@warlock.js/ai 4.4.0 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (648) hide show
  1. package/CHANGELOG.md +63 -52
  2. package/cjs/index.cjs +240 -14147
  3. package/cjs/src-Bmajk4Qg.cjs +30 -0
  4. package/cjs/src-OZyDYHxm.cjs +25089 -0
  5. package/cjs/src-OZyDYHxm.cjs.map +1 -0
  6. package/esm/agent/agent-config.type.d.mts +119 -1
  7. package/esm/agent/agent-config.type.d.mts.map +1 -1
  8. package/esm/agent/agent-input-builder.mjs +27 -6
  9. package/esm/agent/agent-input-builder.mjs.map +1 -1
  10. package/esm/agent/agent.d.mts +40 -1
  11. package/esm/agent/agent.d.mts.map +1 -1
  12. package/esm/agent/agent.mjs +328 -36
  13. package/esm/agent/agent.mjs.map +1 -1
  14. package/esm/agent/index.d.mts +2 -1
  15. package/esm/agent/index.mjs +1 -0
  16. package/esm/agent/judge-config.type.d.mts +33 -0
  17. package/esm/agent/judge-config.type.d.mts.map +1 -0
  18. package/esm/agent/judge-config.type.mjs +13 -0
  19. package/esm/agent/judge-config.type.mjs.map +1 -0
  20. package/esm/agent/signature.mjs +57 -0
  21. package/esm/agent/signature.mjs.map +1 -0
  22. package/esm/agent/snapshot.mjs +101 -0
  23. package/esm/agent/snapshot.mjs.map +1 -0
  24. package/esm/ai-openai/src/embedder.mjs +4 -0
  25. package/esm/ai-openai/src/image.mjs +5 -0
  26. package/esm/ai-openai/src/index.mjs +7 -0
  27. package/esm/ai-openai/src/model.mjs +5 -0
  28. package/esm/ai-openai/src/sdk.mjs +9 -0
  29. package/esm/ai-openai/src/speech.mjs +5 -0
  30. package/esm/ai-openai/src/transcription.mjs +6 -0
  31. package/esm/ai-openai/src/utils/index.mjs +5 -0
  32. package/esm/ai-openai/src/utils/to-openai-messages.mjs +3 -0
  33. package/esm/ai-openai/src/utils/to-openai-tools.mjs +3 -0
  34. package/esm/ai-openai/src/utils/wrap-openai-error.mjs +4 -0
  35. package/esm/ai.d.mts +164 -53
  36. package/esm/ai.d.mts.map +1 -1
  37. package/esm/ai.mjs +79 -8
  38. package/esm/ai.mjs.map +1 -1
  39. package/esm/batch/batch.d.mts.map +1 -1
  40. package/esm/batch/batch.mjs +21 -1
  41. package/esm/batch/batch.mjs.map +1 -1
  42. package/esm/batch/batch.type.d.mts +11 -4
  43. package/esm/batch/batch.type.d.mts.map +1 -1
  44. package/esm/config.d.mts +39 -3
  45. package/esm/config.d.mts.map +1 -1
  46. package/esm/config.mjs +26 -2
  47. package/esm/config.mjs.map +1 -1
  48. package/esm/contracts/agent/agent-options.type.d.mts +33 -5
  49. package/esm/contracts/agent/agent-options.type.d.mts.map +1 -1
  50. package/esm/contracts/agent/agent-snapshot.type.d.mts +90 -0
  51. package/esm/contracts/agent/agent-snapshot.type.d.mts.map +1 -0
  52. package/esm/contracts/agent/agent.contract.d.mts +29 -1
  53. package/esm/contracts/agent/agent.contract.d.mts.map +1 -1
  54. package/esm/contracts/agent/eval.type.d.mts +43 -2
  55. package/esm/contracts/agent/eval.type.d.mts.map +1 -1
  56. package/esm/contracts/agent/index.d.mts +2 -1
  57. package/esm/contracts/attachment-policy.type.d.mts +51 -0
  58. package/esm/contracts/attachment-policy.type.d.mts.map +1 -0
  59. package/esm/contracts/attachment.type.d.mts +16 -7
  60. package/esm/contracts/attachment.type.d.mts.map +1 -1
  61. package/esm/contracts/content-part.type.d.mts +14 -5
  62. package/esm/contracts/content-part.type.d.mts.map +1 -1
  63. package/esm/contracts/events/supervisor-events.type.d.mts.map +1 -1
  64. package/esm/contracts/image-model.contract.d.mts +156 -0
  65. package/esm/contracts/image-model.contract.d.mts.map +1 -0
  66. package/esm/contracts/index.d.mts +13 -6
  67. package/esm/contracts/model.contract.d.mts +11 -8
  68. package/esm/contracts/model.contract.d.mts.map +1 -1
  69. package/esm/contracts/orchestrator/index.d.mts +1 -0
  70. package/esm/contracts/orchestrator/orchestrator-config.type.d.mts +31 -2
  71. package/esm/contracts/orchestrator/orchestrator-config.type.d.mts.map +1 -1
  72. package/esm/contracts/orchestrator/session-lock.contract.d.mts +47 -0
  73. package/esm/contracts/orchestrator/session-lock.contract.d.mts.map +1 -0
  74. package/esm/contracts/planner/index.d.mts +3 -2
  75. package/esm/contracts/planner/planner-config.type.d.mts +61 -0
  76. package/esm/contracts/planner/planner-config.type.d.mts.map +1 -1
  77. package/esm/contracts/planner/planner-execute-options.type.d.mts +60 -1
  78. package/esm/contracts/planner/planner-execute-options.type.d.mts.map +1 -1
  79. package/esm/contracts/planner/planner-result.type.d.mts +8 -0
  80. package/esm/contracts/planner/planner-result.type.d.mts.map +1 -1
  81. package/esm/contracts/planner/planner-snapshot.type.d.mts +77 -0
  82. package/esm/contracts/planner/planner-snapshot.type.d.mts.map +1 -0
  83. package/esm/contracts/planner/planner.contract.d.mts +21 -1
  84. package/esm/contracts/planner/planner.contract.d.mts.map +1 -1
  85. package/esm/contracts/result/agent-result.type.d.mts +6 -4
  86. package/esm/contracts/result/agent-result.type.d.mts.map +1 -1
  87. package/esm/contracts/result/base-report.type.d.mts +21 -3
  88. package/esm/contracts/result/base-report.type.d.mts.map +1 -1
  89. package/esm/contracts/result/base-report.type.mjs.map +1 -1
  90. package/esm/contracts/result/execution-report.type.d.mts +53 -1
  91. package/esm/contracts/result/execution-report.type.d.mts.map +1 -1
  92. package/esm/contracts/result/supervisor-result.type.d.mts +14 -2
  93. package/esm/contracts/result/supervisor-result.type.d.mts.map +1 -1
  94. package/esm/contracts/result/workflow-result.type.d.mts +2 -1
  95. package/esm/contracts/result/workflow-result.type.d.mts.map +1 -1
  96. package/esm/contracts/sdk-adapter.contract.d.mts +37 -0
  97. package/esm/contracts/sdk-adapter.contract.d.mts.map +1 -1
  98. package/esm/contracts/speech-model.contract.d.mts +97 -0
  99. package/esm/contracts/speech-model.contract.d.mts.map +1 -0
  100. package/esm/contracts/supervisor/supervisor-config.type.d.mts +29 -0
  101. package/esm/contracts/supervisor/supervisor-config.type.d.mts.map +1 -1
  102. package/esm/contracts/system-prompt.contract.d.mts +103 -1
  103. package/esm/contracts/system-prompt.contract.d.mts.map +1 -1
  104. package/esm/contracts/team/index.d.mts +1 -0
  105. package/esm/contracts/team/team-config.type.d.mts +127 -0
  106. package/esm/contracts/team/team-config.type.d.mts.map +1 -0
  107. package/esm/contracts/tool.contract.d.mts +4 -2
  108. package/esm/contracts/tool.contract.d.mts.map +1 -1
  109. package/esm/contracts/transcription-model.contract.d.mts +101 -0
  110. package/esm/contracts/transcription-model.contract.d.mts.map +1 -0
  111. package/esm/contracts/workflow/step.contract.d.mts +30 -5
  112. package/esm/contracts/workflow/step.contract.d.mts.map +1 -1
  113. package/esm/contracts/workflow/workflow.contract.d.mts +16 -0
  114. package/esm/contracts/workflow/workflow.contract.d.mts.map +1 -1
  115. package/esm/errors/agent-drift-error.d.mts +32 -0
  116. package/esm/errors/agent-drift-error.d.mts.map +1 -0
  117. package/esm/errors/agent-drift-error.mjs +31 -0
  118. package/esm/errors/agent-drift-error.mjs.map +1 -0
  119. package/esm/errors/error-code.type.d.mts +1 -1
  120. package/esm/errors/index.d.mts +3 -0
  121. package/esm/errors/index.mjs +3 -0
  122. package/esm/errors/outbound-policy-error.d.mts +27 -0
  123. package/esm/errors/outbound-policy-error.d.mts.map +1 -0
  124. package/esm/errors/outbound-policy-error.mjs +32 -0
  125. package/esm/errors/outbound-policy-error.mjs.map +1 -0
  126. package/esm/errors/planner-drift-error.d.mts +34 -0
  127. package/esm/errors/planner-drift-error.d.mts.map +1 -0
  128. package/esm/errors/planner-drift-error.mjs +33 -0
  129. package/esm/errors/planner-drift-error.mjs.map +1 -0
  130. package/esm/eval/dataset.d.mts +28 -0
  131. package/esm/eval/dataset.d.mts.map +1 -0
  132. package/esm/eval/dataset.mjs +112 -0
  133. package/esm/eval/dataset.mjs.map +1 -0
  134. package/esm/eval/dataset.type.d.mts +53 -0
  135. package/esm/eval/dataset.type.d.mts.map +1 -0
  136. package/esm/eval/eval-runner.d.mts.map +1 -1
  137. package/esm/eval/eval-runner.mjs +16 -2
  138. package/esm/eval/eval-runner.mjs.map +1 -1
  139. package/esm/eval/index.d.mts +20 -1
  140. package/esm/eval/index.d.mts.map +1 -1
  141. package/esm/eval/index.mjs +20 -2
  142. package/esm/eval/index.mjs.map +1 -1
  143. package/esm/eval/regression.d.mts +30 -0
  144. package/esm/eval/regression.d.mts.map +1 -0
  145. package/esm/eval/regression.mjs +51 -0
  146. package/esm/eval/regression.mjs.map +1 -0
  147. package/esm/eval/report-json.d.mts +30 -0
  148. package/esm/eval/report-json.d.mts.map +1 -0
  149. package/esm/eval/report-json.mjs +33 -0
  150. package/esm/eval/report-json.mjs.map +1 -0
  151. package/esm/eval/report-junit.d.mts +22 -0
  152. package/esm/eval/report-junit.d.mts.map +1 -0
  153. package/esm/eval/report-junit.mjs +60 -0
  154. package/esm/eval/report-junit.mjs.map +1 -0
  155. package/esm/guard/contracts/guard-options.type.d.mts +165 -0
  156. package/esm/guard/contracts/guard-options.type.d.mts.map +1 -0
  157. package/esm/guard/contracts/guardrail.contract.d.mts +78 -0
  158. package/esm/guard/contracts/guardrail.contract.d.mts.map +1 -0
  159. package/esm/guard/contracts/index.d.mts +4 -0
  160. package/esm/guard/contracts/openai-client.contract.d.mts +51 -0
  161. package/esm/guard/contracts/openai-client.contract.d.mts.map +1 -0
  162. package/esm/guard/contracts/verdict.type.d.mts +76 -0
  163. package/esm/guard/contracts/verdict.type.d.mts.map +1 -0
  164. package/esm/guard/detectors/index.d.mts +4 -0
  165. package/esm/guard/detectors/index.mjs +6 -0
  166. package/esm/guard/detectors/injection.d.mts +34 -0
  167. package/esm/guard/detectors/injection.d.mts.map +1 -0
  168. package/esm/guard/detectors/injection.mjs +254 -0
  169. package/esm/guard/detectors/injection.mjs.map +1 -0
  170. package/esm/guard/detectors/moderation.d.mts +32 -0
  171. package/esm/guard/detectors/moderation.d.mts.map +1 -0
  172. package/esm/guard/detectors/moderation.mjs +134 -0
  173. package/esm/guard/detectors/moderation.mjs.map +1 -0
  174. package/esm/guard/detectors/pii.d.mts +41 -0
  175. package/esm/guard/detectors/pii.d.mts.map +1 -0
  176. package/esm/guard/detectors/pii.mjs +199 -0
  177. package/esm/guard/detectors/pii.mjs.map +1 -0
  178. package/esm/guard/detectors/topic.d.mts +29 -0
  179. package/esm/guard/detectors/topic.d.mts.map +1 -0
  180. package/esm/guard/detectors/topic.mjs +99 -0
  181. package/esm/guard/detectors/topic.mjs.map +1 -0
  182. package/esm/guard/errors.d.mts +12 -0
  183. package/esm/guard/errors.d.mts.map +1 -0
  184. package/esm/guard/errors.mjs +18 -0
  185. package/esm/guard/errors.mjs.map +1 -0
  186. package/esm/guard/guard.d.mts +67 -0
  187. package/esm/guard/guard.d.mts.map +1 -0
  188. package/esm/guard/guard.mjs +209 -0
  189. package/esm/guard/guard.mjs.map +1 -0
  190. package/esm/guard/guardrail.d.mts +39 -0
  191. package/esm/guard/guardrail.d.mts.map +1 -0
  192. package/esm/guard/guardrail.mjs +22 -0
  193. package/esm/guard/guardrail.mjs.map +1 -0
  194. package/esm/human/contracts/approval.type.d.mts +154 -0
  195. package/esm/human/contracts/approval.type.d.mts.map +1 -0
  196. package/esm/human/contracts/human-approval.type.d.mts +38 -0
  197. package/esm/human/contracts/human-approval.type.d.mts.map +1 -0
  198. package/esm/human/contracts/index.d.mts +4 -0
  199. package/esm/human/contracts/interrupt-store.contract.d.mts +112 -0
  200. package/esm/human/contracts/interrupt-store.contract.d.mts.map +1 -0
  201. package/esm/human/contracts/resume.type.d.mts +77 -0
  202. package/esm/human/contracts/resume.type.d.mts.map +1 -0
  203. package/esm/human/errors.d.mts +84 -0
  204. package/esm/human/errors.d.mts.map +1 -0
  205. package/esm/human/errors.mjs +60 -0
  206. package/esm/human/errors.mjs.map +1 -0
  207. package/esm/human/human-approval.d.mts +57 -0
  208. package/esm/human/human-approval.d.mts.map +1 -0
  209. package/esm/human/human-approval.mjs +170 -0
  210. package/esm/human/human-approval.mjs.map +1 -0
  211. package/esm/human/policy.d.mts +55 -0
  212. package/esm/human/policy.d.mts.map +1 -0
  213. package/esm/human/policy.mjs +67 -0
  214. package/esm/human/policy.mjs.map +1 -0
  215. package/esm/human/register.mjs +37 -0
  216. package/esm/human/register.mjs.map +1 -0
  217. package/esm/human/resume-seed.mjs +53 -0
  218. package/esm/human/resume-seed.mjs.map +1 -0
  219. package/esm/human/resume.d.mts +54 -0
  220. package/esm/human/resume.d.mts.map +1 -0
  221. package/esm/human/resume.mjs +121 -0
  222. package/esm/human/resume.mjs.map +1 -0
  223. package/esm/human/stores/index.mjs +5 -0
  224. package/esm/human/stores/memory.d.mts +30 -0
  225. package/esm/human/stores/memory.d.mts.map +1 -0
  226. package/esm/human/stores/memory.mjs +91 -0
  227. package/esm/human/stores/memory.mjs.map +1 -0
  228. package/esm/human/stores/pg.d.mts +59 -0
  229. package/esm/human/stores/pg.d.mts.map +1 -0
  230. package/esm/human/stores/pg.mjs +220 -0
  231. package/esm/human/stores/pg.mjs.map +1 -0
  232. package/esm/human/stores/redis.d.mts +56 -0
  233. package/esm/human/stores/redis.d.mts.map +1 -0
  234. package/esm/human/stores/redis.mjs +201 -0
  235. package/esm/human/stores/redis.mjs.map +1 -0
  236. package/esm/image/image-cost.d.mts +32 -0
  237. package/esm/image/image-cost.d.mts.map +1 -0
  238. package/esm/image/image-cost.mjs +55 -0
  239. package/esm/image/image-cost.mjs.map +1 -0
  240. package/esm/image/image.d.mts +92 -0
  241. package/esm/image/image.d.mts.map +1 -0
  242. package/esm/image/image.mjs +113 -0
  243. package/esm/image/image.mjs.map +1 -0
  244. package/esm/image/index.mjs +4 -0
  245. package/esm/index.d.mts +137 -24
  246. package/esm/index.mjs +101 -11
  247. package/esm/middleware/builtins/budget.mjs +6 -2
  248. package/esm/middleware/builtins/budget.mjs.map +1 -1
  249. package/esm/middleware/utils/extract-user-text.d.mts +8 -1
  250. package/esm/middleware/utils/extract-user-text.d.mts.map +1 -1
  251. package/esm/middleware/utils/extract-user-text.mjs +8 -1
  252. package/esm/middleware/utils/extract-user-text.mjs.map +1 -1
  253. package/esm/mock/index.d.mts +3 -0
  254. package/esm/mock/index.mjs +3 -0
  255. package/esm/mock/mock-config.type.d.mts +22 -0
  256. package/esm/mock/mock-config.type.d.mts.map +1 -1
  257. package/esm/mock/mock-image-model.d.mts +41 -0
  258. package/esm/mock/mock-image-model.d.mts.map +1 -0
  259. package/esm/mock/mock-image-model.mjs +52 -0
  260. package/esm/mock/mock-image-model.mjs.map +1 -0
  261. package/esm/mock/mock-sdk.d.mts +7 -1
  262. package/esm/mock/mock-sdk.d.mts.map +1 -1
  263. package/esm/mock/mock-sdk.mjs +27 -0
  264. package/esm/mock/mock-sdk.mjs.map +1 -1
  265. package/esm/mock/mock-speech-model.d.mts +31 -0
  266. package/esm/mock/mock-speech-model.d.mts.map +1 -0
  267. package/esm/mock/mock-speech-model.mjs +39 -0
  268. package/esm/mock/mock-speech-model.mjs.map +1 -0
  269. package/esm/mock/mock-transcription-model.d.mts +32 -0
  270. package/esm/mock/mock-transcription-model.d.mts.map +1 -0
  271. package/esm/mock/mock-transcription-model.mjs +36 -0
  272. package/esm/mock/mock-transcription-model.mjs.map +1 -0
  273. package/esm/object-stream/index.d.mts +2 -0
  274. package/esm/object-stream/index.mjs +4 -0
  275. package/esm/object-stream/parse-partial-json.d.mts +22 -0
  276. package/esm/object-stream/parse-partial-json.d.mts.map +1 -0
  277. package/esm/object-stream/parse-partial-json.mjs +78 -0
  278. package/esm/object-stream/parse-partial-json.mjs.map +1 -0
  279. package/esm/object-stream/stream-object.d.mts +68 -0
  280. package/esm/object-stream/stream-object.d.mts.map +1 -0
  281. package/esm/object-stream/stream-object.mjs +104 -0
  282. package/esm/object-stream/stream-object.mjs.map +1 -0
  283. package/esm/observe/index.mjs +4 -0
  284. package/esm/observe/observer-registry.d.mts +30 -0
  285. package/esm/observe/observer-registry.d.mts.map +1 -0
  286. package/esm/observe/observer-registry.mjs +51 -0
  287. package/esm/observe/observer-registry.mjs.map +1 -0
  288. package/esm/observe/observer.contract.d.mts +40 -0
  289. package/esm/observe/observer.contract.d.mts.map +1 -0
  290. package/esm/observe/resolve-observers.d.mts +40 -0
  291. package/esm/observe/resolve-observers.d.mts.map +1 -0
  292. package/esm/observe/resolve-observers.mjs +73 -0
  293. package/esm/observe/resolve-observers.mjs.map +1 -0
  294. package/esm/orchestrator/execution.d.mts.map +1 -1
  295. package/esm/orchestrator/execution.mjs +5 -2
  296. package/esm/orchestrator/execution.mjs.map +1 -1
  297. package/esm/orchestrator/index.d.mts +1 -0
  298. package/esm/orchestrator/index.mjs +1 -0
  299. package/esm/orchestrator/orchestrator.d.mts.map +1 -1
  300. package/esm/orchestrator/orchestrator.mjs +39 -6
  301. package/esm/orchestrator/orchestrator.mjs.map +1 -1
  302. package/esm/orchestrator/session-lock.d.mts +25 -0
  303. package/esm/orchestrator/session-lock.d.mts.map +1 -0
  304. package/esm/orchestrator/session-lock.mjs +83 -0
  305. package/esm/orchestrator/session-lock.mjs.map +1 -0
  306. package/esm/planner/dag-scheduler.mjs +97 -0
  307. package/esm/planner/dag-scheduler.mjs.map +1 -0
  308. package/esm/planner/plan-prompt.d.mts +1 -1
  309. package/esm/planner/plan-prompt.d.mts.map +1 -1
  310. package/esm/planner/plan-prompt.mjs +2 -1
  311. package/esm/planner/plan-prompt.mjs.map +1 -1
  312. package/esm/planner/planner-run.d.mts +8 -0
  313. package/esm/planner/planner-run.d.mts.map +1 -1
  314. package/esm/planner/planner-run.mjs +457 -31
  315. package/esm/planner/planner-run.mjs.map +1 -1
  316. package/esm/planner/planner.d.mts.map +1 -1
  317. package/esm/planner/planner.mjs +26 -2
  318. package/esm/planner/planner.mjs.map +1 -1
  319. package/esm/planner/snapshot.mjs +95 -0
  320. package/esm/planner/snapshot.mjs.map +1 -0
  321. package/esm/prompt/errors.d.mts +57 -0
  322. package/esm/prompt/errors.d.mts.map +1 -0
  323. package/esm/prompt/errors.mjs +73 -0
  324. package/esm/prompt/errors.mjs.map +1 -0
  325. package/esm/prompt/index.d.mts +3 -0
  326. package/esm/prompt/index.mjs +4 -0
  327. package/esm/prompt/prompt-langfuse-sync.mjs +104 -0
  328. package/esm/prompt/prompt-langfuse-sync.mjs.map +1 -0
  329. package/esm/prompt/prompt-langfuse-sync.type.d.mts +32 -0
  330. package/esm/prompt/prompt-langfuse-sync.type.d.mts.map +1 -0
  331. package/esm/prompt/prompt-validate.mjs +170 -0
  332. package/esm/prompt/prompt-validate.mjs.map +1 -0
  333. package/esm/prompt/prompt.d.mts +54 -0
  334. package/esm/prompt/prompt.d.mts.map +1 -0
  335. package/esm/prompt/prompt.mjs +218 -0
  336. package/esm/prompt/prompt.mjs.map +1 -0
  337. package/esm/prompt/prompt.type.d.mts +174 -0
  338. package/esm/prompt/prompt.type.d.mts.map +1 -0
  339. package/esm/prompts/index.d.mts +3 -0
  340. package/esm/prompts/index.mjs +3 -0
  341. package/esm/prompts/prompts-manager.contract.d.mts +154 -0
  342. package/esm/prompts/prompts-manager.contract.d.mts.map +1 -0
  343. package/esm/prompts/prompts-manager.d.mts +38 -0
  344. package/esm/prompts/prompts-manager.d.mts.map +1 -0
  345. package/esm/prompts/prompts-manager.mjs +410 -0
  346. package/esm/prompts/prompts-manager.mjs.map +1 -0
  347. package/esm/prompts/prompts-manager.type.d.mts +172 -0
  348. package/esm/prompts/prompts-manager.type.d.mts.map +1 -0
  349. package/esm/prompts/prompts-validate.mjs +200 -0
  350. package/esm/prompts/prompts-validate.mjs.map +1 -0
  351. package/esm/rag/as-tool.mjs +48 -0
  352. package/esm/rag/as-tool.mjs.map +1 -0
  353. package/esm/rag/chunk/chunk.d.mts +24 -0
  354. package/esm/rag/chunk/chunk.d.mts.map +1 -0
  355. package/esm/rag/chunk/chunk.mjs +44 -0
  356. package/esm/rag/chunk/chunk.mjs.map +1 -0
  357. package/esm/rag/chunk/fixed.mjs +32 -0
  358. package/esm/rag/chunk/fixed.mjs.map +1 -0
  359. package/esm/rag/chunk/markdown.mjs +75 -0
  360. package/esm/rag/chunk/markdown.mjs.map +1 -0
  361. package/esm/rag/chunk/recursive.mjs +132 -0
  362. package/esm/rag/chunk/recursive.mjs.map +1 -0
  363. package/esm/rag/chunk/sentence.mjs +73 -0
  364. package/esm/rag/chunk/sentence.mjs.map +1 -0
  365. package/esm/rag/contracts/chunk-options.type.d.mts +35 -0
  366. package/esm/rag/contracts/chunk-options.type.d.mts.map +1 -0
  367. package/esm/rag/contracts/citation.type.d.mts +35 -0
  368. package/esm/rag/contracts/citation.type.d.mts.map +1 -0
  369. package/esm/rag/contracts/index.d.mts +4 -0
  370. package/esm/rag/contracts/rag-config.type.d.mts +68 -0
  371. package/esm/rag/contracts/rag-config.type.d.mts.map +1 -0
  372. package/esm/rag/contracts/rag-document.type.d.mts +21 -0
  373. package/esm/rag/contracts/rag-document.type.d.mts.map +1 -0
  374. package/esm/rag/hybrid/bm25.d.mts +23 -0
  375. package/esm/rag/hybrid/bm25.d.mts.map +1 -0
  376. package/esm/rag/hybrid/bm25.mjs +51 -0
  377. package/esm/rag/hybrid/bm25.mjs.map +1 -0
  378. package/esm/rag/hybrid/hybrid-rank.d.mts +33 -0
  379. package/esm/rag/hybrid/hybrid-rank.d.mts.map +1 -0
  380. package/esm/rag/hybrid/hybrid-rank.mjs +29 -0
  381. package/esm/rag/hybrid/hybrid-rank.mjs.map +1 -0
  382. package/esm/rag/hybrid/rrf.d.mts +25 -0
  383. package/esm/rag/hybrid/rrf.d.mts.map +1 -0
  384. package/esm/rag/hybrid/rrf.mjs +30 -0
  385. package/esm/rag/hybrid/rrf.mjs.map +1 -0
  386. package/esm/rag/index.d.mts +22 -0
  387. package/esm/rag/index.mjs +18 -0
  388. package/esm/rag/loaders/errors.d.mts +19 -0
  389. package/esm/rag/loaders/errors.d.mts.map +1 -0
  390. package/esm/rag/loaders/errors.mjs +25 -0
  391. package/esm/rag/loaders/errors.mjs.map +1 -0
  392. package/esm/rag/loaders/index.mjs +7 -0
  393. package/esm/rag/loaders/load-html.d.mts +26 -0
  394. package/esm/rag/loaders/load-html.d.mts.map +1 -0
  395. package/esm/rag/loaders/load-html.mjs +138 -0
  396. package/esm/rag/loaders/load-html.mjs.map +1 -0
  397. package/esm/rag/loaders/load-pdf.d.mts +38 -0
  398. package/esm/rag/loaders/load-pdf.d.mts.map +1 -0
  399. package/esm/rag/loaders/load-pdf.mjs +150 -0
  400. package/esm/rag/loaders/load-pdf.mjs.map +1 -0
  401. package/esm/rag/loaders/load-text.d.mts +47 -0
  402. package/esm/rag/loaders/load-text.d.mts.map +1 -0
  403. package/esm/rag/loaders/load-text.mjs +60 -0
  404. package/esm/rag/loaders/load-text.mjs.map +1 -0
  405. package/esm/rag/loaders/load-web.d.mts +42 -0
  406. package/esm/rag/loaders/load-web.d.mts.map +1 -0
  407. package/esm/rag/loaders/load-web.mjs +89 -0
  408. package/esm/rag/loaders/load-web.mjs.map +1 -0
  409. package/esm/rag/loaders/loader.type.d.mts +89 -0
  410. package/esm/rag/loaders/loader.type.d.mts.map +1 -0
  411. package/esm/rag/rag.d.mts +38 -0
  412. package/esm/rag/rag.d.mts.map +1 -0
  413. package/esm/rag/rag.mjs +126 -0
  414. package/esm/rag/rag.mjs.map +1 -0
  415. package/esm/rag/rerank/keyword-reranker.d.mts +32 -0
  416. package/esm/rag/rerank/keyword-reranker.d.mts.map +1 -0
  417. package/esm/rag/rerank/keyword-reranker.mjs +58 -0
  418. package/esm/rag/rerank/keyword-reranker.mjs.map +1 -0
  419. package/esm/rag/rerank/llm-reranker.d.mts +36 -0
  420. package/esm/rag/rerank/llm-reranker.d.mts.map +1 -0
  421. package/esm/rag/rerank/llm-reranker.mjs +85 -0
  422. package/esm/rag/rerank/llm-reranker.mjs.map +1 -0
  423. package/esm/rag/rerank/reranker.contract.d.mts +28 -0
  424. package/esm/rag/rerank/reranker.contract.d.mts.map +1 -0
  425. package/esm/rag/retrieve.mjs +68 -0
  426. package/esm/rag/retrieve.mjs.map +1 -0
  427. package/esm/rag/store/cache-vector-store.d.mts +27 -0
  428. package/esm/rag/store/cache-vector-store.d.mts.map +1 -0
  429. package/esm/rag/store/cache-vector-store.mjs +48 -0
  430. package/esm/rag/store/cache-vector-store.mjs.map +1 -0
  431. package/esm/rag/store/pg-vector-store.d.mts +139 -0
  432. package/esm/rag/store/pg-vector-store.d.mts.map +1 -0
  433. package/esm/rag/store/pg-vector-store.mjs +328 -0
  434. package/esm/rag/store/pg-vector-store.mjs.map +1 -0
  435. package/esm/rag/store/vector-store.contract.d.mts +38 -0
  436. package/esm/rag/store/vector-store.contract.d.mts.map +1 -0
  437. package/esm/rag/transforms/multi-query.d.mts +27 -0
  438. package/esm/rag/transforms/multi-query.d.mts.map +1 -0
  439. package/esm/rag/transforms/multi-query.mjs +41 -0
  440. package/esm/rag/transforms/multi-query.mjs.map +1 -0
  441. package/esm/security/index.mjs +5 -0
  442. package/esm/security/outbound-policy.d.mts +46 -0
  443. package/esm/security/outbound-policy.d.mts.map +1 -0
  444. package/esm/security/outbound-policy.mjs +187 -0
  445. package/esm/security/outbound-policy.mjs.map +1 -0
  446. package/esm/security/outbound-policy.type.d.mts +74 -0
  447. package/esm/security/outbound-policy.type.d.mts.map +1 -0
  448. package/esm/security/private-ip.d.mts +15 -0
  449. package/esm/security/private-ip.d.mts.map +1 -0
  450. package/esm/security/private-ip.mjs +48 -0
  451. package/esm/security/private-ip.mjs.map +1 -0
  452. package/esm/security/redact.d.mts +59 -0
  453. package/esm/security/redact.d.mts.map +1 -0
  454. package/esm/security/redact.mjs +122 -0
  455. package/esm/security/redact.mjs.map +1 -0
  456. package/esm/serve/serve.d.mts +50 -0
  457. package/esm/serve/serve.d.mts.map +1 -0
  458. package/esm/serve/serve.mjs +90 -0
  459. package/esm/serve/serve.mjs.map +1 -0
  460. package/esm/serve/sse.d.mts +20 -0
  461. package/esm/serve/sse.d.mts.map +1 -0
  462. package/esm/serve/sse.mjs +25 -0
  463. package/esm/serve/sse.mjs.map +1 -0
  464. package/esm/serve/stream-to-sse.d.mts +29 -0
  465. package/esm/serve/stream-to-sse.d.mts.map +1 -0
  466. package/esm/serve/stream-to-sse.mjs +37 -0
  467. package/esm/serve/stream-to-sse.mjs.map +1 -0
  468. package/esm/skills/catalog.d.mts +49 -0
  469. package/esm/skills/catalog.d.mts.map +1 -0
  470. package/esm/skills/catalog.mjs +140 -0
  471. package/esm/skills/catalog.mjs.map +1 -0
  472. package/esm/skills/contracts/skill-record.type.d.mts +37 -0
  473. package/esm/skills/contracts/skill-record.type.d.mts.map +1 -0
  474. package/esm/skills/contracts/skills-config.type.d.mts +108 -0
  475. package/esm/skills/contracts/skills-config.type.d.mts.map +1 -0
  476. package/esm/skills/contracts/skills-store.contract.d.mts +28 -0
  477. package/esm/skills/contracts/skills-store.contract.d.mts.map +1 -0
  478. package/esm/skills/contracts/skills.contract.d.mts +43 -0
  479. package/esm/skills/contracts/skills.contract.d.mts.map +1 -0
  480. package/esm/skills/index.d.mts +16 -0
  481. package/esm/skills/index.mjs +14 -0
  482. package/esm/skills/load-skill-tool.d.mts +38 -0
  483. package/esm/skills/load-skill-tool.d.mts.map +1 -0
  484. package/esm/skills/load-skill-tool.mjs +65 -0
  485. package/esm/skills/load-skill-tool.mjs.map +1 -0
  486. package/esm/skills/review-gate.d.mts +33 -0
  487. package/esm/skills/review-gate.d.mts.map +1 -0
  488. package/esm/skills/review-gate.mjs +60 -0
  489. package/esm/skills/review-gate.mjs.map +1 -0
  490. package/esm/skills/save-skill-tool.d.mts +39 -0
  491. package/esm/skills/save-skill-tool.d.mts.map +1 -0
  492. package/esm/skills/save-skill-tool.mjs +65 -0
  493. package/esm/skills/save-skill-tool.mjs.map +1 -0
  494. package/esm/skills/skills.d.mts +33 -0
  495. package/esm/skills/skills.d.mts.map +1 -0
  496. package/esm/skills/skills.mjs +109 -0
  497. package/esm/skills/skills.mjs.map +1 -0
  498. package/esm/skills/sources/directory-source.d.mts +19 -0
  499. package/esm/skills/sources/directory-source.d.mts.map +1 -0
  500. package/esm/skills/sources/directory-source.mjs +108 -0
  501. package/esm/skills/sources/directory-source.mjs.map +1 -0
  502. package/esm/skills/sources/index.d.mts +18 -0
  503. package/esm/skills/sources/index.d.mts.map +1 -0
  504. package/esm/skills/sources/index.mjs +27 -0
  505. package/esm/skills/sources/index.mjs.map +1 -0
  506. package/esm/skills/sources/parse-frontmatter.d.mts +27 -0
  507. package/esm/skills/sources/parse-frontmatter.d.mts.map +1 -0
  508. package/esm/skills/sources/parse-frontmatter.mjs +46 -0
  509. package/esm/skills/sources/parse-frontmatter.mjs.map +1 -0
  510. package/esm/skills/sources/store-source.d.mts +14 -0
  511. package/esm/skills/sources/store-source.d.mts.map +1 -0
  512. package/esm/skills/sources/store-source.mjs +15 -0
  513. package/esm/skills/sources/store-source.mjs.map +1 -0
  514. package/esm/skills/sources/url-source.d.mts +29 -0
  515. package/esm/skills/sources/url-source.d.mts.map +1 -0
  516. package/esm/skills/sources/url-source.mjs +117 -0
  517. package/esm/skills/sources/url-source.mjs.map +1 -0
  518. package/esm/skills/store/mock-skills-store.d.mts +57 -0
  519. package/esm/skills/store/mock-skills-store.d.mts.map +1 -0
  520. package/esm/skills/store/mock-skills-store.mjs +100 -0
  521. package/esm/skills/store/mock-skills-store.mjs.map +1 -0
  522. package/esm/skills/store/procedural-skill-store.d.mts +30 -0
  523. package/esm/skills/store/procedural-skill-store.d.mts.map +1 -0
  524. package/esm/skills/store/procedural-skill-store.mjs +125 -0
  525. package/esm/skills/store/procedural-skill-store.mjs.map +1 -0
  526. package/esm/speech/index.mjs +3 -0
  527. package/esm/speech/speech.d.mts +65 -0
  528. package/esm/speech/speech.d.mts.map +1 -0
  529. package/esm/speech/speech.mjs +123 -0
  530. package/esm/speech/speech.mjs.map +1 -0
  531. package/esm/supervisor/as-tool.mjs +2 -2
  532. package/esm/supervisor/as-tool.mjs.map +1 -1
  533. package/esm/supervisor/entries.mjs +2 -2
  534. package/esm/supervisor/entries.mjs.map +1 -1
  535. package/esm/supervisor/execution.d.mts.map +1 -1
  536. package/esm/supervisor/execution.mjs +31 -28
  537. package/esm/supervisor/execution.mjs.map +1 -1
  538. package/esm/supervisor/supervisor.d.mts.map +1 -1
  539. package/esm/supervisor/supervisor.mjs +8 -3
  540. package/esm/supervisor/supervisor.mjs.map +1 -1
  541. package/esm/system-prompt/index.d.mts +4 -0
  542. package/esm/system-prompt/system-prompt.d.mts +68 -4
  543. package/esm/system-prompt/system-prompt.d.mts.map +1 -1
  544. package/esm/system-prompt/system-prompt.mjs +89 -5
  545. package/esm/system-prompt/system-prompt.mjs.map +1 -1
  546. package/esm/team/gates.mjs +48 -0
  547. package/esm/team/gates.mjs.map +1 -0
  548. package/esm/team/index.d.mts +1 -0
  549. package/esm/team/index.mjs +3 -0
  550. package/esm/team/team.d.mts +42 -0
  551. package/esm/team/team.d.mts.map +1 -0
  552. package/esm/team/team.mjs +94 -0
  553. package/esm/team/team.mjs.map +1 -0
  554. package/esm/tool/executable-as-tool.d.mts.map +1 -1
  555. package/esm/tool/executable-as-tool.mjs +2 -2
  556. package/esm/tool/executable-as-tool.mjs.map +1 -1
  557. package/esm/tool/tool.d.mts.map +1 -1
  558. package/esm/tool/tool.mjs +2 -2
  559. package/esm/tool/tool.mjs.map +1 -1
  560. package/esm/transcribe/audio-input.d.mts +47 -0
  561. package/esm/transcribe/audio-input.d.mts.map +1 -0
  562. package/esm/transcribe/audio-input.mjs +84 -0
  563. package/esm/transcribe/audio-input.mjs.map +1 -0
  564. package/esm/transcribe/index.mjs +4 -0
  565. package/esm/transcribe/transcribe.d.mts +64 -0
  566. package/esm/transcribe/transcribe.d.mts.map +1 -0
  567. package/esm/transcribe/transcribe.mjs +128 -0
  568. package/esm/transcribe/transcribe.mjs.map +1 -0
  569. package/esm/utils/compute-cost.d.mts +17 -1
  570. package/esm/utils/compute-cost.d.mts.map +1 -1
  571. package/esm/utils/compute-cost.mjs +26 -1
  572. package/esm/utils/compute-cost.mjs.map +1 -1
  573. package/esm/utils/extract-json-lenient.d.mts +42 -0
  574. package/esm/utils/extract-json-lenient.d.mts.map +1 -0
  575. package/esm/utils/extract-json-lenient.mjs +97 -0
  576. package/esm/utils/extract-json-lenient.mjs.map +1 -0
  577. package/esm/utils/index.d.mts +4 -2
  578. package/esm/utils/index.mjs +3 -1
  579. package/esm/utils/json-schema.d.mts +1 -1
  580. package/esm/utils/prepare-attachment-part.d.mts +10 -1
  581. package/esm/utils/prepare-attachment-part.d.mts.map +1 -1
  582. package/esm/utils/prepare-attachment-part.mjs +103 -11
  583. package/esm/utils/prepare-attachment-part.mjs.map +1 -1
  584. package/esm/utils/resolve-attachment.d.mts +4 -3
  585. package/esm/utils/resolve-attachment.d.mts.map +1 -1
  586. package/esm/utils/resolve-attachment.mjs +4 -3
  587. package/esm/utils/resolve-attachment.mjs.map +1 -1
  588. package/esm/utils/run-context.d.mts +94 -0
  589. package/esm/utils/run-context.d.mts.map +1 -0
  590. package/esm/utils/run-context.mjs +98 -0
  591. package/esm/utils/run-context.mjs.map +1 -0
  592. package/esm/vcr/cassette-io.mjs +57 -0
  593. package/esm/vcr/cassette-io.mjs.map +1 -0
  594. package/esm/vcr/errors.d.mts +42 -0
  595. package/esm/vcr/errors.d.mts.map +1 -0
  596. package/esm/vcr/errors.mjs +37 -0
  597. package/esm/vcr/errors.mjs.map +1 -0
  598. package/esm/vcr/hash-request.d.mts +28 -0
  599. package/esm/vcr/hash-request.d.mts.map +1 -0
  600. package/esm/vcr/hash-request.mjs +118 -0
  601. package/esm/vcr/hash-request.mjs.map +1 -0
  602. package/esm/vcr/index.d.mts +4 -0
  603. package/esm/vcr/index.mjs +5 -0
  604. package/esm/vcr/vcr.d.mts +32 -0
  605. package/esm/vcr/vcr.d.mts.map +1 -0
  606. package/esm/vcr/vcr.mjs +248 -0
  607. package/esm/vcr/vcr.mjs.map +1 -0
  608. package/esm/vcr/vcr.type.d.mts +118 -0
  609. package/esm/vcr/vcr.type.d.mts.map +1 -0
  610. package/esm/workflow/as-tool.mjs +2 -2
  611. package/esm/workflow/as-tool.mjs.map +1 -1
  612. package/esm/workflow/engine.mjs +1 -0
  613. package/esm/workflow/engine.mjs.map +1 -1
  614. package/esm/workflow/step-runner.mjs +19 -20
  615. package/esm/workflow/step-runner.mjs.map +1 -1
  616. package/esm/workflow/workflow.d.mts.map +1 -1
  617. package/esm/workflow/workflow.mjs +8 -3
  618. package/esm/workflow/workflow.mjs.map +1 -1
  619. package/llms-full.txt +2572 -204
  620. package/llms.txt +21 -4
  621. package/package.json +7 -3
  622. package/skills/README.md +44 -4
  623. package/skills/ai-dx-helpers/SKILL.md +2 -2
  624. package/skills/approve-tool-calls/SKILL.md +134 -0
  625. package/skills/attach-ai-middleware/SKILL.md +1 -1
  626. package/skills/detect-and-redact-pii/SKILL.md +104 -0
  627. package/skills/durable-agent-runs/SKILL.md +135 -0
  628. package/skills/durable-resume/SKILL.md +128 -0
  629. package/skills/escalate-block-to-human/SKILL.md +85 -0
  630. package/skills/eval-datasets-and-ci/SKILL.md +117 -0
  631. package/skills/generate-images/SKILL.md +138 -0
  632. package/skills/generate-speech/SKILL.md +139 -0
  633. package/skills/guard-input-output/SKILL.md +117 -0
  634. package/skills/manage-prompts/SKILL.md +186 -0
  635. package/skills/observe-ai-flows/SKILL.md +94 -0
  636. package/skills/rag-loaders-and-stores/SKILL.md +164 -0
  637. package/skills/record-replay-llm/SKILL.md +92 -0
  638. package/skills/run-ai-agent/SKILL.md +26 -1
  639. package/skills/run-ai-rag/SKILL.md +139 -0
  640. package/skills/run-ai-team/SKILL.md +107 -0
  641. package/skills/run-orchestrator/SKILL.md +2 -0
  642. package/skills/run-planner/SKILL.md +73 -8
  643. package/skills/run-supervisor/SKILL.md +20 -1
  644. package/skills/transcribe-audio/SKILL.md +157 -0
  645. package/skills/use-runtime-skills/SKILL.md +106 -0
  646. package/skills/write-system-prompt/SKILL.md +30 -1
  647. package/cjs/index.cjs.map +0 -1
  648. package/esm/contracts/result/index.d.mts +0 -15
