@warlock.js/ai 4.1.7 → 4.1.8

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 (224) hide show
  1. package/cjs/index.cjs +86 -86
  2. package/esm/agent/agent-config.type.d.mts +1 -1
  3. package/esm/agent/agent-input-builder.mjs +1 -1
  4. package/esm/agent/agent-log-event.mjs +1 -1
  5. package/esm/agent/agent-stream.d.mts +1 -1
  6. package/esm/agent/agent-stream.mjs +1 -1
  7. package/esm/agent/agent-to-stream-event.mjs +1 -1
  8. package/esm/agent/agent.d.mts +1 -1
  9. package/esm/agent/agent.mjs +1 -1
  10. package/esm/agent/json-stream-guard.mjs +1 -1
  11. package/esm/ai.d.mts +1 -1
  12. package/esm/ai.mjs +1 -1
  13. package/esm/config.d.mts +1 -1
  14. package/esm/config.mjs +1 -1
  15. package/esm/contracts/agent/agent-options.type.d.mts +1 -1
  16. package/esm/contracts/agent/agent.contract.d.mts +1 -1
  17. package/esm/contracts/attachment.type.d.mts +1 -1
  18. package/esm/contracts/content-part.type.d.mts +1 -1
  19. package/esm/contracts/conversation-message.type.d.mts +1 -1
  20. package/esm/contracts/embedder.contract.d.mts +1 -1
  21. package/esm/contracts/end.type.d.mts +1 -1
  22. package/esm/contracts/end.type.mjs +1 -1
  23. package/esm/contracts/events/agent-events.type.d.mts +1 -1
  24. package/esm/contracts/events/complete-event.type.d.mts +1 -1
  25. package/esm/contracts/events/event-identity.type.d.mts +1 -1
  26. package/esm/contracts/events/event-map.type.d.mts +1 -1
  27. package/esm/contracts/events/supervisor-events.type.d.mts +1 -1
  28. package/esm/contracts/events/usage-event.type.d.mts +1 -1
  29. package/esm/contracts/events/workflow-events.type.d.mts +1 -1
  30. package/esm/contracts/executable.contract.d.mts +1 -1
  31. package/esm/contracts/finish-reason.type.d.mts +1 -1
  32. package/esm/contracts/middleware/middleware-context.type.d.mts +1 -1
  33. package/esm/contracts/middleware/middleware-state.type.d.mts +1 -1
  34. package/esm/contracts/middleware/middleware.contract.d.mts +1 -1
  35. package/esm/contracts/model-tool-call-request.type.d.mts +1 -1
  36. package/esm/contracts/model.contract.d.mts +1 -1
  37. package/esm/contracts/placeholders.type.d.mts +1 -1
  38. package/esm/contracts/result/agent-result.type.d.mts +1 -1
  39. package/esm/contracts/result/attempt-entry.type.d.mts +1 -1
  40. package/esm/contracts/result/base-report.type.d.mts +1 -1
  41. package/esm/contracts/result/base-report.type.mjs +1 -1
  42. package/esm/contracts/result/base-result.type.d.mts +1 -1
  43. package/esm/contracts/result/execute-result.type.d.mts +1 -1
  44. package/esm/contracts/result/execution-report.type.d.mts +1 -1
  45. package/esm/contracts/result/llm-trip.type.d.mts +1 -1
  46. package/esm/contracts/result/model-pricing.type.d.mts +1 -1
  47. package/esm/contracts/result/session-send-result.type.d.mts +1 -1
  48. package/esm/contracts/result/step-result.type.d.mts +1 -1
  49. package/esm/contracts/result/supervisor-result.type.d.mts +1 -1
  50. package/esm/contracts/result/tool-call.type.d.mts +1 -1
  51. package/esm/contracts/result/usage.type.d.mts +1 -1
  52. package/esm/contracts/result/workflow-result.type.d.mts +1 -1
  53. package/esm/contracts/sdk-adapter.contract.d.mts +1 -1
  54. package/esm/contracts/stream/stream-event.type.d.mts +1 -1
  55. package/esm/contracts/stream/stream.contract.d.mts +1 -1
  56. package/esm/contracts/streaming-tool-guard-config.type.d.mts +1 -1
  57. package/esm/contracts/supervisor/ack-entry.type.d.mts +1 -1
  58. package/esm/contracts/supervisor/classifier-context.type.d.mts +1 -1
  59. package/esm/contracts/supervisor/dispatch-context.type.d.mts +1 -1
  60. package/esm/contracts/supervisor/evaluate-context.type.d.mts +1 -1
  61. package/esm/contracts/supervisor/intent-entry.type.d.mts +1 -1
  62. package/esm/contracts/supervisor/iteration-snapshot.type.d.mts +1 -1
  63. package/esm/contracts/supervisor/next.type.d.mts +1 -1
  64. package/esm/contracts/supervisor/route-context.type.d.mts +1 -1
  65. package/esm/contracts/supervisor/router-entry.type.d.mts +1 -1
  66. package/esm/contracts/supervisor/supervisor-config.type.d.mts +1 -1
  67. package/esm/contracts/supervisor/supervisor-execute-options.type.d.mts +1 -1
  68. package/esm/contracts/supervisor/supervisor-input.type.d.mts +1 -1
  69. package/esm/contracts/supervisor/supervisor-snapshot.type.d.mts +1 -1
  70. package/esm/contracts/supervisor/supervisor-stream-event.type.d.mts +1 -1
  71. package/esm/contracts/supervisor/supervisor.contract.d.mts +1 -1
  72. package/esm/contracts/system-prompt.contract.d.mts +1 -1
  73. package/esm/contracts/tool.contract.d.mts +1 -1
  74. package/esm/contracts/workflow/next-step-result.type.d.mts +1 -1
  75. package/esm/contracts/workflow/retry-config.type.d.mts +1 -1
  76. package/esm/contracts/workflow/step.contract.d.mts +1 -1
  77. package/esm/contracts/workflow/workflow-context.type.d.mts +1 -1
  78. package/esm/contracts/workflow/workflow-snapshot.type.d.mts +1 -1
  79. package/esm/contracts/workflow/workflow.contract.d.mts +1 -1
  80. package/esm/errors/agent-cancelled-error.d.mts +1 -1
  81. package/esm/errors/agent-cancelled-error.mjs +1 -1
  82. package/esm/errors/agent-execution-error.d.mts +1 -1
  83. package/esm/errors/agent-execution-error.mjs +1 -1
  84. package/esm/errors/agent-max-trips-error.d.mts +1 -1
  85. package/esm/errors/agent-max-trips-error.mjs +1 -1
  86. package/esm/errors/ai-error.d.mts +1 -1
  87. package/esm/errors/ai-error.mjs +1 -1
  88. package/esm/errors/budget-exceeded-error.d.mts +1 -1
  89. package/esm/errors/budget-exceeded-error.mjs +1 -1
  90. package/esm/errors/content-filter-error.d.mts +1 -1
  91. package/esm/errors/content-filter-error.mjs +1 -1
  92. package/esm/errors/context-length-exceeded-error.d.mts +1 -1
  93. package/esm/errors/context-length-exceeded-error.mjs +1 -1
  94. package/esm/errors/error-category.type.d.mts +1 -1
  95. package/esm/errors/error-code.type.d.mts +1 -1
  96. package/esm/errors/guardrail-violation-error.d.mts +1 -1
  97. package/esm/errors/guardrail-violation-error.mjs +1 -1
  98. package/esm/errors/invalid-request-error.d.mts +1 -1
  99. package/esm/errors/invalid-request-error.mjs +1 -1
  100. package/esm/errors/max-iterations-error.d.mts +1 -1
  101. package/esm/errors/max-iterations-error.mjs +1 -1
  102. package/esm/errors/max-steps-exceeded-error.d.mts +1 -1
  103. package/esm/errors/max-steps-exceeded-error.mjs +1 -1
  104. package/esm/errors/provider-auth-error.d.mts +1 -1
  105. package/esm/errors/provider-auth-error.mjs +1 -1
  106. package/esm/errors/provider-error.d.mts +1 -1
  107. package/esm/errors/provider-error.mjs +1 -1
  108. package/esm/errors/provider-rate-limit-error.d.mts +1 -1
  109. package/esm/errors/provider-rate-limit-error.mjs +1 -1
  110. package/esm/errors/provider-timeout-error.d.mts +1 -1
  111. package/esm/errors/provider-timeout-error.mjs +1 -1
  112. package/esm/errors/quota-exceeded-error.d.mts +1 -1
  113. package/esm/errors/quota-exceeded-error.mjs +1 -1
  114. package/esm/errors/routing-error.d.mts +1 -1
  115. package/esm/errors/routing-error.mjs +1 -1
  116. package/esm/errors/schema-validation-error.d.mts +1 -1
  117. package/esm/errors/schema-validation-error.mjs +1 -1
  118. package/esm/errors/step-failed-error.d.mts +1 -1
  119. package/esm/errors/step-failed-error.mjs +1 -1
  120. package/esm/errors/supervisor-cancelled-error.d.mts +1 -1
  121. package/esm/errors/supervisor-cancelled-error.mjs +1 -1
  122. package/esm/errors/supervisor-drift-error.d.mts +1 -1
  123. package/esm/errors/supervisor-drift-error.mjs +1 -1
  124. package/esm/errors/supervisor-failed-error.d.mts +1 -1
  125. package/esm/errors/supervisor-failed-error.mjs +1 -1
  126. package/esm/errors/supervisor-routing-error.d.mts +1 -1
  127. package/esm/errors/supervisor-routing-error.mjs +1 -1
  128. package/esm/errors/tool-execution-error.d.mts +1 -1
  129. package/esm/errors/tool-execution-error.mjs +1 -1
  130. package/esm/errors/workflow-cancelled-error.d.mts +1 -1
  131. package/esm/errors/workflow-cancelled-error.mjs +1 -1
  132. package/esm/errors/workflow-drift-error.d.mts +1 -1
  133. package/esm/errors/workflow-drift-error.mjs +1 -1
  134. package/esm/errors/workflow-error.d.mts +1 -1
  135. package/esm/errors/workflow-error.mjs +1 -1
  136. package/esm/middleware/builtins/budget.d.mts +1 -1
  137. package/esm/middleware/builtins/budget.mjs +1 -1
  138. package/esm/middleware/builtins/guardrail.d.mts +1 -1
  139. package/esm/middleware/builtins/guardrail.mjs +1 -1
  140. package/esm/middleware/builtins/semantic-cache.d.mts +1 -1
  141. package/esm/middleware/builtins/semantic-cache.mjs +1 -1
  142. package/esm/middleware/helpers/compose.d.mts +1 -1
  143. package/esm/middleware/helpers/compose.mjs +1 -1
  144. package/esm/middleware/helpers/for-tool.d.mts +1 -1
  145. package/esm/middleware/helpers/for-tool.mjs +1 -1
  146. package/esm/middleware/pipeline.d.mts +1 -1
  147. package/esm/middleware/pipeline.mjs +1 -1
  148. package/esm/middleware/utils/extract-user-text.d.mts +1 -1
  149. package/esm/middleware/utils/extract-user-text.mjs +1 -1
  150. package/esm/middleware/utils/namespaced-state.d.mts +1 -1
  151. package/esm/middleware/utils/namespaced-state.mjs +1 -1
  152. package/esm/mock/mock-agent.d.mts +1 -1
  153. package/esm/mock/mock-agent.mjs +1 -1
  154. package/esm/mock/mock-config.type.d.mts +1 -1
  155. package/esm/mock/mock-model.d.mts +1 -1
  156. package/esm/mock/mock-model.mjs +1 -1
  157. package/esm/mock/mock-sdk.d.mts +1 -1
  158. package/esm/mock/mock-sdk.mjs +1 -1
  159. package/esm/supervisor/as-tool.d.mts +1 -1
  160. package/esm/supervisor/as-tool.mjs +1 -1
  161. package/esm/supervisor/cancellation.d.mts +1 -1
  162. package/esm/supervisor/cancellation.mjs +1 -1
  163. package/esm/supervisor/decide.mjs +1 -1
  164. package/esm/supervisor/emitter.d.mts +1 -1
  165. package/esm/supervisor/emitter.mjs +1 -1
  166. package/esm/supervisor/entries.d.mts +1 -1
  167. package/esm/supervisor/entries.mjs +1 -1
  168. package/esm/supervisor/execution.d.mts +1 -1
  169. package/esm/supervisor/execution.mjs +1 -1
  170. package/esm/supervisor/router-prompt.d.mts +1 -1
  171. package/esm/supervisor/router-prompt.mjs +1 -1
  172. package/esm/supervisor/signature.d.mts +1 -1
  173. package/esm/supervisor/signature.mjs +1 -1
  174. package/esm/supervisor/snapshot.d.mts +1 -1
  175. package/esm/supervisor/snapshot.mjs +1 -1
  176. package/esm/supervisor/supervisor-stream.d.mts +1 -1
  177. package/esm/supervisor/supervisor-stream.mjs +1 -1
  178. package/esm/supervisor/supervisor.d.mts +1 -1
  179. package/esm/supervisor/supervisor.mjs +1 -1
  180. package/esm/system-prompt/instruction.d.mts +1 -1
  181. package/esm/system-prompt/instruction.mjs +1 -1
  182. package/esm/system-prompt/persona.d.mts +1 -1
  183. package/esm/system-prompt/persona.mjs +1 -1
  184. package/esm/system-prompt/render-placeholders.d.mts +1 -1
  185. package/esm/system-prompt/render-placeholders.mjs +1 -1
  186. package/esm/system-prompt/system-prompt.d.mts +1 -1
  187. package/esm/system-prompt/system-prompt.mjs +1 -1
  188. package/esm/tool/tool.d.mts +1 -1
  189. package/esm/tool/tool.mjs +1 -1
  190. package/esm/utils/compute-cost.d.mts +1 -1
  191. package/esm/utils/compute-cost.mjs +1 -1
  192. package/esm/utils/extract-json-payload.d.mts +1 -1
  193. package/esm/utils/extract-json-payload.mjs +1 -1
  194. package/esm/utils/generate-run-id.d.mts +1 -1
  195. package/esm/utils/generate-run-id.mjs +1 -1
  196. package/esm/utils/json-schema.d.mts +1 -1
  197. package/esm/utils/json-schema.mjs +1 -1
  198. package/esm/utils/prepare-attachment-part.d.mts +1 -1
  199. package/esm/utils/prepare-attachment-part.mjs +1 -1
  200. package/esm/utils/resolve-attachment.d.mts +1 -1
  201. package/esm/utils/resolve-attachment.mjs +1 -1
  202. package/esm/utils/safe-json-parse.d.mts +1 -1
  203. package/esm/utils/safe-json-parse.mjs +1 -1
  204. package/esm/utils/stamp-report-lineage.d.mts +1 -1
  205. package/esm/utils/stamp-report-lineage.mjs +1 -1
  206. package/esm/utils/token-count.d.mts +1 -1
  207. package/esm/utils/token-count.mjs +1 -1
  208. package/esm/workflow/as-tool.mjs +1 -1
  209. package/esm/workflow/cancellation.mjs +1 -1
  210. package/esm/workflow/emitter.mjs +1 -1
  211. package/esm/workflow/engine.mjs +1 -1
  212. package/esm/workflow/retry.mjs +1 -1
  213. package/esm/workflow/router.mjs +1 -1
  214. package/esm/workflow/run-scoped-emitter.mjs +1 -1
  215. package/esm/workflow/signature.d.mts +1 -1
  216. package/esm/workflow/signature.mjs +1 -1
  217. package/esm/workflow/snapshot.mjs +1 -1
  218. package/esm/workflow/state.mjs +1 -1
  219. package/esm/workflow/step-runner.mjs +1 -1
  220. package/esm/workflow/step.d.mts +1 -1
  221. package/esm/workflow/step.mjs +1 -1
  222. package/esm/workflow/workflow.d.mts +1 -1
  223. package/esm/workflow/workflow.mjs +1 -1
  224. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  import { AIError } from "./ai-error.mjs";
