claudish 7.16.0 → 7.17.0
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 +37 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -581,7 +581,7 @@ var init_onepassword_config = __esm(() => {
|
|
|
581
581
|
});
|
|
582
582
|
|
|
583
583
|
// src/version.ts
|
|
584
|
-
var VERSION = "7.
|
|
584
|
+
var VERSION = "7.17.0";
|
|
585
585
|
|
|
586
586
|
// src/logger.ts
|
|
587
587
|
var exports_logger = {};
|
|
@@ -58695,6 +58695,7 @@ var init_config = __esm(() => {
|
|
|
58695
58695
|
ANTHROPIC_DEFAULT_SONNET_MODEL: "ANTHROPIC_DEFAULT_SONNET_MODEL",
|
|
58696
58696
|
ANTHROPIC_DEFAULT_HAIKU_MODEL: "ANTHROPIC_DEFAULT_HAIKU_MODEL",
|
|
58697
58697
|
CLAUDE_CODE_SUBAGENT_MODEL: "CLAUDE_CODE_SUBAGENT_MODEL",
|
|
58698
|
+
CLAUDE_CODE_AUTO_COMPACT_WINDOW: "CLAUDE_CODE_AUTO_COMPACT_WINDOW",
|
|
58698
58699
|
OLLAMA_BASE_URL: "OLLAMA_BASE_URL",
|
|
58699
58700
|
OLLAMA_HOST: "OLLAMA_HOST",
|
|
58700
58701
|
LMSTUDIO_BASE_URL: "LMSTUDIO_BASE_URL",
|
|
@@ -71380,6 +71381,7 @@ __export(exports_claude_runner, {
|
|
|
71380
71381
|
runClaudeWithProxy: () => runClaudeWithProxy,
|
|
71381
71382
|
managedSettingsForcesClaudeAi: () => managedSettingsForcesClaudeAi,
|
|
71382
71383
|
isProxyAuthMode: () => isProxyAuthMode,
|
|
71384
|
+
computeMainThreadContextWindow: () => computeMainThreadContextWindow,
|
|
71383
71385
|
checkClaudeInstalled: () => checkClaudeInstalled,
|
|
71384
71386
|
buildClaudishSettingsOverlay: () => buildClaudishSettingsOverlay
|
|
71385
71387
|
});
|
|
@@ -71598,6 +71600,29 @@ function mergeUserSettingsIfPresent(config3, tempSettingsPath, statusLine, proxy
|
|
|
71598
71600
|
}
|
|
71599
71601
|
config3.claudeArgs.splice(idx, 2);
|
|
71600
71602
|
}
|
|
71603
|
+
async function computeMainThreadContextWindow(config3, cachePath) {
|
|
71604
|
+
const specs = [config3.model, config3.modelOpus, config3.modelSonnet].filter((s) => typeof s === "string" && s.length > 0);
|
|
71605
|
+
if (specs.length === 0)
|
|
71606
|
+
return 0;
|
|
71607
|
+
let min = Number.POSITIVE_INFINITY;
|
|
71608
|
+
for (const spec of specs) {
|
|
71609
|
+
try {
|
|
71610
|
+
const parsed = parseModelSpec(spec);
|
|
71611
|
+
let provider = parsed.provider;
|
|
71612
|
+
if (!parsed.isExplicitProvider) {
|
|
71613
|
+
const plan = await route(spec);
|
|
71614
|
+
if (plan.kind !== "ok")
|
|
71615
|
+
continue;
|
|
71616
|
+
provider = plan.primary.provider;
|
|
71617
|
+
}
|
|
71618
|
+
const win = lookupModelForProvider(parsed.model, provider, cachePath);
|
|
71619
|
+
if (typeof win === "number" && win > 0) {
|
|
71620
|
+
min = Math.min(min, win);
|
|
71621
|
+
}
|
|
71622
|
+
} catch {}
|
|
71623
|
+
}
|
|
71624
|
+
return Number.isFinite(min) ? min : 0;
|
|
71625
|
+
}
|
|
71601
71626
|
async function runClaudeWithProxy(config3, proxyUrl, onCleanup) {
|
|
71602
71627
|
const hasProfileMappings = config3.modelOpus || config3.modelSonnet || config3.modelHaiku || config3.modelSubagent;
|
|
71603
71628
|
const modelId = config3.model || (hasProfileMappings || config3.monitor ? undefined : "unknown");
|
|
@@ -71662,6 +71687,15 @@ async function runClaudeWithProxy(config3, proxyUrl, onCleanup) {
|
|
|
71662
71687
|
if (hasNativeAnthropicMapping(config3)) {} else {
|
|
71663
71688
|
env.ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY || "sk-ant-api03-placeholder-not-used-proxy-handles-auth-with-openrouter-key-xxxxxxxxxxxxxxxxxxxxx";
|
|
71664
71689
|
env.ANTHROPIC_AUTH_TOKEN = process.env.ANTHROPIC_AUTH_TOKEN || "placeholder-token-not-used-proxy-handles-auth";
|
|
71690
|
+
if (!process.env[ENV.CLAUDE_CODE_AUTO_COMPACT_WINDOW]) {
|
|
71691
|
+
const autoCompactWindow = await computeMainThreadContextWindow(config3);
|
|
71692
|
+
if (autoCompactWindow > 0) {
|
|
71693
|
+
env[ENV.CLAUDE_CODE_AUTO_COMPACT_WINDOW] = String(autoCompactWindow);
|
|
71694
|
+
if (!config3.quiet) {
|
|
71695
|
+
console.error(`[claudish] Auto-compact window: ${autoCompactWindow.toLocaleString()} tokens ` + "(Claude Code compacts before the backend's real limit)");
|
|
71696
|
+
}
|
|
71697
|
+
}
|
|
71698
|
+
}
|
|
71665
71699
|
}
|
|
71666
71700
|
}
|
|
71667
71701
|
const log2 = (message) => {
|
|
@@ -71835,8 +71869,10 @@ async function checkClaudeInstalled() {
|
|
|
71835
71869
|
return binary !== null;
|
|
71836
71870
|
}
|
|
71837
71871
|
var init_claude_runner = __esm(() => {
|
|
71872
|
+
init_model_catalog();
|
|
71838
71873
|
init_config();
|
|
71839
71874
|
init_model_parser();
|
|
71875
|
+
init_routing_rules();
|
|
71840
71876
|
init_telemetry();
|
|
71841
71877
|
});
|
|
71842
71878
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudish",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.17.0",
|
|
4
4
|
"description": "Run Claude Code with any model - OpenRouter, Ollama, LM Studio & local models",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"ai"
|
|
61
61
|
],
|
|
62
62
|
"optionalDependencies": {
|
|
63
|
-
"@claudish/magmux-darwin-arm64": "7.
|
|
64
|
-
"@claudish/magmux-darwin-x64": "7.
|
|
65
|
-
"@claudish/magmux-linux-arm64": "7.
|
|
66
|
-
"@claudish/magmux-linux-x64": "7.
|
|
63
|
+
"@claudish/magmux-darwin-arm64": "7.17.0",
|
|
64
|
+
"@claudish/magmux-darwin-x64": "7.17.0",
|
|
65
|
+
"@claudish/magmux-linux-arm64": "7.17.0",
|
|
66
|
+
"@claudish/magmux-linux-x64": "7.17.0"
|
|
67
67
|
},
|
|
68
68
|
"author": "Jack Rudenko <i@madappgang.com>",
|
|
69
69
|
"license": "MIT",
|