claudish 7.62.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 +160 -78
- package/package.json +5 -5
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();
|
|
@@ -55806,7 +55875,7 @@ __export(exports_providers, {
|
|
|
55806
55875
|
providerAuthSource: () => providerAuthSource,
|
|
55807
55876
|
providerAuthCapabilities: () => providerAuthCapabilities,
|
|
55808
55877
|
maskKey: () => maskKey2,
|
|
55809
|
-
|
|
55878
|
+
getProviderDefs: () => getProviderDefs
|
|
55810
55879
|
});
|
|
55811
55880
|
function toProviderDef(def) {
|
|
55812
55881
|
return {
|
|
@@ -55846,6 +55915,9 @@ function providerAuthCapabilities(p, config3) {
|
|
|
55846
55915
|
oauth: { supported: oauthSupported, set: oauthSet }
|
|
55847
55916
|
};
|
|
55848
55917
|
}
|
|
55918
|
+
function getProviderDefs() {
|
|
55919
|
+
return getAllProviders().filter((d) => !SKIP.has(d.name)).map(toProviderDef);
|
|
55920
|
+
}
|
|
55849
55921
|
function maskKey2(key) {
|
|
55850
55922
|
if (!key)
|
|
55851
55923
|
return "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500";
|
|
@@ -55853,7 +55925,7 @@ function maskKey2(key) {
|
|
|
55853
55925
|
return "**** ";
|
|
55854
55926
|
return `${key.slice(0, 3)}\u2022\u2022${key.slice(-3)}`;
|
|
55855
55927
|
}
|
|
55856
|
-
var SKIP
|
|
55928
|
+
var SKIP;
|
|
55857
55929
|
var init_providers = __esm(() => {
|
|
55858
55930
|
init_antigravity_token();
|
|
55859
55931
|
init_source();
|
|
@@ -55861,7 +55933,6 @@ var init_providers = __esm(() => {
|
|
|
55861
55933
|
init_devin_credentials();
|
|
55862
55934
|
init_provider_definitions();
|
|
55863
55935
|
SKIP = new Set(["qwen", "native-anthropic"]);
|
|
55864
|
-
PROVIDERS = getAllProviders().filter((d) => !SKIP.has(d.name)).map(toProviderDef);
|
|
55865
55936
|
});
|
|
55866
55937
|
|
|
55867
55938
|
// src/providers-command.ts
|
|
@@ -55871,7 +55942,8 @@ __export(exports_providers_command, {
|
|
|
55871
55942
|
collectProviderStatuses: () => collectProviderStatuses
|
|
55872
55943
|
});
|
|
55873
55944
|
async function collectProviderStatuses(config3 = loadConfig()) {
|
|
55874
|
-
|
|
55945
|
+
ensureEndpointsRegistered();
|
|
55946
|
+
return Promise.all(getProviderDefs().map(async (p) => {
|
|
55875
55947
|
const authSource = await describeSource(p, config3);
|
|
55876
55948
|
return {
|
|
55877
55949
|
slug: p.catalogName,
|
|
@@ -55895,6 +55967,7 @@ async function providersCommand(opts) {
|
|
|
55895
55967
|
var init_providers_command = __esm(() => {
|
|
55896
55968
|
init_source();
|
|
55897
55969
|
init_profile_config();
|
|
55970
|
+
init_endpoint_registration();
|
|
55898
55971
|
init_providers();
|
|
55899
55972
|
});
|
|
55900
55973
|
|
|
@@ -75055,7 +75128,17 @@ var init_probe_catalog = __esm(() => {
|
|
|
75055
75128
|
});
|
|
75056
75129
|
|
|
75057
75130
|
// src/tui/constants.ts
|
|
75058
|
-
|
|
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;
|
|
75059
75142
|
var init_constants3 = __esm(() => {
|
|
75060
75143
|
init_providers();
|
|
75061
75144
|
COMMON_MODELS = [
|
|
@@ -75077,12 +75160,6 @@ var init_constants3 = __esm(() => {
|
|
|
75077
75160
|
"or@x-ai/grok-code-fast-1",
|
|
75078
75161
|
"or@deepseek/deepseek-r1"
|
|
75079
75162
|
];
|
|
75080
|
-
PROVIDER_PREFIXES = PROVIDERS.map((p) => ({
|
|
75081
|
-
prefix: p.aliases?.[0] ? `${p.aliases[0]}@` : `${p.name}@`,
|
|
75082
|
-
displayName: p.displayName,
|
|
75083
|
-
name: p.name
|
|
75084
|
-
}));
|
|
75085
|
-
CHAIN_PROVIDERS = PROVIDERS;
|
|
75086
75163
|
});
|
|
75087
75164
|
|
|
75088
75165
|
// src/tui/components/Footer.tsx
|
|
@@ -76863,8 +76940,9 @@ function ProfilesContent({
|
|
|
76863
76940
|
{ name: "global ~/.claudish/config.json", description: "", value: "global" },
|
|
76864
76941
|
{ name: "project ./.claudish.json", description: "", value: "project" }
|
|
76865
76942
|
];
|
|
76866
|
-
const
|
|
76867
|
-
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) => ({
|
|
76868
76946
|
name: `${p.prefix.padEnd(prefixColW)}${p.displayName}`,
|
|
76869
76947
|
description: "",
|
|
76870
76948
|
value: p.prefix
|
|
@@ -78750,7 +78828,7 @@ function RoutingContent({
|
|
|
78750
78828
|
scrollY: true,
|
|
78751
78829
|
focused: false,
|
|
78752
78830
|
style: { flexGrow: 1 },
|
|
78753
|
-
children:
|
|
78831
|
+
children: getChainProviders().map((prov, idx) => {
|
|
78754
78832
|
const isCursor = idx === chainCursor;
|
|
78755
78833
|
const isOn = chainSelected.has(prov.name);
|
|
78756
78834
|
const pos = isOn ? chainOrder.indexOf(prov.name) + 1 : 0;
|
|
@@ -79192,10 +79270,10 @@ function useProfileWizard(args) {
|
|
|
79192
79270
|
setProviderPickerIndex((i) => Math.max(0, i - 1));
|
|
79193
79271
|
}, []);
|
|
79194
79272
|
const prefixPickerDown = useCallback(() => {
|
|
79195
|
-
setProviderPickerIndex((i) => Math.min(
|
|
79273
|
+
setProviderPickerIndex((i) => Math.min(getProviderPrefixes().length - 1, i + 1));
|
|
79196
79274
|
}, []);
|
|
79197
79275
|
const prefixPickerSubmit = useCallback(() => {
|
|
79198
|
-
const prefix =
|
|
79276
|
+
const prefix = getProviderPrefixes()[providerPickerIndex]?.prefix ?? "";
|
|
79199
79277
|
setEditProfileValue(prefix);
|
|
79200
79278
|
setSuggestions(computeSuggestions(prefix));
|
|
79201
79279
|
setSuggestionIndex(-1);
|
|
@@ -79505,7 +79583,7 @@ function useRouteProbe(config3) {
|
|
|
79505
79583
|
}
|
|
79506
79584
|
for (let i = 0;i < chain.length; i++) {
|
|
79507
79585
|
const link = chain[i];
|
|
79508
|
-
const provDef =
|
|
79586
|
+
const provDef = getProviderDefs().find((p) => p.catalogName === link.provider);
|
|
79509
79587
|
const ready = provDef ? providerIsReady(provDef, config3) : true;
|
|
79510
79588
|
if (!ready) {
|
|
79511
79589
|
setProbeResults((prev) => prev.map((e, idx) => idx === i ? { ...e, status: "no_key" } : e));
|
|
@@ -79609,7 +79687,7 @@ function App({ requestLogin } = {}) {
|
|
|
79609
79687
|
if (activeTab !== "providers")
|
|
79610
79688
|
return;
|
|
79611
79689
|
let cancelled = false;
|
|
79612
|
-
const localNames =
|
|
79690
|
+
const localNames = getProviderDefs().filter((p) => p.isLocal).map((p) => p.catalogName);
|
|
79613
79691
|
if (localNames.length === 0)
|
|
79614
79692
|
return;
|
|
79615
79693
|
const sweep = async () => {
|
|
@@ -79653,11 +79731,12 @@ function App({ requestLogin } = {}) {
|
|
|
79653
79731
|
const opPickerResolver = useRef4(null);
|
|
79654
79732
|
const quit = useCallback3(() => renderer.destroy(), [renderer]);
|
|
79655
79733
|
const displayProviders = useMemo2(() => {
|
|
79656
|
-
|
|
79734
|
+
const roster = getProviderDefs();
|
|
79735
|
+
return [...roster].sort((a, b) => {
|
|
79657
79736
|
const aReady = providerIsReadyForDisplay(a, config3, localLiveness);
|
|
79658
79737
|
const bReady = providerIsReadyForDisplay(b, config3, localLiveness);
|
|
79659
79738
|
if (aReady === bReady)
|
|
79660
|
-
return
|
|
79739
|
+
return roster.indexOf(a) - roster.indexOf(b);
|
|
79661
79740
|
return aReady ? -1 : 1;
|
|
79662
79741
|
});
|
|
79663
79742
|
}, [config3, localLiveness]);
|
|
@@ -80269,9 +80348,9 @@ function App({ requestLogin } = {}) {
|
|
|
80269
80348
|
if (key.name === "up" || key.name === "k") {
|
|
80270
80349
|
setChainCursor((i) => Math.max(0, i - 1));
|
|
80271
80350
|
} else if (key.name === "down" || key.name === "j") {
|
|
80272
|
-
setChainCursor((i) => Math.min(
|
|
80351
|
+
setChainCursor((i) => Math.min(getChainProviders().length - 1, i + 1));
|
|
80273
80352
|
} else if (key.name === "space" || key.raw === " ") {
|
|
80274
|
-
const prov =
|
|
80353
|
+
const prov = getChainProviders()[chainCursor];
|
|
80275
80354
|
if (prov.isLocal && !providerIsReady(prov, config3)) {
|
|
80276
80355
|
setStatusMsg(`${prov.displayName} is disabled. Enable it in Providers first.`);
|
|
80277
80356
|
return;
|
|
@@ -80289,7 +80368,7 @@ function App({ requestLogin } = {}) {
|
|
|
80289
80368
|
return next;
|
|
80290
80369
|
});
|
|
80291
80370
|
} else if (key.raw && key.raw >= "1" && key.raw <= "9") {
|
|
80292
|
-
const prov =
|
|
80371
|
+
const prov = getChainProviders()[chainCursor];
|
|
80293
80372
|
if (prov.isLocal && !providerIsReady(prov, config3)) {
|
|
80294
80373
|
setStatusMsg(`${prov.displayName} is disabled. Enable it in Providers first.`);
|
|
80295
80374
|
return;
|
|
@@ -80745,7 +80824,7 @@ function App({ requestLogin } = {}) {
|
|
|
80745
80824
|
}
|
|
80746
80825
|
} else if (key.raw === "T") {
|
|
80747
80826
|
const fired = [];
|
|
80748
|
-
for (const prov of
|
|
80827
|
+
for (const prov of getProviderDefs()) {
|
|
80749
80828
|
const localRunning = prov.isLocal && localLiveness[prov.catalogName] === "running";
|
|
80750
80829
|
if (!providerIsReady(prov, config3) && !localRunning)
|
|
80751
80830
|
continue;
|
|
@@ -85530,8 +85609,11 @@ if (isMcpMode) {
|
|
|
85530
85609
|
} else if (isConfigCommand) {
|
|
85531
85610
|
traceSpan("startup:tui-import", () => Promise.resolve().then(() => (init_tui(), exports_tui))).then(async (m) => {
|
|
85532
85611
|
const { credentials: credentials2 } = await Promise.resolve().then(() => (init_authority(), exports_authority));
|
|
85533
|
-
const {
|
|
85534
|
-
|
|
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 });
|
|
85535
85617
|
finalizeStartupTrace("config");
|
|
85536
85618
|
suppressStartupTraceTerminalOutput();
|
|
85537
85619
|
return m.startConfigTui().catch(handlePromptExit);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudish",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.63.0",
|
|
4
4
|
"description": "Run Claude Code with any model - OpenRouter, Ollama, LM Studio & local models",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"ai"
|
|
61
61
|
],
|
|
62
62
|
"optionalDependencies": {
|
|
63
|
-
"@claudish/magmux-darwin-arm64": "7.
|
|
64
|
-
"@claudish/magmux-darwin-x64": "7.
|
|
65
|
-
"@claudish/magmux-linux-arm64": "7.
|
|
66
|
-
"@claudish/magmux-linux-x64": "7.
|
|
63
|
+
"@claudish/magmux-darwin-arm64": "7.63.0",
|
|
64
|
+
"@claudish/magmux-darwin-x64": "7.63.0",
|
|
65
|
+
"@claudish/magmux-linux-arm64": "7.63.0",
|
|
66
|
+
"@claudish/magmux-linux-x64": "7.63.0"
|
|
67
67
|
},
|
|
68
68
|
"author": "Jack Rudenko <i@madappgang.com>",
|
|
69
69
|
"license": "MIT",
|