@warlock.js/ai 4.2.11 → 4.3.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 (427) hide show
  1. package/CHANGELOG.md +61 -1
  2. package/cjs/index.cjs +10151 -4625
  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 +82 -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 +139 -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 +1 -1
  119. package/esm/contracts/result/usage.type.d.mts +24 -0
  120. package/esm/contracts/result/usage.type.d.mts.map +1 -1
  121. package/esm/contracts/sdk-adapter.contract.d.mts +1 -1
  122. package/esm/contracts/supervisor/dispatch-context.type.d.mts +3 -3
  123. package/esm/contracts/supervisor/evaluate-context.type.d.mts +1 -1
  124. package/esm/contracts/supervisor/index.d.mts +5 -5
  125. package/esm/contracts/supervisor/route-context.type.d.mts +2 -2
  126. package/esm/contracts/supervisor/supervisor-config.type.d.mts +55 -13
  127. package/esm/contracts/supervisor/supervisor-config.type.d.mts.map +1 -1
  128. package/esm/contracts/supervisor/supervisor-snapshot.type.d.mts +1 -1
  129. package/esm/contracts/supervisor/supervisor.contract.d.mts +9 -2
  130. package/esm/contracts/supervisor/supervisor.contract.d.mts.map +1 -1
  131. package/esm/contracts/workflow/index.d.mts +2 -2
  132. package/esm/contracts/workflow/workflow.contract.d.mts +28 -7
  133. package/esm/contracts/workflow/workflow.contract.d.mts.map +1 -1
  134. package/esm/errors/error-code.type.d.mts +1 -1
  135. package/esm/errors/index.d.mts +7 -0
  136. package/esm/errors/index.mjs +7 -0
  137. package/esm/errors/orchestrator-cancelled-error.d.mts +32 -0
  138. package/esm/errors/orchestrator-cancelled-error.d.mts.map +1 -0
  139. package/esm/errors/orchestrator-cancelled-error.mjs +31 -0
  140. package/esm/errors/orchestrator-cancelled-error.mjs.map +1 -0
  141. package/esm/errors/orchestrator-config-error.d.mts +26 -0
  142. package/esm/errors/orchestrator-config-error.d.mts.map +1 -0
  143. package/esm/errors/orchestrator-config-error.mjs +30 -0
  144. package/esm/errors/orchestrator-config-error.mjs.map +1 -0
  145. package/esm/errors/orchestrator-drift-error.d.mts +38 -0
  146. package/esm/errors/orchestrator-drift-error.d.mts.map +1 -0
  147. package/esm/errors/orchestrator-drift-error.mjs +37 -0
  148. package/esm/errors/orchestrator-drift-error.mjs.map +1 -0
  149. package/esm/errors/orchestrator-failed-error.d.mts +33 -0
  150. package/esm/errors/orchestrator-failed-error.d.mts.map +1 -0
  151. package/esm/errors/orchestrator-failed-error.mjs +36 -0
  152. package/esm/errors/orchestrator-failed-error.mjs.map +1 -0
  153. package/esm/errors/planner-cancelled-error.d.mts +33 -0
  154. package/esm/errors/planner-cancelled-error.d.mts.map +1 -0
  155. package/esm/errors/planner-cancelled-error.mjs +29 -0
  156. package/esm/errors/planner-cancelled-error.mjs.map +1 -0
  157. package/esm/errors/planner-failed-error.d.mts +40 -0
  158. package/esm/errors/planner-failed-error.d.mts.map +1 -0
  159. package/esm/errors/planner-failed-error.mjs +37 -0
  160. package/esm/errors/planner-failed-error.mjs.map +1 -0
  161. package/esm/errors/planner-plan-invalid-error.d.mts +21 -0
  162. package/esm/errors/planner-plan-invalid-error.d.mts.map +1 -0
  163. package/esm/errors/planner-plan-invalid-error.mjs +25 -0
  164. package/esm/errors/planner-plan-invalid-error.mjs.map +1 -0
  165. package/esm/eval/eval-runner.d.mts +17 -0
  166. package/esm/eval/eval-runner.d.mts.map +1 -0
  167. package/esm/eval/eval-runner.mjs +121 -0
  168. package/esm/eval/eval-runner.mjs.map +1 -0
  169. package/esm/eval/index.d.mts +29 -0
  170. package/esm/eval/index.d.mts.map +1 -0
  171. package/esm/eval/index.mjs +30 -0
  172. package/esm/eval/index.mjs.map +1 -0
  173. package/esm/eval/judge-scorer.d.mts +21 -0
  174. package/esm/eval/judge-scorer.d.mts.map +1 -0
  175. package/esm/eval/judge-scorer.mjs +87 -0
  176. package/esm/eval/judge-scorer.mjs.map +1 -0
  177. package/esm/eval/scorers.d.mts +50 -0
  178. package/esm/eval/scorers.d.mts.map +1 -0
  179. package/esm/eval/scorers.mjs +101 -0
  180. package/esm/eval/scorers.mjs.map +1 -0
  181. package/esm/index.d.mts +95 -30
  182. package/esm/index.mjs +66 -22
  183. package/esm/memory/derive-id.mjs +24 -0
  184. package/esm/memory/derive-id.mjs.map +1 -0
  185. package/esm/memory/episodic-memory.mjs +106 -0
  186. package/esm/memory/episodic-memory.mjs.map +1 -0
  187. package/esm/memory/index.d.mts +5 -0
  188. package/esm/memory/memory.d.mts +42 -0
  189. package/esm/memory/memory.d.mts.map +1 -0
  190. package/esm/memory/memory.mjs +166 -0
  191. package/esm/memory/memory.mjs.map +1 -0
  192. package/esm/memory/procedural-memory.mjs +103 -0
  193. package/esm/memory/procedural-memory.mjs.map +1 -0
  194. package/esm/memory/semantic-memory.mjs +80 -0
  195. package/esm/memory/semantic-memory.mjs.map +1 -0
  196. package/esm/memory/working-memory.mjs +62 -0
  197. package/esm/memory/working-memory.mjs.map +1 -0
  198. package/esm/middleware/builtins/budget-contract.type.d.mts +126 -0
  199. package/esm/middleware/builtins/budget-contract.type.d.mts.map +1 -0
  200. package/esm/middleware/builtins/budget.d.mts +71 -1
  201. package/esm/middleware/builtins/budget.d.mts.map +1 -1
  202. package/esm/middleware/builtins/budget.mjs +119 -4
  203. package/esm/middleware/builtins/budget.mjs.map +1 -1
  204. package/esm/middleware/builtins/semantic-cache.d.mts +1 -1
  205. package/esm/middleware/index.d.mts +2 -1
  206. package/esm/middleware/index.mjs +1 -1
  207. package/esm/middleware/pipeline.d.mts +9 -6
  208. package/esm/middleware/pipeline.d.mts.map +1 -1
  209. package/esm/middleware/pipeline.mjs.map +1 -1
  210. package/esm/mock/index.d.mts +1 -0
  211. package/esm/mock/index.mjs +1 -0
  212. package/esm/mock/mock-router.d.mts +63 -0
  213. package/esm/mock/mock-router.d.mts.map +1 -0
  214. package/esm/mock/mock-router.mjs +58 -0
  215. package/esm/mock/mock-router.mjs.map +1 -0
  216. package/esm/model/fallback-model.d.mts +45 -0
  217. package/esm/model/fallback-model.d.mts.map +1 -0
  218. package/esm/model/fallback-model.mjs +218 -0
  219. package/esm/model/fallback-model.mjs.map +1 -0
  220. package/esm/model/index.d.mts +2 -0
  221. package/esm/model/index.mjs +3 -0
  222. package/esm/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +78 -0
  223. package/esm/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +1 -0
  224. package/esm/node_modules/@vitest/expect/dist/index.mjs +1473 -0
  225. package/esm/node_modules/@vitest/expect/dist/index.mjs.map +1 -0
  226. package/esm/node_modules/@vitest/pretty-format/dist/index.mjs +888 -0
  227. package/esm/node_modules/@vitest/pretty-format/dist/index.mjs.map +1 -0
  228. package/esm/node_modules/@vitest/runner/dist/chunk-artifact.mjs +1533 -0
  229. package/esm/node_modules/@vitest/runner/dist/chunk-artifact.mjs.map +1 -0
  230. package/esm/node_modules/@vitest/runner/dist/index.mjs +3 -0
  231. package/esm/node_modules/@vitest/runner/dist/utils.mjs +3 -0
  232. package/esm/node_modules/@vitest/snapshot/dist/index.mjs +922 -0
  233. package/esm/node_modules/@vitest/snapshot/dist/index.mjs.map +1 -0
  234. package/esm/node_modules/@vitest/spy/dist/index.mjs +386 -0
  235. package/esm/node_modules/@vitest/spy/dist/index.mjs.map +1 -0
  236. package/esm/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs +82 -0
  237. package/esm/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs.map +1 -0
  238. package/esm/node_modules/@vitest/utils/dist/diff.mjs +1357 -0
  239. package/esm/node_modules/@vitest/utils/dist/diff.mjs.map +1 -0
  240. package/esm/node_modules/@vitest/utils/dist/display.mjs +559 -0
  241. package/esm/node_modules/@vitest/utils/dist/display.mjs.map +1 -0
  242. package/esm/node_modules/@vitest/utils/dist/error.mjs +38 -0
  243. package/esm/node_modules/@vitest/utils/dist/error.mjs.map +1 -0
  244. package/esm/node_modules/@vitest/utils/dist/helpers.mjs +181 -0
  245. package/esm/node_modules/@vitest/utils/dist/helpers.mjs.map +1 -0
  246. package/esm/node_modules/@vitest/utils/dist/offset.mjs +27 -0
  247. package/esm/node_modules/@vitest/utils/dist/offset.mjs.map +1 -0
  248. package/esm/node_modules/@vitest/utils/dist/serialize.mjs +77 -0
  249. package/esm/node_modules/@vitest/utils/dist/serialize.mjs.map +1 -0
  250. package/esm/node_modules/@vitest/utils/dist/source-map.mjs +374 -0
  251. package/esm/node_modules/@vitest/utils/dist/source-map.mjs.map +1 -0
  252. package/esm/node_modules/@vitest/utils/dist/timers.mjs +37 -0
  253. package/esm/node_modules/@vitest/utils/dist/timers.mjs.map +1 -0
  254. package/esm/node_modules/chai/index.mjs +2973 -0
  255. package/esm/node_modules/chai/index.mjs.map +1 -0
  256. package/esm/node_modules/magic-string/dist/magic-string.es.mjs +940 -0
  257. package/esm/node_modules/magic-string/dist/magic-string.es.mjs.map +1 -0
  258. package/esm/node_modules/tinyrainbow/dist/index.mjs +87 -0
  259. package/esm/node_modules/tinyrainbow/dist/index.mjs.map +1 -0
  260. package/esm/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs +6 -0
  261. package/esm/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs.map +1 -0
  262. package/esm/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs +52 -0
  263. package/esm/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs.map +1 -0
  264. package/esm/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs +2697 -0
  265. package/esm/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs.map +1 -0
  266. package/esm/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs +45 -0
  267. package/esm/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs.map +1 -0
  268. package/esm/orchestrator/as-tool.d.mts +42 -0
  269. package/esm/orchestrator/as-tool.d.mts.map +1 -0
  270. package/esm/orchestrator/as-tool.mjs +98 -0
  271. package/esm/orchestrator/as-tool.mjs.map +1 -0
  272. package/esm/orchestrator/checkpoint.mjs +75 -0
  273. package/esm/orchestrator/checkpoint.mjs.map +1 -0
  274. package/esm/orchestrator/commands.d.mts +38 -0
  275. package/esm/orchestrator/commands.d.mts.map +1 -0
  276. package/esm/orchestrator/commands.mjs +34 -0
  277. package/esm/orchestrator/commands.mjs.map +1 -0
  278. package/esm/orchestrator/compaction.mjs +206 -0
  279. package/esm/orchestrator/compaction.mjs.map +1 -0
  280. package/esm/orchestrator/dispatch.mjs +171 -0
  281. package/esm/orchestrator/dispatch.mjs.map +1 -0
  282. package/esm/orchestrator/emitter-port.type.d.mts +31 -0
  283. package/esm/orchestrator/emitter-port.type.d.mts.map +1 -0
  284. package/esm/orchestrator/emitter.d.mts +56 -0
  285. package/esm/orchestrator/emitter.d.mts.map +1 -0
  286. package/esm/orchestrator/emitter.mjs +85 -0
  287. package/esm/orchestrator/emitter.mjs.map +1 -0
  288. package/esm/orchestrator/engine-context.type.d.mts +56 -0
  289. package/esm/orchestrator/engine-context.type.d.mts.map +1 -0
  290. package/esm/orchestrator/execution.d.mts +116 -0
  291. package/esm/orchestrator/execution.d.mts.map +1 -0
  292. package/esm/orchestrator/execution.mjs +406 -0
  293. package/esm/orchestrator/execution.mjs.map +1 -0
  294. package/esm/orchestrator/index.d.mts +8 -0
  295. package/esm/orchestrator/index.mjs +10 -0
  296. package/esm/orchestrator/load.mjs +49 -0
  297. package/esm/orchestrator/load.mjs.map +1 -0
  298. package/esm/orchestrator/lock.mjs +75 -0
  299. package/esm/orchestrator/lock.mjs.map +1 -0
  300. package/esm/orchestrator/memory.d.mts +84 -0
  301. package/esm/orchestrator/memory.d.mts.map +1 -0
  302. package/esm/orchestrator/memory.mjs +141 -0
  303. package/esm/orchestrator/memory.mjs.map +1 -0
  304. package/esm/orchestrator/orchestrator-stream.d.mts +42 -0
  305. package/esm/orchestrator/orchestrator-stream.d.mts.map +1 -0
  306. package/esm/orchestrator/orchestrator-stream.mjs +98 -0
  307. package/esm/orchestrator/orchestrator-stream.mjs.map +1 -0
  308. package/esm/orchestrator/orchestrator.d.mts +38 -0
  309. package/esm/orchestrator/orchestrator.d.mts.map +1 -0
  310. package/esm/orchestrator/orchestrator.mjs +173 -0
  311. package/esm/orchestrator/orchestrator.mjs.map +1 -0
  312. package/esm/orchestrator/resume.mjs +74 -0
  313. package/esm/orchestrator/resume.mjs.map +1 -0
  314. package/esm/orchestrator/signature.d.mts +40 -0
  315. package/esm/orchestrator/signature.d.mts.map +1 -0
  316. package/esm/orchestrator/signature.mjs +120 -0
  317. package/esm/orchestrator/signature.mjs.map +1 -0
  318. package/esm/orchestrator/window.mjs +56 -0
  319. package/esm/orchestrator/window.mjs.map +1 -0
  320. package/esm/planner/index.d.mts +5 -0
  321. package/esm/planner/index.mjs +6 -0
  322. package/esm/planner/plan-prompt.d.mts +17 -0
  323. package/esm/planner/plan-prompt.d.mts.map +1 -0
  324. package/esm/planner/plan-prompt.mjs +30 -0
  325. package/esm/planner/plan-prompt.mjs.map +1 -0
  326. package/esm/planner/plan-schema.d.mts +27 -0
  327. package/esm/planner/plan-schema.d.mts.map +1 -0
  328. package/esm/planner/plan-schema.mjs +117 -0
  329. package/esm/planner/plan-schema.mjs.map +1 -0
  330. package/esm/planner/planner-run.d.mts +23 -0
  331. package/esm/planner/planner-run.d.mts.map +1 -0
  332. package/esm/planner/planner-run.mjs +344 -0
  333. package/esm/planner/planner-run.mjs.map +1 -0
  334. package/esm/planner/planner.d.mts +37 -0
  335. package/esm/planner/planner.d.mts.map +1 -0
  336. package/esm/planner/planner.mjs +120 -0
  337. package/esm/planner/planner.mjs.map +1 -0
  338. package/esm/planner/signature.d.mts +18 -0
  339. package/esm/planner/signature.d.mts.map +1 -0
  340. package/esm/planner/signature.mjs +27 -0
  341. package/esm/planner/signature.mjs.map +1 -0
  342. package/esm/snapshot/index.d.mts +3 -0
  343. package/esm/snapshot/memory.d.mts +26 -0
  344. package/esm/snapshot/memory.d.mts.map +1 -0
  345. package/esm/snapshot/memory.mjs +81 -0
  346. package/esm/snapshot/memory.mjs.map +1 -0
  347. package/esm/snapshot/pg.d.mts +41 -0
  348. package/esm/snapshot/pg.d.mts.map +1 -0
  349. package/esm/snapshot/pg.mjs +146 -0
  350. package/esm/snapshot/pg.mjs.map +1 -0
  351. package/esm/snapshot/redis.d.mts +42 -0
  352. package/esm/snapshot/redis.d.mts.map +1 -0
  353. package/esm/snapshot/redis.mjs +101 -0
  354. package/esm/snapshot/redis.mjs.map +1 -0
  355. package/esm/supervisor/as-tool.d.mts +0 -6
  356. package/esm/supervisor/as-tool.d.mts.map +1 -1
  357. package/esm/supervisor/as-tool.mjs +0 -6
  358. package/esm/supervisor/as-tool.mjs.map +1 -1
  359. package/esm/supervisor/execution.d.mts +43 -8
  360. package/esm/supervisor/execution.d.mts.map +1 -1
  361. package/esm/supervisor/execution.mjs +66 -16
  362. package/esm/supervisor/execution.mjs.map +1 -1
  363. package/esm/supervisor/fan-out.d.mts +65 -0
  364. package/esm/supervisor/fan-out.d.mts.map +1 -0
  365. package/esm/supervisor/fan-out.mjs +65 -0
  366. package/esm/supervisor/fan-out.mjs.map +1 -0
  367. package/esm/supervisor/index.d.mts +5 -3
  368. package/esm/supervisor/index.mjs +3 -1
  369. package/esm/supervisor/router-factory.d.mts +110 -0
  370. package/esm/supervisor/router-factory.d.mts.map +1 -0
  371. package/esm/supervisor/router-factory.mjs +141 -0
  372. package/esm/supervisor/router-factory.mjs.map +1 -0
  373. package/esm/supervisor/router-prompt.d.mts +1 -1
  374. package/esm/supervisor/snapshot.d.mts +4 -10
  375. package/esm/supervisor/snapshot.d.mts.map +1 -1
  376. package/esm/supervisor/snapshot.mjs +8 -16
  377. package/esm/supervisor/snapshot.mjs.map +1 -1
  378. package/esm/supervisor/supervisor.mjs +1 -0
  379. package/esm/supervisor/supervisor.mjs.map +1 -1
  380. package/esm/system-prompt/index.mjs +6 -0
  381. package/esm/system-prompt/system-prompt.d.mts +51 -3
  382. package/esm/system-prompt/system-prompt.d.mts.map +1 -1
  383. package/esm/system-prompt/system-prompt.mjs +52 -6
  384. package/esm/system-prompt/system-prompt.mjs.map +1 -1
  385. package/esm/testing/matcher-logic.d.mts +76 -0
  386. package/esm/testing/matcher-logic.d.mts.map +1 -0
  387. package/esm/testing/matcher-logic.mjs +144 -0
  388. package/esm/testing/matcher-logic.mjs.map +1 -0
  389. package/esm/testing/matchers.d.mts +48 -0
  390. package/esm/testing/matchers.d.mts.map +1 -0
  391. package/esm/testing/matchers.mjs +37 -0
  392. package/esm/testing/matchers.mjs.map +1 -0
  393. package/esm/testing/register-lazy.d.mts +20 -0
  394. package/esm/testing/register-lazy.d.mts.map +1 -0
  395. package/esm/testing/register-lazy.mjs +24 -0
  396. package/esm/testing/register-lazy.mjs.map +1 -0
  397. package/esm/tool/executable-as-tool.d.mts +87 -0
  398. package/esm/tool/executable-as-tool.d.mts.map +1 -0
  399. package/esm/tool/executable-as-tool.mjs +81 -0
  400. package/esm/tool/executable-as-tool.mjs.map +1 -0
  401. package/esm/tool/index.d.mts +2 -1
  402. package/esm/tool/index.mjs +1 -0
  403. package/esm/workflow/as-tool.mjs +0 -6
  404. package/esm/workflow/as-tool.mjs.map +1 -1
  405. package/esm/workflow/engine.mjs +2 -2
  406. package/esm/workflow/snapshot.mjs +13 -7
  407. package/esm/workflow/snapshot.mjs.map +1 -1
  408. package/esm/workflow/step-runner.mjs +1 -1
  409. package/esm/workflow/workflow.mjs +1 -0
  410. package/esm/workflow/workflow.mjs.map +1 -1
  411. package/llms-full.txt +947 -42
  412. package/llms.txt +13 -8
  413. package/package.json +3 -3
  414. package/skills/README.md +25 -5
  415. package/skills/ai-basics/SKILL.md +18 -7
  416. package/skills/ai-dx-helpers/SKILL.md +180 -0
  417. package/skills/attach-ai-middleware/SKILL.md +32 -3
  418. package/skills/handle-ai-errors/SKILL.md +20 -6
  419. package/skills/manage-ai-stores/SKILL.md +127 -0
  420. package/skills/persist-ai-data/SKILL.md +21 -10
  421. package/skills/pick-ai-provider/SKILL.md +46 -12
  422. package/skills/run-ai-agent/SKILL.md +51 -2
  423. package/skills/run-orchestrator/SKILL.md +198 -0
  424. package/skills/run-planner/SKILL.md +68 -0
  425. package/skills/run-supervisor/SKILL.md +47 -2
  426. package/skills/use-ai-memory/SKILL.md +124 -0
  427. package/skills/write-system-prompt/SKILL.md +14 -1
