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