@pellux/goodvibes-sdk 0.38.0 → 1.0.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 (474) hide show
  1. package/dist/contracts/artifacts/operator-contract.json +3171 -929
  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/surfaces.d.ts +25 -3
  6. package/dist/events/surfaces.d.ts.map +1 -1
  7. package/dist/events/surfaces.js +22 -1
  8. package/dist/events/workflows.d.ts +7 -6
  9. package/dist/events/workflows.d.ts.map +1 -1
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/platform/agents/archetypes.d.ts.map +1 -1
  13. package/dist/platform/agents/archetypes.js +7 -0
  14. package/dist/platform/agents/index.d.ts +1 -0
  15. package/dist/platform/agents/index.d.ts.map +1 -1
  16. package/dist/platform/agents/index.js +1 -0
  17. package/dist/platform/agents/orchestrator-runner.d.ts +13 -0
  18. package/dist/platform/agents/orchestrator-runner.d.ts.map +1 -1
  19. package/dist/platform/agents/orchestrator-runner.js +14 -0
  20. package/dist/platform/agents/orchestrator.d.ts +38 -6
  21. package/dist/platform/agents/orchestrator.d.ts.map +1 -1
  22. package/dist/platform/agents/orchestrator.js +66 -18
  23. package/dist/platform/agents/planner-decomposition-runner.d.ts +38 -0
  24. package/dist/platform/agents/planner-decomposition-runner.d.ts.map +1 -0
  25. package/dist/platform/agents/planner-decomposition-runner.js +113 -0
  26. package/dist/platform/agents/turn-knowledge-injection.d.ts +88 -3
  27. package/dist/platform/agents/turn-knowledge-injection.d.ts.map +1 -1
  28. package/dist/platform/agents/turn-knowledge-injection.js +147 -30
  29. package/dist/platform/agents/worktree.d.ts +126 -8
  30. package/dist/platform/agents/worktree.d.ts.map +1 -1
  31. package/dist/platform/agents/worktree.js +240 -19
  32. package/dist/platform/agents/wrfc-controller.d.ts +23 -0
  33. package/dist/platform/agents/wrfc-controller.d.ts.map +1 -1
  34. package/dist/platform/agents/wrfc-controller.js +158 -32
  35. package/dist/platform/agents/wrfc-gate-runtime.d.ts +9 -0
  36. package/dist/platform/agents/wrfc-gate-runtime.d.ts.map +1 -1
  37. package/dist/platform/agents/wrfc-gate-runtime.js +7 -3
  38. package/dist/platform/agents/wrfc-gates.d.ts +1 -1
  39. package/dist/platform/agents/wrfc-gates.d.ts.map +1 -1
  40. package/dist/platform/agents/wrfc-gates.js +7 -1
  41. package/dist/platform/agents/wrfc-types.d.ts +23 -3
  42. package/dist/platform/agents/wrfc-types.d.ts.map +1 -1
  43. package/dist/platform/automation/types.d.ts +9 -1
  44. package/dist/platform/automation/types.d.ts.map +1 -1
  45. package/dist/platform/calendar/calendar-api-shared.d.ts +25 -0
  46. package/dist/platform/calendar/calendar-api-shared.d.ts.map +1 -0
  47. package/dist/platform/calendar/calendar-api-shared.js +100 -0
  48. package/dist/platform/calendar/calendar-connector.d.ts +79 -0
  49. package/dist/platform/calendar/calendar-connector.d.ts.map +1 -0
  50. package/dist/platform/calendar/calendar-connector.js +155 -0
  51. package/dist/platform/calendar/google-calendar-api.d.ts +25 -0
  52. package/dist/platform/calendar/google-calendar-api.d.ts.map +1 -0
  53. package/dist/platform/calendar/google-calendar-api.js +89 -0
  54. package/dist/platform/calendar/http-fetch-adapter.d.ts +25 -0
  55. package/dist/platform/calendar/http-fetch-adapter.d.ts.map +1 -0
  56. package/dist/platform/calendar/http-fetch-adapter.js +25 -0
  57. package/dist/platform/calendar/ics-parser.d.ts +35 -0
  58. package/dist/platform/calendar/ics-parser.d.ts.map +1 -0
  59. package/dist/platform/calendar/ics-parser.js +236 -0
  60. package/dist/platform/calendar/index.d.ts +41 -0
  61. package/dist/platform/calendar/index.d.ts.map +1 -0
  62. package/dist/platform/calendar/index.js +49 -0
  63. package/dist/platform/calendar/merged-calendar-model.d.ts +67 -0
  64. package/dist/platform/calendar/merged-calendar-model.d.ts.map +1 -0
  65. package/dist/platform/calendar/merged-calendar-model.js +181 -0
  66. package/dist/platform/calendar/microsoft-graph-api.d.ts +25 -0
  67. package/dist/platform/calendar/microsoft-graph-api.d.ts.map +1 -0
  68. package/dist/platform/calendar/microsoft-graph-api.js +95 -0
  69. package/dist/platform/calendar/oauth-flow.d.ts +62 -0
  70. package/dist/platform/calendar/oauth-flow.d.ts.map +1 -0
  71. package/dist/platform/calendar/oauth-flow.js +305 -0
  72. package/dist/platform/calendar/oauth-providers.d.ts +43 -0
  73. package/dist/platform/calendar/oauth-providers.d.ts.map +1 -0
  74. package/dist/platform/calendar/oauth-providers.js +120 -0
  75. package/dist/platform/calendar/oauth-token-store.d.ts +72 -0
  76. package/dist/platform/calendar/oauth-token-store.d.ts.map +1 -0
  77. package/dist/platform/calendar/oauth-token-store.js +189 -0
  78. package/dist/platform/calendar/oauth-types.d.ts +274 -0
  79. package/dist/platform/calendar/oauth-types.d.ts.map +1 -0
  80. package/dist/platform/calendar/oauth-types.js +22 -0
  81. package/dist/platform/calendar/rrule.d.ts +39 -0
  82. package/dist/platform/calendar/rrule.d.ts.map +1 -0
  83. package/dist/platform/calendar/rrule.js +261 -0
  84. package/dist/platform/calendar/subscription-store.d.ts +118 -0
  85. package/dist/platform/calendar/subscription-store.d.ts.map +1 -0
  86. package/dist/platform/calendar/subscription-store.js +293 -0
  87. package/dist/platform/calendar/types.d.ts +170 -0
  88. package/dist/platform/calendar/types.d.ts.map +1 -0
  89. package/dist/platform/calendar/types.js +21 -0
  90. package/dist/platform/companion/companion-chat-attachments.d.ts +29 -0
  91. package/dist/platform/companion/companion-chat-attachments.d.ts.map +1 -0
  92. package/dist/platform/companion/companion-chat-attachments.js +121 -0
  93. package/dist/platform/companion/companion-chat-broker-bridge.d.ts +40 -0
  94. package/dist/platform/companion/companion-chat-broker-bridge.d.ts.map +1 -0
  95. package/dist/platform/companion/companion-chat-broker-bridge.js +14 -0
  96. package/dist/platform/companion/companion-chat-broker-sync.d.ts +38 -0
  97. package/dist/platform/companion/companion-chat-broker-sync.d.ts.map +1 -0
  98. package/dist/platform/companion/companion-chat-broker-sync.js +80 -0
  99. package/dist/platform/companion/companion-chat-gc.d.ts +63 -0
  100. package/dist/platform/companion/companion-chat-gc.d.ts.map +1 -0
  101. package/dist/platform/companion/companion-chat-gc.js +38 -0
  102. package/dist/platform/companion/companion-chat-manager.d.ts +67 -20
  103. package/dist/platform/companion/companion-chat-manager.d.ts.map +1 -1
  104. package/dist/platform/companion/companion-chat-manager.js +130 -144
  105. package/dist/platform/companion/companion-chat-persistence.d.ts +9 -1
  106. package/dist/platform/companion/companion-chat-persistence.d.ts.map +1 -1
  107. package/dist/platform/companion/companion-chat-persistence.js +10 -2
  108. package/dist/platform/companion/companion-chat-routes.d.ts +2 -1
  109. package/dist/platform/companion/companion-chat-routes.d.ts.map +1 -1
  110. package/dist/platform/companion/companion-chat-routes.js +37 -4
  111. package/dist/platform/config/credential-status.d.ts +28 -0
  112. package/dist/platform/config/credential-status.d.ts.map +1 -0
  113. package/dist/platform/config/credential-status.js +75 -0
  114. package/dist/platform/config/index.d.ts +25 -0
  115. package/dist/platform/config/index.d.ts.map +1 -1
  116. package/dist/platform/config/index.js +18 -0
  117. package/dist/platform/config/manager.d.ts +9 -0
  118. package/dist/platform/config/manager.d.ts.map +1 -1
  119. package/dist/platform/config/manager.js +21 -2
  120. package/dist/platform/config/migrations.d.ts +48 -0
  121. package/dist/platform/config/migrations.d.ts.map +1 -0
  122. package/dist/platform/config/migrations.js +54 -0
  123. package/dist/platform/config/schema-domain-core.d.ts +10 -1
  124. package/dist/platform/config/schema-domain-core.d.ts.map +1 -1
  125. package/dist/platform/config/schema-domain-core.js +46 -3
  126. package/dist/platform/config/schema-types.d.ts +13 -7
  127. package/dist/platform/config/schema-types.d.ts.map +1 -1
  128. package/dist/platform/config/schema.d.ts.map +1 -1
  129. package/dist/platform/config/schema.js +2 -0
  130. package/dist/platform/control-plane/approval-broker.d.ts +11 -0
  131. package/dist/platform/control-plane/approval-broker.d.ts.map +1 -1
  132. package/dist/platform/control-plane/approval-broker.js +17 -1
  133. package/dist/platform/control-plane/approval-hunk-apply.d.ts +77 -0
  134. package/dist/platform/control-plane/approval-hunk-apply.d.ts.map +1 -0
  135. package/dist/platform/control-plane/approval-hunk-apply.js +80 -0
  136. package/dist/platform/control-plane/gateway-disabled-response.d.ts +20 -0
  137. package/dist/platform/control-plane/gateway-disabled-response.d.ts.map +1 -0
  138. package/dist/platform/control-plane/gateway-disabled-response.js +24 -0
  139. package/dist/platform/control-plane/gateway-scope-enforcement.d.ts +68 -0
  140. package/dist/platform/control-plane/gateway-scope-enforcement.d.ts.map +1 -0
  141. package/dist/platform/control-plane/gateway-scope-enforcement.js +91 -0
  142. package/dist/platform/control-plane/gateway-utils.d.ts +17 -0
  143. package/dist/platform/control-plane/gateway-utils.d.ts.map +1 -1
  144. package/dist/platform/control-plane/gateway-utils.js +30 -0
  145. package/dist/platform/control-plane/gateway.d.ts +12 -2
  146. package/dist/platform/control-plane/gateway.d.ts.map +1 -1
  147. package/dist/platform/control-plane/gateway.js +27 -31
  148. package/dist/platform/control-plane/index.d.ts +6 -1
  149. package/dist/platform/control-plane/index.d.ts.map +1 -1
  150. package/dist/platform/control-plane/index.js +4 -0
  151. package/dist/platform/control-plane/invoke-input-validation.d.ts +56 -0
  152. package/dist/platform/control-plane/invoke-input-validation.d.ts.map +1 -0
  153. package/dist/platform/control-plane/invoke-input-validation.js +163 -0
  154. package/dist/platform/control-plane/method-catalog-admin.d.ts.map +1 -1
  155. package/dist/platform/control-plane/method-catalog-admin.js +12 -1
  156. package/dist/platform/control-plane/method-catalog-calendar.d.ts +16 -0
  157. package/dist/platform/control-plane/method-catalog-calendar.d.ts.map +1 -1
  158. package/dist/platform/control-plane/method-catalog-calendar.js +21 -0
  159. package/dist/platform/control-plane/method-catalog-channels.d.ts.map +1 -1
  160. package/dist/platform/control-plane/method-catalog-channels.js +32 -3
  161. package/dist/platform/control-plane/method-catalog-control-automation.d.ts.map +1 -1
  162. package/dist/platform/control-plane/method-catalog-control-automation.js +19 -34
  163. package/dist/platform/control-plane/method-catalog-control-companion.d.ts +15 -0
  164. package/dist/platform/control-plane/method-catalog-control-companion.d.ts.map +1 -0
  165. package/dist/platform/control-plane/method-catalog-control-companion.js +133 -0
  166. package/dist/platform/control-plane/method-catalog-control-core.d.ts.map +1 -1
  167. package/dist/platform/control-plane/method-catalog-control-core.js +104 -122
  168. package/dist/platform/control-plane/method-catalog-control.d.ts.map +1 -1
  169. package/dist/platform/control-plane/method-catalog-control.js +4 -0
  170. package/dist/platform/control-plane/method-catalog-email.d.ts +17 -0
  171. package/dist/platform/control-plane/method-catalog-email.d.ts.map +1 -1
  172. package/dist/platform/control-plane/method-catalog-email.js +21 -0
  173. package/dist/platform/control-plane/method-catalog-events.d.ts +28 -0
  174. package/dist/platform/control-plane/method-catalog-events.d.ts.map +1 -1
  175. package/dist/platform/control-plane/method-catalog-events.js +74 -1
  176. package/dist/platform/control-plane/method-catalog-fleet.d.ts +24 -0
  177. package/dist/platform/control-plane/method-catalog-fleet.d.ts.map +1 -0
  178. package/dist/platform/control-plane/method-catalog-fleet.js +65 -0
  179. package/dist/platform/control-plane/method-catalog-route-reconcile.d.ts +84 -0
  180. package/dist/platform/control-plane/method-catalog-route-reconcile.d.ts.map +1 -0
  181. package/dist/platform/control-plane/method-catalog-route-reconcile.js +103 -0
  182. package/dist/platform/control-plane/method-catalog-shared.d.ts +29 -0
  183. package/dist/platform/control-plane/method-catalog-shared.d.ts.map +1 -1
  184. package/dist/platform/control-plane/method-catalog.d.ts +9 -0
  185. package/dist/platform/control-plane/method-catalog.d.ts.map +1 -1
  186. package/dist/platform/control-plane/method-catalog.js +32 -3
  187. package/dist/platform/control-plane/operator-contract-schemas-admin.d.ts +8 -0
  188. package/dist/platform/control-plane/operator-contract-schemas-admin.d.ts.map +1 -1
  189. package/dist/platform/control-plane/operator-contract-schemas-admin.js +22 -1
  190. package/dist/platform/control-plane/operator-contract-schemas-fleet.d.ts +18 -0
  191. package/dist/platform/control-plane/operator-contract-schemas-fleet.d.ts.map +1 -0
  192. package/dist/platform/control-plane/operator-contract-schemas-fleet.js +182 -0
  193. package/dist/platform/control-plane/operator-contract-schemas-permissions.d.ts.map +1 -1
  194. package/dist/platform/control-plane/operator-contract-schemas-permissions.js +5 -0
  195. package/dist/platform/control-plane/operator-contract-schemas-runtime.d.ts +29 -0
  196. package/dist/platform/control-plane/operator-contract-schemas-runtime.d.ts.map +1 -1
  197. package/dist/platform/control-plane/operator-contract-schemas-runtime.js +57 -3
  198. package/dist/platform/control-plane/operator-contract-schemas.d.ts +1 -0
  199. package/dist/platform/control-plane/operator-contract-schemas.d.ts.map +1 -1
  200. package/dist/platform/control-plane/operator-contract-schemas.js +1 -0
  201. package/dist/platform/control-plane/operator-contract.d.ts.map +1 -1
  202. package/dist/platform/control-plane/operator-contract.js +8 -0
  203. package/dist/platform/control-plane/routes/checkpoints.d.ts +39 -0
  204. package/dist/platform/control-plane/routes/checkpoints.d.ts.map +1 -0
  205. package/dist/platform/control-plane/routes/checkpoints.js +166 -0
  206. package/dist/platform/control-plane/routes/fleet.d.ts +53 -0
  207. package/dist/platform/control-plane/routes/fleet.d.ts.map +1 -0
  208. package/dist/platform/control-plane/routes/fleet.js +153 -0
  209. package/dist/platform/control-plane/routes/gateway-verb-error.d.ts +30 -0
  210. package/dist/platform/control-plane/routes/gateway-verb-error.d.ts.map +1 -0
  211. package/dist/platform/control-plane/routes/gateway-verb-error.js +36 -0
  212. package/dist/platform/control-plane/routes/index.d.ts +0 -6
  213. package/dist/platform/control-plane/routes/index.d.ts.map +1 -1
  214. package/dist/platform/control-plane/routes/index.js +5 -5
  215. package/dist/platform/control-plane/routes/invocation-params.d.ts +23 -0
  216. package/dist/platform/control-plane/routes/invocation-params.d.ts.map +1 -0
  217. package/dist/platform/control-plane/routes/invocation-params.js +9 -0
  218. package/dist/platform/control-plane/routes/register-w3-s2.d.ts +26 -0
  219. package/dist/platform/control-plane/routes/register-w3-s2.d.ts.map +1 -0
  220. package/dist/platform/control-plane/routes/register-w3-s2.js +8 -0
  221. package/dist/platform/control-plane/routes/session-search.d.ts +37 -0
  222. package/dist/platform/control-plane/routes/session-search.d.ts.map +1 -0
  223. package/dist/platform/control-plane/routes/session-search.js +113 -0
  224. package/dist/platform/control-plane/session-broker-gc.d.ts +16 -0
  225. package/dist/platform/control-plane/session-broker-gc.d.ts.map +1 -1
  226. package/dist/platform/control-plane/session-broker-gc.js +23 -6
  227. package/dist/platform/control-plane/session-broker-helpers.d.ts +3 -3
  228. package/dist/platform/control-plane/session-broker-helpers.d.ts.map +1 -1
  229. package/dist/platform/control-plane/session-broker-inputs.d.ts +18 -0
  230. package/dist/platform/control-plane/session-broker-inputs.d.ts.map +1 -1
  231. package/dist/platform/control-plane/session-broker-inputs.js +34 -0
  232. package/dist/platform/control-plane/session-broker-sessions.d.ts +102 -3
  233. package/dist/platform/control-plane/session-broker-sessions.d.ts.map +1 -1
  234. package/dist/platform/control-plane/session-broker-sessions.js +179 -5
  235. package/dist/platform/control-plane/session-broker-state.d.ts +20 -1
  236. package/dist/platform/control-plane/session-broker-state.d.ts.map +1 -1
  237. package/dist/platform/control-plane/session-broker-state.js +67 -5
  238. package/dist/platform/control-plane/session-broker.d.ts +51 -38
  239. package/dist/platform/control-plane/session-broker.d.ts.map +1 -1
  240. package/dist/platform/control-plane/session-broker.js +183 -75
  241. package/dist/platform/control-plane/session-store-importer.d.ts +57 -0
  242. package/dist/platform/control-plane/session-store-importer.d.ts.map +1 -0
  243. package/dist/platform/control-plane/session-store-importer.js +227 -0
  244. package/dist/platform/control-plane/session-types.d.ts +142 -7
  245. package/dist/platform/control-plane/session-types.d.ts.map +1 -1
  246. package/dist/platform/core/execution-plan.d.ts +43 -1
  247. package/dist/platform/core/execution-plan.d.ts.map +1 -1
  248. package/dist/platform/core/execution-plan.js +46 -10
  249. package/dist/platform/core/index.d.ts +1 -0
  250. package/dist/platform/core/index.d.ts.map +1 -1
  251. package/dist/platform/core/index.js +1 -0
  252. package/dist/platform/core/orchestrator-runtime.d.ts +21 -1
  253. package/dist/platform/core/orchestrator-runtime.d.ts.map +1 -1
  254. package/dist/platform/core/orchestrator-tool-runtime.d.ts +7 -0
  255. package/dist/platform/core/orchestrator-tool-runtime.d.ts.map +1 -1
  256. package/dist/platform/core/orchestrator-tool-runtime.js +10 -0
  257. package/dist/platform/core/orchestrator-turn-loop.d.ts +8 -1
  258. package/dist/platform/core/orchestrator-turn-loop.d.ts.map +1 -1
  259. package/dist/platform/core/orchestrator-turn-loop.js +6 -0
  260. package/dist/platform/core/orchestrator.d.ts +6 -0
  261. package/dist/platform/core/orchestrator.d.ts.map +1 -1
  262. package/dist/platform/core/orchestrator.js +15 -0
  263. package/dist/platform/core/plan-decomposition.d.ts +196 -0
  264. package/dist/platform/core/plan-decomposition.d.ts.map +1 -0
  265. package/dist/platform/core/plan-decomposition.js +417 -0
  266. package/dist/platform/core/plan-proposal.d.ts +39 -0
  267. package/dist/platform/core/plan-proposal.d.ts.map +1 -1
  268. package/dist/platform/core/wrfc-routing.d.ts +1 -0
  269. package/dist/platform/core/wrfc-routing.d.ts.map +1 -1
  270. package/dist/platform/core/wrfc-routing.js +51 -1
  271. package/dist/platform/daemon/boot.d.ts +63 -0
  272. package/dist/platform/daemon/boot.d.ts.map +1 -0
  273. package/dist/platform/daemon/boot.js +60 -0
  274. package/dist/platform/daemon/cli.js +2 -1
  275. package/dist/platform/daemon/control-plane.d.ts.map +1 -1
  276. package/dist/platform/daemon/control-plane.js +50 -1
  277. package/dist/platform/daemon/facade-composition.d.ts.map +1 -1
  278. package/dist/platform/daemon/facade-composition.js +6 -0
  279. package/dist/platform/daemon/facade.d.ts +18 -6
  280. package/dist/platform/daemon/facade.d.ts.map +1 -1
  281. package/dist/platform/daemon/facade.js +50 -43
  282. package/dist/platform/daemon/http/router-route-contexts.d.ts +1 -0
  283. package/dist/platform/daemon/http/router-route-contexts.d.ts.map +1 -1
  284. package/dist/platform/daemon/http/router-route-contexts.js +1 -0
  285. package/dist/platform/daemon/http/router-session-broker-adapter.d.ts +13 -0
  286. package/dist/platform/daemon/http/router-session-broker-adapter.d.ts.map +1 -0
  287. package/dist/platform/daemon/http/router-session-broker-adapter.js +27 -0
  288. package/dist/platform/daemon/http/router.d.ts +1 -1
  289. package/dist/platform/daemon/http/router.d.ts.map +1 -1
  290. package/dist/platform/daemon/http/router.js +7 -22
  291. package/dist/platform/daemon/http/runtime-route-types.d.ts +42 -4
  292. package/dist/platform/daemon/http/runtime-route-types.d.ts.map +1 -1
  293. package/dist/platform/daemon/index.d.ts +2 -0
  294. package/dist/platform/daemon/index.d.ts.map +1 -1
  295. package/dist/platform/daemon/index.js +1 -0
  296. package/dist/platform/daemon/service-manager.d.ts +16 -0
  297. package/dist/platform/daemon/service-manager.d.ts.map +1 -1
  298. package/dist/platform/daemon/service-manager.js +79 -15
  299. package/dist/platform/intelligence/tree-sitter/service.d.ts.map +1 -1
  300. package/dist/platform/intelligence/tree-sitter/service.js +16 -2
  301. package/dist/platform/knowledge/browser-history/readers.d.ts.map +1 -1
  302. package/dist/platform/knowledge/browser-history/readers.js +15 -5
  303. package/dist/platform/knowledge/project-planning/service.d.ts +14 -1
  304. package/dist/platform/knowledge/project-planning/service.d.ts.map +1 -1
  305. package/dist/platform/knowledge/project-planning/service.js +77 -0
  306. package/dist/platform/knowledge/project-planning/types.d.ts +32 -0
  307. package/dist/platform/knowledge/project-planning/types.d.ts.map +1 -1
  308. package/dist/platform/orchestration/bookkeeping.d.ts +12 -0
  309. package/dist/platform/orchestration/bookkeeping.d.ts.map +1 -0
  310. package/dist/platform/orchestration/bookkeeping.js +91 -0
  311. package/dist/platform/orchestration/controller-compat.d.ts +14 -0
  312. package/dist/platform/orchestration/controller-compat.d.ts.map +1 -1
  313. package/dist/platform/orchestration/controller-compat.js +18 -4
  314. package/dist/platform/orchestration/engine.d.ts +26 -1
  315. package/dist/platform/orchestration/engine.d.ts.map +1 -1
  316. package/dist/platform/orchestration/engine.js +226 -21
  317. package/dist/platform/orchestration/index.d.ts +6 -4
  318. package/dist/platform/orchestration/index.d.ts.map +1 -1
  319. package/dist/platform/orchestration/index.js +3 -2
  320. package/dist/platform/orchestration/persistence.d.ts.map +1 -1
  321. package/dist/platform/orchestration/persistence.js +4 -1
  322. package/dist/platform/orchestration/phase-runner.d.ts +29 -2
  323. package/dist/platform/orchestration/phase-runner.d.ts.map +1 -1
  324. package/dist/platform/orchestration/phase-runner.js +98 -25
  325. package/dist/platform/orchestration/proposal-workstream.d.ts +56 -0
  326. package/dist/platform/orchestration/proposal-workstream.d.ts.map +1 -0
  327. package/dist/platform/orchestration/proposal-workstream.js +76 -0
  328. package/dist/platform/orchestration/scheduler.d.ts +19 -0
  329. package/dist/platform/orchestration/scheduler.d.ts.map +1 -1
  330. package/dist/platform/orchestration/scheduler.js +16 -0
  331. package/dist/platform/orchestration/types.d.ts +286 -1
  332. package/dist/platform/orchestration/types.d.ts.map +1 -1
  333. package/dist/platform/orchestration/types.js +32 -0
  334. package/dist/platform/orchestration/worktree-isolation.d.ts +33 -0
  335. package/dist/platform/orchestration/worktree-isolation.d.ts.map +1 -0
  336. package/dist/platform/orchestration/worktree-isolation.js +248 -0
  337. package/dist/platform/presentation/glyphs.d.ts +91 -0
  338. package/dist/platform/presentation/glyphs.d.ts.map +1 -0
  339. package/dist/platform/presentation/glyphs.js +93 -0
  340. package/dist/platform/presentation/index.d.ts +28 -0
  341. package/dist/platform/presentation/index.d.ts.map +1 -0
  342. package/dist/platform/presentation/index.js +27 -0
  343. package/dist/platform/presentation/thinking-phrases.d.ts +12 -0
  344. package/dist/platform/presentation/thinking-phrases.d.ts.map +1 -0
  345. package/dist/platform/presentation/thinking-phrases.js +32 -0
  346. package/dist/platform/presentation/tones.d.ts +121 -0
  347. package/dist/platform/presentation/tones.d.ts.map +1 -0
  348. package/dist/platform/presentation/tones.js +145 -0
  349. package/dist/platform/presentation/waiting-wording.d.ts +54 -0
  350. package/dist/platform/presentation/waiting-wording.d.ts.map +1 -0
  351. package/dist/platform/presentation/waiting-wording.js +51 -0
  352. package/dist/platform/providers/runtime-snapshot.d.ts.map +1 -1
  353. package/dist/platform/providers/runtime-snapshot.js +12 -2
  354. package/dist/platform/runtime/bootstrap-services.d.ts +62 -2
  355. package/dist/platform/runtime/bootstrap-services.d.ts.map +1 -1
  356. package/dist/platform/runtime/bootstrap-services.js +217 -50
  357. package/dist/platform/runtime/daemon-version-compat.d.ts +39 -0
  358. package/dist/platform/runtime/daemon-version-compat.d.ts.map +1 -0
  359. package/dist/platform/runtime/daemon-version-compat.js +75 -0
  360. package/dist/platform/runtime/detached-daemon-runtime.d.ts +26 -0
  361. package/dist/platform/runtime/detached-daemon-runtime.d.ts.map +1 -0
  362. package/dist/platform/runtime/detached-daemon-runtime.js +49 -0
  363. package/dist/platform/runtime/emitters/workflows.d.ts +1 -1
  364. package/dist/platform/runtime/emitters/workflows.d.ts.map +1 -1
  365. package/dist/platform/runtime/events/index.d.ts +13 -0
  366. package/dist/platform/runtime/events/index.d.ts.map +1 -1
  367. package/dist/platform/runtime/events/index.js +13 -0
  368. package/dist/platform/runtime/feature-flags/flags.d.ts.map +1 -1
  369. package/dist/platform/runtime/feature-flags/flags.js +39 -1
  370. package/dist/platform/runtime/fleet/adapters/orchestration.d.ts +40 -18
  371. package/dist/platform/runtime/fleet/adapters/orchestration.d.ts.map +1 -1
  372. package/dist/platform/runtime/fleet/adapters/orchestration.js +138 -34
  373. package/dist/platform/runtime/fleet/adapters/wrfc.d.ts +13 -0
  374. package/dist/platform/runtime/fleet/adapters/wrfc.d.ts.map +1 -1
  375. package/dist/platform/runtime/fleet/adapters/wrfc.js +48 -1
  376. package/dist/platform/runtime/fleet/registry.d.ts.map +1 -1
  377. package/dist/platform/runtime/fleet/registry.js +38 -4
  378. package/dist/platform/runtime/operator-client.d.ts +20 -2
  379. package/dist/platform/runtime/operator-client.d.ts.map +1 -1
  380. package/dist/platform/runtime/operator-client.js +11 -1
  381. package/dist/platform/runtime/provider-accounts/registry.d.ts.map +1 -1
  382. package/dist/platform/runtime/provider-accounts/registry.js +11 -1
  383. package/dist/platform/runtime/services.d.ts +9 -7
  384. package/dist/platform/runtime/services.d.ts.map +1 -1
  385. package/dist/platform/runtime/services.js +19 -4
  386. package/dist/platform/runtime/session-spine/client.d.ts +234 -0
  387. package/dist/platform/runtime/session-spine/client.d.ts.map +1 -0
  388. package/dist/platform/runtime/session-spine/client.js +449 -0
  389. package/dist/platform/runtime/session-spine/index.d.ts +12 -0
  390. package/dist/platform/runtime/session-spine/index.d.ts.map +1 -0
  391. package/dist/platform/runtime/session-spine/index.js +11 -0
  392. package/dist/platform/runtime/session-spine/union-cache.d.ts +225 -0
  393. package/dist/platform/runtime/session-spine/union-cache.d.ts.map +1 -0
  394. package/dist/platform/runtime/session-spine/union-cache.js +333 -0
  395. package/dist/platform/runtime/shell-command-ops.d.ts +3 -1
  396. package/dist/platform/runtime/shell-command-ops.d.ts.map +1 -1
  397. package/dist/platform/runtime/transports/daemon-http-client-validators.d.ts.map +1 -1
  398. package/dist/platform/runtime/transports/daemon-http-client-validators.js +22 -0
  399. package/dist/platform/runtime/transports/daemon-http-client.d.ts.map +1 -1
  400. package/dist/platform/runtime/transports/daemon-http-client.js +25 -2
  401. package/dist/platform/runtime/transports/http-types.d.ts +9 -2
  402. package/dist/platform/runtime/transports/http-types.d.ts.map +1 -1
  403. package/dist/platform/state/canonical-memory.d.ts +95 -0
  404. package/dist/platform/state/canonical-memory.d.ts.map +1 -0
  405. package/dist/platform/state/canonical-memory.js +155 -0
  406. package/dist/platform/state/code-index-reindex.d.ts +73 -0
  407. package/dist/platform/state/code-index-reindex.d.ts.map +1 -0
  408. package/dist/platform/state/code-index-reindex.js +156 -0
  409. package/dist/platform/state/code-index-store.d.ts.map +1 -1
  410. package/dist/platform/state/code-index-store.js +10 -2
  411. package/dist/platform/state/index.d.ts +8 -0
  412. package/dist/platform/state/index.d.ts.map +1 -1
  413. package/dist/platform/state/index.js +4 -0
  414. package/dist/platform/state/memory-recall-contract.d.ts +63 -0
  415. package/dist/platform/state/memory-recall-contract.d.ts.map +1 -0
  416. package/dist/platform/state/memory-recall-contract.js +94 -0
  417. package/dist/platform/state/memory-store.d.ts +2 -0
  418. package/dist/platform/state/memory-store.d.ts.map +1 -1
  419. package/dist/platform/state/memory-store.js +4 -0
  420. package/dist/platform/state/memory-vector-store.d.ts.map +1 -1
  421. package/dist/platform/state/memory-vector-store.js +13 -2
  422. package/dist/platform/state/sqlite-store.d.ts +2 -0
  423. package/dist/platform/state/sqlite-store.d.ts.map +1 -1
  424. package/dist/platform/state/sqlite-store.js +4 -0
  425. package/dist/platform/state/vibe-projection.d.ts +67 -0
  426. package/dist/platform/state/vibe-projection.d.ts.map +1 -0
  427. package/dist/platform/state/vibe-projection.js +115 -0
  428. package/dist/platform/tools/agent/index.d.ts.map +1 -1
  429. package/dist/platform/tools/agent/index.js +8 -0
  430. package/dist/platform/tools/agent/manager.d.ts +12 -0
  431. package/dist/platform/tools/agent/manager.d.ts.map +1 -1
  432. package/dist/platform/tools/agent/manager.js +6 -0
  433. package/dist/platform/tools/agent/schema.d.ts +26 -0
  434. package/dist/platform/tools/agent/schema.d.ts.map +1 -1
  435. package/dist/platform/tools/agent/schema.js +2 -2
  436. package/dist/platform/tools/agent/wrfc-batch-policy.d.ts +13 -0
  437. package/dist/platform/tools/agent/wrfc-batch-policy.d.ts.map +1 -1
  438. package/dist/platform/tools/agent/wrfc-batch-policy.js +60 -0
  439. package/dist/platform/tools/exec/runtime.d.ts +10 -0
  440. package/dist/platform/tools/exec/runtime.d.ts.map +1 -1
  441. package/dist/platform/tools/exec/runtime.js +22 -5
  442. package/dist/platform/tools/exec/schema.d.ts +1 -1
  443. package/dist/platform/tools/exec/schema.d.ts.map +1 -1
  444. package/dist/platform/tools/exec/schema.js +2 -1
  445. package/dist/platform/tools/index.d.ts +2 -0
  446. package/dist/platform/tools/index.d.ts.map +1 -1
  447. package/dist/platform/tools/index.js +2 -0
  448. package/dist/platform/tools/state/index.d.ts +9 -0
  449. package/dist/platform/tools/state/index.d.ts.map +1 -1
  450. package/dist/platform/tools/state/index.js +60 -3
  451. package/dist/platform/types/foundation-contract.d.ts +1 -1
  452. package/dist/platform/types/foundation-contract.d.ts.map +1 -1
  453. package/dist/platform/types/index.d.ts +1 -1
  454. package/dist/platform/types/index.d.ts.map +1 -1
  455. package/dist/platform/version.js +1 -1
  456. package/package.json +21 -9
  457. package/dist/platform/control-plane/routes/automation.d.ts +0 -3
  458. package/dist/platform/control-plane/routes/automation.d.ts.map +0 -1
  459. package/dist/platform/control-plane/routes/automation.js +0 -63
  460. package/dist/platform/control-plane/routes/context.d.ts +0 -2
  461. package/dist/platform/control-plane/routes/context.d.ts.map +0 -1
  462. package/dist/platform/control-plane/routes/context.js +0 -1
  463. package/dist/platform/control-plane/routes/operator.d.ts +0 -8
  464. package/dist/platform/control-plane/routes/operator.d.ts.map +0 -1
  465. package/dist/platform/control-plane/routes/operator.js +0 -415
  466. package/dist/platform/control-plane/routes/remote.d.ts +0 -3
  467. package/dist/platform/control-plane/routes/remote.d.ts.map +0 -1
  468. package/dist/platform/control-plane/routes/remote.js +0 -35
  469. package/dist/platform/control-plane/routes/sessions.d.ts +0 -3
  470. package/dist/platform/control-plane/routes/sessions.d.ts.map +0 -1
  471. package/dist/platform/control-plane/routes/sessions.js +0 -43
  472. package/dist/platform/control-plane/routes/tasks.d.ts +0 -3
  473. package/dist/platform/control-plane/routes/tasks.d.ts.map +0 -1
  474. package/dist/platform/control-plane/routes/tasks.js +0 -22
