@warlock.js/ai 4.2.11 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (432) hide show
  1. package/CHANGELOG.md +68 -1
  2. package/cjs/index.cjs +10155 -4626
  3. package/cjs/index.cjs.map +1 -1
  4. package/cjs/magic-string.es-BtxW4VqG.cjs +1015 -0
  5. package/cjs/magic-string.es-BtxW4VqG.cjs.map +1 -0
  6. package/cjs/matcher-logic-SBnzYohQ.cjs +217 -0
  7. package/cjs/matcher-logic-SBnzYohQ.cjs.map +1 -0
  8. package/cjs/matchers-BBh3gyB-.cjs +13739 -0
  9. package/cjs/matchers-BBh3gyB-.cjs.map +1 -0
  10. package/esm/agent/agent-config.type.d.mts +19 -6
  11. package/esm/agent/agent-config.type.d.mts.map +1 -1
  12. package/esm/agent/agent.d.mts.map +1 -1
  13. package/esm/agent/agent.mjs +17 -6
  14. package/esm/agent/agent.mjs.map +1 -1
  15. package/esm/agent/index.d.mts +2 -1
  16. package/esm/agent/index.mjs +1 -0
  17. package/esm/agent/spawn-sub-agent.d.mts +87 -0
  18. package/esm/agent/spawn-sub-agent.d.mts.map +1 -0
  19. package/esm/agent/spawn-sub-agent.mjs +68 -0
  20. package/esm/agent/spawn-sub-agent.mjs.map +1 -0
  21. package/esm/ai.d.mts +58 -3
  22. package/esm/ai.d.mts.map +1 -1
  23. package/esm/ai.mjs +58 -3
  24. package/esm/ai.mjs.map +1 -1
  25. package/esm/batch/batch.d.mts +43 -0
  26. package/esm/batch/batch.d.mts.map +1 -0
  27. package/esm/batch/batch.mjs +179 -0
  28. package/esm/batch/batch.mjs.map +1 -0
  29. package/esm/batch/batch.type.d.mts +144 -0
  30. package/esm/batch/batch.type.d.mts.map +1 -0
  31. package/esm/batch/index.mjs +3 -0
  32. package/esm/batch/run-batch-item.mjs +100 -0
  33. package/esm/batch/run-batch-item.mjs.map +1 -0
  34. package/esm/batch/run-with-concurrency.mjs +39 -0
  35. package/esm/batch/run-with-concurrency.mjs.map +1 -0
  36. package/esm/checkpoint/index.d.mts +3 -0
  37. package/esm/checkpoint/memory.d.mts +21 -0
  38. package/esm/checkpoint/memory.d.mts.map +1 -0
  39. package/esm/checkpoint/memory.mjs +0 -0
  40. package/esm/checkpoint/memory.mjs.map +1 -0
  41. package/esm/checkpoint/pg.d.mts +37 -0
  42. package/esm/checkpoint/pg.d.mts.map +1 -0
  43. package/esm/checkpoint/pg.mjs +265 -0
  44. package/esm/checkpoint/pg.mjs.map +1 -0
  45. package/esm/checkpoint/redis.d.mts +39 -0
  46. package/esm/checkpoint/redis.d.mts.map +1 -0
  47. package/esm/checkpoint/redis.mjs +200 -0
  48. package/esm/checkpoint/redis.mjs.map +1 -0
  49. package/esm/config.d.mts +61 -14
  50. package/esm/config.d.mts.map +1 -1
  51. package/esm/config.mjs +25 -6
  52. package/esm/config.mjs.map +1 -1
  53. package/esm/contracts/agent/agent.contract.d.mts +43 -0
  54. package/esm/contracts/agent/agent.contract.d.mts.map +1 -1
  55. package/esm/contracts/agent/eval.type.d.mts +143 -0
  56. package/esm/contracts/agent/eval.type.d.mts.map +1 -0
  57. package/esm/contracts/agent/index.d.mts +1 -0
  58. package/esm/contracts/events/supervisor-events.type.d.mts +3 -3
  59. package/esm/contracts/fallback-model.contract.d.mts +65 -0
  60. package/esm/contracts/fallback-model.contract.d.mts.map +1 -0
  61. package/esm/contracts/index.d.mts +32 -12
  62. package/esm/contracts/memory/index.d.mts +4 -0
  63. package/esm/contracts/memory/memory-config.type.d.mts +150 -0
  64. package/esm/contracts/memory/memory-config.type.d.mts.map +1 -0
  65. package/esm/contracts/memory/memory-item.type.d.mts +64 -0
  66. package/esm/contracts/memory/memory-item.type.d.mts.map +1 -0
  67. package/esm/contracts/memory/memory.contract.d.mts +87 -0
  68. package/esm/contracts/memory/memory.contract.d.mts.map +1 -0
  69. package/esm/contracts/memory/recall-options.type.d.mts +33 -0
  70. package/esm/contracts/memory/recall-options.type.d.mts.map +1 -0
  71. package/esm/contracts/middleware/index.d.mts +2 -2
  72. package/esm/contracts/middleware/middleware-context.type.d.mts +42 -2
  73. package/esm/contracts/middleware/middleware-context.type.d.mts.map +1 -1
  74. package/esm/contracts/middleware/middleware.contract.d.mts +46 -2
  75. package/esm/contracts/middleware/middleware.contract.d.mts.map +1 -1
  76. package/esm/contracts/model.contract.d.mts +63 -2
  77. package/esm/contracts/model.contract.d.mts.map +1 -1
  78. package/esm/contracts/orchestrator/checkpoint-store.contract.d.mts +91 -0
  79. package/esm/contracts/orchestrator/checkpoint-store.contract.d.mts.map +1 -0
  80. package/esm/contracts/orchestrator/index.d.mts +8 -0
  81. package/esm/contracts/orchestrator/orchestrator-commands.type.d.mts +43 -0
  82. package/esm/contracts/orchestrator/orchestrator-commands.type.d.mts.map +1 -0
  83. package/esm/contracts/orchestrator/orchestrator-config.type.d.mts +170 -0
  84. package/esm/contracts/orchestrator/orchestrator-config.type.d.mts.map +1 -0
  85. package/esm/contracts/orchestrator/orchestrator-event.type.d.mts +118 -0
  86. package/esm/contracts/orchestrator/orchestrator-event.type.d.mts.map +1 -0
  87. package/esm/contracts/orchestrator/orchestrator-execute-options.type.d.mts +44 -0
  88. package/esm/contracts/orchestrator/orchestrator-execute-options.type.d.mts.map +1 -0
  89. package/esm/contracts/orchestrator/orchestrator.contract.d.mts +129 -0
  90. package/esm/contracts/orchestrator/orchestrator.contract.d.mts.map +1 -0
  91. package/esm/contracts/orchestrator/session.contract.d.mts +26 -0
  92. package/esm/contracts/orchestrator/session.contract.d.mts.map +1 -0
  93. package/esm/contracts/orchestrator/snapshot-store.contract.d.mts +89 -0
  94. package/esm/contracts/orchestrator/snapshot-store.contract.d.mts.map +1 -0
  95. package/esm/contracts/planner/index.d.mts +6 -0
  96. package/esm/contracts/planner/planner-capability.type.d.mts +39 -0
  97. package/esm/contracts/planner/planner-capability.type.d.mts.map +1 -0
  98. package/esm/contracts/planner/planner-config.type.d.mts +78 -0
  99. package/esm/contracts/planner/planner-config.type.d.mts.map +1 -0
  100. package/esm/contracts/planner/planner-execute-options.type.d.mts +43 -0
  101. package/esm/contracts/planner/planner-execute-options.type.d.mts.map +1 -0
  102. package/esm/contracts/planner/planner-plan.type.d.mts +48 -0
  103. package/esm/contracts/planner/planner-plan.type.d.mts.map +1 -0
  104. package/esm/contracts/planner/planner-result.type.d.mts +88 -0
  105. package/esm/contracts/planner/planner-result.type.d.mts.map +1 -0
  106. package/esm/contracts/planner/planner.contract.d.mts +60 -0
  107. package/esm/contracts/planner/planner.contract.d.mts.map +1 -0
  108. package/esm/contracts/result/base-report.type.d.mts +7 -2
  109. package/esm/contracts/result/base-report.type.d.mts.map +1 -1
  110. package/esm/contracts/result/base-report.type.mjs.map +1 -1
  111. package/esm/contracts/result/index.d.mts +2 -1
  112. package/esm/contracts/result/model-pricing.type.d.mts +10 -0
  113. package/esm/contracts/result/model-pricing.type.d.mts.map +1 -1
  114. package/esm/contracts/result/orchestrator-result.type.d.mts +143 -0
  115. package/esm/contracts/result/orchestrator-result.type.d.mts.map +1 -0
  116. package/esm/contracts/result/session-send-result.type.d.mts +12 -3
  117. package/esm/contracts/result/session-send-result.type.d.mts.map +1 -1
  118. package/esm/contracts/result/supervisor-result.type.d.mts +2 -2
  119. package/esm/contracts/result/supervisor-result.type.d.mts.map +1 -1
  120. package/esm/contracts/result/tool-call.type.d.mts +2 -2
  121. package/esm/contracts/result/tool-call.type.d.mts.map +1 -1
  122. package/esm/contracts/result/usage.type.d.mts +24 -0
  123. package/esm/contracts/result/usage.type.d.mts.map +1 -1
  124. package/esm/contracts/result/workflow-result.type.d.mts +1 -1
  125. package/esm/contracts/result/workflow-result.type.d.mts.map +1 -1
  126. package/esm/contracts/sdk-adapter.contract.d.mts +1 -1
  127. package/esm/contracts/supervisor/dispatch-context.type.d.mts +3 -3
  128. package/esm/contracts/supervisor/evaluate-context.type.d.mts +1 -1
  129. package/esm/contracts/supervisor/index.d.mts +5 -5
  130. package/esm/contracts/supervisor/route-context.type.d.mts +2 -2
  131. package/esm/contracts/supervisor/supervisor-config.type.d.mts +55 -13
  132. package/esm/contracts/supervisor/supervisor-config.type.d.mts.map +1 -1
  133. package/esm/contracts/supervisor/supervisor-snapshot.type.d.mts +1 -1
  134. package/esm/contracts/supervisor/supervisor.contract.d.mts +9 -2
  135. package/esm/contracts/supervisor/supervisor.contract.d.mts.map +1 -1
  136. package/esm/contracts/workflow/index.d.mts +2 -2
  137. package/esm/contracts/workflow/workflow.contract.d.mts +28 -7
  138. package/esm/contracts/workflow/workflow.contract.d.mts.map +1 -1
  139. package/esm/errors/error-code.type.d.mts +1 -1
  140. package/esm/errors/index.d.mts +7 -0
  141. package/esm/errors/index.mjs +7 -0
  142. package/esm/errors/orchestrator-cancelled-error.d.mts +32 -0
  143. package/esm/errors/orchestrator-cancelled-error.d.mts.map +1 -0
  144. package/esm/errors/orchestrator-cancelled-error.mjs +31 -0
  145. package/esm/errors/orchestrator-cancelled-error.mjs.map +1 -0
  146. package/esm/errors/orchestrator-config-error.d.mts +26 -0
  147. package/esm/errors/orchestrator-config-error.d.mts.map +1 -0
  148. package/esm/errors/orchestrator-config-error.mjs +30 -0
  149. package/esm/errors/orchestrator-config-error.mjs.map +1 -0
  150. package/esm/errors/orchestrator-drift-error.d.mts +38 -0
  151. package/esm/errors/orchestrator-drift-error.d.mts.map +1 -0
  152. package/esm/errors/orchestrator-drift-error.mjs +37 -0
  153. package/esm/errors/orchestrator-drift-error.mjs.map +1 -0
  154. package/esm/errors/orchestrator-failed-error.d.mts +33 -0
  155. package/esm/errors/orchestrator-failed-error.d.mts.map +1 -0
  156. package/esm/errors/orchestrator-failed-error.mjs +36 -0
  157. package/esm/errors/orchestrator-failed-error.mjs.map +1 -0
  158. package/esm/errors/planner-cancelled-error.d.mts +33 -0
  159. package/esm/errors/planner-cancelled-error.d.mts.map +1 -0
  160. package/esm/errors/planner-cancelled-error.mjs +29 -0
  161. package/esm/errors/planner-cancelled-error.mjs.map +1 -0
  162. package/esm/errors/planner-failed-error.d.mts +40 -0
  163. package/esm/errors/planner-failed-error.d.mts.map +1 -0
  164. package/esm/errors/planner-failed-error.mjs +37 -0
  165. package/esm/errors/planner-failed-error.mjs.map +1 -0
  166. package/esm/errors/planner-plan-invalid-error.d.mts +21 -0
  167. package/esm/errors/planner-plan-invalid-error.d.mts.map +1 -0
  168. package/esm/errors/planner-plan-invalid-error.mjs +25 -0
  169. package/esm/errors/planner-plan-invalid-error.mjs.map +1 -0
  170. package/esm/eval/eval-runner.d.mts +17 -0
  171. package/esm/eval/eval-runner.d.mts.map +1 -0
  172. package/esm/eval/eval-runner.mjs +121 -0
  173. package/esm/eval/eval-runner.mjs.map +1 -0
  174. package/esm/eval/index.d.mts +29 -0
  175. package/esm/eval/index.d.mts.map +1 -0
  176. package/esm/eval/index.mjs +30 -0
  177. package/esm/eval/index.mjs.map +1 -0
  178. package/esm/eval/judge-scorer.d.mts +21 -0
  179. package/esm/eval/judge-scorer.d.mts.map +1 -0
  180. package/esm/eval/judge-scorer.mjs +87 -0
  181. package/esm/eval/judge-scorer.mjs.map +1 -0
  182. package/esm/eval/scorers.d.mts +50 -0
  183. package/esm/eval/scorers.d.mts.map +1 -0
  184. package/esm/eval/scorers.mjs +101 -0
  185. package/esm/eval/scorers.mjs.map +1 -0
  186. package/esm/index.d.mts +95 -30
  187. package/esm/index.mjs +66 -22
  188. package/esm/memory/derive-id.mjs +24 -0
  189. package/esm/memory/derive-id.mjs.map +1 -0
  190. package/esm/memory/episodic-memory.mjs +106 -0
  191. package/esm/memory/episodic-memory.mjs.map +1 -0
  192. package/esm/memory/index.d.mts +5 -0
  193. package/esm/memory/memory.d.mts +42 -0
  194. package/esm/memory/memory.d.mts.map +1 -0
  195. package/esm/memory/memory.mjs +166 -0
  196. package/esm/memory/memory.mjs.map +1 -0
  197. package/esm/memory/procedural-memory.mjs +103 -0
  198. package/esm/memory/procedural-memory.mjs.map +1 -0
  199. package/esm/memory/semantic-memory.mjs +80 -0
  200. package/esm/memory/semantic-memory.mjs.map +1 -0
  201. package/esm/memory/working-memory.mjs +62 -0
  202. package/esm/memory/working-memory.mjs.map +1 -0
  203. package/esm/middleware/builtins/budget-contract.type.d.mts +126 -0
  204. package/esm/middleware/builtins/budget-contract.type.d.mts.map +1 -0
  205. package/esm/middleware/builtins/budget.d.mts +71 -1
  206. package/esm/middleware/builtins/budget.d.mts.map +1 -1
  207. package/esm/middleware/builtins/budget.mjs +119 -4
  208. package/esm/middleware/builtins/budget.mjs.map +1 -1
  209. package/esm/middleware/builtins/semantic-cache.d.mts +1 -1
  210. package/esm/middleware/index.d.mts +2 -1
  211. package/esm/middleware/index.mjs +1 -1
  212. package/esm/middleware/pipeline.d.mts +9 -6
  213. package/esm/middleware/pipeline.d.mts.map +1 -1
  214. package/esm/middleware/pipeline.mjs.map +1 -1
  215. package/esm/mock/index.d.mts +1 -0
  216. package/esm/mock/index.mjs +1 -0
  217. package/esm/mock/mock-router.d.mts +63 -0
  218. package/esm/mock/mock-router.d.mts.map +1 -0
  219. package/esm/mock/mock-router.mjs +58 -0
  220. package/esm/mock/mock-router.mjs.map +1 -0
  221. package/esm/model/fallback-model.d.mts +45 -0
  222. package/esm/model/fallback-model.d.mts.map +1 -0
  223. package/esm/model/fallback-model.mjs +218 -0
  224. package/esm/model/fallback-model.mjs.map +1 -0
  225. package/esm/model/index.d.mts +2 -0
  226. package/esm/model/index.mjs +3 -0
  227. package/esm/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +78 -0
  228. package/esm/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +1 -0
  229. package/esm/node_modules/@vitest/expect/dist/index.mjs +1473 -0
  230. package/esm/node_modules/@vitest/expect/dist/index.mjs.map +1 -0
  231. package/esm/node_modules/@vitest/pretty-format/dist/index.mjs +888 -0
  232. package/esm/node_modules/@vitest/pretty-format/dist/index.mjs.map +1 -0
  233. package/esm/node_modules/@vitest/runner/dist/chunk-artifact.mjs +1533 -0
  234. package/esm/node_modules/@vitest/runner/dist/chunk-artifact.mjs.map +1 -0
  235. package/esm/node_modules/@vitest/runner/dist/index.mjs +3 -0
  236. package/esm/node_modules/@vitest/runner/dist/utils.mjs +3 -0
  237. package/esm/node_modules/@vitest/snapshot/dist/index.mjs +922 -0
  238. package/esm/node_modules/@vitest/snapshot/dist/index.mjs.map +1 -0
  239. package/esm/node_modules/@vitest/spy/dist/index.mjs +386 -0
  240. package/esm/node_modules/@vitest/spy/dist/index.mjs.map +1 -0
  241. package/esm/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs +82 -0
  242. package/esm/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs.map +1 -0
  243. package/esm/node_modules/@vitest/utils/dist/diff.mjs +1357 -0
  244. package/esm/node_modules/@vitest/utils/dist/diff.mjs.map +1 -0
  245. package/esm/node_modules/@vitest/utils/dist/display.mjs +559 -0
  246. package/esm/node_modules/@vitest/utils/dist/display.mjs.map +1 -0
  247. package/esm/node_modules/@vitest/utils/dist/error.mjs +38 -0
  248. package/esm/node_modules/@vitest/utils/dist/error.mjs.map +1 -0
  249. package/esm/node_modules/@vitest/utils/dist/helpers.mjs +181 -0
  250. package/esm/node_modules/@vitest/utils/dist/helpers.mjs.map +1 -0
  251. package/esm/node_modules/@vitest/utils/dist/offset.mjs +27 -0
  252. package/esm/node_modules/@vitest/utils/dist/offset.mjs.map +1 -0
  253. package/esm/node_modules/@vitest/utils/dist/serialize.mjs +77 -0
  254. package/esm/node_modules/@vitest/utils/dist/serialize.mjs.map +1 -0
  255. package/esm/node_modules/@vitest/utils/dist/source-map.mjs +374 -0
  256. package/esm/node_modules/@vitest/utils/dist/source-map.mjs.map +1 -0
  257. package/esm/node_modules/@vitest/utils/dist/timers.mjs +37 -0
  258. package/esm/node_modules/@vitest/utils/dist/timers.mjs.map +1 -0
  259. package/esm/node_modules/chai/index.mjs +2973 -0
  260. package/esm/node_modules/chai/index.mjs.map +1 -0
  261. package/esm/node_modules/magic-string/dist/magic-string.es.mjs +940 -0
  262. package/esm/node_modules/magic-string/dist/magic-string.es.mjs.map +1 -0
  263. package/esm/node_modules/tinyrainbow/dist/index.mjs +87 -0
  264. package/esm/node_modules/tinyrainbow/dist/index.mjs.map +1 -0
  265. package/esm/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs +6 -0
  266. package/esm/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs.map +1 -0
  267. package/esm/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs +52 -0
  268. package/esm/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs.map +1 -0
  269. package/esm/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs +2697 -0
  270. package/esm/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs.map +1 -0
  271. package/esm/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs +45 -0
  272. package/esm/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs.map +1 -0
  273. package/esm/orchestrator/as-tool.d.mts +42 -0
  274. package/esm/orchestrator/as-tool.d.mts.map +1 -0
  275. package/esm/orchestrator/as-tool.mjs +98 -0
  276. package/esm/orchestrator/as-tool.mjs.map +1 -0
  277. package/esm/orchestrator/checkpoint.mjs +75 -0
  278. package/esm/orchestrator/checkpoint.mjs.map +1 -0
  279. package/esm/orchestrator/commands.d.mts +38 -0
  280. package/esm/orchestrator/commands.d.mts.map +1 -0
  281. package/esm/orchestrator/commands.mjs +34 -0
  282. package/esm/orchestrator/commands.mjs.map +1 -0
  283. package/esm/orchestrator/compaction.mjs +206 -0
  284. package/esm/orchestrator/compaction.mjs.map +1 -0
  285. package/esm/orchestrator/dispatch.mjs +171 -0
  286. package/esm/orchestrator/dispatch.mjs.map +1 -0
  287. package/esm/orchestrator/emitter-port.type.d.mts +31 -0
  288. package/esm/orchestrator/emitter-port.type.d.mts.map +1 -0
  289. package/esm/orchestrator/emitter.d.mts +56 -0
  290. package/esm/orchestrator/emitter.d.mts.map +1 -0
  291. package/esm/orchestrator/emitter.mjs +85 -0
  292. package/esm/orchestrator/emitter.mjs.map +1 -0
  293. package/esm/orchestrator/engine-context.type.d.mts +56 -0
  294. package/esm/orchestrator/engine-context.type.d.mts.map +1 -0
  295. package/esm/orchestrator/execution.d.mts +116 -0
  296. package/esm/orchestrator/execution.d.mts.map +1 -0
  297. package/esm/orchestrator/execution.mjs +406 -0
  298. package/esm/orchestrator/execution.mjs.map +1 -0
  299. package/esm/orchestrator/index.d.mts +8 -0
  300. package/esm/orchestrator/index.mjs +10 -0
  301. package/esm/orchestrator/load.mjs +49 -0
  302. package/esm/orchestrator/load.mjs.map +1 -0
  303. package/esm/orchestrator/lock.mjs +75 -0
  304. package/esm/orchestrator/lock.mjs.map +1 -0
  305. package/esm/orchestrator/memory.d.mts +84 -0
  306. package/esm/orchestrator/memory.d.mts.map +1 -0
  307. package/esm/orchestrator/memory.mjs +141 -0
  308. package/esm/orchestrator/memory.mjs.map +1 -0
  309. package/esm/orchestrator/orchestrator-stream.d.mts +42 -0
  310. package/esm/orchestrator/orchestrator-stream.d.mts.map +1 -0
  311. package/esm/orchestrator/orchestrator-stream.mjs +98 -0
  312. package/esm/orchestrator/orchestrator-stream.mjs.map +1 -0
  313. package/esm/orchestrator/orchestrator.d.mts +38 -0
  314. package/esm/orchestrator/orchestrator.d.mts.map +1 -0
  315. package/esm/orchestrator/orchestrator.mjs +173 -0
  316. package/esm/orchestrator/orchestrator.mjs.map +1 -0
  317. package/esm/orchestrator/resume.mjs +74 -0
  318. package/esm/orchestrator/resume.mjs.map +1 -0
  319. package/esm/orchestrator/signature.d.mts +40 -0
  320. package/esm/orchestrator/signature.d.mts.map +1 -0
  321. package/esm/orchestrator/signature.mjs +120 -0
  322. package/esm/orchestrator/signature.mjs.map +1 -0
  323. package/esm/orchestrator/window.mjs +56 -0
  324. package/esm/orchestrator/window.mjs.map +1 -0
  325. package/esm/planner/index.d.mts +5 -0
  326. package/esm/planner/index.mjs +6 -0
  327. package/esm/planner/plan-prompt.d.mts +17 -0
  328. package/esm/planner/plan-prompt.d.mts.map +1 -0
  329. package/esm/planner/plan-prompt.mjs +30 -0
  330. package/esm/planner/plan-prompt.mjs.map +1 -0
  331. package/esm/planner/plan-schema.d.mts +27 -0
  332. package/esm/planner/plan-schema.d.mts.map +1 -0
  333. package/esm/planner/plan-schema.mjs +120 -0
  334. package/esm/planner/plan-schema.mjs.map +1 -0
  335. package/esm/planner/planner-run.d.mts +23 -0
  336. package/esm/planner/planner-run.d.mts.map +1 -0
  337. package/esm/planner/planner-run.mjs +344 -0
  338. package/esm/planner/planner-run.mjs.map +1 -0
  339. package/esm/planner/planner.d.mts +37 -0
  340. package/esm/planner/planner.d.mts.map +1 -0
  341. package/esm/planner/planner.mjs +120 -0
  342. package/esm/planner/planner.mjs.map +1 -0
  343. package/esm/planner/signature.d.mts +18 -0
  344. package/esm/planner/signature.d.mts.map +1 -0
  345. package/esm/planner/signature.mjs +27 -0
  346. package/esm/planner/signature.mjs.map +1 -0
  347. package/esm/snapshot/index.d.mts +3 -0
  348. package/esm/snapshot/memory.d.mts +26 -0
  349. package/esm/snapshot/memory.d.mts.map +1 -0
  350. package/esm/snapshot/memory.mjs +81 -0
  351. package/esm/snapshot/memory.mjs.map +1 -0
  352. package/esm/snapshot/pg.d.mts +41 -0
  353. package/esm/snapshot/pg.d.mts.map +1 -0
  354. package/esm/snapshot/pg.mjs +146 -0
  355. package/esm/snapshot/pg.mjs.map +1 -0
  356. package/esm/snapshot/redis.d.mts +42 -0
  357. package/esm/snapshot/redis.d.mts.map +1 -0
  358. package/esm/snapshot/redis.mjs +101 -0
  359. package/esm/snapshot/redis.mjs.map +1 -0
  360. package/esm/supervisor/as-tool.d.mts +0 -6
  361. package/esm/supervisor/as-tool.d.mts.map +1 -1
  362. package/esm/supervisor/as-tool.mjs +0 -6
  363. package/esm/supervisor/as-tool.mjs.map +1 -1
  364. package/esm/supervisor/execution.d.mts +43 -8
  365. package/esm/supervisor/execution.d.mts.map +1 -1
  366. package/esm/supervisor/execution.mjs +66 -16
  367. package/esm/supervisor/execution.mjs.map +1 -1
  368. package/esm/supervisor/fan-out.d.mts +65 -0
  369. package/esm/supervisor/fan-out.d.mts.map +1 -0
  370. package/esm/supervisor/fan-out.mjs +65 -0
  371. package/esm/supervisor/fan-out.mjs.map +1 -0
  372. package/esm/supervisor/index.d.mts +5 -3
  373. package/esm/supervisor/index.mjs +3 -1
  374. package/esm/supervisor/router-factory.d.mts +110 -0
  375. package/esm/supervisor/router-factory.d.mts.map +1 -0
  376. package/esm/supervisor/router-factory.mjs +141 -0
  377. package/esm/supervisor/router-factory.mjs.map +1 -0
  378. package/esm/supervisor/router-prompt.d.mts +1 -1
  379. package/esm/supervisor/snapshot.d.mts +4 -10
  380. package/esm/supervisor/snapshot.d.mts.map +1 -1
  381. package/esm/supervisor/snapshot.mjs +8 -16
  382. package/esm/supervisor/snapshot.mjs.map +1 -1
  383. package/esm/supervisor/supervisor.mjs +1 -0
  384. package/esm/supervisor/supervisor.mjs.map +1 -1
  385. package/esm/system-prompt/index.mjs +6 -0
  386. package/esm/system-prompt/system-prompt.d.mts +51 -3
  387. package/esm/system-prompt/system-prompt.d.mts.map +1 -1
  388. package/esm/system-prompt/system-prompt.mjs +52 -6
  389. package/esm/system-prompt/system-prompt.mjs.map +1 -1
  390. package/esm/testing/matcher-logic.d.mts +76 -0
  391. package/esm/testing/matcher-logic.d.mts.map +1 -0
  392. package/esm/testing/matcher-logic.mjs +144 -0
  393. package/esm/testing/matcher-logic.mjs.map +1 -0
  394. package/esm/testing/matchers.d.mts +48 -0
  395. package/esm/testing/matchers.d.mts.map +1 -0
  396. package/esm/testing/matchers.mjs +37 -0
  397. package/esm/testing/matchers.mjs.map +1 -0
  398. package/esm/testing/register-lazy.d.mts +20 -0
  399. package/esm/testing/register-lazy.d.mts.map +1 -0
  400. package/esm/testing/register-lazy.mjs +24 -0
  401. package/esm/testing/register-lazy.mjs.map +1 -0
  402. package/esm/tool/executable-as-tool.d.mts +87 -0
  403. package/esm/tool/executable-as-tool.d.mts.map +1 -0
  404. package/esm/tool/executable-as-tool.mjs +81 -0
  405. package/esm/tool/executable-as-tool.mjs.map +1 -0
  406. package/esm/tool/index.d.mts +2 -1
  407. package/esm/tool/index.mjs +1 -0
  408. package/esm/workflow/as-tool.mjs +0 -6
  409. package/esm/workflow/as-tool.mjs.map +1 -1
  410. package/esm/workflow/engine.mjs +2 -2
  411. package/esm/workflow/snapshot.mjs +13 -7
  412. package/esm/workflow/snapshot.mjs.map +1 -1
  413. package/esm/workflow/step-runner.mjs +1 -1
  414. package/esm/workflow/workflow.mjs +1 -0
  415. package/esm/workflow/workflow.mjs.map +1 -1
  416. package/llms-full.txt +947 -42
  417. package/llms.txt +13 -8
  418. package/package.json +3 -3
  419. package/skills/README.md +25 -5
  420. package/skills/ai-basics/SKILL.md +18 -7
  421. package/skills/ai-dx-helpers/SKILL.md +180 -0
  422. package/skills/attach-ai-middleware/SKILL.md +32 -3
  423. package/skills/handle-ai-errors/SKILL.md +20 -6
  424. package/skills/manage-ai-stores/SKILL.md +127 -0
  425. package/skills/persist-ai-data/SKILL.md +21 -10
  426. package/skills/pick-ai-provider/SKILL.md +46 -12
  427. package/skills/run-ai-agent/SKILL.md +51 -2
  428. package/skills/run-orchestrator/SKILL.md +198 -0
  429. package/skills/run-planner/SKILL.md +68 -0
  430. package/skills/run-supervisor/SKILL.md +47 -2
  431. package/skills/use-ai-memory/SKILL.md +124 -0
  432. package/skills/write-system-prompt/SKILL.md +14 -1
