@statelyai/agent 2.0.0-alpha.25 → 2.0.0-alpha.27

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 (53) hide show
  1. package/dist/ai-sdk.cjs +4 -4
  2. package/dist/ai-sdk.d.cts +6 -6
  3. package/dist/ai-sdk.d.mts +6 -6
  4. package/dist/ai-sdk.mjs +4 -4
  5. package/dist/{decision-CM9CYZ6t.cjs → decision-CmM8-HHz.cjs} +10 -9
  6. package/dist/{decision-DzSv1NpD.mjs → decision-RQ0iv0oZ.mjs} +10 -9
  7. package/dist/{event-log-store-Ba2fsc4E.mjs → event-log-store-2pAFiWuc.mjs} +1 -1
  8. package/dist/{event-log-store-DvOcs10J.d.cts → event-log-store-2xzFmgr2.d.cts} +1 -1
  9. package/dist/{event-log-store-DxyVgnas.d.mts → event-log-store-BIPOz-di.d.mts} +1 -1
  10. package/dist/{event-log-store-DQmImLYk.cjs → event-log-store-C-COhIXP.cjs} +1 -1
  11. package/dist/index.cjs +13 -195
  12. package/dist/index.d.cts +25 -105
  13. package/dist/index.d.mts +25 -105
  14. package/dist/index.mjs +12 -189
  15. package/dist/log.cjs +1 -1
  16. package/dist/log.d.cts +1 -1
  17. package/dist/log.d.mts +1 -1
  18. package/dist/log.mjs +1 -1
  19. package/dist/machines.cjs +4 -7
  20. package/dist/machines.d.cts +5 -7
  21. package/dist/machines.d.mts +5 -7
  22. package/dist/machines.mjs +4 -7
  23. package/dist/openai.cjs +3 -3
  24. package/dist/openai.d.cts +5 -5
  25. package/dist/openai.d.mts +5 -5
  26. package/dist/openai.mjs +3 -3
  27. package/dist/otel.cjs +2 -2
  28. package/dist/otel.d.cts +3 -3
  29. package/dist/otel.d.mts +3 -3
  30. package/dist/otel.mjs +2 -2
  31. package/dist/{run-agent-CG343kFs.d.mts → run-agent-ByO-Bxyd.d.cts} +184 -179
  32. package/dist/{run-agent-BOfoJg5B.d.cts → run-agent-COXXc0RW.d.mts} +184 -179
  33. package/dist/{run-agent-Cb1-LS5P.cjs → run-agent-Dmf8GV2d.cjs} +539 -737
  34. package/dist/{run-agent-DvDQd4If.mjs → run-agent-xNTxpt82.mjs} +537 -705
  35. package/dist/{setup-agent-CFW-jPI8.mjs → setup-agent-BuanDXeh.mjs} +6 -28
  36. package/dist/{setup-agent-CPf7MxnG.cjs → setup-agent-DV4cTou-.cjs} +6 -28
  37. package/dist/testing.cjs +285 -170
  38. package/dist/testing.d.cts +39 -22
  39. package/dist/testing.d.mts +39 -22
  40. package/dist/testing.mjs +270 -155
  41. package/dist/{text-logic-Bl_ZRxDi.mjs → text-logic-CIqHAmBi.mjs} +10 -26
  42. package/dist/{text-logic-BFEOxyxv.d.cts → text-logic-D-czVPYp.d.mts} +27 -28
  43. package/dist/{text-logic-hZSiRUo1.d.mts → text-logic-IjfYy9DP.d.cts} +27 -28
  44. package/dist/{text-logic-C8xyr6Ag.cjs → text-logic-f5F5sCdc.cjs} +9 -43
  45. package/dist/{types-B1Qs2q3q.d.cts → types-BgNbNKnJ.d.mts} +3 -3
  46. package/dist/{types-tA3SdczG.d.mts → types-hR5f5YXa.d.cts} +3 -3
  47. package/dist/{utils-C1p37X_c.d.mts → utils-_q7F-AZu.d.mts} +3 -103
  48. package/dist/{utils-RalRn9sk.d.cts → utils-o4YRdHJX.d.cts} +3 -103
  49. package/dist/validate.cjs +0 -8
  50. package/dist/validate.mjs +0 -8
  51. package/package.json +5 -4
  52. package/readme.md +8 -4
  53. package/schemas/agent-workflow.json +0 -8
