@statelyai/agent 1.1.6 → 2.0.0-alpha.10

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 (88) hide show
  1. package/LICENSE +21 -0
  2. package/dist/ai-sdk.cjs +342 -0
  3. package/dist/ai-sdk.d.cts +206 -0
  4. package/dist/ai-sdk.d.mts +206 -0
  5. package/dist/ai-sdk.mjs +331 -0
  6. package/dist/cli.cjs +64 -0
  7. package/dist/cli.d.cts +1 -0
  8. package/dist/cli.d.mts +1 -0
  9. package/dist/cli.mjs +65 -0
  10. package/dist/decision-CQdrKc8k.mjs +978 -0
  11. package/dist/decision-b-lkcs4L.cjs +1295 -0
  12. package/dist/index.cjs +59 -0
  13. package/dist/index.d.cts +212 -0
  14. package/dist/index.d.mts +201 -417
  15. package/dist/index.mjs +4 -588
  16. package/dist/openai-compat.cjs +319 -0
  17. package/dist/openai-compat.d.cts +98 -0
  18. package/dist/openai-compat.d.mts +98 -0
  19. package/dist/openai-compat.mjs +312 -0
  20. package/dist/run-agent-BFMkuI1F.cjs +1599 -0
  21. package/dist/run-agent-BVMd--1l.d.cts +1103 -0
  22. package/dist/run-agent-BoAOq_0Z.mjs +1540 -0
  23. package/dist/run-agent-DzYJb3CK.d.mts +1103 -0
  24. package/dist/src-D-77Ha5p.cjs +1087 -0
  25. package/dist/src-DUeIFjv-.mjs +1016 -0
  26. package/dist/text-logic-C7WJpCIc.d.mts +710 -0
  27. package/dist/text-logic-CZjyACzQ.d.cts +710 -0
  28. package/dist/types-C9QiMjre.d.cts +219 -0
  29. package/dist/types-qm00QF91.d.mts +219 -0
  30. package/dist/utils-Dri7aeEG.d.cts +108 -0
  31. package/dist/utils-Y6GDRGGE.d.mts +108 -0
  32. package/dist/zod.cjs +31 -0
  33. package/dist/zod.d.cts +30 -0
  34. package/dist/zod.d.mts +30 -0
  35. package/dist/zod.mjs +30 -0
  36. package/package.json +109 -28
  37. package/readme.md +143 -6
  38. package/schemas/agent-workflow.json +527 -0
  39. package/.changeset/README.md +0 -8
  40. package/.changeset/config.json +0 -11
  41. package/.env.template +0 -3
  42. package/.github/actions/ci-setup/action.yml +0 -24
  43. package/.github/workflows/release.yml +0 -46
  44. package/.vscode/launch.json +0 -28
  45. package/CHANGELOG.md +0 -222
  46. package/dist/index.d.ts +0 -428
  47. package/dist/index.js +0 -621
  48. package/examples/chatbot.ts +0 -71
  49. package/examples/cot.ts +0 -89
  50. package/examples/email.ts +0 -118
  51. package/examples/example.ts +0 -81
  52. package/examples/goal.ts +0 -94
  53. package/examples/helpers/helpers.ts +0 -17
  54. package/examples/helpers/loader.ts +0 -32
  55. package/examples/helpers/runner.ts +0 -27
  56. package/examples/joke.ts +0 -225
  57. package/examples/multi.ts +0 -103
  58. package/examples/newspaper.ts +0 -324
  59. package/examples/number.ts +0 -102
  60. package/examples/raffle.ts +0 -105
  61. package/examples/sandbox.ts +0 -28
  62. package/examples/simple.ts +0 -39
  63. package/examples/support.ts +0 -147
  64. package/examples/ticTacToe.ts +0 -224
  65. package/examples/todo.ts +0 -137
  66. package/examples/tutor.ts +0 -100
  67. package/examples/verify.ts +0 -120
  68. package/examples/weather.ts +0 -178
  69. package/examples/wiki.ts +0 -30
  70. package/examples/word.ts +0 -171
  71. package/src/adapters/vercel.ts +0 -7
  72. package/src/agent-experimental.ts +0 -221
  73. package/src/agent.test.ts +0 -506
  74. package/src/agent.ts +0 -300
  75. package/src/decision.test.ts +0 -179
  76. package/src/decision.ts +0 -84
  77. package/src/index.ts +0 -4
  78. package/src/memory.ts +0 -25
  79. package/src/planners/shortestPathPlanner.ts +0 -22
  80. package/src/planners/simplePlanner.ts +0 -139
  81. package/src/schemas.ts +0 -11
  82. package/src/strategies/chain-of-note.ts +0 -155
  83. package/src/templates/defaultText.ts +0 -18
  84. package/src/text.ts +0 -241
  85. package/src/types.ts +0 -499
  86. package/src/utils.ts +0 -72
  87. package/tsconfig.json +0 -109
  88. package/vitest.config.ts +0 -9