@@ -0,0 +1,60 @@
1
+ import { ExecutableContract } from "../executable.contract.mjs";
2
+ import { PlannerExecuteOptions } from "./planner-execute-options.type.mjs";
3
+ import { PlannerResult } from "./planner-result.type.mjs";
4
+
5
+ //#region ../@warlock.js/ai/src/contracts/planner/planner.contract.d.ts
6
+ /**
7
+ * Runtime handle returned by `ai.planner(config)`.
8
+ *
9
+ * Implements {@link ExecutableContract} alongside `AgentContract`,
10
+ * `WorkflowInstance`, and `SupervisorContract`, so a planner can be
11
+ * dispatched anywhere the framework dispatches an executable — composed
12
+ * as a supervisor intent, an orchestrator capability, or wrapped as a
13
+ * tool for an outer agent.
14
+ *
15
+ * **What it does.** At `execute(goal)` it asks an LLM to GENERATE an
16
+ * ordered plan over the registered capabilities, then executes that
17
+ * plan step-by-step through each capability's own `execute()`,
18
+ * returning the unified `{ data, report, usage, error }` envelope with
19
+ * `report.type === "planner"`. Never throws on runtime failure — errors
20
+ * surface via `result.error`. Authoring-time misconfiguration throws at
21
+ * factory call, not here.
22
+ *
23
+ * @example
24
+ * const research = ai.planner({
25
+ * name: "research-assistant",
26
+ * model: ai.openai.model({ name: "gpt-4o" }),
27
+ * capabilities: [
28
+ * { name: "search", description: "Search the web", executable: searchAgent },
29
+ * { name: "write", description: "Draft a summary", executable: writerAgent },
30
+ * ],
31
+ * });
32
+ *
33
+ * const { data, report, usage, error } = await research.execute(
34
+ * "Summarize the latest on TypeScript 6",
35
+ * );
36
+ *
37
+ * console.log(report.plan?.summary);
38
+ * for (const executed of report.executedSteps) {
39
+ * console.log(executed.step.capability, executed.status);
40
+ * }
41
+ */
42
+ interface PlannerContract<TOutput = unknown> extends ExecutableContract<string, PlannerExecuteOptions<TOutput>, PlannerResult<TOutput>> {
43
+ /** Stable identifier — mirrors the config's `name`. */
44
+ readonly name: string;
45
+ /**
46
+ * Structural fingerprint of the planner definition — name + ordered
47
+ * capability names. Stamped on every report node this planner
48
+ * produces.
49
+ */
50
+ readonly signature: string;
51
+ /**
52
+ * Generate a plan over the configured capabilities and execute it
53
+ * end-to-end. Returns the uniform `{ data, report, usage, error }`
54
+ * shape; runtime failures surface on `result.error`.
55
+ */
56
+ execute(goal: string, options?: PlannerExecuteOptions<TOutput>): Promise<PlannerResult<TOutput>>;
57
+ }
58
+ //#endregion
59
+ export { PlannerContract };
60
+ //# sourceMappingURL=planner.contract.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner.contract.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/planner/planner.contract.ts"],"mappings":";;;;;;;AAwCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBkC;;UAtBjB,eAAA,4BAA2C,kBAAA,SAE1D,qBAAA,CAAsB,OAAA,GACtB,aAAA,CAAc,OAAA;;WAGL,IAAA;;;;;;WAMA,SAAA;;;;;;EAOT,OAAA,CACE,IAAA,UACA,OAAA,GAAU,qBAAA,CAAsB,OAAA,IAC/B,OAAA,CAAQ,aAAA,CAAc,OAAA;AAAA"}
@@ -19,7 +19,7 @@ declare const REPORT_SCHEMA_VERSION = 1;
19
19
  * {@link BaseReport}. Forms a closed union so consumers can narrow on
