@warlock.js/ai 4.8.2 → 4.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1169) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/cjs/index.cjs +263 -241
  3. package/cjs/index.cjs.map +1 -1
  4. package/cjs/{magic-string.es-BtxW4VqG.cjs → magic-string.es-BoSa5xIt.cjs} +3 -3
  5. package/cjs/magic-string.es-BoSa5xIt.cjs.map +1 -0
  6. package/cjs/{matcher-logic-SBnzYohQ.cjs → matcher-logic-07fFOz7r.cjs} +3 -3
  7. package/cjs/matcher-logic-07fFOz7r.cjs.map +1 -0
  8. package/cjs/{matchers-BBh3gyB-.cjs → matchers-DnV47KR_.cjs} +24 -24
  9. package/cjs/matchers-DnV47KR_.cjs.map +1 -0
  10. package/esm/agent/agent-config.type.d.mts +1 -1
  11. package/esm/agent/agent-config.type.d.mts.map +1 -1
  12. package/esm/agent/agent-input-builder.mjs +1 -1
  13. package/esm/agent/agent-input-builder.mjs.map +1 -1
  14. package/esm/agent/agent-log-event.mjs +1 -1
  15. package/esm/agent/agent-log-event.mjs.map +1 -1
  16. package/esm/agent/agent-stream.d.mts +1 -1
  17. package/esm/agent/agent-stream.d.mts.map +1 -1
  18. package/esm/agent/agent-stream.mjs +1 -1
  19. package/esm/agent/agent-stream.mjs.map +1 -1
  20. package/esm/agent/agent-to-stream-event.mjs +1 -1
  21. package/esm/agent/agent-to-stream-event.mjs.map +1 -1
  22. package/esm/agent/agent.d.mts +1 -1
  23. package/esm/agent/agent.d.mts.map +1 -1
  24. package/esm/agent/agent.mjs +1 -1
  25. package/esm/agent/agent.mjs.map +1 -1
  26. package/esm/agent/json-stream-guard.mjs +1 -1
  27. package/esm/agent/json-stream-guard.mjs.map +1 -1
  28. package/esm/agent/judge-config.type.d.mts +1 -1
  29. package/esm/agent/judge-config.type.d.mts.map +1 -1
  30. package/esm/agent/judge-config.type.mjs +1 -1
  31. package/esm/agent/judge-config.type.mjs.map +1 -1
  32. package/esm/agent/signature.mjs +1 -1
  33. package/esm/agent/signature.mjs.map +1 -1
  34. package/esm/agent/snapshot.mjs +1 -1
  35. package/esm/agent/snapshot.mjs.map +1 -1
  36. package/esm/agent/spawn-sub-agent.d.mts +1 -1
  37. package/esm/agent/spawn-sub-agent.d.mts.map +1 -1
  38. package/esm/agent/spawn-sub-agent.mjs +1 -1
  39. package/esm/agent/spawn-sub-agent.mjs.map +1 -1
  40. package/esm/ai.d.mts +1 -1
  41. package/esm/ai.d.mts.map +1 -1
  42. package/esm/ai.mjs +1 -1
  43. package/esm/ai.mjs.map +1 -1
  44. package/esm/batch/batch.d.mts +1 -1
  45. package/esm/batch/batch.d.mts.map +1 -1
  46. package/esm/batch/batch.mjs +1 -1
  47. package/esm/batch/batch.mjs.map +1 -1
  48. package/esm/batch/batch.type.d.mts +1 -1
  49. package/esm/batch/batch.type.d.mts.map +1 -1
  50. package/esm/batch/run-batch-item.mjs +1 -1
  51. package/esm/batch/run-batch-item.mjs.map +1 -1
  52. package/esm/batch/run-with-concurrency.mjs +1 -1
  53. package/esm/batch/run-with-concurrency.mjs.map +1 -1
  54. package/esm/checkpoint/memory.d.mts +1 -1
  55. package/esm/checkpoint/memory.d.mts.map +1 -1
  56. package/esm/checkpoint/memory.mjs +0 -0
  57. package/esm/checkpoint/memory.mjs.map +1 -1
  58. package/esm/checkpoint/pg.d.mts +1 -1
  59. package/esm/checkpoint/pg.d.mts.map +1 -1
  60. package/esm/checkpoint/pg.mjs +1 -1
  61. package/esm/checkpoint/pg.mjs.map +1 -1
  62. package/esm/checkpoint/redis.d.mts +1 -1
  63. package/esm/checkpoint/redis.d.mts.map +1 -1
  64. package/esm/checkpoint/redis.mjs +1 -1
  65. package/esm/checkpoint/redis.mjs.map +1 -1
  66. package/esm/config.d.mts +1 -1
  67. package/esm/config.d.mts.map +1 -1
  68. package/esm/config.mjs +1 -1
  69. package/esm/config.mjs.map +1 -1
  70. package/esm/contracts/agent/agent-options.type.d.mts +1 -1
  71. package/esm/contracts/agent/agent-options.type.d.mts.map +1 -1
  72. package/esm/contracts/agent/agent-snapshot.type.d.mts +1 -1
  73. package/esm/contracts/agent/agent-snapshot.type.d.mts.map +1 -1
  74. package/esm/contracts/agent/agent.contract.d.mts +1 -1
  75. package/esm/contracts/agent/agent.contract.d.mts.map +1 -1
  76. package/esm/contracts/agent/eval.type.d.mts +1 -1
  77. package/esm/contracts/agent/eval.type.d.mts.map +1 -1
  78. package/esm/contracts/attachment-policy.type.d.mts +1 -1
  79. package/esm/contracts/attachment-policy.type.d.mts.map +1 -1
  80. package/esm/contracts/attachment.type.d.mts +1 -1
  81. package/esm/contracts/attachment.type.d.mts.map +1 -1
  82. package/esm/contracts/content-part.type.d.mts +1 -1
  83. package/esm/contracts/content-part.type.d.mts.map +1 -1
  84. package/esm/contracts/conversation-message.type.d.mts +1 -1
  85. package/esm/contracts/conversation-message.type.d.mts.map +1 -1
  86. package/esm/contracts/embedder.contract.d.mts +1 -1
  87. package/esm/contracts/embedder.contract.d.mts.map +1 -1
  88. package/esm/contracts/end.type.d.mts +1 -1
  89. package/esm/contracts/end.type.d.mts.map +1 -1
  90. package/esm/contracts/end.type.mjs +1 -1
  91. package/esm/contracts/end.type.mjs.map +1 -1
  92. package/esm/contracts/events/agent-events.type.d.mts +1 -1
  93. package/esm/contracts/events/agent-events.type.d.mts.map +1 -1
  94. package/esm/contracts/events/complete-event.type.d.mts +1 -1
  95. package/esm/contracts/events/complete-event.type.d.mts.map +1 -1
  96. package/esm/contracts/events/event-identity.type.d.mts +1 -1
  97. package/esm/contracts/events/event-identity.type.d.mts.map +1 -1
  98. package/esm/contracts/events/event-map.type.d.mts +1 -1
  99. package/esm/contracts/events/event-map.type.d.mts.map +1 -1
  100. package/esm/contracts/events/supervisor-events.type.d.mts +1 -1
  101. package/esm/contracts/events/supervisor-events.type.d.mts.map +1 -1
  102. package/esm/contracts/events/usage-event.type.d.mts +1 -1
  103. package/esm/contracts/events/usage-event.type.d.mts.map +1 -1
  104. package/esm/contracts/events/workflow-events.type.d.mts +1 -1
  105. package/esm/contracts/events/workflow-events.type.d.mts.map +1 -1
  106. package/esm/contracts/executable.contract.d.mts +1 -1
  107. package/esm/contracts/executable.contract.d.mts.map +1 -1
  108. package/esm/contracts/fallback-model.contract.d.mts +1 -1
  109. package/esm/contracts/fallback-model.contract.d.mts.map +1 -1
  110. package/esm/contracts/finish-reason.type.d.mts +1 -1
  111. package/esm/contracts/finish-reason.type.d.mts.map +1 -1
  112. package/esm/contracts/image-model.contract.d.mts +1 -1
  113. package/esm/contracts/image-model.contract.d.mts.map +1 -1
  114. package/esm/contracts/memory/memory-config.type.d.mts +1 -1
  115. package/esm/contracts/memory/memory-config.type.d.mts.map +1 -1
  116. package/esm/contracts/memory/memory-item.type.d.mts +1 -1
  117. package/esm/contracts/memory/memory-item.type.d.mts.map +1 -1
  118. package/esm/contracts/memory/memory.contract.d.mts +1 -1
  119. package/esm/contracts/memory/memory.contract.d.mts.map +1 -1
  120. package/esm/contracts/memory/recall-options.type.d.mts +1 -1
  121. package/esm/contracts/memory/recall-options.type.d.mts.map +1 -1
  122. package/esm/contracts/middleware/middleware-context.type.d.mts +1 -1
  123. package/esm/contracts/middleware/middleware-context.type.d.mts.map +1 -1
  124. package/esm/contracts/middleware/middleware-state.type.d.mts +1 -1
  125. package/esm/contracts/middleware/middleware-state.type.d.mts.map +1 -1
  126. package/esm/contracts/middleware/middleware.contract.d.mts +1 -1
  127. package/esm/contracts/middleware/middleware.contract.d.mts.map +1 -1
  128. package/esm/contracts/model-tool-call-request.type.d.mts +1 -1
  129. package/esm/contracts/model-tool-call-request.type.d.mts.map +1 -1
  130. package/esm/contracts/model.contract.d.mts +9 -1
  131. package/esm/contracts/model.contract.d.mts.map +1 -1
  132. package/esm/contracts/orchestrator/checkpoint-store.contract.d.mts +1 -1
  133. package/esm/contracts/orchestrator/checkpoint-store.contract.d.mts.map +1 -1
  134. package/esm/contracts/orchestrator/orchestrator-commands.type.d.mts +1 -1
  135. package/esm/contracts/orchestrator/orchestrator-commands.type.d.mts.map +1 -1
  136. package/esm/contracts/orchestrator/orchestrator-config.type.d.mts +1 -1
  137. package/esm/contracts/orchestrator/orchestrator-config.type.d.mts.map +1 -1
  138. package/esm/contracts/orchestrator/orchestrator-event.type.d.mts +1 -1
  139. package/esm/contracts/orchestrator/orchestrator-event.type.d.mts.map +1 -1
  140. package/esm/contracts/orchestrator/orchestrator-execute-options.type.d.mts +1 -1
  141. package/esm/contracts/orchestrator/orchestrator-execute-options.type.d.mts.map +1 -1
  142. package/esm/contracts/orchestrator/orchestrator.contract.d.mts +1 -1
  143. package/esm/contracts/orchestrator/orchestrator.contract.d.mts.map +1 -1
  144. package/esm/contracts/orchestrator/session-lock.contract.d.mts +1 -1
  145. package/esm/contracts/orchestrator/session-lock.contract.d.mts.map +1 -1
  146. package/esm/contracts/orchestrator/session.contract.d.mts +1 -1
  147. package/esm/contracts/orchestrator/session.contract.d.mts.map +1 -1
  148. package/esm/contracts/orchestrator/snapshot-store.contract.d.mts +1 -1
  149. package/esm/contracts/orchestrator/snapshot-store.contract.d.mts.map +1 -1
  150. package/esm/contracts/placeholders.type.d.mts +1 -1
  151. package/esm/contracts/placeholders.type.d.mts.map +1 -1
  152. package/esm/contracts/planner/planner-capability.type.d.mts +1 -1
  153. package/esm/contracts/planner/planner-capability.type.d.mts.map +1 -1
  154. package/esm/contracts/planner/planner-config.type.d.mts +1 -1
  155. package/esm/contracts/planner/planner-config.type.d.mts.map +1 -1
  156. package/esm/contracts/planner/planner-execute-options.type.d.mts +1 -1
  157. package/esm/contracts/planner/planner-execute-options.type.d.mts.map +1 -1
  158. package/esm/contracts/planner/planner-plan.type.d.mts +1 -1
  159. package/esm/contracts/planner/planner-plan.type.d.mts.map +1 -1
  160. package/esm/contracts/planner/planner-result.type.d.mts +1 -1
  161. package/esm/contracts/planner/planner-result.type.d.mts.map +1 -1
  162. package/esm/contracts/planner/planner-snapshot.type.d.mts +1 -1
  163. package/esm/contracts/planner/planner-snapshot.type.d.mts.map +1 -1
  164. package/esm/contracts/planner/planner.contract.d.mts +1 -1
  165. package/esm/contracts/planner/planner.contract.d.mts.map +1 -1
  166. package/esm/contracts/result/agent-result.type.d.mts +1 -1
  167. package/esm/contracts/result/agent-result.type.d.mts.map +1 -1
  168. package/esm/contracts/result/attempt-entry.type.d.mts +1 -1
  169. package/esm/contracts/result/attempt-entry.type.d.mts.map +1 -1
  170. package/esm/contracts/result/base-report.type.d.mts +1 -1
  171. package/esm/contracts/result/base-report.type.d.mts.map +1 -1
  172. package/esm/contracts/result/base-report.type.mjs +1 -1
  173. package/esm/contracts/result/base-report.type.mjs.map +1 -1
  174. package/esm/contracts/result/base-result.type.d.mts +1 -1
  175. package/esm/contracts/result/base-result.type.d.mts.map +1 -1
  176. package/esm/contracts/result/execute-result.type.d.mts +1 -1
  177. package/esm/contracts/result/execute-result.type.d.mts.map +1 -1
  178. package/esm/contracts/result/execution-report.type.d.mts +1 -1
  179. package/esm/contracts/result/execution-report.type.d.mts.map +1 -1
  180. package/esm/contracts/result/llm-trip.type.d.mts +1 -1
  181. package/esm/contracts/result/llm-trip.type.d.mts.map +1 -1
  182. package/esm/contracts/result/model-pricing.type.d.mts +1 -1
  183. package/esm/contracts/result/model-pricing.type.d.mts.map +1 -1
  184. package/esm/contracts/result/orchestrator-result.type.d.mts +1 -1
  185. package/esm/contracts/result/orchestrator-result.type.d.mts.map +1 -1
  186. package/esm/contracts/result/session-send-result.type.d.mts +1 -1
  187. package/esm/contracts/result/session-send-result.type.d.mts.map +1 -1
  188. package/esm/contracts/result/step-result.type.d.mts +12 -2
  189. package/esm/contracts/result/step-result.type.d.mts.map +1 -1
  190. package/esm/contracts/result/supervisor-result.type.d.mts +1 -1
  191. package/esm/contracts/result/supervisor-result.type.d.mts.map +1 -1
  192. package/esm/contracts/result/tool-call.type.d.mts +1 -1
  193. package/esm/contracts/result/tool-call.type.d.mts.map +1 -1
  194. package/esm/contracts/result/usage.type.d.mts +1 -1
  195. package/esm/contracts/result/usage.type.d.mts.map +1 -1
  196. package/esm/contracts/result/workflow-result.type.d.mts +1 -1
  197. package/esm/contracts/result/workflow-result.type.d.mts.map +1 -1
  198. package/esm/contracts/sdk-adapter.contract.d.mts +1 -1
  199. package/esm/contracts/sdk-adapter.contract.d.mts.map +1 -1
  200. package/esm/contracts/speech-model.contract.d.mts +1 -1
  201. package/esm/contracts/speech-model.contract.d.mts.map +1 -1
  202. package/esm/contracts/stream/stream-event.type.d.mts +1 -1
  203. package/esm/contracts/stream/stream-event.type.d.mts.map +1 -1
  204. package/esm/contracts/stream/stream.contract.d.mts +1 -1
  205. package/esm/contracts/stream/stream.contract.d.mts.map +1 -1
  206. package/esm/contracts/streaming-tool-guard-config.type.d.mts +1 -1
  207. package/esm/contracts/streaming-tool-guard-config.type.d.mts.map +1 -1
  208. package/esm/contracts/supervisor/ack-entry.type.d.mts +1 -1
  209. package/esm/contracts/supervisor/ack-entry.type.d.mts.map +1 -1
  210. package/esm/contracts/supervisor/classifier-context.type.d.mts +1 -1
  211. package/esm/contracts/supervisor/classifier-context.type.d.mts.map +1 -1
  212. package/esm/contracts/supervisor/dispatch-context.type.d.mts +1 -1
  213. package/esm/contracts/supervisor/dispatch-context.type.d.mts.map +1 -1
  214. package/esm/contracts/supervisor/evaluate-context.type.d.mts +1 -1
  215. package/esm/contracts/supervisor/evaluate-context.type.d.mts.map +1 -1
  216. package/esm/contracts/supervisor/intent-entry.type.d.mts +1 -1
  217. package/esm/contracts/supervisor/intent-entry.type.d.mts.map +1 -1
  218. package/esm/contracts/supervisor/iteration-snapshot.type.d.mts +1 -1
  219. package/esm/contracts/supervisor/iteration-snapshot.type.d.mts.map +1 -1
  220. package/esm/contracts/supervisor/next.type.d.mts +1 -1
  221. package/esm/contracts/supervisor/next.type.d.mts.map +1 -1
  222. package/esm/contracts/supervisor/route-context.type.d.mts +1 -1
  223. package/esm/contracts/supervisor/route-context.type.d.mts.map +1 -1
  224. package/esm/contracts/supervisor/router-entry.type.d.mts +1 -1
  225. package/esm/contracts/supervisor/router-entry.type.d.mts.map +1 -1
  226. package/esm/contracts/supervisor/supervisor-config.type.d.mts +1 -1
  227. package/esm/contracts/supervisor/supervisor-config.type.d.mts.map +1 -1
  228. package/esm/contracts/supervisor/supervisor-execute-options.type.d.mts +1 -1
  229. package/esm/contracts/supervisor/supervisor-execute-options.type.d.mts.map +1 -1
  230. package/esm/contracts/supervisor/supervisor-input.type.d.mts +1 -1
  231. package/esm/contracts/supervisor/supervisor-input.type.d.mts.map +1 -1
  232. package/esm/contracts/supervisor/supervisor-snapshot.type.d.mts +1 -1
  233. package/esm/contracts/supervisor/supervisor-snapshot.type.d.mts.map +1 -1
  234. package/esm/contracts/supervisor/supervisor-stream-event.type.d.mts +1 -1
  235. package/esm/contracts/supervisor/supervisor-stream-event.type.d.mts.map +1 -1
  236. package/esm/contracts/supervisor/supervisor.contract.d.mts +1 -1
  237. package/esm/contracts/supervisor/supervisor.contract.d.mts.map +1 -1
  238. package/esm/contracts/system-prompt.contract.d.mts +1 -1
  239. package/esm/contracts/system-prompt.contract.d.mts.map +1 -1
  240. package/esm/contracts/team/team-config.type.d.mts +1 -1
  241. package/esm/contracts/team/team-config.type.d.mts.map +1 -1
  242. package/esm/contracts/tool.contract.d.mts +1 -1
  243. package/esm/contracts/tool.contract.d.mts.map +1 -1
  244. package/esm/contracts/transcription-model.contract.d.mts +1 -1
  245. package/esm/contracts/transcription-model.contract.d.mts.map +1 -1
  246. package/esm/contracts/workflow/next-step-result.type.d.mts +1 -1
  247. package/esm/contracts/workflow/next-step-result.type.d.mts.map +1 -1
  248. package/esm/contracts/workflow/retry-config.type.d.mts +1 -1
  249. package/esm/contracts/workflow/retry-config.type.d.mts.map +1 -1
  250. package/esm/contracts/workflow/step.contract.d.mts +1 -1
  251. package/esm/contracts/workflow/step.contract.d.mts.map +1 -1
  252. package/esm/contracts/workflow/workflow-context.type.d.mts +1 -1
  253. package/esm/contracts/workflow/workflow-context.type.d.mts.map +1 -1
  254. package/esm/contracts/workflow/workflow-snapshot.type.d.mts +1 -1
  255. package/esm/contracts/workflow/workflow-snapshot.type.d.mts.map +1 -1
  256. package/esm/contracts/workflow/workflow.contract.d.mts +1 -1
  257. package/esm/contracts/workflow/workflow.contract.d.mts.map +1 -1
  258. package/esm/errors/agent-cancelled-error.d.mts +1 -1
  259. package/esm/errors/agent-cancelled-error.d.mts.map +1 -1
  260. package/esm/errors/agent-cancelled-error.mjs +1 -1
  261. package/esm/errors/agent-cancelled-error.mjs.map +1 -1
  262. package/esm/errors/agent-drift-error.d.mts +1 -1
  263. package/esm/errors/agent-drift-error.d.mts.map +1 -1
  264. package/esm/errors/agent-drift-error.mjs +1 -1
  265. package/esm/errors/agent-drift-error.mjs.map +1 -1
  266. package/esm/errors/agent-execution-error.d.mts +1 -1
  267. package/esm/errors/agent-execution-error.d.mts.map +1 -1
  268. package/esm/errors/agent-execution-error.mjs +1 -1
  269. package/esm/errors/agent-execution-error.mjs.map +1 -1
  270. package/esm/errors/agent-max-trips-error.d.mts +1 -1
  271. package/esm/errors/agent-max-trips-error.d.mts.map +1 -1
  272. package/esm/errors/agent-max-trips-error.mjs +1 -1
  273. package/esm/errors/agent-max-trips-error.mjs.map +1 -1
  274. package/esm/errors/ai-error.d.mts +1 -1
  275. package/esm/errors/ai-error.d.mts.map +1 -1
  276. package/esm/errors/ai-error.mjs +1 -1
  277. package/esm/errors/ai-error.mjs.map +1 -1
  278. package/esm/errors/budget-exceeded-error.d.mts +1 -1
  279. package/esm/errors/budget-exceeded-error.d.mts.map +1 -1
  280. package/esm/errors/budget-exceeded-error.mjs +1 -1
  281. package/esm/errors/budget-exceeded-error.mjs.map +1 -1
  282. package/esm/errors/content-filter-error.d.mts +1 -1
  283. package/esm/errors/content-filter-error.d.mts.map +1 -1
  284. package/esm/errors/content-filter-error.mjs +1 -1
  285. package/esm/errors/content-filter-error.mjs.map +1 -1
  286. package/esm/errors/context-length-exceeded-error.d.mts +1 -1
  287. package/esm/errors/context-length-exceeded-error.d.mts.map +1 -1
  288. package/esm/errors/context-length-exceeded-error.mjs +1 -1
  289. package/esm/errors/context-length-exceeded-error.mjs.map +1 -1
  290. package/esm/errors/error-category.type.d.mts +1 -1
  291. package/esm/errors/error-category.type.d.mts.map +1 -1
  292. package/esm/errors/error-code.type.d.mts +1 -1
  293. package/esm/errors/error-code.type.d.mts.map +1 -1
  294. package/esm/errors/guardrail-violation-error.d.mts +1 -1
  295. package/esm/errors/guardrail-violation-error.d.mts.map +1 -1
  296. package/esm/errors/guardrail-violation-error.mjs +1 -1
  297. package/esm/errors/guardrail-violation-error.mjs.map +1 -1
  298. package/esm/errors/invalid-request-error.d.mts +1 -1
  299. package/esm/errors/invalid-request-error.d.mts.map +1 -1
  300. package/esm/errors/invalid-request-error.mjs +1 -1
  301. package/esm/errors/invalid-request-error.mjs.map +1 -1
  302. package/esm/errors/max-iterations-error.d.mts +1 -1
  303. package/esm/errors/max-iterations-error.d.mts.map +1 -1
  304. package/esm/errors/max-iterations-error.mjs +1 -1
  305. package/esm/errors/max-iterations-error.mjs.map +1 -1
  306. package/esm/errors/max-steps-exceeded-error.d.mts +1 -1
  307. package/esm/errors/max-steps-exceeded-error.d.mts.map +1 -1
  308. package/esm/errors/max-steps-exceeded-error.mjs +1 -1
  309. package/esm/errors/max-steps-exceeded-error.mjs.map +1 -1
  310. package/esm/errors/orchestrator-cancelled-error.d.mts +1 -1
  311. package/esm/errors/orchestrator-cancelled-error.d.mts.map +1 -1
  312. package/esm/errors/orchestrator-cancelled-error.mjs +1 -1
  313. package/esm/errors/orchestrator-cancelled-error.mjs.map +1 -1
  314. package/esm/errors/orchestrator-config-error.d.mts +1 -1
  315. package/esm/errors/orchestrator-config-error.d.mts.map +1 -1
  316. package/esm/errors/orchestrator-config-error.mjs +1 -1
  317. package/esm/errors/orchestrator-config-error.mjs.map +1 -1
  318. package/esm/errors/orchestrator-drift-error.d.mts +1 -1
  319. package/esm/errors/orchestrator-drift-error.d.mts.map +1 -1
  320. package/esm/errors/orchestrator-drift-error.mjs +1 -1
  321. package/esm/errors/orchestrator-drift-error.mjs.map +1 -1
  322. package/esm/errors/orchestrator-failed-error.d.mts +1 -1
  323. package/esm/errors/orchestrator-failed-error.d.mts.map +1 -1
  324. package/esm/errors/orchestrator-failed-error.mjs +1 -1
  325. package/esm/errors/orchestrator-failed-error.mjs.map +1 -1
  326. package/esm/errors/outbound-policy-error.d.mts +1 -1
  327. package/esm/errors/outbound-policy-error.d.mts.map +1 -1
  328. package/esm/errors/outbound-policy-error.mjs +1 -1
  329. package/esm/errors/outbound-policy-error.mjs.map +1 -1
  330. package/esm/errors/planner-cancelled-error.d.mts +1 -1
  331. package/esm/errors/planner-cancelled-error.d.mts.map +1 -1
  332. package/esm/errors/planner-cancelled-error.mjs +1 -1
  333. package/esm/errors/planner-cancelled-error.mjs.map +1 -1
  334. package/esm/errors/planner-drift-error.d.mts +1 -1
  335. package/esm/errors/planner-drift-error.d.mts.map +1 -1
  336. package/esm/errors/planner-drift-error.mjs +1 -1
  337. package/esm/errors/planner-drift-error.mjs.map +1 -1
  338. package/esm/errors/planner-failed-error.d.mts +1 -1
  339. package/esm/errors/planner-failed-error.d.mts.map +1 -1
  340. package/esm/errors/planner-failed-error.mjs +1 -1
  341. package/esm/errors/planner-failed-error.mjs.map +1 -1
  342. package/esm/errors/planner-plan-invalid-error.d.mts +1 -1
  343. package/esm/errors/planner-plan-invalid-error.d.mts.map +1 -1
  344. package/esm/errors/planner-plan-invalid-error.mjs +1 -1
  345. package/esm/errors/planner-plan-invalid-error.mjs.map +1 -1
  346. package/esm/errors/prompt-refinement-error.d.mts +1 -1
  347. package/esm/errors/prompt-refinement-error.d.mts.map +1 -1
  348. package/esm/errors/prompt-refinement-error.mjs +1 -1
  349. package/esm/errors/prompt-refinement-error.mjs.map +1 -1
  350. package/esm/errors/provider-auth-error.d.mts +1 -1
  351. package/esm/errors/provider-auth-error.d.mts.map +1 -1
  352. package/esm/errors/provider-auth-error.mjs +1 -1
  353. package/esm/errors/provider-auth-error.mjs.map +1 -1
  354. package/esm/errors/provider-error.d.mts +1 -1
  355. package/esm/errors/provider-error.d.mts.map +1 -1
  356. package/esm/errors/provider-error.mjs +1 -1
  357. package/esm/errors/provider-error.mjs.map +1 -1
  358. package/esm/errors/provider-rate-limit-error.d.mts +1 -1
  359. package/esm/errors/provider-rate-limit-error.d.mts.map +1 -1
  360. package/esm/errors/provider-rate-limit-error.mjs +1 -1
  361. package/esm/errors/provider-rate-limit-error.mjs.map +1 -1
  362. package/esm/errors/provider-timeout-error.d.mts +1 -1
  363. package/esm/errors/provider-timeout-error.d.mts.map +1 -1
  364. package/esm/errors/provider-timeout-error.mjs +1 -1
  365. package/esm/errors/provider-timeout-error.mjs.map +1 -1
  366. package/esm/errors/quota-exceeded-error.d.mts +1 -1
  367. package/esm/errors/quota-exceeded-error.d.mts.map +1 -1
  368. package/esm/errors/quota-exceeded-error.mjs +1 -1
  369. package/esm/errors/quota-exceeded-error.mjs.map +1 -1
  370. package/esm/errors/routing-error.d.mts +1 -1
  371. package/esm/errors/routing-error.d.mts.map +1 -1
  372. package/esm/errors/routing-error.mjs +1 -1
  373. package/esm/errors/routing-error.mjs.map +1 -1
  374. package/esm/errors/schema-validation-error.d.mts +1 -1
  375. package/esm/errors/schema-validation-error.d.mts.map +1 -1
  376. package/esm/errors/schema-validation-error.mjs +1 -1
  377. package/esm/errors/schema-validation-error.mjs.map +1 -1
  378. package/esm/errors/step-failed-error.d.mts +1 -1
  379. package/esm/errors/step-failed-error.d.mts.map +1 -1
  380. package/esm/errors/step-failed-error.mjs +1 -1
  381. package/esm/errors/step-failed-error.mjs.map +1 -1
  382. package/esm/errors/supervisor-cancelled-error.d.mts +1 -1
  383. package/esm/errors/supervisor-cancelled-error.d.mts.map +1 -1
  384. package/esm/errors/supervisor-cancelled-error.mjs +1 -1
  385. package/esm/errors/supervisor-cancelled-error.mjs.map +1 -1
  386. package/esm/errors/supervisor-drift-error.d.mts +1 -1
  387. package/esm/errors/supervisor-drift-error.d.mts.map +1 -1
  388. package/esm/errors/supervisor-drift-error.mjs +1 -1
  389. package/esm/errors/supervisor-drift-error.mjs.map +1 -1
  390. package/esm/errors/supervisor-failed-error.d.mts +1 -1
  391. package/esm/errors/supervisor-failed-error.d.mts.map +1 -1
  392. package/esm/errors/supervisor-failed-error.mjs +1 -1
  393. package/esm/errors/supervisor-failed-error.mjs.map +1 -1
  394. package/esm/errors/supervisor-routing-error.d.mts +1 -1
  395. package/esm/errors/supervisor-routing-error.d.mts.map +1 -1
  396. package/esm/errors/supervisor-routing-error.mjs +1 -1
  397. package/esm/errors/supervisor-routing-error.mjs.map +1 -1
  398. package/esm/errors/tool-execution-error.d.mts +1 -1
  399. package/esm/errors/tool-execution-error.d.mts.map +1 -1
  400. package/esm/errors/tool-execution-error.mjs +1 -1
  401. package/esm/errors/tool-execution-error.mjs.map +1 -1
  402. package/esm/errors/workflow-cancelled-error.d.mts +1 -1
  403. package/esm/errors/workflow-cancelled-error.d.mts.map +1 -1
  404. package/esm/errors/workflow-cancelled-error.mjs +1 -1
  405. package/esm/errors/workflow-cancelled-error.mjs.map +1 -1
  406. package/esm/errors/workflow-drift-error.d.mts +1 -1
  407. package/esm/errors/workflow-drift-error.d.mts.map +1 -1
  408. package/esm/errors/workflow-drift-error.mjs +1 -1
  409. package/esm/errors/workflow-drift-error.mjs.map +1 -1
  410. package/esm/errors/workflow-error.d.mts +1 -1
  411. package/esm/errors/workflow-error.d.mts.map +1 -1
  412. package/esm/errors/workflow-error.mjs +1 -1
  413. package/esm/errors/workflow-error.mjs.map +1 -1
  414. package/esm/eval/dataset.d.mts +1 -1
  415. package/esm/eval/dataset.d.mts.map +1 -1
  416. package/esm/eval/dataset.mjs +1 -1
  417. package/esm/eval/dataset.mjs.map +1 -1
  418. package/esm/eval/dataset.type.d.mts +1 -1
  419. package/esm/eval/dataset.type.d.mts.map +1 -1
  420. package/esm/eval/eval-runner.d.mts +1 -1
  421. package/esm/eval/eval-runner.d.mts.map +1 -1
  422. package/esm/eval/eval-runner.mjs +1 -1
  423. package/esm/eval/eval-runner.mjs.map +1 -1
  424. package/esm/eval/index.d.mts +1 -1
  425. package/esm/eval/index.d.mts.map +1 -1
  426. package/esm/eval/index.mjs +1 -1
  427. package/esm/eval/index.mjs.map +1 -1
  428. package/esm/eval/judge-scorer.d.mts +1 -1
  429. package/esm/eval/judge-scorer.d.mts.map +1 -1
  430. package/esm/eval/judge-scorer.mjs +1 -1
  431. package/esm/eval/judge-scorer.mjs.map +1 -1
  432. package/esm/eval/regression.d.mts +1 -1
  433. package/esm/eval/regression.d.mts.map +1 -1
  434. package/esm/eval/regression.mjs +1 -1
  435. package/esm/eval/regression.mjs.map +1 -1
  436. package/esm/eval/report-json.d.mts +1 -1
  437. package/esm/eval/report-json.d.mts.map +1 -1
  438. package/esm/eval/report-json.mjs +1 -1
  439. package/esm/eval/report-json.mjs.map +1 -1
  440. package/esm/eval/report-junit.d.mts +1 -1
  441. package/esm/eval/report-junit.d.mts.map +1 -1
  442. package/esm/eval/report-junit.mjs +1 -1
  443. package/esm/eval/report-junit.mjs.map +1 -1
  444. package/esm/eval/scorers.d.mts +1 -1
  445. package/esm/eval/scorers.d.mts.map +1 -1
  446. package/esm/eval/scorers.mjs +1 -1
  447. package/esm/eval/scorers.mjs.map +1 -1
  448. package/esm/guard/contracts/guard-options.type.d.mts +1 -1
  449. package/esm/guard/contracts/guard-options.type.d.mts.map +1 -1
  450. package/esm/guard/contracts/guardrail.contract.d.mts +1 -1
  451. package/esm/guard/contracts/guardrail.contract.d.mts.map +1 -1
  452. package/esm/guard/contracts/openai-client.contract.d.mts +1 -1
  453. package/esm/guard/contracts/openai-client.contract.d.mts.map +1 -1
  454. package/esm/guard/contracts/verdict.type.d.mts +1 -1
  455. package/esm/guard/contracts/verdict.type.d.mts.map +1 -1
  456. package/esm/guard/detectors/injection.d.mts +1 -1
  457. package/esm/guard/detectors/injection.d.mts.map +1 -1
  458. package/esm/guard/detectors/injection.mjs +1 -1
  459. package/esm/guard/detectors/injection.mjs.map +1 -1
  460. package/esm/guard/detectors/moderation.d.mts +1 -1
  461. package/esm/guard/detectors/moderation.d.mts.map +1 -1
  462. package/esm/guard/detectors/moderation.mjs +1 -1
  463. package/esm/guard/detectors/moderation.mjs.map +1 -1
  464. package/esm/guard/detectors/pii.d.mts +1 -1
  465. package/esm/guard/detectors/pii.d.mts.map +1 -1
  466. package/esm/guard/detectors/pii.mjs +1 -1
  467. package/esm/guard/detectors/pii.mjs.map +1 -1
  468. package/esm/guard/detectors/topic.d.mts +1 -1
  469. package/esm/guard/detectors/topic.d.mts.map +1 -1
  470. package/esm/guard/detectors/topic.mjs +1 -1
  471. package/esm/guard/detectors/topic.mjs.map +1 -1
  472. package/esm/guard/errors.d.mts +1 -1
  473. package/esm/guard/errors.d.mts.map +1 -1
  474. package/esm/guard/errors.mjs +1 -1
  475. package/esm/guard/errors.mjs.map +1 -1
  476. package/esm/guard/guard.d.mts +1 -1
  477. package/esm/guard/guard.d.mts.map +1 -1
  478. package/esm/guard/guard.mjs +1 -1
  479. package/esm/guard/guard.mjs.map +1 -1
  480. package/esm/guard/guardrail.d.mts +1 -1
  481. package/esm/guard/guardrail.d.mts.map +1 -1
  482. package/esm/guard/guardrail.mjs +1 -1
  483. package/esm/guard/guardrail.mjs.map +1 -1
  484. package/esm/human/contracts/approval.type.d.mts +1 -1
  485. package/esm/human/contracts/approval.type.d.mts.map +1 -1
  486. package/esm/human/contracts/human-approval.type.d.mts +1 -1
  487. package/esm/human/contracts/human-approval.type.d.mts.map +1 -1
  488. package/esm/human/contracts/interrupt-store.contract.d.mts +1 -1
  489. package/esm/human/contracts/interrupt-store.contract.d.mts.map +1 -1
  490. package/esm/human/contracts/resume.type.d.mts +1 -1
  491. package/esm/human/contracts/resume.type.d.mts.map +1 -1
  492. package/esm/human/errors.d.mts +1 -1
  493. package/esm/human/errors.d.mts.map +1 -1
  494. package/esm/human/errors.mjs +1 -1
  495. package/esm/human/errors.mjs.map +1 -1
  496. package/esm/human/human-approval.d.mts +1 -1
  497. package/esm/human/human-approval.d.mts.map +1 -1
  498. package/esm/human/human-approval.mjs +1 -1
  499. package/esm/human/human-approval.mjs.map +1 -1
  500. package/esm/human/policy.d.mts +1 -1
  501. package/esm/human/policy.d.mts.map +1 -1
  502. package/esm/human/policy.mjs +1 -1
  503. package/esm/human/policy.mjs.map +1 -1
  504. package/esm/human/register.mjs +1 -1
  505. package/esm/human/register.mjs.map +1 -1
  506. package/esm/human/resume-seed.mjs +1 -1
  507. package/esm/human/resume-seed.mjs.map +1 -1
  508. package/esm/human/resume.d.mts +1 -1
  509. package/esm/human/resume.d.mts.map +1 -1
  510. package/esm/human/resume.mjs +1 -1
  511. package/esm/human/resume.mjs.map +1 -1
  512. package/esm/human/stores/memory.d.mts +1 -1
  513. package/esm/human/stores/memory.d.mts.map +1 -1
  514. package/esm/human/stores/memory.mjs +1 -1
  515. package/esm/human/stores/memory.mjs.map +1 -1
  516. package/esm/human/stores/pg.d.mts +1 -1
  517. package/esm/human/stores/pg.d.mts.map +1 -1
  518. package/esm/human/stores/pg.mjs +1 -1
  519. package/esm/human/stores/pg.mjs.map +1 -1
  520. package/esm/human/stores/redis.d.mts +1 -1
  521. package/esm/human/stores/redis.d.mts.map +1 -1
  522. package/esm/human/stores/redis.mjs +1 -1
  523. package/esm/human/stores/redis.mjs.map +1 -1
  524. package/esm/image/image-cost.d.mts +1 -1
  525. package/esm/image/image-cost.d.mts.map +1 -1
  526. package/esm/image/image-cost.mjs +1 -1
  527. package/esm/image/image-cost.mjs.map +1 -1
  528. package/esm/image/image.d.mts +1 -1
  529. package/esm/image/image.d.mts.map +1 -1
  530. package/esm/image/image.mjs +1 -1
  531. package/esm/image/image.mjs.map +1 -1
  532. package/esm/memory/derive-id.mjs +1 -1
  533. package/esm/memory/derive-id.mjs.map +1 -1
  534. package/esm/memory/episodic-memory.mjs +1 -1
  535. package/esm/memory/episodic-memory.mjs.map +1 -1
  536. package/esm/memory/memory.d.mts +1 -1
  537. package/esm/memory/memory.d.mts.map +1 -1
  538. package/esm/memory/memory.mjs +1 -1
  539. package/esm/memory/memory.mjs.map +1 -1
  540. package/esm/memory/procedural-memory.mjs +1 -1
  541. package/esm/memory/procedural-memory.mjs.map +1 -1
  542. package/esm/memory/semantic-memory.mjs +1 -1
  543. package/esm/memory/semantic-memory.mjs.map +1 -1
  544. package/esm/memory/working-memory.mjs +1 -1
  545. package/esm/memory/working-memory.mjs.map +1 -1
  546. package/esm/middleware/builtins/budget-contract.type.d.mts +1 -1
  547. package/esm/middleware/builtins/budget-contract.type.d.mts.map +1 -1
  548. package/esm/middleware/builtins/budget.d.mts +1 -1
  549. package/esm/middleware/builtins/budget.d.mts.map +1 -1
  550. package/esm/middleware/builtins/budget.mjs +1 -1
  551. package/esm/middleware/builtins/budget.mjs.map +1 -1
  552. package/esm/middleware/builtins/guardrail.d.mts +1 -1
  553. package/esm/middleware/builtins/guardrail.d.mts.map +1 -1
  554. package/esm/middleware/builtins/guardrail.mjs +1 -1
  555. package/esm/middleware/builtins/guardrail.mjs.map +1 -1
  556. package/esm/middleware/builtins/semantic-cache.d.mts +1 -1
  557. package/esm/middleware/builtins/semantic-cache.d.mts.map +1 -1
  558. package/esm/middleware/builtins/semantic-cache.mjs +1 -1
  559. package/esm/middleware/builtins/semantic-cache.mjs.map +1 -1
  560. package/esm/middleware/helpers/compose.d.mts +1 -1
  561. package/esm/middleware/helpers/compose.d.mts.map +1 -1
  562. package/esm/middleware/helpers/compose.mjs +1 -1
  563. package/esm/middleware/helpers/compose.mjs.map +1 -1
  564. package/esm/middleware/helpers/for-tool.d.mts +1 -1
  565. package/esm/middleware/helpers/for-tool.d.mts.map +1 -1
  566. package/esm/middleware/helpers/for-tool.mjs +1 -1
  567. package/esm/middleware/helpers/for-tool.mjs.map +1 -1
  568. package/esm/middleware/pipeline.d.mts +1 -1
  569. package/esm/middleware/pipeline.d.mts.map +1 -1
  570. package/esm/middleware/pipeline.mjs +1 -1
  571. package/esm/middleware/pipeline.mjs.map +1 -1
  572. package/esm/middleware/utils/extract-user-text.d.mts +1 -1
  573. package/esm/middleware/utils/extract-user-text.d.mts.map +1 -1
  574. package/esm/middleware/utils/extract-user-text.mjs +1 -1
  575. package/esm/middleware/utils/extract-user-text.mjs.map +1 -1
  576. package/esm/middleware/utils/namespaced-state.d.mts +1 -1
  577. package/esm/middleware/utils/namespaced-state.d.mts.map +1 -1
  578. package/esm/middleware/utils/namespaced-state.mjs +1 -1
  579. package/esm/middleware/utils/namespaced-state.mjs.map +1 -1
  580. package/esm/mock/mock-agent.d.mts +1 -1
  581. package/esm/mock/mock-agent.d.mts.map +1 -1
  582. package/esm/mock/mock-agent.mjs +1 -1
  583. package/esm/mock/mock-agent.mjs.map +1 -1
  584. package/esm/mock/mock-config.type.d.mts +1 -1
  585. package/esm/mock/mock-config.type.d.mts.map +1 -1
  586. package/esm/mock/mock-image-model.d.mts +1 -1
  587. package/esm/mock/mock-image-model.d.mts.map +1 -1
  588. package/esm/mock/mock-image-model.mjs +1 -1
  589. package/esm/mock/mock-image-model.mjs.map +1 -1
  590. package/esm/mock/mock-model.d.mts +1 -1
  591. package/esm/mock/mock-model.d.mts.map +1 -1
  592. package/esm/mock/mock-model.mjs +1 -1
  593. package/esm/mock/mock-model.mjs.map +1 -1
  594. package/esm/mock/mock-router.d.mts +1 -1
  595. package/esm/mock/mock-router.d.mts.map +1 -1
  596. package/esm/mock/mock-router.mjs +1 -1
  597. package/esm/mock/mock-router.mjs.map +1 -1
  598. package/esm/mock/mock-sdk.d.mts +1 -1
  599. package/esm/mock/mock-sdk.d.mts.map +1 -1
  600. package/esm/mock/mock-sdk.mjs +1 -1
  601. package/esm/mock/mock-sdk.mjs.map +1 -1
  602. package/esm/mock/mock-speech-model.d.mts +1 -1
  603. package/esm/mock/mock-speech-model.d.mts.map +1 -1
  604. package/esm/mock/mock-speech-model.mjs +1 -1
  605. package/esm/mock/mock-speech-model.mjs.map +1 -1
  606. package/esm/mock/mock-transcription-model.d.mts +1 -1
  607. package/esm/mock/mock-transcription-model.d.mts.map +1 -1
  608. package/esm/mock/mock-transcription-model.mjs +1 -1
  609. package/esm/mock/mock-transcription-model.mjs.map +1 -1
  610. package/esm/model/fallback-model.d.mts +1 -1
  611. package/esm/model/fallback-model.d.mts.map +1 -1
  612. package/esm/model/fallback-model.mjs +1 -1
  613. package/esm/model/fallback-model.mjs.map +1 -1
  614. package/esm/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +1 -1
  615. package/esm/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +1 -1
  616. package/esm/node_modules/@vitest/expect/dist/index.mjs +1 -1
  617. package/esm/node_modules/@vitest/expect/dist/index.mjs.map +1 -1
  618. package/esm/node_modules/@vitest/pretty-format/dist/index.mjs +1 -1
  619. package/esm/node_modules/@vitest/pretty-format/dist/index.mjs.map +1 -1
  620. package/esm/node_modules/@vitest/runner/dist/chunk-artifact.mjs +1 -1
  621. package/esm/node_modules/@vitest/runner/dist/chunk-artifact.mjs.map +1 -1
  622. package/esm/node_modules/@vitest/snapshot/dist/index.mjs +1 -1
  623. package/esm/node_modules/@vitest/snapshot/dist/index.mjs.map +1 -1
  624. package/esm/node_modules/@vitest/spy/dist/index.mjs +1 -1
  625. package/esm/node_modules/@vitest/spy/dist/index.mjs.map +1 -1
  626. package/esm/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs +1 -1
  627. package/esm/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs.map +1 -1
  628. package/esm/node_modules/@vitest/utils/dist/diff.mjs +1 -1
  629. package/esm/node_modules/@vitest/utils/dist/diff.mjs.map +1 -1
  630. package/esm/node_modules/@vitest/utils/dist/display.mjs +1 -1
  631. package/esm/node_modules/@vitest/utils/dist/display.mjs.map +1 -1
  632. package/esm/node_modules/@vitest/utils/dist/error.mjs +1 -1
  633. package/esm/node_modules/@vitest/utils/dist/error.mjs.map +1 -1
  634. package/esm/node_modules/@vitest/utils/dist/helpers.mjs +1 -1
  635. package/esm/node_modules/@vitest/utils/dist/helpers.mjs.map +1 -1
  636. package/esm/node_modules/@vitest/utils/dist/offset.mjs +1 -1
  637. package/esm/node_modules/@vitest/utils/dist/offset.mjs.map +1 -1
  638. package/esm/node_modules/@vitest/utils/dist/serialize.mjs +1 -1
  639. package/esm/node_modules/@vitest/utils/dist/serialize.mjs.map +1 -1
  640. package/esm/node_modules/@vitest/utils/dist/source-map.mjs +1 -1
  641. package/esm/node_modules/@vitest/utils/dist/source-map.mjs.map +1 -1
  642. package/esm/node_modules/@vitest/utils/dist/timers.mjs +1 -1
  643. package/esm/node_modules/@vitest/utils/dist/timers.mjs.map +1 -1
  644. package/esm/node_modules/chai/index.mjs +1 -1
  645. package/esm/node_modules/chai/index.mjs.map +1 -1
  646. package/esm/node_modules/magic-string/dist/magic-string.es.mjs +1 -1
  647. package/esm/node_modules/magic-string/dist/magic-string.es.mjs.map +1 -1
  648. package/esm/node_modules/tinyrainbow/dist/index.mjs +1 -1
  649. package/esm/node_modules/tinyrainbow/dist/index.mjs.map +1 -1
  650. package/esm/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs +1 -1
  651. package/esm/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs.map +1 -1
  652. package/esm/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs +1 -1
  653. package/esm/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs.map +1 -1
  654. package/esm/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs +1 -1
  655. package/esm/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs.map +1 -1
  656. package/esm/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs +1 -1
  657. package/esm/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs.map +1 -1
  658. package/esm/object-stream/parse-partial-json.d.mts +1 -1
  659. package/esm/object-stream/parse-partial-json.d.mts.map +1 -1
  660. package/esm/object-stream/parse-partial-json.mjs +1 -1
  661. package/esm/object-stream/parse-partial-json.mjs.map +1 -1
  662. package/esm/object-stream/stream-object.d.mts +1 -1
  663. package/esm/object-stream/stream-object.d.mts.map +1 -1
  664. package/esm/object-stream/stream-object.mjs +1 -1
  665. package/esm/object-stream/stream-object.mjs.map +1 -1
  666. package/esm/observe/observer-registry.d.mts +1 -1
  667. package/esm/observe/observer-registry.d.mts.map +1 -1
  668. package/esm/observe/observer-registry.mjs +1 -1
  669. package/esm/observe/observer-registry.mjs.map +1 -1
  670. package/esm/observe/observer.contract.d.mts +1 -1
  671. package/esm/observe/observer.contract.d.mts.map +1 -1
  672. package/esm/observe/resolve-observers.d.mts +1 -1
  673. package/esm/observe/resolve-observers.d.mts.map +1 -1
  674. package/esm/observe/resolve-observers.mjs +1 -1
  675. package/esm/observe/resolve-observers.mjs.map +1 -1
  676. package/esm/orchestrator/as-tool.d.mts +1 -1
  677. package/esm/orchestrator/as-tool.d.mts.map +1 -1
  678. package/esm/orchestrator/as-tool.mjs +1 -1
  679. package/esm/orchestrator/as-tool.mjs.map +1 -1
  680. package/esm/orchestrator/checkpoint.mjs +1 -1
  681. package/esm/orchestrator/checkpoint.mjs.map +1 -1
  682. package/esm/orchestrator/commands.d.mts +1 -1
  683. package/esm/orchestrator/commands.d.mts.map +1 -1
  684. package/esm/orchestrator/commands.mjs +1 -1
  685. package/esm/orchestrator/commands.mjs.map +1 -1
  686. package/esm/orchestrator/compaction.mjs +1 -1
  687. package/esm/orchestrator/compaction.mjs.map +1 -1
  688. package/esm/orchestrator/dispatch.mjs +1 -1
  689. package/esm/orchestrator/dispatch.mjs.map +1 -1
  690. package/esm/orchestrator/emitter-port.type.d.mts +1 -1
  691. package/esm/orchestrator/emitter-port.type.d.mts.map +1 -1
  692. package/esm/orchestrator/emitter.d.mts +1 -1
  693. package/esm/orchestrator/emitter.d.mts.map +1 -1
  694. package/esm/orchestrator/emitter.mjs +1 -1
  695. package/esm/orchestrator/emitter.mjs.map +1 -1
  696. package/esm/orchestrator/engine-context.type.d.mts +1 -1
  697. package/esm/orchestrator/engine-context.type.d.mts.map +1 -1
  698. package/esm/orchestrator/execution.d.mts +1 -1
  699. package/esm/orchestrator/execution.d.mts.map +1 -1
  700. package/esm/orchestrator/execution.mjs +1 -1
  701. package/esm/orchestrator/execution.mjs.map +1 -1
  702. package/esm/orchestrator/load.mjs +1 -1
  703. package/esm/orchestrator/load.mjs.map +1 -1
  704. package/esm/orchestrator/lock.mjs +1 -1
  705. package/esm/orchestrator/lock.mjs.map +1 -1
  706. package/esm/orchestrator/memory.d.mts +1 -1
  707. package/esm/orchestrator/memory.d.mts.map +1 -1
  708. package/esm/orchestrator/memory.mjs +1 -1
  709. package/esm/orchestrator/memory.mjs.map +1 -1
  710. package/esm/orchestrator/orchestrator-stream.d.mts +1 -1
  711. package/esm/orchestrator/orchestrator-stream.d.mts.map +1 -1
  712. package/esm/orchestrator/orchestrator-stream.mjs +1 -1
  713. package/esm/orchestrator/orchestrator-stream.mjs.map +1 -1
  714. package/esm/orchestrator/orchestrator.d.mts +1 -1
  715. package/esm/orchestrator/orchestrator.d.mts.map +1 -1
  716. package/esm/orchestrator/orchestrator.mjs +1 -1
  717. package/esm/orchestrator/orchestrator.mjs.map +1 -1
  718. package/esm/orchestrator/resume.mjs +1 -1
  719. package/esm/orchestrator/resume.mjs.map +1 -1
  720. package/esm/orchestrator/session-lock.d.mts +1 -1
  721. package/esm/orchestrator/session-lock.d.mts.map +1 -1
  722. package/esm/orchestrator/session-lock.mjs +1 -1
  723. package/esm/orchestrator/session-lock.mjs.map +1 -1
  724. package/esm/orchestrator/signature.d.mts +1 -1
  725. package/esm/orchestrator/signature.d.mts.map +1 -1
  726. package/esm/orchestrator/signature.mjs +1 -1
  727. package/esm/orchestrator/signature.mjs.map +1 -1
  728. package/esm/orchestrator/window.mjs +1 -1
  729. package/esm/orchestrator/window.mjs.map +1 -1
  730. package/esm/planner/dag-scheduler.mjs +1 -1
  731. package/esm/planner/dag-scheduler.mjs.map +1 -1
  732. package/esm/planner/plan-prompt.d.mts +1 -1
  733. package/esm/planner/plan-prompt.d.mts.map +1 -1
  734. package/esm/planner/plan-prompt.mjs +1 -1
  735. package/esm/planner/plan-prompt.mjs.map +1 -1
  736. package/esm/planner/plan-schema.d.mts +1 -1
  737. package/esm/planner/plan-schema.d.mts.map +1 -1
  738. package/esm/planner/plan-schema.mjs +1 -1
  739. package/esm/planner/plan-schema.mjs.map +1 -1
  740. package/esm/planner/planner-run.d.mts +1 -1
  741. package/esm/planner/planner-run.d.mts.map +1 -1
  742. package/esm/planner/planner-run.mjs +1 -1
  743. package/esm/planner/planner-run.mjs.map +1 -1
  744. package/esm/planner/planner.d.mts +1 -1
  745. package/esm/planner/planner.d.mts.map +1 -1
  746. package/esm/planner/planner.mjs +1 -1
  747. package/esm/planner/planner.mjs.map +1 -1
  748. package/esm/planner/signature.d.mts +1 -1
  749. package/esm/planner/signature.d.mts.map +1 -1
  750. package/esm/planner/signature.mjs +1 -1
  751. package/esm/planner/signature.mjs.map +1 -1
  752. package/esm/planner/snapshot.mjs +1 -1
  753. package/esm/planner/snapshot.mjs.map +1 -1
  754. package/esm/prompt/errors.d.mts +1 -1
  755. package/esm/prompt/errors.d.mts.map +1 -1
  756. package/esm/prompt/errors.mjs +1 -1
  757. package/esm/prompt/errors.mjs.map +1 -1
  758. package/esm/prompt/prompt-langfuse-sync.mjs +1 -1
  759. package/esm/prompt/prompt-langfuse-sync.mjs.map +1 -1
  760. package/esm/prompt/prompt-langfuse-sync.type.d.mts +1 -1
  761. package/esm/prompt/prompt-langfuse-sync.type.d.mts.map +1 -1
  762. package/esm/prompt/prompt-validate.mjs +1 -1
  763. package/esm/prompt/prompt-validate.mjs.map +1 -1
  764. package/esm/prompt/prompt.d.mts +1 -1
  765. package/esm/prompt/prompt.d.mts.map +1 -1
  766. package/esm/prompt/prompt.mjs +1 -1
  767. package/esm/prompt/prompt.mjs.map +1 -1
  768. package/esm/prompt/prompt.type.d.mts +1 -1
  769. package/esm/prompt/prompt.type.d.mts.map +1 -1
  770. package/esm/prompts/prompts-manager.contract.d.mts +1 -1
  771. package/esm/prompts/prompts-manager.contract.d.mts.map +1 -1
  772. package/esm/prompts/prompts-manager.d.mts +1 -1
  773. package/esm/prompts/prompts-manager.d.mts.map +1 -1
  774. package/esm/prompts/prompts-manager.mjs +1 -1
  775. package/esm/prompts/prompts-manager.mjs.map +1 -1
  776. package/esm/prompts/prompts-manager.type.d.mts +1 -1
  777. package/esm/prompts/prompts-manager.type.d.mts.map +1 -1
  778. package/esm/prompts/prompts-validate.d.mts +1 -1
  779. package/esm/prompts/prompts-validate.d.mts.map +1 -1
  780. package/esm/prompts/prompts-validate.mjs +0 -0
  781. package/esm/prompts/prompts-validate.mjs.map +1 -1
  782. package/esm/rag/as-tool.mjs +1 -1
  783. package/esm/rag/as-tool.mjs.map +1 -1
  784. package/esm/rag/chunk/chunk.d.mts +1 -1
  785. package/esm/rag/chunk/chunk.d.mts.map +1 -1
  786. package/esm/rag/chunk/chunk.mjs +1 -1
  787. package/esm/rag/chunk/chunk.mjs.map +1 -1
  788. package/esm/rag/chunk/fixed.mjs +1 -1
  789. package/esm/rag/chunk/fixed.mjs.map +1 -1
  790. package/esm/rag/chunk/markdown.mjs +1 -1
  791. package/esm/rag/chunk/markdown.mjs.map +1 -1
  792. package/esm/rag/chunk/recursive.mjs +1 -1
  793. package/esm/rag/chunk/recursive.mjs.map +1 -1
  794. package/esm/rag/chunk/sentence.mjs +1 -1
  795. package/esm/rag/chunk/sentence.mjs.map +1 -1
  796. package/esm/rag/contracts/chunk-options.type.d.mts +1 -1
  797. package/esm/rag/contracts/chunk-options.type.d.mts.map +1 -1
  798. package/esm/rag/contracts/citation.type.d.mts +1 -1
  799. package/esm/rag/contracts/citation.type.d.mts.map +1 -1
  800. package/esm/rag/contracts/rag-config.type.d.mts +1 -1
  801. package/esm/rag/contracts/rag-config.type.d.mts.map +1 -1
  802. package/esm/rag/contracts/rag-document.type.d.mts +1 -1
  803. package/esm/rag/contracts/rag-document.type.d.mts.map +1 -1
  804. package/esm/rag/hybrid/bm25.d.mts +1 -1
  805. package/esm/rag/hybrid/bm25.d.mts.map +1 -1
  806. package/esm/rag/hybrid/bm25.mjs +1 -1
  807. package/esm/rag/hybrid/bm25.mjs.map +1 -1
  808. package/esm/rag/hybrid/hybrid-rank.d.mts +1 -1
  809. package/esm/rag/hybrid/hybrid-rank.d.mts.map +1 -1
  810. package/esm/rag/hybrid/hybrid-rank.mjs +1 -1
  811. package/esm/rag/hybrid/hybrid-rank.mjs.map +1 -1
  812. package/esm/rag/hybrid/rrf.d.mts +1 -1
  813. package/esm/rag/hybrid/rrf.d.mts.map +1 -1
  814. package/esm/rag/hybrid/rrf.mjs +1 -1
  815. package/esm/rag/hybrid/rrf.mjs.map +1 -1
  816. package/esm/rag/loaders/errors.d.mts +1 -1
  817. package/esm/rag/loaders/errors.d.mts.map +1 -1
  818. package/esm/rag/loaders/errors.mjs +1 -1
  819. package/esm/rag/loaders/errors.mjs.map +1 -1
  820. package/esm/rag/loaders/load-html.d.mts +1 -1
  821. package/esm/rag/loaders/load-html.d.mts.map +1 -1
  822. package/esm/rag/loaders/load-html.mjs +1 -1
  823. package/esm/rag/loaders/load-html.mjs.map +1 -1
  824. package/esm/rag/loaders/load-pdf.d.mts +1 -1
  825. package/esm/rag/loaders/load-pdf.d.mts.map +1 -1
  826. package/esm/rag/loaders/load-pdf.mjs +1 -1
  827. package/esm/rag/loaders/load-pdf.mjs.map +1 -1
  828. package/esm/rag/loaders/load-text.d.mts +1 -1
  829. package/esm/rag/loaders/load-text.d.mts.map +1 -1
  830. package/esm/rag/loaders/load-text.mjs +1 -1
  831. package/esm/rag/loaders/load-text.mjs.map +1 -1
  832. package/esm/rag/loaders/load-web.d.mts +1 -1
  833. package/esm/rag/loaders/load-web.d.mts.map +1 -1
  834. package/esm/rag/loaders/load-web.mjs +1 -1
  835. package/esm/rag/loaders/load-web.mjs.map +1 -1
  836. package/esm/rag/loaders/loader.type.d.mts +1 -1
  837. package/esm/rag/loaders/loader.type.d.mts.map +1 -1
  838. package/esm/rag/rag.d.mts +1 -1
  839. package/esm/rag/rag.d.mts.map +1 -1
  840. package/esm/rag/rag.mjs +1 -1
  841. package/esm/rag/rag.mjs.map +1 -1
  842. package/esm/rag/rerank/keyword-reranker.d.mts +1 -1
  843. package/esm/rag/rerank/keyword-reranker.d.mts.map +1 -1
  844. package/esm/rag/rerank/keyword-reranker.mjs +1 -1
  845. package/esm/rag/rerank/keyword-reranker.mjs.map +1 -1
  846. package/esm/rag/rerank/llm-reranker.d.mts +1 -1
  847. package/esm/rag/rerank/llm-reranker.d.mts.map +1 -1
  848. package/esm/rag/rerank/llm-reranker.mjs +1 -1
  849. package/esm/rag/rerank/llm-reranker.mjs.map +1 -1
  850. package/esm/rag/rerank/reranker.contract.d.mts +1 -1
  851. package/esm/rag/rerank/reranker.contract.d.mts.map +1 -1
  852. package/esm/rag/retrieve.mjs +1 -1
  853. package/esm/rag/retrieve.mjs.map +1 -1
  854. package/esm/rag/store/cache-vector-store.d.mts +1 -1
  855. package/esm/rag/store/cache-vector-store.d.mts.map +1 -1
  856. package/esm/rag/store/cache-vector-store.mjs +1 -1
  857. package/esm/rag/store/cache-vector-store.mjs.map +1 -1
  858. package/esm/rag/store/pg-vector-store.d.mts +1 -1
  859. package/esm/rag/store/pg-vector-store.d.mts.map +1 -1
  860. package/esm/rag/store/pg-vector-store.mjs +1 -1
  861. package/esm/rag/store/pg-vector-store.mjs.map +1 -1
  862. package/esm/rag/store/vector-store.contract.d.mts +1 -1
  863. package/esm/rag/store/vector-store.contract.d.mts.map +1 -1
  864. package/esm/rag/transforms/multi-query.d.mts +1 -1
  865. package/esm/rag/transforms/multi-query.d.mts.map +1 -1
  866. package/esm/rag/transforms/multi-query.mjs +1 -1
  867. package/esm/rag/transforms/multi-query.mjs.map +1 -1
  868. package/esm/security/outbound-policy.d.mts +1 -1
  869. package/esm/security/outbound-policy.d.mts.map +1 -1
  870. package/esm/security/outbound-policy.mjs +1 -1
  871. package/esm/security/outbound-policy.mjs.map +1 -1
  872. package/esm/security/outbound-policy.type.d.mts +1 -1
  873. package/esm/security/outbound-policy.type.d.mts.map +1 -1
  874. package/esm/security/private-ip.d.mts +1 -1
  875. package/esm/security/private-ip.d.mts.map +1 -1
  876. package/esm/security/private-ip.mjs +1 -1
  877. package/esm/security/private-ip.mjs.map +1 -1
  878. package/esm/security/redact.d.mts +1 -1
  879. package/esm/security/redact.d.mts.map +1 -1
  880. package/esm/security/redact.mjs +1 -1
  881. package/esm/security/redact.mjs.map +1 -1
  882. package/esm/serve/serve.d.mts +1 -1
  883. package/esm/serve/serve.d.mts.map +1 -1
  884. package/esm/serve/serve.mjs +1 -1
  885. package/esm/serve/serve.mjs.map +1 -1
  886. package/esm/serve/sse.d.mts +1 -1
  887. package/esm/serve/sse.d.mts.map +1 -1
  888. package/esm/serve/sse.mjs +1 -1
  889. package/esm/serve/sse.mjs.map +1 -1
  890. package/esm/serve/stream-to-sse.d.mts +1 -1
  891. package/esm/serve/stream-to-sse.d.mts.map +1 -1
  892. package/esm/serve/stream-to-sse.mjs +1 -1
  893. package/esm/serve/stream-to-sse.mjs.map +1 -1
  894. package/esm/skills/catalog.d.mts +1 -1
  895. package/esm/skills/catalog.d.mts.map +1 -1
  896. package/esm/skills/catalog.mjs +1 -1
  897. package/esm/skills/catalog.mjs.map +1 -1
  898. package/esm/skills/contracts/skill-record.type.d.mts +1 -1
  899. package/esm/skills/contracts/skill-record.type.d.mts.map +1 -1
  900. package/esm/skills/contracts/skills-config.type.d.mts +1 -1
  901. package/esm/skills/contracts/skills-config.type.d.mts.map +1 -1
  902. package/esm/skills/contracts/skills-store.contract.d.mts +1 -1
  903. package/esm/skills/contracts/skills-store.contract.d.mts.map +1 -1
  904. package/esm/skills/contracts/skills.contract.d.mts +1 -1
  905. package/esm/skills/contracts/skills.contract.d.mts.map +1 -1
  906. package/esm/skills/load-skill-tool.d.mts +1 -1
  907. package/esm/skills/load-skill-tool.d.mts.map +1 -1
  908. package/esm/skills/load-skill-tool.mjs +1 -1
  909. package/esm/skills/load-skill-tool.mjs.map +1 -1
  910. package/esm/skills/review-gate.d.mts +1 -1
  911. package/esm/skills/review-gate.d.mts.map +1 -1
  912. package/esm/skills/review-gate.mjs +1 -1
  913. package/esm/skills/review-gate.mjs.map +1 -1
  914. package/esm/skills/save-skill-tool.d.mts +1 -1
  915. package/esm/skills/save-skill-tool.d.mts.map +1 -1
  916. package/esm/skills/save-skill-tool.mjs +1 -1
  917. package/esm/skills/save-skill-tool.mjs.map +1 -1
  918. package/esm/skills/skills.d.mts +1 -1
  919. package/esm/skills/skills.d.mts.map +1 -1
  920. package/esm/skills/skills.mjs +1 -1
  921. package/esm/skills/skills.mjs.map +1 -1
  922. package/esm/skills/sources/directory-source.d.mts +1 -1
  923. package/esm/skills/sources/directory-source.d.mts.map +1 -1
  924. package/esm/skills/sources/directory-source.mjs +1 -1
  925. package/esm/skills/sources/directory-source.mjs.map +1 -1
  926. package/esm/skills/sources/index.d.mts +1 -1
  927. package/esm/skills/sources/index.d.mts.map +1 -1
  928. package/esm/skills/sources/index.mjs +1 -1
  929. package/esm/skills/sources/index.mjs.map +1 -1
  930. package/esm/skills/sources/parse-frontmatter.d.mts +1 -1
  931. package/esm/skills/sources/parse-frontmatter.d.mts.map +1 -1
  932. package/esm/skills/sources/parse-frontmatter.mjs +1 -1
  933. package/esm/skills/sources/parse-frontmatter.mjs.map +1 -1
  934. package/esm/skills/sources/store-source.d.mts +1 -1
  935. package/esm/skills/sources/store-source.d.mts.map +1 -1
  936. package/esm/skills/sources/store-source.mjs +1 -1
  937. package/esm/skills/sources/store-source.mjs.map +1 -1
  938. package/esm/skills/sources/url-source.d.mts +1 -1
  939. package/esm/skills/sources/url-source.d.mts.map +1 -1
  940. package/esm/skills/sources/url-source.mjs +1 -1
  941. package/esm/skills/sources/url-source.mjs.map +1 -1
  942. package/esm/skills/store/mock-skills-store.d.mts +1 -1
  943. package/esm/skills/store/mock-skills-store.d.mts.map +1 -1
  944. package/esm/skills/store/mock-skills-store.mjs +1 -1
  945. package/esm/skills/store/mock-skills-store.mjs.map +1 -1
  946. package/esm/skills/store/procedural-skill-store.d.mts +1 -1
  947. package/esm/skills/store/procedural-skill-store.d.mts.map +1 -1
  948. package/esm/skills/store/procedural-skill-store.mjs +1 -1
  949. package/esm/skills/store/procedural-skill-store.mjs.map +1 -1
  950. package/esm/snapshot/memory.d.mts +1 -1
  951. package/esm/snapshot/memory.d.mts.map +1 -1
  952. package/esm/snapshot/memory.mjs +1 -1
  953. package/esm/snapshot/memory.mjs.map +1 -1
  954. package/esm/snapshot/pg.d.mts +1 -1
  955. package/esm/snapshot/pg.d.mts.map +1 -1
  956. package/esm/snapshot/pg.mjs +1 -1
  957. package/esm/snapshot/pg.mjs.map +1 -1
  958. package/esm/snapshot/redis.d.mts +1 -1
  959. package/esm/snapshot/redis.d.mts.map +1 -1
  960. package/esm/snapshot/redis.mjs +1 -1
  961. package/esm/snapshot/redis.mjs.map +1 -1
  962. package/esm/speech/speech.d.mts +1 -1
  963. package/esm/speech/speech.d.mts.map +1 -1
  964. package/esm/speech/speech.mjs +1 -1
  965. package/esm/speech/speech.mjs.map +1 -1
  966. package/esm/supervisor/as-tool.d.mts +1 -1
  967. package/esm/supervisor/as-tool.d.mts.map +1 -1
  968. package/esm/supervisor/as-tool.mjs +1 -1
  969. package/esm/supervisor/as-tool.mjs.map +1 -1
  970. package/esm/supervisor/cancellation.d.mts +1 -1
  971. package/esm/supervisor/cancellation.d.mts.map +1 -1
  972. package/esm/supervisor/cancellation.mjs +1 -1
  973. package/esm/supervisor/cancellation.mjs.map +1 -1
  974. package/esm/supervisor/decide.mjs +1 -1
  975. package/esm/supervisor/decide.mjs.map +1 -1
  976. package/esm/supervisor/emitter.d.mts +1 -1
  977. package/esm/supervisor/emitter.d.mts.map +1 -1
  978. package/esm/supervisor/emitter.mjs +1 -1
  979. package/esm/supervisor/emitter.mjs.map +1 -1
  980. package/esm/supervisor/entries.d.mts +1 -1
  981. package/esm/supervisor/entries.d.mts.map +1 -1
  982. package/esm/supervisor/entries.mjs +1 -1
  983. package/esm/supervisor/entries.mjs.map +1 -1
  984. package/esm/supervisor/execution.d.mts +1 -1
  985. package/esm/supervisor/execution.d.mts.map +1 -1
  986. package/esm/supervisor/execution.mjs +1 -1
  987. package/esm/supervisor/execution.mjs.map +1 -1
  988. package/esm/supervisor/fan-out.d.mts +1 -1
  989. package/esm/supervisor/fan-out.d.mts.map +1 -1
  990. package/esm/supervisor/fan-out.mjs +1 -1
  991. package/esm/supervisor/fan-out.mjs.map +1 -1
  992. package/esm/supervisor/router-factory.d.mts +1 -1
  993. package/esm/supervisor/router-factory.d.mts.map +1 -1
  994. package/esm/supervisor/router-factory.mjs +1 -1
  995. package/esm/supervisor/router-factory.mjs.map +1 -1
  996. package/esm/supervisor/router-prompt.d.mts +1 -1
  997. package/esm/supervisor/router-prompt.d.mts.map +1 -1
  998. package/esm/supervisor/router-prompt.mjs +1 -1
  999. package/esm/supervisor/router-prompt.mjs.map +1 -1
  1000. package/esm/supervisor/signature.d.mts +1 -1
  1001. package/esm/supervisor/signature.d.mts.map +1 -1
  1002. package/esm/supervisor/signature.mjs +1 -1
  1003. package/esm/supervisor/signature.mjs.map +1 -1
  1004. package/esm/supervisor/snapshot.d.mts +1 -1
  1005. package/esm/supervisor/snapshot.d.mts.map +1 -1
  1006. package/esm/supervisor/snapshot.mjs +1 -1
  1007. package/esm/supervisor/snapshot.mjs.map +1 -1
  1008. package/esm/supervisor/supervisor-stream.d.mts +1 -1
  1009. package/esm/supervisor/supervisor-stream.d.mts.map +1 -1
  1010. package/esm/supervisor/supervisor-stream.mjs +1 -1
  1011. package/esm/supervisor/supervisor-stream.mjs.map +1 -1
  1012. package/esm/supervisor/supervisor.d.mts +1 -1
  1013. package/esm/supervisor/supervisor.d.mts.map +1 -1
  1014. package/esm/supervisor/supervisor.mjs +1 -1
  1015. package/esm/supervisor/supervisor.mjs.map +1 -1
  1016. package/esm/system-prompt/instruction.d.mts +1 -1
  1017. package/esm/system-prompt/instruction.d.mts.map +1 -1
  1018. package/esm/system-prompt/instruction.mjs +1 -1
  1019. package/esm/system-prompt/instruction.mjs.map +1 -1
  1020. package/esm/system-prompt/persona.d.mts +1 -1
  1021. package/esm/system-prompt/persona.d.mts.map +1 -1
  1022. package/esm/system-prompt/persona.mjs +1 -1
  1023. package/esm/system-prompt/persona.mjs.map +1 -1
  1024. package/esm/system-prompt/refined-system-prompt.d.mts +1 -1
  1025. package/esm/system-prompt/refined-system-prompt.d.mts.map +1 -1
  1026. package/esm/system-prompt/refined-system-prompt.mjs +1 -1
  1027. package/esm/system-prompt/refined-system-prompt.mjs.map +1 -1
  1028. package/esm/system-prompt/render-placeholders.d.mts +1 -1
  1029. package/esm/system-prompt/render-placeholders.d.mts.map +1 -1
  1030. package/esm/system-prompt/render-placeholders.mjs +1 -1
  1031. package/esm/system-prompt/render-placeholders.mjs.map +1 -1
  1032. package/esm/system-prompt/system-prompt.d.mts +1 -1
  1033. package/esm/system-prompt/system-prompt.d.mts.map +1 -1
  1034. package/esm/system-prompt/system-prompt.mjs +1 -1
  1035. package/esm/system-prompt/system-prompt.mjs.map +1 -1
  1036. package/esm/team/gates.mjs +1 -1
  1037. package/esm/team/gates.mjs.map +1 -1
  1038. package/esm/team/team.d.mts +1 -1
  1039. package/esm/team/team.d.mts.map +1 -1
  1040. package/esm/team/team.mjs +1 -1
  1041. package/esm/team/team.mjs.map +1 -1
  1042. package/esm/testing/matcher-logic.d.mts +1 -1
  1043. package/esm/testing/matcher-logic.d.mts.map +1 -1
  1044. package/esm/testing/matcher-logic.mjs +1 -1
  1045. package/esm/testing/matcher-logic.mjs.map +1 -1
  1046. package/esm/testing/matchers.d.mts +1 -1
  1047. package/esm/testing/matchers.d.mts.map +1 -1
  1048. package/esm/testing/matchers.mjs +1 -1
  1049. package/esm/testing/matchers.mjs.map +1 -1
  1050. package/esm/testing/register-lazy.d.mts +1 -1
  1051. package/esm/testing/register-lazy.d.mts.map +1 -1
  1052. package/esm/testing/register-lazy.mjs +1 -1
  1053. package/esm/testing/register-lazy.mjs.map +1 -1
  1054. package/esm/tool/executable-as-tool.d.mts +1 -1
  1055. package/esm/tool/executable-as-tool.d.mts.map +1 -1
  1056. package/esm/tool/executable-as-tool.mjs +1 -1
  1057. package/esm/tool/executable-as-tool.mjs.map +1 -1
  1058. package/esm/tool/tool.d.mts +1 -1
  1059. package/esm/tool/tool.d.mts.map +1 -1
  1060. package/esm/tool/tool.mjs +1 -1
  1061. package/esm/tool/tool.mjs.map +1 -1
  1062. package/esm/transcribe/audio-input.d.mts +1 -1
  1063. package/esm/transcribe/audio-input.d.mts.map +1 -1
  1064. package/esm/transcribe/audio-input.mjs +1 -1
  1065. package/esm/transcribe/audio-input.mjs.map +1 -1
  1066. package/esm/transcribe/transcribe.d.mts +1 -1
  1067. package/esm/transcribe/transcribe.d.mts.map +1 -1
  1068. package/esm/transcribe/transcribe.mjs +1 -1
  1069. package/esm/transcribe/transcribe.mjs.map +1 -1
  1070. package/esm/utils/compute-cost.d.mts +1 -1
  1071. package/esm/utils/compute-cost.d.mts.map +1 -1
  1072. package/esm/utils/compute-cost.mjs +1 -1
  1073. package/esm/utils/compute-cost.mjs.map +1 -1
  1074. package/esm/utils/extract-json-lenient.d.mts +1 -1
  1075. package/esm/utils/extract-json-lenient.d.mts.map +1 -1
  1076. package/esm/utils/extract-json-lenient.mjs +1 -1
  1077. package/esm/utils/extract-json-lenient.mjs.map +1 -1
  1078. package/esm/utils/extract-json-payload.d.mts +1 -1
  1079. package/esm/utils/extract-json-payload.d.mts.map +1 -1
  1080. package/esm/utils/extract-json-payload.mjs +1 -1
  1081. package/esm/utils/extract-json-payload.mjs.map +1 -1
  1082. package/esm/utils/generate-run-id.d.mts +1 -1
  1083. package/esm/utils/generate-run-id.d.mts.map +1 -1
  1084. package/esm/utils/generate-run-id.mjs +1 -1
  1085. package/esm/utils/generate-run-id.mjs.map +1 -1
  1086. package/esm/utils/json-schema.d.mts +1 -1
  1087. package/esm/utils/json-schema.d.mts.map +1 -1
  1088. package/esm/utils/json-schema.mjs +1 -1
  1089. package/esm/utils/json-schema.mjs.map +1 -1
  1090. package/esm/utils/prepare-attachment-part.d.mts +1 -1
  1091. package/esm/utils/prepare-attachment-part.d.mts.map +1 -1
  1092. package/esm/utils/prepare-attachment-part.mjs +1 -1
  1093. package/esm/utils/prepare-attachment-part.mjs.map +1 -1
  1094. package/esm/utils/resolve-attachment.d.mts +1 -1
  1095. package/esm/utils/resolve-attachment.d.mts.map +1 -1
  1096. package/esm/utils/resolve-attachment.mjs +1 -1
  1097. package/esm/utils/resolve-attachment.mjs.map +1 -1
  1098. package/esm/utils/run-context.d.mts +1 -1
  1099. package/esm/utils/run-context.d.mts.map +1 -1
  1100. package/esm/utils/run-context.mjs +1 -1
  1101. package/esm/utils/run-context.mjs.map +1 -1
  1102. package/esm/utils/safe-json-parse.d.mts +1 -1
  1103. package/esm/utils/safe-json-parse.d.mts.map +1 -1
  1104. package/esm/utils/safe-json-parse.mjs +1 -1
  1105. package/esm/utils/safe-json-parse.mjs.map +1 -1
  1106. package/esm/utils/stamp-report-lineage.d.mts +1 -1
  1107. package/esm/utils/stamp-report-lineage.d.mts.map +1 -1
  1108. package/esm/utils/stamp-report-lineage.mjs +1 -1
  1109. package/esm/utils/stamp-report-lineage.mjs.map +1 -1
  1110. package/esm/utils/token-count.d.mts +1 -1
  1111. package/esm/utils/token-count.d.mts.map +1 -1
  1112. package/esm/utils/token-count.mjs +1 -1
  1113. package/esm/utils/token-count.mjs.map +1 -1
  1114. package/esm/vcr/cassette-io.mjs +1 -1
  1115. package/esm/vcr/cassette-io.mjs.map +1 -1
  1116. package/esm/vcr/errors.d.mts +1 -1
  1117. package/esm/vcr/errors.d.mts.map +1 -1
  1118. package/esm/vcr/errors.mjs +1 -1
  1119. package/esm/vcr/errors.mjs.map +1 -1
  1120. package/esm/vcr/hash-request.d.mts +1 -1
  1121. package/esm/vcr/hash-request.d.mts.map +1 -1
  1122. package/esm/vcr/hash-request.mjs +1 -1
  1123. package/esm/vcr/hash-request.mjs.map +1 -1
  1124. package/esm/vcr/vcr.d.mts +1 -1
  1125. package/esm/vcr/vcr.d.mts.map +1 -1
  1126. package/esm/vcr/vcr.mjs +1 -1
  1127. package/esm/vcr/vcr.mjs.map +1 -1
  1128. package/esm/vcr/vcr.type.d.mts +1 -1
  1129. package/esm/vcr/vcr.type.d.mts.map +1 -1
  1130. package/esm/workflow/as-tool.mjs +1 -1
  1131. package/esm/workflow/as-tool.mjs.map +1 -1
  1132. package/esm/workflow/cancellation.mjs +1 -1
  1133. package/esm/workflow/cancellation.mjs.map +1 -1
  1134. package/esm/workflow/emitter.mjs +1 -1
  1135. package/esm/workflow/emitter.mjs.map +1 -1
  1136. package/esm/workflow/engine.mjs +5 -2
  1137. package/esm/workflow/engine.mjs.map +1 -1
  1138. package/esm/workflow/retry.mjs +1 -1
  1139. package/esm/workflow/retry.mjs.map +1 -1
  1140. package/esm/workflow/router.mjs +1 -1
  1141. package/esm/workflow/router.mjs.map +1 -1
  1142. package/esm/workflow/run-scoped-emitter.mjs +1 -1
  1143. package/esm/workflow/run-scoped-emitter.mjs.map +1 -1
  1144. package/esm/workflow/signature.d.mts +1 -1
  1145. package/esm/workflow/signature.d.mts.map +1 -1
  1146. package/esm/workflow/signature.mjs +1 -1
  1147. package/esm/workflow/signature.mjs.map +1 -1
  1148. package/esm/workflow/snapshot.mjs +1 -1
  1149. package/esm/workflow/snapshot.mjs.map +1 -1
  1150. package/esm/workflow/state.mjs +1 -1
  1151. package/esm/workflow/state.mjs.map +1 -1
  1152. package/esm/workflow/step-runner.mjs +25 -6
  1153. package/esm/workflow/step-runner.mjs.map +1 -1
  1154. package/esm/workflow/step.d.mts +1 -1
  1155. package/esm/workflow/step.d.mts.map +1 -1
  1156. package/esm/workflow/step.mjs +1 -1
  1157. package/esm/workflow/step.mjs.map +1 -1
  1158. package/esm/workflow/workflow.d.mts +1 -1
  1159. package/esm/workflow/workflow.d.mts.map +1 -1
  1160. package/esm/workflow/workflow.mjs +1 -1
  1161. package/esm/workflow/workflow.mjs.map +1 -1
  1162. package/llms-full.txt +23 -2
  1163. package/package.json +4 -4
  1164. package/skills/observe-ai-flows/SKILL.md +2 -2
  1165. package/skills/run-ai-workflow/SKILL.md +19 -0
  1166. package/skills/run-supervisor/SKILL.md +2 -0
  1167. package/cjs/magic-string.es-BtxW4VqG.cjs.map +0 -1
  1168. package/cjs/matcher-logic-SBnzYohQ.cjs.map +0 -1
  1169. package/cjs/matchers-BBh3gyB-.cjs.map +0 -1
