@pellux/goodvibes-sdk 0.38.0 → 1.1.0

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 (559) hide show
  1. package/dist/contracts/artifacts/operator-contract.json +4468 -916
  2. package/dist/daemon.d.ts +2 -0
  3. package/dist/daemon.d.ts.map +1 -1
  4. package/dist/daemon.js +4 -0
  5. package/dist/events/communication.d.ts +1 -1
  6. package/dist/events/surfaces.d.ts +25 -3
  7. package/dist/events/surfaces.d.ts.map +1 -1
  8. package/dist/events/surfaces.js +22 -1
  9. package/dist/events/workflows.d.ts +7 -6
  10. package/dist/events/workflows.d.ts.map +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/platform/agents/archetypes.d.ts.map +1 -1
  14. package/dist/platform/agents/archetypes.js +7 -0
  15. package/dist/platform/agents/index.d.ts +1 -0
  16. package/dist/platform/agents/index.d.ts.map +1 -1
  17. package/dist/platform/agents/index.js +1 -0
  18. package/dist/platform/agents/orchestrator-runner.d.ts +16 -3
  19. package/dist/platform/agents/orchestrator-runner.d.ts.map +1 -1
  20. package/dist/platform/agents/orchestrator-runner.js +20 -6
  21. package/dist/platform/agents/orchestrator.d.ts +42 -10
  22. package/dist/platform/agents/orchestrator.d.ts.map +1 -1
  23. package/dist/platform/agents/orchestrator.js +68 -20
  24. package/dist/platform/agents/planner-decomposition-runner.d.ts +38 -0
  25. package/dist/platform/agents/planner-decomposition-runner.d.ts.map +1 -0
  26. package/dist/platform/agents/planner-decomposition-runner.js +113 -0
  27. package/dist/platform/agents/turn-knowledge-injection.d.ts +88 -3
  28. package/dist/platform/agents/turn-knowledge-injection.d.ts.map +1 -1
  29. package/dist/platform/agents/turn-knowledge-injection.js +147 -30
  30. package/dist/platform/agents/worktree.d.ts +126 -8
  31. package/dist/platform/agents/worktree.d.ts.map +1 -1
  32. package/dist/platform/agents/worktree.js +240 -19
  33. package/dist/platform/agents/wrfc-controller.d.ts +24 -1
  34. package/dist/platform/agents/wrfc-controller.d.ts.map +1 -1
  35. package/dist/platform/agents/wrfc-controller.js +161 -35
  36. package/dist/platform/agents/wrfc-gate-runtime.d.ts +9 -0
  37. package/dist/platform/agents/wrfc-gate-runtime.d.ts.map +1 -1
  38. package/dist/platform/agents/wrfc-gate-runtime.js +7 -3
  39. package/dist/platform/agents/wrfc-gates.d.ts +1 -1
  40. package/dist/platform/agents/wrfc-gates.d.ts.map +1 -1
  41. package/dist/platform/agents/wrfc-gates.js +7 -1
  42. package/dist/platform/agents/wrfc-types.d.ts +23 -3
  43. package/dist/platform/agents/wrfc-types.d.ts.map +1 -1
  44. package/dist/platform/automation/types.d.ts +9 -1
  45. package/dist/platform/automation/types.d.ts.map +1 -1
  46. package/dist/platform/calendar/calendar-api-shared.d.ts +25 -0
  47. package/dist/platform/calendar/calendar-api-shared.d.ts.map +1 -0
  48. package/dist/platform/calendar/calendar-api-shared.js +100 -0
  49. package/dist/platform/calendar/calendar-connector.d.ts +79 -0
  50. package/dist/platform/calendar/calendar-connector.d.ts.map +1 -0
  51. package/dist/platform/calendar/calendar-connector.js +155 -0
  52. package/dist/platform/calendar/google-calendar-api.d.ts +25 -0
  53. package/dist/platform/calendar/google-calendar-api.d.ts.map +1 -0
  54. package/dist/platform/calendar/google-calendar-api.js +89 -0
  55. package/dist/platform/calendar/http-fetch-adapter.d.ts +25 -0
  56. package/dist/platform/calendar/http-fetch-adapter.d.ts.map +1 -0
  57. package/dist/platform/calendar/http-fetch-adapter.js +25 -0
  58. package/dist/platform/calendar/ics-parser.d.ts +35 -0
  59. package/dist/platform/calendar/ics-parser.d.ts.map +1 -0
  60. package/dist/platform/calendar/ics-parser.js +236 -0
  61. package/dist/platform/calendar/index.d.ts +41 -0
  62. package/dist/platform/calendar/index.d.ts.map +1 -0
  63. package/dist/platform/calendar/index.js +49 -0
  64. package/dist/platform/calendar/merged-calendar-model.d.ts +67 -0
  65. package/dist/platform/calendar/merged-calendar-model.d.ts.map +1 -0
  66. package/dist/platform/calendar/merged-calendar-model.js +181 -0
  67. package/dist/platform/calendar/microsoft-graph-api.d.ts +25 -0
  68. package/dist/platform/calendar/microsoft-graph-api.d.ts.map +1 -0
  69. package/dist/platform/calendar/microsoft-graph-api.js +95 -0
  70. package/dist/platform/calendar/oauth-flow.d.ts +62 -0
  71. package/dist/platform/calendar/oauth-flow.d.ts.map +1 -0
  72. package/dist/platform/calendar/oauth-flow.js +305 -0
  73. package/dist/platform/calendar/oauth-providers.d.ts +43 -0
  74. package/dist/platform/calendar/oauth-providers.d.ts.map +1 -0
  75. package/dist/platform/calendar/oauth-providers.js +120 -0
  76. package/dist/platform/calendar/oauth-token-store.d.ts +72 -0
  77. package/dist/platform/calendar/oauth-token-store.d.ts.map +1 -0
  78. package/dist/platform/calendar/oauth-token-store.js +189 -0
  79. package/dist/platform/calendar/oauth-types.d.ts +274 -0
  80. package/dist/platform/calendar/oauth-types.d.ts.map +1 -0
  81. package/dist/platform/calendar/oauth-types.js +22 -0
  82. package/dist/platform/calendar/rrule.d.ts +39 -0
  83. package/dist/platform/calendar/rrule.d.ts.map +1 -0
  84. package/dist/platform/calendar/rrule.js +261 -0
  85. package/dist/platform/calendar/subscription-store.d.ts +118 -0
  86. package/dist/platform/calendar/subscription-store.d.ts.map +1 -0
  87. package/dist/platform/calendar/subscription-store.js +293 -0
  88. package/dist/platform/calendar/types.d.ts +170 -0
  89. package/dist/platform/calendar/types.d.ts.map +1 -0
  90. package/dist/platform/calendar/types.js +21 -0
  91. package/dist/platform/companion/companion-chat-attachments.d.ts +29 -0
  92. package/dist/platform/companion/companion-chat-attachments.d.ts.map +1 -0
  93. package/dist/platform/companion/companion-chat-attachments.js +121 -0
  94. package/dist/platform/companion/companion-chat-branching.d.ts +66 -0
  95. package/dist/platform/companion/companion-chat-branching.d.ts.map +1 -0
  96. package/dist/platform/companion/companion-chat-branching.js +142 -0
  97. package/dist/platform/companion/companion-chat-broker-bridge.d.ts +40 -0
  98. package/dist/platform/companion/companion-chat-broker-bridge.d.ts.map +1 -0
  99. package/dist/platform/companion/companion-chat-broker-bridge.js +14 -0
  100. package/dist/platform/companion/companion-chat-broker-sync.d.ts +38 -0
  101. package/dist/platform/companion/companion-chat-broker-sync.d.ts.map +1 -0
  102. package/dist/platform/companion/companion-chat-broker-sync.js +80 -0
  103. package/dist/platform/companion/companion-chat-gc.d.ts +63 -0
  104. package/dist/platform/companion/companion-chat-gc.d.ts.map +1 -0
  105. package/dist/platform/companion/companion-chat-gc.js +38 -0
  106. package/dist/platform/companion/companion-chat-manager.d.ts +91 -23
  107. package/dist/platform/companion/companion-chat-manager.d.ts.map +1 -1
  108. package/dist/platform/companion/companion-chat-manager.js +195 -223
  109. package/dist/platform/companion/companion-chat-persistence.d.ts +9 -1
  110. package/dist/platform/companion/companion-chat-persistence.d.ts.map +1 -1
  111. package/dist/platform/companion/companion-chat-persistence.js +10 -2
  112. package/dist/platform/companion/companion-chat-routes.d.ts +2 -1
  113. package/dist/platform/companion/companion-chat-routes.d.ts.map +1 -1
  114. package/dist/platform/companion/companion-chat-routes.js +113 -4
  115. package/dist/platform/companion/companion-chat-turn-execution.d.ts +61 -0
  116. package/dist/platform/companion/companion-chat-turn-execution.d.ts.map +1 -0
  117. package/dist/platform/companion/companion-chat-turn-execution.js +107 -0
  118. package/dist/platform/companion/companion-chat-types.d.ts +67 -0
  119. package/dist/platform/companion/companion-chat-types.d.ts.map +1 -1
  120. package/dist/platform/config/credential-status.d.ts +28 -0
  121. package/dist/platform/config/credential-status.d.ts.map +1 -0
  122. package/dist/platform/config/credential-status.js +75 -0
  123. package/dist/platform/config/index.d.ts +25 -0
  124. package/dist/platform/config/index.d.ts.map +1 -1
  125. package/dist/platform/config/index.js +18 -0
  126. package/dist/platform/config/manager.d.ts +9 -0
  127. package/dist/platform/config/manager.d.ts.map +1 -1
  128. package/dist/platform/config/manager.js +21 -2
  129. package/dist/platform/config/migrations.d.ts +48 -0
  130. package/dist/platform/config/migrations.d.ts.map +1 -0
  131. package/dist/platform/config/migrations.js +54 -0
  132. package/dist/platform/config/schema-domain-core.d.ts +10 -1
  133. package/dist/platform/config/schema-domain-core.d.ts.map +1 -1
  134. package/dist/platform/config/schema-domain-core.js +46 -3
  135. package/dist/platform/config/schema-domain-runtime.d.ts +8 -0
  136. package/dist/platform/config/schema-domain-runtime.d.ts.map +1 -1
  137. package/dist/platform/config/schema-domain-runtime.js +32 -0
  138. package/dist/platform/config/schema-types.d.ts +21 -7
  139. package/dist/platform/config/schema-types.d.ts.map +1 -1
  140. package/dist/platform/config/schema.d.ts.map +1 -1
  141. package/dist/platform/config/schema.js +2 -0
  142. package/dist/platform/control-plane/approval-broker.d.ts +11 -0
  143. package/dist/platform/control-plane/approval-broker.d.ts.map +1 -1
  144. package/dist/platform/control-plane/approval-broker.js +17 -1
  145. package/dist/platform/control-plane/approval-hunk-apply.d.ts +77 -0
  146. package/dist/platform/control-plane/approval-hunk-apply.d.ts.map +1 -0
  147. package/dist/platform/control-plane/approval-hunk-apply.js +80 -0
  148. package/dist/platform/control-plane/gateway-disabled-response.d.ts +20 -0
  149. package/dist/platform/control-plane/gateway-disabled-response.d.ts.map +1 -0
  150. package/dist/platform/control-plane/gateway-disabled-response.js +24 -0
  151. package/dist/platform/control-plane/gateway-scope-enforcement.d.ts +68 -0
  152. package/dist/platform/control-plane/gateway-scope-enforcement.d.ts.map +1 -0
  153. package/dist/platform/control-plane/gateway-scope-enforcement.js +91 -0
  154. package/dist/platform/control-plane/gateway-utils.d.ts +17 -0
  155. package/dist/platform/control-plane/gateway-utils.d.ts.map +1 -1
  156. package/dist/platform/control-plane/gateway-utils.js +30 -0
  157. package/dist/platform/control-plane/gateway.d.ts +12 -2
  158. package/dist/platform/control-plane/gateway.d.ts.map +1 -1
  159. package/dist/platform/control-plane/gateway.js +27 -31
  160. package/dist/platform/control-plane/index.d.ts +8 -1
  161. package/dist/platform/control-plane/index.d.ts.map +1 -1
  162. package/dist/platform/control-plane/index.js +8 -0
  163. package/dist/platform/control-plane/invoke-input-validation.d.ts +56 -0
  164. package/dist/platform/control-plane/invoke-input-validation.d.ts.map +1 -0
  165. package/dist/platform/control-plane/invoke-input-validation.js +163 -0
  166. package/dist/platform/control-plane/method-catalog-admin.d.ts.map +1 -1
  167. package/dist/platform/control-plane/method-catalog-admin.js +12 -1
  168. package/dist/platform/control-plane/method-catalog-calendar.d.ts +16 -0
  169. package/dist/platform/control-plane/method-catalog-calendar.d.ts.map +1 -1
  170. package/dist/platform/control-plane/method-catalog-calendar.js +21 -0
  171. package/dist/platform/control-plane/method-catalog-channels.d.ts.map +1 -1
  172. package/dist/platform/control-plane/method-catalog-channels.js +32 -3
  173. package/dist/platform/control-plane/method-catalog-control-automation.d.ts.map +1 -1
  174. package/dist/platform/control-plane/method-catalog-control-automation.js +19 -34
  175. package/dist/platform/control-plane/method-catalog-control-companion.d.ts +15 -0
  176. package/dist/platform/control-plane/method-catalog-control-companion.d.ts.map +1 -0
  177. package/dist/platform/control-plane/method-catalog-control-companion.js +176 -0
  178. package/dist/platform/control-plane/method-catalog-control-core.d.ts.map +1 -1
  179. package/dist/platform/control-plane/method-catalog-control-core.js +104 -122
  180. package/dist/platform/control-plane/method-catalog-control.d.ts.map +1 -1
  181. package/dist/platform/control-plane/method-catalog-control.js +4 -0
  182. package/dist/platform/control-plane/method-catalog-email.d.ts +17 -0
  183. package/dist/platform/control-plane/method-catalog-email.d.ts.map +1 -1
  184. package/dist/platform/control-plane/method-catalog-email.js +21 -0
  185. package/dist/platform/control-plane/method-catalog-events.d.ts +28 -0
  186. package/dist/platform/control-plane/method-catalog-events.d.ts.map +1 -1
  187. package/dist/platform/control-plane/method-catalog-events.js +74 -1
  188. package/dist/platform/control-plane/method-catalog-fleet.d.ts +24 -0
  189. package/dist/platform/control-plane/method-catalog-fleet.d.ts.map +1 -0
  190. package/dist/platform/control-plane/method-catalog-fleet.js +65 -0
  191. package/dist/platform/control-plane/method-catalog-push.d.ts +30 -0
  192. package/dist/platform/control-plane/method-catalog-push.d.ts.map +1 -0
  193. package/dist/platform/control-plane/method-catalog-push.js +80 -0
  194. package/dist/platform/control-plane/method-catalog-route-reconcile.d.ts +84 -0
  195. package/dist/platform/control-plane/method-catalog-route-reconcile.d.ts.map +1 -0
  196. package/dist/platform/control-plane/method-catalog-route-reconcile.js +103 -0
  197. package/dist/platform/control-plane/method-catalog-runtime.d.ts.map +1 -1
  198. package/dist/platform/control-plane/method-catalog-runtime.js +83 -1
  199. package/dist/platform/control-plane/method-catalog-shared.d.ts +29 -0
  200. package/dist/platform/control-plane/method-catalog-shared.d.ts.map +1 -1
  201. package/dist/platform/control-plane/method-catalog.d.ts +9 -0
  202. package/dist/platform/control-plane/method-catalog.d.ts.map +1 -1
  203. package/dist/platform/control-plane/method-catalog.js +34 -3
  204. package/dist/platform/control-plane/operator-contract-schemas-admin.d.ts +8 -0
  205. package/dist/platform/control-plane/operator-contract-schemas-admin.d.ts.map +1 -1
  206. package/dist/platform/control-plane/operator-contract-schemas-admin.js +22 -1
  207. package/dist/platform/control-plane/operator-contract-schemas-fleet.d.ts +18 -0
  208. package/dist/platform/control-plane/operator-contract-schemas-fleet.d.ts.map +1 -0
  209. package/dist/platform/control-plane/operator-contract-schemas-fleet.js +182 -0
  210. package/dist/platform/control-plane/operator-contract-schemas-permissions.d.ts.map +1 -1
  211. package/dist/platform/control-plane/operator-contract-schemas-permissions.js +5 -0
  212. package/dist/platform/control-plane/operator-contract-schemas-runtime.d.ts +37 -0
  213. package/dist/platform/control-plane/operator-contract-schemas-runtime.d.ts.map +1 -1
  214. package/dist/platform/control-plane/operator-contract-schemas-runtime.js +100 -3
  215. package/dist/platform/control-plane/operator-contract-schemas.d.ts +1 -0
  216. package/dist/platform/control-plane/operator-contract-schemas.d.ts.map +1 -1
  217. package/dist/platform/control-plane/operator-contract-schemas.js +1 -0
  218. package/dist/platform/control-plane/operator-contract.d.ts.map +1 -1
  219. package/dist/platform/control-plane/operator-contract.js +8 -0
  220. package/dist/platform/control-plane/routes/checkpoints.d.ts +39 -0
  221. package/dist/platform/control-plane/routes/checkpoints.d.ts.map +1 -0
  222. package/dist/platform/control-plane/routes/checkpoints.js +166 -0
  223. package/dist/platform/control-plane/routes/fleet.d.ts +53 -0
  224. package/dist/platform/control-plane/routes/fleet.d.ts.map +1 -0
  225. package/dist/platform/control-plane/routes/fleet.js +153 -0
  226. package/dist/platform/control-plane/routes/gateway-verb-error.d.ts +30 -0
  227. package/dist/platform/control-plane/routes/gateway-verb-error.d.ts.map +1 -0
  228. package/dist/platform/control-plane/routes/gateway-verb-error.js +36 -0
  229. package/dist/platform/control-plane/routes/index.d.ts +0 -6
  230. package/dist/platform/control-plane/routes/index.d.ts.map +1 -1
  231. package/dist/platform/control-plane/routes/index.js +5 -5
  232. package/dist/platform/control-plane/routes/invocation-params.d.ts +23 -0
  233. package/dist/platform/control-plane/routes/invocation-params.d.ts.map +1 -0
  234. package/dist/platform/control-plane/routes/invocation-params.js +9 -0
  235. package/dist/platform/control-plane/routes/push.d.ts +26 -0
  236. package/dist/platform/control-plane/routes/push.d.ts.map +1 -0
  237. package/dist/platform/control-plane/routes/push.js +104 -0
  238. package/dist/platform/control-plane/routes/register-gateway-verb-groups.d.ts +31 -0
  239. package/dist/platform/control-plane/routes/register-gateway-verb-groups.d.ts.map +1 -0
  240. package/dist/platform/control-plane/routes/register-gateway-verb-groups.js +16 -0
  241. package/dist/platform/control-plane/routes/register-w3-s2.d.ts +26 -0
  242. package/dist/platform/control-plane/routes/register-w3-s2.d.ts.map +1 -0
  243. package/dist/platform/control-plane/routes/register-w3-s2.js +8 -0
  244. package/dist/platform/control-plane/routes/session-search.d.ts +37 -0
  245. package/dist/platform/control-plane/routes/session-search.d.ts.map +1 -0
  246. package/dist/platform/control-plane/routes/session-search.js +113 -0
  247. package/dist/platform/control-plane/session-broker-gc.d.ts +16 -0
  248. package/dist/platform/control-plane/session-broker-gc.d.ts.map +1 -1
  249. package/dist/platform/control-plane/session-broker-gc.js +23 -6
  250. package/dist/platform/control-plane/session-broker-helpers.d.ts +3 -3
  251. package/dist/platform/control-plane/session-broker-helpers.d.ts.map +1 -1
  252. package/dist/platform/control-plane/session-broker-inputs.d.ts +18 -0
  253. package/dist/platform/control-plane/session-broker-inputs.d.ts.map +1 -1
  254. package/dist/platform/control-plane/session-broker-inputs.js +34 -0
  255. package/dist/platform/control-plane/session-broker-sessions.d.ts +102 -3
  256. package/dist/platform/control-plane/session-broker-sessions.d.ts.map +1 -1
  257. package/dist/platform/control-plane/session-broker-sessions.js +179 -5
  258. package/dist/platform/control-plane/session-broker-state.d.ts +20 -1
  259. package/dist/platform/control-plane/session-broker-state.d.ts.map +1 -1
  260. package/dist/platform/control-plane/session-broker-state.js +67 -5
  261. package/dist/platform/control-plane/session-broker.d.ts +51 -38
  262. package/dist/platform/control-plane/session-broker.d.ts.map +1 -1
  263. package/dist/platform/control-plane/session-broker.js +183 -75
  264. package/dist/platform/control-plane/session-store-importer.d.ts +57 -0
  265. package/dist/platform/control-plane/session-store-importer.d.ts.map +1 -0
  266. package/dist/platform/control-plane/session-store-importer.js +227 -0
  267. package/dist/platform/control-plane/session-types.d.ts +142 -7
  268. package/dist/platform/control-plane/session-types.d.ts.map +1 -1
  269. package/dist/platform/core/execution-plan.d.ts +43 -1
  270. package/dist/platform/core/execution-plan.d.ts.map +1 -1
  271. package/dist/platform/core/execution-plan.js +46 -10
  272. package/dist/platform/core/index.d.ts +1 -0
  273. package/dist/platform/core/index.d.ts.map +1 -1
  274. package/dist/platform/core/index.js +1 -0
  275. package/dist/platform/core/orchestrator-runtime.d.ts +23 -3
  276. package/dist/platform/core/orchestrator-runtime.d.ts.map +1 -1
  277. package/dist/platform/core/orchestrator-tool-runtime.d.ts +7 -0
  278. package/dist/platform/core/orchestrator-tool-runtime.d.ts.map +1 -1
  279. package/dist/platform/core/orchestrator-tool-runtime.js +10 -0
  280. package/dist/platform/core/orchestrator-turn-loop.d.ts +13 -6
  281. package/dist/platform/core/orchestrator-turn-loop.d.ts.map +1 -1
  282. package/dist/platform/core/orchestrator-turn-loop.js +29 -22
  283. package/dist/platform/core/orchestrator.d.ts +16 -10
  284. package/dist/platform/core/orchestrator.d.ts.map +1 -1
  285. package/dist/platform/core/orchestrator.js +23 -8
  286. package/dist/platform/core/plan-decomposition.d.ts +196 -0
  287. package/dist/platform/core/plan-decomposition.d.ts.map +1 -0
  288. package/dist/platform/core/plan-decomposition.js +417 -0
  289. package/dist/platform/core/plan-proposal.d.ts +39 -0
  290. package/dist/platform/core/plan-proposal.d.ts.map +1 -1
  291. package/dist/platform/core/wrfc-routing.d.ts +1 -0
  292. package/dist/platform/core/wrfc-routing.d.ts.map +1 -1
  293. package/dist/platform/core/wrfc-routing.js +51 -1
  294. package/dist/platform/daemon/boot.d.ts +69 -0
  295. package/dist/platform/daemon/boot.d.ts.map +1 -0
  296. package/dist/platform/daemon/boot.js +61 -0
  297. package/dist/platform/daemon/cli.js +2 -1
  298. package/dist/platform/daemon/control-plane.d.ts.map +1 -1
  299. package/dist/platform/daemon/control-plane.js +50 -1
  300. package/dist/platform/daemon/facade-composition.d.ts.map +1 -1
  301. package/dist/platform/daemon/facade-composition.js +6 -0
  302. package/dist/platform/daemon/facade.d.ts +15 -6
  303. package/dist/platform/daemon/facade.d.ts.map +1 -1
  304. package/dist/platform/daemon/facade.js +48 -43
  305. package/dist/platform/daemon/http/router-route-contexts.d.ts +1 -0
  306. package/dist/platform/daemon/http/router-route-contexts.d.ts.map +1 -1
  307. package/dist/platform/daemon/http/router-route-contexts.js +1 -0
  308. package/dist/platform/daemon/http/router-session-broker-adapter.d.ts +13 -0
  309. package/dist/platform/daemon/http/router-session-broker-adapter.d.ts.map +1 -0
  310. package/dist/platform/daemon/http/router-session-broker-adapter.js +27 -0
  311. package/dist/platform/daemon/http/router.d.ts +2 -1
  312. package/dist/platform/daemon/http/router.d.ts.map +1 -1
  313. package/dist/platform/daemon/http/router.js +42 -40
  314. package/dist/platform/daemon/http/runtime-route-types.d.ts +42 -4
  315. package/dist/platform/daemon/http/runtime-route-types.d.ts.map +1 -1
  316. package/dist/platform/daemon/http/webui-serving.d.ts +68 -0
  317. package/dist/platform/daemon/http/webui-serving.d.ts.map +1 -0
  318. package/dist/platform/daemon/http/webui-serving.js +230 -0
  319. package/dist/platform/daemon/index.d.ts +2 -0
  320. package/dist/platform/daemon/index.d.ts.map +1 -1
  321. package/dist/platform/daemon/index.js +1 -0
  322. package/dist/platform/daemon/service-manager.d.ts +16 -0
  323. package/dist/platform/daemon/service-manager.d.ts.map +1 -1
  324. package/dist/platform/daemon/service-manager.js +79 -15
  325. package/dist/platform/intelligence/tree-sitter/service.d.ts.map +1 -1
  326. package/dist/platform/intelligence/tree-sitter/service.js +16 -2
  327. package/dist/platform/knowledge/browser-history/readers.d.ts.map +1 -1
  328. package/dist/platform/knowledge/browser-history/readers.js +15 -5
  329. package/dist/platform/knowledge/knowledge-api.d.ts +1 -1
  330. package/dist/platform/knowledge/project-planning/service.d.ts +14 -1
  331. package/dist/platform/knowledge/project-planning/service.d.ts.map +1 -1
  332. package/dist/platform/knowledge/project-planning/service.js +77 -0
  333. package/dist/platform/knowledge/project-planning/types.d.ts +32 -0
  334. package/dist/platform/knowledge/project-planning/types.d.ts.map +1 -1
  335. package/dist/platform/orchestration/bookkeeping.d.ts +12 -0
  336. package/dist/platform/orchestration/bookkeeping.d.ts.map +1 -0
  337. package/dist/platform/orchestration/bookkeeping.js +91 -0
  338. package/dist/platform/orchestration/budget.d.ts +2 -2
  339. package/dist/platform/orchestration/cancellation.d.ts +2 -2
  340. package/dist/platform/orchestration/controller-compat.d.ts +16 -3
  341. package/dist/platform/orchestration/controller-compat.d.ts.map +1 -1
  342. package/dist/platform/orchestration/controller-compat.js +18 -4
  343. package/dist/platform/orchestration/dirty-guard.js +1 -1
  344. package/dist/platform/orchestration/engine.d.ts +26 -1
  345. package/dist/platform/orchestration/engine.d.ts.map +1 -1
  346. package/dist/platform/orchestration/engine.js +229 -25
  347. package/dist/platform/orchestration/index.d.ts +6 -4
  348. package/dist/platform/orchestration/index.d.ts.map +1 -1
  349. package/dist/platform/orchestration/index.js +3 -2
  350. package/dist/platform/orchestration/persistence.d.ts.map +1 -1
  351. package/dist/platform/orchestration/persistence.js +6 -3
  352. package/dist/platform/orchestration/phase-runner.d.ts +33 -6
  353. package/dist/platform/orchestration/phase-runner.d.ts.map +1 -1
  354. package/dist/platform/orchestration/phase-runner.js +98 -25
  355. package/dist/platform/orchestration/proposal-workstream.d.ts +56 -0
  356. package/dist/platform/orchestration/proposal-workstream.d.ts.map +1 -0
  357. package/dist/platform/orchestration/proposal-workstream.js +76 -0
  358. package/dist/platform/orchestration/scheduler.d.ts +20 -1
  359. package/dist/platform/orchestration/scheduler.d.ts.map +1 -1
  360. package/dist/platform/orchestration/scheduler.js +16 -0
  361. package/dist/platform/orchestration/types.d.ts +289 -4
  362. package/dist/platform/orchestration/types.d.ts.map +1 -1
  363. package/dist/platform/orchestration/types.js +32 -0
  364. package/dist/platform/orchestration/worktree-isolation.d.ts +33 -0
  365. package/dist/platform/orchestration/worktree-isolation.d.ts.map +1 -0
  366. package/dist/platform/orchestration/worktree-isolation.js +248 -0
  367. package/dist/platform/presentation/glyphs.d.ts +91 -0
  368. package/dist/platform/presentation/glyphs.d.ts.map +1 -0
  369. package/dist/platform/presentation/glyphs.js +93 -0
  370. package/dist/platform/presentation/index.d.ts +28 -0
  371. package/dist/platform/presentation/index.d.ts.map +1 -0
  372. package/dist/platform/presentation/index.js +27 -0
  373. package/dist/platform/presentation/thinking-phrases.d.ts +12 -0
  374. package/dist/platform/presentation/thinking-phrases.d.ts.map +1 -0
  375. package/dist/platform/presentation/thinking-phrases.js +32 -0
  376. package/dist/platform/presentation/tones.d.ts +121 -0
  377. package/dist/platform/presentation/tones.d.ts.map +1 -0
  378. package/dist/platform/presentation/tones.js +145 -0
  379. package/dist/platform/presentation/waiting-wording.d.ts +54 -0
  380. package/dist/platform/presentation/waiting-wording.d.ts.map +1 -0
  381. package/dist/platform/presentation/waiting-wording.js +51 -0
  382. package/dist/platform/providers/runtime-snapshot.d.ts.map +1 -1
  383. package/dist/platform/providers/runtime-snapshot.js +12 -2
  384. package/dist/platform/push/delivery.d.ts +48 -0
  385. package/dist/platform/push/delivery.d.ts.map +1 -0
  386. package/dist/platform/push/delivery.js +117 -0
  387. package/dist/platform/push/encryption.d.ts +41 -0
  388. package/dist/platform/push/encryption.d.ts.map +1 -0
  389. package/dist/platform/push/encryption.js +82 -0
  390. package/dist/platform/push/index.d.ts +17 -0
  391. package/dist/platform/push/index.d.ts.map +1 -0
  392. package/dist/platform/push/index.js +10 -0
  393. package/dist/platform/push/service.d.ts +75 -0
  394. package/dist/platform/push/service.d.ts.map +1 -0
  395. package/dist/platform/push/service.js +95 -0
  396. package/dist/platform/push/subscription-store.d.ts +50 -0
  397. package/dist/platform/push/subscription-store.d.ts.map +1 -0
  398. package/dist/platform/push/subscription-store.js +123 -0
  399. package/dist/platform/push/types.d.ts +68 -0
  400. package/dist/platform/push/types.d.ts.map +1 -0
  401. package/dist/platform/push/types.js +13 -0
  402. package/dist/platform/push/vapid.d.ts +54 -0
  403. package/dist/platform/push/vapid.d.ts.map +1 -0
  404. package/dist/platform/push/vapid.js +113 -0
  405. package/dist/platform/runtime/bootstrap-services.d.ts +62 -2
  406. package/dist/platform/runtime/bootstrap-services.d.ts.map +1 -1
  407. package/dist/platform/runtime/bootstrap-services.js +217 -50
  408. package/dist/platform/runtime/daemon-version-compat.d.ts +39 -0
  409. package/dist/platform/runtime/daemon-version-compat.d.ts.map +1 -0
  410. package/dist/platform/runtime/daemon-version-compat.js +75 -0
  411. package/dist/platform/runtime/detached-daemon-runtime.d.ts +26 -0
  412. package/dist/platform/runtime/detached-daemon-runtime.d.ts.map +1 -0
  413. package/dist/platform/runtime/detached-daemon-runtime.js +49 -0
  414. package/dist/platform/runtime/emitters/workflows.d.ts +1 -1
  415. package/dist/platform/runtime/emitters/workflows.d.ts.map +1 -1
  416. package/dist/platform/runtime/events/index.d.ts +13 -0
  417. package/dist/platform/runtime/events/index.d.ts.map +1 -1
  418. package/dist/platform/runtime/events/index.js +13 -0
  419. package/dist/platform/runtime/feature-flags/flags.d.ts.map +1 -1
  420. package/dist/platform/runtime/feature-flags/flags.js +39 -1
  421. package/dist/platform/runtime/fleet/adapters/agent.d.ts +2 -2
  422. package/dist/platform/runtime/fleet/adapters/agent.d.ts.map +1 -1
  423. package/dist/platform/runtime/fleet/adapters/agent.js +4 -4
  424. package/dist/platform/runtime/fleet/adapters/automation.d.ts +1 -1
  425. package/dist/platform/runtime/fleet/adapters/automation.js +1 -1
  426. package/dist/platform/runtime/fleet/adapters/code-index.d.ts +1 -1
  427. package/dist/platform/runtime/fleet/adapters/code-index.js +1 -1
  428. package/dist/platform/runtime/fleet/adapters/orchestration.d.ts +40 -18
  429. package/dist/platform/runtime/fleet/adapters/orchestration.d.ts.map +1 -1
  430. package/dist/platform/runtime/fleet/adapters/orchestration.js +138 -34
  431. package/dist/platform/runtime/fleet/adapters/schedule.d.ts +4 -4
  432. package/dist/platform/runtime/fleet/adapters/schedule.js +4 -4
  433. package/dist/platform/runtime/fleet/adapters/trigger.d.ts +3 -4
  434. package/dist/platform/runtime/fleet/adapters/trigger.d.ts.map +1 -1
  435. package/dist/platform/runtime/fleet/adapters/trigger.js +3 -4
  436. package/dist/platform/runtime/fleet/adapters/wrfc.d.ts +13 -0
  437. package/dist/platform/runtime/fleet/adapters/wrfc.d.ts.map +1 -1
  438. package/dist/platform/runtime/fleet/adapters/wrfc.js +49 -2
  439. package/dist/platform/runtime/fleet/registry.d.ts +7 -7
  440. package/dist/platform/runtime/fleet/registry.d.ts.map +1 -1
  441. package/dist/platform/runtime/fleet/registry.js +41 -7
  442. package/dist/platform/runtime/fleet/types.d.ts +9 -9
  443. package/dist/platform/runtime/fleet/types.d.ts.map +1 -1
  444. package/dist/platform/runtime/memory-spine/client.d.ts +127 -0
  445. package/dist/platform/runtime/memory-spine/client.d.ts.map +1 -0
  446. package/dist/platform/runtime/memory-spine/client.js +113 -0
  447. package/dist/platform/runtime/memory-spine/index.d.ts +11 -0
  448. package/dist/platform/runtime/memory-spine/index.d.ts.map +1 -0
  449. package/dist/platform/runtime/memory-spine/index.js +10 -0
  450. package/dist/platform/runtime/operator-client.d.ts +20 -2
  451. package/dist/platform/runtime/operator-client.d.ts.map +1 -1
  452. package/dist/platform/runtime/operator-client.js +11 -1
  453. package/dist/platform/runtime/provider-accounts/registry.d.ts.map +1 -1
  454. package/dist/platform/runtime/provider-accounts/registry.js +11 -1
  455. package/dist/platform/runtime/services.d.ts +11 -9
  456. package/dist/platform/runtime/services.d.ts.map +1 -1
  457. package/dist/platform/runtime/services.js +24 -9
  458. package/dist/platform/runtime/session-spine/client.d.ts +234 -0
  459. package/dist/platform/runtime/session-spine/client.d.ts.map +1 -0
  460. package/dist/platform/runtime/session-spine/client.js +449 -0
  461. package/dist/platform/runtime/session-spine/index.d.ts +12 -0
  462. package/dist/platform/runtime/session-spine/index.d.ts.map +1 -0
  463. package/dist/platform/runtime/session-spine/index.js +11 -0
  464. package/dist/platform/runtime/session-spine/union-cache.d.ts +225 -0
  465. package/dist/platform/runtime/session-spine/union-cache.d.ts.map +1 -0
  466. package/dist/platform/runtime/session-spine/union-cache.js +333 -0
  467. package/dist/platform/runtime/shell-command-ops.d.ts +3 -1
  468. package/dist/platform/runtime/shell-command-ops.d.ts.map +1 -1
  469. package/dist/platform/runtime/transports/daemon-http-client-validators.d.ts.map +1 -1
  470. package/dist/platform/runtime/transports/daemon-http-client-validators.js +22 -0
  471. package/dist/platform/runtime/transports/daemon-http-client.d.ts.map +1 -1
  472. package/dist/platform/runtime/transports/daemon-http-client.js +25 -2
  473. package/dist/platform/runtime/transports/http-types.d.ts +9 -2
  474. package/dist/platform/runtime/transports/http-types.d.ts.map +1 -1
  475. package/dist/platform/state/canonical-memory.d.ts +95 -0
  476. package/dist/platform/state/canonical-memory.d.ts.map +1 -0
  477. package/dist/platform/state/canonical-memory.js +155 -0
  478. package/dist/platform/state/code-index-chunking.js +1 -1
  479. package/dist/platform/state/code-index-db.d.ts +1 -1
  480. package/dist/platform/state/code-index-reindex.d.ts +73 -0
  481. package/dist/platform/state/code-index-reindex.d.ts.map +1 -0
  482. package/dist/platform/state/code-index-reindex.js +156 -0
  483. package/dist/platform/state/code-index-store.d.ts.map +1 -1
  484. package/dist/platform/state/code-index-store.js +11 -3
  485. package/dist/platform/state/index.d.ts +8 -0
  486. package/dist/platform/state/index.d.ts.map +1 -1
  487. package/dist/platform/state/index.js +4 -0
  488. package/dist/platform/state/memory-recall-contract.d.ts +118 -0
  489. package/dist/platform/state/memory-recall-contract.d.ts.map +1 -0
  490. package/dist/platform/state/memory-recall-contract.js +170 -0
  491. package/dist/platform/state/memory-registry.d.ts +8 -0
  492. package/dist/platform/state/memory-registry.d.ts.map +1 -1
  493. package/dist/platform/state/memory-registry.js +10 -0
  494. package/dist/platform/state/memory-store.d.ts +2 -0
  495. package/dist/platform/state/memory-store.d.ts.map +1 -1
  496. package/dist/platform/state/memory-store.js +4 -0
  497. package/dist/platform/state/memory-vector-store.d.ts.map +1 -1
  498. package/dist/platform/state/memory-vector-store.js +14 -3
  499. package/dist/platform/state/sqlite-store.d.ts +2 -0
  500. package/dist/platform/state/sqlite-store.d.ts.map +1 -1
  501. package/dist/platform/state/sqlite-store.js +4 -0
  502. package/dist/platform/state/sqlite-vec-loader.d.ts +1 -1
  503. package/dist/platform/state/sqlite-vec-loader.js +1 -1
  504. package/dist/platform/state/vibe-projection.d.ts +67 -0
  505. package/dist/platform/state/vibe-projection.d.ts.map +1 -0
  506. package/dist/platform/state/vibe-projection.js +115 -0
  507. package/dist/platform/tools/agent/index.d.ts.map +1 -1
  508. package/dist/platform/tools/agent/index.js +8 -0
  509. package/dist/platform/tools/agent/manager.d.ts +22 -10
  510. package/dist/platform/tools/agent/manager.d.ts.map +1 -1
  511. package/dist/platform/tools/agent/manager.js +13 -7
  512. package/dist/platform/tools/agent/schema.d.ts +26 -0
  513. package/dist/platform/tools/agent/schema.d.ts.map +1 -1
  514. package/dist/platform/tools/agent/schema.js +2 -2
  515. package/dist/platform/tools/agent/wrfc-batch-policy.d.ts +13 -0
  516. package/dist/platform/tools/agent/wrfc-batch-policy.d.ts.map +1 -1
  517. package/dist/platform/tools/agent/wrfc-batch-policy.js +60 -0
  518. package/dist/platform/tools/exec/runtime.d.ts +10 -0
  519. package/dist/platform/tools/exec/runtime.d.ts.map +1 -1
  520. package/dist/platform/tools/exec/runtime.js +27 -10
  521. package/dist/platform/tools/exec/schema.d.ts +2 -2
  522. package/dist/platform/tools/exec/schema.d.ts.map +1 -1
  523. package/dist/platform/tools/exec/schema.js +2 -1
  524. package/dist/platform/tools/fetch/runtime.d.ts +1 -1
  525. package/dist/platform/tools/index.d.ts +2 -0
  526. package/dist/platform/tools/index.d.ts.map +1 -1
  527. package/dist/platform/tools/index.js +2 -0
  528. package/dist/platform/tools/registry.d.ts +1 -1
  529. package/dist/platform/tools/registry.js +1 -1
  530. package/dist/platform/tools/state/index.d.ts +9 -0
  531. package/dist/platform/tools/state/index.d.ts.map +1 -1
  532. package/dist/platform/tools/state/index.js +60 -3
  533. package/dist/platform/types/foundation-contract.d.ts +1 -1
  534. package/dist/platform/types/foundation-contract.d.ts.map +1 -1
  535. package/dist/platform/types/index.d.ts +1 -1
  536. package/dist/platform/types/index.d.ts.map +1 -1
  537. package/dist/platform/types/tools.d.ts +1 -1
  538. package/dist/platform/utils/request-body.d.ts.map +1 -1
  539. package/dist/platform/utils/request-body.js +50 -5
  540. package/dist/platform/version.js +1 -1
  541. package/package.json +25 -9
  542. package/dist/platform/control-plane/routes/automation.d.ts +0 -3
  543. package/dist/platform/control-plane/routes/automation.d.ts.map +0 -1
  544. package/dist/platform/control-plane/routes/automation.js +0 -63
  545. package/dist/platform/control-plane/routes/context.d.ts +0 -2
  546. package/dist/platform/control-plane/routes/context.d.ts.map +0 -1
  547. package/dist/platform/control-plane/routes/context.js +0 -1
  548. package/dist/platform/control-plane/routes/operator.d.ts +0 -8
  549. package/dist/platform/control-plane/routes/operator.d.ts.map +0 -1
  550. package/dist/platform/control-plane/routes/operator.js +0 -415
  551. package/dist/platform/control-plane/routes/remote.d.ts +0 -3
  552. package/dist/platform/control-plane/routes/remote.d.ts.map +0 -1
  553. package/dist/platform/control-plane/routes/remote.js +0 -35
  554. package/dist/platform/control-plane/routes/sessions.d.ts +0 -3
  555. package/dist/platform/control-plane/routes/sessions.d.ts.map +0 -1
  556. package/dist/platform/control-plane/routes/sessions.js +0 -43
  557. package/dist/platform/control-plane/routes/tasks.d.ts +0 -3
  558. package/dist/platform/control-plane/routes/tasks.d.ts.map +0 -1
  559. package/dist/platform/control-plane/routes/tasks.js +0 -22