20
20
  * the tree without string-matching on `name`.
21
21
  */
22
- type ReportType = "tool" | "callback" | "agent" | "workflow" | "supervisor";
22
+ type ReportType = "tool" | "callback" | "agent" | "workflow" | "supervisor" | "orchestrator" | "batch" | "planner";
23
23
  /**
24
24
  * Terminal status every executable primitive reports. Unified across
25
25
  * tools, agents, workflows, and supervisors so dashboards and
@@ -34,8 +34,13 @@ type ReportType = "tool" | "callback" | "agent" | "workflow" | "supervisor";
34
34
  * iteration cap was hit without an explicit `END` / `satisfied`.
35
35
  * Harmless on non-supervisor reports; keeping it on the shared
36
36
  * union lets consumers write one `switch` for every status.
37
+ * - `"awaiting-input"` — orchestrator-specific NON-terminal status: the
38
+ * session is paused waiting for the next user turn (§15.6). The only
39
+ * non-terminal member of this union; consumers branching on
40
+ * `status === "completed"` must treat it as a session-continues path,
41
+ * not a failure. Harmless on non-orchestrator reports.
37
42
  */
38
- type ReportStatus = "completed" | "failed" | "cancelled" | "max-iterations";
43
+ type ReportStatus = "completed" | "failed" | "cancelled" | "max-iterations" | "awaiting-input";
39
44
  /**
40
45
  * Universal execution report shared by every primitive. Per-primitive
41
46
  * report types extend this with their own domain-specific fields
@@ -1 +1 @@
1
- {"version":3,"file":"base-report.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/base-report.type.ts"],"mappings":";;;;;;AAcA;;;;AAAkC;AAOlC;;;;cAPa,qBAAA;AA6Bb;;;;AAAwB;AAAxB,KAtBY,UAAA;;;;;;;;;;;;;;;;KAsBA,YAAA;;;;;;;;;;;;;;;AA4GS;;;;;;;;;;KA9ET,UAAA;sFAEV,KAAA;;;;;;;;;;EAUA,WAAA;;;;;;;EAOA,SAAA;EAEA,IAAA;;;;;;;;;;;;EAYA,OAAA;;;;;;;;;;EAUA,SAAA;EAEA,IAAA,EAAM,UAAA;EAEN,MAAA,EAAQ,YAAA;EAER,SAAA;EAEA,OAAA;EAEA,QAAA;EAEA,KAAA,EAAO,KAAA;;;;;;EAMP,QAAA,EAAU,UAAA;;;;;;;;EAQV,QAAA,GAAW,YAAA;;;;;;;;;EASX,mBAAA;AAAA"}
1
+ {"version":3,"file":"base-report.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/base-report.type.ts"],"mappings":";;;;;;AAcA;;;;AAAkC;AAOlC;;;;cAPa,qBAAA;AAqCb;;;;AAAwB;AAAxB,KA9BY,UAAA;;;;;;;;;;;;;;;;;;;;;KA8BA,YAAA;;;;;;;;;;AA6GS;;;;;;;;;;;;;;;KA9ET,UAAA;sFAEV,KAAA;;;;;;;;;;EAUA,WAAA;;;;;;;EAOA,SAAA;EAEA,IAAA;;;;;;;;;;;;EAYA,OAAA;;;;;;;;;;EAUA,SAAA;EAEA,IAAA,EAAM,UAAA;EAEN,MAAA,EAAQ,YAAA;EAER,SAAA;EAEA,OAAA;EAEA,QAAA;EAEA,KAAA,EAAO,KAAA;;;;;;EAMP,QAAA,EAAU,UAAA;;;;;;;;EAQV,QAAA,GAAW,YAAA;;;;;;;;;EASX,mBAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"base-report.type.mjs","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/base-report.type.ts"],"sourcesContent":["import type { AttemptEntry } from \"./attempt-entry.type\";\nimport type { Usage } from \"./usage.type\";\n\n/**\n * Wire-format version stamped on every root `BaseReport`. Bumped only\n * when we make a BREAKING change to the report shape (field removed,\n * required-ness flipped, semantics changed). Additive changes (new\n * optional fields) do not bump.\n *\n * Panoptic and other downstream consumers branch on this to parse\n * old stored reports with their original-shape rules.\n *\n * Current: **1** — initial Panoptic-readiness shape.\n */\nexport const REPORT_SCHEMA_VERSION = 1;\n\n/**\n * Discriminator for the kind of executable that produced a given\n * {@link BaseReport}. Forms a closed union so consumers can narrow on\n * the tree without string-matching on `name`.\n */\nexport type ReportType =\n | \"tool\"\n | \"callback\"\n | \"agent\"\n | \"workflow\"\n | \"supervisor\";\n\n/**\n * Terminal status every executable primitive reports. Unified across\n * tools, agents, workflows, and supervisors so dashboards and\n * generic traversal helpers don't special-case per primitive.\n *\n * - `\"completed\"` — ran to natural end with a usable result.\n * - `\"failed\"` — aborted mid-run or finished without a usable result\n * (crash, schema failure, max-trips, etc.). The\n * accompanying `error` on the envelope carries the typed cause.\n * - `\"cancelled\"` — caller aborted before completion via `AbortSignal`.\n * - `\"max-iterations\"` — supervisor-specific termination when the\n * iteration cap was hit without an explicit `END` / `satisfied`.\n * Harmless on non-supervisor reports; keeping it on the shared\n * union lets consumers write one `switch` for every status.\n */\nexport type ReportStatus =\n | \"completed\"\n | \"failed\"\n | \"cancelled\"\n | \"max-iterations\";\n\n/**\n * Universal execution report shared by every primitive. Per-primitive\n * report types extend this with their own domain-specific fields\n * (agent trips, workflow steps, supervisor iteration snapshots) while\n * keeping the root fields identical. Recursion happens through\n * {@link BaseReport.children} — any executable this node invoked\n * contributes its own full report here, producing a walkable tree of\n * the entire run.\n *\n * **Usage rollup.** `usage` at every node equals this node's own cost\n * plus the sum of each child's `usage`. Leaves (tools) contribute\n * zero own-cost; composites contribute their direct LLM spend only,\n * with children covering everything delegated.\n *\n * @example\n * function totalCost(report: BaseReport): number {\n * return report.usage.total;\n * }\n *\n * function walk(report: BaseReport, depth = 0): void {\n * console.log(`${\" \".repeat(depth)}${report.type} \"${report.name}\" — ${report.status}`);\n * for (const child of report.children) walk(child, depth + 1);\n * }\n */\nexport type BaseReport = {\n /** Stable id for this execution node. Generated per `execute()`/`invoke()` call. */\n runId: string;\n /**\n * Run-id of the immediate parent execution node, when this node was\n * invoked as part of a larger run (e.g. a tool dispatched by an\n * agent; an agent dispatched by a supervisor; an inner primitive\n * wrapped via `asTool()`). Absent on root nodes.\n *\n * Lets Panoptic and other flat-row consumers reconstruct the tree\n * without traversing `children[]` in memory.\n */\n parentRunId?: string;\n /**\n * Run-id of the top-level execution this node belongs to. Equals\n * `runId` on the root node, and is propagated downward to every\n * descendant. Used to slice flat report tables back into per-run\n * groupings.\n */\n rootRunId: string;\n /** Executable identity — the tool/agent/workflow/supervisor name. */\n name: string;\n /**\n * Dev-curated version string mirrored from the primitive's config\n * (`AgentConfig.version`, `ToolConfig.version`, etc.). Free-form —\n * the framework neither parses nor compares it. Stored verbatim on\n * every report so trip-archive queries can distinguish runs of\n * \"agent X v2.1\" from \"agent X v2.2\" even when name + signature\n * are identical.\n *\n * Stays `undefined` when the dev didn't declare one — never\n * auto-defaulted.\n */\n version?: string;\n /**\n * Caller-supplied identifier that groups multiple `.execute()` calls\n * into one conceptual user session / request. Propagated to every\n * descendant report node so flat queries (\"total spend for session\n * X today\") work without joining the tree.\n *\n * Threaded from `execute()` options on every primitive. Optional —\n * absent when the caller didn't supply one.\n */\n sessionId?: string;\n /** Discriminator for the kind of executable that produced this report. */\n type: ReportType;\n /** Terminal status of this execution. */\n status: ReportStatus;\n /** ISO-8601 wall-clock timestamp when execution began. */\n startedAt: string;\n /** ISO-8601 wall-clock timestamp when execution finished. */\n endedAt: string;\n /** Monotonic duration in milliseconds — `performance.now()` delta. */\n duration: number;\n /** Rolled-up usage: own cost + sum of `children[].usage`. */\n usage: Usage;\n /**\n * Reports of every executable invoked by this node, in invocation\n * order. Empty for leaves (pure tools) and for executables that\n * didn't delegate work.\n */\n children: BaseReport[];\n /**\n * Retry history when middleware (or, for workflow steps, the engine\n * itself) retried this node before it either succeeded or gave up.\n * Absent when zero retries happened — keeps the common-case payload\n * lean. The surviving (final) attempt is NOT duplicated here; its\n * outcome is the report's own `status` / timing.\n */\n attempts?: AttemptEntry[];\n /**\n * Wire-format version of this report shape. Only present on root\n * report nodes — implies the same version for the whole tree.\n * Panoptic / archive consumers branch on this to parse old reports\n * with their original-shape rules.\n *\n * Always equals {@link REPORT_SCHEMA_VERSION} at write time.\n */\n reportSchemaVersion?: number;\n};\n"],"mappings":";;;;;;;;;;;;AAcA,MAAa,wBAAwB"}
1
+ {"version":3,"file":"base-report.type.mjs","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/base-report.type.ts"],"sourcesContent":["import type { AttemptEntry } from \"./attempt-entry.type\";\nimport type { Usage } from \"./usage.type\";\n\n/**\n * Wire-format version stamped on every root `BaseReport`. Bumped only\n * when we make a BREAKING change to the report shape (field removed,\n * required-ness flipped, semantics changed). Additive changes (new\n * optional fields) do not bump.\n *\n * Panoptic and other downstream consumers branch on this to parse\n * old stored reports with their original-shape rules.\n *\n * Current: **1** — initial Panoptic-readiness shape.\n */\nexport const REPORT_SCHEMA_VERSION = 1;\n\n/**\n * Discriminator for the kind of executable that produced a given\n * {@link BaseReport}. Forms a closed union so consumers can narrow on\n * the tree without string-matching on `name`.\n */\nexport type ReportType =\n | \"tool\"\n | \"callback\"\n | \"agent\"\n | \"workflow\"\n | \"supervisor\"\n | \"orchestrator\"\n | \"batch\"\n | \"planner\";\n\n/**\n * Terminal status every executable primitive reports. Unified across\n * tools, agents, workflows, and supervisors so dashboards and\n * generic traversal helpers don't special-case per primitive.\n *\n * - `\"completed\"` — ran to natural end with a usable result.\n * - `\"failed\"` — aborted mid-run or finished without a usable result\n * (crash, schema failure, max-trips, etc.). The\n * accompanying `error` on the envelope carries the typed cause.\n * - `\"cancelled\"` — caller aborted before completion via `AbortSignal`.\n * - `\"max-iterations\"` — supervisor-specific termination when the\n * iteration cap was hit without an explicit `END` / `satisfied`.\n * Harmless on non-supervisor reports; keeping it on the shared\n * union lets consumers write one `switch` for every status.\n * - `\"awaiting-input\"` — orchestrator-specific NON-terminal status: the\n * session is paused waiting for the next user turn (§15.6). The only\n * non-terminal member of this union; consumers branching on\n * `status === \"completed\"` must treat it as a session-continues path,\n * not a failure. Harmless on non-orchestrator reports.\n */\nexport type ReportStatus =\n | \"completed\"\n | \"failed\"\n | \"cancelled\"\n | \"max-iterations\"\n | \"awaiting-input\";\n\n/**\n * Universal execution report shared by every primitive. Per-primitive\n * report types extend this with their own domain-specific fields\n * (agent trips, workflow steps, supervisor iteration snapshots) while\n * keeping the root fields identical. Recursion happens through\n * {@link BaseReport.children} — any executable this node invoked\n * contributes its own full report here, producing a walkable tree of\n * the entire run.\n *\n * **Usage rollup.** `usage` at every node equals this node's own cost\n * plus the sum of each child's `usage`. Leaves (tools) contribute\n * zero own-cost; composites contribute their direct LLM spend only,\n * with children covering everything delegated.\n *\n * @example\n * function totalCost(report: BaseReport): number {\n * return report.usage.total;\n * }\n *\n * function walk(report: BaseReport, depth = 0): void {\n * console.log(`${\" \".repeat(depth)}${report.type} \"${report.name}\" — ${report.status}`);\n * for (const child of report.children) walk(child, depth + 1);\n * }\n */\nexport type BaseReport = {\n /** Stable id for this execution node. Generated per `execute()`/`invoke()` call. */\n runId: string;\n /**\n * Run-id of the immediate parent execution node, when this node was\n * invoked as part of a larger run (e.g. a tool dispatched by an\n * agent; an agent dispatched by a supervisor; an inner primitive\n * wrapped via `asTool()`). Absent on root nodes.\n *\n * Lets Panoptic and other flat-row consumers reconstruct the tree\n * without traversing `children[]` in memory.\n */\n parentRunId?: string;\n /**\n * Run-id of the top-level execution this node belongs to. Equals\n * `runId` on the root node, and is propagated downward to every\n * descendant. Used to slice flat report tables back into per-run\n * groupings.\n */\n rootRunId: string;\n /** Executable identity — the tool/agent/workflow/supervisor name. */\n name: string;\n /**\n * Dev-curated version string mirrored from the primitive's config\n * (`AgentConfig.version`, `ToolConfig.version`, etc.). Free-form —\n * the framework neither parses nor compares it. Stored verbatim on\n * every report so trip-archive queries can distinguish runs of\n * \"agent X v2.1\" from \"agent X v2.2\" even when name + signature\n * are identical.\n *\n * Stays `undefined` when the dev didn't declare one — never\n * auto-defaulted.\n */\n version?: string;\n /**\n * Caller-supplied identifier that groups multiple `.execute()` calls\n * into one conceptual user session / request. Propagated to every\n * descendant report node so flat queries (\"total spend for session\n * X today\") work without joining the tree.\n *\n * Threaded from `execute()` options on every primitive. Optional —\n * absent when the caller didn't supply one.\n */\n sessionId?: string;\n /** Discriminator for the kind of executable that produced this report. */\n type: ReportType;\n /** Terminal status of this execution. */\n status: ReportStatus;\n /** ISO-8601 wall-clock timestamp when execution began. */\n startedAt: string;\n /** ISO-8601 wall-clock timestamp when execution finished. */\n endedAt: string;\n /** Monotonic duration in milliseconds — `performance.now()` delta. */\n duration: number;\n /** Rolled-up usage: own cost + sum of `children[].usage`. */\n usage: Usage;\n /**\n * Reports of every executable invoked by this node, in invocation\n * order. Empty for leaves (pure tools) and for executables that\n * didn't delegate work.\n */\n children: BaseReport[];\n /**\n * Retry history when middleware (or, for workflow steps, the engine\n * itself) retried this node before it either succeeded or gave up.\n * Absent when zero retries happened — keeps the common-case payload\n * lean. The surviving (final) attempt is NOT duplicated here; its\n * outcome is the report's own `status` / timing.\n */\n attempts?: AttemptEntry[];\n /**\n * Wire-format version of this report shape. Only present on root\n * report nodes — implies the same version for the whole tree.\n * Panoptic / archive consumers branch on this to parse old reports\n * with their original-shape rules.\n *\n * Always equals {@link REPORT_SCHEMA_VERSION} at write time.\n */\n reportSchemaVersion?: number;\n};\n"],"mappings":";;;;;;;;;;;;AAcA,MAAa,wBAAwB"}
@@ -8,7 +8,8 @@ import { LLMTrip } from "./llm-trip.type.mjs";
8
8
  import { AgentReport, ExecutionReport, ExecutionStatus } from "./execution-report.type.mjs";
