Eliminate unsafe `as any` casts across 21 non-test source files,
replacing them with specific type annotations:
- Bridge transport: use StdoutMessage type for write/writeBatch calls
- print.ts: type msg.request as Record<string, unknown> for unknown
SDK control subtypes; use StdoutMessage for output.enqueue()
- API providers (openai/grok/gemini): import ChatCompletion types,
type streams as AsyncIterable<ChatCompletionChunk>, type request
bodies as ChatCompletionCreateParamsStreaming
- Computer use executor: use Partial<ResolvePrepareCaptureResult>
for cross-platform screenshot result
- Components: replace Ink color string casts with proper typing
- Win32 bridge: type stdin as Writable after null check
All 2453 tests pass with 0 failures.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reverse-engineer the missing daemon + remoteControlServer implementation
by tracing the call chain from existing code:
- src/daemon/main.ts: restore from stub to full supervisor (spawn/monitor
workers, exponential backoff restart, graceful shutdown)
- src/daemon/workerRegistry.ts: restore from stub to worker dispatcher
(remoteControl kind → runBridgeHeadless())
- src/commands/remoteControlServer/: new slash command /remote-control-server
(alias /rcs) for managing the daemon from REPL
- build.ts + scripts/dev.ts: enable DAEMON feature flag
Both official CLI 2.1.92 and our codebase had the command registered in
commands.ts but the directory and daemon implementation were missing.
The bottom layer (runBridgeHeadless in bridgeMain.ts) was already complete.
Co-authored-by: unraid <local@unraid.local>