@@ -1,106 +1,6 @@
1
- import { C as UserMessage, S as ToolResultPart, _ as StandardSchemaV1, b as ToolCallPart, f as FilePart, l as AssistantMessage, n as AgentMessage, p as ImagePart, u as ChosenEvent, v as SystemMessage, x as ToolMessage, y as TextPart } from "./types-tA3SdczG.mjs";
2
- import { M as AgentDecisionRequest, c as AgentRequestExecutorInfo, f as AgentTextRequest, t as AgentCallUsage, u as AgentRequestExecutors } from "./text-logic-hZSiRUo1.mjs";
1
+ import { C as UserMessage, S as ToolResultPart, _ as StandardSchemaV1, b as ToolCallPart, f as FilePart, l as AssistantMessage, n as AgentMessage, p as ImagePart, v as SystemMessage, x as ToolMessage, y as TextPart } from "./types-BgNbNKnJ.mjs";
3
2
  import { AnyMachineSnapshot, AnyStateMachine, StateValue } from "xstate";
4
3
 
5
- //#region src/scripted-executors.d.ts
6
- /**
7
- * A scripted `decide` answer: either the {@link ChosenEvent} itself (an object
8
- * with a string `type`), or the executor result `{ event, reason?, usage? }`
9
- * when the entry also reports a `reason` or token `usage`.
10
- */
11
- type ScriptedDecisionValue = ChosenEvent | {
12
- event: ChosenEvent;
13
- reason?: string;
14
- usage?: AgentCallUsage;
15
- };
16
- /**
17
- * One scripted `decide` answer, or a function of the
18
- * {@link AgentDecisionRequest} returning one (for choices that depend on the
19
- * prompt, the candidate `events`, or the prior failed `attempts`).
20
- */
21
- type ScriptedDecisionEntry = ScriptedDecisionValue | ((request: AgentDecisionRequest) => ScriptedDecisionValue | PromiseLike<ScriptedDecisionValue>);
22
- /**
23
- * One scripted text answer: the request's output value (a string, or the
24
- * object a structured request declares), or a function of the
25
- * {@link AgentTextRequest} returning one.
26
- *
27
- * An entry is taken as the executor result (instead of the value itself)
28
- * only when its OWN keys are a `result` plus, optionally, `messages`/`usage`/
29
- * `raw` — that is how an entry reports token `usage`. Anything else, including
30
- * an object that merely happens to have a `result` key alongside its own data
31
- * (`{ result: 'draft', confidence: 0.9 }`), is the output value. For a
32
- * structured request whose declared output is exactly `{ result }` (or
33
- * `{ result, usage }`), wrap it once more: `{ result: { result: '…' } }`.
34
- */
35
- type ScriptedTextEntry = ((request: AgentTextRequest, info?: AgentRequestExecutorInfo) => unknown) | string | number | boolean | null | object;
36
- /**
37
- * A request-name keyed script. The key is the request's resolved `name` — the
38
- * authored name, else the invoke `id`. `"*"` is the fallback route.
39
- */
40
- type ScriptedByName<TEntry> = Record<string, TEntry | TEntry[]>;
41
- /** One scripted stream call: chunks, or a function producing chunks. */
42
- type ScriptedStreamEntry = string | readonly string[] | ((request: AgentTextRequest, info?: AgentRequestExecutorInfo) => string | readonly string[] | PromiseLike<string | readonly string[]>);
43
- /** A call observed by {@link createScriptedExecutors}. */
44
- interface ScriptedExecutorCall {
45
- kind: "generateText" | "streamText" | "decide";
46
- name: string;
47
- input: unknown;
48
- request: AgentTextRequest | AgentDecisionRequest;
49
- }
50
- /**
51
- * The script {@link createScriptedExecutors} plays back. Every channel is
52
- * keyed by request name and consumed in order; the last entry for a name
53
- * repeats forever.
54
- */
55
- interface ScriptedExecutorsScript {
56
- /** Answers for `decide` requests, keyed by request name. */
57
- decisions?: ScriptedByName<ScriptedDecisionEntry>;
58
- /** Answers for generate requests, keyed by request name. */
59
- text?: ScriptedByName<ScriptedTextEntry>;
60
- /** Stream chunks keyed by request name. */
61
- stream?: Record<string, ScriptedStreamEntry>;
62
- /** Default usage attached when an entry does not provide its own. */
63
- usage?: AgentCallUsage;
64
- }
65
- /** What {@link createScriptedExecutors} returns: the full executor set plus the calls it observed. */
66
- type ScriptedExecutors = Required<AgentRequestExecutors> & {
67
- calls: ScriptedExecutorCall[];
68
- };
69
- /**
70
- * Executors that replay a script instead of calling a model. Every slot is
71
- * provided, so any machine binds.
72
- *
73
- * Answers are keyed by the request's resolved name — its authored `name`, else
74
- * the invoke `id` — and `"*"` serves anything unmatched.
75
- * Entries for a name are consumed in order and the last one repeats forever, so
76
- * a looping machine needs no extra option. A request the script has no route
77
- * for throws an ordinary `Error` from inside the executor, which reaches the
78
- * machine as an actor error.
79
- *
80
- * Queues are copied on creation, so the caller's arrays are never mutated and
81
- * each call builds a fresh, independent playthrough. Entries may be plain
82
- * values or functions of the request.
83
- *
84
- * @example
85
- * ```ts
86
- * const result = await runAgent(moderationMachine, {
87
- * input: { comment: 'honestly this update is terrible', trust: 20 },
88
- * executors: createScriptedExecutors({
89
- * decisions: { moderate: [{ type: 'FLAG', reason: 'Borderline tone.' }] },
90
- * }),
91
- * });
92
- * ```
93
- *
94
- * @example Dynamic entries
95
- * ```ts
96
- * createScriptedExecutors({
97
- * text: { draft: (request) => `Draft about ${request.prompt}` },
98
- * decisions: { route: (request) => ({ type: request.events[0]!.type }) },
99
- * });
100
- * ```
101
- */
102
- declare function createScriptedExecutors(script?: ScriptedExecutorsScript): ScriptedExecutors;
103
- //#endregion
104
4
  //#region src/utils.d.ts