9
9
  import { AgentResult } from "./agent-result.type.mjs";
10
10
  import { ExecuteResult } from "./execute-result.type.mjs";
11
+ import { SupervisorReport, SupervisorResult, SupervisorTerminatedBy } from "./supervisor-result.type.mjs";
11
12
  import { StepSnapshot } from "./step-result.type.mjs";
12
13
  import { WorkflowReport, WorkflowResult } from "./workflow-result.type.mjs";
13
- import { SupervisorReport, SupervisorResult, SupervisorTerminatedBy } from "./supervisor-result.type.mjs";
14
+ import { CompactionResult, OrchestratorAwaitingStatus, OrchestratorReport, OrchestratorReportStatus, OrchestratorReportType, OrchestratorResult, TurnSnapshot } from "./orchestrator-result.type.mjs";
14
15
  import { SessionSendResult } from "./session-send-result.type.mjs";
@@ -45,6 +45,16 @@ type ModelPricing = {
45
45
  * does not. Falls back to `output` when undefined.
46
46
  */
47
47
  cachedOutput?: number;
48
+ /**
49
+ * USD per 1M reasoning/thinking tokens (`Usage.reasoningTokens`), for
50
+ * providers that price reasoning above the standard output rate.
51
+ * Falls back to `output` when undefined — the common case, since most
52
+ * providers bill reasoning tokens at the output rate.
53
+ *
54
+ * @example
55
+ * const pricing: ModelPricing = { input: 0.15, output: 0.6, reasoning: 0.6 };
56
+ */
57
+ reasoning?: number;
48
58
  };