@@ -1 +1 @@
1
- {"version":3,"file":"supervisor.contract.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/supervisor/supervisor.contract.ts"],"mappings":";;;;;;;;;;;;;;AAwBA;;;;;;;;KAAY,uBAAA;EACV,IAAA;EACA,WAAA;EACA,WAAA,EAAa,gBAAgB,CAAC,UAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA2Cf,kBAAA,4BAA8C,kBAAA,CAC7D,eAAA,EACA,wBAAA,EACA,gBAAA,CAAiB,OAAA;EAAjB;EAAA,SAGS,IAAA;EAAA;;;;;;EAAA,SAQA,SAAA;EAWN;;;;;;EAHH,OAAA,CACE,KAAA,EAAO,eAAA,EACP,OAAA,GAAU,wBAAA,GACT,OAAA,CAAQ,gBAAA,CAAiB,OAAA;EAW1B;;;;;;;EAFF,MAAA,CACE,KAAA,EAAO,eAAA,EACP,OAAA,GAAU,wBAAA,GACT,cAAA,CAAe,gBAAA,CAAiB,OAAA,GAAU,qBAAA;EAWvB;;;;;;;;;EAAtB,MAAA,CAAO,KAAA,UAAe,OAAA,GAAU,uBAAA,GAA0B,OAAA,CAAQ,gBAAA,CAAiB,OAAA;EAQF;;;;;;EAAjF,EAAA,iBAAmB,kBAAA,EAAoB,KAAA,EAAO,CAAA,EAAG,OAAA,EAAS,sBAAA,CAAuB,CAAA;EAMtB;;;;EAA3D,GAAA,iBAAoB,kBAAA,EAAoB,KAAA,EAAO,CAAA,EAAG,OAAA,EAAS,sBAAA,CAAuB,CAAA;EAUvE;;;;;;;EADX,MAAA,sBACE,OAAA,EAAS,uBAAA,CAAwB,UAAA,IAChC,YAAA,CAAa,UAAA,EAAY,OAAA;AAAA"}
1
+ {"version":3,"file":"supervisor.contract.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/supervisor/supervisor.contract.ts"],"mappings":";;;;;;;;;;;;;;AAwBA;;;;;;;;KAAY,uBAAA;EACV,IAAA;EACA,WAAA;EACA,WAAA,EAAa,gBAAgB,CAAC,UAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA2Cf,kBAAA,4BAA8C,kBAAA,CAC7D,eAAA,EACA,wBAAA,EACA,gBAAA,CAAiB,OAAA;EAFjB;EAAA,SAKS,IAAA;EAHT;;;;;;EAAA,SAWS,WAAA,GAAc,gBAAA,CAAiB,eAAA;EAgBxC;;;;;;EAAA,SARS,SAAA;EAWmB;;;;;;EAH5B,OAAA,CACE,KAAA,EAAO,eAAA,EACP,OAAA,GAAU,wBAAA,GACT,OAAA,CAAQ,gBAAA,CAAiB,OAAA;EAYV;;;;;;;EAHlB,MAAA,CACE,KAAA,EAAO,eAAA,EACP,OAAA,GAAU,wBAAA,GACT,cAAA,CAAe,gBAAA,CAAiB,OAAA,GAAU,qBAAA;EAWqB;;;;;;;;;EAAlE,MAAA,CAAO,KAAA,UAAe,OAAA,GAAU,uBAAA,GAA0B,OAAA,CAAQ,gBAAA,CAAiB,OAAA;EAcnF;;;;;;EANA,EAAA,iBAAmB,kBAAA,EAAoB,KAAA,EAAO,CAAA,EAAG,OAAA,EAAS,sBAAA,CAAuB,CAAA;EAM/B;;;;EAAlD,GAAA,iBAAoB,kBAAA,EAAoB,KAAA,EAAO,CAAA,EAAG,OAAA,EAAS,sBAAA,CAAuB,CAAA;EAUhF;;;;;AACiC;;EAFnC,MAAA,sBACE,OAAA,EAAS,uBAAA,CAAwB,UAAA,IAChC,YAAA,CAAa,UAAA,EAAY,OAAA;AAAA"}
@@ -2,5 +2,5 @@ import { NextStepResult } from "./next-step-result.type.mjs";
2
2
  import { RetryBackoff, RetryConfig } from "./retry-config.type.mjs";