105
5
  /** Returns the human-readable text carried by a message, ignoring non-text parts. */
106
6
  declare function getMessageText(message: AgentMessage): string;
@@ -113,7 +13,7 @@ declare function getMessageText(message: AgentMessage): string;
113
13
  * their prompts or executors hash identically; adding/removing/retargeting a
114
14
  * state or transition changes the hash.
115
15
  *
116
- * Used by {@link runAgent} to stamp settled snapshots with a `version` and to
16
+ * Used by {@link createAgentRuntime} to stamp settled snapshots with a `version` and to
117
17
  * detect a structurally-edited machine on resume. It is a change detector, not
118
18
  * a cryptographic digest — collisions are possible but unlikely for real
119
19
  * configs. Declare `createMachine({ version })` to pin an explicit version instead.
@@ -206,4 +106,4 @@ declare function getJsonSchema(schema?: StandardSchemaV1): Promise<Record<string
206
106
  */
207
107
  declare function getJsonSchemaSync(schema?: StandardSchemaV1): Record<string, unknown> | undefined;
208
108
  //#endregion
209
- export { ScriptedExecutorsScript as _, getMachineStructuralHash as a, getStatePath as c, toolMessage as d, userMessage as f, ScriptedExecutors as g, ScriptedDecisionValue as h, getJsonSchemaSync as i, isStandardSchema as l, ScriptedDecisionEntry as m, assistantMessage as n, getMessageText as o, ScriptedByName as p, getJsonSchema as r, getStateMeta as s, MetaOfSnapshot as t, systemMessage as u, ScriptedTextEntry as v, createScriptedExecutors as y };
109
+ export { getMachineStructuralHash as a, getStatePath as c, toolMessage as d, userMessage as f, getJsonSchemaSync as i, isStandardSchema as l, assistantMessage as n, getMessageText as o, getJsonSchema as r, getStateMeta as s, MetaOfSnapshot as t, systemMessage as u };
@@ -1,106 +1,6 @@
1
- import { C as UserMessage, S as ToolResultPart, _ as StandardSchemaV1, b as ToolCallPart, f as FilePart, l as AssistantMessage, n as AgentMessage, p as ImagePart, u as ChosenEvent, v as SystemMessage, x as ToolMessage, y as TextPart } from "./types-B1Qs2q3q.cjs";
2
- import { M as AgentDecisionRequest, c as AgentRequestExecutorInfo, f as AgentTextRequest, t as AgentCallUsage, u as AgentRequestExecutors } from "./text-logic-BFEOxyxv.cjs";
1
+ import { C as UserMessage, S as ToolResultPart, _ as StandardSchemaV1, b as ToolCallPart, f as FilePart, l as AssistantMessage, n as AgentMessage, p as ImagePart, v as SystemMessage, x as ToolMessage, y as TextPart } from "./types-hR5f5YXa.cjs";
3
2
  import { AnyMachineSnapshot, AnyStateMachine, StateValue } from "xstate";
