feat(dashboard): 4-way roster (user/bot/voice/role), persistence, TTS all-emotions, layout

- 유저 등록/관리 search now has 4 types: 유저(non-bot members), 봇(bot members),
  통화방(current voice-channel members, bot flag enriched), 역할(roles — expandable
  to the members under each role; register the role OR a member under it).
- Persist settings to a JSON state store (WSAI_STATE_FILE, default
  ~/.config/wsai/state.json) so they survive a service/container restart:
  per-guild listen lists + bargeIn (BotControl), TTS base/overrides and the
  chosen STT/LLM models (Dashboard). Applied on voice-server startup before warm.
- TTS 감정 선택에 최상단 "전체변경 (모든 감정)" 추가: 적용하면 base를 그 값으로 세팅하고
  모든 per-emotion override를 지워 전 감정이 한 번에 그 값으로 말합니다.
- Move the component status bar (눈/시각/귀/LLM/입) above the bot bar.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-08-27 00:14:24 +09:00
parent 0588ee21ac
commit c39b47cfd3
5 changed files with 189 additions and 27 deletions

View File

@@ -31,10 +31,13 @@ class BotControl:
self._cmd_id = 0
# Per-guild listen filter. Empty whitelist => listen to everyone;
# blacklist always excludes. Users and roles both supported.
self._lists: dict[str, dict[str, Any]] = {}
# Restored from the persistent state store so it survives a restart.
from . import state_store
st = state_store.load()
self._lists: dict[str, dict[str, Any]] = st.get("lists") or {}
# Bot behaviour settings the dashboard toggles and the bot reads on each
# report. bargeIn: stop the bot's current TTS the moment a user speaks.
self._settings: dict[str, Any] = {"bargeIn": True}
self._settings: dict[str, Any] = {"bargeIn": True, **(st.get("botSettings") or {})}
# -- bot behaviour settings ------------------------------------------ #
def get_settings(self) -> dict[str, Any]:
@@ -45,7 +48,10 @@ class BotControl:
with self._lock:
if "bargeIn" in data:
self._settings["bargeIn"] = bool(data["bargeIn"])
return dict(self._settings)
out = dict(self._settings)
from . import state_store
state_store.patch("botSettings", out)
return out
# -- whitelist / blacklist (per guild) ------------------------------- #
@staticmethod
@@ -72,6 +78,9 @@ class BotControl:
]
with self._lock:
self._lists[guild_id] = clean
snapshot = {g: dict(v) for g, v in self._lists.items()}
from . import state_store
state_store.patch("lists", snapshot) # persist per-guild lists across restarts
return clean
# -- bot -> dashboard (state push) ----------------------------------- #