@warlock.js/ai 4.1.12 → 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
|
@@ -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
|
|
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
|
|
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,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
|
|
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
|
|
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;
|
package/esm/agent/agent.d.mts
CHANGED
|
@@ -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
|
|
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
|
*
|
package/esm/agent/agent.mjs
CHANGED
|
@@ -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
|
|
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
|
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
|
|
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
|
|
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
|
|
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
|
@@ -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
|
|
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
|
|
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,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
|
|
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
|
*
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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:
|