2
2
 
3
- //#region ../../@warlock.js/ai/src/errors/tool-execution-error.ts
3
+ //#region ../@warlock.js/ai/src/errors/tool-execution-error.ts
4
4
  /**
5
5
  * A registered tool's `execute()` threw during dispatch — the tool
6
6
  * code itself failed (not its input schema). The model's request was
@@ -2,7 +2,7 @@ import { ErrorCategory } from "./error-category.type.mjs";
2
2
  import { AIErrorOptions } from "./ai-error.mjs";
3
3
  import { WorkflowError } from "./workflow-error.mjs";
4
4
 
5
- //#region ../../@warlock.js/ai/src/errors/workflow-cancelled-error.d.ts
5
+ //#region ../@warlock.js/ai/src/errors/workflow-cancelled-error.d.ts
6
6
  type WorkflowCancelledErrorOptions = AIErrorOptions & {
7
7
  cancelledAt: string;
8
8
  reason?: string;
@@ -1,6 +1,6 @@
1
1
  import { WorkflowError } from "./workflow-error.mjs";
2
2
 
3
- //#region ../../@warlock.js/ai/src/errors/workflow-cancelled-error.ts
3
+ //#region ../@warlock.js/ai/src/errors/workflow-cancelled-error.ts
4
4
  /**
5
5
  * Workflow was cancelled via `AbortSignal` before it could finish.
6
6
  * `cancelledAt` is ISO timestamp at abort; `reason` carries the
@@ -2,7 +2,7 @@ import { ErrorCategory } from "./error-category.type.mjs";
2
2
  import { AIErrorOptions } from "./ai-error.mjs";
3
3
  import { WorkflowError } from "./workflow-error.mjs";
4
4
 
5
- //#region ../../@warlock.js/ai/src/errors/workflow-drift-error.d.ts
5
+ //#region ../@warlock.js/ai/src/errors/workflow-drift-error.d.ts
6
6
  type WorkflowDriftErrorOptions = AIErrorOptions & {
7
7
  savedSignature: string;
8
8
  currentSignature: string;
@@ -1,6 +1,6 @@
1
1
  import { WorkflowError } from "./workflow-error.mjs";
2
2
 
3
- //#region ../../@warlock.js/ai/src/errors/workflow-drift-error.ts
3
+ //#region ../@warlock.js/ai/src/errors/workflow-drift-error.ts
4
4
  /**
5
5
  * `workflow.resume(runId)` found a snapshot whose structural signature
6
6
  * doesn't match the current workflow definition. Thrown without
@@ -1,7 +1,7 @@
1
1
  import { AIErrorCode } from "./error-code.type.mjs";
2
2
  import { AIError, AIErrorOptions } from "./ai-error.mjs";
3
3
 
4
- //#region ../../@warlock.js/ai/src/errors/workflow-error.d.ts
4
+ //#region ../@warlock.js/ai/src/errors/workflow-error.d.ts
5
5
  /**
6
6
  * Base class for all workflow-specific failures. Subclasses carry
7
7
  * precise codes; this base catches everything `workflow.execute()`
@@ -1,6 +1,6 @@
1
1
  import { AIError } from "./ai-error.mjs";
2
2
 
3
- //#region ../../@warlock.js/ai/src/errors/workflow-error.ts
3
+ //#region ../@warlock.js/ai/src/errors/workflow-error.ts
4
4
  /**
5
5
  * Base class for all workflow-specific failures. Subclasses carry
6
6
  * precise codes; this base catches everything `workflow.execute()`
@@ -1,5 +1,5 @@
1
1
  import { AgentMiddleware } from "../../contracts/middleware/middleware.contract.mjs";
2
- //#region ../../@warlock.js/ai/src/middleware/builtins/budget.d.ts
2
+ //#region ../@warlock.js/ai/src/middleware/builtins/budget.d.ts
3
3
  /**
4
4
  * Per-model pricing used to compute USD cost from token counts.
5
5
  * Caller-supplied — no bundled table. Keys are model names (the
@@ -2,7 +2,7 @@ import { BudgetExceededError } from "../../errors/budget-exceeded-error.mjs";
2
2
  import "../../errors/index.mjs";
3
3
  import { namespacedState } from "../utils/namespaced-state.mjs";
4
4
 
5
- //#region ../../@warlock.js/ai/src/middleware/builtins/budget.ts
5
+ //#region ../@warlock.js/ai/src/middleware/builtins/budget.ts
6
6
  function breach(limit, actual, unit, name) {
7
7
  throw new BudgetExceededError(`budget "${name}" exceeded — ${actual} ${unit} (cap: ${limit})`, {
8
8
  limit,
@@ -1,6 +1,6 @@
1
1
  import { MiddlewareTripContext } from "../../contracts/middleware/middleware-context.type.mjs";
2
2
  import { AgentMiddleware } from "../../contracts/middleware/middleware.contract.mjs";
3
- //#region ../../@warlock.js/ai/src/middleware/builtins/guardrail.d.ts
3
+ //#region ../@warlock.js/ai/src/middleware/builtins/guardrail.d.ts
4
4
  /**
5
5
  * Decision returned by a guardrail check function. `ok: true`
6
6
  * permits the call; `ok: false` rejects with a human-readable
@@ -2,7 +2,7 @@ import { GuardrailViolationError } from "../../errors/guardrail-violation-error.
2
2
  import "../../errors/index.mjs";
3
3
  import { extractUserText } from "../utils/extract-user-text.mjs";
4
4
 
5
- //#region ../../@warlock.js/ai/src/middleware/builtins/guardrail.ts
5
+ //#region ../@warlock.js/ai/src/middleware/builtins/guardrail.ts
6
6
  /**
7
7
  * Pre/post content guardrail for an agent run.
8
8
  *
@@ -2,7 +2,7 @@ import { EmbedderContract } from "../../contracts/embedder.contract.mjs";
2
2
  import { AgentMiddleware } from "../../contracts/middleware/middleware.contract.mjs";
3
3
  import { CacheDriver } from "@warlock.js/cache";
4
4
 
5
- //#region ../../@warlock.js/ai/src/middleware/builtins/semantic-cache.d.ts
5
+ //#region ../@warlock.js/ai/src/middleware/builtins/semantic-cache.d.ts
6
6
  /**
7
7
  * Configuration for `semanticCache()`.
8
8
  */
