1.5 KiB
1.5 KiB
Web Chat (macOS menu bar)
The macOS Clawdis app ships a built-in web chat window that reuses your primary Clawd session instead of creating a new one. This is meant for quick desktop access without exposing any local HTTP ports.
How it works
- UI:
pi-mono/packages/web-uibundle loaded in aWKWebView. - Bridge:
WKScriptMessageHandlernamedclawdis(seeapps/macos/Sources/Clawdis/WebChatWindow.swift). The page postssessionKey+ message; Swift shellspnpm clawdis agent --to <sessionKey> --message <text> --jsonand returns the first payload text to the page. No sockets are opened. - Session selection: picks the most recently updated entry in
~/.clawdis/sessions/sessions.json; falls back to+1003if none exist. This keeps the web chat on the same primary conversation as the relay/CLI. - Assets: currently loads
pi-web-uidirectly from../pi-mono/packages/web-ui/diston disk. (We should copy it into the app bundle in a future step.)
Requirements
pnpmon PATH.pnpm installalready run in the repo sopnpm clawdis agent ...works.pi-monochecked out at../pi-monowithpackages/web-ui/distbuilt.
Limitations / TODO
- Single-turn (no streaming), text-only; attachments/tools not wired yet.
- Absolute dist path; bundle should be copied into app resources and versioned.
- Errors from the agent subprocess are minimally surfaced.
Usage
- Launch the macOS Clawdis menu bar app, click the lobster icon → “Open Web Chat”.
- Type and send; replies continue the primary Clawd session.