pulseed 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. package/dist/base/state/state-manager-goal-write.d.ts +22 -0
  2. package/dist/base/state/state-manager-goal-write.d.ts.map +1 -0
  3. package/dist/base/state/state-manager-goal-write.js +74 -0
  4. package/dist/base/state/state-manager-goal-write.js.map +1 -0
  5. package/dist/base/state/state-manager-wal.d.ts +11 -0
  6. package/dist/base/state/state-manager-wal.d.ts.map +1 -0
  7. package/dist/base/state/state-manager-wal.js +89 -0
  8. package/dist/base/state/state-manager-wal.js.map +1 -0
  9. package/dist/base/state/state-manager.d.ts +1 -4
  10. package/dist/base/state/state-manager.d.ts.map +1 -1
  11. package/dist/base/state/state-manager.js +18 -127
  12. package/dist/base/state/state-manager.js.map +1 -1
  13. package/dist/interface/chat/chat-runner.d.ts +1 -1
  14. package/dist/interface/chat/event-subscriber.d.ts +4 -0
  15. package/dist/interface/chat/event-subscriber.d.ts.map +1 -1
  16. package/dist/interface/chat/event-subscriber.js +49 -2
  17. package/dist/interface/chat/event-subscriber.js.map +1 -1
  18. package/dist/interface/chat/tend-command.d.ts +1 -1
  19. package/dist/interface/cli/cli-command-registry.js +1 -1
  20. package/dist/interface/cli/cli-command-registry.js.map +1 -1
  21. package/dist/interface/cli/commands/chat.js +2 -2
  22. package/dist/interface/cli/commands/daemon.d.ts.map +1 -1
  23. package/dist/interface/cli/commands/daemon.js +87 -44
  24. package/dist/interface/cli/commands/daemon.js.map +1 -1
  25. package/dist/interface/cli/commands/schedule.js +2 -2
  26. package/dist/interface/cli/commands/setup/steps-runtime.js +1 -1
  27. package/dist/interface/cli/ensure-api-key.d.ts +4 -1
  28. package/dist/interface/cli/ensure-api-key.d.ts.map +1 -1
  29. package/dist/interface/cli/ensure-api-key.js +52 -15
  30. package/dist/interface/cli/ensure-api-key.js.map +1 -1
  31. package/dist/interface/tui/app.d.ts +1 -1
  32. package/dist/interface/tui/chat/scroll.d.ts +14 -0
  33. package/dist/interface/tui/chat/scroll.d.ts.map +1 -0
  34. package/dist/interface/tui/chat/scroll.js +46 -0
  35. package/dist/interface/tui/chat/scroll.js.map +1 -0
  36. package/dist/interface/tui/chat/suggestions.d.ts +8 -0
  37. package/dist/interface/tui/chat/suggestions.d.ts.map +1 -0
  38. package/dist/interface/tui/chat/suggestions.js +112 -0
  39. package/dist/interface/tui/chat/suggestions.js.map +1 -0
  40. package/dist/interface/tui/chat/types.d.ts +31 -0
  41. package/dist/interface/tui/chat/types.d.ts.map +1 -0
  42. package/dist/interface/tui/chat/types.js +2 -0
  43. package/dist/interface/tui/chat/types.js.map +1 -0
  44. package/dist/interface/tui/chat/viewport.d.ts +3 -0
  45. package/dist/interface/tui/chat/viewport.d.ts.map +1 -0
  46. package/dist/interface/tui/chat/viewport.js +78 -0
  47. package/dist/interface/tui/chat/viewport.js.map +1 -0
  48. package/dist/interface/tui/chat.d.ts +5 -49
  49. package/dist/interface/tui/chat.d.ts.map +1 -1
  50. package/dist/interface/tui/chat.js +7 -236
  51. package/dist/interface/tui/chat.js.map +1 -1
  52. package/dist/interface/tui/entry.js +3 -3
  53. package/dist/interface/tui/use-loop.d.ts +1 -1
  54. package/dist/orchestrator/execution/task/task-lifecycle.d.ts +3 -0
  55. package/dist/orchestrator/execution/task/task-lifecycle.d.ts.map +1 -1
  56. package/dist/orchestrator/execution/task/task-lifecycle.js +3 -0
  57. package/dist/orchestrator/execution/task/task-lifecycle.js.map +1 -1
  58. package/dist/orchestrator/execution/task/task-verifier-rules.d.ts.map +1 -1
  59. package/dist/orchestrator/execution/task/task-verifier-rules.js +34 -2
  60. package/dist/orchestrator/execution/task/task-verifier-rules.js.map +1 -1
  61. package/dist/orchestrator/execution/task/task-verifier-types.d.ts +2 -0
  62. package/dist/orchestrator/execution/task/task-verifier-types.d.ts.map +1 -1
  63. package/dist/orchestrator/loop/checkpoint-manager-loop.d.ts +1 -1
  64. package/dist/orchestrator/loop/checkpoint-manager-loop.d.ts.map +1 -1
  65. package/dist/orchestrator/loop/core-loop/capability.d.ts +22 -0
  66. package/dist/orchestrator/loop/core-loop/capability.d.ts.map +1 -0
  67. package/dist/orchestrator/loop/core-loop/capability.js +151 -0
  68. package/dist/orchestrator/loop/core-loop/capability.js.map +1 -0
  69. package/dist/orchestrator/loop/core-loop/contracts.d.ts +245 -0
  70. package/dist/orchestrator/loop/core-loop/contracts.d.ts.map +1 -0
  71. package/dist/orchestrator/loop/core-loop/contracts.js +40 -0
  72. package/dist/orchestrator/loop/core-loop/contracts.js.map +1 -0
  73. package/dist/orchestrator/loop/core-loop/control.d.ts +27 -0
  74. package/dist/orchestrator/loop/core-loop/control.d.ts.map +1 -0
  75. package/dist/orchestrator/loop/core-loop/control.js +72 -0
  76. package/dist/orchestrator/loop/core-loop/control.js.map +1 -0
  77. package/dist/orchestrator/loop/core-loop/learning.d.ts +31 -0
  78. package/dist/orchestrator/loop/core-loop/learning.d.ts.map +1 -0
  79. package/dist/orchestrator/loop/core-loop/learning.js +92 -0
  80. package/dist/orchestrator/loop/core-loop/learning.js.map +1 -0
  81. package/dist/orchestrator/loop/core-loop/preparation.d.ts +63 -0
  82. package/dist/orchestrator/loop/core-loop/preparation.d.ts.map +1 -0
  83. package/dist/orchestrator/loop/core-loop/preparation.js +362 -0
  84. package/dist/orchestrator/loop/core-loop/preparation.js.map +1 -0
  85. package/dist/orchestrator/loop/core-loop/task-cycle.d.ts +29 -0
  86. package/dist/orchestrator/loop/core-loop/task-cycle.d.ts.map +1 -0
  87. package/dist/orchestrator/loop/core-loop/task-cycle.js +674 -0
  88. package/dist/orchestrator/loop/core-loop/task-cycle.js.map +1 -0
  89. package/dist/orchestrator/loop/core-loop-capability.d.ts +1 -24
  90. package/dist/orchestrator/loop/core-loop-capability.d.ts.map +1 -1
  91. package/dist/orchestrator/loop/core-loop-capability.js +1 -153
  92. package/dist/orchestrator/loop/core-loop-capability.js.map +1 -1
  93. package/dist/orchestrator/loop/core-loop-learning.d.ts +1 -34
  94. package/dist/orchestrator/loop/core-loop-learning.d.ts.map +1 -1
  95. package/dist/orchestrator/loop/core-loop-learning.js +1 -95
  96. package/dist/orchestrator/loop/core-loop-learning.js.map +1 -1
  97. package/dist/orchestrator/loop/core-loop-phases-b.d.ts +1 -31
  98. package/dist/orchestrator/loop/core-loop-phases-b.d.ts.map +1 -1
  99. package/dist/orchestrator/loop/core-loop-phases-b.js +1 -669
  100. package/dist/orchestrator/loop/core-loop-phases-b.js.map +1 -1
  101. package/dist/orchestrator/loop/core-loop-phases-c.d.ts +1 -26
  102. package/dist/orchestrator/loop/core-loop-phases-c.d.ts.map +1 -1
  103. package/dist/orchestrator/loop/core-loop-phases-c.js +1 -71
  104. package/dist/orchestrator/loop/core-loop-phases-c.js.map +1 -1
  105. package/dist/orchestrator/loop/core-loop-phases.d.ts +1 -68
  106. package/dist/orchestrator/loop/core-loop-phases.d.ts.map +1 -1
  107. package/dist/orchestrator/loop/core-loop-phases.js +1 -367
  108. package/dist/orchestrator/loop/core-loop-phases.js.map +1 -1
  109. package/dist/orchestrator/loop/core-loop-types.d.ts +1 -244
  110. package/dist/orchestrator/loop/core-loop-types.d.ts.map +1 -1
  111. package/dist/orchestrator/loop/core-loop-types.js +1 -39
  112. package/dist/orchestrator/loop/core-loop-types.js.map +1 -1
  113. package/dist/orchestrator/loop/core-loop.d.ts +3 -3
  114. package/dist/orchestrator/loop/core-loop.d.ts.map +1 -1
  115. package/dist/orchestrator/loop/core-loop.js +6 -6
  116. package/dist/orchestrator/loop/core-loop.js.map +1 -1
  117. package/dist/orchestrator/loop/loop-report-helper.d.ts +1 -1
  118. package/dist/orchestrator/loop/loop-report-helper.d.ts.map +1 -1
  119. package/dist/orchestrator/loop/parallel-dispatch.d.ts +2 -2
  120. package/dist/orchestrator/loop/parallel-dispatch.d.ts.map +1 -1
  121. package/dist/orchestrator/loop/post-loop-hooks.d.ts +1 -1
  122. package/dist/orchestrator/loop/post-loop-hooks.d.ts.map +1 -1
  123. package/dist/orchestrator/loop/tree-loop-runner.d.ts +1 -1
  124. package/dist/orchestrator/loop/tree-loop-runner.d.ts.map +1 -1
  125. package/dist/orchestrator/loop/tree-loop-runner.js +1 -1
  126. package/dist/orchestrator/loop/tree-loop-runner.js.map +1 -1
  127. package/dist/platform/dream/dream-schedule-suggestions.d.ts +1 -1
  128. package/dist/platform/drive/drive-system.d.ts +8 -0
  129. package/dist/platform/drive/drive-system.d.ts.map +1 -1
  130. package/dist/platform/drive/drive-system.js +39 -22
  131. package/dist/platform/drive/drive-system.js.map +1 -1
  132. package/dist/platform/observation/engine/observe-context.d.ts +4 -0
  133. package/dist/platform/observation/engine/observe-context.d.ts.map +1 -0
  134. package/dist/platform/observation/engine/observe-context.js +26 -0
  135. package/dist/platform/observation/engine/observe-context.js.map +1 -0
  136. package/dist/platform/observation/engine/observe-datasource-stage.d.ts +33 -0
  137. package/dist/platform/observation/engine/observe-datasource-stage.d.ts.map +1 -0
  138. package/dist/platform/observation/engine/observe-datasource-stage.js +66 -0
  139. package/dist/platform/observation/engine/observe-datasource-stage.js.map +1 -0
  140. package/dist/platform/observation/engine/observe-llm-stage.d.ts +25 -0
  141. package/dist/platform/observation/engine/observe-llm-stage.d.ts.map +1 -0
  142. package/dist/platform/observation/engine/observe-llm-stage.js +79 -0
  143. package/dist/platform/observation/engine/observe-llm-stage.js.map +1 -0
  144. package/dist/platform/observation/engine/observe-precheck.d.ts +21 -0
  145. package/dist/platform/observation/engine/observe-precheck.d.ts.map +1 -0
  146. package/dist/platform/observation/engine/observe-precheck.js +51 -0
  147. package/dist/platform/observation/engine/observe-precheck.js.map +1 -0
  148. package/dist/platform/observation/engine/observe-self-report.d.ts +18 -0
  149. package/dist/platform/observation/engine/observe-self-report.d.ts.map +1 -0
  150. package/dist/platform/observation/engine/observe-self-report.js +26 -0
  151. package/dist/platform/observation/engine/observe-self-report.js.map +1 -0
  152. package/dist/platform/observation/engine/observe-tool-stage.d.ts +21 -0
  153. package/dist/platform/observation/engine/observe-tool-stage.d.ts.map +1 -0
  154. package/dist/platform/observation/engine/observe-tool-stage.js +49 -0
  155. package/dist/platform/observation/engine/observe-tool-stage.js.map +1 -0
  156. package/dist/platform/observation/observation-engine.d.ts.map +1 -1
  157. package/dist/platform/observation/observation-engine.js +67 -246
  158. package/dist/platform/observation/observation-engine.js.map +1 -1
  159. package/dist/prompt/context-assembler.d.ts +61 -13
  160. package/dist/prompt/context-assembler.d.ts.map +1 -1
  161. package/dist/prompt/context-assembler.js +18 -3
  162. package/dist/prompt/context-assembler.js.map +1 -1
  163. package/dist/runtime/approval-broker.d.ts.map +1 -1
  164. package/dist/runtime/approval-broker.js +1 -0
  165. package/dist/runtime/approval-broker.js.map +1 -1
  166. package/dist/runtime/command-dispatcher.d.ts +35 -0
  167. package/dist/runtime/command-dispatcher.d.ts.map +1 -0
  168. package/dist/runtime/command-dispatcher.js +145 -0
  169. package/dist/runtime/command-dispatcher.js.map +1 -0
  170. package/dist/runtime/daemon/client.d.ts +67 -0
  171. package/dist/runtime/daemon/client.d.ts.map +1 -0
  172. package/dist/runtime/daemon/client.js +330 -0
  173. package/dist/runtime/daemon/client.js.map +1 -0
  174. package/dist/runtime/daemon/health.d.ts +31 -0
  175. package/dist/runtime/daemon/health.d.ts.map +1 -0
  176. package/dist/runtime/daemon/health.js +113 -0
  177. package/dist/runtime/daemon/health.js.map +1 -0
  178. package/dist/runtime/daemon/index.d.ts +9 -0
  179. package/dist/runtime/daemon/index.d.ts.map +1 -0
  180. package/dist/runtime/daemon/index.js +8 -0
  181. package/dist/runtime/daemon/index.js.map +1 -0
  182. package/dist/runtime/daemon/maintenance.d.ts +47 -0
  183. package/dist/runtime/daemon/maintenance.d.ts.map +1 -0
  184. package/dist/runtime/daemon/maintenance.js +230 -0
  185. package/dist/runtime/daemon/maintenance.js.map +1 -0
  186. package/dist/runtime/daemon/persistence.d.ts +20 -0
  187. package/dist/runtime/daemon/persistence.d.ts.map +1 -0
  188. package/dist/runtime/daemon/persistence.js +112 -0
  189. package/dist/runtime/daemon/persistence.js.map +1 -0
  190. package/dist/runtime/daemon/runner-lifecycle.d.ts +29 -0
  191. package/dist/runtime/daemon/runner-lifecycle.d.ts.map +1 -0
  192. package/dist/runtime/daemon/runner-lifecycle.js +56 -0
  193. package/dist/runtime/daemon/runner-lifecycle.js.map +1 -0
  194. package/dist/runtime/daemon/runner.d.ts +229 -0
  195. package/dist/runtime/daemon/runner.d.ts.map +1 -0
  196. package/dist/runtime/daemon/runner.js +875 -0
  197. package/dist/runtime/daemon/runner.js.map +1 -0
  198. package/dist/runtime/daemon/runtime-ownership.d.ts +30 -0
  199. package/dist/runtime/daemon/runtime-ownership.d.ts.map +1 -0
  200. package/dist/runtime/daemon/runtime-ownership.js +132 -0
  201. package/dist/runtime/daemon/runtime-ownership.js.map +1 -0
  202. package/dist/runtime/daemon/signals.d.ts +17 -0
  203. package/dist/runtime/daemon/signals.d.ts.map +1 -0
  204. package/dist/runtime/daemon/signals.js +31 -0
  205. package/dist/runtime/daemon/signals.js.map +1 -0
  206. package/dist/runtime/daemon/types.d.ts +8 -0
  207. package/dist/runtime/daemon/types.d.ts.map +1 -0
  208. package/dist/runtime/daemon/types.js +2 -0
  209. package/dist/runtime/daemon/types.js.map +1 -0
  210. package/dist/runtime/daemon-client.d.ts +1 -55
  211. package/dist/runtime/daemon-client.d.ts.map +1 -1
  212. package/dist/runtime/daemon-client.js +1 -297
  213. package/dist/runtime/daemon-client.js.map +1 -1
  214. package/dist/runtime/daemon-health.d.ts +1 -30
  215. package/dist/runtime/daemon-health.d.ts.map +1 -1
  216. package/dist/runtime/daemon-health.js +1 -112
  217. package/dist/runtime/daemon-health.js.map +1 -1
  218. package/dist/runtime/daemon-runner-lifecycle.d.ts +2 -0
  219. package/dist/runtime/daemon-runner-lifecycle.d.ts.map +1 -0
  220. package/dist/runtime/daemon-runner-lifecycle.js +2 -0
  221. package/dist/runtime/daemon-runner-lifecycle.js.map +1 -0
  222. package/dist/runtime/daemon-runner.d.ts +1 -231
  223. package/dist/runtime/daemon-runner.d.ts.map +1 -1
  224. package/dist/runtime/daemon-runner.js +1 -1042
  225. package/dist/runtime/daemon-runner.js.map +1 -1
  226. package/dist/runtime/daemon-runtime-ownership.d.ts +2 -0
  227. package/dist/runtime/daemon-runtime-ownership.d.ts.map +1 -0
  228. package/dist/runtime/daemon-runtime-ownership.js +2 -0
  229. package/dist/runtime/daemon-runtime-ownership.js.map +1 -0
  230. package/dist/runtime/daemon-signals.d.ts +1 -16
  231. package/dist/runtime/daemon-signals.d.ts.map +1 -1
  232. package/dist/runtime/daemon-signals.js +1 -30
  233. package/dist/runtime/daemon-signals.js.map +1 -1
  234. package/dist/runtime/event/dispatcher.d.ts +34 -0
  235. package/dist/runtime/event/dispatcher.d.ts.map +1 -0
  236. package/dist/runtime/event/dispatcher.js +124 -0
  237. package/dist/runtime/event/dispatcher.js.map +1 -0
  238. package/dist/runtime/event/index.d.ts +5 -0
  239. package/dist/runtime/event/index.d.ts.map +1 -0
  240. package/dist/runtime/event/index.js +5 -0
  241. package/dist/runtime/event/index.js.map +1 -0
  242. package/dist/runtime/event/server-snapshot-reader.d.ts +31 -0
  243. package/dist/runtime/event/server-snapshot-reader.d.ts.map +1 -0
  244. package/dist/runtime/event/server-snapshot-reader.js +94 -0
  245. package/dist/runtime/event/server-snapshot-reader.js.map +1 -0
  246. package/dist/runtime/event/server-sse.d.ts +25 -0
  247. package/dist/runtime/event/server-sse.d.ts.map +1 -0
  248. package/dist/runtime/event/server-sse.js +149 -0
  249. package/dist/runtime/event/server-sse.js.map +1 -0
  250. package/dist/runtime/event/server.d.ts +114 -0
  251. package/dist/runtime/event/server.d.ts.map +1 -0
  252. package/dist/runtime/event/server.js +651 -0
  253. package/dist/runtime/event/server.js.map +1 -0
  254. package/dist/runtime/event-dispatcher.d.ts +2 -0
  255. package/dist/runtime/event-dispatcher.d.ts.map +1 -0
  256. package/dist/runtime/event-dispatcher.js +2 -0
  257. package/dist/runtime/event-dispatcher.js.map +1 -0
  258. package/dist/runtime/event-server-snapshot-reader.d.ts +2 -0
  259. package/dist/runtime/event-server-snapshot-reader.d.ts.map +1 -0
  260. package/dist/runtime/event-server-snapshot-reader.js +2 -0
  261. package/dist/runtime/event-server-snapshot-reader.js.map +1 -0
  262. package/dist/runtime/event-server-sse.d.ts +2 -0
  263. package/dist/runtime/event-server-sse.d.ts.map +1 -0
  264. package/dist/runtime/event-server-sse.js +2 -0
  265. package/dist/runtime/event-server-sse.js.map +1 -0
  266. package/dist/runtime/event-server.d.ts +1 -91
  267. package/dist/runtime/event-server.d.ts.map +1 -1
  268. package/dist/runtime/event-server.js +1 -698
  269. package/dist/runtime/event-server.js.map +1 -1
  270. package/dist/runtime/executor/loop-supervisor.d.ts +9 -5
  271. package/dist/runtime/executor/loop-supervisor.d.ts.map +1 -1
  272. package/dist/runtime/executor/loop-supervisor.js +59 -76
  273. package/dist/runtime/executor/loop-supervisor.js.map +1 -1
  274. package/dist/runtime/gateway/http-channel-adapter.d.ts +1 -1
  275. package/dist/runtime/plugin-loader.d.ts +1 -1
  276. package/dist/runtime/queue/index.d.ts +0 -4
  277. package/dist/runtime/queue/index.d.ts.map +1 -1
  278. package/dist/runtime/queue/index.js +0 -2
  279. package/dist/runtime/queue/index.js.map +1 -1
  280. package/dist/runtime/queue/journal-backed-queue.d.ts.map +1 -1
  281. package/dist/runtime/queue/journal-backed-queue.js +2 -0
  282. package/dist/runtime/queue/journal-backed-queue.js.map +1 -1
  283. package/dist/runtime/schedule/engine-layers.d.ts +44 -0
  284. package/dist/runtime/schedule/engine-layers.d.ts.map +1 -0
  285. package/dist/runtime/schedule/engine-layers.js +433 -0
  286. package/dist/runtime/schedule/engine-layers.js.map +1 -0
  287. package/dist/runtime/schedule/engine.d.ts +82 -0
  288. package/dist/runtime/schedule/engine.d.ts.map +1 -0
  289. package/dist/runtime/schedule/engine.js +480 -0
  290. package/dist/runtime/schedule/engine.js.map +1 -0
  291. package/dist/runtime/schedule/index.d.ts +5 -0
  292. package/dist/runtime/schedule/index.d.ts.map +1 -0
  293. package/dist/runtime/schedule/index.js +5 -0
  294. package/dist/runtime/schedule/index.js.map +1 -0
  295. package/dist/runtime/schedule/presets.d.ts +536 -0
  296. package/dist/runtime/schedule/presets.d.ts.map +1 -0
  297. package/dist/runtime/schedule/presets.js +166 -0
  298. package/dist/runtime/schedule/presets.js.map +1 -0
  299. package/dist/runtime/schedule/source.d.ts +65 -0
  300. package/dist/runtime/schedule/source.d.ts.map +1 -0
  301. package/dist/runtime/schedule/source.js +16 -0
  302. package/dist/runtime/schedule/source.js.map +1 -0
  303. package/dist/runtime/schedule-engine-layers.d.ts +1 -43
  304. package/dist/runtime/schedule-engine-layers.d.ts.map +1 -1
  305. package/dist/runtime/schedule-engine-layers.js +1 -432
  306. package/dist/runtime/schedule-engine-layers.js.map +1 -1
  307. package/dist/runtime/schedule-engine.d.ts +1 -81
  308. package/dist/runtime/schedule-engine.d.ts.map +1 -1
  309. package/dist/runtime/schedule-engine.js +1 -479
  310. package/dist/runtime/schedule-engine.js.map +1 -1
  311. package/dist/runtime/schedule-presets.d.ts +1 -535
  312. package/dist/runtime/schedule-presets.d.ts.map +1 -1
  313. package/dist/runtime/schedule-presets.js +1 -165
  314. package/dist/runtime/schedule-presets.js.map +1 -1
  315. package/dist/runtime/schedule-source.d.ts +1 -64
  316. package/dist/runtime/schedule-source.d.ts.map +1 -1
  317. package/dist/runtime/schedule-source.js +1 -15
  318. package/dist/runtime/schedule-source.js.map +1 -1
  319. package/dist/runtime/types/daemon.d.ts.map +1 -1
  320. package/dist/runtime/types/daemon.js +2 -1
  321. package/dist/runtime/types/daemon.js.map +1 -1
  322. package/dist/runtime/watchdog.d.ts +44 -0
  323. package/dist/runtime/watchdog.d.ts.map +1 -0
  324. package/dist/runtime/watchdog.js +185 -0
  325. package/dist/runtime/watchdog.js.map +1 -0
  326. package/dist/tools/builtin/index.d.ts +1 -1
  327. package/dist/tools/schedule/CreateScheduleTool/CreateScheduleTool.d.ts +1 -1
  328. package/dist/tools/schedule/CreateScheduleTool/CreateScheduleTool.js +1 -1
  329. package/dist/tools/schedule/GetScheduleTool/GetScheduleTool.d.ts +1 -1
  330. package/dist/tools/schedule/ListSchedulesTool/ListSchedulesTool.d.ts +1 -1
  331. package/dist/tools/schedule/PauseScheduleTool/PauseScheduleTool.d.ts +1 -1
  332. package/dist/tools/schedule/RemoveScheduleTool/RemoveScheduleTool.d.ts +1 -1
  333. package/dist/tools/schedule/ResumeScheduleTool/ResumeScheduleTool.d.ts +1 -1
  334. package/dist/tools/schedule/UpdateScheduleTool/UpdateScheduleTool.d.ts +1 -1
  335. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"core-loop-phases-b.js","sourceRoot":"","sources":["../../../src/orchestrator/loop/core-loop-phases-b.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAKlC,OAAO,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AACjH,OAAO,EACL,iBAAiB,GAElB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,aAAa,EACb,YAAY,GACb,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EACL,+BAA+B,EAC/B,4BAA4B,GAC7B,MAAM,yCAAyC,CAAC;AAGjD,kBAAkB;AAElB;yEACyE;AACzE,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,GAAa,EACb,MAAc,EACd,IAAU,EACV,MAA2B,EAC3B,SAAiB;IAEjB,4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-b.js","sourceRoot":"","sources":["../../../src/orchestrator/loop/core-loop-phases-b.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
@@ -1,27 +1,2 @@
1
- import type { Logger } from "../../runtime/logger.js";
2
- import type { StateDiffCalculator, IterationSnapshot } from "./state-diff.js";
3
- import type { ResolvedLoopConfig, LoopIterationResult, CoreLoopDeps } from "./core-loop-types.js";
4
- import type { Goal } from "../../base/types/goal.js";
5
- export interface StateDiffState {
6
- previousSnapshot: IterationSnapshot | null;
7
- consecutiveSkips: number;
8
- }
9
- /**
10
- * Runs the state diff check for a loop iteration.
11
- *
12
- * Returns an object indicating whether to skip the rest of the iteration.
13
- * When `shouldSkip` is true, `result` has been fully populated with skip info
14
- * and the caller should return it immediately.
15
- * When `shouldSkip` is false, the loop should continue normally.
16
- */
17
- export declare function runStateDiffCheck(stateDiff: StateDiffCalculator, stateDiffStateMap: Map<string, StateDiffState>, goalId: string, goal: Goal, loopIndex: number, config: ResolvedLoopConfig, deps: CoreLoopDeps, result: LoopIterationResult, startTime: number, logger?: Logger): Promise<{
18
- shouldSkip: boolean;
19
- }>;
20
- /**
21
- * Attempts to run the iteration in parallel (TaskGroup mode).
22
- *
23
- * Returns `true` if the parallel path was taken (caller should return result),
24
- * `false` if parallel was skipped/unavailable (fall through to normal task cycle).
25
- */
26
- export declare function tryParallelExecution(goalId: string, goal: Goal, gapAggregate: number, result: LoopIterationResult, startTime: number, deps: CoreLoopDeps, loopIndex: number, logger?: Logger): Promise<boolean>;
1
+ export * from "./core-loop/control.js";
27
2
  //# sourceMappingURL=core-loop-phases-c.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-loop-phases-c.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/loop/core-loop-phases-c.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAG9E,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAIrD,MAAM,WAAW,cAAc;IAC7B,gBAAgB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC3C,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,mBAAmB,EAC9B,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,EAC9C,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,kBAAkB,EAC1B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,mBAAmB,EAC3B,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC;IAAE,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC,CAgDlC;AAID;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,mBAAmB,EAC3B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,OAAO,CAAC,CAclB"}
1
+ {"version":3,"file":"core-loop-phases-c.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/loop/core-loop-phases-c.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
@@ -1,72 +1,2 @@
1
- import { tryRunParallel } from "./parallel-dispatch.js";
2
- import { generateLoopReport } from "./loop-report-helper.js";
3
- /**
4
- * Runs the state diff check for a loop iteration.
5
- *
6
- * Returns an object indicating whether to skip the rest of the iteration.
7
- * When `shouldSkip` is true, `result` has been fully populated with skip info
8
- * and the caller should return it immediately.
9
- * When `shouldSkip` is false, the loop should continue normally.
10
- */
11
- export async function runStateDiffCheck(stateDiff, stateDiffStateMap, goalId, goal, loopIndex, config, deps, result, startTime, logger) {
12
- const diffState = stateDiffStateMap.get(goalId) ?? { previousSnapshot: null, consecutiveSkips: 0 };
13
- const snapshot = stateDiff.buildSnapshot(goal, loopIndex);
14
- const diff = stateDiff.compare(diffState.previousSnapshot, snapshot);
15
- diffState.previousSnapshot = snapshot;
16
- if (!diff.hasChange && diffState.consecutiveSkips < config.maxConsecutiveSkips) {
17
- diffState.consecutiveSkips++;
18
- stateDiffStateMap.set(goalId, diffState);
19
- logger?.info(`[CoreLoop] iteration ${loopIndex} skipped: no state change detected ` +
20
- `(consecutiveSkips=${diffState.consecutiveSkips}/${config.maxConsecutiveSkips})`, { goalId });
21
- result.skipped = true;
22
- result.skipReason = "no_state_change";
23
- deps.onProgress?.({
24
- iteration: loopIndex + 1,
25
- maxIterations: config.maxIterations,
26
- phase: "Skipped",
27
- skipReason: result.skipReason,
28
- });
29
- // Carry forward completion status from the already-loaded goal so a
30
- // completed goal is not forced through 5 more iterations.
31
- const goalState = await deps.stateManager.loadGoal(goalId);
32
- if (goalState?.status === "completed") {
33
- result.completionJudgment.is_complete = true;
34
- }
35
- deps.onProgress?.({
36
- iteration: loopIndex + 1,
37
- maxIterations: config.maxIterations,
38
- phase: "Skipped (no state change)",
39
- });
40
- result.elapsedMs = Date.now() - startTime;
41
- return { shouldSkip: true };
42
- }
43
- // Reset skip counter — full loop is running
44
- diffState.consecutiveSkips = 0;
45
- stateDiffStateMap.set(goalId, diffState);
46
- if (!diff.hasChange) {
47
- logger?.info(`[CoreLoop] max consecutive skips reached (${config.maxConsecutiveSkips}), ` +
48
- "forcing full iteration for stall detection", { goalId });
49
- }
50
- return { shouldSkip: false };
51
- }
52
- // ─── Parallel execution check ───
53
- /**
54
- * Attempts to run the iteration in parallel (TaskGroup mode).
55
- *
56
- * Returns `true` if the parallel path was taken (caller should return result),
57
- * `false` if parallel was skipped/unavailable (fall through to normal task cycle).
58
- */
59
- export async function tryParallelExecution(goalId, goal, gapAggregate, result, startTime, deps, loopIndex, logger) {
60
- if (!deps.parallelExecutor || !deps.generateTaskGroupFn) {
61
- return false;
62
- }
63
- const parallelResult = await tryRunParallel(goalId, goal, gapAggregate, result, startTime, deps, logger);
64
- if (parallelResult !== null) {
65
- // Parallel path completed — skip normal task cycle
66
- await generateLoopReport(goalId, loopIndex, result, goal, deps.reportingEngine, logger);
67
- result.elapsedMs = Date.now() - startTime;
68
- return true;
69
- }
70
- return false;
71
- }
1
+ export * from "./core-loop/control.js";
72
2
  //# sourceMappingURL=core-loop-phases-c.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-loop-phases-c.js","sourceRoot":"","sources":["../../../src/orchestrator/loop/core-loop-phases-c.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAe7D;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,SAA8B,EAC9B,iBAA8C,EAC9C,MAAc,EACd,IAAU,EACV,SAAiB,EACjB,MAA0B,EAC1B,IAAkB,EAClB,MAA2B,EAC3B,SAAiB,EACjB,MAAe;IAEf,MAAM,SAAS,GAAG,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,EAAE,CAAC;IACnG,MAAM,QAAQ,GAAG,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC1D,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;IACrE,SAAS,CAAC,gBAAgB,GAAG,QAAQ,CAAC;IAEtC,IAAI,CAAC,IAA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,EAAE,SAAS,CAAC,CAAC;IACzC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;QACpB,MAAM,EAAE,IAAI,CACV,6CAA6C,MAAM,CAAC,mBAAmB,KAAK;YAC5E,4CAA4C,EAC5C,EAAE,MAAM,EAAE,CACX,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;AAC/B,CAAC;AAED,mCAAmC;AAEnC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAAc,EACd,IAAU,EACV,YAAoB,EACpB,MAA2B,EAC3B,SAAiB,EACjB,IAAkB,EAClB,SAAiB,EACjB,MAAe;IAEf,IAAI,CAAC,IAAI,CAAC,gBAAgB,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACxD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,cAAc,GAAG,MAAM,cAAc,CACzC,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,CAC5D,CAAC;IACF,IAAI,cAAc,KAAK,IAAI,EAAE,CAAC;QAC5B,mDAAmD;QACnD,MAAM,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;QACxF,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;QAC1C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"core-loop-phases-c.js","sourceRoot":"","sources":["../../../src/orchestrator/loop/core-loop-phases-c.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
@@ -1,69 +1,2 @@
1
- /**
2
- * core-loop-phases.ts
3
- *
4
- * Phases 1–4 of CoreLoop.runOneIteration() as standalone functions.
5
- * Each function accepts a PhaseCtx (deps + config + logger) plus phase-specific
6
- * parameters. They mutate `result` by reference and return values as documented.
7
- *
8
- * Phases 5–7 are in core-loop-phases-b.ts.
9
- */
10
- import type { Logger } from "../../runtime/logger.js";
11
- import type { ToolExecutor } from "../../tools/executor.js";
12
- import type { Goal } from "../../base/types/goal.js";
13
- import type { GapVector } from "../../base/types/gap.js";
14
- import type { DriveScore } from "../../base/types/drive.js";
15
- import { type CoreLoopDeps, type ResolvedLoopConfig, type LoopIterationResult } from "./core-loop-types.js";
16
- /** Minimal context passed to every phase function. */
17
- export interface PhaseCtx {
18
- deps: CoreLoopDeps;
19
- config: ResolvedLoopConfig;
20
- logger: Logger | undefined;
21
- toolExecutor?: ToolExecutor;
22
- /**
23
- * Optional TimeHorizonEngine for canAffordWait gate in rebalancePortfolio (Gap 1).
24
- * When present, WaitStrategy processing is skipped if the engine reports the goal
25
- * cannot afford to wait given the remaining time budget.
26
- */
27
- timeHorizonEngine?: import('../../platform/time/time-horizon-engine.js').ITimeHorizonEngine;
28
- }
29
- /** Load goal from state, apply tree aggregation if applicable.
30
- * Returns the loaded Goal, or null if an error occurred (result is mutated). */
31
- export declare function loadGoalWithAggregation(ctx: PhaseCtx, goalId: string, result: LoopIterationResult, startTime: number): Promise<Goal | null>;
32
- /**
33
- * Automatically decompose an abstract goal into sub-goals using
34
- * TreeLoopOrchestrator.ensureGoalRefined(). Skipped when disabled,
35
- * when the goal already has children, or when the goal is a leaf.
36
- * Only root goals (decomposition_depth === 0) are auto-decomposed to
37
- * prevent recursive decomposition of child nodes.
38
- * Specificity checks are delegated to ensureGoalRefined internally.
39
- *
40
- * @param decomposedGoals - Set of goal IDs already decomposed this run.
41
- * When provided, goals already in the set are skipped and the goal ID is
42
- * added to the set after a successful decomposition attempt.
43
- */
44
- export declare function phaseAutoDecompose(goalId: string, goal: Goal, deps: CoreLoopDeps, config: ResolvedLoopConfig, logger: Logger | undefined, decomposedGoals?: Set<string>, isFirstIteration?: boolean): Promise<void>;
45
- /** Build a ToolCallContext from PhaseCtx for CoreLoop autonomous tool calls. */
46
- export declare function buildLoopToolContext(ctx: PhaseCtx, goalId: string): Promise<import("../../tools/types.js").ToolCallContext>;
47
- /** Run observation engine, reload goal after observation.
48
- * Observation failure is non-fatal — returns current goal state.
49
- * When ctx.toolExecutor is present, routes through the observe-goal tool first
50
- * and falls back to direct engine.observe() on tool failure. */
51
- export declare function observeAndReload(ctx: PhaseCtx, goalId: string, goal: Goal, loopIndex: number): Promise<Goal>;
52
- /** Calculate gap vector and aggregate.
53
- * Returns null on error.
54
- * When gap === 0, returns the gap result with skipTaskGeneration=true so the
55
- * caller continues to Phase 5 (SatisficingJudge) instead of short-circuiting.
56
- */
57
- export declare function calculateGapOrComplete(ctx: PhaseCtx, goalId: string, goal: Goal, loopIndex: number, result: LoopIterationResult, startTime: number): Promise<{
58
- gapVector: GapVector;
59
- gapAggregate: number;
60
- skipTaskGeneration?: boolean;
61
- } | null>;
62
- /** Score drives, update DriveScoreAdapter, check knowledge gap.
63
- * Returns ranked DriveScores with highDissatisfactionDimensions, or null if the caller should
64
- * return result early (knowledge gap task generated or drive scoring failed). */
65
- export declare function scoreDrivesAndCheckKnowledge(ctx: PhaseCtx, goalId: string, goal: Goal, gapVector: GapVector, loopIndex: number, result: LoopIterationResult, startTime: number, tryGenerateReport: (goalId: string, loopIndex: number, result: LoopIterationResult, goal: Goal) => void): Promise<{
66
- driveScores: DriveScore[];
67
- highDissatisfactionDimensions: string[];
68
- } | null>;
1
+ export * from "./core-loop/preparation.js";
69
2
  //# sourceMappingURL=core-loop-phases.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-loop-phases.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/loop/core-loop-phases.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,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MAAM,EACd,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAuCf;AAID;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,mBAAmB,EAC3B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC,CAyF9F;AAID;;iFAEiF;AACjF,wBAAsB,4BAA4B,CAChD,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,mBAAmB,EAC3B,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,GACtG,OAAO,CAAC;IAAE,WAAW,EAAE,UAAU,EAAE,CAAC;IAAC,6BAA6B,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,IAAI,CAAC,CAoHxF"}
1
+ {"version":3,"file":"core-loop-phases.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/loop/core-loop-phases.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC"}
@@ -1,368 +1,2 @@
1
- /**
2
- * core-loop-phases.ts
3
- *
4
- * Phases 1–4 of CoreLoop.runOneIteration() as standalone functions.
5
- * Each function accepts a PhaseCtx (deps + config + logger) plus phase-specific
6
- * parameters. They mutate `result` by reference and return values as documented.
7
- *
8
- * Phases 5–7 are in core-loop-phases-b.ts.
9
- */
10
- import { buildDriveContext, } from "./core-loop-types.js";
11
- import { logRewardComputation } from "../../platform/drive/reward-log.js";
12
- // ─── Phase 1 ───
13
- /** Load goal from state, apply tree aggregation if applicable.
14
- * Returns the loaded Goal, or null if an error occurred (result is mutated). */
15
- export async function loadGoalWithAggregation(ctx, goalId, result, startTime) {
16
- let goal;
17
- try {
18
- const loaded = await ctx.deps.stateManager.loadGoal(goalId);
19
- if (!loaded) {
20
- result.error = `Goal "${goalId}" not found`;
21
- result.elapsedMs = Date.now() - startTime;
22
- return null;
23
- }
24
- goal = loaded;
25
- }
26
- catch (err) {
27
- result.error = `Failed to load goal: ${err instanceof Error ? err.message : String(err)}`;
28
- ctx.logger?.error(`CoreLoop: ${result.error}`, { goalId });
29
- result.elapsedMs = Date.now() - startTime;
30
- return null;
31
- }
32
- // Tree aggregation
33
- if (ctx.deps.stateAggregator && goal.children_ids.length > 0) {
34
- try {
35
- await ctx.deps.stateAggregator.aggregateChildStates(goalId);
36
- const reloaded = await ctx.deps.stateManager.loadGoal(goalId);
37
- if (reloaded)
38
- goal = reloaded;
39
- }
40
- catch {
41
- // Tree aggregation failure is non-fatal
42
- }
43
- }
44
- return goal;
45
- }
46
- // ─── Phase 1b: Auto-decompose ───
47
- /**
48
- * Automatically decompose an abstract goal into sub-goals using
49
- * TreeLoopOrchestrator.ensureGoalRefined(). Skipped when disabled,
50
- * when the goal already has children, or when the goal is a leaf.
51
- * Only root goals (decomposition_depth === 0) are auto-decomposed to
52
- * prevent recursive decomposition of child nodes.
53
- * Specificity checks are delegated to ensureGoalRefined internally.
54
- *
55
- * @param decomposedGoals - Set of goal IDs already decomposed this run.
56
- * When provided, goals already in the set are skipped and the goal ID is
57
- * added to the set after a successful decomposition attempt.
58
- */
59
- export async function phaseAutoDecompose(goalId, goal, deps, config, logger, decomposedGoals, isFirstIteration) {
60
- if (config.autoDecompose === false)
61
- return;
62
- if (!deps.treeLoopOrchestrator)
63
- return;
64
- if (goal.children_ids.length > 0) {
65
- logger?.debug("[CoreLoop] phaseAutoDecompose: skipped — goal already has children", { goalId });
66
- return;
67
- }
68
- if (goal.node_type === "leaf") {
69
- logger?.debug("[CoreLoop] phaseAutoDecompose: skipped — goal is leaf", { goalId });
70
- return;
71
- }
72
- // Only auto-decompose root goals — prevent recursive decomposition of children
73
- if ((goal.decomposition_depth ?? 0) > 0) {
74
- logger?.debug("[CoreLoop] phaseAutoDecompose: skipped — non-root goal (depth > 0)", { goalId, depth: goal.decomposition_depth });
75
- return;
76
- }
77
- // Skip if already decomposed this run
78
- if (decomposedGoals?.has(goalId)) {
79
- logger?.debug("[CoreLoop] phaseAutoDecompose: skipped — already decomposed this run", { goalId });
80
- return;
81
- }
82
- const force = isFirstIteration === true;
83
- if (force) {
84
- logger?.info("[decompose] forcing goal decomposition on first iteration", { goalId });
85
- }
86
- else {
87
- logger?.info("[CoreLoop] phaseAutoDecompose: decomposing abstract goal", { goalId });
88
- }
89
- decomposedGoals?.add(goalId);
90
- try {
91
- await deps.treeLoopOrchestrator.ensureGoalRefined(goalId, { force });
92
- }
93
- catch (err) {
94
- logger?.warn("[CoreLoop] phaseAutoDecompose: ensureGoalRefined failed (non-fatal)", {
95
- goalId,
96
- error: err instanceof Error ? err.message : String(err),
97
- });
98
- return;
99
- }
100
- logger?.info("[CoreLoop] phaseAutoDecompose: decomposition complete", { goalId });
101
- }
102
- // ─── Phase 2 helpers ───
103
- /** Build a ToolCallContext from PhaseCtx for CoreLoop autonomous tool calls. */
104
- export async function buildLoopToolContext(ctx, goalId) {
105
- let trustBalance = 0;
106
- if (ctx.deps.trustManager) {
107
- try {
108
- const balance = await ctx.deps.trustManager.getBalance(goalId);
109
- trustBalance = balance.balance;
110
- }
111
- catch {
112
- // Non-fatal — default to 0
113
- }
114
- }
115
- return {
116
- cwd: process.cwd(),
117
- goalId,
118
- trustBalance,
119
- preApproved: true,
120
- approvalFn: async () => false,
121
- };
122
- }
123
- // ─── Phase 2 ───
124
- /** Run observation engine, reload goal after observation.
125
- * Observation failure is non-fatal — returns current goal state.
126
- * When ctx.toolExecutor is present, routes through the observe-goal tool first
127
- * and falls back to direct engine.observe() on tool failure. */
128
- export async function observeAndReload(ctx, goalId, goal, loopIndex) {
129
- ctx.deps.onProgress?.({
130
- iteration: loopIndex + 1,
131
- maxIterations: ctx.config.maxIterations,
132
- phase: "Observing...",
133
- });
134
- // Tool path: route through ToolExecutor when available
135
- if (ctx.toolExecutor) {
136
- try {
137
- const toolCtx = await buildLoopToolContext(ctx, goalId);
138
- const toolResult = await ctx.toolExecutor.execute("observe-goal", { goal_id: goalId }, toolCtx);
139
- if (toolResult.success) {
140
- const reloaded = await ctx.deps.stateManager.loadGoal(goalId);
141
- if (reloaded)
142
- return reloaded;
143
- return goal;
144
- }
145
- ctx.logger?.warn(`CoreLoop: observe-goal tool failed: ${toolResult.error}, falling back to direct call`);
146
- }
147
- catch (err) {
148
- ctx.logger?.warn("CoreLoop: observe-goal tool threw (falling back to direct call)", { error: err instanceof Error ? err.message : String(err) });
149
- }
150
- }
151
- // Direct path: fallback (or when toolExecutor is absent)
152
- try {
153
- const engine = ctx.deps.observationEngine;
154
- ctx.logger?.debug("CoreLoop: engine.getDataSources exists", { exists: true });
155
- const dataSources = engine.getDataSources();
156
- ctx.logger?.debug("CoreLoop: observation setup", { dataSourceCount: dataSources.length });
157
- await engine.observe(goalId, []);
158
- const reloaded = await ctx.deps.stateManager.loadGoal(goalId);
159
- if (reloaded)
160
- return reloaded;
161
- }
162
- catch (err) {
163
- ctx.logger?.warn("CoreLoop: observation failed (non-fatal)", { error: err instanceof Error ? err.message : String(err) });
164
- }
165
- return goal;
166
- }
167
- // ─── Phase 3 ───
168
- /** Calculate gap vector and aggregate.
169
- * Returns null on error.
170
- * When gap === 0, returns the gap result with skipTaskGeneration=true so the
171
- * caller continues to Phase 5 (SatisficingJudge) instead of short-circuiting.
172
- */
173
- export async function calculateGapOrComplete(ctx, goalId, goal, loopIndex, result, startTime) {
174
- let gapVector;
175
- let gapAggregate;
176
- try {
177
- // Refresh stale dimensions via tool measurement before gap calculation
178
- if (ctx.toolExecutor && goal.dimensions) {
179
- const { needsDirectMeasurement, measureDirectly } = await import("../../platform/drive/gap-calculator-tools.js");
180
- let anyRefreshed = false;
181
- for (const dim of goal.dimensions) {
182
- if (needsDirectMeasurement(dim)) {
183
- try {
184
- const refreshed = await measureDirectly(dim, ctx.toolExecutor, {
185
- cwd: process.cwd(),
186
- goalId,
187
- trustBalance: 0,
188
- preApproved: true,
189
- approvalFn: async () => false,
190
- });
191
- if (refreshed !== null) {
192
- dim.current_value = refreshed.value;
193
- dim.confidence = refreshed.confidence;
194
- anyRefreshed = true;
195
- ctx.logger?.debug(`[GapRefresh] Refreshed stale dimension ${dim.name}: confidence ${dim.confidence}`);
196
- }
197
- }
198
- catch (err) {
199
- ctx.logger?.warn(`[GapRefresh] Failed to refresh ${dim.name}: ${err instanceof Error ? err.message : String(err)}`);
200
- }
201
- }
202
- }
203
- // Persist refreshed dimension values to avoid re-measuring on the next iteration
204
- if (anyRefreshed) {
205
- try {
206
- await ctx.deps.stateManager.saveGoal(goal);
207
- ctx.logger?.debug('[GapRefresh] Persisted refreshed dimensions for goal ' + goalId);
208
- }
209
- catch (err) {
210
- ctx.logger?.warn?.('[GapRefresh] Failed to persist refreshed dimensions: ' + String(err));
211
- }
212
- }
213
- }
214
- gapVector = ctx.deps.gapCalculator.calculateGapVector(goalId, goal.dimensions, goal.uncertainty_weight);
215
- const gapValues = gapVector.gaps.map((g) => g.normalized_weighted_gap);
216
- gapAggregate = ctx.deps.gapCalculator.aggregateGaps(gapValues, goal.gap_aggregation);
217
- result.gapAggregate = gapAggregate;
218
- await ctx.deps.stateManager.appendGapHistoryEntry(goalId, {
219
- iteration: loopIndex,
220
- timestamp: new Date().toISOString(),
221
- gap_vector: gapVector.gaps.map((g) => ({
222
- dimension_name: g.dimension_name,
223
- normalized_weighted_gap: g.normalized_weighted_gap,
224
- })),
225
- confidence_vector: gapVector.gaps.map((g) => ({
226
- dimension_name: g.dimension_name,
227
- confidence: g.confidence,
228
- })),
229
- });
230
- }
231
- catch (err) {
232
- result.error = `Gap calculation failed: ${err instanceof Error ? err.message : String(err)}`;
233
- ctx.logger?.error(`CoreLoop: ${result.error}`, { goalId });
234
- result.elapsedMs = Date.now() - startTime;
235
- return null;
236
- }
237
- // Gap zero check — gap is satisfied; skip task generation but continue to
238
- // Phase 5 so SatisficingJudge can enforce confidence and double-confirmation.
239
- if (gapAggregate === 0) {
240
- ctx.logger?.info(`[CoreLoop] gap=0 for goal ${goalId} — skipping task generation, deferring to SatisficingJudge`);
241
- return { gapVector, gapAggregate, skipTaskGeneration: true };
242
- }
243
- const avgConf = gapVector.gaps.length > 0
244
- ? gapVector.gaps.reduce((s, g) => s + g.confidence, 0) / gapVector.gaps.length
245
- : undefined;
246
- ctx.deps.onProgress?.({
247
- iteration: loopIndex + 1,
248
- maxIterations: ctx.config.maxIterations,
249
- phase: "Generating task...",
250
- gap: gapAggregate,
251
- confidence: avgConf,
252
- });
253
- return { gapVector, gapAggregate };
254
- }
255
- // ─── Phase 4 ───
256
- /** Score drives, update DriveScoreAdapter, check knowledge gap.
257
- * Returns ranked DriveScores with highDissatisfactionDimensions, or null if the caller should
258
- * return result early (knowledge gap task generated or drive scoring failed). */
259
- export async function scoreDrivesAndCheckKnowledge(ctx, goalId, goal, gapVector, loopIndex, result, startTime, tryGenerateReport) {
260
- let driveScores;
261
- let highDissatisfactionDimensions = [];
262
- try {
263
- const driveContext = buildDriveContext(goal);
264
- driveScores = ctx.deps.driveScorer.scoreAllDimensions(gapVector, driveContext);
265
- const rankedScores = ctx.deps.driveScorer.rankDimensions(driveScores);
266
- result.driveScores = rankedScores;
267
- driveScores = rankedScores;
268
- if (ctx.deps.driveScoreAdapter) {
269
- ctx.deps.driveScoreAdapter.update(driveScores);
270
- }
271
- // Extract dimensions with high dissatisfaction (> 0.7) for memory tier promotion
272
- highDissatisfactionDimensions = driveScores
273
- .filter((s) => s.dissatisfaction > 0.7)
274
- .map((s) => s.dimension_name);
275
- // Consolidated reward computation log (PULSEED_REWARD_LOG=1 to enable)
276
- const confidenceAvg = gapVector.gaps.reduce((sum, g) => sum + g.confidence, 0) /
277
- Math.max(gapVector.gaps.length, 1);
278
- let trustScore = null;
279
- if (ctx.deps.trustManager) {
280
- try {
281
- const balance = await ctx.deps.trustManager.getBalance(ctx.config.adapterType);
282
- trustScore = balance.balance;
283
- }
284
- catch {
285
- // Non-fatal: trust score is diagnostic-only
286
- }
287
- }
288
- logRewardComputation({
289
- goalId,
290
- iteration: loopIndex,
291
- gapAggregate: result.gapAggregate ?? 0,
292
- confidenceAvg,
293
- trustScore,
294
- driveScores,
295
- completionJudgment: null,
296
- });
297
- }
298
- catch (err) {
299
- result.error = `Drive scoring failed: ${err instanceof Error ? err.message : String(err)}`;
300
- ctx.logger?.error(`CoreLoop: ${result.error}`, { goalId });
301
- result.elapsedMs = Date.now() - startTime;
302
- return null;
303
- }
304
- // Knowledge gap check
305
- if (ctx.deps.knowledgeManager) {
306
- try {
307
- let strategies = null;
308
- try {
309
- const portfolio = await ctx.deps.strategyManager.getPortfolio(goalId);
310
- strategies = portfolio !== null ? portfolio.strategies : null;
311
- }
312
- catch {
313
- // If strategy loading fails, leave as null
314
- }
315
- const observationContext = {
316
- observations: goal.dimensions.map((d) => ({
317
- name: d.name,
318
- current_value: d.current_value,
319
- confidence: d.confidence,
320
- })),
321
- strategies,
322
- confidence: gapVector.gaps.reduce((sum, g) => sum + g.confidence, 0) /
323
- Math.max(gapVector.gaps.length, 1),
324
- };
325
- // Skip knowledge gap detection when:
326
- // 1. Observations are purely self-report (confidence <= 0.3, no data sources)
327
- // 2. Not the first iteration — prevents repeated gap detection from blocking
328
- // task execution every loop. Gap detection runs once; after that, let the
329
- // normal task cycle proceed.
330
- const skipGapDetection = observationContext.confidence <= 0.3 ||
331
- !Number.isFinite(observationContext.confidence) ||
332
- loopIndex > 0;
333
- const gapSignal = skipGapDetection
334
- ? null
335
- : await ctx.deps.knowledgeManager.detectKnowledgeGap(observationContext);
336
- if (gapSignal !== null) {
337
- const acquisitionTask = await ctx.deps.knowledgeManager.generateAcquisitionTask(gapSignal, goalId);
338
- const acquisitionVerification = {
339
- task_id: acquisitionTask.id,
340
- verdict: "pass",
341
- confidence: 0.9,
342
- evidence: [
343
- {
344
- layer: "mechanical",
345
- description: "Knowledge acquisition task generated for gap: " + gapSignal.signal_type,
346
- confidence: 0.9,
347
- },
348
- ],
349
- dimension_updates: [],
350
- timestamp: new Date().toISOString(),
351
- };
352
- result.taskResult = {
353
- task: acquisitionTask,
354
- verificationResult: acquisitionVerification,
355
- action: "completed",
356
- };
357
- tryGenerateReport(goalId, loopIndex, result, goal);
358
- result.elapsedMs = Date.now() - startTime;
359
- return null;
360
- }
361
- }
362
- catch {
363
- // Knowledge gap detection failure is non-fatal
364
- }
365
- }
366
- return { driveScores, highDissatisfactionDimensions };
367
- }
1
+ export * from "./core-loop/preparation.js";
368
2
  //# sourceMappingURL=core-loop-phases.js.map