qlogicagent 2.24.1 → 2.24.2

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 (297) hide show
  1. package/README.md +52 -324
  2. package/dist/agent.js +38 -43
  3. package/dist/cli.js +7 -7
  4. package/dist/default-project-knowledge/INSTRUCTIONS.md +7 -7
  5. package/dist/default-project-knowledge/rules/project-workflow.md +6 -6
  6. package/dist/index.js +265 -1018
  7. package/dist/orchestration.js +10 -10
  8. package/dist/types/agent/runtime-vars.d.ts +1 -16
  9. package/dist/types/agent/tool-loop/compression-pipeline.d.ts +0 -2
  10. package/dist/types/agent/tool-loop.d.ts +0 -6
  11. package/dist/types/agent/types.d.ts +3 -22
  12. package/dist/types/cli/acp-commands.d.ts +4 -5
  13. package/dist/types/cli/acp-message-router.d.ts +1 -2
  14. package/dist/types/cli/acp-session-handlers.d.ts +6 -12
  15. package/dist/types/cli/acp-session-host.d.ts +5 -48
  16. package/dist/types/cli/adapter-launch-config.d.ts +14 -0
  17. package/dist/types/cli/agent-runtime-bootstrap.d.ts +2 -23
  18. package/dist/types/cli/agent-runtime-session-state.d.ts +1 -6
  19. package/dist/types/cli/base-tool-bootstrap.d.ts +0 -2
  20. package/dist/types/cli/cli-acp-request-handler.d.ts +3 -5
  21. package/dist/types/cli/core-tool-coordinator.d.ts +0 -4
  22. package/dist/types/cli/core-tools/agent-tool-service.d.ts +0 -3
  23. package/dist/types/cli/core-tools/fork-system-prompt.d.ts +1 -5
  24. package/dist/types/cli/handlers/files-handler.d.ts +0 -6
  25. package/dist/types/cli/handlers/turn-handler.d.ts +7 -83
  26. package/dist/types/cli/main.d.ts +2 -4
  27. package/dist/types/cli/permission-approval-bridge.d.ts +2 -6
  28. package/dist/types/cli/permission-bootstrap.d.ts +2 -12
  29. package/dist/types/cli/plugin-bootstrap.d.ts +2 -4
  30. package/dist/types/cli/runtime-hook-bootstrap.d.ts +0 -21
  31. package/dist/types/cli/session-context.d.ts +4 -14
  32. package/dist/types/cli/session-coordinator.d.ts +1 -9
  33. package/dist/types/cli/stdio-acp-protocol-coordinator.d.ts +2 -9
  34. package/dist/types/cli/stdio-acp-request-host.d.ts +3 -15
  35. package/dist/types/cli/stdio-agent-session-bootstrap.d.ts +3 -23
  36. package/dist/types/cli/stdio-runtime-bootstrap.d.ts +0 -8
  37. package/dist/types/cli/stdio-runtime-services.d.ts +2 -13
  38. package/dist/types/cli/stdio-server.d.ts +6 -128
  39. package/dist/types/cli/tool-bootstrap.d.ts +4 -8
  40. package/dist/types/cli/tool-catalog.d.ts +2 -2
  41. package/dist/types/cli/tool-invoker-factory.d.ts +0 -2
  42. package/dist/types/cli/tool-registry-adapter.d.ts +3 -7
  43. package/dist/types/cli/tool-result-processor.d.ts +0 -1
  44. package/dist/types/cli/turn-core.d.ts +6 -10
  45. package/dist/types/cli/turn-event-forwarder.d.ts +6 -3
  46. package/dist/types/cli/turn-lifecycle.d.ts +0 -3
  47. package/dist/types/cli/turn-project-router.d.ts +0 -7
  48. package/dist/types/contracts/hooks.d.ts +1 -20
  49. package/dist/types/contracts/tool-execution-evidence.d.ts +20 -1
  50. package/dist/types/contracts/turn-event.d.ts +2 -2
  51. package/dist/types/orchestration/index.d.ts +1 -1
  52. package/dist/types/protocol/notifications.d.ts +2 -9
  53. package/dist/types/protocol/wire/acp-protocol.d.ts +12 -186
  54. package/dist/types/protocol/wire/capability-transport.d.ts +0 -2
  55. package/dist/types/protocol/wire/index.d.ts +2 -10
  56. package/dist/types/protocol/wire/notification-payloads.d.ts +4 -989
  57. package/dist/types/protocol/wire/thread-protocol.d.ts +24 -3
  58. package/dist/types/runtime/config/tunable-defaults.d.ts +3 -75
  59. package/dist/types/runtime/execution/forked-agent.d.ts +2 -5
  60. package/dist/types/runtime/execution/streaming-tool-executor.d.ts +0 -2
  61. package/dist/types/runtime/execution/tool-result-storage.d.ts +13 -4
  62. package/dist/types/runtime/infra/agent-paths.d.ts +4 -54
  63. package/dist/types/runtime/infra/agent-project-projection.d.ts +20 -0
  64. package/dist/types/runtime/infra/background-tasks.d.ts +3 -3
  65. package/dist/types/runtime/infra/default-path-service.d.ts +0 -7
  66. package/dist/types/runtime/infra/llmrouter-catalog.d.ts +1 -1
  67. package/dist/types/runtime/infra/model-registry.d.ts +6 -9
  68. package/dist/types/runtime/infra/project-store.d.ts +3 -3
  69. package/dist/types/runtime/infra/subagent-turn-snapshot.d.ts +54 -7
  70. package/dist/types/runtime/infra/task-runtime.d.ts +1 -1
  71. package/dist/types/runtime/ports/agent-runtime-ports.d.ts +1 -3
  72. package/dist/types/runtime/ports/index.d.ts +0 -4
  73. package/dist/types/runtime/ports/path-service.d.ts +1 -9
  74. package/dist/types/runtime/ports/tool-contracts.d.ts +0 -1
  75. package/dist/types/runtime/session/agent-session-projection.d.ts +37 -0
  76. package/dist/types/runtime/tasks/task-types.d.ts +2 -25
  77. package/dist/types/skills/mcp/mcp-manager.d.ts +2 -2
  78. package/dist/types/skills/plugins/plugin-loader.d.ts +1 -1
  79. package/dist/types/skills/skill-system/skill-category.d.ts +4 -2
  80. package/dist/types/skills/tools.d.ts +1 -18
  81. package/dist/types/test-support/project-store-fixture.d.ts +4 -4
  82. package/dist/types/transport/acp-event-emitter.d.ts +1 -20
  83. package/dist/types/transport/acp-server.d.ts +8 -88
  84. package/package.json +4 -96
  85. package/dist/agent-contract.js +0 -1
  86. package/dist/host-contract.js +0 -1
  87. package/dist/host-session-collection-contract.js +0 -1
  88. package/dist/memory-category-contract.js +0 -1
  89. package/dist/permissions.js +0 -1
  90. package/dist/plugin-marketplace-compute.js +0 -1
  91. package/dist/project-memory-host.js +0 -38
  92. package/dist/protocol.js +0 -1
  93. package/dist/skill-category-contract.js +0 -1
  94. package/dist/tunables.js +0 -1
  95. package/dist/types/agent/memory-recall-context.d.ts +0 -22
  96. package/dist/types/agent/memory-recall-injection.d.ts +0 -32
  97. package/dist/types/cli/acp-extended-handlers.d.ts +0 -110
  98. package/dist/types/cli/acp-extended-host-adapter.d.ts +0 -20
  99. package/dist/types/cli/community-resource-installer.d.ts +0 -39
  100. package/dist/types/cli/community-skill-installer.d.ts +0 -18
  101. package/dist/types/cli/community-workflow-installer.d.ts +0 -29
  102. package/dist/types/cli/default-project-bootstrap.d.ts +0 -12
  103. package/dist/types/cli/dream-host-adapter.d.ts +0 -24
  104. package/dist/types/cli/gateway-rpc-connection.d.ts +0 -50
  105. package/dist/types/cli/handlers/community-handler.d.ts +0 -14
  106. package/dist/types/cli/handlers/config-handler.d.ts +0 -19
  107. package/dist/types/cli/handlers/control-handler.d.ts +0 -29
  108. package/dist/types/cli/handlers/dream-handler.d.ts +0 -41
  109. package/dist/types/cli/handlers/goal-handler.d.ts +0 -66
  110. package/dist/types/cli/handlers/memory-handler.d.ts +0 -23
  111. package/dist/types/cli/handlers/product-handler.d.ts +0 -35
  112. package/dist/types/cli/handlers/session-handler.d.ts +0 -29
  113. package/dist/types/cli/handlers/skill-curator-handler.d.ts +0 -8
  114. package/dist/types/cli/handlers/solo-handler.d.ts +0 -25
  115. package/dist/types/cli/handlers/turn-baseline-handler.d.ts +0 -8
  116. package/dist/types/cli/handlers/workflow-compute-handler.d.ts +0 -8
  117. package/dist/types/cli/handlers/working-materials-handler.d.ts +0 -9
  118. package/dist/types/cli/idle-dream-coordinator.d.ts +0 -57
  119. package/dist/types/cli/memory-background-coordinator.d.ts +0 -26
  120. package/dist/types/cli/memory-candidate-service.d.ts +0 -75
  121. package/dist/types/cli/memory-coordinator.d.ts +0 -40
  122. package/dist/types/cli/multi-agent-handler-host.d.ts +0 -16
  123. package/dist/types/cli/multi-agent-state-coordinator.d.ts +0 -8
  124. package/dist/types/cli/orchestration-memory-context.d.ts +0 -23
  125. package/dist/types/cli/product-acp-params.d.ts +0 -30
  126. package/dist/types/cli/product-coordinator.d.ts +0 -21
  127. package/dist/types/cli/project-memory-store-factory.d.ts +0 -12
  128. package/dist/types/cli/project-template-seeder.d.ts +0 -5
  129. package/dist/types/cli/rpc-registry.d.ts +0 -56
  130. package/dist/types/cli/session-history-coordinator.d.ts +0 -8
  131. package/dist/types/cli/session-query-service.d.ts +0 -27
  132. package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +0 -56
  133. package/dist/types/cli/stdio-session-runtime-coordinator.d.ts +0 -17
  134. package/dist/types/cli/task-distillation-coordinator.d.ts +0 -146
  135. package/dist/types/cli/turn-ask-user-setup.d.ts +0 -24
  136. package/dist/types/cli/turn-suggestion-generator.d.ts +0 -15
  137. package/dist/types/contracts/memory-recall-packet.d.ts +0 -31
  138. package/dist/types/contracts/memory-response-contract.d.ts +0 -2
  139. package/dist/types/host-contract/fts-segment.d.ts +0 -20
  140. package/dist/types/host-contract/index.d.ts +0 -1819
  141. package/dist/types/host-contract/memory-category.d.ts +0 -8
  142. package/dist/types/host-contract/skill-category.d.ts +0 -5
  143. package/dist/types/host-session-collection-contract.d.ts +0 -65
  144. package/dist/types/orchestration/agent-instance.d.ts +0 -215
  145. package/dist/types/orchestration/agent-roster.d.ts +0 -32
  146. package/dist/types/orchestration/dag-scheduler.d.ts +0 -219
  147. package/dist/types/orchestration/delegate-approval-policy.d.ts +0 -8
  148. package/dist/types/orchestration/delegate-bridge.d.ts +0 -8
  149. package/dist/types/orchestration/goal-acceptance.d.ts +0 -17
  150. package/dist/types/orchestration/goal-context-envelope.d.ts +0 -7
  151. package/dist/types/orchestration/goal-loop-coordinator.d.ts +0 -151
  152. package/dist/types/orchestration/goal-mode-adapters.d.ts +0 -152
  153. package/dist/types/orchestration/goal-run-persistence.d.ts +0 -21
  154. package/dist/types/orchestration/goal-run-types.d.ts +0 -225
  155. package/dist/types/orchestration/planner-memory-brief.d.ts +0 -39
  156. package/dist/types/orchestration/product-budget.d.ts +0 -94
  157. package/dist/types/orchestration/product-checkpoint.d.ts +0 -50
  158. package/dist/types/orchestration/product-dag-mutation-applier.d.ts +0 -10
  159. package/dist/types/orchestration/product-persistence.d.ts +0 -90
  160. package/dist/types/orchestration/product-planner.d.ts +0 -332
  161. package/dist/types/orchestration/product-run-coordinator.d.ts +0 -49
  162. package/dist/types/orchestration/product-worktree.d.ts +0 -19
  163. package/dist/types/orchestration/run-state-host-authority.d.ts +0 -7
  164. package/dist/types/orchestration/solo-evaluator.d.ts +0 -179
  165. package/dist/types/orchestration/solo-persistence.d.ts +0 -47
  166. package/dist/types/orchestration/solo-spec-builder.d.ts +0 -58
  167. package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +0 -23
  168. package/dist/types/orchestration/testing/host-agent-provider-directory-fixture.d.ts +0 -7
  169. package/dist/types/orchestration/testing/run-state-client-double.d.ts +0 -13
  170. package/dist/types/orchestration/workflow/budget-permission-gate.d.ts +0 -94
  171. package/dist/types/orchestration/workflow/builtin-capabilities.d.ts +0 -3
  172. package/dist/types/orchestration/workflow/builtin-executors.d.ts +0 -18
  173. package/dist/types/orchestration/workflow/capability-catalog.d.ts +0 -72
  174. package/dist/types/orchestration/workflow/cron-schedule.d.ts +0 -36
  175. package/dist/types/orchestration/workflow/data-item.d.ts +0 -39
  176. package/dist/types/orchestration/workflow/expression.d.ts +0 -60
  177. package/dist/types/orchestration/workflow/host-executors.d.ts +0 -15
  178. package/dist/types/orchestration/workflow/n8n-expression.d.ts +0 -48
  179. package/dist/types/orchestration/workflow/n8n-import.d.ts +0 -64
  180. package/dist/types/orchestration/workflow/n8n-template-compat.d.ts +0 -5
  181. package/dist/types/orchestration/workflow/node-registry.d.ts +0 -32
  182. package/dist/types/orchestration/workflow/node-schema.d.ts +0 -249
  183. package/dist/types/orchestration/workflow/params-schema.d.ts +0 -69
  184. package/dist/types/orchestration/workflow/qla-executor-host.d.ts +0 -63
  185. package/dist/types/orchestration/workflow/run-checkpoint-store.d.ts +0 -53
  186. package/dist/types/orchestration/workflow/run-history-store.d.ts +0 -103
  187. package/dist/types/orchestration/workflow/semantic-acceptance.d.ts +0 -65
  188. package/dist/types/orchestration/workflow/trigger-validation.d.ts +0 -22
  189. package/dist/types/orchestration/workflow/workflow-audit-store.d.ts +0 -31
  190. package/dist/types/orchestration/workflow/workflow-authoring.d.ts +0 -74
  191. package/dist/types/orchestration/workflow/workflow-bundle.d.ts +0 -51
  192. package/dist/types/orchestration/workflow/workflow-controller.d.ts +0 -237
  193. package/dist/types/orchestration/workflow/workflow-edit-context.d.ts +0 -46
  194. package/dist/types/orchestration/workflow/workflow-error.d.ts +0 -28
  195. package/dist/types/orchestration/workflow/workflow-intent-contract.d.ts +0 -56
  196. package/dist/types/orchestration/workflow/workflow-patch.d.ts +0 -122
  197. package/dist/types/orchestration/workflow/workflow-render.d.ts +0 -40
  198. package/dist/types/orchestration/workflow/workflow-runtime.d.ts +0 -184
  199. package/dist/types/orchestration/workflow/workflow-scheduler.d.ts +0 -122
  200. package/dist/types/orchestration/workflow/workflow-store.d.ts +0 -85
  201. package/dist/types/orchestration/workflow/workflow-template-setup.d.ts +0 -65
  202. package/dist/types/orchestration/workflow/workflow-trigger.d.ts +0 -43
  203. package/dist/types/orchestration/workflow-chat-builder.d.ts +0 -152
  204. package/dist/types/orchestration/worktree-task-prompt.d.ts +0 -1
  205. package/dist/types/permissions.d.ts +0 -4
  206. package/dist/types/project-memory-host.d.ts +0 -4
  207. package/dist/types/protocol/agent-contract.d.ts +0 -93
  208. package/dist/types/protocol/methods.d.ts +0 -645
  209. package/dist/types/protocol/wire/acp-agent-management.d.ts +0 -533
  210. package/dist/types/protocol/wire/agent-events.d.ts +0 -1
  211. package/dist/types/protocol/wire/agent-methods.d.ts +0 -500
  212. package/dist/types/protocol/wire/agent-rpc.d.ts +0 -100
  213. package/dist/types/protocol/wire/gateway-contract.d.ts +0 -61
  214. package/dist/types/protocol/wire/gateway-rpc.d.ts +0 -1177
  215. package/dist/types/protocol/wire/memory-provider-lifecycle.d.ts +0 -31
  216. package/dist/types/protocol/wire/turn.d.ts +0 -208
  217. package/dist/types/runtime/community/autonomy-budget.d.ts +0 -26
  218. package/dist/types/runtime/community/community-consent-client.d.ts +0 -55
  219. package/dist/types/runtime/community/package-materialize.d.ts +0 -19
  220. package/dist/types/runtime/community/ranged-download.d.ts +0 -21
  221. package/dist/types/runtime/community/registry-signature.d.ts +0 -48
  222. package/dist/types/runtime/execution/dream-agent.d.ts +0 -273
  223. package/dist/types/runtime/execution/dream-category-context.d.ts +0 -47
  224. package/dist/types/runtime/execution/memory-decay.d.ts +0 -73
  225. package/dist/types/runtime/execution/turn-progress-notifier.d.ts +0 -16
  226. package/dist/types/runtime/hooks/memory-hooks.d.ts +0 -111
  227. package/dist/types/runtime/infra/acp-host-handler.d.ts +0 -31
  228. package/dist/types/runtime/infra/acp-protocol-adapter.d.ts +0 -209
  229. package/dist/types/runtime/infra/acp-usage-tracker.d.ts +0 -46
  230. package/dist/types/runtime/infra/cloud-auth-host-authority.d.ts +0 -4
  231. package/dist/types/runtime/infra/feedback-distillation-worker.d.ts +0 -20
  232. package/dist/types/runtime/infra/feedback-distillation.d.ts +0 -32
  233. package/dist/types/runtime/infra/feedback-event-store.d.ts +0 -179
  234. package/dist/types/runtime/infra/feedback-host-authority.d.ts +0 -4
  235. package/dist/types/runtime/infra/feedback-outbox.d.ts +0 -26
  236. package/dist/types/runtime/infra/feedback-redaction.d.ts +0 -71
  237. package/dist/types/runtime/infra/feedback-upload-client.d.ts +0 -39
  238. package/dist/types/runtime/infra/feedback-upload-worker.d.ts +0 -11
  239. package/dist/types/runtime/infra/host-agent-provider-directory.d.ts +0 -17
  240. package/dist/types/runtime/infra/project-authority-facade.d.ts +0 -11
  241. package/dist/types/runtime/infra/project-data-paths.d.ts +0 -24
  242. package/dist/types/runtime/infra/project-host-authority.d.ts +0 -11
  243. package/dist/types/runtime/infra/project-instructions-store.d.ts +0 -30
  244. package/dist/types/runtime/infra/turn-baseline-store.d.ts +0 -102
  245. package/dist/types/runtime/infra/turn-telemetry-store.d.ts +0 -100
  246. package/dist/types/runtime/infra/working-materials-store.d.ts +0 -29
  247. package/dist/types/runtime/memory/find-relevant-memories.d.ts +0 -26
  248. package/dist/types/runtime/memory/implicit-extraction.d.ts +0 -69
  249. package/dist/types/runtime/memory/memory-recall-attribution.d.ts +0 -24
  250. package/dist/types/runtime/ports/memory-provider.d.ts +0 -219
  251. package/dist/types/runtime/ports/memory-recall-source.d.ts +0 -14
  252. package/dist/types/runtime/ports/memory-writer.d.ts +0 -70
  253. package/dist/types/runtime/ports/project-memory-store.d.ts +0 -49
  254. package/dist/types/runtime/prompt/host-skill-directory.d.ts +0 -16
  255. package/dist/types/runtime/session/group-session-split.d.ts +0 -38
  256. package/dist/types/runtime/session/inbound-upload-persistence.d.ts +0 -47
  257. package/dist/types/runtime/session/session-catalog.d.ts +0 -12
  258. package/dist/types/runtime/session/session-deletion-guard.d.ts +0 -4
  259. package/dist/types/runtime/session/session-locator.d.ts +0 -26
  260. package/dist/types/runtime/session/session-metadata-store.d.ts +0 -8
  261. package/dist/types/runtime/session/session-paths.d.ts +0 -8
  262. package/dist/types/runtime/session/session-permission-store.d.ts +0 -6
  263. package/dist/types/runtime/session/session-persistence.d.ts +0 -37
  264. package/dist/types/runtime/session/session-recovery.d.ts +0 -62
  265. package/dist/types/runtime/session/session-resource-key.d.ts +0 -28
  266. package/dist/types/runtime/session/session-resume.d.ts +0 -9
  267. package/dist/types/runtime/session/session-schema.d.ts +0 -10
  268. package/dist/types/runtime/session/session-summary.d.ts +0 -7
  269. package/dist/types/runtime/session/session-title.d.ts +0 -9
  270. package/dist/types/runtime/session/session-transcript-store.d.ts +0 -30
  271. package/dist/types/runtime/session/session-types.d.ts +0 -113
  272. package/dist/types/runtime/session/session-write-queue.d.ts +0 -3
  273. package/dist/types/skills/memory/host-memory-provider.d.ts +0 -235
  274. package/dist/types/skills/memory/memdir.d.ts +0 -111
  275. package/dist/types/skills/memory/memory-content-safety.d.ts +0 -1
  276. package/dist/types/skills/memory/memory-vector-utils.d.ts +0 -2
  277. package/dist/types/skills/memory/task-distillation.d.ts +0 -183
  278. package/dist/types/skills/plugins/plugin-marketplace.d.ts +0 -43
  279. package/dist/types/skills/skill-system/skill-bundles.d.ts +0 -8
  280. package/dist/types/skills/skill-system/skill-lifecycle.d.ts +0 -89
  281. package/dist/types/test-support/run-state-authority-setup.d.ts +0 -1
  282. package/dist/types/transport/delegate-client.d.ts +0 -82
  283. package/dist/types/transport/host-capability-client.d.ts +0 -21
  284. package/dist/types/transport/host-cloud-auth-client.d.ts +0 -10
  285. package/dist/types/transport/host-community-client.d.ts +0 -7
  286. package/dist/types/transport/host-feedback-client.d.ts +0 -25
  287. package/dist/types/transport/host-profile-client.d.ts +0 -19
  288. package/dist/types/transport/host-project-client.d.ts +0 -16
  289. package/dist/types/transport/host-request-client.d.ts +0 -42
  290. package/dist/types/transport/host-run-state-client.d.ts +0 -23
  291. package/dist/types/transport/host-session-client.d.ts +0 -30
  292. package/dist/types/tunables.d.ts +0 -2
  293. package/dist/types/workflow-host.d.ts +0 -38
  294. package/dist/workflow-host.js +0 -11
  295. /package/dist/types/{host-contract → protocol/wire}/acp-content.d.ts +0 -0
  296. /package/dist/types/{host-contract → runtime/infra}/project-id.d.ts +0 -0
  297. /package/dist/types/{host-contract → runtime/infra}/provider-profile.d.ts +0 -0
