ai 5.0.88 → 5.0.89

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
2
2
 
3
+ ## 5.0.89
4
+
5
+ ### Patch Changes
6
+
7
+ - 7cfada6: feat(ai): `chat.addToolResult()` is now `chat.addToolOutput()`
8
+
3
9
  ## 5.0.88
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -4195,6 +4195,20 @@ declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
4195
4195
  * Clear the error state and set the status to ready if the chat is in an error state.
4196
4196
  */
4197
4197
  clearError: () => void;
4198
+ addToolOutput: <TOOL extends keyof InferUIMessageTools<UI_MESSAGE>>({ state, tool, toolCallId, output, errorText, }: {
4199
+ state?: "output-available";
4200
+ tool: TOOL;
4201
+ toolCallId: string;
4202
+ output: InferUIMessageTools<UI_MESSAGE>[TOOL]["output"];
4203
+ errorText?: never;
4204
+ } | {
4205
+ state: "output-error";
4206
+ tool: TOOL;
4207
+ toolCallId: string;
4208
+ output?: never;
4209
+ errorText: string;
4210
+ }) => Promise<void>;
4211
+ /** @deprecated Use addToolOutput */
4198
4212
  addToolResult: <TOOL extends keyof InferUIMessageTools<UI_MESSAGE>>({ state, tool, toolCallId, output, errorText, }: {
4199
4213
  state?: "output-available";
4200
4214
  tool: TOOL;
package/dist/index.d.ts CHANGED
@@ -4195,6 +4195,20 @@ declare abstract class AbstractChat<UI_MESSAGE extends UIMessage> {
4195
4195
  * Clear the error state and set the status to ready if the chat is in an error state.
4196
4196
  */
4197
4197
  clearError: () => void;
4198
+ addToolOutput: <TOOL extends keyof InferUIMessageTools<UI_MESSAGE>>({ state, tool, toolCallId, output, errorText, }: {
4199
+ state?: "output-available";
4200
+ tool: TOOL;
4201
+ toolCallId: string;
4202
+ output: InferUIMessageTools<UI_MESSAGE>[TOOL]["output"];
4203
+ errorText?: never;
4204
+ } | {
4205
+ state: "output-error";
4206
+ tool: TOOL;
4207
+ toolCallId: string;
4208
+ output?: never;
4209
+ errorText: string;
4210
+ }) => Promise<void>;
4211
+ /** @deprecated Use addToolOutput */
4198
4212
  addToolResult: <TOOL extends keyof InferUIMessageTools<UI_MESSAGE>>({ state, tool, toolCallId, output, errorText, }: {
4199
4213
  state?: "output-available";
4200
4214
  tool: TOOL;
package/dist/index.js CHANGED
@@ -764,7 +764,7 @@ function detectMediaType({
764
764
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
765
765
 
766
766
  // src/version.ts
767
- var VERSION = true ? "5.0.88" : "0.0.0-test";
767
+ var VERSION = true ? "5.0.89" : "0.0.0-test";
768
768
 
769
769
  // src/util/download/download.ts
770
770
  var download = async ({ url }) => {
@@ -9267,7 +9267,7 @@ var AbstractChat = class {
9267
9267
  this.setStatus({ status: "ready" });
9268
9268
  }
9269
9269
  };
9270
- this.addToolResult = async ({
9270
+ this.addToolOutput = async ({
9271
9271
  state = "output-available",
9272
9272
  tool: tool2,
9273
9273
  toolCallId,
@@ -9300,6 +9300,8 @@ var AbstractChat = class {
9300
9300
  });
9301
9301
  }
9302
9302
  });
9303
+ /** @deprecated Use addToolOutput */
9304
+ this.addToolResult = this.addToolOutput;
9303
9305
  /**
9304
9306
  * Abort the current request immediately, keep the generated tokens if any.
9305
9307
  */