claudish 5.7.0 → 5.7.1
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.js +17 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31836,7 +31836,7 @@ async function fetchGLMCodingModels() {
|
|
|
31836
31836
|
return [];
|
|
31837
31837
|
}
|
|
31838
31838
|
}
|
|
31839
|
-
var __filename4, __dirname4, VERSION = "5.7.
|
|
31839
|
+
var __filename4, __dirname4, VERSION = "5.7.1", CACHE_MAX_AGE_DAYS2 = 2, MODELS_JSON_PATH, CLAUDISH_CACHE_DIR2, ALL_MODELS_JSON_PATH;
|
|
31840
31840
|
var init_cli = __esm(() => {
|
|
31841
31841
|
init_config();
|
|
31842
31842
|
init_model_loader();
|
|
@@ -64925,7 +64925,21 @@ var init_anthropic_passthrough_adapter = __esm(() => {
|
|
|
64925
64925
|
return "AnthropicPassthroughAdapter";
|
|
64926
64926
|
}
|
|
64927
64927
|
convertMessages(claudeRequest, _filterFn) {
|
|
64928
|
-
|
|
64928
|
+
const messages = claudeRequest.messages || [];
|
|
64929
|
+
return messages.map((msg) => this.stripUnsupportedContentTypes(msg));
|
|
64930
|
+
}
|
|
64931
|
+
stripUnsupportedContentTypes(message) {
|
|
64932
|
+
if (!message.content || !Array.isArray(message.content)) {
|
|
64933
|
+
return message;
|
|
64934
|
+
}
|
|
64935
|
+
const filteredContent = message.content.map((block) => {
|
|
64936
|
+
if (block.type === "tool_result" && Array.isArray(block.content)) {
|
|
64937
|
+
const filtered = block.content.filter((c) => c.type !== "tool_reference");
|
|
64938
|
+
return { ...block, content: filtered.length > 0 ? filtered : [{ type: "text", text: "" }] };
|
|
64939
|
+
}
|
|
64940
|
+
return block;
|
|
64941
|
+
}).filter((block) => block.type !== "tool_reference");
|
|
64942
|
+
return { ...message, content: filteredContent };
|
|
64929
64943
|
}
|
|
64930
64944
|
convertTools(claudeRequest, _summarize) {
|
|
64931
64945
|
return claudeRequest.tools || [];
|
|
@@ -65241,7 +65255,7 @@ async function createProxyServer(port, openrouterApiKey, model, monitorMode = fa
|
|
|
65241
65255
|
const poeHandlers = new Map;
|
|
65242
65256
|
const getOpenRouterHandler = (targetModel) => {
|
|
65243
65257
|
const parsed = parseModelSpec(targetModel);
|
|
65244
|
-
const modelId =
|
|
65258
|
+
const modelId = targetModel.includes("@") ? parsed.model : targetModel;
|
|
65245
65259
|
if (!openRouterHandlers.has(modelId)) {
|
|
65246
65260
|
const orProvider = new OpenRouterProvider(openrouterApiKey || "");
|
|
65247
65261
|
const orAdapter = new OpenRouterAdapter(modelId);
|