@statelyai/agent 2.0.0-alpha.7 → 2.0.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ai-sdk.cjs CHANGED
@@ -1,5 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_decision = require("./decision-BnATHy0W.cjs");
2
+ const require_run_agent = require("./run-agent-BQ3vV7UI.cjs");
3
+ const require_decision = require("./decision-b-lkcs4L.cjs");
3
4
  let ai = require("ai");
4
5
  //#region src/ai-sdk/index.ts
5
6
  /**
@@ -85,7 +86,7 @@ function resolveAiSdkModel(options, modelRef) {
85
86
  /**
86
87
  * AI SDK request-mapping settings shared by `generateText`/`streamText`.
87
88
  * `AgentTextRequest.messages` (`AgentMessage[]`) and AI SDK's `ModelMessage[]`
88
- * are structurally compatible by design (§1 of docs/p0-design.md) — the cast
89
+ * are structurally compatible by design (§1 of .scratch/p0-design.md) — the cast
89
90
  * below is a typed identity mapping, not a semantic conversion.
90
91
  */
91
92
  function toAiSdkCallSettings(request) {
@@ -274,8 +275,36 @@ function createAiSdkExecutors(options) {
274
275
  decide
275
276
  };
276
277
  }
278
+ /** AI SDK host for a machine authored with `setupAgent({ models })`. */
279
+ function runAgent(machine, options) {
280
+ const models = require_decision.getRegisteredAgentModels(machine);
281
+ if (!models || Object.keys(models).length === 0) throw new Error("AI SDK runAgent: machine has no models. Pass `models` to setupAgent, or use core runAgent with explicit executors.");
282
+ return require_run_agent.runAgent(machine, {
283
+ ...options,
284
+ executors: createAiSdkExecutors({ models })
285
+ });
286
+ }
287
+ function createAgent(config) {
288
+ const { model, models: configuredModels, schemas, ...machineConfig } = config;
289
+ const models = configuredModels ?? { default: model };
290
+ const executors = createAiSdkExecutors({ models });
291
+ const machine = require_run_agent.setupAgent({
292
+ ...schemas,
293
+ models
294
+ }).createMachine(machineConfig);
295
+ return {
296
+ machine,
297
+ run(runInput, options = {}) {
298
+ return require_run_agent.runAgent(machine, {
299
+ ...options,
300
+ input: runInput,
301
+ executors
302
+ });
303
+ }
304
+ };
305
+ }
277
306
  /** One AI SDK `tool()` per candidate event — the "tool-per-event +
278
- * toolChoice: 'required'" recipe from docs/p0-design.md §2.6. */
307
+ * toolChoice: 'required'" recipe from .scratch/p0-design.md §2.6. */
279
308
  function toAiSdkEventTools(events) {
280
309
  return Object.fromEntries(events.map((event) => [event.toolName, (0, ai.tool)({
281
310
  description: `Choose the '${event.type}' move.`,
@@ -300,10 +329,12 @@ function toDecisionMessages(request) {
300
329
  return messages;
301
330
  }
302
331
  //#endregion
332
+ exports.createAgent = createAgent;
303
333
  exports.createAiSdkExecutors = createAiSdkExecutors;
304
334
  exports.defineModels = defineModels;
305
335
  exports.extractFirstJsonValue = extractFirstJsonValue;
306
336
  exports.isStructuredOutputRequest = isStructuredOutputRequest;
337
+ exports.runAgent = runAgent;
307
338
  exports.toAiSdkCallSettings = toAiSdkCallSettings;
308
339
  exports.toAiSdkEventTools = toAiSdkEventTools;
309
340
  exports.toAiSdkToolChoice = toAiSdkToolChoice;
package/dist/ai-sdk.d.cts CHANGED
@@ -1,5 +1,7 @@
1
- import { c as AgentTools, f as ChosenEvent } from "./types-BHjeDdch.cjs";
2
- import { H as AgentEventDescriptor, i as AgentRequestExecutor, j as AgentDecisionRequest, k as AgentDecisionExecutor, l as AgentTextRequest, s as AgentRequestExecutors } from "./text-logic-4Q2F9kyr.cjs";
1
+ import { C as StandardSchemaV1, m as ChosenEvent, n as AgentEventSchemaInputMap, u as AgentTools } from "./types-C9QiMjre.cjs";
2
+ import { H as AgentEventDescriptor, i as AgentRequestExecutor, j as AgentDecisionRequest, k as AgentDecisionExecutor, l as AgentTextRequest, s as AgentRequestExecutors } from "./text-logic-CZjyACzQ.cjs";
3
+ import { E as AgentMachineConfig, T as AgentMachine, c as RunAgentResult, s as RunAgentOptions } from "./run-agent-BzW4emV_.cjs";
4
+ import * as _$xstate from "xstate";
3
5
  import { FinishReason, LanguageModel, LanguageModelUsage, ModelMessage, Tool, ToolSet, TypedToolCall, TypedToolResult } from "ai";
4
6
 
5
7
  //#region src/ai-sdk/index.d.ts
@@ -54,7 +56,7 @@ type CreateAiSdkExecutorsOptions<TModels extends AiSdkModelMap = AiSdkModelMap>
54
56
  /**
55
57
  * AI SDK request-mapping settings shared by `generateText`/`streamText`.
56
58
  * `AgentTextRequest.messages` (`AgentMessage[]`) and AI SDK's `ModelMessage[]`
57
- * are structurally compatible by design (§1 of docs/p0-design.md) — the cast
59
+ * are structurally compatible by design (§1 of .scratch/p0-design.md) — the cast
58
60
  * below is a typed identity mapping, not a semantic conversion.
59
61
  */
60
62
  declare function toAiSdkCallSettings(request: AgentTextRequest & {
@@ -162,8 +164,35 @@ interface AiSdkExecutors extends AgentRequestExecutors<AiSdkGenerateResult, AiSd
162
164
  * ```
163
165
  */
164
166
  declare function createAiSdkExecutors<TModels extends AiSdkModelMap>(options: CreateAiSdkExecutorsOptions<TModels>): AiSdkExecutors;
167
+ /** AI SDK host for a machine authored with `setupAgent({ models })`. */
168
+ declare function runAgent<TMachine extends _$xstate.AnyStateMachine>(machine: TMachine, options: Omit<RunAgentOptions<TMachine>, "executors">): Promise<RunAgentResult<TMachine>>;
169
+ type CreateAgentMachineConfig<TContextSchema extends StandardSchemaV1<Record<string, unknown>>, TInputSchema extends StandardSchemaV1, TEventSchemas extends AgentEventSchemaInputMap, TOutputSchema extends StandardSchemaV1, TModels extends AiSdkModelMap> = Omit<AgentMachineConfig<TContextSchema, TInputSchema, TEventSchemas, TOutputSchema, TModels>, "schemas">;
170
+ type CreateAgentBaseConfig<TContextSchema extends StandardSchemaV1<Record<string, unknown>>, TInputSchema extends StandardSchemaV1, TEventSchemas extends AgentEventSchemaInputMap, TOutputSchema extends StandardSchemaV1, TModels extends AiSdkModelMap> = CreateAgentMachineConfig<TContextSchema, TInputSchema, TEventSchemas, TOutputSchema, TModels> & {
171
+ schemas: {
172
+ context: TContextSchema;
173
+ input: TInputSchema;
174
+ events?: TEventSchemas;
175
+ output?: TOutputSchema;
176
+ };
177
+ };
178
+ interface CreatedAgent<TMachine extends _$xstate.AnyStateMachine> {
179
+ machine: TMachine;
180
+ run(input: _$xstate.InputFrom<TMachine>, options?: Omit<RunAgentOptions<TMachine>, "input" | "executors">): Promise<RunAgentResult<TMachine>>;
181
+ }
182
+ /**
183
+ * One-call AI SDK entry point for the common case: creates a typed machine and
184
+ * a `run(input)` method with model executors already wired.
185
+ */
186
+ declare function createAgent<TContextSchema extends StandardSchemaV1<Record<string, unknown>>, TInputSchema extends StandardSchemaV1, TEventSchemas extends AgentEventSchemaInputMap = {}, TOutputSchema extends StandardSchemaV1 = StandardSchemaV1>(config: CreateAgentBaseConfig<TContextSchema, TInputSchema, TEventSchemas, TOutputSchema, AiSdkModelMap<"default">> & {
187
+ model: LanguageModel;
188
+ models?: never;
189
+ }): CreatedAgent<AgentMachine<TContextSchema, TInputSchema, TEventSchemas, TOutputSchema, AiSdkModelMap<"default">>>;
190
+ declare function createAgent<TModels extends AiSdkModelMap, TContextSchema extends StandardSchemaV1<Record<string, unknown>>, TInputSchema extends StandardSchemaV1, TEventSchemas extends AgentEventSchemaInputMap = {}, TOutputSchema extends StandardSchemaV1 = StandardSchemaV1>(config: CreateAgentBaseConfig<TContextSchema, TInputSchema, TEventSchemas, TOutputSchema, TModels> & {
191
+ models: TModels;
192
+ model?: never;
193
+ }): CreatedAgent<AgentMachine<TContextSchema, TInputSchema, TEventSchemas, TOutputSchema, TModels>>;
165
194
  /** One AI SDK `tool()` per candidate event — the "tool-per-event +
166
- * toolChoice: 'required'" recipe from docs/p0-design.md §2.6. */
195
+ * toolChoice: 'required'" recipe from .scratch/p0-design.md §2.6. */
167
196
  declare function toAiSdkEventTools(events: AgentEventDescriptor[]): {
168
197
  [k: string]: Tool<unknown, never>;
169
198
  };
@@ -174,4 +203,4 @@ declare function toAiSdkEventTools(events: AgentEventDescriptor[]): {
174
203
  */
175
204
  declare function toDecisionMessages(request: Pick<AgentDecisionRequest, "messages" | "prompt" | "events" | "attempts">): ModelMessage[] | undefined;
176
205
  //#endregion
177
- export { AiSdkDecideResult, AiSdkExecutors, AiSdkGenerateResult, AiSdkModelMap, AiSdkStreamResult, CreateAiSdkExecutorsOptions, createAiSdkExecutors, defineModels, extractFirstJsonValue, isStructuredOutputRequest, toAiSdkCallSettings, toAiSdkEventTools, toAiSdkToolChoice, toAiSdkTools, toDecisionMessages };
206
+ export { AiSdkDecideResult, AiSdkExecutors, AiSdkGenerateResult, AiSdkModelMap, AiSdkStreamResult, CreateAiSdkExecutorsOptions, CreatedAgent, createAgent, createAiSdkExecutors, defineModels, extractFirstJsonValue, isStructuredOutputRequest, runAgent, toAiSdkCallSettings, toAiSdkEventTools, toAiSdkToolChoice, toAiSdkTools, toDecisionMessages };
package/dist/ai-sdk.d.mts CHANGED
@@ -1,5 +1,7 @@
1
- import { c as AgentTools, f as ChosenEvent } from "./types-Cq1YlAQ6.mjs";
2
- import { H as AgentEventDescriptor, i as AgentRequestExecutor, j as AgentDecisionRequest, k as AgentDecisionExecutor, l as AgentTextRequest, s as AgentRequestExecutors } from "./text-logic-2wFNEznm.mjs";
1
+ import { C as StandardSchemaV1, m as ChosenEvent, n as AgentEventSchemaInputMap, u as AgentTools } from "./types-qm00QF91.mjs";
2
+ import { H as AgentEventDescriptor, i as AgentRequestExecutor, j as AgentDecisionRequest, k as AgentDecisionExecutor, l as AgentTextRequest, s as AgentRequestExecutors } from "./text-logic-C7WJpCIc.mjs";
3
+ import { E as AgentMachineConfig, T as AgentMachine, c as RunAgentResult, s as RunAgentOptions } from "./run-agent-XYjmBxHi.mjs";
4
+ import * as _$xstate from "xstate";
3
5
  import { FinishReason, LanguageModel, LanguageModelUsage, ModelMessage, Tool, ToolSet, TypedToolCall, TypedToolResult } from "ai";
4
6
 
5
7
  //#region src/ai-sdk/index.d.ts
@@ -54,7 +56,7 @@ type CreateAiSdkExecutorsOptions<TModels extends AiSdkModelMap = AiSdkModelMap>
54
56
  /**
55
57
  * AI SDK request-mapping settings shared by `generateText`/`streamText`.
56
58
  * `AgentTextRequest.messages` (`AgentMessage[]`) and AI SDK's `ModelMessage[]`
57
- * are structurally compatible by design (§1 of docs/p0-design.md) — the cast
59
+ * are structurally compatible by design (§1 of .scratch/p0-design.md) — the cast
58
60
  * below is a typed identity mapping, not a semantic conversion.
59
61
  */
60
62
  declare function toAiSdkCallSettings(request: AgentTextRequest & {
@@ -162,8 +164,35 @@ interface AiSdkExecutors extends AgentRequestExecutors<AiSdkGenerateResult, AiSd
162
164
  * ```
163
165
  */
164
166
  declare function createAiSdkExecutors<TModels extends AiSdkModelMap>(options: CreateAiSdkExecutorsOptions<TModels>): AiSdkExecutors;
167
+ /** AI SDK host for a machine authored with `setupAgent({ models })`. */
168
+ declare function runAgent<TMachine extends _$xstate.AnyStateMachine>(machine: TMachine, options: Omit<RunAgentOptions<TMachine>, "executors">): Promise<RunAgentResult<TMachine>>;
169
+ type CreateAgentMachineConfig<TContextSchema extends StandardSchemaV1<Record<string, unknown>>, TInputSchema extends StandardSchemaV1, TEventSchemas extends AgentEventSchemaInputMap, TOutputSchema extends StandardSchemaV1, TModels extends AiSdkModelMap> = Omit<AgentMachineConfig<TContextSchema, TInputSchema, TEventSchemas, TOutputSchema, TModels>, "schemas">;
170
+ type CreateAgentBaseConfig<TContextSchema extends StandardSchemaV1<Record<string, unknown>>, TInputSchema extends StandardSchemaV1, TEventSchemas extends AgentEventSchemaInputMap, TOutputSchema extends StandardSchemaV1, TModels extends AiSdkModelMap> = CreateAgentMachineConfig<TContextSchema, TInputSchema, TEventSchemas, TOutputSchema, TModels> & {
171
+ schemas: {
172
+ context: TContextSchema;
173
+ input: TInputSchema;
174
+ events?: TEventSchemas;
175
+ output?: TOutputSchema;
176
+ };
177
+ };
178
+ interface CreatedAgent<TMachine extends _$xstate.AnyStateMachine> {
179
+ machine: TMachine;
180
+ run(input: _$xstate.InputFrom<TMachine>, options?: Omit<RunAgentOptions<TMachine>, "input" | "executors">): Promise<RunAgentResult<TMachine>>;
181
+ }
182
+ /**
183
+ * One-call AI SDK entry point for the common case: creates a typed machine and
184
+ * a `run(input)` method with model executors already wired.
185
+ */
186
+ declare function createAgent<TContextSchema extends StandardSchemaV1<Record<string, unknown>>, TInputSchema extends StandardSchemaV1, TEventSchemas extends AgentEventSchemaInputMap = {}, TOutputSchema extends StandardSchemaV1 = StandardSchemaV1>(config: CreateAgentBaseConfig<TContextSchema, TInputSchema, TEventSchemas, TOutputSchema, AiSdkModelMap<"default">> & {
187
+ model: LanguageModel;
188
+ models?: never;
189
+ }): CreatedAgent<AgentMachine<TContextSchema, TInputSchema, TEventSchemas, TOutputSchema, AiSdkModelMap<"default">>>;
190
+ declare function createAgent<TModels extends AiSdkModelMap, TContextSchema extends StandardSchemaV1<Record<string, unknown>>, TInputSchema extends StandardSchemaV1, TEventSchemas extends AgentEventSchemaInputMap = {}, TOutputSchema extends StandardSchemaV1 = StandardSchemaV1>(config: CreateAgentBaseConfig<TContextSchema, TInputSchema, TEventSchemas, TOutputSchema, TModels> & {
191
+ models: TModels;
192
+ model?: never;
193
+ }): CreatedAgent<AgentMachine<TContextSchema, TInputSchema, TEventSchemas, TOutputSchema, TModels>>;
165
194
  /** One AI SDK `tool()` per candidate event — the "tool-per-event +
166
- * toolChoice: 'required'" recipe from docs/p0-design.md §2.6. */
195
+ * toolChoice: 'required'" recipe from .scratch/p0-design.md §2.6. */
167
196
  declare function toAiSdkEventTools(events: AgentEventDescriptor[]): {
168
197
  [k: string]: Tool<unknown, never>;
169
198
  };
@@ -174,4 +203,4 @@ declare function toAiSdkEventTools(events: AgentEventDescriptor[]): {
174
203
  */
175
204
  declare function toDecisionMessages(request: Pick<AgentDecisionRequest, "messages" | "prompt" | "events" | "attempts">): ModelMessage[] | undefined;
176
205
  //#endregion
177
- export { AiSdkDecideResult, AiSdkExecutors, AiSdkGenerateResult, AiSdkModelMap, AiSdkStreamResult, CreateAiSdkExecutorsOptions, createAiSdkExecutors, defineModels, extractFirstJsonValue, isStructuredOutputRequest, toAiSdkCallSettings, toAiSdkEventTools, toAiSdkToolChoice, toAiSdkTools, toDecisionMessages };
206
+ export { AiSdkDecideResult, AiSdkExecutors, AiSdkGenerateResult, AiSdkModelMap, AiSdkStreamResult, CreateAiSdkExecutorsOptions, CreatedAgent, createAgent, createAiSdkExecutors, defineModels, extractFirstJsonValue, isStructuredOutputRequest, runAgent, toAiSdkCallSettings, toAiSdkEventTools, toAiSdkToolChoice, toAiSdkTools, toDecisionMessages };
package/dist/ai-sdk.mjs CHANGED
@@ -1,4 +1,5 @@
1
- import { T as getAgentOutputMode, l as renderDecisionAttempts, q as isStandardSchema, x as buildEnvelopeSchema } from "./decision-mPR_YQd8.mjs";
1
+ import { a as runAgent$1, c as setupAgent } from "./run-agent-7OaHM7SB.mjs";
2
+ import { J as isStandardSchema, L as getRegisteredAgentModels, T as getAgentOutputMode, l as renderDecisionAttempts, x as buildEnvelopeSchema } from "./decision-CQdrKc8k.mjs";
2
3
  import { NoObjectGeneratedError, Output, generateText, stepCountIs, streamText, tool } from "ai";
3
4
  //#region src/ai-sdk/index.ts
4
5
  /**
@@ -84,7 +85,7 @@ function resolveAiSdkModel(options, modelRef) {
84
85
  /**
85
86
  * AI SDK request-mapping settings shared by `generateText`/`streamText`.
86
87
  * `AgentTextRequest.messages` (`AgentMessage[]`) and AI SDK's `ModelMessage[]`
87
- * are structurally compatible by design (§1 of docs/p0-design.md) — the cast
88
+ * are structurally compatible by design (§1 of .scratch/p0-design.md) — the cast
88
89
  * below is a typed identity mapping, not a semantic conversion.
89
90
  */
90
91
  function toAiSdkCallSettings(request) {
@@ -273,8 +274,36 @@ function createAiSdkExecutors(options) {
273
274
  decide
274
275
  };
275
276
  }
277
+ /** AI SDK host for a machine authored with `setupAgent({ models })`. */
278
+ function runAgent(machine, options) {
279
+ const models = getRegisteredAgentModels(machine);
280
+ if (!models || Object.keys(models).length === 0) throw new Error("AI SDK runAgent: machine has no models. Pass `models` to setupAgent, or use core runAgent with explicit executors.");
281
+ return runAgent$1(machine, {
282
+ ...options,
283
+ executors: createAiSdkExecutors({ models })
284
+ });
285
+ }
286
+ function createAgent(config) {
287
+ const { model, models: configuredModels, schemas, ...machineConfig } = config;
288
+ const models = configuredModels ?? { default: model };
289
+ const executors = createAiSdkExecutors({ models });
290
+ const machine = setupAgent({
291
+ ...schemas,
292
+ models
293
+ }).createMachine(machineConfig);
294
+ return {
295
+ machine,
296
+ run(runInput, options = {}) {
297
+ return runAgent$1(machine, {
298
+ ...options,
299
+ input: runInput,
300
+ executors
301
+ });
302
+ }
303
+ };
304
+ }
276
305
  /** One AI SDK `tool()` per candidate event — the "tool-per-event +
277
- * toolChoice: 'required'" recipe from docs/p0-design.md §2.6. */
306
+ * toolChoice: 'required'" recipe from .scratch/p0-design.md §2.6. */
278
307
  function toAiSdkEventTools(events) {
279
308
  return Object.fromEntries(events.map((event) => [event.toolName, tool({
280
309
  description: `Choose the '${event.type}' move.`,
@@ -299,4 +328,4 @@ function toDecisionMessages(request) {
299
328
  return messages;
300
329
  }
301
330
  //#endregion
302
- export { createAiSdkExecutors, defineModels, extractFirstJsonValue, isStructuredOutputRequest, toAiSdkCallSettings, toAiSdkEventTools, toAiSdkToolChoice, toAiSdkTools, toDecisionMessages };
331
+ export { createAgent, createAiSdkExecutors, defineModels, extractFirstJsonValue, isStructuredOutputRequest, runAgent, toAiSdkCallSettings, toAiSdkEventTools, toAiSdkToolChoice, toAiSdkTools, toDecisionMessages };
package/dist/cli.cjs CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
- const require_src = require("./src-MysDmqwT.cjs");
2
+ const require_run_agent = require("./run-agent-BQ3vV7UI.cjs");
3
+ const require_src = require("./src-CFtSqm-c.cjs");
3
4
  let node_fs = require("node:fs");
4
5
  //#region src/cli.ts
5
6
  /**
@@ -44,7 +45,7 @@ function main(argv) {
44
45
  }
45
46
  let machine;
46
47
  try {
47
- machine = require_src.setupAgent.fromConfig(config, { compileSchema: stubCompileSchema });
48
+ machine = require_run_agent.setupAgent.fromConfig(config, { compileSchema: stubCompileSchema });
48
49
  } catch (error) {
49
50
  process.stderr.write(`statelyai-agent: '${file}' is not a valid agent-machine config: ${error instanceof Error ? error.message : String(error)}\n`);
50
51
  return 2;
package/dist/cli.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { r as lintAgentMachine, v as setupAgent } from "./src-BpQdxsKc.mjs";
2
+ import { c as setupAgent } from "./run-agent-7OaHM7SB.mjs";
3
+ import { r as lintAgentMachine } from "./src-d-jhiOgP.mjs";
3
4
  import { readFileSync } from "node:fs";
4
5
  //#region src/cli.ts
5
6
  /**
@@ -221,6 +221,9 @@ function validateSchemaSync(schema, value) {
221
221
  //#endregion
222
222
  //#region src/internal/registry.ts
223
223
  const agentExecutionOptions = /* @__PURE__ */ new WeakMap();
224
+ function getRegisteredAgentModels(machine) {
225
+ return agentExecutionOptions.get(machine)?.models;
226
+ }
224
227
  /**
225
228
  * Machine-carried wait-state predicates, keyed on the machine's root `config`
226
229
  * object. `config` is shared by reference across `machine.provide(...)` (unlike
@@ -972,4 +975,4 @@ async function resolveDecision(request, executor, options = {}) {
972
975
  throw new DecisionExhaustedError(attempts);
973
976
  }
974
977
  //#endregion
975
- export { parseOutput as A, assistantMessage as B, createTextLogic as C, isTextLogic as D, isStructuredOutputSchema as E, getMachineSuspensionPredicate as F, getMachineStructuralHash as G, getAgentMessages as H, getRegisteredAgentExecutionOptions as I, persistSnapshot as J, getStateMeta as K, isUnboundPlaceholder as L, userInputActor as M, agentExecutionOptions as N, normalizeGeneratorResult as O, executorBoundLogics as P, validateSchemaSync as Q, machineSuspensionPredicates as R, builtinTextActors as S, getAgentOutputMode as T, getJsonSchema as U, findNonSerializableContextPaths as V, getJsonSchemaSync as W, toolMessage as X, systemMessage as Y, userMessage as Z, INTERPRET_SOURCE as _, createPlanActor as a, bindRequestExecutor as b, isPlanLogic as c, EVENT_TOOL_PREFIX as d, getAcceptedEvents as f, DECIDE_ACTOR as g, sanitizeEventToolName as h, createDecideActor as i, parseStructuredEnvelope as j, parseModelRef as k, renderDecisionAttempts as l, parseAgentEvent as m, PLAN_DONE_EVENT_TYPE as n, initialPlanLedger as o, matchesEventPattern as p, isStandardSchema as q, advancePlanLedger as r, isDecisionLogic as s, DecisionExhaustedError as t, resolveDecision as u, PLAN_ACTOR as v, executeAgentTextRequest as w, buildEnvelopeSchema as x, USER_INPUT_ACTOR as y, missingActor as z };
978
+ export { validateSchemaSync as $, parseOutput as A, missingActor as B, createTextLogic as C, isTextLogic as D, isStructuredOutputSchema as E, getMachineSuspensionPredicate as F, getJsonSchemaSync as G, findNonSerializableContextPaths as H, getRegisteredAgentExecutionOptions as I, isStandardSchema as J, getMachineStructuralHash as K, getRegisteredAgentModels as L, userInputActor as M, agentExecutionOptions as N, normalizeGeneratorResult as O, executorBoundLogics as P, userMessage as Q, isUnboundPlaceholder as R, builtinTextActors as S, getAgentOutputMode as T, getAgentMessages as U, assistantMessage as V, getJsonSchema as W, systemMessage as X, persistSnapshot as Y, toolMessage as Z, INTERPRET_SOURCE as _, createPlanActor as a, bindRequestExecutor as b, isPlanLogic as c, EVENT_TOOL_PREFIX as d, getAcceptedEvents as f, DECIDE_ACTOR as g, sanitizeEventToolName as h, createDecideActor as i, parseStructuredEnvelope as j, parseModelRef as k, renderDecisionAttempts as l, parseAgentEvent as m, PLAN_DONE_EVENT_TYPE as n, initialPlanLedger as o, matchesEventPattern as p, getStateMeta as q, advancePlanLedger as r, isDecisionLogic as s, DecisionExhaustedError as t, resolveDecision as u, PLAN_ACTOR as v, executeAgentTextRequest as w, buildEnvelopeSchema as x, USER_INPUT_ACTOR as y, machineSuspensionPredicates as z };
@@ -221,6 +221,9 @@ function validateSchemaSync(schema, value) {
221
221
  //#endregion
222
222
  //#region src/internal/registry.ts
223
223
  const agentExecutionOptions = /* @__PURE__ */ new WeakMap();
224
+ function getRegisteredAgentModels(machine) {
225
+ return agentExecutionOptions.get(machine)?.models;
226
+ }
224
227
  /**
225
228
  * Machine-carried wait-state predicates, keyed on the machine's root `config`
226
229
  * object. `config` is shared by reference across `machine.provide(...)` (unlike
@@ -1134,6 +1137,12 @@ Object.defineProperty(exports, "getRegisteredAgentExecutionOptions", {
1134
1137
  return getRegisteredAgentExecutionOptions;
1135
1138
  }
1136
1139
  });
1140
+ Object.defineProperty(exports, "getRegisteredAgentModels", {
1141
+ enumerable: true,
1142
+ get: function() {
1143
+ return getRegisteredAgentModels;
1144
+ }
1145
+ });
1137
1146
  Object.defineProperty(exports, "getStateMeta", {
1138
1147
  enumerable: true,
1139
1148
  get: function() {
package/dist/index.cjs CHANGED
@@ -1,18 +1,19 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_src = require("./src-MysDmqwT.cjs");
3
- const require_decision = require("./decision-BnATHy0W.cjs");
4
- exports.AgentIdleError = require_src.AgentIdleError;
2
+ const require_run_agent = require("./run-agent-BQ3vV7UI.cjs");
3
+ const require_decision = require("./decision-b-lkcs4L.cjs");
4
+ const require_src = require("./src-CFtSqm-c.cjs");
5
+ exports.AgentIdleError = require_run_agent.AgentIdleError;
5
6
  exports.DecisionExhaustedError = require_decision.DecisionExhaustedError;
6
7
  exports.EVENT_TOOL_PREFIX = require_decision.EVENT_TOOL_PREFIX;
7
- exports.IllegalResumeEventError = require_src.IllegalResumeEventError;
8
+ exports.IllegalResumeEventError = require_run_agent.IllegalResumeEventError;
8
9
  exports.PLAN_DONE_EVENT_TYPE = require_decision.PLAN_DONE_EVENT_TYPE;
9
- exports.SnapshotVersionMismatchError = require_src.SnapshotVersionMismatchError;
10
- exports.appendMessages = require_src.appendMessages;
10
+ exports.SnapshotVersionMismatchError = require_run_agent.SnapshotVersionMismatchError;
11
+ exports.appendMessages = require_run_agent.appendMessages;
11
12
  exports.assistantMessage = require_decision.assistantMessage;
12
13
  exports.bindRequestExecutor = require_decision.bindRequestExecutor;
13
14
  exports.buildEnvelopeSchema = require_decision.buildEnvelopeSchema;
14
15
  exports.canReach = require_src.canReach;
15
- exports.createAgentSchemas = require_src.createAgentSchemas;
16
+ exports.createAgentSchemas = require_run_agent.createAgentSchemas;
16
17
  exports.createTextLogic = require_decision.createTextLogic;
17
18
  exports.executeAgentRequest = require_src.executeAgentRequest;
18
19
  exports.explorePaths = require_src.explorePaths;
@@ -25,12 +26,12 @@ exports.getJsonSchemaSync = require_decision.getJsonSchemaSync;
25
26
  exports.getMachineStructuralHash = require_decision.getMachineStructuralHash;
26
27
  exports.getStateMeta = require_decision.getStateMeta;
27
28
  exports.initialAgentStep = require_src.initialAgentStep;
28
- exports.inspectTransitions = require_src.inspectTransitions;
29
+ exports.inspectTransitions = require_run_agent.inspectTransitions;
29
30
  exports.isStandardSchema = require_decision.isStandardSchema;
30
31
  exports.isStructuredOutputSchema = require_decision.isStructuredOutputSchema;
31
32
  exports.lintAgentMachine = require_src.lintAgentMachine;
32
33
  exports.matchesEventPattern = require_decision.matchesEventPattern;
33
- exports.messagesSchema = require_src.messagesSchema;
34
+ exports.messagesSchema = require_run_agent.messagesSchema;
34
35
  exports.parseAgentEvent = require_decision.parseAgentEvent;
35
36
  exports.parseModelRef = require_decision.parseModelRef;
36
37
  exports.parseOutput = require_decision.parseOutput;
@@ -40,12 +41,12 @@ exports.renderDecisionAttempts = require_decision.renderDecisionAttempts;
40
41
  exports.resolveAgentRequests = require_src.resolveAgentRequests;
41
42
  exports.resolveAgentStep = require_src.resolveAgentStep;
42
43
  exports.resolveDecision = require_decision.resolveDecision;
43
- exports.runAgent = require_src.runAgent;
44
- exports.runAgentToCompletion = require_src.runAgentToCompletion;
44
+ exports.runAgent = require_run_agent.runAgent;
45
+ exports.runAgentToCompletion = require_run_agent.runAgentToCompletion;
45
46
  Object.defineProperty(exports, "setupAgent", {
46
47
  enumerable: true,
47
48
  get: function() {
48
- return require_src.setupAgent;
49
+ return require_run_agent.setupAgent;
49
50
  }
50
51
  });
51
52
  exports.simulateAgent = require_src.simulateAgent;