claudish 7.61.0 → 7.63.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 +857 -342
- 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.63.0";
|
|
733
733
|
|
|
734
734
|
// src/logger.ts
|
|
735
735
|
var exports_logger = {};
|
|
@@ -36505,6 +36505,17 @@ function wrapAnthropicError(status, message, errorType, upstreamStatus) {
|
|
|
36505
36505
|
error46.upstream_status = upstreamStatus;
|
|
36506
36506
|
return { type: "error", error: error46 };
|
|
36507
36507
|
}
|
|
36508
|
+
function extractUpstreamStatus(body) {
|
|
36509
|
+
if (!body)
|
|
36510
|
+
return;
|
|
36511
|
+
try {
|
|
36512
|
+
const parsed = JSON.parse(body);
|
|
36513
|
+
const status = parsed?.error?.upstream_status;
|
|
36514
|
+
return typeof status === "number" ? status : undefined;
|
|
36515
|
+
} catch {
|
|
36516
|
+
return;
|
|
36517
|
+
}
|
|
36518
|
+
}
|
|
36508
36519
|
function extractProviderMessage(body) {
|
|
36509
36520
|
if (body == null)
|
|
36510
36521
|
return "";
|
|
@@ -45297,6 +45308,40 @@ var init_endpoint_diagnostics = __esm(() => {
|
|
|
45297
45308
|
reasons = new Map;
|
|
45298
45309
|
});
|
|
45299
45310
|
|
|
45311
|
+
// src/providers/picker-alias-extra.ts
|
|
45312
|
+
var PROVIDER_FILTER_ALIAS_EXTRA;
|
|
45313
|
+
var init_picker_alias_extra = __esm(() => {
|
|
45314
|
+
PROVIDER_FILTER_ALIAS_EXTRA = {
|
|
45315
|
+
gem: "google",
|
|
45316
|
+
zen: "opencode-zen"
|
|
45317
|
+
};
|
|
45318
|
+
});
|
|
45319
|
+
|
|
45320
|
+
// src/providers/reserved-namespace.ts
|
|
45321
|
+
function reservedNamespace() {
|
|
45322
|
+
const reserved = new Map;
|
|
45323
|
+
for (const def of BUILTIN_PROVIDERS) {
|
|
45324
|
+
reserved.set(def.name.toLowerCase(), def.name);
|
|
45325
|
+
for (const shortcut of def.shortcuts) {
|
|
45326
|
+
reserved.set(shortcut.toLowerCase(), def.name);
|
|
45327
|
+
}
|
|
45328
|
+
for (const legacy of def.legacyPrefixes) {
|
|
45329
|
+
reserved.set(legacy.prefix.replace(/[/:]+$/, "").toLowerCase(), def.name);
|
|
45330
|
+
}
|
|
45331
|
+
}
|
|
45332
|
+
for (const [alias, owner] of Object.entries(PROVIDER_FILTER_ALIAS_EXTRA)) {
|
|
45333
|
+
reserved.set(alias.toLowerCase(), owner);
|
|
45334
|
+
}
|
|
45335
|
+
return reserved;
|
|
45336
|
+
}
|
|
45337
|
+
function reservedNamespaceOwner(name) {
|
|
45338
|
+
return reservedNamespace().get(name.toLowerCase());
|
|
45339
|
+
}
|
|
45340
|
+
var init_reserved_namespace = __esm(() => {
|
|
45341
|
+
init_picker_alias_extra();
|
|
45342
|
+
init_provider_definitions();
|
|
45343
|
+
});
|
|
45344
|
+
|
|
45300
45345
|
// src/providers/custom-endpoints-loader.ts
|
|
45301
45346
|
function registerEndpoint(name, entry, ovr) {
|
|
45302
45347
|
const validated = CustomEndpointSchema.parse(entry);
|
|
@@ -45314,11 +45359,18 @@ function registerEndpoint(name, entry, ovr) {
|
|
|
45314
45359
|
clearEndpointUnavailable(name);
|
|
45315
45360
|
}
|
|
45316
45361
|
function loadCustomEndpoints(config2) {
|
|
45317
|
-
const result = { registered: 0, errors: [] };
|
|
45362
|
+
const result = { registered: 0, errors: [], refused: [] };
|
|
45318
45363
|
const raw = config2.customEndpoints;
|
|
45319
45364
|
if (!raw || typeof raw !== "object")
|
|
45320
45365
|
return result;
|
|
45321
45366
|
for (const [name, entry] of Object.entries(raw)) {
|
|
45367
|
+
const owner = reservedNamespaceOwner(name);
|
|
45368
|
+
if (owner) {
|
|
45369
|
+
const reason = `'${name}' is already claimed by builtin provider '${owner}' ` + "(as its name, a shortcut, or a legacy prefix)";
|
|
45370
|
+
result.refused.push({ name, reason });
|
|
45371
|
+
recordEndpointUnavailable(name, `custom endpoint was skipped because ${reason}`);
|
|
45372
|
+
continue;
|
|
45373
|
+
}
|
|
45322
45374
|
try {
|
|
45323
45375
|
registerEndpoint(name, entry);
|
|
45324
45376
|
result.registered++;
|
|
@@ -45549,21 +45601,13 @@ var init_custom_endpoints_loader = __esm(() => {
|
|
|
45549
45601
|
init_composed_handler();
|
|
45550
45602
|
init_endpoint_diagnostics();
|
|
45551
45603
|
init_provider_definitions();
|
|
45604
|
+
init_reserved_namespace();
|
|
45552
45605
|
init_runtime_providers();
|
|
45553
45606
|
init_anthropic_compat();
|
|
45554
45607
|
init_litellm();
|
|
45555
45608
|
init_openai();
|
|
45556
45609
|
});
|
|
45557
45610
|
|
|
45558
|
-
// src/providers/picker-alias-extra.ts
|
|
45559
|
-
var PROVIDER_FILTER_ALIAS_EXTRA;
|
|
45560
|
-
var init_picker_alias_extra = __esm(() => {
|
|
45561
|
-
PROVIDER_FILTER_ALIAS_EXTRA = {
|
|
45562
|
-
gem: "google",
|
|
45563
|
-
zen: "opencode-zen"
|
|
45564
|
-
};
|
|
45565
|
-
});
|
|
45566
|
-
|
|
45567
45611
|
// src/providers/predefined-catalog.ts
|
|
45568
45612
|
var PREDEFINED_ENDPOINTS;
|
|
45569
45613
|
var init_predefined_catalog = __esm(() => {
|
|
@@ -45872,22 +45916,6 @@ function warnOnce2(message) {
|
|
|
45872
45916
|
function activeCatalog() {
|
|
45873
45917
|
return catalogOverride ?? PREDEFINED_ENDPOINTS;
|
|
45874
45918
|
}
|
|
45875
|
-
function reservedNamespace() {
|
|
45876
|
-
const reserved = new Map;
|
|
45877
|
-
for (const def of BUILTIN_PROVIDERS) {
|
|
45878
|
-
reserved.set(def.name.toLowerCase(), def.name);
|
|
45879
|
-
for (const shortcut of def.shortcuts) {
|
|
45880
|
-
reserved.set(shortcut.toLowerCase(), def.name);
|
|
45881
|
-
}
|
|
45882
|
-
for (const legacy of def.legacyPrefixes) {
|
|
45883
|
-
reserved.set(legacy.prefix.replace(/[/:]+$/, "").toLowerCase(), def.name);
|
|
45884
|
-
}
|
|
45885
|
-
}
|
|
45886
|
-
for (const [alias, owner] of Object.entries(PROVIDER_FILTER_ALIAS_EXTRA)) {
|
|
45887
|
-
reserved.set(alias.toLowerCase(), owner);
|
|
45888
|
-
}
|
|
45889
|
-
return reserved;
|
|
45890
|
-
}
|
|
45891
45919
|
function readOptOut(config2) {
|
|
45892
45920
|
const off = { disabled: true, disable: new Set, enable: new Set };
|
|
45893
45921
|
if (process.env[KILL_SWITCH_ENV] === "1")
|
|
@@ -46026,9 +46054,8 @@ var init_predefined_endpoints = __esm(() => {
|
|
|
46026
46054
|
init_config_schema();
|
|
46027
46055
|
init_custom_endpoints_loader();
|
|
46028
46056
|
init_endpoint_diagnostics();
|
|
46029
|
-
init_picker_alias_extra();
|
|
46030
46057
|
init_predefined_catalog();
|
|
46031
|
-
|
|
46058
|
+
init_reserved_namespace();
|
|
46032
46059
|
init_runtime_providers();
|
|
46033
46060
|
warnedMessages2 = new Set;
|
|
46034
46061
|
ownRegistrations = new Set;
|
|
@@ -46038,23 +46065,67 @@ var init_predefined_endpoints = __esm(() => {
|
|
|
46038
46065
|
var exports_endpoint_registration = {};
|
|
46039
46066
|
__export(exports_endpoint_registration, {
|
|
46040
46067
|
invalidateEndpointRegistration: () => invalidateEndpointRegistration,
|
|
46068
|
+
getCustomEndpointResult: () => getCustomEndpointResult,
|
|
46041
46069
|
ensureEndpointsRegistered: () => ensureEndpointsRegistered
|
|
46042
46070
|
});
|
|
46071
|
+
function getCustomEndpointResult() {
|
|
46072
|
+
return lastCustomResult;
|
|
46073
|
+
}
|
|
46043
46074
|
function ensureEndpointsRegistered(opts = {}) {
|
|
46044
46075
|
if (registered && !opts.force)
|
|
46045
46076
|
return;
|
|
46077
|
+
let config2;
|
|
46078
|
+
try {
|
|
46079
|
+
config2 = opts.config ?? loadConfig();
|
|
46080
|
+
} catch {
|
|
46081
|
+
return;
|
|
46082
|
+
}
|
|
46046
46083
|
registered = true;
|
|
46047
46084
|
try {
|
|
46048
|
-
loadPredefinedEndpoints(
|
|
46085
|
+
loadPredefinedEndpoints(config2);
|
|
46086
|
+
} catch {}
|
|
46087
|
+
try {
|
|
46088
|
+
lastCustomResult = loadCustomEndpoints(config2);
|
|
46089
|
+
reportCustomEndpoints(lastCustomResult);
|
|
46090
|
+
} catch {}
|
|
46091
|
+
try {
|
|
46092
|
+
warnOnProjectScopedEndpoints();
|
|
46049
46093
|
} catch {}
|
|
46050
46094
|
}
|
|
46095
|
+
function reportCustomEndpoints(result) {
|
|
46096
|
+
for (const { name, message } of result.errors) {
|
|
46097
|
+
logStderr(`customEndpoints['${name}'] failed validation: ${message}`);
|
|
46098
|
+
}
|
|
46099
|
+
for (const { name, reason } of result.refused) {
|
|
46100
|
+
warnOnce3(`customEndpoints['${name}'] skipped: ${reason}. The builtin wins. ` + `Rename your entry (e.g. '${name}-custom') to use it.`);
|
|
46101
|
+
}
|
|
46102
|
+
}
|
|
46103
|
+
function warnOnProjectScopedEndpoints() {
|
|
46104
|
+
try {
|
|
46105
|
+
const local = loadLocalConfig();
|
|
46106
|
+
const names = Object.keys(local?.customEndpoints ?? {});
|
|
46107
|
+
if (names.length === 0)
|
|
46108
|
+
return;
|
|
46109
|
+
warnOnce3(`.claudish.json declares customEndpoints (${names.join(", ")}) but they are ` + "read from the GLOBAL config only, so they are being ignored. Move them to " + "~/.claudish/config.json.");
|
|
46110
|
+
} catch {}
|
|
46111
|
+
}
|
|
46112
|
+
function warnOnce3(message) {
|
|
46113
|
+
if (warnedMessages3.has(message))
|
|
46114
|
+
return;
|
|
46115
|
+
warnedMessages3.add(message);
|
|
46116
|
+
logStderr(message);
|
|
46117
|
+
}
|
|
46051
46118
|
function invalidateEndpointRegistration() {
|
|
46052
46119
|
registered = false;
|
|
46053
46120
|
}
|
|
46054
|
-
var registered = false;
|
|
46121
|
+
var registered = false, lastCustomResult, warnedMessages3;
|
|
46055
46122
|
var init_endpoint_registration = __esm(() => {
|
|
46123
|
+
init_logger();
|
|
46056
46124
|
init_profile_config();
|
|
46125
|
+
init_custom_endpoints_loader();
|
|
46057
46126
|
init_predefined_endpoints();
|
|
46127
|
+
lastCustomResult = { registered: 0, errors: [], refused: [] };
|
|
46128
|
+
warnedMessages3 = new Set;
|
|
46058
46129
|
});
|
|
46059
46130
|
|
|
46060
46131
|
// src/providers/provider-registry.ts
|
|
@@ -46911,7 +46982,6 @@ async function prepareParentRoutingContext() {
|
|
|
46911
46982
|
try {
|
|
46912
46983
|
const config2 = loadConfig();
|
|
46913
46984
|
ensureEndpointsRegistered({ config: config2 });
|
|
46914
|
-
loadCustomEndpoints(config2);
|
|
46915
46985
|
} catch {}
|
|
46916
46986
|
}
|
|
46917
46987
|
try {
|
|
@@ -46960,7 +47030,6 @@ var init_prehydrate = __esm(() => {
|
|
|
46960
47030
|
init_profile_config();
|
|
46961
47031
|
init_auto_route();
|
|
46962
47032
|
init_catalog_client();
|
|
46963
|
-
init_custom_endpoints_loader();
|
|
46964
47033
|
init_endpoint_registration();
|
|
46965
47034
|
init_model_parser();
|
|
46966
47035
|
init_onepassword();
|
|
@@ -48113,17 +48182,6 @@ async function safeReadBody(response) {
|
|
|
48113
48182
|
return "";
|
|
48114
48183
|
}
|
|
48115
48184
|
}
|
|
48116
|
-
function extractUpstreamStatus(body) {
|
|
48117
|
-
if (!body)
|
|
48118
|
-
return;
|
|
48119
|
-
try {
|
|
48120
|
-
const parsed = JSON.parse(body);
|
|
48121
|
-
const status = parsed?.error?.upstream_status;
|
|
48122
|
-
return typeof status === "number" ? status : undefined;
|
|
48123
|
-
} catch {
|
|
48124
|
-
return;
|
|
48125
|
-
}
|
|
48126
|
-
}
|
|
48127
48185
|
function extractErrorType(body) {
|
|
48128
48186
|
if (!body)
|
|
48129
48187
|
return;
|
|
@@ -48447,6 +48505,7 @@ function isFailureState(state) {
|
|
|
48447
48505
|
}
|
|
48448
48506
|
var STREAM_MS_FLOOR = 50, OAUTH_PROVIDERS2, PROBE_PROMPT = "Count from one to twenty in words, one per line.", PROBE_MAX_TOKENS = 512, MINIMAL_EFFORT_UNSUPPORTED;
|
|
48449
48507
|
var init_probe_live = __esm(() => {
|
|
48508
|
+
init_anthropic_error();
|
|
48450
48509
|
init_model_unsupported();
|
|
48451
48510
|
OAUTH_PROVIDERS2 = new Set(["vertex", "antigravity", "devin"]);
|
|
48452
48511
|
MINIMAL_EFFORT_UNSUPPORTED = new Set(["native-anthropic", "anthropic"]);
|
|
@@ -50491,6 +50550,10 @@ ${summary}`);
|
|
|
50491
50550
|
function isRetryableError(status, errorBody, provider) {
|
|
50492
50551
|
if (hasQuotaExhaustionWording(errorBody))
|
|
50493
50552
|
return true;
|
|
50553
|
+
const upstream = status === 400 ? extractUpstreamStatus(errorBody) : undefined;
|
|
50554
|
+
if (upstream === 401 || upstream === 403 || upstream === 402 || upstream === 429) {
|
|
50555
|
+
return true;
|
|
50556
|
+
}
|
|
50494
50557
|
if (status === 401 || status === 403)
|
|
50495
50558
|
return true;
|
|
50496
50559
|
if (status === 402)
|
|
@@ -50526,8 +50589,15 @@ function isRetryableError(status, errorBody, provider) {
|
|
|
50526
50589
|
function exhaustedChainStatus(errors3) {
|
|
50527
50590
|
if (errors3.length === 0)
|
|
50528
50591
|
return 400;
|
|
50529
|
-
const
|
|
50530
|
-
|
|
50592
|
+
const isTransient = (e) => {
|
|
50593
|
+
if (e.status === 429 || e.status === 503)
|
|
50594
|
+
return true;
|
|
50595
|
+
if (hasQuotaExhaustionWording(e.message))
|
|
50596
|
+
return true;
|
|
50597
|
+
const upstream = e.status === 400 ? extractUpstreamStatus(e.message) : undefined;
|
|
50598
|
+
return upstream === 429 || upstream === 503;
|
|
50599
|
+
};
|
|
50600
|
+
return errors3.every(isTransient) ? 503 : 400;
|
|
50531
50601
|
}
|
|
50532
50602
|
function isProvider(provider, needle) {
|
|
50533
50603
|
if (!provider)
|
|
@@ -50552,6 +50622,7 @@ function truncate(s, max) {
|
|
|
50552
50622
|
var init_fallback_handler = __esm(() => {
|
|
50553
50623
|
init_logger();
|
|
50554
50624
|
init_composed_handler();
|
|
50625
|
+
init_anthropic_error();
|
|
50555
50626
|
init_quota_exhaustion();
|
|
50556
50627
|
});
|
|
50557
50628
|
|
|
@@ -52034,14 +52105,11 @@ function maybeCaptureClassifierRequest(c, body) {
|
|
|
52034
52105
|
async function createProxyServer(port, _openrouterApiKey, model, monitorMode = false, anthropicApiKey, modelMap, options = {}) {
|
|
52035
52106
|
try {
|
|
52036
52107
|
const config2 = loadConfig();
|
|
52037
|
-
ensureEndpointsRegistered({ config: config2 });
|
|
52038
|
-
const customEpResult =
|
|
52108
|
+
ensureEndpointsRegistered({ config: config2, force: true });
|
|
52109
|
+
const customEpResult = getCustomEndpointResult();
|
|
52039
52110
|
if (customEpResult.registered > 0) {
|
|
52040
52111
|
log(`[Proxy] Registered ${customEpResult.registered} custom endpoint(s) from config`);
|
|
52041
52112
|
}
|
|
52042
|
-
for (const err of customEpResult.errors) {
|
|
52043
|
-
logStderr(`customEndpoints['${err.name}'] failed validation: ${err.message}`);
|
|
52044
|
-
}
|
|
52045
52113
|
} catch (err) {
|
|
52046
52114
|
log(`[Proxy] customEndpoints load skipped: ${err instanceof Error ? err.message : String(err)}`);
|
|
52047
52115
|
}
|
|
@@ -52511,7 +52579,6 @@ var init_proxy_server = __esm(() => {
|
|
|
52511
52579
|
init_profile_config();
|
|
52512
52580
|
init_auto_route();
|
|
52513
52581
|
init_catalog_client();
|
|
52514
|
-
init_custom_endpoints_loader();
|
|
52515
52582
|
init_endpoint_diagnostics();
|
|
52516
52583
|
init_endpoint_registration();
|
|
52517
52584
|
init_model_parser();
|
|
@@ -54106,6 +54173,7 @@ Use with: run_prompt(model="${results[0].model.id}", prompt="your prompt")`;
|
|
|
54106
54173
|
const doProbe = args.probe !== false;
|
|
54107
54174
|
const timeoutMs = typeof args.timeout_ms === "number" ? args.timeout_ms : 20000;
|
|
54108
54175
|
const proxy = doProbe ? await getProxy() : null;
|
|
54176
|
+
ensureEndpointsRegistered();
|
|
54109
54177
|
const rows = [];
|
|
54110
54178
|
const readyModels = [];
|
|
54111
54179
|
const failedModels = [];
|
|
@@ -54775,6 +54843,7 @@ var init_mcp_server = __esm(() => {
|
|
|
54775
54843
|
init_progress_heartbeat();
|
|
54776
54844
|
init_model_loader();
|
|
54777
54845
|
init_port_manager();
|
|
54846
|
+
init_endpoint_registration();
|
|
54778
54847
|
init_model_parser();
|
|
54779
54848
|
init_onepassword();
|
|
54780
54849
|
init_probe_live();
|
|
@@ -54912,6 +54981,208 @@ var init_serve_command = __esm(() => {
|
|
|
54912
54981
|
init_proxy_server();
|
|
54913
54982
|
});
|
|
54914
54983
|
|
|
54984
|
+
// src/theme/theme-mode.ts
|
|
54985
|
+
var exports_theme_mode = {};
|
|
54986
|
+
__export(exports_theme_mode, {
|
|
54987
|
+
themeModeOverride: () => themeModeOverride,
|
|
54988
|
+
themeModeFromColorFgBg: () => themeModeFromColorFgBg,
|
|
54989
|
+
setThemeMode: () => setThemeMode,
|
|
54990
|
+
resetThemeModeForTests: () => resetThemeModeForTests,
|
|
54991
|
+
relativeLuminance: () => relativeLuminance,
|
|
54992
|
+
queryTerminalThemeMode: () => queryTerminalThemeMode,
|
|
54993
|
+
onThemeModeChange: () => onThemeModeChange,
|
|
54994
|
+
getThemeMode: () => getThemeMode,
|
|
54995
|
+
detectAndSetThemeModeSync: () => detectAndSetThemeModeSync,
|
|
54996
|
+
detectAndSetThemeMode: () => detectAndSetThemeMode,
|
|
54997
|
+
classifyOscBackground: () => classifyOscBackground
|
|
54998
|
+
});
|
|
54999
|
+
function getThemeMode() {
|
|
55000
|
+
return detected;
|
|
55001
|
+
}
|
|
55002
|
+
function setThemeMode(mode) {
|
|
55003
|
+
detected = mode;
|
|
55004
|
+
for (const cb of listeners)
|
|
55005
|
+
cb(mode);
|
|
55006
|
+
}
|
|
55007
|
+
function onThemeModeChange(cb) {
|
|
55008
|
+
listeners.push(cb);
|
|
55009
|
+
cb(detected);
|
|
55010
|
+
}
|
|
55011
|
+
function resetThemeModeForTests() {
|
|
55012
|
+
setThemeMode(null);
|
|
55013
|
+
}
|
|
55014
|
+
function themeModeOverride(env = process.env) {
|
|
55015
|
+
const raw2 = env.CLAUDISH_THEME?.trim().toLowerCase();
|
|
55016
|
+
if (raw2 === "light" || raw2 === "dark")
|
|
55017
|
+
return raw2;
|
|
55018
|
+
return null;
|
|
55019
|
+
}
|
|
55020
|
+
function themeModeFromColorFgBg(env = process.env) {
|
|
55021
|
+
const raw2 = env.COLORFGBG;
|
|
55022
|
+
if (!raw2)
|
|
55023
|
+
return null;
|
|
55024
|
+
const last = raw2.split(";").pop()?.trim();
|
|
55025
|
+
if (!last || !/^\d+$/.test(last))
|
|
55026
|
+
return null;
|
|
55027
|
+
const bg = Number.parseInt(last, 10);
|
|
55028
|
+
if (bg === 7 || bg === 15)
|
|
55029
|
+
return "light";
|
|
55030
|
+
if (bg <= 8)
|
|
55031
|
+
return "dark";
|
|
55032
|
+
return null;
|
|
55033
|
+
}
|
|
55034
|
+
function relativeLuminance(r, g, b) {
|
|
55035
|
+
const lin = (c) => c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
55036
|
+
return 0.2126 * lin(r) + 0.7152 * lin(g) + 0.0722 * lin(b);
|
|
55037
|
+
}
|
|
55038
|
+
function classifyOscBackground(reply) {
|
|
55039
|
+
const m = reply.match(/\]11;rgb:([0-9a-fA-F]{1,4})\/([0-9a-fA-F]{1,4})\/([0-9a-fA-F]{1,4})/);
|
|
55040
|
+
if (!m)
|
|
55041
|
+
return null;
|
|
55042
|
+
const channel = (hex3) => {
|
|
55043
|
+
const max = 16 ** hex3.length - 1;
|
|
55044
|
+
return Number.parseInt(hex3, 16) / max;
|
|
55045
|
+
};
|
|
55046
|
+
const lum = relativeLuminance(channel(m[1]), channel(m[2]), channel(m[3]));
|
|
55047
|
+
return lum >= MID_SRGB_LUMINANCE ? "light" : "dark";
|
|
55048
|
+
}
|
|
55049
|
+
async function queryTerminalThemeMode(timeoutMs = 150) {
|
|
55050
|
+
const stdin = process.stdin;
|
|
55051
|
+
const stdout = process.stdout;
|
|
55052
|
+
if (!stdin.isTTY || !stdout.isTTY || typeof stdin.setRawMode !== "function")
|
|
55053
|
+
return null;
|
|
55054
|
+
if (process.env.TERM === "dumb")
|
|
55055
|
+
return null;
|
|
55056
|
+
return await new Promise((resolve5) => {
|
|
55057
|
+
let buffer = "";
|
|
55058
|
+
let settled = false;
|
|
55059
|
+
const wasRaw = stdin.isRaw === true;
|
|
55060
|
+
const finish = (mode) => {
|
|
55061
|
+
if (settled)
|
|
55062
|
+
return;
|
|
55063
|
+
settled = true;
|
|
55064
|
+
clearTimeout(timer);
|
|
55065
|
+
stdin.off("data", onData);
|
|
55066
|
+
try {
|
|
55067
|
+
if (!wasRaw)
|
|
55068
|
+
stdin.setRawMode(false);
|
|
55069
|
+
stdin.pause();
|
|
55070
|
+
} catch {}
|
|
55071
|
+
resolve5(mode);
|
|
55072
|
+
};
|
|
55073
|
+
const onData = (chunk) => {
|
|
55074
|
+
buffer += chunk.toString("latin1");
|
|
55075
|
+
if (/\]11;[^\x07\x1b]*(\x07|\x1b\\)/.test(buffer)) {
|
|
55076
|
+
finish(classifyOscBackground(buffer));
|
|
55077
|
+
}
|
|
55078
|
+
};
|
|
55079
|
+
const timer = setTimeout(() => finish(null), timeoutMs);
|
|
55080
|
+
try {
|
|
55081
|
+
if (!wasRaw)
|
|
55082
|
+
stdin.setRawMode(true);
|
|
55083
|
+
stdin.resume();
|
|
55084
|
+
stdin.on("data", onData);
|
|
55085
|
+
stdout.write("\x1B]11;?\x07");
|
|
55086
|
+
} catch {
|
|
55087
|
+
finish(null);
|
|
55088
|
+
}
|
|
55089
|
+
});
|
|
55090
|
+
}
|
|
55091
|
+
async function detectAndSetThemeMode() {
|
|
55092
|
+
const override = themeModeOverride();
|
|
55093
|
+
if (override) {
|
|
55094
|
+
setThemeMode(override);
|
|
55095
|
+
return override;
|
|
55096
|
+
}
|
|
55097
|
+
const fromEnv = themeModeFromColorFgBg();
|
|
55098
|
+
if (fromEnv) {
|
|
55099
|
+
setThemeMode(fromEnv);
|
|
55100
|
+
return fromEnv;
|
|
55101
|
+
}
|
|
55102
|
+
const fromOsc = await queryTerminalThemeMode();
|
|
55103
|
+
setThemeMode(fromOsc);
|
|
55104
|
+
return fromOsc;
|
|
55105
|
+
}
|
|
55106
|
+
function detectAndSetThemeModeSync() {
|
|
55107
|
+
const mode = themeModeOverride() ?? themeModeFromColorFgBg();
|
|
55108
|
+
if (mode)
|
|
55109
|
+
setThemeMode(mode);
|
|
55110
|
+
return mode ?? detected;
|
|
55111
|
+
}
|
|
55112
|
+
var detected = null, listeners, MID_SRGB_LUMINANCE;
|
|
55113
|
+
var init_theme_mode = __esm(() => {
|
|
55114
|
+
listeners = [];
|
|
55115
|
+
MID_SRGB_LUMINANCE = relativeLuminance(0.5, 0.5, 0.5);
|
|
55116
|
+
});
|
|
55117
|
+
|
|
55118
|
+
// src/theme/ansi.ts
|
|
55119
|
+
function fgHex(hex3) {
|
|
55120
|
+
const r = Number.parseInt(hex3.slice(1, 3), 16);
|
|
55121
|
+
const g = Number.parseInt(hex3.slice(3, 5), 16);
|
|
55122
|
+
const b = Number.parseInt(hex3.slice(5, 7), 16);
|
|
55123
|
+
return `\x1B[38;2;${r};${g};${b}m`;
|
|
55124
|
+
}
|
|
55125
|
+
function bgHex(hex3) {
|
|
55126
|
+
const r = Number.parseInt(hex3.slice(1, 3), 16);
|
|
55127
|
+
const g = Number.parseInt(hex3.slice(3, 5), 16);
|
|
55128
|
+
const b = Number.parseInt(hex3.slice(5, 7), 16);
|
|
55129
|
+
return `\x1B[48;2;${r};${g};${b}m`;
|
|
55130
|
+
}
|
|
55131
|
+
function cliAnsi() {
|
|
55132
|
+
if (process.env.NO_COLOR)
|
|
55133
|
+
return NONE;
|
|
55134
|
+
return getThemeMode() === "light" ? LIGHT : CLASSIC;
|
|
55135
|
+
}
|
|
55136
|
+
var CLASSIC, LIGHT, NONE;
|
|
55137
|
+
var init_ansi = __esm(() => {
|
|
55138
|
+
init_theme_mode();
|
|
55139
|
+
CLASSIC = {
|
|
55140
|
+
RESET: "\x1B[0m",
|
|
55141
|
+
BOLD: "\x1B[1m",
|
|
55142
|
+
DIM: "\x1B[2m",
|
|
55143
|
+
ITALIC: "\x1B[3m",
|
|
55144
|
+
GREEN: "\x1B[32m",
|
|
55145
|
+
BRIGHT_GREEN: "\x1B[92m",
|
|
55146
|
+
RED: "\x1B[31m",
|
|
55147
|
+
YELLOW: "\x1B[33m",
|
|
55148
|
+
CYAN: "\x1B[36m",
|
|
55149
|
+
BLUE: "\x1B[34m",
|
|
55150
|
+
MAGENTA: "\x1B[35m",
|
|
55151
|
+
GRAY: "\x1B[90m",
|
|
55152
|
+
STRONG: "\x1B[37m"
|
|
55153
|
+
};
|
|
55154
|
+
LIGHT = {
|
|
55155
|
+
RESET: "\x1B[0m",
|
|
55156
|
+
BOLD: "\x1B[1m",
|
|
55157
|
+
DIM: "\x1B[2m",
|
|
55158
|
+
ITALIC: "\x1B[3m",
|
|
55159
|
+
GREEN: fgHex("#15803d"),
|
|
55160
|
+
BRIGHT_GREEN: fgHex("#166534"),
|
|
55161
|
+
RED: fgHex("#dc2626"),
|
|
55162
|
+
YELLOW: fgHex("#a16207"),
|
|
55163
|
+
CYAN: fgHex("#0e7490"),
|
|
55164
|
+
BLUE: fgHex("#1d4ed8"),
|
|
55165
|
+
MAGENTA: fgHex("#9333ea"),
|
|
55166
|
+
GRAY: fgHex("#6b7280"),
|
|
55167
|
+
STRONG: fgHex("#111827")
|
|
55168
|
+
};
|
|
55169
|
+
NONE = {
|
|
55170
|
+
RESET: "",
|
|
55171
|
+
BOLD: "",
|
|
55172
|
+
DIM: "",
|
|
55173
|
+
ITALIC: "",
|
|
55174
|
+
GREEN: "",
|
|
55175
|
+
BRIGHT_GREEN: "",
|
|
55176
|
+
RED: "",
|
|
55177
|
+
YELLOW: "",
|
|
55178
|
+
CYAN: "",
|
|
55179
|
+
BLUE: "",
|
|
55180
|
+
MAGENTA: "",
|
|
55181
|
+
GRAY: "",
|
|
55182
|
+
STRONG: ""
|
|
55183
|
+
};
|
|
55184
|
+
});
|
|
55185
|
+
|
|
54915
55186
|
// src/behavior-command.ts
|
|
54916
55187
|
var exports_behavior_command = {};
|
|
54917
55188
|
__export(exports_behavior_command, {
|
|
@@ -55097,10 +55368,23 @@ Usage:
|
|
|
55097
55368
|
process.exit(1);
|
|
55098
55369
|
}
|
|
55099
55370
|
}
|
|
55100
|
-
var green = (s) =>
|
|
55371
|
+
var green = (s) => {
|
|
55372
|
+
const a = cliAnsi();
|
|
55373
|
+
return `${a.GREEN}${s}${a.RESET}`;
|
|
55374
|
+
}, yellow = (s) => {
|
|
55375
|
+
const a = cliAnsi();
|
|
55376
|
+
return `${a.YELLOW}${s}${a.RESET}`;
|
|
55377
|
+
}, dim2 = (s) => {
|
|
55378
|
+
const a = cliAnsi();
|
|
55379
|
+
return `${a.DIM}${s}${a.RESET}`;
|
|
55380
|
+
}, bold2 = (s) => {
|
|
55381
|
+
const a = cliAnsi();
|
|
55382
|
+
return `${a.BOLD}${s}${a.RESET}`;
|
|
55383
|
+
};
|
|
55101
55384
|
var init_behavior_command = __esm(() => {
|
|
55102
55385
|
init_behavior();
|
|
55103
55386
|
init_profile_config();
|
|
55387
|
+
init_ansi();
|
|
55104
55388
|
});
|
|
55105
55389
|
|
|
55106
55390
|
// src/team-grid.ts
|
|
@@ -55591,7 +55875,7 @@ __export(exports_providers, {
|
|
|
55591
55875
|
providerAuthSource: () => providerAuthSource,
|
|
55592
55876
|
providerAuthCapabilities: () => providerAuthCapabilities,
|
|
55593
55877
|
maskKey: () => maskKey2,
|
|
55594
|
-
|
|
55878
|
+
getProviderDefs: () => getProviderDefs
|
|
55595
55879
|
});
|
|
55596
55880
|
function toProviderDef(def) {
|
|
55597
55881
|
return {
|
|
@@ -55631,6 +55915,9 @@ function providerAuthCapabilities(p, config3) {
|
|
|
55631
55915
|
oauth: { supported: oauthSupported, set: oauthSet }
|
|
55632
55916
|
};
|
|
55633
55917
|
}
|
|
55918
|
+
function getProviderDefs() {
|
|
55919
|
+
return getAllProviders().filter((d) => !SKIP.has(d.name)).map(toProviderDef);
|
|
55920
|
+
}
|
|
55634
55921
|
function maskKey2(key) {
|
|
55635
55922
|
if (!key)
|
|
55636
55923
|
return "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500";
|
|
@@ -55638,7 +55925,7 @@ function maskKey2(key) {
|
|
|
55638
55925
|
return "**** ";
|
|
55639
55926
|
return `${key.slice(0, 3)}\u2022\u2022${key.slice(-3)}`;
|
|
55640
55927
|
}
|
|
55641
|
-
var SKIP
|
|
55928
|
+
var SKIP;
|
|
55642
55929
|
var init_providers = __esm(() => {
|
|
55643
55930
|
init_antigravity_token();
|
|
55644
55931
|
init_source();
|
|
@@ -55646,7 +55933,6 @@ var init_providers = __esm(() => {
|
|
|
55646
55933
|
init_devin_credentials();
|
|
55647
55934
|
init_provider_definitions();
|
|
55648
55935
|
SKIP = new Set(["qwen", "native-anthropic"]);
|
|
55649
|
-
PROVIDERS = getAllProviders().filter((d) => !SKIP.has(d.name)).map(toProviderDef);
|
|
55650
55936
|
});
|
|
55651
55937
|
|
|
55652
55938
|
// src/providers-command.ts
|
|
@@ -55656,7 +55942,8 @@ __export(exports_providers_command, {
|
|
|
55656
55942
|
collectProviderStatuses: () => collectProviderStatuses
|
|
55657
55943
|
});
|
|
55658
55944
|
async function collectProviderStatuses(config3 = loadConfig()) {
|
|
55659
|
-
|
|
55945
|
+
ensureEndpointsRegistered();
|
|
55946
|
+
return Promise.all(getProviderDefs().map(async (p) => {
|
|
55660
55947
|
const authSource = await describeSource(p, config3);
|
|
55661
55948
|
return {
|
|
55662
55949
|
slug: p.catalogName,
|
|
@@ -55680,6 +55967,7 @@ async function providersCommand(opts) {
|
|
|
55680
55967
|
var init_providers_command = __esm(() => {
|
|
55681
55968
|
init_source();
|
|
55682
55969
|
init_profile_config();
|
|
55970
|
+
init_endpoint_registration();
|
|
55683
55971
|
init_providers();
|
|
55684
55972
|
});
|
|
55685
55973
|
|
|
@@ -57088,13 +57376,13 @@ var init_mjs = __esm(() => {
|
|
|
57088
57376
|
this.#sigListeners = {};
|
|
57089
57377
|
for (const sig of signals) {
|
|
57090
57378
|
this.#sigListeners[sig] = () => {
|
|
57091
|
-
const
|
|
57379
|
+
const listeners2 = this.#process.listeners(sig);
|
|
57092
57380
|
let { count } = this.#emitter;
|
|
57093
57381
|
const p = process4;
|
|
57094
57382
|
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
|
|
57095
57383
|
count += p.__signal_exit_emitter__.count;
|
|
57096
57384
|
}
|
|
57097
|
-
if (
|
|
57385
|
+
if (listeners2.length === count) {
|
|
57098
57386
|
this.unload();
|
|
57099
57387
|
const ret = this.#emitter.emit("exit", null, sig);
|
|
57100
57388
|
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
@@ -68316,7 +68604,21 @@ __export(exports_quota_command, {
|
|
|
68316
68604
|
formatRelativeReset: () => formatRelativeReset,
|
|
68317
68605
|
buildUsageBar: () => buildUsageBar
|
|
68318
68606
|
});
|
|
68607
|
+
function refreshAnsi() {
|
|
68608
|
+
const a = cliAnsi();
|
|
68609
|
+
R = a.RESET;
|
|
68610
|
+
B = a.BOLD;
|
|
68611
|
+
D = a.DIM;
|
|
68612
|
+
I = a.ITALIC;
|
|
68613
|
+
RED = a.RED;
|
|
68614
|
+
GRN = a.GREEN;
|
|
68615
|
+
YEL = a.YELLOW;
|
|
68616
|
+
CYN = a.CYAN;
|
|
68617
|
+
WHT = a.STRONG;
|
|
68618
|
+
GRY = a.GRAY;
|
|
68619
|
+
}
|
|
68319
68620
|
async function quotaCommand(provider) {
|
|
68621
|
+
refreshAnsi();
|
|
68320
68622
|
const adapter = provider ? resolveAdapterFromInput(provider) : await promptForAdapter();
|
|
68321
68623
|
if (!adapter) {
|
|
68322
68624
|
printUnknownProvider(provider ?? "");
|
|
@@ -68457,6 +68759,7 @@ function colorFor(usedPct) {
|
|
|
68457
68759
|
return usedPct < 50 ? GRN : usedPct < 80 ? YEL : RED;
|
|
68458
68760
|
}
|
|
68459
68761
|
function buildUsageBar(usedFraction, color, width = 24) {
|
|
68762
|
+
refreshAnsi();
|
|
68460
68763
|
const clamped = Math.max(0, Math.min(1, usedFraction));
|
|
68461
68764
|
const usedCols = clamped >= 1 ? width : Math.max(clamped > 0.005 ? 1 : 0, Math.round(clamped * width));
|
|
68462
68765
|
const freeCols = width - usedCols;
|
|
@@ -68480,9 +68783,10 @@ function formatRelativeReset(resetTime) {
|
|
|
68480
68783
|
return `resets ${hours}h`;
|
|
68481
68784
|
return `resets ${minutes}m`;
|
|
68482
68785
|
}
|
|
68483
|
-
var R = "
|
|
68786
|
+
var R = "", B = "", D = "", I = "", RED = "", GRN = "", YEL = "", CYN = "", WHT = "", GRY = "", W = 58, FRIENDLY_NAMES;
|
|
68484
68787
|
var init_quota_command = __esm(() => {
|
|
68485
68788
|
init_provider_definitions();
|
|
68789
|
+
init_ansi();
|
|
68486
68790
|
init_registry();
|
|
68487
68791
|
FRIENDLY_NAMES = {
|
|
68488
68792
|
gpt: "openai-codex",
|
|
@@ -69614,11 +69918,11 @@ var init_model_selector = __esm(() => {
|
|
|
69614
69918
|
import { createTextAttributes } from "@opentui/core";
|
|
69615
69919
|
function latencyBucket(ms) {
|
|
69616
69920
|
const v = Math.max(0, ms);
|
|
69617
|
-
for (const b of
|
|
69921
|
+
for (const b of activeLatencyBuckets) {
|
|
69618
69922
|
if (v < b.maxMs)
|
|
69619
69923
|
return b;
|
|
69620
69924
|
}
|
|
69621
|
-
return
|
|
69925
|
+
return activeLatencyBuckets[activeLatencyBuckets.length - 1];
|
|
69622
69926
|
}
|
|
69623
69927
|
function formatLatency(ms) {
|
|
69624
69928
|
if (ms < 1000)
|
|
@@ -69647,6 +69951,24 @@ function hexToAnsiFg(hex3) {
|
|
|
69647
69951
|
const b = Number.parseInt(hex3.slice(5, 7), 16);
|
|
69648
69952
|
return `\x1B[38;2;${r};${g};${b}m`;
|
|
69649
69953
|
}
|
|
69954
|
+
function registerPaletteRefresher(fn) {
|
|
69955
|
+
paletteRefreshers.push(fn);
|
|
69956
|
+
fn();
|
|
69957
|
+
}
|
|
69958
|
+
function applyTuiTheme(mode) {
|
|
69959
|
+
const palette = mode === "light" ? LIGHT2 : DARK;
|
|
69960
|
+
activeLatencyBuckets = mode === "light" ? LATENCY_BUCKETS_LIGHT : LATENCY_BUCKETS_DARK;
|
|
69961
|
+
Object.assign(C, palette);
|
|
69962
|
+
Object.assign(STAGE_BG, mode === "light" ? STAGE_BG_LIGHT : STAGE_BG_DARK);
|
|
69963
|
+
STAGE_BG_ANSI.network = hexToAnsiBg(STAGE_BG.network);
|
|
69964
|
+
STAGE_BG_ANSI.server = hexToAnsiBg(STAGE_BG.server);
|
|
69965
|
+
STAGE_BG_ANSI.streaming = hexToAnsiBg(STAGE_BG.streaming);
|
|
69966
|
+
STAGE_FG.network = C.cyan;
|
|
69967
|
+
STAGE_FG.server = C.blue;
|
|
69968
|
+
STAGE_FG.streaming = C.yellow;
|
|
69969
|
+
for (const fn of paletteRefreshers)
|
|
69970
|
+
fn();
|
|
69971
|
+
}
|
|
69650
69972
|
function throughputFg(tokensPerSec) {
|
|
69651
69973
|
if (tokensPerSec >= 100)
|
|
69652
69974
|
return C.brightGreen;
|
|
@@ -69713,9 +70035,10 @@ function tokBarCells(tokensPerSec, maxTokPerSec, tokWidth) {
|
|
|
69713
70035
|
const raw2 = Math.round(tokWidth * Math.max(0, tokensPerSec) / denom);
|
|
69714
70036
|
return Math.min(tokWidth, Math.max(0, raw2));
|
|
69715
70037
|
}
|
|
69716
|
-
var C, bold3, A,
|
|
70038
|
+
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
70039
|
var init_theme2 = __esm(() => {
|
|
69718
|
-
|
|
70040
|
+
init_theme_mode();
|
|
70041
|
+
DARK = {
|
|
69719
70042
|
bg: "#000000",
|
|
69720
70043
|
bgAlt: "#111111",
|
|
69721
70044
|
bgHighlight: "#1e3a5f",
|
|
@@ -69735,6 +70058,8 @@ var init_theme2 = __esm(() => {
|
|
|
69735
70058
|
orange: "#ff8800",
|
|
69736
70059
|
white: "#ffffff",
|
|
69737
70060
|
black: "#000000",
|
|
70061
|
+
ink: "#ffffff",
|
|
70062
|
+
strong: "#ffffff",
|
|
69738
70063
|
tabActiveBg: "#0088ff",
|
|
69739
70064
|
tabInactiveBg: "#001a33",
|
|
69740
70065
|
tabActiveFg: "#ffffff",
|
|
@@ -69744,23 +70069,71 @@ var init_theme2 = __esm(() => {
|
|
|
69744
70069
|
chipKeyBg: "#3a3a3a",
|
|
69745
70070
|
chipLabelBg: "#222222"
|
|
69746
70071
|
};
|
|
70072
|
+
LIGHT2 = {
|
|
70073
|
+
bg: "#ffffff",
|
|
70074
|
+
bgAlt: "#f3f4f6",
|
|
70075
|
+
bgHighlight: "#bfdbfe",
|
|
70076
|
+
bgError: "#fee2e2",
|
|
70077
|
+
fg: "#1f2937",
|
|
70078
|
+
fgMuted: "#4b5563",
|
|
70079
|
+
dim: "#6b7280",
|
|
70080
|
+
border: "#d1d5db",
|
|
70081
|
+
focusBorder: "#2563eb",
|
|
70082
|
+
green: "#15803d",
|
|
70083
|
+
brightGreen: "#166534",
|
|
70084
|
+
red: "#dc2626",
|
|
70085
|
+
yellow: "#a16207",
|
|
70086
|
+
cyan: "#0e7490",
|
|
70087
|
+
blue: "#1d4ed8",
|
|
70088
|
+
magenta: "#9333ea",
|
|
70089
|
+
orange: "#c2410c",
|
|
70090
|
+
white: "#ffffff",
|
|
70091
|
+
black: "#000000",
|
|
70092
|
+
ink: "#ffffff",
|
|
70093
|
+
strong: "#111827",
|
|
70094
|
+
tabActiveBg: "#2563eb",
|
|
70095
|
+
tabInactiveBg: "#e5e7eb",
|
|
70096
|
+
tabActiveFg: "#ffffff",
|
|
70097
|
+
tabInactiveFg: "#374151",
|
|
70098
|
+
pillKeyBg: "#2d6e3e",
|
|
70099
|
+
pillOauthBg: "#1f6d75",
|
|
70100
|
+
chipKeyBg: "#d1d5db",
|
|
70101
|
+
chipLabelBg: "#e5e7eb"
|
|
70102
|
+
};
|
|
70103
|
+
C = { ...DARK };
|
|
69747
70104
|
bold3 = createTextAttributes({ bold: true });
|
|
69748
70105
|
A = {
|
|
69749
70106
|
bold: bold3,
|
|
69750
70107
|
boldIf: (enabled2) => enabled2 ? bold3 : undefined
|
|
69751
70108
|
};
|
|
69752
|
-
|
|
70109
|
+
LATENCY_BUCKETS_DARK = [
|
|
69753
70110
|
{ maxMs: 500, hex: "#1f8f3b" },
|
|
69754
70111
|
{ maxMs: 1000, hex: "#2d6e3e" },
|
|
69755
70112
|
{ maxMs: 3000, hex: "#8a7d1e" },
|
|
69756
70113
|
{ maxMs: 6000, hex: "#b5651d" },
|
|
69757
70114
|
{ maxMs: Number.POSITIVE_INFINITY, hex: "#9e2b2b" }
|
|
69758
70115
|
];
|
|
69759
|
-
|
|
70116
|
+
LATENCY_BUCKETS_LIGHT = [
|
|
70117
|
+
{ maxMs: 500, hex: "#1d8738" },
|
|
70118
|
+
{ maxMs: 1000, hex: "#2d6e3e" },
|
|
70119
|
+
{ maxMs: 3000, hex: "#83771c" },
|
|
70120
|
+
{ maxMs: 6000, hex: "#b0621c" },
|
|
70121
|
+
{ maxMs: Number.POSITIVE_INFINITY, hex: "#9e2b2b" }
|
|
70122
|
+
];
|
|
70123
|
+
activeLatencyBuckets = LATENCY_BUCKETS_DARK;
|
|
70124
|
+
STAGE_BG_DARK = {
|
|
69760
70125
|
network: "#00b3c4",
|
|
69761
70126
|
server: "#2563ff",
|
|
69762
70127
|
streaming: "#ffcc00"
|
|
69763
70128
|
};
|
|
70129
|
+
STAGE_BG_LIGHT = {
|
|
70130
|
+
network: "#0891b2",
|
|
70131
|
+
server: "#2563eb",
|
|
70132
|
+
streaming: "#d97706"
|
|
70133
|
+
};
|
|
70134
|
+
STAGE_BG = {
|
|
70135
|
+
...STAGE_BG_DARK
|
|
70136
|
+
};
|
|
69764
70137
|
STAGE_FG = {
|
|
69765
70138
|
network: C.cyan,
|
|
69766
70139
|
server: C.blue,
|
|
@@ -69771,9 +70144,32 @@ var init_theme2 = __esm(() => {
|
|
|
69771
70144
|
server: hexToAnsiBg(STAGE_BG.server),
|
|
69772
70145
|
streaming: hexToAnsiBg(STAGE_BG.streaming)
|
|
69773
70146
|
};
|
|
70147
|
+
paletteRefreshers = [];
|
|
70148
|
+
onThemeModeChange(applyTuiTheme);
|
|
69774
70149
|
});
|
|
69775
70150
|
|
|
69776
70151
|
// src/probe/probe-results-printer.ts
|
|
70152
|
+
function buildPrinterColors() {
|
|
70153
|
+
const a = cliAnsi();
|
|
70154
|
+
const light = getThemeMode() === "light";
|
|
70155
|
+
const noColor = !!process.env.NO_COLOR;
|
|
70156
|
+
return {
|
|
70157
|
+
reset: a.RESET,
|
|
70158
|
+
bold: a.BOLD,
|
|
70159
|
+
dim: a.DIM,
|
|
70160
|
+
green: a.GREEN,
|
|
70161
|
+
red: a.RED,
|
|
70162
|
+
yellow: a.YELLOW,
|
|
70163
|
+
cyan: a.CYAN,
|
|
70164
|
+
brightGreen: a.BRIGHT_GREEN,
|
|
70165
|
+
gray: a.GRAY,
|
|
70166
|
+
bgFastest: noColor ? "" : light ? bgHex("#bbf7d0") : "\x1B[48;5;22m",
|
|
70167
|
+
bgSlowest: noColor ? "" : light ? bgHex("#fecaca") : "\x1B[48;5;95m"
|
|
70168
|
+
};
|
|
70169
|
+
}
|
|
70170
|
+
function refreshPc() {
|
|
70171
|
+
pc = buildPrinterColors();
|
|
70172
|
+
}
|
|
69777
70173
|
function stripAnsi2(s) {
|
|
69778
70174
|
return s.replace(ANSI_RE2, "");
|
|
69779
70175
|
}
|
|
@@ -70186,6 +70582,7 @@ function buildCardLayout(result, isLiveProbe, directKeyVar) {
|
|
|
70186
70582
|
};
|
|
70187
70583
|
}
|
|
70188
70584
|
function computeRequiredWidth(result, isLiveProbe, directKeyVar) {
|
|
70585
|
+
refreshPc();
|
|
70189
70586
|
const layout = buildCardLayout(result, isLiveProbe, directKeyVar);
|
|
70190
70587
|
return computeCardWidth(layout.rows, layout.widths, visibleLength(layout.titleStyled), visibleLength(layout.summaryStyled), layout.footerVis);
|
|
70191
70588
|
}
|
|
@@ -70401,6 +70798,7 @@ function renderLeaderboard(results, scales, maxWidth, w) {
|
|
|
70401
70798
|
`);
|
|
70402
70799
|
}
|
|
70403
70800
|
function printProbeResults(results, isLiveProbe) {
|
|
70801
|
+
refreshPc();
|
|
70404
70802
|
const w = process.stderr.write.bind(process.stderr);
|
|
70405
70803
|
w(`
|
|
70406
70804
|
`);
|
|
@@ -70437,26 +70835,30 @@ function printProbeResults(results, isLiveProbe) {
|
|
|
70437
70835
|
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
70836
|
var init_probe_results_printer = __esm(() => {
|
|
70439
70837
|
init_probe_live();
|
|
70838
|
+
init_ansi();
|
|
70839
|
+
init_theme_mode();
|
|
70440
70840
|
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
70841
|
ANSI_RE2 = /\x1b\[[0-9;]*[A-Za-z]/g;
|
|
70455
70842
|
PRINTER_BARS_FULL_WIDTH = 24 + 2 + 7 + 34 + 17 + 9;
|
|
70456
70843
|
PRINTER_BARS_NOTOK_WIDTH = 24 + 2 + 7 + 34 + 2 + 9;
|
|
70457
70844
|
PRINTER_BARS_MIN_WIDTH = 24 + 2 + 7 + 2 + 9;
|
|
70458
70845
|
});
|
|
70459
70846
|
|
|
70847
|
+
// src/theme/renderer-theme.ts
|
|
70848
|
+
async function applyRendererThemeMode(renderer) {
|
|
70849
|
+
const override = themeModeOverride();
|
|
70850
|
+
if (override) {
|
|
70851
|
+
setThemeMode(override);
|
|
70852
|
+
return;
|
|
70853
|
+
}
|
|
70854
|
+
const mode = await renderer.waitForThemeMode(THEME_MODE_WAIT_MS).catch(() => null);
|
|
70855
|
+
setThemeMode(mode ?? getThemeMode());
|
|
70856
|
+
}
|
|
70857
|
+
var THEME_MODE_WAIT_MS = 250;
|
|
70858
|
+
var init_renderer_theme = __esm(() => {
|
|
70859
|
+
init_theme_mode();
|
|
70860
|
+
});
|
|
70861
|
+
|
|
70460
70862
|
// src/probe/probe-tui-app.tsx
|
|
70461
70863
|
import { useKeyboard, useTerminalDimensions } from "@opentui/react";
|
|
70462
70864
|
import { useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
|
|
@@ -70573,6 +70975,9 @@ function padEndSafe(s, n) {
|
|
|
70573
70975
|
function stripAnsi3(text) {
|
|
70574
70976
|
return text.replace(/\x1b\[[0-9;]*[A-Za-z]/g, "");
|
|
70575
70977
|
}
|
|
70978
|
+
function ishGreen() {
|
|
70979
|
+
return getThemeMode() === "light" ? "#047857" : "#00ff7f";
|
|
70980
|
+
}
|
|
70576
70981
|
function Banner() {
|
|
70577
70982
|
const claudLines = [
|
|
70578
70983
|
" \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 +70989,6 @@ function Banner() {
|
|
|
70584
70989
|
];
|
|
70585
70990
|
const ishLines = [" _ _ ", " (_)__| |_ ", " | (_-< ' \\ ", " |_/__/_||_|"];
|
|
70586
70991
|
const ishPad = " ";
|
|
70587
|
-
const ishGreen = "#00ff7f";
|
|
70588
70992
|
const renderBannerRow = (claudLine, ishLine, key) => /* @__PURE__ */ jsxDEV("box", {
|
|
70589
70993
|
flexDirection: "row",
|
|
70590
70994
|
children: [
|
|
@@ -70601,7 +71005,7 @@ function Banner() {
|
|
|
70601
71005
|
}, undefined, false, undefined, this),
|
|
70602
71006
|
/* @__PURE__ */ jsxDEV("text", {
|
|
70603
71007
|
children: /* @__PURE__ */ jsxDEV("span", {
|
|
70604
|
-
fg: ishGreen,
|
|
71008
|
+
fg: ishGreen(),
|
|
70605
71009
|
attributes: A.bold,
|
|
70606
71010
|
children: ishLine
|
|
70607
71011
|
}, undefined, false, undefined, this)
|
|
@@ -70742,7 +71146,7 @@ function ProgressBar({
|
|
|
70742
71146
|
children: " "
|
|
70743
71147
|
}, undefined, false, undefined, this),
|
|
70744
71148
|
/* @__PURE__ */ jsxDEV("span", {
|
|
70745
|
-
fg: C.
|
|
71149
|
+
fg: C.strong,
|
|
70746
71150
|
children: padStartSafe2(formatLatency(t.totalMs), TOTAL_COL)
|
|
70747
71151
|
}, undefined, false, undefined, this),
|
|
70748
71152
|
layout.showBreakdown && /* @__PURE__ */ jsxDEV(Fragment, {
|
|
@@ -70886,10 +71290,10 @@ function ModelGroup({
|
|
|
70886
71290
|
children: " "
|
|
70887
71291
|
}, undefined, false, undefined, this),
|
|
70888
71292
|
/* @__PURE__ */ jsxDEV("box", {
|
|
70889
|
-
backgroundColor:
|
|
71293
|
+
backgroundColor: C.bgHighlight,
|
|
70890
71294
|
children: /* @__PURE__ */ jsxDEV("text", {
|
|
70891
71295
|
children: /* @__PURE__ */ jsxDEV("span", {
|
|
70892
|
-
fg:
|
|
71296
|
+
fg: C.strong,
|
|
70893
71297
|
attributes: A.bold,
|
|
70894
71298
|
children: headerText
|
|
70895
71299
|
}, undefined, false, undefined, this)
|
|
@@ -71108,7 +71512,7 @@ function DetailLinkRow({
|
|
|
71108
71512
|
children: " "
|
|
71109
71513
|
}, undefined, false, undefined, this),
|
|
71110
71514
|
/* @__PURE__ */ jsxDEV("span", {
|
|
71111
|
-
fg: C.
|
|
71515
|
+
fg: C.strong,
|
|
71112
71516
|
children: padStartSafe2(formatLatency(t.totalMs), TOTAL_COL)
|
|
71113
71517
|
}, undefined, false, undefined, this),
|
|
71114
71518
|
layout.showBreakdown && /* @__PURE__ */ jsxDEV(Fragment, {
|
|
@@ -71416,7 +71820,7 @@ function LeaderLiveRow({
|
|
|
71416
71820
|
children: [
|
|
71417
71821
|
lead,
|
|
71418
71822
|
/* @__PURE__ */ jsxDEV("span", {
|
|
71419
|
-
fg: C.
|
|
71823
|
+
fg: C.strong,
|
|
71420
71824
|
children: padStartSafe2(formatLatency(t.totalMs), TOTAL_COL)
|
|
71421
71825
|
}, undefined, false, undefined, this)
|
|
71422
71826
|
]
|
|
@@ -71446,7 +71850,7 @@ function LeaderLiveRow({
|
|
|
71446
71850
|
children: " "
|
|
71447
71851
|
}, undefined, false, undefined, this),
|
|
71448
71852
|
/* @__PURE__ */ jsxDEV("span", {
|
|
71449
|
-
fg: C.
|
|
71853
|
+
fg: C.strong,
|
|
71450
71854
|
children: padStartSafe2(formatLatency(t.totalMs), TOTAL_COL)
|
|
71451
71855
|
}, undefined, false, undefined, this),
|
|
71452
71856
|
layout.showBreakdown && /* @__PURE__ */ jsxDEV(Fragment, {
|
|
@@ -71800,6 +72204,7 @@ function ProbeApp({
|
|
|
71800
72204
|
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
72205
|
var init_probe_tui_app = __esm(() => {
|
|
71802
72206
|
init_probe_live();
|
|
72207
|
+
init_theme_mode();
|
|
71803
72208
|
init_theme2();
|
|
71804
72209
|
ANIM_FRAMES = ["\u2593", "\u2592", "\u2591", "\u2592"];
|
|
71805
72210
|
BREAKDOWN_COL = 16 + 3 * STAGE_NUM_W2;
|
|
@@ -71812,10 +72217,11 @@ import { jsxDEV as jsxDEV2 } from "@opentui/react/jsx-dev-runtime";
|
|
|
71812
72217
|
async function startProbeTui(initial) {
|
|
71813
72218
|
const renderer = await createCliRenderer({
|
|
71814
72219
|
stdout: process.stderr,
|
|
71815
|
-
|
|
72220
|
+
screenMode: "main-screen",
|
|
71816
72221
|
useMouse: true,
|
|
71817
72222
|
exitOnCtrlC: true
|
|
71818
72223
|
});
|
|
72224
|
+
await applyRendererThemeMode(renderer);
|
|
71819
72225
|
const store = new ProbeStore(initial);
|
|
71820
72226
|
let resolveQuit;
|
|
71821
72227
|
const quitPromise = new Promise((resolve5) => {
|
|
@@ -71848,6 +72254,7 @@ async function startProbeTui(initial) {
|
|
|
71848
72254
|
return { store, waitForQuit: () => quitPromise, shutdown };
|
|
71849
72255
|
}
|
|
71850
72256
|
var init_probe_tui_runtime = __esm(() => {
|
|
72257
|
+
init_renderer_theme();
|
|
71851
72258
|
init_probe_tui_app();
|
|
71852
72259
|
});
|
|
71853
72260
|
|
|
@@ -72916,9 +73323,7 @@ async function probeModelRouting(models, jsonOutput, options = { live: true, tim
|
|
|
72916
73323
|
};
|
|
72917
73324
|
}
|
|
72918
73325
|
if (jsonOutput) {
|
|
72919
|
-
const DIM =
|
|
72920
|
-
const YELLOW = "\x1B[33m";
|
|
72921
|
-
const RESET = "\x1B[0m";
|
|
73326
|
+
const { DIM, YELLOW, RESET } = cliAnsi();
|
|
72922
73327
|
let liveProxy2 = null;
|
|
72923
73328
|
if (options.live) {
|
|
72924
73329
|
try {
|
|
@@ -73192,14 +73597,15 @@ async function probeModelRouting(models, jsonOutput, options = { live: true, tim
|
|
|
73192
73597
|
}
|
|
73193
73598
|
function printHelp2() {
|
|
73194
73599
|
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
|
|
73600
|
+
const A2 = cliAnsi();
|
|
73601
|
+
const c = (esc2) => (s) => useColor && esc2 ? `${esc2}${s}${A2.RESET}` : s;
|
|
73602
|
+
const bold4 = c(A2.BOLD);
|
|
73603
|
+
const dim3 = c(A2.DIM);
|
|
73604
|
+
const cyan = c(A2.CYAN);
|
|
73605
|
+
const green2 = c(A2.GREEN);
|
|
73606
|
+
const yellow2 = c(A2.YELLOW);
|
|
73607
|
+
const magenta = c(A2.MAGENTA);
|
|
73608
|
+
const blue = c(A2.BLUE);
|
|
73203
73609
|
const h = (title) => bold4(cyan(`\u258C ${title}`));
|
|
73204
73610
|
console.log(`
|
|
73205
73611
|
${bold4("claudish")} ${dim3("\xB7")} Run Claude Code with any AI model
|
|
@@ -73613,6 +74019,7 @@ var init_cli = __esm(() => {
|
|
|
73613
74019
|
init_probe_runner();
|
|
73614
74020
|
init_provider_definitions();
|
|
73615
74021
|
init_routing_rules();
|
|
74022
|
+
init_ansi();
|
|
73616
74023
|
init_provider_resolver();
|
|
73617
74024
|
__filename3 = fileURLToPath3(import.meta.url);
|
|
73618
74025
|
__dirname3 = dirname11(__filename3);
|
|
@@ -73748,13 +74155,15 @@ async function checkForUpdates(currentVersion, options = {}) {
|
|
|
73748
74155
|
return;
|
|
73749
74156
|
}
|
|
73750
74157
|
if (!quiet) {
|
|
74158
|
+
const { RESET, BOLD, GREEN, CYAN, DIM } = cliAnsi();
|
|
73751
74159
|
console.error("");
|
|
73752
74160
|
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
74161
|
console.error("");
|
|
73754
74162
|
}
|
|
73755
74163
|
}
|
|
73756
|
-
var isWindows, NPM_REGISTRY_URL = "https://registry.npmjs.org/claudish/latest", CACHE_MAX_AGE_MS
|
|
74164
|
+
var isWindows, NPM_REGISTRY_URL = "https://registry.npmjs.org/claudish/latest", CACHE_MAX_AGE_MS;
|
|
73757
74165
|
var init_update_checker = __esm(() => {
|
|
74166
|
+
init_ansi();
|
|
73758
74167
|
isWindows = platform2() === "win32";
|
|
73759
74168
|
CACHE_MAX_AGE_MS = 24 * 60 * 60 * 1000;
|
|
73760
74169
|
});
|
|
@@ -73765,6 +74174,9 @@ __export(exports_update_command, {
|
|
|
73765
74174
|
updateCommand: () => updateCommand
|
|
73766
74175
|
});
|
|
73767
74176
|
import { execSync as execSync2 } from "child_process";
|
|
74177
|
+
function refreshAnsi2() {
|
|
74178
|
+
({ RESET, BOLD, GREEN, YELLOW, CYAN, RED: RED2, MAGENTA, DIM } = cliAnsi());
|
|
74179
|
+
}
|
|
73768
74180
|
function detectInstallationMethod() {
|
|
73769
74181
|
const scriptPath = process.argv[1] || "";
|
|
73770
74182
|
if (scriptPath.includes("/opt/homebrew/") || scriptPath.includes("/usr/local/Cellar/")) {
|
|
@@ -73799,8 +74211,8 @@ async function executeUpdate(command) {
|
|
|
73799
74211
|
return true;
|
|
73800
74212
|
} catch {
|
|
73801
74213
|
console.error(`
|
|
73802
|
-
${RED2}\u2717${
|
|
73803
|
-
console.error(`${YELLOW}Try manually:${
|
|
74214
|
+
${RED2}\u2717${RESET} ${BOLD}Update failed.${RESET}`);
|
|
74215
|
+
console.error(`${YELLOW}Try manually:${RESET}`);
|
|
73804
74216
|
console.error(` ${command}
|
|
73805
74217
|
`);
|
|
73806
74218
|
return false;
|
|
@@ -73881,15 +74293,15 @@ async function fetchChangelog(currentVersion, latestVersion) {
|
|
|
73881
74293
|
function itemStyle(type) {
|
|
73882
74294
|
switch (type) {
|
|
73883
74295
|
case "feat":
|
|
73884
|
-
return { symbol: "\u2726", color:
|
|
74296
|
+
return { symbol: "\u2726", color: GREEN };
|
|
73885
74297
|
case "fix":
|
|
73886
74298
|
return { symbol: "\u2726", color: YELLOW };
|
|
73887
74299
|
case "breaking":
|
|
73888
74300
|
return { symbol: "\u2726", color: MAGENTA };
|
|
73889
74301
|
case "perf":
|
|
73890
|
-
return { symbol: "\u2726", color:
|
|
74302
|
+
return { symbol: "\u2726", color: CYAN };
|
|
73891
74303
|
case "chore":
|
|
73892
|
-
return { symbol: "\u25AA", color:
|
|
74304
|
+
return { symbol: "\u25AA", color: DIM };
|
|
73893
74305
|
}
|
|
73894
74306
|
}
|
|
73895
74307
|
function displayChangelog(entries) {
|
|
@@ -73897,34 +74309,34 @@ function displayChangelog(entries) {
|
|
|
73897
74309
|
return;
|
|
73898
74310
|
}
|
|
73899
74311
|
const innerWidth = 50;
|
|
73900
|
-
const headerLabel = ` ${YELLOW}\u2726${
|
|
74312
|
+
const headerLabel = ` ${YELLOW}\u2726${RESET} ${BOLD}What's New${RESET}`;
|
|
73901
74313
|
const headerVisible = 14;
|
|
73902
74314
|
const headerPad = innerWidth - headerVisible;
|
|
73903
74315
|
console.log("");
|
|
73904
|
-
console.log(`${
|
|
73905
|
-
console.log(`${
|
|
73906
|
-
console.log(`${
|
|
74316
|
+
console.log(`${CYAN}\u250C${"\u2500".repeat(innerWidth + 1)}\u2510${RESET}`);
|
|
74317
|
+
console.log(`${CYAN}\u2502${RESET}${headerLabel}${" ".repeat(headerPad)}${CYAN}\u2502${RESET}`);
|
|
74318
|
+
console.log(`${CYAN}\u2514${"\u2500".repeat(innerWidth + 1)}\u2518${RESET}`);
|
|
73907
74319
|
console.log("");
|
|
73908
74320
|
for (const entry of entries) {
|
|
73909
74321
|
const titlePart = entry.title ? ` ${entry.title}` : "";
|
|
73910
|
-
console.log(` ${
|
|
73911
|
-
console.log(` ${
|
|
74322
|
+
console.log(` ${BOLD}${GREEN}v${entry.version}${RESET}${titlePart}`);
|
|
74323
|
+
console.log(` ${DIM}${"\u2500".repeat(30)}${RESET}`);
|
|
73912
74324
|
for (const item of entry.items) {
|
|
73913
74325
|
const { symbol: symbol2, color } = itemStyle(item.type);
|
|
73914
|
-
console.log(` ${color}${symbol2}${
|
|
74326
|
+
console.log(` ${color}${symbol2}${RESET} ${item.text}`);
|
|
73915
74327
|
}
|
|
73916
74328
|
console.log("");
|
|
73917
74329
|
}
|
|
73918
|
-
console.log(`${
|
|
74330
|
+
console.log(`${CYAN}Please restart any running claudish sessions.${RESET}`);
|
|
73919
74331
|
}
|
|
73920
74332
|
function printManualInstructions() {
|
|
73921
74333
|
console.log(`
|
|
73922
|
-
${
|
|
73923
|
-
console.log(`${YELLOW}Please update manually:${
|
|
74334
|
+
${BOLD}Unable to detect installation method.${RESET}`);
|
|
74335
|
+
console.log(`${YELLOW}Please update manually:${RESET}
|
|
73924
74336
|
`);
|
|
73925
|
-
console.log(` ${
|
|
73926
|
-
console.log(` ${
|
|
73927
|
-
console.log(` ${
|
|
74337
|
+
console.log(` ${CYAN}npm:${RESET} npm install -g claudish@latest`);
|
|
74338
|
+
console.log(` ${CYAN}bun:${RESET} bun install -g claudish@latest`);
|
|
74339
|
+
console.log(` ${CYAN}brew:${RESET} brew upgrade claudish
|
|
73928
74340
|
`);
|
|
73929
74341
|
}
|
|
73930
74342
|
function fetchLatestVersionViaNpm() {
|
|
@@ -73953,17 +74365,18 @@ async function resolveLatestVersion() {
|
|
|
73953
74365
|
return { error: fetchError };
|
|
73954
74366
|
}
|
|
73955
74367
|
async function updateCommand() {
|
|
74368
|
+
refreshAnsi2();
|
|
73956
74369
|
const currentVersion = getVersion3();
|
|
73957
74370
|
const installInfo = detectInstallationMethod();
|
|
73958
74371
|
const result = await resolveLatestVersion();
|
|
73959
74372
|
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.${
|
|
74373
|
+
console.error(`${RED2}\u2717${RESET} Unable to fetch latest version from npm registry.`);
|
|
74374
|
+
console.error(`${DIM}Reason: ${result.error}${RESET}`);
|
|
74375
|
+
console.error(`${YELLOW}The npm registry may be slow or unreachable from this network.${RESET}`);
|
|
73963
74376
|
const manualCommand = getUpdateCommand(installInfo.method);
|
|
73964
74377
|
if (manualCommand) {
|
|
73965
|
-
console.error(`${YELLOW}You can update manually:${
|
|
73966
|
-
console.error(` ${
|
|
74378
|
+
console.error(`${YELLOW}You can update manually:${RESET}`);
|
|
74379
|
+
console.error(` ${CYAN}${manualCommand}${RESET}
|
|
73967
74380
|
`);
|
|
73968
74381
|
} else {
|
|
73969
74382
|
printManualInstructions();
|
|
@@ -73973,24 +74386,24 @@ async function updateCommand() {
|
|
|
73973
74386
|
const latestVersion = result.version;
|
|
73974
74387
|
const comparison = compareVersions(latestVersion, currentVersion);
|
|
73975
74388
|
if (comparison <= 0) {
|
|
73976
|
-
console.log(`${
|
|
73977
|
-
console.log(`${
|
|
74389
|
+
console.log(`${GREEN}\u2713${RESET} ${BOLD}Already up-to-date!${RESET}`);
|
|
74390
|
+
console.log(`${CYAN}Current version: ${currentVersion}${RESET}
|
|
73978
74391
|
`);
|
|
73979
74392
|
process.exit(0);
|
|
73980
74393
|
}
|
|
73981
|
-
console.log(` ${
|
|
74394
|
+
console.log(` ${BOLD}claudish${RESET} ${YELLOW}v${currentVersion}${RESET} ${DIM}\u2192${RESET} ${GREEN}v${latestVersion}${RESET} ${DIM}(${installInfo.method})${RESET}`);
|
|
73982
74395
|
if (installInfo.method === "unknown") {
|
|
73983
74396
|
printManualInstructions();
|
|
73984
74397
|
process.exit(1);
|
|
73985
74398
|
}
|
|
73986
74399
|
const command = getUpdateCommand(installInfo.method);
|
|
73987
74400
|
console.log(`
|
|
73988
|
-
${
|
|
74401
|
+
${DIM}Updating...${RESET}
|
|
73989
74402
|
`);
|
|
73990
74403
|
const success2 = await executeUpdate(command);
|
|
73991
74404
|
if (success2) {
|
|
73992
74405
|
console.log(`
|
|
73993
|
-
${
|
|
74406
|
+
${GREEN}\u2713${RESET} ${BOLD}Updated successfully${RESET}`);
|
|
73994
74407
|
clearCache();
|
|
73995
74408
|
const changelog = await fetchChangelog(currentVersion, latestVersion);
|
|
73996
74409
|
displayChangelog(changelog);
|
|
@@ -74000,9 +74413,10 @@ ${DIM2}Updating...${RESET2}
|
|
|
74000
74413
|
process.exit(1);
|
|
74001
74414
|
}
|
|
74002
74415
|
}
|
|
74003
|
-
var
|
|
74416
|
+
var RESET = "", BOLD = "", GREEN = "", YELLOW = "", CYAN = "", RED2 = "", MAGENTA = "", DIM = "", SECTION_TYPE_MAP;
|
|
74004
74417
|
var init_update_command = __esm(() => {
|
|
74005
74418
|
init_cli();
|
|
74419
|
+
init_ansi();
|
|
74006
74420
|
init_update_checker();
|
|
74007
74421
|
SECTION_TYPE_MAP = {
|
|
74008
74422
|
"new features": "feat",
|
|
@@ -74031,6 +74445,9 @@ __export(exports_profile_commands, {
|
|
|
74031
74445
|
profileAddCommand: () => profileAddCommand,
|
|
74032
74446
|
initCommand: () => initCommand
|
|
74033
74447
|
});
|
|
74448
|
+
function refreshAnsi3() {
|
|
74449
|
+
({ RESET: RESET2, BOLD: BOLD2, DIM: DIM2, GREEN: GREEN2, YELLOW: YELLOW2, CYAN: CYAN2, MAGENTA: MAGENTA2 } = cliAnsi());
|
|
74450
|
+
}
|
|
74034
74451
|
function parseScopeFlag(args) {
|
|
74035
74452
|
const remainingArgs = [];
|
|
74036
74453
|
let scope;
|
|
@@ -74067,16 +74484,17 @@ async function resolveScope(scopeFlag) {
|
|
|
74067
74484
|
}
|
|
74068
74485
|
function scopeBadge(scope, shadowed) {
|
|
74069
74486
|
if (scope === "local") {
|
|
74070
|
-
return `${MAGENTA2}[local]${
|
|
74487
|
+
return `${MAGENTA2}[local]${RESET2}`;
|
|
74071
74488
|
}
|
|
74072
74489
|
if (shadowed) {
|
|
74073
|
-
return `${
|
|
74490
|
+
return `${DIM2}[global, shadowed]${RESET2}`;
|
|
74074
74491
|
}
|
|
74075
|
-
return `${
|
|
74492
|
+
return `${DIM2}[global]${RESET2}`;
|
|
74076
74493
|
}
|
|
74077
74494
|
async function initCommand(scopeFlag) {
|
|
74495
|
+
refreshAnsi3();
|
|
74078
74496
|
console.log(`
|
|
74079
|
-
${
|
|
74497
|
+
${BOLD2}${CYAN2}Claudish Setup Wizard${RESET2}
|
|
74080
74498
|
`);
|
|
74081
74499
|
const scope = await resolveScope(scopeFlag);
|
|
74082
74500
|
const configPath = getConfigPathForScope(scope);
|
|
@@ -74090,31 +74508,32 @@ ${BOLD3}${CYAN3}Claudish Setup Wizard${RESET3}
|
|
|
74090
74508
|
return;
|
|
74091
74509
|
}
|
|
74092
74510
|
}
|
|
74093
|
-
console.log(`${
|
|
74511
|
+
console.log(`${DIM2}This wizard will help you set up Claudish with your preferred models.${RESET2}
|
|
74094
74512
|
`);
|
|
74095
74513
|
const profileName = "default";
|
|
74096
|
-
console.log(`${
|
|
74097
|
-
console.log(`${
|
|
74514
|
+
console.log(`${BOLD2}Step 1: Select models for each Claude tier${RESET2}`);
|
|
74515
|
+
console.log(`${DIM2}These models will be used when Claude Code requests specific model types.${RESET2}
|
|
74098
74516
|
`);
|
|
74099
74517
|
const models = await selectModelsForProfile();
|
|
74100
74518
|
const profile = createProfile(profileName, models, undefined, scope);
|
|
74101
74519
|
setDefaultProfile(profileName, scope);
|
|
74102
74520
|
console.log(`
|
|
74103
|
-
${
|
|
74521
|
+
${GREEN2}\u2713${RESET2} Configuration saved to: ${CYAN2}${configPath}${RESET2}`);
|
|
74104
74522
|
console.log(`
|
|
74105
|
-
${
|
|
74523
|
+
${BOLD2}Profile created:${RESET2}`);
|
|
74106
74524
|
printProfile(profile, true, false, scope);
|
|
74107
74525
|
console.log(`
|
|
74108
|
-
${
|
|
74109
|
-
console.log(` ${
|
|
74110
|
-
console.log(` ${
|
|
74526
|
+
${BOLD2}Usage:${RESET2}`);
|
|
74527
|
+
console.log(` ${CYAN2}claudish${RESET2} # Use default profile`);
|
|
74528
|
+
console.log(` ${CYAN2}claudish profile add${RESET2} # Add another profile`);
|
|
74111
74529
|
if (scope === "local") {
|
|
74112
74530
|
console.log(`
|
|
74113
|
-
${
|
|
74531
|
+
${DIM2}Local config applies only when running from this directory.${RESET2}`);
|
|
74114
74532
|
}
|
|
74115
74533
|
console.log("");
|
|
74116
74534
|
}
|
|
74117
74535
|
async function profileListCommand(scopeFilter) {
|
|
74536
|
+
refreshAnsi3();
|
|
74118
74537
|
const allProfiles = listAllProfiles();
|
|
74119
74538
|
const profiles = scopeFilter ? allProfiles.filter((p) => p.scope === scopeFilter) : allProfiles;
|
|
74120
74539
|
if (profiles.length === 0) {
|
|
@@ -74126,11 +74545,11 @@ async function profileListCommand(scopeFilter) {
|
|
|
74126
74545
|
return;
|
|
74127
74546
|
}
|
|
74128
74547
|
console.log(`
|
|
74129
|
-
${
|
|
74548
|
+
${BOLD2}Claudish Profiles${RESET2}
|
|
74130
74549
|
`);
|
|
74131
|
-
console.log(`${
|
|
74550
|
+
console.log(`${DIM2}Global: ${getConfigPath()}${RESET2}`);
|
|
74132
74551
|
if (localConfigExists()) {
|
|
74133
|
-
console.log(`${
|
|
74552
|
+
console.log(`${DIM2}Local: ${getLocalConfigPath()}${RESET2}`);
|
|
74134
74553
|
}
|
|
74135
74554
|
console.log("");
|
|
74136
74555
|
for (const profile of profiles) {
|
|
@@ -74139,20 +74558,21 @@ ${BOLD3}Claudish Profiles${RESET3}
|
|
|
74139
74558
|
}
|
|
74140
74559
|
}
|
|
74141
74560
|
async function profileAddCommand(scopeFlag) {
|
|
74561
|
+
refreshAnsi3();
|
|
74142
74562
|
console.log(`
|
|
74143
|
-
${
|
|
74563
|
+
${BOLD2}${CYAN2}Add New Profile${RESET2}
|
|
74144
74564
|
`);
|
|
74145
74565
|
const scope = await resolveScope(scopeFlag);
|
|
74146
74566
|
const existingNames = getProfileNames(scope);
|
|
74147
74567
|
const name = await promptForProfileName(existingNames);
|
|
74148
74568
|
const description = await promptForProfileDescription();
|
|
74149
74569
|
console.log(`
|
|
74150
|
-
${
|
|
74570
|
+
${BOLD2}Select models for this profile:${RESET2}
|
|
74151
74571
|
`);
|
|
74152
74572
|
const models = await selectModelsForProfile();
|
|
74153
74573
|
const profile = createProfile(name, models, description, scope);
|
|
74154
74574
|
console.log(`
|
|
74155
|
-
${
|
|
74575
|
+
${GREEN2}\u2713${RESET2} Profile "${name}" created ${scopeBadge(scope)}.`);
|
|
74156
74576
|
printProfile(profile, false, false, scope);
|
|
74157
74577
|
const setAsDefault = await dist_default4({
|
|
74158
74578
|
message: `Set this profile as default in ${scope} config?`,
|
|
@@ -74160,10 +74580,11 @@ ${GREEN3}\u2713${RESET3} Profile "${name}" created ${scopeBadge(scope)}.`);
|
|
|
74160
74580
|
});
|
|
74161
74581
|
if (setAsDefault) {
|
|
74162
74582
|
setDefaultProfile(name, scope);
|
|
74163
|
-
console.log(`${
|
|
74583
|
+
console.log(`${GREEN2}\u2713${RESET2} "${name}" is now the default ${scope} profile.`);
|
|
74164
74584
|
}
|
|
74165
74585
|
}
|
|
74166
74586
|
async function profileRemoveCommand(name, scopeFlag) {
|
|
74587
|
+
refreshAnsi3();
|
|
74167
74588
|
let scope = scopeFlag;
|
|
74168
74589
|
let profileName = name;
|
|
74169
74590
|
if (!profileName) {
|
|
@@ -74176,7 +74597,7 @@ async function profileRemoveCommand(name, scopeFlag) {
|
|
|
74176
74597
|
const choice = await dist_default11({
|
|
74177
74598
|
message: "Select a profile to remove:",
|
|
74178
74599
|
choices: selectable.map((p) => ({
|
|
74179
|
-
name: `${p.name} ${scopeBadge(p.scope)}${p.isDefault ? ` ${YELLOW2}(default)${
|
|
74600
|
+
name: `${p.name} ${scopeBadge(p.scope)}${p.isDefault ? ` ${YELLOW2}(default)${RESET2}` : ""}`,
|
|
74180
74601
|
value: `${p.scope}:${p.name}`
|
|
74181
74602
|
}))
|
|
74182
74603
|
});
|
|
@@ -74224,12 +74645,13 @@ async function profileRemoveCommand(name, scopeFlag) {
|
|
|
74224
74645
|
}
|
|
74225
74646
|
try {
|
|
74226
74647
|
deleteProfile(profileName, scope);
|
|
74227
|
-
console.log(`${
|
|
74648
|
+
console.log(`${GREEN2}\u2713${RESET2} Profile "${profileName}" deleted from ${scope} config.`);
|
|
74228
74649
|
} catch (error46) {
|
|
74229
74650
|
console.error(`Error: ${error46}`);
|
|
74230
74651
|
}
|
|
74231
74652
|
}
|
|
74232
74653
|
async function profileUseCommand(name, scopeFlag) {
|
|
74654
|
+
refreshAnsi3();
|
|
74233
74655
|
let scope = scopeFlag;
|
|
74234
74656
|
let profileName = name;
|
|
74235
74657
|
if (!profileName) {
|
|
@@ -74242,7 +74664,7 @@ async function profileUseCommand(name, scopeFlag) {
|
|
|
74242
74664
|
const choice = await dist_default11({
|
|
74243
74665
|
message: "Select a profile to set as default:",
|
|
74244
74666
|
choices: selectable.map((p) => ({
|
|
74245
|
-
name: `${p.name} ${scopeBadge(p.scope)}${p.isDefault ? ` ${YELLOW2}(default)${
|
|
74667
|
+
name: `${p.name} ${scopeBadge(p.scope)}${p.isDefault ? ` ${YELLOW2}(default)${RESET2}` : ""}`,
|
|
74246
74668
|
value: `${p.scope}:${p.name}`
|
|
74247
74669
|
}))
|
|
74248
74670
|
});
|
|
@@ -74278,9 +74700,10 @@ async function profileUseCommand(name, scopeFlag) {
|
|
|
74278
74700
|
return;
|
|
74279
74701
|
}
|
|
74280
74702
|
setDefaultProfile(profileName, scope);
|
|
74281
|
-
console.log(`${
|
|
74703
|
+
console.log(`${GREEN2}\u2713${RESET2} "${profileName}" is now the default ${scope} profile.`);
|
|
74282
74704
|
}
|
|
74283
74705
|
async function profileShowCommand(name, scopeFlag) {
|
|
74706
|
+
refreshAnsi3();
|
|
74284
74707
|
let profileName = name;
|
|
74285
74708
|
let scope = scopeFlag;
|
|
74286
74709
|
if (!profileName) {
|
|
@@ -74320,6 +74743,7 @@ async function profileShowCommand(name, scopeFlag) {
|
|
|
74320
74743
|
printProfile(profile, isDefault, true, scope);
|
|
74321
74744
|
}
|
|
74322
74745
|
async function profileEditCommand(name, scopeFlag) {
|
|
74746
|
+
refreshAnsi3();
|
|
74323
74747
|
let scope = scopeFlag;
|
|
74324
74748
|
let profileName = name;
|
|
74325
74749
|
if (!profileName) {
|
|
@@ -74332,7 +74756,7 @@ async function profileEditCommand(name, scopeFlag) {
|
|
|
74332
74756
|
const choice = await dist_default11({
|
|
74333
74757
|
message: "Select a profile to edit:",
|
|
74334
74758
|
choices: selectable.map((p) => ({
|
|
74335
|
-
name: `${p.name} ${scopeBadge(p.scope)}${p.isDefault ? ` ${YELLOW2}(default)${
|
|
74759
|
+
name: `${p.name} ${scopeBadge(p.scope)}${p.isDefault ? ` ${YELLOW2}(default)${RESET2}` : ""}`,
|
|
74336
74760
|
value: `${p.scope}:${p.name}`
|
|
74337
74761
|
}))
|
|
74338
74762
|
});
|
|
@@ -74367,9 +74791,9 @@ async function profileEditCommand(name, scopeFlag) {
|
|
|
74367
74791
|
return;
|
|
74368
74792
|
}
|
|
74369
74793
|
console.log(`
|
|
74370
|
-
${
|
|
74794
|
+
${BOLD2}Editing profile: ${profileName}${RESET2} ${scopeBadge(scope)}
|
|
74371
74795
|
`);
|
|
74372
|
-
console.log(`${
|
|
74796
|
+
console.log(`${DIM2}Current models:${RESET2}`);
|
|
74373
74797
|
printModelMapping(profile.models);
|
|
74374
74798
|
console.log("");
|
|
74375
74799
|
const whatToEdit = await dist_default11({
|
|
@@ -74391,14 +74815,14 @@ ${BOLD3}Editing profile: ${profileName}${RESET3} ${scopeBadge(scope)}
|
|
|
74391
74815
|
const newDescription = await promptForProfileDescription();
|
|
74392
74816
|
profile.description = newDescription;
|
|
74393
74817
|
setProfile(profile, scope);
|
|
74394
|
-
console.log(`${
|
|
74818
|
+
console.log(`${GREEN2}\u2713${RESET2} Description updated.`);
|
|
74395
74819
|
return;
|
|
74396
74820
|
}
|
|
74397
74821
|
if (whatToEdit === "all") {
|
|
74398
74822
|
const models = await selectModelsForProfile();
|
|
74399
74823
|
profile.models = { ...profile.models, ...models };
|
|
74400
74824
|
setProfile(profile, scope);
|
|
74401
|
-
console.log(`${
|
|
74825
|
+
console.log(`${GREEN2}\u2713${RESET2} All models updated.`);
|
|
74402
74826
|
return;
|
|
74403
74827
|
}
|
|
74404
74828
|
const tier = whatToEdit;
|
|
@@ -74408,42 +74832,43 @@ ${BOLD3}Editing profile: ${profileName}${RESET3} ${scopeBadge(scope)}
|
|
|
74408
74832
|
});
|
|
74409
74833
|
profile.models[tier] = newModel;
|
|
74410
74834
|
setProfile(profile, scope);
|
|
74411
|
-
console.log(`${
|
|
74835
|
+
console.log(`${GREEN2}\u2713${RESET2} ${tierName} model updated to: ${newModel}`);
|
|
74412
74836
|
}
|
|
74413
74837
|
function printProfile(profile, isDefault, verbose = false, scope) {
|
|
74414
|
-
const defaultBadge = isDefault ? ` ${YELLOW2}(default)${
|
|
74838
|
+
const defaultBadge = isDefault ? ` ${YELLOW2}(default)${RESET2}` : "";
|
|
74415
74839
|
const scopeTag = scope ? ` ${scopeBadge(scope)}` : "";
|
|
74416
|
-
console.log(`${
|
|
74840
|
+
console.log(`${BOLD2}${profile.name}${RESET2}${defaultBadge}${scopeTag}`);
|
|
74417
74841
|
if (profile.description) {
|
|
74418
|
-
console.log(` ${
|
|
74842
|
+
console.log(` ${DIM2}${profile.description}${RESET2}`);
|
|
74419
74843
|
}
|
|
74420
74844
|
printModelMapping(profile.models);
|
|
74421
74845
|
if (verbose) {
|
|
74422
|
-
console.log(` ${
|
|
74423
|
-
console.log(` ${
|
|
74846
|
+
console.log(` ${DIM2}Created: ${profile.createdAt}${RESET2}`);
|
|
74847
|
+
console.log(` ${DIM2}Updated: ${profile.updatedAt}${RESET2}`);
|
|
74424
74848
|
}
|
|
74425
74849
|
}
|
|
74426
74850
|
function printProfileWithScope(profile) {
|
|
74427
|
-
const defaultBadge = profile.isDefault ? ` ${YELLOW2}(default)${
|
|
74851
|
+
const defaultBadge = profile.isDefault ? ` ${YELLOW2}(default)${RESET2}` : "";
|
|
74428
74852
|
const badge = scopeBadge(profile.scope, profile.shadowed);
|
|
74429
|
-
console.log(`${
|
|
74853
|
+
console.log(`${BOLD2}${profile.name}${RESET2}${defaultBadge} ${badge}`);
|
|
74430
74854
|
if (profile.shadowed) {
|
|
74431
|
-
console.log(` ${
|
|
74855
|
+
console.log(` ${DIM2}(overridden by local profile of same name)${RESET2}`);
|
|
74432
74856
|
}
|
|
74433
74857
|
if (profile.description) {
|
|
74434
|
-
console.log(` ${
|
|
74858
|
+
console.log(` ${DIM2}${profile.description}${RESET2}`);
|
|
74435
74859
|
}
|
|
74436
74860
|
printModelMapping(profile.models);
|
|
74437
74861
|
}
|
|
74438
74862
|
function printModelMapping(models) {
|
|
74439
|
-
console.log(` ${
|
|
74440
|
-
console.log(` ${
|
|
74441
|
-
console.log(` ${
|
|
74863
|
+
console.log(` ${CYAN2}opus${RESET2}: ${models.opus || `${DIM2}not set${RESET2}`}`);
|
|
74864
|
+
console.log(` ${CYAN2}sonnet${RESET2}: ${models.sonnet || `${DIM2}not set${RESET2}`}`);
|
|
74865
|
+
console.log(` ${CYAN2}haiku${RESET2}: ${models.haiku || `${DIM2}not set${RESET2}`}`);
|
|
74442
74866
|
if (models.subagent) {
|
|
74443
|
-
console.log(` ${
|
|
74867
|
+
console.log(` ${CYAN2}subagent${RESET2}: ${models.subagent}`);
|
|
74444
74868
|
}
|
|
74445
74869
|
}
|
|
74446
74870
|
async function profileCommand(args) {
|
|
74871
|
+
refreshAnsi3();
|
|
74447
74872
|
const { scope, remainingArgs } = parseScopeFlag(args);
|
|
74448
74873
|
const subcommand = remainingArgs[0];
|
|
74449
74874
|
const name = remainingArgs[1];
|
|
@@ -74480,22 +74905,22 @@ async function profileCommand(args) {
|
|
|
74480
74905
|
}
|
|
74481
74906
|
function printProfileHelp() {
|
|
74482
74907
|
console.log(`
|
|
74483
|
-
${
|
|
74484
|
-
|
|
74485
|
-
${
|
|
74486
|
-
${
|
|
74487
|
-
${
|
|
74488
|
-
${
|
|
74489
|
-
${
|
|
74490
|
-
${
|
|
74491
|
-
${
|
|
74492
|
-
|
|
74493
|
-
${
|
|
74494
|
-
${
|
|
74495
|
-
${
|
|
74496
|
-
${
|
|
74497
|
-
|
|
74498
|
-
${
|
|
74908
|
+
${BOLD2}Usage:${RESET2} claudish profile <command> [options]
|
|
74909
|
+
|
|
74910
|
+
${BOLD2}Commands:${RESET2}
|
|
74911
|
+
${CYAN2}list${RESET2}, ${CYAN2}ls${RESET2} List all profiles
|
|
74912
|
+
${CYAN2}add${RESET2}, ${CYAN2}new${RESET2} Add a new profile
|
|
74913
|
+
${CYAN2}remove${RESET2} ${DIM2}[name]${RESET2} Remove a profile
|
|
74914
|
+
${CYAN2}use${RESET2} ${DIM2}[name]${RESET2} Set default profile
|
|
74915
|
+
${CYAN2}show${RESET2} ${DIM2}[name]${RESET2} Show profile details
|
|
74916
|
+
${CYAN2}edit${RESET2} ${DIM2}[name]${RESET2} Edit a profile
|
|
74917
|
+
|
|
74918
|
+
${BOLD2}Scope Flags:${RESET2}
|
|
74919
|
+
${CYAN2}--local${RESET2} Target .claudish.json in the current directory
|
|
74920
|
+
${CYAN2}--global${RESET2} Target ~/.claudish/config.json (default)
|
|
74921
|
+
${DIM2}If neither flag is given, you'll be prompted interactively.${RESET2}
|
|
74922
|
+
|
|
74923
|
+
${BOLD2}Examples:${RESET2}
|
|
74499
74924
|
claudish profile list
|
|
74500
74925
|
claudish profile list --local
|
|
74501
74926
|
claudish profile add --local
|
|
@@ -74505,11 +74930,12 @@ ${BOLD3}Examples:${RESET3}
|
|
|
74505
74930
|
claudish init --local
|
|
74506
74931
|
`);
|
|
74507
74932
|
}
|
|
74508
|
-
var
|
|
74933
|
+
var RESET2 = "", BOLD2 = "", DIM2 = "", GREEN2 = "", YELLOW2 = "", CYAN2 = "", MAGENTA2 = "";
|
|
74509
74934
|
var init_profile_commands = __esm(() => {
|
|
74510
74935
|
init_dist16();
|
|
74511
74936
|
init_model_selector();
|
|
74512
74937
|
init_profile_config();
|
|
74938
|
+
init_ansi();
|
|
74513
74939
|
});
|
|
74514
74940
|
|
|
74515
74941
|
// src/providers/local-liveness.ts
|
|
@@ -74702,7 +75128,17 @@ var init_probe_catalog = __esm(() => {
|
|
|
74702
75128
|
});
|
|
74703
75129
|
|
|
74704
75130
|
// src/tui/constants.ts
|
|
74705
|
-
|
|
75131
|
+
function getProviderPrefixes() {
|
|
75132
|
+
return getProviderDefs().map((p) => ({
|
|
75133
|
+
prefix: p.aliases?.[0] ? `${p.aliases[0]}@` : `${p.name}@`,
|
|
75134
|
+
displayName: p.displayName,
|
|
75135
|
+
name: p.name
|
|
75136
|
+
}));
|
|
75137
|
+
}
|
|
75138
|
+
function getChainProviders() {
|
|
75139
|
+
return getProviderDefs();
|
|
75140
|
+
}
|
|
75141
|
+
var COMMON_MODELS, HEADER_H = 2, TABS_H = 3, FOOTER_H = 1, DETAIL_H = 7;
|
|
74706
75142
|
var init_constants3 = __esm(() => {
|
|
74707
75143
|
init_providers();
|
|
74708
75144
|
COMMON_MODELS = [
|
|
@@ -74724,12 +75160,6 @@ var init_constants3 = __esm(() => {
|
|
|
74724
75160
|
"or@x-ai/grok-code-fast-1",
|
|
74725
75161
|
"or@deepseek/deepseek-r1"
|
|
74726
75162
|
];
|
|
74727
|
-
PROVIDER_PREFIXES = PROVIDERS.map((p) => ({
|
|
74728
|
-
prefix: p.aliases?.[0] ? `${p.aliases[0]}@` : `${p.name}@`,
|
|
74729
|
-
displayName: p.displayName,
|
|
74730
|
-
name: p.name
|
|
74731
|
-
}));
|
|
74732
|
-
CHAIN_PROVIDERS = PROVIDERS;
|
|
74733
75163
|
});
|
|
74734
75164
|
|
|
74735
75165
|
// src/tui/components/Footer.tsx
|
|
@@ -74977,7 +75407,7 @@ function OnepasswordContent({
|
|
|
74977
75407
|
children: " "
|
|
74978
75408
|
}, undefined, false, undefined, this),
|
|
74979
75409
|
/* @__PURE__ */ jsxDEV4("span", {
|
|
74980
|
-
fg: selected ? C.
|
|
75410
|
+
fg: selected ? C.strong : C.fgMuted,
|
|
74981
75411
|
attributes: A.boldIf(selected),
|
|
74982
75412
|
children: e.value
|
|
74983
75413
|
}, undefined, false, undefined, this),
|
|
@@ -75082,7 +75512,7 @@ function OnepasswordContent({
|
|
|
75082
75512
|
children: "\u25B4 "
|
|
75083
75513
|
}, undefined, false, undefined, this),
|
|
75084
75514
|
/* @__PURE__ */ jsxDEV4("span", {
|
|
75085
|
-
fg: C.
|
|
75515
|
+
fg: C.strong,
|
|
75086
75516
|
children: `project: ${account.project}`
|
|
75087
75517
|
}, undefined, false, undefined, this)
|
|
75088
75518
|
]
|
|
@@ -75094,7 +75524,7 @@ function OnepasswordContent({
|
|
|
75094
75524
|
children: "\u2022 "
|
|
75095
75525
|
}, undefined, false, undefined, this),
|
|
75096
75526
|
/* @__PURE__ */ jsxDEV4("span", {
|
|
75097
|
-
fg: C.
|
|
75527
|
+
fg: C.strong,
|
|
75098
75528
|
children: `global: ${account.global}`
|
|
75099
75529
|
}, undefined, false, undefined, this)
|
|
75100
75530
|
]
|
|
@@ -75107,7 +75537,7 @@ function OnepasswordContent({
|
|
|
75107
75537
|
/* @__PURE__ */ jsxDEV4("text", {
|
|
75108
75538
|
children: [
|
|
75109
75539
|
/* @__PURE__ */ jsxDEV4("span", {
|
|
75110
|
-
fg: C.
|
|
75540
|
+
fg: C.strong,
|
|
75111
75541
|
attributes: A.bold,
|
|
75112
75542
|
children: String(keyCount)
|
|
75113
75543
|
}, undefined, false, undefined, this),
|
|
@@ -75120,7 +75550,7 @@ function OnepasswordContent({
|
|
|
75120
75550
|
children: " "
|
|
75121
75551
|
}, undefined, false, undefined, this),
|
|
75122
75552
|
/* @__PURE__ */ jsxDEV4("span", {
|
|
75123
|
-
fg: C.
|
|
75553
|
+
fg: C.strong,
|
|
75124
75554
|
attributes: A.bold,
|
|
75125
75555
|
children: String(setCount)
|
|
75126
75556
|
}, undefined, false, undefined, this),
|
|
@@ -75133,7 +75563,7 @@ function OnepasswordContent({
|
|
|
75133
75563
|
children: " "
|
|
75134
75564
|
}, undefined, false, undefined, this),
|
|
75135
75565
|
/* @__PURE__ */ jsxDEV4("span", {
|
|
75136
|
-
fg: C.
|
|
75566
|
+
fg: C.strong,
|
|
75137
75567
|
attributes: A.bold,
|
|
75138
75568
|
children: String(envCount)
|
|
75139
75569
|
}, undefined, false, undefined, this),
|
|
@@ -75294,7 +75724,7 @@ function OnepasswordDetail({ selectedEntry, testResults }) {
|
|
|
75294
75724
|
children: "Kind: "
|
|
75295
75725
|
}, undefined, false, undefined, this),
|
|
75296
75726
|
/* @__PURE__ */ jsxDEV5("span", {
|
|
75297
|
-
fg: C.
|
|
75727
|
+
fg: C.strong,
|
|
75298
75728
|
children: kindLabel2(selectedEntry.kind)
|
|
75299
75729
|
}, undefined, false, undefined, this)
|
|
75300
75730
|
]
|
|
@@ -75307,7 +75737,7 @@ function OnepasswordDetail({ selectedEntry, testResults }) {
|
|
|
75307
75737
|
children: "Value: "
|
|
75308
75738
|
}, undefined, false, undefined, this),
|
|
75309
75739
|
/* @__PURE__ */ jsxDEV5("span", {
|
|
75310
|
-
fg: C.
|
|
75740
|
+
fg: C.strong,
|
|
75311
75741
|
children: selectedEntry.value
|
|
75312
75742
|
}, undefined, false, undefined, this)
|
|
75313
75743
|
]
|
|
@@ -75611,7 +76041,7 @@ function OnepasswordModal({
|
|
|
75611
76041
|
children: "filter: "
|
|
75612
76042
|
}, undefined, false, undefined, this),
|
|
75613
76043
|
filter ? /* @__PURE__ */ jsxDEV6("span", {
|
|
75614
|
-
fg: C.
|
|
76044
|
+
fg: C.strong,
|
|
75615
76045
|
attributes: A.bold,
|
|
75616
76046
|
children: filter
|
|
75617
76047
|
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV6("span", {
|
|
@@ -75657,7 +76087,7 @@ function OnepasswordModal({
|
|
|
75657
76087
|
children: selected ? "\u25B6 " : " "
|
|
75658
76088
|
}, undefined, false, undefined, this),
|
|
75659
76089
|
/* @__PURE__ */ jsxDEV6("span", {
|
|
75660
|
-
fg: selected ? C.
|
|
76090
|
+
fg: selected ? C.strong : C.fgMuted,
|
|
75661
76091
|
attributes: A.boldIf(selected),
|
|
75662
76092
|
children: row
|
|
75663
76093
|
}, undefined, false, undefined, this)
|
|
@@ -75749,7 +76179,7 @@ function OnepasswordModal({
|
|
|
75749
76179
|
children: "filter: "
|
|
75750
76180
|
}, undefined, false, undefined, this),
|
|
75751
76181
|
filter ? /* @__PURE__ */ jsxDEV6("span", {
|
|
75752
|
-
fg: C.
|
|
76182
|
+
fg: C.strong,
|
|
75753
76183
|
attributes: A.bold,
|
|
75754
76184
|
children: filter
|
|
75755
76185
|
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV6("span", {
|
|
@@ -75849,7 +76279,7 @@ function OnepasswordModal({
|
|
|
75849
76279
|
focused: true,
|
|
75850
76280
|
width: dialogW - 6,
|
|
75851
76281
|
backgroundColor: C.bgHighlight,
|
|
75852
|
-
textColor: C.
|
|
76282
|
+
textColor: C.strong
|
|
75853
76283
|
}, undefined, false, undefined, this)
|
|
75854
76284
|
]
|
|
75855
76285
|
}, undefined, true, undefined, this),
|
|
@@ -75905,7 +76335,7 @@ function OnepasswordModal({
|
|
|
75905
76335
|
children: selected ? "\u25B6 " : " "
|
|
75906
76336
|
}, undefined, false, undefined, this),
|
|
75907
76337
|
/* @__PURE__ */ jsxDEV6("span", {
|
|
75908
|
-
fg: selected ? C.
|
|
76338
|
+
fg: selected ? C.strong : C.fgMuted,
|
|
75909
76339
|
attributes: A.bold,
|
|
75910
76340
|
children: opt.title
|
|
75911
76341
|
}, undefined, false, undefined, this)
|
|
@@ -75932,7 +76362,7 @@ function OnepasswordModal({
|
|
|
75932
76362
|
backgroundColor: C.bg,
|
|
75933
76363
|
textColor: C.fgMuted,
|
|
75934
76364
|
selectedBackgroundColor: C.bgHighlight,
|
|
75935
|
-
selectedTextColor: C.
|
|
76365
|
+
selectedTextColor: C.strong,
|
|
75936
76366
|
height: SCOPE_OPTIONS.length
|
|
75937
76367
|
}, undefined, false, undefined, this);
|
|
75938
76368
|
} else if (mode === "pick_op_account") {
|
|
@@ -76178,7 +76608,7 @@ function PrivacyContent({
|
|
|
76178
76608
|
}, undefined, false, undefined, this),
|
|
76179
76609
|
/* @__PURE__ */ jsxDEV7("text", {
|
|
76180
76610
|
children: /* @__PURE__ */ jsxDEV7("span", {
|
|
76181
|
-
fg: C.
|
|
76611
|
+
fg: C.strong,
|
|
76182
76612
|
attributes: A.bold,
|
|
76183
76613
|
children: "Never sends keys, prompts, or paths."
|
|
76184
76614
|
}, undefined, false, undefined, this)
|
|
@@ -76247,7 +76677,7 @@ function PrivacyContent({
|
|
|
76247
76677
|
]
|
|
76248
76678
|
}, undefined, true, undefined, this),
|
|
76249
76679
|
/* @__PURE__ */ jsxDEV7("span", {
|
|
76250
|
-
fg: C.
|
|
76680
|
+
fg: C.strong,
|
|
76251
76681
|
attributes: A.bold,
|
|
76252
76682
|
children: bufStats.events
|
|
76253
76683
|
}, undefined, false, undefined, this),
|
|
@@ -76510,8 +76940,9 @@ function ProfilesContent({
|
|
|
76510
76940
|
{ name: "global ~/.claudish/config.json", description: "", value: "global" },
|
|
76511
76941
|
{ name: "project ./.claudish.json", description: "", value: "project" }
|
|
76512
76942
|
];
|
|
76513
|
-
const
|
|
76514
|
-
const
|
|
76943
|
+
const prefixes = getProviderPrefixes();
|
|
76944
|
+
const prefixColW = prefixes.reduce((max, p) => Math.max(max, p.prefix.length), 0) + 2;
|
|
76945
|
+
const prefixOptions = prefixes.map((p) => ({
|
|
76515
76946
|
name: `${p.prefix.padEnd(prefixColW)}${p.displayName}`,
|
|
76516
76947
|
description: "",
|
|
76517
76948
|
value: p.prefix
|
|
@@ -76590,7 +77021,7 @@ function ProfilesContent({
|
|
|
76590
77021
|
children: " "
|
|
76591
77022
|
}, undefined, false, undefined, this),
|
|
76592
77023
|
/* @__PURE__ */ jsxDEV10("span", {
|
|
76593
|
-
fg: selected ? C.
|
|
77024
|
+
fg: selected ? C.strong : isActive ? C.orange : C.fgMuted,
|
|
76594
77025
|
attributes: A.boldIf(selected || isActive),
|
|
76595
77026
|
children: namePad
|
|
76596
77027
|
}, undefined, false, undefined, this),
|
|
@@ -76607,7 +77038,7 @@ function ProfilesContent({
|
|
|
76607
77038
|
children: " "
|
|
76608
77039
|
}, undefined, false, undefined, this),
|
|
76609
77040
|
/* @__PURE__ */ jsxDEV10("span", {
|
|
76610
|
-
fg: selected ? C.
|
|
77041
|
+
fg: selected ? C.strong : shadowed ? C.dim : C.fgMuted,
|
|
76611
77042
|
children: shadowed ? "(shadowed by local) " : modelSummary
|
|
76612
77043
|
}, undefined, false, undefined, this)
|
|
76613
77044
|
]
|
|
@@ -76651,7 +77082,7 @@ function ProfilesContent({
|
|
|
76651
77082
|
backgroundColor: C.bg,
|
|
76652
77083
|
textColor: C.fgMuted,
|
|
76653
77084
|
selectedBackgroundColor: C.bgHighlight,
|
|
76654
|
-
selectedTextColor: C.
|
|
77085
|
+
selectedTextColor: C.strong,
|
|
76655
77086
|
height: scopeOptions.length
|
|
76656
77087
|
}, undefined, false, undefined, this),
|
|
76657
77088
|
/* @__PURE__ */ jsxDEV10("text", {
|
|
@@ -76777,7 +77208,7 @@ function ProfilesContent({
|
|
|
76777
77208
|
children: "> "
|
|
76778
77209
|
}, undefined, false, undefined, this),
|
|
76779
77210
|
/* @__PURE__ */ jsxDEV10("span", {
|
|
76780
|
-
fg: editProfileValue === "auto" ? C.yellow : C.
|
|
77211
|
+
fg: editProfileValue === "auto" ? C.yellow : C.strong,
|
|
76781
77212
|
children: editProfileValue
|
|
76782
77213
|
}, undefined, false, undefined, this),
|
|
76783
77214
|
/* @__PURE__ */ jsxDEV10("span", {
|
|
@@ -76808,7 +77239,7 @@ function ProfilesContent({
|
|
|
76808
77239
|
children: s.substring(0, matchIdx)
|
|
76809
77240
|
}, undefined, false, undefined, this),
|
|
76810
77241
|
/* @__PURE__ */ jsxDEV10("span", {
|
|
76811
|
-
fg: selected ? C.
|
|
77242
|
+
fg: selected ? C.strong : C.cyan,
|
|
76812
77243
|
attributes: A.bold,
|
|
76813
77244
|
children: s.substring(matchIdx, matchIdx + lower.length)
|
|
76814
77245
|
}, undefined, false, undefined, this),
|
|
@@ -76818,7 +77249,7 @@ function ProfilesContent({
|
|
|
76818
77249
|
}, undefined, false, undefined, this)
|
|
76819
77250
|
]
|
|
76820
77251
|
}, undefined, true, undefined, this) : /* @__PURE__ */ jsxDEV10("span", {
|
|
76821
|
-
fg: selected ? C.
|
|
77252
|
+
fg: selected ? C.strong : C.fgMuted,
|
|
76822
77253
|
children: s
|
|
76823
77254
|
}, undefined, false, undefined, this)
|
|
76824
77255
|
]
|
|
@@ -77065,7 +77496,7 @@ function ProviderDetail({
|
|
|
77065
77496
|
focused: true,
|
|
77066
77497
|
width: width - 8,
|
|
77067
77498
|
backgroundColor: C.bgHighlight,
|
|
77068
|
-
textColor: C.
|
|
77499
|
+
textColor: C.strong
|
|
77069
77500
|
}, undefined, false, undefined, this)
|
|
77070
77501
|
]
|
|
77071
77502
|
}, undefined, true, undefined, this)
|
|
@@ -77228,7 +77659,7 @@ function ProviderDetail({
|
|
|
77228
77659
|
]
|
|
77229
77660
|
}, undefined, true, undefined, this),
|
|
77230
77661
|
/* @__PURE__ */ jsxDEV11("span", {
|
|
77231
|
-
fg: C.
|
|
77662
|
+
fg: C.strong,
|
|
77232
77663
|
children: selectedProvider.description
|
|
77233
77664
|
}, undefined, false, undefined, this)
|
|
77234
77665
|
]
|
|
@@ -77460,7 +77891,7 @@ function ProvidersContent({
|
|
|
77460
77891
|
children: " "
|
|
77461
77892
|
}, undefined, false, undefined, this),
|
|
77462
77893
|
/* @__PURE__ */ jsxDEV12("span", {
|
|
77463
|
-
fg: selected ? C.
|
|
77894
|
+
fg: selected ? C.strong : isReady ? C.fgMuted : C.dim,
|
|
77464
77895
|
attributes: A.boldIf(selected),
|
|
77465
77896
|
children: pad(p.displayName, COL_NAME)
|
|
77466
77897
|
}, undefined, false, undefined, this),
|
|
@@ -77480,14 +77911,14 @@ function ProvidersContent({
|
|
|
77480
77911
|
/* @__PURE__ */ jsxDEV12(Fragment8, {
|
|
77481
77912
|
children: [
|
|
77482
77913
|
/* @__PURE__ */ jsxDEV12("span", {
|
|
77483
|
-
fg: keySlot.set ? C.
|
|
77914
|
+
fg: keySlot.set ? C.strong : C.dim,
|
|
77484
77915
|
children: keySlotGlyph
|
|
77485
77916
|
}, undefined, false, undefined, this),
|
|
77486
77917
|
/* @__PURE__ */ jsxDEV12("span", {
|
|
77487
77918
|
children: " "
|
|
77488
77919
|
}, undefined, false, undefined, this),
|
|
77489
77920
|
/* @__PURE__ */ jsxDEV12("span", {
|
|
77490
|
-
fg: oauthSlot.set ? C.
|
|
77921
|
+
fg: oauthSlot.set ? C.strong : C.dim,
|
|
77491
77922
|
children: oauthSlotGlyph
|
|
77492
77923
|
}, undefined, false, undefined, this)
|
|
77493
77924
|
]
|
|
@@ -77512,7 +77943,7 @@ function ProvidersContent({
|
|
|
77512
77943
|
fg: C.yellow,
|
|
77513
77944
|
children: tr.error.replace(/\s+/g, " ").trim()
|
|
77514
77945
|
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV12("span", {
|
|
77515
|
-
fg: selected ? C.
|
|
77946
|
+
fg: selected ? C.strong : C.dim,
|
|
77516
77947
|
children: p.description
|
|
77517
77948
|
}, undefined, false, undefined, this)
|
|
77518
77949
|
]
|
|
@@ -77691,7 +78122,7 @@ function RoutingContent({
|
|
|
77691
78122
|
children: [
|
|
77692
78123
|
/* @__PURE__ */ jsxDEV13("text", {
|
|
77693
78124
|
children: /* @__PURE__ */ jsxDEV13("span", {
|
|
77694
|
-
fg: C.
|
|
78125
|
+
fg: C.strong,
|
|
77695
78126
|
attributes: A.bold,
|
|
77696
78127
|
children: "Route Probe"
|
|
77697
78128
|
}, undefined, false, undefined, this)
|
|
@@ -77716,7 +78147,7 @@ function RoutingContent({
|
|
|
77716
78147
|
children: "> "
|
|
77717
78148
|
}, undefined, false, undefined, this),
|
|
77718
78149
|
/* @__PURE__ */ jsxDEV13("span", {
|
|
77719
|
-
fg: C.
|
|
78150
|
+
fg: C.strong,
|
|
77720
78151
|
children: probeModel
|
|
77721
78152
|
}, undefined, false, undefined, this),
|
|
77722
78153
|
/* @__PURE__ */ jsxDEV13("span", {
|
|
@@ -77774,7 +78205,7 @@ function RoutingContent({
|
|
|
77774
78205
|
children: /* @__PURE__ */ jsxDEV13("text", {
|
|
77775
78206
|
children: [
|
|
77776
78207
|
/* @__PURE__ */ jsxDEV13("span", {
|
|
77777
|
-
fg: C.
|
|
78208
|
+
fg: C.strong,
|
|
77778
78209
|
attributes: A.bold,
|
|
77779
78210
|
children: probeMode === "done" ? "Probe: " : "Probing: "
|
|
77780
78211
|
}, undefined, false, undefined, this),
|
|
@@ -77833,7 +78264,7 @@ function RoutingContent({
|
|
|
77833
78264
|
children: `${idx + 1}. `
|
|
77834
78265
|
}, undefined, false, undefined, this),
|
|
77835
78266
|
/* @__PURE__ */ jsxDEV13("span", {
|
|
77836
|
-
fg: isNoKey ? C.dim : isSelected ? C.
|
|
78267
|
+
fg: isNoKey ? C.dim : isSelected ? C.strong : isNotReached ? C.dim : C.fgMuted,
|
|
77837
78268
|
attributes: A.boldIf(isSelected),
|
|
77838
78269
|
children: nameCol
|
|
77839
78270
|
}, undefined, false, undefined, this),
|
|
@@ -78108,7 +78539,7 @@ function RoutingContent({
|
|
|
78108
78539
|
scopeText = "global ";
|
|
78109
78540
|
scopeFg = C.green;
|
|
78110
78541
|
}
|
|
78111
|
-
const patFg = sel ? C.
|
|
78542
|
+
const patFg = sel ? C.strong : isDefault ? C.fgMuted : C.cyan;
|
|
78112
78543
|
const chainFg = sel ? C.cyan : isDefault ? C.dim : C.fgMuted;
|
|
78113
78544
|
return /* @__PURE__ */ jsxDEV13("box", {
|
|
78114
78545
|
height: 1,
|
|
@@ -78156,7 +78587,7 @@ function RoutingContent({
|
|
|
78156
78587
|
children: "Scope for "
|
|
78157
78588
|
}, undefined, false, undefined, this),
|
|
78158
78589
|
/* @__PURE__ */ jsxDEV13("span", {
|
|
78159
|
-
fg: C.
|
|
78590
|
+
fg: C.strong,
|
|
78160
78591
|
attributes: A.bold,
|
|
78161
78592
|
children: routingPattern
|
|
78162
78593
|
}, undefined, false, undefined, this),
|
|
@@ -78315,7 +78746,7 @@ function RoutingContent({
|
|
|
78315
78746
|
children: "> "
|
|
78316
78747
|
}, undefined, false, undefined, this),
|
|
78317
78748
|
/* @__PURE__ */ jsxDEV13("span", {
|
|
78318
|
-
fg: C.
|
|
78749
|
+
fg: C.strong,
|
|
78319
78750
|
children: routingPattern
|
|
78320
78751
|
}, undefined, false, undefined, this),
|
|
78321
78752
|
/* @__PURE__ */ jsxDEV13("span", {
|
|
@@ -78368,7 +78799,7 @@ function RoutingContent({
|
|
|
78368
78799
|
children: "Select providers for "
|
|
78369
78800
|
}, undefined, false, undefined, this),
|
|
78370
78801
|
/* @__PURE__ */ jsxDEV13("span", {
|
|
78371
|
-
fg: C.
|
|
78802
|
+
fg: C.strong,
|
|
78372
78803
|
attributes: A.bold,
|
|
78373
78804
|
children: routingPattern
|
|
78374
78805
|
}, undefined, false, undefined, this),
|
|
@@ -78397,7 +78828,7 @@ function RoutingContent({
|
|
|
78397
78828
|
scrollY: true,
|
|
78398
78829
|
focused: false,
|
|
78399
78830
|
style: { flexGrow: 1 },
|
|
78400
|
-
children:
|
|
78831
|
+
children: getChainProviders().map((prov, idx) => {
|
|
78401
78832
|
const isCursor = idx === chainCursor;
|
|
78402
78833
|
const isOn = chainSelected.has(prov.name);
|
|
78403
78834
|
const pos = isOn ? chainOrder.indexOf(prov.name) + 1 : 0;
|
|
@@ -78417,7 +78848,7 @@ function RoutingContent({
|
|
|
78417
78848
|
children: " [ ] "
|
|
78418
78849
|
}, undefined, false, undefined, this),
|
|
78419
78850
|
/* @__PURE__ */ jsxDEV13("span", {
|
|
78420
|
-
fg: isCursor ? C.
|
|
78851
|
+
fg: isCursor ? C.strong : ready ? C.fgMuted : C.dim,
|
|
78421
78852
|
attributes: A.boldIf(isCursor),
|
|
78422
78853
|
children: label
|
|
78423
78854
|
}, undefined, false, undefined, this),
|
|
@@ -78839,10 +79270,10 @@ function useProfileWizard(args) {
|
|
|
78839
79270
|
setProviderPickerIndex((i) => Math.max(0, i - 1));
|
|
78840
79271
|
}, []);
|
|
78841
79272
|
const prefixPickerDown = useCallback(() => {
|
|
78842
|
-
setProviderPickerIndex((i) => Math.min(
|
|
79273
|
+
setProviderPickerIndex((i) => Math.min(getProviderPrefixes().length - 1, i + 1));
|
|
78843
79274
|
}, []);
|
|
78844
79275
|
const prefixPickerSubmit = useCallback(() => {
|
|
78845
|
-
const prefix =
|
|
79276
|
+
const prefix = getProviderPrefixes()[providerPickerIndex]?.prefix ?? "";
|
|
78846
79277
|
setEditProfileValue(prefix);
|
|
78847
79278
|
setSuggestions(computeSuggestions(prefix));
|
|
78848
79279
|
setSuggestionIndex(-1);
|
|
@@ -79152,7 +79583,7 @@ function useRouteProbe(config3) {
|
|
|
79152
79583
|
}
|
|
79153
79584
|
for (let i = 0;i < chain.length; i++) {
|
|
79154
79585
|
const link = chain[i];
|
|
79155
|
-
const provDef =
|
|
79586
|
+
const provDef = getProviderDefs().find((p) => p.catalogName === link.provider);
|
|
79156
79587
|
const ready = provDef ? providerIsReady(provDef, config3) : true;
|
|
79157
79588
|
if (!ready) {
|
|
79158
79589
|
setProbeResults((prev) => prev.map((e, idx) => idx === i ? { ...e, status: "no_key" } : e));
|
|
@@ -79256,7 +79687,7 @@ function App({ requestLogin } = {}) {
|
|
|
79256
79687
|
if (activeTab !== "providers")
|
|
79257
79688
|
return;
|
|
79258
79689
|
let cancelled = false;
|
|
79259
|
-
const localNames =
|
|
79690
|
+
const localNames = getProviderDefs().filter((p) => p.isLocal).map((p) => p.catalogName);
|
|
79260
79691
|
if (localNames.length === 0)
|
|
79261
79692
|
return;
|
|
79262
79693
|
const sweep = async () => {
|
|
@@ -79300,11 +79731,12 @@ function App({ requestLogin } = {}) {
|
|
|
79300
79731
|
const opPickerResolver = useRef4(null);
|
|
79301
79732
|
const quit = useCallback3(() => renderer.destroy(), [renderer]);
|
|
79302
79733
|
const displayProviders = useMemo2(() => {
|
|
79303
|
-
|
|
79734
|
+
const roster = getProviderDefs();
|
|
79735
|
+
return [...roster].sort((a, b) => {
|
|
79304
79736
|
const aReady = providerIsReadyForDisplay(a, config3, localLiveness);
|
|
79305
79737
|
const bReady = providerIsReadyForDisplay(b, config3, localLiveness);
|
|
79306
79738
|
if (aReady === bReady)
|
|
79307
|
-
return
|
|
79739
|
+
return roster.indexOf(a) - roster.indexOf(b);
|
|
79308
79740
|
return aReady ? -1 : 1;
|
|
79309
79741
|
});
|
|
79310
79742
|
}, [config3, localLiveness]);
|
|
@@ -79916,9 +80348,9 @@ function App({ requestLogin } = {}) {
|
|
|
79916
80348
|
if (key.name === "up" || key.name === "k") {
|
|
79917
80349
|
setChainCursor((i) => Math.max(0, i - 1));
|
|
79918
80350
|
} else if (key.name === "down" || key.name === "j") {
|
|
79919
|
-
setChainCursor((i) => Math.min(
|
|
80351
|
+
setChainCursor((i) => Math.min(getChainProviders().length - 1, i + 1));
|
|
79920
80352
|
} else if (key.name === "space" || key.raw === " ") {
|
|
79921
|
-
const prov =
|
|
80353
|
+
const prov = getChainProviders()[chainCursor];
|
|
79922
80354
|
if (prov.isLocal && !providerIsReady(prov, config3)) {
|
|
79923
80355
|
setStatusMsg(`${prov.displayName} is disabled. Enable it in Providers first.`);
|
|
79924
80356
|
return;
|
|
@@ -79936,7 +80368,7 @@ function App({ requestLogin } = {}) {
|
|
|
79936
80368
|
return next;
|
|
79937
80369
|
});
|
|
79938
80370
|
} else if (key.raw && key.raw >= "1" && key.raw <= "9") {
|
|
79939
|
-
const prov =
|
|
80371
|
+
const prov = getChainProviders()[chainCursor];
|
|
79940
80372
|
if (prov.isLocal && !providerIsReady(prov, config3)) {
|
|
79941
80373
|
setStatusMsg(`${prov.displayName} is disabled. Enable it in Providers first.`);
|
|
79942
80374
|
return;
|
|
@@ -80392,7 +80824,7 @@ function App({ requestLogin } = {}) {
|
|
|
80392
80824
|
}
|
|
80393
80825
|
} else if (key.raw === "T") {
|
|
80394
80826
|
const fired = [];
|
|
80395
|
-
for (const prov of
|
|
80827
|
+
for (const prov of getProviderDefs()) {
|
|
80396
80828
|
const localRunning = prov.isLocal && localLiveness[prov.catalogName] === "running";
|
|
80397
80829
|
if (!providerIsReady(prov, config3) && !localRunning)
|
|
80398
80830
|
continue;
|
|
@@ -80665,7 +81097,7 @@ function App({ requestLogin } = {}) {
|
|
|
80665
81097
|
children: /* @__PURE__ */ jsxDEV16("text", {
|
|
80666
81098
|
children: [
|
|
80667
81099
|
/* @__PURE__ */ jsxDEV16("span", {
|
|
80668
|
-
fg: C.
|
|
81100
|
+
fg: C.strong,
|
|
80669
81101
|
attributes: A.bold,
|
|
80670
81102
|
children: "claudish"
|
|
80671
81103
|
}, undefined, false, undefined, this),
|
|
@@ -80918,6 +81350,7 @@ async function startConfigTui() {
|
|
|
80918
81350
|
const renderer = await createCliRenderer2({
|
|
80919
81351
|
exitOnCtrlC: false
|
|
80920
81352
|
});
|
|
81353
|
+
await applyRendererThemeMode(renderer);
|
|
80921
81354
|
await new Promise((resolve5) => {
|
|
80922
81355
|
renderer.once("destroy", () => resolve5());
|
|
80923
81356
|
createRoot2(renderer).render(/* @__PURE__ */ jsxDEV17(App, {
|
|
@@ -80967,6 +81400,7 @@ var init_tui = __esm(() => {
|
|
|
80967
81400
|
init_codex_oauth();
|
|
80968
81401
|
init_kimi_oauth();
|
|
80969
81402
|
init_logger();
|
|
81403
|
+
init_renderer_theme();
|
|
80970
81404
|
init_endpoint_registration();
|
|
80971
81405
|
init_App();
|
|
80972
81406
|
if (isDirectRun) {
|
|
@@ -81145,15 +81579,21 @@ function createStatusLineScript(tokenFilePath) {
|
|
|
81145
81579
|
const timestamp = Date.now();
|
|
81146
81580
|
const scriptPath = join39(claudishDir, `status-${timestamp}.js`);
|
|
81147
81581
|
const escapedTokenPath = tokenFilePath.replace(/\\/g, "\\\\");
|
|
81582
|
+
const light = getThemeMode() === "light";
|
|
81583
|
+
const cyanCode = light ? "38;2;14;116;144" : "96";
|
|
81584
|
+
const yellowCode = light ? "38;2;161;98;7" : "93";
|
|
81585
|
+
const greenCode = light ? "38;2;21;128;61" : "92";
|
|
81586
|
+
const redCode = light ? "38;2;220;38;38" : "91";
|
|
81587
|
+
const magentaCode = light ? "38;2;147;51;234" : "95";
|
|
81148
81588
|
const script = `
|
|
81149
81589
|
const fs = require('fs');
|
|
81150
81590
|
const path = require('path');
|
|
81151
81591
|
|
|
81152
|
-
const CYAN = "\\x1b[
|
|
81153
|
-
const YELLOW = "\\x1b[
|
|
81154
|
-
const GREEN = "\\x1b[
|
|
81155
|
-
const RED = "\\x1b[
|
|
81156
|
-
const MAGENTA = "\\x1b[
|
|
81592
|
+
const CYAN = "\\x1b[${cyanCode}m";
|
|
81593
|
+
const YELLOW = "\\x1b[${yellowCode}m";
|
|
81594
|
+
const GREEN = "\\x1b[${greenCode}m";
|
|
81595
|
+
const RED = "\\x1b[${redCode}m";
|
|
81596
|
+
const MAGENTA = "\\x1b[${magentaCode}m";
|
|
81157
81597
|
const DIM = "\\x1b[2m";
|
|
81158
81598
|
const RESET = "\\x1b[0m";
|
|
81159
81599
|
const BOLD = "\\x1b[1m";
|
|
@@ -81393,22 +81833,23 @@ function createTempSettingsFile(_modelDisplay, port, proxyAuthMode, userStatusLi
|
|
|
81393
81833
|
const scriptPath = createStatusLineScript(tokenFilePath);
|
|
81394
81834
|
statusCommand = `node "${scriptPath}"`;
|
|
81395
81835
|
} else {
|
|
81396
|
-
const
|
|
81397
|
-
const
|
|
81398
|
-
const
|
|
81399
|
-
const
|
|
81400
|
-
const
|
|
81401
|
-
const
|
|
81402
|
-
const
|
|
81836
|
+
const light = getThemeMode() === "light";
|
|
81837
|
+
const CYAN3 = light ? "\\033[38;2;14;116;144m" : "\\033[96m";
|
|
81838
|
+
const YELLOW3 = light ? "\\033[38;2;161;98;7m" : "\\033[93m";
|
|
81839
|
+
const GREEN3 = light ? "\\033[38;2;21;128;61m" : "\\033[92m";
|
|
81840
|
+
const MAGENTA3 = light ? "\\033[38;2;147;51;234m" : "\\033[95m";
|
|
81841
|
+
const DIM3 = "\\033[2m";
|
|
81842
|
+
const RESET3 = "\\033[0m";
|
|
81843
|
+
const BOLD3 = "\\033[1m";
|
|
81403
81844
|
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
81845
|
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
81846
|
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
81847
|
const dirPrelude = `DIR=$(basename "$(pwd)"); [ \${#DIR} -gt 15 ] && DIR="\${DIR:0:12}..." || true; `;
|
|
81407
81848
|
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 "${
|
|
81849
|
+
const planSuffix = `if [ -n "$PLAN_DISPLAY" ]; then printf " ${DIM3}\u2022${RESET3} ${GREEN3}%s${RESET3}" "$PLAN_DISPLAY"; fi`;
|
|
81850
|
+
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"`;
|
|
81851
|
+
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"`;
|
|
81852
|
+
const segmentNoDirNoProvider = `printf "${GREEN3}%s${RESET3} ${DIM3}\u2022${RESET3} ${MAGENTA3}%s${RESET3}" "$COST_DISPLAY" "$CTX_DISPLAY"; ${planSuffix}; printf "\\n"`;
|
|
81412
81853
|
const segmentNoDir = `if [ -n "$PROVIDER" ]; then ${segmentNoDirWithProvider}; else ${segmentNoDirNoProvider}; fi`;
|
|
81413
81854
|
statusCommand = userStatusLineCommand ? buildChainedStatusCommand(userStatusLineCommand, readState, segmentNoDir) : `JSON=$(cat); ${dirPrelude}${readState}; ${segmentWithDir}`;
|
|
81414
81855
|
}
|
|
@@ -81813,6 +82254,7 @@ var init_claude_runner = __esm(() => {
|
|
|
81813
82254
|
init_routing_rules();
|
|
81814
82255
|
init_telemetry();
|
|
81815
82256
|
init_terminal_isolation();
|
|
82257
|
+
init_theme_mode();
|
|
81816
82258
|
STALE_TOKEN_FILE_MS = 7 * 24 * 60 * 60 * 1000;
|
|
81817
82259
|
});
|
|
81818
82260
|
|
|
@@ -82187,6 +82629,32 @@ var init_text = __esm(() => {
|
|
|
82187
82629
|
});
|
|
82188
82630
|
|
|
82189
82631
|
// src/tui/viz/tokens.ts
|
|
82632
|
+
function refreshTokens() {
|
|
82633
|
+
tokens.fatal = C.red;
|
|
82634
|
+
tokens.error = C.red;
|
|
82635
|
+
tokens.warn = C.orange;
|
|
82636
|
+
tokens.info = C.cyan;
|
|
82637
|
+
tokens.debug = C.fgMuted;
|
|
82638
|
+
tokens.trace = C.dim;
|
|
82639
|
+
tokens.success = C.green;
|
|
82640
|
+
tokens.running = C.blue;
|
|
82641
|
+
tokens.idle = C.fgMuted;
|
|
82642
|
+
tokens.dead = C.dim;
|
|
82643
|
+
tokens.border = C.border;
|
|
82644
|
+
tokens.subtle = C.dim;
|
|
82645
|
+
tokens.text = C.fg;
|
|
82646
|
+
tokens.accent = C.focusBorder;
|
|
82647
|
+
tokens.bgPanel = C.bgAlt;
|
|
82648
|
+
tokens.ink = C.black;
|
|
82649
|
+
refreshRamps();
|
|
82650
|
+
}
|
|
82651
|
+
function refreshRamps() {
|
|
82652
|
+
ramps.load = [tokens.success, C.yellow, tokens.error];
|
|
82653
|
+
ramps.temperature = [tokens.running, tokens.success, C.orange, tokens.error];
|
|
82654
|
+
ramps.network = [tokens.success, C.yellow, tokens.error];
|
|
82655
|
+
ramps.savings = [tokens.error, C.yellow, tokens.success];
|
|
82656
|
+
ramps.volume = [C.border, C.blue, C.cyan];
|
|
82657
|
+
}
|
|
82190
82658
|
var tokens, ramps;
|
|
82191
82659
|
var init_tokens = __esm(() => {
|
|
82192
82660
|
init_theme2();
|
|
@@ -82215,6 +82683,7 @@ var init_tokens = __esm(() => {
|
|
|
82215
82683
|
savings: [tokens.error, C.yellow, tokens.success],
|
|
82216
82684
|
volume: [C.border, C.blue, C.cyan]
|
|
82217
82685
|
};
|
|
82686
|
+
registerPaletteRefresher(refreshTokens);
|
|
82218
82687
|
});
|
|
82219
82688
|
|
|
82220
82689
|
// src/tui/viz/color.ts
|
|
@@ -82370,7 +82839,7 @@ function BadgeSpan({ label, bg, width }) {
|
|
|
82370
82839
|
/* @__PURE__ */ jsxDEV18("span", {
|
|
82371
82840
|
fg: pickInk(bg),
|
|
82372
82841
|
bg,
|
|
82373
|
-
attributes:
|
|
82842
|
+
attributes: BOLD3,
|
|
82374
82843
|
children: ` ${label} `
|
|
82375
82844
|
}, undefined, false, undefined, this),
|
|
82376
82845
|
badgePad(label, width)
|
|
@@ -82401,12 +82870,12 @@ function Panel({
|
|
|
82401
82870
|
children
|
|
82402
82871
|
}, undefined, false, undefined, this);
|
|
82403
82872
|
}
|
|
82404
|
-
var
|
|
82873
|
+
var BOLD3, FILL = "\u2588", TRACK = "\u2591", SPARK, GAP = " ", NODATA = "\u254C", RAMP_CACHE, RAMP_CACHE_MAX = 64;
|
|
82405
82874
|
var init_widgets = __esm(() => {
|
|
82406
82875
|
init_color();
|
|
82407
82876
|
init_text();
|
|
82408
82877
|
init_tokens();
|
|
82409
|
-
|
|
82878
|
+
BOLD3 = createTextAttributes2({ bold: true });
|
|
82410
82879
|
SPARK = ["\u2581", "\u2582", "\u2583", "\u2584", "\u2585", "\u2586", "\u2587", "\u2588"];
|
|
82411
82880
|
RAMP_CACHE = new Map;
|
|
82412
82881
|
});
|
|
@@ -83056,6 +83525,9 @@ var init_conversation = __esm(() => {
|
|
|
83056
83525
|
import { useKeyboard as useKeyboard3 } from "@opentui/react";
|
|
83057
83526
|
import { useEffect as useEffect5, useMemo as useMemo3, useState as useState6 } from "react";
|
|
83058
83527
|
import { jsxDEV as jsxDEV19, Fragment as Fragment12 } from "@opentui/react/jsx-dev-runtime";
|
|
83528
|
+
function speaker() {
|
|
83529
|
+
return getThemeMode() === "light" ? SPEAKER_LIGHT : SPEAKER;
|
|
83530
|
+
}
|
|
83059
83531
|
function layoutRows(turns, textWidth) {
|
|
83060
83532
|
const rows = [];
|
|
83061
83533
|
const turnStart = [];
|
|
@@ -83389,6 +83861,9 @@ function scrollbarCells(viewport, total, top, hits) {
|
|
|
83389
83861
|
}
|
|
83390
83862
|
return cells;
|
|
83391
83863
|
}
|
|
83864
|
+
function barColor(cell) {
|
|
83865
|
+
return cell === "track" ? tokens.border : cell === "thumb" ? tokens.accent : tokens.warn;
|
|
83866
|
+
}
|
|
83392
83867
|
function ReaderRow({
|
|
83393
83868
|
row,
|
|
83394
83869
|
turn,
|
|
@@ -83404,15 +83879,16 @@ function ReaderRow({
|
|
|
83404
83879
|
children: " ".repeat(Math.max(0, width))
|
|
83405
83880
|
}, undefined, false, undefined, this),
|
|
83406
83881
|
/* @__PURE__ */ jsxDEV19("span", {
|
|
83407
|
-
bg:
|
|
83882
|
+
bg: barColor(bar),
|
|
83408
83883
|
children: " "
|
|
83409
83884
|
}, undefined, false, undefined, this)
|
|
83410
83885
|
]
|
|
83411
83886
|
}, undefined, true, undefined, this);
|
|
83412
83887
|
}
|
|
83888
|
+
const sp = speaker();
|
|
83413
83889
|
const text = turn.text.slice(row.start, row.end);
|
|
83414
83890
|
const fg = turn.role === "user" ? tokens.text : C.fgMuted;
|
|
83415
|
-
const railFg = turn.role === "user" ?
|
|
83891
|
+
const railFg = turn.role === "user" ? sp.you : sp.ai;
|
|
83416
83892
|
const pad2 = Math.max(0, width - GUTTER - displayWidth(text));
|
|
83417
83893
|
return /* @__PURE__ */ jsxDEV19("text", {
|
|
83418
83894
|
children: [
|
|
@@ -83422,7 +83898,7 @@ function ReaderRow({
|
|
|
83422
83898
|
}, undefined, false, undefined, this),
|
|
83423
83899
|
row.first ? /* @__PURE__ */ jsxDEV19(BadgeSpan, {
|
|
83424
83900
|
label: turn.role === "user" ? "you" : "ai",
|
|
83425
|
-
bg: turn.role === "user" ?
|
|
83901
|
+
bg: turn.role === "user" ? sp.you : sp.ai,
|
|
83426
83902
|
width: ROLE_W
|
|
83427
83903
|
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV19("span", {
|
|
83428
83904
|
children: " ".repeat(ROLE_W)
|
|
@@ -83435,7 +83911,7 @@ function ReaderRow({
|
|
|
83435
83911
|
children: " ".repeat(pad2)
|
|
83436
83912
|
}, undefined, false, undefined, this),
|
|
83437
83913
|
/* @__PURE__ */ jsxDEV19("span", {
|
|
83438
|
-
bg:
|
|
83914
|
+
bg: barColor(bar),
|
|
83439
83915
|
children: " "
|
|
83440
83916
|
}, undefined, false, undefined, this)
|
|
83441
83917
|
]
|
|
@@ -83456,7 +83932,7 @@ function highlighted(text, hl, current, fg) {
|
|
|
83456
83932
|
}, `p${i}`, false, undefined, this));
|
|
83457
83933
|
const bg = hit === current ? tokens.accent : tokens.warn;
|
|
83458
83934
|
out.push(/* @__PURE__ */ jsxDEV19("span", {
|
|
83459
|
-
fg: tokens.ink,
|
|
83935
|
+
fg: pickInk(bg, tokens.ink, C.ink),
|
|
83460
83936
|
bg,
|
|
83461
83937
|
attributes: A.bold,
|
|
83462
83938
|
children: text.slice(start, e)
|
|
@@ -83472,9 +83948,11 @@ function highlighted(text, hl, current, fg) {
|
|
|
83472
83948
|
children: out
|
|
83473
83949
|
}, undefined, false, undefined, this);
|
|
83474
83950
|
}
|
|
83475
|
-
var RAIL = "\u258D", RAIL_W = 2, ROLE_W = 6, GUTTER, BAR_W = 1, SPEAKER, MAX_MATCHES = 5000, EMPTY_SEARCH, NO_TURNS
|
|
83951
|
+
var RAIL = "\u258D", RAIL_W = 2, ROLE_W = 6, GUTTER, BAR_W = 1, SPEAKER, SPEAKER_LIGHT, MAX_MATCHES = 5000, EMPTY_SEARCH, NO_TURNS;
|
|
83476
83952
|
var init_conversation_reader = __esm(() => {
|
|
83953
|
+
init_theme_mode();
|
|
83477
83954
|
init_theme2();
|
|
83955
|
+
init_color();
|
|
83478
83956
|
init_text();
|
|
83479
83957
|
init_tokens();
|
|
83480
83958
|
init_widgets();
|
|
@@ -83485,13 +83963,12 @@ var init_conversation_reader = __esm(() => {
|
|
|
83485
83963
|
you: "#39d353",
|
|
83486
83964
|
ai: "#39c5cf"
|
|
83487
83965
|
};
|
|
83966
|
+
SPEAKER_LIGHT = {
|
|
83967
|
+
you: "#2da44e",
|
|
83968
|
+
ai: "#0891b2"
|
|
83969
|
+
};
|
|
83488
83970
|
EMPTY_SEARCH = { hits: [], ranges: new Map, capped: false };
|
|
83489
83971
|
NO_TURNS = [];
|
|
83490
|
-
BAR_COLOR = {
|
|
83491
|
-
track: tokens.border,
|
|
83492
|
-
thumb: tokens.accent,
|
|
83493
|
-
hit: tokens.warn
|
|
83494
|
-
};
|
|
83495
83972
|
});
|
|
83496
83973
|
|
|
83497
83974
|
// src/session/resume-picker.tsx
|
|
@@ -83524,6 +84001,15 @@ function age(ms) {
|
|
|
83524
84001
|
return `${h}h`;
|
|
83525
84002
|
return `${Math.floor(h / 24)}d`;
|
|
83526
84003
|
}
|
|
84004
|
+
function ghLevels() {
|
|
84005
|
+
return getThemeMode() === "light" ? GH_LEVELS_LIGHT : GH_LEVELS;
|
|
84006
|
+
}
|
|
84007
|
+
function chips() {
|
|
84008
|
+
return getThemeMode() === "light" ? CHIP_LIGHT : CHIP;
|
|
84009
|
+
}
|
|
84010
|
+
function hereFg() {
|
|
84011
|
+
return ghLevels()[4];
|
|
84012
|
+
}
|
|
83527
84013
|
function chipW(label) {
|
|
83528
84014
|
return label + 2;
|
|
83529
84015
|
}
|
|
@@ -83550,6 +84036,9 @@ function Slot({
|
|
|
83550
84036
|
bg
|
|
83551
84037
|
}, undefined, false, undefined, this);
|
|
83552
84038
|
}
|
|
84039
|
+
function muted() {
|
|
84040
|
+
return C.fgMuted;
|
|
84041
|
+
}
|
|
83553
84042
|
function WorktreeRow({
|
|
83554
84043
|
g,
|
|
83555
84044
|
cursor,
|
|
@@ -83562,35 +84051,36 @@ function WorktreeRow({
|
|
|
83562
84051
|
const room = Math.max(0, width - blockWidth(cols));
|
|
83563
84052
|
const series = room >= SPARK_MIN_DAYS ? activitySeries(g.sessions, room) : null;
|
|
83564
84053
|
const spark = series && hasActivity(series) ? series : null;
|
|
83565
|
-
const
|
|
84054
|
+
const chip = chips();
|
|
84055
|
+
const run = [];
|
|
83566
84056
|
if (cols.sync > 0 && g.ahead) {
|
|
83567
|
-
|
|
84057
|
+
run.push({
|
|
83568
84058
|
label: `\u2191${padStartTo(String(g.ahead), cols.sync)}`,
|
|
83569
|
-
bg:
|
|
84059
|
+
bg: chip.ahead,
|
|
83570
84060
|
labelW: cols.sync + 1
|
|
83571
84061
|
});
|
|
83572
84062
|
}
|
|
83573
84063
|
if (cols.sync > 0 && g.behind) {
|
|
83574
|
-
|
|
84064
|
+
run.push({
|
|
83575
84065
|
label: `\u2193${padStartTo(String(g.behind), cols.sync)}`,
|
|
83576
|
-
bg:
|
|
84066
|
+
bg: chip.behind,
|
|
83577
84067
|
labelW: cols.sync + 1
|
|
83578
84068
|
});
|
|
83579
84069
|
}
|
|
83580
84070
|
if (cols.dirty > 0 && g.dirty) {
|
|
83581
|
-
|
|
84071
|
+
run.push({
|
|
83582
84072
|
label: `${DIRTY_GLYPH}${padStartTo(String(g.dirty), cols.dirty)}`,
|
|
83583
|
-
bg:
|
|
84073
|
+
bg: chip.dirty,
|
|
83584
84074
|
labelW: cols.dirty + 1
|
|
83585
84075
|
});
|
|
83586
84076
|
}
|
|
83587
|
-
|
|
83588
|
-
|
|
84077
|
+
run.push({ label: padStartTo(String(count), cols.count), bg: chip.count, labelW: cols.count });
|
|
84078
|
+
run.push({
|
|
83589
84079
|
label: padStartTo(g.lastActiveMs ? age(g.lastActiveMs) : "\u2014", cols.age),
|
|
83590
|
-
bg: stale ?
|
|
84080
|
+
bg: stale ? chip.stale : chip.fresh,
|
|
83591
84081
|
labelW: cols.age
|
|
83592
84082
|
});
|
|
83593
|
-
const used =
|
|
84083
|
+
const used = run.reduce((w, c) => w + c.labelW + 2, 0) + LIVE_W;
|
|
83594
84084
|
const gap = Math.max(0, width - room - used);
|
|
83595
84085
|
return /* @__PURE__ */ jsxDEV20("box", {
|
|
83596
84086
|
flexDirection: "column",
|
|
@@ -83610,7 +84100,7 @@ function WorktreeRow({
|
|
|
83610
84100
|
children: [
|
|
83611
84101
|
spark ? /* @__PURE__ */ jsxDEV20(SparklineSpan, {
|
|
83612
84102
|
values: spark,
|
|
83613
|
-
fg:
|
|
84103
|
+
fg: sparkFg()
|
|
83614
84104
|
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV20("span", {
|
|
83615
84105
|
children: " ".repeat(room)
|
|
83616
84106
|
}, undefined, false, undefined, this),
|
|
@@ -83621,7 +84111,7 @@ function WorktreeRow({
|
|
|
83621
84111
|
fg: tokens.success,
|
|
83622
84112
|
children: g.activeNow ? "\u25CF " : " "
|
|
83623
84113
|
}, undefined, false, undefined, this),
|
|
83624
|
-
|
|
84114
|
+
run.map((c) => /* @__PURE__ */ jsxDEV20(Slot, {
|
|
83625
84115
|
label: c.label,
|
|
83626
84116
|
bg: c.bg,
|
|
83627
84117
|
labelW: c.labelW
|
|
@@ -83632,6 +84122,12 @@ function WorktreeRow({
|
|
|
83632
84122
|
]
|
|
83633
84123
|
}, undefined, true, undefined, this);
|
|
83634
84124
|
}
|
|
84125
|
+
function scrollbarOptions() {
|
|
84126
|
+
return {
|
|
84127
|
+
showArrows: false,
|
|
84128
|
+
trackOptions: { backgroundColor: tokens.bgPanel, foregroundColor: tokens.border }
|
|
84129
|
+
};
|
|
84130
|
+
}
|
|
83635
84131
|
function dailyActivity(groups, days) {
|
|
83636
84132
|
const day = 86400000;
|
|
83637
84133
|
const today = Math.floor(Date.now() / day);
|
|
@@ -83660,6 +84156,7 @@ function ActivityCalendar({
|
|
|
83660
84156
|
width
|
|
83661
84157
|
}) {
|
|
83662
84158
|
const levels = activityLevels(days);
|
|
84159
|
+
const scale = ghLevels();
|
|
83663
84160
|
const title = `activity \xB7 ${ACTIVITY_WEEKS}w `;
|
|
83664
84161
|
const grid = Math.max(WEEK_DAYS, width - WEEK_LABEL_W);
|
|
83665
84162
|
const base = Math.floor(grid / WEEK_DAYS);
|
|
@@ -83691,7 +84188,7 @@ function ActivityCalendar({
|
|
|
83691
84188
|
children: padTo(ago === 0 ? "now" : `-${ago}w`, WEEK_LABEL_W)
|
|
83692
84189
|
}, undefined, false, undefined, this),
|
|
83693
84190
|
Array.from({ length: WEEK_DAYS }, (_2, d) => /* @__PURE__ */ jsxDEV20("span", {
|
|
83694
|
-
bg:
|
|
84191
|
+
bg: scale[levels[w * WEEK_DAYS + d] ?? 0],
|
|
83695
84192
|
children: " ".repeat(base + (d < extra ? 1 : 0))
|
|
83696
84193
|
}, d, false, undefined, this))
|
|
83697
84194
|
]
|
|
@@ -83725,6 +84222,9 @@ function SectionHeader({ label, width }) {
|
|
|
83725
84222
|
]
|
|
83726
84223
|
}, undefined, true, undefined, this);
|
|
83727
84224
|
}
|
|
84225
|
+
function sparkFg() {
|
|
84226
|
+
return getThemeMode() === "light" ? SPARK_FG_LIGHT : SPARK_FG;
|
|
84227
|
+
}
|
|
83728
84228
|
function hasActivity(series) {
|
|
83729
84229
|
return series.some((v) => v > 0);
|
|
83730
84230
|
}
|
|
@@ -83780,7 +84280,7 @@ function SessionRowView({
|
|
|
83780
84280
|
}, undefined, false, undefined, this),
|
|
83781
84281
|
/* @__PURE__ */ jsxDEV20(BadgeSpan, {
|
|
83782
84282
|
label: padStartTo(age(row.mtimeMs), SESSION_AGE_W),
|
|
83783
|
-
bg: Date.now() - row.mtimeMs < STALE_MS ?
|
|
84283
|
+
bg: Date.now() - row.mtimeMs < STALE_MS ? chips().fresh : chips().stale,
|
|
83784
84284
|
width: SESSION_AGE_COL
|
|
83785
84285
|
}, undefined, false, undefined, this),
|
|
83786
84286
|
/* @__PURE__ */ jsxDEV20(MeterSpan, {
|
|
@@ -83789,7 +84289,7 @@ function SessionRowView({
|
|
|
83789
84289
|
ramp: ramps.volume
|
|
83790
84290
|
}, undefined, false, undefined, this),
|
|
83791
84291
|
/* @__PURE__ */ jsxDEV20("span", {
|
|
83792
|
-
fg:
|
|
84292
|
+
fg: muted(),
|
|
83793
84293
|
children: padStartTo(size, SIZE_COL)
|
|
83794
84294
|
}, undefined, false, undefined, this),
|
|
83795
84295
|
row.gitBranch ? /* @__PURE__ */ jsxDEV20("span", {
|
|
@@ -84082,7 +84582,7 @@ function ResumePicker({ groups, onDone }) {
|
|
|
84082
84582
|
/* @__PURE__ */ jsxDEV20("scrollbox", {
|
|
84083
84583
|
focused: false,
|
|
84084
84584
|
flexGrow: 1,
|
|
84085
|
-
scrollbarOptions:
|
|
84585
|
+
scrollbarOptions: scrollbarOptions(),
|
|
84086
84586
|
children: [
|
|
84087
84587
|
fresh.map((g, i) => /* @__PURE__ */ jsxDEV20(WorktreeRow, {
|
|
84088
84588
|
g,
|
|
@@ -84126,7 +84626,7 @@ function ResumePicker({ groups, onDone }) {
|
|
|
84126
84626
|
children: /* @__PURE__ */ jsxDEV20("scrollbox", {
|
|
84127
84627
|
focused: false,
|
|
84128
84628
|
flexGrow: 1,
|
|
84129
|
-
scrollbarOptions:
|
|
84629
|
+
scrollbarOptions: scrollbarOptions(),
|
|
84130
84630
|
children: items.length === 0 ? /* @__PURE__ */ jsxDEV20("text", {
|
|
84131
84631
|
fg: tokens.subtle,
|
|
84132
84632
|
children: " no sessions match"
|
|
@@ -84247,17 +84747,18 @@ function WorktreeDetail({
|
|
|
84247
84747
|
children: "no worktree selected"
|
|
84248
84748
|
}, undefined, false, undefined, this);
|
|
84249
84749
|
const L = 9;
|
|
84750
|
+
const chip = chips();
|
|
84250
84751
|
const badges = [];
|
|
84251
84752
|
if (group.dirty !== undefined) {
|
|
84252
84753
|
badges.push({
|
|
84253
84754
|
label: group.dirty > 0 ? `${DIRTY_GLYPH}${group.dirty} uncommitted` : "clean",
|
|
84254
|
-
bg: group.dirty > 0 ?
|
|
84755
|
+
bg: group.dirty > 0 ? chip.dirty : chip.clean
|
|
84255
84756
|
});
|
|
84256
84757
|
}
|
|
84257
84758
|
if (group.ahead)
|
|
84258
|
-
badges.push({ label: `\u2191${group.ahead}`, bg:
|
|
84759
|
+
badges.push({ label: `\u2191${group.ahead}`, bg: chip.ahead });
|
|
84259
84760
|
if (group.behind)
|
|
84260
|
-
badges.push({ label: `\u2193${group.behind}`, bg:
|
|
84761
|
+
badges.push({ label: `\u2193${group.behind}`, bg: chip.behind });
|
|
84261
84762
|
const badgeW = badges.reduce((w, b) => w + displayWidth(b.label) + 2, 0);
|
|
84262
84763
|
const marker = group.current ? " \u25B6 you are here" : !group.live ? " worktree deleted" : "";
|
|
84263
84764
|
const branch = group.branch ?? (group.live ? "detached" : "\u2014");
|
|
@@ -84283,7 +84784,7 @@ function WorktreeDetail({
|
|
|
84283
84784
|
children: truncate3(group.name, nameW)
|
|
84284
84785
|
}, undefined, false, undefined, this),
|
|
84285
84786
|
/* @__PURE__ */ jsxDEV20("span", {
|
|
84286
|
-
fg: group.current ?
|
|
84787
|
+
fg: group.current ? hereFg() : tokens.dead,
|
|
84287
84788
|
children: marker
|
|
84288
84789
|
}, undefined, false, undefined, this),
|
|
84289
84790
|
/* @__PURE__ */ jsxDEV20("span", {
|
|
@@ -84316,7 +84817,7 @@ function WorktreeDetail({
|
|
|
84316
84817
|
}, undefined, false, undefined, this),
|
|
84317
84818
|
/* @__PURE__ */ jsxDEV20(Sparkline, {
|
|
84318
84819
|
values: hasActivity(spark) ? spark : [],
|
|
84319
|
-
fg:
|
|
84820
|
+
fg: sparkFg()
|
|
84320
84821
|
}, undefined, false, undefined, this),
|
|
84321
84822
|
/* @__PURE__ */ jsxDEV20("text", {
|
|
84322
84823
|
fg: tokens.trace,
|
|
@@ -84394,6 +84895,7 @@ function Conversation({
|
|
|
84394
84895
|
}, undefined, false, undefined, this);
|
|
84395
84896
|
}
|
|
84396
84897
|
const ROLE_W2 = 6;
|
|
84898
|
+
const sp = speaker();
|
|
84397
84899
|
const textW = Math.max(10, width - ROLE_W2 - 2);
|
|
84398
84900
|
const shown = turns.slice(-max);
|
|
84399
84901
|
return /* @__PURE__ */ jsxDEV20("box", {
|
|
@@ -84408,19 +84910,20 @@ function Conversation({
|
|
|
84408
84910
|
}, undefined, false, undefined, this),
|
|
84409
84911
|
/* @__PURE__ */ jsxDEV20(BadgeSpan, {
|
|
84410
84912
|
label: t.role === "user" ? "you" : "ai",
|
|
84411
|
-
bg: t.role === "user" ?
|
|
84913
|
+
bg: t.role === "user" ? sp.you : sp.ai,
|
|
84412
84914
|
width: ROLE_W2
|
|
84413
84915
|
}, undefined, false, undefined, this),
|
|
84414
84916
|
/* @__PURE__ */ jsxDEV20("span", {
|
|
84415
|
-
fg: t.role === "user" ? tokens.text :
|
|
84917
|
+
fg: t.role === "user" ? tokens.text : muted(),
|
|
84416
84918
|
children: truncate3(t.text, textW)
|
|
84417
84919
|
}, undefined, false, undefined, this)
|
|
84418
84920
|
]
|
|
84419
84921
|
}, `${i}-${t.text.slice(0, 12)}`, true, undefined, this))
|
|
84420
84922
|
}, undefined, false, undefined, this);
|
|
84421
84923
|
}
|
|
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,
|
|
84924
|
+
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
84925
|
var init_resume_picker = __esm(() => {
|
|
84926
|
+
init_theme_mode();
|
|
84424
84927
|
init_theme2();
|
|
84425
84928
|
init_text();
|
|
84426
84929
|
init_tokens();
|
|
@@ -84430,6 +84933,7 @@ var init_resume_picker = __esm(() => {
|
|
|
84430
84933
|
init_session_discovery();
|
|
84431
84934
|
STALE_MS = 3 * 86400000;
|
|
84432
84935
|
GH_LEVELS = ["#21262d", "#0e4429", "#006d32", "#26a641", "#39d353"];
|
|
84936
|
+
GH_LEVELS_LIGHT = ["#d0d7de", "#9be9a8", "#40c463", "#30a14e", "#216e39"];
|
|
84433
84937
|
CHIP = {
|
|
84434
84938
|
fresh: GH_LEVELS[4],
|
|
84435
84939
|
stale: "#a1a9b3",
|
|
@@ -84439,14 +84943,17 @@ var init_resume_picker = __esm(() => {
|
|
|
84439
84943
|
ahead: "#bc8cff",
|
|
84440
84944
|
behind: "#d2a8ff"
|
|
84441
84945
|
};
|
|
84442
|
-
|
|
84946
|
+
CHIP_LIGHT = {
|
|
84947
|
+
fresh: GH_LEVELS_LIGHT[3],
|
|
84948
|
+
stale: "#818b98",
|
|
84949
|
+
count: "#218bff",
|
|
84950
|
+
dirty: "#bf8700",
|
|
84951
|
+
clean: GH_LEVELS_LIGHT[2],
|
|
84952
|
+
ahead: "#a475f9",
|
|
84953
|
+
behind: "#b88aff"
|
|
84954
|
+
};
|
|
84443
84955
|
SESSION_AGE_COL = SESSION_AGE_W + 3;
|
|
84444
84956
|
SIZE_FLOOR_BYTES = 16 * 1024;
|
|
84445
|
-
MUTED = C.fgMuted;
|
|
84446
|
-
SCROLLBAR = {
|
|
84447
|
-
showArrows: false,
|
|
84448
|
-
trackOptions: { backgroundColor: tokens.bgPanel, foregroundColor: tokens.border }
|
|
84449
|
-
};
|
|
84450
84957
|
ACTIVITY_H = 2 + ACTIVITY_WEEKS;
|
|
84451
84958
|
});
|
|
84452
84959
|
|
|
@@ -84468,9 +84975,10 @@ async function runResumePicker(cwd = process.cwd()) {
|
|
|
84468
84975
|
await enrichWorktreeGit(groups, repo.root);
|
|
84469
84976
|
setStderrQuiet(true);
|
|
84470
84977
|
const renderer = await createCliRenderer3({
|
|
84471
|
-
|
|
84978
|
+
screenMode: "alternate-screen",
|
|
84472
84979
|
exitOnCtrlC: false
|
|
84473
84980
|
});
|
|
84981
|
+
await applyRendererThemeMode(renderer);
|
|
84474
84982
|
const root = createRoot3(renderer);
|
|
84475
84983
|
let chosen = null;
|
|
84476
84984
|
try {
|
|
@@ -84501,6 +85009,7 @@ async function runResumePicker(cwd = process.cwd()) {
|
|
|
84501
85009
|
}
|
|
84502
85010
|
var init_resume_picker_run = __esm(() => {
|
|
84503
85011
|
init_logger();
|
|
85012
|
+
init_renderer_theme();
|
|
84504
85013
|
init_resume_picker();
|
|
84505
85014
|
init_session_discovery();
|
|
84506
85015
|
});
|
|
@@ -84631,7 +85140,7 @@ function bg(hex4) {
|
|
|
84631
85140
|
return `\x1B[48;2;${r};${g};${b}m`;
|
|
84632
85141
|
}
|
|
84633
85142
|
function paint(text, hex4, bold4 = false) {
|
|
84634
|
-
return `${bold4 ?
|
|
85143
|
+
return `${bold4 ? BOLD4 : ""}${fg(hex4)}${text}${RESET3}`;
|
|
84635
85144
|
}
|
|
84636
85145
|
function meter(pct, width, ramp = ramps.load) {
|
|
84637
85146
|
const cells = Math.floor(width);
|
|
@@ -84651,7 +85160,7 @@ function meter(pct, width, ramp = ramps.load) {
|
|
|
84651
85160
|
}
|
|
84652
85161
|
out += i < filled ? FILL2 : TRACK2;
|
|
84653
85162
|
}
|
|
84654
|
-
return out +
|
|
85163
|
+
return out + RESET3;
|
|
84655
85164
|
}
|
|
84656
85165
|
function stackedBar(segments, width) {
|
|
84657
85166
|
const cells = Math.floor(width);
|
|
@@ -84666,10 +85175,10 @@ function stackedBar(segments, width) {
|
|
|
84666
85175
|
if (n > 0)
|
|
84667
85176
|
out += `${bg(segments[i].color)}${" ".repeat(n)}`;
|
|
84668
85177
|
}
|
|
84669
|
-
return out +
|
|
85178
|
+
return out + RESET3;
|
|
84670
85179
|
}
|
|
84671
85180
|
function badge(label, hex4) {
|
|
84672
|
-
return `${
|
|
85181
|
+
return `${BOLD4}${fg(pickInk(hex4, tokens.ink, C.ink))}${bg(hex4)} ${label} ${RESET3}`;
|
|
84673
85182
|
}
|
|
84674
85183
|
function stripAnsi4(s) {
|
|
84675
85184
|
return s.replace(ANSI_RE3, "");
|
|
@@ -84702,7 +85211,7 @@ function clipStyled(s, width) {
|
|
|
84702
85211
|
w += cw;
|
|
84703
85212
|
i += ch.length;
|
|
84704
85213
|
}
|
|
84705
|
-
return out +
|
|
85214
|
+
return out + RESET3;
|
|
84706
85215
|
}
|
|
84707
85216
|
function padVisible2(s, width, align = "left") {
|
|
84708
85217
|
const clipped = clipStyled(s, width);
|
|
@@ -84744,8 +85253,9 @@ function usd(n) {
|
|
|
84744
85253
|
return `$${n.toFixed(3)}`;
|
|
84745
85254
|
return `$${n.toFixed(2)}`;
|
|
84746
85255
|
}
|
|
84747
|
-
var
|
|
85256
|
+
var RESET3 = "\x1B[0m", BOLD4 = "\x1B[1m", FILL2 = "\u2588", TRACK2 = "\u2591", NODATA2 = "\u254C", ANSI_RE3;
|
|
84748
85257
|
var init_ansi_viz = __esm(() => {
|
|
85258
|
+
init_theme2();
|
|
84749
85259
|
init_color();
|
|
84750
85260
|
init_text();
|
|
84751
85261
|
init_tokens();
|
|
@@ -84759,6 +85269,12 @@ __export(exports_session_summary, {
|
|
|
84759
85269
|
renderSessionSummary: () => renderSessionSummary,
|
|
84760
85270
|
printSessionSummary: () => printSessionSummary
|
|
84761
85271
|
});
|
|
85272
|
+
function toolColors() {
|
|
85273
|
+
return [C.blue, C.cyan, "#8a7d1e", "#1f6d75", C.magenta, "#2d6e3e", C.orange];
|
|
85274
|
+
}
|
|
85275
|
+
function toolOther() {
|
|
85276
|
+
return C.dim;
|
|
85277
|
+
}
|
|
84762
85278
|
function cardWidth() {
|
|
84763
85279
|
const cols = process.stdout.columns || 80;
|
|
84764
85280
|
return Math.max(MIN_W, Math.min(MAX_W, cols - 2));
|
|
@@ -84778,15 +85294,15 @@ function renderSessionSummary(input) {
|
|
|
84778
85294
|
out.push(`${paint("\u2502", tokens.border)} ${padVisible2(s, inner)} ${paint("\u2502", tokens.border)}`);
|
|
84779
85295
|
};
|
|
84780
85296
|
const blank = () => row("");
|
|
84781
|
-
const
|
|
85297
|
+
const chips2 = [badge(truncate3(modelSpec, 34), tokens.accent)];
|
|
84782
85298
|
if (stats.isFree)
|
|
84783
|
-
|
|
85299
|
+
chips2.push(badge("FREE", C.pillKeyBg));
|
|
84784
85300
|
else if (stats.isEstimated)
|
|
84785
|
-
|
|
85301
|
+
chips2.push(badge("EST", "#8a7d1e"));
|
|
84786
85302
|
if (exitCode !== 0)
|
|
84787
|
-
|
|
85303
|
+
chips2.push(badge(`EXIT ${exitCode}`, "#9e2b2b"));
|
|
84788
85304
|
const right = body(duration3(stats.durationMs));
|
|
84789
|
-
const left = clipStyled(
|
|
85305
|
+
const left = clipStyled(chips2.join(" "), Math.max(0, inner - visibleWidth(right) - 1));
|
|
84790
85306
|
const gap = Math.max(1, inner - visibleWidth(left) - visibleWidth(right));
|
|
84791
85307
|
row(left + " ".repeat(gap) + right);
|
|
84792
85308
|
if (stats.providerName)
|
|
@@ -84812,13 +85328,15 @@ function renderSessionSummary(input) {
|
|
|
84812
85328
|
], barW), dim3("in ") + body(usd(stats.inputCostUsd)) + dim3(" out ") + body(usd(stats.outputCostUsd)));
|
|
84813
85329
|
}
|
|
84814
85330
|
if (stats.toolCallTotal > 0) {
|
|
84815
|
-
const
|
|
84816
|
-
const
|
|
84817
|
-
const
|
|
85331
|
+
const toolCols = toolColors();
|
|
85332
|
+
const other = toolOther();
|
|
85333
|
+
const shown = stats.toolCalls.slice(0, toolCols.length);
|
|
85334
|
+
const rest = stats.toolCalls.slice(toolCols.length).reduce((a, t) => a + t.count, 0);
|
|
85335
|
+
const segs = shown.map((t, i) => ({ value: t.count, color: toolCols[i] }));
|
|
84818
85336
|
if (rest > 0)
|
|
84819
|
-
segs.push({ value: rest, color:
|
|
85337
|
+
segs.push({ value: rest, color: other });
|
|
84820
85338
|
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}`,
|
|
85339
|
+
const legend = shown.map((t, i) => paint(`${t.name} ${t.count}`, toolCols[i])).concat(rest > 0 ? [paint(`other ${rest}`, other)] : []);
|
|
84822
85340
|
for (const line of wrapStyled(legend, dim3(" \xB7 "), inner - LABEL_W)) {
|
|
84823
85341
|
row(" ".repeat(LABEL_W) + line);
|
|
84824
85342
|
}
|
|
@@ -84843,12 +85361,12 @@ function renderSessionSummary(input) {
|
|
|
84843
85361
|
}
|
|
84844
85362
|
return out;
|
|
84845
85363
|
}
|
|
84846
|
-
function wrapStyled(
|
|
85364
|
+
function wrapStyled(chips2, sep, width) {
|
|
84847
85365
|
const lines = [];
|
|
84848
85366
|
let cur = "";
|
|
84849
85367
|
let curW = 0;
|
|
84850
85368
|
const sepW = visibleWidth(sep);
|
|
84851
|
-
for (const chip of
|
|
85369
|
+
for (const chip of chips2) {
|
|
84852
85370
|
const w = visibleWidth(chip);
|
|
84853
85371
|
if (cur && curW + sepW + w > width) {
|
|
84854
85372
|
lines.push(cur);
|
|
@@ -84866,24 +85384,14 @@ function wrapStyled(chips, sep, width) {
|
|
|
84866
85384
|
function printSessionSummary(input, write) {
|
|
84867
85385
|
for (const line of renderSessionSummary(input))
|
|
84868
85386
|
write(line);
|
|
84869
|
-
write(
|
|
85387
|
+
write(RESET3);
|
|
84870
85388
|
}
|
|
84871
|
-
var
|
|
85389
|
+
var MIN_W = 62, MAX_W = 96, CHROME = 4, LABEL_W = 10;
|
|
84872
85390
|
var init_session_summary = __esm(() => {
|
|
84873
85391
|
init_theme2();
|
|
84874
85392
|
init_text();
|
|
84875
85393
|
init_tokens();
|
|
84876
85394
|
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
85395
|
});
|
|
84888
85396
|
|
|
84889
85397
|
// src/index.ts
|
|
@@ -85101,8 +85609,11 @@ if (isMcpMode) {
|
|
|
85101
85609
|
} else if (isConfigCommand) {
|
|
85102
85610
|
traceSpan("startup:tui-import", () => Promise.resolve().then(() => (init_tui(), exports_tui))).then(async (m) => {
|
|
85103
85611
|
const { credentials: credentials2 } = await Promise.resolve().then(() => (init_authority(), exports_authority));
|
|
85104
|
-
const {
|
|
85105
|
-
|
|
85612
|
+
const { ensureEndpointsRegistered: ensureEndpointsRegistered2 } = await Promise.resolve().then(() => (init_endpoint_registration(), exports_endpoint_registration));
|
|
85613
|
+
ensureEndpointsRegistered2();
|
|
85614
|
+
const { getProviderDefs: getProviderDefs2 } = await Promise.resolve().then(() => (init_providers(), exports_providers));
|
|
85615
|
+
const tuiProviders = getProviderDefs2();
|
|
85616
|
+
await traceSpan("startup:credential-resolution", () => Promise.all(tuiProviders.map((p) => credentials2.isAvailable(p.catalogName, { allowOpPrompt: true }))), { providers: tuiProviders.length });
|
|
85106
85617
|
finalizeStartupTrace("config");
|
|
85107
85618
|
suppressStartupTraceTerminalOutput();
|
|
85108
85619
|
return m.startConfigTui().catch(handlePromptExit);
|
|
@@ -85137,6 +85648,10 @@ async function runCli() {
|
|
|
85137
85648
|
return Buffer.concat(chunks).toString("utf-8");
|
|
85138
85649
|
}
|
|
85139
85650
|
try {
|
|
85651
|
+
await traceSpan("startup:theme-detect", async () => {
|
|
85652
|
+
const { detectAndSetThemeMode: detectAndSetThemeMode2 } = await Promise.resolve().then(() => (init_theme_mode(), exports_theme_mode));
|
|
85653
|
+
await detectAndSetThemeMode2();
|
|
85654
|
+
});
|
|
85140
85655
|
const cliConfig = await traceSpan("startup:parse-args", () => parseArgs2(process.argv.slice(2)));
|
|
85141
85656
|
await traceSpan("startup:endpoint-registration", async () => {
|
|
85142
85657
|
const { ensureEndpointsRegistered: ensureEndpointsRegistered2 } = await Promise.resolve().then(() => (init_endpoint_registration(), exports_endpoint_registration));
|