@vellumai/assistant 0.3.4 → 0.3.6

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