@zenning/openai 3.0.13 → 3.0.15

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/dist/index.mjs CHANGED
@@ -2552,10 +2552,8 @@ async function convertToOpenAIResponsesInput({
2552
2552
  const input = [];
2553
2553
  const warnings = [];
2554
2554
  const processedApprovalIds = /* @__PURE__ */ new Set();
2555
- const hasApprovalResponses = prompt.some(
2556
- (message) => message.role === "tool" && message.content.some((part) => part.type === "tool-approval-response")
2557
- );
2558
- console.log("[OpenAI Provider] Approval continuation detected:", hasApprovalResponses);
2555
+ const skipItemReferences = (providerOptionsName && (store == null ? void 0 : store.skipItemReferencesForApproval)) === true;
2556
+ console.log("[OpenAI Provider] Skip item references flag:", skipItemReferences);
2559
2557
  if (compactionInput && compactionInput.length > 0) {
2560
2558
  input.push(...compactionInput);
2561
2559
  }
@@ -2650,29 +2648,31 @@ async function convertToOpenAIResponsesInput({
2650
2648
  }
2651
2649
  case "tool-call": {
2652
2650
  const id = (_g = (_d = (_c = part.providerOptions) == null ? void 0 : _c[providerOptionsName]) == null ? void 0 : _d.itemId) != null ? _g : (_f = (_e = part.providerMetadata) == null ? void 0 : _e[providerOptionsName]) == null ? void 0 : _f.itemId;
2653
- const skipItemReference = hasApprovalResponses;
2654
2651
  console.log("[OpenAI Provider] Processing tool-call:", {
2655
2652
  toolCallId: part.toolCallId,
2656
2653
  toolName: part.toolName,
2657
2654
  id,
2658
2655
  providerExecuted: part.providerExecuted,
2659
2656
  store,
2660
- hasApprovalResponses,
2661
- skipItemReference,
2662
- willCreateItemReference: store && id != null && !skipItemReference
2657
+ skipItemReferences,
2658
+ willCreateItemReference: store && id != null && !skipItemReferences
2663
2659
  });
2664
2660
  if (part.providerExecuted) {
2665
- if (store && id != null && !skipItemReference) {
2661
+ if (store && id != null && !skipItemReferences) {
2666
2662
  console.log("[OpenAI Provider] Creating item_reference (providerExecuted)");
2667
2663
  input.push({ type: "item_reference", id });
2668
2664
  }
2669
2665
  break;
2670
2666
  }
2671
- if (store && id != null && !skipItemReference) {
2667
+ if (store && id != null && !skipItemReferences) {
2672
2668
  console.log("[OpenAI Provider] Creating item_reference (non-providerExecuted)");
2673
2669
  input.push({ type: "item_reference", id });
2674
2670
  break;
2675
2671
  }
2672
+ if (skipItemReferences) {
2673
+ console.log("[OpenAI Provider] Skipping function_call due to approval continuation flag");
2674
+ break;
2675
+ }
2676
2676
  const resolvedToolName = toolNameMapping.toProviderToolName(
2677
2677
  part.toolName
2678
2678
  );
@@ -5870,7 +5870,7 @@ var OpenAITranscriptionModel = class {
5870
5870
  };
5871
5871
 
5872
5872
  // src/version.ts
5873
- var VERSION = true ? "3.0.12" : "0.0.0-test";
5873
+ var VERSION = true ? "3.0.14" : "0.0.0-test";
5874
5874
 
5875
5875
  // src/openai-provider.ts
5876
5876
  function createOpenAI(options = {}) {