@jcanizalez7/clauxy 0.1.7 → 0.1.9

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.
Files changed (2) hide show
  1. package/dist/cli.js +21 -8
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1124,13 +1124,6 @@ function convertMessages(anthropicMessages, system) {
1124
1124
  ...toolCalls.length > 0 && { tool_calls: toolCalls }
1125
1125
  });
1126
1126
  } else {
1127
- if (textBlocks.length > 0) {
1128
- messages.push({
1129
- role: "user",
1130
- content: textBlocks.map((b) => b.text).join(`
1131
- `)
1132
- });
1133
- }
1134
1127
  for (const toolResult of toolResultBlocks) {
1135
1128
  messages.push({
1136
1129
  role: "tool",
@@ -1138,6 +1131,13 @@ function convertMessages(anthropicMessages, system) {
1138
1131
  tool_call_id: toolResult.tool_use_id || ""
1139
1132
  });
1140
1133
  }
1134
+ if (textBlocks.length > 0) {
1135
+ messages.push({
1136
+ role: "user",
1137
+ content: textBlocks.map((b) => b.text).join(`
1138
+ `)
1139
+ });
1140
+ }
1141
1141
  }
1142
1142
  }
1143
1143
  }
@@ -2077,6 +2077,19 @@ async function loadProvider() {
2077
2077
  return await getProvider(providerId);
2078
2078
  }
2079
2079
  function convertAnthropicToOpenAI(anthropicReq) {
2080
+ if (currentLogLevel === "debug") {
2081
+ for (let i = 0;i < anthropicReq.messages.length; i++) {
2082
+ const msg = anthropicReq.messages[i];
2083
+ if (Array.isArray(msg.content)) {
2084
+ const toolUses = msg.content.filter((b) => b.type === "tool_use").map((b) => b.id);
2085
+ const toolResults = msg.content.filter((b) => b.type === "tool_result").map((b) => b.tool_use_id);
2086
+ if (toolUses.length > 0)
2087
+ log.debug(`msg[${i}] ${msg.role}: tool_use ids: ${toolUses.join(", ")}`);
2088
+ if (toolResults.length > 0)
2089
+ log.debug(`msg[${i}] ${msg.role}: tool_result ids: ${toolResults.join(", ")}`);
2090
+ }
2091
+ }
2092
+ }
2080
2093
  const messages = convertMessages(anthropicReq.messages, anthropicReq.system);
2081
2094
  const tools = convertTools(anthropicReq.tools);
2082
2095
  const mappedModel = provider.mapModel(anthropicReq.model);
@@ -2621,7 +2634,7 @@ Models configured:`);
2621
2634
  // package.json
2622
2635
  var package_default = {
2623
2636
  name: "@jcanizalez7/clauxy",
2624
- version: "0.1.7",
2637
+ version: "0.1.9",
2625
2638
  description: "Multi-provider AI proxy for Claude Code (GitHub Copilot, ChatGPT Plus, Google Gemini)",
2626
2639
  type: "module",
2627
2640
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcanizalez7/clauxy",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Multi-provider AI proxy for Claude Code (GitHub Copilot, ChatGPT Plus, Google Gemini)",
5
5
  "type": "module",
6
6
  "bin": {