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,179 +0,0 @@
1
- /**
2
- * Solo Mode Evaluator — parallel N-agent PK with user-triggered evaluation.
3
- *
4
- * Flow:
5
- * 1. solo.start → create N isolated git worktrees, spawn N agents in parallel
6
- * 2. Each agent receives the same task prompt in its own worktree
7
- * (all agents share initial config: memory/rules from project .qlogicagent/)
8
- * 3. On completion of initial task, agents enter "idle" state (process kept alive)
9
- * 4. User can send follow-up messages to individual agents via solo.message
10
- * 5. User triggers evaluation via solo.evaluate (or skips directly to solo.select)
11
- * 6. solo.select → materialize the winner's worktree changes into the workspace, clean up all
12
- * worktrees + solo/* branches
13
- *
14
- * Key design:
15
- * - Solo = special project type persisted by the Gateway RunState authority
16
- * - Agents share the same initial config but operate in isolated worktrees
17
- * - User controls the evaluation timing (not automatic)
18
- * - Follow-up instructions to individual agents supported
19
- *
20
- * Degradation: if K agents fail but ≥1 succeeds, session remains interactive.
21
- */
22
- import type { DelegateBridge } from "./delegate-bridge.js";
23
- import type { SoloState, SoloAgentState, SoloEvaluation, SoloStatus, SoloStartParams, SoloSelectParams, SoloSpec } from "../protocol/wire/acp-agent-management.js";
24
- export interface SoloCallbacks {
25
- log?: {
26
- info(msg: string): void;
27
- warn(msg: string): void;
28
- debug?(msg: string): void;
29
- };
30
- onProgress?: (soloId: string, agentId: string, state: SoloAgentState, progress: string | undefined, worktreePath: string | undefined, projectId: string) => void;
31
- onEvaluation?: (soloId: string, evaluation: SoloEvaluation, projectId: string) => void | Promise<void>;
32
- /** Streaming text delta from a competing agent (forwarded from child process). */
33
- onAgentDelta?: (soloId: string, agentId: string, text: string) => void;
34
- /** Live tool-activity heartbeat emitted from the supervised delegate event sink. */
35
- onAgentActivity?: (soloId: string, agentId: string, toolName: string) => void;
36
- /** Token usage report after agent completes. */
37
- onAgentUsage?: (soloId: string, agentId: string, inputTokens: number, outputTokens: number) => void;
38
- /** Full (capped) unified diff of a competitor's worktree once a turn settles — the same diff the
39
- * judge scores, so the user can inspect actual changes instead of only the agent's self-report. */
40
- onAgentDiff?: (soloId: string, agentId: string, diff: string) => void;
41
- /** Run-level state transition (running/evaluating/…): lets the UI narrate the auto-judge phase. */
42
- onState?: (soloId: string, state: SoloState, projectId: string) => void;
43
- /** Required Gateway delegate access; Solo fails loud when the Host rail is unavailable. */
44
- getDelegateBridge?: () => DelegateBridge | undefined;
45
- /** Ready (launchable) agent provider ids — used to prefer an INDEPENDENT judge over a competitor
46
- * scoring its own race. Best effort: absent/failing falls back to a participant judge. */
47
- listReadyAgentIds?: () => Promise<string[]>;
48
- /**
49
- * Race reached a terminal state WITHOUT an evaluation winner (all agents failed, or cancelled).
50
- * The success path uses onEvaluation; this lets the host write back the plan project's planStatus
51
- * (failed/cancelled) so 历史方案 is correct and recovery doesn't restore a dead run.
52
- */
53
- onTerminal?: (soloId: string, state: SoloState, projectId: string) => void | Promise<void>;
54
- }
55
- /**
56
- * Solo is an explicit user-launched coding race and every racer is confined to its own disposable
57
- * worktree. Permit a requested operation only for this turn; never upgrade the decision to a
58
- * persistent allow. If the agent offers no one-shot allow, fail closed with a rejection option.
59
- */
60
- export declare function selectSoloApprovalOptionId(options: Array<Record<string, unknown>>): string;
61
- /**
62
- * Assemble the prompt every competitor receives (Cut4). Shared context (rules/memory) + optional
63
- * <spec> block, then the body. Body = spec.rawTask when a Spec was built (the task captured during
64
- * specBuild), else the raw task. With neither sharedConfig nor spec the result is exactly `task`
65
- * (regression-safe vs the pre-Spec path).
66
- */
67
- export declare function buildEnrichedTask(task: string, sharedConfig: {
68
- memory?: string[];
69
- rules?: string[];
70
- model?: string;
71
- } | undefined, spec: SoloSpec | undefined): string;
72
- /**
73
- * Build the judge prompt (Cut4). When the Spec defines acceptance criteria, the judge scores
74
- * per-criterion (满足/部分/不满足) instead of a subjective compare. The WINNER:/REASONING: output
75
- * markers are unchanged so parseEvaluationResponse still works — only the basis of REASONING upgrades.
76
- */
77
- export declare function buildEvaluationPrompt(originalTask: string, spec: SoloSpec | undefined, succeeded: ReadonlyArray<{
78
- displayId: string;
79
- resultText?: string;
80
- diff?: string;
81
- }>): string;
82
- export declare class SoloEvaluator {
83
- private callbacks;
84
- private sessions;
85
- private persistenceTails;
86
- constructor(callbacks?: SoloCallbacks);
87
- private snapshotSession;
88
- private queuePersistSession;
89
- private publishNotification;
90
- /** Announce the run-level state so the UI can narrate phases (esp. the auto-judge window). */
91
- private publishState;
92
- /**
93
- * Resolve a session, lazily rehydrating from the Host RunState checkpoint after an engine
94
- * restart — without this, every restart turned live races into zombies (uncancellable,
95
- * unadoptable, undeletable, forever "运行中" in history).
96
- *
97
- * A restart killed the racer processes, so a checkpointed "running"/"pending" agent can never
98
- * settle: mark it failed to make the run actionable. Same for a mid-flight "evaluating" run —
99
- * the judge turn is gone; drop back to "running" so select/cancel/evaluate stay available.
100
- */
101
- private requireSession;
102
- /**
103
- * Start a Solo Mode PK session.
104
- * Creates worktrees, spawns agents in parallel, waits for completion, then evaluates.
105
- */
106
- start(params: SoloStartParams): Promise<string>;
107
- /**
108
- * 激活层(active Host path §1.5):gateway-routed delegate 路径 —— 竞速者回合经网关代派(x/delegate),不本地
109
- * spawn。同 handle(solo-racer/soloId/agentId/seq)⇒ supervisor 按 memberKey 复用同一竞速者进程与
110
- * ACP 会话:初赛 → follow-up → 评比全程上下文连续(取代旧「watchdog reap + 按需 re-spawn」循环,
111
- * worktree 文件仍是 durable state)。cwd=worktree;self 竞速者的 QLOGICAGENT_WORKTREE_WORKDIR /
112
- * QLOGICAGENT_SOLO_LEAN 由 gateway 按 kind=solo-racer 派生注入(AgentSpec.envOverrides,current contract
113
- * —— descriptor/env 注入在 qla 侧退场,env 是监督者按成员种类决定的启动器不变量,非调用方入参)。
114
- * usage 由 TurnResult.usage 承(不再读共享 PM 的 usage tracker)。
115
- */
116
- private runTurnViaDelegate;
117
- /**
118
- * Ensure the agent's ACP process is alive in its worktree, spawning it if absent. Used by the
119
- * initial run AND by follow-up messages: the watchdog reaps idle competitors after the race, so a
120
- * follow-up almost always arrives after the process is gone. The worktree (its files) is the durable
121
- * state, so re-spawning there lets follow-ups keep working for the whole session — not just in the
122
- * brief window before reaping. Self-agent gets the worktree-workdir + lean env (see runOne notes):
123
- * QLOGICAGENT_WORKTREE_WORKDIR anchors writes to the worktree; QLOGICAGENT_SOLO_LEAN drops media
124
- * tools so it matches the external coding CLIs and won't wander into 图像生成 on a code task.
125
- */
126
- /**
127
- * Send a follow-up message to a specific agent within a solo session.
128
- * Agent must be in "idle" or "completed" state.
129
- */
130
- message(soloId: string, agentId: string, content: string, agentIndex?: number): Promise<{
131
- resultText: string;
132
- }>;
133
- /**
134
- * User-triggered evaluation — compare all completed/idle agents' results.
135
- * The user chooses which agent in the session performs the evaluation comparison.
136
- */
137
- triggerEvaluation(soloId: string, evaluatorAgentId: string, evaluatorIndex?: number): Promise<SoloEvaluation>;
138
- /** Map a spawned member back to its solo run + UI column id (for live delta forwarding). */
139
- getMemberContext(memberId: string): {
140
- soloId: string;
141
- displayId: string;
142
- } | null;
143
- /**
144
- * Replay each in-flight agent's already-streamed turn text (reconnect/refresh resume). The status
145
- * snapshot only carries SETTLED turn text; this hands back what the current turn has produced so
146
- * far, so a refresh mid-race doesn't blank the streaming columns until the next delta.
147
- */
148
- replayLiveText(soloId: string, emit: (agentDisplayId: string, text: string) => void): Promise<void>;
149
- /** Get the current status of a solo session. */
150
- getStatus(soloId: string): SoloStatus | null;
151
- /** Cancel a running solo session. Kill all agents and clean up worktrees. */
152
- cancel(soloId: string): Promise<void>;
153
- /**
154
- * Select a winner and adopt their worktree changes into the workspace.
155
- *
156
- * Racers never commit on their `solo/*` branch, so the old `git merge --no-ff` here was a no-op
157
- * ("Already up to date") and the follow-up cleanup then deleted every uncommitted产物. Adoption
158
- * now COPIES the winner's staged/untracked changes back (same materialize path Product mode uses)
159
- * and only cleans up after the copy succeeded — a materialize failure keeps all worktrees intact.
160
- */
161
- select(params: SoloSelectParams): Promise<string>;
162
- /** Delete a solo session, killing agents and cleaning up worktrees if still active. */
163
- delete(soloId: string): Promise<void>;
164
- /**
165
- * Pick a ready agent that is NOT racing to act as an independent judge (小智优先). Returns a
166
- * synthetic member on the same supervised delegate rail: unique seq (= agents.length) keeps its
167
- * memberKey distinct, cwd = the project workspace (the judge only reads the prompt; evaluation
168
- * turns are stream-suppressed and its memberId is unknown to getMemberContext, so nothing leaks
169
- * into competitor columns). Best effort — any failure falls back to a participant judge.
170
- */
171
- private resolveExternalJudge;
172
- /**
173
- * Build an evaluation prompt and send to the user-chosen evaluator agent.
174
- * Returns evaluation result.
175
- */
176
- private evaluate;
177
- private parseEvaluationResponse;
178
- private cleanupWorktrees;
179
- }
@@ -1,47 +0,0 @@
1
- /**
2
- * Solo persistence facade over the Gateway-owned RunStateStore.
3
- */
4
- import type { SoloAgentState, SoloEvaluation, SoloSpec, SoloState } from "../protocol/wire/acp-agent-management.js";
5
- import { type HostRunStateAuthority } from "./run-state-host-authority.js";
6
- export interface PersistedSoloState {
7
- soloId: string;
8
- projectId: string;
9
- state: SoloState;
10
- task: string;
11
- cwd: string;
12
- gitRoot: string;
13
- agents: Array<{
14
- agentId: string;
15
- displayId?: string;
16
- memberId: string;
17
- /** Stable delegate handle sequence that distinguishes duplicate agent IDs. */
18
- seq: number;
19
- worktreePath: string;
20
- worktreeBranch: string;
21
- state: SoloAgentState;
22
- resultText?: string;
23
- diff?: string;
24
- usage?: {
25
- inputTokens: number;
26
- outputTokens: number;
27
- };
28
- error?: string;
29
- turns?: Array<{
30
- role: "user" | "agent";
31
- content: string;
32
- timestamp: number;
33
- }>;
34
- }>;
35
- evaluation?: SoloEvaluation;
36
- spec?: SoloSpec;
37
- createdAt: number;
38
- }
39
- export interface SoloPersistenceOptions {
40
- authority?: HostRunStateAuthority;
41
- }
42
- /** Save the latest Solo snapshot through Gateway authority. */
43
- export declare function saveSoloState(state: PersistedSoloState, options?: SoloPersistenceOptions): Promise<void>;
44
- /** Load the latest Solo snapshot from Gateway authority. */
45
- export declare function loadSoloState(soloId: string, options?: SoloPersistenceOptions): Promise<PersistedSoloState | undefined>;
46
- /** Delete a Solo run through Gateway authority. */
47
- export declare function deleteSoloState(soloId: string, options?: SoloPersistenceOptions): Promise<boolean>;
@@ -1,58 +0,0 @@
1
- /**
2
- * Solo Spec Builder — 小智(qlogicagent)主持的「一轮澄清 + 轻量 spec」过程。
3
- *
4
- * 路径选择:走 runForkedAgent(进程内推理 agent,同 team-delegate/dream),而非 solo 竞赛的
5
- * processManager.spawn(ACP 子进程)。理由:spec 阶段是交互式推理(分析→ask-user 澄清→产 spec),
6
- * 不改文件、不需 worktree,且需要 ask-user 交互 —— 这正是 runForkedAgent 的场景。
7
- *
8
- * 本模块是纯编排:askUser 后端 + ask_user 工具定义由调用方(Cut3 RPC handler)注入,
9
- * 这样模块本身不依赖全局 ask-user 回调或 toolCatalog。
10
- */
11
- import type { ForkedAgentRunnerFactory } from "../runtime/ports/agent-execution-contracts.js";
12
- import type { LLMTransport } from "../runtime/ports/index.js";
13
- import type { ToolDefinition, AgentLogger } from "../agent/types.js";
14
- import type { SoloSpec } from "../protocol/wire/acp-agent-management.js";
15
- import { type AskUserQuestion } from "../skills/tools/ask-user-tool.js";
16
- /** R3 多轮对话式 spec 的单轮入参。history 含到本轮为止的完整对话(末条为用户最新消息)。 */
17
- export interface SpecChatDeps {
18
- rawTask: string;
19
- history: {
20
- role: "user" | "assistant";
21
- content: string;
22
- }[];
23
- transport: LLMTransport;
24
- apiKey: string;
25
- model: string;
26
- createAgentRunner: ForkedAgentRunnerFactory;
27
- askUserToolDef: ToolDefinition;
28
- askUser: (questions: AskUserQuestion[], signal?: AbortSignal) => Promise<Record<string, string> | null>;
29
- log: AgentLogger;
30
- parentSignal?: AbortSignal;
31
- /** Per-phase progress for the UI. A round is a blocking RPC that otherwise streams nothing back, so
32
- * the handler relays these labels (solo.specProgress) to replace the frozen "思考中" with the real
33
- * phase (分析 → 确认 → 拟定). Best-effort: never throws into the round. */
34
- onPhase?: (phase: string) => void;
35
- /** (a) Owner global memory cheat-sheet — the spec moderator must honor standing
36
- * preferences/boundaries (language, style, hard limits) when drafting the spec. */
37
- globalMemoryIndex?: string | null;
38
- /** 上一轮已形成的规格草稿。多轮打磨必须在它的基础上增量更新——不回传会导致第二轮起模型
39
- * 凭对话重写整份规格,用户此前敲定的约束/验收被静默丢弃。 */
40
- previousSpec?: SoloSpec | null;
41
- }
42
- /** R3 多轮对话式 spec:agent 通过此工具产出/更新结构化规格(类比 plan_mode 的 plan 入参)。 */
43
- export declare const SET_SPEC_TOOL_NAME = "set_spec";
44
- export declare const SET_SPEC_TOOL_DEF: ToolDefinition;
45
- /**
46
- * R3 单轮对话式 spec(无状态:每轮带全量 history 重跑 forked agent)。受限工具 = ask_user + set_spec,
47
- * 纯推理不改文件(plan-mode 式)。返回本轮自然语言 reply + 最新 SoloSpec(set_spec 未调时回退解析文本)。
48
- * 失败(LLM/连接级)会抛 —— 由调用方降级。
49
- */
50
- export declare function runSpecChatRound(deps: SpecChatDeps): Promise<{
51
- reply: string;
52
- spec: SoloSpec;
53
- }>;
54
- /** 解析小智的标记块文本 → SoloSpec。带兜底,绝不抛(降级:goal=rawTask、acceptance 可空)。 */
55
- export declare function parseSpecResponse(text: string, rawTask: string, clarifications?: {
56
- question: string;
57
- answer: string;
58
- }[]): SoloSpec;
@@ -1,23 +0,0 @@
1
- import type { DelegateBridge } from "../delegate-bridge.js";
2
- interface LegacyTurnFixture {
3
- sendTask(memberId: string, prompt: string, options?: {
4
- timeout?: number;
5
- session?: unknown;
6
- }): Promise<unknown>;
7
- getUsageTracker?(memberId: string): {
8
- getUsage(): {
9
- inputTokens: number;
10
- outputTokens: number;
11
- };
12
- } | null;
13
- /**
14
- * Optional streamed chunks for this turn, replayed through the caller's sink before the result
15
- * resolves. The bridge used to drop the sink entirely, so no test could observe which turns stream —
16
- * which is how every acceptance verdict reached the leader conversation unnoticed.
17
- */
18
- streamDeltas?(memberId: string, prompt: string): string[];
19
- lifecycleEvents?(memberId: string, prompt: string): Array<Record<string, unknown>>;
20
- }
21
- /** Test-only adapter for migrating orchestration fixtures from the retired local spawn lane. */
22
- export declare function makeDelegateTestBridge(processManager: LegacyTurnFixture): DelegateBridge;
23
- export {};
@@ -1,7 +0,0 @@
1
- import type { HostAgentProviderState } from "../../host-contract/index.js";
2
- import type { HostAgentProviderDirectory } from "../../runtime/infra/host-agent-provider-directory.js";
3
- export interface HostProviderDirectoryFixtureOptions {
4
- states?: Readonly<Record<string, HostAgentProviderState | "not_installed">>;
5
- diagnostics?: Readonly<Record<string, string>>;
6
- }
7
- export declare function makeHostAgentProviderDirectoryFixture(options?: HostProviderDirectoryFixtureOptions): HostAgentProviderDirectory;
@@ -1,13 +0,0 @@
1
- /**
2
- * Test double helper for HostRunStateClient.
3
- *
4
- * The RunState client contract is hand-rolled into ~19 inline object literals across the orchestration
5
- * tests, each cast with `as never`. That cast means TypeScript cannot tell a double from a real client,
6
- * so adding a method to the contract breaks every one of them at RUNTIME instead of at compile time —
7
- * which is exactly what happened when `openWithCheckpoint` was introduced.
8
- *
9
- * This wrapper derives the atomic method from whatever `open`/`checkpoint` the double already provides,
10
- * so existing spies and their assertions keep working unchanged: `openWithCheckpoint` still routes
11
- * through the double's own `checkpoint` spy, preserving every "checkpoint was called with X" assertion.
12
- */
13
- export declare function runStateClientDouble<T extends Record<string, unknown>>(partial: T): never;
@@ -1,94 +0,0 @@
1
- /**
2
- * Budget + permission ExecutionGate — the engine half of plan D15 ("无人值守触发须过 budget+权限闸门")
3
- * and the M2 acceptance "触发式运行受 budget+权限闸门拦截".
4
- *
5
- * A workflow run is either ATTENDED (trigger "manual": a human is present and authorizes
6
- * interactively) or UNATTENDED (trigger "schedule" / "im-message" / "webhook": fired by the
7
- * trigger layer with nobody watching). This gate enforces two independent guarantees on every
8
- * node, before it executes:
9
- *
10
- * 1. Permission (security, HARD fail-loud) — an unattended run may only execute side-effecting
11
- * ("sensitive") node kinds that were EXPLICITLY authorized via `allowUnattendedKinds`. A
12
- * sensitive kind that was not pre-authorized throws `WorkflowPermissionDenied` and halts the
13
- * run (status "failed"). Pure / control-flow kinds (set/if/loop/merge/passthrough/trigger)
14
- * are always allowed. Manual runs skip permission entirely (the user is the authorization).
15
- * 2. Budget (resumable pause) — every node must pass the per-run budget (D15 "每轮过 budget"):
16
- * a hard cap on node executions and an optional wall-clock cap. Exceeding either throws
17
- * `WorkflowBudgetExceeded`, which extends the runtime's pause signal, so the run SUSPENDS
18
- * with its cache intact (raise the budget, then resume) rather than failing — mirroring the
19
- * existing ProductBudgetTracker "exceeded → pause" semantics.
20
- *
21
- * Pure and deterministic: no I/O, an injectable clock. fail-loud construction: a non-positive
22
- * `maxNodeExecutions` (or non-positive `maxDurationMs`) throws — a budget with no ceiling is a
23
- * silent way to disable the gate, which D15 forbids.
24
- */
25
- import { WorkflowPauseSignal, type ExecutionGate } from "./workflow-runtime.js";
26
- /** The trigger kinds that can start a run. Single source of the union (consumed by the controller). */
27
- export type WorkflowTriggerKind = "manual" | "schedule" | "im-message" | "webhook" | "intent" | "form";
28
- /**
29
- * Node kinds that reach the outside world (network calls, channel sends, Agent/Action side
30
- * effects). These require explicit authorization to run unattended. Control / data-shaping kinds
31
- * (set / if / loop / merge / passthrough / trigger) are NOT here — they cannot escape the engine.
32
- */
33
- export declare const SENSITIVE_KINDS: ReadonlySet<string>;
34
- /**
35
- * The distinct sensitive (side-effecting) kinds present among these node kinds — i.e. the
36
- * capabilities a workflow will need authorized to run unattended. Pure; drives upfront disclosure at
37
- * ACTIVATION so the user authorizes these knowingly, instead of the first unattended run hard-failing
38
- * at the gate (the old surprise: "activated fine, then the 3am schedule died at a channel send").
39
- */
40
- export declare function requiredUnattendedPermissions(nodeKinds: Iterable<string>): string[];
41
- /** Required unattended permissions NOT yet granted — exactly what activation should ask to authorize. */
42
- export declare function missingUnattendedAuthorizations(nodeKinds: Iterable<string>, granted: readonly string[] | undefined): string[];
43
- /** Hard, non-resumable denial: an unauthorized side-effecting kind under an unattended trigger. */
44
- export declare class WorkflowPermissionDenied extends Error {
45
- readonly nodeId: string;
46
- readonly kind: string;
47
- readonly trigger: WorkflowTriggerKind;
48
- constructor(nodeId: string, kind: string, trigger: WorkflowTriggerKind);
49
- }
50
- /**
51
- * Budget ceiling reached. Extends WorkflowPauseSignal so the runtime treats it as a graceful,
52
- * resumable suspension (cache retained) rather than a failure — the caller raises the budget and
53
- * resumes, and already-completed nodes hit cache.
54
- */
55
- export declare class WorkflowBudgetExceeded extends WorkflowPauseSignal {
56
- readonly reason: "executions" | "duration";
57
- readonly limit: number;
58
- constructor(atNodeId: string, reason: "executions" | "duration", limit: number);
59
- }
60
- export interface BudgetPermissionGateOptions {
61
- /** Trigger kind of THIS run. "manual" = attended (permission skipped); others = unattended. */
62
- trigger: WorkflowTriggerKind;
63
- /** Hard cap on node executions per run (D15 loop hard-cap is separate, in the scheduler). */
64
- maxNodeExecutions: number;
65
- /** Optional wall-clock cap in ms; the run pauses once elapsed reaches it. */
66
- maxDurationMs?: number;
67
- /** Sensitive kinds an UNATTENDED run is allowed to execute. Ignored for manual runs. */
68
- allowUnattendedKinds?: readonly string[];
69
- /** Injectable clock (ms epoch) for deterministic tests. */
70
- now?: () => number;
71
- }
72
- export declare class BudgetPermissionGate implements ExecutionGate {
73
- private readonly trigger;
74
- private maxNodeExecutions;
75
- private maxDurationMs?;
76
- private readonly allow;
77
- private readonly now;
78
- private executions;
79
- private startedAt;
80
- constructor(opts: BudgetPermissionGateOptions);
81
- private get unattended();
82
- /** Invoked by the runtime before each node executes. Throws to deny (hard) or pause (budget). */
83
- check(nodeId: string, kind: string): void;
84
- /**
85
- * Raise the remaining allowance so a budget-paused run can resume (D15 "抬预算后 resume").
86
- * Deltas are ADDED to the current ceilings. fail-loud: a non-positive delta is rejected, and
87
- * extending duration is only valid when a duration cap exists (extending an absent cap is a
88
- * silent no-op the caller likely did not intend).
89
- */
90
- extend(delta: {
91
- executions?: number;
92
- durationMs?: number;
93
- }): void;
94
- }
@@ -1,3 +0,0 @@
1
- import type { CapabilityEntry } from "./capability-catalog.js";
2
- /** Fresh copies prevent Host/UI consumers from mutating the shared contract. */
3
- export declare function builtinWorkflowCapabilities(): CapabilityEntry[];
@@ -1,18 +0,0 @@
1
- /**
2
- * Built-in deterministic NodeExecutors (M2).
3
- *
4
- * These are REAL node implementations (not mocks): pure data transforms used by automation
5
- * workflows. Host-backed kinds (agent/tool/http/mcp/channel) are injected separately so the
6
- * engine stays a pure executor (plan D12/D13).
7
- *
8
- * Note: "loop" is NOT here — loop control is owned by the runtime (DagScheduler.decideLoop),
9
- * not a user executor.
10
- */
11
- import type { NodeExecutor } from "./node-schema.js";
12
- /**
13
- * Params the runtime must NOT pre-resolve at node level (D34): these carry per-item
14
- * expressions ($json = each item) that the executor evaluates itself — same restricted
15
- * language, same evaluator, just per-item invocation.
16
- */
17
- export declare const RAW_PARAM_KEYS: Record<string, readonly string[]>;
18
- export declare const builtinExecutors: Record<string, NodeExecutor>;
@@ -1,72 +0,0 @@
1
- /**
2
- * Canonical Workflow capability-catalog helpers. Runtime owns and injects the exact catalog;
3
- * qlogicagent only renders and validates that snapshot for Workflow Chat.
4
- */
5
- export type CapabilityCategory = "agent" | "action" | "mcp" | "memory" | "channel" | "control";
6
- export interface CapabilityEntry {
7
- category: CapabilityCategory;
8
- kind: string;
9
- /** Concrete Agent, MCP plugin/tool, memory, channel, or control reference. */
10
- id: string;
11
- label: string;
12
- description?: string;
13
- paramsSchema?: Record<string, unknown>;
14
- paramsTemplate?: Record<string, unknown>;
15
- pluginId?: string;
16
- toolName?: string;
17
- server?: string;
18
- tool?: string;
19
- /** Machine-readable planning hints owned by Runtime, not prose invented by the Agent. */
20
- useWhen?: string[];
21
- avoidWhen?: string[];
22
- keywords?: string[];
23
- inputSchema?: Record<string, unknown>;
24
- outputSchema?: Record<string, unknown>;
25
- inputPorts?: Array<{
26
- name: string;
27
- type: string;
28
- required?: boolean;
29
- }>;
30
- outputPorts?: Array<{
31
- name: string;
32
- type: string;
33
- }>;
34
- requiredParams?: string[];
35
- sideEffectLevel?: "none" | "local" | "external";
36
- permissionHints?: string[];
37
- constraints?: string[];
38
- examples?: Array<{
39
- intent: string;
40
- params?: Record<string, unknown>;
41
- }>;
42
- }
43
- /** Render the Host-owned catalog for the AI graph builder prompt. */
44
- export declare function renderCatalogForPrompt(entries: CapabilityEntry[], perCategoryCap?: number): string;
45
- /**
46
- * Select a compact, deterministic capability working set before the Agent turn.
47
- * The full catalog remains available through list_capabilities for long-tail discovery.
48
- */
49
- export declare function selectRelevantCapabilities(entries: CapabilityEntry[], intent: string, options?: {
50
- limit?: number;
51
- preferredIds?: string[];
52
- }): CapabilityEntry[];
53
- /** Extract canonical references for anti-hallucination validation. */
54
- export declare function collectCapabilityRefs(def: {
55
- nodes: {
56
- id: string;
57
- kind: string;
58
- params?: Record<string, unknown>;
59
- }[];
60
- }): {
61
- category: CapabilityCategory;
62
- ref: string;
63
- nodeId: string;
64
- }[];
65
- /** Validate canonical references against the Host-owned catalog. */
66
- export declare function validateCapabilityRefs(def: {
67
- nodes: {
68
- id: string;
69
- kind: string;
70
- params?: Record<string, unknown>;
71
- }[];
72
- }, entries: CapabilityEntry[]): string[];
@@ -1,36 +0,0 @@
1
- /**
2
- * Deterministic cron schedule computation (plan M3 trigger layer).
3
- *
4
- * `validateCron` (trigger-validation.ts) guarantees a stored schedule is structurally valid; this
5
- * module turns a validated cron string into a concrete "next fire time" so the in-process
6
- * WorkflowScheduler can arm a timer. Pure, side-effect-free, and deterministic for an explicit
7
- * IANA timezone. Legacy callers that omit a timezone retain UTC semantics.
8
- *
9
- * Grammar matches validateCron exactly: 5-field (min hour dom month dow) or 6-field (+ leading
10
- * seconds); each field is a comma-list of star / star-step / value / range / stepped-range, with
11
- * 3-letter month and day-of-week names, and dow accepting both 0 and 7 for Sunday.
12
- */
13
- export interface ParsedCron {
14
- hasSeconds: boolean;
15
- seconds: Set<number>;
16
- minutes: Set<number>;
17
- hours: Set<number>;
18
- /** days-of-month, 1-31 */
19
- doms: Set<number>;
20
- /** months, 1-12 */
21
- months: Set<number>;
22
- /** days-of-week, 0-6 (Sunday=0; 7 is normalized to 0) */
23
- dows: Set<number>;
24
- /** true ⇔ the day-of-month field is restricted (not "*") */
25
- domRestricted: boolean;
26
- /** true ⇔ the day-of-week field is restricted (not "*") */
27
- dowRestricted: boolean;
28
- }
29
- /** Parse a validated cron string into expanded numeric sets. Throws on malformed input (fail-loud). */
30
- export declare function parseCron(cron: string): ParsedCron;
31
- /**
32
- * The next instant strictly after `afterMs` (UTC epoch ms) that matches `cron`. Throws if no match
33
- * exists within a ~5-year horizon (e.g. an impossible date like "0 0 30 2 *"). Deterministic: the
34
- * same (cron, afterMs) always returns the same value.
35
- */
36
- export declare function nextCronTime(cron: string, afterMs: number, timezone?: string): number;
@@ -1,39 +0,0 @@
1
- /**
2
- * Workflow data envelope.
3
- *
4
- * Control/data separation: DagScheduler manages control (ready/skip/loop/ports) and
5
- * never touches these values. The runtime data-routing layer carries DataItem[] along
6
- * data edges; NodeExecutors consume/produce them.
7
- *
8
- * Media travels by-ref (BinaryRef → content-addressed blob store), keeping the envelope
9
- * small and hash-cacheable.
10
- */
11
- /** A content-addressed reference to a large binary (image/video/audio), never inlined into json. */
12
- export interface BinaryRef {
13
- /** Pointer into the engine-managed blob store; content-addressed hash. */
14
- ref: string;
15
- mimeType: string;
16
- size: number;
17
- fileName?: string;
18
- meta?: Record<string, unknown>;
19
- }
20
- /** A single unit of data flowing through a port. Most nodes emit one item per port. */
21
- export interface DataItem {
22
- /** Structured data — what expressions reference. */
23
- json: Record<string, unknown>;
24
- /** Large binaries by reference; kept out of json. */
25
- binary?: Record<string, BinaryRef>;
26
- }
27
- /** Per-port payload: every port carries an array of items (supports fan-out / batching). */
28
- export type PortMap = Record<string, DataItem[]>;
29
- /** Convenience: wrap a plain object into a single-item DataItem. */
30
- export declare function item(json: Record<string, unknown>, binary?: Record<string, BinaryRef>): DataItem;
31
- /** Convenience: a single-item port map on the given port (default "default"). */
32
- export declare function singlePort(json: Record<string, unknown>, port?: string): PortMap;
33
- /**
34
- * Stable content signature of a port map, for the run-from-node cache key (§A5).
35
- * Binary participates via its content-addressed ref (not its bytes).
36
- */
37
- export declare function signaturePortMap(ports: PortMap): string;
38
- /** Deterministic JSON stringify with sorted object keys (arrays keep order). */
39
- export declare function stableStringify(value: unknown): string;