@@ -0,0 +1,117 @@
1
+ import { fetchTextWithPolicy } from "../../security/outbound-policy.mjs";
2
+
3
+ //#region ../@warlock.js/ai/src/skills/sources/url-source.ts
4
+ /**
5
+ * Read skills from a remote JSON manifest at `url`. The manifest is a flat
6
+ * array of {@link SkillRecord}s (bodies inline).
7
+ *
8
+ * **Trust boundary (S3).** A remote skill source is a prompt supply chain —
9
+ * its bodies flow straight into model context — so the manifest fetch runs
10
+ * through the shared `OutboundPolicy` (scheme + host allowlist, post-DNS
11
+ * private-IP deny, max bytes, timeout) and **every record is runtime-
12
+ * validated** before it can be served. A malformed record fails loudly
13
+ * rather than being cast blindly into a `SkillRecord`.
14
+ *
15
+ * The request is made lazily on the first `list()` / `load()`. The result
16
+ * is cached for the source's lifetime, or for `cacheTtlMs` when set
17
+ * (a stale cache refetches on next access).
18
+ */
19
+ function urlSource(url, options = {}) {
20
+ const { headers, policy, cacheTtlMs } = options;
21
+ let cache;
22
+ let cachedAtMs;
23
+ const records = () => {
24
+ const expired = cacheTtlMs !== void 0 && cachedAtMs !== void 0 && Date.now() - cachedAtMs > cacheTtlMs;
25
+ if (!cache || expired) {
26
+ cachedAtMs = Date.now();
27
+ cache = fetchManifest(url, headers, policy);
28
+ }
29
+ return cache;
30
+ };
31
+ return {
32
+ async list(scope) {
33
+ const all = await records();
34
+ const wanted = scope?.tags;
35
+ return [...all.values()].filter((record) => record.type !== "candidate").filter((record) => intersects(record.tags, wanted)).map(toCatalogEntry);
36
+ },
37
+ async load(name, version) {
38
+ const record = (await records()).get(name);
39
+ if (!record || record.type === "candidate") return;
40
+ if (version !== void 0 && record.version !== version) return;
41
+ return record;
42
+ },
43
+ async saveCandidate() {
44
+ throw new Error("url source is read-only — saveCandidate requires a writable store (set `review.store`)");
45
+ },
46
+ async promote() {
47
+ throw new Error("url source is read-only — promote requires a writable store (set `review.store`)");
48
+ }
49
+ };
50
+ }
51
+ /** Fetch + validate + parse the manifest once into a name → record map. */
52
+ async function fetchManifest(url, headers, policy) {
53
+ const result = await fetchTextWithPolicy(url, policy ?? {}, headers ? { headers } : void 0);
54
+ if (!result.ok) throw new Error(`url skill source failed: ${result.status} ${result.statusText} for ${url}`);
55
+ let parsed;
56
+ try {
57
+ parsed = JSON.parse(result.text);
58
+ } catch (cause) {
59
+ throw new Error(`url skill source returned invalid JSON from ${url}`, { cause });
60
+ }
61
+ if (!Array.isArray(parsed)) throw new Error(`url skill source at ${url} must return a JSON array of skill records`);
62
+ const records = /* @__PURE__ */ new Map();
63
+ parsed.forEach((raw, index) => {
64
+ const record = validateManifestRecord(raw, url, index);
65
+ records.set(record.name, record);
66
+ });
67
+ return records;
68
+ }
69
+ /**
70
+ * Runtime-validate one manifest record before it is trusted as a
71
+ * {@link SkillRecord}. Untyped remote JSON cast blindly into the context
72
+ * is both an injection surface and a correctness bug; this rejects a
73
+ * record missing the required `name` / `description` / `body` strings, and
74
+ * fills `version` / `type` defaults for a thin record.
75
+ */
76
+ function validateManifestRecord(raw, url, index) {
77
+ if (!raw || typeof raw !== "object") throw new Error(`url skill source at ${url}: record #${index} is not an object`);
78
+ const r = raw;
79
+ const requireString = (field) => {
80
+ const value = r[field];
81
+ if (typeof value !== "string" || value.length === 0) throw new Error(`url skill source at ${url}: record #${index} is missing a string "${field}"`);
82
+ return value;
83
+ };
84
+ const name = requireString("name");
85
+ const description = requireString("description");
86
+ const body = requireString("body");
87
+ const type = r.type === "authored" || r.type === "promoted" || r.type === "candidate" ? r.type : "authored";
88
+ return {
89
+ name,
90
+ description,
91
+ body,
92
+ version: typeof r.version === "number" ? r.version : 1,
93
+ type,
94
+ tags: Array.isArray(r.tags) ? r.tags.filter((t) => typeof t === "string") : void 0,
95
+ metadata: r.metadata && typeof r.metadata === "object" ? r.metadata : void 0
96
+ };
97
+ }
98
+ /** Project a full record down to its catalog entry (body omitted). */
99
+ function toCatalogEntry(record) {
100
+ return {
101
+ name: record.name,
102
+ description: record.description,
103
+ version: record.version,
104
+ tags: record.tags,
105
+ type: record.type
106
+ };
107
+ }
108
+ /** True when no filter is requested or the record shares a requested tag. */
109
+ function intersects(recordTags, wanted) {
110
+ if (!wanted || wanted.length === 0) return true;
111
+ if (!recordTags || recordTags.length === 0) return false;
112
+ return recordTags.some((tag) => wanted.includes(tag));
113
+ }
114
+
115
+ //#endregion
116
+ export { urlSource };
117
+ //# sourceMappingURL=url-source.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url-source.mjs","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/skills/sources/url-source.ts"],"sourcesContent":["import { fetchTextWithPolicy } from \"../../security/outbound-policy\";\nimport type { OutboundPolicy } from \"../../security/outbound-policy.type\";\nimport type {\n SkillCatalogEntry,\n SkillRecord,\n} from \"../contracts/skill-record.type\";\nimport type { SkillsStoreContract } from \"../contracts/skills-store.contract\";\n\n/**\n * The JSON manifest shape a `url` source fetches — a flat array of skill\n * records. Bodies travel inline; the catalog projection drops them so the\n * always-injected metadata block stays cheap.\n */\ntype SkillManifest = SkillRecord[];\n\n/** Options for {@link urlSource} (S3). */\nexport type UrlSourceOptions = {\n headers?: Record<string, string>;\n /** Fetch hardening for the manifest request. */\n policy?: OutboundPolicy;\n /** Cache the manifest for this many ms; omit to cache for the source's lifetime. */\n cacheTtlMs?: number;\n};\n\n/**\n * Read skills from a remote JSON manifest at `url`. The manifest is a flat\n * array of {@link SkillRecord}s (bodies inline).\n *\n * **Trust boundary (S3).** A remote skill source is a prompt supply chain —\n * its bodies flow straight into model context — so the manifest fetch runs\n * through the shared `OutboundPolicy` (scheme + host allowlist, post-DNS\n * private-IP deny, max bytes, timeout) and **every record is runtime-\n * validated** before it can be served. A malformed record fails loudly\n * rather than being cast blindly into a `SkillRecord`.\n *\n * The request is made lazily on the first `list()` / `load()`. The result\n * is cached for the source's lifetime, or for `cacheTtlMs` when set\n * (a stale cache refetches on next access).\n */\nexport function urlSource(\n url: string,\n options: UrlSourceOptions = {},\n): SkillsStoreContract {\n const { headers, policy, cacheTtlMs } = options;\n\n let cache: Promise<Map<string, SkillRecord>> | undefined;\n let cachedAtMs: number | undefined;\n\n const records = (): Promise<Map<string, SkillRecord>> => {\n const expired =\n cacheTtlMs !== undefined &&\n cachedAtMs !== undefined &&\n Date.now() - cachedAtMs > cacheTtlMs;\n\n if (!cache || expired) {\n cachedAtMs = Date.now();\n cache = fetchManifest(url, headers, policy);\n }\n\n return cache;\n };\n\n return {\n async list(scope?: { tags?: string[] }): Promise<SkillCatalogEntry[]> {\n const all = await records();\n const wanted = scope?.tags;\n\n return [...all.values()]\n .filter(record => record.type !== \"candidate\")\n .filter(record => intersects(record.tags, wanted))\n .map(toCatalogEntry);\n },\n async load(name: string, version?: number): Promise<SkillRecord | undefined> {\n const all = await records();\n const record = all.get(name);\n\n if (!record || record.type === \"candidate\") {\n return undefined;\n }\n\n if (version !== undefined && record.version !== version) {\n return undefined;\n }\n\n return record;\n },\n async saveCandidate(): Promise<SkillRecord> {\n throw new Error(\n \"url source is read-only — saveCandidate requires a writable store (set `review.store`)\",\n );\n },\n async promote(): Promise<SkillRecord> {\n throw new Error(\n \"url source is read-only — promote requires a writable store (set `review.store`)\",\n );\n },\n };\n}\n\n/** Fetch + validate + parse the manifest once into a name → record map. */\nasync function fetchManifest(\n url: string,\n headers: Record<string, string> | undefined,\n policy: OutboundPolicy | undefined,\n): Promise<Map<string, SkillRecord>> {\n const result = await fetchTextWithPolicy(\n url,\n policy ?? {},\n headers ? { headers } : undefined,\n );\n\n if (!result.ok) {\n throw new Error(\n `url skill source failed: ${result.status} ${result.statusText} for ${url}`,\n );\n }\n\n let parsed: unknown;\n try {\n parsed = JSON.parse(result.text);\n } catch (cause) {\n throw new Error(`url skill source returned invalid JSON from ${url}`, {\n cause,\n });\n }\n\n if (!Array.isArray(parsed)) {\n throw new Error(\n `url skill source at ${url} must return a JSON array of skill records`,\n );\n }\n\n const records = new Map<string, SkillRecord>();\n\n (parsed as SkillManifest).forEach((raw, index) => {\n const record = validateManifestRecord(raw, url, index);\n records.set(record.name, record);\n });\n\n return records;\n}\n\n/**\n * Runtime-validate one manifest record before it is trusted as a\n * {@link SkillRecord}. Untyped remote JSON cast blindly into the context\n * is both an injection surface and a correctness bug; this rejects a\n * record missing the required `name` / `description` / `body` strings, and\n * fills `version` / `type` defaults for a thin record.\n */\nfunction validateManifestRecord(\n raw: unknown,\n url: string,\n index: number,\n): SkillRecord {\n if (!raw || typeof raw !== \"object\") {\n throw new Error(`url skill source at ${url}: record #${index} is not an object`);\n }\n\n const r = raw as Record<string, unknown>;\n const requireString = (field: string): string => {\n const value = r[field];\n if (typeof value !== \"string\" || value.length === 0) {\n throw new Error(\n `url skill source at ${url}: record #${index} is missing a string \"${field}\"`,\n );\n }\n return value;\n };\n\n const name = requireString(\"name\");\n const description = requireString(\"description\");\n const body = requireString(\"body\");\n\n const type =\n r.type === \"authored\" || r.type === \"promoted\" || r.type === \"candidate\"\n ? r.type\n : \"authored\";\n const version = typeof r.version === \"number\" ? r.version : 1;\n const tags = Array.isArray(r.tags)\n ? r.tags.filter((t): t is string => typeof t === \"string\")\n : undefined;\n const metadata =\n r.metadata && typeof r.metadata === \"object\"\n ? (r.metadata as Record<string, unknown>)\n : undefined;\n\n return { name, description, body, version, type, tags, metadata };\n}\n\n/** Project a full record down to its catalog entry (body omitted). */\nfunction toCatalogEntry(record: SkillRecord): SkillCatalogEntry {\n return {\n name: record.name,\n description: record.description,\n version: record.version,\n tags: record.tags,\n type: record.type,\n };\n}\n\n/** True when no filter is requested or the record shares a requested tag. */\nfunction intersects(recordTags: string[] | undefined, wanted: string[] | undefined): boolean {\n if (!wanted || wanted.length === 0) {\n return true;\n }\n\n if (!recordTags || recordTags.length === 0) {\n return false;\n }\n\n return recordTags.some(tag => wanted.includes(tag));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAuCA,SAAgB,UACd,KACA,UAA4B,CAAC,GACR;CACrB,MAAM,EAAE,SAAS,QAAQ,eAAe;CAExC,IAAI;CACJ,IAAI;CAEJ,MAAM,gBAAmD;EACvD,MAAM,UACJ,eAAe,UACf,eAAe,UACf,KAAK,IAAI,IAAI,aAAa;EAE5B,IAAI,CAAC,SAAS,SAAS;GACrB,aAAa,KAAK,IAAI;GACtB,QAAQ,cAAc,KAAK,SAAS,MAAM;EAC5C;EAEA,OAAO;CACT;CAEA,OAAO;EACL,MAAM,KAAK,OAA2D;GACpE,MAAM,MAAM,MAAM,QAAQ;GAC1B,MAAM,SAAS,OAAO;GAEtB,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,CAAC,CACrB,QAAO,WAAU,OAAO,SAAS,WAAW,CAAC,CAC7C,QAAO,WAAU,WAAW,OAAO,MAAM,MAAM,CAAC,CAAC,CACjD,IAAI,cAAc;EACvB;EACA,MAAM,KAAK,MAAc,SAAoD;GAE3E,MAAM,UAAS,MADG,QAAQ,EACR,CAAC,IAAI,IAAI;GAE3B,IAAI,CAAC,UAAU,OAAO,SAAS,aAC7B;GAGF,IAAI,YAAY,UAAa,OAAO,YAAY,SAC9C;GAGF,OAAO;EACT;EACA,MAAM,gBAAsC;GAC1C,MAAM,IAAI,MACR,wFACF;EACF;EACA,MAAM,UAAgC;GACpC,MAAM,IAAI,MACR,kFACF;EACF;CACF;AACF;;AAGA,eAAe,cACb,KACA,SACA,QACmC;CACnC,MAAM,SAAS,MAAM,oBACnB,KACA,UAAU,CAAC,GACX,UAAU,EAAE,QAAQ,IAAI,MAC1B;CAEA,IAAI,CAAC,OAAO,IACV,MAAM,IAAI,MACR,4BAA4B,OAAO,OAAO,GAAG,OAAO,WAAW,OAAO,KACxE;CAGF,IAAI;CACJ,IAAI;EACF,SAAS,KAAK,MAAM,OAAO,IAAI;CACjC,SAAS,OAAO;EACd,MAAM,IAAI,MAAM,+CAA+C,OAAO,EACpE,MACF,CAAC;CACH;CAEA,IAAI,CAAC,MAAM,QAAQ,MAAM,GACvB,MAAM,IAAI,MACR,uBAAuB,IAAI,2CAC7B;CAGF,MAAM,0BAAU,IAAI,IAAyB;CAE7C,AAAC,OAAyB,SAAS,KAAK,UAAU;EAChD,MAAM,SAAS,uBAAuB,KAAK,KAAK,KAAK;EACrD,QAAQ,IAAI,OAAO,MAAM,MAAM;CACjC,CAAC;CAED,OAAO;AACT;;;;;;;;AASA,SAAS,uBACP,KACA,KACA,OACa;CACb,IAAI,CAAC,OAAO,OAAO,QAAQ,UACzB,MAAM,IAAI,MAAM,uBAAuB,IAAI,YAAY,MAAM,kBAAkB;CAGjF,MAAM,IAAI;CACV,MAAM,iBAAiB,UAA0B;EAC/C,MAAM,QAAQ,EAAE;EAChB,IAAI,OAAO,UAAU,YAAY,MAAM,WAAW,GAChD,MAAM,IAAI,MACR,uBAAuB,IAAI,YAAY,MAAM,wBAAwB,MAAM,EAC7E;EAEF,OAAO;CACT;CAEA,MAAM,OAAO,cAAc,MAAM;CACjC,MAAM,cAAc,cAAc,aAAa;CAC/C,MAAM,OAAO,cAAc,MAAM;CAEjC,MAAM,OACJ,EAAE,SAAS,cAAc,EAAE,SAAS,cAAc,EAAE,SAAS,cACzD,EAAE,OACF;CAUN,OAAO;EAAE;EAAM;EAAa;EAAM,SATlB,OAAO,EAAE,YAAY,WAAW,EAAE,UAAU;EASjB;EAAM,MARpC,MAAM,QAAQ,EAAE,IAAI,IAC7B,EAAE,KAAK,QAAQ,MAAmB,OAAO,MAAM,QAAQ,IACvD;EAMmD,UAJrD,EAAE,YAAY,OAAO,EAAE,aAAa,WAC/B,EAAE,WACH;CAE0D;AAClE;;AAGA,SAAS,eAAe,QAAwC;CAC9D,OAAO;EACL,MAAM,OAAO;EACb,aAAa,OAAO;EACpB,SAAS,OAAO;EAChB,MAAM,OAAO;EACb,MAAM,OAAO;CACf;AACF;;AAGA,SAAS,WAAW,YAAkC,QAAuC;CAC3F,IAAI,CAAC,UAAU,OAAO,WAAW,GAC/B,OAAO;CAGT,IAAI,CAAC,cAAc,WAAW,WAAW,GACvC,OAAO;CAGT,OAAO,WAAW,MAAK,QAAO,OAAO,SAAS,GAAG,CAAC;AACpD"}
@@ -0,0 +1,57 @@
1
+ import { SkillCatalogEntry, SkillRecord } from "../contracts/skill-record.type.mjs";
2
+ import { SkillsStoreContract } from "../contracts/skills-store.contract.mjs";
3
+
4
+ //#region ../@warlock.js/ai/src/skills/store/mock-skills-store.d.ts
5
+ /**
6
+ * In-memory {@link SkillsStoreContract} that ships with the package.
7
+ *
8
+ * Backs tests and small/ephemeral skill libraries with zero external
9
+ * dependencies. Holds the **latest** record per skill name; `saveCandidate`
10
+ * writes an INERT `type: "candidate"` (never injectable until promoted),
11
+ * and `promote` flips it to `type: "promoted"` with a monotonic
12
+ * `version + 1`.
13
+ *
14
+ * Construct via `new MockSkillsStore([...records])` — it is a concrete
15
+ * test/utility store, not a factory-fronted runtime primitive, so `new`
16
+ * is the public surface here.
17
+ *
18
+ * @example
19
+ * const store = new MockSkillsStore([
20
+ * { name: "scaffold", description: "Scaffold a form", version: 1, body: "...", type: "authored" },
21
+ * ]);
22
+ * const lib = skills({ name: "build", sources: [{ type: "store", store }] });
23
+ */
24
+ declare class MockSkillsStore implements SkillsStoreContract {
25
+ /** Latest record per skill name. */
26
+ private readonly records;
27
+ constructor(seed?: SkillRecord[]);
28
+ /**
29
+ * List the cheap catalog metadata for every NON-candidate skill,
30
+ * optionally filtered to those whose `tags` intersect `scope.tags`.
31
+ * Candidates are filtered out — they can never be catalogued or injected.
32
+ */
33
+ list(scope?: {
34
+ tags?: string[];
35
+ }): Promise<SkillCatalogEntry[]>;
36
+ /**
37
+ * Load the full record for `name`. When `version` is given, returns the
38
+ * record only if its version matches (pin); otherwise the latest. A
39
+ * `candidate` is never returned here — it is inert until promoted.
40
+ */
41
+ load(name: string, version?: number): Promise<SkillRecord | undefined>;
42
+ /**
43
+ * Write an INERT candidate (`type: "candidate"`, `version: 0`). A
44
+ * candidate is filtered out of `list()` / `load()` — it can never be
45
+ * injected until a `review` gate promotes it.
46
+ */
47
+ saveCandidate(record: Omit<SkillRecord, "version" | "type">): Promise<SkillRecord>;
48
+ /**
49
+ * Promote the stored candidate for `name` to a new monotonic version
50
+ * (`type: "promoted"`, `version + 1`). Throws when there is no candidate
51
+ * to promote — promotion of a non-existent skill is a programming error.
52
+ */
53
+ promote(name: string): Promise<SkillRecord>;
54
+ }
55
+ //#endregion
56
+ export { MockSkillsStore };
57
+ //# sourceMappingURL=mock-skills-store.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-skills-store.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/skills/store/mock-skills-store.ts"],"mappings":";;;;;;AAyBA;;;;;;;;;;;;;;;;;cAAa,eAAA,YAA2B,mBAAA;EAErB;EAAA,iBAAA,OAAA;cAEE,IAAA,GAAM,WAAA;EAAN;;;;;EAWN,IAAA,CAAK,KAAA;IAAU,IAAA;EAAA,IAAoB,OAAA,CAAQ,iBAAA;EAcxB;;;;;EAAnB,IAAA,CAAK,IAAA,UAAc,OAAA,YAAmB,OAAA,CAAQ,WAAA;EAoBzD;;;;;EADW,aAAA,CACX,MAAA,EAAQ,IAAA,CAAK,WAAA,wBACZ,OAAA,CAAQ,WAAA;EAiBiC;;AAAW;;;EAA1C,OAAA,CAAQ,IAAA,WAAe,OAAA,CAAQ,WAAA;AAAA"}
@@ -0,0 +1,100 @@
1
+ //#region ../@warlock.js/ai/src/skills/store/mock-skills-store.ts
2
+ /**
3
+ * In-memory {@link SkillsStoreContract} that ships with the package.
4
+ *
5
+ * Backs tests and small/ephemeral skill libraries with zero external
6
+ * dependencies. Holds the **latest** record per skill name; `saveCandidate`
7
+ * writes an INERT `type: "candidate"` (never injectable until promoted),
8
+ * and `promote` flips it to `type: "promoted"` with a monotonic
9
+ * `version + 1`.
10
+ *
11
+ * Construct via `new MockSkillsStore([...records])` — it is a concrete
12
+ * test/utility store, not a factory-fronted runtime primitive, so `new`
13
+ * is the public surface here.
14
+ *
15
+ * @example
16
+ * const store = new MockSkillsStore([
17
+ * { name: "scaffold", description: "Scaffold a form", version: 1, body: "...", type: "authored" },
18
+ * ]);
19
+ * const lib = skills({ name: "build", sources: [{ type: "store", store }] });
20
+ */
21
+ var MockSkillsStore = class {
22
+ constructor(seed = []) {
23
+ this.records = /* @__PURE__ */ new Map();
24
+ for (const record of seed) this.records.set(record.name, { ...record });
25
+ }
26
+ /**
27
+ * List the cheap catalog metadata for every NON-candidate skill,
28
+ * optionally filtered to those whose `tags` intersect `scope.tags`.
29
+ * Candidates are filtered out — they can never be catalogued or injected.
30
+ */
31
+ async list(scope) {
32
+ const wanted = scope?.tags;
33
+ return [...this.records.values()].filter((record) => record.type !== "candidate").filter((record) => intersects(record.tags, wanted)).map(toCatalogEntry);
34
+ }
35
+ /**
36
+ * Load the full record for `name`. When `version` is given, returns the
37
+ * record only if its version matches (pin); otherwise the latest. A
38
+ * `candidate` is never returned here — it is inert until promoted.
39
+ */
40
+ async load(name, version) {
41
+ const record = this.records.get(name);
42
+ if (!record || record.type === "candidate") return;
43
+ if (version !== void 0 && record.version !== version) return;
44
+ return { ...record };
45
+ }
46
+ /**
47
+ * Write an INERT candidate (`type: "candidate"`, `version: 0`). A
48
+ * candidate is filtered out of `list()` / `load()` — it can never be
49
+ * injected until a `review` gate promotes it.
50
+ */
51
+ async saveCandidate(record) {
52
+ const candidate = {
53
+ ...record,
54
+ version: 0,
55
+ type: "candidate"
56
+ };
57
+ this.records.set(candidate.name, candidate);
58
+ return { ...candidate };
59
+ }
60
+ /**
61
+ * Promote the stored candidate for `name` to a new monotonic version
62
+ * (`type: "promoted"`, `version + 1`). Throws when there is no candidate
63
+ * to promote — promotion of a non-existent skill is a programming error.
64
+ */
65
+ async promote(name) {
66
+ const existing = this.records.get(name);
67
+ if (!existing) throw new Error(`MockSkillsStore.promote: no skill named "${name}" to promote`);
68
+ const promoted = {
69
+ ...existing,
70
+ version: existing.version + 1,
71
+ type: "promoted"
72
+ };
73
+ this.records.set(name, promoted);
74
+ return { ...promoted };
75
+ }
76
+ };
77
+ /** Project a full record down to its catalog entry (body omitted). */
78
+ function toCatalogEntry(record) {
79
+ return {
80
+ name: record.name,
81
+ description: record.description,
82
+ version: record.version,
83
+ tags: record.tags,
84
+ type: record.type
85
+ };
86
+ }
87
+ /**
88
+ * True when no filter tags are requested, or when the record carries at
89
+ * least one of the requested tags. A tagless record matches only the
90
+ * unfiltered case.
91
+ */
92
+ function intersects(recordTags, wanted) {
93
+ if (!wanted || wanted.length === 0) return true;
94
+ if (!recordTags || recordTags.length === 0) return false;
95
+ return recordTags.some((tag) => wanted.includes(tag));
96
+ }
97
+
98
+ //#endregion
99
+ export { MockSkillsStore };
100
+ //# sourceMappingURL=mock-skills-store.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-skills-store.mjs","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/skills/store/mock-skills-store.ts"],"sourcesContent":["import type {\n SkillCatalogEntry,\n SkillRecord,\n} from \"../contracts/skill-record.type\";\nimport type { SkillsStoreContract } from \"../contracts/skills-store.contract\";\n\n/**\n * In-memory {@link SkillsStoreContract} that ships with the package.\n *\n * Backs tests and small/ephemeral skill libraries with zero external\n * dependencies. Holds the **latest** record per skill name; `saveCandidate`\n * writes an INERT `type: \"candidate\"` (never injectable until promoted),\n * and `promote` flips it to `type: \"promoted\"` with a monotonic\n * `version + 1`.\n *\n * Construct via `new MockSkillsStore([...records])` — it is a concrete\n * test/utility store, not a factory-fronted runtime primitive, so `new`\n * is the public surface here.\n *\n * @example\n * const store = new MockSkillsStore([\n * { name: \"scaffold\", description: \"Scaffold a form\", version: 1, body: \"...\", type: \"authored\" },\n * ]);\n * const lib = skills({ name: \"build\", sources: [{ type: \"store\", store }] });\n */\nexport class MockSkillsStore implements SkillsStoreContract {\n /** Latest record per skill name. */\n private readonly records = new Map<string, SkillRecord>();\n\n public constructor(seed: SkillRecord[] = []) {\n for (const record of seed) {\n this.records.set(record.name, { ...record });\n }\n }\n\n /**\n * List the cheap catalog metadata for every NON-candidate skill,\n * optionally filtered to those whose `tags` intersect `scope.tags`.\n * Candidates are filtered out — they can never be catalogued or injected.\n */\n public async list(scope?: { tags?: string[] }): Promise<SkillCatalogEntry[]> {\n const wanted = scope?.tags;\n\n return [...this.records.values()]\n .filter((record) => record.type !== \"candidate\")\n .filter((record) => intersects(record.tags, wanted))\n .map(toCatalogEntry);\n }\n\n /**\n * Load the full record for `name`. When `version` is given, returns the\n * record only if its version matches (pin); otherwise the latest. A\n * `candidate` is never returned here — it is inert until promoted.\n */\n public async load(name: string, version?: number): Promise<SkillRecord | undefined> {\n const record = this.records.get(name);\n\n if (!record || record.type === \"candidate\") {\n return undefined;\n }\n\n if (version !== undefined && record.version !== version) {\n return undefined;\n }\n\n return { ...record };\n }\n\n /**\n * Write an INERT candidate (`type: \"candidate\"`, `version: 0`). A\n * candidate is filtered out of `list()` / `load()` — it can never be\n * injected until a `review` gate promotes it.\n */\n public async saveCandidate(\n record: Omit<SkillRecord, \"version\" | \"type\">,\n ): Promise<SkillRecord> {\n const candidate: SkillRecord = {\n ...record,\n version: 0,\n type: \"candidate\",\n };\n\n this.records.set(candidate.name, candidate);\n\n return { ...candidate };\n }\n\n /**\n * Promote the stored candidate for `name` to a new monotonic version\n * (`type: \"promoted\"`, `version + 1`). Throws when there is no candidate\n * to promote — promotion of a non-existent skill is a programming error.\n */\n public async promote(name: string): Promise<SkillRecord> {\n const existing = this.records.get(name);\n\n if (!existing) {\n throw new Error(`MockSkillsStore.promote: no skill named \"${name}\" to promote`);\n }\n\n const promoted: SkillRecord = {\n ...existing,\n version: existing.version + 1,\n type: \"promoted\",\n };\n\n this.records.set(name, promoted);\n\n return { ...promoted };\n }\n}\n\n/** Project a full record down to its catalog entry (body omitted). */\nfunction toCatalogEntry(record: SkillRecord): SkillCatalogEntry {\n return {\n name: record.name,\n description: record.description,\n version: record.version,\n tags: record.tags,\n type: record.type,\n };\n}\n\n/**\n * True when no filter tags are requested, or when the record carries at\n * least one of the requested tags. A tagless record matches only the\n * unfiltered case.\n */\nfunction intersects(recordTags: string[] | undefined, wanted: string[] | undefined): boolean {\n if (!wanted || wanted.length === 0) {\n return true;\n }\n\n if (!recordTags || recordTags.length === 0) {\n return false;\n }\n\n return recordTags.some((tag) => wanted.includes(tag));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyBA,IAAa,kBAAb,MAA4D;CAI1D,AAAO,YAAY,OAAsB,CAAC,GAAG;iCAFlB,IAAI,IAAyB;EAGtD,KAAK,MAAM,UAAU,MACnB,KAAK,QAAQ,IAAI,OAAO,MAAM,EAAE,GAAG,OAAO,CAAC;CAE/C;;;;;;CAOA,MAAa,KAAK,OAA2D;EAC3E,MAAM,SAAS,OAAO;EAEtB,OAAO,CAAC,GAAG,KAAK,QAAQ,OAAO,CAAC,CAAC,CAC9B,QAAQ,WAAW,OAAO,SAAS,WAAW,CAAC,CAC/C,QAAQ,WAAW,WAAW,OAAO,MAAM,MAAM,CAAC,CAAC,CACnD,IAAI,cAAc;CACvB;;;;;;CAOA,MAAa,KAAK,MAAc,SAAoD;EAClF,MAAM,SAAS,KAAK,QAAQ,IAAI,IAAI;EAEpC,IAAI,CAAC,UAAU,OAAO,SAAS,aAC7B;EAGF,IAAI,YAAY,UAAa,OAAO,YAAY,SAC9C;EAGF,OAAO,EAAE,GAAG,OAAO;CACrB;;;;;;CAOA,MAAa,cACX,QACsB;EACtB,MAAM,YAAyB;GAC7B,GAAG;GACH,SAAS;GACT,MAAM;EACR;EAEA,KAAK,QAAQ,IAAI,UAAU,MAAM,SAAS;EAE1C,OAAO,EAAE,GAAG,UAAU;CACxB;;;;;;CAOA,MAAa,QAAQ,MAAoC;EACvD,MAAM,WAAW,KAAK,QAAQ,IAAI,IAAI;EAEtC,IAAI,CAAC,UACH,MAAM,IAAI,MAAM,4CAA4C,KAAK,aAAa;EAGhF,MAAM,WAAwB;GAC5B,GAAG;GACH,SAAS,SAAS,UAAU;GAC5B,MAAM;EACR;EAEA,KAAK,QAAQ,IAAI,MAAM,QAAQ;EAE/B,OAAO,EAAE,GAAG,SAAS;CACvB;AACF;;AAGA,SAAS,eAAe,QAAwC;CAC9D,OAAO;EACL,MAAM,OAAO;EACb,aAAa,OAAO;EACpB,SAAS,OAAO;EAChB,MAAM,OAAO;EACb,MAAM,OAAO;CACf;AACF;;;;;;AAOA,SAAS,WAAW,YAAkC,QAAuC;CAC3F,IAAI,CAAC,UAAU,OAAO,WAAW,GAC/B,OAAO;CAGT,IAAI,CAAC,cAAc,WAAW,WAAW,GACvC,OAAO;CAGT,OAAO,WAAW,MAAM,QAAQ,OAAO,SAAS,GAAG,CAAC;AACtD"}
@@ -0,0 +1,30 @@
1
+ import { ProceduralMemoryConfig } from "../../contracts/memory/memory-config.type.mjs";
2
+ import { SkillsStoreContract } from "../contracts/skills-store.contract.mjs";
3
+
4
+ //#region ../@warlock.js/ai/src/skills/store/procedural-skill-store.d.ts
5
+ /**
6
+ * {@link SkillsStoreContract} backed by the procedural memory tier
7
+ * (`ai.memory({ procedural })`). **The unification** the design calls for:
8
+ * "promote a proven procedural memory to a named skill" and "save a
9
+ * self-authored skill" are the SAME machinery — one store, two entry
10
+ * points. No fifth `MemoryTier` is added; the existing `"procedural"` tier
11
+ * is reused verbatim.
12
+ *
13
+ * - `saveCandidate` ⇒ `memory.remember({ tier: "procedural", metadata: { type: "candidate" } })`.
14
+ * - `promote` ⇒ re-remembers the same id with `type: "promoted"` and
15
+ * `version + 1`, which the procedural tier reinforces (increments `uses`).
16
+ * - `list` / `load` map `memory.recall(..., { tier: "procedural" })` ⇒
17
+ * `RecalledMemory[]` ⇒ `SkillCatalogEntry[]` / `SkillRecord`, filtering
18
+ * out inert candidates so they can never be catalogued or injected.
19
+ *
20
+ * @example
21
+ * const store = proceduralSkillStore({ embedder, store: cacheDriver });
22
+ * const lib = skills({ name: "learned", sources: [{ type: "store", store }], review: gate });
23
+ */
24
+ declare function proceduralSkillStore(config: ProceduralMemoryConfig & {
25
+ name?: string;
26
+ recallQuery?: string;
27
+ }): SkillsStoreContract;
28
+ //#endregion
29
+ export { proceduralSkillStore };
30
+ //# sourceMappingURL=procedural-skill-store.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"procedural-skill-store.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/skills/store/procedural-skill-store.ts"],"mappings":";;;;;;AAsDA;;;;;;;;;;AAEsB;;;;;;;iBAFN,oBAAA,CACd,MAAA,EAAQ,sBAAA;EAA2B,IAAA;EAAe,WAAA;AAAA,IACjD,mBAAmB"}
@@ -0,0 +1,125 @@
1
+ import { memory } from "../../memory/memory.mjs";
2
+
3
+ //#region ../@warlock.js/ai/src/skills/store/procedural-skill-store.ts
4
+ const RECALL_K = 1e3;
5
+ /**
6
+ * {@link SkillsStoreContract} backed by the procedural memory tier
7
+ * (`ai.memory({ procedural })`). **The unification** the design calls for:
8
+ * "promote a proven procedural memory to a named skill" and "save a
9
+ * self-authored skill" are the SAME machinery — one store, two entry
10
+ * points. No fifth `MemoryTier` is added; the existing `"procedural"` tier
11
+ * is reused verbatim.
12
+ *
13
+ * - `saveCandidate` ⇒ `memory.remember({ tier: "procedural", metadata: { type: "candidate" } })`.
14
+ * - `promote` ⇒ re-remembers the same id with `type: "promoted"` and
15
+ * `version + 1`, which the procedural tier reinforces (increments `uses`).
16
+ * - `list` / `load` map `memory.recall(..., { tier: "procedural" })` ⇒
17
+ * `RecalledMemory[]` ⇒ `SkillCatalogEntry[]` / `SkillRecord`, filtering
18
+ * out inert candidates so they can never be catalogued or injected.
19
+ *
20
+ * @example
21
+ * const store = proceduralSkillStore({ embedder, store: cacheDriver });
22
+ * const lib = skills({ name: "learned", sources: [{ type: "store", store }], review: gate });
23
+ */
24
+ function proceduralSkillStore(config) {
25
+ const store = memory({
26
+ name: config.name ?? "skills.procedural",
27
+ working: false,
28
+ defaultTier: "procedural",
29
+ procedural: {
30
+ embedder: config.embedder,
31
+ store: config.store,
32
+ namespace: config.namespace,
33
+ reinforcementWeight: config.reinforcementWeight
34
+ }
35
+ });
36
+ const recallQuery = config.recallQuery ?? "skill procedure how-to";
37
+ const recallAll = async () => {
38
+ return (await store.recall(recallQuery, {
39
+ tier: "procedural",
40
+ k: RECALL_K,
41
+ threshold: 0
42
+ })).map((hit) => ({
43
+ body: hit.text,
44
+ meta: hit.metadata
45
+ })).filter((entry) => Boolean(entry.meta?.skill));
46
+ };
47
+ return {
48
+ async list(scope) {
49
+ const all = await recallAll();
50
+ const wanted = scope?.tags;
51
+ return all.filter((entry) => entry.meta.type !== "candidate").filter((entry) => intersects(entry.meta.tags, wanted)).map((entry) => toCatalogEntry(entry.meta));
52
+ },
53
+ async load(name, version) {
54
+ const match = (await recallAll()).find((entry) => entry.meta.name === name);
55
+ if (!match || match.meta.type === "candidate") return;
56
+ if (version !== void 0 && match.meta.version !== version) return;
57
+ return toRecord(match.body, match.meta);
58
+ },
59
+ async saveCandidate(record) {
60
+ const meta = {
61
+ skill: true,
62
+ name: record.name,
63
+ type: "candidate",
64
+ description: record.description,
65
+ version: 0,
66
+ tags: record.tags
67
+ };
68
+ await store.remember({
69
+ id: record.name,
70
+ text: record.body,
71
+ tier: "procedural",
72
+ metadata: meta
73
+ });
74
+ return {
75
+ ...record,
76
+ version: 0,
77
+ type: "candidate"
78
+ };
79
+ },
80
+ async promote(name) {
81
+ const match = (await recallAll()).find((entry) => entry.meta.name === name);
82
+ if (!match) throw new Error(`proceduralSkillStore.promote: no skill named "${name}" to promote`);
83
+ const meta = {
84
+ ...match.meta,
85
+ type: "promoted",
86
+ version: match.meta.version + 1
87
+ };
88
+ await store.remember({
89
+ id: name,
90
+ text: match.body,
91
+ tier: "procedural",
92
+ metadata: meta
93
+ });
94
+ return toRecord(match.body, meta);
95
+ }
96
+ };
97
+ }
98
+ function toCatalogEntry(meta) {
99
+ return {
100
+ name: meta.name,
101
+ description: meta.description,
102
+ version: meta.version,
103
+ tags: meta.tags,
104
+ type: meta.type
105
+ };
106
+ }
107
+ function toRecord(body, meta) {
108
+ return {
109
+ name: meta.name,
110
+ description: meta.description,
111
+ version: meta.version,
112
+ body,
113
+ tags: meta.tags,
114
+ type: meta.type
115
+ };
116
+ }
117
+ function intersects(recordTags, wanted) {
118
+ if (!wanted || wanted.length === 0) return true;
119
+ if (!recordTags || recordTags.length === 0) return false;
120
+ return recordTags.some((tag) => wanted.includes(tag));
121
+ }
122
+
123
+ //#endregion
124
+ export { proceduralSkillStore };
125
+ //# sourceMappingURL=procedural-skill-store.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"procedural-skill-store.mjs","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/skills/store/procedural-skill-store.ts"],"sourcesContent":["import type { MemoryContract } from \"../../contracts/memory/memory.contract\";\nimport type { ProceduralMemoryConfig } from \"../../contracts/memory/memory-config.type\";\nimport { memory } from \"../../memory\";\nimport type {\n SkillCatalogEntry,\n SkillRecord,\n} from \"../contracts/skill-record.type\";\nimport type { SkillsStoreContract } from \"../contracts/skills-store.contract\";\n\n/**\n * Metadata a procedural memory carries to round-trip a skill. `recall()`\n * surfaces `metadata` verbatim, so the skill's identity (name, version,\n * provenance, description, tags) rides here while the procedure body lives\n * in the memory's `text`.\n */\ntype ProceduralSkillMeta = {\n /** Marks the record as a skill (vs. a plain procedure) so `list` can scope. */\n skill: true;\n /** Skill name — the catalog key (also the memory `id`). */\n name: string;\n /** Provenance flag round-tripped onto the SkillRecord. */\n type: \"candidate\" | \"promoted\";\n /** Catalog line. */\n description: string;\n /** Monotonic version — bumped on promote. */\n version: number;\n /** Optional scope tags. */\n tags?: string[];\n};\n\n/** A recalled skill entry — the procedure body plus its skill metadata. */\ntype ProceduralSkillEntry = { body: string; meta: ProceduralSkillMeta };\n\nconst RECALL_K = 1000;\n\n/**\n * {@link SkillsStoreContract} backed by the procedural memory tier\n * (`ai.memory({ procedural })`). **The unification** the design calls for:\n * \"promote a proven procedural memory to a named skill\" and \"save a\n * self-authored skill\" are the SAME machinery — one store, two entry\n * points. No fifth `MemoryTier` is added; the existing `\"procedural\"` tier\n * is reused verbatim.\n *\n * - `saveCandidate` ⇒ `memory.remember({ tier: \"procedural\", metadata: { type: \"candidate\" } })`.\n * - `promote` ⇒ re-remembers the same id with `type: \"promoted\"` and\n * `version + 1`, which the procedural tier reinforces (increments `uses`).\n * - `list` / `load` map `memory.recall(..., { tier: \"procedural\" })` ⇒\n * `RecalledMemory[]` ⇒ `SkillCatalogEntry[]` / `SkillRecord`, filtering\n * out inert candidates so they can never be catalogued or injected.\n *\n * @example\n * const store = proceduralSkillStore({ embedder, store: cacheDriver });\n * const lib = skills({ name: \"learned\", sources: [{ type: \"store\", store }], review: gate });\n */\nexport function proceduralSkillStore(\n config: ProceduralMemoryConfig & { name?: string; recallQuery?: string },\n): SkillsStoreContract {\n const store: MemoryContract = memory({\n name: config.name ?? \"skills.procedural\",\n working: false,\n defaultTier: \"procedural\",\n procedural: {\n embedder: config.embedder,\n store: config.store,\n namespace: config.namespace,\n reinforcementWeight: config.reinforcementWeight,\n },\n });\n\n // The procedural tier recalls by similarity to a query; for a full\n // catalog listing we recall against a broad seed with a large `k` and a\n // zero floor so every stored skill comes back.\n const recallQuery = config.recallQuery ?? \"skill procedure how-to\";\n\n const recallAll = async (): Promise<ProceduralSkillEntry[]> => {\n const hits = await store.recall(recallQuery, {\n tier: \"procedural\",\n k: RECALL_K,\n threshold: 0,\n });\n\n return hits\n .map((hit) => ({ body: hit.text, meta: hit.metadata as ProceduralSkillMeta | undefined }))\n .filter((entry): entry is ProceduralSkillEntry => Boolean(entry.meta?.skill));\n };\n\n return {\n async list(scope?: { tags?: string[] }): Promise<SkillCatalogEntry[]> {\n const all = await recallAll();\n const wanted = scope?.tags;\n\n return all\n .filter((entry) => entry.meta.type !== \"candidate\")\n .filter((entry) => intersects(entry.meta.tags, wanted))\n .map((entry) => toCatalogEntry(entry.meta));\n },\n async load(name: string, version?: number): Promise<SkillRecord | undefined> {\n const all = await recallAll();\n const match = all.find((entry) => entry.meta.name === name);\n\n if (!match || match.meta.type === \"candidate\") {\n return undefined;\n }\n\n if (version !== undefined && match.meta.version !== version) {\n return undefined;\n }\n\n return toRecord(match.body, match.meta);\n },\n async saveCandidate(record: Omit<SkillRecord, \"version\" | \"type\">): Promise<SkillRecord> {\n const meta: ProceduralSkillMeta = {\n skill: true,\n name: record.name,\n type: \"candidate\",\n description: record.description,\n version: 0,\n tags: record.tags,\n };\n\n await store.remember({\n id: record.name,\n text: record.body,\n tier: \"procedural\",\n metadata: meta,\n });\n\n return { ...record, version: 0, type: \"candidate\" };\n },\n async promote(name: string): Promise<SkillRecord> {\n const all = await recallAll();\n const match = all.find((entry) => entry.meta.name === name);\n\n if (!match) {\n throw new Error(`proceduralSkillStore.promote: no skill named \"${name}\" to promote`);\n }\n\n const meta: ProceduralSkillMeta = {\n ...match.meta,\n type: \"promoted\",\n version: match.meta.version + 1,\n };\n\n // Re-remembering the same id reinforces (uses++) AND flips the\n // metadata — the procedural tier's reinforcement IS the promotion.\n await store.remember({\n id: name,\n text: match.body,\n tier: \"procedural\",\n metadata: meta,\n });\n\n return toRecord(match.body, meta);\n },\n };\n}\n\nfunction toCatalogEntry(meta: ProceduralSkillMeta): SkillCatalogEntry {\n return {\n name: meta.name,\n description: meta.description,\n version: meta.version,\n tags: meta.tags,\n type: meta.type,\n };\n}\n\nfunction toRecord(body: string, meta: ProceduralSkillMeta): SkillRecord {\n return {\n name: meta.name,\n description: meta.description,\n version: meta.version,\n body,\n tags: meta.tags,\n type: meta.type,\n };\n}\n\nfunction intersects(recordTags: string[] | undefined, wanted: string[] | undefined): boolean {\n if (!wanted || wanted.length === 0) {\n return true;\n }\n\n if (!recordTags || recordTags.length === 0) {\n return false;\n }\n\n return recordTags.some((tag) => wanted.includes(tag));\n}\n"],"mappings":";;;AAiCA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;AAqBjB,SAAgB,qBACd,QACqB;CACrB,MAAM,QAAwB,OAAO;EACnC,MAAM,OAAO,QAAQ;EACrB,SAAS;EACT,aAAa;EACb,YAAY;GACV,UAAU,OAAO;GACjB,OAAO,OAAO;GACd,WAAW,OAAO;GAClB,qBAAqB,OAAO;EAC9B;CACF,CAAC;CAKD,MAAM,cAAc,OAAO,eAAe;CAE1C,MAAM,YAAY,YAA6C;EAO7D,QAAO,MANY,MAAM,OAAO,aAAa;GAC3C,MAAM;GACN,GAAG;GACH,WAAW;EACb,CAAC,EAEU,CACR,KAAK,SAAS;GAAE,MAAM,IAAI;GAAM,MAAM,IAAI;EAA4C,EAAE,CAAC,CACzF,QAAQ,UAAyC,QAAQ,MAAM,MAAM,KAAK,CAAC;CAChF;CAEA,OAAO;EACL,MAAM,KAAK,OAA2D;GACpE,MAAM,MAAM,MAAM,UAAU;GAC5B,MAAM,SAAS,OAAO;GAEtB,OAAO,IACJ,QAAQ,UAAU,MAAM,KAAK,SAAS,WAAW,CAAC,CAClD,QAAQ,UAAU,WAAW,MAAM,KAAK,MAAM,MAAM,CAAC,CAAC,CACtD,KAAK,UAAU,eAAe,MAAM,IAAI,CAAC;EAC9C;EACA,MAAM,KAAK,MAAc,SAAoD;GAE3E,MAAM,SAAQ,MADI,UAAU,EACX,CAAC,MAAM,UAAU,MAAM,KAAK,SAAS,IAAI;GAE1D,IAAI,CAAC,SAAS,MAAM,KAAK,SAAS,aAChC;GAGF,IAAI,YAAY,UAAa,MAAM,KAAK,YAAY,SAClD;GAGF,OAAO,SAAS,MAAM,MAAM,MAAM,IAAI;EACxC;EACA,MAAM,cAAc,QAAqE;GACvF,MAAM,OAA4B;IAChC,OAAO;IACP,MAAM,OAAO;IACb,MAAM;IACN,aAAa,OAAO;IACpB,SAAS;IACT,MAAM,OAAO;GACf;GAEA,MAAM,MAAM,SAAS;IACnB,IAAI,OAAO;IACX,MAAM,OAAO;IACb,MAAM;IACN,UAAU;GACZ,CAAC;GAED,OAAO;IAAE,GAAG;IAAQ,SAAS;IAAG,MAAM;GAAY;EACpD;EACA,MAAM,QAAQ,MAAoC;GAEhD,MAAM,SAAQ,MADI,UAAU,EACX,CAAC,MAAM,UAAU,MAAM,KAAK,SAAS,IAAI;GAE1D,IAAI,CAAC,OACH,MAAM,IAAI,MAAM,iDAAiD,KAAK,aAAa;GAGrF,MAAM,OAA4B;IAChC,GAAG,MAAM;IACT,MAAM;IACN,SAAS,MAAM,KAAK,UAAU;GAChC;GAIA,MAAM,MAAM,SAAS;IACnB,IAAI;IACJ,MAAM,MAAM;IACZ,MAAM;IACN,UAAU;GACZ,CAAC;GAED,OAAO,SAAS,MAAM,MAAM,IAAI;EAClC;CACF;AACF;AAEA,SAAS,eAAe,MAA8C;CACpE,OAAO;EACL,MAAM,KAAK;EACX,aAAa,KAAK;EAClB,SAAS,KAAK;EACd,MAAM,KAAK;EACX,MAAM,KAAK;CACb;AACF;AAEA,SAAS,SAAS,MAAc,MAAwC;CACtE,OAAO;EACL,MAAM,KAAK;EACX,aAAa,KAAK;EAClB,SAAS,KAAK;EACd;EACA,MAAM,KAAK;EACX,MAAM,KAAK;CACb;AACF;AAEA,SAAS,WAAW,YAAkC,QAAuC;CAC3F,IAAI,CAAC,UAAU,OAAO,WAAW,GAC/B,OAAO;CAGT,IAAI,CAAC,cAAc,WAAW,WAAW,GACvC,OAAO;CAGT,OAAO,WAAW,MAAM,QAAQ,OAAO,SAAS,GAAG,CAAC;AACtD"}
@@ -0,0 +1,3 @@
1
+ import { speech } from "./speech.mjs";
2
+
3
+ export { };
@@ -0,0 +1,65 @@
1
+ import { BaseReport } from "../contracts/result/base-report.type.mjs";
2
+ import { ExecuteResult } from "../contracts/result/execute-result.type.mjs";
3
+ import { FlowObserveOption } from "../observe/resolve-observers.mjs";
4
+ import { GeneratedAudio, SpeechModelContract } from "../contracts/speech-model.contract.mjs";
5
+
6
+ //#region ../@warlock.js/ai/src/speech/speech.d.ts
7
+ /** Parameters for {@link speech}. `model` comes from `sdk.speech({ name })`. */
8
+ type SpeechParams = {
9
+ /** The TTS model to synthesize with. */model: SpeechModelContract; /** The text to speak. */
10
+ text: string; /** Voice id/name; overrides the model's default voice. */
11
+ voice?: string; /** Output container (`"mp3"` / `"opus"` / `"aac"` / `"flac"` / `"wav"` / `"pcm"`). */
12
+ format?: string; /** Playback speed multiplier. */
13
+ speed?: number; /** Extra tone/delivery steering (model-dependent). */
14
+ instructions?: string; /** Cancellation handle. */
15
+ signal?: AbortSignal; /** Observability routing — same `observe` seam as agents. */
16
+ observe?: FlowObserveOption; /** Groups this call into a session for flat cost/trace queries. */
17
+ sessionId?: string; /** Report node name (defaults to `"speech"`). */
18
+ name?: string; /** Provider-specific options forwarded verbatim to the adapter. */
19
+ options?: Record<string, unknown>;
20
+ };
21
+ /** Success payload of a {@link speech} run. */
22
+ type SpeechData = {
23
+ /** The synthesized audio, normalized to the discriminated shape. */audio: GeneratedAudio;
24
+ };
25
+ /** The report node a {@link speech} run produces (`type: "speech"`). */
26
+ type SpeechReport = BaseReport & {
27
+ type: "speech"; /** Identity of the TTS model this run used. */
28
+ model: {
29
+ name: string;
30
+ provider: string;
31
+ }; /** Number of input characters synthesized (0 on failure). */
32
+ characters: number;
33
+ };
34
+ /** Result envelope of {@link speech} — the uniform `{ data, error, usage, report }`. */
35
+ type SpeechResult = ExecuteResult<SpeechData> & {
36
+ type: "speech";
37
+ report: SpeechReport;
38
+ };
39
+ /**
40
+ * Synthesize speech from text — the text-to-speech verb of the
41
+ * output-modality track (Theme I), sibling to `ai.image()`. Wraps a
42
+ * {@link SpeechModelContract} (from `openai.speech(...)`) in the
43
+ * framework's uniform result contract:
44
+ *
45
+ * - **Never throws.** Provider failures surface as a typed `AIError` on
46
+ * `result.error`; `result.data` is then `undefined`.
47
+ * - **Cost-truth.** `result.usage.cost` is filled per-character
48
+ * (`tts-1`) or per-token (`gpt-4o-mini-tts`), folding into the same
49
+ * `Usage.cost` rollup as text.
50
+ * - **Observable.** The completed {@link SpeechReport} routes to any
51
+ * registered `Observer` (panoptic, OTel, …) via the `observe` seam.
52
+ *
53
+ * @example
54
+ * const openai = new OpenAISDK({ apiKey });
55
+ * const { data, error } = await ai.speech({
56
+ * model: openai.speech({ name: "tts-1", voice: "alloy" }),
57
+ * text: "Your order has shipped.",
58
+ * format: "mp3",
59
+ * });
60
+ * if (!error) await fs.writeFile("ship.mp3", Buffer.from(data.audio.base64, "base64"));
61
+ */
62
+ declare function speech(params: SpeechParams): Promise<SpeechResult>;
63
+ //#endregion
64
+ export { SpeechData, SpeechParams, SpeechReport, SpeechResult, speech };
65
+ //# sourceMappingURL=speech.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"speech.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/speech/speech.ts"],"mappings":";;;;;;;KAmBY,YAAA;EAAA,wCAEV,KAAA,EAAO,mBAAA;EAEP,IAAA,UAUS;EART,KAAA,WAgBU;EAdV,MAAA,WAcgB;EAZhB,KAAA,WARO;EAUP,YAAA,WANA;EAQA,MAAA,GAAS,WAAA,EAJT;EAMA,OAAA,GAAU,iBAAA,EAFV;EAIA,SAAA,WAFA;EAIA,IAAA,WAFA;EAIA,OAAA,GAAU,MAAA;AAAA;;KAIA,UAAA;EAJM,oEAMhB,KAAA,EAAO,cAAc;AAAA;;KAIX,YAAA,GAAe,UAAU;EACnC,IAAA,YADU;EAGV,KAAA;IAAS,IAAA;IAAc,QAAA;EAAA,GAFvB;EAIA,UAAA;AAAA;;KAIU,YAAA,GAAe,aAAA,CAAc,UAAA;EACvC,IAAA;EACA,MAAA,EAAQ,YAAA;AAAA;;;;;;;;;;;;;;AAAY;AA0BtB;;;;;;;;;iBAAsB,MAAA,CAAO,MAAA,EAAQ,YAAA,GAAe,OAAA,CAAQ,YAAA"}