ai 6.0.95 → 6.0.97

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.
@@ -104,19 +104,424 @@ To see `ToolLoopAgent` in action, check out [these examples](#examples).
104
104
  description:
105
105
  'Optional callback to attempt automatic recovery when a tool call cannot be parsed.',
106
106
  },
107
+ {
108
+ name: 'experimental_onStart',
109
+ type: 'ToolLoopAgentOnStartCallback',
110
+ isOptional: true,
111
+ description:
112
+ 'Callback that is called when the agent operation begins, before any LLM calls are made. Useful for logging, analytics, or initializing state. If also specified in `generate()` or `stream()`, both callbacks are called (constructor first). Experimental (can break in patch releases).',
113
+ properties: [
114
+ {
115
+ type: 'OnStartEvent',
116
+ parameters: [
117
+ {
118
+ name: 'model',
119
+ type: '{ provider: string; modelId: string }',
120
+ description: 'The model being used for the generation.',
121
+ },
122
+ {
123
+ name: 'system',
124
+ type: 'string | SystemModelMessage | Array<SystemModelMessage> | undefined',
125
+ description: 'The system message(s) provided to the model.',
126
+ },
127
+ {
128
+ name: 'prompt',
129
+ type: 'string | Array<ModelMessage> | undefined',
130
+ description:
131
+ 'The prompt string or array of messages if using the prompt option.',
132
+ },
133
+ {
134
+ name: 'messages',
135
+ type: 'Array<ModelMessage> | undefined',
136
+ description: 'The messages array if using the messages option.',
137
+ },
138
+ {
139
+ name: 'tools',
140
+ type: 'TOOLS | undefined',
141
+ description: 'The tools available for this generation.',
142
+ },
143
+ {
144
+ name: 'toolChoice',
145
+ type: 'ToolChoice<TOOLS> | undefined',
146
+ description: 'The tool choice strategy for this generation.',
147
+ },
148
+ {
149
+ name: 'activeTools',
150
+ type: 'Array<keyof TOOLS> | undefined',
151
+ description:
152
+ 'Limits which tools are available for the model to call.',
153
+ },
154
+ {
155
+ name: 'maxOutputTokens',
156
+ type: 'number | undefined',
157
+ description: 'Maximum number of tokens to generate.',
158
+ },
159
+ {
160
+ name: 'temperature',
161
+ type: 'number | undefined',
162
+ description: 'Sampling temperature for generation.',
163
+ },
164
+ {
165
+ name: 'topP',
166
+ type: 'number | undefined',
167
+ description: 'Top-p (nucleus) sampling parameter.',
168
+ },
169
+ {
170
+ name: 'topK',
171
+ type: 'number | undefined',
172
+ description: 'Top-k sampling parameter.',
173
+ },
174
+ {
175
+ name: 'presencePenalty',
176
+ type: 'number | undefined',
177
+ description: 'Presence penalty for generation.',
178
+ },
179
+ {
180
+ name: 'frequencyPenalty',
181
+ type: 'number | undefined',
182
+ description: 'Frequency penalty for generation.',
183
+ },
184
+ {
185
+ name: 'stopSequences',
186
+ type: 'string[] | undefined',
187
+ description: 'Sequences that will stop generation.',
188
+ },
189
+ {
190
+ name: 'seed',
191
+ type: 'number | undefined',
192
+ description: 'Random seed for reproducible generation.',
193
+ },
194
+ {
195
+ name: 'maxRetries',
196
+ type: 'number',
197
+ description: 'Maximum number of retries for failed requests.',
198
+ },
199
+ {
200
+ name: 'timeout',
201
+ type: 'number | { totalMs?: number; stepMs?: number; chunkMs?: number } | undefined',
202
+ description: 'Timeout configuration for the generation.',
203
+ },
204
+ {
205
+ name: 'headers',
206
+ type: 'Record<string, string | undefined> | undefined',
207
+ description: 'Additional HTTP headers sent with the request.',
208
+ },
209
+ {
210
+ name: 'providerOptions',
211
+ type: 'ProviderOptions | undefined',
212
+ description: 'Additional provider-specific options.',
213
+ },
214
+ {
215
+ name: 'stopWhen',
216
+ type: 'StopCondition<TOOLS> | Array<StopCondition<TOOLS>> | undefined',
217
+ description: 'Condition(s) for stopping the generation.',
218
+ },
219
+ {
220
+ name: 'output',
221
+ type: 'OUTPUT | undefined',
222
+ description:
223
+ 'The output specification for structured outputs, if configured.',
224
+ },
225
+ {
226
+ name: 'abortSignal',
227
+ type: 'AbortSignal | undefined',
228
+ description: 'Abort signal for cancelling the operation.',
229
+ },
230
+ {
231
+ name: 'include',
232
+ type: '{ requestBody?: boolean; responseBody?: boolean } | undefined',
233
+ description:
234
+ 'Settings for controlling what data is included in step results.',
235
+ },
236
+ {
237
+ name: 'functionId',
238
+ type: 'string | undefined',
239
+ description:
240
+ 'Identifier from telemetry settings for grouping related operations.',
241
+ },
242
+ {
243
+ name: 'metadata',
244
+ type: 'Record<string, unknown> | undefined',
245
+ description: 'Additional metadata passed to the generation.',
246
+ },
247
+ {
248
+ name: 'experimental_context',
249
+ type: 'unknown',
250
+ description:
251
+ 'User-defined context object that flows through the entire generation lifecycle.',
252
+ },
253
+ ],
254
+ },
255
+ ],
256
+ },
257
+ {
258
+ name: 'experimental_onStepStart',
259
+ type: 'ToolLoopAgentOnStepStartCallback',
260
+ isOptional: true,
261
+ description:
262
+ 'Callback that is called when a step (LLM call) begins, before the provider is called. Each step represents a single LLM invocation. If also specified in `generate()` or `stream()`, both callbacks are called (constructor first). Experimental (can break in patch releases).',
263
+ properties: [
264
+ {
265
+ type: 'OnStepStartEvent',
266
+ parameters: [
267
+ {
268
+ name: 'stepNumber',
269
+ type: 'number',
270
+ description: 'Zero-based index of the current step.',
271
+ },
272
+ {
273
+ name: 'model',
274
+ type: '{ provider: string; modelId: string }',
275
+ description: 'The model being used for this step.',
276
+ },
277
+ {
278
+ name: 'system',
279
+ type: 'string | SystemModelMessage | Array<SystemModelMessage> | undefined',
280
+ description: 'The system message for this step.',
281
+ },
282
+ {
283
+ name: 'messages',
284
+ type: 'Array<ModelMessage>',
285
+ description:
286
+ 'The messages that will be sent to the model for this step.',
287
+ },
288
+ {
289
+ name: 'tools',
290
+ type: 'TOOLS | undefined',
291
+ description: 'The tools available for this generation.',
292
+ },
293
+ {
294
+ name: 'toolChoice',
295
+ type: 'LanguageModelV3ToolChoice | undefined',
296
+ description: 'The tool choice configuration for this step.',
297
+ },
298
+ {
299
+ name: 'activeTools',
300
+ type: 'Array<keyof TOOLS> | undefined',
301
+ description: 'Limits which tools are available for this step.',
302
+ },
303
+ {
304
+ name: 'steps',
305
+ type: 'ReadonlyArray<StepResult<TOOLS>>',
306
+ description:
307
+ 'Array of results from previous steps (empty for first step).',
308
+ },
309
+ {
310
+ name: 'providerOptions',
311
+ type: 'ProviderOptions | undefined',
312
+ description:
313
+ 'Additional provider-specific options for this step.',
314
+ },
315
+ {
316
+ name: 'timeout',
317
+ type: 'number | { totalMs?: number; stepMs?: number; chunkMs?: number } | undefined',
318
+ description: 'Timeout configuration for the generation.',
319
+ },
320
+ {
321
+ name: 'headers',
322
+ type: 'Record<string, string | undefined> | undefined',
323
+ description: 'Additional HTTP headers sent with the request.',
324
+ },
325
+ {
326
+ name: 'stopWhen',
327
+ type: 'StopCondition<TOOLS> | Array<StopCondition<TOOLS>> | undefined',
328
+ description: 'Condition(s) for stopping the generation.',
329
+ },
330
+ {
331
+ name: 'output',
332
+ type: 'OUTPUT | undefined',
333
+ description:
334
+ 'The output specification for structured outputs, if configured.',
335
+ },
336
+ {
337
+ name: 'abortSignal',
338
+ type: 'AbortSignal | undefined',
339
+ description: 'Abort signal for cancelling the operation.',
340
+ },
341
+ {
342
+ name: 'include',
343
+ type: '{ requestBody?: boolean; responseBody?: boolean } | undefined',
344
+ description:
345
+ 'Settings for controlling what data is included in step results.',
346
+ },
347
+ {
348
+ name: 'functionId',
349
+ type: 'string | undefined',
350
+ description:
351
+ 'Identifier from telemetry settings for grouping related operations.',
352
+ },
353
+ {
354
+ name: 'metadata',
355
+ type: 'Record<string, unknown> | undefined',
356
+ description: 'Additional metadata from telemetry settings.',
357
+ },
358
+ {
359
+ name: 'experimental_context',
360
+ type: 'unknown',
361
+ description:
362
+ 'User-defined context object. May be updated from prepareStep between steps.',
363
+ },
364
+ ],
365
+ },
366
+ ],
367
+ },
368
+ {
369
+ name: 'experimental_onToolCallStart',
370
+ type: 'ToolLoopAgentOnToolCallStartCallback',
371
+ isOptional: true,
372
+ description:
373
+ "Callback that is called right before a tool's execute function runs. If also specified in `generate()` or `stream()`, both callbacks are called (constructor first). Experimental (can break in patch releases).",
374
+ properties: [
375
+ {
376
+ type: 'OnToolCallStartEvent',
377
+ parameters: [
378
+ {
379
+ name: 'stepNumber',
380
+ type: 'number | undefined',
381
+ description:
382
+ 'The zero-based index of the current step where this tool call occurs. May be undefined in streaming contexts.',
383
+ },
384
+ {
385
+ name: 'model',
386
+ type: '{ provider: string; modelId: string } | undefined',
387
+ description:
388
+ 'Information about the model being used. May be undefined in streaming contexts.',
389
+ },
390
+ {
391
+ name: 'toolCall',
392
+ type: 'TypedToolCall<TOOLS>',
393
+ description:
394
+ 'The full tool call object containing toolName, toolCallId, input, and metadata.',
395
+ },
396
+ {
397
+ name: 'messages',
398
+ type: 'Array<ModelMessage>',
399
+ description:
400
+ 'The conversation messages available at tool execution time.',
401
+ },
402
+ {
403
+ name: 'abortSignal',
404
+ type: 'AbortSignal | undefined',
405
+ description: 'Signal for cancelling the operation.',
406
+ },
407
+ {
408
+ name: 'functionId',
409
+ type: 'string | undefined',
410
+ description:
411
+ 'Identifier from telemetry settings for grouping related operations.',
412
+ },
413
+ {
414
+ name: 'metadata',
415
+ type: 'Record<string, unknown> | undefined',
416
+ description: 'Additional metadata from telemetry settings.',
417
+ },
418
+ {
419
+ name: 'experimental_context',
420
+ type: 'unknown',
421
+ description:
422
+ 'User-defined context object flowing through the generation.',
423
+ },
424
+ ],
425
+ },
426
+ ],
427
+ },
428
+ {
429
+ name: 'experimental_onToolCallFinish',
430
+ type: 'ToolLoopAgentOnToolCallFinishCallback',
431
+ isOptional: true,
432
+ description:
433
+ "Callback that is called right after a tool's execute function completes (or errors). Uses a discriminated union on the `success` field: when `success: true`, `output` contains the tool result; when `success: false`, `error` contains the error. If also specified in `generate()` or `stream()`, both callbacks are called (constructor first). Experimental (can break in patch releases).",
434
+ properties: [
435
+ {
436
+ type: 'OnToolCallFinishEvent',
437
+ parameters: [
438
+ {
439
+ name: 'stepNumber',
440
+ type: 'number | undefined',
441
+ description:
442
+ 'The zero-based index of the current step where this tool call occurred. May be undefined in streaming contexts.',
443
+ },
444
+ {
445
+ name: 'model',
446
+ type: '{ provider: string; modelId: string } | undefined',
447
+ description:
448
+ 'Information about the model being used. May be undefined in streaming contexts.',
449
+ },
450
+ {
451
+ name: 'toolCall',
452
+ type: 'TypedToolCall<TOOLS>',
453
+ description:
454
+ 'The full tool call object containing toolName, toolCallId, input, and metadata.',
455
+ },
456
+ {
457
+ name: 'messages',
458
+ type: 'Array<ModelMessage>',
459
+ description:
460
+ 'The conversation messages available at tool execution time.',
461
+ },
462
+ {
463
+ name: 'abortSignal',
464
+ type: 'AbortSignal | undefined',
465
+ description: 'Signal for cancelling the operation.',
466
+ },
467
+ {
468
+ name: 'durationMs',
469
+ type: 'number',
470
+ description:
471
+ 'The wall-clock duration of the tool execution in milliseconds.',
472
+ },
473
+ {
474
+ name: 'functionId',
475
+ type: 'string | undefined',
476
+ description:
477
+ 'Identifier from telemetry settings for grouping related operations.',
478
+ },
479
+ {
480
+ name: 'metadata',
481
+ type: 'Record<string, unknown> | undefined',
482
+ description: 'Additional metadata from telemetry settings.',
483
+ },
484
+ {
485
+ name: 'experimental_context',
486
+ type: 'unknown',
487
+ description:
488
+ 'User-defined context object flowing through the generation.',
489
+ },
490
+ {
491
+ name: 'success',
492
+ type: 'boolean',
493
+ description:
494
+ 'Discriminator indicating whether the tool call succeeded. When true, output is available. When false, error is available.',
495
+ },
496
+ {
497
+ name: 'output',
498
+ type: 'unknown',
499
+ description:
500
+ "The tool's return value (only present when `success: true`).",
501
+ },
502
+ {
503
+ name: 'error',
504
+ type: 'unknown',
505
+ description:
506
+ 'The error that occurred during tool execution (only present when `success: false`).',
507
+ },
508
+ ],
509
+ },
510
+ ],
511
+ },
107
512
  {
108
513
  name: 'onStepFinish',
109
- type: 'GenerateTextOnStepFinishCallback',
514
+ type: 'ToolLoopAgentOnStepFinishCallback',
110
515
  isOptional: true,
111
516
  description:
112
- 'Callback invoked after each agent step (LLM/tool call) completes.',
517
+ 'Callback invoked after each agent step (LLM/tool call) completes. If also specified in `generate()` or `stream()`, both callbacks are called (constructor first).',
113
518
  },