4
3
 
5
- //#region src/scripted-executors.d.ts
6
- /**
7
- * A scripted `decide` answer: either the {@link ChosenEvent} itself (an object
8
- * with a string `type`), or the executor result `{ event, reason?, usage? }`
9
- * when the entry also reports a `reason` or token `usage`.
10
- */
11
- type ScriptedDecisionValue = ChosenEvent | {
12
- event: ChosenEvent;
13
- reason?: string;
14
- usage?: AgentCallUsage;
15
- };
16
- /**
17
- * One scripted `decide` answer, or a function of the
18
- * {@link AgentDecisionRequest} returning one (for choices that depend on the
19
- * prompt, the candidate `events`, or the prior failed `attempts`).
20
- */
21
- type ScriptedDecisionEntry = ScriptedDecisionValue | ((request: AgentDecisionRequest) => ScriptedDecisionValue | PromiseLike<ScriptedDecisionValue>);
22
- /**
23
- * One scripted text answer: the request's output value (a string, or the
24
- * object a structured request declares), or a function of the
25
- * {@link AgentTextRequest} returning one.
26
- *
27
- * An entry is taken as the executor result (instead of the value itself)
28
- * only when its OWN keys are a `result` plus, optionally, `messages`/`usage`/
29
- * `raw` — that is how an entry reports token `usage`. Anything else, including
30
- * an object that merely happens to have a `result` key alongside its own data
31
- * (`{ result: 'draft', confidence: 0.9 }`), is the output value. For a
32
- * structured request whose declared output is exactly `{ result }` (or
33
- * `{ result, usage }`), wrap it once more: `{ result: { result: '…' } }`.
34
- */
35
- type ScriptedTextEntry = ((request: AgentTextRequest, info?: AgentRequestExecutorInfo) => unknown) | string | number | boolean | null | object;
36
- /**
37
- * A request-name keyed script. The key is the request's resolved `name` — the
38
- * authored name, else the invoke `id`. `"*"` is the fallback route.
39
- */
40
- type ScriptedByName<TEntry> = Record<string, TEntry | TEntry[]>;
41
- /** One scripted stream call: chunks, or a function producing chunks. */
42
- type ScriptedStreamEntry = string | readonly string[] | ((request: AgentTextRequest, info?: AgentRequestExecutorInfo) => string | readonly string[] | PromiseLike<string | readonly string[]>);
43
- /** A call observed by {@link createScriptedExecutors}. */
44
- interface ScriptedExecutorCall {
45
- kind: "generateText" | "streamText" | "decide";
46
- name: string;
47
- input: unknown;
48
- request: AgentTextRequest | AgentDecisionRequest;
49
- }
50
- /**
51
- * The script {@link createScriptedExecutors} plays back. Every channel is
52
- * keyed by request name and consumed in order; the last entry for a name
53
- * repeats forever.
54
- */
55
- interface ScriptedExecutorsScript {
56
- /** Answers for `decide` requests, keyed by request name. */
57
- decisions?: ScriptedByName<ScriptedDecisionEntry>;
58
- /** Answers for generate requests, keyed by request name. */
59
- text?: ScriptedByName<ScriptedTextEntry>;
60
- /** Stream chunks keyed by request name. */
61
- stream?: Record<string, ScriptedStreamEntry>;
62
- /** Default usage attached when an entry does not provide its own. */
63
- usage?: AgentCallUsage;
64
- }
65
- /** What {@link createScriptedExecutors} returns: the full executor set plus the calls it observed. */
66
- type ScriptedExecutors = Required<AgentRequestExecutors> & {
67
- calls: ScriptedExecutorCall[];
68
- };
69
- /**
70
- * Executors that replay a script instead of calling a model. Every slot is
71
- * provided, so any machine binds.
72
- *
73
- * Answers are keyed by the request's resolved name — its authored `name`, else
74
- * the invoke `id` — and `"*"` serves anything unmatched.
75
- * Entries for a name are consumed in order and the last one repeats forever, so
76
- * a looping machine needs no extra option. A request the script has no route
77
- * for throws an ordinary `Error` from inside the executor, which reaches the
78
- * machine as an actor error.
79
- *
80
- * Queues are copied on creation, so the caller's arrays are never mutated and
81
- * each call builds a fresh, independent playthrough. Entries may be plain
82
- * values or functions of the request.
83
- *
84
- * @example
85
- * ```ts
86
- * const result = await runAgent(moderationMachine, {
87
- * input: { comment: 'honestly this update is terrible', trust: 20 },
88
- * executors: createScriptedExecutors({
89
- * decisions: { moderate: [{ type: 'FLAG', reason: 'Borderline tone.' }] },
90
- * }),
91
- * });
92
- * ```
93
- *
94
- * @example Dynamic entries
95
- * ```ts
96
- * createScriptedExecutors({
97
- * text: { draft: (request) => `Draft about ${request.prompt}` },
98
- * decisions: { route: (request) => ({ type: request.events[0]!.type }) },
99
- * });
100
- * ```
101
- */
102
- declare function createScriptedExecutors(script?: ScriptedExecutorsScript): ScriptedExecutors;
103
- //#endregion
104
4
  //#region src/utils.d.ts