@@ -8,7 +8,8 @@ import type { AdaptivePlanner } from './adaptive-planner.js';
8
8
  import type { ExecutionPlanManager } from './execution-plan.js';
9
9
  import type { SessionMemoryStore } from './session-memory.js';
10
10
  import type { FavoritesStore } from '../providers/favorites.js';
11
- import type { TurnKnowledgeRegistrySource } from '../agents/turn-knowledge-injection.js';
11
+ import type { TurnKnowledgeRegistrySource, TurnCodeIndexSource } from '../agents/turn-knowledge-injection.js';
12
+ import type { CodeIndexReindexScheduler } from '../state/code-index-reindex.js';
12
13
  export type OrchestratorCoreServices = {
13
14
  configManager?: Pick<ConfigManager, 'get' | 'getCategory' | 'getWorkingDirectory'> | undefined;
14
15
  providerRegistry?: ProviderRegistry | undefined;
@@ -20,15 +21,34 @@ export type OrchestratorCoreServices = {
20
21
  sessionMemoryStore?: Pick<SessionMemoryStore, 'list'> | undefined;
21
22
  favoritesStore?: Pick<FavoritesStore, 'recordUsage'> | undefined;
22
23
  /**
23
- * Wave-5 (wo805) narrow injection seam for the MAIN interactive session's per-turn
24
+ * Narrow injection seam for the MAIN interactive session's per-turn
24
25
  * passive knowledge injection (see core/orchestrator-turn-loop.ts). Optional/undefined
25
26
  * is a hard no-op — the feature never runs and the base system prompt is
26
- * byte-identical, matching the agent path's (wo801) `memoryRegistry` semantics. Wired
27
+ * byte-identical, matching the agent path's `memoryRegistry` semantics. Wired
27
28
  * in post-construction via `Orchestrator.setCoreServices({ memoryRegistry })` since,
28
29
  * like `sessionMemoryStore`/`planManager` above, it is not required at construction
29
30
  * time.
30
31
  */
31
32
  memoryRegistry?: TurnKnowledgeRegistrySource | undefined;
33
+ /**
34
+ * Stage B code-index injection seam for the MAIN interactive session. Optional/
35
+ * undefined is a hard no-op (memory-only injection, base prompt byte-identical). Whether code
36
+ * hits are actually injected is additionally gated by the `agent-passive-code-injection`
37
+ * feature flag (DEFAULT OFF) and `isCodeInjectionSettingEnabled` below — both must hold.
38
+ */
39
+ codeIndex?: TurnCodeIndexSource | undefined;
40
+ /**
41
+ * Live gate for the embedder's storage.codeIndexEnabled setting. Undefined defaults to
42
+ * "allowed" — the feature flag alone then governs. ANDed with the flag each turn so a runtime
43
+ * toggle of either takes effect without reconstructing the orchestrator.
44
+ */
45
+ isCodeInjectionSettingEnabled?: (() => boolean) | undefined;
46
+ /**
47
+ * Stage B tool-site reindex scheduler. Optional/undefined is a hard no-op. When wired,
48
+ * a successful write/edit tool call schedules a debounced incremental reindex of the touched
49
+ * path(s) (never blocking the tool result).
50
+ */
51
+ codeIndexReindexScheduler?: Pick<CodeIndexReindexScheduler, 'onToolExecuted'> | undefined;
32
52
  };
33
53
  export declare function normalizeUsage(usage: Awaited<ReturnType<LLMProvider['chat']>>['usage']): Awaited<ReturnType<LLMProvider['chat']>>['usage'];
34
54
  export declare function estimateFreshTurnInputTokens(lastInputTokens: number, currentEstimatedTokens: number, text: string, content?: ContentPart[]): number;
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrator-runtime.d.ts","sourceRoot":"","sources":["../../../src/platform/core/orchestrator-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAA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,EAAE,qBAAqB,GAChD,qBAAqB,CAEvB;AAED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,wBAAwB,EAClC,qBAAqB,EAAE,gBAAgB,GACtC,gBAAgB,CAElB;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,wBAAwB,GACjC,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,aAAa,GAAG,qBAAqB,CAAC,CAKpE;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,wBAAwB,GAAG,gBAAgB,CAK5F;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,wBAAwB,EAClC,oBAAoB,EAAE,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,GACxD,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,CAErC;AAED,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO,8BAA8B,EAAE,cAAc,CAMvD"}
@@ -19,6 +19,13 @@ export type ToolExecutionDeps = {
19
19
  runtimeBus: RuntimeEventBus | null;
20
20
  sessionId: string;
21
21
  emitterContext: EmitterContextFactory;
22
+ /**
23
+ * Stage B: called once per executed tool with (toolName, resolved args, success) so a
24
+ * code-index reindex scheduler can debounce an incremental reindex of touched files. Invoked
25
+ * for BOTH success and failure (the scheduler no-ops on failure); never awaited — it must not
26
+ * block the tool-result path.
27
+ */
28
+ onToolExecuted?: ((toolName: string, args: Record<string, unknown>, success: boolean) => void) | undefined;
22
29
  };
23
30
  export declare function executeToolCalls(deps: ToolExecutionDeps, turnId: string, calls: ToolCall[]): Promise<ToolResult[]>;
24
31
  export type ReconciliationDeps = {
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrator-tool-runtime.d.ts","sourceRoot":"","sources":["../../../src/platform/core/orchestrator-tool-runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAiB,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,KAAK,E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,GAAG,IAAW,GAClE,MAAM,EAAE,CA4GV"}
@@ -246,6 +246,16 @@ export async function executeToolCalls(deps, turnId, calls) {
246
246
  // leave result as-is
247
247
  }
248
248
  }
249
+ if (deps.onToolExecuted) {
250
+ // Fire-and-forget: the scheduler only records a debounce timer; it must never block the
251
+ // tool-result path. Args are the ones actually executed (post-permission modification).
252
+ try {
253
+ deps.onToolExecuted(call.name, checkResult.modifiedArgs ?? call.arguments, result.success === true);
254
+ }
255
+ catch (err) {
256
+ logger.warn('onToolExecuted hook error', { tool: call.name, error: summarizeError(err) });
257
+ }
258
+ }
249
259
  results.push(result);
250
260
  }