114
519
  {
115
520
  name: 'onFinish',
116
521
  type: 'ToolLoopAgentOnFinishCallback',
117
522
  isOptional: true,
118
523
  description:
119
- 'Callback that is called when all agent steps are finished and the response is complete. Receives { steps, result, experimental_context }.',
524
+ 'Callback that is called when all agent steps are finished and the response is complete. Receives step results, total usage, experimental_context, functionId, and metadata. If also specified in `generate()` or `stream()`, both callbacks are called (constructor first).',
120
525
  },
121
526
  {
122
527
  name: 'experimental_context',
@@ -276,6 +681,34 @@ const result = await agent.generate({
276
681
  description:
277
682
  'Custom call options when the agent is configured with a callOptionsSchema.',
278
683
  },
684
+ {
685
+ name: 'experimental_onStart',
686
+ type: 'ToolLoopAgentOnStartCallback',
687
+ isOptional: true,
688
+ description:
689
+ 'Callback that is called when the agent operation begins, before any LLM calls are made. If also specified in the constructor, both callbacks are called (constructor first). Experimental (can break in patch releases).',
690
+ },
691
+ {
692
+ name: 'experimental_onStepStart',
693
+ type: 'ToolLoopAgentOnStepStartCallback',
694
+ isOptional: true,
695
+ description:
696
+ 'Callback that is called when a step (LLM call) begins, before the provider is called. If also specified in the constructor, both callbacks are called (constructor first). Experimental (can break in patch releases).',
697
+ },
698
+ {
699
+ name: 'experimental_onToolCallStart',
700
+ type: 'ToolLoopAgentOnToolCallStartCallback',
701
+ isOptional: true,
702
+ description:
703
+ "Callback that is called right before a tool's execute function runs. If also specified in the constructor, both callbacks are called (constructor first). Experimental (can break in patch releases).",
704
+ },
705
+ {
706
+ name: 'experimental_onToolCallFinish',
707
+ type: 'ToolLoopAgentOnToolCallFinishCallback',
708
+ isOptional: true,
709
+ description:
710
+ "Callback that is called right after a tool's execute function completes (or errors). If also specified in the constructor, both callbacks are called (constructor first). Experimental (can break in patch releases).",
711
+ },
279
712
  {
280
713
  name: 'onStepFinish',
281
714
  type: 'ToolLoopAgentOnStepFinishCallback',
@@ -283,6 +716,13 @@ const result = await agent.generate({
283
716
  description:
284
717
  'Callback invoked after each agent step (LLM/tool call) completes. If also specified in the constructor, both callbacks are called (constructor first, then this one).',
285
718
  },
719
+ {
720
+ name: 'onFinish',
721
+ type: 'ToolLoopAgentOnFinishCallback',
722
+ isOptional: true,
723
+ description:
724
+ 'Callback that is called when all agent steps are finished and the response is complete. If also specified in the constructor, both callbacks are called (constructor first, then this one).',
725
+ },
286
726
  ]}
287
727
  />
288
728
 
@@ -344,6 +784,34 @@ for await (const chunk of stream.textStream) {
344
784
  description:
345
785
  'Optional stream transformation(s). They are applied in the order provided and must maintain the stream structure. See `streamText` docs for details.',
346
786
  },
787
+ {
788
+ name: 'experimental_onStart',
789
+ type: 'ToolLoopAgentOnStartCallback',
790
+ isOptional: true,
791
+ description:
792
+ 'Callback that is called when the agent operation begins, before any LLM calls are made. If also specified in the constructor, both callbacks are called (constructor first). Experimental (can break in patch releases).',
793
+ },
794
+ {
795
+ name: 'experimental_onStepStart',
796
+ type: 'ToolLoopAgentOnStepStartCallback',
797
+ isOptional: true,
798
+ description:
799
+ 'Callback that is called when a step (LLM call) begins, before the provider is called. If also specified in the constructor, both callbacks are called (constructor first). Experimental (can break in patch releases).',
800
+ },
801
+ {
802
+ name: 'experimental_onToolCallStart',
803
+ type: 'ToolLoopAgentOnToolCallStartCallback',
804
+ isOptional: true,
805
+ description:
806
+ "Callback that is called right before a tool's execute function runs. If also specified in the constructor, both callbacks are called (constructor first). Experimental (can break in patch releases).",
807
+ },
808
+ {
809
+ name: 'experimental_onToolCallFinish',
810
+ type: 'ToolLoopAgentOnToolCallFinishCallback',
811
+ isOptional: true,
812
+ description:
813
+ "Callback that is called right after a tool's execute function completes (or errors). If also specified in the constructor, both callbacks are called (constructor first). Experimental (can break in patch releases).",
814
+ },
347
815
  {
348
816
  name: 'onStepFinish',
349
817
  type: 'ToolLoopAgentOnStepFinishCallback',
@@ -351,6 +819,13 @@ for await (const chunk of stream.textStream) {
351
819
  description:
352
820
  'Callback invoked after each agent step (LLM/tool call) completes. If also specified in the constructor, both callbacks are called (constructor first, then this one).',
353
821
  },
822
+ {
823
+ name: 'onFinish',
824
+ type: 'ToolLoopAgentOnFinishCallback',
825
+ isOptional: true,
826
+ description:
827
+ 'Callback that is called when all agent steps are finished and the response is complete. If also specified in the constructor, both callbacks are called (constructor first, then this one).',
828
+ },
354
829
  ]}
355
830
  />
356
831
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "6.0.95",
3
+ "version": "6.0.97",
4
4
  "description": "AI SDK by Vercel - The AI Toolkit for TypeScript and JavaScript",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -5,7 +5,14 @@ import { StreamTextTransform } from '../generate-text/stream-text';
5
5
  import { StreamTextResult } from '../generate-text/stream-text-result';
6
6
  import { ToolSet } from '../generate-text/tool-set';
7
7
  import { TimeoutConfiguration } from '../prompt/call-settings';
8
- import { ToolLoopAgentOnStepFinishCallback } from './tool-loop-agent-on-step-finish-callback';
8
+ import type {
9
+ ToolLoopAgentOnFinishCallback,
10
+ ToolLoopAgentOnStartCallback,
11
+ ToolLoopAgentOnStepFinishCallback,
12
+ ToolLoopAgentOnStepStartCallback,
13
+ ToolLoopAgentOnToolCallFinishCallback,
14
+ ToolLoopAgentOnToolCallStartCallback,
15
+ } from './tool-loop-agent-settings';
9
16
 
10
17
  /**
11
18
  * Parameters for calling an agent.
@@ -57,10 +64,35 @@ export type AgentCallParameters<CALL_OPTIONS, TOOLS extends ToolSet = {}> = ([
57
64
  */
58
65
  timeout?: TimeoutConfiguration;
59
66
 
67
+ /**
68
+ * Callback that is called when the agent operation begins, before any LLM calls.
69
+ */
70
+ experimental_onStart?: ToolLoopAgentOnStartCallback<TOOLS>;
71
+
72
+ /**
73
+ * Callback that is called when a step (LLM call) begins, before the provider is called.
74
+ */
75
+ experimental_onStepStart?: ToolLoopAgentOnStepStartCallback<TOOLS>;
76
+
77
+ /**
78
+ * Callback that is called before each tool execution begins.
79
+ */
80
+ experimental_onToolCallStart?: ToolLoopAgentOnToolCallStartCallback<TOOLS>;
81
+
82
+ /**
83
+ * Callback that is called after each tool execution completes.
84
+ */
85
+ experimental_onToolCallFinish?: ToolLoopAgentOnToolCallFinishCallback<TOOLS>;
86
+
60
87
  /**
61
88
  * Callback that is called when each step (LLM call) is finished, including intermediate steps.
62
89
  */
63
90
  onStepFinish?: ToolLoopAgentOnStepFinishCallback<TOOLS>;
91
+
92
+ /**
93
+ * Callback that is called when all steps are finished and the response is complete.
94
+ */
95
+ onFinish?: ToolLoopAgentOnFinishCallback<TOOLS>;
64
96
  };
