@warlock.js/ai 4.3.0 → 4.5.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 (541) hide show
  1. package/CHANGELOG.md +52 -48
  2. package/cjs/index.cjs +221 -14144
  3. package/cjs/src-C02yzsLs.cjs +22991 -0
  4. package/cjs/src-C02yzsLs.cjs.map +1 -0
  5. package/cjs/src-DFibP2FQ.cjs +30 -0
  6. package/esm/agent/agent-config.type.d.mts +90 -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 +203 -30
  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/ai-openai/src/embedder.mjs +4 -0
  21. package/esm/ai-openai/src/index.mjs +4 -0
  22. package/esm/ai-openai/src/model.mjs +5 -0
  23. package/esm/ai-openai/src/sdk.mjs +6 -0
  24. package/esm/ai-openai/src/utils/index.mjs +4 -0
  25. package/esm/ai-openai/src/utils/to-openai-tools.mjs +3 -0
  26. package/esm/ai-openai/src/utils/wrap-openai-error.mjs +4 -0
  27. package/esm/ai.d.mts +119 -53
  28. package/esm/ai.d.mts.map +1 -1
  29. package/esm/ai.mjs +43 -8
  30. package/esm/ai.mjs.map +1 -1
  31. package/esm/batch/batch.d.mts.map +1 -1
  32. package/esm/batch/batch.mjs +21 -1
  33. package/esm/batch/batch.mjs.map +1 -1
  34. package/esm/batch/batch.type.d.mts +11 -4
  35. package/esm/batch/batch.type.d.mts.map +1 -1
  36. package/esm/config.d.mts +39 -3
  37. package/esm/config.d.mts.map +1 -1
  38. package/esm/config.mjs +26 -2
  39. package/esm/config.mjs.map +1 -1
  40. package/esm/contracts/agent/agent-options.type.d.mts +11 -3
  41. package/esm/contracts/agent/agent-options.type.d.mts.map +1 -1
  42. package/esm/contracts/agent/eval.type.d.mts +43 -2
  43. package/esm/contracts/agent/eval.type.d.mts.map +1 -1
  44. package/esm/contracts/attachment-policy.type.d.mts +51 -0
  45. package/esm/contracts/attachment-policy.type.d.mts.map +1 -0
  46. package/esm/contracts/attachment.type.d.mts +16 -7
  47. package/esm/contracts/attachment.type.d.mts.map +1 -1
  48. package/esm/contracts/content-part.type.d.mts +14 -5
  49. package/esm/contracts/content-part.type.d.mts.map +1 -1
  50. package/esm/contracts/events/supervisor-events.type.d.mts.map +1 -1
  51. package/esm/contracts/index.d.mts +6 -4
  52. package/esm/contracts/model.contract.d.mts +11 -8
  53. package/esm/contracts/model.contract.d.mts.map +1 -1
  54. package/esm/contracts/orchestrator/index.d.mts +1 -0
  55. package/esm/contracts/orchestrator/orchestrator-config.type.d.mts +31 -2
  56. package/esm/contracts/orchestrator/orchestrator-config.type.d.mts.map +1 -1
  57. package/esm/contracts/orchestrator/session-lock.contract.d.mts +47 -0
  58. package/esm/contracts/orchestrator/session-lock.contract.d.mts.map +1 -0
  59. package/esm/contracts/planner/index.d.mts +1 -1
  60. package/esm/contracts/planner/planner-config.type.d.mts +31 -0
  61. package/esm/contracts/planner/planner-config.type.d.mts.map +1 -1
  62. package/esm/contracts/planner/planner-execute-options.type.d.mts +48 -1
  63. package/esm/contracts/planner/planner-execute-options.type.d.mts.map +1 -1
  64. package/esm/contracts/planner/planner-result.type.d.mts +19 -5
  65. package/esm/contracts/planner/planner-result.type.d.mts.map +1 -1
  66. package/esm/contracts/planner/planner.contract.d.mts +1 -1
  67. package/esm/contracts/result/agent-result.type.d.mts +6 -4
  68. package/esm/contracts/result/agent-result.type.d.mts.map +1 -1
  69. package/esm/contracts/result/base-report.type.d.mts +21 -3
  70. package/esm/contracts/result/base-report.type.d.mts.map +1 -1
  71. package/esm/contracts/result/base-report.type.mjs.map +1 -1
  72. package/esm/contracts/result/execution-report.type.d.mts +53 -1
  73. package/esm/contracts/result/execution-report.type.d.mts.map +1 -1
  74. package/esm/contracts/result/orchestrator-result.type.d.mts +15 -11
  75. package/esm/contracts/result/orchestrator-result.type.d.mts.map +1 -1
  76. package/esm/contracts/result/supervisor-result.type.d.mts +13 -1
  77. package/esm/contracts/result/supervisor-result.type.d.mts.map +1 -1
  78. package/esm/contracts/result/tool-call.type.d.mts +2 -2
  79. package/esm/contracts/result/tool-call.type.d.mts.map +1 -1
  80. package/esm/contracts/result/workflow-result.type.d.mts +1 -0
  81. package/esm/contracts/result/workflow-result.type.d.mts.map +1 -1
  82. package/esm/contracts/supervisor/supervisor-config.type.d.mts +29 -0
  83. package/esm/contracts/supervisor/supervisor-config.type.d.mts.map +1 -1
  84. package/esm/contracts/system-prompt.contract.d.mts +103 -1
  85. package/esm/contracts/system-prompt.contract.d.mts.map +1 -1
  86. package/esm/contracts/team/index.d.mts +1 -0
  87. package/esm/contracts/team/team-config.type.d.mts +127 -0
  88. package/esm/contracts/team/team-config.type.d.mts.map +1 -0
  89. package/esm/contracts/tool.contract.d.mts +4 -2
  90. package/esm/contracts/tool.contract.d.mts.map +1 -1
  91. package/esm/contracts/workflow/step.contract.d.mts +30 -5
  92. package/esm/contracts/workflow/step.contract.d.mts.map +1 -1
  93. package/esm/contracts/workflow/workflow.contract.d.mts +16 -0
  94. package/esm/contracts/workflow/workflow.contract.d.mts.map +1 -1
  95. package/esm/errors/error-code.type.d.mts +1 -1
  96. package/esm/errors/index.d.mts +1 -0
  97. package/esm/errors/index.mjs +1 -0
  98. package/esm/errors/outbound-policy-error.d.mts +27 -0
  99. package/esm/errors/outbound-policy-error.d.mts.map +1 -0
  100. package/esm/errors/outbound-policy-error.mjs +32 -0
  101. package/esm/errors/outbound-policy-error.mjs.map +1 -0
  102. package/esm/eval/dataset.d.mts +28 -0
  103. package/esm/eval/dataset.d.mts.map +1 -0
  104. package/esm/eval/dataset.mjs +112 -0
  105. package/esm/eval/dataset.mjs.map +1 -0
  106. package/esm/eval/dataset.type.d.mts +53 -0
  107. package/esm/eval/dataset.type.d.mts.map +1 -0
  108. package/esm/eval/eval-runner.d.mts.map +1 -1
  109. package/esm/eval/eval-runner.mjs +16 -2
  110. package/esm/eval/eval-runner.mjs.map +1 -1
  111. package/esm/eval/index.d.mts +20 -1
  112. package/esm/eval/index.d.mts.map +1 -1
  113. package/esm/eval/index.mjs +20 -2
  114. package/esm/eval/index.mjs.map +1 -1
  115. package/esm/eval/regression.d.mts +30 -0
  116. package/esm/eval/regression.d.mts.map +1 -0
  117. package/esm/eval/regression.mjs +51 -0
  118. package/esm/eval/regression.mjs.map +1 -0
  119. package/esm/eval/report-json.d.mts +30 -0
  120. package/esm/eval/report-json.d.mts.map +1 -0
  121. package/esm/eval/report-json.mjs +33 -0
  122. package/esm/eval/report-json.mjs.map +1 -0
  123. package/esm/eval/report-junit.d.mts +22 -0
  124. package/esm/eval/report-junit.d.mts.map +1 -0
  125. package/esm/eval/report-junit.mjs +60 -0
  126. package/esm/eval/report-junit.mjs.map +1 -0
  127. package/esm/guard/contracts/guard-options.type.d.mts +165 -0
  128. package/esm/guard/contracts/guard-options.type.d.mts.map +1 -0
  129. package/esm/guard/contracts/guardrail.contract.d.mts +78 -0
  130. package/esm/guard/contracts/guardrail.contract.d.mts.map +1 -0
  131. package/esm/guard/contracts/index.d.mts +4 -0
  132. package/esm/guard/contracts/openai-client.contract.d.mts +51 -0
  133. package/esm/guard/contracts/openai-client.contract.d.mts.map +1 -0
  134. package/esm/guard/contracts/verdict.type.d.mts +76 -0
  135. package/esm/guard/contracts/verdict.type.d.mts.map +1 -0
  136. package/esm/guard/detectors/index.d.mts +4 -0
  137. package/esm/guard/detectors/index.mjs +6 -0
  138. package/esm/guard/detectors/injection.d.mts +34 -0
  139. package/esm/guard/detectors/injection.d.mts.map +1 -0
  140. package/esm/guard/detectors/injection.mjs +254 -0
  141. package/esm/guard/detectors/injection.mjs.map +1 -0
  142. package/esm/guard/detectors/moderation.d.mts +32 -0
  143. package/esm/guard/detectors/moderation.d.mts.map +1 -0
  144. package/esm/guard/detectors/moderation.mjs +134 -0
  145. package/esm/guard/detectors/moderation.mjs.map +1 -0
  146. package/esm/guard/detectors/pii.d.mts +41 -0
  147. package/esm/guard/detectors/pii.d.mts.map +1 -0
  148. package/esm/guard/detectors/pii.mjs +199 -0
  149. package/esm/guard/detectors/pii.mjs.map +1 -0
  150. package/esm/guard/detectors/topic.d.mts +29 -0
  151. package/esm/guard/detectors/topic.d.mts.map +1 -0
  152. package/esm/guard/detectors/topic.mjs +99 -0
  153. package/esm/guard/detectors/topic.mjs.map +1 -0
  154. package/esm/guard/errors.d.mts +12 -0
  155. package/esm/guard/errors.d.mts.map +1 -0
  156. package/esm/guard/errors.mjs +18 -0
  157. package/esm/guard/errors.mjs.map +1 -0
  158. package/esm/guard/guard.d.mts +67 -0
  159. package/esm/guard/guard.d.mts.map +1 -0
  160. package/esm/guard/guard.mjs +209 -0
  161. package/esm/guard/guard.mjs.map +1 -0
  162. package/esm/guard/guardrail.d.mts +39 -0
  163. package/esm/guard/guardrail.d.mts.map +1 -0
  164. package/esm/guard/guardrail.mjs +22 -0
  165. package/esm/guard/guardrail.mjs.map +1 -0
  166. package/esm/human/contracts/approval.type.d.mts +154 -0
  167. package/esm/human/contracts/approval.type.d.mts.map +1 -0
  168. package/esm/human/contracts/human-approval.type.d.mts +38 -0
  169. package/esm/human/contracts/human-approval.type.d.mts.map +1 -0
  170. package/esm/human/contracts/index.d.mts +4 -0
  171. package/esm/human/contracts/interrupt-store.contract.d.mts +112 -0
  172. package/esm/human/contracts/interrupt-store.contract.d.mts.map +1 -0
  173. package/esm/human/contracts/resume.type.d.mts +77 -0
  174. package/esm/human/contracts/resume.type.d.mts.map +1 -0
  175. package/esm/human/errors.d.mts +84 -0
  176. package/esm/human/errors.d.mts.map +1 -0
  177. package/esm/human/errors.mjs +60 -0
  178. package/esm/human/errors.mjs.map +1 -0
  179. package/esm/human/human-approval.d.mts +57 -0
  180. package/esm/human/human-approval.d.mts.map +1 -0
  181. package/esm/human/human-approval.mjs +170 -0
  182. package/esm/human/human-approval.mjs.map +1 -0
  183. package/esm/human/policy.d.mts +55 -0
  184. package/esm/human/policy.d.mts.map +1 -0
  185. package/esm/human/policy.mjs +67 -0
  186. package/esm/human/policy.mjs.map +1 -0
  187. package/esm/human/register.mjs +37 -0
  188. package/esm/human/register.mjs.map +1 -0
  189. package/esm/human/resume-seed.mjs +53 -0
  190. package/esm/human/resume-seed.mjs.map +1 -0
  191. package/esm/human/resume.d.mts +54 -0
  192. package/esm/human/resume.d.mts.map +1 -0
  193. package/esm/human/resume.mjs +121 -0
  194. package/esm/human/resume.mjs.map +1 -0
  195. package/esm/human/stores/index.mjs +5 -0
  196. package/esm/human/stores/memory.d.mts +30 -0
  197. package/esm/human/stores/memory.d.mts.map +1 -0
  198. package/esm/human/stores/memory.mjs +91 -0
  199. package/esm/human/stores/memory.mjs.map +1 -0
  200. package/esm/human/stores/pg.d.mts +59 -0
  201. package/esm/human/stores/pg.d.mts.map +1 -0
  202. package/esm/human/stores/pg.mjs +220 -0
  203. package/esm/human/stores/pg.mjs.map +1 -0
  204. package/esm/human/stores/redis.d.mts +56 -0
  205. package/esm/human/stores/redis.d.mts.map +1 -0
  206. package/esm/human/stores/redis.mjs +201 -0
  207. package/esm/human/stores/redis.mjs.map +1 -0
  208. package/esm/index.d.mts +113 -22
  209. package/esm/index.mjs +82 -11
  210. package/esm/middleware/builtins/budget.mjs +6 -2
  211. package/esm/middleware/builtins/budget.mjs.map +1 -1
  212. package/esm/middleware/utils/extract-user-text.d.mts +8 -1
  213. package/esm/middleware/utils/extract-user-text.d.mts.map +1 -1
  214. package/esm/middleware/utils/extract-user-text.mjs +8 -1
  215. package/esm/middleware/utils/extract-user-text.mjs.map +1 -1
  216. package/esm/object-stream/index.d.mts +2 -0
  217. package/esm/object-stream/index.mjs +4 -0
  218. package/esm/object-stream/parse-partial-json.d.mts +22 -0
  219. package/esm/object-stream/parse-partial-json.d.mts.map +1 -0
  220. package/esm/object-stream/parse-partial-json.mjs +78 -0
  221. package/esm/object-stream/parse-partial-json.mjs.map +1 -0
  222. package/esm/object-stream/stream-object.d.mts +68 -0
  223. package/esm/object-stream/stream-object.d.mts.map +1 -0
  224. package/esm/object-stream/stream-object.mjs +104 -0
  225. package/esm/object-stream/stream-object.mjs.map +1 -0
  226. package/esm/observe/index.mjs +4 -0
  227. package/esm/observe/observer-registry.d.mts +30 -0
  228. package/esm/observe/observer-registry.d.mts.map +1 -0
  229. package/esm/observe/observer-registry.mjs +51 -0
  230. package/esm/observe/observer-registry.mjs.map +1 -0
  231. package/esm/observe/observer.contract.d.mts +40 -0
  232. package/esm/observe/observer.contract.d.mts.map +1 -0
  233. package/esm/observe/resolve-observers.d.mts +40 -0
  234. package/esm/observe/resolve-observers.d.mts.map +1 -0
  235. package/esm/observe/resolve-observers.mjs +73 -0
  236. package/esm/observe/resolve-observers.mjs.map +1 -0
  237. package/esm/orchestrator/execution.d.mts.map +1 -1
  238. package/esm/orchestrator/execution.mjs +5 -2
  239. package/esm/orchestrator/execution.mjs.map +1 -1
  240. package/esm/orchestrator/index.d.mts +1 -0
  241. package/esm/orchestrator/index.mjs +1 -0
  242. package/esm/orchestrator/orchestrator.d.mts.map +1 -1
  243. package/esm/orchestrator/orchestrator.mjs +39 -6
  244. package/esm/orchestrator/orchestrator.mjs.map +1 -1
  245. package/esm/orchestrator/session-lock.d.mts +25 -0
  246. package/esm/orchestrator/session-lock.d.mts.map +1 -0
  247. package/esm/orchestrator/session-lock.mjs +83 -0
  248. package/esm/orchestrator/session-lock.mjs.map +1 -0
  249. package/esm/planner/dag-scheduler.mjs +97 -0
  250. package/esm/planner/dag-scheduler.mjs.map +1 -0
  251. package/esm/planner/plan-prompt.d.mts +1 -1
  252. package/esm/planner/plan-prompt.d.mts.map +1 -1
  253. package/esm/planner/plan-prompt.mjs +2 -1
  254. package/esm/planner/plan-prompt.mjs.map +1 -1
  255. package/esm/planner/plan-schema.mjs +17 -14
  256. package/esm/planner/plan-schema.mjs.map +1 -1
  257. package/esm/planner/planner-run.d.mts.map +1 -1
  258. package/esm/planner/planner-run.mjs +300 -29
  259. package/esm/planner/planner-run.mjs.map +1 -1
  260. package/esm/planner/planner.mjs +1 -1
  261. package/esm/planner/planner.mjs.map +1 -1
  262. package/esm/prompt/errors.d.mts +57 -0
  263. package/esm/prompt/errors.d.mts.map +1 -0
  264. package/esm/prompt/errors.mjs +73 -0
  265. package/esm/prompt/errors.mjs.map +1 -0
  266. package/esm/prompt/index.d.mts +3 -0
  267. package/esm/prompt/index.mjs +4 -0
  268. package/esm/prompt/prompt-langfuse-sync.mjs +104 -0
  269. package/esm/prompt/prompt-langfuse-sync.mjs.map +1 -0
  270. package/esm/prompt/prompt-langfuse-sync.type.d.mts +32 -0
  271. package/esm/prompt/prompt-langfuse-sync.type.d.mts.map +1 -0
  272. package/esm/prompt/prompt-validate.mjs +170 -0
  273. package/esm/prompt/prompt-validate.mjs.map +1 -0
  274. package/esm/prompt/prompt.d.mts +54 -0
  275. package/esm/prompt/prompt.d.mts.map +1 -0
  276. package/esm/prompt/prompt.mjs +218 -0
  277. package/esm/prompt/prompt.mjs.map +1 -0
  278. package/esm/prompt/prompt.type.d.mts +174 -0
  279. package/esm/prompt/prompt.type.d.mts.map +1 -0
  280. package/esm/prompts/index.d.mts +3 -0
  281. package/esm/prompts/index.mjs +3 -0
  282. package/esm/prompts/prompts-manager.contract.d.mts +154 -0
  283. package/esm/prompts/prompts-manager.contract.d.mts.map +1 -0
  284. package/esm/prompts/prompts-manager.d.mts +38 -0
  285. package/esm/prompts/prompts-manager.d.mts.map +1 -0
  286. package/esm/prompts/prompts-manager.mjs +410 -0
  287. package/esm/prompts/prompts-manager.mjs.map +1 -0
  288. package/esm/prompts/prompts-manager.type.d.mts +172 -0
  289. package/esm/prompts/prompts-manager.type.d.mts.map +1 -0
  290. package/esm/prompts/prompts-validate.mjs +200 -0
  291. package/esm/prompts/prompts-validate.mjs.map +1 -0
  292. package/esm/rag/as-tool.mjs +48 -0
  293. package/esm/rag/as-tool.mjs.map +1 -0
  294. package/esm/rag/chunk/chunk.d.mts +24 -0
  295. package/esm/rag/chunk/chunk.d.mts.map +1 -0
  296. package/esm/rag/chunk/chunk.mjs +44 -0
  297. package/esm/rag/chunk/chunk.mjs.map +1 -0
  298. package/esm/rag/chunk/fixed.mjs +32 -0
  299. package/esm/rag/chunk/fixed.mjs.map +1 -0
  300. package/esm/rag/chunk/markdown.mjs +75 -0
  301. package/esm/rag/chunk/markdown.mjs.map +1 -0
  302. package/esm/rag/chunk/recursive.mjs +132 -0
  303. package/esm/rag/chunk/recursive.mjs.map +1 -0
  304. package/esm/rag/chunk/sentence.mjs +73 -0
  305. package/esm/rag/chunk/sentence.mjs.map +1 -0
  306. package/esm/rag/contracts/chunk-options.type.d.mts +35 -0
  307. package/esm/rag/contracts/chunk-options.type.d.mts.map +1 -0
  308. package/esm/rag/contracts/citation.type.d.mts +35 -0
  309. package/esm/rag/contracts/citation.type.d.mts.map +1 -0
  310. package/esm/rag/contracts/index.d.mts +4 -0
  311. package/esm/rag/contracts/rag-config.type.d.mts +68 -0
  312. package/esm/rag/contracts/rag-config.type.d.mts.map +1 -0
  313. package/esm/rag/contracts/rag-document.type.d.mts +21 -0
  314. package/esm/rag/contracts/rag-document.type.d.mts.map +1 -0
  315. package/esm/rag/hybrid/bm25.d.mts +23 -0
  316. package/esm/rag/hybrid/bm25.d.mts.map +1 -0
  317. package/esm/rag/hybrid/bm25.mjs +51 -0
  318. package/esm/rag/hybrid/bm25.mjs.map +1 -0
  319. package/esm/rag/hybrid/hybrid-rank.d.mts +33 -0
  320. package/esm/rag/hybrid/hybrid-rank.d.mts.map +1 -0
  321. package/esm/rag/hybrid/hybrid-rank.mjs +29 -0
  322. package/esm/rag/hybrid/hybrid-rank.mjs.map +1 -0
  323. package/esm/rag/hybrid/rrf.d.mts +25 -0
  324. package/esm/rag/hybrid/rrf.d.mts.map +1 -0
  325. package/esm/rag/hybrid/rrf.mjs +30 -0
  326. package/esm/rag/hybrid/rrf.mjs.map +1 -0
  327. package/esm/rag/index.d.mts +15 -0
  328. package/esm/rag/index.mjs +11 -0
  329. package/esm/rag/rag.d.mts +38 -0
  330. package/esm/rag/rag.d.mts.map +1 -0
  331. package/esm/rag/rag.mjs +126 -0
  332. package/esm/rag/rag.mjs.map +1 -0
  333. package/esm/rag/rerank/keyword-reranker.d.mts +32 -0
  334. package/esm/rag/rerank/keyword-reranker.d.mts.map +1 -0
  335. package/esm/rag/rerank/keyword-reranker.mjs +58 -0
  336. package/esm/rag/rerank/keyword-reranker.mjs.map +1 -0
  337. package/esm/rag/rerank/llm-reranker.d.mts +36 -0
  338. package/esm/rag/rerank/llm-reranker.d.mts.map +1 -0
  339. package/esm/rag/rerank/llm-reranker.mjs +85 -0
  340. package/esm/rag/rerank/llm-reranker.mjs.map +1 -0
  341. package/esm/rag/rerank/reranker.contract.d.mts +28 -0
  342. package/esm/rag/rerank/reranker.contract.d.mts.map +1 -0
  343. package/esm/rag/retrieve.mjs +68 -0
  344. package/esm/rag/retrieve.mjs.map +1 -0
  345. package/esm/rag/store/cache-vector-store.d.mts +27 -0
  346. package/esm/rag/store/cache-vector-store.d.mts.map +1 -0
  347. package/esm/rag/store/cache-vector-store.mjs +48 -0
  348. package/esm/rag/store/cache-vector-store.mjs.map +1 -0
  349. package/esm/rag/store/vector-store.contract.d.mts +38 -0
  350. package/esm/rag/store/vector-store.contract.d.mts.map +1 -0
  351. package/esm/rag/transforms/multi-query.d.mts +27 -0
  352. package/esm/rag/transforms/multi-query.d.mts.map +1 -0
  353. package/esm/rag/transforms/multi-query.mjs +41 -0
  354. package/esm/rag/transforms/multi-query.mjs.map +1 -0
  355. package/esm/security/index.mjs +5 -0
  356. package/esm/security/outbound-policy.d.mts +46 -0
  357. package/esm/security/outbound-policy.d.mts.map +1 -0
  358. package/esm/security/outbound-policy.mjs +187 -0
  359. package/esm/security/outbound-policy.mjs.map +1 -0
  360. package/esm/security/outbound-policy.type.d.mts +74 -0
  361. package/esm/security/outbound-policy.type.d.mts.map +1 -0
  362. package/esm/security/private-ip.d.mts +15 -0
  363. package/esm/security/private-ip.d.mts.map +1 -0
  364. package/esm/security/private-ip.mjs +48 -0
  365. package/esm/security/private-ip.mjs.map +1 -0
  366. package/esm/security/redact.d.mts +59 -0
  367. package/esm/security/redact.d.mts.map +1 -0
  368. package/esm/security/redact.mjs +122 -0
  369. package/esm/security/redact.mjs.map +1 -0
  370. package/esm/serve/serve.d.mts +50 -0
  371. package/esm/serve/serve.d.mts.map +1 -0
  372. package/esm/serve/serve.mjs +90 -0
  373. package/esm/serve/serve.mjs.map +1 -0
  374. package/esm/serve/sse.d.mts +20 -0
  375. package/esm/serve/sse.d.mts.map +1 -0
  376. package/esm/serve/sse.mjs +25 -0
  377. package/esm/serve/sse.mjs.map +1 -0
  378. package/esm/serve/stream-to-sse.d.mts +29 -0
  379. package/esm/serve/stream-to-sse.d.mts.map +1 -0
  380. package/esm/serve/stream-to-sse.mjs +37 -0
  381. package/esm/serve/stream-to-sse.mjs.map +1 -0
  382. package/esm/skills/catalog.d.mts +49 -0
  383. package/esm/skills/catalog.d.mts.map +1 -0
  384. package/esm/skills/catalog.mjs +140 -0
  385. package/esm/skills/catalog.mjs.map +1 -0
  386. package/esm/skills/contracts/skill-record.type.d.mts +37 -0
  387. package/esm/skills/contracts/skill-record.type.d.mts.map +1 -0
  388. package/esm/skills/contracts/skills-config.type.d.mts +108 -0
  389. package/esm/skills/contracts/skills-config.type.d.mts.map +1 -0
  390. package/esm/skills/contracts/skills-store.contract.d.mts +28 -0
  391. package/esm/skills/contracts/skills-store.contract.d.mts.map +1 -0
  392. package/esm/skills/contracts/skills.contract.d.mts +43 -0
  393. package/esm/skills/contracts/skills.contract.d.mts.map +1 -0
  394. package/esm/skills/index.d.mts +16 -0
  395. package/esm/skills/index.mjs +14 -0
  396. package/esm/skills/load-skill-tool.d.mts +38 -0
  397. package/esm/skills/load-skill-tool.d.mts.map +1 -0
  398. package/esm/skills/load-skill-tool.mjs +65 -0
  399. package/esm/skills/load-skill-tool.mjs.map +1 -0
  400. package/esm/skills/review-gate.d.mts +33 -0
  401. package/esm/skills/review-gate.d.mts.map +1 -0
  402. package/esm/skills/review-gate.mjs +60 -0
  403. package/esm/skills/review-gate.mjs.map +1 -0
  404. package/esm/skills/save-skill-tool.d.mts +39 -0
  405. package/esm/skills/save-skill-tool.d.mts.map +1 -0
  406. package/esm/skills/save-skill-tool.mjs +65 -0
  407. package/esm/skills/save-skill-tool.mjs.map +1 -0
  408. package/esm/skills/skills.d.mts +33 -0
  409. package/esm/skills/skills.d.mts.map +1 -0
  410. package/esm/skills/skills.mjs +109 -0
  411. package/esm/skills/skills.mjs.map +1 -0
  412. package/esm/skills/sources/directory-source.d.mts +19 -0
  413. package/esm/skills/sources/directory-source.d.mts.map +1 -0
  414. package/esm/skills/sources/directory-source.mjs +108 -0
  415. package/esm/skills/sources/directory-source.mjs.map +1 -0
  416. package/esm/skills/sources/index.d.mts +18 -0
  417. package/esm/skills/sources/index.d.mts.map +1 -0
  418. package/esm/skills/sources/index.mjs +27 -0
  419. package/esm/skills/sources/index.mjs.map +1 -0
  420. package/esm/skills/sources/parse-frontmatter.d.mts +27 -0
  421. package/esm/skills/sources/parse-frontmatter.d.mts.map +1 -0
  422. package/esm/skills/sources/parse-frontmatter.mjs +46 -0
  423. package/esm/skills/sources/parse-frontmatter.mjs.map +1 -0
  424. package/esm/skills/sources/store-source.d.mts +14 -0
  425. package/esm/skills/sources/store-source.d.mts.map +1 -0
  426. package/esm/skills/sources/store-source.mjs +15 -0
  427. package/esm/skills/sources/store-source.mjs.map +1 -0
  428. package/esm/skills/sources/url-source.d.mts +29 -0
  429. package/esm/skills/sources/url-source.d.mts.map +1 -0
  430. package/esm/skills/sources/url-source.mjs +117 -0
  431. package/esm/skills/sources/url-source.mjs.map +1 -0
  432. package/esm/skills/store/mock-skills-store.d.mts +57 -0
  433. package/esm/skills/store/mock-skills-store.d.mts.map +1 -0
  434. package/esm/skills/store/mock-skills-store.mjs +100 -0
  435. package/esm/skills/store/mock-skills-store.mjs.map +1 -0
  436. package/esm/skills/store/procedural-skill-store.d.mts +30 -0
  437. package/esm/skills/store/procedural-skill-store.d.mts.map +1 -0
  438. package/esm/skills/store/procedural-skill-store.mjs +125 -0
  439. package/esm/skills/store/procedural-skill-store.mjs.map +1 -0
  440. package/esm/supervisor/as-tool.mjs +2 -2
  441. package/esm/supervisor/as-tool.mjs.map +1 -1
  442. package/esm/supervisor/execution.d.mts.map +1 -1
  443. package/esm/supervisor/execution.mjs +31 -28
  444. package/esm/supervisor/execution.mjs.map +1 -1
  445. package/esm/supervisor/supervisor.d.mts.map +1 -1
  446. package/esm/supervisor/supervisor.mjs +8 -3
  447. package/esm/supervisor/supervisor.mjs.map +1 -1
  448. package/esm/system-prompt/index.d.mts +4 -0
  449. package/esm/system-prompt/system-prompt.d.mts +68 -4
  450. package/esm/system-prompt/system-prompt.d.mts.map +1 -1
  451. package/esm/system-prompt/system-prompt.mjs +89 -5
  452. package/esm/system-prompt/system-prompt.mjs.map +1 -1
  453. package/esm/team/gates.mjs +48 -0
  454. package/esm/team/gates.mjs.map +1 -0
  455. package/esm/team/index.d.mts +1 -0
  456. package/esm/team/index.mjs +3 -0
  457. package/esm/team/team.d.mts +42 -0
  458. package/esm/team/team.d.mts.map +1 -0
  459. package/esm/team/team.mjs +94 -0
  460. package/esm/team/team.mjs.map +1 -0
  461. package/esm/tool/executable-as-tool.d.mts.map +1 -1
  462. package/esm/tool/executable-as-tool.mjs +2 -2
  463. package/esm/tool/executable-as-tool.mjs.map +1 -1
  464. package/esm/tool/tool.d.mts.map +1 -1
  465. package/esm/tool/tool.mjs +2 -2
  466. package/esm/tool/tool.mjs.map +1 -1
  467. package/esm/utils/compute-cost.d.mts +17 -1
  468. package/esm/utils/compute-cost.d.mts.map +1 -1
  469. package/esm/utils/compute-cost.mjs +26 -1
  470. package/esm/utils/compute-cost.mjs.map +1 -1
  471. package/esm/utils/extract-json-lenient.d.mts +42 -0
  472. package/esm/utils/extract-json-lenient.d.mts.map +1 -0
  473. package/esm/utils/extract-json-lenient.mjs +97 -0
  474. package/esm/utils/extract-json-lenient.mjs.map +1 -0
  475. package/esm/utils/index.d.mts +4 -2
  476. package/esm/utils/index.mjs +3 -1
  477. package/esm/utils/json-schema.d.mts +1 -1
  478. package/esm/utils/prepare-attachment-part.d.mts +10 -1
  479. package/esm/utils/prepare-attachment-part.d.mts.map +1 -1
  480. package/esm/utils/prepare-attachment-part.mjs +103 -11
  481. package/esm/utils/prepare-attachment-part.mjs.map +1 -1
  482. package/esm/utils/resolve-attachment.d.mts +4 -3
  483. package/esm/utils/resolve-attachment.d.mts.map +1 -1
  484. package/esm/utils/resolve-attachment.mjs +4 -3
  485. package/esm/utils/resolve-attachment.mjs.map +1 -1
  486. package/esm/utils/run-context.d.mts +94 -0
  487. package/esm/utils/run-context.d.mts.map +1 -0
  488. package/esm/utils/run-context.mjs +98 -0
  489. package/esm/utils/run-context.mjs.map +1 -0
  490. package/esm/vcr/cassette-io.mjs +57 -0
  491. package/esm/vcr/cassette-io.mjs.map +1 -0
  492. package/esm/vcr/errors.d.mts +42 -0
  493. package/esm/vcr/errors.d.mts.map +1 -0
  494. package/esm/vcr/errors.mjs +37 -0
  495. package/esm/vcr/errors.mjs.map +1 -0
  496. package/esm/vcr/hash-request.d.mts +28 -0
  497. package/esm/vcr/hash-request.d.mts.map +1 -0
  498. package/esm/vcr/hash-request.mjs +118 -0
  499. package/esm/vcr/hash-request.mjs.map +1 -0
  500. package/esm/vcr/index.d.mts +4 -0
  501. package/esm/vcr/index.mjs +5 -0
  502. package/esm/vcr/vcr.d.mts +32 -0
  503. package/esm/vcr/vcr.d.mts.map +1 -0
  504. package/esm/vcr/vcr.mjs +248 -0
  505. package/esm/vcr/vcr.mjs.map +1 -0
  506. package/esm/vcr/vcr.type.d.mts +118 -0
  507. package/esm/vcr/vcr.type.d.mts.map +1 -0
  508. package/esm/workflow/as-tool.mjs +2 -2
  509. package/esm/workflow/as-tool.mjs.map +1 -1
  510. package/esm/workflow/engine.mjs +1 -0
  511. package/esm/workflow/engine.mjs.map +1 -1
  512. package/esm/workflow/step-runner.mjs +19 -20
  513. package/esm/workflow/step-runner.mjs.map +1 -1
  514. package/esm/workflow/workflow.d.mts.map +1 -1
  515. package/esm/workflow/workflow.mjs +8 -3
  516. package/esm/workflow/workflow.mjs.map +1 -1
  517. package/llms-full.txt +1683 -68
  518. package/llms.txt +16 -4
  519. package/package.json +7 -3
  520. package/skills/README.md +40 -4
  521. package/skills/ai-dx-helpers/SKILL.md +2 -2
  522. package/skills/approve-tool-calls/SKILL.md +134 -0
  523. package/skills/attach-ai-middleware/SKILL.md +1 -1
  524. package/skills/detect-and-redact-pii/SKILL.md +104 -0
  525. package/skills/durable-resume/SKILL.md +128 -0
  526. package/skills/escalate-block-to-human/SKILL.md +85 -0
  527. package/skills/eval-datasets-and-ci/SKILL.md +117 -0
  528. package/skills/guard-input-output/SKILL.md +117 -0
  529. package/skills/manage-prompts/SKILL.md +186 -0
  530. package/skills/observe-ai-flows/SKILL.md +94 -0
  531. package/skills/record-replay-llm/SKILL.md +92 -0
  532. package/skills/run-ai-agent/SKILL.md +26 -1
  533. package/skills/run-ai-rag/SKILL.md +139 -0
  534. package/skills/run-ai-team/SKILL.md +107 -0
  535. package/skills/run-orchestrator/SKILL.md +2 -0
  536. package/skills/run-planner/SKILL.md +73 -8
  537. package/skills/run-supervisor/SKILL.md +20 -1
  538. package/skills/use-runtime-skills/SKILL.md +106 -0
  539. package/skills/write-system-prompt/SKILL.md +30 -1
  540. package/cjs/index.cjs.map +0 -1
  541. package/esm/contracts/result/index.d.mts +0 -15