49
59
  //#endregion
50
60
  export { ModelPricing };
@@ -1 +1 @@
1
- {"version":3,"file":"model-pricing.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/model-pricing.type.ts"],"mappings":";;AA+BA;;;;;;;;;AAgBc;;;;;;;;;;;;;;;;;;;;;KAhBF,YAAA;iCAEV,KAAA;EAEA,MAAA;;;;;;EAMA,WAAA;;;;;;EAMA,YAAA;AAAA"}
1
+ {"version":3,"file":"model-pricing.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/model-pricing.type.ts"],"mappings":";;AA+BA;;;;;;;;;;AA0BW;;;;;;;;;;;;;;;;;;;;KA1BC,YAAA;iCAEV,KAAA;EAEA,MAAA;;;;;;EAMA,WAAA;;;;;;EAMA,YAAA;;;;;;;;;;EAUA,SAAA;AAAA"}
@@ -0,0 +1,143 @@
1
+ import { Message } from "../conversation-message.type.mjs";
2
+ import { Usage } from "./usage.type.mjs";
3
+ import { BaseReport, ReportStatus } from "./base-report.type.mjs";
4
+ import { ExecuteResult } from "./execute-result.type.mjs";
5
+ import { SupervisorInput } from "../supervisor/supervisor-input.type.mjs";
6
+ import { EvaluateResult } from "../supervisor/evaluate-context.type.mjs";
7
+ import { AgentBranchSnapshot } from "../supervisor/iteration-snapshot.type.mjs";
8
+
9
+ //#region ../@warlock.js/ai/src/contracts/result/orchestrator-result.type.d.ts
10
+ /**
11
+ * Discriminator literal the orchestrator stamps onto its report's
12
+ * `type` field (design §15.5). A member of the shared
13
+ * {@link ReportType} closed union in `base-report.type.ts`.
14
+ *
15
+ * {@link OrchestratorReport} re-declares `type` as this literal by
16
+ * *overriding* it (`Omit<BaseReport, "type"> & { type: ... }`) rather than
17
+ * intersecting `BaseReport` with it: intersecting a single literal against
18
+ * `BaseReport.type` (the whole `ReportType` union) lets a strict TypeScript
19
+ * collapse the report to `never` ("conflicting types in some constituents").
20
+ */
21
+ type OrchestratorReportType = "orchestrator";
22
+ /**
23
+ * Non-terminal status the orchestrator adds on top of the shared
24
+ * {@link ReportStatus} union — the session is paused waiting for the
25
+ * next user turn (design §15.6, Q9). This is the only non-terminal
26
+ * status across the unified result tree, and is now a member of the
27
+ * shared {@link ReportStatus} union in `base-report.type.ts`.
28
+ */
29
+ type OrchestratorAwaitingStatus = "awaiting-input";
30
+ /**
31
+ * Combined status surface for an orchestrator report — every terminal
32
+ * {@link ReportStatus} plus the non-terminal `"awaiting-input"`.
33
+ * Consumers branching on `status === "completed"` must explicitly
34
+ * handle `"awaiting-input"` as a session-continues path, not a failure
35
+ * (§15.6, §18.10).
36
+ */
37
+ type OrchestratorReportStatus = ReportStatus | OrchestratorAwaitingStatus;
38
+ /**
39
+ * The result of compacting (summarizing) a slice of session history
40
+ * (design §12, §15.5). Carries the replacement summary message plus the
41
+ * inclusive index range it replaces, so a dev-owned message store can
42
+ * apply the compaction deterministically.
43
+ *
44
+ * Structurally identical to `OrchestratorCommands["compact"]["result"]`
45
+ * — both are kept per the literal §11 / §15.5 spec shapes.
46
+ */
47
+ type CompactionResult = {
48
+ /** The summary message that replaces the compacted range. */summary: Message; /** Inclusive start index (in the dev's history array) of the replaced range. */
49
+ replacesFromIndex: number; /** Inclusive end index of the replaced range. */
50
+ replacesToIndex: number;
51
+ };
52
+ /**
53
+ * One turn's forensic record on {@link OrchestratorReport.turns}.
54
+ * Mirrors the supervisor's `IterationSnapshot.result` shape so a turn
55
+ * reads uniformly whether it dispatched one agent (`iterate: false`) or
56
+ * delegated to an internal supervisor (`iterate: true`).
57
+ *
58
+ * Frozen (`Readonly`) so consumers can pass snapshots across async
59
+ * boundaries without defensive cloning. `state` is the post-merge,
60
+ * JSON-serializable session state at the end of the turn.
61
+ */
62
+ type TurnSnapshot = Readonly<{
63
+ /** Zero-indexed turn number. */turn: number; /** The user input that opened this turn. */
64
+ input: SupervisorInput; /** Where the dispatch decision came from and its raw value. */
65
+ decision: {
66
+ source: "route" | "router" | "intent.next";
67
+ raw: unknown;
68
+ reasoning?: string;
69
+ }; /** Per-branch dispatch records keyed by intent (mirrors supervisor). */
70
+ result: Record<string, AgentBranchSnapshot>; /** Post-merge session state — JSON-serializable. */
71
+ state: unknown; /** Evaluate verdict, if `evaluate` ran this turn. */
72
+ evaluate?: EvaluateResult;
73
+ startedAt: string;
74
+ endedAt: string;
75
+ duration: number;
76
+ usage: Usage;
77
+ /**
78
+ * The dispatched primitive's full report tree — the internal
79
+ * supervisor's report when `iterate: true`, the direct agent's report
80
+ * when `iterate: false`.
81
+ */
82
+ childReport?: BaseReport;
83
+ }>;
84
+ /**
85
+ * Session-scoped execution report for a single orchestrator turn
86
+ * (design §15.5). Extends {@link BaseReport} with session identity, the
87
+ * turn index, the drift signature, and the per-turn history on
88
+ * `turns[]`.
89
+ *
90
+ * `children[]` carries ONLY the current turn's dispatched primitive
91
+ * reports (Q9). Full session history lives on `turns[]`; walkers that
92
+ * recurse via `children[]` will NOT reach prior turns — intentional.
93
+ *
94
+ * @remarks
95
+ * `type` and `status` are the orchestrator-specific literals — both
96
+ * `"orchestrator"` and `"awaiting-input"` are members of the shared
97
+ * {@link ReportType} / {@link ReportStatus} unions. `type` is OVERRIDDEN
98
+ * via `Omit<BaseReport, "type">` (not intersected) so a strict TypeScript
99
+ * can't collapse the report to `never`; `status` is re-declared compatibly.
100
+ */
101
+ type OrchestratorReport = Omit<BaseReport, "type"> & {
102
+ type: OrchestratorReportType;
103
+ status: OrchestratorReportStatus;
104
+ sessionId: string;
105
+ turnIndex: number; /** Orchestrator-scope drift signature (§10.1). */
106
+ signature: string;
107
+ version?: string; /** Current turn + (optionally) prior turns, bounded by `keepSnapshots`. */
108
+ turns: TurnSnapshot[];
109
+ };
110
+ /**
111
+ * Per-turn result returned by `orchestrator.execute()` and resolved by
112
+ * `orchestrator.stream().result` (design §15.5). Extends the unified
113
+ * {@link ExecuteResult} envelope with the session id, the turn index,
114
+ * an optional compaction record, and the orchestrator report.
115
+ *
116
+ * Narrow on `report.type` / `report.status` (not a top-level
117
+ * discriminant string) and read typed `data` for the turn's output.
118
+ *
119
+ * @example
120
+ * const result = await orchestrator.execute(message, { sessionId, history });
121
+ *
122
+ * if (result.error) {
123
+ * logger.error(result.error.code, { sessionId: result.sessionId });
124
+ * return;
125
+ * }
126
+ *
127
+ * if (result.report.status === "awaiting-input") {
128
+ * // session continues — prompt the user for the next turn
129
+ * }
130
+ *
131
+ * if (result.compaction) {
132
+ * await myMessageStore.applyCompaction(result.sessionId, result.compaction);
133
+ * }
134
+ */
135
+ type OrchestratorResult<TOutput = unknown> = Omit<ExecuteResult<TOutput>, "report"> & {
136
+ sessionId: string;
137
+ turnIndex: number;
138
+ compaction?: CompactionResult;
139
+ report: OrchestratorReport;
140
+ };
141
+ //#endregion
142
+ export { CompactionResult, OrchestratorAwaitingStatus, OrchestratorReport, OrchestratorReportStatus, OrchestratorReportType, OrchestratorResult, TurnSnapshot };
143
+ //# sourceMappingURL=orchestrator-result.type.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator-result.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/orchestrator-result.type.ts"],"mappings":";;;;;;;;;;;AAmBA;;;;AAAkC;AASlC;;;;KATY,sBAAA;AAkBZ;;;;AAAgF;AAWhF;;AAXA,KATY,0BAAA;;;;;;;AA0BK;KAjBL,wBAAA,GAA2B,YAAA,GAAe,0BAA0B;;;;;;;;;;KAWpE,gBAAA;EAmBuB,6DAjBjC,OAAA,EAAS,OAAO,EAmBhB;EAjBA,iBAAA,UAmBO;EAjBP,eAAA;AAAA;;;;;;;;;;;KAaU,YAAA,GAAe,QAAA;EAoBzB,gCAlBA,IAAA,UAwBA;EAtBA,KAAA,EAAO,eAAA,EAsBiB;EApBxB,QAAA;IACE,MAAA;IACA,GAAA;IACA,SAAA;EAAA,GAqC6B;EAlC/B,MAAA,EAAQ,MAAA,SAAe,mBAAA,GAoCf;EAlCR,KAAA,WAyCmB;EAvCnB,QAAA,GAAW,cAAA;EACX,SAAA;EACA,OAAA;EACA,QAAA;EACA,KAAA,EAAO,KAAA;EA4BP;;;;;EAtBA,WAAA,GAAc,UAAA;AAAA;;;AA6BK;AA4BrB;;;;;;;;;;;;;;KArCY,kBAAA,GAAqB,IAAA,CAAK,UAAA;EACpC,IAAA,EAAM,sBAAA;EACN,MAAA,EAAQ,wBAAA;EACR,SAAA;EACA,SAAA,UAqCQ;EAnCR,SAAA;EACA,OAAA;EAEA,KAAA,EAAO,YAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;KA4BG,kBAAA,sBAAwC,IAAA,CAAK,aAAA,CAAc,OAAA;EACrE,SAAA;EACA,SAAA;EACA,UAAA,GAAa,gBAAA;EACb,MAAA,EAAQ,kBAAA;AAAA"}
@@ -1,13 +1,22 @@
1
1
  import { AIError } from "../../errors/ai-error.mjs";
