@ai-sdk/workflow 1.0.60 → 1.0.62

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/workflow",
3
- "version": "1.0.60",
3
+ "version": "1.0.62",
4
4
  "type": "module",
5
5
  "description": "WorkflowAgent for building AI agents with AI SDK",
6
6
  "license": "Apache-2.0",
@@ -28,8 +28,8 @@
28
28
  "dependencies": {
29
29
  "ajv": "^8.20.0",
30
30
  "@ai-sdk/provider": "4.0.7",
31
- "@ai-sdk/provider-utils": "5.0.26",
32
- "ai": "7.0.60"
31
+ "@ai-sdk/provider-utils": "5.0.27",
32
+ "ai": "7.0.62"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/node": "22.19.19",
@@ -126,6 +126,28 @@ export async function doStreamStep(
126
126
  ? resolveSerializableTools(serializedTools)
127
127
  : undefined;
128
128
 
129
+ // streamModelCall derives the model responseFormat from its output spec.
130
+ // WorkflowAgent parses output outside the model-call helper, so this minimal
131
+ // output spec only carries the responseFormat across the step boundary.
132
+ const output =
133
+ options?.responseFormat == null
134
+ ? undefined
135
+ : {
136
+ name: 'workflow',
137
+ responseFormat: Promise.resolve(options.responseFormat),
138
+ async parseCompleteOutput() {
139
+ throw new Error(
140
+ 'WorkflowAgent does not use streamModelCall output parsing.',
141
+ );
142
+ },
143
+ async parsePartialOutput() {
144
+ return undefined;
145
+ },
146
+ createElementStreamTransform() {
147
+ return undefined;
148
+ },
149
+ };
150
+
129
151
  // streamModelCall handles: prompt standardization, tool preparation,
130
152
  // model.doStream(), retry logic, and stream part transformation
131
153
  // (tool call parsing, finish reason mapping, file wrapping).
@@ -143,6 +165,7 @@ export async function doStreamStep(
143
165
  abortSignal: options?.abortSignal,
144
166
  headers: options?.headers,
145
167
  reasoning: options?.reasoning,
168
+ output,
146
169
  maxOutputTokens: options?.maxOutputTokens,
147
170
  temperature: options?.temperature,
148
171
  topP: options?.topP,
@@ -1434,6 +1434,10 @@ export class WorkflowAgent<
1434
1434
  effectiveGenerationSettings.stopSequences = prepared.stopSequences;
1435
1435
  if (prepared.seed !== undefined)
1436
1436
  effectiveGenerationSettings.seed = prepared.seed;
1437
+ if (prepared.maxRetries !== undefined)
1438
+ effectiveGenerationSettings.maxRetries = prepared.maxRetries;
1439
+ if (prepared.abortSignal !== undefined)
1440
+ effectiveGenerationSettings.abortSignal = prepared.abortSignal;
1437
1441
  if (prepared.headers !== undefined)
1438
1442
  effectiveGenerationSettings.headers = prepared.headers;
1439
1443
  if (prepared.reasoning !== undefined)