claudish 9.0.6 → 9.0.8
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 +164 -33
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -715,7 +715,7 @@ var init_onepassword_config = __esm(() => {
|
|
|
715
715
|
});
|
|
716
716
|
|
|
717
717
|
// src/version.ts
|
|
718
|
-
var VERSION = "9.0.
|
|
718
|
+
var VERSION = "9.0.8";
|
|
719
719
|
|
|
720
720
|
// src/logger.ts
|
|
721
721
|
import { appendFile, existsSync as existsSync2, mkdirSync, readdirSync, unlinkSync, writeFileSync as writeFileSync2 } from "fs";
|
|
@@ -18330,6 +18330,9 @@ function lookupModelCapabilities(modelId, cachePath) {
|
|
|
18330
18330
|
return;
|
|
18331
18331
|
return { supportsTools: entry.supportsTools, supportsThinking: entry.supportsThinking };
|
|
18332
18332
|
}
|
|
18333
|
+
function lookupModelEndpoint(modelId, transport, cachePath) {
|
|
18334
|
+
return findCacheEntry(modelId, cachePath)?.endpoints?.[transport];
|
|
18335
|
+
}
|
|
18333
18336
|
function lookupModelForProvider(modelId, provider, cachePath) {
|
|
18334
18337
|
const entry = findCacheEntry(modelId, cachePath);
|
|
18335
18338
|
if (!entry)
|
|
@@ -19331,6 +19334,60 @@ var init_transform = __esm(() => {
|
|
|
19331
19334
|
});
|
|
19332
19335
|
|
|
19333
19336
|
// src/handlers/shared/format/openai-tools.ts
|
|
19337
|
+
function isPortablePattern(pattern) {
|
|
19338
|
+
for (let i = 0;i < pattern.length; i++) {
|
|
19339
|
+
const char = pattern[i];
|
|
19340
|
+
if (char === "\\") {
|
|
19341
|
+
const escaped = pattern[i + 1];
|
|
19342
|
+
i++;
|
|
19343
|
+
if (escaped && /[A-Za-z]/.test(escaped) && !PORTABLE_ESCAPE_LETTERS.has(escaped)) {
|
|
19344
|
+
return false;
|
|
19345
|
+
}
|
|
19346
|
+
continue;
|
|
19347
|
+
}
|
|
19348
|
+
if (char === "(" && pattern[i + 1] === "?" && pattern[i + 2] === "<") {
|
|
19349
|
+
const after = pattern[i + 3];
|
|
19350
|
+
if (after !== "=" && after !== "!")
|
|
19351
|
+
return false;
|
|
19352
|
+
}
|
|
19353
|
+
}
|
|
19354
|
+
return true;
|
|
19355
|
+
}
|
|
19356
|
+
function isNamedSchemaMap(key, value) {
|
|
19357
|
+
return NAMED_SCHEMA_MAPS.has(key) && !!value && typeof value === "object" && !Array.isArray(value);
|
|
19358
|
+
}
|
|
19359
|
+
function stripInNamedSchemaMap(map, path) {
|
|
19360
|
+
const result = {};
|
|
19361
|
+
for (const name in map) {
|
|
19362
|
+
result[name] = stripUnportablePatterns(map[name], `${path}.${name}`);
|
|
19363
|
+
}
|
|
19364
|
+
return result;
|
|
19365
|
+
}
|
|
19366
|
+
function stripUnportablePatterns(schema, path = "parameters") {
|
|
19367
|
+
if (Array.isArray(schema)) {
|
|
19368
|
+
return schema.map((item, index) => stripUnportablePatterns(item, `${path}[${index}]`));
|
|
19369
|
+
}
|
|
19370
|
+
if (!schema || typeof schema !== "object")
|
|
19371
|
+
return schema;
|
|
19372
|
+
const result = {};
|
|
19373
|
+
for (const key in schema) {
|
|
19374
|
+
const value = schema[key];
|
|
19375
|
+
if (key === "pattern" && typeof value === "string") {
|
|
19376
|
+
if (isPortablePattern(value)) {
|
|
19377
|
+
result[key] = value;
|
|
19378
|
+
} else {
|
|
19379
|
+
log(`[OpenAITools] Dropped unportable pattern at ${path}: ${value}`);
|
|
19380
|
+
}
|
|
19381
|
+
continue;
|
|
19382
|
+
}
|
|
19383
|
+
if (isNamedSchemaMap(key, value)) {
|
|
19384
|
+
result[key] = stripInNamedSchemaMap(value, path);
|
|
19385
|
+
continue;
|
|
19386
|
+
}
|
|
19387
|
+
result[key] = stripUnportablePatterns(value, `${path}.${key}`);
|
|
19388
|
+
}
|
|
19389
|
+
return result;
|
|
19390
|
+
}
|
|
19334
19391
|
function emptyParamsSchema() {
|
|
19335
19392
|
return { type: "object", properties: {} };
|
|
19336
19393
|
}
|
|
@@ -19355,7 +19412,7 @@ function sanitizeSchemaForOpenAI(schema) {
|
|
|
19355
19412
|
root.type = "object";
|
|
19356
19413
|
if (!root.properties)
|
|
19357
19414
|
root.properties = {};
|
|
19358
|
-
return removeUriFormat(root);
|
|
19415
|
+
return stripUnportablePatterns(removeUriFormat(root));
|
|
19359
19416
|
}
|
|
19360
19417
|
function convertToolsToOpenAI(req, summarize = false) {
|
|
19361
19418
|
return req.tools?.map((tool) => ({
|
|
@@ -19395,8 +19452,33 @@ function summarizeToolParameters(schema) {
|
|
|
19395
19452
|
}
|
|
19396
19453
|
return summarized;
|
|
19397
19454
|
}
|
|
19455
|
+
var PORTABLE_ESCAPE_LETTERS, NAMED_SCHEMA_MAPS;
|
|
19398
19456
|
var init_openai_tools = __esm(() => {
|
|
19457
|
+
init_logger();
|
|
19399
19458
|
init_transform();
|
|
19459
|
+
PORTABLE_ESCAPE_LETTERS = new Set([
|
|
19460
|
+
"A",
|
|
19461
|
+
"b",
|
|
19462
|
+
"B",
|
|
19463
|
+
"d",
|
|
19464
|
+
"D",
|
|
19465
|
+
"s",
|
|
19466
|
+
"S",
|
|
19467
|
+
"w",
|
|
19468
|
+
"W",
|
|
19469
|
+
"Z",
|
|
19470
|
+
"a",
|
|
19471
|
+
"f",
|
|
19472
|
+
"n",
|
|
19473
|
+
"r",
|
|
19474
|
+
"t",
|
|
19475
|
+
"v",
|
|
19476
|
+
"x",
|
|
19477
|
+
"u",
|
|
19478
|
+
"U",
|
|
19479
|
+
"N"
|
|
19480
|
+
]);
|
|
19481
|
+
NAMED_SCHEMA_MAPS = new Set(["properties", "$defs", "definitions"]);
|
|
19400
19482
|
});
|
|
19401
19483
|
|
|
19402
19484
|
// src/adapters/base-api-format.ts
|
|
@@ -32089,6 +32171,14 @@ var init_model_unsupported = __esm(() => {
|
|
|
32089
32171
|
];
|
|
32090
32172
|
});
|
|
32091
32173
|
|
|
32174
|
+
// src/handlers/shared/request-shape.ts
|
|
32175
|
+
function isRequestShapeError(errorBody) {
|
|
32176
|
+
if (!errorBody)
|
|
32177
|
+
return false;
|
|
32178
|
+
const lower = errorBody.toLowerCase();
|
|
32179
|
+
return lower.includes("unknown_parameter") || lower.includes("unsupported_parameter") || lower.includes("invalid_parameter") || lower.includes("unknown parameter:") || lower.includes("unsupported parameter:") || lower.includes("invalid parameter:");
|
|
32180
|
+
}
|
|
32181
|
+
|
|
32092
32182
|
// src/handlers/shared/stream-head-sniffer.ts
|
|
32093
32183
|
function isRetryableStreamError(code, type, message) {
|
|
32094
32184
|
if (RETRYABLE_ERROR_CODES.has(code))
|
|
@@ -35011,6 +35101,9 @@ function getRecoveryHint(status, errorText, providerName, transportTerminal429)
|
|
|
35011
35101
|
if (lower.includes("unsupported content type") || lower.includes("unsupported_content_type")) {
|
|
35012
35102
|
return "Model doesn't support this content format. Try a different model.";
|
|
35013
35103
|
}
|
|
35104
|
+
if (isRequestShapeError(errorText)) {
|
|
35105
|
+
return "Wrong request shape for this endpoint \u2014 the provider named the parameter it rejected (see the message below). Nothing was too large; a shorter prompt will not help.";
|
|
35106
|
+
}
|
|
35014
35107
|
if (lower.includes("context") || lower.includes("too long") || lower.includes("token")) {
|
|
35015
35108
|
return "Input too large. Reduce message history or use a larger-context model.";
|
|
35016
35109
|
}
|
|
@@ -35749,9 +35842,14 @@ __export(exports_provider_profiles, {
|
|
|
35749
35842
|
openCodeZenProfile: () => openCodeZenProfile,
|
|
35750
35843
|
openaiCodexProfile: () => openaiCodexProfile,
|
|
35751
35844
|
openaiProfile: () => openaiProfile,
|
|
35845
|
+
requiresResponsesApi: () => requiresResponsesApi,
|
|
35752
35846
|
vertexProfile: () => vertexProfile
|
|
35753
35847
|
});
|
|
35754
|
-
function requiresResponsesApi(modelName) {
|
|
35848
|
+
function requiresResponsesApi(modelName, cachePath) {
|
|
35849
|
+
const endpoint = lookupModelEndpoint(modelName, "openai", cachePath);
|
|
35850
|
+
if (endpoint?.api === "responses" || endpoint?.toolsWithReasoning === "requires-responses") {
|
|
35851
|
+
return true;
|
|
35852
|
+
}
|
|
35755
35853
|
const name = modelName.toLowerCase();
|
|
35756
35854
|
return /^gpt-5\.6/.test(name) || name.includes("codex");
|
|
35757
35855
|
}
|
|
@@ -35780,6 +35878,7 @@ var init_provider_profiles = __esm(() => {
|
|
|
35780
35878
|
init_devin_api_format();
|
|
35781
35879
|
init_gemini_api_format();
|
|
35782
35880
|
init_litellm_api_format();
|
|
35881
|
+
init_model_catalog();
|
|
35783
35882
|
init_ollama_api_format();
|
|
35784
35883
|
init_openai_api_format();
|
|
35785
35884
|
init_vertex_auth();
|
|
@@ -35852,7 +35951,7 @@ var init_provider_profiles = __esm(() => {
|
|
|
35852
35951
|
};
|
|
35853
35952
|
openaiProfile = {
|
|
35854
35953
|
createHandler(ctx) {
|
|
35855
|
-
if (requiresResponsesApi(ctx.modelName)) {
|
|
35954
|
+
if (requiresResponsesApi(ctx.modelName, ctx.catalogCachePath)) {
|
|
35856
35955
|
const responsesProvider = { ...ctx.provider, apiPath: "/v1/responses" };
|
|
35857
35956
|
const transport = new OpenAIProviderTransport(responsesProvider, ctx.modelName, ctx.apiKey);
|
|
35858
35957
|
const adapter = new CodexAPIFormat(ctx.modelName);
|
|
@@ -39713,6 +39812,7 @@ function sessionsIn(dirName) {
|
|
|
39713
39812
|
id: basename(n, ".jsonl"),
|
|
39714
39813
|
file,
|
|
39715
39814
|
mtimeMs: st.mtimeMs,
|
|
39815
|
+
birthtimeMs: st.birthtimeMs,
|
|
39716
39816
|
sizeBytes: st.size
|
|
39717
39817
|
};
|
|
39718
39818
|
const head = readChunk(file, 0, Math.min(ENTRYPOINT_BYTES, st.size));
|
|
@@ -40056,10 +40156,12 @@ function sessionLabel(row) {
|
|
|
40056
40156
|
return row.title || row.firstPrompt || row.id;
|
|
40057
40157
|
}
|
|
40058
40158
|
function findLatestSessionId(cwd = process.cwd(), sinceMs = 0) {
|
|
40059
|
-
const
|
|
40060
|
-
if (
|
|
40159
|
+
const touched = sessionsIn(slugForPath(cwd)).filter((r) => r.mtimeMs >= sinceMs);
|
|
40160
|
+
if (touched.length === 0)
|
|
40061
40161
|
return null;
|
|
40062
|
-
|
|
40162
|
+
const born = touched.filter((r) => r.birthtimeMs !== undefined && r.birthtimeMs >= sinceMs);
|
|
40163
|
+
const pool = born.length > 0 ? born : touched;
|
|
40164
|
+
return pool.reduce((a, b) => b.mtimeMs > a.mtimeMs ? b : a).id;
|
|
40063
40165
|
}
|
|
40064
40166
|
var ENTRYPOINT_BYTES = 8192, PROJECTS_DIR, ACTIVE_WINDOW_MS = 120000, HEAD_BYTES, TAIL_BYTES, HARNESS_ENVELOPES, DEEP_TAIL_BYTES, RECENT_AI_TURNS = 5, RECENT_USER_TURNS = 1;
|
|
40065
40167
|
var init_session_discovery = __esm(() => {
|
|
@@ -44599,7 +44701,7 @@ If you cannot use structured tool_calls, format as JSON:
|
|
|
44599
44701
|
// src/adapters/openrouter-api-format.ts
|
|
44600
44702
|
var OpenRouterAPIFormat;
|
|
44601
44703
|
var init_openrouter_api_format = __esm(() => {
|
|
44602
|
-
|
|
44704
|
+
init_openai_tools();
|
|
44603
44705
|
init_base_api_format();
|
|
44604
44706
|
init_dialect_manager();
|
|
44605
44707
|
OpenRouterAPIFormat = class OpenRouterAPIFormat extends BaseAPIFormat {
|
|
@@ -44653,14 +44755,7 @@ ${text}`;
|
|
|
44653
44755
|
}
|
|
44654
44756
|
}
|
|
44655
44757
|
convertTools(claudeRequest, _summarize = false) {
|
|
44656
|
-
return claudeRequest
|
|
44657
|
-
type: "function",
|
|
44658
|
-
function: {
|
|
44659
|
-
name: tool.name,
|
|
44660
|
-
description: tool.description,
|
|
44661
|
-
parameters: removeUriFormat(tool.input_schema)
|
|
44662
|
-
}
|
|
44663
|
-
})) || [];
|
|
44758
|
+
return convertToolsToOpenAI(claudeRequest, false);
|
|
44664
44759
|
}
|
|
44665
44760
|
buildPayload(claudeRequest, messages, tools) {
|
|
44666
44761
|
const payload = {
|
|
@@ -53570,8 +53665,12 @@ function retintSurfaces(palette, pageHex) {
|
|
|
53570
53665
|
]);
|
|
53571
53666
|
}
|
|
53572
53667
|
}
|
|
53668
|
+
function isLightTheme() {
|
|
53669
|
+
return appliedMode === "light";
|
|
53670
|
+
}
|
|
53573
53671
|
function applyTuiTheme(mode) {
|
|
53574
53672
|
const palette = mode === "light" ? LIGHT2 : DARK;
|
|
53673
|
+
appliedMode = mode;
|
|
53575
53674
|
activeLatencyBuckets = mode === "light" ? LATENCY_BUCKETS_LIGHT : LATENCY_BUCKETS_DARK;
|
|
53576
53675
|
Object.assign(C, palette);
|
|
53577
53676
|
const terminalBg = getTerminalBackground();
|
|
@@ -53655,7 +53754,7 @@ function tokBarCells(tokensPerSec, maxTokPerSec, tokWidth) {
|
|
|
53655
53754
|
const raw = Math.round(tokWidth * Math.max(0, tokensPerSec) / denom);
|
|
53656
53755
|
return Math.min(tokWidth, Math.max(0, raw));
|
|
53657
53756
|
}
|
|
53658
|
-
var DARK, LIGHT2, C, bold3, A, LATENCY_BUCKETS_DARK, LATENCY_BUCKETS_LIGHT, activeLatencyBuckets, latencyFg = "#ffffff", LATENCY_FG_ANSI = "\x1B[38;2;255;255;255m", ANSI_RESET = "\x1B[0m", STAGE_BG_DARK, STAGE_BG_LIGHT, STAGE_BG, STAGE_FG, STAGE_BG_ANSI, paletteRefreshers, SURFACE_TOKENS;
|
|
53757
|
+
var DARK, LIGHT2, C, bold3, A, LATENCY_BUCKETS_DARK, LATENCY_BUCKETS_LIGHT, activeLatencyBuckets, latencyFg = "#ffffff", LATENCY_FG_ANSI = "\x1B[38;2;255;255;255m", ANSI_RESET = "\x1B[0m", STAGE_BG_DARK, STAGE_BG_LIGHT, STAGE_BG, STAGE_FG, STAGE_BG_ANSI, paletteRefreshers, SURFACE_TOKENS, appliedMode = null;
|
|
53659
53758
|
var init_theme2 = __esm(() => {
|
|
53660
53759
|
init_theme_mode();
|
|
53661
53760
|
DARK = {
|
|
@@ -66574,6 +66673,11 @@ function blendStops(steps, ...stops) {
|
|
|
66574
66673
|
return mix(pts[s], pts[s + 1], p - s);
|
|
66575
66674
|
});
|
|
66576
66675
|
}
|
|
66676
|
+
function lighten(c, amount) {
|
|
66677
|
+
const k = clamp01(amount);
|
|
66678
|
+
const v = rgba(c);
|
|
66679
|
+
return hex(RGBA.fromValues(v.r + (1 - v.r) * k, v.g + (1 - v.g) * k, v.b + (1 - v.b) * k, v.a));
|
|
66680
|
+
}
|
|
66577
66681
|
function luminance(c) {
|
|
66578
66682
|
const f = (v) => v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;
|
|
66579
66683
|
return 0.2126 * f(clamp01(c.r)) + 0.7152 * f(clamp01(c.g)) + 0.0722 * f(clamp01(c.b));
|
|
@@ -68678,12 +68782,22 @@ function toolColors() {
|
|
|
68678
68782
|
function toolOther() {
|
|
68679
68783
|
return C.dim;
|
|
68680
68784
|
}
|
|
68785
|
+
function area(hex) {
|
|
68786
|
+
return isLightTheme() ? lighten(hex, 0.55) : hex;
|
|
68787
|
+
}
|
|
68788
|
+
function areaRamp(ramp) {
|
|
68789
|
+
const [first, ...rest] = ramp;
|
|
68790
|
+
return [area(first), ...rest.map(area)];
|
|
68791
|
+
}
|
|
68681
68792
|
function cardWidth() {
|
|
68682
68793
|
const cols = process.stdout.columns || 80;
|
|
68683
68794
|
return Math.max(MIN_W, Math.min(MAX_W, cols - 2));
|
|
68684
68795
|
}
|
|
68796
|
+
function shellArg(path) {
|
|
68797
|
+
return /^[A-Za-z0-9_@%+=:,./-]+$/.test(path) ? path : `'${path.replace(/'/g, `'\\''`)}'`;
|
|
68798
|
+
}
|
|
68685
68799
|
function renderSessionSummary(input) {
|
|
68686
|
-
const { stats, modelSpec, resumeModelSpec, resumeId, exitCode } = input;
|
|
68800
|
+
const { stats, modelSpec, resumeModelSpec, resumeId, resumeCwd, exitCode } = input;
|
|
68687
68801
|
const W = cardWidth();
|
|
68688
68802
|
const inner = W - CHROME;
|
|
68689
68803
|
const out = [];
|
|
@@ -68712,22 +68826,24 @@ function renderSessionSummary(input) {
|
|
|
68712
68826
|
row(dim(truncate3(stats.providerName, inner)));
|
|
68713
68827
|
blank();
|
|
68714
68828
|
const VALUE_W = 24;
|
|
68715
|
-
const
|
|
68829
|
+
const BAR_MAX = 30;
|
|
68830
|
+
const barW = Math.max(12, Math.min(BAR_MAX, inner - LABEL_W - VALUE_W));
|
|
68831
|
+
const barGap = Math.max(0, inner - LABEL_W - barW - VALUE_W);
|
|
68716
68832
|
const dataRow = (label, bar, values) => {
|
|
68717
|
-
row(dim(padTo(label, LABEL_W)) + bar + padVisible2(values, VALUE_W, "right"));
|
|
68833
|
+
row(dim(padTo(label, LABEL_W)) + bar + " ".repeat(barGap) + padVisible2(values, VALUE_W, "right"));
|
|
68718
68834
|
};
|
|
68719
68835
|
if (stats.contextUsed !== null && stats.contextWindow) {
|
|
68720
68836
|
const pct = stats.contextUsed * 100;
|
|
68721
|
-
dataRow("context", meter(pct, barW, ramps.load), body(padStartTo(`${Math.round(pct)}%`, 4)) + dim(` ${compact(stats.inputTokens)}/${compact(stats.contextWindow)}`));
|
|
68837
|
+
dataRow("context", meter(pct, barW, areaRamp(ramps.load)), body(padStartTo(`${Math.round(pct)}%`, 4)) + dim(` ${compact(stats.inputTokens)}/${compact(stats.contextWindow)}`));
|
|
68722
68838
|
}
|
|
68723
68839
|
dataRow("tokens", stackedBar([
|
|
68724
|
-
{ value: stats.inputTokens, color: C.blue },
|
|
68725
|
-
{ value: stats.outputTokens, color: C.cyan }
|
|
68840
|
+
{ value: stats.inputTokens, color: area(C.blue) },
|
|
68841
|
+
{ value: stats.outputTokens, color: area(C.cyan) }
|
|
68726
68842
|
], barW), dim("in ") + body(compact(stats.inputTokens)) + dim(" out ") + body(compact(stats.outputTokens)));
|
|
68727
68843
|
if (!stats.isFree && stats.inputCostUsd + stats.outputCostUsd > 0) {
|
|
68728
68844
|
dataRow("spend", stackedBar([
|
|
68729
|
-
{ value: stats.inputCostUsd, color: C.blue },
|
|
68730
|
-
{ value: stats.outputCostUsd, color: C.cyan }
|
|
68845
|
+
{ value: stats.inputCostUsd, color: area(C.blue) },
|
|
68846
|
+
{ value: stats.outputCostUsd, color: area(C.cyan) }
|
|
68731
68847
|
], barW), dim("in ") + body(usd(stats.inputCostUsd)) + dim(" out ") + body(usd(stats.outputCostUsd)));
|
|
68732
68848
|
}
|
|
68733
68849
|
if (stats.toolCallTotal > 0) {
|
|
@@ -68735,9 +68851,12 @@ function renderSessionSummary(input) {
|
|
|
68735
68851
|
const other = toolOther();
|
|
68736
68852
|
const shown = stats.toolCalls.slice(0, toolCols.length);
|
|
68737
68853
|
const rest = stats.toolCalls.slice(toolCols.length).reduce((a, t) => a + t.count, 0);
|
|
68738
|
-
const segs = shown.map((t, i) => ({
|
|
68854
|
+
const segs = shown.map((t, i) => ({
|
|
68855
|
+
value: t.count,
|
|
68856
|
+
color: area(toolCols[i])
|
|
68857
|
+
}));
|
|
68739
68858
|
if (rest > 0)
|
|
68740
|
-
segs.push({ value: rest, color: other });
|
|
68859
|
+
segs.push({ value: rest, color: area(other) });
|
|
68741
68860
|
dataRow("tools", stackedBar(segs, barW), body(padStartTo(String(stats.toolCallTotal), 4)) + dim(" calls"));
|
|
68742
68861
|
const legend = shown.map((t, i) => paint(`${t.name} ${t.count}`, toolCols[i])).concat(rest > 0 ? [paint(`other ${rest}`, other)] : []);
|
|
68743
68862
|
for (const line of wrapStyled(legend, dim(" \xB7 "), inner - LABEL_W)) {
|
|
@@ -68745,14 +68864,16 @@ function renderSessionSummary(input) {
|
|
|
68745
68864
|
}
|
|
68746
68865
|
}
|
|
68747
68866
|
blank();
|
|
68748
|
-
row(dim(padTo("cost", LABEL_W)) + paint(stats.isFree ? "free" : usd(stats.costUsd),
|
|
68867
|
+
row(dim(padTo("cost", LABEL_W)) + paint(stats.isFree ? "free" : usd(stats.costUsd), tokens.text, true) + (stats.isEstimated && !stats.isFree ? dim(" estimated") : ""));
|
|
68868
|
+
const dearest = Math.max(0, ...stats.savings.map((s) => s.baselineUsd));
|
|
68749
68869
|
for (const s of stats.savings) {
|
|
68750
68870
|
const label = padTo(`vs ${s.label}`, LABEL_W);
|
|
68751
68871
|
if (s.savedUsd >= 0) {
|
|
68752
68872
|
const pct = s.baselineUsd > 0 ? s.savedUsd / s.baselineUsd * 100 : 0;
|
|
68753
|
-
|
|
68873
|
+
const share = dearest > 0 ? s.savedUsd / dearest * 100 : 0;
|
|
68874
|
+
dataRow(label, meter(share, barW, areaRamp(ramps.volume)), dim(`${padStartTo(`${Math.round(pct)}%`, 4)} saved `) + body(usd(s.savedUsd)));
|
|
68754
68875
|
} else {
|
|
68755
|
-
dataRow(label, meter(0, barW, ramps.
|
|
68876
|
+
dataRow(label, meter(0, barW, areaRamp(ramps.volume)), dim("over by ") + paint(usd(-s.savedUsd), tokens.error));
|
|
68756
68877
|
}
|
|
68757
68878
|
}
|
|
68758
68879
|
out.push(paint(`\u2570${"\u2500".repeat(W - 2)}\u256F`, tokens.border));
|
|
@@ -68760,7 +68881,8 @@ function renderSessionSummary(input) {
|
|
|
68760
68881
|
out.push("");
|
|
68761
68882
|
out.push(dim("Resume this session with:"));
|
|
68762
68883
|
const modelFlag = resumeModelSpec ? `--model ${resumeModelSpec} ` : "";
|
|
68763
|
-
|
|
68884
|
+
const prefix = resumeCwd ? `cd ${shellArg(resumeCwd)} && ` : "";
|
|
68885
|
+
out.push(`${prefix}claudish ${modelFlag}--resume ${resumeId}`);
|
|
68764
68886
|
}
|
|
68765
68887
|
return out;
|
|
68766
68888
|
}
|
|
@@ -68792,6 +68914,7 @@ function printSessionSummary(input, write) {
|
|
|
68792
68914
|
var MIN_W = 62, MAX_W = 96, CHROME = 4, LABEL_W = 10;
|
|
68793
68915
|
var init_session_summary = __esm(() => {
|
|
68794
68916
|
init_theme2();
|
|
68917
|
+
init_color();
|
|
68795
68918
|
init_text();
|
|
68796
68919
|
init_tokens();
|
|
68797
68920
|
init_ansi_viz();
|
|
@@ -69325,18 +69448,26 @@ Team Status`);
|
|
|
69325
69448
|
write(`[claudish] Done
|
|
69326
69449
|
`);
|
|
69327
69450
|
try {
|
|
69328
|
-
const [
|
|
69451
|
+
const [
|
|
69452
|
+
{ readSessionStats },
|
|
69453
|
+
{ printSessionSummary },
|
|
69454
|
+
{ findLatestSessionId, getRepoContext }
|
|
69455
|
+
] = await Promise.all([
|
|
69329
69456
|
Promise.resolve().then(() => (init_session_stats(), exports_session_stats)),
|
|
69330
69457
|
Promise.resolve().then(() => (init_session_summary(), exports_session_summary)),
|
|
69331
69458
|
Promise.resolve().then(() => (init_session_discovery(), exports_session_discovery))
|
|
69332
69459
|
]);
|
|
69333
69460
|
const stats = readSessionStats(port);
|
|
69461
|
+
const repo = getRepoContext(process.cwd());
|
|
69462
|
+
const worktreeCwd = repo && repo.current !== repo.root ? process.cwd() : null;
|
|
69463
|
+
const runStartMs = Date.now() - Math.round(process.uptime() * 1000);
|
|
69334
69464
|
if (stats) {
|
|
69335
69465
|
printSessionSummary({
|
|
69336
69466
|
stats,
|
|
69337
69467
|
modelSpec: explicitModel || stats.modelName || "",
|
|
69338
69468
|
resumeModelSpec: explicitModel ?? null,
|
|
69339
|
-
resumeId: resumedSessionId ?? findLatestSessionId(process.cwd(),
|
|
69469
|
+
resumeId: resumedSessionId ?? findLatestSessionId(process.cwd(), runStartMs),
|
|
69470
|
+
resumeCwd: worktreeCwd,
|
|
69340
69471
|
exitCode
|
|
69341
69472
|
}, write);
|
|
69342
69473
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudish",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.8",
|
|
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": "9.0.
|
|
64
|
-
"@claudish/magmux-darwin-x64": "9.0.
|
|
65
|
-
"@claudish/magmux-linux-arm64": "9.0.
|
|
66
|
-
"@claudish/magmux-linux-x64": "9.0.
|
|
63
|
+
"@claudish/magmux-darwin-arm64": "9.0.8",
|
|
64
|
+
"@claudish/magmux-darwin-x64": "9.0.8",
|
|
65
|
+
"@claudish/magmux-linux-arm64": "9.0.8",
|
|
66
|
+
"@claudish/magmux-linux-x64": "9.0.8"
|
|
67
67
|
},
|
|
68
68
|
"author": "Jack Rudenko <i@madappgang.com>",
|
|
69
69
|
"license": "MIT",
|