@cuylabs/agent-core 0.9.0 → 0.11.0

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 (116) hide show
  1. package/README.md +33 -17
  2. package/dist/chunk-2O4MCSQS.js +780 -0
  3. package/dist/chunk-2TTOLHBT.js +198 -0
  4. package/dist/chunk-5FMSGQVX.js +281 -0
  5. package/dist/chunk-5NVVNXPQ.js +288 -0
  6. package/dist/{chunk-EKR6PKXU.js → chunk-6HZBHFOL.js} +3 -3
  7. package/dist/chunk-CJI7PVS2.js +58 -0
  8. package/dist/{chunk-WKHDSSXG.js → chunk-CMYN2RCB.js} +146 -46
  9. package/dist/chunk-FII65CN7.js +117 -0
  10. package/dist/{chunk-UHCJEM2E.js → chunk-ICZ66572.js} +13 -6
  11. package/dist/chunk-KYLPMBHD.js +316 -0
  12. package/dist/chunk-MXAP4UG6.js +2956 -0
  13. package/dist/{chunk-4QFNWPIF.js → chunk-N3VX7FEE.js} +35 -2
  14. package/dist/{chunk-MAZ5DY5B.js → chunk-NDZWXCBZ.js} +213 -78
  15. package/dist/{chunk-MHKK374K.js → chunk-Q742PSH3.js} +11 -27
  16. package/dist/{chunk-WGZAPU6N.js → chunk-QAL3OMI3.js} +15 -1
  17. package/dist/{chunk-UDCZ673N.js → chunk-RN6WZEUF.js} +27 -23
  18. package/dist/{chunk-ZXAKHMWH.js → chunk-ROTGCYDW.js} +22 -84
  19. package/dist/chunk-SPBFQXOT.js +0 -0
  20. package/dist/chunk-SSFBF3US.js +602 -0
  21. package/dist/chunk-SZ2XBPTW.js +8 -0
  22. package/dist/chunk-T4UIX5D7.js +115 -0
  23. package/dist/{chunk-IYWQOJMQ.js → chunk-TIHPYVAJ.js} +34 -34
  24. package/dist/{chunk-RKEW5WXI.js → chunk-TOTDGK3P.js} +1 -1
  25. package/dist/chunk-V4RFNEET.js +563 -0
  26. package/dist/chunk-VOUEJSW6.js +0 -0
  27. package/dist/{chunk-J4QDGZIA.js → chunk-WBPOZ7CL.js} +659 -275
  28. package/dist/chunk-X4VN4GIJ.js +185 -0
  29. package/dist/dispatch/index.d.ts +93 -0
  30. package/dist/dispatch/index.js +37 -0
  31. package/dist/events/index.d.ts +93 -0
  32. package/dist/events/index.js +6 -0
  33. package/dist/{runtime → execution}/index.d.ts +120 -35
  34. package/dist/{runtime → execution}/index.js +17 -11
  35. package/dist/index.d.ts +489 -115
  36. package/dist/index.js +1665 -462
  37. package/dist/inference/errors/index.js +1 -1
  38. package/dist/inference/index.d.ts +13 -21
  39. package/dist/inference/index.js +15 -12
  40. package/dist/instance-DzPiv6EK.d.ts +5723 -0
  41. package/dist/logger/index.d.ts +50 -0
  42. package/dist/logger/index.js +11 -0
  43. package/dist/mcp/index.d.ts +5 -9
  44. package/dist/mcp/index.js +2 -3
  45. package/dist/middleware/index.d.ts +10 -150
  46. package/dist/middleware/index.js +10 -2
  47. package/dist/model-messages-CJfwfzGe.d.ts +13 -0
  48. package/dist/models/index.d.ts +5 -2
  49. package/dist/models/index.js +2 -1
  50. package/dist/models/reasoning/index.js +2 -1
  51. package/dist/plugin/index.d.ts +55 -11
  52. package/dist/plugin/index.js +1 -1
  53. package/dist/profiles/index.d.ts +55 -0
  54. package/dist/{presets → profiles}/index.js +10 -10
  55. package/dist/prompt/index.d.ts +8 -13
  56. package/dist/safety/index.d.ts +109 -14
  57. package/dist/safety/index.js +59 -3
  58. package/dist/sandbox/index.d.ts +81 -0
  59. package/dist/sandbox/index.js +1 -0
  60. package/dist/skill/index.d.ts +10 -8
  61. package/dist/skill/index.js +2 -2
  62. package/dist/storage/index.d.ts +12 -4
  63. package/dist/storage/index.js +1 -1
  64. package/dist/subagents/index.d.ts +177 -0
  65. package/dist/subagents/index.js +78 -0
  66. package/dist/team/index.d.ts +544 -0
  67. package/dist/team/index.js +41 -0
  68. package/dist/tool/host/index.d.ts +41 -0
  69. package/dist/tool/host/index.js +10 -0
  70. package/dist/tool/index.d.ts +111 -21
  71. package/dist/tool/index.js +20 -13
  72. package/dist/{types-VQgymC1N.d.ts → types-Bj_J8u_W.d.ts} +44 -64
  73. package/dist/{types-CHiPh8U2.d.ts → types-C_LCeYNg.d.ts} +7 -7
  74. package/dist/types-RSCv7nQ4.d.ts +59 -0
  75. package/package.json +46 -47
  76. package/dist/builder-BgZ_j4Vs.d.ts +0 -35
  77. package/dist/chunk-5ARZJWD2.js +0 -259
  78. package/dist/chunk-DXFBQMXP.js +0 -53
  79. package/dist/chunk-H3FUYU52.js +0 -81
  80. package/dist/chunk-JLXG2SH7.js +0 -905
  81. package/dist/chunk-N7P4PN3O.js +0 -84
  82. package/dist/chunk-OFDKHNCX.js +0 -727
  83. package/dist/chunk-SDSBEQXG.js +0 -157
  84. package/dist/chunk-VEKUXUVF.js +0 -41
  85. package/dist/chunk-VNQBHPCT.js +0 -398
  86. package/dist/chunk-WWYYNWEW.js +0 -259
  87. package/dist/context/index.d.ts +0 -259
  88. package/dist/context/index.js +0 -26
  89. package/dist/events-CE72w8W4.d.ts +0 -149
  90. package/dist/host/index.d.ts +0 -45
  91. package/dist/host/index.js +0 -8
  92. package/dist/index-DQuTZ8xL.d.ts +0 -1335
  93. package/dist/messages-BYWGn8TY.d.ts +0 -110
  94. package/dist/presets/index.d.ts +0 -53
  95. package/dist/registry-DwYqsQkX.d.ts +0 -164
  96. package/dist/runner-CI-XeR16.d.ts +0 -91
  97. package/dist/scope/index.d.ts +0 -10
  98. package/dist/scope/index.js +0 -14
  99. package/dist/session-manager-KbYt2WUh.d.ts +0 -282
  100. package/dist/signal/index.d.ts +0 -28
  101. package/dist/signal/index.js +0 -6
  102. package/dist/sub-agent/index.d.ts +0 -24
  103. package/dist/sub-agent/index.js +0 -32
  104. package/dist/tool-CZWN3KbO.d.ts +0 -141
  105. package/dist/tool-DkhSCV2Y.d.ts +0 -145
  106. package/dist/tracker-DClqYqTj.d.ts +0 -96
  107. package/dist/tracking/index.d.ts +0 -111
  108. package/dist/tracking/index.js +0 -20
  109. package/dist/types-BfNpU8NS.d.ts +0 -270
  110. package/dist/types-BlOKk-Bb.d.ts +0 -330
  111. package/dist/types-BlZwmnuW.d.ts +0 -50
  112. package/dist/types-CQL-SvTn.d.ts +0 -29
  113. package/dist/types-CWm-7rvB.d.ts +0 -55
  114. package/dist/types-DTSkxakL.d.ts +0 -651
  115. package/dist/types-DmDwi2zI.d.ts +0 -339
  116. package/dist/types-YuWV4ag7.d.ts +0 -72
