@zenning/ai 6.0.15 → 6.0.16

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
+ ## 6.0.16
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix tool approval validation error when using previousResponseId. Skip validation of approval-request existence when continuing from a previous response, since the approval-request is in the provider's context rather than the current messages.
8
+
3
9
  ## 6.0.15
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1001,7 +1001,7 @@ var import_provider_utils3 = require("@zenning/provider-utils");
1001
1001
  var import_provider_utils4 = require("@zenning/provider-utils");
1002
1002
 
1003
1003
  // src/version.ts
1004
- var VERSION = true ? "6.0.14" : "0.0.0-test";
1004
+ var VERSION = true ? "6.0.15" : "0.0.0-test";
1005
1005
 
1006
1006
  // src/util/download/download.ts
1007
1007
  var download = async ({ url }) => {
@@ -7492,7 +7492,7 @@ async function convertToModelMessages(messages, options) {
7492
7492
  });
7493
7493
  } else if (isToolUIPart(part)) {
7494
7494
  const toolName = getToolName(part);
7495
- if (part.state !== "input-streaming") {
7495
+ if (part.state !== "input-streaming" && part.state !== "approval-responded" && part.state !== "output-denied") {
7496
7496
  content.push({
7497
7497
  type: "tool-call",
7498
7498
  toolCallId: part.toolCallId,
@@ -7508,7 +7508,7 @@ async function convertToModelMessages(messages, options) {
7508
7508
  toolCallId: part.toolCallId
7509
7509
  });
7510
7510
  }
7511
- if (part.providerExecuted === true && part.state !== "approval-responded" && (part.state === "output-available" || part.state === "output-error")) {
7511
+ if (part.providerExecuted === true && (part.state === "output-available" || part.state === "output-error")) {
7512
7512
  content.push({
7513
7513
  type: "tool-result",
7514
7514
  toolCallId: part.toolCallId,