snowcode 0.9.0 → 0.9.1
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 +366 -190
- package/package.json +3 -2
package/dist/cli.mjs
CHANGED
|
@@ -109691,7 +109691,7 @@ class OpenAIShimMessages {
|
|
|
109691
109691
|
});
|
|
109692
109692
|
}
|
|
109693
109693
|
if (request.transport === "codex_responses") {
|
|
109694
|
-
const credentials =
|
|
109694
|
+
const credentials = await resolveCodexApiCredentialsForRequest();
|
|
109695
109695
|
if (!credentials.apiKey) {
|
|
109696
109696
|
const authHint = credentials.authPath ? ` or place a Codex auth.json at ${credentials.authPath}` : "";
|
|
109697
109697
|
throw new Error(`Codex auth is required for ${request.requestedModel}. Set CODEX_API_KEY${authHint}.`);
|
|
@@ -125645,7 +125645,7 @@ var init_metadata = __esm(() => {
|
|
|
125645
125645
|
isClaudeAiAuth: isClaudeAISubscriber(),
|
|
125646
125646
|
version: "99.0.0",
|
|
125647
125647
|
versionBase: getVersionBase(),
|
|
125648
|
-
buildTime: "2026-04-
|
|
125648
|
+
buildTime: "2026-04-05T03:08:12.888Z",
|
|
125649
125649
|
deploymentEnvironment: env2.detectDeploymentEnvironment(),
|
|
125650
125650
|
...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
|
|
125651
125651
|
githubEventName: process.env.GITHUB_EVENT_NAME,
|
|
@@ -129985,9 +129985,9 @@ var init_antigravityOAuth = __esm(() => {
|
|
|
129985
129985
|
});
|
|
129986
129986
|
|
|
129987
129987
|
// src/services/api/providerConfig.ts
|
|
129988
|
-
import { existsSync as existsSync7, readFileSync as readFileSync9 } from "node:fs";
|
|
129988
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync5, readFileSync as readFileSync9, writeFileSync as writeFileSync4 } from "node:fs";
|
|
129989
129989
|
import { homedir as homedir11 } from "node:os";
|
|
129990
|
-
import { join as join29 } from "node:path";
|
|
129990
|
+
import { dirname as dirname12, join as join29 } from "node:path";
|
|
129991
129991
|
function asTrimmedString(value) {
|
|
129992
129992
|
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
129993
129993
|
}
|
|
@@ -130366,6 +130366,104 @@ function loadCodexAuthJson(authPath) {
|
|
|
130366
130366
|
return;
|
|
130367
130367
|
}
|
|
130368
130368
|
}
|
|
130369
|
+
function readCodexAccountId(authJson, envAccountId, apiKey) {
|
|
130370
|
+
return envAccountId ?? (authJson ? readNestedString(authJson, [
|
|
130371
|
+
["account_id"],
|
|
130372
|
+
["accountId"],
|
|
130373
|
+
["tokens", "account_id"],
|
|
130374
|
+
["tokens", "accountId"],
|
|
130375
|
+
["auth", "account_id"],
|
|
130376
|
+
["auth", "accountId"]
|
|
130377
|
+
]) : undefined) ?? parseChatgptAccountId(apiKey);
|
|
130378
|
+
}
|
|
130379
|
+
function readCodexRefreshToken(authJson) {
|
|
130380
|
+
if (!authJson)
|
|
130381
|
+
return;
|
|
130382
|
+
return readNestedString(authJson, [
|
|
130383
|
+
["refresh_token"],
|
|
130384
|
+
["refreshToken"],
|
|
130385
|
+
["tokens", "refresh_token"],
|
|
130386
|
+
["tokens", "refreshToken"],
|
|
130387
|
+
["auth", "refresh_token"],
|
|
130388
|
+
["auth", "refreshToken"],
|
|
130389
|
+
["token", "refresh_token"],
|
|
130390
|
+
["token", "refreshToken"]
|
|
130391
|
+
]);
|
|
130392
|
+
}
|
|
130393
|
+
function getPreferredCodexOauthAccount(accounts) {
|
|
130394
|
+
return [...accounts].filter((account) => account.enabled && account.type === "codex_oauth" && Boolean(asTrimmedString(account.refreshToken))).sort((left, right) => {
|
|
130395
|
+
const leftAddedAt = Date.parse(left.addedAt || "");
|
|
130396
|
+
const rightAddedAt = Date.parse(right.addedAt || "");
|
|
130397
|
+
return rightAddedAt - leftAddedAt;
|
|
130398
|
+
})[0];
|
|
130399
|
+
}
|
|
130400
|
+
function getJwtExpiryTimeMs(token) {
|
|
130401
|
+
if (!token)
|
|
130402
|
+
return;
|
|
130403
|
+
const payload = decodeJwtPayload(token);
|
|
130404
|
+
const exp = payload?.exp;
|
|
130405
|
+
return typeof exp === "number" && Number.isFinite(exp) ? exp * 1000 : undefined;
|
|
130406
|
+
}
|
|
130407
|
+
function isExpiredOrNearExpiry(token) {
|
|
130408
|
+
if (!token)
|
|
130409
|
+
return true;
|
|
130410
|
+
const expiryMs = getJwtExpiryTimeMs(token);
|
|
130411
|
+
if (!expiryMs)
|
|
130412
|
+
return false;
|
|
130413
|
+
return expiryMs <= Date.now() + 60000;
|
|
130414
|
+
}
|
|
130415
|
+
async function refreshCodexAccessToken(refreshToken) {
|
|
130416
|
+
try {
|
|
130417
|
+
const response = await fetch(CODEX_TOKEN_URL, {
|
|
130418
|
+
method: "POST",
|
|
130419
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
130420
|
+
body: new URLSearchParams({
|
|
130421
|
+
client_id: CODEX_CLIENT_ID,
|
|
130422
|
+
refresh_token: refreshToken,
|
|
130423
|
+
grant_type: "refresh_token"
|
|
130424
|
+
}).toString()
|
|
130425
|
+
});
|
|
130426
|
+
if (!response.ok)
|
|
130427
|
+
return;
|
|
130428
|
+
const json2 = await response.json();
|
|
130429
|
+
const accessToken = asTrimmedString(json2.access_token);
|
|
130430
|
+
if (!accessToken)
|
|
130431
|
+
return;
|
|
130432
|
+
return {
|
|
130433
|
+
accessToken,
|
|
130434
|
+
refreshToken: asTrimmedString(json2.refresh_token)
|
|
130435
|
+
};
|
|
130436
|
+
} catch {
|
|
130437
|
+
return;
|
|
130438
|
+
}
|
|
130439
|
+
}
|
|
130440
|
+
function persistCodexAuthJson(options) {
|
|
130441
|
+
const next = options.existing ? JSON.parse(JSON.stringify(options.existing)) : {};
|
|
130442
|
+
next.access_token = options.accessToken;
|
|
130443
|
+
if (options.accountId) {
|
|
130444
|
+
next.account_id = options.accountId;
|
|
130445
|
+
}
|
|
130446
|
+
if (options.refreshToken) {
|
|
130447
|
+
next.refresh_token = options.refreshToken;
|
|
130448
|
+
}
|
|
130449
|
+
const buckets = ["tokens", "auth", "token"];
|
|
130450
|
+
for (const bucket of buckets) {
|
|
130451
|
+
const rawBucket = next[bucket];
|
|
130452
|
+
const target = rawBucket && typeof rawBucket === "object" ? rawBucket : bucket === "tokens" ? {} : undefined;
|
|
130453
|
+
if (!target)
|
|
130454
|
+
continue;
|
|
130455
|
+
target.access_token = options.accessToken;
|
|
130456
|
+
if (options.accountId) {
|
|
130457
|
+
target.account_id = options.accountId;
|
|
130458
|
+
}
|
|
130459
|
+
if (options.refreshToken) {
|
|
130460
|
+
target.refresh_token = options.refreshToken;
|
|
130461
|
+
}
|
|
130462
|
+
next[bucket] = target;
|
|
130463
|
+
}
|
|
130464
|
+
mkdirSync5(dirname12(options.authPath), { recursive: true });
|
|
130465
|
+
writeFileSync4(options.authPath, JSON.stringify(next, null, 2), "utf8");
|
|
130466
|
+
}
|
|
130369
130467
|
function resolveCodexApiCredentials(env4 = process.env) {
|
|
130370
130468
|
const envApiKey = asTrimmedString(env4.CODEX_API_KEY);
|
|
130371
130469
|
const envAccountId = asTrimmedString(env4.CODEX_ACCOUNT_ID) ?? asTrimmedString(env4.CHATGPT_ACCOUNT_ID);
|
|
@@ -130397,19 +130495,14 @@ function resolveCodexApiCredentials(env4 = process.env) {
|
|
|
130397
130495
|
["tokens", "id_token"],
|
|
130398
130496
|
["tokens", "idToken"]
|
|
130399
130497
|
]);
|
|
130400
|
-
const accountId =
|
|
130401
|
-
|
|
130402
|
-
["accountId"],
|
|
130403
|
-
["tokens", "account_id"],
|
|
130404
|
-
["tokens", "accountId"],
|
|
130405
|
-
["auth", "account_id"],
|
|
130406
|
-
["auth", "accountId"]
|
|
130407
|
-
]) ?? parseChatgptAccountId(apiKey);
|
|
130498
|
+
const accountId = readCodexAccountId(authJson, envAccountId, apiKey);
|
|
130499
|
+
const refreshToken = readCodexRefreshToken(authJson);
|
|
130408
130500
|
if (!apiKey) {
|
|
130409
130501
|
return {
|
|
130410
130502
|
apiKey: "",
|
|
130411
130503
|
accountId,
|
|
130412
130504
|
authPath,
|
|
130505
|
+
refreshToken,
|
|
130413
130506
|
source: "none"
|
|
130414
130507
|
};
|
|
130415
130508
|
}
|
|
@@ -130417,10 +130510,93 @@ function resolveCodexApiCredentials(env4 = process.env) {
|
|
|
130417
130510
|
apiKey,
|
|
130418
130511
|
accountId,
|
|
130419
130512
|
authPath,
|
|
130513
|
+
refreshToken,
|
|
130420
130514
|
source: "auth.json"
|
|
130421
130515
|
};
|
|
130422
130516
|
}
|
|
130423
|
-
|
|
130517
|
+
async function resolveCodexApiCredentialsForRequest(env4 = process.env) {
|
|
130518
|
+
const envApiKey = asTrimmedString(env4.CODEX_API_KEY);
|
|
130519
|
+
const envAccountId = asTrimmedString(env4.CODEX_ACCOUNT_ID) ?? asTrimmedString(env4.CHATGPT_ACCOUNT_ID);
|
|
130520
|
+
if (envApiKey) {
|
|
130521
|
+
return {
|
|
130522
|
+
apiKey: envApiKey,
|
|
130523
|
+
accountId: envAccountId ?? parseChatgptAccountId(envApiKey),
|
|
130524
|
+
source: "env"
|
|
130525
|
+
};
|
|
130526
|
+
}
|
|
130527
|
+
const authPath = resolveCodexAuthPath(env4);
|
|
130528
|
+
const authJson = loadCodexAuthJson(authPath);
|
|
130529
|
+
const authJsonApiKey = authJson ? readNestedString(authJson, [
|
|
130530
|
+
["access_token"],
|
|
130531
|
+
["accessToken"],
|
|
130532
|
+
["tokens", "access_token"],
|
|
130533
|
+
["tokens", "accessToken"],
|
|
130534
|
+
["auth", "access_token"],
|
|
130535
|
+
["auth", "accessToken"],
|
|
130536
|
+
["token", "access_token"],
|
|
130537
|
+
["token", "accessToken"],
|
|
130538
|
+
["tokens", "id_token"],
|
|
130539
|
+
["tokens", "idToken"]
|
|
130540
|
+
]) : undefined;
|
|
130541
|
+
const authJsonRefreshToken = readCodexRefreshToken(authJson);
|
|
130542
|
+
const authJsonAccountId = readCodexAccountId(authJson, envAccountId, authJsonApiKey);
|
|
130543
|
+
if (authJsonApiKey && authJsonAccountId && !isExpiredOrNearExpiry(authJsonApiKey)) {
|
|
130544
|
+
return {
|
|
130545
|
+
apiKey: authJsonApiKey,
|
|
130546
|
+
accountId: authJsonAccountId,
|
|
130547
|
+
authPath,
|
|
130548
|
+
refreshToken: authJsonRefreshToken,
|
|
130549
|
+
source: "auth.json"
|
|
130550
|
+
};
|
|
130551
|
+
}
|
|
130552
|
+
const preferredAccount = getPreferredCodexOauthAccount(loadAccounts().accounts);
|
|
130553
|
+
const refreshToken = authJsonRefreshToken ?? asTrimmedString(preferredAccount?.refreshToken);
|
|
130554
|
+
if (refreshToken) {
|
|
130555
|
+
const refreshed2 = await refreshCodexAccessToken(refreshToken);
|
|
130556
|
+
if (refreshed2?.accessToken) {
|
|
130557
|
+
const refreshedAccountId = envAccountId ?? parseChatgptAccountId(refreshed2.accessToken) ?? authJsonAccountId;
|
|
130558
|
+
const rotatedRefreshToken = refreshed2.refreshToken ?? refreshToken;
|
|
130559
|
+
persistCodexAuthJson({
|
|
130560
|
+
authPath,
|
|
130561
|
+
existing: authJson,
|
|
130562
|
+
accessToken: refreshed2.accessToken,
|
|
130563
|
+
accountId: refreshedAccountId,
|
|
130564
|
+
refreshToken: rotatedRefreshToken
|
|
130565
|
+
});
|
|
130566
|
+
if (preferredAccount?.id && rotatedRefreshToken !== preferredAccount.refreshToken) {
|
|
130567
|
+
updateAccount(preferredAccount.id, {
|
|
130568
|
+
refreshToken: rotatedRefreshToken
|
|
130569
|
+
});
|
|
130570
|
+
}
|
|
130571
|
+
return {
|
|
130572
|
+
apiKey: refreshed2.accessToken,
|
|
130573
|
+
accountId: refreshedAccountId,
|
|
130574
|
+
authPath,
|
|
130575
|
+
refreshToken: rotatedRefreshToken,
|
|
130576
|
+
accountRecordId: preferredAccount?.id,
|
|
130577
|
+
source: authJsonRefreshToken ? "auth.json" : "accounts"
|
|
130578
|
+
};
|
|
130579
|
+
}
|
|
130580
|
+
}
|
|
130581
|
+
if (authJsonApiKey) {
|
|
130582
|
+
return {
|
|
130583
|
+
apiKey: authJsonApiKey,
|
|
130584
|
+
accountId: authJsonAccountId,
|
|
130585
|
+
authPath,
|
|
130586
|
+
refreshToken: authJsonRefreshToken,
|
|
130587
|
+
source: "auth.json"
|
|
130588
|
+
};
|
|
130589
|
+
}
|
|
130590
|
+
return {
|
|
130591
|
+
apiKey: "",
|
|
130592
|
+
accountId: authJsonAccountId ?? envAccountId,
|
|
130593
|
+
authPath,
|
|
130594
|
+
refreshToken,
|
|
130595
|
+
accountRecordId: preferredAccount?.id,
|
|
130596
|
+
source: "none"
|
|
130597
|
+
};
|
|
130598
|
+
}
|
|
130599
|
+
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
130600
|
var init_providerConfig = __esm(() => {
|
|
130425
130601
|
init_accountManager();
|
|
130426
130602
|
init_antigravityOAuth();
|
|
@@ -130460,10 +130636,10 @@ var init_providerConfig = __esm(() => {
|
|
|
130460
130636
|
});
|
|
130461
130637
|
|
|
130462
130638
|
// src/utils/updateCheck.ts
|
|
130463
|
-
import { existsSync as existsSync8, mkdirSync as
|
|
130639
|
+
import { existsSync as existsSync8, mkdirSync as mkdirSync6, readFileSync as readFileSync10, writeFileSync as writeFileSync5 } from "node:fs";
|
|
130464
130640
|
import { join as join30 } from "node:path";
|
|
130465
130641
|
function getCurrentVersion() {
|
|
130466
|
-
return "0.9.
|
|
130642
|
+
return "0.9.1".replace(/[^0-9.]/g, "") || "0.0.0";
|
|
130467
130643
|
}
|
|
130468
130644
|
function cachePath() {
|
|
130469
130645
|
return join30(getClaudeConfigHomeDir(), "update-check.json");
|
|
@@ -130482,8 +130658,8 @@ function writeUpdateCache(cache2) {
|
|
|
130482
130658
|
try {
|
|
130483
130659
|
const dir = getClaudeConfigHomeDir();
|
|
130484
130660
|
if (!existsSync8(dir))
|
|
130485
|
-
|
|
130486
|
-
|
|
130661
|
+
mkdirSync6(dir, { recursive: true });
|
|
130662
|
+
writeFileSync5(cachePath(), JSON.stringify(cache2));
|
|
130487
130663
|
} catch {}
|
|
130488
130664
|
}
|
|
130489
130665
|
function getAvailableUpdate(cache2) {
|
|
@@ -130660,7 +130836,7 @@ function printStartupScreen() {
|
|
|
130660
130836
|
const sLen = ` ● ${sL} Ready — type /help to begin`.length;
|
|
130661
130837
|
out.push(boxRow(sRow, W2, sLen));
|
|
130662
130838
|
out.push(`${rgb(...BORDER)}╚${"═".repeat(W2 - 2)}╝${RESET}`);
|
|
130663
|
-
const _ver = "0.9.
|
|
130839
|
+
const _ver = "0.9.1";
|
|
130664
130840
|
checkForUpdateInBackground();
|
|
130665
130841
|
const _update = getAvailableUpdate(readUpdateCache());
|
|
130666
130842
|
out.push(` ${DIM}${rgb(...DIMCOL)}snowcode v${_ver}${RESET}`);
|
|
@@ -162367,7 +162543,7 @@ var init_MessageResponse = __esm(() => {
|
|
|
162367
162543
|
|
|
162368
162544
|
// src/commands/add-dir/validation.ts
|
|
162369
162545
|
import { stat as stat8 } from "fs/promises";
|
|
162370
|
-
import { dirname as
|
|
162546
|
+
import { dirname as dirname13, resolve as resolve9 } from "path";
|
|
162371
162547
|
async function validateDirectoryForWorkspace(directoryPath, permissionContext) {
|
|
162372
162548
|
if (!directoryPath) {
|
|
162373
162549
|
return {
|
|
@@ -162417,7 +162593,7 @@ function addDirHelpMessage(result) {
|
|
|
162417
162593
|
case "pathNotFound":
|
|
162418
162594
|
return `Path ${source_default.bold(result.absolutePath)} was not found.`;
|
|
162419
162595
|
case "notADirectory": {
|
|
162420
|
-
const parentDir =
|
|
162596
|
+
const parentDir = dirname13(result.absolutePath);
|
|
162421
162597
|
return `${source_default.bold(result.directoryPath)} is not a directory. Did you mean to add the parent directory ${source_default.bold(parentDir)}?`;
|
|
162422
162598
|
}
|
|
162423
162599
|
case "alreadyInWorkingDirectory":
|
|
@@ -162852,9 +163028,9 @@ class NodeFsHandler {
|
|
|
162852
163028
|
if (this.fsw.closed) {
|
|
162853
163029
|
return;
|
|
162854
163030
|
}
|
|
162855
|
-
const
|
|
163031
|
+
const dirname15 = sysPath.dirname(file2);
|
|
162856
163032
|
const basename6 = sysPath.basename(file2);
|
|
162857
|
-
const parent = this.fsw._getWatchedDir(
|
|
163033
|
+
const parent = this.fsw._getWatchedDir(dirname15);
|
|
162858
163034
|
let prevStats = stats;
|
|
162859
163035
|
if (parent.has(basename6))
|
|
162860
163036
|
return;
|
|
@@ -162881,7 +163057,7 @@ class NodeFsHandler {
|
|
|
162881
163057
|
prevStats = newStats2;
|
|
162882
163058
|
}
|
|
162883
163059
|
} catch (error42) {
|
|
162884
|
-
this.fsw._remove(
|
|
163060
|
+
this.fsw._remove(dirname15, basename6);
|
|
162885
163061
|
}
|
|
162886
163062
|
} else if (parent.has(basename6)) {
|
|
162887
163063
|
const at = newStats.atimeMs;
|
|
@@ -172100,7 +172276,7 @@ var init_pluginOnlyPolicy = __esm(() => {
|
|
|
172100
172276
|
import { statSync as statSync4 } from "fs";
|
|
172101
172277
|
import { lstat as lstat3, readdir as readdir7, readFile as readFile7, realpath as realpath5, stat as stat13 } from "fs/promises";
|
|
172102
172278
|
import { homedir as homedir13 } from "os";
|
|
172103
|
-
import { dirname as
|
|
172279
|
+
import { dirname as dirname17, join as join34, resolve as resolve13, sep as sep6 } from "path";
|
|
172104
172280
|
function extractDescriptionFromMarkdown(content, defaultDescription = "Custom item") {
|
|
172105
172281
|
const lines = content.split(`
|
|
172106
172282
|
`);
|
|
@@ -172201,7 +172377,7 @@ function getProjectDirsUpToHome(subdir, cwd2) {
|
|
|
172201
172377
|
if (gitRoot && normalizePathForComparison(current) === normalizePathForComparison(gitRoot)) {
|
|
172202
172378
|
break;
|
|
172203
172379
|
}
|
|
172204
|
-
const parent =
|
|
172380
|
+
const parent = dirname17(current);
|
|
172205
172381
|
if (parent === current) {
|
|
172206
172382
|
break;
|
|
172207
172383
|
}
|
|
@@ -174744,7 +174920,7 @@ var init_readOnlyCommandValidation = __esm(() => {
|
|
|
174744
174920
|
|
|
174745
174921
|
// src/utils/permissions/pathValidation.ts
|
|
174746
174922
|
import { homedir as homedir14 } from "os";
|
|
174747
|
-
import { dirname as
|
|
174923
|
+
import { dirname as dirname18, isAbsolute as isAbsolute6, resolve as resolve15 } from "path";
|
|
174748
174924
|
function formatDirectoryList(directories) {
|
|
174749
174925
|
const dirCount = directories.length;
|
|
174750
174926
|
if (dirCount <= MAX_DIRS_TO_LIST) {
|
|
@@ -174887,7 +175063,7 @@ function isDangerousRemovalPath(resolvedPath) {
|
|
|
174887
175063
|
if (normalizedPath === normalizedHome) {
|
|
174888
175064
|
return true;
|
|
174889
175065
|
}
|
|
174890
|
-
const parentDir =
|
|
175066
|
+
const parentDir = dirname18(normalizedPath);
|
|
174891
175067
|
if (parentDir === "/") {
|
|
174892
175068
|
return true;
|
|
174893
175069
|
}
|
|
@@ -174966,7 +175142,7 @@ var init_pathValidation = __esm(() => {
|
|
|
174966
175142
|
});
|
|
174967
175143
|
|
|
174968
175144
|
// src/utils/plugins/pluginDirectories.ts
|
|
174969
|
-
import { mkdirSync as
|
|
175145
|
+
import { mkdirSync as mkdirSync7 } from "fs";
|
|
174970
175146
|
import { readdir as readdir8, rm, stat as stat14 } from "fs/promises";
|
|
174971
175147
|
import { delimiter, join as join37 } from "path";
|
|
174972
175148
|
function getPluginsDirectoryName() {
|
|
@@ -174999,7 +175175,7 @@ function pluginDataDirPath(pluginId) {
|
|
|
174999
175175
|
}
|
|
175000
175176
|
function getPluginDataDir(pluginId) {
|
|
175001
175177
|
const dir = pluginDataDirPath(pluginId);
|
|
175002
|
-
|
|
175178
|
+
mkdirSync7(dir, { recursive: true });
|
|
175003
175179
|
return dir;
|
|
175004
175180
|
}
|
|
175005
175181
|
async function getPluginDataDirSize(pluginId) {
|
|
@@ -177878,7 +178054,7 @@ var init_systemDirectories = __esm(() => {
|
|
|
177878
178054
|
// src/utils/plugins/mcpbHandler.ts
|
|
177879
178055
|
import { createHash as createHash4 } from "crypto";
|
|
177880
178056
|
import { chmod, writeFile as writeFile4 } from "fs/promises";
|
|
177881
|
-
import { dirname as
|
|
178057
|
+
import { dirname as dirname19, join as join39 } from "path";
|
|
177882
178058
|
function isMcpbSource(source) {
|
|
177883
178059
|
return source.endsWith(".mcpb") || source.endsWith(".dxt");
|
|
177884
178060
|
}
|
|
@@ -178114,7 +178290,7 @@ async function extractMcpbContents(unzipped, extractPath, modes, onProgress) {
|
|
|
178114
178290
|
const totalFiles = entries.length;
|
|
178115
178291
|
for (const [filePath, fileData] of entries) {
|
|
178116
178292
|
const fullPath = join39(extractPath, filePath);
|
|
178117
|
-
const dir =
|
|
178293
|
+
const dir = dirname19(fullPath);
|
|
178118
178294
|
if (dir !== extractPath) {
|
|
178119
178295
|
await getFsImplementation().mkdir(dir);
|
|
178120
178296
|
}
|
|
@@ -185055,7 +185231,7 @@ var init_fileStateCache = __esm(() => {
|
|
|
185055
185231
|
// src/utils/claudemd.ts
|
|
185056
185232
|
import {
|
|
185057
185233
|
basename as basename9,
|
|
185058
|
-
dirname as
|
|
185234
|
+
dirname as dirname20,
|
|
185059
185235
|
extname as extname4,
|
|
185060
185236
|
isAbsolute as isAbsolute8,
|
|
185061
185237
|
join as join42,
|
|
@@ -185168,7 +185344,7 @@ function extractIncludePathsFromTokens(tokens, basePath) {
|
|
|
185168
185344
|
if (path12) {
|
|
185169
185345
|
const isValidPath = path12.startsWith("./") || path12.startsWith("~/") || path12.startsWith("/") && path12 !== "/" || !path12.startsWith("@") && !path12.match(/^[#%^&*()]+/) && path12.match(/^[a-zA-Z0-9._-]/);
|
|
185170
185346
|
if (isValidPath) {
|
|
185171
|
-
const resolvedPath = expandPath(path12,
|
|
185347
|
+
const resolvedPath = expandPath(path12, dirname20(basePath));
|
|
185172
185348
|
absolutePaths.add(resolvedPath);
|
|
185173
185349
|
}
|
|
185174
185350
|
}
|
|
@@ -185230,7 +185406,7 @@ function resolveExcludePatterns(patterns) {
|
|
|
185230
185406
|
}
|
|
185231
185407
|
const globStart = normalized.search(/[*?{[]/);
|
|
185232
185408
|
const staticPrefix = globStart === -1 ? normalized : normalized.slice(0, globStart);
|
|
185233
|
-
const dirToResolve =
|
|
185409
|
+
const dirToResolve = dirname20(staticPrefix);
|
|
185234
185410
|
try {
|
|
185235
185411
|
const resolvedDir = fs2.realpathSync(dirToResolve).replaceAll("\\", "/");
|
|
185236
185412
|
if (resolvedDir !== dirToResolve) {
|
|
@@ -185414,7 +185590,7 @@ async function processConditionedMdRules(targetPath, rulesDir, type, processedPa
|
|
|
185414
185590
|
if (!file2.globs || file2.globs.length === 0) {
|
|
185415
185591
|
return false;
|
|
185416
185592
|
}
|
|
185417
|
-
const baseDir = type === "Project" ?
|
|
185593
|
+
const baseDir = type === "Project" ? dirname20(dirname20(rulesDir)) : getOriginalCwd();
|
|
185418
185594
|
const relativePath = isAbsolute8(targetPath) ? relative5(baseDir, targetPath) : targetPath;
|
|
185419
185595
|
if (!relativePath || relativePath.startsWith("..") || isAbsolute8(relativePath)) {
|
|
185420
185596
|
return false;
|
|
@@ -185636,7 +185812,7 @@ var init_claudemd = __esm(() => {
|
|
|
185636
185812
|
let currentDir = originalCwd;
|
|
185637
185813
|
while (currentDir !== parse7(currentDir).root) {
|
|
185638
185814
|
dirs.push(currentDir);
|
|
185639
|
-
currentDir =
|
|
185815
|
+
currentDir = dirname20(currentDir);
|
|
185640
185816
|
}
|
|
185641
185817
|
const gitRoot = findGitRoot(originalCwd);
|
|
185642
185818
|
const canonicalRoot = findCanonicalGitRoot(originalCwd);
|
|
@@ -188500,7 +188676,7 @@ var init_postSamplingHooks = __esm(() => {
|
|
|
188500
188676
|
// src/services/api/dumpPrompts.ts
|
|
188501
188677
|
import { createHash as createHash5 } from "crypto";
|
|
188502
188678
|
import { promises as fs2 } from "fs";
|
|
188503
|
-
import { dirname as
|
|
188679
|
+
import { dirname as dirname21, join as join43 } from "path";
|
|
188504
188680
|
function hashString3(str) {
|
|
188505
188681
|
return createHash5("sha256").update(str).digest("hex");
|
|
188506
188682
|
}
|
|
@@ -188527,7 +188703,7 @@ function getDumpPromptsPath(agentIdOrSessionId) {
|
|
|
188527
188703
|
function appendToFile(filePath, entries) {
|
|
188528
188704
|
if (entries.length === 0)
|
|
188529
188705
|
return;
|
|
188530
|
-
fs2.mkdir(
|
|
188706
|
+
fs2.mkdir(dirname21(filePath), { recursive: true }).then(() => fs2.appendFile(filePath, entries.join(`
|
|
188531
188707
|
`) + `
|
|
188532
188708
|
`)).catch(() => {});
|
|
188533
188709
|
}
|
|
@@ -239325,7 +239501,7 @@ var init_queryHelpers = __esm(() => {
|
|
|
239325
239501
|
import { randomUUID as randomUUID6 } from "crypto";
|
|
239326
239502
|
import { rm as rm2 } from "fs";
|
|
239327
239503
|
import { appendFile as appendFile4, copyFile, mkdir as mkdir6 } from "fs/promises";
|
|
239328
|
-
import { dirname as
|
|
239504
|
+
import { dirname as dirname22, isAbsolute as isAbsolute11, join as join45, relative as relative7 } from "path";
|
|
239329
239505
|
function safeRemoveOverlay(overlayPath) {
|
|
239330
239506
|
rm2(overlayPath, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }, () => {});
|
|
239331
239507
|
}
|
|
@@ -239345,7 +239521,7 @@ async function copyOverlayToMain(overlayPath, writtenPaths, cwd2) {
|
|
|
239345
239521
|
const src = join45(overlayPath, rel);
|
|
239346
239522
|
const dest = join45(cwd2, rel);
|
|
239347
239523
|
try {
|
|
239348
|
-
await mkdir6(
|
|
239524
|
+
await mkdir6(dirname22(dest), { recursive: true });
|
|
239349
239525
|
await copyFile(src, dest);
|
|
239350
239526
|
} catch {
|
|
239351
239527
|
allCopied = false;
|
|
@@ -239594,7 +239770,7 @@ async function startSpeculation(suggestionText, context5, setAppState, isPipelin
|
|
|
239594
239770
|
if (isWriteTool) {
|
|
239595
239771
|
if (!writtenPathsRef.current.has(rel)) {
|
|
239596
239772
|
const overlayFile = join45(overlayPath, rel);
|
|
239597
|
-
await mkdir6(
|
|
239773
|
+
await mkdir6(dirname22(overlayFile), { recursive: true });
|
|
239598
239774
|
try {
|
|
239599
239775
|
await copyFile(join45(cwd2, rel), overlayFile);
|
|
239600
239776
|
} catch {}
|
|
@@ -255535,7 +255711,7 @@ var init_validate2 = __esm(() => {
|
|
|
255535
255711
|
// src/keybindings/loadUserBindings.ts
|
|
255536
255712
|
import { readFileSync as readFileSync11 } from "fs";
|
|
255537
255713
|
import { readFile as readFile9, stat as stat16 } from "fs/promises";
|
|
255538
|
-
import { dirname as
|
|
255714
|
+
import { dirname as dirname23, join as join47 } from "path";
|
|
255539
255715
|
function isKeybindingCustomizationEnabled() {
|
|
255540
255716
|
return getFeatureValue_CACHED_MAY_BE_STALE("tengu_keybinding_customization_release", false);
|
|
255541
255717
|
}
|
|
@@ -255714,7 +255890,7 @@ async function initializeKeybindingWatcher() {
|
|
|
255714
255890
|
return;
|
|
255715
255891
|
}
|
|
255716
255892
|
const userPath = getKeybindingsPath();
|
|
255717
|
-
const watchDir =
|
|
255893
|
+
const watchDir = dirname23(userPath);
|
|
255718
255894
|
try {
|
|
255719
255895
|
const stats = await stat16(watchDir);
|
|
255720
255896
|
if (!stats.isDirectory()) {
|
|
@@ -259986,7 +260162,7 @@ var init_claudeai = __esm(() => {
|
|
|
259986
260162
|
|
|
259987
260163
|
// src/services/mcp/config.ts
|
|
259988
260164
|
import { chmod as chmod2, open as open5, rename, stat as stat18, unlink as unlink3 } from "fs/promises";
|
|
259989
|
-
import { dirname as
|
|
260165
|
+
import { dirname as dirname24, join as join50, parse as parse9 } from "path";
|
|
259990
260166
|
function getEnterpriseMcpFilePath() {
|
|
259991
260167
|
return join50(getManagedFilePath(), "managed-mcp.json");
|
|
259992
260168
|
}
|
|
@@ -260488,7 +260664,7 @@ function getMcpConfigsByScope(scope) {
|
|
|
260488
260664
|
let currentDir = getCwd();
|
|
260489
260665
|
while (currentDir !== parse9(currentDir).root) {
|
|
260490
260666
|
dirs.push(currentDir);
|
|
260491
|
-
currentDir =
|
|
260667
|
+
currentDir = dirname24(currentDir);
|
|
260492
260668
|
}
|
|
260493
260669
|
for (const dir of dirs.reverse()) {
|
|
260494
260670
|
const mcpJsonPath = join50(dir, ".mcp.json");
|
|
@@ -270355,7 +270531,7 @@ function createLinkedTransportPair() {
|
|
|
270355
270531
|
|
|
270356
270532
|
// src/services/mcp/client.ts
|
|
270357
270533
|
import { mkdir as mkdir9, readFile as readFile10, unlink as unlink4, writeFile as writeFile7 } from "fs/promises";
|
|
270358
|
-
import { dirname as
|
|
270534
|
+
import { dirname as dirname25, join as join57 } from "path";
|
|
270359
270535
|
function isMcpSessionExpiredError(error42) {
|
|
270360
270536
|
const httpStatus = "code" in error42 ? error42.code : undefined;
|
|
270361
270537
|
if (httpStatus !== 404) {
|
|
@@ -270388,7 +270564,7 @@ function setMcpAuthCacheEntry(serverId) {
|
|
|
270388
270564
|
const cache3 = await getMcpAuthCache();
|
|
270389
270565
|
cache3[serverId] = { timestamp: Date.now() };
|
|
270390
270566
|
const cachePath2 = getMcpAuthCachePath();
|
|
270391
|
-
await mkdir9(
|
|
270567
|
+
await mkdir9(dirname25(cachePath2), { recursive: true });
|
|
270392
270568
|
await writeFile7(cachePath2, jsonStringify(cache3));
|
|
270393
270569
|
authCachePromise = null;
|
|
270394
270570
|
}).catch(() => {});
|
|
@@ -284323,7 +284499,7 @@ import {
|
|
|
284323
284499
|
writeFile as writeFile12
|
|
284324
284500
|
} from "fs/promises";
|
|
284325
284501
|
import { homedir as homedir22 } from "os";
|
|
284326
|
-
import { basename as basename14, delimiter as delimiter3, dirname as
|
|
284502
|
+
import { basename as basename14, delimiter as delimiter3, dirname as dirname26, join as join68, resolve as resolve19 } from "path";
|
|
284327
284503
|
function getPlatform2() {
|
|
284328
284504
|
const os4 = env2.platform;
|
|
284329
284505
|
const arch = process.arch === "x64" ? "x64" : process.arch === "arm64" ? "arm64" : null;
|
|
@@ -284366,7 +284542,7 @@ async function getVersionPaths(version2) {
|
|
|
284366
284542
|
const dirs = getBaseDirectories();
|
|
284367
284543
|
const dirsToCreate = [dirs.versions, dirs.staging, dirs.locks];
|
|
284368
284544
|
await Promise.all(dirsToCreate.map((dir) => mkdir11(dir, { recursive: true })));
|
|
284369
|
-
const executableParentDir =
|
|
284545
|
+
const executableParentDir = dirname26(dirs.executable);
|
|
284370
284546
|
await mkdir11(executableParentDir, { recursive: true });
|
|
284371
284547
|
const installPath = join68(dirs.versions, version2);
|
|
284372
284548
|
try {
|
|
@@ -284460,7 +284636,7 @@ async function tryWithVersionLock(versionFilePath, callback, retries = 0) {
|
|
|
284460
284636
|
}
|
|
284461
284637
|
}
|
|
284462
284638
|
async function atomicMoveToInstallPath(stagedBinaryPath, installPath) {
|
|
284463
|
-
await mkdir11(
|
|
284639
|
+
await mkdir11(dirname26(installPath), { recursive: true });
|
|
284464
284640
|
const tempInstallPath = `${installPath}.tmp.${process.pid}.${Date.now()}`;
|
|
284465
284641
|
try {
|
|
284466
284642
|
await copyFile2(stagedBinaryPath, tempInstallPath);
|
|
@@ -284674,7 +284850,7 @@ async function updateSymlink(symlinkPath, targetPath) {
|
|
|
284674
284850
|
const isWindows2 = platform4.startsWith("win32");
|
|
284675
284851
|
if (isWindows2) {
|
|
284676
284852
|
try {
|
|
284677
|
-
const parentDir2 =
|
|
284853
|
+
const parentDir2 = dirname26(symlinkPath);
|
|
284678
284854
|
await mkdir11(parentDir2, { recursive: true });
|
|
284679
284855
|
let existingStats;
|
|
284680
284856
|
try {
|
|
@@ -284720,7 +284896,7 @@ async function updateSymlink(symlinkPath, targetPath) {
|
|
|
284720
284896
|
return false;
|
|
284721
284897
|
}
|
|
284722
284898
|
}
|
|
284723
|
-
const parentDir =
|
|
284899
|
+
const parentDir = dirname26(symlinkPath);
|
|
284724
284900
|
try {
|
|
284725
284901
|
await mkdir11(parentDir, { recursive: true });
|
|
284726
284902
|
logForDebugging2(`Created directory ${parentDir} for symlink`);
|
|
@@ -284737,7 +284913,7 @@ async function updateSymlink(symlinkPath, targetPath) {
|
|
|
284737
284913
|
if (symlinkExists) {
|
|
284738
284914
|
try {
|
|
284739
284915
|
const currentTarget = await readlink(symlinkPath);
|
|
284740
|
-
const resolvedCurrentTarget = resolve19(
|
|
284916
|
+
const resolvedCurrentTarget = resolve19(dirname26(symlinkPath), currentTarget);
|
|
284741
284917
|
const resolvedTargetPath = resolve19(targetPath);
|
|
284742
284918
|
if (resolvedCurrentTarget === resolvedTargetPath) {
|
|
284743
284919
|
return false;
|
|
@@ -284777,7 +284953,7 @@ async function checkInstall(force = false) {
|
|
|
284777
284953
|
}
|
|
284778
284954
|
const dirs = getBaseDirectories();
|
|
284779
284955
|
const messages = [];
|
|
284780
|
-
const localBinDir =
|
|
284956
|
+
const localBinDir = dirname26(dirs.executable);
|
|
284781
284957
|
const resolvedLocalBinPath = resolve19(localBinDir);
|
|
284782
284958
|
const platform4 = getPlatform2();
|
|
284783
284959
|
const isWindows2 = platform4.startsWith("win32");
|
|
@@ -284801,7 +284977,7 @@ async function checkInstall(force = false) {
|
|
|
284801
284977
|
} else {
|
|
284802
284978
|
try {
|
|
284803
284979
|
const target = await readlink(dirs.executable);
|
|
284804
|
-
const absoluteTarget = resolve19(
|
|
284980
|
+
const absoluteTarget = resolve19(dirname26(dirs.executable), target);
|
|
284805
284981
|
if (!await isPossibleClaudeBinary(absoluteTarget)) {
|
|
284806
284982
|
messages.push({
|
|
284807
284983
|
message: `Claude symlink points to missing or invalid binary: ${target}`,
|
|
@@ -284908,7 +285084,7 @@ async function installLatestImpl(channelOrVersion, forceReinstall = false) {
|
|
|
284908
285084
|
async function getVersionFromSymlink(symlinkPath) {
|
|
284909
285085
|
try {
|
|
284910
285086
|
const target = await readlink(symlinkPath);
|
|
284911
|
-
const absoluteTarget = resolve19(
|
|
285087
|
+
const absoluteTarget = resolve19(dirname26(symlinkPath), target);
|
|
284912
285088
|
if (await isPossibleClaudeBinary(absoluteTarget)) {
|
|
284913
285089
|
return absoluteTarget;
|
|
284914
285090
|
}
|
|
@@ -285003,7 +285179,7 @@ async function cleanupOldVersions() {
|
|
|
285003
285179
|
const dirs = getBaseDirectories();
|
|
285004
285180
|
const oneHourAgo = Date.now() - 3600000;
|
|
285005
285181
|
if (getPlatform2().startsWith("win32")) {
|
|
285006
|
-
const executableDir =
|
|
285182
|
+
const executableDir = dirname26(dirs.executable);
|
|
285007
285183
|
try {
|
|
285008
285184
|
const files = await readdir9(executableDir);
|
|
285009
285185
|
let cleanedCount = 0;
|
|
@@ -292985,7 +293161,7 @@ __export(exports_teamHelpers, {
|
|
|
292985
293161
|
cleanupSessionTeams: () => cleanupSessionTeams,
|
|
292986
293162
|
addHiddenPaneId: () => addHiddenPaneId
|
|
292987
293163
|
});
|
|
292988
|
-
import { mkdirSync as
|
|
293164
|
+
import { mkdirSync as mkdirSync8, readFileSync as readFileSync12, writeFileSync as writeFileSync6 } from "fs";
|
|
292989
293165
|
import { mkdir as mkdir14, readFile as readFile16, rm as rm4, writeFile as writeFile15 } from "fs/promises";
|
|
292990
293166
|
import { join as join71 } from "path";
|
|
292991
293167
|
function sanitizeName(name) {
|
|
@@ -293024,8 +293200,8 @@ async function readTeamFileAsync(teamName) {
|
|
|
293024
293200
|
}
|
|
293025
293201
|
function writeTeamFile(teamName, teamFile) {
|
|
293026
293202
|
const teamDir = getTeamDir(teamName);
|
|
293027
|
-
|
|
293028
|
-
|
|
293203
|
+
mkdirSync8(teamDir, { recursive: true });
|
|
293204
|
+
writeFileSync6(getTeamFilePath(teamName), jsonStringify(teamFile, null, 2));
|
|
293029
293205
|
}
|
|
293030
293206
|
async function writeTeamFileAsync(teamName, teamFile) {
|
|
293031
293207
|
const teamDir = getTeamDir(teamName);
|
|
@@ -308221,7 +308397,7 @@ import {
|
|
|
308221
308397
|
stat as stat21,
|
|
308222
308398
|
unlink as unlink9
|
|
308223
308399
|
} from "fs/promises";
|
|
308224
|
-
import { dirname as
|
|
308400
|
+
import { dirname as dirname27, isAbsolute as isAbsolute13, join as join72, relative as relative9 } from "path";
|
|
308225
308401
|
import { inspect as inspect3 } from "util";
|
|
308226
308402
|
function fileHistoryEnabled() {
|
|
308227
308403
|
if (getIsNonInteractiveSession()) {
|
|
@@ -308662,7 +308838,7 @@ async function createBackup(filePath, version2) {
|
|
|
308662
308838
|
} catch (e) {
|
|
308663
308839
|
if (!isENOENT(e))
|
|
308664
308840
|
throw e;
|
|
308665
|
-
await mkdir15(
|
|
308841
|
+
await mkdir15(dirname27(backupPath), { recursive: true });
|
|
308666
308842
|
await copyFile3(filePath, backupPath);
|
|
308667
308843
|
}
|
|
308668
308844
|
await chmod6(backupPath, srcStats.mode);
|
|
@@ -308694,7 +308870,7 @@ async function restoreBackup(filePath, backupFileName) {
|
|
|
308694
308870
|
} catch (e) {
|
|
308695
308871
|
if (!isENOENT(e))
|
|
308696
308872
|
throw e;
|
|
308697
|
-
await mkdir15(
|
|
308873
|
+
await mkdir15(dirname27(filePath), { recursive: true });
|
|
308698
308874
|
await copyFile3(backupPath, filePath);
|
|
308699
308875
|
}
|
|
308700
308876
|
await chmod6(filePath, backupStats.mode);
|
|
@@ -326942,7 +327118,7 @@ var builders = null;
|
|
|
326942
327118
|
import { realpath as realpath10 } from "fs/promises";
|
|
326943
327119
|
import {
|
|
326944
327120
|
basename as basename21,
|
|
326945
|
-
dirname as
|
|
327121
|
+
dirname as dirname29,
|
|
326946
327122
|
isAbsolute as isAbsolute17,
|
|
326947
327123
|
join as join81,
|
|
326948
327124
|
sep as pathSep,
|
|
@@ -327196,7 +327372,7 @@ async function loadSkillsFromSkillsDir(basePath, source) {
|
|
|
327196
327372
|
const skillFiles = await findSkillMarkdownFiles(basePath);
|
|
327197
327373
|
const results = await Promise.all(skillFiles.map(async (skillFilePath) => {
|
|
327198
327374
|
try {
|
|
327199
|
-
const skillDirPath =
|
|
327375
|
+
const skillDirPath = dirname29(skillFilePath);
|
|
327200
327376
|
let content;
|
|
327201
327377
|
try {
|
|
327202
327378
|
content = await fs4.readFile(skillFilePath, { encoding: "utf-8" });
|
|
@@ -327237,7 +327413,7 @@ function isSkillFile(filePath) {
|
|
|
327237
327413
|
function transformSkillFiles(files) {
|
|
327238
327414
|
const filesByDir = new Map;
|
|
327239
327415
|
for (const file2 of files) {
|
|
327240
|
-
const dir =
|
|
327416
|
+
const dir = dirname29(file2.filePath);
|
|
327241
327417
|
const dirFiles = filesByDir.get(dir) ?? [];
|
|
327242
327418
|
dirFiles.push(file2);
|
|
327243
327419
|
filesByDir.set(dir, dirFiles);
|
|
@@ -327266,15 +327442,15 @@ function buildNamespace(targetDir, baseDir) {
|
|
|
327266
327442
|
return relativePath ? relativePath.split(pathSep).join(":") : "";
|
|
327267
327443
|
}
|
|
327268
327444
|
function getSkillCommandName(filePath, baseDir) {
|
|
327269
|
-
const skillDirectory =
|
|
327270
|
-
const parentOfSkillDir =
|
|
327445
|
+
const skillDirectory = dirname29(filePath);
|
|
327446
|
+
const parentOfSkillDir = dirname29(skillDirectory);
|
|
327271
327447
|
const commandBaseName = basename21(skillDirectory);
|
|
327272
327448
|
const namespace = buildNamespace(parentOfSkillDir, baseDir);
|
|
327273
327449
|
return namespace ? `${namespace}:${commandBaseName}` : commandBaseName;
|
|
327274
327450
|
}
|
|
327275
327451
|
function getRegularCommandName(filePath, baseDir) {
|
|
327276
327452
|
const fileName = basename21(filePath);
|
|
327277
|
-
const fileDirectory =
|
|
327453
|
+
const fileDirectory = dirname29(filePath);
|
|
327278
327454
|
const commandBaseName = fileName.replace(/\.md$/, "");
|
|
327279
327455
|
const namespace = buildNamespace(fileDirectory, baseDir);
|
|
327280
327456
|
return namespace ? `${namespace}:${commandBaseName}` : commandBaseName;
|
|
@@ -327297,7 +327473,7 @@ async function loadSkillsFromCommandsDir(cwd2) {
|
|
|
327297
327473
|
} of processedFiles) {
|
|
327298
327474
|
try {
|
|
327299
327475
|
const isSkillFormat = isSkillFile(filePath);
|
|
327300
|
-
const skillDirectory = isSkillFormat ?
|
|
327476
|
+
const skillDirectory = isSkillFormat ? dirname29(filePath) : undefined;
|
|
327301
327477
|
const cmdName = getCommandName2({
|
|
327302
327478
|
baseDir,
|
|
327303
327479
|
filePath,
|
|
@@ -327349,7 +327525,7 @@ async function discoverSkillDirsForPaths(filePaths, cwd2) {
|
|
|
327349
327525
|
const resolvedCwd = cwd2.endsWith(pathSep) ? cwd2.slice(0, -1) : cwd2;
|
|
327350
327526
|
const newDirs = [];
|
|
327351
327527
|
for (const filePath of filePaths) {
|
|
327352
|
-
let currentDir =
|
|
327528
|
+
let currentDir = dirname29(filePath);
|
|
327353
327529
|
while (currentDir.startsWith(resolvedCwd + pathSep)) {
|
|
327354
327530
|
const skillDir = join81(currentDir, ".claude", "skills");
|
|
327355
327531
|
if (!dynamicSkillDirs.has(skillDir)) {
|
|
@@ -327363,7 +327539,7 @@ async function discoverSkillDirsForPaths(filePaths, cwd2) {
|
|
|
327363
327539
|
newDirs.push(skillDir);
|
|
327364
327540
|
} catch {}
|
|
327365
327541
|
}
|
|
327366
|
-
const parent =
|
|
327542
|
+
const parent = dirname29(currentDir);
|
|
327367
327543
|
if (parent === currentDir)
|
|
327368
327544
|
break;
|
|
327369
327545
|
currentDir = parent;
|
|
@@ -327867,7 +328043,7 @@ var init_fileOperationAnalytics = __esm(() => {
|
|
|
327867
328043
|
|
|
327868
328044
|
// src/utils/gitDiff.ts
|
|
327869
328045
|
import { access as access5, readFile as readFile22 } from "fs/promises";
|
|
327870
|
-
import { dirname as
|
|
328046
|
+
import { dirname as dirname30, join as join82, relative as relative13, sep as sep16 } from "path";
|
|
327871
328047
|
async function fetchGitDiff() {
|
|
327872
328048
|
const isGit = await getIsGit();
|
|
327873
328049
|
if (!isGit)
|
|
@@ -328051,7 +328227,7 @@ function parseShortstat(stdout) {
|
|
|
328051
328227
|
};
|
|
328052
328228
|
}
|
|
328053
328229
|
async function fetchSingleFileGitDiff(absoluteFilePath) {
|
|
328054
|
-
const gitRoot = findGitRoot(
|
|
328230
|
+
const gitRoot = findGitRoot(dirname30(absoluteFilePath));
|
|
328055
328231
|
if (!gitRoot)
|
|
328056
328232
|
return null;
|
|
328057
328233
|
const gitPath = relative13(gitRoot, absoluteFilePath).split(sep16).join("/");
|
|
@@ -331174,7 +331350,7 @@ var init_UI8 = __esm(() => {
|
|
|
331174
331350
|
});
|
|
331175
331351
|
|
|
331176
331352
|
// src/tools/FileEditTool/FileEditTool.ts
|
|
331177
|
-
import { dirname as
|
|
331353
|
+
import { dirname as dirname31, isAbsolute as isAbsolute18, sep as sep17 } from "path";
|
|
331178
331354
|
function readFileForEdit(absoluteFilePath) {
|
|
331179
331355
|
try {
|
|
331180
331356
|
const meta = readFileSyncWithMetadata(absoluteFilePath);
|
|
@@ -331475,7 +331651,7 @@ String: ${old_string}`,
|
|
|
331475
331651
|
activateConditionalSkillsForPaths([absoluteFilePath], cwd2);
|
|
331476
331652
|
}
|
|
331477
331653
|
await diagnosticTracker.beforeFileEdited(absoluteFilePath);
|
|
331478
|
-
await fs4.mkdir(
|
|
331654
|
+
await fs4.mkdir(dirname31(absoluteFilePath));
|
|
331479
331655
|
if (fileHistoryEnabled()) {
|
|
331480
331656
|
await fileHistoryTrackEdit(updateFileHistoryState, absoluteFilePath, parentMessage.uuid);
|
|
331481
331657
|
}
|
|
@@ -332048,7 +332224,7 @@ var init_UI9 = __esm(() => {
|
|
|
332048
332224
|
});
|
|
332049
332225
|
|
|
332050
332226
|
// src/tools/FileWriteTool/FileWriteTool.ts
|
|
332051
|
-
import { dirname as
|
|
332227
|
+
import { dirname as dirname32, sep as sep18 } from "path";
|
|
332052
332228
|
var inputSchema13, outputSchema10, FileWriteTool;
|
|
332053
332229
|
var init_FileWriteTool = __esm(() => {
|
|
332054
332230
|
init_analytics();
|
|
@@ -332188,7 +332364,7 @@ var init_FileWriteTool = __esm(() => {
|
|
|
332188
332364
|
},
|
|
332189
332365
|
async call({ file_path, content }, { readFileState, updateFileHistoryState, dynamicSkillDirTriggers }, _, parentMessage) {
|
|
332190
332366
|
const fullFilePath = expandPath(file_path);
|
|
332191
|
-
const dir =
|
|
332367
|
+
const dir = dirname32(fullFilePath);
|
|
332192
332368
|
const cwd2 = getCwd();
|
|
332193
332369
|
const newSkillDirs = await discoverSkillDirsForPaths([fullFilePath], cwd2);
|
|
332194
332370
|
if (newSkillDirs.length > 0) {
|
|
@@ -332330,7 +332506,7 @@ var init_FileWriteTool = __esm(() => {
|
|
|
332330
332506
|
});
|
|
332331
332507
|
|
|
332332
332508
|
// src/utils/plugins/orphanedPluginFilter.ts
|
|
332333
|
-
import { dirname as
|
|
332509
|
+
import { dirname as dirname33, isAbsolute as isAbsolute20, join as join83, normalize as normalize11, relative as relative16, sep as sep19 } from "path";
|
|
332334
332510
|
async function getGlobExclusionsForPluginCache(searchPath) {
|
|
332335
332511
|
const cachePath2 = normalize11(join83(getPluginsDirectory(), "cache"));
|
|
332336
332512
|
if (searchPath && !pathsOverlap(searchPath, cachePath2)) {
|
|
@@ -332350,7 +332526,7 @@ async function getGlobExclusionsForPluginCache(searchPath) {
|
|
|
332350
332526
|
ORPHANED_AT_FILENAME
|
|
332351
332527
|
], cachePath2, new AbortController().signal);
|
|
332352
332528
|
cachedExclusions = markers.map((markerPath) => {
|
|
332353
|
-
const versionDir =
|
|
332529
|
+
const versionDir = dirname33(markerPath);
|
|
332354
332530
|
const rel = isAbsolute20(versionDir) ? relative16(cachePath2, versionDir) : versionDir;
|
|
332355
332531
|
const posixRelative = rel.replace(/\\/g, "/");
|
|
332356
332532
|
return `!**/${posixRelative}/**`;
|
|
@@ -332380,12 +332556,12 @@ var init_orphanedPluginFilter = __esm(() => {
|
|
|
332380
332556
|
});
|
|
332381
332557
|
|
|
332382
332558
|
// src/utils/glob.ts
|
|
332383
|
-
import { basename as basename23, dirname as
|
|
332559
|
+
import { basename as basename23, dirname as dirname34, isAbsolute as isAbsolute21, join as join84, sep as sep20 } from "path";
|
|
332384
332560
|
function extractGlobBaseDirectory(pattern) {
|
|
332385
332561
|
const globChars = /[*?[{]/;
|
|
332386
332562
|
const match = pattern.match(globChars);
|
|
332387
332563
|
if (!match || match.index === undefined) {
|
|
332388
|
-
const dir =
|
|
332564
|
+
const dir = dirname34(pattern);
|
|
332389
332565
|
const file2 = basename23(pattern);
|
|
332390
332566
|
return { baseDir: dir, relativePattern: file2 };
|
|
332391
332567
|
}
|
|
@@ -356332,7 +356508,7 @@ var init_ExitWorktreeTool = __esm(() => {
|
|
|
356332
356508
|
var CONFIG_TOOL_NAME = "Config";
|
|
356333
356509
|
|
|
356334
356510
|
// src/utils/modelConfig.ts
|
|
356335
|
-
import { existsSync as existsSync9, mkdirSync as
|
|
356511
|
+
import { existsSync as existsSync9, mkdirSync as mkdirSync9, readFileSync as readFileSync14, writeFileSync as writeFileSync7 } from "node:fs";
|
|
356336
356512
|
import { join as join87 } from "node:path";
|
|
356337
356513
|
function getModelsPath() {
|
|
356338
356514
|
return join87(getClaudeConfigHomeDir(), "models.json");
|
|
@@ -356342,8 +356518,8 @@ function loadModelConfig() {
|
|
|
356342
356518
|
if (!existsSync9(path16)) {
|
|
356343
356519
|
const dir = getClaudeConfigHomeDir();
|
|
356344
356520
|
if (!existsSync9(dir))
|
|
356345
|
-
|
|
356346
|
-
|
|
356521
|
+
mkdirSync9(dir, { recursive: true });
|
|
356522
|
+
writeFileSync7(path16, JSON.stringify(DEFAULT_MODELS, null, 2));
|
|
356347
356523
|
return DEFAULT_MODELS;
|
|
356348
356524
|
}
|
|
356349
356525
|
try {
|
|
@@ -370898,7 +371074,7 @@ function getAnthropicEnvMetadata() {
|
|
|
370898
371074
|
function getBuildAgeMinutes() {
|
|
370899
371075
|
if (false)
|
|
370900
371076
|
;
|
|
370901
|
-
const buildTime = new Date("2026-04-
|
|
371077
|
+
const buildTime = new Date("2026-04-05T03:08:12.888Z").getTime();
|
|
370902
371078
|
if (isNaN(buildTime))
|
|
370903
371079
|
return;
|
|
370904
371080
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -374617,7 +374793,7 @@ var init_toolSearch = __esm(() => {
|
|
|
374617
374793
|
// src/services/vcr.ts
|
|
374618
374794
|
import { createHash as createHash18, randomUUID as randomUUID21 } from "crypto";
|
|
374619
374795
|
import { mkdir as mkdir22, readFile as readFile28, writeFile as writeFile22 } from "fs/promises";
|
|
374620
|
-
import { dirname as
|
|
374796
|
+
import { dirname as dirname35, join as join91 } from "path";
|
|
374621
374797
|
function shouldUseVCR() {
|
|
374622
374798
|
if (false) {}
|
|
374623
374799
|
if (process.env.USER_TYPE === "ant" && isEnvTruthy(process.env.FORCE_VCR)) {
|
|
@@ -374644,7 +374820,7 @@ async function withFixture(input, fixtureName, f) {
|
|
|
374644
374820
|
throw new Error(`Fixture missing: ${filename}. Re-run tests with VCR_RECORD=1, then commit the result.`);
|
|
374645
374821
|
}
|
|
374646
374822
|
const result = await f();
|
|
374647
|
-
await mkdir22(
|
|
374823
|
+
await mkdir22(dirname35(filename), { recursive: true });
|
|
374648
374824
|
await writeFile22(filename, jsonStringify(result, null, 2), {
|
|
374649
374825
|
encoding: "utf8"
|
|
374650
374826
|
});
|
|
@@ -374683,7 +374859,7 @@ ${jsonStringify(dehydratedInput, null, 2)}`);
|
|
|
374683
374859
|
if (env2.isCI && !isEnvTruthy(process.env.VCR_RECORD)) {
|
|
374684
374860
|
return results;
|
|
374685
374861
|
}
|
|
374686
|
-
await mkdir22(
|
|
374862
|
+
await mkdir22(dirname35(filename), { recursive: true });
|
|
374687
374863
|
await writeFile22(filename, jsonStringify({
|
|
374688
374864
|
input: dehydratedInput,
|
|
374689
374865
|
output: results.map((message, index) => mapMessage(message, dehydrateValue, index))
|
|
@@ -376807,7 +376983,7 @@ var init_findRelevantMemories = __esm(() => {
|
|
|
376807
376983
|
|
|
376808
376984
|
// src/utils/attachments.ts
|
|
376809
376985
|
import { readdir as readdir17, stat as stat31 } from "fs/promises";
|
|
376810
|
-
import { dirname as
|
|
376986
|
+
import { dirname as dirname36, parse as parse12, relative as relative19, resolve as resolve29 } from "path";
|
|
376811
376987
|
import { randomUUID as randomUUID23 } from "crypto";
|
|
376812
376988
|
async function getAttachments(input, toolUseContext, ideSelection, queuedCommands, messages, querySource, options2) {
|
|
376813
376989
|
if (isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_ATTACHMENTS) || isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE)) {
|
|
@@ -377183,21 +377359,21 @@ async function getSelectedLinesFromIDE(ideSelection, toolUseContext) {
|
|
|
377183
377359
|
];
|
|
377184
377360
|
}
|
|
377185
377361
|
function getDirectoriesToProcess(targetPath, originalCwd) {
|
|
377186
|
-
const targetDir =
|
|
377362
|
+
const targetDir = dirname36(resolve29(targetPath));
|
|
377187
377363
|
const nestedDirs = [];
|
|
377188
377364
|
let currentDir = targetDir;
|
|
377189
377365
|
while (currentDir !== originalCwd && currentDir !== parse12(currentDir).root) {
|
|
377190
377366
|
if (currentDir.startsWith(originalCwd)) {
|
|
377191
377367
|
nestedDirs.push(currentDir);
|
|
377192
377368
|
}
|
|
377193
|
-
currentDir =
|
|
377369
|
+
currentDir = dirname36(currentDir);
|
|
377194
377370
|
}
|
|
377195
377371
|
nestedDirs.reverse();
|
|
377196
377372
|
const cwdLevelDirs = [];
|
|
377197
377373
|
currentDir = originalCwd;
|
|
377198
377374
|
while (currentDir !== parse12(currentDir).root) {
|
|
377199
377375
|
cwdLevelDirs.push(currentDir);
|
|
377200
|
-
currentDir =
|
|
377376
|
+
currentDir = dirname36(currentDir);
|
|
377201
377377
|
}
|
|
377202
377378
|
cwdLevelDirs.reverse();
|
|
377203
377379
|
return { nestedDirs, cwdLevelDirs };
|
|
@@ -378443,21 +378619,21 @@ var init_attachments2 = __esm(() => {
|
|
|
378443
378619
|
});
|
|
378444
378620
|
|
|
378445
378621
|
// src/utils/plugins/loadPluginCommands.ts
|
|
378446
|
-
import { basename as basename27, dirname as
|
|
378622
|
+
import { basename as basename27, dirname as dirname37, join as join94 } from "path";
|
|
378447
378623
|
function isSkillFile2(filePath) {
|
|
378448
378624
|
return /^skill\.md$/i.test(basename27(filePath));
|
|
378449
378625
|
}
|
|
378450
378626
|
function getCommandNameFromFile(filePath, baseDir, pluginName) {
|
|
378451
378627
|
const isSkill = isSkillFile2(filePath);
|
|
378452
378628
|
if (isSkill) {
|
|
378453
|
-
const skillDirectory =
|
|
378454
|
-
const parentOfSkillDir =
|
|
378629
|
+
const skillDirectory = dirname37(filePath);
|
|
378630
|
+
const parentOfSkillDir = dirname37(skillDirectory);
|
|
378455
378631
|
const commandBaseName = basename27(skillDirectory);
|
|
378456
378632
|
const relativePath = parentOfSkillDir.startsWith(baseDir) ? parentOfSkillDir.slice(baseDir.length).replace(/^\//, "") : "";
|
|
378457
378633
|
const namespace = relativePath ? relativePath.split("/").join(":") : "";
|
|
378458
378634
|
return namespace ? `${pluginName}:${namespace}:${commandBaseName}` : `${pluginName}:${commandBaseName}`;
|
|
378459
378635
|
} else {
|
|
378460
|
-
const fileDirectory =
|
|
378636
|
+
const fileDirectory = dirname37(filePath);
|
|
378461
378637
|
const commandBaseName = basename27(filePath).replace(/\.md$/, "");
|
|
378462
378638
|
const relativePath = fileDirectory.startsWith(baseDir) ? fileDirectory.slice(baseDir.length).replace(/^\//, "") : "";
|
|
378463
378639
|
const namespace = relativePath ? relativePath.split("/").join(":") : "";
|
|
@@ -378484,7 +378660,7 @@ async function collectMarkdownFiles(dirPath, baseDir, loadedPaths) {
|
|
|
378484
378660
|
function transformPluginSkillFiles(files) {
|
|
378485
378661
|
const filesByDir = new Map;
|
|
378486
378662
|
for (const file2 of files) {
|
|
378487
|
-
const dir =
|
|
378663
|
+
const dir = dirname37(file2.filePath);
|
|
378488
378664
|
const dirFiles = filesByDir.get(dir) ?? [];
|
|
378489
378665
|
dirFiles.push(file2);
|
|
378490
378666
|
filesByDir.set(dir, dirFiles);
|
|
@@ -378573,7 +378749,7 @@ function createPluginCommand(commandName, file2, sourceName, pluginManifest, plu
|
|
|
378573
378749
|
return displayName || commandName;
|
|
378574
378750
|
},
|
|
378575
378751
|
async getPromptForCommand(args, context6) {
|
|
378576
|
-
let finalContent = config2.isSkillMode ? `Base directory for this skill: ${
|
|
378752
|
+
let finalContent = config2.isSkillMode ? `Base directory for this skill: ${dirname37(file2.filePath)}
|
|
378577
378753
|
|
|
378578
378754
|
${content}` : content;
|
|
378579
378755
|
finalContent = substituteArguments(finalContent, args, true, argumentNames);
|
|
@@ -378585,7 +378761,7 @@ ${content}` : content;
|
|
|
378585
378761
|
finalContent = substituteUserConfigInContent(finalContent, loadPluginOptions(sourceName), pluginManifest.userConfig);
|
|
378586
378762
|
}
|
|
378587
378763
|
if (config2.isSkillMode) {
|
|
378588
|
-
const rawSkillDir =
|
|
378764
|
+
const rawSkillDir = dirname37(file2.filePath);
|
|
378589
378765
|
const skillDir = process.platform === "win32" ? rawSkillDir.replace(/\\/g, "/") : rawSkillDir;
|
|
378590
378766
|
finalContent = finalContent.replace(/\$\{CLAUDE_SKILL_DIR\}/g, skillDir);
|
|
378591
378767
|
}
|
|
@@ -378645,7 +378821,7 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi
|
|
|
378645
378821
|
const skillName = `${pluginName}:${basename27(skillsPath)}`;
|
|
378646
378822
|
const file2 = {
|
|
378647
378823
|
filePath: directSkillPath,
|
|
378648
|
-
baseDir:
|
|
378824
|
+
baseDir: dirname37(directSkillPath),
|
|
378649
378825
|
frontmatter,
|
|
378650
378826
|
content: markdownContent
|
|
378651
378827
|
};
|
|
@@ -378694,7 +378870,7 @@ async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, plugi
|
|
|
378694
378870
|
const skillName = `${pluginName}:${entry.name}`;
|
|
378695
378871
|
const file2 = {
|
|
378696
378872
|
filePath: skillFilePath,
|
|
378697
|
-
baseDir:
|
|
378873
|
+
baseDir: dirname37(skillFilePath),
|
|
378698
378874
|
frontmatter,
|
|
378699
378875
|
content: markdownContent
|
|
378700
378876
|
};
|
|
@@ -378807,7 +378983,7 @@ var init_loadPluginCommands = __esm(() => {
|
|
|
378807
378983
|
} : frontmatter;
|
|
378808
378984
|
const file2 = {
|
|
378809
378985
|
filePath: commandPath,
|
|
378810
|
-
baseDir:
|
|
378986
|
+
baseDir: dirname37(commandPath),
|
|
378811
378987
|
frontmatter: finalFrontmatter,
|
|
378812
378988
|
content: markdownContent
|
|
378813
378989
|
};
|
|
@@ -378932,7 +379108,7 @@ import {
|
|
|
378932
379108
|
writeFile as writeFile23
|
|
378933
379109
|
} from "fs/promises";
|
|
378934
379110
|
import { tmpdir as tmpdir6 } from "os";
|
|
378935
|
-
import { basename as basename28, dirname as
|
|
379111
|
+
import { basename as basename28, dirname as dirname38, join as join95 } from "path";
|
|
378936
379112
|
function isPluginZipCacheEnabled() {
|
|
378937
379113
|
return isEnvTruthy(process.env.CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE);
|
|
378938
379114
|
}
|
|
@@ -378995,7 +379171,7 @@ async function cleanupSessionPluginCache() {
|
|
|
378995
379171
|
}
|
|
378996
379172
|
}
|
|
378997
379173
|
async function atomicWriteToZipCache(targetPath, data) {
|
|
378998
|
-
const dir =
|
|
379174
|
+
const dir = dirname38(targetPath);
|
|
378999
379175
|
await getFsImplementation().mkdir(dir);
|
|
379000
379176
|
const tmpName = `.${basename28(targetPath)}.tmp.${randomBytes11(4).toString("hex")}`;
|
|
379001
379177
|
const tmpPath = join95(dir, tmpName);
|
|
@@ -379092,7 +379268,7 @@ async function extractZipToDirectory(zipPath, targetDir) {
|
|
|
379092
379268
|
continue;
|
|
379093
379269
|
}
|
|
379094
379270
|
const fullPath = join95(targetDir, relPath);
|
|
379095
|
-
await getFsImplementation().mkdir(
|
|
379271
|
+
await getFsImplementation().mkdir(dirname38(fullPath));
|
|
379096
379272
|
await writeFile23(fullPath, data);
|
|
379097
379273
|
const mode = modes[relPath];
|
|
379098
379274
|
if (mode && mode & 73) {
|
|
@@ -379582,7 +379758,7 @@ var init_marketplaceHelpers = __esm(() => {
|
|
|
379582
379758
|
|
|
379583
379759
|
// src/utils/plugins/officialMarketplaceGcs.ts
|
|
379584
379760
|
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
|
|
379761
|
+
import { dirname as dirname39, join as join97, resolve as resolve30, sep as sep21 } from "path";
|
|
379586
379762
|
async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCacheDir) {
|
|
379587
379763
|
const cacheDir = resolve30(marketplacesCacheDir);
|
|
379588
379764
|
const resolvedLoc = resolve30(installLocation);
|
|
@@ -379629,7 +379805,7 @@ async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCach
|
|
|
379629
379805
|
if (!rel || rel.endsWith("/"))
|
|
379630
379806
|
continue;
|
|
379631
379807
|
const dest = join97(staging, rel);
|
|
379632
|
-
await mkdir24(
|
|
379808
|
+
await mkdir24(dirname39(dest), { recursive: true });
|
|
379633
379809
|
await writeFile25(dest, data);
|
|
379634
379810
|
const mode = modes[arcPath];
|
|
379635
379811
|
if (mode && mode & 73) {
|
|
@@ -379703,7 +379879,7 @@ var init_officialMarketplaceGcs = __esm(() => {
|
|
|
379703
379879
|
|
|
379704
379880
|
// src/utils/plugins/marketplaceManager.ts
|
|
379705
379881
|
import { writeFile as writeFile26 } from "fs/promises";
|
|
379706
|
-
import { basename as basename29, dirname as
|
|
379882
|
+
import { basename as basename29, dirname as dirname40, isAbsolute as isAbsolute23, join as join98, resolve as resolve31, sep as sep22 } from "path";
|
|
379707
379883
|
function getKnownMarketplacesFile() {
|
|
379708
379884
|
return join98(getPluginsDirectory(), "known_marketplaces.json");
|
|
379709
379885
|
}
|
|
@@ -380383,7 +380559,7 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
380383
380559
|
case "file": {
|
|
380384
380560
|
const absPath = resolve31(source.path);
|
|
380385
380561
|
marketplacePath = absPath;
|
|
380386
|
-
temporaryCachePath =
|
|
380562
|
+
temporaryCachePath = dirname40(dirname40(absPath));
|
|
380387
380563
|
cleanupNeeded = false;
|
|
380388
380564
|
break;
|
|
380389
380565
|
}
|
|
@@ -380398,7 +380574,7 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
380398
380574
|
temporaryCachePath = join98(cacheDir, source.name);
|
|
380399
380575
|
marketplacePath = join98(temporaryCachePath, ".claude-plugin", "marketplace.json");
|
|
380400
380576
|
cleanupNeeded = false;
|
|
380401
|
-
await fs4.mkdir(
|
|
380577
|
+
await fs4.mkdir(dirname40(marketplacePath));
|
|
380402
380578
|
await writeFile26(marketplacePath, jsonStringify({
|
|
380403
380579
|
name: source.name,
|
|
380404
380580
|
owner: source.owner ?? { name: "settings" },
|
|
@@ -380893,7 +381069,7 @@ var init_marketplaceManager = __esm(() => {
|
|
|
380893
381069
|
});
|
|
380894
381070
|
|
|
380895
381071
|
// src/utils/plugins/installedPluginsManager.ts
|
|
380896
|
-
import { dirname as
|
|
381072
|
+
import { dirname as dirname41, join as join99 } from "path";
|
|
380897
381073
|
function getInstalledPluginsFilePath() {
|
|
380898
381074
|
return join99(getPluginsDirectory(), "installed_plugins.json");
|
|
380899
381075
|
}
|
|
@@ -381459,7 +381635,7 @@ var init_pluginVersioning = __esm(() => {
|
|
|
381459
381635
|
// src/utils/plugins/pluginInstallationHelpers.ts
|
|
381460
381636
|
import { randomBytes as randomBytes12 } from "crypto";
|
|
381461
381637
|
import { rename as rename5, rm as rm8 } from "fs/promises";
|
|
381462
|
-
import { dirname as
|
|
381638
|
+
import { dirname as dirname42, join as join100, resolve as resolve32, sep as sep23 } from "path";
|
|
381463
381639
|
function getCurrentTimestamp() {
|
|
381464
381640
|
return new Date().toISOString();
|
|
381465
381641
|
}
|
|
@@ -381483,14 +381659,14 @@ async function cacheAndRegisterPlugin(pluginId, entry, scope = "user", projectPa
|
|
|
381483
381659
|
const versionedPath = getVersionedCachePath(pluginId, version2);
|
|
381484
381660
|
let finalPath = cacheResult.path;
|
|
381485
381661
|
if (cacheResult.path !== versionedPath) {
|
|
381486
|
-
await getFsImplementation().mkdir(
|
|
381662
|
+
await getFsImplementation().mkdir(dirname42(versionedPath));
|
|
381487
381663
|
await rm8(versionedPath, { recursive: true, force: true });
|
|
381488
381664
|
const normalizedCachePath = cacheResult.path.endsWith(sep23) ? cacheResult.path : cacheResult.path + sep23;
|
|
381489
381665
|
const isSubdirectory = versionedPath.startsWith(normalizedCachePath);
|
|
381490
381666
|
if (isSubdirectory) {
|
|
381491
|
-
const tempPath = join100(
|
|
381667
|
+
const tempPath = join100(dirname42(cacheResult.path), `.claude-plugin-temp-${Date.now()}-${randomBytes12(4).toString("hex")}`);
|
|
381492
381668
|
await rename5(cacheResult.path, tempPath);
|
|
381493
|
-
await getFsImplementation().mkdir(
|
|
381669
|
+
await getFsImplementation().mkdir(dirname42(versionedPath));
|
|
381494
381670
|
await rename5(tempPath, versionedPath);
|
|
381495
381671
|
} else {
|
|
381496
381672
|
await rename5(cacheResult.path, versionedPath);
|
|
@@ -381719,7 +381895,7 @@ import {
|
|
|
381719
381895
|
stat as stat34,
|
|
381720
381896
|
symlink as symlink3
|
|
381721
381897
|
} from "fs/promises";
|
|
381722
|
-
import { basename as basename30, dirname as
|
|
381898
|
+
import { basename as basename30, dirname as dirname43, join as join101, relative as relative20, resolve as resolve33, sep as sep24 } from "path";
|
|
381723
381899
|
function getPluginCachePath() {
|
|
381724
381900
|
return join101(getPluginsDirectory(), "cache");
|
|
381725
381901
|
}
|
|
@@ -381749,7 +381925,7 @@ async function probeSeedCache(pluginId, version2) {
|
|
|
381749
381925
|
}
|
|
381750
381926
|
async function probeSeedCacheAnyVersion(pluginId) {
|
|
381751
381927
|
for (const seedDir of getPluginSeedDirs()) {
|
|
381752
|
-
const pluginDir =
|
|
381928
|
+
const pluginDir = dirname43(getVersionedCachePathIn(seedDir, pluginId, "_"));
|
|
381753
381929
|
try {
|
|
381754
381930
|
const versions2 = await readdir20(pluginDir);
|
|
381755
381931
|
if (versions2.length !== 1)
|
|
@@ -381791,7 +381967,7 @@ async function copyDir(src, dest) {
|
|
|
381791
381967
|
if (resolvedTarget.startsWith(srcPrefix) || resolvedTarget === resolvedSrc) {
|
|
381792
381968
|
const targetRelativeToSrc = relative20(resolvedSrc, resolvedTarget);
|
|
381793
381969
|
const destTargetPath = join101(dest, targetRelativeToSrc);
|
|
381794
|
-
const relativeLinkPath = relative20(
|
|
381970
|
+
const relativeLinkPath = relative20(dirname43(destPath), destTargetPath);
|
|
381795
381971
|
await symlink3(relativeLinkPath, destPath);
|
|
381796
381972
|
} else {
|
|
381797
381973
|
await symlink3(resolvedTarget, destPath);
|
|
@@ -381822,7 +381998,7 @@ async function copyPluginToVersionedCache(sourcePath, pluginId, version2, entry,
|
|
|
381822
381998
|
logForDebugging2(`Using seed cache for ${pluginId}@${version2} at ${seedPath}`);
|
|
381823
381999
|
return seedPath;
|
|
381824
382000
|
}
|
|
381825
|
-
await getFsImplementation().mkdir(
|
|
382001
|
+
await getFsImplementation().mkdir(dirname43(cachePath2));
|
|
381826
382002
|
if (entry && typeof entry.source === "string" && marketplaceDir) {
|
|
381827
382003
|
const sourceDir = validatePathWithinBase(marketplaceDir, entry.source);
|
|
381828
382004
|
logForDebugging2(`Copying source directory ${entry.source} for plugin ${pluginId}`);
|
|
@@ -390049,7 +390225,7 @@ var init_appleTerminalBackup = __esm(() => {
|
|
|
390049
390225
|
|
|
390050
390226
|
// src/utils/completionCache.ts
|
|
390051
390227
|
import { homedir as homedir27 } from "os";
|
|
390052
|
-
import { dirname as
|
|
390228
|
+
import { dirname as dirname44, join as join104 } from "path";
|
|
390053
390229
|
function detectShell() {
|
|
390054
390230
|
const shell = process.env.SHELL || "";
|
|
390055
390231
|
const home = homedir27();
|
|
@@ -390129,7 +390305,7 @@ __export(exports_terminalSetup, {
|
|
|
390129
390305
|
import { randomBytes as randomBytes14 } from "crypto";
|
|
390130
390306
|
import { copyFile as copyFile8, mkdir as mkdir25, readFile as readFile33, writeFile as writeFile27 } from "fs/promises";
|
|
390131
390307
|
import { homedir as homedir28, platform as platform4 } from "os";
|
|
390132
|
-
import { dirname as
|
|
390308
|
+
import { dirname as dirname45, join as join105 } from "path";
|
|
390133
390309
|
import { pathToFileURL as pathToFileURL7 } from "url";
|
|
390134
390310
|
function isVSCodeRemoteSSH() {
|
|
390135
390311
|
const askpassMain = process.env.VSCODE_GIT_ASKPASS_MAIN ?? "";
|
|
@@ -390451,7 +390627,7 @@ chars = "\\u001B\\r"`;
|
|
|
390451
390627
|
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
390628
|
}
|
|
390453
390629
|
} else {
|
|
390454
|
-
await mkdir25(
|
|
390630
|
+
await mkdir25(dirname45(configPath), {
|
|
390455
390631
|
recursive: true
|
|
390456
390632
|
});
|
|
390457
390633
|
}
|
|
@@ -392913,7 +393089,7 @@ var init_TextInput = __esm(() => {
|
|
|
392913
393089
|
});
|
|
392914
393090
|
|
|
392915
393091
|
// src/utils/suggestions/directoryCompletion.ts
|
|
392916
|
-
import { basename as basename34, dirname as
|
|
393092
|
+
import { basename as basename34, dirname as dirname46, join as join108, sep as sep25 } from "path";
|
|
392917
393093
|
function parsePartialPath(partialPath, basePath) {
|
|
392918
393094
|
if (!partialPath) {
|
|
392919
393095
|
const directory2 = basePath || getCwd();
|
|
@@ -392923,7 +393099,7 @@ function parsePartialPath(partialPath, basePath) {
|
|
|
392923
393099
|
if (partialPath.endsWith("/") || partialPath.endsWith(sep25)) {
|
|
392924
393100
|
return { directory: resolved, prefix: "" };
|
|
392925
393101
|
}
|
|
392926
|
-
const directory =
|
|
393102
|
+
const directory = dirname46(resolved);
|
|
392927
393103
|
const prefix = basename34(partialPath);
|
|
392928
393104
|
return { directory, prefix };
|
|
392929
393105
|
}
|
|
@@ -411098,7 +411274,7 @@ __export(exports_keybindings, {
|
|
|
411098
411274
|
call: () => call23
|
|
411099
411275
|
});
|
|
411100
411276
|
import { mkdir as mkdir30, writeFile as writeFile32 } from "fs/promises";
|
|
411101
|
-
import { dirname as
|
|
411277
|
+
import { dirname as dirname48 } from "path";
|
|
411102
411278
|
async function call23() {
|
|
411103
411279
|
if (!isKeybindingCustomizationEnabled()) {
|
|
411104
411280
|
return {
|
|
@@ -411108,7 +411284,7 @@ async function call23() {
|
|
|
411108
411284
|
}
|
|
411109
411285
|
const keybindingsPath = getKeybindingsPath();
|
|
411110
411286
|
let fileExists = false;
|
|
411111
|
-
await mkdir30(
|
|
411287
|
+
await mkdir30(dirname48(keybindingsPath), { recursive: true });
|
|
411112
411288
|
try {
|
|
411113
411289
|
await writeFile32(keybindingsPath, generateKeybindingsTemplate(), {
|
|
411114
411290
|
encoding: "utf-8",
|
|
@@ -411162,13 +411338,13 @@ __export(exports_auth3, {
|
|
|
411162
411338
|
});
|
|
411163
411339
|
import { createServer as createServer5 } from "node:http";
|
|
411164
411340
|
import { createHash as createHash21, randomBytes as randomBytes15 } from "node:crypto";
|
|
411165
|
-
import { appendFileSync as appendFileSync5, existsSync as existsSync10, mkdirSync as
|
|
411341
|
+
import { appendFileSync as appendFileSync5, existsSync as existsSync10, mkdirSync as mkdirSync10 } from "node:fs";
|
|
411166
411342
|
import { join as join115 } from "node:path";
|
|
411167
411343
|
function appendAuthLog(service, message) {
|
|
411168
411344
|
try {
|
|
411169
411345
|
const dir = getClaudeConfigHomeDir();
|
|
411170
411346
|
if (!existsSync10(dir)) {
|
|
411171
|
-
|
|
411347
|
+
mkdirSync10(dir, { recursive: true });
|
|
411172
411348
|
}
|
|
411173
411349
|
appendFileSync5(join115(dir, "auth.log"), `[${new Date().toISOString()}] [${service}] ${message}
|
|
411174
411350
|
`, { mode: 384 });
|
|
@@ -411183,7 +411359,7 @@ function appendAuthHttpLog(service, label, requestInfo, responseInfo) {
|
|
|
411183
411359
|
try {
|
|
411184
411360
|
const dir = getClaudeConfigHomeDir();
|
|
411185
411361
|
if (!existsSync10(dir)) {
|
|
411186
|
-
|
|
411362
|
+
mkdirSync10(dir, { recursive: true });
|
|
411187
411363
|
}
|
|
411188
411364
|
appendFileSync5(join115(dir, "auth-http.log"), `[${new Date().toISOString()}] [${service}] ${label}
|
|
411189
411365
|
REQUEST:
|
|
@@ -412118,7 +412294,7 @@ function AuthCommand({
|
|
|
412118
412294
|
port: CODEX_PORT,
|
|
412119
412295
|
callbackPath: "/auth/callback",
|
|
412120
412296
|
buildAuthUrl: (state2, challenge) => `${CODEX_AUTH_URL}?` + new URLSearchParams({
|
|
412121
|
-
client_id:
|
|
412297
|
+
client_id: CODEX_CLIENT_ID2,
|
|
412122
412298
|
redirect_uri: CODEX_REDIRECT_URI,
|
|
412123
412299
|
response_type: "code",
|
|
412124
412300
|
scope: CODEX_SCOPES,
|
|
@@ -412129,9 +412305,9 @@ function AuthCommand({
|
|
|
412129
412305
|
prompt: "consent"
|
|
412130
412306
|
}).toString(),
|
|
412131
412307
|
doExchange: async (code, verifier) => {
|
|
412132
|
-
const tokens = await exchangeTokens(
|
|
412308
|
+
const tokens = await exchangeTokens(CODEX_TOKEN_URL2, {
|
|
412133
412309
|
code,
|
|
412134
|
-
client_id:
|
|
412310
|
+
client_id: CODEX_CLIENT_ID2,
|
|
412135
412311
|
redirect_uri: CODEX_REDIRECT_URI,
|
|
412136
412312
|
grant_type: "authorization_code",
|
|
412137
412313
|
code_verifier: verifier
|
|
@@ -412172,7 +412348,7 @@ async function call24(onDone, context7) {
|
|
|
412172
412348
|
context: context7
|
|
412173
412349
|
}, undefined, false, undefined, this);
|
|
412174
412350
|
}
|
|
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,
|
|
412351
|
+
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
412352
|
var init_auth8 = __esm(() => {
|
|
412177
412353
|
init_ConsoleOAuthFlow();
|
|
412178
412354
|
init_Dialog();
|
|
@@ -423133,7 +423309,7 @@ var init_DiscoverPlugins = __esm(() => {
|
|
|
423133
423309
|
});
|
|
423134
423310
|
|
|
423135
423311
|
// src/services/plugins/pluginOperations.ts
|
|
423136
|
-
import { dirname as
|
|
423312
|
+
import { dirname as dirname49, join as join118 } from "path";
|
|
423137
423313
|
function assertInstallableScope(scope) {
|
|
423138
423314
|
if (!VALID_INSTALLABLE_SCOPES.includes(scope)) {
|
|
423139
423315
|
throw new Error(`Invalid scope "${scope}". Must be one of: ${VALID_INSTALLABLE_SCOPES.join(", ")}`);
|
|
@@ -423610,7 +423786,7 @@ async function performPluginUpdate({
|
|
|
423610
423786
|
}
|
|
423611
423787
|
throw e;
|
|
423612
423788
|
}
|
|
423613
|
-
const marketplaceDir = marketplaceStats.isDirectory() ? marketplaceInstallLocation :
|
|
423789
|
+
const marketplaceDir = marketplaceStats.isDirectory() ? marketplaceInstallLocation : dirname49(marketplaceInstallLocation);
|
|
423614
423790
|
sourcePath = join118(marketplaceDir, entry.source);
|
|
423615
423791
|
try {
|
|
423616
423792
|
await fs4.stat(sourcePath);
|
|
@@ -434946,7 +435122,7 @@ ${args ? "Additional user input: " + args : ""}
|
|
|
434946
435122
|
|
|
434947
435123
|
// src/utils/releaseNotes.ts
|
|
434948
435124
|
import { mkdir as mkdir31, readFile as readFile40, writeFile as writeFile35 } from "fs/promises";
|
|
434949
|
-
import { dirname as
|
|
435125
|
+
import { dirname as dirname51, join as join122 } from "path";
|
|
434950
435126
|
function getChangelogCachePath() {
|
|
434951
435127
|
return join122(getClaudeConfigHomeDir(), "cache", "changelog.md");
|
|
434952
435128
|
}
|
|
@@ -434957,7 +435133,7 @@ async function migrateChangelogFromConfig() {
|
|
|
434957
435133
|
}
|
|
434958
435134
|
const cachePath2 = getChangelogCachePath();
|
|
434959
435135
|
try {
|
|
434960
|
-
await mkdir31(
|
|
435136
|
+
await mkdir31(dirname51(cachePath2), { recursive: true });
|
|
434961
435137
|
await writeFile35(cachePath2, config3.cachedChangelog, {
|
|
434962
435138
|
encoding: "utf-8",
|
|
434963
435139
|
flag: "wx"
|
|
@@ -434979,7 +435155,7 @@ async function fetchAndStoreChangelog() {
|
|
|
434979
435155
|
return;
|
|
434980
435156
|
}
|
|
434981
435157
|
const cachePath2 = getChangelogCachePath();
|
|
434982
|
-
await mkdir31(
|
|
435158
|
+
await mkdir31(dirname51(cachePath2), { recursive: true });
|
|
434983
435159
|
await writeFile35(cachePath2, changelogContent, { encoding: "utf-8" });
|
|
434984
435160
|
changelogMemoryCache = changelogContent;
|
|
434985
435161
|
const changelogLastFetched = Date.now();
|
|
@@ -449073,7 +449249,7 @@ var init_terminalSetup2 = __esm(() => {
|
|
|
449073
449249
|
|
|
449074
449250
|
// src/utils/antigravityLocalSessions.ts
|
|
449075
449251
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
449076
|
-
import { existsSync as existsSync11, mkdirSync as
|
|
449252
|
+
import { existsSync as existsSync11, mkdirSync as mkdirSync11, readFileSync as readFileSync15, writeFileSync as writeFileSync8 } from "node:fs";
|
|
449077
449253
|
import { join as join123 } from "node:path";
|
|
449078
449254
|
import { platform as platform5 } from "node:os";
|
|
449079
449255
|
function getSnapshotPath() {
|
|
@@ -449092,8 +449268,8 @@ function loadSnapshotFile() {
|
|
|
449092
449268
|
function saveSnapshotFile(data) {
|
|
449093
449269
|
const dir = getClaudeConfigHomeDir();
|
|
449094
449270
|
if (!existsSync11(dir))
|
|
449095
|
-
|
|
449096
|
-
|
|
449271
|
+
mkdirSync11(dir, { recursive: true });
|
|
449272
|
+
writeFileSync8(getSnapshotPath(), JSON.stringify(data, null, 2), "utf8");
|
|
449097
449273
|
}
|
|
449098
449274
|
function extractRefreshToken(oauthTokenValue) {
|
|
449099
449275
|
const raw = oauthTokenValue?.trim();
|
|
@@ -449195,7 +449371,7 @@ var init_antigravityLocalSessions = __esm(() => {
|
|
|
449195
449371
|
|
|
449196
449372
|
// src/utils/antigravityLocalUsage.ts
|
|
449197
449373
|
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
449198
|
-
import { existsSync as existsSync12, mkdirSync as
|
|
449374
|
+
import { existsSync as existsSync12, mkdirSync as mkdirSync12, readdirSync as readdirSync4, readFileSync as readFileSync16, writeFileSync as writeFileSync9 } from "node:fs";
|
|
449199
449375
|
import { join as join124 } from "node:path";
|
|
449200
449376
|
import { homedir as homedir31, platform as platform6 } from "node:os";
|
|
449201
449377
|
function getConfigDir() {
|
|
@@ -449217,8 +449393,8 @@ function loadSnapshots() {
|
|
|
449217
449393
|
function saveSnapshots(data) {
|
|
449218
449394
|
const dir = getConfigDir();
|
|
449219
449395
|
if (!existsSync12(dir))
|
|
449220
|
-
|
|
449221
|
-
|
|
449396
|
+
mkdirSync12(dir, { recursive: true });
|
|
449397
|
+
writeFileSync9(getSnapshotPath2(), JSON.stringify(data, null, 2), "utf8");
|
|
449222
449398
|
}
|
|
449223
449399
|
function saveSnapshot(snapshot2) {
|
|
449224
449400
|
const data = loadSnapshots();
|
|
@@ -449705,14 +449881,14 @@ ${errorBody}`);
|
|
|
449705
449881
|
};
|
|
449706
449882
|
}
|
|
449707
449883
|
async function refreshCodexToken(refreshToken) {
|
|
449708
|
-
const res = await fetch(
|
|
449884
|
+
const res = await fetch(CODEX_TOKEN_URL3, {
|
|
449709
449885
|
method: "POST",
|
|
449710
449886
|
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
449711
|
-
body: new URLSearchParams({ client_id:
|
|
449887
|
+
body: new URLSearchParams({ client_id: CODEX_CLIENT_ID3, refresh_token: refreshToken, grant_type: "refresh_token" }).toString()
|
|
449712
449888
|
});
|
|
449713
449889
|
if (!res.ok) {
|
|
449714
449890
|
const errorBody = await res.text().catch(() => "unknown error");
|
|
449715
|
-
appendHttpLog("usage codex refresh error", `POST ${
|
|
449891
|
+
appendHttpLog("usage codex refresh error", `POST ${CODEX_TOKEN_URL3}
|
|
449716
449892
|
Content-Type: application/x-www-form-urlencoded`, `status=${res.status}
|
|
449717
449893
|
${errorBody}`);
|
|
449718
449894
|
if (res.status === 401) {
|
|
@@ -450330,7 +450506,7 @@ function UsageDashboard({ onDone }) {
|
|
|
450330
450506
|
]
|
|
450331
450507
|
}, undefined, true, undefined, this);
|
|
450332
450508
|
}
|
|
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",
|
|
450509
|
+
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
450510
|
return /* @__PURE__ */ jsx_dev_runtime278.jsxDEV(UsageDashboard, {
|
|
450335
450511
|
onDone: () => onDone(undefined, { display: "skip" })
|
|
450336
450512
|
}, undefined, false, undefined, this);
|
|
@@ -450364,7 +450540,7 @@ var init_usage3 = __esm(() => {
|
|
|
450364
450540
|
});
|
|
450365
450541
|
|
|
450366
450542
|
// src/utils/fallbackConfig.ts
|
|
450367
|
-
import { existsSync as existsSync13, readFileSync as readFileSync17, writeFileSync as
|
|
450543
|
+
import { existsSync as existsSync13, readFileSync as readFileSync17, writeFileSync as writeFileSync10 } from "node:fs";
|
|
450368
450544
|
import { join as join125 } from "node:path";
|
|
450369
450545
|
function getPath3() {
|
|
450370
450546
|
return join125(getClaudeConfigHomeDir(), "fallbacks.json");
|
|
@@ -450380,7 +450556,7 @@ function loadFallbackConfig() {
|
|
|
450380
450556
|
}
|
|
450381
450557
|
}
|
|
450382
450558
|
function saveFallbackConfig(config3) {
|
|
450383
|
-
|
|
450559
|
+
writeFileSync10(getPath3(), JSON.stringify(config3, null, 2), "utf-8");
|
|
450384
450560
|
}
|
|
450385
450561
|
function getFallbackOrder() {
|
|
450386
450562
|
return loadFallbackConfig().order;
|
|
@@ -464054,7 +464230,7 @@ var init_rewind = __esm(() => {
|
|
|
464054
464230
|
});
|
|
464055
464231
|
|
|
464056
464232
|
// src/utils/heapDumpService.ts
|
|
464057
|
-
import { createWriteStream as createWriteStream3, writeFileSync as
|
|
464233
|
+
import { createWriteStream as createWriteStream3, writeFileSync as writeFileSync11 } from "fs";
|
|
464058
464234
|
import { readdir as readdir25, readFile as readFile43, writeFile as writeFile37 } from "fs/promises";
|
|
464059
464235
|
import { join as join129 } from "path";
|
|
464060
464236
|
import { pipeline as pipeline2 } from "stream/promises";
|
|
@@ -464193,7 +464369,7 @@ async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
|
464193
464369
|
}
|
|
464194
464370
|
async function writeHeapSnapshot(filepath) {
|
|
464195
464371
|
if (typeof Bun !== "undefined") {
|
|
464196
|
-
|
|
464372
|
+
writeFileSync11(filepath, Bun.generateHeapSnapshot("v8", "arraybuffer"), {
|
|
464197
464373
|
mode: 384
|
|
464198
464374
|
});
|
|
464199
464375
|
Bun.gc(true);
|
|
@@ -464732,7 +464908,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
464732
464908
|
var call59 = async () => {
|
|
464733
464909
|
return {
|
|
464734
464910
|
type: "text",
|
|
464735
|
-
value: `${"99.0.0"} (built ${"2026-04-
|
|
464911
|
+
value: `${"99.0.0"} (built ${"2026-04-05T03:08:12.888Z"})`
|
|
464736
464912
|
};
|
|
464737
464913
|
}, version2, version_default;
|
|
464738
464914
|
var init_version = __esm(() => {
|
|
@@ -466828,7 +467004,7 @@ var init_advisor2 = __esm(() => {
|
|
|
466828
467004
|
// src/skills/bundledSkills.ts
|
|
466829
467005
|
import { constants as fsConstants5 } from "fs";
|
|
466830
467006
|
import { mkdir as mkdir35, open as open13 } from "fs/promises";
|
|
466831
|
-
import { dirname as
|
|
467007
|
+
import { dirname as dirname52, isAbsolute as isAbsolute24, join as join132, normalize as normalize13, sep as pathSep2 } from "path";
|
|
466832
467008
|
function registerBundledSkill(definition) {
|
|
466833
467009
|
const { files: files2 } = definition;
|
|
466834
467010
|
let skillRoot;
|
|
@@ -466892,7 +467068,7 @@ async function writeSkillFiles(dir, files2) {
|
|
|
466892
467068
|
const byParent = new Map;
|
|
466893
467069
|
for (const [relPath, content] of Object.entries(files2)) {
|
|
466894
467070
|
const target = resolveSkillFilePath(dir, relPath);
|
|
466895
|
-
const parent2 =
|
|
467071
|
+
const parent2 = dirname52(target);
|
|
466896
467072
|
const entry = [target, content];
|
|
466897
467073
|
const group = byParent.get(parent2);
|
|
466898
467074
|
if (group)
|
|
@@ -474863,7 +475039,7 @@ import {
|
|
|
474863
475039
|
unlink as unlink21,
|
|
474864
475040
|
writeFile as writeFile41
|
|
474865
475041
|
} from "fs/promises";
|
|
474866
|
-
import { basename as basename40, dirname as
|
|
475042
|
+
import { basename as basename40, dirname as dirname54, join as join139 } from "path";
|
|
474867
475043
|
function isTranscriptMessage(entry) {
|
|
474868
475044
|
return entry.type === "user" || entry.type === "assistant" || entry.type === "attachment" || entry.type === "system";
|
|
474869
475045
|
}
|
|
@@ -474908,7 +475084,7 @@ function getAgentMetadataPath(agentId) {
|
|
|
474908
475084
|
}
|
|
474909
475085
|
async function writeAgentMetadata(agentId, metadata) {
|
|
474910
475086
|
const path21 = getAgentMetadataPath(agentId);
|
|
474911
|
-
await mkdir38(
|
|
475087
|
+
await mkdir38(dirname54(path21), { recursive: true });
|
|
474912
475088
|
await writeFile41(path21, JSON.stringify(metadata));
|
|
474913
475089
|
}
|
|
474914
475090
|
async function readAgentMetadata(agentId) {
|
|
@@ -474931,7 +475107,7 @@ function getRemoteAgentMetadataPath(taskId) {
|
|
|
474931
475107
|
}
|
|
474932
475108
|
async function writeRemoteAgentMetadata(taskId, metadata) {
|
|
474933
475109
|
const path21 = getRemoteAgentMetadataPath(taskId);
|
|
474934
|
-
await mkdir38(
|
|
475110
|
+
await mkdir38(dirname54(path21), { recursive: true });
|
|
474935
475111
|
await writeFile41(path21, JSON.stringify(metadata));
|
|
474936
475112
|
}
|
|
474937
475113
|
async function readRemoteAgentMetadata(taskId) {
|
|
@@ -475120,7 +475296,7 @@ class Project {
|
|
|
475120
475296
|
try {
|
|
475121
475297
|
await fsAppendFile(filePath, data, { mode: 384 });
|
|
475122
475298
|
} catch {
|
|
475123
|
-
await mkdir38(
|
|
475299
|
+
await mkdir38(dirname54(filePath), { recursive: true, mode: 448 });
|
|
475124
475300
|
await fsAppendFile(filePath, data, { mode: 384 });
|
|
475125
475301
|
}
|
|
475126
475302
|
}
|
|
@@ -475719,7 +475895,7 @@ async function hydrateFromCCRv2InternalEvents(sessionId) {
|
|
|
475719
475895
|
}
|
|
475720
475896
|
for (const [agentId, entries] of byAgent) {
|
|
475721
475897
|
const agentFile = getAgentTranscriptPath(asAgentId(agentId));
|
|
475722
|
-
await mkdir38(
|
|
475898
|
+
await mkdir38(dirname54(agentFile), { recursive: true, mode: 448 });
|
|
475723
475899
|
const agentContent = entries.map((p) => jsonStringify(p) + `
|
|
475724
475900
|
`).join("");
|
|
475725
475901
|
await writeFile41(agentFile, agentContent, {
|
|
@@ -476256,7 +476432,7 @@ function appendEntryToFile(fullPath, entry) {
|
|
|
476256
476432
|
try {
|
|
476257
476433
|
fs5.appendFileSync(fullPath, line, { mode: 384 });
|
|
476258
476434
|
} catch {
|
|
476259
|
-
fs5.mkdirSync(
|
|
476435
|
+
fs5.mkdirSync(dirname54(fullPath), { mode: 448 });
|
|
476260
476436
|
fs5.appendFileSync(fullPath, line, { mode: 384 });
|
|
476261
476437
|
}
|
|
476262
476438
|
}
|
|
@@ -483184,7 +483360,7 @@ import {
|
|
|
483184
483360
|
symlink as symlink5,
|
|
483185
483361
|
utimes as utimes2
|
|
483186
483362
|
} from "fs/promises";
|
|
483187
|
-
import { basename as basename42, dirname as
|
|
483363
|
+
import { basename as basename42, dirname as dirname55, join as join143 } from "path";
|
|
483188
483364
|
function validateWorktreeSlug(slug) {
|
|
483189
483365
|
if (slug.length > MAX_WORKTREE_SLUG_LENGTH) {
|
|
483190
483366
|
throw new Error(`Invalid worktree name: must be ${MAX_WORKTREE_SLUG_LENGTH} characters or fewer (got ${slug.length})`);
|
|
@@ -483380,7 +483556,7 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
|
483380
483556
|
const srcPath = join143(repoRoot, relativePath2);
|
|
483381
483557
|
const destPath = join143(worktreePath, relativePath2);
|
|
483382
483558
|
try {
|
|
483383
|
-
await mkdir40(
|
|
483559
|
+
await mkdir40(dirname55(destPath), { recursive: true });
|
|
483384
483560
|
await copyFile10(srcPath, destPath);
|
|
483385
483561
|
copied.push(relativePath2);
|
|
483386
483562
|
} catch (e) {
|
|
@@ -483397,7 +483573,7 @@ async function performPostCreationSetup(repoRoot, worktreePath) {
|
|
|
483397
483573
|
const sourceSettingsLocal = join143(repoRoot, localSettingsRelativePath);
|
|
483398
483574
|
try {
|
|
483399
483575
|
const destSettingsLocal = join143(worktreePath, localSettingsRelativePath);
|
|
483400
|
-
await mkdirRecursive(
|
|
483576
|
+
await mkdirRecursive(dirname55(destSettingsLocal));
|
|
483401
483577
|
await copyFile10(sourceSettingsLocal, destSettingsLocal);
|
|
483402
483578
|
logForDebugging2(`Copied settings.local.json to worktree: ${destSettingsLocal}`);
|
|
483403
483579
|
} catch (e) {
|
|
@@ -524555,7 +524731,7 @@ __export(exports_asciicast, {
|
|
|
524555
524731
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
524556
524732
|
});
|
|
524557
524733
|
import { appendFile as appendFile7, rename as rename10 } from "fs/promises";
|
|
524558
|
-
import { basename as basename55, dirname as
|
|
524734
|
+
import { basename as basename55, dirname as dirname56, join as join149 } from "path";
|
|
524559
524735
|
function getRecordFilePath() {
|
|
524560
524736
|
if (recordingState.filePath !== null) {
|
|
524561
524737
|
return recordingState.filePath;
|
|
@@ -524637,7 +524813,7 @@ function installAsciicastRecorder() {
|
|
|
524637
524813
|
}
|
|
524638
524814
|
});
|
|
524639
524815
|
try {
|
|
524640
|
-
getFsImplementation().mkdirSync(
|
|
524816
|
+
getFsImplementation().mkdirSync(dirname56(filePath));
|
|
524641
524817
|
} catch {}
|
|
524642
524818
|
getFsImplementation().appendFileSync(filePath, header + `
|
|
524643
524819
|
`, { mode: 384 });
|
|
@@ -524706,7 +524882,7 @@ var init_asciicast = __esm(() => {
|
|
|
524706
524882
|
});
|
|
524707
524883
|
|
|
524708
524884
|
// src/utils/sessionRestore.ts
|
|
524709
|
-
import { dirname as
|
|
524885
|
+
import { dirname as dirname57 } from "path";
|
|
524710
524886
|
function extractTodosFromTranscript(messages) {
|
|
524711
524887
|
for (let i3 = messages.length - 1;i3 >= 0; i3--) {
|
|
524712
524888
|
const msg = messages[i3];
|
|
@@ -524831,7 +525007,7 @@ async function processResumedConversation(result, opts, context8) {
|
|
|
524831
525007
|
if (!opts.forkSession) {
|
|
524832
525008
|
const sid = opts.sessionIdOverride ?? result.sessionId;
|
|
524833
525009
|
if (sid) {
|
|
524834
|
-
switchSession(asSessionId(sid), opts.transcriptPath ?
|
|
525010
|
+
switchSession(asSessionId(sid), opts.transcriptPath ? dirname57(opts.transcriptPath) : null);
|
|
524835
525011
|
await renameRecordingForSession();
|
|
524836
525012
|
await resetSessionFilePointer();
|
|
524837
525013
|
restoreCostStateForSession(sid);
|
|
@@ -533526,7 +533702,7 @@ var exports_REPL = {};
|
|
|
533526
533702
|
__export(exports_REPL, {
|
|
533527
533703
|
REPL: () => REPL
|
|
533528
533704
|
});
|
|
533529
|
-
import { dirname as
|
|
533705
|
+
import { dirname as dirname58, join as join152 } from "path";
|
|
533530
533706
|
import { tmpdir as tmpdir11 } from "os";
|
|
533531
533707
|
import { writeFile as writeFile44 } from "fs/promises";
|
|
533532
533708
|
import { randomUUID as randomUUID47 } from "crypto";
|
|
@@ -534462,7 +534638,7 @@ function REPL({
|
|
|
534462
534638
|
const targetSessionCosts = getStoredSessionCosts(sessionId);
|
|
534463
534639
|
saveCurrentSessionCosts();
|
|
534464
534640
|
resetCostState();
|
|
534465
|
-
switchSession(asSessionId(sessionId), log2.fullPath ?
|
|
534641
|
+
switchSession(asSessionId(sessionId), log2.fullPath ? dirname58(log2.fullPath) : null);
|
|
534466
534642
|
const {
|
|
534467
534643
|
renameRecordingForSession: renameRecordingForSession2
|
|
534468
534644
|
} = await Promise.resolve().then(() => (init_asciicast(), exports_asciicast));
|
|
@@ -538185,7 +538361,7 @@ function WelcomeV2() {
|
|
|
538185
538361
|
dimColor: true,
|
|
538186
538362
|
children: [
|
|
538187
538363
|
"v",
|
|
538188
|
-
"0.9.
|
|
538364
|
+
"0.9.1",
|
|
538189
538365
|
" "
|
|
538190
538366
|
]
|
|
538191
538367
|
}, undefined, true, undefined, this)
|
|
@@ -538385,7 +538561,7 @@ function WelcomeV2() {
|
|
|
538385
538561
|
dimColor: true,
|
|
538386
538562
|
children: [
|
|
538387
538563
|
"v",
|
|
538388
|
-
"0.9.
|
|
538564
|
+
"0.9.1",
|
|
538389
538565
|
" "
|
|
538390
538566
|
]
|
|
538391
538567
|
}, undefined, true, undefined, this)
|
|
@@ -538611,7 +538787,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
538611
538787
|
dimColor: true,
|
|
538612
538788
|
children: [
|
|
538613
538789
|
"v",
|
|
538614
|
-
"0.9.
|
|
538790
|
+
"0.9.1",
|
|
538615
538791
|
" "
|
|
538616
538792
|
]
|
|
538617
538793
|
}, undefined, true, undefined, this);
|
|
@@ -538865,7 +539041,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
538865
539041
|
dimColor: true,
|
|
538866
539042
|
children: [
|
|
538867
539043
|
"v",
|
|
538868
|
-
"0.9.
|
|
539044
|
+
"0.9.1",
|
|
538869
539045
|
" "
|
|
538870
539046
|
]
|
|
538871
539047
|
}, undefined, true, undefined, this);
|
|
@@ -541541,7 +541717,7 @@ var exports_ResumeConversation = {};
|
|
|
541541
541717
|
__export(exports_ResumeConversation, {
|
|
541542
541718
|
ResumeConversation: () => ResumeConversation
|
|
541543
541719
|
});
|
|
541544
|
-
import { dirname as
|
|
541720
|
+
import { dirname as dirname59 } from "path";
|
|
541545
541721
|
function parsePrIdentifier(value) {
|
|
541546
541722
|
const directNumber = parseInt(value, 10);
|
|
541547
541723
|
if (!isNaN(directNumber) && directNumber > 0) {
|
|
@@ -541675,7 +541851,7 @@ function ResumeConversation({
|
|
|
541675
541851
|
}
|
|
541676
541852
|
if (false) {}
|
|
541677
541853
|
if (result_3.sessionId && !forkSession) {
|
|
541678
|
-
switchSession(asSessionId(result_3.sessionId), log_0.fullPath ?
|
|
541854
|
+
switchSession(asSessionId(result_3.sessionId), log_0.fullPath ? dirname59(log_0.fullPath) : null);
|
|
541679
541855
|
await renameRecordingForSession();
|
|
541680
541856
|
await resetSessionFilePointer();
|
|
541681
541857
|
restoreCostStateForSession(result_3.sessionId);
|
|
@@ -544839,7 +545015,7 @@ var init_createDirectConnectSession = __esm(() => {
|
|
|
544839
545015
|
});
|
|
544840
545016
|
|
|
544841
545017
|
// src/utils/errorLogSink.ts
|
|
544842
|
-
import { dirname as
|
|
545018
|
+
import { dirname as dirname60, join as join153 } from "path";
|
|
544843
545019
|
function getErrorsPath() {
|
|
544844
545020
|
return join153(CACHE_PATHS.errors(), DATE + ".jsonl");
|
|
544845
545021
|
}
|
|
@@ -544860,7 +545036,7 @@ function createJsonlWriter(options2) {
|
|
|
544860
545036
|
function getLogWriter(path23) {
|
|
544861
545037
|
let writer = logWriters.get(path23);
|
|
544862
545038
|
if (!writer) {
|
|
544863
|
-
const dir =
|
|
545039
|
+
const dir = dirname60(path23);
|
|
544864
545040
|
writer = createJsonlWriter({
|
|
544865
545041
|
writeFn: (content) => {
|
|
544866
545042
|
try {
|
|
@@ -549253,14 +549429,14 @@ __export(exports_bridgePointer, {
|
|
|
549253
549429
|
BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
|
|
549254
549430
|
});
|
|
549255
549431
|
import { mkdir as mkdir44, readFile as readFile51, stat as stat49, unlink as unlink25, writeFile as writeFile47 } from "fs/promises";
|
|
549256
|
-
import { dirname as
|
|
549432
|
+
import { dirname as dirname61, join as join157 } from "path";
|
|
549257
549433
|
function getBridgePointerPath(dir) {
|
|
549258
549434
|
return join157(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
|
|
549259
549435
|
}
|
|
549260
549436
|
async function writeBridgePointer(dir, pointer) {
|
|
549261
549437
|
const path23 = getBridgePointerPath(dir);
|
|
549262
549438
|
try {
|
|
549263
|
-
await mkdir44(
|
|
549439
|
+
await mkdir44(dirname61(path23), { recursive: true });
|
|
549264
549440
|
await writeFile47(path23, jsonStringify(pointer), "utf8");
|
|
549265
549441
|
logForDebugging2(`[bridge:pointer] wrote ${path23}`);
|
|
549266
549442
|
} catch (err3) {
|
|
@@ -551264,7 +551440,7 @@ __export(exports_print, {
|
|
|
551264
551440
|
canBatchWith: () => canBatchWith
|
|
551265
551441
|
});
|
|
551266
551442
|
import { readFile as readFile52, stat as stat50 } from "fs/promises";
|
|
551267
|
-
import { dirname as
|
|
551443
|
+
import { dirname as dirname62 } from "path";
|
|
551268
551444
|
import { cwd as cwd2 } from "process";
|
|
551269
551445
|
import { randomUUID as randomUUID53 } from "crypto";
|
|
551270
551446
|
function trackReceivedMessageUuid(uuid3) {
|
|
@@ -553699,7 +553875,7 @@ async function loadInitialMessages(setAppState, options2) {
|
|
|
553699
553875
|
if (false) {}
|
|
553700
553876
|
if (!options2.forkSession) {
|
|
553701
553877
|
if (result.sessionId) {
|
|
553702
|
-
switchSession(asSessionId(result.sessionId), result.fullPath ?
|
|
553878
|
+
switchSession(asSessionId(result.sessionId), result.fullPath ? dirname62(result.fullPath) : null);
|
|
553703
553879
|
if (persistSession) {
|
|
553704
553880
|
await resetSessionFilePointer();
|
|
553705
553881
|
}
|
|
@@ -553797,7 +553973,7 @@ async function loadInitialMessages(setAppState, options2) {
|
|
|
553797
553973
|
}
|
|
553798
553974
|
if (false) {}
|
|
553799
553975
|
if (!options2.forkSession && result.sessionId) {
|
|
553800
|
-
switchSession(asSessionId(result.sessionId), result.fullPath ?
|
|
553976
|
+
switchSession(asSessionId(result.sessionId), result.fullPath ? dirname62(result.fullPath) : null);
|
|
553801
553977
|
if (persistSession) {
|
|
553802
553978
|
await resetSessionFilePointer();
|
|
553803
553979
|
}
|
|
@@ -555617,7 +555793,7 @@ __export(exports_plugins, {
|
|
|
555617
555793
|
VALID_UPDATE_SCOPES: () => VALID_UPDATE_SCOPES,
|
|
555618
555794
|
VALID_INSTALLABLE_SCOPES: () => VALID_INSTALLABLE_SCOPES
|
|
555619
555795
|
});
|
|
555620
|
-
import { basename as basename57, dirname as
|
|
555796
|
+
import { basename as basename57, dirname as dirname63 } from "path";
|
|
555621
555797
|
function handleMarketplaceError(error42, action2) {
|
|
555622
555798
|
logError2(error42);
|
|
555623
555799
|
cliError(`${figures_default.cross} Failed to ${action2}: ${errorMessage(error42)}`);
|
|
@@ -555650,9 +555826,9 @@ async function pluginValidateHandler(manifestPath, options2) {
|
|
|
555650
555826
|
printValidationResult(result);
|
|
555651
555827
|
let contentResults = [];
|
|
555652
555828
|
if (result.fileType === "plugin") {
|
|
555653
|
-
const manifestDir =
|
|
555829
|
+
const manifestDir = dirname63(result.filePath);
|
|
555654
555830
|
if (basename57(manifestDir) === ".claude-plugin") {
|
|
555655
|
-
contentResults = await validatePluginContents(
|
|
555831
|
+
contentResults = await validatePluginContents(dirname63(manifestDir));
|
|
555656
555832
|
for (const r of contentResults) {
|
|
555657
555833
|
console.log(`Validating ${r.fileType}: ${r.filePath}
|
|
555658
555834
|
`);
|
|
@@ -558986,7 +559162,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
558986
559162
|
pendingHookMessages
|
|
558987
559163
|
}, renderAndRun);
|
|
558988
559164
|
}
|
|
558989
|
-
}).version("0.9.
|
|
559165
|
+
}).version("0.9.1 (Snowcode)", "-v, --version", "Output the version number");
|
|
558990
559166
|
program.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
558991
559167
|
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
559168
|
if (canUserConfigureAdvisor()) {
|
|
@@ -559547,7 +559723,7 @@ function validateProviderEnvOrExit() {
|
|
|
559547
559723
|
async function main2() {
|
|
559548
559724
|
const args = process.argv.slice(2);
|
|
559549
559725
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
559550
|
-
console.log(`${"0.9.
|
|
559726
|
+
console.log(`${"0.9.1"} (Snowcode)`);
|
|
559551
559727
|
return;
|
|
559552
559728
|
}
|
|
559553
559729
|
validateProviderEnvOrExit();
|
|
@@ -559636,4 +559812,4 @@ async function main2() {
|
|
|
559636
559812
|
}
|
|
559637
559813
|
main2();
|
|
559638
559814
|
|
|
559639
|
-
//# debugId=
|
|
559815
|
+
//# debugId=2D17C89FE5FFF28264756E2164756E21
|