@@ -0,0 +1,60 @@
1
+ //#region ../@warlock.js/ai/src/eval/report-junit.ts
2
+ /**
3
+ * Escape the five XML predefined entities so arbitrary text (case names,
4
+ * failure reasons, agent names) is safe inside an attribute value or
5
+ * element body. Covers `&`, `<`, `>`, `"`, and `'`.
6
+ */
7
+ function escapeXml(value) {
8
+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
9
+ }
10
+ /**
11
+ * Build the `<failure>` body for a failed case: the joined reasons of
12
+ * every non-passing scorer, falling back to a generic message when a
13
+ * scorer offered no reason (or the failure was an agent error).
14
+ */
15
+ function failureMessage(entry) {
16
+ if (entry.result.error) return `agent error: ${entry.result.error.message}`;
17
+ const reasons = entry.scores.filter((score) => score.passed === false).map((score) => score.reason).filter((reason) => typeof reason === "string" && reason !== "");
18
+ if (reasons.length > 0) return reasons.join("; ");
19
+ return "case did not pass";
20
+ }
21
+ /**
22
+ * Serialize an {@link EvalReport} to a JUnit-XML string for CI ingestion.
23
+ *
24
+ * **Role.** A pure, runner-decoupled reporter: one `<testsuite>` whose
25
+ * name is the agent, one `<testcase>` per eval case, a `<failure>` child
26
+ * on each case that did not pass (with the joined scorer reasons), and a
27
+ * `time` attribute carrying the case / suite duration in **seconds**
28
+ * (JUnit's unit; the report stores milliseconds).
29
+ *
30
+ * XML is hand-emitted (no `xml` dependency) and every dynamic value is
31
+ * entity-escaped via {@link escapeXml}.
32
+ *
33
+ * @example
34
+ * await writeFile("./report.junit.xml", toJUnit(report));
35
+ */
36
+ function toJUnit(report) {
37
+ const suiteName = escapeXml(report.agentName);
38
+ const suiteTime = (report.duration / 1e3).toFixed(3);
39
+ const lines = [];
40
+ lines.push("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
41
+ lines.push(`<testsuite name="${suiteName}" tests="${report.total}" failures="${report.failedCount}" time="${suiteTime}">`);
42
+ for (const entry of report.cases) {
43
+ const caseName = escapeXml(entry.case.name);
44
+ const caseTime = (entry.duration / 1e3).toFixed(3);
45
+ if (entry.passed) {
46
+ lines.push(` <testcase name="${caseName}" classname="${suiteName}" time="${caseTime}"/>`);
47
+ continue;
48
+ }
49
+ const message = failureMessage(entry);
50
+ lines.push(` <testcase name="${caseName}" classname="${suiteName}" time="${caseTime}">`);
51
+ lines.push(` <failure message="${escapeXml(message)}">${escapeXml(message)}</failure>`);
52
+ lines.push(" </testcase>");
53
+ }
54
+ lines.push("</testsuite>");
55
+ return lines.join("\n");
56
+ }
57
+
58
+ //#endregion
59
+ export { toJUnit };
60
+ //# sourceMappingURL=report-junit.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-junit.mjs","names":[],"sources":["../../../../../../../@warlock.js/ai/src/eval/report-junit.ts"],"sourcesContent":["import type { EvalCaseResult, EvalReport } from \"../contracts/agent/eval.type\";\n\n/**\n * Escape the five XML predefined entities so arbitrary text (case names,\n * failure reasons, agent names) is safe inside an attribute value or\n * element body. Covers `&`, `<`, `>`, `\"`, and `'`.\n */\nfunction escapeXml(value: string): string {\n return value\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&apos;\");\n}\n\n/**\n * Build the `<failure>` body for a failed case: the joined reasons of\n * every non-passing scorer, falling back to a generic message when a\n * scorer offered no reason (or the failure was an agent error).\n */\nfunction failureMessage(entry: EvalCaseResult): string {\n if (entry.result.error) {\n return `agent error: ${entry.result.error.message}`;\n }\n\n const reasons = entry.scores\n .filter((score) => score.passed === false)\n .map((score) => score.reason)\n .filter((reason): reason is string => typeof reason === \"string\" && reason !== \"\");\n\n if (reasons.length > 0) {\n return reasons.join(\"; \");\n }\n\n return \"case did not pass\";\n}\n\n/**\n * Serialize an {@link EvalReport} to a JUnit-XML string for CI ingestion.\n *\n * **Role.** A pure, runner-decoupled reporter: one `<testsuite>` whose\n * name is the agent, one `<testcase>` per eval case, a `<failure>` child\n * on each case that did not pass (with the joined scorer reasons), and a\n * `time` attribute carrying the case / suite duration in **seconds**\n * (JUnit's unit; the report stores milliseconds).\n *\n * XML is hand-emitted (no `xml` dependency) and every dynamic value is\n * entity-escaped via {@link escapeXml}.\n *\n * @example\n * await writeFile(\"./report.junit.xml\", toJUnit(report));\n */\nexport function toJUnit(report: EvalReport): string {\n const suiteName = escapeXml(report.agentName);\n const suiteTime = (report.duration / 1000).toFixed(3);\n\n const lines: string[] = [];\n\n lines.push('<?xml version=\"1.0\" encoding=\"UTF-8\"?>');\n lines.push(\n `<testsuite name=\"${suiteName}\" tests=\"${report.total}\" failures=\"${report.failedCount}\" time=\"${suiteTime}\">`,\n );\n\n for (const entry of report.cases) {\n const caseName = escapeXml(entry.case.name);\n const caseTime = (entry.duration / 1000).toFixed(3);\n\n if (entry.passed) {\n lines.push(\n ` <testcase name=\"${caseName}\" classname=\"${suiteName}\" time=\"${caseTime}\"/>`,\n );\n\n continue;\n }\n\n const message = failureMessage(entry);\n lines.push(\n ` <testcase name=\"${caseName}\" classname=\"${suiteName}\" time=\"${caseTime}\">`,\n );\n lines.push(\n ` <failure message=\"${escapeXml(message)}\">${escapeXml(message)}</failure>`,\n );\n lines.push(\" </testcase>\");\n }\n\n lines.push(\"</testsuite>\");\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;AAOA,SAAS,UAAU,OAAuB;CACxC,OAAO,MACJ,QAAQ,MAAM,OAAO,CAAC,CACtB,QAAQ,MAAM,MAAM,CAAC,CACrB,QAAQ,MAAM,MAAM,CAAC,CACrB,QAAQ,MAAM,QAAQ,CAAC,CACvB,QAAQ,MAAM,QAAQ;AAC3B;;;;;;AAOA,SAAS,eAAe,OAA+B;CACrD,IAAI,MAAM,OAAO,OACf,OAAO,gBAAgB,MAAM,OAAO,MAAM;CAG5C,MAAM,UAAU,MAAM,OACnB,QAAQ,UAAU,MAAM,WAAW,KAAK,CAAC,CACzC,KAAK,UAAU,MAAM,MAAM,CAAC,CAC5B,QAAQ,WAA6B,OAAO,WAAW,YAAY,WAAW,EAAE;CAEnF,IAAI,QAAQ,SAAS,GACnB,OAAO,QAAQ,KAAK,IAAI;CAG1B,OAAO;AACT;;;;;;;;;;;;;;;;AAiBA,SAAgB,QAAQ,QAA4B;CAClD,MAAM,YAAY,UAAU,OAAO,SAAS;CAC5C,MAAM,aAAa,OAAO,WAAW,IAAI,CAAE,QAAQ,CAAC;CAEpD,MAAM,QAAkB,CAAC;CAEzB,MAAM,KAAK,4CAAwC;CACnD,MAAM,KACJ,oBAAoB,UAAU,WAAW,OAAO,MAAM,cAAc,OAAO,YAAY,UAAU,UAAU,GAC7G;CAEA,KAAK,MAAM,SAAS,OAAO,OAAO;EAChC,MAAM,WAAW,UAAU,MAAM,KAAK,IAAI;EAC1C,MAAM,YAAY,MAAM,WAAW,IAAI,CAAE,QAAQ,CAAC;EAElD,IAAI,MAAM,QAAQ;GAChB,MAAM,KACJ,qBAAqB,SAAS,eAAe,UAAU,UAAU,SAAS,IAC5E;GAEA;EACF;EAEA,MAAM,UAAU,eAAe,KAAK;EACpC,MAAM,KACJ,qBAAqB,SAAS,eAAe,UAAU,UAAU,SAAS,GAC5E;EACA,MAAM,KACJ,yBAAyB,UAAU,OAAO,EAAE,IAAI,UAAU,OAAO,EAAE,WACrE;EACA,MAAM,KAAK,eAAe;CAC5B;CAEA,MAAM,KAAK,cAAc;CAEzB,OAAO,MAAM,KAAK,IAAI;AACxB"}
@@ -0,0 +1,165 @@
1
+ import { MiddlewareTripContext } from "../../contracts/middleware/middleware-context.type.mjs";
2
+ import { GuardrailAction, GuardrailMatch, GuardrailPhase } from "./verdict.type.mjs";
3
+ import { GuardrailDetector } from "./guardrail.contract.mjs";
4
+ import { OpenAiClientLike } from "./openai-client.contract.mjs";
5
+
6
+ //#region ../@warlock.js/ai/src/guard/contracts/guard-options.type.d.ts
7
+ /**
8
+ * The payload handed to {@link GuardrailEscalation.onBlock} when a detector
9
+ * returns `{ type: "block", escalate: true }`. The factory builds it just
10
+ * before throwing the `GuardrailViolationError`, so a host can route the
11
+ * hard block to a human-review surface.
12
+ */
13
+ interface GuardrailBlockEvent {
14
+ /** Where the block fired: input prompt, output, or tool args. */
15
+ readonly phase: GuardrailPhase;
16
+ /** The detector's human-readable reason. */
17
+ readonly reason: string;
18
+ /** The matches that triggered the block, when the detector reported them. */
19
+ readonly matches?: readonly GuardrailMatch[];
20
+ /** The live middleware trip context (state, messages, agent, model, signal). */
21
+ readonly ctx: MiddlewareTripContext;
22
+ }
23
+ /**
24
+ * Escalation seam for composing a hard block with a human-review surface.
25
+ *
26
+ * The callback fires **only** for a verdict of `{ type: "block", escalate:
27
+ * true }`, awaited *before* the `GuardrailViolationError` is thrown. It is a
28
+ * plain callback by design — `ai-guard` takes no dependency on the deferred
29
+ * human-step machinery; the host wires its own review queue / resume loop
30
+ * inside `onBlock`.
31
+ */
32
+ interface GuardrailEscalation {
33
+ /** Route a `{ type: "block", escalate: true }` verdict to a human. */
34
+ onBlock?(event: GuardrailBlockEvent): void | Promise<void>;
35
+ }
36
+ /**
37
+ * Configuration for the {@link guard} factory (surfaced as
38
+ * `ai.guardrail(options)`). Each phase array runs in registration order;
39
+ * the first non-`allow` verdict decides the action for that phase.
40
+ *
41
+ * At least one of `input` / `output` / `tool` should be supplied — a guard
42
+ * with no detectors is a no-op middleware.
43
+ */
44
+ interface GuardOptions {
45
+ /**
46
+ * Override the middleware name — surfaces on
47
+ * `GuardrailViolationError.guardrail` and as the `ctx.state` namespace so
48
+ * operators can tell two guards apart. Default `"guardrail"`.
49
+ */
50
+ name?: string;
51
+ /**
52
+ * Detectors run on the outbound prompt at `trip.before`.
53
+ *
54
+ * **Input redaction is not supported in v1:** the core `trip.before` hook
55
+ * can only short-circuit, not rewrite-and-continue, so a `redact` verdict
56
+ * here is treated as a `block`. Input detectors are effectively
57
+ * `block` / `flag` only.
58
+ */
59
+ input?: readonly GuardrailDetector[];
60
+ /** Detectors run on `response.content` at `trip.after`. Support `redact`. */
61
+ output?: readonly GuardrailDetector[];
62
+ /**
63
+ * Detectors run on `JSON.stringify(toolArgs)` at `tool.before`. A
64
+ * `redact` verdict here is treated as a `block` (silently rewriting tool
65
+ * arguments changes side-effects unpredictably).
66
+ */
67
+ tool?: readonly GuardrailDetector[];
68
+ /**
69
+ * The tool names the `tool` detectors apply to. Omit to apply to every
70
+ * tool. When set, the middleware's `tool` hooks are scoped via the core
71
+ * `forTool(toolNames, mw)` helper; `trip` hooks are unaffected.
72
+ */
73
+ toolNames?: string | readonly string[];
74
+ /** Compose a `{ type: "block", escalate: true }` verdict with a human. */
75
+ escalation?: GuardrailEscalation;
76
+ }
77
+ /**
78
+ * The PII categories the built-in `pii` detector can scan for. Each is a
79
+ * linear (anchored, no nested quantifiers) regex — safe against catastrophic
80
+ * backtracking.
81
+ */
82
+ type PiiCategory = "ssn" | "email" | "phone" | "credit-card" | "ipv4";
83
+ /**
84
+ * Options for the built-in `pii` detector (`ai.guardrail.pii`). All built-in
85
+ * PII matching is regex / exact-string only — zero runtime dependency.
86
+ */
87
+ interface PiiDetectorOptions {
88
+ /** Which categories to scan for. Default: every {@link PiiCategory}. */
89
+ detect?: readonly PiiCategory[];
90
+ /** What to do on a match. Default `"redact"`. */
91
+ onMatch?: Extract<GuardrailAction, "redact" | "block" | "flag">;
92
+ /**
93
+ * Replacement template used on `redact`. Supports the `{label}` token,
94
+ * substituted with the matched category — e.g. `"[REDACTED:{label}]"`.
95
+ * Default masks the matched span with a fixed placeholder.
96
+ */
97
+ mask?: string;
98
+ /** Extra exact-string terms to treat as PII alongside the built-in regexes. */
99
+ dictionary?: readonly string[];
100
+ }
101
+ /**
102
+ * Options for the built-in `topic` filter (`ai.guardrail.topic`). Matches a
103
+ * case-insensitive substring or a `RegExp` against the inspected text.
104
+ */
105
+ interface TopicFilterOptions {
106
+ /**
107
+ * Deny-list terms / phrases. A `string` matches case-insensitively as a
108
+ * substring; a `RegExp` is tested as-is. Any hit triggers `onMatch`.
109
+ */
110
+ deny?: readonly (string | RegExp)[];
111
+ /**
112
+ * Allow-list terms / phrases. When set, text matching **none** of these
113
+ * triggers `onMatch` (an allow-list miss).
114
+ */
115
+ allow?: readonly (string | RegExp)[];
116
+ /** Action on a deny hit (or an allow-list miss). Default `"block"`. */
117
+ onMatch?: Extract<GuardrailAction, "block" | "flag">;
118
+ /** Override the verdict's human-readable reason. */
119
+ reason?: string;
120
+ }
121
+ /**
122
+ * Options for the built-in `injection` detector (`ai.guardrail.injection`).
123
+ * Matches a built-in set of jailbreak / prompt-injection marker phrases,
124
+ * extensible with caller-supplied markers.
125
+ */
126
+ interface InjectionDetectorOptions {
127
+ /**
128
+ * Extra marker phrases beyond the built-in jailbreak / prompt-injection
129
+ * set. A `string` matches case-insensitively as a substring; a `RegExp`
130
+ * is tested as-is.
131
+ */
132
+ markers?: readonly (string | RegExp)[];
133
+ /**
134
+ * Action on a match. Default `"flag"` — callers commonly escalate to
135
+ * `"block"` on the input phase.
136
+ */
137
+ onMatch?: Extract<GuardrailAction, "block" | "flag">;
138
+ }
139
+ /**
140
+ * Options for the optional `moderation` detector (`ai.guardrail.moderation`),
141
+ * backed by a lazily-imported `openai` peer. Importing `@warlock.js/ai`
142
+ * never forces `openai` to resolve; the detector throws a curated install
143
+ * string on first `check()` when the SDK is absent.
144
+ */
145
+ interface OpenAiModerationOptions {
146
+ /**
147
+ * A pre-built OpenAI-compatible client (any object matching
148
+ * {@link OpenAiClientLike}, including a real `OpenAI` instance). When
149
+ * supplied, the detector calls it directly and never imports the SDK —
150
+ * the bring-your-own-client / test escape hatch.
151
+ */
152
+ client?: OpenAiClientLike;
153
+ /** OpenAI API key. Reads `OPENAI_API_KEY` from the environment when omitted. */
154
+ apiKey?: string;
155
+ /** Moderation model to call. Default `"omni-moderation-latest"`. */
156
+ model?: string;
157
+ /**
158
+ * Categories that escalate to `block`; every other flagged category
159
+ * produces a `flag` verdict instead. Omit to `flag` on any category.
160
+ */
161
+ blockOn?: readonly string[];
162
+ }
163
+ //#endregion
164
+ export { GuardOptions, GuardrailBlockEvent, GuardrailEscalation, InjectionDetectorOptions, OpenAiModerationOptions, PiiCategory, PiiDetectorOptions, TopicFilterOptions };
165
+ //# sourceMappingURL=guard-options.type.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guard-options.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/guard/contracts/guard-options.type.ts"],"mappings":";;;;;;;;AAeA;;;;UAAiB,mBAAA;EAQD;EAAA,SANL,KAAA,EAAO,cAAA;EAMmB;EAAA,SAJ1B,MAAA;EAFO;EAAA,SAIP,OAAA,YAAmB,cAAA;EAAnB;EAAA,SAEA,GAAA,EAAK,qBAAA;AAAA;;;AAAqB;AAYrC;;;;;;UAAiB,mBAAA;EAE8B;EAA7C,OAAA,EAAS,KAAA,EAAO,mBAAA,UAA6B,OAAO;AAAA;AAWtD;;;;;;;;AAAA,UAAiB,YAAA;EAMf;;;;;EAAA,IAAA;EAiBgB;;;;;AAQgB;AAQlC;;EAxBE,KAAA,YAAiB,iBAAA;EAwBI;EAtBrB,MAAA,YAAkB,iBAAA;EA4BH;;;;;EAtBf,IAAA,YAAgB,iBAAA;EA0BC;;;;;EApBjB,SAAA;EAoBkB;EAlBlB,UAAA,GAAa,mBAAA;AAAA;;AA0BH;AAOZ;;;KAzBY,WAAA;;;;;UAMK,kBAAA;EAwBf;EAtBA,MAAA,YAAkB,WAAA;EA2BlB;EAzBA,OAAA,GAAU,OAAA,CAAQ,eAAA;EA2BlB;;;;;EArBA,IAAA;EA+Be;EA7Bf,UAAA;AAAA;;;;;UAOe,kBAAA;EA4Bf;;;;EAvBA,IAAA,sBAA0B,MAAA;EA4BO;AAAA;AASnC;;EAhCE,KAAA,sBAA2B,MAAA;EAuCF;EArCzB,OAAA,GAAU,OAAA,CAAQ,eAAA;EAqCT;EAnCT,MAAA;AAAA;;;AA4CO;;;UApCQ,wBAAA;;;;;;EAMf,OAAA,sBAA6B,MAAA;;;;;EAK7B,OAAA,GAAU,OAAA,CAAQ,eAAA;AAAA;;;;;;;UASH,uBAAA;;;;;;;EAOf,MAAA,GAAS,gBAAgB;;EAEzB,MAAA;;EAEA,KAAA;;;;;EAKA,OAAA;AAAA"}
@@ -0,0 +1,78 @@
1
+ import { MiddlewareTripContext } from "../../contracts/middleware/middleware-context.type.mjs";
2
+ import { GuardrailPhase, GuardrailVerdict } from "./verdict.type.mjs";
3
+
4
+ //#region ../@warlock.js/ai/src/guard/contracts/guardrail.contract.d.ts
5
+ /**
6
+ * The stable context every detector receives on each `check()` — the phase
7
+ * it is running at plus the live middleware trip context.
8
+ *
9
+ * A detector reads `phase` to branch on *where* it is running (e.g. an
10
+ * injection detector escalating to `block` on `"input"` but only `flag` on
11
+ * `"output"`), and `ctx` for the surrounding run identity (`state`,
12
+ * `messages`, `agent`, `model`, `signal`). A detector must never mutate
13
+ * `ctx` — it is a read-only view; the factory owns all pipeline effects.
14
+ */
15
+ interface GuardrailDetectorContext {
16
+ /** Where this detector is running: input prompt, output, or tool args. */
17
+ readonly phase: GuardrailPhase;
18
+ /** The live middleware trip context (state, messages, agent, model, signal). */
19
+ readonly ctx: MiddlewareTripContext;
20
+ }
21
+ /**
22
+ * A guardrail detector — the unit of content intelligence. Inspects a piece
23
+ * of text and returns a {@link GuardrailVerdict}. Sync or async (an async
24
+ * `check` routes to an external moderation API).
25
+ *
26
+ * A detector has **no** knowledge of hooks, ordering, or `ctx.state`
27
+ * mutation — the {@link guard} factory is the thin adapter that runs
28
+ * detectors at the right hook points and translates verdicts into the
29
+ * pipeline's throw / return / record mechanics.
30
+ *
31
+ * @example
32
+ * const noShouting: GuardrailDetector = {
33
+ * name: "no-shouting",
34
+ * check(text) {
35
+ * return text === text.toUpperCase() && text.length > 0
36
+ * ? { type: "flag", reason: "all caps", matches: [{ rule: "no-shouting" }] }
37
+ * : { type: "allow" };
38
+ * },
39
+ * };
40
+ */
41
+ interface GuardrailDetector {
42
+ /**
43
+ * Kebab-case identifier, used as the rule prefix in {@link GuardrailMatch}
44
+ * and surfaced in logs / events — e.g. `"pii"`, `"topic"`, `"injection"`,
45
+ * `"moderation.openai"`.
46
+ */
47
+ readonly name: string;
48
+ /**
49
+ * Inspect `text` and return a verdict. Receives the
50
+ * {@link GuardrailDetectorContext} so it can branch on the phase or read
51
+ * the surrounding run state.
52
+ */
53
+ check(text: string, detectorCtx: GuardrailDetectorContext): GuardrailVerdict | Promise<GuardrailVerdict>;
54
+ }
55
+ /**
56
+ * A {@link GuardrailDetector} whose `check()` is **synchronous** — it returns a
57
+ * {@link GuardrailVerdict} directly, never a `Promise`. Used by the built-in
58
+ * zero-dependency detectors (`pii`, `topic`, `injection`) that inspect text
59
+ * with pure string / regex matching and have no async work to do.
60
+ *
61
+ * Because the return type is covariant, a `SyncGuardrailDetector` is
62
+ * structurally assignable to {@link GuardrailDetector}: anything that accepts a
63
+ * `GuardrailDetector` (the guard factory's `input` / `output` / `tool` arrays)
64
+ * accepts a `SyncGuardrailDetector` unchanged. Callers that hold the concrete
65
+ * sync type additionally get to read `verdict.type` / `.matches` / `.text`
66
+ * without awaiting.
67
+ */
68
+ interface SyncGuardrailDetector extends GuardrailDetector {
69
+ /**
70
+ * Inspect `text` and return a verdict synchronously. Receives the
71
+ * {@link GuardrailDetectorContext} so it can branch on the phase or read
72
+ * the surrounding run state.
73
+ */
74
+ check(text: string, detectorCtx: GuardrailDetectorContext): GuardrailVerdict;
75
+ }
76
+ //#endregion
77
+ export { GuardrailDetector, GuardrailDetectorContext, SyncGuardrailDetector };
78
+ //# sourceMappingURL=guardrail.contract.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guardrail.contract.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/guard/contracts/guardrail.contract.ts"],"mappings":";;;;;;AAaA;;;;;;;;UAAiB,wBAAA;EAIoB;EAAA,SAF1B,KAAA,EAAO,cAAA;EAyBgB;EAAA,SAvBvB,GAAA,EAAK,qBAAqB;AAAA;;;;;;;;;;;;;;;AAsCW;AAgBhD;;;;;UA/BiB,iBAAA;EA+B+C;;;;;EAAA,SAzBrD,IAAA;EA+BW;;;AAAwD;;EAzB5E,KAAA,CACE,IAAA,UACA,WAAA,EAAa,wBAAA,GACZ,gBAAA,GAAmB,OAAA,CAAQ,gBAAA;AAAA;;;;;;;;;;;;;;UAgBf,qBAAA,SAA8B,iBAAA;;;;;;EAM7C,KAAA,CAAM,IAAA,UAAc,WAAA,EAAa,wBAAA,GAA2B,gBAAA;AAAA"}
@@ -0,0 +1,4 @@
1
+ import { GuardrailAction, GuardrailMatch, GuardrailPhase, GuardrailVerdict } from "./verdict.type.mjs";
2
+ import { GuardrailDetector, GuardrailDetectorContext, SyncGuardrailDetector } from "./guardrail.contract.mjs";
3
+ import { OpenAiClientLike, OpenAiModerationCreateBody, OpenAiModerationResponse, OpenAiModerationResult } from "./openai-client.contract.mjs";
4
+ import { GuardOptions, GuardrailBlockEvent, GuardrailEscalation, InjectionDetectorOptions, OpenAiModerationOptions, PiiCategory, PiiDetectorOptions, TopicFilterOptions } from "./guard-options.type.mjs";
@@ -0,0 +1,51 @@
1
+ //#region ../@warlock.js/ai/src/guard/contracts/openai-client.contract.d.ts
2
+ /**
3
+ * Minimal structural view of the part of the `openai` SDK the
4
+ * `moderation` detector actually calls. Declared locally (rather than
5
+ * importing the SDK's own types) so `@warlock.js/ai` type-checks even
6
+ * when `openai` is **not** installed — it is an OPTIONAL peer, lazily
7
+ * imported at runtime. The shape tracks the OpenAI Node SDK v4:
8
+ * `client.moderations.create({ model, input })` resolves to a response whose
9
+ * `results[]` each carry a `flagged` boolean and per-category `categories` /
10
+ * `category_scores` maps.
11
+ *
12
+ * Surfacing it as a contract lets a caller pass a ready
13
+ * {@link OpenAiClientLike} (real `OpenAI` instance, mock, or proxy) on
14
+ * `OpenAiModerationOptions.client` to bypass the lazy import entirely.
15
+ */
16
+ /**
17
+ * A pre-built OpenAI-compatible client — any object exposing
18
+ * `moderations.create`. Passing one on `OpenAiModerationOptions.client` lets
19
+ * the detector skip the lazy `import("openai")` entirely (so bring-your-own-
20
+ * client callers and hermetic tests never need the SDK on disk).
21
+ */
22
+ interface OpenAiClientLike {
23
+ readonly moderations: {
24
+ create(body: OpenAiModerationCreateBody): Promise<OpenAiModerationResponse>;
25
+ };
26
+ }
27
+ /** Subset of the moderation-create body the detector populates. */
28
+ interface OpenAiModerationCreateBody {
29
+ /** Moderation model id (e.g. `"omni-moderation-latest"`). */
30
+ readonly model: string;
31
+ /** The text to moderate. */
32
+ readonly input: string;
33
+ }
34
+ /** Subset of the moderation response the detector reads. */
35
+ interface OpenAiModerationResponse {
36
+ readonly results: readonly OpenAiModerationResult[];
37
+ }
38
+ /**
39
+ * One moderation result. `flagged` is the SDK's overall verdict; `categories`
40
+ * maps each policy category to whether it tripped; `category_scores` carries
41
+ * the per-category confidence, surfaced on each {@link GuardrailMatch.label}'s
42
+ * companion data when present.
43
+ */
44
+ interface OpenAiModerationResult {
45
+ readonly flagged: boolean;
46
+ readonly categories: Record<string, boolean>;
47
+ readonly category_scores?: Record<string, number>;
48
+ }
49
+ //#endregion
50
+ export { OpenAiClientLike, OpenAiModerationCreateBody, OpenAiModerationResponse, OpenAiModerationResult };
51
+ //# sourceMappingURL=openai-client.contract.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openai-client.contract.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/guard/contracts/openai-client.contract.ts"],"mappings":";;AAqBA;;;;;;;;;;;;;;;AAE8E;AAK9E;;;UAPiB,gBAAA;EAAA,SACN,WAAA;IACP,MAAA,CAAO,IAAA,EAAM,0BAAA,GAA6B,OAAA,CAAQ,wBAAA;EAAA;AAAA;;UAKrC,0BAAA;EAkBA;EAAA,SAhBN,KAAA;;WAEA,KAAK;AAAA;;UAIC,wBAAA;EAAA,SACN,OAAA,WAAkB,sBAAsB;AAAA;;AAYhB;;;;;UAHlB,sBAAA;EAAA,SACN,OAAA;EAAA,SACA,UAAA,EAAY,MAAA;EAAA,SACZ,eAAA,GAAkB,MAAM;AAAA"}
@@ -0,0 +1,76 @@
1
+ //#region ../@warlock.js/ai/src/guard/contracts/verdict.type.d.ts
2
+ /**
3
+ * Where a detector is running. Widens the core guardrail phase
4
+ * (`"input" | "output"`) with a third value, `"tool"`, for detectors that
5
+ * inspect the arguments the model produced for a tool call. Reused on the
6
+ * `GuardrailViolationError.phase` surfaced to callers and on any emitted
7
+ * escalation event.
8
+ */
9
+ type GuardrailPhase = "input" | "output" | "tool";
10
+ /**
11
+ * The four actions a detector can return, the discriminator of
12
+ * {@link GuardrailVerdict}.
13
+ *
14
+ * - `allow` — content is clean; continue to the next detector.
15
+ * - `redact` — rewrite the inspected text and continue.
16
+ * - `block` — reject the trip / tool call with a `GuardrailViolationError`.
17
+ * - `flag` — allow the content but record the match for a downstream observer.
18
+ *
19
+ * `type` is always the discriminator — never `kind`.
20
+ */
21
+ type GuardrailAction = "allow" | "redact" | "block" | "flag";
22
+ /**
23
+ * A single thing a detector matched inside the inspected text. Surfaced in
24
+ * logs, events, and on `redact` / `flag` verdicts so an operator can see
25
+ * *what* tripped a rule without re-running the detector.
26
+ */
27
+ interface GuardrailMatch {
28
+ /**
29
+ * The detector rule that produced the match, namespaced under the
30
+ * detector — e.g. `"pii.ssn"`, `"topic.deny.medical"`,
31
+ * `"injection.jailbreak"`.
32
+ */
33
+ readonly rule: string;
34
+ /**
35
+ * Inclusive `[start, end]` character offsets into the inspected text,
36
+ * when the detector can locate the match. Omitted for whole-text
37
+ * verdicts (e.g. an allow-list miss or a moderation-model category).
38
+ */
39
+ readonly span?: readonly [start: number, end: number];
40
+ /**
41
+ * Free-form category surfaced in logs and events and substituted into a
42
+ * redaction `mask` template — e.g. `"ssn"`, `"email"`, `"violence"`.
43
+ */
44
+ readonly label?: string;
45
+ }
46
+ /**
47
+ * The verdict a {@link GuardrailDetector} returns from `check()` — a
48
+ * discriminated union with exactly one {@link GuardrailAction} per shape.
49
+ * The factory folds a detector array and acts on the first non-`allow`
50
+ * verdict (short-circuit, in registration order).
51
+ */
52
+ type GuardrailVerdict = {
53
+ /** Content is clean; continue to the next detector. */readonly type: "allow";
54
+ } | {
55
+ /** Rewrite the inspected text and continue. */readonly type: "redact"; /** The inspected text with every match replaced (detector-produced). */
56
+ readonly text: string; /** Human-readable explanation of what was redacted and why. */
57
+ readonly reason: string; /** The matches the detector replaced. */
58
+ readonly matches: readonly GuardrailMatch[];
59
+ } | {
60
+ /** Reject the trip / tool call. */readonly type: "block"; /** Human-readable reason surfaced on `GuardrailViolationError.reason`. */
61
+ readonly reason: string; /** The matches that triggered the block, when known. */
62
+ readonly matches?: readonly GuardrailMatch[];
63
+ /**
64
+ * Ask the host to route this block to a human-review surface. When
65
+ * `true`, the factory awaits `escalation.onBlock` before throwing.
66
+ * Default `false`.
67
+ */
68
+ readonly escalate?: boolean;
69
+ } | {
70
+ /** Allow the content but record the match for a downstream observer. */readonly type: "flag"; /** Human-readable explanation of what was flagged. */
71
+ readonly reason: string; /** The matches the detector recorded. */
72
+ readonly matches: readonly GuardrailMatch[];
73
+ };
74
+ //#endregion
75
+ export { GuardrailAction, GuardrailMatch, GuardrailPhase, GuardrailVerdict };
76
+ //# sourceMappingURL=verdict.type.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verdict.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/guard/contracts/verdict.type.ts"],"mappings":";;AAOA;;;;AAA0B;AAa1B;KAbY,cAAA;;;AAae;AAO3B;;;;;;;;KAPY,eAAA;;AAwBI;AAShB;;;UA1BiB,cAAA;EA+CiB;;;;;EAAA,SAzCvB,IAAA;EA6BI;;;;;EAAA,SAvBJ,IAAA,aAAiB,KAAA,UAAe,GAAA;EAmC5B;;;;EAAA,SA9BJ,KAAA;AAAA;;;AA4CoC;;;;KAnCnC,gBAAA;kEAGG,IAAA;AAAA;0DAIA,IAAA;WAEA,IAAA;WAEA,MAAA;WAEA,OAAA,WAAkB,cAAA;AAAA;8CAIlB,IAAA;WAEA,MAAA;WAEA,OAAA,YAAmB,cAAA;;;;;;WAMnB,QAAA;AAAA;mFAIA,IAAA;WAEA,MAAA;WAEA,OAAA,WAAkB,cAAA;AAAA"}
@@ -0,0 +1,4 @@
1
+ import { injection } from "./injection.mjs";
2
+ import { pii } from "./pii.mjs";
3
+ import { topic } from "./topic.mjs";
4
+ import { moderation } from "./moderation.mjs";
@@ -0,0 +1,6 @@
1
+ import { injection } from "./injection.mjs";
2
+ import { pii } from "./pii.mjs";
3
+ import { topic } from "./topic.mjs";
4
+ import { moderation } from "./moderation.mjs";
5
+
6
+ export { };
@@ -0,0 +1,34 @@
1
+ import { SyncGuardrailDetector } from "../contracts/guardrail.contract.mjs";
2
+ import { InjectionDetectorOptions } from "../contracts/guard-options.type.mjs";
3
+ //#region ../@warlock.js/ai/src/guard/detectors/injection.d.ts
4
+ /**
5
+ * Build the built-in `injection` detector (surfaced as
6
+ * `ai.guardrail.injection(options?)`). Matches a curated set of jailbreak /
7
+ * prompt-injection marker phrases — override (`"ignore previous
8
+ * instructions"`), role-reset (`"you are now"`), jailbreak (`"developer
9
+ * mode"`, `"do anything now"`), and exfiltration (`"reveal your system
10
+ * prompt"`) — extensible with caller `markers` (case-insensitive substrings
11
+ * or `RegExp`s).
12
+ *
13
+ * Zero runtime dependency: matching is pure string / regex. On a hit the
14
+ * verdict is `flag` by default (record but allow); pass `onMatch: "block"`
15
+ * to reject instead — commonly used on the `input` phase, where the core
16
+ * `trip.before` seam supports `block` / `flag` only.
17
+ *
18
+ * @param options - Extra `markers` and the `onMatch` action (`"flag"` | `"block"`).
19
+ * @returns A {@link SyncGuardrailDetector} for the guard's `input` / `output` / `tool` arrays.
20
+ *
21
+ * @example
22
+ * const guard = ai.guardrail({
23
+ * input: [ai.guardrail.injection({ onMatch: "block" })],
24
+ * output: [ai.guardrail.injection()], // flag-only on the model's reply
25
+ * });
26
+ *
27
+ * @example
28
+ * // Extend the built-in set with a house rule.
29
+ * ai.guardrail.injection({ markers: [/system\s*:\s*override/i, "sudo mode"] });
30
+ */
31
+ declare function injection(options?: InjectionDetectorOptions): SyncGuardrailDetector;
32
+ //#endregion
33
+ export { injection };
34
+ //# sourceMappingURL=injection.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"injection.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/guard/detectors/injection.ts"],"mappings":";;;;;;;AAiNA;;;;;;;;AAEwB;;;;;;;;;;;;;;;iBAFR,SAAA,CACd,OAAA,GAAU,wBAAA,GACT,qBAAqB"}