snowcode 0.9.2 → 0.9.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +224 -164
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -125648,7 +125648,7 @@ var init_metadata = __esm(() => {
|
|
|
125648
125648
|
isClaudeAiAuth: isClaudeAISubscriber(),
|
|
125649
125649
|
version: "99.0.0",
|
|
125650
125650
|
versionBase: getVersionBase(),
|
|
125651
|
-
buildTime: "2026-04-05T03:
|
|
125651
|
+
buildTime: "2026-04-05T03:49:47.637Z",
|
|
125652
125652
|
deploymentEnvironment: env2.detectDeploymentEnvironment(),
|
|
125653
125653
|
...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
|
|
125654
125654
|
githubEventName: process.env.GITHUB_EVENT_NAME,
|
|
@@ -129989,7 +129989,6 @@ var init_antigravityOAuth = __esm(() => {
|
|
|
129989
129989
|
|
|
129990
129990
|
// src/services/api/providerConfig.ts
|
|
129991
129991
|
import { existsSync as existsSync7, mkdirSync as mkdirSync5, readFileSync as readFileSync9, writeFileSync as writeFileSync4 } from "node:fs";
|
|
129992
|
-
import { homedir as homedir11 } from "node:os";
|
|
129993
129992
|
import { dirname as dirname12, join as join29 } from "node:path";
|
|
129994
129993
|
function asTrimmedString(value) {
|
|
129995
129994
|
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
@@ -130344,10 +130343,7 @@ function resolveCodexAuthPath(env4 = process.env) {
|
|
|
130344
130343
|
const explicit = asTrimmedString(env4.CODEX_AUTH_JSON_PATH);
|
|
130345
130344
|
if (explicit)
|
|
130346
130345
|
return explicit;
|
|
130347
|
-
|
|
130348
|
-
if (codexHome)
|
|
130349
|
-
return join29(codexHome, "auth.json");
|
|
130350
|
-
return join29(homedir11(), ".codex", "auth.json");
|
|
130346
|
+
return join29(getClaudeConfigHomeDir(), "codex-auth.json");
|
|
130351
130347
|
}
|
|
130352
130348
|
function parseChatgptAccountId(token) {
|
|
130353
130349
|
if (!token)
|
|
@@ -130400,6 +130396,24 @@ function getPreferredCodexOauthAccount(accounts) {
|
|
|
130400
130396
|
return rightAddedAt - leftAddedAt;
|
|
130401
130397
|
})[0];
|
|
130402
130398
|
}
|
|
130399
|
+
function getCodexRefreshCandidates(options) {
|
|
130400
|
+
const candidates = [];
|
|
130401
|
+
const seen = new Set;
|
|
130402
|
+
const pushCandidate = (refreshToken, source, account) => {
|
|
130403
|
+
const trimmed = asTrimmedString(refreshToken);
|
|
130404
|
+
if (!trimmed || seen.has(trimmed))
|
|
130405
|
+
return;
|
|
130406
|
+
seen.add(trimmed);
|
|
130407
|
+
candidates.push({
|
|
130408
|
+
refreshToken: trimmed,
|
|
130409
|
+
source,
|
|
130410
|
+
account
|
|
130411
|
+
});
|
|
130412
|
+
};
|
|
130413
|
+
pushCandidate(options.preferredAccount?.refreshToken, "accounts", options.preferredAccount);
|
|
130414
|
+
pushCandidate(options.authJsonRefreshToken, "auth.json");
|
|
130415
|
+
return candidates;
|
|
130416
|
+
}
|
|
130403
130417
|
function getJwtExpiryTimeMs(token) {
|
|
130404
130418
|
if (!token)
|
|
130405
130419
|
return;
|
|
@@ -130553,12 +130567,15 @@ async function resolveCodexApiCredentialsForRequest(env4 = process.env) {
|
|
|
130553
130567
|
};
|
|
130554
130568
|
}
|
|
130555
130569
|
const preferredAccount = getPreferredCodexOauthAccount(loadAccounts().accounts);
|
|
130556
|
-
const
|
|
130557
|
-
|
|
130558
|
-
|
|
130570
|
+
const refreshCandidates = getCodexRefreshCandidates({
|
|
130571
|
+
authJsonRefreshToken,
|
|
130572
|
+
preferredAccount
|
|
130573
|
+
});
|
|
130574
|
+
for (const candidate of refreshCandidates) {
|
|
130575
|
+
const refreshed2 = await refreshCodexAccessToken(candidate.refreshToken);
|
|
130559
130576
|
if (refreshed2?.accessToken) {
|
|
130560
130577
|
const refreshedAccountId = envAccountId ?? parseChatgptAccountId(refreshed2.accessToken) ?? authJsonAccountId;
|
|
130561
|
-
const rotatedRefreshToken = refreshed2.refreshToken ?? refreshToken;
|
|
130578
|
+
const rotatedRefreshToken = refreshed2.refreshToken ?? candidate.refreshToken;
|
|
130562
130579
|
persistCodexAuthJson({
|
|
130563
130580
|
authPath,
|
|
130564
130581
|
existing: authJson,
|
|
@@ -130566,8 +130583,8 @@ async function resolveCodexApiCredentialsForRequest(env4 = process.env) {
|
|
|
130566
130583
|
accountId: refreshedAccountId,
|
|
130567
130584
|
refreshToken: rotatedRefreshToken
|
|
130568
130585
|
});
|
|
130569
|
-
if (
|
|
130570
|
-
updateAccount(
|
|
130586
|
+
if (candidate.account?.id && rotatedRefreshToken !== candidate.account.refreshToken) {
|
|
130587
|
+
updateAccount(candidate.account.id, {
|
|
130571
130588
|
refreshToken: rotatedRefreshToken
|
|
130572
130589
|
});
|
|
130573
130590
|
}
|
|
@@ -130576,8 +130593,8 @@ async function resolveCodexApiCredentialsForRequest(env4 = process.env) {
|
|
|
130576
130593
|
accountId: refreshedAccountId,
|
|
130577
130594
|
authPath,
|
|
130578
130595
|
refreshToken: rotatedRefreshToken,
|
|
130579
|
-
accountRecordId:
|
|
130580
|
-
source:
|
|
130596
|
+
accountRecordId: candidate.account?.id,
|
|
130597
|
+
source: candidate.source
|
|
130581
130598
|
};
|
|
130582
130599
|
}
|
|
130583
130600
|
}
|
|
@@ -130594,7 +130611,7 @@ async function resolveCodexApiCredentialsForRequest(env4 = process.env) {
|
|
|
130594
130611
|
apiKey: "",
|
|
130595
130612
|
accountId: authJsonAccountId ?? envAccountId,
|
|
130596
130613
|
authPath,
|
|
130597
|
-
refreshToken,
|
|
130614
|
+
refreshToken: refreshCandidates[0]?.refreshToken ?? authJsonRefreshToken,
|
|
130598
130615
|
accountRecordId: preferredAccount?.id,
|
|
130599
130616
|
source: "none"
|
|
130600
130617
|
};
|
|
@@ -130603,6 +130620,7 @@ var DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1", DEFAULT_CODEX_BASE_UR
|
|
|
130603
130620
|
var init_providerConfig = __esm(() => {
|
|
130604
130621
|
init_accountManager();
|
|
130605
130622
|
init_antigravityOAuth();
|
|
130623
|
+
init_envUtils();
|
|
130606
130624
|
init_providerMetadata();
|
|
130607
130625
|
ANTIGRAVITY_FALLBACK_BASE_URLS = [
|
|
130608
130626
|
"https://daily-cloudcode-pa.googleapis.com",
|
|
@@ -130640,9 +130658,34 @@ var init_providerConfig = __esm(() => {
|
|
|
130640
130658
|
|
|
130641
130659
|
// src/utils/updateCheck.ts
|
|
130642
130660
|
import { existsSync as existsSync8, mkdirSync as mkdirSync6, readFileSync as readFileSync10, writeFileSync as writeFileSync5 } from "node:fs";
|
|
130661
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
130643
130662
|
import { join as join30 } from "node:path";
|
|
130663
|
+
function normalizeVersion(version2) {
|
|
130664
|
+
return version2.replace(/[^0-9.]/g, "").split(".").filter(Boolean).map((part) => Number(part) || 0);
|
|
130665
|
+
}
|
|
130666
|
+
function compareVersions(a2, b) {
|
|
130667
|
+
const av = normalizeVersion(a2);
|
|
130668
|
+
const bv = normalizeVersion(b);
|
|
130669
|
+
const len = Math.max(av.length, bv.length, 3);
|
|
130670
|
+
for (let i2 = 0;i2 < len; i2++) {
|
|
130671
|
+
const ai = av[i2] ?? 0;
|
|
130672
|
+
const bi = bv[i2] ?? 0;
|
|
130673
|
+
if (ai > bi)
|
|
130674
|
+
return 1;
|
|
130675
|
+
if (ai < bi)
|
|
130676
|
+
return -1;
|
|
130677
|
+
}
|
|
130678
|
+
return 0;
|
|
130679
|
+
}
|
|
130644
130680
|
function getCurrentVersion() {
|
|
130645
|
-
const displayVersion = (typeof MACRO !== "undefined" ? "0.9.
|
|
130681
|
+
const displayVersion = (typeof MACRO !== "undefined" ? "0.9.21" : undefined) ?? (() => {
|
|
130682
|
+
try {
|
|
130683
|
+
const pkg = require2("../../package.json");
|
|
130684
|
+
return pkg.version;
|
|
130685
|
+
} catch {
|
|
130686
|
+
return;
|
|
130687
|
+
}
|
|
130688
|
+
})() ?? "0.0.0";
|
|
130646
130689
|
return displayVersion.replace(/[^0-9.]/g, "") || "0.0.0";
|
|
130647
130690
|
}
|
|
130648
130691
|
function cachePath() {
|
|
@@ -130686,21 +130729,13 @@ async function fetchLatestVersion(timeoutMs) {
|
|
|
130686
130729
|
function getAvailableUpdate(cache2) {
|
|
130687
130730
|
if (!cache2)
|
|
130688
130731
|
return null;
|
|
130689
|
-
|
|
130690
|
-
const lat = cache2.latestVersion.split(".").map(Number);
|
|
130691
|
-
for (let i2 = 0;i2 < 3; i2++) {
|
|
130692
|
-
const c5 = cur[i2] ?? 0;
|
|
130693
|
-
const l = lat[i2] ?? 0;
|
|
130694
|
-
if (l > c5)
|
|
130695
|
-
return cache2.latestVersion;
|
|
130696
|
-
if (c5 > l)
|
|
130697
|
-
return null;
|
|
130698
|
-
}
|
|
130699
|
-
return null;
|
|
130732
|
+
return compareVersions(cache2.latestVersion, getCurrentVersion()) > 0 ? cache2.latestVersion : null;
|
|
130700
130733
|
}
|
|
130701
130734
|
async function refreshUpdateCache(options) {
|
|
130702
130735
|
const cache2 = readUpdateCache();
|
|
130703
|
-
|
|
130736
|
+
const currentVersion = getCurrentVersion();
|
|
130737
|
+
const canReuseFreshCache = isUpdateCacheFresh(cache2) && (!cache2 || compareVersions(cache2.latestVersion, currentVersion) >= 0);
|
|
130738
|
+
if (!options?.force && canReuseFreshCache) {
|
|
130704
130739
|
return cache2;
|
|
130705
130740
|
}
|
|
130706
130741
|
const latestVersion = await fetchLatestVersion(options?.timeoutMs ?? 5000);
|
|
@@ -130718,10 +130753,11 @@ async function getAvailableUpdateWithRefresh(options) {
|
|
|
130718
130753
|
const cache2 = await refreshUpdateCache(options);
|
|
130719
130754
|
return getAvailableUpdate(cache2);
|
|
130720
130755
|
}
|
|
130721
|
-
var PKG_NAME = "snowcode", CHECK_INTERVAL_MS;
|
|
130756
|
+
var PKG_NAME = "snowcode", CHECK_INTERVAL_MS, require2;
|
|
130722
130757
|
var init_updateCheck = __esm(() => {
|
|
130723
130758
|
init_envUtils();
|
|
130724
130759
|
CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;
|
|
130760
|
+
require2 = createRequire2(import.meta.url);
|
|
130725
130761
|
});
|
|
130726
130762
|
|
|
130727
130763
|
// src/components/StartupScreen.ts
|
|
@@ -130857,7 +130893,7 @@ async function printStartupScreen() {
|
|
|
130857
130893
|
const sLen = ` ● ${sL} Ready — type /help to begin`.length;
|
|
130858
130894
|
out.push(boxRow(sRow, W2, sLen));
|
|
130859
130895
|
out.push(`${rgb(...BORDER)}╚${"═".repeat(W2 - 2)}╝${RESET}`);
|
|
130860
|
-
const _ver = "0.9.
|
|
130896
|
+
const _ver = "0.9.21";
|
|
130861
130897
|
const _update = await getAvailableUpdateWithRefresh({ timeoutMs: 1200 });
|
|
130862
130898
|
out.push(` ${DIM}${rgb(...DIMCOL)}snowcode v${_ver}${RESET}`);
|
|
130863
130899
|
if (_update) {
|
|
@@ -171930,7 +171966,7 @@ var init_frontmatterParser = __esm(() => {
|
|
|
171930
171966
|
|
|
171931
171967
|
// src/utils/ripgrep.ts
|
|
171932
171968
|
import { execFile as execFile3, spawn as spawn2 } from "child_process";
|
|
171933
|
-
import { homedir as
|
|
171969
|
+
import { homedir as homedir11 } from "os";
|
|
171934
171970
|
import * as path11 from "path";
|
|
171935
171971
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
171936
171972
|
function ripgrepCommand() {
|
|
@@ -172201,7 +172237,7 @@ var init_ripgrep = __esm(() => {
|
|
|
172201
172237
|
}
|
|
172202
172238
|
};
|
|
172203
172239
|
countFilesRoundedRg = memoize_default(async (dirPath, abortSignal, ignorePatterns = []) => {
|
|
172204
|
-
if (path11.resolve(dirPath) === path11.resolve(
|
|
172240
|
+
if (path11.resolve(dirPath) === path11.resolve(homedir11())) {
|
|
172205
172241
|
return;
|
|
172206
172242
|
}
|
|
172207
172243
|
try {
|
|
@@ -172295,7 +172331,7 @@ var init_pluginOnlyPolicy = __esm(() => {
|
|
|
172295
172331
|
// src/utils/markdownConfigLoader.ts
|
|
172296
172332
|
import { statSync as statSync4 } from "fs";
|
|
172297
172333
|
import { lstat as lstat3, readdir as readdir7, readFile as readFile7, realpath as realpath5, stat as stat13 } from "fs/promises";
|
|
172298
|
-
import { homedir as
|
|
172334
|
+
import { homedir as homedir12 } from "os";
|
|
172299
172335
|
import { dirname as dirname17, join as join34, resolve as resolve13, sep as sep6 } from "path";
|
|
172300
172336
|
function extractDescriptionFromMarkdown(content, defaultDescription = "Custom item") {
|
|
172301
172337
|
const lines = content.split(`
|
|
@@ -172378,7 +172414,7 @@ function resolveStopBoundary(cwd2) {
|
|
|
172378
172414
|
return cwdGitRoot;
|
|
172379
172415
|
}
|
|
172380
172416
|
function getProjectDirsUpToHome(subdir, cwd2) {
|
|
172381
|
-
const home = resolve13(
|
|
172417
|
+
const home = resolve13(homedir12()).normalize("NFC");
|
|
172382
172418
|
const gitRoot = resolveStopBoundary(cwd2);
|
|
172383
172419
|
let current = resolve13(cwd2);
|
|
172384
172420
|
const dirs = [];
|
|
@@ -174939,7 +174975,7 @@ var init_readOnlyCommandValidation = __esm(() => {
|
|
|
174939
174975
|
});
|
|
174940
174976
|
|
|
174941
174977
|
// src/utils/permissions/pathValidation.ts
|
|
174942
|
-
import { homedir as
|
|
174978
|
+
import { homedir as homedir13 } from "os";
|
|
174943
174979
|
import { dirname as dirname18, isAbsolute as isAbsolute6, resolve as resolve15 } from "path";
|
|
174944
174980
|
function formatDirectoryList(directories) {
|
|
174945
174981
|
const dirCount = directories.length;
|
|
@@ -174962,7 +174998,7 @@ function getGlobBaseDirectory(path12) {
|
|
|
174962
174998
|
}
|
|
174963
174999
|
function expandTilde(path12) {
|
|
174964
175000
|
if (path12 === "~" || path12.startsWith("~/") || process.platform === "win32" && path12.startsWith("~\\")) {
|
|
174965
|
-
return
|
|
175001
|
+
return homedir13() + path12.slice(1);
|
|
174966
175002
|
}
|
|
174967
175003
|
return path12;
|
|
174968
175004
|
}
|
|
@@ -175079,7 +175115,7 @@ function isDangerousRemovalPath(resolvedPath) {
|
|
|
175079
175115
|
if (WINDOWS_DRIVE_ROOT_REGEX.test(normalizedPath)) {
|
|
175080
175116
|
return true;
|
|
175081
175117
|
}
|
|
175082
|
-
const normalizedHome =
|
|
175118
|
+
const normalizedHome = homedir13().replace(/[\\/]+/g, "/");
|
|
175083
175119
|
if (normalizedPath === normalizedHome) {
|
|
175084
175120
|
return true;
|
|
175085
175121
|
}
|
|
@@ -175779,7 +175815,7 @@ __export(exports_esm, {
|
|
|
175779
175815
|
AsyncDecompress: () => AsyncDecompress,
|
|
175780
175816
|
AsyncCompress: () => AsyncGzip
|
|
175781
175817
|
});
|
|
175782
|
-
import { createRequire as
|
|
175818
|
+
import { createRequire as createRequire3 } from "module";
|
|
175783
175819
|
function StrmOpt(opts, cb) {
|
|
175784
175820
|
if (typeof opts == "function")
|
|
175785
175821
|
cb = opts, opts = {};
|
|
@@ -176216,7 +176252,7 @@ function unzipSync(data, opts) {
|
|
|
176216
176252
|
}
|
|
176217
176253
|
return files;
|
|
176218
176254
|
}
|
|
176219
|
-
var
|
|
176255
|
+
var require3, Worker, workerAdd = ";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global", wk, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) {
|
|
176220
176256
|
var b = new u16(31);
|
|
176221
176257
|
for (var i2 = 0;i2 < 31; ++i2) {
|
|
176222
176258
|
b[i2] = start += 1 << eb[i2 - 1];
|
|
@@ -177034,9 +177070,9 @@ var require2, Worker, workerAdd = ";var __w=require('worker_threads');__w.parent
|
|
|
177034
177070
|
wbytes(o2, b + 16, e);
|
|
177035
177071
|
}, ZipPassThrough, ZipDeflate, AsyncZipDeflate, Zip, UnzipPassThrough, UnzipInflate, AsyncUnzipInflate, Unzip, mt;
|
|
177036
177072
|
var init_esm4 = __esm(() => {
|
|
177037
|
-
|
|
177073
|
+
require3 = createRequire3("/");
|
|
177038
177074
|
try {
|
|
177039
|
-
Worker =
|
|
177075
|
+
Worker = require3("worker_threads").Worker;
|
|
177040
177076
|
} catch (e) {}
|
|
177041
177077
|
wk = Worker ? function(c6, _, msg, transfer, cb) {
|
|
177042
177078
|
var done = false;
|
|
@@ -178026,11 +178062,11 @@ var init_zip = __esm(() => {
|
|
|
178026
178062
|
});
|
|
178027
178063
|
|
|
178028
178064
|
// src/utils/systemDirectories.ts
|
|
178029
|
-
import { homedir as
|
|
178065
|
+
import { homedir as homedir14 } from "os";
|
|
178030
178066
|
import { join as join38 } from "path";
|
|
178031
178067
|
function getSystemDirectories(options) {
|
|
178032
178068
|
const platform2 = options?.platform ?? getPlatform();
|
|
178033
|
-
const homeDir = options?.homedir ??
|
|
178069
|
+
const homeDir = options?.homedir ?? homedir14();
|
|
178034
178070
|
const env4 = options?.env ?? process.env;
|
|
178035
178071
|
const defaults2 = {
|
|
178036
178072
|
HOME: homeDir,
|
|
@@ -236972,7 +237008,7 @@ var init_sedValidation = __esm(() => {
|
|
|
236972
237008
|
});
|
|
236973
237009
|
|
|
236974
237010
|
// src/tools/BashTool/pathValidation.ts
|
|
236975
|
-
import { homedir as
|
|
237011
|
+
import { homedir as homedir15 } from "os";
|
|
236976
237012
|
import { isAbsolute as isAbsolute10, resolve as resolve16 } from "path";
|
|
236977
237013
|
function checkDangerousRemovalPaths(command, args, cwd2) {
|
|
236978
237014
|
const extractor = PATH_EXTRACTORS[command];
|
|
@@ -237421,7 +237457,7 @@ var init_pathValidation2 = __esm(() => {
|
|
|
237421
237457
|
init_bashPermissions();
|
|
237422
237458
|
init_sedValidation();
|
|
237423
237459
|
PATH_EXTRACTORS = {
|
|
237424
|
-
cd: (args) => args.length === 0 ? [
|
|
237460
|
+
cd: (args) => args.length === 0 ? [homedir15()] : [args.join(" ")],
|
|
237425
237461
|
ls: (args) => {
|
|
237426
237462
|
const paths2 = filterOutFlags(args);
|
|
237427
237463
|
return paths2.length > 0 ? paths2 : ["."];
|
|
@@ -259350,11 +259386,11 @@ var init_oauthPort = __esm(() => {
|
|
|
259350
259386
|
// src/utils/claudeInChrome/common.ts
|
|
259351
259387
|
import { readdirSync as readdirSync3 } from "fs";
|
|
259352
259388
|
import { stat as stat17 } from "fs/promises";
|
|
259353
|
-
import { homedir as
|
|
259389
|
+
import { homedir as homedir16, platform as platform2, tmpdir as tmpdir2, userInfo as userInfo3 } from "os";
|
|
259354
259390
|
import { join as join48 } from "path";
|
|
259355
259391
|
function getAllBrowserDataPaths() {
|
|
259356
259392
|
const platform3 = getPlatform();
|
|
259357
|
-
const home =
|
|
259393
|
+
const home = homedir16();
|
|
259358
259394
|
const paths2 = [];
|
|
259359
259395
|
for (const browserId of BROWSER_DETECTION_ORDER) {
|
|
259360
259396
|
const config2 = CHROMIUM_BROWSERS[browserId];
|
|
@@ -259389,7 +259425,7 @@ function getAllBrowserDataPaths() {
|
|
|
259389
259425
|
}
|
|
259390
259426
|
function getAllNativeMessagingHostsDirs() {
|
|
259391
259427
|
const platform3 = getPlatform();
|
|
259392
|
-
const home =
|
|
259428
|
+
const home = homedir16();
|
|
259393
259429
|
const paths2 = [];
|
|
259394
259430
|
for (const browserId of BROWSER_DETECTION_ORDER) {
|
|
259395
259431
|
const config2 = CHROMIUM_BROWSERS[browserId];
|
|
@@ -259460,7 +259496,7 @@ async function detectAvailableBrowser() {
|
|
|
259460
259496
|
break;
|
|
259461
259497
|
}
|
|
259462
259498
|
case "windows": {
|
|
259463
|
-
const home =
|
|
259499
|
+
const home = homedir16();
|
|
259464
259500
|
if (config2.windows.dataPath.length > 0) {
|
|
259465
259501
|
const appDataBase = config2.windows.useRoaming ? join48(home, "AppData", "Roaming") : join48(home, "AppData", "Local");
|
|
259466
259502
|
const dataPath = join48(appDataBase, ...config2.windows.dataPath);
|
|
@@ -264364,10 +264400,10 @@ var init_capitalize = __esm(() => {
|
|
|
264364
264400
|
});
|
|
264365
264401
|
|
|
264366
264402
|
// src/utils/jetbrains.ts
|
|
264367
|
-
import { homedir as
|
|
264403
|
+
import { homedir as homedir17, platform as platform3 } from "os";
|
|
264368
264404
|
import { join as join55 } from "path";
|
|
264369
264405
|
function buildCommonPluginDirectoryPaths(ideName) {
|
|
264370
|
-
const homeDir =
|
|
264406
|
+
const homeDir = homedir17();
|
|
264371
264407
|
const directories = [];
|
|
264372
264408
|
const idePatterns = ideNameToDirMap[ideName.toLowerCase()];
|
|
264373
264409
|
if (!idePatterns) {
|
|
@@ -283079,7 +283115,7 @@ var init_shellConfig = __esm(() => {
|
|
|
283079
283115
|
// src/utils/autoUpdater.ts
|
|
283080
283116
|
import { constants as fsConstants2 } from "fs";
|
|
283081
283117
|
import { access as access2, writeFile as writeFile10 } from "fs/promises";
|
|
283082
|
-
import { homedir as
|
|
283118
|
+
import { homedir as homedir19 } from "os";
|
|
283083
283119
|
import { join as join63 } from "path";
|
|
283084
283120
|
async function assertMinVersion() {
|
|
283085
283121
|
if (false) {}
|
|
@@ -283216,10 +283252,10 @@ async function getInstallationPrefix() {
|
|
|
283216
283252
|
let prefixResult = null;
|
|
283217
283253
|
if (isBun) {
|
|
283218
283254
|
prefixResult = await execFileNoThrowWithCwd("bun", ["pm", "bin", "-g"], {
|
|
283219
|
-
cwd:
|
|
283255
|
+
cwd: homedir19()
|
|
283220
283256
|
});
|
|
283221
283257
|
} else {
|
|
283222
|
-
prefixResult = await execFileNoThrowWithCwd("npm", ["-g", "config", "get", "prefix"], { cwd:
|
|
283258
|
+
prefixResult = await execFileNoThrowWithCwd("npm", ["-g", "config", "get", "prefix"], { cwd: homedir19() });
|
|
283223
283259
|
}
|
|
283224
283260
|
if (prefixResult.code !== 0) {
|
|
283225
283261
|
logError2(new Error(`Failed to check ${isBun ? "bun" : "npm"} permissions`));
|
|
@@ -283247,7 +283283,7 @@ async function checkGlobalInstallPermissions() {
|
|
|
283247
283283
|
}
|
|
283248
283284
|
async function getLatestVersion(channel) {
|
|
283249
283285
|
const npmTag = channel === "stable" ? "stable" : "latest";
|
|
283250
|
-
const result = await execFileNoThrowWithCwd("npm", ["view", `${"snowcode"}@${npmTag}`, "version", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd:
|
|
283286
|
+
const result = await execFileNoThrowWithCwd("npm", ["view", `${"snowcode"}@${npmTag}`, "version", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir19() });
|
|
283251
283287
|
if (result.code !== 0) {
|
|
283252
283288
|
logForDebugging2(`npm view failed with code ${result.code}`);
|
|
283253
283289
|
if (result.stderr) {
|
|
@@ -283263,7 +283299,7 @@ async function getLatestVersion(channel) {
|
|
|
283263
283299
|
return result.stdout.trim();
|
|
283264
283300
|
}
|
|
283265
283301
|
async function getNpmDistTags() {
|
|
283266
|
-
const result = await execFileNoThrowWithCwd("npm", ["view", "snowcode", "dist-tags", "--json", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd:
|
|
283302
|
+
const result = await execFileNoThrowWithCwd("npm", ["view", "snowcode", "dist-tags", "--json", "--prefer-online"], { abortSignal: AbortSignal.timeout(5000), cwd: homedir19() });
|
|
283267
283303
|
if (result.code !== 0) {
|
|
283268
283304
|
logForDebugging2(`npm view dist-tags failed with code ${result.code}`);
|
|
283269
283305
|
return { latest: null, stable: null };
|
|
@@ -283333,7 +283369,7 @@ To fix this issue:
|
|
|
283333
283369
|
}
|
|
283334
283370
|
const packageSpec = specificVersion ? `${"snowcode"}@${specificVersion}` : "snowcode";
|
|
283335
283371
|
const packageManager = env2.isRunningWithBun() ? "bun" : "npm";
|
|
283336
|
-
const installResult = await execFileNoThrowWithCwd(packageManager, ["install", "-g", packageSpec], { cwd:
|
|
283372
|
+
const installResult = await execFileNoThrowWithCwd(packageManager, ["install", "-g", packageSpec], { cwd: homedir19() });
|
|
283337
283373
|
if (installResult.code !== 0) {
|
|
283338
283374
|
const error42 = new AutoUpdaterError(`Failed to install new version of claude: ${installResult.stdout} ${installResult.stderr}`);
|
|
283339
283375
|
logError2(error42);
|
|
@@ -283570,7 +283606,7 @@ var init_packageManagers = __esm(() => {
|
|
|
283570
283606
|
|
|
283571
283607
|
// src/utils/doctorDiagnostic.ts
|
|
283572
283608
|
import { readFile as readFile13, realpath as realpath6 } from "fs/promises";
|
|
283573
|
-
import { homedir as
|
|
283609
|
+
import { homedir as homedir20 } from "os";
|
|
283574
283610
|
import { delimiter as delimiter2, join as join64, posix as posix3, win32 } from "path";
|
|
283575
283611
|
function getNormalizedPaths() {
|
|
283576
283612
|
let invokedPath = process.argv[1] || "";
|
|
@@ -283634,8 +283670,8 @@ async function getInstallationPath() {
|
|
|
283634
283670
|
}
|
|
283635
283671
|
} catch {}
|
|
283636
283672
|
try {
|
|
283637
|
-
await getFsImplementation().stat(join64(
|
|
283638
|
-
return join64(
|
|
283673
|
+
await getFsImplementation().stat(join64(homedir20(), ".local/bin/claude"));
|
|
283674
|
+
return join64(homedir20(), ".local/bin/claude");
|
|
283639
283675
|
} catch {}
|
|
283640
283676
|
return "native";
|
|
283641
283677
|
}
|
|
@@ -283658,7 +283694,7 @@ function getInvokedBinary() {
|
|
|
283658
283694
|
async function detectMultipleInstallations() {
|
|
283659
283695
|
const fs3 = getFsImplementation();
|
|
283660
283696
|
const installations = [];
|
|
283661
|
-
const localPath = join64(
|
|
283697
|
+
const localPath = join64(homedir20(), ".claude", "local");
|
|
283662
283698
|
if (await localInstallationExists()) {
|
|
283663
283699
|
installations.push({ type: "npm-local", path: localPath });
|
|
283664
283700
|
}
|
|
@@ -283705,14 +283741,14 @@ async function detectMultipleInstallations() {
|
|
|
283705
283741
|
}
|
|
283706
283742
|
}
|
|
283707
283743
|
}
|
|
283708
|
-
const nativeBinPath = join64(
|
|
283744
|
+
const nativeBinPath = join64(homedir20(), ".local", "bin", "claude");
|
|
283709
283745
|
try {
|
|
283710
283746
|
await fs3.stat(nativeBinPath);
|
|
283711
283747
|
installations.push({ type: "native", path: nativeBinPath });
|
|
283712
283748
|
} catch {}
|
|
283713
283749
|
const config2 = getGlobalConfig();
|
|
283714
283750
|
if (config2.installMethod === "native") {
|
|
283715
|
-
const nativeDataPath = join64(
|
|
283751
|
+
const nativeDataPath = join64(homedir20(), ".local", "share", "claude");
|
|
283716
283752
|
try {
|
|
283717
283753
|
await fs3.stat(nativeDataPath);
|
|
283718
283754
|
if (!installations.some((i3) => i3.type === "native")) {
|
|
@@ -283752,7 +283788,7 @@ async function detectConfigurationIssues(type) {
|
|
|
283752
283788
|
if (type === "native") {
|
|
283753
283789
|
const path12 = process.env.PATH || "";
|
|
283754
283790
|
const pathDirectories = path12.split(delimiter2);
|
|
283755
|
-
const homeDir =
|
|
283791
|
+
const homeDir = homedir20();
|
|
283756
283792
|
const localBinPath = join64(homeDir, ".local", "bin");
|
|
283757
283793
|
let normalizedLocalBinPath = localBinPath;
|
|
283758
283794
|
if (getPlatform() === "windows") {
|
|
@@ -283779,7 +283815,7 @@ async function detectConfigurationIssues(type) {
|
|
|
283779
283815
|
const shellType = getShellType();
|
|
283780
283816
|
const configPaths = getShellConfigPaths();
|
|
283781
283817
|
const configFile = configPaths[shellType];
|
|
283782
|
-
const displayPath = configFile ? configFile.replace(
|
|
283818
|
+
const displayPath = configFile ? configFile.replace(homedir20(), "~") : "your shell config file";
|
|
283783
283819
|
warnings.push({
|
|
283784
283820
|
issue: "Native installation exists but ~/.local/bin is not in your PATH",
|
|
283785
283821
|
fix: `Run: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ${displayPath} then open a new terminal or run: source ${displayPath}`
|
|
@@ -284518,7 +284554,7 @@ import {
|
|
|
284518
284554
|
unlink as unlink7,
|
|
284519
284555
|
writeFile as writeFile12
|
|
284520
284556
|
} from "fs/promises";
|
|
284521
|
-
import { homedir as
|
|
284557
|
+
import { homedir as homedir21 } from "os";
|
|
284522
284558
|
import { basename as basename14, delimiter as delimiter3, dirname as dirname26, join as join68, resolve as resolve19 } from "path";
|
|
284523
284559
|
function getPlatform2() {
|
|
284524
284560
|
const os4 = env2.platform;
|
|
@@ -285046,7 +285082,7 @@ async function checkInstall(force = false) {
|
|
|
285046
285082
|
const shellType = getShellType();
|
|
285047
285083
|
const configPaths = getShellConfigPaths();
|
|
285048
285084
|
const configFile = configPaths[shellType];
|
|
285049
|
-
const displayPath = configFile ? configFile.replace(
|
|
285085
|
+
const displayPath = configFile ? configFile.replace(homedir21(), "~") : "your shell config file";
|
|
285050
285086
|
messages.push({
|
|
285051
285087
|
message: `Native installation exists but ~/.local/bin is not in your PATH. Run:
|
|
285052
285088
|
|
|
@@ -285547,7 +285583,7 @@ async function cleanupNpmInstallations() {
|
|
|
285547
285583
|
errors4.push(macroPackageResult.error);
|
|
285548
285584
|
}
|
|
285549
285585
|
}
|
|
285550
|
-
const localInstallDir = join68(
|
|
285586
|
+
const localInstallDir = join68(homedir21(), ".claude", "local");
|
|
285551
285587
|
try {
|
|
285552
285588
|
await rm3(localInstallDir, { recursive: true });
|
|
285553
285589
|
removed++;
|
|
@@ -291856,7 +291892,7 @@ var init_InProcessBackend = __esm(() => {
|
|
|
291856
291892
|
});
|
|
291857
291893
|
|
|
291858
291894
|
// src/utils/swarm/backends/it2Setup.ts
|
|
291859
|
-
import { homedir as
|
|
291895
|
+
import { homedir as homedir22 } from "os";
|
|
291860
291896
|
async function detectPythonPackageManager() {
|
|
291861
291897
|
const uvResult = await execFileNoThrow("which", ["uv"]);
|
|
291862
291898
|
if (uvResult.code === 0) {
|
|
@@ -291891,18 +291927,18 @@ async function installIt2(packageManager) {
|
|
|
291891
291927
|
switch (packageManager) {
|
|
291892
291928
|
case "uvx":
|
|
291893
291929
|
result = await execFileNoThrowWithCwd("uv", ["tool", "install", "it2"], {
|
|
291894
|
-
cwd:
|
|
291930
|
+
cwd: homedir22()
|
|
291895
291931
|
});
|
|
291896
291932
|
break;
|
|
291897
291933
|
case "pipx":
|
|
291898
291934
|
result = await execFileNoThrowWithCwd("pipx", ["install", "it2"], {
|
|
291899
|
-
cwd:
|
|
291935
|
+
cwd: homedir22()
|
|
291900
291936
|
});
|
|
291901
291937
|
break;
|
|
291902
291938
|
case "pip":
|
|
291903
|
-
result = await execFileNoThrowWithCwd("pip", ["install", "--user", "it2"], { cwd:
|
|
291939
|
+
result = await execFileNoThrowWithCwd("pip", ["install", "--user", "it2"], { cwd: homedir22() });
|
|
291904
291940
|
if (result.code !== 0) {
|
|
291905
|
-
result = await execFileNoThrowWithCwd("pip3", ["install", "--user", "it2"], { cwd:
|
|
291941
|
+
result = await execFileNoThrowWithCwd("pip3", ["install", "--user", "it2"], { cwd: homedir22() });
|
|
291906
291942
|
}
|
|
291907
291943
|
break;
|
|
291908
291944
|
}
|
|
@@ -322940,7 +322976,7 @@ var init_modeValidation = __esm(() => {
|
|
|
322940
322976
|
});
|
|
322941
322977
|
|
|
322942
322978
|
// src/tools/PowerShellTool/pathValidation.ts
|
|
322943
|
-
import { homedir as
|
|
322979
|
+
import { homedir as homedir24 } from "os";
|
|
322944
322980
|
import { isAbsolute as isAbsolute16, resolve as resolve25 } from "path";
|
|
322945
322981
|
function matchesParam(paramLower, paramList) {
|
|
322946
322982
|
for (const p of paramList) {
|
|
@@ -322963,7 +322999,7 @@ function formatDirectoryList2(directories) {
|
|
|
322963
322999
|
}
|
|
322964
323000
|
function expandTilde2(filePath) {
|
|
322965
323001
|
if (filePath === "~" || filePath.startsWith("~/") || filePath.startsWith("~\\")) {
|
|
322966
|
-
return
|
|
323002
|
+
return homedir24() + filePath.slice(1);
|
|
322967
323003
|
}
|
|
322968
323004
|
return filePath;
|
|
322969
323005
|
}
|
|
@@ -370915,7 +370951,7 @@ function getAnthropicEnvMetadata() {
|
|
|
370915
370951
|
function getBuildAgeMinutes() {
|
|
370916
370952
|
if (false)
|
|
370917
370953
|
;
|
|
370918
|
-
const buildTime = new Date("2026-04-05T03:
|
|
370954
|
+
const buildTime = new Date("2026-04-05T03:49:47.637Z").getTime();
|
|
370919
370955
|
if (isNaN(buildTime))
|
|
370920
370956
|
return;
|
|
370921
370957
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -389971,7 +390007,7 @@ var init_projectOnboardingState = __esm(() => {
|
|
|
389971
390007
|
|
|
389972
390008
|
// src/utils/appleTerminalBackup.ts
|
|
389973
390009
|
import { stat as stat35 } from "fs/promises";
|
|
389974
|
-
import { homedir as
|
|
390010
|
+
import { homedir as homedir25 } from "os";
|
|
389975
390011
|
import { join as join103 } from "path";
|
|
389976
390012
|
function markTerminalSetupInProgress(backupPath) {
|
|
389977
390013
|
saveGlobalConfig((current) => ({
|
|
@@ -389994,7 +390030,7 @@ function getTerminalRecoveryInfo() {
|
|
|
389994
390030
|
};
|
|
389995
390031
|
}
|
|
389996
390032
|
function getTerminalPlistPath() {
|
|
389997
|
-
return join103(
|
|
390033
|
+
return join103(homedir25(), "Library", "Preferences", "com.apple.Terminal.plist");
|
|
389998
390034
|
}
|
|
389999
390035
|
async function backupTerminalPreferences() {
|
|
390000
390036
|
const terminalPlistPath = getTerminalPlistPath();
|
|
@@ -390065,11 +390101,11 @@ var init_appleTerminalBackup = __esm(() => {
|
|
|
390065
390101
|
});
|
|
390066
390102
|
|
|
390067
390103
|
// src/utils/completionCache.ts
|
|
390068
|
-
import { homedir as
|
|
390104
|
+
import { homedir as homedir26 } from "os";
|
|
390069
390105
|
import { dirname as dirname44, join as join104 } from "path";
|
|
390070
390106
|
function detectShell() {
|
|
390071
390107
|
const shell = process.env.SHELL || "";
|
|
390072
|
-
const home =
|
|
390108
|
+
const home = homedir26();
|
|
390073
390109
|
const claudeDir = join104(home, ".claude");
|
|
390074
390110
|
if (shell.endsWith("/zsh") || shell.endsWith("/zsh.exe")) {
|
|
390075
390111
|
const cacheFile = join104(claudeDir, "completion.zsh");
|
|
@@ -390145,7 +390181,7 @@ __export(exports_terminalSetup, {
|
|
|
390145
390181
|
});
|
|
390146
390182
|
import { randomBytes as randomBytes14 } from "crypto";
|
|
390147
390183
|
import { copyFile as copyFile8, mkdir as mkdir25, readFile as readFile33, writeFile as writeFile27 } from "fs/promises";
|
|
390148
|
-
import { homedir as
|
|
390184
|
+
import { homedir as homedir27, platform as platform4 } from "os";
|
|
390149
390185
|
import { dirname as dirname45, join as join105 } from "path";
|
|
390150
390186
|
import { pathToFileURL as pathToFileURL7 } from "url";
|
|
390151
390187
|
function isVSCodeRemoteSSH() {
|
|
@@ -390281,7 +390317,7 @@ async function installBindingsForVSCodeTerminal(editor = "VSCode", theme) {
|
|
|
390281
390317
|
]`)}${EOL5}`;
|
|
390282
390318
|
}
|
|
390283
390319
|
const editorDir = editor === "VSCode" ? "Code" : editor;
|
|
390284
|
-
const userDirPath = join105(
|
|
390320
|
+
const userDirPath = join105(homedir27(), platform4() === "win32" ? join105("AppData", "Roaming", editorDir, "User") : platform4() === "darwin" ? join105("Library", "Application Support", editorDir, "User") : join105(".config", editorDir, "User"));
|
|
390285
390321
|
const keybindingsPath = join105(userDirPath, "keybindings.json");
|
|
390286
390322
|
try {
|
|
390287
390323
|
await mkdir25(userDirPath, {
|
|
@@ -390425,7 +390461,7 @@ chars = "\\u001B\\r"`;
|
|
|
390425
390461
|
if (xdgConfigHome) {
|
|
390426
390462
|
configPaths.push(join105(xdgConfigHome, "alacritty", "alacritty.toml"));
|
|
390427
390463
|
} else {
|
|
390428
|
-
configPaths.push(join105(
|
|
390464
|
+
configPaths.push(join105(homedir27(), ".config", "alacritty", "alacritty.toml"));
|
|
390429
390465
|
}
|
|
390430
390466
|
if (platform4() === "win32") {
|
|
390431
390467
|
const appData = process.env.APPDATA;
|
|
@@ -390491,7 +390527,7 @@ chars = "\\u001B\\r"`;
|
|
|
390491
390527
|
}
|
|
390492
390528
|
}
|
|
390493
390529
|
async function installBindingsForZed(theme) {
|
|
390494
|
-
const zedDir = join105(
|
|
390530
|
+
const zedDir = join105(homedir27(), ".config", "zed");
|
|
390495
390531
|
const keymapPath = join105(zedDir, "keymap.json");
|
|
390496
390532
|
try {
|
|
390497
390533
|
await mkdir25(zedDir, {
|
|
@@ -408543,10 +408579,10 @@ var init_MemoryFileSelector = __esm(() => {
|
|
|
408543
408579
|
});
|
|
408544
408580
|
|
|
408545
408581
|
// src/components/memory/MemoryUpdateNotification.tsx
|
|
408546
|
-
import { homedir as
|
|
408582
|
+
import { homedir as homedir28 } from "os";
|
|
408547
408583
|
import { relative as relative23 } from "path";
|
|
408548
408584
|
function getRelativeMemoryPath(path18) {
|
|
408549
|
-
const homeDir =
|
|
408585
|
+
const homeDir = homedir28();
|
|
408550
408586
|
const cwd2 = getCwd();
|
|
408551
408587
|
const relativeToHome = path18.startsWith(homeDir) ? "~" + path18.slice(homeDir.length) : null;
|
|
408552
408588
|
const relativeToCwd = path18.startsWith(cwd2) ? "./" + relative23(cwd2, path18) : null;
|
|
@@ -411179,8 +411215,8 @@ __export(exports_auth3, {
|
|
|
411179
411215
|
});
|
|
411180
411216
|
import { createServer as createServer5 } from "node:http";
|
|
411181
411217
|
import { createHash as createHash21, randomBytes as randomBytes15 } from "node:crypto";
|
|
411182
|
-
import { appendFileSync as appendFileSync5, existsSync as existsSync10, mkdirSync as mkdirSync10 } from "node:fs";
|
|
411183
|
-
import { join as join115 } from "node:path";
|
|
411218
|
+
import { appendFileSync as appendFileSync5, existsSync as existsSync10, mkdirSync as mkdirSync10, writeFileSync as writeFileSync8 } from "node:fs";
|
|
411219
|
+
import { dirname as dirname49, join as join115 } from "node:path";
|
|
411184
411220
|
function appendAuthLog(service, message) {
|
|
411185
411221
|
try {
|
|
411186
411222
|
const dir = getClaudeConfigHomeDir();
|
|
@@ -411294,6 +411330,28 @@ function emailFromTokens(tokens) {
|
|
|
411294
411330
|
return p.email;
|
|
411295
411331
|
return "unknown";
|
|
411296
411332
|
}
|
|
411333
|
+
function persistCodexOauthSession(tokens) {
|
|
411334
|
+
try {
|
|
411335
|
+
const authPath = resolveCodexAuthPath();
|
|
411336
|
+
const accountId = parseChatgptAccountId(tokens.access_token) ?? parseChatgptAccountId(tokens.id_token);
|
|
411337
|
+
mkdirSync10(dirname49(authPath), { recursive: true });
|
|
411338
|
+
writeFileSync8(authPath, JSON.stringify({
|
|
411339
|
+
access_token: tokens.access_token,
|
|
411340
|
+
...tokens.refresh_token ? { refresh_token: tokens.refresh_token } : {},
|
|
411341
|
+
...tokens.id_token ? { id_token: tokens.id_token } : {},
|
|
411342
|
+
...accountId ? { account_id: accountId } : {},
|
|
411343
|
+
tokens: {
|
|
411344
|
+
access_token: tokens.access_token,
|
|
411345
|
+
...tokens.refresh_token ? { refresh_token: tokens.refresh_token } : {},
|
|
411346
|
+
...tokens.id_token ? { id_token: tokens.id_token } : {},
|
|
411347
|
+
...accountId ? { account_id: accountId } : {}
|
|
411348
|
+
}
|
|
411349
|
+
}, null, 2), "utf8");
|
|
411350
|
+
appendAuthLog("codex_oauth", `codex auth.json synced path=${authPath}${accountId ? ` accountId=${accountId}` : ""}`);
|
|
411351
|
+
} catch (error42) {
|
|
411352
|
+
appendAuthLog("codex_oauth", `codex auth.json sync failed ${String(error42)}`);
|
|
411353
|
+
}
|
|
411354
|
+
}
|
|
411297
411355
|
async function fetchGoogleEmail(accessToken, idToken) {
|
|
411298
411356
|
if (idToken) {
|
|
411299
411357
|
const p = decodeJwtPayload2(idToken);
|
|
@@ -412154,6 +412212,7 @@ function AuthCommand({
|
|
|
412154
412212
|
code_verifier: verifier
|
|
412155
412213
|
}, "codex_oauth");
|
|
412156
412214
|
const email3 = emailFromTokens(tokens);
|
|
412215
|
+
persistCodexOauthSession(tokens);
|
|
412157
412216
|
addAccount({ type: "codex_oauth", label: `Codex: ${email3}`, email: email3, refreshToken: tokens.refresh_token, enabled: true });
|
|
412158
412217
|
process.env.OPENAI_API_KEY = "chatgpt-oauth";
|
|
412159
412218
|
appendAuthLog("codex_oauth", `account saved email=${email3}`);
|
|
@@ -412204,6 +412263,7 @@ var init_auth8 = __esm(() => {
|
|
|
412204
412263
|
init_messages3();
|
|
412205
412264
|
init_accountManager();
|
|
412206
412265
|
init_auth2();
|
|
412266
|
+
init_providerConfig();
|
|
412207
412267
|
import_react120 = __toESM(require_react(), 1);
|
|
412208
412268
|
jsx_dev_runtime209 = __toESM(require_jsx_dev_runtime(), 1);
|
|
412209
412269
|
AG_SCOPES = [
|
|
@@ -420119,7 +420179,7 @@ var init_pluginStartupCheck = __esm(() => {
|
|
|
420119
420179
|
});
|
|
420120
420180
|
|
|
420121
420181
|
// src/utils/plugins/parseMarketplaceInput.ts
|
|
420122
|
-
import { homedir as
|
|
420182
|
+
import { homedir as homedir29 } from "os";
|
|
420123
420183
|
import { resolve as resolve36 } from "path";
|
|
420124
420184
|
async function parseMarketplaceInput(input) {
|
|
420125
420185
|
const trimmed = input.trim();
|
|
@@ -420155,7 +420215,7 @@ async function parseMarketplaceInput(input) {
|
|
|
420155
420215
|
const isWindows2 = process.platform === "win32";
|
|
420156
420216
|
const isWindowsPath = isWindows2 && (trimmed.startsWith(".\\") || trimmed.startsWith("..\\") || /^[a-zA-Z]:[/\\]/.test(trimmed));
|
|
420157
420217
|
if (trimmed.startsWith("./") || trimmed.startsWith("../") || trimmed.startsWith("/") || trimmed.startsWith("~") || isWindowsPath) {
|
|
420158
|
-
const resolvedPath = resolve36(trimmed.startsWith("~") ? trimmed.replace(/^~/,
|
|
420218
|
+
const resolvedPath = resolve36(trimmed.startsWith("~") ? trimmed.replace(/^~/, homedir29()) : trimmed);
|
|
420159
420219
|
let stats;
|
|
420160
420220
|
try {
|
|
420161
420221
|
stats = await fs4.stat(resolvedPath);
|
|
@@ -423155,7 +423215,7 @@ var init_DiscoverPlugins = __esm(() => {
|
|
|
423155
423215
|
});
|
|
423156
423216
|
|
|
423157
423217
|
// src/services/plugins/pluginOperations.ts
|
|
423158
|
-
import { dirname as
|
|
423218
|
+
import { dirname as dirname50, join as join118 } from "path";
|
|
423159
423219
|
function assertInstallableScope(scope) {
|
|
423160
423220
|
if (!VALID_INSTALLABLE_SCOPES.includes(scope)) {
|
|
423161
423221
|
throw new Error(`Invalid scope "${scope}". Must be one of: ${VALID_INSTALLABLE_SCOPES.join(", ")}`);
|
|
@@ -423632,7 +423692,7 @@ async function performPluginUpdate({
|
|
|
423632
423692
|
}
|
|
423633
423693
|
throw e;
|
|
423634
423694
|
}
|
|
423635
|
-
const marketplaceDir = marketplaceStats.isDirectory() ? marketplaceInstallLocation :
|
|
423695
|
+
const marketplaceDir = marketplaceStats.isDirectory() ? marketplaceInstallLocation : dirname50(marketplaceInstallLocation);
|
|
423636
423696
|
sourcePath = join118(marketplaceDir, entry.source);
|
|
423637
423697
|
try {
|
|
423638
423698
|
await fs4.stat(sourcePath);
|
|
@@ -434968,7 +435028,7 @@ ${args ? "Additional user input: " + args : ""}
|
|
|
434968
435028
|
|
|
434969
435029
|
// src/utils/releaseNotes.ts
|
|
434970
435030
|
import { mkdir as mkdir31, readFile as readFile40, writeFile as writeFile35 } from "fs/promises";
|
|
434971
|
-
import { dirname as
|
|
435031
|
+
import { dirname as dirname52, join as join122 } from "path";
|
|
434972
435032
|
function getChangelogCachePath() {
|
|
434973
435033
|
return join122(getClaudeConfigHomeDir(), "cache", "changelog.md");
|
|
434974
435034
|
}
|
|
@@ -434979,7 +435039,7 @@ async function migrateChangelogFromConfig() {
|
|
|
434979
435039
|
}
|
|
434980
435040
|
const cachePath2 = getChangelogCachePath();
|
|
434981
435041
|
try {
|
|
434982
|
-
await mkdir31(
|
|
435042
|
+
await mkdir31(dirname52(cachePath2), { recursive: true });
|
|
434983
435043
|
await writeFile35(cachePath2, config3.cachedChangelog, {
|
|
434984
435044
|
encoding: "utf-8",
|
|
434985
435045
|
flag: "wx"
|
|
@@ -435001,7 +435061,7 @@ async function fetchAndStoreChangelog() {
|
|
|
435001
435061
|
return;
|
|
435002
435062
|
}
|
|
435003
435063
|
const cachePath2 = getChangelogCachePath();
|
|
435004
|
-
await mkdir31(
|
|
435064
|
+
await mkdir31(dirname52(cachePath2), { recursive: true });
|
|
435005
435065
|
await writeFile35(cachePath2, changelogContent, { encoding: "utf-8" });
|
|
435006
435066
|
changelogMemoryCache = changelogContent;
|
|
435007
435067
|
const changelogLastFetched = Date.now();
|
|
@@ -449095,7 +449155,7 @@ var init_terminalSetup2 = __esm(() => {
|
|
|
449095
449155
|
|
|
449096
449156
|
// src/utils/antigravityLocalSessions.ts
|
|
449097
449157
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
449098
|
-
import { existsSync as existsSync11, mkdirSync as mkdirSync11, readFileSync as readFileSync15, writeFileSync as
|
|
449158
|
+
import { existsSync as existsSync11, mkdirSync as mkdirSync11, readFileSync as readFileSync15, writeFileSync as writeFileSync9 } from "node:fs";
|
|
449099
449159
|
import { join as join123 } from "node:path";
|
|
449100
449160
|
import { platform as platform5 } from "node:os";
|
|
449101
449161
|
function getSnapshotPath() {
|
|
@@ -449115,7 +449175,7 @@ function saveSnapshotFile(data) {
|
|
|
449115
449175
|
const dir = getClaudeConfigHomeDir();
|
|
449116
449176
|
if (!existsSync11(dir))
|
|
449117
449177
|
mkdirSync11(dir, { recursive: true });
|
|
449118
|
-
|
|
449178
|
+
writeFileSync9(getSnapshotPath(), JSON.stringify(data, null, 2), "utf8");
|
|
449119
449179
|
}
|
|
449120
449180
|
function extractRefreshToken(oauthTokenValue) {
|
|
449121
449181
|
const raw = oauthTokenValue?.trim();
|
|
@@ -449217,11 +449277,11 @@ var init_antigravityLocalSessions = __esm(() => {
|
|
|
449217
449277
|
|
|
449218
449278
|
// src/utils/antigravityLocalUsage.ts
|
|
449219
449279
|
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
449220
|
-
import { existsSync as existsSync12, mkdirSync as mkdirSync12, readdirSync as readdirSync4, readFileSync as readFileSync16, writeFileSync as
|
|
449280
|
+
import { existsSync as existsSync12, mkdirSync as mkdirSync12, readdirSync as readdirSync4, readFileSync as readFileSync16, writeFileSync as writeFileSync10 } from "node:fs";
|
|
449221
449281
|
import { join as join124 } from "node:path";
|
|
449222
|
-
import { homedir as
|
|
449282
|
+
import { homedir as homedir30, platform as platform6 } from "node:os";
|
|
449223
449283
|
function getConfigDir() {
|
|
449224
|
-
return join124(
|
|
449284
|
+
return join124(homedir30(), ".snowcode");
|
|
449225
449285
|
}
|
|
449226
449286
|
function getSnapshotPath2() {
|
|
449227
449287
|
return join124(getConfigDir(), "antigravity-local-usage.json");
|
|
@@ -449240,7 +449300,7 @@ function saveSnapshots(data) {
|
|
|
449240
449300
|
const dir = getConfigDir();
|
|
449241
449301
|
if (!existsSync12(dir))
|
|
449242
449302
|
mkdirSync12(dir, { recursive: true });
|
|
449243
|
-
|
|
449303
|
+
writeFileSync10(getSnapshotPath2(), JSON.stringify(data, null, 2), "utf8");
|
|
449244
449304
|
}
|
|
449245
449305
|
function saveSnapshot(snapshot2) {
|
|
449246
449306
|
const data = loadSnapshots();
|
|
@@ -450386,7 +450446,7 @@ var init_usage3 = __esm(() => {
|
|
|
450386
450446
|
});
|
|
450387
450447
|
|
|
450388
450448
|
// src/utils/fallbackConfig.ts
|
|
450389
|
-
import { existsSync as existsSync13, readFileSync as readFileSync17, writeFileSync as
|
|
450449
|
+
import { existsSync as existsSync13, readFileSync as readFileSync17, writeFileSync as writeFileSync11 } from "node:fs";
|
|
450390
450450
|
import { join as join125 } from "node:path";
|
|
450391
450451
|
function getPath3() {
|
|
450392
450452
|
return join125(getClaudeConfigHomeDir(), "fallbacks.json");
|
|
@@ -450402,7 +450462,7 @@ function loadFallbackConfig() {
|
|
|
450402
450462
|
}
|
|
450403
450463
|
}
|
|
450404
450464
|
function saveFallbackConfig(config3) {
|
|
450405
|
-
|
|
450465
|
+
writeFileSync11(getPath3(), JSON.stringify(config3, null, 2), "utf-8");
|
|
450406
450466
|
}
|
|
450407
450467
|
function getFallbackOrder() {
|
|
450408
450468
|
return loadFallbackConfig().order;
|
|
@@ -464076,7 +464136,7 @@ var init_rewind = __esm(() => {
|
|
|
464076
464136
|
});
|
|
464077
464137
|
|
|
464078
464138
|
// src/utils/heapDumpService.ts
|
|
464079
|
-
import { createWriteStream as createWriteStream3, writeFileSync as
|
|
464139
|
+
import { createWriteStream as createWriteStream3, writeFileSync as writeFileSync12 } from "fs";
|
|
464080
464140
|
import { readdir as readdir25, readFile as readFile43, writeFile as writeFile37 } from "fs/promises";
|
|
464081
464141
|
import { join as join129 } from "path";
|
|
464082
464142
|
import { pipeline as pipeline2 } from "stream/promises";
|
|
@@ -464215,7 +464275,7 @@ async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
|
464215
464275
|
}
|
|
464216
464276
|
async function writeHeapSnapshot(filepath) {
|
|
464217
464277
|
if (typeof Bun !== "undefined") {
|
|
464218
|
-
|
|
464278
|
+
writeFileSync12(filepath, Bun.generateHeapSnapshot("v8", "arraybuffer"), {
|
|
464219
464279
|
mode: 384
|
|
464220
464280
|
});
|
|
464221
464281
|
Bun.gc(true);
|
|
@@ -464754,7 +464814,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
464754
464814
|
var call59 = async () => {
|
|
464755
464815
|
return {
|
|
464756
464816
|
type: "text",
|
|
464757
|
-
value: `${"99.0.0"} (built ${"2026-04-05T03:
|
|
464817
|
+
value: `${"99.0.0"} (built ${"2026-04-05T03:49:47.637Z"})`
|
|
464758
464818
|
};
|
|
464759
464819
|
}, version2, version_default;
|
|
464760
464820
|
var init_version = __esm(() => {
|
|
@@ -466083,7 +466143,7 @@ var init_setupPortable = __esm(() => {
|
|
|
466083
466143
|
|
|
466084
466144
|
// src/utils/claudeInChrome/setup.ts
|
|
466085
466145
|
import { chmod as chmod10, mkdir as mkdir34, readFile as readFile44, writeFile as writeFile38 } from "fs/promises";
|
|
466086
|
-
import { homedir as
|
|
466146
|
+
import { homedir as homedir31 } from "os";
|
|
466087
466147
|
import { join as join131 } from "path";
|
|
466088
466148
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
466089
466149
|
function shouldEnableClaudeInChrome(chromeFlag) {
|
|
@@ -466163,7 +466223,7 @@ function setupClaudeInChrome() {
|
|
|
466163
466223
|
function getNativeMessagingHostsDirs() {
|
|
466164
466224
|
const platform7 = getPlatform();
|
|
466165
466225
|
if (platform7 === "windows") {
|
|
466166
|
-
const home =
|
|
466226
|
+
const home = homedir31();
|
|
466167
466227
|
const appData = process.env.APPDATA || join131(home, "AppData", "Local");
|
|
466168
466228
|
return [join131(appData, "Claude Code", "ChromeNativeHost")];
|
|
466169
466229
|
}
|
|
@@ -466850,7 +466910,7 @@ var init_advisor2 = __esm(() => {
|
|
|
466850
466910
|
// src/skills/bundledSkills.ts
|
|
466851
466911
|
import { constants as fsConstants5 } from "fs";
|
|
466852
466912
|
import { mkdir as mkdir35, open as open13 } from "fs/promises";
|
|
466853
|
-
import { dirname as
|
|
466913
|
+
import { dirname as dirname53, isAbsolute as isAbsolute24, join as join132, normalize as normalize13, sep as pathSep2 } from "path";
|
|
466854
466914
|
function registerBundledSkill(definition) {
|
|
466855
466915
|
const { files: files2 } = definition;
|
|
466856
466916
|
let skillRoot;
|
|
@@ -466914,7 +466974,7 @@ async function writeSkillFiles(dir, files2) {
|
|
|
466914
466974
|
const byParent = new Map;
|
|
466915
466975
|
for (const [relPath, content] of Object.entries(files2)) {
|
|
466916
466976
|
const target = resolveSkillFilePath(dir, relPath);
|
|
466917
|
-
const parent2 =
|
|
466977
|
+
const parent2 = dirname53(target);
|
|
466918
466978
|
const entry = [target, content];
|
|
466919
466979
|
const group = byParent.get(parent2);
|
|
466920
466980
|
if (group)
|
|
@@ -474885,7 +474945,7 @@ import {
|
|
|
474885
474945
|
unlink as unlink21,
|
|
474886
474946
|
writeFile as writeFile41
|
|
474887
474947
|
} from "fs/promises";
|
|
474888
|
-
import { basename as basename40, dirname as
|
|
474948
|
+
import { basename as basename40, dirname as dirname55, join as join139 } from "path";
|
|
474889
474949
|
function isTranscriptMessage(entry) {
|
|
474890
474950
|
return entry.type === "user" || entry.type === "assistant" || entry.type === "attachment" || entry.type === "system";
|
|
474891
474951
|
}
|
|
@@ -474930,7 +474990,7 @@ function getAgentMetadataPath(agentId) {
|
|
|
474930
474990
|
}
|
|
474931
474991
|
async function writeAgentMetadata(agentId, metadata) {
|
|
474932
474992
|
const path21 = getAgentMetadataPath(agentId);
|
|
474933
|
-
await mkdir38(
|
|
474993
|
+
await mkdir38(dirname55(path21), { recursive: true });
|
|
474934
474994
|
await writeFile41(path21, JSON.stringify(metadata));
|
|
474935
474995
|
}
|
|
474936
474996
|
async function readAgentMetadata(agentId) {
|
|
@@ -474953,7 +475013,7 @@ function getRemoteAgentMetadataPath(taskId) {
|
|
|
474953
475013
|
}
|
|
474954
475014
|
async function writeRemoteAgentMetadata(taskId, metadata) {
|
|
474955
475015
|
const path21 = getRemoteAgentMetadataPath(taskId);
|
|
474956
|
-
await mkdir38(
|
|
475016
|
+
await mkdir38(dirname55(path21), { recursive: true });
|
|
474957
475017
|
await writeFile41(path21, JSON.stringify(metadata));
|
|
474958
475018
|
}
|
|
474959
475019
|
async function readRemoteAgentMetadata(taskId) {
|
|
@@ -475142,7 +475202,7 @@ class Project {
|
|
|
475142
475202
|
try {
|
|
475143
475203
|
await fsAppendFile(filePath, data, { mode: 384 });
|
|
475144
475204
|
} catch {
|
|
475145
|
-
await mkdir38(
|
|
475205
|
+
await mkdir38(dirname55(filePath), { recursive: true, mode: 448 });
|
|
475146
475206
|
await fsAppendFile(filePath, data, { mode: 384 });
|
|
475147
475207
|
}
|
|
475148
475208
|
}
|
|
@@ -475741,7 +475801,7 @@ async function hydrateFromCCRv2InternalEvents(sessionId) {
|
|
|
475741
475801
|
}
|
|
475742
475802
|
for (const [agentId, entries] of byAgent) {
|
|
475743
475803
|
const agentFile = getAgentTranscriptPath(asAgentId(agentId));
|
|
475744
|
-
await mkdir38(
|
|
475804
|
+
await mkdir38(dirname55(agentFile), { recursive: true, mode: 448 });
|
|
475745
475805
|
const agentContent = entries.map((p) => jsonStringify(p) + `
|
|
475746
475806
|
`).join("");
|
|
475747
475807
|
await writeFile41(agentFile, agentContent, {
|
|
@@ -476278,7 +476338,7 @@ function appendEntryToFile(fullPath, entry) {
|
|
|
476278
476338
|
try {
|
|
476279
476339
|
fs5.appendFileSync(fullPath, line, { mode: 384 });
|
|
476280
476340
|
} catch {
|
|
476281
|
-
fs5.mkdirSync(
|
|
476341
|
+
fs5.mkdirSync(dirname55(fullPath), { mode: 448 });
|
|
476282
476342
|
fs5.appendFileSync(fullPath, line, { mode: 384 });
|
|
476283
476343
|
}
|
|
476284
476344
|
}
|
|
@@ -478042,7 +478102,7 @@ var init_agentMemory = __esm(() => {
|
|
|
478042
478102
|
|
|
478043
478103
|
// src/utils/permissions/filesystem.ts
|
|
478044
478104
|
import { randomBytes as randomBytes19 } from "crypto";
|
|
478045
|
-
import { homedir as
|
|
478105
|
+
import { homedir as homedir32, tmpdir as tmpdir10 } from "os";
|
|
478046
478106
|
import { join as join141, normalize as normalize15, posix as posix8, sep as sep32 } from "path";
|
|
478047
478107
|
function normalizeCaseForComparison(path21) {
|
|
478048
478108
|
return path21.toLowerCase();
|
|
@@ -478056,7 +478116,7 @@ function getClaudeSkillScope(filePath) {
|
|
|
478056
478116
|
prefix: "/.claude/skills/"
|
|
478057
478117
|
},
|
|
478058
478118
|
{
|
|
478059
|
-
dir: expandPath(join141(
|
|
478119
|
+
dir: expandPath(join141(homedir32(), ".claude", "skills")),
|
|
478060
478120
|
prefix: "~/.claude/skills/"
|
|
478061
478121
|
}
|
|
478062
478122
|
];
|
|
@@ -478370,7 +478430,7 @@ function patternWithRoot(pattern, source) {
|
|
|
478370
478430
|
} else if (pattern.startsWith(`~${DIR_SEP}`)) {
|
|
478371
478431
|
return {
|
|
478372
478432
|
relativePattern: pattern.slice(1),
|
|
478373
|
-
root:
|
|
478433
|
+
root: homedir32().normalize("NFC")
|
|
478374
478434
|
};
|
|
478375
478435
|
} else if (pattern.startsWith(DIR_SEP)) {
|
|
478376
478436
|
return {
|
|
@@ -483206,7 +483266,7 @@ import {
|
|
|
483206
483266
|
symlink as symlink5,
|
|
483207
483267
|
utimes as utimes2
|
|
483208
483268
|
} from "fs/promises";
|
|
483209
|
-
import { basename as basename42, dirname as
|
|
483269
|
+
import { basename as basename42, dirname as dirname56, join as join143 } from "path";
|
|
483210
483270
|
function validateWorktreeSlug(slug) {
|
|
483211
483271
|
if (slug.length > MAX_WORKTREE_SLUG_LENGTH) {
|
|
483212
483272
|
throw new Error(`Invalid worktree name: must be ${MAX_WORKTREE_SLUG_LENGTH} characters or fewer (got ${slug.length})`);
|
|
@@ -483402,7 +483462,7 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
|
483402
483462
|
const srcPath = join143(repoRoot, relativePath2);
|
|
483403
483463
|
const destPath = join143(worktreePath, relativePath2);
|
|
483404
483464
|
try {
|
|
483405
|
-
await mkdir40(
|
|
483465
|
+
await mkdir40(dirname56(destPath), { recursive: true });
|
|
483406
483466
|
await copyFile10(srcPath, destPath);
|
|
483407
483467
|
copied.push(relativePath2);
|
|
483408
483468
|
} catch (e) {
|
|
@@ -483419,7 +483479,7 @@ async function performPostCreationSetup(repoRoot, worktreePath) {
|
|
|
483419
483479
|
const sourceSettingsLocal = join143(repoRoot, localSettingsRelativePath);
|
|
483420
483480
|
try {
|
|
483421
483481
|
const destSettingsLocal = join143(worktreePath, localSettingsRelativePath);
|
|
483422
|
-
await mkdirRecursive(
|
|
483482
|
+
await mkdirRecursive(dirname56(destSettingsLocal));
|
|
483423
483483
|
await copyFile10(sourceSettingsLocal, destSettingsLocal);
|
|
483424
483484
|
logForDebugging2(`Copied settings.local.json to worktree: ${destSettingsLocal}`);
|
|
483425
483485
|
} catch (e) {
|
|
@@ -487712,7 +487772,7 @@ import {
|
|
|
487712
487772
|
unlink as unlink23
|
|
487713
487773
|
} from "fs/promises";
|
|
487714
487774
|
import { createServer as createServer6 } from "net";
|
|
487715
|
-
import { homedir as
|
|
487775
|
+
import { homedir as homedir33, platform as platform7 } from "os";
|
|
487716
487776
|
import { join as join144 } from "path";
|
|
487717
487777
|
function log(message, ...args) {
|
|
487718
487778
|
if (LOG_FILE) {
|
|
@@ -488051,7 +488111,7 @@ var init_chromeNativeHost = __esm(() => {
|
|
|
488051
488111
|
init_slowOperations();
|
|
488052
488112
|
init_common2();
|
|
488053
488113
|
MAX_MESSAGE_SIZE = 1024 * 1024;
|
|
488054
|
-
LOG_FILE = process.env.USER_TYPE === "ant" ? join144(
|
|
488114
|
+
LOG_FILE = process.env.USER_TYPE === "ant" ? join144(homedir33(), ".claude", "debug", "chrome-native-host.txt") : undefined;
|
|
488055
488115
|
messageSchema = lazySchema(() => exports_external2.object({
|
|
488056
488116
|
type: exports_external2.string()
|
|
488057
488117
|
}).passthrough());
|
|
@@ -490347,7 +490407,7 @@ __export(exports_upstreamproxy, {
|
|
|
490347
490407
|
SESSION_TOKEN_PATH: () => SESSION_TOKEN_PATH
|
|
490348
490408
|
});
|
|
490349
490409
|
import { mkdir as mkdir42, readFile as readFile48, unlink as unlink24, writeFile as writeFile42 } from "fs/promises";
|
|
490350
|
-
import { homedir as
|
|
490410
|
+
import { homedir as homedir34 } from "os";
|
|
490351
490411
|
import { join as join145 } from "path";
|
|
490352
490412
|
async function initUpstreamProxy(opts) {
|
|
490353
490413
|
if (!isEnvTruthy(process.env.CLAUDE_CODE_REMOTE)) {
|
|
@@ -490369,7 +490429,7 @@ async function initUpstreamProxy(opts) {
|
|
|
490369
490429
|
}
|
|
490370
490430
|
setNonDumpable();
|
|
490371
490431
|
const baseUrl = opts?.ccrBaseUrl ?? process.env.ANTHROPIC_BASE_URL ?? "https://api.anthropic.com";
|
|
490372
|
-
const caBundlePath = opts?.caBundlePath ?? join145(
|
|
490432
|
+
const caBundlePath = opts?.caBundlePath ?? join145(homedir34(), ".ccr", "ca-bundle.crt");
|
|
490373
490433
|
const caOk = await downloadCaBundle(baseUrl, opts?.systemCaPath ?? SYSTEM_CA_BUNDLE, caBundlePath);
|
|
490374
490434
|
if (!caOk)
|
|
490375
490435
|
return state2;
|
|
@@ -498367,7 +498427,7 @@ var init_ShowInIDEPrompt = __esm(() => {
|
|
|
498367
498427
|
});
|
|
498368
498428
|
|
|
498369
498429
|
// src/components/permissions/FilePermissionDialog/permissionOptions.tsx
|
|
498370
|
-
import { homedir as
|
|
498430
|
+
import { homedir as homedir35 } from "os";
|
|
498371
498431
|
import { basename as basename46, join as join146, sep as sep33 } from "path";
|
|
498372
498432
|
function isInClaudeFolder(filePath) {
|
|
498373
498433
|
const absolutePath = expandPath(filePath);
|
|
@@ -498378,7 +498438,7 @@ function isInClaudeFolder(filePath) {
|
|
|
498378
498438
|
}
|
|
498379
498439
|
function isInGlobalClaudeFolder(filePath) {
|
|
498380
498440
|
const absolutePath = expandPath(filePath);
|
|
498381
|
-
const globalClaudeFolderPath = join146(
|
|
498441
|
+
const globalClaudeFolderPath = join146(homedir35(), ".claude");
|
|
498382
498442
|
const normalizedAbsolutePath = normalizeCaseForComparison(absolutePath);
|
|
498383
498443
|
const normalizedGlobalClaudeFolderPath = normalizeCaseForComparison(globalClaudeFolderPath);
|
|
498384
498444
|
return normalizedAbsolutePath.startsWith(normalizedGlobalClaudeFolderPath + sep33.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalClaudeFolderPath + "/");
|
|
@@ -520999,7 +521059,7 @@ var init_cacache = __esm(() => {
|
|
|
520999
521059
|
|
|
521000
521060
|
// src/utils/cleanup.ts
|
|
521001
521061
|
import * as fs5 from "fs/promises";
|
|
521002
|
-
import { homedir as
|
|
521062
|
+
import { homedir as homedir36 } from "os";
|
|
521003
521063
|
import { join as join147 } from "path";
|
|
521004
521064
|
function getCutoffDate() {
|
|
521005
521065
|
const settings = getSettings_DEPRECATED() || {};
|
|
@@ -521300,7 +521360,7 @@ async function cleanupNpmCacheForAnthropicPackages() {
|
|
|
521300
521360
|
return;
|
|
521301
521361
|
}
|
|
521302
521362
|
logForDebugging2("npm cache cleanup: starting");
|
|
521303
|
-
const npmCachePath = join147(
|
|
521363
|
+
const npmCachePath = join147(homedir36(), ".npm", "_cacache");
|
|
521304
521364
|
const NPM_CACHE_RETENTION_COUNT = 5;
|
|
521305
521365
|
const startTime = Date.now();
|
|
521306
521366
|
try {
|
|
@@ -524586,7 +524646,7 @@ __export(exports_asciicast, {
|
|
|
524586
524646
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
524587
524647
|
});
|
|
524588
524648
|
import { appendFile as appendFile7, rename as rename10 } from "fs/promises";
|
|
524589
|
-
import { basename as basename55, dirname as
|
|
524649
|
+
import { basename as basename55, dirname as dirname57, join as join149 } from "path";
|
|
524590
524650
|
function getRecordFilePath() {
|
|
524591
524651
|
if (recordingState.filePath !== null) {
|
|
524592
524652
|
return recordingState.filePath;
|
|
@@ -524668,7 +524728,7 @@ function installAsciicastRecorder() {
|
|
|
524668
524728
|
}
|
|
524669
524729
|
});
|
|
524670
524730
|
try {
|
|
524671
|
-
getFsImplementation().mkdirSync(
|
|
524731
|
+
getFsImplementation().mkdirSync(dirname57(filePath));
|
|
524672
524732
|
} catch {}
|
|
524673
524733
|
getFsImplementation().appendFileSync(filePath, header + `
|
|
524674
524734
|
`, { mode: 384 });
|
|
@@ -524737,7 +524797,7 @@ var init_asciicast = __esm(() => {
|
|
|
524737
524797
|
});
|
|
524738
524798
|
|
|
524739
524799
|
// src/utils/sessionRestore.ts
|
|
524740
|
-
import { dirname as
|
|
524800
|
+
import { dirname as dirname58 } from "path";
|
|
524741
524801
|
function extractTodosFromTranscript(messages) {
|
|
524742
524802
|
for (let i3 = messages.length - 1;i3 >= 0; i3--) {
|
|
524743
524803
|
const msg = messages[i3];
|
|
@@ -524862,7 +524922,7 @@ async function processResumedConversation(result, opts, context8) {
|
|
|
524862
524922
|
if (!opts.forkSession) {
|
|
524863
524923
|
const sid = opts.sessionIdOverride ?? result.sessionId;
|
|
524864
524924
|
if (sid) {
|
|
524865
|
-
switchSession(asSessionId(sid), opts.transcriptPath ?
|
|
524925
|
+
switchSession(asSessionId(sid), opts.transcriptPath ? dirname58(opts.transcriptPath) : null);
|
|
524866
524926
|
await renameRecordingForSession();
|
|
524867
524927
|
await resetSessionFilePointer();
|
|
524868
524928
|
restoreCostStateForSession(sid);
|
|
@@ -533557,7 +533617,7 @@ var exports_REPL = {};
|
|
|
533557
533617
|
__export(exports_REPL, {
|
|
533558
533618
|
REPL: () => REPL
|
|
533559
533619
|
});
|
|
533560
|
-
import { dirname as
|
|
533620
|
+
import { dirname as dirname59, join as join152 } from "path";
|
|
533561
533621
|
import { tmpdir as tmpdir11 } from "os";
|
|
533562
533622
|
import { writeFile as writeFile44 } from "fs/promises";
|
|
533563
533623
|
import { randomUUID as randomUUID47 } from "crypto";
|
|
@@ -534493,7 +534553,7 @@ function REPL({
|
|
|
534493
534553
|
const targetSessionCosts = getStoredSessionCosts(sessionId);
|
|
534494
534554
|
saveCurrentSessionCosts();
|
|
534495
534555
|
resetCostState();
|
|
534496
|
-
switchSession(asSessionId(sessionId), log2.fullPath ?
|
|
534556
|
+
switchSession(asSessionId(sessionId), log2.fullPath ? dirname59(log2.fullPath) : null);
|
|
534497
534557
|
const {
|
|
534498
534558
|
renameRecordingForSession: renameRecordingForSession2
|
|
534499
534559
|
} = await Promise.resolve().then(() => (init_asciicast(), exports_asciicast));
|
|
@@ -538216,7 +538276,7 @@ function WelcomeV2() {
|
|
|
538216
538276
|
dimColor: true,
|
|
538217
538277
|
children: [
|
|
538218
538278
|
"v",
|
|
538219
|
-
"0.9.
|
|
538279
|
+
"0.9.21",
|
|
538220
538280
|
" "
|
|
538221
538281
|
]
|
|
538222
538282
|
}, undefined, true, undefined, this)
|
|
@@ -538416,7 +538476,7 @@ function WelcomeV2() {
|
|
|
538416
538476
|
dimColor: true,
|
|
538417
538477
|
children: [
|
|
538418
538478
|
"v",
|
|
538419
|
-
"0.9.
|
|
538479
|
+
"0.9.21",
|
|
538420
538480
|
" "
|
|
538421
538481
|
]
|
|
538422
538482
|
}, undefined, true, undefined, this)
|
|
@@ -538642,7 +538702,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
538642
538702
|
dimColor: true,
|
|
538643
538703
|
children: [
|
|
538644
538704
|
"v",
|
|
538645
|
-
"0.9.
|
|
538705
|
+
"0.9.21",
|
|
538646
538706
|
" "
|
|
538647
538707
|
]
|
|
538648
538708
|
}, undefined, true, undefined, this);
|
|
@@ -538896,7 +538956,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
538896
538956
|
dimColor: true,
|
|
538897
538957
|
children: [
|
|
538898
538958
|
"v",
|
|
538899
|
-
"0.9.
|
|
538959
|
+
"0.9.21",
|
|
538900
538960
|
" "
|
|
538901
538961
|
]
|
|
538902
538962
|
}, undefined, true, undefined, this);
|
|
@@ -539748,7 +539808,7 @@ var exports_TrustDialog = {};
|
|
|
539748
539808
|
__export(exports_TrustDialog, {
|
|
539749
539809
|
TrustDialog: () => TrustDialog
|
|
539750
539810
|
});
|
|
539751
|
-
import { homedir as
|
|
539811
|
+
import { homedir as homedir37 } from "os";
|
|
539752
539812
|
function TrustDialog(t0) {
|
|
539753
539813
|
const $2 = import_react_compiler_runtime365.c(33);
|
|
539754
539814
|
const {
|
|
@@ -539859,7 +539919,7 @@ function TrustDialog(t0) {
|
|
|
539859
539919
|
let t13;
|
|
539860
539920
|
if ($2[13] !== hasAnyBashExecution) {
|
|
539861
539921
|
t12 = () => {
|
|
539862
|
-
const isHomeDir =
|
|
539922
|
+
const isHomeDir = homedir37() === getCwd();
|
|
539863
539923
|
logEvent("tengu_trust_dialog_shown", {
|
|
539864
539924
|
isHomeDir,
|
|
539865
539925
|
hasMcpServers,
|
|
@@ -539888,7 +539948,7 @@ function TrustDialog(t0) {
|
|
|
539888
539948
|
gracefulShutdownSync(1);
|
|
539889
539949
|
return;
|
|
539890
539950
|
}
|
|
539891
|
-
const isHomeDir_0 =
|
|
539951
|
+
const isHomeDir_0 = homedir37() === getCwd();
|
|
539892
539952
|
logEvent("tengu_trust_dialog_accept", {
|
|
539893
539953
|
isHomeDir: isHomeDir_0,
|
|
539894
539954
|
hasMcpServers,
|
|
@@ -541572,7 +541632,7 @@ var exports_ResumeConversation = {};
|
|
|
541572
541632
|
__export(exports_ResumeConversation, {
|
|
541573
541633
|
ResumeConversation: () => ResumeConversation
|
|
541574
541634
|
});
|
|
541575
|
-
import { dirname as
|
|
541635
|
+
import { dirname as dirname60 } from "path";
|
|
541576
541636
|
function parsePrIdentifier(value) {
|
|
541577
541637
|
const directNumber = parseInt(value, 10);
|
|
541578
541638
|
if (!isNaN(directNumber) && directNumber > 0) {
|
|
@@ -541706,7 +541766,7 @@ function ResumeConversation({
|
|
|
541706
541766
|
}
|
|
541707
541767
|
if (false) {}
|
|
541708
541768
|
if (result_3.sessionId && !forkSession) {
|
|
541709
|
-
switchSession(asSessionId(result_3.sessionId), log_0.fullPath ?
|
|
541769
|
+
switchSession(asSessionId(result_3.sessionId), log_0.fullPath ? dirname60(log_0.fullPath) : null);
|
|
541710
541770
|
await renameRecordingForSession();
|
|
541711
541771
|
await resetSessionFilePointer();
|
|
541712
541772
|
restoreCostStateForSession(result_3.sessionId);
|
|
@@ -544870,7 +544930,7 @@ var init_createDirectConnectSession = __esm(() => {
|
|
|
544870
544930
|
});
|
|
544871
544931
|
|
|
544872
544932
|
// src/utils/errorLogSink.ts
|
|
544873
|
-
import { dirname as
|
|
544933
|
+
import { dirname as dirname61, join as join153 } from "path";
|
|
544874
544934
|
function getErrorsPath() {
|
|
544875
544935
|
return join153(CACHE_PATHS.errors(), DATE + ".jsonl");
|
|
544876
544936
|
}
|
|
@@ -544891,7 +544951,7 @@ function createJsonlWriter(options2) {
|
|
|
544891
544951
|
function getLogWriter(path23) {
|
|
544892
544952
|
let writer = logWriters.get(path23);
|
|
544893
544953
|
if (!writer) {
|
|
544894
|
-
const dir =
|
|
544954
|
+
const dir = dirname61(path23);
|
|
544895
544955
|
writer = createJsonlWriter({
|
|
544896
544956
|
writeFn: (content) => {
|
|
544897
544957
|
try {
|
|
@@ -545217,7 +545277,7 @@ var init_sessionMemory = __esm(() => {
|
|
|
545217
545277
|
|
|
545218
545278
|
// src/utils/iTermBackup.ts
|
|
545219
545279
|
import { copyFile as copyFile11, stat as stat48 } from "fs/promises";
|
|
545220
|
-
import { homedir as
|
|
545280
|
+
import { homedir as homedir38 } from "os";
|
|
545221
545281
|
import { join as join154 } from "path";
|
|
545222
545282
|
function markITerm2SetupComplete() {
|
|
545223
545283
|
saveGlobalConfig((current) => ({
|
|
@@ -545233,7 +545293,7 @@ function getIterm2RecoveryInfo() {
|
|
|
545233
545293
|
};
|
|
545234
545294
|
}
|
|
545235
545295
|
function getITerm2PlistPath() {
|
|
545236
|
-
return join154(
|
|
545296
|
+
return join154(homedir38(), "Library", "Preferences", "com.googlecode.iterm2.plist");
|
|
545237
545297
|
}
|
|
545238
545298
|
async function checkAndRestoreITerm2Backup() {
|
|
545239
545299
|
const { inProgress, backupPath } = getIterm2RecoveryInfo();
|
|
@@ -549284,14 +549344,14 @@ __export(exports_bridgePointer, {
|
|
|
549284
549344
|
BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
|
|
549285
549345
|
});
|
|
549286
549346
|
import { mkdir as mkdir44, readFile as readFile51, stat as stat49, unlink as unlink25, writeFile as writeFile47 } from "fs/promises";
|
|
549287
|
-
import { dirname as
|
|
549347
|
+
import { dirname as dirname62, join as join157 } from "path";
|
|
549288
549348
|
function getBridgePointerPath(dir) {
|
|
549289
549349
|
return join157(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
|
|
549290
549350
|
}
|
|
549291
549351
|
async function writeBridgePointer(dir, pointer) {
|
|
549292
549352
|
const path23 = getBridgePointerPath(dir);
|
|
549293
549353
|
try {
|
|
549294
|
-
await mkdir44(
|
|
549354
|
+
await mkdir44(dirname62(path23), { recursive: true });
|
|
549295
549355
|
await writeFile47(path23, jsonStringify(pointer), "utf8");
|
|
549296
549356
|
logForDebugging2(`[bridge:pointer] wrote ${path23}`);
|
|
549297
549357
|
} catch (err3) {
|
|
@@ -551295,7 +551355,7 @@ __export(exports_print, {
|
|
|
551295
551355
|
canBatchWith: () => canBatchWith
|
|
551296
551356
|
});
|
|
551297
551357
|
import { readFile as readFile52, stat as stat50 } from "fs/promises";
|
|
551298
|
-
import { dirname as
|
|
551358
|
+
import { dirname as dirname63 } from "path";
|
|
551299
551359
|
import { cwd as cwd2 } from "process";
|
|
551300
551360
|
import { randomUUID as randomUUID53 } from "crypto";
|
|
551301
551361
|
function trackReceivedMessageUuid(uuid3) {
|
|
@@ -553730,7 +553790,7 @@ async function loadInitialMessages(setAppState, options2) {
|
|
|
553730
553790
|
if (false) {}
|
|
553731
553791
|
if (!options2.forkSession) {
|
|
553732
553792
|
if (result.sessionId) {
|
|
553733
|
-
switchSession(asSessionId(result.sessionId), result.fullPath ?
|
|
553793
|
+
switchSession(asSessionId(result.sessionId), result.fullPath ? dirname63(result.fullPath) : null);
|
|
553734
553794
|
if (persistSession) {
|
|
553735
553795
|
await resetSessionFilePointer();
|
|
553736
553796
|
}
|
|
@@ -553828,7 +553888,7 @@ async function loadInitialMessages(setAppState, options2) {
|
|
|
553828
553888
|
}
|
|
553829
553889
|
if (false) {}
|
|
553830
553890
|
if (!options2.forkSession && result.sessionId) {
|
|
553831
|
-
switchSession(asSessionId(result.sessionId), result.fullPath ?
|
|
553891
|
+
switchSession(asSessionId(result.sessionId), result.fullPath ? dirname63(result.fullPath) : null);
|
|
553832
553892
|
if (persistSession) {
|
|
553833
553893
|
await resetSessionFilePointer();
|
|
553834
553894
|
}
|
|
@@ -555225,7 +555285,7 @@ __export(exports_claudeDesktop, {
|
|
|
555225
555285
|
getClaudeDesktopConfigPath: () => getClaudeDesktopConfigPath
|
|
555226
555286
|
});
|
|
555227
555287
|
import { readdir as readdir31, readFile as readFile53, stat as stat51 } from "fs/promises";
|
|
555228
|
-
import { homedir as
|
|
555288
|
+
import { homedir as homedir39 } from "os";
|
|
555229
555289
|
import { join as join158 } from "path";
|
|
555230
555290
|
async function getClaudeDesktopConfigPath() {
|
|
555231
555291
|
const platform8 = getPlatform();
|
|
@@ -555233,7 +555293,7 @@ async function getClaudeDesktopConfigPath() {
|
|
|
555233
555293
|
throw new Error(`Unsupported platform: ${platform8} - Claude Desktop integration only works on macOS and WSL.`);
|
|
555234
555294
|
}
|
|
555235
555295
|
if (platform8 === "macos") {
|
|
555236
|
-
return join158(
|
|
555296
|
+
return join158(homedir39(), "Library", "Application Support", "Claude", "claude_desktop_config.json");
|
|
555237
555297
|
}
|
|
555238
555298
|
const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
|
|
555239
555299
|
if (windowsHome) {
|
|
@@ -555648,7 +555708,7 @@ __export(exports_plugins, {
|
|
|
555648
555708
|
VALID_UPDATE_SCOPES: () => VALID_UPDATE_SCOPES,
|
|
555649
555709
|
VALID_INSTALLABLE_SCOPES: () => VALID_INSTALLABLE_SCOPES
|
|
555650
555710
|
});
|
|
555651
|
-
import { basename as basename57, dirname as
|
|
555711
|
+
import { basename as basename57, dirname as dirname64 } from "path";
|
|
555652
555712
|
function handleMarketplaceError(error42, action2) {
|
|
555653
555713
|
logError2(error42);
|
|
555654
555714
|
cliError(`${figures_default.cross} Failed to ${action2}: ${errorMessage(error42)}`);
|
|
@@ -555681,9 +555741,9 @@ async function pluginValidateHandler(manifestPath, options2) {
|
|
|
555681
555741
|
printValidationResult(result);
|
|
555682
555742
|
let contentResults = [];
|
|
555683
555743
|
if (result.fileType === "plugin") {
|
|
555684
|
-
const manifestDir =
|
|
555744
|
+
const manifestDir = dirname64(result.filePath);
|
|
555685
555745
|
if (basename57(manifestDir) === ".claude-plugin") {
|
|
555686
|
-
contentResults = await validatePluginContents(
|
|
555746
|
+
contentResults = await validatePluginContents(dirname64(manifestDir));
|
|
555687
555747
|
for (const r of contentResults) {
|
|
555688
555748
|
console.log(`Validating ${r.fileType}: ${r.filePath}
|
|
555689
555749
|
`);
|
|
@@ -556160,11 +556220,11 @@ var exports_install = {};
|
|
|
556160
556220
|
__export(exports_install, {
|
|
556161
556221
|
install: () => install
|
|
556162
556222
|
});
|
|
556163
|
-
import { homedir as
|
|
556223
|
+
import { homedir as homedir40 } from "node:os";
|
|
556164
556224
|
import { join as join159 } from "node:path";
|
|
556165
556225
|
function getInstallationPath2() {
|
|
556166
556226
|
const isWindows2 = env2.platform === "win32";
|
|
556167
|
-
const homeDir =
|
|
556227
|
+
const homeDir = homedir40();
|
|
556168
556228
|
if (isWindows2) {
|
|
556169
556229
|
const windowsPath = join159(homeDir, ".local", "bin", "claude.exe");
|
|
556170
556230
|
return windowsPath.replace(/\//g, "\\");
|
|
@@ -559017,7 +559077,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
559017
559077
|
pendingHookMessages
|
|
559018
559078
|
}, renderAndRun);
|
|
559019
559079
|
}
|
|
559020
|
-
}).version("0.9.
|
|
559080
|
+
}).version("0.9.21 (Snowcode)", "-v, --version", "Output the version number");
|
|
559021
559081
|
program.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
559022
559082
|
program.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
559023
559083
|
if (canUserConfigureAdvisor()) {
|
|
@@ -559578,7 +559638,7 @@ function validateProviderEnvOrExit() {
|
|
|
559578
559638
|
async function main2() {
|
|
559579
559639
|
const args = process.argv.slice(2);
|
|
559580
559640
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
559581
|
-
console.log(`${"0.9.
|
|
559641
|
+
console.log(`${"0.9.21"} (Snowcode)`);
|
|
559582
559642
|
return;
|
|
559583
559643
|
}
|
|
559584
559644
|
validateProviderEnvOrExit();
|
|
@@ -559667,4 +559727,4 @@ async function main2() {
|
|
|
559667
559727
|
}
|
|
559668
559728
|
main2();
|
|
559669
559729
|
|
|
559670
|
-
//# debugId=
|
|
559730
|
+
//# debugId=E43E7FACDA558B6964756E2164756E21
|