105
5
  /** Returns the human-readable text carried by a message, ignoring non-text parts. */
106
6
  declare function getMessageText(message: AgentMessage): string;
@@ -113,7 +13,7 @@ declare function getMessageText(message: AgentMessage): string;
113
13
  * their prompts or executors hash identically; adding/removing/retargeting a
114
14
  * state or transition changes the hash.
115
15
  *
116
- * Used by {@link runAgent} to stamp settled snapshots with a `version` and to
16
+ * Used by {@link createAgentRuntime} to stamp settled snapshots with a `version` and to
117
17
  * detect a structurally-edited machine on resume. It is a change detector, not
118
18
  * a cryptographic digest — collisions are possible but unlikely for real
119
19
  * configs. Declare `createMachine({ version })` to pin an explicit version instead.
@@ -206,4 +106,4 @@ declare function getJsonSchema(schema?: StandardSchemaV1): Promise<Record<string
206
106
  */
207
107
  declare function getJsonSchemaSync(schema?: StandardSchemaV1): Record<string, unknown> | undefined;
208
108
  //#endregion
209
- export { ScriptedExecutorsScript as _, getMachineStructuralHash as a, getStatePath as c, toolMessage as d, userMessage as f, ScriptedExecutors as g, ScriptedDecisionValue as h, getJsonSchemaSync as i, isStandardSchema as l, ScriptedDecisionEntry as m, assistantMessage as n, getMessageText as o, ScriptedByName as p, getJsonSchema as r, getStateMeta as s, MetaOfSnapshot as t, systemMessage as u, ScriptedTextEntry as v, createScriptedExecutors as y };
109
+ export { getMachineStructuralHash as a, getStatePath as c, toolMessage as d, userMessage as f, getJsonSchemaSync as i, isStandardSchema as l, assistantMessage as n, getMessageText as o, getJsonSchema as r, getStateMeta as s, MetaOfSnapshot as t, systemMessage as u };
package/dist/validate.cjs CHANGED
@@ -81,14 +81,6 @@ var agent_workflow_default = {
81
81
  "propertyNames": { "$ref": "#/$defs/Identifier" },
82
82
  "additionalProperties": { "$ref": "#/$defs/State" }
83
83
  },
