snowcode 0.9.0 → 0.9.2
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/README.md +94 -7
- package/dist/cli.mjs +451 -420
- package/package.json +3 -2
package/dist/cli.mjs
CHANGED
|
@@ -811,6 +811,9 @@ function updateAccount(id, updates) {
|
|
|
811
811
|
Object.assign(acc, updates);
|
|
812
812
|
saveAccounts(data);
|
|
813
813
|
}
|
|
814
|
+
function getEnabledAccounts(type) {
|
|
815
|
+
return loadAccounts().accounts.filter((a) => a.enabled && (type == null || a.type === type));
|
|
816
|
+
}
|
|
814
817
|
var ACCOUNT_TYPE_LABELS;
|
|
815
818
|
var init_accountManager = __esm(() => {
|
|
816
819
|
init_envUtils();
|
|
@@ -109691,7 +109694,7 @@ class OpenAIShimMessages {
|
|
|
109691
109694
|
});
|
|
109692
109695
|
}
|
|
109693
109696
|
if (request.transport === "codex_responses") {
|
|
109694
|
-
const credentials =
|
|
109697
|
+
const credentials = await resolveCodexApiCredentialsForRequest();
|
|
109695
109698
|
if (!credentials.apiKey) {
|
|
109696
109699
|
const authHint = credentials.authPath ? ` or place a Codex auth.json at ${credentials.authPath}` : "";
|
|
109697
109700
|
throw new Error(`Codex auth is required for ${request.requestedModel}. Set CODEX_API_KEY${authHint}.`);
|
|
@@ -125645,7 +125648,7 @@ var init_metadata = __esm(() => {
|
|
|
125645
125648
|
isClaudeAiAuth: isClaudeAISubscriber(),
|
|
125646
125649
|
version: "99.0.0",
|
|
125647
125650
|
versionBase: getVersionBase(),
|
|
125648
|
-
buildTime: "2026-04-
|
|
125651
|
+
buildTime: "2026-04-05T03:33:03.306Z",
|
|
125649
125652
|
deploymentEnvironment: env2.detectDeploymentEnvironment(),
|
|
125650
125653
|
...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
|
|
125651
125654
|
githubEventName: process.env.GITHUB_EVENT_NAME,
|
|
@@ -129985,9 +129988,9 @@ var init_antigravityOAuth = __esm(() => {
|
|
|
129985
129988
|
});
|
|
129986
129989
|
|
|
129987
129990
|
// src/services/api/providerConfig.ts
|
|
129988
|
-
import { existsSync as existsSync7, readFileSync as readFileSync9 } from "node:fs";
|
|
129991
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync5, readFileSync as readFileSync9, writeFileSync as writeFileSync4 } from "node:fs";
|
|
129989
129992
|
import { homedir as homedir11 } from "node:os";
|
|
129990
|
-
import { join as join29 } from "node:path";
|
|
129993
|
+
import { dirname as dirname12, join as join29 } from "node:path";
|
|
129991
129994
|
function asTrimmedString(value) {
|
|
129992
129995
|
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
129993
129996
|
}
|
|
@@ -130366,6 +130369,104 @@ function loadCodexAuthJson(authPath) {
|
|
|
130366
130369
|
return;
|
|
130367
130370
|
}
|
|
130368
130371
|
}
|
|
130372
|
+
function readCodexAccountId(authJson, envAccountId, apiKey) {
|
|
130373
|
+
return envAccountId ?? (authJson ? readNestedString(authJson, [
|
|
130374
|
+
["account_id"],
|
|
130375
|
+
["accountId"],
|
|
130376
|
+
["tokens", "account_id"],
|
|
130377
|
+
["tokens", "accountId"],
|
|
130378
|
+
["auth", "account_id"],
|
|
130379
|
+
["auth", "accountId"]
|
|
130380
|
+
]) : undefined) ?? parseChatgptAccountId(apiKey);
|
|
130381
|
+
}
|
|
130382
|
+
function readCodexRefreshToken(authJson) {
|
|
130383
|
+
if (!authJson)
|
|
130384
|
+
return;
|
|
130385
|
+
return readNestedString(authJson, [
|
|
130386
|
+
["refresh_token"],
|
|
130387
|
+
["refreshToken"],
|
|
130388
|
+
["tokens", "refresh_token"],
|
|
130389
|
+
["tokens", "refreshToken"],
|
|
130390
|
+
["auth", "refresh_token"],
|
|
130391
|
+
["auth", "refreshToken"],
|
|
130392
|
+
["token", "refresh_token"],
|
|
130393
|
+
["token", "refreshToken"]
|
|
130394
|
+
]);
|
|
130395
|
+
}
|
|
130396
|
+
function getPreferredCodexOauthAccount(accounts) {
|
|
130397
|
+
return [...accounts].filter((account) => account.enabled && account.type === "codex_oauth" && Boolean(asTrimmedString(account.refreshToken))).sort((left, right) => {
|
|
130398
|
+
const leftAddedAt = Date.parse(left.addedAt || "");
|
|
130399
|
+
const rightAddedAt = Date.parse(right.addedAt || "");
|
|
130400
|
+
return rightAddedAt - leftAddedAt;
|
|
130401
|
+
})[0];
|
|
130402
|
+
}
|
|
130403
|
+
function getJwtExpiryTimeMs(token) {
|
|
130404
|
+
if (!token)
|
|
130405
|
+
return;
|
|
130406
|
+
const payload = decodeJwtPayload(token);
|
|
130407
|
+
const exp = payload?.exp;
|
|
130408
|
+
return typeof exp === "number" && Number.isFinite(exp) ? exp * 1000 : undefined;
|
|
130409
|
+
}
|
|
130410
|
+
function isExpiredOrNearExpiry(token) {
|
|
130411
|
+
if (!token)
|
|
130412
|
+
return true;
|
|
130413
|
+
const expiryMs = getJwtExpiryTimeMs(token);
|
|
130414
|
+
if (!expiryMs)
|
|
130415
|
+
return false;
|
|
130416
|
+
return expiryMs <= Date.now() + 60000;
|
|
130417
|
+
}
|
|
130418
|
+
async function refreshCodexAccessToken(refreshToken) {
|
|
130419
|
+
try {
|
|
130420
|
+
const response = await fetch(CODEX_TOKEN_URL, {
|
|
130421
|
+
method: "POST",
|
|
130422
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
130423
|
+
body: new URLSearchParams({
|
|
130424
|
+
client_id: CODEX_CLIENT_ID,
|
|
130425
|
+
refresh_token: refreshToken,
|
|
130426
|
+
grant_type: "refresh_token"
|
|
130427
|
+
}).toString()
|
|
130428
|
+
});
|
|
130429
|
+
if (!response.ok)
|
|
130430
|
+
return;
|
|
130431
|
+
const json2 = await response.json();
|
|
130432
|
+
const accessToken = asTrimmedString(json2.access_token);
|
|
130433
|
+
if (!accessToken)
|
|
130434
|
+
return;
|
|
130435
|
+
return {
|
|
130436
|
+
accessToken,
|
|
130437
|
+
refreshToken: asTrimmedString(json2.refresh_token)
|
|
130438
|
+
};
|
|
130439
|
+
} catch {
|
|
130440
|
+
return;
|
|
130441
|
+
}
|
|
130442
|
+
}
|
|
130443
|
+
function persistCodexAuthJson(options) {
|
|
130444
|
+
const next = options.existing ? JSON.parse(JSON.stringify(options.existing)) : {};
|
|
130445
|
+
next.access_token = options.accessToken;
|
|
130446
|
+
if (options.accountId) {
|
|
130447
|
+
next.account_id = options.accountId;
|
|
130448
|
+
}
|
|
130449
|
+
if (options.refreshToken) {
|
|
130450
|
+
next.refresh_token = options.refreshToken;
|
|
130451
|
+
}
|
|
130452
|
+
const buckets = ["tokens", "auth", "token"];
|
|
130453
|
+
for (const bucket of buckets) {
|
|
130454
|
+
const rawBucket = next[bucket];
|
|
130455
|
+
const target = rawBucket && typeof rawBucket === "object" ? rawBucket : bucket === "tokens" ? {} : undefined;
|
|
130456
|
+
if (!target)
|
|
130457
|
+
continue;
|
|
130458
|
+
target.access_token = options.accessToken;
|
|
130459
|
+
if (options.accountId) {
|
|
130460
|
+
target.account_id = options.accountId;
|
|
130461
|
+
}
|
|
130462
|
+
if (options.refreshToken) {
|
|
130463
|
+
target.refresh_token = options.refreshToken;
|
|
130464
|
+
}
|
|
130465
|
+
next[bucket] = target;
|
|
130466
|
+
}
|
|
130467
|
+
mkdirSync5(dirname12(options.authPath), { recursive: true });
|
|
130468
|
+
writeFileSync4(options.authPath, JSON.stringify(next, null, 2), "utf8");
|
|
130469
|
+
}
|
|
130369
130470
|
function resolveCodexApiCredentials(env4 = process.env) {
|
|
130370
130471
|
const envApiKey = asTrimmedString(env4.CODEX_API_KEY);
|
|
130371
130472
|
const envAccountId = asTrimmedString(env4.CODEX_ACCOUNT_ID) ?? asTrimmedString(env4.CHATGPT_ACCOUNT_ID);
|
|
@@ -130397,19 +130498,14 @@ function resolveCodexApiCredentials(env4 = process.env) {
|
|
|
130397
130498
|
["tokens", "id_token"],
|
|
130398
130499
|
["tokens", "idToken"]
|
|
130399
130500
|
]);
|
|
130400
|
-
const accountId =
|
|
130401
|
-
|
|
130402
|
-
["accountId"],
|
|
130403
|
-
["tokens", "account_id"],
|
|
130404
|
-
["tokens", "accountId"],
|
|
130405
|
-
["auth", "account_id"],
|
|
130406
|
-
["auth", "accountId"]
|
|
130407
|
-
]) ?? parseChatgptAccountId(apiKey);
|
|
130501
|
+
const accountId = readCodexAccountId(authJson, envAccountId, apiKey);
|
|
130502
|
+
const refreshToken = readCodexRefreshToken(authJson);
|
|
130408
130503
|
if (!apiKey) {
|
|
130409
130504
|
return {
|
|
130410
130505
|
apiKey: "",
|
|
130411
130506
|
accountId,
|
|
130412
130507
|
authPath,
|
|
130508
|
+
refreshToken,
|
|
130413
130509
|
source: "none"
|
|
130414
130510
|
};
|
|
130415
130511
|
}
|
|
@@ -130417,10 +130513,93 @@ function resolveCodexApiCredentials(env4 = process.env) {
|
|
|
130417
130513
|
apiKey,
|
|
130418
130514
|
accountId,
|
|
130419
130515
|
authPath,
|
|
130516
|
+
refreshToken,
|
|
130420
130517
|
source: "auth.json"
|
|
130421
130518
|
};
|
|
130422
130519
|
}
|
|
130423
|
-
|
|
130520
|
+
async function resolveCodexApiCredentialsForRequest(env4 = process.env) {
|
|
130521
|
+
const envApiKey = asTrimmedString(env4.CODEX_API_KEY);
|
|
130522
|
+
const envAccountId = asTrimmedString(env4.CODEX_ACCOUNT_ID) ?? asTrimmedString(env4.CHATGPT_ACCOUNT_ID);
|
|
130523
|
+
if (envApiKey) {
|
|
130524
|
+
return {
|
|
130525
|
+
apiKey: envApiKey,
|
|
130526
|
+
accountId: envAccountId ?? parseChatgptAccountId(envApiKey),
|
|
130527
|
+
source: "env"
|
|
130528
|
+
};
|
|
130529
|
+
}
|
|
130530
|
+
const authPath = resolveCodexAuthPath(env4);
|
|
130531
|
+
const authJson = loadCodexAuthJson(authPath);
|
|
130532
|
+
const authJsonApiKey = authJson ? readNestedString(authJson, [
|
|
130533
|
+
["access_token"],
|
|
130534
|
+
["accessToken"],
|
|
130535
|
+
["tokens", "access_token"],
|
|
130536
|
+
["tokens", "accessToken"],
|
|
130537
|
+
["auth", "access_token"],
|
|
130538
|
+
["auth", "accessToken"],
|
|
130539
|
+
["token", "access_token"],
|
|
130540
|
+
["token", "accessToken"],
|
|
130541
|
+
["tokens", "id_token"],
|
|
130542
|
+
["tokens", "idToken"]
|
|
130543
|
+
]) : undefined;
|
|
130544
|
+
const authJsonRefreshToken = readCodexRefreshToken(authJson);
|
|
130545
|
+
const authJsonAccountId = readCodexAccountId(authJson, envAccountId, authJsonApiKey);
|
|
130546
|
+
if (authJsonApiKey && authJsonAccountId && !isExpiredOrNearExpiry(authJsonApiKey)) {
|
|
130547
|
+
return {
|
|
130548
|
+
apiKey: authJsonApiKey,
|
|
130549
|
+
accountId: authJsonAccountId,
|
|
130550
|
+
authPath,
|
|
130551
|
+
refreshToken: authJsonRefreshToken,
|
|
130552
|
+
source: "auth.json"
|
|
130553
|
+
};
|
|
130554
|
+
}
|
|
130555
|
+
const preferredAccount = getPreferredCodexOauthAccount(loadAccounts().accounts);
|
|
130556
|
+
const refreshToken = authJsonRefreshToken ?? asTrimmedString(preferredAccount?.refreshToken);
|
|
130557
|
+
if (refreshToken) {
|
|
130558
|
+
const refreshed2 = await refreshCodexAccessToken(refreshToken);
|
|
130559
|
+
if (refreshed2?.accessToken) {
|
|
130560
|
+
const refreshedAccountId = envAccountId ?? parseChatgptAccountId(refreshed2.accessToken) ?? authJsonAccountId;
|
|
130561
|
+
const rotatedRefreshToken = refreshed2.refreshToken ?? refreshToken;
|
|
130562
|
+
persistCodexAuthJson({
|
|
130563
|
+
authPath,
|
|
130564
|
+
existing: authJson,
|
|
130565
|
+
accessToken: refreshed2.accessToken,
|
|
130566
|
+
accountId: refreshedAccountId,
|
|
130567
|
+
refreshToken: rotatedRefreshToken
|
|
130568
|
+
});
|
|
130569
|
+
if (preferredAccount?.id && rotatedRefreshToken !== preferredAccount.refreshToken) {
|
|
130570
|
+
updateAccount(preferredAccount.id, {
|
|
130571
|
+
refreshToken: rotatedRefreshToken
|
|
130572
|
+
});
|
|
130573
|
+
}
|
|
130574
|
+
return {
|
|
130575
|
+
apiKey: refreshed2.accessToken,
|
|
130576
|
+
accountId: refreshedAccountId,
|
|
130577
|
+
authPath,
|
|
130578
|
+
refreshToken: rotatedRefreshToken,
|
|
130579
|
+
accountRecordId: preferredAccount?.id,
|
|
130580
|
+
source: authJsonRefreshToken ? "auth.json" : "accounts"
|
|
130581
|
+
};
|
|
130582
|
+
}
|
|
130583
|
+
}
|
|
130584
|
+
if (authJsonApiKey) {
|
|
130585
|
+
return {
|
|
130586
|
+
apiKey: authJsonApiKey,
|
|
130587
|
+
accountId: authJsonAccountId,
|
|
130588
|
+
authPath,
|
|
130589
|
+
refreshToken: authJsonRefreshToken,
|
|
130590
|
+
source: "auth.json"
|
|
130591
|
+
};
|
|
130592
|
+
}
|
|
130593
|
+
return {
|
|
130594
|
+
apiKey: "",
|
|
130595
|
+
accountId: authJsonAccountId ?? envAccountId,
|
|
130596
|
+
authPath,
|
|
130597
|
+
refreshToken,
|
|
130598
|
+
accountRecordId: preferredAccount?.id,
|
|
130599
|
+
source: "none"
|
|
130600
|
+
};
|
|
130601
|
+
}
|
|
130602
|
+
var DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1", DEFAULT_CODEX_BASE_URL = "https://chatgpt.com/backend-api/codex", DEFAULT_VERTEX_BASE_URL = "https://aiplatform.googleapis.com/v1", DEFAULT_ANTIGRAVITY_BASE_URL = "https://daily-cloudcode-pa.googleapis.com", ANTIGRAVITY_FALLBACK_BASE_URLS, DEFAULT_GEMINI_OPENAI_BASE_URL = "https://generativelanguage.googleapis.com/v1beta/openai", DEFAULT_ZAI_BASE_URL = "https://api.z.ai/api/paas/v4", GOOGLE_OAUTH_TOKEN_URL = "https://oauth2.googleapis.com/token", CODEX_TOKEN_URL = "https://auth.openai.com/oauth/token", CODEX_CLIENT_ID = "app_EMoamEEZ73f0CkXaXp7hrann", CODEX_ALIAS_MODELS, LOCALHOST_HOSTNAMES, PREFIX_TO_ACCOUNT_TYPE;
|
|
130424
130603
|
var init_providerConfig = __esm(() => {
|
|
130425
130604
|
init_accountManager();
|
|
130426
130605
|
init_antigravityOAuth();
|
|
@@ -130460,10 +130639,11 @@ var init_providerConfig = __esm(() => {
|
|
|
130460
130639
|
});
|
|
130461
130640
|
|
|
130462
130641
|
// src/utils/updateCheck.ts
|
|
130463
|
-
import { existsSync as existsSync8, mkdirSync as
|
|
130642
|
+
import { existsSync as existsSync8, mkdirSync as mkdirSync6, readFileSync as readFileSync10, writeFileSync as writeFileSync5 } from "node:fs";
|
|
130464
130643
|
import { join as join30 } from "node:path";
|
|
130465
130644
|
function getCurrentVersion() {
|
|
130466
|
-
|
|
130645
|
+
const displayVersion = (typeof MACRO !== "undefined" ? "0.9.2" : undefined) ?? "0.0.0";
|
|
130646
|
+
return displayVersion.replace(/[^0-9.]/g, "") || "0.0.0";
|
|
130467
130647
|
}
|
|
130468
130648
|
function cachePath() {
|
|
130469
130649
|
return join30(getClaudeConfigHomeDir(), "update-check.json");
|
|
@@ -130482,10 +130662,27 @@ function writeUpdateCache(cache2) {
|
|
|
130482
130662
|
try {
|
|
130483
130663
|
const dir = getClaudeConfigHomeDir();
|
|
130484
130664
|
if (!existsSync8(dir))
|
|
130485
|
-
|
|
130486
|
-
|
|
130665
|
+
mkdirSync6(dir, { recursive: true });
|
|
130666
|
+
writeFileSync5(cachePath(), JSON.stringify(cache2));
|
|
130487
130667
|
} catch {}
|
|
130488
130668
|
}
|
|
130669
|
+
function isUpdateCacheFresh(cache2, now = Date.now()) {
|
|
130670
|
+
return Boolean(cache2 && now - cache2.checkedAt < CHECK_INTERVAL_MS);
|
|
130671
|
+
}
|
|
130672
|
+
async function fetchLatestVersion(timeoutMs) {
|
|
130673
|
+
try {
|
|
130674
|
+
const res = await fetch(`https://registry.npmjs.org/${PKG_NAME}/latest`, {
|
|
130675
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
130676
|
+
headers: { Accept: "application/json" }
|
|
130677
|
+
});
|
|
130678
|
+
if (!res.ok)
|
|
130679
|
+
return null;
|
|
130680
|
+
const data = await res.json();
|
|
130681
|
+
return typeof data.version === "string" ? data.version : null;
|
|
130682
|
+
} catch {
|
|
130683
|
+
return null;
|
|
130684
|
+
}
|
|
130685
|
+
}
|
|
130489
130686
|
function getAvailableUpdate(cache2) {
|
|
130490
130687
|
if (!cache2)
|
|
130491
130688
|
return null;
|
|
@@ -130501,25 +130698,25 @@ function getAvailableUpdate(cache2) {
|
|
|
130501
130698
|
}
|
|
130502
130699
|
return null;
|
|
130503
130700
|
}
|
|
130504
|
-
function
|
|
130701
|
+
async function refreshUpdateCache(options) {
|
|
130505
130702
|
const cache2 = readUpdateCache();
|
|
130506
|
-
|
|
130507
|
-
|
|
130508
|
-
|
|
130509
|
-
|
|
130510
|
-
|
|
130511
|
-
|
|
130512
|
-
|
|
130513
|
-
|
|
130514
|
-
|
|
130515
|
-
|
|
130516
|
-
|
|
130517
|
-
|
|
130518
|
-
|
|
130519
|
-
|
|
130520
|
-
|
|
130521
|
-
|
|
130522
|
-
|
|
130703
|
+
if (!options?.force && isUpdateCacheFresh(cache2)) {
|
|
130704
|
+
return cache2;
|
|
130705
|
+
}
|
|
130706
|
+
const latestVersion = await fetchLatestVersion(options?.timeoutMs ?? 5000);
|
|
130707
|
+
if (!latestVersion) {
|
|
130708
|
+
return cache2;
|
|
130709
|
+
}
|
|
130710
|
+
const nextCache = {
|
|
130711
|
+
latestVersion,
|
|
130712
|
+
checkedAt: Date.now()
|
|
130713
|
+
};
|
|
130714
|
+
writeUpdateCache(nextCache);
|
|
130715
|
+
return nextCache;
|
|
130716
|
+
}
|
|
130717
|
+
async function getAvailableUpdateWithRefresh(options) {
|
|
130718
|
+
const cache2 = await refreshUpdateCache(options);
|
|
130719
|
+
return getAvailableUpdate(cache2);
|
|
130523
130720
|
}
|
|
130524
130721
|
var PKG_NAME = "snowcode", CHECK_INTERVAL_MS;
|
|
130525
130722
|
var init_updateCheck = __esm(() => {
|
|
@@ -130625,7 +130822,7 @@ function boxRow(content, width, rawLen) {
|
|
|
130625
130822
|
const pad = Math.max(0, width - 2 - rawLen);
|
|
130626
130823
|
return `${rgb(...BORDER)}│${RESET}${content}${" ".repeat(pad)}${rgb(...BORDER)}│${RESET}`;
|
|
130627
130824
|
}
|
|
130628
|
-
function printStartupScreen() {
|
|
130825
|
+
async function printStartupScreen() {
|
|
130629
130826
|
if (process.env.CI || !process.stdout.isTTY)
|
|
130630
130827
|
return;
|
|
130631
130828
|
const p = detectProvider();
|
|
@@ -130660,9 +130857,8 @@ function printStartupScreen() {
|
|
|
130660
130857
|
const sLen = ` ● ${sL} Ready — type /help to begin`.length;
|
|
130661
130858
|
out.push(boxRow(sRow, W2, sLen));
|
|
130662
130859
|
out.push(`${rgb(...BORDER)}╚${"═".repeat(W2 - 2)}╝${RESET}`);
|
|
130663
|
-
const _ver = "0.9.
|
|
130664
|
-
|
|
130665
|
-
const _update = getAvailableUpdate(readUpdateCache());
|
|
130860
|
+
const _ver = "0.9.2";
|
|
130861
|
+
const _update = await getAvailableUpdateWithRefresh({ timeoutMs: 1200 });
|
|
130666
130862
|
out.push(` ${DIM}${rgb(...DIMCOL)}snowcode v${_ver}${RESET}`);
|
|
130667
130863
|
if (_update) {
|
|
130668
130864
|
out.push(` ${rgb(...ACCENT)}★ Update available v${_update} → /update${RESET}`);
|
|
@@ -162367,7 +162563,7 @@ var init_MessageResponse = __esm(() => {
|
|
|
162367
162563
|
|
|
162368
162564
|
// src/commands/add-dir/validation.ts
|
|
162369
162565
|
import { stat as stat8 } from "fs/promises";
|
|
162370
|
-
import { dirname as
|
|
162566
|
+
import { dirname as dirname13, resolve as resolve9 } from "path";
|
|
162371
162567
|
async function validateDirectoryForWorkspace(directoryPath, permissionContext) {
|
|
162372
162568
|
if (!directoryPath) {
|
|
162373
162569
|
return {
|
|
@@ -162417,7 +162613,7 @@ function addDirHelpMessage(result) {
|
|
|
162417
162613
|
case "pathNotFound":
|
|
162418
162614
|
return `Path ${source_default.bold(result.absolutePath)} was not found.`;
|
|
162419
162615
|
case "notADirectory": {
|
|
162420
|
-
const parentDir =
|
|
162616
|
+
const parentDir = dirname13(result.absolutePath);
|
|
162421
162617
|
return `${source_default.bold(result.directoryPath)} is not a directory. Did you mean to add the parent directory ${source_default.bold(parentDir)}?`;
|
|
162422
162618
|
}
|
|
162423
162619
|
case "alreadyInWorkingDirectory":
|
|
@@ -162852,9 +163048,9 @@ class NodeFsHandler {
|
|
|
162852
163048
|
if (this.fsw.closed) {
|
|
162853
163049
|
return;
|
|
162854
163050
|
}
|
|
162855
|
-
const
|
|
163051
|
+
const dirname15 = sysPath.dirname(file2);
|
|
162856
163052
|
const basename6 = sysPath.basename(file2);
|
|
162857
|
-
const parent = this.fsw._getWatchedDir(
|
|
163053
|
+
const parent = this.fsw._getWatchedDir(dirname15);
|
|
162858
163054
|
let prevStats = stats;
|
|
162859
163055
|
if (parent.has(basename6))
|
|
162860
163056
|
return;
|
|
@@ -162881,7 +163077,7 @@ class NodeFsHandler {
|
|
|
162881
163077
|
prevStats = newStats2;
|
|
162882
163078
|
}
|
|
162883
163079
|
} catch (error42) {
|
|
162884
|
-
this.fsw._remove(
|
|
163080
|
+
this.fsw._remove(dirname15, basename6);
|
|
162885
163081
|
}
|
|
162886
163082
|
} else if (parent.has(basename6)) {
|
|
162887
163083
|
const at = newStats.atimeMs;
|
|
@@ -172100,7 +172296,7 @@ var init_pluginOnlyPolicy = __esm(() => {
|
|
|
172100
172296
|
import { statSync as statSync4 } from "fs";
|
|
172101
172297
|
import { lstat as lstat3, readdir as readdir7, readFile as readFile7, realpath as realpath5, stat as stat13 } from "fs/promises";
|
|
172102
172298
|
import { homedir as homedir13 } from "os";
|
|
172103
|
-
import { dirname as
|
|
172299
|
+
import { dirname as dirname17, join as join34, resolve as resolve13, sep as sep6 } from "path";
|
|
172104
172300
|
function extractDescriptionFromMarkdown(content, defaultDescription = "Custom item") {
|
|
172105
172301
|
const lines = content.split(`
|
|
172106
172302
|
`);
|
|
@@ -172201,7 +172397,7 @@ function getProjectDirsUpToHome(subdir, cwd2) {
|
|
|
172201
172397
|
if (gitRoot && normalizePathForComparison(current) === normalizePathForComparison(gitRoot)) {
|
|
172202
172398
|
break;
|
|
172203
172399
|
}
|
|
172204
|
-
const parent =
|
|
172400
|
+
const parent = dirname17(current);
|
|
172205
172401
|
if (parent === current) {
|
|
172206
172402
|
break;
|
|
172207
172403
|
}
|
|
@@ -174744,7 +174940,7 @@ var init_readOnlyCommandValidation = __esm(() => {
|
|
|
174744
174940
|
|
|
174745
174941
|
// src/utils/permissions/pathValidation.ts
|
|
174746
174942
|
import { homedir as homedir14 } from "os";
|
|
174747
|
-
import { dirname as
|
|
174943
|
+
import { dirname as dirname18, isAbsolute as isAbsolute6, resolve as resolve15 } from "path";
|
|
174748
174944
|
function formatDirectoryList(directories) {
|
|
174749
174945
|
const dirCount = directories.length;
|
|
174750
174946
|
if (dirCount <= MAX_DIRS_TO_LIST) {
|
|
@@ -174887,7 +175083,7 @@ function isDangerousRemovalPath(resolvedPath) {
|
|
|
174887
175083
|
if (normalizedPath === normalizedHome) {
|
|
174888
175084
|
return true;
|
|
174889
175085
|
}
|
|
174890
|
-
const parentDir =
|
|
175086
|
+
const parentDir = dirname18(normalizedPath);
|
|
174891
175087
|
if (parentDir === "/") {
|
|
174892
175088
|
return true;
|
|
174893
175089
|
}
|
|
@@ -174966,7 +175162,7 @@ var init_pathValidation = __esm(() => {
|
|
|
174966
175162
|
});
|
|
174967
175163
|
|
|
174968
175164
|
// src/utils/plugins/pluginDirectories.ts
|
|
174969
|
-
import { mkdirSync as
|
|
175165
|
+
import { mkdirSync as mkdirSync7 } from "fs";
|
|
174970
175166
|
import { readdir as readdir8, rm, stat as stat14 } from "fs/promises";
|
|
174971
175167
|
import { delimiter, join as join37 } from "path";
|
|
174972
175168
|
function getPluginsDirectoryName() {
|
|
@@ -174999,7 +175195,7 @@ function pluginDataDirPath(pluginId) {
|
|
|
174999
175195
|
}
|
|
175000
175196
|
function getPluginDataDir(pluginId) {
|
|
175001
175197
|
const dir = pluginDataDirPath(pluginId);
|
|
175002
|
-
|
|
175198
|
+
mkdirSync7(dir, { recursive: true });
|
|
175003
175199
|
return dir;
|
|
175004
175200
|
}
|
|
175005
175201
|
async function getPluginDataDirSize(pluginId) {
|
|
@@ -177878,7 +178074,7 @@ var init_systemDirectories = __esm(() => {
|
|
|
177878
178074
|
// src/utils/plugins/mcpbHandler.ts
|
|
177879
178075
|
import { createHash as createHash4 } from "crypto";
|
|
177880
178076
|
import { chmod, writeFile as writeFile4 } from "fs/promises";
|
|
177881
|
-
import { dirname as
|
|
178077
|
+
import { dirname as dirname19, join as join39 } from "path";
|
|
177882
178078
|
function isMcpbSource(source) {
|
|
177883
178079
|
return source.endsWith(".mcpb") || source.endsWith(".dxt");
|
|
177884
178080
|
}
|
|
@@ -178114,7 +178310,7 @@ async function extractMcpbContents(unzipped, extractPath, modes, onProgress) {
|
|
|
178114
178310
|
const totalFiles = entries.length;
|
|
178115
178311
|
for (const [filePath, fileData] of entries) {
|
|
178116
178312
|
const fullPath = join39(extractPath, filePath);
|
|
178117
|
-
const dir =
|
|
178313
|
+
const dir = dirname19(fullPath);
|
|
178118
178314
|
if (dir !== extractPath) {
|
|
178119
178315
|
await getFsImplementation().mkdir(dir);
|
|
178120
178316
|
}
|
|
@@ -185055,7 +185251,7 @@ var init_fileStateCache = __esm(() => {
|
|
|
185055
185251
|
// src/utils/claudemd.ts
|
|
185056
185252
|
import {
|
|
185057
185253
|
basename as basename9,
|
|
185058
|
-
dirname as
|
|
185254
|
+
dirname as dirname20,
|
|
185059
185255
|
extname as extname4,
|
|
185060
185256
|
isAbsolute as isAbsolute8,
|
|
185061
185257
|
join as join42,
|
|
@@ -185168,7 +185364,7 @@ function extractIncludePathsFromTokens(tokens, basePath) {
|
|
|
185168
185364
|
if (path12) {
|
|
185169
185365
|
const isValidPath = path12.startsWith("./") || path12.startsWith("~/") || path12.startsWith("/") && path12 !== "/" || !path12.startsWith("@") && !path12.match(/^[#%^&*()]+/) && path12.match(/^[a-zA-Z0-9._-]/);
|
|
185170
185366
|
if (isValidPath) {
|
|
185171
|
-
const resolvedPath = expandPath(path12,
|
|
185367
|
+
const resolvedPath = expandPath(path12, dirname20(basePath));
|
|
185172
185368
|
absolutePaths.add(resolvedPath);
|
|
185173
185369
|
}
|
|
185174
185370
|
}
|
|
@@ -185230,7 +185426,7 @@ function resolveExcludePatterns(patterns) {
|
|
|
185230
185426
|
}
|
|
185231
185427
|
const globStart = normalized.search(/[*?{[]/);
|
|
185232
185428
|
const staticPrefix = globStart === -1 ? normalized : normalized.slice(0, globStart);
|
|
185233
|
-
const dirToResolve =
|
|
185429
|
+
const dirToResolve = dirname20(staticPrefix);
|
|
185234
185430
|
try {
|
|
185235
185431
|
const resolvedDir = fs2.realpathSync(dirToResolve).replaceAll("\\", "/");
|
|
185236
185432
|
if (resolvedDir !== dirToResolve) {
|
|
@@ -185414,7 +185610,7 @@ async function processConditionedMdRules(targetPath, rulesDir, type, processedPa
|
|
|
185414
185610
|
if (!file2.globs || file2.globs.length === 0) {
|
|
185415
185611
|
return false;
|
|
185416
185612
|
}
|
|
185417
|
-
const baseDir = type === "Project" ?
|
|
185613
|
+
const baseDir = type === "Project" ? dirname20(dirname20(rulesDir)) : getOriginalCwd();
|
|
185418
185614
|
const relativePath = isAbsolute8(targetPath) ? relative5(baseDir, targetPath) : targetPath;
|
|
185419
185615
|
if (!relativePath || relativePath.startsWith("..") || isAbsolute8(relativePath)) {
|
|
185420
185616
|
return false;
|
|
@@ -185636,7 +185832,7 @@ var init_claudemd = __esm(() => {
|
|
|
185636
185832
|
let currentDir = originalCwd;
|
|
185637
185833
|
while (currentDir !== parse7(currentDir).root) {
|
|
185638
185834
|
dirs.push(currentDir);
|
|
185639
|
-
currentDir =
|
|
185835
|
+
currentDir = dirname20(currentDir);
|
|
185640
185836
|
}
|
|
185641
185837
|
const gitRoot = findGitRoot(originalCwd);
|
|
185642
185838
|
const canonicalRoot = findCanonicalGitRoot(originalCwd);
|
|
@@ -188500,7 +188696,7 @@ var init_postSamplingHooks = __esm(() => {
|
|
|
188500
188696
|
// src/services/api/dumpPrompts.ts
|
|
188501
188697
|
import { createHash as createHash5 } from "crypto";
|
|
188502
188698
|
import { promises as fs2 } from "fs";
|
|
188503
|
-
import { dirname as
|
|
188699
|
+
import { dirname as dirname21, join as join43 } from "path";
|
|
188504
188700
|
function hashString3(str) {
|
|
188505
188701
|
return createHash5("sha256").update(str).digest("hex");
|
|
188506
188702
|
}
|
|
@@ -188527,7 +188723,7 @@ function getDumpPromptsPath(agentIdOrSessionId) {
|
|
|
188527
188723
|
function appendToFile(filePath, entries) {
|
|
188528
188724
|
if (entries.length === 0)
|
|
188529
188725
|
return;
|
|
188530
|
-
fs2.mkdir(
|
|
188726
|
+
fs2.mkdir(dirname21(filePath), { recursive: true }).then(() => fs2.appendFile(filePath, entries.join(`
|
|
188531
188727
|
`) + `
|
|
188532
188728
|
`)).catch(() => {});
|
|
188533
188729
|
}
|
|
@@ -239325,7 +239521,7 @@ var init_queryHelpers = __esm(() => {
|
|
|
239325
239521
|
import { randomUUID as randomUUID6 } from "crypto";
|
|
239326
239522
|
import { rm as rm2 } from "fs";
|
|
239327
239523
|
import { appendFile as appendFile4, copyFile, mkdir as mkdir6 } from "fs/promises";
|
|
239328
|
-
import { dirname as
|
|
239524
|
+
import { dirname as dirname22, isAbsolute as isAbsolute11, join as join45, relative as relative7 } from "path";
|
|
239329
239525
|
function safeRemoveOverlay(overlayPath) {
|
|
239330
239526
|
rm2(overlayPath, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }, () => {});
|
|
239331
239527
|
}
|
|
@@ -239345,7 +239541,7 @@ async function copyOverlayToMain(overlayPath, writtenPaths, cwd2) {
|
|
|
239345
239541
|
const src = join45(overlayPath, rel);
|
|
239346
239542
|
const dest = join45(cwd2, rel);
|
|
239347
239543
|
try {
|
|
239348
|
-
await mkdir6(
|
|
239544
|
+
await mkdir6(dirname22(dest), { recursive: true });
|
|
239349
239545
|
await copyFile(src, dest);
|
|
239350
239546
|
} catch {
|
|
239351
239547
|
allCopied = false;
|
|
@@ -239594,7 +239790,7 @@ async function startSpeculation(suggestionText, context5, setAppState, isPipelin
|
|
|
239594
239790
|
if (isWriteTool) {
|
|
239595
239791
|
if (!writtenPathsRef.current.has(rel)) {
|
|
239596
239792
|
const overlayFile = join45(overlayPath, rel);
|
|
239597
|
-
await mkdir6(
|
|
239793
|
+
await mkdir6(dirname22(overlayFile), { recursive: true });
|
|
239598
239794
|
try {
|
|
239599
239795
|
await copyFile(join45(cwd2, rel), overlayFile);
|
|
239600
239796
|
} catch {}
|
|
@@ -255535,7 +255731,7 @@ var init_validate2 = __esm(() => {
|
|
|
255535
255731
|
// src/keybindings/loadUserBindings.ts
|
|
255536
255732
|
import { readFileSync as readFileSync11 } from "fs";
|
|
255537
255733
|
import { readFile as readFile9, stat as stat16 } from "fs/promises";
|
|
255538
|
-
import { dirname as
|
|
255734
|
+
import { dirname as dirname23, join as join47 } from "path";
|
|
255539
255735
|
function isKeybindingCustomizationEnabled() {
|
|
255540
255736
|
return getFeatureValue_CACHED_MAY_BE_STALE("tengu_keybinding_customization_release", false);
|
|
255541
255737
|
}
|
|
@@ -255714,7 +255910,7 @@ async function initializeKeybindingWatcher() {
|
|
|
255714
255910
|
return;
|
|
255715
255911
|
}
|
|
255716
255912
|
const userPath = getKeybindingsPath();
|
|
255717
|
-
const watchDir =
|
|
255913
|
+
const watchDir = dirname23(userPath);
|
|
255718
255914
|
try {
|
|
255719
255915
|
const stats = await stat16(watchDir);
|
|
255720
255916
|
if (!stats.isDirectory()) {
|
|
@@ -259986,7 +260182,7 @@ var init_claudeai = __esm(() => {
|
|
|
259986
260182
|
|
|
259987
260183
|
// src/services/mcp/config.ts
|
|
259988
260184
|
import { chmod as chmod2, open as open5, rename, stat as stat18, unlink as unlink3 } from "fs/promises";
|
|
259989
|
-
import { dirname as
|
|
260185
|
+
import { dirname as dirname24, join as join50, parse as parse9 } from "path";
|
|
259990
260186
|
function getEnterpriseMcpFilePath() {
|
|
259991
260187
|
return join50(getManagedFilePath(), "managed-mcp.json");
|
|
259992
260188
|
}
|
|
@@ -260488,7 +260684,7 @@ function getMcpConfigsByScope(scope) {
|
|
|
260488
260684
|
let currentDir = getCwd();
|
|
260489
260685
|
while (currentDir !== parse9(currentDir).root) {
|
|
260490
260686
|
dirs.push(currentDir);
|
|
260491
|
-
currentDir =
|
|
260687
|
+
currentDir = dirname24(currentDir);
|
|
260492
260688
|
}
|
|
260493
260689
|
for (const dir of dirs.reverse()) {
|
|
260494
260690
|
const mcpJsonPath = join50(dir, ".mcp.json");
|
|
@@ -270355,7 +270551,7 @@ function createLinkedTransportPair() {
|
|
|
270355
270551
|
|
|
270356
270552
|
// src/services/mcp/client.ts
|
|
270357
270553
|
import { mkdir as mkdir9, readFile as readFile10, unlink as unlink4, writeFile as writeFile7 } from "fs/promises";
|
|
270358
|
-
import { dirname as
|
|
270554
|
+
import { dirname as dirname25, join as join57 } from "path";
|
|
270359
270555
|
function isMcpSessionExpiredError(error42) {
|
|
270360
270556
|
const httpStatus = "code" in error42 ? error42.code : undefined;
|
|
270361
270557
|
if (httpStatus !== 404) {
|
|
@@ -270388,7 +270584,7 @@ function setMcpAuthCacheEntry(serverId) {
|
|
|
270388
270584
|
const cache3 = await getMcpAuthCache();
|
|
270389
270585
|
cache3[serverId] = { timestamp: Date.now() };
|
|
270390
270586
|
const cachePath2 = getMcpAuthCachePath();
|
|
270391
|
-
await mkdir9(
|
|
270587
|
+
await mkdir9(dirname25(cachePath2), { recursive: true });
|
|
270392
270588
|
await writeFile7(cachePath2, jsonStringify(cache3));
|
|
270393
270589
|
authCachePromise = null;
|
|
270394
270590
|
}).catch(() => {});
|
|
@@ -284323,7 +284519,7 @@ import {
|
|
|
284323
284519
|
writeFile as writeFile12
|
|
284324
284520
|
} from "fs/promises";
|
|
284325
284521
|
import { homedir as homedir22 } from "os";
|
|
284326
|
-
import { basename as basename14, delimiter as delimiter3, dirname as
|
|
284522
|
+
import { basename as basename14, delimiter as delimiter3, dirname as dirname26, join as join68, resolve as resolve19 } from "path";
|
|
284327
284523
|
function getPlatform2() {
|
|
284328
284524
|
const os4 = env2.platform;
|
|
284329
284525
|
const arch = process.arch === "x64" ? "x64" : process.arch === "arm64" ? "arm64" : null;
|
|
@@ -284366,7 +284562,7 @@ async function getVersionPaths(version2) {
|
|
|
284366
284562
|
const dirs = getBaseDirectories();
|
|
284367
284563
|
const dirsToCreate = [dirs.versions, dirs.staging, dirs.locks];
|
|
284368
284564
|
await Promise.all(dirsToCreate.map((dir) => mkdir11(dir, { recursive: true })));
|
|
284369
|
-
const executableParentDir =
|
|
284565
|
+
const executableParentDir = dirname26(dirs.executable);
|
|
284370
284566
|
await mkdir11(executableParentDir, { recursive: true });
|
|
284371
284567
|
const installPath = join68(dirs.versions, version2);
|
|
284372
284568
|
try {
|
|
@@ -284460,7 +284656,7 @@ async function tryWithVersionLock(versionFilePath, callback, retries = 0) {
|
|
|
284460
284656
|
}
|
|
284461
284657
|
}
|
|
284462
284658
|
async function atomicMoveToInstallPath(stagedBinaryPath, installPath) {
|
|
284463
|
-
await mkdir11(
|
|
284659
|
+
await mkdir11(dirname26(installPath), { recursive: true });
|
|
284464
284660
|
const tempInstallPath = `${installPath}.tmp.${process.pid}.${Date.now()}`;
|
|
284465
284661
|
try {
|
|
284466
284662
|
await copyFile2(stagedBinaryPath, tempInstallPath);
|
|
@@ -284674,7 +284870,7 @@ async function updateSymlink(symlinkPath, targetPath) {
|
|
|
284674
284870
|
const isWindows2 = platform4.startsWith("win32");
|
|
284675
284871
|
if (isWindows2) {
|
|
284676
284872
|
try {
|
|
284677
|
-
const parentDir2 =
|
|
284873
|
+
const parentDir2 = dirname26(symlinkPath);
|
|
284678
284874
|
await mkdir11(parentDir2, { recursive: true });
|
|
284679
284875
|
let existingStats;
|
|
284680
284876
|
try {
|
|
@@ -284720,7 +284916,7 @@ async function updateSymlink(symlinkPath, targetPath) {
|
|
|
284720
284916
|
return false;
|
|
284721
284917
|
}
|
|
284722
284918
|
}
|
|
284723
|
-
const parentDir =
|
|
284919
|
+
const parentDir = dirname26(symlinkPath);
|
|
284724
284920
|
try {
|
|
284725
284921
|
await mkdir11(parentDir, { recursive: true });
|
|
284726
284922
|
logForDebugging2(`Created directory ${parentDir} for symlink`);
|
|
@@ -284737,7 +284933,7 @@ async function updateSymlink(symlinkPath, targetPath) {
|
|
|
284737
284933
|
if (symlinkExists) {
|
|
284738
284934
|
try {
|
|
284739
284935
|
const currentTarget = await readlink(symlinkPath);
|
|
284740
|
-
const resolvedCurrentTarget = resolve19(
|
|
284936
|
+
const resolvedCurrentTarget = resolve19(dirname26(symlinkPath), currentTarget);
|
|
284741
284937
|
const resolvedTargetPath = resolve19(targetPath);
|
|
284742
284938
|
if (resolvedCurrentTarget === resolvedTargetPath) {
|
|
284743
284939
|
return false;
|
|
@@ -284777,7 +284973,7 @@ async function checkInstall(force = false) {
|
|
|
284777
284973
|
}
|
|
284778
284974
|
const dirs = getBaseDirectories();
|
|
284779
284975
|
const messages = [];
|
|
284780
|
-
const localBinDir =
|
|
284976
|
+
const localBinDir = dirname26(dirs.executable);
|
|
284781
284977
|
const resolvedLocalBinPath = resolve19(localBinDir);
|
|
284782
284978
|
const platform4 = getPlatform2();
|
|
284783
284979
|
const isWindows2 = platform4.startsWith("win32");
|
|
@@ -284801,7 +284997,7 @@ async function checkInstall(force = false) {
|
|
|
284801
284997
|
} else {
|
|
284802
284998
|
try {
|
|
284803
284999
|
const target = await readlink(dirs.executable);
|
|
284804
|
-
const absoluteTarget = resolve19(
|
|
285000
|
+
const absoluteTarget = resolve19(dirname26(dirs.executable), target);
|
|
284805
285001
|
if (!await isPossibleClaudeBinary(absoluteTarget)) {
|
|
284806
285002
|
messages.push({
|
|
284807
285003
|
message: `Claude symlink points to missing or invalid binary: ${target}`,
|
|
@@ -284908,7 +285104,7 @@ async function installLatestImpl(channelOrVersion, forceReinstall = false) {
|
|
|
284908
285104
|
async function getVersionFromSymlink(symlinkPath) {
|
|
284909
285105
|
try {
|
|
284910
285106
|
const target = await readlink(symlinkPath);
|
|
284911
|
-
const absoluteTarget = resolve19(
|
|
285107
|
+
const absoluteTarget = resolve19(dirname26(symlinkPath), target);
|
|
284912
285108
|
if (await isPossibleClaudeBinary(absoluteTarget)) {
|
|
284913
285109
|
return absoluteTarget;
|
|
284914
285110
|
}
|
|
@@ -285003,7 +285199,7 @@ async function cleanupOldVersions() {
|
|
|
285003
285199
|
const dirs = getBaseDirectories();
|
|
285004
285200
|
const oneHourAgo = Date.now() - 3600000;
|
|
285005
285201
|
if (getPlatform2().startsWith("win32")) {
|
|
285006
|
-
const executableDir =
|
|
285202
|
+
const executableDir = dirname26(dirs.executable);
|
|
285007
285203
|
try {
|
|
285008
285204
|
const files = await readdir9(executableDir);
|
|
285009
285205
|
let cleanedCount = 0;
|
|
@@ -292985,7 +293181,7 @@ __export(exports_teamHelpers, {
|
|
|
292985
293181
|
cleanupSessionTeams: () => cleanupSessionTeams,
|
|
292986
293182
|
addHiddenPaneId: () => addHiddenPaneId
|
|
292987
293183
|
});
|
|
292988
|
-
import { mkdirSync as
|
|
293184
|
+
import { mkdirSync as mkdirSync8, readFileSync as readFileSync12, writeFileSync as writeFileSync6 } from "fs";
|
|
292989
293185
|
import { mkdir as mkdir14, readFile as readFile16, rm as rm4, writeFile as writeFile15 } from "fs/promises";
|
|
292990
293186
|
import { join as join71 } from "path";
|
|
292991
293187
|
function sanitizeName(name) {
|
|
@@ -293024,8 +293220,8 @@ async function readTeamFileAsync(teamName) {
|
|
|
293024
293220
|
}
|
|
293025
293221
|
function writeTeamFile(teamName, teamFile) {
|
|
293026
293222
|
const teamDir = getTeamDir(teamName);
|
|
293027
|
-
|
|
293028
|
-
|
|
293223
|
+
mkdirSync8(teamDir, { recursive: true });
|
|
293224
|
+
writeFileSync6(getTeamFilePath(teamName), jsonStringify(teamFile, null, 2));
|
|
293029
293225
|
}
|
|
293030
293226
|
async function writeTeamFileAsync(teamName, teamFile) {
|
|
293031
293227
|
const teamDir = getTeamDir(teamName);
|
|
@@ -294700,14 +294896,6 @@ function ConsoleOAuthFlow({
|
|
|
294700
294896
|
context: "Confirmation",
|
|
294701
294897
|
isActive: oauthStatus.state === "success" && mode !== "setup-token"
|
|
294702
294898
|
});
|
|
294703
|
-
useKeybinding("confirm:yes", () => {
|
|
294704
|
-
setOAuthStatus({
|
|
294705
|
-
state: "idle"
|
|
294706
|
-
});
|
|
294707
|
-
}, {
|
|
294708
|
-
context: "Confirmation",
|
|
294709
|
-
isActive: oauthStatus.state === "platform_setup"
|
|
294710
|
-
});
|
|
294711
294899
|
useKeybinding("confirm:yes", () => {
|
|
294712
294900
|
if (oauthStatus.state === "error" && oauthStatus.toRetry) {
|
|
294713
294901
|
setPastedCode("");
|
|
@@ -294905,7 +295093,7 @@ function ConsoleOAuthFlow({
|
|
|
294905
295093
|
children: [
|
|
294906
295094
|
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedText, {
|
|
294907
295095
|
color: "success",
|
|
294908
|
-
children: "
|
|
295096
|
+
children: "Long-lived authentication token created successfully!"
|
|
294909
295097
|
}, undefined, false, undefined, this),
|
|
294910
295098
|
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedBox_default, {
|
|
294911
295099
|
flexDirection: "column",
|
|
@@ -295038,21 +295226,7 @@ function OAuthStatusMessage(t0) {
|
|
|
295038
295226
|
}
|
|
295039
295227
|
let t6;
|
|
295040
295228
|
if ($2[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
295041
|
-
t6 = [t4, t5
|
|
295042
|
-
label: /* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedText, {
|
|
295043
|
-
children: [
|
|
295044
|
-
"3rd-party platform ·",
|
|
295045
|
-
" ",
|
|
295046
|
-
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedText, {
|
|
295047
|
-
dimColor: true,
|
|
295048
|
-
children: "OpenAI, Gemini, Bedrock, Ollama, and more"
|
|
295049
|
-
}, undefined, false, undefined, this),
|
|
295050
|
-
`
|
|
295051
|
-
`
|
|
295052
|
-
]
|
|
295053
|
-
}, undefined, true, undefined, this),
|
|
295054
|
-
value: "platform"
|
|
295055
|
-
}];
|
|
295229
|
+
t6 = [t4, t5];
|
|
295056
295230
|
$2[5] = t6;
|
|
295057
295231
|
} else {
|
|
295058
295232
|
t6 = $2[5];
|
|
@@ -295063,22 +295237,15 @@ function OAuthStatusMessage(t0) {
|
|
|
295063
295237
|
children: /* @__PURE__ */ jsx_dev_runtime71.jsxDEV(Select, {
|
|
295064
295238
|
options: t6,
|
|
295065
295239
|
onChange: (value_0) => {
|
|
295066
|
-
|
|
295067
|
-
|
|
295068
|
-
|
|
295069
|
-
|
|
295070
|
-
});
|
|
295240
|
+
setOAuthStatus({
|
|
295241
|
+
state: "ready_to_start"
|
|
295242
|
+
});
|
|
295243
|
+
if (value_0 === "claudeai") {
|
|
295244
|
+
logEvent("tengu_oauth_claudeai_selected", {});
|
|
295245
|
+
setLoginWithClaudeAi(true);
|
|
295071
295246
|
} else {
|
|
295072
|
-
|
|
295073
|
-
|
|
295074
|
-
});
|
|
295075
|
-
if (value_0 === "claudeai") {
|
|
295076
|
-
logEvent("tengu_oauth_claudeai_selected", {});
|
|
295077
|
-
setLoginWithClaudeAi(true);
|
|
295078
|
-
} else {
|
|
295079
|
-
logEvent("tengu_oauth_console_selected", {});
|
|
295080
|
-
setLoginWithClaudeAi(false);
|
|
295081
|
-
}
|
|
295247
|
+
logEvent("tengu_oauth_console_selected", {});
|
|
295248
|
+
setLoginWithClaudeAi(false);
|
|
295082
295249
|
}
|
|
295083
295250
|
}
|
|
295084
295251
|
}, undefined, false, undefined, this)
|
|
@@ -295109,156 +295276,6 @@ function OAuthStatusMessage(t0) {
|
|
|
295109
295276
|
}
|
|
295110
295277
|
return t8;
|
|
295111
295278
|
}
|
|
295112
|
-
case "platform_setup": {
|
|
295113
|
-
let t1;
|
|
295114
|
-
if ($2[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
295115
|
-
t1 = /* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedText, {
|
|
295116
|
-
bold: true,
|
|
295117
|
-
children: "Using 3rd-party platforms"
|
|
295118
|
-
}, undefined, false, undefined, this);
|
|
295119
|
-
$2[12] = t1;
|
|
295120
|
-
} else {
|
|
295121
|
-
t1 = $2[12];
|
|
295122
|
-
}
|
|
295123
|
-
let t2;
|
|
295124
|
-
let t3;
|
|
295125
|
-
if ($2[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
295126
|
-
t2 = /* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedText, {
|
|
295127
|
-
children: "SnowCode supports OpenAI-compatible providers (GPT-4o, DeepSeek, Ollama, Groq), Google Gemini, Amazon Bedrock, Microsoft Foundry, and Vertex AI. Set the required environment variables, then restart SnowCode."
|
|
295128
|
-
}, undefined, false, undefined, this);
|
|
295129
|
-
t3 = /* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedText, {
|
|
295130
|
-
children: "If you are part of an enterprise organization, contact your administrator for setup instructions."
|
|
295131
|
-
}, undefined, false, undefined, this);
|
|
295132
|
-
$2[13] = t2;
|
|
295133
|
-
$2[14] = t3;
|
|
295134
|
-
} else {
|
|
295135
|
-
t2 = $2[13];
|
|
295136
|
-
t3 = $2[14];
|
|
295137
|
-
}
|
|
295138
|
-
let t4;
|
|
295139
|
-
if ($2[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
295140
|
-
t4 = /* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedText, {
|
|
295141
|
-
bold: true,
|
|
295142
|
-
children: "Documentation:"
|
|
295143
|
-
}, undefined, false, undefined, this);
|
|
295144
|
-
$2[15] = t4;
|
|
295145
|
-
} else {
|
|
295146
|
-
t4 = $2[15];
|
|
295147
|
-
}
|
|
295148
|
-
let t5;
|
|
295149
|
-
if ($2[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
295150
|
-
t5 = /* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedText, {
|
|
295151
|
-
children: [
|
|
295152
|
-
"· Amazon Bedrock:",
|
|
295153
|
-
" ",
|
|
295154
|
-
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV(Link, {
|
|
295155
|
-
url: "https://code.claude.com/docs/en/amazon-bedrock",
|
|
295156
|
-
children: "https://code.claude.com/docs/en/amazon-bedrock"
|
|
295157
|
-
}, undefined, false, undefined, this)
|
|
295158
|
-
]
|
|
295159
|
-
}, undefined, true, undefined, this);
|
|
295160
|
-
$2[16] = t5;
|
|
295161
|
-
} else {
|
|
295162
|
-
t5 = $2[16];
|
|
295163
|
-
}
|
|
295164
|
-
let t6;
|
|
295165
|
-
if ($2[17] === Symbol.for("react.memo_cache_sentinel")) {
|
|
295166
|
-
t6 = /* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedText, {
|
|
295167
|
-
children: [
|
|
295168
|
-
"· Microsoft Foundry:",
|
|
295169
|
-
" ",
|
|
295170
|
-
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV(Link, {
|
|
295171
|
-
url: "https://code.claude.com/docs/en/microsoft-foundry",
|
|
295172
|
-
children: "https://code.claude.com/docs/en/microsoft-foundry"
|
|
295173
|
-
}, undefined, false, undefined, this)
|
|
295174
|
-
]
|
|
295175
|
-
}, undefined, true, undefined, this);
|
|
295176
|
-
$2[17] = t6;
|
|
295177
|
-
} else {
|
|
295178
|
-
t6 = $2[17];
|
|
295179
|
-
}
|
|
295180
|
-
let t7;
|
|
295181
|
-
if ($2[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
295182
|
-
t7 = /* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedBox_default, {
|
|
295183
|
-
flexDirection: "column",
|
|
295184
|
-
marginTop: 1,
|
|
295185
|
-
children: [
|
|
295186
|
-
t4,
|
|
295187
|
-
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedText, {
|
|
295188
|
-
children: [
|
|
295189
|
-
"· OpenAI / any OpenAI-compatible provider (GPT-4o, DeepSeek, Ollama, Groq):",
|
|
295190
|
-
`
|
|
295191
|
-
`,
|
|
295192
|
-
" ",
|
|
295193
|
-
"CLAUDE_CODE_USE_OPENAI=1 OPENAI_API_KEY=sk-... OPENAI_MODEL=gpt-4o"
|
|
295194
|
-
]
|
|
295195
|
-
}, undefined, true, undefined, this),
|
|
295196
|
-
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedText, {
|
|
295197
|
-
children: [
|
|
295198
|
-
"· Google Gemini (free key at https://aistudio.google.com/apikey):",
|
|
295199
|
-
`
|
|
295200
|
-
`,
|
|
295201
|
-
" ",
|
|
295202
|
-
"CLAUDE_CODE_USE_GEMINI=1 GEMINI_API_KEY=your-key"
|
|
295203
|
-
]
|
|
295204
|
-
}, undefined, true, undefined, this),
|
|
295205
|
-
t5,
|
|
295206
|
-
t6,
|
|
295207
|
-
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedText, {
|
|
295208
|
-
children: [
|
|
295209
|
-
"· Vertex AI:",
|
|
295210
|
-
" ",
|
|
295211
|
-
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV(Link, {
|
|
295212
|
-
url: "https://code.claude.com/docs/en/google-vertex-ai",
|
|
295213
|
-
children: "https://code.claude.com/docs/en/google-vertex-ai"
|
|
295214
|
-
}, undefined, false, undefined, this)
|
|
295215
|
-
]
|
|
295216
|
-
}, undefined, true, undefined, this)
|
|
295217
|
-
]
|
|
295218
|
-
}, undefined, true, undefined, this);
|
|
295219
|
-
$2[18] = t7;
|
|
295220
|
-
} else {
|
|
295221
|
-
t7 = $2[18];
|
|
295222
|
-
}
|
|
295223
|
-
let t8;
|
|
295224
|
-
if ($2[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
295225
|
-
t8 = /* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedBox_default, {
|
|
295226
|
-
flexDirection: "column",
|
|
295227
|
-
gap: 1,
|
|
295228
|
-
marginTop: 1,
|
|
295229
|
-
children: [
|
|
295230
|
-
t1,
|
|
295231
|
-
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedBox_default, {
|
|
295232
|
-
flexDirection: "column",
|
|
295233
|
-
gap: 1,
|
|
295234
|
-
children: [
|
|
295235
|
-
t2,
|
|
295236
|
-
t3,
|
|
295237
|
-
t7,
|
|
295238
|
-
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedBox_default, {
|
|
295239
|
-
marginTop: 1,
|
|
295240
|
-
children: /* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedText, {
|
|
295241
|
-
dimColor: true,
|
|
295242
|
-
children: [
|
|
295243
|
-
"Press ",
|
|
295244
|
-
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedText, {
|
|
295245
|
-
bold: true,
|
|
295246
|
-
children: "Enter"
|
|
295247
|
-
}, undefined, false, undefined, this),
|
|
295248
|
-
" to go back to login options."
|
|
295249
|
-
]
|
|
295250
|
-
}, undefined, true, undefined, this)
|
|
295251
|
-
}, undefined, false, undefined, this)
|
|
295252
|
-
]
|
|
295253
|
-
}, undefined, true, undefined, this)
|
|
295254
|
-
]
|
|
295255
|
-
}, undefined, true, undefined, this);
|
|
295256
|
-
$2[19] = t8;
|
|
295257
|
-
} else {
|
|
295258
|
-
t8 = $2[19];
|
|
295259
|
-
}
|
|
295260
|
-
return t8;
|
|
295261
|
-
}
|
|
295262
295279
|
case "waiting_for_login": {
|
|
295263
295280
|
let t1;
|
|
295264
295281
|
if ($2[20] !== forcedMethodMessage) {
|
|
@@ -295279,7 +295296,7 @@ function OAuthStatusMessage(t0) {
|
|
|
295279
295296
|
children: [
|
|
295280
295297
|
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV(Spinner, {}, undefined, false, undefined, this),
|
|
295281
295298
|
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedText, {
|
|
295282
|
-
children: "Opening browser to sign in
|
|
295299
|
+
children: "Opening browser to sign in..."
|
|
295283
295300
|
}, undefined, false, undefined, this)
|
|
295284
295301
|
]
|
|
295285
295302
|
}, undefined, true, undefined, this);
|
|
@@ -295348,7 +295365,7 @@ function OAuthStatusMessage(t0) {
|
|
|
295348
295365
|
children: [
|
|
295349
295366
|
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV(Spinner, {}, undefined, false, undefined, this),
|
|
295350
295367
|
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedText, {
|
|
295351
|
-
children: "Creating API key for Claude Code
|
|
295368
|
+
children: "Creating API key for Claude Code..."
|
|
295352
295369
|
}, undefined, false, undefined, this)
|
|
295353
295370
|
]
|
|
295354
295371
|
}, undefined, true, undefined, this)
|
|
@@ -295367,7 +295384,7 @@ function OAuthStatusMessage(t0) {
|
|
|
295367
295384
|
gap: 1,
|
|
295368
295385
|
children: /* @__PURE__ */ jsx_dev_runtime71.jsxDEV(ThemedText, {
|
|
295369
295386
|
color: "permission",
|
|
295370
|
-
children: "Retrying
|
|
295387
|
+
children: "Retrying..."
|
|
295371
295388
|
}, undefined, false, undefined, this)
|
|
295372
295389
|
}, undefined, false, undefined, this);
|
|
295373
295390
|
$2[38] = t1;
|
|
@@ -295399,7 +295416,7 @@ function OAuthStatusMessage(t0) {
|
|
|
295399
295416
|
bold: true,
|
|
295400
295417
|
children: "Enter"
|
|
295401
295418
|
}, undefined, false, undefined, this),
|
|
295402
|
-
" to continue
|
|
295419
|
+
" to continue..."
|
|
295403
295420
|
]
|
|
295404
295421
|
}, undefined, true, undefined, this)
|
|
295405
295422
|
]
|
|
@@ -308221,7 +308238,7 @@ import {
|
|
|
308221
308238
|
stat as stat21,
|
|
308222
308239
|
unlink as unlink9
|
|
308223
308240
|
} from "fs/promises";
|
|
308224
|
-
import { dirname as
|
|
308241
|
+
import { dirname as dirname27, isAbsolute as isAbsolute13, join as join72, relative as relative9 } from "path";
|
|
308225
308242
|
import { inspect as inspect3 } from "util";
|
|
308226
308243
|
function fileHistoryEnabled() {
|
|
308227
308244
|
if (getIsNonInteractiveSession()) {
|
|
@@ -308662,7 +308679,7 @@ async function createBackup(filePath, version2) {
|
|
|
308662
308679
|
} catch (e) {
|
|
308663
308680
|
if (!isENOENT(e))
|
|
308664
308681
|
throw e;
|
|
308665
|
-
await mkdir15(
|
|
308682
|
+
await mkdir15(dirname27(backupPath), { recursive: true });
|
|
308666
308683
|
await copyFile3(filePath, backupPath);
|
|
308667
308684
|
}
|
|
308668
308685
|
await chmod6(backupPath, srcStats.mode);
|
|
@@ -308694,7 +308711,7 @@ async function restoreBackup(filePath, backupFileName) {
|
|
|
308694
308711
|
} catch (e) {
|
|
308695
308712
|
if (!isENOENT(e))
|
|
308696
308713
|
throw e;
|
|
308697
|
-
await mkdir15(
|
|
308714
|
+
await mkdir15(dirname27(filePath), { recursive: true });
|
|
308698
308715
|
await copyFile3(backupPath, filePath);
|
|
308699
308716
|
}
|
|
308700
308717
|
await chmod6(filePath, backupStats.mode);
|
|
@@ -326942,7 +326959,7 @@ var builders = null;
|
|
|
326942
326959
|
import { realpath as realpath10 } from "fs/promises";
|
|
326943
326960
|
import {
|
|
326944
326961
|
basename as basename21,
|
|
326945
|
-
dirname as
|
|
326962
|
+
dirname as dirname29,
|
|
326946
326963
|
isAbsolute as isAbsolute17,
|
|
326947
326964
|
join as join81,
|
|
326948
326965
|
sep as pathSep,
|
|
@@ -327196,7 +327213,7 @@ async function loadSkillsFromSkillsDir(basePath, source) {
|
|
|
327196
327213
|
const skillFiles = await findSkillMarkdownFiles(basePath);
|
|
327197
327214
|
const results = await Promise.all(skillFiles.map(async (skillFilePath) => {
|
|
327198
327215
|
try {
|
|
327199
|
-
const skillDirPath =
|
|
327216
|
+
const skillDirPath = dirname29(skillFilePath);
|
|
327200
327217
|
let content;
|
|
327201
327218
|
try {
|
|
327202
327219
|
content = await fs4.readFile(skillFilePath, { encoding: "utf-8" });
|
|
@@ -327237,7 +327254,7 @@ function isSkillFile(filePath) {
|
|
|
327237
327254
|
function transformSkillFiles(files) {
|
|
327238
327255
|
const filesByDir = new Map;
|
|
327239
327256
|
for (const file2 of files) {
|
|
327240
|
-
const dir =
|
|
327257
|
+
const dir = dirname29(file2.filePath);
|
|
327241
327258
|
const dirFiles = filesByDir.get(dir) ?? [];
|
|
327242
327259
|
dirFiles.push(file2);
|
|
327243
327260
|
filesByDir.set(dir, dirFiles);
|
|
@@ -327266,15 +327283,15 @@ function buildNamespace(targetDir, baseDir) {
|
|
|
327266
327283
|
return relativePath ? relativePath.split(pathSep).join(":") : "";
|
|
327267
327284
|
}
|
|
327268
327285
|
function getSkillCommandName(filePath, baseDir) {
|
|
327269
|
-
const skillDirectory =
|
|
327270
|
-
const parentOfSkillDir =
|
|
327286
|
+
const skillDirectory = dirname29(filePath);
|
|
327287
|
+
const parentOfSkillDir = dirname29(skillDirectory);
|
|
327271
327288
|
const commandBaseName = basename21(skillDirectory);
|
|
327272
327289
|
const namespace = buildNamespace(parentOfSkillDir, baseDir);
|
|
327273
327290
|
return namespace ? `${namespace}:${commandBaseName}` : commandBaseName;
|
|
327274
327291
|
}
|
|
327275
327292
|
function getRegularCommandName(filePath, baseDir) {
|
|
327276
327293
|
const fileName = basename21(filePath);
|
|
327277
|
-
const fileDirectory =
|
|
327294
|
+
const fileDirectory = dirname29(filePath);
|
|
327278
327295
|
const commandBaseName = fileName.replace(/\.md$/, "");
|
|
327279
327296
|
const namespace = buildNamespace(fileDirectory, baseDir);
|
|
327280
327297
|
return namespace ? `${namespace}:${commandBaseName}` : commandBaseName;
|
|
@@ -327297,7 +327314,7 @@ async function loadSkillsFromCommandsDir(cwd2) {
|
|
|
327297
327314
|
} of processedFiles) {
|
|
327298
327315
|
try {
|
|
327299
327316
|
const isSkillFormat = isSkillFile(filePath);
|
|
327300
|
-
const skillDirectory = isSkillFormat ?
|
|
327317
|
+
const skillDirectory = isSkillFormat ? dirname29(filePath) : undefined;
|
|
327301
327318
|
const cmdName = getCommandName2({
|
|
327302
327319
|
baseDir,
|
|
327303
327320
|
filePath,
|
|
@@ -327349,7 +327366,7 @@ async function discoverSkillDirsForPaths(filePaths, cwd2) {
|
|
|
327349
327366
|
const resolvedCwd = cwd2.endsWith(pathSep) ? cwd2.slice(0, -1) : cwd2;
|
|
327350
327367
|
const newDirs = [];
|
|
327351
327368
|
for (const filePath of filePaths) {
|
|
327352
|
-
let currentDir =
|
|
327369
|
+
let currentDir = dirname29(filePath);
|
|
327353
327370
|
while (currentDir.startsWith(resolvedCwd + pathSep)) {
|
|
327354
327371
|
const skillDir = join81(currentDir, ".claude", "skills");
|
|
327355
327372
|
if (!dynamicSkillDirs.has(skillDir)) {
|
|
@@ -327363,7 +327380,7 @@ async function discoverSkillDirsForPaths(filePaths, cwd2) {
|
|
|
327363
327380
|
newDirs.push(skillDir);
|
|
327364
327381
|
} catch {}
|
|
327365
327382
|
}
|
|
327366
|
-
const parent =
|
|
327383
|
+
const parent = dirname29(currentDir);
|
|
327367
327384
|
if (parent === currentDir)
|
|
327368
327385
|
break;
|
|
327369
327386
|
currentDir = parent;
|
|
@@ -327867,7 +327884,7 @@ var init_fileOperationAnalytics = __esm(() => {
|
|
|
327867
327884
|
|
|
327868
327885
|
// src/utils/gitDiff.ts
|
|
327869
327886
|
import { access as access5, readFile as readFile22 } from "fs/promises";
|
|
327870
|
-
import { dirname as
|
|
327887
|
+
import { dirname as dirname30, join as join82, relative as relative13, sep as sep16 } from "path";
|
|
327871
327888
|
async function fetchGitDiff() {
|
|
327872
327889
|
const isGit = await getIsGit();
|
|
327873
327890
|
if (!isGit)
|
|
@@ -328051,7 +328068,7 @@ function parseShortstat(stdout) {
|
|
|
328051
328068
|
};
|
|
328052
328069
|
}
|
|
328053
328070
|
async function fetchSingleFileGitDiff(absoluteFilePath) {
|
|
328054
|
-
const gitRoot = findGitRoot(
|
|
328071
|
+
const gitRoot = findGitRoot(dirname30(absoluteFilePath));
|
|
328055
328072
|
if (!gitRoot)
|
|
328056
328073
|
return null;
|
|
328057
328074
|
const gitPath = relative13(gitRoot, absoluteFilePath).split(sep16).join("/");
|
|
@@ -331174,7 +331191,7 @@ var init_UI8 = __esm(() => {
|
|
|
331174
331191
|
});
|
|
331175
331192
|
|
|
331176
331193
|
// src/tools/FileEditTool/FileEditTool.ts
|
|
331177
|
-
import { dirname as
|
|
331194
|
+
import { dirname as dirname31, isAbsolute as isAbsolute18, sep as sep17 } from "path";
|
|
331178
331195
|
function readFileForEdit(absoluteFilePath) {
|
|
331179
331196
|
try {
|
|
331180
331197
|
const meta = readFileSyncWithMetadata(absoluteFilePath);
|
|
@@ -331475,7 +331492,7 @@ String: ${old_string}`,
|
|
|
331475
331492
|
activateConditionalSkillsForPaths([absoluteFilePath], cwd2);
|
|
331476
331493
|
}
|
|
331477
331494
|
await diagnosticTracker.beforeFileEdited(absoluteFilePath);
|
|
331478
|
-
await fs4.mkdir(
|
|
331495
|
+
await fs4.mkdir(dirname31(absoluteFilePath));
|
|
331479
331496
|
if (fileHistoryEnabled()) {
|
|
331480
331497
|
await fileHistoryTrackEdit(updateFileHistoryState, absoluteFilePath, parentMessage.uuid);
|
|
331481
331498
|
}
|
|
@@ -332048,7 +332065,7 @@ var init_UI9 = __esm(() => {
|
|
|
332048
332065
|
});
|
|
332049
332066
|
|
|
332050
332067
|
// src/tools/FileWriteTool/FileWriteTool.ts
|
|
332051
|
-
import { dirname as
|
|
332068
|
+
import { dirname as dirname32, sep as sep18 } from "path";
|
|
332052
332069
|
var inputSchema13, outputSchema10, FileWriteTool;
|
|
332053
332070
|
var init_FileWriteTool = __esm(() => {
|
|
332054
332071
|
init_analytics();
|
|
@@ -332188,7 +332205,7 @@ var init_FileWriteTool = __esm(() => {
|
|
|
332188
332205
|
},
|
|
332189
332206
|
async call({ file_path, content }, { readFileState, updateFileHistoryState, dynamicSkillDirTriggers }, _, parentMessage) {
|
|
332190
332207
|
const fullFilePath = expandPath(file_path);
|
|
332191
|
-
const dir =
|
|
332208
|
+
const dir = dirname32(fullFilePath);
|
|
332192
332209
|
const cwd2 = getCwd();
|
|
332193
332210
|
const newSkillDirs = await discoverSkillDirsForPaths([fullFilePath], cwd2);
|
|
332194
332211
|
if (newSkillDirs.length > 0) {
|
|
@@ -332330,7 +332347,7 @@ var init_FileWriteTool = __esm(() => {
|
|
|
332330
332347
|
});
|
|
332331
332348
|
|
|
332332
332349
|
// src/utils/plugins/orphanedPluginFilter.ts
|
|
332333
|
-
import { dirname as
|
|
332350
|
+
import { dirname as dirname33, isAbsolute as isAbsolute20, join as join83, normalize as normalize11, relative as relative16, sep as sep19 } from "path";
|
|
332334
332351
|
async function getGlobExclusionsForPluginCache(searchPath) {
|
|
332335
332352
|
const cachePath2 = normalize11(join83(getPluginsDirectory(), "cache"));
|
|
332336
332353
|
if (searchPath && !pathsOverlap(searchPath, cachePath2)) {
|
|
@@ -332350,7 +332367,7 @@ async function getGlobExclusionsForPluginCache(searchPath) {
|
|
|
332350
332367
|
ORPHANED_AT_FILENAME
|
|
332351
332368
|
], cachePath2, new AbortController().signal);
|
|
332352
332369
|
cachedExclusions = markers.map((markerPath) => {
|
|
332353
|
-
const versionDir =
|
|
332370
|
+
const versionDir = dirname33(markerPath);
|
|
332354
332371
|
const rel = isAbsolute20(versionDir) ? relative16(cachePath2, versionDir) : versionDir;
|
|
332355
332372
|
const posixRelative = rel.replace(/\\/g, "/");
|
|
332356
332373
|
return `!**/${posixRelative}/**`;
|
|
@@ -332380,12 +332397,12 @@ var init_orphanedPluginFilter = __esm(() => {
|
|
|
332380
332397
|
});
|
|
332381
332398
|
|
|
332382
332399
|
// src/utils/glob.ts
|
|
332383
|
-
import { basename as basename23, dirname as
|
|
332400
|
+
import { basename as basename23, dirname as dirname34, isAbsolute as isAbsolute21, join as join84, sep as sep20 } from "path";
|
|
332384
332401
|
function extractGlobBaseDirectory(pattern) {
|
|
332385
332402
|
const globChars = /[*?[{]/;
|
|
332386
332403
|
const match = pattern.match(globChars);
|
|
332387
332404
|
if (!match || match.index === undefined) {
|
|
332388
|
-
const dir =
|
|
332405
|
+
const dir = dirname34(pattern);
|
|
332389
332406
|
const file2 = basename23(pattern);
|
|
332390
332407
|
return { baseDir: dir, relativePattern: file2 };
|
|
332391
332408
|
}
|
|
@@ -356332,7 +356349,7 @@ var init_ExitWorktreeTool = __esm(() => {
|
|
|
356332
356349
|
var CONFIG_TOOL_NAME = "Config";
|
|
356333
356350
|
|
|
356334
356351
|
// src/utils/modelConfig.ts
|
|
356335
|
-
import { existsSync as existsSync9, mkdirSync as
|
|
356352
|
+
import { existsSync as existsSync9, mkdirSync as mkdirSync9, readFileSync as readFileSync14, writeFileSync as writeFileSync7 } from "node:fs";
|
|
356336
356353
|
import { join as join87 } from "node:path";
|
|
356337
356354
|
function getModelsPath() {
|
|
356338
356355
|
return join87(getClaudeConfigHomeDir(), "models.json");
|
|
@@ -356342,8 +356359,8 @@ function loadModelConfig() {
|
|
|
356342
356359
|
if (!existsSync9(path16)) {
|
|
356343
356360
|
const dir = getClaudeConfigHomeDir();
|
|
356344
356361
|
if (!existsSync9(dir))
|
|
356345
|
-
|
|
356346
|
-
|
|
356362
|
+
mkdirSync9(dir, { recursive: true });
|
|
356363
|
+
writeFileSync7(path16, JSON.stringify(DEFAULT_MODELS, null, 2));
|
|
356347
356364
|
return DEFAULT_MODELS;
|
|
356348
356365
|
}
|
|
356349
356366
|
try {
|
|
@@ -370898,7 +370915,7 @@ function getAnthropicEnvMetadata() {
|
|
|
370898
370915
|
function getBuildAgeMinutes() {
|
|
370899
370916
|
if (false)
|
|
370900
370917
|
;
|
|
370901
|
-
const buildTime = new Date("2026-04-
|
|
370918
|
+
const buildTime = new Date("2026-04-05T03:33:03.306Z").getTime();
|
|
370902
370919
|
if (isNaN(buildTime))
|
|
370903
370920
|
return;
|
|
370904
370921
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -374617,7 +374634,7 @@ var init_toolSearch = __esm(() => {
|
|
|
374617
374634
|
// src/services/vcr.ts
|
|
374618
374635
|
import { createHash as createHash18, randomUUID as randomUUID21 } from "crypto";
|
|
374619
374636
|
import { mkdir as mkdir22, readFile as readFile28, writeFile as writeFile22 } from "fs/promises";
|
|
374620
|
-
import { dirname as
|
|
374637
|
+
import { dirname as dirname35, join as join91 } from "path";
|
|
374621
374638
|
function shouldUseVCR() {
|
|
374622
374639
|
if (false) {}
|
|
374623
374640
|
if (process.env.USER_TYPE === "ant" && isEnvTruthy(process.env.FORCE_VCR)) {
|
|
@@ -374644,7 +374661,7 @@ async function withFixture(input, fixtureName, f) {
|
|
|
374644
374661
|
throw new Error(`Fixture missing: ${filename}. Re-run tests with VCR_RECORD=1, then commit the result.`);
|
|
374645
374662
|
}
|
|
374646
374663
|
const result = await f();
|
|
374647
|
-
await mkdir22(
|
|
374664
|
+
await mkdir22(dirname35(filename), { recursive: true });
|
|
374648
374665
|
await writeFile22(filename, jsonStringify(result, null, 2), {
|
|
374649
374666
|
encoding: "utf8"
|
|
374650
374667
|
});
|
|
@@ -374683,7 +374700,7 @@ ${jsonStringify(dehydratedInput, null, 2)}`);
|
|
|
374683
374700
|
if (env2.isCI && !isEnvTruthy(process.env.VCR_RECORD)) {
|
|
374684
374701
|
return results;
|
|
374685
374702
|
}
|
|
374686
|
-
await mkdir22(
|
|
374703
|
+
await mkdir22(dirname35(filename), { recursive: true });
|
|
374687
374704
|
await writeFile22(filename, jsonStringify({
|
|
374688
374705
|
input: dehydratedInput,
|
|
374689
374706
|
output: results.map((message, index) => mapMessage(message, dehydrateValue, index))
|
|
@@ -376807,7 +376824,7 @@ var init_findRelevantMemories = __esm(() => {
|
|
|
376807
376824
|
|
|
376808
376825
|
// src/utils/attachments.ts
|
|
376809
376826
|
import { readdir as readdir17, stat as stat31 } from "fs/promises";
|
|
376810
|
-
import { dirname as
|
|
376827
|
+
import { dirname as dirname36, parse as parse12, relative as relative19, resolve as resolve29 } from "path";
|
|
376811
376828
|
import { randomUUID as randomUUID23 } from "crypto";
|
|
376812
376829
|
async function getAttachments(input, toolUseContext, ideSelection, queuedCommands, messages, querySource, options2) {
|
|
376813
376830
|
if (isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_ATTACHMENTS) || isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE)) {
|
|
@@ -377183,21 +377200,21 @@ async function getSelectedLinesFromIDE(ideSelection, toolUseContext) {
|
|
|
377183
377200
|
];
|
|
377184
377201
|
}
|
|
377185
377202
|
function getDirectoriesToProcess(targetPath, originalCwd) {
|
|
377186
|
-
const targetDir =
|
|
377203
|
+
const targetDir = dirname36(resolve29(targetPath));
|
|
377187
377204
|
const nestedDirs = [];
|
|
377188
377205
|
let currentDir = targetDir;
|
|
377189
377206
|
while (currentDir !== originalCwd && currentDir !== parse12(currentDir).root) {
|
|
377190
377207
|
if (currentDir.startsWith(originalCwd)) {
|
|
377191
377208
|
nestedDirs.push(currentDir);
|
|
377192
377209
|
}
|
|
377193
|
-
currentDir =
|
|
377210
|
+
currentDir = dirname36(currentDir);
|
|
377194
377211
|
}
|
|
377195
377212
|
nestedDirs.reverse();
|
|
377196
377213
|
const cwdLevelDirs = [];
|
|
377197
377214
|
currentDir = originalCwd;
|
|
377198
377215
|
while (currentDir !== parse12(currentDir).root) {
|
|
377199
377216
|
cwdLevelDirs.push(currentDir);
|
|
377200
|
-
currentDir =
|
|
377217
|
+
currentDir = dirname36(currentDir);
|
|
377201
377218
|
}
|
|
377202
377219
|
cwdLevelDirs.reverse();
|
|
377203
377220
|
return { nestedDirs, cwdLevelDirs };
|
|
@@ -378443,21 +378460,21 @@ var init_attachments2 = __esm(() => {
|
|
|
378443
378460
|
});
|
|
378444
378461
|
|
|
378445
378462
|
// src/utils/plugins/loadPluginCommands.ts
|
|
378446
|
-
import { basename as basename27, dirname as
|
|
378463
|
+
import { basename as basename27, dirname as dirname37, join as join94 } from "path";
|
|
378447
378464
|
function isSkillFile2(filePath) {
|
|
378448
378465
|
return /^skill\.md$/i.test(basename27(filePath));
|
|
378449
378466
|
}
|
|
378450
378467
|
function getCommandNameFromFile(filePath, baseDir, pluginName) {
|
|
378451
378468
|
const isSkill = isSkillFile2(filePath);
|
|
378452
378469
|
if (isSkill) {
|
|
378453
|
-
const skillDirectory =
|
|
378454
|
-
const parentOfSkillDir =
|
|
378470
|
+
const skillDirectory = dirname37(filePath);
|
|
378471
|
+
const parentOfSkillDir = dirname37(skillDirectory);
|
|
378455
378472
|
const commandBaseName = basename27(skillDirectory);
|
|
378456
378473
|
const relativePath = parentOfSkillDir.startsWith(baseDir) ? parentOfSkillDir.slice(baseDir.length).replace(/^\//, "") : "";
|
|
378457
378474
|
const namespace = relativePath ? relativePath.split("/").join(":") : "";
|
|
378458
378475
|
return namespace ? `${pluginName}:${namespace}:${commandBaseName}` : `${pluginName}:${commandBaseName}`;
|
|
378459
378476
|
} else {
|
|
378460
|
-
const fileDirectory =
|
|
378477
|
+
const fileDirectory = dirname37(filePath);
|
|
378461
378478
|
const commandBaseName = basename27(filePath).replace(/\.md$/, "");
|
|
378462
378479
|
const relativePath = fileDirectory.startsWith(baseDir) ? fileDirectory.slice(baseDir.length).replace(/^\//, "") : "";
|
|
378463
378480
|
const namespace = relativePath ? relativePath.split("/").join(":") : "";
|
|
@@ -378484,7 +378501,7 @@ async function collectMarkdownFiles(dirPath, baseDir, loadedPaths) {
|
|
|
378484
378501
|
function transformPluginSkillFiles(files) {
|
|
378485
378502
|
const filesByDir = new Map;
|
|
378486
378503
|
for (const file2 of files) {
|
|
378487
|
-
const dir =
|
|
378504
|
+
const dir = dirname37(file2.filePath);
|
|
378488
378505
|
const dirFiles = filesByDir.get(dir) ?? [];
|
|
378489
378506
|
dirFiles.push(file2);
|
|
378490
378507
|
filesByDir.set(dir, dirFiles);
|
|
@@ -378573,7 +378590,7 @@ function createPluginCommand(commandName, file2, sourceName, pluginManifest, plu
|
|
|
378573
378590
|
return displayName || commandName;
|
|
378574
378591
|
},
|
|
378575
378592
|
async getPromptForCommand(args, context6) {
|
|
378576
|
-
let finalContent = config2.isSkillMode ? `Base directory for this skill: ${
|
|
378593
|
+
let finalContent = config2.isSkillMode ? `Base directory for this skill: ${dirname37(file2.filePath)}
|
|
378577
378594
|
|
|
378578
378595
|
${content}` : content;
|
|
378579
378596
|
finalContent = substituteArguments(finalContent, args, true, argumentNames);
|
|
@@ -378585,7 +378602,7 @@ ${content}` : content;
|
|
|
378585
378602
|
finalContent = substituteUserConfigInContent(finalContent, loadPluginOptions(sourceName), pluginManifest.userConfig);
|
|
378586
378603
|
}
|
|
378587
378604
|
if (config2.isSkillMode) {
|
|
378588
|
-
const rawSkillDir =
|
|
378605
|
+
const rawSkillDir = dirname37(file2.filePath);
|
|
378589
378606
|
const skillDir = process.platform === "win32" ? rawSkillDir.replace(/\\/g, "/") : rawSkillDir;
|
|
378590
378607
|
finalContent = finalContent.replace(/\$\{CLAUDE_SKILL_DIR\}/g, skillDir);
|
|
378591
378608
|
}
|
|
@@ -378645,7 +378662,7 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi
|
|
|
378645
378662
|
const skillName = `${pluginName}:${basename27(skillsPath)}`;
|
|
378646
378663
|
const file2 = {
|
|
378647
378664
|
filePath: directSkillPath,
|
|
378648
|
-
baseDir:
|
|
378665
|
+
baseDir: dirname37(directSkillPath),
|
|
378649
378666
|
frontmatter,
|
|
378650
378667
|
content: markdownContent
|
|
378651
378668
|
};
|
|
@@ -378694,7 +378711,7 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi
|
|
|
378694
378711
|
const skillName = `${pluginName}:${entry.name}`;
|
|
378695
378712
|
const file2 = {
|
|
378696
378713
|
filePath: skillFilePath,
|
|
378697
|
-
baseDir:
|
|
378714
|
+
baseDir: dirname37(skillFilePath),
|
|
378698
378715
|
frontmatter,
|
|
378699
378716
|
content: markdownContent
|
|
378700
378717
|
};
|
|
@@ -378807,7 +378824,7 @@ var init_loadPluginCommands = __esm(() => {
|
|
|
378807
378824
|
} : frontmatter;
|
|
378808
378825
|
const file2 = {
|
|
378809
378826
|
filePath: commandPath,
|
|
378810
|
-
baseDir:
|
|
378827
|
+
baseDir: dirname37(commandPath),
|
|
378811
378828
|
frontmatter: finalFrontmatter,
|
|
378812
378829
|
content: markdownContent
|
|
378813
378830
|
};
|
|
@@ -378932,7 +378949,7 @@ import {
|
|
|
378932
378949
|
writeFile as writeFile23
|
|
378933
378950
|
} from "fs/promises";
|
|
378934
378951
|
import { tmpdir as tmpdir6 } from "os";
|
|
378935
|
-
import { basename as basename28, dirname as
|
|
378952
|
+
import { basename as basename28, dirname as dirname38, join as join95 } from "path";
|
|
378936
378953
|
function isPluginZipCacheEnabled() {
|
|
378937
378954
|
return isEnvTruthy(process.env.CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE);
|
|
378938
378955
|
}
|
|
@@ -378995,7 +379012,7 @@ async function cleanupSessionPluginCache() {
|
|
|
378995
379012
|
}
|
|
378996
379013
|
}
|
|
378997
379014
|
async function atomicWriteToZipCache(targetPath, data) {
|
|
378998
|
-
const dir =
|
|
379015
|
+
const dir = dirname38(targetPath);
|
|
378999
379016
|
await getFsImplementation().mkdir(dir);
|
|
379000
379017
|
const tmpName = `.${basename28(targetPath)}.tmp.${randomBytes11(4).toString("hex")}`;
|
|
379001
379018
|
const tmpPath = join95(dir, tmpName);
|
|
@@ -379092,7 +379109,7 @@ async function extractZipToDirectory(zipPath, targetDir) {
|
|
|
379092
379109
|
continue;
|
|
379093
379110
|
}
|
|
379094
379111
|
const fullPath = join95(targetDir, relPath);
|
|
379095
|
-
await getFsImplementation().mkdir(
|
|
379112
|
+
await getFsImplementation().mkdir(dirname38(fullPath));
|
|
379096
379113
|
await writeFile23(fullPath, data);
|
|
379097
379114
|
const mode = modes[relPath];
|
|
379098
379115
|
if (mode && mode & 73) {
|
|
@@ -379582,7 +379599,7 @@ var init_marketplaceHelpers = __esm(() => {
|
|
|
379582
379599
|
|
|
379583
379600
|
// src/utils/plugins/officialMarketplaceGcs.ts
|
|
379584
379601
|
import { chmod as chmod9, mkdir as mkdir24, readFile as readFile31, rename as rename4, rm as rm7, writeFile as writeFile25 } from "fs/promises";
|
|
379585
|
-
import { dirname as
|
|
379602
|
+
import { dirname as dirname39, join as join97, resolve as resolve30, sep as sep21 } from "path";
|
|
379586
379603
|
async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCacheDir) {
|
|
379587
379604
|
const cacheDir = resolve30(marketplacesCacheDir);
|
|
379588
379605
|
const resolvedLoc = resolve30(installLocation);
|
|
@@ -379629,7 +379646,7 @@ async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCach
|
|
|
379629
379646
|
if (!rel || rel.endsWith("/"))
|
|
379630
379647
|
continue;
|
|
379631
379648
|
const dest = join97(staging, rel);
|
|
379632
|
-
await mkdir24(
|
|
379649
|
+
await mkdir24(dirname39(dest), { recursive: true });
|
|
379633
379650
|
await writeFile25(dest, data);
|
|
379634
379651
|
const mode = modes[arcPath];
|
|
379635
379652
|
if (mode && mode & 73) {
|
|
@@ -379703,7 +379720,7 @@ var init_officialMarketplaceGcs = __esm(() => {
|
|
|
379703
379720
|
|
|
379704
379721
|
// src/utils/plugins/marketplaceManager.ts
|
|
379705
379722
|
import { writeFile as writeFile26 } from "fs/promises";
|
|
379706
|
-
import { basename as basename29, dirname as
|
|
379723
|
+
import { basename as basename29, dirname as dirname40, isAbsolute as isAbsolute23, join as join98, resolve as resolve31, sep as sep22 } from "path";
|
|
379707
379724
|
function getKnownMarketplacesFile() {
|
|
379708
379725
|
return join98(getPluginsDirectory(), "known_marketplaces.json");
|
|
379709
379726
|
}
|
|
@@ -380383,7 +380400,7 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
380383
380400
|
case "file": {
|
|
380384
380401
|
const absPath = resolve31(source.path);
|
|
380385
380402
|
marketplacePath = absPath;
|
|
380386
|
-
temporaryCachePath =
|
|
380403
|
+
temporaryCachePath = dirname40(dirname40(absPath));
|
|
380387
380404
|
cleanupNeeded = false;
|
|
380388
380405
|
break;
|
|
380389
380406
|
}
|
|
@@ -380398,7 +380415,7 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
380398
380415
|
temporaryCachePath = join98(cacheDir, source.name);
|
|
380399
380416
|
marketplacePath = join98(temporaryCachePath, ".claude-plugin", "marketplace.json");
|
|
380400
380417
|
cleanupNeeded = false;
|
|
380401
|
-
await fs4.mkdir(
|
|
380418
|
+
await fs4.mkdir(dirname40(marketplacePath));
|
|
380402
380419
|
await writeFile26(marketplacePath, jsonStringify({
|
|
380403
380420
|
name: source.name,
|
|
380404
380421
|
owner: source.owner ?? { name: "settings" },
|
|
@@ -380893,7 +380910,7 @@ var init_marketplaceManager = __esm(() => {
|
|
|
380893
380910
|
});
|
|
380894
380911
|
|
|
380895
380912
|
// src/utils/plugins/installedPluginsManager.ts
|
|
380896
|
-
import { dirname as
|
|
380913
|
+
import { dirname as dirname41, join as join99 } from "path";
|
|
380897
380914
|
function getInstalledPluginsFilePath() {
|
|
380898
380915
|
return join99(getPluginsDirectory(), "installed_plugins.json");
|
|
380899
380916
|
}
|
|
@@ -381459,7 +381476,7 @@ var init_pluginVersioning = __esm(() => {
|
|
|
381459
381476
|
// src/utils/plugins/pluginInstallationHelpers.ts
|
|
381460
381477
|
import { randomBytes as randomBytes12 } from "crypto";
|
|
381461
381478
|
import { rename as rename5, rm as rm8 } from "fs/promises";
|
|
381462
|
-
import { dirname as
|
|
381479
|
+
import { dirname as dirname42, join as join100, resolve as resolve32, sep as sep23 } from "path";
|
|
381463
381480
|
function getCurrentTimestamp() {
|
|
381464
381481
|
return new Date().toISOString();
|
|
381465
381482
|
}
|
|
@@ -381483,14 +381500,14 @@ async function cacheAndRegisterPlugin(pluginId, entry, scope = "user", projectPa
|
|
|
381483
381500
|
const versionedPath = getVersionedCachePath(pluginId, version2);
|
|
381484
381501
|
let finalPath = cacheResult.path;
|
|
381485
381502
|
if (cacheResult.path !== versionedPath) {
|
|
381486
|
-
await getFsImplementation().mkdir(
|
|
381503
|
+
await getFsImplementation().mkdir(dirname42(versionedPath));
|
|
381487
381504
|
await rm8(versionedPath, { recursive: true, force: true });
|
|
381488
381505
|
const normalizedCachePath = cacheResult.path.endsWith(sep23) ? cacheResult.path : cacheResult.path + sep23;
|
|
381489
381506
|
const isSubdirectory = versionedPath.startsWith(normalizedCachePath);
|
|
381490
381507
|
if (isSubdirectory) {
|
|
381491
|
-
const tempPath = join100(
|
|
381508
|
+
const tempPath = join100(dirname42(cacheResult.path), `.claude-plugin-temp-${Date.now()}-${randomBytes12(4).toString("hex")}`);
|
|
381492
381509
|
await rename5(cacheResult.path, tempPath);
|
|
381493
|
-
await getFsImplementation().mkdir(
|
|
381510
|
+
await getFsImplementation().mkdir(dirname42(versionedPath));
|
|
381494
381511
|
await rename5(tempPath, versionedPath);
|
|
381495
381512
|
} else {
|
|
381496
381513
|
await rename5(cacheResult.path, versionedPath);
|
|
@@ -381719,7 +381736,7 @@ import {
|
|
|
381719
381736
|
stat as stat34,
|
|
381720
381737
|
symlink as symlink3
|
|
381721
381738
|
} from "fs/promises";
|
|
381722
|
-
import { basename as basename30, dirname as
|
|
381739
|
+
import { basename as basename30, dirname as dirname43, join as join101, relative as relative20, resolve as resolve33, sep as sep24 } from "path";
|
|
381723
381740
|
function getPluginCachePath() {
|
|
381724
381741
|
return join101(getPluginsDirectory(), "cache");
|
|
381725
381742
|
}
|
|
@@ -381749,7 +381766,7 @@ async function probeSeedCache(pluginId, version2) {
|
|
|
381749
381766
|
}
|
|
381750
381767
|
async function probeSeedCacheAnyVersion(pluginId) {
|
|
381751
381768
|
for (const seedDir of getPluginSeedDirs()) {
|
|
381752
|
-
const pluginDir =
|
|
381769
|
+
const pluginDir = dirname43(getVersionedCachePathIn(seedDir, pluginId, "_"));
|
|
381753
381770
|
try {
|
|
381754
381771
|
const versions2 = await readdir20(pluginDir);
|
|
381755
381772
|
if (versions2.length !== 1)
|
|
@@ -381791,7 +381808,7 @@ async function copyDir(src, dest) {
|
|
|
381791
381808
|
if (resolvedTarget.startsWith(srcPrefix) || resolvedTarget === resolvedSrc) {
|
|
381792
381809
|
const targetRelativeToSrc = relative20(resolvedSrc, resolvedTarget);
|
|
381793
381810
|
const destTargetPath = join101(dest, targetRelativeToSrc);
|
|
381794
|
-
const relativeLinkPath = relative20(
|
|
381811
|
+
const relativeLinkPath = relative20(dirname43(destPath), destTargetPath);
|
|
381795
381812
|
await symlink3(relativeLinkPath, destPath);
|
|
381796
381813
|
} else {
|
|
381797
381814
|
await symlink3(resolvedTarget, destPath);
|
|
@@ -381822,7 +381839,7 @@ async function copyPluginToVersionedCache(sourcePath, pluginId, version2, entry,
|
|
|
381822
381839
|
logForDebugging2(`Using seed cache for ${pluginId}@${version2} at ${seedPath}`);
|
|
381823
381840
|
return seedPath;
|
|
381824
381841
|
}
|
|
381825
|
-
await getFsImplementation().mkdir(
|
|
381842
|
+
await getFsImplementation().mkdir(dirname43(cachePath2));
|
|
381826
381843
|
if (entry && typeof entry.source === "string" && marketplaceDir) {
|
|
381827
381844
|
const sourceDir = validatePathWithinBase(marketplaceDir, entry.source);
|
|
381828
381845
|
logForDebugging2(`Copying source directory ${entry.source} for plugin ${pluginId}`);
|
|
@@ -386785,7 +386802,7 @@ var init_messages3 = __esm(() => {
|
|
|
386785
386802
|
|
|
386786
386803
|
// src/services/api/errors.ts
|
|
386787
386804
|
function startsWithApiErrorPrefix(text) {
|
|
386788
|
-
return text.startsWith(API_ERROR_MESSAGE_PREFIX) || text.startsWith(`Please run /login
|
|
386805
|
+
return text.startsWith(API_ERROR_MESSAGE_PREFIX) || text.startsWith(`Please run /auth - ${API_ERROR_MESSAGE_PREFIX}`) || text.startsWith(`Please run /login - ${API_ERROR_MESSAGE_PREFIX}`);
|
|
386789
386806
|
}
|
|
386790
386807
|
function isPromptTooLongMessage(msg) {
|
|
386791
386808
|
if (!msg.isApiErrorMessage) {
|
|
@@ -387029,7 +387046,7 @@ function getAssistantMessageFromError(error42, model, options2) {
|
|
|
387029
387046
|
if (error42.message.includes("Extra usage is required for long context")) {
|
|
387030
387047
|
const hint = getIsNonInteractiveSession() ? "enable extra usage at claude.ai/settings/usage, or use --model to switch to standard context" : "run /extra-usage to enable, or /model to switch to standard context";
|
|
387031
387048
|
return createAssistantAPIErrorMessage({
|
|
387032
|
-
content: `${API_ERROR_MESSAGE_PREFIX}: Extra usage is required for 1M context
|
|
387049
|
+
content: `${API_ERROR_MESSAGE_PREFIX}: Extra usage is required for 1M context - ${hint}`,
|
|
387033
387050
|
error: "rate_limit"
|
|
387034
387051
|
});
|
|
387035
387052
|
}
|
|
@@ -387037,7 +387054,7 @@ function getAssistantMessageFromError(error42, model, options2) {
|
|
|
387037
387054
|
const innerMessage = stripped.match(/"message"\s*:\s*"([^"]*)"/)?.[1];
|
|
387038
387055
|
const detail = innerMessage || stripped;
|
|
387039
387056
|
return createAssistantAPIErrorMessage({
|
|
387040
|
-
content: `${API_ERROR_MESSAGE_PREFIX}: Request rejected (429)
|
|
387057
|
+
content: `${API_ERROR_MESSAGE_PREFIX}: Request rejected (429) - ${detail || "this may be a temporary capacity issue - check status.anthropic.com"}`,
|
|
387041
387058
|
error: "rate_limit"
|
|
387042
387059
|
});
|
|
387043
387060
|
}
|
|
@@ -387132,7 +387149,7 @@ Run /share and post the JSON file to ${MACRO.FEEDBACK_CHANNEL}.`;
|
|
|
387132
387149
|
}
|
|
387133
387150
|
if (isClaudeAISubscriber() && error42 instanceof import_sdk11.APIError && error42.status === 400 && error42.message.toLowerCase().includes("invalid model name") && (isNonCustomOpusModel(model) || model === "opus")) {
|
|
387134
387151
|
return createAssistantAPIErrorMessage({
|
|
387135
|
-
content: "Claude Opus is not available with the Claude Pro plan. If you have updated your subscription plan recently, run /logout and /
|
|
387152
|
+
content: "Claude Opus is not available with the Claude Pro plan. If you have updated your subscription plan recently, run /logout and /auth for the plan to take effect.",
|
|
387136
387153
|
error: "invalid_request"
|
|
387137
387154
|
});
|
|
387138
387155
|
}
|
|
@@ -387196,7 +387213,7 @@ Run /share and post the JSON file to ${MACRO.FEEDBACK_CHANNEL}.`;
|
|
|
387196
387213
|
}
|
|
387197
387214
|
return createAssistantAPIErrorMessage({
|
|
387198
387215
|
error: "authentication_failed",
|
|
387199
|
-
content: getIsNonInteractiveSession() ? `Failed to authenticate. ${API_ERROR_MESSAGE_PREFIX}: ${error42.message}` : `Please run /
|
|
387216
|
+
content: getIsNonInteractiveSession() ? `Failed to authenticate. ${API_ERROR_MESSAGE_PREFIX}: ${error42.message}` : `Please run /auth - ${API_ERROR_MESSAGE_PREFIX}: ${error42.message}`
|
|
387200
387217
|
});
|
|
387201
387218
|
}
|
|
387202
387219
|
if (isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK) && error42 instanceof Error && error42.message.toLowerCase().includes("model id")) {
|
|
@@ -387355,7 +387372,7 @@ function getErrorMessageIfRefusal(stopReason, model) {
|
|
|
387355
387372
|
error: "invalid_request"
|
|
387356
387373
|
});
|
|
387357
387374
|
}
|
|
387358
|
-
var import_sdk11, API_ERROR_MESSAGE_PREFIX = "API Error", PROMPT_TOO_LONG_ERROR_MESSAGE = "Prompt is too long", CREDIT_BALANCE_TOO_LOW_ERROR_MESSAGE = "Credit balance is too low", INVALID_API_KEY_ERROR_MESSAGE = "Not logged in
|
|
387375
|
+
var import_sdk11, API_ERROR_MESSAGE_PREFIX = "API Error", PROMPT_TOO_LONG_ERROR_MESSAGE = "Prompt is too long", CREDIT_BALANCE_TOO_LOW_ERROR_MESSAGE = "Credit balance is too low", INVALID_API_KEY_ERROR_MESSAGE = "Not logged in - Please run /auth", INVALID_API_KEY_ERROR_MESSAGE_EXTERNAL = "Invalid API key · Fix external API key", ORG_DISABLED_ERROR_MESSAGE_ENV_KEY_WITH_OAUTH = "Your ANTHROPIC_API_KEY belongs to a disabled organization · Unset the environment variable to use your subscription instead", ORG_DISABLED_ERROR_MESSAGE_ENV_KEY = "Your ANTHROPIC_API_KEY belongs to a disabled organization · Update or unset the environment variable", TOKEN_REVOKED_ERROR_MESSAGE = "OAuth token revoked - Please run /auth", CCR_AUTH_ERROR_MESSAGE = "Authentication error · This may be a temporary network issue, please try again", REPEATED_529_ERROR_MESSAGE = "Repeated 529 Overloaded errors", CUSTOM_OFF_SWITCH_MESSAGE = "Opus is experiencing high load, please use /model to switch to Sonnet", API_TIMEOUT_ERROR_MESSAGE = "Request timed out", OAUTH_ORG_NOT_ALLOWED_ERROR_MESSAGE = "Your account does not have access to Claude Code. Please run /auth.";
|
|
387359
387376
|
var init_errors6 = __esm(() => {
|
|
387360
387377
|
init_betas();
|
|
387361
387378
|
init_auth2();
|
|
@@ -390049,7 +390066,7 @@ var init_appleTerminalBackup = __esm(() => {
|
|
|
390049
390066
|
|
|
390050
390067
|
// src/utils/completionCache.ts
|
|
390051
390068
|
import { homedir as homedir27 } from "os";
|
|
390052
|
-
import { dirname as
|
|
390069
|
+
import { dirname as dirname44, join as join104 } from "path";
|
|
390053
390070
|
function detectShell() {
|
|
390054
390071
|
const shell = process.env.SHELL || "";
|
|
390055
390072
|
const home = homedir27();
|
|
@@ -390129,7 +390146,7 @@ __export(exports_terminalSetup, {
|
|
|
390129
390146
|
import { randomBytes as randomBytes14 } from "crypto";
|
|
390130
390147
|
import { copyFile as copyFile8, mkdir as mkdir25, readFile as readFile33, writeFile as writeFile27 } from "fs/promises";
|
|
390131
390148
|
import { homedir as homedir28, platform as platform4 } from "os";
|
|
390132
|
-
import { dirname as
|
|
390149
|
+
import { dirname as dirname45, join as join105 } from "path";
|
|
390133
390150
|
import { pathToFileURL as pathToFileURL7 } from "url";
|
|
390134
390151
|
function isVSCodeRemoteSSH() {
|
|
390135
390152
|
const askpassMain = process.env.VSCODE_GIT_ASKPASS_MAIN ?? "";
|
|
@@ -390451,7 +390468,7 @@ chars = "\\u001B\\r"`;
|
|
|
390451
390468
|
return `${color("warning", theme)("Error backing up existing Alacritty config. Bailing out.")}${EOL5}${source_default.dim(`See ${formatPathLink(configPath)}`)}${EOL5}${source_default.dim(`Backup path: ${formatPathLink(backupPath)}`)}${EOL5}`;
|
|
390452
390469
|
}
|
|
390453
390470
|
} else {
|
|
390454
|
-
await mkdir25(
|
|
390471
|
+
await mkdir25(dirname45(configPath), {
|
|
390455
390472
|
recursive: true
|
|
390456
390473
|
});
|
|
390457
390474
|
}
|
|
@@ -392913,7 +392930,7 @@ var init_TextInput = __esm(() => {
|
|
|
392913
392930
|
});
|
|
392914
392931
|
|
|
392915
392932
|
// src/utils/suggestions/directoryCompletion.ts
|
|
392916
|
-
import { basename as basename34, dirname as
|
|
392933
|
+
import { basename as basename34, dirname as dirname46, join as join108, sep as sep25 } from "path";
|
|
392917
392934
|
function parsePartialPath(partialPath, basePath) {
|
|
392918
392935
|
if (!partialPath) {
|
|
392919
392936
|
const directory2 = basePath || getCwd();
|
|
@@ -392923,7 +392940,7 @@ function parsePartialPath(partialPath, basePath) {
|
|
|
392923
392940
|
if (partialPath.endsWith("/") || partialPath.endsWith(sep25)) {
|
|
392924
392941
|
return { directory: resolved, prefix: "" };
|
|
392925
392942
|
}
|
|
392926
|
-
const directory =
|
|
392943
|
+
const directory = dirname46(resolved);
|
|
392927
392944
|
const prefix = basename34(partialPath);
|
|
392928
392945
|
return { directory, prefix };
|
|
392929
392946
|
}
|
|
@@ -411098,7 +411115,7 @@ __export(exports_keybindings, {
|
|
|
411098
411115
|
call: () => call23
|
|
411099
411116
|
});
|
|
411100
411117
|
import { mkdir as mkdir30, writeFile as writeFile32 } from "fs/promises";
|
|
411101
|
-
import { dirname as
|
|
411118
|
+
import { dirname as dirname48 } from "path";
|
|
411102
411119
|
async function call23() {
|
|
411103
411120
|
if (!isKeybindingCustomizationEnabled()) {
|
|
411104
411121
|
return {
|
|
@@ -411108,7 +411125,7 @@ async function call23() {
|
|
|
411108
411125
|
}
|
|
411109
411126
|
const keybindingsPath = getKeybindingsPath();
|
|
411110
411127
|
let fileExists = false;
|
|
411111
|
-
await mkdir30(
|
|
411128
|
+
await mkdir30(dirname48(keybindingsPath), { recursive: true });
|
|
411112
411129
|
try {
|
|
411113
411130
|
await writeFile32(keybindingsPath, generateKeybindingsTemplate(), {
|
|
411114
411131
|
encoding: "utf-8",
|
|
@@ -411162,13 +411179,13 @@ __export(exports_auth3, {
|
|
|
411162
411179
|
});
|
|
411163
411180
|
import { createServer as createServer5 } from "node:http";
|
|
411164
411181
|
import { createHash as createHash21, randomBytes as randomBytes15 } from "node:crypto";
|
|
411165
|
-
import { appendFileSync as appendFileSync5, existsSync as existsSync10, mkdirSync as
|
|
411182
|
+
import { appendFileSync as appendFileSync5, existsSync as existsSync10, mkdirSync as mkdirSync10 } from "node:fs";
|
|
411166
411183
|
import { join as join115 } from "node:path";
|
|
411167
411184
|
function appendAuthLog(service, message) {
|
|
411168
411185
|
try {
|
|
411169
411186
|
const dir = getClaudeConfigHomeDir();
|
|
411170
411187
|
if (!existsSync10(dir)) {
|
|
411171
|
-
|
|
411188
|
+
mkdirSync10(dir, { recursive: true });
|
|
411172
411189
|
}
|
|
411173
411190
|
appendFileSync5(join115(dir, "auth.log"), `[${new Date().toISOString()}] [${service}] ${message}
|
|
411174
411191
|
`, { mode: 384 });
|
|
@@ -411183,7 +411200,7 @@ function appendAuthHttpLog(service, label, requestInfo, responseInfo) {
|
|
|
411183
411200
|
try {
|
|
411184
411201
|
const dir = getClaudeConfigHomeDir();
|
|
411185
411202
|
if (!existsSync10(dir)) {
|
|
411186
|
-
|
|
411203
|
+
mkdirSync10(dir, { recursive: true });
|
|
411187
411204
|
}
|
|
411188
411205
|
appendFileSync5(join115(dir, "auth-http.log"), `[${new Date().toISOString()}] [${service}] ${label}
|
|
411189
411206
|
REQUEST:
|
|
@@ -412118,7 +412135,7 @@ function AuthCommand({
|
|
|
412118
412135
|
port: CODEX_PORT,
|
|
412119
412136
|
callbackPath: "/auth/callback",
|
|
412120
412137
|
buildAuthUrl: (state2, challenge) => `${CODEX_AUTH_URL}?` + new URLSearchParams({
|
|
412121
|
-
client_id:
|
|
412138
|
+
client_id: CODEX_CLIENT_ID2,
|
|
412122
412139
|
redirect_uri: CODEX_REDIRECT_URI,
|
|
412123
412140
|
response_type: "code",
|
|
412124
412141
|
scope: CODEX_SCOPES,
|
|
@@ -412129,9 +412146,9 @@ function AuthCommand({
|
|
|
412129
412146
|
prompt: "consent"
|
|
412130
412147
|
}).toString(),
|
|
412131
412148
|
doExchange: async (code, verifier) => {
|
|
412132
|
-
const tokens = await exchangeTokens(
|
|
412149
|
+
const tokens = await exchangeTokens(CODEX_TOKEN_URL2, {
|
|
412133
412150
|
code,
|
|
412134
|
-
client_id:
|
|
412151
|
+
client_id: CODEX_CLIENT_ID2,
|
|
412135
412152
|
redirect_uri: CODEX_REDIRECT_URI,
|
|
412136
412153
|
grant_type: "authorization_code",
|
|
412137
412154
|
code_verifier: verifier
|
|
@@ -412172,7 +412189,7 @@ async function call24(onDone, context7) {
|
|
|
412172
412189
|
context: context7
|
|
412173
412190
|
}, undefined, false, undefined, this);
|
|
412174
412191
|
}
|
|
412175
|
-
var import_react120, jsx_dev_runtime209, AG_REDIRECT_URI = "http://localhost:51121/oauth-callback", AG_SCOPES, AG_AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth", AG_TOKEN_URL = "https://oauth2.googleapis.com/token", AG_USERINFO_URL = "https://www.googleapis.com/oauth2/v1/userinfo", AG_PORT = 51121, AG_BASE_URLS,
|
|
412192
|
+
var import_react120, jsx_dev_runtime209, AG_REDIRECT_URI = "http://localhost:51121/oauth-callback", AG_SCOPES, AG_AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth", AG_TOKEN_URL = "https://oauth2.googleapis.com/token", AG_USERINFO_URL = "https://www.googleapis.com/oauth2/v1/userinfo", AG_PORT = 51121, AG_BASE_URLS, CODEX_CLIENT_ID2 = "app_EMoamEEZ73f0CkXaXp7hrann", CODEX_AUTH_URL = "https://auth.openai.com/oauth/authorize", CODEX_TOKEN_URL2 = "https://auth.openai.com/oauth/token", CODEX_REDIRECT_URI = "http://localhost:1455/auth/callback", CODEX_SCOPES = "openid profile email offline_access", CODEX_PORT = 1455, ADD_TYPE_OPTIONS, API_KEY_ENV;
|
|
412176
412193
|
var init_auth8 = __esm(() => {
|
|
412177
412194
|
init_ConsoleOAuthFlow();
|
|
412178
412195
|
init_Dialog();
|
|
@@ -412225,7 +412242,8 @@ var init_auth8 = __esm(() => {
|
|
|
412225
412242
|
var auth_default = () => ({
|
|
412226
412243
|
type: "local-jsx",
|
|
412227
412244
|
name: "auth",
|
|
412228
|
-
|
|
412245
|
+
aliases: ["login"],
|
|
412246
|
+
description: "Sign in to a provider - Claude, Codex, Gemini, Z.AI",
|
|
412229
412247
|
isEnabled: () => true,
|
|
412230
412248
|
load: () => Promise.resolve().then(() => (init_auth8(), exports_auth3))
|
|
412231
412249
|
});
|
|
@@ -412237,29 +412255,33 @@ __export(exports_update, {
|
|
|
412237
412255
|
});
|
|
412238
412256
|
import { execSync } from "node:child_process";
|
|
412239
412257
|
var call25 = async () => {
|
|
412240
|
-
|
|
412241
|
-
const cache4 = readUpdateCache();
|
|
412258
|
+
const cache4 = await refreshUpdateCache({ force: true, timeoutMs: 5000 });
|
|
412242
412259
|
const latest = getAvailableUpdate(cache4);
|
|
412243
412260
|
const current = getCurrentVersion();
|
|
412261
|
+
if (!cache4) {
|
|
412262
|
+
return {
|
|
412263
|
+
type: "text",
|
|
412264
|
+
value: "Failed to check for updates. Try again in a moment."
|
|
412265
|
+
};
|
|
412266
|
+
}
|
|
412244
412267
|
if (!latest) {
|
|
412245
|
-
const checked = cache4 ? ` (checked ${new Date(cache4.checkedAt).toLocaleString()})` : " (not yet checked — try again in a moment)";
|
|
412246
412268
|
return {
|
|
412247
412269
|
type: "text",
|
|
412248
|
-
value: `snowcode v${current} is up to date${
|
|
412270
|
+
value: `snowcode v${current} is up to date (checked ${new Date(cache4.checkedAt).toLocaleString()})`
|
|
412249
412271
|
};
|
|
412250
412272
|
}
|
|
412251
412273
|
try {
|
|
412252
412274
|
execSync("npm install -g snowcode@latest", { stdio: "inherit" });
|
|
412253
412275
|
return {
|
|
412254
412276
|
type: "text",
|
|
412255
|
-
value:
|
|
412277
|
+
value: `Updated snowcode v${current} -> v${latest}
|
|
412256
412278
|
Restart to use the new version.`
|
|
412257
412279
|
};
|
|
412258
412280
|
} catch {
|
|
412259
412281
|
return {
|
|
412260
412282
|
type: "text",
|
|
412261
412283
|
value: [
|
|
412262
|
-
`Update available: v${current}
|
|
412284
|
+
`Update available: v${current} -> v${latest}`,
|
|
412263
412285
|
"",
|
|
412264
412286
|
"Install with one of:",
|
|
412265
412287
|
" npm install -g snowcode@latest",
|
|
@@ -423133,7 +423155,7 @@ var init_DiscoverPlugins = __esm(() => {
|
|
|
423133
423155
|
});
|
|
423134
423156
|
|
|
423135
423157
|
// src/services/plugins/pluginOperations.ts
|
|
423136
|
-
import { dirname as
|
|
423158
|
+
import { dirname as dirname49, join as join118 } from "path";
|
|
423137
423159
|
function assertInstallableScope(scope) {
|
|
423138
423160
|
if (!VALID_INSTALLABLE_SCOPES.includes(scope)) {
|
|
423139
423161
|
throw new Error(`Invalid scope "${scope}". Must be one of: ${VALID_INSTALLABLE_SCOPES.join(", ")}`);
|
|
@@ -423610,7 +423632,7 @@ async function performPluginUpdate({
|
|
|
423610
423632
|
}
|
|
423611
423633
|
throw e;
|
|
423612
423634
|
}
|
|
423613
|
-
const marketplaceDir = marketplaceStats.isDirectory() ? marketplaceInstallLocation :
|
|
423635
|
+
const marketplaceDir = marketplaceStats.isDirectory() ? marketplaceInstallLocation : dirname49(marketplaceInstallLocation);
|
|
423614
423636
|
sourcePath = join118(marketplaceDir, entry.source);
|
|
423615
423637
|
try {
|
|
423616
423638
|
await fs4.stat(sourcePath);
|
|
@@ -434946,7 +434968,7 @@ ${args ? "Additional user input: " + args : ""}
|
|
|
434946
434968
|
|
|
434947
434969
|
// src/utils/releaseNotes.ts
|
|
434948
434970
|
import { mkdir as mkdir31, readFile as readFile40, writeFile as writeFile35 } from "fs/promises";
|
|
434949
|
-
import { dirname as
|
|
434971
|
+
import { dirname as dirname51, join as join122 } from "path";
|
|
434950
434972
|
function getChangelogCachePath() {
|
|
434951
434973
|
return join122(getClaudeConfigHomeDir(), "cache", "changelog.md");
|
|
434952
434974
|
}
|
|
@@ -434957,7 +434979,7 @@ async function migrateChangelogFromConfig() {
|
|
|
434957
434979
|
}
|
|
434958
434980
|
const cachePath2 = getChangelogCachePath();
|
|
434959
434981
|
try {
|
|
434960
|
-
await mkdir31(
|
|
434982
|
+
await mkdir31(dirname51(cachePath2), { recursive: true });
|
|
434961
434983
|
await writeFile35(cachePath2, config3.cachedChangelog, {
|
|
434962
434984
|
encoding: "utf-8",
|
|
434963
434985
|
flag: "wx"
|
|
@@ -434979,7 +435001,7 @@ async function fetchAndStoreChangelog() {
|
|
|
434979
435001
|
return;
|
|
434980
435002
|
}
|
|
434981
435003
|
const cachePath2 = getChangelogCachePath();
|
|
434982
|
-
await mkdir31(
|
|
435004
|
+
await mkdir31(dirname51(cachePath2), { recursive: true });
|
|
434983
435005
|
await writeFile35(cachePath2, changelogContent, { encoding: "utf-8" });
|
|
434984
435006
|
changelogMemoryCache = changelogContent;
|
|
434985
435007
|
const changelogLastFetched = Date.now();
|
|
@@ -449073,7 +449095,7 @@ var init_terminalSetup2 = __esm(() => {
|
|
|
449073
449095
|
|
|
449074
449096
|
// src/utils/antigravityLocalSessions.ts
|
|
449075
449097
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
449076
|
-
import { existsSync as existsSync11, mkdirSync as
|
|
449098
|
+
import { existsSync as existsSync11, mkdirSync as mkdirSync11, readFileSync as readFileSync15, writeFileSync as writeFileSync8 } from "node:fs";
|
|
449077
449099
|
import { join as join123 } from "node:path";
|
|
449078
449100
|
import { platform as platform5 } from "node:os";
|
|
449079
449101
|
function getSnapshotPath() {
|
|
@@ -449092,8 +449114,8 @@ function loadSnapshotFile() {
|
|
|
449092
449114
|
function saveSnapshotFile(data) {
|
|
449093
449115
|
const dir = getClaudeConfigHomeDir();
|
|
449094
449116
|
if (!existsSync11(dir))
|
|
449095
|
-
|
|
449096
|
-
|
|
449117
|
+
mkdirSync11(dir, { recursive: true });
|
|
449118
|
+
writeFileSync8(getSnapshotPath(), JSON.stringify(data, null, 2), "utf8");
|
|
449097
449119
|
}
|
|
449098
449120
|
function extractRefreshToken(oauthTokenValue) {
|
|
449099
449121
|
const raw = oauthTokenValue?.trim();
|
|
@@ -449195,7 +449217,7 @@ var init_antigravityLocalSessions = __esm(() => {
|
|
|
449195
449217
|
|
|
449196
449218
|
// src/utils/antigravityLocalUsage.ts
|
|
449197
449219
|
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
449198
|
-
import { existsSync as existsSync12, mkdirSync as
|
|
449220
|
+
import { existsSync as existsSync12, mkdirSync as mkdirSync12, readdirSync as readdirSync4, readFileSync as readFileSync16, writeFileSync as writeFileSync9 } from "node:fs";
|
|
449199
449221
|
import { join as join124 } from "node:path";
|
|
449200
449222
|
import { homedir as homedir31, platform as platform6 } from "node:os";
|
|
449201
449223
|
function getConfigDir() {
|
|
@@ -449217,8 +449239,8 @@ function loadSnapshots() {
|
|
|
449217
449239
|
function saveSnapshots(data) {
|
|
449218
449240
|
const dir = getConfigDir();
|
|
449219
449241
|
if (!existsSync12(dir))
|
|
449220
|
-
|
|
449221
|
-
|
|
449242
|
+
mkdirSync12(dir, { recursive: true });
|
|
449243
|
+
writeFileSync9(getSnapshotPath2(), JSON.stringify(data, null, 2), "utf8");
|
|
449222
449244
|
}
|
|
449223
449245
|
function saveSnapshot(snapshot2) {
|
|
449224
449246
|
const data = loadSnapshots();
|
|
@@ -449705,14 +449727,14 @@ ${errorBody}`);
|
|
|
449705
449727
|
};
|
|
449706
449728
|
}
|
|
449707
449729
|
async function refreshCodexToken(refreshToken) {
|
|
449708
|
-
const res = await fetch(
|
|
449730
|
+
const res = await fetch(CODEX_TOKEN_URL3, {
|
|
449709
449731
|
method: "POST",
|
|
449710
449732
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
449711
|
-
body: new URLSearchParams({ client_id:
|
|
449733
|
+
body: new URLSearchParams({ client_id: CODEX_CLIENT_ID3, refresh_token: refreshToken, grant_type: "refresh_token" }).toString()
|
|
449712
449734
|
});
|
|
449713
449735
|
if (!res.ok) {
|
|
449714
449736
|
const errorBody = await res.text().catch(() => "unknown error");
|
|
449715
|
-
appendHttpLog("usage codex refresh error", `POST ${
|
|
449737
|
+
appendHttpLog("usage codex refresh error", `POST ${CODEX_TOKEN_URL3}
|
|
449716
449738
|
Content-Type: application/x-www-form-urlencoded`, `status=${res.status}
|
|
449717
449739
|
${errorBody}`);
|
|
449718
449740
|
if (res.status === 401) {
|
|
@@ -450330,7 +450352,7 @@ function UsageDashboard({ onDone }) {
|
|
|
450330
450352
|
]
|
|
450331
450353
|
}, undefined, true, undefined, this);
|
|
450332
450354
|
}
|
|
450333
|
-
var React94, import_react161, jsx_dev_runtime278, AG_CLOUDCODE_BASE = "https://cloudcode-pa.googleapis.com", AG_TOKEN_URL2 = "https://oauth2.googleapis.com/token", AG_PLATFORM = "PLATFORM_UNSPECIFIED",
|
|
450355
|
+
var React94, import_react161, jsx_dev_runtime278, AG_CLOUDCODE_BASE = "https://cloudcode-pa.googleapis.com", AG_TOKEN_URL2 = "https://oauth2.googleapis.com/token", AG_PLATFORM = "PLATFORM_UNSPECIFIED", CODEX_CLIENT_ID3 = "app_EMoamEEZ73f0CkXaXp7hrann", CODEX_TOKEN_URL3 = "https://auth.openai.com/oauth/token", CODEX_USAGE_URL = "https://chatgpt.com/backend-api/wham/usage", BLUE = "#4696ff", DIM3 = "#5a82af", ACCENT2 = "#64b4ff", WARN = "#ff9944", OK2 = "#44cc88", RED = "#ff5555", USAGE_CACHE_TTL_MS = 60000, USAGE_BAR_FILL = "#2f80ed", USAGE_BAR_TRACK = "#17324d", USAGE_BAR_BRACKET = "#6b8fb8", USAGE_BAR_GLYPH = "█", PAGE_ORDER, usagePageCache, call39 = async (onDone, _context) => {
|
|
450334
450356
|
return /* @__PURE__ */ jsx_dev_runtime278.jsxDEV(UsageDashboard, {
|
|
450335
450357
|
onDone: () => onDone(undefined, { display: "skip" })
|
|
450336
450358
|
}, undefined, false, undefined, this);
|
|
@@ -450364,7 +450386,7 @@ var init_usage3 = __esm(() => {
|
|
|
450364
450386
|
});
|
|
450365
450387
|
|
|
450366
450388
|
// src/utils/fallbackConfig.ts
|
|
450367
|
-
import { existsSync as existsSync13, readFileSync as readFileSync17, writeFileSync as
|
|
450389
|
+
import { existsSync as existsSync13, readFileSync as readFileSync17, writeFileSync as writeFileSync10 } from "node:fs";
|
|
450368
450390
|
import { join as join125 } from "node:path";
|
|
450369
450391
|
function getPath3() {
|
|
450370
450392
|
return join125(getClaudeConfigHomeDir(), "fallbacks.json");
|
|
@@ -450380,7 +450402,7 @@ function loadFallbackConfig() {
|
|
|
450380
450402
|
}
|
|
450381
450403
|
}
|
|
450382
450404
|
function saveFallbackConfig(config3) {
|
|
450383
|
-
|
|
450405
|
+
writeFileSync10(getPath3(), JSON.stringify(config3, null, 2), "utf-8");
|
|
450384
450406
|
}
|
|
450385
450407
|
function getFallbackOrder() {
|
|
450386
450408
|
return loadFallbackConfig().order;
|
|
@@ -464054,7 +464076,7 @@ var init_rewind = __esm(() => {
|
|
|
464054
464076
|
});
|
|
464055
464077
|
|
|
464056
464078
|
// src/utils/heapDumpService.ts
|
|
464057
|
-
import { createWriteStream as createWriteStream3, writeFileSync as
|
|
464079
|
+
import { createWriteStream as createWriteStream3, writeFileSync as writeFileSync11 } from "fs";
|
|
464058
464080
|
import { readdir as readdir25, readFile as readFile43, writeFile as writeFile37 } from "fs/promises";
|
|
464059
464081
|
import { join as join129 } from "path";
|
|
464060
464082
|
import { pipeline as pipeline2 } from "stream/promises";
|
|
@@ -464193,7 +464215,7 @@ async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
|
464193
464215
|
}
|
|
464194
464216
|
async function writeHeapSnapshot(filepath) {
|
|
464195
464217
|
if (typeof Bun !== "undefined") {
|
|
464196
|
-
|
|
464218
|
+
writeFileSync11(filepath, Bun.generateHeapSnapshot("v8", "arraybuffer"), {
|
|
464197
464219
|
mode: 384
|
|
464198
464220
|
});
|
|
464199
464221
|
Bun.gc(true);
|
|
@@ -464732,7 +464754,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
464732
464754
|
var call59 = async () => {
|
|
464733
464755
|
return {
|
|
464734
464756
|
type: "text",
|
|
464735
|
-
value: `${"99.0.0"} (built ${"2026-04-
|
|
464757
|
+
value: `${"99.0.0"} (built ${"2026-04-05T03:33:03.306Z"})`
|
|
464736
464758
|
};
|
|
464737
464759
|
}, version2, version_default;
|
|
464738
464760
|
var init_version = __esm(() => {
|
|
@@ -466828,7 +466850,7 @@ var init_advisor2 = __esm(() => {
|
|
|
466828
466850
|
// src/skills/bundledSkills.ts
|
|
466829
466851
|
import { constants as fsConstants5 } from "fs";
|
|
466830
466852
|
import { mkdir as mkdir35, open as open13 } from "fs/promises";
|
|
466831
|
-
import { dirname as
|
|
466853
|
+
import { dirname as dirname52, isAbsolute as isAbsolute24, join as join132, normalize as normalize13, sep as pathSep2 } from "path";
|
|
466832
466854
|
function registerBundledSkill(definition) {
|
|
466833
466855
|
const { files: files2 } = definition;
|
|
466834
466856
|
let skillRoot;
|
|
@@ -466892,7 +466914,7 @@ async function writeSkillFiles(dir, files2) {
|
|
|
466892
466914
|
const byParent = new Map;
|
|
466893
466915
|
for (const [relPath, content] of Object.entries(files2)) {
|
|
466894
466916
|
const target = resolveSkillFilePath(dir, relPath);
|
|
466895
|
-
const parent2 =
|
|
466917
|
+
const parent2 = dirname52(target);
|
|
466896
466918
|
const entry = [target, content];
|
|
466897
466919
|
const group = byParent.get(parent2);
|
|
466898
466920
|
if (group)
|
|
@@ -474863,7 +474885,7 @@ import {
|
|
|
474863
474885
|
unlink as unlink21,
|
|
474864
474886
|
writeFile as writeFile41
|
|
474865
474887
|
} from "fs/promises";
|
|
474866
|
-
import { basename as basename40, dirname as
|
|
474888
|
+
import { basename as basename40, dirname as dirname54, join as join139 } from "path";
|
|
474867
474889
|
function isTranscriptMessage(entry) {
|
|
474868
474890
|
return entry.type === "user" || entry.type === "assistant" || entry.type === "attachment" || entry.type === "system";
|
|
474869
474891
|
}
|
|
@@ -474908,7 +474930,7 @@ function getAgentMetadataPath(agentId) {
|
|
|
474908
474930
|
}
|
|
474909
474931
|
async function writeAgentMetadata(agentId, metadata) {
|
|
474910
474932
|
const path21 = getAgentMetadataPath(agentId);
|
|
474911
|
-
await mkdir38(
|
|
474933
|
+
await mkdir38(dirname54(path21), { recursive: true });
|
|
474912
474934
|
await writeFile41(path21, JSON.stringify(metadata));
|
|
474913
474935
|
}
|
|
474914
474936
|
async function readAgentMetadata(agentId) {
|
|
@@ -474931,7 +474953,7 @@ function getRemoteAgentMetadataPath(taskId) {
|
|
|
474931
474953
|
}
|
|
474932
474954
|
async function writeRemoteAgentMetadata(taskId, metadata) {
|
|
474933
474955
|
const path21 = getRemoteAgentMetadataPath(taskId);
|
|
474934
|
-
await mkdir38(
|
|
474956
|
+
await mkdir38(dirname54(path21), { recursive: true });
|
|
474935
474957
|
await writeFile41(path21, JSON.stringify(metadata));
|
|
474936
474958
|
}
|
|
474937
474959
|
async function readRemoteAgentMetadata(taskId) {
|
|
@@ -475120,7 +475142,7 @@ class Project {
|
|
|
475120
475142
|
try {
|
|
475121
475143
|
await fsAppendFile(filePath, data, { mode: 384 });
|
|
475122
475144
|
} catch {
|
|
475123
|
-
await mkdir38(
|
|
475145
|
+
await mkdir38(dirname54(filePath), { recursive: true, mode: 448 });
|
|
475124
475146
|
await fsAppendFile(filePath, data, { mode: 384 });
|
|
475125
475147
|
}
|
|
475126
475148
|
}
|
|
@@ -475719,7 +475741,7 @@ async function hydrateFromCCRv2InternalEvents(sessionId) {
|
|
|
475719
475741
|
}
|
|
475720
475742
|
for (const [agentId, entries] of byAgent) {
|
|
475721
475743
|
const agentFile = getAgentTranscriptPath(asAgentId(agentId));
|
|
475722
|
-
await mkdir38(
|
|
475744
|
+
await mkdir38(dirname54(agentFile), { recursive: true, mode: 448 });
|
|
475723
475745
|
const agentContent = entries.map((p) => jsonStringify(p) + `
|
|
475724
475746
|
`).join("");
|
|
475725
475747
|
await writeFile41(agentFile, agentContent, {
|
|
@@ -476256,7 +476278,7 @@ function appendEntryToFile(fullPath, entry) {
|
|
|
476256
476278
|
try {
|
|
476257
476279
|
fs5.appendFileSync(fullPath, line, { mode: 384 });
|
|
476258
476280
|
} catch {
|
|
476259
|
-
fs5.mkdirSync(
|
|
476281
|
+
fs5.mkdirSync(dirname54(fullPath), { mode: 448 });
|
|
476260
476282
|
fs5.appendFileSync(fullPath, line, { mode: 384 });
|
|
476261
476283
|
}
|
|
476262
476284
|
}
|
|
@@ -483184,7 +483206,7 @@ import {
|
|
|
483184
483206
|
symlink as symlink5,
|
|
483185
483207
|
utimes as utimes2
|
|
483186
483208
|
} from "fs/promises";
|
|
483187
|
-
import { basename as basename42, dirname as
|
|
483209
|
+
import { basename as basename42, dirname as dirname55, join as join143 } from "path";
|
|
483188
483210
|
function validateWorktreeSlug(slug) {
|
|
483189
483211
|
if (slug.length > MAX_WORKTREE_SLUG_LENGTH) {
|
|
483190
483212
|
throw new Error(`Invalid worktree name: must be ${MAX_WORKTREE_SLUG_LENGTH} characters or fewer (got ${slug.length})`);
|
|
@@ -483380,7 +483402,7 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
|
483380
483402
|
const srcPath = join143(repoRoot, relativePath2);
|
|
483381
483403
|
const destPath = join143(worktreePath, relativePath2);
|
|
483382
483404
|
try {
|
|
483383
|
-
await mkdir40(
|
|
483405
|
+
await mkdir40(dirname55(destPath), { recursive: true });
|
|
483384
483406
|
await copyFile10(srcPath, destPath);
|
|
483385
483407
|
copied.push(relativePath2);
|
|
483386
483408
|
} catch (e) {
|
|
@@ -483397,7 +483419,7 @@ async function performPostCreationSetup(repoRoot, worktreePath) {
|
|
|
483397
483419
|
const sourceSettingsLocal = join143(repoRoot, localSettingsRelativePath);
|
|
483398
483420
|
try {
|
|
483399
483421
|
const destSettingsLocal = join143(worktreePath, localSettingsRelativePath);
|
|
483400
|
-
await mkdirRecursive(
|
|
483422
|
+
await mkdirRecursive(dirname55(destSettingsLocal));
|
|
483401
483423
|
await copyFile10(sourceSettingsLocal, destSettingsLocal);
|
|
483402
483424
|
logForDebugging2(`Copied settings.local.json to worktree: ${destSettingsLocal}`);
|
|
483403
483425
|
} catch (e) {
|
|
@@ -507512,6 +507534,9 @@ var init_SandboxPromptFooterHint = __esm(() => {
|
|
|
507512
507534
|
});
|
|
507513
507535
|
|
|
507514
507536
|
// src/components/PromptInput/Notifications.tsx
|
|
507537
|
+
function hasAnyConfiguredThirdPartyAuth() {
|
|
507538
|
+
return resolveCodexApiCredentials().source !== "none" || Boolean(process.env.CODEX_API_KEY) || Boolean(process.env.OPENAI_API_KEY) || Boolean(process.env.GEMINI_API_KEY) || Boolean(process.env.GOOGLE_API_KEY) || Boolean(process.env.VERTEX_API_KEY) || Boolean(process.env.ZAI_API_KEY);
|
|
507539
|
+
}
|
|
507515
507540
|
function Notifications(t0) {
|
|
507516
507541
|
const $2 = import_react_compiler_runtime307.c(34);
|
|
507517
507542
|
const {
|
|
@@ -507555,6 +507580,7 @@ function Notifications(t0) {
|
|
|
507555
507580
|
status: ideStatus
|
|
507556
507581
|
} = useIdeConnectionStatus(mcpClients);
|
|
507557
507582
|
const notifications = useAppState(_temp179);
|
|
507583
|
+
const authVersion = useAppState((s) => s.authVersion);
|
|
507558
507584
|
const {
|
|
507559
507585
|
addNotification,
|
|
507560
507586
|
removeNotification
|
|
@@ -507596,6 +507622,7 @@ function Notifications(t0) {
|
|
|
507596
507622
|
}
|
|
507597
507623
|
const subscriptionType = t7;
|
|
507598
507624
|
const isTeamOrEnterprise = subscriptionType === "team" || subscriptionType === "enterprise";
|
|
507625
|
+
const hasAnyLoggedInProvider = import_react232.useMemo(() => getSubscriptionType() !== null || getEnabledAccounts().length > 0 || hasAnyConfiguredThirdPartyAuth(), [authVersion]);
|
|
507599
507626
|
let t8;
|
|
507600
507627
|
if ($2[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
507601
507628
|
t8 = getExternalEditor();
|
|
@@ -507735,6 +507762,8 @@ function NotificationContent({
|
|
|
507735
507762
|
}, 1000, setApiKeyHelperSlow);
|
|
507736
507763
|
return () => clearInterval(interval);
|
|
507737
507764
|
}, []);
|
|
507765
|
+
const authVersion_0 = useAppState((s_2) => s_2.authVersion);
|
|
507766
|
+
const hasAnyLoggedInProvider = import_react232.useMemo(() => getSubscriptionType() !== null || getEnabledAccounts().length > 0 || hasAnyConfiguredThirdPartyAuth(), [authVersion_0]);
|
|
507738
507767
|
const voiceState = "idle";
|
|
507739
507768
|
const voiceEnabled = false;
|
|
507740
507769
|
const voiceError = null;
|
|
@@ -507783,11 +507812,11 @@ function NotificationContent({
|
|
|
507783
507812
|
}, undefined, true, undefined, this)
|
|
507784
507813
|
]
|
|
507785
507814
|
}, undefined, true, undefined, this),
|
|
507786
|
-
(apiKeyStatus === "invalid" || apiKeyStatus === "missing") && /* @__PURE__ */ jsx_dev_runtime402.jsxDEV(ThemedBox_default, {
|
|
507815
|
+
(apiKeyStatus === "invalid" || apiKeyStatus === "missing") && (isEnvTruthy(process.env.CLAUDE_CODE_REMOTE) || !hasAnyLoggedInProvider) && /* @__PURE__ */ jsx_dev_runtime402.jsxDEV(ThemedBox_default, {
|
|
507787
507816
|
children: /* @__PURE__ */ jsx_dev_runtime402.jsxDEV(ThemedText, {
|
|
507788
507817
|
color: "error",
|
|
507789
507818
|
wrap: "truncate",
|
|
507790
|
-
children: isEnvTruthy(process.env.CLAUDE_CODE_REMOTE) ? "Authentication error
|
|
507819
|
+
children: isEnvTruthy(process.env.CLAUDE_CODE_REMOTE) ? "Authentication error - Try again" : "Not logged in - Run /auth"
|
|
507791
507820
|
}, undefined, false, undefined, this)
|
|
507792
507821
|
}, undefined, false, undefined, this),
|
|
507793
507822
|
debug && /* @__PURE__ */ jsx_dev_runtime402.jsxDEV(ThemedBox_default, {
|
|
@@ -507837,6 +507866,8 @@ var init_Notifications = __esm(() => {
|
|
|
507837
507866
|
init_ink2();
|
|
507838
507867
|
init_claudeAiLimitsHook();
|
|
507839
507868
|
init_autoCompact();
|
|
507869
|
+
init_providerConfig();
|
|
507870
|
+
init_accountManager();
|
|
507840
507871
|
init_auth2();
|
|
507841
507872
|
init_editor();
|
|
507842
507873
|
init_envUtils();
|
|
@@ -524555,7 +524586,7 @@ __export(exports_asciicast, {
|
|
|
524555
524586
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
524556
524587
|
});
|
|
524557
524588
|
import { appendFile as appendFile7, rename as rename10 } from "fs/promises";
|
|
524558
|
-
import { basename as basename55, dirname as
|
|
524589
|
+
import { basename as basename55, dirname as dirname56, join as join149 } from "path";
|
|
524559
524590
|
function getRecordFilePath() {
|
|
524560
524591
|
if (recordingState.filePath !== null) {
|
|
524561
524592
|
return recordingState.filePath;
|
|
@@ -524637,7 +524668,7 @@ function installAsciicastRecorder() {
|
|
|
524637
524668
|
}
|
|
524638
524669
|
});
|
|
524639
524670
|
try {
|
|
524640
|
-
getFsImplementation().mkdirSync(
|
|
524671
|
+
getFsImplementation().mkdirSync(dirname56(filePath));
|
|
524641
524672
|
} catch {}
|
|
524642
524673
|
getFsImplementation().appendFileSync(filePath, header + `
|
|
524643
524674
|
`, { mode: 384 });
|
|
@@ -524706,7 +524737,7 @@ var init_asciicast = __esm(() => {
|
|
|
524706
524737
|
});
|
|
524707
524738
|
|
|
524708
524739
|
// src/utils/sessionRestore.ts
|
|
524709
|
-
import { dirname as
|
|
524740
|
+
import { dirname as dirname57 } from "path";
|
|
524710
524741
|
function extractTodosFromTranscript(messages) {
|
|
524711
524742
|
for (let i3 = messages.length - 1;i3 >= 0; i3--) {
|
|
524712
524743
|
const msg = messages[i3];
|
|
@@ -524831,7 +524862,7 @@ async function processResumedConversation(result, opts, context8) {
|
|
|
524831
524862
|
if (!opts.forkSession) {
|
|
524832
524863
|
const sid = opts.sessionIdOverride ?? result.sessionId;
|
|
524833
524864
|
if (sid) {
|
|
524834
|
-
switchSession(asSessionId(sid), opts.transcriptPath ?
|
|
524865
|
+
switchSession(asSessionId(sid), opts.transcriptPath ? dirname57(opts.transcriptPath) : null);
|
|
524835
524866
|
await renameRecordingForSession();
|
|
524836
524867
|
await resetSessionFilePointer();
|
|
524837
524868
|
restoreCostStateForSession(sid);
|
|
@@ -533526,7 +533557,7 @@ var exports_REPL = {};
|
|
|
533526
533557
|
__export(exports_REPL, {
|
|
533527
533558
|
REPL: () => REPL
|
|
533528
533559
|
});
|
|
533529
|
-
import { dirname as
|
|
533560
|
+
import { dirname as dirname58, join as join152 } from "path";
|
|
533530
533561
|
import { tmpdir as tmpdir11 } from "os";
|
|
533531
533562
|
import { writeFile as writeFile44 } from "fs/promises";
|
|
533532
533563
|
import { randomUUID as randomUUID47 } from "crypto";
|
|
@@ -534462,7 +534493,7 @@ function REPL({
|
|
|
534462
534493
|
const targetSessionCosts = getStoredSessionCosts(sessionId);
|
|
534463
534494
|
saveCurrentSessionCosts();
|
|
534464
534495
|
resetCostState();
|
|
534465
|
-
switchSession(asSessionId(sessionId), log2.fullPath ?
|
|
534496
|
+
switchSession(asSessionId(sessionId), log2.fullPath ? dirname58(log2.fullPath) : null);
|
|
534466
534497
|
const {
|
|
534467
534498
|
renameRecordingForSession: renameRecordingForSession2
|
|
534468
534499
|
} = await Promise.resolve().then(() => (init_asciicast(), exports_asciicast));
|
|
@@ -538185,7 +538216,7 @@ function WelcomeV2() {
|
|
|
538185
538216
|
dimColor: true,
|
|
538186
538217
|
children: [
|
|
538187
538218
|
"v",
|
|
538188
|
-
"0.9.
|
|
538219
|
+
"0.9.2",
|
|
538189
538220
|
" "
|
|
538190
538221
|
]
|
|
538191
538222
|
}, undefined, true, undefined, this)
|
|
@@ -538385,7 +538416,7 @@ function WelcomeV2() {
|
|
|
538385
538416
|
dimColor: true,
|
|
538386
538417
|
children: [
|
|
538387
538418
|
"v",
|
|
538388
|
-
"0.9.
|
|
538419
|
+
"0.9.2",
|
|
538389
538420
|
" "
|
|
538390
538421
|
]
|
|
538391
538422
|
}, undefined, true, undefined, this)
|
|
@@ -538611,7 +538642,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
538611
538642
|
dimColor: true,
|
|
538612
538643
|
children: [
|
|
538613
538644
|
"v",
|
|
538614
|
-
"0.9.
|
|
538645
|
+
"0.9.2",
|
|
538615
538646
|
" "
|
|
538616
538647
|
]
|
|
538617
538648
|
}, undefined, true, undefined, this);
|
|
@@ -538865,7 +538896,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
538865
538896
|
dimColor: true,
|
|
538866
538897
|
children: [
|
|
538867
538898
|
"v",
|
|
538868
|
-
"0.9.
|
|
538899
|
+
"0.9.2",
|
|
538869
538900
|
" "
|
|
538870
538901
|
]
|
|
538871
538902
|
}, undefined, true, undefined, this);
|
|
@@ -541541,7 +541572,7 @@ var exports_ResumeConversation = {};
|
|
|
541541
541572
|
__export(exports_ResumeConversation, {
|
|
541542
541573
|
ResumeConversation: () => ResumeConversation
|
|
541543
541574
|
});
|
|
541544
|
-
import { dirname as
|
|
541575
|
+
import { dirname as dirname59 } from "path";
|
|
541545
541576
|
function parsePrIdentifier(value) {
|
|
541546
541577
|
const directNumber = parseInt(value, 10);
|
|
541547
541578
|
if (!isNaN(directNumber) && directNumber > 0) {
|
|
@@ -541675,7 +541706,7 @@ function ResumeConversation({
|
|
|
541675
541706
|
}
|
|
541676
541707
|
if (false) {}
|
|
541677
541708
|
if (result_3.sessionId && !forkSession) {
|
|
541678
|
-
switchSession(asSessionId(result_3.sessionId), log_0.fullPath ?
|
|
541709
|
+
switchSession(asSessionId(result_3.sessionId), log_0.fullPath ? dirname59(log_0.fullPath) : null);
|
|
541679
541710
|
await renameRecordingForSession();
|
|
541680
541711
|
await resetSessionFilePointer();
|
|
541681
541712
|
restoreCostStateForSession(result_3.sessionId);
|
|
@@ -544839,7 +544870,7 @@ var init_createDirectConnectSession = __esm(() => {
|
|
|
544839
544870
|
});
|
|
544840
544871
|
|
|
544841
544872
|
// src/utils/errorLogSink.ts
|
|
544842
|
-
import { dirname as
|
|
544873
|
+
import { dirname as dirname60, join as join153 } from "path";
|
|
544843
544874
|
function getErrorsPath() {
|
|
544844
544875
|
return join153(CACHE_PATHS.errors(), DATE + ".jsonl");
|
|
544845
544876
|
}
|
|
@@ -544860,7 +544891,7 @@ function createJsonlWriter(options2) {
|
|
|
544860
544891
|
function getLogWriter(path23) {
|
|
544861
544892
|
let writer = logWriters.get(path23);
|
|
544862
544893
|
if (!writer) {
|
|
544863
|
-
const dir =
|
|
544894
|
+
const dir = dirname60(path23);
|
|
544864
544895
|
writer = createJsonlWriter({
|
|
544865
544896
|
writeFn: (content) => {
|
|
544866
544897
|
try {
|
|
@@ -549253,14 +549284,14 @@ __export(exports_bridgePointer, {
|
|
|
549253
549284
|
BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
|
|
549254
549285
|
});
|
|
549255
549286
|
import { mkdir as mkdir44, readFile as readFile51, stat as stat49, unlink as unlink25, writeFile as writeFile47 } from "fs/promises";
|
|
549256
|
-
import { dirname as
|
|
549287
|
+
import { dirname as dirname61, join as join157 } from "path";
|
|
549257
549288
|
function getBridgePointerPath(dir) {
|
|
549258
549289
|
return join157(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
|
|
549259
549290
|
}
|
|
549260
549291
|
async function writeBridgePointer(dir, pointer) {
|
|
549261
549292
|
const path23 = getBridgePointerPath(dir);
|
|
549262
549293
|
try {
|
|
549263
|
-
await mkdir44(
|
|
549294
|
+
await mkdir44(dirname61(path23), { recursive: true });
|
|
549264
549295
|
await writeFile47(path23, jsonStringify(pointer), "utf8");
|
|
549265
549296
|
logForDebugging2(`[bridge:pointer] wrote ${path23}`);
|
|
549266
549297
|
} catch (err3) {
|
|
@@ -551264,7 +551295,7 @@ __export(exports_print, {
|
|
|
551264
551295
|
canBatchWith: () => canBatchWith
|
|
551265
551296
|
});
|
|
551266
551297
|
import { readFile as readFile52, stat as stat50 } from "fs/promises";
|
|
551267
|
-
import { dirname as
|
|
551298
|
+
import { dirname as dirname62 } from "path";
|
|
551268
551299
|
import { cwd as cwd2 } from "process";
|
|
551269
551300
|
import { randomUUID as randomUUID53 } from "crypto";
|
|
551270
551301
|
function trackReceivedMessageUuid(uuid3) {
|
|
@@ -553699,7 +553730,7 @@ async function loadInitialMessages(setAppState, options2) {
|
|
|
553699
553730
|
if (false) {}
|
|
553700
553731
|
if (!options2.forkSession) {
|
|
553701
553732
|
if (result.sessionId) {
|
|
553702
|
-
switchSession(asSessionId(result.sessionId), result.fullPath ?
|
|
553733
|
+
switchSession(asSessionId(result.sessionId), result.fullPath ? dirname62(result.fullPath) : null);
|
|
553703
553734
|
if (persistSession) {
|
|
553704
553735
|
await resetSessionFilePointer();
|
|
553705
553736
|
}
|
|
@@ -553797,7 +553828,7 @@ async function loadInitialMessages(setAppState, options2) {
|
|
|
553797
553828
|
}
|
|
553798
553829
|
if (false) {}
|
|
553799
553830
|
if (!options2.forkSession && result.sessionId) {
|
|
553800
|
-
switchSession(asSessionId(result.sessionId), result.fullPath ?
|
|
553831
|
+
switchSession(asSessionId(result.sessionId), result.fullPath ? dirname62(result.fullPath) : null);
|
|
553801
553832
|
if (persistSession) {
|
|
553802
553833
|
await resetSessionFilePointer();
|
|
553803
553834
|
}
|
|
@@ -555617,7 +555648,7 @@ __export(exports_plugins, {
|
|
|
555617
555648
|
VALID_UPDATE_SCOPES: () => VALID_UPDATE_SCOPES,
|
|
555618
555649
|
VALID_INSTALLABLE_SCOPES: () => VALID_INSTALLABLE_SCOPES
|
|
555619
555650
|
});
|
|
555620
|
-
import { basename as basename57, dirname as
|
|
555651
|
+
import { basename as basename57, dirname as dirname63 } from "path";
|
|
555621
555652
|
function handleMarketplaceError(error42, action2) {
|
|
555622
555653
|
logError2(error42);
|
|
555623
555654
|
cliError(`${figures_default.cross} Failed to ${action2}: ${errorMessage(error42)}`);
|
|
@@ -555650,9 +555681,9 @@ async function pluginValidateHandler(manifestPath, options2) {
|
|
|
555650
555681
|
printValidationResult(result);
|
|
555651
555682
|
let contentResults = [];
|
|
555652
555683
|
if (result.fileType === "plugin") {
|
|
555653
|
-
const manifestDir =
|
|
555684
|
+
const manifestDir = dirname63(result.filePath);
|
|
555654
555685
|
if (basename57(manifestDir) === ".claude-plugin") {
|
|
555655
|
-
contentResults = await validatePluginContents(
|
|
555686
|
+
contentResults = await validatePluginContents(dirname63(manifestDir));
|
|
555656
555687
|
for (const r of contentResults) {
|
|
555657
555688
|
console.log(`Validating ${r.fileType}: ${r.filePath}
|
|
555658
555689
|
`);
|
|
@@ -558986,7 +559017,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
558986
559017
|
pendingHookMessages
|
|
558987
559018
|
}, renderAndRun);
|
|
558988
559019
|
}
|
|
558989
|
-
}).version("0.9.
|
|
559020
|
+
}).version("0.9.2 (Snowcode)", "-v, --version", "Output the version number");
|
|
558990
559021
|
program.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
558991
559022
|
program.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
558992
559023
|
if (canUserConfigureAdvisor()) {
|
|
@@ -559547,12 +559578,12 @@ function validateProviderEnvOrExit() {
|
|
|
559547
559578
|
async function main2() {
|
|
559548
559579
|
const args = process.argv.slice(2);
|
|
559549
559580
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
559550
|
-
console.log(`${"0.9.
|
|
559581
|
+
console.log(`${"0.9.2"} (Snowcode)`);
|
|
559551
559582
|
return;
|
|
559552
559583
|
}
|
|
559553
559584
|
validateProviderEnvOrExit();
|
|
559554
559585
|
const { printStartupScreen: printStartupScreen2 } = await Promise.resolve().then(() => (init_StartupScreen(), exports_StartupScreen));
|
|
559555
|
-
printStartupScreen2();
|
|
559586
|
+
await printStartupScreen2();
|
|
559556
559587
|
const {
|
|
559557
559588
|
profileCheckpoint: profileCheckpoint2
|
|
559558
559589
|
} = await Promise.resolve().then(() => (init_startupProfiler(), exports_startupProfiler));
|
|
@@ -559636,4 +559667,4 @@ async function main2() {
|
|
|
559636
559667
|
}
|
|
559637
559668
|
main2();
|
|
559638
559669
|
|
|
559639
|
-
//# debugId=
|
|
559670
|
+
//# debugId=9BF983086649C86964756E2164756E21
|