Docs: add canvas host usage
This commit is contained in:
@@ -122,6 +122,30 @@ Iris runs a WKWebView “Canvas” scaffold which exposes:
|
||||
- `window.__clawdis.ctx` (2D context)
|
||||
- `window.__clawdis.setStatus(title, subtitle)`
|
||||
|
||||
### Gateway Canvas Host (recommended for web content)
|
||||
|
||||
If you want Iris to show real HTML/CSS/JS that the agent can edit on disk, enable the Gateway canvas host and point Iris at it.
|
||||
|
||||
1) On the gateway host, enable `canvasHost` in `~/.clawdis/clawdis.json`:
|
||||
|
||||
```json5
|
||||
{
|
||||
canvasHost: { enabled: true, root: "~/clawd/canvas", port: 18793, bind: "lan" }
|
||||
}
|
||||
```
|
||||
|
||||
2) Create `~/clawd/canvas/index.html`.
|
||||
|
||||
3) Navigate Iris to it (LAN):
|
||||
|
||||
```bash
|
||||
clawdis nodes invoke --node "iOS Node" --command canvas.navigate --params '{"url":"http://<gateway-hostname>.local:18793/"}'
|
||||
```
|
||||
|
||||
Notes:
|
||||
- The server injects a live-reload client into HTML and reloads on file changes.
|
||||
- iOS may require App Transport Security allowances to load plain `http://` URLs; if it fails to load, prefer HTTPS or adjust the iOS app’s ATS config.
|
||||
|
||||
### Draw with `canvas.eval`
|
||||
|
||||
```bash
|
||||
|
||||
@@ -30,6 +30,7 @@ Non-goals (v1):
|
||||
|
||||
## Current repo reality (constraints we respect)
|
||||
- The Gateway WebSocket server binds to `127.0.0.1:18789` (`src/gateway/server.ts`) with an optional `CLAWDIS_GATEWAY_TOKEN`.
|
||||
- The Gateway can optionally expose a LAN/tailnet Canvas file server (`canvasHost`) so nodes can `canvas.navigate` to `http://<lanHost>:<canvasPort>/` and auto-reload when files change (`docs/configuration.md`).
|
||||
- macOS “Canvas” exists today, but is **mac-only** and controlled via mac app IPC (`clawdis-mac canvas ...`) rather than the Gateway protocol (`docs/mac/canvas.md`).
|
||||
- Voice wake forwards via `GatewayChannel` to Gateway `agent` (mac app: `VoiceWakeForwarder` → `GatewayConnection.sendAgent`).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user