@@ -1,7 +1,7 @@
1
1
  import { extractUserText } from "../utils/extract-user-text.mjs";
2
2
  import { resolveDefaultStore } from "../../config.mjs";
3
3
 
4
- //#region ../../@warlock.js/ai/src/middleware/builtins/semantic-cache.ts
4
+ //#region ../@warlock.js/ai/src/middleware/builtins/semantic-cache.ts
5
5
  const DEFAULT_NAMESPACE = "ai.cache";
6
6
  /**
7
7
  * Build a stable fingerprint for a prompt covering the full message
@@ -1,5 +1,5 @@
1
1
  import { AgentMiddleware } from "../../contracts/middleware/middleware.contract.mjs";
2
- //#region ../../@warlock.js/ai/src/middleware/helpers/compose.d.ts
2
+ //#region ../@warlock.js/ai/src/middleware/helpers/compose.d.ts
3
3
  /**
4
4
  * Flatten one or more middleware sources into a single ordered
5
5
  * array suitable for `agent({ middleware: [...] })`.
@@ -1,4 +1,4 @@
1
- //#region ../../@warlock.js/ai/src/middleware/helpers/compose.ts
1
+ //#region ../@warlock.js/ai/src/middleware/helpers/compose.ts
2
2
  /**
3
3
  * Flatten one or more middleware sources into a single ordered
4
4
  * array suitable for `agent({ middleware: [...] })`.
@@ -1,5 +1,5 @@
1
1
  import { AgentMiddleware } from "../../contracts/middleware/middleware.contract.mjs";
2
- //#region ../../@warlock.js/ai/src/middleware/helpers/for-tool.d.ts
2
+ //#region ../@warlock.js/ai/src/middleware/helpers/for-tool.d.ts
3
3
  /**
4
4
  * Scope a middleware's `tool`-level hooks to only fire for a
5
5
  * specific tool name (or a set of names). `execute` and `trip`
@@ -1,4 +1,4 @@
1
- //#region ../../@warlock.js/ai/src/middleware/helpers/for-tool.ts
1
+ //#region ../@warlock.js/ai/src/middleware/helpers/for-tool.ts
2
2
  /**
3
3
  * Scope a middleware's `tool`-level hooks to only fire for a
4
4
  * specific tool name (or a set of names). `execute` and `trip`
@@ -2,7 +2,7 @@ import { MiddlewareExecuteContext, MiddlewareToolContext, MiddlewareTripContext
2
2
  import { AgentMiddleware } from "../contracts/middleware/middleware.contract.mjs";
3
3
  import { Logger } from "@warlock.js/logger";
4
4
 
5
- //#region ../../@warlock.js/ai/src/middleware/pipeline.d.ts
5
+ //#region ../@warlock.js/ai/src/middleware/pipeline.d.ts
6
6
  /**
7
7
  * The three levels at which agent middleware can hook — mirrors
8
8
  * `AgentMiddleware`'s optional `execute` / `trip` / `tool` keys.
@@ -1,4 +1,4 @@
1
- //#region ../../@warlock.js/ai/src/middleware/pipeline.ts
1
+ //#region ../@warlock.js/ai/src/middleware/pipeline.ts
2
2
  const LOG_MODULE = "ai.middleware";
3
3
  /**
4
4
  * Run an inner async operation through a stack of agent middlewares
@@ -1,6 +1,6 @@
1
1
  import { Message } from "../../contracts/conversation-message.type.mjs";
2
2
 
3
- //#region ../../@warlock.js/ai/src/middleware/utils/extract-user-text.d.ts
3
+ //#region ../@warlock.js/ai/src/middleware/utils/extract-user-text.d.ts
4
4
  /**
5
5
  * Pull the text a content-inspection middleware should care about
6
6
  * from the outbound message list.
@@ -1,4 +1,4 @@
1
- //#region ../../@warlock.js/ai/src/middleware/utils/extract-user-text.ts
1
+ //#region ../@warlock.js/ai/src/middleware/utils/extract-user-text.ts
2
2
  /**
3
3
  * Pull the text a content-inspection middleware should care about
4
4
  * from the outbound message list.
@@ -1,5 +1,5 @@
1
1
  import { MiddlewareState } from "../../contracts/middleware/middleware-state.type.mjs";
2
- //#region ../../@warlock.js/ai/src/middleware/utils/namespaced-state.d.ts
2
+ //#region ../@warlock.js/ai/src/middleware/utils/namespaced-state.d.ts
3
3
  /**
4
4
  * Typed accessor over `ctx.state` for a single namespace key. Wraps
5
5
  * the raw `Map<string, unknown>` so middleware authors stop typing
@@ -1,4 +1,4 @@
1
- //#region ../../@warlock.js/ai/src/middleware/utils/namespaced-state.ts
1
+ //#region ../@warlock.js/ai/src/middleware/utils/namespaced-state.ts
2
2
  /**
3
3
  * Typed accessor over `ctx.state` for a single namespace key. Wraps
4
4
  * the raw `Map<string, unknown>` so middleware authors stop typing
@@ -2,7 +2,7 @@ import { AgentContract } from "../contracts/agent/agent.contract.mjs";
2
2
  import { ToolContract } from "../tool/tool.mjs";
3
3
  import { MockModelResponse } from "./mock-config.type.mjs";
4
4
 
5
- //#region ../../@warlock.js/ai/src/mock/mock-agent.d.ts
5
+ //#region ../@warlock.js/ai/src/mock/mock-agent.d.ts
6
6
  /**
7
7
  * Test helper that wires `MockSDK` → mock model → `agent()` in one call.
8
8
  *
@@ -1,7 +1,7 @@
1
1
  import { agent } from "../agent/agent.mjs";
2
2
  import { MockSDK } from "./mock-sdk.mjs";
3
3
 
4
- //#region ../../@warlock.js/ai/src/mock/mock-agent.ts
4
+ //#region ../@warlock.js/ai/src/mock/mock-agent.ts
5
5
  /**
6
6
  * Test helper that wires `MockSDK` → mock model → `agent()` in one call.
7
7
  *
@@ -2,7 +2,7 @@ import { ModelToolCallRequest } from "../contracts/model-tool-call-request.type.
2
2
  import { Usage } from "../contracts/result/usage.type.mjs";
3
3
  import { FinishReason } from "../contracts/finish-reason.type.mjs";
4
4
  import { ModelCapabilities } from "../contracts/model.contract.mjs";
5
- //#region ../../@warlock.js/ai/src/mock/mock-config.type.d.ts
5
+ //#region ../@warlock.js/ai/src/mock/mock-config.type.d.ts
6
6
  /**
7
7
  * Configuration for a single mock model response.
8
8
  * Responses are consumed in order — last one repeats if list is exhausted.
@@ -2,7 +2,7 @@ import { Message } from "../contracts/conversation-message.type.mjs";
2
2
  import { ModelCallOptions, ModelCapabilities, ModelContract, ModelResponse, ModelStreamChunk } from "../contracts/model.contract.mjs";
3
3
  import { MockModelResponse } from "./mock-config.type.mjs";
4
4
 
5
- //#region ../../@warlock.js/ai/src/mock/mock-model.d.ts
5
+ //#region ../@warlock.js/ai/src/mock/mock-model.d.ts
6
6
  type RecordedCall = {
7
7
  messages: Message[];
8
8
  options?: ModelCallOptions;
@@ -1,4 +1,4 @@
1
- //#region ../../@warlock.js/ai/src/mock/mock-model.ts
1
+ //#region ../@warlock.js/ai/src/mock/mock-model.ts
2
2
  /**
3
3
  * Deterministic in-memory `ModelContract` implementation for tests.
4
4
  *
@@ -2,7 +2,7 @@ import { SDKAdapterContract } from "../contracts/sdk-adapter.contract.mjs";
2
2
  import { MockSDKConfig } from "./mock-config.type.mjs";
3
3
  import { MockModel } from "./mock-model.mjs";
4
4
 
5
- //#region ../../@warlock.js/ai/src/mock/mock-sdk.d.ts
5
+ //#region ../@warlock.js/ai/src/mock/mock-sdk.d.ts
6
6
  /**
7
7
  * Creates a mock SDK adapter for testing — no HTTP calls, fully configurable.
8
8
  *
@@ -1,7 +1,7 @@
1
1
  import { approximateTokenCount } from "../utils/token-count.mjs";
2
2
  import { MockModel } from "./mock-model.mjs";
3
3
 
4
- //#region ../../@warlock.js/ai/src/mock/mock-sdk.ts
4
+ //#region ../@warlock.js/ai/src/mock/mock-sdk.ts
5
5
  /**
6
6
  * Creates a mock SDK adapter for testing — no HTTP calls, fully configurable.
7
7
  *
@@ -1,7 +1,7 @@
1
1
  import { ToolContract } from "../tool/tool.mjs";
2
2
  import { SupervisorAsToolOptions, SupervisorContract } from "../contracts/supervisor/supervisor.contract.mjs";
3
3
 
4
- //#region ../../@warlock.js/ai/src/supervisor/as-tool.d.ts
4
+ //#region ../@warlock.js/ai/src/supervisor/as-tool.d.ts
5
5
  /**
6
6
  * Wrap a `SupervisorContract` as a `ToolContract` so an outer agent
7
7
  * can invoke it from its tool-call loop. Mirrors
@@ -2,7 +2,7 @@ import { SupervisorFailedError } from "../errors/supervisor-failed-error.mjs";
2
2
  import "../errors/index.mjs";
3
3
  import { compositeAsTool } from "../tool/tool.mjs";
4
4
 
5
- //#region ../../@warlock.js/ai/src/supervisor/as-tool.ts
5
+ //#region ../@warlock.js/ai/src/supervisor/as-tool.ts
6
6
  /**
7
7
  * Wrap a `SupervisorContract` as a `ToolContract` so an outer agent
8
8
  * can invoke it from its tool-call loop. Mirrors
@@ -1,5 +1,5 @@
1
1
  import { SupervisorCancelledError } from "../errors/supervisor-cancelled-error.mjs";
2
- //#region ../../@warlock.js/ai/src/supervisor/cancellation.d.ts
2
+ //#region ../@warlock.js/ai/src/supervisor/cancellation.d.ts
3
3
  /**
4
4
  * Build a `SupervisorCancelledError` from an `AbortSignal`. Extracts a
5
5
  * human-readable reason from `signal.reason` whether it was a string,
@@ -1,7 +1,7 @@
1
1
  import { SupervisorCancelledError } from "../errors/supervisor-cancelled-error.mjs";
2
2
  import "../errors/index.mjs";
3
3
 
4
- //#region ../../@warlock.js/ai/src/supervisor/cancellation.ts
4
+ //#region ../@warlock.js/ai/src/supervisor/cancellation.ts
5
5
  /**
6
6
  * Build a `SupervisorCancelledError` from an `AbortSignal`. Extracts a
7
7
  * human-readable reason from `signal.reason` whether it was a string,
@@ -5,7 +5,7 @@ import "../errors/index.mjs";
5
5
  import { END } from "../contracts/end.type.mjs";
6
6
  import { buildRouterContextMessage } from "./router-prompt.mjs";
7
7
 
8
- //#region ../../@warlock.js/ai/src/supervisor/decide.ts
8
+ //#region ../@warlock.js/ai/src/supervisor/decide.ts
9
9
  /**
10
10
  * Unified dispatch decision entry — calls either the `route` callback
11
11
  * or the `router` agent based on the supervisor's configured mode and
@@ -1,7 +1,7 @@
1
1
  import { SupervisorEventHandler, SupervisorEventHandlers } from "../contracts/supervisor/supervisor-config.type.mjs";
2
2
  import { SupervisorEventMap } from "../contracts/events/event-map.type.mjs";
3
3
 
4
- //#region ../../@warlock.js/ai/src/supervisor/emitter.d.ts
4
+ //#region ../@warlock.js/ai/src/supervisor/emitter.d.ts
5
5
  /**
6
6
  * Three-tier supervisor event emitter — factory (definition) → instance
7
7
  * → per-execution. Mirrors `WorkflowEmitter` structurally; the only
@@ -1,4 +1,4 @@
1
- //#region ../../@warlock.js/ai/src/supervisor/emitter.ts
1
+ //#region ../@warlock.js/ai/src/supervisor/emitter.ts
2
2
  /**
3
3
  * Three-tier supervisor event emitter — factory (definition) → instance
4
4
  * → per-execution. Mirrors `WorkflowEmitter` structurally; the only
@@ -7,7 +7,7 @@ import { IntentCallback, SupervisorIntentValue } from "../contracts/supervisor/i
7
7
  import { DispatchContext } from "../contracts/supervisor/dispatch-context.type.mjs";
8
8
  import { StandardSchemaV1 } from "@standard-schema/spec";
9
9
 
10
- //#region ../../@warlock.js/ai/src/supervisor/entries.d.ts
10
+ //#region ../@warlock.js/ai/src/supervisor/entries.d.ts
11
11
  /**
12
12
  * Normalized internal representation of one entry in a supervisor's
13
13
  * `intents` map — resolved at factory time from one of the accepted
@@ -1,7 +1,7 @@
1
1
  import { SupervisorFailedError } from "../errors/supervisor-failed-error.mjs";
2
2
  import "../errors/index.mjs";
3
3
 
4
- //#region ../../@warlock.js/ai/src/supervisor/entries.ts
4
+ //#region ../@warlock.js/ai/src/supervisor/entries.ts
5
5
  /**
6
6
  * Validate and normalize the `intents` map into resolved entries.
7
7
  * Runs at factory time — throws `SupervisorFailedError` on the first
@@ -7,7 +7,7 @@ import { SupervisorEmitter } from "./emitter.mjs";
7
7
  import { ResolvedIntentEntry } from "./entries.mjs";
8
8
  import { SupervisorStreamController } from "./supervisor-stream.mjs";
9
9
 
10
- //#region ../../@warlock.js/ai/src/supervisor/execution.d.ts
10
+ //#region ../@warlock.js/ai/src/supervisor/execution.d.ts
11
11
  type SupervisorExecutionParams<TOutput> = {
12
12
  config: SupervisorConfig<TOutput>;
13
13
  entries: Map<string, ResolvedIntentEntry>;
@@ -13,7 +13,7 @@ import { decide } from "./decide.mjs";
13
13
  import { persistSupervisorSnapshot } from "./snapshot.mjs";
14
14
  import { log } from "@warlock.js/logger";
15
15
 
16
- //#region ../../@warlock.js/ai/src/supervisor/execution.ts
16
+ //#region ../@warlock.js/ai/src/supervisor/execution.ts
17
17
  const DEFAULT_MAX_ITERATIONS = 10;
18
18
  const LOG_MODULE_BASE = "ai.supervisor";
19
19
  /**
@@ -2,7 +2,7 @@ import { IterationSnapshot } from "../contracts/supervisor/iteration-snapshot.ty
2
2
  import { SupervisorInput } from "../contracts/supervisor/supervisor-input.type.mjs";
3
3
  import { ResolvedIntentEntry } from "./entries.mjs";
4
4
 
5
- //#region ../../@warlock.js/ai/src/supervisor/router-prompt.d.ts
5
+ //#region ../@warlock.js/ai/src/supervisor/router-prompt.d.ts
6
6
  /**
7
7
  * Build the per-turn user message the supervisor feeds to the router
8
8
  * agent. Carries everything the LLM needs to make a routing decision:
@@ -1,6 +1,6 @@
1
1
  import { END } from "../contracts/end.type.mjs";
2
2
 
3
- //#region ../../@warlock.js/ai/src/supervisor/router-prompt.ts
3
+ //#region ../@warlock.js/ai/src/supervisor/router-prompt.ts
4
4
  /**
5
5
  * Build the per-turn user message the supervisor feeds to the router
6
6
  * agent. Carries everything the LLM needs to make a routing decision:
@@ -1,7 +1,7 @@
1
1
  import { SupervisorConfig } from "../contracts/supervisor/supervisor-config.type.mjs";
2
2
  import { ResolvedIntentEntry } from "./entries.mjs";
3
3
 
4
- //#region ../../@warlock.js/ai/src/supervisor/signature.d.ts
4
+ //#region ../@warlock.js/ai/src/supervisor/signature.d.ts
5
5
  /**
6
6
  * Deterministic structural fingerprint of a supervisor definition.
7
7
  * Persisted on every snapshot so `resume()` can detect drift between
@@ -1,4 +1,4 @@
1
- //#region ../../@warlock.js/ai/src/supervisor/signature.ts
1
+ //#region ../@warlock.js/ai/src/supervisor/signature.ts
2
2
  /**
3
3
  * Deterministic structural fingerprint of a supervisor definition.
4
4
  * Persisted on every snapshot so `resume()` can detect drift between
@@ -4,7 +4,7 @@ import { SupervisorConfig } from "../contracts/supervisor/supervisor-config.type
4
4
  import { SupervisorResumeOptions } from "../contracts/supervisor/supervisor-execute-options.type.mjs";
5
5
  import { SupervisorSnapshot, SupervisorSnapshotStatus } from "../contracts/supervisor/supervisor-snapshot.type.mjs";
6
6
 
7
- //#region ../../@warlock.js/ai/src/supervisor/snapshot.d.ts
7
+ //#region ../@warlock.js/ai/src/supervisor/snapshot.d.ts
8
8
  type PersistParams = {
9
9
  config: SupervisorConfig<unknown>;
10
10
  signature: string;
@@ -3,7 +3,7 @@ import { SupervisorDriftError } from "../errors/supervisor-drift-error.mjs";
3
3
  import "../errors/index.mjs";
4
4
  import { resolveDefaultStore } from "../config.mjs";
5
5
 
6
- //#region ../../@warlock.js/ai/src/supervisor/snapshot.ts
6
+ //#region ../@warlock.js/ai/src/supervisor/snapshot.ts
7
7
  /**
8
8
  * Resolve the effective snapshot store: the supervisor's own
9
9
  * `snapshotStore` field wins; absent that, fall back to the global
@@ -1,7 +1,7 @@
1
1
  import { StreamContract } from "../contracts/stream/stream.contract.mjs";
2
2
  import { SupervisorStreamEvent } from "../contracts/supervisor/supervisor-stream-event.type.mjs";
3
3
 
4
- //#region ../../@warlock.js/ai/src/supervisor/supervisor-stream.d.ts
4
+ //#region ../@warlock.js/ai/src/supervisor/supervisor-stream.d.ts
5
5
  /**
6
6
  * Internal async-queue controller driving `supervisor.stream()`.
7
7
  * Mirrors `StreamController` from `agent-stream.ts` — same
@@ -1,4 +1,4 @@
1
- //#region ../../@warlock.js/ai/src/supervisor/supervisor-stream.ts
1
+ //#region ../@warlock.js/ai/src/supervisor/supervisor-stream.ts
2
2
  /**
3
3
  * Factory mirroring `createAgentStream`. Returns a paired
4
4
  * `{ controller, stream }` — the `SupervisorExecution` pushes events
@@ -2,7 +2,7 @@ import { SupervisorIntentValue } from "../contracts/supervisor/intent-entry.type
2
2
  import { SupervisorConfig } from "../contracts/supervisor/supervisor-config.type.mjs";
3
3
  import { SupervisorContract } from "../contracts/supervisor/supervisor.contract.mjs";
4
4
 
5
- //#region ../../@warlock.js/ai/src/supervisor/supervisor.d.ts
5
+ //#region ../@warlock.js/ai/src/supervisor/supervisor.d.ts
6
6
  /**
7
7
  * `ai.supervisor(config)` — construct a `SupervisorContract`. Validates
8
8
  * the config at author time (throws `SupervisorFailedError` on bad
@@ -8,7 +8,7 @@ import { SupervisorExecution } from "./execution.mjs";
8
8
  import { computeSignature } from "./signature.mjs";
9
9
  import { createSupervisorStream } from "./supervisor-stream.mjs";
10
10
 
11
- //#region ../../@warlock.js/ai/src/supervisor/supervisor.ts
11
+ //#region ../@warlock.js/ai/src/supervisor/supervisor.ts
12
12
  /**
13
13
  * `ai.supervisor(config)` — construct a `SupervisorContract`. Validates
14
14
  * the config at author time (throws `SupervisorFailedError` on bad
@@ -1,7 +1,7 @@
1
1
  import { Placeholders } from "../contracts/placeholders.type.mjs";
2
2
  import { InstructionContract } from "../contracts/system-prompt.contract.mjs";
3
3
 
4
- //#region ../../@warlock.js/ai/src/system-prompt/instruction.d.ts
4
+ //#region ../@warlock.js/ai/src/system-prompt/instruction.d.ts
5
5
  /**
6
6
  * Concrete `InstructionContract` — a reusable directive block.
7
7
  *
@@ -1,6 +1,6 @@
1
1
  import { renderPlaceholders } from "./render-placeholders.mjs";
2
2
 
3
- //#region ../../@warlock.js/ai/src/system-prompt/instruction.ts
3
+ //#region ../@warlock.js/ai/src/system-prompt/instruction.ts
4
4
  /**
5
5
  * Concrete `InstructionContract` — a reusable directive block.
6
6
  *
@@ -1,7 +1,7 @@
1
1
  import { Placeholders } from "../contracts/placeholders.type.mjs";
2
2
  import { PersonaContract } from "../contracts/system-prompt.contract.mjs";
3
3
 
4
- //#region ../../@warlock.js/ai/src/system-prompt/persona.d.ts
4
+ //#region ../@warlock.js/ai/src/system-prompt/persona.d.ts
5
5
  /**
6
6
  * Concrete `PersonaContract` — a reusable "who the agent is" block.
7
7
  *
@@ -1,6 +1,6 @@
1
1
  import { renderPlaceholders } from "./render-placeholders.mjs";
2
2
 
3
- //#region ../../@warlock.js/ai/src/system-prompt/persona.ts
3
+ //#region ../@warlock.js/ai/src/system-prompt/persona.ts
4
4
  /**
5
5
  * Concrete `PersonaContract` — a reusable "who the agent is" block.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  import { Placeholders } from "../contracts/placeholders.type.mjs";
2
2
 
3
- //#region ../../@warlock.js/ai/src/system-prompt/render-placeholders.d.ts
3
+ //#region ../@warlock.js/ai/src/system-prompt/render-placeholders.d.ts
4
4
  /**
5
5
  * Render a template string against a placeholders map, supporting dot-path
6
6
  * lookups and inline fallback values.
@@ -1,4 +1,4 @@
1
- //#region ../../@warlock.js/ai/src/system-prompt/render-placeholders.ts
1
+ //#region ../@warlock.js/ai/src/system-prompt/render-placeholders.ts
2
2
  const PLACEHOLDER_PATTERN = /\{\{\s*([^{}]+?)\s*\}\}/g;
3
3
  /**
4
4
  * Render a template string against a placeholders map, supporting dot-path
@@ -1,7 +1,7 @@
1
1
  import { Placeholders } from "../contracts/placeholders.type.mjs";
2
2
  import { InstructionContract, PersonaContract, SystemPromptBlockContract, SystemPromptContract } from "../contracts/system-prompt.contract.mjs";
3
3
 
4
- //#region ../../@warlock.js/ai/src/system-prompt/system-prompt.d.ts
4
+ //#region ../@warlock.js/ai/src/system-prompt/system-prompt.d.ts
5
5
  /**
6
6
  * Concrete `SystemPromptContract` — an immutable layered prompt builder.
7
7
  *
@@ -1,7 +1,7 @@
1
1
  import { Instruction } from "./instruction.mjs";
2
2
  import { Persona } from "./persona.mjs";
3
3
 
4
- //#region ../../@warlock.js/ai/src/system-prompt/system-prompt.ts
4
+ //#region ../@warlock.js/ai/src/system-prompt/system-prompt.ts
5
5
  /**
6
6
  * Concrete `SystemPromptContract` — an immutable layered prompt builder.
7
7
  *
@@ -4,7 +4,7 @@ import { BaseReport } from "../contracts/result/base-report.type.mjs";
4
4
  import { ToolConfig, ToolContext } from "../contracts/tool.contract.mjs";
5
5
  import { StandardSchemaV1 } from "@standard-schema/spec";
6
6
 
7
- //#region ../../@warlock.js/ai/src/tool/tool.d.ts
7
+ //#region ../@warlock.js/ai/src/tool/tool.d.ts
8
8
  /**
9
9
  * Result returned by `ToolContract.invoke()`.
10
10
  *
package/esm/tool/tool.mjs CHANGED
@@ -3,7 +3,7 @@ import { ToolExecutionError } from "../errors/tool-execution-error.mjs";
3
3
  import "../errors/index.mjs";
4
4
  import { generateRunId } from "../utils/generate-run-id.mjs";
5
5
 
6
- //#region ../../@warlock.js/ai/src/tool/tool.ts
6
+ //#region ../@warlock.js/ai/src/tool/tool.ts
7
7
  /**
8
8
  * Degraded `ToolContext` supplied when no caller threads one through
9
9
  * (`tool.invoke(input)` standalone, batch scripts, tests). Per
@@ -1,7 +1,7 @@
1
1
  import { ModelPricing } from "../contracts/result/model-pricing.type.mjs";
2
2
  import { Usage } from "../contracts/result/usage.type.mjs";
3
3
 
4
- //#region ../../@warlock.js/ai/src/utils/compute-cost.d.ts
4
+ //#region ../@warlock.js/ai/src/utils/compute-cost.d.ts
5
5
  /**
6
6
  * Compute a per-channel USD cost breakdown for a single `Usage` against
7
7
  * a model's pricing table. Returns `undefined` when no pricing is
@@ -1,4 +1,4 @@
1
- //#region ../../@warlock.js/ai/src/utils/compute-cost.ts
1
+ //#region ../@warlock.js/ai/src/utils/compute-cost.ts
2
2
  /**
3
3
  * Compute a per-channel USD cost breakdown for a single `Usage` against
4
4
  * a model's pricing table. Returns `undefined` when no pricing is
@@ -1,4 +1,4 @@
1
- //#region ../../@warlock.js/ai/src/utils/extract-json-payload.d.ts
1
+ //#region ../@warlock.js/ai/src/utils/extract-json-payload.d.ts
2
2
  /**
3
3
  * Strip markdown code fences from an LLM response before JSON parsing.
4
4
  *