84
- "idleTags": {
85
- "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(...) idle predicate so runAgent settles those states idle deterministically. Every listed tag must appear in some state's 'tags'.",
86
- "type": "array",
87
- "items": {
88
- "type": "string",
89
- "minLength": 1
90
- }
91
- },
92
84
  "meta": { "$ref": "#/$defs/JsonObject" }
93
85
  },
94
86
  additionalProperties: false,
package/dist/validate.mjs CHANGED
@@ -57,14 +57,6 @@ var agent_workflow_default = {
57
57
  "propertyNames": { "$ref": "#/$defs/Identifier" },
58
58
  "additionalProperties": { "$ref": "#/$defs/State" }
59
59
  },
60
- "idleTags": {
61
- "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(...) idle predicate so runAgent settles those states idle deterministically. Every listed tag must appear in some state's 'tags'.",
62
- "type": "array",
63
- "items": {
64
- "type": "string",
65
- "minLength": 1
66
- }
67
- },
68
60
  "meta": { "$ref": "#/$defs/JsonObject" }
69
61
  },
70
62
  additionalProperties: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statelyai/agent",
3
- "version": "2.0.0-alpha.25",
3
+ "version": "2.0.0-alpha.27",
4
4
  "description": "Make invalid agent actions impossible. Agent logic as state machines: deterministic, inspectable, resumable, runs anywhere.",
5
5
  "keywords": [
6
6
  "agent",
@@ -115,6 +115,7 @@
115
115
  },
116
116
  "devDependencies": {
117
117
  "@ai-sdk/openai": "^4.0.0",
118
+ "@ai-sdk/typesafe-ai": "3.0.6",
118
119
  "@anthropic-ai/sdk": "^0.120.0",
119
120
  "@changesets/changelog-github": "^0.5.2",
120
121
  "@changesets/cli": "^2.31.1",
@@ -128,7 +129,7 @@
128
129
  "@opentelemetry/sdk-trace-base": "^2.10.0",
129
130
  "@types/node": "^20.19.43",
130
131
  "@types/react": "^19.2.18",
131
- "ai": "^7.0.0",
132
+ "ai": "^7.0.113",
132
133
  "ajv": "^8.20.0",
133
134
  "braintrust": "^3.28.0",
134
135
  "dotenv": "^16.6.1",
@@ -143,7 +144,7 @@
143
144
  "typescript": "^5.9.3",
144
145
  "valibot": "^1.4.2",
145
146
  "vitest": "^4.1.11",
146
- "xstate": "6.0.0-alpha.57",
147
+ "xstate": "6.0.0-alpha.64",
147
148
  "zod": "^4.4.3"
148
149
  },
149
150
  "peerDependencies": {
@@ -151,7 +152,7 @@
151
152
  "ai": "^7.0.0",
152
153
  "ajv": "^8.20.0",
153
154
  "openai": ">=5.0.0 <8",
154
- "xstate": ">=6.0.0-alpha.57 <6.0.0"
155
+ "xstate": "6.0.0-alpha.64"
155
156
  },
