feat(app): M5 step 1, the admin backend under the management app

- datadir: the data folder layout, the location file (JARVIS_DATA_DIR wins),
  free space for the wizard.
- settings_edit: the fields the five settings screens edit; apply writes only
  non-defaults, keeps unknown keys and writes nothing unless the app's own
  check passes. A memory section reaches the worker's hello.
- secrets: config/secrets.dat, DPAPI for the Windows user; the services take
  the bot token from it before JARVIS_DISCORD_TOKEN.
- logs: the log hub behind the log screen (tabs, daily files kept 14 days,
  the recent error report, a zip under 10 MB, secrets and token-shaped text
  masked); the log macros and the worker's output feed it.

Spec: app/src/admin.spec.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-12 13:35:59 +09:00
parent 07c701be54
commit 390f6f0b86
18 changed files with 1457 additions and 19 deletions

View File

@@ -35,6 +35,8 @@ pub struct WorkerClientOptions {
pub audio: PcmFormat,
pub tts: PcmFormat,
pub stt: Map<String, Value>,
/// The worker's memory settings, sent in `hello` (voice_worker.spec.md).
pub memory: Map<String, Value>,
/// First reconnect delay; doubles up to `max_backoff`.
pub backoff: Duration,
pub max_backoff: Duration,
@@ -49,6 +51,7 @@ impl WorkerClientOptions {
audio: DISCORD_PCM,
tts: DISCORD_PCM,
stt: Map::new(),
memory: Map::new(),
backoff: Duration::from_millis(500),
max_backoff: Duration::from_secs(5),
hello_timeout: Duration::from_secs(5),
@@ -436,9 +439,12 @@ async fn connect_once(inner: &Arc<Inner>) -> bool {
let (mut write, mut read) = ws.split();
let stt = inner.state.lock().unwrap().stt.clone();
let o = &inner.opts;
let hello = json!({"type": "hello", "token": o.token,
let mut hello = json!({"type": "hello", "token": o.token,
"audio": {"rate": o.audio.rate, "channels": o.audio.channels},
"tts": {"rate": o.tts.rate, "channels": o.tts.channels}, "stt": stt});
if !o.memory.is_empty() {
hello["memory"] = Value::Object(o.memory.clone());
}
if write.send(Message::text(hello.to_string())).await.is_err() {
return false;
}