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,60 +0,0 @@
1
- /**
2
- * Restricted workflow expression evaluator used to bind node params to upstream data.
3
- *
4
- * HARD SECURITY LINE: NO arbitrary JS eval. This is a tiny recursive-descent interpreter over a
5
- * fixed grammar — property/index path access + a whitelist of pure functions only. Unattended
6
- * triggers make eval an injection surface, so arbitrary script is explicitly out of v1.
7
- *
8
- * Supported:
9
- * - context roots: $input · $json · $node("name") · $now · $vars · $trigger
10
- * - accessors: `.prop` and `[index]` / `["key"]`
11
- * - literals: string ('..' / ".."), number, true/false/null
12
- * - whitelist functions: len, upper, lower, default, jsonpath, date,
13
- * eq, ne, gt, gte, lt, lte, not, and, or, contains
14
- *
15
- * fail-loud: unknown roots/functions, reads through null/undefined, and prototype-escape keys
16
- * all throw. Absent *leaf* keys evaluate to undefined (so `default(x, fb)` works).
17
- */
18
- import type { PortMap } from "./data-item.js";
19
- export interface ExpressionContext {
20
- /** $input — this node's input ports. */
21
- input?: PortMap;
22
- /** $json — shorthand for the current item's json (typically input.default[0].json). */
23
- json?: Record<string, unknown>;
24
- /** $node("X") — completed upstream node outputs, keyed by node id/name. */
25
- nodes?: Record<string, {
26
- output: PortMap;
27
- }>;
28
- /** $now — injectable clock for determinism; defaults to real time. */
29
- now?: () => Date;
30
- /** $vars — workflow-level variables. */
31
- vars?: Record<string, unknown>;
32
- /** $trigger — trigger payload. */
33
- trigger?: Record<string, unknown>;
34
- }
35
- /**
36
- * Evaluate a single expression body (the text inside `{{ }}`, braces stripped).
37
- * Returns the raw value (object/array/number/string/boolean/null/undefined).
38
- */
39
- export declare function evaluateExpression(body: string, ctx: ExpressionContext): unknown;
40
- /**
41
- * Static syntax+semantics gate: is `body` a valid expression of THIS language (no evaluation)?
42
- * Beyond the grammar, it statically enforces what evalNode would reject at run time anyway:
43
- * known context roots, whitelist function names, and "$node(...) is the only callable".
44
- * Returns null when valid, else the error message. The n8n expression converter uses this as
45
- * its single-track output gate — anything it emits must pass here.
46
- */
47
- export declare function validateExpressionSyntax(body: string): string | null;
48
- /**
49
- * Resolve a binding template:
50
- * - exactly `{{ expr }}` (whole string) → returns the raw evaluated value (keeps type)
51
- * - text with embedded `{{ }}` → string interpolation (each sub-expression stringified;
52
- * a sub-expression resolving to null/undefined throws — fail-loud)
53
- * - no `{{ }}` → returned unchanged
54
- */
55
- export declare function resolveBinding(template: string, ctx: ExpressionContext): unknown;
56
- /**
57
- * Recursively resolve every string value in a params object against the context.
58
- * Non-string leaves are returned untouched. Arrays and nested objects are walked.
59
- */
60
- export declare function resolveParams(params: Record<string, unknown>, ctx: ExpressionContext): Record<string, unknown>;
@@ -1,15 +0,0 @@
1
- /**
2
- * Host-backed NodeExecutors (M3 bridge contract; plan D12/D13, spec §B).
3
- *
4
- * The engine is a pure executor: kinds that need real-world capabilities (agent / http / channel)
5
- * are fulfilled by an injected `ExecutorHost`. Canonical Action execution is injected by Runtime.
6
- * (or the qlogicagent CLI host) provides a real host; the engine never imports those subsystems.
7
- *
8
- * These executors are REAL (not mocks): they read the node's resolved params + inputs and delegate
9
- * to the host. fail-loud — invoking a host-backed kind with no host throws (no silent fallback).
10
- */
11
- import type { NodeExecutor } from "./node-schema.js";
12
- /** Host-backed canonical and imported node kinds. Runtime injects the canonical Action executor. */
13
- export declare const hostExecutors: Record<string, NodeExecutor>;
14
- /** Host-backed kind names (used by callers to know which kinds need a host). */
15
- export declare const HOST_BACKED_KINDS: string[];
@@ -1,48 +0,0 @@
1
- /**
2
- * n8n expression → restricted-language converter (IT-11, spec D35).
3
- *
4
- * n8n expressions are arbitrary JS inside `={{ }}`; our language is a fixed grammar
5
- * (path access + literal + whitelist functions — see expression.ts, D6 hard line: NO eval).
6
- * So conversion is a CURATED rewrite of the safe overlap, gated by our own parser:
7
- * every rewritten body must pass `validateExpressionSyntax` or the whole parameter is
8
- * flagged "manual" — we never emit anything our language can't parse, and we never
9
- * approximate semantics silently.
10
- *
11
- * Convertible subset (n8n → ours):
12
- * $json.path / $json["k"] → unchanged
13
- * $node["X"].json.y → $node("X").output.default[0].json.y
14
- * $('X').item.json.y / $('X').first().json.y → $node("X").output.default[0].json.y
15
- * $items("X")[i].json.y → $node("X").output.default[i].json.y
16
- * $input.item.json / $input.first().json → $json
17
- * $now → $now (note: n8n is Luxon, ours is Date)
18
- * Anything else ($today, $binary, $workflow, .method() calls, operators, …) → manual.
19
- */
20
- export type ExpressionConversion = {
21
- ok: true;
22
- converted: string;
23
- notes: string[];
24
- } | {
25
- ok: false;
26
- reason: string;
27
- };
28
- /**
29
- * Convert one n8n parameter STRING. n8n marks expression strings with a leading `=`;
30
- * inside, `{{ }}` segments are evaluated and the rest is literal text. Strings without
31
- * the `=` prefix are plain literals (returned unchanged, not counted as conversions).
32
- */
33
- export declare function convertN8nExpression(raw: string): ExpressionConversion | null;
34
- export interface ParamConversionStats {
35
- converted: number;
36
- manual: Array<{
37
- path: string;
38
- raw: string;
39
- reason: string;
40
- }>;
41
- notes: string[];
42
- }
43
- /**
44
- * Deep-walk a params object converting every n8n expression string in place (returns a new
45
- * object). Unconvertible expressions KEEP their raw n8n text (visible, greppable) and are
46
- * reported in `stats.manual` — explicit degradation, never silent loss.
47
- */
48
- export declare function convertN8nParams(params: Record<string, unknown>, stats: ParamConversionStats, basePath?: string): Record<string, unknown>;
@@ -1,64 +0,0 @@
1
- import type { WorkflowDef } from "./node-schema.js";
2
- import type { WorkflowTemplateSetupManifest } from "./workflow-template-setup.js";
3
- export interface N8nImportOptions {
4
- strictTemplates?: boolean;
5
- }
6
- export interface N8nNodeReport {
7
- id: string;
8
- n8nType: string;
9
- outcome: "converted" | "partial" | "manual" | "skipped" | "unsupported";
10
- notes: string[];
11
- }
12
- export interface N8nCredentialRequirement {
13
- nodeId: string;
14
- n8nCredentialType: string;
15
- label?: string;
16
- }
17
- export interface N8nBindingRequirement {
18
- models: Array<{
19
- nodeId: string;
20
- n8nCredentialType: string;
21
- modelPurpose: string;
22
- label?: string;
23
- }>;
24
- agents: Array<{
25
- nodeId: string;
26
- agentId?: string;
27
- fallback: boolean;
28
- label?: string;
29
- }>;
30
- connections: Array<{
31
- nodeId: string;
32
- n8nCredentialType: string;
33
- connectionType: string;
34
- label?: string;
35
- }>;
36
- }
37
- export interface N8nConversionReport {
38
- status: "full" | "partial" | "manual";
39
- nodes: N8nNodeReport[];
40
- expressions: {
41
- converted: number;
42
- manual: Array<{
43
- nodeId: string;
44
- path: string;
45
- raw: string;
46
- reason: string;
47
- }>;
48
- };
49
- credentials: N8nCredentialRequirement[];
50
- bindings: N8nBindingRequirement;
51
- notes: string[];
52
- }
53
- export interface N8nImportResult {
54
- name: string;
55
- def: WorkflowDef;
56
- report: N8nConversionReport;
57
- }
58
- /** Turn imported n8n credential references into one centralized Host-owned connection form. */
59
- export declare function n8nConnectionSetupManifest(report: N8nConversionReport): WorkflowTemplateSetupManifest | undefined;
60
- export declare class N8nImportError extends Error {
61
- readonly errors: string[];
62
- constructor(errors: string[]);
63
- }
64
- export declare function convertN8nWorkflow(input: string | unknown, workflowId: string, opts?: N8nImportOptions): N8nImportResult;
@@ -1,5 +0,0 @@
1
- export declare const N8N_TEMPLATE_TYPE_MAP: Record<string, string>;
2
- export declare function isModelCredentialType(type: string): boolean;
3
- export declare function isAgentKind(kind: string): boolean;
4
- export declare function modelPurposeForCredential(type: string): string;
5
- export declare function suggestConnectionType(n8nType: string, credentialType: string): string;
@@ -1,32 +0,0 @@
1
- /**
2
- * NodeExecutor registry (M2; plan §M2 "NodeExecutor 注册表").
3
- *
4
- * Single source of truth mapping node `kind` → executor. fail-loud on unknown kinds and
5
- * duplicate registration. Built-in deterministic executors (set / if / merge) register here;
6
- * host-backed executors (agent / tool / http / mcp / channel) are injected by the host so the
7
- * engine stays a pure executor (plan D12/D13).
8
- */
9
- import type { NodeExecutor } from "./node-schema.js";
10
- /**
11
- * Node kinds whose builtin executor is a Host-binding placeholder.
12
- * installHostExecutors overrides ONLY these when already present; any other
13
- * pre-registered kind is kept. Single source of the "rebindable kind" rule.
14
- */
15
- export declare const REBINDABLE_NODE_KINDS: Set<string>;
16
- export declare class NodeRegistry {
17
- private executors;
18
- constructor(includeBuiltins?: boolean);
19
- register(kind: string, executor: NodeExecutor): void;
20
- /** Replace an existing executor (e.g. host overrides a built-in). Must already exist. */
21
- override(kind: string, executor: NodeExecutor): void;
22
- /**
23
- * Wire host-backed executors — the single source of the host-wiring rule used by the
24
- * runtime, the gateway handler, and tests. Absent kinds are registered; an already-present
25
- * rebindable kind (whose builtin is a Host-binding placeholder) is
26
- * overridden; any other already-present kind is kept (caller's pre-registration wins).
27
- */
28
- installHostExecutors(executors: Record<string, NodeExecutor>): void;
29
- has(kind: string): boolean;
30
- get(kind: string): NodeExecutor;
31
- kinds(): string[];
32
- }
@@ -1,249 +0,0 @@
1
- /**
2
- * Workflow node schema + NodeExecutor contract (M2; plan D10, spec §A1/§A6).
3
- *
4
- * One declarative schema, three consumers: inline UI (M4) / execution (here) / NL generation (M5).
5
- * Control/data separation (spec §A1): the DagScheduler owns control; executors are pure data
6
- * transforms `(inputs, params, ctx) → { outputs, firedPorts }`.
7
- */
8
- import type { DataItem, PortMap } from "./data-item.js";
9
- /** Port type for connection validation (spec §A6). "any" connects to anything. */
10
- export type PortType = "any" | "string" | "number" | "boolean" | "json" | "image" | "video" | "audio" | "binary";
11
- export interface PortDef {
12
- name: string;
13
- type?: PortType;
14
- }
15
- /**
16
- * Port-type compatibility — the SINGLE truth for connection validation (R5 手动连线)。
17
- * add_edge 拿它兜底;画布的即时拒绝只是这条规则的前端镜像。
18
- * 规则:any 通配两侧;同型相通;媒体(image/video/audio)可入 binary(媒体 ⊆ 二进制,
19
- * 例如"存文件"节点收任意二进制)。其余不通。
20
- */
21
- export declare function portTypesCompatible(src: PortType | undefined, dst: PortType | undefined): boolean;
22
- /** Declarative workflow node (persisted; may carry `{{ }}` expressions in params). */
23
- export interface WorkflowNodeDef {
24
- id: string;
25
- kind: string;
26
- /** Optional human-friendly display name (rename_node patch op; spec D17 §C). */
27
- name?: string;
28
- params?: Record<string, unknown>;
29
- /** Output ports; default ["default"]. if→["true","false"], loop→["loop","done"]. */
30
- outPorts?: string[];
31
- /**
32
- * Out-port data types(端口名 → 类型;缺省 "any")。与 outPorts(名字,控制流)刻意分离:
33
- * DagScheduler 只关心端口名,类型只参与连线校验(add_edge)与画布 Handle 配色 —— 改
34
- * outPorts 为混合型会波及全部调度消费方,不值得。
35
- */
36
- outPortTypes?: Record<string, PortType>;
37
- /** Input ports (for type-checked routing); default ["default"]. */
38
- inPorts?: PortDef[];
39
- joinPolicy?: "all" | "any";
40
- maxIterations?: number;
41
- /** Retry the executor on failure: total attempts = maxTries (≥1); exponential backoff from backoffMs (default 1000). */
42
- retry?: {
43
- maxTries: number;
44
- backoffMs?: number;
45
- };
46
- /** Per-attempt deadline; the executor's signal aborts when exceeded (counts as a failure → retry applies). */
47
- timeoutMs?: number;
48
- /**
49
- * What a FINAL failure (after retries) does to the run:
50
- * "stop"(default)= run fails loud; "continue" = node marked failed, fires no ports
51
- * (downstream skips), other branches keep running; "errorPort" = a DataItem with the
52
- * error routes out the "error" port (wire an error-handler/notify subgraph to it).
53
- */
54
- onError?: "stop" | "continue" | "errorPort";
55
- /**
56
- * Canvas position pinned by a manual drag (set_node_ui patch op). Layout-only — the
57
- * engine never reads it; absent ⇒ the canvas auto-layouts the node. Travels with the
58
- * def (Bundle/export/Hub/n8n-import) so a hand-arranged graph stays arranged.
59
- */
60
- ui?: {
61
- x: number;
62
- y: number;
63
- };
64
- }
65
- /** A data edge (carries DataItem[]). fromPort/toPort default "default". */
66
- export interface DataEdge {
67
- from: string;
68
- to: string;
69
- fromPort?: string;
70
- toPort?: string;
71
- loopBack?: boolean;
72
- }
73
- export interface WorkflowDef {
74
- id: string;
75
- nodes: WorkflowNodeDef[];
76
- edges: DataEdge[];
77
- /** Workflow-level variables exposed to expressions as $vars. */
78
- vars?: Record<string, unknown>;
79
- }
80
- /**
81
- * SINGLE source of the attended/unattended split. Attended = a person is present right now:
82
- * manual (pressed 运行), intent (just SAID it, confirmed by default D22), form (just SUBMITTED
83
- * it, D34). Everything else (schedule / im-message / webhook) fires with nobody watching.
84
- * Lives here (leaf module) so both the gate and host-executors can import it cycle-free.
85
- */
86
- export declare function isUnattendedTrigger(kind: string): boolean;
87
- export interface ExecutorContext {
88
- nodeId: string;
89
- kind: string;
90
- /** Owning workflow id (def.id) — lets host-backed nodes (approval) tag outbound notifications. */
91
- workflowId?: string;
92
- /** Durable run identity used by Host-backed observability and recovery projections. */
93
- runId?: string;
94
- /** This run's trigger kind (manual/schedule/…) — drives fine-grained unattended audits (IT-7b). */
95
- triggerKind?: string;
96
- /** 0-based; increments per loop iteration (drives the cache key, spec §A5). */
97
- runIndex: number;
98
- vars: Record<string, unknown>;
99
- trigger?: Record<string, unknown>;
100
- /** Injected clock for determinism. */
101
- now: () => Date;
102
- log?: {
103
- info(m: string): void;
104
- warn(m: string): void;
105
- };
106
- /** Host capabilities for host-backed and Runtime-injected node kinds. */
107
- host?: ExecutorHost;
108
- /** Cooperative cancellation for long-running host calls. */
109
- signal?: AbortSignal;
110
- }
111
- /**
112
- * Capabilities the embedding HOST provides for node kinds the engine cannot fulfil on its own.
113
- * Production composition belongs to the xiaozhiclaw Gateway Host; qlogicagent exports the inert
114
- * executor contract and test/CLI adapters. A host-backed kind with no host fails loud.
115
- */
116
- export interface ExecutorHost {
117
- /** Run an agent turn. Returns the agent's structured output as DataItem(s). */
118
- runAgent(req: AgentHostRequest): Promise<DataItem[]>;
119
- /** Run the currently configured workflow/text model. The host resolves provider/API key/model. */
120
- runModel?(req: ModelHostRequest): Promise<DataItem[]>;
121
- /** Perform an HTTP request (credentials resolved host-side). */
122
- httpRequest(req: HttpHostRequest): Promise<DataItem[]>;
123
- /** Invoke an MCP server tool. */
124
- invokeMcp(req: McpHostRequest): Promise<DataItem[]>;
125
- /** Execute an installed n8n ecosystem node in the Host-owned compatibility worker. */
126
- runN8nNode?(req: N8nNodeHostRequest): Promise<Record<string, DataItem[]>>;
127
- /** Send a message out through a channel (飞书/微信/…) via the xiaozhiclaw channel layer. */
128
- sendChannel(req: ChannelHostRequest): Promise<DataItem[]>;
129
- /** Project-scoped memory (memdir) read/write/search for the `memory` kind (spec D25). */
130
- memory?(req: MemoryHostRequest): Promise<DataItem[]>;
131
- /** Run another workflow as a step (D34); the host enforces cycle guards. */
132
- runSubworkflow?(req: SubworkflowHostRequest): Promise<DataItem[]>;
133
- /**
134
- * Human-in-the-loop approval (D34): notify the owner and AWAIT the decision in-memory
135
- * (the run stays "running"; the node shows pending). The Runtime Host persists suspended-run
136
- * state and reconstructs the approval wait after restart.
137
- */
138
- approval?(req: ApprovalHostRequest): Promise<{
139
- approved: boolean;
140
- decidedAt: string;
141
- note?: string;
142
- }>;
143
- /**
144
- * D34 wait-until-webhook: suspend the branch until the given webhook path is called
145
- * (same posture as approval). The Runtime Host persists the checkpoint and re-registers the
146
- * webhook wait after restart.
147
- */
148
- waitWebhook?(req: WebhookWaitHostRequest): Promise<Record<string, unknown>>;
149
- }
150
- export interface AgentHostRequest {
151
- agentId: string;
152
- prompt: string;
153
- input: DataItem[];
154
- signal?: AbortSignal;
155
- }
156
- export declare function requireWorkflowAgentId(value: unknown): string;
157
- export interface ModelHostRequest {
158
- prompt: string;
159
- modelHint?: string;
160
- temperature?: number;
161
- maxTokens?: number;
162
- input: DataItem[];
163
- signal?: AbortSignal;
164
- }
165
- export interface HttpHostRequest {
166
- method: string;
167
- url: string;
168
- headers?: Record<string, string>;
169
- body?: unknown;
170
- /** Stable across retries/recovery for downstream de-duplication. */
171
- idempotencyKey?: string;
172
- signal?: AbortSignal;
173
- }
174
- export interface McpHostRequest {
175
- server: string;
176
- tool: string;
177
- args: Record<string, unknown>;
178
- signal?: AbortSignal;
179
- }
180
- export interface N8nNodeHostRequest {
181
- n8nType: string;
182
- version?: number;
183
- parameters: Record<string, unknown>;
184
- connectionIds?: Record<string, string>;
185
- input: DataItem[];
186
- idempotencyKey?: string;
187
- signal?: AbortSignal;
188
- }
189
- export interface ChannelHostRequest {
190
- channel: string;
191
- target?: string;
192
- payload: unknown;
193
- input: DataItem[];
194
- idempotencyKey?: string;
195
- signal?: AbortSignal;
196
- }
197
- export interface SubworkflowHostRequest {
198
- workflowId: string;
199
- /** The calling workflow's id — joins the cycle-guard chain so top-level runs count too. */
200
- callerWorkflowId?: string;
201
- /** Cross-project call target; absent = the calling workflow's own project root. */
202
- projectId?: string;
203
- /** Becomes the sub-run's $trigger payload (falls back to the upstream item's json). */
204
- payload?: Record<string, unknown>;
205
- input: DataItem[];
206
- signal?: AbortSignal;
207
- }
208
- export interface ApprovalHostRequest {
209
- nodeId: string;
210
- /** Owning workflow id so the approval surface can name/locate the workflow. */
211
- workflowId?: string;
212
- /** Plain-language question shown to the owner (默认 "继续执行?"). */
213
- prompt?: string;
214
- /** Deadline for a decision; default 24h. What happens at the deadline is timeoutAction (default reject). */
215
- timeoutMs?: number;
216
- /** Timeout policy (default "reject"): "reject" fails the node but ANNOUNCES it (not a silent auto-deny);
217
- * "approve" auto-continues; "keepPending" stays suspended in the current Gateway process only. */
218
- timeoutAction?: "approve" | "reject" | "keepPending";
219
- input: DataItem[];
220
- signal?: AbortSignal;
221
- }
222
- export interface WebhookWaitHostRequest {
223
- /** Webhook path to wait for (normalized with a leading "/"). */
224
- path: string;
225
- nodeId: string;
226
- workflowId?: string;
227
- /** Auto-fail deadline; default 24h (a forever-pending branch is a leak, not patience). */
228
- timeoutMs?: number;
229
- signal?: AbortSignal;
230
- }
231
- export interface MemoryHostRequest {
232
- op: "read" | "write" | "search";
233
- /** Topic-file name; absent → operate on the always-visible index. */
234
- key?: string;
235
- /** Content for `write` (falls back to the upstream item's json when omitted). */
236
- value?: unknown;
237
- /** Query for `search`. */
238
- query?: string;
239
- input: DataItem[];
240
- signal?: AbortSignal;
241
- }
242
- export interface NodeExecResult {
243
- /** outPort → DataItem[]. */
244
- outputs: PortMap;
245
- /** Control nodes (if/loop) set this; data nodes omit → all outPorts fire. */
246
- firedPorts?: string[];
247
- }
248
- /** A node executor: pure with respect to (inputs, params, ctx). NO hidden global state. */
249
- export type NodeExecutor = (inputs: PortMap, params: Record<string, unknown>, ctx: ExecutorContext) => Promise<NodeExecResult> | NodeExecResult;
@@ -1,69 +0,0 @@
1
- /**
2
- * Node params schema — single source for "what params does each node kind take" (spec R6 / D45).
3
- *
4
- * Each canonical node kind has one schema in KIND_PARAM_SCHEMAS. MCP tool argument schemas are
5
- * attached to Agent plugins or canonical Action choices by Runtime's Host-owned catalog.
6
- *
7
- * The schemas are a JSON-Schema subset aligned with the canvas SchemaArgsForm consumer
8
- * (type/enum/default/minimum/maximum/multipleOf/format/x-widget). `required` mirrors what the REAL
9
- * executors throw on (host-executors.ts / builtin-executors.ts) — not a wishlist.
10
- *
11
- * fail-loud posture: `validateParamsAgainstSchema` flags missing-required / wrong-enum / wrong-type
12
- * so the AI generation gate (AI-2) can reject and self-correct. Two deliberate exemptions:
13
- * - a value that is a `{{ }}` template is skipped for type checks (resolved at runtime).
14
- * - an `__ASK__: 问题` sentinel (brace-less ON PURPOSE so it bypasses the {{ }} expression gate in
15
- * validateDefExpressions) counts as "present but pending" (the agent honestly marking an unknown,
16
- * not a hallucination) — surfaced by collectClarifications for the pending-field badge and
17
- * execution-readiness validation.
18
- */
19
- import type { CapabilityEntry } from "./capability-catalog.js";
20
- /** Per-kind params schemas. `trigger` (workflow-level trigger def) and
21
- * `manual` (n8n import placeholder that always fails) are intentionally excluded. */
22
- export declare const KIND_PARAM_SCHEMAS: Record<string, Record<string, unknown>>;
23
- /** An `__ASK__: 问题` sentinel — the agent honestly marking an unknown required value (AI-2).
24
- * Brace-less by design so it doesn't enter the {{ }} restricted-expression gate. */
25
- export declare function isAskPlaceholder(v: unknown): boolean;
26
- type NodeLike = {
27
- id: string;
28
- kind: string;
29
- params?: Record<string, unknown>;
30
- };
31
- /**
32
- * Resolve the schema governing a canonical node's params.
33
- */
34
- export declare function resolveNodeParamsSchema(node: NodeLike, entries: CapabilityEntry[]): Record<string, unknown> | undefined;
35
- /**
36
- * Validate every node's params against its resolved schema. Returns human-readable Chinese errors
37
- * (empty = clean). Skips `trigger` (trigger def is validated elsewhere) and `manual` (placeholder).
38
- * Unknown kinds with no schema are skipped here (validateCapabilityRefs / validateGraph cover refs).
39
- */
40
- export declare function validateParamsAgainstSchema(def: {
41
- nodes: NodeLike[];
42
- }, entries: CapabilityEntry[]): string[];
43
- /**
44
- * Collect every brace-less `__ASK__` placeholder in a def (top-level params + one level into
45
- * `args`). Drives the canvas pending-field badge and execution-readiness validation. Empty =
46
- * nothing pending.
47
- */
48
- export declare function collectAskPlaceholders(def: {
49
- nodes: NodeLike[];
50
- }): {
51
- nodeId: string;
52
- field: string;
53
- }[];
54
- /**
55
- * Like collectAskPlaceholders but carries the question text — drives the workflow.chat `clarify`
56
- * bubble (AI-2). Empty = nothing to ask.
57
- */
58
- export declare function collectClarifications(def: {
59
- nodes: NodeLike[];
60
- }): {
61
- nodeId: string;
62
- field: string;
63
- question: string;
64
- }[];
65
- /**
66
- * Compact per-kind params hint for the AI graph-builder prompt, derived from KIND_PARAM_SCHEMAS.
67
- */
68
- export declare function renderKindParamsForPrompt(): string;
69
- export {};
@@ -1,63 +0,0 @@
1
- /**
2
- * QlogicagentExecutorHost backing canonical host executors and Runtime-injected Action nodes
3
- * with qlogicagent's actual capabilities. No mocks, no stubs (plan §1.5).
4
- *
5
- * Boundary capabilities (runAgent / invokeMcp / sendChannel) are injected so this file stays
6
- * decoupled from the Gateway Host. Missing capabilities and downstream rejections fail loudly.
7
- */
8
- import type { LLMTransport } from "../../runtime/ports/index.js";
9
- import { type DataItem } from "./data-item.js";
10
- import type { ExecutorHost, N8nNodeHostRequest, MemoryHostRequest, SubworkflowHostRequest, ApprovalHostRequest, WebhookWaitHostRequest } from "./node-schema.js";
11
- /** Injected boundary capabilities — supplied by the handler host that owns the real runners. */
12
- export interface QlaExecutorHostDeps {
13
- /** Run one agent turn (spawn external ACP agent + sendTask). Returns the agent's text output. */
14
- runAgent: (req: {
15
- agentId: string;
16
- prompt: string;
17
- signal?: AbortSignal;
18
- }) => Promise<string>;
19
- /** Resolve the owner's configured Settings -> Model text model. */
20
- resolveClientForPurpose?: (purpose: "textGeneration") => {
21
- transport: LLMTransport;
22
- apiKey: string;
23
- model: string;
24
- } | null;
25
- /** Invoke an MCP server tool through the real MCP bridge. */
26
- invokeMcp: (req: {
27
- server: string;
28
- tool: string;
29
- args: Record<string, unknown>;
30
- signal?: AbortSignal;
31
- }) => Promise<unknown>;
32
- /** Execute an installed n8n ecosystem node through the embedding Host. */
33
- runN8nNode?: (req: N8nNodeHostRequest) => Promise<Record<string, DataItem[]>>;
34
- /**
35
- * Send a message out through a channel via the xiaozhiclaw channel layer.
36
- * Undefined in standalone qlogicagent (no gateway) → channel nodes fail-loud (D12/D13).
37
- */
38
- sendChannel?: (req: {
39
- channel: string;
40
- target?: string;
41
- payload: unknown;
42
- idempotencyKey?: string;
43
- signal?: AbortSignal;
44
- }) => Promise<unknown>;
45
- /**
46
- * Project-scoped memory backend for the `memory` kind (spec D25). The handler host wires
47
- * the owning project root's memdir; absent → memory nodes fail-loud.
48
- */
49
- memory?: (req: MemoryHostRequest) => Promise<DataItem[]>;
50
- /** Run another workflow as a step (D34); the handler enforces cycle guards. */
51
- runSubworkflow?: (req: SubworkflowHostRequest) => Promise<DataItem[]>;
52
- /** Human-in-the-loop approval (D34): notify + await the owner's decision. */
53
- approval?: (req: ApprovalHostRequest) => Promise<{
54
- approved: boolean;
55
- decidedAt: string;
56
- note?: string;
57
- }>;
58
- /** D34 wait-until-webhook: suspend until the path is hit (handler owns the wake registry). */
59
- waitWebhook?: (req: WebhookWaitHostRequest) => Promise<Record<string, unknown>>;
60
- /** fetch impl; defaults to global fetch. Injectable for tests. */
61
- fetchImpl?: typeof fetch;
62
- }
63
- export declare function createQlaExecutorHost(deps: QlaExecutorHostDeps): ExecutorHost;
@@ -1,53 +0,0 @@
1
- /**
2
- * Run Checkpoint Store — durable crash-restart recovery for in-flight workflow runs (plan §M3).
3
- *
4
- * The runtime's output cache is content-addressed (key = hash(kind + params + input signature +
5
- * runIndex), spec §A5). Persisting that cache to disk turns run-from-node into crash recovery:
6
- * after a qlogicagent restart, a FRESH WorkflowRuntime replays the same DAG, recomputes the same
7
- * cache keys, and hits the persisted entries for every node that already completed — so those
8
- * executors are NOT re-invoked (no duplicate agent turns / channel sends), and only the
9
- * not-yet-run remainder executes. This is exactly the M3 acceptance:
10
- * "qlogicagent 崩溃重启从 checkpoint 恢复在跑工作流".
11
- *
12
- * Stored at `<project>/.qlogicagent/workflows/<workflowId>/runs/<runId>/cache.json`.
13
- * NodeExecResult is JSON (PortMap of DataItems + firedPorts), so the snapshot round-trips losslessly.
14
- *
15
- * fail-loud: a corrupt/unreadable snapshot is treated as absent (a fresh run), never silently
16
- * partially applied.
17
- */
18
- import type { NodeExecResult } from "./node-schema.js";
19
- /** One persisted cache entry: a content key and the executor result it produced. */
20
- export interface CheckpointEntry {
21
- key: string;
22
- result: NodeExecResult;
23
- }
24
- /** A point-in-time snapshot of a run's content-addressed output cache. */
25
- export interface CheckpointSnapshot {
26
- workflowId: string;
27
- runId: string;
28
- entries: CheckpointEntry[];
29
- updatedAt: string;
30
- }
31
- /**
32
- * Durable run state the runtime loads on (re)start and persists after each computed node.
33
- * Implementations may be file-backed (production) or in-memory (tests).
34
- */
35
- export interface RunCheckpoint {
36
- /** Load the prior snapshot, or undefined for a never-started / absent run. */
37
- load(): Promise<CheckpointSnapshot | undefined>;
38
- /** Persist the full set of computed cache entries (idempotent overwrite). */
39
- persist(entries: CheckpointEntry[]): Promise<void>;
40
- /** Remove the snapshot once the run has completed successfully. */
41
- clear(): Promise<void>;
42
- }
43
- /** File-backed checkpoint under `.qlogicagent/workflows/<id>/runs/<runId>/cache.json`. */
44
- export declare class FileRunCheckpoint implements RunCheckpoint {
45
- private readonly workflowId;
46
- private readonly runId;
47
- private readonly dir;
48
- private readonly file;
49
- constructor(cwd: string, workflowId: string, runId: string);
50
- load(): Promise<CheckpointSnapshot | undefined>;
51
- persist(entries: CheckpointEntry[]): Promise<void>;
52
- clear(): Promise<void>;
53
- }