@warlock.js/ai 4.1.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 (490) hide show
  1. package/README.md +72 -0
  2. package/cjs/index.cjs +8625 -0
  3. package/cjs/index.cjs.map +1 -0
  4. package/esm/agent/agent-config.type.d.mts +160 -0
  5. package/esm/agent/agent-config.type.d.mts.map +1 -0
  6. package/esm/agent/agent-input-builder.mjs +111 -0
  7. package/esm/agent/agent-input-builder.mjs.map +1 -0
  8. package/esm/agent/agent-log-event.mjs +101 -0
  9. package/esm/agent/agent-log-event.mjs.map +1 -0
  10. package/esm/agent/agent-stream.d.mts +47 -0
  11. package/esm/agent/agent-stream.d.mts.map +1 -0
  12. package/esm/agent/agent-stream.mjs +82 -0
  13. package/esm/agent/agent-stream.mjs.map +1 -0
  14. package/esm/agent/agent-to-stream-event.mjs +86 -0
  15. package/esm/agent/agent-to-stream-event.mjs.map +1 -0
  16. package/esm/agent/agent.d.mts +38 -0
  17. package/esm/agent/agent.d.mts.map +1 -0
  18. package/esm/agent/agent.mjs +974 -0
  19. package/esm/agent/agent.mjs.map +1 -0
  20. package/esm/agent/index.d.mts +3 -0
  21. package/esm/agent/index.mjs +4 -0
  22. package/esm/agent/json-stream-guard.mjs +400 -0
  23. package/esm/agent/json-stream-guard.mjs.map +1 -0
  24. package/esm/ai.d.mts +64 -0
  25. package/esm/ai.d.mts.map +1 -0
  26. package/esm/ai.mjs +65 -0
  27. package/esm/ai.mjs.map +1 -0
  28. package/esm/config.d.mts +79 -0
  29. package/esm/config.d.mts.map +1 -0
  30. package/esm/config.mjs +43 -0
  31. package/esm/config.mjs.map +1 -0
  32. package/esm/contracts/agent/agent-options.type.d.mts +132 -0
  33. package/esm/contracts/agent/agent-options.type.d.mts.map +1 -0
  34. package/esm/contracts/agent/agent.contract.d.mts +92 -0
  35. package/esm/contracts/agent/agent.contract.d.mts.map +1 -0
  36. package/esm/contracts/agent/index.d.mts +2 -0
  37. package/esm/contracts/attachment.type.d.mts +100 -0
  38. package/esm/contracts/attachment.type.d.mts.map +1 -0
  39. package/esm/contracts/content-part.type.d.mts +55 -0
  40. package/esm/contracts/content-part.type.d.mts.map +1 -0
  41. package/esm/contracts/conversation-message.type.d.mts +51 -0
  42. package/esm/contracts/conversation-message.type.d.mts.map +1 -0
  43. package/esm/contracts/embedder.contract.d.mts +69 -0
  44. package/esm/contracts/embedder.contract.d.mts.map +1 -0
  45. package/esm/contracts/end.type.d.mts +53 -0
  46. package/esm/contracts/end.type.d.mts.map +1 -0
  47. package/esm/contracts/end.type.mjs +47 -0
  48. package/esm/contracts/end.type.mjs.map +1 -0
  49. package/esm/contracts/events/agent-events.type.d.mts +71 -0
  50. package/esm/contracts/events/agent-events.type.d.mts.map +1 -0
  51. package/esm/contracts/events/complete-event.type.d.mts +33 -0
  52. package/esm/contracts/events/complete-event.type.d.mts.map +1 -0
  53. package/esm/contracts/events/event-identity.type.d.mts +30 -0
  54. package/esm/contracts/events/event-identity.type.d.mts.map +1 -0
  55. package/esm/contracts/events/event-map.type.d.mts +80 -0
  56. package/esm/contracts/events/event-map.type.d.mts.map +1 -0
  57. package/esm/contracts/events/index.d.mts +7 -0
  58. package/esm/contracts/events/supervisor-events.type.d.mts +162 -0
  59. package/esm/contracts/events/supervisor-events.type.d.mts.map +1 -0
  60. package/esm/contracts/events/usage-event.type.d.mts +39 -0
  61. package/esm/contracts/events/usage-event.type.d.mts.map +1 -0
  62. package/esm/contracts/events/workflow-events.type.d.mts +51 -0
  63. package/esm/contracts/events/workflow-events.type.d.mts.map +1 -0
  64. package/esm/contracts/executable.contract.d.mts +25 -0
  65. package/esm/contracts/executable.contract.d.mts.map +1 -0
  66. package/esm/contracts/finish-reason.type.d.mts +17 -0
  67. package/esm/contracts/finish-reason.type.d.mts.map +1 -0
  68. package/esm/contracts/index.d.mts +63 -0
  69. package/esm/contracts/middleware/index.d.mts +3 -0
  70. package/esm/contracts/middleware/middleware-context.type.d.mts +99 -0
  71. package/esm/contracts/middleware/middleware-context.type.d.mts.map +1 -0
  72. package/esm/contracts/middleware/middleware-state.type.d.mts +34 -0
  73. package/esm/contracts/middleware/middleware-state.type.d.mts.map +1 -0
  74. package/esm/contracts/middleware/middleware.contract.d.mts +140 -0
  75. package/esm/contracts/middleware/middleware.contract.d.mts.map +1 -0
  76. package/esm/contracts/model-tool-call-request.type.d.mts +58 -0
  77. package/esm/contracts/model-tool-call-request.type.d.mts.map +1 -0
  78. package/esm/contracts/model.contract.d.mts +164 -0
  79. package/esm/contracts/model.contract.d.mts.map +1 -0
  80. package/esm/contracts/placeholders.type.d.mts +23 -0
  81. package/esm/contracts/placeholders.type.d.mts.map +1 -0
  82. package/esm/contracts/result/agent-result.type.d.mts +33 -0
  83. package/esm/contracts/result/agent-result.type.d.mts.map +1 -0
  84. package/esm/contracts/result/attempt-entry.type.d.mts +40 -0
  85. package/esm/contracts/result/attempt-entry.type.d.mts.map +1 -0
  86. package/esm/contracts/result/base-report.type.d.mts +137 -0
  87. package/esm/contracts/result/base-report.type.d.mts.map +1 -0
  88. package/esm/contracts/result/base-report.type.mjs +17 -0
  89. package/esm/contracts/result/base-report.type.mjs.map +1 -0
  90. package/esm/contracts/result/base-result.type.d.mts +26 -0
  91. package/esm/contracts/result/base-result.type.d.mts.map +1 -0
  92. package/esm/contracts/result/execute-result.type.d.mts +40 -0
  93. package/esm/contracts/result/execute-result.type.d.mts.map +1 -0
  94. package/esm/contracts/result/execution-report.type.d.mts +50 -0
  95. package/esm/contracts/result/execution-report.type.d.mts.map +1 -0
  96. package/esm/contracts/result/index.d.mts +14 -0
  97. package/esm/contracts/result/llm-trip.type.d.mts +36 -0
  98. package/esm/contracts/result/llm-trip.type.d.mts.map +1 -0
  99. package/esm/contracts/result/model-pricing.type.d.mts +51 -0
  100. package/esm/contracts/result/model-pricing.type.d.mts.map +1 -0
  101. package/esm/contracts/result/session-send-result.type.d.mts +29 -0
  102. package/esm/contracts/result/session-send-result.type.d.mts.map +1 -0
  103. package/esm/contracts/result/step-result.type.d.mts +43 -0
  104. package/esm/contracts/result/step-result.type.d.mts.map +1 -0
  105. package/esm/contracts/result/supervisor-result.type.d.mts +86 -0
  106. package/esm/contracts/result/supervisor-result.type.d.mts.map +1 -0
  107. package/esm/contracts/result/tool-call.type.d.mts +44 -0
  108. package/esm/contracts/result/tool-call.type.d.mts.map +1 -0
  109. package/esm/contracts/result/usage.type.d.mts +57 -0
  110. package/esm/contracts/result/usage.type.d.mts.map +1 -0
  111. package/esm/contracts/result/workflow-result.type.d.mts +45 -0
  112. package/esm/contracts/result/workflow-result.type.d.mts.map +1 -0
  113. package/esm/contracts/sdk-adapter.contract.d.mts +77 -0
  114. package/esm/contracts/sdk-adapter.contract.d.mts.map +1 -0
  115. package/esm/contracts/stream/stream-event.type.d.mts +68 -0
  116. package/esm/contracts/stream/stream-event.type.d.mts.map +1 -0
  117. package/esm/contracts/stream/stream.contract.d.mts +61 -0
  118. package/esm/contracts/stream/stream.contract.d.mts.map +1 -0
  119. package/esm/contracts/streaming-tool-guard-config.type.d.mts +78 -0
  120. package/esm/contracts/streaming-tool-guard-config.type.d.mts.map +1 -0
  121. package/esm/contracts/supervisor/ack-entry.type.d.mts +97 -0
  122. package/esm/contracts/supervisor/ack-entry.type.d.mts.map +1 -0
  123. package/esm/contracts/supervisor/classifier-context.type.d.mts +189 -0
  124. package/esm/contracts/supervisor/classifier-context.type.d.mts.map +1 -0
  125. package/esm/contracts/supervisor/dispatch-context.type.d.mts +235 -0
  126. package/esm/contracts/supervisor/dispatch-context.type.d.mts.map +1 -0
  127. package/esm/contracts/supervisor/evaluate-context.type.d.mts +124 -0
  128. package/esm/contracts/supervisor/evaluate-context.type.d.mts.map +1 -0
  129. package/esm/contracts/supervisor/index.d.mts +16 -0
  130. package/esm/contracts/supervisor/intent-entry.type.d.mts +254 -0
  131. package/esm/contracts/supervisor/intent-entry.type.d.mts.map +1 -0
  132. package/esm/contracts/supervisor/iteration-snapshot.type.d.mts +117 -0
  133. package/esm/contracts/supervisor/iteration-snapshot.type.d.mts.map +1 -0
  134. package/esm/contracts/supervisor/next.type.d.mts +25 -0
  135. package/esm/contracts/supervisor/next.type.d.mts.map +1 -0
  136. package/esm/contracts/supervisor/route-context.type.d.mts +91 -0
  137. package/esm/contracts/supervisor/route-context.type.d.mts.map +1 -0
  138. package/esm/contracts/supervisor/router-entry.type.d.mts +67 -0
  139. package/esm/contracts/supervisor/router-entry.type.d.mts.map +1 -0
  140. package/esm/contracts/supervisor/supervisor-config.type.d.mts +356 -0
  141. package/esm/contracts/supervisor/supervisor-config.type.d.mts.map +1 -0
  142. package/esm/contracts/supervisor/supervisor-execute-options.type.d.mts +90 -0
  143. package/esm/contracts/supervisor/supervisor-execute-options.type.d.mts.map +1 -0
  144. package/esm/contracts/supervisor/supervisor-input.type.d.mts +24 -0
  145. package/esm/contracts/supervisor/supervisor-input.type.d.mts.map +1 -0
  146. package/esm/contracts/supervisor/supervisor-snapshot.type.d.mts +49 -0
  147. package/esm/contracts/supervisor/supervisor-snapshot.type.d.mts.map +1 -0
  148. package/esm/contracts/supervisor/supervisor-stream-event.type.d.mts +16 -0
  149. package/esm/contracts/supervisor/supervisor-stream-event.type.d.mts.map +1 -0
  150. package/esm/contracts/supervisor/supervisor.contract.d.mts +126 -0
  151. package/esm/contracts/supervisor/supervisor.contract.d.mts.map +1 -0
  152. package/esm/contracts/system-prompt.contract.d.mts +118 -0
  153. package/esm/contracts/system-prompt.contract.d.mts.map +1 -0
  154. package/esm/contracts/tool.contract.d.mts +161 -0
  155. package/esm/contracts/tool.contract.d.mts.map +1 -0
  156. package/esm/contracts/workflow/index.d.mts +6 -0
  157. package/esm/contracts/workflow/next-step-result.type.d.mts +17 -0
  158. package/esm/contracts/workflow/next-step-result.type.d.mts.map +1 -0
  159. package/esm/contracts/workflow/retry-config.type.d.mts +19 -0
  160. package/esm/contracts/workflow/retry-config.type.d.mts.map +1 -0
  161. package/esm/contracts/workflow/step.contract.d.mts +189 -0
  162. package/esm/contracts/workflow/step.contract.d.mts.map +1 -0
  163. package/esm/contracts/workflow/workflow-context.type.d.mts +45 -0
  164. package/esm/contracts/workflow/workflow-context.type.d.mts.map +1 -0
  165. package/esm/contracts/workflow/workflow-snapshot.type.d.mts +24 -0
  166. package/esm/contracts/workflow/workflow-snapshot.type.d.mts.map +1 -0
  167. package/esm/contracts/workflow/workflow.contract.d.mts +142 -0
  168. package/esm/contracts/workflow/workflow.contract.d.mts.map +1 -0
  169. package/esm/errors/agent-cancelled-error.d.mts +49 -0
  170. package/esm/errors/agent-cancelled-error.d.mts.map +1 -0
  171. package/esm/errors/agent-cancelled-error.mjs +43 -0
  172. package/esm/errors/agent-cancelled-error.mjs.map +1 -0
  173. package/esm/errors/agent-execution-error.d.mts +32 -0
  174. package/esm/errors/agent-execution-error.d.mts.map +1 -0
  175. package/esm/errors/agent-execution-error.mjs +35 -0
  176. package/esm/errors/agent-execution-error.mjs.map +1 -0
  177. package/esm/errors/agent-max-trips-error.d.mts +45 -0
  178. package/esm/errors/agent-max-trips-error.d.mts.map +1 -0
  179. package/esm/errors/agent-max-trips-error.mjs +41 -0
  180. package/esm/errors/agent-max-trips-error.mjs.map +1 -0
  181. package/esm/errors/ai-error.d.mts +94 -0
  182. package/esm/errors/ai-error.d.mts.map +1 -0
  183. package/esm/errors/ai-error.mjs +68 -0
  184. package/esm/errors/ai-error.mjs.map +1 -0
  185. package/esm/errors/budget-exceeded-error.d.mts +41 -0
  186. package/esm/errors/budget-exceeded-error.d.mts.map +1 -0
  187. package/esm/errors/budget-exceeded-error.mjs +31 -0
  188. package/esm/errors/budget-exceeded-error.mjs.map +1 -0
  189. package/esm/errors/content-filter-error.d.mts +33 -0
  190. package/esm/errors/content-filter-error.d.mts.map +1 -0
  191. package/esm/errors/content-filter-error.mjs +28 -0
  192. package/esm/errors/content-filter-error.mjs.map +1 -0
  193. package/esm/errors/context-length-exceeded-error.d.mts +38 -0
  194. package/esm/errors/context-length-exceeded-error.d.mts.map +1 -0
  195. package/esm/errors/context-length-exceeded-error.mjs +31 -0
  196. package/esm/errors/context-length-exceeded-error.mjs.map +1 -0
  197. package/esm/errors/error-category.type.d.mts +30 -0
  198. package/esm/errors/error-category.type.d.mts.map +1 -0
  199. package/esm/errors/error-code.type.d.mts +19 -0
  200. package/esm/errors/error-code.type.d.mts.map +1 -0
  201. package/esm/errors/guardrail-violation-error.d.mts +55 -0
  202. package/esm/errors/guardrail-violation-error.d.mts.map +1 -0
  203. package/esm/errors/guardrail-violation-error.mjs +41 -0
  204. package/esm/errors/guardrail-violation-error.mjs.map +1 -0
  205. package/esm/errors/index.d.mts +29 -0
  206. package/esm/errors/index.mjs +29 -0
  207. package/esm/errors/invalid-request-error.d.mts +27 -0
  208. package/esm/errors/invalid-request-error.d.mts.map +1 -0
  209. package/esm/errors/invalid-request-error.mjs +31 -0
  210. package/esm/errors/invalid-request-error.mjs.map +1 -0
  211. package/esm/errors/max-iterations-error.d.mts +31 -0
  212. package/esm/errors/max-iterations-error.d.mts.map +1 -0
  213. package/esm/errors/max-iterations-error.mjs +32 -0
  214. package/esm/errors/max-iterations-error.mjs.map +1 -0
  215. package/esm/errors/max-steps-exceeded-error.d.mts +20 -0
  216. package/esm/errors/max-steps-exceeded-error.d.mts.map +1 -0
  217. package/esm/errors/max-steps-exceeded-error.mjs +21 -0
  218. package/esm/errors/max-steps-exceeded-error.mjs.map +1 -0
  219. package/esm/errors/provider-auth-error.d.mts +22 -0
  220. package/esm/errors/provider-auth-error.d.mts.map +1 -0
  221. package/esm/errors/provider-auth-error.mjs +26 -0
  222. package/esm/errors/provider-auth-error.mjs.map +1 -0
  223. package/esm/errors/provider-error.d.mts +38 -0
  224. package/esm/errors/provider-error.d.mts.map +1 -0
  225. package/esm/errors/provider-error.mjs +42 -0
  226. package/esm/errors/provider-error.mjs.map +1 -0
  227. package/esm/errors/provider-rate-limit-error.d.mts +34 -0
  228. package/esm/errors/provider-rate-limit-error.d.mts.map +1 -0
  229. package/esm/errors/provider-rate-limit-error.mjs +31 -0
  230. package/esm/errors/provider-rate-limit-error.mjs.map +1 -0
  231. package/esm/errors/provider-timeout-error.d.mts +22 -0
  232. package/esm/errors/provider-timeout-error.d.mts.map +1 -0
  233. package/esm/errors/provider-timeout-error.mjs +26 -0
  234. package/esm/errors/provider-timeout-error.mjs.map +1 -0
  235. package/esm/errors/quota-exceeded-error.d.mts +36 -0
  236. package/esm/errors/quota-exceeded-error.d.mts.map +1 -0
  237. package/esm/errors/quota-exceeded-error.mjs +40 -0
  238. package/esm/errors/quota-exceeded-error.mjs.map +1 -0
  239. package/esm/errors/routing-error.d.mts +23 -0
  240. package/esm/errors/routing-error.d.mts.map +1 -0
  241. package/esm/errors/routing-error.mjs +23 -0
  242. package/esm/errors/routing-error.mjs.map +1 -0
  243. package/esm/errors/schema-validation-error.d.mts +40 -0
  244. package/esm/errors/schema-validation-error.d.mts.map +1 -0
  245. package/esm/errors/schema-validation-error.mjs +37 -0
  246. package/esm/errors/schema-validation-error.mjs.map +1 -0
  247. package/esm/errors/step-failed-error.d.mts +20 -0
  248. package/esm/errors/step-failed-error.d.mts.map +1 -0
  249. package/esm/errors/step-failed-error.mjs +19 -0
  250. package/esm/errors/step-failed-error.mjs.map +1 -0
  251. package/esm/errors/supervisor-cancelled-error.d.mts +29 -0
  252. package/esm/errors/supervisor-cancelled-error.d.mts.map +1 -0
  253. package/esm/errors/supervisor-cancelled-error.mjs +29 -0
  254. package/esm/errors/supervisor-cancelled-error.mjs.map +1 -0
  255. package/esm/errors/supervisor-drift-error.d.mts +31 -0
  256. package/esm/errors/supervisor-drift-error.d.mts.map +1 -0
  257. package/esm/errors/supervisor-drift-error.mjs +30 -0
  258. package/esm/errors/supervisor-drift-error.mjs.map +1 -0
  259. package/esm/errors/supervisor-failed-error.d.mts +40 -0
  260. package/esm/errors/supervisor-failed-error.d.mts.map +1 -0
  261. package/esm/errors/supervisor-failed-error.mjs +43 -0
  262. package/esm/errors/supervisor-failed-error.mjs.map +1 -0
  263. package/esm/errors/supervisor-routing-error.d.mts +44 -0
  264. package/esm/errors/supervisor-routing-error.d.mts.map +1 -0
  265. package/esm/errors/supervisor-routing-error.mjs +39 -0
  266. package/esm/errors/supervisor-routing-error.mjs.map +1 -0
  267. package/esm/errors/tool-execution-error.d.mts +35 -0
  268. package/esm/errors/tool-execution-error.d.mts.map +1 -0
  269. package/esm/errors/tool-execution-error.mjs +32 -0
  270. package/esm/errors/tool-execution-error.mjs.map +1 -0
  271. package/esm/errors/workflow-cancelled-error.d.mts +23 -0
  272. package/esm/errors/workflow-cancelled-error.d.mts.map +1 -0
  273. package/esm/errors/workflow-cancelled-error.mjs +23 -0
  274. package/esm/errors/workflow-cancelled-error.mjs.map +1 -0
  275. package/esm/errors/workflow-drift-error.d.mts +25 -0
  276. package/esm/errors/workflow-drift-error.d.mts.map +1 -0
  277. package/esm/errors/workflow-drift-error.mjs +24 -0
  278. package/esm/errors/workflow-drift-error.mjs.map +1 -0
  279. package/esm/errors/workflow-error.d.mts +15 -0
  280. package/esm/errors/workflow-error.d.mts.map +1 -0
  281. package/esm/errors/workflow-error.mjs +18 -0
  282. package/esm/errors/workflow-error.mjs.map +1 -0
  283. package/esm/index.d.mts +137 -0
  284. package/esm/index.mjs +81 -0
  285. package/esm/middleware/builtins/budget.d.mts +103 -0
  286. package/esm/middleware/builtins/budget.d.mts.map +1 -0
  287. package/esm/middleware/builtins/budget.mjs +100 -0
  288. package/esm/middleware/builtins/budget.mjs.map +1 -0
  289. package/esm/middleware/builtins/guardrail.d.mts +92 -0
  290. package/esm/middleware/builtins/guardrail.d.mts.map +1 -0
  291. package/esm/middleware/builtins/guardrail.mjs +76 -0
  292. package/esm/middleware/builtins/guardrail.mjs.map +1 -0
  293. package/esm/middleware/builtins/semantic-cache.d.mts +106 -0
  294. package/esm/middleware/builtins/semantic-cache.d.mts.map +1 -0
  295. package/esm/middleware/builtins/semantic-cache.mjs +149 -0
  296. package/esm/middleware/builtins/semantic-cache.mjs.map +1 -0
  297. package/esm/middleware/helpers/compose.d.mts +42 -0
  298. package/esm/middleware/helpers/compose.d.mts.map +1 -0
  299. package/esm/middleware/helpers/compose.mjs +52 -0
  300. package/esm/middleware/helpers/compose.mjs.map +1 -0
  301. package/esm/middleware/helpers/for-tool.d.mts +55 -0
  302. package/esm/middleware/helpers/for-tool.d.mts.map +1 -0
  303. package/esm/middleware/helpers/for-tool.mjs +80 -0
  304. package/esm/middleware/helpers/for-tool.mjs.map +1 -0
  305. package/esm/middleware/helpers/index.d.mts +2 -0
  306. package/esm/middleware/index.d.mts +8 -0
  307. package/esm/middleware/index.mjs +10 -0
  308. package/esm/middleware/pipeline.d.mts +70 -0
  309. package/esm/middleware/pipeline.d.mts.map +1 -0
  310. package/esm/middleware/pipeline.mjs +100 -0
  311. package/esm/middleware/pipeline.mjs.map +1 -0
  312. package/esm/middleware/utils/extract-user-text.d.mts +33 -0
  313. package/esm/middleware/utils/extract-user-text.d.mts.map +1 -0
  314. package/esm/middleware/utils/extract-user-text.mjs +40 -0
  315. package/esm/middleware/utils/extract-user-text.mjs.map +1 -0
  316. package/esm/middleware/utils/index.d.mts +2 -0
  317. package/esm/middleware/utils/namespaced-state.d.mts +60 -0
  318. package/esm/middleware/utils/namespaced-state.d.mts.map +1 -0
  319. package/esm/middleware/utils/namespaced-state.mjs +60 -0
  320. package/esm/middleware/utils/namespaced-state.mjs.map +1 -0
  321. package/esm/mock/index.d.mts +4 -0
  322. package/esm/mock/index.mjs +5 -0
  323. package/esm/mock/mock-agent.d.mts +41 -0
  324. package/esm/mock/mock-agent.d.mts.map +1 -0
  325. package/esm/mock/mock-agent.mjs +39 -0
  326. package/esm/mock/mock-agent.mjs.map +1 -0
  327. package/esm/mock/mock-config.type.d.mts +31 -0
  328. package/esm/mock/mock-config.type.d.mts.map +1 -0
  329. package/esm/mock/mock-model.d.mts +94 -0
  330. package/esm/mock/mock-model.d.mts.map +1 -0
  331. package/esm/mock/mock-model.mjs +150 -0
  332. package/esm/mock/mock-model.mjs.map +1 -0
  333. package/esm/mock/mock-sdk.d.mts +25 -0
  334. package/esm/mock/mock-sdk.d.mts.map +1 -0
  335. package/esm/mock/mock-sdk.mjs +37 -0
  336. package/esm/mock/mock-sdk.mjs.map +1 -0
  337. package/esm/supervisor/as-tool.d.mts +45 -0
  338. package/esm/supervisor/as-tool.d.mts.map +1 -0
  339. package/esm/supervisor/as-tool.mjs +80 -0
  340. package/esm/supervisor/as-tool.mjs.map +1 -0
  341. package/esm/supervisor/cancellation.d.mts +12 -0
  342. package/esm/supervisor/cancellation.d.mts.map +1 -0
  343. package/esm/supervisor/cancellation.mjs +22 -0
  344. package/esm/supervisor/cancellation.mjs.map +1 -0
  345. package/esm/supervisor/decide.mjs +272 -0
  346. package/esm/supervisor/decide.mjs.map +1 -0
  347. package/esm/supervisor/emitter.d.mts +27 -0
  348. package/esm/supervisor/emitter.d.mts.map +1 -0
  349. package/esm/supervisor/emitter.mjs +47 -0
  350. package/esm/supervisor/emitter.mjs.map +1 -0
  351. package/esm/supervisor/entries.d.mts +141 -0
  352. package/esm/supervisor/entries.d.mts.map +1 -0
  353. package/esm/supervisor/entries.mjs +206 -0
  354. package/esm/supervisor/entries.mjs.map +1 -0
  355. package/esm/supervisor/execution.d.mts +637 -0
  356. package/esm/supervisor/execution.d.mts.map +1 -0
  357. package/esm/supervisor/execution.mjs +1868 -0
  358. package/esm/supervisor/execution.mjs.map +1 -0
  359. package/esm/supervisor/index.d.mts +11 -0
  360. package/esm/supervisor/index.mjs +12 -0
  361. package/esm/supervisor/router-prompt.d.mts +56 -0
  362. package/esm/supervisor/router-prompt.d.mts.map +1 -0
  363. package/esm/supervisor/router-prompt.mjs +52 -0
  364. package/esm/supervisor/router-prompt.mjs.map +1 -0
  365. package/esm/supervisor/signature.d.mts +28 -0
  366. package/esm/supervisor/signature.d.mts.map +1 -0
  367. package/esm/supervisor/signature.mjs +89 -0
  368. package/esm/supervisor/signature.mjs.map +1 -0
  369. package/esm/supervisor/snapshot.d.mts +54 -0
  370. package/esm/supervisor/snapshot.d.mts.map +1 -0
  371. package/esm/supervisor/snapshot.mjs +77 -0
  372. package/esm/supervisor/snapshot.mjs.map +1 -0
  373. package/esm/supervisor/supervisor-stream.d.mts +29 -0
  374. package/esm/supervisor/supervisor-stream.d.mts.map +1 -0
  375. package/esm/supervisor/supervisor-stream.mjs +89 -0
  376. package/esm/supervisor/supervisor-stream.mjs.map +1 -0
  377. package/esm/supervisor/supervisor.d.mts +27 -0
  378. package/esm/supervisor/supervisor.d.mts.map +1 -0
  379. package/esm/supervisor/supervisor.mjs +138 -0
  380. package/esm/supervisor/supervisor.mjs.map +1 -0
  381. package/esm/system-prompt/instruction.d.mts +52 -0
  382. package/esm/system-prompt/instruction.d.mts.map +1 -0
  383. package/esm/system-prompt/instruction.mjs +57 -0
  384. package/esm/system-prompt/instruction.mjs.map +1 -0
  385. package/esm/system-prompt/persona.d.mts +52 -0
  386. package/esm/system-prompt/persona.d.mts.map +1 -0
  387. package/esm/system-prompt/persona.mjs +57 -0
  388. package/esm/system-prompt/persona.mjs.map +1 -0
  389. package/esm/system-prompt/render-placeholders.d.mts +31 -0
  390. package/esm/system-prompt/render-placeholders.d.mts.map +1 -0
  391. package/esm/system-prompt/render-placeholders.mjs +58 -0
  392. package/esm/system-prompt/render-placeholders.mjs.map +1 -0
  393. package/esm/system-prompt/system-prompt.d.mts +117 -0
  394. package/esm/system-prompt/system-prompt.d.mts.map +1 -0
  395. package/esm/system-prompt/system-prompt.mjs +137 -0
  396. package/esm/system-prompt/system-prompt.mjs.map +1 -0
  397. package/esm/tool/index.d.mts +1 -0
  398. package/esm/tool/index.mjs +3 -0
  399. package/esm/tool/tool.d.mts +64 -0
  400. package/esm/tool/tool.d.mts.map +1 -0
  401. package/esm/tool/tool.mjs +184 -0
  402. package/esm/tool/tool.mjs.map +1 -0
  403. package/esm/utils/compute-cost.d.mts +58 -0
  404. package/esm/utils/compute-cost.d.mts.map +1 -0
  405. package/esm/utils/compute-cost.mjs +87 -0
  406. package/esm/utils/compute-cost.mjs.map +1 -0
  407. package/esm/utils/extract-json-payload.d.mts +33 -0
  408. package/esm/utils/extract-json-payload.d.mts.map +1 -0
  409. package/esm/utils/extract-json-payload.mjs +39 -0
  410. package/esm/utils/extract-json-payload.mjs.map +1 -0
  411. package/esm/utils/generate-run-id.d.mts +20 -0
  412. package/esm/utils/generate-run-id.d.mts.map +1 -0
  413. package/esm/utils/generate-run-id.mjs +23 -0
  414. package/esm/utils/generate-run-id.mjs.map +1 -0
  415. package/esm/utils/index.d.mts +9 -0
  416. package/esm/utils/index.mjs +11 -0
  417. package/esm/utils/json-schema.d.mts +57 -0
  418. package/esm/utils/json-schema.d.mts.map +1 -0
  419. package/esm/utils/json-schema.mjs +89 -0
  420. package/esm/utils/json-schema.mjs.map +1 -0
  421. package/esm/utils/prepare-attachment-part.d.mts +36 -0
  422. package/esm/utils/prepare-attachment-part.d.mts.map +1 -0
  423. package/esm/utils/prepare-attachment-part.mjs +140 -0
  424. package/esm/utils/prepare-attachment-part.mjs.map +1 -0
  425. package/esm/utils/resolve-attachment.d.mts +33 -0
  426. package/esm/utils/resolve-attachment.d.mts.map +1 -0
  427. package/esm/utils/resolve-attachment.mjs +73 -0
  428. package/esm/utils/resolve-attachment.mjs.map +1 -0
  429. package/esm/utils/safe-json-parse.d.mts +14 -0
  430. package/esm/utils/safe-json-parse.d.mts.map +1 -0
  431. package/esm/utils/safe-json-parse.mjs +22 -0
  432. package/esm/utils/safe-json-parse.mjs.map +1 -0
  433. package/esm/utils/stamp-report-lineage.d.mts +61 -0
  434. package/esm/utils/stamp-report-lineage.d.mts.map +1 -0
  435. package/esm/utils/stamp-report-lineage.mjs +47 -0
  436. package/esm/utils/stamp-report-lineage.mjs.map +1 -0
  437. package/esm/utils/token-count.d.mts +15 -0
  438. package/esm/utils/token-count.d.mts.map +1 -0
  439. package/esm/utils/token-count.mjs +18 -0
  440. package/esm/utils/token-count.mjs.map +1 -0
  441. package/esm/workflow/as-tool.mjs +55 -0
  442. package/esm/workflow/as-tool.mjs.map +1 -0
  443. package/esm/workflow/cancellation.mjs +44 -0
  444. package/esm/workflow/cancellation.mjs.map +1 -0
  445. package/esm/workflow/emitter.mjs +40 -0
  446. package/esm/workflow/emitter.mjs.map +1 -0
  447. package/esm/workflow/engine.mjs +362 -0
  448. package/esm/workflow/engine.mjs.map +1 -0
  449. package/esm/workflow/index.d.mts +3 -0
  450. package/esm/workflow/index.mjs +5 -0
  451. package/esm/workflow/retry.mjs +32 -0
  452. package/esm/workflow/retry.mjs.map +1 -0
  453. package/esm/workflow/router.mjs +56 -0
  454. package/esm/workflow/router.mjs.map +1 -0
  455. package/esm/workflow/run-scoped-emitter.mjs +32 -0
  456. package/esm/workflow/run-scoped-emitter.mjs.map +1 -0
  457. package/esm/workflow/signature.d.mts +7 -0
  458. package/esm/workflow/signature.d.mts.map +1 -0
  459. package/esm/workflow/signature.mjs +34 -0
  460. package/esm/workflow/signature.mjs.map +1 -0
  461. package/esm/workflow/snapshot.mjs +71 -0
  462. package/esm/workflow/snapshot.mjs.map +1 -0
  463. package/esm/workflow/state.mjs +37 -0
  464. package/esm/workflow/state.mjs.map +1 -0
  465. package/esm/workflow/step-runner.mjs +371 -0
  466. package/esm/workflow/step-runner.mjs.map +1 -0
  467. package/esm/workflow/step.d.mts +19 -0
  468. package/esm/workflow/step.d.mts.map +1 -0
  469. package/esm/workflow/step.mjs +37 -0
  470. package/esm/workflow/step.mjs.map +1 -0
  471. package/esm/workflow/workflow.d.mts +12 -0
  472. package/esm/workflow/workflow.d.mts.map +1 -0
  473. package/esm/workflow/workflow.mjs +116 -0
  474. package/esm/workflow/workflow.mjs.map +1 -0
  475. package/llms-full.txt +2293 -0
  476. package/llms.txt +20 -0
  477. package/package.json +37 -0
  478. package/skills/README.md +53 -0
  479. package/skills/ai-basics/SKILL.md +95 -0
  480. package/skills/attach-ai-middleware/SKILL.md +184 -0
  481. package/skills/define-ai-tool/SKILL.md +186 -0
  482. package/skills/embed-text/SKILL.md +105 -0
  483. package/skills/handle-ai-errors/SKILL.md +194 -0
  484. package/skills/log-ai-calls/SKILL.md +141 -0
  485. package/skills/persist-ai-data/SKILL.md +207 -0
  486. package/skills/pick-ai-provider/SKILL.md +164 -0
  487. package/skills/run-ai-agent/SKILL.md +267 -0
  488. package/skills/run-ai-workflow/SKILL.md +258 -0
  489. package/skills/run-supervisor/SKILL.md +309 -0
  490. package/skills/write-system-prompt/SKILL.md +129 -0
