qlogicagent 2.23.14 → 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 +2 -6
  11. package/dist/types/agent/types.d.ts +9 -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 +4 -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 +8 -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 +8 -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,18 +1,16 @@
1
1
  import type { Agent } from "../agent/agent.js";
2
2
  import type { ToolInvoker } from "../agent/types.js";
3
3
  import type { HookRegistry } from "../contracts/hooks.js";
4
- import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
5
4
  import type { AcpPermissionRequestParams } from "../protocol/wire/index.js";
6
- import type { MemoryPrefetchState } from "../runtime/hooks/memory-hooks.js";
7
5
  import type { BackgroundTaskManager } from "../runtime/infra/background-tasks.js";
8
6
  import type { TaskStore } from "../runtime/infra/task-runtime.js";
9
- import type { MemoryDreamRuntimeProvider, MemoryHandlerProvider, PermissionMetadataResolver, PermissionRuleEnginePort, PathService, ProjectMemoryStore, ToolCatalog } from "../runtime/ports/index.js";
7
+ import type { PermissionMetadataResolver, PermissionRuleEnginePort, PathService, ToolCatalog } from "../runtime/ports/index.js";
10
8
  import type { McpManager } from "../skills/mcp/mcp-manager.js";
11
9
  import type { PluginLoader } from "../skills/plugins/plugin-loader.js";
12
10
  import type { CliCoreToolHostDeps } from "./core-tool-coordinator.js";
13
11
  import { type CliAgentClient } from "./cli-agent-builder.js";
14
12
  import type { ResolvedTextGenerationConfig } from "./model-client-resolver.js";
15
- import type { LLMTransport, ProviderRegistry } from "./provider-core-facade.js";
13
+ import type { ProviderRegistry } from "./provider-core-facade.js";
16
14
  import type { MediaPersistence } from "../runtime/infra/media-persistence.js";
17
15
  import type { FileWatcher } from "./agent-runtime-bootstrap.js";
18
16
  import type { SandboxPermissionSnapshot } from "./tool-bootstrap.js";