@@ -1,19 +1,14 @@
1
- import { A as AgentEvent } from '../events-CE72w8W4.js';
2
- import { T as TokenUsage, M as Message } from '../messages-BYWGn8TY.js';
3
- import { S as ScopeSnapshot } from '../types-CQL-SvTn.js';
4
- import { S as StepProcessingOptions, z as StepProcessingOutput, l as AgentTurnStepCommitSnapshot, r as CreateAgentTurnStepCommitBatchOptions, d as AgentTurnCommitBatch, P as PrepareModelStepOptions, u as PreparedAgentModelStep, R as RunModelStepOptions, x as RunToolBatchOptions, y as RunToolBatchResult, C as CommitOutputOptions, p as CommitStepOptions, j as AgentTurnState, n as AgentTurnStepCommitToolResult, m as AgentTurnStepCommitToolCall } from '../types-DmDwi2zI.js';
5
- export { A as AgentTurnActiveToolCall, a as AgentTurnBoundaryMetadata, b as AgentTurnBoundarySnapshot, c as AgentTurnCommitApplier, e as AgentTurnCommitOptions, f as AgentTurnEngine, g as AgentTurnEngineOptions, h as AgentTurnPhase, i as AgentTurnResolvedToolCall, k as AgentTurnStateAdvanceOptions, o as AgentTurnStepRuntimeConfig, q as CreateAgentTurnStateOptions, v as ProcessorOptions, w as ProcessorOutput, B as advanceAgentTurnState, E as createAgentTurnEngine, F as createAgentTurnState, G as failAgentTurnState } from '../types-DmDwi2zI.js';
6
- import { A as AnyInferenceResult } from '../types-BlOKk-Bb.js';
7
- import { ModelMessage } from 'ai';
8
- import '../tool-CZWN3KbO.js';
1
+ import { e as AnyInferenceResult, cB as StepProcessingOptions, cC as StepProcessingOutput, a6 as AgentTurnStepCommitSnapshot, aF as CreateAgentTurnStepCommitBatchOptions, _ as AgentTurnCommitBatch, b$ as PrepareModelStepOptions, c0 as PreparedAgentModelStep, cb as RunModelStepOptions, A as AgentEvent, cc as RunToolBatchOptions, cd as RunToolBatchResult, av as CommitOutputOptions, aw as CommitStepOptions, dg as TokenUsage, v as ScopeSnapshot, a4 as AgentTurnState, dn as ToolMetadata, a8 as AgentTurnStepCommitToolResult, a7 as AgentTurnStepCommitToolCall, M as Message, dv as UserMessage, ar as AssistantMessage, dm as ToolMessage, cM as SystemMessage } from '../instance-DzPiv6EK.js';
2
+ export { Q as AgentTurnActiveToolCall, X as AgentTurnBoundaryMetadata, Y as AgentTurnBoundarySnapshot, Z as AgentTurnCommitApplier, $ as AgentTurnCommitOptions, a0 as AgentTurnEngine, a1 as AgentTurnEngineOptions, a2 as AgentTurnPhase, a3 as AgentTurnResolvedToolCall, a5 as AgentTurnStateAdvanceOptions, a9 as AgentTurnStepRuntimeConfig, aE as CreateAgentTurnStateOptions, dy as advanceAgentTurnState, dC as createAgentTurnEngine, dD as createAgentTurnState, dK as failAgentTurnState } from '../instance-DzPiv6EK.js';
3
+ import { L as Logger } from '../types-RSCv7nQ4.js';
4
+ export { c as convertAgentMessagesToModelMessages } from '../model-messages-CJfwfzGe.js';
5
+ import '../types-C_LCeYNg.js';
6
+ import 'ai';
9
7
  import 'zod';