251
261
  return results;
@@ -13,7 +13,7 @@ import type { ModelDefinition } from '../providers/registry.js';
13
13
  import type { FavoritesStore } from '../providers/favorites.js';
14
14
  import type { AgentManager } from '../tools/agent/index.js';
15
15
  import type { ExecutionPlanManager } from './execution-plan.js';
16
- import { type TurnInjectionRecord, type TurnKnowledgeRegistrySource } from '../agents/turn-knowledge-injection.js';
16
+ import { type TurnInjectionRecord, type TurnKnowledgeRegistrySource, type TurnCodeIndexSource } from '../agents/turn-knowledge-injection.js';
17
17
  interface HookDispatcherLike {
18
18
  fire(event: HookEvent): Promise<HookResult>;
19
19
  }
@@ -60,10 +60,10 @@ export interface OrchestratorTurnLoopContext {
60
60
  cacheWrite: number;
61
61
  };
62
62
  /**
63
- * Wave-5 (wo805) per-turn passive-injection wiring for the MAIN interactive session —
64
- * the sibling of wo801's agents/orchestrator-runner.ts runAgentTask wiring, gated on the
65
- * SAME `agent-passive-knowledge-injection` feature flag (its description already
66
- * promised "the EVOLVING main-session conversation" coverage; see
63
+ * Per-turn passive-injection wiring for the MAIN interactive session —
64
+ * the sibling of the agent-runner's runAgentTask wiring in agents/orchestrator-runner.ts,
65
+ * gated on the SAME `agent-passive-knowledge-injection` feature flag (its description
66
+ * already promised "the EVOLVING main-session conversation" coverage; see
67
67
  * runtime/feature-flags/flags.ts). `memoryRegistry` undefined is a hard no-op, matching
68
68
  * the agent path. Budget/floor default to the same derived defaults
69
69
  * (defaultTurnKnowledgeBudgetTokens / DEFAULT_TURN_KNOWLEDGE_RELEVANCE_FLOOR) when
@@ -73,10 +73,17 @@ export interface OrchestratorTurnLoopContext {
73
73
  readonly isPassiveKnowledgeInjectionEnabled: () => boolean;
74
74
  readonly passiveKnowledgeInjectionBudgetTokens?: number | undefined;
75
75
  readonly passiveKnowledgeInjectionRelevanceFloor?: number | undefined;
76
+ /**
77
+ * Stage B — repo code index for the main session's per-turn injection. Undefined is a
78
+ * hard no-op. `isPassiveCodeInjectionEnabled` resolves the combined gate (flag AND setting);
79
+ * both it and the source must be present for code hits to be considered this turn.
80
+ */
81
+ readonly codeIndex?: TurnCodeIndexSource | undefined;
82
+ readonly isPassiveCodeInjectionEnabled: () => boolean;
76
83
  /**
77
84
  * The main session has no spawn-time `AgentRecord.knowledgeInjections` baseline, so this
78
85
  * starts empty and grows monotonically for the life of the Orchestrator — no record is
79
- * ever surfaced twice across the whole interactive session (mirrors wo801's
86
+ * ever surfaced twice across the whole interactive session (mirrors the agent-runner's
80
87
  * knowledgeIdsAlreadySurfaced, but session-lifetime instead of one-agent-run-lifetime).
81
88
  */
