@statelyai/agent 2.0.0-alpha.16 → 2.0.0-alpha.18
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/dist/ai-sdk.cjs +1 -1
- package/dist/ai-sdk.d.cts +1 -1
- package/dist/ai-sdk.d.mts +1 -1
- package/dist/ai-sdk.mjs +1 -1
- package/dist/{decision-Bt2HYYRo.mjs → decision-C11xuud2.mjs} +4 -3
- package/dist/{decision-Ba8qrT8r.cjs → decision-DnQCQPew.cjs} +4 -3
- package/dist/index.cjs +3 -2
- package/dist/index.d.cts +36 -3
- package/dist/index.d.mts +36 -3
- package/dist/index.mjs +3 -3
- package/dist/machines.cjs +1 -1
- package/dist/machines.mjs +1 -1
- package/dist/otel.d.cts +1 -1
- package/dist/otel.d.mts +1 -1
- package/dist/{run-agent-COHoCgQd.d.mts → run-agent-DQIDikfd.d.mts} +1 -1
- package/dist/{run-agent-BxjGaVpL.d.cts → run-agent-r9OD4z8F.d.cts} +1 -1
- package/dist/{setup-agent-SbiiSbAU.mjs → setup-agent-BrE2zFDy.mjs} +34 -2
- package/dist/{setup-agent-BLU77gqr.cjs → setup-agent-C3ETi_HZ.cjs} +39 -1
- package/dist/{text-logic-DQW8_DWW.d.mts → text-logic-RvnlD-An.d.mts} +1 -1
- package/dist/{text-logic-BFX5q7fM.d.cts → text-logic-VcWqO-Cl.d.cts} +1 -1
- package/package.json +1 -1
- package/schemas/agent-workflow.json +8 -0
package/dist/ai-sdk.cjs
CHANGED
package/dist/ai-sdk.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as ChosenEvent } from "./types-pJ5Hn8fv.cjs";
|
|
2
|
-
import { A as AgentDecisionExecutor, l as AgentRequestExecutors, o as AgentRequestExecutor } from "./text-logic-
|
|
2
|
+
import { A as AgentDecisionExecutor, l as AgentRequestExecutors, o as AgentRequestExecutor } from "./text-logic-VcWqO-Cl.cjs";
|
|
3
3
|
import { FinishReason, LanguageModel, LanguageModelUsage, ToolSet, TypedToolCall, TypedToolResult } from "ai";
|
|
4
4
|
|
|
5
5
|
//#region src/ai-sdk/index.d.ts
|
package/dist/ai-sdk.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as ChosenEvent } from "./types-DYpK3QF4.mjs";
|
|
2
|
-
import { A as AgentDecisionExecutor, l as AgentRequestExecutors, o as AgentRequestExecutor } from "./text-logic-
|
|
2
|
+
import { A as AgentDecisionExecutor, l as AgentRequestExecutors, o as AgentRequestExecutor } from "./text-logic-RvnlD-An.mjs";
|
|
3
3
|
import { FinishReason, LanguageModel, LanguageModelUsage, ToolSet, TypedToolCall, TypedToolResult } from "ai";
|
|
4
4
|
|
|
5
5
|
//#region src/ai-sdk/index.d.ts
|
package/dist/ai-sdk.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as isStandardSchema, _ as getAgentOutputMode, i as renderDecisionAttempts, p as buildEnvelopeSchema } from "./decision-
|
|
1
|
+
import { H as isStandardSchema, _ as getAgentOutputMode, i as renderDecisionAttempts, p as buildEnvelopeSchema } from "./decision-C11xuud2.mjs";
|
|
2
2
|
import { NoObjectGeneratedError, Output, generateText, stepCountIs, streamText, tool } from "ai";
|
|
3
3
|
//#region src/ai-sdk/mappers.ts
|
|
4
4
|
/**
|
|
@@ -232,9 +232,10 @@ const agentExecutionOptions = /* @__PURE__ */ new WeakMap();
|
|
|
232
232
|
* object. `config` is shared by reference across `machine.provide(...)` (unlike
|
|
233
233
|
* the machine object itself), so a predicate registered here travels with the
|
|
234
234
|
* machine through `.provide` — which is why it is keyed on `config`, not the
|
|
235
|
-
* machine. Set by `setupAgent({ isSuspended })` in `createMachine
|
|
236
|
-
* `
|
|
237
|
-
*
|
|
235
|
+
* machine. Set by `setupAgent({ isSuspended })` in `createMachine` and by
|
|
236
|
+
* `setupAgent.fromConfig` (its `isSuspended` option or the config's
|
|
237
|
+
* `suspendedTags`), read by `runAgent` (below the host `options.isSuspended`
|
|
238
|
+
* override, above the timing heuristic).
|
|
238
239
|
*/
|
|
239
240
|
const machineSuspensionPredicates = /* @__PURE__ */ new WeakMap();
|
|
240
241
|
/** Reads the {@link machineSuspensionPredicates} predicate carried by `machine` (via its root `config`), if any. */
|
|
@@ -232,9 +232,10 @@ const agentExecutionOptions = /* @__PURE__ */ new WeakMap();
|
|
|
232
232
|
* object. `config` is shared by reference across `machine.provide(...)` (unlike
|
|
233
233
|
* the machine object itself), so a predicate registered here travels with the
|
|
234
234
|
* machine through `.provide` — which is why it is keyed on `config`, not the
|
|
235
|
-
* machine. Set by `setupAgent({ isSuspended })` in `createMachine
|
|
236
|
-
* `
|
|
237
|
-
*
|
|
235
|
+
* machine. Set by `setupAgent({ isSuspended })` in `createMachine` and by
|
|
236
|
+
* `setupAgent.fromConfig` (its `isSuspended` option or the config's
|
|
237
|
+
* `suspendedTags`), read by `runAgent` (below the host `options.isSuspended`
|
|
238
|
+
* override, above the timing heuristic).
|
|
238
239
|
*/
|
|
239
240
|
const machineSuspensionPredicates = /* @__PURE__ */ new WeakMap();
|
|
240
241
|
/** Reads the {@link machineSuspensionPredicates} predicate carried by `machine` (via its root `config`), if any. */
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_errors = require("./errors-DUBBzRLP.cjs");
|
|
3
|
-
const require_setup_agent = require("./setup-agent-
|
|
4
|
-
const require_decision = require("./decision-
|
|
3
|
+
const require_setup_agent = require("./setup-agent-C3ETi_HZ.cjs");
|
|
4
|
+
const require_decision = require("./decision-DnQCQPew.cjs");
|
|
5
5
|
const require_event_log_store = require("./event-log-store-yquOV1TX.cjs");
|
|
6
6
|
let xstate = require("xstate");
|
|
7
7
|
//#region src/internal/state-request-pass.ts
|
|
@@ -2711,6 +2711,7 @@ exports.getAcceptedEvents = require_decision.getAcceptedEvents;
|
|
|
2711
2711
|
exports.getAgentEffects = require_setup_agent.getAgentEffects;
|
|
2712
2712
|
exports.getAgentMessages = require_decision.getAgentMessages;
|
|
2713
2713
|
exports.getAgentOutputMode = require_decision.getAgentOutputMode;
|
|
2714
|
+
exports.getAgentSchemas = require_setup_agent.getAgentSchemas;
|
|
2714
2715
|
exports.getCallUsage = require_decision.getCallUsage;
|
|
2715
2716
|
exports.getJsonSchema = require_decision.getJsonSchema;
|
|
2716
2717
|
exports.getJsonSchemaSync = require_decision.getJsonSchemaSync;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { C as ToolResultPart, S as ToolMessage, T as WithAgentInputSchema, _ as NormalizedEventSchemas, a as AgentToolChoice, b as TextPart, c as AgentTools, d as ChosenEvent, f as EventUnion, g as InferOutput, h as InferInput, i as AgentTool, l as AllowedEvents, m as ImagePart, n as AgentMessage, o as AgentToolDescriptor, p as FilePart, r as AgentSnapshotStore, s as AgentToolExecute, t as AgentEventSchemaInputMap, u as AssistantMessage, v as StandardSchemaV1, w as UserMessage, x as ToolCallPart, y as SystemMessage } from "./types-pJ5Hn8fv.cjs";
|
|
2
2
|
import { t as AgentError } from "./errors-BQRk9eiZ.cjs";
|
|
3
|
-
import { A as AgentDecisionExecutor, B as AgentEventToolNameResolver, C as buildEnvelopeSchema, D as parseModelRef, E as getCallUsage, F as DecisionLogicConfig, H as AgentRequestSource, I as ResolveDecisionOptions, L as renderDecisionAttempts, M as AgentDecisionInput, N as AgentDecisionRequest, O as parseOutput, P as DecisionAttempt, R as resolveDecision, S as bindRequestExecutor, T as getAgentOutputMode, U as
|
|
3
|
+
import { A as AgentDecisionExecutor, B as AgentEventToolNameResolver, C as buildEnvelopeSchema, D as parseModelRef, E as getCallUsage, F as DecisionLogicConfig, G as parseAgentEvent, H as AgentRequestSource, I as ResolveDecisionOptions, L as renderDecisionAttempts, M as AgentDecisionInput, N as AgentDecisionRequest, O as parseOutput, P as DecisionAttempt, R as resolveDecision, S as bindRequestExecutor, T as getAgentOutputMode, U as AgentSchemas, V as AgentRequestOptions, W as getAcceptedEvents, _ as StructuredOutputEnvelope, a as AgentOutputMode, b as TextLogicExecuteArgs, c as AgentRequestExecutorResult, d as AgentTextRequest, f as AgentUsage, g as BuiltinAgentActors, h as AiSdkShapedTextResult, i as AgentModelRef, j as AgentDecisionExhaustedError, k as parseStructuredEnvelope, l as AgentRequestExecutors, m as AiSdkShapedStreamResult, n as AgentExecutorTextRequest, o as AgentRequestExecutor, p as AgentUserInput, r as AgentModelMap, s as AgentRequestExecutorInfo, t as AgentCallUsage, u as AgentRequestMode, v as TextLogic, w as createTextLogic, x as TextLogicExecutor, y as TextLogicConfig, z as AgentEventDescriptor } from "./text-logic-VcWqO-Cl.cjs";
|
|
4
4
|
import { a as AgentLogVerification, c as assertAgentLogEntry, d as assertEventLogStoreConformance, i as AgentLogEntry, l as assertJsonSerializable, n as AgentEventLogConflictError, o as JsonValue, r as AgentEventLogStore, s as NonSerializableAgentEventError, t as AGENT_EVENT_SCHEMA_VERSION, u as createInMemoryEventLogStore } from "./event-log-store-CQJq8_v4.cjs";
|
|
5
|
-
import { A as AgentEffect, B as ReplayResult, C as traceTransitions, D as executeAgentRequest, E as AgentStepRequest, F as AgentReplayMachineMismatchError, G as replay, H as diffEventLogs, I as AgentUsageEvent, K as verifyReplay, L as CreateReplayEntryOptions, M as AgentEventLogDiff, N as AgentLogPatchOperation, O as AGENT_INIT_EVENT_TYPE, P as AgentReplayDivergenceError, R as GetAgentEffectsOptions, S as serializeTraceEvent, T as AgentRequest, U as getAgentEffects, V as createReplayEntry, W as initEntry, _ as RunAgentResult, a as AgentInputFrom, b as inspectTransitions, c as AgentSnapshotVersionMismatchError, d as GenerateResult, f as InspectedActorRef, g as RunAgentOptions, h as RunAgentErrorCause, i as AgentIllegalResumeEventError, j as AgentEffectDiff, k as AGENT_USAGE_EVENT_TYPE, l as AgentTraceEvent, m as PendingUserInput, n as AgentActorSession, o as AgentMessageInfo, p as JsonSerializableTraceEvent, r as AgentIdleError, s as AgentRunMeta, t as AGENT_TRACE_SCHEMA_VERSION, u as AgentUserInputExecutor, v as createAgentActor, w as AgentStateRequest, x as runAgent, y as generateResult, z as ReplayOptions } from "./run-agent-
|
|
5
|
+
import { A as AgentEffect, B as ReplayResult, C as traceTransitions, D as executeAgentRequest, E as AgentStepRequest, F as AgentReplayMachineMismatchError, G as replay, H as diffEventLogs, I as AgentUsageEvent, K as verifyReplay, L as CreateReplayEntryOptions, M as AgentEventLogDiff, N as AgentLogPatchOperation, O as AGENT_INIT_EVENT_TYPE, P as AgentReplayDivergenceError, R as GetAgentEffectsOptions, S as serializeTraceEvent, T as AgentRequest, U as getAgentEffects, V as createReplayEntry, W as initEntry, _ as RunAgentResult, a as AgentInputFrom, b as inspectTransitions, c as AgentSnapshotVersionMismatchError, d as GenerateResult, f as InspectedActorRef, g as RunAgentOptions, h as RunAgentErrorCause, i as AgentIllegalResumeEventError, j as AgentEffectDiff, k as AGENT_USAGE_EVENT_TYPE, l as AgentTraceEvent, m as PendingUserInput, n as AgentActorSession, o as AgentMessageInfo, p as JsonSerializableTraceEvent, r as AgentIdleError, s as AgentRunMeta, t as AGENT_TRACE_SCHEMA_VERSION, u as AgentUserInputExecutor, v as createAgentActor, w as AgentStateRequest, x as runAgent, y as generateResult, z as ReplayOptions } from "./run-agent-r9OD4z8F.cjs";
|
|
6
6
|
import { AnyActorLogic, AnyMachineSnapshot, AnySetupConfig, AnyStateMachine, AsyncActorLogic, EventFromLogic, EventObject, InputFrom, MachineContext, MetaObject, NonReducibleUnknown, SetupReturnFromConfig, SetupStateSchema, SnapshotFrom, StateValue } from "xstate";
|
|
7
7
|
|
|
8
8
|
//#region src/messages.d.ts
|
|
@@ -96,6 +96,17 @@ interface AgentWorkflowConfig {
|
|
|
96
96
|
actors?: Record<string, AgentWorkflowActorConfig>;
|
|
97
97
|
initial: string;
|
|
98
98
|
states: Record<string, AgentWorkflowStateConfig>;
|
|
99
|
+
/**
|
|
100
|
+
* State tags that mark an INTENTIONAL wait for an external event (a human
|
|
101
|
+
* approval, an inbound webhook, …) — the declarative form of `setupAgent({
|
|
102
|
+
* isSuspended })`, since a config cannot carry a function. Lowered to a
|
|
103
|
+
* `snapshot.hasTag(...)`-any-of predicate so `runAgent` settles those
|
|
104
|
+
* snapshots idle deterministically instead of using its timing heuristic.
|
|
105
|
+
* Every listed tag must appear in some state's `tags` — an unused tag is a
|
|
106
|
+
* build-time error. A `fromConfig(config, { isSuspended })` option takes
|
|
107
|
+
* precedence; a `runAgent({ isSuspended })` host override beats both.
|
|
108
|
+
*/
|
|
109
|
+
suspendedTags?: string[];
|
|
99
110
|
meta?: Record<string, unknown>;
|
|
100
111
|
}
|
|
101
112
|
/** A `requests` entry in {@link AgentWorkflowConfig} — the JSON equivalent of a `setupAgent({ requests })` `TextLogicConfig`. Fields beyond `input`/`output`/`tools`/`mode`/`description` are `unknown` because they accept template-expression strings (see {@link AgentWorkflowConfig}). */
|
|
@@ -228,6 +239,16 @@ interface FromConfigOptions {
|
|
|
228
239
|
* implementation here is a build-time error.
|
|
229
240
|
*/
|
|
230
241
|
actions?: Record<string, (params: any) => unknown>;
|
|
242
|
+
/**
|
|
243
|
+
* Detects a snapshot that is an INTENTIONAL wait for an external event —
|
|
244
|
+
* the same machine-carried predicate `setupAgent({ isSuspended })` declares
|
|
245
|
+
* for TS-authored machines, registered here because a function cannot live
|
|
246
|
+
* in the workflow config itself. Takes precedence over the config's
|
|
247
|
+
* declarative {@link AgentWorkflowConfig.suspendedTags}; a
|
|
248
|
+
* `runAgent({ isSuspended })` host override beats both. Travels with the
|
|
249
|
+
* machine through `machine.provide(...)`.
|
|
250
|
+
*/
|
|
251
|
+
isSuspended?: (snapshot: AnyMachineSnapshot) => boolean;
|
|
231
252
|
}
|
|
232
253
|
//#endregion
|
|
233
254
|
//#region src/setup-agent.d.ts
|
|
@@ -500,6 +521,18 @@ declare namespace setupAgent {
|
|
|
500
521
|
*/
|
|
501
522
|
function fromConfig(config: AgentWorkflowConfig, options: FromConfigOptions): FromConfigResult;
|
|
502
523
|
}
|
|
524
|
+
/**
|
|
525
|
+
* The schema pack a machine was built with — `setupAgent(...).createMachine`
|
|
526
|
+
* and `setupAgent.fromConfig(...)` both register one, so hosts can read a
|
|
527
|
+
* machine's input/event schemas at runtime without knowing how it was
|
|
528
|
+
* authored. Returns `undefined` for machines not built by either (a plain
|
|
529
|
+
* xstate `createMachine`/`setup` machine).
|
|
530
|
+
*
|
|
531
|
+
* Registration is keyed on the machine object, so a machine returned by
|
|
532
|
+
* `machine.provide(...)` carries no pack — read it from the machine the setup
|
|
533
|
+
* returned.
|
|
534
|
+
*/
|
|
535
|
+
declare function getAgentSchemas(machine: AnyStateMachine): AgentSchemas | undefined;
|
|
503
536
|
//#endregion
|
|
504
537
|
//#region src/agent-run.d.ts
|
|
505
538
|
/**
|
|
@@ -1220,4 +1253,4 @@ interface RunSeamResult<TMachine extends AnyStateMachine> {
|
|
|
1220
1253
|
*/
|
|
1221
1254
|
declare function runSeam<TMachine extends AnyStateMachine>(machine: TMachine, options: RunSeamOptions<TMachine>): Promise<RunSeamResult<TMachine>>;
|
|
1222
1255
|
//#endregion
|
|
1223
|
-
export { AGENT_EVENT_SCHEMA_VERSION, AGENT_INIT_EVENT_TYPE, AGENT_TRACE_SCHEMA_VERSION, AGENT_USAGE_EVENT_TYPE, type AgentActorSession, type AgentCallUsage, type AgentDecisionExecutor, AgentDecisionExhaustedError, type AgentDecisionInput, type AgentDecisionRequest, type AgentEffect, type AgentEffectDiff, AgentError, type AgentEventDescriptor, AgentEventLogConflictError, type AgentEventLogDiff, type AgentEventLogStore, type AgentEventToolNameResolver, type AgentExecutorTextRequest, AgentIdleError, AgentIllegalResumeEventError, type AgentInputFrom, type AgentLintDiagnostic, AgentLintError, type AgentLintSeverity, type AgentLogEntry, type AgentLogPatchOperation, type AgentLogVerification, type AgentMessage, type AgentMessageInfo, type AgentModelRef, type AgentOutputMode, type AgentPathReport, type AgentPathTerminal, AgentReplayDivergenceError, AgentReplayMachineMismatchError, type AgentRequest, type AgentRequestExecutor, type AgentRequestExecutorInfo, type AgentRequestExecutorResult, type AgentRequestExecutors, type AgentRequestOptions, type AgentRequestSource, type AgentRun, type AgentRunMeta, type AgentSchemaPack, type AgentSnapshotStore, AgentSnapshotVersionMismatchError, type AgentStateRequest, type AgentStepRequest, type AgentTextRequest, type AgentTool, type AgentToolChoice, type AgentToolDescriptor, type AgentToolExecute, type AgentTools, type AgentTraceEvent, type AgentUsage, type AgentUsageEvent, type AgentUsageEventPayload, type AgentUserInput, type AgentUserInputExecutor, type AgentWorkflowActionConfig, type AgentWorkflowActorConfig, type AgentWorkflowConfig, type AgentWorkflowInvokeConfig, type AgentWorkflowRequestConfig, type AgentWorkflowStateConfig, type AgentWorkflowTransitionConfig, type AiSdkShapedStreamResult, type AiSdkShapedTextResult, type AllowedEvents, type AssertAgentMachineOptions, type AssistantMessage, type CanReachResult, type ChosenEvent, type CreateReplayEntryOptions, type DecisionAttempt, type DecisionLogicConfig, type ExplorePathsOptions, type FilePart, type FromConfigOptions, type FromConfigResult, type GenerateResult, type GetAgentEffectsOptions, type ImagePart, type InferInput, type InferOutput, type InspectedActorRef, type JsonSerializableTraceEvent, type JsonValue, type LintAgentMachineOptions, type MatchTrajectoryOptions, NonSerializableAgentEventError, type PendingUserInput, type ProvideExecutorsOptions, type ReplayOptions, type ReplayResult, type ResolveDecisionOptions, type RunAgentErrorCause, type RunAgentOptions, type RunAgentResult, type RunSeamOptions, type RunSeamResult, type SchemaCompiler, type ScriptedDecisionEntry, type ScriptedDecisionValue, type ScriptedExecutorsScript, type ScriptedTextEntry, type SeamRef, type SeamSlice, type SeamTurn, type SimulateAgentOptions, type SimulateAgentResult, type SimulationScript, type SimulationTrailEntry, type StandardSchemaV1, type StructuredOutputEnvelope, type SystemMessage, type TextLogic, type TextLogicConfig, type TextLogicExecuteArgs, type TextLogicExecutor, type TextPart, type ToolCallPart, type ToolMessage, type ToolResultPart, type TrajectoryEvent, type TrajectoryItem, type TrajectoryMatch, type TrajectoryMiss, type UserMessage, type WithAgentUsageEvent, appendMessages, assertAgentLogEntry, assertAgentMachine, assertEventLogStoreConformance, assertJsonSerializable, assistantMessage, bindRequestExecutor, buildEnvelopeSchema, canReach, createAgentActor, createAgentRun, createAgentSchemas, createInMemoryEventLogStore, createReplayEntry, createScriptedExecutors, createTextLogic, diffEventLogs, executeAgentRequest, explorePaths, generateResult, getAcceptedEvents, getAgentEffects, getAgentMessages, getAgentOutputMode, getCallUsage, getJsonSchema, getJsonSchemaSync, getMachineStructuralHash, getStateMeta, initEntry, inspectTransitions, isStandardSchema, lintAgentMachine, matchesTrajectory, messagesSchema, parseAgentEvent, parseModelRef, parseOutput, parseStructuredEnvelope, persistSnapshot, provideExecutors, renderDecisionAttempts, replay, resolveDecision, runAgent, runSeam, serializeTraceEvent, setupAgent, simulateAgent, systemMessage, toolMessage, traceTransitions, userMessage, verifyReplay };
|
|
1256
|
+
export { AGENT_EVENT_SCHEMA_VERSION, AGENT_INIT_EVENT_TYPE, AGENT_TRACE_SCHEMA_VERSION, AGENT_USAGE_EVENT_TYPE, type AgentActorSession, type AgentCallUsage, type AgentDecisionExecutor, AgentDecisionExhaustedError, type AgentDecisionInput, type AgentDecisionRequest, type AgentEffect, type AgentEffectDiff, AgentError, type AgentEventDescriptor, AgentEventLogConflictError, type AgentEventLogDiff, type AgentEventLogStore, type AgentEventToolNameResolver, type AgentExecutorTextRequest, AgentIdleError, AgentIllegalResumeEventError, type AgentInputFrom, type AgentLintDiagnostic, AgentLintError, type AgentLintSeverity, type AgentLogEntry, type AgentLogPatchOperation, type AgentLogVerification, type AgentMessage, type AgentMessageInfo, type AgentModelRef, type AgentOutputMode, type AgentPathReport, type AgentPathTerminal, AgentReplayDivergenceError, AgentReplayMachineMismatchError, type AgentRequest, type AgentRequestExecutor, type AgentRequestExecutorInfo, type AgentRequestExecutorResult, type AgentRequestExecutors, type AgentRequestOptions, type AgentRequestSource, type AgentRun, type AgentRunMeta, type AgentSchemaPack, type AgentSchemas, type AgentSnapshotStore, AgentSnapshotVersionMismatchError, type AgentStateRequest, type AgentStepRequest, type AgentTextRequest, type AgentTool, type AgentToolChoice, type AgentToolDescriptor, type AgentToolExecute, type AgentTools, type AgentTraceEvent, type AgentUsage, type AgentUsageEvent, type AgentUsageEventPayload, type AgentUserInput, type AgentUserInputExecutor, type AgentWorkflowActionConfig, type AgentWorkflowActorConfig, type AgentWorkflowConfig, type AgentWorkflowInvokeConfig, type AgentWorkflowRequestConfig, type AgentWorkflowStateConfig, type AgentWorkflowTransitionConfig, type AiSdkShapedStreamResult, type AiSdkShapedTextResult, type AllowedEvents, type AssertAgentMachineOptions, type AssistantMessage, type CanReachResult, type ChosenEvent, type CreateReplayEntryOptions, type DecisionAttempt, type DecisionLogicConfig, type ExplorePathsOptions, type FilePart, type FromConfigOptions, type FromConfigResult, type GenerateResult, type GetAgentEffectsOptions, type ImagePart, type InferInput, type InferOutput, type InspectedActorRef, type JsonSerializableTraceEvent, type JsonValue, type LintAgentMachineOptions, type MatchTrajectoryOptions, NonSerializableAgentEventError, type PendingUserInput, type ProvideExecutorsOptions, type ReplayOptions, type ReplayResult, type ResolveDecisionOptions, type RunAgentErrorCause, type RunAgentOptions, type RunAgentResult, type RunSeamOptions, type RunSeamResult, type SchemaCompiler, type ScriptedDecisionEntry, type ScriptedDecisionValue, type ScriptedExecutorsScript, type ScriptedTextEntry, type SeamRef, type SeamSlice, type SeamTurn, type SimulateAgentOptions, type SimulateAgentResult, type SimulationScript, type SimulationTrailEntry, type StandardSchemaV1, type StructuredOutputEnvelope, type SystemMessage, type TextLogic, type TextLogicConfig, type TextLogicExecuteArgs, type TextLogicExecutor, type TextPart, type ToolCallPart, type ToolMessage, type ToolResultPart, type TrajectoryEvent, type TrajectoryItem, type TrajectoryMatch, type TrajectoryMiss, type UserMessage, type WithAgentUsageEvent, appendMessages, assertAgentLogEntry, assertAgentMachine, assertEventLogStoreConformance, assertJsonSerializable, assistantMessage, bindRequestExecutor, buildEnvelopeSchema, canReach, createAgentActor, createAgentRun, createAgentSchemas, createInMemoryEventLogStore, createReplayEntry, createScriptedExecutors, createTextLogic, diffEventLogs, executeAgentRequest, explorePaths, generateResult, getAcceptedEvents, getAgentEffects, getAgentMessages, getAgentOutputMode, getAgentSchemas, getCallUsage, getJsonSchema, getJsonSchemaSync, getMachineStructuralHash, getStateMeta, initEntry, inspectTransitions, isStandardSchema, lintAgentMachine, matchesTrajectory, messagesSchema, parseAgentEvent, parseModelRef, parseOutput, parseStructuredEnvelope, persistSnapshot, provideExecutors, renderDecisionAttempts, replay, resolveDecision, runAgent, runSeam, serializeTraceEvent, setupAgent, simulateAgent, systemMessage, toolMessage, traceTransitions, userMessage, verifyReplay };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { C as ToolResultPart, S as ToolMessage, T as WithAgentInputSchema, _ as NormalizedEventSchemas, a as AgentToolChoice, b as TextPart, c as AgentTools, d as ChosenEvent, f as EventUnion, g as InferOutput, h as InferInput, i as AgentTool, l as AllowedEvents, m as ImagePart, n as AgentMessage, o as AgentToolDescriptor, p as FilePart, r as AgentSnapshotStore, s as AgentToolExecute, t as AgentEventSchemaInputMap, u as AssistantMessage, v as StandardSchemaV1, w as UserMessage, x as ToolCallPart, y as SystemMessage } from "./types-DYpK3QF4.mjs";
|
|
2
2
|
import { t as AgentError } from "./errors-C9rxnWbX.mjs";
|
|
3
|
-
import { A as AgentDecisionExecutor, B as AgentEventToolNameResolver, C as buildEnvelopeSchema, D as parseModelRef, E as getCallUsage, F as DecisionLogicConfig, H as AgentRequestSource, I as ResolveDecisionOptions, L as renderDecisionAttempts, M as AgentDecisionInput, N as AgentDecisionRequest, O as parseOutput, P as DecisionAttempt, R as resolveDecision, S as bindRequestExecutor, T as getAgentOutputMode, U as
|
|
3
|
+
import { A as AgentDecisionExecutor, B as AgentEventToolNameResolver, C as buildEnvelopeSchema, D as parseModelRef, E as getCallUsage, F as DecisionLogicConfig, G as parseAgentEvent, H as AgentRequestSource, I as ResolveDecisionOptions, L as renderDecisionAttempts, M as AgentDecisionInput, N as AgentDecisionRequest, O as parseOutput, P as DecisionAttempt, R as resolveDecision, S as bindRequestExecutor, T as getAgentOutputMode, U as AgentSchemas, V as AgentRequestOptions, W as getAcceptedEvents, _ as StructuredOutputEnvelope, a as AgentOutputMode, b as TextLogicExecuteArgs, c as AgentRequestExecutorResult, d as AgentTextRequest, f as AgentUsage, g as BuiltinAgentActors, h as AiSdkShapedTextResult, i as AgentModelRef, j as AgentDecisionExhaustedError, k as parseStructuredEnvelope, l as AgentRequestExecutors, m as AiSdkShapedStreamResult, n as AgentExecutorTextRequest, o as AgentRequestExecutor, p as AgentUserInput, r as AgentModelMap, s as AgentRequestExecutorInfo, t as AgentCallUsage, u as AgentRequestMode, v as TextLogic, w as createTextLogic, x as TextLogicExecutor, y as TextLogicConfig, z as AgentEventDescriptor } from "./text-logic-RvnlD-An.mjs";
|
|
4
4
|
import { a as AgentLogVerification, c as assertAgentLogEntry, d as assertEventLogStoreConformance, i as AgentLogEntry, l as assertJsonSerializable, n as AgentEventLogConflictError, o as JsonValue, r as AgentEventLogStore, s as NonSerializableAgentEventError, t as AGENT_EVENT_SCHEMA_VERSION, u as createInMemoryEventLogStore } from "./event-log-store-BrC9Q1xW.mjs";
|
|
5
|
-
import { A as AgentEffect, B as ReplayResult, C as traceTransitions, D as executeAgentRequest, E as AgentStepRequest, F as AgentReplayMachineMismatchError, G as replay, H as diffEventLogs, I as AgentUsageEvent, K as verifyReplay, L as CreateReplayEntryOptions, M as AgentEventLogDiff, N as AgentLogPatchOperation, O as AGENT_INIT_EVENT_TYPE, P as AgentReplayDivergenceError, R as GetAgentEffectsOptions, S as serializeTraceEvent, T as AgentRequest, U as getAgentEffects, V as createReplayEntry, W as initEntry, _ as RunAgentResult, a as AgentInputFrom, b as inspectTransitions, c as AgentSnapshotVersionMismatchError, d as GenerateResult, f as InspectedActorRef, g as RunAgentOptions, h as RunAgentErrorCause, i as AgentIllegalResumeEventError, j as AgentEffectDiff, k as AGENT_USAGE_EVENT_TYPE, l as AgentTraceEvent, m as PendingUserInput, n as AgentActorSession, o as AgentMessageInfo, p as JsonSerializableTraceEvent, r as AgentIdleError, s as AgentRunMeta, t as AGENT_TRACE_SCHEMA_VERSION, u as AgentUserInputExecutor, v as createAgentActor, w as AgentStateRequest, x as runAgent, y as generateResult, z as ReplayOptions } from "./run-agent-
|
|
5
|
+
import { A as AgentEffect, B as ReplayResult, C as traceTransitions, D as executeAgentRequest, E as AgentStepRequest, F as AgentReplayMachineMismatchError, G as replay, H as diffEventLogs, I as AgentUsageEvent, K as verifyReplay, L as CreateReplayEntryOptions, M as AgentEventLogDiff, N as AgentLogPatchOperation, O as AGENT_INIT_EVENT_TYPE, P as AgentReplayDivergenceError, R as GetAgentEffectsOptions, S as serializeTraceEvent, T as AgentRequest, U as getAgentEffects, V as createReplayEntry, W as initEntry, _ as RunAgentResult, a as AgentInputFrom, b as inspectTransitions, c as AgentSnapshotVersionMismatchError, d as GenerateResult, f as InspectedActorRef, g as RunAgentOptions, h as RunAgentErrorCause, i as AgentIllegalResumeEventError, j as AgentEffectDiff, k as AGENT_USAGE_EVENT_TYPE, l as AgentTraceEvent, m as PendingUserInput, n as AgentActorSession, o as AgentMessageInfo, p as JsonSerializableTraceEvent, r as AgentIdleError, s as AgentRunMeta, t as AGENT_TRACE_SCHEMA_VERSION, u as AgentUserInputExecutor, v as createAgentActor, w as AgentStateRequest, x as runAgent, y as generateResult, z as ReplayOptions } from "./run-agent-DQIDikfd.mjs";
|
|
6
6
|
import { AnyActorLogic, AnyMachineSnapshot, AnySetupConfig, AnyStateMachine, AsyncActorLogic, EventFromLogic, EventObject, InputFrom, MachineContext, MetaObject, NonReducibleUnknown, SetupReturnFromConfig, SetupStateSchema, SnapshotFrom, StateValue } from "xstate";
|
|
7
7
|
|
|
8
8
|
//#region src/messages.d.ts
|
|
@@ -96,6 +96,17 @@ interface AgentWorkflowConfig {
|
|
|
96
96
|
actors?: Record<string, AgentWorkflowActorConfig>;
|
|
97
97
|
initial: string;
|
|
98
98
|
states: Record<string, AgentWorkflowStateConfig>;
|
|
99
|
+
/**
|
|
100
|
+
* State tags that mark an INTENTIONAL wait for an external event (a human
|
|
101
|
+
* approval, an inbound webhook, …) — the declarative form of `setupAgent({
|
|
102
|
+
* isSuspended })`, since a config cannot carry a function. Lowered to a
|
|
103
|
+
* `snapshot.hasTag(...)`-any-of predicate so `runAgent` settles those
|
|
104
|
+
* snapshots idle deterministically instead of using its timing heuristic.
|
|
105
|
+
* Every listed tag must appear in some state's `tags` — an unused tag is a
|
|
106
|
+
* build-time error. A `fromConfig(config, { isSuspended })` option takes
|
|
107
|
+
* precedence; a `runAgent({ isSuspended })` host override beats both.
|
|
108
|
+
*/
|
|
109
|
+
suspendedTags?: string[];
|
|
99
110
|
meta?: Record<string, unknown>;
|
|
100
111
|
}
|
|
101
112
|
/** A `requests` entry in {@link AgentWorkflowConfig} — the JSON equivalent of a `setupAgent({ requests })` `TextLogicConfig`. Fields beyond `input`/`output`/`tools`/`mode`/`description` are `unknown` because they accept template-expression strings (see {@link AgentWorkflowConfig}). */
|
|
@@ -228,6 +239,16 @@ interface FromConfigOptions {
|
|
|
228
239
|
* implementation here is a build-time error.
|
|
229
240
|
*/
|
|
230
241
|
actions?: Record<string, (params: any) => unknown>;
|
|
242
|
+
/**
|
|
243
|
+
* Detects a snapshot that is an INTENTIONAL wait for an external event —
|
|
244
|
+
* the same machine-carried predicate `setupAgent({ isSuspended })` declares
|
|
245
|
+
* for TS-authored machines, registered here because a function cannot live
|
|
246
|
+
* in the workflow config itself. Takes precedence over the config's
|
|
247
|
+
* declarative {@link AgentWorkflowConfig.suspendedTags}; a
|
|
248
|
+
* `runAgent({ isSuspended })` host override beats both. Travels with the
|
|
249
|
+
* machine through `machine.provide(...)`.
|
|
250
|
+
*/
|
|
251
|
+
isSuspended?: (snapshot: AnyMachineSnapshot) => boolean;
|
|
231
252
|
}
|
|
232
253
|
//#endregion
|
|
233
254
|
//#region src/setup-agent.d.ts
|
|
@@ -500,6 +521,18 @@ declare namespace setupAgent {
|
|
|
500
521
|
*/
|
|
501
522
|
function fromConfig(config: AgentWorkflowConfig, options: FromConfigOptions): FromConfigResult;
|
|
502
523
|
}
|
|
524
|
+
/**
|
|
525
|
+
* The schema pack a machine was built with — `setupAgent(...).createMachine`
|
|
526
|
+
* and `setupAgent.fromConfig(...)` both register one, so hosts can read a
|
|
527
|
+
* machine's input/event schemas at runtime without knowing how it was
|
|
528
|
+
* authored. Returns `undefined` for machines not built by either (a plain
|
|
529
|
+
* xstate `createMachine`/`setup` machine).
|
|
530
|
+
*
|
|
531
|
+
* Registration is keyed on the machine object, so a machine returned by
|
|
532
|
+
* `machine.provide(...)` carries no pack — read it from the machine the setup
|
|
533
|
+
* returned.
|
|
534
|
+
*/
|
|
535
|
+
declare function getAgentSchemas(machine: AnyStateMachine): AgentSchemas | undefined;
|
|
503
536
|
//#endregion
|
|
504
537
|
//#region src/agent-run.d.ts
|
|
505
538
|
/**
|
|
@@ -1220,4 +1253,4 @@ interface RunSeamResult<TMachine extends AnyStateMachine> {
|
|
|
1220
1253
|
*/
|
|
1221
1254
|
declare function runSeam<TMachine extends AnyStateMachine>(machine: TMachine, options: RunSeamOptions<TMachine>): Promise<RunSeamResult<TMachine>>;
|
|
1222
1255
|
//#endregion
|
|
1223
|
-
export { AGENT_EVENT_SCHEMA_VERSION, AGENT_INIT_EVENT_TYPE, AGENT_TRACE_SCHEMA_VERSION, AGENT_USAGE_EVENT_TYPE, type AgentActorSession, type AgentCallUsage, type AgentDecisionExecutor, AgentDecisionExhaustedError, type AgentDecisionInput, type AgentDecisionRequest, type AgentEffect, type AgentEffectDiff, AgentError, type AgentEventDescriptor, AgentEventLogConflictError, type AgentEventLogDiff, type AgentEventLogStore, type AgentEventToolNameResolver, type AgentExecutorTextRequest, AgentIdleError, AgentIllegalResumeEventError, type AgentInputFrom, type AgentLintDiagnostic, AgentLintError, type AgentLintSeverity, type AgentLogEntry, type AgentLogPatchOperation, type AgentLogVerification, type AgentMessage, type AgentMessageInfo, type AgentModelRef, type AgentOutputMode, type AgentPathReport, type AgentPathTerminal, AgentReplayDivergenceError, AgentReplayMachineMismatchError, type AgentRequest, type AgentRequestExecutor, type AgentRequestExecutorInfo, type AgentRequestExecutorResult, type AgentRequestExecutors, type AgentRequestOptions, type AgentRequestSource, type AgentRun, type AgentRunMeta, type AgentSchemaPack, type AgentSnapshotStore, AgentSnapshotVersionMismatchError, type AgentStateRequest, type AgentStepRequest, type AgentTextRequest, type AgentTool, type AgentToolChoice, type AgentToolDescriptor, type AgentToolExecute, type AgentTools, type AgentTraceEvent, type AgentUsage, type AgentUsageEvent, type AgentUsageEventPayload, type AgentUserInput, type AgentUserInputExecutor, type AgentWorkflowActionConfig, type AgentWorkflowActorConfig, type AgentWorkflowConfig, type AgentWorkflowInvokeConfig, type AgentWorkflowRequestConfig, type AgentWorkflowStateConfig, type AgentWorkflowTransitionConfig, type AiSdkShapedStreamResult, type AiSdkShapedTextResult, type AllowedEvents, type AssertAgentMachineOptions, type AssistantMessage, type CanReachResult, type ChosenEvent, type CreateReplayEntryOptions, type DecisionAttempt, type DecisionLogicConfig, type ExplorePathsOptions, type FilePart, type FromConfigOptions, type FromConfigResult, type GenerateResult, type GetAgentEffectsOptions, type ImagePart, type InferInput, type InferOutput, type InspectedActorRef, type JsonSerializableTraceEvent, type JsonValue, type LintAgentMachineOptions, type MatchTrajectoryOptions, NonSerializableAgentEventError, type PendingUserInput, type ProvideExecutorsOptions, type ReplayOptions, type ReplayResult, type ResolveDecisionOptions, type RunAgentErrorCause, type RunAgentOptions, type RunAgentResult, type RunSeamOptions, type RunSeamResult, type SchemaCompiler, type ScriptedDecisionEntry, type ScriptedDecisionValue, type ScriptedExecutorsScript, type ScriptedTextEntry, type SeamRef, type SeamSlice, type SeamTurn, type SimulateAgentOptions, type SimulateAgentResult, type SimulationScript, type SimulationTrailEntry, type StandardSchemaV1, type StructuredOutputEnvelope, type SystemMessage, type TextLogic, type TextLogicConfig, type TextLogicExecuteArgs, type TextLogicExecutor, type TextPart, type ToolCallPart, type ToolMessage, type ToolResultPart, type TrajectoryEvent, type TrajectoryItem, type TrajectoryMatch, type TrajectoryMiss, type UserMessage, type WithAgentUsageEvent, appendMessages, assertAgentLogEntry, assertAgentMachine, assertEventLogStoreConformance, assertJsonSerializable, assistantMessage, bindRequestExecutor, buildEnvelopeSchema, canReach, createAgentActor, createAgentRun, createAgentSchemas, createInMemoryEventLogStore, createReplayEntry, createScriptedExecutors, createTextLogic, diffEventLogs, executeAgentRequest, explorePaths, generateResult, getAcceptedEvents, getAgentEffects, getAgentMessages, getAgentOutputMode, getCallUsage, getJsonSchema, getJsonSchemaSync, getMachineStructuralHash, getStateMeta, initEntry, inspectTransitions, isStandardSchema, lintAgentMachine, matchesTrajectory, messagesSchema, parseAgentEvent, parseModelRef, parseOutput, parseStructuredEnvelope, persistSnapshot, provideExecutors, renderDecisionAttempts, replay, resolveDecision, runAgent, runSeam, serializeTraceEvent, setupAgent, simulateAgent, systemMessage, toolMessage, traceTransitions, userMessage, verifyReplay };
|
|
1256
|
+
export { AGENT_EVENT_SCHEMA_VERSION, AGENT_INIT_EVENT_TYPE, AGENT_TRACE_SCHEMA_VERSION, AGENT_USAGE_EVENT_TYPE, type AgentActorSession, type AgentCallUsage, type AgentDecisionExecutor, AgentDecisionExhaustedError, type AgentDecisionInput, type AgentDecisionRequest, type AgentEffect, type AgentEffectDiff, AgentError, type AgentEventDescriptor, AgentEventLogConflictError, type AgentEventLogDiff, type AgentEventLogStore, type AgentEventToolNameResolver, type AgentExecutorTextRequest, AgentIdleError, AgentIllegalResumeEventError, type AgentInputFrom, type AgentLintDiagnostic, AgentLintError, type AgentLintSeverity, type AgentLogEntry, type AgentLogPatchOperation, type AgentLogVerification, type AgentMessage, type AgentMessageInfo, type AgentModelRef, type AgentOutputMode, type AgentPathReport, type AgentPathTerminal, AgentReplayDivergenceError, AgentReplayMachineMismatchError, type AgentRequest, type AgentRequestExecutor, type AgentRequestExecutorInfo, type AgentRequestExecutorResult, type AgentRequestExecutors, type AgentRequestOptions, type AgentRequestSource, type AgentRun, type AgentRunMeta, type AgentSchemaPack, type AgentSchemas, type AgentSnapshotStore, AgentSnapshotVersionMismatchError, type AgentStateRequest, type AgentStepRequest, type AgentTextRequest, type AgentTool, type AgentToolChoice, type AgentToolDescriptor, type AgentToolExecute, type AgentTools, type AgentTraceEvent, type AgentUsage, type AgentUsageEvent, type AgentUsageEventPayload, type AgentUserInput, type AgentUserInputExecutor, type AgentWorkflowActionConfig, type AgentWorkflowActorConfig, type AgentWorkflowConfig, type AgentWorkflowInvokeConfig, type AgentWorkflowRequestConfig, type AgentWorkflowStateConfig, type AgentWorkflowTransitionConfig, type AiSdkShapedStreamResult, type AiSdkShapedTextResult, type AllowedEvents, type AssertAgentMachineOptions, type AssistantMessage, type CanReachResult, type ChosenEvent, type CreateReplayEntryOptions, type DecisionAttempt, type DecisionLogicConfig, type ExplorePathsOptions, type FilePart, type FromConfigOptions, type FromConfigResult, type GenerateResult, type GetAgentEffectsOptions, type ImagePart, type InferInput, type InferOutput, type InspectedActorRef, type JsonSerializableTraceEvent, type JsonValue, type LintAgentMachineOptions, type MatchTrajectoryOptions, NonSerializableAgentEventError, type PendingUserInput, type ProvideExecutorsOptions, type ReplayOptions, type ReplayResult, type ResolveDecisionOptions, type RunAgentErrorCause, type RunAgentOptions, type RunAgentResult, type RunSeamOptions, type RunSeamResult, type SchemaCompiler, type ScriptedDecisionEntry, type ScriptedDecisionValue, type ScriptedExecutorsScript, type ScriptedTextEntry, type SeamRef, type SeamSlice, type SeamTurn, type SimulateAgentOptions, type SimulateAgentResult, type SimulationScript, type SimulationTrailEntry, type StandardSchemaV1, type StructuredOutputEnvelope, type SystemMessage, type TextLogic, type TextLogicConfig, type TextLogicExecuteArgs, type TextLogicExecutor, type TextPart, type ToolCallPart, type ToolMessage, type ToolResultPart, type TrajectoryEvent, type TrajectoryItem, type TrajectoryMatch, type TrajectoryMiss, type UserMessage, type WithAgentUsageEvent, appendMessages, assertAgentLogEntry, assertAgentMachine, assertEventLogStoreConformance, assertJsonSerializable, assistantMessage, bindRequestExecutor, buildEnvelopeSchema, canReach, createAgentActor, createAgentRun, createAgentSchemas, createInMemoryEventLogStore, createReplayEntry, createScriptedExecutors, createTextLogic, diffEventLogs, executeAgentRequest, explorePaths, generateResult, getAcceptedEvents, getAgentEffects, getAgentMessages, getAgentOutputMode, getAgentSchemas, getCallUsage, getJsonSchema, getJsonSchemaSync, getMachineStructuralHash, getStateMeta, initEntry, inspectTransitions, isStandardSchema, lintAgentMachine, matchesTrajectory, messagesSchema, parseAgentEvent, parseModelRef, parseOutput, parseStructuredEnvelope, persistSnapshot, provideExecutors, renderDecisionAttempts, replay, resolveDecision, runAgent, runSeam, serializeTraceEvent, setupAgent, simulateAgent, systemMessage, toolMessage, traceTransitions, userMessage, verifyReplay };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as AgentError } from "./errors-CeSXQx0v.mjs";
|
|
2
|
-
import { _ as
|
|
3
|
-
import { A as isUnboundPlaceholder, B as getMachineStructuralHash, C as parseStructuredEnvelope, D as getMachineStaticTransitionTargets, E as executorBoundLogics, G as toolMessage, H as isStandardSchema, I as findNonSerializableContextPaths, K as userMessage, L as getAgentMessages, O as getMachineSuspensionPredicate, P as assistantMessage, R as getJsonSchema, S as parseOutput, U as persistSnapshot, V as getStateMeta, W as systemMessage, _ as getAgentOutputMode, a as resolveDecision, b as normalizeGeneratorResult, c as AGENT_USAGE_TOKEN_FIELDS, f as bindRequestExecutor, h as createTextLogic, i as renderDecisionAttempts, k as getRegisteredAgentExecutionOptions, o as getAcceptedEvents, p as buildEnvelopeSchema, q as validateSchemaSync, r as isDecisionLogic, s as parseAgentEvent, t as AgentDecisionExhaustedError, u as INTERPRET_SOURCE, v as getCallUsage, x as parseModelRef, y as isTextLogic, z as getJsonSchemaSync } from "./decision-
|
|
2
|
+
import { _ as initialAgentStep, a as AGENT_USAGE_EVENT_TYPE, b as appendMessages, c as createReplayEntry, d as initEntry, f as replay, g as getInvokeEffectMetadata, h as executeAgentRequest, i as AGENT_INIT_EVENT_TYPE, l as diffEventLogs, m as verifyReplay, n as getAgentSchemas, o as AgentReplayDivergenceError, p as validateReplayEntries, r as setupAgent, s as AgentReplayMachineMismatchError, t as createAgentSchemas, u as getAgentEffects, v as resolveAgentStep, x as messagesSchema, y as transitionAgentStep } from "./setup-agent-BrE2zFDy.mjs";
|
|
3
|
+
import { A as isUnboundPlaceholder, B as getMachineStructuralHash, C as parseStructuredEnvelope, D as getMachineStaticTransitionTargets, E as executorBoundLogics, G as toolMessage, H as isStandardSchema, I as findNonSerializableContextPaths, K as userMessage, L as getAgentMessages, O as getMachineSuspensionPredicate, P as assistantMessage, R as getJsonSchema, S as parseOutput, U as persistSnapshot, V as getStateMeta, W as systemMessage, _ as getAgentOutputMode, a as resolveDecision, b as normalizeGeneratorResult, c as AGENT_USAGE_TOKEN_FIELDS, f as bindRequestExecutor, h as createTextLogic, i as renderDecisionAttempts, k as getRegisteredAgentExecutionOptions, o as getAcceptedEvents, p as buildEnvelopeSchema, q as validateSchemaSync, r as isDecisionLogic, s as parseAgentEvent, t as AgentDecisionExhaustedError, u as INTERPRET_SOURCE, v as getCallUsage, x as parseModelRef, y as isTextLogic, z as getJsonSchemaSync } from "./decision-C11xuud2.mjs";
|
|
4
4
|
import { a as assertJsonSerializable, i as assertAgentLogEntry, n as AgentEventLogConflictError, o as createInMemoryEventLogStore, r as NonSerializableAgentEventError, s as assertEventLogStoreConformance, t as AGENT_EVENT_SCHEMA_VERSION } from "./event-log-store-B-1fcfkT.mjs";
|
|
5
5
|
import { createActor, createAsyncLogic, getNextTransitions, isMachineSnapshot } from "xstate";
|
|
6
6
|
//#region src/internal/state-request-pass.ts
|
|
@@ -2672,4 +2672,4 @@ async function runSeam(machine, options) {
|
|
|
2672
2672
|
};
|
|
2673
2673
|
}
|
|
2674
2674
|
//#endregion
|
|
2675
|
-
export { AGENT_EVENT_SCHEMA_VERSION, AGENT_INIT_EVENT_TYPE, AGENT_TRACE_SCHEMA_VERSION, AGENT_USAGE_EVENT_TYPE, AgentDecisionExhaustedError, AgentError, AgentEventLogConflictError, AgentIdleError, AgentIllegalResumeEventError, AgentLintError, AgentReplayDivergenceError, AgentReplayMachineMismatchError, AgentSnapshotVersionMismatchError, NonSerializableAgentEventError, appendMessages, assertAgentLogEntry, assertAgentMachine, assertEventLogStoreConformance, assertJsonSerializable, assistantMessage, bindRequestExecutor, buildEnvelopeSchema, canReach, createAgentActor, createAgentRun, createAgentSchemas, createInMemoryEventLogStore, createReplayEntry, createScriptedExecutors, createTextLogic, diffEventLogs, executeAgentRequest, explorePaths, generateResult, getAcceptedEvents, getAgentEffects, getAgentMessages, getAgentOutputMode, getCallUsage, getJsonSchema, getJsonSchemaSync, getMachineStructuralHash, getStateMeta, initEntry, inspectTransitions, isStandardSchema, lintAgentMachine, matchesTrajectory, messagesSchema, parseAgentEvent, parseModelRef, parseOutput, parseStructuredEnvelope, persistSnapshot, provideExecutors, renderDecisionAttempts, replay, resolveDecision, runAgent, runSeam, serializeTraceEvent, setupAgent, simulateAgent, systemMessage, toolMessage, traceTransitions, userMessage, verifyReplay };
|
|
2675
|
+
export { AGENT_EVENT_SCHEMA_VERSION, AGENT_INIT_EVENT_TYPE, AGENT_TRACE_SCHEMA_VERSION, AGENT_USAGE_EVENT_TYPE, AgentDecisionExhaustedError, AgentError, AgentEventLogConflictError, AgentIdleError, AgentIllegalResumeEventError, AgentLintError, AgentReplayDivergenceError, AgentReplayMachineMismatchError, AgentSnapshotVersionMismatchError, NonSerializableAgentEventError, appendMessages, assertAgentLogEntry, assertAgentMachine, assertEventLogStoreConformance, assertJsonSerializable, assistantMessage, bindRequestExecutor, buildEnvelopeSchema, canReach, createAgentActor, createAgentRun, createAgentSchemas, createInMemoryEventLogStore, createReplayEntry, createScriptedExecutors, createTextLogic, diffEventLogs, executeAgentRequest, explorePaths, generateResult, getAcceptedEvents, getAgentEffects, getAgentMessages, getAgentOutputMode, getAgentSchemas, getCallUsage, getJsonSchema, getJsonSchemaSync, getMachineStructuralHash, getStateMeta, initEntry, inspectTransitions, isStandardSchema, lintAgentMachine, matchesTrajectory, messagesSchema, parseAgentEvent, parseModelRef, parseOutput, parseStructuredEnvelope, persistSnapshot, provideExecutors, renderDecisionAttempts, replay, resolveDecision, runAgent, runSeam, serializeTraceEvent, setupAgent, simulateAgent, systemMessage, toolMessage, traceTransitions, userMessage, verifyReplay };
|
package/dist/machines.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_setup_agent = require("./setup-agent-
|
|
2
|
+
const require_setup_agent = require("./setup-agent-C3ETi_HZ.cjs");
|
|
3
3
|
//#region src/machines/internal.ts
|
|
4
4
|
/** The builtin inline text request every preset lowers a request entry to. */
|
|
5
5
|
const GENERATE_TEXT_SRC = "agent.generateText";
|
package/dist/machines.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as setupAgent } from "./setup-agent-BrE2zFDy.mjs";
|
|
2
2
|
//#region src/machines/internal.ts
|
|
3
3
|
/** The builtin inline text request every preset lowers a request entry to. */
|
|
4
4
|
const GENERATE_TEXT_SRC = "agent.generateText";
|
package/dist/otel.d.cts
CHANGED
package/dist/otel.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { T as WithAgentInputSchema, c as AgentTools, d as ChosenEvent, h as InferInput, n as AgentMessage, v as StandardSchemaV1 } from "./types-DYpK3QF4.mjs";
|
|
2
2
|
import { t as AgentError } from "./errors-C9rxnWbX.mjs";
|
|
3
|
-
import { H as AgentRequestSource, N as AgentDecisionRequest, V as AgentRequestOptions, d as AgentTextRequest, f as AgentUsage, l as AgentRequestExecutors, p as AgentUserInput, t as AgentCallUsage, u as AgentRequestMode, z as AgentEventDescriptor } from "./text-logic-
|
|
3
|
+
import { H as AgentRequestSource, N as AgentDecisionRequest, V as AgentRequestOptions, d as AgentTextRequest, f as AgentUsage, l as AgentRequestExecutors, p as AgentUserInput, t as AgentCallUsage, u as AgentRequestMode, z as AgentEventDescriptor } from "./text-logic-RvnlD-An.mjs";
|
|
4
4
|
import { i as AgentLogEntry, o as JsonValue } from "./event-log-store-BrC9Q1xW.mjs";
|
|
5
5
|
import { AnyActorLogic, AnyActorRef, AnyMachineSnapshot, AnyStateMachine, AsyncActorLogic, EmittedFrom, EventFromLogic, EventObject, ExecutableActionObject, InputFrom, InspectionEvent, OutputFrom, Snapshot, SnapshotFrom, createActor } from "xstate";
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { T as WithAgentInputSchema, c as AgentTools, d as ChosenEvent, h as InferInput, n as AgentMessage, v as StandardSchemaV1 } from "./types-pJ5Hn8fv.cjs";
|
|
2
2
|
import { t as AgentError } from "./errors-BQRk9eiZ.cjs";
|
|
3
|
-
import { H as AgentRequestSource, N as AgentDecisionRequest, V as AgentRequestOptions, d as AgentTextRequest, f as AgentUsage, l as AgentRequestExecutors, p as AgentUserInput, t as AgentCallUsage, u as AgentRequestMode, z as AgentEventDescriptor } from "./text-logic-
|
|
3
|
+
import { H as AgentRequestSource, N as AgentDecisionRequest, V as AgentRequestOptions, d as AgentTextRequest, f as AgentUsage, l as AgentRequestExecutors, p as AgentUserInput, t as AgentCallUsage, u as AgentRequestMode, z as AgentEventDescriptor } from "./text-logic-VcWqO-Cl.cjs";
|
|
4
4
|
import { i as AgentLogEntry, o as JsonValue } from "./event-log-store-CQJq8_v4.cjs";
|
|
5
5
|
import { AnyActorLogic, AnyActorRef, AnyMachineSnapshot, AnyStateMachine, AsyncActorLogic, EmittedFrom, EventFromLogic, EventObject, ExecutableActionObject, InputFrom, InspectionEvent, OutputFrom, Snapshot, SnapshotFrom, createActor } from "xstate";
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as AgentError } from "./errors-CeSXQx0v.mjs";
|
|
2
|
-
import { B as getMachineStructuralHash, F as djb2Hex, M as machineSuspensionPredicates, N as missingActor, T as agentExecutionOptions, d as USER_INPUT_ACTOR, g as executeAgentTextRequest, h as createTextLogic, j as machineStaticTransitionTargets, k as getRegisteredAgentExecutionOptions, l as DECIDE_ACTOR, m as builtinTextActors, n as createDecideActor, o as getAcceptedEvents, q as validateSchemaSync, r as isDecisionLogic, w as userInputActor, y as isTextLogic } from "./decision-
|
|
2
|
+
import { B as getMachineStructuralHash, F as djb2Hex, M as machineSuspensionPredicates, N as missingActor, T as agentExecutionOptions, d as USER_INPUT_ACTOR, g as executeAgentTextRequest, h as createTextLogic, j as machineStaticTransitionTargets, k as getRegisteredAgentExecutionOptions, l as DECIDE_ACTOR, m as builtinTextActors, n as createDecideActor, o as getAcceptedEvents, q as validateSchemaSync, r as isDecisionLogic, w as userInputActor, y as isTextLogic } from "./decision-C11xuud2.mjs";
|
|
3
3
|
import { a as assertJsonSerializable, i as assertAgentLogEntry } from "./event-log-store-B-1fcfkT.mjs";
|
|
4
4
|
import { createMachineFromConfig, initialTransition, setup, transition } from "xstate";
|
|
5
5
|
//#region src/messages.ts
|
|
@@ -1128,6 +1128,22 @@ function translateWorkflowConfig(config, translation) {
|
|
|
1128
1128
|
if (json.output === void 0 && finalOutputs.length === 1) json.output = finalOutputs[0];
|
|
1129
1129
|
return json;
|
|
1130
1130
|
}
|
|
1131
|
+
function collectDeclaredStateTags(states, tags = /* @__PURE__ */ new Set()) {
|
|
1132
|
+
for (const state of Object.values(states ?? {})) {
|
|
1133
|
+
for (const tag of state.tags ?? []) tags.add(tag);
|
|
1134
|
+
collectDeclaredStateTags(state.states, tags);
|
|
1135
|
+
}
|
|
1136
|
+
return tags;
|
|
1137
|
+
}
|
|
1138
|
+
function resolveSuspensionPredicate(config, options) {
|
|
1139
|
+
if (options.isSuspended) return options.isSuspended;
|
|
1140
|
+
const suspendedTags = config.suspendedTags ?? [];
|
|
1141
|
+
if (!suspendedTags.length) return;
|
|
1142
|
+
const declaredTags = collectDeclaredStateTags(config.states);
|
|
1143
|
+
const unknown = suspendedTags.filter((tag) => !declaredTags.has(tag));
|
|
1144
|
+
if (unknown.length) throw new Error(`setupAgent.fromConfig: 'suspendedTags' lists ${unknown.map((tag) => `'${tag}'`).join(", ")}, which no state declares in its 'tags'. Tag the waiting state(s) — e.g. "tags": ["${unknown[0]}"] — or remove the entry.`);
|
|
1145
|
+
return (snapshot) => suspendedTags.some((tag) => snapshot.hasTag(tag));
|
|
1146
|
+
}
|
|
1131
1147
|
function setupAgentFromConfig(config, options) {
|
|
1132
1148
|
if (!options || typeof options.compileSchema !== "function") throw new Error("setupAgent.fromConfig(...) requires a 'compileSchema' option: { compileSchema: (jsonSchema, name) => StandardSchemaV1 }. Bring your own JSON Schema engine (Ajv, @cfworker/json-schema, a compiled-Zod-from-JSON-Schema pipeline, ...). Core intentionally ships no JSON Schema engine.");
|
|
1133
1149
|
const { compileSchema } = options;
|
|
@@ -1158,6 +1174,8 @@ function setupAgentFromConfig(config, options) {
|
|
|
1158
1174
|
models: {}
|
|
1159
1175
|
});
|
|
1160
1176
|
if (machine.config) machineStaticTransitionTargets.set(machine.config, translation.transitionTargets);
|
|
1177
|
+
const isSuspended = resolveSuspensionPredicate(config, options);
|
|
1178
|
+
if (isSuspended && machine.config) machineSuspensionPredicates.set(machine.config, isSuspended);
|
|
1161
1179
|
return {
|
|
1162
1180
|
machine,
|
|
1163
1181
|
schemas
|
|
@@ -1404,6 +1422,20 @@ function withRootOutputFromSingleFinal(config) {
|
|
|
1404
1422
|
}
|
|
1405
1423
|
_setupAgent.fromConfig = fromConfig;
|
|
1406
1424
|
})(setupAgent || (setupAgent = {}));
|
|
1425
|
+
/**
|
|
1426
|
+
* The schema pack a machine was built with — `setupAgent(...).createMachine`
|
|
1427
|
+
* and `setupAgent.fromConfig(...)` both register one, so hosts can read a
|
|
1428
|
+
* machine's input/event schemas at runtime without knowing how it was
|
|
1429
|
+
* authored. Returns `undefined` for machines not built by either (a plain
|
|
1430
|
+
* xstate `createMachine`/`setup` machine).
|
|
1431
|
+
*
|
|
1432
|
+
* Registration is keyed on the machine object, so a machine returned by
|
|
1433
|
+
* `machine.provide(...)` carries no pack — read it from the machine the setup
|
|
1434
|
+
* returned.
|
|
1435
|
+
*/
|
|
1436
|
+
function getAgentSchemas(machine) {
|
|
1437
|
+
return agentExecutionOptions.get(machine)?.schemas;
|
|
1438
|
+
}
|
|
1407
1439
|
/** Builds one TextLogic actor per `setupAgent({ requests })` entry. @internal */
|
|
1408
1440
|
function createRequestActors(requests) {
|
|
1409
1441
|
return Object.fromEntries(Object.entries(requests).map(([key, request]) => {
|
|
@@ -1483,4 +1515,4 @@ function createAgentActors(actors, requestActors) {
|
|
|
1483
1515
|
};
|
|
1484
1516
|
}
|
|
1485
1517
|
//#endregion
|
|
1486
|
-
export {
|
|
1518
|
+
export { initialAgentStep as _, AGENT_USAGE_EVENT_TYPE as a, appendMessages as b, createReplayEntry as c, initEntry as d, replay as f, getInvokeEffectMetadata as g, executeAgentRequest as h, AGENT_INIT_EVENT_TYPE as i, diffEventLogs as l, verifyReplay as m, getAgentSchemas as n, AgentReplayDivergenceError as o, validateReplayEntries as p, setupAgent as r, AgentReplayMachineMismatchError as s, createAgentSchemas as t, getAgentEffects as u, resolveAgentStep as v, messagesSchema as x, transitionAgentStep as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_errors = require("./errors-DUBBzRLP.cjs");
|
|
2
|
-
const require_decision = require("./decision-
|
|
2
|
+
const require_decision = require("./decision-DnQCQPew.cjs");
|
|
3
3
|
const require_event_log_store = require("./event-log-store-yquOV1TX.cjs");
|
|
4
4
|
let xstate = require("xstate");
|
|
5
5
|
//#region src/messages.ts
|
|
@@ -1128,6 +1128,22 @@ function translateWorkflowConfig(config, translation) {
|
|
|
1128
1128
|
if (json.output === void 0 && finalOutputs.length === 1) json.output = finalOutputs[0];
|
|
1129
1129
|
return json;
|
|
1130
1130
|
}
|
|
1131
|
+
function collectDeclaredStateTags(states, tags = /* @__PURE__ */ new Set()) {
|
|
1132
|
+
for (const state of Object.values(states ?? {})) {
|
|
1133
|
+
for (const tag of state.tags ?? []) tags.add(tag);
|
|
1134
|
+
collectDeclaredStateTags(state.states, tags);
|
|
1135
|
+
}
|
|
1136
|
+
return tags;
|
|
1137
|
+
}
|
|
1138
|
+
function resolveSuspensionPredicate(config, options) {
|
|
1139
|
+
if (options.isSuspended) return options.isSuspended;
|
|
1140
|
+
const suspendedTags = config.suspendedTags ?? [];
|
|
1141
|
+
if (!suspendedTags.length) return;
|
|
1142
|
+
const declaredTags = collectDeclaredStateTags(config.states);
|
|
1143
|
+
const unknown = suspendedTags.filter((tag) => !declaredTags.has(tag));
|
|
1144
|
+
if (unknown.length) throw new Error(`setupAgent.fromConfig: 'suspendedTags' lists ${unknown.map((tag) => `'${tag}'`).join(", ")}, which no state declares in its 'tags'. Tag the waiting state(s) — e.g. "tags": ["${unknown[0]}"] — or remove the entry.`);
|
|
1145
|
+
return (snapshot) => suspendedTags.some((tag) => snapshot.hasTag(tag));
|
|
1146
|
+
}
|
|
1131
1147
|
function setupAgentFromConfig(config, options) {
|
|
1132
1148
|
if (!options || typeof options.compileSchema !== "function") throw new Error("setupAgent.fromConfig(...) requires a 'compileSchema' option: { compileSchema: (jsonSchema, name) => StandardSchemaV1 }. Bring your own JSON Schema engine (Ajv, @cfworker/json-schema, a compiled-Zod-from-JSON-Schema pipeline, ...). Core intentionally ships no JSON Schema engine.");
|
|
1133
1149
|
const { compileSchema } = options;
|
|
@@ -1158,6 +1174,8 @@ function setupAgentFromConfig(config, options) {
|
|
|
1158
1174
|
models: {}
|
|
1159
1175
|
});
|
|
1160
1176
|
if (machine.config) require_decision.machineStaticTransitionTargets.set(machine.config, translation.transitionTargets);
|
|
1177
|
+
const isSuspended = resolveSuspensionPredicate(config, options);
|
|
1178
|
+
if (isSuspended && machine.config) require_decision.machineSuspensionPredicates.set(machine.config, isSuspended);
|
|
1161
1179
|
return {
|
|
1162
1180
|
machine,
|
|
1163
1181
|
schemas
|
|
@@ -1404,6 +1422,20 @@ function withRootOutputFromSingleFinal(config) {
|
|
|
1404
1422
|
}
|
|
1405
1423
|
_setupAgent.fromConfig = fromConfig;
|
|
1406
1424
|
})(setupAgent || (setupAgent = {}));
|
|
1425
|
+
/**
|
|
1426
|
+
* The schema pack a machine was built with — `setupAgent(...).createMachine`
|
|
1427
|
+
* and `setupAgent.fromConfig(...)` both register one, so hosts can read a
|
|
1428
|
+
* machine's input/event schemas at runtime without knowing how it was
|
|
1429
|
+
* authored. Returns `undefined` for machines not built by either (a plain
|
|
1430
|
+
* xstate `createMachine`/`setup` machine).
|
|
1431
|
+
*
|
|
1432
|
+
* Registration is keyed on the machine object, so a machine returned by
|
|
1433
|
+
* `machine.provide(...)` carries no pack — read it from the machine the setup
|
|
1434
|
+
* returned.
|
|
1435
|
+
*/
|
|
1436
|
+
function getAgentSchemas(machine) {
|
|
1437
|
+
return require_decision.agentExecutionOptions.get(machine)?.schemas;
|
|
1438
|
+
}
|
|
1407
1439
|
/** Builds one TextLogic actor per `setupAgent({ requests })` entry. @internal */
|
|
1408
1440
|
function createRequestActors(requests) {
|
|
1409
1441
|
return Object.fromEntries(Object.entries(requests).map(([key, request]) => {
|
|
@@ -1543,6 +1575,12 @@ Object.defineProperty(exports, "getAgentEffects", {
|
|
|
1543
1575
|
return getAgentEffects;
|
|
1544
1576
|
}
|
|
1545
1577
|
});
|
|
1578
|
+
Object.defineProperty(exports, "getAgentSchemas", {
|
|
1579
|
+
enumerable: true,
|
|
1580
|
+
get: function() {
|
|
1581
|
+
return getAgentSchemas;
|
|
1582
|
+
}
|
|
1583
|
+
});
|
|
1546
1584
|
Object.defineProperty(exports, "getInvokeEffectMetadata", {
|
|
1547
1585
|
enumerable: true,
|
|
1548
1586
|
get: function() {
|
|
@@ -725,4 +725,4 @@ declare function buildEnvelopeSchema(inner: StandardSchemaV1, options?: {
|
|
|
725
725
|
*/
|
|
726
726
|
declare function parseStructuredEnvelope(request: Pick<AgentTextRequest, "outputSchema" | "reasoning">, value: unknown): StructuredOutputEnvelope;
|
|
727
727
|
//#endregion
|
|
728
|
-
export { AgentDecisionExecutor as A, AgentEventToolNameResolver as B, buildEnvelopeSchema as C, parseModelRef as D, getCallUsage as E, DecisionLogicConfig as F, AgentRequestSource as H, ResolveDecisionOptions as I, renderDecisionAttempts as L, AgentDecisionInput as M, AgentDecisionRequest as N, parseOutput as O, DecisionAttempt as P, resolveDecision as R, bindRequestExecutor as S, getAgentOutputMode as T,
|
|
728
|
+
export { AgentDecisionExecutor as A, AgentEventToolNameResolver as B, buildEnvelopeSchema as C, parseModelRef as D, getCallUsage as E, DecisionLogicConfig as F, parseAgentEvent as G, AgentRequestSource as H, ResolveDecisionOptions as I, renderDecisionAttempts as L, AgentDecisionInput as M, AgentDecisionRequest as N, parseOutput as O, DecisionAttempt as P, resolveDecision as R, bindRequestExecutor as S, getAgentOutputMode as T, AgentSchemas as U, AgentRequestOptions as V, getAcceptedEvents as W, StructuredOutputEnvelope as _, AgentOutputMode as a, TextLogicExecuteArgs as b, AgentRequestExecutorResult as c, AgentTextRequest as d, AgentUsage as f, BuiltinAgentActors as g, AiSdkShapedTextResult as h, AgentModelRef as i, AgentDecisionExhaustedError as j, parseStructuredEnvelope as k, AgentRequestExecutors as l, AiSdkShapedStreamResult as m, AgentExecutorTextRequest as n, AgentRequestExecutor as o, AgentUserInput as p, AgentModelMap as r, AgentRequestExecutorInfo as s, AgentCallUsage as t, AgentRequestMode as u, TextLogic as v, createTextLogic as w, TextLogicExecutor as x, TextLogicConfig as y, AgentEventDescriptor as z };
|
|
@@ -725,4 +725,4 @@ declare function buildEnvelopeSchema(inner: StandardSchemaV1, options?: {
|
|
|
725
725
|
*/
|
|
726
726
|
declare function parseStructuredEnvelope(request: Pick<AgentTextRequest, "outputSchema" | "reasoning">, value: unknown): StructuredOutputEnvelope;
|
|
727
727
|
//#endregion
|
|
728
|
-
export { AgentDecisionExecutor as A, AgentEventToolNameResolver as B, buildEnvelopeSchema as C, parseModelRef as D, getCallUsage as E, DecisionLogicConfig as F, AgentRequestSource as H, ResolveDecisionOptions as I, renderDecisionAttempts as L, AgentDecisionInput as M, AgentDecisionRequest as N, parseOutput as O, DecisionAttempt as P, resolveDecision as R, bindRequestExecutor as S, getAgentOutputMode as T,
|
|
728
|
+
export { AgentDecisionExecutor as A, AgentEventToolNameResolver as B, buildEnvelopeSchema as C, parseModelRef as D, getCallUsage as E, DecisionLogicConfig as F, parseAgentEvent as G, AgentRequestSource as H, ResolveDecisionOptions as I, renderDecisionAttempts as L, AgentDecisionInput as M, AgentDecisionRequest as N, parseOutput as O, DecisionAttempt as P, resolveDecision as R, bindRequestExecutor as S, getAgentOutputMode as T, AgentSchemas as U, AgentRequestOptions as V, getAcceptedEvents as W, StructuredOutputEnvelope as _, AgentOutputMode as a, TextLogicExecuteArgs as b, AgentRequestExecutorResult as c, AgentTextRequest as d, AgentUsage as f, BuiltinAgentActors as g, AiSdkShapedTextResult as h, AgentModelRef as i, AgentDecisionExhaustedError as j, parseStructuredEnvelope as k, AgentRequestExecutors as l, AiSdkShapedStreamResult as m, AgentExecutorTextRequest as n, AgentRequestExecutor as o, AgentUserInput as p, AgentModelMap as r, AgentRequestExecutorInfo as s, AgentCallUsage as t, AgentRequestMode as u, TextLogic as v, createTextLogic as w, TextLogicExecutor as x, TextLogicConfig as y, AgentEventDescriptor as z };
|
package/package.json
CHANGED
|
@@ -71,6 +71,14 @@
|
|
|
71
71
|
"$ref": "#/$defs/State"
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
|
+
"suspendedTags": {
|
|
75
|
+
"description": "State tags that mark an intentional wait for an external event (a human approval, an inbound webhook, ...). Lowered by setupAgent.fromConfig(...) into a snapshot.hasTag(...) suspension predicate so runAgent settles those states idle deterministically. Every listed tag must appear in some state's 'tags'.",
|
|
76
|
+
"type": "array",
|
|
77
|
+
"items": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"minLength": 1
|
|
80
|
+
}
|
|
81
|
+
},
|
|
74
82
|
"meta": {
|
|
75
83
|
"$ref": "#/$defs/JsonObject"
|
|
76
84
|
}
|