pulseed 0.3.0 → 0.4.1

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 (947) hide show
  1. package/dist/base/config/config-metadata.d.ts +1 -1
  2. package/dist/base/config/config-metadata.d.ts.map +1 -1
  3. package/dist/base/config/config-metadata.js +1 -1
  4. package/dist/base/config/config-metadata.js.map +1 -1
  5. package/dist/base/config/identity-loader.d.ts +1 -1
  6. package/dist/base/config/identity-loader.d.ts.map +1 -1
  7. package/dist/base/config/identity-loader.js +4 -3
  8. package/dist/base/config/identity-loader.js.map +1 -1
  9. package/dist/base/config/tool-metadata.d.ts +2 -0
  10. package/dist/base/config/tool-metadata.d.ts.map +1 -1
  11. package/dist/base/config/tool-metadata.js +30 -6
  12. package/dist/base/config/tool-metadata.js.map +1 -1
  13. package/dist/base/llm/llm-client.d.ts +12 -1
  14. package/dist/base/llm/llm-client.d.ts.map +1 -1
  15. package/dist/base/llm/llm-client.js +78 -2
  16. package/dist/base/llm/llm-client.js.map +1 -1
  17. package/dist/base/llm/ollama-client.d.ts +1 -0
  18. package/dist/base/llm/ollama-client.d.ts.map +1 -1
  19. package/dist/base/llm/ollama-client.js +1 -0
  20. package/dist/base/llm/ollama-client.js.map +1 -1
  21. package/dist/base/llm/openai-client.d.ts +3 -1
  22. package/dist/base/llm/openai-client.d.ts.map +1 -1
  23. package/dist/base/llm/openai-client.js +131 -41
  24. package/dist/base/llm/openai-client.js.map +1 -1
  25. package/dist/base/llm/provider-config.d.ts +1 -1
  26. package/dist/base/llm/provider-config.d.ts.map +1 -1
  27. package/dist/base/llm/provider-factory.d.ts.map +1 -1
  28. package/dist/base/llm/provider-factory.js +22 -3
  29. package/dist/base/llm/provider-factory.js.map +1 -1
  30. package/dist/base/state/checkpoint-trust-port.d.ts +4 -0
  31. package/dist/base/state/checkpoint-trust-port.d.ts.map +1 -0
  32. package/dist/base/state/checkpoint-trust-port.js +2 -0
  33. package/dist/base/state/checkpoint-trust-port.js.map +1 -0
  34. package/dist/base/state/state-manager-goal-write.d.ts +22 -0
  35. package/dist/base/state/state-manager-goal-write.d.ts.map +1 -0
  36. package/dist/base/state/state-manager-goal-write.js +74 -0
  37. package/dist/base/state/state-manager-goal-write.js.map +1 -0
  38. package/dist/base/state/state-manager-wal.d.ts +11 -0
  39. package/dist/base/state/state-manager-wal.d.ts.map +1 -0
  40. package/dist/base/state/state-manager-wal.js +89 -0
  41. package/dist/base/state/state-manager-wal.js.map +1 -0
  42. package/dist/base/state/state-manager.d.ts +12 -5
  43. package/dist/base/state/state-manager.d.ts.map +1 -1
  44. package/dist/base/state/state-manager.js +24 -118
  45. package/dist/base/state/state-manager.js.map +1 -1
  46. package/dist/base/utils/errors.d.ts +4 -0
  47. package/dist/base/utils/errors.d.ts.map +1 -1
  48. package/dist/base/utils/errors.js +8 -0
  49. package/dist/base/utils/errors.js.map +1 -1
  50. package/dist/base/utils/pulseed-meta.d.ts +4 -0
  51. package/dist/base/utils/pulseed-meta.d.ts.map +1 -0
  52. package/dist/base/utils/pulseed-meta.js +32 -0
  53. package/dist/base/utils/pulseed-meta.js.map +1 -0
  54. package/dist/index.d.ts +3 -0
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +1 -0
  57. package/dist/index.js.map +1 -1
  58. package/dist/interface/chat/chat-event-state.d.ts +10 -0
  59. package/dist/interface/chat/chat-event-state.d.ts.map +1 -0
  60. package/dist/interface/chat/chat-event-state.js +75 -0
  61. package/dist/interface/chat/chat-event-state.js.map +1 -0
  62. package/dist/interface/chat/chat-events.d.ts +59 -0
  63. package/dist/interface/chat/chat-events.d.ts.map +1 -0
  64. package/dist/interface/chat/chat-events.js +2 -0
  65. package/dist/interface/chat/chat-events.js.map +1 -0
  66. package/dist/interface/chat/chat-history.d.ts +4 -4
  67. package/dist/interface/chat/chat-history.d.ts.map +1 -1
  68. package/dist/interface/chat/chat-history.js +3 -3
  69. package/dist/interface/chat/chat-history.js.map +1 -1
  70. package/dist/interface/chat/chat-runner.d.ts +15 -4
  71. package/dist/interface/chat/chat-runner.d.ts.map +1 -1
  72. package/dist/interface/chat/chat-runner.js +241 -27
  73. package/dist/interface/chat/chat-runner.js.map +1 -1
  74. package/dist/interface/chat/event-subscriber.d.ts +7 -1
  75. package/dist/interface/chat/event-subscriber.d.ts.map +1 -1
  76. package/dist/interface/chat/event-subscriber.js +88 -2
  77. package/dist/interface/chat/event-subscriber.js.map +1 -1
  78. package/dist/interface/chat/grounding.d.ts +2 -0
  79. package/dist/interface/chat/grounding.d.ts.map +1 -1
  80. package/dist/interface/chat/grounding.js +95 -42
  81. package/dist/interface/chat/grounding.js.map +1 -1
  82. package/dist/interface/chat/mutation-tool-defs.js +1 -1
  83. package/dist/interface/chat/mutation-tool-defs.js.map +1 -1
  84. package/dist/interface/chat/self-knowledge-mutation-tools.d.ts.map +1 -1
  85. package/dist/interface/chat/self-knowledge-mutation-tools.js +20 -3
  86. package/dist/interface/chat/self-knowledge-mutation-tools.js.map +1 -1
  87. package/dist/interface/chat/self-knowledge-tools.js +2 -2
  88. package/dist/interface/chat/self-knowledge-tools.js.map +1 -1
  89. package/dist/interface/chat/tend-command.d.ts +1 -1
  90. package/dist/interface/cli/cli-command-registry.js +1 -1
  91. package/dist/interface/cli/cli-command-registry.js.map +1 -1
  92. package/dist/interface/cli/commands/chat.d.ts.map +1 -1
  93. package/dist/interface/cli/commands/chat.js +46 -13
  94. package/dist/interface/cli/commands/chat.js.map +1 -1
  95. package/dist/interface/cli/commands/config.d.ts.map +1 -1
  96. package/dist/interface/cli/commands/config.js +37 -6
  97. package/dist/interface/cli/commands/config.js.map +1 -1
  98. package/dist/interface/cli/commands/daemon.d.ts.map +1 -1
  99. package/dist/interface/cli/commands/daemon.js +105 -50
  100. package/dist/interface/cli/commands/daemon.js.map +1 -1
  101. package/dist/interface/cli/commands/doctor.d.ts +1 -1
  102. package/dist/interface/cli/commands/doctor.d.ts.map +1 -1
  103. package/dist/interface/cli/commands/doctor.js +5 -7
  104. package/dist/interface/cli/commands/doctor.js.map +1 -1
  105. package/dist/interface/cli/commands/presets/root-presets.d.ts +3 -3
  106. package/dist/interface/cli/commands/presets/root-presets.d.ts.map +1 -1
  107. package/dist/interface/cli/commands/presets/root-presets.js +8 -5
  108. package/dist/interface/cli/commands/presets/root-presets.js.map +1 -1
  109. package/dist/interface/cli/commands/schedule.d.ts.map +1 -1
  110. package/dist/interface/cli/commands/schedule.js +166 -13
  111. package/dist/interface/cli/commands/schedule.js.map +1 -1
  112. package/dist/interface/cli/commands/setup/steps-runtime.js +1 -1
  113. package/dist/interface/cli/ensure-api-key.d.ts +4 -1
  114. package/dist/interface/cli/ensure-api-key.d.ts.map +1 -1
  115. package/dist/interface/cli/ensure-api-key.js +52 -15
  116. package/dist/interface/cli/ensure-api-key.js.map +1 -1
  117. package/dist/interface/cli/setup.d.ts +9 -0
  118. package/dist/interface/cli/setup.d.ts.map +1 -1
  119. package/dist/interface/cli/setup.js +43 -20
  120. package/dist/interface/cli/setup.js.map +1 -1
  121. package/dist/interface/cli/utils.d.ts.map +1 -1
  122. package/dist/interface/cli/utils.js +5 -1
  123. package/dist/interface/cli/utils.js.map +1 -1
  124. package/dist/interface/tui/app.d.ts +1 -1
  125. package/dist/interface/tui/app.d.ts.map +1 -1
  126. package/dist/interface/tui/app.js +8 -12
  127. package/dist/interface/tui/app.js.map +1 -1
  128. package/dist/interface/tui/chat/scroll.d.ts +14 -0
  129. package/dist/interface/tui/chat/scroll.d.ts.map +1 -0
  130. package/dist/interface/tui/chat/scroll.js +46 -0
  131. package/dist/interface/tui/chat/scroll.js.map +1 -0
  132. package/dist/interface/tui/chat/suggestions.d.ts +8 -0
  133. package/dist/interface/tui/chat/suggestions.d.ts.map +1 -0
  134. package/dist/interface/tui/chat/suggestions.js +112 -0
  135. package/dist/interface/tui/chat/suggestions.js.map +1 -0
  136. package/dist/interface/tui/chat/types.d.ts +31 -0
  137. package/dist/interface/tui/chat/types.d.ts.map +1 -0
  138. package/dist/interface/tui/chat/types.js +2 -0
  139. package/dist/interface/tui/chat/types.js.map +1 -0
  140. package/dist/interface/tui/chat/viewport.d.ts +3 -0
  141. package/dist/interface/tui/chat/viewport.d.ts.map +1 -0
  142. package/dist/interface/tui/chat/viewport.js +78 -0
  143. package/dist/interface/tui/chat/viewport.js.map +1 -0
  144. package/dist/interface/tui/chat.d.ts +5 -49
  145. package/dist/interface/tui/chat.d.ts.map +1 -1
  146. package/dist/interface/tui/chat.js +9 -238
  147. package/dist/interface/tui/chat.js.map +1 -1
  148. package/dist/interface/tui/checkerboard-spinner.d.ts +3 -0
  149. package/dist/interface/tui/checkerboard-spinner.d.ts.map +1 -0
  150. package/dist/interface/tui/checkerboard-spinner.js +20 -0
  151. package/dist/interface/tui/checkerboard-spinner.js.map +1 -0
  152. package/dist/interface/tui/dashboard.js +2 -2
  153. package/dist/interface/tui/dashboard.js.map +1 -1
  154. package/dist/interface/tui/entry.d.ts.map +1 -1
  155. package/dist/interface/tui/entry.js +51 -7
  156. package/dist/interface/tui/entry.js.map +1 -1
  157. package/dist/interface/tui/use-loop.d.ts +1 -1
  158. package/dist/orchestrator/ethics-gate.d.ts +3 -0
  159. package/dist/orchestrator/ethics-gate.d.ts.map +1 -0
  160. package/dist/orchestrator/ethics-gate.js +2 -0
  161. package/dist/orchestrator/ethics-gate.js.map +1 -0
  162. package/dist/orchestrator/execution/context/context-builder.d.ts +8 -0
  163. package/dist/orchestrator/execution/context/context-builder.d.ts.map +1 -1
  164. package/dist/orchestrator/execution/context/context-builder.js +38 -0
  165. package/dist/orchestrator/execution/context/context-builder.js.map +1 -1
  166. package/dist/orchestrator/execution/parallel-execution-types.d.ts +7 -0
  167. package/dist/orchestrator/execution/parallel-execution-types.d.ts.map +1 -0
  168. package/dist/orchestrator/execution/parallel-execution-types.js +2 -0
  169. package/dist/orchestrator/execution/parallel-execution-types.js.map +1 -0
  170. package/dist/orchestrator/execution/parallel-executor.d.ts +2 -6
  171. package/dist/orchestrator/execution/parallel-executor.d.ts.map +1 -1
  172. package/dist/orchestrator/execution/parallel-executor.js.map +1 -1
  173. package/dist/orchestrator/execution/result-reconciler.d.ts +1 -1
  174. package/dist/orchestrator/execution/result-reconciler.d.ts.map +1 -1
  175. package/dist/orchestrator/execution/task/task-lifecycle.d.ts +8 -10
  176. package/dist/orchestrator/execution/task/task-lifecycle.d.ts.map +1 -1
  177. package/dist/orchestrator/execution/task/task-lifecycle.js +28 -1
  178. package/dist/orchestrator/execution/task/task-lifecycle.js.map +1 -1
  179. package/dist/orchestrator/execution/task/task-pipeline-cycle.d.ts +5 -35
  180. package/dist/orchestrator/execution/task/task-pipeline-cycle.d.ts.map +1 -1
  181. package/dist/orchestrator/execution/task/task-pipeline-cycle.js.map +1 -1
  182. package/dist/orchestrator/execution/task/task-pipeline-types.d.ts +39 -0
  183. package/dist/orchestrator/execution/task/task-pipeline-types.d.ts.map +1 -0
  184. package/dist/orchestrator/execution/task/task-pipeline-types.js +2 -0
  185. package/dist/orchestrator/execution/task/task-pipeline-types.js.map +1 -0
  186. package/dist/orchestrator/execution/task/task-verifier-rules.d.ts.map +1 -1
  187. package/dist/orchestrator/execution/task/task-verifier-rules.js +34 -2
  188. package/dist/orchestrator/execution/task/task-verifier-rules.js.map +1 -1
  189. package/dist/orchestrator/execution/task/task-verifier-types.d.ts +2 -0
  190. package/dist/orchestrator/execution/task/task-verifier-types.d.ts.map +1 -1
  191. package/dist/orchestrator/goal/goal-negotiator.d.ts.map +1 -1
  192. package/dist/orchestrator/goal/goal-negotiator.js +2 -1
  193. package/dist/orchestrator/goal/goal-negotiator.js.map +1 -1
  194. package/dist/orchestrator/goal/goal-refiner.d.ts.map +1 -1
  195. package/dist/orchestrator/goal/goal-refiner.js +1 -1
  196. package/dist/orchestrator/goal/goal-refiner.js.map +1 -1
  197. package/dist/orchestrator/goal/goal-tree-manager.d.ts +2 -2
  198. package/dist/orchestrator/goal/goal-tree-manager.d.ts.map +1 -1
  199. package/dist/orchestrator/goal/goal-tree-manager.js.map +1 -1
  200. package/dist/orchestrator/goal/negotiator-feasibility.d.ts +10 -0
  201. package/dist/orchestrator/goal/negotiator-feasibility.d.ts.map +1 -0
  202. package/dist/orchestrator/goal/negotiator-feasibility.js +55 -0
  203. package/dist/orchestrator/goal/negotiator-feasibility.js.map +1 -0
  204. package/dist/orchestrator/goal/negotiator-steps.d.ts +1 -6
  205. package/dist/orchestrator/goal/negotiator-steps.d.ts.map +1 -1
  206. package/dist/orchestrator/goal/negotiator-steps.js +4 -56
  207. package/dist/orchestrator/goal/negotiator-steps.js.map +1 -1
  208. package/dist/orchestrator/knowledge/knowledge-manager.d.ts +2 -0
  209. package/dist/orchestrator/knowledge/knowledge-manager.d.ts.map +1 -0
  210. package/dist/orchestrator/knowledge/knowledge-manager.js +2 -0
  211. package/dist/orchestrator/knowledge/knowledge-manager.js.map +1 -0
  212. package/dist/orchestrator/knowledge/memory/memory-lifecycle.d.ts +2 -0
  213. package/dist/orchestrator/knowledge/memory/memory-lifecycle.d.ts.map +1 -0
  214. package/dist/orchestrator/knowledge/memory/memory-lifecycle.js +2 -0
  215. package/dist/orchestrator/knowledge/memory/memory-lifecycle.js.map +1 -0
  216. package/dist/orchestrator/knowledge/transfer/knowledge-transfer.d.ts +2 -0
  217. package/dist/orchestrator/knowledge/transfer/knowledge-transfer.d.ts.map +1 -0
  218. package/dist/orchestrator/knowledge/transfer/knowledge-transfer.js +2 -0
  219. package/dist/orchestrator/knowledge/transfer/knowledge-transfer.js.map +1 -0
  220. package/dist/orchestrator/loop/checkpoint-manager-loop.d.ts +1 -1
  221. package/dist/orchestrator/loop/checkpoint-manager-loop.d.ts.map +1 -1
  222. package/dist/orchestrator/loop/core-loop/capability.d.ts +22 -0
  223. package/dist/orchestrator/loop/core-loop/capability.d.ts.map +1 -0
  224. package/dist/orchestrator/loop/core-loop/capability.js +151 -0
  225. package/dist/orchestrator/loop/core-loop/capability.js.map +1 -0
  226. package/dist/orchestrator/loop/core-loop/contracts.d.ts +245 -0
  227. package/dist/orchestrator/loop/core-loop/contracts.d.ts.map +1 -0
  228. package/dist/orchestrator/loop/core-loop/contracts.js +40 -0
  229. package/dist/orchestrator/loop/core-loop/contracts.js.map +1 -0
  230. package/dist/orchestrator/loop/core-loop/control.d.ts +27 -0
  231. package/dist/orchestrator/loop/core-loop/control.d.ts.map +1 -0
  232. package/dist/orchestrator/loop/core-loop/control.js +72 -0
  233. package/dist/orchestrator/loop/core-loop/control.js.map +1 -0
  234. package/dist/orchestrator/loop/core-loop/learning.d.ts +31 -0
  235. package/dist/orchestrator/loop/core-loop/learning.d.ts.map +1 -0
  236. package/dist/orchestrator/loop/core-loop/learning.js +92 -0
  237. package/dist/orchestrator/loop/core-loop/learning.js.map +1 -0
  238. package/dist/orchestrator/loop/core-loop/preparation.d.ts +63 -0
  239. package/dist/orchestrator/loop/core-loop/preparation.d.ts.map +1 -0
  240. package/dist/orchestrator/loop/core-loop/preparation.js +362 -0
  241. package/dist/orchestrator/loop/core-loop/preparation.js.map +1 -0
  242. package/dist/orchestrator/loop/core-loop/task-cycle.d.ts +29 -0
  243. package/dist/orchestrator/loop/core-loop/task-cycle.d.ts.map +1 -0
  244. package/dist/orchestrator/loop/core-loop/task-cycle.js +674 -0
  245. package/dist/orchestrator/loop/core-loop/task-cycle.js.map +1 -0
  246. package/dist/orchestrator/loop/core-loop-capability.d.ts +1 -18
  247. package/dist/orchestrator/loop/core-loop-capability.d.ts.map +1 -1
  248. package/dist/orchestrator/loop/core-loop-capability.js +1 -106
  249. package/dist/orchestrator/loop/core-loop-capability.js.map +1 -1
  250. package/dist/orchestrator/loop/core-loop-learning.d.ts +1 -34
  251. package/dist/orchestrator/loop/core-loop-learning.d.ts.map +1 -1
  252. package/dist/orchestrator/loop/core-loop-learning.js +1 -95
  253. package/dist/orchestrator/loop/core-loop-learning.js.map +1 -1
  254. package/dist/orchestrator/loop/core-loop-phases-b.d.ts +1 -30
  255. package/dist/orchestrator/loop/core-loop-phases-b.d.ts.map +1 -1
  256. package/dist/orchestrator/loop/core-loop-phases-b.js +1 -590
  257. package/dist/orchestrator/loop/core-loop-phases-b.js.map +1 -1
  258. package/dist/orchestrator/loop/core-loop-phases-c.d.ts +1 -26
  259. package/dist/orchestrator/loop/core-loop-phases-c.d.ts.map +1 -1
  260. package/dist/orchestrator/loop/core-loop-phases-c.js +1 -71
  261. package/dist/orchestrator/loop/core-loop-phases-c.js.map +1 -1
  262. package/dist/orchestrator/loop/core-loop-phases.d.ts +1 -68
  263. package/dist/orchestrator/loop/core-loop-phases.d.ts.map +1 -1
  264. package/dist/orchestrator/loop/core-loop-phases.js +1 -367
  265. package/dist/orchestrator/loop/core-loop-phases.js.map +1 -1
  266. package/dist/orchestrator/loop/core-loop-types.d.ts +1 -307
  267. package/dist/orchestrator/loop/core-loop-types.d.ts.map +1 -1
  268. package/dist/orchestrator/loop/core-loop-types.js +1 -64
  269. package/dist/orchestrator/loop/core-loop-types.js.map +1 -1
  270. package/dist/orchestrator/loop/core-loop.d.ts +6 -3
  271. package/dist/orchestrator/loop/core-loop.d.ts.map +1 -1
  272. package/dist/orchestrator/loop/core-loop.js +92 -8
  273. package/dist/orchestrator/loop/core-loop.js.map +1 -1
  274. package/dist/orchestrator/loop/loop-report-helper.d.ts +1 -1
  275. package/dist/orchestrator/loop/loop-report-helper.d.ts.map +1 -1
  276. package/dist/orchestrator/loop/loop-result-types.d.ts +67 -0
  277. package/dist/orchestrator/loop/loop-result-types.d.ts.map +1 -0
  278. package/dist/orchestrator/loop/loop-result-types.js +27 -0
  279. package/dist/orchestrator/loop/loop-result-types.js.map +1 -0
  280. package/dist/orchestrator/loop/parallel-dispatch.d.ts +2 -2
  281. package/dist/orchestrator/loop/parallel-dispatch.d.ts.map +1 -1
  282. package/dist/orchestrator/loop/post-loop-hooks.d.ts +4 -1
  283. package/dist/orchestrator/loop/post-loop-hooks.d.ts.map +1 -1
  284. package/dist/orchestrator/loop/post-loop-hooks.js +19 -1
  285. package/dist/orchestrator/loop/post-loop-hooks.js.map +1 -1
  286. package/dist/orchestrator/loop/tree-loop-runner.d.ts +1 -1
  287. package/dist/orchestrator/loop/tree-loop-runner.d.ts.map +1 -1
  288. package/dist/orchestrator/loop/tree-loop-runner.js +1 -1
  289. package/dist/orchestrator/loop/tree-loop-runner.js.map +1 -1
  290. package/dist/orchestrator/observation/capability-detector.d.ts +2 -0
  291. package/dist/orchestrator/observation/capability-detector.d.ts.map +1 -0
  292. package/dist/orchestrator/observation/capability-detector.js +2 -0
  293. package/dist/orchestrator/observation/capability-detector.js.map +1 -0
  294. package/dist/orchestrator/strategy/strategy-manager-base.d.ts +1 -0
  295. package/dist/orchestrator/strategy/strategy-manager-base.d.ts.map +1 -1
  296. package/dist/orchestrator/strategy/strategy-manager-base.js +48 -4
  297. package/dist/orchestrator/strategy/strategy-manager-base.js.map +1 -1
  298. package/dist/orchestrator/strategy-manager.d.ts +2 -0
  299. package/dist/orchestrator/strategy-manager.d.ts.map +1 -0
  300. package/dist/orchestrator/strategy-manager.js +2 -0
  301. package/dist/orchestrator/strategy-manager.js.map +1 -0
  302. package/dist/platform/dream/dream-activation.d.ts +52 -0
  303. package/dist/platform/dream/dream-activation.d.ts.map +1 -0
  304. package/dist/platform/dream/dream-activation.js +199 -0
  305. package/dist/platform/dream/dream-activation.js.map +1 -0
  306. package/dist/platform/dream/dream-analyzer.d.ts +53 -0
  307. package/dist/platform/dream/dream-analyzer.d.ts.map +1 -0
  308. package/dist/platform/dream/dream-analyzer.js +489 -0
  309. package/dist/platform/dream/dream-analyzer.js.map +1 -0
  310. package/dist/platform/dream/dream-config.d.ts +6 -0
  311. package/dist/platform/dream/dream-config.d.ts.map +1 -0
  312. package/dist/platform/dream/dream-config.js +20 -0
  313. package/dist/platform/dream/dream-config.js.map +1 -0
  314. package/dist/platform/dream/dream-consolidator.d.ts +35 -0
  315. package/dist/platform/dream/dream-consolidator.d.ts.map +1 -0
  316. package/dist/platform/dream/dream-consolidator.js +304 -0
  317. package/dist/platform/dream/dream-consolidator.js.map +1 -0
  318. package/dist/platform/dream/dream-importance.d.ts +24 -0
  319. package/dist/platform/dream/dream-importance.d.ts.map +1 -0
  320. package/dist/platform/dream/dream-importance.js +71 -0
  321. package/dist/platform/dream/dream-importance.js.map +1 -0
  322. package/dist/platform/dream/dream-log-collector.d.ts +73 -0
  323. package/dist/platform/dream/dream-log-collector.d.ts.map +1 -0
  324. package/dist/platform/dream/dream-log-collector.js +256 -0
  325. package/dist/platform/dream/dream-log-collector.js.map +1 -0
  326. package/dist/platform/dream/dream-log-store.d.ts +22 -0
  327. package/dist/platform/dream/dream-log-store.d.ts.map +1 -0
  328. package/dist/platform/dream/dream-log-store.js +150 -0
  329. package/dist/platform/dream/dream-log-store.js.map +1 -0
  330. package/dist/platform/dream/dream-schedule-suggestions.d.ts +26 -0
  331. package/dist/platform/dream/dream-schedule-suggestions.d.ts.map +1 -0
  332. package/dist/platform/dream/dream-schedule-suggestions.js +195 -0
  333. package/dist/platform/dream/dream-schedule-suggestions.js.map +1 -0
  334. package/dist/platform/dream/dream-types.d.ts +2587 -0
  335. package/dist/platform/dream/dream-types.d.ts.map +1 -0
  336. package/dist/platform/dream/dream-types.js +265 -0
  337. package/dist/platform/dream/dream-types.js.map +1 -0
  338. package/dist/platform/dream/index.d.ts +6 -0
  339. package/dist/platform/dream/index.d.ts.map +1 -0
  340. package/dist/platform/dream/index.js +6 -0
  341. package/dist/platform/dream/index.js.map +1 -0
  342. package/dist/platform/drive/drive-system.d.ts +8 -0
  343. package/dist/platform/drive/drive-system.d.ts.map +1 -1
  344. package/dist/platform/drive/drive-system.js +39 -22
  345. package/dist/platform/drive/drive-system.js.map +1 -1
  346. package/dist/platform/ethics-gate.d.ts +2 -0
  347. package/dist/platform/ethics-gate.d.ts.map +1 -0
  348. package/dist/platform/ethics-gate.js +2 -0
  349. package/dist/platform/ethics-gate.js.map +1 -0
  350. package/dist/platform/execution/task/task-lifecycle.d.ts +2 -0
  351. package/dist/platform/execution/task/task-lifecycle.d.ts.map +1 -0
  352. package/dist/platform/execution/task/task-lifecycle.js +2 -0
  353. package/dist/platform/execution/task/task-lifecycle.js.map +1 -0
  354. package/dist/platform/knowledge/transfer/knowledge-transfer-apply.d.ts.map +1 -1
  355. package/dist/platform/knowledge/transfer/knowledge-transfer-apply.js +6 -0
  356. package/dist/platform/knowledge/transfer/knowledge-transfer-apply.js.map +1 -1
  357. package/dist/platform/knowledge/transfer/knowledge-transfer-detect.d.ts.map +1 -1
  358. package/dist/platform/knowledge/transfer/knowledge-transfer-detect.js +32 -0
  359. package/dist/platform/knowledge/transfer/knowledge-transfer-detect.js.map +1 -1
  360. package/dist/platform/knowledge/transfer/knowledge-transfer.d.ts +18 -1
  361. package/dist/platform/knowledge/transfer/knowledge-transfer.d.ts.map +1 -1
  362. package/dist/platform/knowledge/transfer/knowledge-transfer.js +121 -6
  363. package/dist/platform/knowledge/transfer/knowledge-transfer.js.map +1 -1
  364. package/dist/platform/observation/capability-detector.d.ts +8 -0
  365. package/dist/platform/observation/capability-detector.d.ts.map +1 -1
  366. package/dist/platform/observation/capability-detector.js +71 -4
  367. package/dist/platform/observation/capability-detector.js.map +1 -1
  368. package/dist/platform/observation/data-source-adapter.d.ts +19 -0
  369. package/dist/platform/observation/data-source-adapter.d.ts.map +1 -1
  370. package/dist/platform/observation/data-source-adapter.js +166 -0
  371. package/dist/platform/observation/data-source-adapter.js.map +1 -1
  372. package/dist/platform/observation/engine/observe-context.d.ts +4 -0
  373. package/dist/platform/observation/engine/observe-context.d.ts.map +1 -0
  374. package/dist/platform/observation/engine/observe-context.js +26 -0
  375. package/dist/platform/observation/engine/observe-context.js.map +1 -0
  376. package/dist/platform/observation/engine/observe-datasource-stage.d.ts +33 -0
  377. package/dist/platform/observation/engine/observe-datasource-stage.d.ts.map +1 -0
  378. package/dist/platform/observation/engine/observe-datasource-stage.js +66 -0
  379. package/dist/platform/observation/engine/observe-datasource-stage.js.map +1 -0
  380. package/dist/platform/observation/engine/observe-llm-stage.d.ts +25 -0
  381. package/dist/platform/observation/engine/observe-llm-stage.d.ts.map +1 -0
  382. package/dist/platform/observation/engine/observe-llm-stage.js +79 -0
  383. package/dist/platform/observation/engine/observe-llm-stage.js.map +1 -0
  384. package/dist/platform/observation/engine/observe-precheck.d.ts +21 -0
  385. package/dist/platform/observation/engine/observe-precheck.d.ts.map +1 -0
  386. package/dist/platform/observation/engine/observe-precheck.js +51 -0
  387. package/dist/platform/observation/engine/observe-precheck.js.map +1 -0
  388. package/dist/platform/observation/engine/observe-self-report.d.ts +18 -0
  389. package/dist/platform/observation/engine/observe-self-report.d.ts.map +1 -0
  390. package/dist/platform/observation/engine/observe-self-report.js +26 -0
  391. package/dist/platform/observation/engine/observe-self-report.js.map +1 -0
  392. package/dist/platform/observation/engine/observe-tool-stage.d.ts +21 -0
  393. package/dist/platform/observation/engine/observe-tool-stage.d.ts.map +1 -0
  394. package/dist/platform/observation/engine/observe-tool-stage.js +49 -0
  395. package/dist/platform/observation/engine/observe-tool-stage.js.map +1 -0
  396. package/dist/platform/observation/observation-engine.d.ts.map +1 -1
  397. package/dist/platform/observation/observation-engine.js +67 -246
  398. package/dist/platform/observation/observation-engine.js.map +1 -1
  399. package/dist/platform/observation/observation-helpers.d.ts +6 -0
  400. package/dist/platform/observation/observation-helpers.d.ts.map +1 -1
  401. package/dist/platform/observation/observation-helpers.js +2 -0
  402. package/dist/platform/observation/observation-helpers.js.map +1 -1
  403. package/dist/platform/observation/types/data-source.d.ts +12 -0
  404. package/dist/platform/observation/types/data-source.d.ts.map +1 -1
  405. package/dist/platform/observation/types/data-source.js +1 -0
  406. package/dist/platform/observation/types/data-source.js.map +1 -1
  407. package/dist/platform/runtime/plugin-loader.d.ts +2 -0
  408. package/dist/platform/runtime/plugin-loader.d.ts.map +1 -0
  409. package/dist/platform/runtime/plugin-loader.js +2 -0
  410. package/dist/platform/runtime/plugin-loader.js.map +1 -0
  411. package/dist/platform/tools/executor.d.ts +2 -0
  412. package/dist/platform/tools/executor.d.ts.map +1 -0
  413. package/dist/platform/tools/executor.js +2 -0
  414. package/dist/platform/tools/executor.js.map +1 -0
  415. package/dist/prompt/context-assembler.d.ts +61 -13
  416. package/dist/prompt/context-assembler.d.ts.map +1 -1
  417. package/dist/prompt/context-assembler.js +18 -3
  418. package/dist/prompt/context-assembler.js.map +1 -1
  419. package/dist/prompt/purposes/dream.d.ts +9 -0
  420. package/dist/prompt/purposes/dream.d.ts.map +1 -0
  421. package/dist/prompt/purposes/dream.js +71 -0
  422. package/dist/prompt/purposes/dream.js.map +1 -0
  423. package/dist/prompt/purposes/index.d.ts +1 -0
  424. package/dist/prompt/purposes/index.d.ts.map +1 -1
  425. package/dist/prompt/purposes/index.js +1 -0
  426. package/dist/prompt/purposes/index.js.map +1 -1
  427. package/dist/reporting/report-formatters.d.ts +1 -1
  428. package/dist/reporting/report-formatters.d.ts.map +1 -1
  429. package/dist/reporting/reporting-engine.d.ts +2 -24
  430. package/dist/reporting/reporting-engine.d.ts.map +1 -1
  431. package/dist/reporting/reporting-engine.js +0 -1
  432. package/dist/reporting/reporting-engine.js.map +1 -1
  433. package/dist/reporting/reporting-types.d.ts +25 -0
  434. package/dist/reporting/reporting-types.d.ts.map +1 -0
  435. package/dist/reporting/reporting-types.js +2 -0
  436. package/dist/reporting/reporting-types.js.map +1 -0
  437. package/dist/runtime/approval-broker.d.ts +44 -0
  438. package/dist/runtime/approval-broker.d.ts.map +1 -0
  439. package/dist/runtime/approval-broker.js +141 -0
  440. package/dist/runtime/approval-broker.js.map +1 -0
  441. package/dist/runtime/command-dispatcher.d.ts +35 -0
  442. package/dist/runtime/command-dispatcher.d.ts.map +1 -0
  443. package/dist/runtime/command-dispatcher.js +145 -0
  444. package/dist/runtime/command-dispatcher.js.map +1 -0
  445. package/dist/runtime/daemon/client.d.ts +67 -0
  446. package/dist/runtime/daemon/client.d.ts.map +1 -0
  447. package/dist/runtime/daemon/client.js +330 -0
  448. package/dist/runtime/daemon/client.js.map +1 -0
  449. package/dist/runtime/daemon/health.d.ts +31 -0
  450. package/dist/runtime/daemon/health.d.ts.map +1 -0
  451. package/dist/runtime/daemon/health.js +113 -0
  452. package/dist/runtime/daemon/health.js.map +1 -0
  453. package/dist/runtime/daemon/index.d.ts +9 -0
  454. package/dist/runtime/daemon/index.d.ts.map +1 -0
  455. package/dist/runtime/daemon/index.js +8 -0
  456. package/dist/runtime/daemon/index.js.map +1 -0
  457. package/dist/runtime/daemon/maintenance.d.ts +47 -0
  458. package/dist/runtime/daemon/maintenance.d.ts.map +1 -0
  459. package/dist/runtime/daemon/maintenance.js +230 -0
  460. package/dist/runtime/daemon/maintenance.js.map +1 -0
  461. package/dist/runtime/daemon/persistence.d.ts +20 -0
  462. package/dist/runtime/daemon/persistence.d.ts.map +1 -0
  463. package/dist/runtime/daemon/persistence.js +112 -0
  464. package/dist/runtime/daemon/persistence.js.map +1 -0
  465. package/dist/runtime/daemon/runner-lifecycle.d.ts +29 -0
  466. package/dist/runtime/daemon/runner-lifecycle.d.ts.map +1 -0
  467. package/dist/runtime/daemon/runner-lifecycle.js +56 -0
  468. package/dist/runtime/daemon/runner-lifecycle.js.map +1 -0
  469. package/dist/runtime/daemon/runner.d.ts +229 -0
  470. package/dist/runtime/daemon/runner.d.ts.map +1 -0
  471. package/dist/runtime/daemon/runner.js +875 -0
  472. package/dist/runtime/daemon/runner.js.map +1 -0
  473. package/dist/runtime/daemon/runtime-ownership.d.ts +30 -0
  474. package/dist/runtime/daemon/runtime-ownership.d.ts.map +1 -0
  475. package/dist/runtime/daemon/runtime-ownership.js +132 -0
  476. package/dist/runtime/daemon/runtime-ownership.js.map +1 -0
  477. package/dist/runtime/daemon/signals.d.ts +17 -0
  478. package/dist/runtime/daemon/signals.d.ts.map +1 -0
  479. package/dist/runtime/daemon/signals.js +31 -0
  480. package/dist/runtime/daemon/signals.js.map +1 -0
  481. package/dist/runtime/daemon/types.d.ts +8 -0
  482. package/dist/runtime/daemon/types.d.ts.map +1 -0
  483. package/dist/runtime/daemon/types.js +2 -0
  484. package/dist/runtime/daemon/types.js.map +1 -0
  485. package/dist/runtime/daemon-client.d.ts +1 -55
  486. package/dist/runtime/daemon-client.d.ts.map +1 -1
  487. package/dist/runtime/daemon-client.js +1 -297
  488. package/dist/runtime/daemon-client.js.map +1 -1
  489. package/dist/runtime/daemon-health.d.ts +1 -30
  490. package/dist/runtime/daemon-health.d.ts.map +1 -1
  491. package/dist/runtime/daemon-health.js +1 -112
  492. package/dist/runtime/daemon-health.js.map +1 -1
  493. package/dist/runtime/daemon-runner-lifecycle.d.ts +2 -0
  494. package/dist/runtime/daemon-runner-lifecycle.d.ts.map +1 -0
  495. package/dist/runtime/daemon-runner-lifecycle.js +2 -0
  496. package/dist/runtime/daemon-runner-lifecycle.js.map +1 -0
  497. package/dist/runtime/daemon-runner.d.ts +1 -209
  498. package/dist/runtime/daemon-runner.d.ts.map +1 -1
  499. package/dist/runtime/daemon-runner.js +1 -874
  500. package/dist/runtime/daemon-runner.js.map +1 -1
  501. package/dist/runtime/daemon-runtime-ownership.d.ts +2 -0
  502. package/dist/runtime/daemon-runtime-ownership.d.ts.map +1 -0
  503. package/dist/runtime/daemon-runtime-ownership.js +2 -0
  504. package/dist/runtime/daemon-runtime-ownership.js.map +1 -0
  505. package/dist/runtime/daemon-signals.d.ts +1 -16
  506. package/dist/runtime/daemon-signals.d.ts.map +1 -1
  507. package/dist/runtime/daemon-signals.js +1 -30
  508. package/dist/runtime/daemon-signals.js.map +1 -1
  509. package/dist/runtime/event/dispatcher.d.ts +34 -0
  510. package/dist/runtime/event/dispatcher.d.ts.map +1 -0
  511. package/dist/runtime/event/dispatcher.js +124 -0
  512. package/dist/runtime/event/dispatcher.js.map +1 -0
  513. package/dist/runtime/event/index.d.ts +5 -0
  514. package/dist/runtime/event/index.d.ts.map +1 -0
  515. package/dist/runtime/event/index.js +5 -0
  516. package/dist/runtime/event/index.js.map +1 -0
  517. package/dist/runtime/event/server-snapshot-reader.d.ts +31 -0
  518. package/dist/runtime/event/server-snapshot-reader.d.ts.map +1 -0
  519. package/dist/runtime/event/server-snapshot-reader.js +94 -0
  520. package/dist/runtime/event/server-snapshot-reader.js.map +1 -0
  521. package/dist/runtime/event/server-sse.d.ts +25 -0
  522. package/dist/runtime/event/server-sse.d.ts.map +1 -0
  523. package/dist/runtime/event/server-sse.js +149 -0
  524. package/dist/runtime/event/server-sse.js.map +1 -0
  525. package/dist/runtime/event/server.d.ts +114 -0
  526. package/dist/runtime/event/server.d.ts.map +1 -0
  527. package/dist/runtime/event/server.js +651 -0
  528. package/dist/runtime/event/server.js.map +1 -0
  529. package/dist/runtime/event-dispatcher.d.ts +2 -0
  530. package/dist/runtime/event-dispatcher.d.ts.map +1 -0
  531. package/dist/runtime/event-dispatcher.js +2 -0
  532. package/dist/runtime/event-dispatcher.js.map +1 -0
  533. package/dist/runtime/event-server-snapshot-reader.d.ts +2 -0
  534. package/dist/runtime/event-server-snapshot-reader.d.ts.map +1 -0
  535. package/dist/runtime/event-server-snapshot-reader.js +2 -0
  536. package/dist/runtime/event-server-snapshot-reader.js.map +1 -0
  537. package/dist/runtime/event-server-sse.d.ts +2 -0
  538. package/dist/runtime/event-server-sse.d.ts.map +1 -0
  539. package/dist/runtime/event-server-sse.js +2 -0
  540. package/dist/runtime/event-server-sse.js.map +1 -0
  541. package/dist/runtime/event-server.d.ts +1 -81
  542. package/dist/runtime/event-server.d.ts.map +1 -1
  543. package/dist/runtime/event-server.js +1 -599
  544. package/dist/runtime/event-server.js.map +1 -1
  545. package/dist/runtime/executor/loop-supervisor.d.ts +25 -2
  546. package/dist/runtime/executor/loop-supervisor.d.ts.map +1 -1
  547. package/dist/runtime/executor/loop-supervisor.js +249 -57
  548. package/dist/runtime/executor/loop-supervisor.js.map +1 -1
  549. package/dist/runtime/gateway/http-channel-adapter.d.ts +1 -1
  550. package/dist/runtime/gateway/http-channel-adapter.js +2 -2
  551. package/dist/runtime/gateway/http-channel-adapter.js.map +1 -1
  552. package/dist/runtime/gateway/ingress-gateway.js +1 -1
  553. package/dist/runtime/gateway/ingress-gateway.js.map +1 -1
  554. package/dist/runtime/goal-lease-manager.d.ts +35 -0
  555. package/dist/runtime/goal-lease-manager.d.ts.map +1 -0
  556. package/dist/runtime/goal-lease-manager.js +191 -0
  557. package/dist/runtime/goal-lease-manager.js.map +1 -0
  558. package/dist/runtime/hook-manager.d.ts +4 -0
  559. package/dist/runtime/hook-manager.d.ts.map +1 -1
  560. package/dist/runtime/hook-manager.js +33 -0
  561. package/dist/runtime/hook-manager.js.map +1 -1
  562. package/dist/runtime/leader-lock-manager.d.ts +30 -0
  563. package/dist/runtime/leader-lock-manager.d.ts.map +1 -0
  564. package/dist/runtime/leader-lock-manager.js +160 -0
  565. package/dist/runtime/leader-lock-manager.js.map +1 -0
  566. package/dist/runtime/notification-dispatcher.d.ts +2 -0
  567. package/dist/runtime/notification-dispatcher.d.ts.map +1 -1
  568. package/dist/runtime/notification-dispatcher.js +12 -0
  569. package/dist/runtime/notification-dispatcher.js.map +1 -1
  570. package/dist/runtime/plugin-loader.d.ts +1 -1
  571. package/dist/runtime/queue/index.d.ts +4 -4
  572. package/dist/runtime/queue/index.d.ts.map +1 -1
  573. package/dist/runtime/queue/index.js +2 -2
  574. package/dist/runtime/queue/index.js.map +1 -1
  575. package/dist/runtime/queue/journal-backed-queue.d.ts +80 -0
  576. package/dist/runtime/queue/journal-backed-queue.d.ts.map +1 -0
  577. package/dist/runtime/queue/journal-backed-queue.js +511 -0
  578. package/dist/runtime/queue/journal-backed-queue.js.map +1 -0
  579. package/dist/runtime/queue/queue-claim-sweeper.d.ts +15 -0
  580. package/dist/runtime/queue/queue-claim-sweeper.d.ts.map +1 -0
  581. package/dist/runtime/queue/queue-claim-sweeper.js +28 -0
  582. package/dist/runtime/queue/queue-claim-sweeper.js.map +1 -0
  583. package/dist/runtime/schedule/engine-layers.d.ts +44 -0
  584. package/dist/runtime/schedule/engine-layers.d.ts.map +1 -0
  585. package/dist/runtime/schedule/engine-layers.js +433 -0
  586. package/dist/runtime/schedule/engine-layers.js.map +1 -0
  587. package/dist/runtime/schedule/engine.d.ts +82 -0
  588. package/dist/runtime/schedule/engine.d.ts.map +1 -0
  589. package/dist/runtime/schedule/engine.js +480 -0
  590. package/dist/runtime/schedule/engine.js.map +1 -0
  591. package/dist/runtime/schedule/index.d.ts +5 -0
  592. package/dist/runtime/schedule/index.d.ts.map +1 -0
  593. package/dist/runtime/schedule/index.js +5 -0
  594. package/dist/runtime/schedule/index.js.map +1 -0
  595. package/dist/runtime/schedule/presets.d.ts +536 -0
  596. package/dist/runtime/schedule/presets.d.ts.map +1 -0
  597. package/dist/runtime/schedule/presets.js +166 -0
  598. package/dist/runtime/schedule/presets.js.map +1 -0
  599. package/dist/runtime/schedule/source.d.ts +65 -0
  600. package/dist/runtime/schedule/source.d.ts.map +1 -0
  601. package/dist/runtime/schedule/source.js +16 -0
  602. package/dist/runtime/schedule/source.js.map +1 -0
  603. package/dist/runtime/schedule-engine-layers.d.ts +1 -37
  604. package/dist/runtime/schedule-engine-layers.d.ts.map +1 -1
  605. package/dist/runtime/schedule-engine-layers.js +1 -301
  606. package/dist/runtime/schedule-engine-layers.js.map +1 -1
  607. package/dist/runtime/schedule-engine.d.ts +1 -61
  608. package/dist/runtime/schedule-engine.d.ts.map +1 -1
  609. package/dist/runtime/schedule-engine.js +1 -397
  610. package/dist/runtime/schedule-engine.js.map +1 -1
  611. package/dist/runtime/schedule-presets.d.ts +2 -0
  612. package/dist/runtime/schedule-presets.d.ts.map +1 -0
  613. package/dist/runtime/schedule-presets.js +2 -0
  614. package/dist/runtime/schedule-presets.js.map +1 -0
  615. package/dist/runtime/schedule-source.d.ts +1 -64
  616. package/dist/runtime/schedule-source.d.ts.map +1 -1
  617. package/dist/runtime/schedule-source.js +1 -15
  618. package/dist/runtime/schedule-source.js.map +1 -1
  619. package/dist/runtime/store/approval-store.d.ts +26 -0
  620. package/dist/runtime/store/approval-store.d.ts.map +1 -0
  621. package/dist/runtime/store/approval-store.js +119 -0
  622. package/dist/runtime/store/approval-store.js.map +1 -0
  623. package/dist/runtime/store/health-store.d.ts +16 -0
  624. package/dist/runtime/store/health-store.d.ts.map +1 -0
  625. package/dist/runtime/store/health-store.js +68 -0
  626. package/dist/runtime/store/health-store.js.map +1 -0
  627. package/dist/runtime/store/index.d.ts +10 -0
  628. package/dist/runtime/store/index.d.ts.map +1 -0
  629. package/dist/runtime/store/index.js +7 -0
  630. package/dist/runtime/store/index.js.map +1 -0
  631. package/dist/runtime/store/outbox-store.d.ts +16 -0
  632. package/dist/runtime/store/outbox-store.d.ts.map +1 -0
  633. package/dist/runtime/store/outbox-store.js +92 -0
  634. package/dist/runtime/store/outbox-store.js.map +1 -0
  635. package/dist/runtime/store/runtime-journal.d.ts +19 -0
  636. package/dist/runtime/store/runtime-journal.d.ts.map +1 -0
  637. package/dist/runtime/store/runtime-journal.js +77 -0
  638. package/dist/runtime/store/runtime-journal.js.map +1 -0
  639. package/dist/runtime/store/runtime-paths.d.ts +35 -0
  640. package/dist/runtime/store/runtime-paths.d.ts.map +1 -0
  641. package/dist/runtime/store/runtime-paths.js +108 -0
  642. package/dist/runtime/store/runtime-paths.js.map +1 -0
  643. package/dist/runtime/store/runtime-schemas.d.ts +218 -0
  644. package/dist/runtime/store/runtime-schemas.d.ts.map +1 -0
  645. package/dist/runtime/store/runtime-schemas.js +94 -0
  646. package/dist/runtime/store/runtime-schemas.js.map +1 -0
  647. package/dist/runtime/types/daemon.d.ts +6 -0
  648. package/dist/runtime/types/daemon.d.ts.map +1 -1
  649. package/dist/runtime/types/daemon.js +3 -0
  650. package/dist/runtime/types/daemon.js.map +1 -1
  651. package/dist/runtime/types/hook.d.ts +12 -12
  652. package/dist/runtime/types/hook.d.ts.map +1 -1
  653. package/dist/runtime/types/hook.js +1 -0
  654. package/dist/runtime/types/hook.js.map +1 -1
  655. package/dist/runtime/types/schedule.d.ts +204 -27
  656. package/dist/runtime/types/schedule.d.ts.map +1 -1
  657. package/dist/runtime/types/schedule.js +25 -0
  658. package/dist/runtime/types/schedule.js.map +1 -1
  659. package/dist/runtime/watchdog.d.ts +44 -0
  660. package/dist/runtime/watchdog.d.ts.map +1 -0
  661. package/dist/runtime/watchdog.js +185 -0
  662. package/dist/runtime/watchdog.js.map +1 -0
  663. package/dist/tools/builtin/index.d.ts +15 -0
  664. package/dist/tools/builtin/index.d.ts.map +1 -1
  665. package/dist/tools/builtin/index.js +31 -2
  666. package/dist/tools/builtin/index.js.map +1 -1
  667. package/dist/tools/execution/MemoryConsolidateTool/MemoryConsolidateTool.d.ts +1 -1
  668. package/dist/tools/execution/MemoryConsolidateTool/MemoryConsolidateTool.d.ts.map +1 -1
  669. package/dist/tools/execution/MemoryConsolidateTool/MemoryConsolidateTool.js +6 -5
  670. package/dist/tools/execution/MemoryConsolidateTool/MemoryConsolidateTool.js.map +1 -1
  671. package/dist/tools/fs/FileEditTool/FileEditTool.d.ts +1 -1
  672. package/dist/tools/fs/FileEditTool/FileEditTool.d.ts.map +1 -1
  673. package/dist/tools/fs/FileEditTool/FileEditTool.js +1 -1
  674. package/dist/tools/fs/FileEditTool/FileEditTool.js.map +1 -1
  675. package/dist/tools/fs/FileWriteTool/FileWriteTool.d.ts +1 -1
  676. package/dist/tools/fs/FileWriteTool/FileWriteTool.d.ts.map +1 -1
  677. package/dist/tools/fs/FileWriteTool/FileWriteTool.js +1 -1
  678. package/dist/tools/fs/FileWriteTool/FileWriteTool.js.map +1 -1
  679. package/dist/tools/fs/GlobTool/GlobTool.d.ts +2 -2
  680. package/dist/tools/fs/GlobTool/GlobTool.d.ts.map +1 -1
  681. package/dist/tools/fs/GlobTool/GlobTool.js +2 -2
  682. package/dist/tools/fs/GlobTool/GlobTool.js.map +1 -1
  683. package/dist/tools/fs/GrepTool/GrepTool.d.ts +2 -2
  684. package/dist/tools/fs/GrepTool/GrepTool.d.ts.map +1 -1
  685. package/dist/tools/fs/GrepTool/GrepTool.js +9 -3
  686. package/dist/tools/fs/GrepTool/GrepTool.js.map +1 -1
  687. package/dist/tools/fs/JsonQueryTool/JsonQueryTool.d.ts +2 -2
  688. package/dist/tools/fs/JsonQueryTool/JsonQueryTool.d.ts.map +1 -1
  689. package/dist/tools/fs/JsonQueryTool/JsonQueryTool.js +6 -2
  690. package/dist/tools/fs/JsonQueryTool/JsonQueryTool.js.map +1 -1
  691. package/dist/tools/fs/ListDirTool/ListDirTool.d.ts +2 -2
  692. package/dist/tools/fs/ListDirTool/ListDirTool.d.ts.map +1 -1
  693. package/dist/tools/fs/ListDirTool/ListDirTool.js +2 -2
  694. package/dist/tools/fs/ListDirTool/ListDirTool.js.map +1 -1
  695. package/dist/tools/fs/ReadTool/ReadTool.d.ts +1 -1
  696. package/dist/tools/fs/ReadTool/ReadTool.d.ts.map +1 -1
  697. package/dist/tools/fs/ReadTool/ReadTool.js +1 -1
  698. package/dist/tools/fs/ReadTool/ReadTool.js.map +1 -1
  699. package/dist/tools/mutation/ArchiveGoalTool/ArchiveGoalTool.d.ts +1 -1
  700. package/dist/tools/mutation/ArchiveGoalTool/ArchiveGoalTool.d.ts.map +1 -1
  701. package/dist/tools/mutation/ArchiveGoalTool/ArchiveGoalTool.js +1 -1
  702. package/dist/tools/mutation/ArchiveGoalTool/ArchiveGoalTool.js.map +1 -1
  703. package/dist/tools/mutation/DeleteGoalTool/DeleteGoalTool.d.ts +1 -1
  704. package/dist/tools/mutation/DeleteGoalTool/DeleteGoalTool.d.ts.map +1 -1
  705. package/dist/tools/mutation/DeleteGoalTool/DeleteGoalTool.js +1 -1
  706. package/dist/tools/mutation/DeleteGoalTool/DeleteGoalTool.js.map +1 -1
  707. package/dist/tools/mutation/ResetTrustTool/ResetTrustTool.d.ts +1 -1
  708. package/dist/tools/mutation/ResetTrustTool/ResetTrustTool.d.ts.map +1 -1
  709. package/dist/tools/mutation/ResetTrustTool/ResetTrustTool.js +1 -1
  710. package/dist/tools/mutation/ResetTrustTool/ResetTrustTool.js.map +1 -1
  711. package/dist/tools/mutation/SetGoalTool/SetGoalTool.d.ts +2 -2
  712. package/dist/tools/mutation/SetGoalTool/SetGoalTool.d.ts.map +1 -1
  713. package/dist/tools/mutation/SetGoalTool/SetGoalTool.js +2 -2
  714. package/dist/tools/mutation/SetGoalTool/SetGoalTool.js.map +1 -1
  715. package/dist/tools/mutation/TaskCreateTool/TaskCreateTool.d.ts +216 -0
  716. package/dist/tools/mutation/TaskCreateTool/TaskCreateTool.d.ts.map +1 -0
  717. package/dist/tools/mutation/TaskCreateTool/TaskCreateTool.js +104 -0
  718. package/dist/tools/mutation/TaskCreateTool/TaskCreateTool.js.map +1 -0
  719. package/dist/tools/mutation/TaskCreateTool/constants.d.ts +5 -0
  720. package/dist/tools/mutation/TaskCreateTool/constants.d.ts.map +1 -0
  721. package/dist/tools/mutation/TaskCreateTool/constants.js +5 -0
  722. package/dist/tools/mutation/TaskCreateTool/constants.js.map +1 -0
  723. package/dist/tools/mutation/TaskCreateTool/prompt.d.ts +2 -0
  724. package/dist/tools/mutation/TaskCreateTool/prompt.d.ts.map +1 -0
  725. package/dist/tools/mutation/TaskCreateTool/prompt.js +2 -0
  726. package/dist/tools/mutation/TaskCreateTool/prompt.js.map +1 -0
  727. package/dist/tools/mutation/TaskOutputTool/TaskOutputTool.d.ts +46 -0
  728. package/dist/tools/mutation/TaskOutputTool/TaskOutputTool.d.ts.map +1 -0
  729. package/dist/tools/mutation/TaskOutputTool/TaskOutputTool.js +95 -0
  730. package/dist/tools/mutation/TaskOutputTool/TaskOutputTool.js.map +1 -0
  731. package/dist/tools/mutation/TaskOutputTool/constants.d.ts +5 -0
  732. package/dist/tools/mutation/TaskOutputTool/constants.d.ts.map +1 -0
  733. package/dist/tools/mutation/TaskOutputTool/constants.js +5 -0
  734. package/dist/tools/mutation/TaskOutputTool/constants.js.map +1 -0
  735. package/dist/tools/mutation/TaskOutputTool/prompt.d.ts +2 -0
  736. package/dist/tools/mutation/TaskOutputTool/prompt.d.ts.map +1 -0
  737. package/dist/tools/mutation/TaskOutputTool/prompt.js +2 -0
  738. package/dist/tools/mutation/TaskOutputTool/prompt.js.map +1 -0
  739. package/dist/tools/mutation/TaskStopTool/TaskStopTool.d.ts +40 -0
  740. package/dist/tools/mutation/TaskStopTool/TaskStopTool.d.ts.map +1 -0
  741. package/dist/tools/mutation/TaskStopTool/TaskStopTool.js +95 -0
  742. package/dist/tools/mutation/TaskStopTool/TaskStopTool.js.map +1 -0
  743. package/dist/tools/mutation/TaskStopTool/constants.d.ts +5 -0
  744. package/dist/tools/mutation/TaskStopTool/constants.d.ts.map +1 -0
  745. package/dist/tools/mutation/TaskStopTool/constants.js +5 -0
  746. package/dist/tools/mutation/TaskStopTool/constants.js.map +1 -0
  747. package/dist/tools/mutation/TaskStopTool/prompt.d.ts +2 -0
  748. package/dist/tools/mutation/TaskStopTool/prompt.d.ts.map +1 -0
  749. package/dist/tools/mutation/TaskStopTool/prompt.js +2 -0
  750. package/dist/tools/mutation/TaskStopTool/prompt.js.map +1 -0
  751. package/dist/tools/mutation/TaskUpdateTool/TaskUpdateTool.d.ts +270 -0
  752. package/dist/tools/mutation/TaskUpdateTool/TaskUpdateTool.d.ts.map +1 -0
  753. package/dist/tools/mutation/TaskUpdateTool/TaskUpdateTool.js +137 -0
  754. package/dist/tools/mutation/TaskUpdateTool/TaskUpdateTool.js.map +1 -0
  755. package/dist/tools/mutation/TaskUpdateTool/constants.d.ts +5 -0
  756. package/dist/tools/mutation/TaskUpdateTool/constants.d.ts.map +1 -0
  757. package/dist/tools/mutation/TaskUpdateTool/constants.js +5 -0
  758. package/dist/tools/mutation/TaskUpdateTool/constants.js.map +1 -0
  759. package/dist/tools/mutation/TaskUpdateTool/prompt.d.ts +2 -0
  760. package/dist/tools/mutation/TaskUpdateTool/prompt.d.ts.map +1 -0
  761. package/dist/tools/mutation/TaskUpdateTool/prompt.js +2 -0
  762. package/dist/tools/mutation/TaskUpdateTool/prompt.js.map +1 -0
  763. package/dist/tools/mutation/TogglePluginTool/TogglePluginTool.d.ts +1 -1
  764. package/dist/tools/mutation/TogglePluginTool/TogglePluginTool.d.ts.map +1 -1
  765. package/dist/tools/mutation/TogglePluginTool/TogglePluginTool.js +1 -1
  766. package/dist/tools/mutation/TogglePluginTool/TogglePluginTool.js.map +1 -1
  767. package/dist/tools/mutation/UpdateConfigTool/UpdateConfigTool.d.ts +2 -2
  768. package/dist/tools/mutation/UpdateConfigTool/UpdateConfigTool.d.ts.map +1 -1
  769. package/dist/tools/mutation/UpdateConfigTool/UpdateConfigTool.js +11 -2
  770. package/dist/tools/mutation/UpdateConfigTool/UpdateConfigTool.js.map +1 -1
  771. package/dist/tools/mutation/UpdateGoalTool/UpdateGoalTool.d.ts +2 -2
  772. package/dist/tools/mutation/UpdateGoalTool/UpdateGoalTool.d.ts.map +1 -1
  773. package/dist/tools/mutation/UpdateGoalTool/UpdateGoalTool.js +2 -2
  774. package/dist/tools/mutation/UpdateGoalTool/UpdateGoalTool.js.map +1 -1
  775. package/dist/tools/mutation/task-history-utils.d.ts +4 -0
  776. package/dist/tools/mutation/task-history-utils.d.ts.map +1 -0
  777. package/dist/tools/mutation/task-history-utils.js +30 -0
  778. package/dist/tools/mutation/task-history-utils.js.map +1 -0
  779. package/dist/tools/network/HttpFetchTool/HttpFetchTool.d.ts +1 -1
  780. package/dist/tools/network/HttpFetchTool/HttpFetchTool.d.ts.map +1 -1
  781. package/dist/tools/network/HttpFetchTool/HttpFetchTool.js +1 -1
  782. package/dist/tools/network/HttpFetchTool/HttpFetchTool.js.map +1 -1
  783. package/dist/tools/query/ArchitectureTool/ArchitectureTool.d.ts +2 -2
  784. package/dist/tools/query/ArchitectureTool/ArchitectureTool.d.ts.map +1 -1
  785. package/dist/tools/query/ArchitectureTool/ArchitectureTool.js +2 -2
  786. package/dist/tools/query/ArchitectureTool/ArchitectureTool.js.map +1 -1
  787. package/dist/tools/query/ConfigTool/ConfigTool.d.ts +2 -2
  788. package/dist/tools/query/ConfigTool/ConfigTool.d.ts.map +1 -1
  789. package/dist/tools/query/ConfigTool/ConfigTool.js +2 -2
  790. package/dist/tools/query/ConfigTool/ConfigTool.js.map +1 -1
  791. package/dist/tools/query/GoalStateTool/GoalStateTool.d.ts +2 -2
  792. package/dist/tools/query/GoalStateTool/GoalStateTool.d.ts.map +1 -1
  793. package/dist/tools/query/GoalStateTool/GoalStateTool.js +2 -2
  794. package/dist/tools/query/GoalStateTool/GoalStateTool.js.map +1 -1
  795. package/dist/tools/query/KnowledgeQueryTool/KnowledgeQueryTool.d.ts +2 -2
  796. package/dist/tools/query/KnowledgeQueryTool/KnowledgeQueryTool.d.ts.map +1 -1
  797. package/dist/tools/query/KnowledgeQueryTool/KnowledgeQueryTool.js +2 -2
  798. package/dist/tools/query/KnowledgeQueryTool/KnowledgeQueryTool.js.map +1 -1
  799. package/dist/tools/query/MemoryRecallTool/MemoryRecallTool.d.ts +7 -7
  800. package/dist/tools/query/MemoryRecallTool/MemoryRecallTool.d.ts.map +1 -1
  801. package/dist/tools/query/MemoryRecallTool/MemoryRecallTool.js +11 -10
  802. package/dist/tools/query/MemoryRecallTool/MemoryRecallTool.js.map +1 -1
  803. package/dist/tools/query/PluginStateTool/PluginStateTool.d.ts +2 -2
  804. package/dist/tools/query/PluginStateTool/PluginStateTool.d.ts.map +1 -1
  805. package/dist/tools/query/PluginStateTool/PluginStateTool.js +2 -2
  806. package/dist/tools/query/PluginStateTool/PluginStateTool.js.map +1 -1
  807. package/dist/tools/query/ProgressHistoryTool/ProgressHistoryTool.d.ts +4 -4
  808. package/dist/tools/query/ProgressHistoryTool/ProgressHistoryTool.d.ts.map +1 -1
  809. package/dist/tools/query/ProgressHistoryTool/ProgressHistoryTool.js +2 -2
  810. package/dist/tools/query/ProgressHistoryTool/ProgressHistoryTool.js.map +1 -1
  811. package/dist/tools/query/SessionHistoryTool/SessionHistoryTool.d.ts +2 -2
  812. package/dist/tools/query/SessionHistoryTool/SessionHistoryTool.d.ts.map +1 -1
  813. package/dist/tools/query/SessionHistoryTool/SessionHistoryTool.js +2 -2
  814. package/dist/tools/query/SessionHistoryTool/SessionHistoryTool.js.map +1 -1
  815. package/dist/tools/query/TaskGetTool/TaskGetTool.d.ts +34 -0
  816. package/dist/tools/query/TaskGetTool/TaskGetTool.d.ts.map +1 -0
  817. package/dist/tools/query/TaskGetTool/TaskGetTool.js +77 -0
  818. package/dist/tools/query/TaskGetTool/TaskGetTool.js.map +1 -0
  819. package/dist/tools/query/TaskGetTool/constants.d.ts +6 -0
  820. package/dist/tools/query/TaskGetTool/constants.d.ts.map +1 -0
  821. package/dist/tools/query/TaskGetTool/constants.js +6 -0
  822. package/dist/tools/query/TaskGetTool/constants.js.map +1 -0
  823. package/dist/tools/query/TaskGetTool/prompt.d.ts +2 -0
  824. package/dist/tools/query/TaskGetTool/prompt.d.ts.map +1 -0
  825. package/dist/tools/query/TaskGetTool/prompt.js +2 -0
  826. package/dist/tools/query/TaskGetTool/prompt.js.map +1 -0
  827. package/dist/tools/query/TaskListTool/TaskListTool.d.ts +58 -0
  828. package/dist/tools/query/TaskListTool/TaskListTool.d.ts.map +1 -0
  829. package/dist/tools/query/TaskListTool/TaskListTool.js +101 -0
  830. package/dist/tools/query/TaskListTool/TaskListTool.js.map +1 -0
  831. package/dist/tools/query/TaskListTool/constants.d.ts +6 -0
  832. package/dist/tools/query/TaskListTool/constants.d.ts.map +1 -0
  833. package/dist/tools/query/TaskListTool/constants.js +6 -0
  834. package/dist/tools/query/TaskListTool/constants.js.map +1 -0
  835. package/dist/tools/query/TaskListTool/prompt.d.ts +2 -0
  836. package/dist/tools/query/TaskListTool/prompt.d.ts.map +1 -0
  837. package/dist/tools/query/TaskListTool/prompt.js +2 -0
  838. package/dist/tools/query/TaskListTool/prompt.js.map +1 -0
  839. package/dist/tools/query/TrustStateTool/TrustStateTool.d.ts +2 -2
  840. package/dist/tools/query/TrustStateTool/TrustStateTool.d.ts.map +1 -1
  841. package/dist/tools/query/TrustStateTool/TrustStateTool.js +2 -2
  842. package/dist/tools/query/TrustStateTool/TrustStateTool.js.map +1 -1
  843. package/dist/tools/schedule/CreateScheduleTool/CreateScheduleTool.d.ts +1638 -0
  844. package/dist/tools/schedule/CreateScheduleTool/CreateScheduleTool.d.ts.map +1 -0
  845. package/dist/tools/schedule/CreateScheduleTool/CreateScheduleTool.js +86 -0
  846. package/dist/tools/schedule/CreateScheduleTool/CreateScheduleTool.js.map +1 -0
  847. package/dist/tools/schedule/CreateScheduleTool/constants.d.ts +5 -0
  848. package/dist/tools/schedule/CreateScheduleTool/constants.d.ts.map +1 -0
  849. package/dist/tools/schedule/CreateScheduleTool/constants.js +5 -0
  850. package/dist/tools/schedule/CreateScheduleTool/constants.js.map +1 -0
  851. package/dist/tools/schedule/CreateScheduleTool/prompt.d.ts +2 -0
  852. package/dist/tools/schedule/CreateScheduleTool/prompt.d.ts.map +1 -0
  853. package/dist/tools/schedule/CreateScheduleTool/prompt.js +2 -0
  854. package/dist/tools/schedule/CreateScheduleTool/prompt.js.map +1 -0
  855. package/dist/tools/schedule/GetScheduleTool/GetScheduleTool.d.ts +28 -0
  856. package/dist/tools/schedule/GetScheduleTool/GetScheduleTool.d.ts.map +1 -0
  857. package/dist/tools/schedule/GetScheduleTool/GetScheduleTool.js +79 -0
  858. package/dist/tools/schedule/GetScheduleTool/GetScheduleTool.js.map +1 -0
  859. package/dist/tools/schedule/GetScheduleTool/constants.d.ts +6 -0
  860. package/dist/tools/schedule/GetScheduleTool/constants.d.ts.map +1 -0
  861. package/dist/tools/schedule/GetScheduleTool/constants.js +6 -0
  862. package/dist/tools/schedule/GetScheduleTool/constants.js.map +1 -0
  863. package/dist/tools/schedule/GetScheduleTool/prompt.d.ts +2 -0
  864. package/dist/tools/schedule/GetScheduleTool/prompt.d.ts.map +1 -0
  865. package/dist/tools/schedule/GetScheduleTool/prompt.js +2 -0
  866. package/dist/tools/schedule/GetScheduleTool/prompt.js.map +1 -0
  867. package/dist/tools/schedule/ListSchedulesTool/ListSchedulesTool.d.ts +40 -0
  868. package/dist/tools/schedule/ListSchedulesTool/ListSchedulesTool.d.ts.map +1 -0
  869. package/dist/tools/schedule/ListSchedulesTool/ListSchedulesTool.js +83 -0
  870. package/dist/tools/schedule/ListSchedulesTool/ListSchedulesTool.js.map +1 -0
  871. package/dist/tools/schedule/ListSchedulesTool/constants.d.ts +6 -0
  872. package/dist/tools/schedule/ListSchedulesTool/constants.d.ts.map +1 -0
  873. package/dist/tools/schedule/ListSchedulesTool/constants.js +6 -0
  874. package/dist/tools/schedule/ListSchedulesTool/constants.js.map +1 -0
  875. package/dist/tools/schedule/ListSchedulesTool/prompt.d.ts +2 -0
  876. package/dist/tools/schedule/ListSchedulesTool/prompt.d.ts.map +1 -0
  877. package/dist/tools/schedule/ListSchedulesTool/prompt.js +2 -0
  878. package/dist/tools/schedule/ListSchedulesTool/prompt.js.map +1 -0
  879. package/dist/tools/schedule/PauseScheduleTool/PauseScheduleTool.d.ts +32 -0
  880. package/dist/tools/schedule/PauseScheduleTool/PauseScheduleTool.d.ts.map +1 -0
  881. package/dist/tools/schedule/PauseScheduleTool/PauseScheduleTool.js +94 -0
  882. package/dist/tools/schedule/PauseScheduleTool/PauseScheduleTool.js.map +1 -0
  883. package/dist/tools/schedule/PauseScheduleTool/constants.d.ts +5 -0
  884. package/dist/tools/schedule/PauseScheduleTool/constants.d.ts.map +1 -0
  885. package/dist/tools/schedule/PauseScheduleTool/constants.js +5 -0
  886. package/dist/tools/schedule/PauseScheduleTool/constants.js.map +1 -0
  887. package/dist/tools/schedule/PauseScheduleTool/prompt.d.ts +2 -0
  888. package/dist/tools/schedule/PauseScheduleTool/prompt.d.ts.map +1 -0
  889. package/dist/tools/schedule/PauseScheduleTool/prompt.js +2 -0
  890. package/dist/tools/schedule/PauseScheduleTool/prompt.js.map +1 -0
  891. package/dist/tools/schedule/RemoveScheduleTool/RemoveScheduleTool.d.ts +35 -0
  892. package/dist/tools/schedule/RemoveScheduleTool/RemoveScheduleTool.d.ts.map +1 -0
  893. package/dist/tools/schedule/RemoveScheduleTool/RemoveScheduleTool.js +100 -0
  894. package/dist/tools/schedule/RemoveScheduleTool/RemoveScheduleTool.js.map +1 -0
  895. package/dist/tools/schedule/RemoveScheduleTool/constants.d.ts +5 -0
  896. package/dist/tools/schedule/RemoveScheduleTool/constants.d.ts.map +1 -0
  897. package/dist/tools/schedule/RemoveScheduleTool/constants.js +5 -0
  898. package/dist/tools/schedule/RemoveScheduleTool/constants.js.map +1 -0
  899. package/dist/tools/schedule/RemoveScheduleTool/prompt.d.ts +2 -0
  900. package/dist/tools/schedule/RemoveScheduleTool/prompt.d.ts.map +1 -0
  901. package/dist/tools/schedule/RemoveScheduleTool/prompt.js +2 -0
  902. package/dist/tools/schedule/RemoveScheduleTool/prompt.js.map +1 -0
  903. package/dist/tools/schedule/ResumeScheduleTool/ResumeScheduleTool.d.ts +32 -0
  904. package/dist/tools/schedule/ResumeScheduleTool/ResumeScheduleTool.d.ts.map +1 -0
  905. package/dist/tools/schedule/ResumeScheduleTool/ResumeScheduleTool.js +94 -0
  906. package/dist/tools/schedule/ResumeScheduleTool/ResumeScheduleTool.js.map +1 -0
  907. package/dist/tools/schedule/ResumeScheduleTool/constants.d.ts +5 -0
  908. package/dist/tools/schedule/ResumeScheduleTool/constants.d.ts.map +1 -0
  909. package/dist/tools/schedule/ResumeScheduleTool/constants.js +5 -0
  910. package/dist/tools/schedule/ResumeScheduleTool/constants.js.map +1 -0
  911. package/dist/tools/schedule/ResumeScheduleTool/prompt.d.ts +2 -0
  912. package/dist/tools/schedule/ResumeScheduleTool/prompt.d.ts.map +1 -0
  913. package/dist/tools/schedule/ResumeScheduleTool/prompt.js +2 -0
  914. package/dist/tools/schedule/ResumeScheduleTool/prompt.js.map +1 -0
  915. package/dist/tools/schedule/UpdateScheduleTool/UpdateScheduleTool.d.ts +770 -0
  916. package/dist/tools/schedule/UpdateScheduleTool/UpdateScheduleTool.d.ts.map +1 -0
  917. package/dist/tools/schedule/UpdateScheduleTool/UpdateScheduleTool.js +131 -0
  918. package/dist/tools/schedule/UpdateScheduleTool/UpdateScheduleTool.js.map +1 -0
  919. package/dist/tools/schedule/UpdateScheduleTool/constants.d.ts +5 -0
  920. package/dist/tools/schedule/UpdateScheduleTool/constants.d.ts.map +1 -0
  921. package/dist/tools/schedule/UpdateScheduleTool/constants.js +5 -0
  922. package/dist/tools/schedule/UpdateScheduleTool/constants.js.map +1 -0
  923. package/dist/tools/schedule/UpdateScheduleTool/prompt.d.ts +2 -0
  924. package/dist/tools/schedule/UpdateScheduleTool/prompt.d.ts.map +1 -0
  925. package/dist/tools/schedule/UpdateScheduleTool/prompt.js +2 -0
  926. package/dist/tools/schedule/UpdateScheduleTool/prompt.js.map +1 -0
  927. package/dist/tools/system/EnvTool/EnvTool.d.ts +2 -2
  928. package/dist/tools/system/EnvTool/EnvTool.d.ts.map +1 -1
  929. package/dist/tools/system/EnvTool/EnvTool.js +2 -2
  930. package/dist/tools/system/EnvTool/EnvTool.js.map +1 -1
  931. package/dist/tools/system/GitDiffTool/GitDiffTool.d.ts +2 -2
  932. package/dist/tools/system/GitDiffTool/GitDiffTool.d.ts.map +1 -1
  933. package/dist/tools/system/GitDiffTool/GitDiffTool.js +2 -2
  934. package/dist/tools/system/GitDiffTool/GitDiffTool.js.map +1 -1
  935. package/dist/tools/system/GitLogTool/GitLogTool.d.ts +2 -2
  936. package/dist/tools/system/GitLogTool/GitLogTool.d.ts.map +1 -1
  937. package/dist/tools/system/GitLogTool/GitLogTool.js +2 -2
  938. package/dist/tools/system/GitLogTool/GitLogTool.js.map +1 -1
  939. package/dist/tools/system/SleepTool/SleepTool.d.ts +2 -2
  940. package/dist/tools/system/SleepTool/SleepTool.d.ts.map +1 -1
  941. package/dist/tools/system/SleepTool/SleepTool.js +2 -2
  942. package/dist/tools/system/SleepTool/SleepTool.js.map +1 -1
  943. package/dist/tools/system/test-runner.d.ts +2 -52
  944. package/dist/tools/system/test-runner.d.ts.map +1 -1
  945. package/dist/tools/system/test-runner.js +1 -180
  946. package/dist/tools/system/test-runner.js.map +1 -1
  947. package/package.json +1 -1