@@ -1,25 +1,4 @@
1
- /**
2
- * Agent Notification Payload Types — wire-format contract for all JSON-RPC notifications.
3
- *
4
- * These types define the exact shape of `params` in every notification the agent emits.
5
- * Consumers (xiaozhiclaw UI, Hub relay, Electron, test harness) import from here
6
- * to get type-safe access to event payloads without depending on agent internals.
7
- *
8
- * Design: Agent's protocol/notifications.ts re-exports these; adding a new event =
9
- * 1. Add payload interface here
10
- * 2. Add entry in NotificationMethodMap here
11
- * 3. Add event name string in agent-events.ts (if WS-relayed)
12
- */
13
- import type { DelegationError } from "./gateway-rpc.js";
14
- import type { ThreadItem, ThreadItemEvent } from "../../host-contract/index.js";
15
- import type { ToolIdentity } from "./chat-types.js";
16
- /** Identifies which agent produced this notification (main or teammate). */
17
- export interface AgentSource {
18
- id: string;
19
- name: string;
20
- role: "main" | "teammate";
21
- }
22
- /** Token usage as sent on the wire (JSON-RPC notifications). */
1
+ /** Token accounting returned by an Agent turn. */
23
2
  export interface WireTokenUsage {
24
3
  inputTokens: number;
25
4
  outputTokens: number;
@@ -27,89 +6,18 @@ export interface WireTokenUsage {
27
6
  cacheRead?: number;
28
7
  cacheWrite?: number;
29
8
  }
30
- /** Embedded canonical item; never a second notification-only item shape. */
31
- export type NotificationThreadItem = ThreadItem;
32
- /** One live notification carrying the exact envelope written to the Host journal. */
33
- export type ThreadItemNotification = ThreadItemEvent;
34
- export type MediaResultType = "image" | "tts" | "video" | "music" | "3d" | "file";
35
- export type ArtifactType = "code" | "file" | "image" | "document" | "diagram" | "table";
36
- /** Turn started — always emitted first. */
37
- export interface TurnStartNotification {
38
- turnId: string;
39
- model?: string;
40
- provider?: string;
41
- /** Project that owns this session — enables frontend to associate without fallback guessing */
42
- projectId?: string;
43
- }
44
- /** Streaming text chunk from the main agent. */
9
+ /** Internal events that have a direct standard ACP projection. */
45
10
  export interface TurnDeltaNotification {
46
11
  turnId: string;
47
12
  text: string;
48
- item?: NotificationThreadItem;
49
- agentSource?: AgentSource;
50
13
  }
51
- /** Turn completed successfully. */
52
14
  export interface TurnEndNotification {
53
15
  turnId: string;
54
16
  content: string;
55
17
  usage?: WireTokenUsage;
56
18
  model?: string;
57
19
  provider?: string;
58
- item?: NotificationThreadItem;
59
- agentSource?: AgentSource;
60
- }
61
- /** Turn failed. */
62
- export interface TurnErrorNotification {
63
- turnId: string;
64
- error: {
65
- message: string;
66
- code?: string;
67
- };
68
- }
69
- /** Agent self-recovered from an error. */
70
- export interface TurnRecoveryNotification {
71
- turnId: string;
72
- action: string;
73
- detail?: string;
74
- item?: NotificationThreadItem;
75
20
  }
76
- /**
77
- * 作废本回合已发出但随后被丢弃的助手文本(后缀截断)。语义与边界见
78
- * `contracts/turn-event.ts` 的 `text_rollback` 变体;消费端只执行截断,不推断截断点。
79
- */
80
- export interface TurnTextRollbackNotification {
81
- turnId: string;
82
- /** 保留的助手文本长度,UTF-16 code unit,按全部文本段逻辑拼接计算。 */
83
- keepLength: number;
84
- reason: string;
85
- }
86
- export type TurnFileChangeStatus = "added" | "modified" | "deleted" | "renamed" | "moved" | "copied" | "unchanged";
87
- export interface TurnFileChangeRecord {
88
- path: string;
89
- previousPath?: string;
90
- status: TurnFileChangeStatus;
91
- additions?: number;
92
- deletions?: number;
93
- }
94
- export interface TurnFileChangeSummaryWire {
95
- turnId: string;
96
- sessionId: string;
97
- projectId: string;
98
- state: "running" | "completed" | "failed" | "cancelled";
99
- startedAt: string;
100
- completedAt?: string;
101
- filesChanged: number;
102
- files: TurnFileChangeRecord[];
103
- truncated?: boolean;
104
- }
105
- export interface TurnFileChangesNotification {
106
- sessionId: string;
107
- turnId: string;
108
- projectId: string;
109
- state: "completed" | "failed" | "cancelled";
110
- summary: TurnFileChangeSummaryWire;
111
- }
112
- /** Tool invocation started. */
113
21
  export interface TurnToolCallNotification {
114
22
  turnId: string;
115
23
  callId: string;
@@ -117,10 +25,7 @@ export interface TurnToolCallNotification {
117
25
  displayName?: string;
118
26
  arguments?: string;
119
27
  inputSummary?: string;
120
- item?: NotificationThreadItem;
121
- agentSource?: AgentSource;
122
28
  }
123
- /** Tool execution completed. */
124
29
  export interface TurnToolResultNotification {
125
30
  turnId: string;
126
31
  callId: string;
@@ -128,925 +33,35 @@ export interface TurnToolResultNotification {
128
33
  ok: boolean;
129
34
  error?: string;
130
35
  outputPreview?: string;
131
- durationMs?: number;
132
- exitCode?: number;
133
- stdout?: string;
134
- stderr?: string;
135
36
  details?: Record<string, unknown>;
136
- item?: NotificationThreadItem;
137
37
  }
138
- /** Tool execution blocked by permission system. */
139
38
  export interface TurnToolBlockedNotification {
140
39
  turnId: string;
141
40
  callId: string;
142
41
  name: string;
143
42
  reason: string;
144
- item?: NotificationThreadItem;
145
43
  }
146
- /** Reasoning/thinking token stream. */
147
44
  export interface TurnReasoningDeltaNotification {
148
45
  turnId: string;
149
46
  delta?: string;
150
- /** Alias for delta — used by stdio-server event forwarding. */
151
47
  text?: string;
152
48
  }
153
- /** Plan/strategy update. */
154
- export interface TurnPlanUpdateNotification {
155
- turnId: string;
156
- slug: string;
157
- content: string;
158
- item?: NotificationThreadItem;
159
- }
160
- /** Suggestion items. */
161
- export interface TurnSuggestionsNotification {
162
- turnId: string;
163
- items: Array<{
164
- text: string;
165
- icon?: string;
166
- action?: string;
167
- }>;
168
- }
169
- /** Memory recall visibility (Part B): fired when turn-time recall injected memories,
170
- * so the UI can render a "based on N memories" disclosure row (recall was invisible before). */
171
- export interface TurnMemoryRecallNotification {
172
- /** Receipt schema for consumers that distinguish final prompt admission. */
173
- receiptVersion?: 1;
174
- /** Present only when the receipt witnesses admission into the final model prompt. */
175
- stage?: "final-prompt";
176
- sessionId: string;
177
- turnId: string;
178
- /** How memory entered the final prompt; resident INDEX context is not selective retrieval. */
179
- source: "automatic" | "tool" | "resident";
180
- count: number;
181
- /** Truncated texts of the memories actually injected (post-cap), for the expanded list. */
182
- titles: string[];
183
- /** Content-free canonical memory ids used to compare evidence across recall routes. */
184
- memoryIds?: string[];
185
- /** Content-free identifiers for the injected memory layers. */
186
- sources?: string[];
187
- }
188
- /** Memory write visibility (Part B): fired on the synchronous agent-remember tool path.
189
- * Dream/async consolidation deliberately does NOT emit this (it surfaces via next-turn recall). */
190
- export interface TurnMemoryWrittenNotification {
191
- items: Array<{
192
- title: string;
193
- }>;
194
- }
195
- /** Sidechain started execution. */
196
- export interface TurnSidechainStartedNotification {
197
- turnId: string;
198
- depth: number;
199
- role: string;
200
- }
201
- /** Sub-agent streaming text chunk. */
202
- export interface TurnSubagentDeltaNotification {
203
- agentType: string;
204
- subagentId?: string;
205
- text: string;
206
- }
207
- export type TurnSubagentActivityStatus = "running" | "completed" | "failed" | "blocked";
208
- /** Tool-level sub-agent progress. Never carries hidden reasoning or raw model chain-of-thought. */
209
- export interface TurnSubagentActivityNotification {
210
- turnId: string;
211
- parentTurnId: string;
212
- subagentId: string;
213
- agentType: string;
214
- displayName: string;
215
- activityId?: string;
216
- toolName?: string;
217
- conciseStatus: string;
218
- status: TurnSubagentActivityStatus;
219
- observedAt: string;
220
- }
221
- /** Sidechain completed execution. */
222
- export interface TurnSidechainCompletedNotification {
223
- turnId: string;
224
- depth: number;
225
- toolCallCount: number;
226
- }
227
- /** URL / file citations returned by OpenAI built-in tools. */
228
- export interface TurnAnnotationsNotification {
229
- turnId: string;
230
- annotations: Array<{
231
- type: string;
232
- url?: string;
233
- title?: string;
234
- [key: string]: unknown;
235
- }>;
236
- }
237
- /** Structured media generation result. */
49
+ export type MediaResultType = "image" | "tts" | "video" | "music" | "3d" | "file";
238
50
  export interface TurnMediaResultNotification {
239
51
  turnId: string;
240
52
  mediaType: MediaResultType;
241
53
  url: string;
242
- model?: string;
243
- provider?: string;
244
- durationSeconds?: number;
245
- width?: number;
246
- height?: number;
247
54
  mimeType?: string;
248
55
  filename?: string;
249
56
  size?: number;
250
- billingUnit?: string;
251
- billingQuantity?: number;
252
- taskId?: string;
253
- }
254
- /** Task state change. */
255
- export interface TurnTaskUpdatedNotification {
256
- turnId: string;
257
- tasks: Array<{
258
- id: string;
259
- title: string;
260
- status: string;
261
- }>;
262
- }
263
- /** Real-time todo list update. */
264
- export interface TurnTodosUpdatedNotification {
265
- turnId: string;
266
- items: Array<{
267
- id: number;
268
- title: string;
269
- status: string;
270
- owner?: string;
271
- blockedBy?: number[];
272
- }>;
273
- summary?: {
274
- total: number;
275
- completed: number;
276
- inProgress: number;
277
- notStarted: number;
278
- };
279
- }
280
- /** Long-running command execution progress. */
281
- export interface TurnExecProgressNotification {
282
- output: string;
283
- elapsedTimeSeconds: number;
284
- visibleLines: number;
285
- totalBytes: number;
286
- }
287
- /**
288
- * Throttled long-turn progress (IM channel feedback). Emitted at most once per throttle
289
- * interval while a turn keeps running tools; gateway/IM bridge renders it as a short
290
- * progress line. Desktop UIs already show the tool stream and may ignore it.
291
- */
292
- export interface TurnProgressNotification {
293
- turnId: string;
294
- /** Milliseconds since the turn started. */
295
- elapsedMs: number;
296
- /** Tool results observed so far this turn. */
297
- toolCalls: number;
298
- /** Name of the most recently completed tool. */
299
- lastTool: string;
300
- }
301
- /** Generic progress heartbeat. */
302
- export interface TurnHeartbeatNotification {
303
- turnId: string;
304
- message: string;
305
- }
306
- /** Structured telemetry for a tool use batch. */
307
- export interface ToolCallExecutionEvidence {
308
- sequence: number;
309
- callId: string;
310
- name: string;
311
- identity: ToolIdentity;
312
- status: "running" | "succeeded" | "failed" | "blocked";
313
- arguments?: string;
314
- error?: string;
315
- failureKind?: "policy_blocked" | "semantic_quality_failed" | "timeout" | "mcp_start_failed" | "mcp_unavailable" | "tool_execution_failed";
316
- }
317
- export interface FinalAnswerEvidence {
318
- schemaVersion: 1;
319
- requirement: "not-required" | "fresh-tool-evidence";
320
- disposition: "not-required" | "grounded" | "blocked-no-tool-evidence" | "blocked-no-successful-evidence";
321
- successfulCallIds: string[];
322
- failedCallIds: string[];
323
- blockedCallIds: string[];
324
- reason: string;
325
- }
326
- export interface TurnToolUseSummaryNotification {
327
- turnId: string;
328
- telemetrySource?: "agent";
329
- ledgerSchemaVersion: 4;
330
- toolCalls: ToolCallExecutionEvidence[];
331
- finalAnswerEvidence: FinalAnswerEvidence;
332
- availableToolNames: string[];
333
- enabledToolNames: string[];
334
- toolCallNames: string[];
335
- blockedToolCalls: Array<{
336
- name: string;
337
- reason: string;
338
- }>;
339
- }
340
- export interface TurnToolSelectionPolicyNotification {
341
- turnId: string;
342
- policyId: string;
343
- intent: "benchmark_state_maintenance" | "fresh_evidence" | "verification" | "final_answer" | "tool_recovery" | "lifecycle_reconciliation";
344
- reason: string;
345
- availableToolNames: string[];
346
- enabledToolNamesBefore: string[];
347
- enabledToolNamesAfter: string[];
348
- suppressedToolNames: string[];
349
- nextAction: string;
350
- }
351
- /** Queryable long-horizon turn lifecycle telemetry. */
352
- export interface TurnLifecycleNotification {
353
- turnId: string;
354
- kind: "stage" | "reopen" | "resume" | "context_compression" | "goal_reconstruction" | "memory_drift" | "artifact_path_drift";
355
- stage?: string;
356
- status?: string;
357
- detail?: string;
358
- reconstruction?: GoalReconstructionState;
359
- observedAt?: string;
360
- }
361
- export interface GoalReconstructionState {
362
- goal: string;
363
- artifactRoot: string;
364
- decisions: string[];
365
- defects: string[];
366
- acceptanceCriteria: string[];
367
- blockers: string[];
368
- nextAction: string;
369
- }
370
- export interface MaintainedDocumentIndex {
371
- name?: string;
372
- path?: string;
373
- indexed: true;
374
- maintained: true;
375
- indexVersion: string;
376
- contentHash: string;
377
- summary: string;
378
- lastReviewedTurn: number;
379
- fileSizeBytes: number;
380
- recordCount: number;
381
- }
382
- export interface DecisionStateRecord {
383
- id: string;
384
- decision: string;
385
- status: string;
386
- evidence: string;
387
- lastConfirmedTurn: number;
388
- }
389
- export interface ReadCycleGuard {
390
- strategy: string;
391
- nextReadPolicy: string;
392
- budgetStatus: "within-budget";
393
- maxReadsPerDocument: number;
394
- observedReadsByPath: Record<string, number>;
395
- }
396
- /** Queryable large-document maintenance and read-cycle audit telemetry. */
397
- export interface TurnDocumentMaintenanceNotification {
398
- turnId: string;
399
- checkpointId: string;
400
- documents: MaintainedDocumentIndex[];
401
- decisionStateTable: DecisionStateRecord[];
402
- readCycleFindings: Array<Record<string, unknown>>;
403
- readCycleGuard: ReadCycleGuard;
404
- observedAt?: string;
405
- }
406
- /** Structured artifact produced by the agent. */
407
- export interface TurnArtifactNotification {
408
- turnId: string;
409
- artifactId: string;
410
- type: ArtifactType;
411
- title: string;
412
- filePath?: string;
413
- language?: string;
414
- content?: string;
415
- mimeType?: string;
416
- }
417
- /** Single-track artifact delivery and browser-acceptance contract. */
418
- export interface TurnArtifactContractNotification {
419
- turnId: string;
420
- artifactRoot?: string;
421
- writePaths: string[];
422
- outOfRootWrites: Array<{
423
- path: string;
424
- artifactRoot: string;
425
- toolName: string;
426
- }>;
427
- devServerUrls: string[];
428
- browserVerified: boolean;
429
- browserEvidence: string[];
430
- requiresBrowserAcceptance: boolean;
431
- }
432
- /** Agent requests user approval before executing a restricted tool. */
433
- export interface ToolApprovalRequestNotification {
434
- approvalId: string;
435
- callId: string;
436
- toolName: string;
437
- arguments: string;
438
- message?: string;
439
- suggestions?: string[];
440
- category?: "cross_workspace" | "high_risk_delete" | "high_risk_egress" | "destructive";
441
- reason?: string;
442
- options?: Array<{
443
- optionId: string;
444
- name: string;
445
- kind: string;
446
- scope?: string;
447
- }>;
448
- rememberScope?: {
449
- kind: "directory";
450
- path: string;
451
- };
452
- }
453
- /** Agent detected a repeating pattern that should be acquired as a skill from hub. */
454
- export interface TurnSkillAcquisitionNeededNotification {
455
- turnId: string;
456
- pattern: {
457
- suggestedName: string;
458
- description: string;
459
- tools: string[];
460
- };
461
- }
462
- /** Agent asks the user a clarifying question mid-turn. */
463
- export interface TurnAskUserNotification {
464
- askId?: string;
465
- requestId?: string;
466
- questions: Array<{
467
- header: string;
468
- question: string;
469
- options?: Array<{
470
- label: string;
471
- description?: string;
472
- }>;
473
- }>;
474
- }
475
- /** Memory content changed (local md or QMemory). */
476
- export interface MemoryUpdatedNotification {
477
- source: string;
478
- target?: string;
479
- entryCount?: number;
480
- summary?: string;
481
- }
482
- /** Project knowledge base instruction file changed. */
483
- export interface InstructionsUpdatedNotification {
484
- projectId?: string;
485
- action: "write" | "delete";
486
- filename: string;
487
- }
488
- /** Skills list changed (activated/deactivated/learned/deleted). */
489
- export interface SkillsUpdatedNotification {
490
- action: "activate" | "deactivate" | "delete" | "learn" | "promote";
491
- name?: string;
492
- }
493
- /** Importance decay completed after Dream consolidation. */
494
- export interface MemoryDecayCompletedNotification {
495
- decayed: number;
496
- archived: number;
497
- durationMs: number;
498
- }
499
- /** L3 启动扫描发现的待恢复会话(崩溃残留的 in-flight turn,session-lifecycle-recovery)。 */
500
- export interface SessionRecoveryPendingNotification {
501
- sessions: Array<{
502
- sessionId: string;
503
- turnId: string;
504
- startedAt: string;
505
- lastUserPreview?: string;
506
- hadSideEffectTool: boolean;
507
- }>;
508
- }
509
- /** Session metadata changed. */
510
- export interface SessionInfoNotification {
511
- sessionId: string;
512
- title?: string;
513
- model?: string;
514
- provider?: string;
515
- cwd?: string;
516
- turnCount?: number;
517
- pinnedAt?: string;
518
- projectId?: string;
519
- }
520
- /** Permission rule saved/updated. */
521
- export interface PermissionRuleUpdatedNotification {
522
- pattern: string;
523
- behavior: string;
524
- scope?: "session" | "persistent";
525
- }
526
- /** Forwarded notification from a team member child process. */
527
- export interface TeamMemberNotification {
528
- memberId: string;
529
- method: string;
530
- params: unknown;
531
- }
532
- export interface PongNotification {
533
- }
534
- /** Real-time token usage update. */
535
- export interface TurnUsageUpdateNotification {
536
- turnId: string;
537
- usage: WireTokenUsage;
538
- model?: string;
539
- sessionCostUSD?: number;
540
- }
541
- /** Solo agent progress. */
542
- export interface SoloProgressNotification {
543
- soloId: string;
544
- agentId: string;
545
- state: "pending" | "running" | "completed" | "failed" | "idle";
546
- progress?: string;
547
- /** Absolute path of the competitor's isolated git worktree, sent with the first "running" event so
548
- * the UI can resolve the agent's产物 (which live in the worktree) for click-to-preview. */
549
- worktreePath?: string;
550
- }
551
- /** Solo evaluation completed. */
552
- export interface SoloEvaluationNotification {
553
- soloId: string;
554
- winnerId: string;
555
- reasoning: string;
556
- /** Present (true) only on the solo.select adoption event; absent on the auto-judge recommendation. */
557
- adopted?: boolean;
558
- /** displayId of the agent that acted as judge (trust caveat when it is also a racer). */
559
- judgedBy?: string;
560
- /** True when an independent, non-competing agent judged the race. */
561
- judgeExternal?: boolean;
562
- /** True when the verdict is a fallback (judge failed / unparseable) — flag for manual review. */
563
- degraded?: boolean;
564
- }
565
- /** Full unified diff of one competitor's worktree, emitted when a turn settles (initial run or
566
- * follow-up). Carries the same capped diff the judge scores, so the user sees what the judge sees. */
567
- export interface SoloAgentDiffNotification {
568
- soloId: string;
569
- agentId: string;
570
- diff: string;
571
- }
572
- /** Run-level Solo state transition (e.g. entering/leaving "evaluating"), so the UI can show the
573
- * auto-judge phase instead of a silent gap between all-done and the verdict. */
574
- export interface SoloStateNotification {
575
- soloId: string;
576
- state: "running" | "evaluating" | "completed" | "failed" | "cancelled";
577
- }
578
- /** Solo agent streaming delta. */
579
- export interface SoloAgentDeltaNotification {
580
- soloId: string;
581
- agentId: string;
582
- text: string;
583
- }
584
- /** Solo agent usage. */
585
- export interface SoloAgentUsageNotification {
586
- soloId: string;
587
- agentId: string;
588
- inputTokens: number;
589
- outputTokens: number;
590
- }
591
- /** Product task started. */
592
- export interface ProductTaskStartedNotification {
593
- productId: string;
594
- taskId: string;
595
- assignee: string;
596
- /** Monotonic attempt number under the stable taskId. */
597
- attempt: number;
598
- }
599
- /** Product task completed. */
600
- export interface ProductTaskCompletedNotification {
601
- productId: string;
602
- taskId: string;
603
- result: string;
604
- attempt: number;
605
- /** Per-task token usage harvested from the agent's usage tracker. */
606
- inputTokens?: number;
607
- outputTokens?: number;
608
- /** Relative paths of files the task produced (before its worktree was torn down). */
609
- changedFiles?: string[];
610
- }
611
- /** Product task failed. */
612
- export interface ProductTaskFailedNotification {
613
- productId: string;
614
- taskId: string;
615
- error: string;
616
- attempt: number;
617
- terminalState: "failed" | "cancelled";
618
- }
619
- /** Automatic abnormal-worker handoff receipt for one stable task. */
620
- export interface ProductTaskHandoffNotification {
621
- productId: string;
622
- taskId: string;
623
- from: string;
624
- to: string;
625
- reason: string;
626
- /** Attempt number that the replacement worker will execute. */
627
- attempt: number;
628
- timestamp: string;
629
- }
630
- /** Product checkpoint saved. */
631
- export interface ProductCheckpointedNotification {
632
- productId: string;
633
- timestamp: string;
634
- }
635
- /** Product budget warning (>80%). */
636
- export interface ProductBudgetWarningNotification {
637
- productId: string;
638
- usedTokens: number;
639
- maxTotalTokens: number;
640
- percentage: number;
641
- }
642
- /**
643
- * Product budget hard limit hit (100%) — the run auto-paused. The counterpart of the 80% warning, and
644
- * the louder of the two: the run has stopped. `maxTotalTokens` is absent for a time-only budget, so
645
- * `reason` is what states WHICH ceiling tripped.
646
- */
647
- export interface ProductBudgetExceededNotification {
648
- productId: string;
649
- usedTokens: number;
650
- maxTotalTokens?: number;
651
- reason: string;
652
- }
653
- /** Product completed (all tasks done or terminal). */
654
- export interface ProductCompletedNotification {
655
- productId: string;
656
- summary: string;
657
- }
658
- /** Product DAG topology. */
659
- export interface ProductDagTopologyNotification {
660
- productId: string;
661
- nodes: {
662
- id: string;
663
- label: string;
664
- deps: string[];
665
- }[];
666
- edges: {
667
- from: string;
668
- to: string;
669
- }[];
670
- }
671
- /** Product budget update. */
672
- export interface ProductBudgetUpdateNotification {
673
- productId: string;
674
- inputTokens: number;
675
- outputTokens: number;
676
- elapsed: number;
677
- maxTotalTokens?: number;
678
- }
679
- /** Product task output delta. */
680
- export interface ProductTaskOutputDeltaNotification {
681
- productId: string;
682
- taskId: string;
683
- text: string;
684
- }
685
- /** Live team roster, emitted once at run start (and on resume) so the 团队成员 panel populates live. */
686
- export interface ProductMembersNotification {
687
- productId: string;
688
- members: {
689
- agentId: string;
690
- role: string;
691
- name: string;
692
- }[];
693
- }
694
- /** Per-task tool-call heartbeat (parity with Solo's solo.agentActivity) — keeps a silent-tool worker's
695
- * detail pane from looking frozen by surfacing the tool it is currently using. */
696
- export interface ProductAgentActivityNotification {
697
- productId: string;
698
- taskId: string;
699
- toolName: string;
700
- }
701
- /** Leader agent produced a structured plan — client should present to user. */
702
- export interface ProductPlanReadyNotification {
703
- productId: string;
704
- plan: {
705
- name: string;
706
- modules: Array<{
707
- name: string;
708
- description: string;
709
- suggestedAgentId?: string;
710
- }>;
711
- instances: Array<{
712
- name: string;
713
- agentId: string;
714
- role: string;
715
- }>;
716
- tasks: Array<{
717
- taskId: string;
718
- assignee: string;
719
- prompt: string;
720
- dependsOn?: string[];
721
- }>;
722
- reasoning: string;
723
- };
724
- }
725
- /** Planning failed. */
726
- export interface ProductPlanFailedNotification {
727
- productId: string;
728
- error: string;
729
- }
730
- /** Streaming text output from leader during planning. */
731
- export interface ProductPlanningDeltaNotification {
732
- productId: string;
733
- text: string;
734
- }
735
- export interface ProductLeaderMessageNotification {
736
- productId: string;
737
- message: string;
738
- }
739
- export interface ProductPlanningAskNotification {
740
- productId: string;
741
- askId: string;
742
- questions: Array<{
743
- question: string;
744
- header: string;
745
- options?: Array<{
746
- label: string;
747
- description?: string;
748
- }>;
749
- multiSelect?: boolean;
750
- }>;
751
- }
752
- /** Plan interrupted. */
753
- export interface PlanInterruptedNotification {
754
- planId: string;
755
- /** The project type (solo/product) of the interrupted plan */
756
- projectType: "solo" | "product";
757
- reason: string;
758
- }
759
- /** A project was created. */
760
- export interface ProjectCreatedNotification {
761
- id: string;
762
- name: string;
763
- workspaceDir: string;
764
- type: string;
765
- groupId?: string;
766
- }
767
- /** Active project was switched. */
768
- export interface ProjectSwitchedNotification {
769
- id: string;
770
- name: string;
771
- workspaceDir: string;
772
- }
773
- /** A project was deleted. */
774
- export interface ProjectDeletedNotification {
775
- id: string;
776
- }
777
- export interface ProjectDetachedNotification {
778
- project: {
779
- id: string;
780
- name: string;
781
- workspaceDir: string;
782
- type: string;
783
- status: "detached";
784
- };
785
- switchedTo?: {
786
- id: string;
787
- name: string;
788
- workspaceDir: string;
789
- };
790
- }
791
- export interface ProjectAttachedNotification {
792
- project: {
793
- id: string;
794
- name: string;
795
- workspaceDir: string;
796
- type: string;
797
- status: "active";
798
- };
799
- }
800
- /** A project was renamed. */
801
- export interface ProjectRenamedNotification {
802
- id: string;
803
- name: string;
804
- workspaceDir: string;
805
- }
806
- /** A project was archived. */
807
- export interface ProjectArchivedNotification {
808
- id: string;
809
- }
810
- /** A project was unarchived (restored). */
811
- export interface ProjectUnarchivedNotification {
812
- id: string;
813
- name: string;
814
- workspaceDir: string;
815
- }
816
- /** A sub-agent was spawned. */
817
- export interface TurnSubagentStartedNotification {
818
- turnId: string;
819
- parentTurnId: string;
820
- subagentId: string;
821
- agentType: string;
822
- displayName: string;
823
- delegatedTask: string;
824
- mode: "foreground" | "background";
825
- startedAt: string;
826
- /** @deprecated Use delegatedTask. */
827
- prompt?: string;
828
- }
829
- /** A sub-agent finished. */
830
- export interface TurnSubagentEndedNotification {
831
- turnId: string;
832
- subagentId: string;
833
- agentType: string;
834
- ok: boolean;
835
- outputPreview?: string;
836
- error?: string;
837
- }
838
- export interface TurnSubagentEvidenceItem {
839
- source: "tool" | "artifact" | "verification";
840
- label: string;
841
- status: "passed" | "failed" | "observed";
842
- }
843
- export interface TurnSubagentTokenUsage {
844
- inputTokens: number;
845
- outputTokens: number;
846
- totalTokens: number;
847
- }
848
- /** Canonical terminal lifecycle event for foreground and background sub-agents. */
849
- export interface TurnSubagentCompletedNotification {
850
- turnId: string;
851
- parentTurnId: string;
852
- subagentId: string;
853
- agentType: string;
854
- displayName: string;
855
- status: "completed" | "failed" | "cancelled";
856
- resultSummary?: string;
857
- evidence: TurnSubagentEvidenceItem[];
858
- toolsUsed: string[];
859
- durationMs: number;
860
- tokenUsage: TurnSubagentTokenUsage;
861
- error?: string;
862
- finishedAt: string;
863
- }
864
- /** Explicit parent synthesis decision; absence remains truthfully "pending", never inferred. */
865
- export interface TurnSubagentDecisionNotification {
866
- turnId: string;
867
- parentTurnId: string;
868
- subagentId: string;
869
- decision: "adopted" | "partially_adopted" | "rejected";
870
- summary?: string;
871
- decidedAt: string;
872
- }
873
- /** A task lifecycle state changed. */
874
- export interface TaskUpdatedNotification {
875
- taskId: string;
876
- type: string;
877
- lifecycle: string;
878
- label?: string;
879
- }
880
- export interface SystemActivityNotification {
881
- category: "dream" | "cron" | "decay" | "system";
882
- level: "info" | "warn" | "error" | "success";
883
- title: string;
884
- detail?: string;
885
- }
886
- export interface WorkflowRecordNotification {
887
- workflow: {
888
- id: string;
889
- name: string;
890
- active: boolean;
891
- concurrency: string;
892
- rev: number;
893
- createdAt: string;
894
- updatedAt: string;
895
- trigger?: unknown;
896
- def: unknown;
897
- };
898
- }
899
- export interface WorkflowDeletedNotification {
900
- workflowId: string;
901
- }
902
- export interface WorkflowRunStartedNotification {
903
- workflowId: string;
904
- triggerType: string;
905
- }
906
- export interface WorkflowRunCompletedNotification {
907
- workflowId: string;
908
- status: "completed" | "paused" | "skipped";
909
- triggerType: string;
910
- outcome?: unknown;
911
- }
912
- export interface WorkflowRunFailedNotification {
913
- workflowId: string;
914
- triggerType?: string;
915
- error: string;
916
- outcome?: unknown;
917
- }
918
- export interface MentionDelegateStartedNotification {
919
- parentSessionId: string;
920
- parentMessageId: string;
921
- bindingId: string;
922
- executionSessionId: string;
923
- delegationId: string;
924
- sequence: number;
925
- providerId: string;
926
- revision: number;
927
- brief?: string;
928
- }
929
- export interface MentionDelegateActivityNotification {
930
- parentSessionId: string;
931
- parentMessageId: string;
932
- bindingId: string;
933
- executionSessionId: string;
934
- delegationId: string;
935
- sequence: number;
936
- providerId: string;
937
- revision: number;
938
- toolName?: string;
939
- delta?: string;
940
- }
941
- export interface MentionDelegateSettledNotification {
942
- parentSessionId: string;
943
- parentMessageId: string;
944
- bindingId: string;
945
- executionSessionId: string;
946
- delegationId: string;
947
- sequence: number;
948
- providerId: string;
949
- revision: number;
950
- status: "completed" | "failed" | "cancelled";
951
- changedFiles?: string[];
952
- finalText?: string;
953
- error?: DelegationError;
954
57
  }
955
58
  export interface NotificationMethodMap {
956
- "turn.start": TurnStartNotification;
957
59
  "turn.delta": TurnDeltaNotification;
958
60
  "turn.end": TurnEndNotification;
959
- "turn.error": TurnErrorNotification;
960
- "turn.recovery": TurnRecoveryNotification;
961
- "turn.text_rollback": TurnTextRollbackNotification;
962
- "turn.file_changes": TurnFileChangesNotification;
61
+ "turn.reasoning_delta": TurnReasoningDeltaNotification;
963
62
  "turn.tool_call": TurnToolCallNotification;
964
63
  "turn.tool_result": TurnToolResultNotification;
965
64
  "turn.tool_blocked": TurnToolBlockedNotification;
966
- "turn.reasoning_delta": TurnReasoningDeltaNotification;
967
- "turn.plan_update": TurnPlanUpdateNotification;
968
- "turn.suggestions": TurnSuggestionsNotification;
969
- "turn.memory_recall": TurnMemoryRecallNotification;
970
- "turn.memory_written": TurnMemoryWrittenNotification;
971
- "turn.sidechain_started": TurnSidechainStartedNotification;
972
- "turn.subagent_delta": TurnSubagentDeltaNotification;
973
- "turn.subagent_activity": TurnSubagentActivityNotification;
974
- "turn.sidechain_completed": TurnSidechainCompletedNotification;
975
- "turn.subagent_started": TurnSubagentStartedNotification;
976
- "turn.subagent_ended": TurnSubagentEndedNotification;
977
- "turn.subagent_completed": TurnSubagentCompletedNotification;
978
- "turn.subagent_decision": TurnSubagentDecisionNotification;
979
- "turn.annotations": TurnAnnotationsNotification;
980
65
  "turn.media_result": TurnMediaResultNotification;
981
- "turn.task_updated": TurnTaskUpdatedNotification;
982
- "turn.todos_updated": TurnTodosUpdatedNotification;
983
- "task.updated": TaskUpdatedNotification;
984
- "turn.exec_progress": TurnExecProgressNotification;
985
- "turn.progress": TurnProgressNotification;
986
- "turn.heartbeat": TurnHeartbeatNotification;
987
- "turn.tool_use_summary": TurnToolUseSummaryNotification;
988
- "turn.tool_selection_policy": TurnToolSelectionPolicyNotification;
989
- "turn.lifecycle": TurnLifecycleNotification;
990
- "turn.document_maintenance": TurnDocumentMaintenanceNotification;
991
- "turn.artifact": TurnArtifactNotification;
992
- "turn.artifact_contract": TurnArtifactContractNotification;
993
- "tool.approval.request": ToolApprovalRequestNotification;
994
- "turn.skill_acquisition_needed": TurnSkillAcquisitionNeededNotification;
995
- "turn.ask_user": TurnAskUserNotification;
996
- "memory.updated": MemoryUpdatedNotification;
997
- "instructions.updated": InstructionsUpdatedNotification;
998
- "memory.decay.completed": MemoryDecayCompletedNotification;
999
- "skills.updated": SkillsUpdatedNotification;
1000
- "session.info": SessionInfoNotification;
1001
- "session.recovery_pending": SessionRecoveryPendingNotification;
1002
- "permission.rule_updated": PermissionRuleUpdatedNotification;
1003
- "team.member.notification": TeamMemberNotification;
1004
- "thread.item": ThreadItemNotification;
1005
- "turn.usage_update": TurnUsageUpdateNotification;
1006
- "pong": PongNotification;
1007
- "solo.progress": SoloProgressNotification;
1008
- "solo.evaluation": SoloEvaluationNotification;
1009
- "solo.agentDelta": SoloAgentDeltaNotification;
1010
- "solo.agentUsage": SoloAgentUsageNotification;
1011
- "solo.agentDiff": SoloAgentDiffNotification;
1012
- "solo.state": SoloStateNotification;
1013
- "product.taskStarted": ProductTaskStartedNotification;
1014
- "product.taskCompleted": ProductTaskCompletedNotification;
1015
- "product.taskFailed": ProductTaskFailedNotification;
1016
- "product.taskHandoff": ProductTaskHandoffNotification;
1017
- "product.checkpointed": ProductCheckpointedNotification;
1018
- "product.budgetWarning": ProductBudgetWarningNotification;
1019
- "product.budgetExceeded": ProductBudgetExceededNotification;
1020
- "product.completed": ProductCompletedNotification;
1021
- "product.dagTopology": ProductDagTopologyNotification;
1022
- "product.budgetUpdate": ProductBudgetUpdateNotification;
1023
- "product.taskOutput": ProductTaskOutputDeltaNotification;
1024
- "product.members": ProductMembersNotification;
1025
- "product.agentActivity": ProductAgentActivityNotification;
1026
- "product.planReady": ProductPlanReadyNotification;
1027
- "product.planFailed": ProductPlanFailedNotification;
1028
- "product.planningDelta": ProductPlanningDeltaNotification;
1029
- "product.leaderMessage": ProductLeaderMessageNotification;
1030
- "product.planningAsk": ProductPlanningAskNotification;
1031
- "plan.interrupted": PlanInterruptedNotification;
1032
- "mention.delegate_started": MentionDelegateStartedNotification;
1033
- "mention.delegate_activity": MentionDelegateActivityNotification;
1034
- "mention.delegate_settled": MentionDelegateSettledNotification;
1035
- "project.created": ProjectCreatedNotification;
1036
- "project.switched": ProjectSwitchedNotification;
1037
- "project.detached": ProjectDetachedNotification;
1038
- "project.attached": ProjectAttachedNotification;
1039
- "project.deleted": ProjectDeletedNotification;
1040
- "project.renamed": ProjectRenamedNotification;
1041
- "project.archived": ProjectArchivedNotification;
1042
- "project.unarchived": ProjectUnarchivedNotification;
1043
- "system.activity": SystemActivityNotification;
1044
- "workflow.created": WorkflowRecordNotification;
1045
- "workflow.updated": WorkflowRecordNotification;
1046
- "workflow.deleted": WorkflowDeletedNotification;
1047
- "workflow.runStarted": WorkflowRunStartedNotification;
1048
- "workflow.runCompleted": WorkflowRunCompletedNotification;
1049
- "workflow.runFailed": WorkflowRunFailedNotification;
1050
66
  }
1051
- /** All known notification method names. */
1052
67
  export type NotificationMethod = keyof NotificationMethodMap;