3
3
  import { WorkflowContext } from "./workflow-context.type.mjs";
4
4
  import { StepAgentInput, StepDefinition, StepLocalEvents, StepOutputSpec } from "./step.contract.mjs";
5
- import { WorkflowDefinition, WorkflowEventHandler, WorkflowEventHandlers, WorkflowExecuteOptions, WorkflowInstance, WorkflowResumeOptions, WorkflowRunOptions } from "./workflow.contract.mjs";
6
- import { WorkflowSnapshot } from "./workflow-snapshot.type.mjs";
5
+ import { WorkflowSnapshot } from "./workflow-snapshot.type.mjs";
6
+ import { WorkflowDefinition, WorkflowEventHandler, WorkflowEventHandlers, WorkflowExecuteOptions, WorkflowInstance, WorkflowResumeOptions, WorkflowRunOptions } from "./workflow.contract.mjs";
@@ -1,13 +1,14 @@
1
1
  import { ExecutableContract } from "../executable.contract.mjs";
2
2
  import { WorkflowResult } from "../result/workflow-result.type.mjs";
3
3
  import { ToolContract } from "../../tool/tool.mjs";
4
+ import { SnapshotStore } from "../orchestrator/snapshot-store.contract.mjs";
4
5
  import { NextStepResult } from "./next-step-result.type.mjs";
5
6
  import { RetryConfig } from "./retry-config.type.mjs";
6
7
  import { WorkflowContext } from "./workflow-context.type.mjs";
7
8
  import { StepDefinition, StepOutputSpec } from "./step.contract.mjs";
9
+ import { WorkflowSnapshot } from "./workflow-snapshot.type.mjs";
8
10
  import { WorkflowEventMap } from "../events/event-map.type.mjs";
9
11
  import { StandardSchemaV1 } from "@standard-schema/spec";
10
- import { CacheDriver } from "@warlock.js/cache";
11
12
 
12
13
  //#region ../@warlock.js/ai/src/contracts/workflow/workflow.contract.d.ts
13
14
  type WorkflowEventHandler<K extends keyof WorkflowEventMap> = (payload: WorkflowEventMap[K]) => void;
@@ -58,18 +59,31 @@ type WorkflowDefinition<TInput = unknown, TOutput = unknown, TState = Record<str
58
59
  * the default tool description.
59
60
  */
60
61
  description?: string;
62
+ /**
63
+ * Opt-in Standard Schema describing this workflow's input. Purely
64
+ * additive — when set, the workflow can be dropped straight into an
65
+ * agent's `tools: []` array WITHOUT calling `.asTool()`: the runtime
66
+ * derives the LLM tool manifest from `name` + `description` + this
67
+ * schema and dispatches through `execute()`. Omit it and `.asTool()`
68
+ * (which takes its own `inputSchema`) remains the way to expose the
69
+ * workflow as a tool. Never validated by the workflow engine itself —
70
+ * step inputs are still each step's responsibility.
71
+ */
72
+ inputSchema?: StandardSchemaV1<TInput>;
61
73
  version?: string;
62
74
  steps: StepDefinition<TInput, TState, TContext>[];
63
75
  /**
64
- * Optional durable store enabling `workflow.resume(runId)`. Accepts
65
- * any `@warlock.js/cache` driver — `MemoryCacheDriver` for
66
- * dev/tests, `RedisCacheDriver` / `PgCacheDriver` for production.
76
+ * Optional durable {@link SnapshotStore} enabling
77
+ * `workflow.resume(runId)`. Construct with
78
+ * `ai.snapshot.{memory,pg,redis}()` `ai.snapshot.memory()` for
79
+ * dev/tests, `ai.snapshot.redis()` / `ai.snapshot.pg()` for
80
+ * production.
67
81
  *
68
- * Falls back to `ai.config({ defaultStore })` when omitted. When
69
- * neither is set, `resume()` throws and snapshot writes silently
82
+ * Falls back to `ai.config({ defaultSnapshotStore })` when omitted.
83
+ * When neither is set, `resume()` throws and snapshot writes silently
70
84
  * skip (current behavior preserved).
71
85
  */
72
- snapshotStore?: CacheDriver<any, any>;
86
+ snapshotStore?: SnapshotStore<WorkflowSnapshot>;
73
87
  /**
74
88
  * Default retry applied to every step that doesn't supply its own
75
89
  * `retry`. `undefined` (omitted) means "no retry" — resolves to
@@ -95,6 +109,13 @@ type WorkflowDefinition<TInput = unknown, TOutput = unknown, TState = Record<str
95
109
  interface WorkflowInstance<TInput = unknown, TOutput = unknown, TState = Record<string, unknown>, TContext = unknown> extends ExecutableContract<TInput, WorkflowRunOptions<TContext>, WorkflowResult<TOutput>> {
96
110
  readonly name: string;
97
111
  readonly description?: string;
112
+ /**
113
+ * Mirrors {@link WorkflowDefinition.inputSchema} when set — lets the
114
+ * agent tool-collection path auto-adapt this workflow into a
115
+ * `ToolContract` (manifest derived from name + description + this
116
+ * schema) when it appears in `tools: []` without `.asTool()`.
117
+ */
118
+ readonly inputSchema?: StandardSchemaV1<TInput>;
98
119
  readonly signature: string;