@@ -29,18 +27,6 @@ export interface StdioAgentSessionBootstrapDeps {
29
27
  projectRoot: string;
30
28
  pathService: PathService;
31
29
  getActiveWorkdir?: () => string;
32
- memdir: ProjectMemoryStore;
33
- getMemdir?: () => ProjectMemoryStore | null;
34
- currentUserId: string;
35
- memoryPrefetchState: MemoryPrefetchState;
36
- getLastUserMessage(): string | undefined;
37
- getLastAssistantMessage(): string | undefined;
38
- resolveSmallModelClient(): {
39
- transport: LLMTransport;
40
- apiKey: string;
41
- model: string;
42
- } | null;
43
- scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
44
30
  providerRegistry: ProviderRegistry;
45
31
  mediaPersistence: MediaPersistence;
46
32
  toolCatalog: ToolCatalog;
@@ -52,9 +38,6 @@ export interface StdioAgentSessionBootstrapDeps {
52
38
  } | undefined;
53
39
  applyBootstrap(sessionId: string, result: {
54
40
  hooks: HookRegistry;
55
- memoryHandlerProvider: MemoryHandlerProvider | null;
56
- memoryDreamProvider: MemoryDreamRuntimeProvider | null;
57
- memoryUserId: string;
58
41
  permissionChecker: PermissionMetadataResolver;
59
42
  permissionUnregister: () => void;
60
43
  ruleEngine: PermissionRuleEnginePort;
@@ -71,13 +54,10 @@ export interface StdioAgentSessionBootstrapDeps {
71
54
  resolveSandboxPermissionSnapshot?(): SandboxPermissionSnapshot | undefined;
72
55
  getAcpPermissionSession(): {
73
56
  sessionId: string;
74
- requestPermission(params: AcpPermissionRequestParams): Promise<{
75
- optionId?: string;
76
- }>;
57
+ requestPermission(params: AcpPermissionRequestParams): Promise<import("../protocol/wire/index.js").AcpPermissionRequestResult>;
77
58
  } | undefined;
78
59
  coreToolHost: CliCoreToolHostDeps;
79
60
  log(message: string): void;
80
- sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
81
61
  }
82
62
  export interface StdioAgentSessionBootstrapResult {
83
63
  agent: Agent;
@@ -1,7 +1,4 @@
1
- import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
2
- import type { MemoryHostRequestAccess } from "./memory-coordinator.js";
3
1
  import { type StdioRuntimeServices } from "./stdio-runtime-services.js";
4
- import type { HostProfileClient } from "../transport/host-profile-client.js";
5
2
  export interface StdioRuntimeBootstrapDeps {
6
3
  verbose: boolean;
7
4
  getActiveProjectRoot(): string;
@@ -9,10 +6,5 @@ export interface StdioRuntimeBootstrapDeps {
9
6
  getCurrentTurnId?(): string | undefined;
10
7
  isGroupSecurityMode?(): boolean;
11
8
  log(message: string): void;
12
- sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
13
- /** B3(X7):host-state 接入面(AcpServer;lazy——gate 在 provider 创建时刻现读)。 */
14
- resolveMemoryHostRequestAccess?(): MemoryHostRequestAccess | null;
15
- /** Lazy session-bound host profile facade; unavailable/non-ACP must fail loud at first web invoke. */
16
- resolveHostProfileClient?(): HostProfileClient | undefined;
17
9
  }
18
10
  export declare function bootstrapStdioRuntimeServices(deps: StdioRuntimeBootstrapDeps): StdioRuntimeServices;
@@ -1,14 +1,8 @@
1
- import type { MemoryDreamRuntimeProvider, MemoryHandlerProvider, PathService, ToolBootstrap, ToolCatalog } from "../runtime/ports/index.js";
1
+ import type { PathService, ToolBootstrap, ToolCatalog } from "../runtime/ports/index.js";
2
2
  import { MediaPersistence } from "../runtime/infra/media-persistence.js";
3
3
  import { ProviderRegistry } from "./provider-core-facade.js";
4
- import { type MemoryHostRequestAccess, type MemoryProviderState } from "./memory-coordinator.js";
5
4
  export interface StdioRuntimeServicesDeps {
6
5
  getActiveProjectRoot(): string;
7
- /**
8
- * B3(X7)host-state 接入面(AcpServer;initialize 前/非 ACP 宿主 = null)。
9
- * memory provider 工厂据此在创建时刻按 memory service 一次性选型 HostMemoryProvider。
10
- */
11
- resolveMemoryHostRequestAccess?(): MemoryHostRequestAccess | null;
12
6
  }
13
7
  export interface StdioRuntimeServices {
14
8
  providerRegistry: ProviderRegistry;
@@ -16,10 +10,5 @@ export interface StdioRuntimeServices {
16
10
  pathService: PathService;
17
11
  toolCatalog: ToolCatalog;
18
12
  toolBootstrap: ToolBootstrap;
19
- ensureMemoryProvider(currentUserId: string): MemoryProviderState;
20
- closeMemoryProviders(state: {
21
- memoryProvider: MemoryHandlerProvider | null;
22
- memoryDreamProvider: MemoryDreamRuntimeProvider | null;
23
- }): void;
24
13
  }
25
- export declare function createStdioRuntimeServices(deps: StdioRuntimeServicesDeps): StdioRuntimeServices;
14
+ export declare function createStdioRuntimeServices(_deps: StdioRuntimeServicesDeps): StdioRuntimeServices;
@@ -8,28 +8,16 @@
8
8
  * Protocol: each message is a single JSON-RPC 2.0 object.
9
9
  * The physical I/O layer is abstracted via the Transport interface.
10
10
  */
11
- import { TaskDistillationCoordinator } from "./task-distillation-coordinator.js";
12
11
  import type { Transport } from "./transport.js";
13
12
  import type { Agent } from "../agent/agent.js";
14
13
  import type { TurnConfig } from "../agent/types.js";
15
14
  import type { LLMTransport } from "./provider-core-facade.js";
16
- import { type MemoryPrefetchState } from "../runtime/hooks/memory-hooks.js";
17
15
  import { SessionState } from "../runtime/session/session-state.js";
18
16
  import { TaskStore } from "../runtime/infra/task-runtime.js";
19
17
  import { BackgroundTaskManager } from "../runtime/infra/background-tasks.js";
20
- import { type AgentRpcError } from "../protocol/wire/index.js";
21
18
  import type { AcpServer } from "../transport/acp-server.js";
22
19
  import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
23
- import { type MultiAgentHandlerHost } from "./multi-agent-handler-host.js";
24
- import { SessionHistoryCoordinator } from "./session-history-coordinator.js";
25
- import type { MemoryDreamRuntimeProvider, MemoryHandlerProvider, PermissionMode, ProjectMemoryStore } from "../runtime/ports/index.js";
26
- import { HostProfileClient } from "../transport/host-profile-client.js";
27
- import { HostCapabilityClient } from "../transport/host-capability-client.js";
28
- import { HostSessionClient } from "../transport/host-session-client.js";
29
- import { HostProjectClient } from "../transport/host-project-client.js";
30
- import { HostFeedbackClient } from "../transport/host-feedback-client.js";
31
- import { HostCommunityClient } from "../transport/host-community-client.js";
32
- import { HostCloudAuthClient } from "../transport/host-cloud-auth-client.js";
20
+ import type { PermissionMode } from "../runtime/ports/index.js";
33
21
  export interface StdioServerConfig {
34
22
  verbose: boolean;
35
23
  transport?: Transport;
@@ -38,10 +26,7 @@ export declare class StdioServer {
38
26
  running: boolean;
39
27
  readonly startedAt: number;
40
28
  readonly packageVersion: string;
41
- /** JSON-RPC request lifecycle: gateway contract, in-flight ledger, deadlines. */
42
- private rpc;
43
- /** Gateway contract — exposed for control-handler metrics/cancel. */
44
- get rpcContract(): import("../protocol/wire/gateway-contract.js").GatewayRpcContract;
29
+ /** Active ACP turn lifecycle for cancellation and orderly shutdown. */
45
30
  private connectionActiveTurn;
46
31
  /** Resolves when the active turn fully completes (including post-abort flush). */
47
32
  private connectionTurnDone;
@@ -66,35 +51,13 @@ export declare class StdioServer {
66
51
  backgroundTasks: BackgroundTaskManager;
67
52
  /** Settled-task notifications isolated by their launching session. */
68
53
  private readonly pendingTaskNotificationsBySession;
69
- /** Session-scoped memory prefetch state (LRU dedup + byte limit). */
70
- private connectionMemoryPrefetchState;
71
- /** Last user message text for auto-extract hook (set at turn start, cleared at turn end).
72
- * Public: the turn pipeline writes it through the ACP host adapter. */
73
- private connectionLastUserMessageForAutoExtract;
74
- /** Last assistant message text for implicit extraction hook (set at turn end).
75
- * Public: the turn pipeline writes it through the ACP host adapter. */
76
- private connectionLastAssistantMessageForExtract;
77
- private connectionPendingTurnGuidance;
54
+ private readonly connectionLoadedDeferredToolNames;
78
55
  private connectionRequestGeneration;
79
56
  /** Foreground reservations begin before async routing, closing the idle-timer race. */
80
57
  private foregroundTurnCount;
81
- private readonly memoryBackground;
82
- /** MEMDIR file-based memory (CC memdir parity). */
83
- private connectionMemdir;
84
- readonly projectMemoryStoreFactory: import("../runtime/ports/project-memory-store.js").ProjectMemoryStoreFactory;
85
- /** Memory write gate state (P2+P3: category gate + supersedes). */
86
- /** Pending ask_user requests waiting for host response */
87
- pendingAskUser: Map<string, {
88
- resolve: (answers: Record<string, string> | null) => void;
89
- }>;
90
58
  /** Agents/solo/product handler facade. */
91
- readonly multiAgentHandlerHost: MultiAgentHandlerHost;
92
59
  /** ACP protocol coordinator — owns AcpServer lifecycle and ACP event mapping. */
93
60
  private readonly acp;
94
- sessionHistory: SessionHistoryCoordinator;
95
- private idleDreamCoordinator;
96
- private readonly sessionRuntime;
97
- private modelRegistryHydration;
98
61
  private get registry();
99
62
  get mediaPersistence(): import("../runtime/infra/media-persistence.js").MediaPersistence;
100
63
  private get pathService();
@@ -103,7 +66,7 @@ export declare class StdioServer {
103
66
  get mcpReady(): Promise<void>;
104
67
  private get activeResolvedAgent();
105
68
  private get agent();
106
- /** Cached LLM transport for sub-agent forks (dream). */
69
+ /** Cached LLM transport for sub-agent forks. */
107
70
  get currentTransport(): LLMTransport | null;
108
71
  get currentApiKey(): string;
109
72
  get currentModel(): string;
@@ -131,14 +94,6 @@ export declare class StdioServer {
131
94
  isTurnRequestCurrent(generation: number): boolean;
132
95
  get sessionState(): SessionState | null;
133
96
  set sessionState(v: SessionState | null);
134
- get memoryPrefetchState(): MemoryPrefetchState;
135
- set memoryPrefetchState(v: MemoryPrefetchState);
136
- get memdir(): ProjectMemoryStore | null;
137
- set memdir(v: ProjectMemoryStore | null);
138
- get lastUserMessageForAutoExtract(): string | undefined;
139
- set lastUserMessageForAutoExtract(v: string | undefined);
140
- get lastAssistantMessageForExtract(): string | undefined;
141
- set lastAssistantMessageForExtract(v: string | undefined);
142
97
  /**
143
98
  * The active ACP permission session for the current turn, or undefined when no host is connected.
144
99
  */
@@ -146,38 +101,13 @@ export declare class StdioServer {
146
101
  sessionId: string;
147
102
  requestPermission: AcpServer["requestPermission"];
148
103
  } | undefined;
149
- /** The coordinator-owned host-request client is available only for an active ACP session. */
150
- getHostRequestClient(): import("../transport/host-request-client.js").HostRequestClient | undefined;
151
- /** Thin facade over the coordinator-owned HostRequestClient; owns no second pending table. */
152
- getHostProfileClient(): HostProfileClient | undefined;
153
- /** Thin read-only facade; consumers fail loudly when the host did not advertise capability. */
154
- getHostCapabilityClient(): HostCapabilityClient | undefined;
155
- getHostCommunityClient(): HostCommunityClient | undefined;
156
- getHostCloudAuthClient(): HostCloudAuthClient | undefined;
157
- getHostAgentProviderDirectory(): import("../runtime/infra/host-agent-provider-directory.js").HostAgentProviderDirectory;
158
- /** Session durable-state facade; absent under gate-off/standalone so compatibility stays inert. */
159
- getHostSessionClient(): HostSessionClient | undefined;
160
- /** D2 telemetry/feedback business facade; durable storage remains gateway-only. */
161
- getHostFeedbackClient(): HostFeedbackClient | undefined;
162
- getHostProjectClient(): HostProjectClient | undefined;
163
- initializeHostProjectAuthority(): Promise<void>;
164
- /**
165
- * Mid-turn guidance queue (运行中引导). Reset per turn by runTurnPipeline, pushed by
166
- * handleTurnGuide (via the turn host proxy), drained each round by the tool loop.
167
- * Declared as a real field so the proxy in createTurnHost has a shared backing store
168
- * (turn pipeline and handleTurnGuide must see the SAME array).
169
- */
170
- get pendingTurnGuidance(): string[];
171
- set pendingTurnGuidance(v: string[]);
104
+ get loadedDeferredToolNames(): Set<string>;
172
105
  /** LH-10: an explicit cancel of a session stops the background tasks that
173
106
  * session launched — the forked agent + the exec processes it spawned —
174
107
  * instead of leaving them running as zombies. Keyed by session id, which is
175
108
  * shared across the client/agent boundary (turn ids are not). */
176
109
  cancelBackgroundTasksForSession(sessionId?: string, parentTurnId?: string): void;
177
110
  get sessionLlmConfigBySession(): Map<string, import("./acp-session-host.js").SessionLlmConfig>;
178
- get materializedSessionProfiles(): Map<string, import("./acp-session-host.js").MaterializedSessionProfile>;
179
- get acpSessionMeta(): Record<string, unknown> | null;
180
- set acpSessionMeta(v: Record<string, unknown> | null);
181
111
  get acpSessionMetaBySession(): Map<string, Record<string, unknown>>;
182
112
  get currentHooks(): import("../contracts/hooks.js").HookRegistry | null;
183
113
  get permissionChecker(): import("../runtime/ports/permission-contracts.js").PermissionMetadataResolver | null;
@@ -191,16 +121,10 @@ export declare class StdioServer {
191
121
  mode: PermissionMode;
192
122
  }): void;
193
123
  private set mcpManager(value);
194
- get memoryProvider(): MemoryHandlerProvider | null;
195
- set memoryProvider(value: MemoryHandlerProvider | null);
196
- get memoryDreamProvider(): MemoryDreamRuntimeProvider | null;
197
- set memoryDreamProvider(value: MemoryDreamRuntimeProvider | null);
198
- get memoryUserId(): string;
199
- set memoryUserId(value: string);
200
124
  constructor(config: StdioServerConfig);
201
125
  /**
202
126
  * Get the active project workspace directory.
203
- * Reads from projectStore (single source of truth).
127
+ * Reads from the current ACP session's in-process project projection.
204
128
  */
205
129
  getActiveProjectRoot(): string;
206
130
  /**
@@ -209,26 +133,14 @@ export declare class StdioServer {
209
133
  * into the model's context as <task_notification> blocks.
210
134
  */
211
135
  drainPendingTaskNotifications(sessionId: string): string[];
212
- ensureModelRegistryHydrated(): Promise<void>;
213
136
  /**
214
137
  * Single entry point for updating the active workdir.
215
138
  * Centralizes all side-effects (bootstrap workdir, media persistence, etc.).
216
- * Uses projectStore as the source of truth no private field cache.
139
+ * Updates the current ACP session's in-process project projection.
217
140
  */
218
141
  setActiveWorkdir(dir: string): void;
219
142
  start(): void;
220
143
  stop(): Promise<void>;
221
- private readonly methodHandlers;
222
- /** Live registry method names — the single source of truth for the initialize capability
223
- * declaration, so it never drifts from what's actually registered (replaces the
224
- * previous hand-maintained method list, which had fallen ~100 methods behind). */
225
- getRegisteredMethods(): string[];
226
- private handleMessage;
227
- /**
228
- * Ensure a default project exists on first start.
229
- * Called from both legacy handleInitialize and ACP acpHandleInitialize.
230
- */
231
- ensureDefaultProject(): Promise<void>;
232
144
  /**
233
145
  * Atomically resolve transport + model + apiKey for a given ModelPurpose.
234
146
  * If the resolved provider matches `this.currentProvider`, reuses cached transport.
@@ -240,54 +152,22 @@ export declare class StdioServer {
240
152
  apiKey: string;
241
153
  model: string;
242
154
  } | null;
243
- /**
244
- * Ensure the L2 SQLite memory provider exists for read-only RPCs
245
- * (memory.atlas / memory.activity). These can be called before any turn has
246
- * run, so they cannot rely on resolveAgent() having initialized the provider.
247
- * Opening the DB is cheap and side-effect-free (list() does not embed).
248
- */
249
- ensureMemoryProvider(): void;
250
- private _taskDistillation;
251
- get taskDistillation(): TaskDistillationCoordinator;
252
- ensureTaskDistillation(): TaskDistillationCoordinator;
253
155
  resolveAgent(config: TurnConfig, routedProjectRoot?: string): Agent | null;
254
156
  private invalidateResolvedLlmCache;
255
- createDreamHandlerHost(): import("./handlers/dream-handler.js").DreamHandlerHost;
256
- private createAcpExtendedHandlerHost;
257
- /**
258
- * Lazily resolve the AcpServer delegate because the server is initialized during handshake.
259
- * Orchestration callers fail loud when the Host does not advertise delegate support.
260
- */
261
- private buildDelegateBridge;
262
157
  /**
263
158
  * Handle an MCP tool call proxied from an external ACP agent via the
264
159
  * named-pipe bridge. Dispatches the tool through the host's own tool
265
160
  * system and returns the text result.
266
161
  */
267
162
  private handleMcpToolCall;
268
- sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
269
- /**
270
- * Send a JSON-RPC error response by (code, message, data) — convenience over
271
- * sendResponse for handlers that build the error inline (e.g. session.moveToProject
272
- * error paths call `this.sendError`).
273
- */
274
- sendError(id: string | number, code: AgentRpcError["code"], message: string, data?: unknown): void;
275
163
  sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
276
- private writeStdout;
277
164
  log(message: string): void;
278
- /**
279
- * Enable idle dream scheduling. Called after session setup when LLM config is available.
280
- */
281
- enableIdleDream(minutes?: number): void;
282
165
  beginForegroundTurn(): void;
283
166
  endForegroundTurn(): void;
284
- scheduleBackgroundMemoryWork(label: string, work: (signal: AbortSignal) => Promise<void>): Promise<boolean>;
285
- cancelIdleDreamTimer(): void;
286
- disposeSessionRuntime(): void;
287
167
  disposeSessionPermissions(sessionId: string): void;
288
168
  disposeSessionMcp(sessionId: string): Promise<void>;
289
169
  /**
290
- * Initialize the ACP server alongside the legacy protocol.
170
+ * Initialize the ACP server as the process's only protocol surface.
291
171
  * Called once when the host is an ACP-compliant client.
292
172
  */
293
173
  initAcpServer(): void;
@@ -36,7 +36,7 @@ export declare function setAskUserCallback(callback: ((questions: AskUserQuestio
36
36
  export declare function setBootstrapWorkdir(newWorkdir: string): void;
37
37
  export interface BootstrapConfig {
38
38
  workdir?: string;
39
- toolCatalog?: ToolCatalog;
39
+ toolCatalog: ToolCatalog;
40
40
  pathService?: PathService;
41
41
  mediaPersistence?: MediaPersistence;
42
42
  log?: AgentLogger;
@@ -49,11 +49,7 @@ export interface BootstrapConfig {
49
49
  loadTunableOverrides?(): Promise<Record<string, unknown>>;
50
50
  }
51
51
  /**
52
- * Create all locally-executable tools and install into centralized tool pool.
53
- *
54
- * CC parity: getAllBaseTools() returns flat array, installed via setToolPool().
55
- * Tools execute IN-PROCESS (zero IPC).
56
- *
57
- * @alias initToolDeps -kept for backward compat with existing call sites.
52
+ * Create all locally executable tools and install them into the Runtime catalog.
53
+ * Tools execute in-process.
58
54
  */
59
- export declare function getAllBaseTools(config?: BootstrapConfig): PortableTool[];
55
+ export declare function getAllBaseTools(config: BootstrapConfig): PortableTool[];
@@ -1,4 +1,4 @@
1
1
  import type { ToolBootstrap, ToolCatalog } from "../runtime/ports/index.js";
2
- import { type ToolRegistry } from "./tool-registry-adapter.js";
2
+ import { ToolRegistry } from "./tool-registry-adapter.js";
3
3
  export declare function createCliToolCatalog(registry?: ToolRegistry): ToolCatalog;
4
- export declare function createCliToolBootstrap(toolCatalog?: ToolCatalog): ToolBootstrap;
4
+ export declare function createCliToolBootstrap(toolCatalog: ToolCatalog): ToolBootstrap;
@@ -1,5 +1,4 @@
1
1
  import type { ToolInvoker } from "../agent/types.js";
2
- import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
3
2
  import type { MediaPersistence } from "../runtime/infra/media-persistence.js";
4
3
  import type { ToolCatalog } from "../runtime/ports/index.js";
5
4
  export interface LocalToolInvokerDeps {
@@ -7,6 +6,5 @@ export interface LocalToolInvokerDeps {
7
6
  toolCatalog: ToolCatalog;
8
7
  getSessionId(): string;
9
8
  log(message: string): void;
10
- sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
11
9
  }
12
10
  export declare function createLocalToolInvoker(deps: LocalToolInvokerDeps): ToolInvoker;
@@ -1,12 +1,8 @@
1
1
  import { ToolRegistry } from "../skills/tools.js";
2
2
  import type { ToolCatalog } from "../runtime/ports/index.js";
3
- export type { ToolRegistry };
4
- export declare function createToolCatalogFromRegistry(registry?: ToolRegistry): ToolCatalog;
3
+ export { ToolRegistry };
4
+ export declare function createToolCatalogFromRegistry(registry: ToolRegistry): ToolCatalog;
5
5
  /**
6
- * Creates an empty catalog behind the legacy registry adapter boundary.
7
- *
8
- * Runtime/session owners must not depend on the legacy registry implementation merely to obtain
9
- * isolated storage. Keeping construction here makes ToolCatalog the only contract visible above
10
- * this adapter and leaves the registry removable in a later cleanup.
6
+ * Creates an empty registry-backed catalog for one isolated session overlay.
11
7
  */
12
8
  export declare function createIsolatedToolCatalog(): ToolCatalog;
@@ -8,7 +8,6 @@ export interface ToolResultProcessorDeps {
8
8
  result: PortableToolResult;
9
9
  mediaPersistence: MediaPersistence;
10
10
  log(message: string): void;
11
- sendNotification(method: string, params: unknown): void;
12
11
  }
13
12
  export declare function processToolResult(deps: ToolResultProcessorDeps): Promise<ToolInvokeResult>;
14
13
  export {};
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Shared turn-execution core for the turn pipeline (`runTurnPipeline` -> `executeTurnCore`).
3
- * Owns the `agent.run()` event loop: side-event forwarding (`forwardTurnSideEvent`), the
4
- * `turn.start`/`turn.end`/`turn.error` notification skeleton, and content/usage collection.
5
- * Path-specific behaviour (transcript persistence, usage tracking, literal-response
3
+ * Owns the `agent.run()` event loop, standard ACP side-event forwarding, terminal content,
4
+ * and usage collection.
5
+ * Path-specific behaviour (usage tracking, literal-response
6
6
  * transforms, skill auto-persist) is supplied via optional hooks.
7
7
  */
8
8
  import type { ChatMessage, TokenUsage, ToolDefinition, TurnConfig, TurnEvent } from "../agent/types.js";
@@ -15,6 +15,8 @@ export interface TurnCoreRequest {
15
15
  availableTools?: ToolDefinition[];
16
16
  /** Exact capability names whose full schemas are loaded only after Agent selection. */
17
17
  deferredToolNames?: string[];
18
+ /** Session-owned names already loaded by Agent selection on an earlier turn. */
19
+ loadedDeferredToolNames?: Set<string>;
18
20
  tools: ToolDefinition[];
19
21
  /** Live tool-manifest rebuild for same-turn activation (forwarded to the loop). */
20
22
  refreshTools?: () => ToolDefinition[];
@@ -24,8 +26,6 @@ export interface TurnCoreRequest {
24
26
  drainPendingTaskNotifications?: () => string[];
25
27
  /** Sanitize tool-result media the main model can't consume — forwarded to the tool loop. */
26
28
  sanitizeToolResultMedia?: (message: Record<string, unknown>) => Promise<void>;
27
- /** Persist each model-visible tool-stream message to the transcript — forwarded to the tool loop. */
28
- persistTurnMessage?: (message: ChatMessage) => void;
29
29
  systemPrompt: string;
30
30
  config: TurnConfig;
31
31
  /** Epoch/identity guard supplied by the session lifecycle owner. */
@@ -37,11 +37,11 @@ export interface TurnCoreAgent {
37
37
  export interface TurnCoreHooks {
38
38
  /** Invoked for every side event handled by `forwardTurnSideEvent` (e.g. tool-call accounting). */
39
39
  onSideEvent?: (event: TurnEvent) => void;
40
- /** Extra work after `turn.end` is emitted (usage tracking, `turn.usage_update`, transcript persistence). */
40
+ /** Extra work after terminal content is committed. */
41
41
  onEnd?: (event: Extract<TurnEvent, {
42
42
  type: "end";
43
43
  }>, finalContent: string) => void;
44
- /** Extra work after `turn.error` is emitted (e.g. usage tracking on the error path). */
44
+ /** Extra work after a terminal Agent error. */
45
45
  onError?: (event: Extract<TurnEvent, {
46
46
  type: "error";
47
47
  }>) => void;
@@ -60,8 +60,6 @@ export interface TurnCoreResult {
60
60
  provider?: string;
61
61
  }
62
62
  /**
63
- * Drive a single agent turn to completion, emitting the shared notification stream.
64
- * The caller is responsible for emitting `turn.start` (for the early-lifecycle
65
- * contract) before invoking this, and for all pre/post-turn pipeline work.
63
+ * Drive a single agent turn to completion and emit only standard ACP updates.
66
64
  */
67
65
  export declare function executeTurnCore(host: TurnEventForwardHost, agent: TurnCoreAgent, request: TurnCoreRequest, signal: AbortSignal, hooks?: TurnCoreHooks): Promise<TurnCoreResult>;
@@ -1,10 +1,13 @@
1
1
  import type { TurnEvent } from "../agent/types.js";
2
+ import type { NotificationMethod, NotificationMethodMap } from "../protocol/notifications.js";
2
3
  export interface TurnEventForwardHost {
3
- sendNotification(method: string, params: unknown): void;
4
+ sendNotification<M extends NotificationMethod>(method: M, params: NotificationMethodMap[M]): void;
4
5
  }
6
+ /**
7
+ * Forward only internal events that have a standard ACP session/update representation.
8
+ * Adapter-only lifecycle, recovery, planning, and telemetry events remain internal.
9
+ */
5
10
  export declare function forwardTurnSideEvent(params: {
6
11
  event: TurnEvent;
7
- turnId: string;
8
- now: string;
9
12
  host: TurnEventForwardHost;
10
13
  }): boolean;
@@ -1,5 +1,4 @@
1
1
  import type { HookRegistry } from "../contracts/hooks.js";
2
- import { type MemoryPrefetchState } from "../runtime/hooks/memory-hooks.js";
3
2
  import { SessionState } from "../runtime/session/session-state.js";
4
3
  export interface TurnLifecycleHost {
5
4
  activeTurn: AbortController | null;
@@ -7,8 +6,6 @@ export interface TurnLifecycleHost {
7
6
  currentSessionId: string;
8
7
  currentHooks: HookRegistry | null;
9
8
  sessionState: SessionState | null;
10
- memoryPrefetchState: MemoryPrefetchState;
11
- enableIdleDream(): void;
12
9
  log?(message: string): void;
13
10
  }
14
11
  export interface PreparedTurnLifecycle {
@@ -2,17 +2,10 @@ export interface TurnProjectRoutingHost {
2
2
  getActiveProjectRoot(): string;
3
3
  setActiveWorkdir(workdir: string): void;
4
4
  log(message: string): void;
5
- sendNotification(method: string, params: Record<string, unknown>): void;
6
- }
7
- export interface StaleProjectHintContext {
8
- activeProjectName?: string;
9
- projectNames: string[];
10
5
  }
11
6
  export interface TurnProjectRoutingResult {
12
7
  sessionProjectRoot: string;
13
8
  sessionProjectId?: string;
14
- projectHintStale: boolean;
15
- staleProjectHintContext?: StaleProjectHintContext;
16
9
  /**
17
10
  * Set when the turn's config CARRIES a projectId that could not be resolved to a registered
18
11
  * project. The caller must treat this as fatal for the turn (reject it) — silently falling back
@@ -7,7 +7,7 @@
7
7
  /**
8
8
  * All supported hook points in the Agent Runtime lifecycle.
9
9
  */
10
- export type HookPoint = "session.created" | "session.ended" | "turn.submitted" | "turn.before_inference" | "turn.after_inference" | "turn.completed" | "turn.failed" | "tool.before_invoke" | "tool.after_invoke" | "tool.invoke_failed" | "approval.requested" | "approval.responded" | "permission.denied" | "context.before_compact" | "context.after_compact" | "memory.before_recall" | "memory.after_recall" | "subagent.started" | "subagent.stopped" | "stop" | "stop.failed" | "stop.failure" | "task.created" | "task.completed" | "file.changed" | "cwd.changed" | "config.changed" | "instructions.loaded";
10
+ export type HookPoint = "session.created" | "session.ended" | "turn.submitted" | "turn.before_inference" | "turn.after_inference" | "turn.completed" | "turn.failed" | "tool.before_invoke" | "tool.after_invoke" | "tool.invoke_failed" | "approval.requested" | "approval.responded" | "permission.denied" | "context.before_compact" | "context.after_compact" | "subagent.started" | "subagent.stopped" | "stop" | "stop.failed" | "stop.failure" | "task.created" | "task.completed" | "file.changed" | "cwd.changed" | "config.changed" | "instructions.loaded";
11
11
  export interface HookSessionContext {
12
12
  sessionId: string;
13
13
  gatewayId?: string;
@@ -111,25 +111,6 @@ export interface HookContextMap {
111
111
  tokenCount?: number;
112
112
  removedCount?: number;
113
113
  };
114
- "memory.before_recall": HookTurnContext & {
115
- query?: string;
116
- recalledMemories?: Array<{
117
- text: string;
118
- id?: string;
119
- score?: number;
120
- category?: string | null;
121
- source?: string;
122
- label?: string;
123
- metadata?: Record<string, unknown>;
124
- }>;
125
- };
126
- "memory.after_recall": HookTurnContext & {
127
- blockCount?: number;
128
- recalledSummaries?: string[];
129
- injectedCount?: number;
130
- droppedCount?: number;
131
- injectedMemoryIds?: string[];
132
- };
133
114
  "subagent.started": HookSubagentContext;
134
115
  "subagent.stopped": HookSubagentContext;
135
116
  "stop": HookStopContext;
@@ -1,4 +1,23 @@
1
- import type { FinalAnswerEvidence, ToolCallExecutionEvidence } from "../protocol/wire/notification-payloads.js";
1
+ import type { ToolIdentity } from "../protocol/wire/chat-types.js";
2
+ export interface ToolCallExecutionEvidence {
3
+ sequence: number;
4
+ callId: string;
5
+ name: string;
6
+ identity: ToolIdentity;
7
+ status: "running" | "succeeded" | "failed" | "blocked";
8
+ arguments?: string;
9
+ error?: string;
10
+ failureKind?: "policy_blocked" | "semantic_quality_failed" | "timeout" | "mcp_start_failed" | "mcp_unavailable" | "tool_execution_failed";
11
+ }
12
+ export interface FinalAnswerEvidence {
13
+ schemaVersion: 1;
14
+ requirement: "not-required" | "fresh-tool-evidence";
15
+ disposition: "not-required" | "grounded" | "blocked-no-tool-evidence" | "blocked-no-successful-evidence";
16
+ successfulCallIds: string[];
17
+ failedCallIds: string[];
18
+ blockedCallIds: string[];
19
+ reason: string;
20
+ }
2
21
  export declare function isFreshEvidenceToolCall(call: Pick<ToolCallExecutionEvidence, "identity">): boolean;
3
22
  export declare function hasSuccessfulFreshToolEvidence(toolCalls: readonly ToolCallExecutionEvidence[]): boolean;
4
23
  export declare function classifyToolFailureKind(result: {
@@ -130,8 +130,8 @@ export type TurnEvent = {
130
130
  telemetrySource?: "agent";
131
131
  /** Versioned terminal ledger for per-call execution and final-answer evidence. */
132
132
  ledgerSchemaVersion: 4;
133
- toolCalls: import("../protocol/wire/notification-payloads.js").ToolCallExecutionEvidence[];
134
- finalAnswerEvidence: import("../protocol/wire/notification-payloads.js").FinalAnswerEvidence;
133
+ toolCalls: import("./tool-execution-evidence.js").ToolCallExecutionEvidence[];
134
+ finalAnswerEvidence: import("./tool-execution-evidence.js").FinalAnswerEvidence;
135
135
  availableToolNames: string[];
136
136
  enabledToolNames: string[];
137
137
  toolCallNames: string[];
@@ -9,6 +9,6 @@ export { advanceToolLoopState, recoverToolLoopStateFromChatConversation, recover
9
9
  export { isForegroundSource, isTransientCapacityError, computeRetryBackoff, isPersistentRetryEnabled, FallbackTriggeredError, type PersistentRetryConfig, } from "./error-handling/retry-loop.js";
10
10
  export { canForkAtDepth, buildForkedMessages, buildForkPlaceholderResults, FORK_PLACEHOLDER_RESULT, FORK_SENTINEL_TAG, generateForkChildAgentId, isInForkChild, MAX_FORK_DEPTH, resolveForkChildTools, type ForkChildConfig, type ForkChildMessage, type ForkContext, type ForkResult, } from "./subagent/fork-subagent.js";
11
11
  export { getBuiltInAgent, getBuiltInAgents, isBuiltInAgent, resolveAgentToolSet, type AgentDefinition, } from "./subagent/agent-registry.js";
12
- export { createTaskState, type IsolationMode, type PermissionRole, type TaskType, type TaskLifecycle, type TaskState, type TaskStateBase, type LocalBashTaskState, type LocalAgentTaskState, type RemoteAgentTaskState, type DreamTaskState, type DreamTurn, type DreamPhase, } from "./subagent/task-types.js";
12
+ export { createTaskState, type IsolationMode, type PermissionRole, type TaskType, type TaskLifecycle, type TaskState, type TaskStateBase, type LocalBashTaskState, type LocalAgentTaskState, type RemoteAgentTaskState, } from "./subagent/task-types.js";
13
13
  export { calculateTokenWarningState, createTurnLoopGuardState, resolveApiErrorRecovery, resolveOutputTokenEscalation, shouldAbortTurn, type ApiErrorRecovery, type TokenWarningState, type TurnLoopGuardConfig, type TurnLoopGuardState, } from "./context/turn-loop-guard.js";
14
14
  export { buildPostCompactRestorationMessage, createReactiveCompactState, shouldAttemptReactiveCompact, type ReactiveCompactConfig, type ReactiveCompactState, } from "./context/reactive-compact.js";
@@ -1,9 +1,2 @@
1
- /**
2
- * Centralized Notification Event Protocol all JSON-RPC notification types
3
- * that qlogicagent emits to external apps.
4
- *
5
- * CANONICAL SOURCE: protocol/wire/notification-payloads.ts
6
- * This file re-exports the wire types.
7
- * Internal consumers import from this file — zero churn.
8
- */
9
- export type { AgentSource, ArtifactType, MediaResultType, MemoryDecayCompletedNotification, MemoryUpdatedNotification, NotificationMethod, NotificationMethodMap, NotificationThreadItem, ThreadItemNotification, PermissionRuleUpdatedNotification, PlanInterruptedNotification, PongNotification, ProductAgentActivityNotification, ProductBudgetUpdateNotification, ProductBudgetWarningNotification, ProductCheckpointedNotification, ProductCompletedNotification, ProductDagTopologyNotification, ProductMembersNotification, ProductPlanFailedNotification, ProductPlanningDeltaNotification, ProductPlanReadyNotification, ProductLeaderMessageNotification, ProductPlanningAskNotification, ProductTaskCompletedNotification, ProductTaskFailedNotification, ProductTaskOutputDeltaNotification, ProductTaskStartedNotification, ProjectArchivedNotification, ProjectCreatedNotification, ProjectDeletedNotification, ProjectRenamedNotification, ProjectSwitchedNotification, ProjectUnarchivedNotification, SessionInfoNotification, SessionRecoveryPendingNotification, SoloAgentDeltaNotification, SoloAgentUsageNotification, SoloEvaluationNotification, SoloProgressNotification, TeamMemberNotification, ToolApprovalRequestNotification, TurnAnnotationsNotification, TurnArtifactNotification, TurnAskUserNotification, TurnDeltaNotification, TurnEndNotification, TurnErrorNotification, TurnExecProgressNotification, TurnHeartbeatNotification, TurnMediaResultNotification, TurnPlanUpdateNotification, TurnProgressNotification, TurnReasoningDeltaNotification, TurnRecoveryNotification, TurnSidechainCompletedNotification, TurnSidechainStartedNotification, TurnStartNotification, TurnSubagentActivityNotification, TurnSubagentActivityStatus, TurnSubagentCompletedNotification, TurnSubagentDecisionNotification, TurnSubagentDeltaNotification, TurnSubagentEvidenceItem, TurnSubagentStartedNotification, TurnSubagentTokenUsage, TurnSuggestionsNotification, TurnTaskUpdatedNotification, TurnTodosUpdatedNotification, TurnToolBlockedNotification, TurnToolCallNotification, TurnToolResultNotification, TurnToolUseSummaryNotification, TurnUsageUpdateNotification, WireTokenUsage, MentionDelegateStartedNotification, MentionDelegateActivityNotification, MentionDelegateSettledNotification, } from "./wire/index.js";
1
+ /** Adapter-internal events with a direct standard ACP projection. */
2
+ export type { MediaResultType, NotificationMethod, NotificationMethodMap, TurnDeltaNotification, TurnEndNotification, TurnMediaResultNotification, TurnReasoningDeltaNotification, TurnToolBlockedNotification, TurnToolCallNotification, TurnToolResultNotification, WireTokenUsage, } from "./wire/notification-payloads.js";