claudish 7.61.0 → 7.62.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 +698 -265
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -729,7 +729,7 @@ var init_onepassword_config = __esm(() => {
|
|
|
729
729
|
});
|
|
730
730
|
|
|
731
731
|
// src/version.ts
|
|
732
|
-
var VERSION = "7.
|
|
732
|
+
var VERSION = "7.62.0";
|
|
733
733
|
|
|
734
734
|
// src/logger.ts
|
|
735
735
|
var exports_logger = {};
|
|
@@ -54912,6 +54912,208 @@ var init_serve_command = __esm(() => {
|
|
|
54912
54912
|
init_proxy_server();
|
|
54913
54913
|
});
|
|
54914
54914
|
|
|
54915
|
+
// src/theme/theme-mode.ts
|
|
54916
|
+
var exports_theme_mode = {};
|
|
54917
|
+
__export(exports_theme_mode, {
|
|
54918
|
+
themeModeOverride: () => themeModeOverride,
|
|
54919
|
+
themeModeFromColorFgBg: () => themeModeFromColorFgBg,
|
|
54920
|
+
setThemeMode: () => setThemeMode,
|
|
54921
|
+
resetThemeModeForTests: () => resetThemeModeForTests,
|
|
54922
|
+
relativeLuminance: () => relativeLuminance,
|
|
54923
|
+
queryTerminalThemeMode: () => queryTerminalThemeMode,
|
|
54924
|
+
onThemeModeChange: () => onThemeModeChange,
|
|
54925
|
+
getThemeMode: () => getThemeMode,
|
|
54926
|
+
detectAndSetThemeModeSync: () => detectAndSetThemeModeSync,
|
|
54927
|
+
detectAndSetThemeMode: () => detectAndSetThemeMode,
|
|
54928
|
+
classifyOscBackground: () => classifyOscBackground
|
|
54929
|
+
});
|
|
54930
|
+
function getThemeMode() {
|
|
54931
|
+
return detected;
|
|
54932
|
+
}
|
|
54933
|
+
function setThemeMode(mode) {
|
|
54934
|
+
detected = mode;
|
|
54935
|
+
for (const cb of listeners)
|
|
54936
|
+
cb(mode);
|
|
54937
|
+
}
|
|
54938
|
+
function onThemeModeChange(cb) {
|
|
54939
|
+
listeners.push(cb);
|
|
54940
|
+
cb(detected);
|
|
54941
|
+
}
|
|
54942
|
+
function resetThemeModeForTests() {
|
|
54943
|
+
setThemeMode(null);
|
|
54944
|
+
}
|
|
54945
|
+
function themeModeOverride(env = process.env) {
|
|
54946
|
+
const raw2 = env.CLAUDISH_THEME?.trim().toLowerCase();
|
|
54947
|
+
if (raw2 === "light" || raw2 === "dark")
|
|
54948
|
+
return raw2;
|
|
54949
|
+
return null;
|
|
54950
|
+
}
|
|
54951
|
+
function themeModeFromColorFgBg(env = process.env) {
|
|
54952
|
+
const raw2 = env.COLORFGBG;
|
|
54953
|
+
if (!raw2)
|
|
54954
|
+
return null;
|
|
54955
|
+
const last = raw2.split(";").pop()?.trim();
|
|
54956
|
+
if (!last || !/^\d+$/.test(last))
|
|
54957
|
+
return null;
|
|
54958
|
+
const bg = Number.parseInt(last, 10);
|
|
54959
|
+
if (bg === 7 || bg === 15)
|
|
54960
|
+
return "light";
|
|
54961
|
+
if (bg <= 8)
|
|
54962
|
+
return "dark";
|
|
54963
|
+
return null;
|
|
54964
|
+
}
|
|
54965
|
+
function relativeLuminance(r, g, b) {
|
|
54966
|
+
const lin = (c) => c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
54967
|
+
return 0.2126 * lin(r) + 0.7152 * lin(g) + 0.0722 * lin(b);
|
|
54968
|
+
}
|
|
54969
|
+
function classifyOscBackground(reply) {
|
|
54970
|
+
const m = reply.match(/\]11;rgb:([0-9a-fA-F]{1,4})\/([0-9a-fA-F]{1,4})\/([0-9a-fA-F]{1,4})/);
|
|
54971
|
+
if (!m)
|
|
54972
|
+
return null;
|
|
54973
|
+
const channel = (hex3) => {
|
|
54974
|
+
const max = 16 ** hex3.length - 1;
|
|
54975
|
+
return Number.parseInt(hex3, 16) / max;
|
|
54976
|
+
};
|
|
54977
|
+
const lum = relativeLuminance(channel(m[1]), channel(m[2]), channel(m[3]));
|
|
54978
|
+
return lum >= MID_SRGB_LUMINANCE ? "light" : "dark";
|
|
54979
|
+
}
|
|
54980
|
+
async function queryTerminalThemeMode(timeoutMs = 150) {
|
|
54981
|
+
const stdin = process.stdin;
|
|
54982
|
+
const stdout = process.stdout;
|
|
54983
|
+
if (!stdin.isTTY || !stdout.isTTY || typeof stdin.setRawMode !== "function")
|
|
54984
|
+
return null;
|
|
54985
|
+
if (process.env.TERM === "dumb")
|
|
54986
|
+
return null;
|
|
54987
|
+
return await new Promise((resolve5) => {
|
|
54988
|
+
let buffer = "";
|
|
54989
|
+
let settled = false;
|
|
54990
|
+
const wasRaw = stdin.isRaw === true;
|
|
54991
|
+
const finish = (mode) => {
|
|
54992
|
+
if (settled)
|
|
54993
|
+
return;
|
|
54994
|
+
settled = true;
|
|
54995
|
+
clearTimeout(timer);
|
|
54996
|
+
stdin.off("data", onData);
|
|
54997
|
+
try {
|
|
54998
|
+
if (!wasRaw)
|
|
54999
|
+
stdin.setRawMode(false);
|
|
55000
|
+
stdin.pause();
|
|
55001
|
+
} catch {}
|
|
55002
|
+
resolve5(mode);
|
|
55003
|
+
};
|
|
55004
|
+
const onData = (chunk) => {
|
|
55005
|
+
buffer += chunk.toString("latin1");
|
|
55006
|
+
if (/\]11;[^\x07\x1b]*(\x07|\x1b\\)/.test(buffer)) {
|
|
55007
|
+
finish(classifyOscBackground(buffer));
|
|
55008
|
+
}
|
|
55009
|
+
};
|
|
55010
|
+
const timer = setTimeout(() => finish(null), timeoutMs);
|
|
55011
|
+
try {
|
|
55012
|
+
if (!wasRaw)
|
|
55013
|
+
stdin.setRawMode(true);
|
|
55014
|
+
stdin.resume();
|
|
55015
|
+
stdin.on("data", onData);
|
|
55016
|
+
stdout.write("\x1B]11;?\x07");
|
|
55017
|
+
} catch {
|
|
55018
|
+
finish(null);
|
|
55019
|
+
}
|
|
55020
|
+
});
|
|
55021
|
+
}
|
|
55022
|
+
async function detectAndSetThemeMode() {
|
|
55023
|
+
const override = themeModeOverride();
|
|
55024
|
+
if (override) {
|
|
55025
|
+
setThemeMode(override);
|
|
55026
|
+
return override;
|
|
55027
|
+
}
|
|
55028
|
+
const fromEnv = themeModeFromColorFgBg();
|
|
55029
|
+
if (fromEnv) {
|
|
55030
|
+
setThemeMode(fromEnv);
|
|
55031
|
+
return fromEnv;
|
|
55032
|
+
}
|
|
55033
|
+
const fromOsc = await queryTerminalThemeMode();
|
|
55034
|
+
setThemeMode(fromOsc);
|
|
55035
|
+
return fromOsc;
|
|
55036
|
+
}
|
|
55037
|
+
function detectAndSetThemeModeSync() {
|
|
55038
|
+
const mode = themeModeOverride() ?? themeModeFromColorFgBg();
|
|
55039
|
+
if (mode)
|
|
55040
|
+
setThemeMode(mode);
|
|
55041
|
+
return mode ?? detected;
|
|
55042
|
+
}
|
|
55043
|
+
var detected = null, listeners, MID_SRGB_LUMINANCE;
|
|
55044
|
+
var init_theme_mode = __esm(() => {
|
|
55045
|
+
listeners = [];
|
|
55046
|
+
MID_SRGB_LUMINANCE = relativeLuminance(0.5, 0.5, 0.5);
|
|
55047
|
+
});
|
|
55048
|
+
|
|
55049
|
+
// src/theme/ansi.ts
|
|
55050
|
+
function fgHex(hex3) {
|
|
55051
|
+
const r = Number.parseInt(hex3.slice(1, 3), 16);
|
|
55052
|
+
const g = Number.parseInt(hex3.slice(3, 5), 16);
|
|
55053
|
+
const b = Number.parseInt(hex3.slice(5, 7), 16);
|
|
55054
|
+
return `\x1B[38;2;${r};${g};${b}m`;
|
|
55055
|
+
}
|
|
55056
|
+
function bgHex(hex3) {
|
|
55057
|
+
const r = Number.parseInt(hex3.slice(1, 3), 16);
|
|
55058
|
+
const g = Number.parseInt(hex3.slice(3, 5), 16);
|
|
55059
|
+
const b = Number.parseInt(hex3.slice(5, 7), 16);
|
|
55060
|
+
return `\x1B[48;2;${r};${g};${b}m`;
|
|
55061
|
+
}
|
|
55062
|
+
function cliAnsi() {
|
|
55063
|
+
if (process.env.NO_COLOR)
|
|
55064
|
+
return NONE;
|
|
55065
|
+
return getThemeMode() === "light" ? LIGHT : CLASSIC;
|
|
55066
|
+
}
|
|
55067
|
+
var CLASSIC, LIGHT, NONE;
|
|
55068
|
+
var init_ansi = __esm(() => {
|
|
55069
|
+
init_theme_mode();
|
|
55070
|
+
CLASSIC = {
|
|
55071
|
+
RESET: "\x1B[0m",
|
|
55072
|
+
BOLD: "\x1B[1m",
|
|
55073
|
+
DIM: "\x1B[2m",
|
|
55074
|
+
ITALIC: "\x1B[3m",
|
|
55075
|
+
GREEN: "\x1B[32m",
|
|
55076
|
+
BRIGHT_GREEN: "\x1B[92m",
|
|
55077
|
+
RED: "\x1B[31m",
|
|
55078
|
+
YELLOW: "\x1B[33m",
|
|
55079
|
+
CYAN: "\x1B[36m",
|
|
55080
|
+
BLUE: "\x1B[34m",
|
|
55081
|
+
MAGENTA: "\x1B[35m",
|
|
55082
|
+
GRAY: "\x1B[90m",
|
|
55083
|
+
STRONG: "\x1B[37m"
|
|
55084
|
+
};
|
|
55085
|
+
LIGHT = {
|
|
55086
|
+
RESET: "\x1B[0m",
|
|
55087
|
+
BOLD: "\x1B[1m",
|
|
55088
|
+
DIM: "\x1B[2m",
|
|
55089
|
+
ITALIC: "\x1B[3m",
|
|
55090
|
+
GREEN: fgHex("#15803d"),
|
|
55091
|
+
BRIGHT_GREEN: fgHex("#166534"),
|
|
55092
|
+
RED: fgHex("#dc2626"),
|
|
55093
|
+
YELLOW: fgHex("#a16207"),
|
|
55094
|
+
CYAN: fgHex("#0e7490"),
|
|
55095
|
+
BLUE: fgHex("#1d4ed8"),
|
|
55096
|
+
MAGENTA: fgHex("#9333ea"),
|
|
55097
|
+
GRAY: fgHex("#6b7280"),
|
|
55098
|
+
STRONG: fgHex("#111827")
|
|
55099
|
+
};
|
|
55100
|
+
NONE = {
|
|
55101
|
+
RESET: "",
|
|
55102
|
+
BOLD: "",
|
|
55103
|
+
DIM: "",
|
|
55104
|
+
ITALIC: "",
|
|
55105
|
+
GREEN: "",
|
|
55106
|
+
BRIGHT_GREEN: "",
|
|
55107
|
+
RED: "",
|
|
55108
|
+
YELLOW: "",
|
|
55109
|
+
CYAN: "",
|
|
55110
|
+
BLUE: "",
|
|
55111
|
+
MAGENTA: "",
|
|
55112
|
+
GRAY: "",
|
|
55113
|
+
STRONG: ""
|
|
55114
|
+
};
|
|
55115
|
+
});
|
|
55116
|
+
|
|
54915
55117
|
// src/behavior-command.ts
|
|
54916
55118
|
var exports_behavior_command = {};
|
|
54917
55119
|
__export(exports_behavior_command, {
|
|
@@ -55097,10 +55299,23 @@ Usage:
|
|
|
55097
55299
|
process.exit(1);
|
|
55098
55300
|
}
|
|
55099
55301
|
}
|
|
55100
|
-
var green = (s) =>
|
|
55302
|
+
var green = (s) => {
|
|
55303
|
+
const a = cliAnsi();
|
|
55304
|
+
return `${a.GREEN}${s}${a.RESET}`;
|
|
55305
|
+
}, yellow = (s) => {
|
|
55306
|
+
const a = cliAnsi();
|
|
55307
|
+
return `${a.YELLOW}${s}${a.RESET}`;
|
|
55308
|
+
}, dim2 = (s) => {
|
|
55309
|
+
const a = cliAnsi();
|
|
55310
|
+
return `${a.DIM}${s}${a.RESET}`;
|
|
55311
|
+
}, bold2 = (s) => {
|
|
55312
|
+
const a = cliAnsi();
|
|
55313
|
+
return `${a.BOLD}${s}${a.RESET}`;
|
|
55314
|
+
};
|
|
55101
55315
|
var init_behavior_command = __esm(() => {
|
|
55102
55316
|
init_behavior();
|
|
55103
55317
|
init_profile_config();
|
|
55318
|
+
init_ansi();
|
|
55104
55319
|
});
|
|
55105
55320
|
|
|
55106
55321
|
// src/team-grid.ts
|
|
@@ -57088,13 +57303,13 @@ var init_mjs = __esm(() => {
|
|
|
57088
57303
|
this.#sigListeners = {};
|
|
57089
57304
|
for (const sig of signals) {
|
|
57090
57305
|
this.#sigListeners[sig] = () => {
|
|
57091
|
-
const
|
|
57306
|
+
const listeners2 = this.#process.listeners(sig);
|
|
57092
57307
|
let { count } = this.#emitter;
|
|
57093
57308
|
const p = process4;
|
|
57094
57309
|
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
|
|
57095
57310
|
count += p.__signal_exit_emitter__.count;
|
|
57096
57311
|
}
|
|
57097
|
-
if (
|
|
57312
|
+
if (listeners2.length === count) {
|
|
57098
57313
|
this.unload();
|
|
57099
57314
|
const ret = this.#emitter.emit("exit", null, sig);
|
|
57100
57315
|
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
@@ -68316,7 +68531,21 @@ __export(exports_quota_command, {
|
|
|
68316
68531
|
formatRelativeReset: () => formatRelativeReset,
|
|
68317
68532
|
buildUsageBar: () => buildUsageBar
|
|
68318
68533
|
});
|
|
68534
|
+
function refreshAnsi() {
|
|
68535
|
+
const a = cliAnsi();
|
|
68536
|
+
R = a.RESET;
|
|
68537
|
+
B = a.BOLD;
|
|
68538
|
+
D = a.DIM;
|
|
68539
|
+
I = a.ITALIC;
|
|
68540
|
+
RED = a.RED;
|
|
68541
|
+
GRN = a.GREEN;
|
|
68542
|
+
YEL = a.YELLOW;
|
|
68543
|
+
CYN = a.CYAN;
|
|
68544
|
+
WHT = a.STRONG;
|
|
68545
|
+
GRY = a.GRAY;
|
|
68546
|
+
}
|
|
68319
68547
|
async function quotaCommand(provider) {
|
|
68548
|
+
refreshAnsi();
|
|
68320
68549
|
const adapter = provider ? resolveAdapterFromInput(provider) : await promptForAdapter();
|
|
68321
68550
|
if (!adapter) {
|
|
68322
68551
|
printUnknownProvider(provider ?? "");
|
|
@@ -68457,6 +68686,7 @@ function colorFor(usedPct) {
|
|
|
68457
68686
|
return usedPct < 50 ? GRN : usedPct < 80 ? YEL : RED;
|
|
68458
68687
|
}
|
|
68459
68688
|
function buildUsageBar(usedFraction, color, width = 24) {
|
|
68689
|
+
refreshAnsi();
|
|
68460
68690
|
const clamped = Math.max(0, Math.min(1, usedFraction));
|
|
68461
68691
|
const usedCols = clamped >= 1 ? width : Math.max(clamped > 0.005 ? 1 : 0, Math.round(clamped * width));
|
|
68462
68692
|
const freeCols = width - usedCols;
|
|
@@ -68480,9 +68710,10 @@ function formatRelativeReset(resetTime) {
|
|
|
68480
68710
|
return `resets ${hours}h`;
|
|
68481
68711
|
return `resets ${minutes}m`;
|
|
68482
68712
|
}
|
|
68483
|
-
var R = "
|
|
68713
|
+
var R = "", B = "", D = "", I = "", RED = "", GRN = "", YEL = "", CYN = "", WHT = "", GRY = "", W = 58, FRIENDLY_NAMES;
|
|
68484
68714
|
var init_quota_command = __esm(() => {
|
|
68485
68715
|
init_provider_definitions();
|
|
68716
|
+
init_ansi();
|
|
68486
68717
|
init_registry();
|
|
68487
68718
|
FRIENDLY_NAMES = {
|
|
68488
68719
|
gpt: "openai-codex",
|
|
@@ -69614,11 +69845,11 @@ var init_model_selector = __esm(() => {
|
|
|
69614
69845
|
import { createTextAttributes } from "@opentui/core";
|
|
69615
69846
|
function latencyBucket(ms) {
|
|
69616
69847
|
const v = Math.max(0, ms);
|
|
69617
|
-
for (const b of
|
|
69848
|
+
for (const b of activeLatencyBuckets) {
|
|
69618
69849
|
if (v < b.maxMs)
|
|
69619
69850
|
return b;
|
|
69620
69851
|
}
|
|
69621
|
-
return
|
|
69852
|
+
return activeLatencyBuckets[activeLatencyBuckets.length - 1];
|
|
69622
69853
|
}
|
|
69623
69854
|
function formatLatency(ms) {
|
|
69624
69855
|
if (ms < 1000)
|
|
@@ -69647,6 +69878,24 @@ function hexToAnsiFg(hex3) {
|
|
|
69647
69878
|
const b = Number.parseInt(hex3.slice(5, 7), 16);
|
|
69648
69879
|
return `\x1B[38;2;${r};${g};${b}m`;
|
|
69649
69880
|
}
|
|
69881
|
+
function registerPaletteRefresher(fn) {
|
|
69882
|
+
paletteRefreshers.push(fn);
|
|
69883
|
+
fn();
|
|
69884
|
+
}
|
|
69885
|
+
function applyTuiTheme(mode) {
|
|
69886
|
+
const palette = mode === "light" ? LIGHT2 : DARK;
|
|
69887
|
+
activeLatencyBuckets = mode === "light" ? LATENCY_BUCKETS_LIGHT : LATENCY_BUCKETS_DARK;
|
|
69888
|
+
Object.assign(C, palette);
|
|
69889
|
+
Object.assign(STAGE_BG, mode === "light" ? STAGE_BG_LIGHT : STAGE_BG_DARK);
|
|
69890
|
+
STAGE_BG_ANSI.network = hexToAnsiBg(STAGE_BG.network);
|
|
69891
|
+
STAGE_BG_ANSI.server = hexToAnsiBg(STAGE_BG.server);
|
|
69892
|
+
STAGE_BG_ANSI.streaming = hexToAnsiBg(STAGE_BG.streaming);
|
|
69893
|
+
STAGE_FG.network = C.cyan;
|
|
69894
|
+
STAGE_FG.server = C.blue;
|
|
69895
|
+
STAGE_FG.streaming = C.yellow;
|
|
69896
|
+
for (const fn of paletteRefreshers)
|
|
69897
|
+
fn();
|
|
69898
|
+
}
|
|
69650
69899
|
function throughputFg(tokensPerSec) {
|
|
69651
69900
|
if (tokensPerSec >= 100)
|
|
69652
69901
|
return C.brightGreen;
|
|
@@ -69713,9 +69962,10 @@ function tokBarCells(tokensPerSec, maxTokPerSec, tokWidth) {
|
|
|
69713
69962
|
const raw2 = Math.round(tokWidth * Math.max(0, tokensPerSec) / denom);
|
|
69714
69963
|
return Math.min(tokWidth, Math.max(0, raw2));
|
|
69715
69964
|
}
|
|
69716
|
-
var C, bold3, A,
|
|
69965
|
+
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;
|
|
69717
69966
|
var init_theme2 = __esm(() => {
|
|
69718
|
-
|
|
69967
|
+
init_theme_mode();
|
|
69968
|
+
DARK = {
|
|
69719
69969
|
bg: "#000000",
|
|
69720
69970
|
bgAlt: "#111111",
|
|
69721
69971
|
bgHighlight: "#1e3a5f",
|
|
@@ -69735,6 +69985,8 @@ var init_theme2 = __esm(() => {
|
|
|
69735
69985
|
orange: "#ff8800",
|
|
69736
69986
|
white: "#ffffff",
|
|
69737
69987
|
black: "#000000",
|
|
69988
|
+
ink: "#ffffff",
|
|
69989
|
+
strong: "#ffffff",
|
|
69738
69990
|
tabActiveBg: "#0088ff",
|
|
69739
69991
|
tabInactiveBg: "#001a33",
|
|
69740
69992
|
tabActiveFg: "#ffffff",
|
|
@@ -69744,23 +69996,71 @@ var init_theme2 = __esm(() => {
|
|
|
69744
69996
|
chipKeyBg: "#3a3a3a",
|
|
69745
69997
|
chipLabelBg: "#222222"
|
|
69746
69998
|
};
|
|
69999
|
+
LIGHT2 = {
|
|
70000
|
+
bg: "#ffffff",
|
|
70001
|
+
bgAlt: "#f3f4f6",
|
|
70002
|
+
bgHighlight: "#bfdbfe",
|
|
70003
|
+
bgError: "#fee2e2",
|
|
70004
|
+
fg: "#1f2937",
|
|
70005
|
+
fgMuted: "#4b5563",
|
|
70006
|
+
dim: "#6b7280",
|
|
70007
|
+
border: "#d1d5db",
|
|
70008
|
+
focusBorder: "#2563eb",
|
|
70009
|
+
green: "#15803d",
|
|
70010
|
+
brightGreen: "#166534",
|
|
70011
|
+
red: "#dc2626",
|
|
70012
|
+
yellow: "#a16207",
|
|
70013
|
+
cyan: "#0e7490",
|
|
70014
|
+
blue: "#1d4ed8",
|
|
70015
|
+
magenta: "#9333ea",
|
|
70016
|
+
orange: "#c2410c",
|
|
70017
|
+
white: "#ffffff",
|
|
70018
|
+
black: "#000000",
|
|
70019
|
+
ink: "#ffffff",
|
|
70020
|
+
strong: "#111827",
|
|
70021
|
+
tabActiveBg: "#2563eb",
|
|
70022
|
+
tabInactiveBg: "#e5e7eb",
|
|
70023
|
+
tabActiveFg: "#ffffff",
|
|
70024
|
+
tabInactiveFg: "#374151",
|
|
70025
|
+
pillKeyBg: "#2d6e3e",
|
|
70026
|
+
pillOauthBg: "#1f6d75",
|
|
70027
|
+
chipKeyBg: "#d1d5db",
|
|
70028
|
+
chipLabelBg: "#e5e7eb"
|
|
70029
|
+
};
|
|
70030
|
+
C = { ...DARK };
|
|
69747
70031
|
bold3 = createTextAttributes({ bold: true });
|
|
69748
70032
|
A = {
|
|
69749
70033
|
bold: bold3,
|
|
69750
70034
|
boldIf: (enabled2) => enabled2 ? bold3 : undefined
|
|
69751
70035
|
};
|
|
69752
|
-
|
|
70036
|
+
LATENCY_BUCKETS_DARK = [
|
|
69753
70037
|
{ maxMs: 500, hex: "#1f8f3b" },
|
|
69754
70038
|
{ maxMs: 1000, hex: "#2d6e3e" },
|
|
69755
70039
|
{ maxMs: 3000, hex: "#8a7d1e" },
|
|
69756
70040
|
{ maxMs: 6000, hex: "#b5651d" },
|
|
69757
70041
|
{ maxMs: Number.POSITIVE_INFINITY, hex: "#9e2b2b" }
|
|
69758
70042
|
];
|
|
69759
|
-
|
|
70043
|
+
LATENCY_BUCKETS_LIGHT = [
|
|
70044
|
+
{ maxMs: 500, hex: "#1d8738" },
|
|
70045
|
+
{ maxMs: 1000, hex: "#2d6e3e" },
|
|
70046
|
+
{ maxMs: 3000, hex: "#83771c" },
|
|
70047
|
+
{ maxMs: 6000, hex: "#b0621c" },
|
|
70048
|
+
{ maxMs: Number.POSITIVE_INFINITY, hex: "#9e2b2b" }
|
|
70049
|
+
];
|
|
70050
|
+
activeLatencyBuckets = LATENCY_BUCKETS_DARK;
|
|
70051
|
+
STAGE_BG_DARK = {
|
|
69760
70052
|
network: "#00b3c4",
|
|
69761
70053
|
server: "#2563ff",
|
|
69762
70054
|
streaming: "#ffcc00"
|
|
69763
70055
|
};
|
|
70056
|
+
STAGE_BG_LIGHT = {
|
|
70057
|
+
network: "#0891b2",
|
|
70058
|
+
server: "#2563eb",
|
|
70059
|
+
streaming: "#d97706"
|
|
70060
|
+
};
|
|
70061
|
+
STAGE_BG = {
|
|
70062
|
+
...STAGE_BG_DARK
|
|
70063
|
+
};
|
|
69764
70064
|
STAGE_FG = {
|
|
69765
70065
|
network: C.cyan,
|
|
69766
70066
|
server: C.blue,
|
|
@@ -69771,9 +70071,32 @@ var init_theme2 = __esm(() => {
|
|
|
69771
70071
|
server: hexToAnsiBg(STAGE_BG.server),
|
|
69772
70072
|
streaming: hexToAnsiBg(STAGE_BG.streaming)
|
|
69773
70073
|
};
|
|
70074
|
+
paletteRefreshers = [];
|
|
70075
|
+
onThemeModeChange(applyTuiTheme);
|
|
69774
70076
|
});
|
|
69775
70077
|
|
|
69776
70078
|
// src/probe/probe-results-printer.ts
|
|
70079
|
+
function buildPrinterColors() {
|
|
70080
|
+
const a = cliAnsi();
|
|
70081
|
+
const light = getThemeMode() === "light";
|
|
70082
|
+
const noColor = !!process.env.NO_COLOR;
|
|
70083
|
+
return {
|
|
70084
|
+
reset: a.RESET,
|
|
70085
|
+
bold: a.BOLD,
|
|
70086
|
+
dim: a.DIM,
|
|
70087
|
+
green: a.GREEN,
|
|
70088
|
+
red: a.RED,
|
|
70089
|
+
yellow: a.YELLOW,
|
|
70090
|
+
cyan: a.CYAN,
|
|
70091
|
+
brightGreen: a.BRIGHT_GREEN,
|
|
70092
|
+
gray: a.GRAY,
|
|
70093
|
+
bgFastest: noColor ? "" : light ? bgHex("#bbf7d0") : "\x1B[48;5;22m",
|
|
70094
|
+
bgSlowest: noColor ? "" : light ? bgHex("#fecaca") : "\x1B[48;5;95m"
|
|
70095
|
+
};
|
|
70096
|
+
}
|
|
70097
|
+
function refreshPc() {
|
|
70098
|
+
pc = buildPrinterColors();
|
|
70099
|
+
}
|
|
69777
70100
|
function stripAnsi2(s) {
|
|
69778
70101
|
return s.replace(ANSI_RE2, "");
|
|
69779
70102
|
}
|
|
@@ -70186,6 +70509,7 @@ function buildCardLayout(result, isLiveProbe, directKeyVar) {
|
|
|
70186
70509
|
};
|
|
70187
70510
|
}
|
|
70188
70511
|
function computeRequiredWidth(result, isLiveProbe, directKeyVar) {
|
|
70512
|
+
refreshPc();
|
|
70189
70513
|
const layout = buildCardLayout(result, isLiveProbe, directKeyVar);
|
|
70190
70514
|
return computeCardWidth(layout.rows, layout.widths, visibleLength(layout.titleStyled), visibleLength(layout.summaryStyled), layout.footerVis);
|
|
70191
70515
|
}
|
|
@@ -70401,6 +70725,7 @@ function renderLeaderboard(results, scales, maxWidth, w) {
|
|
|
70401
70725
|
`);
|
|
70402
70726
|
}
|
|
70403
70727
|
function printProbeResults(results, isLiveProbe) {
|
|
70728
|
+
refreshPc();
|
|
70404
70729
|
const w = process.stderr.write.bind(process.stderr);
|
|
70405
70730
|
w(`
|
|
70406
70731
|
`);
|
|
@@ -70437,26 +70762,30 @@ function printProbeResults(results, isLiveProbe) {
|
|
|
70437
70762
|
var pc, ANSI_RE2, PRINTER_BAR_WIDTH = 24, PRINTER_TOK_WIDTH = 14, PRINTER_TRACK = "\xB7", PRINTER_BAR_FILL = "\u2588", STAGE_NUM_W = 6, PRINTER_TOK_VALUE_W = 9, PRINTER_BARS_FULL_WIDTH, PRINTER_BARS_NOTOK_WIDTH, PRINTER_BARS_MIN_WIDTH, MIN_CARD_WIDTH = 60, CARD_PADDING_LEFT = 2, CARD_PADDING_RIGHT = 2;
|
|
70438
70763
|
var init_probe_results_printer = __esm(() => {
|
|
70439
70764
|
init_probe_live();
|
|
70765
|
+
init_ansi();
|
|
70766
|
+
init_theme_mode();
|
|
70440
70767
|
init_theme2();
|
|
70441
|
-
pc = {
|
|
70442
|
-
reset: "\x1B[0m",
|
|
70443
|
-
bold: "\x1B[1m",
|
|
70444
|
-
dim: "\x1B[2m",
|
|
70445
|
-
green: "\x1B[32m",
|
|
70446
|
-
red: "\x1B[31m",
|
|
70447
|
-
yellow: "\x1B[33m",
|
|
70448
|
-
cyan: "\x1B[36m",
|
|
70449
|
-
brightGreen: "\x1B[92m",
|
|
70450
|
-
gray: "\x1B[90m",
|
|
70451
|
-
bgFastest: "\x1B[48;5;22m",
|
|
70452
|
-
bgSlowest: "\x1B[48;5;95m"
|
|
70453
|
-
};
|
|
70454
70768
|
ANSI_RE2 = /\x1b\[[0-9;]*[A-Za-z]/g;
|
|
70455
70769
|
PRINTER_BARS_FULL_WIDTH = 24 + 2 + 7 + 34 + 17 + 9;
|
|
70456
70770
|
PRINTER_BARS_NOTOK_WIDTH = 24 + 2 + 7 + 34 + 2 + 9;
|
|
70457
70771
|
PRINTER_BARS_MIN_WIDTH = 24 + 2 + 7 + 2 + 9;
|
|
70458
70772
|
});
|
|
70459
70773
|
|
|
70774
|
+
// src/theme/renderer-theme.ts
|
|
70775
|
+
async function applyRendererThemeMode(renderer) {
|
|
70776
|
+
const override = themeModeOverride();
|
|
70777
|
+
if (override) {
|
|
70778
|
+
setThemeMode(override);
|
|
70779
|
+
return;
|
|
70780
|
+
}
|
|
70781
|
+
const mode = await renderer.waitForThemeMode(THEME_MODE_WAIT_MS).catch(() => null);
|
|
70782
|
+
setThemeMode(mode ?? getThemeMode());
|
|
70783
|
+
}
|
|
70784
|
+
var THEME_MODE_WAIT_MS = 250;
|
|
70785
|
+
var init_renderer_theme = __esm(() => {
|
|
70786
|
+
init_theme_mode();
|
|
70787
|
+
});
|
|
70788
|
+
|
|
70460
70789
|
// src/probe/probe-tui-app.tsx
|
|
70461
70790
|
import { useKeyboard, useTerminalDimensions } from "@opentui/react";
|
|
70462
70791
|
import { useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
|
|
@@ -70573,6 +70902,9 @@ function padEndSafe(s, n) {
|
|
|
70573
70902
|
function stripAnsi3(text) {
|
|
70574
70903
|
return text.replace(/\x1b\[[0-9;]*[A-Za-z]/g, "");
|
|
70575
70904
|
}
|
|
70905
|
+
function ishGreen() {
|
|
70906
|
+
return getThemeMode() === "light" ? "#047857" : "#00ff7f";
|
|
70907
|
+
}
|
|
70576
70908
|
function Banner() {
|
|
70577
70909
|
const claudLines = [
|
|
70578
70910
|
" \u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ",
|
|
@@ -70584,7 +70916,6 @@ function Banner() {
|
|
|
70584
70916
|
];
|
|
70585
70917
|
const ishLines = [" _ _ ", " (_)__| |_ ", " | (_-< ' \\ ", " |_/__/_||_|"];
|
|
70586
70918
|
const ishPad = " ";
|
|
70587
|
-
const ishGreen = "#00ff7f";
|
|
70588
70919
|
const renderBannerRow = (claudLine, ishLine, key) => /* @__PURE__ */ jsxDEV("box", {
|
|
70589
70920
|
flexDirection: "row",
|
|
70590
70921
|
children: [
|
|
@@ -70601,7 +70932,7 @@ function Banner() {
|
|
|
70601
70932
|
}, undefined, false, undefined, this),
|
|
70602
70933
|
/* @__PURE__ */ jsxDEV("text", {
|
|
70603
70934
|
children: /* @__PURE__ */ jsxDEV("span", {
|
|
70604
|
-
fg: ishGreen,
|
|
70935
|
+
fg: ishGreen(),
|
|
70605
70936
|
attributes: A.bold,
|
|
70606
70937
|
children: ishLine
|
|
70607
70938
|
}, undefined, false, undefined, this)
|
|
@@ -70742,7 +71073,7 @@ function ProgressBar({
|
|
|
70742
71073
|
children: " "
|
|
70743
71074
|
}, undefined, false, undefined, this),
|
|
70744
71075
|
/* @__PURE__ */ jsxDEV("span", {
|
|
70745
|
-
fg: C.
|
|
71076
|
+
fg: C.strong,
|
|
70746
71077
|
children: padStartSafe2(formatLatency(t.totalMs), TOTAL_COL)
|
|
70747
71078
|
}, undefined, false, undefined, this),
|
|
70748
71079
|
layout.showBreakdown && /* @__PURE__ */ jsxDEV(Fragment, {
|
|
@@ -70886,10 +71217,10 @@ function ModelGroup({
|
|
|
70886
71217
|
children: " "
|
|
70887
71218
|
}, undefined, false, undefined, this),
|
|
70888
71219
|
/* @__PURE__ */ jsxDEV("box", {
|
|
70889
|
-
backgroundColor:
|
|
71220
|
+
backgroundColor: C.bgHighlight,
|
|
70890
71221
|
children: /* @__PURE__ */ jsxDEV("text", {
|
|
70891
71222
|
children: /* @__PURE__ */ jsxDEV("span", {
|
|
70892
|
-
fg:
|
|
71223
|
+
fg: C.strong,
|
|
70893
71224
|
attributes: A.bold,
|
|
70894
71225
|
children: headerText
|
|
70895
71226
|
}, undefined, false, undefined, this)
|
|
@@ -71108,7 +71439,7 @@ function DetailLinkRow({
|
|
|
71108
71439
|
children: " "
|
|
71109
71440
|
}, undefined, false, undefined, this),
|
|
71110
71441
|
/* @__PURE__ */ jsxDEV("span", {
|
|
71111
|
-
fg: C.
|
|
71442
|
+
fg: C.strong,
|
|
71112
71443
|
children: padStartSafe2(formatLatency(t.totalMs), TOTAL_COL)
|
|
71113
71444
|
}, undefined, false, undefined, this),
|
|
71114
71445
|
layout.showBreakdown && /* @__PURE__ */ jsxDEV(Fragment, {
|
|
@@ -71416,7 +71747,7 @@ function LeaderLiveRow({
|
|
|
71416
71747
|
children: [
|
|
71417
71748
|
lead,
|
|
71418
71749
|
/* @__PURE__ */ jsxDEV("span", {
|
|
71419
|
-
fg: C.
|
|
71750
|
+
fg: C.strong,
|
|
71420
71751
|
children: padStartSafe2(formatLatency(t.totalMs), TOTAL_COL)
|
|
71421
71752
|
}, undefined, false, undefined, this)
|
|
71422
71753
|
]
|
|
@@ -71446,7 +71777,7 @@ function LeaderLiveRow({
|
|
|
71446
71777
|
children: " "
|
|
71447
71778
|
}, undefined, false, undefined, this),
|
|
71448
71779
|
/* @__PURE__ */ jsxDEV("span", {
|
|
71449
|
-
fg: C.
|
|
71780
|
+
fg: C.strong,
|
|
71450
71781
|
children: padStartSafe2(formatLatency(t.totalMs), TOTAL_COL)
|
|
71451
71782
|
}, undefined, false, undefined, this),
|
|
71452
71783
|
layout.showBreakdown && /* @__PURE__ */ jsxDEV(Fragment, {
|
|
@@ -71800,6 +72131,7 @@ function ProbeApp({
|
|
|
71800
72131
|
var ANIM_FRAMES, TIMELINE_BAR_FULL = 24, TIMELINE_BAR_NARROW = 12, TOK_BAR_FULL = 14, TOTAL_COL = 7, STAGE_NUM_W2 = 6, BREAKDOWN_COL, TOK_VALUE_COL = 7, TRACK_CHAR = "\xB7", BAR_FILL = "\u2588", BANNER_ROWS = 7, SCROLL_HINT_ROWS = 1, LEGEND_ROWS = 2, MIN_LIST_H = 4, TAB_BAR_ROWS = 2;
|
|
71801
72132
|
var init_probe_tui_app = __esm(() => {
|
|
71802
72133
|
init_probe_live();
|
|
72134
|
+
init_theme_mode();
|
|
71803
72135
|
init_theme2();
|
|
71804
72136
|
ANIM_FRAMES = ["\u2593", "\u2592", "\u2591", "\u2592"];
|
|
71805
72137
|
BREAKDOWN_COL = 16 + 3 * STAGE_NUM_W2;
|
|
@@ -71812,10 +72144,11 @@ import { jsxDEV as jsxDEV2 } from "@opentui/react/jsx-dev-runtime";
|
|
|
71812
72144
|
async function startProbeTui(initial) {
|
|
71813
72145
|
const renderer = await createCliRenderer({
|
|
71814
72146
|
stdout: process.stderr,
|
|
71815
|
-
|
|
72147
|
+
screenMode: "main-screen",
|
|
71816
72148
|
useMouse: true,
|
|
71817
72149
|
exitOnCtrlC: true
|
|
71818
72150
|
});
|
|
72151
|
+
await applyRendererThemeMode(renderer);
|
|
71819
72152
|
const store = new ProbeStore(initial);
|
|
71820
72153
|
let resolveQuit;
|
|
71821
72154
|
const quitPromise = new Promise((resolve5) => {
|
|
@@ -71848,6 +72181,7 @@ async function startProbeTui(initial) {
|
|
|
71848
72181
|
return { store, waitForQuit: () => quitPromise, shutdown };
|
|
71849
72182
|
}
|
|
71850
72183
|
var init_probe_tui_runtime = __esm(() => {
|
|
72184
|
+
init_renderer_theme();
|
|
71851
72185
|
init_probe_tui_app();
|
|
71852
72186
|
});
|
|
71853
72187
|
|
|
@@ -72916,9 +73250,7 @@ async function probeModelRouting(models, jsonOutput, options = { live: true, tim
|
|
|
72916
73250
|
};
|
|
72917
73251
|
}
|
|
72918
73252
|
if (jsonOutput) {
|
|
72919
|
-
const DIM =
|
|
72920
|
-
const YELLOW = "\x1B[33m";
|
|
72921
|
-
const RESET = "\x1B[0m";
|
|
73253
|
+
const { DIM, YELLOW, RESET } = cliAnsi();
|
|
72922
73254
|
let liveProxy2 = null;
|
|
72923
73255
|
if (options.live) {
|
|
72924
73256
|
try {
|
|
@@ -73192,14 +73524,15 @@ async function probeModelRouting(models, jsonOutput, options = { live: true, tim
|
|
|
73192
73524
|
}
|
|
73193
73525
|
function printHelp2() {
|
|
73194
73526
|
const useColor = !!process.stdout.isTTY && !process.env.NO_COLOR;
|
|
73195
|
-
const
|
|
73196
|
-
const
|
|
73197
|
-
const
|
|
73198
|
-
const
|
|
73199
|
-
const
|
|
73200
|
-
const
|
|
73201
|
-
const
|
|
73202
|
-
const
|
|
73527
|
+
const A2 = cliAnsi();
|
|
73528
|
+
const c = (esc2) => (s) => useColor && esc2 ? `${esc2}${s}${A2.RESET}` : s;
|
|
73529
|
+
const bold4 = c(A2.BOLD);
|
|
73530
|
+
const dim3 = c(A2.DIM);
|
|
73531
|
+
const cyan = c(A2.CYAN);
|
|
73532
|
+
const green2 = c(A2.GREEN);
|
|
73533
|
+
const yellow2 = c(A2.YELLOW);
|
|
73534
|
+
const magenta = c(A2.MAGENTA);
|
|
73535
|
+
const blue = c(A2.BLUE);
|
|
73203
73536
|
const h = (title) => bold4(cyan(`\u258C ${title}`));
|
|
73204
73537
|
console.log(`
|
|
73205
73538
|
${bold4("claudish")} ${dim3("\xB7")} Run Claude Code with any AI model
|
|
@@ -73613,6 +73946,7 @@ var init_cli = __esm(() => {
|
|
|
73613
73946
|
init_probe_runner();
|
|
73614
73947
|
init_provider_definitions();
|
|
73615
73948
|
init_routing_rules();
|
|
73949
|
+
init_ansi();
|
|
73616
73950
|
init_provider_resolver();
|
|
73617
73951
|
__filename3 = fileURLToPath3(import.meta.url);
|
|
73618
73952
|
__dirname3 = dirname11(__filename3);
|
|
@@ -73748,13 +74082,15 @@ async function checkForUpdates(currentVersion, options = {}) {
|
|
|
73748
74082
|
return;
|
|
73749
74083
|
}
|
|
73750
74084
|
if (!quiet) {
|
|
74085
|
+
const { RESET, BOLD, GREEN, CYAN, DIM } = cliAnsi();
|
|
73751
74086
|
console.error("");
|
|
73752
74087
|
console.error(` ${CYAN}\u250C${RESET} ${BOLD}Update available:${RESET} ${currentVersion} ${DIM}\u2192${RESET} ${GREEN}${latestVersion}${RESET} ${DIM}Run:${RESET} ${BOLD}${CYAN}claudish update${RESET}`);
|
|
73753
74088
|
console.error("");
|
|
73754
74089
|
}
|
|
73755
74090
|
}
|
|
73756
|
-
var isWindows, NPM_REGISTRY_URL = "https://registry.npmjs.org/claudish/latest", CACHE_MAX_AGE_MS
|
|
74091
|
+
var isWindows, NPM_REGISTRY_URL = "https://registry.npmjs.org/claudish/latest", CACHE_MAX_AGE_MS;
|
|
73757
74092
|
var init_update_checker = __esm(() => {
|
|
74093
|
+
init_ansi();
|
|
73758
74094
|
isWindows = platform2() === "win32";
|
|
73759
74095
|
CACHE_MAX_AGE_MS = 24 * 60 * 60 * 1000;
|
|
73760
74096
|
});
|
|
@@ -73765,6 +74101,9 @@ __export(exports_update_command, {
|
|
|
73765
74101
|
updateCommand: () => updateCommand
|
|
73766
74102
|
});
|
|
73767
74103
|
import { execSync as execSync2 } from "child_process";
|
|
74104
|
+
function refreshAnsi2() {
|
|
74105
|
+
({ RESET, BOLD, GREEN, YELLOW, CYAN, RED: RED2, MAGENTA, DIM } = cliAnsi());
|
|
74106
|
+
}
|
|
73768
74107
|
function detectInstallationMethod() {
|
|
73769
74108
|
const scriptPath = process.argv[1] || "";
|
|
73770
74109
|
if (scriptPath.includes("/opt/homebrew/") || scriptPath.includes("/usr/local/Cellar/")) {
|
|
@@ -73799,8 +74138,8 @@ async function executeUpdate(command) {
|
|
|
73799
74138
|
return true;
|
|
73800
74139
|
} catch {
|
|
73801
74140
|
console.error(`
|
|
73802
|
-
${RED2}\u2717${
|
|
73803
|
-
console.error(`${YELLOW}Try manually:${
|
|
74141
|
+
${RED2}\u2717${RESET} ${BOLD}Update failed.${RESET}`);
|
|
74142
|
+
console.error(`${YELLOW}Try manually:${RESET}`);
|
|
73804
74143
|
console.error(` ${command}
|
|
73805
74144
|
`);
|
|
73806
74145
|
return false;
|
|
@@ -73881,15 +74220,15 @@ async function fetchChangelog(currentVersion, latestVersion) {
|
|
|
73881
74220
|
function itemStyle(type) {
|
|
73882
74221
|
switch (type) {
|
|
73883
74222
|
case "feat":
|
|
73884
|
-
return { symbol: "\u2726", color:
|
|
74223
|
+
return { symbol: "\u2726", color: GREEN };
|
|
73885
74224
|
case "fix":
|
|
73886
74225
|
return { symbol: "\u2726", color: YELLOW };
|
|
73887
74226
|
case "breaking":
|
|
73888
74227
|
return { symbol: "\u2726", color: MAGENTA };
|
|
73889
74228
|
case "perf":
|
|
73890
|
-
return { symbol: "\u2726", color:
|
|
74229
|
+
return { symbol: "\u2726", color: CYAN };
|
|
73891
74230
|
case "chore":
|
|
73892
|
-
return { symbol: "\u25AA", color:
|
|
74231
|
+
return { symbol: "\u25AA", color: DIM };
|
|
73893
74232
|
}
|
|
73894
74233
|
}
|
|
73895
74234
|
function displayChangelog(entries) {
|
|
@@ -73897,34 +74236,34 @@ function displayChangelog(entries) {
|
|
|
73897
74236
|
return;
|
|
73898
74237
|
}
|
|
73899
74238
|
const innerWidth = 50;
|
|
73900
|
-
const headerLabel = ` ${YELLOW}\u2726${
|
|
74239
|
+
const headerLabel = ` ${YELLOW}\u2726${RESET} ${BOLD}What's New${RESET}`;
|
|
73901
74240
|
const headerVisible = 14;
|
|
73902
74241
|
const headerPad = innerWidth - headerVisible;
|
|
73903
74242
|
console.log("");
|
|
73904
|
-
console.log(`${
|
|
73905
|
-
console.log(`${
|
|
73906
|
-
console.log(`${
|
|
74243
|
+
console.log(`${CYAN}\u250C${"\u2500".repeat(innerWidth + 1)}\u2510${RESET}`);
|
|
74244
|
+
console.log(`${CYAN}\u2502${RESET}${headerLabel}${" ".repeat(headerPad)}${CYAN}\u2502${RESET}`);
|
|
74245
|
+
console.log(`${CYAN}\u2514${"\u2500".repeat(innerWidth + 1)}\u2518${RESET}`);
|
|
73907
74246
|
console.log("");
|
|
73908
74247
|
for (const entry of entries) {
|
|
73909
74248
|
const titlePart = entry.title ? ` ${entry.title}` : "";
|
|
73910
|
-
console.log(` ${
|
|
73911
|
-
console.log(` ${
|
|
74249
|
+
console.log(` ${BOLD}${GREEN}v${entry.version}${RESET}${titlePart}`);
|
|
74250
|
+
console.log(` ${DIM}${"\u2500".repeat(30)}${RESET}`);
|
|
73912
74251
|
for (const item of entry.items) {
|
|
73913
74252
|
const { symbol: symbol2, color } = itemStyle(item.type);
|
|
73914
|
-
console.log(` ${color}${symbol2}${
|
|
74253
|
+
console.log(` ${color}${symbol2}${RESET} ${item.text}`);
|
|
73915
74254
|
}
|
|
73916
74255
|
console.log("");
|
|
73917
74256
|
}
|
|
73918
|
-
console.log(`${
|
|
74257
|
+
console.log(`${CYAN}Please restart any running claudish sessions.${RESET}`);
|
|
73919
74258
|
}
|
|
73920
74259
|
function printManualInstructions() {
|
|
73921
74260
|
console.log(`
|
|
73922
|
-
${
|
|
73923
|
-
console.log(`${YELLOW}Please update manually:${
|
|
74261
|
+
${BOLD}Unable to detect installation method.${RESET}`);
|
|
74262
|
+
console.log(`${YELLOW}Please update manually:${RESET}
|
|
73924
74263
|
`);
|
|
73925
|
-
console.log(` ${
|
|
73926
|
-
console.log(` ${
|
|
73927
|
-
console.log(` ${
|
|
74264
|
+
console.log(` ${CYAN}npm:${RESET} npm install -g claudish@latest`);
|
|
74265
|
+
console.log(` ${CYAN}bun:${RESET} bun install -g claudish@latest`);
|
|
74266
|
+
console.log(` ${CYAN}brew:${RESET} brew upgrade claudish
|
|
73928
74267
|
`);
|
|
73929
74268
|
}
|
|
73930
74269
|
function fetchLatestVersionViaNpm() {
|
|
@@ -73953,17 +74292,18 @@ async function resolveLatestVersion() {
|
|
|
73953
74292
|
return { error: fetchError };
|
|
73954
74293
|
}
|
|
73955
74294
|
async function updateCommand() {
|
|
74295
|
+
refreshAnsi2();
|
|
73956
74296
|
const currentVersion = getVersion3();
|
|
73957
74297
|
const installInfo = detectInstallationMethod();
|
|
73958
74298
|
const result = await resolveLatestVersion();
|
|
73959
74299
|
if ("error" in result) {
|
|
73960
|
-
console.error(`${RED2}\u2717${
|
|
73961
|
-
console.error(`${
|
|
73962
|
-
console.error(`${YELLOW}The npm registry may be slow or unreachable from this network.${
|
|
74300
|
+
console.error(`${RED2}\u2717${RESET} Unable to fetch latest version from npm registry.`);
|
|
74301
|
+
console.error(`${DIM}Reason: ${result.error}${RESET}`);
|
|
74302
|
+
console.error(`${YELLOW}The npm registry may be slow or unreachable from this network.${RESET}`);
|
|
73963
74303
|
const manualCommand = getUpdateCommand(installInfo.method);
|
|
73964
74304
|
if (manualCommand) {
|
|
73965
|
-
console.error(`${YELLOW}You can update manually:${
|
|
73966
|
-
console.error(` ${
|
|
74305
|
+
console.error(`${YELLOW}You can update manually:${RESET}`);
|
|
74306
|
+
console.error(` ${CYAN}${manualCommand}${RESET}
|
|
73967
74307
|
`);
|
|
73968
74308
|
} else {
|
|
73969
74309
|
printManualInstructions();
|
|
@@ -73973,24 +74313,24 @@ async function updateCommand() {
|
|
|
73973
74313
|
const latestVersion = result.version;
|
|
73974
74314
|
const comparison = compareVersions(latestVersion, currentVersion);
|
|
73975
74315
|
if (comparison <= 0) {
|
|
73976
|
-
console.log(`${
|
|
73977
|
-
console.log(`${
|
|
74316
|
+
console.log(`${GREEN}\u2713${RESET} ${BOLD}Already up-to-date!${RESET}`);
|
|
74317
|
+
console.log(`${CYAN}Current version: ${currentVersion}${RESET}
|
|
73978
74318
|
`);
|
|
73979
74319
|
process.exit(0);
|
|
73980
74320
|
}
|
|
73981
|
-
console.log(` ${
|
|
74321
|
+
console.log(` ${BOLD}claudish${RESET} ${YELLOW}v${currentVersion}${RESET} ${DIM}\u2192${RESET} ${GREEN}v${latestVersion}${RESET} ${DIM}(${installInfo.method})${RESET}`);
|
|
73982
74322
|
if (installInfo.method === "unknown") {
|
|
73983
74323
|
printManualInstructions();
|
|
73984
74324
|
process.exit(1);
|
|
73985
74325
|
}
|
|
73986
74326
|
const command = getUpdateCommand(installInfo.method);
|
|
73987
74327
|
console.log(`
|
|
73988
|
-
${
|
|
74328
|
+
${DIM}Updating...${RESET}
|
|
73989
74329
|
`);
|
|
73990
74330
|
const success2 = await executeUpdate(command);
|
|
73991
74331
|
if (success2) {
|
|
73992
74332
|
console.log(`
|
|
73993
|
-
${
|
|
74333
|
+
${GREEN}\u2713${RESET} ${BOLD}Updated successfully${RESET}`);
|
|
73994
74334
|
clearCache();
|
|
73995
74335
|
const changelog = await fetchChangelog(currentVersion, latestVersion);
|
|
73996
74336
|
displayChangelog(changelog);
|
|
@@ -74000,9 +74340,10 @@ ${DIM2}Updating...${RESET2}
|
|
|
74000
74340
|
process.exit(1);
|
|
74001
74341
|
}
|
|
74002
74342
|
}
|
|
74003
|
-
var
|
|
74343
|
+
var RESET = "", BOLD = "", GREEN = "", YELLOW = "", CYAN = "", RED2 = "", MAGENTA = "", DIM = "", SECTION_TYPE_MAP;
|
|
74004
74344
|
var init_update_command = __esm(() => {
|
|
74005
74345
|
init_cli();
|
|
74346
|
+
init_ansi();
|
|
74006
74347
|
init_update_checker();
|
|
74007
74348
|
SECTION_TYPE_MAP = {
|
|
74008
74349
|
"new features": "feat",
|
|
@@ -74031,6 +74372,9 @@ __export(exports_profile_commands, {
|
|
|
74031
74372
|
profileAddCommand: () => profileAddCommand,
|
|
74032
74373
|
initCommand: () => initCommand
|
|
74033
74374
|
});
|
|
74375
|
+
function refreshAnsi3() {
|
|
74376
|
+
({ RESET: RESET2, BOLD: BOLD2, DIM: DIM2, GREEN: GREEN2, YELLOW: YELLOW2, CYAN: CYAN2, MAGENTA: MAGENTA2 } = cliAnsi());
|
|
74377
|
+
}
|
|
74034
74378
|
function parseScopeFlag(args) {
|
|
74035
74379
|
const remainingArgs = [];
|
|
74036
74380
|
let scope;
|
|
@@ -74067,16 +74411,17 @@ async function resolveScope(scopeFlag) {
|
|
|
74067
74411
|
}
|
|
74068
74412
|
function scopeBadge(scope, shadowed) {
|
|
74069
74413
|
if (scope === "local") {
|
|
74070
|
-
return `${MAGENTA2}[local]${
|
|
74414
|
+
return `${MAGENTA2}[local]${RESET2}`;
|
|
74071
74415
|
}
|
|
74072
74416
|
if (shadowed) {
|
|
74073
|
-
return `${
|
|
74417
|
+
return `${DIM2}[global, shadowed]${RESET2}`;
|
|
74074
74418
|
}
|
|
74075
|
-
return `${
|
|
74419
|
+
return `${DIM2}[global]${RESET2}`;
|
|
74076
74420
|
}
|
|
74077
74421
|
async function initCommand(scopeFlag) {
|
|
74422
|
+
refreshAnsi3();
|
|
74078
74423
|
console.log(`
|
|
74079
|
-
${
|
|
74424
|
+
${BOLD2}${CYAN2}Claudish Setup Wizard${RESET2}
|
|
74080
74425
|
`);
|
|
74081
74426
|
const scope = await resolveScope(scopeFlag);
|
|
74082
74427
|
const configPath = getConfigPathForScope(scope);
|
|
@@ -74090,31 +74435,32 @@ ${BOLD3}${CYAN3}Claudish Setup Wizard${RESET3}
|
|
|
74090
74435
|
return;
|
|
74091
74436
|
}
|
|
74092
74437
|
}
|
|
74093
|
-
console.log(`${
|
|
74438
|
+
console.log(`${DIM2}This wizard will help you set up Claudish with your preferred models.${RESET2}
|
|
74094
74439
|
`);
|
|
74095
74440
|
const profileName = "default";
|
|
74096
|
-
console.log(`${
|
|
74097
|
-
console.log(`${
|
|
74441
|
+
console.log(`${BOLD2}Step 1: Select models for each Claude tier${RESET2}`);
|
|
74442
|
+
console.log(`${DIM2}These models will be used when Claude Code requests specific model types.${RESET2}
|
|
74098
74443
|
`);
|
|
74099
74444
|
const models = await selectModelsForProfile();
|
|
74100
74445
|
const profile = createProfile(profileName, models, undefined, scope);
|
|
74101
74446
|
setDefaultProfile(profileName, scope);
|
|
74102
74447
|
console.log(`
|
|
74103
|
-
${
|
|
74448
|
+
${GREEN2}\u2713${RESET2} Configuration saved to: ${CYAN2}${configPath}${RESET2}`);
|
|
74104
74449
|
console.log(`
|
|
74105
|
-
${
|
|
74450
|
+
${BOLD2}Profile created:${RESET2}`);
|
|
74106
74451
|
printProfile(profile, true, false, scope);
|
|
74107
74452
|
console.log(`
|
|
74108
|
-
${
|
|
74109
|
-
console.log(` ${
|
|
74110
|
-
console.log(` ${
|
|
74453
|
+
${BOLD2}Usage:${RESET2}`);
|
|
74454
|
+
console.log(` ${CYAN2}claudish${RESET2} # Use default profile`);
|
|
74455
|
+
console.log(` ${CYAN2}claudish profile add${RESET2} # Add another profile`);
|
|
74111
74456
|
if (scope === "local") {
|
|
74112
74457
|
console.log(`
|
|
74113
|
-
${
|
|
74458
|
+
${DIM2}Local config applies only when running from this directory.${RESET2}`);
|
|
74114
74459
|
}
|
|
74115
74460
|
console.log("");
|
|
74116
74461
|
}
|
|
74117
74462
|
async function profileListCommand(scopeFilter) {
|
|
74463
|
+
refreshAnsi3();
|
|
74118
74464
|
const allProfiles = listAllProfiles();
|
|
74119
74465
|
const profiles = scopeFilter ? allProfiles.filter((p) => p.scope === scopeFilter) : allProfiles;
|
|
74120
74466
|
if (profiles.length === 0) {
|
|
@@ -74126,11 +74472,11 @@ async function profileListCommand(scopeFilter) {
|
|
|
74126
74472
|
return;
|
|
74127
74473
|
}
|
|
74128
74474
|
console.log(`
|
|
74129
|
-
${
|
|
74475
|
+
${BOLD2}Claudish Profiles${RESET2}
|
|
74130
74476
|
`);
|
|
74131
|
-
console.log(`${
|
|
74477
|
+
console.log(`${DIM2}Global: ${getConfigPath()}${RESET2}`);
|
|
74132
74478
|
if (localConfigExists()) {
|
|
74133
|
-
console.log(`${
|
|
74479
|
+
console.log(`${DIM2}Local: ${getLocalConfigPath()}${RESET2}`);
|
|
74134
74480
|
}
|
|
74135
74481
|
console.log("");
|
|
74136
74482
|
for (const profile of profiles) {
|
|
@@ -74139,20 +74485,21 @@ ${BOLD3}Claudish Profiles${RESET3}
|
|
|
74139
74485
|
}
|
|
74140
74486
|
}
|
|
74141
74487
|
async function profileAddCommand(scopeFlag) {
|
|
74488
|
+
refreshAnsi3();
|
|
74142
74489
|
console.log(`
|
|
74143
|
-
${
|
|
74490
|
+
${BOLD2}${CYAN2}Add New Profile${RESET2}
|
|
74144
74491
|
`);
|
|
74145
74492
|
const scope = await resolveScope(scopeFlag);
|
|
74146
74493
|
const existingNames = getProfileNames(scope);
|
|
74147
74494
|
const name = await promptForProfileName(existingNames);
|
|
74148
74495
|
const description = await promptForProfileDescription();
|
|
74149
74496
|
console.log(`
|
|
74150
|
-
${
|
|
74497
|
+
${BOLD2}Select models for this profile:${RESET2}
|
|
74151
74498
|
`);
|
|
74152
74499
|
const models = await selectModelsForProfile();
|
|
74153
74500
|
const profile = createProfile(name, models, description, scope);
|
|
74154
74501
|
console.log(`
|
|
74155
|
-
${
|
|
74502
|
+
${GREEN2}\u2713${RESET2} Profile "${name}" created ${scopeBadge(scope)}.`);
|
|
74156
74503
|
printProfile(profile, false, false, scope);
|
|
74157
74504
|
const setAsDefault = await dist_default4({
|
|
74158
74505
|
message: `Set this profile as default in ${scope} config?`,
|
|
@@ -74160,10 +74507,11 @@ ${GREEN3}\u2713${RESET3} Profile "${name}" created ${scopeBadge(scope)}.`);
|
|
|
74160
74507
|
});
|
|
74161
74508
|
if (setAsDefault) {
|
|
74162
74509
|
setDefaultProfile(name, scope);
|
|
74163
|
-
console.log(`${
|
|
74510
|
+
console.log(`${GREEN2}\u2713${RESET2} "${name}" is now the default ${scope} profile.`);
|
|
74164
74511
|
}
|
|
74165
74512
|
}
|
|
74166
74513
|
async function profileRemoveCommand(name, scopeFlag) {
|
|
74514
|
+
refreshAnsi3();
|
|
74167
74515
|
let scope = scopeFlag;
|
|
74168
74516
|
let profileName = name;
|
|
74169
74517
|
if (!profileName) {
|
|
@@ -74176,7 +74524,7 @@ async function profileRemoveCommand(name, scopeFlag) {
|
|
|
74176
74524
|
const choice = await dist_default11({
|
|
74177
74525
|
message: "Select a profile to remove:",
|
|
74178
74526
|
choices: selectable.map((p) => ({
|
|
74179
|
-
name: `${p.name} ${scopeBadge(p.scope)}${p.isDefault ? ` ${YELLOW2}(default)${
|
|
74527
|
+
name: `${p.name} ${scopeBadge(p.scope)}${p.isDefault ? ` ${YELLOW2}(default)${RESET2}` : ""}`,
|
|
74180
74528
|
value: `${p.scope}:${p.name}`
|
|
74181
74529
|
}))
|
|
74182
74530
|
});
|
|
@@ -74224,12 +74572,13 @@ async function profileRemoveCommand(name, scopeFlag) {
|
|
|
74224
74572
|
}
|
|
74225
74573
|
try {
|
|
74226
74574
|
deleteProfile(profileName, scope);
|
|
74227
|
-
console.log(`${
|
|
74575
|
+
console.log(`${GREEN2}\u2713${RESET2} Profile "${profileName}" deleted from ${scope} config.`);
|
|
74228
74576
|
} catch (error46) {
|
|
74229
74577
|
console.error(`Error: ${error46}`);
|
|
74230
74578
|
}
|
|
74231
74579
|
}
|
|
74232
74580
|
async function profileUseCommand(name, scopeFlag) {
|
|
74581
|
+
refreshAnsi3();
|
|
74233
74582
|
let scope = scopeFlag;
|
|
74234
74583
|
let profileName = name;
|
|
74235
74584
|
if (!profileName) {
|
|
@@ -74242,7 +74591,7 @@ async function profileUseCommand(name, scopeFlag) {
|
|
|
74242
74591
|
const choice = await dist_default11({
|
|
74243
74592
|
message: "Select a profile to set as default:",
|
|
74244
74593
|
choices: selectable.map((p) => ({
|
|
74245
|
-
name: `${p.name} ${scopeBadge(p.scope)}${p.isDefault ? ` ${YELLOW2}(default)${
|
|
74594
|
+
name: `${p.name} ${scopeBadge(p.scope)}${p.isDefault ? ` ${YELLOW2}(default)${RESET2}` : ""}`,
|
|
74246
74595
|
value: `${p.scope}:${p.name}`
|
|
74247
74596
|
}))
|
|
74248
74597
|
});
|
|
@@ -74278,9 +74627,10 @@ async function profileUseCommand(name, scopeFlag) {
|
|
|
74278
74627
|
return;
|
|
74279
74628
|
}
|
|
74280
74629
|
setDefaultProfile(profileName, scope);
|
|
74281
|
-
console.log(`${
|
|
74630
|
+
console.log(`${GREEN2}\u2713${RESET2} "${profileName}" is now the default ${scope} profile.`);
|
|
74282
74631
|
}
|
|
74283
74632
|
async function profileShowCommand(name, scopeFlag) {
|
|
74633
|
+
refreshAnsi3();
|
|
74284
74634
|
let profileName = name;
|
|
74285
74635
|
let scope = scopeFlag;
|
|
74286
74636
|
if (!profileName) {
|
|
@@ -74320,6 +74670,7 @@ async function profileShowCommand(name, scopeFlag) {
|
|
|
74320
74670
|
printProfile(profile, isDefault, true, scope);
|
|
74321
74671
|
}
|
|
74322
74672
|
async function profileEditCommand(name, scopeFlag) {
|
|
74673
|
+
refreshAnsi3();
|
|
74323
74674
|
let scope = scopeFlag;
|
|
74324
74675
|
let profileName = name;
|
|
74325
74676
|
if (!profileName) {
|
|
@@ -74332,7 +74683,7 @@ async function profileEditCommand(name, scopeFlag) {
|
|
|
74332
74683
|
const choice = await dist_default11({
|
|
74333
74684
|
message: "Select a profile to edit:",
|
|
74334
74685
|
choices: selectable.map((p) => ({
|
|
74335
|
-
name: `${p.name} ${scopeBadge(p.scope)}${p.isDefault ? ` ${YELLOW2}(default)${
|
|
74686
|
+
name: `${p.name} ${scopeBadge(p.scope)}${p.isDefault ? ` ${YELLOW2}(default)${RESET2}` : ""}`,
|
|
74336
74687
|
value: `${p.scope}:${p.name}`
|
|
74337
74688
|
}))
|
|
74338
74689
|
});
|
|
@@ -74367,9 +74718,9 @@ async function profileEditCommand(name, scopeFlag) {
|
|
|
74367
74718
|
return;
|
|
74368
74719
|
}
|
|
74369
74720
|
console.log(`
|
|
74370
|
-
${
|
|
74721
|
+
${BOLD2}Editing profile: ${profileName}${RESET2} ${scopeBadge(scope)}
|
|
74371
74722
|
`);
|
|
74372
|
-
console.log(`${
|
|
74723
|
+
console.log(`${DIM2}Current models:${RESET2}`);
|
|
74373
74724
|
printModelMapping(profile.models);
|
|
74374
74725
|
console.log("");
|
|
74375
74726
|
const whatToEdit = await dist_default11({
|
|
@@ -74391,14 +74742,14 @@ ${BOLD3}Editing profile: ${profileName}${RESET3} ${scopeBadge(scope)}
|
|
|
74391
74742
|
const newDescription = await promptForProfileDescription();
|
|
74392
74743
|
profile.description = newDescription;
|
|
74393
74744
|
setProfile(profile, scope);
|
|
74394
|
-
console.log(`${
|
|
74745
|
+
console.log(`${GREEN2}\u2713${RESET2} Description updated.`);
|
|
74395
74746
|
return;
|
|
74396
74747
|
}
|
|
74397
74748
|
if (whatToEdit === "all") {
|
|
74398
74749
|
const models = await selectModelsForProfile();
|
|
74399
74750
|
profile.models = { ...profile.models, ...models };
|
|
74400
74751
|
setProfile(profile, scope);
|
|
74401
|
-
console.log(`${
|
|
74752
|
+
console.log(`${GREEN2}\u2713${RESET2} All models updated.`);
|
|
74402
74753
|
return;
|
|
74403
74754
|
}
|
|
74404
74755
|
const tier = whatToEdit;
|
|
@@ -74408,42 +74759,43 @@ ${BOLD3}Editing profile: ${profileName}${RESET3} ${scopeBadge(scope)}
|
|
|
74408
74759
|
});
|
|
74409
74760
|
profile.models[tier] = newModel;
|
|
74410
74761
|
setProfile(profile, scope);
|
|
74411
|
-
console.log(`${
|
|
74762
|
+
console.log(`${GREEN2}\u2713${RESET2} ${tierName} model updated to: ${newModel}`);
|
|
74412
74763
|
}
|
|
74413
74764
|
function printProfile(profile, isDefault, verbose = false, scope) {
|
|
74414
|
-
const defaultBadge = isDefault ? ` ${YELLOW2}(default)${
|
|
74765
|
+
const defaultBadge = isDefault ? ` ${YELLOW2}(default)${RESET2}` : "";
|
|
74415
74766
|
const scopeTag = scope ? ` ${scopeBadge(scope)}` : "";
|
|
74416
|
-
console.log(`${
|
|
74767
|
+
console.log(`${BOLD2}${profile.name}${RESET2}${defaultBadge}${scopeTag}`);
|
|
74417
74768
|
if (profile.description) {
|
|
74418
|
-
console.log(` ${
|
|
74769
|
+
console.log(` ${DIM2}${profile.description}${RESET2}`);
|
|
74419
74770
|
}
|
|
74420
74771
|
printModelMapping(profile.models);
|
|
74421
74772
|
if (verbose) {
|
|
74422
|
-
console.log(` ${
|
|
74423
|
-
console.log(` ${
|
|
74773
|
+
console.log(` ${DIM2}Created: ${profile.createdAt}${RESET2}`);
|
|
74774
|
+
console.log(` ${DIM2}Updated: ${profile.updatedAt}${RESET2}`);
|
|
74424
74775
|
}
|
|
74425
74776
|
}
|
|
74426
74777
|
function printProfileWithScope(profile) {
|
|
74427
|
-
const defaultBadge = profile.isDefault ? ` ${YELLOW2}(default)${
|
|
74778
|
+
const defaultBadge = profile.isDefault ? ` ${YELLOW2}(default)${RESET2}` : "";
|
|
74428
74779
|
const badge = scopeBadge(profile.scope, profile.shadowed);
|
|
74429
|
-
console.log(`${
|
|
74780
|
+
console.log(`${BOLD2}${profile.name}${RESET2}${defaultBadge} ${badge}`);
|
|
74430
74781
|
if (profile.shadowed) {
|
|
74431
|
-
console.log(` ${
|
|
74782
|
+
console.log(` ${DIM2}(overridden by local profile of same name)${RESET2}`);
|
|
74432
74783
|
}
|
|
74433
74784
|
if (profile.description) {
|
|
74434
|
-
console.log(` ${
|
|
74785
|
+
console.log(` ${DIM2}${profile.description}${RESET2}`);
|
|
74435
74786
|
}
|
|
74436
74787
|
printModelMapping(profile.models);
|
|
74437
74788
|
}
|
|
74438
74789
|
function printModelMapping(models) {
|
|
74439
|
-
console.log(` ${
|
|
74440
|
-
console.log(` ${
|
|
74441
|
-
console.log(` ${
|
|
74790
|
+
console.log(` ${CYAN2}opus${RESET2}: ${models.opus || `${DIM2}not set${RESET2}`}`);
|
|
74791
|
+
console.log(` ${CYAN2}sonnet${RESET2}: ${models.sonnet || `${DIM2}not set${RESET2}`}`);
|
|
74792
|
+
console.log(` ${CYAN2}haiku${RESET2}: ${models.haiku || `${DIM2}not set${RESET2}`}`);
|
|
74442
74793
|
if (models.subagent) {
|
|
74443
|
-
console.log(` ${
|
|
74794
|
+
console.log(` ${CYAN2}subagent${RESET2}: ${models.subagent}`);
|
|
74444
74795
|
}
|
|
74445
74796
|
}
|
|
74446
74797
|
async function profileCommand(args) {
|
|
74798
|
+
refreshAnsi3();
|
|
74447
74799
|
const { scope, remainingArgs } = parseScopeFlag(args);
|
|
74448
74800
|
const subcommand = remainingArgs[0];
|
|
74449
74801
|
const name = remainingArgs[1];
|
|
@@ -74480,22 +74832,22 @@ async function profileCommand(args) {
|
|
|
74480
74832
|
}
|
|
74481
74833
|
function printProfileHelp() {
|
|
74482
74834
|
console.log(`
|
|
74483
|
-
${
|
|
74484
|
-
|
|
74485
|
-
${
|
|
74486
|
-
${
|
|
74487
|
-
${
|
|
74488
|
-
${
|
|
74489
|
-
${
|
|
74490
|
-
${
|
|
74491
|
-
${
|
|
74492
|
-
|
|
74493
|
-
${
|
|
74494
|
-
${
|
|
74495
|
-
${
|
|
74496
|
-
${
|
|
74497
|
-
|
|
74498
|
-
${
|
|
74835
|
+
${BOLD2}Usage:${RESET2} claudish profile <command> [options]
|
|
74836
|
+
|
|
74837
|
+
${BOLD2}Commands:${RESET2}
|
|
74838
|
+
${CYAN2}list${RESET2}, ${CYAN2}ls${RESET2} List all profiles
|
|
74839
|
+
${CYAN2}add${RESET2}, ${CYAN2}new${RESET2} Add a new profile
|
|
74840
|
+
${CYAN2}remove${RESET2} ${DIM2}[name]${RESET2} Remove a profile
|
|
74841
|
+
${CYAN2}use${RESET2} ${DIM2}[name]${RESET2} Set default profile
|
|
74842
|
+
${CYAN2}show${RESET2} ${DIM2}[name]${RESET2} Show profile details
|
|
74843
|
+
${CYAN2}edit${RESET2} ${DIM2}[name]${RESET2} Edit a profile
|
|
74844
|
+
|
|
74845
|
+
${BOLD2}Scope Flags:${RESET2}
|
|
74846
|
+
${CYAN2}--local${RESET2} Target .claudish.json in the current directory
|
|
74847
|
+
${CYAN2}--global${RESET2} Target ~/.claudish/config.json (default)
|
|
74848
|
+
${DIM2}If neither flag is given, you'll be prompted interactively.${RESET2}
|
|
74849
|
+
|
|
74850
|
+
${BOLD2}Examples:${RESET2}
|
|
74499
74851
|
claudish profile list
|
|
74500
74852
|
claudish profile list --local
|
|
74501
74853
|
claudish profile add --local
|
|
@@ -74505,11 +74857,12 @@ ${BOLD3}Examples:${RESET3}
|
|
|
74505
74857
|
claudish init --local
|
|
74506
74858
|
`);
|
|
74507
74859
|
}
|
|
74508
|
-
var
|
|
74860
|
+
var RESET2 = "", BOLD2 = "", DIM2 = "", GREEN2 = "", YELLOW2 = "", CYAN2 = "", MAGENTA2 = "";
|
|
74509
74861
|
var init_profile_commands = __esm(() => {
|
|
74510
74862
|
init_dist16();
|
|
74511
74863
|
init_model_selector();
|
|
74512
74864
|
init_profile_config();
|
|
74865
|
+
init_ansi();
|
|
74513
74866
|
});
|
|
74514
74867
|
|
|
74515
74868
|
// src/providers/local-liveness.ts
|
|
@@ -74977,7 +75330,7 @@ function OnepasswordContent({
|
|
|
74977
75330
|
children: " "
|
|
74978
75331
|
}, undefined, false, undefined, this),
|
|
74979
75332
|
/* @__PURE__ */ jsxDEV4("span", {
|
|
74980
|
-
fg: selected ? C.
|
|
75333
|
+
fg: selected ? C.strong : C.fgMuted,
|
|
74981
75334
|
attributes: A.boldIf(selected),
|
|
74982
75335
|
children: e.value
|
|
74983
75336
|
}, undefined, false, undefined, this),
|
|
@@ -75082,7 +75435,7 @@ function OnepasswordContent({
|
|
|
75082
75435
|
children: "\u25B4 "
|
|
75083
75436
|
}, undefined, false, undefined, this),
|
|
75084
75437
|
/* @__PURE__ */ jsxDEV4("span", {
|
|
75085
|
-
fg: C.
|
|
75438
|
+
fg: C.strong,
|
|
75086
75439
|
children: `project: ${account.project}`
|
|
75087
75440
|
}, undefined, false, undefined, this)
|
|
75088
75441
|
]
|
|
@@ -75094,7 +75447,7 @@ function OnepasswordContent({
|
|
|
75094
75447
|
children: "\u2022 "
|
|
75095
75448
|
}, undefined, false, undefined, this),
|
|
75096
75449
|
/* @__PURE__ */ jsxDEV4("span", {
|
|
75097
|
-
fg: C.
|
|
75450
|
+
fg: C.strong,
|
|
75098
75451
|
children: `global: ${account.global}`
|
|
75099
75452
|
}, undefined, false, undefined, this)
|
|
75100
75453
|
]
|
|
@@ -75107,7 +75460,7 @@ function OnepasswordContent({
|
|
|
75107
75460
|
/* @__PURE__ */ jsxDEV4("text", {
|
|
75108
75461
|
children: [
|
|
75109
75462
|
/* @__PURE__ */ jsxDEV4("span", {
|
|
75110
|
-
fg: C.
|
|
75463
|
+
fg: C.strong,
|
|
75111
75464
|
attributes: A.bold,
|
|
75112
75465
|
children: String(keyCount)
|
|
75113
75466
|
}, undefined, false, undefined, this),
|
|
@@ -75120,7 +75473,7 @@ function OnepasswordContent({
|
|
|
75120
75473
|
children: " "
|
|
75121
75474
|
}, undefined, false, undefined, this),
|
|
75122
75475
|
/* @__PURE__ */ jsxDEV4("span", {
|
|
75123
|
-
fg: C.
|
|
75476
|
+
fg: C.strong,
|
|
75124
75477
|
attributes: A.bold,
|
|
75125
75478
|
children: String(setCount)
|
|
75126
75479
|
}, undefined, false, undefined, this),
|
|
@@ -75133,7 +75486,7 @@ function OnepasswordContent({
|
|
|
75133
75486
|
children: " "
|
|
75134
75487
|
}, undefined, false, undefined, this),
|
|
75135
75488
|
/* @__PURE__ */ jsxDEV4("span", {
|
|
75136
|
-
fg: C.
|
|
75489
|
+
fg: C.strong,
|
|
75137
75490
|
attributes: A.bold,
|
|
75138
75491
|
children: String(envCount)
|
|
75139
75492
|
}, undefined, false, undefined, this),
|
|
@@ -75294,7 +75647,7 @@ function OnepasswordDetail({ selectedEntry, testResults }) {
|
|
|
75294
75647
|
children: "Kind: "
|
|
75295
75648
|
}, undefined, false, undefined, this),
|
|
75296
75649
|
/* @__PURE__ */ jsxDEV5("span", {
|
|
75297
|
-
fg: C.
|
|
75650
|
+
fg: C.strong,
|
|
75298
75651
|
children: kindLabel2(selectedEntry.kind)
|
|
75299
75652
|
}, undefined, false, undefined, this)
|
|
75300
75653
|
]
|
|
@@ -75307,7 +75660,7 @@ function OnepasswordDetail({ selectedEntry, testResults }) {
|
|
|
75307
75660
|
children: "Value: "
|
|
75308
75661
|
}, undefined, false, undefined, this),
|
|
75309
75662
|
/* @__PURE__ */ jsxDEV5("span", {
|
|
75310
|
-
fg: C.
|
|
75663
|
+
fg: C.strong,
|
|
75311
75664
|
children: selectedEntry.value
|
|
75312
75665
|
}, undefined, false, undefined, this)
|
|
75313
75666
|
]
|
|
@@ -75611,7 +75964,7 @@ function OnepasswordModal({
|
|
|
75611
75964
|
children: "filter: "
|
|
75612
75965
|
}, undefined, false, undefined, this),
|
|
75613
75966
|
filter ? /* @__PURE__ */ jsxDEV6("span", {
|
|
75614
|
-
fg: C.
|
|
75967
|
+
fg: C.strong,
|
|
75615
75968
|
attributes: A.bold,
|
|
75616
75969
|
children: filter
|
|
75617
75970
|
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV6("span", {
|
|
@@ -75657,7 +76010,7 @@ function OnepasswordModal({
|
|
|
75657
76010
|
children: selected ? "\u25B6 " : " "
|
|
75658
76011
|
}, undefined, false, undefined, this),
|
|
75659
76012
|
/* @__PURE__ */ jsxDEV6("span", {
|
|
75660
|
-
fg: selected ? C.
|
|
76013
|
+
fg: selected ? C.strong : C.fgMuted,
|
|
75661
76014
|
attributes: A.boldIf(selected),
|
|
75662
76015
|
children: row
|
|
75663
76016
|
}, undefined, false, undefined, this)
|
|
@@ -75749,7 +76102,7 @@ function OnepasswordModal({
|
|
|
75749
76102
|
children: "filter: "
|
|
75750
76103
|
}, undefined, false, undefined, this),
|
|
75751
76104
|
filter ? /* @__PURE__ */ jsxDEV6("span", {
|
|
75752
|
-
fg: C.
|
|
76105
|
+
fg: C.strong,
|
|
75753
76106
|
attributes: A.bold,
|
|
75754
76107
|
children: filter
|
|
75755
76108
|
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV6("span", {
|
|
@@ -75849,7 +76202,7 @@ function OnepasswordModal({
|
|
|
75849
76202
|
focused: true,
|
|
75850
76203
|
width: dialogW - 6,
|
|
75851
76204
|
backgroundColor: C.bgHighlight,
|
|
75852
|
-
textColor: C.
|
|
76205
|
+
textColor: C.strong
|
|
75853
76206
|
}, undefined, false, undefined, this)
|
|
75854
76207
|
]
|
|
75855
76208
|
}, undefined, true, undefined, this),
|
|
@@ -75905,7 +76258,7 @@ function OnepasswordModal({
|
|
|
75905
76258
|
children: selected ? "\u25B6 " : " "
|
|
75906
76259
|
}, undefined, false, undefined, this),
|
|
75907
76260
|
/* @__PURE__ */ jsxDEV6("span", {
|
|
75908
|
-
fg: selected ? C.
|
|
76261
|
+
fg: selected ? C.strong : C.fgMuted,
|
|
75909
76262
|
attributes: A.bold,
|
|
75910
76263
|
children: opt.title
|
|
75911
76264
|
}, undefined, false, undefined, this)
|
|
@@ -75932,7 +76285,7 @@ function OnepasswordModal({
|
|
|
75932
76285
|
backgroundColor: C.bg,
|
|
75933
76286
|
textColor: C.fgMuted,
|
|
75934
76287
|
selectedBackgroundColor: C.bgHighlight,
|
|
75935
|
-
selectedTextColor: C.
|
|
76288
|
+
selectedTextColor: C.strong,
|
|
75936
76289
|
height: SCOPE_OPTIONS.length
|
|
75937
76290
|
}, undefined, false, undefined, this);
|
|
75938
76291
|
} else if (mode === "pick_op_account") {
|
|
@@ -76178,7 +76531,7 @@ function PrivacyContent({
|
|
|
76178
76531
|
}, undefined, false, undefined, this),
|
|
76179
76532
|
/* @__PURE__ */ jsxDEV7("text", {
|
|
76180
76533
|
children: /* @__PURE__ */ jsxDEV7("span", {
|
|
76181
|
-
fg: C.
|
|
76534
|
+
fg: C.strong,
|
|
76182
76535
|
attributes: A.bold,
|
|
76183
76536
|
children: "Never sends keys, prompts, or paths."
|
|
76184
76537
|
}, undefined, false, undefined, this)
|
|
@@ -76247,7 +76600,7 @@ function PrivacyContent({
|
|
|
76247
76600
|
]
|
|
76248
76601
|
}, undefined, true, undefined, this),
|
|
76249
76602
|
/* @__PURE__ */ jsxDEV7("span", {
|
|
76250
|
-
fg: C.
|
|
76603
|
+
fg: C.strong,
|
|
76251
76604
|
attributes: A.bold,
|
|
76252
76605
|
children: bufStats.events
|
|
76253
76606
|
}, undefined, false, undefined, this),
|
|
@@ -76590,7 +76943,7 @@ function ProfilesContent({
|
|
|
76590
76943
|
children: " "
|
|
76591
76944
|
}, undefined, false, undefined, this),
|
|
76592
76945
|
/* @__PURE__ */ jsxDEV10("span", {
|
|
76593
|
-
fg: selected ? C.
|
|
76946
|
+
fg: selected ? C.strong : isActive ? C.orange : C.fgMuted,
|
|
76594
76947
|
attributes: A.boldIf(selected || isActive),
|
|
76595
76948
|
children: namePad
|
|
76596
76949
|
}, undefined, false, undefined, this),
|
|
@@ -76607,7 +76960,7 @@ function ProfilesContent({
|
|
|
76607
76960
|
children: " "
|
|
76608
76961
|
}, undefined, false, undefined, this),
|
|
76609
76962
|
/* @__PURE__ */ jsxDEV10("span", {
|
|
76610
|
-
fg: selected ? C.
|
|
76963
|
+
fg: selected ? C.strong : shadowed ? C.dim : C.fgMuted,
|
|
76611
76964
|
children: shadowed ? "(shadowed by local) " : modelSummary
|
|
76612
76965
|
}, undefined, false, undefined, this)
|
|
76613
76966
|
]
|
|
@@ -76651,7 +77004,7 @@ function ProfilesContent({
|
|
|
76651
77004
|
backgroundColor: C.bg,
|
|
76652
77005
|
textColor: C.fgMuted,
|
|
76653
77006
|
selectedBackgroundColor: C.bgHighlight,
|
|
76654
|
-
selectedTextColor: C.
|
|
77007
|
+
selectedTextColor: C.strong,
|
|
76655
77008
|
height: scopeOptions.length
|
|
76656
77009
|
}, undefined, false, undefined, this),
|
|
76657
77010
|
/* @__PURE__ */ jsxDEV10("text", {
|
|
@@ -76777,7 +77130,7 @@ function ProfilesContent({
|
|
|
76777
77130
|
children: "> "
|
|
76778
77131
|
}, undefined, false, undefined, this),
|
|
76779
77132
|
/* @__PURE__ */ jsxDEV10("span", {
|
|
76780
|
-
fg: editProfileValue === "auto" ? C.yellow : C.
|
|
77133
|
+
fg: editProfileValue === "auto" ? C.yellow : C.strong,
|
|
76781
77134
|
children: editProfileValue
|
|
76782
77135
|
}, undefined, false, undefined, this),
|
|
76783
77136
|
/* @__PURE__ */ jsxDEV10("span", {
|
|
@@ -76808,7 +77161,7 @@ function ProfilesContent({
|
|
|
76808
77161
|
children: s.substring(0, matchIdx)
|
|
76809
77162
|
}, undefined, false, undefined, this),
|
|
76810
77163
|
/* @__PURE__ */ jsxDEV10("span", {
|
|
76811
|
-
fg: selected ? C.
|
|
77164
|
+
fg: selected ? C.strong : C.cyan,
|
|
76812
77165
|
attributes: A.bold,
|
|
76813
77166
|
children: s.substring(matchIdx, matchIdx + lower.length)
|
|
76814
77167
|
}, undefined, false, undefined, this),
|
|
@@ -76818,7 +77171,7 @@ function ProfilesContent({
|
|
|
76818
77171
|
}, undefined, false, undefined, this)
|
|
76819
77172
|
]
|
|
76820
77173
|
}, undefined, true, undefined, this) : /* @__PURE__ */ jsxDEV10("span", {
|
|
76821
|
-
fg: selected ? C.
|
|
77174
|
+
fg: selected ? C.strong : C.fgMuted,
|
|
76822
77175
|
children: s
|
|
76823
77176
|
}, undefined, false, undefined, this)
|
|
76824
77177
|
]
|
|
@@ -77065,7 +77418,7 @@ function ProviderDetail({
|
|
|
77065
77418
|
focused: true,
|
|
77066
77419
|
width: width - 8,
|
|
77067
77420
|
backgroundColor: C.bgHighlight,
|
|
77068
|
-
textColor: C.
|
|
77421
|
+
textColor: C.strong
|
|
77069
77422
|
}, undefined, false, undefined, this)
|
|
77070
77423
|
]
|
|
77071
77424
|
}, undefined, true, undefined, this)
|
|
@@ -77228,7 +77581,7 @@ function ProviderDetail({
|
|
|
77228
77581
|
]
|
|
77229
77582
|
}, undefined, true, undefined, this),
|
|
77230
77583
|
/* @__PURE__ */ jsxDEV11("span", {
|
|
77231
|
-
fg: C.
|
|
77584
|
+
fg: C.strong,
|
|
77232
77585
|
children: selectedProvider.description
|
|
77233
77586
|
}, undefined, false, undefined, this)
|
|
77234
77587
|
]
|
|
@@ -77460,7 +77813,7 @@ function ProvidersContent({
|
|
|
77460
77813
|
children: " "
|
|
77461
77814
|
}, undefined, false, undefined, this),
|
|
77462
77815
|
/* @__PURE__ */ jsxDEV12("span", {
|
|
77463
|
-
fg: selected ? C.
|
|
77816
|
+
fg: selected ? C.strong : isReady ? C.fgMuted : C.dim,
|
|
77464
77817
|
attributes: A.boldIf(selected),
|
|
77465
77818
|
children: pad(p.displayName, COL_NAME)
|
|
77466
77819
|
}, undefined, false, undefined, this),
|
|
@@ -77480,14 +77833,14 @@ function ProvidersContent({
|
|
|
77480
77833
|
/* @__PURE__ */ jsxDEV12(Fragment8, {
|
|
77481
77834
|
children: [
|
|
77482
77835
|
/* @__PURE__ */ jsxDEV12("span", {
|
|
77483
|
-
fg: keySlot.set ? C.
|
|
77836
|
+
fg: keySlot.set ? C.strong : C.dim,
|
|
77484
77837
|
children: keySlotGlyph
|
|
77485
77838
|
}, undefined, false, undefined, this),
|
|
77486
77839
|
/* @__PURE__ */ jsxDEV12("span", {
|
|
77487
77840
|
children: " "
|
|
77488
77841
|
}, undefined, false, undefined, this),
|
|
77489
77842
|
/* @__PURE__ */ jsxDEV12("span", {
|
|
77490
|
-
fg: oauthSlot.set ? C.
|
|
77843
|
+
fg: oauthSlot.set ? C.strong : C.dim,
|
|
77491
77844
|
children: oauthSlotGlyph
|
|
77492
77845
|
}, undefined, false, undefined, this)
|
|
77493
77846
|
]
|
|
@@ -77512,7 +77865,7 @@ function ProvidersContent({
|
|
|
77512
77865
|
fg: C.yellow,
|
|
77513
77866
|
children: tr.error.replace(/\s+/g, " ").trim()
|
|
77514
77867
|
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV12("span", {
|
|
77515
|
-
fg: selected ? C.
|
|
77868
|
+
fg: selected ? C.strong : C.dim,
|
|
77516
77869
|
children: p.description
|
|
77517
77870
|
}, undefined, false, undefined, this)
|
|
77518
77871
|
]
|
|
@@ -77691,7 +78044,7 @@ function RoutingContent({
|
|
|
77691
78044
|
children: [
|
|
77692
78045
|
/* @__PURE__ */ jsxDEV13("text", {
|
|
77693
78046
|
children: /* @__PURE__ */ jsxDEV13("span", {
|
|
77694
|
-
fg: C.
|
|
78047
|
+
fg: C.strong,
|
|
77695
78048
|
attributes: A.bold,
|
|
77696
78049
|
children: "Route Probe"
|
|
77697
78050
|
}, undefined, false, undefined, this)
|
|
@@ -77716,7 +78069,7 @@ function RoutingContent({
|
|
|
77716
78069
|
children: "> "
|
|
77717
78070
|
}, undefined, false, undefined, this),
|
|
77718
78071
|
/* @__PURE__ */ jsxDEV13("span", {
|
|
77719
|
-
fg: C.
|
|
78072
|
+
fg: C.strong,
|
|
77720
78073
|
children: probeModel
|
|
77721
78074
|
}, undefined, false, undefined, this),
|
|
77722
78075
|
/* @__PURE__ */ jsxDEV13("span", {
|
|
@@ -77774,7 +78127,7 @@ function RoutingContent({
|
|
|
77774
78127
|
children: /* @__PURE__ */ jsxDEV13("text", {
|
|
77775
78128
|
children: [
|
|
77776
78129
|
/* @__PURE__ */ jsxDEV13("span", {
|
|
77777
|
-
fg: C.
|
|
78130
|
+
fg: C.strong,
|
|
77778
78131
|
attributes: A.bold,
|
|
77779
78132
|
children: probeMode === "done" ? "Probe: " : "Probing: "
|
|
77780
78133
|
}, undefined, false, undefined, this),
|
|
@@ -77833,7 +78186,7 @@ function RoutingContent({
|
|
|
77833
78186
|
children: `${idx + 1}. `
|
|
77834
78187
|
}, undefined, false, undefined, this),
|
|
77835
78188
|
/* @__PURE__ */ jsxDEV13("span", {
|
|
77836
|
-
fg: isNoKey ? C.dim : isSelected ? C.
|
|
78189
|
+
fg: isNoKey ? C.dim : isSelected ? C.strong : isNotReached ? C.dim : C.fgMuted,
|
|
77837
78190
|
attributes: A.boldIf(isSelected),
|
|
77838
78191
|
children: nameCol
|
|
77839
78192
|
}, undefined, false, undefined, this),
|
|
@@ -78108,7 +78461,7 @@ function RoutingContent({
|
|
|
78108
78461
|
scopeText = "global ";
|
|
78109
78462
|
scopeFg = C.green;
|
|
78110
78463
|
}
|
|
78111
|
-
const patFg = sel ? C.
|
|
78464
|
+
const patFg = sel ? C.strong : isDefault ? C.fgMuted : C.cyan;
|
|
78112
78465
|
const chainFg = sel ? C.cyan : isDefault ? C.dim : C.fgMuted;
|
|
78113
78466
|
return /* @__PURE__ */ jsxDEV13("box", {
|
|
78114
78467
|
height: 1,
|
|
@@ -78156,7 +78509,7 @@ function RoutingContent({
|
|
|
78156
78509
|
children: "Scope for "
|
|
78157
78510
|
}, undefined, false, undefined, this),
|
|
78158
78511
|
/* @__PURE__ */ jsxDEV13("span", {
|
|
78159
|
-
fg: C.
|
|
78512
|
+
fg: C.strong,
|
|
78160
78513
|
attributes: A.bold,
|
|
78161
78514
|
children: routingPattern
|
|
78162
78515
|
}, undefined, false, undefined, this),
|
|
@@ -78315,7 +78668,7 @@ function RoutingContent({
|
|
|
78315
78668
|
children: "> "
|
|
78316
78669
|
}, undefined, false, undefined, this),
|
|
78317
78670
|
/* @__PURE__ */ jsxDEV13("span", {
|
|
78318
|
-
fg: C.
|
|
78671
|
+
fg: C.strong,
|
|
78319
78672
|
children: routingPattern
|
|
78320
78673
|
}, undefined, false, undefined, this),
|
|
78321
78674
|
/* @__PURE__ */ jsxDEV13("span", {
|
|
@@ -78368,7 +78721,7 @@ function RoutingContent({
|
|
|
78368
78721
|
children: "Select providers for "
|
|
78369
78722
|
}, undefined, false, undefined, this),
|
|
78370
78723
|
/* @__PURE__ */ jsxDEV13("span", {
|
|
78371
|
-
fg: C.
|
|
78724
|
+
fg: C.strong,
|
|
78372
78725
|
attributes: A.bold,
|
|
78373
78726
|
children: routingPattern
|
|
78374
78727
|
}, undefined, false, undefined, this),
|
|
@@ -78417,7 +78770,7 @@ function RoutingContent({
|
|
|
78417
78770
|
children: " [ ] "
|
|
78418
78771
|
}, undefined, false, undefined, this),
|
|
78419
78772
|
/* @__PURE__ */ jsxDEV13("span", {
|
|
78420
|
-
fg: isCursor ? C.
|
|
78773
|
+
fg: isCursor ? C.strong : ready ? C.fgMuted : C.dim,
|
|
78421
78774
|
attributes: A.boldIf(isCursor),
|
|
78422
78775
|
children: label
|
|
78423
78776
|
}, undefined, false, undefined, this),
|
|
@@ -80665,7 +81018,7 @@ function App({ requestLogin } = {}) {
|
|
|
80665
81018
|
children: /* @__PURE__ */ jsxDEV16("text", {
|
|
80666
81019
|
children: [
|
|
80667
81020
|
/* @__PURE__ */ jsxDEV16("span", {
|
|
80668
|
-
fg: C.
|
|
81021
|
+
fg: C.strong,
|
|
80669
81022
|
attributes: A.bold,
|
|
80670
81023
|
children: "claudish"
|
|
80671
81024
|
}, undefined, false, undefined, this),
|
|
@@ -80918,6 +81271,7 @@ async function startConfigTui() {
|
|
|
80918
81271
|
const renderer = await createCliRenderer2({
|
|
80919
81272
|
exitOnCtrlC: false
|
|
80920
81273
|
});
|
|
81274
|
+
await applyRendererThemeMode(renderer);
|
|
80921
81275
|
await new Promise((resolve5) => {
|
|
80922
81276
|
renderer.once("destroy", () => resolve5());
|
|
80923
81277
|
createRoot2(renderer).render(/* @__PURE__ */ jsxDEV17(App, {
|
|
@@ -80967,6 +81321,7 @@ var init_tui = __esm(() => {
|
|
|
80967
81321
|
init_codex_oauth();
|
|
80968
81322
|
init_kimi_oauth();
|
|
80969
81323
|
init_logger();
|
|
81324
|
+
init_renderer_theme();
|
|
80970
81325
|
init_endpoint_registration();
|
|
80971
81326
|
init_App();
|
|
80972
81327
|
if (isDirectRun) {
|
|
@@ -81145,15 +81500,21 @@ function createStatusLineScript(tokenFilePath) {
|
|
|
81145
81500
|
const timestamp = Date.now();
|
|
81146
81501
|
const scriptPath = join39(claudishDir, `status-${timestamp}.js`);
|
|
81147
81502
|
const escapedTokenPath = tokenFilePath.replace(/\\/g, "\\\\");
|
|
81503
|
+
const light = getThemeMode() === "light";
|
|
81504
|
+
const cyanCode = light ? "38;2;14;116;144" : "96";
|
|
81505
|
+
const yellowCode = light ? "38;2;161;98;7" : "93";
|
|
81506
|
+
const greenCode = light ? "38;2;21;128;61" : "92";
|
|
81507
|
+
const redCode = light ? "38;2;220;38;38" : "91";
|
|
81508
|
+
const magentaCode = light ? "38;2;147;51;234" : "95";
|
|
81148
81509
|
const script = `
|
|
81149
81510
|
const fs = require('fs');
|
|
81150
81511
|
const path = require('path');
|
|
81151
81512
|
|
|
81152
|
-
const CYAN = "\\x1b[
|
|
81153
|
-
const YELLOW = "\\x1b[
|
|
81154
|
-
const GREEN = "\\x1b[
|
|
81155
|
-
const RED = "\\x1b[
|
|
81156
|
-
const MAGENTA = "\\x1b[
|
|
81513
|
+
const CYAN = "\\x1b[${cyanCode}m";
|
|
81514
|
+
const YELLOW = "\\x1b[${yellowCode}m";
|
|
81515
|
+
const GREEN = "\\x1b[${greenCode}m";
|
|
81516
|
+
const RED = "\\x1b[${redCode}m";
|
|
81517
|
+
const MAGENTA = "\\x1b[${magentaCode}m";
|
|
81157
81518
|
const DIM = "\\x1b[2m";
|
|
81158
81519
|
const RESET = "\\x1b[0m";
|
|
81159
81520
|
const BOLD = "\\x1b[1m";
|
|
@@ -81393,22 +81754,23 @@ function createTempSettingsFile(_modelDisplay, port, proxyAuthMode, userStatusLi
|
|
|
81393
81754
|
const scriptPath = createStatusLineScript(tokenFilePath);
|
|
81394
81755
|
statusCommand = `node "${scriptPath}"`;
|
|
81395
81756
|
} else {
|
|
81396
|
-
const
|
|
81397
|
-
const
|
|
81398
|
-
const
|
|
81399
|
-
const
|
|
81400
|
-
const
|
|
81401
|
-
const
|
|
81402
|
-
const
|
|
81757
|
+
const light = getThemeMode() === "light";
|
|
81758
|
+
const CYAN3 = light ? "\\033[38;2;14;116;144m" : "\\033[96m";
|
|
81759
|
+
const YELLOW3 = light ? "\\033[38;2;161;98;7m" : "\\033[93m";
|
|
81760
|
+
const GREEN3 = light ? "\\033[38;2;21;128;61m" : "\\033[92m";
|
|
81761
|
+
const MAGENTA3 = light ? "\\033[38;2;147;51;234m" : "\\033[95m";
|
|
81762
|
+
const DIM3 = "\\033[2m";
|
|
81763
|
+
const RESET3 = "\\033[0m";
|
|
81764
|
+
const BOLD3 = "\\033[1m";
|
|
81403
81765
|
const readPlanBash = `PLAN_PAIR=$(echo "$TOKENS" | grep -o '"id": *"[^"]*", *"used_pct": *[0-9]*' | sed 's/"id": *"\\([^"]*\\)", *"used_pct": *\\([0-9]*\\)/\\2 \\1/' | sort -rn | head -1); if [ -n "$PLAN_PAIR" ]; then PLAN_PCT="\${PLAN_PAIR%% *}"; PLAN_ID="\${PLAN_PAIR#* }"; case "$PLAN_PCT" in ''|*[!0-9]*) PLAN_PCT="" ;; esac; [ -n "$PLAN_PCT" ] && PLAN_DISPLAY="$PLAN_ID:$PLAN_PCT%"; fi;`;
|
|
81404
81766
|
const formatTokensBash = `fmt_tok() { local n=\${1:-0}; if [ "$n" -ge 1000000 ]; then echo "$((n/1000000))M"; elif [ "$n" -ge 1000 ]; then echo "$((n/1000))k"; else echo "$n"; fi; }`;
|
|
81405
81767
|
const effWinBash = `eff_win() { local w=\${1:-0}; local m=\${CLAUDE_CODE_MAX_CONTEXT_TOKENS:-}; local a=\${CLAUDE_CODE_AUTO_COMPACT_WINDOW:-}; case "$m" in ''|*[!0-9]*) m=${CLAUDE_CODE_DEFAULT_MAX_CONTEXT};; esac; case "$a" in ''|*[!0-9]*) a=0;; esac; case "$w" in ''|*[!0-9]*) w=0;; esac; if [ "$w" -gt 0 ]; then if [ "$m" -gt 0 ] && [ "$m" -lt "$w" ]; then w=$m; fi; if [ "$a" -gt 0 ] && [ "$a" -lt "$w" ]; then w=$a; fi; fi; echo "$w"; }`;
|
|
81406
81768
|
const dirPrelude = `DIR=$(basename "$(pwd)"); [ \${#DIR} -gt 15 ] && DIR="\${DIR:0:12}..." || true; `;
|
|
81407
81769
|
const readState = `CTX=-1; COST="0"; IS_FREE="false"; IS_EST="false"; PROVIDER=""; TOKEN_MODEL=""; IN_TOK=0; CTX_WIN=0; PLAN_DISPLAY=""; ${formatTokensBash}; ${effWinBash}; if [ -f "${tokenFilePath}" ]; then TOKENS=$(cat "${tokenFilePath}" 2>/dev/null | tr -d '\\n\\r'); V=$(echo "$TOKENS" | grep -o '"context_left_percent": *-\\?[0-9]*' | grep -o '\\-\\?[0-9]*'); [ -n "$V" ] && CTX="$V"; V=$(echo "$TOKENS" | grep -o '"total_cost": *[0-9.]*' | cut -d: -f2 | tr -d ' '); [ -n "$V" ] && COST="$V"; V=$(echo "$TOKENS" | grep -o '"input_tokens": *[0-9]*' | grep -o '[0-9]*'); [ -n "$V" ] && IN_TOK="$V"; V=$(echo "$TOKENS" | grep -o '"context_window": *[0-9]*' | grep -o '[0-9]*'); [ -n "$V" ] && CTX_WIN="$V"; V=$(echo "$TOKENS" | grep -o '"is_free": *[a-z]*' | cut -d: -f2 | tr -d ' '); [ -n "$V" ] && IS_FREE="$V"; V=$(echo "$TOKENS" | grep -o '"is_estimated": *[a-z]*' | cut -d: -f2 | tr -d ' '); [ -n "$V" ] && IS_EST="$V"; V=$(echo "$TOKENS" | grep -o '"provider_name": *"[^"]*"' | cut -d'"' -f4); [ -n "$V" ] && PROVIDER="$V"; V=$(echo "$TOKENS" | grep -o '"model_name": *"[^"]*"' | cut -d'"' -f4); [ -n "$V" ] && TOKEN_MODEL="$V"; ${readPlanBash} fi; if [ "$CLAUDISH_IS_LOCAL" = "true" ]; then COST_DISPLAY="LOCAL"; elif [ "$IS_FREE" = "true" ]; then COST_DISPLAY="FREE"; elif [ "$IS_EST" = "true" ]; then COST_DISPLAY=$(printf "~\\$%.3f" "$COST"); else COST_DISPLAY=$(printf "\\$%.3f" "$COST"); fi; MODEL_DISPLAY="\${TOKEN_MODEL:-$CLAUDISH_ACTIVE_MODEL_NAME}"; if [ -n "$PROVIDER" ]; then MODEL_DISPLAY="$PROVIDER $MODEL_DISPLAY"; fi; EFF_WIN=$(eff_win $CTX_WIN); if [ "$EFF_WIN" -gt 0 ] 2>/dev/null && [ "$IN_TOK" -gt 0 ] 2>/dev/null; then CTX=$(( ((EFF_WIN - IN_TOK) * 200 / EFF_WIN + 1) / 2 )); if [ "$CTX" -lt 0 ]; then CTX=0; fi; fi; if [ "$CTX" -lt 0 ] 2>/dev/null || [ "$EFF_WIN" -le 0 ] 2>/dev/null; then if [ "$IN_TOK" -gt 0 ] 2>/dev/null; then CTX_DISPLAY="$(fmt_tok $IN_TOK) tokens"; else CTX_DISPLAY="N/A"; fi; elif [ "$IN_TOK" -gt 0 ] 2>/dev/null; then if [ "$EFF_WIN" -lt "$CTX_WIN" ] 2>/dev/null; then CTX_DISPLAY="$CTX% ($(fmt_tok $IN_TOK)/$(fmt_tok $EFF_WIN) of $(fmt_tok $CTX_WIN))"; else CTX_DISPLAY="$CTX% ($(fmt_tok $IN_TOK)/$(fmt_tok $EFF_WIN))"; fi; else CTX_DISPLAY="$CTX%"; fi`;
|
|
81408
|
-
const planSuffix = `if [ -n "$PLAN_DISPLAY" ]; then printf " ${
|
|
81409
|
-
const segmentWithDir = `printf "${
|
|
81410
|
-
const segmentNoDirWithProvider = `printf "${YELLOW3}%s${
|
|
81411
|
-
const segmentNoDirNoProvider = `printf "${
|
|
81770
|
+
const planSuffix = `if [ -n "$PLAN_DISPLAY" ]; then printf " ${DIM3}\u2022${RESET3} ${GREEN3}%s${RESET3}" "$PLAN_DISPLAY"; fi`;
|
|
81771
|
+
const segmentWithDir = `printf "${CYAN3}${BOLD3}%s${RESET3} ${DIM3}\u2022${RESET3} ${YELLOW3}%s${RESET3} ${DIM3}\u2022${RESET3} ${GREEN3}%s${RESET3} ${DIM3}\u2022${RESET3} ${MAGENTA3}%s${RESET3}" "$DIR" "$MODEL_DISPLAY" "$COST_DISPLAY" "$CTX_DISPLAY"; ${planSuffix}; printf "\\n"`;
|
|
81772
|
+
const segmentNoDirWithProvider = `printf "${YELLOW3}%s${RESET3} ${DIM3}\u2022${RESET3} ${GREEN3}%s${RESET3} ${DIM3}\u2022${RESET3} ${MAGENTA3}%s${RESET3}" "$PROVIDER" "$COST_DISPLAY" "$CTX_DISPLAY"; ${planSuffix}; printf "\\n"`;
|
|
81773
|
+
const segmentNoDirNoProvider = `printf "${GREEN3}%s${RESET3} ${DIM3}\u2022${RESET3} ${MAGENTA3}%s${RESET3}" "$COST_DISPLAY" "$CTX_DISPLAY"; ${planSuffix}; printf "\\n"`;
|
|
81412
81774
|
const segmentNoDir = `if [ -n "$PROVIDER" ]; then ${segmentNoDirWithProvider}; else ${segmentNoDirNoProvider}; fi`;
|
|
81413
81775
|
statusCommand = userStatusLineCommand ? buildChainedStatusCommand(userStatusLineCommand, readState, segmentNoDir) : `JSON=$(cat); ${dirPrelude}${readState}; ${segmentWithDir}`;
|
|
81414
81776
|
}
|
|
@@ -81813,6 +82175,7 @@ var init_claude_runner = __esm(() => {
|
|
|
81813
82175
|
init_routing_rules();
|
|
81814
82176
|
init_telemetry();
|
|
81815
82177
|
init_terminal_isolation();
|
|
82178
|
+
init_theme_mode();
|
|
81816
82179
|
STALE_TOKEN_FILE_MS = 7 * 24 * 60 * 60 * 1000;
|
|
81817
82180
|
});
|
|
81818
82181
|
|
|
@@ -82187,6 +82550,32 @@ var init_text = __esm(() => {
|
|
|
82187
82550
|
});
|
|
82188
82551
|
|
|
82189
82552
|
// src/tui/viz/tokens.ts
|
|
82553
|
+
function refreshTokens() {
|
|
82554
|
+
tokens.fatal = C.red;
|
|
82555
|
+
tokens.error = C.red;
|
|
82556
|
+
tokens.warn = C.orange;
|
|
82557
|
+
tokens.info = C.cyan;
|
|
82558
|
+
tokens.debug = C.fgMuted;
|
|
82559
|
+
tokens.trace = C.dim;
|
|
82560
|
+
tokens.success = C.green;
|
|
82561
|
+
tokens.running = C.blue;
|
|
82562
|
+
tokens.idle = C.fgMuted;
|
|
82563
|
+
tokens.dead = C.dim;
|
|
82564
|
+
tokens.border = C.border;
|
|
82565
|
+
tokens.subtle = C.dim;
|
|
82566
|
+
tokens.text = C.fg;
|
|
82567
|
+
tokens.accent = C.focusBorder;
|
|
82568
|
+
tokens.bgPanel = C.bgAlt;
|
|
82569
|
+
tokens.ink = C.black;
|
|
82570
|
+
refreshRamps();
|
|
82571
|
+
}
|
|
82572
|
+
function refreshRamps() {
|
|
82573
|
+
ramps.load = [tokens.success, C.yellow, tokens.error];
|
|
82574
|
+
ramps.temperature = [tokens.running, tokens.success, C.orange, tokens.error];
|
|
82575
|
+
ramps.network = [tokens.success, C.yellow, tokens.error];
|
|
82576
|
+
ramps.savings = [tokens.error, C.yellow, tokens.success];
|
|
82577
|
+
ramps.volume = [C.border, C.blue, C.cyan];
|
|
82578
|
+
}
|
|
82190
82579
|
var tokens, ramps;
|
|
82191
82580
|
var init_tokens = __esm(() => {
|
|
82192
82581
|
init_theme2();
|
|
@@ -82215,6 +82604,7 @@ var init_tokens = __esm(() => {
|
|
|
82215
82604
|
savings: [tokens.error, C.yellow, tokens.success],
|
|
82216
82605
|
volume: [C.border, C.blue, C.cyan]
|
|
82217
82606
|
};
|
|
82607
|
+
registerPaletteRefresher(refreshTokens);
|
|
82218
82608
|
});
|
|
82219
82609
|
|
|
82220
82610
|
// src/tui/viz/color.ts
|
|
@@ -82370,7 +82760,7 @@ function BadgeSpan({ label, bg, width }) {
|
|
|
82370
82760
|
/* @__PURE__ */ jsxDEV18("span", {
|
|
82371
82761
|
fg: pickInk(bg),
|
|
82372
82762
|
bg,
|
|
82373
|
-
attributes:
|
|
82763
|
+
attributes: BOLD3,
|
|
82374
82764
|
children: ` ${label} `
|
|
82375
82765
|
}, undefined, false, undefined, this),
|
|
82376
82766
|
badgePad(label, width)
|
|
@@ -82401,12 +82791,12 @@ function Panel({
|
|
|
82401
82791
|
children
|
|
82402
82792
|
}, undefined, false, undefined, this);
|
|
82403
82793
|
}
|
|
82404
|
-
var
|
|
82794
|
+
var BOLD3, FILL = "\u2588", TRACK = "\u2591", SPARK, GAP = " ", NODATA = "\u254C", RAMP_CACHE, RAMP_CACHE_MAX = 64;
|
|
82405
82795
|
var init_widgets = __esm(() => {
|
|
82406
82796
|
init_color();
|
|
82407
82797
|
init_text();
|
|
82408
82798
|
init_tokens();
|
|
82409
|
-
|
|
82799
|
+
BOLD3 = createTextAttributes2({ bold: true });
|
|
82410
82800
|
SPARK = ["\u2581", "\u2582", "\u2583", "\u2584", "\u2585", "\u2586", "\u2587", "\u2588"];
|
|
82411
82801
|
RAMP_CACHE = new Map;
|
|
82412
82802
|
});
|
|
@@ -83056,6 +83446,9 @@ var init_conversation = __esm(() => {
|
|
|
83056
83446
|
import { useKeyboard as useKeyboard3 } from "@opentui/react";
|
|
83057
83447
|
import { useEffect as useEffect5, useMemo as useMemo3, useState as useState6 } from "react";
|
|
83058
83448
|
import { jsxDEV as jsxDEV19, Fragment as Fragment12 } from "@opentui/react/jsx-dev-runtime";
|
|
83449
|
+
function speaker() {
|
|
83450
|
+
return getThemeMode() === "light" ? SPEAKER_LIGHT : SPEAKER;
|
|
83451
|
+
}
|
|
83059
83452
|
function layoutRows(turns, textWidth) {
|
|
83060
83453
|
const rows = [];
|
|
83061
83454
|
const turnStart = [];
|
|
@@ -83389,6 +83782,9 @@ function scrollbarCells(viewport, total, top, hits) {
|
|
|
83389
83782
|
}
|
|
83390
83783
|
return cells;
|
|
83391
83784
|
}
|
|
83785
|
+
function barColor(cell) {
|
|
83786
|
+
return cell === "track" ? tokens.border : cell === "thumb" ? tokens.accent : tokens.warn;
|
|
83787
|
+
}
|
|
83392
83788
|
function ReaderRow({
|
|
83393
83789
|
row,
|
|
83394
83790
|
turn,
|
|
@@ -83404,15 +83800,16 @@ function ReaderRow({
|
|
|
83404
83800
|
children: " ".repeat(Math.max(0, width))
|
|
83405
83801
|
}, undefined, false, undefined, this),
|
|
83406
83802
|
/* @__PURE__ */ jsxDEV19("span", {
|
|
83407
|
-
bg:
|
|
83803
|
+
bg: barColor(bar),
|
|
83408
83804
|
children: " "
|
|
83409
83805
|
}, undefined, false, undefined, this)
|
|
83410
83806
|
]
|
|
83411
83807
|
}, undefined, true, undefined, this);
|
|
83412
83808
|
}
|
|
83809
|
+
const sp = speaker();
|
|
83413
83810
|
const text = turn.text.slice(row.start, row.end);
|
|
83414
83811
|
const fg = turn.role === "user" ? tokens.text : C.fgMuted;
|
|
83415
|
-
const railFg = turn.role === "user" ?
|
|
83812
|
+
const railFg = turn.role === "user" ? sp.you : sp.ai;
|
|
83416
83813
|
const pad2 = Math.max(0, width - GUTTER - displayWidth(text));
|
|
83417
83814
|
return /* @__PURE__ */ jsxDEV19("text", {
|
|
83418
83815
|
children: [
|
|
@@ -83422,7 +83819,7 @@ function ReaderRow({
|
|
|
83422
83819
|
}, undefined, false, undefined, this),
|
|
83423
83820
|
row.first ? /* @__PURE__ */ jsxDEV19(BadgeSpan, {
|
|
83424
83821
|
label: turn.role === "user" ? "you" : "ai",
|
|
83425
|
-
bg: turn.role === "user" ?
|
|
83822
|
+
bg: turn.role === "user" ? sp.you : sp.ai,
|
|
83426
83823
|
width: ROLE_W
|
|
83427
83824
|
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV19("span", {
|
|
83428
83825
|
children: " ".repeat(ROLE_W)
|
|
@@ -83435,7 +83832,7 @@ function ReaderRow({
|
|
|
83435
83832
|
children: " ".repeat(pad2)
|
|
83436
83833
|
}, undefined, false, undefined, this),
|
|
83437
83834
|
/* @__PURE__ */ jsxDEV19("span", {
|
|
83438
|
-
bg:
|
|
83835
|
+
bg: barColor(bar),
|
|
83439
83836
|
children: " "
|
|
83440
83837
|
}, undefined, false, undefined, this)
|
|
83441
83838
|
]
|
|
@@ -83456,7 +83853,7 @@ function highlighted(text, hl, current, fg) {
|
|
|
83456
83853
|
}, `p${i}`, false, undefined, this));
|
|
83457
83854
|
const bg = hit === current ? tokens.accent : tokens.warn;
|
|
83458
83855
|
out.push(/* @__PURE__ */ jsxDEV19("span", {
|
|
83459
|
-
fg: tokens.ink,
|
|
83856
|
+
fg: pickInk(bg, tokens.ink, C.ink),
|
|
83460
83857
|
bg,
|
|
83461
83858
|
attributes: A.bold,
|
|
83462
83859
|
children: text.slice(start, e)
|
|
@@ -83472,9 +83869,11 @@ function highlighted(text, hl, current, fg) {
|
|
|
83472
83869
|
children: out
|
|
83473
83870
|
}, undefined, false, undefined, this);
|
|
83474
83871
|
}
|
|
83475
|
-
var RAIL = "\u258D", RAIL_W = 2, ROLE_W = 6, GUTTER, BAR_W = 1, SPEAKER, MAX_MATCHES = 5000, EMPTY_SEARCH, NO_TURNS
|
|
83872
|
+
var RAIL = "\u258D", RAIL_W = 2, ROLE_W = 6, GUTTER, BAR_W = 1, SPEAKER, SPEAKER_LIGHT, MAX_MATCHES = 5000, EMPTY_SEARCH, NO_TURNS;
|
|
83476
83873
|
var init_conversation_reader = __esm(() => {
|
|
83874
|
+
init_theme_mode();
|
|
83477
83875
|
init_theme2();
|
|
83876
|
+
init_color();
|
|
83478
83877
|
init_text();
|
|
83479
83878
|
init_tokens();
|
|
83480
83879
|
init_widgets();
|
|
@@ -83485,13 +83884,12 @@ var init_conversation_reader = __esm(() => {
|
|
|
83485
83884
|
you: "#39d353",
|
|
83486
83885
|
ai: "#39c5cf"
|
|
83487
83886
|
};
|
|
83887
|
+
SPEAKER_LIGHT = {
|
|
83888
|
+
you: "#2da44e",
|
|
83889
|
+
ai: "#0891b2"
|
|
83890
|
+
};
|
|
83488
83891
|
EMPTY_SEARCH = { hits: [], ranges: new Map, capped: false };
|
|
83489
83892
|
NO_TURNS = [];
|
|
83490
|
-
BAR_COLOR = {
|
|
83491
|
-
track: tokens.border,
|
|
83492
|
-
thumb: tokens.accent,
|
|
83493
|
-
hit: tokens.warn
|
|
83494
|
-
};
|
|
83495
83893
|
});
|
|
83496
83894
|
|
|
83497
83895
|
// src/session/resume-picker.tsx
|
|
@@ -83524,6 +83922,15 @@ function age(ms) {
|
|
|
83524
83922
|
return `${h}h`;
|
|
83525
83923
|
return `${Math.floor(h / 24)}d`;
|
|
83526
83924
|
}
|
|
83925
|
+
function ghLevels() {
|
|
83926
|
+
return getThemeMode() === "light" ? GH_LEVELS_LIGHT : GH_LEVELS;
|
|
83927
|
+
}
|
|
83928
|
+
function chips() {
|
|
83929
|
+
return getThemeMode() === "light" ? CHIP_LIGHT : CHIP;
|
|
83930
|
+
}
|
|
83931
|
+
function hereFg() {
|
|
83932
|
+
return ghLevels()[4];
|
|
83933
|
+
}
|
|
83527
83934
|
function chipW(label) {
|
|
83528
83935
|
return label + 2;
|
|
83529
83936
|
}
|
|
@@ -83550,6 +83957,9 @@ function Slot({
|
|
|
83550
83957
|
bg
|
|
83551
83958
|
}, undefined, false, undefined, this);
|
|
83552
83959
|
}
|
|
83960
|
+
function muted() {
|
|
83961
|
+
return C.fgMuted;
|
|
83962
|
+
}
|
|
83553
83963
|
function WorktreeRow({
|
|
83554
83964
|
g,
|
|
83555
83965
|
cursor,
|
|
@@ -83562,35 +83972,36 @@ function WorktreeRow({
|
|
|
83562
83972
|
const room = Math.max(0, width - blockWidth(cols));
|
|
83563
83973
|
const series = room >= SPARK_MIN_DAYS ? activitySeries(g.sessions, room) : null;
|
|
83564
83974
|
const spark = series && hasActivity(series) ? series : null;
|
|
83565
|
-
const
|
|
83975
|
+
const chip = chips();
|
|
83976
|
+
const run = [];
|
|
83566
83977
|
if (cols.sync > 0 && g.ahead) {
|
|
83567
|
-
|
|
83978
|
+
run.push({
|
|
83568
83979
|
label: `\u2191${padStartTo(String(g.ahead), cols.sync)}`,
|
|
83569
|
-
bg:
|
|
83980
|
+
bg: chip.ahead,
|
|
83570
83981
|
labelW: cols.sync + 1
|
|
83571
83982
|
});
|
|
83572
83983
|
}
|
|
83573
83984
|
if (cols.sync > 0 && g.behind) {
|
|
83574
|
-
|
|
83985
|
+
run.push({
|
|
83575
83986
|
label: `\u2193${padStartTo(String(g.behind), cols.sync)}`,
|
|
83576
|
-
bg:
|
|
83987
|
+
bg: chip.behind,
|
|
83577
83988
|
labelW: cols.sync + 1
|
|
83578
83989
|
});
|
|
83579
83990
|
}
|
|
83580
83991
|
if (cols.dirty > 0 && g.dirty) {
|
|
83581
|
-
|
|
83992
|
+
run.push({
|
|
83582
83993
|
label: `${DIRTY_GLYPH}${padStartTo(String(g.dirty), cols.dirty)}`,
|
|
83583
|
-
bg:
|
|
83994
|
+
bg: chip.dirty,
|
|
83584
83995
|
labelW: cols.dirty + 1
|
|
83585
83996
|
});
|
|
83586
83997
|
}
|
|
83587
|
-
|
|
83588
|
-
|
|
83998
|
+
run.push({ label: padStartTo(String(count), cols.count), bg: chip.count, labelW: cols.count });
|
|
83999
|
+
run.push({
|
|
83589
84000
|
label: padStartTo(g.lastActiveMs ? age(g.lastActiveMs) : "\u2014", cols.age),
|
|
83590
|
-
bg: stale ?
|
|
84001
|
+
bg: stale ? chip.stale : chip.fresh,
|
|
83591
84002
|
labelW: cols.age
|
|
83592
84003
|
});
|
|
83593
|
-
const used =
|
|
84004
|
+
const used = run.reduce((w, c) => w + c.labelW + 2, 0) + LIVE_W;
|
|
83594
84005
|
const gap = Math.max(0, width - room - used);
|
|
83595
84006
|
return /* @__PURE__ */ jsxDEV20("box", {
|
|
83596
84007
|
flexDirection: "column",
|
|
@@ -83610,7 +84021,7 @@ function WorktreeRow({
|
|
|
83610
84021
|
children: [
|
|
83611
84022
|
spark ? /* @__PURE__ */ jsxDEV20(SparklineSpan, {
|
|
83612
84023
|
values: spark,
|
|
83613
|
-
fg:
|
|
84024
|
+
fg: sparkFg()
|
|
83614
84025
|
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV20("span", {
|
|
83615
84026
|
children: " ".repeat(room)
|
|
83616
84027
|
}, undefined, false, undefined, this),
|
|
@@ -83621,7 +84032,7 @@ function WorktreeRow({
|
|
|
83621
84032
|
fg: tokens.success,
|
|
83622
84033
|
children: g.activeNow ? "\u25CF " : " "
|
|
83623
84034
|
}, undefined, false, undefined, this),
|
|
83624
|
-
|
|
84035
|
+
run.map((c) => /* @__PURE__ */ jsxDEV20(Slot, {
|
|
83625
84036
|
label: c.label,
|
|
83626
84037
|
bg: c.bg,
|
|
83627
84038
|
labelW: c.labelW
|
|
@@ -83632,6 +84043,12 @@ function WorktreeRow({
|
|
|
83632
84043
|
]
|
|
83633
84044
|
}, undefined, true, undefined, this);
|
|
83634
84045
|
}
|
|
84046
|
+
function scrollbarOptions() {
|
|
84047
|
+
return {
|
|
84048
|
+
showArrows: false,
|
|
84049
|
+
trackOptions: { backgroundColor: tokens.bgPanel, foregroundColor: tokens.border }
|
|
84050
|
+
};
|
|
84051
|
+
}
|
|
83635
84052
|
function dailyActivity(groups, days) {
|
|
83636
84053
|
const day = 86400000;
|
|
83637
84054
|
const today = Math.floor(Date.now() / day);
|
|
@@ -83660,6 +84077,7 @@ function ActivityCalendar({
|
|
|
83660
84077
|
width
|
|
83661
84078
|
}) {
|
|
83662
84079
|
const levels = activityLevels(days);
|
|
84080
|
+
const scale = ghLevels();
|
|
83663
84081
|
const title = `activity \xB7 ${ACTIVITY_WEEKS}w `;
|
|
83664
84082
|
const grid = Math.max(WEEK_DAYS, width - WEEK_LABEL_W);
|
|
83665
84083
|
const base = Math.floor(grid / WEEK_DAYS);
|
|
@@ -83691,7 +84109,7 @@ function ActivityCalendar({
|
|
|
83691
84109
|
children: padTo(ago === 0 ? "now" : `-${ago}w`, WEEK_LABEL_W)
|
|
83692
84110
|
}, undefined, false, undefined, this),
|
|
83693
84111
|
Array.from({ length: WEEK_DAYS }, (_2, d) => /* @__PURE__ */ jsxDEV20("span", {
|
|
83694
|
-
bg:
|
|
84112
|
+
bg: scale[levels[w * WEEK_DAYS + d] ?? 0],
|
|
83695
84113
|
children: " ".repeat(base + (d < extra ? 1 : 0))
|
|
83696
84114
|
}, d, false, undefined, this))
|
|
83697
84115
|
]
|
|
@@ -83725,6 +84143,9 @@ function SectionHeader({ label, width }) {
|
|
|
83725
84143
|
]
|
|
83726
84144
|
}, undefined, true, undefined, this);
|
|
83727
84145
|
}
|
|
84146
|
+
function sparkFg() {
|
|
84147
|
+
return getThemeMode() === "light" ? SPARK_FG_LIGHT : SPARK_FG;
|
|
84148
|
+
}
|
|
83728
84149
|
function hasActivity(series) {
|
|
83729
84150
|
return series.some((v) => v > 0);
|
|
83730
84151
|
}
|
|
@@ -83780,7 +84201,7 @@ function SessionRowView({
|
|
|
83780
84201
|
}, undefined, false, undefined, this),
|
|
83781
84202
|
/* @__PURE__ */ jsxDEV20(BadgeSpan, {
|
|
83782
84203
|
label: padStartTo(age(row.mtimeMs), SESSION_AGE_W),
|
|
83783
|
-
bg: Date.now() - row.mtimeMs < STALE_MS ?
|
|
84204
|
+
bg: Date.now() - row.mtimeMs < STALE_MS ? chips().fresh : chips().stale,
|
|
83784
84205
|
width: SESSION_AGE_COL
|
|
83785
84206
|
}, undefined, false, undefined, this),
|
|
83786
84207
|
/* @__PURE__ */ jsxDEV20(MeterSpan, {
|
|
@@ -83789,7 +84210,7 @@ function SessionRowView({
|
|
|
83789
84210
|
ramp: ramps.volume
|
|
83790
84211
|
}, undefined, false, undefined, this),
|
|
83791
84212
|
/* @__PURE__ */ jsxDEV20("span", {
|
|
83792
|
-
fg:
|
|
84213
|
+
fg: muted(),
|
|
83793
84214
|
children: padStartTo(size, SIZE_COL)
|
|
83794
84215
|
}, undefined, false, undefined, this),
|
|
83795
84216
|
row.gitBranch ? /* @__PURE__ */ jsxDEV20("span", {
|
|
@@ -84082,7 +84503,7 @@ function ResumePicker({ groups, onDone }) {
|
|
|
84082
84503
|
/* @__PURE__ */ jsxDEV20("scrollbox", {
|
|
84083
84504
|
focused: false,
|
|
84084
84505
|
flexGrow: 1,
|
|
84085
|
-
scrollbarOptions:
|
|
84506
|
+
scrollbarOptions: scrollbarOptions(),
|
|
84086
84507
|
children: [
|
|
84087
84508
|
fresh.map((g, i) => /* @__PURE__ */ jsxDEV20(WorktreeRow, {
|
|
84088
84509
|
g,
|
|
@@ -84126,7 +84547,7 @@ function ResumePicker({ groups, onDone }) {
|
|
|
84126
84547
|
children: /* @__PURE__ */ jsxDEV20("scrollbox", {
|
|
84127
84548
|
focused: false,
|
|
84128
84549
|
flexGrow: 1,
|
|
84129
|
-
scrollbarOptions:
|
|
84550
|
+
scrollbarOptions: scrollbarOptions(),
|
|
84130
84551
|
children: items.length === 0 ? /* @__PURE__ */ jsxDEV20("text", {
|
|
84131
84552
|
fg: tokens.subtle,
|
|
84132
84553
|
children: " no sessions match"
|
|
@@ -84247,17 +84668,18 @@ function WorktreeDetail({
|
|
|
84247
84668
|
children: "no worktree selected"
|
|
84248
84669
|
}, undefined, false, undefined, this);
|
|
84249
84670
|
const L = 9;
|
|
84671
|
+
const chip = chips();
|
|
84250
84672
|
const badges = [];
|
|
84251
84673
|
if (group.dirty !== undefined) {
|
|
84252
84674
|
badges.push({
|
|
84253
84675
|
label: group.dirty > 0 ? `${DIRTY_GLYPH}${group.dirty} uncommitted` : "clean",
|
|
84254
|
-
bg: group.dirty > 0 ?
|
|
84676
|
+
bg: group.dirty > 0 ? chip.dirty : chip.clean
|
|
84255
84677
|
});
|
|
84256
84678
|
}
|
|
84257
84679
|
if (group.ahead)
|
|
84258
|
-
badges.push({ label: `\u2191${group.ahead}`, bg:
|
|
84680
|
+
badges.push({ label: `\u2191${group.ahead}`, bg: chip.ahead });
|
|
84259
84681
|
if (group.behind)
|
|
84260
|
-
badges.push({ label: `\u2193${group.behind}`, bg:
|
|
84682
|
+
badges.push({ label: `\u2193${group.behind}`, bg: chip.behind });
|
|
84261
84683
|
const badgeW = badges.reduce((w, b) => w + displayWidth(b.label) + 2, 0);
|
|
84262
84684
|
const marker = group.current ? " \u25B6 you are here" : !group.live ? " worktree deleted" : "";
|
|
84263
84685
|
const branch = group.branch ?? (group.live ? "detached" : "\u2014");
|
|
@@ -84283,7 +84705,7 @@ function WorktreeDetail({
|
|
|
84283
84705
|
children: truncate3(group.name, nameW)
|
|
84284
84706
|
}, undefined, false, undefined, this),
|
|
84285
84707
|
/* @__PURE__ */ jsxDEV20("span", {
|
|
84286
|
-
fg: group.current ?
|
|
84708
|
+
fg: group.current ? hereFg() : tokens.dead,
|
|
84287
84709
|
children: marker
|
|
84288
84710
|
}, undefined, false, undefined, this),
|
|
84289
84711
|
/* @__PURE__ */ jsxDEV20("span", {
|
|
@@ -84316,7 +84738,7 @@ function WorktreeDetail({
|
|
|
84316
84738
|
}, undefined, false, undefined, this),
|
|
84317
84739
|
/* @__PURE__ */ jsxDEV20(Sparkline, {
|
|
84318
84740
|
values: hasActivity(spark) ? spark : [],
|
|
84319
|
-
fg:
|
|
84741
|
+
fg: sparkFg()
|
|
84320
84742
|
}, undefined, false, undefined, this),
|
|
84321
84743
|
/* @__PURE__ */ jsxDEV20("text", {
|
|
84322
84744
|
fg: tokens.trace,
|
|
@@ -84394,6 +84816,7 @@ function Conversation({
|
|
|
84394
84816
|
}, undefined, false, undefined, this);
|
|
84395
84817
|
}
|
|
84396
84818
|
const ROLE_W2 = 6;
|
|
84819
|
+
const sp = speaker();
|
|
84397
84820
|
const textW = Math.max(10, width - ROLE_W2 - 2);
|
|
84398
84821
|
const shown = turns.slice(-max);
|
|
84399
84822
|
return /* @__PURE__ */ jsxDEV20("box", {
|
|
@@ -84408,19 +84831,20 @@ function Conversation({
|
|
|
84408
84831
|
}, undefined, false, undefined, this),
|
|
84409
84832
|
/* @__PURE__ */ jsxDEV20(BadgeSpan, {
|
|
84410
84833
|
label: t.role === "user" ? "you" : "ai",
|
|
84411
|
-
bg: t.role === "user" ?
|
|
84834
|
+
bg: t.role === "user" ? sp.you : sp.ai,
|
|
84412
84835
|
width: ROLE_W2
|
|
84413
84836
|
}, undefined, false, undefined, this),
|
|
84414
84837
|
/* @__PURE__ */ jsxDEV20("span", {
|
|
84415
|
-
fg: t.role === "user" ? tokens.text :
|
|
84838
|
+
fg: t.role === "user" ? tokens.text : muted(),
|
|
84416
84839
|
children: truncate3(t.text, textW)
|
|
84417
84840
|
}, undefined, false, undefined, this)
|
|
84418
84841
|
]
|
|
84419
84842
|
}, `${i}-${t.text.slice(0, 12)}`, true, undefined, this))
|
|
84420
84843
|
}, undefined, false, undefined, this);
|
|
84421
84844
|
}
|
|
84422
|
-
var PANEL_CHROME = 4, PANEL_BORDER = 2, SCROLL_CHROME = 1, SIDEBAR_MIN = 28, SIDEBAR_MAX = 50, DETAIL_CHROME = 5, WORKTREE_DETAIL_H = 4, STALE_MS, GH_LEVELS, CHIP,
|
|
84845
|
+
var PANEL_CHROME = 4, PANEL_BORDER = 2, SCROLL_CHROME = 1, SIDEBAR_MIN = 28, SIDEBAR_MAX = 50, DETAIL_CHROME = 5, WORKTREE_DETAIL_H = 4, STALE_MS, GH_LEVELS, GH_LEVELS_LIGHT, CHIP, CHIP_LIGHT, LIVE_W = 2, DIRTY_GLYPH = "+", SESSION_AGE_W = 3, SESSION_AGE_COL, SIZE_FLOOR_BYTES, WEEK_DAYS = 7, ACTIVITY_WEEKS = 6, BRANCH_ICON = "\u2387", BRANCH_LEAD = 5, BRANCH_LEAD_DENSE = 6, WEEK_LABEL_W = 4, ACTIVITY_H, SPARK_MIN_DAYS = 7, SPARK_FG = "#3f6f9e", SPARK_FG_LIGHT = "#2563eb";
|
|
84423
84846
|
var init_resume_picker = __esm(() => {
|
|
84847
|
+
init_theme_mode();
|
|
84424
84848
|
init_theme2();
|
|
84425
84849
|
init_text();
|
|
84426
84850
|
init_tokens();
|
|
@@ -84430,6 +84854,7 @@ var init_resume_picker = __esm(() => {
|
|
|
84430
84854
|
init_session_discovery();
|
|
84431
84855
|
STALE_MS = 3 * 86400000;
|
|
84432
84856
|
GH_LEVELS = ["#21262d", "#0e4429", "#006d32", "#26a641", "#39d353"];
|
|
84857
|
+
GH_LEVELS_LIGHT = ["#d0d7de", "#9be9a8", "#40c463", "#30a14e", "#216e39"];
|
|
84433
84858
|
CHIP = {
|
|
84434
84859
|
fresh: GH_LEVELS[4],
|
|
84435
84860
|
stale: "#a1a9b3",
|
|
@@ -84439,14 +84864,17 @@ var init_resume_picker = __esm(() => {
|
|
|
84439
84864
|
ahead: "#bc8cff",
|
|
84440
84865
|
behind: "#d2a8ff"
|
|
84441
84866
|
};
|
|
84442
|
-
|
|
84867
|
+
CHIP_LIGHT = {
|
|
84868
|
+
fresh: GH_LEVELS_LIGHT[3],
|
|
84869
|
+
stale: "#818b98",
|
|
84870
|
+
count: "#218bff",
|
|
84871
|
+
dirty: "#bf8700",
|
|
84872
|
+
clean: GH_LEVELS_LIGHT[2],
|
|
84873
|
+
ahead: "#a475f9",
|
|
84874
|
+
behind: "#b88aff"
|
|
84875
|
+
};
|
|
84443
84876
|
SESSION_AGE_COL = SESSION_AGE_W + 3;
|
|
84444
84877
|
SIZE_FLOOR_BYTES = 16 * 1024;
|
|
84445
|
-
MUTED = C.fgMuted;
|
|
84446
|
-
SCROLLBAR = {
|
|
84447
|
-
showArrows: false,
|
|
84448
|
-
trackOptions: { backgroundColor: tokens.bgPanel, foregroundColor: tokens.border }
|
|
84449
|
-
};
|
|
84450
84878
|
ACTIVITY_H = 2 + ACTIVITY_WEEKS;
|
|
84451
84879
|
});
|
|
84452
84880
|
|
|
@@ -84468,9 +84896,10 @@ async function runResumePicker(cwd = process.cwd()) {
|
|
|
84468
84896
|
await enrichWorktreeGit(groups, repo.root);
|
|
84469
84897
|
setStderrQuiet(true);
|
|
84470
84898
|
const renderer = await createCliRenderer3({
|
|
84471
|
-
|
|
84899
|
+
screenMode: "alternate-screen",
|
|
84472
84900
|
exitOnCtrlC: false
|
|
84473
84901
|
});
|
|
84902
|
+
await applyRendererThemeMode(renderer);
|
|
84474
84903
|
const root = createRoot3(renderer);
|
|
84475
84904
|
let chosen = null;
|
|
84476
84905
|
try {
|
|
@@ -84501,6 +84930,7 @@ async function runResumePicker(cwd = process.cwd()) {
|
|
|
84501
84930
|
}
|
|
84502
84931
|
var init_resume_picker_run = __esm(() => {
|
|
84503
84932
|
init_logger();
|
|
84933
|
+
init_renderer_theme();
|
|
84504
84934
|
init_resume_picker();
|
|
84505
84935
|
init_session_discovery();
|
|
84506
84936
|
});
|
|
@@ -84631,7 +85061,7 @@ function bg(hex4) {
|
|
|
84631
85061
|
return `\x1B[48;2;${r};${g};${b}m`;
|
|
84632
85062
|
}
|
|
84633
85063
|
function paint(text, hex4, bold4 = false) {
|
|
84634
|
-
return `${bold4 ?
|
|
85064
|
+
return `${bold4 ? BOLD4 : ""}${fg(hex4)}${text}${RESET3}`;
|
|
84635
85065
|
}
|
|
84636
85066
|
function meter(pct, width, ramp = ramps.load) {
|
|
84637
85067
|
const cells = Math.floor(width);
|
|
@@ -84651,7 +85081,7 @@ function meter(pct, width, ramp = ramps.load) {
|
|
|
84651
85081
|
}
|
|
84652
85082
|
out += i < filled ? FILL2 : TRACK2;
|
|
84653
85083
|
}
|
|
84654
|
-
return out +
|
|
85084
|
+
return out + RESET3;
|
|
84655
85085
|
}
|
|
84656
85086
|
function stackedBar(segments, width) {
|
|
84657
85087
|
const cells = Math.floor(width);
|
|
@@ -84666,10 +85096,10 @@ function stackedBar(segments, width) {
|
|
|
84666
85096
|
if (n > 0)
|
|
84667
85097
|
out += `${bg(segments[i].color)}${" ".repeat(n)}`;
|
|
84668
85098
|
}
|
|
84669
|
-
return out +
|
|
85099
|
+
return out + RESET3;
|
|
84670
85100
|
}
|
|
84671
85101
|
function badge(label, hex4) {
|
|
84672
|
-
return `${
|
|
85102
|
+
return `${BOLD4}${fg(pickInk(hex4, tokens.ink, C.ink))}${bg(hex4)} ${label} ${RESET3}`;
|
|
84673
85103
|
}
|
|
84674
85104
|
function stripAnsi4(s) {
|
|
84675
85105
|
return s.replace(ANSI_RE3, "");
|
|
@@ -84702,7 +85132,7 @@ function clipStyled(s, width) {
|
|
|
84702
85132
|
w += cw;
|
|
84703
85133
|
i += ch.length;
|
|
84704
85134
|
}
|
|
84705
|
-
return out +
|
|
85135
|
+
return out + RESET3;
|
|
84706
85136
|
}
|
|
84707
85137
|
function padVisible2(s, width, align = "left") {
|
|
84708
85138
|
const clipped = clipStyled(s, width);
|
|
@@ -84744,8 +85174,9 @@ function usd(n) {
|
|
|
84744
85174
|
return `$${n.toFixed(3)}`;
|
|
84745
85175
|
return `$${n.toFixed(2)}`;
|
|
84746
85176
|
}
|
|
84747
|
-
var
|
|
85177
|
+
var RESET3 = "\x1B[0m", BOLD4 = "\x1B[1m", FILL2 = "\u2588", TRACK2 = "\u2591", NODATA2 = "\u254C", ANSI_RE3;
|
|
84748
85178
|
var init_ansi_viz = __esm(() => {
|
|
85179
|
+
init_theme2();
|
|
84749
85180
|
init_color();
|
|
84750
85181
|
init_text();
|
|
84751
85182
|
init_tokens();
|
|
@@ -84759,6 +85190,12 @@ __export(exports_session_summary, {
|
|
|
84759
85190
|
renderSessionSummary: () => renderSessionSummary,
|
|
84760
85191
|
printSessionSummary: () => printSessionSummary
|
|
84761
85192
|
});
|
|
85193
|
+
function toolColors() {
|
|
85194
|
+
return [C.blue, C.cyan, "#8a7d1e", "#1f6d75", C.magenta, "#2d6e3e", C.orange];
|
|
85195
|
+
}
|
|
85196
|
+
function toolOther() {
|
|
85197
|
+
return C.dim;
|
|
85198
|
+
}
|
|
84762
85199
|
function cardWidth() {
|
|
84763
85200
|
const cols = process.stdout.columns || 80;
|
|
84764
85201
|
return Math.max(MIN_W, Math.min(MAX_W, cols - 2));
|
|
@@ -84778,15 +85215,15 @@ function renderSessionSummary(input) {
|
|
|
84778
85215
|
out.push(`${paint("\u2502", tokens.border)} ${padVisible2(s, inner)} ${paint("\u2502", tokens.border)}`);
|
|
84779
85216
|
};
|
|
84780
85217
|
const blank = () => row("");
|
|
84781
|
-
const
|
|
85218
|
+
const chips2 = [badge(truncate3(modelSpec, 34), tokens.accent)];
|
|
84782
85219
|
if (stats.isFree)
|
|
84783
|
-
|
|
85220
|
+
chips2.push(badge("FREE", C.pillKeyBg));
|
|
84784
85221
|
else if (stats.isEstimated)
|
|
84785
|
-
|
|
85222
|
+
chips2.push(badge("EST", "#8a7d1e"));
|
|
84786
85223
|
if (exitCode !== 0)
|
|
84787
|
-
|
|
85224
|
+
chips2.push(badge(`EXIT ${exitCode}`, "#9e2b2b"));
|
|
84788
85225
|
const right = body(duration3(stats.durationMs));
|
|
84789
|
-
const left = clipStyled(
|
|
85226
|
+
const left = clipStyled(chips2.join(" "), Math.max(0, inner - visibleWidth(right) - 1));
|
|
84790
85227
|
const gap = Math.max(1, inner - visibleWidth(left) - visibleWidth(right));
|
|
84791
85228
|
row(left + " ".repeat(gap) + right);
|
|
84792
85229
|
if (stats.providerName)
|
|
@@ -84812,13 +85249,15 @@ function renderSessionSummary(input) {
|
|
|
84812
85249
|
], barW), dim3("in ") + body(usd(stats.inputCostUsd)) + dim3(" out ") + body(usd(stats.outputCostUsd)));
|
|
84813
85250
|
}
|
|
84814
85251
|
if (stats.toolCallTotal > 0) {
|
|
84815
|
-
const
|
|
84816
|
-
const
|
|
84817
|
-
const
|
|
85252
|
+
const toolCols = toolColors();
|
|
85253
|
+
const other = toolOther();
|
|
85254
|
+
const shown = stats.toolCalls.slice(0, toolCols.length);
|
|
85255
|
+
const rest = stats.toolCalls.slice(toolCols.length).reduce((a, t) => a + t.count, 0);
|
|
85256
|
+
const segs = shown.map((t, i) => ({ value: t.count, color: toolCols[i] }));
|
|
84818
85257
|
if (rest > 0)
|
|
84819
|
-
segs.push({ value: rest, color:
|
|
85258
|
+
segs.push({ value: rest, color: other });
|
|
84820
85259
|
dataRow("tools", stackedBar(segs, barW), body(padStartTo(String(stats.toolCallTotal), 4)) + dim3(" calls"));
|
|
84821
|
-
const legend = shown.map((t, i) => paint(`${t.name} ${t.count}`,
|
|
85260
|
+
const legend = shown.map((t, i) => paint(`${t.name} ${t.count}`, toolCols[i])).concat(rest > 0 ? [paint(`other ${rest}`, other)] : []);
|
|
84822
85261
|
for (const line of wrapStyled(legend, dim3(" \xB7 "), inner - LABEL_W)) {
|
|
84823
85262
|
row(" ".repeat(LABEL_W) + line);
|
|
84824
85263
|
}
|
|
@@ -84843,12 +85282,12 @@ function renderSessionSummary(input) {
|
|
|
84843
85282
|
}
|
|
84844
85283
|
return out;
|
|
84845
85284
|
}
|
|
84846
|
-
function wrapStyled(
|
|
85285
|
+
function wrapStyled(chips2, sep, width) {
|
|
84847
85286
|
const lines = [];
|
|
84848
85287
|
let cur = "";
|
|
84849
85288
|
let curW = 0;
|
|
84850
85289
|
const sepW = visibleWidth(sep);
|
|
84851
|
-
for (const chip of
|
|
85290
|
+
for (const chip of chips2) {
|
|
84852
85291
|
const w = visibleWidth(chip);
|
|
84853
85292
|
if (cur && curW + sepW + w > width) {
|
|
84854
85293
|
lines.push(cur);
|
|
@@ -84866,24 +85305,14 @@ function wrapStyled(chips, sep, width) {
|
|
|
84866
85305
|
function printSessionSummary(input, write) {
|
|
84867
85306
|
for (const line of renderSessionSummary(input))
|
|
84868
85307
|
write(line);
|
|
84869
|
-
write(
|
|
85308
|
+
write(RESET3);
|
|
84870
85309
|
}
|
|
84871
|
-
var
|
|
85310
|
+
var MIN_W = 62, MAX_W = 96, CHROME = 4, LABEL_W = 10;
|
|
84872
85311
|
var init_session_summary = __esm(() => {
|
|
84873
85312
|
init_theme2();
|
|
84874
85313
|
init_text();
|
|
84875
85314
|
init_tokens();
|
|
84876
85315
|
init_ansi_viz();
|
|
84877
|
-
TOOL_COLORS = [
|
|
84878
|
-
C.blue,
|
|
84879
|
-
C.cyan,
|
|
84880
|
-
"#8a7d1e",
|
|
84881
|
-
"#1f6d75",
|
|
84882
|
-
C.magenta,
|
|
84883
|
-
"#2d6e3e",
|
|
84884
|
-
C.orange
|
|
84885
|
-
];
|
|
84886
|
-
TOOL_OTHER = C.dim;
|
|
84887
85316
|
});
|
|
84888
85317
|
|
|
84889
85318
|
// src/index.ts
|
|
@@ -85137,6 +85566,10 @@ async function runCli() {
|
|
|
85137
85566
|
return Buffer.concat(chunks).toString("utf-8");
|
|
85138
85567
|
}
|
|
85139
85568
|
try {
|
|
85569
|
+
await traceSpan("startup:theme-detect", async () => {
|
|
85570
|
+
const { detectAndSetThemeMode: detectAndSetThemeMode2 } = await Promise.resolve().then(() => (init_theme_mode(), exports_theme_mode));
|
|
85571
|
+
await detectAndSetThemeMode2();
|
|
85572
|
+
});
|
|
85140
85573
|
const cliConfig = await traceSpan("startup:parse-args", () => parseArgs2(process.argv.slice(2)));
|
|
85141
85574
|
await traceSpan("startup:endpoint-registration", async () => {
|
|
85142
85575
|
const { ensureEndpointsRegistered: ensureEndpointsRegistered2 } = await Promise.resolve().then(() => (init_endpoint_registration(), exports_endpoint_registration));
|