@ai-sdk/workflow 1.0.0-beta.9 → 1.0.0-canary.33

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,238 @@
1
1
  # @ai-sdk/workflow
2
2
 
3
+ ## 1.0.0-canary.33
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [47e65d6]
8
+ - ai@7.0.0-canary.118
9
+
10
+ ## 1.0.0-canary.32
11
+
12
+ ### Patch Changes
13
+
14
+ - 0c4c275: trigger initial canary release
15
+ - Updated dependencies [0c4c275]
16
+ - @ai-sdk/provider-utils@5.0.0-canary.31
17
+ - @ai-sdk/provider@4.0.0-canary.15
18
+ - ai@7.0.0-canary.117
19
+
20
+ ## 1.0.0-beta.31
21
+
22
+ ### Patch Changes
23
+
24
+ - ai@7.0.0-beta.116
25
+
26
+ ## 1.0.0-beta.30
27
+
28
+ ### Patch Changes
29
+
30
+ - Updated dependencies [08d2129]
31
+ - Updated dependencies [202f107]
32
+ - @ai-sdk/provider-utils@5.0.0-beta.30
33
+ - ai@7.0.0-beta.115
34
+
35
+ ## 1.0.0-beta.29
36
+
37
+ ### Patch Changes
38
+
39
+ - 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
40
+ - Updated dependencies [43a6750]
41
+ - Updated dependencies [81caa5d]
42
+ - Updated dependencies [1f7db50]
43
+ - Updated dependencies [9bd6512]
44
+ - Updated dependencies [258c093]
45
+ - Updated dependencies [b6783da]
46
+ - Updated dependencies [6147cdf]
47
+ - ai@7.0.0-beta.114
48
+ - @ai-sdk/provider-utils@5.0.0-beta.29
49
+ - @ai-sdk/provider@4.0.0-beta.14
50
+
51
+ ## 1.0.0-beta.28
52
+
53
+ ### Patch Changes
54
+
55
+ - 9f0e36c: trigger release for all packages after provenance setup
56
+ - Updated dependencies [9f0e36c]
57
+ - ai@7.0.0-beta.113
58
+ - @ai-sdk/provider@4.0.0-beta.13
59
+ - @ai-sdk/provider-utils@5.0.0-beta.28
60
+
61
+ ## 1.0.0-beta.27
62
+
63
+ ### Patch Changes
64
+
65
+ - 29d8cf4: feat(ai): rename the core-event types
66
+ - a0ca584: fix (workflow): preserve invalid tool calls as errors instead of emitting synthetic success results
67
+ - Updated dependencies [785fe16]
68
+ - Updated dependencies [5f3749c]
69
+ - Updated dependencies [0a51f7d]
70
+ - Updated dependencies [71d3022]
71
+ - Updated dependencies [67df0a0]
72
+ - Updated dependencies [4181cfe]
73
+ - Updated dependencies [51ce232]
74
+ - Updated dependencies [cf93359]
75
+ - Updated dependencies [befb78c]
76
+ - Updated dependencies [29d8cf4]
77
+ - Updated dependencies [0458559]
78
+ - Updated dependencies [58a2ad7]
79
+ - Updated dependencies [5852c0a]
80
+ - Updated dependencies [37d69b2]
81
+ - Updated dependencies [1043274]
82
+ - Updated dependencies [7f59f04]
83
+ - Updated dependencies [7677c1e]
84
+ - Updated dependencies [116c89f]
85
+ - Updated dependencies [f58f9bc]
86
+ - Updated dependencies [e1bfb9c]
87
+ - Updated dependencies [e87d71b]
88
+ - Updated dependencies [9d486aa]
89
+ - Updated dependencies [9b0bc8a]
90
+ - Updated dependencies [fc92055]
91
+ - Updated dependencies [4e095b0]
92
+ - @ai-sdk/provider-utils@5.0.0-beta.27
93
+ - ai@7.0.0-beta.112
94
+
95
+ ## 1.0.0-beta.26
96
+
97
+ ### Major Changes
98
+
99
+ - 1949571: feat(ai): make experimental_telemetry stable
100
+
101
+ ### Patch Changes
102
+
103
+ - f32c750: refactoring(ai): simplify mergeAbortSignals
104
+ - Updated dependencies [f319fde]
105
+ - Updated dependencies [1949571]
106
+ - Updated dependencies [511902c]
107
+ - Updated dependencies [6542d93]
108
+ - Updated dependencies [2e98477]
109
+ - Updated dependencies [876fd3e]
110
+ - Updated dependencies [f32c750]
111
+ - ai@7.0.0-beta.111
112
+ - @ai-sdk/provider-utils@5.0.0-beta.26
113
+
114
+ ## 1.0.0-beta.25
115
+
116
+ ### Patch Changes
117
+
118
+ - Updated dependencies [72cb801]
119
+ - ai@7.0.0-beta.110
120
+
121
+ ## 1.0.0-beta.24
122
+
123
+ ### Patch Changes
124
+
125
+ - eea8d98: refactoring: rename tool execution events
126
+ - Updated dependencies [ec98264]
127
+ - Updated dependencies [eea8d98]
128
+ - Updated dependencies [75ef93e]
129
+ - ai@7.0.0-beta.109
130
+ - @ai-sdk/provider-utils@5.0.0-beta.25
131
+
132
+ ## 1.0.0-beta.23
133
+
134
+ ### Patch Changes
135
+
136
+ - Updated dependencies [f807e45]
137
+ - @ai-sdk/provider-utils@5.0.0-beta.24
138
+ - ai@7.0.0-beta.108
139
+
140
+ ## 1.0.0-beta.22
141
+
142
+ ### Patch Changes
143
+
144
+ - Updated dependencies [350ea38]
145
+ - @ai-sdk/provider-utils@5.0.0-beta.23
146
+ - ai@7.0.0-beta.107
147
+
148
+ ## 1.0.0-beta.21
149
+
150
+ ### Patch Changes
151
+
152
+ - fbea042: refactor: replace duplicate `filterTools`/`filterToolSet` with shared `experimental_filterActiveTools` from `ai`
153
+
154
+ ## 1.0.0-beta.20
155
+
156
+ ### Patch Changes
157
+
158
+ - ai@7.0.0-beta.106
159
+
160
+ ## 1.0.0-beta.19
161
+
162
+ ### Patch Changes
163
+
164
+ - Updated dependencies [33d099c]
165
+ - ai@7.0.0-beta.105
166
+
167
+ ## 1.0.0-beta.18
168
+
169
+ ### Patch Changes
170
+
171
+ - eba685c: Remove `maxSteps` option from `WorkflowAgent`. Use `stopWhen` with stop conditions like `isStepCount()` instead.
172
+ - Updated dependencies [2a74d43]
173
+ - ai@7.0.0-beta.104
174
+
175
+ ## 1.0.0-beta.17
176
+
177
+ ### Patch Changes
178
+
179
+ - 382d53b: refactoring: rename context to runtimeContext
180
+ - c3d4019: chore(ai): rename 'TelemetrySettings' to 'TelemetryOptions'
181
+ - 083947b: feat(ai): separate toolsContext from context
182
+ - Updated dependencies [382d53b]
183
+ - Updated dependencies [7bf7d7f]
184
+ - Updated dependencies [c3d4019]
185
+ - Updated dependencies [083947b]
186
+ - ai@7.0.0-beta.103
187
+ - @ai-sdk/provider-utils@5.0.0-beta.22
188
+
189
+ ## 1.0.0-beta.16
190
+
191
+ ### Patch Changes
192
+
193
+ - ai@7.0.0-beta.102
194
+
195
+ ## 1.0.0-beta.15
196
+
197
+ ### Patch Changes
198
+
199
+ - Updated dependencies [4873966]
200
+ - ai@7.0.0-beta.101
201
+
202
+ ## 1.0.0-beta.14
203
+
204
+ ### Patch Changes
205
+
206
+ - Updated dependencies [add1126]
207
+ - @ai-sdk/provider-utils@5.0.0-beta.21
208
+ - ai@7.0.0-beta.100
209
+
210
+ ## 1.0.0-beta.13
211
+
212
+ ### Patch Changes
213
+
214
+ - Updated dependencies [2a9c144]
215
+ - ai@7.0.0-beta.99
216
+
217
+ ## 1.0.0-beta.12
218
+
219
+ ### Patch Changes
220
+
221
+ - ai@7.0.0-beta.98
222
+
223
+ ## 1.0.0-beta.11
224
+
225
+ ### Patch Changes
226
+
227
+ - Updated dependencies [208d045]
228
+ - ai@7.0.0-beta.97
229
+
230
+ ## 1.0.0-beta.10
231
+
232
+ ### Patch Changes
233
+
234
+ - ai@7.0.0-beta.96
235
+
3
236
  ## 1.0.0-beta.9