package/dist/index.mjs CHANGED
@@ -1,588 +1,4 @@
1
- // src/agent.ts
2
- import {
3
- createActor,
4
- fromTransition
5
- } from "xstate";
6
-
7
- // src/planners/simplePlanner.ts
8
- import { tool } from "ai";
9
-
10
- // src/utils.ts
11
- import hash from "object-hash";
12
- function getAllTransitions(state) {
13
- const nodes = state._nodes;
14
- const transitions = nodes.map((node) => [...node.transitions.values()]).map((nodeTransitions) => {
15
- return nodeTransitions.map((nodeEventTransitions) => {
16
- return nodeEventTransitions.map((transition) => {
17
- return {
18
- ...transition,
19
- guard: typeof transition.guard === "string" ? { type: transition.guard } : transition.guard
20
- // TODO: fix
21
- };
22
- });
23
- });
24
- }).flat(2);
25
- return transitions;
26
- }
27
- function getAllMachineTransitions(stateNode) {
28
- const transitions = [...stateNode.transitions.values()].map((nodeTransitions) => {
29
- return nodeTransitions.map((transition) => {
30
- return {
31
- ...transition,
32
- guard: typeof transition.guard === "string" ? { type: transition.guard } : transition.guard
33
- // TODO: fix
34
- };
35
- });
36
- }).flat(2);
37
- for (const s of Object.values(stateNode.states)) {
38
- const stateTransitions = getAllMachineTransitions(s);
39
- transitions.push(...stateTransitions);
40
- }
41
- return transitions;
42
- }
43
- function wrapInXml(tagName, content) {
44
- return `<${tagName}>${content}</${tagName}>`;
45
- }
46
- function randomId() {
47
- const timestamp = Date.now().toString(36);
48
- const random = Math.random().toString(36).substring(2, 9);
49
- return timestamp + random;
50
- }
51
- var machineHashes = /* @__PURE__ */ new WeakMap();
52
- function getMachineHash(machine) {
53
- if (machineHashes.has(machine)) return machineHashes.get(machine);
54
- const transitions = getAllMachineTransitions(machine.root);
55
- const machineHash = hash(transitions);
56
- machineHashes.set(machine, machineHash);
57
- return machineHash;
58
- }
59
-
60
- // src/templates/defaultText.ts
61
- var defaultTextTemplate = (data) => {
62
- const preamble = [
63
- data.context ? wrapInXml("context", JSON.stringify(data.context)) : void 0
64
- ].filter(Boolean).join("\n");
65
- return `
66
- ${preamble}
67
-
68
- ${data.goal}
69
- `.trim();
70
- };
71
-
72
- // src/text.ts
73
- import {
74
- fromObservable,
75
- fromPromise,
76
- toObserver
77
- } from "xstate";
78
- async function getMessages(agent, prompt, options) {
79
- let messages = [];
80
- if (typeof options.messages === "function") {
81
- messages = await options.messages(agent);
82
- } else if (options.messages) {
83
- messages = options.messages;
84
- }
85
- messages = messages.concat({
86
- role: "user",
87
- content: prompt
88
- });
89
- return messages;
90
- }
91
- async function agentGenerateText(agent, options) {
92
- const resolvedOptions = {
93
- ...agent.defaultOptions,
94
- ...options,
95
- correlationId: options.correlationId ?? randomId()
96
- };
97
- const template = resolvedOptions.template ?? defaultTextTemplate;
98
- const id = randomId();
99
- const goal = typeof resolvedOptions.prompt === "string" ? resolvedOptions.prompt : await resolvedOptions.prompt(agent);
100
- const promptWithContext = template({
101
- goal,
102
- context: resolvedOptions.context
103
- });
104
- const messages = await getMessages(agent, promptWithContext, resolvedOptions);
105
- agent.addMessage({
106
- id,
107
- role: "user",
108
- content: promptWithContext,
109
- timestamp: Date.now(),
110
- correlationId: resolvedOptions.correlationId,
111
- parentCorrelationId: resolvedOptions.parentCorrelationId
112
- });
113
- const result = await agent.adapter.generateText({
114
- ...resolvedOptions,
115
- prompt: void 0,
116
- messages
117
- });
118
- agent.addMessage({
119
- content: result.text,
120
- id,
121
- role: "assistant",
122
- timestamp: Date.now(),
123
- responseId: id,
124
- result,
125
- correlationId: resolvedOptions.correlationId,
126
- parentCorrelationId: resolvedOptions.parentCorrelationId
127
- });
128
- return {
129
- ...result,
130
- parentCorrelationId: resolvedOptions.parentCorrelationId,
131
- correlationId: resolvedOptions.correlationId
132
- };
133
- }
134
- async function agentStreamText(agent, options) {
135
- const resolvedOptions = {
136
- ...agent.defaultOptions,
137
- ...options,
138
- correlationId: options.correlationId ?? randomId()
139
- };
140
- const template = resolvedOptions.template ?? defaultTextTemplate;
141
- const id = randomId();
142
- const goal = typeof resolvedOptions.prompt === "string" ? resolvedOptions.prompt : await resolvedOptions.prompt(agent);
143
- const promptWithContext = template({
144
- goal,
145
- context: resolvedOptions.context
146
- });
147
- const messages = await getMessages(agent, promptWithContext, resolvedOptions);
148
- agent.addMessage({
149
- role: "user",
150
- content: promptWithContext,
151
- id,
152
- timestamp: Date.now(),
153
- correlationId: resolvedOptions.correlationId,
154
- parentCorrelationId: resolvedOptions.parentCorrelationId
155
- });
156
- const result = await agent.adapter.streamText({
157
- ...resolvedOptions,
158
- prompt: void 0,
159
- messages,
160
- onFinish: async (res) => {
161
- agent.addMessage({
162
- role: "assistant",
163
- result: {
164
- text: res.text,
165
- finishReason: res.finishReason,
166
- logprobs: void 0,
167
- responseMessages: [],
168
- toolCalls: [],
169
- toolResults: [],
170
- usage: res.usage,
171
- warnings: res.warnings,
172
- rawResponse: res.rawResponse,
173
- roundtrips: [],
174
- // TODO: how do we get this information?,
175
- steps: res.steps,
176
- response: res.response,
177
- experimental_providerMetadata: res.experimental_providerMetadata
178
- },
179
- content: res.text,
180
- id: randomId(),
181
- timestamp: Date.now(),
182
- responseId: id,
183
- correlationId: resolvedOptions.correlationId,
184
- parentCorrelationId: resolvedOptions.parentCorrelationId
185
- });
186
- }
187
- });
188
- return {
189
- ...result,
190
- textStream: result.textStream,
191
- fullStream: result.fullStream,
192
- parentCorrelationId: resolvedOptions.parentCorrelationId,
193
- correlationId: resolvedOptions.correlationId
194
- };
195
- }
196
- function fromTextStream(agent, defaultOptions) {
197
- return fromObservable(({ input }) => {
198
- const observers = /* @__PURE__ */ new Set();
199
- (async () => {
200
- const result = await agentStreamText(agent, {
201
- ...defaultOptions,
202
- ...input,
203
- context: input.context
204
- });
205
- for await (const part of result.fullStream) {
206
- if (part.type === "text-delta") {
207
- observers.forEach((observer) => {
208
- observer.next?.(part);
209
- });
210
- }
211
- }
212
- })();
213
- return {
214
- subscribe: (...args) => {
215
- const observer = toObserver(...args);
216
- observers.add(observer);
217
- return {
218
- unsubscribe: () => {
219
- observers.delete(observer);
220
- }
221
- };
222
- }
223
- };
224
- });
225
- }
226
- function fromText(agent, defaultOptions) {
227
- return fromPromise(async ({ input }) => {
228
- return await agentGenerateText(agent, {
229
- ...input,
230
- ...defaultOptions,
231
- context: input.context
232
- });
233
- });
234
- }
235
-
236
- // src/planners/simplePlanner.ts
237
- function getTransitions(state, machine) {
238
- if (!machine) {
239
- return [];
240
- }
241
- const resolvedState = machine.resolveState(state);
242
- return getAllTransitions(resolvedState);
243
- }
244
- var simplePlannerPromptTemplate = (data) => {
245
- return `
246
- ${defaultTextTemplate(data)}
247
-
248
- Make at most one tool call to achieve the above goal. If the goal cannot be achieved with any tool calls, do not make any tool call.
249
- `.trim();
250
- };
251
- async function simplePlanner(agent, input) {
252
- const transitions = input.machine ? getTransitions(input.state, input.machine) : Object.entries(input.events).map(([eventType, { description }]) => ({
253
- eventType,
254
- description
255
- }));
256
- const filter = (eventType) => Object.keys(input.events).includes(eventType);
257
- const functionNameMapping = {};
258
- const toolTransitions = transitions.filter((t) => {
259
- return filter(t.eventType);
260
- }).map((t) => {
261
- const name = t.eventType.replace(/\./g, "_");
262
- functionNameMapping[name] = t.eventType;
263
- return {
264
- type: "function",
265
- eventType: t.eventType,
266
- description: t.description,
267
- name
268
- };
269
- });
270
- const toolMap = {};
271
- for (const toolTransitionData of toolTransitions) {
272
- const toolZodType = input.events?.[toolTransitionData.eventType];
273
- if (!toolZodType) {
274
- continue;
275
- }
276
- toolMap[toolTransitionData.name] = tool({
277
- description: toolZodType?.description ?? toolTransitionData.description,
278
- parameters: toolZodType,
279
- execute: async (params) => {
280
- const event = {
281
- type: toolTransitionData.eventType,
282
- ...params
283
- };
284
- return event;
285
- }
286
- });
287
- }
288
- if (!Object.keys(toolMap).length) {
289
- return void 0;
290
- }
291
- const prompt = simplePlannerPromptTemplate({
292
- context: input.state.context,
293
- goal: input.goal
294
- });
295
- const messages = await getMessages(agent, prompt, input);
296
- const result = await agent.generateText({
297
- toolChoice: "required",
298
- ...input,
299
- prompt,
300
- messages,
301
- tools: toolMap
302
- });
303
- const singleResult = result.toolResults[0];
304
- if (!singleResult) {
305
- console.warn("No tool call results returned");
306
- return void 0;
307
- }
308
- return {
309
- goal: input.goal,
310
- state: input.state,
311
- execute: async (state) => {
312
- if (JSON.stringify(state) === JSON.stringify(input.state)) {
313
- return singleResult.result;
314
- }
315
- return void 0;
316
- },
317
- nextEvent: singleResult.result,
318
- sessionId: agent.sessionId,
319
- timestamp: Date.now()
320
- };
321
- }
322
-
323
- // src/decision.ts
324
- import { fromPromise as fromPromise2 } from "xstate";
325
- async function agentDecide(agent, options) {
326
- const resolvedOptions = {
327
- ...agent.defaultOptions,
328
- ...options
329
- };
330
- const {
331
- planner = simplePlanner,
332
- goal,
333
- events = agent.events,
334
- state,
335
- machine,
336
- model = agent.model,
337
- ...otherPlanInput
338
- } = resolvedOptions;
339
- const plan = await planner(agent, {
340
- model,
341
- goal,
342
- events,
343
- state,
344
- machine,
345
- ...otherPlanInput
346
- });
347
- if (plan?.nextEvent) {
348
- agent.addPlan(plan);
349
- await resolvedOptions.execute?.(plan.nextEvent);
350
- }
351
- return plan;
352
- }
353
- function fromDecision(agent, defaultInput) {
354
- return fromPromise2(async ({ input, self }) => {
355
- const parentRef = self._parent;
356
- if (!parentRef) {
357
- return;
358
- }
359
- const snapshot = parentRef.getSnapshot();
360
- const inputObject = typeof input === "string" ? { goal: input } : input;
361
- const resolvedInput = {
362
- ...defaultInput,
363
- ...inputObject
364
- };
365
- const contextToInclude = resolvedInput.context === true ? (
366
- // include entire context
367
- parentRef.getSnapshot().context
368
- ) : resolvedInput.context;
369
- const state = {
370
- value: snapshot.value,
371
- context: contextToInclude
372
- };
373
- const plan = await agentDecide(agent, {
374
- machine: parentRef.logic,
375
- state,
376
- execute: async (event) => {
377
- parentRef.send(event);
378
- },
379
- ...resolvedInput
380
- });
381
- return plan;
382
- });
383
- }
384
-
385
- // src/adapters/vercel.ts
386
- import { generateText, streamText } from "ai";
387
- var vercelAdapter = {
388
- generateText,
389
- streamText
390
- };
391
-
392
- // src/agent.ts
393
- var agentLogic = fromTransition(
394
- (state, event, { emit }) => {
395
- switch (event.type) {
396
- case "agent.feedback": {
397
- state.feedback.push(event.feedback);
398
- emit({
399
- type: "feedback",
400
- // @ts-ignore TODO: fix types in XState
401
- feedback: event.feedback
402
- });
403
- break;
404
- }
405
- case "agent.observe": {
406
- state.observations.push(event.observation);
407
- emit({
408
- type: "observation",
409
- // @ts-ignore TODO: fix types in XState
410
- observation: event.observation
411
- });
412
- break;
413
- }
414
- case "agent.message": {
415
- state.messages.push(event.message);
416
- emit({
417
- type: "message",
418
- // @ts-ignore TODO: fix types in XState
419
- message: event.message
420
- });
421
- break;
422
- }
423
- case "agent.plan": {
424
- state.plans.push(event.plan);
425
- emit({
426
- type: "plan",
427
- // @ts-ignore TODO: fix types in XState
428
- plan: event.plan
429
- });
430
- break;
431
- }
432
- default:
433
- break;
434
- }
435
- return state;
436
- },
437
- () => ({
438
- feedback: [],
439
- messages: [],
440
- observations: [],
441
- plans: []
442
- })
443
- );
444
- function createAgent({
445
- name,
446
- description,
447
- model,
448
- events,
449
- context,
450
- planner = simplePlanner,
451
- stringify = JSON.stringify,
452
- getMemory,
453
- logic = agentLogic,
454
- adapter = vercelAdapter,
455
- ...generateTextOptions
456
- }) {
457
- const agent = createActor(logic);
458
- agent.events = events;
459
- agent.model = model;
460
- agent.name = name;
461
- agent.description = description;
462
- agent.adapter = adapter;
463
- agent.defaultOptions = { ...generateTextOptions, model };
464
- agent.select = (selector) => {
465
- return selector(agent.getSnapshot().context);
466
- };
467
- agent.memory = getMemory ? getMemory(agent) : void 0;
468
- agent.onMessage = (callback) => {
469
- agent.on("message", (ev) => callback(ev.message));
470
- };
471
- agent.decide = (opts) => {
472
- return agentDecide(agent, opts);
473
- };
474
- agent.addMessage = (messageInput) => {
475
- const message = {
476
- ...messageInput,
477
- id: messageInput.id ?? randomId(),
478
- timestamp: messageInput.timestamp ?? Date.now(),
479
- sessionId: agent.sessionId,
480
- correlationId: messageInput.correlationId ?? randomId()
481
- };
482
- agent.send({
483
- type: "agent.message",
484
- message
485
- });
486
- return message;
487
- };
488
- agent.getMessages = () => agent.getSnapshot().context.messages;
489
- agent.generateText = (opts) => agentGenerateText(agent, opts);
490
- agent.streamText = (opts) => agentStreamText(agent, opts);
491
- agent.addFeedback = (feedbackInput) => {
492
- const feedback = {
493
- ...feedbackInput,
494
- attributes: { ...feedbackInput.attributes },
495
- reward: feedbackInput.reward ?? 0,
496
- timestamp: feedbackInput.timestamp ?? Date.now(),
497
- sessionId: agent.sessionId
498
- };
499
- agent.send({
500
- type: "agent.feedback",
501
- feedback
502
- });
503
- return feedback;
504
- };
505
- agent.getFeedback = () => agent.getSnapshot().context.feedback;
506
- agent.addObservation = (observationInput) => {
507
- const { prevState, event, state } = observationInput;
508
- const observation = {
509
- prevState,
510
- event,
511
- state,
512
- id: observationInput.id ?? randomId(),
513
- sessionId: agent.sessionId,
514
- timestamp: observationInput.timestamp ?? Date.now(),
515
- machineHash: observationInput.machine ? getMachineHash(observationInput.machine) : void 0
516
- };
517
- agent.send({
518
- type: "agent.observe",
519
- observation
520
- });
521
- return observation;
522
- };
523
- agent.getObservations = () => agent.getSnapshot().context.observations;
524
- agent.addPlan = (plan) => {
525
- agent.send({
526
- type: "agent.plan",
527
- plan
528
- });
529
- };
530
- agent.getPlans = () => agent.getSnapshot().context.plans;
531
- agent.interact = (actorRef, getInput) => {
532
- let prevState = void 0;
533
- let subscribed = true;
534
- async function handleObservation(observationInput) {
535
- const observation = agent.addObservation(observationInput);
536
- const input = getInput?.(observation);
537
- if (input) {
538
- await agentDecide(agent, {
539
- machine: actorRef.src,
540
- state: observation.state,
541
- execute: async (event) => {
542
- actorRef.send(event);
543
- },
544
- ...input
545
- });
546
- }
547
- prevState = observationInput.state;
548
- }
549
- actorRef.system.inspect({
550
- next: async (inspEvent) => {
551
- if (!subscribed || inspEvent.actorRef !== actorRef || inspEvent.type !== "@xstate.snapshot") {
552
- return;
553
- }
554
- const observationInput = {
555
- event: inspEvent.event,
556
- prevState,
557
- state: inspEvent.snapshot,
558
- machine: actorRef.src
559
- };
560
- await handleObservation(observationInput);
561
- }
562
- });
563
- if (actorRef._processingStatus === 1) {
564
- handleObservation({
565
- prevState: void 0,
566
- event: { type: "" },
567
- // TODO: unknown events?
568
- state: actorRef.getSnapshot(),
569
- machine: actorRef.src
570
- });
571
- }
572
- return {
573
- unsubscribe: () => {
574
- subscribed = false;
575
- }
576
- // TODO: make this actually unsubscribe
577
- };
578
- };
579
- agent.types = {};
580
- agent.start();
581
- return agent;
582
- }
583
- export {
584
- createAgent,
585
- fromDecision,
586
- fromText,
587
- fromTextStream
588
- };
1
+ import { a as runAgent, c as setupAgent, i as inspectTransitions, l as appendMessages, n as IllegalResumeEventError, o as runAgentToCompletion, r as SnapshotVersionMismatchError, s as createAgentSchemas, t as AgentIdleError, u as messagesSchema } from "./run-agent-BoAOq_0Z.mjs";
2
+ import { $ as validateSchemaSync, A as parseOutput, C as createTextLogic, E as isStructuredOutputSchema, G as getJsonSchemaSync, J as isStandardSchema, K as getMachineStructuralHash, Q as userMessage, T as getAgentOutputMode, U as getAgentMessages, V as assistantMessage, W as getJsonSchema, X as systemMessage, Y as persistSnapshot, Z as toolMessage, b as bindRequestExecutor, d as EVENT_TOOL_PREFIX, f as getAcceptedEvents, j as parseStructuredEnvelope, k as parseModelRef, l as renderDecisionAttempts, m as parseAgentEvent, n as PLAN_DONE_EVENT_TYPE, p as matchesEventPattern, q as getStateMeta, t as DecisionExhaustedError, u as resolveDecision, x as buildEnvelopeSchema } from "./decision-CQdrKc8k.mjs";
3
+ import { a as lintAgentMachine, c as getAgentRequests, d as resolveAgentStep, f as transitionAgentStep, i as explorePaths, l as initialAgentStep, n as assertAgentMachine, o as simulateAgent, r as canReach, s as executeAgentRequest, t as AgentLintError, u as resolveAgentRequests } from "./src-DUeIFjv-.mjs";
4
+ export { AgentIdleError, AgentLintError, DecisionExhaustedError, EVENT_TOOL_PREFIX, IllegalResumeEventError, PLAN_DONE_EVENT_TYPE, SnapshotVersionMismatchError, appendMessages, assertAgentMachine, assistantMessage, bindRequestExecutor, buildEnvelopeSchema, canReach, createAgentSchemas, createTextLogic, executeAgentRequest, explorePaths, getAcceptedEvents, getAgentMessages, getAgentOutputMode, getAgentRequests, getJsonSchema, getJsonSchemaSync, getMachineStructuralHash, getStateMeta, initialAgentStep, inspectTransitions, isStandardSchema, isStructuredOutputSchema, lintAgentMachine, matchesEventPattern, messagesSchema, parseAgentEvent, parseModelRef, parseOutput, parseStructuredEnvelope, persistSnapshot, renderDecisionAttempts, resolveAgentRequests, resolveAgentStep, resolveDecision, runAgent, runAgentToCompletion, setupAgent, simulateAgent, systemMessage, toolMessage, transitionAgentStep, userMessage, validateSchemaSync };