2
2
  import { Usage } from "./usage.type.mjs";
3
3
  import { AgentResult } from "./agent-result.type.mjs";
4
- import { WorkflowResult } from "./workflow-result.type.mjs";
5
4
  import { SupervisorResult } from "./supervisor-result.type.mjs";
5
+ import { WorkflowResult } from "./workflow-result.type.mjs";
6
6
 
7
7
  //#region ../@warlock.js/ai/src/contracts/result/session-send-result.type.d.ts
8
8
  /**
9
- * Result returned by SessionContract.send().
10
- * Narrows executionResult by checking the `type` discriminant.
9
+ * Result returned by `SessionContract.send()`.
10
+ * Narrows `executionResult` by checking the `type` discriminant.
11
+ *
12
+ * @deprecated Obsolete v2 forward-declaration. The locked v1
13
+ * orchestrator's per-turn result is `OrchestratorResult<TOutput>` — see
14
+ * `./orchestrator-result.type`. It extends the unified
15
+ * {@link ExecuteResult} envelope (`data` / `error` / `usage` / `report`)
16
+ * and adds `sessionId` / `turnIndex` / optional `compaction`, narrowing
17
+ * via `report.type` / `report.status` rather than the `response` /
18
+ * `done` / `executionResult` fields here. Retained unchanged for one
19
+ * minor for non-breaking compatibility; do not use in new code.
11
20
  *
12
21
  * @example
13
22
  * const result = await session.send("Analyze this dataset");
@@ -1 +1 @@
1
- {"version":3,"file":"session-send-result.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/session-send-result.type.ts"],"mappings":";;;;;;;;;AAkBA;;;;;;;;;;KAAY,iBAAA;EAIV,iDAFA,QAAA,UAIQ;EAFR,IAAA,WAKI;EAHJ,KAAA,GAAQ,OAAA,EAKJ;EAHJ,eAAA,EACI,WAAA,YACA,gBAAA,YACA,cAAA,WAEG;EAAP,KAAA,EAAO,KAAA;AAAA"}
1
+ {"version":3,"file":"session-send-result.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/session-send-result.type.ts"],"mappings":";;;;;;;;;AA2BA;;;;;;;;;;;;;;;;;;;KAAY,iBAAA;EAaE,iDAXZ,QAAA;EAEA,IAAA;EAEA,KAAA,GAAQ,OAAA;EAER,eAAA,EACI,WAAA,YACA,gBAAA,YACA,cAAA;EAEJ,KAAA,EAAO,KAAA;AAAA"}
@@ -1,7 +1,7 @@
1
1
  import { BaseResult } from "./base-result.type.mjs";
2
2
  import { BaseReport } from "./base-report.type.mjs";
3
- import { AckSnapshot, IterationSnapshot } from "../supervisor/iteration-snapshot.type.mjs";
4
3
  import { ClassifierSnapshot } from "../supervisor/classifier-context.type.mjs";
4
+ import { AckSnapshot, IterationSnapshot } from "../supervisor/iteration-snapshot.type.mjs";
5
5
 
6
6
  //#region ../@warlock.js/ai/src/contracts/result/supervisor-result.type.d.ts
7
7
  /**
@@ -24,7 +24,7 @@ type SupervisorTerminatedBy = "router" | "route" | "classifier" | "evaluate" | "
24
24
  * on {@link BaseReport.children}, which duplicates nothing: it's the
25
25
  * reports of the child agents/workflows dispatched across iterations.
26
26
  */
