@zenning/ai 6.0.18 → 6.0.19

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.19
4
+
5
+ ### Patch Changes
6
+
7
+ - approvals2
8
+
3
9
  ## 6.0.18
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.16" : "0.0.0-test";
1004
+ var VERSION = true ? "6.0.18" : "0.0.0-test";
1005
1005
 
1006
1006
  // src/util/download/download.ts
1007
1007
  var download = async ({ url }) => {
@@ -7502,13 +7502,18 @@ async function convertToModelMessages(messages, options) {
7502
7502
  ...part.callProviderMetadata != null ? { providerOptions: part.callProviderMetadata } : {}
7503
7503
  });
7504
7504
  if (part.approval != null) {
7505
+ console.log("[SDK convertToModelMessages] Creating tool-approval-request:", {
7506
+ approvalId: part.approval.id,
7507
+ toolCallId: part.toolCallId,
7508
+ toolName
7509
+ });
7505
7510
  content.push({
7506
7511
  type: "tool-approval-request",
7507
7512
  approvalId: part.approval.id,
7508
7513
  toolCallId: part.toolCallId
7509
7514
  });
7510
7515
  }
7511
- if (part.providerExecuted === true && (part.state === "output-available" || part.state === "output-error")) {
7516
+ if (part.providerExecuted === true && part.state !== "approval-responded" && (part.state === "output-available" || part.state === "output-error")) {
7512
7517
  content.push({
7513
7518
  type: "tool-result",
7514
7519
  toolCallId: part.toolCallId,
@@ -7552,6 +7557,12 @@ async function convertToModelMessages(messages, options) {
7552
7557
  const content2 = [];
7553
7558
  for (const toolPart of toolParts) {
7554
7559
  if (((_d = toolPart.approval) == null ? void 0 : _d.approved) != null) {
7560
+ console.log("[SDK convertToModelMessages] Creating tool-approval-response:", {
7561
+ approvalId: toolPart.approval.id,
7562
+ approved: toolPart.approval.approved,
7563
+ toolCallId: toolPart.toolCallId,
7564
+ toolName: getToolName(toolPart)
7565
+ });
7555
7566
  content2.push({
7556
7567
  type: "tool-approval-response",
7557
7568
  approvalId: toolPart.approval.id,