@statelyai/agent 2.0.0-alpha.17 → 2.0.0-alpha.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/ai-sdk.cjs +4 -2
  2. package/dist/ai-sdk.d.cts +1 -1
  3. package/dist/ai-sdk.d.mts +1 -1
  4. package/dist/ai-sdk.mjs +3 -2
  5. package/dist/{decision-C11xuud2.mjs → decision-DsIkEuHz.mjs} +48 -28
  6. package/dist/{decision-DnQCQPew.cjs → decision-t26zsnSR.cjs} +64 -43
  7. package/dist/{event-log-store-CQJq8_v4.d.cts → event-log-store-Bz7HDBkE.d.cts} +11 -12
  8. package/dist/{event-log-store-B-1fcfkT.mjs → event-log-store-DmIDosD6.mjs} +22 -14
  9. package/dist/{event-log-store-yquOV1TX.cjs → event-log-store-a_TKy1gk.cjs} +22 -14
  10. package/dist/{event-log-store-BrC9Q1xW.d.mts → event-log-store-hrA1vqtN.d.mts} +11 -12
  11. package/dist/index.cjs +266 -109
  12. package/dist/index.d.cts +148 -80
  13. package/dist/index.d.mts +148 -80
  14. package/dist/index.mjs +262 -107
  15. package/dist/machines.cjs +13 -17
  16. package/dist/machines.d.cts +14 -17
  17. package/dist/machines.d.mts +14 -17
  18. package/dist/machines.mjs +13 -17
  19. package/dist/otel.cjs +1 -0
  20. package/dist/otel.d.cts +1 -1
  21. package/dist/otel.d.mts +1 -1
  22. package/dist/{run-agent-BxjGaVpL.d.cts → run-agent--4bbms-D.d.cts} +121 -48
  23. package/dist/{run-agent-COHoCgQd.d.mts → run-agent-CwmzAZwj.d.mts} +121 -48
  24. package/dist/{setup-agent-D_EyJ0Ik.cjs → setup-agent-BFA4VKpN.cjs} +51 -33
  25. package/dist/{setup-agent-CTg57Pa4.mjs → setup-agent-CPFPN06s.mjs} +45 -28
  26. package/dist/sqlite.cjs +3 -9
  27. package/dist/sqlite.d.cts +1 -1
  28. package/dist/sqlite.d.mts +1 -1
  29. package/dist/sqlite.mjs +3 -9
  30. package/dist/{text-logic-BFX5q7fM.d.cts → text-logic-Cavva1W6.d.cts} +25 -9
  31. package/dist/{text-logic-DQW8_DWW.d.mts → text-logic-Er5KkTX6.d.mts} +25 -9
  32. package/dist/validate.cjs +436 -0
  33. package/dist/validate.d.cts +31 -0
  34. package/dist/validate.d.mts +31 -0
  35. package/dist/validate.mjs +411 -0
  36. package/package.json +15 -1
  37. package/schemas/agent-workflow.json +2 -2
  38. package/skills/generate-machine/SKILL.md +12 -14
@@ -1,6 +1,7 @@
1
1
  const require_errors = require("./errors-DUBBzRLP.cjs");
2
- const require_decision = require("./decision-DnQCQPew.cjs");
3
- const require_event_log_store = require("./event-log-store-yquOV1TX.cjs");
2
+ const require_decision = require("./decision-t26zsnSR.cjs");
3
+ const require_event_log_store = require("./event-log-store-a_TKy1gk.cjs");
4
+ require("./validate.cjs");
4
5
  let xstate = require("xstate");
5
6
  //#region src/messages.ts
