@vellumai/assistant 0.3.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/.dockerignore +27 -0
- package/.env.example +22 -0
- package/Dockerfile +99 -0
- package/Dockerfile.sandbox +5 -0
- package/README.md +248 -0
- package/bun.lock +1723 -0
- package/bunfig.toml +2 -0
- package/docs/skills.md +158 -0
- package/drizzle/0000_dizzy_maggott.sql +301 -0
- package/drizzle/meta/0000_snapshot.json +1999 -0
- package/drizzle/meta/_journal.json +13 -0
- package/drizzle.config.ts +7 -0
- package/eslint.config.mjs +17 -0
- package/hook-templates/debug-prompt-logger/hook.json +7 -0
- package/hook-templates/debug-prompt-logger/run.sh +68 -0
- package/knip.json +9 -0
- package/package.json +70 -0
- package/scripts/capture-x-graphql.ts +545 -0
- package/scripts/ipc/check-contract-inventory.ts +104 -0
- package/scripts/ipc/check-swift-decoder-drift.ts +166 -0
- package/scripts/ipc/generate-swift.ts +492 -0
- package/scripts/test-filesystem-tools.sh +48 -0
- package/scripts/test.sh +127 -0
- package/src/__tests__/__snapshots__/ipc-snapshot.test.ts.snap +2485 -0
- package/src/__tests__/account-registry.test.ts +245 -0
- package/src/__tests__/active-skill-tools.test.ts +378 -0
- package/src/__tests__/agent-heartbeat-service.test.ts +250 -0
- package/src/__tests__/agent-loop-thinking.test.ts +81 -0
- package/src/__tests__/agent-loop.test.ts +1135 -0
- package/src/__tests__/anthropic-provider.test.ts +778 -0
- package/src/__tests__/app-builder-tool-scripts.test.ts +290 -0
- package/src/__tests__/app-bundler.test.ts +292 -0
- package/src/__tests__/app-executors.test.ts +613 -0
- package/src/__tests__/app-git-history.test.ts +176 -0
- package/src/__tests__/app-git-service.test.ts +169 -0
- package/src/__tests__/app-open-proxy.test.ts +62 -0
- package/src/__tests__/asset-materialize-tool.test.ts +452 -0
- package/src/__tests__/asset-search-tool.test.ts +477 -0
- package/src/__tests__/assistant-attachment-directive.test.ts +401 -0
- package/src/__tests__/assistant-attachments.test.ts +437 -0
- package/src/__tests__/assistant-event-hub.test.ts +226 -0
- package/src/__tests__/assistant-event.test.ts +123 -0
- package/src/__tests__/assistant-events-sse-hardening.test.ts +315 -0
- package/src/__tests__/attachments-store.test.ts +476 -0
- package/src/__tests__/attachments.test.ts +134 -0
- package/src/__tests__/audit-log-rotation.test.ts +154 -0
- package/src/__tests__/browser-fill-credential.test.ts +309 -0
- package/src/__tests__/browser-manager.test.ts +203 -0
- package/src/__tests__/browser-runtime-check.test.ts +55 -0
- package/src/__tests__/browser-skill-baseline-tool-payload.test.ts +68 -0
- package/src/__tests__/browser-skill-endstate.test.ts +195 -0
- package/src/__tests__/bundle-scanner.test.ts +313 -0
- package/src/__tests__/call-bridge.test.ts +517 -0
- package/src/__tests__/call-constants.test.ts +40 -0
- package/src/__tests__/call-domain.test.ts +163 -0
- package/src/__tests__/call-orchestrator.test.ts +625 -0
- package/src/__tests__/call-recovery.test.ts +518 -0
- package/src/__tests__/call-routes-http.test.ts +699 -0
- package/src/__tests__/call-state-machine.test.ts +143 -0
- package/src/__tests__/call-state.test.ts +174 -0
- package/src/__tests__/call-store.test.ts +691 -0
- package/src/__tests__/channel-approval-routes.test.ts +2356 -0
- package/src/__tests__/channel-approval.test.ts +299 -0
- package/src/__tests__/channel-approvals.test.ts +521 -0
- package/src/__tests__/channel-delivery-store.test.ts +447 -0
- package/src/__tests__/channel-guardian.test.ts +1005 -0
- package/src/__tests__/checker.test.ts +3519 -0
- package/src/__tests__/clarification-resolver.test.ts +159 -0
- package/src/__tests__/classifier.test.ts +67 -0
- package/src/__tests__/claude-code-skill-regression.test.ts +127 -0
- package/src/__tests__/claude-code-tool-profiles.test.ts +88 -0
- package/src/__tests__/cli-discover.test.ts +85 -0
- package/src/__tests__/cli.test.ts +26 -0
- package/src/__tests__/clipboard.test.ts +80 -0
- package/src/__tests__/commit-guarantee.test.ts +335 -0
- package/src/__tests__/commit-message-enrichment-service.test.ts +550 -0
- package/src/__tests__/compaction.benchmark.test.ts +176 -0
- package/src/__tests__/computer-use-session-compaction.test.ts +132 -0
- package/src/__tests__/computer-use-session-lifecycle.test.ts +293 -0
- package/src/__tests__/computer-use-session-working-dir.test.ts +117 -0
- package/src/__tests__/computer-use-skill-baseline.test.ts +74 -0
- package/src/__tests__/computer-use-skill-endstate.test.ts +89 -0
- package/src/__tests__/computer-use-skill-lifecycle-cleanup.test.ts +217 -0
- package/src/__tests__/computer-use-skill-manifest-regression.test.ts +107 -0
- package/src/__tests__/computer-use-skill-proxy-bridge.test.ts +54 -0
- package/src/__tests__/computer-use-tools.test.ts +250 -0
- package/src/__tests__/config-schema.test.ts +1462 -0
- package/src/__tests__/conflict-intent-tokenization.test.ts +141 -0
- package/src/__tests__/conflict-policy.test.ts +121 -0
- package/src/__tests__/conflict-store.test.ts +332 -0
- package/src/__tests__/connection-policy.test.ts +102 -0
- package/src/__tests__/contacts-tools.test.ts +331 -0
- package/src/__tests__/context-memory-e2e.test.ts +434 -0
- package/src/__tests__/context-token-estimator.test.ts +135 -0
- package/src/__tests__/context-window-manager.test.ts +376 -0
- package/src/__tests__/contradiction-checker.test.ts +314 -0
- package/src/__tests__/conversation-store.test.ts +612 -0
- package/src/__tests__/credential-broker-browser-fill.test.ts +517 -0
- package/src/__tests__/credential-broker-server-use.test.ts +554 -0
- package/src/__tests__/credential-broker.test.ts +167 -0
- package/src/__tests__/credential-host-pattern-match.test.ts +104 -0
- package/src/__tests__/credential-metadata-store.test.ts +779 -0
- package/src/__tests__/credential-policy-validate.test.ts +121 -0
- package/src/__tests__/credential-resolve.test.ts +328 -0
- package/src/__tests__/credential-security-e2e.test.ts +352 -0
- package/src/__tests__/credential-security-invariants.test.ts +583 -0
- package/src/__tests__/credential-selection.test.ts +354 -0
- package/src/__tests__/credential-vault-unit.test.ts +780 -0
- package/src/__tests__/credential-vault.test.ts +852 -0
- package/src/__tests__/daemon-assistant-events.test.ts +164 -0
- package/src/__tests__/daemon-server-session-init.test.ts +522 -0
- package/src/__tests__/date-context.test.ts +373 -0
- package/src/__tests__/db-schedule-syntax-migration.test.ts +129 -0
- package/src/__tests__/delete-managed-skill-tool.test.ts +97 -0
- package/src/__tests__/diff.test.ts +121 -0
- package/src/__tests__/domain-normalize.test.ts +112 -0
- package/src/__tests__/domain-policy.test.ts +124 -0
- package/src/__tests__/doordash-client.test.ts +186 -0
- package/src/__tests__/doordash-session.test.ts +152 -0
- package/src/__tests__/dynamic-page-surface.test.ts +91 -0
- package/src/__tests__/dynamic-skill-workflow-prompt.test.ts +132 -0
- package/src/__tests__/edit-engine.test.ts +180 -0
- package/src/__tests__/elevenlabs-client.test.ts +271 -0
- package/src/__tests__/email-cli.test.ts +283 -0
- package/src/__tests__/encrypted-store.test.ts +332 -0
- package/src/__tests__/entity-extractor.test.ts +190 -0
- package/src/__tests__/ephemeral-permissions.test.ts +362 -0
- package/src/__tests__/evaluate-typescript-tool.test.ts +286 -0
- package/src/__tests__/event-bus.test.ts +222 -0
- package/src/__tests__/file-edit-tool.test.ts +122 -0
- package/src/__tests__/file-ops-service.test.ts +330 -0
- package/src/__tests__/file-read-tool.test.ts +75 -0
- package/src/__tests__/file-write-tool.test.ts +113 -0
- package/src/__tests__/filesystem-tools.test.ts +579 -0
- package/src/__tests__/fixtures/credential-security-fixtures.ts +181 -0
- package/src/__tests__/fixtures/media-reuse-fixtures.ts +126 -0
- package/src/__tests__/fixtures/mock-signup-server.ts +387 -0
- package/src/__tests__/fixtures/proxy-fixtures.ts +147 -0
- package/src/__tests__/followup-tools.test.ts +303 -0
- package/src/__tests__/forbidden-legacy-symbols.test.ts +71 -0
- package/src/__tests__/fuzzy-match-property.test.ts +216 -0
- package/src/__tests__/fuzzy-match.test.ts +138 -0
- package/src/__tests__/gateway-only-enforcement.test.ts +631 -0
- package/src/__tests__/gemini-image-service.test.ts +261 -0
- package/src/__tests__/gemini-provider.test.ts +651 -0
- package/src/__tests__/get-weather.test.ts +318 -0
- package/src/__tests__/gmail-integration.test.ts +73 -0
- package/src/__tests__/handlers-add-trust-rule-metadata.test.ts +202 -0
- package/src/__tests__/handlers-cu-observation-blob.test.ts +352 -0
- package/src/__tests__/handlers-ipc-blob-probe.test.ts +191 -0
- package/src/__tests__/handlers-slack-config.test.ts +200 -0
- package/src/__tests__/handlers-task-submit-slash.test.ts +38 -0
- package/src/__tests__/handlers-telegram-config.test.ts +968 -0
- package/src/__tests__/handlers-twilio-config.test.ts +659 -0
- package/src/__tests__/handlers-twitter-config.test.ts +858 -0
- package/src/__tests__/headless-browser-interactions.test.ts +536 -0
- package/src/__tests__/headless-browser-navigate.test.ts +211 -0
- package/src/__tests__/headless-browser-read-tools.test.ts +261 -0
- package/src/__tests__/headless-browser-snapshot.test.ts +185 -0
- package/src/__tests__/history-repair-observability.test.ts +56 -0
- package/src/__tests__/history-repair.test.ts +510 -0
- package/src/__tests__/home-base-bootstrap.test.ts +82 -0
- package/src/__tests__/hooks-blocking.test.ts +128 -0
- package/src/__tests__/hooks-cli.test.ts +144 -0
- package/src/__tests__/hooks-config.test.ts +93 -0
- package/src/__tests__/hooks-discovery.test.ts +199 -0
- package/src/__tests__/hooks-integration.test.ts +189 -0
- package/src/__tests__/hooks-manager.test.ts +187 -0
- package/src/__tests__/hooks-runner.test.ts +182 -0
- package/src/__tests__/hooks-settings.test.ts +154 -0
- package/src/__tests__/hooks-templates.test.ts +137 -0
- package/src/__tests__/hooks-ts-runner.test.ts +125 -0
- package/src/__tests__/hooks-watch.test.ts +100 -0
- package/src/__tests__/host-file-edit-tool.test.ts +228 -0
- package/src/__tests__/host-file-read-tool.test.ts +123 -0
- package/src/__tests__/host-file-write-tool.test.ts +136 -0
- package/src/__tests__/host-shell-tool.test.ts +562 -0
- package/src/__tests__/ingress-reconcile.test.ts +581 -0
- package/src/__tests__/ingress-url-consistency.test.ts +214 -0
- package/src/__tests__/intent-routing.test.ts +259 -0
- package/src/__tests__/ipc-blob-store.test.ts +315 -0
- package/src/__tests__/ipc-contract-inventory.test.ts +54 -0
- package/src/__tests__/ipc-contract.test.ts +74 -0
- package/src/__tests__/ipc-protocol.test.ts +113 -0
- package/src/__tests__/ipc-roundtrip.benchmark.test.ts +237 -0
- package/src/__tests__/ipc-snapshot.test.ts +1769 -0
- package/src/__tests__/ipc-validate.test.ts +407 -0
- package/src/__tests__/key-migration.test.ts +206 -0
- package/src/__tests__/keychain.test.ts +258 -0
- package/src/__tests__/llm-usage-store.test.ts +221 -0
- package/src/__tests__/managed-skill-lifecycle.test.ts +257 -0
- package/src/__tests__/managed-store.test.ts +608 -0
- package/src/__tests__/media-generate-image.test.ts +238 -0
- package/src/__tests__/media-reuse-story.e2e.test.ts +676 -0
- package/src/__tests__/media-visibility-policy.test.ts +141 -0
- package/src/__tests__/memory-context-benchmark.benchmark.test.ts +235 -0
- package/src/__tests__/memory-lifecycle-e2e.test.ts +481 -0
- package/src/__tests__/memory-query-builder.test.ts +59 -0
- package/src/__tests__/memory-recall-quality.test.ts +846 -0
- package/src/__tests__/memory-regressions.experimental.test.ts +538 -0
- package/src/__tests__/memory-regressions.test.ts +4435 -0
- package/src/__tests__/memory-retrieval-budget.test.ts +49 -0
- package/src/__tests__/memory-retrieval.benchmark.test.ts +430 -0
- package/src/__tests__/migration-cli-flows.test.ts +169 -0
- package/src/__tests__/migration-ordering.test.ts +249 -0
- package/src/__tests__/mock-signup-server.test.ts +528 -0
- package/src/__tests__/oauth-callback-registry.test.ts +92 -0
- package/src/__tests__/oauth2-gateway-transport.test.ts +285 -0
- package/src/__tests__/onboarding-starter-tasks.test.ts +176 -0
- package/src/__tests__/onboarding-template-contract.test.ts +58 -0
- package/src/__tests__/openai-provider.test.ts +753 -0
- package/src/__tests__/parallel-tool.benchmark.test.ts +294 -0
- package/src/__tests__/parser.test.ts +472 -0
- package/src/__tests__/path-classifier.test.ts +73 -0
- package/src/__tests__/path-policy.test.ts +435 -0
- package/src/__tests__/platform-move-helper.test.ts +99 -0
- package/src/__tests__/platform-socket-path.test.ts +52 -0
- package/src/__tests__/platform-workspace-migration.test.ts +1000 -0
- package/src/__tests__/platform.test.ts +131 -0
- package/src/__tests__/playbook-execution.test.ts +502 -0
- package/src/__tests__/playbook-tools.test.ts +340 -0
- package/src/__tests__/prebuilt-home-base-seed.test.ts +75 -0
- package/src/__tests__/pricing.test.ts +256 -0
- package/src/__tests__/profile-compiler.test.ts +374 -0
- package/src/__tests__/provider-commit-message-generator.test.ts +342 -0
- package/src/__tests__/provider-registry-ollama.test.ts +16 -0
- package/src/__tests__/provider-streaming.benchmark.test.ts +773 -0
- package/src/__tests__/proxy-approval-callback.test.ts +601 -0
- package/src/__tests__/public-ingress-urls.test.ts +256 -0
- package/src/__tests__/qdrant-manager.test.ts +267 -0
- package/src/__tests__/ratelimit.test.ts +297 -0
- package/src/__tests__/recurrence-engine-rruleset.test.ts +175 -0
- package/src/__tests__/recurrence-engine.test.ts +78 -0
- package/src/__tests__/recurrence-types.test.ts +79 -0
- package/src/__tests__/registry.test.ts +494 -0
- package/src/__tests__/relay-server.test.ts +688 -0
- package/src/__tests__/reminder-store.test.ts +223 -0
- package/src/__tests__/reminder.test.ts +229 -0
- package/src/__tests__/request-file-tool.test.ts +158 -0
- package/src/__tests__/run-orchestrator-assistant-events.test.ts +227 -0
- package/src/__tests__/run-orchestrator.test.ts +425 -0
- package/src/__tests__/runtime-attachment-metadata.test.ts +189 -0
- package/src/__tests__/runtime-events-sse-parity.test.ts +343 -0
- package/src/__tests__/runtime-events-sse.test.ts +162 -0
- package/src/__tests__/runtime-runs-http.test.ts +438 -0
- package/src/__tests__/runtime-runs.test.ts +260 -0
- package/src/__tests__/sandbox-diagnostics.test.ts +408 -0
- package/src/__tests__/sandbox-host-parity.test.ts +950 -0
- package/src/__tests__/scaffold-managed-skill-tool.test.ts +253 -0
- package/src/__tests__/schedule-store.test.ts +484 -0
- package/src/__tests__/schedule-tools.test.ts +783 -0
- package/src/__tests__/scheduler-recurrence.test.ts +430 -0
- package/src/__tests__/script-proxy-certs.test.ts +90 -0
- package/src/__tests__/script-proxy-connect-tunnel.test.ts +177 -0
- package/src/__tests__/script-proxy-decision-trace.test.ts +156 -0
- package/src/__tests__/script-proxy-http-forwarder.test.ts +281 -0
- package/src/__tests__/script-proxy-injection-runtime.test.ts +401 -0
- package/src/__tests__/script-proxy-mitm-handler.test.ts +407 -0
- package/src/__tests__/script-proxy-policy-runtime.test.ts +287 -0
- package/src/__tests__/script-proxy-policy.test.ts +310 -0
- package/src/__tests__/script-proxy-rewrite-specificity.test.ts +135 -0
- package/src/__tests__/script-proxy-router.test.ts +180 -0
- package/src/__tests__/script-proxy-session-manager.test.ts +382 -0
- package/src/__tests__/script-proxy-session-runtime.test.ts +113 -0
- package/src/__tests__/secret-allowlist.test.ts +230 -0
- package/src/__tests__/secret-ingress-handler.test.ts +110 -0
- package/src/__tests__/secret-onetime-send.test.ts +130 -0
- package/src/__tests__/secret-prompt-log-hygiene.test.ts +106 -0
- package/src/__tests__/secret-response-routing.test.ts +93 -0
- package/src/__tests__/secret-scanner-executor.test.ts +348 -0
- package/src/__tests__/secret-scanner.test.ts +900 -0
- package/src/__tests__/secure-keys.test.ts +323 -0
- package/src/__tests__/server-history-render.test.ts +431 -0
- package/src/__tests__/session-abort-tool-results.test.ts +240 -0
- package/src/__tests__/session-conflict-gate.test.ts +1136 -0
- package/src/__tests__/session-error.test.ts +369 -0
- package/src/__tests__/session-evictor.test.ts +188 -0
- package/src/__tests__/session-init.benchmark.test.ts +465 -0
- package/src/__tests__/session-load-history-repair.test.ts +222 -0
- package/src/__tests__/session-pre-run-repair.test.ts +213 -0
- package/src/__tests__/session-process-bridge.test.ts +242 -0
- package/src/__tests__/session-profile-injection.test.ts +444 -0
- package/src/__tests__/session-provider-retry-repair.test.ts +306 -0
- package/src/__tests__/session-queue.test.ts +1535 -0
- package/src/__tests__/session-runtime-assembly.test.ts +476 -0
- package/src/__tests__/session-runtime-workspace.test.ts +183 -0
- package/src/__tests__/session-skill-tools.test.ts +2431 -0
- package/src/__tests__/session-slash-known.test.ts +368 -0
- package/src/__tests__/session-slash-queue.test.ts +288 -0
- package/src/__tests__/session-slash-unknown.test.ts +271 -0
- package/src/__tests__/session-surfaces-task-progress.test.ts +104 -0
- package/src/__tests__/session-tool-setup-app-refresh.test.ts +473 -0
- package/src/__tests__/session-tool-setup-memory-scope.test.ts +140 -0
- package/src/__tests__/session-tool-setup-side-effect-flag.test.ts +140 -0
- package/src/__tests__/session-undo.test.ts +75 -0
- package/src/__tests__/session-workspace-cache-state.test.ts +246 -0
- package/src/__tests__/session-workspace-injection.test.ts +327 -0
- package/src/__tests__/session-workspace-tool-tracking.test.ts +240 -0
- package/src/__tests__/shared-filesystem-errors.test.ts +78 -0
- package/src/__tests__/shell-credential-ref.test.ts +187 -0
- package/src/__tests__/shell-identity.test.ts +256 -0
- package/src/__tests__/shell-parser-fuzz.test.ts +544 -0
- package/src/__tests__/shell-parser-property.test.ts +433 -0
- package/src/__tests__/shell-tool-proxy-mode.test.ts +272 -0
- package/src/__tests__/signup-e2e.test.ts +353 -0
- package/src/__tests__/size-guard.test.ts +117 -0
- package/src/__tests__/skill-include-graph.test.ts +303 -0
- package/src/__tests__/skill-load-tool.test.ts +409 -0
- package/src/__tests__/skill-projection.benchmark.test.ts +338 -0
- package/src/__tests__/skill-script-runner-host.test.ts +489 -0
- package/src/__tests__/skill-script-runner-sandbox.test.ts +349 -0
- package/src/__tests__/skill-script-runner.test.ts +159 -0
- package/src/__tests__/skill-tool-factory.test.ts +252 -0
- package/src/__tests__/skill-tool-manifest.test.ts +658 -0
- package/src/__tests__/skill-version-hash.test.ts +182 -0
- package/src/__tests__/skills.test.ts +680 -0
- package/src/__tests__/slash-commands-catalog.test.ts +86 -0
- package/src/__tests__/slash-commands-parser.test.ts +119 -0
- package/src/__tests__/slash-commands-resolver.test.ts +193 -0
- package/src/__tests__/slash-commands-rewrite.test.ts +39 -0
- package/src/__tests__/speaker-identification.test.ts +52 -0
- package/src/__tests__/starter-bundle.test.ts +136 -0
- package/src/__tests__/starter-task-flow.test.ts +143 -0
- package/src/__tests__/subagent-manager-notify.test.ts +404 -0
- package/src/__tests__/subagent-tools.test.ts +801 -0
- package/src/__tests__/subagent-types.test.ts +78 -0
- package/src/__tests__/swarm-orchestrator.test.ts +428 -0
- package/src/__tests__/swarm-plan-validator.test.ts +330 -0
- package/src/__tests__/swarm-recursion.test.ts +165 -0
- package/src/__tests__/swarm-router-planner.test.ts +208 -0
- package/src/__tests__/swarm-session-integration.test.ts +274 -0
- package/src/__tests__/swarm-tool.test.ts +145 -0
- package/src/__tests__/swarm-worker-backend.test.ts +129 -0
- package/src/__tests__/swarm-worker-runner.test.ts +272 -0
- package/src/__tests__/system-prompt.test.ts +439 -0
- package/src/__tests__/task-compiler.test.ts +284 -0
- package/src/__tests__/task-management-tools.test.ts +936 -0
- package/src/__tests__/task-runner.test.ts +216 -0
- package/src/__tests__/task-scheduler.test.ts +217 -0
- package/src/__tests__/task-tools.test.ts +595 -0
- package/src/__tests__/terminal-sandbox-docker.test.ts +1064 -0
- package/src/__tests__/terminal-sandbox.integration.test.ts +178 -0
- package/src/__tests__/terminal-sandbox.test.ts +202 -0
- package/src/__tests__/terminal-tools.test.ts +840 -0
- package/src/__tests__/test-support/browser-skill-harness.ts +90 -0
- package/src/__tests__/test-support/computer-use-skill-harness.ts +45 -0
- package/src/__tests__/tool-audit-listener.test.ts +113 -0
- package/src/__tests__/tool-domain-event-publisher.test.ts +253 -0
- package/src/__tests__/tool-execution-pipeline.benchmark.test.ts +500 -0
- package/src/__tests__/tool-executor-lifecycle-events.test.ts +516 -0
- package/src/__tests__/tool-executor-redaction.test.ts +289 -0
- package/src/__tests__/tool-executor-shell-integration.test.ts +301 -0
- package/src/__tests__/tool-executor.test.ts +1989 -0
- package/src/__tests__/tool-metrics-listener.test.ts +225 -0
- package/src/__tests__/tool-notification-listener.test.ts +49 -0
- package/src/__tests__/tool-permission-simulate-handler.test.ts +336 -0
- package/src/__tests__/tool-policy.test.ts +54 -0
- package/src/__tests__/tool-profiling-listener.test.ts +268 -0
- package/src/__tests__/tool-result-truncation.test.ts +217 -0
- package/src/__tests__/tool-trace-listener.test.ts +226 -0
- package/src/__tests__/top-level-renderer.test.ts +121 -0
- package/src/__tests__/top-level-scanner.test.ts +141 -0
- package/src/__tests__/trace-emitter.test.ts +173 -0
- package/src/__tests__/trust-store.test.ts +1605 -0
- package/src/__tests__/turn-commit.test.ts +554 -0
- package/src/__tests__/twilio-provider.test.ts +329 -0
- package/src/__tests__/twilio-routes-elevenlabs.test.ts +375 -0
- package/src/__tests__/twilio-routes-twiml.test.ts +127 -0
- package/src/__tests__/twilio-routes.test.ts +577 -0
- package/src/__tests__/twitter-auth-handler.test.ts +667 -0
- package/src/__tests__/twitter-cli-error-shaping.test.ts +208 -0
- package/src/__tests__/twitter-cli-routing.test.ts +252 -0
- package/src/__tests__/twitter-oauth-client.test.ts +209 -0
- package/src/__tests__/url-safety.test.ts +418 -0
- package/src/__tests__/view-image-tool.test.ts +217 -0
- package/src/__tests__/weather-skill-regression.test.ts +225 -0
- package/src/__tests__/web-fetch.test.ts +869 -0
- package/src/__tests__/web-search.test.ts +584 -0
- package/src/__tests__/workspace-git-service.test.ts +1153 -0
- package/src/__tests__/workspace-heartbeat-service.test.ts +486 -0
- package/src/__tests__/workspace-lifecycle.test.ts +292 -0
- package/src/__tests__/workspace-policy.test.ts +213 -0
- package/src/agent/attachments.ts +35 -0
- package/src/agent/loop.ts +500 -0
- package/src/agent/message-types.ts +17 -0
- package/src/agent-heartbeat/agent-heartbeat-service.ts +155 -0
- package/src/autonomy/autonomy-resolver.ts +60 -0
- package/src/autonomy/autonomy-store.ts +122 -0
- package/src/autonomy/disposition-mapper.ts +31 -0
- package/src/autonomy/index.ts +11 -0
- package/src/autonomy/types.ts +39 -0
- package/src/bundler/app-bundler.ts +295 -0
- package/src/bundler/bundle-scanner.ts +535 -0
- package/src/bundler/bundle-signer.ts +124 -0
- package/src/bundler/manifest.ts +21 -0
- package/src/bundler/signature-verifier.ts +184 -0
- package/src/calls/call-bridge.ts +168 -0
- package/src/calls/call-constants.ts +48 -0
- package/src/calls/call-domain.ts +430 -0
- package/src/calls/call-orchestrator.ts +498 -0
- package/src/calls/call-recovery.ts +207 -0
- package/src/calls/call-state-machine.ts +68 -0
- package/src/calls/call-state.ts +87 -0
- package/src/calls/call-store.ts +422 -0
- package/src/calls/elevenlabs-client.ts +97 -0
- package/src/calls/elevenlabs-config.ts +31 -0
- package/src/calls/relay-server.ts +390 -0
- package/src/calls/speaker-identification.ts +213 -0
- package/src/calls/twilio-config.ts +45 -0
- package/src/calls/twilio-provider.ts +263 -0
- package/src/calls/twilio-rest.ts +156 -0
- package/src/calls/twilio-routes.ts +311 -0
- package/src/calls/types.ts +39 -0
- package/src/calls/voice-provider.ts +14 -0
- package/src/calls/voice-quality.ts +114 -0
- package/src/cli/autonomy.ts +188 -0
- package/src/cli/config-commands.ts +334 -0
- package/src/cli/contacts.ts +149 -0
- package/src/cli/core-commands.ts +784 -0
- package/src/cli/doordash.ts +1055 -0
- package/src/cli/email-guardrails.ts +200 -0
- package/src/cli/email.ts +405 -0
- package/src/cli/ipc-client.ts +82 -0
- package/src/cli/main-screen.tsx +53 -0
- package/src/cli/map.ts +270 -0
- package/src/cli/twitter.ts +754 -0
- package/src/cli.ts +918 -0
- package/src/commands/__tests__/cc-command-registry.test.ts +319 -0
- package/src/commands/cc-command-registry.ts +209 -0
- package/src/config/bundled-skills/.gitkeep +0 -0
- package/src/config/bundled-skills/agentmail/SKILL.md +128 -0
- package/src/config/bundled-skills/agentmail/icon.svg +21 -0
- package/src/config/bundled-skills/app-builder/SKILL.md +1404 -0
- package/src/config/bundled-skills/app-builder/TOOLS.json +279 -0
- package/src/config/bundled-skills/app-builder/icon.svg +9 -0
- package/src/config/bundled-skills/app-builder/tools/app-create.ts +15 -0
- package/src/config/bundled-skills/app-builder/tools/app-delete.ts +10 -0
- package/src/config/bundled-skills/app-builder/tools/app-file-edit.ts +11 -0
- package/src/config/bundled-skills/app-builder/tools/app-file-list.ts +10 -0
- package/src/config/bundled-skills/app-builder/tools/app-file-read.ts +18 -0
- package/src/config/bundled-skills/app-builder/tools/app-file-write.ts +11 -0
- package/src/config/bundled-skills/app-builder/tools/app-list.ts +10 -0
- package/src/config/bundled-skills/app-builder/tools/app-query.ts +10 -0
- package/src/config/bundled-skills/app-builder/tools/app-update.ts +20 -0
- package/src/config/bundled-skills/browser/SKILL.md +28 -0
- package/src/config/bundled-skills/browser/TOOLS.json +234 -0
- package/src/config/bundled-skills/browser/tools/browser-click.ts +9 -0
- package/src/config/bundled-skills/browser/tools/browser-close.ts +9 -0
- package/src/config/bundled-skills/browser/tools/browser-extract.ts +9 -0
- package/src/config/bundled-skills/browser/tools/browser-fill-credential.ts +9 -0
- package/src/config/bundled-skills/browser/tools/browser-navigate.ts +9 -0
- package/src/config/bundled-skills/browser/tools/browser-press-key.ts +9 -0
- package/src/config/bundled-skills/browser/tools/browser-screenshot.ts +9 -0
- package/src/config/bundled-skills/browser/tools/browser-snapshot.ts +9 -0
- package/src/config/bundled-skills/browser/tools/browser-type.ts +9 -0
- package/src/config/bundled-skills/browser/tools/browser-wait-for.ts +9 -0
- package/src/config/bundled-skills/claude-code/SKILL.md +50 -0
- package/src/config/bundled-skills/claude-code/TOOLS.json +40 -0
- package/src/config/bundled-skills/claude-code/tools/claude-code.ts +9 -0
- package/src/config/bundled-skills/computer-use/SKILL.md +17 -0
- package/src/config/bundled-skills/computer-use/TOOLS.json +326 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-click.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-done.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-double-click.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-drag.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-key.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-open-app.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-request-control.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-respond.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-right-click.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-run-applescript.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-scroll.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-type-text.ts +9 -0
- package/src/config/bundled-skills/computer-use/tools/computer-use-wait.ts +9 -0
- package/src/config/bundled-skills/contacts/SKILL.md +39 -0
- package/src/config/bundled-skills/contacts/TOOLS.json +122 -0
- package/src/config/bundled-skills/contacts/tools/contact-merge.ts +57 -0
- package/src/config/bundled-skills/contacts/tools/contact-search.ts +60 -0
- package/src/config/bundled-skills/contacts/tools/contact-upsert.ts +66 -0
- package/src/config/bundled-skills/document/SKILL.md +26 -0
- package/src/config/bundled-skills/document/TOOLS.json +53 -0
- package/src/config/bundled-skills/document/tools/document-create.ts +9 -0
- package/src/config/bundled-skills/document/tools/document-update.ts +9 -0
- package/src/config/bundled-skills/doordash/SKILL.md +163 -0
- package/src/config/bundled-skills/followups/SKILL.md +32 -0
- package/src/config/bundled-skills/followups/TOOLS.json +100 -0
- package/src/config/bundled-skills/followups/icon.svg +24 -0
- package/src/config/bundled-skills/followups/tools/followup-create.ts +9 -0
- package/src/config/bundled-skills/followups/tools/followup-list.ts +9 -0
- package/src/config/bundled-skills/followups/tools/followup-resolve.ts +9 -0
- package/src/config/bundled-skills/google-calendar/SKILL.md +51 -0
- package/src/config/bundled-skills/google-calendar/TOOLS.json +108 -0
- package/src/config/bundled-skills/google-calendar/calendar-client.ts +165 -0
- package/src/config/bundled-skills/google-calendar/tools/calendar-check-availability.ts +21 -0
- package/src/config/bundled-skills/google-calendar/tools/calendar-create-event.ts +42 -0
- package/src/config/bundled-skills/google-calendar/tools/calendar-get-event.ts +13 -0
- package/src/config/bundled-skills/google-calendar/tools/calendar-list-events.ts +30 -0
- package/src/config/bundled-skills/google-calendar/tools/calendar-rsvp.ts +41 -0
- package/src/config/bundled-skills/google-calendar/tools/shared.ts +18 -0
- package/src/config/bundled-skills/google-calendar/types.ts +97 -0
- package/src/config/bundled-skills/image-studio/SKILL.md +32 -0
- package/src/config/bundled-skills/image-studio/TOOLS.json +42 -0
- package/src/config/bundled-skills/image-studio/tools/media-generate-image.ts +115 -0
- package/src/config/bundled-skills/macos-automation/SKILL.md +66 -0
- package/src/config/bundled-skills/messaging/SKILL.md +153 -0
- package/src/config/bundled-skills/messaging/TOOLS.json +357 -0
- package/src/config/bundled-skills/messaging/tools/gmail-archive.ts +23 -0
- package/src/config/bundled-skills/messaging/tools/gmail-batch-archive.ts +23 -0
- package/src/config/bundled-skills/messaging/tools/gmail-batch-label.ts +25 -0
- package/src/config/bundled-skills/messaging/tools/gmail-draft.ts +26 -0
- package/src/config/bundled-skills/messaging/tools/gmail-label.ts +25 -0
- package/src/config/bundled-skills/messaging/tools/gmail-trash.ts +23 -0
- package/src/config/bundled-skills/messaging/tools/gmail-unsubscribe.ts +84 -0
- package/src/config/bundled-skills/messaging/tools/messaging-analyze-activity.ts +18 -0
- package/src/config/bundled-skills/messaging/tools/messaging-analyze-style.ts +125 -0
- package/src/config/bundled-skills/messaging/tools/messaging-auth-test.ts +16 -0
- package/src/config/bundled-skills/messaging/tools/messaging-draft.ts +49 -0
- package/src/config/bundled-skills/messaging/tools/messaging-list-conversations.ts +21 -0
- package/src/config/bundled-skills/messaging/tools/messaging-mark-read.ts +25 -0
- package/src/config/bundled-skills/messaging/tools/messaging-read.ts +28 -0
- package/src/config/bundled-skills/messaging/tools/messaging-reply.ts +32 -0
- package/src/config/bundled-skills/messaging/tools/messaging-search.ts +22 -0
- package/src/config/bundled-skills/messaging/tools/messaging-send.ts +31 -0
- package/src/config/bundled-skills/messaging/tools/shared.ts +76 -0
- package/src/config/bundled-skills/messaging/tools/slack-add-reaction.ts +25 -0
- package/src/config/bundled-skills/messaging/tools/slack-leave-channel.ts +23 -0
- package/src/config/bundled-skills/phone-calls/SKILL.md +533 -0
- package/src/config/bundled-skills/playbooks/SKILL.md +31 -0
- package/src/config/bundled-skills/playbooks/TOOLS.json +126 -0
- package/src/config/bundled-skills/playbooks/tools/playbook-create.ts +98 -0
- package/src/config/bundled-skills/playbooks/tools/playbook-delete.ts +54 -0
- package/src/config/bundled-skills/playbooks/tools/playbook-list.ts +76 -0
- package/src/config/bundled-skills/playbooks/tools/playbook-update.ts +113 -0
- package/src/config/bundled-skills/public-ingress/SKILL.md +200 -0
- package/src/config/bundled-skills/reminder/SKILL.md +20 -0
- package/src/config/bundled-skills/reminder/TOOLS.json +67 -0
- package/src/config/bundled-skills/reminder/tools/reminder-cancel.ts +9 -0
- package/src/config/bundled-skills/reminder/tools/reminder-create.ts +9 -0
- package/src/config/bundled-skills/reminder/tools/reminder-list.ts +9 -0
- package/src/config/bundled-skills/schedule/SKILL.md +74 -0
- package/src/config/bundled-skills/schedule/TOOLS.json +135 -0
- package/src/config/bundled-skills/schedule/tools/schedule-create.ts +9 -0
- package/src/config/bundled-skills/schedule/tools/schedule-delete.ts +9 -0
- package/src/config/bundled-skills/schedule/tools/schedule-list.ts +9 -0
- package/src/config/bundled-skills/schedule/tools/schedule-update.ts +9 -0
- package/src/config/bundled-skills/self-upgrade/SKILL.md +68 -0
- package/src/config/bundled-skills/start-the-day/SKILL.md +70 -0
- package/src/config/bundled-skills/start-the-day/icon.svg +13 -0
- package/src/config/bundled-skills/subagent/SKILL.md +25 -0
- package/src/config/bundled-skills/subagent/TOOLS.json +107 -0
- package/src/config/bundled-skills/subagent/tools/subagent-abort.ts +9 -0
- package/src/config/bundled-skills/subagent/tools/subagent-message.ts +9 -0
- package/src/config/bundled-skills/subagent/tools/subagent-read.ts +9 -0
- package/src/config/bundled-skills/subagent/tools/subagent-spawn.ts +9 -0
- package/src/config/bundled-skills/subagent/tools/subagent-status.ts +9 -0
- package/src/config/bundled-skills/tasks/SKILL.md +28 -0
- package/src/config/bundled-skills/tasks/TOOLS.json +281 -0
- package/src/config/bundled-skills/tasks/tools/task-delete.ts +9 -0
- package/src/config/bundled-skills/tasks/tools/task-list-add.ts +9 -0
- package/src/config/bundled-skills/tasks/tools/task-list-remove.ts +9 -0
- package/src/config/bundled-skills/tasks/tools/task-list-show.ts +9 -0
- package/src/config/bundled-skills/tasks/tools/task-list-update.ts +9 -0
- package/src/config/bundled-skills/tasks/tools/task-list.ts +9 -0
- package/src/config/bundled-skills/tasks/tools/task-queue-run.ts +9 -0
- package/src/config/bundled-skills/tasks/tools/task-run.ts +9 -0
- package/src/config/bundled-skills/tasks/tools/task-save.ts +9 -0
- package/src/config/bundled-skills/transcribe/SKILL.md +25 -0
- package/src/config/bundled-skills/transcribe/TOOLS.json +32 -0
- package/src/config/bundled-skills/transcribe/tools/transcribe-media.ts +370 -0
- package/src/config/bundled-skills/twitter/SKILL.md +220 -0
- package/src/config/bundled-skills/watcher/SKILL.md +27 -0
- package/src/config/bundled-skills/watcher/TOOLS.json +147 -0
- package/src/config/bundled-skills/watcher/tools/watcher-create.ts +9 -0
- package/src/config/bundled-skills/watcher/tools/watcher-delete.ts +9 -0
- package/src/config/bundled-skills/watcher/tools/watcher-digest.ts +9 -0
- package/src/config/bundled-skills/watcher/tools/watcher-list.ts +9 -0
- package/src/config/bundled-skills/watcher/tools/watcher-update.ts +9 -0
- package/src/config/bundled-skills/weather/SKILL.md +37 -0
- package/src/config/bundled-skills/weather/TOOLS.json +32 -0
- package/src/config/bundled-skills/weather/icon.svg +24 -0
- package/src/config/bundled-skills/weather/tools/get-weather.ts +9 -0
- package/src/config/computer-use-prompt.ts +97 -0
- package/src/config/defaults.ts +263 -0
- package/src/config/loader.ts +339 -0
- package/src/config/schema.ts +1436 -0
- package/src/config/skill-state.ts +95 -0
- package/src/config/skills.ts +972 -0
- package/src/config/system-prompt.ts +675 -0
- package/src/config/templates/BOOTSTRAP.md +70 -0
- package/src/config/templates/IDENTITY.md +25 -0
- package/src/config/templates/LOOKS.md +25 -0
- package/src/config/templates/SOUL.md +37 -0
- package/src/config/templates/USER.md +19 -0
- package/src/config/types.ts +42 -0
- package/src/config/vellum-skills/chatgpt-import/SKILL.md +24 -0
- package/src/config/vellum-skills/chatgpt-import/TOOLS.json +23 -0
- package/src/config/vellum-skills/chatgpt-import/tools/chatgpt-import.ts +284 -0
- package/src/config/vellum-skills/deploy-fullstack-vercel/SKILL.md +179 -0
- package/src/config/vellum-skills/document-writer/SKILL.md +195 -0
- package/src/config/vellum-skills/google-oauth-setup/SKILL.md +199 -0
- package/src/config/vellum-skills/slack-oauth-setup/SKILL.md +153 -0
- package/src/config/vellum-skills/telegram-setup/SKILL.md +143 -0
- package/src/config/vellum-skills/twilio-setup/SKILL.md +213 -0
- package/src/contacts/contact-store.ts +410 -0
- package/src/contacts/index.ts +11 -0
- package/src/contacts/types.ts +28 -0
- package/src/context/token-estimator.ts +108 -0
- package/src/context/tool-result-truncation.ts +128 -0
- package/src/context/window-manager.ts +531 -0
- package/src/daemon/assistant-attachments.ts +691 -0
- package/src/daemon/classifier.ts +110 -0
- package/src/daemon/computer-use-session.ts +903 -0
- package/src/daemon/connection-policy.ts +41 -0
- package/src/daemon/date-context.ts +136 -0
- package/src/daemon/handlers/apps.ts +530 -0
- package/src/daemon/handlers/browser.ts +54 -0
- package/src/daemon/handlers/computer-use.ts +187 -0
- package/src/daemon/handlers/config.ts +1517 -0
- package/src/daemon/handlers/diagnostics.ts +338 -0
- package/src/daemon/handlers/documents.ts +173 -0
- package/src/daemon/handlers/home-base.ts +78 -0
- package/src/daemon/handlers/identity.ts +127 -0
- package/src/daemon/handlers/index.ts +129 -0
- package/src/daemon/handlers/misc.ts +331 -0
- package/src/daemon/handlers/open-bundle-handler.ts +80 -0
- package/src/daemon/handlers/publish.ts +187 -0
- package/src/daemon/handlers/sessions.ts +555 -0
- package/src/daemon/handlers/shared.ts +570 -0
- package/src/daemon/handlers/signing.ts +37 -0
- package/src/daemon/handlers/skills.ts +486 -0
- package/src/daemon/handlers/subagents.ts +210 -0
- package/src/daemon/handlers/twitter-auth.ts +198 -0
- package/src/daemon/handlers/work-items.ts +632 -0
- package/src/daemon/handlers/workspace-files.ts +75 -0
- package/src/daemon/handlers.ts +17 -0
- package/src/daemon/history-repair.ts +214 -0
- package/src/daemon/ipc-blob-store.ts +231 -0
- package/src/daemon/ipc-contract-inventory.json +495 -0
- package/src/daemon/ipc-contract-inventory.ts +126 -0
- package/src/daemon/ipc-contract.ts +2551 -0
- package/src/daemon/ipc-protocol.ts +75 -0
- package/src/daemon/ipc-validate.ts +188 -0
- package/src/daemon/lifecycle.ts +582 -0
- package/src/daemon/main.ts +21 -0
- package/src/daemon/media-visibility-policy.ts +57 -0
- package/src/daemon/ride-shotgun-handler.ts +309 -0
- package/src/daemon/server.ts +1215 -0
- package/src/daemon/session-agent-loop.ts +922 -0
- package/src/daemon/session-attachments.ts +196 -0
- package/src/daemon/session-conflict-gate.ts +184 -0
- package/src/daemon/session-dynamic-profile.ts +63 -0
- package/src/daemon/session-error.ts +290 -0
- package/src/daemon/session-evictor.ts +196 -0
- package/src/daemon/session-history.ts +437 -0
- package/src/daemon/session-lifecycle.ts +147 -0
- package/src/daemon/session-media-retry.ts +147 -0
- package/src/daemon/session-memory.ts +212 -0
- package/src/daemon/session-messaging.ts +145 -0
- package/src/daemon/session-notifiers.ts +193 -0
- package/src/daemon/session-process.ts +323 -0
- package/src/daemon/session-queue-manager.ts +82 -0
- package/src/daemon/session-runtime-assembly.ts +447 -0
- package/src/daemon/session-skill-tools.ts +356 -0
- package/src/daemon/session-slash.ts +305 -0
- package/src/daemon/session-surfaces.ts +702 -0
- package/src/daemon/session-tool-setup.ts +523 -0
- package/src/daemon/session-usage.ts +72 -0
- package/src/daemon/session-workspace.ts +19 -0
- package/src/daemon/session.ts +400 -0
- package/src/daemon/tls-certs.ts +189 -0
- package/src/daemon/trace-emitter.ts +82 -0
- package/src/daemon/video-thumbnail.ts +62 -0
- package/src/daemon/watch-handler.ts +274 -0
- package/src/doordash/client.ts +999 -0
- package/src/doordash/queries.ts +1311 -0
- package/src/doordash/query-extractor.ts +93 -0
- package/src/doordash/session.ts +82 -0
- package/src/email/provider.ts +117 -0
- package/src/email/providers/agentmail.ts +317 -0
- package/src/email/providers/index.ts +58 -0
- package/src/email/service.ts +303 -0
- package/src/email/types.ts +126 -0
- package/src/events/bus.ts +157 -0
- package/src/events/domain-events.ts +83 -0
- package/src/events/index.ts +18 -0
- package/src/events/tool-audit-listener.ts +80 -0
- package/src/events/tool-domain-event-publisher.ts +111 -0
- package/src/events/tool-metrics-listener.ts +159 -0
- package/src/events/tool-notification-listener.ts +17 -0
- package/src/events/tool-profiling-listener.ts +158 -0
- package/src/events/tool-trace-listener.ts +75 -0
- package/src/export/formatter.ts +98 -0
- package/src/followups/followup-store.ts +168 -0
- package/src/followups/index.ts +10 -0
- package/src/followups/types.ts +29 -0
- package/src/gallery/default-gallery.ts +795 -0
- package/src/gallery/gallery-manifest.ts +24 -0
- package/src/home-base/app-link-store.ts +82 -0
- package/src/home-base/bootstrap.ts +68 -0
- package/src/home-base/prebuilt/index.html +662 -0
- package/src/home-base/prebuilt/seed-metadata.json +21 -0
- package/src/home-base/prebuilt/seed.ts +112 -0
- package/src/home-base/prebuilt-home-base-updater.ts +30 -0
- package/src/hooks/cli.ts +163 -0
- package/src/hooks/config.ts +88 -0
- package/src/hooks/discovery.ts +110 -0
- package/src/hooks/manager.ts +124 -0
- package/src/hooks/runner.ts +123 -0
- package/src/hooks/templates.ts +52 -0
- package/src/hooks/types.ts +72 -0
- package/src/inbound/public-ingress-urls.ts +123 -0
- package/src/index.ts +81 -0
- package/src/instrument.ts +60 -0
- package/src/logfire.ts +99 -0
- package/src/media/gemini-image-service.ts +136 -0
- package/src/memory/account-store.ts +108 -0
- package/src/memory/admin.ts +211 -0
- package/src/memory/app-git-service.ts +295 -0
- package/src/memory/app-store.ts +577 -0
- package/src/memory/attachments-store.ts +397 -0
- package/src/memory/channel-delivery-store.ts +353 -0
- package/src/memory/channel-guardian-store.ts +669 -0
- package/src/memory/checkpoints.ts +52 -0
- package/src/memory/clarification-resolver.ts +298 -0
- package/src/memory/conflict-intent.ts +157 -0
- package/src/memory/conflict-policy.ts +73 -0
- package/src/memory/conflict-store.ts +350 -0
- package/src/memory/contradiction-checker.ts +358 -0
- package/src/memory/conversation-key-store.ts +122 -0
- package/src/memory/conversation-store.ts +470 -0
- package/src/memory/db.ts +1991 -0
- package/src/memory/embedding-backend.ts +229 -0
- package/src/memory/embedding-gemini.ts +52 -0
- package/src/memory/embedding-local.ts +65 -0
- package/src/memory/embedding-ollama.ts +55 -0
- package/src/memory/embedding-openai.ts +25 -0
- package/src/memory/entity-extractor.ts +474 -0
- package/src/memory/external-conversation-store.ts +234 -0
- package/src/memory/fingerprint.ts +20 -0
- package/src/memory/indexer.ts +156 -0
- package/src/memory/items-extractor.ts +461 -0
- package/src/memory/job-handlers/backfill.ts +139 -0
- package/src/memory/job-handlers/cleanup.ts +58 -0
- package/src/memory/job-handlers/conflict.ts +141 -0
- package/src/memory/job-handlers/embedding.ts +61 -0
- package/src/memory/job-handlers/extraction.ts +123 -0
- package/src/memory/job-handlers/index-maintenance.ts +54 -0
- package/src/memory/job-handlers/summarization.ts +286 -0
- package/src/memory/job-utils.ts +170 -0
- package/src/memory/jobs-store.ts +401 -0
- package/src/memory/jobs-worker.ts +313 -0
- package/src/memory/llm-request-log-store.ts +45 -0
- package/src/memory/llm-usage-store.ts +60 -0
- package/src/memory/message-content.ts +54 -0
- package/src/memory/profile-compiler.ts +160 -0
- package/src/memory/published-pages-store.ts +137 -0
- package/src/memory/qdrant-client.ts +366 -0
- package/src/memory/qdrant-manager.ts +242 -0
- package/src/memory/query-builder.ts +45 -0
- package/src/memory/retrieval-budget.ts +30 -0
- package/src/memory/retriever.ts +653 -0
- package/src/memory/runs-store.ts +305 -0
- package/src/memory/schema.ts +677 -0
- package/src/memory/search/entity.ts +298 -0
- package/src/memory/search/formatting.ts +207 -0
- package/src/memory/search/lexical.ts +227 -0
- package/src/memory/search/ranking.ts +401 -0
- package/src/memory/search/semantic.ts +121 -0
- package/src/memory/search/types.ts +137 -0
- package/src/memory/segmenter.ts +68 -0
- package/src/memory/shared-app-links-store.ts +138 -0
- package/src/memory/tool-usage-store.ts +62 -0
- package/src/messaging/activity-analyzer.ts +76 -0
- package/src/messaging/draft-store.ts +88 -0
- package/src/messaging/index.ts +3 -0
- package/src/messaging/provider-types.ts +80 -0
- package/src/messaging/provider.ts +52 -0
- package/src/messaging/providers/gmail/adapter.ts +193 -0
- package/src/messaging/providers/gmail/client.ts +204 -0
- package/src/messaging/providers/gmail/types.ts +90 -0
- package/src/messaging/providers/slack/adapter.ts +202 -0
- package/src/messaging/providers/slack/client.ts +198 -0
- package/src/messaging/providers/slack/types.ts +119 -0
- package/src/messaging/providers/telegram-bot/adapter.ts +162 -0
- package/src/messaging/providers/telegram-bot/client.ts +104 -0
- package/src/messaging/providers/telegram-bot/types.ts +15 -0
- package/src/messaging/registry.ts +35 -0
- package/src/messaging/style-analyzer.ts +159 -0
- package/src/messaging/thread-summarizer.ts +306 -0
- package/src/messaging/triage-engine.ts +323 -0
- package/src/messaging/types.ts +55 -0
- package/src/permissions/checker.ts +640 -0
- package/src/permissions/defaults.ts +254 -0
- package/src/permissions/prompter.ts +98 -0
- package/src/permissions/secret-prompter.ts +114 -0
- package/src/permissions/shell-identity.ts +227 -0
- package/src/permissions/trust-store.ts +607 -0
- package/src/permissions/types.ts +43 -0
- package/src/permissions/workspace-policy.ts +114 -0
- package/src/playbooks/index.ts +2 -0
- package/src/playbooks/playbook-compiler.ts +90 -0
- package/src/playbooks/types.ts +55 -0
- package/src/providers/anthropic/client.ts +751 -0
- package/src/providers/failover.ts +129 -0
- package/src/providers/fireworks/client.ts +20 -0
- package/src/providers/gemini/client.ts +285 -0
- package/src/providers/ollama/client.ts +30 -0
- package/src/providers/openai/client.ts +337 -0
- package/src/providers/openrouter/client.ts +20 -0
- package/src/providers/ratelimit.ts +93 -0
- package/src/providers/registry.ts +146 -0
- package/src/providers/retry.ts +81 -0
- package/src/providers/stream-timeout.ts +38 -0
- package/src/providers/types.ts +109 -0
- package/src/runtime/assistant-event-hub.ts +157 -0
- package/src/runtime/assistant-event.ts +82 -0
- package/src/runtime/channel-approval-parser.ts +60 -0
- package/src/runtime/channel-approval-types.ts +73 -0
- package/src/runtime/channel-approvals.ts +206 -0
- package/src/runtime/channel-guardian-service.ts +212 -0
- package/src/runtime/gateway-client.ts +58 -0
- package/src/runtime/http-server.ts +1076 -0
- package/src/runtime/http-types.ts +66 -0
- package/src/runtime/routes/app-routes.ts +174 -0
- package/src/runtime/routes/attachment-routes.ts +133 -0
- package/src/runtime/routes/call-routes.ts +190 -0
- package/src/runtime/routes/channel-routes.ts +1404 -0
- package/src/runtime/routes/conversation-routes.ts +352 -0
- package/src/runtime/routes/events-routes.ts +148 -0
- package/src/runtime/routes/run-routes.ts +257 -0
- package/src/runtime/routes/secret-routes.ts +76 -0
- package/src/runtime/run-orchestrator.ts +330 -0
- package/src/schedule/recurrence-engine.ts +162 -0
- package/src/schedule/recurrence-types.ts +67 -0
- package/src/schedule/schedule-store.ts +506 -0
- package/src/schedule/scheduler.ts +171 -0
- package/src/security/encrypted-store.ts +238 -0
- package/src/security/keychain.ts +252 -0
- package/src/security/oauth-callback-registry.ts +66 -0
- package/src/security/oauth2.ts +274 -0
- package/src/security/redaction.ts +89 -0
- package/src/security/secret-allowlist.ts +164 -0
- package/src/security/secret-ingress.ts +57 -0
- package/src/security/secret-scanner.ts +550 -0
- package/src/security/secure-keys.ts +180 -0
- package/src/security/token-manager.ts +141 -0
- package/src/services/published-app-updater.ts +69 -0
- package/src/services/vercel-deploy.ts +73 -0
- package/src/skills/active-skill-tools.ts +81 -0
- package/src/skills/clawhub.ts +414 -0
- package/src/skills/include-graph.ts +146 -0
- package/src/skills/managed-store.ts +233 -0
- package/src/skills/path-classifier.ts +128 -0
- package/src/skills/slash-commands.ts +174 -0
- package/src/skills/tool-manifest.ts +165 -0
- package/src/skills/version-hash.ts +110 -0
- package/src/slack/slack-webhook.ts +61 -0
- package/src/subagent/index.ts +19 -0
- package/src/subagent/manager.ts +511 -0
- package/src/subagent/types.ts +69 -0
- package/src/swarm/backend-claude-code.ts +145 -0
- package/src/swarm/index.ts +44 -0
- package/src/swarm/limits.ts +37 -0
- package/src/swarm/orchestrator.ts +279 -0
- package/src/swarm/plan-validator.ts +151 -0
- package/src/swarm/router-planner.ts +100 -0
- package/src/swarm/router-prompts.ts +36 -0
- package/src/swarm/synthesizer.ts +62 -0
- package/src/swarm/types.ts +62 -0
- package/src/swarm/worker-backend.ts +121 -0
- package/src/swarm/worker-prompts.ts +79 -0
- package/src/swarm/worker-runner.ts +164 -0
- package/src/tasks/SPEC.md +139 -0
- package/src/tasks/candidate-store.ts +86 -0
- package/src/tasks/ephemeral-permissions.ts +48 -0
- package/src/tasks/task-compiler.ts +199 -0
- package/src/tasks/task-runner.ts +90 -0
- package/src/tasks/task-scheduler.ts +21 -0
- package/src/tasks/task-store.ts +127 -0
- package/src/tasks/tool-sanitizer.ts +36 -0
- package/src/tools/apps/definitions.ts +59 -0
- package/src/tools/apps/executors.ts +313 -0
- package/src/tools/apps/open-proxy.ts +43 -0
- package/src/tools/apps/registry.ts +16 -0
- package/src/tools/assets/materialize.ts +218 -0
- package/src/tools/assets/search.ts +361 -0
- package/src/tools/browser/__tests__/auth-cache.test.ts +219 -0
- package/src/tools/browser/__tests__/auth-detector.test.ts +362 -0
- package/src/tools/browser/__tests__/jit-auth.test.ts +189 -0
- package/src/tools/browser/api-map.ts +293 -0
- package/src/tools/browser/auth-cache.ts +149 -0
- package/src/tools/browser/auth-detector.ts +347 -0
- package/src/tools/browser/auto-navigate.ts +270 -0
- package/src/tools/browser/browser-execution.ts +980 -0
- package/src/tools/browser/browser-handoff.ts +79 -0
- package/src/tools/browser/browser-manager.ts +715 -0
- package/src/tools/browser/browser-screencast.ts +217 -0
- package/src/tools/browser/headless-browser.ts +450 -0
- package/src/tools/browser/jit-auth.ts +51 -0
- package/src/tools/browser/network-recorder.ts +349 -0
- package/src/tools/browser/network-recording-types.ts +49 -0
- package/src/tools/browser/recording-store.ts +49 -0
- package/src/tools/browser/runtime-check.ts +43 -0
- package/src/tools/browser/x-auto-navigate.ts +207 -0
- package/src/tools/calls/call-end.ts +67 -0
- package/src/tools/calls/call-start.ts +81 -0
- package/src/tools/calls/call-status.ts +81 -0
- package/src/tools/claude-code/claude-code.ts +428 -0
- package/src/tools/computer-use/definitions.ts +443 -0
- package/src/tools/computer-use/registry.ts +22 -0
- package/src/tools/computer-use/request-computer-control.ts +53 -0
- package/src/tools/computer-use/skill-proxy-bridge.ts +28 -0
- package/src/tools/credentials/account-registry.ts +127 -0
- package/src/tools/credentials/broker-types.ts +107 -0
- package/src/tools/credentials/broker.ts +372 -0
- package/src/tools/credentials/domain-policy.ts +51 -0
- package/src/tools/credentials/host-pattern-match.ts +60 -0
- package/src/tools/credentials/metadata-store.ts +335 -0
- package/src/tools/credentials/policy-types.ts +52 -0
- package/src/tools/credentials/policy-validate.ts +80 -0
- package/src/tools/credentials/resolve.ts +122 -0
- package/src/tools/credentials/selection.ts +159 -0
- package/src/tools/credentials/tool-policy.ts +25 -0
- package/src/tools/credentials/vault.ts +657 -0
- package/src/tools/document/document-tool.ts +92 -0
- package/src/tools/document/editor-template.ts +237 -0
- package/src/tools/execution-target.ts +21 -0
- package/src/tools/execution-timeout.ts +49 -0
- package/src/tools/executor.ts +815 -0
- package/src/tools/filesystem/edit.ts +127 -0
- package/src/tools/filesystem/fuzzy-match.ts +202 -0
- package/src/tools/filesystem/read.ts +71 -0
- package/src/tools/filesystem/view-image.ts +199 -0
- package/src/tools/filesystem/write.ts +79 -0
- package/src/tools/followups/followup_create.ts +76 -0
- package/src/tools/followups/followup_list.ts +60 -0
- package/src/tools/followups/followup_resolve.ts +56 -0
- package/src/tools/host-filesystem/edit.ts +125 -0
- package/src/tools/host-filesystem/read.ts +80 -0
- package/src/tools/host-filesystem/write.ts +76 -0
- package/src/tools/host-terminal/cli-discover.ts +180 -0
- package/src/tools/host-terminal/host-shell.ts +191 -0
- package/src/tools/memory/definitions.ts +69 -0
- package/src/tools/memory/handlers.ts +246 -0
- package/src/tools/memory/register.ts +66 -0
- package/src/tools/network/__tests__/web-search.test.ts +427 -0
- package/src/tools/network/domain-normalize.ts +85 -0
- package/src/tools/network/script-proxy/__tests__/logging.test.ts +248 -0
- package/src/tools/network/script-proxy/__tests__/policy.test.ts +234 -0
- package/src/tools/network/script-proxy/__tests__/router.test.ts +76 -0
- package/src/tools/network/script-proxy/certs.ts +237 -0
- package/src/tools/network/script-proxy/connect-tunnel.ts +82 -0
- package/src/tools/network/script-proxy/http-forwarder.ts +151 -0
- package/src/tools/network/script-proxy/index.ts +28 -0
- package/src/tools/network/script-proxy/logging.ts +196 -0
- package/src/tools/network/script-proxy/mitm-handler.ts +269 -0
- package/src/tools/network/script-proxy/policy.ts +152 -0
- package/src/tools/network/script-proxy/router.ts +60 -0
- package/src/tools/network/script-proxy/server.ts +136 -0
- package/src/tools/network/script-proxy/session-manager.ts +534 -0
- package/src/tools/network/script-proxy/types.ts +125 -0
- package/src/tools/network/url-safety.ts +227 -0
- package/src/tools/network/web-fetch.ts +713 -0
- package/src/tools/network/web-search.ts +296 -0
- package/src/tools/policy-context.ts +29 -0
- package/src/tools/registry.ts +295 -0
- package/src/tools/reminder/reminder-store.ts +148 -0
- package/src/tools/reminder/reminder.ts +80 -0
- package/src/tools/schedule/create.ts +81 -0
- package/src/tools/schedule/delete.ts +28 -0
- package/src/tools/schedule/list.ts +69 -0
- package/src/tools/schedule/update.ts +97 -0
- package/src/tools/shared/filesystem/edit-engine.ts +56 -0
- package/src/tools/shared/filesystem/errors.ts +85 -0
- package/src/tools/shared/filesystem/file-ops-service.ts +215 -0
- package/src/tools/shared/filesystem/format-diff.ts +35 -0
- package/src/tools/shared/filesystem/path-policy.ts +125 -0
- package/src/tools/shared/filesystem/size-guard.ts +41 -0
- package/src/tools/shared/filesystem/types.ts +80 -0
- package/src/tools/shared/shell-output.ts +52 -0
- package/src/tools/skills/delete-managed.ts +60 -0
- package/src/tools/skills/load.ts +139 -0
- package/src/tools/skills/sandbox-runner.ts +279 -0
- package/src/tools/skills/scaffold-managed.ts +150 -0
- package/src/tools/skills/script-contract.ts +6 -0
- package/src/tools/skills/skill-script-runner.ts +86 -0
- package/src/tools/skills/skill-tool-factory.ts +64 -0
- package/src/tools/skills/vellum-catalog.ts +217 -0
- package/src/tools/subagent/abort.ts +33 -0
- package/src/tools/subagent/message.ts +39 -0
- package/src/tools/subagent/read.ts +67 -0
- package/src/tools/subagent/spawn.ts +46 -0
- package/src/tools/subagent/status.ts +45 -0
- package/src/tools/swarm/delegate.ts +183 -0
- package/src/tools/system/request-permission.ts +98 -0
- package/src/tools/system/version.ts +43 -0
- package/src/tools/tasks/index.ts +27 -0
- package/src/tools/tasks/task-delete.ts +82 -0
- package/src/tools/tasks/task-list.ts +44 -0
- package/src/tools/tasks/task-run.ts +97 -0
- package/src/tools/tasks/task-save.ts +47 -0
- package/src/tools/tasks/work-item-enqueue.ts +234 -0
- package/src/tools/tasks/work-item-list.ts +55 -0
- package/src/tools/tasks/work-item-remove.ts +60 -0
- package/src/tools/tasks/work-item-run.ts +78 -0
- package/src/tools/tasks/work-item-update.ts +114 -0
- package/src/tools/terminal/backends/docker.ts +372 -0
- package/src/tools/terminal/backends/native.ts +190 -0
- package/src/tools/terminal/backends/types.ts +26 -0
- package/src/tools/terminal/evaluate-typescript.ts +275 -0
- package/src/tools/terminal/parser.ts +413 -0
- package/src/tools/terminal/safe-env.ts +37 -0
- package/src/tools/terminal/sandbox-diagnostics.ts +149 -0
- package/src/tools/terminal/sandbox.ts +44 -0
- package/src/tools/terminal/shell.ts +257 -0
- package/src/tools/tool-manifest.ts +198 -0
- package/src/tools/types.ts +176 -0
- package/src/tools/ui-surface/definitions.ts +244 -0
- package/src/tools/ui-surface/registry.ts +14 -0
- package/src/tools/watch/screen-watch.ts +130 -0
- package/src/tools/watch/watch-state.ts +119 -0
- package/src/tools/watcher/create.ts +64 -0
- package/src/tools/watcher/delete.ts +27 -0
- package/src/tools/watcher/digest.ts +50 -0
- package/src/tools/watcher/list.ts +60 -0
- package/src/tools/watcher/update.ts +56 -0
- package/src/tools/weather/service.ts +551 -0
- package/src/twitter/client.ts +690 -0
- package/src/twitter/oauth-client.ts +102 -0
- package/src/twitter/router.ts +101 -0
- package/src/twitter/session.ts +91 -0
- package/src/usage/actors.ts +24 -0
- package/src/usage/types.ts +37 -0
- package/src/util/clipboard.ts +33 -0
- package/src/util/content-id.ts +16 -0
- package/src/util/debounce.ts +88 -0
- package/src/util/diff.ts +181 -0
- package/src/util/errors.ts +129 -0
- package/src/util/logger.ts +243 -0
- package/src/util/network-info.ts +47 -0
- package/src/util/platform.ts +632 -0
- package/src/util/pricing.ts +150 -0
- package/src/util/promise-guard.ts +37 -0
- package/src/util/retry.ts +98 -0
- package/src/util/spinner.ts +51 -0
- package/src/util/time.ts +16 -0
- package/src/util/truncate.ts +6 -0
- package/src/util/xml.ts +4 -0
- package/src/version.ts +3 -0
- package/src/watcher/constants.ts +11 -0
- package/src/watcher/engine.ts +199 -0
- package/src/watcher/provider-registry.ts +15 -0
- package/src/watcher/provider-types.ts +48 -0
- package/src/watcher/providers/gmail.ts +198 -0
- package/src/watcher/providers/google-calendar.ts +228 -0
- package/src/watcher/providers/slack.ts +129 -0
- package/src/watcher/watcher-store.ts +419 -0
- package/src/work-items/work-item-runner.ts +171 -0
- package/src/work-items/work-item-store.ts +325 -0
- package/src/workspace/commit-message-enrichment-service.ts +284 -0
- package/src/workspace/commit-message-provider.ts +95 -0
- package/src/workspace/git-service.ts +857 -0
- package/src/workspace/heartbeat-service.ts +345 -0
- package/src/workspace/provider-commit-message-generator.ts +285 -0
- package/src/workspace/top-level-renderer.ts +19 -0
- package/src/workspace/top-level-scanner.ts +41 -0
- package/src/workspace/turn-commit.ts +175 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,2551 @@
|
|
|
1
|
+
import type { GalleryManifest } from '../gallery/gallery-manifest.js';
|
|
2
|
+
|
|
3
|
+
// === Shared types ===
|
|
4
|
+
|
|
5
|
+
export type ThreadType = 'standard' | 'private';
|
|
6
|
+
|
|
7
|
+
/** Runtime normalizer — collapses unknown/legacy DB values to 'standard'. */
|
|
8
|
+
export function normalizeThreadType(raw: string | null | undefined): ThreadType {
|
|
9
|
+
return raw === 'private' ? 'private' : 'standard';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface IpcBlobRef {
|
|
13
|
+
id: string;
|
|
14
|
+
kind: 'ax_tree' | 'screenshot_jpeg';
|
|
15
|
+
encoding: 'utf8' | 'binary';
|
|
16
|
+
byteLength: number;
|
|
17
|
+
sha256?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface UsageStats {
|
|
21
|
+
inputTokens: number;
|
|
22
|
+
outputTokens: number;
|
|
23
|
+
estimatedCost: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// === Client → Server messages ===
|
|
27
|
+
|
|
28
|
+
export interface UserMessage {
|
|
29
|
+
type: 'user_message';
|
|
30
|
+
sessionId: string;
|
|
31
|
+
content?: string;
|
|
32
|
+
attachments?: UserMessageAttachment[];
|
|
33
|
+
activeSurfaceId?: string;
|
|
34
|
+
/** The page currently displayed in the WebView (e.g. "settings.html"). */
|
|
35
|
+
currentPage?: string;
|
|
36
|
+
/** When true, skip the secret-ingress check. Set by the client when the user clicks "Send Anyway". */
|
|
37
|
+
bypassSecretCheck?: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface UserMessageAttachment {
|
|
41
|
+
id?: string;
|
|
42
|
+
filename: string;
|
|
43
|
+
mimeType: string;
|
|
44
|
+
data: string;
|
|
45
|
+
extractedText?: string;
|
|
46
|
+
/** Original file size in bytes. Present when data was omitted from history_response to reduce payload size. */
|
|
47
|
+
sizeBytes?: number;
|
|
48
|
+
/** Base64-encoded JPEG thumbnail. Generated server-side for video attachments. */
|
|
49
|
+
thumbnailData?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface ConfirmationResponse {
|
|
53
|
+
type: 'confirmation_response';
|
|
54
|
+
requestId: string;
|
|
55
|
+
decision: 'allow' | 'always_allow' | 'always_allow_high_risk' | 'deny' | 'always_deny';
|
|
56
|
+
selectedPattern?: string;
|
|
57
|
+
selectedScope?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface SecretResponse {
|
|
61
|
+
type: 'secret_response';
|
|
62
|
+
requestId: string;
|
|
63
|
+
value?: string; // undefined = user cancelled
|
|
64
|
+
/** How the secret should be delivered: 'store' persists to keychain (default), 'transient_send' for one-time use without persisting. */
|
|
65
|
+
delivery?: 'store' | 'transient_send';
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface SessionListRequest {
|
|
69
|
+
type: 'session_list';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Lightweight session transport metadata for channel identity and natural-language guidance. */
|
|
73
|
+
export interface SessionTransportMetadata {
|
|
74
|
+
/** Logical channel identifier (e.g. "desktop", "telegram", "mobile"). */
|
|
75
|
+
channelId: string;
|
|
76
|
+
/** Optional natural-language hints for channel-specific UX behavior. */
|
|
77
|
+
hints?: string[];
|
|
78
|
+
/** Optional concise UX brief for this channel. */
|
|
79
|
+
uxBrief?: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface SessionCreateRequest {
|
|
83
|
+
type: 'session_create';
|
|
84
|
+
title?: string;
|
|
85
|
+
systemPromptOverride?: string;
|
|
86
|
+
maxResponseTokens?: number;
|
|
87
|
+
correlationId?: string;
|
|
88
|
+
transport?: SessionTransportMetadata;
|
|
89
|
+
threadType?: ThreadType;
|
|
90
|
+
/** Skill IDs to pre-activate in the new session (loaded before the first message). */
|
|
91
|
+
preactivatedSkillIds?: string[];
|
|
92
|
+
/** If provided, automatically sent as the first user message after session creation. */
|
|
93
|
+
initialMessage?: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface SessionSwitchRequest {
|
|
97
|
+
type: 'session_switch';
|
|
98
|
+
sessionId: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface AuthMessage {
|
|
102
|
+
type: 'auth';
|
|
103
|
+
token: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface PingMessage {
|
|
107
|
+
type: 'ping';
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface CancelRequest {
|
|
111
|
+
type: 'cancel';
|
|
112
|
+
sessionId?: string;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface DeleteQueuedMessage {
|
|
116
|
+
type: 'delete_queued_message';
|
|
117
|
+
sessionId: string;
|
|
118
|
+
requestId: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface ModelGetRequest {
|
|
122
|
+
type: 'model_get';
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface ModelSetRequest {
|
|
126
|
+
type: 'model_set';
|
|
127
|
+
model: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface ImageGenModelSetRequest {
|
|
131
|
+
type: 'image_gen_model_set';
|
|
132
|
+
model: string;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface HistoryRequest {
|
|
136
|
+
type: 'history_request';
|
|
137
|
+
sessionId: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface UndoRequest {
|
|
141
|
+
type: 'undo';
|
|
142
|
+
sessionId: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface RegenerateRequest {
|
|
146
|
+
type: 'regenerate';
|
|
147
|
+
sessionId: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface UsageRequest {
|
|
151
|
+
type: 'usage_request';
|
|
152
|
+
sessionId: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface SandboxSetRequest {
|
|
156
|
+
type: 'sandbox_set';
|
|
157
|
+
enabled: boolean;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface CuSessionCreate {
|
|
161
|
+
type: 'cu_session_create';
|
|
162
|
+
sessionId: string;
|
|
163
|
+
task: string;
|
|
164
|
+
screenWidth: number;
|
|
165
|
+
screenHeight: number;
|
|
166
|
+
attachments?: UserMessageAttachment[];
|
|
167
|
+
interactionType?: 'computer_use' | 'text_qa';
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface CuSessionAbort {
|
|
171
|
+
type: 'cu_session_abort';
|
|
172
|
+
sessionId: string;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export interface CuObservation {
|
|
176
|
+
type: 'cu_observation';
|
|
177
|
+
sessionId: string;
|
|
178
|
+
axTree?: string;
|
|
179
|
+
axDiff?: string;
|
|
180
|
+
secondaryWindows?: string;
|
|
181
|
+
screenshot?: string;
|
|
182
|
+
/** Screenshot image width in pixels (`Px`). */
|
|
183
|
+
screenshotWidthPx?: number;
|
|
184
|
+
/** Screenshot image height in pixels (`Px`). */
|
|
185
|
+
screenshotHeightPx?: number;
|
|
186
|
+
/** Screen width in macOS points (`Pt`) used by native execution. */
|
|
187
|
+
screenWidthPt?: number;
|
|
188
|
+
/** Screen height in macOS points (`Pt`) used by native execution. */
|
|
189
|
+
screenHeightPt?: number;
|
|
190
|
+
/** Coordinate origin convention used by the observation payload. */
|
|
191
|
+
coordinateOrigin?: 'top_left';
|
|
192
|
+
/** Display ID used by screenshot capture for this observation. */
|
|
193
|
+
captureDisplayId?: number;
|
|
194
|
+
executionResult?: string;
|
|
195
|
+
executionError?: string;
|
|
196
|
+
axTreeBlob?: IpcBlobRef;
|
|
197
|
+
screenshotBlob?: IpcBlobRef;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export interface TaskSubmit {
|
|
201
|
+
type: 'task_submit';
|
|
202
|
+
task: string;
|
|
203
|
+
screenWidth: number;
|
|
204
|
+
screenHeight: number;
|
|
205
|
+
attachments?: UserMessageAttachment[];
|
|
206
|
+
source?: 'voice' | 'text';
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export interface RideShotgunStart {
|
|
210
|
+
type: 'ride_shotgun_start';
|
|
211
|
+
durationSeconds: number;
|
|
212
|
+
intervalSeconds: number;
|
|
213
|
+
mode?: 'observe' | 'learn';
|
|
214
|
+
targetDomain?: string;
|
|
215
|
+
/** Domain to auto-navigate (may differ from targetDomain, e.g. open.spotify.com vs spotify.com). */
|
|
216
|
+
navigateDomain?: string;
|
|
217
|
+
autoNavigate?: boolean;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export interface RideShotgunStop {
|
|
221
|
+
type: 'ride_shotgun_stop';
|
|
222
|
+
watchId: string;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export interface WatchObservation {
|
|
226
|
+
type: 'watch_observation';
|
|
227
|
+
watchId: string;
|
|
228
|
+
sessionId: string;
|
|
229
|
+
ocrText: string;
|
|
230
|
+
appName?: string;
|
|
231
|
+
windowTitle?: string;
|
|
232
|
+
bundleIdentifier?: string;
|
|
233
|
+
timestamp: number;
|
|
234
|
+
captureIndex: number;
|
|
235
|
+
totalExpected: number;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export interface AppDataRequest {
|
|
239
|
+
type: 'app_data_request';
|
|
240
|
+
surfaceId: string;
|
|
241
|
+
callId: string;
|
|
242
|
+
method: 'query' | 'create' | 'update' | 'delete';
|
|
243
|
+
appId: string;
|
|
244
|
+
recordId?: string;
|
|
245
|
+
data?: Record<string, unknown>;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface SkillsListRequest {
|
|
249
|
+
type: 'skills_list';
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export interface SkillDetailRequest {
|
|
253
|
+
type: 'skill_detail';
|
|
254
|
+
skillId: string;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export interface SkillsEnableRequest {
|
|
258
|
+
type: 'skills_enable';
|
|
259
|
+
name: string;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export interface SkillsDisableRequest {
|
|
263
|
+
type: 'skills_disable';
|
|
264
|
+
name: string;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export interface SkillsConfigureRequest {
|
|
268
|
+
type: 'skills_configure';
|
|
269
|
+
name: string;
|
|
270
|
+
env?: Record<string, string>;
|
|
271
|
+
apiKey?: string;
|
|
272
|
+
config?: Record<string, unknown>;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export interface SkillsInstallRequest {
|
|
276
|
+
type: 'skills_install';
|
|
277
|
+
slug: string;
|
|
278
|
+
version?: string;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export interface SkillsUninstallRequest {
|
|
282
|
+
type: 'skills_uninstall';
|
|
283
|
+
name: string;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export interface SkillsUpdateRequest {
|
|
287
|
+
type: 'skills_update';
|
|
288
|
+
name: string;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export interface SkillsCheckUpdatesRequest {
|
|
292
|
+
type: 'skills_check_updates';
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export interface SkillsSearchRequest {
|
|
296
|
+
type: 'skills_search';
|
|
297
|
+
query: string;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export interface SessionsClearRequest {
|
|
301
|
+
type: 'sessions_clear';
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export interface SkillsInspectRequest {
|
|
305
|
+
type: 'skills_inspect';
|
|
306
|
+
slug: string;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export interface SuggestionRequest {
|
|
310
|
+
type: 'suggestion_request';
|
|
311
|
+
sessionId: string;
|
|
312
|
+
requestId: string;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export interface AddTrustRule {
|
|
316
|
+
type: 'add_trust_rule';
|
|
317
|
+
toolName: string;
|
|
318
|
+
pattern: string;
|
|
319
|
+
scope: string;
|
|
320
|
+
decision: 'allow' | 'deny' | 'ask';
|
|
321
|
+
/** When true, the rule also covers high-risk invocations. */
|
|
322
|
+
allowHighRisk?: boolean;
|
|
323
|
+
/** Execution target override for this rule. */
|
|
324
|
+
executionTarget?: 'host' | 'sandbox';
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export interface TrustRulesList {
|
|
328
|
+
type: 'trust_rules_list';
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export interface RemoveTrustRule {
|
|
332
|
+
type: 'remove_trust_rule';
|
|
333
|
+
id: string;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export interface UpdateTrustRule {
|
|
337
|
+
type: 'update_trust_rule';
|
|
338
|
+
id: string;
|
|
339
|
+
tool?: string;
|
|
340
|
+
pattern?: string;
|
|
341
|
+
scope?: string;
|
|
342
|
+
decision?: 'allow' | 'deny' | 'ask';
|
|
343
|
+
priority?: number;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export interface AcceptStarterBundle {
|
|
347
|
+
type: 'accept_starter_bundle';
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export interface SchedulesList {
|
|
351
|
+
type: 'schedules_list';
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export interface RemindersList {
|
|
355
|
+
type: 'reminders_list';
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export interface ReminderCancel {
|
|
359
|
+
type: 'reminder_cancel';
|
|
360
|
+
id: string;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export interface ScheduleToggle {
|
|
364
|
+
type: 'schedule_toggle';
|
|
365
|
+
id: string;
|
|
366
|
+
enabled: boolean;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export interface ScheduleRemove {
|
|
370
|
+
type: 'schedule_remove';
|
|
371
|
+
id: string;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export interface AppsListRequest {
|
|
375
|
+
type: 'apps_list';
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export interface HomeBaseGetRequest {
|
|
379
|
+
type: 'home_base_get';
|
|
380
|
+
/** If true, daemon ensures a durable Home Base link exists before responding. */
|
|
381
|
+
ensureLinked?: boolean;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export interface AppOpenRequest {
|
|
385
|
+
type: 'app_open_request';
|
|
386
|
+
appId: string;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export interface SharedAppsListRequest {
|
|
390
|
+
type: 'shared_apps_list';
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export interface SharedAppDeleteRequest {
|
|
394
|
+
type: 'shared_app_delete';
|
|
395
|
+
uuid: string;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export interface ForkSharedAppRequest {
|
|
399
|
+
type: 'fork_shared_app';
|
|
400
|
+
uuid: string;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
export interface BundleAppRequest {
|
|
404
|
+
type: 'bundle_app';
|
|
405
|
+
appId: string;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
export interface AppUpdatePreviewRequest {
|
|
409
|
+
type: 'app_update_preview';
|
|
410
|
+
appId: string;
|
|
411
|
+
/** Base64-encoded PNG screenshot thumbnail. */
|
|
412
|
+
preview: string;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export interface AppUpdatePreviewResponse {
|
|
416
|
+
type: 'app_update_preview_response';
|
|
417
|
+
success: boolean;
|
|
418
|
+
appId: string;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
export interface AppPreviewRequest {
|
|
422
|
+
type: 'app_preview_request';
|
|
423
|
+
appId: string;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
export interface AppPreviewResponse {
|
|
427
|
+
type: 'app_preview_response';
|
|
428
|
+
appId: string;
|
|
429
|
+
preview?: string;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export interface OpenBundleRequest {
|
|
433
|
+
type: 'open_bundle';
|
|
434
|
+
filePath: string;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
export interface SignBundlePayloadResponse {
|
|
438
|
+
type: 'sign_bundle_payload_response';
|
|
439
|
+
requestId: string;
|
|
440
|
+
signature?: string;
|
|
441
|
+
keyId?: string;
|
|
442
|
+
publicKey?: string;
|
|
443
|
+
error?: string;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export interface GetSigningIdentityResponse {
|
|
447
|
+
type: 'get_signing_identity_response';
|
|
448
|
+
requestId: string;
|
|
449
|
+
keyId?: string;
|
|
450
|
+
publicKey?: string;
|
|
451
|
+
error?: string;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
export interface GalleryListRequest {
|
|
455
|
+
type: 'gallery_list';
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
export interface GalleryInstallRequest {
|
|
459
|
+
type: 'gallery_install';
|
|
460
|
+
galleryAppId: string;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
export interface AppHistoryRequest {
|
|
464
|
+
type: 'app_history_request';
|
|
465
|
+
appId: string;
|
|
466
|
+
limit?: number;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
export interface AppDiffRequest {
|
|
470
|
+
type: 'app_diff_request';
|
|
471
|
+
appId: string;
|
|
472
|
+
fromCommit: string;
|
|
473
|
+
toCommit?: string;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
export interface AppFileAtVersionRequest {
|
|
477
|
+
type: 'app_file_at_version_request';
|
|
478
|
+
appId: string;
|
|
479
|
+
path: string;
|
|
480
|
+
commitHash: string;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
export interface AppRestoreRequest {
|
|
484
|
+
type: 'app_restore_request';
|
|
485
|
+
appId: string;
|
|
486
|
+
commitHash: string;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
export interface ShareAppCloudRequest {
|
|
490
|
+
type: 'share_app_cloud';
|
|
491
|
+
appId: string;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export interface ShareToSlackRequest {
|
|
495
|
+
type: 'share_to_slack';
|
|
496
|
+
appId: string;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
export interface SlackWebhookConfigRequest {
|
|
500
|
+
type: 'slack_webhook_config';
|
|
501
|
+
action: 'get' | 'set';
|
|
502
|
+
webhookUrl?: string;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
export interface IngressConfigRequest {
|
|
506
|
+
type: 'ingress_config';
|
|
507
|
+
action: 'get' | 'set';
|
|
508
|
+
publicBaseUrl?: string;
|
|
509
|
+
enabled?: boolean;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
export interface VercelApiConfigRequest {
|
|
513
|
+
type: 'vercel_api_config';
|
|
514
|
+
action: 'get' | 'set' | 'delete';
|
|
515
|
+
apiToken?: string;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
export interface VercelApiConfigResponse {
|
|
519
|
+
type: 'vercel_api_config_response';
|
|
520
|
+
hasToken: boolean;
|
|
521
|
+
success: boolean;
|
|
522
|
+
error?: string;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
export interface TwitterIntegrationConfigRequest {
|
|
526
|
+
type: 'twitter_integration_config';
|
|
527
|
+
action: 'get' | 'set_mode' | 'set_local_client' | 'clear_local_client' | 'disconnect' | 'get_strategy' | 'set_strategy';
|
|
528
|
+
mode?: 'local_byo' | 'managed';
|
|
529
|
+
clientId?: string;
|
|
530
|
+
clientSecret?: string;
|
|
531
|
+
strategy?: string;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
export interface TelegramConfigRequest {
|
|
535
|
+
type: 'telegram_config';
|
|
536
|
+
action: 'get' | 'set' | 'clear' | 'set_commands';
|
|
537
|
+
botToken?: string; // Only for action: 'set'
|
|
538
|
+
commands?: Array<{ command: string; description: string }>; // Only for action: 'set_commands'
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
export interface TelegramConfigResponse {
|
|
542
|
+
type: 'telegram_config_response';
|
|
543
|
+
success: boolean;
|
|
544
|
+
hasBotToken: boolean;
|
|
545
|
+
botUsername?: string;
|
|
546
|
+
connected: boolean;
|
|
547
|
+
hasWebhookSecret: boolean;
|
|
548
|
+
lastError?: string;
|
|
549
|
+
error?: string;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
export interface TwilioConfigRequest {
|
|
553
|
+
type: 'twilio_config';
|
|
554
|
+
action: 'get' | 'set_credentials' | 'clear_credentials' | 'provision_number' | 'assign_number' | 'list_numbers';
|
|
555
|
+
accountSid?: string; // Only for action: 'set_credentials'
|
|
556
|
+
authToken?: string; // Only for action: 'set_credentials'
|
|
557
|
+
phoneNumber?: string; // Only for action: 'assign_number'
|
|
558
|
+
areaCode?: string; // Only for action: 'provision_number'
|
|
559
|
+
country?: string; // Only for action: 'provision_number' (ISO 3166-1 alpha-2, default 'US')
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
export interface TwilioConfigResponse {
|
|
563
|
+
type: 'twilio_config_response';
|
|
564
|
+
success: boolean;
|
|
565
|
+
hasCredentials: boolean;
|
|
566
|
+
phoneNumber?: string;
|
|
567
|
+
numbers?: Array<{ phoneNumber: string; friendlyName: string; capabilities: { voice: boolean; sms: boolean } }>;
|
|
568
|
+
error?: string;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
export interface GuardianVerificationRequest {
|
|
572
|
+
type: 'guardian_verification';
|
|
573
|
+
action: 'create_challenge' | 'status' | 'revoke';
|
|
574
|
+
channel?: string; // Defaults to 'telegram'
|
|
575
|
+
sessionId?: string;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
export interface GuardianVerificationResponse {
|
|
579
|
+
type: 'guardian_verification_response';
|
|
580
|
+
success: boolean;
|
|
581
|
+
secret?: string;
|
|
582
|
+
instruction?: string;
|
|
583
|
+
/** Present when action is 'status'. */
|
|
584
|
+
bound?: boolean;
|
|
585
|
+
guardianExternalUserId?: string;
|
|
586
|
+
error?: string;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
export interface TwitterIntegrationConfigResponse {
|
|
590
|
+
type: 'twitter_integration_config_response';
|
|
591
|
+
success: boolean;
|
|
592
|
+
mode?: 'local_byo' | 'managed';
|
|
593
|
+
managedAvailable: boolean;
|
|
594
|
+
localClientConfigured: boolean;
|
|
595
|
+
connected: boolean;
|
|
596
|
+
accountInfo?: string;
|
|
597
|
+
strategy?: 'oauth' | 'browser' | 'auto';
|
|
598
|
+
/** Whether the user has explicitly set a strategy (vs. relying on the default 'auto'). */
|
|
599
|
+
strategyConfigured?: boolean;
|
|
600
|
+
error?: string;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
export interface TwitterAuthStartRequest {
|
|
604
|
+
type: 'twitter_auth_start';
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
export interface TwitterAuthStatusRequest {
|
|
608
|
+
type: 'twitter_auth_status';
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
export interface TwitterAuthResult {
|
|
612
|
+
type: 'twitter_auth_result';
|
|
613
|
+
success: boolean;
|
|
614
|
+
accountInfo?: string;
|
|
615
|
+
error?: string;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
export interface TwitterAuthStatusResponse {
|
|
619
|
+
type: 'twitter_auth_status_response';
|
|
620
|
+
connected: boolean;
|
|
621
|
+
accountInfo?: string;
|
|
622
|
+
mode?: 'local_byo' | 'managed';
|
|
623
|
+
error?: string;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
export interface LinkOpenRequest {
|
|
627
|
+
type: 'link_open_request';
|
|
628
|
+
url: string;
|
|
629
|
+
metadata?: Record<string, unknown>;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
export interface DiagnosticsExportRequest {
|
|
633
|
+
type: 'diagnostics_export_request';
|
|
634
|
+
conversationId: string;
|
|
635
|
+
anchorMessageId?: string; // if omitted, use latest assistant message
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
export interface EnvVarsRequest {
|
|
639
|
+
type: 'env_vars_request';
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
export interface IpcBlobProbe {
|
|
643
|
+
type: 'ipc_blob_probe';
|
|
644
|
+
probeId: string;
|
|
645
|
+
nonceSha256: string;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
// === Surface types ===
|
|
649
|
+
|
|
650
|
+
export type SurfaceType = 'card' | 'form' | 'list' | 'table' | 'confirmation' | 'dynamic_page' | 'file_upload' | 'browser_view' | 'document_preview';
|
|
651
|
+
|
|
652
|
+
export const INTERACTIVE_SURFACE_TYPES: SurfaceType[] = ['form', 'confirmation', 'dynamic_page', 'file_upload'];
|
|
653
|
+
|
|
654
|
+
export interface SurfaceAction {
|
|
655
|
+
id: string;
|
|
656
|
+
label: string;
|
|
657
|
+
style?: 'primary' | 'secondary' | 'destructive';
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
export interface CardSurfaceData {
|
|
661
|
+
title: string;
|
|
662
|
+
subtitle?: string;
|
|
663
|
+
body: string;
|
|
664
|
+
metadata?: Array<{ label: string; value: string }>;
|
|
665
|
+
/** Optional template name for specialized rendering (e.g. "weather_forecast"). */
|
|
666
|
+
template?: string;
|
|
667
|
+
/** Arbitrary data consumed by the template renderer. Shape depends on template. */
|
|
668
|
+
templateData?: Record<string, unknown>;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
export interface FormField {
|
|
672
|
+
id: string;
|
|
673
|
+
type: 'text' | 'textarea' | 'select' | 'toggle' | 'number' | 'password';
|
|
674
|
+
label: string;
|
|
675
|
+
placeholder?: string;
|
|
676
|
+
required?: boolean;
|
|
677
|
+
defaultValue?: string | number | boolean;
|
|
678
|
+
options?: Array<{ label: string; value: string }>;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
export interface FormPage {
|
|
682
|
+
id: string;
|
|
683
|
+
title: string;
|
|
684
|
+
description?: string;
|
|
685
|
+
fields: FormField[];
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
export interface FormSurfaceData {
|
|
689
|
+
description?: string;
|
|
690
|
+
fields: FormField[];
|
|
691
|
+
submitLabel?: string;
|
|
692
|
+
pages?: FormPage[];
|
|
693
|
+
pageLabels?: { next?: string; back?: string; submit?: string };
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
export interface ListItem {
|
|
697
|
+
id: string;
|
|
698
|
+
title: string;
|
|
699
|
+
subtitle?: string;
|
|
700
|
+
icon?: string;
|
|
701
|
+
selected?: boolean;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
export interface ListSurfaceData {
|
|
705
|
+
items: ListItem[];
|
|
706
|
+
selectionMode: 'single' | 'multiple' | 'none';
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
export interface ConfirmationSurfaceData {
|
|
710
|
+
message: string;
|
|
711
|
+
detail?: string;
|
|
712
|
+
confirmLabel?: string;
|
|
713
|
+
cancelLabel?: string;
|
|
714
|
+
destructive?: boolean;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
export interface DynamicPagePreview {
|
|
718
|
+
title: string;
|
|
719
|
+
subtitle?: string;
|
|
720
|
+
description?: string;
|
|
721
|
+
icon?: string;
|
|
722
|
+
metrics?: Array<{ label: string; value: string }>;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
export interface DynamicPageSurfaceData {
|
|
726
|
+
html: string;
|
|
727
|
+
width?: number;
|
|
728
|
+
height?: number;
|
|
729
|
+
appId?: string;
|
|
730
|
+
appType?: string;
|
|
731
|
+
reloadGeneration?: number;
|
|
732
|
+
status?: string;
|
|
733
|
+
preview?: DynamicPagePreview;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
export interface FileUploadSurfaceData {
|
|
737
|
+
prompt: string;
|
|
738
|
+
acceptedTypes?: string[];
|
|
739
|
+
maxFiles?: number;
|
|
740
|
+
maxSizeBytes?: number;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
export interface TableColumn {
|
|
744
|
+
id: string;
|
|
745
|
+
label: string;
|
|
746
|
+
width?: number;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
export interface TableRow {
|
|
750
|
+
id: string;
|
|
751
|
+
cells: Record<string, string>;
|
|
752
|
+
selectable?: boolean;
|
|
753
|
+
selected?: boolean;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
export interface TableSurfaceData {
|
|
757
|
+
columns: TableColumn[];
|
|
758
|
+
rows: TableRow[];
|
|
759
|
+
selectionMode?: 'none' | 'single' | 'multiple';
|
|
760
|
+
caption?: string;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
export interface BrowserViewSurfaceData {
|
|
764
|
+
sessionId: string;
|
|
765
|
+
currentUrl: string;
|
|
766
|
+
status: 'navigating' | 'idle' | 'interacting';
|
|
767
|
+
frame?: string; // base64 JPEG
|
|
768
|
+
actionText?: string; // "Clicking 'Submit' button"
|
|
769
|
+
highlights?: Array<{ x: number; y: number; w: number; h: number; label: string }>;
|
|
770
|
+
pages?: Array<{ id: string; title: string; url: string; active: boolean }>;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
export interface DocumentPreviewSurfaceData {
|
|
774
|
+
title: string;
|
|
775
|
+
surfaceId: string; // the doc's real surfaceId, for focusing the panel
|
|
776
|
+
subtitle?: string;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
export type SurfaceData = CardSurfaceData | FormSurfaceData | ListSurfaceData | TableSurfaceData | ConfirmationSurfaceData | DynamicPageSurfaceData | FileUploadSurfaceData | BrowserViewSurfaceData | DocumentPreviewSurfaceData;
|
|
780
|
+
|
|
781
|
+
export interface UiSurfaceAction {
|
|
782
|
+
type: 'ui_surface_action';
|
|
783
|
+
sessionId: string;
|
|
784
|
+
surfaceId: string;
|
|
785
|
+
actionId: string;
|
|
786
|
+
data?: Record<string, unknown>;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
export interface UiSurfaceUndoRequest {
|
|
790
|
+
type: 'ui_surface_undo';
|
|
791
|
+
sessionId: string;
|
|
792
|
+
surfaceId: string;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
export interface PublishPageRequest {
|
|
796
|
+
type: 'publish_page';
|
|
797
|
+
html: string;
|
|
798
|
+
title?: string;
|
|
799
|
+
appId?: string;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
export interface PublishPageResponse {
|
|
803
|
+
type: 'publish_page_response';
|
|
804
|
+
success: boolean;
|
|
805
|
+
publicUrl?: string;
|
|
806
|
+
deploymentId?: string;
|
|
807
|
+
error?: string;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
export interface UnpublishPageRequest {
|
|
811
|
+
type: 'unpublish_page';
|
|
812
|
+
deploymentId: string;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
export interface UnpublishPageResponse {
|
|
816
|
+
type: 'unpublish_page_response';
|
|
817
|
+
success: boolean;
|
|
818
|
+
error?: string;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
export interface DiagnosticsExportResponse {
|
|
822
|
+
type: 'diagnostics_export_response';
|
|
823
|
+
success: boolean;
|
|
824
|
+
filePath?: string; // path to the zip file on success
|
|
825
|
+
error?: string; // error message on failure
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
export interface EnvVarsResponse {
|
|
829
|
+
type: 'env_vars_response';
|
|
830
|
+
vars: Record<string, string>;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
export interface AppFilesChanged {
|
|
834
|
+
type: 'app_files_changed';
|
|
835
|
+
appId: string;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
export interface BrowserFrame {
|
|
839
|
+
type: 'browser_frame';
|
|
840
|
+
sessionId: string;
|
|
841
|
+
surfaceId: string;
|
|
842
|
+
frame: string; // base64 JPEG
|
|
843
|
+
metadata?: { offsetTop: number; pageScaleFactor: number; scrollOffsetX: number; scrollOffsetY: number; timestamp: number };
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
export interface BrowserCDPRequest {
|
|
847
|
+
type: 'browser_cdp_request';
|
|
848
|
+
sessionId: string;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
export interface BrowserCDPResponse {
|
|
852
|
+
type: 'browser_cdp_response';
|
|
853
|
+
sessionId: string;
|
|
854
|
+
success: boolean;
|
|
855
|
+
declined?: boolean;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
export interface BrowserUserClick {
|
|
859
|
+
type: 'browser_user_click';
|
|
860
|
+
sessionId: string;
|
|
861
|
+
surfaceId: string;
|
|
862
|
+
x: number;
|
|
863
|
+
y: number;
|
|
864
|
+
button?: 'left' | 'right';
|
|
865
|
+
doubleClick?: boolean;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
export interface BrowserUserScroll {
|
|
869
|
+
type: 'browser_user_scroll';
|
|
870
|
+
sessionId: string;
|
|
871
|
+
surfaceId: string;
|
|
872
|
+
deltaX: number;
|
|
873
|
+
deltaY: number;
|
|
874
|
+
x: number;
|
|
875
|
+
y: number;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
export interface BrowserUserKeypress {
|
|
879
|
+
type: 'browser_user_keypress';
|
|
880
|
+
sessionId: string;
|
|
881
|
+
surfaceId: string;
|
|
882
|
+
key: string;
|
|
883
|
+
modifiers?: string[];
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
export interface BrowserInteractiveMode {
|
|
887
|
+
type: 'browser_interactive_mode';
|
|
888
|
+
sessionId: string;
|
|
889
|
+
surfaceId: string;
|
|
890
|
+
enabled: boolean;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
export interface BrowserInteractiveModeChanged {
|
|
894
|
+
type: 'browser_interactive_mode_changed';
|
|
895
|
+
sessionId: string;
|
|
896
|
+
surfaceId: string;
|
|
897
|
+
enabled: boolean;
|
|
898
|
+
reason?: string;
|
|
899
|
+
message?: string;
|
|
900
|
+
}
|
|
901
|
+
export interface BrowserHandoffRequest {
|
|
902
|
+
type: 'browser_handoff_request';
|
|
903
|
+
sessionId: string;
|
|
904
|
+
surfaceId: string;
|
|
905
|
+
reason: 'auth' | 'checkout' | 'captcha' | 'custom';
|
|
906
|
+
message: string;
|
|
907
|
+
bringToFront?: boolean;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
// ── Work Items (Tasks) ───────────────────────────────────────────────
|
|
911
|
+
|
|
912
|
+
export interface WorkItemsListRequest {
|
|
913
|
+
type: 'work_items_list';
|
|
914
|
+
status?: string; // optional filter
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
export interface WorkItemGetRequest {
|
|
918
|
+
type: 'work_item_get';
|
|
919
|
+
id: string;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
export interface WorkItemUpdateRequest {
|
|
923
|
+
type: 'work_item_update';
|
|
924
|
+
id: string;
|
|
925
|
+
title?: string;
|
|
926
|
+
notes?: string;
|
|
927
|
+
status?: string;
|
|
928
|
+
priorityTier?: number;
|
|
929
|
+
sortIndex?: number;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
export interface WorkItemCompleteRequest {
|
|
933
|
+
type: 'work_item_complete';
|
|
934
|
+
id: string;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
export interface WorkItemDeleteRequest {
|
|
938
|
+
type: 'work_item_delete';
|
|
939
|
+
id: string;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
export interface WorkItemRunTaskRequest {
|
|
943
|
+
type: 'work_item_run_task';
|
|
944
|
+
id: string;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
export interface WorkItemOutputRequest {
|
|
948
|
+
type: 'work_item_output';
|
|
949
|
+
id: string;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
export interface WorkItemPreflightRequest {
|
|
953
|
+
type: 'work_item_preflight';
|
|
954
|
+
id: string; // work item ID
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
export interface WorkItemApprovePermissionsRequest {
|
|
958
|
+
type: 'work_item_approve_permissions';
|
|
959
|
+
id: string;
|
|
960
|
+
approvedTools: string[]; // tools the user approved
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
export interface WorkItemCancelRequest {
|
|
964
|
+
type: 'work_item_cancel';
|
|
965
|
+
id: string;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
// === Workspace File IPC ─────────────────────────────────────────────────────
|
|
969
|
+
|
|
970
|
+
export interface WorkspaceFilesListRequest {
|
|
971
|
+
type: 'workspace_files_list';
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
export interface WorkspaceFileReadRequest {
|
|
975
|
+
type: 'workspace_file_read';
|
|
976
|
+
/** Relative path within the workspace directory (e.g. "IDENTITY.md"). */
|
|
977
|
+
path: string;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
export interface IdentityGetRequest {
|
|
981
|
+
type: 'identity_get';
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
export interface ToolPermissionSimulateRequest {
|
|
985
|
+
type: 'tool_permission_simulate';
|
|
986
|
+
/** Tool name to simulate (e.g. 'bash', 'file_write'). */
|
|
987
|
+
toolName: string;
|
|
988
|
+
/** Tool input record to simulate. */
|
|
989
|
+
input: Record<string, unknown>;
|
|
990
|
+
/** Working directory context; defaults to daemon cwd when omitted. */
|
|
991
|
+
workingDir?: string;
|
|
992
|
+
/** Whether the simulated context is interactive (default true). */
|
|
993
|
+
isInteractive?: boolean;
|
|
994
|
+
/** When true, side-effect tools that would normally be auto-allowed get promoted to prompt. */
|
|
995
|
+
forcePromptSideEffects?: boolean;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
export interface ToolNamesListRequest {
|
|
999
|
+
type: 'tool_names_list';
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
export type ClientMessage =
|
|
1003
|
+
| AuthMessage
|
|
1004
|
+
| UserMessage
|
|
1005
|
+
| ConfirmationResponse
|
|
1006
|
+
| SecretResponse
|
|
1007
|
+
| SessionListRequest
|
|
1008
|
+
| SessionCreateRequest
|
|
1009
|
+
| SessionSwitchRequest
|
|
1010
|
+
| PingMessage
|
|
1011
|
+
| CancelRequest
|
|
1012
|
+
| DeleteQueuedMessage
|
|
1013
|
+
| ModelGetRequest
|
|
1014
|
+
| ModelSetRequest
|
|
1015
|
+
| ImageGenModelSetRequest
|
|
1016
|
+
| HistoryRequest
|
|
1017
|
+
| UndoRequest
|
|
1018
|
+
| RegenerateRequest
|
|
1019
|
+
| UsageRequest
|
|
1020
|
+
| SandboxSetRequest
|
|
1021
|
+
| CuSessionCreate
|
|
1022
|
+
| CuSessionAbort
|
|
1023
|
+
| CuObservation
|
|
1024
|
+
| RideShotgunStart
|
|
1025
|
+
| RideShotgunStop
|
|
1026
|
+
| WatchObservation
|
|
1027
|
+
| TaskSubmit
|
|
1028
|
+
| UiSurfaceAction
|
|
1029
|
+
| UiSurfaceUndoRequest
|
|
1030
|
+
| AppDataRequest
|
|
1031
|
+
| SkillsListRequest
|
|
1032
|
+
| SkillDetailRequest
|
|
1033
|
+
| SkillsEnableRequest
|
|
1034
|
+
| SkillsDisableRequest
|
|
1035
|
+
| SkillsConfigureRequest
|
|
1036
|
+
| SkillsInstallRequest
|
|
1037
|
+
| SkillsUninstallRequest
|
|
1038
|
+
| SkillsUpdateRequest
|
|
1039
|
+
| SkillsCheckUpdatesRequest
|
|
1040
|
+
| SkillsSearchRequest
|
|
1041
|
+
| SkillsInspectRequest
|
|
1042
|
+
| SuggestionRequest
|
|
1043
|
+
| AddTrustRule
|
|
1044
|
+
| TrustRulesList
|
|
1045
|
+
| RemoveTrustRule
|
|
1046
|
+
| UpdateTrustRule
|
|
1047
|
+
| AcceptStarterBundle
|
|
1048
|
+
| SchedulesList
|
|
1049
|
+
| ScheduleToggle
|
|
1050
|
+
| ScheduleRemove
|
|
1051
|
+
| RemindersList
|
|
1052
|
+
| ReminderCancel
|
|
1053
|
+
| BundleAppRequest
|
|
1054
|
+
| AppsListRequest
|
|
1055
|
+
| HomeBaseGetRequest
|
|
1056
|
+
| AppOpenRequest
|
|
1057
|
+
| SharedAppsListRequest
|
|
1058
|
+
| SharedAppDeleteRequest
|
|
1059
|
+
| ForkSharedAppRequest
|
|
1060
|
+
| OpenBundleRequest
|
|
1061
|
+
| SignBundlePayloadResponse
|
|
1062
|
+
| GetSigningIdentityResponse
|
|
1063
|
+
| IpcBlobProbe
|
|
1064
|
+
| LinkOpenRequest
|
|
1065
|
+
| ShareAppCloudRequest
|
|
1066
|
+
| ShareToSlackRequest
|
|
1067
|
+
| SlackWebhookConfigRequest
|
|
1068
|
+
| IngressConfigRequest
|
|
1069
|
+
| VercelApiConfigRequest
|
|
1070
|
+
| TwitterIntegrationConfigRequest
|
|
1071
|
+
| TelegramConfigRequest
|
|
1072
|
+
| TwilioConfigRequest
|
|
1073
|
+
| GuardianVerificationRequest
|
|
1074
|
+
| TwitterAuthStartRequest
|
|
1075
|
+
| TwitterAuthStatusRequest
|
|
1076
|
+
| SessionsClearRequest
|
|
1077
|
+
| GalleryListRequest
|
|
1078
|
+
| GalleryInstallRequest
|
|
1079
|
+
| AppHistoryRequest
|
|
1080
|
+
| AppDiffRequest
|
|
1081
|
+
| AppFileAtVersionRequest
|
|
1082
|
+
| AppRestoreRequest
|
|
1083
|
+
| AppUpdatePreviewRequest
|
|
1084
|
+
| AppPreviewRequest
|
|
1085
|
+
| PublishPageRequest
|
|
1086
|
+
| UnpublishPageRequest
|
|
1087
|
+
| DiagnosticsExportRequest
|
|
1088
|
+
| EnvVarsRequest
|
|
1089
|
+
| IntegrationListRequest
|
|
1090
|
+
| IntegrationConnectRequest
|
|
1091
|
+
| IntegrationDisconnectRequest
|
|
1092
|
+
| DocumentSaveRequest
|
|
1093
|
+
| DocumentLoadRequest
|
|
1094
|
+
| DocumentListRequest
|
|
1095
|
+
| BrowserCDPResponse
|
|
1096
|
+
| BrowserUserClick
|
|
1097
|
+
| BrowserUserScroll
|
|
1098
|
+
| BrowserUserKeypress
|
|
1099
|
+
| BrowserInteractiveMode
|
|
1100
|
+
| WorkItemsListRequest
|
|
1101
|
+
| WorkItemGetRequest
|
|
1102
|
+
| WorkItemUpdateRequest
|
|
1103
|
+
| WorkItemCompleteRequest
|
|
1104
|
+
| WorkItemDeleteRequest
|
|
1105
|
+
| WorkItemRunTaskRequest
|
|
1106
|
+
| WorkItemOutputRequest
|
|
1107
|
+
| WorkItemPreflightRequest
|
|
1108
|
+
| WorkItemApprovePermissionsRequest
|
|
1109
|
+
| WorkItemCancelRequest
|
|
1110
|
+
| SubagentAbortRequest
|
|
1111
|
+
| SubagentStatusRequest
|
|
1112
|
+
| SubagentMessageRequest
|
|
1113
|
+
| SubagentDetailRequest
|
|
1114
|
+
| WorkspaceFilesListRequest
|
|
1115
|
+
| WorkspaceFileReadRequest
|
|
1116
|
+
| IdentityGetRequest
|
|
1117
|
+
| ToolPermissionSimulateRequest
|
|
1118
|
+
| ToolNamesListRequest;
|
|
1119
|
+
|
|
1120
|
+
export interface IntegrationListRequest {
|
|
1121
|
+
type: 'integration_list';
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
export interface IntegrationConnectRequest {
|
|
1125
|
+
type: 'integration_connect';
|
|
1126
|
+
integrationId: string;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
export interface IntegrationDisconnectRequest {
|
|
1130
|
+
type: 'integration_disconnect';
|
|
1131
|
+
integrationId: string;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
export interface IntegrationListResponse {
|
|
1135
|
+
type: 'integration_list_response';
|
|
1136
|
+
integrations: Array<{
|
|
1137
|
+
id: string;
|
|
1138
|
+
connected: boolean;
|
|
1139
|
+
accountInfo?: string | null;
|
|
1140
|
+
connectedAt?: number | null;
|
|
1141
|
+
lastUsed?: number | null;
|
|
1142
|
+
error?: string | null;
|
|
1143
|
+
}>;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
export interface IntegrationConnectResult {
|
|
1147
|
+
type: 'integration_connect_result';
|
|
1148
|
+
integrationId: string;
|
|
1149
|
+
success: boolean;
|
|
1150
|
+
accountInfo?: string | null;
|
|
1151
|
+
error?: string | null;
|
|
1152
|
+
setupRequired?: boolean;
|
|
1153
|
+
setupSkillId?: string;
|
|
1154
|
+
setupHint?: string;
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
// === Server → Client messages ===
|
|
1158
|
+
|
|
1159
|
+
export interface UserMessageEcho {
|
|
1160
|
+
type: 'user_message_echo';
|
|
1161
|
+
text: string;
|
|
1162
|
+
sessionId?: string;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
export interface AssistantTextDelta {
|
|
1166
|
+
type: 'assistant_text_delta';
|
|
1167
|
+
text: string;
|
|
1168
|
+
sessionId?: string;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
export interface AssistantThinkingDelta {
|
|
1172
|
+
type: 'assistant_thinking_delta';
|
|
1173
|
+
thinking: string;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
export interface ToolUseStart {
|
|
1177
|
+
type: 'tool_use_start';
|
|
1178
|
+
toolName: string;
|
|
1179
|
+
input: Record<string, unknown>;
|
|
1180
|
+
sessionId?: string;
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
export interface ToolOutputChunk {
|
|
1184
|
+
type: 'tool_output_chunk';
|
|
1185
|
+
chunk: string;
|
|
1186
|
+
sessionId?: string;
|
|
1187
|
+
subType?: 'tool_start' | 'tool_complete' | 'status';
|
|
1188
|
+
subToolName?: string;
|
|
1189
|
+
subToolInput?: string;
|
|
1190
|
+
subToolIsError?: boolean;
|
|
1191
|
+
subToolId?: string;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
export interface ToolInputDelta {
|
|
1195
|
+
type: 'tool_input_delta';
|
|
1196
|
+
toolName: string;
|
|
1197
|
+
content: string;
|
|
1198
|
+
sessionId?: string;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
export interface ToolResult {
|
|
1202
|
+
type: 'tool_result';
|
|
1203
|
+
toolName: string;
|
|
1204
|
+
result: string;
|
|
1205
|
+
isError?: boolean;
|
|
1206
|
+
diff?: { filePath: string; oldContent: string; newContent: string; isNewFile: boolean };
|
|
1207
|
+
status?: string;
|
|
1208
|
+
sessionId?: string;
|
|
1209
|
+
/** Base64-encoded image data extracted from contentBlocks (e.g. browser_screenshot). */
|
|
1210
|
+
imageData?: string;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
export interface ConfirmationRequest {
|
|
1214
|
+
type: 'confirmation_request';
|
|
1215
|
+
requestId: string;
|
|
1216
|
+
toolName: string;
|
|
1217
|
+
input: Record<string, unknown>;
|
|
1218
|
+
riskLevel: string;
|
|
1219
|
+
executionTarget?: 'sandbox' | 'host';
|
|
1220
|
+
allowlistOptions: Array<{ label: string; description: string; pattern: string }>;
|
|
1221
|
+
scopeOptions: Array<{ label: string; scope: string }>;
|
|
1222
|
+
diff?: { filePath: string; oldContent: string; newContent: string; isNewFile: boolean };
|
|
1223
|
+
sandboxed?: boolean;
|
|
1224
|
+
sessionId?: string;
|
|
1225
|
+
/** When false, the client should hide "always allow" / trust-rule persistence affordances. */
|
|
1226
|
+
persistentDecisionsAllowed?: boolean;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
export interface SecretRequest {
|
|
1230
|
+
type: 'secret_request';
|
|
1231
|
+
requestId: string;
|
|
1232
|
+
service: string;
|
|
1233
|
+
field: string;
|
|
1234
|
+
label: string;
|
|
1235
|
+
description?: string;
|
|
1236
|
+
placeholder?: string;
|
|
1237
|
+
sessionId?: string;
|
|
1238
|
+
/** Intended purpose of the credential (displayed to user). */
|
|
1239
|
+
purpose?: string;
|
|
1240
|
+
/** Tools allowed to use this credential. */
|
|
1241
|
+
allowedTools?: string[];
|
|
1242
|
+
/** Domains where this credential may be used. */
|
|
1243
|
+
allowedDomains?: string[];
|
|
1244
|
+
/** Whether one-time send override is available. */
|
|
1245
|
+
allowOneTimeSend?: boolean;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
export interface MessageComplete {
|
|
1249
|
+
type: 'message_complete';
|
|
1250
|
+
sessionId?: string;
|
|
1251
|
+
attachments?: UserMessageAttachment[];
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
export interface SessionInfo {
|
|
1255
|
+
type: 'session_info';
|
|
1256
|
+
sessionId: string;
|
|
1257
|
+
title: string;
|
|
1258
|
+
correlationId?: string;
|
|
1259
|
+
threadType?: ThreadType;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
/** Channel binding metadata exposed in session/conversation list APIs. */
|
|
1263
|
+
export interface ChannelBinding {
|
|
1264
|
+
sourceChannel: string;
|
|
1265
|
+
externalChatId: string;
|
|
1266
|
+
externalUserId?: string | null;
|
|
1267
|
+
displayName?: string | null;
|
|
1268
|
+
username?: string | null;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
export interface SessionListResponse {
|
|
1272
|
+
type: 'session_list_response';
|
|
1273
|
+
sessions: Array<{ id: string; title: string; updatedAt: number; threadType?: ThreadType; channelBinding?: ChannelBinding }>;
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
export interface SessionsClearResponse {
|
|
1277
|
+
type: 'sessions_clear_response';
|
|
1278
|
+
cleared: number;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
export interface ErrorMessage {
|
|
1282
|
+
type: 'error';
|
|
1283
|
+
message: string;
|
|
1284
|
+
/** Categorizes the error so the client can offer contextual actions (e.g. "Send Anyway" for secret_blocked). */
|
|
1285
|
+
category?: string;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
export interface AuthResult {
|
|
1289
|
+
type: 'auth_result';
|
|
1290
|
+
success: boolean;
|
|
1291
|
+
message?: string;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
export interface PongMessage {
|
|
1295
|
+
type: 'pong';
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
export interface DaemonStatusMessage {
|
|
1299
|
+
type: 'daemon_status';
|
|
1300
|
+
httpPort?: number;
|
|
1301
|
+
version?: string;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
export interface GenerationCancelled {
|
|
1305
|
+
type: 'generation_cancelled';
|
|
1306
|
+
sessionId?: string;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
export interface GenerationHandoff {
|
|
1310
|
+
type: 'generation_handoff';
|
|
1311
|
+
sessionId: string;
|
|
1312
|
+
requestId?: string;
|
|
1313
|
+
queuedCount: number;
|
|
1314
|
+
attachments?: UserMessageAttachment[];
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
export interface ModelInfo {
|
|
1318
|
+
type: 'model_info';
|
|
1319
|
+
model: string;
|
|
1320
|
+
provider: string;
|
|
1321
|
+
configuredProviders?: string[];
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
export interface HistoryResponseToolCall {
|
|
1325
|
+
name: string;
|
|
1326
|
+
input: Record<string, unknown>;
|
|
1327
|
+
result?: string;
|
|
1328
|
+
isError?: boolean;
|
|
1329
|
+
/** Base64-encoded image data from tool contentBlocks (e.g. browser_screenshot). */
|
|
1330
|
+
imageData?: string;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
export interface HistoryResponseSurface {
|
|
1334
|
+
surfaceId: string;
|
|
1335
|
+
surfaceType: string;
|
|
1336
|
+
title?: string;
|
|
1337
|
+
data: Record<string, unknown>;
|
|
1338
|
+
actions?: Array<{ id: string; label: string; style?: string }>;
|
|
1339
|
+
display?: string;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
export interface HistoryResponse {
|
|
1343
|
+
type: 'history_response';
|
|
1344
|
+
sessionId: string;
|
|
1345
|
+
messages: Array<{
|
|
1346
|
+
id?: string; // Database message ID (for matching surfaces)
|
|
1347
|
+
role: string;
|
|
1348
|
+
text: string;
|
|
1349
|
+
timestamp: number;
|
|
1350
|
+
toolCalls?: HistoryResponseToolCall[];
|
|
1351
|
+
/** True when tool_use blocks appeared before any text block in the original content. */
|
|
1352
|
+
toolCallsBeforeText?: boolean;
|
|
1353
|
+
attachments?: UserMessageAttachment[];
|
|
1354
|
+
/** Text segments split by tool-call boundaries. Preserves interleaving order. */
|
|
1355
|
+
textSegments?: string[];
|
|
1356
|
+
/** Content block ordering using "text:N", "tool:N", "surface:N" encoding. */
|
|
1357
|
+
contentOrder?: string[];
|
|
1358
|
+
/** UI surfaces (widgets) embedded in the message. */
|
|
1359
|
+
surfaces?: HistoryResponseSurface[];
|
|
1360
|
+
/** Present when this message is a subagent lifecycle notification (completed/failed/aborted). */
|
|
1361
|
+
subagentNotification?: {
|
|
1362
|
+
subagentId: string;
|
|
1363
|
+
label: string;
|
|
1364
|
+
status: 'completed' | 'failed' | 'aborted';
|
|
1365
|
+
error?: string;
|
|
1366
|
+
conversationId?: string;
|
|
1367
|
+
};
|
|
1368
|
+
}>;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
export interface UndoComplete {
|
|
1372
|
+
type: 'undo_complete';
|
|
1373
|
+
removedCount: number;
|
|
1374
|
+
sessionId?: string;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
export interface UsageUpdate {
|
|
1378
|
+
type: 'usage_update';
|
|
1379
|
+
inputTokens: number;
|
|
1380
|
+
outputTokens: number;
|
|
1381
|
+
totalInputTokens: number;
|
|
1382
|
+
totalOutputTokens: number;
|
|
1383
|
+
estimatedCost: number;
|
|
1384
|
+
model: string;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
export interface UsageResponse {
|
|
1388
|
+
type: 'usage_response';
|
|
1389
|
+
totalInputTokens: number;
|
|
1390
|
+
totalOutputTokens: number;
|
|
1391
|
+
estimatedCost: number;
|
|
1392
|
+
model: string;
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
export interface ContextCompacted {
|
|
1396
|
+
type: 'context_compacted';
|
|
1397
|
+
previousEstimatedInputTokens: number;
|
|
1398
|
+
estimatedInputTokens: number;
|
|
1399
|
+
maxInputTokens: number;
|
|
1400
|
+
thresholdTokens: number;
|
|
1401
|
+
compactedMessages: number;
|
|
1402
|
+
summaryCalls: number;
|
|
1403
|
+
summaryInputTokens: number;
|
|
1404
|
+
summaryOutputTokens: number;
|
|
1405
|
+
summaryModel: string;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
export interface SecretDetected {
|
|
1409
|
+
type: 'secret_detected';
|
|
1410
|
+
toolName: string;
|
|
1411
|
+
matches: Array<{ type: string; redactedValue: string }>;
|
|
1412
|
+
action: 'redact' | 'warn' | 'block' | 'prompt';
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
export interface MemoryRecalledCandidateDebug {
|
|
1416
|
+
key: string;
|
|
1417
|
+
type: string;
|
|
1418
|
+
kind: string;
|
|
1419
|
+
finalScore: number;
|
|
1420
|
+
lexical: number;
|
|
1421
|
+
semantic: number;
|
|
1422
|
+
recency: number;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
export interface MemoryRecalled {
|
|
1426
|
+
type: 'memory_recalled';
|
|
1427
|
+
provider: string;
|
|
1428
|
+
model: string;
|
|
1429
|
+
lexicalHits: number;
|
|
1430
|
+
semanticHits: number;
|
|
1431
|
+
recencyHits: number;
|
|
1432
|
+
entityHits: number;
|
|
1433
|
+
relationSeedEntityCount?: number;
|
|
1434
|
+
relationTraversedEdgeCount?: number;
|
|
1435
|
+
relationNeighborEntityCount?: number;
|
|
1436
|
+
relationExpandedItemCount?: number;
|
|
1437
|
+
earlyTerminated?: boolean;
|
|
1438
|
+
mergedCount: number;
|
|
1439
|
+
selectedCount: number;
|
|
1440
|
+
rerankApplied: boolean;
|
|
1441
|
+
injectedTokens: number;
|
|
1442
|
+
latencyMs: number;
|
|
1443
|
+
topCandidates: MemoryRecalledCandidateDebug[];
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
export interface MemoryStatus {
|
|
1447
|
+
type: 'memory_status';
|
|
1448
|
+
enabled: boolean;
|
|
1449
|
+
degraded: boolean;
|
|
1450
|
+
reason?: string;
|
|
1451
|
+
provider?: string;
|
|
1452
|
+
model?: string;
|
|
1453
|
+
conflictsPending: number;
|
|
1454
|
+
conflictsResolved: number;
|
|
1455
|
+
oldestPendingConflictAgeMs: number | null;
|
|
1456
|
+
cleanupResolvedJobsPending: number;
|
|
1457
|
+
cleanupSupersededJobsPending: number;
|
|
1458
|
+
cleanupResolvedJobsCompleted24h: number;
|
|
1459
|
+
cleanupSupersededJobsCompleted24h: number;
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
export interface CuAction {
|
|
1463
|
+
type: 'cu_action';
|
|
1464
|
+
sessionId: string;
|
|
1465
|
+
toolName: string;
|
|
1466
|
+
input: Record<string, unknown>;
|
|
1467
|
+
reasoning?: string;
|
|
1468
|
+
stepNumber: number;
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
export interface CuComplete {
|
|
1472
|
+
type: 'cu_complete';
|
|
1473
|
+
sessionId: string;
|
|
1474
|
+
summary: string;
|
|
1475
|
+
stepCount: number;
|
|
1476
|
+
isResponse?: boolean;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
export interface CuError {
|
|
1480
|
+
type: 'cu_error';
|
|
1481
|
+
sessionId: string;
|
|
1482
|
+
message: string;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
export type SessionErrorCode =
|
|
1486
|
+
| 'PROVIDER_NETWORK'
|
|
1487
|
+
| 'PROVIDER_RATE_LIMIT'
|
|
1488
|
+
| 'PROVIDER_API'
|
|
1489
|
+
| 'CONTEXT_TOO_LARGE'
|
|
1490
|
+
| 'QUEUE_FULL'
|
|
1491
|
+
| 'SESSION_ABORTED'
|
|
1492
|
+
| 'SESSION_PROCESSING_FAILED'
|
|
1493
|
+
| 'REGENERATE_FAILED'
|
|
1494
|
+
| 'UNKNOWN';
|
|
1495
|
+
|
|
1496
|
+
export interface SessionErrorMessage {
|
|
1497
|
+
type: 'session_error';
|
|
1498
|
+
sessionId: string;
|
|
1499
|
+
code: SessionErrorCode;
|
|
1500
|
+
userMessage: string;
|
|
1501
|
+
retryable: boolean;
|
|
1502
|
+
debugDetails?: string;
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
export interface TaskRouted {
|
|
1506
|
+
type: 'task_routed';
|
|
1507
|
+
sessionId: string;
|
|
1508
|
+
interactionType: 'computer_use' | 'text_qa';
|
|
1509
|
+
/** The task text passed to the escalated session. */
|
|
1510
|
+
task?: string;
|
|
1511
|
+
/** Set when a text_qa session escalates to computer_use via computer_use_request_control. */
|
|
1512
|
+
escalatedFrom?: string;
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
export interface RideShotgunResult {
|
|
1516
|
+
type: 'ride_shotgun_result';
|
|
1517
|
+
sessionId: string;
|
|
1518
|
+
watchId: string;
|
|
1519
|
+
summary: string;
|
|
1520
|
+
observationCount: number;
|
|
1521
|
+
recordingId?: string;
|
|
1522
|
+
recordingPath?: string;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
export interface MessageQueued {
|
|
1526
|
+
type: 'message_queued';
|
|
1527
|
+
sessionId: string;
|
|
1528
|
+
requestId: string;
|
|
1529
|
+
position: number;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
export interface MessageDequeued {
|
|
1533
|
+
type: 'message_dequeued';
|
|
1534
|
+
sessionId: string;
|
|
1535
|
+
requestId: string;
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
export interface MessageQueuedDeleted {
|
|
1539
|
+
type: 'message_queued_deleted';
|
|
1540
|
+
sessionId: string;
|
|
1541
|
+
requestId: string;
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
export interface AppDataResponse {
|
|
1545
|
+
type: 'app_data_response';
|
|
1546
|
+
surfaceId: string;
|
|
1547
|
+
callId: string;
|
|
1548
|
+
success: boolean;
|
|
1549
|
+
result?: unknown;
|
|
1550
|
+
error?: string;
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
export interface SkillsListResponse {
|
|
1554
|
+
type: 'skills_list_response';
|
|
1555
|
+
skills: Array<{
|
|
1556
|
+
id: string;
|
|
1557
|
+
name: string;
|
|
1558
|
+
description: string;
|
|
1559
|
+
emoji?: string;
|
|
1560
|
+
homepage?: string;
|
|
1561
|
+
source: 'bundled' | 'managed' | 'workspace' | 'clawhub' | 'extra';
|
|
1562
|
+
state: 'enabled' | 'disabled' | 'available';
|
|
1563
|
+
degraded: boolean;
|
|
1564
|
+
missingRequirements?: { bins?: string[]; env?: string[]; permissions?: string[] };
|
|
1565
|
+
installedVersion?: string;
|
|
1566
|
+
latestVersion?: string;
|
|
1567
|
+
updateAvailable: boolean;
|
|
1568
|
+
userInvocable: boolean;
|
|
1569
|
+
clawhub?: { author: string; stars: number; installs: number; reports: number; publishedAt: string };
|
|
1570
|
+
}>;
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
export interface SkillStateChanged {
|
|
1574
|
+
type: 'skills_state_changed';
|
|
1575
|
+
name: string;
|
|
1576
|
+
state: 'enabled' | 'disabled' | 'installed' | 'uninstalled';
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
export interface SkillsOperationResponse {
|
|
1580
|
+
type: 'skills_operation_response';
|
|
1581
|
+
operation: string;
|
|
1582
|
+
success: boolean;
|
|
1583
|
+
error?: string;
|
|
1584
|
+
data?: unknown;
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
export interface SkillDetailResponse {
|
|
1588
|
+
type: 'skill_detail_response';
|
|
1589
|
+
skillId: string;
|
|
1590
|
+
body: string;
|
|
1591
|
+
icon?: string;
|
|
1592
|
+
error?: string;
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
export interface SkillsInspectResponse {
|
|
1596
|
+
type: 'skills_inspect_response';
|
|
1597
|
+
slug: string;
|
|
1598
|
+
data?: {
|
|
1599
|
+
skill: { slug: string; displayName: string; summary: string };
|
|
1600
|
+
owner?: { handle: string; displayName: string; image?: string } | null;
|
|
1601
|
+
stats?: { stars: number; installs: number; downloads: number; versions: number } | null;
|
|
1602
|
+
createdAt?: number | null;
|
|
1603
|
+
updatedAt?: number | null;
|
|
1604
|
+
latestVersion?: { version: string; changelog?: string } | null;
|
|
1605
|
+
files?: Array<{ path: string; size: number; contentType?: string }> | null;
|
|
1606
|
+
skillMdContent?: string | null;
|
|
1607
|
+
};
|
|
1608
|
+
error?: string;
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
export interface SuggestionResponse {
|
|
1612
|
+
type: 'suggestion_response';
|
|
1613
|
+
requestId: string;
|
|
1614
|
+
suggestion: string | null;
|
|
1615
|
+
source: 'llm' | 'none';
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
export interface TrustRulesListResponse {
|
|
1619
|
+
type: 'trust_rules_list_response';
|
|
1620
|
+
rules: Array<{
|
|
1621
|
+
id: string;
|
|
1622
|
+
tool: string;
|
|
1623
|
+
pattern: string;
|
|
1624
|
+
scope: string;
|
|
1625
|
+
decision: 'allow' | 'deny' | 'ask';
|
|
1626
|
+
priority: number;
|
|
1627
|
+
createdAt: number;
|
|
1628
|
+
}>;
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
export interface AcceptStarterBundleResponse {
|
|
1632
|
+
type: 'accept_starter_bundle_response';
|
|
1633
|
+
accepted: boolean;
|
|
1634
|
+
rulesAdded: number;
|
|
1635
|
+
alreadyAccepted: boolean;
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
export interface SchedulesListResponse {
|
|
1639
|
+
type: 'schedules_list_response';
|
|
1640
|
+
schedules: Array<{
|
|
1641
|
+
id: string;
|
|
1642
|
+
name: string;
|
|
1643
|
+
enabled: boolean;
|
|
1644
|
+
syntax: string;
|
|
1645
|
+
expression: string;
|
|
1646
|
+
cronExpression: string;
|
|
1647
|
+
timezone: string | null;
|
|
1648
|
+
message: string;
|
|
1649
|
+
nextRunAt: number;
|
|
1650
|
+
lastRunAt: number | null;
|
|
1651
|
+
lastStatus: string | null;
|
|
1652
|
+
description: string;
|
|
1653
|
+
}>;
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
export interface RemindersListResponse {
|
|
1657
|
+
type: 'reminders_list_response';
|
|
1658
|
+
reminders: Array<{
|
|
1659
|
+
id: string;
|
|
1660
|
+
label: string;
|
|
1661
|
+
message: string;
|
|
1662
|
+
fireAt: number;
|
|
1663
|
+
mode: string;
|
|
1664
|
+
status: string;
|
|
1665
|
+
firedAt: number | null;
|
|
1666
|
+
createdAt: number;
|
|
1667
|
+
}>;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
export interface AppsListResponse {
|
|
1671
|
+
type: 'apps_list_response';
|
|
1672
|
+
apps: Array<{
|
|
1673
|
+
id: string;
|
|
1674
|
+
name: string;
|
|
1675
|
+
description?: string;
|
|
1676
|
+
icon?: string;
|
|
1677
|
+
preview?: string;
|
|
1678
|
+
createdAt: number;
|
|
1679
|
+
version?: string;
|
|
1680
|
+
contentId?: string;
|
|
1681
|
+
appType?: string;
|
|
1682
|
+
}>;
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
export interface HomeBaseGetResponse {
|
|
1686
|
+
type: 'home_base_get_response';
|
|
1687
|
+
homeBase: {
|
|
1688
|
+
appId: string;
|
|
1689
|
+
source: string;
|
|
1690
|
+
starterTasks: string[];
|
|
1691
|
+
onboardingTasks: string[];
|
|
1692
|
+
preview: {
|
|
1693
|
+
title: string;
|
|
1694
|
+
subtitle: string;
|
|
1695
|
+
description: string;
|
|
1696
|
+
icon: string;
|
|
1697
|
+
metrics: Array<{ label: string; value: string }>;
|
|
1698
|
+
};
|
|
1699
|
+
} | null;
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
export interface SharedAppsListResponse {
|
|
1703
|
+
type: 'shared_apps_list_response';
|
|
1704
|
+
apps: Array<{
|
|
1705
|
+
uuid: string;
|
|
1706
|
+
name: string;
|
|
1707
|
+
description?: string;
|
|
1708
|
+
icon?: string;
|
|
1709
|
+
preview?: string;
|
|
1710
|
+
entry: string;
|
|
1711
|
+
trustTier: string;
|
|
1712
|
+
signerDisplayName?: string;
|
|
1713
|
+
bundleSizeBytes: number;
|
|
1714
|
+
installedAt: string;
|
|
1715
|
+
version?: string;
|
|
1716
|
+
contentId?: string;
|
|
1717
|
+
updateAvailable?: boolean;
|
|
1718
|
+
}>;
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
export interface SharedAppDeleteResponse {
|
|
1722
|
+
type: 'shared_app_delete_response';
|
|
1723
|
+
success: boolean;
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
export interface ForkSharedAppResponse {
|
|
1727
|
+
type: 'fork_shared_app_response';
|
|
1728
|
+
success: boolean;
|
|
1729
|
+
appId?: string;
|
|
1730
|
+
name?: string;
|
|
1731
|
+
error?: string;
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
export interface BundleAppResponse {
|
|
1735
|
+
type: 'bundle_app_response';
|
|
1736
|
+
bundlePath: string;
|
|
1737
|
+
manifest: {
|
|
1738
|
+
format_version: number;
|
|
1739
|
+
name: string;
|
|
1740
|
+
description?: string;
|
|
1741
|
+
icon?: string;
|
|
1742
|
+
created_at: string;
|
|
1743
|
+
created_by: string;
|
|
1744
|
+
entry: string;
|
|
1745
|
+
capabilities: string[];
|
|
1746
|
+
version?: string;
|
|
1747
|
+
content_id?: string;
|
|
1748
|
+
};
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
export interface OpenBundleResponse {
|
|
1752
|
+
type: 'open_bundle_response';
|
|
1753
|
+
manifest: {
|
|
1754
|
+
format_version: number;
|
|
1755
|
+
name: string;
|
|
1756
|
+
description?: string;
|
|
1757
|
+
icon?: string;
|
|
1758
|
+
created_at: string;
|
|
1759
|
+
created_by: string;
|
|
1760
|
+
entry: string;
|
|
1761
|
+
capabilities: string[];
|
|
1762
|
+
};
|
|
1763
|
+
scanResult: {
|
|
1764
|
+
passed: boolean;
|
|
1765
|
+
blocked: string[];
|
|
1766
|
+
warnings: string[];
|
|
1767
|
+
};
|
|
1768
|
+
signatureResult: {
|
|
1769
|
+
trustTier: 'verified' | 'signed' | 'unsigned' | 'tampered';
|
|
1770
|
+
signerKeyId?: string;
|
|
1771
|
+
signerDisplayName?: string;
|
|
1772
|
+
signerAccount?: string;
|
|
1773
|
+
};
|
|
1774
|
+
bundleSizeBytes: number;
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
export interface SignBundlePayloadRequest {
|
|
1778
|
+
type: 'sign_bundle_payload';
|
|
1779
|
+
requestId: string;
|
|
1780
|
+
payload: string;
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
export interface GetSigningIdentityRequest {
|
|
1784
|
+
type: 'get_signing_identity';
|
|
1785
|
+
requestId: string;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
export interface ShareAppCloudResponse {
|
|
1789
|
+
type: 'share_app_cloud_response';
|
|
1790
|
+
success: boolean;
|
|
1791
|
+
shareToken?: string;
|
|
1792
|
+
shareUrl?: string;
|
|
1793
|
+
error?: string;
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
export interface IpcBlobProbeResult {
|
|
1797
|
+
type: 'ipc_blob_probe_result';
|
|
1798
|
+
probeId: string;
|
|
1799
|
+
ok: boolean;
|
|
1800
|
+
observedNonceSha256?: string;
|
|
1801
|
+
reason?: string;
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
export interface GalleryListResponse {
|
|
1805
|
+
type: 'gallery_list_response';
|
|
1806
|
+
gallery: GalleryManifest;
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
export interface GalleryInstallResponse {
|
|
1810
|
+
type: 'gallery_install_response';
|
|
1811
|
+
success: boolean;
|
|
1812
|
+
appId?: string;
|
|
1813
|
+
name?: string;
|
|
1814
|
+
error?: string;
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
export interface AppHistoryResponse {
|
|
1818
|
+
type: 'app_history_response';
|
|
1819
|
+
appId: string;
|
|
1820
|
+
versions: Array<{
|
|
1821
|
+
commitHash: string;
|
|
1822
|
+
message: string;
|
|
1823
|
+
timestamp: number;
|
|
1824
|
+
}>;
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
export interface AppDiffResponse {
|
|
1828
|
+
type: 'app_diff_response';
|
|
1829
|
+
appId: string;
|
|
1830
|
+
diff: string;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
export interface AppFileAtVersionResponse {
|
|
1834
|
+
type: 'app_file_at_version_response';
|
|
1835
|
+
appId: string;
|
|
1836
|
+
path: string;
|
|
1837
|
+
content: string;
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
export interface AppRestoreResponse {
|
|
1841
|
+
type: 'app_restore_response';
|
|
1842
|
+
success: boolean;
|
|
1843
|
+
error?: string;
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
export interface ShareToSlackResponse {
|
|
1847
|
+
type: 'share_to_slack_response';
|
|
1848
|
+
success: boolean;
|
|
1849
|
+
error?: string;
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
export interface SlackWebhookConfigResponse {
|
|
1853
|
+
type: 'slack_webhook_config_response';
|
|
1854
|
+
webhookUrl?: string;
|
|
1855
|
+
success: boolean;
|
|
1856
|
+
error?: string;
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
export interface IngressConfigResponse {
|
|
1860
|
+
type: 'ingress_config_response';
|
|
1861
|
+
enabled: boolean;
|
|
1862
|
+
publicBaseUrl: string;
|
|
1863
|
+
/** Read-only gateway target computed from GATEWAY_PORT env var (default 7830) + loopback host. */
|
|
1864
|
+
localGatewayTarget: string;
|
|
1865
|
+
success: boolean;
|
|
1866
|
+
error?: string;
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
export interface OpenUrl {
|
|
1870
|
+
type: 'open_url';
|
|
1871
|
+
url: string;
|
|
1872
|
+
title?: string;
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
export interface ReminderFired {
|
|
1876
|
+
type: 'reminder_fired';
|
|
1877
|
+
reminderId: string;
|
|
1878
|
+
label: string;
|
|
1879
|
+
message: string;
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1882
|
+
export interface ScheduleComplete {
|
|
1883
|
+
type: 'schedule_complete';
|
|
1884
|
+
scheduleId: string;
|
|
1885
|
+
name: string;
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
export interface WatcherNotification {
|
|
1889
|
+
type: 'watcher_notification';
|
|
1890
|
+
title: string;
|
|
1891
|
+
body: string;
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
export interface WatcherEscalation {
|
|
1895
|
+
type: 'watcher_escalation';
|
|
1896
|
+
title: string;
|
|
1897
|
+
body: string;
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
export interface AgentHeartbeatAlert {
|
|
1901
|
+
type: 'agent_heartbeat_alert';
|
|
1902
|
+
title: string;
|
|
1903
|
+
body: string;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
export interface WatchStarted {
|
|
1907
|
+
type: 'watch_started';
|
|
1908
|
+
sessionId: string;
|
|
1909
|
+
watchId: string;
|
|
1910
|
+
durationSeconds: number;
|
|
1911
|
+
intervalSeconds: number;
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
export interface WatchCompleteRequest {
|
|
1915
|
+
type: 'watch_complete_request';
|
|
1916
|
+
sessionId: string;
|
|
1917
|
+
watchId: string;
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
export type TraceEventKind =
|
|
1921
|
+
| 'request_received'
|
|
1922
|
+
| 'request_queued'
|
|
1923
|
+
| 'request_dequeued'
|
|
1924
|
+
| 'llm_call_started'
|
|
1925
|
+
| 'llm_call_finished'
|
|
1926
|
+
| 'assistant_message'
|
|
1927
|
+
| 'tool_started'
|
|
1928
|
+
| 'tool_permission_requested'
|
|
1929
|
+
| 'tool_permission_decided'
|
|
1930
|
+
| 'tool_finished'
|
|
1931
|
+
| 'tool_failed'
|
|
1932
|
+
| 'secret_detected'
|
|
1933
|
+
| 'generation_handoff'
|
|
1934
|
+
| 'message_complete'
|
|
1935
|
+
| 'generation_cancelled'
|
|
1936
|
+
| 'request_error'
|
|
1937
|
+
| 'tool_profiling_summary';
|
|
1938
|
+
|
|
1939
|
+
export interface TraceEvent {
|
|
1940
|
+
type: 'trace_event';
|
|
1941
|
+
eventId: string;
|
|
1942
|
+
sessionId: string;
|
|
1943
|
+
requestId?: string;
|
|
1944
|
+
timestampMs: number;
|
|
1945
|
+
sequence: number;
|
|
1946
|
+
kind: TraceEventKind;
|
|
1947
|
+
status?: 'info' | 'success' | 'warning' | 'error';
|
|
1948
|
+
summary: string;
|
|
1949
|
+
attributes?: Record<string, string | number | boolean | null>;
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
/** Common fields shared by all UiSurfaceShow variants. */
|
|
1953
|
+
interface UiSurfaceShowBase {
|
|
1954
|
+
type: 'ui_surface_show';
|
|
1955
|
+
sessionId: string;
|
|
1956
|
+
surfaceId: string;
|
|
1957
|
+
title?: string;
|
|
1958
|
+
actions?: SurfaceAction[];
|
|
1959
|
+
display?: 'inline' | 'panel';
|
|
1960
|
+
/** The message ID that this surface belongs to (for history loading). */
|
|
1961
|
+
messageId?: string;
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
export interface UiSurfaceShowCard extends UiSurfaceShowBase {
|
|
1965
|
+
surfaceType: 'card';
|
|
1966
|
+
data: CardSurfaceData;
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
export interface UiSurfaceShowForm extends UiSurfaceShowBase {
|
|
1970
|
+
surfaceType: 'form';
|
|
1971
|
+
data: FormSurfaceData;
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
export interface UiSurfaceShowList extends UiSurfaceShowBase {
|
|
1975
|
+
surfaceType: 'list';
|
|
1976
|
+
data: ListSurfaceData;
|
|
1977
|
+
}
|
|
1978
|
+
|
|
1979
|
+
export interface UiSurfaceShowConfirmation extends UiSurfaceShowBase {
|
|
1980
|
+
surfaceType: 'confirmation';
|
|
1981
|
+
data: ConfirmationSurfaceData;
|
|
1982
|
+
}
|
|
1983
|
+
|
|
1984
|
+
export interface UiSurfaceShowDynamicPage extends UiSurfaceShowBase {
|
|
1985
|
+
surfaceType: 'dynamic_page';
|
|
1986
|
+
data: DynamicPageSurfaceData;
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
export interface UiSurfaceShowTable extends UiSurfaceShowBase {
|
|
1990
|
+
surfaceType: 'table';
|
|
1991
|
+
data: TableSurfaceData;
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
export interface UiSurfaceShowFileUpload extends UiSurfaceShowBase {
|
|
1995
|
+
surfaceType: 'file_upload';
|
|
1996
|
+
data: FileUploadSurfaceData;
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
export interface UiSurfaceShowBrowserView extends UiSurfaceShowBase {
|
|
2000
|
+
surfaceType: 'browser_view';
|
|
2001
|
+
data: BrowserViewSurfaceData;
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
export interface UiSurfaceShowDocumentPreview extends UiSurfaceShowBase {
|
|
2005
|
+
surfaceType: 'document_preview';
|
|
2006
|
+
data: DocumentPreviewSurfaceData;
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
export type UiSurfaceShow =
|
|
2010
|
+
| UiSurfaceShowCard
|
|
2011
|
+
| UiSurfaceShowForm
|
|
2012
|
+
| UiSurfaceShowList
|
|
2013
|
+
| UiSurfaceShowTable
|
|
2014
|
+
| UiSurfaceShowConfirmation
|
|
2015
|
+
| UiSurfaceShowDynamicPage
|
|
2016
|
+
| UiSurfaceShowFileUpload
|
|
2017
|
+
| UiSurfaceShowBrowserView
|
|
2018
|
+
| UiSurfaceShowDocumentPreview;
|
|
2019
|
+
|
|
2020
|
+
export interface UiSurfaceUpdate {
|
|
2021
|
+
type: 'ui_surface_update';
|
|
2022
|
+
sessionId: string;
|
|
2023
|
+
surfaceId: string;
|
|
2024
|
+
data: Partial<SurfaceData>;
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2027
|
+
export interface UiSurfaceDismiss {
|
|
2028
|
+
type: 'ui_surface_dismiss';
|
|
2029
|
+
sessionId: string;
|
|
2030
|
+
surfaceId: string;
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
export interface UiSurfaceComplete {
|
|
2034
|
+
type: 'ui_surface_complete';
|
|
2035
|
+
sessionId: string;
|
|
2036
|
+
surfaceId: string;
|
|
2037
|
+
summary: string;
|
|
2038
|
+
submittedData?: Record<string, unknown>;
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
export interface UiSurfaceUndoResult {
|
|
2042
|
+
type: 'ui_surface_undo_result';
|
|
2043
|
+
sessionId: string;
|
|
2044
|
+
surfaceId: string;
|
|
2045
|
+
success: boolean;
|
|
2046
|
+
/** Number of remaining undo entries after this undo. */
|
|
2047
|
+
remainingUndos: number;
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
// ── Document Editor Messages ────────────────────────────────────────
|
|
2051
|
+
|
|
2052
|
+
export interface DocumentEditorShow {
|
|
2053
|
+
type: 'document_editor_show';
|
|
2054
|
+
sessionId: string;
|
|
2055
|
+
surfaceId: string;
|
|
2056
|
+
title: string;
|
|
2057
|
+
initialContent: string;
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
export interface DocumentEditorUpdate {
|
|
2061
|
+
type: 'document_editor_update';
|
|
2062
|
+
sessionId: string;
|
|
2063
|
+
surfaceId: string;
|
|
2064
|
+
markdown: string;
|
|
2065
|
+
mode: string;
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
export interface DocumentSaveRequest {
|
|
2069
|
+
type: 'document_save';
|
|
2070
|
+
surfaceId: string;
|
|
2071
|
+
conversationId: string;
|
|
2072
|
+
title: string;
|
|
2073
|
+
content: string;
|
|
2074
|
+
wordCount: number;
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
export interface DocumentSaveResponse {
|
|
2078
|
+
type: 'document_save_response';
|
|
2079
|
+
surfaceId: string;
|
|
2080
|
+
success: boolean;
|
|
2081
|
+
error?: string;
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
export interface DocumentLoadRequest {
|
|
2085
|
+
type: 'document_load';
|
|
2086
|
+
surfaceId: string;
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
export interface DocumentLoadResponse {
|
|
2090
|
+
type: 'document_load_response';
|
|
2091
|
+
surfaceId: string;
|
|
2092
|
+
conversationId: string;
|
|
2093
|
+
title: string;
|
|
2094
|
+
content: string;
|
|
2095
|
+
wordCount: number;
|
|
2096
|
+
createdAt: number;
|
|
2097
|
+
updatedAt: number;
|
|
2098
|
+
success: boolean;
|
|
2099
|
+
error?: string;
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
export interface DocumentListRequest {
|
|
2103
|
+
type: 'document_list';
|
|
2104
|
+
conversationId?: string;
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
export interface DocumentListResponse {
|
|
2108
|
+
type: 'document_list_response';
|
|
2109
|
+
documents: Array<{
|
|
2110
|
+
surfaceId: string;
|
|
2111
|
+
conversationId: string;
|
|
2112
|
+
title: string;
|
|
2113
|
+
wordCount: number;
|
|
2114
|
+
createdAt: number;
|
|
2115
|
+
updatedAt: number;
|
|
2116
|
+
}>;
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
// ── Work Items (Tasks) — Server Responses ───────────────────────────
|
|
2120
|
+
|
|
2121
|
+
export interface WorkItemsListResponse {
|
|
2122
|
+
type: 'work_items_list_response';
|
|
2123
|
+
items: Array<{
|
|
2124
|
+
id: string;
|
|
2125
|
+
taskId: string;
|
|
2126
|
+
title: string;
|
|
2127
|
+
notes: string | null;
|
|
2128
|
+
status: string;
|
|
2129
|
+
priorityTier: number;
|
|
2130
|
+
sortIndex: number | null;
|
|
2131
|
+
lastRunId: string | null;
|
|
2132
|
+
lastRunConversationId: string | null;
|
|
2133
|
+
lastRunStatus: string | null;
|
|
2134
|
+
sourceType: string | null;
|
|
2135
|
+
sourceId: string | null;
|
|
2136
|
+
createdAt: number;
|
|
2137
|
+
updatedAt: number;
|
|
2138
|
+
}>;
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
export interface WorkItemGetResponse {
|
|
2142
|
+
type: 'work_item_get_response';
|
|
2143
|
+
item: {
|
|
2144
|
+
id: string;
|
|
2145
|
+
taskId: string;
|
|
2146
|
+
title: string;
|
|
2147
|
+
notes: string | null;
|
|
2148
|
+
status: string;
|
|
2149
|
+
priorityTier: number;
|
|
2150
|
+
sortIndex: number | null;
|
|
2151
|
+
lastRunId: string | null;
|
|
2152
|
+
lastRunConversationId: string | null;
|
|
2153
|
+
lastRunStatus: string | null;
|
|
2154
|
+
sourceType: string | null;
|
|
2155
|
+
sourceId: string | null;
|
|
2156
|
+
createdAt: number;
|
|
2157
|
+
updatedAt: number;
|
|
2158
|
+
} | null;
|
|
2159
|
+
}
|
|
2160
|
+
|
|
2161
|
+
export interface WorkItemUpdateResponse {
|
|
2162
|
+
type: 'work_item_update_response';
|
|
2163
|
+
item: {
|
|
2164
|
+
id: string;
|
|
2165
|
+
taskId: string;
|
|
2166
|
+
title: string;
|
|
2167
|
+
notes: string | null;
|
|
2168
|
+
status: string;
|
|
2169
|
+
priorityTier: number;
|
|
2170
|
+
sortIndex: number | null;
|
|
2171
|
+
lastRunId: string | null;
|
|
2172
|
+
lastRunConversationId: string | null;
|
|
2173
|
+
lastRunStatus: string | null;
|
|
2174
|
+
sourceType: string | null;
|
|
2175
|
+
sourceId: string | null;
|
|
2176
|
+
createdAt: number;
|
|
2177
|
+
updatedAt: number;
|
|
2178
|
+
} | null;
|
|
2179
|
+
}
|
|
2180
|
+
|
|
2181
|
+
export interface WorkItemDeleteResponse {
|
|
2182
|
+
type: 'work_item_delete_response';
|
|
2183
|
+
id: string;
|
|
2184
|
+
success: boolean;
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
export type WorkItemRunTaskErrorCode = 'not_found' | 'already_running' | 'invalid_status' | 'no_task' | 'permission_required';
|
|
2188
|
+
|
|
2189
|
+
export interface WorkItemRunTaskResponse {
|
|
2190
|
+
type: 'work_item_run_task_response';
|
|
2191
|
+
id: string;
|
|
2192
|
+
lastRunId: string;
|
|
2193
|
+
success: boolean;
|
|
2194
|
+
error?: string;
|
|
2195
|
+
/** Structured error code so the client can deterministically re-enable buttons or show contextual UI. */
|
|
2196
|
+
errorCode?: WorkItemRunTaskErrorCode;
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
export interface WorkItemOutputResponse {
|
|
2200
|
+
type: 'work_item_output_response';
|
|
2201
|
+
id: string;
|
|
2202
|
+
success: boolean;
|
|
2203
|
+
error?: string;
|
|
2204
|
+
output?: {
|
|
2205
|
+
title: string;
|
|
2206
|
+
status: string;
|
|
2207
|
+
runId: string | null;
|
|
2208
|
+
conversationId: string | null;
|
|
2209
|
+
completedAt: number | null;
|
|
2210
|
+
summary: string;
|
|
2211
|
+
highlights: string[];
|
|
2212
|
+
};
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
export interface WorkItemPreflightResponse {
|
|
2216
|
+
type: 'work_item_preflight_response';
|
|
2217
|
+
id: string;
|
|
2218
|
+
success: boolean;
|
|
2219
|
+
error?: string;
|
|
2220
|
+
permissions?: {
|
|
2221
|
+
tool: string;
|
|
2222
|
+
description: string;
|
|
2223
|
+
riskLevel: 'low' | 'medium' | 'high';
|
|
2224
|
+
currentDecision: 'allow' | 'deny' | 'prompt';
|
|
2225
|
+
}[];
|
|
2226
|
+
}
|
|
2227
|
+
|
|
2228
|
+
export interface WorkItemApprovePermissionsResponse {
|
|
2229
|
+
type: 'work_item_approve_permissions_response';
|
|
2230
|
+
id: string;
|
|
2231
|
+
success: boolean;
|
|
2232
|
+
error?: string;
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2235
|
+
export interface WorkItemCancelResponse {
|
|
2236
|
+
type: 'work_item_cancel_response';
|
|
2237
|
+
id: string;
|
|
2238
|
+
success: boolean;
|
|
2239
|
+
error?: string;
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
/** Server push — tells the client to open/focus the tasks window. */
|
|
2243
|
+
export interface OpenTasksWindow {
|
|
2244
|
+
type: 'open_tasks_window';
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
/** Server push — lightweight invalidation signal: the task queue has been mutated, refetch your list. */
|
|
2248
|
+
export interface TasksChanged {
|
|
2249
|
+
type: 'tasks_changed';
|
|
2250
|
+
}
|
|
2251
|
+
|
|
2252
|
+
/** Server push — broadcast when a work item status changes (e.g. running -> awaiting_review). */
|
|
2253
|
+
export interface WorkItemStatusChanged {
|
|
2254
|
+
type: 'work_item_status_changed';
|
|
2255
|
+
item: {
|
|
2256
|
+
id: string;
|
|
2257
|
+
taskId: string;
|
|
2258
|
+
title: string;
|
|
2259
|
+
status: string;
|
|
2260
|
+
lastRunId: string | null;
|
|
2261
|
+
lastRunConversationId: string | null;
|
|
2262
|
+
lastRunStatus: string | null;
|
|
2263
|
+
updatedAt: number;
|
|
2264
|
+
};
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
/** Server push — broadcast when a task run creates a conversation, so the client can show it as a chat thread. */
|
|
2268
|
+
export interface TaskRunThreadCreated {
|
|
2269
|
+
type: 'task_run_thread_created';
|
|
2270
|
+
conversationId: string;
|
|
2271
|
+
workItemId: string;
|
|
2272
|
+
title: string;
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
// === Workspace File Responses ────────────────────────────────────────────────
|
|
2276
|
+
|
|
2277
|
+
export interface WorkspaceFilesListResponse {
|
|
2278
|
+
type: 'workspace_files_list_response';
|
|
2279
|
+
files: Array<{
|
|
2280
|
+
/** Relative path within the workspace (e.g. "IDENTITY.md", "skills/my-skill"). */
|
|
2281
|
+
path: string;
|
|
2282
|
+
/** Display name (e.g. "IDENTITY.md"). */
|
|
2283
|
+
name: string;
|
|
2284
|
+
/** Whether the file/directory exists. */
|
|
2285
|
+
exists: boolean;
|
|
2286
|
+
}>;
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
export interface WorkspaceFileReadResponse {
|
|
2290
|
+
type: 'workspace_file_read_response';
|
|
2291
|
+
path: string;
|
|
2292
|
+
content: string | null;
|
|
2293
|
+
error?: string;
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
export interface IdentityGetResponse {
|
|
2297
|
+
type: 'identity_get_response';
|
|
2298
|
+
/** Whether an IDENTITY.md file was found. When false, all fields are empty defaults. Optional for backwards compat with older daemons. */
|
|
2299
|
+
found?: boolean;
|
|
2300
|
+
name: string;
|
|
2301
|
+
role: string;
|
|
2302
|
+
personality: string;
|
|
2303
|
+
emoji: string;
|
|
2304
|
+
home: string;
|
|
2305
|
+
version?: string;
|
|
2306
|
+
assistantId?: string;
|
|
2307
|
+
createdAt?: string;
|
|
2308
|
+
originSystem?: string;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
export interface ToolPermissionSimulateResponse {
|
|
2312
|
+
type: 'tool_permission_simulate_response';
|
|
2313
|
+
success: boolean;
|
|
2314
|
+
/** The simulated permission decision. */
|
|
2315
|
+
decision?: 'allow' | 'deny' | 'prompt';
|
|
2316
|
+
/** Risk level of the simulated tool invocation. */
|
|
2317
|
+
riskLevel?: string;
|
|
2318
|
+
/** Human-readable reason for the decision. */
|
|
2319
|
+
reason?: string;
|
|
2320
|
+
/** When decision is 'prompt', the data needed to render a ToolConfirmationBubble. */
|
|
2321
|
+
promptPayload?: {
|
|
2322
|
+
allowlistOptions: Array<{ label: string; description: string; pattern: string }>;
|
|
2323
|
+
scopeOptions: Array<{ label: string; scope: string }>;
|
|
2324
|
+
persistentDecisionsAllowed: boolean;
|
|
2325
|
+
};
|
|
2326
|
+
/** Resolved execution target for the tool. */
|
|
2327
|
+
executionTarget?: 'host' | 'sandbox';
|
|
2328
|
+
/** ID of the trust rule that matched (if any). */
|
|
2329
|
+
matchedRuleId?: string;
|
|
2330
|
+
/** Error message when success is false. */
|
|
2331
|
+
error?: string;
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2334
|
+
export interface ToolInputSchema {
|
|
2335
|
+
type: 'object';
|
|
2336
|
+
properties?: Record<string, {
|
|
2337
|
+
type?: string;
|
|
2338
|
+
description?: string;
|
|
2339
|
+
enum?: string[];
|
|
2340
|
+
[key: string]: unknown;
|
|
2341
|
+
}>;
|
|
2342
|
+
required?: string[];
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2345
|
+
export interface ToolNamesListResponse {
|
|
2346
|
+
type: 'tool_names_list_response';
|
|
2347
|
+
/** Sorted list of all registered tool names. */
|
|
2348
|
+
names: string[];
|
|
2349
|
+
/** Input schemas keyed by tool name. */
|
|
2350
|
+
schemas?: Record<string, ToolInputSchema>;
|
|
2351
|
+
}
|
|
2352
|
+
|
|
2353
|
+
export type ServerMessage =
|
|
2354
|
+
| AuthResult
|
|
2355
|
+
| UserMessageEcho
|
|
2356
|
+
| AssistantTextDelta
|
|
2357
|
+
| AssistantThinkingDelta
|
|
2358
|
+
| ToolUseStart
|
|
2359
|
+
| ToolOutputChunk
|
|
2360
|
+
| ToolInputDelta
|
|
2361
|
+
| ToolResult
|
|
2362
|
+
| ConfirmationRequest
|
|
2363
|
+
| SecretRequest
|
|
2364
|
+
| MessageComplete
|
|
2365
|
+
| SessionInfo
|
|
2366
|
+
| SessionListResponse
|
|
2367
|
+
| SessionsClearResponse
|
|
2368
|
+
| ErrorMessage
|
|
2369
|
+
| PongMessage
|
|
2370
|
+
| DaemonStatusMessage
|
|
2371
|
+
| GenerationCancelled
|
|
2372
|
+
| GenerationHandoff
|
|
2373
|
+
| ModelInfo
|
|
2374
|
+
| HistoryResponse
|
|
2375
|
+
| UndoComplete
|
|
2376
|
+
| UsageUpdate
|
|
2377
|
+
| UsageResponse
|
|
2378
|
+
| ContextCompacted
|
|
2379
|
+
| SecretDetected
|
|
2380
|
+
| MemoryRecalled
|
|
2381
|
+
| MemoryStatus
|
|
2382
|
+
| CuAction
|
|
2383
|
+
| CuComplete
|
|
2384
|
+
| CuError
|
|
2385
|
+
| SessionErrorMessage
|
|
2386
|
+
| TaskRouted
|
|
2387
|
+
| RideShotgunResult
|
|
2388
|
+
| UiSurfaceShow
|
|
2389
|
+
| UiSurfaceUpdate
|
|
2390
|
+
| UiSurfaceDismiss
|
|
2391
|
+
| UiSurfaceComplete
|
|
2392
|
+
| UiSurfaceUndoResult
|
|
2393
|
+
| AppDataResponse
|
|
2394
|
+
| SkillsListResponse
|
|
2395
|
+
| SkillDetailResponse
|
|
2396
|
+
| SkillStateChanged
|
|
2397
|
+
| SkillsOperationResponse
|
|
2398
|
+
| SkillsInspectResponse
|
|
2399
|
+
| SuggestionResponse
|
|
2400
|
+
| MessageQueued
|
|
2401
|
+
| MessageDequeued
|
|
2402
|
+
| MessageQueuedDeleted
|
|
2403
|
+
| ReminderFired
|
|
2404
|
+
| ScheduleComplete
|
|
2405
|
+
| WatcherNotification
|
|
2406
|
+
| WatcherEscalation
|
|
2407
|
+
| AgentHeartbeatAlert
|
|
2408
|
+
| WatchStarted
|
|
2409
|
+
| WatchCompleteRequest
|
|
2410
|
+
| TrustRulesListResponse
|
|
2411
|
+
| AcceptStarterBundleResponse
|
|
2412
|
+
| SchedulesListResponse
|
|
2413
|
+
| RemindersListResponse
|
|
2414
|
+
| BundleAppResponse
|
|
2415
|
+
| AppsListResponse
|
|
2416
|
+
| HomeBaseGetResponse
|
|
2417
|
+
| SharedAppsListResponse
|
|
2418
|
+
| SharedAppDeleteResponse
|
|
2419
|
+
| ForkSharedAppResponse
|
|
2420
|
+
| OpenBundleResponse
|
|
2421
|
+
| SignBundlePayloadRequest
|
|
2422
|
+
| GetSigningIdentityRequest
|
|
2423
|
+
| IpcBlobProbeResult
|
|
2424
|
+
| ShareAppCloudResponse
|
|
2425
|
+
| TraceEvent
|
|
2426
|
+
| GalleryListResponse
|
|
2427
|
+
| GalleryInstallResponse
|
|
2428
|
+
| AppHistoryResponse
|
|
2429
|
+
| AppDiffResponse
|
|
2430
|
+
| AppFileAtVersionResponse
|
|
2431
|
+
| AppRestoreResponse
|
|
2432
|
+
| ShareToSlackResponse
|
|
2433
|
+
| SlackWebhookConfigResponse
|
|
2434
|
+
| IngressConfigResponse
|
|
2435
|
+
| VercelApiConfigResponse
|
|
2436
|
+
| TwitterIntegrationConfigResponse
|
|
2437
|
+
| TelegramConfigResponse
|
|
2438
|
+
| TwilioConfigResponse
|
|
2439
|
+
| GuardianVerificationResponse
|
|
2440
|
+
| TwitterAuthResult
|
|
2441
|
+
| TwitterAuthStatusResponse
|
|
2442
|
+
| OpenUrl
|
|
2443
|
+
| AppUpdatePreviewResponse
|
|
2444
|
+
| AppPreviewResponse
|
|
2445
|
+
| PublishPageResponse
|
|
2446
|
+
| UnpublishPageResponse
|
|
2447
|
+
| DiagnosticsExportResponse
|
|
2448
|
+
| AppFilesChanged
|
|
2449
|
+
| BrowserFrame
|
|
2450
|
+
| EnvVarsResponse
|
|
2451
|
+
| IntegrationListResponse
|
|
2452
|
+
| IntegrationConnectResult
|
|
2453
|
+
| DocumentEditorShow
|
|
2454
|
+
| DocumentEditorUpdate
|
|
2455
|
+
| DocumentSaveResponse
|
|
2456
|
+
| DocumentLoadResponse
|
|
2457
|
+
| DocumentListResponse
|
|
2458
|
+
| BrowserCDPRequest
|
|
2459
|
+
| BrowserInteractiveModeChanged
|
|
2460
|
+
| BrowserHandoffRequest
|
|
2461
|
+
| WorkItemsListResponse
|
|
2462
|
+
| WorkItemGetResponse
|
|
2463
|
+
| WorkItemUpdateResponse
|
|
2464
|
+
| WorkItemDeleteResponse
|
|
2465
|
+
| WorkItemRunTaskResponse
|
|
2466
|
+
| WorkItemOutputResponse
|
|
2467
|
+
| WorkItemPreflightResponse
|
|
2468
|
+
| WorkItemApprovePermissionsResponse
|
|
2469
|
+
| WorkItemCancelResponse
|
|
2470
|
+
| WorkItemStatusChanged
|
|
2471
|
+
| TaskRunThreadCreated
|
|
2472
|
+
| TasksChanged
|
|
2473
|
+
| OpenTasksWindow
|
|
2474
|
+
| SubagentSpawned
|
|
2475
|
+
| SubagentStatusChanged
|
|
2476
|
+
| SubagentEvent
|
|
2477
|
+
| SubagentDetailResponse
|
|
2478
|
+
| WorkspaceFilesListResponse
|
|
2479
|
+
| WorkspaceFileReadResponse
|
|
2480
|
+
| IdentityGetResponse
|
|
2481
|
+
| ToolPermissionSimulateResponse
|
|
2482
|
+
| ToolNamesListResponse;
|
|
2483
|
+
|
|
2484
|
+
// === Subagent IPC ─────────────────────────────────────────────────────
|
|
2485
|
+
|
|
2486
|
+
export interface SubagentSpawned {
|
|
2487
|
+
type: 'subagent_spawned';
|
|
2488
|
+
subagentId: string;
|
|
2489
|
+
parentSessionId: string;
|
|
2490
|
+
label: string;
|
|
2491
|
+
objective: string;
|
|
2492
|
+
}
|
|
2493
|
+
|
|
2494
|
+
export interface SubagentStatusChanged {
|
|
2495
|
+
type: 'subagent_status_changed';
|
|
2496
|
+
subagentId: string;
|
|
2497
|
+
status: import('../subagent/types.js').SubagentStatus;
|
|
2498
|
+
error?: string;
|
|
2499
|
+
usage?: UsageStats;
|
|
2500
|
+
}
|
|
2501
|
+
|
|
2502
|
+
export interface SubagentDetailResponse {
|
|
2503
|
+
type: 'subagent_detail_response';
|
|
2504
|
+
subagentId: string;
|
|
2505
|
+
objective?: string;
|
|
2506
|
+
events: Array<{
|
|
2507
|
+
type: string;
|
|
2508
|
+
content: string;
|
|
2509
|
+
toolName?: string;
|
|
2510
|
+
isError?: boolean;
|
|
2511
|
+
}>;
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
/** Wraps any ServerMessage emitted by a subagent session for routing to the client. */
|
|
2515
|
+
export interface SubagentEvent {
|
|
2516
|
+
type: 'subagent_event';
|
|
2517
|
+
subagentId: string;
|
|
2518
|
+
event: ServerMessage;
|
|
2519
|
+
}
|
|
2520
|
+
|
|
2521
|
+
// === Client → Server subagent messages ───────────────────────────────
|
|
2522
|
+
|
|
2523
|
+
export interface SubagentAbortRequest {
|
|
2524
|
+
type: 'subagent_abort';
|
|
2525
|
+
subagentId: string;
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2528
|
+
export interface SubagentStatusRequest {
|
|
2529
|
+
type: 'subagent_status';
|
|
2530
|
+
/** If omitted, returns all subagents for the session. */
|
|
2531
|
+
subagentId?: string;
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2534
|
+
export interface SubagentMessageRequest {
|
|
2535
|
+
type: 'subagent_message';
|
|
2536
|
+
subagentId: string;
|
|
2537
|
+
content: string;
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
export interface SubagentDetailRequest {
|
|
2541
|
+
type: 'subagent_detail_request';
|
|
2542
|
+
subagentId: string;
|
|
2543
|
+
conversationId: string;
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
// === Contract schema ===
|
|
2547
|
+
|
|
2548
|
+
export interface IPCContractSchema {
|
|
2549
|
+
client: ClientMessage;
|
|
2550
|
+
server: ServerMessage;
|
|
2551
|
+
}
|