10
- import '../tool-DkhSCV2Y.js';
11
- import '../types-CHiPh8U2.js';
12
- import '../runner-CI-XeR16.js';
13
- import '../types-DTSkxakL.js';
14
- import '@ai-sdk/provider-utils';
15
- import '../types-BfNpU8NS.js';
16
8
  import '../types-CQaXbRsS.js';
9
+ import '../types-Bj_J8u_W.js';
10
+ import '@ai-sdk/provider-utils';
11
+ import '../sandbox/index.js';
17
12
  import '../llm-error-D93FNNLY.js';
18
13
 
19
14
  /**
@@ -39,10 +34,6 @@ declare class ContextOverflowError extends Error {
39
34
  * Process an inference stream into runtime step events.
40
35
  */
41
36
  declare function processStepStream(stream: AnyInferenceResult, options: StepProcessingOptions): Promise<StepProcessingOutput>;
42
- /**
43
- * @deprecated Use `processStepStream`.
44
- */
45
- declare const processStream: typeof processStepStream;
46
37
 
47
38
  declare function createAgentTurnStepCommitBatch(step: number, snapshot: AgentTurnStepCommitSnapshot, options?: CreateAgentTurnStepCommitBatchOptions): AgentTurnCommitBatch | undefined;
48
39
 
@@ -58,6 +49,13 @@ declare function runModelStep(options: RunModelStepOptions): AsyncGenerator<Agen
58
49
 
59
50
  /**
60
51
  * Execute planned tool calls outside the AI SDK loop.
52
+ *
53
+ * When multiple tool calls are pending, the batch is partitioned:
54
+ * - Tools that declare `capabilities.parallelSafe` run concurrently
55
+ * - All other tools run serially (in original order)
56
+ *
57
+ * Serial tools always run after the parallel batch completes, preserving
58
+ * the invariant that non-parallel-safe tools never overlap with anything.
61
59
  */