99
120
  readonly version?: string;
100
121
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.contract.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/workflow/workflow.contract.ts"],"mappings":";;;;;;;;;;;;KAWY,oBAAA,iBAAqC,gBAAA,KAC/C,OAAA,EAAS,gBAAA,CAAiB,CAAA;AAAA,KAGhB,qBAAA,GAAwB,OAAA,eACtB,gBAAA,GAAmB,oBAAA,CAAqB,CAAA;;;;;KAO1C,kBAAA;EAXiB,sEAa3B,KAAA,WAd+C;EAgB/C,MAAA,GAAS,WAAA,EAfiB;EAiB1B,EAAA,GAAK,qBAAA;EAjBuB;AAAA;AAG9B;;;;;EAsBE,OAAA,GAAU,QAAA;EAtBwB;;;;;;;EA8BlC,SAAA;AAAA;AA7BqD;AAOvD;;;;AAPuD,KAqC3C,sBAAA,yCAGR,kBAAA,CAAmB,QAAA;EACrB,KAAA,EAAO,MAAA;AAAA;AAAA,KAGG,qBAAA,uBACV,kBAAkB,CAAC,QAAA;EAtCU;;EAyC3B,KAAA;AAAA;AAAA,KAGQ,kBAAA,+CAGD,MAAA;EAGT,IAAA;EApCA;;;;AAQS;EAkCT,WAAA;EACA,OAAA;EACA,KAAA,EAAO,cAAA,CAAe,MAAA,EAAQ,MAAA,EAAQ,QAAA;EAzBjB;;;;;;;;;EAmCrB,aAAA,GAAgB,WAAA;EAlCT;;AAAM;AAGf;;;;;;EAyCE,YAAA,GAAe,WAAA;EACf,QAAA;EACA,aAAA;EACA,QAAA,IACE,QAAA,UACA,GAAA,EAAK,eAAA,CAAgB,MAAA,EAAQ,MAAA,EAAQ,QAAA,MAClC,cAAA,GAAiB,OAAA,CAAQ,cAAA;EAC9B,MAAA,GAAS,cAAA,CAAe,OAAA,EAAS,MAAA,EAAQ,MAAA,EAAQ,QAAA;EACjD,EAAA,GAAK,qBAAA;AAAA;;;;;;;UASU,gBAAA,+CAGN,MAAA,+CAED,kBAAA,CACR,MAAA,EACA,kBAAA,CAAmB,QAAA,GACnB,cAAA,CAAe,OAAA;EAAA,SAEN,IAAA;EAAA,SACA,WAAA;EAAA,SACA,SAAA;EAAA,SACA,OAAA;EAxBJ;;;;;;;;;;;;;;EAwCL,OAAA,CACE,KAAA,EAAO,MAAA,EACP,OAAA,GAAU,kBAAA,CAAmB,QAAA,IAC5B,OAAA,CAAQ,cAAA,CAAe,OAAA;EAC1B,OAAA,CACE,OAAA,EAAS,sBAAA,CAAuB,MAAA,EAAQ,QAAA,IACvC,OAAA,CAAQ,cAAA,CAAe,OAAA;EAE1B,MAAA,CACE,KAAA,UACA,OAAA,GAAU,qBAAA,CAAsB,QAAA,IAC/B,OAAA,CAAQ,cAAA,CAAe,OAAA;EAE1B,EAAA,iBAAmB,gBAAA,EAAkB,KAAA,EAAO,CAAA,EAAG,OAAA,EAAS,oBAAA,CAAqB,CAAA;EAC7E,GAAA,iBAAoB,gBAAA,EAAkB,KAAA,EAAO,CAAA,EAAG,OAAA,EAAS,oBAAA,CAAqB,CAAA;EAhF9E;;;;;;;;;;;;;;;;EAkGA,MAAA,cAAoB,MAAA,EAAQ,OAAA;IAC1B,WAAA;IACA,WAAA,EAAa,gBAAA,CAAiB,UAAA;EAAA,IAC5B,YAAA,CAAa,UAAA,EAAY,OAAA;AAAA"}
1
+ {"version":3,"file":"workflow.contract.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/workflow/workflow.contract.ts"],"mappings":";;;;;;;;;;;;;KAYY,oBAAA,iBAAqC,gBAAA,KAC/C,OAAA,EAAS,gBAAA,CAAiB,CAAA;AAAA,KAGhB,qBAAA,GAAwB,OAAA,eACtB,gBAAA,GAAmB,oBAAA,CAAqB,CAAA;;;;;KAO1C,kBAAA;EAXiB,sEAa3B,KAAA,WAd+C;EAgB/C,MAAA,GAAS,WAAA,EAfiB;EAiB1B,EAAA,GAAK,qBAAA;EAjBuB;AAAA;AAG9B;;;;;EAsBE,OAAA,GAAU,QAAA;EAtBwB;;;;;;;EA8BlC,SAAA;AAAA;AA7BqD;AAOvD;;;;AAPuD,KAqC3C,sBAAA,yCAGR,kBAAA,CAAmB,QAAA;EACrB,KAAA,EAAO,MAAA;AAAA;AAAA,KAGG,qBAAA,uBACV,kBAAkB,CAAC,QAAA;EAtCU;;EAyC3B,KAAA;AAAA;AAAA,KAGQ,kBAAA,+CAGD,MAAA;EAGT,IAAA;EApCA;;;;AAQS;EAkCT,WAAA;EA1BgC;;;;;;;;;;EAqChC,WAAA,GAAc,gBAAA,CAAiB,MAAA;EAC/B,OAAA;EACA,KAAA,EAAO,cAAA,CAAe,MAAA,EAAQ,MAAA,EAAQ,QAAA;EAnCzB;AAAA;AAGf;;;;;;;;;EA4CE,aAAA,GAAgB,aAAA,CAAc,gBAAA;EArCpB;;;;;;;;;EA+CV,YAAA,GAAe,WAAA;EACf,QAAA;EACA,aAAA;EACA,QAAA,IACE,QAAA,UACA,GAAA,EAAK,eAAA,CAAgB,MAAA,EAAQ,MAAA,EAAQ,QAAA,MAClC,cAAA,GAAiB,OAAA,CAAQ,cAAA;EAC9B,MAAA,GAAS,cAAA,CAAe,OAAA,EAAS,MAAA,EAAQ,MAAA,EAAQ,QAAA;EACjD,EAAA,GAAK,qBAAA;AAAA;;;;;;;UASU,gBAAA,+CAGN,MAAA,+CAED,kBAAA,CACR,MAAA,EACA,kBAAA,CAAmB,QAAA,GACnB,cAAA,CAAe,OAAA;EAAA,SAEN,IAAA;EAAA,SACA,WAAA;EApBJ;;;;;;EAAA,SA2BI,WAAA,GAAc,gBAAA,CAAiB,MAAA;EAAA,SAC/B,SAAA;EAAA,SACA,OAAA;EAxET;;;;;;;;;;;;;;EAwFA,OAAA,CACE,KAAA,EAAO,MAAA,EACP,OAAA,GAAU,kBAAA,CAAmB,QAAA,IAC5B,OAAA,CAAQ,cAAA,CAAe,OAAA;EAC1B,OAAA,CACE,OAAA,EAAS,sBAAA,CAAuB,MAAA,EAAQ,QAAA,IACvC,OAAA,CAAQ,cAAA,CAAe,OAAA;EAE1B,MAAA,CACE,KAAA,UACA,OAAA,GAAU,qBAAA,CAAsB,QAAA,IAC/B,OAAA,CAAQ,cAAA,CAAe,OAAA;EAE1B,EAAA,iBAAmB,gBAAA,EAAkB,KAAA,EAAO,CAAA,EAAG,OAAA,EAAS,oBAAA,CAAqB,CAAA;EAC7E,GAAA,iBAAoB,gBAAA,EAAkB,KAAA,EAAO,CAAA,EAAG,OAAA,EAAS,oBAAA,CAAqB,CAAA;EA9DvE;;;;;;;;;;;;;;;;EAgFP,MAAA,cAAoB,MAAA,EAAQ,OAAA;IAC1B,WAAA;IACA,WAAA,EAAa,gBAAA,CAAiB,UAAA;EAAA,IAC5B,YAAA,CAAa,UAAA,EAAY,OAAA;AAAA"}
@@ -13,7 +13,7 @@
13
13
  * return agent.execute(input);
14
14
  * }
15
15
  */
