@warlock.js/ai 4.1.13 → 4.1.14

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 +1 -1
@@ -9,7 +9,7 @@ import { CompleteEvent } from "../contracts/events/complete-event.type.mjs";
9
9
  import { UsageEvent } from "../contracts/events/usage-event.type.mjs";
10
10
  import { StandardSchemaV1 } from "@standard-schema/spec";
11
11
 
12
- //#region ../@warlock.js/ai/src/agent/agent-config.type.d.ts
12
+ //#region ../../@warlock.js/ai/src/agent/agent-config.type.d.ts
13
13
  /**
14
14
  * Map of factory-level event handlers. Every key is optional; handlers
15
15
  * registered here fire on every `execute()` / `stream()` call made
@@ -4,7 +4,7 @@ import { extractJsonSchema } from "../utils/json-schema.mjs";
4
4
  import { prepareAttachmentPart } from "../utils/prepare-attachment-part.mjs";
5
5
  import "../utils/index.mjs";
6
6
 
7
- //#region ../@warlock.js/ai/src/agent/agent-input-builder.ts
7
+ //#region ../../@warlock.js/ai/src/agent/agent-input-builder.ts
8
8
  /**
9
9
  * Assemble the seed conversation for an agent execution. Runs exactly
10
10
  * once per run — subsequent trips append to the same message list.
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/agent/agent-log-event.ts
1
+ //#region ../../@warlock.js/ai/src/agent/agent-log-event.ts
2
2
  /**
3
3
  * Structured logging for agent lifecycle events. Mirrors
4
4
  * `Execution.emit`'s call sites without touching class state — the
@@ -1,6 +1,6 @@
1
1
  import { StreamEvent } from "../contracts/stream/stream-event.type.mjs";
2
2
  import { StreamContract } from "../contracts/stream/stream.contract.mjs";
3
- //#region ../@warlock.js/ai/src/agent/agent-stream.d.ts
3
+ //#region ../../@warlock.js/ai/src/agent/agent-stream.d.ts
4
4
  /**
5
5
  * Internal async-queue `StreamContract` used by `agent().stream()`.
6
6
  *
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/agent/agent-stream.ts
1
+ //#region ../../@warlock.js/ai/src/agent/agent-stream.ts
2
2
  function createAgentStream() {
3
3
  const queue = [];
4
4
  const pending = [];
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/agent/agent-to-stream-event.ts
1
+ //#region ../../@warlock.js/ai/src/agent/agent-to-stream-event.ts
2
2
  /**
3
3
  * Map an internal `AgentEventMap` entry into the public `StreamEvent`
4
4
  * shape. Event names are the same dot-notation strings on both sides;
@@ -1,7 +1,7 @@
1
1
  import { AgentContract } from "../contracts/agent/agent.contract.mjs";
2
2
  import { AgentConfig } from "./agent-config.type.mjs";
3
3
 
4
- //#region ../@warlock.js/ai/src/agent/agent.d.ts
4
+ //#region ../../@warlock.js/ai/src/agent/agent.d.ts
5
5
  /**
6
6
  * Creates an executable AI agent from the given configuration.
7
7
  *
@@ -19,7 +19,7 @@ import { agentEventToStreamEvent } from "./agent-to-stream-event.mjs";
19
19
  import { JsonStreamGuard } from "./json-stream-guard.mjs";
20
20
  import { log } from "@warlock.js/logger";
21
21
 
22
- //#region ../@warlock.js/ai/src/agent/agent.ts
22
+ //#region ../../@warlock.js/ai/src/agent/agent.ts
23
23
  const LOG_MODULE = "ai.agent";
24
24
  /**
25
25
  * Detect abort-flavored errors surfaced by SDK HTTP layers — the
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/agent/json-stream-guard.ts
1
+ //#region ../../@warlock.js/ai/src/agent/json-stream-guard.ts
2
2
  /**
3
3
  * Default cap on bytes accumulated in a single suspect buffer before
4
4
  * the guard gives up, flushes as text, and resets to pass-through.
package/esm/ai.d.mts CHANGED
@@ -13,7 +13,7 @@ import { systemPrompt } from "./system-prompt/system-prompt.mjs";
13
13
  import { step } from "./workflow/step.mjs";
14
14
  import { workflow } from "./workflow/workflow.mjs";
15
15
 
16
- //#region ../@warlock.js/ai/src/ai.d.ts
16
+ //#region ../../@warlock.js/ai/src/ai.d.ts
17
17
  /**
18
18
  * Top-level `ai` namespace — holds built-in factories and user-registered SDK adapters.
19
19
  *
package/esm/ai.mjs CHANGED
@@ -13,7 +13,7 @@ import { systemPrompt } from "./system-prompt/system-prompt.mjs";
13
13
  import { step } from "./workflow/step.mjs";
14
14
  import { workflow } from "./workflow/workflow.mjs";
15
15
 
16
- //#region ../@warlock.js/ai/src/ai.ts
16
+ //#region ../../@warlock.js/ai/src/ai.ts
17
17
  /**
18
18
  * Top-level `ai` namespace — holds built-in factories and user-registered SDK adapters.
19
19
  *
package/esm/config.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CacheDriver } from "@warlock.js/cache";
2
2
 
3
- //#region ../@warlock.js/ai/src/config.d.ts
3
+ //#region ../../@warlock.js/ai/src/config.d.ts
4
4
  /**
5
5
  * Process-wide `@warlock.js/ai` configuration. **Intentionally tiny.**
6
6
  * Lives here only for genuinely cross-cutting defaults that would
package/esm/config.mjs CHANGED
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/config.ts
1
+ //#region ../../@warlock.js/ai/src/config.ts
2
2
  const aiConfig = {};
3
3
  /**
4
4
  * Set or extend process-wide AI configuration. Merges over existing
@@ -7,7 +7,7 @@ import { AgentEventMap } from "../events/event-map.type.mjs";
7
7
  import { StreamingToolGuardConfig } from "../streaming-tool-guard-config.type.mjs";
8
8
  import { StandardSchemaV1 } from "@standard-schema/spec";
9
9
 
10
- //#region ../@warlock.js/ai/src/contracts/agent/agent-options.type.d.ts
10
+ //#region ../../@warlock.js/ai/src/contracts/agent/agent-options.type.d.ts
11
11
  /**
12
12
  * Options passed to AgentContract.execute() to configure a single execution run.
13
13
  *
@@ -4,7 +4,7 @@ import { StreamContract } from "../stream/stream.contract.mjs";
4
4
  import { AgentEventMap } from "../events/event-map.type.mjs";
5
5
  import { AgentExecuteOptions } from "./agent-options.type.mjs";
6
6
 
7
- //#region ../@warlock.js/ai/src/contracts/agent/agent.contract.d.ts
7
+ //#region ../../@warlock.js/ai/src/contracts/agent/agent.contract.d.ts
8
8
  /**
9
9
  * Handler function for a single agent event. Takes the event's typed
10
10
  * payload; return value is ignored.
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/contracts/attachment.type.d.ts
1
+ //#region ../../@warlock.js/ai/src/contracts/attachment.type.d.ts
2
2
  /**
3
3
  * Shape of a StorageFile object from @warlock.js/core.
4
4
  * Used to detect storage files in the Attachment union.
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/contracts/content-part.type.d.ts
1
+ //#region ../../@warlock.js/ai/src/contracts/content-part.type.d.ts
2
2
  /**
3
3
  * A single resolved piece of message content.
4
4
  *
@@ -1,7 +1,7 @@
1
1
  import { ContentPart } from "./content-part.type.mjs";
2
2
  import { ModelToolCallRequest } from "./model-tool-call-request.type.mjs";
3
3
 
4
- //#region ../@warlock.js/ai/src/contracts/conversation-message.type.d.ts
4
+ //#region ../../@warlock.js/ai/src/contracts/conversation-message.type.d.ts
5
5
  /**
6
6
  * A single message in a conversation history.
7
7
  *
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/contracts/embedder.contract.d.ts
1
+ //#region ../../@warlock.js/ai/src/contracts/embedder.contract.d.ts
2
2
  /** Token usage returned from an embedding request. */