@@ -0,0 +1,60 @@
1
+ /**
2
+ * boot.ts
3
+ *
4
+ * A thin public factory that wraps the daemon construction graph in ONE call.
5
+ *
6
+ * `DaemonServer` already self-composes its full runtime graph
7
+ * (ConfigManager → RuntimeEventBus → runtime store → createRuntimeServices →
8
+ * gateway/brokers/router) from a `DaemonConfig`, and installs the network
9
+ * transport + folds legacy session stores during `start()`. This factory just
10
+ * threads the caller's overrides in, enables the daemon with the given token,
11
+ * starts it, and hands back a stop handle — composition, not new behavior.
12
+ *
13
+ * It exists so embedders and tests do not have to hand-mirror cli.ts's graph to
14
+ * stand up a real daemon (isolated home, ephemeral port, auth round-trip).
15
+ */
16
+ import { ConfigManager } from '../config/manager.js';
17
+ import { DaemonServer } from './facade.js';
18
+ /**
19
+ * Boot a fully-composed daemon in one call and return a stop handle.
20
+ *
21
+ * @example
22
+ * const daemon = await bootDaemon({ homeDirectory, workingDir, port: 0, token });
23
+ * // ... hit `${daemon.url}/api/...` with `Authorization: Bearer ${token}`
24
+ * await daemon.stop();
25
+ */
26
+ export async function bootDaemon(options) {
27
+ // Build a ConfigManager rooted at the injected dirs when the caller did not
28
+ // supply one — this is what makes the graph self-compose from just the dirs.
29
+ const configManager = options.configManager ?? new ConfigManager({
30
+ workingDir: options.workingDir,
31
+ homeDir: options.homeDirectory,
32
+ surfaceRoot: 'goodvibes',
33
+ });
34
+ const server = new DaemonServer({
35
+ port: options.port ?? 0,
36
+ ...(options.host !== undefined ? { host: options.host } : {}),
37
+ workingDir: options.workingDir,
38
+ homeDirectory: options.homeDirectory,
39
+ ...(options.daemonHomeDir !== undefined ? { daemonHomeDir: options.daemonHomeDir } : {}),
40
+ configManager,
41
+ ...(options.serveFactory !== undefined ? { serveFactory: options.serveFactory } : {}),
42
+ });
43
+ server.enable({ daemon: true }, options.token);
44
+ await server.start();
45
+ const host = server.boundHost;
46
+ const port = server.boundPort;
47
+ return {
48
+ server,
49
+ approvals: server.approvals,
50
+ host,
51
+ port,
52
+ url: `http://${host}:${port}`,
53
+ // Best-effort teardown, mirroring cli.ts's `Promise.allSettled` stance: a
54
+ // subsystem that refuses to stop (e.g. a feature-gated watcher) must not
55
+ // leave the caller unable to shut the daemon down.
56
+ stop: async () => {
57
+ await Promise.resolve(server.stop()).catch(() => { });
58
+ },
59
+ };
60
+ }
@@ -1,5 +1,6 @@
1
1
  import { homedir } from 'node:os';
