@ai-sdk/workflow 2.0.19 → 2.0.20

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,11 @@
1
1
  # @ai-sdk/workflow
2
2
 
3
+ ## 2.0.20
4
+
5
+ ### Patch Changes
6
+
7
+ - 85d2081: fix(workflow): preserve configured tool and runtime context types in stop conditions
8
+
3
9
  ## 2.0.19
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -284,7 +284,7 @@ interface PrepareCallOptions<TTools extends ToolSet = ToolSet, TRuntimeContext e
284
284
  tools: TTools;
285
285
  instructions?: Instructions;
286
286
  toolChoice?: ToolChoice<TTools>;
287
- stopWhen?: StopCondition<NoInfer<ToolSet>, any> | Array<StopCondition<NoInfer<ToolSet>, any>>;
287
+ stopWhen?: StopCondition<NoInfer<TTools>, TRuntimeContext> | Array<StopCondition<NoInfer<TTools>, TRuntimeContext>>;
288
288
  activeTools?: ActiveTools<NoInfer<TTools>>;
289
289
  experimental_download?: DownloadFunction;
290
290
  telemetry?: TelemetryOptions<TRuntimeContext, TTools>;
@@ -369,7 +369,7 @@ type WorkflowAgentOptions<TTools extends ToolSet = ToolSet, TRuntimeContext exte
369
369
  *
370
370
  * Per-stream `stopWhen` values passed to `stream()` override this default.
371
371
  */
372
- stopWhen?: StopCondition<NoInfer<ToolSet>, any> | Array<StopCondition<NoInfer<ToolSet>, any>>;
372
+ stopWhen?: StopCondition<NoInfer<TTools>, TRuntimeContext> | Array<StopCondition<NoInfer<TTools>, TRuntimeContext>>;
373
373
  /**
374
374
  * Default set of active tools that limits which tools the model can call,
375
375
  * without changing the tool call and result types in the result.
@@ -705,7 +705,7 @@ type WorkflowAgentStreamOptions<TTools extends ToolSet = ToolSet, TRuntimeContex
705
705
  * Condition for stopping the generation when there are tool results in the last step.
706
706
  * When the condition is an array, any of the conditions can be met to stop the generation.
707
707
  */
708
- stopWhen?: StopCondition<NoInfer<ToolSet>, any> | Array<StopCondition<NoInfer<ToolSet>, any>>;
708
+ stopWhen?: StopCondition<NoInfer<TTools>, TRuntimeContext> | Array<StopCondition<NoInfer<TTools>, TRuntimeContext>>;
709
709
  /**
710
710
  * The tool choice strategy. Default: 'auto'.
711
711
  * Overrides the toolChoice from the constructor if provided.