@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.
- package/cjs/index.cjs +86 -86
- package/esm/agent/agent-config.type.d.mts +1 -1
- package/esm/agent/agent-input-builder.mjs +1 -1
- package/esm/agent/agent-log-event.mjs +1 -1
- package/esm/agent/agent-stream.d.mts +1 -1
- package/esm/agent/agent-stream.mjs +1 -1
- package/esm/agent/agent-to-stream-event.mjs +1 -1
- package/esm/agent/agent.d.mts +1 -1
- package/esm/agent/agent.mjs +1 -1
- package/esm/agent/json-stream-guard.mjs +1 -1
- package/esm/ai.d.mts +1 -1
- package/esm/ai.mjs +1 -1
- package/esm/config.d.mts +1 -1
- package/esm/config.mjs +1 -1
- package/esm/contracts/agent/agent-options.type.d.mts +1 -1
- package/esm/contracts/agent/agent.contract.d.mts +1 -1
- package/esm/contracts/attachment.type.d.mts +1 -1
- package/esm/contracts/content-part.type.d.mts +1 -1
- package/esm/contracts/conversation-message.type.d.mts +1 -1
- package/esm/contracts/embedder.contract.d.mts +1 -1
- package/esm/contracts/end.type.d.mts +1 -1
- package/esm/contracts/end.type.mjs +1 -1
- package/esm/contracts/events/agent-events.type.d.mts +1 -1
- package/esm/contracts/events/complete-event.type.d.mts +1 -1
- package/esm/contracts/events/event-identity.type.d.mts +1 -1
- package/esm/contracts/events/event-map.type.d.mts +1 -1
- package/esm/contracts/events/supervisor-events.type.d.mts +1 -1
- package/esm/contracts/events/usage-event.type.d.mts +1 -1
- package/esm/contracts/events/workflow-events.type.d.mts +1 -1
- package/esm/contracts/executable.contract.d.mts +1 -1
- package/esm/contracts/finish-reason.type.d.mts +1 -1
- package/esm/contracts/middleware/middleware-context.type.d.mts +1 -1
- package/esm/contracts/middleware/middleware-state.type.d.mts +1 -1
- package/esm/contracts/middleware/middleware.contract.d.mts +1 -1
- package/esm/contracts/model-tool-call-request.type.d.mts +1 -1
- package/esm/contracts/model.contract.d.mts +1 -1
- package/esm/contracts/placeholders.type.d.mts +1 -1
- package/esm/contracts/result/agent-result.type.d.mts +1 -1
- package/esm/contracts/result/attempt-entry.type.d.mts +1 -1
- package/esm/contracts/result/base-report.type.d.mts +1 -1
- package/esm/contracts/result/base-report.type.mjs +1 -1
- package/esm/contracts/result/base-result.type.d.mts +1 -1
- package/esm/contracts/result/execute-result.type.d.mts +1 -1
- package/esm/contracts/result/execution-report.type.d.mts +1 -1
- package/esm/contracts/result/llm-trip.type.d.mts +1 -1
- package/esm/contracts/result/model-pricing.type.d.mts +1 -1
- package/esm/contracts/result/session-send-result.type.d.mts +1 -1
- package/esm/contracts/result/step-result.type.d.mts +1 -1
- package/esm/contracts/result/supervisor-result.type.d.mts +1 -1
- package/esm/contracts/result/tool-call.type.d.mts +1 -1
- package/esm/contracts/result/usage.type.d.mts +1 -1
- package/esm/contracts/result/workflow-result.type.d.mts +1 -1
- package/esm/contracts/sdk-adapter.contract.d.mts +1 -1
- package/esm/contracts/stream/stream-event.type.d.mts +1 -1
- package/esm/contracts/stream/stream.contract.d.mts +1 -1
- package/esm/contracts/streaming-tool-guard-config.type.d.mts +1 -1
- package/esm/contracts/supervisor/ack-entry.type.d.mts +1 -1
- package/esm/contracts/supervisor/classifier-context.type.d.mts +1 -1
- package/esm/contracts/supervisor/dispatch-context.type.d.mts +1 -1
- package/esm/contracts/supervisor/evaluate-context.type.d.mts +1 -1
- package/esm/contracts/supervisor/intent-entry.type.d.mts +1 -1
- package/esm/contracts/supervisor/iteration-snapshot.type.d.mts +1 -1
- package/esm/contracts/supervisor/next.type.d.mts +1 -1
- package/esm/contracts/supervisor/route-context.type.d.mts +1 -1
- package/esm/contracts/supervisor/router-entry.type.d.mts +1 -1
- package/esm/contracts/supervisor/supervisor-config.type.d.mts +1 -1
- package/esm/contracts/supervisor/supervisor-execute-options.type.d.mts +1 -1
- package/esm/contracts/supervisor/supervisor-input.type.d.mts +1 -1
- package/esm/contracts/supervisor/supervisor-snapshot.type.d.mts +1 -1
- package/esm/contracts/supervisor/supervisor-stream-event.type.d.mts +1 -1
- package/esm/contracts/supervisor/supervisor.contract.d.mts +1 -1
- package/esm/contracts/system-prompt.contract.d.mts +1 -1
- package/esm/contracts/tool.contract.d.mts +1 -1
- package/esm/contracts/workflow/next-step-result.type.d.mts +1 -1
- package/esm/contracts/workflow/retry-config.type.d.mts +1 -1
- package/esm/contracts/workflow/step.contract.d.mts +1 -1
- package/esm/contracts/workflow/workflow-context.type.d.mts +1 -1
- package/esm/contracts/workflow/workflow-snapshot.type.d.mts +1 -1
- package/esm/contracts/workflow/workflow.contract.d.mts +1 -1
- package/esm/errors/agent-cancelled-error.d.mts +1 -1
- package/esm/errors/agent-cancelled-error.mjs +1 -1
- package/esm/errors/agent-execution-error.d.mts +1 -1
- package/esm/errors/agent-execution-error.mjs +1 -1
- package/esm/errors/agent-max-trips-error.d.mts +1 -1
- package/esm/errors/agent-max-trips-error.mjs +1 -1
- package/esm/errors/ai-error.d.mts +1 -1
- package/esm/errors/ai-error.mjs +1 -1
- package/esm/errors/budget-exceeded-error.d.mts +1 -1
- package/esm/errors/budget-exceeded-error.mjs +1 -1
- package/esm/errors/content-filter-error.d.mts +1 -1
- package/esm/errors/content-filter-error.mjs +1 -1
- package/esm/errors/context-length-exceeded-error.d.mts +1 -1
- package/esm/errors/context-length-exceeded-error.mjs +1 -1
- package/esm/errors/error-category.type.d.mts +1 -1
- package/esm/errors/error-code.type.d.mts +1 -1
- package/esm/errors/guardrail-violation-error.d.mts +1 -1
- package/esm/errors/guardrail-violation-error.mjs +1 -1
- package/esm/errors/invalid-request-error.d.mts +1 -1
- package/esm/errors/invalid-request-error.mjs +1 -1
- package/esm/errors/max-iterations-error.d.mts +1 -1
- package/esm/errors/max-iterations-error.mjs +1 -1
- package/esm/errors/max-steps-exceeded-error.d.mts +1 -1
- package/esm/errors/max-steps-exceeded-error.mjs +1 -1
- package/esm/errors/provider-auth-error.d.mts +1 -1
- package/esm/errors/provider-auth-error.mjs +1 -1
- package/esm/errors/provider-error.d.mts +1 -1
- package/esm/errors/provider-error.mjs +1 -1
- package/esm/errors/provider-rate-limit-error.d.mts +1 -1
- package/esm/errors/provider-rate-limit-error.mjs +1 -1
- package/esm/errors/provider-timeout-error.d.mts +1 -1
- package/esm/errors/provider-timeout-error.mjs +1 -1
- package/esm/errors/quota-exceeded-error.d.mts +1 -1
- package/esm/errors/quota-exceeded-error.mjs +1 -1
- package/esm/errors/routing-error.d.mts +1 -1
- package/esm/errors/routing-error.mjs +1 -1
- package/esm/errors/schema-validation-error.d.mts +1 -1
- package/esm/errors/schema-validation-error.mjs +1 -1
- package/esm/errors/step-failed-error.d.mts +1 -1
- package/esm/errors/step-failed-error.mjs +1 -1
- package/esm/errors/supervisor-cancelled-error.d.mts +1 -1
- package/esm/errors/supervisor-cancelled-error.mjs +1 -1
- package/esm/errors/supervisor-drift-error.d.mts +1 -1
- package/esm/errors/supervisor-drift-error.mjs +1 -1
- package/esm/errors/supervisor-failed-error.d.mts +1 -1
- package/esm/errors/supervisor-failed-error.mjs +1 -1
- package/esm/errors/supervisor-routing-error.d.mts +1 -1
- package/esm/errors/supervisor-routing-error.mjs +1 -1
- package/esm/errors/tool-execution-error.d.mts +1 -1
- package/esm/errors/tool-execution-error.mjs +1 -1
- package/esm/errors/workflow-cancelled-error.d.mts +1 -1
- package/esm/errors/workflow-cancelled-error.mjs +1 -1
- package/esm/errors/workflow-drift-error.d.mts +1 -1
- package/esm/errors/workflow-drift-error.mjs +1 -1
- package/esm/errors/workflow-error.d.mts +1 -1
- package/esm/errors/workflow-error.mjs +1 -1
- package/esm/middleware/builtins/budget.d.mts +1 -1
- package/esm/middleware/builtins/budget.mjs +1 -1
- package/esm/middleware/builtins/guardrail.d.mts +1 -1
- package/esm/middleware/builtins/guardrail.mjs +1 -1
- package/esm/middleware/builtins/semantic-cache.d.mts +1 -1
- package/esm/middleware/builtins/semantic-cache.mjs +1 -1
- package/esm/middleware/helpers/compose.d.mts +1 -1
- package/esm/middleware/helpers/compose.mjs +1 -1
- package/esm/middleware/helpers/for-tool.d.mts +1 -1
- package/esm/middleware/helpers/for-tool.mjs +1 -1
- package/esm/middleware/pipeline.d.mts +1 -1
- package/esm/middleware/pipeline.mjs +1 -1
- package/esm/middleware/utils/extract-user-text.d.mts +1 -1
- package/esm/middleware/utils/extract-user-text.mjs +1 -1
- package/esm/middleware/utils/namespaced-state.d.mts +1 -1
- package/esm/middleware/utils/namespaced-state.mjs +1 -1
- package/esm/mock/mock-agent.d.mts +1 -1
- package/esm/mock/mock-agent.mjs +1 -1
- package/esm/mock/mock-config.type.d.mts +1 -1
- package/esm/mock/mock-model.d.mts +1 -1
- package/esm/mock/mock-model.mjs +1 -1
- package/esm/mock/mock-sdk.d.mts +1 -1
- package/esm/mock/mock-sdk.mjs +1 -1
- package/esm/supervisor/as-tool.d.mts +1 -1
- package/esm/supervisor/as-tool.mjs +1 -1
- package/esm/supervisor/cancellation.d.mts +1 -1
- package/esm/supervisor/cancellation.mjs +1 -1
- package/esm/supervisor/decide.mjs +1 -1
- package/esm/supervisor/emitter.d.mts +1 -1
- package/esm/supervisor/emitter.mjs +1 -1
- package/esm/supervisor/entries.d.mts +1 -1
- package/esm/supervisor/entries.mjs +1 -1
- package/esm/supervisor/execution.d.mts +1 -1
- package/esm/supervisor/execution.mjs +1 -1
- package/esm/supervisor/router-prompt.d.mts +1 -1
- package/esm/supervisor/router-prompt.mjs +1 -1
- package/esm/supervisor/signature.d.mts +1 -1
- package/esm/supervisor/signature.mjs +1 -1
- package/esm/supervisor/snapshot.d.mts +1 -1
- package/esm/supervisor/snapshot.mjs +1 -1
- package/esm/supervisor/supervisor-stream.d.mts +1 -1
- package/esm/supervisor/supervisor-stream.mjs +1 -1
- package/esm/supervisor/supervisor.d.mts +1 -1
- package/esm/supervisor/supervisor.mjs +1 -1
- package/esm/system-prompt/instruction.d.mts +1 -1
- package/esm/system-prompt/instruction.mjs +1 -1
- package/esm/system-prompt/persona.d.mts +1 -1
- package/esm/system-prompt/persona.mjs +1 -1
- package/esm/system-prompt/render-placeholders.d.mts +1 -1
- package/esm/system-prompt/render-placeholders.mjs +1 -1
- package/esm/system-prompt/system-prompt.d.mts +1 -1
- package/esm/system-prompt/system-prompt.mjs +1 -1
- package/esm/tool/tool.d.mts +1 -1
- package/esm/tool/tool.mjs +1 -1
- package/esm/utils/compute-cost.d.mts +1 -1
- package/esm/utils/compute-cost.mjs +1 -1
- package/esm/utils/extract-json-payload.d.mts +1 -1
- package/esm/utils/extract-json-payload.mjs +1 -1
- package/esm/utils/generate-run-id.d.mts +1 -1
- package/esm/utils/generate-run-id.mjs +1 -1
- package/esm/utils/json-schema.d.mts +1 -1
- package/esm/utils/json-schema.mjs +1 -1
- package/esm/utils/prepare-attachment-part.d.mts +1 -1
- package/esm/utils/prepare-attachment-part.mjs +1 -1
- package/esm/utils/resolve-attachment.d.mts +1 -1
- package/esm/utils/resolve-attachment.mjs +1 -1
- package/esm/utils/safe-json-parse.d.mts +1 -1
- package/esm/utils/safe-json-parse.mjs +1 -1
- package/esm/utils/stamp-report-lineage.d.mts +1 -1
- package/esm/utils/stamp-report-lineage.mjs +1 -1
- package/esm/utils/token-count.d.mts +1 -1
- package/esm/utils/token-count.mjs +1 -1
- package/esm/workflow/as-tool.mjs +1 -1
- package/esm/workflow/cancellation.mjs +1 -1
- package/esm/workflow/emitter.mjs +1 -1
- package/esm/workflow/engine.mjs +1 -1
- package/esm/workflow/retry.mjs +1 -1
- package/esm/workflow/router.mjs +1 -1
- package/esm/workflow/run-scoped-emitter.mjs +1 -1
- package/esm/workflow/signature.d.mts +1 -1
- package/esm/workflow/signature.mjs +1 -1
- package/esm/workflow/snapshot.mjs +1 -1
- package/esm/workflow/state.mjs +1 -1
- package/esm/workflow/step-runner.mjs +1 -1
- package/esm/workflow/step.d.mts +1 -1
- package/esm/workflow/step.mjs +1 -1
- package/esm/workflow/workflow.d.mts +1 -1
- package/esm/workflow/workflow.mjs +1 -1
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ import { SupervisorEventMap } from "../events/event-map.type.mjs";
|
|
|
12
12
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
13
13
|
import { CacheDriver } from "@warlock.js/cache";
|
|
14
14
|
|
|
15
|
-
//#region
|
|
15
|
+
//#region ../../@warlock.js/ai/src/contracts/supervisor/supervisor-config.type.d.ts
|
|
16
16
|
/**
|
|
17
17
|
* Handler function for a single supervisor event. Receives the
|
|
18
18
|
* event's typed payload; return value is ignored.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Message } from "../conversation-message.type.mjs";
|
|
2
2
|
import { SupervisorEventHandlers } from "./supervisor-config.type.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../../@warlock.js/ai/src/contracts/supervisor/supervisor-execute-options.type.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Per-call options for `supervisor.execute()`. Everything here is
|
|
7
7
|
* scoped to a single run — factory-level knobs live on
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region ../../@warlock.js/ai/src/contracts/supervisor/supervisor-input.type.d.ts
|
|
2
2
|
/**
|
|
3
3
|
* Accepted input shape for `supervisor.execute(input)` and the
|
|
4
4
|
* matching field on every supervisor context (`RouteContext`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IterationSnapshot } from "./iteration-snapshot.type.mjs";
|
|
2
2
|
import { SupervisorInput } from "./supervisor-input.type.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../../@warlock.js/ai/src/contracts/supervisor/supervisor-snapshot.type.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Lifecycle status of a supervisor run, recorded on the persisted
|
|
7
7
|
* snapshot so resume can decide whether a run is still in flight.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SupervisorEventMap } from "../events/event-map.type.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/contracts/supervisor/supervisor-stream-event.type.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Discriminated union of every event consumers see when iterating
|
|
6
6
|
* `supervisor.stream()`. Mirrors `SupervisorEventMap` keys one-for-one
|
|
@@ -9,7 +9,7 @@ import { SupervisorResult } from "../result/supervisor-result.type.mjs";
|
|
|
9
9
|
import { SupervisorEventMap } from "../events/event-map.type.mjs";
|
|
10
10
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
11
11
|
|
|
12
|
-
//#region
|
|
12
|
+
//#region ../../@warlock.js/ai/src/contracts/supervisor/supervisor.contract.d.ts
|
|
13
13
|
/**
|
|
14
14
|
* Options accepted by `supervisor.asTool()`, mirroring
|
|
15
15
|
* `workflow.asTool()` / `agent.asTool()`. Exposes the supervisor as
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Placeholders } from "./placeholders.type.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/contracts/system-prompt.contract.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Base contract shared by every block that can appear inside a
|
|
6
6
|
* `SystemPromptContract` — currently persona and instruction, with room for
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/contracts/tool.contract.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Optional metadata attached to a tool for documentation and tooling.
|
|
6
6
|
*
|
|
@@ -6,7 +6,7 @@ import { WorkflowContext } from "./workflow-context.type.mjs";
|
|
|
6
6
|
import { AgentExecuteOptions } from "../agent/agent-options.type.mjs";
|
|
7
7
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
8
8
|
|
|
9
|
-
//#region
|
|
9
|
+
//#region ../../@warlock.js/ai/src/contracts/workflow/step.contract.d.ts
|
|
10
10
|
/**
|
|
11
11
|
* Step-local event payloads. Fired on per-step `on: { ... }` handlers
|
|
12
12
|
* in addition to the workflow-level `workflow.step.*` events — useful
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AgentResult } from "../result/agent-result.type.mjs";
|
|
2
2
|
import { StepSnapshot } from "../result/step-result.type.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../../@warlock.js/ai/src/contracts/workflow/workflow-context.type.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Context threaded through every step lifecycle phase.
|
|
7
7
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ExecutionStatus } from "../result/execution-report.type.mjs";
|
|
2
2
|
import { StepSnapshot } from "../result/step-result.type.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../../@warlock.js/ai/src/contracts/workflow/workflow-snapshot.type.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Serializable workflow state written to the configured `KVStore`
|
|
7
7
|
* after every step completion.
|
|
@@ -9,7 +9,7 @@ import { WorkflowEventMap } from "../events/event-map.type.mjs";
|
|
|
9
9
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
10
10
|
import { CacheDriver } from "@warlock.js/cache";
|
|
11
11
|
|
|
12
|
-
//#region
|
|
12
|
+
//#region ../../@warlock.js/ai/src/contracts/workflow/workflow.contract.d.ts
|
|
13
13
|
type WorkflowEventHandler<K extends keyof WorkflowEventMap> = (payload: WorkflowEventMap[K]) => void;
|
|
14
14
|
type WorkflowEventHandlers = Partial<{ [K in keyof WorkflowEventMap]: WorkflowEventHandler<K> }>;
|
|
15
15
|
/**
|
|
@@ -2,7 +2,7 @@ import { ErrorCategory } from "./error-category.type.mjs";
|
|
|
2
2
|
import { AIErrorOptions } from "./ai-error.mjs";
|
|
3
3
|
import { AgentExecutionError } from "./agent-execution-error.mjs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../../@warlock.js/ai/src/errors/agent-cancelled-error.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Payload for {@link AgentCancelledError}. `cancelledAt` is the
|
|
8
8
|
* ISO-8601 timestamp at which the abort was observed; `reason`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AgentExecutionError } from "./agent-execution-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/agent-cancelled-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* Agent run was cancelled via `AbortSignal` before it could finish.
|
|
6
6
|
* Between-trip cancellation is guaranteed; mid-trip cancellation is
|
|
@@ -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
|
|
4
|
+
//#region ../../@warlock.js/ai/src/errors/agent-execution-error.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Base for agent runtime failures that aren't schema / tool / provider
|
|
7
7
|
* problems — runtime-structural issues inside the trip loop or
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AIError } from "./ai-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/agent-execution-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* Base for agent runtime failures that aren't schema / tool / provider
|
|
6
6
|
* problems — runtime-structural issues inside the trip loop or
|
|
@@ -2,7 +2,7 @@ import { ErrorCategory } from "./error-category.type.mjs";
|
|
|
2
2
|
import { AIErrorOptions } from "./ai-error.mjs";
|
|
3
3
|
import { AgentExecutionError } from "./agent-execution-error.mjs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../../@warlock.js/ai/src/errors/agent-max-trips-error.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Payload for {@link AgentMaxTripsError}. `maxTrips` is the cap the
|
|
8
8
|
* agent hit — useful for log/metric attribution and for retry-with-
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AgentExecutionError } from "./agent-execution-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/agent-max-trips-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* Runaway-loop hard guard: the agent's trip loop ran `maxTrips` round
|
|
6
6
|
* trips to the model without the model issuing a natural stop. The
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ErrorCategory } from "./error-category.type.mjs";
|
|
2
2
|
import { AIErrorCode } from "./error-code.type.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../../@warlock.js/ai/src/errors/ai-error.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Optional constructor payload shared by every `AIError` subclass.
|
|
7
7
|
*
|
package/esm/errors/ai-error.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ErrorCategory } from "./error-category.type.mjs";
|
|
2
2
|
import { AIError, AIErrorOptions } from "./ai-error.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../../@warlock.js/ai/src/errors/budget-exceeded-error.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Unit of the budget being enforced. `tokens` for context/output
|
|
7
7
|
* caps, `usd` for monetary caps, `requests` for call-count caps.
|
|
@@ -2,7 +2,7 @@ import { ErrorCategory } from "./error-category.type.mjs";
|
|
|
2
2
|
import { AIErrorOptions } from "./ai-error.mjs";
|
|
3
3
|
import { ProviderError } from "./provider-error.mjs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../../@warlock.js/ai/src/errors/content-filter-error.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Payload for `ContentFilterError`. Both fields optional — providers
|
|
8
8
|
* don't consistently disclose the specific filter reason or
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProviderError } from "./provider-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/content-filter-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* Response (or request) was blocked by the provider's safety filter.
|
|
6
6
|
* Not retryable with the same input — reshape the prompt or lean on
|
|
@@ -2,7 +2,7 @@ import { ErrorCategory } from "./error-category.type.mjs";
|
|
|
2
2
|
import { AIErrorOptions } from "./ai-error.mjs";
|
|
3
3
|
import { ProviderError } from "./provider-error.mjs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../../@warlock.js/ai/src/errors/context-length-exceeded-error.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Payload for `ContextLengthExceededError`. All fields are optional —
|
|
8
8
|
* providers inconsistently surface exact token counts and the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProviderError } from "./provider-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/context-length-exceeded-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* The request's prompt (messages + tools + schema) exceeded the
|
|
6
6
|
* model's context window. Not retryable without shortening the input.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region ../../@warlock.js/ai/src/errors/error-category.type.d.ts
|
|
2
2
|
/**
|
|
3
3
|
* Coarse error grouping for dashboards and routing logic. `code` is too
|
|
4
4
|
* granular for "what's failing this week" charts — the category union
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ErrorCategory } from "./error-category.type.mjs";
|
|
2
2
|
import { AIError, AIErrorOptions } from "./ai-error.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../../@warlock.js/ai/src/errors/guardrail-violation-error.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Phase at which a guardrail rejected the content — `"input"` when the
|
|
7
7
|
* violation was detected on the outbound prompt (before the model saw
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AIError } from "./ai-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/guardrail-violation-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* A guardrail middleware rejected the prompt or response mid-execution.
|
|
6
6
|
*
|
|
@@ -2,7 +2,7 @@ import { ErrorCategory } from "./error-category.type.mjs";
|
|
|
2
2
|
import { AIErrorOptions } from "./ai-error.mjs";
|
|
3
3
|
import { ProviderError } from "./provider-error.mjs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../../@warlock.js/ai/src/errors/invalid-request-error.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Provider rejected the request as malformed — bad model name,
|
|
8
8
|
* unsupported feature, missing required field, image attached to a
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProviderError } from "./provider-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/invalid-request-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* Provider rejected the request as malformed — bad model name,
|
|
6
6
|
* unsupported feature, missing required field, image attached to a
|
|
@@ -2,7 +2,7 @@ import { ErrorCategory } from "./error-category.type.mjs";
|
|
|
2
2
|
import { AIErrorOptions } from "./ai-error.mjs";
|
|
3
3
|
import { SupervisorFailedError } from "./supervisor-failed-error.mjs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../../@warlock.js/ai/src/errors/max-iterations-error.d.ts
|
|
6
6
|
type MaxIterationsErrorOptions = AIErrorOptions & {
|
|
7
7
|
maxIterations: number;
|
|
8
8
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SupervisorFailedError } from "./supervisor-failed-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/max-iterations-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* Hard-cap guard: the supervisor ran `maxIterations` loop turns
|
|
6
6
|
* without reaching a terminal decision (`END`, `satisfied: true`, or
|
|
@@ -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
|
|
5
|
+
//#region ../../@warlock.js/ai/src/errors/max-steps-exceeded-error.d.ts
|
|
6
6
|
type MaxStepsExceededErrorOptions = AIErrorOptions & {
|
|
7
7
|
maxSteps: number;
|
|
8
8
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WorkflowError } from "./workflow-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/max-steps-exceeded-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* Runaway-loop hard guard: workflow executed more step transitions
|
|
6
6
|
* than `maxSteps` allows. Terminates the workflow immediately.
|
|
@@ -2,7 +2,7 @@ import { ErrorCategory } from "./error-category.type.mjs";
|
|
|
2
2
|
import { AIErrorOptions } from "./ai-error.mjs";
|
|
3
3
|
import { ProviderError } from "./provider-error.mjs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../../@warlock.js/ai/src/errors/provider-auth-error.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Provider rejected the credential — missing / invalid / expired API
|
|
8
8
|
* key or insufficient permissions on the underlying account. Not
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProviderError } from "./provider-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/provider-auth-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* Provider rejected the credential — missing / invalid / expired API
|
|
6
6
|
* key or insufficient permissions on the underlying account. Not
|
|
@@ -2,7 +2,7 @@ import { ErrorCategory } from "./error-category.type.mjs";
|
|
|
2
2
|
import { AIErrorCode } from "./error-code.type.mjs";
|
|
3
3
|
import { AIError, AIErrorOptions } from "./ai-error.mjs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../../@warlock.js/ai/src/errors/provider-error.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Any failure that originated from the model provider (OpenAI, Azure,
|
|
8
8
|
* OpenRouter, local gateway). Base class for the provider subclasses
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AIError } from "./ai-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/provider-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* Any failure that originated from the model provider (OpenAI, Azure,
|
|
6
6
|
* OpenRouter, local gateway). Base class for the provider subclasses
|
|
@@ -2,7 +2,7 @@ import { ErrorCategory } from "./error-category.type.mjs";
|
|
|
2
2
|
import { AIErrorOptions } from "./ai-error.mjs";
|
|
3
3
|
import { ProviderError } from "./provider-error.mjs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../../@warlock.js/ai/src/errors/provider-rate-limit-error.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Payload for `ProviderRateLimitError`. `retryAfter` is the server's
|
|
8
8
|
* hint (typically parsed from the `Retry-After` header) in milliseconds.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProviderError } from "./provider-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/provider-rate-limit-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* Provider refused the call because the account (or key, or window)
|
|
6
6
|
* is over its rate-limit or quota. Retryable after `retryAfter`
|
|
@@ -2,7 +2,7 @@ import { ErrorCategory } from "./error-category.type.mjs";
|
|
|
2
2
|
import { AIErrorOptions } from "./ai-error.mjs";
|
|
3
3
|
import { ProviderError } from "./provider-error.mjs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../../@warlock.js/ai/src/errors/provider-timeout-error.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Provider call timed out — either at the transport layer (socket
|
|
8
8
|
* connection) or on the server side (request exceeded the provider's
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProviderError } from "./provider-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/provider-timeout-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* Provider call timed out — either at the transport layer (socket
|
|
6
6
|
* connection) or on the server side (request exceeded the provider's
|
|
@@ -2,7 +2,7 @@ import { ErrorCategory } from "./error-category.type.mjs";
|
|
|
2
2
|
import { AIErrorOptions } from "./ai-error.mjs";
|
|
3
3
|
import { ProviderError } from "./provider-error.mjs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../../@warlock.js/ai/src/errors/quota-exceeded-error.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Provider refused the call because the account has exhausted its
|
|
8
8
|
* paid quota (monthly credit, billing cap, subscription tier limit).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProviderError } from "./provider-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/quota-exceeded-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* Provider refused the call because the account has exhausted its
|
|
6
6
|
* paid quota (monthly credit, billing cap, subscription tier limit).
|
|
@@ -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
|
|
5
|
+
//#region ../../@warlock.js/ai/src/errors/routing-error.d.ts
|
|
6
6
|
type RoutingErrorOptions = AIErrorOptions & {
|
|
7
7
|
stepName: string;
|
|
8
8
|
targetName?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WorkflowError } from "./workflow-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/routing-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* `nextStep` returned an invalid `goto`, or the `nextStep` callback
|
|
6
6
|
* itself threw. Routing is authoritative and has no recovery path —
|
|
@@ -2,7 +2,7 @@ import { ErrorCategory } from "./error-category.type.mjs";
|
|
|
2
2
|
import { AIError, AIErrorOptions } from "./ai-error.mjs";
|
|
3
3
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../../@warlock.js/ai/src/errors/schema-validation-error.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Payload passed to `SchemaValidationError`. Subset of
|
|
8
8
|
* `AIErrorOptions` plus the machine-readable validation issues list.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AIError } from "./ai-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/schema-validation-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* A `StandardSchemaV1` validation call returned issues, or the input
|
|
6
6
|
* was not valid JSON before validation could even run.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AIErrorOptions } from "./ai-error.mjs";
|
|
2
2
|
import { WorkflowError } from "./workflow-error.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../../@warlock.js/ai/src/errors/step-failed-error.d.ts
|
|
5
5
|
type StepFailedErrorOptions = AIErrorOptions & {
|
|
6
6
|
stepName: string;
|
|
7
7
|
attempts: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WorkflowError } from "./workflow-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/step-failed-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* A workflow step exhausted its retries (or was not retried) and
|
|
6
6
|
* terminated with an error. `cause` carries the last underlying error.
|
|
@@ -2,7 +2,7 @@ import { ErrorCategory } from "./error-category.type.mjs";
|
|
|
2
2
|
import { AIErrorOptions } from "./ai-error.mjs";
|
|
3
3
|
import { SupervisorFailedError } from "./supervisor-failed-error.mjs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../../@warlock.js/ai/src/errors/supervisor-cancelled-error.d.ts
|
|
6
6
|
type SupervisorCancelledErrorOptions = AIErrorOptions & {
|
|
7
7
|
/** ISO-8601 timestamp at which the abort was observed by the supervisor. */cancelledAt: string; /** `controller.abort(reason)` payload when the caller supplied one. */
|
|
8
8
|
reason?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SupervisorFailedError } from "./supervisor-failed-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/supervisor-cancelled-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* Supervisor run was cancelled via `AbortSignal` before it could
|
|
6
6
|
* finish. Between-iteration cancellation is guaranteed; mid-iteration
|
|
@@ -2,7 +2,7 @@ import { ErrorCategory } from "./error-category.type.mjs";
|
|
|
2
2
|
import { AIErrorOptions } from "./ai-error.mjs";
|
|
3
3
|
import { SupervisorFailedError } from "./supervisor-failed-error.mjs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../../@warlock.js/ai/src/errors/supervisor-drift-error.d.ts
|
|
6
6
|
type SupervisorDriftErrorOptions = AIErrorOptions & {
|
|
7
7
|
/** Signature recorded on the snapshot being resumed. */savedSignature: string; /** Signature computed from the current supervisor definition. */
|
|
8
8
|
currentSignature: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SupervisorFailedError } from "./supervisor-failed-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/supervisor-drift-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* `supervisor.resume(runId)` loaded a snapshot whose structural
|
|
6
6
|
* fingerprint does not match the current supervisor definition
|
|
@@ -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
|
|
4
|
+
//#region ../../@warlock.js/ai/src/errors/supervisor-failed-error.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Base class for every supervisor-specific failure surfaced from
|
|
7
7
|
* `supervisor.execute()` / `supervisor.resume()` / authoring-time
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AIError } from "./ai-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/supervisor-failed-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* Base class for every supervisor-specific failure surfaced from
|
|
6
6
|
* `supervisor.execute()` / `supervisor.resume()` / authoring-time
|
|
@@ -2,7 +2,7 @@ import { ErrorCategory } from "./error-category.type.mjs";
|
|
|
2
2
|
import { AIErrorOptions } from "./ai-error.mjs";
|
|
3
3
|
import { SupervisorFailedError } from "./supervisor-failed-error.mjs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../../@warlock.js/ai/src/errors/supervisor-routing-error.d.ts
|
|
6
6
|
type SupervisorRoutingErrorOptions = AIErrorOptions & {
|
|
7
7
|
/**
|
|
8
8
|
* The raw value the `route` callback or router agent returned. Keyed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SupervisorFailedError } from "./supervisor-failed-error.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../../@warlock.js/ai/src/errors/supervisor-routing-error.ts
|
|
4
4
|
/**
|
|
5
5
|
* A `route` callback or router agent returned a value that doesn't
|
|
6
6
|
* resolve to a configured agent key, a `string[]` of configured keys,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ErrorCategory } from "./error-category.type.mjs";
|
|
2
2
|
import { AIError, AIErrorOptions } from "./ai-error.mjs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../../@warlock.js/ai/src/errors/tool-execution-error.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Payload passed to `ToolExecutionError` — identifies which tool
|
|
7
7
|
* failed and, when applicable, which trip it was dispatched from.
|