82
89
  readonly getAlreadyInjectedKnowledgeIds: () => readonly string[];
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrator-turn-loop.d.ts","sourceRoot":"","sources":["../../../src/platform/core/orchestrator-turn-loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,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AAC;IACF;;;;;;;;;OASG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,2BAA2B,GAAG,SAAS,CAAC;IAClE,QAAQ,CAAC,kCAAkC,EAAE,MAAM,OAAO,CAAC;IAC3D,QAAQ,CAAC,qCAAqC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpE,QAAQ,CAAC,uCAAuC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtE;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACrD,QAAQ,CAAC,6BAA6B,EAAE,MAAM,OAAO,CAAC;IACtD;;;;;OAKG;IACH,QAAQ,CAAC,8BAA8B,EAAE,MAAM,SAAS,MAAM,EAAE,CAAC;IACjE,QAAQ,CAAC,uBAAuB,EAAE,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;IACnE,uFAAuF;IACvF,QAAQ,CAAC,4BAA4B,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC7E,wFAAwF;IACxF,QAAQ,CAAC,yBAAyB,EAAE,MAAM,MAAM,CAAC;CAClD;AAED,wBAAsB,2BAA2B,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAserG"}
@@ -11,13 +11,13 @@ import { buildWrfcWorkflowRoutingPrompt } from './wrfc-routing.js';
11
11
  import { buildPerTurnKnowledgeInjection, defaultTurnKnowledgeBudgetTokens, DEFAULT_TURN_KNOWLEDGE_RELEVANCE_FLOOR, } from '../agents/turn-knowledge-injection.js';
