@zenning/openai 3.0.23 → 3.0.25

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
@@ -2556,10 +2556,23 @@ async function convertToOpenAIResponsesInput({
2556
2556
  const warnings = [];
2557
2557
  const processedApprovalIds = /* @__PURE__ */ new Set();
2558
2558
  const approvalToolCallIds = new Set(approvalToolCallIdsArray || []);
2559
+ console.log("CALDEBUG [convertToOpenAIResponsesInput] Starting conversion:", {
2560
+ containsApprovalResponses,
2561
+ approvalToolCallIdsCount: approvalToolCallIds.size,
2562
+ approvalToolCallIds: Array.from(approvalToolCallIds),
2563
+ previousResponseId,
2564
+ promptLength: prompt.length
2565
+ });
2559
2566
  if (compactionInput && compactionInput.length > 0) {
2560
2567
  input.push(...compactionInput);
2561
2568
  }
2562
2569
  for (const { role, content } of prompt) {
2570
+ console.log("CALDEBUG [convertToOpenAIResponsesInput] Processing message:", {
2571
+ role,
2572
+ isString: typeof content === "string",
2573
+ partsCount: typeof content === "string" ? 0 : content.length,
2574
+ partTypes: typeof content === "string" ? [] : content.map((p) => p.type)
2575
+ });
2563
2576
  switch (role) {
2564
2577
  case "system": {
2565
2578
  switch (systemMessageMode) {
@@ -2790,6 +2803,10 @@ async function convertToOpenAIResponsesInput({
2790
2803
  break;
2791
2804
  }
2792
2805
  case "tool": {
2806
+ console.log("CALDEBUG [convertToOpenAIResponsesInput] Processing tool role message:", {
2807
+ partsCount: content.length,
2808
+ partTypes: content.map((p) => p.type)
2809
+ });
2793
2810
  for (const part of content) {
2794
2811
  if (part.type === "tool-approval-response") {
2795
2812
  const approvalResponse = part;
@@ -2813,6 +2830,13 @@ async function convertToOpenAIResponsesInput({
2813
2830
  const output = part.output;
2814
2831
  if (output.type === "execution-denied") {
2815
2832
  const approvalId = (_l = (_k = output.providerOptions) == null ? void 0 : _k.openai) == null ? void 0 : _l.approvalId;
2833
+ console.log("CALDEBUG [convertToOpenAIResponsesInput] Found execution-denied:", {
2834
+ toolCallId: part.toolCallId,
2835
+ toolName: part.toolName,
2836
+ hasApprovalId: !!approvalId,
2837
+ approvalId,
2838
+ willSkip: !!approvalId
2839
+ });
2816
2840
  if (approvalId) {
2817
2841
  continue;
2818
2842
  }
@@ -2922,6 +2946,15 @@ async function convertToOpenAIResponsesInput({
2922
2946
  }
2923
2947
  }
2924
2948
  }
2949
+ console.log("CALDEBUG [convertToOpenAIResponsesInput] Final input:", {
2950
+ inputLength: input.length,
2951
+ inputTypes: input.map((item) => item.type || item.role),
2952
+ hasItemReferences: input.some((item) => item.type === "item_reference"),
2953
+ itemReferences: input.filter((item) => item.type === "item_reference").map((item) => ({
2954
+ type: item.type,
2955
+ id: typeof item.id === "string" ? item.id.substring(0, 20) + "..." : item.id
2956
+ }))
2957
+ });
2925
2958
  return { input, warnings };
2926
2959
  }
2927
2960
  var openaiResponsesReasoningProviderOptionsSchema = z18.object({
@@ -5875,7 +5908,7 @@ var OpenAITranscriptionModel = class {
5875
5908
  };
5876
5909
 
5877
5910
  // src/version.ts
5878
- var VERSION = true ? "3.0.23" : "0.0.0-test";
5911
+ var VERSION = true ? "3.0.25" : "0.0.0-test";
5879
5912
 
5880
5913
  // src/openai-provider.ts
5881
5914
  function createOpenAI(options = {}) {