156
157
  "peerDependenciesMeta": {
157
158
  "@opentelemetry/api": {
package/readme.md CHANGED
@@ -25,9 +25,11 @@ Stately Agent 2 is in alpha. APIs may change before the stable release.
25
25
  <!-- install command matching the package prerelease channel and package.json peers -->
26
26
 
27
27
  ```sh
28
- pnpm add @statelyai/agent@alpha xstate@alpha zod
28
+ pnpm add @statelyai/agent@alpha xstate@6.0.0-alpha.64 zod
29
29
  ```
30
30
 
31
+ XState is pinned while its experimental durable restoration API evolves.
32
+
31
33
  For the optional Vercel AI SDK executor:
32
34
 
33
35
  ```sh
@@ -40,6 +42,8 @@ For the optional raw OpenAI SDK executor (`@statelyai/agent/openai`):
40
42
  pnpm add openai
41
43
  ```
42
44
 
45
+ Classification, grading, relevance, and yes/no checks are judgments: call the AI SDK's `experimental_evaluate` with `@ai-sdk/typesafe-ai` (`pnpm add ai @ai-sdk/typesafe-ai`) from an ordinary actor; see [Judgments with the AI SDK](docs/judgments.md).
46
+
43
47
  Requirements:
44
48
 
45
49
  - Node 22.18 or newer, and XState v6 alpha.46 or newer.
@@ -139,7 +143,7 @@ const liveResult = await runAgent(refundMachine, {
139
143
  });
140
144
  ```
141
145
 
142
- For a machine with several requests, `createScriptedExecutors` from `@statelyai/agent/testing` holds ordered answers keyed by request name. See [Evals](docs/evals.md#scripted-executors).
146
+ For a machine with several requests, the executor routes on `request.name`, or `MockLanguageModelV3` from `ai/test` stands in for the provider behind `createAiSdkExecutors`. See [Evals](docs/evals.md#testing-without-a-provider).
143
147
 
144
148
  Passing the same `models` map to `setupAgent({ models })` types the machine's model refs. Executors are always explicit, and core does not import the AI SDK. See [Hosts and executors](docs/hosts.md).
145
149
 
@@ -155,7 +159,7 @@ flowchart LR
155
159
  R -->|event or output| M
156
160
  ```
157
161
 
158
- The machine never talks to a model directly, so swapping `createAiSdkExecutors` for `createScriptedExecutors` (or your own functions) changes nothing about the agent.
162
+ The machine never talks to a model directly, so swapping `createAiSdkExecutors` for your own functions changes nothing about the agent.
159
163
 
160
164
  The example above has one model decision and two final outcomes. Real machines add approval states, retries, parallel work, child agents, and long-running waits without changing how control flow is represented.
161
165
 
@@ -169,7 +173,7 @@ The core concepts (machines owning control flow, bounded model decisions, typed
169
173
  - [Chameleon](examples/chameleon) combines hidden information, sequential turns, and a human vote.
170
174
  - [Snapshot migration](examples/snapshot-migration) uses XState's native `version` and `migrate` contract.
171
175
  - [Portable XState loop](examples/portable-xstate-loop) runs the artifact through native transitions and effects.
172
- - [Framework-owned storage](examples/file-snapshot-store) persists native XState snapshots in application code.
176
+ - [Application-owned storage](examples/file-snapshot-store) persists native XState snapshots in application code.
173
177
  - [Tool calling](examples/review-tool-calls) keeps tools and message history in the AI SDK's native format.
174
178
  - [Ticket triage](examples/triage) returns structured data from a model request.
175
179
  - [JSON agent](examples/json-agent) runs a machine defined as data.
@@ -71,14 +71,6 @@
71
71
  "$ref": "#/$defs/State"
72
72
  }
73
73
  },
74
- "idleTags": {
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(...) idle 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
- },
82
74
  "meta": {
83
75
  "$ref": "#/$defs/JsonObject"
84
76
  }