12
12
  const AUTO_SPAWN_FALLBACK_DELAY_MS = 5_000;
13
13
  /**
14
- * Wave-5 (wo805) per-turn passive-injection headroom clamp for the MAIN interactive
14
+ * Per-turn passive-injection headroom clamp for the MAIN interactive
15
15
  * session. Mirrors agents/orchestrator-runner.ts's CONTEXT_COMPACT_THRESHOLD (0.85) —
16
16
  * deliberately NOT derived from this loop's own configurable `behavior.autoCompactThreshold`
17
17
  * (default 80, see config/schema-domain-core.ts), which governs CONVERSATION compaction and
18
18
  * can be user-tuned or disabled (0) independently of this feature. Keeping this fixed keeps
19
- * the injection block's safety margin identical to wo801's regardless of what the operator
20
- * has configured for compaction.
19
+ * the injection block's safety margin identical to the agent-runner's regardless of what the
20
+ * operator has configured for compaction.
21
21
  */
22
22
  const PASSIVE_KNOWLEDGE_INJECTION_CONTEXT_THRESHOLD = 0.85;
23
23
  export async function executeOrchestratorTurnLoop(context) {
@@ -28,13 +28,13 @@ export async function executeOrchestratorTurnLoop(context) {
28
28
  const streamEnabled = context.configManager.get('display.stream');
29
29
  let continueLoop = true;
30
30
  const circuitBreaker = new ConsecutiveErrorBreaker();
31
- // Wave-5 (wo805): true only for the FIRST LLM call this executeOrchestratorTurnLoop()
31
+ // True only for the FIRST LLM call this executeOrchestratorTurnLoop()
32
32
  // invocation makes (see the per-iteration gate below for why this is the main loop's
33
- // analog of wo801's "new user input this turn").
33
+ // analog of the agent-runner's "new user input this turn").
34
34
  let isFirstIterationOfThisCall = true;
35
- // Wave-5 (wo805): the last successfully-built per-turn knowledge block, reused verbatim
35
+ // The last successfully-built per-turn knowledge block, reused verbatim
36
36
  // on tool-continuation iterations of THIS call where nothing new arrived (mirrors
37
- // wo801's priorTurnKnowledgeBlock) — declared OUTSIDE the while loop so a block built on
37
+ // the agent-runner's priorTurnKnowledgeBlock) — declared OUTSIDE the while loop so a block built on
38
38
  // iteration 1 (the human message that started this runTurn()) stays available to every
39
39
  // later tool round of the SAME call, not just the first LLM call. It is composed onto
40
40
  // the CURRENT `composedBaseSystemPrompt` fresh every iteration (see
@@ -124,17 +124,18 @@ export async function executeOrchestratorTurnLoop(context) {
124
124
  break;
125
125
  }
126
126
  }
127
- // Wave-5 (wo805): per-turn passive knowledge injection for the MAIN interactive
128
- // session — the missing counterpart to wo801's agents/orchestrator-runner.ts wiring.
129
- // `newUserInputThisTurn` mirrors wo801's turn-1/steer-drain gate: it is true exactly
130
- // on the FIRST LLM call this executeOrchestratorTurnLoop() invocation makes (the fresh
131
- // human message this runTurn() call was invoked with) and false on every subsequent
132
- // tool-continuation iteration of the SAME call, since the main session never drains
133
- // new human input mid-call (handleUserInput queues a second message until the current
134
- // runTurn() completes see orchestrator.ts). Retrieval reruns only when
135
- // newUserInputThisTurn is true; tool-continuation iterations reuse `turnKnowledgeBlock`
136
- // as-is (declared before the while loop) exactly wo801's reuse behavior for
137
- // no-new-input turns, just with a different trigger for what counts as "new".
127
+ // Per-turn passive knowledge injection for the MAIN interactive
128
+ // session — the missing counterpart to the agent-runner's wiring in
129
+ // agents/orchestrator-runner.ts. `newUserInputThisTurn` mirrors the agent-runner's
130
+ // turn-1/steer-drain gate: it is true exactly on the FIRST LLM call this
131
+ // executeOrchestratorTurnLoop() invocation makes (the fresh human message this
132
+ // runTurn() call was invoked with) and false on every subsequent tool-continuation
133
+ // iteration of the SAME call, since the main session never drains new human input
134
+ // mid-call (handleUserInput queues a second message until the current runTurn()
135
+ // completes see orchestrator.ts). Retrieval reruns only when newUserInputThisTurn
136
+ // is true; tool-continuation iterations reuse `turnKnowledgeBlock` as-is (declared
137
+ // before the while loop) exactly the agent-runner's reuse behavior for no-new-input
138
+ // turns, just with a different trigger for what counts as "new".
138
139
  const newUserInputThisTurn = isFirstIterationOfThisCall;
139
140
  isFirstIterationOfThisCall = false;
140
141
  const passiveKnowledgeInjectionEnabled = context.isPassiveKnowledgeInjectionEnabled();
@@ -165,6 +166,10 @@ export async function executeOrchestratorTurnLoop(context) {
165
166
  }
166
167
  if (turnBudgetTokens > 0) {
167
168
  const relevanceFloor = context.passiveKnowledgeInjectionRelevanceFloor ?? DEFAULT_TURN_KNOWLEDGE_RELEVANCE_FLOOR;
169
+ // Stage B: code hits share this turn's SAME budget/floor. Gated on the separate
170
+ // (default-off) code-injection flag AND the embedder's storage.codeIndexEnabled
171
+ // setting, both folded into isPassiveCodeInjectionEnabled by the orchestrator.
172
+ const codeInjectionEnabled = !!context.codeIndex && context.isPassiveCodeInjectionEnabled();
168
173
  const { block, record: turnInjectionRecord } = buildPerTurnKnowledgeInjection({
169
174
  memoryRegistry: context.memoryRegistry,
170
175
  // The main session has no frozen "task" distinct from the live conversation —
@@ -172,13 +177,15 @@ export async function executeOrchestratorTurnLoop(context) {
172
177
  // is also the latest user-role message already appended to the conversation
173
178
  // before the loop started (see prepareConversationForTurn), so
174
179
  // deriveTurnKnowledgeQuery collapses to it with no duplication — the same
175
- // turn-1 behavior wo801 documents for the agent path.
180
+ // turn-1 behavior documented for the agent path.
176
181
  task: context.text,
177
182
  conversationTail: context.conversation.getMessagesForLLM(),
178
183
  budgetTokens: turnBudgetTokens,
179
184
  relevanceFloor,
180
185
  alreadyInjectedIds: context.getAlreadyInjectedKnowledgeIds(),
181
186
  turn: context.nextTurnKnowledgeSequence(),
187
+ codeIndex: context.codeIndex,
188
+ codeInjectionEnabled,
182
189
  });
183
190
  turnKnowledgeBlock = block;
184
191
  if (turnInjectionRecord.injectedIds.length > 0) {
@@ -190,14 +197,14 @@ export async function executeOrchestratorTurnLoop(context) {
190
197
  // Hard no-op: no budget headroom this call. Never call into retrieval for a
191
198
  // budget already known to be zero, and never keep claiming a stale block from an
192
199
  // earlier iteration that no longer fits — clear it so composeTurnSystemPrompt
193
- // falls back to the base prompt exactly (mirrors wo801's identical branch).
200
+ // falls back to the base prompt exactly (mirrors the agent-runner's identical branch).
194
201
  turnKnowledgeBlock = null;
195
202
  }
196
203
  }
197
204
  // Composed fresh at the call site (never a hoisted `const` reused across calls) so the
198
205
  // block is re-validated against LIVE tokens at the instant it is actually sent — the
199
- // same "never mutate the cached base, recompute at the call site" discipline wo801's
200
- // composeTurnSystemPrompt established, even though this loop has no in-call
206
+ // same "never mutate the cached base, recompute at the call site" discipline the
207
+ // agent-runner's composeTurnSystemPrompt established, even though this loop has no in-call
201
208
  // context-exceeded retry path to go stale across (compaction here is the PROACTIVE
202
209
  // checkContextWindowPreflight above, not a reactive mid-call retry-and-shrink).
203
210
  const composeTurnSystemPrompt = (base) => {
@@ -68,14 +68,14 @@ export interface OrchestratorOptions {
68
68
  */
69
69
  sessionId?: string | undefined;
70
70
  /**
71
- * Wave-5 (wo805) per-turn passive-injection budget override for the main session,
71
+ * Per-turn passive-injection budget override for the main session,
72
72
  * mirroring agents/orchestrator-runner.ts's `passiveKnowledgeInjectionBudgetTokens`.
73
73
  * Omitted uses the derived default (defaultTurnKnowledgeBudgetTokens). `0` is a hard
74
74
  * no-op, independent of the feature flag's own state.
75
75
  */
76
76
  passiveKnowledgeInjectionBudgetTokens?: number | undefined;
77
77
  /**
78
- * Wave-5 (wo805) per-turn passive-injection relevance-floor override for the main
78
+ * Per-turn passive-injection relevance-floor override for the main
79
79
  * session, mirroring agents/orchestrator-runner.ts's
80
80
  * `passiveKnowledgeInjectionRelevanceFloor`. Omitted uses DEFAULT_TURN_KNOWLEDGE_RELEVANCE_FLOOR.
81
81
  */
@@ -184,7 +184,7 @@ export declare class Orchestrator {
184
184
  private getSystemPrompt;
185
185
  private hookDispatcher;
186
186
  /**
187
- * Wave-5 (wo805) per-turn passive-injection state for the MAIN interactive session —
187
+ * Per-turn passive-injection state for the MAIN interactive session —
188
188
  * see core/orchestrator-turn-loop.ts for the retrieval/budget wiring that reads and
189
189
  * mutates these. `turnKnowledgeIdsAlreadySurfaced` has no spawn-time baseline (unlike
190
190
  * an AgentRecord's `knowledgeInjections`) so it starts empty and grows monotonically
@@ -225,9 +225,9 @@ export declare class Orchestrator {
225
225
  registerDelegateTool(manager: AcpManager): void;
226
226
  getSpinner(): string;
227
227
  /**
228
- * Wave-5 (wo805): bounded ring of per-turn passive-injection honesty records for the
228
+ * Bounded ring of per-turn passive-injection honesty records for the
229
229
  * MAIN interactive session — the main-session counterpart to `AgentRecord.turnInjections`
230
- * (wo801). There is no AgentRecord for the primary conversation, so this is the exact
230
+ * on the agent path. There is no AgentRecord for the primary conversation, so this is the exact
231
231
  * accessor a `/recall`-style renderer should read as the main-session default when no
232
232
  * agent id is given. See agents/turn-knowledge-injection.ts for the record shape and
233
233
  * recordTurnInjection for the ring-eviction policy (same bounded size as the agent path).
@@ -304,7 +304,7 @@ export declare class Orchestrator {
304
304
  */
305
305
  private isReconciliationEnabled;
306
306
  /**
307
- * Returns `true` when Wave-5 (wo801/wo805) per-turn passive knowledge injection is
307
+ * Returns `true` when per-turn passive knowledge injection is
308
308
  * active for this session. Shares the SAME `agent-passive-knowledge-injection` flag as
309
309
  * the agent path (agents/orchestrator-runner.ts) rather than a sibling main-session
310
310
  * flag — the flag's own description already promises "the EVOLVING main-session
@@ -317,16 +317,22 @@ export declare class Orchestrator {
317
317
  */
318
318
  private isPassiveKnowledgeInjectionEnabled;
319
319
  /**
320
- * Wave-5 (wo805): ids never to re-surface in a later per-turn knowledge block. The main
320
+ * Stage B code injection is opt-in: the `agent-passive-code-injection` flag defaults OFF
321
+ * (so a null flagManager means OFF, unlike the memory flag above), AND the embedder's
322
+ * storage.codeIndexEnabled setting must be on. Both are re-read per turn.
323
+ */
324
+ private isPassiveCodeInjectionEnabled;
325
+ /**
326
+ * Ids never to re-surface in a later per-turn knowledge block. The main
321
327
  * session has no spawn-time `AgentRecord.knowledgeInjections` baseline, so this starts
322
328
  * empty and grows monotonically for the life of the Orchestrator.
323
329
  */
324
330
  private getAlreadyInjectedKnowledgeIds;
325
- /** Wave-5 (wo805): mark ids as surfaced so they are never listed twice this session. */
331
+ /** Mark ids as surfaced so they are never listed twice this session. */
326
332
  private addInjectedKnowledgeIds;
327
- /** Wave-5 (wo805): append one honesty record to the bounded ring behind {@link getTurnInjections}. */
333
+ /** Append one honesty record to the bounded ring behind {@link getTurnInjections}. */
328
334
  private recordTurnKnowledgeInjection;
329
- /** Wave-5 (wo805): monotonic per-Orchestrator-lifetime sequence number for TurnInjectionRecord.turn. */
335
+ /** Monotonic per-Orchestrator-lifetime sequence number for TurnInjectionRecord.turn. */
330
336
  private nextTurnKnowledgeSequence;
331
337
  /**
332
338
  * Reconcile unresol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;IAK1C;;;;OAIG;IACH,OAAO,CAAC,6BAA6B;IAMrC;;;;OAIG;IACH,OAAO,CAAC,8BAA8B;IAItC,wEAAwE;IACxE,OAAO,CAAC,uBAAuB;IAI/B,sFAAsF;IACtF,OAAO,CAAC,4BAA4B;IAIpC,wFAAwF;IACxF,OAAO,CAAC,yBAAyB;IAIjC;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,4BAA4B;YAetB,gBAAgB;CAa/B"}
@@ -113,7 +113,7 @@ export class Orchestrator {
113
113
  getSystemPrompt;
114
114
  hookDispatcher;
115
115
  /**
116
- * Wave-5 (wo805) per-turn passive-injection state for the MAIN interactive session —
116
+ * Per-turn passive-injection state for the MAIN interactive session —
117
117
  * see core/orchestrator-turn-loop.ts for the retrieval/budget wiring that reads and
118
118
  * mutates these. `turnKnowledgeIdsAlreadySurfaced` has no spawn-time baseline (unlike
119
119
  * an AgentRecord's `knowledgeInjections`) so it starts empty and grows monotonically
@@ -267,9 +267,9 @@ export class Orchestrator {
267
267
  return THINKING_SPINNER_FRAMES[this.thinkingFrame % THINKING_SPINNER_FRAMES.length];
268
268
  }
269
269
  /**
270
- * Wave-5 (wo805): bounded ring of per-turn passive-injection honesty records for the
270
+ * Bounded ring of per-turn passive-injection honesty records for the
271
271
  * MAIN interactive session — the main-session counterpart to `AgentRecord.turnInjections`
272
- * (wo801). There is no AgentRecord for the primary conversation, so this is the exact
272
+ * on the agent path. There is no AgentRecord for the primary conversation, so this is the exact
273
273
  * accessor a `/recall`-style renderer should read as the main-session default when no
274
274
  * agent id is given. See agents/turn-knowledge-injection.ts for the record shape and
275
275
  * recordTurnInjection for the ring-eviction policy (same bounded size as the agent path).
@@ -536,6 +536,8 @@ export class Orchestrator {
536
536
  isPassiveKnowledgeInjectionEnabled: () => this.isPassiveKnowledgeInjectionEnabled(),
537
537
  passiveKnowledgeInjectionBudgetTokens: this.passiveKnowledgeInjectionBudgetTokens,
538
538
  passiveKnowledgeInjectionRelevanceFloor: this.passiveKnowledgeInjectionRelevanceFloor,
539
+ codeIndex: this.coreServices.codeIndex,
540
+ isPassiveCodeInjectionEnabled: () => this.isPassiveCodeInjectionEnabled(),
539
541
  getAlreadyInjectedKnowledgeIds: () => this.getAlreadyInjectedKnowledgeIds(),
540
542
  addInjectedKnowledgeIds: (ids) => { this.addInjectedKnowledgeIds(ids); },
541
543
  recordTurnKnowledgeInjection: (record) => { this.recordTurnKnowledgeInjection(record); },
@@ -715,7 +717,7 @@ export class Orchestrator {
715
717
  return this.flagManager.isEnabled('tool-result-reconciliation');
716
718
  }
717
719
  /**
718
- * Returns `true` when Wave-5 (wo801/wo805) per-turn passive knowledge injection is
720
+ * Returns `true` when per-turn passive knowledge injection is
719
721
  * active for this session. Shares the SAME `agent-passive-knowledge-injection` flag as
720
722
  * the agent path (agents/orchestrator-runner.ts) rather than a sibling main-session
721
723
  * flag — the flag's own description already promises "the EVOLVING main-session
@@ -732,23 +734,33 @@ export class Orchestrator {
732
734
  return this.flagManager.isEnabled('agent-passive-knowledge-injection');
733
735
  }
734
736
  /**
735
- * Wave-5 (wo805): ids never to re-surface in a later per-turn knowledge block. The main
737
+ * Stage B code injection is opt-in: the `agent-passive-code-injection` flag defaults OFF
738
+ * (so a null flagManager means OFF, unlike the memory flag above), AND the embedder's
739
+ * storage.codeIndexEnabled setting must be on. Both are re-read per turn.
740
+ */
741
+ isPassiveCodeInjectionEnabled() {
742
+ const flagOn = this.flagManager?.isEnabled('agent-passive-code-injection') ?? false;
743
+ const settingOn = this.coreServices.isCodeInjectionSettingEnabled?.() ?? true;
744
+ return flagOn && settingOn;
745
+ }
746
+ /**
747
+ * Ids never to re-surface in a later per-turn knowledge block. The main
736
748
  * session has no spawn-time `AgentRecord.knowledgeInjections` baseline, so this starts
737
749
  * empty and grows monotonically for the life of the Orchestrator.
738
750
  */
739
751
  getAlreadyInjectedKnowledgeIds() {
740
752
  return [...this.turnKnowledgeIdsAlreadySurfaced];
741
753
  }
742
- /** Wave-5 (wo805): mark ids as surfaced so they are never listed twice this session. */
754
+ /** Mark ids as surfaced so they are never listed twice this session. */
743
755
  addInjectedKnowledgeIds(ids) {
744
756
  for (const id of ids)
745
757
  this.turnKnowledgeIdsAlreadySurfaced.add(id);
746
758
  }
747
- /** Wave-5 (wo805): append one honesty record to the bounded ring behind {@link getTurnInjections}. */
759
+ /** Append one honesty record to the bounded ring behind {@link getTurnInjections}. */
748
760
  recordTurnKnowledgeInjection(record) {
749
761
  this.turnInjectionRing = recordTurnInjection(this.turnInjectionRing, record);
750
762
  }
751
- /** Wave-5 (wo805): monotonic per-Orchestrator-lifetime sequence number for TurnInjectionRecord.turn. */
763
+ /** Monotonic per-Orchestrator-lifetime sequence number for TurnInjectionRecord.turn. */
752
764
  nextTurnKnowledgeSequence() {
753
765
  return ++this.turnKnowledgeSequence;
754
766
  }
@@ -785,6 +797,9 @@ export class Orchestrator {
785
797
  runtimeBus: this.runtimeBus,
786
798
  sessionId: this.sessionId,
787
799
  emitterContext: (id) => createEmitterContext(this.sessionId, id),
800
+ onToolExecuted: this.coreServices.codeIndexReindexScheduler
801
+ ? (toolName, args, success) => this.coreServices.codeIndexReindexScheduler.onToolExecuted(toolName, args, success)
802
+ : undefined,
788
803
  }, turnId, calls);
789
804
  }
790
805
  }