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,500 +0,0 @@
1
- /**
2
- * Agent RPC Method Map — complete typed contract for ALL agent JSON-RPC methods.
3
- *
4
- * This extends GatewayRpcMethodMap (26 methods Gateway directly calls) with all
5
- * additional agent-specific methods (thread, memory, agents, solo, product, etc.).
6
- *
7
- * Consumers use this for fully typed RPC clients:
8
- * import type { AgentRpcMethodMap } from "qlogicagent/protocol";
9
- * async function call<M extends keyof AgentRpcMethodMap>(method: M, params: AgentRpcMethodMap[M]["params"]): Promise<AgentRpcMethodMap[M]["result"]> { ... }
10
- */
11
- import type { ChatMessage, LocalizedToolText, ToolCapabilityCategory } from "./chat-types.js";
12
- import type { GatewayRpcMethodMap } from "./gateway-rpc.js";
13
- import type { WireTokenUsage } from "./notification-payloads.js";
14
- export type SoloState = "running" | "evaluating" | "completed" | "cancelled" | "failed";
15
- export type SoloAgentState = "pending" | "running" | "completed" | "failed" | "idle";
16
- export interface SoloAgentResult {
17
- id: string;
18
- state: SoloAgentState;
19
- progress?: string;
20
- resultText?: string;
21
- diff?: string;
22
- usage?: {
23
- inputTokens: number;
24
- outputTokens: number;
25
- };
26
- error?: string;
27
- worktreePath?: string;
28
- }
29
- export interface SoloStatus {
30
- soloId: string;
31
- projectId: string;
32
- state: SoloState;
33
- agents: SoloAgentResult[];
34
- evaluation?: {
35
- winnerId: string;
36
- reasoning: string;
37
- adopted?: boolean;
38
- judgedBy?: string;
39
- degraded?: boolean;
40
- };
41
- /** Original task text — history reopen must show what the race was about. */
42
- task?: string;
43
- /** Clarified Spec (goal/constraints/acceptance) when the race was started from one. */
44
- spec?: {
45
- goal: string;
46
- constraints: string[];
47
- acceptance: string[];
48
- rawTask?: string;
49
- };
50
- /** Epoch ms the race started. */
51
- createdAt?: number;
52
- }
53
- export type ProductPhase = "active" | "paused" | "completed" | "failed";
54
- export type ProductTaskStatus = "pending" | "running" | "completed" | "failed" | "paused" | "skipped";
55
- export interface ProductInstanceDef {
56
- name: string;
57
- role: string;
58
- agentId: string;
59
- }
60
- export interface ProductTaskDef {
61
- taskId: string;
62
- assignee: string;
63
- prompt: string;
64
- dependsOn?: string[];
65
- /** Leader-authored "done" criteria: files to produce / how to self-check / terminal PASS.
66
- * Appended to the task prompt so the evidence gate (assertProductTaskCompletionEvidence) sees it. */
67
- acceptanceCriteria?: string;
68
- }
69
- export interface ProductStatus {
70
- productId: string;
71
- projectId: string;
72
- name: string;
73
- phase: ProductPhase;
74
- instances: Array<{
75
- instanceId: string;
76
- name: string;
77
- agentId: string;
78
- state: string;
79
- worktreePath?: string;
80
- usage?: {
81
- inputTokens: number;
82
- outputTokens: number;
83
- };
84
- }>;
85
- tasks: Array<{
86
- taskId: string;
87
- assignee: string;
88
- status: ProductTaskStatus;
89
- result?: string;
90
- error?: string;
91
- startedAt?: string;
92
- completedAt?: string;
93
- inputTokens?: number;
94
- outputTokens?: number;
95
- changedFiles?: string[];
96
- }>;
97
- budget: {
98
- maxTotalTokens?: number;
99
- maxDuration?: number;
100
- usedTokens: number;
101
- elapsed: number;
102
- };
103
- lastCheckpointAt: string;
104
- }
105
- export interface ProductSummary {
106
- productId: string;
107
- name: string;
108
- phase: ProductPhase;
109
- instanceCount: number;
110
- taskCount: number;
111
- completedTasks: number;
112
- createdAt: string;
113
- lastCheckpointAt: string;
114
- }
115
- /**
116
- * All agent RPC methods — superset of GatewayRpcMethodMap.
117
- *
118
- * Methods from GatewayRpcMethodMap (session.*, project.*, files.*, instructions.*)
119
- * are inherited. This adds the agent-specific protocol methods.
120
- */
121
- export interface AgentRpcMethodMap extends GatewayRpcMethodMap {
122
- "initialize": {
123
- params: {
124
- protocolVersion: string;
125
- host?: {
126
- name: string;
127
- version: string;
128
- };
129
- hostName?: string;
130
- hostVersion?: string;
131
- capabilities?: {
132
- streaming?: boolean;
133
- toolApproval?: boolean;
134
- threads?: boolean;
135
- };
136
- config?: Record<string, unknown>;
137
- };
138
- result: {
139
- protocolVersion: string;
140
- agent: {
141
- name: string;
142
- version: string;
143
- };
144
- capabilities: {
145
- tools: string[];
146
- streaming: boolean;
147
- threads: boolean;
148
- notifications: string[];
149
- methods: string[];
150
- };
151
- };
152
- };
153
- "thread.create": {
154
- params: {
155
- id?: string;
156
- title?: string;
157
- cwd?: string;
158
- config?: Record<string, unknown>;
159
- };
160
- result: {
161
- id: string;
162
- title?: string;
163
- status: "active";
164
- createdAt: string;
165
- };
166
- };
167
- "thread.list": {
168
- params: {
169
- limit?: number;
170
- };
171
- result: {
172
- threads: Array<{
173
- id: string;
174
- title?: string;
175
- status: "active" | "archived";
176
- turnCount?: number;
177
- createdAt: string;
178
- lastActiveAt: string;
179
- }>;
180
- };
181
- };
182
- "session.resume": {
183
- params: {
184
- sessionId: string;
185
- };
186
- result: {
187
- metadata: {
188
- sessionId: string;
189
- projectId: string;
190
- createdAt: string;
191
- lastActiveAt: string;
192
- model?: string;
193
- cwd?: string;
194
- turnCount: number;
195
- messageCount: number;
196
- title?: string;
197
- totalInputTokens?: number;
198
- totalOutputTokens?: number;
199
- };
200
- messages: ChatMessage[];
201
- };
202
- };
203
- "session.getInfo": {
204
- params: {
205
- sessionId?: string;
206
- };
207
- result: {
208
- sessionId: string;
209
- paths: {
210
- sessionDir: string;
211
- transcript: string;
212
- state: string;
213
- agentHome: string;
214
- settings: string;
215
- cwd: string;
216
- };
217
- model?: string;
218
- provider?: string;
219
- turnCount: number;
220
- title?: string;
221
- usage?: {
222
- totalPromptTokens: number;
223
- totalCompletionTokens: number;
224
- totalCost?: number;
225
- };
226
- };
227
- };
228
- "memory.list": {
229
- params: {
230
- source?: "local" | "store" | "qmemory" | "all";
231
- };
232
- result: {
233
- entries: Array<{
234
- source: "local" | "store" | "qmemory";
235
- target?: string;
236
- path?: string;
237
- content?: string;
238
- lines?: number;
239
- }>;
240
- };
241
- };
242
- "memory.read": {
243
- params: {
244
- source?: string;
245
- target?: string;
246
- path?: string;
247
- };
248
- result: {
249
- content: string;
250
- source: string;
251
- path?: string;
252
- };
253
- };
254
- "memory.write": {
255
- params: {
256
- source?: string;
257
- target?: string;
258
- path?: string;
259
- content: string;
260
- mode?: "overwrite" | "append";
261
- };
262
- result: {
263
- ok: boolean;
264
- path?: string;
265
- };
266
- };
267
- "memory.delete": {
268
- params: {
269
- source?: string;
270
- target?: string;
271
- path?: string;
272
- };
273
- result: {
274
- ok: boolean;
275
- deleted?: number;
276
- };
277
- };
278
- "memory.dream": {
279
- params: {
280
- scope?: "session" | "project" | "all";
281
- };
282
- result: {
283
- ok: boolean;
284
- consolidated: number;
285
- archived: number;
286
- durationMs: number;
287
- };
288
- };
289
- "tools.list": {
290
- params: {
291
- category?: ToolCapabilityCategory;
292
- };
293
- result: {
294
- tools: Array<{
295
- id: string;
296
- name: string;
297
- category: ToolCapabilityCategory;
298
- displayName: LocalizedToolText;
299
- displayDescription: LocalizedToolText;
300
- fallbackName: string;
301
- fallbackDescription: string;
302
- description: string;
303
- source: "builtin";
304
- parameters?: Record<string, unknown>;
305
- }>;
306
- total: number;
307
- };
308
- };
309
- "todos.list": {
310
- params: {
311
- sessionId?: string;
312
- };
313
- result: {
314
- items: Array<{
315
- id: number;
316
- title: string;
317
- status: string;
318
- owner?: string;
319
- blockedBy?: number[];
320
- }>;
321
- summary: string;
322
- };
323
- };
324
- "tasks.list": {
325
- params: {
326
- status?: string;
327
- };
328
- result: {
329
- tasks: Array<{
330
- id: string;
331
- type: string;
332
- status: string;
333
- progress?: number;
334
- createdAt: string;
335
- }>;
336
- };
337
- };
338
- "tasks.cancel": {
339
- params: {
340
- taskId: string;
341
- };
342
- result: {
343
- ok: boolean;
344
- };
345
- };
346
- "agent.ping": {
347
- params: undefined;
348
- result: {
349
- status: "idle" | "busy";
350
- uptime: number;
351
- version: string;
352
- usage?: WireTokenUsage;
353
- };
354
- };
355
- "thread.user_response": {
356
- params: {
357
- requestId: string;
358
- declined?: boolean;
359
- answers?: Record<string, string>;
360
- };
361
- result: {
362
- received: boolean;
363
- };
364
- };
365
- "session.resolve": {
366
- params: {
367
- platform?: string;
368
- chatId?: string;
369
- chatType?: string;
370
- userId?: string;
371
- groupName?: string;
372
- projectId?: string;
373
- title?: string;
374
- };
375
- result: {
376
- sessionId: string;
377
- title?: string;
378
- type: string;
379
- agentId?: string;
380
- ownerPlatform?: string;
381
- ownerId?: string;
382
- groupKey?: string;
383
- groupPlatform?: string;
384
- groupName?: string;
385
- projectId?: string;
386
- };
387
- };
388
- "session.focus": {
389
- params: {
390
- sessionId: string;
391
- projectName?: string;
392
- };
393
- result: {
394
- ok: false;
395
- } | {
396
- ok: true;
397
- projectId: string;
398
- };
399
- };
400
- "memory.atlas": GatewayRpcMethodMap["memory.atlas"];
401
- "memory.activity": GatewayRpcMethodMap["memory.activity"];
402
- "memory.propose": GatewayRpcMethodMap["memory.propose"];
403
- "memory.consolidate": GatewayRpcMethodMap["memory.consolidate"];
404
- "memory.update": GatewayRpcMethodMap["memory.update"];
405
- "memory.attachment.adopt": GatewayRpcMethodMap["memory.attachment.adopt"];
406
- "memory.attachment.locate": GatewayRpcMethodMap["memory.attachment.locate"];
407
- "community.resolveInstall": {
408
- params: {
409
- resourceId: string;
410
- version?: string;
411
- explicitInstallConsent: true;
412
- explicitHighRiskConsent?: true;
413
- };
414
- result: {
415
- ok: boolean;
416
- install: Record<string, unknown>;
417
- };
418
- };
419
- "community.listResourceVersions": {
420
- params: {
421
- resourceId: string;
422
- };
423
- result: {
424
- ok: true;
425
- versions: unknown;
426
- };
427
- };
428
- "community.installResource": {
429
- params: {
430
- resourceId: string;
431
- version?: string;
432
- explicitInstallConsent: true;
433
- allowReplace?: boolean;
434
- replacementPolicy?: "managed-unmodified" | "user-confirmed";
435
- };
436
- result: {
437
- ok: boolean;
438
- installed?: Record<string, unknown>;
439
- preview?: Record<string, unknown>;
440
- };
441
- };
442
- "community.runtimeStatus": {
443
- params: {
444
- ids: string[];
445
- };
446
- result: {
447
- ok: boolean;
448
- items: Array<Record<string, unknown>>;
449
- };
450
- };
451
- "community.installRuntime": {
452
- params: {
453
- id: string;
454
- };
455
- result: {
456
- ok: boolean;
457
- id: string;
458
- version?: string;
459
- binPath?: string;
460
- };
461
- };
462
- "agent.health": GatewayRpcMethodMap["agent.health"];
463
- "agent.metrics": GatewayRpcMethodMap["agent.metrics"];
464
- "agent.cancel": GatewayRpcMethodMap["agent.cancel"];
465
- "session.moveToProject": GatewayRpcMethodMap["session.moveToProject"];
466
- "instructions.list": GatewayRpcMethodMap["instructions.list"];
467
- "instructions.read": GatewayRpcMethodMap["instructions.read"];
468
- "instructions.write": GatewayRpcMethodMap["instructions.write"];
469
- "instructions.delete": GatewayRpcMethodMap["instructions.delete"];
470
- "plans.list": {
471
- params: {
472
- projectId?: string;
473
- };
474
- result: {
475
- plans: Array<{
476
- slug: string;
477
- name: string;
478
- title: string;
479
- status?: string;
480
- path: string;
481
- size: number;
482
- }>;
483
- };
484
- };
485
- "skills.promote": {
486
- params: {
487
- name: string;
488
- };
489
- result: {
490
- ok: true;
491
- promoted: string;
492
- scope: "global";
493
- globalPath: string;
494
- };
495
- };
496
- "skills.curator": {
497
- params: undefined;
498
- result: Record<string, unknown>;
499
- };
500
- }
@@ -1,100 +0,0 @@
1
- /**
2
- * Protocol version. Both sides exchange this during `agent.hello`
3
- * handshake. If major versions differ the host MUST reject.
4
- */
5
- export declare const AGENT_RPC_PROTOCOL_VERSION: "1.0.0";
6
- export declare const AGENT_RPC_ERROR_CODES: {
7
- readonly PARSE_ERROR: -32700;
8
- readonly INVALID_REQUEST: -32600;
9
- readonly METHOD_NOT_FOUND: -32601;
10
- readonly INVALID_PARAMS: -32602;
11
- readonly INTERNAL_ERROR: -32603;
12
- readonly TURN_ABORTED: -32000;
13
- readonly TURN_TIMEOUT: -32001;
14
- readonly LLM_ERROR: -32010;
15
- readonly LLM_AUTH_ERROR: -32011;
16
- readonly LLM_RATE_LIMIT: -32012;
17
- readonly LLM_QUOTA_EXHAUSTED: -32013;
18
- readonly LLM_MODEL_NOT_FOUND: -32014;
19
- readonly TOOL_INVOKE_FAILED: -32020;
20
- readonly TOOL_TIMEOUT: -32021;
21
- readonly PROTOCOL_MISMATCH: -32030;
22
- readonly REQUEST_DEADLINE_EXCEEDED: -32040;
23
- readonly REQUEST_CANCELLED: -32041;
24
- readonly REQUEST_DEDUPED: -32042;
25
- readonly REQUEST_IDEMPOTENCY_REQUIRED: -32043;
26
- };
27
- export type AgentRpcErrorCode = (typeof AGENT_RPC_ERROR_CODES)[keyof typeof AGENT_RPC_ERROR_CODES];
28
- export interface AgentRpcRequest {
29
- jsonrpc: "2.0";
30
- method: string;
31
- params?: Record<string, unknown>;
32
- id?: string | number;
33
- meta?: AgentRpcMeta;
34
- }
35
- export type AgentRpcChannel = "query" | "task";
36
- export interface AgentRpcMeta {
37
- requestId: string;
38
- deadlineAt: number;
39
- createdAt: number;
40
- channel: AgentRpcChannel;
41
- idempotencyKey?: string;
42
- traceId?: string;
43
- }
44
- export interface AgentRpcError {
45
- code: AgentRpcErrorCode | number;
46
- message: string;
47
- data?: unknown;
48
- }
49
- export interface AgentRpcResponse {
50
- jsonrpc: "2.0";
51
- id: string | number;
52
- result?: unknown;
53
- error?: AgentRpcError;
54
- }
55
- export interface AgentRpcNotification {
56
- jsonrpc: "2.0";
57
- method: string;
58
- params: Record<string, unknown>;
59
- }
60
- export type AgentRpcMessage = AgentRpcRequest | AgentRpcResponse | AgentRpcNotification;
61
- /** Sent by host to agent CLI as params of `agent.hello` request. */
62
- export interface AgentHelloParams {
63
- protocolVersion: string;
64
- hostName: string;
65
- hostVersion: string;
66
- capabilities?: string[];
67
- }
68
- /** Returned by agent CLI as result of `agent.hello` request. */
69
- export interface AgentHelloResult {
70
- protocolVersion: string;
71
- agentName: string;
72
- agentVersion: string;
73
- capabilities?: string[];
74
- }
75
- /**
76
- * Agent → Host notification: agent requests human approval before executing a tool.
77
- * Method name: `tool.approval.request`
78
- */
79
- export interface ToolApprovalRequestParams {
80
- /** Unique id for this approval request (used to correlate the response). */
81
- approvalId: string;
82
- /** Tool call id from the LLM. */
83
- callId: string;
84
- /** Tool name. */
85
- toolName: string;
86
- /** Serialized arguments JSON. */
87
- arguments: string;
88
- /** Human-readable reason for requiring approval. */
89
- message?: string;
90
- /** Suggested allow/ask/deny policy updates the user can apply with the decision. */
91
- suggestions?: string[];
92
- }
93
- /** Well-known method names for the approval protocol. */
94
- export declare const AGENT_RPC_APPROVAL_METHODS: {
95
- readonly REQUEST: "tool.approval.request";
96
- };
97
- export declare function isAgentRpcRequest(msg: unknown): msg is AgentRpcRequest;
98
- export declare function isAgentRpcResponse(msg: unknown): msg is AgentRpcResponse;
99
- export declare function isAgentRpcNotification(msg: unknown): msg is AgentRpcNotification;
100
- export declare function parseAgentRpcMessage(raw: string): AgentRpcMessage | null;
@@ -1,61 +0,0 @@
1
- import { type AgentRpcError, type AgentRpcMeta, type AgentRpcRequest, type AgentRpcChannel } from "./agent-rpc.js";
2
- export type GatewayRpcMutability = "read" | "write";
3
- export interface GatewayRpcClassification {
4
- channel: AgentRpcChannel;
5
- mutability: GatewayRpcMutability;
6
- defaultTimeoutMs: number;
7
- }
8
- export interface GatewayRpcMetrics {
9
- activeRequests: number;
10
- completedRequests: number;
11
- cancelledRequests: number;
12
- deadlineExceededRequests: number;
13
- dedupedRequests: number;
14
- lateResponsesDropped: number;
15
- invalidRequests: number;
16
- }
17
- export declare function classifyGatewayRpcMethod(method: string): GatewayRpcClassification;
18
- export declare function requiresIdempotencyKey(method: string): boolean;
19
- export declare function buildAgentRpcMeta(method: string, options?: {
20
- now?: number;
21
- timeoutMs?: number;
22
- requestId?: string;
23
- idempotencyKey?: string;
24
- traceId?: string;
25
- channel?: AgentRpcChannel;
26
- }): AgentRpcMeta;
27
- export declare function requireGatewayRpcMeta(request: Pick<AgentRpcRequest, "method" | "meta">, now?: number): {
28
- ok: true;
29
- meta: AgentRpcMeta;
30
- } | {
31
- ok: false;
32
- error: AgentRpcError;
33
- };
34
- export declare class GatewayRpcContract {
35
- private readonly now;
36
- private readonly active;
37
- private readonly idempotency;
38
- private readonly counters;
39
- constructor(options?: {
40
- now?: () => number;
41
- });
42
- begin(method: string, meta: AgentRpcMeta): {
43
- status: "started";
44
- } | {
45
- status: "deduped";
46
- result?: unknown;
47
- error?: AgentRpcError;
48
- } | {
49
- status: "rejected";
50
- error: AgentRpcError;
51
- };
52
- cancel(requestId: string, reason?: string): boolean;
53
- expire(requestId: string): boolean;
54
- settle(requestId: string, result?: unknown, error?: AgentRpcError): {
55
- accepted: true;
56
- } | {
57
- accepted: false;
58
- reason: "unknown" | "cancelled" | "deadline_exceeded";
59
- };
60
- metrics(): GatewayRpcMetrics;
61
- }