62
60
  declare function runToolBatch(options: RunToolBatchOptions): Promise<RunToolBatchResult>;
63
61
 
@@ -81,6 +79,8 @@ interface AgentTaskPayload {
81
79
  interface AgentTaskExecutionContext {
82
80
  /** Abort signal propagated to agent.chat(). */
83
81
  signal?: AbortSignal;
82
+ /** Stable identifier for this task execution when supplied by the caller. */
83
+ executionId?: string;
84
84
  /** Optional trigger descriptor from caller (for logging/routing). */
85
85
  trigger?: string;
86
86
  /**
@@ -88,6 +88,45 @@ interface AgentTaskExecutionContext {
88
88
  * For scheduled jobs, a job ID is a good candidate.
89
89
  */
90
90
  fallbackSessionKey?: string;
91
+ /**
92
+ * Optional prior execution state to resume from. When provided, the task
93
+ * runner restores accumulated response, usage, tool results, and step
94
+ * counter from this snapshot before streaming the next agent.chat() turn.
95
+ *
96
+ * This enables runtime providers (e.g. Dapr) to implement crash recovery
97
+ * on the direct (non-workflow) execution path: load the last checkpoint
98
+ * from the execution store, then re-run with `restoreFrom` so the turn
99
+ * continues from where it left off rather than starting fresh.
100
+ *
101
+ * The snapshot only provides accumulated bookkeeping — the actual
102
+ * conversation context is recovered through the session storage layer
103
+ * (same sessionId → same persisted messages).
104
+ */
105
+ restoreFrom?: AgentTaskResumeSnapshot;
106
+ }
107
+ /**
108
+ * Portable snapshot of prior execution state used for resume.
109
+ *
110
+ * This is intentionally a minimal subset — just enough for the task runner
111
+ * to restore its accumulators. The full `AgentTaskExecutionSnapshot` (with
112
+ * turn state, events, scope) lives in the runtime provider's execution store.
113
+ */
114
+ interface AgentTaskResumeSnapshot {
115
+ /** Accumulated response text from prior execution. */
116
+ response: string;
117
+ /** Accumulated token usage from prior execution. */
118
+ usage: TokenUsage;
119
+ /** Tool calls completed in the prior execution. */
120
+ toolCalls: Array<{
121
+ name: string;
122
+ result: unknown;
123
+ }>;
124
+ /** Step counter to resume from. */
125
+ step: number;
126
+ /** Event counter to resume from. */
127
+ eventCount: number;
128
+ /** ISO timestamp of the original execution start. */
129
+ startedAt: string;
91
130
  }
92
131
  interface AgentTaskResult {
93
132
  response: string;
@@ -117,6 +156,7 @@ interface AgentTaskExecutionRun<TPayload extends AgentTaskPayload = AgentTaskPay
117
156
  payload: Readonly<TPayload>;
118
157
  context: Readonly<AgentTaskExecutionContext>;
119
158
  sessionId: string;
159
+ executionId: string;
120
160
  startedAt: string;
121
161
  scope?: ScopeSnapshot;
122
162
  }
@@ -158,7 +198,7 @@ interface AgentTaskObserver<TPayload extends AgentTaskPayload = AgentTaskPayload
158
198
  * it into activities so child spans (AI SDK, tool calls) are
159
199
  * correlated under the observer's root span.
160
200
  */
161
- getOtelContext?(sessionId: string): unknown;
201
+ getOtelContext?(sessionId: string, executionId?: string): unknown;
162
202
  /**
163
203
  * Activate the OTel context for a session around a function call.
164
204
  *
@@ -167,7 +207,7 @@ interface AgentTaskObserver<TPayload extends AgentTaskPayload = AgentTaskPayload
167
207
  * execution mode. The observer wraps `fn` in `context.with()` so
168
208
  * that `context.active()` returns the session's trace context.
169
209
  */
170
- activateContext?<T>(sessionId: string, fn: () => T): T;
210
+ activateContext?<T>(sessionId: string, executionId: string, fn: () => T): T;
171
211
  }
172
212
  interface AgentTaskCheckpointStrategyInput<TPayload extends AgentTaskPayload = AgentTaskPayload> {
173
213
  run: AgentTaskExecutionRun<TPayload>;
@@ -206,6 +246,8 @@ interface AgentTaskRunnerOptions<TPayload extends AgentTaskPayload = AgentTaskPa
206
246
  * `defaultAgentTaskCheckpointStrategy(...)`.
207
247
  */
208
248
  checkpointStrategy?: AgentTaskCheckpointStrategy<TPayload>;
249
+ /** Logger for diagnostic output. Defaults to silent. */
250
+ logger?: Logger;
209
251
  }
210
252
  /**
211
253
  * Create a reusable task runner that maps generic task payloads to `agent.chat()`.
@@ -256,6 +298,7 @@ interface AgentWorkflowToolMessageSnapshot {
256
298
  toolCallId: string;
257
299
  toolName: string;
258
300
  result: unknown;
301
+ metadata?: ToolMetadata;
259
302
  compactedAt?: number;
260
303
  }
261
304
  interface AgentWorkflowSystemMessageSnapshot {
@@ -265,7 +308,7 @@ interface AgentWorkflowSystemMessageSnapshot {
265
308
  content: string;
266
309
  }
267
310
  type AgentWorkflowMessageSnapshot = AgentWorkflowUserMessageSnapshot | AgentWorkflowAssistantMessageSnapshot | AgentWorkflowToolMessageSnapshot | AgentWorkflowSystemMessageSnapshot;
268
- type AgentWorkflowTurnPhase = "model-step" | "tool-batch" | "step-commit" | "output-commit" | "completed" | "failed";
311
+ type AgentWorkflowTurnPhase = "input-commit" | "model-step" | "tool-batch" | "step-commit" | "output-commit" | "completed" | "failed";
269
312
  interface AgentWorkflowReplayDecision {
270
313
  toolCallId: string;
271
314
  toolName: string;
@@ -292,11 +335,17 @@ interface AgentWorkflowToolCallResult {
292
335
  toolResult: AgentTurnStepCommitToolResult;
293
336
  turnState?: AgentTurnState;
294
337
  }
338
+ interface AgentWorkflowInterventionSnapshot {
339
+ id: string;
340
+ message: string;
341
+ createdAt: string;
342
+ }
295
343
  interface AgentWorkflowTurnState {
296
344
  sessionId: string;
297
345
  systemPrompts: string[];
298
346
  messages: AgentWorkflowMessageSnapshot[];
299
347
  phase: AgentWorkflowTurnPhase;
348
+ pendingInput?: AgentWorkflowUserMessageSnapshot;
300
349
  step: number;
301
350
  maxSteps: number;
302
351
  usage?: TokenUsage;
@@ -307,6 +356,19 @@ interface AgentWorkflowTurnState {
307
356
  error?: string;
308
357
  startedAt: string;
309
358
  updatedAt: string;
359
+ /**
360
+ * Pending steering messages injected by an external client.
361
+ * In direct execution, the `InterventionController` handles this.
362
+ * In durable execution, pending messages are drained at each
363
+ * model-step boundary and injected as user messages.
364
+ */
365
+ pendingInterventions?: AgentWorkflowInterventionSnapshot[];
366
+ /**
367
+ * Deferred follow-up messages queued by an external client.
368
+ * These are held until the current turn completes and can then be
369
+ * surfaced by the host as candidate next-turn messages.
370
+ */
371
+ queuedFollowUps?: AgentWorkflowInterventionSnapshot[];
310
372
  }
311
373
  interface CreateAgentWorkflowTurnStateOptions {
312
374
  sessionId: string;
@@ -314,15 +376,30 @@ interface CreateAgentWorkflowTurnStateOptions {
314
376
  maxSteps: number;
315
377
  systemPrompts?: string[];
316
378
  initialMessages?: AgentWorkflowMessageSnapshot[];
379
+ initialInput?: AgentWorkflowUserMessageSnapshot;
317
380
  initialStep?: number;
318
381
  }
319
- declare function snapshotAgentWorkflowMessage(message: Message): AgentWorkflowMessageSnapshot;
320
- declare function snapshotAgentWorkflowMessages(messages: Message[]): AgentWorkflowMessageSnapshot[];
321
- declare function restoreAgentWorkflowMessage(snapshot: AgentWorkflowMessageSnapshot): Message;
322
- declare function restoreAgentWorkflowMessages(snapshots: AgentWorkflowMessageSnapshot[]): Message[];
323
382
  declare function createAgentWorkflowTurnState(options: CreateAgentWorkflowTurnStateOptions): AgentWorkflowTurnState;
324
383
  declare function cloneAgentWorkflowTurnState(state: AgentWorkflowTurnState): AgentWorkflowTurnState;
384
+ declare function applyWorkflowInterventions(state: AgentWorkflowTurnState, interventions: readonly AgentWorkflowInterventionSnapshot[], updatedAt: string): AgentWorkflowTurnState;
385
+ /**
386
+ * Drain pending intervention messages from the workflow state,
387
+ * injecting each as a user message into `state.messages`.
388
+ *
389
+ * Returns the updated state with `pendingInterventions` cleared.
390
+ * If there are no pending interventions, returns the state unchanged.
391
+ *
392
+ * This is the durable-execution equivalent of
393
+ * `InterventionController.drainImmediate()` in the direct path.
394
+ */
395
+ declare function drainWorkflowInterventions(state: AgentWorkflowTurnState, updatedAt: string): AgentWorkflowTurnState;
396
+ declare function queueWorkflowFollowUps(state: AgentWorkflowTurnState, followUps: readonly AgentWorkflowInterventionSnapshot[], updatedAt: string): AgentWorkflowTurnState;
325
397
 
398
+ interface AgentWorkflowInputCommitPlan {
399
+ kind: "input-commit";
400
+ sessionId: string;
401
+ messages: AgentWorkflowMessageSnapshot[];
402
+ }
326
403
  interface AgentWorkflowModelStepPlan {
327
404
  kind: "model-step";
328
405
  sessionId: string;
@@ -345,13 +422,21 @@ interface AgentWorkflowToolCallPlan {
345
422
  turnState: AgentWorkflowTurnState["turnState"];
346
423
  replayDecision?: AgentWorkflowReplayDecision;
347
424
  }
425
+ interface AgentWorkflowToolBatchPlan {
426
+ kind: "tool-batch";
427
+ step: number;
428
+ sessionId: string;
429
+ toolCalls: AgentTurnStepCommitToolCall[];
430
+ turnState: AgentWorkflowTurnState["turnState"];
431
+ replayDecisions: Record<string, AgentWorkflowReplayDecision>;
432
+ }
348
433
  interface AgentWorkflowOutputCommitPlan {
349
434
  kind: "output-commit";
350
435
  sessionId: string;
351
436
  text: string;
352
437
  usage?: TokenUsage;
353
438
  }
354
- type AgentWorkflowOperationPlan = AgentWorkflowModelStepPlan | AgentWorkflowToolCallPlan | AgentWorkflowStepCommitPlan | AgentWorkflowOutputCommitPlan;
439
+ type AgentWorkflowOperationPlan = AgentWorkflowInputCommitPlan | AgentWorkflowModelStepPlan | AgentWorkflowToolCallPlan | AgentWorkflowToolBatchPlan | AgentWorkflowStepCommitPlan | AgentWorkflowOutputCommitPlan;
355
440
 
356
441
  /**
357
442
  * Decide which deterministic workflow operation should run next.
@@ -383,13 +468,13 @@ declare function recordAgentWorkflowReplayDecision(state: AgentWorkflowTurnState
383
468
  */
384
469
  declare function failAgentWorkflowTurnState(state: AgentWorkflowTurnState, error: Error, updatedAt: string): AgentWorkflowTurnState;
385
470
 
386
- /**
387
- * Convert framework messages into Vercel AI SDK model messages.
388
- *
389
- * This keeps the message translation logic reusable for workflow activities
390
- * and other runtime integrations without forcing those integrations to reach
391
- * into `Agent` internals.
392
- */
393
- declare function convertAgentMessagesToModelMessages(messages: Message[]): ModelMessage[];
471
+ declare function snapshotAgentWorkflowMessage(message: UserMessage): AgentWorkflowUserMessageSnapshot;
472
+ declare function snapshotAgentWorkflowMessage(message: AssistantMessage): AgentWorkflowAssistantMessageSnapshot;
473
+ declare function snapshotAgentWorkflowMessage(message: ToolMessage): AgentWorkflowToolMessageSnapshot;
474
+ declare function snapshotAgentWorkflowMessage(message: SystemMessage): AgentWorkflowSystemMessageSnapshot;
475
+ declare function snapshotAgentWorkflowMessage(message: Message): AgentWorkflowMessageSnapshot;
476
+ declare function snapshotAgentWorkflowMessages(messages: Message[]): AgentWorkflowMessageSnapshot[];
477
+ declare function restoreAgentWorkflowMessage(snapshot: AgentWorkflowMessageSnapshot): Message;
478
+ declare function restoreAgentWorkflowMessages(snapshots: AgentWorkflowMessageSnapshot[]): Message[];
394
479
 
395
- export { type AgentTaskChatAdapter, type AgentTaskCheckpointReason, type AgentTaskCheckpointStrategy, type AgentTaskCheckpointStrategyInput, type AgentTaskExecutionCheckpoint, type AgentTaskExecutionContext, type AgentTaskExecutionRun, type AgentTaskExecutionSnapshot, type AgentTaskObserver, type AgentTaskPayload, type AgentTaskResult, type AgentTaskRunner, type AgentTaskRunnerOptions, AgentTurnCommitBatch, AgentTurnState, AgentTurnStepCommitSnapshot, AgentTurnStepCommitToolCall, AgentTurnStepCommitToolResult, type AgentWorkflowAssistantMessageSnapshot, type AgentWorkflowCommitResult, type AgentWorkflowMessageSnapshot, type AgentWorkflowModelStepPlan, type AgentWorkflowModelStepResult, type AgentWorkflowOperationPlan, type AgentWorkflowOutputCommitPlan, type AgentWorkflowReplayDecision, type AgentWorkflowStepCommitPlan, type AgentWorkflowSystemMessageSnapshot, type AgentWorkflowToolBatchResult, type AgentWorkflowToolCallPlan, type AgentWorkflowToolCallResult, type AgentWorkflowToolCallSnapshot, type AgentWorkflowToolMessageSnapshot, type AgentWorkflowTurnPhase, type AgentWorkflowTurnState, type AgentWorkflowUserMessageSnapshot, CommitOutputOptions, CommitStepOptions, ContextOverflowError, CreateAgentTurnStepCommitBatchOptions, type CreateAgentWorkflowTurnStateOptions, DoomLoopError, PrepareModelStepOptions, PreparedAgentModelStep, RunModelStepOptions, RunToolBatchOptions, RunToolBatchResult, StepProcessingOptions, StepProcessingOutput, applyAgentWorkflowCommitResult, applyAgentWorkflowModelStepResult, applyAgentWorkflowToolBatchResult, applyAgentWorkflowToolCallResult, cloneAgentWorkflowTurnState, commitOutput, commitStep, convertAgentMessagesToModelMessages, createAgentTaskRunner, createAgentTurnStepCommitBatch, createAgentWorkflowTurnState, defaultAgentTaskCheckpointStrategy, failAgentWorkflowTurnState, planNextAgentWorkflowOperation, prepareModelStep, processStepStream, processStream, recordAgentWorkflowReplayDecision, restoreAgentWorkflowMessage, restoreAgentWorkflowMessages, runModelStep, runToolBatch, snapshotAgentWorkflowMessage, snapshotAgentWorkflowMessages };
480
+ export { type AgentTaskChatAdapter, type AgentTaskCheckpointReason, type AgentTaskCheckpointStrategy, type AgentTaskCheckpointStrategyInput, type AgentTaskExecutionCheckpoint, type AgentTaskExecutionContext, type AgentTaskExecutionRun, type AgentTaskExecutionSnapshot, type AgentTaskObserver, type AgentTaskPayload, type AgentTaskResult, type AgentTaskResumeSnapshot, type AgentTaskRunner, type AgentTaskRunnerOptions, AgentTurnCommitBatch, AgentTurnState, AgentTurnStepCommitSnapshot, AgentTurnStepCommitToolCall, AgentTurnStepCommitToolResult, type AgentWorkflowAssistantMessageSnapshot, type AgentWorkflowCommitResult, type AgentWorkflowInputCommitPlan, type AgentWorkflowInterventionSnapshot, type AgentWorkflowMessageSnapshot, type AgentWorkflowModelStepPlan, type AgentWorkflowModelStepResult, type AgentWorkflowOperationPlan, type AgentWorkflowOutputCommitPlan, type AgentWorkflowReplayDecision, type AgentWorkflowStepCommitPlan, type AgentWorkflowSystemMessageSnapshot, type AgentWorkflowToolBatchPlan, type AgentWorkflowToolBatchResult, type AgentWorkflowToolCallPlan, type AgentWorkflowToolCallResult, type AgentWorkflowToolCallSnapshot, type AgentWorkflowToolMessageSnapshot, type AgentWorkflowTurnPhase, type AgentWorkflowTurnState, type AgentWorkflowUserMessageSnapshot, CommitOutputOptions, CommitStepOptions, ContextOverflowError, CreateAgentTurnStepCommitBatchOptions, type CreateAgentWorkflowTurnStateOptions, DoomLoopError, PrepareModelStepOptions, PreparedAgentModelStep, RunModelStepOptions, RunToolBatchOptions, RunToolBatchResult, StepProcessingOptions, StepProcessingOutput, applyAgentWorkflowCommitResult, applyAgentWorkflowModelStepResult, applyAgentWorkflowToolBatchResult, applyAgentWorkflowToolCallResult, applyWorkflowInterventions, cloneAgentWorkflowTurnState, commitOutput, commitStep, createAgentTaskRunner, createAgentTurnStepCommitBatch, createAgentWorkflowTurnState, defaultAgentTaskCheckpointStrategy, drainWorkflowInterventions, failAgentWorkflowTurnState, planNextAgentWorkflowOperation, prepareModelStep, processStepStream, queueWorkflowFollowUps, recordAgentWorkflowReplayDecision, restoreAgentWorkflowMessage, restoreAgentWorkflowMessages, runModelStep, runToolBatch, snapshotAgentWorkflowMessage, snapshotAgentWorkflowMessages };
@@ -7,22 +7,23 @@ import {
7
7
  applyAgentWorkflowModelStepResult,
8
8
  applyAgentWorkflowToolBatchResult,
9
9
  applyAgentWorkflowToolCallResult,
10
+ applyWorkflowInterventions,
10
11
  cloneAgentWorkflowTurnState,
11
12
  commitOutput,
12
13
  commitStep,
13
- convertAgentMessagesToModelMessages,
14
14
  createAgentTaskRunner,
15
15
  createAgentTurnEngine,
16
16
  createAgentTurnState,
17
17
  createAgentTurnStepCommitBatch,
18
18
  createAgentWorkflowTurnState,
19
19
  defaultAgentTaskCheckpointStrategy,
20
+ drainWorkflowInterventions,
20
21
  failAgentTurnState,
21
22
  failAgentWorkflowTurnState,
22
23
  planNextAgentWorkflowOperation,
23
24
  prepareModelStep,
24
25
  processStepStream,
25
- processStream,
26
+ queueWorkflowFollowUps,
26
27
  recordAgentWorkflowReplayDecision,
27
28
  restoreAgentWorkflowMessage,
28
29
  restoreAgentWorkflowMessages,
@@ -30,15 +31,18 @@ import {
30
31
  runToolBatch,
31
32
  snapshotAgentWorkflowMessage,
32
33
  snapshotAgentWorkflowMessages
33
- } from "../chunk-J4QDGZIA.js";
34
- import "../chunk-WWYYNWEW.js";
35
- import "../chunk-WKHDSSXG.js";
36
- import "../chunk-H3FUYU52.js";
37
- import "../chunk-VEKUXUVF.js";
38
- import "../chunk-4QFNWPIF.js";
39
- import "../chunk-N7P4PN3O.js";
40
- import "../chunk-UDCZ673N.js";
34
+ } from "../chunk-WBPOZ7CL.js";
35
+ import {
36
+ convertAgentMessagesToModelMessages
37
+ } from "../chunk-CMYN2RCB.js";
38
+ import "../chunk-5NVVNXPQ.js";
39
+ import "../chunk-N3VX7FEE.js";
40
+ import "../chunk-RN6WZEUF.js";
41
+ import "../chunk-CJI7PVS2.js";
41
42
  import "../chunk-I6PKJ7XQ.js";
43
+ import "../chunk-V4RFNEET.js";
44
+ import "../chunk-FII65CN7.js";
45
+ import "../chunk-T4UIX5D7.js";
42
46
  export {
43
47
  AgentTurnEngine,
44
48
  ContextOverflowError,
@@ -48,6 +52,7 @@ export {
48
52
  applyAgentWorkflowModelStepResult,
49
53
  applyAgentWorkflowToolBatchResult,
50
54
  applyAgentWorkflowToolCallResult,
55
+ applyWorkflowInterventions,
51
56
  cloneAgentWorkflowTurnState,
52
57
  commitOutput,
53
58
  commitStep,
@@ -58,12 +63,13 @@ export {
58
63
  createAgentTurnStepCommitBatch,
59
64
  createAgentWorkflowTurnState,
60
65
  defaultAgentTaskCheckpointStrategy,
66
+ drainWorkflowInterventions,
61
67
  failAgentTurnState,
62
68
  failAgentWorkflowTurnState,
63
69
  planNextAgentWorkflowOperation,
64
70
  prepareModelStep,
65
71
  processStepStream,
66
- processStream,
72
+ queueWorkflowFollowUps,
67
73
  recordAgentWorkflowReplayDecision,
68
74
  restoreAgentWorkflowMessage,
69
75
  restoreAgentWorkflowMessages,