16
- type AIErrorCode = "AGENT_EXEC_FAILED" | "AGENT_CANCELLED" | "AGENT_MAX_TRIPS" | "SCHEMA_VALIDATION_FAILED" | "TOOL_EXEC_FAILED" | "PROVIDER_ERROR" | "PROVIDER_RATE_LIMIT" | "PROVIDER_QUOTA_EXCEEDED" | "PROVIDER_TIMEOUT" | "CONTEXT_LENGTH_EXCEEDED" | "CONTENT_FILTER" | "PROVIDER_INVALID_REQUEST" | "PROVIDER_AUTH" | "BUDGET_EXCEEDED" | "GUARDRAIL_VIOLATION" | "WORKFLOW_ERROR" | "STEP_FAILED" | "WORKFLOW_DRIFT" | "WORKFLOW_CANCELLED" | "WORKFLOW_MAX_STEPS" | "WORKFLOW_INVALID_GOTO" | "SUPERVISOR_FAILED" | "SUPERVISOR_MAX_ITERATIONS" | "SUPERVISOR_INVALID_ROUTE" | "SUPERVISOR_CANCELLED" | "SUPERVISOR_DRIFT" | "SUPERVISOR_INTENT_DESCRIPTION_REQUIRED" | "SUPERVISOR_INTENT_MIXED_DISPATCH" | "SUPERVISOR_INTENT_STREAM_AND_OUTPUT" | "SUPERVISOR_INTENT_STREAM_TO_REQUIRED" | "SUPERVISOR_INTENT_STREAM_ON_WORKFLOW" | "SUPERVISOR_DISPATCH_CYCLE";
16
+ type AIErrorCode = "AGENT_EXEC_FAILED" | "AGENT_CANCELLED" | "AGENT_MAX_TRIPS" | "SCHEMA_VALIDATION_FAILED" | "TOOL_EXEC_FAILED" | "PROVIDER_ERROR" | "PROVIDER_RATE_LIMIT" | "PROVIDER_QUOTA_EXCEEDED" | "PROVIDER_TIMEOUT" | "CONTEXT_LENGTH_EXCEEDED" | "CONTENT_FILTER" | "PROVIDER_INVALID_REQUEST" | "PROVIDER_AUTH" | "BUDGET_EXCEEDED" | "GUARDRAIL_VIOLATION" | "WORKFLOW_ERROR" | "STEP_FAILED" | "WORKFLOW_DRIFT" | "WORKFLOW_CANCELLED" | "WORKFLOW_MAX_STEPS" | "WORKFLOW_INVALID_GOTO" | "SUPERVISOR_FAILED" | "SUPERVISOR_MAX_ITERATIONS" | "SUPERVISOR_INVALID_ROUTE" | "SUPERVISOR_CANCELLED" | "SUPERVISOR_DRIFT" | "SUPERVISOR_INTENT_DESCRIPTION_REQUIRED" | "SUPERVISOR_INTENT_MIXED_DISPATCH" | "SUPERVISOR_INTENT_STREAM_AND_OUTPUT" | "SUPERVISOR_INTENT_STREAM_TO_REQUIRED" | "SUPERVISOR_INTENT_STREAM_ON_WORKFLOW" | "SUPERVISOR_DISPATCH_CYCLE" | "ORCHESTRATOR_FAILED" | "ORCHESTRATOR_DRIFT" | "ORCHESTRATOR_CONFIG" | "ORCHESTRATOR_CANCELLED" | "PLANNER_FAILED" | "PLANNER_PLAN_INVALID" | "PLANNER_CANCELLED";
17
17
  //#endregion
18
18
  export { AIErrorCode };
19
19
  //# sourceMappingURL=error-code.type.d.mts.map
@@ -14,6 +14,13 @@ import { SupervisorFailedError } from "./supervisor-failed-error.mjs";
14
14
  import { MaxIterationsError, MaxIterationsErrorOptions } from "./max-iterations-error.mjs";
15
15
  import { WorkflowError } from "./workflow-error.mjs";
16
16
  import { MaxStepsExceededError, MaxStepsExceededErrorOptions } from "./max-steps-exceeded-error.mjs";
17
+ import { OrchestratorFailedError } from "./orchestrator-failed-error.mjs";
18
+ import { OrchestratorCancelledError, OrchestratorCancelledErrorOptions } from "./orchestrator-cancelled-error.mjs";
19
+ import { OrchestratorConfigError } from "./orchestrator-config-error.mjs";
20
+ import { OrchestratorDriftError, OrchestratorDriftErrorOptions } from "./orchestrator-drift-error.mjs";
21
+ import { PlannerFailedError } from "./planner-failed-error.mjs";
22
+ import { PlannerCancelledError, PlannerCancelledErrorOptions } from "./planner-cancelled-error.mjs";
23
+ import { PlannerPlanInvalidError } from "./planner-plan-invalid-error.mjs";
17
24
  import { ProviderAuthError } from "./provider-auth-error.mjs";
18
25
  import { ProviderRateLimitError, ProviderRateLimitErrorOptions } from "./provider-rate-limit-error.mjs";
19
26
  import { ProviderTimeoutError } from "./provider-timeout-error.mjs";
@@ -12,6 +12,13 @@ import { SupervisorFailedError } from "./supervisor-failed-error.mjs";
12
12
  import { MaxIterationsError } from "./max-iterations-error.mjs";
13
13
  import { WorkflowError } from "./workflow-error.mjs";
14
14
  import { MaxStepsExceededError } from "./max-steps-exceeded-error.mjs";
15
+ import { OrchestratorFailedError } from "./orchestrator-failed-error.mjs";
16
+ import { OrchestratorCancelledError } from "./orchestrator-cancelled-error.mjs";
17
+ import { OrchestratorConfigError } from "./orchestrator-config-error.mjs";
18
+ import { OrchestratorDriftError } from "./orchestrator-drift-error.mjs";
19
+ import { PlannerFailedError } from "./planner-failed-error.mjs";
20
+ import { PlannerCancelledError } from "./planner-cancelled-error.mjs";
21
+ import { PlannerPlanInvalidError } from "./planner-plan-invalid-error.mjs";
15
22
  import { ProviderAuthError } from "./provider-auth-error.mjs";
16
23
  import { ProviderRateLimitError } from "./provider-rate-limit-error.mjs";
17
24
  import { ProviderTimeoutError } from "./provider-timeout-error.mjs";