3
3
  type EmbeddingUsage = {
4
4
  promptTokens: number;
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/contracts/end.type.d.ts
1
+ //#region ../../@warlock.js/ai/src/contracts/end.type.d.ts
2
2
  /**
3
3
  * Framework-global termination sentinel. Emitted by any primitive
4
4
  * whose control flow is routed through JSON-serializable strings —
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/contracts/end.type.ts
1
+ //#region ../../@warlock.js/ai/src/contracts/end.type.ts
2
2
  /**
3
3
  * Framework-global termination sentinel. Emitted by any primitive
4
4
  * whose control flow is routed through JSON-serializable strings —
@@ -3,7 +3,7 @@ import { ToolCall } from "../result/tool-call.type.mjs";
3
3
  import { LLMTrip } from "../result/llm-trip.type.mjs";
4
4
  import { AgentResult } from "../result/agent-result.type.mjs";
5
5
 
6
- //#region ../@warlock.js/ai/src/contracts/events/agent-events.type.d.ts
6
+ //#region ../../@warlock.js/ai/src/contracts/events/agent-events.type.d.ts
7
7
  /**
8
8
  * Lightweight tool metadata surfaced on tool-lifecycle events. A
9
9
  * deliberately thin slice of `ToolConfig` — name and description
@@ -1,6 +1,6 @@
1
1
  import { AgentResult } from "../result/agent-result.type.mjs";
2
2
 
3
- //#region ../@warlock.js/ai/src/contracts/events/complete-event.type.d.ts
3
+ //#region ../../@warlock.js/ai/src/contracts/events/complete-event.type.d.ts
4
4
  /**
5
5
  * Execution-completion payload for the `onComplete` agent hook (T1
6
6
  * of the 2026-05-08 ai-usage/runs/state/cart plan).
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/contracts/events/event-identity.type.d.ts
1
+ //#region ../../@warlock.js/ai/src/contracts/events/event-identity.type.d.ts
2
2
  /**
3
3
  * Run-scoped identity stamped onto every lifecycle event payload
4
4
  * (agent, workflow, supervisor) and every stream event.
@@ -3,7 +3,7 @@ import { EventIdentity } from "./event-identity.type.mjs";
3
3
  import { SupervisorAckCompletedPayload, SupervisorAckStreamingPayload, SupervisorAgentCompletedPayload, SupervisorAgentFailedPayload, SupervisorAgentStartingPayload, SupervisorAgentStreamingPayload, SupervisorCancelledPayload, SupervisorClassifierCompletedPayload, SupervisorClassifierFailedPayload, SupervisorClassifierStartingPayload, SupervisorClassifierStreamingPayload, SupervisorCompletedPayload, SupervisorErrorPayload, SupervisorEvaluateVerdictPayload, SupervisorIterationCompletedPayload, SupervisorIterationStartingPayload, SupervisorRouterDecidedPayload, SupervisorRouterDecidingPayload, SupervisorStartingPayload } from "./supervisor-events.type.mjs";
4
4
  import { WorkflowCancelledPayload, WorkflowCompletedPayload, WorkflowErrorPayload, WorkflowLoopWarningPayload, WorkflowStartingPayload, WorkflowStepCompletedPayload, WorkflowStepFailedPayload, WorkflowStepRetryingPayload, WorkflowStepSkippedPayload, WorkflowStepStartingPayload, WorkflowStepStreamingPayload } from "./workflow-events.type.mjs";
5
5
 
6
- //#region ../@warlock.js/ai/src/contracts/events/event-map.type.d.ts
6
+ //#region ../../@warlock.js/ai/src/contracts/events/event-map.type.d.ts
7
7
  /**
8
8
  * Apply run identity to every value of an event map. The central
9
9
  * `emit` chokepoint of each primitive injects `runId` / `rootRunId`,
@@ -5,7 +5,7 @@ import { IterationSnapshot } from "../supervisor/iteration-snapshot.type.mjs";
5
5
  import { SupervisorInput } from "../supervisor/supervisor-input.type.mjs";
6
6
  import { EvaluateResult } from "../supervisor/evaluate-context.type.mjs";
7
7
  import { SupervisorResult } from "../result/supervisor-result.type.mjs";
8
- //#region ../@warlock.js/ai/src/contracts/events/supervisor-events.type.d.ts
8
+ //#region ../../@warlock.js/ai/src/contracts/events/supervisor-events.type.d.ts
9
9
  /** Fires once at the start of every `supervisor.execute()` call. */
10
10
  type SupervisorStartingPayload = {
11
11
  supervisorName: string;
@@ -1,6 +1,6 @@
1
1
  import { Usage } from "../result/usage.type.mjs";
2
2
 
3
- //#region ../@warlock.js/ai/src/contracts/events/usage-event.type.d.ts
3
+ //#region ../../@warlock.js/ai/src/contracts/events/usage-event.type.d.ts
4
4
  /**
5
5
  * Per-trip telemetry payload for the `onUsage` agent hook (T1 of the
6
6
  * 2026-05-08 ai-usage/runs/state/cart plan).
@@ -1,6 +1,6 @@
1
1
  import { WorkflowResult } from "../result/workflow-result.type.mjs";
2
2
 
3
- //#region ../@warlock.js/ai/src/contracts/events/workflow-events.type.d.ts
3
+ //#region ../../@warlock.js/ai/src/contracts/events/workflow-events.type.d.ts
4
4
  type WorkflowStartingPayload = {
5
5
  workflowName: string;
6
6
  input: unknown;
@@ -1,6 +1,6 @@
1
1
  import { BaseResult } from "./result/base-result.type.mjs";
2
2
 
3
- //#region ../@warlock.js/ai/src/contracts/executable.contract.d.ts
3
+ //#region ../../@warlock.js/ai/src/contracts/executable.contract.d.ts
4
4
  /**
5
5
  * Shared contract for all executable AI primitives (agent, workflow, supervisor).
6
6
  * All three implement this interface with their specific result types.
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/contracts/finish-reason.type.d.ts
1
+ //#region ../../@warlock.js/ai/src/contracts/finish-reason.type.d.ts
2
2
  /**
3
3
  * Reasons the LLM stopped generating. Shared across model responses,
4
4
  * streaming chunks, and LLM trip records.
@@ -4,7 +4,7 @@ import { ToolMode } from "../tool.contract.mjs";
4
4
  import { AgentExecuteOptions } from "../agent/agent-options.type.mjs";
5
5
  import { MiddlewareState } from "./middleware-state.type.mjs";
6
6
 
7
- //#region ../@warlock.js/ai/src/contracts/middleware/middleware-context.type.d.ts
7
+ //#region ../../@warlock.js/ai/src/contracts/middleware/middleware-context.type.d.ts
8
8
  /**
9
9
  * Minimal identity shape of the agent the middleware is wrapping.
10
10
  * Middleware never mutates the agent itself, so it sees only the
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/contracts/middleware/middleware-state.type.d.ts
1
+ //#region ../../@warlock.js/ai/src/contracts/middleware/middleware-state.type.d.ts
2
2
  /**
3
3
  * Per-execution shared-state bag threaded through every middleware
4
4
  * hook of every level (`execute`, `trip`, `tool`) for a single
@@ -4,7 +4,7 @@ import { ToolInvokeResult } from "../../tool/tool.mjs";
4
4
  import { MiddlewareExecuteContext, MiddlewareToolContext, MiddlewareTripContext } from "./middleware-context.type.mjs";
5
5
  import { ModelResponse } from "../model.contract.mjs";
6
6
 
7
- //#region ../@warlock.js/ai/src/contracts/middleware/middleware.contract.d.ts
7
+ //#region ../../@warlock.js/ai/src/contracts/middleware/middleware.contract.d.ts
8
8
  /**
9
9
  * `execute`-level hook map. Wraps the entire `agent.execute()` call.
10
10
  *
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/contracts/model-tool-call-request.type.d.ts
1
+ //#region ../../@warlock.js/ai/src/contracts/model-tool-call-request.type.d.ts
2
2
  /**
3
3
  * A raw tool call request returned by the model during a complete() call or
4
4
  * emitted as a chunk during stream(). Agents look up the tool by `name` and
@@ -5,7 +5,7 @@ import { Usage } from "./result/usage.type.mjs";
5
5
  import { FinishReason } from "./finish-reason.type.mjs";
6
6
  import { ToolConfig } from "./tool.contract.mjs";
7
7
 
8
- //#region ../@warlock.js/ai/src/contracts/model.contract.d.ts
8
+ //#region ../../@warlock.js/ai/src/contracts/model.contract.d.ts
9
9
  /**
10
10
  * Options passed to model.complete() or model.stream().
11
11
  *
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/contracts/placeholders.type.d.ts
1
+ //#region ../../@warlock.js/ai/src/contracts/placeholders.type.d.ts
2
2
  /**
3
3
  * A map of placeholder keys to their replacement values.
4
4
  * Supports nested access via dot notation in {{mustache}} templates.
@@ -1,7 +1,7 @@
1
1
  import { BaseResult } from "./base-result.type.mjs";
2
2
  import { AgentReport } from "./execution-report.type.mjs";
3
3
 
4
- //#region ../@warlock.js/ai/src/contracts/result/agent-result.type.d.ts
4
+ //#region ../../@warlock.js/ai/src/contracts/result/agent-result.type.d.ts
5
5
  /**
6
6
  * Result returned by `agent.execute()` and resolved by `stream.result`.
7
7
  *
@@ -1,6 +1,6 @@
1
1
  import { AIError } from "../../errors/ai-error.mjs";
2
2
 
3
- //#region ../@warlock.js/ai/src/contracts/result/attempt-entry.type.d.ts
3
+ //#region ../../@warlock.js/ai/src/contracts/result/attempt-entry.type.d.ts
4
4
  /**
5
5
  * One row in an executable's retry history. Captures a single
6
6
  * attempt's timing + outcome — populated wherever retry happens:
@@ -1,7 +1,7 @@
1
1
  import { Usage } from "./usage.type.mjs";
2
2
  import { AttemptEntry } from "./attempt-entry.type.mjs";
3
3
 
4
- //#region ../@warlock.js/ai/src/contracts/result/base-report.type.d.ts
4
+ //#region ../../@warlock.js/ai/src/contracts/result/base-report.type.d.ts
5
5
  /**
6
6
  * Wire-format version stamped on every root `BaseReport`. Bumped only
7
7
  * when we make a BREAKING change to the report shape (field removed,
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/contracts/result/base-report.type.ts
1
+ //#region ../../@warlock.js/ai/src/contracts/result/base-report.type.ts
2
2
  /**
3
3
  * Wire-format version stamped on every root `BaseReport`. Bumped only
4
4
  * when we make a BREAKING change to the report shape (field removed,
@@ -1,7 +1,7 @@
1
1
  import { AIError } from "../../errors/ai-error.mjs";
2
2
  import { Usage } from "./usage.type.mjs";
3
3
 
4
- //#region ../@warlock.js/ai/src/contracts/result/base-result.type.d.ts
4
+ //#region ../../@warlock.js/ai/src/contracts/result/base-result.type.d.ts
5
5
  /**
6
6
  * Minimal shape every execution result satisfies. Used as the upper
7
7
  * bound on `ExecutableContract`'s `TResult` generic so the contract
@@ -2,7 +2,7 @@ import { AIError } from "../../errors/ai-error.mjs";
2
2
  import { Usage } from "./usage.type.mjs";
3
3
  import { BaseReport } from "./base-report.type.mjs";
4
4
 
5
- //#region ../@warlock.js/ai/src/contracts/result/execute-result.type.d.ts
5
+ //#region ../../@warlock.js/ai/src/contracts/result/execute-result.type.d.ts
6
6
  /**
7
7
  * Unified result envelope returned by every executable primitive —
8
8
  * `tool.invoke()`, `agent.execute()`, `workflow.execute()`,
@@ -1,7 +1,7 @@
1
1
  import { BaseReport, ReportStatus } from "./base-report.type.mjs";
2
2
  import { LLMTrip } from "./llm-trip.type.mjs";
3
3
 
4
- //#region ../@warlock.js/ai/src/contracts/result/execution-report.type.d.ts
4
+ //#region ../../@warlock.js/ai/src/contracts/result/execution-report.type.d.ts
5
5
  /**
6
6
  * Terminal status alias retained for backwards-compatibility with
7
7
  * existing imports. Use {@link ReportStatus} directly for new code —
@@ -3,7 +3,7 @@ import { Usage } from "./usage.type.mjs";
3
3
  import { FinishReason } from "../finish-reason.type.mjs";
4
4
  import { ToolCall } from "./tool-call.type.mjs";
5
5
 
6
- //#region ../@warlock.js/ai/src/contracts/result/llm-trip.type.d.ts
6
+ //#region ../../@warlock.js/ai/src/contracts/result/llm-trip.type.d.ts
7
7
  /**
8
8
  * A single LLM round-trip within an agent execution.
9
9
  * An agent may make multiple trips when tools are called.
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/contracts/result/model-pricing.type.d.ts
1
+ //#region ../../@warlock.js/ai/src/contracts/result/model-pricing.type.d.ts
2
2
  /**
3
3
  * Per-million-token USD pricing for a model. All values are in USD per
4
4
  * 1,000,000 tokens — the industry-standard unit. Used by the framework
@@ -4,7 +4,7 @@ import { AgentResult } from "./agent-result.type.mjs";
4
4
  import { WorkflowResult } from "./workflow-result.type.mjs";
5
5
  import { SupervisorResult } from "./supervisor-result.type.mjs";
6
6
 
7
- //#region ../@warlock.js/ai/src/contracts/result/session-send-result.type.d.ts
7
+ //#region ../../@warlock.js/ai/src/contracts/result/session-send-result.type.d.ts
8
8
  /**
9
9
  * Result returned by SessionContract.send().
10
10
  * Narrows executionResult by checking the `type` discriminant.
@@ -4,7 +4,7 @@ import { AttemptEntry } from "./attempt-entry.type.mjs";
4
4
  import { AgentReport } from "./execution-report.type.mjs";
5
5
  import { AgentResult } from "./agent-result.type.mjs";
6
6
 
7
- //#region ../@warlock.js/ai/src/contracts/result/step-result.type.d.ts
7
+ //#region ../../@warlock.js/ai/src/contracts/result/step-result.type.d.ts
8
8
  /**
9
9
  * Frozen snapshot of a completed workflow step, stored under
10
10
  * `WorkflowReport.steps[name]` and `ctx.steps[name]`.
@@ -3,7 +3,7 @@ import { BaseReport } from "./base-report.type.mjs";
3
3
  import { AckSnapshot, IterationSnapshot } from "../supervisor/iteration-snapshot.type.mjs";
4
4
  import { ClassifierSnapshot } from "../supervisor/classifier-context.type.mjs";
5
5
 
6
- //#region ../@warlock.js/ai/src/contracts/result/supervisor-result.type.d.ts
6
+ //#region ../../@warlock.js/ai/src/contracts/result/supervisor-result.type.d.ts
7
7
  /**
8
8
  * How the supervisor decided to stop iterating. Recorded so log and
9
9
  * dashboard queries can slice "ended because router said END" from
@@ -1,7 +1,7 @@
1
1
  import { AIError } from "../../errors/ai-error.mjs";
2
2
  import { BaseReport } from "./base-report.type.mjs";
3
3
 
4
- //#region ../@warlock.js/ai/src/contracts/result/tool-call.type.d.ts
4
+ //#region ../../@warlock.js/ai/src/contracts/result/tool-call.type.d.ts
5
5
  /**
6
6
  * Forensic record of a single leaf-tool dispatch inside an agent's
7
7
  * execution. Structurally a {@link BaseReport} (`type: "tool"`) with
@@ -1,6 +1,6 @@
1
1
  import { ModelPricing } from "./model-pricing.type.mjs";
2
2
 
3
- //#region ../@warlock.js/ai/src/contracts/result/usage.type.d.ts
3
+ //#region ../../@warlock.js/ai/src/contracts/result/usage.type.d.ts
4
4
  /**
5
5
  * Token usage statistics for a single LLM call or aggregated across trips.
6
6
  *
@@ -3,7 +3,7 @@ import { BaseResult } from "./base-result.type.mjs";
3
3
  import { BaseReport } from "./base-report.type.mjs";
4
4
  import { StepSnapshot } from "./step-result.type.mjs";
5
5
 
6
- //#region ../@warlock.js/ai/src/contracts/result/workflow-result.type.d.ts
6
+ //#region ../../@warlock.js/ai/src/contracts/result/workflow-result.type.d.ts
7
7
  /**
8
8
  * Workflow-specific execution report — {@link BaseReport} plus
9
9
  * per-step snapshots and the final frozen `ctx.state`.
@@ -2,7 +2,7 @@ import { ModelPricing } from "./result/model-pricing.type.mjs";
2
2
  import { EmbedderConfig, EmbedderContract } from "./embedder.contract.mjs";
3
3
  import { ModelContract } from "./model.contract.mjs";
4
4
 
5
- //#region ../@warlock.js/ai/src/contracts/sdk-adapter.contract.d.ts
5
+ //#region ../../@warlock.js/ai/src/contracts/sdk-adapter.contract.d.ts
6
6
  /**
7
7
  * Configuration passed to SDKAdapterContract.model() to create a model instance.
8
8
  *
@@ -4,7 +4,7 @@ import { LLMTrip } from "../result/llm-trip.type.mjs";
4
4
  import { ToolEventMeta } from "../events/agent-events.type.mjs";
5
5
  import { EventIdentity } from "../events/event-identity.type.mjs";
6
6
 
7
- //#region ../@warlock.js/ai/src/contracts/stream/stream-event.type.d.ts
7
+ //#region ../../@warlock.js/ai/src/contracts/stream/stream-event.type.d.ts
8
8
  /**
9
9
  * Discriminated union of all events emitted during a streaming execution.
10
10
  * Iterate over a StreamContract to receive these events.
@@ -1,6 +1,6 @@
1
1
  import { StreamEvent } from "./stream-event.type.mjs";
2
2
 
3
- //#region ../@warlock.js/ai/src/contracts/stream/stream.contract.d.ts
3
+ //#region ../../@warlock.js/ai/src/contracts/stream/stream.contract.d.ts
4
4
  /**
5
5
  * An async iterable stream that also exposes a result promise.
6
6
  * Returned by every primitive's `stream()` method.
@@ -1,4 +1,4 @@
1
- //#region ../@warlock.js/ai/src/contracts/streaming-tool-guard-config.type.d.ts
1
+ //#region ../../@warlock.js/ai/src/contracts/streaming-tool-guard-config.type.d.ts
2
2
  /**
3
3
  * Configuration for the stream-time tool-call guard.
4
4
  *
@@ -3,7 +3,7 @@ import { AgentContract } from "../agent/agent.contract.mjs";
3
3
  import { RouteContext } from "./route-context.type.mjs";
4
4
  import { StandardSchemaV1 } from "@standard-schema/spec";
5
5
 
6
- //#region ../@warlock.js/ai/src/contracts/supervisor/ack-entry.type.d.ts
6
+ //#region ../../@warlock.js/ai/src/contracts/supervisor/ack-entry.type.d.ts
7
7
  /**
8
8
  * Receptionist callback — pure code that produces an acknowledgment
9
9
  * slice. Bare-callback shorthand for `AckRunEntry`. Use when the ack
@@ -7,7 +7,7 @@ import { EndSentinel } from "../end.type.mjs";
7
7
  import { SupervisorInput } from "./supervisor-input.type.mjs";
8
8
  import { StreamableExecutable, SupervisableExecutable, SupervisableExecuteOptions, SupervisableResult } from "./dispatch-context.type.mjs";
9
9
 
10
- //#region ../@warlock.js/ai/src/contracts/supervisor/classifier-context.type.d.ts
10
+ //#region ../../@warlock.js/ai/src/contracts/supervisor/classifier-context.type.d.ts
11
11
  /**
12
12
  * Locked output shape every classifier must produce — agent or callback
13
13
  * form. `intent` is required and must match a key in the supervisor's
@@ -12,7 +12,7 @@ import { ClassifierSnapshot } from "./classifier-context.type.mjs";
12
12
  import { SupervisorResult } from "../result/supervisor-result.type.mjs";
13
13
  import { AgentExecuteOptions } from "../agent/agent-options.type.mjs";
14
14
 
15
- //#region ../@warlock.js/ai/src/contracts/supervisor/dispatch-context.type.d.ts
15
+ //#region ../../@warlock.js/ai/src/contracts/supervisor/dispatch-context.type.d.ts
16
16
  /**
17
17
  * Runner exposed on `DispatchContext.intents` for each registered
18
18
  * intent. Two methods, mirroring the canonical execute / stream
@@ -5,7 +5,7 @@ import { IterationSnapshot } from "./iteration-snapshot.type.mjs";
5
5
  import { SupervisorInput } from "./supervisor-input.type.mjs";
6
6
  import { ClassifierSnapshot } from "./classifier-context.type.mjs";
7
7
 
8
- //#region ../@warlock.js/ai/src/contracts/supervisor/evaluate-context.type.d.ts
8
+ //#region ../../@warlock.js/ai/src/contracts/supervisor/evaluate-context.type.d.ts
9
9
  /**
10
10
  * Per-branch summary passed to `evaluate` via
11
11
  * `EvaluateContext.result[intent]`. Carries exactly what `evaluate`
@@ -8,7 +8,7 @@ import { RouteContext } from "./route-context.type.mjs";
8
8
  import { DispatchContext } from "./dispatch-context.type.mjs";
9
9
  import { StandardSchemaV1 } from "@standard-schema/spec";
10
10
 
11
- //#region ../@warlock.js/ai/src/contracts/supervisor/intent-entry.type.d.ts
11
+ //#region ../../@warlock.js/ai/src/contracts/supervisor/intent-entry.type.d.ts
12
12
  /**
13
13
  * Raw result produced by a dispatched unit — either an agent or a
14
14
  * workflow — before any per-intent strip-merge runs.
@@ -3,7 +3,7 @@ import { Usage } from "../result/usage.type.mjs";
3
3
  import { Next } from "./next.type.mjs";
4
4
  import { EvaluateResult } from "./evaluate-context.type.mjs";
5
5
 
6
- //#region ../@warlock.js/ai/src/contracts/supervisor/iteration-snapshot.type.d.ts
6
+ //#region ../../@warlock.js/ai/src/contracts/supervisor/iteration-snapshot.type.d.ts
7
7
  /**
8
8
  * Per-branch snapshot captured during dispatch — one per intent that
9
9
  * ran in the iteration. The persistence-grade record of what each
@@ -1,6 +1,6 @@
1
1
  import { EndSentinel } from "../end.type.mjs";
2
2
 
3
- //#region ../@warlock.js/ai/src/contracts/supervisor/next.type.d.ts
3
+ //#region ../../@warlock.js/ai/src/contracts/supervisor/next.type.d.ts
4
4
  /**
5
5
  * The legal return shape of a supervisor's dispatch decision — what
6
6
  * both `route` callbacks and router agents produce for `next`:
@@ -4,7 +4,7 @@ import { SupervisorInput } from "./supervisor-input.type.mjs";
4
4
  import { EvaluateResult } from "./evaluate-context.type.mjs";
5
5
  import { ClassifierSnapshot } from "./classifier-context.type.mjs";
6
6
 
7
- //#region ../@warlock.js/ai/src/contracts/supervisor/route-context.type.d.ts
7
+ //#region ../../@warlock.js/ai/src/contracts/supervisor/route-context.type.d.ts
8
8
  /**
9
9
  * Context passed to a supervisor's `route` callback (deterministic
10
10
  * dispatch mode) and also exposed to router-agent input composers
@@ -2,7 +2,7 @@ import { Message } from "../conversation-message.type.mjs";
2
2
  import { AgentContract } from "../agent/agent.contract.mjs";
3
3
  import { RouteContext } from "./route-context.type.mjs";
4
4
 
5
- //#region ../@warlock.js/ai/src/contracts/supervisor/router-entry.type.d.ts
5
+ //#region ../../@warlock.js/ai/src/contracts/supervisor/router-entry.type.d.ts
6
6
  /**
7
7
  * Object form for `SupervisorConfig.router` — symmetric with
8
8
  * `IntentEntry`, but a strict subset: