Split desktop store actions into domain factories and decompose store helpers into runtime, persistence, transcript, control socket, and thread reducer modules while preserving public store APIs.
Extract TUI sync event/model-stream/socket lifecycle modules, split Electron IPC registration by concern with shared trusted invoke helpers, and keep public entrypoints stable.
Refactor SessionDb internals into repository/migrations/legacy import/file hardening layers and split MCP auth/config registry into parser/store/editor/layer modules with compatibility facades and shared config path resolution.
Validated with targeted cross-area suites and full bun test (all passing; remote MCP tests skipped).
Co-authored-by: Codex <noreply@openai.com>