2
2
  import { ConfigManager } from '../config/manager.js';
3
+ import { resolveDaemonEnabled } from '../config/index.js';
3
4
  import { RuntimeEventBus } from '../runtime/events/index.js';
4
5
  import { createRuntimeStore } from '../runtime/store/index.js';
5
6
  import { createRuntimeServices } from '../runtime/services.js';
@@ -96,7 +97,7 @@ async function main() {
96
97
  process.on('SIGINT', () => void shutdown());
97
98
  process.on('SIGTERM', () => void shutdown());
98
99
  logger.info('goodvibes daemon host started', {
99
- daemon: config.get('danger.daemon'),
100
+ daemon: resolveDaemonEnabled(config),
100
101
  httpListener: config.get('danger.httpListener'),
101
102
  workingDir,
102
103
  daemonHomeDir,
@@ -1 +1 @@
1
- {"version":3,"file":"control-plane.d.ts","sourceRoot":"","sources":["../../../src/platform/daemon/control-plane.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAOhE,OAAO,KAAK,EAAE,mBAAmB,EAAuB,MAAM,2BAA2B,CAAC;AAC1F,OAAO,KAAK,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAI5E,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,IAAI,CAAC;IAC3D,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,kBA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,OAAO,GAAG,SAAS,CAAC;YACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;YAChD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;SAC1C,CAAC;KACH,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC;CA0F5D"}
@@ -3,6 +3,9 @@ import { isRuntimeEventDomain } from '../runtime/events/index.js';
3
3
  import { extractForwardedClientIp } from '../runtime/network/index.js';
4
4
  import { resolveGatewayPathTemplate } from './helpers.js';
5
5
  import { summarizeError } from '../utils/error-display.js';
6
+ import { validateInvocationInput } from '../control-plane/invoke-input-validation.js';
7
+ import { isGatewayVerbError } from '../control-plane/routes/gateway-verb-error.js';
8
+ import { SDKErrorCodes } from '@pellux/goodvibes-errors';
6
9
  import { buildMissingScopeBody, resolveAuthenticatedPrincipal, } from './http-policy.js';
7
10
  export class DaemonControlPlaneHelper {
8
11
  context;
@@ -97,6 +100,11 @@ export class DaemonControlPlaneHelper {
97
100
  ok: false,
98
101
  body: {
99
102
  error: `Gateway method is cataloged but not invokable through method dispatch: ${descriptor.id}`,
103
+ // Machine-readable, following the SDKErrorCodes.SESSION_CLOSED precedent
104
+ // (session-broker.ts) — consumers match on `code`, never on the message
105
+ // string. See the `invokable` field's doc comment (method-catalog-shared.ts)
106
+ // for what this status does and does not mean.
107
+ code: SDKErrorCodes.NOT_INVOKABLE,
100
108
  },
101
109
  };
102
110
  }
@@ -321,6 +329,14 @@ export class DaemonControlPlaneHelper {
321
329
  const denied = this.validateGatewayInvocation(matchedDescriptor, input.context);
322
330
  if (denied)
323
331
  return denied;
332
+ // Same input gate for the method+path WS call path (no bypass of the HTTP
333
+ // methodId gate). Only POST/PATCH carry a validatable body here.
334
+ if (input.method === 'POST' || input.method === 'PATCH') {
335
+ const invalid = validateInvocationInput(matchedDescriptor, input.body);
336
+ if (invalid) {
337
+ return { status: 400, ok: false, body: { error: invalid.detail, code: invalid.code } };
338
+ }
339
+ }
324
340
  }
325
341
  const url = new URL(`http://${this.context.host}:${this.context.port}${input.path.startsWith('/') ? input.path : `/${input.path}`}`);
326
342
  for (const [key, value] of Object.entries(input.query ?? {})) {
@@ -359,11 +375,33 @@ export class DaemonControlPlaneHelper {
359
375
  async invokeGatewayMethodCall(input) {
360
376
  const descriptor = this.context.gatewayMethods.get(input.methodId);
361
377
  if (!descriptor) {
362
- return { status: 404, ok: false, body: { error: `Unknown gateway method: ${input.methodId}` } };
378
+ return {
379
+ status: 404,
380
+ ok: false,
381
+ body: {
382
+ error: `Unknown gateway method: ${input.methodId}`,
383
+ // Machine-readable, mirroring the NOT_INVOKABLE convention just below
384
+ // (validateGatewayInvocation) — the uncataloged-id 404 gets its own code so
385
+ // no consumer has to string-match "Unknown gateway method".
386
+ code: SDKErrorCodes.METHOD_NOT_FOUND,
387
+ },
388
+ };
363
389
  }
364
390
  const denied = this.validateGatewayInvocation(descriptor, input.context);
365
391
  if (denied)
366
392
  return denied;
393
+ // Input validation gate: reject a wrong-typed / missing-required body against
394
+ // the verb's typed inputSchema before the handler runs (honest 400, not silent
395
+ // coercion). Only body-carrying invocations are checked — a handler method
396
+ // (no http binding) or a POST/PATCH verb receives its params in the body;
397
+ // GET/DELETE params arrive as query strings that cannot be soundly type-checked.
398
+ const carriesBody = !descriptor.http || descriptor.http.method === 'POST' || descriptor.http.method === 'PATCH';
399
+ if (carriesBody) {
400
+ const invalid = validateInvocationInput(descriptor, input.body);
401
+ if (invalid) {
402
+ return { status: 400, ok: false, body: { error: invalid.detail, code: invalid.code } };
403
+ }
404
+ }
367
405
  if (this.context.gatewayMethods.hasHandler(input.methodId)) {
368
406
  try {
369
407
  const body = await this.context.gatewayMethods.invoke(input.methodId, {
@@ -381,6 +419,17 @@ export class DaemonControlPlaneHelper {
381
419
  return { status: 200, ok: true, body };
382
420
  }
383
421
  catch (error) {
422
+ // A handler-registered verb (W3-S2: fleet.*, checkpoints.*,
423
+ // sessions.search) may throw a GatewayVerbError to report an honest
424
+ // caller-error status (400/404) instead of the blanket 500 below —
425
+ // see routes/gateway-verb-error.ts for why this seam is needed.
426
+ if (isGatewayVerbError(error)) {
427
+ return {
428
+ status: error.status,
429
+ ok: false,
430
+ body: { error: error.message, code: error.code },
431
+ };
432
+ }
384
433
  return {
385
434
  status: 500,
386
435
  ok: false,
@@ -1 +1 @@
1
- {"version":3,"file":"facade-composition.d.ts","sourceRoot":"","sources":["../../../src/platform/daemon/facade-composition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AA6BvD,OAAO,KAAK,EAAE,oBAAoB,EAA0B,MAAM,wCAAwC,CAAC;AAG3G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAuB,MAAM,YAAY,CAAC;AAKpE,YAAY,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,sCAAsC,GACvC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,sCAAsC,EACvC,MAAM,mBAAmB,CAAC;AAiD3B;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,8BAA8B,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,oBAAoB,CA8HvG;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,YAAY,GAAG,2BAA2B,CAkJ5F;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,sCAAsC,GAC9C,yBAAyB,CA4K3B;AAED,wBAAgB,kCAAkC,CAAC,OAAO,EAAE;IAC1D,QAAQ,CAAC,aAAa,EAAE,OAAO,2BAA2B,EAAE,mBAAmB,CAAC;IAChF,QAAQ,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,YAAY,CA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AAG,2BAA2B,CAwJ5F;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,sCAAsC,GAC9C,yBAAyB,CA4K3B;AAED,wBAAgB,kCAAkC,CAAC,OAAO,EAAE;IAC1D,QAAQ,CAAC,aAAa,EAAE,OAAO,2BAA2B,EAAE,mBAAmB,CAAC;IAChF,QAAQ,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,yBAAyB,EAAE,WAAW,GAAG,QAAQ,CAAC;IACzK,QAAQ,CAAC,4BAA4B,EAAE,CAAC,OAAO,EAAE,OAAO,yBAAyB,EAAE,sBAAsB,GAAG,SAAS,EAAE,KAAK,EAAE;QAC5H,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACxC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC9C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KACzC,KAAK,IAAI,CAAC;CACZ,GAAG,IAAI,CAoBP"}
@@ -275,6 +275,12 @@ export function resolveDaemonFacadeRuntime(config) {
275
275
  // Explicitly opt into disk persistence for the daemon. Default is false
276
276
  // for tests and embedded hosts.
277
277
  persist: true,
278
+ // Honor the runtime's injected home so an isolated-home daemon never reads
279
+ // or writes the real ~/.goodvibes/companion-chat.
280
+ sessionsDir: runtimeServices.shellPaths.resolveUserPath('companion-chat', 'sessions'),
281
+ // Live spine: companion sessions register INTO the shared broker at write
282
+ // time so /api/sessions reflects them same-process (no restart).
283
+ sessionBroker: runtimeServices.sessionBroker,
278
284
  // Wire the full ToolRegistry so LLM-emitted tool calls are executed.
279
285
  toolRegistry: runtimeServices.agentOrchestrator.getToolRegistry(),
280
286
  permissionManager: new PermissionManager(undefined, createPermissionConfigReader(resolvedConfigManager), runtimeServices.policyRuntimeState, runtimeServices.hookDispatcher, runtimeServices.featureFlags),
@@ -1,8 +1,8 @@
1
+ import type { ApprovalBroker } from '../control-plane/index.js';
1
2
  import type { DaemonConfig, DaemonDangerConfig } from './types.js';
2
3
  /**
3
- * DaemonServer — HTTP task server, disabled by default.
4
- *
5
- * Enable via: danger.daemon = true in config.
4
+ * DaemonServer — HTTP task server. Enabled by default via `daemon.enabled`
5
+ * (loopback-bound), resolved via resolveDaemonEnabled.
6
6
  * All routes require Bearer token auth (set via enable()).
7
7
  * POST /task — submit a task; returns agentId.
8
8
  * GET /task/:id — returns agent status.
@@ -72,11 +72,23 @@ export declare class DaemonServer {
72
72
  constructor(config?: DaemonConfig);
73
73
  listRecentControlPlaneEvents(limit?: number): readonly import('../control-plane/gateway.js').ControlPlaneRecentEvent[];
74
74
  /**
75
- * Enable the daemon. Requires danger.daemon = true in config.
76
- * The provided token is used to authenticate all incoming requests.
77
- * Returns true if enabled, false if the config forbids it.
75
+ * Enable the daemon. Caller passes the resolved enable decision (from
76
+ * resolveDaemonEnabled). The token authenticates all requests. Returns false
77
+ * if the passed-in flag forbids it.
78
78
  */
79
79
  enable(dangerConfig: DaemonDangerConfig, token?: string): boolean;
80
+ /** Bound TCP port after {@link start} (resolves a `port: 0` request to the real port). */
81
+ get boundPort(): number;
82
+ /** The host the daemon is bound to. */
83
+ get boundHost(): string;
84
+ /**
85
+ * The daemon's shared approval broker. Exposed so embedders (and the boot
86
+ * factory's proof tests) can seed or inspect approvals against the SAME broker
87
+ * the HTTP approvals routes resolve through — e.g. to bridge an external
88
+ * approval UI, or to prove per-hunk approve/deny over the live wire without a
89
+ * running agent to originate a real tool-call approval.
90
+ */
91
+ get approvals(): ApprovalBroker;
80
92
  /**
81
93
  * Start the daemon. Refuses to start if not explicitly enabled.
82
94
  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,OAAO,CAAC,qBAAqB;IAY7B,OAAO,CAAC,sBAAsB;YAIhB,yBAAyB;IAGvC,OAAO,CAAC,iBAAiB;IAGzB,OAAO,CAAC,kBAAkB;CAG3B"}
@@ -2,6 +2,7 @@ import { logger } from '../utils/logger.js';
2
2
  import { jsonErrorResponse } from './http/error-response.js';
3
3
  import { summarizeError } from '../utils/error-display.js';
4
4
  import { AgentManager } from '../tools/agent/index.js';
5
+ import { discoverLegacySessionSources, importLegacySessionStores } from '../control-plane/index.js';
5
6
  import {} from '../runtime/remote/index.js';
6
7
  import { isSurfaceDeliveryEnabled } from './surface-policy.js';
7
8
  import { AgentTaskAdapter } from '../runtime/tasks/adapters/agent-adapter.js';
@@ -13,13 +14,10 @@ import { readAutomationReasoningEffort, readAutomationWakeMode, readExternalCont
13
14
  import { requirePortAvailable } from './port-check.js';
14
15
  import { resolveHostBinding } from './host-resolver.js';
15
16
  import { createHostModeRestartWatcher } from './host-mode-watcher.js';
16
- // ---------------------------------------------------------------------------
17
- // DaemonServer
18
- // ---------------------------------------------------------------------------
17
+ // --- DaemonServer ---
19
18
  /**
20
- * DaemonServer — HTTP task server, disabled by default.
21
- *
22
- * Enable via: danger.daemon = true in config.
19
+ * DaemonServer — HTTP task server. Enabled by default via `daemon.enabled`
20
+ * (loopback-bound), resolved via resolveDaemonEnabled.
23
21
  * All routes require Bearer token auth (set via enable()).
24
22
  * POST /task — submit a task; returns agentId.
25
23
  * GET /task/:id — returns agent status.
@@ -145,8 +143,7 @@ export class DaemonServer {
145
143
  handleApprovalAction: (approvalId, action, req) => this.handleApprovalAction(approvalId, action, req),
146
144
  tlsState: () => this.tlsState,
147
145
  swapManager: this.config.swapManager ?? null,
148
- // Resolve companion-chat defaults from the live ProviderRegistry so session
149
- // creation uses the current route, not a snapshot captured at startup.
146
+ // Resolve companion-chat defaults from the live ProviderRegistry (current route, not a startup snapshot).
150
147
  resolveDefaultProviderModel: () => {
151
148
  try {
152
149
  const current = resolved.runtimeServices.providerRegistry.getCurrentModel();
@@ -167,8 +164,7 @@ export class DaemonServer {
167
164
  this.httpRouter = collaborators.httpRouter;
168
165
  this.providerRuntime = collaborators.providerRuntime;
169
166
  this.builtinChannels = collaborators.builtinChannels;
170
- // Wire AgentTaskAdapter to the RuntimeEventBus so task records reach
171
- // terminal states when their backing agent finishes.
167
+ // Wire AgentTaskAdapter to the RuntimeEventBus so task records reach terminal states on agent finish.
172
168
  this.agentTaskAdapter = new AgentTaskAdapter(this.runtimeStore);
173
169
  this.agentTaskAdapterUnsub = this.agentTaskAdapter.attachRuntimeBus(this.runtimeBus);
174
170
  // Mark any tasks that were running at startup as aborted after daemon restart.
@@ -191,13 +187,13 @@ export class DaemonServer {
191
187
  return this.controlPlaneGateway.listRecentEvents(limit);
192
188
  }
193
189
  /**
194
- * Enable the daemon. Requires danger.daemon = true in config.
195
- * The provided token is used to authenticate all incoming requests.
196
- * Returns true if enabled, false if the config forbids it.
190
+ * Enable the daemon. Caller passes the resolved enable decision (from
191
+ * resolveDaemonEnabled). The token authenticates all requests. Returns false
192
+ * if the passed-in flag forbids it.
197
193
  */
198
194
  enable(dangerConfig, token) {
199
195
  if (!dangerConfig.daemon) {
200
- logger.info('DaemonServer.enable: danger.daemon is false — not enabling');
196
+ logger.info('DaemonServer.enable: daemon disabled by config (daemon.enabled=false) — not enabling');
201
197
  return false;
202
198
  }
203
199
  this.enabled = true;
@@ -205,12 +201,27 @@ export class DaemonServer {
205
201
  this.controlPlaneGateway.setServerState({ enabled: true, host: this.host, port: this.port });
206
202
  return true;
207
203
  }
204
+ /** Bound TCP port after {@link start} (resolves a `port: 0` request to the real port). */
205
+ get boundPort() {
206
+ const served = this.server?.port;
207
+ return typeof served === 'number' ? served : this.port;
208
+ }
209
+ /** The host the daemon is bound to. */
210
+ get boundHost() { return this.host; }
211
+ /**
212
+ * The daemon's shared approval broker. Exposed so embedders (and the boot
213
+ * factory's proof tests) can seed or inspect approvals against the SAME broker
214
+ * the HTTP approvals routes resolve through — e.g. to bridge an external
215
+ * approval UI, or to prove per-hunk approve/deny over the live wire without a
216
+ * running agent to originate a real tool-call approval.
217
+ */
218
+ get approvals() { return this.approvalBroker; }
208
219
  /**
209
220
  * Start the daemon. Refuses to start if not explicitly enabled.
210
221
  */
211
222
  async start() {
212
223
  if (!this.enabled) {
213
- logger.info('Daemon mode is disabled. Enable via danger.daemon config.');
224
+ logger.info('Daemon mode is disabled (daemon.enabled=false). It is on by default.');
214
225
  return;
215
226
  }
216
227
  if (this.authToken === null) {
@@ -285,6 +296,14 @@ export class DaemonServer {
285
296
  },
286
297
  },
287
298
  });
299
+ // Boot precondition: fold legacy stores into the home store before the broker serves (idempotent).
300
+ await importLegacySessionStores({
301
+ homeStorePath: this.runtimeServices.shellPaths.resolveUserPath('control-plane', 'sessions.json'),
302
+ sources: discoverLegacySessionSources({
303
+ projectRoot: this.runtimeServices.shellPaths.workingDirectory,
304
+ companionSessionsDir: this.runtimeServices.shellPaths.resolveUserPath('companion-chat', 'sessions'), // injected home
305
+ }),
306
+ }).catch((error) => logger.warn('DaemonServer: legacy session import failed', { error: summarizeError(error) }));
288
307
  await Promise.all([
289
308
  this.sessionBroker.start(),
290
309
  this.approvalBroker.start(),
@@ -293,19 +312,16 @@ export class DaemonServer {
293
312
  this.distributedRuntime.start(),
294
313
  ]);
295
314
  await this.providerRuntime.startConfigured();
296
- // Load persisted companion sessions after providers are configured.
297
315
  await this.companionChatManager.init();
298
316
  if (this.replyPoller === null) {
299
- // Poll every 2 s for surface replies that have resolved asynchronously.
300
- // The interval is intentionally short to keep companion response latency
301
- // below a perceptible threshold while still batching concurrent replies.
317
+ // Poll every 2 s for asynchronously-resolved surface replies; short interval
318
+ // keeps companion latency low while batching concurrent replies.
302
319
  this.replyPoller = setInterval(() => {
303
320
  void this.pollPendingSurfaceReplies().catch((error) => {
304
321
  logger.warn('DaemonServer: surface reply poll failed', { error: summarizeError(error) });
305
322
  });
306
323
  }, 2_000);
307
- // unref() prevents this timer from keeping the Node.js/Bun event loop
308
- // alive if all other async work has completed — same pattern as animInterval.
324
+ // unref() so this timer never keeps the event loop alive past shutdown.
309
325
  this.replyPoller.unref?.();
310
326
  }
311
327
  this.surfaceRegistry.syncConfiguredSurfaces();
@@ -387,16 +403,15 @@ export class DaemonServer {
387
403
  async stop() {
388
404
  if (this.server === null)
389
405
  return;
390
- // Tear down config watcher only on intentional stop, not mid-restart.
391
- // During a restart cycle (_restarting=true) the watcher must stay active so
392
- // config changes that arrive between stop() and the subsequent start() can be
393
- // captured by the dirty flag.
406
+ // Tear down config watcher only on intentional stop; during a restart cycle
407
+ // (_restarting) it must stay active so mid-restart changes hit the dirty flag.
394
408
  if (!this._restarting) {
395
409
  this._configWatchUnsub?.();
396
410
  this._configWatchUnsub = null;
397
411
  }
398
- // Synchronous pre-stop teardown
399
- this.watcherRegistry.stopWatcher('daemon-heartbeat', 'daemon-stopped');
412
+ // Synchronous pre-stop teardown. Only stop the heartbeat watcher when start() engaged it (registered solely behind `watchers.enabled`); stopWatcher() runs requireFeatureGate('watcher-framework') and THROWS when that gate is off, which would break a clean shutdown of a watchers-disabled daemon.
413
+ if (this.configManager.get('watchers.enabled'))
414
+ this.watcherRegistry.stopWatcher('daemon-heartbeat', 'daemon-stopped');
400
415
  if (this.replyPoller !== null) {
401
416
  clearInterval(this.replyPoller);
402
417
  this.replyPoller = null;
@@ -406,9 +421,8 @@ export class DaemonServer {
406
421
  this.approvalBrokerUnsubscribe = null;
407
422
  this.httpRouter.dispose();
408
423
  this.companionChatManager.dispose();
409
- // Stop services that expose async teardown. Note: sessionBroker, approvalBroker,
410
- // channelPolicy, and distributedRuntime expose start() only their lifecycle ends
411
- // when the server socket closes. We stop what we can in reverse start order.
424
+ // Stop services with async teardown in reverse start order (sessionBroker,
425
+ // approvalBroker, channelPolicy, distributedRuntime end when the socket closes).
412
426
  this.providerRuntime.stopAll();
413
427
  this.automationManager.stop();
414
428
  // Tear down the adapter bus subscription and session broker GC interval.
@@ -431,9 +445,8 @@ export class DaemonServer {
431
445
  return; // idempotent
432
446
  const restart = () => {
433
447
  if (this._restarting) {
434
- // A change arrived mid-restart — queue a second cycle via dirty flag.
435
- // Check _restarting BEFORE isRunning: stop() runs synchronously inside the
436
- // restart IIFE, so isRunning may be false even while a restart is in progress.
448
+ // Change arrived mid-restart — queue a second cycle (check _restarting
449
+ // before isRunning: stop() runs synchronously inside the restart IIFE).
437
450
  this._restartDirty = true;
438
451
  return;
439
452
  }
@@ -467,10 +480,8 @@ export class DaemonServer {
467
480
  }
468
481
  })();
469
482
  };
470
- // getIsRunning must also return true while a restart cycle is in progress
471
- // (_restarting=true) so that config changes arriving mid-restart reach the
472
- // dirty-flag path inside `restart`. When the server is intentionally stopped
473
- // (not mid-restart) isRunning and _restarting are both false.
483
+ // getIsRunning also returns true mid-restart (_restarting) so changes arriving
484
+ // then reach the dirty-flag path; both are false on an intentional stop.
474
485
  const watcher = createHostModeRestartWatcher({
475
486
  configManager: this.configManager,
476
487
  keys: ['controlPlane.hostMode', 'controlPlane.host', 'controlPlane.port'],
@@ -485,9 +496,7 @@ export class DaemonServer {
485
496
  get isRunning() {
486
497
  return this.server !== null;
487
498
  }
488
- // -------------------------------------------------------------------------
489
- // Auth
490
- // -------------------------------------------------------------------------
499
+ // --- Auth ---
491
500
  extractAuthToken(req) {
492
501
  return this.controlPlaneHelper.extractAuthToken(req);
493
502
  }
@@ -530,9 +539,7 @@ export class DaemonServer {
530
539
  async invokeGatewayMethodCall(input) {
531
540
  return await this.controlPlaneHelper.invokeGatewayMethodCall(input);
532
541
  }
533
- // -------------------------------------------------------------------------
534
- // Request handling
535
- // -------------------------------------------------------------------------
542
+ // --- Request handling ---
536
543
  async handleRequest(req) {
537
544
  return await this.httpRouter.handleRequest(req);
538
545
  }
@@ -27,6 +27,7 @@ export declare function buildChannelRouteContext(input: {
27
27
  export declare function buildSystemRouteContext(input: {
28
28
  readonly approvalBroker: ApprovalBroker;
29
29
  readonly configManager: ConfigManager;
30
+ readonly credentialStatus: DaemonSystemRouteContext['credentialStatus'];
30
31
  readonly integrationHelpers: IntegrationHelperService | null;
31
32
  readonly inspectInboundTls: (surface: 'controlPlane' | 'httpListener') => unknown;
32
33
  readonly inspectOutboundTls: () => unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"router-route-contexts.d.ts","sourceRoot":"","sources":["../../../../src/platform/daemon/http/router-route-contexts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEjI,OAAO,KAAK,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,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AA6B,GAAG,6BAA6B,CAEhH"}
@@ -42,6 +42,7 @@ export function buildSystemRouteContext(input) {
42
42
  return {
43
43
  approvalBroker: input.approvalBroker,
44
44
  configManager: input.configManager,
45
+ credentialStatus: input.credentialStatus,
45
46
  integrationHelpers: input.integrationHelpers,
46
47
  inspectInboundTls: input.inspectInboundTls,
47
48
  inspectOutboundTls: input.inspectOutboundTls,
@@ -0,0 +1,13 @@
1
+ /**
2
+ * router-session-broker-adapter.ts
3
+ *
4
+ * Adapts the real `SharedSessionBroker` to the narrow structural shape
5
+ * `createDaemonRuntimeRouteHandlers` (runtime-routes.ts) expects on its
6
+ * `sessionBroker` context field. Split out of router.ts (W5-S1) to stay under
7
+ * the repo's grandfathered line-cap ceiling (see scripts/check-line-cap.ts) —
8
+ * this is a pure file-organization move, not a behavior change.
9
+ */
10
+ import type { SharedSessionBroker } from '../../control-plane/index.js';
11
+ import type { DaemonRuntimeRouteContext } from './runtime-route-types.js';
12
+ export declare function buildRouterSessionBrokerAdapter(sessionBroker: SharedSessionBroker): DaemonRuntimeRouteContext['sessionBroker'];
13
+ //# sourceMappingURL=router-session-broker-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router-session-broker-adapter.d.ts","sourceRoot":"","sources":["../../../../src/platform/daemon/http/router-session-broker-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAE1E,wBAAgB,+BAA+B,CAC7C,aAAa,EAAE,mBAAmB,GACjC,yBAAyB,CAAC,eAAe,CAAC,CAsC5C"}
@@ -0,0 +1,27 @@
1
+ export function buildRouterSessionBrokerAdapter(sessionBroker) {
2
+ return {
3
+ start: () => sessionBroker.start(),
4
+ submitMessage: (input) => sessionBroker.submitMessage(input),
5
+ steerMessage: (input) => sessionBroker.steerMessage(input),
6
+ followUpMessage: (input) => sessionBroker.followUpMessage(input),
7
+ bindAgent: async (sessionId, agentId) => {
8
+ await sessionBroker.bindAgent(sessionId, agentId);
9
+ },
10
+ createSession: (input) => sessionBroker.createSession(input),
11
+ register: (input) => sessionBroker.register(input),
12
+ getSession: (sessionId) => sessionBroker.getSession(sessionId),
13
+ getMessages: (sessionId, limit) => sessionBroker.getMessages(sessionId, limit),
14
+ getInputs: (sessionId, limit) => sessionBroker.getInputs(sessionId, limit),
15
+ getInputsSince: (sessionId, options) => sessionBroker.getInputsSince(sessionId, options),
16
+ markInputDelivered: (sessionId, inputId, options) => sessionBroker.markInputDelivered(sessionId, inputId, options),
17
+ closeSession: (sessionId) => sessionBroker.closeSession(sessionId),
18
+ reopenSession: (sessionId) => sessionBroker.reopenSession(sessionId),
19
+ detachParticipant: (sessionId, surfaceId) => sessionBroker.detachParticipant(sessionId, surfaceId),
20
+ deleteSession: (sessionId) => sessionBroker.deleteSession(sessionId),
21
+ cancelInput: (sessionId, inputId) => sessionBroker.cancelInput(sessionId, inputId),
22
+ completeAgent: async (sessionId, agentId, message, meta) => {
23
+ await sessionBroker.completeAgent(sessionId, agentId, message, meta);
24
+ },
25
+ appendCompanionMessage: (sessionId, input) => sessionBroker.appendCompanionMessage(sessionId, input),
26
+ };
27
+ }
@@ -130,7 +130,7 @@ interface DaemonHttpRouterContext {
130
130
  * Without this, the production router always passes undefined and the secrets
131
131
  * tier is permanently dead on live code paths.
132
132
  */
133
- readonly secretsManager?: Pick<import('../../config/secrets.js').SecretsManager, 'get' | 'set' | 'getGlobalHome'> | null | undefined;
133
+ readonly secretsManager?: Pick<import('../../config/secrets.js').SecretsManager, 'get' | 'set' | 'getGlobalHome' | 'list' | 'listDetailed'> | null | undefined;
134
134
  readonly trySpawnAgent: (input: Parameters<AgentManager['spawn']>[0], logLabel?: string, sessionId?: string) => import('../../tools/agent/index.js').AgentRecord | Response;
135
135
  }
136
136
  export declare class DaemonHttpRouter {
@@ -1 +1 @@
1
- {"version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