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,560 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
const NonEmptyString = Type.String({ minLength: 1 });
|
|
3
|
+
export const PresenceEntrySchema = Type.Object({
|
|
4
|
+
host: Type.Optional(NonEmptyString),
|
|
5
|
+
ip: Type.Optional(NonEmptyString),
|
|
6
|
+
version: Type.Optional(NonEmptyString),
|
|
7
|
+
platform: Type.Optional(NonEmptyString),
|
|
8
|
+
deviceFamily: Type.Optional(NonEmptyString),
|
|
9
|
+
modelIdentifier: Type.Optional(NonEmptyString),
|
|
10
|
+
mode: Type.Optional(NonEmptyString),
|
|
11
|
+
lastInputSeconds: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
12
|
+
reason: Type.Optional(NonEmptyString),
|
|
13
|
+
tags: Type.Optional(Type.Array(NonEmptyString)),
|
|
14
|
+
text: Type.Optional(Type.String()),
|
|
15
|
+
ts: Type.Integer({ minimum: 0 }),
|
|
16
|
+
instanceId: Type.Optional(NonEmptyString),
|
|
17
|
+
}, { additionalProperties: false });
|
|
18
|
+
export const HealthSnapshotSchema = Type.Any();
|
|
19
|
+
export const StateVersionSchema = Type.Object({
|
|
20
|
+
presence: Type.Integer({ minimum: 0 }),
|
|
21
|
+
health: Type.Integer({ minimum: 0 }),
|
|
22
|
+
}, { additionalProperties: false });
|
|
23
|
+
export const SnapshotSchema = Type.Object({
|
|
24
|
+
presence: Type.Array(PresenceEntrySchema),
|
|
25
|
+
health: HealthSnapshotSchema,
|
|
26
|
+
stateVersion: StateVersionSchema,
|
|
27
|
+
uptimeMs: Type.Integer({ minimum: 0 }),
|
|
28
|
+
configPath: Type.Optional(NonEmptyString),
|
|
29
|
+
stateDir: Type.Optional(NonEmptyString),
|
|
30
|
+
}, { additionalProperties: false });
|
|
31
|
+
export const TickEventSchema = Type.Object({
|
|
32
|
+
ts: Type.Integer({ minimum: 0 }),
|
|
33
|
+
}, { additionalProperties: false });
|
|
34
|
+
export const ShutdownEventSchema = Type.Object({
|
|
35
|
+
reason: NonEmptyString,
|
|
36
|
+
restartExpectedMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
37
|
+
}, { additionalProperties: false });
|
|
38
|
+
export const ConnectParamsSchema = Type.Object({
|
|
39
|
+
minProtocol: Type.Integer({ minimum: 1 }),
|
|
40
|
+
maxProtocol: Type.Integer({ minimum: 1 }),
|
|
41
|
+
client: Type.Object({
|
|
42
|
+
name: NonEmptyString,
|
|
43
|
+
version: NonEmptyString,
|
|
44
|
+
platform: NonEmptyString,
|
|
45
|
+
deviceFamily: Type.Optional(NonEmptyString),
|
|
46
|
+
modelIdentifier: Type.Optional(NonEmptyString),
|
|
47
|
+
mode: NonEmptyString,
|
|
48
|
+
instanceId: Type.Optional(NonEmptyString),
|
|
49
|
+
}, { additionalProperties: false }),
|
|
50
|
+
caps: Type.Optional(Type.Array(NonEmptyString, { default: [] })),
|
|
51
|
+
auth: Type.Optional(Type.Object({
|
|
52
|
+
token: Type.Optional(Type.String()),
|
|
53
|
+
password: Type.Optional(Type.String()),
|
|
54
|
+
}, { additionalProperties: false })),
|
|
55
|
+
locale: Type.Optional(Type.String()),
|
|
56
|
+
userAgent: Type.Optional(Type.String()),
|
|
57
|
+
}, { additionalProperties: false });
|
|
58
|
+
export const HelloOkSchema = Type.Object({
|
|
59
|
+
type: Type.Literal("hello-ok"),
|
|
60
|
+
protocol: Type.Integer({ minimum: 1 }),
|
|
61
|
+
server: Type.Object({
|
|
62
|
+
version: NonEmptyString,
|
|
63
|
+
commit: Type.Optional(NonEmptyString),
|
|
64
|
+
host: Type.Optional(NonEmptyString),
|
|
65
|
+
connId: NonEmptyString,
|
|
66
|
+
}, { additionalProperties: false }),
|
|
67
|
+
features: Type.Object({
|
|
68
|
+
methods: Type.Array(NonEmptyString),
|
|
69
|
+
events: Type.Array(NonEmptyString),
|
|
70
|
+
}, { additionalProperties: false }),
|
|
71
|
+
snapshot: SnapshotSchema,
|
|
72
|
+
canvasHostUrl: Type.Optional(NonEmptyString),
|
|
73
|
+
policy: Type.Object({
|
|
74
|
+
maxPayload: Type.Integer({ minimum: 1 }),
|
|
75
|
+
maxBufferedBytes: Type.Integer({ minimum: 1 }),
|
|
76
|
+
tickIntervalMs: Type.Integer({ minimum: 1 }),
|
|
77
|
+
}, { additionalProperties: false }),
|
|
78
|
+
}, { additionalProperties: false });
|
|
79
|
+
export const ErrorShapeSchema = Type.Object({
|
|
80
|
+
code: NonEmptyString,
|
|
81
|
+
message: NonEmptyString,
|
|
82
|
+
details: Type.Optional(Type.Unknown()),
|
|
83
|
+
retryable: Type.Optional(Type.Boolean()),
|
|
84
|
+
retryAfterMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
85
|
+
}, { additionalProperties: false });
|
|
86
|
+
export const RequestFrameSchema = Type.Object({
|
|
87
|
+
type: Type.Literal("req"),
|
|
88
|
+
id: NonEmptyString,
|
|
89
|
+
method: NonEmptyString,
|
|
90
|
+
params: Type.Optional(Type.Unknown()),
|
|
91
|
+
}, { additionalProperties: false });
|
|
92
|
+
export const ResponseFrameSchema = Type.Object({
|
|
93
|
+
type: Type.Literal("res"),
|
|
94
|
+
id: NonEmptyString,
|
|
95
|
+
ok: Type.Boolean(),
|
|
96
|
+
payload: Type.Optional(Type.Unknown()),
|
|
97
|
+
error: Type.Optional(ErrorShapeSchema),
|
|
98
|
+
}, { additionalProperties: false });
|
|
99
|
+
export const EventFrameSchema = Type.Object({
|
|
100
|
+
type: Type.Literal("event"),
|
|
101
|
+
event: NonEmptyString,
|
|
102
|
+
payload: Type.Optional(Type.Unknown()),
|
|
103
|
+
seq: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
104
|
+
stateVersion: Type.Optional(StateVersionSchema),
|
|
105
|
+
}, { additionalProperties: false });
|
|
106
|
+
// Discriminated union of all top-level frames. Using a discriminator makes
|
|
107
|
+
// downstream codegen (quicktype) produce tighter types instead of all-optional
|
|
108
|
+
// blobs.
|
|
109
|
+
export const GatewayFrameSchema = Type.Union([RequestFrameSchema, ResponseFrameSchema, EventFrameSchema], { discriminator: "type" });
|
|
110
|
+
export const AgentEventSchema = Type.Object({
|
|
111
|
+
runId: NonEmptyString,
|
|
112
|
+
seq: Type.Integer({ minimum: 0 }),
|
|
113
|
+
stream: NonEmptyString,
|
|
114
|
+
ts: Type.Integer({ minimum: 0 }),
|
|
115
|
+
data: Type.Record(Type.String(), Type.Unknown()),
|
|
116
|
+
}, { additionalProperties: false });
|
|
117
|
+
export const SendParamsSchema = Type.Object({
|
|
118
|
+
to: NonEmptyString,
|
|
119
|
+
message: NonEmptyString,
|
|
120
|
+
mediaUrl: Type.Optional(Type.String()),
|
|
121
|
+
gifPlayback: Type.Optional(Type.Boolean()),
|
|
122
|
+
provider: Type.Optional(Type.String()),
|
|
123
|
+
idempotencyKey: NonEmptyString,
|
|
124
|
+
}, { additionalProperties: false });
|
|
125
|
+
export const AgentParamsSchema = Type.Object({
|
|
126
|
+
message: NonEmptyString,
|
|
127
|
+
to: Type.Optional(Type.String()),
|
|
128
|
+
sessionId: Type.Optional(Type.String()),
|
|
129
|
+
sessionKey: Type.Optional(Type.String()),
|
|
130
|
+
thinking: Type.Optional(Type.String()),
|
|
131
|
+
deliver: Type.Optional(Type.Boolean()),
|
|
132
|
+
channel: Type.Optional(Type.String()),
|
|
133
|
+
timeout: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
134
|
+
lane: Type.Optional(Type.String()),
|
|
135
|
+
extraSystemPrompt: Type.Optional(Type.String()),
|
|
136
|
+
idempotencyKey: NonEmptyString,
|
|
137
|
+
}, { additionalProperties: false });
|
|
138
|
+
export const AgentWaitParamsSchema = Type.Object({
|
|
139
|
+
runId: NonEmptyString,
|
|
140
|
+
afterMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
141
|
+
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
142
|
+
}, { additionalProperties: false });
|
|
143
|
+
export const WakeParamsSchema = Type.Object({
|
|
144
|
+
mode: Type.Union([Type.Literal("now"), Type.Literal("next-heartbeat")]),
|
|
145
|
+
text: NonEmptyString,
|
|
146
|
+
}, { additionalProperties: false });
|
|
147
|
+
export const NodePairRequestParamsSchema = Type.Object({
|
|
148
|
+
nodeId: NonEmptyString,
|
|
149
|
+
displayName: Type.Optional(NonEmptyString),
|
|
150
|
+
platform: Type.Optional(NonEmptyString),
|
|
151
|
+
version: Type.Optional(NonEmptyString),
|
|
152
|
+
deviceFamily: Type.Optional(NonEmptyString),
|
|
153
|
+
modelIdentifier: Type.Optional(NonEmptyString),
|
|
154
|
+
caps: Type.Optional(Type.Array(NonEmptyString)),
|
|
155
|
+
commands: Type.Optional(Type.Array(NonEmptyString)),
|
|
156
|
+
remoteIp: Type.Optional(NonEmptyString),
|
|
157
|
+
silent: Type.Optional(Type.Boolean()),
|
|
158
|
+
}, { additionalProperties: false });
|
|
159
|
+
export const NodePairListParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
160
|
+
export const NodePairApproveParamsSchema = Type.Object({ requestId: NonEmptyString }, { additionalProperties: false });
|
|
161
|
+
export const NodePairRejectParamsSchema = Type.Object({ requestId: NonEmptyString }, { additionalProperties: false });
|
|
162
|
+
export const NodePairVerifyParamsSchema = Type.Object({ nodeId: NonEmptyString, token: NonEmptyString }, { additionalProperties: false });
|
|
163
|
+
export const NodeRenameParamsSchema = Type.Object({ nodeId: NonEmptyString, displayName: NonEmptyString }, { additionalProperties: false });
|
|
164
|
+
export const NodeListParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
165
|
+
export const NodeDescribeParamsSchema = Type.Object({ nodeId: NonEmptyString }, { additionalProperties: false });
|
|
166
|
+
export const NodeInvokeParamsSchema = Type.Object({
|
|
167
|
+
nodeId: NonEmptyString,
|
|
168
|
+
command: NonEmptyString,
|
|
169
|
+
params: Type.Optional(Type.Unknown()),
|
|
170
|
+
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
171
|
+
idempotencyKey: NonEmptyString,
|
|
172
|
+
}, { additionalProperties: false });
|
|
173
|
+
export const SessionsListParamsSchema = Type.Object({
|
|
174
|
+
limit: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
175
|
+
activeMinutes: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
176
|
+
includeGlobal: Type.Optional(Type.Boolean()),
|
|
177
|
+
includeUnknown: Type.Optional(Type.Boolean()),
|
|
178
|
+
}, { additionalProperties: false });
|
|
179
|
+
export const SessionsPatchParamsSchema = Type.Object({
|
|
180
|
+
key: NonEmptyString,
|
|
181
|
+
thinkingLevel: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
182
|
+
verboseLevel: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
183
|
+
elevatedLevel: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
184
|
+
model: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
185
|
+
sendPolicy: Type.Optional(Type.Union([Type.Literal("allow"), Type.Literal("deny"), Type.Null()])),
|
|
186
|
+
groupActivation: Type.Optional(Type.Union([
|
|
187
|
+
Type.Literal("mention"),
|
|
188
|
+
Type.Literal("always"),
|
|
189
|
+
Type.Null(),
|
|
190
|
+
])),
|
|
191
|
+
}, { additionalProperties: false });
|
|
192
|
+
export const SessionsResetParamsSchema = Type.Object({ key: NonEmptyString }, { additionalProperties: false });
|
|
193
|
+
export const SessionsDeleteParamsSchema = Type.Object({
|
|
194
|
+
key: NonEmptyString,
|
|
195
|
+
deleteTranscript: Type.Optional(Type.Boolean()),
|
|
196
|
+
}, { additionalProperties: false });
|
|
197
|
+
export const SessionsCompactParamsSchema = Type.Object({
|
|
198
|
+
key: NonEmptyString,
|
|
199
|
+
maxLines: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
200
|
+
}, { additionalProperties: false });
|
|
201
|
+
export const ConfigGetParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
202
|
+
export const ConfigSetParamsSchema = Type.Object({
|
|
203
|
+
raw: NonEmptyString,
|
|
204
|
+
}, { additionalProperties: false });
|
|
205
|
+
export const ConfigSchemaParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
206
|
+
export const ConfigUiHintSchema = Type.Object({
|
|
207
|
+
label: Type.Optional(Type.String()),
|
|
208
|
+
help: Type.Optional(Type.String()),
|
|
209
|
+
group: Type.Optional(Type.String()),
|
|
210
|
+
order: Type.Optional(Type.Integer()),
|
|
211
|
+
advanced: Type.Optional(Type.Boolean()),
|
|
212
|
+
sensitive: Type.Optional(Type.Boolean()),
|
|
213
|
+
placeholder: Type.Optional(Type.String()),
|
|
214
|
+
itemTemplate: Type.Optional(Type.Unknown()),
|
|
215
|
+
}, { additionalProperties: false });
|
|
216
|
+
export const ConfigSchemaResponseSchema = Type.Object({
|
|
217
|
+
schema: Type.Unknown(),
|
|
218
|
+
uiHints: Type.Record(Type.String(), ConfigUiHintSchema),
|
|
219
|
+
version: NonEmptyString,
|
|
220
|
+
generatedAt: NonEmptyString,
|
|
221
|
+
}, { additionalProperties: false });
|
|
222
|
+
export const WizardStartParamsSchema = Type.Object({
|
|
223
|
+
mode: Type.Optional(Type.Union([Type.Literal("local"), Type.Literal("remote")])),
|
|
224
|
+
workspace: Type.Optional(Type.String()),
|
|
225
|
+
}, { additionalProperties: false });
|
|
226
|
+
export const WizardAnswerSchema = Type.Object({
|
|
227
|
+
stepId: NonEmptyString,
|
|
228
|
+
value: Type.Optional(Type.Unknown()),
|
|
229
|
+
}, { additionalProperties: false });
|
|
230
|
+
export const WizardNextParamsSchema = Type.Object({
|
|
231
|
+
sessionId: NonEmptyString,
|
|
232
|
+
answer: Type.Optional(WizardAnswerSchema),
|
|
233
|
+
}, { additionalProperties: false });
|
|
234
|
+
export const WizardCancelParamsSchema = Type.Object({
|
|
235
|
+
sessionId: NonEmptyString,
|
|
236
|
+
}, { additionalProperties: false });
|
|
237
|
+
export const WizardStatusParamsSchema = Type.Object({
|
|
238
|
+
sessionId: NonEmptyString,
|
|
239
|
+
}, { additionalProperties: false });
|
|
240
|
+
export const WizardStepOptionSchema = Type.Object({
|
|
241
|
+
value: Type.Unknown(),
|
|
242
|
+
label: NonEmptyString,
|
|
243
|
+
hint: Type.Optional(Type.String()),
|
|
244
|
+
}, { additionalProperties: false });
|
|
245
|
+
export const WizardStepSchema = Type.Object({
|
|
246
|
+
id: NonEmptyString,
|
|
247
|
+
type: Type.Union([
|
|
248
|
+
Type.Literal("note"),
|
|
249
|
+
Type.Literal("select"),
|
|
250
|
+
Type.Literal("text"),
|
|
251
|
+
Type.Literal("confirm"),
|
|
252
|
+
Type.Literal("multiselect"),
|
|
253
|
+
Type.Literal("progress"),
|
|
254
|
+
Type.Literal("action"),
|
|
255
|
+
]),
|
|
256
|
+
title: Type.Optional(Type.String()),
|
|
257
|
+
message: Type.Optional(Type.String()),
|
|
258
|
+
options: Type.Optional(Type.Array(WizardStepOptionSchema)),
|
|
259
|
+
initialValue: Type.Optional(Type.Unknown()),
|
|
260
|
+
placeholder: Type.Optional(Type.String()),
|
|
261
|
+
sensitive: Type.Optional(Type.Boolean()),
|
|
262
|
+
executor: Type.Optional(Type.Union([Type.Literal("gateway"), Type.Literal("client")])),
|
|
263
|
+
}, { additionalProperties: false });
|
|
264
|
+
export const WizardNextResultSchema = Type.Object({
|
|
265
|
+
done: Type.Boolean(),
|
|
266
|
+
step: Type.Optional(WizardStepSchema),
|
|
267
|
+
status: Type.Optional(Type.Union([
|
|
268
|
+
Type.Literal("running"),
|
|
269
|
+
Type.Literal("done"),
|
|
270
|
+
Type.Literal("cancelled"),
|
|
271
|
+
Type.Literal("error"),
|
|
272
|
+
])),
|
|
273
|
+
error: Type.Optional(Type.String()),
|
|
274
|
+
}, { additionalProperties: false });
|
|
275
|
+
export const WizardStartResultSchema = Type.Object({
|
|
276
|
+
sessionId: NonEmptyString,
|
|
277
|
+
done: Type.Boolean(),
|
|
278
|
+
step: Type.Optional(WizardStepSchema),
|
|
279
|
+
status: Type.Optional(Type.Union([
|
|
280
|
+
Type.Literal("running"),
|
|
281
|
+
Type.Literal("done"),
|
|
282
|
+
Type.Literal("cancelled"),
|
|
283
|
+
Type.Literal("error"),
|
|
284
|
+
])),
|
|
285
|
+
error: Type.Optional(Type.String()),
|
|
286
|
+
}, { additionalProperties: false });
|
|
287
|
+
export const WizardStatusResultSchema = Type.Object({
|
|
288
|
+
status: Type.Union([
|
|
289
|
+
Type.Literal("running"),
|
|
290
|
+
Type.Literal("done"),
|
|
291
|
+
Type.Literal("cancelled"),
|
|
292
|
+
Type.Literal("error"),
|
|
293
|
+
]),
|
|
294
|
+
error: Type.Optional(Type.String()),
|
|
295
|
+
}, { additionalProperties: false });
|
|
296
|
+
export const TalkModeParamsSchema = Type.Object({
|
|
297
|
+
enabled: Type.Boolean(),
|
|
298
|
+
phase: Type.Optional(Type.String()),
|
|
299
|
+
}, { additionalProperties: false });
|
|
300
|
+
export const ProvidersStatusParamsSchema = Type.Object({
|
|
301
|
+
probe: Type.Optional(Type.Boolean()),
|
|
302
|
+
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
303
|
+
}, { additionalProperties: false });
|
|
304
|
+
export const WebLoginStartParamsSchema = Type.Object({
|
|
305
|
+
force: Type.Optional(Type.Boolean()),
|
|
306
|
+
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
307
|
+
verbose: Type.Optional(Type.Boolean()),
|
|
308
|
+
}, { additionalProperties: false });
|
|
309
|
+
export const WebLoginWaitParamsSchema = Type.Object({
|
|
310
|
+
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
311
|
+
}, { additionalProperties: false });
|
|
312
|
+
export const ModelChoiceSchema = Type.Object({
|
|
313
|
+
id: NonEmptyString,
|
|
314
|
+
name: NonEmptyString,
|
|
315
|
+
provider: NonEmptyString,
|
|
316
|
+
contextWindow: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
317
|
+
reasoning: Type.Optional(Type.Boolean()),
|
|
318
|
+
}, { additionalProperties: false });
|
|
319
|
+
export const ModelsListParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
320
|
+
export const ModelsListResultSchema = Type.Object({
|
|
321
|
+
models: Type.Array(ModelChoiceSchema),
|
|
322
|
+
}, { additionalProperties: false });
|
|
323
|
+
export const SkillsStatusParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
324
|
+
export const SkillsInstallParamsSchema = Type.Object({
|
|
325
|
+
name: NonEmptyString,
|
|
326
|
+
installId: NonEmptyString,
|
|
327
|
+
timeoutMs: Type.Optional(Type.Integer({ minimum: 1000 })),
|
|
328
|
+
}, { additionalProperties: false });
|
|
329
|
+
export const SkillsUpdateParamsSchema = Type.Object({
|
|
330
|
+
skillKey: NonEmptyString,
|
|
331
|
+
enabled: Type.Optional(Type.Boolean()),
|
|
332
|
+
apiKey: Type.Optional(Type.String()),
|
|
333
|
+
env: Type.Optional(Type.Record(NonEmptyString, Type.String())),
|
|
334
|
+
}, { additionalProperties: false });
|
|
335
|
+
export const CronScheduleSchema = Type.Union([
|
|
336
|
+
Type.Object({
|
|
337
|
+
kind: Type.Literal("at"),
|
|
338
|
+
atMs: Type.Integer({ minimum: 0 }),
|
|
339
|
+
}, { additionalProperties: false }),
|
|
340
|
+
Type.Object({
|
|
341
|
+
kind: Type.Literal("every"),
|
|
342
|
+
everyMs: Type.Integer({ minimum: 1 }),
|
|
343
|
+
anchorMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
344
|
+
}, { additionalProperties: false }),
|
|
345
|
+
Type.Object({
|
|
346
|
+
kind: Type.Literal("cron"),
|
|
347
|
+
expr: NonEmptyString,
|
|
348
|
+
tz: Type.Optional(Type.String()),
|
|
349
|
+
}, { additionalProperties: false }),
|
|
350
|
+
]);
|
|
351
|
+
export const CronPayloadSchema = Type.Union([
|
|
352
|
+
Type.Object({
|
|
353
|
+
kind: Type.Literal("systemEvent"),
|
|
354
|
+
text: NonEmptyString,
|
|
355
|
+
}, { additionalProperties: false }),
|
|
356
|
+
Type.Object({
|
|
357
|
+
kind: Type.Literal("agentTurn"),
|
|
358
|
+
message: NonEmptyString,
|
|
359
|
+
thinking: Type.Optional(Type.String()),
|
|
360
|
+
timeoutSeconds: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
361
|
+
deliver: Type.Optional(Type.Boolean()),
|
|
362
|
+
channel: Type.Optional(Type.Union([
|
|
363
|
+
Type.Literal("last"),
|
|
364
|
+
Type.Literal("whatsapp"),
|
|
365
|
+
Type.Literal("telegram"),
|
|
366
|
+
Type.Literal("discord"),
|
|
367
|
+
Type.Literal("slack"),
|
|
368
|
+
])),
|
|
369
|
+
to: Type.Optional(Type.String()),
|
|
370
|
+
bestEffortDeliver: Type.Optional(Type.Boolean()),
|
|
371
|
+
}, { additionalProperties: false }),
|
|
372
|
+
]);
|
|
373
|
+
export const CronIsolationSchema = Type.Object({
|
|
374
|
+
postToMainPrefix: Type.Optional(Type.String()),
|
|
375
|
+
}, { additionalProperties: false });
|
|
376
|
+
export const CronJobStateSchema = Type.Object({
|
|
377
|
+
nextRunAtMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
378
|
+
runningAtMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
379
|
+
lastRunAtMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
380
|
+
lastStatus: Type.Optional(Type.Union([
|
|
381
|
+
Type.Literal("ok"),
|
|
382
|
+
Type.Literal("error"),
|
|
383
|
+
Type.Literal("skipped"),
|
|
384
|
+
])),
|
|
385
|
+
lastError: Type.Optional(Type.String()),
|
|
386
|
+
lastDurationMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
387
|
+
}, { additionalProperties: false });
|
|
388
|
+
export const CronJobSchema = Type.Object({
|
|
389
|
+
id: NonEmptyString,
|
|
390
|
+
name: NonEmptyString,
|
|
391
|
+
description: Type.Optional(Type.String()),
|
|
392
|
+
enabled: Type.Boolean(),
|
|
393
|
+
createdAtMs: Type.Integer({ minimum: 0 }),
|
|
394
|
+
updatedAtMs: Type.Integer({ minimum: 0 }),
|
|
395
|
+
schedule: CronScheduleSchema,
|
|
396
|
+
sessionTarget: Type.Union([Type.Literal("main"), Type.Literal("isolated")]),
|
|
397
|
+
wakeMode: Type.Union([Type.Literal("next-heartbeat"), Type.Literal("now")]),
|
|
398
|
+
payload: CronPayloadSchema,
|
|
399
|
+
isolation: Type.Optional(CronIsolationSchema),
|
|
400
|
+
state: CronJobStateSchema,
|
|
401
|
+
}, { additionalProperties: false });
|
|
402
|
+
export const CronListParamsSchema = Type.Object({
|
|
403
|
+
includeDisabled: Type.Optional(Type.Boolean()),
|
|
404
|
+
}, { additionalProperties: false });
|
|
405
|
+
export const CronStatusParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
406
|
+
export const CronAddParamsSchema = Type.Object({
|
|
407
|
+
name: NonEmptyString,
|
|
408
|
+
description: Type.Optional(Type.String()),
|
|
409
|
+
enabled: Type.Optional(Type.Boolean()),
|
|
410
|
+
schedule: CronScheduleSchema,
|
|
411
|
+
sessionTarget: Type.Union([Type.Literal("main"), Type.Literal("isolated")]),
|
|
412
|
+
wakeMode: Type.Union([Type.Literal("next-heartbeat"), Type.Literal("now")]),
|
|
413
|
+
payload: CronPayloadSchema,
|
|
414
|
+
isolation: Type.Optional(CronIsolationSchema),
|
|
415
|
+
}, { additionalProperties: false });
|
|
416
|
+
export const CronUpdateParamsSchema = Type.Object({
|
|
417
|
+
id: NonEmptyString,
|
|
418
|
+
patch: Type.Partial(CronAddParamsSchema),
|
|
419
|
+
}, { additionalProperties: false });
|
|
420
|
+
export const CronRemoveParamsSchema = Type.Object({
|
|
421
|
+
id: NonEmptyString,
|
|
422
|
+
}, { additionalProperties: false });
|
|
423
|
+
export const CronRunParamsSchema = Type.Object({
|
|
424
|
+
id: NonEmptyString,
|
|
425
|
+
mode: Type.Optional(Type.Union([Type.Literal("due"), Type.Literal("force")])),
|
|
426
|
+
}, { additionalProperties: false });
|
|
427
|
+
export const CronRunsParamsSchema = Type.Object({
|
|
428
|
+
id: NonEmptyString,
|
|
429
|
+
limit: Type.Optional(Type.Integer({ minimum: 1, maximum: 5000 })),
|
|
430
|
+
}, { additionalProperties: false });
|
|
431
|
+
export const CronRunLogEntrySchema = Type.Object({
|
|
432
|
+
ts: Type.Integer({ minimum: 0 }),
|
|
433
|
+
jobId: NonEmptyString,
|
|
434
|
+
action: Type.Literal("finished"),
|
|
435
|
+
status: Type.Optional(Type.Union([
|
|
436
|
+
Type.Literal("ok"),
|
|
437
|
+
Type.Literal("error"),
|
|
438
|
+
Type.Literal("skipped"),
|
|
439
|
+
])),
|
|
440
|
+
error: Type.Optional(Type.String()),
|
|
441
|
+
summary: Type.Optional(Type.String()),
|
|
442
|
+
runAtMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
443
|
+
durationMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
444
|
+
nextRunAtMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
445
|
+
}, { additionalProperties: false });
|
|
446
|
+
// WebChat/WebSocket-native chat methods
|
|
447
|
+
export const ChatHistoryParamsSchema = Type.Object({
|
|
448
|
+
sessionKey: NonEmptyString,
|
|
449
|
+
limit: Type.Optional(Type.Integer({ minimum: 1, maximum: 1000 })),
|
|
450
|
+
}, { additionalProperties: false });
|
|
451
|
+
export const ChatSendParamsSchema = Type.Object({
|
|
452
|
+
sessionKey: NonEmptyString,
|
|
453
|
+
message: NonEmptyString,
|
|
454
|
+
thinking: Type.Optional(Type.String()),
|
|
455
|
+
deliver: Type.Optional(Type.Boolean()),
|
|
456
|
+
attachments: Type.Optional(Type.Array(Type.Unknown())),
|
|
457
|
+
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
458
|
+
idempotencyKey: NonEmptyString,
|
|
459
|
+
}, { additionalProperties: false });
|
|
460
|
+
export const ChatAbortParamsSchema = Type.Object({
|
|
461
|
+
sessionKey: NonEmptyString,
|
|
462
|
+
runId: NonEmptyString,
|
|
463
|
+
}, { additionalProperties: false });
|
|
464
|
+
export const ChatEventSchema = Type.Object({
|
|
465
|
+
runId: NonEmptyString,
|
|
466
|
+
sessionKey: NonEmptyString,
|
|
467
|
+
seq: Type.Integer({ minimum: 0 }),
|
|
468
|
+
state: Type.Union([
|
|
469
|
+
Type.Literal("delta"),
|
|
470
|
+
Type.Literal("final"),
|
|
471
|
+
Type.Literal("aborted"),
|
|
472
|
+
Type.Literal("error"),
|
|
473
|
+
]),
|
|
474
|
+
message: Type.Optional(Type.Unknown()),
|
|
475
|
+
errorMessage: Type.Optional(Type.String()),
|
|
476
|
+
usage: Type.Optional(Type.Unknown()),
|
|
477
|
+
stopReason: Type.Optional(Type.String()),
|
|
478
|
+
}, { additionalProperties: false });
|
|
479
|
+
export const ProtocolSchemas = {
|
|
480
|
+
ConnectParams: ConnectParamsSchema,
|
|
481
|
+
HelloOk: HelloOkSchema,
|
|
482
|
+
RequestFrame: RequestFrameSchema,
|
|
483
|
+
ResponseFrame: ResponseFrameSchema,
|
|
484
|
+
EventFrame: EventFrameSchema,
|
|
485
|
+
GatewayFrame: GatewayFrameSchema,
|
|
486
|
+
PresenceEntry: PresenceEntrySchema,
|
|
487
|
+
StateVersion: StateVersionSchema,
|
|
488
|
+
Snapshot: SnapshotSchema,
|
|
489
|
+
ErrorShape: ErrorShapeSchema,
|
|
490
|
+
AgentEvent: AgentEventSchema,
|
|
491
|
+
SendParams: SendParamsSchema,
|
|
492
|
+
AgentParams: AgentParamsSchema,
|
|
493
|
+
AgentWaitParams: AgentWaitParamsSchema,
|
|
494
|
+
WakeParams: WakeParamsSchema,
|
|
495
|
+
NodePairRequestParams: NodePairRequestParamsSchema,
|
|
496
|
+
NodePairListParams: NodePairListParamsSchema,
|
|
497
|
+
NodePairApproveParams: NodePairApproveParamsSchema,
|
|
498
|
+
NodePairRejectParams: NodePairRejectParamsSchema,
|
|
499
|
+
NodePairVerifyParams: NodePairVerifyParamsSchema,
|
|
500
|
+
NodeRenameParams: NodeRenameParamsSchema,
|
|
501
|
+
NodeListParams: NodeListParamsSchema,
|
|
502
|
+
NodeDescribeParams: NodeDescribeParamsSchema,
|
|
503
|
+
NodeInvokeParams: NodeInvokeParamsSchema,
|
|
504
|
+
SessionsListParams: SessionsListParamsSchema,
|
|
505
|
+
SessionsPatchParams: SessionsPatchParamsSchema,
|
|
506
|
+
SessionsResetParams: SessionsResetParamsSchema,
|
|
507
|
+
SessionsDeleteParams: SessionsDeleteParamsSchema,
|
|
508
|
+
SessionsCompactParams: SessionsCompactParamsSchema,
|
|
509
|
+
ConfigGetParams: ConfigGetParamsSchema,
|
|
510
|
+
ConfigSetParams: ConfigSetParamsSchema,
|
|
511
|
+
ConfigSchemaParams: ConfigSchemaParamsSchema,
|
|
512
|
+
ConfigSchemaResponse: ConfigSchemaResponseSchema,
|
|
513
|
+
WizardStartParams: WizardStartParamsSchema,
|
|
514
|
+
WizardNextParams: WizardNextParamsSchema,
|
|
515
|
+
WizardCancelParams: WizardCancelParamsSchema,
|
|
516
|
+
WizardStatusParams: WizardStatusParamsSchema,
|
|
517
|
+
WizardStep: WizardStepSchema,
|
|
518
|
+
WizardNextResult: WizardNextResultSchema,
|
|
519
|
+
WizardStartResult: WizardStartResultSchema,
|
|
520
|
+
WizardStatusResult: WizardStatusResultSchema,
|
|
521
|
+
TalkModeParams: TalkModeParamsSchema,
|
|
522
|
+
ProvidersStatusParams: ProvidersStatusParamsSchema,
|
|
523
|
+
WebLoginStartParams: WebLoginStartParamsSchema,
|
|
524
|
+
WebLoginWaitParams: WebLoginWaitParamsSchema,
|
|
525
|
+
ModelChoice: ModelChoiceSchema,
|
|
526
|
+
ModelsListParams: ModelsListParamsSchema,
|
|
527
|
+
ModelsListResult: ModelsListResultSchema,
|
|
528
|
+
SkillsStatusParams: SkillsStatusParamsSchema,
|
|
529
|
+
SkillsInstallParams: SkillsInstallParamsSchema,
|
|
530
|
+
SkillsUpdateParams: SkillsUpdateParamsSchema,
|
|
531
|
+
CronJob: CronJobSchema,
|
|
532
|
+
CronListParams: CronListParamsSchema,
|
|
533
|
+
CronStatusParams: CronStatusParamsSchema,
|
|
534
|
+
CronAddParams: CronAddParamsSchema,
|
|
535
|
+
CronUpdateParams: CronUpdateParamsSchema,
|
|
536
|
+
CronRemoveParams: CronRemoveParamsSchema,
|
|
537
|
+
CronRunParams: CronRunParamsSchema,
|
|
538
|
+
CronRunsParams: CronRunsParamsSchema,
|
|
539
|
+
CronRunLogEntry: CronRunLogEntrySchema,
|
|
540
|
+
ChatHistoryParams: ChatHistoryParamsSchema,
|
|
541
|
+
ChatSendParams: ChatSendParamsSchema,
|
|
542
|
+
ChatAbortParams: ChatAbortParamsSchema,
|
|
543
|
+
ChatEvent: ChatEventSchema,
|
|
544
|
+
TickEvent: TickEventSchema,
|
|
545
|
+
ShutdownEvent: ShutdownEventSchema,
|
|
546
|
+
};
|
|
547
|
+
export const PROTOCOL_VERSION = 2;
|
|
548
|
+
export const ErrorCodes = {
|
|
549
|
+
NOT_LINKED: "NOT_LINKED",
|
|
550
|
+
AGENT_TIMEOUT: "AGENT_TIMEOUT",
|
|
551
|
+
INVALID_REQUEST: "INVALID_REQUEST",
|
|
552
|
+
UNAVAILABLE: "UNAVAILABLE",
|
|
553
|
+
};
|
|
554
|
+
export function errorShape(code, message, opts) {
|
|
555
|
+
return {
|
|
556
|
+
code,
|
|
557
|
+
message,
|
|
558
|
+
...opts,
|
|
559
|
+
};
|
|
560
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export function createBridgeSubscriptionManager() {
|
|
2
|
+
const bridgeNodeSubscriptions = new Map();
|
|
3
|
+
const bridgeSessionSubscribers = new Map();
|
|
4
|
+
const toPayloadJSON = (payload) => payload ? JSON.stringify(payload) : null;
|
|
5
|
+
const subscribe = (nodeId, sessionKey) => {
|
|
6
|
+
const normalizedNodeId = nodeId.trim();
|
|
7
|
+
const normalizedSessionKey = sessionKey.trim();
|
|
8
|
+
if (!normalizedNodeId || !normalizedSessionKey)
|
|
9
|
+
return;
|
|
10
|
+
let nodeSet = bridgeNodeSubscriptions.get(normalizedNodeId);
|
|
11
|
+
if (!nodeSet) {
|
|
12
|
+
nodeSet = new Set();
|
|
13
|
+
bridgeNodeSubscriptions.set(normalizedNodeId, nodeSet);
|
|
14
|
+
}
|
|
15
|
+
if (nodeSet.has(normalizedSessionKey))
|
|
16
|
+
return;
|
|
17
|
+
nodeSet.add(normalizedSessionKey);
|
|
18
|
+
let sessionSet = bridgeSessionSubscribers.get(normalizedSessionKey);
|
|
19
|
+
if (!sessionSet) {
|
|
20
|
+
sessionSet = new Set();
|
|
21
|
+
bridgeSessionSubscribers.set(normalizedSessionKey, sessionSet);
|
|
22
|
+
}
|
|
23
|
+
sessionSet.add(normalizedNodeId);
|
|
24
|
+
};
|
|
25
|
+
const unsubscribe = (nodeId, sessionKey) => {
|
|
26
|
+
const normalizedNodeId = nodeId.trim();
|
|
27
|
+
const normalizedSessionKey = sessionKey.trim();
|
|
28
|
+
if (!normalizedNodeId || !normalizedSessionKey)
|
|
29
|
+
return;
|
|
30
|
+
const nodeSet = bridgeNodeSubscriptions.get(normalizedNodeId);
|
|
31
|
+
nodeSet?.delete(normalizedSessionKey);
|
|
32
|
+
if (nodeSet?.size === 0)
|
|
33
|
+
bridgeNodeSubscriptions.delete(normalizedNodeId);
|
|
34
|
+
const sessionSet = bridgeSessionSubscribers.get(normalizedSessionKey);
|
|
35
|
+
sessionSet?.delete(normalizedNodeId);
|
|
36
|
+
if (sessionSet?.size === 0)
|
|
37
|
+
bridgeSessionSubscribers.delete(normalizedSessionKey);
|
|
38
|
+
};
|
|
39
|
+
const unsubscribeAll = (nodeId) => {
|
|
40
|
+
const normalizedNodeId = nodeId.trim();
|
|
41
|
+
const nodeSet = bridgeNodeSubscriptions.get(normalizedNodeId);
|
|
42
|
+
if (!nodeSet)
|
|
43
|
+
return;
|
|
44
|
+
for (const sessionKey of nodeSet) {
|
|
45
|
+
const sessionSet = bridgeSessionSubscribers.get(sessionKey);
|
|
46
|
+
sessionSet?.delete(normalizedNodeId);
|
|
47
|
+
if (sessionSet?.size === 0)
|
|
48
|
+
bridgeSessionSubscribers.delete(sessionKey);
|
|
49
|
+
}
|
|
50
|
+
bridgeNodeSubscriptions.delete(normalizedNodeId);
|
|
51
|
+
};
|
|
52
|
+
const sendToSession = (sessionKey, event, payload, sendEvent) => {
|
|
53
|
+
const normalizedSessionKey = sessionKey.trim();
|
|
54
|
+
if (!normalizedSessionKey || !sendEvent)
|
|
55
|
+
return;
|
|
56
|
+
const subs = bridgeSessionSubscribers.get(normalizedSessionKey);
|
|
57
|
+
if (!subs || subs.size === 0)
|
|
58
|
+
return;
|
|
59
|
+
const payloadJSON = toPayloadJSON(payload);
|
|
60
|
+
for (const nodeId of subs) {
|
|
61
|
+
sendEvent({ nodeId, event, payloadJSON });
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const sendToAllSubscribed = (event, payload, sendEvent) => {
|
|
65
|
+
if (!sendEvent)
|
|
66
|
+
return;
|
|
67
|
+
const payloadJSON = toPayloadJSON(payload);
|
|
68
|
+
for (const nodeId of bridgeNodeSubscriptions.keys()) {
|
|
69
|
+
sendEvent({ nodeId, event, payloadJSON });
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const sendToAllConnected = (event, payload, listConnected, sendEvent) => {
|
|
73
|
+
if (!sendEvent || !listConnected)
|
|
74
|
+
return;
|
|
75
|
+
const payloadJSON = toPayloadJSON(payload);
|
|
76
|
+
for (const node of listConnected()) {
|
|
77
|
+
sendEvent({ nodeId: node.nodeId, event, payloadJSON });
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const clear = () => {
|
|
81
|
+
bridgeNodeSubscriptions.clear();
|
|
82
|
+
bridgeSessionSubscribers.clear();
|
|
83
|
+
};
|
|
84
|
+
return {
|
|
85
|
+
subscribe,
|
|
86
|
+
unsubscribe,
|
|
87
|
+
unsubscribeAll,
|
|
88
|
+
sendToSession,
|
|
89
|
+
sendToAllSubscribed,
|
|
90
|
+
sendToAllConnected,
|
|
91
|
+
clear,
|
|
92
|
+
};
|
|
93
|
+
}
|