diff --git a/docs/control-api.md b/docs/control-api.md deleted file mode 100644 index 936065444..000000000 --- a/docs/control-api.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -summary: "Deprecated newline-delimited control channel API (pre-gateway)" -read_when: - - Maintaining legacy control channel support ---- -# Control channel API (newline-delimited JSON) - -**Deprecated (historical):** superseded by the WebSocket Gateway protocol (`clawdbot gateway`, see [`docs/architecture.md`](https://docs.clawd.bot/architecture) and [`docs/gateway.md`](https://docs.clawd.bot/gateway)). -Current builds use a WebSocket server on `ws://127.0.0.1:18789` and do **not** expose this TCP control channel. - -Legacy endpoint (if present in an older build): `127.0.0.1:18789` (TCP, localhost only), typically reached via SSH port forward in remote mode. - -## Frame format -Each line is a JSON object. Two shapes exist: -- **Request**: `{ "type": "request", "id": "", "method": "health" | "status" | "last-heartbeat" | "set-heartbeats" | "ping", "params"?: { ... } }` -- **Response**: `{ "type": "response", "id": "", "ok": true, "payload"?: { ... } }` or `{ "type": "response", "id": "", "ok": false, "error": "message" }` -- **Event**: `{ "type": "event", "event": "heartbeat" | "gateway-status" | "log", "payload": { ... } }` - -## Methods -- `ping`: sanity check. Payload: `{ pong: true, ts }`. -- `health`: returns the gateway health snapshot (same shape as `clawdbot health --json`). -- `status`: shorter summary (linked/authAge/heartbeatSeconds, session counts). -- `last-heartbeat`: returns the most recent heartbeat event the gateway has seen. -- `set-heartbeats { enabled: boolean }`: toggle heartbeat scheduling. - -## Events -- `heartbeat` payload: - ```json - { - "ts": 1765224052664, - "status": "sent" | "ok-empty" | "ok-token" | "skipped" | "failed", - "to": "+15551234567", - "preview": "Heartbeat OK", - "hasMedia": false, - "durationMs": 1025, - "reason": "" // only on failed/skipped - } - ``` -- `gateway-status` payload: `{ "state": "starting" | "running" | "restarting" | "failed" | "stopped", "pid"?: number, "reason"?: string }` -- `log` payload: arbitrary log line; optional, can be disabled. - -## Suggested client flow -1) Connect (or reconnect) → send `ping`. -2) Send `health` and `last-heartbeat` to populate UI. -3) Listen for `event` frames; update UI in real time. -4) For user toggles, send `set-heartbeats` and await response. - -## Backward compatibility -- If the control channel is unavailable: that’s expected on modern builds. Use the Gateway WS protocol instead. diff --git a/docs/hubs.md b/docs/hubs.md index 64de4086e..f53c85a5f 100644 --- a/docs/hubs.md +++ b/docs/hubs.md @@ -66,7 +66,6 @@ Use these hubs to discover every page, including deep dives and reference docs t - [Logging](https://docs.clawd.bot/logging) - [Dashboard](https://docs.clawd.bot/dashboard) - [Control UI](https://docs.clawd.bot/control-ui) -- [Control API (legacy)](https://docs.clawd.bot/control-api) - [Remote access](https://docs.clawd.bot/remote) - [Remote gateway README](https://docs.clawd.bot/remote-gateway-readme) - [Tailscale](https://docs.clawd.bot/tailscale) diff --git a/docs/remote.md b/docs/remote.md index 4c366f695..fd43e6355 100644 --- a/docs/remote.md +++ b/docs/remote.md @@ -59,8 +59,3 @@ WebChat no longer uses a separate HTTP port. The SwiftUI chat UI connects direct The macOS menu bar app can drive the same setup end-to-end (remote status checks, WebChat, and Voice Wake forwarding). Runbook: [`docs/mac/remote.md`](https://docs.clawd.bot/mac/remote). - -## Legacy control channel - -Older builds experimented with a newline-delimited TCP control channel on the same port. -That API is deprecated and should not be relied on. (Historical reference: [`docs/control-api.md`](https://docs.clawd.bot/control-api).)