@@ -0,0 +1,32 @@
1
+ import { ErrorCategory } from "./error-category.type.mjs";
2
+ import { AIErrorOptions } from "./ai-error.mjs";
3
+ import { OrchestratorFailedError } from "./orchestrator-failed-error.mjs";
4
+
5
+ //#region ../@warlock.js/ai/src/errors/orchestrator-cancelled-error.d.ts
6
+ type OrchestratorCancelledErrorOptions = AIErrorOptions & {
7
+ /** ISO-8601 timestamp at which the abort was observed by the orchestrator. */cancelledAt: string; /** The session whose turn was cancelled. */
8
+ sessionId: string; /** `controller.abort(reason)` payload when the caller supplied one. */
9
+ reason?: string;
10
+ };
11
+ /**
12
+ * A turn was cancelled via `AbortSignal` before it could settle
13
+ * (orchestrator.md §17 — "mid-turn cancel"). The orchestrator returns
14
+ * normally with `report.status: "cancelled"` and the error placed on
15
+ * `result.error` rather than thrown; session state reverts to the
16
+ * pre-turn checkpoint (the orchestrator does not persist a fresh row
17
+ * for a cancelled turn — Q10).
18
+ *
19
+ * Mirrors `SupervisorCancelledError`, orchestrator scope. When an
20
+ * `iterate: true` turn is cancelled mid-iteration, the underlying
21
+ * `SupervisorCancelledError` rides on `cause`.
22
+ */
23
+ declare class OrchestratorCancelledError extends OrchestratorFailedError {
24
+ static readonly defaultCategory: ErrorCategory;
25
+ readonly cancelledAt: string;
26
+ readonly sessionId: string;
27
+ readonly reason?: string;
28
+ constructor(message: string, options: OrchestratorCancelledErrorOptions);
29
+ }
30
+ //#endregion
31
+ export { OrchestratorCancelledError, OrchestratorCancelledErrorOptions };
32
+ //# sourceMappingURL=orchestrator-cancelled-error.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator-cancelled-error.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/errors/orchestrator-cancelled-error.ts"],"mappings":";;;;;KAIY,iCAAA,GAAoC,cAAc;gFAE5D,WAAA,UAF2C;EAI3C,SAAA,UAJ4D;EAM5D,MAAA;AAAA;;;;AAAM;AAeR;;;;;;;;cAAa,0BAAA,SAAmC,uBAAA;EAAA,gBACvB,eAAA,EAAiB,aAAA;EAAA,SAExB,WAAA;EAAA,SACA,SAAA;EAAA,SACA,MAAA;cAGd,OAAA,UACA,OAAA,EAAS,iCAAA;AAAA"}
@@ -0,0 +1,31 @@
1
+ import { OrchestratorFailedError } from "./orchestrator-failed-error.mjs";
2
+
3
+ //#region ../@warlock.js/ai/src/errors/orchestrator-cancelled-error.ts
4
+ /**
5
+ * A turn was cancelled via `AbortSignal` before it could settle
6
+ * (orchestrator.md §17 — "mid-turn cancel"). The orchestrator returns
7
+ * normally with `report.status: "cancelled"` and the error placed on
8
+ * `result.error` rather than thrown; session state reverts to the
9
+ * pre-turn checkpoint (the orchestrator does not persist a fresh row
10
+ * for a cancelled turn — Q10).
11
+ *
12
+ * Mirrors `SupervisorCancelledError`, orchestrator scope. When an
13
+ * `iterate: true` turn is cancelled mid-iteration, the underlying
14
+ * `SupervisorCancelledError` rides on `cause`.
15
+ */
16
+ var OrchestratorCancelledError = class extends OrchestratorFailedError {
17
+ static {
18
+ this.defaultCategory = "cancelled";
19
+ }
20
+ constructor(message, options) {
21
+ super(message, options, "ORCHESTRATOR_CANCELLED");
22
+ this.name = "OrchestratorCancelledError";
23
+ this.cancelledAt = options.cancelledAt;
24
+ this.sessionId = options.sessionId;
25
+ this.reason = options.reason;
26
+ }
27
+ };
28
+
29
+ //#endregion
30
+ export { OrchestratorCancelledError };
31
+ //# sourceMappingURL=orchestrator-cancelled-error.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator-cancelled-error.mjs","names":[],"sources":["../../../../../../../@warlock.js/ai/src/errors/orchestrator-cancelled-error.ts"],"sourcesContent":["import type { AIErrorOptions } from \"./ai-error\";\nimport type { ErrorCategory } from \"./error-category.type\";\nimport { OrchestratorFailedError } from \"./orchestrator-failed-error\";\n\nexport type OrchestratorCancelledErrorOptions = AIErrorOptions & {\n /** ISO-8601 timestamp at which the abort was observed by the orchestrator. */\n cancelledAt: string;\n /** The session whose turn was cancelled. */\n sessionId: string;\n /** `controller.abort(reason)` payload when the caller supplied one. */\n reason?: string;\n};\n\n/**\n * A turn was cancelled via `AbortSignal` before it could settle\n * (orchestrator.md §17 — \"mid-turn cancel\"). The orchestrator returns\n * normally with `report.status: \"cancelled\"` and the error placed on\n * `result.error` rather than thrown; session state reverts to the\n * pre-turn checkpoint (the orchestrator does not persist a fresh row\n * for a cancelled turn — Q10).\n *\n * Mirrors `SupervisorCancelledError`, orchestrator scope. When an\n * `iterate: true` turn is cancelled mid-iteration, the underlying\n * `SupervisorCancelledError` rides on `cause`.\n */\nexport class OrchestratorCancelledError extends OrchestratorFailedError {\n public static readonly defaultCategory: ErrorCategory = \"cancelled\";\n\n public readonly cancelledAt: string;\n public readonly sessionId: string;\n public readonly reason?: string;\n\n public constructor(\n message: string,\n options: OrchestratorCancelledErrorOptions,\n ) {\n super(message, options, \"ORCHESTRATOR_CANCELLED\");\n this.name = \"OrchestratorCancelledError\";\n this.cancelledAt = options.cancelledAt;\n this.sessionId = options.sessionId;\n this.reason = options.reason;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAyBA,IAAa,6BAAb,cAAgD,wBAAwB;;yBACd;;CAMxD,AAAO,YACL,SACA,SACA;EACA,MAAM,SAAS,SAAS,wBAAwB;EAChD,KAAK,OAAO;EACZ,KAAK,cAAc,QAAQ;EAC3B,KAAK,YAAY,QAAQ;EACzB,KAAK,SAAS,QAAQ;CACxB;AACF"}
@@ -0,0 +1,26 @@
1
+ import { ErrorCategory } from "./error-category.type.mjs";
2
+ import { AIErrorOptions } from "./ai-error.mjs";
3
+ import { OrchestratorFailedError } from "./orchestrator-failed-error.mjs";
4
+
5
+ //#region ../@warlock.js/ai/src/errors/orchestrator-config-error.d.ts
6
+ /**
7
+ * Authoring-time misconfiguration of `ai.orchestrator(config)`
8
+ * (orchestrator.md §17). Thrown synchronously at construction — never
9
+ * surfaced via `result.error` — so a bad definition fails fast at boot
10
+ * rather than on the first turn.
11
+ *
12
+ * Examples (§17): `iterate: true` with no `snapshotStore` (or
13
+ * `ai.config({ defaultSnapshotStore })`); no resolvable
14
+ * `checkpointStore`; both `route` and `router` configured;
15
+ * `initialAgent` that is not a key in `intents`.
16
+ *
17
+ * Mirrors the `authoring: true` context tag the supervisor factory
18
+ * stamps on its construction-time failures.
19
+ */
20
+ declare class OrchestratorConfigError extends OrchestratorFailedError {
21
+ static readonly defaultCategory: ErrorCategory;
22
+ constructor(message: string, options?: AIErrorOptions);
23
+ }
24
+ //#endregion
25
+ export { OrchestratorConfigError };
26
+ //# sourceMappingURL=orchestrator-config-error.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator-config-error.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/errors/orchestrator-config-error.ts"],"mappings":";;;;;;;AAkBA;;;;;;;;;;;;cAAa,uBAAA,SAAgC,uBAAA;EAAA,gBACpB,eAAA,EAAiB,aAAA;cAErB,OAAA,UAAiB,OAAA,GAAU,cAAA;AAAA"}
@@ -0,0 +1,30 @@
1
+ import { OrchestratorFailedError } from "./orchestrator-failed-error.mjs";
2
+
3
+ //#region ../@warlock.js/ai/src/errors/orchestrator-config-error.ts
4
+ /**
5
+ * Authoring-time misconfiguration of `ai.orchestrator(config)`
6
+ * (orchestrator.md §17). Thrown synchronously at construction — never
7
+ * surfaced via `result.error` — so a bad definition fails fast at boot
8
+ * rather than on the first turn.
9
+ *
10
+ * Examples (§17): `iterate: true` with no `snapshotStore` (or
11
+ * `ai.config({ defaultSnapshotStore })`); no resolvable
12
+ * `checkpointStore`; both `route` and `router` configured;
13
+ * `initialAgent` that is not a key in `intents`.
14
+ *
15
+ * Mirrors the `authoring: true` context tag the supervisor factory
16
+ * stamps on its construction-time failures.
17
+ */
18
+ var OrchestratorConfigError = class extends OrchestratorFailedError {
19
+ static {
20
+ this.defaultCategory = "validation";
21
+ }
22
+ constructor(message, options) {
23
+ super(message, options, "ORCHESTRATOR_CONFIG");
24
+ this.name = "OrchestratorConfigError";
25
+ }
26
+ };
27
+
28
+ //#endregion
29
+ export { OrchestratorConfigError };
30
+ //# sourceMappingURL=orchestrator-config-error.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator-config-error.mjs","names":[],"sources":["../../../../../../../@warlock.js/ai/src/errors/orchestrator-config-error.ts"],"sourcesContent":["import type { AIErrorOptions } from \"./ai-error\";\nimport type { ErrorCategory } from \"./error-category.type\";\nimport { OrchestratorFailedError } from \"./orchestrator-failed-error\";\n\n/**\n * Authoring-time misconfiguration of `ai.orchestrator(config)`\n * (orchestrator.md §17). Thrown synchronously at construction — never\n * surfaced via `result.error` — so a bad definition fails fast at boot\n * rather than on the first turn.\n *\n * Examples (§17): `iterate: true` with no `snapshotStore` (or\n * `ai.config({ defaultSnapshotStore })`); no resolvable\n * `checkpointStore`; both `route` and `router` configured;\n * `initialAgent` that is not a key in `intents`.\n *\n * Mirrors the `authoring: true` context tag the supervisor factory\n * stamps on its construction-time failures.\n */\nexport class OrchestratorConfigError extends OrchestratorFailedError {\n public static readonly defaultCategory: ErrorCategory = \"validation\";\n\n public constructor(message: string, options?: AIErrorOptions) {\n super(message, options, \"ORCHESTRATOR_CONFIG\");\n this.name = \"OrchestratorConfigError\";\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,IAAa,0BAAb,cAA6C,wBAAwB;;yBACX;;CAExD,AAAO,YAAY,SAAiB,SAA0B;EAC5D,MAAM,SAAS,SAAS,qBAAqB;EAC7C,KAAK,OAAO;CACd;AACF"}
@@ -0,0 +1,38 @@
1
+ import { ErrorCategory } from "./error-category.type.mjs";
2
+ import { AIErrorOptions } from "./ai-error.mjs";
3
+ import { OrchestratorFailedError } from "./orchestrator-failed-error.mjs";
4
+
5
+ //#region ../@warlock.js/ai/src/errors/orchestrator-drift-error.d.ts
6
+ type OrchestratorDriftErrorOptions = AIErrorOptions & {
7
+ /** Signature recorded on the loaded checkpoint. */savedSignature: string; /** Signature computed from the current orchestrator definition. */
8
+ currentSignature: string; /** The session whose checkpoint drifted. */
9
+ sessionId: string;
10
+ };
11
+ /**
12
+ * Phase 2 drift guard (orchestrator.md §3 / §10). `execute()` or
13
+ * `resume()` loaded a checkpoint whose structural fingerprint does not
14
+ * match the current orchestrator definition (name + intents map +
15
+ * route/router presence + evaluate presence + initialAgent +
16
+ * maxIterations + iterate flag + historyWindow shape — §10.1).
17
+ *
18
+ * The turn is refused synchronously — nothing dispatches — and the dev
19
+ * decides how to recover: discard the session, migrate the persisted
20
+ * state, or pass `{ force: true }` to accept the new signature on the
21
+ * next persisted checkpoint.
22
+ *
23
+ * Mirrors `SupervisorDriftError` / `WorkflowDriftError` — same
24
+ * rationale, orchestrator scope. The orchestrator signature does NOT
25
+ * aggregate the internal supervisor's signature (§10.1); internal-
26
+ * supervisor drift surfaces only on `iterate: true` resume via the
27
+ * supervisor's own drift check.
28
+ */
29
+ declare class OrchestratorDriftError extends OrchestratorFailedError {
30
+ static readonly defaultCategory: ErrorCategory;
31
+ readonly savedSignature: string;
32
+ readonly currentSignature: string;
33
+ readonly sessionId: string;
34
+ constructor(message: string, options: OrchestratorDriftErrorOptions);
35
+ }
36
+ //#endregion
37
+ export { OrchestratorDriftError, OrchestratorDriftErrorOptions };
38
+ //# sourceMappingURL=orchestrator-drift-error.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator-drift-error.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/errors/orchestrator-drift-error.ts"],"mappings":";;;;;KAIY,6BAAA,GAAgC,cAAc;qDAExD,cAAA,UAFuC;EAIvC,gBAAA,UAJwD;EAMxD,SAAA;AAAA;;;;AAAS;AAqBX;;;;;;;;;;;;;;cAAa,sBAAA,SAA+B,uBAAA;EAAA,gBACnB,eAAA,EAAiB,aAAA;EAAA,SAExB,cAAA;EAAA,SACA,gBAAA;EAAA,SACA,SAAA;cAEG,OAAA,UAAiB,OAAA,EAAS,6BAAA;AAAA"}
@@ -0,0 +1,37 @@
1
+ import { OrchestratorFailedError } from "./orchestrator-failed-error.mjs";
2
+
3
+ //#region ../@warlock.js/ai/src/errors/orchestrator-drift-error.ts
4
+ /**
5
+ * Phase 2 drift guard (orchestrator.md §3 / §10). `execute()` or
6
+ * `resume()` loaded a checkpoint whose structural fingerprint does not
7
+ * match the current orchestrator definition (name + intents map +
8
+ * route/router presence + evaluate presence + initialAgent +
9
+ * maxIterations + iterate flag + historyWindow shape — §10.1).
10
+ *
11
+ * The turn is refused synchronously — nothing dispatches — and the dev
12
+ * decides how to recover: discard the session, migrate the persisted
13
+ * state, or pass `{ force: true }` to accept the new signature on the
14
+ * next persisted checkpoint.
15
+ *
16
+ * Mirrors `SupervisorDriftError` / `WorkflowDriftError` — same
17
+ * rationale, orchestrator scope. The orchestrator signature does NOT
18
+ * aggregate the internal supervisor's signature (§10.1); internal-
19
+ * supervisor drift surfaces only on `iterate: true` resume via the
20
+ * supervisor's own drift check.
21
+ */
22
+ var OrchestratorDriftError = class extends OrchestratorFailedError {
23
+ static {
24
+ this.defaultCategory = "drift";
25
+ }
26
+ constructor(message, options) {
27
+ super(message, options, "ORCHESTRATOR_DRIFT");
28
+ this.name = "OrchestratorDriftError";
29
+ this.savedSignature = options.savedSignature;
30
+ this.currentSignature = options.currentSignature;
31
+ this.sessionId = options.sessionId;
32
+ }
33
+ };
34
+
35
+ //#endregion
36
+ export { OrchestratorDriftError };
37
+ //# sourceMappingURL=orchestrator-drift-error.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator-drift-error.mjs","names":[],"sources":["../../../../../../../@warlock.js/ai/src/errors/orchestrator-drift-error.ts"],"sourcesContent":["import type { AIErrorOptions } from \"./ai-error\";\nimport type { ErrorCategory } from \"./error-category.type\";\nimport { OrchestratorFailedError } from \"./orchestrator-failed-error\";\n\nexport type OrchestratorDriftErrorOptions = AIErrorOptions & {\n /** Signature recorded on the loaded checkpoint. */\n savedSignature: string;\n /** Signature computed from the current orchestrator definition. */\n currentSignature: string;\n /** The session whose checkpoint drifted. */\n sessionId: string;\n};\n\n/**\n * Phase 2 drift guard (orchestrator.md §3 / §10). `execute()` or\n * `resume()` loaded a checkpoint whose structural fingerprint does not\n * match the current orchestrator definition (name + intents map +\n * route/router presence + evaluate presence + initialAgent +\n * maxIterations + iterate flag + historyWindow shape — §10.1).\n *\n * The turn is refused synchronously — nothing dispatches — and the dev\n * decides how to recover: discard the session, migrate the persisted\n * state, or pass `{ force: true }` to accept the new signature on the\n * next persisted checkpoint.\n *\n * Mirrors `SupervisorDriftError` / `WorkflowDriftError` — same\n * rationale, orchestrator scope. The orchestrator signature does NOT\n * aggregate the internal supervisor's signature (§10.1); internal-\n * supervisor drift surfaces only on `iterate: true` resume via the\n * supervisor's own drift check.\n */\nexport class OrchestratorDriftError extends OrchestratorFailedError {\n public static readonly defaultCategory: ErrorCategory = \"drift\";\n\n public readonly savedSignature: string;\n public readonly currentSignature: string;\n public readonly sessionId: string;\n\n public constructor(message: string, options: OrchestratorDriftErrorOptions) {\n super(message, options, \"ORCHESTRATOR_DRIFT\");\n this.name = \"OrchestratorDriftError\";\n this.savedSignature = options.savedSignature;\n this.currentSignature = options.currentSignature;\n this.sessionId = options.sessionId;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA+BA,IAAa,yBAAb,cAA4C,wBAAwB;;yBACV;;CAMxD,AAAO,YAAY,SAAiB,SAAwC;EAC1E,MAAM,SAAS,SAAS,oBAAoB;EAC5C,KAAK,OAAO;EACZ,KAAK,iBAAiB,QAAQ;EAC9B,KAAK,mBAAmB,QAAQ;EAChC,KAAK,YAAY,QAAQ;CAC3B;AACF"}
@@ -0,0 +1,33 @@
1
+ import { AIErrorCode } from "./error-code.type.mjs";
2
+ import { AIError, AIErrorOptions } from "./ai-error.mjs";
3
+
4
+ //#region ../@warlock.js/ai/src/errors/orchestrator-failed-error.d.ts
5
+ /**
6
+ * Base class for every orchestrator-specific failure surfaced from
7
+ * `orchestrator.execute()` / `orchestrator.resume()` /
8
+ * `orchestrator.command()` or thrown at authoring-time by
9
+ * `ai.orchestrator()` validation (orchestrator.md §17).
10
+ *
11
+ * **Role.** Anchor for the `ORCHESTRATOR_*` code family. Subclasses
12
+ * carry precise codes (`ORCHESTRATOR_DRIFT`, `ORCHESTRATOR_CONFIG`,
13
+ * `ORCHESTRATOR_CANCELLED`, …); this base catches everything a turn can
14
+ * produce that isn't already an agent / tool / provider / supervisor
15
+ * error bubbling up from the dispatched child.
16
+ *
17
+ * Child-execution errors (agent, tool, provider, supervisor) flow
18
+ * through the orchestrator unchanged — they are captured on the turn's
19
+ * `childReport` and surfaced on `result.error` directly, never
20
+ * re-wrapped.
21
+ *
22
+ * @example
23
+ * const result = await orchestrator.execute(message, { sessionId, history });
24
+ * if (result.error instanceof OrchestratorFailedError) {
25
+ * console.error(result.error.code, result.error.message);
26
+ * }
27
+ */
28
+ declare class OrchestratorFailedError extends AIError {
29
+ constructor(message: string, options?: AIErrorOptions, code?: AIErrorCode);
30
+ }
31
+ //#endregion
32
+ export { OrchestratorFailedError };
33
+ //# sourceMappingURL=orchestrator-failed-error.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator-failed-error.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/errors/orchestrator-failed-error.ts"],"mappings":";;;;;;AA0BA;;;;;;;;;;;;;;;;AAI6C;;;;;cAJhC,uBAAA,SAAgC,OAAA;cAEzC,OAAA,UACA,OAAA,GAAU,cAAA,EACV,IAAA,GAAM,WAAA;AAAA"}
@@ -0,0 +1,36 @@
1
+ import { AIError } from "./ai-error.mjs";
2
+
3
+ //#region ../@warlock.js/ai/src/errors/orchestrator-failed-error.ts
4
+ /**
5
+ * Base class for every orchestrator-specific failure surfaced from
6
+ * `orchestrator.execute()` / `orchestrator.resume()` /
7
+ * `orchestrator.command()` or thrown at authoring-time by
8
+ * `ai.orchestrator()` validation (orchestrator.md §17).
9
+ *
10
+ * **Role.** Anchor for the `ORCHESTRATOR_*` code family. Subclasses
11
+ * carry precise codes (`ORCHESTRATOR_DRIFT`, `ORCHESTRATOR_CONFIG`,
12
+ * `ORCHESTRATOR_CANCELLED`, …); this base catches everything a turn can
13
+ * produce that isn't already an agent / tool / provider / supervisor
14
+ * error bubbling up from the dispatched child.
15
+ *
16
+ * Child-execution errors (agent, tool, provider, supervisor) flow
17
+ * through the orchestrator unchanged — they are captured on the turn's
18
+ * `childReport` and surfaced on `result.error` directly, never
19
+ * re-wrapped.
20
+ *
21
+ * @example
22
+ * const result = await orchestrator.execute(message, { sessionId, history });
23
+ * if (result.error instanceof OrchestratorFailedError) {
24
+ * console.error(result.error.code, result.error.message);
25
+ * }
26
+ */
27
+ var OrchestratorFailedError = class extends AIError {
28
+ constructor(message, options, code = "ORCHESTRATOR_FAILED") {
29
+ super(code, message, options);
30
+ this.name = "OrchestratorFailedError";
31
+ }
32
+ };
33
+
34
+ //#endregion
35
+ export { OrchestratorFailedError };
36
+ //# sourceMappingURL=orchestrator-failed-error.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orchestrator-failed-error.mjs","names":[],"sources":["../../../../../../../@warlock.js/ai/src/errors/orchestrator-failed-error.ts"],"sourcesContent":["import { AIError, type AIErrorOptions } from \"./ai-error\";\nimport type { AIErrorCode } from \"./error-code.type\";\n\n/**\n * Base class for every orchestrator-specific failure surfaced from\n * `orchestrator.execute()` / `orchestrator.resume()` /\n * `orchestrator.command()` or thrown at authoring-time by\n * `ai.orchestrator()` validation (orchestrator.md §17).\n *\n * **Role.** Anchor for the `ORCHESTRATOR_*` code family. Subclasses\n * carry precise codes (`ORCHESTRATOR_DRIFT`, `ORCHESTRATOR_CONFIG`,\n * `ORCHESTRATOR_CANCELLED`, …); this base catches everything a turn can\n * produce that isn't already an agent / tool / provider / supervisor\n * error bubbling up from the dispatched child.\n *\n * Child-execution errors (agent, tool, provider, supervisor) flow\n * through the orchestrator unchanged — they are captured on the turn's\n * `childReport` and surfaced on `result.error` directly, never\n * re-wrapped.\n *\n * @example\n * const result = await orchestrator.execute(message, { sessionId, history });\n * if (result.error instanceof OrchestratorFailedError) {\n * console.error(result.error.code, result.error.message);\n * }\n */\nexport class OrchestratorFailedError extends AIError {\n public constructor(\n message: string,\n options?: AIErrorOptions,\n code: AIErrorCode = \"ORCHESTRATOR_FAILED\",\n ) {\n super(code, message, options);\n this.name = \"OrchestratorFailedError\";\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAa,0BAAb,cAA6C,QAAQ;CACnD,AAAO,YACL,SACA,SACA,OAAoB,uBACpB;EACA,MAAM,MAAM,SAAS,OAAO;EAC5B,KAAK,OAAO;CACd;AACF"}
@@ -0,0 +1,33 @@
1
+ import { ErrorCategory } from "./error-category.type.mjs";
2
+ import { AIErrorOptions } from "./ai-error.mjs";
3
+ import { PlannerFailedError } from "./planner-failed-error.mjs";
4
+
5
+ //#region ../@warlock.js/ai/src/errors/planner-cancelled-error.d.ts
6
+ /**
7
+ * Options for {@link PlannerCancelledError}. Carries the observation
8
+ * timestamp and the optional `controller.abort(reason)` payload.
9
+ */
10
+ type PlannerCancelledErrorOptions = AIErrorOptions & {
11
+ /** ISO-8601 timestamp at which the abort was observed by the planner. */cancelledAt: string; /** `controller.abort(reason)` payload when the caller supplied one. */
12
+ reason?: string;
13
+ };
14
+ /**
15
+ * Planner run was cancelled via `AbortSignal` before it could finish.
16
+ * Between-step cancellation is guaranteed; mid-step cancellation is
17
+ * best-effort (the signal is threaded into every in-flight capability
18
+ * `execute()` call, but effectiveness depends on the child primitive
19
+ * respecting it).
20
+ *
21
+ * On cancellation the planner returns normally with
22
+ * `report.status === "cancelled"` and the partial step snapshots — the
23
+ * error is placed on `result.error` rather than thrown.
24
+ */
25
+ declare class PlannerCancelledError extends PlannerFailedError {
26
+ static readonly defaultCategory: ErrorCategory;
27
+ readonly cancelledAt: string;
28
+ readonly reason?: string;
29
+ constructor(message: string, options: PlannerCancelledErrorOptions);
30
+ }
31
+ //#endregion
32
+ export { PlannerCancelledError, PlannerCancelledErrorOptions };
33
+ //# sourceMappingURL=planner-cancelled-error.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-cancelled-error.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/errors/planner-cancelled-error.ts"],"mappings":";;;;;;;AAQA;;KAAY,4BAAA,GAA+B,cAAc;EAAA,yEAEvD,WAAA;EAEA,MAAA;AAAA;AAAM;AAcR;;;;;;;;;;AAdQ,cAcK,qBAAA,SAA8B,kBAAA;EAAA,gBAClB,eAAA,EAAiB,aAAA;EAAA,SAExB,WAAA;EAAA,SACA,MAAA;cAEG,OAAA,UAAiB,OAAA,EAAS,4BAAA;AAAA"}
@@ -0,0 +1,29 @@
1
+ import { PlannerFailedError } from "./planner-failed-error.mjs";
2
+
3
+ //#region ../@warlock.js/ai/src/errors/planner-cancelled-error.ts
4
+ /**
5
+ * Planner run was cancelled via `AbortSignal` before it could finish.
6
+ * Between-step cancellation is guaranteed; mid-step cancellation is
7
+ * best-effort (the signal is threaded into every in-flight capability
8
+ * `execute()` call, but effectiveness depends on the child primitive
9
+ * respecting it).
10
+ *
11
+ * On cancellation the planner returns normally with
12
+ * `report.status === "cancelled"` and the partial step snapshots — the
13
+ * error is placed on `result.error` rather than thrown.
14
+ */
15
+ var PlannerCancelledError = class extends PlannerFailedError {
16
+ static {
17
+ this.defaultCategory = "cancelled";
18
+ }
19
+ constructor(message, options) {
20
+ super(message, options, "PLANNER_CANCELLED");
21
+ this.name = "PlannerCancelledError";
22
+ this.cancelledAt = options.cancelledAt;
23
+ this.reason = options.reason;
24
+ }
25
+ };
26
+
27
+ //#endregion
28
+ export { PlannerCancelledError };
29
+ //# sourceMappingURL=planner-cancelled-error.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-cancelled-error.mjs","names":[],"sources":["../../../../../../../@warlock.js/ai/src/errors/planner-cancelled-error.ts"],"sourcesContent":["import type { AIErrorOptions } from \"./ai-error\";\nimport type { ErrorCategory } from \"./error-category.type\";\nimport { PlannerFailedError } from \"./planner-failed-error\";\n\n/**\n * Options for {@link PlannerCancelledError}. Carries the observation\n * timestamp and the optional `controller.abort(reason)` payload.\n */\nexport type PlannerCancelledErrorOptions = AIErrorOptions & {\n /** ISO-8601 timestamp at which the abort was observed by the planner. */\n cancelledAt: string;\n /** `controller.abort(reason)` payload when the caller supplied one. */\n reason?: string;\n};\n\n/**\n * Planner run was cancelled via `AbortSignal` before it could finish.\n * Between-step cancellation is guaranteed; mid-step cancellation is\n * best-effort (the signal is threaded into every in-flight capability\n * `execute()` call, but effectiveness depends on the child primitive\n * respecting it).\n *\n * On cancellation the planner returns normally with\n * `report.status === \"cancelled\"` and the partial step snapshots — the\n * error is placed on `result.error` rather than thrown.\n */\nexport class PlannerCancelledError extends PlannerFailedError {\n public static readonly defaultCategory: ErrorCategory = \"cancelled\";\n\n public readonly cancelledAt: string;\n public readonly reason?: string;\n\n public constructor(message: string, options: PlannerCancelledErrorOptions) {\n super(message, options, \"PLANNER_CANCELLED\");\n this.name = \"PlannerCancelledError\";\n this.cancelledAt = options.cancelledAt;\n this.reason = options.reason;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AA0BA,IAAa,wBAAb,cAA2C,mBAAmB;;yBACJ;;CAKxD,AAAO,YAAY,SAAiB,SAAuC;EACzE,MAAM,SAAS,SAAS,mBAAmB;EAC3C,KAAK,OAAO;EACZ,KAAK,cAAc,QAAQ;EAC3B,KAAK,SAAS,QAAQ;CACxB;AACF"}
@@ -0,0 +1,40 @@
1
+ import { ErrorCategory } from "./error-category.type.mjs";
2
+ import { AIErrorCode } from "./error-code.type.mjs";
3
+ import { AIError, AIErrorOptions } from "./ai-error.mjs";
4
+
5
+ //#region ../@warlock.js/ai/src/errors/planner-failed-error.d.ts
6
+ /**
7
+ * Base class for every planner-specific failure surfaced from
8
+ * `planner.execute()` or thrown at authoring-time by `ai.planner()`
9
+ * validation.
10
+ *
11
+ * **Role.** Anchor for the `PLANNER_*` code family. Subclasses carry
12
+ * precise codes (`PLANNER_PLAN_INVALID`, `PLANNER_CANCELLED`); this base
13
+ * catches everything a planning run can produce that isn't already an
14
+ * agent / tool / workflow / supervisor error bubbling up from a
15
+ * dispatched capability.
16
+ *
17
+ * Child-execution errors (agent, tool, provider, workflow) flow through
18
+ * the planner unchanged — they are captured on the relevant step
19
+ * snapshot and surfaced on `result.error` directly, never re-wrapped.
20
+ *
21
+ * @example
22
+ * const result = await planner.execute("Research and summarize X");
23
+ * if (result.error instanceof PlannerFailedError) {
24
+ * console.error(result.error.code, result.error.message);
25
+ * }
26
+ */
27
+ declare class PlannerFailedError extends AIError {
28
+ /**
29
+ * Generic planner failures (authoring-time config violations, the
30
+ * `toAIError` catch-all for unexpected runtime crashes during a run)
31
+ * are orchestration-level provider failures. Subclasses with a more
32
+ * precise meaning redeclare their own — `PlannerPlanInvalidError` is
33
+ * `"schema"`, `PlannerCancelledError` is `"cancelled"`.
34
+ */
35
+ static readonly defaultCategory: ErrorCategory;
36
+ constructor(message: string, options?: AIErrorOptions, code?: AIErrorCode);
37
+ }
38
+ //#endregion
39
+ export { PlannerFailedError };
40
+ //# sourceMappingURL=planner-failed-error.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-failed-error.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/errors/planner-failed-error.ts"],"mappings":";;;;;;;AAyBA;;;;;;;;;;;;;;;;;;;cAAa,kBAAA,SAA2B,OAAA;;;;;;;;kBAQf,eAAA,EAAiB,aAAA;cAGtC,OAAA,UACA,OAAA,GAAU,cAAA,EACV,IAAA,GAAM,WAAA;AAAA"}
@@ -0,0 +1,37 @@
1
+ import { AIError } from "./ai-error.mjs";
2
+
3
+ //#region ../@warlock.js/ai/src/errors/planner-failed-error.ts
4
+ /**
5
+ * Base class for every planner-specific failure surfaced from
6
+ * `planner.execute()` or thrown at authoring-time by `ai.planner()`
7
+ * validation.
8
+ *
9
+ * **Role.** Anchor for the `PLANNER_*` code family. Subclasses carry
10
+ * precise codes (`PLANNER_PLAN_INVALID`, `PLANNER_CANCELLED`); this base
11
+ * catches everything a planning run can produce that isn't already an
12
+ * agent / tool / workflow / supervisor error bubbling up from a
13
+ * dispatched capability.
14
+ *
15
+ * Child-execution errors (agent, tool, provider, workflow) flow through
16
+ * the planner unchanged — they are captured on the relevant step
17
+ * snapshot and surfaced on `result.error` directly, never re-wrapped.
18
+ *
19
+ * @example
20
+ * const result = await planner.execute("Research and summarize X");
21
+ * if (result.error instanceof PlannerFailedError) {
22
+ * console.error(result.error.code, result.error.message);
23
+ * }
24
+ */
25
+ var PlannerFailedError = class extends AIError {
26
+ static {
27
+ this.defaultCategory = "provider";
28
+ }
29
+ constructor(message, options, code = "PLANNER_FAILED") {
30
+ super(code, message, options);
31
+ this.name = "PlannerFailedError";
32
+ }
33
+ };
34
+
35
+ //#endregion
36
+ export { PlannerFailedError };
37
+ //# sourceMappingURL=planner-failed-error.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"planner-failed-error.mjs","names":[],"sources":["../../../../../../../@warlock.js/ai/src/errors/planner-failed-error.ts"],"sourcesContent":["import { AIError, type AIErrorOptions } from \"./ai-error\";\nimport type { AIErrorCode } from \"./error-code.type\";\nimport type { ErrorCategory } from \"./error-category.type\";\n\n/**\n * Base class for every planner-specific failure surfaced from\n * `planner.execute()` or thrown at authoring-time by `ai.planner()`\n * validation.\n *\n * **Role.** Anchor for the `PLANNER_*` code family. Subclasses carry\n * precise codes (`PLANNER_PLAN_INVALID`, `PLANNER_CANCELLED`); this base\n * catches everything a planning run can produce that isn't already an\n * agent / tool / workflow / supervisor error bubbling up from a\n * dispatched capability.\n *\n * Child-execution errors (agent, tool, provider, workflow) flow through\n * the planner unchanged — they are captured on the relevant step\n * snapshot and surfaced on `result.error` directly, never re-wrapped.\n *\n * @example\n * const result = await planner.execute(\"Research and summarize X\");\n * if (result.error instanceof PlannerFailedError) {\n * console.error(result.error.code, result.error.message);\n * }\n */\nexport class PlannerFailedError extends AIError {\n /**\n * Generic planner failures (authoring-time config violations, the\n * `toAIError` catch-all for unexpected runtime crashes during a run)\n * are orchestration-level provider failures. Subclasses with a more\n * precise meaning redeclare their own — `PlannerPlanInvalidError` is\n * `\"schema\"`, `PlannerCancelledError` is `\"cancelled\"`.\n */\n public static readonly defaultCategory: ErrorCategory = \"provider\";\n\n public constructor(\n message: string,\n options?: AIErrorOptions,\n code: AIErrorCode = \"PLANNER_FAILED\",\n ) {\n super(code, message, options);\n this.name = \"PlannerFailedError\";\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAa,qBAAb,cAAwC,QAAQ;;yBAQU;;CAExD,AAAO,YACL,SACA,SACA,OAAoB,kBACpB;EACA,MAAM,MAAM,SAAS,OAAO;EAC5B,KAAK,OAAO;CACd;AACF"}