From a40e56bcb72c235455be84e505690fff3e536a6b Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 8 Dec 2025 14:15:03 +0000 Subject: [PATCH] Docs: webchat now served in-process, no CLI spawn --- docs/mac/remote.md | 4 ++-- docs/mac/webchat.md | 2 +- docs/webchat.md | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/mac/remote.md b/docs/mac/remote.md index 14ddc5d9a..b9864c0b6 100644 --- a/docs/mac/remote.md +++ b/docs/mac/remote.md @@ -24,7 +24,7 @@ This flow lets the macOS app act as a full remote control for a Clawdis relay ru ## Web Chat over SSH - The relay hosts a loopback-only HTTP server (default 18788, see `webchat.port`). -- The mac app forwards `127.0.0.1:` over SSH (`ssh -L :127.0.0.1:`), then loads `/webchat/?session=` in-app. +- The mac app forwards `127.0.0.1:` over SSH (`ssh -L :127.0.0.1:`), then loads `/webchat/?session=` in-app. Sends go in-process on the relay (no CLI spawn/PATH issues). - Keep the feature enabled in *Settings → Config → Web chat*. Disable it to hide the menu entry entirely. ## Permissions @@ -38,7 +38,7 @@ This flow lets the macOS app act as a full remote control for a Clawdis relay ru ## Troubleshooting - **exit 127 / not found**: `clawdis` isn’t on PATH for non-login shells. Add it to `/etc/paths`, your shell rc, or symlink into `/usr/local/bin`/`/opt/homebrew/bin`. - **Health probe failed**: check SSH reachability, PATH, and that Baileys is logged in (`clawdis status --json`). -- **Web Chat stuck**: confirm the relay is running on the remote host and `webchat.enabled` is true; ensure the forwarded port matches *Settings → Config*. +- **Web Chat stuck**: confirm the relay is running on the remote host and `webchat.enabled` is true; ensure the forwarded port matches *Settings → Config*. Since RPC is in-process, PATH is no longer a factor. - **Voice Wake**: trigger phrases are forwarded automatically in remote mode; no separate forwarder is needed. ## Notification sounds diff --git a/docs/mac/webchat.md b/docs/mac/webchat.md index ab4ef0e71..9eeb833c4 100644 --- a/docs/mac/webchat.md +++ b/docs/mac/webchat.md @@ -10,7 +10,7 @@ The macOS menu bar app opens the relay’s loopback web chat server in a WKWebVi ## How it’s wired - Assets: `apps/macos/Sources/Clawdis/Resources/WebChat/` contains the `pi-web-ui` dist plus a local import map pointing at bundled vendor modules and a tiny `pi-ai` stub. Everything is served from the relay at `/webchat/*`. -- Bridge: none. The web UI calls `/webchat/rpc` directly; Swift no longer proxies messages. +- Bridge: none. The web UI calls `/webchat/rpc` directly; Swift no longer proxies messages. RPC is handled in-process inside the relay (no CLI spawn/PATH dependency). - Session: always primary; multiple transports (WhatsApp/Telegram/Desktop) share the same session key so context is unified. ## Security / surface area diff --git a/docs/webchat.md b/docs/webchat.md index d85a62225..c36ddb5da 100644 --- a/docs/webchat.md +++ b/docs/webchat.md @@ -7,7 +7,7 @@ Updated: 2025-12-08 - Endpoints: - `GET /webchat/info?session=` → `{port, sessionId, initialMessages, basePath}` plus history from the relay’s session store. - `GET /webchat/*` → static Web Chat assets. - - `POST /webchat/rpc` → runs `clawdis agent --json` and returns `{ ok, payloads?, error? }`. + - `POST /webchat/rpc` → runs the agent in-process and returns `{ ok, payloads?, error? }` (no CLI spawn, no PATH dependency). - The macOS app simply loads `http://127.0.0.1:/webchat/?session=` (or the SSH-forwarded port in remote mode). No Swift bridge is used for sends; all chat traffic stays inside the Node relay. - Initial messages are fetched from `/webchat/info`, so history appears immediately. - Enable/disable via `webchat.enabled` (default **true**); set the port with `webchat.port`. @@ -24,6 +24,7 @@ Updated: 2025-12-08 - Static assets stay in `apps/macos/Sources/Clawdis/Resources/WebChat`; the server reads them directly. - Server code: `src/webchat/server.ts`. - CLI entrypoint (optional): `clawdis webchat --json [--port N]` to query/start manually. +- RPC send path is in-process; the relay does not spawn `clawdis` or rely on PATH. - Mac glue: `WebChatWindow.swift` (bootstrap + tunnel) and `WebChatTunnel` (SSH -L). ## TODO / nice-to-haves