ai 6.0.198 → 6.0.199

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,14 @@
1
1
  # ai
2
2
 
3
+ ## 6.0.199
4
+
5
+ ### Patch Changes
6
+
7
+ - 49d9364: fix(ai): add approval guard for denied tool outputs
8
+ - Updated dependencies [3851e29]
9
+ - Updated dependencies [2a91a17]
10
+ - @ai-sdk/gateway@3.0.127
11
+
3
12
  ## 6.0.198
4
13
 
5
14
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1254,7 +1254,7 @@ function detectMediaType({
1254
1254
  var import_provider_utils3 = require("@ai-sdk/provider-utils");
1255
1255
 
1256
1256
  // src/version.ts
1257
- var VERSION = true ? "6.0.198" : "0.0.0-test";
1257
+ var VERSION = true ? "6.0.199" : "0.0.0-test";
1258
1258
 
1259
1259
  // src/util/download/download.ts
1260
1260
  var download = async ({
@@ -8592,7 +8592,7 @@ async function convertToModelMessages(messages, options) {
8592
8592
  if (message.parts != null) {
8593
8593
  let block = [];
8594
8594
  async function processBlock() {
8595
- var _a21, _b, _c, _d, _e, _f, _g;
8595
+ var _a21, _b, _c, _d, _e, _f, _g, _h;
8596
8596
  if (block.length === 0) {
8597
8597
  return;
8598
8598
  }
@@ -8700,7 +8700,7 @@ async function convertToModelMessages(messages, options) {
8700
8700
  toolName: getToolName(toolPart),
8701
8701
  output: {
8702
8702
  type: "error-text",
8703
- value: (_f = toolPart.approval.reason) != null ? _f : "Tool execution denied."
8703
+ value: (_g = (_f = toolPart.approval) == null ? void 0 : _f.reason) != null ? _g : "Tool execution denied."
8704
8704
  },
8705
8705
  ...toolPart.callProviderMetadata != null ? { providerOptions: toolPart.callProviderMetadata } : {}
8706
8706
  });
@@ -8717,7 +8717,7 @@ async function convertToModelMessages(messages, options) {
8717
8717
  toolCallId: toolPart.toolCallId,
8718
8718
  input: toolPart.input,
8719
8719
  output: toolPart.state === "output-error" ? toolPart.errorText : toolPart.output,
8720
- tool: (_g = options == null ? void 0 : options.tools) == null ? void 0 : _g[toolName],
8720
+ tool: (_h = options == null ? void 0 : options.tools) == null ? void 0 : _h[toolName],
8721
8721
  errorMode: toolPart.state === "output-error" ? "text" : "none"
8722
8722
  }),
8723
8723
  ...toolPart.callProviderMetadata != null ? { providerOptions: toolPart.callProviderMetadata } : {}