claudish 4.2.0 → 4.2.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 +16 -22
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28165,9 +28165,9 @@ var init_profile_config = __esm(() => {
|
|
|
28165
28165
|
name: "default",
|
|
28166
28166
|
description: "Default profile - balanced performance and cost",
|
|
28167
28167
|
models: {
|
|
28168
|
-
opus: "
|
|
28169
|
-
sonnet: "
|
|
28170
|
-
haiku: "
|
|
28168
|
+
opus: "xai@grok-4-0709",
|
|
28169
|
+
sonnet: "xai@grok-4-1-fast-reasoning",
|
|
28170
|
+
haiku: "xai@grok-code-fast-1"
|
|
28171
28171
|
},
|
|
28172
28172
|
createdAt: new Date().toISOString(),
|
|
28173
28173
|
updatedAt: new Date().toISOString()
|
|
@@ -31263,14 +31263,18 @@ async function runClaudeWithProxy(config3, proxyUrl) {
|
|
|
31263
31263
|
...process.env,
|
|
31264
31264
|
ANTHROPIC_BASE_URL: proxyUrl,
|
|
31265
31265
|
[ENV.CLAUDISH_ACTIVE_MODEL_NAME]: modelId,
|
|
31266
|
-
CLAUDISH_IS_LOCAL: isLocalModel ? "true" : "false"
|
|
31267
|
-
[ENV.ANTHROPIC_MODEL]: modelId,
|
|
31268
|
-
[ENV.ANTHROPIC_SMALL_FAST_MODEL]: modelId
|
|
31266
|
+
CLAUDISH_IS_LOCAL: isLocalModel ? "true" : "false"
|
|
31269
31267
|
};
|
|
31270
31268
|
if (config3.monitor) {
|
|
31271
31269
|
delete env.ANTHROPIC_API_KEY;
|
|
31272
31270
|
delete env.ANTHROPIC_AUTH_TOKEN;
|
|
31271
|
+
if (modelId && modelId !== "unknown") {
|
|
31272
|
+
env[ENV.ANTHROPIC_MODEL] = modelId;
|
|
31273
|
+
env[ENV.ANTHROPIC_SMALL_FAST_MODEL] = modelId;
|
|
31274
|
+
}
|
|
31273
31275
|
} else {
|
|
31276
|
+
env[ENV.ANTHROPIC_MODEL] = modelId;
|
|
31277
|
+
env[ENV.ANTHROPIC_SMALL_FAST_MODEL] = modelId;
|
|
31274
31278
|
env.ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY || "sk-ant-api03-placeholder-not-used-proxy-handles-auth-with-openrouter-key-xxxxxxxxxxxxxxxxxxxxx";
|
|
31275
31279
|
env.ANTHROPIC_AUTH_TOKEN = process.env.ANTHROPIC_AUTH_TOKEN || "placeholder-token-not-used-proxy-handles-auth";
|
|
31276
31280
|
}
|
|
@@ -32656,14 +32660,11 @@ async function parseArgs(args) {
|
|
|
32656
32660
|
if (config3.monitor) {
|
|
32657
32661
|
if (process.env.ANTHROPIC_API_KEY && process.env.ANTHROPIC_API_KEY.includes("placeholder")) {
|
|
32658
32662
|
delete process.env.ANTHROPIC_API_KEY;
|
|
32659
|
-
if (!config3.quiet) {
|
|
32660
|
-
console.log("[claudish] Removed placeholder API key - Claude Code will use native authentication");
|
|
32661
|
-
}
|
|
32662
32663
|
}
|
|
32663
32664
|
if (!config3.quiet) {
|
|
32664
32665
|
console.log("[claudish] Monitor mode enabled - proxying to real Anthropic API");
|
|
32665
|
-
console.log("[claudish]
|
|
32666
|
-
console.log("[claudish]
|
|
32666
|
+
console.log("[claudish] Using Claude Code's native authentication");
|
|
32667
|
+
console.log("[claudish] Tip: Run with --debug to see request/response details");
|
|
32667
32668
|
}
|
|
32668
32669
|
}
|
|
32669
32670
|
config3.openrouterApiKey = process.env[ENV.OPENROUTER_API_KEY];
|
|
@@ -33658,7 +33659,7 @@ async function fetchZenModels() {
|
|
|
33658
33659
|
return [];
|
|
33659
33660
|
}
|
|
33660
33661
|
}
|
|
33661
|
-
var __filename5, __dirname5, VERSION = "4.2.
|
|
33662
|
+
var __filename5, __dirname5, VERSION = "4.2.1", CACHE_MAX_AGE_DAYS3 = 2, MODELS_JSON_PATH, CLAUDISH_CACHE_DIR3, ALL_MODELS_JSON_PATH2;
|
|
33662
33663
|
var init_cli = __esm(() => {
|
|
33663
33664
|
init_config();
|
|
33664
33665
|
init_model_loader();
|
|
@@ -35916,20 +35917,15 @@ class NativeHandler {
|
|
|
35916
35917
|
baseUrl;
|
|
35917
35918
|
constructor(apiKey) {
|
|
35918
35919
|
this.apiKey = apiKey;
|
|
35919
|
-
this.baseUrl =
|
|
35920
|
+
this.baseUrl = "https://api.anthropic.com";
|
|
35920
35921
|
}
|
|
35921
35922
|
async handle(c, payload) {
|
|
35922
35923
|
const originalHeaders = c.req.header();
|
|
35923
35924
|
const target = payload.model;
|
|
35924
35925
|
log(`
|
|
35925
35926
|
=== [NATIVE] Claude Code → Anthropic API Request ===`);
|
|
35926
|
-
|
|
35927
|
-
|
|
35928
|
-
log("[Native] WARNING: No API key found in headers!");
|
|
35929
|
-
log("[Native] Looking for: x-api-key or authorization header");
|
|
35930
|
-
} else {
|
|
35931
|
-
log(`API Key found: ${maskCredential(extractedApiKey)}`);
|
|
35932
|
-
}
|
|
35927
|
+
log(`[Native] x-api-key: ${originalHeaders["x-api-key"] ? maskCredential(originalHeaders["x-api-key"]) : "(not set)"}`);
|
|
35928
|
+
log(`[Native] authorization: ${originalHeaders["authorization"] ? maskCredential(originalHeaders["authorization"]) : "(not set)"}`);
|
|
35933
35929
|
log(`Request body (Model: ${target}):`);
|
|
35934
35930
|
log(`=== End Request ===
|
|
35935
35931
|
`);
|
|
@@ -35942,8 +35938,6 @@ class NativeHandler {
|
|
|
35942
35938
|
}
|
|
35943
35939
|
if (originalHeaders["x-api-key"]) {
|
|
35944
35940
|
headers["x-api-key"] = originalHeaders["x-api-key"];
|
|
35945
|
-
} else if (extractedApiKey) {
|
|
35946
|
-
headers["x-api-key"] = extractedApiKey;
|
|
35947
35941
|
}
|
|
35948
35942
|
if (originalHeaders["anthropic-beta"]) {
|
|
35949
35943
|
headers["anthropic-beta"] = originalHeaders["anthropic-beta"];
|