clawdbot 2026.1.4-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +120 -0
- package/LICENSE +21 -0
- package/README-header.png +0 -0
- package/README.md +297 -0
- package/dist/agents/agent-paths.js +17 -0
- package/dist/agents/bash-process-registry.js +126 -0
- package/dist/agents/bash-tools.js +837 -0
- package/dist/agents/clawdbot-tools.js +30 -0
- package/dist/agents/clawdis-tools.js +27 -0
- package/dist/agents/context.js +34 -0
- package/dist/agents/defaults.js +6 -0
- package/dist/agents/model-auth.js +112 -0
- package/dist/agents/model-catalog.js +55 -0
- package/dist/agents/model-fallback.js +191 -0
- package/dist/agents/model-scan.js +263 -0
- package/dist/agents/model-selection.js +116 -0
- package/dist/agents/models-config.js +49 -0
- package/dist/agents/pi-embedded-helpers.js +74 -0
- package/dist/agents/pi-embedded-runner.js +407 -0
- package/dist/agents/pi-embedded-subscribe.js +568 -0
- package/dist/agents/pi-embedded-utils.js +20 -0
- package/dist/agents/pi-embedded.js +1 -0
- package/dist/agents/pi-oauth.js +88 -0
- package/dist/agents/pi-tools.js +433 -0
- package/dist/agents/sandbox-paths.js +68 -0
- package/dist/agents/sandbox.js +644 -0
- package/dist/agents/shell-utils.js +53 -0
- package/dist/agents/skills-install.js +244 -0
- package/dist/agents/skills-status.js +157 -0
- package/dist/agents/skills.js +470 -0
- package/dist/agents/steerable-agent-loop.js +338 -0
- package/dist/agents/steerable-provider-transport.js +48 -0
- package/dist/agents/system-prompt.js +104 -0
- package/dist/agents/tool-display.js +162 -0
- package/dist/agents/tool-images.js +138 -0
- package/dist/agents/tools/browser-tool.js +339 -0
- package/dist/agents/tools/canvas-tool.js +193 -0
- package/dist/agents/tools/common.js +88 -0
- package/dist/agents/tools/cron-tool.js +124 -0
- package/dist/agents/tools/discord-actions-guild.js +186 -0
- package/dist/agents/tools/discord-actions-messaging.js +285 -0
- package/dist/agents/tools/discord-actions-moderation.js +70 -0
- package/dist/agents/tools/discord-actions.js +56 -0
- package/dist/agents/tools/discord-schema.js +199 -0
- package/dist/agents/tools/discord-tool.js +16 -0
- package/dist/agents/tools/gateway-tool.js +46 -0
- package/dist/agents/tools/gateway.js +27 -0
- package/dist/agents/tools/image-tool.js +132 -0
- package/dist/agents/tools/nodes-tool.js +413 -0
- package/dist/agents/tools/nodes-utils.js +92 -0
- package/dist/agents/tools/sessions-helpers.js +88 -0
- package/dist/agents/tools/sessions-history-tool.js +53 -0
- package/dist/agents/tools/sessions-list-tool.js +143 -0
- package/dist/agents/tools/sessions-send-helpers.js +100 -0
- package/dist/agents/tools/sessions-send-tool.js +347 -0
- package/dist/agents/tools/slack-actions.js +129 -0
- package/dist/agents/tools/slack-schema.js +59 -0
- package/dist/agents/tools/slack-tool.js +16 -0
- package/dist/agents/usage.js +39 -0
- package/dist/agents/workspace.js +241 -0
- package/dist/auto-reply/chunk.js +76 -0
- package/dist/auto-reply/envelope.js +38 -0
- package/dist/auto-reply/group-activation.js +20 -0
- package/dist/auto-reply/heartbeat.js +57 -0
- package/dist/auto-reply/model.js +14 -0
- package/dist/auto-reply/reply/abort.js +14 -0
- package/dist/auto-reply/reply/agent-runner.js +371 -0
- package/dist/auto-reply/reply/block-streaming.js +34 -0
- package/dist/auto-reply/reply/body.js +29 -0
- package/dist/auto-reply/reply/commands.js +207 -0
- package/dist/auto-reply/reply/directive-handling.js +361 -0
- package/dist/auto-reply/reply/directives.js +47 -0
- package/dist/auto-reply/reply/followup-runner.js +149 -0
- package/dist/auto-reply/reply/groups.js +91 -0
- package/dist/auto-reply/reply/mentions.js +38 -0
- package/dist/auto-reply/reply/model-selection.js +114 -0
- package/dist/auto-reply/reply/queue.js +399 -0
- package/dist/auto-reply/reply/reply-tags.js +26 -0
- package/dist/auto-reply/reply/session-updates.js +87 -0
- package/dist/auto-reply/reply/session.js +160 -0
- package/dist/auto-reply/reply/typing.js +75 -0
- package/dist/auto-reply/reply.js +535 -0
- package/dist/auto-reply/send-policy.js +28 -0
- package/dist/auto-reply/status.js +158 -0
- package/dist/auto-reply/templating.js +9 -0
- package/dist/auto-reply/thinking.js +49 -0
- package/dist/auto-reply/tokens.js +2 -0
- package/dist/auto-reply/tool-meta.js +74 -0
- package/dist/auto-reply/transcription.js +57 -0
- package/dist/auto-reply/types.js +1 -0
- package/dist/browser/bridge-server.js +37 -0
- package/dist/browser/cdp.js +382 -0
- package/dist/browser/chrome.js +432 -0
- package/dist/browser/client-actions-core.js +67 -0
- package/dist/browser/client-actions-observe.js +24 -0
- package/dist/browser/client-actions-types.js +1 -0
- package/dist/browser/client-actions.js +3 -0
- package/dist/browser/client-fetch.js +43 -0
- package/dist/browser/client.js +105 -0
- package/dist/browser/config.js +140 -0
- package/dist/browser/constants.js +4 -0
- package/dist/browser/profiles-service.js +122 -0
- package/dist/browser/profiles.js +85 -0
- package/dist/browser/pw-ai.js +2 -0
- package/dist/browser/pw-session.js +144 -0
- package/dist/browser/pw-tools-core.js +363 -0
- package/dist/browser/routes/agent.js +535 -0
- package/dist/browser/routes/basic.js +155 -0
- package/dist/browser/routes/index.js +8 -0
- package/dist/browser/routes/tabs.js +105 -0
- package/dist/browser/routes/utils.js +62 -0
- package/dist/browser/screenshot.js +40 -0
- package/dist/browser/server-context.js +377 -0
- package/dist/browser/server.js +81 -0
- package/dist/browser/target-id.js +18 -0
- package/dist/browser/trash.js +21 -0
- package/dist/canvas-host/a2ui/.bundle.hash +1 -0
- package/dist/canvas-host/a2ui/a2ui.bundle.js +17768 -0
- package/dist/canvas-host/a2ui/index.html +246 -0
- package/dist/canvas-host/a2ui.js +187 -0
- package/dist/canvas-host/server.js +382 -0
- package/dist/cli/browser-cli-actions-input.js +459 -0
- package/dist/cli/browser-cli-actions-observe.js +56 -0
- package/dist/cli/browser-cli-examples.js +31 -0
- package/dist/cli/browser-cli-inspect.js +97 -0
- package/dist/cli/browser-cli-manage.js +286 -0
- package/dist/cli/browser-cli-shared.js +1 -0
- package/dist/cli/browser-cli.js +26 -0
- package/dist/cli/canvas-cli.js +416 -0
- package/dist/cli/cron-cli.js +454 -0
- package/dist/cli/deps.js +17 -0
- package/dist/cli/dns-cli.js +180 -0
- package/dist/cli/gateway-cli.js +489 -0
- package/dist/cli/gateway-rpc.js +20 -0
- package/dist/cli/hooks-cli.js +135 -0
- package/dist/cli/models-cli.js +248 -0
- package/dist/cli/nodes-camera.js +57 -0
- package/dist/cli/nodes-canvas.js +26 -0
- package/dist/cli/nodes-cli.js +946 -0
- package/dist/cli/nodes-screen.js +37 -0
- package/dist/cli/parse-duration.js +20 -0
- package/dist/cli/ports.js +97 -0
- package/dist/cli/program.js +406 -0
- package/dist/cli/prompt.js +19 -0
- package/dist/cli/tui-cli.js +35 -0
- package/dist/cli/wait.js +8 -0
- package/dist/commands/agent.js +645 -0
- package/dist/commands/antigravity-oauth.js +327 -0
- package/dist/commands/configure.js +480 -0
- package/dist/commands/doctor.js +484 -0
- package/dist/commands/health.js +108 -0
- package/dist/commands/models/aliases.js +64 -0
- package/dist/commands/models/fallbacks.js +99 -0
- package/dist/commands/models/image-fallbacks.js +99 -0
- package/dist/commands/models/list.js +323 -0
- package/dist/commands/models/scan.js +266 -0
- package/dist/commands/models/set-image.js +23 -0
- package/dist/commands/models/set.js +23 -0
- package/dist/commands/models/shared.js +72 -0
- package/dist/commands/models.js +7 -0
- package/dist/commands/onboard-auth.js +70 -0
- package/dist/commands/onboard-helpers.js +295 -0
- package/dist/commands/onboard-interactive.js +17 -0
- package/dist/commands/onboard-non-interactive.js +202 -0
- package/dist/commands/onboard-providers.js +634 -0
- package/dist/commands/onboard-remote.js +120 -0
- package/dist/commands/onboard-skills.js +148 -0
- package/dist/commands/onboard-types.js +1 -0
- package/dist/commands/onboard.js +12 -0
- package/dist/commands/send.js +124 -0
- package/dist/commands/sessions.js +212 -0
- package/dist/commands/setup.js +58 -0
- package/dist/commands/signal-install.js +135 -0
- package/dist/commands/status.js +207 -0
- package/dist/commands/update.js +16 -0
- package/dist/config/config.js +6 -0
- package/dist/config/defaults.js +61 -0
- package/dist/config/io.js +147 -0
- package/dist/config/legacy-migrate.js +13 -0
- package/dist/config/legacy.js +159 -0
- package/dist/config/paths.js +71 -0
- package/dist/config/schema.js +150 -0
- package/dist/config/sessions.js +282 -0
- package/dist/config/talk.js +31 -0
- package/dist/config/types.js +1 -0
- package/dist/config/validation.js +29 -0
- package/dist/config/zod-schema.js +831 -0
- package/dist/control-ui/assets/index-BFID3yAA.css +1 -0
- package/dist/control-ui/assets/index-CE_axlTS.js +2235 -0
- package/dist/control-ui/assets/index-CE_axlTS.js.map +1 -0
- package/dist/control-ui/index.html +15 -0
- package/dist/cron/isolated-agent.js +499 -0
- package/dist/cron/run-log.js +72 -0
- package/dist/cron/schedule.js +24 -0
- package/dist/cron/service.js +471 -0
- package/dist/cron/store.js +43 -0
- package/dist/cron/types.js +1 -0
- package/dist/daemon/constants.js +10 -0
- package/dist/daemon/launchd.js +276 -0
- package/dist/daemon/legacy.js +63 -0
- package/dist/daemon/program-args.js +76 -0
- package/dist/daemon/schtasks.js +257 -0
- package/dist/daemon/service.js +60 -0
- package/dist/daemon/systemd.js +266 -0
- package/dist/discord/index.js +2 -0
- package/dist/discord/monitor.js +1188 -0
- package/dist/discord/probe.js +54 -0
- package/dist/discord/send.js +577 -0
- package/dist/discord/token.js +8 -0
- package/dist/gateway/auth.js +121 -0
- package/dist/gateway/call.js +94 -0
- package/dist/gateway/chat-attachments.js +41 -0
- package/dist/gateway/client.js +180 -0
- package/dist/gateway/config-reload.js +274 -0
- package/dist/gateway/control-ui.js +184 -0
- package/dist/gateway/hooks-mapping.js +282 -0
- package/dist/gateway/hooks.js +168 -0
- package/dist/gateway/net.js +29 -0
- package/dist/gateway/protocol/index.js +61 -0
- package/dist/gateway/protocol/schema.js +560 -0
- package/dist/gateway/server-bridge-subscriptions.js +93 -0
- package/dist/gateway/server-bridge.js +1013 -0
- package/dist/gateway/server-browser.js +12 -0
- package/dist/gateway/server-chat.js +159 -0
- package/dist/gateway/server-constants.js +8 -0
- package/dist/gateway/server-discovery.js +62 -0
- package/dist/gateway/server-http.js +165 -0
- package/dist/gateway/server-methods/agent-job.js +125 -0
- package/dist/gateway/server-methods/agent.js +250 -0
- package/dist/gateway/server-methods/chat.js +200 -0
- package/dist/gateway/server-methods/config.js +50 -0
- package/dist/gateway/server-methods/connect.js +6 -0
- package/dist/gateway/server-methods/cron.js +83 -0
- package/dist/gateway/server-methods/health.js +28 -0
- package/dist/gateway/server-methods/models.js +16 -0
- package/dist/gateway/server-methods/nodes.js +294 -0
- package/dist/gateway/server-methods/providers.js +217 -0
- package/dist/gateway/server-methods/send.js +166 -0
- package/dist/gateway/server-methods/sessions.js +305 -0
- package/dist/gateway/server-methods/skills.js +83 -0
- package/dist/gateway/server-methods/system.js +118 -0
- package/dist/gateway/server-methods/talk.js +22 -0
- package/dist/gateway/server-methods/types.js +1 -0
- package/dist/gateway/server-methods/voicewake.js +30 -0
- package/dist/gateway/server-methods/web.js +58 -0
- package/dist/gateway/server-methods/wizard.js +100 -0
- package/dist/gateway/server-methods.js +53 -0
- package/dist/gateway/server-providers.js +644 -0
- package/dist/gateway/server-shared.js +1 -0
- package/dist/gateway/server-utils.js +35 -0
- package/dist/gateway/server.js +1437 -0
- package/dist/gateway/session-utils.js +216 -0
- package/dist/gateway/ws-log.js +349 -0
- package/dist/gateway/ws-logging.js +8 -0
- package/dist/globals.js +41 -0
- package/dist/hooks/gmail-ops.js +236 -0
- package/dist/hooks/gmail-setup-utils.js +278 -0
- package/dist/hooks/gmail-watcher.js +175 -0
- package/dist/hooks/gmail.js +177 -0
- package/dist/imessage/client.js +165 -0
- package/dist/imessage/index.js +3 -0
- package/dist/imessage/monitor.js +272 -0
- package/dist/imessage/probe.js +26 -0
- package/dist/imessage/send.js +83 -0
- package/dist/imessage/targets.js +176 -0
- package/dist/index.js +50 -0
- package/dist/infra/agent-events.js +46 -0
- package/dist/infra/binaries.js +9 -0
- package/dist/infra/bonjour-discovery.js +163 -0
- package/dist/infra/bonjour.js +200 -0
- package/dist/infra/bridge/server.js +562 -0
- package/dist/infra/canvas-host-url.js +54 -0
- package/dist/infra/env.js +8 -0
- package/dist/infra/errors.js +28 -0
- package/dist/infra/gateway-lock.js +8 -0
- package/dist/infra/heartbeat-events.js +21 -0
- package/dist/infra/heartbeat-runner.js +453 -0
- package/dist/infra/heartbeat-wake.js +61 -0
- package/dist/infra/is-main.js +37 -0
- package/dist/infra/machine-name.js +40 -0
- package/dist/infra/node-pairing.js +211 -0
- package/dist/infra/pam.js +42 -0
- package/dist/infra/path-env.js +92 -0
- package/dist/infra/ports.js +87 -0
- package/dist/infra/provider-summary.js +80 -0
- package/dist/infra/restart.js +29 -0
- package/dist/infra/retry.js +16 -0
- package/dist/infra/runtime-guard.js +59 -0
- package/dist/infra/system-events.js +44 -0
- package/dist/infra/system-presence.js +216 -0
- package/dist/infra/tailnet.js +46 -0
- package/dist/infra/tailscale.js +149 -0
- package/dist/infra/voicewake.js +77 -0
- package/dist/infra/widearea-dns.js +123 -0
- package/dist/infra/ws.js +13 -0
- package/dist/logger.js +52 -0
- package/dist/logging.js +490 -0
- package/dist/macos/gateway-daemon.js +141 -0
- package/dist/macos/relay.js +46 -0
- package/dist/media/constants.js +33 -0
- package/dist/media/host.js +42 -0
- package/dist/media/image-ops.js +121 -0
- package/dist/media/mime.js +115 -0
- package/dist/media/parse.js +81 -0
- package/dist/media/server.js +64 -0
- package/dist/media/store.js +139 -0
- package/dist/process/command-queue.js +97 -0
- package/dist/process/exec.js +75 -0
- package/dist/protocol.schema.json +2918 -0
- package/dist/provider-web.js +8 -0
- package/dist/providers/web/index.js +2 -0
- package/dist/runtime.js +8 -0
- package/dist/sessions/send-policy.js +68 -0
- package/dist/signal/client.js +134 -0
- package/dist/signal/daemon.js +69 -0
- package/dist/signal/index.js +3 -0
- package/dist/signal/monitor.js +336 -0
- package/dist/signal/probe.js +46 -0
- package/dist/signal/send.js +91 -0
- package/dist/slack/actions.js +97 -0
- package/dist/slack/index.js +5 -0
- package/dist/slack/monitor.js +1029 -0
- package/dist/slack/probe.js +47 -0
- package/dist/slack/send.js +131 -0
- package/dist/slack/token.js +10 -0
- package/dist/telegram/bot.js +394 -0
- package/dist/telegram/download.js +34 -0
- package/dist/telegram/index.js +4 -0
- package/dist/telegram/monitor.js +47 -0
- package/dist/telegram/probe.js +63 -0
- package/dist/telegram/proxy.js +9 -0
- package/dist/telegram/send.js +138 -0
- package/dist/telegram/token.js +30 -0
- package/dist/telegram/webhook-set.js +12 -0
- package/dist/telegram/webhook.js +56 -0
- package/dist/tui/commands.js +74 -0
- package/dist/tui/components/assistant-message.js +16 -0
- package/dist/tui/components/chat-log.js +92 -0
- package/dist/tui/components/custom-editor.js +53 -0
- package/dist/tui/components/selectors.js +8 -0
- package/dist/tui/components/tool-execution.js +111 -0
- package/dist/tui/components/user-message.js +17 -0
- package/dist/tui/gateway-chat.js +140 -0
- package/dist/tui/layout.js +41 -0
- package/dist/tui/message-list.js +57 -0
- package/dist/tui/theme/theme.js +80 -0
- package/dist/tui/theme.js +25 -0
- package/dist/tui/tui.js +708 -0
- package/dist/utils.js +133 -0
- package/dist/version.js +18 -0
- package/dist/web/active-listener.js +7 -0
- package/dist/web/auto-reply.js +1203 -0
- package/dist/web/inbound.js +481 -0
- package/dist/web/login-qr.js +204 -0
- package/dist/web/login.js +59 -0
- package/dist/web/media.js +148 -0
- package/dist/web/outbound.js +67 -0
- package/dist/web/qr-image.js +97 -0
- package/dist/web/reconnect.js +60 -0
- package/dist/web/reply-heartbeat-wake.js +61 -0
- package/dist/web/session.js +346 -0
- package/dist/wizard/clack-prompter.js +56 -0
- package/dist/wizard/onboarding.js +452 -0
- package/dist/wizard/prompts.js +6 -0
- package/dist/wizard/session.js +203 -0
- package/docs/AGENTS.default.md +116 -0
- package/docs/CNAME +1 -0
- package/docs/RELEASING.md +64 -0
- package/docs/_config.yml +51 -0
- package/docs/_layouts/default.html +145 -0
- package/docs/agent-send.md +21 -0
- package/docs/agent.md +104 -0
- package/docs/android/connect.md +131 -0
- package/docs/architecture.md +89 -0
- package/docs/assets/markdown.css +130 -0
- package/docs/assets/pixel-lobster.svg +60 -0
- package/docs/assets/terminal.css +497 -0
- package/docs/assets/theme.js +55 -0
- package/docs/audio.md +50 -0
- package/docs/background-process.md +74 -0
- package/docs/bash.md +32 -0
- package/docs/bonjour.md +159 -0
- package/docs/browser.md +289 -0
- package/docs/camera.md +152 -0
- package/docs/clawd.md +199 -0
- package/docs/clawdbot-mac.md +104 -0
- package/docs/configuration.md +1177 -0
- package/docs/control-api.md +49 -0
- package/docs/control-ui.md +83 -0
- package/docs/cron.md +374 -0
- package/docs/dashboard.md +17 -0
- package/docs/device-models.md +46 -0
- package/docs/discord.md +293 -0
- package/docs/discovery.md +112 -0
- package/docs/docker.md +251 -0
- package/docs/docs.json +86 -0
- package/docs/doctor.md +47 -0
- package/docs/elevated.md +31 -0
- package/docs/faq.md +640 -0
- package/docs/gateway/pairing.md +109 -0
- package/docs/gateway-lock.md +28 -0
- package/docs/gateway.md +174 -0
- package/docs/gmail-pubsub.md +191 -0
- package/docs/grammy.md +27 -0
- package/docs/group-messages.md +71 -0
- package/docs/groups.md +78 -0
- package/docs/health.md +28 -0
- package/docs/heartbeat.md +64 -0
- package/docs/images.md +52 -0
- package/docs/imessage.md +63 -0
- package/docs/index.md +182 -0
- package/docs/ios/connect.md +177 -0
- package/docs/ios/spec.md +236 -0
- package/docs/location-command.md +95 -0
- package/docs/logging.md +99 -0
- package/docs/lore.md +131 -0
- package/docs/mac/bun.md +133 -0
- package/docs/mac/canvas.md +161 -0
- package/docs/mac/child-process.md +72 -0
- package/docs/mac/dev-setup.md +81 -0
- package/docs/mac/health.md +28 -0
- package/docs/mac/icon.md +26 -0
- package/docs/mac/logging.md +51 -0
- package/docs/mac/menu-bar.md +69 -0
- package/docs/mac/peekaboo.md +170 -0
- package/docs/mac/permissions.md +40 -0
- package/docs/mac/release.md +76 -0
- package/docs/mac/remote.md +57 -0
- package/docs/mac/signing.md +41 -0
- package/docs/mac/skills.md +27 -0
- package/docs/mac/voice-overlay.md +52 -0
- package/docs/mac/voicewake.md +56 -0
- package/docs/mac/webchat.md +27 -0
- package/docs/mac/xpc.md +40 -0
- package/docs/models.md +90 -0
- package/docs/nix.md +49 -0
- package/docs/nodes.md +157 -0
- package/docs/onboarding-config-protocol.md +29 -0
- package/docs/onboarding.md +185 -0
- package/docs/presence.md +133 -0
- package/docs/queue.md +78 -0
- package/docs/refactor/browser-control-simplification.md +58 -0
- package/docs/refactor/canvas-a2ui.md +93 -0
- package/docs/refactor/cli-unification.md +64 -0
- package/docs/refactor/gateway-client.md +31 -0
- package/docs/refactor/gateway.md +99 -0
- package/docs/refactor/new-arch.md +171 -0
- package/docs/refactor/tui.md +26 -0
- package/docs/refactor/web-gateway-troubleshooting.md +37 -0
- package/docs/refactor/webagent-session.md +46 -0
- package/docs/remote-gateway-readme.md +148 -0
- package/docs/remote.md +66 -0
- package/docs/research/memory.md +227 -0
- package/docs/rpc.md +35 -0
- package/docs/security.md +168 -0
- package/docs/session-tool.md +119 -0
- package/docs/session.md +84 -0
- package/docs/sessions.md +8 -0
- package/docs/setup.md +118 -0
- package/docs/signal.md +113 -0
- package/docs/skills-config.md +58 -0
- package/docs/skills.md +149 -0
- package/docs/slack.md +158 -0
- package/docs/surface.md +20 -0
- package/docs/tailscale.md +71 -0
- package/docs/talk.md +79 -0
- package/docs/telegram.md +90 -0
- package/docs/templates/AGENTS.md +126 -0
- package/docs/templates/BOOTSTRAP.md +53 -0
- package/docs/templates/IDENTITY.md +17 -0
- package/docs/templates/SOUL.md +41 -0
- package/docs/templates/TOOLS.md +41 -0
- package/docs/templates/USER.md +22 -0
- package/docs/test.md +35 -0
- package/docs/thinking.md +46 -0
- package/docs/tools.md +248 -0
- package/docs/troubleshooting.md +227 -0
- package/docs/tui.md +69 -0
- package/docs/typebox.md +42 -0
- package/docs/voicewake.md +61 -0
- package/docs/web.md +115 -0
- package/docs/webchat.md +34 -0
- package/docs/webhook.md +132 -0
- package/docs/whatsapp-clawd.jpg +0 -0
- package/docs/whatsapp.md +142 -0
- package/docs/wizard.md +158 -0
- package/package.json +186 -0
- package/skills/apple-notes/SKILL.md +50 -0
- package/skills/apple-reminders/SKILL.md +67 -0
- package/skills/bear-notes/SKILL.md +79 -0
- package/skills/bird/SKILL.md +25 -0
- package/skills/blogwatcher/SKILL.md +46 -0
- package/skills/blucli/SKILL.md +27 -0
- package/skills/brave-search/SKILL.md +30 -0
- package/skills/brave-search/scripts/content.mjs +53 -0
- package/skills/brave-search/scripts/search.mjs +79 -0
- package/skills/camsnap/SKILL.md +25 -0
- package/skills/clawdhub/SKILL.md +53 -0
- package/skills/coding-agent/SKILL.md +275 -0
- package/skills/discord/SKILL.md +369 -0
- package/skills/eightctl/SKILL.md +29 -0
- package/skills/food-order/SKILL.md +41 -0
- package/skills/gemini/SKILL.md +23 -0
- package/skills/gifgrep/SKILL.md +47 -0
- package/skills/github/SKILL.md +47 -0
- package/skills/gog/SKILL.md +36 -0
- package/skills/goplaces/SKILL.md +30 -0
- package/skills/imsg/SKILL.md +25 -0
- package/skills/local-places/SERVER_README.md +101 -0
- package/skills/local-places/SKILL.md +91 -0
- package/skills/local-places/pyproject.toml +27 -0
- package/skills/local-places/src/local_places/__init__.py +2 -0
- package/skills/local-places/src/local_places/__pycache__/__init__.cpython-314.pyc +0 -0
- package/skills/local-places/src/local_places/__pycache__/google_places.cpython-314.pyc +0 -0
- package/skills/local-places/src/local_places/__pycache__/main.cpython-314.pyc +0 -0
- package/skills/local-places/src/local_places/__pycache__/schemas.cpython-314.pyc +0 -0
- package/skills/local-places/src/local_places/google_places.py +314 -0
- package/skills/local-places/src/local_places/main.py +65 -0
- package/skills/local-places/src/local_places/schemas.py +107 -0
- package/skills/mcporter/SKILL.md +38 -0
- package/skills/nano-banana-pro/SKILL.md +29 -0
- package/skills/nano-banana-pro/scripts/generate_image.py +167 -0
- package/skills/nano-pdf/SKILL.md +20 -0
- package/skills/notion/SKILL.md +156 -0
- package/skills/obsidian/SKILL.md +55 -0
- package/skills/openai-image-gen/SKILL.md +31 -0
- package/skills/openai-image-gen/scripts/gen.py +173 -0
- package/skills/openai-whisper/SKILL.md +19 -0
- package/skills/openai-whisper-api/SKILL.md +43 -0
- package/skills/openai-whisper-api/scripts/transcribe.sh +85 -0
- package/skills/openhue/SKILL.md +30 -0
- package/skills/oracle/SKILL.md +105 -0
- package/skills/ordercli/SKILL.md +47 -0
- package/skills/peekaboo/SKILL.md +153 -0
- package/skills/qmd/SKILL.md +26 -0
- package/skills/sag/SKILL.md +62 -0
- package/skills/slack/SKILL.md +143 -0
- package/skills/songsee/SKILL.md +29 -0
- package/skills/sonoscli/SKILL.md +26 -0
- package/skills/spotify-player/SKILL.md +34 -0
- package/skills/summarize/SKILL.md +49 -0
- package/skills/things-mac/SKILL.md +61 -0
- package/skills/tmux/SKILL.md +121 -0
- package/skills/tmux/scripts/find-sessions.sh +112 -0
- package/skills/tmux/scripts/wait-for-text.sh +83 -0
- package/skills/trello/SKILL.md +84 -0
- package/skills/video-frames/SKILL.md +29 -0
- package/skills/video-frames/scripts/frame.sh +81 -0
- package/skills/wacli/SKILL.md +42 -0
- package/skills/weather/SKILL.md +49 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Refactor: host A2UI from the Gateway (HTTP), remove app-bundled shells"
|
|
3
|
+
read_when:
|
|
4
|
+
- Refactoring Canvas/A2UI ownership or assets
|
|
5
|
+
- Moving UI rendering from native bundles into the Gateway
|
|
6
|
+
- Updating node canvas navigation or A2UI command flows
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Canvas / A2UI — HTTP-hosted from Gateway
|
|
10
|
+
|
|
11
|
+
Status: Implemented · Date: 2025-12-20
|
|
12
|
+
|
|
13
|
+
## Goal
|
|
14
|
+
- Make the **Gateway (TypeScript)** the single owner of A2UI.
|
|
15
|
+
- Remove **app-bundled A2UI shells** (macOS, iOS, Android).
|
|
16
|
+
- A2UI renders only when the **Gateway is reachable** (acceptable failure mode).
|
|
17
|
+
|
|
18
|
+
## Decision
|
|
19
|
+
All A2UI HTML/JS assets are **served by the Gateway canvas host** on
|
|
20
|
+
`canvasHost.port` (default `18793`), bound to the **bridge interface**. Nodes
|
|
21
|
+
(mac/iOS/Android) **navigate to the advertised `canvasHostUrl`** before applying
|
|
22
|
+
A2UI messages. No local custom-scheme or bundled fallback remains.
|
|
23
|
+
|
|
24
|
+
## Why
|
|
25
|
+
- One source of truth (TS) for A2UI rendering.
|
|
26
|
+
- Faster iteration (no app release required for A2UI updates).
|
|
27
|
+
- iOS/Android/macOS all behave identically.
|
|
28
|
+
|
|
29
|
+
## New behavior (summary)
|
|
30
|
+
1) `canvas.a2ui.*` on any node:
|
|
31
|
+
- Ensure Canvas is visible.
|
|
32
|
+
- Navigate the node WebView to the Gateway A2UI URL.
|
|
33
|
+
- Apply/reset A2UI messages once the page is ready.
|
|
34
|
+
2) If Gateway is unreachable:
|
|
35
|
+
- A2UI fails with an explicit error (no fallback).
|
|
36
|
+
|
|
37
|
+
## Gateway changes
|
|
38
|
+
|
|
39
|
+
### Serve A2UI assets
|
|
40
|
+
Add A2UI HTML/JS to the Gateway Canvas host (standalone HTTP server on
|
|
41
|
+
`canvasHost.port`), e.g.:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
/__clawdbot__/a2ui/ -> index.html
|
|
45
|
+
/__clawdbot__/a2ui/a2ui.bundle.js -> bundled A2UI runtime
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Serve Canvas files at `/__clawdbot__/canvas/` and A2UI at `/__clawdbot__/a2ui/`.
|
|
49
|
+
Use the shared Canvas host handler (`src/canvas-host/server.ts`) to serve these
|
|
50
|
+
assets and inject the action bridge + live reload if desired.
|
|
51
|
+
|
|
52
|
+
### Canonical host URL
|
|
53
|
+
The Gateway exposes a **canonical** `canvasHostUrl` in hello/bridge payloads
|
|
54
|
+
so nodes don’t need to guess.
|
|
55
|
+
|
|
56
|
+
## Node changes (mac/iOS/Android)
|
|
57
|
+
|
|
58
|
+
### Navigation path
|
|
59
|
+
Before applying A2UI:
|
|
60
|
+
- Navigate to `${canvasHostUrl}/__clawdbot__/a2ui/`.
|
|
61
|
+
|
|
62
|
+
### Remove bundled shells
|
|
63
|
+
Remove all fallback logic that serves A2UI from local bundles:
|
|
64
|
+
- macOS: remove custom-scheme fallback for `/__clawdbot__/a2ui/`
|
|
65
|
+
- iOS/Android: remove packaged A2UI assets and "default scaffold" assumptions
|
|
66
|
+
|
|
67
|
+
### Error behavior
|
|
68
|
+
If `canvasHostUrl` is missing or unreachable:
|
|
69
|
+
- `canvas.a2ui.push/reset` returns a clear error:
|
|
70
|
+
- `A2UI_HOST_UNAVAILABLE` or `A2UI_HOST_NOT_CONFIGURED`
|
|
71
|
+
|
|
72
|
+
## Security / transport
|
|
73
|
+
- For non-TLS Gateway URLs (http), iOS/Android will need ATS exceptions.
|
|
74
|
+
- For TLS (https), prefer WSS + HTTPS with a valid cert.
|
|
75
|
+
|
|
76
|
+
## Implementation plan
|
|
77
|
+
1) Gateway
|
|
78
|
+
- Add A2UI assets under `src/canvas-host/`.
|
|
79
|
+
- Serve them at `/__clawdbot__/a2ui/` (align with existing naming).
|
|
80
|
+
- Serve Canvas files at `/__clawdbot__/canvas/` on `canvasHost.port`.
|
|
81
|
+
- Expose `canvasHostUrl` in handshake + bridge hello payloads.
|
|
82
|
+
2) Node runtimes
|
|
83
|
+
- Update `canvas.a2ui.*` to navigate to `canvasHostUrl`.
|
|
84
|
+
- Remove custom-scheme A2UI fallback and bundled assets.
|
|
85
|
+
3) Tests
|
|
86
|
+
- TS: verify `/__clawdbot__/a2ui/` responds with HTML + JS.
|
|
87
|
+
- Node: verify A2UI fails when host is unreachable and succeeds when reachable.
|
|
88
|
+
4) Docs
|
|
89
|
+
- Update `docs/mac/canvas.md`, `docs/ios/spec.md`, `docs/android/connect.md`
|
|
90
|
+
to remove local fallback assumptions and point to gateway-hosted A2UI.
|
|
91
|
+
|
|
92
|
+
## Notes
|
|
93
|
+
- iOS/Android may still require ATS exceptions for `http://` canvas hosts.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Refactor: unify on the clawdbot CLI + gateway-first control; retire clawdbot-mac"
|
|
3
|
+
read_when:
|
|
4
|
+
- Removing or replacing the macOS CLI helper
|
|
5
|
+
- Adding node capabilities or permissions metadata
|
|
6
|
+
- Updating macOS app packaging/install flows
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# CLI unification (clawdbot-only)
|
|
10
|
+
|
|
11
|
+
Status: active refactor · Date: 2025-12-20
|
|
12
|
+
|
|
13
|
+
## Goals
|
|
14
|
+
- **Single CLI**: use `clawdbot` for all automation (local + remote). Retire `clawdbot-mac`.
|
|
15
|
+
- **Gateway-first**: all agent actions flow through the Gateway WebSocket + node.invoke.
|
|
16
|
+
- **Permission awareness**: nodes advertise permission state so the agent can decide what to run.
|
|
17
|
+
- **No duplicate paths**: remove macOS control socket + Swift CLI surface.
|
|
18
|
+
|
|
19
|
+
## Non-goals
|
|
20
|
+
- Keep legacy `clawdbot-mac` compatibility.
|
|
21
|
+
- Support agent control when no Gateway is running.
|
|
22
|
+
|
|
23
|
+
## Key decisions
|
|
24
|
+
1) **No Gateway → no control**
|
|
25
|
+
- If the macOS app is running but the Gateway is not, remote commands (canvas/run/notify) are unavailable.
|
|
26
|
+
- This is acceptable to keep one network surface.
|
|
27
|
+
|
|
28
|
+
2) **Remove ensure-permissions CLI**
|
|
29
|
+
- Permissions are **advertised by the node** (e.g., screen recording granted/denied).
|
|
30
|
+
- Commands will still fail with explicit errors when permissions are missing.
|
|
31
|
+
|
|
32
|
+
3) **Mac app installs/symlinks `clawdbot`**
|
|
33
|
+
- Bundle a standalone `clawdbot` binary in the app (bun-compiled).
|
|
34
|
+
- Install/symlink that binary to `/usr/local/bin/clawdbot` and `/opt/homebrew/bin/clawdbot`.
|
|
35
|
+
- No `clawdbot-mac` helper remains.
|
|
36
|
+
|
|
37
|
+
4) **Canvas parity across node types**
|
|
38
|
+
- Use `node.invoke` commands consistently (`canvas.present|navigate|eval|snapshot|a2ui.*`).
|
|
39
|
+
- The TS CLI provides convenient wrappers so agents never have to craft raw `node.invoke` calls.
|
|
40
|
+
|
|
41
|
+
## Command surface (new/normalized)
|
|
42
|
+
- `clawdbot nodes invoke --command canvas.*` remains valid.
|
|
43
|
+
- New CLI wrappers for convenience:
|
|
44
|
+
- `clawdbot canvas present|navigate|eval|snapshot|a2ui push|a2ui reset`
|
|
45
|
+
- New node commands (mac-only initially):
|
|
46
|
+
- `system.run` (shell execution)
|
|
47
|
+
- `system.notify` (local notifications)
|
|
48
|
+
|
|
49
|
+
## Permission advertising
|
|
50
|
+
- Node hello/pairing includes a `permissions` map:
|
|
51
|
+
- Example keys: `screenRecording`, `accessibility`, `microphone`, `notifications`, `speechRecognition`.
|
|
52
|
+
- Values: boolean (`true` = granted, `false` = not granted).
|
|
53
|
+
- Gateway `node.list` / `node.describe` surfaces the map.
|
|
54
|
+
|
|
55
|
+
## Gateway mode + config
|
|
56
|
+
- Gateways should only auto-start when explicitly configured for **local** mode.
|
|
57
|
+
- When config is missing or explicitly remote, `clawdbot gateway` should refuse to auto-start unless forced.
|
|
58
|
+
|
|
59
|
+
## Implementation checklist
|
|
60
|
+
- Add bun-compiled `clawdbot` binary to macOS app bundle; update codesign + install flows.
|
|
61
|
+
- Remove `ClawdbotCLI` target and control socket server.
|
|
62
|
+
- Add node command(s) for `system.run` and `system.notify` on macOS.
|
|
63
|
+
- Add permission map to node hello/pairing + gateway responses.
|
|
64
|
+
- Update TS CLI + docs to use `clawdbot` only.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Refactor notes for the macOS gateway client typed API migration (Dec 2025)."
|
|
3
|
+
read_when:
|
|
4
|
+
- Refactoring macOS gateway client or typed gateway methods
|
|
5
|
+
- Auditing agent routing or channel semantics
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Gateway Client Refactor (Dec 2025)
|
|
9
|
+
|
|
10
|
+
Goal: remove stringly-typed gateway calls from the macOS app, centralize routing/channel semantics, and improve error handling.
|
|
11
|
+
|
|
12
|
+
## Progress
|
|
13
|
+
|
|
14
|
+
- [x] Fold legacy “AgentRPC” into `GatewayConnection` (single layer; no separate client object).
|
|
15
|
+
- [x] Typed gateway API: `GatewayConnection.Method` + `requestDecoded/requestVoid` + typed helpers (status/agent/chat/cron/etc).
|
|
16
|
+
- [x] Centralize agent routing/channel semantics via `GatewayAgentChannel` + `GatewayAgentInvocation`.
|
|
17
|
+
- [x] Improve gateway error model (structured `GatewayResponseError` + decoding errors include method).
|
|
18
|
+
- [x] Migrate mac call sites to typed helpers (leave only intentionally dynamic forwarding paths).
|
|
19
|
+
- [x] Convert remaining UI raw channel strings to `GatewayAgentChannel` (Cron editor).
|
|
20
|
+
- [x] Cleanup naming: rename remaining tests/docs that still reference “RPC/AgentRPC”.
|
|
21
|
+
|
|
22
|
+
### Notes
|
|
23
|
+
|
|
24
|
+
- Intentionally string-based:
|
|
25
|
+
- `BridgeServer` dynamic request forwarding (method is data-driven).
|
|
26
|
+
- `ControlChannel` request wrapper (generic escape hatch).
|
|
27
|
+
|
|
28
|
+
## Notes / Non-goals
|
|
29
|
+
|
|
30
|
+
- No functional behavior changes intended (beyond better errors and removing “magic strings”).
|
|
31
|
+
- Keep changes incremental: introduce typed APIs first, then migrate call sites, then remove old helpers.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Refactor notes for the macOS gateway client: single shared websocket + follow-ups"
|
|
3
|
+
read_when:
|
|
4
|
+
- Investigating duplicate/stale Gateway WS connections
|
|
5
|
+
- Refactoring macOS gateway client architecture
|
|
6
|
+
- Debugging noisy reconnect storms on gateway restart
|
|
7
|
+
---
|
|
8
|
+
# Gateway Refactor Notes (macOS client)
|
|
9
|
+
|
|
10
|
+
Last updated: 2025-12-12
|
|
11
|
+
|
|
12
|
+
This document captures the rationale and outcome of the macOS app’s Gateway client refactor: **one shared websocket connection per app process**, with an in-process event bus for server push frames.
|
|
13
|
+
|
|
14
|
+
Related docs:
|
|
15
|
+
- `docs/refactor/new-arch.md` (overall gateway protocol/server plan)
|
|
16
|
+
- `docs/gateway.md` (gateway operations/runbook)
|
|
17
|
+
- `docs/presence.md` (presence semantics and dedupe)
|
|
18
|
+
- `docs/mac/webchat.md` (WebChat surfaces and debugging)
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Background: what was wrong
|
|
23
|
+
|
|
24
|
+
Symptoms:
|
|
25
|
+
- Restarting the gateway produced a *storm* of reconnects/log spam (`gateway/ws in connect`, `hello`, `hello-ok`) and elevated `clients=` counts.
|
|
26
|
+
- Even with “one panel open”, the mac app could hold tens of websocket connections to `ws://127.0.0.1:18789`.
|
|
27
|
+
|
|
28
|
+
Root cause (historical bug):
|
|
29
|
+
- The mac app was repeatedly “reconfiguring” a gateway client on a timer (via health polling), creating a new websocket owner each time.
|
|
30
|
+
- Old websocket owners were not fully torn down and could keep watchdog/tick tasks alive, leading to **connection accumulation** over time.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## What changed
|
|
35
|
+
|
|
36
|
+
- **One socket owner:** `GatewayConnection.shared` is the only supported entry point for gateway RPC.
|
|
37
|
+
- **No global notifications:** server push frames are delivered via `GatewayConnection.shared.subscribe(...) -> AsyncStream<GatewayPush>` (no `NotificationCenter` fan-out).
|
|
38
|
+
- **No tunnel side effects:** `GatewayConnection` does not create/ensure SSH tunnels in remote mode; it consumes the already-established forwarded port.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Current architecture (as of 2025-12-12)
|
|
43
|
+
|
|
44
|
+
Goal: enforce the invariant **“one gateway websocket per app process (per effective config)”**.
|
|
45
|
+
|
|
46
|
+
Key elements:
|
|
47
|
+
- `GatewayConnection.shared` owns the one websocket and is the *only* supported entry point for app code that needs gateway RPC.
|
|
48
|
+
- Consumers (e.g. Control UI, agent invocations, SwiftUI WebChat) call `GatewayConnection.shared.request(...)` and do not create their own sockets.
|
|
49
|
+
- If the effective connection config changes (local ↔ remote tunnel port, token change), `GatewayConnection` replaces the underlying connection.
|
|
50
|
+
- The transport (`GatewayChannelActor`) is an internal detail and forwards push frames back into `GatewayConnection`.
|
|
51
|
+
- Server-push frames are delivered via `GatewayConnection.shared.subscribe(...) -> AsyncStream<GatewayPush>` (in-process event bus).
|
|
52
|
+
|
|
53
|
+
Notes:
|
|
54
|
+
- Remote mode requires an SSH control tunnel. `GatewayConnection` **does not** start tunnels; it consumes the already-established forwarded port (owned by `ConnectionModeCoordinator` / `RemoteTunnelManager`).
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Design constraints / principles
|
|
59
|
+
|
|
60
|
+
- **Single ownership:** Exactly one component owns the actual socket and reconnect policy.
|
|
61
|
+
- **Explicit config changes:** Recreate/reconnect only when config changes, not as a side effect of periodic work.
|
|
62
|
+
- **No implicit fan-out sockets:** Adding new UI features must not accidentally add new persistent gateway connections.
|
|
63
|
+
- **Testable seams:** Connection config and websocket session creation should be overridable in tests.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Status / remaining work
|
|
68
|
+
|
|
69
|
+
- ✅ One shared websocket per app process (per config)
|
|
70
|
+
- ✅ Event streaming moved into `GatewayConnection` (`AsyncStream<GatewayPush>`) and replays latest snapshot to new subscribers
|
|
71
|
+
- ✅ `NotificationCenter` removed for in-process gateway events (ControlChannel / Instances / WebChatSwiftUI)
|
|
72
|
+
- ✅ Remote tunnel lifecycle is not started implicitly by random RPC calls
|
|
73
|
+
- ✅ Payload decoding helpers extracted so UI adapters stay thin
|
|
74
|
+
- ✅ Dedicated resolved-endpoint publisher for remote mode (`GatewayEndpointStore`)
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Testing strategy (what we want to cover)
|
|
79
|
+
|
|
80
|
+
Minimum invariants:
|
|
81
|
+
- Repeated requests under the same config do **not** create additional websocket tasks.
|
|
82
|
+
- Concurrent requests still create **exactly one** websocket and reuse it.
|
|
83
|
+
- Shutdown prevents any reconnect loop after failures.
|
|
84
|
+
- Config changes (token / endpoint) cancel the old socket and reconnect once.
|
|
85
|
+
|
|
86
|
+
Nice-to-have integration coverage:
|
|
87
|
+
- Multiple “consumers” (Control UI + agent invocations + SwiftUI WebChat) all call through the shared connection and still produce only one websocket.
|
|
88
|
+
|
|
89
|
+
Additional coverage added (macOS):
|
|
90
|
+
- Subscribing after connect replays the latest snapshot.
|
|
91
|
+
- Sequence gaps emit an explicit `GatewayPush.seqGap(...)` before the corresponding event.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Debug notes (operational)
|
|
96
|
+
|
|
97
|
+
When diagnosing “too many connections”:
|
|
98
|
+
- Prefer counting actual TCP connections on port 18789 and grouping by PID to see which process is holding sockets.
|
|
99
|
+
- Gateway `--verbose` prints *every* connect/hello and event broadcast; use it only when needed and filter output if you’re just sanity-checking.
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Implementation plan for the new gateway architecture and protocol"
|
|
3
|
+
read_when:
|
|
4
|
+
- Executing the gateway refactor
|
|
5
|
+
---
|
|
6
|
+
# New Gateway Architecture – Implementation Plan (detailed)
|
|
7
|
+
|
|
8
|
+
Last updated: 2025-12-09
|
|
9
|
+
|
|
10
|
+
Goal: replace legacy gateway/stdin/TCP control with a single WebSocket Gateway, typed protocol, and first-frame snapshot. No backward compatibility.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Phase 0 — Foundations
|
|
15
|
+
- **Naming**: CLI subcommand `clawdbot gateway`; internal namespace `Gateway`.
|
|
16
|
+
- **Protocol folder**: create `protocol/` for schemas and build artifacts. ✅ `src/gateway/protocol`.
|
|
17
|
+
- **Schema tooling**:
|
|
18
|
+
- Prefer **TypeBox** (or ArkType) as source-of-truth types. ✅ TypeBox in `schema.ts`.
|
|
19
|
+
- `pnpm protocol:gen`: emits JSON Schema (`dist/protocol.schema.json`). ✅
|
|
20
|
+
- `pnpm protocol:gen:swift`: generates Swift `Codable` models (`apps/macos/Sources/ClawdbotProtocol/GatewayModels.swift`). ✅
|
|
21
|
+
- AJV compile step for server validators. ✅
|
|
22
|
+
- **CI**: add a job that fails if schema or generated Swift is stale. ✅ `pnpm protocol:check` (runs gen + git diff).
|
|
23
|
+
|
|
24
|
+
## Phase 1 — Protocol specification
|
|
25
|
+
- Frames (WS text JSON, all with explicit `type`):
|
|
26
|
+
- `req {type:"req", id, method:"connect", params:{minProtocol,maxProtocol,client:{name,version,platform,deviceFamily?,modelIdentifier?,mode,instanceId}, caps, auth:{token?}, locale?, userAgent?}}`
|
|
27
|
+
- `res {type:"res", id, ok:true, payload: hello-ok }` (or `ok:false` then close)
|
|
28
|
+
- `hello-ok {type:"hello-ok", protocol:<chosen>, server:{version,commit,host,connId}, features:{methods,events}, snapshot:{presence[], health, stateVersion:{presence,health}, uptimeMs}, policy:{maxPayload, maxBufferedBytes, tickIntervalMs}}`
|
|
29
|
+
- `req {type:"req", id, method, params?}`
|
|
30
|
+
- `res {type:"res", id, ok, payload?, error?}` where `error` = `{code,message,details?,retryable?,retryAfterMs?}`
|
|
31
|
+
- `event {type:"event", event, payload, seq?, stateVersion?}` (presence/tick/shutdown/agent)
|
|
32
|
+
- `close` (standard WS close codes; policy uses 1008 for slow consumer/unauthorized, 1012/1001 for restart)
|
|
33
|
+
- Payload types:
|
|
34
|
+
- `PresenceEntry {host, ip, version, platform?, deviceFamily?, modelIdentifier?, mode, lastInputSeconds?, ts, reason?, tags?[], instanceId?}`
|
|
35
|
+
- `HealthSnapshot` (match existing `clawdbot health --json` fields)
|
|
36
|
+
- `AgentEvent` (streamed tool/output; `{runId, seq, stream, data, ts}`)
|
|
37
|
+
- `TickEvent {ts}`
|
|
38
|
+
- `ShutdownEvent {reason, restartExpectedMs?}`
|
|
39
|
+
- Error codes: `NOT_LINKED`, `AGENT_TIMEOUT`, `INVALID_REQUEST`, `UNAVAILABLE`.
|
|
40
|
+
- Error shape: `{code, message, details?, retryable?, retryAfterMs?}`
|
|
41
|
+
- Rules:
|
|
42
|
+
- First frame must be `req` with `method:"connect"`; otherwise close. Add handshake timeout (e.g., 3s) for silent clients.
|
|
43
|
+
- Negotiate protocol: server picks within `[minProtocol,maxProtocol]`; if none, reply `res ok:false` and close.
|
|
44
|
+
- Protocol version bump on breaking changes; `hello-ok` must include `minClient` when needed.
|
|
45
|
+
- `stateVersion` increments for presence/health to drop stale deltas.
|
|
46
|
+
- Stable IDs: client sends `instanceId`; server issues per-connection `connId` in `hello-ok`; presence entries may include `instanceId` to dedupe reconnects.
|
|
47
|
+
- Token-based auth: bearer token in `auth.token`; required except for loopback development.
|
|
48
|
+
- Presence is primarily connection-derived; client may add hints (e.g., lastInputSeconds); entries expire via TTL to keep the map bounded (e.g., 5m TTL, max 200 entries).
|
|
49
|
+
- Idempotency keys: required for `send` and `agent` to safely retry after disconnects.
|
|
50
|
+
- Size limits: bound first-frame size by `maxPayload`; reject early if exceeded.
|
|
51
|
+
- Close on any non-JSON or wrong `type` before connect.
|
|
52
|
+
- Per-op idempotency keys: client SHOULD supply an explicit key per `send`/`agent`; if omitted, server may derive a scoped key from `instanceId+connId`, but explicit keys are safer across reconnects.
|
|
53
|
+
- Locale/userAgent are informational; server may log them for analytics but must not rely on them for access control.
|
|
54
|
+
|
|
55
|
+
## Phase 2 — Gateway WebSocket server
|
|
56
|
+
- New module `src/gateway/server.ts`:
|
|
57
|
+
- Bind 127.0.0.1:18789 (configurable).
|
|
58
|
+
- On connect: validate `connect` params, send snapshot payload, start event pump.
|
|
59
|
+
- Per-connection queues with backpressure (bounded; drop oldest non-critical).
|
|
60
|
+
- WS-level caps: set `maxPayload` to cap frame size before JSON parse.
|
|
61
|
+
- Emit `tick` every N seconds when idle (or WS ping/pong if adequate).
|
|
62
|
+
- Emit `shutdown` before exit; then close sockets.
|
|
63
|
+
- Methods implemented:
|
|
64
|
+
- `health`, `status`, `system-presence`, `system-event`, `send`, `agent`.
|
|
65
|
+
- Optional: `set-heartbeats` removed/renamed if heartbeat concept is retired.
|
|
66
|
+
- Events implemented:
|
|
67
|
+
- `agent`, `presence` (deltas, with `stateVersion`), `tick`, `shutdown`.
|
|
68
|
+
- All events include `seq` for loss/out-of-order detection.
|
|
69
|
+
- Logging: structured logs on connect/close/error; include client fingerprint.
|
|
70
|
+
- Slow consumer policy:
|
|
71
|
+
- Per-connection outbound queue limit (bytes/messages). If exceeded, drop non-critical events (presence/tick) or close with a policy violation / retryable code; clients reconnect with backoff.
|
|
72
|
+
- Handshake edge cases:
|
|
73
|
+
- Close on handshake timeout.
|
|
74
|
+
- Close on over-limit first frame (maxPayload).
|
|
75
|
+
- Close immediately on non-JSON or wrong `type` before connect.
|
|
76
|
+
- Default guardrails: `maxPayload` ~512 KB, handshake timeout ~3 s, outbound buffered amount cap ~1.5 MB (tune as you implement).
|
|
77
|
+
- Dedupe cache: bound TTL (~5m) and max size (~1000 entries); evict oldest first (LRU) to prevent memory growth.
|
|
78
|
+
|
|
79
|
+
## Phase 3 — Gateway CLI entrypoint
|
|
80
|
+
- Add `clawdbot gateway` command in CLI program:
|
|
81
|
+
- Reads config (port, WS options).
|
|
82
|
+
- Foreground process; exit non-zero on fatal errors.
|
|
83
|
+
- Flags: `--port`, `--no-tick` (optional), `--log-json` (optional).
|
|
84
|
+
- System supervision docs for launchd/systemd (see `gateway.md`).
|
|
85
|
+
|
|
86
|
+
## Phase 4 — Presence/health snapshot & stateVersion
|
|
87
|
+
- `hello-ok.snapshot` includes:
|
|
88
|
+
- `presence[]` (current list)
|
|
89
|
+
- `health` (full snapshot)
|
|
90
|
+
- `stateVersion {presence:int, health:int}`
|
|
91
|
+
- `uptimeMs`
|
|
92
|
+
- `policy {maxPayload, maxBufferedBytes, tickIntervalMs}`
|
|
93
|
+
- Emit `presence` deltas with updated `stateVersion.presence`.
|
|
94
|
+
- Emit `tick` to indicate liveness when no other events occur.
|
|
95
|
+
- Keep `health` method for manual refresh; not required after connect.
|
|
96
|
+
- Presence expiry: prune entries older than TTL; enforce a max map size; include `stateVersion` in presence events.
|
|
97
|
+
|
|
98
|
+
## Phase 5 — Clients migration
|
|
99
|
+
- **macOS app**:
|
|
100
|
+
- Replace stdio/SSH RPC with WS client (tunneled via SSH/Tailscale for remote). ✅ GatewayConnection/ControlChannel now use Gateway WS.
|
|
101
|
+
- Implement handshake, snapshot hydration, subscriptions to `presence`, `tick`, `agent`, `shutdown`. ✅ snapshot + presence events broadcast to InstancesStore; agent events still to wire to UI if desired.
|
|
102
|
+
- Remove immediate `health/system-presence` fetch on connect. ✅ presence hydrated from snapshot; periodic refresh kept as fallback.
|
|
103
|
+
- Handle connect failures (`res ok:false`) and retry with backoff if version/token mismatched. ✅ macOS GatewayChannel reconnects with exponential backoff.
|
|
104
|
+
- **CLI**:
|
|
105
|
+
- Add lightweight WS client helper for `status/health/send/agent` when Gateway is up. ✅ `gateway` subcommands use the Gateway over WS.
|
|
106
|
+
- Consider a “local only” flag to avoid accidental remote connects. (optional; not needed with tunnel-first model.)
|
|
107
|
+
- **WebChat backend**:
|
|
108
|
+
- Single WS to Gateway; seed UI from snapshot; forward `presence/tick/agent` to browser. ✅ implemented via the WebChat gateway client in `webchat/server.ts`.
|
|
109
|
+
- Fail fast if handshake fails; no fallback transports. ✅ (webchat returns gateway unavailable)
|
|
110
|
+
|
|
111
|
+
## Phase 6 — Send/agent path hardening
|
|
112
|
+
- Ensure only the Gateway can open Baileys; no IPC fallback.
|
|
113
|
+
- `send` executes in-process; respond with explicit result/error, not via heartbeat.
|
|
114
|
+
- `agent` spawns Pi; respond quickly with `{runId,status:"accepted"}` (ack); stream `event:agent {runId, seq, stream, data, ts}`; final `res:agent {runId, status:"ok"|"error", summary}` completes request (idempotent via key).
|
|
115
|
+
- Idempotency: side-effecting methods (`send`, `agent`) accept an idempotency key; keep a short-lived dedupe cache to avoid double-send on client retries. Client retry flow: on timeout/close, retry with same key; Gateway returns cached result when available; cache TTL ~5m and bounded.
|
|
116
|
+
- Agent stream ordering: enforce monotonic `seq` per runId; if gap detected by server, terminate stream with error; if detected by client, issue a retry with same idempotency key.
|
|
117
|
+
- Send response shape: `{messageId?, toJid?, error?}` and always include `runId` when available for traceability.
|
|
118
|
+
|
|
119
|
+
## Phase 7 — Keepalive and shutdown semantics
|
|
120
|
+
- Keepalive: `tick` events (or WS ping/pong) at fixed interval; clients treat missing ticks as disconnect and reconnect.
|
|
121
|
+
- Shutdown: send `event:shutdown {reason, restartExpectedMs?}` then close sockets; clients auto-reconnect.
|
|
122
|
+
- Restart semantics: close sockets with a standard retryable close code; on reconnect, `hello-ok` snapshot must be sufficient to rebuild UI without event replay.
|
|
123
|
+
- Use a standard close code (e.g., 1012 service restart or 1001 going away) for planned restart; 1008 policy violation for slow consumers.
|
|
124
|
+
- Include `policy` in `hello-ok` so clients know the tick interval and buffer limits to tune their expectations.
|
|
125
|
+
|
|
126
|
+
## Phase 8 — Cleanup and deprecation
|
|
127
|
+
- Retire `clawdbot rpc` as default path; keep only if explicitly requested (documented as legacy).
|
|
128
|
+
- Remove reliance on `src/infra/control-channel.ts` for new clients; mark as legacy or delete after migration. ✅ file removed; mac app now uses Gateway WS.
|
|
129
|
+
- Update README, docs (`architecture.md`, `gateway.md`, `webchat.md`) to final shapes; remove `control-api.md` references if obsolete.
|
|
130
|
+
- Presence hygiene:
|
|
131
|
+
- Presence derived primarily from connection (server-fills host/ip/version/connId/instanceId); allow client hints (e.g., lastInputSeconds).
|
|
132
|
+
- Add TTL/expiry; prune to keep map bounded (e.g., 5m TTL, max 200 entries).
|
|
133
|
+
|
|
134
|
+
## Edge cases and ordering
|
|
135
|
+
- Event ordering: all events carry `seq`; clients detect gaps and should re-fetch snapshot (or targeted refresh) on gap.
|
|
136
|
+
- Partial handshakes: if client connects and never sends `req:connect`, server closes after handshake timeout.
|
|
137
|
+
- Garbage/oversize first frame: bounded by `maxPayload`; server closes immediately on parse failure.
|
|
138
|
+
- Duplicate delivery on reconnect: clients must send idempotency keys; Gateway dedupe cache prevents double-send/agent execution.
|
|
139
|
+
- Snapshot sufficiency: `hello-ok.snapshot` must contain enough to render UI after reconnect without event replay.
|
|
140
|
+
- Client reconnect guidance: exponential backoff with jitter; reuse same `instanceId` across reconnects to avoid duplicate presence; resend idempotency keys for in-flight sends/agents; on seq gap, issue `health`/`system-presence` refresh.
|
|
141
|
+
- Presence TTL/defaults: set a concrete TTL (e.g., 5 minutes) and prune periodically; cap the presence map size with LRU if needed.
|
|
142
|
+
- Replay policy: if seq gap detected, server does not replay; clients must pull fresh `health` + `system-presence` and continue.
|
|
143
|
+
|
|
144
|
+
## Phase 9 — Testing & validation
|
|
145
|
+
- Unit: frame validation, handshake failure, auth/token, stateVersion on presence events, agent stream fanout, send dedupe. ✅
|
|
146
|
+
- Integration: connect → snapshot → req/res → streaming agent → shutdown. ✅ Covered in gateway WS tests (connect/health/status/presence, agent ack+final, shutdown broadcast).
|
|
147
|
+
- Load: multiple concurrent WS clients; backpressure behavior under burst. ✅ Basic fanout test with 3 clients receiving presence broadcast; heavier soak still recommended.
|
|
148
|
+
- Mac app smoke: presence/health render from snapshot; reconnect on tick loss. (Manual: open Instances tab, verify snapshot after connect, induce seq gap by toggling wifi, ensure UI refreshes.)
|
|
149
|
+
- WebChat smoke: snapshot seed + event updates; tunnel scenario. ✅ Offline snapshot harness in `src/webchat/server.test.ts` (mock gateway) now passes; live tunnel still recommended for manual.
|
|
150
|
+
- Idempotency tests: retry send/agent with same key after forced disconnect; expect deduped result. ✅ send + agent dedupe + reconnect retry covered in gateway tests.
|
|
151
|
+
- Seq-gap handling: ✅ clients now detect seq gaps (WebChat gateway client + mac `GatewayConnection/GatewayChannel`) and refresh health/presence (webchat) or trigger UI refresh (mac). Load-test still optional.
|
|
152
|
+
|
|
153
|
+
## Phase 10 — Rollout
|
|
154
|
+
- Version bump; release notes: breaking change to control plane (WS only).
|
|
155
|
+
- Ship launchd/systemd templates for `clawdbot gateway`.
|
|
156
|
+
- Recommend Tailscale/SSH tunnel for remote access; no additional auth layer assumed in this model.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
- Quick checklist
|
|
161
|
+
- [x] Protocol types & schemas (TS + JSON Schema + Swift via quicktype)
|
|
162
|
+
- [x] AJV validators wired
|
|
163
|
+
- [x] WS server with connect → snapshot → events
|
|
164
|
+
- [x] Tick + shutdown events
|
|
165
|
+
- [x] stateVersion + presence deltas
|
|
166
|
+
- [x] Gateway CLI command
|
|
167
|
+
- [x] macOS app WS client (Gateway WS for control; presence events live; agent stream UI pending)
|
|
168
|
+
- [x] WebChat WS client
|
|
169
|
+
- [x] Remove legacy stdin/TCP paths from default flows (file removed; mac app/CLI on Gateway)
|
|
170
|
+
- [x] Tests (unit/integration/load) — unit + integration + basic fanout/reconnect; heavier load/soak optional
|
|
171
|
+
- [x] Docs updated and legacy docs flagged
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Refactor plan: Gateway TUI parity with pi-mono interactive UI"
|
|
3
|
+
read_when:
|
|
4
|
+
- Building or refactoring the Gateway TUI
|
|
5
|
+
- Syncing TUI slash commands with Clawdbot behavior
|
|
6
|
+
---
|
|
7
|
+
# Gateway TUI refactor plan
|
|
8
|
+
|
|
9
|
+
Updated: 2026-01-03
|
|
10
|
+
|
|
11
|
+
## Goals
|
|
12
|
+
- Match pi-mono interactive TUI feel (editor, streaming, tool cards, selectors).
|
|
13
|
+
- Keep Clawdbot semantics: Gateway WS only, session store owns state, no branching/export.
|
|
14
|
+
- Work locally or remotely via Gateway URL/token.
|
|
15
|
+
|
|
16
|
+
## Non-goals
|
|
17
|
+
- Branching, export, OAuth flows, or hook UIs.
|
|
18
|
+
- File-system operations on the Gateway host from the TUI.
|
|
19
|
+
|
|
20
|
+
## Checklist
|
|
21
|
+
- [x] Protocol + server: sessions.patch supports model overrides; agent events include tool results (text-only payloads).
|
|
22
|
+
- [x] Gateway TUI client: add session/model helpers + stricter typing.
|
|
23
|
+
- [x] TUI UI kit: theme + components (editor, message feed, tool cards, selectors).
|
|
24
|
+
- [x] TUI controller: keybindings + Clawdbot slash commands + history/stream wiring.
|
|
25
|
+
- [x] Docs + changelog updated for the new TUI behavior.
|
|
26
|
+
- [x] Gate: lint, build, tests, docs list.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Troubleshooting guide for the web gateway/Baileys stack"
|
|
3
|
+
read_when:
|
|
4
|
+
- Diagnosing web gateway socket or login issues
|
|
5
|
+
---
|
|
6
|
+
# Web Gateway Troubleshooting (Nov 26, 2025)
|
|
7
|
+
|
|
8
|
+
## Symptoms & quick fixes
|
|
9
|
+
- **Stream Errored / Conflict / status 409–515:** WhatsApp closed the socket because another session is active or creds went stale. Run `clawdbot logout`, then `clawdbot login`, then restart the Gateway.
|
|
10
|
+
- **Logged out:** Console prints “session logged out”; re-link with `clawdbot login`.
|
|
11
|
+
- **Repeated retries then exit:** Tune reconnect behavior via config `web.reconnect` and restart the Gateway.
|
|
12
|
+
- **No inbound messages:** Ensure the QR-linked account is online in WhatsApp, and check logs for `web-heartbeat` to confirm auth age/connection.
|
|
13
|
+
- **Status 515 right after pairing:** The QR login flow now auto-restarts once; you should not need a manual gateway restart after scanning.
|
|
14
|
+
- **Fast nuke:** From an allowed WhatsApp sender you can send `/restart` to request a supervised restart (launchd/mac app setups); wait a few seconds for it to come back.
|
|
15
|
+
|
|
16
|
+
## Helpful commands
|
|
17
|
+
- Start the Gateway: `clawdbot gateway --verbose`
|
|
18
|
+
- Logout (clear creds): `clawdbot logout`
|
|
19
|
+
- Relink (show QR): `clawdbot login --verbose`
|
|
20
|
+
- Tail logs (default): `tail -f /tmp/clawdbot/clawdbot-*.log`
|
|
21
|
+
|
|
22
|
+
## Reading the logs
|
|
23
|
+
- `web-reconnect`: close reasons, retry/backoff, max-attempt exit.
|
|
24
|
+
- `web-heartbeat`: connectionId, messagesHandled, authAgeMs, uptimeMs (every 60s by default).
|
|
25
|
+
- `web-auto-reply`: inbound/outbound message records with correlation IDs.
|
|
26
|
+
|
|
27
|
+
## When to tweak knobs
|
|
28
|
+
- High churn networks: increase `web.reconnect.maxAttempts`.
|
|
29
|
+
- Slow links: raise `web.reconnect.maxMs` to give more headroom before bailing.
|
|
30
|
+
- Chatty monitors: increase `web.heartbeatSeconds` if log volume is high.
|
|
31
|
+
|
|
32
|
+
## If it keeps failing
|
|
33
|
+
1) `clawdbot logout` → `clawdbot login` (fresh QR link).
|
|
34
|
+
2) Ensure no other device/browser is using the same WA Web session.
|
|
35
|
+
3) Check WhatsApp mobile app is online and not in low-power mode.
|
|
36
|
+
4) If status is 515, let the client restart once after pairing (already handled automatically).
|
|
37
|
+
5) Capture the last `web-reconnect` entry and the status code before escalating.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "WebChat session migration notes (Gateway WS-only)"
|
|
3
|
+
read_when:
|
|
4
|
+
- Changing WebChat Gateway methods/events
|
|
5
|
+
---
|
|
6
|
+
<!-- {% raw %} -->
|
|
7
|
+
# WebAgent session migration (WS-only)
|
|
8
|
+
|
|
9
|
+
Context: web chat currently lives in a WKWebView that loads the pi-web bundle. Sends go over HTTP `/rpc` to the webchat server, and updates come from `/socket` snapshots based on session JSONL file changes. The Gateway itself already speaks WebSocket to the webchat server, and Pi writes the session JSONL files. This doc tracks the plan to move WebChat to a single Gateway WebSocket and drop the HTTP shim/file-watching.
|
|
10
|
+
|
|
11
|
+
## Target state
|
|
12
|
+
- Gateway WS adds methods:
|
|
13
|
+
- `chat.history { sessionKey }` → `{ sessionKey, messages[], thinkingLevel }` (reads the existing JSONL + session store).
|
|
14
|
+
- `chat.send { sessionKey, message, attachments?, thinking?, deliver?, timeoutMs<=30000, idempotencyKey }` → `res { runId, status:"accepted" }` or `res ok:false` on validation/timeout.
|
|
15
|
+
- Gateway WS emits `chat` events `{ runId, sessionKey, seq, state:"delta"|"final"|"error", message?, errorMessage?, usage?, stopReason? }`. Streaming is optional; minimum is a single `state:"final"` per send.
|
|
16
|
+
- Client consumes only WS: bootstrap via `chat.history`, send via `chat.send`, live updates via `chat` events. No file watchers.
|
|
17
|
+
- Health gate: client subscribes to `health` and blocks send when health is not OK; 30s client-side timeout for sends.
|
|
18
|
+
- Tunneling: only the Gateway WS port needs to be forwarded; HTTP server remains for static assets but no RPC endpoints.
|
|
19
|
+
|
|
20
|
+
## Server work (Node)
|
|
21
|
+
- Implement `chat.history` and `chat.send` handlers in `src/gateway/server.ts`; update protocol schemas/tests.
|
|
22
|
+
- Emit `chat` events by plumbing `agentCommand`/`emitAgentEvent` outputs; include assistant text/tool results.
|
|
23
|
+
- Remove `/rpc` and `/socket` routes + file-watch broadcast from `src/webchat/server.ts`; leave static host only.
|
|
24
|
+
|
|
25
|
+
## Client work (pi-web bundle)
|
|
26
|
+
- Replace `NativeTransport` with a Gateway WS client:
|
|
27
|
+
- `connect` → `chat.history` for initial state.
|
|
28
|
+
- Listen to `chat/presence/tick/health`; update UI from events only.
|
|
29
|
+
- Send via `chat.send`; mark pending until `chat state:final|error`.
|
|
30
|
+
- Enforce health gate + 30s timeout.
|
|
31
|
+
- Remove reliance on session file snapshots and `/rpc`.
|
|
32
|
+
|
|
33
|
+
## Persistence
|
|
34
|
+
- Keep passing `--session <.../.clawdbot/sessions/{{SessionId}}.jsonl>` to Pi so it continues writing JSONL. The WS history reader uses the same file; no new store introduced.
|
|
35
|
+
|
|
36
|
+
## Docs to update when shipping
|
|
37
|
+
- `docs/webchat.md` (WS-only flow, methods/events, health gate, tunnel WS port).
|
|
38
|
+
- `docs/mac/webchat.md` (WKWebView now talks Gateway WS; `/rpc`/file-watch removed).
|
|
39
|
+
- `docs/architecture.md` / `typebox.md` if protocol methods are listed.
|
|
40
|
+
- Optional: add a concise Gateway chat protocol appendix if needed.
|
|
41
|
+
|
|
42
|
+
## Open decisions
|
|
43
|
+
- Streaming granularity: start with `state:"final"` only, or include token/tool deltas immediately?
|
|
44
|
+
- Attachments over WS: text-only initially is OK; confirm before wiring binary/upload path.
|
|
45
|
+
- Error shape: use `res ok:false` for validation/timeout, `chat state:"error"` for model/runtime failures.
|
|
46
|
+
<!-- {% endraw %} -->
|