loudmouth-ai 0.1.0
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 +1158 -0
- package/LICENSE +21 -0
- package/README.md +128 -0
- package/assets/avatar-placeholder.svg +19 -0
- package/assets/chrome-extension/README.md +22 -0
- package/assets/chrome-extension/background.js +438 -0
- package/assets/chrome-extension/icons/icon128.png +0 -0
- package/assets/chrome-extension/icons/icon16.png +0 -0
- package/assets/chrome-extension/icons/icon32.png +0 -0
- package/assets/chrome-extension/icons/icon48.png +0 -0
- package/assets/chrome-extension/manifest.json +25 -0
- package/assets/chrome-extension/options.html +197 -0
- package/assets/chrome-extension/options.js +59 -0
- package/assets/dmg-background-small.png +0 -0
- package/assets/dmg-background.png +0 -0
- package/dist/acp/client.js +144 -0
- package/dist/acp/commands.js +38 -0
- package/dist/acp/event-mapper.js +70 -0
- package/dist/acp/index.js +2 -0
- package/dist/acp/meta.js +30 -0
- package/dist/acp/server.js +131 -0
- package/dist/acp/session-mapper.js +65 -0
- package/dist/acp/session.js +68 -0
- package/dist/acp/translator.js +344 -0
- package/dist/acp/types.js +6 -0
- package/dist/agents/agent-paths.js +19 -0
- package/dist/agents/agent-scope.js +118 -0
- package/dist/agents/anthropic-payload-log.js +160 -0
- package/dist/agents/apply-patch-update.js +145 -0
- package/dist/agents/apply-patch.js +355 -0
- package/dist/agents/auth-health.js +165 -0
- package/dist/agents/auth-profiles/constants.js +20 -0
- package/dist/agents/auth-profiles/display.js +10 -0
- package/dist/agents/auth-profiles/doctor.js +31 -0
- package/dist/agents/auth-profiles/external-cli-sync.js +62 -0
- package/dist/agents/auth-profiles/oauth.js +193 -0
- package/dist/agents/auth-profiles/order.js +166 -0
- package/dist/agents/auth-profiles/paths.js +27 -0
- package/dist/agents/auth-profiles/profiles.js +63 -0
- package/dist/agents/auth-profiles/repair.js +120 -0
- package/dist/agents/auth-profiles/session-override.js +97 -0
- package/dist/agents/auth-profiles/store.js +323 -0
- package/dist/agents/auth-profiles/types.js +1 -0
- package/dist/agents/auth-profiles/usage.js +235 -0
- package/dist/agents/auth-profiles.js +10 -0
- package/dist/agents/bash-process-registry.js +177 -0
- package/dist/agents/bash-tools.exec.js +1176 -0
- package/dist/agents/bash-tools.js +2 -0
- package/dist/agents/bash-tools.process.js +569 -0
- package/dist/agents/bash-tools.shared.js +191 -0
- package/dist/agents/bedrock-discovery.js +157 -0
- package/dist/agents/bootstrap-files.js +28 -0
- package/dist/agents/bootstrap-hooks.js +19 -0
- package/dist/agents/cache-trace.js +185 -0
- package/dist/agents/channel-tools.js +58 -0
- package/dist/agents/chutes-oauth.js +133 -0
- package/dist/agents/claude-cli-runner.js +3 -0
- package/dist/agents/clawdbot-tools.js +124 -0
- package/dist/agents/cli-backends.js +126 -0
- package/dist/agents/cli-credentials.js +360 -0
- package/dist/agents/cli-runner/helpers.js +409 -0
- package/dist/agents/cli-runner.js +265 -0
- package/dist/agents/cli-session.js +27 -0
- package/dist/agents/compaction.js +226 -0
- package/dist/agents/context-window-guard.js +37 -0
- package/dist/agents/context.js +34 -0
- package/dist/agents/date-time.js +158 -0
- package/dist/agents/defaults.js +6 -0
- package/dist/agents/docs-path.js +20 -0
- package/dist/agents/failover-error.js +164 -0
- package/dist/agents/identity-avatar.js +82 -0
- package/dist/agents/identity-file.js +80 -0
- package/dist/agents/identity.js +61 -0
- package/dist/agents/lanes.js +2 -0
- package/dist/agents/live-auth-keys.js +70 -0
- package/dist/agents/live-model-filter.js +70 -0
- package/dist/agents/memory-search.js +184 -0
- package/dist/agents/minimax-vlm.js +81 -0
- package/dist/agents/model-auth.js +273 -0
- package/dist/agents/model-catalog.js +95 -0
- package/dist/agents/model-compat.js +17 -0
- package/dist/agents/model-fallback.js +246 -0
- package/dist/agents/model-scan.js +350 -0
- package/dist/agents/model-selection.js +284 -0
- package/dist/agents/models-config.js +111 -0
- package/dist/agents/models-config.providers.js +423 -0
- package/dist/agents/opencode-zen-models.js +254 -0
- package/dist/agents/pi-embedded-block-chunker.js +209 -0
- package/dist/agents/pi-embedded-helpers/bootstrap.js +159 -0
- package/dist/agents/pi-embedded-helpers/errors.js +436 -0
- package/dist/agents/pi-embedded-helpers/google.js +12 -0
- package/dist/agents/pi-embedded-helpers/images.js +92 -0
- package/dist/agents/pi-embedded-helpers/messaging-dedupe.js +35 -0
- package/dist/agents/pi-embedded-helpers/openai.js +98 -0
- package/dist/agents/pi-embedded-helpers/thinking.js +32 -0
- package/dist/agents/pi-embedded-helpers/turns.js +95 -0
- package/dist/agents/pi-embedded-helpers/types.js +1 -0
- package/dist/agents/pi-embedded-helpers.js +9 -0
- package/dist/agents/pi-embedded-messaging.js +24 -0
- package/dist/agents/pi-embedded-runner/abort.js +9 -0
- package/dist/agents/pi-embedded-runner/cache-ttl.js +45 -0
- package/dist/agents/pi-embedded-runner/compact.js +405 -0
- package/dist/agents/pi-embedded-runner/extensions.js +59 -0
- package/dist/agents/pi-embedded-runner/extra-params.js +70 -0
- package/dist/agents/pi-embedded-runner/google.js +302 -0
- package/dist/agents/pi-embedded-runner/history.js +61 -0
- package/dist/agents/pi-embedded-runner/lanes.js +11 -0
- package/dist/agents/pi-embedded-runner/logger.js +2 -0
- package/dist/agents/pi-embedded-runner/model.js +70 -0
- package/dist/agents/pi-embedded-runner/run/attempt.js +748 -0
- package/dist/agents/pi-embedded-runner/run/images.js +344 -0
- package/dist/agents/pi-embedded-runner/run/params.js +1 -0
- package/dist/agents/pi-embedded-runner/run/payloads.js +162 -0
- package/dist/agents/pi-embedded-runner/run/types.js +1 -0
- package/dist/agents/pi-embedded-runner/run.js +535 -0
- package/dist/agents/pi-embedded-runner/runs.js +107 -0
- package/dist/agents/pi-embedded-runner/sandbox-info.js +25 -0
- package/dist/agents/pi-embedded-runner/session-manager-cache.js +54 -0
- package/dist/agents/pi-embedded-runner/session-manager-init.js +31 -0
- package/dist/agents/pi-embedded-runner/system-prompt.js +33 -0
- package/dist/agents/pi-embedded-runner/tool-split.js +8 -0
- package/dist/agents/pi-embedded-runner/types.js +1 -0
- package/dist/agents/pi-embedded-runner/utils.js +25 -0
- package/dist/agents/pi-embedded-runner.js +10 -0
- package/dist/agents/pi-embedded-subscribe.handlers.js +45 -0
- package/dist/agents/pi-embedded-subscribe.handlers.lifecycle.js +86 -0
- package/dist/agents/pi-embedded-subscribe.handlers.messages.js +230 -0
- package/dist/agents/pi-embedded-subscribe.handlers.tools.js +176 -0
- package/dist/agents/pi-embedded-subscribe.handlers.types.js +1 -0
- package/dist/agents/pi-embedded-subscribe.js +454 -0
- package/dist/agents/pi-embedded-subscribe.raw-stream.js +27 -0
- package/dist/agents/pi-embedded-subscribe.tools.js +166 -0
- package/dist/agents/pi-embedded-subscribe.types.js +1 -0
- package/dist/agents/pi-embedded-utils.js +341 -0
- package/dist/agents/pi-embedded.js +1 -0
- package/dist/agents/pi-extensions/compaction-safeguard.js +223 -0
- package/dist/agents/pi-extensions/context-pruning/extension.js +32 -0
- package/dist/agents/pi-extensions/context-pruning/pruner.js +263 -0
- package/dist/agents/pi-extensions/context-pruning/runtime.js +21 -0
- package/dist/agents/pi-extensions/context-pruning/settings.js +71 -0
- package/dist/agents/pi-extensions/context-pruning/tools.js +44 -0
- package/dist/agents/pi-extensions/context-pruning.js +9 -0
- package/dist/agents/pi-settings.js +19 -0
- package/dist/agents/pi-tool-definition-adapter.js +74 -0
- package/dist/agents/pi-tools.abort.js +41 -0
- package/dist/agents/pi-tools.js +289 -0
- package/dist/agents/pi-tools.policy.js +212 -0
- package/dist/agents/pi-tools.read.js +227 -0
- package/dist/agents/pi-tools.schema.js +147 -0
- package/dist/agents/pi-tools.types.js +1 -0
- package/dist/agents/pty-dsr.js +13 -0
- package/dist/agents/pty-keys.js +235 -0
- package/dist/agents/sandbox/browser-bridges.js +1 -0
- package/dist/agents/sandbox/browser.js +178 -0
- package/dist/agents/sandbox/config-hash.js +45 -0
- package/dist/agents/sandbox/config.js +126 -0
- package/dist/agents/sandbox/constants.js +45 -0
- package/dist/agents/sandbox/context.js +117 -0
- package/dist/agents/sandbox/docker.js +272 -0
- package/dist/agents/sandbox/manage.js +91 -0
- package/dist/agents/sandbox/prune.js +87 -0
- package/dist/agents/sandbox/registry.js +71 -0
- package/dist/agents/sandbox/runtime-status.js +90 -0
- package/dist/agents/sandbox/shared.js +38 -0
- package/dist/agents/sandbox/tool-policy.js +106 -0
- package/dist/agents/sandbox/types.docker.js +1 -0
- package/dist/agents/sandbox/types.js +1 -0
- package/dist/agents/sandbox/workspace.js +39 -0
- package/dist/agents/sandbox-paths.js +68 -0
- package/dist/agents/sandbox.js +7 -0
- package/dist/agents/schema/clean-for-gemini.js +295 -0
- package/dist/agents/schema/typebox.js +22 -0
- package/dist/agents/session-slug.js +134 -0
- package/dist/agents/session-tool-result-guard-wrapper.js +34 -0
- package/dist/agents/session-tool-result-guard.js +99 -0
- package/dist/agents/session-transcript-repair.js +174 -0
- package/dist/agents/session-write-lock.js +102 -0
- package/dist/agents/shell-utils.js +99 -0
- package/dist/agents/skills/bundled-dir.js +30 -0
- package/dist/agents/skills/config.js +141 -0
- package/dist/agents/skills/env-overrides.js +67 -0
- package/dist/agents/skills/frontmatter.js +119 -0
- package/dist/agents/skills/plugin-skills.js +55 -0
- package/dist/agents/skills/refresh.js +135 -0
- package/dist/agents/skills/serialize.js +13 -0
- package/dist/agents/skills/types.js +1 -0
- package/dist/agents/skills/workspace.js +272 -0
- package/dist/agents/skills-install.js +390 -0
- package/dist/agents/skills-status.js +183 -0
- package/dist/agents/skills.js +13 -0
- package/dist/agents/subagent-announce-queue.js +129 -0
- package/dist/agents/subagent-announce.js +391 -0
- package/dist/agents/subagent-registry.js +343 -0
- package/dist/agents/subagent-registry.store.js +73 -0
- package/dist/agents/synthetic-models.js +174 -0
- package/dist/agents/system-prompt-params.js +70 -0
- package/dist/agents/system-prompt-report.js +113 -0
- package/dist/agents/system-prompt.js +467 -0
- package/dist/agents/test-helpers/fast-coding-tools.js +18 -0
- package/dist/agents/test-helpers/fast-core-tools.js +24 -0
- package/dist/agents/timeout.js +24 -0
- package/dist/agents/tool-call-id.js +164 -0
- package/dist/agents/tool-display.js +209 -0
- package/dist/agents/tool-display.json +308 -0
- package/dist/agents/tool-images.js +166 -0
- package/dist/agents/tool-policy.js +193 -0
- package/dist/agents/tool-summaries.js +10 -0
- package/dist/agents/tools/agent-step.js +44 -0
- package/dist/agents/tools/agents-list-tool.js +66 -0
- package/dist/agents/tools/browser-tool.js +656 -0
- package/dist/agents/tools/browser-tool.schema.js +106 -0
- package/dist/agents/tools/canvas-tool.js +158 -0
- package/dist/agents/tools/common.js +146 -0
- package/dist/agents/tools/cron-tool.js +261 -0
- package/dist/agents/tools/discord-actions-guild.js +453 -0
- package/dist/agents/tools/discord-actions-messaging.js +383 -0
- package/dist/agents/tools/discord-actions-moderation.js +92 -0
- package/dist/agents/tools/discord-actions.js +61 -0
- package/dist/agents/tools/gateway-tool.js +214 -0
- package/dist/agents/tools/gateway.js +30 -0
- package/dist/agents/tools/image-tool.helpers.js +55 -0
- package/dist/agents/tools/image-tool.js +370 -0
- package/dist/agents/tools/memory-tool.js +103 -0
- package/dist/agents/tools/message-tool.js +319 -0
- package/dist/agents/tools/nodes-tool.js +399 -0
- package/dist/agents/tools/nodes-utils.js +92 -0
- package/dist/agents/tools/session-status-tool.js +357 -0
- package/dist/agents/tools/sessions-announce-target.js +43 -0
- package/dist/agents/tools/sessions-helpers.js +261 -0
- package/dist/agents/tools/sessions-history-tool.js +118 -0
- package/dist/agents/tools/sessions-list-tool.js +161 -0
- package/dist/agents/tools/sessions-send-helpers.js +116 -0
- package/dist/agents/tools/sessions-send-tool.a2a.js +119 -0
- package/dist/agents/tools/sessions-send-tool.js +345 -0
- package/dist/agents/tools/sessions-spawn-tool.js +232 -0
- package/dist/agents/tools/slack-actions.js +243 -0
- package/dist/agents/tools/telegram-actions.js +162 -0
- package/dist/agents/tools/tts-tool.js +47 -0
- package/dist/agents/tools/web-fetch-utils.js +104 -0
- package/dist/agents/tools/web-fetch.js +477 -0
- package/dist/agents/tools/web-search.js +355 -0
- package/dist/agents/tools/web-shared.js +62 -0
- package/dist/agents/tools/web-tools.js +2 -0
- package/dist/agents/tools/whatsapp-actions.js +32 -0
- package/dist/agents/transcript-policy.js +83 -0
- package/dist/agents/usage.js +48 -0
- package/dist/agents/venice-models.js +342 -0
- package/dist/agents/workspace.js +234 -0
- package/dist/auto-reply/chunk.js +358 -0
- package/dist/auto-reply/command-auth.js +132 -0
- package/dist/auto-reply/command-detection.js +56 -0
- package/dist/auto-reply/commands-args.js +85 -0
- package/dist/auto-reply/commands-registry.data.js +509 -0
- package/dist/auto-reply/commands-registry.js +351 -0
- package/dist/auto-reply/commands-registry.types.js +1 -0
- package/dist/auto-reply/dispatch.js +40 -0
- package/dist/auto-reply/envelope.js +173 -0
- package/dist/auto-reply/group-activation.js +22 -0
- package/dist/auto-reply/heartbeat.js +120 -0
- package/dist/auto-reply/inbound-debounce.js +74 -0
- package/dist/auto-reply/media-note.js +72 -0
- package/dist/auto-reply/model.js +28 -0
- package/dist/auto-reply/reply/abort.js +151 -0
- package/dist/auto-reply/reply/agent-runner-execution.js +461 -0
- package/dist/auto-reply/reply/agent-runner-helpers.js +65 -0
- package/dist/auto-reply/reply/agent-runner-memory.js +155 -0
- package/dist/auto-reply/reply/agent-runner-payloads.js +85 -0
- package/dist/auto-reply/reply/agent-runner-utils.js +101 -0
- package/dist/auto-reply/reply/agent-runner.js +379 -0
- package/dist/auto-reply/reply/audio-tags.js +1 -0
- package/dist/auto-reply/reply/bash-command.js +336 -0
- package/dist/auto-reply/reply/block-reply-coalescer.js +101 -0
- package/dist/auto-reply/reply/block-reply-pipeline.js +179 -0
- package/dist/auto-reply/reply/block-streaming.js +91 -0
- package/dist/auto-reply/reply/body.js +37 -0
- package/dist/auto-reply/reply/commands-allowlist.js +570 -0
- package/dist/auto-reply/reply/commands-approve.js +88 -0
- package/dist/auto-reply/reply/commands-bash.js +25 -0
- package/dist/auto-reply/reply/commands-compact.js +106 -0
- package/dist/auto-reply/reply/commands-config.js +239 -0
- package/dist/auto-reply/reply/commands-context-report.js +294 -0
- package/dist/auto-reply/reply/commands-context.js +29 -0
- package/dist/auto-reply/reply/commands-core.js +101 -0
- package/dist/auto-reply/reply/commands-info.js +109 -0
- package/dist/auto-reply/reply/commands-models.js +201 -0
- package/dist/auto-reply/reply/commands-plugin.js +35 -0
- package/dist/auto-reply/reply/commands-session.js +311 -0
- package/dist/auto-reply/reply/commands-status.js +178 -0
- package/dist/auto-reply/reply/commands-subagents.js +357 -0
- package/dist/auto-reply/reply/commands-tts.js +228 -0
- package/dist/auto-reply/reply/commands-types.js +1 -0
- package/dist/auto-reply/reply/commands.js +3 -0
- package/dist/auto-reply/reply/config-commands.js +58 -0
- package/dist/auto-reply/reply/config-value.js +35 -0
- package/dist/auto-reply/reply/debug-commands.js +58 -0
- package/dist/auto-reply/reply/directive-handling.auth.js +191 -0
- package/dist/auto-reply/reply/directive-handling.fast-lane.js +60 -0
- package/dist/auto-reply/reply/directive-handling.impl.js +380 -0
- package/dist/auto-reply/reply/directive-handling.js +5 -0
- package/dist/auto-reply/reply/directive-handling.model-picker.js +64 -0
- package/dist/auto-reply/reply/directive-handling.model.js +279 -0
- package/dist/auto-reply/reply/directive-handling.parse.js +84 -0
- package/dist/auto-reply/reply/directive-handling.persist.js +181 -0
- package/dist/auto-reply/reply/directive-handling.queue-validation.js +48 -0
- package/dist/auto-reply/reply/directive-handling.shared.js +43 -0
- package/dist/auto-reply/reply/directives.js +114 -0
- package/dist/auto-reply/reply/dispatch-from-config.js +289 -0
- package/dist/auto-reply/reply/exec/directive.js +183 -0
- package/dist/auto-reply/reply/exec.js +1 -0
- package/dist/auto-reply/reply/followup-runner.js +221 -0
- package/dist/auto-reply/reply/get-reply-directives-apply.js +201 -0
- package/dist/auto-reply/reply/get-reply-directives-utils.js +45 -0
- package/dist/auto-reply/reply/get-reply-directives.js +343 -0
- package/dist/auto-reply/reply/get-reply-inline-actions.js +257 -0
- package/dist/auto-reply/reply/get-reply-run.js +282 -0
- package/dist/auto-reply/reply/get-reply.js +234 -0
- package/dist/auto-reply/reply/groups.js +102 -0
- package/dist/auto-reply/reply/history.js +87 -0
- package/dist/auto-reply/reply/inbound-context.js +51 -0
- package/dist/auto-reply/reply/inbound-dedupe.js +39 -0
- package/dist/auto-reply/reply/inbound-sender-meta.js +45 -0
- package/dist/auto-reply/reply/inbound-text.js +3 -0
- package/dist/auto-reply/reply/line-directives.js +294 -0
- package/dist/auto-reply/reply/memory-flush.js +66 -0
- package/dist/auto-reply/reply/mentions.js +122 -0
- package/dist/auto-reply/reply/model-selection.js +398 -0
- package/dist/auto-reply/reply/normalize-reply.js +54 -0
- package/dist/auto-reply/reply/provider-dispatcher.js +19 -0
- package/dist/auto-reply/reply/queue/cleanup.js +19 -0
- package/dist/auto-reply/reply/queue/directive.js +155 -0
- package/dist/auto-reply/reply/queue/drain.js +111 -0
- package/dist/auto-reply/reply/queue/enqueue.js +43 -0
- package/dist/auto-reply/reply/queue/normalize.js +30 -0
- package/dist/auto-reply/reply/queue/settings.js +52 -0
- package/dist/auto-reply/reply/queue/state.js +53 -0
- package/dist/auto-reply/reply/queue/types.js +1 -0
- package/dist/auto-reply/reply/queue.js +6 -0
- package/dist/auto-reply/reply/reply-directives.js +30 -0
- package/dist/auto-reply/reply/reply-dispatcher.js +100 -0
- package/dist/auto-reply/reply/reply-elevated.js +166 -0
- package/dist/auto-reply/reply/reply-inline.js +28 -0
- package/dist/auto-reply/reply/reply-payloads.js +83 -0
- package/dist/auto-reply/reply/reply-reference.js +35 -0
- package/dist/auto-reply/reply/reply-tags.js +13 -0
- package/dist/auto-reply/reply/reply-threading.js +41 -0
- package/dist/auto-reply/reply/response-prefix-template.js +76 -0
- package/dist/auto-reply/reply/route-reply.js +108 -0
- package/dist/auto-reply/reply/session-reset-model.js +133 -0
- package/dist/auto-reply/reply/session-updates.js +228 -0
- package/dist/auto-reply/reply/session-usage.js +79 -0
- package/dist/auto-reply/reply/session.js +303 -0
- package/dist/auto-reply/reply/stage-sandbox-media.js +146 -0
- package/dist/auto-reply/reply/streaming-directives.js +92 -0
- package/dist/auto-reply/reply/subagents-utils.js +52 -0
- package/dist/auto-reply/reply/test-ctx.js +15 -0
- package/dist/auto-reply/reply/typing-mode.js +91 -0
- package/dist/auto-reply/reply/typing.js +132 -0
- package/dist/auto-reply/reply.js +5 -0
- package/dist/auto-reply/send-policy.js +30 -0
- package/dist/auto-reply/skill-commands.js +97 -0
- package/dist/auto-reply/status.js +399 -0
- package/dist/auto-reply/templating.js +39 -0
- package/dist/auto-reply/thinking.js +154 -0
- package/dist/auto-reply/tokens.js +15 -0
- package/dist/auto-reply/tool-meta.js +112 -0
- package/dist/auto-reply/types.js +1 -0
- package/dist/browser/bridge-server.js +47 -0
- package/dist/browser/cdp.helpers.js +136 -0
- package/dist/browser/cdp.js +293 -0
- package/dist/browser/chrome.executables.js +509 -0
- package/dist/browser/chrome.js +253 -0
- package/dist/browser/chrome.profile-decoration.js +144 -0
- package/dist/browser/client-actions-core.js +94 -0
- package/dist/browser/client-actions-observe.js +94 -0
- package/dist/browser/client-actions-state.js +163 -0
- package/dist/browser/client-actions-types.js +1 -0
- package/dist/browser/client-actions.js +4 -0
- package/dist/browser/client-fetch.js +78 -0
- package/dist/browser/client.js +139 -0
- package/dist/browser/config.js +193 -0
- package/dist/browser/constants.js +8 -0
- package/dist/browser/extension-relay.js +541 -0
- package/dist/browser/profiles-service.js +132 -0
- package/dist/browser/profiles.js +93 -0
- package/dist/browser/pw-ai-module.js +37 -0
- package/dist/browser/pw-ai.js +2 -0
- package/dist/browser/pw-role-snapshot.js +310 -0
- package/dist/browser/pw-session.js +431 -0
- package/dist/browser/pw-tools-core.activity.js +44 -0
- package/dist/browser/pw-tools-core.downloads.js +176 -0
- package/dist/browser/pw-tools-core.interactions.js +420 -0
- package/dist/browser/pw-tools-core.js +8 -0
- package/dist/browser/pw-tools-core.responses.js +83 -0
- package/dist/browser/pw-tools-core.shared.js +48 -0
- package/dist/browser/pw-tools-core.snapshot.js +142 -0
- package/dist/browser/pw-tools-core.state.js +147 -0
- package/dist/browser/pw-tools-core.storage.js +72 -0
- package/dist/browser/pw-tools-core.trace.js +25 -0
- package/dist/browser/routes/agent.act.js +453 -0
- package/dist/browser/routes/agent.act.shared.js +38 -0
- package/dist/browser/routes/agent.debug.js +133 -0
- package/dist/browser/routes/agent.js +10 -0
- package/dist/browser/routes/agent.shared.js +45 -0
- package/dist/browser/routes/agent.snapshot.js +269 -0
- package/dist/browser/routes/agent.storage.js +386 -0
- package/dist/browser/routes/basic.js +174 -0
- package/dist/browser/routes/index.js +8 -0
- package/dist/browser/routes/tabs.js +120 -0
- package/dist/browser/routes/utils.js +57 -0
- package/dist/browser/screenshot.js +39 -0
- package/dist/browser/server-context.js +533 -0
- package/dist/browser/server-context.types.js +1 -0
- package/dist/browser/server.js +92 -0
- package/dist/browser/target-id.js +16 -0
- package/dist/browser/trash.js +21 -0
- package/dist/build-info.json +5 -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 +307 -0
- package/dist/canvas-host/a2ui.js +185 -0
- package/dist/canvas-host/server.js +380 -0
- package/dist/channel-web.js +8 -0
- package/dist/channels/ack-reactions.js +56 -0
- package/dist/channels/allowlist-match.js +3 -0
- package/dist/channels/allowlists/resolve-utils.js +37 -0
- package/dist/channels/channel-config.js +131 -0
- package/dist/channels/chat-type.js +12 -0
- package/dist/channels/command-gating.js +24 -0
- package/dist/channels/conversation-label.js +48 -0
- package/dist/channels/dock.js +344 -0
- package/dist/channels/location.js +44 -0
- package/dist/channels/logging.js +13 -0
- package/dist/channels/mention-gating.js +26 -0
- package/dist/channels/plugins/actions/discord/handle-action.guild-admin.js +328 -0
- package/dist/channels/plugins/actions/discord/handle-action.js +165 -0
- package/dist/channels/plugins/actions/discord.js +93 -0
- package/dist/channels/plugins/actions/signal.js +115 -0
- package/dist/channels/plugins/actions/telegram.js +95 -0
- package/dist/channels/plugins/agent-tools/whatsapp-login.js +63 -0
- package/dist/channels/plugins/allowlist-match.js +1 -0
- package/dist/channels/plugins/bluebubbles-actions.js +16 -0
- package/dist/channels/plugins/catalog.js +216 -0
- package/dist/channels/plugins/channel-config.js +1 -0
- package/dist/channels/plugins/config-helpers.js +87 -0
- package/dist/channels/plugins/config-schema.js +8 -0
- package/dist/channels/plugins/config-writes.js +21 -0
- package/dist/channels/plugins/directory-config.js +185 -0
- package/dist/channels/plugins/group-mentions.js +267 -0
- package/dist/channels/plugins/helpers.js +12 -0
- package/dist/channels/plugins/index.js +51 -0
- package/dist/channels/plugins/load.js +22 -0
- package/dist/channels/plugins/media-limits.js +15 -0
- package/dist/channels/plugins/message-action-names.js +50 -0
- package/dist/channels/plugins/message-actions.js +35 -0
- package/dist/channels/plugins/normalize/discord.js +18 -0
- package/dist/channels/plugins/normalize/imessage.js +36 -0
- package/dist/channels/plugins/normalize/signal.js +52 -0
- package/dist/channels/plugins/normalize/slack.js +19 -0
- package/dist/channels/plugins/normalize/telegram.js +31 -0
- package/dist/channels/plugins/normalize/whatsapp.js +17 -0
- package/dist/channels/plugins/onboarding/channel-access.js +68 -0
- package/dist/channels/plugins/onboarding/discord.js +413 -0
- package/dist/channels/plugins/onboarding/helpers.js +33 -0
- package/dist/channels/plugins/onboarding/imessage.js +231 -0
- package/dist/channels/plugins/onboarding/signal.js +262 -0
- package/dist/channels/plugins/onboarding/slack.js +470 -0
- package/dist/channels/plugins/onboarding/telegram.js +281 -0
- package/dist/channels/plugins/onboarding/whatsapp.js +286 -0
- package/dist/channels/plugins/onboarding-types.js +1 -0
- package/dist/channels/plugins/outbound/discord.js +29 -0
- package/dist/channels/plugins/outbound/imessage.js +38 -0
- package/dist/channels/plugins/outbound/load.js +28 -0
- package/dist/channels/plugins/outbound/signal.js +36 -0
- package/dist/channels/plugins/outbound/slack.js +27 -0
- package/dist/channels/plugins/outbound/telegram.js +91 -0
- package/dist/channels/plugins/outbound/whatsapp.js +76 -0
- package/dist/channels/plugins/pairing-message.js +1 -0
- package/dist/channels/plugins/pairing.js +44 -0
- package/dist/channels/plugins/setup-helpers.js +89 -0
- package/dist/channels/plugins/slack.actions.js +158 -0
- package/dist/channels/plugins/status-issues/bluebubbles.js +76 -0
- package/dist/channels/plugins/status-issues/discord.js +115 -0
- package/dist/channels/plugins/status-issues/shared.js +23 -0
- package/dist/channels/plugins/status-issues/telegram.js +100 -0
- package/dist/channels/plugins/status-issues/whatsapp.js +52 -0
- package/dist/channels/plugins/status.js +26 -0
- package/dist/channels/plugins/types.adapters.js +1 -0
- package/dist/channels/plugins/types.core.js +1 -0
- package/dist/channels/plugins/types.js +1 -0
- package/dist/channels/plugins/types.plugin.js +1 -0
- package/dist/channels/plugins/whatsapp-heartbeat.js +56 -0
- package/dist/channels/registry.js +153 -0
- package/dist/channels/reply-prefix.js +21 -0
- package/dist/channels/sender-identity.js +30 -0
- package/dist/channels/sender-label.js +38 -0
- package/dist/channels/session.js +26 -0
- package/dist/channels/targets.js +27 -0
- package/dist/channels/typing.js +17 -0
- package/dist/channels/web/index.js +2 -0
- package/dist/cli/acp-cli.js +61 -0
- package/dist/cli/argv.js +119 -0
- package/dist/cli/banner.js +94 -0
- package/dist/cli/browser-cli-actions-input/register.element.js +200 -0
- package/dist/cli/browser-cli-actions-input/register.files-downloads.js +128 -0
- package/dist/cli/browser-cli-actions-input/register.form-wait-eval.js +108 -0
- package/dist/cli/browser-cli-actions-input/register.js +10 -0
- package/dist/cli/browser-cli-actions-input/register.navigation.js +63 -0
- package/dist/cli/browser-cli-actions-input/shared.js +50 -0
- package/dist/cli/browser-cli-actions-input.js +1 -0
- package/dist/cli/browser-cli-actions-observe.js +82 -0
- package/dist/cli/browser-cli-debug.js +148 -0
- package/dist/cli/browser-cli-examples.js +33 -0
- package/dist/cli/browser-cli-extension.js +98 -0
- package/dist/cli/browser-cli-inspect.js +130 -0
- package/dist/cli/browser-cli-manage.js +351 -0
- package/dist/cli/browser-cli-serve.js +91 -0
- package/dist/cli/browser-cli-shared.js +1 -0
- package/dist/cli/browser-cli-state.cookies-storage.js +168 -0
- package/dist/cli/browser-cli-state.js +261 -0
- package/dist/cli/browser-cli.js +38 -0
- package/dist/cli/channel-auth.js +49 -0
- package/dist/cli/channel-options.js +29 -0
- package/dist/cli/channels-cli.js +208 -0
- package/dist/cli/cli-utils.js +34 -0
- package/dist/cli/command-format.js +14 -0
- package/dist/cli/command-options.js +6 -0
- package/dist/cli/config-cli.js +295 -0
- package/dist/cli/cron-cli/register.cron-add.js +188 -0
- package/dist/cli/cron-cli/register.cron-edit.js +160 -0
- package/dist/cli/cron-cli/register.cron-simple.js +98 -0
- package/dist/cli/cron-cli/register.js +16 -0
- package/dist/cli/cron-cli/shared.js +178 -0
- package/dist/cli/cron-cli.js +1 -0
- package/dist/cli/daemon-cli/install.js +112 -0
- package/dist/cli/daemon-cli/lifecycle.js +265 -0
- package/dist/cli/daemon-cli/probe.js +28 -0
- package/dist/cli/daemon-cli/register.js +69 -0
- package/dist/cli/daemon-cli/response.js +20 -0
- package/dist/cli/daemon-cli/runners.js +3 -0
- package/dist/cli/daemon-cli/shared.js +162 -0
- package/dist/cli/daemon-cli/status.gather.js +170 -0
- package/dist/cli/daemon-cli/status.js +19 -0
- package/dist/cli/daemon-cli/status.print.js +241 -0
- package/dist/cli/daemon-cli/types.js +1 -0
- package/dist/cli/daemon-cli.js +2 -0
- package/dist/cli/deps.js +28 -0
- package/dist/cli/devices-cli.js +181 -0
- package/dist/cli/directory-cli.js +227 -0
- package/dist/cli/dns-cli.js +199 -0
- package/dist/cli/docs-cli.js +17 -0
- package/dist/cli/exec-approvals-cli.js +378 -0
- package/dist/cli/gateway-cli/call.js +25 -0
- package/dist/cli/gateway-cli/dev.js +99 -0
- package/dist/cli/gateway-cli/discover.js +88 -0
- package/dist/cli/gateway-cli/register.js +255 -0
- package/dist/cli/gateway-cli/run-loop.js +87 -0
- package/dist/cli/gateway-cli/run.js +265 -0
- package/dist/cli/gateway-cli/shared.js +101 -0
- package/dist/cli/gateway-cli.js +1 -0
- package/dist/cli/gateway-rpc.js +27 -0
- package/dist/cli/help-format.js +16 -0
- package/dist/cli/hooks-cli.js +709 -0
- package/dist/cli/logs-cli.js +222 -0
- package/dist/cli/memory-cli.js +527 -0
- package/dist/cli/models-cli.js +321 -0
- package/dist/cli/node-cli/daemon.js +481 -0
- package/dist/cli/node-cli/register.js +81 -0
- package/dist/cli/node-cli.js +1 -0
- package/dist/cli/nodes-camera.js +50 -0
- package/dist/cli/nodes-canvas.js +24 -0
- package/dist/cli/nodes-cli/a2ui-jsonl.js +81 -0
- package/dist/cli/nodes-cli/cli-utils.js +27 -0
- package/dist/cli/nodes-cli/format.js +35 -0
- package/dist/cli/nodes-cli/register.camera.js +193 -0
- package/dist/cli/nodes-cli/register.canvas.js +215 -0
- package/dist/cli/nodes-cli/register.invoke.js +303 -0
- package/dist/cli/nodes-cli/register.js +24 -0
- package/dist/cli/nodes-cli/register.location.js +64 -0
- package/dist/cli/nodes-cli/register.notify.js +51 -0
- package/dist/cli/nodes-cli/register.pairing.js +99 -0
- package/dist/cli/nodes-cli/register.screen.js +66 -0
- package/dist/cli/nodes-cli/register.status.js +328 -0
- package/dist/cli/nodes-cli/rpc.js +88 -0
- package/dist/cli/nodes-cli/types.js +1 -0
- package/dist/cli/nodes-cli.js +1 -0
- package/dist/cli/nodes-run.js +19 -0
- package/dist/cli/nodes-screen.js +35 -0
- package/dist/cli/outbound-send-deps.js +11 -0
- package/dist/cli/pairing-cli.js +115 -0
- package/dist/cli/parse-duration.js +28 -0
- package/dist/cli/parse-timeout.js +18 -0
- package/dist/cli/plugin-registry.js +24 -0
- package/dist/cli/plugins-cli.js +469 -0
- package/dist/cli/ports.js +101 -0
- package/dist/cli/profile-utils.js +17 -0
- package/dist/cli/profile.js +86 -0
- package/dist/cli/program/build-program.js +14 -0
- package/dist/cli/program/command-registry.js +148 -0
- package/dist/cli/program/config-guard.js +67 -0
- package/dist/cli/program/context.js +11 -0
- package/dist/cli/program/help.js +69 -0
- package/dist/cli/program/helpers.js +26 -0
- package/dist/cli/program/message/helpers.js +46 -0
- package/dist/cli/program/message/register.broadcast.js +11 -0
- package/dist/cli/program/message/register.discord-admin.js +119 -0
- package/dist/cli/program/message/register.emoji-sticker.js +43 -0
- package/dist/cli/program/message/register.permissions-search.js +22 -0
- package/dist/cli/program/message/register.pins.js +23 -0
- package/dist/cli/program/message/register.poll.js +13 -0
- package/dist/cli/program/message/register.reactions.js +21 -0
- package/dist/cli/program/message/register.read-edit-delete.js +30 -0
- package/dist/cli/program/message/register.send.js +17 -0
- package/dist/cli/program/message/register.thread.js +35 -0
- package/dist/cli/program/preaction.js +46 -0
- package/dist/cli/program/register.agent.js +162 -0
- package/dist/cli/program/register.configure.js +32 -0
- package/dist/cli/program/register.maintenance.js +91 -0
- package/dist/cli/program/register.message.js +54 -0
- package/dist/cli/program/register.onboard.js +120 -0
- package/dist/cli/program/register.setup.js +41 -0
- package/dist/cli/program/register.status-health-sessions.js +109 -0
- package/dist/cli/program/register.subclis.js +271 -0
- package/dist/cli/program.js +2 -0
- package/dist/cli/progress.js +165 -0
- package/dist/cli/prompt.js +17 -0
- package/dist/cli/route.js +29 -0
- package/dist/cli/run-main.js +100 -0
- package/dist/cli/sandbox-cli.js +98 -0
- package/dist/cli/security-cli.js +123 -0
- package/dist/cli/skills-cli.js +341 -0
- package/dist/cli/system-cli.js +98 -0
- package/dist/cli/tagline.js +208 -0
- package/dist/cli/tui-cli.js +44 -0
- package/dist/cli/update-cli.js +997 -0
- package/dist/cli/wait.js +8 -0
- package/dist/cli/webhooks-cli.js +140 -0
- package/dist/commands/agent/delivery.js +140 -0
- package/dist/commands/agent/run-context.js +27 -0
- package/dist/commands/agent/session-store.js +43 -0
- package/dist/commands/agent/session.js +74 -0
- package/dist/commands/agent/types.js +1 -0
- package/dist/commands/agent-via-gateway.js +119 -0
- package/dist/commands/agent.js +438 -0
- package/dist/commands/agents.bindings.js +126 -0
- package/dist/commands/agents.command-shared.js +18 -0
- package/dist/commands/agents.commands.add.js +293 -0
- package/dist/commands/agents.commands.delete.js +75 -0
- package/dist/commands/agents.commands.identity.js +168 -0
- package/dist/commands/agents.commands.list.js +98 -0
- package/dist/commands/agents.config.js +145 -0
- package/dist/commands/agents.js +6 -0
- package/dist/commands/agents.providers.js +140 -0
- package/dist/commands/auth-choice-options.js +165 -0
- package/dist/commands/auth-choice-prompt.js +36 -0
- package/dist/commands/auth-choice.api-key.js +34 -0
- package/dist/commands/auth-choice.apply.anthropic.js +77 -0
- package/dist/commands/auth-choice.apply.api-providers.js +502 -0
- package/dist/commands/auth-choice.apply.copilot-proxy.js +10 -0
- package/dist/commands/auth-choice.apply.github-copilot.js +47 -0
- package/dist/commands/auth-choice.apply.google-antigravity.js +10 -0
- package/dist/commands/auth-choice.apply.google-gemini-cli.js +10 -0
- package/dist/commands/auth-choice.apply.js +30 -0
- package/dist/commands/auth-choice.apply.minimax.js +72 -0
- package/dist/commands/auth-choice.apply.oauth.js +78 -0
- package/dist/commands/auth-choice.apply.openai.js +117 -0
- package/dist/commands/auth-choice.apply.plugin-provider.js +140 -0
- package/dist/commands/auth-choice.apply.qwen-portal.js +10 -0
- package/dist/commands/auth-choice.default-model.js +12 -0
- package/dist/commands/auth-choice.js +3 -0
- package/dist/commands/auth-choice.model-check.js +61 -0
- package/dist/commands/auth-choice.preferred-provider.js +32 -0
- package/dist/commands/auth-token.js +32 -0
- package/dist/commands/channels/add-mutators.js +49 -0
- package/dist/commands/channels/add.js +210 -0
- package/dist/commands/channels/capabilities.js +439 -0
- package/dist/commands/channels/list.js +145 -0
- package/dist/commands/channels/logs.js +85 -0
- package/dist/commands/channels/remove.js +114 -0
- package/dist/commands/channels/resolve.js +107 -0
- package/dist/commands/channels/shared.js +41 -0
- package/dist/commands/channels/status.js +238 -0
- package/dist/commands/channels.js +7 -0
- package/dist/commands/chutes-oauth.js +144 -0
- package/dist/commands/cleanup-utils.js +74 -0
- package/dist/commands/configure.channels.js +52 -0
- package/dist/commands/configure.commands.js +8 -0
- package/dist/commands/configure.daemon.js +101 -0
- package/dist/commands/configure.gateway-auth.js +64 -0
- package/dist/commands/configure.gateway.js +159 -0
- package/dist/commands/configure.js +4 -0
- package/dist/commands/configure.shared.js +49 -0
- package/dist/commands/configure.wizard.js +466 -0
- package/dist/commands/daemon-install-helpers.js +51 -0
- package/dist/commands/daemon-runtime.js +11 -0
- package/dist/commands/dashboard.js +47 -0
- package/dist/commands/docs.js +148 -0
- package/dist/commands/doctor-auth.js +236 -0
- package/dist/commands/doctor-config-flow.js +188 -0
- package/dist/commands/doctor-format.js +85 -0
- package/dist/commands/doctor-gateway-daemon-flow.js +201 -0
- package/dist/commands/doctor-gateway-health.js +43 -0
- package/dist/commands/doctor-gateway-services.js +209 -0
- package/dist/commands/doctor-install.js +27 -0
- package/dist/commands/doctor-legacy-config.js +42 -0
- package/dist/commands/doctor-platform-notes.js +66 -0
- package/dist/commands/doctor-prompter.js +64 -0
- package/dist/commands/doctor-sandbox.js +207 -0
- package/dist/commands/doctor-security.js +141 -0
- package/dist/commands/doctor-state-integrity.js +332 -0
- package/dist/commands/doctor-state-migrations.js +1 -0
- package/dist/commands/doctor-ui.js +119 -0
- package/dist/commands/doctor-update.js +65 -0
- package/dist/commands/doctor-workspace-status.js +56 -0
- package/dist/commands/doctor-workspace.js +69 -0
- package/dist/commands/doctor.js +252 -0
- package/dist/commands/gateway-status/helpers.js +200 -0
- package/dist/commands/gateway-status.js +300 -0
- package/dist/commands/google-gemini-model-default.js +33 -0
- package/dist/commands/health-format.js +37 -0
- package/dist/commands/health.js +595 -0
- package/dist/commands/message-format.js +345 -0
- package/dist/commands/message.js +45 -0
- package/dist/commands/model-picker.js +420 -0
- package/dist/commands/models/aliases.js +92 -0
- package/dist/commands/models/auth-order.js +95 -0
- package/dist/commands/models/auth.js +334 -0
- package/dist/commands/models/fallbacks.js +126 -0
- package/dist/commands/models/image-fallbacks.js +126 -0
- package/dist/commands/models/list.auth-overview.js +93 -0
- package/dist/commands/models/list.configured.js +80 -0
- package/dist/commands/models/list.format.js +41 -0
- package/dist/commands/models/list.js +2 -0
- package/dist/commands/models/list.list-command.js +99 -0
- package/dist/commands/models/list.probe.js +348 -0
- package/dist/commands/models/list.registry.js +81 -0
- package/dist/commands/models/list.status-command.js +420 -0
- package/dist/commands/models/list.table.js +58 -0
- package/dist/commands/models/list.types.js +1 -0
- package/dist/commands/models/scan.js +293 -0
- package/dist/commands/models/set-image.js +28 -0
- package/dist/commands/models/set.js +28 -0
- package/dist/commands/models/shared.js +80 -0
- package/dist/commands/models.js +10 -0
- package/dist/commands/node-daemon-install-helpers.js +35 -0
- package/dist/commands/node-daemon-runtime.js +6 -0
- package/dist/commands/oauth-env.js +16 -0
- package/dist/commands/oauth-flow.js +33 -0
- package/dist/commands/onboard-auth.config-core.js +386 -0
- package/dist/commands/onboard-auth.config-minimax.js +176 -0
- package/dist/commands/onboard-auth.config-opencode.js +40 -0
- package/dist/commands/onboard-auth.credentials.js +147 -0
- package/dist/commands/onboard-auth.js +7 -0
- package/dist/commands/onboard-auth.models.js +100 -0
- package/dist/commands/onboard-channels.js +527 -0
- package/dist/commands/onboard-helpers.js +359 -0
- package/dist/commands/onboard-hooks.js +59 -0
- package/dist/commands/onboard-interactive.js +17 -0
- package/dist/commands/onboard-non-interactive/api-keys.js +45 -0
- package/dist/commands/onboard-non-interactive/local/auth-choice.js +333 -0
- package/dist/commands/onboard-non-interactive/local/daemon-install.js +45 -0
- package/dist/commands/onboard-non-interactive/local/gateway-config.js +86 -0
- package/dist/commands/onboard-non-interactive/local/output.js +14 -0
- package/dist/commands/onboard-non-interactive/local/skills-config.js +21 -0
- package/dist/commands/onboard-non-interactive/local/workspace.js +7 -0
- package/dist/commands/onboard-non-interactive/local.js +105 -0
- package/dist/commands/onboard-non-interactive/remote.js +41 -0
- package/dist/commands/onboard-non-interactive.js +25 -0
- package/dist/commands/onboard-remote.js +121 -0
- package/dist/commands/onboard-skills.js +146 -0
- package/dist/commands/onboard-types.js +1 -0
- package/dist/commands/onboard.js +62 -0
- package/dist/commands/onboarding/__tests__/test-utils.js +20 -0
- package/dist/commands/onboarding/plugin-install.js +162 -0
- package/dist/commands/onboarding/registry.js +13 -0
- package/dist/commands/onboarding/types.js +1 -0
- package/dist/commands/openai-codex-model-default.js +44 -0
- package/dist/commands/opencode-zen-model-default.js +35 -0
- package/dist/commands/reset.js +134 -0
- package/dist/commands/sandbox-display.js +82 -0
- package/dist/commands/sandbox-explain.js +226 -0
- package/dist/commands/sandbox-formatters.js +31 -0
- package/dist/commands/sandbox.js +119 -0
- package/dist/commands/sessions.js +211 -0
- package/dist/commands/setup.js +60 -0
- package/dist/commands/signal-install.js +132 -0
- package/dist/commands/status-all/agents.js +62 -0
- package/dist/commands/status-all/channels.js +354 -0
- package/dist/commands/status-all/diagnosis.js +156 -0
- package/dist/commands/status-all/format.js +41 -0
- package/dist/commands/status-all/gateway.js +158 -0
- package/dist/commands/status-all/report-lines.js +135 -0
- package/dist/commands/status-all.js +409 -0
- package/dist/commands/status.agent-local.js +68 -0
- package/dist/commands/status.command.js +476 -0
- package/dist/commands/status.daemon.js +30 -0
- package/dist/commands/status.format.js +52 -0
- package/dist/commands/status.gateway-probe.js +35 -0
- package/dist/commands/status.js +2 -0
- package/dist/commands/status.link-channel.js +39 -0
- package/dist/commands/status.scan.js +140 -0
- package/dist/commands/status.summary.js +172 -0
- package/dist/commands/status.types.js +1 -0
- package/dist/commands/status.update.js +112 -0
- package/dist/commands/systemd-linger.js +77 -0
- package/dist/commands/uninstall.js +161 -0
- package/dist/config/agent-dirs.js +79 -0
- package/dist/config/agent-limits.js +16 -0
- package/dist/config/cache-utils.js +22 -0
- package/dist/config/channel-capabilities.js +42 -0
- package/dist/config/commands.js +38 -0
- package/dist/config/config-paths.js +75 -0
- package/dist/config/config.js +7 -0
- package/dist/config/defaults.js +350 -0
- package/dist/config/env-substitution.js +117 -0
- package/dist/config/env-vars.js +21 -0
- package/dist/config/group-policy.js +54 -0
- package/dist/config/includes.js +183 -0
- package/dist/config/io.js +488 -0
- package/dist/config/legacy-migrate.js +13 -0
- package/dist/config/legacy.js +34 -0
- package/dist/config/legacy.migrations.js +8 -0
- package/dist/config/legacy.migrations.part-1.js +308 -0
- package/dist/config/legacy.migrations.part-2.js +343 -0
- package/dist/config/legacy.migrations.part-3.js +161 -0
- package/dist/config/legacy.rules.js +116 -0
- package/dist/config/legacy.shared.js +76 -0
- package/dist/config/logging.js +10 -0
- package/dist/config/markdown-tables.js +36 -0
- package/dist/config/merge-config.js +22 -0
- package/dist/config/merge-patch.js +22 -0
- package/dist/config/normalize-paths.js +54 -0
- package/dist/config/paths.js +90 -0
- package/dist/config/plugin-auto-enable.js +338 -0
- package/dist/config/port-defaults.js +30 -0
- package/dist/config/runtime-overrides.js +50 -0
- package/dist/config/schema.js +789 -0
- package/dist/config/sessions/group.js +83 -0
- package/dist/config/sessions/main-session.js +43 -0
- package/dist/config/sessions/metadata.js +114 -0
- package/dist/config/sessions/paths.js +46 -0
- package/dist/config/sessions/reset.js +103 -0
- package/dist/config/sessions/session-key.js +34 -0
- package/dist/config/sessions/store.js +346 -0
- package/dist/config/sessions/transcript.js +113 -0
- package/dist/config/sessions/types.js +11 -0
- package/dist/config/sessions.js +9 -0
- package/dist/config/talk.js +31 -0
- package/dist/config/telegram-custom-commands.js +70 -0
- package/dist/config/types.agent-defaults.js +1 -0
- package/dist/config/types.agents.js +1 -0
- package/dist/config/types.approvals.js +1 -0
- package/dist/config/types.auth.js +1 -0
- package/dist/config/types.base.js +1 -0
- package/dist/config/types.browser.js +1 -0
- package/dist/config/types.channels.js +1 -0
- package/dist/config/types.clawdbot.js +1 -0
- package/dist/config/types.cron.js +1 -0
- package/dist/config/types.discord.js +1 -0
- package/dist/config/types.gateway.js +1 -0
- package/dist/config/types.googlechat.js +1 -0
- package/dist/config/types.hooks.js +1 -0
- package/dist/config/types.imessage.js +1 -0
- package/dist/config/types.js +29 -0
- package/dist/config/types.messages.js +1 -0
- package/dist/config/types.models.js +1 -0
- package/dist/config/types.msteams.js +1 -0
- package/dist/config/types.node-host.js +1 -0
- package/dist/config/types.plugins.js +1 -0
- package/dist/config/types.queue.js +1 -0
- package/dist/config/types.sandbox.js +1 -0
- package/dist/config/types.signal.js +1 -0
- package/dist/config/types.skills.js +1 -0
- package/dist/config/types.slack.js +1 -0
- package/dist/config/types.telegram.js +1 -0
- package/dist/config/types.tools.js +1 -0
- package/dist/config/types.tts.js +1 -0
- package/dist/config/types.whatsapp.js +1 -0
- package/dist/config/validation.js +297 -0
- package/dist/config/version.js +30 -0
- package/dist/config/zod-schema.agent-defaults.js +156 -0
- package/dist/config/zod-schema.agent-runtime.js +487 -0
- package/dist/config/zod-schema.agents.js +46 -0
- package/dist/config/zod-schema.approvals.js +25 -0
- package/dist/config/zod-schema.channels.js +9 -0
- package/dist/config/zod-schema.core.js +452 -0
- package/dist/config/zod-schema.hooks.js +124 -0
- package/dist/config/zod-schema.js +539 -0
- package/dist/config/zod-schema.providers-core.js +687 -0
- package/dist/config/zod-schema.providers-whatsapp.js +123 -0
- package/dist/config/zod-schema.providers.js +29 -0
- package/dist/config/zod-schema.session.js +100 -0
- package/dist/control-ui/assets/index-08nzABV3.css +1 -0
- package/dist/control-ui/assets/index-DQcOTEYz.js +3119 -0
- package/dist/control-ui/assets/index-DQcOTEYz.js.map +1 -0
- package/dist/control-ui/index.html +15 -0
- package/dist/cron/isolated-agent/delivery-target.js +59 -0
- package/dist/cron/isolated-agent/helpers.js +49 -0
- package/dist/cron/isolated-agent/run.js +374 -0
- package/dist/cron/isolated-agent/session.js +27 -0
- package/dist/cron/isolated-agent.js +1 -0
- package/dist/cron/normalize.js +111 -0
- package/dist/cron/parse.js +24 -0
- package/dist/cron/payload-migration.js +29 -0
- package/dist/cron/run-log.js +70 -0
- package/dist/cron/schedule.js +24 -0
- package/dist/cron/service/jobs.js +174 -0
- package/dist/cron/service/locked.js +12 -0
- package/dist/cron/service/normalize.js +55 -0
- package/dist/cron/service/ops.js +118 -0
- package/dist/cron/service/state.js +10 -0
- package/dist/cron/service/store.js +57 -0
- package/dist/cron/service/timer.js +217 -0
- package/dist/cron/service.js +35 -0
- package/dist/cron/store.js +43 -0
- package/dist/cron/types.js +1 -0
- package/dist/daemon/constants.js +71 -0
- package/dist/daemon/diagnostics.js +38 -0
- package/dist/daemon/inspect.js +313 -0
- package/dist/daemon/launchd-plist.js +68 -0
- package/dist/daemon/launchd.js +316 -0
- package/dist/daemon/legacy.js +44 -0
- package/dist/daemon/node-service.js +53 -0
- package/dist/daemon/paths.js +35 -0
- package/dist/daemon/program-args.js +220 -0
- package/dist/daemon/runtime-parse.js +17 -0
- package/dist/daemon/runtime-paths.js +109 -0
- package/dist/daemon/schtasks.js +303 -0
- package/dist/daemon/service-audit.js +270 -0
- package/dist/daemon/service-env.js +128 -0
- package/dist/daemon/service-runtime.js +1 -0
- package/dist/daemon/service.js +90 -0
- package/dist/daemon/systemd-hints.js +24 -0
- package/dist/daemon/systemd-linger.js +59 -0
- package/dist/daemon/systemd-unit.js +108 -0
- package/dist/daemon/systemd.js +318 -0
- package/dist/discord/accounts.js +52 -0
- package/dist/discord/api.js +93 -0
- package/dist/discord/audit.js +94 -0
- package/dist/discord/chunk.js +200 -0
- package/dist/discord/directory-live.js +76 -0
- package/dist/discord/gateway-logging.js +48 -0
- package/dist/discord/index.js +2 -0
- package/dist/discord/monitor/allow-list.js +230 -0
- package/dist/discord/monitor/exec-approvals.js +406 -0
- package/dist/discord/monitor/format.js +27 -0
- package/dist/discord/monitor/listeners.js +240 -0
- package/dist/discord/monitor/message-handler.js +101 -0
- package/dist/discord/monitor/message-handler.preflight.js +438 -0
- package/dist/discord/monitor/message-handler.preflight.types.js +1 -0
- package/dist/discord/monitor/message-handler.process.js +344 -0
- package/dist/discord/monitor/message-utils.js +189 -0
- package/dist/discord/monitor/native-command.js +705 -0
- package/dist/discord/monitor/presence-cache.js +38 -0
- package/dist/discord/monitor/provider.js +551 -0
- package/dist/discord/monitor/reply-context.js +29 -0
- package/dist/discord/monitor/reply-delivery.js +57 -0
- package/dist/discord/monitor/system-events.js +53 -0
- package/dist/discord/monitor/threading.js +201 -0
- package/dist/discord/monitor/typing.js +8 -0
- package/dist/discord/monitor.gateway.js +54 -0
- package/dist/discord/monitor.js +7 -0
- package/dist/discord/probe.js +124 -0
- package/dist/discord/resolve-channels.js +239 -0
- package/dist/discord/resolve-users.js +114 -0
- package/dist/discord/send.channels.js +74 -0
- package/dist/discord/send.emojis-stickers.js +48 -0
- package/dist/discord/send.guild.js +79 -0
- package/dist/discord/send.js +7 -0
- package/dist/discord/send.messages.js +91 -0
- package/dist/discord/send.outbound.js +87 -0
- package/dist/discord/send.permissions.js +116 -0
- package/dist/discord/send.reactions.js +71 -0
- package/dist/discord/send.shared.js +249 -0
- package/dist/discord/send.types.js +16 -0
- package/dist/discord/targets.js +43 -0
- package/dist/discord/token.js +29 -0
- package/dist/entry.js +127 -0
- package/dist/gateway/assistant-identity.js +64 -0
- package/dist/gateway/auth.js +194 -0
- package/dist/gateway/boot.js +72 -0
- package/dist/gateway/call.js +182 -0
- package/dist/gateway/chat-abort.js +55 -0
- package/dist/gateway/chat-attachments.js +133 -0
- package/dist/gateway/chat-sanitize.js +103 -0
- package/dist/gateway/client.js +339 -0
- package/dist/gateway/config-reload.js +295 -0
- package/dist/gateway/control-ui-shared.js +48 -0
- package/dist/gateway/control-ui.js +258 -0
- package/dist/gateway/device-auth.js +19 -0
- package/dist/gateway/exec-approval-manager.js +40 -0
- package/dist/gateway/hooks-mapping.js +287 -0
- package/dist/gateway/hooks.js +169 -0
- package/dist/gateway/http-common.js +43 -0
- package/dist/gateway/http-utils.js +51 -0
- package/dist/gateway/live-image-probe.js +156 -0
- package/dist/gateway/net.js +176 -0
- package/dist/gateway/node-command-policy.js +106 -0
- package/dist/gateway/node-registry.js +142 -0
- package/dist/gateway/open-responses.schema.js +285 -0
- package/dist/gateway/openai-http.js +327 -0
- package/dist/gateway/openresponses-http.js +693 -0
- package/dist/gateway/probe.js +87 -0
- package/dist/gateway/protocol/client-info.js +46 -0
- package/dist/gateway/protocol/index.js +109 -0
- package/dist/gateway/protocol/schema/agent.js +73 -0
- package/dist/gateway/protocol/schema/agents-models-skills.js +47 -0
- package/dist/gateway/protocol/schema/channels.js +74 -0
- package/dist/gateway/protocol/schema/config.js +44 -0
- package/dist/gateway/protocol/schema/cron.js +159 -0
- package/dist/gateway/protocol/schema/devices.js +36 -0
- package/dist/gateway/protocol/schema/error-codes.js +14 -0
- package/dist/gateway/protocol/schema/exec-approvals.js +66 -0
- package/dist/gateway/protocol/schema/frames.js +101 -0
- package/dist/gateway/protocol/schema/logs-chat.js +53 -0
- package/dist/gateway/protocol/schema/nodes.js +54 -0
- package/dist/gateway/protocol/schema/primitives.js +10 -0
- package/dist/gateway/protocol/schema/protocol-schemas.js +117 -0
- package/dist/gateway/protocol/schema/sessions.js +69 -0
- package/dist/gateway/protocol/schema/snapshot.js +40 -0
- package/dist/gateway/protocol/schema/types.js +1 -0
- package/dist/gateway/protocol/schema/wizard.js +76 -0
- package/dist/gateway/protocol/schema.js +16 -0
- package/dist/gateway/server/__tests__/test-utils.js +24 -0
- package/dist/gateway/server/close-reason.js +10 -0
- package/dist/gateway/server/health-state.js +69 -0
- package/dist/gateway/server/hooks.js +85 -0
- package/dist/gateway/server/http-listen.js +26 -0
- package/dist/gateway/server/plugins-http.js +45 -0
- package/dist/gateway/server/tls.js +4 -0
- package/dist/gateway/server/ws-connection/message-handler.js +771 -0
- package/dist/gateway/server/ws-connection.js +191 -0
- package/dist/gateway/server/ws-types.js +1 -0
- package/dist/gateway/server-broadcast.js +73 -0
- package/dist/gateway/server-browser.js +11 -0
- package/dist/gateway/server-channels.js +242 -0
- package/dist/gateway/server-chat.js +195 -0
- package/dist/gateway/server-close.js +99 -0
- package/dist/gateway/server-constants.js +29 -0
- package/dist/gateway/server-cron.js +84 -0
- package/dist/gateway/server-discovery-runtime.js +69 -0
- package/dist/gateway/server-discovery.js +62 -0
- package/dist/gateway/server-http.js +224 -0
- package/dist/gateway/server-lanes.js +7 -0
- package/dist/gateway/server-maintenance.js +68 -0
- package/dist/gateway/server-methods/agent-job.js +104 -0
- package/dist/gateway/server-methods/agent.js +360 -0
- package/dist/gateway/server-methods/agents.js +14 -0
- package/dist/gateway/server-methods/channels.js +218 -0
- package/dist/gateway/server-methods/chat.js +520 -0
- package/dist/gateway/server-methods/config.js +269 -0
- package/dist/gateway/server-methods/connect.js +6 -0
- package/dist/gateway/server-methods/cron.js +109 -0
- package/dist/gateway/server-methods/devices.js +95 -0
- package/dist/gateway/server-methods/exec-approval.js +78 -0
- package/dist/gateway/server-methods/exec-approvals.js +141 -0
- package/dist/gateway/server-methods/health.js +29 -0
- package/dist/gateway/server-methods/logs.js +143 -0
- package/dist/gateway/server-methods/models.js +16 -0
- package/dist/gateway/server-methods/nodes.helpers.js +32 -0
- package/dist/gateway/server-methods/nodes.js +426 -0
- package/dist/gateway/server-methods/send.js +280 -0
- package/dist/gateway/server-methods/sessions.js +322 -0
- package/dist/gateway/server-methods/skills.js +137 -0
- package/dist/gateway/server-methods/system.js +122 -0
- package/dist/gateway/server-methods/talk.js +20 -0
- package/dist/gateway/server-methods/tts.js +132 -0
- package/dist/gateway/server-methods/types.js +1 -0
- package/dist/gateway/server-methods/update.js +96 -0
- package/dist/gateway/server-methods/usage.js +63 -0
- package/dist/gateway/server-methods/voicewake.js +30 -0
- package/dist/gateway/server-methods/web.js +73 -0
- package/dist/gateway/server-methods/wizard.js +100 -0
- package/dist/gateway/server-methods-list.js +107 -0
- package/dist/gateway/server-methods.js +192 -0
- package/dist/gateway/server-mobile-nodes.js +10 -0
- package/dist/gateway/server-model-catalog.js +11 -0
- package/dist/gateway/server-node-events-types.js +1 -0
- package/dist/gateway/server-node-events.js +206 -0
- package/dist/gateway/server-node-subscriptions.js +93 -0
- package/dist/gateway/server-plugins.js +36 -0
- package/dist/gateway/server-reload-handlers.js +112 -0
- package/dist/gateway/server-restart-sentinel.js +84 -0
- package/dist/gateway/server-runtime-config.js +66 -0
- package/dist/gateway/server-runtime-state.js +113 -0
- package/dist/gateway/server-session-key.js +20 -0
- package/dist/gateway/server-shared.js +1 -0
- package/dist/gateway/server-startup-log.js +27 -0
- package/dist/gateway/server-startup.js +119 -0
- package/dist/gateway/server-tailscale.js +41 -0
- package/dist/gateway/server-utils.js +35 -0
- package/dist/gateway/server-wizard-sessions.js +19 -0
- package/dist/gateway/server-ws-runtime.js +20 -0
- package/dist/gateway/server.impl.js +436 -0
- package/dist/gateway/server.js +2 -0
- package/dist/gateway/session-utils.fs.js +343 -0
- package/dist/gateway/session-utils.js +534 -0
- package/dist/gateway/session-utils.types.js +1 -0
- package/dist/gateway/sessions-patch.js +298 -0
- package/dist/gateway/sessions-resolve.js +103 -0
- package/dist/gateway/test-helpers.e2e.js +101 -0
- package/dist/gateway/test-helpers.mocks.js +502 -0
- package/dist/gateway/test-helpers.openai-mock.js +163 -0
- package/dist/gateway/test-helpers.server.js +369 -0
- package/dist/gateway/tools-invoke-http.js +178 -0
- package/dist/gateway/ws-log.js +336 -0
- package/dist/gateway/ws-logging.js +8 -0
- package/dist/globals.js +41 -0
- package/dist/hooks/bundled/boot-md/HOOK.md +19 -0
- package/dist/hooks/bundled/boot-md/handler.js +14 -0
- package/dist/hooks/bundled/command-logger/HOOK.md +122 -0
- package/dist/hooks/bundled/command-logger/handler.js +55 -0
- package/dist/hooks/bundled/session-memory/HOOK.md +86 -0
- package/dist/hooks/bundled/session-memory/handler.js +140 -0
- package/dist/hooks/bundled/soul-evil/HOOK.md +71 -0
- package/dist/hooks/bundled/soul-evil/handler.js +36 -0
- package/dist/hooks/bundled-dir.js +42 -0
- package/dist/hooks/config.js +122 -0
- package/dist/hooks/frontmatter.js +105 -0
- package/dist/hooks/gmail-ops.js +243 -0
- package/dist/hooks/gmail-setup-utils.js +310 -0
- package/dist/hooks/gmail-watcher.js +191 -0
- package/dist/hooks/gmail.js +179 -0
- package/dist/hooks/hooks-status.js +135 -0
- package/dist/hooks/hooks.js +2 -0
- package/dist/hooks/install.js +327 -0
- package/dist/hooks/installs.js +24 -0
- package/dist/hooks/internal-hooks.js +121 -0
- package/dist/hooks/llm-slug-generator.js +70 -0
- package/dist/hooks/loader.js +110 -0
- package/dist/hooks/plugin-hooks.js +91 -0
- package/dist/hooks/soul-evil.js +186 -0
- package/dist/hooks/types.js +1 -0
- package/dist/hooks/workspace.js +206 -0
- package/dist/imessage/accounts.js +61 -0
- package/dist/imessage/client.js +174 -0
- package/dist/imessage/index.js +3 -0
- package/dist/imessage/monitor/deliver.js +45 -0
- package/dist/imessage/monitor/monitor-provider.js +592 -0
- package/dist/imessage/monitor/runtime.js +12 -0
- package/dist/imessage/monitor/types.js +1 -0
- package/dist/imessage/monitor.js +1 -0
- package/dist/imessage/probe.js +68 -0
- package/dist/imessage/send.js +101 -0
- package/dist/imessage/targets.js +172 -0
- package/dist/index.js +49 -0
- package/dist/infra/agent-events.js +54 -0
- package/dist/infra/archive.js +97 -0
- package/dist/infra/backoff.js +19 -0
- package/dist/infra/binaries.js +9 -0
- package/dist/infra/bonjour-ciao.js +10 -0
- package/dist/infra/bonjour-discovery.js +445 -0
- package/dist/infra/bonjour-errors.js +7 -0
- package/dist/infra/bonjour.js +209 -0
- package/dist/infra/brew.js +55 -0
- package/dist/infra/canvas-host-url.js +52 -0
- package/dist/infra/channel-activity.js +32 -0
- package/dist/infra/channel-summary.js +183 -0
- package/dist/infra/channels-status-issues.js +15 -0
- package/dist/infra/clawdbot-root.js +56 -0
- package/dist/infra/clipboard.js +24 -0
- package/dist/infra/control-ui-assets.js +98 -0
- package/dist/infra/dedupe.js +47 -0
- package/dist/infra/device-auth-store.js +97 -0
- package/dist/infra/device-identity.js +149 -0
- package/dist/infra/device-pairing.js +401 -0
- package/dist/infra/diagnostic-events.js +28 -0
- package/dist/infra/diagnostic-flags.js +66 -0
- package/dist/infra/dotenv.js +15 -0
- package/dist/infra/env-file.js +43 -0
- package/dist/infra/env.js +34 -0
- package/dist/infra/errors.js +35 -0
- package/dist/infra/exec-approval-forwarder.js +212 -0
- package/dist/infra/exec-approvals.js +1040 -0
- package/dist/infra/exec-host.js +75 -0
- package/dist/infra/exec-safety.js +31 -0
- package/dist/infra/fetch.js +58 -0
- package/dist/infra/format-duration.js +20 -0
- package/dist/infra/gateway-lock.js +202 -0
- package/dist/infra/git-commit.js +106 -0
- package/dist/infra/heartbeat-events.js +34 -0
- package/dist/infra/heartbeat-runner.js +743 -0
- package/dist/infra/heartbeat-visibility.js +31 -0
- package/dist/infra/heartbeat-wake.js +61 -0
- package/dist/infra/is-main.js +33 -0
- package/dist/infra/json-file.js +21 -0
- package/dist/infra/machine-name.js +43 -0
- package/dist/infra/net/ssrf.js +199 -0
- package/dist/infra/node-pairing.js +228 -0
- package/dist/infra/node-shell.js +9 -0
- package/dist/infra/os-summary.js +23 -0
- package/dist/infra/outbound/agent-delivery.js +86 -0
- package/dist/infra/outbound/channel-adapters.js +16 -0
- package/dist/infra/outbound/channel-selection.js +62 -0
- package/dist/infra/outbound/channel-target.js +28 -0
- package/dist/infra/outbound/deliver.js +253 -0
- package/dist/infra/outbound/directory-cache.js +44 -0
- package/dist/infra/outbound/envelope.js +20 -0
- package/dist/infra/outbound/format.js +66 -0
- package/dist/infra/outbound/message-action-runner.js +766 -0
- package/dist/infra/outbound/message-action-spec.js +82 -0
- package/dist/infra/outbound/message.js +189 -0
- package/dist/infra/outbound/outbound-policy.js +122 -0
- package/dist/infra/outbound/outbound-send-service.js +123 -0
- package/dist/infra/outbound/outbound-session.js +744 -0
- package/dist/infra/outbound/payloads.js +78 -0
- package/dist/infra/outbound/target-errors.js +23 -0
- package/dist/infra/outbound/target-normalization.js +27 -0
- package/dist/infra/outbound/target-resolver.js +348 -0
- package/dist/infra/outbound/targets.js +213 -0
- package/dist/infra/path-env.js +93 -0
- package/dist/infra/ports-format.js +53 -0
- package/dist/infra/ports-inspect.js +240 -0
- package/dist/infra/ports-lsof.js +33 -0
- package/dist/infra/ports-types.js +1 -0
- package/dist/infra/ports.js +75 -0
- package/dist/infra/provider-usage.auth.js +188 -0
- package/dist/infra/provider-usage.fetch.antigravity.js +212 -0
- package/dist/infra/provider-usage.fetch.claude.js +129 -0
- package/dist/infra/provider-usage.fetch.codex.js +62 -0
- package/dist/infra/provider-usage.fetch.copilot.js +42 -0
- package/dist/infra/provider-usage.fetch.gemini.js +57 -0
- package/dist/infra/provider-usage.fetch.js +7 -0
- package/dist/infra/provider-usage.fetch.minimax.js +332 -0
- package/dist/infra/provider-usage.fetch.shared.js +10 -0
- package/dist/infra/provider-usage.fetch.zai.js +62 -0
- package/dist/infra/provider-usage.format.js +96 -0
- package/dist/infra/provider-usage.js +3 -0
- package/dist/infra/provider-usage.load.js +59 -0
- package/dist/infra/provider-usage.shared.js +51 -0
- package/dist/infra/provider-usage.types.js +1 -0
- package/dist/infra/restart-sentinel.js +65 -0
- package/dist/infra/restart.js +171 -0
- package/dist/infra/retry-policy.js +68 -0
- package/dist/infra/retry.js +85 -0
- package/dist/infra/runtime-guard.js +60 -0
- package/dist/infra/session-cost-usage.js +190 -0
- package/dist/infra/shell-env.js +125 -0
- package/dist/infra/skills-remote.js +282 -0
- package/dist/infra/ssh-config.js +83 -0
- package/dist/infra/ssh-tunnel.js +166 -0
- package/dist/infra/state-migrations.fs.js +49 -0
- package/dist/infra/state-migrations.js +498 -0
- package/dist/infra/system-events.js +75 -0
- package/dist/infra/system-presence.js +231 -0
- package/dist/infra/tailnet.js +46 -0
- package/dist/infra/tailscale.js +368 -0
- package/dist/infra/tls/fingerprint.js +5 -0
- package/dist/infra/tls/gateway.js +119 -0
- package/dist/infra/transport-ready.js +38 -0
- package/dist/infra/unhandled-rejections.js +29 -0
- package/dist/infra/update-channels.js +57 -0
- package/dist/infra/update-check.js +293 -0
- package/dist/infra/update-global.js +85 -0
- package/dist/infra/update-runner.js +557 -0
- package/dist/infra/update-startup.js +86 -0
- package/dist/infra/voicewake.js +74 -0
- package/dist/infra/warnings.js +25 -0
- package/dist/infra/widearea-dns.js +131 -0
- package/dist/infra/ws.js +13 -0
- package/dist/infra/wsl.js +25 -0
- package/dist/line/accounts.js +130 -0
- package/dist/line/auto-reply-delivery.js +102 -0
- package/dist/line/bot-access.js +38 -0
- package/dist/line/bot-handlers.js +258 -0
- package/dist/line/bot-message-context.js +374 -0
- package/dist/line/bot.js +48 -0
- package/dist/line/config-schema.js +47 -0
- package/dist/line/download.js +95 -0
- package/dist/line/flex-templates.js +1264 -0
- package/dist/line/http-registry.js +27 -0
- package/dist/line/index.js +19 -0
- package/dist/line/markdown-to-line.js +346 -0
- package/dist/line/monitor.js +270 -0
- package/dist/line/probe.js +37 -0
- package/dist/line/reply-chunks.js +53 -0
- package/dist/line/rich-menu.js +320 -0
- package/dist/line/send.js +451 -0
- package/dist/line/template-messages.js +258 -0
- package/dist/line/types.js +1 -0
- package/dist/line/webhook.js +75 -0
- package/dist/link-understanding/apply.js +22 -0
- package/dist/link-understanding/defaults.js +2 -0
- package/dist/link-understanding/detect.js +49 -0
- package/dist/link-understanding/format.js +10 -0
- package/dist/link-understanding/index.js +4 -0
- package/dist/link-understanding/runner.js +99 -0
- package/dist/logger.js +53 -0
- package/dist/logging/config.js +19 -0
- package/dist/logging/console.js +237 -0
- package/dist/logging/diagnostic.js +236 -0
- package/dist/logging/levels.js +26 -0
- package/dist/logging/logger.js +185 -0
- package/dist/logging/parse-log-line.js +52 -0
- package/dist/logging/redact.js +115 -0
- package/dist/logging/state.js +12 -0
- package/dist/logging/subsystem.js +234 -0
- package/dist/logging.js +5 -0
- package/dist/macos/gateway-daemon.js +178 -0
- package/dist/macos/relay-smoke.js +29 -0
- package/dist/macos/relay.js +60 -0
- package/dist/markdown/code-spans.js +67 -0
- package/dist/markdown/fences.js +57 -0
- package/dist/markdown/frontmatter.js +124 -0
- package/dist/markdown/ir.js +687 -0
- package/dist/markdown/render.js +113 -0
- package/dist/markdown/tables.js +35 -0
- package/dist/media/audio-tags.js +14 -0
- package/dist/media/audio.js +15 -0
- package/dist/media/constants.js +33 -0
- package/dist/media/fetch.js +151 -0
- package/dist/media/host.js +43 -0
- package/dist/media/image-ops.js +385 -0
- package/dist/media/input-files.js +276 -0
- package/dist/media/mime.js +147 -0
- package/dist/media/parse.js +175 -0
- package/dist/media/server.js +64 -0
- package/dist/media/store.js +199 -0
- package/dist/media-understanding/apply.js +78 -0
- package/dist/media-understanding/attachments.js +320 -0
- package/dist/media-understanding/concurrency.js +26 -0
- package/dist/media-understanding/defaults.js +30 -0
- package/dist/media-understanding/errors.js +11 -0
- package/dist/media-understanding/format.js +56 -0
- package/dist/media-understanding/index.js +3 -0
- package/dist/media-understanding/providers/anthropic/index.js +6 -0
- package/dist/media-understanding/providers/deepgram/audio.js +47 -0
- package/dist/media-understanding/providers/deepgram/index.js +6 -0
- package/dist/media-understanding/providers/google/audio.js +64 -0
- package/dist/media-understanding/providers/google/index.js +10 -0
- package/dist/media-understanding/providers/google/video.js +64 -0
- package/dist/media-understanding/providers/groq/index.js +10 -0
- package/dist/media-understanding/providers/image.js +59 -0
- package/dist/media-understanding/providers/index.js +45 -0
- package/dist/media-understanding/providers/minimax/index.js +6 -0
- package/dist/media-understanding/providers/openai/audio.js +46 -0
- package/dist/media-understanding/providers/openai/index.js +8 -0
- package/dist/media-understanding/providers/shared.js +29 -0
- package/dist/media-understanding/resolve.js +113 -0
- package/dist/media-understanding/runner.js +976 -0
- package/dist/media-understanding/scope.js +41 -0
- package/dist/media-understanding/types.js +1 -0
- package/dist/media-understanding/video.js +8 -0
- package/dist/memory/batch-gemini.js +320 -0
- package/dist/memory/batch-openai.js +290 -0
- package/dist/memory/embeddings-gemini.js +129 -0
- package/dist/memory/embeddings-openai.js +65 -0
- package/dist/memory/embeddings.js +170 -0
- package/dist/memory/headers-fingerprint.js +16 -0
- package/dist/memory/hybrid.js +61 -0
- package/dist/memory/index.js +1 -0
- package/dist/memory/internal.js +189 -0
- package/dist/memory/manager-cache-key.js +45 -0
- package/dist/memory/manager-search.js +95 -0
- package/dist/memory/manager.js +1815 -0
- package/dist/memory/memory-schema.js +76 -0
- package/dist/memory/node-llama.js +3 -0
- package/dist/memory/openai-batch.js +2 -0
- package/dist/memory/provider-key.js +23 -0
- package/dist/memory/search-manager.js +11 -0
- package/dist/memory/session-files.js +98 -0
- package/dist/memory/sqlite-vec.js +19 -0
- package/dist/memory/sqlite.js +7 -0
- package/dist/memory/status-format.js +23 -0
- package/dist/memory/sync-memory-files.js +69 -0
- package/dist/memory/sync-session-files.js +95 -0
- package/dist/node-host/config.js +53 -0
- package/dist/node-host/runner.js +951 -0
- package/dist/pairing/pairing-labels.js +4 -0
- package/dist/pairing/pairing-messages.js +14 -0
- package/dist/pairing/pairing-store.js +357 -0
- package/dist/plugin-sdk/index.js +84 -0
- package/dist/plugins/bundled-dir.js +35 -0
- package/dist/plugins/cli.js +49 -0
- package/dist/plugins/commands.js +228 -0
- package/dist/plugins/config-schema.js +23 -0
- package/dist/plugins/config-state.js +101 -0
- package/dist/plugins/discovery.js +273 -0
- package/dist/plugins/enable.js +36 -0
- package/dist/plugins/hook-runner-global.js +57 -0
- package/dist/plugins/hooks.js +283 -0
- package/dist/plugins/http-path.js +10 -0
- package/dist/plugins/http-registry.js +31 -0
- package/dist/plugins/install.js +323 -0
- package/dist/plugins/installs.js +21 -0
- package/dist/plugins/loader.js +364 -0
- package/dist/plugins/manifest-registry.js +136 -0
- package/dist/plugins/manifest.js +69 -0
- package/dist/plugins/providers.js +16 -0
- package/dist/plugins/registry.js +312 -0
- package/dist/plugins/runtime/index.js +290 -0
- package/dist/plugins/runtime/native-deps.js +16 -0
- package/dist/plugins/runtime/types.js +1 -0
- package/dist/plugins/runtime.js +42 -0
- package/dist/plugins/schema-validator.js +28 -0
- package/dist/plugins/services.js +55 -0
- package/dist/plugins/slots.js +68 -0
- package/dist/plugins/status.js +27 -0
- package/dist/plugins/tools.js +98 -0
- package/dist/plugins/types.js +1 -0
- package/dist/plugins/update.js +324 -0
- package/dist/polls.js +41 -0
- package/dist/process/child-process-bridge.js +34 -0
- package/dist/process/command-queue.js +104 -0
- package/dist/process/exec.js +98 -0
- package/dist/process/lanes.js +1 -0
- package/dist/process/spawn-utils.js +95 -0
- package/dist/providers/github-copilot-auth.js +124 -0
- package/dist/providers/github-copilot-models.js +35 -0
- package/dist/providers/github-copilot-token.js +95 -0
- package/dist/providers/qwen-portal-oauth.js +38 -0
- package/dist/routing/bindings.js +87 -0
- package/dist/routing/resolve-route.js +140 -0
- package/dist/routing/session-key.js +169 -0
- package/dist/runtime.js +15 -0
- package/dist/security/audit-extra.js +852 -0
- package/dist/security/audit-fs.js +133 -0
- package/dist/security/audit.js +790 -0
- package/dist/security/external-content.js +143 -0
- package/dist/security/fix.js +402 -0
- package/dist/security/windows-acl.js +162 -0
- package/dist/sessions/level-overrides.js +24 -0
- package/dist/sessions/model-overrides.js +57 -0
- package/dist/sessions/send-policy.js +69 -0
- package/dist/sessions/session-key-utils.js +51 -0
- package/dist/sessions/session-label.js +16 -0
- package/dist/sessions/transcript-events.js +16 -0
- package/dist/shared/text/reasoning-tags.js +48 -0
- package/dist/signal/accounts.js +59 -0
- package/dist/signal/client.js +141 -0
- package/dist/signal/daemon.js +69 -0
- package/dist/signal/format.js +165 -0
- package/dist/signal/identity.js +95 -0
- package/dist/signal/index.js +5 -0
- package/dist/signal/monitor/event-handler.js +492 -0
- package/dist/signal/monitor/event-handler.types.js +1 -0
- package/dist/signal/monitor.js +269 -0
- package/dist/signal/probe.js +46 -0
- package/dist/signal/reaction-level.js +53 -0
- package/dist/signal/send-reactions.js +155 -0
- package/dist/signal/send.js +192 -0
- package/dist/signal/sse-reconnect.js +56 -0
- package/dist/slack/accounts.js +84 -0
- package/dist/slack/actions.js +156 -0
- package/dist/slack/channel-migration.js +53 -0
- package/dist/slack/client.js +17 -0
- package/dist/slack/directory-live.js +122 -0
- package/dist/slack/format.js +111 -0
- package/dist/slack/http/index.js +1 -0
- package/dist/slack/http/registry.js +27 -0
- package/dist/slack/index.js +6 -0
- package/dist/slack/monitor/allow-list.js +58 -0
- package/dist/slack/monitor/auth.js +17 -0
- package/dist/slack/monitor/channel-config.js +79 -0
- package/dist/slack/monitor/commands.js +17 -0
- package/dist/slack/monitor/context.js +242 -0
- package/dist/slack/monitor/events/channels.js +116 -0
- package/dist/slack/monitor/events/members.js +74 -0
- package/dist/slack/monitor/events/messages.js +111 -0
- package/dist/slack/monitor/events/pins.js +76 -0
- package/dist/slack/monitor/events/reactions.js +54 -0
- package/dist/slack/monitor/events.js +15 -0
- package/dist/slack/monitor/media.js +93 -0
- package/dist/slack/monitor/message-handler/dispatch.js +170 -0
- package/dist/slack/monitor/message-handler/prepare.js +477 -0
- package/dist/slack/monitor/message-handler/types.js +1 -0
- package/dist/slack/monitor/message-handler.js +87 -0
- package/dist/slack/monitor/policy.js +10 -0
- package/dist/slack/monitor/provider.js +324 -0
- package/dist/slack/monitor/replies.js +107 -0
- package/dist/slack/monitor/slash.js +504 -0
- package/dist/slack/monitor/thread-resolution.js +102 -0
- package/dist/slack/monitor/types.js +1 -0
- package/dist/slack/monitor.js +4 -0
- package/dist/slack/monitor.test-helpers.js +119 -0
- package/dist/slack/probe.js +47 -0
- package/dist/slack/resolve-channels.js +88 -0
- package/dist/slack/resolve-users.js +133 -0
- package/dist/slack/scopes.js +87 -0
- package/dist/slack/send.js +132 -0
- package/dist/slack/targets.js +48 -0
- package/dist/slack/threading-tool-context.js +18 -0
- package/dist/slack/threading.js +26 -0
- package/dist/slack/token.js +10 -0
- package/dist/slack/types.js +1 -0
- package/dist/telegram/accounts.js +98 -0
- package/dist/telegram/allowed-updates.js +8 -0
- package/dist/telegram/audit.js +116 -0
- package/dist/telegram/bot/delivery.js +312 -0
- package/dist/telegram/bot/helpers.js +303 -0
- package/dist/telegram/bot/types.js +1 -0
- package/dist/telegram/bot-access.js +59 -0
- package/dist/telegram/bot-handlers.js +516 -0
- package/dist/telegram/bot-message-context.js +435 -0
- package/dist/telegram/bot-message-dispatch.js +183 -0
- package/dist/telegram/bot-message.js +41 -0
- package/dist/telegram/bot-native-commands.js +402 -0
- package/dist/telegram/bot-updates.js +25 -0
- package/dist/telegram/bot.js +383 -0
- package/dist/telegram/caption.js +11 -0
- package/dist/telegram/download.js +34 -0
- package/dist/telegram/draft-chunking.js +22 -0
- package/dist/telegram/draft-stream.js +101 -0
- package/dist/telegram/fetch.js +11 -0
- package/dist/telegram/format.js +66 -0
- package/dist/telegram/group-migration.js +53 -0
- package/dist/telegram/index.js +4 -0
- package/dist/telegram/inline-buttons.js +55 -0
- package/dist/telegram/monitor.js +142 -0
- package/dist/telegram/pairing-store.js +77 -0
- package/dist/telegram/probe.js +70 -0
- package/dist/telegram/proxy.js +10 -0
- package/dist/telegram/reaction-level.js +46 -0
- package/dist/telegram/send.js +382 -0
- package/dist/telegram/sent-message-cache.js +53 -0
- package/dist/telegram/targets.js +46 -0
- package/dist/telegram/token.js +58 -0
- package/dist/telegram/update-offset-store.js +60 -0
- package/dist/telegram/voice.js +23 -0
- package/dist/telegram/webhook-set.js +21 -0
- package/dist/telegram/webhook.js +90 -0
- package/dist/terminal/ansi.js +11 -0
- package/dist/terminal/links.js +17 -0
- package/dist/terminal/note.js +79 -0
- package/dist/terminal/palette.js +12 -0
- package/dist/terminal/progress-line.js +18 -0
- package/dist/terminal/prompt-style.js +4 -0
- package/dist/terminal/stream-writer.js +49 -0
- package/dist/terminal/table.js +327 -0
- package/dist/terminal/theme.js +22 -0
- package/dist/tts/tts.js +1159 -0
- package/dist/tui/commands.js +134 -0
- package/dist/tui/components/assistant-message.js +16 -0
- package/dist/tui/components/chat-log.js +86 -0
- package/dist/tui/components/custom-editor.js +61 -0
- package/dist/tui/components/filterable-select-list.js +102 -0
- package/dist/tui/components/fuzzy-filter.js +113 -0
- package/dist/tui/components/searchable-select-list.js +231 -0
- package/dist/tui/components/selectors.js +16 -0
- package/dist/tui/components/tool-execution.js +109 -0
- package/dist/tui/components/user-message.js +17 -0
- package/dist/tui/gateway-chat.js +146 -0
- package/dist/tui/theme/syntax-theme.js +49 -0
- package/dist/tui/theme/theme.js +119 -0
- package/dist/tui/tui-command-handlers.js +418 -0
- package/dist/tui/tui-event-handlers.js +160 -0
- package/dist/tui/tui-formatters.js +158 -0
- package/dist/tui/tui-local-shell.js +99 -0
- package/dist/tui/tui-overlays.js +13 -0
- package/dist/tui/tui-session-actions.js +205 -0
- package/dist/tui/tui-status-summary.js +74 -0
- package/dist/tui/tui-stream-assembler.js +54 -0
- package/dist/tui/tui-types.js +1 -0
- package/dist/tui/tui-waiting.js +34 -0
- package/dist/tui/tui.js +551 -0
- package/dist/utils/account-id.js +6 -0
- package/dist/utils/boolean.js +22 -0
- package/dist/utils/delivery-context.js +84 -0
- package/dist/utils/directive-tags.js +54 -0
- package/dist/utils/message-channel.js +84 -0
- package/dist/utils/provider-utils.js +28 -0
- package/dist/utils/queue-helpers.js +95 -0
- package/dist/utils/time-format.js +19 -0
- package/dist/utils/usage-format.js +46 -0
- package/dist/utils.js +247 -0
- package/dist/version.js +18 -0
- package/dist/web/accounts.js +122 -0
- package/dist/web/active-listener.js +37 -0
- package/dist/web/auth-store.js +168 -0
- package/dist/web/auto-reply/constants.js +1 -0
- package/dist/web/auto-reply/deliver-reply.js +140 -0
- package/dist/web/auto-reply/heartbeat-runner.js +264 -0
- package/dist/web/auto-reply/loggers.js +5 -0
- package/dist/web/auto-reply/mentions.js +79 -0
- package/dist/web/auto-reply/monitor/ack-reaction.js +47 -0
- package/dist/web/auto-reply/monitor/broadcast.js +64 -0
- package/dist/web/auto-reply/monitor/commands.js +21 -0
- package/dist/web/auto-reply/monitor/echo.js +36 -0
- package/dist/web/auto-reply/monitor/group-activation.js +37 -0
- package/dist/web/auto-reply/monitor/group-gating.js +98 -0
- package/dist/web/auto-reply/monitor/group-members.js +53 -0
- package/dist/web/auto-reply/monitor/last-route.js +38 -0
- package/dist/web/auto-reply/monitor/message-line.js +35 -0
- package/dist/web/auto-reply/monitor/on-message.js +128 -0
- package/dist/web/auto-reply/monitor/peer.js +10 -0
- package/dist/web/auto-reply/monitor/process-message.js +316 -0
- package/dist/web/auto-reply/monitor.js +355 -0
- package/dist/web/auto-reply/session-snapshot.js +40 -0
- package/dist/web/auto-reply/types.js +1 -0
- package/dist/web/auto-reply/util.js +47 -0
- package/dist/web/auto-reply.impl.js +5 -0
- package/dist/web/auto-reply.js +1 -0
- package/dist/web/inbound/access-control.js +147 -0
- package/dist/web/inbound/dedupe.js +13 -0
- package/dist/web/inbound/extract.js +254 -0
- package/dist/web/inbound/media.js +35 -0
- package/dist/web/inbound/monitor.js +332 -0
- package/dist/web/inbound/send-api.js +90 -0
- package/dist/web/inbound/types.js +1 -0
- package/dist/web/inbound.js +3 -0
- package/dist/web/login-qr.js +227 -0
- package/dist/web/login.js +68 -0
- package/dist/web/media.js +221 -0
- package/dist/web/outbound.js +132 -0
- package/dist/web/qr-image.js +95 -0
- package/dist/web/reconnect.js +36 -0
- package/dist/web/session.js +224 -0
- package/dist/web/vcard.js +63 -0
- package/dist/whatsapp/normalize.js +66 -0
- package/dist/wizard/clack-prompter.js +72 -0
- package/dist/wizard/onboarding.finalize.js +351 -0
- package/dist/wizard/onboarding.gateway-config.js +188 -0
- package/dist/wizard/onboarding.js +372 -0
- package/dist/wizard/onboarding.types.js +1 -0
- package/dist/wizard/prompts.js +6 -0
- package/dist/wizard/session.js +201 -0
- package/docs/CNAME +1 -0
- package/docs/_config.yml +53 -0
- package/docs/_layouts/default.html +145 -0
- package/docs/assets/markdown.css +179 -0
- package/docs/assets/pixel-lobster.svg +60 -0
- package/docs/assets/showcase/agents-ui.jpg +0 -0
- package/docs/assets/showcase/bambu-cli.png +0 -0
- package/docs/assets/showcase/codexmonitor.png +0 -0
- package/docs/assets/showcase/gohome-grafana.png +0 -0
- package/docs/assets/showcase/ios-testflight.jpg +0 -0
- package/docs/assets/showcase/oura-health.png +0 -0
- package/docs/assets/showcase/padel-cli.svg +11 -0
- package/docs/assets/showcase/padel-screenshot.jpg +0 -0
- package/docs/assets/showcase/papla-tts.jpg +0 -0
- package/docs/assets/showcase/pr-review-telegram.jpg +0 -0
- package/docs/assets/showcase/roborock-screenshot.jpg +0 -0
- package/docs/assets/showcase/roborock-status.svg +13 -0
- package/docs/assets/showcase/roof-camera-sky.jpg +0 -0
- package/docs/assets/showcase/snag.png +0 -0
- package/docs/assets/showcase/tesco-shop.jpg +0 -0
- package/docs/assets/showcase/wienerlinien.png +0 -0
- package/docs/assets/showcase/wine-cellar-skill.jpg +0 -0
- package/docs/assets/showcase/winix-air-purifier.jpg +0 -0
- package/docs/assets/showcase/xuezh-pronunciation.jpeg +0 -0
- package/docs/assets/terminal.css +470 -0
- package/docs/assets/theme.js +55 -0
- package/docs/automation/auth-monitoring.md +41 -0
- package/docs/automation/cron-jobs.md +286 -0
- package/docs/automation/cron-vs-heartbeat.md +274 -0
- package/docs/automation/gmail-pubsub.md +252 -0
- package/docs/automation/poll.md +63 -0
- package/docs/automation/webhook.md +155 -0
- package/docs/bedrock.md +172 -0
- package/docs/brave-search.md +40 -0
- package/docs/broadcast-groups.md +407 -0
- package/docs/channels/bluebubbles.md +232 -0
- package/docs/channels/discord.md +400 -0
- package/docs/channels/googlechat.md +220 -0
- package/docs/channels/grammy.md +27 -0
- package/docs/channels/imessage.md +261 -0
- package/docs/channels/index.md +43 -0
- package/docs/channels/line.md +183 -0
- package/docs/channels/location.md +48 -0
- package/docs/channels/matrix.md +230 -0
- package/docs/channels/mattermost.md +123 -0
- package/docs/channels/msteams.md +703 -0
- package/docs/channels/nextcloud-talk.md +120 -0
- package/docs/channels/nostr.md +235 -0
- package/docs/channels/signal.md +179 -0
- package/docs/channels/slack.md +507 -0
- package/docs/channels/telegram.md +546 -0
- package/docs/channels/tlon.md +133 -0
- package/docs/channels/troubleshooting.md +25 -0
- package/docs/channels/twitch.md +366 -0
- package/docs/channels/whatsapp.md +362 -0
- package/docs/channels/zalo.md +167 -0
- package/docs/channels/zalouser.md +123 -0
- package/docs/cli/acp.md +166 -0
- package/docs/cli/agent.md +22 -0
- package/docs/cli/agents.md +71 -0
- package/docs/cli/approvals.md +48 -0
- package/docs/cli/browser.md +106 -0
- package/docs/cli/channels.md +75 -0
- package/docs/cli/config.md +49 -0
- package/docs/cli/configure.md +30 -0
- package/docs/cli/cron.md +29 -0
- package/docs/cli/dashboard.md +16 -0
- package/docs/cli/devices.md +66 -0
- package/docs/cli/directory.md +60 -0
- package/docs/cli/dns.md +22 -0
- package/docs/cli/docs.md +15 -0
- package/docs/cli/doctor.md +38 -0
- package/docs/cli/gateway.md +187 -0
- package/docs/cli/health.md +19 -0
- package/docs/cli/hooks.md +290 -0
- package/docs/cli/index.md +919 -0
- package/docs/cli/logs.md +23 -0
- package/docs/cli/memory.md +41 -0
- package/docs/cli/message.md +228 -0
- package/docs/cli/models.md +68 -0
- package/docs/cli/node.md +108 -0
- package/docs/cli/nodes.md +68 -0
- package/docs/cli/onboard.md +25 -0
- package/docs/cli/pairing.md +20 -0
- package/docs/cli/plugins.md +60 -0
- package/docs/cli/reset.md +17 -0
- package/docs/cli/sandbox.md +150 -0
- package/docs/cli/security.md +24 -0
- package/docs/cli/sessions.md +16 -0
- package/docs/cli/setup.md +28 -0
- package/docs/cli/skills.md +25 -0
- package/docs/cli/status.md +24 -0
- package/docs/cli/system.md +55 -0
- package/docs/cli/tui.md +22 -0
- package/docs/cli/uninstall.md +17 -0
- package/docs/cli/update.md +96 -0
- package/docs/cli/voicecall.md +33 -0
- package/docs/cli/webhooks.md +23 -0
- package/docs/concepts/agent-loop.md +126 -0
- package/docs/concepts/agent-workspace.md +231 -0
- package/docs/concepts/agent.md +117 -0
- package/docs/concepts/architecture.md +122 -0
- package/docs/concepts/channel-routing.md +114 -0
- package/docs/concepts/compaction.md +49 -0
- package/docs/concepts/context.md +151 -0
- package/docs/concepts/group-messages.md +78 -0
- package/docs/concepts/groups.md +308 -0
- package/docs/concepts/markdown-formatting.md +132 -0
- package/docs/concepts/memory.md +388 -0
- package/docs/concepts/messages.md +143 -0
- package/docs/concepts/model-failover.md +139 -0
- package/docs/concepts/model-providers.md +318 -0
- package/docs/concepts/models.md +202 -0
- package/docs/concepts/multi-agent.md +354 -0
- package/docs/concepts/oauth.md +135 -0
- package/docs/concepts/presence.md +98 -0
- package/docs/concepts/queue.md +77 -0
- package/docs/concepts/retry.md +60 -0
- package/docs/concepts/session-pruning.md +104 -0
- package/docs/concepts/session-tool.md +171 -0
- package/docs/concepts/session.md +150 -0
- package/docs/concepts/sessions.md +8 -0
- package/docs/concepts/streaming.md +123 -0
- package/docs/concepts/system-prompt.md +110 -0
- package/docs/concepts/timezone.md +89 -0
- package/docs/concepts/typebox.md +281 -0
- package/docs/concepts/typing-indicators.md +59 -0
- package/docs/concepts/usage-tracking.md +30 -0
- package/docs/date-time.md +127 -0
- package/docs/debug/node-issue.md +72 -0
- package/docs/debugging.md +161 -0
- package/docs/diagnostics/flags.md +89 -0
- package/docs/docs.json +1135 -0
- package/docs/environment.md +78 -0
- package/docs/experiments/onboarding-config-protocol.md +34 -0
- package/docs/experiments/plans/cron-add-hardening.md +57 -0
- package/docs/experiments/plans/group-policy-hardening.md +38 -0
- package/docs/experiments/plans/openresponses-gateway.md +122 -0
- package/docs/experiments/proposals/model-config.md +32 -0
- package/docs/experiments/research/memory.md +210 -0
- package/docs/gateway/authentication.md +143 -0
- package/docs/gateway/background-process.md +82 -0
- package/docs/gateway/bonjour.md +162 -0
- package/docs/gateway/bridge-protocol.md +85 -0
- package/docs/gateway/cli-backends.md +221 -0
- package/docs/gateway/configuration-examples.md +572 -0
- package/docs/gateway/configuration.md +3246 -0
- package/docs/gateway/discovery.md +110 -0
- package/docs/gateway/doctor.md +252 -0
- package/docs/gateway/gateway-lock.md +28 -0
- package/docs/gateway/health.md +29 -0
- package/docs/gateway/heartbeat.md +297 -0
- package/docs/gateway/index.md +292 -0
- package/docs/gateway/local-models.md +146 -0
- package/docs/gateway/logging.md +112 -0
- package/docs/gateway/multiple-gateways.md +107 -0
- package/docs/gateway/openai-http-api.md +112 -0
- package/docs/gateway/openresponses-http-api.md +298 -0
- package/docs/gateway/pairing.md +92 -0
- package/docs/gateway/protocol.md +215 -0
- package/docs/gateway/remote-gateway-readme.md +153 -0
- package/docs/gateway/remote.md +122 -0
- package/docs/gateway/sandbox-vs-tool-policy-vs-elevated.md +117 -0
- package/docs/gateway/sandboxing.md +174 -0
- package/docs/gateway/security.md +741 -0
- package/docs/gateway/tailscale.md +146 -0
- package/docs/gateway/tools-invoke-http-api.md +79 -0
- package/docs/gateway/troubleshooting.md +714 -0
- package/docs/help/faq.md +2725 -0
- package/docs/help/index.md +20 -0
- package/docs/help/troubleshooting.md +97 -0
- package/docs/hooks/soul-evil.md +68 -0
- package/docs/hooks.md +896 -0
- package/docs/images/groups-flow.svg +52 -0
- package/docs/images/mobile-ui-screenshot.png +0 -0
- package/docs/index.md +240 -0
- package/docs/install/ansible.md +205 -0
- package/docs/install/bun.md +58 -0
- package/docs/install/development-channels.md +74 -0
- package/docs/install/docker.md +447 -0
- package/docs/install/index.md +180 -0
- package/docs/install/installer.md +122 -0
- package/docs/install/nix.md +95 -0
- package/docs/install/node.md +77 -0
- package/docs/install/uninstall.md +125 -0
- package/docs/install/updating.md +218 -0
- package/docs/logging.md +343 -0
- package/docs/multi-agent-sandbox-tools.md +374 -0
- package/docs/network.md +51 -0
- package/docs/nodes/audio.md +109 -0
- package/docs/nodes/camera.md +152 -0
- package/docs/nodes/images.md +61 -0
- package/docs/nodes/index.md +305 -0
- package/docs/nodes/location-command.md +95 -0
- package/docs/nodes/media-understanding.md +313 -0
- package/docs/nodes/talk.md +79 -0
- package/docs/nodes/voicewake.md +61 -0
- package/docs/perplexity.md +79 -0
- package/docs/platforms/android.md +141 -0
- package/docs/platforms/digitalocean.md +243 -0
- package/docs/platforms/exe-dev.md +187 -0
- package/docs/platforms/fly.md +465 -0
- package/docs/platforms/gcp.md +498 -0
- package/docs/platforms/hetzner.md +325 -0
- package/docs/platforms/index.md +50 -0
- package/docs/platforms/ios.md +104 -0
- package/docs/platforms/linux.md +89 -0
- package/docs/platforms/mac/bundled-gateway.md +67 -0
- package/docs/platforms/mac/canvas.md +121 -0
- package/docs/platforms/mac/child-process.md +67 -0
- package/docs/platforms/mac/dev-setup.md +91 -0
- package/docs/platforms/mac/health.md +28 -0
- package/docs/platforms/mac/icon.md +26 -0
- package/docs/platforms/mac/logging.md +51 -0
- package/docs/platforms/mac/menu-bar.md +70 -0
- package/docs/platforms/mac/peekaboo.md +62 -0
- package/docs/platforms/mac/permissions.md +40 -0
- package/docs/platforms/mac/release.md +77 -0
- package/docs/platforms/mac/remote.md +71 -0
- package/docs/platforms/mac/signing.md +43 -0
- package/docs/platforms/mac/skills.md +27 -0
- package/docs/platforms/mac/voice-overlay.md +52 -0
- package/docs/platforms/mac/voicewake.md +56 -0
- package/docs/platforms/mac/webchat.md +39 -0
- package/docs/platforms/mac/xpc.md +51 -0
- package/docs/platforms/macos-vm.md +275 -0
- package/docs/platforms/macos.md +195 -0
- package/docs/platforms/oracle.md +291 -0
- package/docs/platforms/raspberry-pi.md +354 -0
- package/docs/platforms/windows.md +153 -0
- package/docs/plugin.md +638 -0
- package/docs/plugins/agent-tools.md +96 -0
- package/docs/plugins/manifest.md +67 -0
- package/docs/plugins/voice-call.md +238 -0
- package/docs/plugins/zalouser.md +75 -0
- package/docs/prose.md +131 -0
- package/docs/providers/anthropic.md +126 -0
- package/docs/providers/claude-max-api-proxy.md +145 -0
- package/docs/providers/deepgram.md +89 -0
- package/docs/providers/github-copilot.md +70 -0
- package/docs/providers/glm.md +31 -0
- package/docs/providers/index.md +59 -0
- package/docs/providers/minimax.md +183 -0
- package/docs/providers/models.md +48 -0
- package/docs/providers/moonshot.md +151 -0
- package/docs/providers/ollama.md +219 -0
- package/docs/providers/openai.md +60 -0
- package/docs/providers/opencode.md +34 -0
- package/docs/providers/openrouter.md +35 -0
- package/docs/providers/qwen.md +51 -0
- package/docs/providers/synthetic.md +97 -0
- package/docs/providers/venice.md +264 -0
- package/docs/providers/vercel-ai-gateway.md +50 -0
- package/docs/providers/zai.md +34 -0
- package/docs/railway.mdx +96 -0
- package/docs/refactor/clawnet.md +360 -0
- package/docs/refactor/exec-host.md +265 -0
- package/docs/refactor/outbound-session-mirroring.md +75 -0
- package/docs/refactor/plugin-sdk.md +187 -0
- package/docs/refactor/strict-config.md +81 -0
- package/docs/reference/AGENTS.default.md +113 -0
- package/docs/reference/RELEASING.md +107 -0
- package/docs/reference/api-usage-costs.md +116 -0
- package/docs/reference/device-models.md +46 -0
- package/docs/reference/rpc.md +35 -0
- package/docs/reference/session-management-compaction.md +273 -0
- package/docs/reference/templates/AGENTS.dev.md +78 -0
- package/docs/reference/templates/AGENTS.md +196 -0
- package/docs/reference/templates/BOOT.md +9 -0
- package/docs/reference/templates/BOOTSTRAP.md +55 -0
- package/docs/reference/templates/HEARTBEAT.md +9 -0
- package/docs/reference/templates/IDENTITY.dev.md +40 -0
- package/docs/reference/templates/IDENTITY.md +27 -0
- package/docs/reference/templates/SOUL.dev.md +74 -0
- package/docs/reference/templates/SOUL.md +41 -0
- package/docs/reference/templates/TOOLS.dev.md +21 -0
- package/docs/reference/templates/TOOLS.md +41 -0
- package/docs/reference/templates/USER.dev.md +17 -0
- package/docs/reference/templates/USER.md +22 -0
- package/docs/reference/test.md +46 -0
- package/docs/reference/transcript-hygiene.md +95 -0
- package/docs/render.mdx +158 -0
- package/docs/scripts.md +31 -0
- package/docs/start/clawd.md +235 -0
- package/docs/start/getting-started.md +203 -0
- package/docs/start/hubs.md +182 -0
- package/docs/start/lore.md +133 -0
- package/docs/start/onboarding.md +103 -0
- package/docs/start/pairing.md +83 -0
- package/docs/start/setup.md +143 -0
- package/docs/start/showcase.md +416 -0
- package/docs/start/wizard.md +318 -0
- package/docs/testing.md +349 -0
- package/docs/token-use.md +110 -0
- package/docs/tools/agent-send.md +51 -0
- package/docs/tools/apply-patch.md +49 -0
- package/docs/tools/browser-linux-troubleshooting.md +129 -0
- package/docs/tools/browser-login.md +67 -0
- package/docs/tools/browser.md +642 -0
- package/docs/tools/chrome-extension.md +185 -0
- package/docs/tools/clawdhub.md +201 -0
- package/docs/tools/creating-skills.md +41 -0
- package/docs/tools/elevated.md +48 -0
- package/docs/tools/exec-approvals.md +223 -0
- package/docs/tools/exec.md +156 -0
- package/docs/tools/firecrawl.md +58 -0
- package/docs/tools/index.md +447 -0
- package/docs/tools/llm-task.md +114 -0
- package/docs/tools/lobster.md +326 -0
- package/docs/tools/reactions.md +20 -0
- package/docs/tools/skills-config.md +75 -0
- package/docs/tools/skills.md +267 -0
- package/docs/tools/slash-commands.md +188 -0
- package/docs/tools/subagents.md +137 -0
- package/docs/tools/thinking.md +62 -0
- package/docs/tools/web.md +257 -0
- package/docs/tts.md +389 -0
- package/docs/tui.md +134 -0
- package/docs/vps.md +39 -0
- package/docs/web/control-ui.md +163 -0
- package/docs/web/dashboard.md +42 -0
- package/docs/web/index.md +110 -0
- package/docs/web/webchat.md +41 -0
- package/docs/whatsapp-clawd.jpg +0 -0
- package/extensions/bluebubbles/clawdbot.plugin.json +11 -0
- package/extensions/bluebubbles/index.ts +20 -0
- package/extensions/bluebubbles/package.json +33 -0
- package/extensions/bluebubbles/src/accounts.ts +80 -0
- package/extensions/bluebubbles/src/actions.test.ts +651 -0
- package/extensions/bluebubbles/src/actions.ts +403 -0
- package/extensions/bluebubbles/src/attachments.test.ts +346 -0
- package/extensions/bluebubbles/src/attachments.ts +282 -0
- package/extensions/bluebubbles/src/channel.ts +399 -0
- package/extensions/bluebubbles/src/chat.test.ts +462 -0
- package/extensions/bluebubbles/src/chat.ts +354 -0
- package/extensions/bluebubbles/src/config-schema.ts +51 -0
- package/extensions/bluebubbles/src/media-send.ts +168 -0
- package/extensions/bluebubbles/src/monitor.test.ts +2140 -0
- package/extensions/bluebubbles/src/monitor.ts +2101 -0
- package/extensions/bluebubbles/src/onboarding.ts +340 -0
- package/extensions/bluebubbles/src/probe.ts +127 -0
- package/extensions/bluebubbles/src/reactions.test.ts +393 -0
- package/extensions/bluebubbles/src/reactions.ts +183 -0
- package/extensions/bluebubbles/src/runtime.ts +14 -0
- package/extensions/bluebubbles/src/send.test.ts +809 -0
- package/extensions/bluebubbles/src/send.ts +418 -0
- package/extensions/bluebubbles/src/targets.test.ts +184 -0
- package/extensions/bluebubbles/src/targets.ts +323 -0
- package/extensions/bluebubbles/src/types.ts +127 -0
- package/extensions/copilot-proxy/README.md +24 -0
- package/extensions/copilot-proxy/clawdbot.plugin.json +11 -0
- package/extensions/copilot-proxy/index.ts +142 -0
- package/extensions/copilot-proxy/package.json +11 -0
- package/extensions/diagnostics-otel/clawdbot.plugin.json +8 -0
- package/extensions/diagnostics-otel/index.ts +16 -0
- package/extensions/diagnostics-otel/package.json +24 -0
- package/extensions/diagnostics-otel/src/service.test.ts +220 -0
- package/extensions/diagnostics-otel/src/service.ts +566 -0
- package/extensions/discord/clawdbot.plugin.json +11 -0
- package/extensions/discord/index.ts +18 -0
- package/extensions/discord/package.json +11 -0
- package/extensions/discord/src/channel.ts +422 -0
- package/extensions/discord/src/runtime.ts +14 -0
- package/extensions/google-antigravity-auth/README.md +24 -0
- package/extensions/google-antigravity-auth/clawdbot.plugin.json +11 -0
- package/extensions/google-antigravity-auth/index.ts +437 -0
- package/extensions/google-antigravity-auth/package.json +11 -0
- package/extensions/google-gemini-cli-auth/README.md +35 -0
- package/extensions/google-gemini-cli-auth/clawdbot.plugin.json +11 -0
- package/extensions/google-gemini-cli-auth/index.ts +91 -0
- package/extensions/google-gemini-cli-auth/oauth.test.ts +228 -0
- package/extensions/google-gemini-cli-auth/oauth.ts +580 -0
- package/extensions/google-gemini-cli-auth/package.json +11 -0
- package/extensions/googlechat/clawdbot.plugin.json +11 -0
- package/extensions/googlechat/index.ts +20 -0
- package/extensions/googlechat/package.json +39 -0
- package/extensions/googlechat/src/accounts.ts +133 -0
- package/extensions/googlechat/src/actions.ts +162 -0
- package/extensions/googlechat/src/api.test.ts +62 -0
- package/extensions/googlechat/src/api.ts +259 -0
- package/extensions/googlechat/src/auth.ts +113 -0
- package/extensions/googlechat/src/channel.ts +580 -0
- package/extensions/googlechat/src/monitor.test.ts +27 -0
- package/extensions/googlechat/src/monitor.ts +900 -0
- package/extensions/googlechat/src/onboarding.ts +278 -0
- package/extensions/googlechat/src/runtime.ts +14 -0
- package/extensions/googlechat/src/targets.test.ts +35 -0
- package/extensions/googlechat/src/targets.ts +55 -0
- package/extensions/googlechat/src/types.config.ts +3 -0
- package/extensions/googlechat/src/types.ts +73 -0
- package/extensions/imessage/clawdbot.plugin.json +11 -0
- package/extensions/imessage/index.ts +18 -0
- package/extensions/imessage/package.json +11 -0
- package/extensions/imessage/src/channel.ts +294 -0
- package/extensions/imessage/src/runtime.ts +14 -0
- package/extensions/line/clawdbot.plugin.json +11 -0
- package/extensions/line/index.ts +20 -0
- package/extensions/line/package.json +29 -0
- package/extensions/line/src/card-command.ts +338 -0
- package/extensions/line/src/channel.logout.test.ts +96 -0
- package/extensions/line/src/channel.sendPayload.test.ts +308 -0
- package/extensions/line/src/channel.ts +773 -0
- package/extensions/line/src/runtime.ts +14 -0
- package/extensions/llm-task/README.md +97 -0
- package/extensions/llm-task/clawdbot.plugin.json +21 -0
- package/extensions/llm-task/index.ts +7 -0
- package/extensions/llm-task/package.json +11 -0
- package/extensions/llm-task/src/llm-task-tool.test.ts +117 -0
- package/extensions/llm-task/src/llm-task-tool.ts +218 -0
- package/extensions/lobster/README.md +80 -0
- package/extensions/lobster/SKILL.md +90 -0
- package/extensions/lobster/clawdbot.plugin.json +10 -0
- package/extensions/lobster/index.ts +13 -0
- package/extensions/lobster/package.json +11 -0
- package/extensions/lobster/src/lobster-tool.test.ts +123 -0
- package/extensions/lobster/src/lobster-tool.ts +222 -0
- package/extensions/matrix/CHANGELOG.md +54 -0
- package/extensions/matrix/clawdbot.plugin.json +11 -0
- package/extensions/matrix/index.ts +18 -0
- package/extensions/matrix/package.json +36 -0
- package/extensions/matrix/src/actions.ts +185 -0
- package/extensions/matrix/src/channel.directory.test.ts +56 -0
- package/extensions/matrix/src/channel.ts +417 -0
- package/extensions/matrix/src/config-schema.ts +62 -0
- package/extensions/matrix/src/directory-live.ts +175 -0
- package/extensions/matrix/src/group-mentions.ts +61 -0
- package/extensions/matrix/src/matrix/accounts.test.ts +83 -0
- package/extensions/matrix/src/matrix/accounts.ts +63 -0
- package/extensions/matrix/src/matrix/actions/client.ts +53 -0
- package/extensions/matrix/src/matrix/actions/messages.ts +120 -0
- package/extensions/matrix/src/matrix/actions/pins.ts +70 -0
- package/extensions/matrix/src/matrix/actions/reactions.ts +84 -0
- package/extensions/matrix/src/matrix/actions/room.ts +88 -0
- package/extensions/matrix/src/matrix/actions/summary.ts +77 -0
- package/extensions/matrix/src/matrix/actions/types.ts +84 -0
- package/extensions/matrix/src/matrix/actions.ts +15 -0
- package/extensions/matrix/src/matrix/active-client.ts +11 -0
- package/extensions/matrix/src/matrix/client/config.ts +165 -0
- package/extensions/matrix/src/matrix/client/create-client.ts +127 -0
- package/extensions/matrix/src/matrix/client/logging.ts +35 -0
- package/extensions/matrix/src/matrix/client/runtime.ts +4 -0
- package/extensions/matrix/src/matrix/client/shared.ts +169 -0
- package/extensions/matrix/src/matrix/client/storage.ts +131 -0
- package/extensions/matrix/src/matrix/client/types.ts +34 -0
- package/extensions/matrix/src/matrix/client.test.ts +57 -0
- package/extensions/matrix/src/matrix/client.ts +9 -0
- package/extensions/matrix/src/matrix/credentials.ts +103 -0
- package/extensions/matrix/src/matrix/deps.ts +57 -0
- package/extensions/matrix/src/matrix/format.test.ts +34 -0
- package/extensions/matrix/src/matrix/format.ts +22 -0
- package/extensions/matrix/src/matrix/index.ts +11 -0
- package/extensions/matrix/src/matrix/monitor/allowlist.ts +58 -0
- package/extensions/matrix/src/matrix/monitor/auto-join.ts +68 -0
- package/extensions/matrix/src/matrix/monitor/direct.ts +105 -0
- package/extensions/matrix/src/matrix/monitor/events.ts +103 -0
- package/extensions/matrix/src/matrix/monitor/handler.ts +645 -0
- package/extensions/matrix/src/matrix/monitor/index.ts +279 -0
- package/extensions/matrix/src/matrix/monitor/location.ts +83 -0
- package/extensions/matrix/src/matrix/monitor/media.test.ts +103 -0
- package/extensions/matrix/src/matrix/monitor/media.ts +113 -0
- package/extensions/matrix/src/matrix/monitor/mentions.ts +31 -0
- package/extensions/matrix/src/matrix/monitor/replies.ts +96 -0
- package/extensions/matrix/src/matrix/monitor/room-info.ts +58 -0
- package/extensions/matrix/src/matrix/monitor/rooms.ts +43 -0
- package/extensions/matrix/src/matrix/monitor/threads.ts +64 -0
- package/extensions/matrix/src/matrix/monitor/types.ts +39 -0
- package/extensions/matrix/src/matrix/poll-types.test.ts +22 -0
- package/extensions/matrix/src/matrix/poll-types.ts +157 -0
- package/extensions/matrix/src/matrix/probe.ts +70 -0
- package/extensions/matrix/src/matrix/send/client.ts +63 -0
- package/extensions/matrix/src/matrix/send/formatting.ts +92 -0
- package/extensions/matrix/src/matrix/send/media.ts +220 -0
- package/extensions/matrix/src/matrix/send/targets.test.ts +102 -0
- package/extensions/matrix/src/matrix/send/targets.ts +144 -0
- package/extensions/matrix/src/matrix/send/types.ts +109 -0
- package/extensions/matrix/src/matrix/send.test.ts +172 -0
- package/extensions/matrix/src/matrix/send.ts +255 -0
- package/extensions/matrix/src/onboarding.ts +432 -0
- package/extensions/matrix/src/outbound.ts +53 -0
- package/extensions/matrix/src/resolve-targets.ts +89 -0
- package/extensions/matrix/src/runtime.ts +14 -0
- package/extensions/matrix/src/tool-actions.ts +160 -0
- package/extensions/matrix/src/types.ts +95 -0
- package/extensions/mattermost/clawdbot.plugin.json +11 -0
- package/extensions/mattermost/index.ts +18 -0
- package/extensions/mattermost/package.json +25 -0
- package/extensions/mattermost/src/channel.test.ts +43 -0
- package/extensions/mattermost/src/channel.ts +339 -0
- package/extensions/mattermost/src/config-schema.ts +56 -0
- package/extensions/mattermost/src/group-mentions.ts +14 -0
- package/extensions/mattermost/src/mattermost/accounts.ts +115 -0
- package/extensions/mattermost/src/mattermost/client.ts +208 -0
- package/extensions/mattermost/src/mattermost/index.ts +9 -0
- package/extensions/mattermost/src/mattermost/monitor-helpers.ts +150 -0
- package/extensions/mattermost/src/mattermost/monitor.ts +921 -0
- package/extensions/mattermost/src/mattermost/probe.ts +70 -0
- package/extensions/mattermost/src/mattermost/send.ts +217 -0
- package/extensions/mattermost/src/normalize.ts +38 -0
- package/extensions/mattermost/src/onboarding-helpers.ts +42 -0
- package/extensions/mattermost/src/onboarding.ts +187 -0
- package/extensions/mattermost/src/runtime.ts +14 -0
- package/extensions/mattermost/src/types.ts +50 -0
- package/extensions/memory-core/clawdbot.plugin.json +9 -0
- package/extensions/memory-core/index.ts +36 -0
- package/extensions/memory-core/package.json +14 -0
- package/extensions/memory-lancedb/clawdbot.plugin.json +67 -0
- package/extensions/memory-lancedb/config.ts +114 -0
- package/extensions/memory-lancedb/index.test.ts +284 -0
- package/extensions/memory-lancedb/index.ts +590 -0
- package/extensions/memory-lancedb/package.json +16 -0
- package/extensions/msteams/CHANGELOG.md +51 -0
- package/extensions/msteams/clawdbot.plugin.json +11 -0
- package/extensions/msteams/index.ts +18 -0
- package/extensions/msteams/package.json +36 -0
- package/extensions/msteams/src/attachments/download.ts +206 -0
- package/extensions/msteams/src/attachments/graph.ts +319 -0
- package/extensions/msteams/src/attachments/html.ts +76 -0
- package/extensions/msteams/src/attachments/payload.ts +22 -0
- package/extensions/msteams/src/attachments/shared.ts +235 -0
- package/extensions/msteams/src/attachments/types.ts +37 -0
- package/extensions/msteams/src/attachments.test.ts +424 -0
- package/extensions/msteams/src/attachments.ts +18 -0
- package/extensions/msteams/src/channel.directory.test.ts +46 -0
- package/extensions/msteams/src/channel.ts +436 -0
- package/extensions/msteams/src/conversation-store-fs.test.ts +88 -0
- package/extensions/msteams/src/conversation-store-fs.ts +155 -0
- package/extensions/msteams/src/conversation-store-memory.ts +45 -0
- package/extensions/msteams/src/conversation-store.ts +41 -0
- package/extensions/msteams/src/directory-live.ts +179 -0
- package/extensions/msteams/src/errors.test.ts +46 -0
- package/extensions/msteams/src/errors.ts +158 -0
- package/extensions/msteams/src/file-consent-helpers.test.ts +234 -0
- package/extensions/msteams/src/file-consent-helpers.ts +73 -0
- package/extensions/msteams/src/file-consent.ts +122 -0
- package/extensions/msteams/src/graph-chat.ts +52 -0
- package/extensions/msteams/src/graph-upload.ts +445 -0
- package/extensions/msteams/src/inbound.test.ts +67 -0
- package/extensions/msteams/src/inbound.ts +38 -0
- package/extensions/msteams/src/index.ts +4 -0
- package/extensions/msteams/src/media-helpers.test.ts +186 -0
- package/extensions/msteams/src/media-helpers.ts +77 -0
- package/extensions/msteams/src/messenger.test.ts +245 -0
- package/extensions/msteams/src/messenger.ts +460 -0
- package/extensions/msteams/src/monitor-handler/inbound-media.ts +123 -0
- package/extensions/msteams/src/monitor-handler/message-handler.ts +629 -0
- package/extensions/msteams/src/monitor-handler.ts +166 -0
- package/extensions/msteams/src/monitor-types.ts +5 -0
- package/extensions/msteams/src/monitor.ts +290 -0
- package/extensions/msteams/src/onboarding.ts +432 -0
- package/extensions/msteams/src/outbound.ts +47 -0
- package/extensions/msteams/src/pending-uploads.ts +87 -0
- package/extensions/msteams/src/policy.test.ts +210 -0
- package/extensions/msteams/src/policy.ts +202 -0
- package/extensions/msteams/src/polls-store-memory.ts +30 -0
- package/extensions/msteams/src/polls-store.test.ts +40 -0
- package/extensions/msteams/src/polls.test.ts +72 -0
- package/extensions/msteams/src/polls.ts +299 -0
- package/extensions/msteams/src/probe.test.ts +57 -0
- package/extensions/msteams/src/probe.ts +99 -0
- package/extensions/msteams/src/reply-dispatcher.ts +128 -0
- package/extensions/msteams/src/resolve-allowlist.ts +277 -0
- package/extensions/msteams/src/runtime.ts +14 -0
- package/extensions/msteams/src/sdk-types.ts +19 -0
- package/extensions/msteams/src/sdk.ts +33 -0
- package/extensions/msteams/src/send-context.ts +156 -0
- package/extensions/msteams/src/send.ts +489 -0
- package/extensions/msteams/src/sent-message-cache.test.ts +16 -0
- package/extensions/msteams/src/sent-message-cache.ts +41 -0
- package/extensions/msteams/src/storage.ts +22 -0
- package/extensions/msteams/src/store-fs.ts +80 -0
- package/extensions/msteams/src/token.ts +19 -0
- package/extensions/nextcloud-talk/clawdbot.plugin.json +11 -0
- package/extensions/nextcloud-talk/index.ts +18 -0
- package/extensions/nextcloud-talk/package.json +30 -0
- package/extensions/nextcloud-talk/src/accounts.ts +154 -0
- package/extensions/nextcloud-talk/src/channel.ts +404 -0
- package/extensions/nextcloud-talk/src/config-schema.ts +78 -0
- package/extensions/nextcloud-talk/src/format.ts +79 -0
- package/extensions/nextcloud-talk/src/inbound.ts +336 -0
- package/extensions/nextcloud-talk/src/monitor.ts +246 -0
- package/extensions/nextcloud-talk/src/normalize.ts +31 -0
- package/extensions/nextcloud-talk/src/onboarding.ts +341 -0
- package/extensions/nextcloud-talk/src/policy.ts +175 -0
- package/extensions/nextcloud-talk/src/room-info.ts +111 -0
- package/extensions/nextcloud-talk/src/runtime.ts +14 -0
- package/extensions/nextcloud-talk/src/send.ts +206 -0
- package/extensions/nextcloud-talk/src/signature.ts +67 -0
- package/extensions/nextcloud-talk/src/types.ts +179 -0
- package/extensions/nostr/CHANGELOG.md +46 -0
- package/extensions/nostr/README.md +136 -0
- package/extensions/nostr/clawdbot.plugin.json +11 -0
- package/extensions/nostr/index.ts +69 -0
- package/extensions/nostr/package.json +31 -0
- package/extensions/nostr/src/channel.test.ts +141 -0
- package/extensions/nostr/src/channel.ts +342 -0
- package/extensions/nostr/src/config-schema.ts +90 -0
- package/extensions/nostr/src/metrics.ts +464 -0
- package/extensions/nostr/src/nostr-bus.fuzz.test.ts +544 -0
- package/extensions/nostr/src/nostr-bus.integration.test.ts +452 -0
- package/extensions/nostr/src/nostr-bus.test.ts +199 -0
- package/extensions/nostr/src/nostr-bus.ts +741 -0
- package/extensions/nostr/src/nostr-profile-http.test.ts +378 -0
- package/extensions/nostr/src/nostr-profile-http.ts +500 -0
- package/extensions/nostr/src/nostr-profile-import.test.ts +120 -0
- package/extensions/nostr/src/nostr-profile-import.ts +259 -0
- package/extensions/nostr/src/nostr-profile.fuzz.test.ts +479 -0
- package/extensions/nostr/src/nostr-profile.test.ts +410 -0
- package/extensions/nostr/src/nostr-profile.ts +242 -0
- package/extensions/nostr/src/nostr-state-store.test.ts +128 -0
- package/extensions/nostr/src/nostr-state-store.ts +226 -0
- package/extensions/nostr/src/runtime.ts +14 -0
- package/extensions/nostr/src/seen-tracker.ts +271 -0
- package/extensions/nostr/src/types.test.ts +161 -0
- package/extensions/nostr/src/types.ts +99 -0
- package/extensions/nostr/test/setup.ts +5 -0
- package/extensions/open-prose/README.md +25 -0
- package/extensions/open-prose/clawdbot.plugin.json +11 -0
- package/extensions/open-prose/index.ts +5 -0
- package/extensions/open-prose/package.json +11 -0
- package/extensions/open-prose/skills/prose/LICENSE +21 -0
- package/extensions/open-prose/skills/prose/SKILL.md +318 -0
- package/extensions/open-prose/skills/prose/alt-borges.md +141 -0
- package/extensions/open-prose/skills/prose/alts/arabian-nights.md +358 -0
- package/extensions/open-prose/skills/prose/alts/borges.md +360 -0
- package/extensions/open-prose/skills/prose/alts/folk.md +322 -0
- package/extensions/open-prose/skills/prose/alts/homer.md +346 -0
- package/extensions/open-prose/skills/prose/alts/kafka.md +373 -0
- package/extensions/open-prose/skills/prose/compiler.md +2967 -0
- package/extensions/open-prose/skills/prose/examples/01-hello-world.prose +4 -0
- package/extensions/open-prose/skills/prose/examples/02-research-and-summarize.prose +6 -0
- package/extensions/open-prose/skills/prose/examples/03-code-review.prose +17 -0
- package/extensions/open-prose/skills/prose/examples/04-write-and-refine.prose +14 -0
- package/extensions/open-prose/skills/prose/examples/05-debug-issue.prose +20 -0
- package/extensions/open-prose/skills/prose/examples/06-explain-codebase.prose +17 -0
- package/extensions/open-prose/skills/prose/examples/07-refactor.prose +20 -0
- package/extensions/open-prose/skills/prose/examples/08-blog-post.prose +20 -0
- package/extensions/open-prose/skills/prose/examples/09-research-with-agents.prose +25 -0
- package/extensions/open-prose/skills/prose/examples/10-code-review-agents.prose +32 -0
- package/extensions/open-prose/skills/prose/examples/11-skills-and-imports.prose +27 -0
- package/extensions/open-prose/skills/prose/examples/12-secure-agent-permissions.prose +43 -0
- package/extensions/open-prose/skills/prose/examples/13-variables-and-context.prose +51 -0
- package/extensions/open-prose/skills/prose/examples/14-composition-blocks.prose +48 -0
- package/extensions/open-prose/skills/prose/examples/15-inline-sequences.prose +23 -0
- package/extensions/open-prose/skills/prose/examples/16-parallel-reviews.prose +19 -0
- package/extensions/open-prose/skills/prose/examples/17-parallel-research.prose +19 -0
- package/extensions/open-prose/skills/prose/examples/18-mixed-parallel-sequential.prose +36 -0
- package/extensions/open-prose/skills/prose/examples/19-advanced-parallel.prose +71 -0
- package/extensions/open-prose/skills/prose/examples/20-fixed-loops.prose +20 -0
- package/extensions/open-prose/skills/prose/examples/21-pipeline-operations.prose +35 -0
- package/extensions/open-prose/skills/prose/examples/22-error-handling.prose +51 -0
- package/extensions/open-prose/skills/prose/examples/23-retry-with-backoff.prose +63 -0
- package/extensions/open-prose/skills/prose/examples/24-choice-blocks.prose +86 -0
- package/extensions/open-prose/skills/prose/examples/25-conditionals.prose +114 -0
- package/extensions/open-prose/skills/prose/examples/26-parameterized-blocks.prose +100 -0
- package/extensions/open-prose/skills/prose/examples/27-string-interpolation.prose +105 -0
- package/extensions/open-prose/skills/prose/examples/28-automated-pr-review.prose +37 -0
- package/extensions/open-prose/skills/prose/examples/28-gas-town.prose +1572 -0
- package/extensions/open-prose/skills/prose/examples/29-captains-chair.prose +218 -0
- package/extensions/open-prose/skills/prose/examples/30-captains-chair-simple.prose +42 -0
- package/extensions/open-prose/skills/prose/examples/31-captains-chair-with-memory.prose +145 -0
- package/extensions/open-prose/skills/prose/examples/33-pr-review-autofix.prose +168 -0
- package/extensions/open-prose/skills/prose/examples/34-content-pipeline.prose +204 -0
- package/extensions/open-prose/skills/prose/examples/35-feature-factory.prose +296 -0
- package/extensions/open-prose/skills/prose/examples/36-bug-hunter.prose +237 -0
- package/extensions/open-prose/skills/prose/examples/37-the-forge.prose +1474 -0
- package/extensions/open-prose/skills/prose/examples/38-skill-scan.prose +455 -0
- package/extensions/open-prose/skills/prose/examples/39-architect-by-simulation.prose +277 -0
- package/extensions/open-prose/skills/prose/examples/40-rlm-self-refine.prose +32 -0
- package/extensions/open-prose/skills/prose/examples/41-rlm-divide-conquer.prose +38 -0
- package/extensions/open-prose/skills/prose/examples/42-rlm-filter-recurse.prose +46 -0
- package/extensions/open-prose/skills/prose/examples/43-rlm-pairwise.prose +50 -0
- package/extensions/open-prose/skills/prose/examples/44-run-endpoint-ux-test.prose +261 -0
- package/extensions/open-prose/skills/prose/examples/45-plugin-release.prose +159 -0
- package/extensions/open-prose/skills/prose/examples/45-run-endpoint-ux-test-with-remediation.prose +637 -0
- package/extensions/open-prose/skills/prose/examples/46-run-endpoint-ux-test-fast.prose +148 -0
- package/extensions/open-prose/skills/prose/examples/46-workflow-crystallizer.prose +225 -0
- package/extensions/open-prose/skills/prose/examples/47-language-self-improvement.prose +356 -0
- package/extensions/open-prose/skills/prose/examples/48-habit-miner.prose +445 -0
- package/extensions/open-prose/skills/prose/examples/49-prose-run-retrospective.prose +210 -0
- package/extensions/open-prose/skills/prose/examples/README.md +391 -0
- package/extensions/open-prose/skills/prose/examples/roadmap/README.md +22 -0
- package/extensions/open-prose/skills/prose/examples/roadmap/iterative-refinement.prose +20 -0
- package/extensions/open-prose/skills/prose/examples/roadmap/parallel-review.prose +18 -0
- package/extensions/open-prose/skills/prose/examples/roadmap/simple-pipeline.prose +17 -0
- package/extensions/open-prose/skills/prose/examples/roadmap/syntax/open-prose-syntax.prose +223 -0
- package/extensions/open-prose/skills/prose/guidance/antipatterns.md +951 -0
- package/extensions/open-prose/skills/prose/guidance/patterns.md +700 -0
- package/extensions/open-prose/skills/prose/guidance/system-prompt.md +180 -0
- package/extensions/open-prose/skills/prose/help.md +143 -0
- package/extensions/open-prose/skills/prose/lib/README.md +105 -0
- package/extensions/open-prose/skills/prose/lib/calibrator.prose +215 -0
- package/extensions/open-prose/skills/prose/lib/cost-analyzer.prose +174 -0
- package/extensions/open-prose/skills/prose/lib/error-forensics.prose +250 -0
- package/extensions/open-prose/skills/prose/lib/inspector.prose +196 -0
- package/extensions/open-prose/skills/prose/lib/profiler.prose +460 -0
- package/extensions/open-prose/skills/prose/lib/program-improver.prose +275 -0
- package/extensions/open-prose/skills/prose/lib/project-memory.prose +118 -0
- package/extensions/open-prose/skills/prose/lib/user-memory.prose +93 -0
- package/extensions/open-prose/skills/prose/lib/vm-improver.prose +243 -0
- package/extensions/open-prose/skills/prose/primitives/session.md +587 -0
- package/extensions/open-prose/skills/prose/prose.md +1235 -0
- package/extensions/open-prose/skills/prose/state/filesystem.md +478 -0
- package/extensions/open-prose/skills/prose/state/in-context.md +380 -0
- package/extensions/open-prose/skills/prose/state/postgres.md +875 -0
- package/extensions/open-prose/skills/prose/state/sqlite.md +572 -0
- package/extensions/qwen-portal-auth/README.md +24 -0
- package/extensions/qwen-portal-auth/clawdbot.plugin.json +11 -0
- package/extensions/qwen-portal-auth/index.ts +127 -0
- package/extensions/qwen-portal-auth/oauth.ts +190 -0
- package/extensions/signal/clawdbot.plugin.json +11 -0
- package/extensions/signal/index.ts +18 -0
- package/extensions/signal/package.json +11 -0
- package/extensions/signal/src/channel.ts +312 -0
- package/extensions/signal/src/runtime.ts +14 -0
- package/extensions/slack/clawdbot.plugin.json +11 -0
- package/extensions/slack/index.ts +18 -0
- package/extensions/slack/package.json +11 -0
- package/extensions/slack/src/channel.ts +577 -0
- package/extensions/slack/src/runtime.ts +14 -0
- package/extensions/telegram/clawdbot.plugin.json +11 -0
- package/extensions/telegram/index.ts +18 -0
- package/extensions/telegram/package.json +11 -0
- package/extensions/telegram/src/channel.ts +478 -0
- package/extensions/telegram/src/runtime.ts +14 -0
- package/extensions/tlon/README.md +5 -0
- package/extensions/tlon/clawdbot.plugin.json +11 -0
- package/extensions/tlon/index.ts +18 -0
- package/extensions/tlon/package.json +30 -0
- package/extensions/tlon/src/channel.ts +379 -0
- package/extensions/tlon/src/config-schema.test.ts +32 -0
- package/extensions/tlon/src/config-schema.ts +43 -0
- package/extensions/tlon/src/monitor/discovery.ts +71 -0
- package/extensions/tlon/src/monitor/history.ts +87 -0
- package/extensions/tlon/src/monitor/index.ts +501 -0
- package/extensions/tlon/src/monitor/processed-messages.test.ts +24 -0
- package/extensions/tlon/src/monitor/processed-messages.ts +38 -0
- package/extensions/tlon/src/monitor/utils.ts +83 -0
- package/extensions/tlon/src/onboarding.ts +213 -0
- package/extensions/tlon/src/runtime.ts +14 -0
- package/extensions/tlon/src/targets.ts +79 -0
- package/extensions/tlon/src/types.ts +85 -0
- package/extensions/tlon/src/urbit/auth.ts +18 -0
- package/extensions/tlon/src/urbit/http-api.ts +36 -0
- package/extensions/tlon/src/urbit/send.test.ts +38 -0
- package/extensions/tlon/src/urbit/send.ts +127 -0
- package/extensions/tlon/src/urbit/sse-client.test.ts +41 -0
- package/extensions/tlon/src/urbit/sse-client.ts +367 -0
- package/extensions/twitch/CHANGELOG.md +21 -0
- package/extensions/twitch/README.md +89 -0
- package/extensions/twitch/clawdbot.plugin.json +9 -0
- package/extensions/twitch/index.ts +20 -0
- package/extensions/twitch/package.json +20 -0
- package/extensions/twitch/src/access-control.test.ts +489 -0
- package/extensions/twitch/src/access-control.ts +154 -0
- package/extensions/twitch/src/actions.ts +173 -0
- package/extensions/twitch/src/client-manager-registry.ts +115 -0
- package/extensions/twitch/src/config-schema.ts +82 -0
- package/extensions/twitch/src/config.test.ts +88 -0
- package/extensions/twitch/src/config.ts +116 -0
- package/extensions/twitch/src/monitor.ts +257 -0
- package/extensions/twitch/src/onboarding.test.ts +311 -0
- package/extensions/twitch/src/onboarding.ts +411 -0
- package/extensions/twitch/src/outbound.test.ts +373 -0
- package/extensions/twitch/src/outbound.ts +186 -0
- package/extensions/twitch/src/plugin.test.ts +39 -0
- package/extensions/twitch/src/plugin.ts +274 -0
- package/extensions/twitch/src/probe.test.ts +198 -0
- package/extensions/twitch/src/probe.ts +118 -0
- package/extensions/twitch/src/resolver.ts +137 -0
- package/extensions/twitch/src/runtime.ts +14 -0
- package/extensions/twitch/src/send.test.ts +289 -0
- package/extensions/twitch/src/send.ts +136 -0
- package/extensions/twitch/src/status.test.ts +270 -0
- package/extensions/twitch/src/status.ts +176 -0
- package/extensions/twitch/src/token.test.ts +171 -0
- package/extensions/twitch/src/token.ts +87 -0
- package/extensions/twitch/src/twitch-client.test.ts +574 -0
- package/extensions/twitch/src/twitch-client.ts +277 -0
- package/extensions/twitch/src/types.ts +141 -0
- package/extensions/twitch/src/utils/markdown.ts +92 -0
- package/extensions/twitch/src/utils/twitch.ts +78 -0
- package/extensions/twitch/test/setup.ts +7 -0
- package/extensions/voice-call/CHANGELOG.md +72 -0
- package/extensions/voice-call/README.md +134 -0
- package/extensions/voice-call/clawdbot.plugin.json +601 -0
- package/extensions/voice-call/index.ts +497 -0
- package/extensions/voice-call/package.json +16 -0
- package/extensions/voice-call/src/cli.ts +300 -0
- package/extensions/voice-call/src/config.test.ts +204 -0
- package/extensions/voice-call/src/config.ts +493 -0
- package/extensions/voice-call/src/core-bridge.ts +196 -0
- package/extensions/voice-call/src/manager/context.ts +21 -0
- package/extensions/voice-call/src/manager/events.ts +177 -0
- package/extensions/voice-call/src/manager/lookup.ts +33 -0
- package/extensions/voice-call/src/manager/outbound.ts +248 -0
- package/extensions/voice-call/src/manager/state.ts +50 -0
- package/extensions/voice-call/src/manager/store.ts +88 -0
- package/extensions/voice-call/src/manager/timers.ts +86 -0
- package/extensions/voice-call/src/manager/twiml.ts +9 -0
- package/extensions/voice-call/src/manager.test.ts +108 -0
- package/extensions/voice-call/src/manager.ts +876 -0
- package/extensions/voice-call/src/media-stream.test.ts +97 -0
- package/extensions/voice-call/src/media-stream.ts +393 -0
- package/extensions/voice-call/src/providers/base.ts +67 -0
- package/extensions/voice-call/src/providers/index.ts +10 -0
- package/extensions/voice-call/src/providers/mock.ts +168 -0
- package/extensions/voice-call/src/providers/plivo.test.ts +28 -0
- package/extensions/voice-call/src/providers/plivo.ts +504 -0
- package/extensions/voice-call/src/providers/stt-openai-realtime.ts +311 -0
- package/extensions/voice-call/src/providers/telnyx.ts +364 -0
- package/extensions/voice-call/src/providers/tts-openai.ts +264 -0
- package/extensions/voice-call/src/providers/twilio/api.ts +45 -0
- package/extensions/voice-call/src/providers/twilio/webhook.ts +29 -0
- package/extensions/voice-call/src/providers/twilio.test.ts +64 -0
- package/extensions/voice-call/src/providers/twilio.ts +595 -0
- package/extensions/voice-call/src/response-generator.ts +171 -0
- package/extensions/voice-call/src/runtime.ts +205 -0
- package/extensions/voice-call/src/telephony-audio.ts +88 -0
- package/extensions/voice-call/src/telephony-tts.ts +95 -0
- package/extensions/voice-call/src/tunnel.ts +331 -0
- package/extensions/voice-call/src/types.ts +272 -0
- package/extensions/voice-call/src/utils.ts +12 -0
- package/extensions/voice-call/src/voice-mapping.ts +65 -0
- package/extensions/voice-call/src/webhook-security.test.ts +233 -0
- package/extensions/voice-call/src/webhook-security.ts +446 -0
- package/extensions/voice-call/src/webhook.ts +490 -0
- package/extensions/whatsapp/clawdbot.plugin.json +11 -0
- package/extensions/whatsapp/index.ts +18 -0
- package/extensions/whatsapp/package.json +11 -0
- package/extensions/whatsapp/src/channel.ts +500 -0
- package/extensions/whatsapp/src/runtime.ts +14 -0
- package/extensions/zalo/CHANGELOG.md +55 -0
- package/extensions/zalo/README.md +50 -0
- package/extensions/zalo/clawdbot.plugin.json +11 -0
- package/extensions/zalo/index.ts +20 -0
- package/extensions/zalo/package.json +33 -0
- package/extensions/zalo/src/accounts.ts +71 -0
- package/extensions/zalo/src/actions.ts +62 -0
- package/extensions/zalo/src/api.ts +206 -0
- package/extensions/zalo/src/channel.directory.test.ts +35 -0
- package/extensions/zalo/src/channel.ts +394 -0
- package/extensions/zalo/src/config-schema.ts +24 -0
- package/extensions/zalo/src/monitor.ts +760 -0
- package/extensions/zalo/src/monitor.webhook.test.ts +70 -0
- package/extensions/zalo/src/onboarding.ts +405 -0
- package/extensions/zalo/src/probe.ts +46 -0
- package/extensions/zalo/src/proxy.ts +18 -0
- package/extensions/zalo/src/runtime.ts +14 -0
- package/extensions/zalo/src/send.ts +117 -0
- package/extensions/zalo/src/status-issues.ts +50 -0
- package/extensions/zalo/src/token.ts +55 -0
- package/extensions/zalo/src/types.ts +42 -0
- package/extensions/zalouser/CHANGELOG.md +33 -0
- package/extensions/zalouser/README.md +221 -0
- package/extensions/zalouser/clawdbot.plugin.json +11 -0
- package/extensions/zalouser/index.ts +32 -0
- package/extensions/zalouser/package.json +33 -0
- package/extensions/zalouser/src/accounts.ts +117 -0
- package/extensions/zalouser/src/channel.test.ts +17 -0
- package/extensions/zalouser/src/channel.ts +641 -0
- package/extensions/zalouser/src/config-schema.ts +27 -0
- package/extensions/zalouser/src/monitor.ts +574 -0
- package/extensions/zalouser/src/onboarding.ts +488 -0
- package/extensions/zalouser/src/probe.ts +28 -0
- package/extensions/zalouser/src/runtime.ts +14 -0
- package/extensions/zalouser/src/send.ts +150 -0
- package/extensions/zalouser/src/status-issues.test.ts +58 -0
- package/extensions/zalouser/src/status-issues.ts +81 -0
- package/extensions/zalouser/src/tool.ts +156 -0
- package/extensions/zalouser/src/types.ts +102 -0
- package/extensions/zalouser/src/zca.ts +208 -0
- package/git-hooks/pre-commit +4 -0
- package/package.json +280 -0
- package/patches/.gitkeep +0 -0
- package/scripts/format-staged.js +148 -0
- package/scripts/postinstall.js +300 -0
- package/scripts/setup-git-hooks.js +96 -0
- package/skills/1password/SKILL.md +53 -0
- package/skills/1password/references/cli-examples.md +29 -0
- package/skills/1password/references/get-started.md +17 -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 +197 -0
- package/skills/blogwatcher/SKILL.md +46 -0
- package/skills/blucli/SKILL.md +27 -0
- package/skills/bluebubbles/SKILL.md +39 -0
- package/skills/camsnap/SKILL.md +25 -0
- package/skills/canvas/SKILL.md +189 -0
- package/skills/clawdhub/SKILL.md +53 -0
- package/skills/coding-agent/SKILL.md +278 -0
- package/skills/content-writer/SKILL.md +260 -0
- package/skills/discord/SKILL.md +475 -0
- package/skills/eightctl/SKILL.md +29 -0
- package/skills/food-order/SKILL.md +41 -0
- package/skills/ga4/SKILL.md +297 -0
- package/skills/gemini/SKILL.md +23 -0
- package/skills/gifgrep/SKILL.md +47 -0
- package/skills/github/SKILL.md +48 -0
- package/skills/gog/SKILL.md +92 -0
- package/skills/goplaces/SKILL.md +30 -0
- package/skills/himalaya/SKILL.md +217 -0
- package/skills/himalaya/references/configuration.md +174 -0
- package/skills/himalaya/references/message-composition.md +182 -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/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/marketing-reporter/SKILL.md +221 -0
- package/skills/mcporter/SKILL.md +38 -0
- package/skills/model-usage/SKILL.md +45 -0
- package/skills/model-usage/references/codexbar-cli.md +28 -0
- package/skills/model-usage/scripts/model_usage.py +310 -0
- package/skills/nano-banana-pro/SKILL.md +30 -0
- package/skills/nano-banana-pro/scripts/generate_image.py +169 -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 +71 -0
- package/skills/openai-image-gen/scripts/gen.py +240 -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/sag/SKILL.md +62 -0
- package/skills/search-console/SKILL.md +288 -0
- package/skills/session-logs/SKILL.md +105 -0
- package/skills/sherpa-onnx-tts/SKILL.md +49 -0
- package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
- package/skills/skill-creator/SKILL.md +371 -0
- package/skills/skill-creator/license.txt +202 -0
- package/skills/skill-creator/scripts/init_skill.py +378 -0
- package/skills/skill-creator/scripts/package_skill.py +111 -0
- package/skills/skill-creator/scripts/quick_validate.py +101 -0
- package/skills/slack/SKILL.md +144 -0
- package/skills/social-posting/SKILL.md +311 -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 +67 -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/voice-call/SKILL.md +35 -0
- package/skills/wacli/SKILL.md +42 -0
- package/skills/weather/SKILL.md +49 -0
|
@@ -0,0 +1,2140 @@
|
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
3
|
+
import { EventEmitter } from "node:events";
|
|
4
|
+
|
|
5
|
+
import { removeAckReactionAfterReply, shouldAckReaction } from "clawdbot/plugin-sdk";
|
|
6
|
+
import type { ClawdbotConfig, PluginRuntime } from "clawdbot/plugin-sdk";
|
|
7
|
+
import {
|
|
8
|
+
handleBlueBubblesWebhookRequest,
|
|
9
|
+
registerBlueBubblesWebhookTarget,
|
|
10
|
+
resolveBlueBubblesMessageId,
|
|
11
|
+
_resetBlueBubblesShortIdState,
|
|
12
|
+
} from "./monitor.js";
|
|
13
|
+
import { setBlueBubblesRuntime } from "./runtime.js";
|
|
14
|
+
import type { ResolvedBlueBubblesAccount } from "./accounts.js";
|
|
15
|
+
|
|
16
|
+
// Mock dependencies
|
|
17
|
+
vi.mock("./send.js", () => ({
|
|
18
|
+
resolveChatGuidForTarget: vi.fn().mockResolvedValue("iMessage;-;+15551234567"),
|
|
19
|
+
sendMessageBlueBubbles: vi.fn().mockResolvedValue({ messageId: "msg-123" }),
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
vi.mock("./chat.js", () => ({
|
|
23
|
+
markBlueBubblesChatRead: vi.fn().mockResolvedValue(undefined),
|
|
24
|
+
sendBlueBubblesTyping: vi.fn().mockResolvedValue(undefined),
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
vi.mock("./attachments.js", () => ({
|
|
28
|
+
downloadBlueBubblesAttachment: vi.fn().mockResolvedValue({
|
|
29
|
+
buffer: Buffer.from("test"),
|
|
30
|
+
contentType: "image/jpeg",
|
|
31
|
+
}),
|
|
32
|
+
}));
|
|
33
|
+
|
|
34
|
+
vi.mock("./reactions.js", async () => {
|
|
35
|
+
const actual = await vi.importActual<typeof import("./reactions.js")>("./reactions.js");
|
|
36
|
+
return {
|
|
37
|
+
...actual,
|
|
38
|
+
sendBlueBubblesReaction: vi.fn().mockResolvedValue(undefined),
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// Mock runtime
|
|
43
|
+
const mockEnqueueSystemEvent = vi.fn();
|
|
44
|
+
const mockBuildPairingReply = vi.fn(() => "Pairing code: TESTCODE");
|
|
45
|
+
const mockReadAllowFromStore = vi.fn().mockResolvedValue([]);
|
|
46
|
+
const mockUpsertPairingRequest = vi.fn().mockResolvedValue({ code: "TESTCODE", created: true });
|
|
47
|
+
const mockResolveAgentRoute = vi.fn(() => ({
|
|
48
|
+
agentId: "main",
|
|
49
|
+
accountId: "default",
|
|
50
|
+
sessionKey: "agent:main:bluebubbles:dm:+15551234567",
|
|
51
|
+
}));
|
|
52
|
+
const mockBuildMentionRegexes = vi.fn(() => [/\bbert\b/i]);
|
|
53
|
+
const mockMatchesMentionPatterns = vi.fn((text: string, regexes: RegExp[]) =>
|
|
54
|
+
regexes.some((r) => r.test(text)),
|
|
55
|
+
);
|
|
56
|
+
const mockResolveRequireMention = vi.fn(() => false);
|
|
57
|
+
const mockResolveGroupPolicy = vi.fn(() => "open");
|
|
58
|
+
const mockDispatchReplyWithBufferedBlockDispatcher = vi.fn(async () => undefined);
|
|
59
|
+
const mockHasControlCommand = vi.fn(() => false);
|
|
60
|
+
const mockResolveCommandAuthorizedFromAuthorizers = vi.fn(() => false);
|
|
61
|
+
const mockSaveMediaBuffer = vi.fn().mockResolvedValue({
|
|
62
|
+
path: "/tmp/test-media.jpg",
|
|
63
|
+
contentType: "image/jpeg",
|
|
64
|
+
});
|
|
65
|
+
const mockResolveStorePath = vi.fn(() => "/tmp/sessions.json");
|
|
66
|
+
const mockReadSessionUpdatedAt = vi.fn(() => undefined);
|
|
67
|
+
const mockResolveEnvelopeFormatOptions = vi.fn(() => ({
|
|
68
|
+
template: "channel+name+time",
|
|
69
|
+
}));
|
|
70
|
+
const mockFormatAgentEnvelope = vi.fn((opts: { body: string }) => opts.body);
|
|
71
|
+
const mockChunkMarkdownText = vi.fn((text: string) => [text]);
|
|
72
|
+
|
|
73
|
+
function createMockRuntime(): PluginRuntime {
|
|
74
|
+
return {
|
|
75
|
+
version: "1.0.0",
|
|
76
|
+
config: {
|
|
77
|
+
loadConfig: vi.fn(() => ({})) as unknown as PluginRuntime["config"]["loadConfig"],
|
|
78
|
+
writeConfigFile: vi.fn() as unknown as PluginRuntime["config"]["writeConfigFile"],
|
|
79
|
+
},
|
|
80
|
+
system: {
|
|
81
|
+
enqueueSystemEvent: mockEnqueueSystemEvent as unknown as PluginRuntime["system"]["enqueueSystemEvent"],
|
|
82
|
+
runCommandWithTimeout: vi.fn() as unknown as PluginRuntime["system"]["runCommandWithTimeout"],
|
|
83
|
+
},
|
|
84
|
+
media: {
|
|
85
|
+
loadWebMedia: vi.fn() as unknown as PluginRuntime["media"]["loadWebMedia"],
|
|
86
|
+
detectMime: vi.fn() as unknown as PluginRuntime["media"]["detectMime"],
|
|
87
|
+
mediaKindFromMime: vi.fn() as unknown as PluginRuntime["media"]["mediaKindFromMime"],
|
|
88
|
+
isVoiceCompatibleAudio: vi.fn() as unknown as PluginRuntime["media"]["isVoiceCompatibleAudio"],
|
|
89
|
+
getImageMetadata: vi.fn() as unknown as PluginRuntime["media"]["getImageMetadata"],
|
|
90
|
+
resizeToJpeg: vi.fn() as unknown as PluginRuntime["media"]["resizeToJpeg"],
|
|
91
|
+
},
|
|
92
|
+
tools: {
|
|
93
|
+
createMemoryGetTool: vi.fn() as unknown as PluginRuntime["tools"]["createMemoryGetTool"],
|
|
94
|
+
createMemorySearchTool: vi.fn() as unknown as PluginRuntime["tools"]["createMemorySearchTool"],
|
|
95
|
+
registerMemoryCli: vi.fn() as unknown as PluginRuntime["tools"]["registerMemoryCli"],
|
|
96
|
+
},
|
|
97
|
+
channel: {
|
|
98
|
+
text: {
|
|
99
|
+
chunkMarkdownText: mockChunkMarkdownText as unknown as PluginRuntime["channel"]["text"]["chunkMarkdownText"],
|
|
100
|
+
chunkText: vi.fn() as unknown as PluginRuntime["channel"]["text"]["chunkText"],
|
|
101
|
+
resolveTextChunkLimit: vi.fn(() => 4000) as unknown as PluginRuntime["channel"]["text"]["resolveTextChunkLimit"],
|
|
102
|
+
hasControlCommand: mockHasControlCommand as unknown as PluginRuntime["channel"]["text"]["hasControlCommand"],
|
|
103
|
+
resolveMarkdownTableMode: vi.fn(() => "code") as unknown as PluginRuntime["channel"]["text"]["resolveMarkdownTableMode"],
|
|
104
|
+
convertMarkdownTables: vi.fn((text: string) => text) as unknown as PluginRuntime["channel"]["text"]["convertMarkdownTables"],
|
|
105
|
+
},
|
|
106
|
+
reply: {
|
|
107
|
+
dispatchReplyWithBufferedBlockDispatcher: mockDispatchReplyWithBufferedBlockDispatcher as unknown as PluginRuntime["channel"]["reply"]["dispatchReplyWithBufferedBlockDispatcher"],
|
|
108
|
+
createReplyDispatcherWithTyping: vi.fn() as unknown as PluginRuntime["channel"]["reply"]["createReplyDispatcherWithTyping"],
|
|
109
|
+
resolveEffectiveMessagesConfig: vi.fn() as unknown as PluginRuntime["channel"]["reply"]["resolveEffectiveMessagesConfig"],
|
|
110
|
+
resolveHumanDelayConfig: vi.fn() as unknown as PluginRuntime["channel"]["reply"]["resolveHumanDelayConfig"],
|
|
111
|
+
dispatchReplyFromConfig: vi.fn() as unknown as PluginRuntime["channel"]["reply"]["dispatchReplyFromConfig"],
|
|
112
|
+
finalizeInboundContext: vi.fn() as unknown as PluginRuntime["channel"]["reply"]["finalizeInboundContext"],
|
|
113
|
+
formatAgentEnvelope: mockFormatAgentEnvelope as unknown as PluginRuntime["channel"]["reply"]["formatAgentEnvelope"],
|
|
114
|
+
formatInboundEnvelope: vi.fn() as unknown as PluginRuntime["channel"]["reply"]["formatInboundEnvelope"],
|
|
115
|
+
resolveEnvelopeFormatOptions: mockResolveEnvelopeFormatOptions as unknown as PluginRuntime["channel"]["reply"]["resolveEnvelopeFormatOptions"],
|
|
116
|
+
},
|
|
117
|
+
routing: {
|
|
118
|
+
resolveAgentRoute: mockResolveAgentRoute as unknown as PluginRuntime["channel"]["routing"]["resolveAgentRoute"],
|
|
119
|
+
},
|
|
120
|
+
pairing: {
|
|
121
|
+
buildPairingReply: mockBuildPairingReply as unknown as PluginRuntime["channel"]["pairing"]["buildPairingReply"],
|
|
122
|
+
readAllowFromStore: mockReadAllowFromStore as unknown as PluginRuntime["channel"]["pairing"]["readAllowFromStore"],
|
|
123
|
+
upsertPairingRequest: mockUpsertPairingRequest as unknown as PluginRuntime["channel"]["pairing"]["upsertPairingRequest"],
|
|
124
|
+
},
|
|
125
|
+
media: {
|
|
126
|
+
fetchRemoteMedia: vi.fn() as unknown as PluginRuntime["channel"]["media"]["fetchRemoteMedia"],
|
|
127
|
+
saveMediaBuffer: mockSaveMediaBuffer as unknown as PluginRuntime["channel"]["media"]["saveMediaBuffer"],
|
|
128
|
+
},
|
|
129
|
+
session: {
|
|
130
|
+
resolveStorePath: mockResolveStorePath as unknown as PluginRuntime["channel"]["session"]["resolveStorePath"],
|
|
131
|
+
readSessionUpdatedAt: mockReadSessionUpdatedAt as unknown as PluginRuntime["channel"]["session"]["readSessionUpdatedAt"],
|
|
132
|
+
recordInboundSession: vi.fn() as unknown as PluginRuntime["channel"]["session"]["recordInboundSession"],
|
|
133
|
+
recordSessionMetaFromInbound: vi.fn() as unknown as PluginRuntime["channel"]["session"]["recordSessionMetaFromInbound"],
|
|
134
|
+
updateLastRoute: vi.fn() as unknown as PluginRuntime["channel"]["session"]["updateLastRoute"],
|
|
135
|
+
},
|
|
136
|
+
mentions: {
|
|
137
|
+
buildMentionRegexes: mockBuildMentionRegexes as unknown as PluginRuntime["channel"]["mentions"]["buildMentionRegexes"],
|
|
138
|
+
matchesMentionPatterns: mockMatchesMentionPatterns as unknown as PluginRuntime["channel"]["mentions"]["matchesMentionPatterns"],
|
|
139
|
+
},
|
|
140
|
+
reactions: {
|
|
141
|
+
shouldAckReaction,
|
|
142
|
+
removeAckReactionAfterReply,
|
|
143
|
+
},
|
|
144
|
+
groups: {
|
|
145
|
+
resolveGroupPolicy: mockResolveGroupPolicy as unknown as PluginRuntime["channel"]["groups"]["resolveGroupPolicy"],
|
|
146
|
+
resolveRequireMention: mockResolveRequireMention as unknown as PluginRuntime["channel"]["groups"]["resolveRequireMention"],
|
|
147
|
+
},
|
|
148
|
+
debounce: {
|
|
149
|
+
createInboundDebouncer: vi.fn() as unknown as PluginRuntime["channel"]["debounce"]["createInboundDebouncer"],
|
|
150
|
+
resolveInboundDebounceMs: vi.fn() as unknown as PluginRuntime["channel"]["debounce"]["resolveInboundDebounceMs"],
|
|
151
|
+
},
|
|
152
|
+
commands: {
|
|
153
|
+
resolveCommandAuthorizedFromAuthorizers: mockResolveCommandAuthorizedFromAuthorizers as unknown as PluginRuntime["channel"]["commands"]["resolveCommandAuthorizedFromAuthorizers"],
|
|
154
|
+
isControlCommandMessage: vi.fn() as unknown as PluginRuntime["channel"]["commands"]["isControlCommandMessage"],
|
|
155
|
+
shouldComputeCommandAuthorized: vi.fn() as unknown as PluginRuntime["channel"]["commands"]["shouldComputeCommandAuthorized"],
|
|
156
|
+
shouldHandleTextCommands: vi.fn() as unknown as PluginRuntime["channel"]["commands"]["shouldHandleTextCommands"],
|
|
157
|
+
},
|
|
158
|
+
discord: {} as PluginRuntime["channel"]["discord"],
|
|
159
|
+
slack: {} as PluginRuntime["channel"]["slack"],
|
|
160
|
+
telegram: {} as PluginRuntime["channel"]["telegram"],
|
|
161
|
+
signal: {} as PluginRuntime["channel"]["signal"],
|
|
162
|
+
imessage: {} as PluginRuntime["channel"]["imessage"],
|
|
163
|
+
whatsapp: {} as PluginRuntime["channel"]["whatsapp"],
|
|
164
|
+
},
|
|
165
|
+
logging: {
|
|
166
|
+
shouldLogVerbose: vi.fn(() => false) as unknown as PluginRuntime["logging"]["shouldLogVerbose"],
|
|
167
|
+
getChildLogger: vi.fn(() => ({
|
|
168
|
+
info: vi.fn(),
|
|
169
|
+
warn: vi.fn(),
|
|
170
|
+
error: vi.fn(),
|
|
171
|
+
debug: vi.fn(),
|
|
172
|
+
})) as unknown as PluginRuntime["logging"]["getChildLogger"],
|
|
173
|
+
},
|
|
174
|
+
state: {
|
|
175
|
+
resolveStateDir: vi.fn(() => "/tmp/clawdbot") as unknown as PluginRuntime["state"]["resolveStateDir"],
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function createMockAccount(overrides: Partial<ResolvedBlueBubblesAccount["config"]> = {}): ResolvedBlueBubblesAccount {
|
|
181
|
+
return {
|
|
182
|
+
accountId: "default",
|
|
183
|
+
enabled: true,
|
|
184
|
+
configured: true,
|
|
185
|
+
config: {
|
|
186
|
+
serverUrl: "http://localhost:1234",
|
|
187
|
+
password: "test-password",
|
|
188
|
+
dmPolicy: "open",
|
|
189
|
+
groupPolicy: "open",
|
|
190
|
+
allowFrom: [],
|
|
191
|
+
groupAllowFrom: [],
|
|
192
|
+
...overrides,
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function createMockRequest(
|
|
198
|
+
method: string,
|
|
199
|
+
url: string,
|
|
200
|
+
body: unknown,
|
|
201
|
+
headers: Record<string, string> = {},
|
|
202
|
+
): IncomingMessage {
|
|
203
|
+
const req = new EventEmitter() as IncomingMessage;
|
|
204
|
+
req.method = method;
|
|
205
|
+
req.url = url;
|
|
206
|
+
req.headers = headers;
|
|
207
|
+
(req as unknown as { socket: { remoteAddress: string } }).socket = { remoteAddress: "127.0.0.1" };
|
|
208
|
+
|
|
209
|
+
// Emit body data after a microtask
|
|
210
|
+
Promise.resolve().then(() => {
|
|
211
|
+
const bodyStr = typeof body === "string" ? body : JSON.stringify(body);
|
|
212
|
+
req.emit("data", Buffer.from(bodyStr));
|
|
213
|
+
req.emit("end");
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
return req;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function createMockResponse(): ServerResponse & { body: string; statusCode: number } {
|
|
220
|
+
const res = {
|
|
221
|
+
statusCode: 200,
|
|
222
|
+
body: "",
|
|
223
|
+
setHeader: vi.fn(),
|
|
224
|
+
end: vi.fn((data?: string) => {
|
|
225
|
+
res.body = data ?? "";
|
|
226
|
+
}),
|
|
227
|
+
} as unknown as ServerResponse & { body: string; statusCode: number };
|
|
228
|
+
return res;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const flushAsync = async () => {
|
|
232
|
+
for (let i = 0; i < 2; i += 1) {
|
|
233
|
+
await new Promise<void>((resolve) => setImmediate(resolve));
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
describe("BlueBubbles webhook monitor", () => {
|
|
238
|
+
let unregister: () => void;
|
|
239
|
+
|
|
240
|
+
beforeEach(() => {
|
|
241
|
+
vi.clearAllMocks();
|
|
242
|
+
// Reset short ID state between tests for predictable behavior
|
|
243
|
+
_resetBlueBubblesShortIdState();
|
|
244
|
+
mockReadAllowFromStore.mockResolvedValue([]);
|
|
245
|
+
mockUpsertPairingRequest.mockResolvedValue({ code: "TESTCODE", created: true });
|
|
246
|
+
mockResolveRequireMention.mockReturnValue(false);
|
|
247
|
+
mockHasControlCommand.mockReturnValue(false);
|
|
248
|
+
mockResolveCommandAuthorizedFromAuthorizers.mockReturnValue(false);
|
|
249
|
+
mockBuildMentionRegexes.mockReturnValue([/\bbert\b/i]);
|
|
250
|
+
|
|
251
|
+
setBlueBubblesRuntime(createMockRuntime());
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
afterEach(() => {
|
|
255
|
+
unregister?.();
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
describe("webhook parsing + auth handling", () => {
|
|
259
|
+
it("rejects non-POST requests", async () => {
|
|
260
|
+
const account = createMockAccount();
|
|
261
|
+
const config: ClawdbotConfig = {};
|
|
262
|
+
const core = createMockRuntime();
|
|
263
|
+
setBlueBubblesRuntime(core);
|
|
264
|
+
|
|
265
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
266
|
+
account,
|
|
267
|
+
config,
|
|
268
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
269
|
+
core,
|
|
270
|
+
path: "/bluebubbles-webhook",
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
const req = createMockRequest("GET", "/bluebubbles-webhook", {});
|
|
274
|
+
const res = createMockResponse();
|
|
275
|
+
|
|
276
|
+
const handled = await handleBlueBubblesWebhookRequest(req, res);
|
|
277
|
+
|
|
278
|
+
expect(handled).toBe(true);
|
|
279
|
+
expect(res.statusCode).toBe(405);
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
it("accepts POST requests with valid JSON payload", async () => {
|
|
283
|
+
const account = createMockAccount();
|
|
284
|
+
const config: ClawdbotConfig = {};
|
|
285
|
+
const core = createMockRuntime();
|
|
286
|
+
setBlueBubblesRuntime(core);
|
|
287
|
+
|
|
288
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
289
|
+
account,
|
|
290
|
+
config,
|
|
291
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
292
|
+
core,
|
|
293
|
+
path: "/bluebubbles-webhook",
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
const payload = {
|
|
297
|
+
type: "new-message",
|
|
298
|
+
data: {
|
|
299
|
+
text: "hello",
|
|
300
|
+
handle: { address: "+15551234567" },
|
|
301
|
+
isGroup: false,
|
|
302
|
+
isFromMe: false,
|
|
303
|
+
guid: "msg-1",
|
|
304
|
+
date: Date.now(),
|
|
305
|
+
},
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
309
|
+
const res = createMockResponse();
|
|
310
|
+
|
|
311
|
+
const handled = await handleBlueBubblesWebhookRequest(req, res);
|
|
312
|
+
|
|
313
|
+
expect(handled).toBe(true);
|
|
314
|
+
expect(res.statusCode).toBe(200);
|
|
315
|
+
expect(res.body).toBe("ok");
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
it("rejects requests with invalid JSON", async () => {
|
|
319
|
+
const account = createMockAccount();
|
|
320
|
+
const config: ClawdbotConfig = {};
|
|
321
|
+
const core = createMockRuntime();
|
|
322
|
+
setBlueBubblesRuntime(core);
|
|
323
|
+
|
|
324
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
325
|
+
account,
|
|
326
|
+
config,
|
|
327
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
328
|
+
core,
|
|
329
|
+
path: "/bluebubbles-webhook",
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", "invalid json {{");
|
|
333
|
+
const res = createMockResponse();
|
|
334
|
+
|
|
335
|
+
const handled = await handleBlueBubblesWebhookRequest(req, res);
|
|
336
|
+
|
|
337
|
+
expect(handled).toBe(true);
|
|
338
|
+
expect(res.statusCode).toBe(400);
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
it("authenticates via password query parameter", async () => {
|
|
342
|
+
const account = createMockAccount({ password: "secret-token" });
|
|
343
|
+
const config: ClawdbotConfig = {};
|
|
344
|
+
const core = createMockRuntime();
|
|
345
|
+
setBlueBubblesRuntime(core);
|
|
346
|
+
|
|
347
|
+
// Mock non-localhost request
|
|
348
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook?password=secret-token", {
|
|
349
|
+
type: "new-message",
|
|
350
|
+
data: {
|
|
351
|
+
text: "hello",
|
|
352
|
+
handle: { address: "+15551234567" },
|
|
353
|
+
isGroup: false,
|
|
354
|
+
isFromMe: false,
|
|
355
|
+
guid: "msg-1",
|
|
356
|
+
},
|
|
357
|
+
});
|
|
358
|
+
(req as unknown as { socket: { remoteAddress: string } }).socket = { remoteAddress: "192.168.1.100" };
|
|
359
|
+
|
|
360
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
361
|
+
account,
|
|
362
|
+
config,
|
|
363
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
364
|
+
core,
|
|
365
|
+
path: "/bluebubbles-webhook",
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
const res = createMockResponse();
|
|
369
|
+
const handled = await handleBlueBubblesWebhookRequest(req, res);
|
|
370
|
+
|
|
371
|
+
expect(handled).toBe(true);
|
|
372
|
+
expect(res.statusCode).toBe(200);
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
it("authenticates via x-password header", async () => {
|
|
376
|
+
const account = createMockAccount({ password: "secret-token" });
|
|
377
|
+
const config: ClawdbotConfig = {};
|
|
378
|
+
const core = createMockRuntime();
|
|
379
|
+
setBlueBubblesRuntime(core);
|
|
380
|
+
|
|
381
|
+
const req = createMockRequest(
|
|
382
|
+
"POST",
|
|
383
|
+
"/bluebubbles-webhook",
|
|
384
|
+
{
|
|
385
|
+
type: "new-message",
|
|
386
|
+
data: {
|
|
387
|
+
text: "hello",
|
|
388
|
+
handle: { address: "+15551234567" },
|
|
389
|
+
isGroup: false,
|
|
390
|
+
isFromMe: false,
|
|
391
|
+
guid: "msg-1",
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
{ "x-password": "secret-token" },
|
|
395
|
+
);
|
|
396
|
+
(req as unknown as { socket: { remoteAddress: string } }).socket = { remoteAddress: "192.168.1.100" };
|
|
397
|
+
|
|
398
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
399
|
+
account,
|
|
400
|
+
config,
|
|
401
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
402
|
+
core,
|
|
403
|
+
path: "/bluebubbles-webhook",
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
const res = createMockResponse();
|
|
407
|
+
const handled = await handleBlueBubblesWebhookRequest(req, res);
|
|
408
|
+
|
|
409
|
+
expect(handled).toBe(true);
|
|
410
|
+
expect(res.statusCode).toBe(200);
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
it("rejects unauthorized requests with wrong password", async () => {
|
|
414
|
+
const account = createMockAccount({ password: "secret-token" });
|
|
415
|
+
const config: ClawdbotConfig = {};
|
|
416
|
+
const core = createMockRuntime();
|
|
417
|
+
setBlueBubblesRuntime(core);
|
|
418
|
+
|
|
419
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook?password=wrong-token", {
|
|
420
|
+
type: "new-message",
|
|
421
|
+
data: {
|
|
422
|
+
text: "hello",
|
|
423
|
+
handle: { address: "+15551234567" },
|
|
424
|
+
isGroup: false,
|
|
425
|
+
isFromMe: false,
|
|
426
|
+
guid: "msg-1",
|
|
427
|
+
},
|
|
428
|
+
});
|
|
429
|
+
(req as unknown as { socket: { remoteAddress: string } }).socket = { remoteAddress: "192.168.1.100" };
|
|
430
|
+
|
|
431
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
432
|
+
account,
|
|
433
|
+
config,
|
|
434
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
435
|
+
core,
|
|
436
|
+
path: "/bluebubbles-webhook",
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
const res = createMockResponse();
|
|
440
|
+
const handled = await handleBlueBubblesWebhookRequest(req, res);
|
|
441
|
+
|
|
442
|
+
expect(handled).toBe(true);
|
|
443
|
+
expect(res.statusCode).toBe(401);
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
it("allows localhost requests without authentication", async () => {
|
|
447
|
+
const account = createMockAccount({ password: "secret-token" });
|
|
448
|
+
const config: ClawdbotConfig = {};
|
|
449
|
+
const core = createMockRuntime();
|
|
450
|
+
setBlueBubblesRuntime(core);
|
|
451
|
+
|
|
452
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", {
|
|
453
|
+
type: "new-message",
|
|
454
|
+
data: {
|
|
455
|
+
text: "hello",
|
|
456
|
+
handle: { address: "+15551234567" },
|
|
457
|
+
isGroup: false,
|
|
458
|
+
isFromMe: false,
|
|
459
|
+
guid: "msg-1",
|
|
460
|
+
},
|
|
461
|
+
});
|
|
462
|
+
// Localhost address
|
|
463
|
+
(req as unknown as { socket: { remoteAddress: string } }).socket = { remoteAddress: "127.0.0.1" };
|
|
464
|
+
|
|
465
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
466
|
+
account,
|
|
467
|
+
config,
|
|
468
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
469
|
+
core,
|
|
470
|
+
path: "/bluebubbles-webhook",
|
|
471
|
+
});
|
|
472
|
+
|
|
473
|
+
const res = createMockResponse();
|
|
474
|
+
const handled = await handleBlueBubblesWebhookRequest(req, res);
|
|
475
|
+
|
|
476
|
+
expect(handled).toBe(true);
|
|
477
|
+
expect(res.statusCode).toBe(200);
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
it("ignores unregistered webhook paths", async () => {
|
|
481
|
+
const req = createMockRequest("POST", "/unregistered-path", {});
|
|
482
|
+
const res = createMockResponse();
|
|
483
|
+
|
|
484
|
+
const handled = await handleBlueBubblesWebhookRequest(req, res);
|
|
485
|
+
|
|
486
|
+
expect(handled).toBe(false);
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
it("parses chatId when provided as a string (webhook variant)", async () => {
|
|
490
|
+
const { resolveChatGuidForTarget } = await import("./send.js");
|
|
491
|
+
vi.mocked(resolveChatGuidForTarget).mockClear();
|
|
492
|
+
|
|
493
|
+
const account = createMockAccount({ groupPolicy: "open" });
|
|
494
|
+
const config: ClawdbotConfig = {};
|
|
495
|
+
const core = createMockRuntime();
|
|
496
|
+
setBlueBubblesRuntime(core);
|
|
497
|
+
|
|
498
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
499
|
+
account,
|
|
500
|
+
config,
|
|
501
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
502
|
+
core,
|
|
503
|
+
path: "/bluebubbles-webhook",
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
const payload = {
|
|
507
|
+
type: "new-message",
|
|
508
|
+
data: {
|
|
509
|
+
text: "hello from group",
|
|
510
|
+
handle: { address: "+15551234567" },
|
|
511
|
+
isGroup: true,
|
|
512
|
+
isFromMe: false,
|
|
513
|
+
guid: "msg-1",
|
|
514
|
+
chatId: "123",
|
|
515
|
+
date: Date.now(),
|
|
516
|
+
},
|
|
517
|
+
};
|
|
518
|
+
|
|
519
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
520
|
+
const res = createMockResponse();
|
|
521
|
+
|
|
522
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
523
|
+
await flushAsync();
|
|
524
|
+
|
|
525
|
+
expect(resolveChatGuidForTarget).toHaveBeenCalledWith(
|
|
526
|
+
expect.objectContaining({
|
|
527
|
+
target: { kind: "chat_id", chatId: 123 },
|
|
528
|
+
}),
|
|
529
|
+
);
|
|
530
|
+
});
|
|
531
|
+
|
|
532
|
+
it("extracts chatGuid from nested chat object fields (webhook variant)", async () => {
|
|
533
|
+
const { sendMessageBlueBubbles, resolveChatGuidForTarget } = await import("./send.js");
|
|
534
|
+
vi.mocked(sendMessageBlueBubbles).mockClear();
|
|
535
|
+
vi.mocked(resolveChatGuidForTarget).mockClear();
|
|
536
|
+
|
|
537
|
+
mockDispatchReplyWithBufferedBlockDispatcher.mockImplementationOnce(async (params) => {
|
|
538
|
+
await params.dispatcherOptions.deliver({ text: "replying now" }, { kind: "final" });
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
const account = createMockAccount({ groupPolicy: "open" });
|
|
542
|
+
const config: ClawdbotConfig = {};
|
|
543
|
+
const core = createMockRuntime();
|
|
544
|
+
setBlueBubblesRuntime(core);
|
|
545
|
+
|
|
546
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
547
|
+
account,
|
|
548
|
+
config,
|
|
549
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
550
|
+
core,
|
|
551
|
+
path: "/bluebubbles-webhook",
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
const payload = {
|
|
555
|
+
type: "new-message",
|
|
556
|
+
data: {
|
|
557
|
+
text: "hello from group",
|
|
558
|
+
handle: { address: "+15551234567" },
|
|
559
|
+
isGroup: true,
|
|
560
|
+
isFromMe: false,
|
|
561
|
+
guid: "msg-1",
|
|
562
|
+
chat: { chatGuid: "iMessage;+;chat123456" },
|
|
563
|
+
date: Date.now(),
|
|
564
|
+
},
|
|
565
|
+
};
|
|
566
|
+
|
|
567
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
568
|
+
const res = createMockResponse();
|
|
569
|
+
|
|
570
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
571
|
+
await flushAsync();
|
|
572
|
+
|
|
573
|
+
expect(resolveChatGuidForTarget).not.toHaveBeenCalled();
|
|
574
|
+
expect(sendMessageBlueBubbles).toHaveBeenCalledWith(
|
|
575
|
+
"chat_guid:iMessage;+;chat123456",
|
|
576
|
+
expect.any(String),
|
|
577
|
+
expect.any(Object),
|
|
578
|
+
);
|
|
579
|
+
});
|
|
580
|
+
});
|
|
581
|
+
|
|
582
|
+
describe("DM pairing behavior vs allowFrom", () => {
|
|
583
|
+
it("allows DM from sender in allowFrom list", async () => {
|
|
584
|
+
const account = createMockAccount({
|
|
585
|
+
dmPolicy: "allowlist",
|
|
586
|
+
allowFrom: ["+15551234567"],
|
|
587
|
+
});
|
|
588
|
+
const config: ClawdbotConfig = {};
|
|
589
|
+
const core = createMockRuntime();
|
|
590
|
+
setBlueBubblesRuntime(core);
|
|
591
|
+
|
|
592
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
593
|
+
account,
|
|
594
|
+
config,
|
|
595
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
596
|
+
core,
|
|
597
|
+
path: "/bluebubbles-webhook",
|
|
598
|
+
});
|
|
599
|
+
|
|
600
|
+
const payload = {
|
|
601
|
+
type: "new-message",
|
|
602
|
+
data: {
|
|
603
|
+
text: "hello from allowed sender",
|
|
604
|
+
handle: { address: "+15551234567" },
|
|
605
|
+
isGroup: false,
|
|
606
|
+
isFromMe: false,
|
|
607
|
+
guid: "msg-1",
|
|
608
|
+
date: Date.now(),
|
|
609
|
+
},
|
|
610
|
+
};
|
|
611
|
+
|
|
612
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
613
|
+
const res = createMockResponse();
|
|
614
|
+
|
|
615
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
616
|
+
|
|
617
|
+
// Wait for async processing
|
|
618
|
+
await flushAsync();
|
|
619
|
+
|
|
620
|
+
expect(res.statusCode).toBe(200);
|
|
621
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
it("blocks DM from sender not in allowFrom when dmPolicy=allowlist", async () => {
|
|
625
|
+
const account = createMockAccount({
|
|
626
|
+
dmPolicy: "allowlist",
|
|
627
|
+
allowFrom: ["+15559999999"], // Different number
|
|
628
|
+
});
|
|
629
|
+
const config: ClawdbotConfig = {};
|
|
630
|
+
const core = createMockRuntime();
|
|
631
|
+
setBlueBubblesRuntime(core);
|
|
632
|
+
|
|
633
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
634
|
+
account,
|
|
635
|
+
config,
|
|
636
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
637
|
+
core,
|
|
638
|
+
path: "/bluebubbles-webhook",
|
|
639
|
+
});
|
|
640
|
+
|
|
641
|
+
const payload = {
|
|
642
|
+
type: "new-message",
|
|
643
|
+
data: {
|
|
644
|
+
text: "hello from blocked sender",
|
|
645
|
+
handle: { address: "+15551234567" },
|
|
646
|
+
isGroup: false,
|
|
647
|
+
isFromMe: false,
|
|
648
|
+
guid: "msg-1",
|
|
649
|
+
date: Date.now(),
|
|
650
|
+
},
|
|
651
|
+
};
|
|
652
|
+
|
|
653
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
654
|
+
const res = createMockResponse();
|
|
655
|
+
|
|
656
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
657
|
+
await flushAsync();
|
|
658
|
+
|
|
659
|
+
expect(res.statusCode).toBe(200);
|
|
660
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).not.toHaveBeenCalled();
|
|
661
|
+
});
|
|
662
|
+
|
|
663
|
+
it("triggers pairing flow for unknown sender when dmPolicy=pairing", async () => {
|
|
664
|
+
// Note: empty allowFrom = allow all. To trigger pairing, we need a non-empty
|
|
665
|
+
// allowlist that doesn't include the sender
|
|
666
|
+
const account = createMockAccount({
|
|
667
|
+
dmPolicy: "pairing",
|
|
668
|
+
allowFrom: ["+15559999999"], // Different number than sender
|
|
669
|
+
});
|
|
670
|
+
const config: ClawdbotConfig = {};
|
|
671
|
+
const core = createMockRuntime();
|
|
672
|
+
setBlueBubblesRuntime(core);
|
|
673
|
+
|
|
674
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
675
|
+
account,
|
|
676
|
+
config,
|
|
677
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
678
|
+
core,
|
|
679
|
+
path: "/bluebubbles-webhook",
|
|
680
|
+
});
|
|
681
|
+
|
|
682
|
+
const payload = {
|
|
683
|
+
type: "new-message",
|
|
684
|
+
data: {
|
|
685
|
+
text: "hello",
|
|
686
|
+
handle: { address: "+15551234567" },
|
|
687
|
+
isGroup: false,
|
|
688
|
+
isFromMe: false,
|
|
689
|
+
guid: "msg-1",
|
|
690
|
+
date: Date.now(),
|
|
691
|
+
},
|
|
692
|
+
};
|
|
693
|
+
|
|
694
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
695
|
+
const res = createMockResponse();
|
|
696
|
+
|
|
697
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
698
|
+
await flushAsync();
|
|
699
|
+
|
|
700
|
+
expect(mockUpsertPairingRequest).toHaveBeenCalled();
|
|
701
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).not.toHaveBeenCalled();
|
|
702
|
+
});
|
|
703
|
+
|
|
704
|
+
it("does not resend pairing reply when request already exists", async () => {
|
|
705
|
+
mockUpsertPairingRequest.mockResolvedValue({ code: "TESTCODE", created: false });
|
|
706
|
+
|
|
707
|
+
// Note: empty allowFrom = allow all. To trigger pairing, we need a non-empty
|
|
708
|
+
// allowlist that doesn't include the sender
|
|
709
|
+
const account = createMockAccount({
|
|
710
|
+
dmPolicy: "pairing",
|
|
711
|
+
allowFrom: ["+15559999999"], // Different number than sender
|
|
712
|
+
});
|
|
713
|
+
const config: ClawdbotConfig = {};
|
|
714
|
+
const core = createMockRuntime();
|
|
715
|
+
setBlueBubblesRuntime(core);
|
|
716
|
+
|
|
717
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
718
|
+
account,
|
|
719
|
+
config,
|
|
720
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
721
|
+
core,
|
|
722
|
+
path: "/bluebubbles-webhook",
|
|
723
|
+
});
|
|
724
|
+
|
|
725
|
+
const payload = {
|
|
726
|
+
type: "new-message",
|
|
727
|
+
data: {
|
|
728
|
+
text: "hello again",
|
|
729
|
+
handle: { address: "+15551234567" },
|
|
730
|
+
isGroup: false,
|
|
731
|
+
isFromMe: false,
|
|
732
|
+
guid: "msg-2",
|
|
733
|
+
date: Date.now(),
|
|
734
|
+
},
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
738
|
+
const res = createMockResponse();
|
|
739
|
+
|
|
740
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
741
|
+
await flushAsync();
|
|
742
|
+
|
|
743
|
+
expect(mockUpsertPairingRequest).toHaveBeenCalled();
|
|
744
|
+
// Should not send pairing reply since created=false
|
|
745
|
+
const { sendMessageBlueBubbles } = await import("./send.js");
|
|
746
|
+
expect(sendMessageBlueBubbles).not.toHaveBeenCalled();
|
|
747
|
+
});
|
|
748
|
+
|
|
749
|
+
it("allows all DMs when dmPolicy=open", async () => {
|
|
750
|
+
const account = createMockAccount({
|
|
751
|
+
dmPolicy: "open",
|
|
752
|
+
allowFrom: [],
|
|
753
|
+
});
|
|
754
|
+
const config: ClawdbotConfig = {};
|
|
755
|
+
const core = createMockRuntime();
|
|
756
|
+
setBlueBubblesRuntime(core);
|
|
757
|
+
|
|
758
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
759
|
+
account,
|
|
760
|
+
config,
|
|
761
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
762
|
+
core,
|
|
763
|
+
path: "/bluebubbles-webhook",
|
|
764
|
+
});
|
|
765
|
+
|
|
766
|
+
const payload = {
|
|
767
|
+
type: "new-message",
|
|
768
|
+
data: {
|
|
769
|
+
text: "hello from anyone",
|
|
770
|
+
handle: { address: "+15559999999" },
|
|
771
|
+
isGroup: false,
|
|
772
|
+
isFromMe: false,
|
|
773
|
+
guid: "msg-1",
|
|
774
|
+
date: Date.now(),
|
|
775
|
+
},
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
779
|
+
const res = createMockResponse();
|
|
780
|
+
|
|
781
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
782
|
+
await flushAsync();
|
|
783
|
+
|
|
784
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
|
|
785
|
+
});
|
|
786
|
+
|
|
787
|
+
it("blocks all DMs when dmPolicy=disabled", async () => {
|
|
788
|
+
const account = createMockAccount({
|
|
789
|
+
dmPolicy: "disabled",
|
|
790
|
+
});
|
|
791
|
+
const config: ClawdbotConfig = {};
|
|
792
|
+
const core = createMockRuntime();
|
|
793
|
+
setBlueBubblesRuntime(core);
|
|
794
|
+
|
|
795
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
796
|
+
account,
|
|
797
|
+
config,
|
|
798
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
799
|
+
core,
|
|
800
|
+
path: "/bluebubbles-webhook",
|
|
801
|
+
});
|
|
802
|
+
|
|
803
|
+
const payload = {
|
|
804
|
+
type: "new-message",
|
|
805
|
+
data: {
|
|
806
|
+
text: "hello",
|
|
807
|
+
handle: { address: "+15551234567" },
|
|
808
|
+
isGroup: false,
|
|
809
|
+
isFromMe: false,
|
|
810
|
+
guid: "msg-1",
|
|
811
|
+
date: Date.now(),
|
|
812
|
+
},
|
|
813
|
+
};
|
|
814
|
+
|
|
815
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
816
|
+
const res = createMockResponse();
|
|
817
|
+
|
|
818
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
819
|
+
await flushAsync();
|
|
820
|
+
|
|
821
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).not.toHaveBeenCalled();
|
|
822
|
+
});
|
|
823
|
+
});
|
|
824
|
+
|
|
825
|
+
describe("group message gating", () => {
|
|
826
|
+
it("allows group messages when groupPolicy=open and no allowlist", async () => {
|
|
827
|
+
const account = createMockAccount({
|
|
828
|
+
groupPolicy: "open",
|
|
829
|
+
});
|
|
830
|
+
const config: ClawdbotConfig = {};
|
|
831
|
+
const core = createMockRuntime();
|
|
832
|
+
setBlueBubblesRuntime(core);
|
|
833
|
+
|
|
834
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
835
|
+
account,
|
|
836
|
+
config,
|
|
837
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
838
|
+
core,
|
|
839
|
+
path: "/bluebubbles-webhook",
|
|
840
|
+
});
|
|
841
|
+
|
|
842
|
+
const payload = {
|
|
843
|
+
type: "new-message",
|
|
844
|
+
data: {
|
|
845
|
+
text: "hello from group",
|
|
846
|
+
handle: { address: "+15551234567" },
|
|
847
|
+
isGroup: true,
|
|
848
|
+
isFromMe: false,
|
|
849
|
+
guid: "msg-1",
|
|
850
|
+
chatGuid: "iMessage;+;chat123456",
|
|
851
|
+
date: Date.now(),
|
|
852
|
+
},
|
|
853
|
+
};
|
|
854
|
+
|
|
855
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
856
|
+
const res = createMockResponse();
|
|
857
|
+
|
|
858
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
859
|
+
await flushAsync();
|
|
860
|
+
|
|
861
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
|
|
862
|
+
});
|
|
863
|
+
|
|
864
|
+
it("blocks group messages when groupPolicy=disabled", async () => {
|
|
865
|
+
const account = createMockAccount({
|
|
866
|
+
groupPolicy: "disabled",
|
|
867
|
+
});
|
|
868
|
+
const config: ClawdbotConfig = {};
|
|
869
|
+
const core = createMockRuntime();
|
|
870
|
+
setBlueBubblesRuntime(core);
|
|
871
|
+
|
|
872
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
873
|
+
account,
|
|
874
|
+
config,
|
|
875
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
876
|
+
core,
|
|
877
|
+
path: "/bluebubbles-webhook",
|
|
878
|
+
});
|
|
879
|
+
|
|
880
|
+
const payload = {
|
|
881
|
+
type: "new-message",
|
|
882
|
+
data: {
|
|
883
|
+
text: "hello from group",
|
|
884
|
+
handle: { address: "+15551234567" },
|
|
885
|
+
isGroup: true,
|
|
886
|
+
isFromMe: false,
|
|
887
|
+
guid: "msg-1",
|
|
888
|
+
chatGuid: "iMessage;+;chat123456",
|
|
889
|
+
date: Date.now(),
|
|
890
|
+
},
|
|
891
|
+
};
|
|
892
|
+
|
|
893
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
894
|
+
const res = createMockResponse();
|
|
895
|
+
|
|
896
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
897
|
+
await flushAsync();
|
|
898
|
+
|
|
899
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).not.toHaveBeenCalled();
|
|
900
|
+
});
|
|
901
|
+
|
|
902
|
+
it("treats chat_guid groups as group even when isGroup=false", async () => {
|
|
903
|
+
const account = createMockAccount({
|
|
904
|
+
groupPolicy: "allowlist",
|
|
905
|
+
dmPolicy: "open",
|
|
906
|
+
});
|
|
907
|
+
const config: ClawdbotConfig = {};
|
|
908
|
+
const core = createMockRuntime();
|
|
909
|
+
setBlueBubblesRuntime(core);
|
|
910
|
+
|
|
911
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
912
|
+
account,
|
|
913
|
+
config,
|
|
914
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
915
|
+
core,
|
|
916
|
+
path: "/bluebubbles-webhook",
|
|
917
|
+
});
|
|
918
|
+
|
|
919
|
+
const payload = {
|
|
920
|
+
type: "new-message",
|
|
921
|
+
data: {
|
|
922
|
+
text: "hello from group",
|
|
923
|
+
handle: { address: "+15551234567" },
|
|
924
|
+
isGroup: false,
|
|
925
|
+
isFromMe: false,
|
|
926
|
+
guid: "msg-1",
|
|
927
|
+
chatGuid: "iMessage;+;chat123456",
|
|
928
|
+
date: Date.now(),
|
|
929
|
+
},
|
|
930
|
+
};
|
|
931
|
+
|
|
932
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
933
|
+
const res = createMockResponse();
|
|
934
|
+
|
|
935
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
936
|
+
await flushAsync();
|
|
937
|
+
|
|
938
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).not.toHaveBeenCalled();
|
|
939
|
+
});
|
|
940
|
+
|
|
941
|
+
it("allows group messages from allowed chat_guid in groupAllowFrom", async () => {
|
|
942
|
+
const account = createMockAccount({
|
|
943
|
+
groupPolicy: "allowlist",
|
|
944
|
+
groupAllowFrom: ["chat_guid:iMessage;+;chat123456"],
|
|
945
|
+
});
|
|
946
|
+
const config: ClawdbotConfig = {};
|
|
947
|
+
const core = createMockRuntime();
|
|
948
|
+
setBlueBubblesRuntime(core);
|
|
949
|
+
|
|
950
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
951
|
+
account,
|
|
952
|
+
config,
|
|
953
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
954
|
+
core,
|
|
955
|
+
path: "/bluebubbles-webhook",
|
|
956
|
+
});
|
|
957
|
+
|
|
958
|
+
const payload = {
|
|
959
|
+
type: "new-message",
|
|
960
|
+
data: {
|
|
961
|
+
text: "hello from allowed group",
|
|
962
|
+
handle: { address: "+15551234567" },
|
|
963
|
+
isGroup: true,
|
|
964
|
+
isFromMe: false,
|
|
965
|
+
guid: "msg-1",
|
|
966
|
+
chatGuid: "iMessage;+;chat123456",
|
|
967
|
+
date: Date.now(),
|
|
968
|
+
},
|
|
969
|
+
};
|
|
970
|
+
|
|
971
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
972
|
+
const res = createMockResponse();
|
|
973
|
+
|
|
974
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
975
|
+
await flushAsync();
|
|
976
|
+
|
|
977
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
|
|
978
|
+
});
|
|
979
|
+
});
|
|
980
|
+
|
|
981
|
+
describe("mention gating (group messages)", () => {
|
|
982
|
+
it("processes group message when mentioned and requireMention=true", async () => {
|
|
983
|
+
mockResolveRequireMention.mockReturnValue(true);
|
|
984
|
+
mockMatchesMentionPatterns.mockReturnValue(true);
|
|
985
|
+
|
|
986
|
+
const account = createMockAccount({ groupPolicy: "open" });
|
|
987
|
+
const config: ClawdbotConfig = {};
|
|
988
|
+
const core = createMockRuntime();
|
|
989
|
+
setBlueBubblesRuntime(core);
|
|
990
|
+
|
|
991
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
992
|
+
account,
|
|
993
|
+
config,
|
|
994
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
995
|
+
core,
|
|
996
|
+
path: "/bluebubbles-webhook",
|
|
997
|
+
});
|
|
998
|
+
|
|
999
|
+
const payload = {
|
|
1000
|
+
type: "new-message",
|
|
1001
|
+
data: {
|
|
1002
|
+
text: "bert, can you help me?",
|
|
1003
|
+
handle: { address: "+15551234567" },
|
|
1004
|
+
isGroup: true,
|
|
1005
|
+
isFromMe: false,
|
|
1006
|
+
guid: "msg-1",
|
|
1007
|
+
chatGuid: "iMessage;+;chat123456",
|
|
1008
|
+
date: Date.now(),
|
|
1009
|
+
},
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1013
|
+
const res = createMockResponse();
|
|
1014
|
+
|
|
1015
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1016
|
+
await flushAsync();
|
|
1017
|
+
|
|
1018
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
|
|
1019
|
+
const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
|
|
1020
|
+
expect(callArgs.ctx.WasMentioned).toBe(true);
|
|
1021
|
+
});
|
|
1022
|
+
|
|
1023
|
+
it("skips group message when not mentioned and requireMention=true", async () => {
|
|
1024
|
+
mockResolveRequireMention.mockReturnValue(true);
|
|
1025
|
+
mockMatchesMentionPatterns.mockReturnValue(false);
|
|
1026
|
+
|
|
1027
|
+
const account = createMockAccount({ groupPolicy: "open" });
|
|
1028
|
+
const config: ClawdbotConfig = {};
|
|
1029
|
+
const core = createMockRuntime();
|
|
1030
|
+
setBlueBubblesRuntime(core);
|
|
1031
|
+
|
|
1032
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1033
|
+
account,
|
|
1034
|
+
config,
|
|
1035
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1036
|
+
core,
|
|
1037
|
+
path: "/bluebubbles-webhook",
|
|
1038
|
+
});
|
|
1039
|
+
|
|
1040
|
+
const payload = {
|
|
1041
|
+
type: "new-message",
|
|
1042
|
+
data: {
|
|
1043
|
+
text: "hello everyone",
|
|
1044
|
+
handle: { address: "+15551234567" },
|
|
1045
|
+
isGroup: true,
|
|
1046
|
+
isFromMe: false,
|
|
1047
|
+
guid: "msg-1",
|
|
1048
|
+
chatGuid: "iMessage;+;chat123456",
|
|
1049
|
+
date: Date.now(),
|
|
1050
|
+
},
|
|
1051
|
+
};
|
|
1052
|
+
|
|
1053
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1054
|
+
const res = createMockResponse();
|
|
1055
|
+
|
|
1056
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1057
|
+
await flushAsync();
|
|
1058
|
+
|
|
1059
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).not.toHaveBeenCalled();
|
|
1060
|
+
});
|
|
1061
|
+
|
|
1062
|
+
it("processes group message without mention when requireMention=false", async () => {
|
|
1063
|
+
mockResolveRequireMention.mockReturnValue(false);
|
|
1064
|
+
|
|
1065
|
+
const account = createMockAccount({ groupPolicy: "open" });
|
|
1066
|
+
const config: ClawdbotConfig = {};
|
|
1067
|
+
const core = createMockRuntime();
|
|
1068
|
+
setBlueBubblesRuntime(core);
|
|
1069
|
+
|
|
1070
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1071
|
+
account,
|
|
1072
|
+
config,
|
|
1073
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1074
|
+
core,
|
|
1075
|
+
path: "/bluebubbles-webhook",
|
|
1076
|
+
});
|
|
1077
|
+
|
|
1078
|
+
const payload = {
|
|
1079
|
+
type: "new-message",
|
|
1080
|
+
data: {
|
|
1081
|
+
text: "hello everyone",
|
|
1082
|
+
handle: { address: "+15551234567" },
|
|
1083
|
+
isGroup: true,
|
|
1084
|
+
isFromMe: false,
|
|
1085
|
+
guid: "msg-1",
|
|
1086
|
+
chatGuid: "iMessage;+;chat123456",
|
|
1087
|
+
date: Date.now(),
|
|
1088
|
+
},
|
|
1089
|
+
};
|
|
1090
|
+
|
|
1091
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1092
|
+
const res = createMockResponse();
|
|
1093
|
+
|
|
1094
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1095
|
+
await flushAsync();
|
|
1096
|
+
|
|
1097
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
|
|
1098
|
+
});
|
|
1099
|
+
});
|
|
1100
|
+
|
|
1101
|
+
describe("group metadata", () => {
|
|
1102
|
+
it("includes group subject + members in ctx", async () => {
|
|
1103
|
+
const account = createMockAccount({ groupPolicy: "open" });
|
|
1104
|
+
const config: ClawdbotConfig = {};
|
|
1105
|
+
const core = createMockRuntime();
|
|
1106
|
+
setBlueBubblesRuntime(core);
|
|
1107
|
+
|
|
1108
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1109
|
+
account,
|
|
1110
|
+
config,
|
|
1111
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1112
|
+
core,
|
|
1113
|
+
path: "/bluebubbles-webhook",
|
|
1114
|
+
});
|
|
1115
|
+
|
|
1116
|
+
const payload = {
|
|
1117
|
+
type: "new-message",
|
|
1118
|
+
data: {
|
|
1119
|
+
text: "hello group",
|
|
1120
|
+
handle: { address: "+15551234567" },
|
|
1121
|
+
isGroup: true,
|
|
1122
|
+
isFromMe: false,
|
|
1123
|
+
guid: "msg-1",
|
|
1124
|
+
chatGuid: "iMessage;+;chat123456",
|
|
1125
|
+
chatName: "Family",
|
|
1126
|
+
participants: [
|
|
1127
|
+
{ address: "+15551234567", displayName: "Alice" },
|
|
1128
|
+
{ address: "+15557654321", displayName: "Bob" },
|
|
1129
|
+
],
|
|
1130
|
+
date: Date.now(),
|
|
1131
|
+
},
|
|
1132
|
+
};
|
|
1133
|
+
|
|
1134
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1135
|
+
const res = createMockResponse();
|
|
1136
|
+
|
|
1137
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1138
|
+
await flushAsync();
|
|
1139
|
+
|
|
1140
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
|
|
1141
|
+
const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
|
|
1142
|
+
expect(callArgs.ctx.GroupSubject).toBe("Family");
|
|
1143
|
+
expect(callArgs.ctx.GroupMembers).toBe("Alice (+15551234567), Bob (+15557654321)");
|
|
1144
|
+
});
|
|
1145
|
+
});
|
|
1146
|
+
|
|
1147
|
+
describe("reply metadata", () => {
|
|
1148
|
+
it("surfaces reply fields in ctx when provided", async () => {
|
|
1149
|
+
const account = createMockAccount({ dmPolicy: "open" });
|
|
1150
|
+
const config: ClawdbotConfig = {};
|
|
1151
|
+
const core = createMockRuntime();
|
|
1152
|
+
setBlueBubblesRuntime(core);
|
|
1153
|
+
|
|
1154
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1155
|
+
account,
|
|
1156
|
+
config,
|
|
1157
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1158
|
+
core,
|
|
1159
|
+
path: "/bluebubbles-webhook",
|
|
1160
|
+
});
|
|
1161
|
+
|
|
1162
|
+
const payload = {
|
|
1163
|
+
type: "new-message",
|
|
1164
|
+
data: {
|
|
1165
|
+
text: "replying now",
|
|
1166
|
+
handle: { address: "+15551234567" },
|
|
1167
|
+
isGroup: false,
|
|
1168
|
+
isFromMe: false,
|
|
1169
|
+
guid: "msg-1",
|
|
1170
|
+
chatGuid: "iMessage;-;+15551234567",
|
|
1171
|
+
replyTo: {
|
|
1172
|
+
guid: "msg-0",
|
|
1173
|
+
text: "original message",
|
|
1174
|
+
handle: { address: "+15550000000", displayName: "Alice" },
|
|
1175
|
+
},
|
|
1176
|
+
date: Date.now(),
|
|
1177
|
+
},
|
|
1178
|
+
};
|
|
1179
|
+
|
|
1180
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1181
|
+
const res = createMockResponse();
|
|
1182
|
+
|
|
1183
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1184
|
+
await flushAsync();
|
|
1185
|
+
|
|
1186
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
|
|
1187
|
+
const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
|
|
1188
|
+
// ReplyToId is the full UUID since it wasn't previously cached
|
|
1189
|
+
expect(callArgs.ctx.ReplyToId).toBe("msg-0");
|
|
1190
|
+
expect(callArgs.ctx.ReplyToBody).toBe("original message");
|
|
1191
|
+
expect(callArgs.ctx.ReplyToSender).toBe("+15550000000");
|
|
1192
|
+
// Body uses inline [[reply_to:N]] tag format
|
|
1193
|
+
expect(callArgs.ctx.Body).toContain("[[reply_to:msg-0]]");
|
|
1194
|
+
});
|
|
1195
|
+
|
|
1196
|
+
it("preserves part index prefixes in reply tags when short IDs are unavailable", async () => {
|
|
1197
|
+
const account = createMockAccount({ dmPolicy: "open" });
|
|
1198
|
+
const config: ClawdbotConfig = {};
|
|
1199
|
+
const core = createMockRuntime();
|
|
1200
|
+
setBlueBubblesRuntime(core);
|
|
1201
|
+
|
|
1202
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1203
|
+
account,
|
|
1204
|
+
config,
|
|
1205
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1206
|
+
core,
|
|
1207
|
+
path: "/bluebubbles-webhook",
|
|
1208
|
+
});
|
|
1209
|
+
|
|
1210
|
+
const payload = {
|
|
1211
|
+
type: "new-message",
|
|
1212
|
+
data: {
|
|
1213
|
+
text: "replying now",
|
|
1214
|
+
handle: { address: "+15551234567" },
|
|
1215
|
+
isGroup: false,
|
|
1216
|
+
isFromMe: false,
|
|
1217
|
+
guid: "msg-1",
|
|
1218
|
+
chatGuid: "iMessage;-;+15551234567",
|
|
1219
|
+
replyTo: {
|
|
1220
|
+
guid: "p:1/msg-0",
|
|
1221
|
+
text: "original message",
|
|
1222
|
+
handle: { address: "+15550000000", displayName: "Alice" },
|
|
1223
|
+
},
|
|
1224
|
+
date: Date.now(),
|
|
1225
|
+
},
|
|
1226
|
+
};
|
|
1227
|
+
|
|
1228
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1229
|
+
const res = createMockResponse();
|
|
1230
|
+
|
|
1231
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1232
|
+
await flushAsync();
|
|
1233
|
+
|
|
1234
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
|
|
1235
|
+
const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
|
|
1236
|
+
expect(callArgs.ctx.ReplyToId).toBe("p:1/msg-0");
|
|
1237
|
+
expect(callArgs.ctx.ReplyToIdFull).toBe("p:1/msg-0");
|
|
1238
|
+
expect(callArgs.ctx.Body).toContain("[[reply_to:p:1/msg-0]]");
|
|
1239
|
+
});
|
|
1240
|
+
|
|
1241
|
+
it("hydrates missing reply sender/body from the recent-message cache", async () => {
|
|
1242
|
+
const account = createMockAccount({ dmPolicy: "open", groupPolicy: "open" });
|
|
1243
|
+
const config: ClawdbotConfig = {};
|
|
1244
|
+
const core = createMockRuntime();
|
|
1245
|
+
setBlueBubblesRuntime(core);
|
|
1246
|
+
|
|
1247
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1248
|
+
account,
|
|
1249
|
+
config,
|
|
1250
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1251
|
+
core,
|
|
1252
|
+
path: "/bluebubbles-webhook",
|
|
1253
|
+
});
|
|
1254
|
+
|
|
1255
|
+
const chatGuid = "iMessage;+;chat-reply-cache";
|
|
1256
|
+
|
|
1257
|
+
const originalPayload = {
|
|
1258
|
+
type: "new-message",
|
|
1259
|
+
data: {
|
|
1260
|
+
text: "original message (cached)",
|
|
1261
|
+
handle: { address: "+15550000000" },
|
|
1262
|
+
isGroup: true,
|
|
1263
|
+
isFromMe: false,
|
|
1264
|
+
guid: "cache-msg-0",
|
|
1265
|
+
chatGuid,
|
|
1266
|
+
date: Date.now(),
|
|
1267
|
+
},
|
|
1268
|
+
};
|
|
1269
|
+
|
|
1270
|
+
const originalReq = createMockRequest("POST", "/bluebubbles-webhook", originalPayload);
|
|
1271
|
+
const originalRes = createMockResponse();
|
|
1272
|
+
|
|
1273
|
+
await handleBlueBubblesWebhookRequest(originalReq, originalRes);
|
|
1274
|
+
await flushAsync();
|
|
1275
|
+
|
|
1276
|
+
// Only assert the reply message behavior below.
|
|
1277
|
+
mockDispatchReplyWithBufferedBlockDispatcher.mockClear();
|
|
1278
|
+
|
|
1279
|
+
const replyPayload = {
|
|
1280
|
+
type: "new-message",
|
|
1281
|
+
data: {
|
|
1282
|
+
text: "replying now",
|
|
1283
|
+
handle: { address: "+15551234567" },
|
|
1284
|
+
isGroup: true,
|
|
1285
|
+
isFromMe: false,
|
|
1286
|
+
guid: "cache-msg-1",
|
|
1287
|
+
chatGuid,
|
|
1288
|
+
// Only the GUID is provided; sender/body must be hydrated.
|
|
1289
|
+
replyToMessageGuid: "cache-msg-0",
|
|
1290
|
+
date: Date.now(),
|
|
1291
|
+
},
|
|
1292
|
+
};
|
|
1293
|
+
|
|
1294
|
+
const replyReq = createMockRequest("POST", "/bluebubbles-webhook", replyPayload);
|
|
1295
|
+
const replyRes = createMockResponse();
|
|
1296
|
+
|
|
1297
|
+
await handleBlueBubblesWebhookRequest(replyReq, replyRes);
|
|
1298
|
+
await flushAsync();
|
|
1299
|
+
|
|
1300
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
|
|
1301
|
+
const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
|
|
1302
|
+
// ReplyToId uses short ID "1" (first cached message) for token savings
|
|
1303
|
+
expect(callArgs.ctx.ReplyToId).toBe("1");
|
|
1304
|
+
expect(callArgs.ctx.ReplyToIdFull).toBe("cache-msg-0");
|
|
1305
|
+
expect(callArgs.ctx.ReplyToBody).toBe("original message (cached)");
|
|
1306
|
+
expect(callArgs.ctx.ReplyToSender).toBe("+15550000000");
|
|
1307
|
+
// Body uses inline [[reply_to:N]] tag format with short ID
|
|
1308
|
+
expect(callArgs.ctx.Body).toContain("[[reply_to:1]]");
|
|
1309
|
+
});
|
|
1310
|
+
|
|
1311
|
+
it("falls back to threadOriginatorGuid when reply metadata is absent", async () => {
|
|
1312
|
+
const account = createMockAccount({ dmPolicy: "open" });
|
|
1313
|
+
const config: ClawdbotConfig = {};
|
|
1314
|
+
const core = createMockRuntime();
|
|
1315
|
+
setBlueBubblesRuntime(core);
|
|
1316
|
+
|
|
1317
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1318
|
+
account,
|
|
1319
|
+
config,
|
|
1320
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1321
|
+
core,
|
|
1322
|
+
path: "/bluebubbles-webhook",
|
|
1323
|
+
});
|
|
1324
|
+
|
|
1325
|
+
const payload = {
|
|
1326
|
+
type: "new-message",
|
|
1327
|
+
data: {
|
|
1328
|
+
text: "replying now",
|
|
1329
|
+
handle: { address: "+15551234567" },
|
|
1330
|
+
isGroup: false,
|
|
1331
|
+
isFromMe: false,
|
|
1332
|
+
guid: "msg-1",
|
|
1333
|
+
threadOriginatorGuid: "msg-0",
|
|
1334
|
+
chatGuid: "iMessage;-;+15551234567",
|
|
1335
|
+
date: Date.now(),
|
|
1336
|
+
},
|
|
1337
|
+
};
|
|
1338
|
+
|
|
1339
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1340
|
+
const res = createMockResponse();
|
|
1341
|
+
|
|
1342
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1343
|
+
await flushAsync();
|
|
1344
|
+
|
|
1345
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
|
|
1346
|
+
const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
|
|
1347
|
+
expect(callArgs.ctx.ReplyToId).toBe("msg-0");
|
|
1348
|
+
});
|
|
1349
|
+
});
|
|
1350
|
+
|
|
1351
|
+
describe("tapback text parsing", () => {
|
|
1352
|
+
it("does not rewrite tapback-like text without metadata", async () => {
|
|
1353
|
+
const account = createMockAccount({ dmPolicy: "open" });
|
|
1354
|
+
const config: ClawdbotConfig = {};
|
|
1355
|
+
const core = createMockRuntime();
|
|
1356
|
+
setBlueBubblesRuntime(core);
|
|
1357
|
+
|
|
1358
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1359
|
+
account,
|
|
1360
|
+
config,
|
|
1361
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1362
|
+
core,
|
|
1363
|
+
path: "/bluebubbles-webhook",
|
|
1364
|
+
});
|
|
1365
|
+
|
|
1366
|
+
const payload = {
|
|
1367
|
+
type: "new-message",
|
|
1368
|
+
data: {
|
|
1369
|
+
text: "Loved this idea",
|
|
1370
|
+
handle: { address: "+15551234567" },
|
|
1371
|
+
isGroup: false,
|
|
1372
|
+
isFromMe: false,
|
|
1373
|
+
guid: "msg-1",
|
|
1374
|
+
chatGuid: "iMessage;-;+15551234567",
|
|
1375
|
+
date: Date.now(),
|
|
1376
|
+
},
|
|
1377
|
+
};
|
|
1378
|
+
|
|
1379
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1380
|
+
const res = createMockResponse();
|
|
1381
|
+
|
|
1382
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1383
|
+
await flushAsync();
|
|
1384
|
+
|
|
1385
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
|
|
1386
|
+
const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
|
|
1387
|
+
expect(callArgs.ctx.RawBody).toBe("Loved this idea");
|
|
1388
|
+
expect(callArgs.ctx.Body).toContain("Loved this idea");
|
|
1389
|
+
expect(callArgs.ctx.Body).not.toContain("reacted with");
|
|
1390
|
+
});
|
|
1391
|
+
|
|
1392
|
+
it("parses tapback text with custom emoji when metadata is present", async () => {
|
|
1393
|
+
const account = createMockAccount({ dmPolicy: "open" });
|
|
1394
|
+
const config: ClawdbotConfig = {};
|
|
1395
|
+
const core = createMockRuntime();
|
|
1396
|
+
setBlueBubblesRuntime(core);
|
|
1397
|
+
|
|
1398
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1399
|
+
account,
|
|
1400
|
+
config,
|
|
1401
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1402
|
+
core,
|
|
1403
|
+
path: "/bluebubbles-webhook",
|
|
1404
|
+
});
|
|
1405
|
+
|
|
1406
|
+
const payload = {
|
|
1407
|
+
type: "new-message",
|
|
1408
|
+
data: {
|
|
1409
|
+
text: 'Reacted 😅 to "nice one"',
|
|
1410
|
+
handle: { address: "+15551234567" },
|
|
1411
|
+
isGroup: false,
|
|
1412
|
+
isFromMe: false,
|
|
1413
|
+
guid: "msg-2",
|
|
1414
|
+
chatGuid: "iMessage;-;+15551234567",
|
|
1415
|
+
date: Date.now(),
|
|
1416
|
+
},
|
|
1417
|
+
};
|
|
1418
|
+
|
|
1419
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1420
|
+
const res = createMockResponse();
|
|
1421
|
+
|
|
1422
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1423
|
+
await flushAsync();
|
|
1424
|
+
|
|
1425
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
|
|
1426
|
+
const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
|
|
1427
|
+
expect(callArgs.ctx.RawBody).toBe("reacted with 😅");
|
|
1428
|
+
expect(callArgs.ctx.Body).toContain("reacted with 😅");
|
|
1429
|
+
expect(callArgs.ctx.Body).not.toContain("[[reply_to:");
|
|
1430
|
+
});
|
|
1431
|
+
});
|
|
1432
|
+
|
|
1433
|
+
describe("ack reactions", () => {
|
|
1434
|
+
it("sends ack reaction when configured", async () => {
|
|
1435
|
+
const { sendBlueBubblesReaction } = await import("./reactions.js");
|
|
1436
|
+
vi.mocked(sendBlueBubblesReaction).mockClear();
|
|
1437
|
+
|
|
1438
|
+
const account = createMockAccount({ dmPolicy: "open" });
|
|
1439
|
+
const config: ClawdbotConfig = {
|
|
1440
|
+
messages: {
|
|
1441
|
+
ackReaction: "❤️",
|
|
1442
|
+
ackReactionScope: "direct",
|
|
1443
|
+
},
|
|
1444
|
+
};
|
|
1445
|
+
const core = createMockRuntime();
|
|
1446
|
+
setBlueBubblesRuntime(core);
|
|
1447
|
+
|
|
1448
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1449
|
+
account,
|
|
1450
|
+
config,
|
|
1451
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1452
|
+
core,
|
|
1453
|
+
path: "/bluebubbles-webhook",
|
|
1454
|
+
});
|
|
1455
|
+
|
|
1456
|
+
const payload = {
|
|
1457
|
+
type: "new-message",
|
|
1458
|
+
data: {
|
|
1459
|
+
text: "hello",
|
|
1460
|
+
handle: { address: "+15551234567" },
|
|
1461
|
+
isGroup: false,
|
|
1462
|
+
isFromMe: false,
|
|
1463
|
+
guid: "msg-1",
|
|
1464
|
+
chatGuid: "iMessage;-;+15551234567",
|
|
1465
|
+
date: Date.now(),
|
|
1466
|
+
},
|
|
1467
|
+
};
|
|
1468
|
+
|
|
1469
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1470
|
+
const res = createMockResponse();
|
|
1471
|
+
|
|
1472
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1473
|
+
await flushAsync();
|
|
1474
|
+
|
|
1475
|
+
expect(sendBlueBubblesReaction).toHaveBeenCalledWith(
|
|
1476
|
+
expect.objectContaining({
|
|
1477
|
+
chatGuid: "iMessage;-;+15551234567",
|
|
1478
|
+
messageGuid: "msg-1",
|
|
1479
|
+
emoji: "❤️",
|
|
1480
|
+
opts: expect.objectContaining({ accountId: "default" }),
|
|
1481
|
+
}),
|
|
1482
|
+
);
|
|
1483
|
+
});
|
|
1484
|
+
});
|
|
1485
|
+
|
|
1486
|
+
describe("command gating", () => {
|
|
1487
|
+
it("allows control command to bypass mention gating when authorized", async () => {
|
|
1488
|
+
mockResolveRequireMention.mockReturnValue(true);
|
|
1489
|
+
mockMatchesMentionPatterns.mockReturnValue(false); // Not mentioned
|
|
1490
|
+
mockHasControlCommand.mockReturnValue(true); // Has control command
|
|
1491
|
+
mockResolveCommandAuthorizedFromAuthorizers.mockReturnValue(true); // Authorized
|
|
1492
|
+
|
|
1493
|
+
const account = createMockAccount({
|
|
1494
|
+
groupPolicy: "open",
|
|
1495
|
+
allowFrom: ["+15551234567"],
|
|
1496
|
+
});
|
|
1497
|
+
const config: ClawdbotConfig = {};
|
|
1498
|
+
const core = createMockRuntime();
|
|
1499
|
+
setBlueBubblesRuntime(core);
|
|
1500
|
+
|
|
1501
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1502
|
+
account,
|
|
1503
|
+
config,
|
|
1504
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1505
|
+
core,
|
|
1506
|
+
path: "/bluebubbles-webhook",
|
|
1507
|
+
});
|
|
1508
|
+
|
|
1509
|
+
const payload = {
|
|
1510
|
+
type: "new-message",
|
|
1511
|
+
data: {
|
|
1512
|
+
text: "/status",
|
|
1513
|
+
handle: { address: "+15551234567" },
|
|
1514
|
+
isGroup: true,
|
|
1515
|
+
isFromMe: false,
|
|
1516
|
+
guid: "msg-1",
|
|
1517
|
+
chatGuid: "iMessage;+;chat123456",
|
|
1518
|
+
date: Date.now(),
|
|
1519
|
+
},
|
|
1520
|
+
};
|
|
1521
|
+
|
|
1522
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1523
|
+
const res = createMockResponse();
|
|
1524
|
+
|
|
1525
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1526
|
+
await flushAsync();
|
|
1527
|
+
|
|
1528
|
+
// Should process even without mention because it's an authorized control command
|
|
1529
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
|
|
1530
|
+
});
|
|
1531
|
+
|
|
1532
|
+
it("blocks control command from unauthorized sender in group", async () => {
|
|
1533
|
+
mockHasControlCommand.mockReturnValue(true);
|
|
1534
|
+
mockResolveCommandAuthorizedFromAuthorizers.mockReturnValue(false);
|
|
1535
|
+
|
|
1536
|
+
const account = createMockAccount({
|
|
1537
|
+
groupPolicy: "open",
|
|
1538
|
+
allowFrom: [], // No one authorized
|
|
1539
|
+
});
|
|
1540
|
+
const config: ClawdbotConfig = {};
|
|
1541
|
+
const core = createMockRuntime();
|
|
1542
|
+
setBlueBubblesRuntime(core);
|
|
1543
|
+
|
|
1544
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1545
|
+
account,
|
|
1546
|
+
config,
|
|
1547
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1548
|
+
core,
|
|
1549
|
+
path: "/bluebubbles-webhook",
|
|
1550
|
+
});
|
|
1551
|
+
|
|
1552
|
+
const payload = {
|
|
1553
|
+
type: "new-message",
|
|
1554
|
+
data: {
|
|
1555
|
+
text: "/status",
|
|
1556
|
+
handle: { address: "+15559999999" },
|
|
1557
|
+
isGroup: true,
|
|
1558
|
+
isFromMe: false,
|
|
1559
|
+
guid: "msg-1",
|
|
1560
|
+
chatGuid: "iMessage;+;chat123456",
|
|
1561
|
+
date: Date.now(),
|
|
1562
|
+
},
|
|
1563
|
+
};
|
|
1564
|
+
|
|
1565
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1566
|
+
const res = createMockResponse();
|
|
1567
|
+
|
|
1568
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1569
|
+
await flushAsync();
|
|
1570
|
+
|
|
1571
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).not.toHaveBeenCalled();
|
|
1572
|
+
});
|
|
1573
|
+
});
|
|
1574
|
+
|
|
1575
|
+
describe("typing/read receipt toggles", () => {
|
|
1576
|
+
it("marks chat as read when sendReadReceipts=true (default)", async () => {
|
|
1577
|
+
const { markBlueBubblesChatRead } = await import("./chat.js");
|
|
1578
|
+
vi.mocked(markBlueBubblesChatRead).mockClear();
|
|
1579
|
+
|
|
1580
|
+
const account = createMockAccount({
|
|
1581
|
+
sendReadReceipts: true,
|
|
1582
|
+
});
|
|
1583
|
+
const config: ClawdbotConfig = {};
|
|
1584
|
+
const core = createMockRuntime();
|
|
1585
|
+
setBlueBubblesRuntime(core);
|
|
1586
|
+
|
|
1587
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1588
|
+
account,
|
|
1589
|
+
config,
|
|
1590
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1591
|
+
core,
|
|
1592
|
+
path: "/bluebubbles-webhook",
|
|
1593
|
+
});
|
|
1594
|
+
|
|
1595
|
+
const payload = {
|
|
1596
|
+
type: "new-message",
|
|
1597
|
+
data: {
|
|
1598
|
+
text: "hello",
|
|
1599
|
+
handle: { address: "+15551234567" },
|
|
1600
|
+
isGroup: false,
|
|
1601
|
+
isFromMe: false,
|
|
1602
|
+
guid: "msg-1",
|
|
1603
|
+
chatGuid: "iMessage;-;+15551234567",
|
|
1604
|
+
date: Date.now(),
|
|
1605
|
+
},
|
|
1606
|
+
};
|
|
1607
|
+
|
|
1608
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1609
|
+
const res = createMockResponse();
|
|
1610
|
+
|
|
1611
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1612
|
+
await flushAsync();
|
|
1613
|
+
|
|
1614
|
+
expect(markBlueBubblesChatRead).toHaveBeenCalled();
|
|
1615
|
+
});
|
|
1616
|
+
|
|
1617
|
+
it("does not mark chat as read when sendReadReceipts=false", async () => {
|
|
1618
|
+
const { markBlueBubblesChatRead } = await import("./chat.js");
|
|
1619
|
+
vi.mocked(markBlueBubblesChatRead).mockClear();
|
|
1620
|
+
|
|
1621
|
+
const account = createMockAccount({
|
|
1622
|
+
sendReadReceipts: false,
|
|
1623
|
+
});
|
|
1624
|
+
const config: ClawdbotConfig = {};
|
|
1625
|
+
const core = createMockRuntime();
|
|
1626
|
+
setBlueBubblesRuntime(core);
|
|
1627
|
+
|
|
1628
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1629
|
+
account,
|
|
1630
|
+
config,
|
|
1631
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1632
|
+
core,
|
|
1633
|
+
path: "/bluebubbles-webhook",
|
|
1634
|
+
});
|
|
1635
|
+
|
|
1636
|
+
const payload = {
|
|
1637
|
+
type: "new-message",
|
|
1638
|
+
data: {
|
|
1639
|
+
text: "hello",
|
|
1640
|
+
handle: { address: "+15551234567" },
|
|
1641
|
+
isGroup: false,
|
|
1642
|
+
isFromMe: false,
|
|
1643
|
+
guid: "msg-1",
|
|
1644
|
+
chatGuid: "iMessage;-;+15551234567",
|
|
1645
|
+
date: Date.now(),
|
|
1646
|
+
},
|
|
1647
|
+
};
|
|
1648
|
+
|
|
1649
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1650
|
+
const res = createMockResponse();
|
|
1651
|
+
|
|
1652
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1653
|
+
await flushAsync();
|
|
1654
|
+
|
|
1655
|
+
expect(markBlueBubblesChatRead).not.toHaveBeenCalled();
|
|
1656
|
+
});
|
|
1657
|
+
|
|
1658
|
+
it("sends typing indicator when processing message", async () => {
|
|
1659
|
+
const { sendBlueBubblesTyping } = await import("./chat.js");
|
|
1660
|
+
vi.mocked(sendBlueBubblesTyping).mockClear();
|
|
1661
|
+
|
|
1662
|
+
const account = createMockAccount();
|
|
1663
|
+
const config: ClawdbotConfig = {};
|
|
1664
|
+
const core = createMockRuntime();
|
|
1665
|
+
setBlueBubblesRuntime(core);
|
|
1666
|
+
|
|
1667
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1668
|
+
account,
|
|
1669
|
+
config,
|
|
1670
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1671
|
+
core,
|
|
1672
|
+
path: "/bluebubbles-webhook",
|
|
1673
|
+
});
|
|
1674
|
+
|
|
1675
|
+
const payload = {
|
|
1676
|
+
type: "new-message",
|
|
1677
|
+
data: {
|
|
1678
|
+
text: "hello",
|
|
1679
|
+
handle: { address: "+15551234567" },
|
|
1680
|
+
isGroup: false,
|
|
1681
|
+
isFromMe: false,
|
|
1682
|
+
guid: "msg-1",
|
|
1683
|
+
chatGuid: "iMessage;-;+15551234567",
|
|
1684
|
+
date: Date.now(),
|
|
1685
|
+
},
|
|
1686
|
+
};
|
|
1687
|
+
|
|
1688
|
+
mockDispatchReplyWithBufferedBlockDispatcher.mockImplementationOnce(async (params) => {
|
|
1689
|
+
await params.dispatcherOptions.onReplyStart?.();
|
|
1690
|
+
});
|
|
1691
|
+
|
|
1692
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1693
|
+
const res = createMockResponse();
|
|
1694
|
+
|
|
1695
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1696
|
+
await flushAsync();
|
|
1697
|
+
|
|
1698
|
+
// Should call typing start when reply flow triggers it.
|
|
1699
|
+
expect(sendBlueBubblesTyping).toHaveBeenCalledWith(
|
|
1700
|
+
expect.any(String),
|
|
1701
|
+
true,
|
|
1702
|
+
expect.any(Object),
|
|
1703
|
+
);
|
|
1704
|
+
});
|
|
1705
|
+
|
|
1706
|
+
it("stops typing on idle", async () => {
|
|
1707
|
+
const { sendBlueBubblesTyping } = await import("./chat.js");
|
|
1708
|
+
vi.mocked(sendBlueBubblesTyping).mockClear();
|
|
1709
|
+
|
|
1710
|
+
const account = createMockAccount();
|
|
1711
|
+
const config: ClawdbotConfig = {};
|
|
1712
|
+
const core = createMockRuntime();
|
|
1713
|
+
setBlueBubblesRuntime(core);
|
|
1714
|
+
|
|
1715
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1716
|
+
account,
|
|
1717
|
+
config,
|
|
1718
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1719
|
+
core,
|
|
1720
|
+
path: "/bluebubbles-webhook",
|
|
1721
|
+
});
|
|
1722
|
+
|
|
1723
|
+
const payload = {
|
|
1724
|
+
type: "new-message",
|
|
1725
|
+
data: {
|
|
1726
|
+
text: "hello",
|
|
1727
|
+
handle: { address: "+15551234567" },
|
|
1728
|
+
isGroup: false,
|
|
1729
|
+
isFromMe: false,
|
|
1730
|
+
guid: "msg-1",
|
|
1731
|
+
chatGuid: "iMessage;-;+15551234567",
|
|
1732
|
+
date: Date.now(),
|
|
1733
|
+
},
|
|
1734
|
+
};
|
|
1735
|
+
|
|
1736
|
+
mockDispatchReplyWithBufferedBlockDispatcher.mockImplementationOnce(async (params) => {
|
|
1737
|
+
await params.dispatcherOptions.onReplyStart?.();
|
|
1738
|
+
await params.dispatcherOptions.deliver({ text: "replying now" }, { kind: "final" });
|
|
1739
|
+
await params.dispatcherOptions.onIdle?.();
|
|
1740
|
+
});
|
|
1741
|
+
|
|
1742
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1743
|
+
const res = createMockResponse();
|
|
1744
|
+
|
|
1745
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1746
|
+
await flushAsync();
|
|
1747
|
+
|
|
1748
|
+
expect(sendBlueBubblesTyping).toHaveBeenCalledWith(
|
|
1749
|
+
expect.any(String),
|
|
1750
|
+
false,
|
|
1751
|
+
expect.any(Object),
|
|
1752
|
+
);
|
|
1753
|
+
});
|
|
1754
|
+
|
|
1755
|
+
it("stops typing when no reply is sent", async () => {
|
|
1756
|
+
const { sendBlueBubblesTyping } = await import("./chat.js");
|
|
1757
|
+
vi.mocked(sendBlueBubblesTyping).mockClear();
|
|
1758
|
+
|
|
1759
|
+
const account = createMockAccount();
|
|
1760
|
+
const config: ClawdbotConfig = {};
|
|
1761
|
+
const core = createMockRuntime();
|
|
1762
|
+
setBlueBubblesRuntime(core);
|
|
1763
|
+
|
|
1764
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1765
|
+
account,
|
|
1766
|
+
config,
|
|
1767
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1768
|
+
core,
|
|
1769
|
+
path: "/bluebubbles-webhook",
|
|
1770
|
+
});
|
|
1771
|
+
|
|
1772
|
+
const payload = {
|
|
1773
|
+
type: "new-message",
|
|
1774
|
+
data: {
|
|
1775
|
+
text: "hello",
|
|
1776
|
+
handle: { address: "+15551234567" },
|
|
1777
|
+
isGroup: false,
|
|
1778
|
+
isFromMe: false,
|
|
1779
|
+
guid: "msg-1",
|
|
1780
|
+
chatGuid: "iMessage;-;+15551234567",
|
|
1781
|
+
date: Date.now(),
|
|
1782
|
+
},
|
|
1783
|
+
};
|
|
1784
|
+
|
|
1785
|
+
mockDispatchReplyWithBufferedBlockDispatcher.mockImplementationOnce(async () => undefined);
|
|
1786
|
+
|
|
1787
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1788
|
+
const res = createMockResponse();
|
|
1789
|
+
|
|
1790
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1791
|
+
await flushAsync();
|
|
1792
|
+
|
|
1793
|
+
expect(sendBlueBubblesTyping).toHaveBeenCalledWith(
|
|
1794
|
+
expect.any(String),
|
|
1795
|
+
false,
|
|
1796
|
+
expect.any(Object),
|
|
1797
|
+
);
|
|
1798
|
+
});
|
|
1799
|
+
});
|
|
1800
|
+
|
|
1801
|
+
describe("outbound message ids", () => {
|
|
1802
|
+
it("enqueues system event for outbound message id", async () => {
|
|
1803
|
+
mockEnqueueSystemEvent.mockClear();
|
|
1804
|
+
|
|
1805
|
+
mockDispatchReplyWithBufferedBlockDispatcher.mockImplementationOnce(async (params) => {
|
|
1806
|
+
await params.dispatcherOptions.deliver({ text: "replying now" }, { kind: "final" });
|
|
1807
|
+
});
|
|
1808
|
+
|
|
1809
|
+
const account = createMockAccount();
|
|
1810
|
+
const config: ClawdbotConfig = {};
|
|
1811
|
+
const core = createMockRuntime();
|
|
1812
|
+
setBlueBubblesRuntime(core);
|
|
1813
|
+
|
|
1814
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1815
|
+
account,
|
|
1816
|
+
config,
|
|
1817
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1818
|
+
core,
|
|
1819
|
+
path: "/bluebubbles-webhook",
|
|
1820
|
+
});
|
|
1821
|
+
|
|
1822
|
+
const payload = {
|
|
1823
|
+
type: "new-message",
|
|
1824
|
+
data: {
|
|
1825
|
+
text: "hello",
|
|
1826
|
+
handle: { address: "+15551234567" },
|
|
1827
|
+
isGroup: false,
|
|
1828
|
+
isFromMe: false,
|
|
1829
|
+
guid: "msg-1",
|
|
1830
|
+
chatGuid: "iMessage;-;+15551234567",
|
|
1831
|
+
date: Date.now(),
|
|
1832
|
+
},
|
|
1833
|
+
};
|
|
1834
|
+
|
|
1835
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1836
|
+
const res = createMockResponse();
|
|
1837
|
+
|
|
1838
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1839
|
+
await flushAsync();
|
|
1840
|
+
|
|
1841
|
+
// Outbound message ID uses short ID "2" (inbound msg-1 is "1", outbound msg-123 is "2")
|
|
1842
|
+
expect(mockEnqueueSystemEvent).toHaveBeenCalledWith(
|
|
1843
|
+
'Assistant sent "replying now" [message_id:2]',
|
|
1844
|
+
expect.objectContaining({
|
|
1845
|
+
sessionKey: "agent:main:bluebubbles:dm:+15551234567",
|
|
1846
|
+
}),
|
|
1847
|
+
);
|
|
1848
|
+
});
|
|
1849
|
+
});
|
|
1850
|
+
|
|
1851
|
+
describe("reaction events", () => {
|
|
1852
|
+
it("enqueues system event for reaction added", async () => {
|
|
1853
|
+
mockEnqueueSystemEvent.mockClear();
|
|
1854
|
+
|
|
1855
|
+
const account = createMockAccount();
|
|
1856
|
+
const config: ClawdbotConfig = {};
|
|
1857
|
+
const core = createMockRuntime();
|
|
1858
|
+
setBlueBubblesRuntime(core);
|
|
1859
|
+
|
|
1860
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1861
|
+
account,
|
|
1862
|
+
config,
|
|
1863
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1864
|
+
core,
|
|
1865
|
+
path: "/bluebubbles-webhook",
|
|
1866
|
+
});
|
|
1867
|
+
|
|
1868
|
+
const payload = {
|
|
1869
|
+
type: "message-reaction",
|
|
1870
|
+
data: {
|
|
1871
|
+
handle: { address: "+15551234567" },
|
|
1872
|
+
isGroup: false,
|
|
1873
|
+
isFromMe: false,
|
|
1874
|
+
associatedMessageGuid: "msg-original-123",
|
|
1875
|
+
associatedMessageType: 2000, // Heart reaction added
|
|
1876
|
+
date: Date.now(),
|
|
1877
|
+
},
|
|
1878
|
+
};
|
|
1879
|
+
|
|
1880
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1881
|
+
const res = createMockResponse();
|
|
1882
|
+
|
|
1883
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1884
|
+
await flushAsync();
|
|
1885
|
+
|
|
1886
|
+
expect(mockEnqueueSystemEvent).toHaveBeenCalledWith(
|
|
1887
|
+
expect.stringContaining("reacted with ❤️ [[reply_to:"),
|
|
1888
|
+
expect.any(Object),
|
|
1889
|
+
);
|
|
1890
|
+
});
|
|
1891
|
+
|
|
1892
|
+
it("enqueues system event for reaction removed", async () => {
|
|
1893
|
+
mockEnqueueSystemEvent.mockClear();
|
|
1894
|
+
|
|
1895
|
+
const account = createMockAccount();
|
|
1896
|
+
const config: ClawdbotConfig = {};
|
|
1897
|
+
const core = createMockRuntime();
|
|
1898
|
+
setBlueBubblesRuntime(core);
|
|
1899
|
+
|
|
1900
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1901
|
+
account,
|
|
1902
|
+
config,
|
|
1903
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1904
|
+
core,
|
|
1905
|
+
path: "/bluebubbles-webhook",
|
|
1906
|
+
});
|
|
1907
|
+
|
|
1908
|
+
const payload = {
|
|
1909
|
+
type: "message-reaction",
|
|
1910
|
+
data: {
|
|
1911
|
+
handle: { address: "+15551234567" },
|
|
1912
|
+
isGroup: false,
|
|
1913
|
+
isFromMe: false,
|
|
1914
|
+
associatedMessageGuid: "msg-original-123",
|
|
1915
|
+
associatedMessageType: 3000, // Heart reaction removed
|
|
1916
|
+
date: Date.now(),
|
|
1917
|
+
},
|
|
1918
|
+
};
|
|
1919
|
+
|
|
1920
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1921
|
+
const res = createMockResponse();
|
|
1922
|
+
|
|
1923
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1924
|
+
await flushAsync();
|
|
1925
|
+
|
|
1926
|
+
expect(mockEnqueueSystemEvent).toHaveBeenCalledWith(
|
|
1927
|
+
expect.stringContaining("removed ❤️ reaction [[reply_to:"),
|
|
1928
|
+
expect.any(Object),
|
|
1929
|
+
);
|
|
1930
|
+
});
|
|
1931
|
+
|
|
1932
|
+
it("ignores reaction from self (fromMe=true)", async () => {
|
|
1933
|
+
mockEnqueueSystemEvent.mockClear();
|
|
1934
|
+
|
|
1935
|
+
const account = createMockAccount();
|
|
1936
|
+
const config: ClawdbotConfig = {};
|
|
1937
|
+
const core = createMockRuntime();
|
|
1938
|
+
setBlueBubblesRuntime(core);
|
|
1939
|
+
|
|
1940
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1941
|
+
account,
|
|
1942
|
+
config,
|
|
1943
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1944
|
+
core,
|
|
1945
|
+
path: "/bluebubbles-webhook",
|
|
1946
|
+
});
|
|
1947
|
+
|
|
1948
|
+
const payload = {
|
|
1949
|
+
type: "message-reaction",
|
|
1950
|
+
data: {
|
|
1951
|
+
handle: { address: "+15551234567" },
|
|
1952
|
+
isGroup: false,
|
|
1953
|
+
isFromMe: true, // From self
|
|
1954
|
+
associatedMessageGuid: "msg-original-123",
|
|
1955
|
+
associatedMessageType: 2000,
|
|
1956
|
+
date: Date.now(),
|
|
1957
|
+
},
|
|
1958
|
+
};
|
|
1959
|
+
|
|
1960
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1961
|
+
const res = createMockResponse();
|
|
1962
|
+
|
|
1963
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
1964
|
+
await flushAsync();
|
|
1965
|
+
|
|
1966
|
+
expect(mockEnqueueSystemEvent).not.toHaveBeenCalled();
|
|
1967
|
+
});
|
|
1968
|
+
|
|
1969
|
+
it("maps reaction types to correct emojis", async () => {
|
|
1970
|
+
mockEnqueueSystemEvent.mockClear();
|
|
1971
|
+
|
|
1972
|
+
const account = createMockAccount();
|
|
1973
|
+
const config: ClawdbotConfig = {};
|
|
1974
|
+
const core = createMockRuntime();
|
|
1975
|
+
setBlueBubblesRuntime(core);
|
|
1976
|
+
|
|
1977
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
1978
|
+
account,
|
|
1979
|
+
config,
|
|
1980
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
1981
|
+
core,
|
|
1982
|
+
path: "/bluebubbles-webhook",
|
|
1983
|
+
});
|
|
1984
|
+
|
|
1985
|
+
// Test thumbs up reaction (2001)
|
|
1986
|
+
const payload = {
|
|
1987
|
+
type: "message-reaction",
|
|
1988
|
+
data: {
|
|
1989
|
+
handle: { address: "+15551234567" },
|
|
1990
|
+
isGroup: false,
|
|
1991
|
+
isFromMe: false,
|
|
1992
|
+
associatedMessageGuid: "msg-123",
|
|
1993
|
+
associatedMessageType: 2001, // Thumbs up
|
|
1994
|
+
date: Date.now(),
|
|
1995
|
+
},
|
|
1996
|
+
};
|
|
1997
|
+
|
|
1998
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
1999
|
+
const res = createMockResponse();
|
|
2000
|
+
|
|
2001
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
2002
|
+
await flushAsync();
|
|
2003
|
+
|
|
2004
|
+
expect(mockEnqueueSystemEvent).toHaveBeenCalledWith(
|
|
2005
|
+
expect.stringContaining("👍"),
|
|
2006
|
+
expect.any(Object),
|
|
2007
|
+
);
|
|
2008
|
+
});
|
|
2009
|
+
});
|
|
2010
|
+
|
|
2011
|
+
describe("short message ID mapping", () => {
|
|
2012
|
+
it("assigns sequential short IDs to messages", async () => {
|
|
2013
|
+
const account = createMockAccount({ dmPolicy: "open" });
|
|
2014
|
+
const config: ClawdbotConfig = {};
|
|
2015
|
+
const core = createMockRuntime();
|
|
2016
|
+
setBlueBubblesRuntime(core);
|
|
2017
|
+
|
|
2018
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
2019
|
+
account,
|
|
2020
|
+
config,
|
|
2021
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
2022
|
+
core,
|
|
2023
|
+
path: "/bluebubbles-webhook",
|
|
2024
|
+
});
|
|
2025
|
+
|
|
2026
|
+
const payload = {
|
|
2027
|
+
type: "new-message",
|
|
2028
|
+
data: {
|
|
2029
|
+
text: "hello",
|
|
2030
|
+
handle: { address: "+15551234567" },
|
|
2031
|
+
isGroup: false,
|
|
2032
|
+
isFromMe: false,
|
|
2033
|
+
guid: "p:1/msg-uuid-12345",
|
|
2034
|
+
chatGuid: "iMessage;-;+15551234567",
|
|
2035
|
+
date: Date.now(),
|
|
2036
|
+
},
|
|
2037
|
+
};
|
|
2038
|
+
|
|
2039
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
2040
|
+
const res = createMockResponse();
|
|
2041
|
+
|
|
2042
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
2043
|
+
await flushAsync();
|
|
2044
|
+
|
|
2045
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).toHaveBeenCalled();
|
|
2046
|
+
const callArgs = mockDispatchReplyWithBufferedBlockDispatcher.mock.calls[0][0];
|
|
2047
|
+
// MessageSid should be short ID "1" instead of full UUID
|
|
2048
|
+
expect(callArgs.ctx.MessageSid).toBe("1");
|
|
2049
|
+
expect(callArgs.ctx.MessageSidFull).toBe("p:1/msg-uuid-12345");
|
|
2050
|
+
});
|
|
2051
|
+
|
|
2052
|
+
it("resolves short ID back to UUID", async () => {
|
|
2053
|
+
const account = createMockAccount({ dmPolicy: "open" });
|
|
2054
|
+
const config: ClawdbotConfig = {};
|
|
2055
|
+
const core = createMockRuntime();
|
|
2056
|
+
setBlueBubblesRuntime(core);
|
|
2057
|
+
|
|
2058
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
2059
|
+
account,
|
|
2060
|
+
config,
|
|
2061
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
2062
|
+
core,
|
|
2063
|
+
path: "/bluebubbles-webhook",
|
|
2064
|
+
});
|
|
2065
|
+
|
|
2066
|
+
const payload = {
|
|
2067
|
+
type: "new-message",
|
|
2068
|
+
data: {
|
|
2069
|
+
text: "hello",
|
|
2070
|
+
handle: { address: "+15551234567" },
|
|
2071
|
+
isGroup: false,
|
|
2072
|
+
isFromMe: false,
|
|
2073
|
+
guid: "p:1/msg-uuid-12345",
|
|
2074
|
+
chatGuid: "iMessage;-;+15551234567",
|
|
2075
|
+
date: Date.now(),
|
|
2076
|
+
},
|
|
2077
|
+
};
|
|
2078
|
+
|
|
2079
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
2080
|
+
const res = createMockResponse();
|
|
2081
|
+
|
|
2082
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
2083
|
+
await flushAsync();
|
|
2084
|
+
|
|
2085
|
+
// The short ID "1" should resolve back to the full UUID
|
|
2086
|
+
expect(resolveBlueBubblesMessageId("1")).toBe("p:1/msg-uuid-12345");
|
|
2087
|
+
});
|
|
2088
|
+
|
|
2089
|
+
it("returns UUID unchanged when not in cache", () => {
|
|
2090
|
+
expect(resolveBlueBubblesMessageId("msg-not-cached")).toBe("msg-not-cached");
|
|
2091
|
+
});
|
|
2092
|
+
|
|
2093
|
+
it("returns short ID unchanged when numeric but not in cache", () => {
|
|
2094
|
+
expect(resolveBlueBubblesMessageId("999")).toBe("999");
|
|
2095
|
+
});
|
|
2096
|
+
|
|
2097
|
+
it("throws when numeric short ID is missing and requireKnownShortId is set", () => {
|
|
2098
|
+
expect(() =>
|
|
2099
|
+
resolveBlueBubblesMessageId("999", { requireKnownShortId: true }),
|
|
2100
|
+
).toThrow(/short message id/i);
|
|
2101
|
+
});
|
|
2102
|
+
});
|
|
2103
|
+
|
|
2104
|
+
describe("fromMe messages", () => {
|
|
2105
|
+
it("ignores messages from self (fromMe=true)", async () => {
|
|
2106
|
+
const account = createMockAccount();
|
|
2107
|
+
const config: ClawdbotConfig = {};
|
|
2108
|
+
const core = createMockRuntime();
|
|
2109
|
+
setBlueBubblesRuntime(core);
|
|
2110
|
+
|
|
2111
|
+
unregister = registerBlueBubblesWebhookTarget({
|
|
2112
|
+
account,
|
|
2113
|
+
config,
|
|
2114
|
+
runtime: { log: vi.fn(), error: vi.fn() },
|
|
2115
|
+
core,
|
|
2116
|
+
path: "/bluebubbles-webhook",
|
|
2117
|
+
});
|
|
2118
|
+
|
|
2119
|
+
const payload = {
|
|
2120
|
+
type: "new-message",
|
|
2121
|
+
data: {
|
|
2122
|
+
text: "my own message",
|
|
2123
|
+
handle: { address: "+15551234567" },
|
|
2124
|
+
isGroup: false,
|
|
2125
|
+
isFromMe: true,
|
|
2126
|
+
guid: "msg-1",
|
|
2127
|
+
date: Date.now(),
|
|
2128
|
+
},
|
|
2129
|
+
};
|
|
2130
|
+
|
|
2131
|
+
const req = createMockRequest("POST", "/bluebubbles-webhook", payload);
|
|
2132
|
+
const res = createMockResponse();
|
|
2133
|
+
|
|
2134
|
+
await handleBlueBubblesWebhookRequest(req, res);
|
|
2135
|
+
await flushAsync();
|
|
2136
|
+
|
|
2137
|
+
expect(mockDispatchReplyWithBufferedBlockDispatcher).not.toHaveBeenCalled();
|
|
2138
|
+
});
|
|
2139
|
+
});
|
|
2140
|
+
});
|