refactor: serve canvas host on gateway port

This commit is contained in:
Peter Steinberger
2025-12-20 17:13:36 +01:00
parent ba85f4a62a
commit 65329496a7
21 changed files with 404 additions and 153 deletions

View File

@@ -157,6 +157,21 @@ Example:
}
```
### `skillsInstall` (installer preference)
Controls which installer is surfaced by the macOS Skills UI when a skill offers
multiple install options (brew vs node). Defaults to **brew when available** and
**npm** for node installs.
```json5
{
skillsInstall: {
preferBrew: true,
nodeManager: "npm" // npm | pnpm | bun
}
}
```
### `skillsLoad`
Additional skill directories to scan (lowest precedence). This is useful if you keep skills in a separate repo but want Clawdis to pick them up without copying them into the workspace.
@@ -216,29 +231,33 @@ Defaults:
Notes:
- `clawdis gateway` refuses to start unless `gateway.mode` is set to `local` (or you pass the override flag).
### `canvasHost` (LAN/tailnet Canvas file server + live reload)
### `canvasHost` (Gateway Canvas file server + live reload)
The Gateway serves a directory of HTML/CSS/JS over HTTP so iOS/Android nodes can simply `canvas.navigate` to it.
The Gateway serves a directory of HTML/CSS/JS over HTTP so iOS/Android nodes can `canvas.navigate` to it.
Default root: `~/clawd/canvas`
Default port: `18793` (chosen to avoid the clawd browser CDP port `18792`)
The server listens on `0.0.0.0` so it works on LAN **and** Tailnet (Tailscale is optional).
Port: **same as the Gateway WebSocket/HTTP port** (default `18789`)
Path: `/__clawdis__/canvas/`
Live-reload WebSocket: `/__clawdis/ws`
The server:
- serves files under `canvasHost.root`
- injects a tiny live-reload client into served HTML
- watches the directory and broadcasts reloads over a WebSocket endpoint at `/__clawdis/ws`
- watches the directory and broadcasts reloads over `/__clawdis/ws`
- auto-creates a starter `index.html` when the directory is empty (so you see something immediately)
```json5
{
canvasHost: {
root: "~/clawd/canvas",
port: 18793
root: "~/clawd/canvas"
}
}
```
Notes:
- `canvasHost.port` is deprecated/ignored (the Gateway port is always used).
- The bind host follows `gateway.bind` (loopback/lan/tailnet).
Disable with:
- config: `canvasHost: { enabled: false }`
- env: `CLAWDIS_SKIP_CANVAS_HOST=1`