@@ -0,0 +1,674 @@
1
+ /**
2
+ * Completion checks, stall handling, and task execution for a CoreLoop iteration.
3
+ */
4
+ import { randomUUID } from "node:crypto";
5
+ import * as path from "node:path";
6
+ import { KnowledgeGraph } from "../../../platform/knowledge/knowledge-graph.js";
7
+ import { loadDreamActivationState, mergeUniqueKnowledgeEntries } from "../../../platform/dream/dream-activation.js";
8
+ import { buildDriveContext, } from "./contracts.js";
9
+ import { getMilestones, evaluatePace, } from "../../goal/milestone-evaluator.js";
10
+ import { gatherStallEvidence } from "../stall-evidence.js";
11
+ import { verifyWithTools } from "../verification-layer1.js";
12
+ import { buildLoopToolContext } from "./preparation.js";
13
+ import { expandKnowledgeEntriesWithGraph, mergeWorkingMemorySelections, } from "../../execution/context/context-builder.js";
14
+ // ─── Phase 5 ───
15
+ /** Completion check + milestone deadline check.
16
+ * Sets result.error on fatal failure, sets result.completionJudgment. */
17
+ export async function checkCompletionAndMilestones(ctx, goalId, goal, result, startTime) {
18
+ // R1-1: record pre-task judgment (do NOT early-return here)
19
+ try {
20
+ const judgment = goal.children_ids.length > 0
21
+ ? await ctx.deps.satisficingJudge.judgeTreeCompletion(goalId)
22
+ : ctx.deps.satisficingJudge.isGoalComplete(goal);
23
+ result.completionJudgment = judgment;
24
+ // Wire satisficing callback to MemoryLifecycleManager
25
+ // SatisficingJudge fires (goalId, satisfiedDimensions[]) but MLM expects per-dimension calls
26
+ if (ctx.deps.memoryLifecycleManager) {
27
+ const blockingSet = new Set(judgment.blocking_dimensions);
28
+ for (const dim of goal.dimensions) {
29
+ const isSatisfied = !blockingSet.has(dim.name);
30
+ ctx.deps.memoryLifecycleManager.onSatisficingJudgment(goalId, dim.name, isSatisfied);
31
+ }
32
+ }
33
+ }
34
+ catch (err) {
35
+ result.error = `Completion check failed: ${err instanceof Error ? err.message : String(err)}`;
36
+ ctx.logger?.error(`CoreLoop: ${result.error}`, { goalId });
37
+ result.elapsedMs = Date.now() - startTime;
38
+ return;
39
+ }
40
+ // Milestone deadline check
41
+ try {
42
+ const allGoals = [goal];
43
+ for (const childId of goal.children_ids) {
44
+ const child = await ctx.deps.stateManager.loadGoal(childId);
45
+ if (child)
46
+ allGoals.push(child);
47
+ }
48
+ const milestones = getMilestones(allGoals);
49
+ if (milestones.length > 0) {
50
+ const milestoneAlerts = [];
51
+ for (const milestone of milestones) {
52
+ const currentAchievement = milestone.pace_snapshot?.achievement_ratio ??
53
+ (typeof milestone.dimensions[0]?.current_value === "number"
54
+ ? Math.min(milestone.dimensions[0].current_value / 100, 1)
55
+ : 0);
56
+ const snapshot = evaluatePace(milestone, currentAchievement);
57
+ await ctx.deps.stateManager.savePaceSnapshot(milestone.id, snapshot);
58
+ if (snapshot.status === "at_risk" || snapshot.status === "behind") {
59
+ milestoneAlerts.push({
60
+ goalId: milestone.id,
61
+ status: snapshot.status,
62
+ pace_ratio: snapshot.pace_ratio,
63
+ });
64
+ }
65
+ else {
66
+ if (ctx.deps.learningPipeline) {
67
+ try {
68
+ await ctx.deps.learningPipeline.onMilestoneReached(goalId, `Milestone ${milestone.title}: pace ${snapshot.status}`);
69
+ }
70
+ catch {
71
+ // non-fatal
72
+ }
73
+ }
74
+ }
75
+ }
76
+ if (milestoneAlerts.length > 0) {
77
+ result.milestoneAlerts = milestoneAlerts;
78
+ }
79
+ }
80
+ }
81
+ catch {
82
+ // Milestone check failure is non-fatal
83
+ }
84
+ }
85
+ // ─── Phase 6 ───
86
+ /** Stall detection per-dimension and globally, plus portfolio rebalance. */
87
+ export async function detectStallsAndRebalance(ctx, goalId, goal, result) {
88
+ try {
89
+ const gapHistory = await ctx.deps.stateManager.loadGapHistory(goalId);
90
+ const gapHistoryByDimension = indexGapHistoryByDimension(goal, gapHistory);
91
+ // Gather tool-based workspace evidence for stall detection (Phase 6)
92
+ if (ctx.toolExecutor) {
93
+ try {
94
+ const toolContext = {
95
+ cwd: process.cwd(),
96
+ goalId,
97
+ trustBalance: 0,
98
+ preApproved: true,
99
+ approvalFn: async () => false,
100
+ };
101
+ const evidence = await gatherStallEvidence(ctx.toolExecutor, toolContext);
102
+ result.toolStallEvidence = evidence;
103
+ if (!evidence.hasWorkspaceChanges) {
104
+ ctx.logger?.info("CoreLoop: stall evidence — no workspace changes detected", { goalId, toolErrors: evidence.toolErrors });
105
+ }
106
+ }
107
+ catch {
108
+ // Non-fatal: evidence gathering failure does not block stall detection
109
+ }
110
+ }
111
+ // Gap 3: isSuppressed wiring — suppression is per-dimension only.
112
+ // Collect suppressed dimensions from all active WaitStrategies; skip those dims in stall loop.
113
+ const suppressedDimensions = new Set();
114
+ if (ctx.deps.portfolioManager) {
115
+ try {
116
+ const portfolio = await ctx.deps.strategyManager.getPortfolio(goalId);
117
+ if (portfolio) {
118
+ for (const s of portfolio.strategies) {
119
+ if (s.state !== "active" || !ctx.deps.portfolioManager.isWaitStrategy(s))
120
+ continue;
121
+ const ws = s;
122
+ const waitUntil = typeof ws["wait_until"] === "string" ? ws["wait_until"] : null;
123
+ if (!ctx.deps.stallDetector.isSuppressed(waitUntil))
124
+ continue;
125
+ // Suppress only the primary_dimension of this WaitStrategy
126
+ const primaryDim = typeof ws["primary_dimension"] === "string" ? ws["primary_dimension"] : null;
127
+ if (primaryDim) {
128
+ suppressedDimensions.add(primaryDim);
129
+ ctx.logger?.info("CoreLoop: stall detection suppressed for dimension by active WaitStrategy", {
130
+ goalId,
131
+ dimension: primaryDim,
132
+ waitUntil,
133
+ });
134
+ result.waitSuppressed = true;
135
+ }
136
+ }
137
+ }
138
+ }
139
+ catch {
140
+ // Non-fatal: suppression check failure does not block stall detection
141
+ }
142
+ }
143
+ // Per-dimension stall check (skip dimensions suppressed by active WaitStrategies)
144
+ for (const dim of goal.dimensions) {
145
+ if (suppressedDimensions.has(dim.name))
146
+ continue;
147
+ const dimGapHistory = gapHistoryByDimension.get(dim.name) ?? [];
148
+ const stallReport = ctx.deps.stallDetector.checkDimensionStall(goalId, dim.name, dimGapHistory);
149
+ if (stallReport) {
150
+ result.stallDetected = true;
151
+ result.stallReport = stallReport;
152
+ // Predicted stalls are advisory — log but don't pivot/escalate
153
+ if (stallReport.stall_type === "predicted_plateau" ||
154
+ stallReport.stall_type === "predicted_regression") {
155
+ ctx.logger?.info(`CoreLoop: early warning ${stallReport.stall_type} — monitoring, no pivot`, { goalId });
156
+ continue;
157
+ }
158
+ const escalationLevel = await ctx.deps.stallDetector.getEscalationLevel(goalId, dim.name);
159
+ await applyStallAction(ctx, goalId, goal, dimGapHistory, stallReport, escalationLevel, dim.name, result, "");
160
+ break;
161
+ }
162
+ }
163
+ // Global stall check
164
+ if (!result.stallDetected) {
165
+ await checkGlobalStall(ctx, goalId, goal, result, gapHistoryByDimension);
166
+ }
167
+ // Portfolio: check rebalance after stall detection
168
+ if (ctx.deps.portfolioManager) {
169
+ await rebalancePortfolio(ctx, goalId, goal, result);
170
+ }
171
+ }
172
+ catch (err) {
173
+ ctx.logger?.warn("CoreLoop: stall detection failed (non-fatal)", { error: err instanceof Error ? err.message : String(err) });
174
+ }
175
+ }
176
+ function indexGapHistoryByDimension(goal, gapHistory) {
177
+ const indexedHistory = new Map();
178
+ for (const dim of goal.dimensions) {
179
+ indexedHistory.set(dim.name, []);
180
+ }
181
+ for (const entry of gapHistory) {
182
+ const seenDimensions = new Set();
183
+ for (const gap of entry.gap_vector) {
184
+ if (seenDimensions.has(gap.dimension_name))
185
+ continue;
186
+ seenDimensions.add(gap.dimension_name);
187
+ const dimHistory = indexedHistory.get(gap.dimension_name);
188
+ if (!dimHistory) {
189
+ continue;
190
+ }
191
+ const normalizedGap = { normalized_gap: gap.normalized_weighted_gap ?? 1 };
192
+ dimHistory.push(normalizedGap);
193
+ }
194
+ }
195
+ return indexedHistory;
196
+ }
197
+ // ─── Shared stall-action helper ───
198
+ /** Apply REFINE/PIVOT/ESCALATE logic for a detected stall (per-dimension or global).
199
+ * @param dimHistory Gap history slice used for analysis (single-dim or first-dim for global).
200
+ * @param stallReport The detected StallReport.
201
+ * @param escalationLevel Current escalation level for the stall dimension.
202
+ * @param incrementDimName Dimension name passed to incrementEscalation after handling.
203
+ * @param logPrefix Short prefix for log messages, e.g. "" or "global ".
204
+ */
205
+ async function applyStallAction(ctx, goalId, goal, dimHistory, stallReport, escalationLevel, incrementDimName, result, logPrefix) {
206
+ if (ctx.deps.learningPipeline) {
207
+ try {
208
+ await ctx.deps.learningPipeline.onStallDetected(goalId, stallReport);
209
+ }
210
+ catch {
211
+ // non-fatal
212
+ }
213
+ }
214
+ const activeStrategyForRecord = await Promise.resolve(ctx.deps.strategyManager.getActiveStrategy(goalId)).catch(() => null);
215
+ const strategyIdForRecord = activeStrategyForRecord?.id ?? "unknown";
216
+ // M14-S2: analyze stall cause to determine REFINE/PIVOT/ESCALATE
217
+ // Falls back to PIVOT behavior when analyzeStallCause is unavailable
218
+ const analysis = ctx.deps.stallDetector.analyzeStallCause?.(dimHistory);
219
+ result.stallAnalysis = analysis;
220
+ if (analysis?.recommended_action === "refine") {
221
+ // REFINE: keep current strategy, just log and continue
222
+ ctx.logger?.info(`CoreLoop: ${logPrefix}stall REFINE — parameter_issue detected, keeping strategy`, {
223
+ goalId,
224
+ evidence: analysis.evidence,
225
+ });
226
+ }
227
+ else if (stallReport.suggested_cause === "information_deficit" && ctx.deps.goalRefiner) {
228
+ // Observation-failure stall: re-refine the leaf to get better dimensions
229
+ ctx.logger?.info(`CoreLoop: ${logPrefix}observation-failure stall — calling reRefineLeaf`, { goalId });
230
+ try {
231
+ await ctx.deps.goalRefiner.reRefineLeaf(goalId, stallReport.suggested_cause);
232
+ }
233
+ catch (reRefineErr) {
234
+ ctx.logger?.warn(`CoreLoop: ${logPrefix}reRefineLeaf failed (non-fatal)`, {
235
+ goalId,
236
+ err: reRefineErr instanceof Error ? reRefineErr.message : String(reRefineErr),
237
+ });
238
+ }
239
+ }
240
+ else if (analysis?.recommended_action === "escalate") {
241
+ // ESCALATE: set escalation level to max to trigger loop exit
242
+ ctx.logger?.warn(`CoreLoop: ${logPrefix}stall ESCALATE — goal_unreachable detected`, {
243
+ goalId,
244
+ evidence: analysis.evidence,
245
+ });
246
+ await ctx.deps.strategyManager.onStallDetected(goalId, 3, goal.origin ?? "general");
247
+ result.pivotOccurred = true;
248
+ }
249
+ else {
250
+ // PIVOT: switch strategy, but check pivot count limit first
251
+ const portfolio = await ctx.deps.strategyManager.getPortfolio(goalId);
252
+ const activeStrategy = portfolio?.strategies.find((s) => s.state === "active");
253
+ const pivotCount = activeStrategy?.pivot_count ?? 0;
254
+ const maxPivotCount = activeStrategy?.max_pivot_count ?? 2;
255
+ if (pivotCount >= maxPivotCount) {
256
+ // Auto-escalate when pivot limit reached
257
+ ctx.logger?.warn(`CoreLoop: ${logPrefix}stall auto-ESCALATE — pivot_count limit reached`, {
258
+ goalId,
259
+ pivotCount,
260
+ maxPivotCount,
261
+ });
262
+ await ctx.deps.strategyManager.onStallDetected(goalId, 3, goal.origin ?? "general");
263
+ result.pivotOccurred = true;
264
+ }
265
+ else {
266
+ const newStrategy = await ctx.deps.strategyManager.onStallDetected(goalId, escalationLevel + 1, goal.origin ?? "general");
267
+ if (newStrategy) {
268
+ result.pivotOccurred = true;
269
+ if (activeStrategy?.id) {
270
+ try {
271
+ await ctx.deps.strategyManager.incrementPivotCount(goalId, activeStrategy.id);
272
+ }
273
+ catch {
274
+ // non-fatal
275
+ }
276
+ }
277
+ }
278
+ }
279
+ }
280
+ // M14-S3: Record decision (non-fatal)
281
+ if (ctx.deps.knowledgeManager) {
282
+ try {
283
+ const latestGap = dimHistory[dimHistory.length - 1]?.normalized_gap ?? 1;
284
+ await ctx.deps.knowledgeManager.recordDecision({
285
+ id: randomUUID(),
286
+ goal_id: goalId,
287
+ goal_type: goal.origin ?? "general",
288
+ strategy_id: strategyIdForRecord,
289
+ hypothesis: activeStrategyForRecord?.hypothesis,
290
+ decision: analysis?.recommended_action ?? "pivot",
291
+ context: {
292
+ gap_value: latestGap,
293
+ stall_count: stallReport.escalation_level,
294
+ cycle_count: dimHistory.length,
295
+ trust_score: 0,
296
+ },
297
+ outcome: "pending",
298
+ timestamp: new Date().toISOString(),
299
+ what_worked: [],
300
+ what_failed: [],
301
+ suggested_next: [],
302
+ });
303
+ }
304
+ catch {
305
+ // non-fatal: never block the loop for decision recording
306
+ }
307
+ }
308
+ if (incrementDimName) {
309
+ await ctx.deps.stallDetector.incrementEscalation(goalId, incrementDimName);
310
+ }
311
+ }
312
+ /** Global stall detection: check all dimensions together, handle REFINE/PIVOT/ESCALATE. */
313
+ async function checkGlobalStall(ctx, goalId, goal, result, gapHistoryByDimension) {
314
+ const globalStall = ctx.deps.stallDetector.checkGlobalStall(goalId, gapHistoryByDimension);
315
+ if (!globalStall)
316
+ return;
317
+ result.stallDetected = true;
318
+ result.stallReport = globalStall;
319
+ const firstDimHistory = gapHistoryByDimension.get(goal.dimensions[0]?.name ?? "") ?? [];
320
+ const firstDimName = goal.dimensions[0]?.name ?? "";
321
+ // Pass escalationLevel=1 so that escalationLevel+1=2, preserving the original global PIVOT level
322
+ await applyStallAction(ctx, goalId, goal, firstDimHistory, globalStall, 1, firstDimName, result, "global ");
323
+ }
324
+ /** Portfolio rebalance: check for rebalance triggers and handle wait strategy expiry. */
325
+ async function rebalancePortfolio(ctx, goalId, goal, result) {
326
+ if (!ctx.deps.portfolioManager)
327
+ return;
328
+ try {
329
+ const rebalanceTrigger = await ctx.deps.portfolioManager.shouldRebalance(goalId);
330
+ if (rebalanceTrigger) {
331
+ const rebalanceResult = await ctx.deps.portfolioManager.rebalance(goalId, rebalanceTrigger);
332
+ if (rebalanceResult.new_generation_needed) {
333
+ await ctx.deps.strategyManager.onStallDetected(goalId, 3, goal.origin ?? "general");
334
+ }
335
+ }
336
+ }
337
+ catch {
338
+ // Portfolio rebalance errors are non-fatal
339
+ }
340
+ try {
341
+ const portfolio = await ctx.deps.strategyManager.getPortfolio(goalId);
342
+ if (portfolio) {
343
+ for (const strategy of portfolio.strategies) {
344
+ if (ctx.deps.portfolioManager.isWaitStrategy(strategy)) {
345
+ // Gap 1: canAffordWait gate — if TimeHorizonEngine is available, check whether
346
+ // the goal can afford the wait before processing WaitStrategy expiry.
347
+ if (ctx.timeHorizonEngine) {
348
+ try {
349
+ const ws = strategy;
350
+ const waitUntil = typeof ws["wait_until"] === "string" ? ws["wait_until"] : null;
351
+ const startedAt = typeof ws["started_at"] === "string" ? ws["started_at"] : (goal.created_at ?? new Date().toISOString());
352
+ // Remaining wait time (not total): use now as reference so nearly-expired waits pass
353
+ const waitHours = waitUntil
354
+ ? Math.max(0, (new Date(waitUntil).getTime() - Date.now()) / 3_600_000)
355
+ : 0;
356
+ const currentGap = result?.gapAggregate ?? 1;
357
+ const initialGap = typeof ws["gap_snapshot_at_start"] === "number" ? ws["gap_snapshot_at_start"] : currentGap;
358
+ // Compute an approximate velocity from gap progress and elapsed time.
359
+ // Fallback to a small positive value (0.01/h) when elapsed is too short to measure.
360
+ const elapsedHours = waitUntil
361
+ ? Math.max(0, (Date.now() - new Date(startedAt).getTime()) / 3_600_000)
362
+ : 0;
363
+ const gapDelta = initialGap - currentGap;
364
+ const velocity = elapsedHours > 0.001 && gapDelta > 0
365
+ ? gapDelta / elapsedHours
366
+ : 0.01; // conservative positive fallback; replace with real velocity when available
367
+ const budget = ctx.timeHorizonEngine.getTimeBudget(goal.deadline ?? null, startedAt, currentGap, initialGap, velocity);
368
+ if (!budget.canAffordWait(waitHours)) {
369
+ ctx.logger?.info("CoreLoop: canAffordWait=false, skipping WaitStrategy processing", {
370
+ goalId,
371
+ strategyId: strategy.id,
372
+ waitHours,
373
+ });
374
+ continue;
375
+ }
376
+ }
377
+ catch {
378
+ // Non-fatal: if canAffordWait check fails, proceed normally
379
+ }
380
+ }
381
+ const waitTrigger = await ctx.deps.portfolioManager.handleWaitStrategyExpiry(goalId, strategy.id);
382
+ if (waitTrigger) {
383
+ await ctx.deps.portfolioManager.rebalance(goalId, waitTrigger);
384
+ if (result) {
385
+ result.waitExpired = true;
386
+ result.waitStrategyId = strategy.id;
387
+ }
388
+ }
389
+ }
390
+ }
391
+ }
392
+ }
393
+ catch {
394
+ // WaitStrategy expiry errors are non-fatal
395
+ }
396
+ }
397
+ // ─── Phase 6b ───
398
+ /** Check dependency graph block.
399
+ * Returns true if goal is blocked (result.error set, caller should return). */
400
+ export function checkDependencyBlock(ctx, goalId, result) {
401
+ if (ctx.deps.goalDependencyGraph) {
402
+ try {
403
+ if (ctx.deps.goalDependencyGraph.isBlocked(goalId)) {
404
+ const blockingGoals = ctx.deps.goalDependencyGraph.getBlockingGoals(goalId);
405
+ result.error = `Goal ${goalId} is blocked by prerequisites: ${blockingGoals.join(", ")}`;
406
+ return true;
407
+ }
408
+ }
409
+ catch {
410
+ // Dependency graph errors are non-fatal
411
+ }
412
+ }
413
+ return false;
414
+ }
415
+ /** Collect context, run task cycle, handle capability acquisition,
416
+ * transfer detection, and post-task completion re-check.
417
+ * Returns true on success, false if the caller should return result early.
418
+ * `transferCheckCounter` is incremented via the callback to keep mutable state on CoreLoop. */
419
+ export async function runTaskCycleWithContext(ctx, goalId, goal, gapVector, driveScores, highDissatisfactionDimensions, loopIndex, result, startTime, callbacks) {
420
+ const { handleCapabilityAcquisition, incrementTransferCounter, tryGenerateReport } = callbacks;
421
+ try {
422
+ const taskStartTime = Date.now();
423
+ const driveContext = buildDriveContext(goal);
424
+ const adapter = ctx.deps.adapterRegistry.getAdapter(ctx.config.adapterType);
425
+ const baseDir = typeof ctx.deps.stateManager.getBaseDir === "function"
426
+ ? ctx.deps.stateManager.getBaseDir()
427
+ : null;
428
+ const dreamActivation = baseDir
429
+ ? await loadDreamActivationState(baseDir).catch(() => null)
430
+ : null;
431
+ const activationFlags = dreamActivation?.flags;
432
+ // Portfolio: select strategy for next task
433
+ if (ctx.deps.portfolioManager) {
434
+ try {
435
+ const selectionResult = await ctx.deps.portfolioManager.selectNextStrategyForTask(goalId);
436
+ if (selectionResult) {
437
+ ctx.deps.taskLifecycle.setOnTaskComplete((strategyId) => {
438
+ ctx.deps.portfolioManager?.recordTaskCompletion(strategyId);
439
+ });
440
+ }
441
+ }
442
+ catch {
443
+ // Portfolio strategy selection is non-fatal
444
+ }
445
+ }
446
+ // Collect knowledge context
447
+ let knowledgeContext;
448
+ if (ctx.deps.knowledgeManager) {
449
+ try {
450
+ const topDimension = driveScores[0]?.dimension_name ?? goal.dimensions[0]?.name;
451
+ if (topDimension) {
452
+ let entries = await ctx.deps.knowledgeManager.getRelevantKnowledge(goalId, topDimension);
453
+ if (activationFlags?.semanticContext) {
454
+ const semanticEntries = await ctx.deps.knowledgeManager.searchKnowledge(`${goal.title} ${goal.description} ${topDimension}`, 5).catch(() => []);
455
+ entries = mergeUniqueKnowledgeEntries(entries, semanticEntries, 8);
456
+ }
457
+ let contradictionWarnings = [];
458
+ if (activationFlags?.graphTraversal && entries.length > 0) {
459
+ const graph = baseDir
460
+ ? await KnowledgeGraph.create(path.join(baseDir, "knowledge", "graph.json")).catch(() => null)
461
+ : null;
462
+ if (graph) {
463
+ const allEntries = await ctx.deps.knowledgeManager.loadKnowledge(goalId).catch(() => []);
464
+ const expanded = expandKnowledgeEntriesWithGraph(entries, allEntries, graph);
465
+ entries = mergeUniqueKnowledgeEntries(entries, expanded.relatedEntries, 10);
466
+ contradictionWarnings = expanded.contradictionWarnings;
467
+ }
468
+ }
469
+ if (entries.length > 0) {
470
+ knowledgeContext = entries
471
+ .map((e) => `Q: ${e.question}\nA: ${e.answer}`)
472
+ .join("\n\n");
473
+ if (contradictionWarnings.length > 0) {
474
+ knowledgeContext += `\n\nContradiction warnings:\n${contradictionWarnings
475
+ .map((warning) => `- ${warning}`)
476
+ .join("\n")}`;
477
+ }
478
+ }
479
+ }
480
+ }
481
+ catch {
482
+ // Knowledge retrieval failure is non-fatal
483
+ }
484
+ }
485
+ if (activationFlags?.crossGoalLessons && ctx.deps.memoryLifecycleManager) {
486
+ try {
487
+ const topDimension = driveScores[0]?.dimension_name ?? goal.dimensions[0]?.name ?? "";
488
+ const lessons = await ctx.deps.memoryLifecycleManager.searchCrossGoalLessons(`${goal.title} ${goal.description} ${topDimension}`, 3);
489
+ if (lessons.length > 0) {
490
+ const lessonsBlock = [
491
+ "Cross-goal lessons:",
492
+ ...lessons.map((lesson, index) => `${index + 1}. ${lesson.lesson}`),
493
+ ].join("\n");
494
+ knowledgeContext = knowledgeContext ? `${knowledgeContext}\n\n${lessonsBlock}` : lessonsBlock;
495
+ }
496
+ }
497
+ catch {
498
+ // Non-fatal: proceed without cross-goal lessons.
499
+ }
500
+ }
501
+ // Tier-aware memory selection: use highDissatisfactionDimensions and dynamic budget
502
+ if (ctx.deps.memoryLifecycleManager) {
503
+ try {
504
+ const dimensions = goal.dimensions.map((d) => d.name);
505
+ const maxDissatisfaction = driveScores.length > 0
506
+ ? Math.max(...driveScores.map((s) => s.dissatisfaction))
507
+ : 0;
508
+ const satisfiedDimensions = goal.dimensions
509
+ .filter((d) => !result.completionJudgment?.blocking_dimensions.includes(d.name))
510
+ .map((d) => d.name);
511
+ const tierAwareMemory = await ctx.deps.memoryLifecycleManager.selectForWorkingMemoryTierAware(goalId, dimensions, [], 10, [goalId], [], satisfiedDimensions, highDissatisfactionDimensions, maxDissatisfaction);
512
+ if (activationFlags?.semanticWorkingMemory) {
513
+ const topDimension = driveScores[0]?.dimension_name ?? goal.dimensions[0]?.name ?? "";
514
+ const semanticMemory = await ctx.deps.memoryLifecycleManager.selectForWorkingMemorySemantic(goalId, `${goal.title} ${goal.description} ${topDimension}`, dimensions, [], 5, driveScores.map((score) => ({
515
+ dimension: score.dimension_name,
516
+ dissatisfaction: score.dissatisfaction,
517
+ deadline: score.deadline,
518
+ })));
519
+ const mergedEntries = mergeWorkingMemorySelections(tierAwareMemory.shortTerm, semanticMemory.shortTerm, 5);
520
+ if (mergedEntries.length > 0) {
521
+ const memoryBlock = [
522
+ "Working memory:",
523
+ ...mergedEntries.map((entry, index) => `${index + 1}. [${entry.data_type}] ${JSON.stringify(entry.data)}`),
524
+ ].join("\n");
525
+ knowledgeContext = knowledgeContext ? `${knowledgeContext}\n\n${memoryBlock}` : memoryBlock;
526
+ }
527
+ }
528
+ }
529
+ catch {
530
+ // Memory selection failure is non-fatal
531
+ }
532
+ }
533
+ // Fetch existing tasks for dedup context
534
+ let existingTasks;
535
+ if (adapter.listExistingTasks) {
536
+ try {
537
+ existingTasks = await adapter.listExistingTasks();
538
+ }
539
+ catch {
540
+ // Non-fatal: proceed without existing tasks context
541
+ }
542
+ }
543
+ // Collect workspace context
544
+ let workspaceContext;
545
+ if (ctx.deps.contextProvider) {
546
+ try {
547
+ const topDimension = driveScores[0]?.dimension_name ?? goal.dimensions[0]?.name ?? "";
548
+ workspaceContext = await ctx.deps.contextProvider(goalId, topDimension);
549
+ }
550
+ catch {
551
+ // Non-fatal: proceed without workspace context
552
+ }
553
+ }
554
+ ctx.logger?.debug("CoreLoop: running task cycle", { adapter: adapter.adapterType, goalId });
555
+ ctx.deps.onProgress?.({
556
+ iteration: loopIndex + 1,
557
+ maxIterations: ctx.config.maxIterations,
558
+ phase: "Executing task...",
559
+ gap: result.gapAggregate,
560
+ });
561
+ const taskResult = await ctx.deps.taskLifecycle.runTaskCycle(goalId, gapVector, driveContext, adapter, knowledgeContext, existingTasks, workspaceContext);
562
+ ctx.logger?.info("CoreLoop: task cycle result", { action: taskResult.action, taskId: taskResult.task.id });
563
+ result.taskResult = taskResult;
564
+ result.tokensUsed = (result.tokensUsed ?? 0) + (taskResult.tokensUsed ?? 0);
565
+ ctx.deps.onProgress?.({
566
+ iteration: loopIndex + 1,
567
+ maxIterations: ctx.config.maxIterations,
568
+ phase: "Verifying result...",
569
+ gap: result.gapAggregate,
570
+ taskDescription: taskResult.task.work_description
571
+ ? taskResult.task.work_description.split("\n")[0]?.slice(0, 80)
572
+ : undefined,
573
+ });
574
+ // Handle capability_acquiring
575
+ if (taskResult.action === "capability_acquiring" && taskResult.acquisition_task) {
576
+ const acquisitionOutcome = await handleCapabilityAcquisition(taskResult.acquisition_task, goalId, adapter);
577
+ if (acquisitionOutcome?.replanRequired) {
578
+ ctx.logger?.info("CoreLoop: capability acquisition requested replanning", {
579
+ capabilityName: acquisitionOutcome.capabilityName,
580
+ replanRequired: acquisitionOutcome.replanRequired,
581
+ recommendationSource: acquisitionOutcome.recommendationSource,
582
+ recommendedPlugin: acquisitionOutcome.recommendedPlugin,
583
+ });
584
+ ctx.deps.onProgress?.({
585
+ iteration: loopIndex + 1,
586
+ maxIterations: ctx.config.maxIterations,
587
+ phase: "Generating task...",
588
+ gap: result.gapAggregate,
589
+ taskDescription: `Replanning after capability acquisition: ${acquisitionOutcome.capabilityName}`,
590
+ });
591
+ }
592
+ }
593
+ // Portfolio: record task completion
594
+ if (ctx.deps.portfolioManager && taskResult.action === "completed" && taskResult.task.strategy_id) {
595
+ try {
596
+ ctx.deps.portfolioManager.recordTaskCompletion(taskResult.task.strategy_id);
597
+ }
598
+ catch {
599
+ // Non-fatal
600
+ }
601
+ }
602
+ // Phase 7: tool-based verification (Layer 1)
603
+ if (ctx.toolExecutor && taskResult.task.success_criteria.length > 0) {
604
+ try {
605
+ const toolCtx = await buildLoopToolContext(ctx, goalId);
606
+ const verificationResult = await verifyWithTools(taskResult.task.success_criteria, ctx.toolExecutor, toolCtx);
607
+ if (!verificationResult.mechanicalPassed) {
608
+ taskResult.verificationResult = { ...taskResult.verificationResult, verdict: "fail" };
609
+ ctx.logger?.info("CoreLoop Phase 7: tool verification failed", {
610
+ taskId: taskResult.task.id,
611
+ details: verificationResult.details,
612
+ });
613
+ }
614
+ result.toolVerification = verificationResult;
615
+ // Feed execution results back to strategy for scoring
616
+ if (typeof ctx.deps.strategyManager.recordExecutionFeedback === 'function') {
617
+ const activeStrat = await ctx.deps.strategyManager.getActiveStrategy(goalId);
618
+ if (activeStrat) {
619
+ ctx.deps.strategyManager.recordExecutionFeedback({
620
+ strategyId: activeStrat.hypothesis,
621
+ taskId: taskResult.task?.id ?? 'unknown',
622
+ success: taskResult.action === 'completed',
623
+ verificationPassed: verificationResult.mechanicalPassed,
624
+ duration_ms: Date.now() - taskStartTime,
625
+ timestamp: Date.now(),
626
+ });
627
+ }
628
+ }
629
+ }
630
+ catch (err) {
631
+ ctx.logger?.warn("CoreLoop Phase 7: tool verification threw (non-fatal)", {
632
+ error: err instanceof Error ? err.message : String(err),
633
+ });
634
+ }
635
+ }
636
+ // Re-check completion after task execution
637
+ const updatedGoal = await ctx.deps.stateManager.loadGoal(goalId);
638
+ if (updatedGoal) {
639
+ const postTaskJudgment = updatedGoal.children_ids.length > 0
640
+ ? await ctx.deps.satisficingJudge.judgeTreeCompletion(updatedGoal.id)
641
+ : ctx.deps.satisficingJudge.isGoalComplete(updatedGoal);
642
+ result.completionJudgment = postTaskJudgment;
643
+ }
644
+ }
645
+ catch (err) {
646
+ result.error = `Task cycle failed: ${err instanceof Error ? err.message : String(err)}`;
647
+ ctx.logger?.error(`CoreLoop: ${result.error}`, { goalId });
648
+ result.elapsedMs = Date.now() - startTime;
649
+ tryGenerateReport(goalId, loopIndex, result, goal);
650
+ return false;
651
+ }
652
+ // Track curiosity goal loop count
653
+ if (ctx.deps.curiosityEngine) {
654
+ const currentGoal = await ctx.deps.stateManager.loadGoal(goalId);
655
+ if (currentGoal?.origin === "curiosity") {
656
+ ctx.deps.curiosityEngine.incrementLoopCount(goalId);
657
+ }
658
+ }
659
+ // Transfer Detection (every 5 iterations, suggestion-only)
660
+ const transferCount = incrementTransferCounter();
661
+ if (ctx.deps.knowledgeTransfer && transferCount % 5 === 0) {
662
+ try {
663
+ const candidates = await ctx.deps.knowledgeTransfer.detectTransferOpportunities(goalId);
664
+ if (candidates.length > 0) {
665
+ result.transfer_candidates = candidates;
666
+ }
667
+ }
668
+ catch {
669
+ // non-fatal
670
+ }
671
+ }
672
+ return true;
673
+ }
674
+ //# sourceMappingURL=task-cycle.js.map