4
237
 
5
238
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { LanguageModelV4, SharedV4ProviderOptions, LanguageModelV4CallOptions, LanguageModelV4Prompt, LanguageModelV4StreamPart } from '@ai-sdk/provider';
2
- import { ToolSet, LanguageModel, SystemModelMessage, ToolChoice, StopCondition, LanguageModelResponseMetadata, LanguageModelUsage, FinishReason, ToolCallRepairFunction, StepResult, StreamTextOnStepFinishCallback, ModelMessage, Experimental_LanguageModelStreamPart, UIMessage, UIMessageChunk, ChatTransport, PrepareSendMessagesRequest, PrepareReconnectToStreamRequest, ChatRequestOptions } from 'ai';
2
+ import { ToolSet, LanguageModel, SystemModelMessage, ToolChoice, StopCondition, ActiveTools, LanguageModelResponseMetadata, LanguageModelUsage, FinishReason, ToolCallRepairFunction, StepResult, GenerateTextOnStepFinishCallback, ModelMessage, Experimental_LanguageModelStreamPart, UIMessage, UIMessageChunk, ChatTransport, PrepareSendMessagesRequest, PrepareReconnectToStreamRequest, ChatRequestOptions } from 'ai';
3
3
  export { Experimental_LanguageModelStreamPart as ModelCallStreamPart, Output, ToolCallRepairFunction } from 'ai';
