claudish 14.16.1 → 14.16.2
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 +110 -41
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -5491,7 +5491,7 @@ var init_onepassword_config = __esm(() => {
|
|
|
5491
5491
|
});
|
|
5492
5492
|
|
|
5493
5493
|
// src/version.ts
|
|
5494
|
-
var VERSION = "14.16.
|
|
5494
|
+
var VERSION = "14.16.2";
|
|
5495
5495
|
|
|
5496
5496
|
// src/redact.ts
|
|
5497
5497
|
function isPlaceholder(value) {
|
|
@@ -12187,6 +12187,8 @@ function stripVendorPrefix(lowerId) {
|
|
|
12187
12187
|
return lowerId.includes("/") ? lowerId.substring(lowerId.lastIndexOf("/") + 1) : lowerId;
|
|
12188
12188
|
}
|
|
12189
12189
|
function findCacheEntry(modelId, cachePath) {
|
|
12190
|
+
if (modelId.startsWith("@"))
|
|
12191
|
+
return;
|
|
12190
12192
|
if (modelId.includes("@")) {
|
|
12191
12193
|
throw new Error(`model-catalog lookup received provider-routed ID "${modelId}" \u2014 callers must strip the "@" prefix before calling`);
|
|
12192
12194
|
}
|
|
@@ -53111,10 +53113,18 @@ function createAnthropicPassthroughStream(c, response, opts) {
|
|
|
53111
53113
|
let pendingEventLine = null;
|
|
53112
53114
|
let inputTokens = 0;
|
|
53113
53115
|
let outputTokens = 0;
|
|
53116
|
+
let cacheReadTokens = 0;
|
|
53117
|
+
let cacheCreationTokens = 0;
|
|
53114
53118
|
let stopReason = null;
|
|
53115
53119
|
let sawMessageStart = false;
|
|
53116
53120
|
let sawMessageStop = false;
|
|
53117
53121
|
let openBlockIndex = null;
|
|
53122
|
+
const reportUsage = () => {
|
|
53123
|
+
opts.onTokenUpdate?.(inputTokens + cacheReadTokens + cacheCreationTokens, outputTokens, {
|
|
53124
|
+
cacheReadTokens,
|
|
53125
|
+
cacheCreationTokens
|
|
53126
|
+
});
|
|
53127
|
+
};
|
|
53118
53128
|
const noteLifecycle = (data, emittedIndex) => {
|
|
53119
53129
|
switch (data?.type) {
|
|
53120
53130
|
case "message_start":
|
|
@@ -53191,10 +53201,10 @@ data: ${JSON.stringify(data)}
|
|
|
53191
53201
|
} catch {}
|
|
53192
53202
|
};
|
|
53193
53203
|
const endCancelled = () => {
|
|
53194
|
-
const sawUsage = inputTokens > 0 || outputTokens > 0;
|
|
53204
|
+
const sawUsage = inputTokens > 0 || outputTokens > 0 || cacheReadTokens > 0 || cacheCreationTokens > 0;
|
|
53195
53205
|
log(`[AnthropicSSE] Client cancelled the stream for ${opts.modelName}; usage ${sawUsage ? "reported" : "not received, not recorded"}`);
|
|
53196
53206
|
if (sawUsage)
|
|
53197
|
-
|
|
53207
|
+
reportUsage();
|
|
53198
53208
|
if (pingInterval) {
|
|
53199
53209
|
clearInterval(pingInterval);
|
|
53200
53210
|
pingInterval = null;
|
|
@@ -53356,10 +53366,14 @@ data: ${JSON.stringify({
|
|
|
53356
53366
|
if (data.message?.usage) {
|
|
53357
53367
|
inputTokens = data.message.usage.input_tokens || inputTokens;
|
|
53358
53368
|
outputTokens = data.message.usage.output_tokens || outputTokens;
|
|
53369
|
+
cacheReadTokens = data.message.usage.cache_read_input_tokens || cacheReadTokens;
|
|
53370
|
+
cacheCreationTokens = data.message.usage.cache_creation_input_tokens || cacheCreationTokens;
|
|
53359
53371
|
}
|
|
53360
53372
|
if (data.usage) {
|
|
53361
53373
|
inputTokens = data.usage.input_tokens || inputTokens;
|
|
53362
53374
|
outputTokens = data.usage.output_tokens || outputTokens;
|
|
53375
|
+
cacheReadTokens = data.usage.cache_read_input_tokens || cacheReadTokens;
|
|
53376
|
+
cacheCreationTokens = data.usage.cache_creation_input_tokens || cacheCreationTokens;
|
|
53363
53377
|
}
|
|
53364
53378
|
if (data.type === "content_block_delta" && data.delta?.type === "text_delta") {
|
|
53365
53379
|
const txt = data.delta.text || "";
|
|
@@ -53398,10 +53412,14 @@ data: ${JSON.stringify({
|
|
|
53398
53412
|
if (data.message?.usage) {
|
|
53399
53413
|
inputTokens = data.message.usage.input_tokens || inputTokens;
|
|
53400
53414
|
outputTokens = data.message.usage.output_tokens || outputTokens;
|
|
53415
|
+
cacheReadTokens = data.message.usage.cache_read_input_tokens || cacheReadTokens;
|
|
53416
|
+
cacheCreationTokens = data.message.usage.cache_creation_input_tokens || cacheCreationTokens;
|
|
53401
53417
|
}
|
|
53402
53418
|
if (data.usage) {
|
|
53403
53419
|
inputTokens = data.usage.input_tokens || inputTokens;
|
|
53404
53420
|
outputTokens = data.usage.output_tokens || outputTokens;
|
|
53421
|
+
cacheReadTokens = data.usage.cache_read_input_tokens || cacheReadTokens;
|
|
53422
|
+
cacheCreationTokens = data.usage.cache_creation_input_tokens || cacheCreationTokens;
|
|
53405
53423
|
}
|
|
53406
53424
|
if (data.type === "content_block_delta" && data.delta?.type === "text_delta") {
|
|
53407
53425
|
textChunks++;
|
|
@@ -53423,9 +53441,7 @@ data: ${JSON.stringify({
|
|
|
53423
53441
|
return;
|
|
53424
53442
|
}
|
|
53425
53443
|
log(`[AnthropicSSE] Stream complete for ${opts.modelName}: ${totalLines} lines, ${textChunks} text chunks, ${toolUseBlocks} tool_use blocks, stop_reason=${stopReason}${filterThinking ? `, filtered ${thinkingBlocksSuppressed} thinking blocks` : ""}`);
|
|
53426
|
-
|
|
53427
|
-
opts.onTokenUpdate(inputTokens, outputTokens);
|
|
53428
|
-
}
|
|
53444
|
+
reportUsage();
|
|
53429
53445
|
if (!isClosed) {
|
|
53430
53446
|
isClosed = true;
|
|
53431
53447
|
if (pingInterval) {
|
|
@@ -53442,7 +53458,7 @@ data: ${JSON.stringify({
|
|
|
53442
53458
|
log(`[AnthropicSSE] Stream error: ${e}`);
|
|
53443
53459
|
finalizeAbandonedStream(controller);
|
|
53444
53460
|
try {
|
|
53445
|
-
|
|
53461
|
+
reportUsage();
|
|
53446
53462
|
} catch {}
|
|
53447
53463
|
if (!isClosed) {
|
|
53448
53464
|
isClosed = true;
|
|
@@ -54617,6 +54633,13 @@ var init_stall_guard = __esm(() => {
|
|
|
54617
54633
|
});
|
|
54618
54634
|
|
|
54619
54635
|
// src/handlers/shared/stream-parsers/responses/responses-leg.ts
|
|
54636
|
+
function hasReplayableReasoning(item) {
|
|
54637
|
+
if (item?.type !== "reasoning")
|
|
54638
|
+
return false;
|
|
54639
|
+
if (item.encrypted_content)
|
|
54640
|
+
return true;
|
|
54641
|
+
return Array.isArray(item.content) && item.content.length > 0;
|
|
54642
|
+
}
|
|
54620
54643
|
function readUsage(raw, prior, keepPrior = false) {
|
|
54621
54644
|
if (!raw || typeof raw !== "object")
|
|
54622
54645
|
return;
|
|
@@ -54945,7 +54968,7 @@ class ResponsesLeg {
|
|
|
54945
54968
|
if (typeof item.phase === "string")
|
|
54946
54969
|
message.phase = item.phase;
|
|
54947
54970
|
this.items.push(message);
|
|
54948
|
-
} else if (item
|
|
54971
|
+
} else if (hasReplayableReasoning(item)) {
|
|
54949
54972
|
this.items.push({
|
|
54950
54973
|
type: "reasoning",
|
|
54951
54974
|
content: item.content ?? [],
|
|
@@ -55040,7 +55063,7 @@ class ResponsesLeg {
|
|
|
55040
55063
|
}
|
|
55041
55064
|
onItemDone(event) {
|
|
55042
55065
|
const item = event.item;
|
|
55043
|
-
if (item
|
|
55066
|
+
if (hasReplayableReasoning(item)) {
|
|
55044
55067
|
this.pendingReasoning.push({
|
|
55045
55068
|
type: "reasoning",
|
|
55046
55069
|
content: item.content ?? [],
|
|
@@ -55655,8 +55678,9 @@ var init_token_file = __esm(() => {
|
|
|
55655
55678
|
import { mkdirSync as mkdirSync16, writeFileSync as writeFileSync12 } from "fs";
|
|
55656
55679
|
import { dirname as dirname13 } from "path";
|
|
55657
55680
|
function stripProviderPrefix(name) {
|
|
55658
|
-
|
|
55659
|
-
|
|
55681
|
+
if (!hasProviderPrefix(name))
|
|
55682
|
+
return name;
|
|
55683
|
+
return name.slice(name.indexOf("@") + 1);
|
|
55660
55684
|
}
|
|
55661
55685
|
function computeCacheReadDiscount(pricing, billedInputTokens, detail) {
|
|
55662
55686
|
const cacheReadTokens = detail?.cacheReadTokens ?? 0;
|
|
@@ -55905,6 +55929,7 @@ var init_token_tracker = __esm(() => {
|
|
|
55905
55929
|
init_tool_name_utils();
|
|
55906
55930
|
init_types2();
|
|
55907
55931
|
init_logger();
|
|
55932
|
+
init_model_parser();
|
|
55908
55933
|
init_token_file();
|
|
55909
55934
|
init_remote_provider_types();
|
|
55910
55935
|
ALLOWANCE_LABEL_STALE_MS = 10 * 60 * 1000;
|
|
@@ -55990,8 +56015,8 @@ class ComposedHandler {
|
|
|
55990
56015
|
pendingFallbackMeta;
|
|
55991
56016
|
lastPlanPollAt = 0;
|
|
55992
56017
|
constructor(provider, targetModel, modelName, port, options = {}) {
|
|
55993
|
-
if (modelName
|
|
55994
|
-
throw new Error(`ComposedHandler: modelName must not contain
|
|
56018
|
+
if (hasProviderPrefix(modelName)) {
|
|
56019
|
+
throw new Error(`ComposedHandler: modelName must not contain a provider prefix (got "${modelName}"). Strip the provider routing prefix before passing modelName. If you need the full routed form, pass it as targetModel.`);
|
|
55995
56020
|
}
|
|
55996
56021
|
this.provider = provider;
|
|
55997
56022
|
this.targetModel = targetModel;
|
|
@@ -56547,7 +56572,7 @@ class ComposedHandler {
|
|
|
56547
56572
|
}));
|
|
56548
56573
|
}
|
|
56549
56574
|
let requestPayload = adapter.buildPayload(claudeRequest, messages, tools);
|
|
56550
|
-
const extraFields = this.provider.getExtraPayloadFields?.();
|
|
56575
|
+
const extraFields = await this.provider.getExtraPayloadFields?.();
|
|
56551
56576
|
if (extraFields) {
|
|
56552
56577
|
Object.assign(requestPayload, extraFields);
|
|
56553
56578
|
}
|
|
@@ -58051,6 +58076,7 @@ var init_composed_handler = __esm(() => {
|
|
|
58051
58076
|
init_raw();
|
|
58052
58077
|
init_request_stage();
|
|
58053
58078
|
init_logger();
|
|
58079
|
+
init_model_parser();
|
|
58054
58080
|
init_provider_definitions();
|
|
58055
58081
|
init_openai();
|
|
58056
58082
|
init_wire_markers();
|
|
@@ -58638,7 +58664,7 @@ class LiteLLMProviderTransport {
|
|
|
58638
58664
|
exclude
|
|
58639
58665
|
});
|
|
58640
58666
|
}
|
|
58641
|
-
getExtraPayloadFields() {
|
|
58667
|
+
async getExtraPayloadFields() {
|
|
58642
58668
|
const fields = {};
|
|
58643
58669
|
const extraHeaders = this.getExtraHeaders();
|
|
58644
58670
|
if (extraHeaders) {
|
|
@@ -61230,6 +61256,9 @@ var init_provider_definitions = __esm(() => {
|
|
|
61230
61256
|
});
|
|
61231
61257
|
|
|
61232
61258
|
// src/providers/model-parser.ts
|
|
61259
|
+
function hasProviderPrefix(spec) {
|
|
61260
|
+
return PROVIDER_PREFIX.test(spec);
|
|
61261
|
+
}
|
|
61233
61262
|
function parseModelChain(modelSpec) {
|
|
61234
61263
|
const parts = modelSpec.split(MODEL_CHAIN_SEPARATOR).map((s) => s.trim()).filter(Boolean);
|
|
61235
61264
|
const merged = [];
|
|
@@ -61363,12 +61392,13 @@ function getLegacySyntaxWarning(parsed) {
|
|
|
61363
61392
|
return `Deprecation warning: "${parsed.original}" uses legacy prefix syntax.
|
|
61364
61393
|
` + ` Consider using: ${newSyntax}`;
|
|
61365
61394
|
}
|
|
61366
|
-
var AUTO_ROUTE_PROVIDER = "auto-route", PROVIDER_SHORTCUTS, LOCAL_PROVIDERS, NATIVE_MODEL_PATTERNS, LEGACY_PREFIX_PATTERNS, MODEL_CHAIN_SEPARATOR = "+", MODE_MARKER_SEGMENT;
|
|
61395
|
+
var AUTO_ROUTE_PROVIDER = "auto-route", PROVIDER_SHORTCUTS, PROVIDER_PREFIX, LOCAL_PROVIDERS, NATIVE_MODEL_PATTERNS, LEGACY_PREFIX_PATTERNS, MODEL_CHAIN_SEPARATOR = "+", MODE_MARKER_SEGMENT;
|
|
61367
61396
|
var init_model_parser = __esm(() => {
|
|
61368
61397
|
init_claude_code_aliases();
|
|
61369
61398
|
init_provider_definitions();
|
|
61370
61399
|
init_wire_markers();
|
|
61371
61400
|
PROVIDER_SHORTCUTS = getShortcuts();
|
|
61401
|
+
PROVIDER_PREFIX = /^[^@]+@/;
|
|
61372
61402
|
LOCAL_PROVIDERS = {
|
|
61373
61403
|
has(name) {
|
|
61374
61404
|
return isLocalTransport(name);
|
|
@@ -72834,6 +72864,8 @@ async function applyCandidateFilters(explanation, candidates) {
|
|
|
72834
72864
|
}
|
|
72835
72865
|
}
|
|
72836
72866
|
function wireIdOf(route) {
|
|
72867
|
+
if (route.provider === "openrouter")
|
|
72868
|
+
return route.modelSpec;
|
|
72837
72869
|
const at = route.modelSpec.indexOf("@");
|
|
72838
72870
|
return at === -1 ? route.modelSpec : route.modelSpec.slice(at + 1);
|
|
72839
72871
|
}
|
|
@@ -73420,7 +73452,7 @@ function normalizePinnedSpec(r) {
|
|
|
73420
73452
|
const spec = r.modelSpec?.trim();
|
|
73421
73453
|
if (!spec)
|
|
73422
73454
|
return null;
|
|
73423
|
-
if (spec
|
|
73455
|
+
if (hasProviderPrefix(spec))
|
|
73424
73456
|
return spec;
|
|
73425
73457
|
if (spec.startsWith("http://") || spec.startsWith("https://"))
|
|
73426
73458
|
return spec;
|
|
@@ -83299,7 +83331,7 @@ var init_probe_live = __esm(() => {
|
|
|
83299
83331
|
function pinProbeModelSpec(link) {
|
|
83300
83332
|
if (link.provider === "native-anthropic")
|
|
83301
83333
|
return link.modelSpec;
|
|
83302
|
-
return link.modelSpec
|
|
83334
|
+
return hasProviderPrefix(link.modelSpec) ? link.modelSpec : `${link.provider}@${link.modelSpec}`;
|
|
83303
83335
|
}
|
|
83304
83336
|
function droppedRemedy(credentialHint) {
|
|
83305
83337
|
if (!credentialHint)
|
|
@@ -83324,6 +83356,7 @@ function probeProviderRoute(proxyUrl, link, timeoutMs) {
|
|
|
83324
83356
|
}
|
|
83325
83357
|
var INTERACTIVE_PROBE_TIMEOUT_MS = 60000, DROPPED_LABEL;
|
|
83326
83358
|
var init_probe_runner = __esm(() => {
|
|
83359
|
+
init_model_parser();
|
|
83327
83360
|
init_probe_live();
|
|
83328
83361
|
DROPPED_LABEL = {
|
|
83329
83362
|
"no-credential": "no credential",
|
|
@@ -90951,6 +90984,16 @@ var init_local_queue = __esm(() => {
|
|
|
90951
90984
|
|
|
90952
90985
|
// src/providers/transport/local.ts
|
|
90953
90986
|
import { Agent } from "undici";
|
|
90987
|
+
async function hasOllamaTagsShape(response) {
|
|
90988
|
+
if (!response.ok)
|
|
90989
|
+
return false;
|
|
90990
|
+
try {
|
|
90991
|
+
const data = await response.json();
|
|
90992
|
+
return Array.isArray(data?.models);
|
|
90993
|
+
} catch {
|
|
90994
|
+
return false;
|
|
90995
|
+
}
|
|
90996
|
+
}
|
|
90954
90997
|
|
|
90955
90998
|
class LocalTransport {
|
|
90956
90999
|
name;
|
|
@@ -90964,6 +91007,7 @@ class LocalTransport {
|
|
|
90964
91007
|
lastProbeError;
|
|
90965
91008
|
lastProbeUrl;
|
|
90966
91009
|
_contextWindow = 32768;
|
|
91010
|
+
_isOllamaBackend;
|
|
90967
91011
|
constructor(config, modelName, options) {
|
|
90968
91012
|
this.config = config;
|
|
90969
91013
|
this.modelName = modelName;
|
|
@@ -91005,7 +91049,7 @@ class LocalTransport {
|
|
|
91005
91049
|
exclude,
|
|
91006
91050
|
hasApiKey: Boolean(this.config.apiKey)
|
|
91007
91051
|
};
|
|
91008
|
-
if (this.
|
|
91052
|
+
if (await this.isOllamaBackend()) {
|
|
91009
91053
|
return discoverViaOllama(this.config.baseUrl, {
|
|
91010
91054
|
...cacheKey,
|
|
91011
91055
|
key: `ollama:${this.config.baseUrl}`
|
|
@@ -91022,8 +91066,8 @@ class LocalTransport {
|
|
|
91022
91066
|
signal: AbortSignal.timeout(600000)
|
|
91023
91067
|
};
|
|
91024
91068
|
}
|
|
91025
|
-
getExtraPayloadFields() {
|
|
91026
|
-
if (this.
|
|
91069
|
+
async getExtraPayloadFields() {
|
|
91070
|
+
if (await this.isOllamaBackend()) {
|
|
91027
91071
|
const numCtx = Math.max(this._contextWindow, 32768);
|
|
91028
91072
|
log(`[${this.displayName}] Setting num_ctx: ${numCtx} (detected: ${this._contextWindow})`);
|
|
91029
91073
|
return { options: { num_ctx: numCtx } };
|
|
@@ -91052,6 +91096,25 @@ class LocalTransport {
|
|
|
91052
91096
|
getConfig() {
|
|
91053
91097
|
return this.config;
|
|
91054
91098
|
}
|
|
91099
|
+
async isOllamaBackend() {
|
|
91100
|
+
if (this.config.name === "ollama")
|
|
91101
|
+
return true;
|
|
91102
|
+
if (this.config.name !== "custom" && this.config.name in DISPLAY_NAMES2)
|
|
91103
|
+
return false;
|
|
91104
|
+
if (this._isOllamaBackend !== undefined)
|
|
91105
|
+
return this._isOllamaBackend;
|
|
91106
|
+
try {
|
|
91107
|
+
const response = await fetch(`${this.config.baseUrl}/api/tags`, {
|
|
91108
|
+
method: "GET",
|
|
91109
|
+
signal: AbortSignal.timeout(5000)
|
|
91110
|
+
});
|
|
91111
|
+
this._isOllamaBackend = await hasOllamaTagsShape(response);
|
|
91112
|
+
} catch {
|
|
91113
|
+
this._isOllamaBackend = false;
|
|
91114
|
+
}
|
|
91115
|
+
log(`[${this.displayName}] Ollama backend probe (${this.config.baseUrl}): ${this._isOllamaBackend}`);
|
|
91116
|
+
return this._isOllamaBackend;
|
|
91117
|
+
}
|
|
91055
91118
|
async checkHealth() {
|
|
91056
91119
|
if (this.healthChecked)
|
|
91057
91120
|
return this.isHealthy;
|
|
@@ -91064,6 +91127,7 @@ class LocalTransport {
|
|
|
91064
91127
|
method: "GET",
|
|
91065
91128
|
signal: AbortSignal.timeout(5000)
|
|
91066
91129
|
});
|
|
91130
|
+
this._isOllamaBackend ??= await hasOllamaTagsShape(response);
|
|
91067
91131
|
if (response.ok) {
|
|
91068
91132
|
this.isHealthy = true;
|
|
91069
91133
|
this.healthChecked = true;
|
|
@@ -91103,7 +91167,7 @@ class LocalTransport {
|
|
|
91103
91167
|
if (process.env.CLAUDISH_CONTEXT_WINDOW)
|
|
91104
91168
|
return;
|
|
91105
91169
|
log(`[${this.displayName}] Fetching context window...`);
|
|
91106
|
-
if (this.
|
|
91170
|
+
if (await this.isOllamaBackend()) {
|
|
91107
91171
|
await this.fetchOllamaContextWindow();
|
|
91108
91172
|
} else if (this.config.name === "lmstudio") {
|
|
91109
91173
|
await this.fetchLMStudioContextWindow();
|
|
@@ -96110,6 +96174,14 @@ var init_magmux_ui = __esm(() => {
|
|
|
96110
96174
|
};
|
|
96111
96175
|
});
|
|
96112
96176
|
|
|
96177
|
+
// src/signal-exit-code.ts
|
|
96178
|
+
import { constants as constants3 } from "os";
|
|
96179
|
+
function signalExitCode(signal) {
|
|
96180
|
+
const signum = constants3.signals[signal];
|
|
96181
|
+
return typeof signum === "number" ? 128 + signum : 128;
|
|
96182
|
+
}
|
|
96183
|
+
var init_signal_exit_code = () => {};
|
|
96184
|
+
|
|
96113
96185
|
// src/terminal-isolation.ts
|
|
96114
96186
|
import { format as format2 } from "util";
|
|
96115
96187
|
function beginTerminalIsolation(onSuppressed) {
|
|
@@ -97198,7 +97270,7 @@ Or set CLAUDE_PATH to your custom installation:`);
|
|
|
97198
97270
|
setClaudeCodeRunning(false);
|
|
97199
97271
|
const paneExit = wrap?.paneExitCode() ?? null;
|
|
97200
97272
|
resolve({
|
|
97201
|
-
exitCode: paneExit !== null ? paneExit : signal ?
|
|
97273
|
+
exitCode: paneExit !== null ? paneExit : signal ? signalExitCode(signal) : code ?? 1,
|
|
97202
97274
|
exitSignal: signal
|
|
97203
97275
|
});
|
|
97204
97276
|
});
|
|
@@ -97226,6 +97298,7 @@ function sessionOutcomeOf(exitCode) {
|
|
|
97226
97298
|
}
|
|
97227
97299
|
function setupSignalHandlers(proc, tempSettingsPath, quiet, onCleanup) {
|
|
97228
97300
|
const signals = isWindows2() ? ["SIGINT", "SIGTERM"] : ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
97301
|
+
claimSignalExit();
|
|
97229
97302
|
for (const signal of signals) {
|
|
97230
97303
|
process.on(signal, () => {
|
|
97231
97304
|
releaseTerminalIsolation();
|
|
@@ -97242,7 +97315,7 @@ function setupSignalHandlers(proc, tempSettingsPath, quiet, onCleanup) {
|
|
|
97242
97315
|
try {
|
|
97243
97316
|
unlinkSync11(tempSettingsPath);
|
|
97244
97317
|
} catch {}
|
|
97245
|
-
process.exit(
|
|
97318
|
+
process.exit(signalExitCode(signal));
|
|
97246
97319
|
});
|
|
97247
97320
|
}
|
|
97248
97321
|
}
|
|
@@ -97345,7 +97418,7 @@ var restoreTerminal = null, macosKeychainAnthropicMemo, defaultKeychainAnthropic
|
|
|
97345
97418
|
}
|
|
97346
97419
|
macosKeychainAnthropicMemo.set(memoKey, found);
|
|
97347
97420
|
return found;
|
|
97348
|
-
}, CLAUDISH_PLACEHOLDER_API_KEY = "sk-ant-api03-placeholder-not-used-proxy-handles-auth-with-openrouter-key-xxxxxxxxxxxxxxxxxxxxx", CLAUDISH_PLACEHOLDER_AUTH_TOKEN = "placeholder-token-not-used-proxy-handles-auth", STALE_TOKEN_FILE_MS, MAX_TOKEN_FILES_SCANNED = 4000, CLAUDE_CODE_DEFAULT_MAX_CONTEXT = 200000, USER_STATUS_LINE_TIMEOUT_SECONDS = 3, MIN_AUTO_COMPACT_WINDOW = 200000, MAX_AUTO_COMPACT_WINDOW = 1e6, ADVISOR_TOOL_ENV_VAR = "CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL", CLAUDISH_CHILD_ADVISOR_MODEL = "sonnet", CHILD_STDERR_NOISE
|
|
97421
|
+
}, CLAUDISH_PLACEHOLDER_API_KEY = "sk-ant-api03-placeholder-not-used-proxy-handles-auth-with-openrouter-key-xxxxxxxxxxxxxxxxxxxxx", CLAUDISH_PLACEHOLDER_AUTH_TOKEN = "placeholder-token-not-used-proxy-handles-auth", STALE_TOKEN_FILE_MS, MAX_TOKEN_FILES_SCANNED = 4000, CLAUDE_CODE_DEFAULT_MAX_CONTEXT = 200000, USER_STATUS_LINE_TIMEOUT_SECONDS = 3, MIN_AUTO_COMPACT_WINDOW = 200000, MAX_AUTO_COMPACT_WINDOW = 1e6, ADVISOR_TOOL_ENV_VAR = "CLAUDE_CODE_ENABLE_EXPERIMENTAL_ADVISOR_TOOL", CLAUDISH_CHILD_ADVISOR_MODEL = "sonnet", CHILD_STDERR_NOISE;
|
|
97349
97422
|
var init_claude_runner = __esm(() => {
|
|
97350
97423
|
init_model_catalog();
|
|
97351
97424
|
init_claude_code_facts();
|
|
@@ -97369,18 +97442,13 @@ var init_claude_runner = __esm(() => {
|
|
|
97369
97442
|
init_settings();
|
|
97370
97443
|
init_session_discovery();
|
|
97371
97444
|
init_token_file();
|
|
97445
|
+
init_signal_exit_code();
|
|
97372
97446
|
init_telemetry();
|
|
97373
97447
|
init_terminal_isolation();
|
|
97374
97448
|
init_theme_mode();
|
|
97375
97449
|
macosKeychainAnthropicMemo = new Map;
|
|
97376
97450
|
STALE_TOKEN_FILE_MS = 7 * 24 * 60 * 60 * 1000;
|
|
97377
97451
|
CHILD_STDERR_NOISE = [/^\[claude-code:unrecognized_model\]/];
|
|
97378
|
-
SIGNAL_EXIT_NUMBERS = {
|
|
97379
|
-
SIGHUP: 1,
|
|
97380
|
-
SIGINT: 2,
|
|
97381
|
-
SIGQUIT: 3,
|
|
97382
|
-
SIGTERM: 15
|
|
97383
|
-
};
|
|
97384
97452
|
});
|
|
97385
97453
|
|
|
97386
97454
|
// src/pane/contract.ts
|
|
@@ -97860,7 +97928,7 @@ var init_accounting = __esm(() => {
|
|
|
97860
97928
|
|
|
97861
97929
|
// src/pane/pane-registry.ts
|
|
97862
97930
|
import {
|
|
97863
|
-
constants as
|
|
97931
|
+
constants as constants4,
|
|
97864
97932
|
accessSync as accessSync2,
|
|
97865
97933
|
existsSync as existsSync38,
|
|
97866
97934
|
lstatSync as lstatSync7,
|
|
@@ -98233,7 +98301,7 @@ function dialErrno(reported, sockPath) {
|
|
|
98233
98301
|
if (!isSocket)
|
|
98234
98302
|
return "ENOTSOCK";
|
|
98235
98303
|
try {
|
|
98236
|
-
accessSync2(sockPath,
|
|
98304
|
+
accessSync2(sockPath, constants4.W_OK);
|
|
98237
98305
|
} catch {
|
|
98238
98306
|
return "EACCES";
|
|
98239
98307
|
}
|
|
@@ -102490,7 +102558,7 @@ var init_transcript_redaction = __esm(() => {
|
|
|
102490
102558
|
|
|
102491
102559
|
// src/pane/transcript-page.ts
|
|
102492
102560
|
import {
|
|
102493
|
-
constants as
|
|
102561
|
+
constants as constants5,
|
|
102494
102562
|
closeSync as closeSync14,
|
|
102495
102563
|
fstatSync as fstatSync5,
|
|
102496
102564
|
lstatSync as lstatSync8,
|
|
@@ -102856,7 +102924,7 @@ var init_transcript_page = __esm(() => {
|
|
|
102856
102924
|
maxEntryBytes: 32 * 1024 * 1024
|
|
102857
102925
|
};
|
|
102858
102926
|
READ_CHUNK = 1024 * 1024;
|
|
102859
|
-
OPEN_FLAGS =
|
|
102927
|
+
OPEN_FLAGS = constants5.O_RDONLY | (constants5.O_NOFOLLOW ?? 0) | (constants5.O_NONBLOCK ?? 0);
|
|
102860
102928
|
loggedRejections = new Set;
|
|
102861
102929
|
HEAD_CWD_MAX_BYTES = 256 * 1024;
|
|
102862
102930
|
});
|
|
@@ -102887,7 +102955,7 @@ var init_pane = __esm(() => {
|
|
|
102887
102955
|
|
|
102888
102956
|
// src/mcp-session/replay-manager.ts
|
|
102889
102957
|
import { randomBytes as randomBytes13, randomUUID as randomUUID9 } from "crypto";
|
|
102890
|
-
import { constants as
|
|
102958
|
+
import { constants as constants6, accessSync as accessSync3, closeSync as closeSync15, existsSync as existsSync39, realpathSync as realpathSync9, statSync as statSync21 } from "fs";
|
|
102891
102959
|
import { dirname as dirname23, resolve as resolve7 } from "path";
|
|
102892
102960
|
function unavailable2(reason, message) {
|
|
102893
102961
|
return new ContractErrorException("replay_unavailable", message, reason);
|
|
@@ -102910,7 +102978,7 @@ async function replayClaudeBinary(env) {
|
|
|
102910
102978
|
try {
|
|
102911
102979
|
if (!statSync21(named).isFile())
|
|
102912
102980
|
throw new Error("not a file");
|
|
102913
|
-
accessSync3(named,
|
|
102981
|
+
accessSync3(named, constants6.X_OK);
|
|
102914
102982
|
} catch {
|
|
102915
102983
|
throw new Error(`CLAUDE_PATH ${named} is not an executable file`);
|
|
102916
102984
|
}
|
|
@@ -120341,6 +120409,9 @@ function shouldWarmCatalog(args) {
|
|
|
120341
120409
|
if (m.startsWith(prefix))
|
|
120342
120410
|
return false;
|
|
120343
120411
|
}
|
|
120412
|
+
const routesOnlyNative = !args.forceUpdate && !args.advisor && !args.modelChain?.length && !args.modelOpus && !args.modelSonnet && !args.modelHaiku && !args.modelSubagent;
|
|
120413
|
+
if (args.model && routesOnlyNative && nativeRouteFor(args.model))
|
|
120414
|
+
return false;
|
|
120344
120415
|
return true;
|
|
120345
120416
|
}
|
|
120346
120417
|
function classifyCatalogState(cache, ttlHours, now) {
|
|
@@ -120396,10 +120467,7 @@ function startSpinner(label, quiet = false) {
|
|
|
120396
120467
|
};
|
|
120397
120468
|
}
|
|
120398
120469
|
async function warmCatalogIfNeeded(config, opts) {
|
|
120399
|
-
if (!shouldWarmCatalog({
|
|
120400
|
-
model: config.model,
|
|
120401
|
-
skipModelsUpdate: config.skipModelsUpdate
|
|
120402
|
-
})) {
|
|
120470
|
+
if (!shouldWarmCatalog(config)) {
|
|
120403
120471
|
return "skipped";
|
|
120404
120472
|
}
|
|
120405
120473
|
if (!config.quiet) {
|
|
@@ -120467,6 +120535,7 @@ var HARD_FAIL_MESSAGE, LOCAL_MODEL_PREFIXES;
|
|
|
120467
120535
|
var init_catalog_warm = __esm(() => {
|
|
120468
120536
|
init_all_models_cache();
|
|
120469
120537
|
init_catalog_client();
|
|
120538
|
+
init_native_route();
|
|
120470
120539
|
HARD_FAIL_MESSAGE = `Error: cannot reach model catalog and no cached copy found.
|
|
120471
120540
|
` + `
|
|
120472
120541
|
` + `To proceed:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudish",
|
|
3
|
-
"version": "14.16.
|
|
3
|
+
"version": "14.16.2",
|
|
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",
|
|
@@ -71,10 +71,10 @@
|
|
|
71
71
|
"ai"
|
|
72
72
|
],
|
|
73
73
|
"optionalDependencies": {
|
|
74
|
-
"@claudish/magmux-darwin-arm64": "14.16.
|
|
75
|
-
"@claudish/magmux-darwin-x64": "14.16.
|
|
76
|
-
"@claudish/magmux-linux-arm64": "14.16.
|
|
77
|
-
"@claudish/magmux-linux-x64": "14.16.
|
|
74
|
+
"@claudish/magmux-darwin-arm64": "14.16.2",
|
|
75
|
+
"@claudish/magmux-darwin-x64": "14.16.2",
|
|
76
|
+
"@claudish/magmux-linux-arm64": "14.16.2",
|
|
77
|
+
"@claudish/magmux-linux-x64": "14.16.2"
|
|
78
78
|
},
|
|
79
79
|
"author": "Jack Rudenko <i@madappgang.com>",
|
|
80
80
|
"license": "MIT",
|