27
- type SupervisorReport = BaseReport & {
27
+ type SupervisorReport = Omit<BaseReport, "type"> & {
28
28
  supervisorName: string; /** Structural fingerprint — same value exposed on the instance. */
29
29
  signature: string;
30
30
  terminatedBy: SupervisorTerminatedBy; /** How many iterations ran (including the terminal one). */
@@ -1 +1 @@
1
- {"version":3,"file":"supervisor-result.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/supervisor-result.type.ts"],"mappings":";;;;;;;;AAWA;;;;KAAY,sBAAA;AAsBZ;;;;;;;;;;;;;AAAA,KAAY,gBAAA,GAAmB,UAAA;EAC7B,cAAA,UAKA;EAHA,SAAA;EACA,YAAA,EAAc,sBAAA,EAKH;EAHX,UAAA,UAUM;EARN,WAAA;EACA,SAAA,EAAW,iBAAA;EAgBoB;AAAA;AA+BjC;;;;EAxCE,GAAA,GAAM,WAAA;EA4CE;;;;;;;;EAnCR,UAAA,GAAa,kBAAA;AAAA;;AAmCW;;;;;;;;;;;;;;;;;;;;;;;;;;;KAJd,gBAAA,sBAAsC,UAAA;wEAEhD,IAAA;EACA,IAAA,GAAO,OAAA;EACP,MAAA,EAAQ,gBAAA;AAAA"}
1
+ {"version":3,"file":"supervisor-result.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/supervisor-result.type.ts"],"mappings":";;;;;;;;AAWA;;;;KAAY,sBAAA;AAsBZ;;;;;;;;;;;;;AAAA,KAAY,gBAAA,GAAmB,IAAA,CAAK,UAAA;EAClC,cAAA,UAGA;EADA,SAAA;EACA,YAAA,EAAc,sBAAA,EAId;EAFA,UAAA,UAGW;EADX,WAAA;EACA,SAAA,EAAW,iBAAA;EAgBX;;;AAA+B;AA+BjC;;EAxCE,GAAA,GAAM,WAAA;EAwC0C;;;;;;;;EA/BhD,UAAA,GAAa,kBAAA;AAAA;;;;AAmCW;;;;;;;;;;;;;;;;;;;;;;;;;KAJd,gBAAA,sBAAsC,UAAA;wEAEhD,IAAA;EACA,IAAA,GAAO,OAAA;EACP,MAAA,EAAQ,gBAAA;AAAA"}
@@ -23,8 +23,8 @@ import { BaseReport } from "./base-report.type.mjs";
23
23
  * console.log(call.name, call.tripIndex, call.input, call.output);
24
24
  * }
25
25
  */