6
7
  function addMessages(resolve) {
@@ -221,7 +222,7 @@ function resolveAgentStep(machine, step, request, output, options) {
221
222
  return createAgentStep(machine, snapshot, actions, require_decision.getRegisteredAgentExecutionOptions(machine, options));
222
223
  }
223
224
  async function executeAgentRequest(requestOrEffect, executors) {
224
- if (requestOrEffect.kind === "decision") throw new Error("executeAgentRequest(...) is text-only. Resolve a 'decision' request with resolveDecision(request, executors.decide, ...) instead.");
225
+ if (requestOrEffect.kind === "decision") throw new Error("executeAgentRequest(...) is text-only. Resolve a 'decision' request with resolveDecision(request, executors, ...) instead.");
225
226
  const request = "requestId" in requestOrEffect ? {
226
227
  kind: "text",
227
228
  id: requestOrEffect.requestId,
@@ -335,7 +336,7 @@ const AGENT_USAGE_EVENT_TYPE = "@agent.usage";
335
336
  function createReplayEntry(machine, entries, event, options = {}) {
336
337
  const index = entries.length;
337
338
  const machineId = machine.config.id ?? machine.id ?? "(machine)";
338
- const machineVersion = options.machineVersion ?? require_decision.getMachineStructuralHash(machine);
339
+ const machineVersion = options.machineVersion ?? require_decision.resolveMachineVersion(machine);
339
340
  const entry = {
340
341
  schemaVersion: 1,
341
342
  id: options.id ?? `evt_${String(index).padStart(8, "0")}`,
@@ -631,7 +632,7 @@ function validateReplayEntries(entries, expected, label) {
631
632
  function replay(machine, entries, options = {}) {
632
633
  validateReplayEntries(entries, {
633
634
  machineId: machine.config.id ?? machine.id ?? "(machine)",
634
- machineVersion: options.machineVersion ?? require_decision.getMachineStructuralHash(machine)
635
+ machineVersion: options.machineVersion ?? require_decision.resolveMachineVersion(machine)
635
636
  }, "Replay entries");
636
637
  const events = toEvents(entries);
637
638
  const initOffset = events[0]?.type === "@agent.init" ? 1 : 0;
@@ -661,13 +662,6 @@ function replay(machine, entries, options = {}) {
661
662
  effects
662
663
  };
663
664
  }
664
- /** Requires and checks every entry's recorded state/effect hashes. */
665
- function verifyReplay(machine, entries, options = {}) {
666
- return replay(machine, entries, {
667
- ...options,
668
- verify: "strict"
669
- });
670
- }
671
665
  /** Structural event-tail, logical-state, and owed-effect comparison. */
672
666
  function diffEventLogs(machine, parentEntries, forkEntries, options = {}) {
673
667
  let commonLength = 0;
@@ -1135,14 +1129,14 @@ function collectDeclaredStateTags(states, tags = /* @__PURE__ */ new Set()) {
1135
1129
  }
1136
1130
  return tags;
1137
1131
  }
1138
- function resolveSuspensionPredicate(config, options) {
1139
- if (options.isSuspended) return options.isSuspended;
1140
- const suspendedTags = config.suspendedTags ?? [];
1141
- if (!suspendedTags.length) return;
1132
+ function resolveIdlePredicate(config, options) {
1133
+ if (options.isIdle) return options.isIdle;
1134
+ const idleTags = config.idleTags ?? [];
1135
+ if (!idleTags.length) return;
1142
1136
  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));
1137
+ const unknown = idleTags.filter((tag) => !declaredTags.has(tag));
1138
+ if (unknown.length) throw new Error(`setupAgent.fromConfig: 'idleTags' 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.`);
1139
+ return (snapshot) => idleTags.some((tag) => snapshot.hasTag(tag));
1146
1140
  }
1147
1141
  function setupAgentFromConfig(config, options) {
1148
1142
  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.");
@@ -1174,8 +1168,8 @@ function setupAgentFromConfig(config, options) {
1174
1168
  models: {}
1175
1169
  });
1176
1170
  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);
1171
+ const isIdle = resolveIdlePredicate(config, options);
1172
+ if (isIdle && machine.config) require_decision.machineIdlePredicates.set(machine.config, isIdle);
1179
1173
  return {
1180
1174
  machine,
1181
1175
  schemas
@@ -1389,9 +1383,9 @@ function setupAgent(config) {
1389
1383
  assertStateSchemaKeysExist(config.states, machineConfig?.states);
1390
1384
  const machine = createBaseMachine(withRootOutputFromSingleFinal(machineConfig));
1391
1385
  require_decision.agentExecutionOptions.set(machine, machineOptions);
1392
- if (config.isSuspended) {
1386
+ if (config.isIdle) {
1393
1387
  const rootConfig = machine.config;
1394
- if (rootConfig) require_decision.machineSuspensionPredicates.set(rootConfig, config.isSuspended);
1388
+ if (rootConfig) require_decision.machineIdlePredicates.set(rootConfig, config.isIdle);
1395
1389
  }
1396
1390
  return machine;
1397
1391
  },
@@ -1422,6 +1416,20 @@ function withRootOutputFromSingleFinal(config) {
1422
1416
  }
1423
1417
  _setupAgent.fromConfig = fromConfig;
1424
1418
  })(setupAgent || (setupAgent = {}));
1419
+ /**
1420
+ * The schema pack a machine was built with — `setupAgent(...).createMachine`
1421
+ * and `setupAgent.fromConfig(...)` both register one, so hosts can read a
1422
+ * machine's input/event schemas at runtime without knowing how it was
1423
+ * authored. Returns `undefined` for machines not built by either (a plain
1424
+ * xstate `createMachine`/`setup` machine).
1425
+ *
1426
+ * Registration is keyed on the machine object, so a machine returned by
1427
+ * `machine.provide(...)` carries no pack — read it from the machine the setup
1428
+ * returned.
1429
+ */
1430
+ function getAgentSchemas(machine) {
1431
+ return require_decision.agentExecutionOptions.get(machine)?.schemas;
1432
+ }
1425
1433
  /** Builds one TextLogic actor per `setupAgent({ requests })` entry. @internal */
1426
1434
  function createRequestActors(requests) {
1427
1435
  return Object.fromEntries(Object.entries(requests).map(([key, request]) => {
@@ -1468,13 +1476,22 @@ const RESERVED_AGENT_ACTOR_KEYS = [
1468
1476
  require_decision.DECIDE_ACTOR
1469
1477
  ];
1470
1478
  /**
1479
+ * The whole `agent.` actor-source namespace is reserved for the library, not
1480
+ * just the shipped builtins: a key starting with this prefix is rejected at
1481
+ * setup time so a future builtin can never collide with (or be shadowed by) a
1482
+ * user source. Name your own sources without it.
1483
+ */
1484
+ const RESERVED_AGENT_KEY_PREFIX = "agent.";
1485
+ /**
1471
1486
  * Runtime guards over the user-supplied `actors`/`requests` keys, in one walk
1472
1487
  * of both groups:
1473
1488
  *
1474
- * 1. A key in the reserved `agent.*` builtin namespace is rejected. Without
1475
- * this, the builtins-first spread in {@link createAgentActors} lets such a
1476
- * key overwrite the builtin (`agent.decide`, …) silently. Deliberate
1477
- * override of a builtin is still possible after the machine is created, via
1489
+ * 1. A key in the reserved `agent.` namespace is rejected — every key with
1490
+ * that prefix, not only today's builtins. Without this, the builtins-first
1491
+ * spread in {@link createAgentActors} lets such a key overwrite the builtin
1492
+ * (`agent.decide`, …) silently, and a builtin added later would start
1493
+ * colliding with user code. Deliberate override of a builtin is still
1494
+ * possible after the machine is created, via
1478
1495
  * `machine.provide({ actors: { 'agent.decide': ... } })`.
1479
1496
  * 2. A key appearing in BOTH groups is almost certainly a mistake (whichever
1480
1497
  * spread applies last would silently win) — fail fast with a clear message
@@ -1485,6 +1502,7 @@ function assertActorKeys(actors, requests) {
1485
1502
  const groups = [["actors", actors], ["requests", requests]];
1486
1503
  for (const [groupName, group] of groups) for (const key of Object.keys(group ?? {})) {
1487
1504
  if (RESERVED_AGENT_ACTOR_KEYS.some((reserved) => reserved === key)) throw new Error(`setupAgent: '${groupName}' key '${key}' is a reserved builtin agent actor and cannot be redefined here (it would silently clobber the builtin). Reserved keys: ${RESERVED_AGENT_ACTOR_KEYS.join(", ")}. To deliberately override a builtin, do it on the created machine instead: machine.provide({ actors: { '${key}': ... } }).`);
1505
+ if (key.startsWith(RESERVED_AGENT_KEY_PREFIX)) throw new Error(`setupAgent: '${groupName}' key '${key}' uses the reserved '${RESERVED_AGENT_KEY_PREFIX}' namespace, which belongs to the library (${RESERVED_AGENT_ACTOR_KEYS.join(", ")}, and anything added later). Rename it without the '${RESERVED_AGENT_KEY_PREFIX}' prefix.`);
1488
1506
  const existingGroup = seenIn.get(key);
1489
1507
  if (existingGroup) throw new Error(`setupAgent: key '${key}' is defined in both '${existingGroup}' and '${groupName}'. Each actor source key must be unique across 'actors' and 'requests'.`);
1490
1508
  seenIn.set(key, groupName);
@@ -1561,6 +1579,12 @@ Object.defineProperty(exports, "getAgentEffects", {
1561
1579
  return getAgentEffects;
1562
1580
  }
1563
1581
  });
1582
+ Object.defineProperty(exports, "getAgentSchemas", {
1583
+ enumerable: true,
1584
+ get: function() {
1585
+ return getAgentSchemas;
1586
+ }
1587
+ });
1564
1588
  Object.defineProperty(exports, "getInvokeEffectMetadata", {
1565
1589
  enumerable: true,
1566
1590
  get: function() {
@@ -1615,9 +1639,3 @@ Object.defineProperty(exports, "validateReplayEntries", {
1615
1639
  return validateReplayEntries;
1616
1640
  }
1617
1641
  });
1618
- Object.defineProperty(exports, "verifyReplay", {
1619
- enumerable: true,
1620
- get: function() {
1621
- return verifyReplay;
1622
- }
1623
- });
@@ -1,6 +1,6 @@
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-C11xuud2.mjs";
3
- import { a as assertJsonSerializable, i as assertAgentLogEntry } from "./event-log-store-B-1fcfkT.mjs";
2
+ import { F as djb2Hex, M as machineStaticTransitionTargets, N as missingActor, T as agentExecutionOptions, U as resolveMachineVersion, d as USER_INPUT_ACTOR, g as executeAgentTextRequest, h as createTextLogic, j as machineIdlePredicates, 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-DsIkEuHz.mjs";
3
+ import { a as assertJsonSerializable, i as assertAgentLogEntry } from "./event-log-store-DmIDosD6.mjs";
4
4
  import { createMachineFromConfig, initialTransition, setup, transition } from "xstate";
5
5
  //#region src/messages.ts
6
6
  function addMessages(resolve) {
@@ -221,7 +221,7 @@ function resolveAgentStep(machine, step, request, output, options) {
221
221
  return createAgentStep(machine, snapshot, actions, getRegisteredAgentExecutionOptions(machine, options));
222
222
  }
223
223
  async function executeAgentRequest(requestOrEffect, executors) {
224
- if (requestOrEffect.kind === "decision") throw new Error("executeAgentRequest(...) is text-only. Resolve a 'decision' request with resolveDecision(request, executors.decide, ...) instead.");
224
+ if (requestOrEffect.kind === "decision") throw new Error("executeAgentRequest(...) is text-only. Resolve a 'decision' request with resolveDecision(request, executors, ...) instead.");
225
225
  const request = "requestId" in requestOrEffect ? {
226
226
  kind: "text",
227
227
  id: requestOrEffect.requestId,
@@ -335,7 +335,7 @@ const AGENT_USAGE_EVENT_TYPE = "@agent.usage";
335
335
  function createReplayEntry(machine, entries, event, options = {}) {
336
336
  const index = entries.length;
337
337
  const machineId = machine.config.id ?? machine.id ?? "(machine)";
338
- const machineVersion = options.machineVersion ?? getMachineStructuralHash(machine);
338
+ const machineVersion = options.machineVersion ?? resolveMachineVersion(machine);
339
339
  const entry = {
340
340
  schemaVersion: 1,
341
341
  id: options.id ?? `evt_${String(index).padStart(8, "0")}`,
@@ -631,7 +631,7 @@ function validateReplayEntries(entries, expected, label) {
631
631
  function replay(machine, entries, options = {}) {
632
632
  validateReplayEntries(entries, {
633
633
  machineId: machine.config.id ?? machine.id ?? "(machine)",
634
- machineVersion: options.machineVersion ?? getMachineStructuralHash(machine)
634
+ machineVersion: options.machineVersion ?? resolveMachineVersion(machine)
635
635
  }, "Replay entries");
636
636
  const events = toEvents(entries);
637
637
  const initOffset = events[0]?.type === "@agent.init" ? 1 : 0;
@@ -661,13 +661,6 @@ function replay(machine, entries, options = {}) {
661
661
  effects
662
662
  };
663
663
  }
664
- /** Requires and checks every entry's recorded state/effect hashes. */
665
- function verifyReplay(machine, entries, options = {}) {
666
- return replay(machine, entries, {
667
- ...options,
668
- verify: "strict"
669
- });
670
- }
671
664
  /** Structural event-tail, logical-state, and owed-effect comparison. */
672
665
  function diffEventLogs(machine, parentEntries, forkEntries, options = {}) {
673
666
  let commonLength = 0;
@@ -1135,14 +1128,14 @@ function collectDeclaredStateTags(states, tags = /* @__PURE__ */ new Set()) {
1135
1128
  }
1136
1129
  return tags;
1137
1130
  }
1138
- function resolveSuspensionPredicate(config, options) {
1139
- if (options.isSuspended) return options.isSuspended;
1140
- const suspendedTags = config.suspendedTags ?? [];
1141
- if (!suspendedTags.length) return;
1131
+ function resolveIdlePredicate(config, options) {
1132
+ if (options.isIdle) return options.isIdle;
1133
+ const idleTags = config.idleTags ?? [];
1134
+ if (!idleTags.length) return;
1142
1135
  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));
1136
+ const unknown = idleTags.filter((tag) => !declaredTags.has(tag));
1137
+ if (unknown.length) throw new Error(`setupAgent.fromConfig: 'idleTags' 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.`);
1138
+ return (snapshot) => idleTags.some((tag) => snapshot.hasTag(tag));
1146
1139
  }
1147
1140
  function setupAgentFromConfig(config, options) {
1148
1141
  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.");
@@ -1174,8 +1167,8 @@ function setupAgentFromConfig(config, options) {
1174
1167
  models: {}
1175
1168
  });
1176
1169
  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);
1170
+ const isIdle = resolveIdlePredicate(config, options);
1171
+ if (isIdle && machine.config) machineIdlePredicates.set(machine.config, isIdle);
1179
1172
  return {
1180
1173
  machine,
1181
1174
  schemas
@@ -1389,9 +1382,9 @@ function setupAgent(config) {
1389
1382
  assertStateSchemaKeysExist(config.states, machineConfig?.states);
1390
1383
  const machine = createBaseMachine(withRootOutputFromSingleFinal(machineConfig));
1391
1384
  agentExecutionOptions.set(machine, machineOptions);
1392
- if (config.isSuspended) {
1385
+ if (config.isIdle) {
1393
1386
  const rootConfig = machine.config;
1394
- if (rootConfig) machineSuspensionPredicates.set(rootConfig, config.isSuspended);
1387
+ if (rootConfig) machineIdlePredicates.set(rootConfig, config.isIdle);
1395
1388
  }
1396
1389
  return machine;
1397
1390
  },
@@ -1422,6 +1415,20 @@ function withRootOutputFromSingleFinal(config) {
1422
1415
  }
1423
1416
  _setupAgent.fromConfig = fromConfig;
1424
1417
  })(setupAgent || (setupAgent = {}));
1418
+ /**
1419
+ * The schema pack a machine was built with — `setupAgent(...).createMachine`
1420
+ * and `setupAgent.fromConfig(...)` both register one, so hosts can read a
1421
+ * machine's input/event schemas at runtime without knowing how it was
1422
+ * authored. Returns `undefined` for machines not built by either (a plain
1423
+ * xstate `createMachine`/`setup` machine).
1424
+ *
1425
+ * Registration is keyed on the machine object, so a machine returned by
1426
+ * `machine.provide(...)` carries no pack — read it from the machine the setup
1427
+ * returned.
1428
+ */
1429
+ function getAgentSchemas(machine) {
1430
+ return agentExecutionOptions.get(machine)?.schemas;
1431
+ }
1425
1432
  /** Builds one TextLogic actor per `setupAgent({ requests })` entry. @internal */
1426
1433
  function createRequestActors(requests) {
1427
1434
  return Object.fromEntries(Object.entries(requests).map(([key, request]) => {
@@ -1468,13 +1475,22 @@ const RESERVED_AGENT_ACTOR_KEYS = [
1468
1475
  DECIDE_ACTOR
1469
1476
  ];
1470
1477
  /**
1478
+ * The whole `agent.` actor-source namespace is reserved for the library, not
1479
+ * just the shipped builtins: a key starting with this prefix is rejected at
1480
+ * setup time so a future builtin can never collide with (or be shadowed by) a
1481
+ * user source. Name your own sources without it.
1482
+ */
1483
+ const RESERVED_AGENT_KEY_PREFIX = "agent.";
1484
+ /**
1471
1485
  * Runtime guards over the user-supplied `actors`/`requests` keys, in one walk
1472
1486
  * of both groups:
1473
1487
  *
1474
- * 1. A key in the reserved `agent.*` builtin namespace is rejected. Without
1475
- * this, the builtins-first spread in {@link createAgentActors} lets such a
1476
- * key overwrite the builtin (`agent.decide`, …) silently. Deliberate
1477
- * override of a builtin is still possible after the machine is created, via
1488
+ * 1. A key in the reserved `agent.` namespace is rejected — every key with
1489
+ * that prefix, not only today's builtins. Without this, the builtins-first
1490
+ * spread in {@link createAgentActors} lets such a key overwrite the builtin
1491
+ * (`agent.decide`, …) silently, and a builtin added later would start
1492
+ * colliding with user code. Deliberate override of a builtin is still
1493
+ * possible after the machine is created, via
1478
1494
  * `machine.provide({ actors: { 'agent.decide': ... } })`.
1479
1495
  * 2. A key appearing in BOTH groups is almost certainly a mistake (whichever
1480
1496
  * spread applies last would silently win) — fail fast with a clear message
@@ -1485,6 +1501,7 @@ function assertActorKeys(actors, requests) {
1485
1501
  const groups = [["actors", actors], ["requests", requests]];
1486
1502
  for (const [groupName, group] of groups) for (const key of Object.keys(group ?? {})) {
1487
1503
  if (RESERVED_AGENT_ACTOR_KEYS.some((reserved) => reserved === key)) throw new Error(`setupAgent: '${groupName}' key '${key}' is a reserved builtin agent actor and cannot be redefined here (it would silently clobber the builtin). Reserved keys: ${RESERVED_AGENT_ACTOR_KEYS.join(", ")}. To deliberately override a builtin, do it on the created machine instead: machine.provide({ actors: { '${key}': ... } }).`);
1504
+ if (key.startsWith(RESERVED_AGENT_KEY_PREFIX)) throw new Error(`setupAgent: '${groupName}' key '${key}' uses the reserved '${RESERVED_AGENT_KEY_PREFIX}' namespace, which belongs to the library (${RESERVED_AGENT_ACTOR_KEYS.join(", ")}, and anything added later). Rename it without the '${RESERVED_AGENT_KEY_PREFIX}' prefix.`);
1488
1505
  const existingGroup = seenIn.get(key);
1489
1506
  if (existingGroup) throw new Error(`setupAgent: key '${key}' is defined in both '${existingGroup}' and '${groupName}'. Each actor source key must be unique across 'actors' and 'requests'.`);
1490
1507
  seenIn.set(key, groupName);
@@ -1501,4 +1518,4 @@ function createAgentActors(actors, requestActors) {
1501
1518
  };
1502
1519
  }
1503
1520
  //#endregion
1504
- export { resolveAgentStep as _, AgentReplayDivergenceError as a, messagesSchema as b, diffEventLogs as c, replay as d, validateReplayEntries as f, initialAgentStep as g, getInvokeEffectMetadata as h, AGENT_USAGE_EVENT_TYPE as i, getAgentEffects as l, executeAgentRequest as m, setupAgent as n, AgentReplayMachineMismatchError as o, verifyReplay as p, AGENT_INIT_EVENT_TYPE as r, createReplayEntry as s, createAgentSchemas as t, initEntry as u, transitionAgentStep as v, appendMessages as y };
1521
+ export { resolveAgentStep as _, AGENT_USAGE_EVENT_TYPE as a, messagesSchema as b, createReplayEntry as c, initEntry as d, replay as f, initialAgentStep as g, getInvokeEffectMetadata as h, AGENT_INIT_EVENT_TYPE as i, diffEventLogs as l, executeAgentRequest as m, getAgentSchemas as n, AgentReplayDivergenceError as o, validateReplayEntries as p, setupAgent as r, AgentReplayMachineMismatchError as s, createAgentSchemas as t, getAgentEffects as u, transitionAgentStep as v, appendMessages as y };
package/dist/sqlite.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_event_log_store = require("./event-log-store-yquOV1TX.cjs");
2
+ const require_event_log_store = require("./event-log-store-a_TKy1gk.cjs");
3
3
  //#region src/sqlite/index.ts
4
4
  function openDatabase(path) {
5
5
  const sqlite = process.getBuiltinModule?.("node:sqlite");
@@ -80,18 +80,12 @@ function createSqliteEventLogStore(options) {
80
80
  async length(threadId) {
81
81
  return lengthOf(threadId);
82
82
  },
83
- async fork({ threadId, newThreadId, upToIndex, atEventId }) {
84
- if (upToIndex !== void 0 && atEventId !== void 0) throw new Error("AgentEventLogStore.fork: pass either upToIndex or atEventId, not both.");
83
+ async fork({ threadId, newThreadId, upToIndex }) {
85
84
  transact(() => {
86
85
  if (lengthOf(newThreadId) > 0) throw new Error(`AgentEventLogStore.fork: newThreadId "${newThreadId}" already has entries.`);
87
86
  const sourceLength = lengthOf(threadId);
88
87
  if (sourceLength === 0) throw new Error(`AgentEventLogStore.fork: unknown source thread "${threadId}".`);
89
- let upTo = upToIndex ?? sourceLength;
90
- if (atEventId !== void 0) {
91
- const row = db.prepare(`SELECT idx FROM ${table} WHERE thread_id = ? AND entry_id = ?`).get(threadId, atEventId);
92
- if (!row) throw new Error(`AgentEventLogStore.fork: thread "${threadId}" has no event id "${atEventId}".`);
93
- upTo = Number(row.idx) + 1;
94
- }
88
+ const upTo = upToIndex ?? sourceLength;
95
89
  if (upTo < 0 || upTo > sourceLength) throw new Error(`AgentEventLogStore.fork: thread "${threadId}" (length ${sourceLength}) has no index ${upTo} to fork up to.`);
96
90
  db.prepare(`INSERT INTO ${table} (thread_id, idx, entry_id, entry)
97
91
  SELECT ?, idx, entry_id, entry FROM ${table} WHERE thread_id = ? AND idx < ?`).run(newThreadId, threadId, upTo);
package/dist/sqlite.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { r as AgentSnapshotStore } from "./types-pJ5Hn8fv.cjs";
2
- import { r as AgentEventLogStore } from "./event-log-store-CQJq8_v4.cjs";
2
+ import { r as AgentEventLogStore } from "./event-log-store-Bz7HDBkE.cjs";
3
3
 
4
4
  //#region src/sqlite/index.d.ts
5
5
  /** A prepared statement, structurally compatible with `node:sqlite`'s `StatementSync`. */
package/dist/sqlite.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { r as AgentSnapshotStore } from "./types-DYpK3QF4.mjs";
2
- import { r as AgentEventLogStore } from "./event-log-store-BrC9Q1xW.mjs";
2
+ import { r as AgentEventLogStore } from "./event-log-store-hrA1vqtN.mjs";
3
3
 
4
4
  //#region src/sqlite/index.d.ts
5
5
  /** A prepared statement, structurally compatible with `node:sqlite`'s `StatementSync`. */
package/dist/sqlite.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { i as assertAgentLogEntry, n as AgentEventLogConflictError } from "./event-log-store-B-1fcfkT.mjs";
1
+ import { i as assertAgentLogEntry, n as AgentEventLogConflictError } from "./event-log-store-DmIDosD6.mjs";
2
2
  //#region src/sqlite/index.ts
3
3
  function openDatabase(path) {
4
4
  const sqlite = process.getBuiltinModule?.("node:sqlite");
@@ -79,18 +79,12 @@ function createSqliteEventLogStore(options) {
79
79
  async length(threadId) {
80
80
  return lengthOf(threadId);
81
81
  },
82
- async fork({ threadId, newThreadId, upToIndex, atEventId }) {
83
- if (upToIndex !== void 0 && atEventId !== void 0) throw new Error("AgentEventLogStore.fork: pass either upToIndex or atEventId, not both.");
82
+ async fork({ threadId, newThreadId, upToIndex }) {
84
83
  transact(() => {
85
84
  if (lengthOf(newThreadId) > 0) throw new Error(`AgentEventLogStore.fork: newThreadId "${newThreadId}" already has entries.`);
86
85
  const sourceLength = lengthOf(threadId);
87
86
  if (sourceLength === 0) throw new Error(`AgentEventLogStore.fork: unknown source thread "${threadId}".`);
88
- let upTo = upToIndex ?? sourceLength;
89
- if (atEventId !== void 0) {
90
- const row = db.prepare(`SELECT idx FROM ${table} WHERE thread_id = ? AND entry_id = ?`).get(threadId, atEventId);
91
- if (!row) throw new Error(`AgentEventLogStore.fork: thread "${threadId}" has no event id "${atEventId}".`);
92
- upTo = Number(row.idx) + 1;
93
- }
87
+ const upTo = upToIndex ?? sourceLength;
94
88
  if (upTo < 0 || upTo > sourceLength) throw new Error(`AgentEventLogStore.fork: thread "${threadId}" (length ${sourceLength}) has no index ${upTo} to fork up to.`);
95
89
  db.prepare(`INSERT INTO ${table} (thread_id, idx, entry_id, entry)
96
90
  SELECT ?, idx, entry_id, entry FROM ${table} WHERE thread_id = ? AND idx < ?`).run(newThreadId, threadId, upTo);
@@ -214,14 +214,17 @@ declare function renderDecisionAttempts(request: Pick<AgentDecisionRequest, "eve
214
214
  * `generateText`/`streamText` — how the model is coerced into choosing
215
215
  * (tool-per-event + forced tool choice, structured output, …) is entirely
216
216
  * adapter business; core only validates and retries the returned choice (see
217
- * {@link resolveDecision}). The optional `reason` is carried through to
217
+ * {@link resolveDecision}). It takes the same `(request, info)` pair as
218
+ * `generateText`/`streamText` — `info` carries the host seams (`signal`,
219
+ * `runId`, `requestId`); `onChunk` is never set for a decision.
220
+ * The optional `reason` is carried through to
218
221
  * `onResult`/event-sourcing but never affects validation. Like text
219
222
  * executors' `{ output, ...extras }` envelope, any extra keys (finish reason,
220
223
  * …) flow untouched to `onResult`'s `raw`; `usage` is the one core reads —
221
224
  * report this attempt's tokens there and `runAgent` folds them into the run's
222
225
  * aggregated {@link AgentUsage}.
223
226
  */
224
- type AgentDecisionExecutor = (request: AgentDecisionRequest) => PromiseLike<{
227
+ type AgentDecisionExecutor = (request: AgentDecisionRequest, info?: AgentRequestExecutorInfo) => PromiseLike<{
225
228
  event: ChosenEvent;
226
229
  reason?: string; /** This attempt's token usage, aggregated into the run result's {@link AgentUsage}. */
227
230
  usage?: AgentCallUsage;
@@ -252,7 +255,7 @@ interface ResolveDecisionOptions<TEvent extends ChosenEvent = ChosenEvent> {
252
255
  }
253
256
  /**
254
257
  * Validation + retry core for decisions. No provider mechanics — the
255
- * `executor` is responsible for making the model choose an event; this
258
+ * `executors.decide` is responsible for making the model choose an event; this
256
259
  * function only validates the choice and retries on failure, up to
257
260
  * `options.maxRetries` (default 2, i.e. up to 3 attempts total).
258
261
  *
@@ -270,12 +273,12 @@ interface ResolveDecisionOptions<TEvent extends ChosenEvent = ChosenEvent> {
270
273
  *
271
274
  * @example
272
275
  * ```ts
273
- * const event = await resolveDecision(request, decide, {
276
+ * const event = await resolveDecision(request, executors, {
274
277
  * canTake: (e) => snapshot.can(e),
275
278
  * });
276
279
  * ```
277
280
  */
278
- declare function resolveDecision<TEvent extends ChosenEvent = ChosenEvent>(request: AgentDecisionRequest, executor: AgentDecisionExecutor, options?: ResolveDecisionOptions<TEvent>): Promise<TEvent>;
281
+ declare function resolveDecision<TEvent extends ChosenEvent = ChosenEvent>(request: AgentDecisionRequest, executors: Pick<Partial<AgentRequestExecutors>, "decide">, options?: ResolveDecisionOptions<TEvent>): Promise<TEvent>;
279
282
  //#endregion
280
283
  //#region src/text-logic.d.ts
281
284
  declare const USER_INPUT_ACTOR: "agent.userInput";
@@ -352,12 +355,23 @@ interface AgentTextRequest<TMetadata = Record<string, unknown>> {
352
355
  topK?: number;
353
356
  seed?: number;
354
357
  stopSequences?: string[];
358
+ /**
359
+ * Bounds the HOST-side tool-call loop for this one request: the maximum
360
+ * number of model steps the executor may run before it must return. Omitted
361
+ * means single-step (one model call, tool results not fed back). Named and
362
+ * typed to match the AI SDK — the shipped adapter lowers it to
363
+ * `stopWhen: stepCountIs(maxSteps)`.
364
+ *
365
+ * This is a REQUEST budget, distinct from the machine-level `maxTurns` a
366
+ * preset uses for its own turn budget, and from `runAgent`'s run-wide
367
+ * `maxModelCalls`.
368
+ */
369
+ maxSteps?: number;
355
370
  /**
356
371
  * Host-owned per-call options. Use this for provider/runtime details such
357
372
  * as Cloudflare bindings, tracing IDs, SDK provider options, or transport
358
- * hints. The machine carries it; the host decides what it means e.g.
359
- * the AI SDK adapter (`createAiSdkExecutors`) reads `metadata.maxSteps` to
360
- * bound its multi-step tool-call loop for that request.
373
+ * hints. The machine carries it; the host decides what it means. Not the
374
+ * place for `maxSteps` any more — that is a typed field above.
361
375
  */
362
376
  metadata?: TMetadata;
363
377
  }
@@ -473,6 +487,8 @@ interface TextLogicConfig<TInputSchema extends StandardSchemaV1 = StandardSchema
473
487
  topK?: ResolveTextLogicValue<number | undefined, InferOutput<TInputSchema>>;
474
488
  seed?: ResolveTextLogicValue<number | undefined, InferOutput<TInputSchema>>;
475
489
  stopSequences?: ResolveTextLogicValue<string[] | undefined, InferOutput<TInputSchema>>;
490
+ /** Bounds this request's host-side tool loop (see {@link AgentTextRequest.maxSteps}). */
491
+ maxSteps?: ResolveTextLogicValue<number | undefined, InferOutput<TInputSchema>>;
476
492
  metadata?: ResolveTextLogicValue<TMetadata | undefined, InferOutput<TInputSchema>>;
477
493
  }
478
494
  /** Arguments passed to a {@link TextLogicExecutor}: the typed input, the lowered {@link AgentTextRequest}, and the actor's own `signal`/`system`/`self`/`emit`. */
@@ -725,4 +741,4 @@ declare function buildEnvelopeSchema(inner: StandardSchemaV1, options?: {
725
741
  */
726
742
  declare function parseStructuredEnvelope(request: Pick<AgentTextRequest, "outputSchema" | "reasoning">, value: unknown): StructuredOutputEnvelope;
727
743
  //#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, getAcceptedEvents as U, AgentRequestOptions as V, parseAgentEvent 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 };
744
+ 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 };
@@ -214,14 +214,17 @@ declare function renderDecisionAttempts(request: Pick<AgentDecisionRequest, "eve
214
214
  * `generateText`/`streamText` — how the model is coerced into choosing
215
215
  * (tool-per-event + forced tool choice, structured output, …) is entirely
216
216
  * adapter business; core only validates and retries the returned choice (see
217
- * {@link resolveDecision}). The optional `reason` is carried through to
217
+ * {@link resolveDecision}). It takes the same `(request, info)` pair as
218
+ * `generateText`/`streamText` — `info` carries the host seams (`signal`,
219
+ * `runId`, `requestId`); `onChunk` is never set for a decision.
220
+ * The optional `reason` is carried through to
218
221
  * `onResult`/event-sourcing but never affects validation. Like text
219
222
  * executors' `{ output, ...extras }` envelope, any extra keys (finish reason,
220
223
  * …) flow untouched to `onResult`'s `raw`; `usage` is the one core reads —
221
224
  * report this attempt's tokens there and `runAgent` folds them into the run's
222
225
  * aggregated {@link AgentUsage}.
223
226
  */
224
- type AgentDecisionExecutor = (request: AgentDecisionRequest) => PromiseLike<{
227
+ type AgentDecisionExecutor = (request: AgentDecisionRequest, info?: AgentRequestExecutorInfo) => PromiseLike<{
225
228
  event: ChosenEvent;
226
229
  reason?: string; /** This attempt's token usage, aggregated into the run result's {@link AgentUsage}. */
227
230
  usage?: AgentCallUsage;
@@ -252,7 +255,7 @@ interface ResolveDecisionOptions<TEvent extends ChosenEvent = ChosenEvent> {
252
255
  }
253
256
  /**
254
257
  * Validation + retry core for decisions. No provider mechanics — the
255
- * `executor` is responsible for making the model choose an event; this
258
+ * `executors.decide` is responsible for making the model choose an event; this
256
259
  * function only validates the choice and retries on failure, up to
257
260
  * `options.maxRetries` (default 2, i.e. up to 3 attempts total).
258
261
  *
@@ -270,12 +273,12 @@ interface ResolveDecisionOptions<TEvent extends ChosenEvent = ChosenEvent> {
270
273
  *
271
274
  * @example
272
275
  * ```ts
273
- * const event = await resolveDecision(request, decide, {
276
+ * const event = await resolveDecision(request, executors, {
274
277
  * canTake: (e) => snapshot.can(e),
275
278
  * });
276
279
  * ```
277
280
  */
278
- declare function resolveDecision<TEvent extends ChosenEvent = ChosenEvent>(request: AgentDecisionRequest, executor: AgentDecisionExecutor, options?: ResolveDecisionOptions<TEvent>): Promise<TEvent>;
281
+ declare function resolveDecision<TEvent extends ChosenEvent = ChosenEvent>(request: AgentDecisionRequest, executors: Pick<Partial<AgentRequestExecutors>, "decide">, options?: ResolveDecisionOptions<TEvent>): Promise<TEvent>;
279
282
  //#endregion
280
283
  //#region src/text-logic.d.ts
281
284
  declare const USER_INPUT_ACTOR: "agent.userInput";
@@ -352,12 +355,23 @@ interface AgentTextRequest<TMetadata = Record<string, unknown>> {
352
355
  topK?: number;
353
356
  seed?: number;
354
357
  stopSequences?: string[];
358
+ /**
359
+ * Bounds the HOST-side tool-call loop for this one request: the maximum
360
+ * number of model steps the executor may run before it must return. Omitted
361
+ * means single-step (one model call, tool results not fed back). Named and
362
+ * typed to match the AI SDK — the shipped adapter lowers it to
363
+ * `stopWhen: stepCountIs(maxSteps)`.
364
+ *
365
+ * This is a REQUEST budget, distinct from the machine-level `maxTurns` a
366
+ * preset uses for its own turn budget, and from `runAgent`'s run-wide
367
+ * `maxModelCalls`.
368
+ */
369
+ maxSteps?: number;
355
370
  /**
356
371
  * Host-owned per-call options. Use this for provider/runtime details such
357
372
  * as Cloudflare bindings, tracing IDs, SDK provider options, or transport
358
- * hints. The machine carries it; the host decides what it means e.g.
359
- * the AI SDK adapter (`createAiSdkExecutors`) reads `metadata.maxSteps` to
360
- * bound its multi-step tool-call loop for that request.
373
+ * hints. The machine carries it; the host decides what it means. Not the
374
+ * place for `maxSteps` any more — that is a typed field above.
361
375
  */
362
376
  metadata?: TMetadata;
363
377
  }
@@ -473,6 +487,8 @@ interface TextLogicConfig<TInputSchema extends StandardSchemaV1 = StandardSchema
473
487
  topK?: ResolveTextLogicValue<number | undefined, InferOutput<TInputSchema>>;
474
488
  seed?: ResolveTextLogicValue<number | undefined, InferOutput<TInputSchema>>;
475
489
  stopSequences?: ResolveTextLogicValue<string[] | undefined, InferOutput<TInputSchema>>;
490
+ /** Bounds this request's host-side tool loop (see {@link AgentTextRequest.maxSteps}). */
491
+ maxSteps?: ResolveTextLogicValue<number | undefined, InferOutput<TInputSchema>>;
476
492
  metadata?: ResolveTextLogicValue<TMetadata | undefined, InferOutput<TInputSchema>>;
477
493
  }
478
494
  /** Arguments passed to a {@link TextLogicExecutor}: the typed input, the lowered {@link AgentTextRequest}, and the actor's own `signal`/`system`/`self`/`emit`. */
@@ -725,4 +741,4 @@ declare function buildEnvelopeSchema(inner: StandardSchemaV1, options?: {
725
741
  */
726
742
  declare function parseStructuredEnvelope(request: Pick<AgentTextRequest, "outputSchema" | "reasoning">, value: unknown): StructuredOutputEnvelope;
727
743
  //#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, getAcceptedEvents as U, AgentRequestOptions as V, parseAgentEvent 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 };
744
+ 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 };