4
4
 
5
5
  /**
@@ -15,10 +15,10 @@ type CompatibleLanguageModel = LanguageModelV4;
15
15
 
16
16
  /**
17
17
  * Callback function to be called after each step completes.
18
- * Alias for the AI SDK's StreamTextOnStepFinishCallback, using
18
+ * Alias for the AI SDK's GenerateTextOnStepFinishCallback, using
19
19
  * WorkflowAgent-consistent naming.
20
20
  */
21
- type WorkflowAgentOnStepFinishCallback<TTools extends ToolSet = ToolSet> = StreamTextOnStepFinishCallback<TTools, any>;
21
+ type WorkflowAgentOnStepFinishCallback<TTools extends ToolSet = ToolSet> = GenerateTextOnStepFinishCallback<TTools, any>;
22
22
  /**
23
23
  * Infer the type of the tools of a workflow agent.
24
24
  */
@@ -55,7 +55,7 @@ type ProviderOptions = SharedV4ProviderOptions;
55
55
  /**
56
56
  * Telemetry settings for observability.
57
57
  */
58
- interface TelemetrySettings {
58
+ interface TelemetryOptions {
59
59
  /**
60
60
  * Enable or disable telemetry. Defaults to true.
61
61
  */
@@ -252,7 +252,11 @@ interface PrepareCallOptions<TTools extends ToolSet = ToolSet> extends Partial<G
252
252
  tools: TTools;
253
253
  instructions?: string | SystemModelMessage | Array<SystemModelMessage>;
254
254
  toolChoice?: ToolChoice<TTools>;
255
- experimental_telemetry?: TelemetrySettings;
255
+ telemetry?: TelemetryOptions;
256
+ /**
257
+ * @deprecated Use `telemetry` instead. This alias will be removed in a future major release.
258
+ */
259
+ experimental_telemetry?: TelemetryOptions;
256
260
  experimental_context?: unknown;
257
261
  messages: ModelMessage[];
258
262
  }
@@ -303,9 +307,15 @@ interface WorkflowAgentOptions<TTools extends ToolSet = ToolSet> extends Generat
303
307
  */
304
308
  toolChoice?: ToolChoice<TTools>;
305
309
  /**
306
- * Optional telemetry configuration (experimental).
310
+ * Optional telemetry configuration.
311
+ */
312
+ telemetry?: TelemetryOptions;
313
+ /**
314
+ * Optional telemetry configuration.
315
+ *
316
+ * @deprecated Use `telemetry` instead. This alias will be removed in a future major release.
307
317
  */
308
- experimental_telemetry?: TelemetrySettings;
318
+ experimental_telemetry?: TelemetryOptions;
309
319
  /**
310
320
  * Default context that is passed into tool execution for every stream call on this agent.
311
321
  *
@@ -327,7 +337,7 @@ interface WorkflowAgentOptions<TTools extends ToolSet = ToolSet> extends Generat
327
337
  *
328
338
  * Per-stream `activeTools` values passed to `stream()` override this default.
329
339
  */
330
- activeTools?: Array<keyof NoInfer<TTools>>;
340
+ activeTools?: ActiveTools<NoInfer<TTools>>;
331
341
  /**
332
342
  * Default output specification for structured outputs.
333
343
  * Use `Output.object({ schema })` for structured output or `Output.text()` for text output.
@@ -374,11 +384,11 @@ interface WorkflowAgentOptions<TTools extends ToolSet = ToolSet> extends Generat
374
384
  /**
375
385
  * Callback called before a tool's execute function runs.
376
386
  */
377
- experimental_onToolCallStart?: WorkflowAgentOnToolCallStartCallback;
387
+ experimental_onToolExecutionStart?: WorkflowAgentOnToolExecutionStartCallback;
378
388
  /**
379
389
  * Callback called after a tool execution completes.
380
390
  */
381
- experimental_onToolCallFinish?: WorkflowAgentOnToolCallFinishCallback;
391
+ experimental_onToolExecutionEnd?: WorkflowAgentOnToolExecutionEndCallback;
382
392
  /**
383
393
  * Prepare the parameters for the stream call.
384
394
  * Called once before the agent loop starts. Use this to transform
@@ -460,7 +470,7 @@ type WorkflowAgentOnStepStartCallback<TTools extends ToolSet = ToolSet> = (event
460
470
  /**
461
471
  * Callback that is called before a tool's execute function runs.
462
472
  */
463
- type WorkflowAgentOnToolCallStartCallback = (event: {
473
+ type WorkflowAgentOnToolExecutionStartCallback = (event: {
464
474
  /** The tool call being executed */
465
475
  readonly toolCall: ToolCall;
466
476
  /** The current step number (0-based) */
@@ -471,7 +481,7 @@ type WorkflowAgentOnToolCallStartCallback = (event: {
471
481
  * Uses a discriminated union pattern: check `success` to determine
472
482
  * whether `output` or `error` is available.
473
483
  */
474
- type WorkflowAgentOnToolCallFinishCallback = (event: {
484
+ type WorkflowAgentOnToolExecutionEndCallback = (event: {
475
485
  /** The tool call that was executed */
476
486
  readonly toolCall: ToolCall;
477
487
  /** The current step number (0-based) */
@@ -558,12 +568,6 @@ type WorkflowAgentStreamOptions<TTools extends ToolSet = ToolSet, OUTPUT = never
558
568
  * When the condition is an array, any of the conditions can be met to stop the generation.
559
569
  */
560
570
  stopWhen?: StopCondition<NoInfer<ToolSet>, any> | Array<StopCondition<NoInfer<ToolSet>, any>>;
561
- /**
562
- * Maximum number of sequential LLM calls (steps), e.g. when you use tool calls.
563
- * A maximum number can be set to prevent infinite loops in the case of misconfigured tools.
564
- * By default, it's unlimited (the agent loops until completion).
565
- */
566
- maxSteps?: number;
567
571
  /**
568
572
  * The tool choice strategy. Default: 'auto'.
569
573
  * Overrides the toolChoice from the constructor if provided.
@@ -573,11 +577,17 @@ type WorkflowAgentStreamOptions<TTools extends ToolSet = ToolSet, OUTPUT = never
573
577
  * Limits the tools that are available for the model to call without
574
578
  * changing the tool call and result types in the result.
575
579
  */
576
- activeTools?: Array<keyof NoInfer<TTools>>;
580
+ activeTools?: ActiveTools<NoInfer<TTools>>;
577
581
  /**
578
- * Optional telemetry configuration (experimental).
582
+ * Optional telemetry configuration.
583
+ */
584
+ telemetry?: TelemetryOptions;
585
+ /**
586
+ * Optional telemetry configuration.
587
+ *
588
+ * @deprecated Use `telemetry` instead. This alias will be removed in a future major release.
579
589
  */
580
- experimental_telemetry?: TelemetrySettings;
590
+ experimental_telemetry?: TelemetryOptions;
581
591
  /**
582
592
  * Context that is passed into tool execution.
583
593
  * Experimental (can break in patch releases).
@@ -659,11 +669,11 @@ type WorkflowAgentStreamOptions<TTools extends ToolSet = ToolSet, OUTPUT = never
659
669
  /**
660
670
  * Callback called before a tool's execute function runs.
661
671
  */
662
- experimental_onToolCallStart?: WorkflowAgentOnToolCallStartCallback;
672
+ experimental_onToolExecutionStart?: WorkflowAgentOnToolExecutionStartCallback;
663
673
  /**
664
674
  * Callback called after a tool execution completes.
665
675
  */
666
- experimental_onToolCallFinish?: WorkflowAgentOnToolCallFinishCallback;
676
+ experimental_onToolExecutionEnd?: WorkflowAgentOnToolExecutionEndCallback;
667
677
  /**
668
678
  * Callback function called before each step in the agent loop.
669
679
  * Use this to modify settings, manage context, or inject messages dynamically.
@@ -823,8 +833,8 @@ declare class WorkflowAgent<TBaseTools extends ToolSet = ToolSet> {
823
833
  private constructorOnFinish?;
824
834
  private constructorOnStart?;
825
835
  private constructorOnStepStart?;
826
- private constructorOnToolCallStart?;
827
- private constructorOnToolCallFinish?;
836
+ private constructorOnToolExecutionStart?;
837
+ private constructorOnToolExecutionEnd?;
828
838
  private prepareCall?;
829
839
  constructor(options: WorkflowAgentOptions<TBaseTools>);
830
840
  generate(): void;
@@ -997,4 +1007,4 @@ declare class WorkflowChatTransport<UI_MESSAGE extends UIMessage> implements Cha
997
1007
  private onFinish;
998
1008
  }
999
1009
 
1000
- export { type CompatibleLanguageModel, type DownloadFunction, type GenerationSettings, type InferWorkflowAgentTools, type InferWorkflowAgentUIMessage, type OutputSpecification, type PrepareCallCallback, type PrepareCallOptions, type PrepareCallResult, type PrepareStepCallback, type PrepareStepInfo, type PrepareStepResult, type ProviderOptions, type ReconnectToStreamOptions, type SendMessagesOptions, type StreamTextTransform, type TelemetrySettings, WorkflowAgent, type WorkflowAgentOnAbortCallback, type WorkflowAgentOnErrorCallback, type WorkflowAgentOnFinishCallback, type WorkflowAgentOnStartCallback, type WorkflowAgentOnStepFinishCallback, type WorkflowAgentOnStepStartCallback, type WorkflowAgentOnToolCallFinishCallback, type WorkflowAgentOnToolCallStartCallback, type WorkflowAgentOptions, type WorkflowAgentStreamOptions, type WorkflowAgentStreamResult, WorkflowChatTransport, type WorkflowChatTransportOptions, createModelCallToUIChunkTransform, toUIMessageChunk };
1010
+ export { type CompatibleLanguageModel, type DownloadFunction, type GenerationSettings, type InferWorkflowAgentTools, type InferWorkflowAgentUIMessage, type OutputSpecification, type PrepareCallCallback, type PrepareCallOptions, type PrepareCallResult, type PrepareStepCallback, type PrepareStepInfo, type PrepareStepResult, type ProviderOptions, type ReconnectToStreamOptions, type SendMessagesOptions, type StreamTextTransform, type TelemetryOptions, WorkflowAgent, type WorkflowAgentOnAbortCallback, type WorkflowAgentOnErrorCallback, type WorkflowAgentOnFinishCallback, type WorkflowAgentOnStartCallback, type WorkflowAgentOnStepFinishCallback, type WorkflowAgentOnStepStartCallback, type WorkflowAgentOnToolExecutionEndCallback, type WorkflowAgentOnToolExecutionStartCallback, type WorkflowAgentOptions, type WorkflowAgentStreamOptions, type WorkflowAgentStreamResult, WorkflowChatTransport, type WorkflowChatTransportOptions, createModelCallToUIChunkTransform, toUIMessageChunk };