65
97
 
66
98
  /**
@@ -7,7 +7,7 @@ import { UIMessageStreamResponseInit } from '../ui-message-stream/ui-message-str
7
7
  import { InferUITools, UIMessage } from '../ui/ui-messages';
8
8
  import { Agent } from './agent';
9
9
  import { createAgentUIStream } from './create-agent-ui-stream';
10
- import { ToolLoopAgentOnStepFinishCallback } from './tool-loop-agent-on-step-finish-callback';
10
+ import type { ToolLoopAgentOnStepFinishCallback } from './tool-loop-agent-settings';
11
11
 
12
12
  /**
13
13
  * Runs the agent and returns a response object with a UI message stream.
@@ -8,7 +8,7 @@ import { InferUITools, UIMessage } from '../ui/ui-messages';
8
8
  import { validateUIMessages } from '../ui/validate-ui-messages';
9
9
  import { AsyncIterableStream } from '../util/async-iterable-stream';
10
10
  import { Agent } from './agent';
11
- import { ToolLoopAgentOnStepFinishCallback } from './tool-loop-agent-on-step-finish-callback';
11
+ import type { ToolLoopAgentOnStepFinishCallback } from './tool-loop-agent-settings';
12
12
 
13
13
  /**
14
14
  * Runs the agent and stream the output as a UI message stream.
@@ -3,9 +3,13 @@ export {
3
3
  type AgentCallParameters,
4
4
  type AgentStreamParameters,
5
5
  } from './agent';
6
- export { type ToolLoopAgentOnFinishCallback } from './tool-loop-agent-on-finish-callback';
7
- export { type ToolLoopAgentOnStepFinishCallback } from './tool-loop-agent-on-step-finish-callback';
8
6
  export {
7
+ type ToolLoopAgentOnFinishCallback,
8
+ type ToolLoopAgentOnStartCallback,
9
+ type ToolLoopAgentOnStepFinishCallback,
10
+ type ToolLoopAgentOnStepStartCallback,
11
+ type ToolLoopAgentOnToolCallFinishCallback,
12
+ type ToolLoopAgentOnToolCallStartCallback,
9
13
  type ToolLoopAgentSettings,
10
14
 
11
15
  /**
@@ -8,7 +8,7 @@ import { UIMessageStreamResponseInit } from '../ui-message-stream/ui-message-str
8
8
  import { InferUITools, UIMessage } from '../ui/ui-messages';
9
9
  import { Agent } from './agent';
10
10
  import { createAgentUIStream } from './create-agent-ui-stream';
11
- import { ToolLoopAgentOnStepFinishCallback } from './tool-loop-agent-on-step-finish-callback';
11
+ import type { ToolLoopAgentOnStepFinishCallback } from './tool-loop-agent-settings';
12
12
 
13
13
  /**
14
14
  * Pipes the agent UI message stream to a Node.js ServerResponse object.