Connect stdiod to multiple backend profiles

MI
1d ago
+595-105

Summary

  • Run one WebSocket session per backend profile in a single stdiod process. Keep credentials, status, and child processes scoped to their profile.
  • Add --profile to login, logout, status, server, and keep-awake commands. The running daemon discovers new profiles automatically.
  • Preserve named sign-ins when the desktop app resets its default account. Explicit uninstall --purge still removes all profiles.

Verification

  • Rust workspace tests (205 passed), formatting, and Clippy.
  • Integration coverage for two concurrent sessions, profile discovery, and isolated logout.
  • Verified the demo and dashboard backends connected simultaneously on a Mac under one daemon PID.

Summary by cubic

Connects stdiod to multiple backends from a single daemon process, with one WebSocket session per named profile.

  • Adds --profile to login, logout, status, keep-awake, and server; commands without it still use the default sign-in.
  • Runs the daemon as a per-profile orchestrator (daemon_profiles) that discovers and respawns backend sessions; tunnel handling stays in daemon::run_backend, and session tasks are aborted cleanly on shutdown.
  • Keeps backend setup errors isolated to their profiles so one failing backend cannot take down the others.
  • Desktop resetStdiod preserves named profiles (previously --purge wiped them); explicit uninstall --purge still removes everything, with --keep-profiles opting into preservation.
  • Profile names are 1–48 lowercase letters, digits, or hyphens, starting with a letter.