gateway: drop ipc and simplify cli

This commit is contained in:
Peter Steinberger
2025-12-09 20:18:50 +00:00
parent d33a3f619a
commit 131864b940
11 changed files with 133 additions and 548 deletions

View File

@@ -127,10 +127,11 @@ Enable with `systemctl enable --now clawdis-gateway.service`.
- Graceful shutdown: emit `shutdown` event before closing; clients must handle close + reconnect.
## CLI helpers
- `clawdis gw:health` / `gw:status` — request health/status over the Gateway WS.
- `clawdis gw:send --to <num> --message "hi" [--media-url ...]` — send via Gateway (idempotent).
- `clawdis gw:agent --message "hi" [--to ...]` — run an agent turn (waits for final by default).
- `clawdis gw:call <method> --params '{"k":"v"}'` — raw method invoker for debugging.
- `clawdis gateway health|status` — request health/status over the Gateway WS.
- `clawdis gateway send --to <num> --message "hi" [--media-url ...]` — send via Gateway (idempotent).
- `clawdis gateway agent --message "hi" [--to ...]` — run an agent turn (waits for final by default).
- `clawdis gateway call <method> --params '{"k":"v"}'` — raw method invoker for debugging.
- All gateway helpers accept `--spawn-gateway` to start a local gateway if none is listening on `--url`.
## Migration guidance
- Retire uses of `clawdis gateway` and the legacy TCP control port.

View File

@@ -103,7 +103,7 @@ Goal: replace legacy gateway/stdin/TCP control with a single WebSocket Gateway,
- Remove immediate `health/system-presence` fetch on connect. ✅ presence hydrated from snapshot; periodic refresh kept as fallback.
- Handle `hello-error` and retry with backoff if version/token mismatched. ✅ macOS GatewayChannel reconnects with exponential backoff.
- **CLI**:
- Add lightweight WS client helper for `status/health/send/agent` when Gateway is up. ✅ `gw:*` commands use the Gateway over WS.
- Add lightweight WS client helper for `status/health/send/agent` when Gateway is up. ✅ `gateway` subcommands use the Gateway over WS.
- Consider a “local only” flag to avoid accidental remote connects. (optional; not needed with tunnel-first model.)
- **WebChat backend**:
- Single WS to Gateway; seed UI from snapshot; forward `presence/tick/agent` to browser. ✅ implemented via `GatewayClient` in `webchat/server.ts`.