package/esm/ai.d.mts ADDED
@@ -0,0 +1,64 @@
1
+ import { tool } from "./tool/tool.mjs";
2
+ import { agent } from "./agent/agent.mjs";
3
+ import { setAIConfig } from "./config.mjs";
4
+ import { budget } from "./middleware/builtins/budget.mjs";
5
+ import { guardrail } from "./middleware/builtins/guardrail.mjs";
6
+ import { semanticCache } from "./middleware/builtins/semantic-cache.mjs";
7
+ import { composeMiddleware } from "./middleware/helpers/compose.mjs";
8
+ import { forTool } from "./middleware/helpers/for-tool.mjs";
9
+ import { supervisor } from "./supervisor/supervisor.mjs";
10
+ import { instruction } from "./system-prompt/instruction.mjs";
11
+ import { persona } from "./system-prompt/persona.mjs";
12
+ import { systemPrompt } from "./system-prompt/system-prompt.mjs";
13
+ import { step } from "./workflow/step.mjs";
14
+ import { workflow } from "./workflow/workflow.mjs";
15
+
16
+ //#region ../../@warlock.js/ai/src/ai.d.ts
17
+ /**
18
+ * Top-level `ai` namespace — holds built-in factories and user-registered SDK adapters.
19
+ *
20
+ * Factories:
21
+ * - `ai.tool(...)` — wrap an async function with a schema-validated input.
22
+ * - `ai.agent(...)` — build an executable agent from model + tools + prompt.
23
+ * - `ai.systemPrompt(...)` — compose a layered persona + instructions prompt.
24
+ * - `ai.persona(text)` — reusable persona block (can be passed to `systemPrompt`).
25
+ * - `ai.instruction(text)` — reusable instruction block (can be passed to `systemPrompt`).
26
+ * - `ai.openai.model(...)` / `ai.anthropic.model(...)` / ... once the adapter SDK is registered.
27
+ *
28
+ * @example
29
+ * const alex = ai.persona("You are Alex, a TypeScript expert.");
30
+ * const replyIn = ai.instruction("Respond in {{language|English}}.");
31
+ *
32
+ * const prompt = ai.systemPrompt().persona(alex).instruction(replyIn);
33
+ *
34
+ * const myAgent = ai.agent({
35
+ * model: ai.openai.model({ name: "gpt-4o" }),
36
+ * systemPrompt: prompt,
37
+ * tools: [myTool],
38
+ * });
39
+ *
40
+ * const result = await myAgent.execute("What is the weather in Cairo?", {
41
+ * placeholders: { language: "Arabic" },
42
+ * });
43
+ */
44
+ declare const ai: {
45
+ config: typeof setAIConfig;
46
+ tool: typeof tool;
47
+ agent: typeof agent;
48
+ systemPrompt: typeof systemPrompt;
49
+ persona: typeof persona;
50
+ instruction: typeof instruction;
51
+ workflow: typeof workflow;
52
+ step: typeof step;
53
+ supervisor: typeof supervisor;
54
+ middleware: {
55
+ budget: typeof budget;
56
+ guardrail: typeof guardrail;
57
+ semanticCache: typeof semanticCache;
58
+ compose: typeof composeMiddleware;
59
+ forTool: typeof forTool;
60
+ };
61
+ };
62
+ //#endregion
63
+ export { ai };
64
+ //# sourceMappingURL=ai.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai.d.mts","names":[],"sources":["../../../../../@warlock.js/ai/src/ai.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyCA;;;;;;;;;;;;;;;;;;;;;;;cAAa,EAAA"}
package/esm/ai.mjs ADDED
@@ -0,0 +1,65 @@
1
+ import { budget } from "./middleware/builtins/budget.mjs";
2
+ import { guardrail } from "./middleware/builtins/guardrail.mjs";
3
+ import { setAIConfig } from "./config.mjs";
4
+ import { semanticCache } from "./middleware/builtins/semantic-cache.mjs";
5
+ import { composeMiddleware } from "./middleware/helpers/compose.mjs";
6
+ import { forTool } from "./middleware/helpers/for-tool.mjs";
7
+ import { agent } from "./agent/agent.mjs";
8
+ import { tool } from "./tool/tool.mjs";
9
+ import { supervisor } from "./supervisor/supervisor.mjs";
10
+ import { instruction } from "./system-prompt/instruction.mjs";
11
+ import { persona } from "./system-prompt/persona.mjs";
12
+ import { systemPrompt } from "./system-prompt/system-prompt.mjs";
13
+ import { step } from "./workflow/step.mjs";
14
+ import { workflow } from "./workflow/workflow.mjs";
15
+
16
+ //#region ../../@warlock.js/ai/src/ai.ts
17
+ /**
18
+ * Top-level `ai` namespace — holds built-in factories and user-registered SDK adapters.
19
+ *
20
+ * Factories:
21
+ * - `ai.tool(...)` — wrap an async function with a schema-validated input.
22
+ * - `ai.agent(...)` — build an executable agent from model + tools + prompt.
23
+ * - `ai.systemPrompt(...)` — compose a layered persona + instructions prompt.
24
+ * - `ai.persona(text)` — reusable persona block (can be passed to `systemPrompt`).
25
+ * - `ai.instruction(text)` — reusable instruction block (can be passed to `systemPrompt`).
26
+ * - `ai.openai.model(...)` / `ai.anthropic.model(...)` / ... once the adapter SDK is registered.
27
+ *
28
+ * @example
29
+ * const alex = ai.persona("You are Alex, a TypeScript expert.");
30
+ * const replyIn = ai.instruction("Respond in {{language|English}}.");
31
+ *
32
+ * const prompt = ai.systemPrompt().persona(alex).instruction(replyIn);
33
+ *
34
+ * const myAgent = ai.agent({
35
+ * model: ai.openai.model({ name: "gpt-4o" }),
36
+ * systemPrompt: prompt,
37
+ * tools: [myTool],
38
+ * });
39
+ *
40
+ * const result = await myAgent.execute("What is the weather in Cairo?", {
41
+ * placeholders: { language: "Arabic" },
42
+ * });
43
+ */
44
+ const ai = {
45
+ config: setAIConfig,
46
+ tool,
47
+ agent,
48
+ systemPrompt,
49
+ persona,
50
+ instruction,
51
+ workflow,
52
+ step,
53
+ supervisor,
54
+ middleware: {
55
+ budget,
56
+ guardrail,
57
+ semanticCache,
58
+ compose: composeMiddleware,
59
+ forTool
60
+ }
61
+ };
62
+
63
+ //#endregion
64
+ export { ai };
65
+ //# sourceMappingURL=ai.mjs.map
package/esm/ai.mjs.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai.mjs","names":[],"sources":["../../../../../@warlock.js/ai/src/ai.ts"],"sourcesContent":["import { agent } from \"./agent/agent\";\nimport { setAIConfig } from \"./config\";\nimport { budget } from \"./middleware/builtins/budget\";\nimport { guardrail } from \"./middleware/builtins/guardrail\";\nimport { semanticCache } from \"./middleware/builtins/semantic-cache\";\nimport { composeMiddleware, forTool } from \"./middleware/helpers\";\nimport { supervisor } from \"./supervisor/supervisor\";\nimport { instruction } from \"./system-prompt/instruction\";\nimport { persona } from \"./system-prompt/persona\";\nimport { systemPrompt } from \"./system-prompt/system-prompt\";\nimport { tool } from \"./tool/tool\";\nimport { step } from \"./workflow/step\";\nimport { workflow } from \"./workflow/workflow\";\n\n/**\n * Top-level `ai` namespace — holds built-in factories and user-registered SDK adapters.\n *\n * Factories:\n * - `ai.tool(...)` — wrap an async function with a schema-validated input.\n * - `ai.agent(...)` — build an executable agent from model + tools + prompt.\n * - `ai.systemPrompt(...)` — compose a layered persona + instructions prompt.\n * - `ai.persona(text)` — reusable persona block (can be passed to `systemPrompt`).\n * - `ai.instruction(text)` — reusable instruction block (can be passed to `systemPrompt`).\n * - `ai.openai.model(...)` / `ai.anthropic.model(...)` / ... once the adapter SDK is registered.\n *\n * @example\n * const alex = ai.persona(\"You are Alex, a TypeScript expert.\");\n * const replyIn = ai.instruction(\"Respond in {{language|English}}.\");\n *\n * const prompt = ai.systemPrompt().persona(alex).instruction(replyIn);\n *\n * const myAgent = ai.agent({\n * model: ai.openai.model({ name: \"gpt-4o\" }),\n * systemPrompt: prompt,\n * tools: [myTool],\n * });\n *\n * const result = await myAgent.execute(\"What is the weather in Cairo?\", {\n * placeholders: { language: \"Arabic\" },\n * });\n */\nexport const ai = {\n config: setAIConfig,\n tool,\n agent,\n systemPrompt,\n persona,\n instruction,\n workflow,\n step,\n supervisor,\n middleware: {\n budget,\n guardrail,\n semanticCache,\n compose: composeMiddleware,\n forTool,\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAa,KAAK;CAChB,QAAQ;CACR;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,YAAY;EACV;EACA;EACA;EACA,SAAS;EACT;CACF;AACF"}
@@ -0,0 +1,79 @@
1
+ import { CacheDriver } from "@warlock.js/cache";
2
+
3
+ //#region ../../@warlock.js/ai/src/config.d.ts
4
+ /**
5
+ * Process-wide `@warlock.js/ai` configuration. **Intentionally tiny.**
6
+ * Lives here only for genuinely cross-cutting defaults that would
7
+ * otherwise force users to wire the same value into every consumer.
8
+ *
9
+ * **What lives here.** A field earns a slot only when it satisfies
10
+ * all three:
11
+ * 1. Multiple unrelated consumers need the same value.
12
+ * 2. The value is infrastructure (drivers, clients, pools), not
13
+ * behavior (kill-switches, mode flags).
14
+ * 3. Per-call override doesn't make sense for the use case.
15
+ *
16
+ * **What does NOT live here.** Logger config (use
17
+ * `@warlock.js/logger` directly). Per-primitive feature flags
18
+ * (live on the relevant config type). Anything that's really one
19
+ * consumer's concern (lives on that consumer).
20
+ *
21
+ * Phase 3.2 deliberately removed the previous `configureAI()` bag
22
+ * because it was growing unbounded. Treat new fields here with the
23
+ * same suspicion.
24
+ */
25
+ type AIConfig = {
26
+ /**
27
+ * Default store used by every consumer that supports persistence
28
+ * but didn't supply its own `store` / `snapshotStore`. Most
29
+ * realistic deployments back resume snapshots, semantic cache, and
30
+ * future memory primitives with the same driver — declaring it
31
+ * once here removes the repetition.
32
+ *
33
+ * Per-declaration overrides (`SupervisorConfig.snapshotStore`,
34
+ * `semanticCache({ store })`) win when supplied. Set this once at
35
+ * app boot, *after* you've constructed your driver.
36
+ *
37
+ * @example
38
+ * import { cache } from "@warlock.js/cache";
39
+ * import { ai } from "@warlock.js/ai";
40
+ *
41
+ * ai.config({
42
+ * defaultStore: cache.driver("redis", { client: redisClient }),
43
+ * });
44
+ */
45
+ defaultStore?: CacheDriver<any, any>;
46
+ };
47
+ /**
48
+ * Set or extend process-wide AI configuration. Merges over existing
49
+ * values — fields not present in `partial` keep whatever was set
50
+ * before (or stay unset). Call once at app boot, before constructing
51
+ * any agent / supervisor / middleware that should pick up the
52
+ * defaults.
53
+ *
54
+ * Returns the merged config so callers can verify what landed.
55
+ *
56
+ * @example
57
+ * import { cache } from "@warlock.js/cache";
58
+ * import { ai } from "@warlock.js/ai";
59
+ *
60
+ * ai.config({ defaultStore: cache.driver("redis", { client }) });
61
+ */
62
+ declare function setAIConfig(partial: Partial<AIConfig>): AIConfig;
63
+ /**
64
+ * Read the current AI config snapshot. Returns a shallow copy so
65
+ * callers can't accidentally mutate the source of truth. Used
66
+ * internally by consumers to resolve their `defaultStore` fallback.
67
+ */
68
+ declare function getAIConfig(): AIConfig;
69
+ /**
70
+ * Resolve the effective store for a consumer that didn't receive an
71
+ * explicit one. Returns the global `defaultStore` if set, otherwise
72
+ * `undefined`. Consumers decide whether `undefined` is fatal (semantic
73
+ * cache: yes, throws) or a no-op (snapshot persistence: yes, just
74
+ * skips).
75
+ */
76
+ declare function resolveDefaultStore(): CacheDriver<any, any> | undefined;
77
+ //#endregion
78
+ export { AIConfig, getAIConfig, resolveDefaultStore, setAIConfig };
79
+ //# sourceMappingURL=config.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.mts","names":[],"sources":["../../../../../@warlock.js/ai/src/config.ts"],"mappings":";;;;;AAuBA;;;;AAoB4B;AAoB5B;;;;;;;;;;;;;AAAiE;KAxCrD,QAAA;EAkDe;;;AAAY;AAWvC;;;;AAAkD;;;;;;;;;;;EAzChD,YAAA,GAAe,WAAW;AAAA;;;;;;;;;;;;;;;;iBAoBZ,WAAA,CAAY,OAAA,EAAS,OAAA,CAAQ,QAAA,IAAY,QAAA;;;;;;iBAUzC,WAAA,CAAA,GAAe,QAAQ;;;;;;;;iBAWvB,mBAAA,CAAA,GAAuB,WAAW"}
package/esm/config.mjs ADDED
@@ -0,0 +1,43 @@
1
+ //#region ../../@warlock.js/ai/src/config.ts
2
+ const aiConfig = {};
3
+ /**
4
+ * Set or extend process-wide AI configuration. Merges over existing
5
+ * values — fields not present in `partial` keep whatever was set
6
+ * before (or stay unset). Call once at app boot, before constructing
7
+ * any agent / supervisor / middleware that should pick up the
8
+ * defaults.
9
+ *
10
+ * Returns the merged config so callers can verify what landed.
11
+ *
12
+ * @example
13
+ * import { cache } from "@warlock.js/cache";
14
+ * import { ai } from "@warlock.js/ai";
15
+ *
16
+ * ai.config({ defaultStore: cache.driver("redis", { client }) });
17
+ */
18
+ function setAIConfig(partial) {
19
+ Object.assign(aiConfig, partial);
20
+ return { ...aiConfig };
21
+ }
22
+ /**
23
+ * Read the current AI config snapshot. Returns a shallow copy so
24
+ * callers can't accidentally mutate the source of truth. Used
25
+ * internally by consumers to resolve their `defaultStore` fallback.
26
+ */
27
+ function getAIConfig() {
28
+ return { ...aiConfig };
29
+ }
30
+ /**
31
+ * Resolve the effective store for a consumer that didn't receive an
32
+ * explicit one. Returns the global `defaultStore` if set, otherwise
33
+ * `undefined`. Consumers decide whether `undefined` is fatal (semantic
34
+ * cache: yes, throws) or a no-op (snapshot persistence: yes, just
35
+ * skips).
36
+ */
37
+ function resolveDefaultStore() {
38
+ return aiConfig.defaultStore;
39
+ }
40
+
41
+ //#endregion
42
+ export { getAIConfig, resolveDefaultStore, setAIConfig };
43
+ //# sourceMappingURL=config.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.mjs","names":[],"sources":["../../../../../@warlock.js/ai/src/config.ts"],"sourcesContent":["import type { CacheDriver } from \"@warlock.js/cache\";\n\n/**\n * Process-wide `@warlock.js/ai` configuration. **Intentionally tiny.**\n * Lives here only for genuinely cross-cutting defaults that would\n * otherwise force users to wire the same value into every consumer.\n *\n * **What lives here.** A field earns a slot only when it satisfies\n * all three:\n * 1. Multiple unrelated consumers need the same value.\n * 2. The value is infrastructure (drivers, clients, pools), not\n * behavior (kill-switches, mode flags).\n * 3. Per-call override doesn't make sense for the use case.\n *\n * **What does NOT live here.** Logger config (use\n * `@warlock.js/logger` directly). Per-primitive feature flags\n * (live on the relevant config type). Anything that's really one\n * consumer's concern (lives on that consumer).\n *\n * Phase 3.2 deliberately removed the previous `configureAI()` bag\n * because it was growing unbounded. Treat new fields here with the\n * same suspicion.\n */\nexport type AIConfig = {\n /**\n * Default store used by every consumer that supports persistence\n * but didn't supply its own `store` / `snapshotStore`. Most\n * realistic deployments back resume snapshots, semantic cache, and\n * future memory primitives with the same driver — declaring it\n * once here removes the repetition.\n *\n * Per-declaration overrides (`SupervisorConfig.snapshotStore`,\n * `semanticCache({ store })`) win when supplied. Set this once at\n * app boot, *after* you've constructed your driver.\n *\n * @example\n * import { cache } from \"@warlock.js/cache\";\n * import { ai } from \"@warlock.js/ai\";\n *\n * ai.config({\n * defaultStore: cache.driver(\"redis\", { client: redisClient }),\n * });\n */\n defaultStore?: CacheDriver<any, any>;\n};\n\nconst aiConfig: AIConfig = {};\n\n/**\n * Set or extend process-wide AI configuration. Merges over existing\n * values — fields not present in `partial` keep whatever was set\n * before (or stay unset). Call once at app boot, before constructing\n * any agent / supervisor / middleware that should pick up the\n * defaults.\n *\n * Returns the merged config so callers can verify what landed.\n *\n * @example\n * import { cache } from \"@warlock.js/cache\";\n * import { ai } from \"@warlock.js/ai\";\n *\n * ai.config({ defaultStore: cache.driver(\"redis\", { client }) });\n */\nexport function setAIConfig(partial: Partial<AIConfig>): AIConfig {\n Object.assign(aiConfig, partial);\n return { ...aiConfig };\n}\n\n/**\n * Read the current AI config snapshot. Returns a shallow copy so\n * callers can't accidentally mutate the source of truth. Used\n * internally by consumers to resolve their `defaultStore` fallback.\n */\nexport function getAIConfig(): AIConfig {\n return { ...aiConfig };\n}\n\n/**\n * Resolve the effective store for a consumer that didn't receive an\n * explicit one. Returns the global `defaultStore` if set, otherwise\n * `undefined`. Consumers decide whether `undefined` is fatal (semantic\n * cache: yes, throws) or a no-op (snapshot persistence: yes, just\n * skips).\n */\nexport function resolveDefaultStore(): CacheDriver<any, any> | undefined {\n return aiConfig.defaultStore;\n}\n"],"mappings":";AA8CA,MAAM,WAAqB,CAAC;;;;;;;;;;;;;;;;AAiB5B,SAAgB,YAAY,SAAsC;CAChE,OAAO,OAAO,UAAU,OAAO;CAC/B,OAAO,EAAE,GAAG,SAAS;AACvB;;;;;;AAOA,SAAgB,cAAwB;CACtC,OAAO,EAAE,GAAG,SAAS;AACvB;;;;;;;;AASA,SAAgB,sBAAyD;CACvE,OAAO,SAAS;AAClB"}
@@ -0,0 +1,132 @@
1
+ import { Attachment } from "../attachment.type.mjs";
2
+ import { Message } from "../conversation-message.type.mjs";
3
+ import { ToolContext } from "../tool.contract.mjs";
4
+ import { Placeholders } from "../placeholders.type.mjs";
5
+ import { SystemPromptContract } from "../system-prompt.contract.mjs";
6
+ import { AgentEventMap } from "../events/event-map.type.mjs";
7
+ import { StreamingToolGuardConfig } from "../streaming-tool-guard-config.type.mjs";
8
+ import { StandardSchemaV1 } from "@standard-schema/spec";
9
+
10
+ //#region ../../@warlock.js/ai/src/contracts/agent/agent-options.type.d.ts
11
+ /**
12
+ * Options passed to AgentContract.execute() to configure a single execution run.
13
+ *
14
+ * @example
15
+ * const result = await agent.execute("Analyze this document", {
16
+ * history: previousMessages,
17
+ * attachments: ["/path/to/doc.pdf"],
18
+ * placeholders: { language: "English" },
19
+ * output: z.object({ summary: z.string(), keyPoints: z.array(z.string()) }),
20
+ * on: {
21
+ * streaming: ({ delta }) => process.stdout.write(delta),
22
+ * completed: ({ result }) => console.log("Done"),
23
+ * },
24
+ * });
25
+ */
26
+ type AgentExecuteOptions<TOutput = unknown> = {
27
+ /** Prior conversation messages to prepend as context */history?: Message[]; /** Files or URLs to attach to the message */
28
+ attachments?: Attachment[]; /** Values to inject into {{mustache}} placeholders in prompts */
29
+ placeholders?: Placeholders;
30
+ /**
31
+ * Standard Schema for structured output extraction.
32
+ * When provided, the agent will attempt to return typed data in result.data.
33
+ */
34
+ output?: StandardSchemaV1<TOutput>;
35
+ /**
36
+ * Hand-crafted JSON Schema used to drive native structured-output mode
37
+ * (OpenAI `response_format: json_schema`, etc.) and to embed in the
38
+ * soft system-prompt instruction.
39
+ *
40
+ * Primary use case: libraries whose JSON Schema output isn't
41
+ * automatically extractable by `extractJsonSchema` — notably Zod,
42
+ * which ships `z.toJSONSchema` as a top-level module function rather
43
+ * than a property on the schema. Pass the converter's output here and
44
+ * the agent will use it verbatim, skipping extraction.
45
+ *
46
+ * When both `output` and `responseSchema` are set, `responseSchema`
47
+ * wins — `output` still runs for client-side validation into
48
+ * `result.data`, but the wire-level schema sent to the model is
49
+ * whatever was passed here.
50
+ *
51
+ * @example
52
+ * import { z, toJSONSchema } from "zod";
53
+ * const schema = z.object({ summary: z.string() });
54
+ * await agent.execute(input, {
55
+ * output: schema,
56
+ * responseSchema: toJSONSchema(schema),
57
+ * });
58
+ */
59
+ responseSchema?: Record<string, unknown>;
60
+ /**
61
+ * Opt-in self-repair when the model's response fails to parse or
62
+ * validate against `output`. When enabled, the agent appends the bad
63
+ * assistant message plus a corrective user message to the conversation
64
+ * and re-invokes the model up to `maxAttempts` times, re-parsing on
65
+ * each attempt. Disabled by default — schema failures normally surface
66
+ * a real prompt/model issue worth seeing rather than silently retrying.
67
+ *
68
+ * Each repair attempt counts as a normal trip and is bounded by the
69
+ * agent's `maxTrips` cap (belt-and-suspenders against runaway loops).
70
+ *
71
+ * Only active when `output` (or `responseSchema`) is set; ignored
72
+ * otherwise.
73
+ *
74
+ * @example
75
+ * await agent.execute(input, {
76
+ * output: schema,
77
+ * repair: { maxAttempts: 1 },
78
+ * });
79
+ */
80
+ repair?: {
81
+ /** Max number of re-ask attempts after the initial failure. Default 1. */maxAttempts?: number;
82
+ }; /** Override the agent's system prompt for this execution */
83
+ systemPrompt?: SystemPromptContract;
84
+ /**
85
+ * Cancellation handle. When `signal.aborted` becomes true the agent
86
+ * short-circuits at the next trip boundary and returns with
87
+ * `report.status = "cancelled"` + `result.error` set to an
88
+ * `AgentExecutionError` carrying the abort reason. Mid-trip abort
89
+ * is best-effort — it relies on the underlying provider adapter
90
+ * threading `signal` into its HTTP client. The workflow engine
91
+ * passes its own signal through automatically when a step has an
92
+ * `agent`.
93
+ */
94
+ signal?: AbortSignal; /** Event handlers for observing execution progress */
95
+ on?: Partial<{ [K in keyof AgentEventMap]: (payload: AgentEventMap[K]) => void }>;
96
+ /**
97
+ * Tool context threaded into every `tool.invoke()` call this agent
98
+ * runs (Phase 5 / decisions §35). Tools mutate `ctx.artifacts` to
99
+ * contribute system-only side data; the supervisor that supplied
100
+ * the ctx merges that bag into state at iteration end.
101
+ *
102
+ * Typically set by the supervisor's dispatch loop, not by user
103
+ * code. Standalone callers may omit it — the framework supplies a
104
+ * degraded `{ artifacts: {} }` so single-arg legacy tools keep
105
+ * working unchanged.
106
+ */
107
+ toolCtx?: ToolContext;
108
+ /**
109
+ * Per-call override for the stream-time tool-call guard. Wins over
110
+ * `AgentConfig.streamingToolGuard` when set. Pass `undefined` to
111
+ * disable for a single call when the agent-level config has the
112
+ * guard enabled (e.g. a one-off "give me a raw JSON config" call
113
+ * where the buffering delay isn't worth it).
114
+ */
115
+ streamingToolGuard?: StreamingToolGuardConfig;
116
+ /**
117
+ * Opaque caller-supplied identifier that groups multiple `execute()`
118
+ * calls into one conceptual user session / request. Mirrored onto
119
+ * every report node this run produces (and every nested executable
120
+ * it invokes via `asTool` wrappers) so flat queries like "total
121
+ * spend for user X this morning" don't need to walk the tree.
122
+ *
123
+ * Auto-propagated to composite primitives — an inner supervisor
124
+ * dispatched via `asTool` inherits the outer agent's `sessionId`.
125
+ * Execution state (artifacts, snapshots) stays isolated; only the
126
+ * observability identity is shared.
127
+ */
128
+ sessionId?: string;
129
+ };
130
+ //#endregion
131
+ export { AgentExecuteOptions };
132
+ //# sourceMappingURL=agent-options.type.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-options.type.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/contracts/agent/agent-options.type.ts"],"mappings":";;;;;;;;;;;;AAwBA;;;;;;;;;;;;;KAAY,mBAAA;EA2EL,wDAzEL,OAAA,GAAU,OAAA,IA+FW;EA7FrB,WAAA,GAAc,UAAA,IA6F+B;EA3F7C,YAAA,GAAe,YAAA;EAJf;;;;EASA,MAAA,GAAS,gBAAA,CAAiB,OAAA;EALX;;;;;;;;;;;;;;;;;;;;;;;;EA8Bf,cAAA,GAAiB,MAAA;EA0ER;;;;;;;;;;;;;;;;;;;;EArDT,MAAA;8EAEE,WAAA;EAAA;EAGF,YAAA,GAAe,oBAAA;;;;;;;;;;;EAWf,MAAA,GAAS,WAAA;EAET,EAAA,GAAK,OAAA,eACS,aAAA,IAAiB,OAAA,EAAS,aAAA,CAAc,CAAA;;;;;;;;;;;;EAatD,OAAA,GAAU,WAAA;;;;;;;;EAQV,kBAAA,GAAqB,wBAAA;;;;;;;;;;;;;EAarB,SAAA;AAAA"}
@@ -0,0 +1,92 @@
1
+ import { AgentResult } from "../result/agent-result.type.mjs";
2
+ import { ExecutableContract } from "../executable.contract.mjs";
3
+ import { StreamContract } from "../stream/stream.contract.mjs";
4
+ import { AgentEventMap } from "../events/event-map.type.mjs";
5
+ import { AgentExecuteOptions } from "./agent-options.type.mjs";
6
+
7
+ //#region ../../@warlock.js/ai/src/contracts/agent/agent.contract.d.ts
8
+ /**
9
+ * Handler function for a single agent event. Takes the event's typed
10
+ * payload; return value is ignored.
11
+ */
12
+ type AgentEventHandler<K extends keyof AgentEventMap> = (payload: AgentEventMap[K]) => void;
13
+ /**
14
+ * Contract for an AI agent — the core executable primitive.
15
+ *
16
+ * Supports a 3-tier event subscription model. All three layers fire in
17
+ * order on every event: **factory → instance → per-call**. A listener
18
+ * at any level can inspect the same event without the others needing
19
+ * to know.
20
+ *
21
+ * - **Factory-level** — `ai.agent({ on: {...} })`. Fires on every run.
22
+ * - **Instance-level** — `agent.on(event, handler)` / `agent.off(...)`.
23
+ * Imperative additions that persist across every `execute()`/`stream()`
24
+ * call on this instance. `on()` returns an unsubscribe function.
25
+ * - **Per-call** — `agent.execute(input, { on: {...} })` or
26
+ * `agent.stream(input, { on: {...} })`. Scoped to that one run.
27
+ *
28
+ * @example
29
+ * const myAgent = ai.agent({
30
+ * model,
31
+ * on: { "agent.starting": () => metrics.inc("agent.runs") },
32
+ * });
33
+ *
34
+ * const unsubscribe = myAgent.on("agent.error", ({ error }) => logger.error(error));
35
+ *
36
+ * const result = await myAgent.execute("Summarize this", {
37
+ * output: z.object({ summary: z.string() }),
38
+ * on: { "agent.trip.completed": ({ trip }) => console.log(trip.duration) },
39
+ * });
40
+ *
41
+ * unsubscribe();
42
+ *
43
+ * @example
44
+ * // Stream tokens as they arrive
45
+ * const stream = myAgent.stream("Write a poem");
46
+ * for await (const event of stream) {
47
+ * if (event.type === "agent.trip.streaming") process.stdout.write(event.delta);
48
+ * }
49
+ * const result = await stream.result;
50
+ */
51
+ interface AgentContract<TOutput = unknown> extends ExecutableContract<string, AgentExecuteOptions<TOutput>, AgentResult<TOutput>> {
52
+ /**
53
+ * Stable identifier for this agent. Always populated — if the
54
+ * factory caller omitted `name`, a deterministic
55
+ * `anon_<provider>_<model>[_<tool>+...]` fingerprint is synthesized
56
+ * (same config → same name across restarts). Consumers that require
57
+ * a *meaningful* name (workflow step, tool wrapper) should
58
+ * additionally check `isAnonymous`.
59
+ */
60
+ readonly name: string;
61
+ /**
62
+ * `true` when the agent was constructed without an explicit name.
63
+ * Workflow / tool boundaries reject anonymous agents at author time
64
+ * so signature drift detection and tool routing stay honest.
65
+ */
66
+ readonly isAnonymous: boolean;
67
+ /**
68
+ * Optional short summary — surfaced to supervisor router prompts and
69
+ * to `asTool()` wrappers. Mirrors whatever was set on
70
+ * `AgentConfig.description` at factory time.
71
+ */
72
+ readonly description?: string;
73
+ /**
74
+ * Stream execution events in real time.
75
+ * Yields typed StreamEvent values and resolves result when done.
76
+ */
77
+ stream(input: string, options?: AgentExecuteOptions<TOutput>): StreamContract<AgentResult<TOutput>>;
78
+ /**
79
+ * Subscribe a handler to a single event name for the lifetime of
80
+ * this agent instance. Returns an unsubscribe function; calling it
81
+ * is equivalent to `off(event, handler)`.
82
+ */
83
+ on<K extends keyof AgentEventMap>(event: K, handler: AgentEventHandler<K>): () => void;
84
+ /**
85
+ * Remove a previously-subscribed handler. No-op when the handler was
86
+ * never registered or was already removed.
87
+ */
88
+ off<K extends keyof AgentEventMap>(event: K, handler: AgentEventHandler<K>): void;
89
+ }
90
+ //#endregion
91
+ export { AgentContract, AgentEventHandler };
92
+ //# sourceMappingURL=agent.contract.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.contract.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/contracts/agent/agent.contract.ts"],"mappings":";;;;;;;;;AAUA;;KAAY,iBAAA,iBAAkC,aAAA,KAC5C,OAAA,EAAS,aAAA,CAAc,CAAA;;;;;;;;;;;;AAAE;AAyC3B;;;;;;;;;;;;;;;;;;;;;;;;;;UAAiB,aAAA,4BAAyC,kBAAA,SAExD,mBAAA,CAAoB,OAAA,GACpB,WAAA,CAAY,OAAA;EAAZ;;;;;;;;EAAA,SAUS,IAAA;EAmBP;;;;;EAAA,SAbO,WAAA;EAqBU;;;;;EAAA,SAfV,WAAA;EAwBT;;;;EAnBA,MAAA,CACE,KAAA,UACA,OAAA,GAAU,mBAAA,CAAoB,OAAA,IAC7B,cAAA,CAAe,WAAA,CAAY,OAAA;EAkBnB;;;;AAAoB;EAX/B,EAAA,iBAAmB,aAAA,EACjB,KAAA,EAAO,CAAA,EACP,OAAA,EAAS,iBAAA,CAAkB,CAAA;;;;;EAO7B,GAAA,iBAAoB,aAAA,EAClB,KAAA,EAAO,CAAA,EACP,OAAA,EAAS,iBAAA,CAAkB,CAAA;AAAA"}
@@ -0,0 +1,2 @@
1
+ import { AgentContract, AgentEventHandler } from "./agent.contract.mjs";
2
+ import { AgentExecuteOptions } from "./agent-options.type.mjs";
@@ -0,0 +1,100 @@
1
+ //#region ../../@warlock.js/ai/src/contracts/attachment.type.d.ts
2
+ /**
3
+ * Shape of a StorageFile object from @warlock.js/core.
4
+ * Used to detect storage files in the Attachment union.
5
+ *
6
+ * @example
7
+ * const file: StorageFileShape = {
8
+ * url: "https://cdn.example.com/uploads/doc.pdf",
9
+ * absolutePath: "/var/www/uploads/doc.pdf",
10
+ * };
11
+ */
12
+ type StorageFileShape = {
13
+ /** Public URL of the file */url?: string; /** Absolute filesystem path to the file */
14
+ absolutePath?: string;
15
+ };
16
+ /**
17
+ * Where the bytes of an attachment originate. The agent's
18
+ * `prepareAttachmentPart` collapses every variant into a `ContentPart`
19
+ * the model adapter can consume.
20
+ *
21
+ * - `string` — local file path or remote URL (auto-detected via the
22
+ * `https?://` prefix).
23
+ * - `StorageFileShape` — a `@warlock.js/core` storage file; URL wins
24
+ * over path when both are present.
25
+ * - `{ base64, mediaType }` — raw inline bytes with an explicit IANA
26
+ * media type, useful for in-memory data that never touched disk.
27
+ */
28
+ type AttachmentSource = string | StorageFileShape | {
29
+ base64: string;
30
+ mediaType: string;
31
+ };
32
+ /**
33
+ * An attachment that can be passed to an agent execution.
34
+ *
35
+ * Two forms:
36
+ *
37
+ * - **Tagged form** (preferred for non-image types and for explicit
38
+ * intent): `{ type: "image" | "text", source }`.
39
+ * - **Shorthand string / StorageFileShape**: the agent infers the
40
+ * media kind from the file extension. Recognized image extensions:
41
+ * `.png`, `.jpg`, `.jpeg`, `.webp`, `.gif`. Recognized text
42
+ * extension: `.txt`. Anything else throws — silent inference for
43
+ * ambiguous inputs causes silent bugs.
44
+ *
45
+ * @example
46
+ * // Shorthand — extension-inferred image
47
+ * agent.execute("What's in this?", { attachments: ["./photo.png"] });
48
+ *
49
+ * @example
50
+ * // Tagged form — explicit kind
51
+ * agent.execute("Compare", {
52
+ * attachments: [
53
+ * { type: "image", source: "https://cdn.example.com/a.jpg" },
54
+ * { type: "image", source: { base64: "iVBOR...", mediaType: "image/png" } },
55
+ * ],
56
+ * });
57
+ *
58
+ * @example
59
+ * // Text attachment — contents are read and injected as extra text
60
+ * agent.execute("Summarize", { attachments: [{ type: "text", source: "./notes.txt" }] });
61
+ *
62
+ * @example
63
+ * // StorageFileShape from @warlock.js/core (extension-inferred)
64
+ * agent.execute("Describe", { attachments: [storageFile] });
65
+ */
66
+ type Attachment = string | StorageFileShape | {
67
+ type: "image";
68
+ source: AttachmentSource;
69
+ } | {
70
+ type: "text";
71
+ source: AttachmentSource;
72
+ };
73
+ /**
74
+ * A normalized attachment after source resolution — a tagged value the
75
+ * agent can hand to file-reading code without re-discriminating the
76
+ * input variant.
77
+ *
78
+ * @example
79
+ * const resolved: ResolvedAttachment = { type: "url", value: "https://..." };
80
+ * const resolved2: ResolvedAttachment = { type: "path", value: "/tmp/doc.pdf" };
81
+ * const resolved3: ResolvedAttachment = {
82
+ * type: "base64",
83
+ * value: "iVBORw0...",
84
+ * mediaType: "image/png",
85
+ * };
86
+ */
87
+ type ResolvedAttachment = {
88
+ type: "url";
89
+ value: string;
90
+ } | {
91
+ type: "path";
92
+ value: string;
93
+ } | {
94
+ type: "base64";
95
+ value: string;
96
+ mediaType: string;
97
+ };
98
+ //#endregion
99
+ export { Attachment, AttachmentSource, ResolvedAttachment, StorageFileShape };
100
+ //# sourceMappingURL=attachment.type.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment.type.d.mts","names":[],"sources":["../../../../../../@warlock.js/ai/src/contracts/attachment.type.ts"],"mappings":";;AAUA;;;;AAIc;AAed;;;;KAnBY,gBAAA;EAsBN,6BApBJ,GAAA,WAoB6B;EAlB7B,YAAY;AAAA;;;;;;;;;;;;;KAeF,gBAAA,YAER,gBAAgB;EACd,MAAA;EAAgB,SAAA;AAAA;AAwDtB;;;;;;;;;;;;AAG8C;;;;;;;;;;;;;;;;;;;;;;AAH9C,KApBY,UAAA,YAER,gBAAA;EACE,IAAA;EAAe,MAAA,EAAQ,gBAAA;AAAA;EACvB,IAAA;EAAc,MAAA,EAAQ,gBAAA;AAAA;;;;;;;;;;;;;;;KAgBhB,kBAAA;EACN,IAAA;EAAa,KAAA;AAAA;EACb,IAAA;EAAc,KAAA;AAAA;EACd,IAAA;EAAgB,KAAA;EAAe,SAAA;AAAA"}