claudish 7.32.0 → 7.34.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 +452 -243
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -651,7 +651,7 @@ var init_onepassword_config = __esm(() => {
|
|
|
651
651
|
});
|
|
652
652
|
|
|
653
653
|
// src/version.ts
|
|
654
|
-
var VERSION = "7.
|
|
654
|
+
var VERSION = "7.34.0";
|
|
655
655
|
|
|
656
656
|
// src/logger.ts
|
|
657
657
|
var exports_logger = {};
|
|
@@ -912,6 +912,22 @@ var init_logger = __esm(() => {
|
|
|
912
912
|
});
|
|
913
913
|
|
|
914
914
|
// src/startup-trace.ts
|
|
915
|
+
var exports_startup_trace = {};
|
|
916
|
+
__export(exports_startup_trace, {
|
|
917
|
+
traceSpan: () => traceSpan,
|
|
918
|
+
suppressStartupTraceTerminalOutput: () => suppressStartupTraceTerminalOutput,
|
|
919
|
+
setStartupAuthKind: () => setStartupAuthKind,
|
|
920
|
+
finalizeStartupTrace: () => finalizeStartupTrace,
|
|
921
|
+
beginSpan: () => beginSpan,
|
|
922
|
+
beginQueuedSpan: () => beginQueuedSpan,
|
|
923
|
+
addSpanMeta: () => addSpanMeta,
|
|
924
|
+
__resetStartupTraceForTests: () => __resetStartupTraceForTests,
|
|
925
|
+
__getStartupSpansForTests: () => __getStartupSpansForTests,
|
|
926
|
+
__configureStartupTraceForTests: () => __configureStartupTraceForTests,
|
|
927
|
+
STARTUP_METRICS_MAX_LINES: () => STARTUP_METRICS_MAX_LINES,
|
|
928
|
+
STARTUP_METRICS_FILE: () => STARTUP_METRICS_FILE,
|
|
929
|
+
SLOW_START_THRESHOLD_MS: () => SLOW_START_THRESHOLD_MS
|
|
930
|
+
});
|
|
915
931
|
import { appendFileSync, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
916
932
|
import { homedir as homedir3 } from "os";
|
|
917
933
|
import { dirname, join as join3 } from "path";
|
|
@@ -1166,6 +1182,25 @@ function finalizeStartupTrace(context, opts = {}) {
|
|
|
1166
1182
|
} catch {}
|
|
1167
1183
|
} catch {}
|
|
1168
1184
|
}
|
|
1185
|
+
function __configureStartupTraceForTests(overrides) {
|
|
1186
|
+
seams = { ...defaultSeams(), ...overrides };
|
|
1187
|
+
spans = [];
|
|
1188
|
+
finalized = false;
|
|
1189
|
+
authKind = "none";
|
|
1190
|
+
terminalSuppressed = false;
|
|
1191
|
+
suppressedLogSink = undefined;
|
|
1192
|
+
}
|
|
1193
|
+
function __resetStartupTraceForTests() {
|
|
1194
|
+
seams = defaultSeams();
|
|
1195
|
+
spans = [];
|
|
1196
|
+
finalized = false;
|
|
1197
|
+
authKind = "none";
|
|
1198
|
+
terminalSuppressed = false;
|
|
1199
|
+
suppressedLogSink = undefined;
|
|
1200
|
+
}
|
|
1201
|
+
function __getStartupSpansForTests() {
|
|
1202
|
+
return spans.map((s) => ({ ...s, meta: s.meta ? { ...s.meta } : undefined }));
|
|
1203
|
+
}
|
|
1169
1204
|
var STARTUP_METRICS_FILE, STARTUP_METRICS_MAX_LINES = 500, SLOW_START_THRESHOLD_MS = 8000, MAX_BUFFERED_SPANS = 500, seams, spans, finalized = false, authKind = "none", terminalSuppressed = false, suppressedLogSink;
|
|
1170
1205
|
var init_startup_trace = __esm(() => {
|
|
1171
1206
|
STARTUP_METRICS_FILE = join3(homedir3(), ".claudish", "startup-metrics.jsonl");
|
|
@@ -1173,6 +1208,17 @@ var init_startup_trace = __esm(() => {
|
|
|
1173
1208
|
spans = [];
|
|
1174
1209
|
});
|
|
1175
1210
|
|
|
1211
|
+
// src/env-placeholder.ts
|
|
1212
|
+
function realValue(v) {
|
|
1213
|
+
if (!v)
|
|
1214
|
+
return;
|
|
1215
|
+
return UNEXPANDED_PLACEHOLDER.test(v.trim()) ? undefined : v;
|
|
1216
|
+
}
|
|
1217
|
+
var UNEXPANDED_PLACEHOLDER;
|
|
1218
|
+
var init_env_placeholder = __esm(() => {
|
|
1219
|
+
UNEXPANDED_PLACEHOLDER = /^\$\{[^}]*\}$/;
|
|
1220
|
+
});
|
|
1221
|
+
|
|
1176
1222
|
// src/providers/onepassword-handshake-lock.ts
|
|
1177
1223
|
import { closeSync, mkdirSync as mkdirSync3, openSync, readFileSync as readFileSync3, rmSync, statSync, writeSync } from "fs";
|
|
1178
1224
|
import { homedir as homedir4 } from "os";
|
|
@@ -3785,6 +3831,7 @@ __export(exports_onepassword, {
|
|
|
3785
3831
|
resetSdkClientCache: () => resetSdkClientCache,
|
|
3786
3832
|
resetOpFailures: () => resetOpFailures,
|
|
3787
3833
|
renderOpFailureNotice: () => renderOpFailureNotice,
|
|
3834
|
+
renderOpFailureBlock: () => renderOpFailureBlock,
|
|
3788
3835
|
recordOpHydratedVars: () => recordOpHydratedVars,
|
|
3789
3836
|
recordOpFailure: () => recordOpFailure,
|
|
3790
3837
|
readEnvironment: () => readEnvironment,
|
|
@@ -3809,6 +3856,7 @@ __export(exports_onepassword, {
|
|
|
3809
3856
|
detectSdkAuth: () => detectSdkAuth,
|
|
3810
3857
|
defaultSdkClientFactory: () => defaultSdkClientFactory,
|
|
3811
3858
|
defaultScreenLockProbe: () => defaultScreenLockProbe,
|
|
3859
|
+
defaultOpDefaultAccountProbe: () => defaultOpDefaultAccountProbe,
|
|
3812
3860
|
defaultOpAccountLister: () => defaultOpAccountLister,
|
|
3813
3861
|
defaultAppLockProbe: () => defaultAppLockProbe,
|
|
3814
3862
|
currentLockCause: () => currentLockCause,
|
|
@@ -3847,9 +3895,12 @@ function wasOpAuthorizationDenied() {
|
|
|
3847
3895
|
return opSourceFailures.some((f) => /denied authorization/i.test(f.message));
|
|
3848
3896
|
}
|
|
3849
3897
|
function renderOpFailureNotice(envVar) {
|
|
3898
|
+
return renderOpFailureBlock(`for ${envVar} this run`);
|
|
3899
|
+
}
|
|
3900
|
+
function renderOpFailureBlock(subject) {
|
|
3850
3901
|
if (opSourceFailures.length === 0)
|
|
3851
3902
|
return [];
|
|
3852
|
-
const lines = [`1Password was consulted
|
|
3903
|
+
const lines = [`1Password was consulted ${subject} and failed:`];
|
|
3853
3904
|
for (const f of opSourceFailures) {
|
|
3854
3905
|
const where = f.source ? `${f.kind} ${f.source}` : f.kind;
|
|
3855
3906
|
lines.push(` ${where} \u2014 ${f.message.split(`
|
|
@@ -4373,7 +4424,7 @@ function detectSdkAuth(env = process.env) {
|
|
|
4373
4424
|
}
|
|
4374
4425
|
function resolveDesktopAccount(opts = {}) {
|
|
4375
4426
|
const env = opts.env ?? process.env;
|
|
4376
|
-
const envAccount = env.OP_ACCOUNT?.trim();
|
|
4427
|
+
const envAccount = realValue(env.OP_ACCOUNT)?.trim();
|
|
4377
4428
|
if (envAccount)
|
|
4378
4429
|
return { accountName: envAccount };
|
|
4379
4430
|
const configAccount = opts.configAccount?.trim();
|
|
@@ -4393,10 +4444,17 @@ function resolveDesktopAccount(opts = {}) {
|
|
|
4393
4444
|
if (opts.interactive) {
|
|
4394
4445
|
return { needsPicker: accounts };
|
|
4395
4446
|
}
|
|
4447
|
+
const probe = opts.opDefaultAccountProbe ?? defaultOpDefaultAccountProbe;
|
|
4448
|
+
const defaultUuid = probe();
|
|
4449
|
+
if (defaultUuid) {
|
|
4450
|
+
const match = accounts.find((a) => a.account_uuid === defaultUuid);
|
|
4451
|
+
if (match)
|
|
4452
|
+
return { accountName: match.url };
|
|
4453
|
+
}
|
|
4396
4454
|
const listing = accounts.map((a) => ` - ${a.url}${a.email ? ` (${a.email})` : ""}`).join(`
|
|
4397
4455
|
`);
|
|
4398
4456
|
return {
|
|
4399
|
-
error: `Multiple 1Password accounts are available
|
|
4457
|
+
error: `Multiple 1Password accounts are available, this is a non-interactive session, and \`op\` could not name a default account. ${remediation}
|
|
4400
4458
|
Accounts:
|
|
4401
4459
|
${listing}`
|
|
4402
4460
|
};
|
|
@@ -4410,7 +4468,8 @@ async function resolveSdkAuth(opts = {}) {
|
|
|
4410
4468
|
env,
|
|
4411
4469
|
configAccount: opts.configAccount,
|
|
4412
4470
|
interactive: opts.interactive,
|
|
4413
|
-
opAccountLister: opts.opAccountLister
|
|
4471
|
+
opAccountLister: opts.opAccountLister,
|
|
4472
|
+
opDefaultAccountProbe: opts.opDefaultAccountProbe
|
|
4414
4473
|
});
|
|
4415
4474
|
if ("accountName" in result) {
|
|
4416
4475
|
return { kind: "desktop", accountName: result.accountName };
|
|
@@ -4578,8 +4637,19 @@ var OP_REF_RE, opHydratedVars, opSourceFailures, ENV_VAR_NAME_RE, sdkClientCache
|
|
|
4578
4637
|
} catch {
|
|
4579
4638
|
return null;
|
|
4580
4639
|
}
|
|
4640
|
+
}, defaultOpDefaultAccountProbe = () => {
|
|
4641
|
+
try {
|
|
4642
|
+
const res = spawnSync("op", ["account", "get", "--format=json"], { encoding: "utf-8" });
|
|
4643
|
+
if (res.error || res.status !== 0)
|
|
4644
|
+
return null;
|
|
4645
|
+
const parsed = JSON.parse(res.stdout ?? "");
|
|
4646
|
+
return typeof parsed.id === "string" && parsed.id ? parsed.id : null;
|
|
4647
|
+
} catch {
|
|
4648
|
+
return null;
|
|
4649
|
+
}
|
|
4581
4650
|
};
|
|
4582
4651
|
var init_onepassword = __esm(() => {
|
|
4652
|
+
init_env_placeholder();
|
|
4583
4653
|
init_startup_trace();
|
|
4584
4654
|
init_onepassword_handshake_lock();
|
|
4585
4655
|
OP_REF_RE = /^op:\/\/[^\s]+$/;
|
|
@@ -27713,7 +27783,7 @@ var init_provider_definitions = __esm(() => {
|
|
|
27713
27783
|
apiKeyEnvVar: "",
|
|
27714
27784
|
apiKeyDescription: "Antigravity (shared OAuth token)",
|
|
27715
27785
|
apiKeyUrl: "https://antigravity.google/",
|
|
27716
|
-
oauthLoginSlug: "
|
|
27786
|
+
oauthLoginSlug: "antigravity",
|
|
27717
27787
|
shortcuts: ["ag", "antigravity", "go"],
|
|
27718
27788
|
shortestPrefix: "ag",
|
|
27719
27789
|
legacyPrefixes: [
|
|
@@ -28303,31 +28373,25 @@ function locateAgyBinary() {
|
|
|
28303
28373
|
const fallback = join8(homedir8(), ".local", "bin", "agy");
|
|
28304
28374
|
return existsSync6(fallback) ? fallback : null;
|
|
28305
28375
|
}
|
|
28306
|
-
function
|
|
28376
|
+
function defaultDeleteStore() {
|
|
28377
|
+
if (process.platform !== "darwin")
|
|
28378
|
+
return;
|
|
28379
|
+
try {
|
|
28380
|
+
execFileSync("security", ["delete-generic-password", "-s", KC_SERVICE, "-a", KC_ACCOUNT], {
|
|
28381
|
+
stdio: ["ignore", "ignore", "ignore"]
|
|
28382
|
+
});
|
|
28383
|
+
} catch {}
|
|
28384
|
+
}
|
|
28385
|
+
function defaultRunAgyRefresh() {
|
|
28307
28386
|
const agy = locateAgyBinary();
|
|
28308
|
-
if (!agy)
|
|
28309
|
-
|
|
28310
|
-
return [];
|
|
28311
|
-
}
|
|
28312
|
-
let dump;
|
|
28387
|
+
if (!agy)
|
|
28388
|
+
return;
|
|
28313
28389
|
try {
|
|
28314
|
-
|
|
28315
|
-
|
|
28316
|
-
|
|
28390
|
+
execFileSync(agy, ["models"], {
|
|
28391
|
+
stdio: ["ignore", "ignore", "ignore"],
|
|
28392
|
+
timeout: AGY_REFRESH_TIMEOUT_MS
|
|
28317
28393
|
});
|
|
28318
|
-
} catch {
|
|
28319
|
-
logStderr("[Antigravity] `strings` failed on the agy binary \u2014 self-refresh is unavailable.");
|
|
28320
|
-
return [];
|
|
28321
|
-
}
|
|
28322
|
-
const clientIds = Array.from(new Set(dump.match(/[0-9]{6,}-[a-z0-9]+\.apps\.googleusercontent\.com/g) ?? []));
|
|
28323
|
-
const secrets = Array.from(new Set(dump.match(/GOCSPX-[A-Za-z0-9_-]{20,}/g) ?? []));
|
|
28324
|
-
const combos = [];
|
|
28325
|
-
for (const clientId of clientIds) {
|
|
28326
|
-
for (const clientSecret of secrets) {
|
|
28327
|
-
combos.push({ clientId, clientSecret });
|
|
28328
|
-
}
|
|
28329
|
-
}
|
|
28330
|
-
return combos;
|
|
28394
|
+
} catch {}
|
|
28331
28395
|
}
|
|
28332
28396
|
function parseRecord(raw) {
|
|
28333
28397
|
if (!raw)
|
|
@@ -28347,9 +28411,6 @@ function parseRecord(raw) {
|
|
|
28347
28411
|
return null;
|
|
28348
28412
|
}
|
|
28349
28413
|
}
|
|
28350
|
-
function encodeRecord(rec) {
|
|
28351
|
-
return PREFIX + Buffer.from(JSON.stringify(rec), "utf8").toString("base64");
|
|
28352
|
-
}
|
|
28353
28414
|
function readSharedAntigravityToken(deps = defaultDeps) {
|
|
28354
28415
|
const rec = parseRecord(deps.readStore());
|
|
28355
28416
|
return rec ? rec.token : null;
|
|
@@ -28367,14 +28428,9 @@ function hasSharedAntigravityToken(deps = defaultDeps) {
|
|
|
28367
28428
|
cachedHasToken = { at: now, value };
|
|
28368
28429
|
return value;
|
|
28369
28430
|
}
|
|
28370
|
-
function
|
|
28371
|
-
|
|
28372
|
-
|
|
28373
|
-
const merged = {
|
|
28374
|
-
...base,
|
|
28375
|
-
token: { ...base.token, ...tok }
|
|
28376
|
-
};
|
|
28377
|
-
deps.writeStore(encodeRecord(merged));
|
|
28431
|
+
function deleteSharedAntigravityToken(deps = defaultDeps) {
|
|
28432
|
+
(deps.deleteStore ?? defaultDeleteStore)();
|
|
28433
|
+
_resetAntigravityTokenState();
|
|
28378
28434
|
}
|
|
28379
28435
|
function needsRefresh(tok, now) {
|
|
28380
28436
|
const expMs = Date.parse(tok.expiry);
|
|
@@ -28382,57 +28438,25 @@ function needsRefresh(tok, now) {
|
|
|
28382
28438
|
return true;
|
|
28383
28439
|
return now >= expMs - EXPIRY_SKEW_MS;
|
|
28384
28440
|
}
|
|
28385
|
-
async function refreshToken(tok, deps) {
|
|
28386
|
-
const combos = cachedCred ? [cachedCred] : deps.extractCreds();
|
|
28387
|
-
if (combos.length === 0) {
|
|
28388
|
-
throw new Error("[Antigravity] Access token expired and no OAuth client credentials could be extracted " + "from the `agy` binary to refresh it. Re-run the Antigravity CLI to refresh your session, " + "or use g@<model> with GEMINI_API_KEY.");
|
|
28389
|
-
}
|
|
28390
|
-
let lastStatus = 0;
|
|
28391
|
-
let lastBody = "";
|
|
28392
|
-
for (const cred of combos) {
|
|
28393
|
-
const res = await deps.fetch(REFRESH_ENDPOINT, {
|
|
28394
|
-
method: "POST",
|
|
28395
|
-
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
28396
|
-
body: new URLSearchParams({
|
|
28397
|
-
client_id: cred.clientId,
|
|
28398
|
-
client_secret: cred.clientSecret,
|
|
28399
|
-
refresh_token: tok.refresh_token,
|
|
28400
|
-
grant_type: "refresh_token"
|
|
28401
|
-
})
|
|
28402
|
-
});
|
|
28403
|
-
if (res.ok) {
|
|
28404
|
-
cachedCred = cred;
|
|
28405
|
-
const j = await res.json();
|
|
28406
|
-
const expiry = new Date(deps.now() + j.expires_in * 1000).toISOString();
|
|
28407
|
-
return {
|
|
28408
|
-
access_token: j.access_token,
|
|
28409
|
-
token_type: tok.token_type || "Bearer",
|
|
28410
|
-
refresh_token: j.refresh_token || tok.refresh_token,
|
|
28411
|
-
expiry
|
|
28412
|
-
};
|
|
28413
|
-
}
|
|
28414
|
-
lastStatus = res.status;
|
|
28415
|
-
lastBody = await res.text().catch(() => "");
|
|
28416
|
-
}
|
|
28417
|
-
throw new Error(`[Antigravity] Token refresh failed for all ${combos.length} client-cred combo(s) ` + `(last HTTP ${lastStatus}${lastBody ? `: ${lastBody.slice(0, 200)}` : ""}). ` + "Re-run the Antigravity CLI to refresh your session, or use g@<model> with GEMINI_API_KEY.");
|
|
28418
|
-
}
|
|
28419
28441
|
async function resolveValidToken(deps) {
|
|
28420
28442
|
if (process.platform !== "darwin") {
|
|
28421
28443
|
throw new Error("[Antigravity] The shared Antigravity token store is macOS-only for now. " + "Use g@<model> with GEMINI_API_KEY on this platform.");
|
|
28422
28444
|
}
|
|
28423
28445
|
const rec = parseRecord(deps.readStore());
|
|
28424
28446
|
if (!rec) {
|
|
28425
|
-
throw new Error("[Antigravity] No Antigravity session found.
|
|
28447
|
+
throw new Error("[Antigravity] No Antigravity session found. Sign in with `claudish login antigravity`, " + "or use g@<model> with GEMINI_API_KEY " + "(get one at https://aistudio.google.com/app/apikey).");
|
|
28448
|
+
}
|
|
28449
|
+
if (!needsRefresh(rec.token, deps.now())) {
|
|
28450
|
+
return rec.token.access_token;
|
|
28426
28451
|
}
|
|
28427
|
-
|
|
28428
|
-
|
|
28429
|
-
|
|
28452
|
+
log("[Antigravity] Access token expired/near-expiry \u2014 asking the Antigravity CLI to refresh.");
|
|
28453
|
+
deps.runAgyRefresh();
|
|
28454
|
+
const refreshedRec = parseRecord(deps.readStore());
|
|
28455
|
+
if (refreshedRec && !needsRefresh(refreshedRec.token, deps.now())) {
|
|
28456
|
+
log("[Antigravity] Shared token refreshed by the Antigravity CLI.");
|
|
28457
|
+
return refreshedRec.token.access_token;
|
|
28430
28458
|
}
|
|
28431
|
-
|
|
28432
|
-
const refreshed = await refreshToken(tok, deps);
|
|
28433
|
-
writeSharedAntigravityToken(refreshed, deps);
|
|
28434
|
-
log("[Antigravity] Token refreshed and written back to the shared store.");
|
|
28435
|
-
return refreshed.access_token;
|
|
28459
|
+
throw new Error("[Antigravity] Antigravity session expired and couldn't be refreshed. " + "Run `claudish login antigravity` (installs/authenticates the Antigravity CLI).");
|
|
28436
28460
|
}
|
|
28437
28461
|
function getValidAntigravityAccessToken(deps = defaultDeps) {
|
|
28438
28462
|
if (inFlight)
|
|
@@ -28442,14 +28466,18 @@ function getValidAntigravityAccessToken(deps = defaultDeps) {
|
|
|
28442
28466
|
});
|
|
28443
28467
|
return inFlight;
|
|
28444
28468
|
}
|
|
28445
|
-
|
|
28469
|
+
function _resetAntigravityTokenState() {
|
|
28470
|
+
inFlight = null;
|
|
28471
|
+
cachedHasToken = null;
|
|
28472
|
+
}
|
|
28473
|
+
var KC_SERVICE = "gemini", KC_ACCOUNT = "antigravity", PREFIX = "go-keyring-base64:", EXPIRY_SKEW_MS = 120000, AGY_REFRESH_TIMEOUT_MS = 40000, defaultDeps, cachedHasToken = null, HAS_TOKEN_TTL_MS = 5000, inFlight = null;
|
|
28446
28474
|
var init_antigravity_token = __esm(() => {
|
|
28447
28475
|
init_logger();
|
|
28448
28476
|
defaultDeps = {
|
|
28449
28477
|
readStore: defaultReadStore,
|
|
28450
28478
|
writeStore: defaultWriteStore,
|
|
28451
|
-
|
|
28452
|
-
|
|
28479
|
+
deleteStore: defaultDeleteStore,
|
|
28480
|
+
runAgyRefresh: defaultRunAgyRefresh,
|
|
28453
28481
|
now: () => Date.now()
|
|
28454
28482
|
};
|
|
28455
28483
|
});
|
|
@@ -29656,11 +29684,6 @@ var init_antigravity_credential = __esm(() => {
|
|
|
29656
29684
|
import { existsSync as existsSync8 } from "fs";
|
|
29657
29685
|
import { homedir as homedir10 } from "os";
|
|
29658
29686
|
import { join as join10 } from "path";
|
|
29659
|
-
function realValue(v) {
|
|
29660
|
-
if (!v)
|
|
29661
|
-
return;
|
|
29662
|
-
return UNEXPANDED_PLACEHOLDER.test(v.trim()) ? undefined : v;
|
|
29663
|
-
}
|
|
29664
29687
|
|
|
29665
29688
|
class ApiKeyCredentialProvider {
|
|
29666
29689
|
catalogName;
|
|
@@ -29763,11 +29786,10 @@ class ApiKeyCredentialProvider {
|
|
|
29763
29786
|
return { headers };
|
|
29764
29787
|
}
|
|
29765
29788
|
}
|
|
29766
|
-
var UNEXPANDED_PLACEHOLDER;
|
|
29767
29789
|
var init_api_key_credential = __esm(() => {
|
|
29790
|
+
init_env_placeholder();
|
|
29768
29791
|
init_profile_config();
|
|
29769
29792
|
init_op_source();
|
|
29770
|
-
UNEXPANDED_PLACEHOLDER = /^\$\{[^}]*\}$/;
|
|
29771
29793
|
});
|
|
29772
29794
|
|
|
29773
29795
|
// src/auth/codex-oauth.ts
|
|
@@ -31510,6 +31532,7 @@ var init_routing_hints = __esm(() => {
|
|
|
31510
31532
|
kimi: { loginFlag: "login kimi", apiKeyEnvVar: "MOONSHOT_API_KEY" },
|
|
31511
31533
|
google: { loginFlag: "login gemini", apiKeyEnvVar: "GEMINI_API_KEY" },
|
|
31512
31534
|
"gemini-codeassist": { loginFlag: "login gemini", apiKeyEnvVar: "GEMINI_API_KEY" },
|
|
31535
|
+
antigravity: { loginFlag: "login antigravity" },
|
|
31513
31536
|
openai: { apiKeyEnvVar: "OPENAI_API_KEY" },
|
|
31514
31537
|
"openai-codex": { loginFlag: "login codex", apiKeyEnvVar: "OPENAI_CODEX_API_KEY" },
|
|
31515
31538
|
minimax: { apiKeyEnvVar: "MINIMAX_API_KEY" },
|
|
@@ -33319,44 +33342,6 @@ async function isPortAvailable(port) {
|
|
|
33319
33342
|
}
|
|
33320
33343
|
var init_port_manager = () => {};
|
|
33321
33344
|
|
|
33322
|
-
// src/redact.ts
|
|
33323
|
-
function isPlaceholder(value) {
|
|
33324
|
-
return PLACEHOLDER.test(value.trim());
|
|
33325
|
-
}
|
|
33326
|
-
function redactSecrets(text) {
|
|
33327
|
-
if (!text)
|
|
33328
|
-
return "";
|
|
33329
|
-
let out = text;
|
|
33330
|
-
out = out.replace(ASSIGNMENT_RE, (match, lhs, value) => isPlaceholder(value) ? match : `${lhs}${MASK}`);
|
|
33331
|
-
for (const { re } of TOKEN_PATTERNS) {
|
|
33332
|
-
out = out.replace(re, (match) => {
|
|
33333
|
-
const scheme = /^(Bearer|Basic|Token)\s/.exec(match);
|
|
33334
|
-
return scheme ? `${scheme[1]} ${MASK}` : MASK;
|
|
33335
|
-
});
|
|
33336
|
-
}
|
|
33337
|
-
return out;
|
|
33338
|
-
}
|
|
33339
|
-
function sanitizeForReport(text) {
|
|
33340
|
-
if (!text)
|
|
33341
|
-
return "";
|
|
33342
|
-
return redactSecrets(text).replace(/\/Users\/[^/\s]+/g, "/Users/***").replace(/\/home\/[^/\s]+/g, "/home/***").replace(/[A-Z]:\\Users\\[^\\\s]+/gi, "C:\\Users\\***").replace(/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g, "***@***.***");
|
|
33343
|
-
}
|
|
33344
|
-
var MASK = "***REDACTED***", PLACEHOLDER, ASSIGNMENT_RE, TOKEN_PATTERNS;
|
|
33345
|
-
var init_redact = __esm(() => {
|
|
33346
|
-
PLACEHOLDER = /^(['"`]?)(your[-_a-z0-9]*|<[^>]*>|\.\.\.|x{3,}|\*{3,}|REDACTED|CHANGEME|TODO|\$\{[^}]*\}|)(['"`]?)$/i;
|
|
33347
|
-
ASSIGNMENT_RE = /(["']?\b[A-Z][A-Z0-9_]*(?:_API_KEY|_KEY|_TOKEN|_SECRET|_PASSWORD)\b["']?\s*[:=]\s*)(["'`]?\$\{[^}]*\}["'`]?|["'`]?[^\s"'`,}]+["'`]?)/g;
|
|
33348
|
-
TOKEN_PATTERNS = [
|
|
33349
|
-
{ name: "sk", re: /\bsk-[A-Za-z0-9_-]{16,}/g },
|
|
33350
|
-
{ name: "google", re: /\bAIza[A-Za-z0-9_-]{20,}/g },
|
|
33351
|
-
{ name: "xai", re: /\bxai-[A-Za-z0-9_-]{16,}/g },
|
|
33352
|
-
{ name: "github", re: /\bgh[posur]_[A-Za-z0-9]{20,}/g },
|
|
33353
|
-
{ name: "aws", re: /\bAKIA[0-9A-Z]{12,}/g },
|
|
33354
|
-
{ name: "jwt", re: /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g },
|
|
33355
|
-
{ name: "zhipu", re: /\b[0-9a-f]{32}\.[A-Za-z0-9]{16}\b/g },
|
|
33356
|
-
{ name: "bearer", re: /\b(?:Bearer|Basic|Token)\s+[A-Za-z0-9_.\-+/=]{12,}/g }
|
|
33357
|
-
];
|
|
33358
|
-
});
|
|
33359
|
-
|
|
33360
33345
|
// ../../node_modules/.bun/hono@4.10.6/node_modules/hono/dist/compose.js
|
|
33361
33346
|
var compose = (middleware, onError, onNotFound) => {
|
|
33362
33347
|
return (context, next) => {
|
|
@@ -47273,6 +47258,44 @@ var init_proxy_server = __esm(() => {
|
|
|
47273
47258
|
};
|
|
47274
47259
|
});
|
|
47275
47260
|
|
|
47261
|
+
// src/redact.ts
|
|
47262
|
+
function isPlaceholder(value) {
|
|
47263
|
+
return PLACEHOLDER.test(value.trim());
|
|
47264
|
+
}
|
|
47265
|
+
function redactSecrets(text) {
|
|
47266
|
+
if (!text)
|
|
47267
|
+
return "";
|
|
47268
|
+
let out = text;
|
|
47269
|
+
out = out.replace(ASSIGNMENT_RE, (match2, lhs, value) => isPlaceholder(value) ? match2 : `${lhs}${MASK}`);
|
|
47270
|
+
for (const { re } of TOKEN_PATTERNS) {
|
|
47271
|
+
out = out.replace(re, (match2) => {
|
|
47272
|
+
const scheme = /^(Bearer|Basic|Token)\s/.exec(match2);
|
|
47273
|
+
return scheme ? `${scheme[1]} ${MASK}` : MASK;
|
|
47274
|
+
});
|
|
47275
|
+
}
|
|
47276
|
+
return out;
|
|
47277
|
+
}
|
|
47278
|
+
function sanitizeForReport(text) {
|
|
47279
|
+
if (!text)
|
|
47280
|
+
return "";
|
|
47281
|
+
return redactSecrets(text).replace(/\/Users\/[^/\s]+/g, "/Users/***").replace(/\/home\/[^/\s]+/g, "/home/***").replace(/[A-Z]:\\Users\\[^\\\s]+/gi, "C:\\Users\\***").replace(/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g, "***@***.***");
|
|
47282
|
+
}
|
|
47283
|
+
var MASK = "***REDACTED***", PLACEHOLDER, ASSIGNMENT_RE, TOKEN_PATTERNS;
|
|
47284
|
+
var init_redact = __esm(() => {
|
|
47285
|
+
PLACEHOLDER = /^(['"`]?)(your[-_a-z0-9]*|<[^>]*>|\.\.\.|x{3,}|\*{3,}|REDACTED|CHANGEME|TODO|\$\{[^}]*\}|)(['"`]?)$/i;
|
|
47286
|
+
ASSIGNMENT_RE = /(["']?\b[A-Z][A-Z0-9_]*(?:_API_KEY|_KEY|_TOKEN|_SECRET|_PASSWORD)\b["']?\s*[:=]\s*)(["'`]?\$\{[^}]*\}["'`]?|["'`]?[^\s"'`,}]+["'`]?)/g;
|
|
47287
|
+
TOKEN_PATTERNS = [
|
|
47288
|
+
{ name: "sk", re: /\bsk-[A-Za-z0-9_-]{16,}/g },
|
|
47289
|
+
{ name: "google", re: /\bAIza[A-Za-z0-9_-]{20,}/g },
|
|
47290
|
+
{ name: "xai", re: /\bxai-[A-Za-z0-9_-]{16,}/g },
|
|
47291
|
+
{ name: "github", re: /\bgh[posur]_[A-Za-z0-9]{20,}/g },
|
|
47292
|
+
{ name: "aws", re: /\bAKIA[0-9A-Z]{12,}/g },
|
|
47293
|
+
{ name: "jwt", re: /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g },
|
|
47294
|
+
{ name: "zhipu", re: /\b[0-9a-f]{32}\.[A-Za-z0-9]{16}\b/g },
|
|
47295
|
+
{ name: "bearer", re: /\b(?:Bearer|Basic|Token)\s+[A-Za-z0-9_.\-+/=]{12,}/g }
|
|
47296
|
+
];
|
|
47297
|
+
});
|
|
47298
|
+
|
|
47276
47299
|
// src/team-stats.ts
|
|
47277
47300
|
import { existsSync as existsSync18, readFileSync as readFileSync16, writeFileSync as writeFileSync11 } from "fs";
|
|
47278
47301
|
import { join as join25 } from "path";
|
|
@@ -48161,6 +48184,13 @@ function formatTeamResult(status, sessionPath) {
|
|
|
48161
48184
|
}
|
|
48162
48185
|
function defineTools(sessionManager, notifyChannel) {
|
|
48163
48186
|
const tools = [];
|
|
48187
|
+
function withOpFailureContext(message, subject) {
|
|
48188
|
+
const block = renderOpFailureBlock(subject);
|
|
48189
|
+
return block.length === 0 ? message : `${message}
|
|
48190
|
+
|
|
48191
|
+
${block.join(`
|
|
48192
|
+
`)}`;
|
|
48193
|
+
}
|
|
48164
48194
|
tools.push({
|
|
48165
48195
|
name: "run_prompt",
|
|
48166
48196
|
description: "Run a prompt through any model \u2014 supports all providers (Kimi, GLM, Qwen, MiniMax, Gemini, GPT, Grok, etc.) with auto-routing, fallback chains, and custom routing rules.",
|
|
@@ -48195,10 +48225,10 @@ Tokens: ${result.usage.input} input, ${result.usage.output} output`;
|
|
|
48195
48225
|
content: [
|
|
48196
48226
|
{
|
|
48197
48227
|
type: "text",
|
|
48198
|
-
text: `Error: ${errMsg}
|
|
48228
|
+
text: withOpFailureContext(`Error: ${errMsg}
|
|
48199
48229
|
|
|
48200
48230
|
---
|
|
48201
|
-
**To report this error**, use the \`report_error\` tool with \`error_type: "provider_failure"\` and \`model: "${args.model}"
|
|
48231
|
+
**To report this error**, use the \`report_error\` tool with \`error_type: "provider_failure"\` and \`model: "${args.model}"\`.`, `while routing ${args.model}`)
|
|
48202
48232
|
}
|
|
48203
48233
|
],
|
|
48204
48234
|
isError: true
|
|
@@ -48541,7 +48571,7 @@ Use with: run_prompt(model="${results2[0].model.id}", prompt="your prompt")`;
|
|
|
48541
48571
|
content: [
|
|
48542
48572
|
{
|
|
48543
48573
|
type: "text",
|
|
48544
|
-
text: `Error: ${error46 instanceof Error ? error46.message : String(error46)}
|
|
48574
|
+
text: withOpFailureContext(`Error: ${error46 instanceof Error ? error46.message : String(error46)}`, "while running the team")
|
|
48545
48575
|
}
|
|
48546
48576
|
],
|
|
48547
48577
|
isError: true
|
|
@@ -48757,10 +48787,10 @@ Report manually at https://github.com/anthropics/claudish/issues${autoSendHint}`
|
|
|
48757
48787
|
content: [
|
|
48758
48788
|
{
|
|
48759
48789
|
type: "text",
|
|
48760
|
-
text: `Error creating session: ${errMsg}
|
|
48790
|
+
text: withOpFailureContext(`Error creating session: ${errMsg}
|
|
48761
48791
|
|
|
48762
48792
|
---
|
|
48763
|
-
**To report this error**, use the \`report_error\` tool with \`error_type: "provider_failure"\` and \`model: "${args.model}"
|
|
48793
|
+
**To report this error**, use the \`report_error\` tool with \`error_type: "provider_failure"\` and \`model: "${args.model}"\`.`, `while routing ${args.model}`)
|
|
48764
48794
|
}
|
|
48765
48795
|
],
|
|
48766
48796
|
isError: true
|
|
@@ -49016,9 +49046,10 @@ var init_mcp_server = __esm(() => {
|
|
|
49016
49046
|
init_channel();
|
|
49017
49047
|
init_model_loader();
|
|
49018
49048
|
init_port_manager();
|
|
49019
|
-
|
|
49049
|
+
init_onepassword();
|
|
49020
49050
|
init_provider_definitions();
|
|
49021
49051
|
init_proxy_server();
|
|
49052
|
+
init_redact();
|
|
49022
49053
|
init_team_orchestrator();
|
|
49023
49054
|
import_dotenv2 = __toESM(require_main(), 1);
|
|
49024
49055
|
import_dotenv2.config({ quiet: true });
|
|
@@ -61770,6 +61801,163 @@ var init_dist16 = __esm(() => {
|
|
|
61770
61801
|
init_dist15();
|
|
61771
61802
|
});
|
|
61772
61803
|
|
|
61804
|
+
// src/auth/antigravity-oauth.ts
|
|
61805
|
+
import { spawnSync as spawnSync3 } from "child_process";
|
|
61806
|
+
import { existsSync as existsSync22, unlinkSync as unlinkSync7 } from "fs";
|
|
61807
|
+
import { homedir as homedir26 } from "os";
|
|
61808
|
+
import { join as join28 } from "path";
|
|
61809
|
+
async function defaultSuggestModel() {
|
|
61810
|
+
try {
|
|
61811
|
+
const tok = readSharedAntigravityToken();
|
|
61812
|
+
if (!tok)
|
|
61813
|
+
return "<model>";
|
|
61814
|
+
const { projectId } = await setupAntigravityUser(tok.access_token);
|
|
61815
|
+
const { servedIds, defaultId } = await getServedAntigravityModels(tok.access_token, projectId);
|
|
61816
|
+
return defaultId || servedIds[0] || "<model>";
|
|
61817
|
+
} catch {
|
|
61818
|
+
return "<model>";
|
|
61819
|
+
}
|
|
61820
|
+
}
|
|
61821
|
+
function printManualInstall() {
|
|
61822
|
+
console.log("\nInstall the Antigravity CLI, then retry `claudish login antigravity`:");
|
|
61823
|
+
console.log(` ${INSTALL_CMD}`);
|
|
61824
|
+
console.log(` Docs: ${INSTALL_DOCS}`);
|
|
61825
|
+
}
|
|
61826
|
+
async function defaultConfirmInstall() {
|
|
61827
|
+
const { confirm } = await Promise.resolve().then(() => (init_dist16(), exports_dist));
|
|
61828
|
+
return confirm({
|
|
61829
|
+
message: `Install the Antigravity CLI now? (runs: ${INSTALL_CMD})`,
|
|
61830
|
+
default: true
|
|
61831
|
+
});
|
|
61832
|
+
}
|
|
61833
|
+
function defaultRunInstall() {
|
|
61834
|
+
const res = spawnSync3("bash", ["-c", INSTALL_CMD], { stdio: "inherit" });
|
|
61835
|
+
return !res.error && res.status === 0;
|
|
61836
|
+
}
|
|
61837
|
+
function defaultRunAgyAuth(agyPath, interactive) {
|
|
61838
|
+
if (interactive) {
|
|
61839
|
+
spawnSync3(agyPath, [], { stdio: "inherit" });
|
|
61840
|
+
} else {
|
|
61841
|
+
spawnSync3(agyPath, ["-p", "hello", "--print-timeout", "3m"], { stdio: "inherit" });
|
|
61842
|
+
}
|
|
61843
|
+
}
|
|
61844
|
+
async function pollForToken(deps) {
|
|
61845
|
+
const deadline = deps.now() + deps.timing.graceMs;
|
|
61846
|
+
for (;; ) {
|
|
61847
|
+
const tok = deps.readToken();
|
|
61848
|
+
if (tok)
|
|
61849
|
+
return tok;
|
|
61850
|
+
if (deps.now() >= deadline)
|
|
61851
|
+
return null;
|
|
61852
|
+
const remaining = deadline - deps.now();
|
|
61853
|
+
await deps.sleep(Math.min(deps.timing.intervalMs, Math.max(0, remaining)));
|
|
61854
|
+
}
|
|
61855
|
+
}
|
|
61856
|
+
|
|
61857
|
+
class AntigravityOAuth {
|
|
61858
|
+
static instance = null;
|
|
61859
|
+
static getInstance() {
|
|
61860
|
+
if (!AntigravityOAuth.instance) {
|
|
61861
|
+
AntigravityOAuth.instance = new AntigravityOAuth;
|
|
61862
|
+
}
|
|
61863
|
+
return AntigravityOAuth.instance;
|
|
61864
|
+
}
|
|
61865
|
+
constructor() {}
|
|
61866
|
+
async login(depsOverride = {}) {
|
|
61867
|
+
const deps = { ...defaultLoginDeps, ...depsOverride };
|
|
61868
|
+
log("[AntigravityOAuth] Starting agy-delegated login");
|
|
61869
|
+
if (deps.hasToken()) {
|
|
61870
|
+
console.log(`\u2705 Already authenticated with Antigravity. Use: claudish --model ag@${await (deps.suggestModel ?? defaultSuggestModel)()}`);
|
|
61871
|
+
return deps.exit(0);
|
|
61872
|
+
}
|
|
61873
|
+
let agyPath = deps.locateAgy();
|
|
61874
|
+
if (!agyPath) {
|
|
61875
|
+
console.log("\nThe Antigravity CLI (`agy`) is required to sign in to Antigravity.");
|
|
61876
|
+
console.log(`claudish delegates Antigravity sign-in to agy \u2014 agy holds the current OAuth secret
|
|
61877
|
+
` + "and writes the session to the shared keychain store that claudish reads.");
|
|
61878
|
+
if (!deps.isInteractive()) {
|
|
61879
|
+
printManualInstall();
|
|
61880
|
+
return deps.exit(0);
|
|
61881
|
+
}
|
|
61882
|
+
const proceed = await deps.confirmInstall();
|
|
61883
|
+
if (!proceed) {
|
|
61884
|
+
printManualInstall();
|
|
61885
|
+
return deps.exit(0);
|
|
61886
|
+
}
|
|
61887
|
+
console.log(`
|
|
61888
|
+
Installing the Antigravity CLI\u2026
|
|
61889
|
+
`);
|
|
61890
|
+
if (!deps.runInstall()) {
|
|
61891
|
+
console.log(`
|
|
61892
|
+
\u274C Antigravity CLI installation failed.`);
|
|
61893
|
+
printManualInstall();
|
|
61894
|
+
return deps.exit(0);
|
|
61895
|
+
}
|
|
61896
|
+
agyPath = deps.locateAgy();
|
|
61897
|
+
if (!agyPath) {
|
|
61898
|
+
console.log(`
|
|
61899
|
+
\u274C Antigravity CLI still not found after install.`);
|
|
61900
|
+
printManualInstall();
|
|
61901
|
+
return deps.exit(0);
|
|
61902
|
+
}
|
|
61903
|
+
}
|
|
61904
|
+
console.log(`
|
|
61905
|
+
Launching the Antigravity CLI to sign in \u2014 complete the sign-in in your browser.
|
|
61906
|
+
` + `claudish will detect the session automatically.
|
|
61907
|
+
`);
|
|
61908
|
+
deps.runAgyAuth(agyPath, false);
|
|
61909
|
+
let token = await pollForToken(deps);
|
|
61910
|
+
if (!token) {
|
|
61911
|
+
console.log(`
|
|
61912
|
+
No session detected yet. Starting the Antigravity CLI interactively \u2014
|
|
61913
|
+
` + "sign in, then exit agy (its `/quit` command or Ctrl-C) to return here.\n");
|
|
61914
|
+
deps.runAgyAuth(agyPath, true);
|
|
61915
|
+
token = await pollForToken(deps);
|
|
61916
|
+
}
|
|
61917
|
+
if (token) {
|
|
61918
|
+
deps.onAuthenticated();
|
|
61919
|
+
console.log(`
|
|
61920
|
+
\u2705 Authenticated with Antigravity. Use: claudish --model ag@${await (deps.suggestModel ?? defaultSuggestModel)()}`);
|
|
61921
|
+
return deps.exit(0);
|
|
61922
|
+
}
|
|
61923
|
+
console.log("\nNo Antigravity session detected. Run `agy` and sign in, then retry `claudish login antigravity`.");
|
|
61924
|
+
return deps.exit(0);
|
|
61925
|
+
}
|
|
61926
|
+
async logout(deps) {
|
|
61927
|
+
deleteSharedAntigravityToken(deps);
|
|
61928
|
+
try {
|
|
61929
|
+
const tokenFile = join28(homedir26(), ".gemini", "antigravity-cli", "antigravity-oauth-token");
|
|
61930
|
+
if (existsSync22(tokenFile))
|
|
61931
|
+
unlinkSync7(tokenFile);
|
|
61932
|
+
} catch {}
|
|
61933
|
+
log("[AntigravityOAuth] Antigravity session cleared (keychain + agy token file)");
|
|
61934
|
+
}
|
|
61935
|
+
}
|
|
61936
|
+
var INSTALL_CMD = "curl -fsSL https://antigravity.google/cli/install.sh | bash", INSTALL_DOCS = "https://antigravity.google/docs/cli/install", defaultLoginDeps;
|
|
61937
|
+
var init_antigravity_oauth = __esm(() => {
|
|
61938
|
+
init_logger();
|
|
61939
|
+
init_antigravity_token();
|
|
61940
|
+
init_gemini_oauth();
|
|
61941
|
+
defaultLoginDeps = {
|
|
61942
|
+
locateAgy: locateAgyBinary,
|
|
61943
|
+
hasToken: () => readSharedAntigravityToken() != null,
|
|
61944
|
+
readToken: () => {
|
|
61945
|
+
_resetAntigravityTokenState();
|
|
61946
|
+
return readSharedAntigravityToken();
|
|
61947
|
+
},
|
|
61948
|
+
suggestModel: defaultSuggestModel,
|
|
61949
|
+
confirmInstall: defaultConfirmInstall,
|
|
61950
|
+
runInstall: defaultRunInstall,
|
|
61951
|
+
runAgyAuth: defaultRunAgyAuth,
|
|
61952
|
+
onAuthenticated: () => _resetAntigravityTokenState(),
|
|
61953
|
+
isInteractive: () => Boolean(process.stdin.isTTY),
|
|
61954
|
+
now: () => Date.now(),
|
|
61955
|
+
sleep: (ms) => new Promise((r) => setTimeout(r, ms)),
|
|
61956
|
+
exit: (code) => process.exit(code),
|
|
61957
|
+
timing: { graceMs: 1e4, intervalMs: 500 }
|
|
61958
|
+
};
|
|
61959
|
+
});
|
|
61960
|
+
|
|
61773
61961
|
// src/auth/auth-commands.ts
|
|
61774
61962
|
var exports_auth_commands = {};
|
|
61775
61963
|
__export(exports_auth_commands, {
|
|
@@ -61777,7 +61965,7 @@ __export(exports_auth_commands, {
|
|
|
61777
61965
|
loginCommand: () => loginCommand
|
|
61778
61966
|
});
|
|
61779
61967
|
function getAuthStatus(provider) {
|
|
61780
|
-
const hasCredentials = provider.registryKeys.some((k) => hasOAuthCredentials(k));
|
|
61968
|
+
const hasCredentials = provider.registryKeys.some((k) => hasOAuthCredentials(k)) || provider.name === "antigravity" && hasSharedAntigravityToken();
|
|
61781
61969
|
return hasCredentials ? "logged in" : "not logged in";
|
|
61782
61970
|
}
|
|
61783
61971
|
async function selectProvider(action) {
|
|
@@ -61834,11 +62022,20 @@ async function logoutCommand(providerArg) {
|
|
|
61834
62022
|
var AUTH_PROVIDERS;
|
|
61835
62023
|
var init_auth_commands = __esm(() => {
|
|
61836
62024
|
init_dist16();
|
|
62025
|
+
init_antigravity_oauth();
|
|
62026
|
+
init_antigravity_token();
|
|
61837
62027
|
init_codex_oauth();
|
|
61838
62028
|
init_gemini_oauth();
|
|
61839
62029
|
init_kimi_oauth();
|
|
61840
62030
|
init_oauth_registry();
|
|
61841
62031
|
AUTH_PROVIDERS = [
|
|
62032
|
+
{
|
|
62033
|
+
name: "antigravity",
|
|
62034
|
+
displayName: "Antigravity",
|
|
62035
|
+
prefix: "ag@, antigravity@",
|
|
62036
|
+
getInstance: () => AntigravityOAuth.getInstance(),
|
|
62037
|
+
registryKeys: ["antigravity"]
|
|
62038
|
+
},
|
|
61842
62039
|
{
|
|
61843
62040
|
name: "gemini",
|
|
61844
62041
|
displayName: "Gemini Code Assist",
|
|
@@ -61987,11 +62184,11 @@ async function geminiQuotaHandler() {
|
|
|
61987
62184
|
}
|
|
61988
62185
|
}
|
|
61989
62186
|
async function codexQuotaHandler() {
|
|
61990
|
-
const { readFileSync: readFileSync21, existsSync:
|
|
61991
|
-
const { join:
|
|
61992
|
-
const { homedir:
|
|
61993
|
-
const credPath =
|
|
61994
|
-
if (!
|
|
62187
|
+
const { readFileSync: readFileSync21, existsSync: existsSync23 } = await import("fs");
|
|
62188
|
+
const { join: join29 } = await import("path");
|
|
62189
|
+
const { homedir: homedir27 } = await import("os");
|
|
62190
|
+
const credPath = join29(homedir27(), ".claudish", "codex-oauth.json");
|
|
62191
|
+
if (!existsSync23(credPath)) {
|
|
61995
62192
|
console.error(`${RED}No Codex credentials found.${R} Run: ${B}claudish login codex${R}`);
|
|
61996
62193
|
process.exit(1);
|
|
61997
62194
|
}
|
|
@@ -62047,8 +62244,8 @@ async function codexQuotaHandler() {
|
|
|
62047
62244
|
}
|
|
62048
62245
|
let modelSlugs = [];
|
|
62049
62246
|
try {
|
|
62050
|
-
const modelsPath =
|
|
62051
|
-
if (
|
|
62247
|
+
const modelsPath = join29(homedir27(), ".codex", "models_cache.json");
|
|
62248
|
+
if (existsSync23(modelsPath)) {
|
|
62052
62249
|
const cache2 = JSON.parse(readFileSync21(modelsPath, "utf-8"));
|
|
62053
62250
|
modelSlugs = (cache2.models || []).map((m) => m.slug || m.id).filter(Boolean);
|
|
62054
62251
|
}
|
|
@@ -63335,7 +63532,7 @@ function annotateOAuthHint(result, provider, isOAuth) {
|
|
|
63335
63532
|
return result;
|
|
63336
63533
|
if (result.state === "live")
|
|
63337
63534
|
return result;
|
|
63338
|
-
const loginCommand2 = provider === "gemini-codeassist" ? "claudish login gemini" : provider === "vertex" ? "gcloud auth application-default login" : undefined;
|
|
63535
|
+
const loginCommand2 = provider === "gemini-codeassist" ? "claudish login gemini" : provider === "antigravity" ? "claudish login antigravity" : provider === "vertex" ? "gcloud auth application-default login" : undefined;
|
|
63339
63536
|
if (!loginCommand2)
|
|
63340
63537
|
return result;
|
|
63341
63538
|
if (result.httpStatus === 403)
|
|
@@ -65937,22 +66134,22 @@ __export(exports_cli, {
|
|
|
65937
66134
|
});
|
|
65938
66135
|
import {
|
|
65939
66136
|
copyFileSync as copyFileSync2,
|
|
65940
|
-
existsSync as
|
|
66137
|
+
existsSync as existsSync23,
|
|
65941
66138
|
mkdirSync as mkdirSync13,
|
|
65942
66139
|
readFileSync as readFileSync21,
|
|
65943
66140
|
readdirSync as readdirSync5,
|
|
65944
|
-
unlinkSync as
|
|
66141
|
+
unlinkSync as unlinkSync8,
|
|
65945
66142
|
writeFileSync as writeFileSync15
|
|
65946
66143
|
} from "fs";
|
|
65947
|
-
import { homedir as
|
|
65948
|
-
import { dirname as dirname9, join as
|
|
66144
|
+
import { homedir as homedir27 } from "os";
|
|
66145
|
+
import { dirname as dirname9, join as join29 } from "path";
|
|
65949
66146
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
65950
66147
|
function getVersion3() {
|
|
65951
66148
|
return VERSION;
|
|
65952
66149
|
}
|
|
65953
66150
|
function clearAllModelCaches() {
|
|
65954
|
-
const cacheDir =
|
|
65955
|
-
if (!
|
|
66151
|
+
const cacheDir = join29(homedir27(), ".claudish");
|
|
66152
|
+
if (!existsSync23(cacheDir))
|
|
65956
66153
|
return;
|
|
65957
66154
|
const cachePatterns = ["pricing-cache.json", "recommended-models-cache.json"];
|
|
65958
66155
|
let cleared = 0;
|
|
@@ -65960,7 +66157,7 @@ function clearAllModelCaches() {
|
|
|
65960
66157
|
const files = readdirSync5(cacheDir);
|
|
65961
66158
|
for (const file2 of files) {
|
|
65962
66159
|
if (cachePatterns.includes(file2)) {
|
|
65963
|
-
|
|
66160
|
+
unlinkSync8(join29(cacheDir, file2));
|
|
65964
66161
|
cleared++;
|
|
65965
66162
|
}
|
|
65966
66163
|
}
|
|
@@ -66370,8 +66567,8 @@ Usage: claudish --models --provider <slug>`);
|
|
|
66370
66567
|
});
|
|
66371
66568
|
config3.resolvedDefaultProvider = resolved;
|
|
66372
66569
|
if (resolved.legacyAutoPromoted && !config3.quiet) {
|
|
66373
|
-
const markerFile =
|
|
66374
|
-
if (!
|
|
66570
|
+
const markerFile = join29(homedir27(), ".claudish", ".legacy-litellm-hint-shown");
|
|
66571
|
+
if (!existsSync23(markerFile)) {
|
|
66375
66572
|
const hint = buildLegacyHint(resolved);
|
|
66376
66573
|
if (hint) {
|
|
66377
66574
|
console.error(hint);
|
|
@@ -67445,7 +67642,7 @@ ${h("MORE INFO")}
|
|
|
67445
67642
|
}
|
|
67446
67643
|
function printAIAgentGuide() {
|
|
67447
67644
|
try {
|
|
67448
|
-
const guidePath =
|
|
67645
|
+
const guidePath = join29(__dirname3, "../AI_AGENT_GUIDE.md");
|
|
67449
67646
|
const guideContent = readFileSync21(guidePath, "utf-8");
|
|
67450
67647
|
console.log(guideContent);
|
|
67451
67648
|
} catch (error46) {
|
|
@@ -67462,19 +67659,19 @@ async function initializeClaudishSkill() {
|
|
|
67462
67659
|
console.log(`\uD83D\uDD27 Initializing Claudish skill in current project...
|
|
67463
67660
|
`);
|
|
67464
67661
|
const cwd = process.cwd();
|
|
67465
|
-
const claudeDir =
|
|
67466
|
-
const skillsDir =
|
|
67467
|
-
const claudishSkillDir =
|
|
67468
|
-
const skillFile =
|
|
67469
|
-
if (
|
|
67662
|
+
const claudeDir = join29(cwd, ".claude");
|
|
67663
|
+
const skillsDir = join29(claudeDir, "skills");
|
|
67664
|
+
const claudishSkillDir = join29(skillsDir, "claudish-usage");
|
|
67665
|
+
const skillFile = join29(claudishSkillDir, "SKILL.md");
|
|
67666
|
+
if (existsSync23(skillFile)) {
|
|
67470
67667
|
console.log("\u2705 Claudish skill already installed at:");
|
|
67471
67668
|
console.log(` ${skillFile}
|
|
67472
67669
|
`);
|
|
67473
67670
|
console.log("\uD83D\uDCA1 To reinstall, delete the file and run 'claudish --init' again.");
|
|
67474
67671
|
return;
|
|
67475
67672
|
}
|
|
67476
|
-
const sourceSkillPath =
|
|
67477
|
-
if (!
|
|
67673
|
+
const sourceSkillPath = join29(__dirname3, "../skills/claudish-usage/SKILL.md");
|
|
67674
|
+
if (!existsSync23(sourceSkillPath)) {
|
|
67478
67675
|
console.error("\u274C Error: Claudish skill file not found in installation.");
|
|
67479
67676
|
console.error(` Expected at: ${sourceSkillPath}`);
|
|
67480
67677
|
console.error(`
|
|
@@ -67483,15 +67680,15 @@ async function initializeClaudishSkill() {
|
|
|
67483
67680
|
process.exit(1);
|
|
67484
67681
|
}
|
|
67485
67682
|
try {
|
|
67486
|
-
if (!
|
|
67683
|
+
if (!existsSync23(claudeDir)) {
|
|
67487
67684
|
mkdirSync13(claudeDir, { recursive: true });
|
|
67488
67685
|
console.log("\uD83D\uDCC1 Created .claude/ directory");
|
|
67489
67686
|
}
|
|
67490
|
-
if (!
|
|
67687
|
+
if (!existsSync23(skillsDir)) {
|
|
67491
67688
|
mkdirSync13(skillsDir, { recursive: true });
|
|
67492
67689
|
console.log("\uD83D\uDCC1 Created .claude/skills/ directory");
|
|
67493
67690
|
}
|
|
67494
|
-
if (!
|
|
67691
|
+
if (!existsSync23(claudishSkillDir)) {
|
|
67495
67692
|
mkdirSync13(claudishSkillDir, { recursive: true });
|
|
67496
67693
|
console.log("\uD83D\uDCC1 Created .claude/skills/claudish-usage/ directory");
|
|
67497
67694
|
}
|
|
@@ -67576,30 +67773,30 @@ __export(exports_update_checker, {
|
|
|
67576
67773
|
clearCache: () => clearCache,
|
|
67577
67774
|
checkForUpdates: () => checkForUpdates
|
|
67578
67775
|
});
|
|
67579
|
-
import { existsSync as
|
|
67580
|
-
import { homedir as
|
|
67581
|
-
import { join as
|
|
67776
|
+
import { existsSync as existsSync24, mkdirSync as mkdirSync14, readFileSync as readFileSync22, unlinkSync as unlinkSync9, writeFileSync as writeFileSync16 } from "fs";
|
|
67777
|
+
import { homedir as homedir28, platform as platform2, tmpdir } from "os";
|
|
67778
|
+
import { join as join30 } from "path";
|
|
67582
67779
|
function getCacheFilePath() {
|
|
67583
67780
|
let cacheDir;
|
|
67584
67781
|
if (isWindows) {
|
|
67585
|
-
const localAppData = process.env.LOCALAPPDATA ||
|
|
67586
|
-
cacheDir =
|
|
67782
|
+
const localAppData = process.env.LOCALAPPDATA || join30(homedir28(), "AppData", "Local");
|
|
67783
|
+
cacheDir = join30(localAppData, "claudish");
|
|
67587
67784
|
} else {
|
|
67588
|
-
cacheDir =
|
|
67785
|
+
cacheDir = join30(homedir28(), ".cache", "claudish");
|
|
67589
67786
|
}
|
|
67590
67787
|
try {
|
|
67591
|
-
if (!
|
|
67788
|
+
if (!existsSync24(cacheDir)) {
|
|
67592
67789
|
mkdirSync14(cacheDir, { recursive: true });
|
|
67593
67790
|
}
|
|
67594
|
-
return
|
|
67791
|
+
return join30(cacheDir, "update-check.json");
|
|
67595
67792
|
} catch {
|
|
67596
|
-
return
|
|
67793
|
+
return join30(tmpdir(), "claudish-update-check.json");
|
|
67597
67794
|
}
|
|
67598
67795
|
}
|
|
67599
67796
|
function readCache() {
|
|
67600
67797
|
try {
|
|
67601
67798
|
const cachePath = getCacheFilePath();
|
|
67602
|
-
if (!
|
|
67799
|
+
if (!existsSync24(cachePath)) {
|
|
67603
67800
|
return null;
|
|
67604
67801
|
}
|
|
67605
67802
|
const data = JSON.parse(readFileSync22(cachePath, "utf-8"));
|
|
@@ -67625,8 +67822,8 @@ function isCacheValid(cache2) {
|
|
|
67625
67822
|
function clearCache() {
|
|
67626
67823
|
try {
|
|
67627
67824
|
const cachePath = getCacheFilePath();
|
|
67628
|
-
if (
|
|
67629
|
-
|
|
67825
|
+
if (existsSync24(cachePath)) {
|
|
67826
|
+
unlinkSync9(cachePath);
|
|
67630
67827
|
}
|
|
67631
67828
|
} catch {}
|
|
67632
67829
|
}
|
|
@@ -68510,11 +68707,11 @@ var init_local_liveness = __esm(() => {
|
|
|
68510
68707
|
});
|
|
68511
68708
|
|
|
68512
68709
|
// src/providers/probe-catalog.ts
|
|
68513
|
-
import { existsSync as
|
|
68514
|
-
import { homedir as
|
|
68515
|
-
import { dirname as dirname10, join as
|
|
68710
|
+
import { existsSync as existsSync25, mkdirSync as mkdirSync15, readFileSync as readFileSync23, writeFileSync as writeFileSync17 } from "fs";
|
|
68711
|
+
import { homedir as homedir29 } from "os";
|
|
68712
|
+
import { dirname as dirname10, join as join31 } from "path";
|
|
68516
68713
|
function readProbeModelsCache(path2 = PROBE_MODELS_CACHE_PATH) {
|
|
68517
|
-
if (!
|
|
68714
|
+
if (!existsSync25(path2))
|
|
68518
68715
|
return null;
|
|
68519
68716
|
let raw2;
|
|
68520
68717
|
try {
|
|
@@ -68647,7 +68844,7 @@ function isValidResponse(raw2) {
|
|
|
68647
68844
|
var PROBE_MODELS_URL = "https://us-central1-claudish-6da10.cloudfunctions.net/probeModels", CACHE_TTL_MS4, FETCH_TIMEOUT_MS3 = 15000, PROBE_MODELS_CACHE_PATH, _inFlight = null;
|
|
68648
68845
|
var init_probe_catalog = __esm(() => {
|
|
68649
68846
|
CACHE_TTL_MS4 = 60 * 60 * 1000;
|
|
68650
|
-
PROBE_MODELS_CACHE_PATH =
|
|
68847
|
+
PROBE_MODELS_CACHE_PATH = join31(homedir29(), ".claudish", "probe-models.json");
|
|
68651
68848
|
});
|
|
68652
68849
|
|
|
68653
68850
|
// src/tui/constants.ts
|
|
@@ -74845,13 +75042,15 @@ var exports_tui = {};
|
|
|
74845
75042
|
__export(exports_tui, {
|
|
74846
75043
|
startConfigTui: () => startConfigTui
|
|
74847
75044
|
});
|
|
74848
|
-
import { spawnSync as
|
|
75045
|
+
import { spawnSync as spawnSync4 } from "child_process";
|
|
74849
75046
|
import { createCliRenderer as createCliRenderer2 } from "@opentui/core";
|
|
74850
75047
|
import { createRoot as createRoot2 } from "@opentui/react";
|
|
74851
75048
|
import { jsxDEV as jsxDEV17 } from "@opentui/react/jsx-dev-runtime";
|
|
74852
75049
|
async function startConfigTui() {
|
|
74853
75050
|
setStderrQuiet(true);
|
|
74854
|
-
const loginRequest = {
|
|
75051
|
+
const loginRequest = {
|
|
75052
|
+
slug: null
|
|
75053
|
+
};
|
|
74855
75054
|
const requestLogin = (slug) => {
|
|
74856
75055
|
loginRequest.slug = slug;
|
|
74857
75056
|
};
|
|
@@ -74871,7 +75070,7 @@ async function startConfigTui() {
|
|
|
74871
75070
|
console.log(`
|
|
74872
75071
|
Launching: claudish login ${slug}
|
|
74873
75072
|
`);
|
|
74874
|
-
const result =
|
|
75073
|
+
const result = spawnSync4(process.argv[0], [process.argv[1], "login", slug], {
|
|
74875
75074
|
stdio: "inherit"
|
|
74876
75075
|
});
|
|
74877
75076
|
if (result.error) {
|
|
@@ -74883,7 +75082,10 @@ Launching: claudish login ${slug}
|
|
|
74883
75082
|
\u274C Login exited with status ${result.status}
|
|
74884
75083
|
`);
|
|
74885
75084
|
} else {
|
|
74886
|
-
if (slug === "
|
|
75085
|
+
if (slug === "antigravity") {
|
|
75086
|
+
_resetAntigravityTokenState();
|
|
75087
|
+
invalidateProbeProxyHandlers("antigravity");
|
|
75088
|
+
} else if (slug === "gemini") {
|
|
74887
75089
|
reloadGeminiCredentials();
|
|
74888
75090
|
invalidateProbeProxyHandlers("google");
|
|
74889
75091
|
invalidateProbeProxyHandlers("gemini-codeassist");
|
|
@@ -74904,6 +75106,7 @@ Returning to config\u2026
|
|
|
74904
75106
|
}
|
|
74905
75107
|
var isDirectRun = false;
|
|
74906
75108
|
var init_tui = __esm(() => {
|
|
75109
|
+
init_antigravity_token();
|
|
74907
75110
|
init_codex_oauth();
|
|
74908
75111
|
init_gemini_oauth();
|
|
74909
75112
|
init_kimi_oauth();
|
|
@@ -74992,17 +75195,17 @@ __export(exports_claude_runner, {
|
|
|
74992
75195
|
import { spawn as spawn4 } from "child_process";
|
|
74993
75196
|
import {
|
|
74994
75197
|
closeSync as closeSync5,
|
|
74995
|
-
existsSync as
|
|
75198
|
+
existsSync as existsSync26,
|
|
74996
75199
|
mkdirSync as mkdirSync16,
|
|
74997
75200
|
openSync as openSync5,
|
|
74998
75201
|
readFileSync as readFileSync24,
|
|
74999
75202
|
readdirSync as readdirSync6,
|
|
75000
75203
|
statSync as statSync5,
|
|
75001
|
-
unlinkSync as
|
|
75204
|
+
unlinkSync as unlinkSync10,
|
|
75002
75205
|
writeFileSync as writeFileSync18
|
|
75003
75206
|
} from "fs";
|
|
75004
|
-
import { homedir as
|
|
75005
|
-
import { dirname as dirname11, join as
|
|
75207
|
+
import { homedir as homedir30, tmpdir as tmpdir2 } from "os";
|
|
75208
|
+
import { dirname as dirname11, join as join32 } from "path";
|
|
75006
75209
|
import { isatty } from "tty";
|
|
75007
75210
|
function releaseTerminalIsolation() {
|
|
75008
75211
|
if (!restoreTerminal)
|
|
@@ -75037,7 +75240,7 @@ function isProxyAuthMode(config3) {
|
|
|
75037
75240
|
}
|
|
75038
75241
|
function managedSettingsPath() {
|
|
75039
75242
|
if (isWindows2()) {
|
|
75040
|
-
return
|
|
75243
|
+
return join32(process.env.PROGRAMDATA || "C:\\ProgramData", "ClaudeCode", "managed-settings.json");
|
|
75041
75244
|
}
|
|
75042
75245
|
if (process.platform === "darwin") {
|
|
75043
75246
|
return "/Library/Application Support/ClaudeCode/managed-settings.json";
|
|
@@ -75058,9 +75261,9 @@ function isWindows2() {
|
|
|
75058
75261
|
}
|
|
75059
75262
|
function createStatusLineScript(tokenFilePath) {
|
|
75060
75263
|
const homeDir = process.env.HOME || process.env.USERPROFILE || tmpdir2();
|
|
75061
|
-
const claudishDir =
|
|
75264
|
+
const claudishDir = join32(homeDir, ".claudish");
|
|
75062
75265
|
const timestamp = Date.now();
|
|
75063
|
-
const scriptPath =
|
|
75266
|
+
const scriptPath = join32(claudishDir, `status-${timestamp}.js`);
|
|
75064
75267
|
const escapedTokenPath = tokenFilePath.replace(/\\/g, "\\\\");
|
|
75065
75268
|
const script = `
|
|
75066
75269
|
const fs = require('fs');
|
|
@@ -75215,11 +75418,11 @@ function cleanupStaleTokenFiles(dir, now = Date.now(), maxAgeMs = STALE_TOKEN_FI
|
|
|
75215
75418
|
if (!name.startsWith("tokens-") || !name.endsWith(".json"))
|
|
75216
75419
|
continue;
|
|
75217
75420
|
scanned++;
|
|
75218
|
-
const full =
|
|
75421
|
+
const full = join32(dir, name);
|
|
75219
75422
|
try {
|
|
75220
75423
|
if (statSync5(full).mtimeMs >= cutoff)
|
|
75221
75424
|
continue;
|
|
75222
|
-
|
|
75425
|
+
unlinkSync10(full);
|
|
75223
75426
|
removed++;
|
|
75224
75427
|
} catch {}
|
|
75225
75428
|
}
|
|
@@ -75244,13 +75447,13 @@ function parseSettingsArgSafe(value) {
|
|
|
75244
75447
|
}
|
|
75245
75448
|
function userSettingsFileCandidates(cwd) {
|
|
75246
75449
|
return [
|
|
75247
|
-
|
|
75248
|
-
|
|
75249
|
-
|
|
75450
|
+
join32(homedir30(), ".claude", "settings.json"),
|
|
75451
|
+
join32(cwd, ".claude", "settings.json"),
|
|
75452
|
+
join32(cwd, ".claude", "settings.local.json")
|
|
75250
75453
|
];
|
|
75251
75454
|
}
|
|
75252
75455
|
function discoverUserStatusLineCommand(claudeArgs = [], cwd = process.cwd()) {
|
|
75253
|
-
const sources = userSettingsFileCandidates(cwd).filter((file2) =>
|
|
75456
|
+
const sources = userSettingsFileCandidates(cwd).filter((file2) => existsSync26(file2));
|
|
75254
75457
|
const idx = claudeArgs.indexOf("--settings");
|
|
75255
75458
|
const settingsArg = idx === -1 ? undefined : claudeArgs[idx + 1];
|
|
75256
75459
|
if (settingsArg)
|
|
@@ -75287,13 +75490,13 @@ function buildChainedStatusCommand(userCommand, claudishBody, claudishSegment) {
|
|
|
75287
75490
|
}
|
|
75288
75491
|
function createTempSettingsFile(_modelDisplay, port, proxyAuthMode, userStatusLineCommand) {
|
|
75289
75492
|
const homeDir = process.env.HOME || process.env.USERPROFILE || tmpdir2();
|
|
75290
|
-
const claudishDir =
|
|
75493
|
+
const claudishDir = join32(homeDir, ".claudish");
|
|
75291
75494
|
try {
|
|
75292
75495
|
mkdirSync16(claudishDir, { recursive: true });
|
|
75293
75496
|
} catch {}
|
|
75294
75497
|
const timestamp = Date.now();
|
|
75295
|
-
const tempPath =
|
|
75296
|
-
const tokenFilePath =
|
|
75498
|
+
const tempPath = join32(claudishDir, `settings-${timestamp}.json`);
|
|
75499
|
+
const tokenFilePath = join32(claudishDir, `tokens-${port}.json`);
|
|
75297
75500
|
cleanupStaleTokenFiles(claudishDir);
|
|
75298
75501
|
initializeTokenFile(tokenFilePath);
|
|
75299
75502
|
let statusCommand;
|
|
@@ -75560,8 +75763,8 @@ async function runClaudeWithProxy(config3, proxyUrl, onCleanup) {
|
|
|
75560
75763
|
console.error("Install it from: https://claude.com/claude-code");
|
|
75561
75764
|
console.error(`
|
|
75562
75765
|
Or set CLAUDE_PATH to your custom installation:`);
|
|
75563
|
-
const home =
|
|
75564
|
-
const localPath = isWindows2() ?
|
|
75766
|
+
const home = homedir30();
|
|
75767
|
+
const localPath = isWindows2() ? join32(home, ".claude", "local", "claude.exe") : join32(home, ".claude", "local", "claude");
|
|
75565
75768
|
console.error(` export CLAUDE_PATH=${localPath}`);
|
|
75566
75769
|
process.exit(1);
|
|
75567
75770
|
}
|
|
@@ -75612,7 +75815,7 @@ Or set CLAUDE_PATH to your custom installation:`);
|
|
|
75612
75815
|
});
|
|
75613
75816
|
releaseTerminalIsolation();
|
|
75614
75817
|
try {
|
|
75615
|
-
|
|
75818
|
+
unlinkSync10(tempSettingsPath);
|
|
75616
75819
|
} catch {}
|
|
75617
75820
|
return exitCode;
|
|
75618
75821
|
}
|
|
@@ -75632,7 +75835,7 @@ function setupSignalHandlers(proc, tempSettingsPath, quiet, onCleanup) {
|
|
|
75632
75835
|
} catch {}
|
|
75633
75836
|
}
|
|
75634
75837
|
try {
|
|
75635
|
-
|
|
75838
|
+
unlinkSync10(tempSettingsPath);
|
|
75636
75839
|
} catch {}
|
|
75637
75840
|
process.exit(0);
|
|
75638
75841
|
});
|
|
@@ -75641,23 +75844,23 @@ function setupSignalHandlers(proc, tempSettingsPath, quiet, onCleanup) {
|
|
|
75641
75844
|
async function findClaudeBinary() {
|
|
75642
75845
|
const isWindows3 = process.platform === "win32";
|
|
75643
75846
|
if (process.env.CLAUDE_PATH) {
|
|
75644
|
-
if (
|
|
75847
|
+
if (existsSync26(process.env.CLAUDE_PATH)) {
|
|
75645
75848
|
return process.env.CLAUDE_PATH;
|
|
75646
75849
|
}
|
|
75647
75850
|
}
|
|
75648
|
-
const home =
|
|
75649
|
-
const localPath = isWindows3 ?
|
|
75650
|
-
if (
|
|
75851
|
+
const home = homedir30();
|
|
75852
|
+
const localPath = isWindows3 ? join32(home, ".claude", "local", "claude.exe") : join32(home, ".claude", "local", "claude");
|
|
75853
|
+
if (existsSync26(localPath)) {
|
|
75651
75854
|
return localPath;
|
|
75652
75855
|
}
|
|
75653
75856
|
if (isWindows3) {
|
|
75654
75857
|
const windowsPaths = [
|
|
75655
|
-
|
|
75656
|
-
|
|
75657
|
-
|
|
75858
|
+
join32(home, "AppData", "Roaming", "npm", "claude.cmd"),
|
|
75859
|
+
join32(home, ".npm-global", "claude.cmd"),
|
|
75860
|
+
join32(home, "node_modules", ".bin", "claude.cmd")
|
|
75658
75861
|
];
|
|
75659
75862
|
for (const path2 of windowsPaths) {
|
|
75660
|
-
if (
|
|
75863
|
+
if (existsSync26(path2)) {
|
|
75661
75864
|
return path2;
|
|
75662
75865
|
}
|
|
75663
75866
|
}
|
|
@@ -75665,14 +75868,14 @@ async function findClaudeBinary() {
|
|
|
75665
75868
|
const commonPaths = [
|
|
75666
75869
|
"/usr/local/bin/claude",
|
|
75667
75870
|
"/opt/homebrew/bin/claude",
|
|
75668
|
-
|
|
75669
|
-
|
|
75670
|
-
|
|
75871
|
+
join32(home, ".npm-global/bin/claude"),
|
|
75872
|
+
join32(home, ".local/bin/claude"),
|
|
75873
|
+
join32(home, "node_modules/.bin/claude"),
|
|
75671
75874
|
"/data/data/com.termux/files/usr/bin/claude",
|
|
75672
|
-
|
|
75875
|
+
join32(home, "../usr/bin/claude")
|
|
75673
75876
|
];
|
|
75674
75877
|
for (const path2 of commonPaths) {
|
|
75675
|
-
if (
|
|
75878
|
+
if (existsSync26(path2)) {
|
|
75676
75879
|
return path2;
|
|
75677
75880
|
}
|
|
75678
75881
|
}
|
|
@@ -75732,18 +75935,18 @@ __export(exports_diag_output, {
|
|
|
75732
75935
|
NullDiagOutput: () => NullDiagOutput,
|
|
75733
75936
|
LogFileDiagOutput: () => LogFileDiagOutput
|
|
75734
75937
|
});
|
|
75735
|
-
import { createWriteStream as createWriteStream3, mkdirSync as mkdirSync17, unlinkSync as
|
|
75736
|
-
import { homedir as
|
|
75737
|
-
import { join as
|
|
75938
|
+
import { createWriteStream as createWriteStream3, mkdirSync as mkdirSync17, unlinkSync as unlinkSync11, writeFileSync as writeFileSync19 } from "fs";
|
|
75939
|
+
import { homedir as homedir31 } from "os";
|
|
75940
|
+
import { join as join33 } from "path";
|
|
75738
75941
|
function getClaudishDir() {
|
|
75739
|
-
const dir =
|
|
75942
|
+
const dir = join33(homedir31(), ".claudish");
|
|
75740
75943
|
try {
|
|
75741
75944
|
mkdirSync17(dir, { recursive: true });
|
|
75742
75945
|
} catch {}
|
|
75743
75946
|
return dir;
|
|
75744
75947
|
}
|
|
75745
75948
|
function getDiagLogPath() {
|
|
75746
|
-
return
|
|
75949
|
+
return join33(getClaudishDir(), `diag-${process.pid}.log`);
|
|
75747
75950
|
}
|
|
75748
75951
|
|
|
75749
75952
|
class LogFileDiagOutput {
|
|
@@ -75771,7 +75974,7 @@ class LogFileDiagOutput {
|
|
|
75771
75974
|
this.stream.end();
|
|
75772
75975
|
} catch {}
|
|
75773
75976
|
try {
|
|
75774
|
-
|
|
75977
|
+
unlinkSync11(this.logPath);
|
|
75775
75978
|
} catch {}
|
|
75776
75979
|
}
|
|
75777
75980
|
getLogPath() {
|
|
@@ -75954,9 +76157,9 @@ __export(exports_team_grid, {
|
|
|
75954
76157
|
});
|
|
75955
76158
|
import { spawn as spawn5 } from "child_process";
|
|
75956
76159
|
import { execSync as execSync2 } from "child_process";
|
|
75957
|
-
import { existsSync as
|
|
76160
|
+
import { existsSync as existsSync27, readFileSync as readFileSync25, writeFileSync as writeFileSync20 } from "fs";
|
|
75958
76161
|
import { connect as netConnect } from "net";
|
|
75959
|
-
import { dirname as dirname12, join as
|
|
76162
|
+
import { dirname as dirname12, join as join34 } from "path";
|
|
75960
76163
|
import { setTimeout as wait } from "timers/promises";
|
|
75961
76164
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
75962
76165
|
function resolveRouteInfo(modelId) {
|
|
@@ -76050,18 +76253,18 @@ function buildPaneHeader(model, prompt, bg) {
|
|
|
76050
76253
|
function findMagmuxBinary() {
|
|
76051
76254
|
const thisFile = fileURLToPath3(import.meta.url);
|
|
76052
76255
|
const thisDir = dirname12(thisFile);
|
|
76053
|
-
const pkgRoot =
|
|
76256
|
+
const pkgRoot = join34(thisDir, "..");
|
|
76054
76257
|
const platform3 = process.platform;
|
|
76055
76258
|
const arch = process.arch;
|
|
76056
|
-
const bundledMagmux =
|
|
76057
|
-
if (
|
|
76259
|
+
const bundledMagmux = join34(pkgRoot, "native", `magmux-${platform3}-${arch}`);
|
|
76260
|
+
if (existsSync27(bundledMagmux))
|
|
76058
76261
|
return bundledMagmux;
|
|
76059
76262
|
try {
|
|
76060
76263
|
const pkgName = `@claudish/magmux-${platform3}-${arch}`;
|
|
76061
76264
|
let searchDir = pkgRoot;
|
|
76062
76265
|
for (let i = 0;i < 5; i++) {
|
|
76063
|
-
const candidate =
|
|
76064
|
-
if (
|
|
76266
|
+
const candidate = join34(searchDir, "node_modules", pkgName, "bin", "magmux");
|
|
76267
|
+
if (existsSync27(candidate))
|
|
76065
76268
|
return candidate;
|
|
76066
76269
|
const parent = dirname12(searchDir);
|
|
76067
76270
|
if (parent === searchDir)
|
|
@@ -76080,7 +76283,7 @@ function findMagmuxBinary() {
|
|
|
76080
76283
|
async function subscribeToMagmux(sockPath, onEvent) {
|
|
76081
76284
|
let client = null;
|
|
76082
76285
|
for (let attempt = 0;attempt < 40; attempt++) {
|
|
76083
|
-
if (
|
|
76286
|
+
if (existsSync27(sockPath)) {
|
|
76084
76287
|
try {
|
|
76085
76288
|
client = await new Promise((resolve4, reject) => {
|
|
76086
76289
|
const s = netConnect(sockPath);
|
|
@@ -76167,9 +76370,9 @@ async function runWithGrid(sessionPath, models, input, opts) {
|
|
|
76167
76370
|
const keep = opts?.keep ?? false;
|
|
76168
76371
|
const manifest = setupSession(sessionPath, models, input);
|
|
76169
76372
|
const startedAt = new Date().toISOString();
|
|
76170
|
-
const gridfilePath =
|
|
76171
|
-
const prompt = readFileSync25(
|
|
76172
|
-
const rawPrompt = readFileSync25(
|
|
76373
|
+
const gridfilePath = join34(sessionPath, "gridfile.txt");
|
|
76374
|
+
const prompt = readFileSync25(join34(sessionPath, "input.md"), "utf-8").replace(/'/g, "'\\''").replace(/\n/g, " ");
|
|
76375
|
+
const rawPrompt = readFileSync25(join34(sessionPath, "input.md"), "utf-8");
|
|
76173
76376
|
const usedBannerColors = new Set;
|
|
76174
76377
|
const gridLines = Object.entries(manifest.models).map(([anonId]) => {
|
|
76175
76378
|
const model = manifest.models[anonId].model;
|
|
@@ -76200,7 +76403,7 @@ async function runWithGrid(sessionPath, models, input, opts) {
|
|
|
76200
76403
|
});
|
|
76201
76404
|
const [{ results: results2 }] = await Promise.all([subscription, procExit]);
|
|
76202
76405
|
const status = buildTeamStatus(manifest, startedAt, results2?.panes ?? null);
|
|
76203
|
-
const statusPath =
|
|
76406
|
+
const statusPath = join34(sessionPath, "status.json");
|
|
76204
76407
|
writeFileSync20(statusPath, JSON.stringify(status, null, 2), "utf-8");
|
|
76205
76408
|
return status;
|
|
76206
76409
|
}
|
|
@@ -76224,8 +76427,8 @@ var init_team_grid = __esm(() => {
|
|
|
76224
76427
|
init_op_source();
|
|
76225
76428
|
init_startup_trace();
|
|
76226
76429
|
var import_dotenv3 = __toESM(require_main(), 1);
|
|
76227
|
-
import { existsSync as
|
|
76228
|
-
import { join as
|
|
76430
|
+
import { existsSync as existsSync28, readFileSync as readFileSync26 } from "fs";
|
|
76431
|
+
import { join as join35, resolve as resolve4 } from "path";
|
|
76229
76432
|
import_dotenv3.config({ quiet: true });
|
|
76230
76433
|
function classifyStartupKind() {
|
|
76231
76434
|
const argv = process.argv.slice(2);
|
|
@@ -76324,7 +76527,7 @@ async function applyConfigOverride() {
|
|
|
76324
76527
|
const { planConfigOverride: planConfigOverride2, setConfigFileOverride: setConfigFileOverride2 } = await Promise.resolve().then(() => exports_config_override);
|
|
76325
76528
|
const plan = planConfigOverride2(process.argv.slice(2), process.env, {
|
|
76326
76529
|
resolve: resolve4,
|
|
76327
|
-
exists:
|
|
76530
|
+
exists: existsSync28
|
|
76328
76531
|
});
|
|
76329
76532
|
if (plan.kind === "none")
|
|
76330
76533
|
return;
|
|
@@ -76367,7 +76570,13 @@ var isLegacyGeminiLogout = args.includes("--gemini-logout");
|
|
|
76367
76570
|
var isLegacyKimiLogin = args.includes("--kimi-login");
|
|
76368
76571
|
var isLegacyKimiLogout = args.includes("--kimi-logout");
|
|
76369
76572
|
if (isMcpMode) {
|
|
76370
|
-
Promise.resolve().then(() => (init_mcp_server(), exports_mcp_server)).then((mcp) =>
|
|
76573
|
+
Promise.resolve().then(() => (init_mcp_server(), exports_mcp_server)).then(async (mcp) => {
|
|
76574
|
+
mcp.startMcpServer();
|
|
76575
|
+
if (process.env.CLAUDISH_STARTUP_TRACE === "1") {
|
|
76576
|
+
const { finalizeStartupTrace: finalizeStartupTrace2 } = await Promise.resolve().then(() => (init_startup_trace(), exports_startup_trace));
|
|
76577
|
+
finalizeStartupTrace2("mcp", { quiet: true });
|
|
76578
|
+
}
|
|
76579
|
+
});
|
|
76371
76580
|
} else if (isServeCommand) {
|
|
76372
76581
|
const serveArgIndex = args.indexOf("serve");
|
|
76373
76582
|
Promise.resolve().then(() => (init_serve_command(), exports_serve_command)).then((m) => m.serveCommand(args.slice(serveArgIndex + 1)).catch((e) => {
|
|
@@ -76473,7 +76682,7 @@ async function runCli() {
|
|
|
76473
76682
|
process.exit(1);
|
|
76474
76683
|
}
|
|
76475
76684
|
const mode = cliConfig.teamMode ?? "default";
|
|
76476
|
-
const sessionPath =
|
|
76685
|
+
const sessionPath = join35(process.cwd(), `.claudish-team-${Date.now()}`);
|
|
76477
76686
|
if (mode === "json") {
|
|
76478
76687
|
const { setupSession: setupSession2, runModels: runModels2 } = await Promise.resolve().then(() => (init_team_orchestrator(), exports_team_orchestrator));
|
|
76479
76688
|
setupSession2(sessionPath, cliConfig.team, prompt);
|
|
@@ -76483,7 +76692,7 @@ async function runCli() {
|
|
|
76483
76692
|
});
|
|
76484
76693
|
const result = { ...status2, responses: {} };
|
|
76485
76694
|
for (const anonId of Object.keys(status2.models)) {
|
|
76486
|
-
const responsePath =
|
|
76695
|
+
const responsePath = join35(sessionPath, `response-${anonId}.md`);
|
|
76487
76696
|
try {
|
|
76488
76697
|
const raw2 = readFileSync26(responsePath, "utf-8").trim();
|
|
76489
76698
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudish",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.34.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.34.0",
|
|
64
|
+
"@claudish/magmux-darwin-x64": "7.34.0",
|
|
65
|
+
"@claudish/magmux-linux-arm64": "7.34.0",
|
|
66
|
+
"@claudish/magmux-linux-x64": "7.34.0"
|
|
67
67
|
},
|
|
68
68
|
"author": "Jack Rudenko <i@madappgang.com>",
|
|
69
69
|
"license": "MIT",
|