26
- type ToolCall = BaseReport & {
27
- /** Discriminator already fixed on BaseReport, narrowed to "tool" here. */type: "tool"; /** Which LLM trip triggered this tool call (0-indexed). */
26
+ type ToolCall = Omit<BaseReport, "type"> & {
27
+ /** Discriminator overridden to "tool" via `Omit<BaseReport, "type">`. */type: "tool"; /** Which LLM trip triggered this tool call (0-indexed). */
28
28
  tripIndex: number; /** Input passed to the tool (validated args from the model's request). */
29
29
  input: unknown; /** Output returned by the tool (undefined if an error occurred). */
30
30
  output?: unknown; /** Typed AI error thrown during dispatch (validation or execute), if any. */
@@ -1 +1 @@
1
- {"version":3,"file":"tool-call.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/tool-call.type.ts"],"mappings":";;;;;;AAwBA;;;;;;;;;;;;;AAmBe;;;;;;KAnBH,QAAA,GAAW,UAAA;4EAErB,IAAA;EAEA,SAAA;EAEA,KAAA;EAEA,MAAA;EAEA,KAAA,GAAQ,OAAO;;;;;;;;;EASf,aAAA;AAAA"}
1
+ {"version":3,"file":"tool-call.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/tool-call.type.ts"],"mappings":";;;;;;AAwBA;;;;;;;;;;;;;;;;;;AAmBe;KAnBH,QAAA,GAAW,IAAA,CAAK,UAAA;2EAE1B,IAAA;EAEA,SAAA;EAEA,KAAA;EAEA,MAAA;EAEA,KAAA,GAAQ,OAAA;;;;;;;;;EASR,aAAA;AAAA"}
@@ -31,6 +31,30 @@ type Usage = {
31
31
  * providers that don't report cache hits leave this undefined.
32
32
  */
33
33
  cachedTokens?: number;
34
+ /**
35
+ * Subset of `output` the provider attributes to internal reasoning /
36
+ * thinking before the visible answer (OpenAI reasoning models'
37
+ * `completion_tokens_details.reasoning_tokens`, Anthropic
38
+ * extended-thinking tokens). Counted within `output` for billing
39
+ * unless the provider prices it separately (see
40
+ * `ModelPricing.reasoning`). Optional — undefined when the provider
41
+ * doesn't report a reasoning channel.
42
+ *
43
+ * @example
44
+ * const usage: Usage = { input: 150, output: 320, total: 470, reasoningTokens: 180 };
45
+ */
46
+ reasoningTokens?: number;
47
+ /**
48
+ * Number of input tokens WRITTEN to the provider's prompt cache on
49
+ * this call (Anthropic `cache_creation_input_tokens`). Distinct from
50
+ * `cachedTokens`, which counts read hits. Bills at
51
+ * `ModelPricing.cachedOutput` when set. Optional — undefined for
52
+ * providers/calls with no cache write.
53
+ *
54
+ * @example
55
+ * const usage: Usage = { input: 150, output: 320, total: 470, cacheWriteTokens: 64 };
56
+ */
57
+ cacheWriteTokens?: number;
34
58
  /**
35
59
  * Cost breakdown in USD, computed at emit time from `tokens × pricing[model]`
36
60
  * when the model adapter declared a `ModelPricing`. Same shape as
@@ -1 +1 @@
1
- {"version":3,"file":"usage.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/usage.type.ts"],"mappings":";;;;;AAsBA;;;;;;;;;;;AAgCqB;;;;;;;KAhCT,KAAA;wEAEV,KAAA;EAEA,MAAA;EAEA,KAAA;;;;;;EAMA,YAAA;;;;;;;;;;;;;;;;;;;;EAoBA,IAAA,GAAO,YAAY;AAAA"}
1
+ {"version":3,"file":"usage.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/usage.type.ts"],"mappings":";;;;;AAsBA;;;;;;;;;;;;;AAwDqB;;;;;KAxDT,KAAA;wEAEV,KAAA;EAEA,MAAA;EAEA,KAAA;;;;;;EAMA,YAAA;;;;;;;;;;;;;EAaA,eAAA;;;;;;;;;;;EAWA,gBAAA;;;;;;;;;;;;;;;;;;;;EAoBA,IAAA,GAAO,YAAY;AAAA"}
@@ -14,7 +14,7 @@ import { StepSnapshot } from "./step-result.type.mjs";
14
14
  * structure — one entry per defined step — while `children` gives
15
15
  * the cross-cutting tree view shared with other primitives.
16
16
  */
17
- type WorkflowReport = BaseReport & {
17
+ type WorkflowReport = Omit<BaseReport, "type"> & {
18
18
  workflowName: string; /** Structural fingerprint — same value exposed on the workflow instance. */
19
19
  signature: string; /** ISO-8601 timestamp when cancellation was observed, if any. */
20
20
  cancelledAt?: string; /** Per-step snapshots keyed by step name. */
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-result.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/workflow-result.type.ts"],"mappings":";;;;;;;;AAeA;;;;;;;;KAAY,cAAA,GAAiB,UAAA;EAC3B,YAAA,UAD2B;EAG3B,SAAA;EAEA,WAAA,WAEA;EAAA,KAAA,EAAO,MAAA,SAAe,YAAA,GAAA;EAEtB,KAAA,EAAO,QAAA,CAAS,MAAA;AAAA;;;AAAM;AAgBxB;;;;;;;;;;KAAY,cAAA,sBAAoC,UAAA;EAC9C,IAAA;EACA,IAAA,GAAO,OAAA;EACP,MAAA,EAAQ,cAAA;EACR,KAAA,GAAQ,OAAA;AAAA"}
1
+ {"version":3,"file":"workflow-result.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/workflow-result.type.ts"],"mappings":";;;;;;;;AAeA;;;;;;;;KAAY,cAAA,GAAiB,IAAA,CAAK,UAAA;EAChC,YAAA,UAQe;EANf,SAAA,UAHgC;EAKhC,WAAA,WAFA;EAIA,KAAA,EAAO,MAAA,SAAe,YAAA,GAAtB;EAEA,KAAA,EAAO,QAAA,CAAS,MAAA;AAAA;;;;;AAAM;AAgBxB;;;;;;;;KAAY,cAAA,sBAAoC,UAAA;EAC9C,IAAA;EACA,IAAA,GAAO,OAAA;EACP,MAAA,EAAQ,cAAA;EACR,KAAA,GAAQ,OAAA;AAAA"}
@@ -1,6 +1,6 @@
1
1
  import { ModelPricing } from "./result/model-pricing.type.mjs";
2
- import { EmbedderConfig, EmbedderContract } from "./embedder.contract.mjs";
3
2
  import { ModelContract } from "./model.contract.mjs";
3
+ import { EmbedderConfig, EmbedderContract } from "./embedder.contract.mjs";
4
4
 
5
5
  //#region ../@warlock.js/ai/src/contracts/sdk-adapter.contract.d.ts
6
6
  /**
@@ -2,14 +2,14 @@ import { Message } from "../conversation-message.type.mjs";
2
2
  import { AgentResult } from "../result/agent-result.type.mjs";
3
3
  import { StreamContract } from "../stream/stream.contract.mjs";
4
4
  import { AgentContract } from "../agent/agent.contract.mjs";
5
+ import { SupervisorResult } from "../result/supervisor-result.type.mjs";
5
6
  import { WorkflowResult } from "../result/workflow-result.type.mjs";
6
7
  import { WorkflowInstance, WorkflowRunOptions } from "../workflow/workflow.contract.mjs";
7
- import { IterationSnapshot } from "./iteration-snapshot.type.mjs";
8
- import { SupervisorIntentValue } from "./intent-entry.type.mjs";
9
8
  import { SupervisorExecuteOptions } from "./supervisor-execute-options.type.mjs";
9
+ import { SupervisorIntentValue } from "./intent-entry.type.mjs";
10
10
  import { SupervisorContract } from "./supervisor.contract.mjs";
11
11
  import { ClassifierSnapshot } from "./classifier-context.type.mjs";
12
- import { SupervisorResult } from "../result/supervisor-result.type.mjs";
12
+ import { IterationSnapshot } from "./iteration-snapshot.type.mjs";
13
13
  import { AgentExecuteOptions } from "../agent/agent-options.type.mjs";
14
14
 
15
15
  //#region ../@warlock.js/ai/src/contracts/supervisor/dispatch-context.type.d.ts
@@ -1,9 +1,9 @@
1
1
  import { Message } from "../conversation-message.type.mjs";
2
2
  import { AIError } from "../../errors/ai-error.mjs";
3
3
  import { Usage } from "../result/usage.type.mjs";
4
- import { IterationSnapshot } from "./iteration-snapshot.type.mjs";
5
4
  import { SupervisorInput } from "./supervisor-input.type.mjs";
6
5
  import { ClassifierSnapshot } from "./classifier-context.type.mjs";
6
+ import { IterationSnapshot } from "./iteration-snapshot.type.mjs";
7
7
 
8
8
  //#region ../@warlock.js/ai/src/contracts/supervisor/evaluate-context.type.d.ts
9
9
  /**
@@ -1,16 +1,16 @@
1
1
  import { END, EndSentinel } from "../end.type.mjs";
2
- import { Next } from "./next.type.mjs";
3
- import { AckSnapshot, AgentBranchSnapshot, DecisionSource, IterationDecision, IterationSnapshot } from "./iteration-snapshot.type.mjs";
4
2
  import { SupervisorInput } from "./supervisor-input.type.mjs";
5
- import { EvaluateBranchResult, EvaluateContext, EvaluateResult } from "./evaluate-context.type.mjs";
3
+ import { SupervisorSnapshot, SupervisorSnapshotStatus } from "./supervisor-snapshot.type.mjs";
4
+ import { SupervisorExecuteOptions, SupervisorResumeOptions } from "./supervisor-execute-options.type.mjs";
6
5
  import { RouteContext } from "./route-context.type.mjs";
7
6
  import { AckCallback, AckConfig, AckEntry, AckRunEntry } from "./ack-entry.type.mjs";
8
7
  import { DispatchRawResult, IntentCallback, IntentEntry, IntentRunEntry, SupervisorIntentValue } from "./intent-entry.type.mjs";
8
+ import { Next } from "./next.type.mjs";
9
9
  import { RouterEntry } from "./router-entry.type.mjs";
10
10
  import { SupervisorConfig, SupervisorEventHandler, SupervisorEventHandlers } from "./supervisor-config.type.mjs";
11
- import { SupervisorExecuteOptions, SupervisorResumeOptions } from "./supervisor-execute-options.type.mjs";
12
11
  import { SupervisorStreamEvent } from "./supervisor-stream-event.type.mjs";
13
12
  import { SupervisorAsToolOptions, SupervisorContract } from "./supervisor.contract.mjs";
14
13
  import { DispatchContext, IntentRunner, IntentRunnerMap } from "./dispatch-context.type.mjs";
15
14
  import { ClassifierAgentEntry, ClassifierCallback, ClassifierConfig, ClassifierContext, ClassifierOutput, ClassifierRefineContext, ClassifierRefineResult, ClassifierRunEntry, ClassifierSnapshot } from "./classifier-context.type.mjs";
16
- import { SupervisorSnapshot, SupervisorSnapshotStatus } from "./supervisor-snapshot.type.mjs";
15
+ import { EvaluateBranchResult, EvaluateContext, EvaluateResult } from "./evaluate-context.type.mjs";
16
+ import { AckSnapshot, AgentBranchSnapshot, DecisionSource, IterationDecision, IterationSnapshot } from "./iteration-snapshot.type.mjs";
@@ -1,8 +1,8 @@
1
1
  import { Message } from "../conversation-message.type.mjs";
2
- import { IterationSnapshot } from "./iteration-snapshot.type.mjs";
3
2
  import { SupervisorInput } from "./supervisor-input.type.mjs";
4
- import { EvaluateResult } from "./evaluate-context.type.mjs";
5
3
  import { ClassifierSnapshot } from "./classifier-context.type.mjs";
4
+ import { EvaluateResult } from "./evaluate-context.type.mjs";
5
+ import { IterationSnapshot } from "./iteration-snapshot.type.mjs";
6
6
 
7
7
  //#region ../@warlock.js/ai/src/contracts/supervisor/route-context.type.d.ts
8
8
  /**