@@ -2,7 +2,7 @@ import { AgentContract } from "../contracts/agent/agent.contract.mjs";
2
2
  import { WorkflowInstance } from "../contracts/workflow/workflow.contract.mjs";
3
3
  import { IntentEntry } from "../contracts/supervisor/intent-entry.type.mjs";
4
4
 
5
- //#region ../@warlock.js/ai/src/supervisor/fan-out.d.ts
5
+ //#region ../ai/src/supervisor/fan-out.d.ts
6
6
  /**
7
7
  * A dispatchable unit that can be fanned out — an agent or a workflow.
8
8
  * The same union the supervisor's `intents` map accepts for its
@@ -1 +1 @@
1
- {"version":3,"file":"fan-out.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/supervisor/fan-out.ts"],"mappings":";;;;;;;AASA;;;KAAY,UAAA,GAAa,aAAA,YAAyB,gBAAgB;AAAA;AAKlE;;AALkE,KAKtD,aAAA;EAKV;AAQW;AAmCb;;EA3CE,SAAA;EA4CM;;;;;;;EApCN,WAAW;AAAA;;;;;;AAuCgB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAJb,MAAA,CACd,IAAA,EAAM,UAAA,EACN,KAAA,UACA,OAAA,GAAS,aAAA,GACR,MAAA,SAAe,WAAA"}
1
+ {"version":3,"file":"fan-out.d.mts","names":[],"sources":["../../../../../../../ai/src/supervisor/fan-out.ts"],"mappings":";;;;;;;AASA;;;KAAY,UAAA,GAAa,aAAA,YAAyB,gBAAgB;AAAA;AAKlE;;AALkE,KAKtD,aAAA;EAKV;AAQW;AAmCb;;EA3CE,SAAA;EA4CM;;;;;;;EApCN,WAAW;AAAA;;;;;;AAuCgB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAJb,MAAA,CACd,IAAA,EAAM,UAAA,EACN,KAAA,UACA,OAAA,GAAS,aAAA,GACR,MAAA,SAAe,WAAA"}
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/supervisor/fan-out.ts
1
+ //#region ../ai/src/supervisor/fan-out.ts
2
2
  /**
3
3
  * Spread one agent/workflow into `n` distinctly-keyed intent entries
4
4
  * for voting / self-consistency under a supervisor.
@@ -1 +1 @@
1
- {"version":3,"file":"fan-out.mjs","names":[],"sources":["../../../../../../../@warlock.js/ai/src/supervisor/fan-out.ts"],"sourcesContent":["import type { AgentContract } from \"../contracts/agent/agent.contract\";\nimport type { IntentEntry } from \"../contracts/supervisor/intent-entry.type\";\nimport type { WorkflowInstance } from \"../contracts/workflow/workflow.contract\";\n\n/**\n * A dispatchable unit that can be fanned out — an agent or a workflow.\n * The same union the supervisor's `intents` map accepts for its\n * agent/workflow object entries.\n */\nexport type FanOutUnit = AgentContract<unknown> | WorkflowInstance<unknown, unknown>;\n\n/**\n * Options for {@link fanOut}.\n */\nexport type FanOutOptions = {\n /**\n * Base name for the generated intent keys. Defaults to the unit's own\n * `name`. The keys are `<keyPrefix>1`, `<keyPrefix>2`, … `<keyPrefix>n`.\n */\n keyPrefix?: string;\n /**\n * Description applied to every generated entry. Defaults to the\n * unit's own `description`. A description is required when the\n * supervisor uses a `router` (the LLM needs a signal per intent); the\n * factory enforces that downstream, so supply one here when the\n * underlying unit has none.\n */\n description?: string;\n};\n\n/**\n * Spread one agent/workflow into `n` distinctly-keyed intent entries\n * for voting / self-consistency under a supervisor.\n *\n * A supervisor dispatches a fan-out array (`[\"writer1\", \"writer2\",\n * \"writer3\"]`) in parallel; each branch runs the SAME unit independently\n * so a downstream evaluate/aggregate intent can pick the majority answer\n * or the best of `n` samples. Because every branch needs its own intent\n * KEY, this helper clones the unit across distinct keys rather than\n * cloning the unit itself — the underlying agent/workflow is referenced\n * by all entries, but each entry is a separate dispatch slot.\n *\n * Returns a `Record<string, IntentEntry>` you spread directly into the\n * supervisor's `intents` map. The keys are `<keyPrefix>1..<keyPrefix>n`.\n *\n * @example\n * const writer = ai.agent({ name: \"writer\", description: \"Drafts an answer.\", model });\n *\n * const support = ai.supervisor({\n * name: \"self-consistency\",\n * intents: {\n * ...ai.fanOut(writer, 3), // writer1, writer2, writer3\n * vote: { run: pickMajority, description: \"Choose the majority answer.\" },\n * },\n * route: (ctx) =>\n * ctx.iteration === 0 ? [\"writer1\", \"writer2\", \"writer3\"] : \"vote\",\n * });\n *\n * @param unit The agent or workflow to fan out.\n * @param count Number of parallel copies. Must be an integer >= 1.\n * @param options Optional key-prefix / description overrides.\n */\nexport function fanOut(\n unit: FanOutUnit,\n count: number,\n options: FanOutOptions = {},\n): Record<string, IntentEntry> {\n if (!unit || typeof (unit as { execute?: unknown }).execute !== \"function\") {\n throw new TypeError(\"ai.fanOut: first argument must be an agent or workflow\");\n }\n\n if (!Number.isInteger(count) || count < 1) {\n throw new TypeError(`ai.fanOut: \\`count\\` must be an integer >= 1 (received ${String(count)})`);\n }\n\n const keyPrefix = resolveKeyPrefix(unit, options.keyPrefix);\n const description = options.description ?? readDescription(unit);\n\n const entries: Record<string, IntentEntry> = {};\n\n for (let index = 1; index <= count; index++) {\n const entry: IntentEntry = { agent: unit };\n\n if (description) {\n entry.description = description;\n }\n\n entries[`${keyPrefix}${index}`] = entry;\n }\n\n return entries;\n}\n\n/**\n * Resolve the base key prefix: explicit override wins, then the unit's\n * own name. A unit with no usable name forces an explicit `keyPrefix`\n * so the generated keys stay meaningful and collision-free.\n */\nfunction resolveKeyPrefix(unit: FanOutUnit, override: string | undefined): string {\n if (override && override.trim().length > 0) {\n return override.trim();\n }\n\n const name = (unit as { name?: unknown }).name;\n\n if (typeof name === \"string\" && name.trim().length > 0) {\n return name.trim();\n }\n\n throw new TypeError(\n \"ai.fanOut: the unit has no usable `name` — pass `options.keyPrefix` to name the generated intent keys\",\n );\n}\n\nfunction readDescription(unit: FanOutUnit): string | undefined {\n const description = (unit as { description?: unknown }).description;\n\n return typeof description === \"string\" && description.trim().length > 0 ? description : undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,SAAgB,OACd,MACA,OACA,UAAyB,CAAC,GACG;CAC7B,IAAI,CAAC,QAAQ,OAAQ,KAA+B,YAAY,YAC9D,MAAM,IAAI,UAAU,wDAAwD;CAG9E,IAAI,CAAC,OAAO,UAAU,KAAK,KAAK,QAAQ,GACtC,MAAM,IAAI,UAAU,0DAA0D,OAAO,KAAK,EAAE,EAAE;CAGhG,MAAM,YAAY,iBAAiB,MAAM,QAAQ,SAAS;CAC1D,MAAM,cAAc,QAAQ,eAAe,gBAAgB,IAAI;CAE/D,MAAM,UAAuC,CAAC;CAE9C,KAAK,IAAI,QAAQ,GAAG,SAAS,OAAO,SAAS;EAC3C,MAAM,QAAqB,EAAE,OAAO,KAAK;EAEzC,IAAI,aACF,MAAM,cAAc;EAGtB,QAAQ,GAAG,YAAY,WAAW;CACpC;CAEA,OAAO;AACT;;;;;;AAOA,SAAS,iBAAiB,MAAkB,UAAsC;CAChF,IAAI,YAAY,SAAS,KAAK,CAAC,CAAC,SAAS,GACvC,OAAO,SAAS,KAAK;CAGvB,MAAM,OAAQ,KAA4B;CAE1C,IAAI,OAAO,SAAS,YAAY,KAAK,KAAK,CAAC,CAAC,SAAS,GACnD,OAAO,KAAK,KAAK;CAGnB,MAAM,IAAI,UACR,uGACF;AACF;AAEA,SAAS,gBAAgB,MAAsC;CAC7D,MAAM,cAAe,KAAmC;CAExD,OAAO,OAAO,gBAAgB,YAAY,YAAY,KAAK,CAAC,CAAC,SAAS,IAAI,cAAc;AAC1F"}
1
+ {"version":3,"file":"fan-out.mjs","names":[],"sources":["../../../../../../../ai/src/supervisor/fan-out.ts"],"sourcesContent":["import type { AgentContract } from \"../contracts/agent/agent.contract\";\nimport type { IntentEntry } from \"../contracts/supervisor/intent-entry.type\";\nimport type { WorkflowInstance } from \"../contracts/workflow/workflow.contract\";\n\n/**\n * A dispatchable unit that can be fanned out — an agent or a workflow.\n * The same union the supervisor's `intents` map accepts for its\n * agent/workflow object entries.\n */\nexport type FanOutUnit = AgentContract<unknown> | WorkflowInstance<unknown, unknown>;\n\n/**\n * Options for {@link fanOut}.\n */\nexport type FanOutOptions = {\n /**\n * Base name for the generated intent keys. Defaults to the unit's own\n * `name`. The keys are `<keyPrefix>1`, `<keyPrefix>2`, … `<keyPrefix>n`.\n */\n keyPrefix?: string;\n /**\n * Description applied to every generated entry. Defaults to the\n * unit's own `description`. A description is required when the\n * supervisor uses a `router` (the LLM needs a signal per intent); the\n * factory enforces that downstream, so supply one here when the\n * underlying unit has none.\n */\n description?: string;\n};\n\n/**\n * Spread one agent/workflow into `n` distinctly-keyed intent entries\n * for voting / self-consistency under a supervisor.\n *\n * A supervisor dispatches a fan-out array (`[\"writer1\", \"writer2\",\n * \"writer3\"]`) in parallel; each branch runs the SAME unit independently\n * so a downstream evaluate/aggregate intent can pick the majority answer\n * or the best of `n` samples. Because every branch needs its own intent\n * KEY, this helper clones the unit across distinct keys rather than\n * cloning the unit itself — the underlying agent/workflow is referenced\n * by all entries, but each entry is a separate dispatch slot.\n *\n * Returns a `Record<string, IntentEntry>` you spread directly into the\n * supervisor's `intents` map. The keys are `<keyPrefix>1..<keyPrefix>n`.\n *\n * @example\n * const writer = ai.agent({ name: \"writer\", description: \"Drafts an answer.\", model });\n *\n * const support = ai.supervisor({\n * name: \"self-consistency\",\n * intents: {\n * ...ai.fanOut(writer, 3), // writer1, writer2, writer3\n * vote: { run: pickMajority, description: \"Choose the majority answer.\" },\n * },\n * route: (ctx) =>\n * ctx.iteration === 0 ? [\"writer1\", \"writer2\", \"writer3\"] : \"vote\",\n * });\n *\n * @param unit The agent or workflow to fan out.\n * @param count Number of parallel copies. Must be an integer >= 1.\n * @param options Optional key-prefix / description overrides.\n */\nexport function fanOut(\n unit: FanOutUnit,\n count: number,\n options: FanOutOptions = {},\n): Record<string, IntentEntry> {\n if (!unit || typeof (unit as { execute?: unknown }).execute !== \"function\") {\n throw new TypeError(\"ai.fanOut: first argument must be an agent or workflow\");\n }\n\n if (!Number.isInteger(count) || count < 1) {\n throw new TypeError(`ai.fanOut: \\`count\\` must be an integer >= 1 (received ${String(count)})`);\n }\n\n const keyPrefix = resolveKeyPrefix(unit, options.keyPrefix);\n const description = options.description ?? readDescription(unit);\n\n const entries: Record<string, IntentEntry> = {};\n\n for (let index = 1; index <= count; index++) {\n const entry: IntentEntry = { agent: unit };\n\n if (description) {\n entry.description = description;\n }\n\n entries[`${keyPrefix}${index}`] = entry;\n }\n\n return entries;\n}\n\n/**\n * Resolve the base key prefix: explicit override wins, then the unit's\n * own name. A unit with no usable name forces an explicit `keyPrefix`\n * so the generated keys stay meaningful and collision-free.\n */\nfunction resolveKeyPrefix(unit: FanOutUnit, override: string | undefined): string {\n if (override && override.trim().length > 0) {\n return override.trim();\n }\n\n const name = (unit as { name?: unknown }).name;\n\n if (typeof name === \"string\" && name.trim().length > 0) {\n return name.trim();\n }\n\n throw new TypeError(\n \"ai.fanOut: the unit has no usable `name` — pass `options.keyPrefix` to name the generated intent keys\",\n );\n}\n\nfunction readDescription(unit: FanOutUnit): string | undefined {\n const description = (unit as { description?: unknown }).description;\n\n return typeof description === \"string\" && description.trim().length > 0 ? description : undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,SAAgB,OACd,MACA,OACA,UAAyB,CAAC,GACG;CAC7B,IAAI,CAAC,QAAQ,OAAQ,KAA+B,YAAY,YAC9D,MAAM,IAAI,UAAU,wDAAwD;CAG9E,IAAI,CAAC,OAAO,UAAU,KAAK,KAAK,QAAQ,GACtC,MAAM,IAAI,UAAU,0DAA0D,OAAO,KAAK,EAAE,EAAE;CAGhG,MAAM,YAAY,iBAAiB,MAAM,QAAQ,SAAS;CAC1D,MAAM,cAAc,QAAQ,eAAe,gBAAgB,IAAI;CAE/D,MAAM,UAAuC,CAAC;CAE9C,KAAK,IAAI,QAAQ,GAAG,SAAS,OAAO,SAAS;EAC3C,MAAM,QAAqB,EAAE,OAAO,KAAK;EAEzC,IAAI,aACF,MAAM,cAAc;EAGtB,QAAQ,GAAG,YAAY,WAAW;CACpC;CAEA,OAAO;AACT;;;;;;AAOA,SAAS,iBAAiB,MAAkB,UAAsC;CAChF,IAAI,YAAY,SAAS,KAAK,CAAC,CAAC,SAAS,GACvC,OAAO,SAAS,KAAK;CAGvB,MAAM,OAAQ,KAA4B;CAE1C,IAAI,OAAO,SAAS,YAAY,KAAK,KAAK,CAAC,CAAC,SAAS,GACnD,OAAO,KAAK,KAAK;CAGnB,MAAM,IAAI,UACR,uGACF;AACF;AAEA,SAAS,gBAAgB,MAAsC;CAC7D,MAAM,cAAe,KAAmC;CAExD,OAAO,OAAO,gBAAgB,YAAY,YAAY,KAAK,CAAC,CAAC,SAAS,IAAI,cAAc;AAC1F"}
@@ -6,7 +6,7 @@ import { SupervisorIntentValue } from "../contracts/supervisor/intent-entry.type
6
6
  import { Next } from "../contracts/supervisor/next.type.mjs";
7
7
  import { AgentEventHandlers } from "../agent/agent-config.type.mjs";
8
8
 
9
- //#region ../@warlock.js/ai/src/supervisor/router-factory.d.ts
9
+ //#region ../ai/src/supervisor/router-factory.d.ts
10
10
  /**
11
11
  * Output shape every router agent produced by {@link router} emits —
12
12
  * the canonical `{ next, reasoning }` contract the supervisor's
@@ -1 +1 @@
1
- {"version":3,"file":"router-factory.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/supervisor/router-factory.ts"],"mappings":";;;;;;;;;;;AAiBA;;;;KAAY,YAAA;EAEJ,kEAAN,IAAA,EAAM,IAAI,EAED;EAAT,SAAA;AAAA;;;;AAa8D;AAShE;;;;;;KATY,aAAA,GAAgB,MAAM,SAAS,qBAAA;;;;;;;;KAS/B,YAAA;EAgBD;;;;;;EATT,IAAA,WA0BA;EAxBA,KAAA,EAAO,aAAA;EA0BF;;AAAkB;AAuCzB;;;EA1DE,OAAA,EAAS,aAAA;EA0DiD;;;;;;EAnD1D,YAAA,GAAe,oBAAA,WAmD2C;EAjD1D,YAAA,GAAe,YAAA,EAiDuD;EA/CtE,YAAA,GAAe,gBAAA;;;;;;EAMf,QAAA;EAEA,EAAA,GAAK,kBAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuCS,MAAA,CAAO,MAAA,EAAQ,YAAA,GAAe,aAAA,CAAc,YAAA"}
1
+ {"version":3,"file":"router-factory.d.mts","names":[],"sources":["../../../../../../../ai/src/supervisor/router-factory.ts"],"mappings":";;;;;;;;;;;AAiBA;;;;KAAY,YAAA;EAEJ,kEAAN,IAAA,EAAM,IAAI,EAED;EAAT,SAAA;AAAA;;;;AAa8D;AAShE;;;;;;KATY,aAAA,GAAgB,MAAM,SAAS,qBAAA;;;;;;;;KAS/B,YAAA;EAgBD;;;;;;EATT,IAAA,WA0BA;EAxBA,KAAA,EAAO,aAAA;EA0BF;;AAAkB;AAuCzB;;;EA1DE,OAAA,EAAS,aAAA;EA0DiD;;;;;;EAnD1D,YAAA,GAAe,oBAAA,WAmD2C;EAjD1D,YAAA,GAAe,YAAA,EAiDuD;EA/CtE,YAAA,GAAe,gBAAA;;;;;;EAMf,QAAA;EAEA,EAAA,GAAK,kBAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuCS,MAAA,CAAO,MAAA,EAAQ,YAAA,GAAe,aAAA,CAAc,YAAA"}
@@ -1,7 +1,7 @@
1
1
  import { agent } from "../agent/agent.mjs";
2
2
  import { END } from "../contracts/end.type.mjs";
3
3
 
4
- //#region ../@warlock.js/ai/src/supervisor/router-factory.ts
4
+ //#region ../ai/src/supervisor/router-factory.ts
5
5
  /**
6
6
  * Build a routing agent for `ai.supervisor({ router })` without
7
7
  * hand-writing the output schema or the "pick one of these intents"
@@ -1 +1 @@
1
- {"version":3,"file":"router-factory.mjs","names":[],"sources":["../../../../../../../@warlock.js/ai/src/supervisor/router-factory.ts"],"sourcesContent":["import type { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport { agent } from \"../agent/agent\";\nimport type { AgentEventHandlers } from \"../agent/agent-config.type\";\nimport type { AgentContract } from \"../contracts/agent/agent.contract\";\nimport { END } from \"../contracts/end.type\";\nimport type { ModelCallOptions, ModelContract } from \"../contracts/model.contract\";\nimport type { Placeholders } from \"../contracts/placeholders.type\";\nimport type { SupervisorIntentValue } from \"../contracts/supervisor/intent-entry.type\";\nimport type { Next } from \"../contracts/supervisor/next.type\";\nimport type { SystemPromptContract } from \"../contracts/system-prompt.contract\";\n\n/**\n * Output shape every router agent produced by {@link router} emits —\n * the canonical `{ next, reasoning }` contract the supervisor's\n * dispatch loop reads. Exposed so callers can type a router result\n * they handle directly.\n */\nexport type RouterOutput = {\n /** Chosen intent name, a fan-out array, or the `END` sentinel. */\n next: Next;\n /** One-sentence justification for the routing choice. */\n reasoning: string;\n};\n\n/**\n * Description source for one intent the router can pick from. Accepts\n * the same value-shapes the supervisor's `intents` map does (bare\n * agent / workflow / callback / object entry) so a caller can pass the\n * very same `intents` object to both `router()` and `ai.supervisor()`.\n *\n * The router only needs each intent's NAME (the map key) and a\n * human-readable DESCRIPTION — it never dispatches anything itself, so\n * the underlying unit is read for its `description` only.\n */\nexport type RouterIntents = Record<string, SupervisorIntentValue>;\n\n/**\n * Config for {@link router}. Mirrors the relevant slice of `AgentConfig`\n * — the router IS an agent — plus the `intents` map it routes over.\n *\n * Everything except `model` and `intents` is optional; the helper\n * generates the output schema and the routing system prompt for you.\n */\nexport type RouterConfig = {\n /**\n * Stable identifier for the router agent. Defaults to\n * `\"<supervisor-ish>-router\"` is NOT assumed — when omitted the helper\n * uses `\"router\"` so the agent carries a meaningful (non-anonymous)\n * name, which `ai.supervisor({ router })` is happy to accept.\n */\n name?: string;\n /** The routing LLM. Required — a router with no model can't decide. */\n model: ModelContract;\n /**\n * The intents the router chooses among. Same object you pass to\n * `ai.supervisor({ intents })`. Their descriptions are rendered into\n * the generated routing system prompt so the LLM knows what each\n * option does.\n */\n intents: RouterIntents;\n /**\n * Extra guidance prepended to the framework-generated routing system\n * prompt. Use it for domain framing (\"You coordinate a support\n * team.\"); the mechanical \"here are your options, emit `next`\"\n * scaffolding is appended automatically.\n */\n systemPrompt?: SystemPromptContract | string;\n /** Placeholder values merged into the router's system prompt template. */\n placeholders?: Placeholders;\n /** Base model call options forwarded to the underlying agent. */\n modelOptions?: ModelCallOptions;\n /**\n * Hard cap on LLM trips for the router agent. A router is a\n * single-shot decision maker, so this defaults to `1` — override\n * only if the router itself calls tools mid-decision.\n */\n maxTrips?: number;\n /** Factory-level event handlers forwarded to the underlying agent. */\n on?: AgentEventHandlers;\n};\n\n/**\n * Build a routing agent for `ai.supervisor({ router })` without\n * hand-writing the output schema or the \"pick one of these intents\"\n * system prompt.\n *\n * **What it does for you.**\n * - Generates the canonical `{ next, reasoning }` output schema\n * (baked onto the agent so it's a valid router standalone, and\n * identical to what the supervisor injects per-turn) — the model is\n * steered to emit a single intent name or the `END` sentinel.\n * - Auto-builds a system prompt that lists every intent + its\n * description + the reserved `END` value + terse routing rules, with\n * any caller-supplied `systemPrompt` framing kept on top.\n *\n * The result is a plain {@link AgentContract}; pass it straight to\n * `ai.supervisor({ router: ... })`. Because the supervisor also injects\n * the same schema per-turn and prepends its own per-turn context\n * message, the baked schema/prompt are belt-and-suspenders — they make\n * the agent a correct router even when invoked directly.\n *\n * @example\n * const intents = { triage, orderLookup, billingLookup, resolver };\n *\n * const supportRouter = ai.router({\n * model,\n * intents,\n * systemPrompt: \"You coordinate a customer-support team.\",\n * });\n *\n * const support = ai.supervisor({\n * name: \"customer-support\",\n * router: supportRouter,\n * intents,\n * maxIterations: 6,\n * });\n */\nexport function router(config: RouterConfig): AgentContract<RouterOutput> {\n if (!config.model) {\n throw new TypeError(\"ai.router: `model` is required\");\n }\n\n if (!config.intents || typeof config.intents !== \"object\") {\n throw new TypeError(\"ai.router: `intents` is required and must be an object\");\n }\n\n const intentNames = Object.keys(config.intents);\n\n if (intentNames.length === 0) {\n throw new TypeError(\"ai.router: `intents` must contain at least one entry\");\n }\n\n const routingPrompt = buildRoutingSystemPrompt(config.intents, resolvePrefix(config.systemPrompt));\n\n return agent<RouterOutput>({\n name: config.name ?? \"router\",\n description: \"Routes a supervisor run to the next intent (or terminates it).\",\n model: config.model,\n systemPrompt: routingPrompt,\n output: routerOutputSchema(intentNames),\n placeholders: config.placeholders,\n modelOptions: config.modelOptions,\n maxTrips: config.maxTrips ?? 1,\n on: config.on,\n });\n}\n\n/**\n * Resolve a caller-supplied `systemPrompt` (string or contract) to\n * plain text for prepending to the generated routing block. Returns\n * `undefined` when none was supplied.\n */\nfunction resolvePrefix(prompt: SystemPromptContract | string | undefined): string | undefined {\n if (!prompt) {\n return undefined;\n }\n\n return typeof prompt === \"string\" ? prompt : prompt.resolve();\n}\n\n/**\n * Assemble the routing system prompt: optional caller framing on top,\n * then the mechanical block listing every intent + description, the\n * reserved `END` sentinel, and the rules for emitting `next`.\n */\nfunction buildRoutingSystemPrompt(intents: RouterIntents, prefix: string | undefined): string {\n const intentLines = Object.entries(intents).map(([name, value]) => {\n const description = resolveIntentDescription(value);\n\n return description ? `- ${name}: ${description}` : `- ${name}`;\n });\n\n const sections: string[] = [];\n\n if (prefix && prefix.trim().length > 0) {\n sections.push(prefix.trim(), \"\");\n }\n\n sections.push(\n \"You are a router. Pick the single best intent to handle the next step, or terminate the run.\",\n \"\",\n \"Available intents:\",\n ...intentLines,\n \"\",\n \"Reserved values:\",\n `- ${END} = terminate the run when no further intent is needed`,\n \"\",\n \"Rules:\",\n \"- Respond with the `next` field set to exactly one intent name from the list above, or the END sentinel.\",\n \"- Put a one-sentence justification in the `reasoning` field.\",\n \"- Never invent an intent name that is not listed.\",\n );\n\n return sections.join(\"\\n\");\n}\n\n/**\n * Read the human-readable description off a supervisor-intent value,\n * regardless of which accepted shape it is (bare agent / workflow,\n * object entry with a `description` override, callback entry). Bare\n * callbacks have no description source — returns `undefined`, and the\n * prompt simply lists the intent by name.\n */\nfunction resolveIntentDescription(value: SupervisorIntentValue): string | undefined {\n if (!value || typeof value === \"function\") {\n return undefined;\n }\n\n const entry = value as {\n description?: unknown;\n agent?: { description?: unknown };\n };\n\n if (typeof entry.description === \"string\" && entry.description.trim().length > 0) {\n return entry.description.trim();\n }\n\n const agentDescription = entry.agent?.description;\n\n if (typeof agentDescription === \"string\" && agentDescription.trim().length > 0) {\n return agentDescription.trim();\n }\n\n return undefined;\n}\n\n/**\n * Build the canonical router output Standard Schema. The same shape the\n * supervisor injects per-turn — `{ next: string, reasoning: string }` —\n * with the JSON Schema extension carrying the intent names as an `enum`\n * (plus the `END` sentinel) so capable providers enforce the choice\n * natively rather than via soft prompt coaching. Validation still\n * accepts `string` / `string[]` for framework-level fan-out.\n */\nfunction routerOutputSchema(intentNames: string[]): StandardSchemaV1<RouterOutput> {\n const nextEnum = [...intentNames, END];\n\n const jsonSchema = {\n type: \"object\",\n properties: {\n next: {\n type: \"string\",\n enum: nextEnum,\n description: \"Name of the intent to dispatch next, or the END sentinel to terminate.\",\n },\n reasoning: {\n type: \"string\",\n description: \"One-sentence justification for the routing choice.\",\n },\n },\n required: [\"next\", \"reasoning\"],\n additionalProperties: false,\n };\n\n return {\n \"~standard\": {\n version: 1,\n vendor: \"warlock-router\",\n jsonSchema: {\n input: () => jsonSchema,\n },\n validate(value: unknown): StandardSchemaV1.Result<RouterOutput> {\n if (!value || typeof value !== \"object\") {\n return { issues: [{ message: \"router output must be an object\" }] };\n }\n\n const record = value as { next?: unknown; reasoning?: unknown };\n const rawNext = record.next;\n\n const nextIsValid =\n typeof rawNext === \"string\" ||\n (Array.isArray(rawNext) && rawNext.every((element) => typeof element === \"string\"));\n\n if (!nextIsValid) {\n return {\n issues: [\n { message: \"router output `next` must be a string, string[], or the END sentinel\" },\n ],\n };\n }\n\n const reasoning = typeof record.reasoning === \"string\" ? record.reasoning : \"\";\n\n return {\n value: { next: rawNext as Next, reasoning },\n };\n },\n } as StandardSchemaV1<RouterOutput>[\"~standard\"] & {\n jsonSchema: { input: () => Record<string, unknown> };\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqHA,SAAgB,OAAO,QAAmD;CACxE,IAAI,CAAC,OAAO,OACV,MAAM,IAAI,UAAU,gCAAgC;CAGtD,IAAI,CAAC,OAAO,WAAW,OAAO,OAAO,YAAY,UAC/C,MAAM,IAAI,UAAU,wDAAwD;CAG9E,MAAM,cAAc,OAAO,KAAK,OAAO,OAAO;CAE9C,IAAI,YAAY,WAAW,GACzB,MAAM,IAAI,UAAU,sDAAsD;CAG5E,MAAM,gBAAgB,yBAAyB,OAAO,SAAS,cAAc,OAAO,YAAY,CAAC;CAEjG,OAAO,MAAoB;EACzB,MAAM,OAAO,QAAQ;EACrB,aAAa;EACb,OAAO,OAAO;EACd,cAAc;EACd,QAAQ,mBAAmB,WAAW;EACtC,cAAc,OAAO;EACrB,cAAc,OAAO;EACrB,UAAU,OAAO,YAAY;EAC7B,IAAI,OAAO;CACb,CAAC;AACH;;;;;;AAOA,SAAS,cAAc,QAAuE;CAC5F,IAAI,CAAC,QACH;CAGF,OAAO,OAAO,WAAW,WAAW,SAAS,OAAO,QAAQ;AAC9D;;;;;;AAOA,SAAS,yBAAyB,SAAwB,QAAoC;CAC5F,MAAM,cAAc,OAAO,QAAQ,OAAO,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW;EACjE,MAAM,cAAc,yBAAyB,KAAK;EAElD,OAAO,cAAc,KAAK,KAAK,IAAI,gBAAgB,KAAK;CAC1D,CAAC;CAED,MAAM,WAAqB,CAAC;CAE5B,IAAI,UAAU,OAAO,KAAK,CAAC,CAAC,SAAS,GACnC,SAAS,KAAK,OAAO,KAAK,GAAG,EAAE;CAGjC,SAAS,KACP,gGACA,IACA,sBACA,GAAG,aACH,IACA,oBACA,KAAK,IAAI,wDACT,IACA,UACA,4GACA,gEACA,mDACF;CAEA,OAAO,SAAS,KAAK,IAAI;AAC3B;;;;;;;;AASA,SAAS,yBAAyB,OAAkD;CAClF,IAAI,CAAC,SAAS,OAAO,UAAU,YAC7B;CAGF,MAAM,QAAQ;CAKd,IAAI,OAAO,MAAM,gBAAgB,YAAY,MAAM,YAAY,KAAK,CAAC,CAAC,SAAS,GAC7E,OAAO,MAAM,YAAY,KAAK;CAGhC,MAAM,mBAAmB,MAAM,OAAO;CAEtC,IAAI,OAAO,qBAAqB,YAAY,iBAAiB,KAAK,CAAC,CAAC,SAAS,GAC3E,OAAO,iBAAiB,KAAK;AAIjC;;;;;;;;;AAUA,SAAS,mBAAmB,aAAuD;CAGjF,MAAM,aAAa;EACjB,MAAM;EACN,YAAY;GACV,MAAM;IACJ,MAAM;IACN,MAAM,CAPM,GAAG,aAAa,GAOf;IACb,aAAa;GACf;GACA,WAAW;IACT,MAAM;IACN,aAAa;GACf;EACF;EACA,UAAU,CAAC,QAAQ,WAAW;EAC9B,sBAAsB;CACxB;CAEA,OAAO,EACL,aAAa;EACX,SAAS;EACT,QAAQ;EACR,YAAY,EACV,aAAa,WACf;EACA,SAAS,OAAuD;GAC9D,IAAI,CAAC,SAAS,OAAO,UAAU,UAC7B,OAAO,EAAE,QAAQ,CAAC,EAAE,SAAS,kCAAkC,CAAC,EAAE;GAGpE,MAAM,SAAS;GACf,MAAM,UAAU,OAAO;GAMvB,IAAI,EAHF,OAAO,YAAY,YAClB,MAAM,QAAQ,OAAO,KAAK,QAAQ,OAAO,YAAY,OAAO,YAAY,QAAQ,IAGjF,OAAO,EACL,QAAQ,CACN,EAAE,SAAS,uEAAuE,CACpF,EACF;GAKF,OAAO,EACL,OAAO;IAAE,MAAM;IAAiB,WAHhB,OAAO,OAAO,cAAc,WAAW,OAAO,YAAY;GAGhC,EAC5C;EACF;CACF,EAGF;AACF"}
1
+ {"version":3,"file":"router-factory.mjs","names":[],"sources":["../../../../../../../ai/src/supervisor/router-factory.ts"],"sourcesContent":["import type { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport { agent } from \"../agent/agent\";\nimport type { AgentEventHandlers } from \"../agent/agent-config.type\";\nimport type { AgentContract } from \"../contracts/agent/agent.contract\";\nimport { END } from \"../contracts/end.type\";\nimport type { ModelCallOptions, ModelContract } from \"../contracts/model.contract\";\nimport type { Placeholders } from \"../contracts/placeholders.type\";\nimport type { SupervisorIntentValue } from \"../contracts/supervisor/intent-entry.type\";\nimport type { Next } from \"../contracts/supervisor/next.type\";\nimport type { SystemPromptContract } from \"../contracts/system-prompt.contract\";\n\n/**\n * Output shape every router agent produced by {@link router} emits —\n * the canonical `{ next, reasoning }` contract the supervisor's\n * dispatch loop reads. Exposed so callers can type a router result\n * they handle directly.\n */\nexport type RouterOutput = {\n /** Chosen intent name, a fan-out array, or the `END` sentinel. */\n next: Next;\n /** One-sentence justification for the routing choice. */\n reasoning: string;\n};\n\n/**\n * Description source for one intent the router can pick from. Accepts\n * the same value-shapes the supervisor's `intents` map does (bare\n * agent / workflow / callback / object entry) so a caller can pass the\n * very same `intents` object to both `router()` and `ai.supervisor()`.\n *\n * The router only needs each intent's NAME (the map key) and a\n * human-readable DESCRIPTION — it never dispatches anything itself, so\n * the underlying unit is read for its `description` only.\n */\nexport type RouterIntents = Record<string, SupervisorIntentValue>;\n\n/**\n * Config for {@link router}. Mirrors the relevant slice of `AgentConfig`\n * — the router IS an agent — plus the `intents` map it routes over.\n *\n * Everything except `model` and `intents` is optional; the helper\n * generates the output schema and the routing system prompt for you.\n */\nexport type RouterConfig = {\n /**\n * Stable identifier for the router agent. Defaults to\n * `\"<supervisor-ish>-router\"` is NOT assumed — when omitted the helper\n * uses `\"router\"` so the agent carries a meaningful (non-anonymous)\n * name, which `ai.supervisor({ router })` is happy to accept.\n */\n name?: string;\n /** The routing LLM. Required — a router with no model can't decide. */\n model: ModelContract;\n /**\n * The intents the router chooses among. Same object you pass to\n * `ai.supervisor({ intents })`. Their descriptions are rendered into\n * the generated routing system prompt so the LLM knows what each\n * option does.\n */\n intents: RouterIntents;\n /**\n * Extra guidance prepended to the framework-generated routing system\n * prompt. Use it for domain framing (\"You coordinate a support\n * team.\"); the mechanical \"here are your options, emit `next`\"\n * scaffolding is appended automatically.\n */\n systemPrompt?: SystemPromptContract | string;\n /** Placeholder values merged into the router's system prompt template. */\n placeholders?: Placeholders;\n /** Base model call options forwarded to the underlying agent. */\n modelOptions?: ModelCallOptions;\n /**\n * Hard cap on LLM trips for the router agent. A router is a\n * single-shot decision maker, so this defaults to `1` — override\n * only if the router itself calls tools mid-decision.\n */\n maxTrips?: number;\n /** Factory-level event handlers forwarded to the underlying agent. */\n on?: AgentEventHandlers;\n};\n\n/**\n * Build a routing agent for `ai.supervisor({ router })` without\n * hand-writing the output schema or the \"pick one of these intents\"\n * system prompt.\n *\n * **What it does for you.**\n * - Generates the canonical `{ next, reasoning }` output schema\n * (baked onto the agent so it's a valid router standalone, and\n * identical to what the supervisor injects per-turn) — the model is\n * steered to emit a single intent name or the `END` sentinel.\n * - Auto-builds a system prompt that lists every intent + its\n * description + the reserved `END` value + terse routing rules, with\n * any caller-supplied `systemPrompt` framing kept on top.\n *\n * The result is a plain {@link AgentContract}; pass it straight to\n * `ai.supervisor({ router: ... })`. Because the supervisor also injects\n * the same schema per-turn and prepends its own per-turn context\n * message, the baked schema/prompt are belt-and-suspenders — they make\n * the agent a correct router even when invoked directly.\n *\n * @example\n * const intents = { triage, orderLookup, billingLookup, resolver };\n *\n * const supportRouter = ai.router({\n * model,\n * intents,\n * systemPrompt: \"You coordinate a customer-support team.\",\n * });\n *\n * const support = ai.supervisor({\n * name: \"customer-support\",\n * router: supportRouter,\n * intents,\n * maxIterations: 6,\n * });\n */\nexport function router(config: RouterConfig): AgentContract<RouterOutput> {\n if (!config.model) {\n throw new TypeError(\"ai.router: `model` is required\");\n }\n\n if (!config.intents || typeof config.intents !== \"object\") {\n throw new TypeError(\"ai.router: `intents` is required and must be an object\");\n }\n\n const intentNames = Object.keys(config.intents);\n\n if (intentNames.length === 0) {\n throw new TypeError(\"ai.router: `intents` must contain at least one entry\");\n }\n\n const routingPrompt = buildRoutingSystemPrompt(config.intents, resolvePrefix(config.systemPrompt));\n\n return agent<RouterOutput>({\n name: config.name ?? \"router\",\n description: \"Routes a supervisor run to the next intent (or terminates it).\",\n model: config.model,\n systemPrompt: routingPrompt,\n output: routerOutputSchema(intentNames),\n placeholders: config.placeholders,\n modelOptions: config.modelOptions,\n maxTrips: config.maxTrips ?? 1,\n on: config.on,\n });\n}\n\n/**\n * Resolve a caller-supplied `systemPrompt` (string or contract) to\n * plain text for prepending to the generated routing block. Returns\n * `undefined` when none was supplied.\n */\nfunction resolvePrefix(prompt: SystemPromptContract | string | undefined): string | undefined {\n if (!prompt) {\n return undefined;\n }\n\n return typeof prompt === \"string\" ? prompt : prompt.resolve();\n}\n\n/**\n * Assemble the routing system prompt: optional caller framing on top,\n * then the mechanical block listing every intent + description, the\n * reserved `END` sentinel, and the rules for emitting `next`.\n */\nfunction buildRoutingSystemPrompt(intents: RouterIntents, prefix: string | undefined): string {\n const intentLines = Object.entries(intents).map(([name, value]) => {\n const description = resolveIntentDescription(value);\n\n return description ? `- ${name}: ${description}` : `- ${name}`;\n });\n\n const sections: string[] = [];\n\n if (prefix && prefix.trim().length > 0) {\n sections.push(prefix.trim(), \"\");\n }\n\n sections.push(\n \"You are a router. Pick the single best intent to handle the next step, or terminate the run.\",\n \"\",\n \"Available intents:\",\n ...intentLines,\n \"\",\n \"Reserved values:\",\n `- ${END} = terminate the run when no further intent is needed`,\n \"\",\n \"Rules:\",\n \"- Respond with the `next` field set to exactly one intent name from the list above, or the END sentinel.\",\n \"- Put a one-sentence justification in the `reasoning` field.\",\n \"- Never invent an intent name that is not listed.\",\n );\n\n return sections.join(\"\\n\");\n}\n\n/**\n * Read the human-readable description off a supervisor-intent value,\n * regardless of which accepted shape it is (bare agent / workflow,\n * object entry with a `description` override, callback entry). Bare\n * callbacks have no description source — returns `undefined`, and the\n * prompt simply lists the intent by name.\n */\nfunction resolveIntentDescription(value: SupervisorIntentValue): string | undefined {\n if (!value || typeof value === \"function\") {\n return undefined;\n }\n\n const entry = value as {\n description?: unknown;\n agent?: { description?: unknown };\n };\n\n if (typeof entry.description === \"string\" && entry.description.trim().length > 0) {\n return entry.description.trim();\n }\n\n const agentDescription = entry.agent?.description;\n\n if (typeof agentDescription === \"string\" && agentDescription.trim().length > 0) {\n return agentDescription.trim();\n }\n\n return undefined;\n}\n\n/**\n * Build the canonical router output Standard Schema. The same shape the\n * supervisor injects per-turn — `{ next: string, reasoning: string }` —\n * with the JSON Schema extension carrying the intent names as an `enum`\n * (plus the `END` sentinel) so capable providers enforce the choice\n * natively rather than via soft prompt coaching. Validation still\n * accepts `string` / `string[]` for framework-level fan-out.\n */\nfunction routerOutputSchema(intentNames: string[]): StandardSchemaV1<RouterOutput> {\n const nextEnum = [...intentNames, END];\n\n const jsonSchema = {\n type: \"object\",\n properties: {\n next: {\n type: \"string\",\n enum: nextEnum,\n description: \"Name of the intent to dispatch next, or the END sentinel to terminate.\",\n },\n reasoning: {\n type: \"string\",\n description: \"One-sentence justification for the routing choice.\",\n },\n },\n required: [\"next\", \"reasoning\"],\n additionalProperties: false,\n };\n\n return {\n \"~standard\": {\n version: 1,\n vendor: \"warlock-router\",\n jsonSchema: {\n input: () => jsonSchema,\n },\n validate(value: unknown): StandardSchemaV1.Result<RouterOutput> {\n if (!value || typeof value !== \"object\") {\n return { issues: [{ message: \"router output must be an object\" }] };\n }\n\n const record = value as { next?: unknown; reasoning?: unknown };\n const rawNext = record.next;\n\n const nextIsValid =\n typeof rawNext === \"string\" ||\n (Array.isArray(rawNext) && rawNext.every((element) => typeof element === \"string\"));\n\n if (!nextIsValid) {\n return {\n issues: [\n { message: \"router output `next` must be a string, string[], or the END sentinel\" },\n ],\n };\n }\n\n const reasoning = typeof record.reasoning === \"string\" ? record.reasoning : \"\";\n\n return {\n value: { next: rawNext as Next, reasoning },\n };\n },\n } as StandardSchemaV1<RouterOutput>[\"~standard\"] & {\n jsonSchema: { input: () => Record<string, unknown> };\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqHA,SAAgB,OAAO,QAAmD;CACxE,IAAI,CAAC,OAAO,OACV,MAAM,IAAI,UAAU,gCAAgC;CAGtD,IAAI,CAAC,OAAO,WAAW,OAAO,OAAO,YAAY,UAC/C,MAAM,IAAI,UAAU,wDAAwD;CAG9E,MAAM,cAAc,OAAO,KAAK,OAAO,OAAO;CAE9C,IAAI,YAAY,WAAW,GACzB,MAAM,IAAI,UAAU,sDAAsD;CAG5E,MAAM,gBAAgB,yBAAyB,OAAO,SAAS,cAAc,OAAO,YAAY,CAAC;CAEjG,OAAO,MAAoB;EACzB,MAAM,OAAO,QAAQ;EACrB,aAAa;EACb,OAAO,OAAO;EACd,cAAc;EACd,QAAQ,mBAAmB,WAAW;EACtC,cAAc,OAAO;EACrB,cAAc,OAAO;EACrB,UAAU,OAAO,YAAY;EAC7B,IAAI,OAAO;CACb,CAAC;AACH;;;;;;AAOA,SAAS,cAAc,QAAuE;CAC5F,IAAI,CAAC,QACH;CAGF,OAAO,OAAO,WAAW,WAAW,SAAS,OAAO,QAAQ;AAC9D;;;;;;AAOA,SAAS,yBAAyB,SAAwB,QAAoC;CAC5F,MAAM,cAAc,OAAO,QAAQ,OAAO,CAAC,CAAC,KAAK,CAAC,MAAM,WAAW;EACjE,MAAM,cAAc,yBAAyB,KAAK;EAElD,OAAO,cAAc,KAAK,KAAK,IAAI,gBAAgB,KAAK;CAC1D,CAAC;CAED,MAAM,WAAqB,CAAC;CAE5B,IAAI,UAAU,OAAO,KAAK,CAAC,CAAC,SAAS,GACnC,SAAS,KAAK,OAAO,KAAK,GAAG,EAAE;CAGjC,SAAS,KACP,gGACA,IACA,sBACA,GAAG,aACH,IACA,oBACA,KAAK,IAAI,wDACT,IACA,UACA,4GACA,gEACA,mDACF;CAEA,OAAO,SAAS,KAAK,IAAI;AAC3B;;;;;;;;AASA,SAAS,yBAAyB,OAAkD;CAClF,IAAI,CAAC,SAAS,OAAO,UAAU,YAC7B;CAGF,MAAM,QAAQ;CAKd,IAAI,OAAO,MAAM,gBAAgB,YAAY,MAAM,YAAY,KAAK,CAAC,CAAC,SAAS,GAC7E,OAAO,MAAM,YAAY,KAAK;CAGhC,MAAM,mBAAmB,MAAM,OAAO;CAEtC,IAAI,OAAO,qBAAqB,YAAY,iBAAiB,KAAK,CAAC,CAAC,SAAS,GAC3E,OAAO,iBAAiB,KAAK;AAIjC;;;;;;;;;AAUA,SAAS,mBAAmB,aAAuD;CAGjF,MAAM,aAAa;EACjB,MAAM;EACN,YAAY;GACV,MAAM;IACJ,MAAM;IACN,MAAM,CAPM,GAAG,aAAa,GAOf;IACb,aAAa;GACf;GACA,WAAW;IACT,MAAM;IACN,aAAa;GACf;EACF;EACA,UAAU,CAAC,QAAQ,WAAW;EAC9B,sBAAsB;CACxB;CAEA,OAAO,EACL,aAAa;EACX,SAAS;EACT,QAAQ;EACR,YAAY,EACV,aAAa,WACf;EACA,SAAS,OAAuD;GAC9D,IAAI,CAAC,SAAS,OAAO,UAAU,UAC7B,OAAO,EAAE,QAAQ,CAAC,EAAE,SAAS,kCAAkC,CAAC,EAAE;GAGpE,MAAM,SAAS;GACf,MAAM,UAAU,OAAO;GAMvB,IAAI,EAHF,OAAO,YAAY,YAClB,MAAM,QAAQ,OAAO,KAAK,QAAQ,OAAO,YAAY,OAAO,YAAY,QAAQ,IAGjF,OAAO,EACL,QAAQ,CACN,EAAE,SAAS,uEAAuE,CACpF,EACF;GAKF,OAAO,EACL,OAAO;IAAE,MAAM;IAAiB,WAHhB,OAAO,OAAO,cAAc,WAAW,OAAO,YAAY;GAGhC,EAC5C;EACF;CACF,EAGF;AACF"}
@@ -2,7 +2,7 @@ import { SupervisorInput } from "../contracts/supervisor/supervisor-input.type.m
2
2
  import { IterationSnapshot } from "../contracts/supervisor/iteration-snapshot.type.mjs";
3
3
  import { ResolvedIntentEntry } from "./entries.mjs";
4
4
 
5
- //#region ../@warlock.js/ai/src/supervisor/router-prompt.d.ts
5
+ //#region ../ai/src/supervisor/router-prompt.d.ts
6
6
  /**
7
7
  * Build the per-turn user message the supervisor feeds to the router
8
8
  * agent. Carries everything the LLM needs to make a routing decision:
@@ -1 +1 @@
1
- {"version":3,"file":"router-prompt.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/supervisor/router-prompt.ts"],"mappings":";;;;;;;AAmBA;;;;;;;;;;;;iBAAgB,yBAAA,CAA0B,MAAA;EACxC,OAAA,EAAS,GAAA,SAAY,mBAAA;EACrB,SAAA;EACA,aAAA;EACA,UAAA,EAAY,iBAAA;EACZ,KAAA,EAAO,eAAA;EAAA;;;;;;EAOP,KAAA,GAAQ,MAAA;EAqBT;AAAA;;;;EAfC,QAAA;;;;;;;EAOA,gBAAA;;;;;;;EAOA,IAAA;AAAA"}
1
+ {"version":3,"file":"router-prompt.d.mts","names":[],"sources":["../../../../../../../ai/src/supervisor/router-prompt.ts"],"mappings":";;;;;;;AAmBA;;;;;;;;;;;;iBAAgB,yBAAA,CAA0B,MAAA;EACxC,OAAA,EAAS,GAAA,SAAY,mBAAA;EACrB,SAAA;EACA,aAAA;EACA,UAAA,EAAY,iBAAA;EACZ,KAAA,EAAO,eAAA;EAAA;;;;;;EAOP,KAAA,GAAQ,MAAA;EAqBT;AAAA;;;;EAfC,QAAA;;;;;;;EAOA,gBAAA;;;;;;;EAOA,IAAA;AAAA"}
@@ -1,6 +1,6 @@
1
1
  import { END } from "../contracts/end.type.mjs";
2
2
 
3
- //#region ../@warlock.js/ai/src/supervisor/router-prompt.ts
3
+ //#region ../ai/src/supervisor/router-prompt.ts
4
4
  /**
5
5
  * Build the per-turn user message the supervisor feeds to the router
6
6
  * agent. Carries everything the LLM needs to make a routing decision:
@@ -1 +1 @@
1
- {"version":3,"file":"router-prompt.mjs","names":[],"sources":["../../../../../../../@warlock.js/ai/src/supervisor/router-prompt.ts"],"sourcesContent":["import { END } from \"../contracts/end.type\";\nimport type { IterationSnapshot } from \"../contracts/supervisor/iteration-snapshot.type\";\nimport type { SupervisorInput } from \"../contracts/supervisor/supervisor-input.type\";\nimport type { ResolvedIntentEntry } from \"./entries\";\n\n/**\n * Build the per-turn user message the supervisor feeds to the router\n * agent. Carries everything the LLM needs to make a routing decision:\n *\n * - Available intents with descriptions (so the router knows what\n * to pick from).\n * - The reserved `END` sentinel value it can emit to terminate.\n * - Iteration counter + ceiling so the router can pace itself.\n * - Compact history of prior iterations (intent + short output clip).\n * - The supervisor's original input so the router stays anchored.\n *\n * Note the router's own `systemPrompt` is kept persistent across\n * turns — this function produces only the per-turn USER message.\n */\nexport function buildRouterContextMessage(params: {\n entries: Map<string, ResolvedIntentEntry>;\n iteration: number;\n maxIterations: number;\n iterations: IterationSnapshot[];\n input: SupervisorInput;\n /**\n * Per-execute state at the START of this iteration (post-merge of\n * the previous iteration). Rendered as a JSON snippet so the\n * router can pick the next intent based on what's already filled\n * in (Q14).\n */\n state?: Record<string, unknown>;\n /**\n * Reviewer feedback string from the previous iteration's evaluate\n * verdict. Rendered as its own section so the router weighs it\n * alongside the intent list (Q18).\n */\n feedback?: string;\n /**\n * Supervisor-level system prompt text, when configured. Surfaced at\n * the TOP of the router's per-turn user message so the router reads\n * team/domain context before the routing mechanics block. Skipped\n * when the supervisor didn't configure `systemPrompt`.\n */\n supervisorPrompt?: string;\n /**\n * Resolved natural-language objective from `SupervisorConfig.goal`.\n * Surfaced as its own labeled section near the top of the router's\n * user message so routing decisions are objective-aware. Skipped\n * when no goal was configured.\n */\n goal?: string;\n}): string {\n const {\n entries,\n iteration,\n maxIterations,\n iterations,\n input,\n state,\n feedback,\n supervisorPrompt,\n goal,\n } = params;\n\n const intentLines = [...entries.values()].map(\n entry => `- ${entry.intent}: ${entry.description}`,\n );\n\n const historyLines =\n iterations.length === 0\n ? [\"(none yet)\"]\n : iterations.map(snapshot => formatHistoryLine(snapshot));\n\n const sections: string[] = [];\n\n if (supervisorPrompt) {\n sections.push(supervisorPrompt.trim(), \"\");\n }\n\n if (goal) {\n sections.push(\"Goal:\", goal.trim(), \"\");\n }\n\n sections.push(\n \"Available intents:\",\n ...intentLines,\n \"\",\n \"Reserved values:\",\n `- ${END} = terminate the run`,\n \"\",\n `Iteration: ${iteration + 1} / ${maxIterations}`,\n \"\",\n \"History:\",\n ...historyLines,\n );\n\n if (state && Object.keys(state).length > 0) {\n sections.push(\"\", \"Current state:\", safeStringify(state));\n }\n\n if (feedback) {\n sections.push(\"\", `Reviewer feedback from last iteration: ${feedback}`);\n }\n\n const renderedInput =\n typeof input === \"string\" ? input : safeStringify(input);\n\n sections.push(\"\", `Original input: ${renderedInput}`);\n\n return sections.join(\"\\n\");\n}\n\nfunction formatHistoryLine(snapshot: IterationSnapshot): string {\n const branches = Object.entries(snapshot.result).map(\n ([intent, branch]) => `${intent} → ${clip(branch.output)}`,\n );\n\n return `[${snapshot.iteration}] ${branches.join(\" | \")}`;\n}\n\nfunction clip(value: unknown, maxLength = 160): string {\n if (value === undefined || value === null) {\n return String(value);\n }\n\n const raw = typeof value === \"string\" ? value : safeStringify(value);\n\n if (raw.length <= maxLength) {\n return raw;\n }\n\n return `${raw.slice(0, maxLength - 1)}…`;\n}\n\nfunction safeStringify(value: unknown): string {\n try {\n return JSON.stringify(value);\n } catch {\n return `[unserializable: ${typeof value}]`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmBA,SAAgB,0BAA0B,QAiC/B;CACT,MAAM,EACJ,SACA,WACA,eACA,YACA,OACA,OACA,UACA,kBACA,SACE;CAEJ,MAAM,cAAc,CAAC,GAAG,QAAQ,OAAO,CAAC,CAAC,CAAC,KACxC,UAAS,KAAK,MAAM,OAAO,IAAI,MAAM,aACvC;CAEA,MAAM,eACJ,WAAW,WAAW,IAClB,CAAC,YAAY,IACb,WAAW,KAAI,aAAY,kBAAkB,QAAQ,CAAC;CAE5D,MAAM,WAAqB,CAAC;CAE5B,IAAI,kBACF,SAAS,KAAK,iBAAiB,KAAK,GAAG,EAAE;CAG3C,IAAI,MACF,SAAS,KAAK,SAAS,KAAK,KAAK,GAAG,EAAE;CAGxC,SAAS,KACP,sBACA,GAAG,aACH,IACA,oBACA,KAAK,IAAI,uBACT,IACA,cAAc,YAAY,EAAE,KAAK,iBACjC,IACA,YACA,GAAG,YACL;CAEA,IAAI,SAAS,OAAO,KAAK,KAAK,CAAC,CAAC,SAAS,GACvC,SAAS,KAAK,IAAI,kBAAkB,cAAc,KAAK,CAAC;CAG1D,IAAI,UACF,SAAS,KAAK,IAAI,0CAA0C,UAAU;CAGxE,MAAM,gBACJ,OAAO,UAAU,WAAW,QAAQ,cAAc,KAAK;CAEzD,SAAS,KAAK,IAAI,mBAAmB,eAAe;CAEpD,OAAO,SAAS,KAAK,IAAI;AAC3B;AAEA,SAAS,kBAAkB,UAAqC;CAC9D,MAAM,WAAW,OAAO,QAAQ,SAAS,MAAM,CAAC,CAAC,KAC9C,CAAC,QAAQ,YAAY,GAAG,OAAO,KAAK,KAAK,OAAO,MAAM,GACzD;CAEA,OAAO,IAAI,SAAS,UAAU,IAAI,SAAS,KAAK,KAAK;AACvD;AAEA,SAAS,KAAK,OAAgB,YAAY,KAAa;CACrD,IAAI,UAAU,UAAa,UAAU,MACnC,OAAO,OAAO,KAAK;CAGrB,MAAM,MAAM,OAAO,UAAU,WAAW,QAAQ,cAAc,KAAK;CAEnE,IAAI,IAAI,UAAU,WAChB,OAAO;CAGT,OAAO,GAAG,IAAI,MAAM,GAAG,YAAY,CAAC,EAAE;AACxC;AAEA,SAAS,cAAc,OAAwB;CAC7C,IAAI;EACF,OAAO,KAAK,UAAU,KAAK;CAC7B,QAAQ;EACN,OAAO,oBAAoB,OAAO,MAAM;CAC1C;AACF"}
1
+ {"version":3,"file":"router-prompt.mjs","names":[],"sources":["../../../../../../../ai/src/supervisor/router-prompt.ts"],"sourcesContent":["import { END } from \"../contracts/end.type\";\nimport type { IterationSnapshot } from \"../contracts/supervisor/iteration-snapshot.type\";\nimport type { SupervisorInput } from \"../contracts/supervisor/supervisor-input.type\";\nimport type { ResolvedIntentEntry } from \"./entries\";\n\n/**\n * Build the per-turn user message the supervisor feeds to the router\n * agent. Carries everything the LLM needs to make a routing decision:\n *\n * - Available intents with descriptions (so the router knows what\n * to pick from).\n * - The reserved `END` sentinel value it can emit to terminate.\n * - Iteration counter + ceiling so the router can pace itself.\n * - Compact history of prior iterations (intent + short output clip).\n * - The supervisor's original input so the router stays anchored.\n *\n * Note the router's own `systemPrompt` is kept persistent across\n * turns — this function produces only the per-turn USER message.\n */\nexport function buildRouterContextMessage(params: {\n entries: Map<string, ResolvedIntentEntry>;\n iteration: number;\n maxIterations: number;\n iterations: IterationSnapshot[];\n input: SupervisorInput;\n /**\n * Per-execute state at the START of this iteration (post-merge of\n * the previous iteration). Rendered as a JSON snippet so the\n * router can pick the next intent based on what's already filled\n * in (Q14).\n */\n state?: Record<string, unknown>;\n /**\n * Reviewer feedback string from the previous iteration's evaluate\n * verdict. Rendered as its own section so the router weighs it\n * alongside the intent list (Q18).\n */\n feedback?: string;\n /**\n * Supervisor-level system prompt text, when configured. Surfaced at\n * the TOP of the router's per-turn user message so the router reads\n * team/domain context before the routing mechanics block. Skipped\n * when the supervisor didn't configure `systemPrompt`.\n */\n supervisorPrompt?: string;\n /**\n * Resolved natural-language objective from `SupervisorConfig.goal`.\n * Surfaced as its own labeled section near the top of the router's\n * user message so routing decisions are objective-aware. Skipped\n * when no goal was configured.\n */\n goal?: string;\n}): string {\n const {\n entries,\n iteration,\n maxIterations,\n iterations,\n input,\n state,\n feedback,\n supervisorPrompt,\n goal,\n } = params;\n\n const intentLines = [...entries.values()].map(\n entry => `- ${entry.intent}: ${entry.description}`,\n );\n\n const historyLines =\n iterations.length === 0\n ? [\"(none yet)\"]\n : iterations.map(snapshot => formatHistoryLine(snapshot));\n\n const sections: string[] = [];\n\n if (supervisorPrompt) {\n sections.push(supervisorPrompt.trim(), \"\");\n }\n\n if (goal) {\n sections.push(\"Goal:\", goal.trim(), \"\");\n }\n\n sections.push(\n \"Available intents:\",\n ...intentLines,\n \"\",\n \"Reserved values:\",\n `- ${END} = terminate the run`,\n \"\",\n `Iteration: ${iteration + 1} / ${maxIterations}`,\n \"\",\n \"History:\",\n ...historyLines,\n );\n\n if (state && Object.keys(state).length > 0) {\n sections.push(\"\", \"Current state:\", safeStringify(state));\n }\n\n if (feedback) {\n sections.push(\"\", `Reviewer feedback from last iteration: ${feedback}`);\n }\n\n const renderedInput =\n typeof input === \"string\" ? input : safeStringify(input);\n\n sections.push(\"\", `Original input: ${renderedInput}`);\n\n return sections.join(\"\\n\");\n}\n\nfunction formatHistoryLine(snapshot: IterationSnapshot): string {\n const branches = Object.entries(snapshot.result).map(\n ([intent, branch]) => `${intent} → ${clip(branch.output)}`,\n );\n\n return `[${snapshot.iteration}] ${branches.join(\" | \")}`;\n}\n\nfunction clip(value: unknown, maxLength = 160): string {\n if (value === undefined || value === null) {\n return String(value);\n }\n\n const raw = typeof value === \"string\" ? value : safeStringify(value);\n\n if (raw.length <= maxLength) {\n return raw;\n }\n\n return `${raw.slice(0, maxLength - 1)}…`;\n}\n\nfunction safeStringify(value: unknown): string {\n try {\n return JSON.stringify(value);\n } catch {\n return `[unserializable: ${typeof value}]`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmBA,SAAgB,0BAA0B,QAiC/B;CACT,MAAM,EACJ,SACA,WACA,eACA,YACA,OACA,OACA,UACA,kBACA,SACE;CAEJ,MAAM,cAAc,CAAC,GAAG,QAAQ,OAAO,CAAC,CAAC,CAAC,KACxC,UAAS,KAAK,MAAM,OAAO,IAAI,MAAM,aACvC;CAEA,MAAM,eACJ,WAAW,WAAW,IAClB,CAAC,YAAY,IACb,WAAW,KAAI,aAAY,kBAAkB,QAAQ,CAAC;CAE5D,MAAM,WAAqB,CAAC;CAE5B,IAAI,kBACF,SAAS,KAAK,iBAAiB,KAAK,GAAG,EAAE;CAG3C,IAAI,MACF,SAAS,KAAK,SAAS,KAAK,KAAK,GAAG,EAAE;CAGxC,SAAS,KACP,sBACA,GAAG,aACH,IACA,oBACA,KAAK,IAAI,uBACT,IACA,cAAc,YAAY,EAAE,KAAK,iBACjC,IACA,YACA,GAAG,YACL;CAEA,IAAI,SAAS,OAAO,KAAK,KAAK,CAAC,CAAC,SAAS,GACvC,SAAS,KAAK,IAAI,kBAAkB,cAAc,KAAK,CAAC;CAG1D,IAAI,UACF,SAAS,KAAK,IAAI,0CAA0C,UAAU;CAGxE,MAAM,gBACJ,OAAO,UAAU,WAAW,QAAQ,cAAc,KAAK;CAEzD,SAAS,KAAK,IAAI,mBAAmB,eAAe;CAEpD,OAAO,SAAS,KAAK,IAAI;AAC3B;AAEA,SAAS,kBAAkB,UAAqC;CAC9D,MAAM,WAAW,OAAO,QAAQ,SAAS,MAAM,CAAC,CAAC,KAC9C,CAAC,QAAQ,YAAY,GAAG,OAAO,KAAK,KAAK,OAAO,MAAM,GACzD;CAEA,OAAO,IAAI,SAAS,UAAU,IAAI,SAAS,KAAK,KAAK;AACvD;AAEA,SAAS,KAAK,OAAgB,YAAY,KAAa;CACrD,IAAI,UAAU,UAAa,UAAU,MACnC,OAAO,OAAO,KAAK;CAGrB,MAAM,MAAM,OAAO,UAAU,WAAW,QAAQ,cAAc,KAAK;CAEnE,IAAI,IAAI,UAAU,WAChB,OAAO;CAGT,OAAO,GAAG,IAAI,MAAM,GAAG,YAAY,CAAC,EAAE;AACxC;AAEA,SAAS,cAAc,OAAwB;CAC7C,IAAI;EACF,OAAO,KAAK,UAAU,KAAK;CAC7B,QAAQ;EACN,OAAO,oBAAoB,OAAO,MAAM;CAC1C;AACF"}
@@ -1,7 +1,7 @@
1
1
  import { SupervisorConfig } from "../contracts/supervisor/supervisor-config.type.mjs";
2
2
  import { ResolvedIntentEntry } from "./entries.mjs";
3
3
 
4
- //#region ../@warlock.js/ai/src/supervisor/signature.d.ts
4
+ //#region ../ai/src/supervisor/signature.d.ts
5
5
  /**
6
6
  * Deterministic structural fingerprint of a supervisor definition.
7
7
  * Persisted on every snapshot so `resume()` can detect drift between
@@ -1 +1 @@
1
- {"version":3,"file":"signature.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/supervisor/signature.ts"],"mappings":";;;;;;AAwBA;;;;;;;;;;;;;;AAE2C;;;;iBAF3B,gBAAA,CACd,MAAA,EAAQ,gBAAA,WACR,OAAA,EAAS,GAAA,SAAY,mBAAA"}
1
+ {"version":3,"file":"signature.d.mts","names":[],"sources":["../../../../../../../ai/src/supervisor/signature.ts"],"mappings":";;;;;;AAwBA;;;;;;;;;;;;;;AAE2C;;;;iBAF3B,gBAAA,CACd,MAAA,EAAQ,gBAAA,WACR,OAAA,EAAS,GAAA,SAAY,mBAAA"}
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/supervisor/signature.ts
1
+ //#region ../ai/src/supervisor/signature.ts
2
2
  /**
3
3
  * Deterministic structural fingerprint of a supervisor definition.
4
4
  * Persisted on every snapshot so `resume()` can detect drift between
@@ -1 +1 @@
1
- {"version":3,"file":"signature.mjs","names":[],"sources":["../../../../../../../@warlock.js/ai/src/supervisor/signature.ts"],"sourcesContent":["import { ClassifierAgentEntry, ClassifierRunEntry } from \"../contracts\";\nimport type { SupervisorConfig } from \"../contracts/supervisor/supervisor-config.type\";\nimport type { ResolvedIntentEntry } from \"./entries\";\n\n/**\n * Deterministic structural fingerprint of a supervisor definition.\n * Persisted on every snapshot so `resume()` can detect drift between\n * the saved run and the current definition. Covers:\n *\n * - Supervisor name.\n * - Every intent key + its resolved description + the underlying\n * unit's stable identity (agent name, workflow name + signature,\n * or `\"callback\"` marker for dev-callback intents).\n * - Router agent's name (if the supervisor uses LLM routing).\n * - Whether a deterministic `route` callback is configured (but not\n * its contents — route callbacks are code, not data).\n * - Whether an `evaluate` callback is configured.\n * - `initialAgent` when set.\n * - `maxIterations` (a semantic shape change, not a cosmetic one).\n *\n * Does NOT cover: system prompt text, logger, store identity, per-\n * event handlers — all runtime knobs that don't change the shape of\n * a resumable run.\n */\nexport function computeSignature(\n config: SupervisorConfig<unknown>,\n entries: Map<string, ResolvedIntentEntry>,\n): string {\n const intentsFingerprint = [...entries.entries()]\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([intent, entry]) => ({\n k: intent,\n d: entry.description,\n u: fingerprintUnit(entry),\n }));\n\n const fingerprint = {\n n: config.name,\n a: intentsFingerprint,\n r: resolveRouterName(config.router),\n rc: config.route ? 1 : 0,\n e: config.evaluate ? 1 : 0,\n i: config.initialAgent ?? null,\n m: config.maxIterations ?? null,\n // Phase 7 / decisions §37 — classifier is part of structural identity.\n // Resume drift detection notices when the classifier swap changes\n // routing semantics. Same fingerprint shape as router (agent name\n // when applicable; \"callback\" marker for callback form).\n c: resolveClassifierFingerprint(config.classifier),\n };\n\n return hash(JSON.stringify(fingerprint));\n}\n\nfunction resolveRouterName(router: SupervisorConfig<unknown>[\"router\"]): string | null {\n if (!router) {\n return null;\n }\n\n if (typeof (router as { execute?: unknown }).execute === \"function\") {\n return (router as { name?: string }).name ?? null;\n }\n\n return (router as { agent?: { name?: string } }).agent?.name ?? null;\n}\n\nfunction resolveClassifierFingerprint(\n classifier: SupervisorConfig<unknown>[\"classifier\"],\n): unknown {\n if (!classifier) {\n return null;\n }\n\n if (typeof classifier === \"function\") {\n return { t: \"callback\" };\n }\n\n if (typeof (classifier as { execute?: unknown }).execute === \"function\") {\n return { t: \"agent\", n: (classifier as { name?: string }).name ?? null };\n }\n\n if (typeof (classifier as ClassifierRunEntry).run === \"function\") {\n return { t: \"callback\" };\n }\n\n if (typeof (classifier as ClassifierAgentEntry).agent?.execute === \"function\") {\n return {\n t: \"agent\",\n n: (classifier as ClassifierAgentEntry).agent?.name ?? null,\n };\n }\n\n return { t: \"unknown\" };\n}\n\nfunction fingerprintUnit(entry: ResolvedIntentEntry): unknown {\n if (entry.type === \"callback\") {\n // Callbacks are dev code — fingerprint the type + intent name\n // only (the closure itself can't be hashed deterministically).\n // Drift detection covers add/remove/rename of callback intents,\n // not edits to the function body. Same trade-off as `route`.\n return { t: \"callback\" };\n }\n\n if (entry.type === \"workflow\") {\n const workflow = entry.unit;\n return { t: \"workflow\", n: workflow.name, s: workflow.signature };\n }\n\n return { t: \"agent\", n: entry.unit.name };\n}\n\n/**\n * FNV-1a 32-bit — same hash `workflow/signature.ts` uses. Deterministic,\n * no crypto dependency, cheap; signatures are 8-char hex.\n */\nfunction hash(input: string): string {\n let h = 0x811c9dc5;\n\n for (let i = 0; i < input.length; i++) {\n h ^= input.charCodeAt(i);\n h = (h + ((h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24))) >>> 0;\n }\n\n return h.toString(16).padStart(8, \"0\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBA,SAAgB,iBACd,QACA,SACQ;CACR,MAAM,qBAAqB,CAAC,GAAG,QAAQ,QAAQ,CAAC,CAAC,CAC9C,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,CACtC,KAAK,CAAC,QAAQ,YAAY;EACzB,GAAG;EACH,GAAG,MAAM;EACT,GAAG,gBAAgB,KAAK;CAC1B,EAAE;CAEJ,MAAM,cAAc;EAClB,GAAG,OAAO;EACV,GAAG;EACH,GAAG,kBAAkB,OAAO,MAAM;EAClC,IAAI,OAAO,QAAQ,IAAI;EACvB,GAAG,OAAO,WAAW,IAAI;EACzB,GAAG,OAAO,gBAAgB;EAC1B,GAAG,OAAO,iBAAiB;EAK3B,GAAG,6BAA6B,OAAO,UAAU;CACnD;CAEA,OAAO,KAAK,KAAK,UAAU,WAAW,CAAC;AACzC;AAEA,SAAS,kBAAkB,QAA4D;CACrF,IAAI,CAAC,QACH,OAAO;CAGT,IAAI,OAAQ,OAAiC,YAAY,YACvD,OAAQ,OAA6B,QAAQ;CAG/C,OAAQ,OAAyC,OAAO,QAAQ;AAClE;AAEA,SAAS,6BACP,YACS;CACT,IAAI,CAAC,YACH,OAAO;CAGT,IAAI,OAAO,eAAe,YACxB,OAAO,EAAE,GAAG,WAAW;CAGzB,IAAI,OAAQ,WAAqC,YAAY,YAC3D,OAAO;EAAE,GAAG;EAAS,GAAI,WAAiC,QAAQ;CAAK;CAGzE,IAAI,OAAQ,WAAkC,QAAQ,YACpD,OAAO,EAAE,GAAG,WAAW;CAGzB,IAAI,OAAQ,WAAoC,OAAO,YAAY,YACjE,OAAO;EACL,GAAG;EACH,GAAI,WAAoC,OAAO,QAAQ;CACzD;CAGF,OAAO,EAAE,GAAG,UAAU;AACxB;AAEA,SAAS,gBAAgB,OAAqC;CAC5D,IAAI,MAAM,SAAS,YAKjB,OAAO,EAAE,GAAG,WAAW;CAGzB,IAAI,MAAM,SAAS,YAAY;EAC7B,MAAM,WAAW,MAAM;EACvB,OAAO;GAAE,GAAG;GAAY,GAAG,SAAS;GAAM,GAAG,SAAS;EAAU;CAClE;CAEA,OAAO;EAAE,GAAG;EAAS,GAAG,MAAM,KAAK;CAAK;AAC1C;;;;;AAMA,SAAS,KAAK,OAAuB;CACnC,IAAI,IAAI;CAER,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACrC,KAAK,MAAM,WAAW,CAAC;EACvB,IAAK,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,SAAU;CACxE;CAEA,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;AACvC"}
1
+ {"version":3,"file":"signature.mjs","names":[],"sources":["../../../../../../../ai/src/supervisor/signature.ts"],"sourcesContent":["import { ClassifierAgentEntry, ClassifierRunEntry } from \"../contracts\";\nimport type { SupervisorConfig } from \"../contracts/supervisor/supervisor-config.type\";\nimport type { ResolvedIntentEntry } from \"./entries\";\n\n/**\n * Deterministic structural fingerprint of a supervisor definition.\n * Persisted on every snapshot so `resume()` can detect drift between\n * the saved run and the current definition. Covers:\n *\n * - Supervisor name.\n * - Every intent key + its resolved description + the underlying\n * unit's stable identity (agent name, workflow name + signature,\n * or `\"callback\"` marker for dev-callback intents).\n * - Router agent's name (if the supervisor uses LLM routing).\n * - Whether a deterministic `route` callback is configured (but not\n * its contents — route callbacks are code, not data).\n * - Whether an `evaluate` callback is configured.\n * - `initialAgent` when set.\n * - `maxIterations` (a semantic shape change, not a cosmetic one).\n *\n * Does NOT cover: system prompt text, logger, store identity, per-\n * event handlers — all runtime knobs that don't change the shape of\n * a resumable run.\n */\nexport function computeSignature(\n config: SupervisorConfig<unknown>,\n entries: Map<string, ResolvedIntentEntry>,\n): string {\n const intentsFingerprint = [...entries.entries()]\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([intent, entry]) => ({\n k: intent,\n d: entry.description,\n u: fingerprintUnit(entry),\n }));\n\n const fingerprint = {\n n: config.name,\n a: intentsFingerprint,\n r: resolveRouterName(config.router),\n rc: config.route ? 1 : 0,\n e: config.evaluate ? 1 : 0,\n i: config.initialAgent ?? null,\n m: config.maxIterations ?? null,\n // Phase 7 / decisions §37 — classifier is part of structural identity.\n // Resume drift detection notices when the classifier swap changes\n // routing semantics. Same fingerprint shape as router (agent name\n // when applicable; \"callback\" marker for callback form).\n c: resolveClassifierFingerprint(config.classifier),\n };\n\n return hash(JSON.stringify(fingerprint));\n}\n\nfunction resolveRouterName(router: SupervisorConfig<unknown>[\"router\"]): string | null {\n if (!router) {\n return null;\n }\n\n if (typeof (router as { execute?: unknown }).execute === \"function\") {\n return (router as { name?: string }).name ?? null;\n }\n\n return (router as { agent?: { name?: string } }).agent?.name ?? null;\n}\n\nfunction resolveClassifierFingerprint(\n classifier: SupervisorConfig<unknown>[\"classifier\"],\n): unknown {\n if (!classifier) {\n return null;\n }\n\n if (typeof classifier === \"function\") {\n return { t: \"callback\" };\n }\n\n if (typeof (classifier as { execute?: unknown }).execute === \"function\") {\n return { t: \"agent\", n: (classifier as { name?: string }).name ?? null };\n }\n\n if (typeof (classifier as ClassifierRunEntry).run === \"function\") {\n return { t: \"callback\" };\n }\n\n if (typeof (classifier as ClassifierAgentEntry).agent?.execute === \"function\") {\n return {\n t: \"agent\",\n n: (classifier as ClassifierAgentEntry).agent?.name ?? null,\n };\n }\n\n return { t: \"unknown\" };\n}\n\nfunction fingerprintUnit(entry: ResolvedIntentEntry): unknown {\n if (entry.type === \"callback\") {\n // Callbacks are dev code — fingerprint the type + intent name\n // only (the closure itself can't be hashed deterministically).\n // Drift detection covers add/remove/rename of callback intents,\n // not edits to the function body. Same trade-off as `route`.\n return { t: \"callback\" };\n }\n\n if (entry.type === \"workflow\") {\n const workflow = entry.unit;\n return { t: \"workflow\", n: workflow.name, s: workflow.signature };\n }\n\n return { t: \"agent\", n: entry.unit.name };\n}\n\n/**\n * FNV-1a 32-bit — same hash `workflow/signature.ts` uses. Deterministic,\n * no crypto dependency, cheap; signatures are 8-char hex.\n */\nfunction hash(input: string): string {\n let h = 0x811c9dc5;\n\n for (let i = 0; i < input.length; i++) {\n h ^= input.charCodeAt(i);\n h = (h + ((h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24))) >>> 0;\n }\n\n return h.toString(16).padStart(8, \"0\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBA,SAAgB,iBACd,QACA,SACQ;CACR,MAAM,qBAAqB,CAAC,GAAG,QAAQ,QAAQ,CAAC,CAAC,CAC9C,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,CACtC,KAAK,CAAC,QAAQ,YAAY;EACzB,GAAG;EACH,GAAG,MAAM;EACT,GAAG,gBAAgB,KAAK;CAC1B,EAAE;CAEJ,MAAM,cAAc;EAClB,GAAG,OAAO;EACV,GAAG;EACH,GAAG,kBAAkB,OAAO,MAAM;EAClC,IAAI,OAAO,QAAQ,IAAI;EACvB,GAAG,OAAO,WAAW,IAAI;EACzB,GAAG,OAAO,gBAAgB;EAC1B,GAAG,OAAO,iBAAiB;EAK3B,GAAG,6BAA6B,OAAO,UAAU;CACnD;CAEA,OAAO,KAAK,KAAK,UAAU,WAAW,CAAC;AACzC;AAEA,SAAS,kBAAkB,QAA4D;CACrF,IAAI,CAAC,QACH,OAAO;CAGT,IAAI,OAAQ,OAAiC,YAAY,YACvD,OAAQ,OAA6B,QAAQ;CAG/C,OAAQ,OAAyC,OAAO,QAAQ;AAClE;AAEA,SAAS,6BACP,YACS;CACT,IAAI,CAAC,YACH,OAAO;CAGT,IAAI,OAAO,eAAe,YACxB,OAAO,EAAE,GAAG,WAAW;CAGzB,IAAI,OAAQ,WAAqC,YAAY,YAC3D,OAAO;EAAE,GAAG;EAAS,GAAI,WAAiC,QAAQ;CAAK;CAGzE,IAAI,OAAQ,WAAkC,QAAQ,YACpD,OAAO,EAAE,GAAG,WAAW;CAGzB,IAAI,OAAQ,WAAoC,OAAO,YAAY,YACjE,OAAO;EACL,GAAG;EACH,GAAI,WAAoC,OAAO,QAAQ;CACzD;CAGF,OAAO,EAAE,GAAG,UAAU;AACxB;AAEA,SAAS,gBAAgB,OAAqC;CAC5D,IAAI,MAAM,SAAS,YAKjB,OAAO,EAAE,GAAG,WAAW;CAGzB,IAAI,MAAM,SAAS,YAAY;EAC7B,MAAM,WAAW,MAAM;EACvB,OAAO;GAAE,GAAG;GAAY,GAAG,SAAS;GAAM,GAAG,SAAS;EAAU;CAClE;CAEA,OAAO;EAAE,GAAG;EAAS,GAAG,MAAM,KAAK;CAAK;AAC1C;;;;;AAMA,SAAS,KAAK,OAAuB;CACnC,IAAI,IAAI;CAER,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACrC,KAAK,MAAM,WAAW,CAAC;EACvB,IAAK,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,SAAU;CACxE;CAEA,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;AACvC"}
@@ -4,7 +4,7 @@ import { SupervisorResumeOptions } from "../contracts/supervisor/supervisor-exec
4
4
  import { SupervisorConfig } from "../contracts/supervisor/supervisor-config.type.mjs";
5
5
  import { IterationSnapshot } from "../contracts/supervisor/iteration-snapshot.type.mjs";
6
6
 
7
- //#region ../@warlock.js/ai/src/supervisor/snapshot.d.ts
7
+ //#region ../ai/src/supervisor/snapshot.d.ts
8
8
  type PersistParams = {
9
9
  config: SupervisorConfig<unknown>;
10
10
  signature: string;
@@ -1 +1 @@
1
- {"version":3,"file":"snapshot.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/supervisor/snapshot.ts"],"mappings":";;;;;;;KAoBY,aAAA;EACV,MAAA,EAAQ,gBAAA;EACR,SAAA;EACA,KAAA;EACA,KAAA,EAAO,eAAA;EACP,SAAA;EACA,SAAA;EACA,SAAA,EAAW,iBAAA;EACX,MAAA,EAAQ,wBAAA;AAAA;AAAA,KAGE,cAAA;EAAmB,EAAA;AAAA;EAAe,EAAA;EAAW,KAAA;AAAA;;;;;;;;;iBAUnC,yBAAA,CACpB,MAAA,EAAQ,aAAA,GACP,OAAA,CAAQ,cAAA;AAZX;;;;;;;AAAA,iBA+CsB,qBAAA,CAAsB,MAAA;EAC1C,MAAA,EAAQ,gBAAA;EACR,SAAA;EACA,KAAA;EACA,OAAA,GAAU,uBAAA;AAAA,IACR,OAAA,CAAQ,kBAAA"}
1
+ {"version":3,"file":"snapshot.d.mts","names":[],"sources":["../../../../../../../ai/src/supervisor/snapshot.ts"],"mappings":";;;;;;;KAoBY,aAAA;EACV,MAAA,EAAQ,gBAAA;EACR,SAAA;EACA,KAAA;EACA,KAAA,EAAO,eAAA;EACP,SAAA;EACA,SAAA;EACA,SAAA,EAAW,iBAAA;EACX,MAAA,EAAQ,wBAAA;AAAA;AAAA,KAGE,cAAA;EAAmB,EAAA;AAAA;EAAe,EAAA;EAAW,KAAA;AAAA;;;;;;;;;iBAUnC,yBAAA,CACpB,MAAA,EAAQ,aAAA,GACP,OAAA,CAAQ,cAAA;AAZX;;;;;;;AAAA,iBA+CsB,qBAAA,CAAsB,MAAA;EAC1C,MAAA,EAAQ,gBAAA;EACR,SAAA;EACA,KAAA;EACA,OAAA,GAAU,uBAAA;AAAA,IACR,OAAA,CAAQ,kBAAA"}
@@ -3,7 +3,7 @@ import { SupervisorDriftError } from "../errors/supervisor-drift-error.mjs";
3
3
  import "../errors/index.mjs";
4
4
  import { resolveDefaultSnapshotStore } from "../config.mjs";
5
5
 
6
- //#region ../@warlock.js/ai/src/supervisor/snapshot.ts
6
+ //#region ../ai/src/supervisor/snapshot.ts
7
7
  /**
8
8
  * Resolve the effective {@link SnapshotStore}: the supervisor's own
9
9
  * `snapshotStore` field wins; absent that, fall back to the global
@@ -1 +1 @@
1
- {"version":3,"file":"snapshot.mjs","names":[],"sources":["../../../../../../../@warlock.js/ai/src/supervisor/snapshot.ts"],"sourcesContent":["import { resolveDefaultSnapshotStore } from \"../config\";\nimport type { IterationSnapshot } from \"../contracts/supervisor/iteration-snapshot.type\";\nimport type { SupervisorConfig } from \"../contracts/supervisor/supervisor-config.type\";\nimport type { SupervisorResumeOptions } from \"../contracts/supervisor/supervisor-execute-options.type\";\nimport type { SupervisorInput } from \"../contracts/supervisor/supervisor-input.type\";\nimport type {\n SupervisorSnapshot,\n SupervisorSnapshotStatus,\n} from \"../contracts/supervisor/supervisor-snapshot.type\";\nimport { SupervisorDriftError, SupervisorFailedError } from \"../errors\";\n\n/**\n * Resolve the effective {@link SnapshotStore}: the supervisor's own\n * `snapshotStore` field wins; absent that, fall back to the global\n * default set via `ai.config({ defaultSnapshotStore })`.\n */\nfunction resolveSnapshotStore(config: SupervisorConfig<unknown>) {\n return config.snapshotStore ?? resolveDefaultSnapshotStore();\n}\n\nexport type PersistParams = {\n config: SupervisorConfig<unknown>;\n signature: string;\n runId: string;\n input: SupervisorInput;\n startedAt: string;\n iteration: number;\n snapshots: IterationSnapshot[];\n status: SupervisorSnapshotStatus;\n};\n\nexport type PersistOutcome = { ok: true } | { ok: false; error: unknown };\n\n/**\n * Write the current run state to the resolved snapshot store. No-op\n * (ok) when neither the supervisor's `snapshotStore` nor the global\n * `defaultStore` is configured. Failures are returned as\n * `{ ok: false }` rather than thrown so the engine can surface them\n * via events/logs without aborting the run — callers decide whether\n * a failed checkpoint is fatal.\n */\nexport async function persistSupervisorSnapshot(\n params: PersistParams,\n): Promise<PersistOutcome> {\n const store = resolveSnapshotStore(params.config);\n\n if (!store) {\n return { ok: true };\n }\n\n const snapshot: SupervisorSnapshot = {\n runId: params.runId,\n supervisorName: params.config.name,\n signature: params.signature,\n input: params.input,\n iteration: params.iteration,\n snapshots: params.snapshots,\n status: params.status,\n startedAt: params.startedAt,\n savedAt: new Date().toISOString(),\n };\n\n try {\n await store.save(snapshot);\n\n return { ok: true };\n } catch (error) {\n return { ok: false, error };\n }\n}\n\n/**\n * Load a persisted snapshot for `resume()` and run the drift check.\n * Throws `SupervisorFailedError` when no store is configured or when\n * the run is missing; throws `SupervisorDriftError` when the stored\n * signature doesn't match the current definition (unless `force` is\n * set).\n */\nexport async function loadSnapshotForResume(params: {\n config: SupervisorConfig<unknown>;\n signature: string;\n runId: string;\n options?: SupervisorResumeOptions;\n}): Promise<SupervisorSnapshot> {\n const store = resolveSnapshotStore(params.config);\n\n if (!store) {\n throw new SupervisorFailedError(\n `supervisor \"${params.config.name}\" has no store configured — set \\`snapshotStore\\` on the config or call \\`ai.config({ defaultSnapshotStore })\\` at boot before calling resume()`,\n { context: { runId: params.runId } },\n );\n }\n\n const snapshot = (await store.load(params.runId)) ?? null;\n\n if (!snapshot) {\n throw new SupervisorFailedError(\n `supervisor \"${params.config.name}\": no snapshot for runId \"${params.runId}\"`,\n { context: { runId: params.runId } },\n );\n }\n\n if (!params.options?.force && snapshot.signature !== params.signature) {\n throw new SupervisorDriftError(\n `supervisor \"${params.config.name}\" signature drift on resume`,\n {\n savedSignature: snapshot.signature,\n currentSignature: params.signature,\n runId: params.runId,\n },\n );\n }\n\n return snapshot;\n}\n"],"mappings":";;;;;;;;;;;AAgBA,SAAS,qBAAqB,QAAmC;CAC/D,OAAO,OAAO,iBAAiB,4BAA4B;AAC7D;;;;;;;;;AAuBA,eAAsB,0BACpB,QACyB;CACzB,MAAM,QAAQ,qBAAqB,OAAO,MAAM;CAEhD,IAAI,CAAC,OACH,OAAO,EAAE,IAAI,KAAK;CAGpB,MAAM,WAA+B;EACnC,OAAO,OAAO;EACd,gBAAgB,OAAO,OAAO;EAC9B,WAAW,OAAO;EAClB,OAAO,OAAO;EACd,WAAW,OAAO;EAClB,WAAW,OAAO;EAClB,QAAQ,OAAO;EACf,WAAW,OAAO;EAClB,0BAAS,IAAI,KAAK,EAAC,CAAC,YAAY;CAClC;CAEA,IAAI;EACF,MAAM,MAAM,KAAK,QAAQ;EAEzB,OAAO,EAAE,IAAI,KAAK;CACpB,SAAS,OAAO;EACd,OAAO;GAAE,IAAI;GAAO;EAAM;CAC5B;AACF;;;;;;;;AASA,eAAsB,sBAAsB,QAKZ;CAC9B,MAAM,QAAQ,qBAAqB,OAAO,MAAM;CAEhD,IAAI,CAAC,OACH,MAAM,IAAI,sBACR,eAAe,OAAO,OAAO,KAAK,kJAClC,EAAE,SAAS,EAAE,OAAO,OAAO,MAAM,EAAE,CACrC;CAGF,MAAM,WAAY,MAAM,MAAM,KAAK,OAAO,KAAK,KAAM;CAErD,IAAI,CAAC,UACH,MAAM,IAAI,sBACR,eAAe,OAAO,OAAO,KAAK,4BAA4B,OAAO,MAAM,IAC3E,EAAE,SAAS,EAAE,OAAO,OAAO,MAAM,EAAE,CACrC;CAGF,IAAI,CAAC,OAAO,SAAS,SAAS,SAAS,cAAc,OAAO,WAC1D,MAAM,IAAI,qBACR,eAAe,OAAO,OAAO,KAAK,8BAClC;EACE,gBAAgB,SAAS;EACzB,kBAAkB,OAAO;EACzB,OAAO,OAAO;CAChB,CACF;CAGF,OAAO;AACT"}
1
+ {"version":3,"file":"snapshot.mjs","names":[],"sources":["../../../../../../../ai/src/supervisor/snapshot.ts"],"sourcesContent":["import { resolveDefaultSnapshotStore } from \"../config\";\nimport type { IterationSnapshot } from \"../contracts/supervisor/iteration-snapshot.type\";\nimport type { SupervisorConfig } from \"../contracts/supervisor/supervisor-config.type\";\nimport type { SupervisorResumeOptions } from \"../contracts/supervisor/supervisor-execute-options.type\";\nimport type { SupervisorInput } from \"../contracts/supervisor/supervisor-input.type\";\nimport type {\n SupervisorSnapshot,\n SupervisorSnapshotStatus,\n} from \"../contracts/supervisor/supervisor-snapshot.type\";\nimport { SupervisorDriftError, SupervisorFailedError } from \"../errors\";\n\n/**\n * Resolve the effective {@link SnapshotStore}: the supervisor's own\n * `snapshotStore` field wins; absent that, fall back to the global\n * default set via `ai.config({ defaultSnapshotStore })`.\n */\nfunction resolveSnapshotStore(config: SupervisorConfig<unknown>) {\n return config.snapshotStore ?? resolveDefaultSnapshotStore();\n}\n\nexport type PersistParams = {\n config: SupervisorConfig<unknown>;\n signature: string;\n runId: string;\n input: SupervisorInput;\n startedAt: string;\n iteration: number;\n snapshots: IterationSnapshot[];\n status: SupervisorSnapshotStatus;\n};\n\nexport type PersistOutcome = { ok: true } | { ok: false; error: unknown };\n\n/**\n * Write the current run state to the resolved snapshot store. No-op\n * (ok) when neither the supervisor's `snapshotStore` nor the global\n * `defaultStore` is configured. Failures are returned as\n * `{ ok: false }` rather than thrown so the engine can surface them\n * via events/logs without aborting the run — callers decide whether\n * a failed checkpoint is fatal.\n */\nexport async function persistSupervisorSnapshot(\n params: PersistParams,\n): Promise<PersistOutcome> {\n const store = resolveSnapshotStore(params.config);\n\n if (!store) {\n return { ok: true };\n }\n\n const snapshot: SupervisorSnapshot = {\n runId: params.runId,\n supervisorName: params.config.name,\n signature: params.signature,\n input: params.input,\n iteration: params.iteration,\n snapshots: params.snapshots,\n status: params.status,\n startedAt: params.startedAt,\n savedAt: new Date().toISOString(),\n };\n\n try {\n await store.save(snapshot);\n\n return { ok: true };\n } catch (error) {\n return { ok: false, error };\n }\n}\n\n/**\n * Load a persisted snapshot for `resume()` and run the drift check.\n * Throws `SupervisorFailedError` when no store is configured or when\n * the run is missing; throws `SupervisorDriftError` when the stored\n * signature doesn't match the current definition (unless `force` is\n * set).\n */\nexport async function loadSnapshotForResume(params: {\n config: SupervisorConfig<unknown>;\n signature: string;\n runId: string;\n options?: SupervisorResumeOptions;\n}): Promise<SupervisorSnapshot> {\n const store = resolveSnapshotStore(params.config);\n\n if (!store) {\n throw new SupervisorFailedError(\n `supervisor \"${params.config.name}\" has no store configured — set \\`snapshotStore\\` on the config or call \\`ai.config({ defaultSnapshotStore })\\` at boot before calling resume()`,\n { context: { runId: params.runId } },\n );\n }\n\n const snapshot = (await store.load(params.runId)) ?? null;\n\n if (!snapshot) {\n throw new SupervisorFailedError(\n `supervisor \"${params.config.name}\": no snapshot for runId \"${params.runId}\"`,\n { context: { runId: params.runId } },\n );\n }\n\n if (!params.options?.force && snapshot.signature !== params.signature) {\n throw new SupervisorDriftError(\n `supervisor \"${params.config.name}\" signature drift on resume`,\n {\n savedSignature: snapshot.signature,\n currentSignature: params.signature,\n runId: params.runId,\n },\n );\n }\n\n return snapshot;\n}\n"],"mappings":";;;;;;;;;;;AAgBA,SAAS,qBAAqB,QAAmC;CAC/D,OAAO,OAAO,iBAAiB,4BAA4B;AAC7D;;;;;;;;;AAuBA,eAAsB,0BACpB,QACyB;CACzB,MAAM,QAAQ,qBAAqB,OAAO,MAAM;CAEhD,IAAI,CAAC,OACH,OAAO,EAAE,IAAI,KAAK;CAGpB,MAAM,WAA+B;EACnC,OAAO,OAAO;EACd,gBAAgB,OAAO,OAAO;EAC9B,WAAW,OAAO;EAClB,OAAO,OAAO;EACd,WAAW,OAAO;EAClB,WAAW,OAAO;EAClB,QAAQ,OAAO;EACf,WAAW,OAAO;EAClB,0BAAS,IAAI,KAAK,EAAC,CAAC,YAAY;CAClC;CAEA,IAAI;EACF,MAAM,MAAM,KAAK,QAAQ;EAEzB,OAAO,EAAE,IAAI,KAAK;CACpB,SAAS,OAAO;EACd,OAAO;GAAE,IAAI;GAAO;EAAM;CAC5B;AACF;;;;;;;;AASA,eAAsB,sBAAsB,QAKZ;CAC9B,MAAM,QAAQ,qBAAqB,OAAO,MAAM;CAEhD,IAAI,CAAC,OACH,MAAM,IAAI,sBACR,eAAe,OAAO,OAAO,KAAK,kJAClC,EAAE,SAAS,EAAE,OAAO,OAAO,MAAM,EAAE,CACrC;CAGF,MAAM,WAAY,MAAM,MAAM,KAAK,OAAO,KAAK,KAAM;CAErD,IAAI,CAAC,UACH,MAAM,IAAI,sBACR,eAAe,OAAO,OAAO,KAAK,4BAA4B,OAAO,MAAM,IAC3E,EAAE,SAAS,EAAE,OAAO,OAAO,MAAM,EAAE,CACrC;CAGF,IAAI,CAAC,OAAO,SAAS,SAAS,SAAS,cAAc,OAAO,WAC1D,MAAM,IAAI,qBACR,eAAe,OAAO,OAAO,KAAK,8BAClC;EACE,gBAAgB,SAAS;EACzB,kBAAkB,OAAO;EACzB,OAAO,OAAO;CAChB,CACF;CAGF,OAAO;AACT"}
@@ -1,7 +1,7 @@
1
1
  import { StreamContract } from "../contracts/stream/stream.contract.mjs";
2
2
  import { SupervisorStreamEvent } from "../contracts/supervisor/supervisor-stream-event.type.mjs";
3
3
 
4
- //#region ../@warlock.js/ai/src/supervisor/supervisor-stream.d.ts
4
+ //#region ../ai/src/supervisor/supervisor-stream.d.ts
5
5
  /**
6
6
  * Internal async-queue controller driving `supervisor.stream()`.
7
7
  * Mirrors `StreamController` from `agent-stream.ts` — same
@@ -1 +1 @@
1
- {"version":3,"file":"supervisor-stream.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/supervisor/supervisor-stream.ts"],"mappings":";;;;;AAaA;;;;;KAAY,0BAAA;EACV,IAAA,CAAK,KAAA,EAAO,qBAAA;EACZ,GAAA,CAAI,MAAA,EAAQ,OAAA;EACZ,IAAA,CAAK,KAAA,EAAO,KAAA;AAAA;;;;;;;;iBAeE,sBAAA;EACd,UAAA,EAAY,0BAAA,CAA2B,OAAA;EACvC,MAAA,EAAQ,cAAA,CAAe,OAAA,EAAS,qBAAA;AAAA"}
1
+ {"version":3,"file":"supervisor-stream.d.mts","names":[],"sources":["../../../../../../../ai/src/supervisor/supervisor-stream.ts"],"mappings":";;;;;AAaA;;;;;KAAY,0BAAA;EACV,IAAA,CAAK,KAAA,EAAO,qBAAA;EACZ,GAAA,CAAI,MAAA,EAAQ,OAAA;EACZ,IAAA,CAAK,KAAA,EAAO,KAAA;AAAA;;;;;;;;iBAeE,sBAAA;EACd,UAAA,EAAY,0BAAA,CAA2B,OAAA;EACvC,MAAA,EAAQ,cAAA,CAAe,OAAA,EAAS,qBAAA;AAAA"}
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/supervisor/supervisor-stream.ts
1
+ //#region ../ai/src/supervisor/supervisor-stream.ts
2
2
  /**
3
3
  * Factory mirroring `createAgentStream`. Returns a paired
4
4
  * `{ controller, stream }` — the `SupervisorExecution` pushes events
@@ -1 +1 @@
1
- {"version":3,"file":"supervisor-stream.mjs","names":[],"sources":["../../../../../../../@warlock.js/ai/src/supervisor/supervisor-stream.ts"],"sourcesContent":["import type { StreamContract } from \"../contracts/stream/stream.contract\";\nimport type { SupervisorStreamEvent } from \"../contracts/supervisor/supervisor-stream-event.type\";\n\n// Re-export so internal callers that already imported from this file\n// keep working unchanged. Canonical home is the contracts barrel.\nexport type { SupervisorStreamEvent };\n\n/**\n * Internal async-queue controller driving `supervisor.stream()`.\n * Mirrors `StreamController` from `agent-stream.ts` — same\n * producer/consumer pipe, same semantics, parameterized by the\n * supervisor event union and terminal result type.\n */\nexport type SupervisorStreamController<TResult> = {\n push(event: SupervisorStreamEvent): void;\n end(result: TResult): void;\n fail(error: Error): void;\n};\n\ntype PendingRead = {\n resolve(value: IteratorResult<SupervisorStreamEvent>): void;\n reject(error: Error): void;\n};\n\n/**\n * Factory mirroring `createAgentStream`. Returns a paired\n * `{ controller, stream }` — the `SupervisorExecution` pushes events\n * into the controller while the caller iterates (or awaits `.result`)\n * on the stream side. See `agent-stream.ts` for the full role\n * description.\n */\nexport function createSupervisorStream<TResult>(): {\n controller: SupervisorStreamController<TResult>;\n stream: StreamContract<TResult, SupervisorStreamEvent>;\n} {\n const queue: SupervisorStreamEvent[] = [];\n const pending: PendingRead[] = [];\n const handlers = new Map<string, (event: SupervisorStreamEvent) => void>();\n\n let closed = false;\n let failure: Error | undefined;\n let resolveResult!: (value: TResult) => void;\n let rejectResult!: (error: Error) => void;\n\n const result = new Promise<TResult>((resolve, reject) => {\n resolveResult = resolve;\n rejectResult = reject;\n });\n\n const controller: SupervisorStreamController<TResult> = {\n push(event) {\n const handler = handlers.get(event.type);\n\n if (handler) {\n try {\n handler(event);\n } catch {\n // Stream handlers must never crash the supervisor.\n }\n }\n\n const reader = pending.shift();\n\n if (reader) {\n reader.resolve({ value: event, done: false });\n return;\n }\n\n queue.push(event);\n },\n\n end(finalResult) {\n closed = true;\n resolveResult(finalResult);\n\n while (pending.length > 0) {\n pending.shift()?.resolve({ value: undefined, done: true });\n }\n },\n\n fail(error) {\n closed = true;\n failure = error;\n rejectResult(error);\n\n while (pending.length > 0) {\n pending.shift()?.reject(error);\n }\n },\n };\n\n const iterator: AsyncIterator<SupervisorStreamEvent> = {\n next() {\n if (queue.length > 0) {\n return Promise.resolve({ value: queue.shift()!, done: false });\n }\n\n if (closed) {\n if (failure) {\n return Promise.reject(failure);\n }\n\n return Promise.resolve({ value: undefined, done: true });\n }\n\n return new Promise<IteratorResult<SupervisorStreamEvent>>(\n (resolve, reject) => {\n pending.push({ resolve, reject });\n },\n );\n },\n };\n\n // The `StreamContract<TResult>` shape is shared across primitives —\n // it types `on()` over the generic `StreamEvent` union (agent\n // events). Supervisor events are a distinct discriminated union\n // with the same `type`-keyed shape, so we satisfy the contract via\n // a structural cast — handlers see the supervisor events at their\n // correct narrowed types.\n const stream = {\n result,\n on(handlerMap) {\n for (const [key, handler] of Object.entries(handlerMap)) {\n if (handler) {\n handlers.set(key, handler as (event: SupervisorStreamEvent) => void);\n }\n }\n\n return stream;\n },\n [Symbol.asyncIterator]() {\n return iterator;\n },\n } as StreamContract<TResult, SupervisorStreamEvent>;\n\n return { controller, stream };\n}\n"],"mappings":";;;;;;;;AA+BA,SAAgB,yBAGd;CACA,MAAM,QAAiC,CAAC;CACxC,MAAM,UAAyB,CAAC;CAChC,MAAM,2BAAW,IAAI,IAAoD;CAEzE,IAAI,SAAS;CACb,IAAI;CACJ,IAAI;CACJ,IAAI;CAEJ,MAAM,SAAS,IAAI,SAAkB,SAAS,WAAW;EACvD,gBAAgB;EAChB,eAAe;CACjB,CAAC;CAED,MAAM,aAAkD;EACtD,KAAK,OAAO;GACV,MAAM,UAAU,SAAS,IAAI,MAAM,IAAI;GAEvC,IAAI,SACF,IAAI;IACF,QAAQ,KAAK;GACf,QAAQ,CAER;GAGF,MAAM,SAAS,QAAQ,MAAM;GAE7B,IAAI,QAAQ;IACV,OAAO,QAAQ;KAAE,OAAO;KAAO,MAAM;IAAM,CAAC;IAC5C;GACF;GAEA,MAAM,KAAK,KAAK;EAClB;EAEA,IAAI,aAAa;GACf,SAAS;GACT,cAAc,WAAW;GAEzB,OAAO,QAAQ,SAAS,GACtB,QAAQ,MAAM,CAAC,EAAE,QAAQ;IAAE,OAAO;IAAW,MAAM;GAAK,CAAC;EAE7D;EAEA,KAAK,OAAO;GACV,SAAS;GACT,UAAU;GACV,aAAa,KAAK;GAElB,OAAO,QAAQ,SAAS,GACtB,QAAQ,MAAM,CAAC,EAAE,OAAO,KAAK;EAEjC;CACF;CAEA,MAAM,WAAiD,EACrD,OAAO;EACL,IAAI,MAAM,SAAS,GACjB,OAAO,QAAQ,QAAQ;GAAE,OAAO,MAAM,MAAM;GAAI,MAAM;EAAM,CAAC;EAG/D,IAAI,QAAQ;GACV,IAAI,SACF,OAAO,QAAQ,OAAO,OAAO;GAG/B,OAAO,QAAQ,QAAQ;IAAE,OAAO;IAAW,MAAM;GAAK,CAAC;EACzD;EAEA,OAAO,IAAI,SACR,SAAS,WAAW;GACnB,QAAQ,KAAK;IAAE;IAAS;GAAO,CAAC;EAClC,CACF;CACF,EACF;CAQA,MAAM,SAAS;EACb;EACA,GAAG,YAAY;GACb,KAAK,MAAM,CAAC,KAAK,YAAY,OAAO,QAAQ,UAAU,GACpD,IAAI,SACF,SAAS,IAAI,KAAK,OAAiD;GAIvE,OAAO;EACT;EACA,CAAC,OAAO,iBAAiB;GACvB,OAAO;EACT;CACF;CAEA,OAAO;EAAE;EAAY;CAAO;AAC9B"}
1
+ {"version":3,"file":"supervisor-stream.mjs","names":[],"sources":["../../../../../../../ai/src/supervisor/supervisor-stream.ts"],"sourcesContent":["import type { StreamContract } from \"../contracts/stream/stream.contract\";\nimport type { SupervisorStreamEvent } from \"../contracts/supervisor/supervisor-stream-event.type\";\n\n// Re-export so internal callers that already imported from this file\n// keep working unchanged. Canonical home is the contracts barrel.\nexport type { SupervisorStreamEvent };\n\n/**\n * Internal async-queue controller driving `supervisor.stream()`.\n * Mirrors `StreamController` from `agent-stream.ts` — same\n * producer/consumer pipe, same semantics, parameterized by the\n * supervisor event union and terminal result type.\n */\nexport type SupervisorStreamController<TResult> = {\n push(event: SupervisorStreamEvent): void;\n end(result: TResult): void;\n fail(error: Error): void;\n};\n\ntype PendingRead = {\n resolve(value: IteratorResult<SupervisorStreamEvent>): void;\n reject(error: Error): void;\n};\n\n/**\n * Factory mirroring `createAgentStream`. Returns a paired\n * `{ controller, stream }` — the `SupervisorExecution` pushes events\n * into the controller while the caller iterates (or awaits `.result`)\n * on the stream side. See `agent-stream.ts` for the full role\n * description.\n */\nexport function createSupervisorStream<TResult>(): {\n controller: SupervisorStreamController<TResult>;\n stream: StreamContract<TResult, SupervisorStreamEvent>;\n} {\n const queue: SupervisorStreamEvent[] = [];\n const pending: PendingRead[] = [];\n const handlers = new Map<string, (event: SupervisorStreamEvent) => void>();\n\n let closed = false;\n let failure: Error | undefined;\n let resolveResult!: (value: TResult) => void;\n let rejectResult!: (error: Error) => void;\n\n const result = new Promise<TResult>((resolve, reject) => {\n resolveResult = resolve;\n rejectResult = reject;\n });\n\n const controller: SupervisorStreamController<TResult> = {\n push(event) {\n const handler = handlers.get(event.type);\n\n if (handler) {\n try {\n handler(event);\n } catch {\n // Stream handlers must never crash the supervisor.\n }\n }\n\n const reader = pending.shift();\n\n if (reader) {\n reader.resolve({ value: event, done: false });\n return;\n }\n\n queue.push(event);\n },\n\n end(finalResult) {\n closed = true;\n resolveResult(finalResult);\n\n while (pending.length > 0) {\n pending.shift()?.resolve({ value: undefined, done: true });\n }\n },\n\n fail(error) {\n closed = true;\n failure = error;\n rejectResult(error);\n\n while (pending.length > 0) {\n pending.shift()?.reject(error);\n }\n },\n };\n\n const iterator: AsyncIterator<SupervisorStreamEvent> = {\n next() {\n if (queue.length > 0) {\n return Promise.resolve({ value: queue.shift()!, done: false });\n }\n\n if (closed) {\n if (failure) {\n return Promise.reject(failure);\n }\n\n return Promise.resolve({ value: undefined, done: true });\n }\n\n return new Promise<IteratorResult<SupervisorStreamEvent>>(\n (resolve, reject) => {\n pending.push({ resolve, reject });\n },\n );\n },\n };\n\n // The `StreamContract<TResult>` shape is shared across primitives —\n // it types `on()` over the generic `StreamEvent` union (agent\n // events). Supervisor events are a distinct discriminated union\n // with the same `type`-keyed shape, so we satisfy the contract via\n // a structural cast — handlers see the supervisor events at their\n // correct narrowed types.\n const stream = {\n result,\n on(handlerMap) {\n for (const [key, handler] of Object.entries(handlerMap)) {\n if (handler) {\n handlers.set(key, handler as (event: SupervisorStreamEvent) => void);\n }\n }\n\n return stream;\n },\n [Symbol.asyncIterator]() {\n return iterator;\n },\n } as StreamContract<TResult, SupervisorStreamEvent>;\n\n return { controller, stream };\n}\n"],"mappings":";;;;;;;;AA+BA,SAAgB,yBAGd;CACA,MAAM,QAAiC,CAAC;CACxC,MAAM,UAAyB,CAAC;CAChC,MAAM,2BAAW,IAAI,IAAoD;CAEzE,IAAI,SAAS;CACb,IAAI;CACJ,IAAI;CACJ,IAAI;CAEJ,MAAM,SAAS,IAAI,SAAkB,SAAS,WAAW;EACvD,gBAAgB;EAChB,eAAe;CACjB,CAAC;CAED,MAAM,aAAkD;EACtD,KAAK,OAAO;GACV,MAAM,UAAU,SAAS,IAAI,MAAM,IAAI;GAEvC,IAAI,SACF,IAAI;IACF,QAAQ,KAAK;GACf,QAAQ,CAER;GAGF,MAAM,SAAS,QAAQ,MAAM;GAE7B,IAAI,QAAQ;IACV,OAAO,QAAQ;KAAE,OAAO;KAAO,MAAM;IAAM,CAAC;IAC5C;GACF;GAEA,MAAM,KAAK,KAAK;EAClB;EAEA,IAAI,aAAa;GACf,SAAS;GACT,cAAc,WAAW;GAEzB,OAAO,QAAQ,SAAS,GACtB,QAAQ,MAAM,CAAC,EAAE,QAAQ;IAAE,OAAO;IAAW,MAAM;GAAK,CAAC;EAE7D;EAEA,KAAK,OAAO;GACV,SAAS;GACT,UAAU;GACV,aAAa,KAAK;GAElB,OAAO,QAAQ,SAAS,GACtB,QAAQ,MAAM,CAAC,EAAE,OAAO,KAAK;EAEjC;CACF;CAEA,MAAM,WAAiD,EACrD,OAAO;EACL,IAAI,MAAM,SAAS,GACjB,OAAO,QAAQ,QAAQ;GAAE,OAAO,MAAM,MAAM;GAAI,MAAM;EAAM,CAAC;EAG/D,IAAI,QAAQ;GACV,IAAI,SACF,OAAO,QAAQ,OAAO,OAAO;GAG/B,OAAO,QAAQ,QAAQ;IAAE,OAAO;IAAW,MAAM;GAAK,CAAC;EACzD;EAEA,OAAO,IAAI,SACR,SAAS,WAAW;GACnB,QAAQ,KAAK;IAAE;IAAS;GAAO,CAAC;EAClC,CACF;CACF,EACF;CAQA,MAAM,SAAS;EACb;EACA,GAAG,YAAY;GACb,KAAK,MAAM,CAAC,KAAK,YAAY,OAAO,QAAQ,UAAU,GACpD,IAAI,SACF,SAAS,IAAI,KAAK,OAAiD;GAIvE,OAAO;EACT;EACA,CAAC,OAAO,iBAAiB;GACvB,OAAO;EACT;CACF;CAEA,OAAO;EAAE;EAAY;CAAO;AAC9B"}
@@ -2,7 +2,7 @@ import { SupervisorIntentValue } from "../contracts/supervisor/intent-entry.type
2
2
  import { SupervisorConfig } from "../contracts/supervisor/supervisor-config.type.mjs";
3
3
  import { SupervisorContract } from "../contracts/supervisor/supervisor.contract.mjs";
4
4
 
5
- //#region ../@warlock.js/ai/src/supervisor/supervisor.d.ts
5
+ //#region ../ai/src/supervisor/supervisor.d.ts
6
6
  /**
7
7
  * `ai.supervisor(config)` — construct a `SupervisorContract`. Validates
8
8
  * the config at author time (throws `SupervisorFailedError` on bad
@@ -1 +1 @@
1
- {"version":3,"file":"supervisor.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/supervisor/supervisor.ts"],"mappings":";;;;;;;AAgDA;;;;;;;;;;;;;;;;iBAAgB,UAAA,6BAEL,OAAA,mBACQ,MAAA,SAAe,qBAAA,IAAyB,MAAA,SAAe,qBAAA,gBAC3D,MAAA,mBACb,MAAA,EAAQ,gBAAA,CAAiB,OAAA,EAAS,MAAA,EAAQ,QAAA,EAAU,UAAA,IAAc,kBAAA,CAAmB,OAAA"}
1
+ {"version":3,"file":"supervisor.d.mts","names":[],"sources":["../../../../../../../ai/src/supervisor/supervisor.ts"],"mappings":";;;;;;;AAgDA;;;;;;;;;;;;;;;;iBAAgB,UAAA,6BAEL,OAAA,mBACQ,MAAA,SAAe,qBAAA,IAAyB,MAAA,SAAe,qBAAA,gBAC3D,MAAA,mBACb,MAAA,EAAQ,gBAAA,CAAiB,OAAA,EAAS,MAAA,EAAQ,QAAA,EAAU,UAAA,IAAc,kBAAA,CAAmB,OAAA"}
@@ -9,7 +9,7 @@ import { SupervisorExecution } from "./execution.mjs";
9
9
  import { computeSignature } from "./signature.mjs";
10
10
  import { createSupervisorStream } from "./supervisor-stream.mjs";
11
11
 
12
- //#region ../@warlock.js/ai/src/supervisor/supervisor.ts
12
+ //#region ../ai/src/supervisor/supervisor.ts
13
13
  /**
14
14
  * `ai.supervisor(config)` — construct a `SupervisorContract`. Validates
15
15
  * the config at author time (throws `SupervisorFailedError` on bad
@@ -1 +1 @@
1
- {"version":3,"file":"supervisor.mjs","names":[],"sources":["../../../../../../../@warlock.js/ai/src/supervisor/supervisor.ts"],"sourcesContent":["import type { SupervisorEventMap } from \"../contracts/events/event-map.type\";\nimport type { ExecutionReport } from \"../contracts/result/execution-report.type\";\nimport type { SupervisorResult } from \"../contracts/result/supervisor-result.type\";\nimport type { StreamContract } from \"../contracts/stream/stream.contract\";\nimport type { SupervisorIntentValue } from \"../contracts/supervisor/intent-entry.type\";\nimport type {\n SupervisorConfig,\n SupervisorEventHandler,\n} from \"../contracts/supervisor/supervisor-config.type\";\nimport type {\n SupervisorExecuteOptions,\n SupervisorResumeOptions,\n} from \"../contracts/supervisor/supervisor-execute-options.type\";\nimport type { SupervisorInput } from \"../contracts/supervisor/supervisor-input.type\";\nimport type { SupervisorStreamEvent } from \"../contracts/supervisor/supervisor-stream-event.type\";\nimport type {\n SupervisorAsToolOptions,\n SupervisorContract,\n} from \"../contracts/supervisor/supervisor.contract\";\nimport { SupervisorFailedError } from \"../errors\";\nimport { notifyObservers } from \"../observe/resolve-observers\";\nimport type { ToolContract } from \"../tool/tool\";\nimport { asTool } from \"./as-tool\";\nimport { SupervisorEmitter } from \"./emitter\";\nimport { assertRouterDescriptions, resolveIntentEntries } from \"./entries\";\nimport { SupervisorExecution } from \"./execution\";\nimport { computeSignature } from \"./signature\";\nimport { loadSnapshotForResume } from \"./snapshot\";\nimport { createSupervisorStream } from \"./supervisor-stream\";\n\n/**\n * `ai.supervisor(config)` — construct a `SupervisorContract`. Validates\n * the config at author time (throws `SupervisorFailedError` on bad\n * shape), resolves agent entries, computes a stable structural\n * signature, wires the three-tier event emitter, and returns an\n * instance that satisfies `ExecutableContract` so it can compose into\n * tools, outer agents, and (future) orchestrators uniformly.\n *\n * @example\n * const support = ai.supervisor({\n * name: \"customer-support\",\n * router: routerAgent,\n * intents: { triage, orderLookup, billingLookup, resolver },\n * evaluate: (ctx) => ctx.result.resolver?.output ? { satisfied: true } : undefined,\n * output: z.object({ response: z.string(), refund: z.boolean() }),\n * maxIterations: 6,\n * });\n */\nexport function supervisor<\n TOutput = unknown,\n TState = TOutput,\n TIntents extends Record<string, SupervisorIntentValue> = Record<string, SupervisorIntentValue>,\n TArtifacts = Record<string, unknown>,\n>(config: SupervisorConfig<TOutput, TState, TIntents, TArtifacts>): SupervisorContract<TOutput> {\n validateFactoryConfig(config as unknown as SupervisorConfig<TOutput>);\n\n const entries = resolveIntentEntries(config.intents, config.name);\n\n assertRouterDescriptions(config as SupervisorConfig<unknown>, entries);\n\n if (config.initialAgent && !entries.has(config.initialAgent)) {\n throw new SupervisorFailedError(\n `ai.supervisor(\"${config.name}\"): \\`initialAgent\\` \"${config.initialAgent}\" is not a key in \\`intents\\``,\n { context: { authoring: true } },\n );\n }\n\n const signature = computeSignature(config as SupervisorConfig<unknown>, entries);\n const emitter = new SupervisorEmitter(config.on);\n\n async function execute(\n input: SupervisorInput,\n options?: SupervisorExecuteOptions,\n ): Promise<SupervisorResult<TOutput>> {\n const runId = options?.runId ?? generateRunId();\n\n const execution = new SupervisorExecution<TOutput>({\n config: config as unknown as SupervisorConfig<TOutput>,\n entries,\n signature,\n emitter,\n input,\n runId,\n options,\n });\n\n const result = await execution.run();\n\n // Route the finished report to any resolved observers (F1/F3).\n // Gated by `config.observe` + the global observe-all flag; observer\n // errors are swallowed inside `notifyObservers`. `ai.team(...)`\n // forwards its `observe` into this same config, so a team inherits\n // observability through here with no extra wiring. Bridge the\n // pre-existing `SupervisorReport = Omit<BaseReport, \"type\">` drift\n // (the report carries `type: \"supervisor\"` at runtime) so this call\n // site adds no new type error beyond the documented baseline.\n await notifyObservers(config.observe, result.report as unknown as ExecutionReport);\n\n return result;\n }\n\n function stream(\n input: SupervisorInput,\n options?: SupervisorExecuteOptions,\n ): StreamContract<SupervisorResult<TOutput>, SupervisorStreamEvent> {\n const runId = options?.runId ?? generateRunId();\n const { controller, stream: contract } = createSupervisorStream<SupervisorResult<TOutput>>();\n\n const execution = new SupervisorExecution<TOutput>({\n config: config as unknown as SupervisorConfig<TOutput>,\n entries,\n signature,\n emitter,\n input,\n runId,\n options,\n streamController: controller,\n });\n\n // Route the finished report to resolved observers once the streamed\n // run settles. Attached to the run promise (not awaited — `stream`\n // returns synchronously); `notifyObservers` swallows observer errors.\n void execution\n .run()\n .then((result) =>\n notifyObservers(config.observe, result.report as unknown as ExecutionReport),\n );\n\n return contract;\n }\n\n async function resume(\n runId: string,\n options?: SupervisorResumeOptions,\n ): Promise<SupervisorResult<TOutput>> {\n const snapshot = await loadSnapshotForResume({\n config: config as SupervisorConfig<unknown>,\n signature,\n runId,\n options,\n });\n\n const execution = new SupervisorExecution<TOutput>({\n config: config as unknown as SupervisorConfig<TOutput>,\n entries,\n signature,\n emitter,\n input: snapshot.input,\n runId,\n options,\n resumeFrom: snapshot,\n });\n\n const result = await execution.run();\n\n await notifyObservers(config.observe, result.report as unknown as ExecutionReport);\n\n return result;\n }\n\n const instance: SupervisorContract<TOutput> = {\n name: config.name,\n inputSchema: config.inputSchema,\n signature,\n execute,\n stream,\n resume,\n on<K extends keyof SupervisorEventMap>(\n event: K,\n handler: SupervisorEventHandler<K>,\n ): () => void {\n return emitter.on(event, handler);\n },\n off<K extends keyof SupervisorEventMap>(event: K, handler: SupervisorEventHandler<K>): void {\n emitter.off(event, handler);\n },\n asTool<TToolInput = string>(\n options: SupervisorAsToolOptions<TToolInput>,\n ): ToolContract<TToolInput, TOutput> {\n return asTool<TOutput, TToolInput>(instance, options);\n },\n };\n\n return instance;\n}\n\n/**\n * Factory-time validation. Enforces the XOR + pairing rules the design\n * locked in §2 and surfaces any violation as a typed\n * `SupervisorFailedError` tagged `authoring: true`.\n */\nfunction validateFactoryConfig<T>(config: SupervisorConfig<T>): void {\n if (!config.name || typeof config.name !== \"string\") {\n throw new SupervisorFailedError(\"ai.supervisor: `name` is required and must be a string\", {\n context: { authoring: true },\n });\n }\n\n if (!config.intents || typeof config.intents !== \"object\") {\n throw new SupervisorFailedError(`ai.supervisor(\"${config.name}\"): \\`intents\\` is required`, {\n context: { authoring: true },\n });\n }\n\n const hasRoute = typeof config.route === \"function\";\n const hasRouter = !!config.router;\n\n if (hasRouter) {\n const router = config.router as { execute?: unknown } | { agent?: { execute?: unknown } };\n const isBareAgent = typeof (router as { execute?: unknown }).execute === \"function\";\n const isEntryForm =\n !isBareAgent &&\n typeof (router as { agent?: { execute?: unknown } }).agent === \"object\" &&\n typeof (router as { agent?: { execute?: unknown } }).agent?.execute === \"function\";\n\n if (!isBareAgent && !isEntryForm) {\n throw new SupervisorFailedError(\n `ai.supervisor(\"${config.name}\"): \\`router\\` must be an agent contract or a \\`{ agent, placeholders?, input? }\\` entry`,\n { context: { authoring: true } },\n );\n }\n }\n\n if (hasRoute && hasRouter) {\n throw new SupervisorFailedError(\n `ai.supervisor(\"${config.name}\"): \\`route\\` and \\`router\\` are mutually exclusive — configure exactly one`,\n { context: { authoring: true } },\n );\n }\n\n // Phase 7 / decisions §37 — `classifier` is the iter-0 prelude;\n // satisfies the \"must have a dispatch source\" rule on its own.\n // Composes with router/route (classifier drives iter 0; router/route\n // takes iter 1+). When configured alone, supervisor terminates after\n // iter 0's branch settles.\n const hasClassifier = config.classifier !== undefined;\n\n if (!hasRoute && !hasRouter && !hasClassifier) {\n throw new SupervisorFailedError(\n `ai.supervisor(\"${config.name}\"): one of \\`route\\`, \\`router\\`, or \\`classifier\\` is required`,\n { context: { authoring: true } },\n );\n }\n\n // Phase 7 — classifier and initialAgent both decide what runs first.\n // Coexistence is meaningless; throw loudly.\n if (hasClassifier && config.initialAgent) {\n throw new SupervisorFailedError(\n `ai.supervisor(\"${config.name}\"): \\`classifier\\` and \\`initialAgent\\` are mutually exclusive — both decide which intent runs first. Pick one.`,\n { context: { authoring: true } },\n );\n }\n\n // Phase 3.4 (Q9) — evaluate now pairs with both `route` and\n // `router`. State-driven termination is useful in either dispatch\n // mode; the historical router-only restriction was incidental,\n // not principled.\n\n if (config.ack !== undefined) {\n const ack = config.ack;\n const isCallback = typeof ack === \"function\";\n const isAgentEntry =\n typeof ack === \"object\" &&\n ack !== null &&\n typeof (ack as { agent?: { execute?: unknown } }).agent?.execute === \"function\";\n const isRunEntry =\n typeof ack === \"object\" &&\n ack !== null &&\n typeof (ack as { run?: unknown }).run === \"function\";\n\n if (!isCallback && !isAgentEntry && !isRunEntry) {\n throw new SupervisorFailedError(\n `ai.supervisor(\"${config.name}\"): \\`ack\\` must be an \\`{ agent, ... }\\` entry, an \\`{ run, ... }\\` entry, or a bare callback function`,\n { context: { authoring: true } },\n );\n }\n\n if (isAgentEntry && isRunEntry) {\n throw new SupervisorFailedError(\n `ai.supervisor(\"${config.name}\"): \\`ack\\` cannot declare both \\`agent\\` and \\`run\\` — pick one`,\n { context: { authoring: true } },\n );\n }\n }\n\n if (config.maxIterations !== undefined && config.maxIterations < 1) {\n throw new SupervisorFailedError(\n `ai.supervisor(\"${config.name}\"): \\`maxIterations\\` must be >= 1`,\n { context: { authoring: true, maxIterations: config.maxIterations } },\n );\n }\n}\n\nfunction generateRunId(): string {\n return `sup_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,SAAgB,WAKd,QAA8F;CAC9F,sBAAsB,MAA8C;CAEpE,MAAM,UAAU,qBAAqB,OAAO,SAAS,OAAO,IAAI;CAEhE,yBAAyB,QAAqC,OAAO;CAErE,IAAI,OAAO,gBAAgB,CAAC,QAAQ,IAAI,OAAO,YAAY,GACzD,MAAM,IAAI,sBACR,kBAAkB,OAAO,KAAK,wBAAwB,OAAO,aAAa,gCAC1E,EAAE,SAAS,EAAE,WAAW,KAAK,EAAE,CACjC;CAGF,MAAM,YAAY,iBAAiB,QAAqC,OAAO;CAC/E,MAAM,UAAU,IAAI,kBAAkB,OAAO,EAAE;CAE/C,eAAe,QACb,OACA,SACoC;EAapC,MAAM,SAAS,MAAM,IAVC,oBAA6B;GACzC;GACR;GACA;GACA;GACA;GACA,OARY,SAAS,SAAS,cAAc;GAS5C;EACF,CAE6B,CAAC,CAAC,IAAI;EAUnC,MAAM,gBAAgB,OAAO,SAAS,OAAO,MAAoC;EAEjF,OAAO;CACT;CAEA,SAAS,OACP,OACA,SACkE;EAClE,MAAM,QAAQ,SAAS,SAAS,cAAc;EAC9C,MAAM,EAAE,YAAY,QAAQ,aAAa,uBAAkD;EAgB3F,AAAK,IAdiB,oBAA6B;GACzC;GACR;GACA;GACA;GACA;GACA;GACA;GACA,kBAAkB;EACpB,CAKa,CAAC,CACX,IAAI,CAAC,CACL,MAAM,WACL,gBAAgB,OAAO,SAAS,OAAO,MAAoC,CAC7E;EAEF,OAAO;CACT;CAEA,eAAe,OACb,OACA,SACoC;EACpC,MAAM,WAAW,MAAM,sBAAsB;GACnC;GACR;GACA;GACA;EACF,CAAC;EAaD,MAAM,SAAS,MAAM,IAXC,oBAA6B;GACzC;GACR;GACA;GACA;GACA,OAAO,SAAS;GAChB;GACA;GACA,YAAY;EACd,CAE6B,CAAC,CAAC,IAAI;EAEnC,MAAM,gBAAgB,OAAO,SAAS,OAAO,MAAoC;EAEjF,OAAO;CACT;CAEA,MAAM,WAAwC;EAC5C,MAAM,OAAO;EACb,aAAa,OAAO;EACpB;EACA;EACA;EACA;EACA,GACE,OACA,SACY;GACZ,OAAO,QAAQ,GAAG,OAAO,OAAO;EAClC;EACA,IAAwC,OAAU,SAA0C;GAC1F,QAAQ,IAAI,OAAO,OAAO;EAC5B;EACA,OACE,SACmC;GACnC,OAAO,OAA4B,UAAU,OAAO;EACtD;CACF;CAEA,OAAO;AACT;;;;;;AAOA,SAAS,sBAAyB,QAAmC;CACnE,IAAI,CAAC,OAAO,QAAQ,OAAO,OAAO,SAAS,UACzC,MAAM,IAAI,sBAAsB,0DAA0D,EACxF,SAAS,EAAE,WAAW,KAAK,EAC7B,CAAC;CAGH,IAAI,CAAC,OAAO,WAAW,OAAO,OAAO,YAAY,UAC/C,MAAM,IAAI,sBAAsB,kBAAkB,OAAO,KAAK,8BAA8B,EAC1F,SAAS,EAAE,WAAW,KAAK,EAC7B,CAAC;CAGH,MAAM,WAAW,OAAO,OAAO,UAAU;CACzC,MAAM,YAAY,CAAC,CAAC,OAAO;CAE3B,IAAI,WAAW;EACb,MAAM,SAAS,OAAO;EACtB,MAAM,cAAc,OAAQ,OAAiC,YAAY;EACzE,MAAM,cACJ,CAAC,eACD,OAAQ,OAA6C,UAAU,YAC/D,OAAQ,OAA6C,OAAO,YAAY;EAE1E,IAAI,CAAC,eAAe,CAAC,aACnB,MAAM,IAAI,sBACR,kBAAkB,OAAO,KAAK,2FAC9B,EAAE,SAAS,EAAE,WAAW,KAAK,EAAE,CACjC;CAEJ;CAEA,IAAI,YAAY,WACd,MAAM,IAAI,sBACR,kBAAkB,OAAO,KAAK,8EAC9B,EAAE,SAAS,EAAE,WAAW,KAAK,EAAE,CACjC;CAQF,MAAM,gBAAgB,OAAO,eAAe;CAE5C,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,eAC9B,MAAM,IAAI,sBACR,kBAAkB,OAAO,KAAK,kEAC9B,EAAE,SAAS,EAAE,WAAW,KAAK,EAAE,CACjC;CAKF,IAAI,iBAAiB,OAAO,cAC1B,MAAM,IAAI,sBACR,kBAAkB,OAAO,KAAK,kHAC9B,EAAE,SAAS,EAAE,WAAW,KAAK,EAAE,CACjC;CAQF,IAAI,OAAO,QAAQ,QAAW;EAC5B,MAAM,MAAM,OAAO;EACnB,MAAM,aAAa,OAAO,QAAQ;EAClC,MAAM,eACJ,OAAO,QAAQ,YACf,QAAQ,QACR,OAAQ,IAA0C,OAAO,YAAY;EACvE,MAAM,aACJ,OAAO,QAAQ,YACf,QAAQ,QACR,OAAQ,IAA0B,QAAQ;EAE5C,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,YACnC,MAAM,IAAI,sBACR,kBAAkB,OAAO,KAAK,0GAC9B,EAAE,SAAS,EAAE,WAAW,KAAK,EAAE,CACjC;EAGF,IAAI,gBAAgB,YAClB,MAAM,IAAI,sBACR,kBAAkB,OAAO,KAAK,mEAC9B,EAAE,SAAS,EAAE,WAAW,KAAK,EAAE,CACjC;CAEJ;CAEA,IAAI,OAAO,kBAAkB,UAAa,OAAO,gBAAgB,GAC/D,MAAM,IAAI,sBACR,kBAAkB,OAAO,KAAK,qCAC9B,EAAE,SAAS;EAAE,WAAW;EAAM,eAAe,OAAO;CAAc,EAAE,CACtE;AAEJ;AAEA,SAAS,gBAAwB;CAC/B,OAAO,OAAO,KAAK,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,GAAG,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,GAAG,EAAE;AACjF"}
1
+ {"version":3,"file":"supervisor.mjs","names":[],"sources":["../../../../../../../ai/src/supervisor/supervisor.ts"],"sourcesContent":["import type { SupervisorEventMap } from \"../contracts/events/event-map.type\";\nimport type { ExecutionReport } from \"../contracts/result/execution-report.type\";\nimport type { SupervisorResult } from \"../contracts/result/supervisor-result.type\";\nimport type { StreamContract } from \"../contracts/stream/stream.contract\";\nimport type { SupervisorIntentValue } from \"../contracts/supervisor/intent-entry.type\";\nimport type {\n SupervisorConfig,\n SupervisorEventHandler,\n} from \"../contracts/supervisor/supervisor-config.type\";\nimport type {\n SupervisorExecuteOptions,\n SupervisorResumeOptions,\n} from \"../contracts/supervisor/supervisor-execute-options.type\";\nimport type { SupervisorInput } from \"../contracts/supervisor/supervisor-input.type\";\nimport type { SupervisorStreamEvent } from \"../contracts/supervisor/supervisor-stream-event.type\";\nimport type {\n SupervisorAsToolOptions,\n SupervisorContract,\n} from \"../contracts/supervisor/supervisor.contract\";\nimport { SupervisorFailedError } from \"../errors\";\nimport { notifyObservers } from \"../observe/resolve-observers\";\nimport type { ToolContract } from \"../tool/tool\";\nimport { asTool } from \"./as-tool\";\nimport { SupervisorEmitter } from \"./emitter\";\nimport { assertRouterDescriptions, resolveIntentEntries } from \"./entries\";\nimport { SupervisorExecution } from \"./execution\";\nimport { computeSignature } from \"./signature\";\nimport { loadSnapshotForResume } from \"./snapshot\";\nimport { createSupervisorStream } from \"./supervisor-stream\";\n\n/**\n * `ai.supervisor(config)` — construct a `SupervisorContract`. Validates\n * the config at author time (throws `SupervisorFailedError` on bad\n * shape), resolves agent entries, computes a stable structural\n * signature, wires the three-tier event emitter, and returns an\n * instance that satisfies `ExecutableContract` so it can compose into\n * tools, outer agents, and (future) orchestrators uniformly.\n *\n * @example\n * const support = ai.supervisor({\n * name: \"customer-support\",\n * router: routerAgent,\n * intents: { triage, orderLookup, billingLookup, resolver },\n * evaluate: (ctx) => ctx.result.resolver?.output ? { satisfied: true } : undefined,\n * output: z.object({ response: z.string(), refund: z.boolean() }),\n * maxIterations: 6,\n * });\n */\nexport function supervisor<\n TOutput = unknown,\n TState = TOutput,\n TIntents extends Record<string, SupervisorIntentValue> = Record<string, SupervisorIntentValue>,\n TArtifacts = Record<string, unknown>,\n>(config: SupervisorConfig<TOutput, TState, TIntents, TArtifacts>): SupervisorContract<TOutput> {\n validateFactoryConfig(config as unknown as SupervisorConfig<TOutput>);\n\n const entries = resolveIntentEntries(config.intents, config.name);\n\n assertRouterDescriptions(config as SupervisorConfig<unknown>, entries);\n\n if (config.initialAgent && !entries.has(config.initialAgent)) {\n throw new SupervisorFailedError(\n `ai.supervisor(\"${config.name}\"): \\`initialAgent\\` \"${config.initialAgent}\" is not a key in \\`intents\\``,\n { context: { authoring: true } },\n );\n }\n\n const signature = computeSignature(config as SupervisorConfig<unknown>, entries);\n const emitter = new SupervisorEmitter(config.on);\n\n async function execute(\n input: SupervisorInput,\n options?: SupervisorExecuteOptions,\n ): Promise<SupervisorResult<TOutput>> {\n const runId = options?.runId ?? generateRunId();\n\n const execution = new SupervisorExecution<TOutput>({\n config: config as unknown as SupervisorConfig<TOutput>,\n entries,\n signature,\n emitter,\n input,\n runId,\n options,\n });\n\n const result = await execution.run();\n\n // Route the finished report to any resolved observers (F1/F3).\n // Gated by `config.observe` + the global observe-all flag; observer\n // errors are swallowed inside `notifyObservers`. `ai.team(...)`\n // forwards its `observe` into this same config, so a team inherits\n // observability through here with no extra wiring. Bridge the\n // pre-existing `SupervisorReport = Omit<BaseReport, \"type\">` drift\n // (the report carries `type: \"supervisor\"` at runtime) so this call\n // site adds no new type error beyond the documented baseline.\n await notifyObservers(config.observe, result.report as unknown as ExecutionReport);\n\n return result;\n }\n\n function stream(\n input: SupervisorInput,\n options?: SupervisorExecuteOptions,\n ): StreamContract<SupervisorResult<TOutput>, SupervisorStreamEvent> {\n const runId = options?.runId ?? generateRunId();\n const { controller, stream: contract } = createSupervisorStream<SupervisorResult<TOutput>>();\n\n const execution = new SupervisorExecution<TOutput>({\n config: config as unknown as SupervisorConfig<TOutput>,\n entries,\n signature,\n emitter,\n input,\n runId,\n options,\n streamController: controller,\n });\n\n // Route the finished report to resolved observers once the streamed\n // run settles. Attached to the run promise (not awaited — `stream`\n // returns synchronously); `notifyObservers` swallows observer errors.\n void execution\n .run()\n .then((result) =>\n notifyObservers(config.observe, result.report as unknown as ExecutionReport),\n );\n\n return contract;\n }\n\n async function resume(\n runId: string,\n options?: SupervisorResumeOptions,\n ): Promise<SupervisorResult<TOutput>> {\n const snapshot = await loadSnapshotForResume({\n config: config as SupervisorConfig<unknown>,\n signature,\n runId,\n options,\n });\n\n const execution = new SupervisorExecution<TOutput>({\n config: config as unknown as SupervisorConfig<TOutput>,\n entries,\n signature,\n emitter,\n input: snapshot.input,\n runId,\n options,\n resumeFrom: snapshot,\n });\n\n const result = await execution.run();\n\n await notifyObservers(config.observe, result.report as unknown as ExecutionReport);\n\n return result;\n }\n\n const instance: SupervisorContract<TOutput> = {\n name: config.name,\n inputSchema: config.inputSchema,\n signature,\n execute,\n stream,\n resume,\n on<K extends keyof SupervisorEventMap>(\n event: K,\n handler: SupervisorEventHandler<K>,\n ): () => void {\n return emitter.on(event, handler);\n },\n off<K extends keyof SupervisorEventMap>(event: K, handler: SupervisorEventHandler<K>): void {\n emitter.off(event, handler);\n },\n asTool<TToolInput = string>(\n options: SupervisorAsToolOptions<TToolInput>,\n ): ToolContract<TToolInput, TOutput> {\n return asTool<TOutput, TToolInput>(instance, options);\n },\n };\n\n return instance;\n}\n\n/**\n * Factory-time validation. Enforces the XOR + pairing rules the design\n * locked in §2 and surfaces any violation as a typed\n * `SupervisorFailedError` tagged `authoring: true`.\n */\nfunction validateFactoryConfig<T>(config: SupervisorConfig<T>): void {\n if (!config.name || typeof config.name !== \"string\") {\n throw new SupervisorFailedError(\"ai.supervisor: `name` is required and must be a string\", {\n context: { authoring: true },\n });\n }\n\n if (!config.intents || typeof config.intents !== \"object\") {\n throw new SupervisorFailedError(`ai.supervisor(\"${config.name}\"): \\`intents\\` is required`, {\n context: { authoring: true },\n });\n }\n\n const hasRoute = typeof config.route === \"function\";\n const hasRouter = !!config.router;\n\n if (hasRouter) {\n const router = config.router as { execute?: unknown } | { agent?: { execute?: unknown } };\n const isBareAgent = typeof (router as { execute?: unknown }).execute === \"function\";\n const isEntryForm =\n !isBareAgent &&\n typeof (router as { agent?: { execute?: unknown } }).agent === \"object\" &&\n typeof (router as { agent?: { execute?: unknown } }).agent?.execute === \"function\";\n\n if (!isBareAgent && !isEntryForm) {\n throw new SupervisorFailedError(\n `ai.supervisor(\"${config.name}\"): \\`router\\` must be an agent contract or a \\`{ agent, placeholders?, input? }\\` entry`,\n { context: { authoring: true } },\n );\n }\n }\n\n if (hasRoute && hasRouter) {\n throw new SupervisorFailedError(\n `ai.supervisor(\"${config.name}\"): \\`route\\` and \\`router\\` are mutually exclusive — configure exactly one`,\n { context: { authoring: true } },\n );\n }\n\n // Phase 7 / decisions §37 — `classifier` is the iter-0 prelude;\n // satisfies the \"must have a dispatch source\" rule on its own.\n // Composes with router/route (classifier drives iter 0; router/route\n // takes iter 1+). When configured alone, supervisor terminates after\n // iter 0's branch settles.\n const hasClassifier = config.classifier !== undefined;\n\n if (!hasRoute && !hasRouter && !hasClassifier) {\n throw new SupervisorFailedError(\n `ai.supervisor(\"${config.name}\"): one of \\`route\\`, \\`router\\`, or \\`classifier\\` is required`,\n { context: { authoring: true } },\n );\n }\n\n // Phase 7 — classifier and initialAgent both decide what runs first.\n // Coexistence is meaningless; throw loudly.\n if (hasClassifier && config.initialAgent) {\n throw new SupervisorFailedError(\n `ai.supervisor(\"${config.name}\"): \\`classifier\\` and \\`initialAgent\\` are mutually exclusive — both decide which intent runs first. Pick one.`,\n { context: { authoring: true } },\n );\n }\n\n // Phase 3.4 (Q9) — evaluate now pairs with both `route` and\n // `router`. State-driven termination is useful in either dispatch\n // mode; the historical router-only restriction was incidental,\n // not principled.\n\n if (config.ack !== undefined) {\n const ack = config.ack;\n const isCallback = typeof ack === \"function\";\n const isAgentEntry =\n typeof ack === \"object\" &&\n ack !== null &&\n typeof (ack as { agent?: { execute?: unknown } }).agent?.execute === \"function\";\n const isRunEntry =\n typeof ack === \"object\" &&\n ack !== null &&\n typeof (ack as { run?: unknown }).run === \"function\";\n\n if (!isCallback && !isAgentEntry && !isRunEntry) {\n throw new SupervisorFailedError(\n `ai.supervisor(\"${config.name}\"): \\`ack\\` must be an \\`{ agent, ... }\\` entry, an \\`{ run, ... }\\` entry, or a bare callback function`,\n { context: { authoring: true } },\n );\n }\n\n if (isAgentEntry && isRunEntry) {\n throw new SupervisorFailedError(\n `ai.supervisor(\"${config.name}\"): \\`ack\\` cannot declare both \\`agent\\` and \\`run\\` — pick one`,\n { context: { authoring: true } },\n );\n }\n }\n\n if (config.maxIterations !== undefined && config.maxIterations < 1) {\n throw new SupervisorFailedError(\n `ai.supervisor(\"${config.name}\"): \\`maxIterations\\` must be >= 1`,\n { context: { authoring: true, maxIterations: config.maxIterations } },\n );\n }\n}\n\nfunction generateRunId(): string {\n return `sup_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,SAAgB,WAKd,QAA8F;CAC9F,sBAAsB,MAA8C;CAEpE,MAAM,UAAU,qBAAqB,OAAO,SAAS,OAAO,IAAI;CAEhE,yBAAyB,QAAqC,OAAO;CAErE,IAAI,OAAO,gBAAgB,CAAC,QAAQ,IAAI,OAAO,YAAY,GACzD,MAAM,IAAI,sBACR,kBAAkB,OAAO,KAAK,wBAAwB,OAAO,aAAa,gCAC1E,EAAE,SAAS,EAAE,WAAW,KAAK,EAAE,CACjC;CAGF,MAAM,YAAY,iBAAiB,QAAqC,OAAO;CAC/E,MAAM,UAAU,IAAI,kBAAkB,OAAO,EAAE;CAE/C,eAAe,QACb,OACA,SACoC;EAapC,MAAM,SAAS,MAAM,IAVC,oBAA6B;GACzC;GACR;GACA;GACA;GACA;GACA,OARY,SAAS,SAAS,cAAc;GAS5C;EACF,CAE6B,CAAC,CAAC,IAAI;EAUnC,MAAM,gBAAgB,OAAO,SAAS,OAAO,MAAoC;EAEjF,OAAO;CACT;CAEA,SAAS,OACP,OACA,SACkE;EAClE,MAAM,QAAQ,SAAS,SAAS,cAAc;EAC9C,MAAM,EAAE,YAAY,QAAQ,aAAa,uBAAkD;EAgB3F,AAAK,IAdiB,oBAA6B;GACzC;GACR;GACA;GACA;GACA;GACA;GACA;GACA,kBAAkB;EACpB,CAKa,CAAC,CACX,IAAI,CAAC,CACL,MAAM,WACL,gBAAgB,OAAO,SAAS,OAAO,MAAoC,CAC7E;EAEF,OAAO;CACT;CAEA,eAAe,OACb,OACA,SACoC;EACpC,MAAM,WAAW,MAAM,sBAAsB;GACnC;GACR;GACA;GACA;EACF,CAAC;EAaD,MAAM,SAAS,MAAM,IAXC,oBAA6B;GACzC;GACR;GACA;GACA;GACA,OAAO,SAAS;GAChB;GACA;GACA,YAAY;EACd,CAE6B,CAAC,CAAC,IAAI;EAEnC,MAAM,gBAAgB,OAAO,SAAS,OAAO,MAAoC;EAEjF,OAAO;CACT;CAEA,MAAM,WAAwC;EAC5C,MAAM,OAAO;EACb,aAAa,OAAO;EACpB;EACA;EACA;EACA;EACA,GACE,OACA,SACY;GACZ,OAAO,QAAQ,GAAG,OAAO,OAAO;EAClC;EACA,IAAwC,OAAU,SAA0C;GAC1F,QAAQ,IAAI,OAAO,OAAO;EAC5B;EACA,OACE,SACmC;GACnC,OAAO,OAA4B,UAAU,OAAO;EACtD;CACF;CAEA,OAAO;AACT;;;;;;AAOA,SAAS,sBAAyB,QAAmC;CACnE,IAAI,CAAC,OAAO,QAAQ,OAAO,OAAO,SAAS,UACzC,MAAM,IAAI,sBAAsB,0DAA0D,EACxF,SAAS,EAAE,WAAW,KAAK,EAC7B,CAAC;CAGH,IAAI,CAAC,OAAO,WAAW,OAAO,OAAO,YAAY,UAC/C,MAAM,IAAI,sBAAsB,kBAAkB,OAAO,KAAK,8BAA8B,EAC1F,SAAS,EAAE,WAAW,KAAK,EAC7B,CAAC;CAGH,MAAM,WAAW,OAAO,OAAO,UAAU;CACzC,MAAM,YAAY,CAAC,CAAC,OAAO;CAE3B,IAAI,WAAW;EACb,MAAM,SAAS,OAAO;EACtB,MAAM,cAAc,OAAQ,OAAiC,YAAY;EACzE,MAAM,cACJ,CAAC,eACD,OAAQ,OAA6C,UAAU,YAC/D,OAAQ,OAA6C,OAAO,YAAY;EAE1E,IAAI,CAAC,eAAe,CAAC,aACnB,MAAM,IAAI,sBACR,kBAAkB,OAAO,KAAK,2FAC9B,EAAE,SAAS,EAAE,WAAW,KAAK,EAAE,CACjC;CAEJ;CAEA,IAAI,YAAY,WACd,MAAM,IAAI,sBACR,kBAAkB,OAAO,KAAK,8EAC9B,EAAE,SAAS,EAAE,WAAW,KAAK,EAAE,CACjC;CAQF,MAAM,gBAAgB,OAAO,eAAe;CAE5C,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,eAC9B,MAAM,IAAI,sBACR,kBAAkB,OAAO,KAAK,kEAC9B,EAAE,SAAS,EAAE,WAAW,KAAK,EAAE,CACjC;CAKF,IAAI,iBAAiB,OAAO,cAC1B,MAAM,IAAI,sBACR,kBAAkB,OAAO,KAAK,kHAC9B,EAAE,SAAS,EAAE,WAAW,KAAK,EAAE,CACjC;CAQF,IAAI,OAAO,QAAQ,QAAW;EAC5B,MAAM,MAAM,OAAO;EACnB,MAAM,aAAa,OAAO,QAAQ;EAClC,MAAM,eACJ,OAAO,QAAQ,YACf,QAAQ,QACR,OAAQ,IAA0C,OAAO,YAAY;EACvE,MAAM,aACJ,OAAO,QAAQ,YACf,QAAQ,QACR,OAAQ,IAA0B,QAAQ;EAE5C,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,YACnC,MAAM,IAAI,sBACR,kBAAkB,OAAO,KAAK,0GAC9B,EAAE,SAAS,EAAE,WAAW,KAAK,EAAE,CACjC;EAGF,IAAI,gBAAgB,YAClB,MAAM,IAAI,sBACR,kBAAkB,OAAO,KAAK,mEAC9B,EAAE,SAAS,EAAE,WAAW,KAAK,EAAE,CACjC;CAEJ;CAEA,IAAI,OAAO,kBAAkB,UAAa,OAAO,gBAAgB,GAC/D,MAAM,IAAI,sBACR,kBAAkB,OAAO,KAAK,qCAC9B,EAAE,SAAS;EAAE,WAAW;EAAM,eAAe,OAAO;CAAc,EAAE,CACtE;AAEJ;AAEA,SAAS,gBAAwB;CAC/B,OAAO,OAAO,KAAK,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,GAAG,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,GAAG,EAAE;AACjF"}
@@ -1,7 +1,7 @@
1
1
  import { Placeholders } from "../contracts/placeholders.type.mjs";
2
2
  import { InstructionContract } from "../contracts/system-prompt.contract.mjs";
3
3
 
4
- //#region ../@warlock.js/ai/src/system-prompt/instruction.d.ts
4
+ //#region ../ai/src/system-prompt/instruction.d.ts
5
5
  /**
6
6
  * Concrete `InstructionContract` — a reusable directive block.
7
7
  *
@@ -1 +1 @@
1
- {"version":3,"file":"instruction.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/system-prompt/instruction.ts"],"mappings":";;;;;;AA8BA;;;;;;;;;;;;;AAY4C;AAY5C;;;;AAAsD;;;;;;cAxBzC,WAAA,YAAuB,mBAAmB;EAAA,SAGlB,IAAA;EAAA,SAFnB,IAAA;cAEmB,IAAA;;;;;;EAS5B,OAAA,CAAQ,YAAA,GAAe,YAAA;AAAA;;;;;;;;iBAYhB,WAAA,CAAY,IAAA,WAAe,WAAW"}
1
+ {"version":3,"file":"instruction.d.mts","names":[],"sources":["../../../../../../../ai/src/system-prompt/instruction.ts"],"mappings":";;;;;;AA8BA;;;;;;;;;;;;;AAY4C;AAY5C;;;;AAAsD;;;;;;cAxBzC,WAAA,YAAuB,mBAAmB;EAAA,SAGlB,IAAA;EAAA,SAFnB,IAAA;cAEmB,IAAA;;;;;;EAS5B,OAAA,CAAQ,YAAA,GAAe,YAAA;AAAA;;;;;;;;iBAYhB,WAAA,CAAY,IAAA,WAAe,WAAW"}
@@ -1,6 +1,6 @@
1
1
  import { renderPlaceholders } from "./render-placeholders.mjs";
2
2
 
3
- //#region ../@warlock.js/ai/src/system-prompt/instruction.ts
3
+ //#region ../ai/src/system-prompt/instruction.ts
4
4
  /**
5
5
  * Concrete `InstructionContract` — a reusable directive block.
6
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"instruction.mjs","names":[],"sources":["../../../../../../../@warlock.js/ai/src/system-prompt/instruction.ts"],"sourcesContent":["import type { Placeholders } from \"../contracts/placeholders.type\";\nimport type { InstructionContract } from \"../contracts/system-prompt.contract\";\nimport { renderPlaceholders } from \"./render-placeholders\";\n\n/**\n * Concrete `InstructionContract` — a reusable directive block.\n *\n * **Role.** A single addressable prompt block representing one rule the\n * agent must follow (`\"Always respond in {{language|English}}.\"`). Exists\n * as its own type so the same instruction can be shared across many\n * prompts and agents, each render supplying its own placeholder map.\n *\n * **Responsibility.**\n * - Owns: the `type: \"instruction\"` discriminator, the raw template text,\n * and the placeholder-rendering step.\n * - Does NOT own: ordering relative to other instructions, joining with a\n * persona, or any surrounding prompt composition — those concerns live\n * in `SystemPrompt`.\n *\n * Users construct via the `ai.instruction()` factory — `new Instruction()`\n * is not the public API (see §4.2 of code-style.md).\n *\n * @example\n * const replyInLanguage = ai.instruction(\"Respond in {{language|English}}.\");\n *\n * const prompt = ai.systemPrompt()\n * .persona(\"You are Alex.\")\n * .instruction(replyInLanguage)\n * .instruction(\"Always include code examples.\");\n */\nexport class Instruction implements InstructionContract {\n public readonly type = \"instruction\" as const;\n\n public constructor(public readonly text: string) {\n //\n }\n\n /**\n * Substitute `{{mustache}}` placeholders in the instruction text against\n * the supplied map. Delegates to the shared `renderPlaceholders` helper\n * so persona / instruction / system-prompt rendering stays identical.\n */\n public resolve(placeholders?: Placeholders): string {\n return renderPlaceholders(this.text, placeholders);\n }\n}\n\n/**\n * Create an `Instruction` from raw template text.\n *\n * @example\n * const replyIn = instruction(\"Respond in {{language|English}}.\");\n * const cite = instruction(\"Always cite sources inline.\");\n */\nexport function instruction(text: string): Instruction {\n return new Instruction(text);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAa,cAAb,MAAwD;CAGtD,AAAO,YAAY,AAAgB,MAAc;EAAd;cAFZ;CAIvB;;;;;;CAOA,AAAO,QAAQ,cAAqC;EAClD,OAAO,mBAAmB,KAAK,MAAM,YAAY;CACnD;AACF;;;;;;;;AASA,SAAgB,YAAY,MAA2B;CACrD,OAAO,IAAI,YAAY,IAAI;AAC7B"}
1
+ {"version":3,"file":"instruction.mjs","names":[],"sources":["../../../../../../../ai/src/system-prompt/instruction.ts"],"sourcesContent":["import type { Placeholders } from \"../contracts/placeholders.type\";\nimport type { InstructionContract } from \"../contracts/system-prompt.contract\";\nimport { renderPlaceholders } from \"./render-placeholders\";\n\n/**\n * Concrete `InstructionContract` — a reusable directive block.\n *\n * **Role.** A single addressable prompt block representing one rule the\n * agent must follow (`\"Always respond in {{language|English}}.\"`). Exists\n * as its own type so the same instruction can be shared across many\n * prompts and agents, each render supplying its own placeholder map.\n *\n * **Responsibility.**\n * - Owns: the `type: \"instruction\"` discriminator, the raw template text,\n * and the placeholder-rendering step.\n * - Does NOT own: ordering relative to other instructions, joining with a\n * persona, or any surrounding prompt composition — those concerns live\n * in `SystemPrompt`.\n *\n * Users construct via the `ai.instruction()` factory — `new Instruction()`\n * is not the public API (see §4.2 of code-style.md).\n *\n * @example\n * const replyInLanguage = ai.instruction(\"Respond in {{language|English}}.\");\n *\n * const prompt = ai.systemPrompt()\n * .persona(\"You are Alex.\")\n * .instruction(replyInLanguage)\n * .instruction(\"Always include code examples.\");\n */\nexport class Instruction implements InstructionContract {\n public readonly type = \"instruction\" as const;\n\n public constructor(public readonly text: string) {\n //\n }\n\n /**\n * Substitute `{{mustache}}` placeholders in the instruction text against\n * the supplied map. Delegates to the shared `renderPlaceholders` helper\n * so persona / instruction / system-prompt rendering stays identical.\n */\n public resolve(placeholders?: Placeholders): string {\n return renderPlaceholders(this.text, placeholders);\n }\n}\n\n/**\n * Create an `Instruction` from raw template text.\n *\n * @example\n * const replyIn = instruction(\"Respond in {{language|English}}.\");\n * const cite = instruction(\"Always cite sources inline.\");\n */\nexport function instruction(text: string): Instruction {\n return new Instruction(text);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAa,cAAb,MAAwD;CAGtD,AAAO,YAAY,AAAgB,MAAc;EAAd;cAFZ;CAIvB;;;;;;CAOA,AAAO,QAAQ,cAAqC;EAClD,OAAO,mBAAmB,KAAK,MAAM,YAAY;CACnD;AACF;;;;;;;;AASA,SAAgB,YAAY,MAA2B;CACrD,OAAO,IAAI,YAAY,IAAI;AAC7B"}
@@ -1,7 +1,7 @@
1
1
  import { Placeholders } from "../contracts/placeholders.type.mjs";
2
2
  import { PersonaContract } from "../contracts/system-prompt.contract.mjs";
3
3
 
4
- //#region ../@warlock.js/ai/src/system-prompt/persona.d.ts
4
+ //#region ../ai/src/system-prompt/persona.d.ts
5
5
  /**
6
6
  * Concrete `PersonaContract` — a reusable "who the agent is" block.
7
7
  *
@@ -1 +1 @@
1
- {"version":3,"file":"persona.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/system-prompt/persona.ts"],"mappings":";;;;;;AA8BA;;;;;;;;;;;;;AAY4C;AAY5C;;;;AAA8C;;;;;;cAxBjC,OAAA,YAAmB,eAAe;EAAA,SAGV,IAAA;EAAA,SAFnB,IAAA;cAEmB,IAAA;;;;;;EAS5B,OAAA,CAAQ,YAAA,GAAe,YAAA;AAAA;;;;;;;;iBAYhB,OAAA,CAAQ,IAAA,WAAe,OAAO"}
1
+ {"version":3,"file":"persona.d.mts","names":[],"sources":["../../../../../../../ai/src/system-prompt/persona.ts"],"mappings":";;;;;;AA8BA;;;;;;;;;;;;;AAY4C;AAY5C;;;;AAA8C;;;;;;cAxBjC,OAAA,YAAmB,eAAe;EAAA,SAGV,IAAA;EAAA,SAFnB,IAAA;cAEmB,IAAA;;;;;;EAS5B,OAAA,CAAQ,YAAA,GAAe,YAAA;AAAA;;;;;;;;iBAYhB,OAAA,CAAQ,IAAA,WAAe,OAAO"}
@@ -1,6 +1,6 @@
1
1
  import { renderPlaceholders } from "./render-placeholders.mjs";
2
2
 
3
- //#region ../@warlock.js/ai/src/system-prompt/persona.ts
3
+ //#region ../ai/src/system-prompt/persona.ts
4
4
  /**
5
5
  * Concrete `PersonaContract` — a reusable "who the agent is" block.
6
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"persona.mjs","names":[],"sources":["../../../../../../../@warlock.js/ai/src/system-prompt/persona.ts"],"sourcesContent":["import type { Placeholders } from \"../contracts/placeholders.type\";\nimport type { PersonaContract } from \"../contracts/system-prompt.contract\";\nimport { renderPlaceholders } from \"./render-placeholders\";\n\n/**\n * Concrete `PersonaContract` — a reusable \"who the agent is\" block.\n *\n * **Role.** A single addressable prompt block representing the agent's\n * identity (`\"You are Alex, a senior TypeScript engineer.\"`). Exists as\n * its own type so personas can be defined once and reused across many\n * `SystemPrompt` compositions, agents, and sessions — each render can\n * supply a different placeholder map.\n *\n * **Responsibility.**\n * - Owns: the `type: \"persona\"` discriminator, the raw template text, and\n * the placeholder-rendering step.\n * - Does NOT own: composition with instructions, ordering, joining, or\n * any knowledge of the surrounding `SystemPrompt`. Those concerns live\n * in `SystemPrompt`.\n *\n * Users construct via the `ai.persona()` factory — `new Persona()` is not\n * the public API (see §4.2 of code-style.md).\n *\n * @example\n * const alex = ai.persona(\"You are Alex, a TypeScript expert.\");\n *\n * const prompt = ai.systemPrompt()\n * .persona(alex)\n * .instruction(\"Always cite sources.\");\n */\nexport class Persona implements PersonaContract {\n public readonly type = \"persona\" as const;\n\n public constructor(public readonly text: string) {\n //\n }\n\n /**\n * Substitute `{{mustache}}` placeholders in the persona text against the\n * supplied map. Delegates to the shared `renderPlaceholders` helper so\n * persona / instruction / system-prompt rendering stays identical.\n */\n public resolve(placeholders?: Placeholders): string {\n return renderPlaceholders(this.text, placeholders);\n }\n}\n\n/**\n * Create a `Persona` from raw template text.\n *\n * @example\n * const alex = persona(\"You are Alex, a TypeScript expert.\");\n * const greeter = persona(\"You are a greeter in {{language|English}}.\");\n */\nexport function persona(text: string): Persona {\n return new Persona(text);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAa,UAAb,MAAgD;CAG9C,AAAO,YAAY,AAAgB,MAAc;EAAd;cAFZ;CAIvB;;;;;;CAOA,AAAO,QAAQ,cAAqC;EAClD,OAAO,mBAAmB,KAAK,MAAM,YAAY;CACnD;AACF;;;;;;;;AASA,SAAgB,QAAQ,MAAuB;CAC7C,OAAO,IAAI,QAAQ,IAAI;AACzB"}
1
+ {"version":3,"file":"persona.mjs","names":[],"sources":["../../../../../../../ai/src/system-prompt/persona.ts"],"sourcesContent":["import type { Placeholders } from \"../contracts/placeholders.type\";\nimport type { PersonaContract } from \"../contracts/system-prompt.contract\";\nimport { renderPlaceholders } from \"./render-placeholders\";\n\n/**\n * Concrete `PersonaContract` — a reusable \"who the agent is\" block.\n *\n * **Role.** A single addressable prompt block representing the agent's\n * identity (`\"You are Alex, a senior TypeScript engineer.\"`). Exists as\n * its own type so personas can be defined once and reused across many\n * `SystemPrompt` compositions, agents, and sessions — each render can\n * supply a different placeholder map.\n *\n * **Responsibility.**\n * - Owns: the `type: \"persona\"` discriminator, the raw template text, and\n * the placeholder-rendering step.\n * - Does NOT own: composition with instructions, ordering, joining, or\n * any knowledge of the surrounding `SystemPrompt`. Those concerns live\n * in `SystemPrompt`.\n *\n * Users construct via the `ai.persona()` factory — `new Persona()` is not\n * the public API (see §4.2 of code-style.md).\n *\n * @example\n * const alex = ai.persona(\"You are Alex, a TypeScript expert.\");\n *\n * const prompt = ai.systemPrompt()\n * .persona(alex)\n * .instruction(\"Always cite sources.\");\n */\nexport class Persona implements PersonaContract {\n public readonly type = \"persona\" as const;\n\n public constructor(public readonly text: string) {\n //\n }\n\n /**\n * Substitute `{{mustache}}` placeholders in the persona text against the\n * supplied map. Delegates to the shared `renderPlaceholders` helper so\n * persona / instruction / system-prompt rendering stays identical.\n */\n public resolve(placeholders?: Placeholders): string {\n return renderPlaceholders(this.text, placeholders);\n }\n}\n\n/**\n * Create a `Persona` from raw template text.\n *\n * @example\n * const alex = persona(\"You are Alex, a TypeScript expert.\");\n * const greeter = persona(\"You are a greeter in {{language|English}}.\");\n */\nexport function persona(text: string): Persona {\n return new Persona(text);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAa,UAAb,MAAgD;CAG9C,AAAO,YAAY,AAAgB,MAAc;EAAd;cAFZ;CAIvB;;;;;;CAOA,AAAO,QAAQ,cAAqC;EAClD,OAAO,mBAAmB,KAAK,MAAM,YAAY;CACnD;AACF;;;;;;;;AASA,SAAgB,QAAQ,MAAuB;CAC7C,OAAO,IAAI,QAAQ,IAAI;AACzB"}
@@ -2,7 +2,7 @@ import { Placeholders } from "../contracts/placeholders.type.mjs";
2
2
  import { PromptValidationResult, PromptsValidateOptions } from "../prompts/prompts-manager.type.mjs";
3
3
  import { InstructionContract, PersonaContract, PromptRefineOptions, RefinedSystemPromptContract, RefinedSystemPromptOptions, SystemPromptBlockContract, SystemPromptContract, SystemPromptMergeOptions, SystemPromptMeta } from "../contracts/system-prompt.contract.mjs";
4
4
 
5
- //#region ../@warlock.js/ai/src/system-prompt/refined-system-prompt.d.ts
5
+ //#region ../ai/src/system-prompt/refined-system-prompt.d.ts
6
6
  /**
7
7
  * Prompt-world collaborators injected by `system-prompt.ts` when it
8
8
  * constructs the wrapper. Dependency-injected (not imported) so this module
@@ -1 +1 @@
1
- {"version":3,"file":"refined-system-prompt.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/system-prompt/refined-system-prompt.ts"],"mappings":";;;;;;;AA0SA;;;;KAAY,uBAAA;EAKP,mEAHH,WAAA,CACE,MAAA,WAAiB,yBAAA,IACjB,IAAA,GAAO,gBAAA,GACN,oBAAA,EAKS;EAFZ,cAAA,CACE,MAAA,EAAQ,oBAAA,EACR,OAAA,GAAU,sBAAA,GACT,OAAA,CAAQ,sBAAA;AAAA;;;;;;;;;;;;;;;;;AAAsB;AAwCnC;;;;;;;;;;;;;;;;;;;;cAAa,mBAAA,YAA+B,2BAAA;EAAA,iBAyBvB,YAAA;EAAA,iBACA,OAAA;EAAA,iBACA,IAAA;EAgHhB;EAAA,QAzIK,eAAA;EAgJL;EAAA,QA7IK,aAAA;EAgLgB;EAAA,QA7KhB,QAAA;EAwLI;;;;;;EAAA,QAhLJ,iBAAA;EASW;EAAA,QANX,eAAA;EAQW;EAAA,QALX,cAAA;cAGW,YAAA,EAAc,oBAAA,EACd,OAAA,EAAS,0BAAA,EACT,IAAA,EAAM,uBAAA;EAnBjB;EAAA,IAyBG,MAAA,IAAU,oBAAA;EAdb;;;;;EAAA,IAuBG,MAAA,aAAmB,yBAAA;EAhBX;;;;;;;EA2BZ,IAAA,IAAQ,gBAAA;EACR,IAAA,CAAK,IAAA,EAAM,gBAAA,GAAmB,2BAAA;EAA9B;EAYA,OAAA,CACL,KAAA,EAAO,eAAA,YACN,2BAAA;EAdS;EAmBL,WAAA,CACL,KAAA,EAAO,mBAAA,YACN,2BAAA;EATI;;;;EAiBA,KAAA,IACF,MAAA,WAAiB,yBAAA,KACnB,2BAAA;EACI,KAAA,CAAM,MAAA,EAAQ,oBAAA,GAAuB,2BAAA;EACrC,KAAA,CACL,IAAA,UACA,OAAA,GAAU,wBAAA,GACT,2BAAA;EAfA;;;;;EAkDI,OAAA,CAAQ,YAAA,GAAe,YAAA;EAvCT;;;;;EAmDd,QAAA,CACL,OAAA,GAAU,sBAAA,GACT,OAAA,CAAQ,sBAAA;EAlDT;EAuDK,OAAA,CACL,OAAA,EAAS,0BAAA,GACR,2BAAA;EArBI;;;;;;;;;;;EAoCM,WAAA,IAAe,OAAA;EAAf;;;;;EAoBN,MAAA,CAAO,OAAA,GAAU,mBAAA,GAAsB,OAAA;EAUjC;;;;;;EAAA,YAAA,CACX,OAAA,GAAU,mBAAA,GACT,OAAA,CAAQ,oBAAA;EAuEG;EAAA,QAnDN,MAAA;EA8JA;;;;;AAkCgB;;EAlChB,QAnJA,OAAA;;;;;;;UAwCM,eAAA;;;;;;UAiDA,UAAA;;UA0DN,iBAAA;;;;;;UAaA,QAAA;;UAUA,KAAA;;;;;;UAWA,gBAAA;AAAA"}
1
+ {"version":3,"file":"refined-system-prompt.d.mts","names":[],"sources":["../../../../../../../ai/src/system-prompt/refined-system-prompt.ts"],"mappings":";;;;;;;AA0SA;;;;KAAY,uBAAA;EAKP,mEAHH,WAAA,CACE,MAAA,WAAiB,yBAAA,IACjB,IAAA,GAAO,gBAAA,GACN,oBAAA,EAKS;EAFZ,cAAA,CACE,MAAA,EAAQ,oBAAA,EACR,OAAA,GAAU,sBAAA,GACT,OAAA,CAAQ,sBAAA;AAAA;;;;;;;;;;;;;;;;;AAAsB;AAwCnC;;;;;;;;;;;;;;;;;;;;cAAa,mBAAA,YAA+B,2BAAA;EAAA,iBAyBvB,YAAA;EAAA,iBACA,OAAA;EAAA,iBACA,IAAA;EAgHhB;EAAA,QAzIK,eAAA;EAgJL;EAAA,QA7IK,aAAA;EAgLgB;EAAA,QA7KhB,QAAA;EAwLI;;;;;;EAAA,QAhLJ,iBAAA;EASW;EAAA,QANX,eAAA;EAQW;EAAA,QALX,cAAA;cAGW,YAAA,EAAc,oBAAA,EACd,OAAA,EAAS,0BAAA,EACT,IAAA,EAAM,uBAAA;EAnBjB;EAAA,IAyBG,MAAA,IAAU,oBAAA;EAdb;;;;;EAAA,IAuBG,MAAA,aAAmB,yBAAA;EAhBX;;;;;;;EA2BZ,IAAA,IAAQ,gBAAA;EACR,IAAA,CAAK,IAAA,EAAM,gBAAA,GAAmB,2BAAA;EAA9B;EAYA,OAAA,CACL,KAAA,EAAO,eAAA,YACN,2BAAA;EAdS;EAmBL,WAAA,CACL,KAAA,EAAO,mBAAA,YACN,2BAAA;EATI;;;;EAiBA,KAAA,IACF,MAAA,WAAiB,yBAAA,KACnB,2BAAA;EACI,KAAA,CAAM,MAAA,EAAQ,oBAAA,GAAuB,2BAAA;EACrC,KAAA,CACL,IAAA,UACA,OAAA,GAAU,wBAAA,GACT,2BAAA;EAfA;;;;;EAkDI,OAAA,CAAQ,YAAA,GAAe,YAAA;EAvCT;;;;;EAmDd,QAAA,CACL,OAAA,GAAU,sBAAA,GACT,OAAA,CAAQ,sBAAA;EAlDT;EAuDK,OAAA,CACL,OAAA,EAAS,0BAAA,GACR,2BAAA;EArBI;;;;;;;;;;;EAoCM,WAAA,IAAe,OAAA;EAAf;;;;;EAoBN,MAAA,CAAO,OAAA,GAAU,mBAAA,GAAsB,OAAA;EAUjC;;;;;;EAAA,YAAA,CACX,OAAA,GAAU,mBAAA,GACT,OAAA,CAAQ,oBAAA;EAuEG;EAAA,QAnDN,MAAA;EA8JA;;;;;AAkCgB;;EAlChB,QAnJA,OAAA;;;;;;;UAwCM,eAAA;;;;;;UAiDA,UAAA;;UA0DN,iBAAA;;;;;;UAaA,QAAA;;UAUA,KAAA;;;;;;UAWA,gBAAA;AAAA"}