@verboo/code 0.9.2 → 0.9.3
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 +265 -370
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -16549,7 +16549,7 @@ function getPathsForPermissionCheck(inputPath) {
|
|
|
16549
16549
|
path7 = nodePath.join(homedir2().normalize("NFC"), path7.slice(2));
|
|
16550
16550
|
}
|
|
16551
16551
|
const pathSet = new Set;
|
|
16552
|
-
const fsImpl =
|
|
16552
|
+
const fsImpl = getFsImplementation();
|
|
16553
16553
|
pathSet.add(path7);
|
|
16554
16554
|
if (path7.startsWith("//") || path7.startsWith("\\\\")) {
|
|
16555
16555
|
return Array.from(pathSet);
|
|
@@ -16591,7 +16591,7 @@ function getPathsForPermissionCheck(inputPath) {
|
|
|
16591
16591
|
}
|
|
16592
16592
|
return Array.from(pathSet);
|
|
16593
16593
|
}
|
|
16594
|
-
function
|
|
16594
|
+
function getFsImplementation() {
|
|
16595
16595
|
return activeFs;
|
|
16596
16596
|
}
|
|
16597
16597
|
async function readFileRange(path7, offset, maxBytes) {
|
|
@@ -17108,10 +17108,10 @@ function getDebugWriter() {
|
|
|
17108
17108
|
if (isDebugMode()) {
|
|
17109
17109
|
if (needMkdir) {
|
|
17110
17110
|
try {
|
|
17111
|
-
|
|
17111
|
+
getFsImplementation().mkdirSync(dir);
|
|
17112
17112
|
} catch {}
|
|
17113
17113
|
}
|
|
17114
|
-
|
|
17114
|
+
getFsImplementation().appendFileSync(path7, content);
|
|
17115
17115
|
updateLatestDebugLogSymlink();
|
|
17116
17116
|
return;
|
|
17117
17117
|
}
|
|
@@ -17371,10 +17371,10 @@ var init_cachePaths = __esm(() => {
|
|
|
17371
17371
|
init_fsOperations();
|
|
17372
17372
|
paths = envPaths("claude-cli");
|
|
17373
17373
|
CACHE_PATHS = {
|
|
17374
|
-
baseLogs: () => join4(paths.cache, getProjectDir(
|
|
17375
|
-
errors: () => join4(paths.cache, getProjectDir(
|
|
17376
|
-
messages: () => join4(paths.cache, getProjectDir(
|
|
17377
|
-
mcpLogs: (serverName) => join4(paths.cache, getProjectDir(
|
|
17374
|
+
baseLogs: () => join4(paths.cache, getProjectDir(getFsImplementation().cwd())),
|
|
17375
|
+
errors: () => join4(paths.cache, getProjectDir(getFsImplementation().cwd()), "errors"),
|
|
17376
|
+
messages: () => join4(paths.cache, getProjectDir(getFsImplementation().cwd()), "messages"),
|
|
17377
|
+
mcpLogs: (serverName) => join4(paths.cache, getProjectDir(getFsImplementation().cwd()), `mcp-logs-${sanitizePath(serverName)}`)
|
|
17378
17378
|
};
|
|
17379
17379
|
});
|
|
17380
17380
|
|
|
@@ -18438,7 +18438,7 @@ var init_plainTextStorage = __esm(() => {
|
|
|
18438
18438
|
read() {
|
|
18439
18439
|
const { storagePath } = getStoragePath();
|
|
18440
18440
|
try {
|
|
18441
|
-
const data =
|
|
18441
|
+
const data = getFsImplementation().readFileSync(storagePath, {
|
|
18442
18442
|
encoding: "utf8"
|
|
18443
18443
|
});
|
|
18444
18444
|
return jsonParse(data);
|
|
@@ -18449,7 +18449,7 @@ var init_plainTextStorage = __esm(() => {
|
|
|
18449
18449
|
async readAsync() {
|
|
18450
18450
|
const { storagePath } = getStoragePath();
|
|
18451
18451
|
try {
|
|
18452
|
-
const data = await
|
|
18452
|
+
const data = await getFsImplementation().readFile(storagePath, {
|
|
18453
18453
|
encoding: "utf8"
|
|
18454
18454
|
});
|
|
18455
18455
|
return jsonParse(data);
|
|
@@ -18461,7 +18461,7 @@ var init_plainTextStorage = __esm(() => {
|
|
|
18461
18461
|
try {
|
|
18462
18462
|
const { storageDir, storagePath } = getStoragePath();
|
|
18463
18463
|
try {
|
|
18464
|
-
|
|
18464
|
+
getFsImplementation().mkdirSync(storageDir);
|
|
18465
18465
|
} catch (e) {
|
|
18466
18466
|
const code = getErrnoCode(e);
|
|
18467
18467
|
if (code !== "EEXIST") {
|
|
@@ -18484,7 +18484,7 @@ var init_plainTextStorage = __esm(() => {
|
|
|
18484
18484
|
delete() {
|
|
18485
18485
|
const { storagePath } = getStoragePath();
|
|
18486
18486
|
try {
|
|
18487
|
-
|
|
18487
|
+
getFsImplementation().unlinkSync(storagePath);
|
|
18488
18488
|
return true;
|
|
18489
18489
|
} catch (e) {
|
|
18490
18490
|
const code = getErrnoCode(e);
|
|
@@ -40502,6 +40502,7 @@ var init_env = __esm(() => {
|
|
|
40502
40502
|
init_combinedAbortSignal();
|
|
40503
40503
|
init_envUtils();
|
|
40504
40504
|
init_findExecutable();
|
|
40505
|
+
init_fsOperations();
|
|
40505
40506
|
init_which();
|
|
40506
40507
|
getGlobalClaudeFile = memoize_default(() => {
|
|
40507
40508
|
const oauthSuffix = fileSuffixForOauthConfig();
|
|
@@ -42145,7 +42146,7 @@ function logForDiagnosticsNoPII(level, event, data) {
|
|
|
42145
42146
|
event,
|
|
42146
42147
|
data: data ?? {}
|
|
42147
42148
|
};
|
|
42148
|
-
const fs2 =
|
|
42149
|
+
const fs2 = getFsImplementation();
|
|
42149
42150
|
const line = jsonStringify(entry) + `
|
|
42150
42151
|
`;
|
|
42151
42152
|
try {
|
|
@@ -43209,7 +43210,7 @@ function isLocalHost(host) {
|
|
|
43209
43210
|
return hostWithoutPort === "localhost" || /^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(hostWithoutPort);
|
|
43210
43211
|
}
|
|
43211
43212
|
function isCurrentDirectoryBareGitRepo() {
|
|
43212
|
-
const fs2 =
|
|
43213
|
+
const fs2 = getFsImplementation();
|
|
43213
43214
|
const cwd2 = getCwd();
|
|
43214
43215
|
const gitPath = join13(cwd2, ".git");
|
|
43215
43216
|
try {
|
|
@@ -43426,7 +43427,7 @@ var init_platform2 = __esm(() => {
|
|
|
43426
43427
|
}
|
|
43427
43428
|
if (process.platform === "linux") {
|
|
43428
43429
|
try {
|
|
43429
|
-
const procVersion =
|
|
43430
|
+
const procVersion = getFsImplementation().readFileSync("/proc/version", { encoding: "utf8" });
|
|
43430
43431
|
if (procVersion.toLowerCase().includes("microsoft") || procVersion.toLowerCase().includes("wsl")) {
|
|
43431
43432
|
return "wsl";
|
|
43432
43433
|
}
|
|
@@ -43446,7 +43447,7 @@ var init_platform2 = __esm(() => {
|
|
|
43446
43447
|
return;
|
|
43447
43448
|
}
|
|
43448
43449
|
try {
|
|
43449
|
-
const procVersion =
|
|
43450
|
+
const procVersion = getFsImplementation().readFileSync("/proc/version", {
|
|
43450
43451
|
encoding: "utf8"
|
|
43451
43452
|
});
|
|
43452
43453
|
const wslVersionMatch = procVersion.match(/WSL(\d+)/i);
|
|
@@ -44102,7 +44103,7 @@ var init_sessionStoragePortable = __esm(() => {
|
|
|
44102
44103
|
import { homedir as homedir6 } from "os";
|
|
44103
44104
|
import { dirname as dirname7, isAbsolute as isAbsolute2, join as join16, normalize, relative, resolve as resolve7 } from "path";
|
|
44104
44105
|
function expandPath(path10, baseDir) {
|
|
44105
|
-
const actualBaseDir = baseDir ?? getCwd() ??
|
|
44106
|
+
const actualBaseDir = baseDir ?? getCwd() ?? getFsImplementation().cwd();
|
|
44106
44107
|
if (typeof path10 !== "string") {
|
|
44107
44108
|
throw new TypeError(`Path must be a string, received ${typeof path10}`);
|
|
44108
44109
|
}
|
|
@@ -44145,7 +44146,7 @@ function getDirectoryForPath(path10) {
|
|
|
44145
44146
|
return dirname7(absolutePath);
|
|
44146
44147
|
}
|
|
44147
44148
|
try {
|
|
44148
|
-
const stats =
|
|
44149
|
+
const stats = getFsImplementation().statSync(absolutePath);
|
|
44149
44150
|
if (stats.isDirectory()) {
|
|
44150
44151
|
return absolutePath;
|
|
44151
44152
|
}
|
|
@@ -55907,7 +55908,7 @@ var init_v4 = __esm(() => {
|
|
|
55907
55908
|
|
|
55908
55909
|
// src/utils/fileRead.ts
|
|
55909
55910
|
function detectEncodingForResolvedPath(resolvedPath) {
|
|
55910
|
-
const { buffer, bytesRead } =
|
|
55911
|
+
const { buffer, bytesRead } = getFsImplementation().readSync(resolvedPath, {
|
|
55911
55912
|
length: 4096
|
|
55912
55913
|
});
|
|
55913
55914
|
if (bytesRead === 0) {
|
|
@@ -55938,7 +55939,7 @@ function detectLineEndingsForString(content) {
|
|
|
55938
55939
|
return crlfCount > lfCount ? "CRLF" : "LF";
|
|
55939
55940
|
}
|
|
55940
55941
|
function readFileSyncWithMetadata(filePath) {
|
|
55941
|
-
const fs2 =
|
|
55942
|
+
const fs2 = getFsImplementation();
|
|
55942
55943
|
const { resolvedPath, isSymlink } = safeResolvePath(fs2, filePath);
|
|
55943
55944
|
if (isSymlink) {
|
|
55944
55945
|
logForDebugging(`Reading through symlink: ${filePath} -> ${resolvedPath}`);
|
|
@@ -56042,7 +56043,7 @@ class FileReadCache {
|
|
|
56042
56043
|
sizeCalculation: (value) => Math.max(1, Buffer.byteLength(value.content))
|
|
56043
56044
|
});
|
|
56044
56045
|
readFile(filePath) {
|
|
56045
|
-
const fs2 =
|
|
56046
|
+
const fs2 = getFsImplementation();
|
|
56046
56047
|
let stats;
|
|
56047
56048
|
try {
|
|
56048
56049
|
stats = fs2.statSync(filePath);
|
|
@@ -56116,7 +56117,7 @@ async function pathExists(path10) {
|
|
|
56116
56117
|
}
|
|
56117
56118
|
function readFileSafe(filepath) {
|
|
56118
56119
|
try {
|
|
56119
|
-
const fs2 =
|
|
56120
|
+
const fs2 = getFsImplementation();
|
|
56120
56121
|
return fs2.readFileSync(filepath, { encoding: "utf8" });
|
|
56121
56122
|
} catch (error41) {
|
|
56122
56123
|
logError2(error41);
|
|
@@ -56124,11 +56125,11 @@ function readFileSafe(filepath) {
|
|
|
56124
56125
|
}
|
|
56125
56126
|
}
|
|
56126
56127
|
function getFileModificationTime(filePath) {
|
|
56127
|
-
const fs2 =
|
|
56128
|
+
const fs2 = getFsImplementation();
|
|
56128
56129
|
return Math.floor(fs2.statSync(filePath).mtimeMs);
|
|
56129
56130
|
}
|
|
56130
56131
|
async function getFileModificationTimeAsync(filePath) {
|
|
56131
|
-
const s = await
|
|
56132
|
+
const s = await getFsImplementation().stat(filePath);
|
|
56132
56133
|
return Math.floor(s.mtimeMs);
|
|
56133
56134
|
}
|
|
56134
56135
|
function writeTextContent(filePath, content, encoding, endings) {
|
|
@@ -56144,7 +56145,7 @@ function writeTextContent(filePath, content, encoding, endings) {
|
|
|
56144
56145
|
}
|
|
56145
56146
|
function detectFileEncoding(filePath) {
|
|
56146
56147
|
try {
|
|
56147
|
-
const fs2 =
|
|
56148
|
+
const fs2 = getFsImplementation();
|
|
56148
56149
|
const { resolvedPath } = safeResolvePath(fs2, filePath);
|
|
56149
56150
|
return detectEncodingForResolvedPath(resolvedPath);
|
|
56150
56151
|
} catch (error41) {
|
|
@@ -56160,7 +56161,7 @@ function detectFileEncoding(filePath) {
|
|
|
56160
56161
|
}
|
|
56161
56162
|
function detectLineEndings(filePath, encoding = "utf8") {
|
|
56162
56163
|
try {
|
|
56163
|
-
const fs2 =
|
|
56164
|
+
const fs2 = getFsImplementation();
|
|
56164
56165
|
const { resolvedPath } = safeResolvePath(fs2, filePath);
|
|
56165
56166
|
const { buffer, bytesRead } = fs2.readSync(resolvedPath, { length: 4096 });
|
|
56166
56167
|
const content = buffer.toString(encoding, 0, bytesRead);
|
|
@@ -56192,7 +56193,7 @@ function getDisplayPath(filePath) {
|
|
|
56192
56193
|
return filePath;
|
|
56193
56194
|
}
|
|
56194
56195
|
function findSimilarFile(filePath) {
|
|
56195
|
-
const fs2 =
|
|
56196
|
+
const fs2 = getFsImplementation();
|
|
56196
56197
|
try {
|
|
56197
56198
|
const dir = dirname8(filePath);
|
|
56198
56199
|
const fileBaseName = basename3(filePath, extname(filePath));
|
|
@@ -56261,7 +56262,7 @@ function stripLineNumberPrefix(line) {
|
|
|
56261
56262
|
}
|
|
56262
56263
|
function isDirEmpty(dirPath) {
|
|
56263
56264
|
try {
|
|
56264
|
-
return
|
|
56265
|
+
return getFsImplementation().isDirEmptySync(dirPath);
|
|
56265
56266
|
} catch (e) {
|
|
56266
56267
|
return isENOENT(e);
|
|
56267
56268
|
}
|
|
@@ -56271,7 +56272,7 @@ function readFileSyncCached(filePath) {
|
|
|
56271
56272
|
return content;
|
|
56272
56273
|
}
|
|
56273
56274
|
function writeFileSyncAndFlush_DEPRECATED(filePath, content, options = { encoding: "utf-8" }) {
|
|
56274
|
-
const fs2 =
|
|
56275
|
+
const fs2 = getFsImplementation();
|
|
56275
56276
|
let targetPath = filePath;
|
|
56276
56277
|
try {
|
|
56277
56278
|
const linkTarget = fs2.readlinkSync(filePath);
|
|
@@ -56350,19 +56351,19 @@ function getDesktopPath() {
|
|
|
56350
56351
|
if (windowsHome) {
|
|
56351
56352
|
const wslPath = windowsHome.replace(/^[A-Z]:/, "");
|
|
56352
56353
|
const desktopPath2 = `/mnt/c${wslPath}/Desktop`;
|
|
56353
|
-
if (
|
|
56354
|
+
if (getFsImplementation().existsSync(desktopPath2)) {
|
|
56354
56355
|
return desktopPath2;
|
|
56355
56356
|
}
|
|
56356
56357
|
}
|
|
56357
56358
|
try {
|
|
56358
56359
|
const usersDir = "/mnt/c/Users";
|
|
56359
|
-
const userDirs =
|
|
56360
|
+
const userDirs = getFsImplementation().readdirSync(usersDir);
|
|
56360
56361
|
for (const user of userDirs) {
|
|
56361
56362
|
if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
|
|
56362
56363
|
continue;
|
|
56363
56364
|
}
|
|
56364
56365
|
const potentialDesktopPath = join18(usersDir, user.name, "Desktop");
|
|
56365
|
-
if (
|
|
56366
|
+
if (getFsImplementation().existsSync(potentialDesktopPath)) {
|
|
56366
56367
|
return potentialDesktopPath;
|
|
56367
56368
|
}
|
|
56368
56369
|
}
|
|
@@ -56371,14 +56372,14 @@ function getDesktopPath() {
|
|
|
56371
56372
|
}
|
|
56372
56373
|
}
|
|
56373
56374
|
const desktopPath = join18(homeDir, "Desktop");
|
|
56374
|
-
if (
|
|
56375
|
+
if (getFsImplementation().existsSync(desktopPath)) {
|
|
56375
56376
|
return desktopPath;
|
|
56376
56377
|
}
|
|
56377
56378
|
return homeDir;
|
|
56378
56379
|
}
|
|
56379
56380
|
function isFileWithinReadSizeLimit(filePath, maxSizeBytes = MAX_OUTPUT_SIZE) {
|
|
56380
56381
|
try {
|
|
56381
|
-
const stats =
|
|
56382
|
+
const stats = getFsImplementation().statSync(filePath);
|
|
56382
56383
|
return stats.size <= maxSizeBytes;
|
|
56383
56384
|
} catch {
|
|
56384
56385
|
return false;
|
|
@@ -58673,7 +58674,7 @@ function profileReport() {
|
|
|
58673
58674
|
if (DETAILED_PROFILING) {
|
|
58674
58675
|
const path10 = getStartupPerfLogPath();
|
|
58675
58676
|
const dir = dirname10(path10);
|
|
58676
|
-
const fs2 =
|
|
58677
|
+
const fs2 = getFsImplementation();
|
|
58677
58678
|
fs2.mkdirSync(dir);
|
|
58678
58679
|
writeFileSync_DEPRECATED(path10, getReport(), {
|
|
58679
58680
|
encoding: "utf8",
|
|
@@ -88459,7 +88460,7 @@ var init_caCerts = __esm(() => {
|
|
|
88459
88460
|
}
|
|
88460
88461
|
if (extraCertsPath) {
|
|
88461
88462
|
try {
|
|
88462
|
-
const extraCert =
|
|
88463
|
+
const extraCert = getFsImplementation().readFileSync(extraCertsPath, {
|
|
88463
88464
|
encoding: "utf8"
|
|
88464
88465
|
});
|
|
88465
88466
|
certs.push(extraCert);
|
|
@@ -110872,7 +110873,7 @@ var init_mtls = __esm(() => {
|
|
|
110872
110873
|
const config2 = {};
|
|
110873
110874
|
if (process.env.CLAUDE_CODE_CLIENT_CERT) {
|
|
110874
110875
|
try {
|
|
110875
|
-
config2.cert =
|
|
110876
|
+
config2.cert = getFsImplementation().readFileSync(process.env.CLAUDE_CODE_CLIENT_CERT, { encoding: "utf8" });
|
|
110876
110877
|
logForDebugging("mTLS: Loaded client certificate from CLAUDE_CODE_CLIENT_CERT");
|
|
110877
110878
|
} catch (error41) {
|
|
110878
110879
|
logForDebugging(`mTLS: Failed to load client certificate: ${error41}`, {
|
|
@@ -110882,7 +110883,7 @@ var init_mtls = __esm(() => {
|
|
|
110882
110883
|
}
|
|
110883
110884
|
if (process.env.CLAUDE_CODE_CLIENT_KEY) {
|
|
110884
110885
|
try {
|
|
110885
|
-
config2.key =
|
|
110886
|
+
config2.key = getFsImplementation().readFileSync(process.env.CLAUDE_CODE_CLIENT_KEY, { encoding: "utf8" });
|
|
110886
110887
|
logForDebugging("mTLS: Loaded client key from CLAUDE_CODE_CLIENT_KEY");
|
|
110887
110888
|
} catch (error41) {
|
|
110888
110889
|
logForDebugging(`mTLS: Failed to load client key: ${error41}`, {
|
|
@@ -138074,7 +138075,7 @@ function maybePersistTokenForSubprocesses(path10, token, tokenName) {
|
|
|
138074
138075
|
}
|
|
138075
138076
|
function readTokenFromWellKnownFile(path10, tokenName) {
|
|
138076
138077
|
try {
|
|
138077
|
-
const fsOps =
|
|
138078
|
+
const fsOps = getFsImplementation();
|
|
138078
138079
|
const token = fsOps.readFileSync(path10, { encoding: "utf8" }).trim();
|
|
138079
138080
|
if (!token) {
|
|
138080
138081
|
return null;
|
|
@@ -138112,7 +138113,7 @@ function getCredentialFromFd({
|
|
|
138112
138113
|
return null;
|
|
138113
138114
|
}
|
|
138114
138115
|
try {
|
|
138115
|
-
const fsOps =
|
|
138116
|
+
const fsOps = getFsImplementation();
|
|
138116
138117
|
const fdPath = process.platform === "darwin" || process.platform === "freebsd" ? `/dev/fd/${fd}` : `/proc/self/fd/${fd}`;
|
|
138117
138118
|
const token = fsOps.readFileSync(fdPath, { encoding: "utf8" }).trim();
|
|
138118
138119
|
if (!token) {
|
|
@@ -153631,7 +153632,7 @@ function isPathAllowed(resolvedPath, context, operationType, precomputedPathsToC
|
|
|
153631
153632
|
function validateGlobPattern(cleanPath, cwd2, toolPermissionContext, operationType) {
|
|
153632
153633
|
if (containsPathTraversal(cleanPath)) {
|
|
153633
153634
|
const absolutePath = isAbsolute5(cleanPath) ? cleanPath : resolve15(cwd2, cleanPath);
|
|
153634
|
-
const { resolvedPath: resolvedPath2, isCanonical: isCanonical2 } = safeResolvePath(
|
|
153635
|
+
const { resolvedPath: resolvedPath2, isCanonical: isCanonical2 } = safeResolvePath(getFsImplementation(), absolutePath);
|
|
153635
153636
|
const result2 = isPathAllowed(resolvedPath2, toolPermissionContext, operationType, isCanonical2 ? [resolvedPath2] : undefined);
|
|
153636
153637
|
return {
|
|
153637
153638
|
allowed: result2.allowed,
|
|
@@ -153641,7 +153642,7 @@ function validateGlobPattern(cleanPath, cwd2, toolPermissionContext, operationTy
|
|
|
153641
153642
|
}
|
|
153642
153643
|
const basePath = getGlobBaseDirectory(cleanPath);
|
|
153643
153644
|
const absoluteBasePath = isAbsolute5(basePath) ? basePath : resolve15(cwd2, basePath);
|
|
153644
|
-
const { resolvedPath, isCanonical } = safeResolvePath(
|
|
153645
|
+
const { resolvedPath, isCanonical } = safeResolvePath(getFsImplementation(), absoluteBasePath);
|
|
153645
153646
|
const result = isPathAllowed(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
|
|
153646
153647
|
return {
|
|
153647
153648
|
allowed: result.allowed,
|
|
@@ -153720,7 +153721,7 @@ function validatePath(path11, cwd2, toolPermissionContext, operationType) {
|
|
|
153720
153721
|
return validateGlobPattern(cleanPath, cwd2, toolPermissionContext, operationType);
|
|
153721
153722
|
}
|
|
153722
153723
|
const absolutePath = isAbsolute5(cleanPath) ? cleanPath : resolve15(cwd2, cleanPath);
|
|
153723
|
-
const { resolvedPath, isCanonical } = safeResolvePath(
|
|
153724
|
+
const { resolvedPath, isCanonical } = safeResolvePath(getFsImplementation(), absolutePath);
|
|
153724
153725
|
const result = isPathAllowed(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
|
|
153725
153726
|
return {
|
|
153726
153727
|
allowed: result.allowed,
|
|
@@ -156933,7 +156934,7 @@ async function generateMcpConfig(manifest, extractedPath, userConfig = {}) {
|
|
|
156933
156934
|
return mcpConfig;
|
|
156934
156935
|
}
|
|
156935
156936
|
async function loadCacheMetadata(cacheDir, source) {
|
|
156936
|
-
const fs2 =
|
|
156937
|
+
const fs2 = getFsImplementation();
|
|
156937
156938
|
const metadataPath = getMetadataPath(cacheDir, source);
|
|
156938
156939
|
try {
|
|
156939
156940
|
const content = await fs2.readFile(metadataPath, { encoding: "utf-8" });
|
|
@@ -156952,7 +156953,7 @@ async function loadCacheMetadata(cacheDir, source) {
|
|
|
156952
156953
|
}
|
|
156953
156954
|
async function saveCacheMetadata(cacheDir, source, metadata) {
|
|
156954
156955
|
const metadataPath = getMetadataPath(cacheDir, source);
|
|
156955
|
-
await
|
|
156956
|
+
await getFsImplementation().mkdir(cacheDir);
|
|
156956
156957
|
await writeFile3(metadataPath, jsonStringify(metadata, null, 2), "utf-8");
|
|
156957
156958
|
}
|
|
156958
156959
|
async function downloadMcpb(url3, destPath, onProgress) {
|
|
@@ -156997,7 +156998,7 @@ async function extractMcpbContents(unzipped, extractPath, modes, onProgress) {
|
|
|
156997
156998
|
if (onProgress) {
|
|
156998
156999
|
onProgress("Extracting files...");
|
|
156999
157000
|
}
|
|
157000
|
-
await
|
|
157001
|
+
await getFsImplementation().mkdir(extractPath);
|
|
157001
157002
|
let filesWritten = 0;
|
|
157002
157003
|
const entries = Object.entries(unzipped).filter(([k]) => !k.endsWith("/"));
|
|
157003
157004
|
const totalFiles = entries.length;
|
|
@@ -157005,7 +157006,7 @@ async function extractMcpbContents(unzipped, extractPath, modes, onProgress) {
|
|
|
157005
157006
|
const fullPath = join31(extractPath, filePath);
|
|
157006
157007
|
const dir = dirname17(fullPath);
|
|
157007
157008
|
if (dir !== extractPath) {
|
|
157008
|
-
await
|
|
157009
|
+
await getFsImplementation().mkdir(dir);
|
|
157009
157010
|
}
|
|
157010
157011
|
const isTextFile = filePath.endsWith(".json") || filePath.endsWith(".js") || filePath.endsWith(".ts") || filePath.endsWith(".txt") || filePath.endsWith(".md") || filePath.endsWith(".yml") || filePath.endsWith(".yaml");
|
|
157011
157012
|
if (isTextFile) {
|
|
@@ -157029,7 +157030,7 @@ async function extractMcpbContents(unzipped, extractPath, modes, onProgress) {
|
|
|
157029
157030
|
}
|
|
157030
157031
|
}
|
|
157031
157032
|
async function checkMcpbChanged(source, pluginPath) {
|
|
157032
|
-
const fs2 =
|
|
157033
|
+
const fs2 = getFsImplementation();
|
|
157033
157034
|
const cacheDir = getMcpbCacheDir(pluginPath);
|
|
157034
157035
|
const metadata = await loadCacheMetadata(cacheDir, source);
|
|
157035
157036
|
if (!metadata) {
|
|
@@ -157070,7 +157071,7 @@ async function checkMcpbChanged(source, pluginPath) {
|
|
|
157070
157071
|
return false;
|
|
157071
157072
|
}
|
|
157072
157073
|
async function loadMcpbFile(source, pluginPath, pluginId, onProgress, providedUserConfig, forceConfigDialog) {
|
|
157073
|
-
const fs2 =
|
|
157074
|
+
const fs2 = getFsImplementation();
|
|
157074
157075
|
const cacheDir = getMcpbCacheDir(pluginPath);
|
|
157075
157076
|
await fs2.mkdir(cacheDir);
|
|
157076
157077
|
logForDebugging(`Loading MCPB from source: ${source}`);
|
|
@@ -157416,7 +157417,7 @@ var init_pluginOptionsStorage = __esm(() => {
|
|
|
157416
157417
|
// src/utils/plugins/walkPluginMarkdown.ts
|
|
157417
157418
|
import { join as join32 } from "path";
|
|
157418
157419
|
async function walkPluginMarkdown(rootDir, onFile, opts = {}) {
|
|
157419
|
-
const fs2 =
|
|
157420
|
+
const fs2 = getFsImplementation();
|
|
157420
157421
|
const label = opts.logLabel ?? "plugin";
|
|
157421
157422
|
async function scan(dirPath, namespace) {
|
|
157422
157423
|
try {
|
|
@@ -157460,7 +157461,7 @@ async function loadAgentsFromDirectory(agentsPath, pluginName, sourceName, plugi
|
|
|
157460
157461
|
return agents;
|
|
157461
157462
|
}
|
|
157462
157463
|
async function loadAgentFromFile(filePath, pluginName, namespace, sourceName, pluginPath, pluginManifest, loadedPaths) {
|
|
157463
|
-
const fs2 =
|
|
157464
|
+
const fs2 = getFsImplementation();
|
|
157464
157465
|
if (isDuplicatePath(fs2, filePath, loadedPaths)) {
|
|
157465
157466
|
return null;
|
|
157466
157467
|
}
|
|
@@ -157602,7 +157603,7 @@ var init_loadPluginAgents = __esm(() => {
|
|
|
157602
157603
|
if (plugin.agentsPaths) {
|
|
157603
157604
|
const pathResults = await Promise.all(plugin.agentsPaths.map(async (agentPath) => {
|
|
157604
157605
|
try {
|
|
157605
|
-
const fs2 =
|
|
157606
|
+
const fs2 = getFsImplementation();
|
|
157606
157607
|
const stats = await fs2.stat(agentPath);
|
|
157607
157608
|
if (stats.isDirectory()) {
|
|
157608
157609
|
const agents = await loadAgentsFromDirectory(agentPath, plugin.name, plugin.source, plugin.path, plugin.manifest, loadedPaths);
|
|
@@ -164725,7 +164726,7 @@ function handleMemoryFileReadError(error41, filePath) {
|
|
|
164725
164726
|
}
|
|
164726
164727
|
async function safelyReadMemoryFileAsync(filePath, type, includeBasePath) {
|
|
164727
164728
|
try {
|
|
164728
|
-
const fs2 =
|
|
164729
|
+
const fs2 = getFsImplementation();
|
|
164729
164730
|
const rawContent = await fs2.readFile(filePath, { encoding: "utf-8" });
|
|
164730
164731
|
return parseMemoryFileContent(rawContent, filePath, type, includeBasePath);
|
|
164731
164732
|
} catch (error41) {
|
|
@@ -164805,7 +164806,7 @@ function isClaudeMdExcluded(filePath, type) {
|
|
|
164805
164806
|
return import_picomatch.default.isMatch(normalizedPath, expandedPatterns, matchOpts);
|
|
164806
164807
|
}
|
|
164807
164808
|
function resolveExcludePatterns(patterns) {
|
|
164808
|
-
const fs2 =
|
|
164809
|
+
const fs2 = getFsImplementation();
|
|
164809
164810
|
const expanded = patterns.map((p) => p.replaceAll("\\", "/"));
|
|
164810
164811
|
for (const normalized of expanded) {
|
|
164811
164812
|
if (!normalized.startsWith("/")) {
|
|
@@ -164832,7 +164833,7 @@ async function processMemoryFile(filePath, type, processedPaths, includeExternal
|
|
|
164832
164833
|
if (isClaudeMdExcluded(filePath, type)) {
|
|
164833
164834
|
return [];
|
|
164834
164835
|
}
|
|
164835
|
-
const { resolvedPath, isSymlink } = safeResolvePath(
|
|
164836
|
+
const { resolvedPath, isSymlink } = safeResolvePath(getFsImplementation(), filePath);
|
|
164836
164837
|
processedPaths.add(normalizedPath);
|
|
164837
164838
|
if (isSymlink) {
|
|
164838
164839
|
processedPaths.add(normalizePathForComparison(resolvedPath));
|
|
@@ -164868,7 +164869,7 @@ async function processMdRules({
|
|
|
164868
164869
|
return [];
|
|
164869
164870
|
}
|
|
164870
164871
|
try {
|
|
164871
|
-
const fs2 =
|
|
164872
|
+
const fs2 = getFsImplementation();
|
|
164872
164873
|
const { resolvedPath: resolvedRulesDir, isSymlink } = safeResolvePath(fs2, rulesDir);
|
|
164873
164874
|
visitedDirs.add(rulesDir);
|
|
164874
164875
|
if (isSymlink) {
|
|
@@ -164957,7 +164958,7 @@ async function getManagedAndUserConditionalRules(targetPath, processedPaths) {
|
|
|
164957
164958
|
async function getMemoryFilesForNestedDirectory(dir, targetPath, processedPaths) {
|
|
164958
164959
|
const result = [];
|
|
164959
164960
|
if (isSettingSourceEnabled("projectSettings")) {
|
|
164960
|
-
const projectPath = getProjectInstructionFilePath(dir,
|
|
164961
|
+
const projectPath = getProjectInstructionFilePath(dir, getFsImplementation().existsSync);
|
|
164961
164962
|
result.push(...await processMemoryFile(projectPath, "Project", processedPaths, false));
|
|
164962
164963
|
const dotClaudePath = join36(dir, ".claude", "CLAUDE.md");
|
|
164963
164964
|
result.push(...await processMemoryFile(dotClaudePath, "Project", processedPaths, false));
|
|
@@ -165258,7 +165259,7 @@ var init_claudemd = __esm(() => {
|
|
|
165258
165259
|
for (const dir of dirs.reverse()) {
|
|
165259
165260
|
const skipProject = isNestedWorktree && pathInWorkingPath(dir, canonicalRoot) && !pathInWorkingPath(dir, gitRoot);
|
|
165260
165261
|
if (isSettingSourceEnabled("projectSettings") && !skipProject) {
|
|
165261
|
-
const projectPath = getProjectInstructionFilePath(dir,
|
|
165262
|
+
const projectPath = getProjectInstructionFilePath(dir, getFsImplementation().existsSync);
|
|
165262
165263
|
result.push(...await processMemoryFile(projectPath, "Project", processedPaths, includeExternal));
|
|
165263
165264
|
const dotClaudePath = join36(dir, ".claude", "CLAUDE.md");
|
|
165264
165265
|
result.push(...await processMemoryFile(dotClaudePath, "Project", processedPaths, includeExternal));
|
|
@@ -165279,7 +165280,7 @@ var init_claudemd = __esm(() => {
|
|
|
165279
165280
|
if (isEnvTruthy(process.env.CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD)) {
|
|
165280
165281
|
const additionalDirs = getAdditionalDirectoriesForClaudeMd();
|
|
165281
165282
|
for (const dir of additionalDirs) {
|
|
165282
|
-
const projectPath = getProjectInstructionFilePath(dir,
|
|
165283
|
+
const projectPath = getProjectInstructionFilePath(dir, getFsImplementation().existsSync);
|
|
165283
165284
|
result.push(...await processMemoryFile(projectPath, "Project", processedPaths, includeExternal));
|
|
165284
165285
|
const dotClaudePath = join36(dir, ".claude", "CLAUDE.md");
|
|
165285
165286
|
result.push(...await processMemoryFile(dotClaudePath, "Project", processedPaths, includeExternal));
|
|
@@ -165975,7 +165976,7 @@ async function waitForSessionMemoryExtraction() {
|
|
|
165975
165976
|
}
|
|
165976
165977
|
}
|
|
165977
165978
|
async function getSessionMemoryContent() {
|
|
165978
|
-
const fs2 =
|
|
165979
|
+
const fs2 = getFsImplementation();
|
|
165979
165980
|
const memoryPath = getSessionMemoryPath();
|
|
165980
165981
|
try {
|
|
165981
165982
|
const content = await fs2.readFile(memoryPath, { encoding: "utf-8" });
|
|
@@ -170637,7 +170638,7 @@ function getSettingsForSourceLenient_FOR_EDITING_ONLY_NOT_FOR_READING(source) {
|
|
|
170637
170638
|
return null;
|
|
170638
170639
|
}
|
|
170639
170640
|
try {
|
|
170640
|
-
const { resolvedPath } = safeResolvePath(
|
|
170641
|
+
const { resolvedPath } = safeResolvePath(getFsImplementation(), filePath);
|
|
170641
170642
|
const content = readFileSync7(resolvedPath);
|
|
170642
170643
|
if (content.trim() === "") {
|
|
170643
170644
|
return {};
|
|
@@ -196258,7 +196259,7 @@ function getCronFilePath(dir) {
|
|
|
196258
196259
|
return join40(dir ?? getProjectRoot(), CRON_FILE_REL);
|
|
196259
196260
|
}
|
|
196260
196261
|
async function readCronTasks(dir) {
|
|
196261
|
-
const fs2 =
|
|
196262
|
+
const fs2 = getFsImplementation();
|
|
196262
196263
|
let raw;
|
|
196263
196264
|
try {
|
|
196264
196265
|
raw = await fs2.readFile(getCronFilePath(dir), { encoding: "utf-8" });
|
|
@@ -212140,7 +212141,7 @@ async function loadPluginMcpServers(plugin, errors4 = []) {
|
|
|
212140
212141
|
return Object.keys(servers).length > 0 ? servers : undefined;
|
|
212141
212142
|
}
|
|
212142
212143
|
async function loadMcpServersFromFile(pluginPath, relativePath) {
|
|
212143
|
-
const fs2 =
|
|
212144
|
+
const fs2 = getFsImplementation();
|
|
212144
212145
|
const filePath = join43(pluginPath, relativePath);
|
|
212145
212146
|
let content;
|
|
212146
212147
|
try {
|
|
@@ -213212,7 +213213,7 @@ function parseMcpConfig(params) {
|
|
|
213212
213213
|
}
|
|
213213
213214
|
function parseMcpConfigFromFilePath(params) {
|
|
213214
213215
|
const { filePath, expandVars, scope } = params;
|
|
213215
|
-
const fs2 =
|
|
213216
|
+
const fs2 = getFsImplementation();
|
|
213216
213217
|
let configContent;
|
|
213217
213218
|
try {
|
|
213218
213219
|
configContent = fs2.readFileSync(filePath, { encoding: "utf8" });
|
|
@@ -216339,7 +216340,7 @@ function buildCommonPluginDirectoryPaths(ideName) {
|
|
|
216339
216340
|
}
|
|
216340
216341
|
async function detectPluginDirectories(ideName) {
|
|
216341
216342
|
const foundDirectories = [];
|
|
216342
|
-
const fs2 =
|
|
216343
|
+
const fs2 = getFsImplementation();
|
|
216343
216344
|
const pluginDirPaths = buildCommonPluginDirectoryPaths(ideName);
|
|
216344
216345
|
const idePatterns = ideNameToDirMap[ideName.toLowerCase()];
|
|
216345
216346
|
if (!idePatterns) {
|
|
@@ -216378,7 +216379,7 @@ async function isJetBrainsPluginInstalled(ideType) {
|
|
|
216378
216379
|
for (const dir of pluginDirs) {
|
|
216379
216380
|
const pluginPath = join48(dir, PLUGIN_PREFIX);
|
|
216380
216381
|
try {
|
|
216381
|
-
await
|
|
216382
|
+
await getFsImplementation().stat(pluginPath);
|
|
216382
216383
|
return true;
|
|
216383
216384
|
} catch {}
|
|
216384
216385
|
}
|
|
@@ -217472,12 +217473,12 @@ async function getSortedIdeLockfiles() {
|
|
|
217472
217473
|
const ideLockFilePaths = await getIdeLockfilesPaths();
|
|
217473
217474
|
const allLockfiles = await Promise.all(ideLockFilePaths.map(async (ideLockFilePath) => {
|
|
217474
217475
|
try {
|
|
217475
|
-
const entries = await
|
|
217476
|
+
const entries = await getFsImplementation().readdir(ideLockFilePath);
|
|
217476
217477
|
const lockEntries = entries.filter((file2) => file2.name.endsWith(".lock"));
|
|
217477
217478
|
const stats = await Promise.all(lockEntries.map(async (file2) => {
|
|
217478
217479
|
const fullPath = join49(ideLockFilePath, file2.name);
|
|
217479
217480
|
try {
|
|
217480
|
-
const fileStat = await
|
|
217481
|
+
const fileStat = await getFsImplementation().stat(fullPath);
|
|
217481
217482
|
return { path: fullPath, mtime: fileStat.mtime };
|
|
217482
217483
|
} catch {
|
|
217483
217484
|
return null;
|
|
@@ -217499,7 +217500,7 @@ async function getSortedIdeLockfiles() {
|
|
|
217499
217500
|
}
|
|
217500
217501
|
async function readIdeLockfile(path12) {
|
|
217501
217502
|
try {
|
|
217502
|
-
const content = await
|
|
217503
|
+
const content = await getFsImplementation().readFile(path12, {
|
|
217503
217504
|
encoding: "utf-8"
|
|
217504
217505
|
});
|
|
217505
217506
|
let workspaceFolders = [];
|
|
@@ -217577,7 +217578,7 @@ async function getIdeLockfilesPaths() {
|
|
|
217577
217578
|
}
|
|
217578
217579
|
try {
|
|
217579
217580
|
const usersDir = "/mnt/c/Users";
|
|
217580
|
-
const userDirs = await
|
|
217581
|
+
const userDirs = await getFsImplementation().readdir(usersDir);
|
|
217581
217582
|
for (const user of userDirs) {
|
|
217582
217583
|
if (!user.isDirectory() && !user.isSymbolicLink()) {
|
|
217583
217584
|
continue;
|
|
@@ -217603,7 +217604,7 @@ async function cleanupStaleIdeLockfiles() {
|
|
|
217603
217604
|
const lockfileInfo = await readIdeLockfile(lockfilePath);
|
|
217604
217605
|
if (!lockfileInfo) {
|
|
217605
217606
|
try {
|
|
217606
|
-
await
|
|
217607
|
+
await getFsImplementation().unlink(lockfilePath);
|
|
217607
217608
|
} catch (error42) {
|
|
217608
217609
|
logError2(error42);
|
|
217609
217610
|
}
|
|
@@ -217630,7 +217631,7 @@ async function cleanupStaleIdeLockfiles() {
|
|
|
217630
217631
|
}
|
|
217631
217632
|
if (shouldDelete) {
|
|
217632
217633
|
try {
|
|
217633
|
-
await
|
|
217634
|
+
await getFsImplementation().unlink(lockfilePath);
|
|
217634
217635
|
} catch (error42) {
|
|
217635
217636
|
logError2(error42);
|
|
217636
217637
|
}
|
|
@@ -217900,7 +217901,7 @@ async function getVSCodeIDECommand(ideType) {
|
|
|
217900
217901
|
const parentExecutable = getVSCodeIDECommandByParentProcess();
|
|
217901
217902
|
if (parentExecutable) {
|
|
217902
217903
|
try {
|
|
217903
|
-
await
|
|
217904
|
+
await getFsImplementation().stat(parentExecutable);
|
|
217904
217905
|
return parentExecutable;
|
|
217905
217906
|
} catch {}
|
|
217906
217907
|
}
|
|
@@ -218076,7 +218077,7 @@ async function installFromArtifactory(command) {
|
|
|
218076
218077
|
const npmrcAuthPrefix = `//${artifactoryBaseUrl.replace(/^https?:\/\//, "")}/api/npm/npm-all/:_authToken=`;
|
|
218077
218078
|
const npmrcPath = join49(os3.homedir(), ".npmrc");
|
|
218078
218079
|
let authToken = null;
|
|
218079
|
-
const fs2 =
|
|
218080
|
+
const fs2 = getFsImplementation();
|
|
218080
218081
|
try {
|
|
218081
218082
|
const npmrcContent = await fs2.readFile(npmrcPath, {
|
|
218082
218083
|
encoding: "utf8"
|
|
@@ -218116,7 +218117,7 @@ async function installFromArtifactory(command) {
|
|
|
218116
218117
|
},
|
|
218117
218118
|
responseType: "stream"
|
|
218118
218119
|
});
|
|
218119
|
-
const writeStream =
|
|
218120
|
+
const writeStream = getFsImplementation().createWriteStream(tempVsixPath);
|
|
218120
218121
|
await new Promise((resolve19, reject2) => {
|
|
218121
218122
|
vsixResponse.data.pipe(writeStream);
|
|
218122
218123
|
writeStream.on("finish", resolve19);
|
|
@@ -218564,7 +218565,7 @@ function getTokenFromFileDescriptor() {
|
|
|
218564
218565
|
return null;
|
|
218565
218566
|
}
|
|
218566
218567
|
try {
|
|
218567
|
-
const fsOps =
|
|
218568
|
+
const fsOps = getFsImplementation();
|
|
218568
218569
|
const fdPath = process.platform === "darwin" || process.platform === "freebsd" ? `/dev/fd/${fd2}` : `/proc/self/fd/${fd2}`;
|
|
218569
218570
|
const token = fsOps.readFileSync(fdPath, { encoding: "utf8" }).trim();
|
|
218570
218571
|
if (!token) {
|
|
@@ -270837,7 +270838,7 @@ async function getImageFromClipboard() {
|
|
|
270837
270838
|
if (saveResult.exitCode !== 0) {
|
|
270838
270839
|
return null;
|
|
270839
270840
|
}
|
|
270840
|
-
let imageBuffer =
|
|
270841
|
+
let imageBuffer = getFsImplementation().readFileBytesSync(screenshotPath);
|
|
270841
270842
|
if (imageBuffer.length >= 2 && imageBuffer[0] === 66 && imageBuffer[1] === 77) {
|
|
270842
270843
|
const sharp = await getImageProcessor();
|
|
270843
270844
|
imageBuffer = await sharp(imageBuffer).png().toBuffer();
|
|
@@ -270910,11 +270911,11 @@ async function tryReadImageFromPath(text) {
|
|
|
270910
270911
|
let imageBuffer;
|
|
270911
270912
|
try {
|
|
270912
270913
|
if (isAbsolute11(imagePath)) {
|
|
270913
|
-
imageBuffer =
|
|
270914
|
+
imageBuffer = getFsImplementation().readFileBytesSync(imagePath);
|
|
270914
270915
|
} else {
|
|
270915
270916
|
const clipboardPath = await getImagePathFromClipboard();
|
|
270916
270917
|
if (clipboardPath && imagePath === basename11(clipboardPath)) {
|
|
270917
|
-
imageBuffer =
|
|
270918
|
+
imageBuffer = getFsImplementation().readFileBytesSync(clipboardPath);
|
|
270918
270919
|
}
|
|
270919
270920
|
}
|
|
270920
270921
|
} catch (e) {
|
|
@@ -271040,7 +271041,7 @@ function evictOldestIfAtCap() {
|
|
|
271040
271041
|
}
|
|
271041
271042
|
}
|
|
271042
271043
|
async function cleanupOldImageCaches() {
|
|
271043
|
-
const fsImpl =
|
|
271044
|
+
const fsImpl = getFsImplementation();
|
|
271044
271045
|
const baseDir = join54(getClaudeConfigHomeDir(), IMAGE_STORE_DIR);
|
|
271045
271046
|
const currentSessionId = getSessionId();
|
|
271046
271047
|
try {
|
|
@@ -275836,7 +275837,7 @@ async function writeIfMissing(path12, content, mode) {
|
|
|
275836
275837
|
async function ensureLocalPackageEnvironment() {
|
|
275837
275838
|
try {
|
|
275838
275839
|
const localInstallDir = getLocalInstallDir();
|
|
275839
|
-
await
|
|
275840
|
+
await getFsImplementation().mkdir(localInstallDir);
|
|
275840
275841
|
await writeIfMissing(join55(localInstallDir, "package.json"), jsonStringify({ name: "verboo-local", version: "0.0.1", private: true }, null, 2));
|
|
275841
275842
|
const wrapperPath = getLocalClaudePath();
|
|
275842
275843
|
const created = await writeIfMissing(wrapperPath, `#!/bin/sh
|
|
@@ -276259,7 +276260,7 @@ async function getInstallationPath() {
|
|
|
276259
276260
|
} catch {}
|
|
276260
276261
|
try {
|
|
276261
276262
|
const nativeBinaryPath = join57(homedir18(), ".local", "bin", getCliBinaryName());
|
|
276262
|
-
await
|
|
276263
|
+
await getFsImplementation().stat(nativeBinaryPath);
|
|
276263
276264
|
return nativeBinaryPath;
|
|
276264
276265
|
} catch {}
|
|
276265
276266
|
return "native";
|
|
@@ -276281,7 +276282,7 @@ function getInvokedBinary() {
|
|
|
276281
276282
|
}
|
|
276282
276283
|
}
|
|
276283
276284
|
async function detectMultipleInstallations() {
|
|
276284
|
-
const fs2 =
|
|
276285
|
+
const fs2 = getFsImplementation();
|
|
276285
276286
|
const installations = [];
|
|
276286
276287
|
const localPath = await getDetectedLocalInstallDir();
|
|
276287
276288
|
if (localPath) {
|
|
@@ -276658,7 +276659,7 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
|
|
|
276658
276659
|
if (!ARTIFACTORY_REGISTRY_URL) {
|
|
276659
276660
|
throw new Error("Internal artifactory registry URL is not configured");
|
|
276660
276661
|
}
|
|
276661
|
-
const fs2 =
|
|
276662
|
+
const fs2 = getFsImplementation();
|
|
276662
276663
|
await fs2.rm(stagingPath, { recursive: true, force: true });
|
|
276663
276664
|
const platform4 = getPlatform2();
|
|
276664
276665
|
const platformPackageName = `${undefined}-${platform4}`;
|
|
@@ -276788,7 +276789,7 @@ async function downloadAndVerifyBinary(binaryUrl, expectedChecksum, binaryPath,
|
|
|
276788
276789
|
throw lastError ?? new Error("Download failed after all retries");
|
|
276789
276790
|
}
|
|
276790
276791
|
async function downloadVersionFromBinaryRepo(version2, stagingPath, baseUrl, authConfig) {
|
|
276791
|
-
const fs2 =
|
|
276792
|
+
const fs2 = getFsImplementation();
|
|
276792
276793
|
await fs2.rm(stagingPath, { recursive: true, force: true });
|
|
276793
276794
|
const platform4 = getPlatform2();
|
|
276794
276795
|
const startTime2 = Date.now();
|
|
@@ -276920,7 +276921,7 @@ function isClaudeProcess(pid, expectedExecPath) {
|
|
|
276920
276921
|
}
|
|
276921
276922
|
}
|
|
276922
276923
|
function readLockContent(lockFilePath) {
|
|
276923
|
-
const fs2 =
|
|
276924
|
+
const fs2 = getFsImplementation();
|
|
276924
276925
|
try {
|
|
276925
276926
|
const content = fs2.readFileSync(lockFilePath, { encoding: "utf8" });
|
|
276926
276927
|
if (!content || content.trim() === "") {
|
|
@@ -276948,7 +276949,7 @@ function isLockActive(lockFilePath) {
|
|
|
276948
276949
|
logForDebugging(`Lock PID ${pid} is running but does not appear to be Claude - treating as stale`);
|
|
276949
276950
|
return false;
|
|
276950
276951
|
}
|
|
276951
|
-
const fs2 =
|
|
276952
|
+
const fs2 = getFsImplementation();
|
|
276952
276953
|
try {
|
|
276953
276954
|
const stats = fs2.statSync(lockFilePath);
|
|
276954
276955
|
const age = Date.now() - stats.mtimeMs;
|
|
@@ -276961,7 +276962,7 @@ function isLockActive(lockFilePath) {
|
|
|
276961
276962
|
return true;
|
|
276962
276963
|
}
|
|
276963
276964
|
function writeLockFile(lockFilePath, content) {
|
|
276964
|
-
const fs2 =
|
|
276965
|
+
const fs2 = getFsImplementation();
|
|
276965
276966
|
const tempPath = `${lockFilePath}.tmp.${process.pid}.${Date.now()}`;
|
|
276966
276967
|
try {
|
|
276967
276968
|
writeFileSync_DEPRECATED(tempPath, jsonStringify(content, null, 2), {
|
|
@@ -276977,7 +276978,7 @@ function writeLockFile(lockFilePath, content) {
|
|
|
276977
276978
|
}
|
|
276978
276979
|
}
|
|
276979
276980
|
async function tryAcquireLock(versionPath, lockFilePath) {
|
|
276980
|
-
const fs2 =
|
|
276981
|
+
const fs2 = getFsImplementation();
|
|
276981
276982
|
const versionName = basename12(versionPath);
|
|
276982
276983
|
if (isLockActive(lockFilePath)) {
|
|
276983
276984
|
const existingContent = readLockContent(lockFilePath);
|
|
@@ -277041,7 +277042,7 @@ async function withLock(versionPath, lockFilePath, callback) {
|
|
|
277041
277042
|
}
|
|
277042
277043
|
}
|
|
277043
277044
|
function getAllLockInfo(locksDir) {
|
|
277044
|
-
const fs2 =
|
|
277045
|
+
const fs2 = getFsImplementation();
|
|
277045
277046
|
const lockInfos = [];
|
|
277046
277047
|
try {
|
|
277047
277048
|
const lockFiles = fs2.readdirStringSync(locksDir).filter((f) => f.endsWith(".lock"));
|
|
@@ -277068,7 +277069,7 @@ function getAllLockInfo(locksDir) {
|
|
|
277068
277069
|
return lockInfos;
|
|
277069
277070
|
}
|
|
277070
277071
|
function cleanupStaleLocks(locksDir) {
|
|
277071
|
-
const fs2 =
|
|
277072
|
+
const fs2 = getFsImplementation();
|
|
277072
277073
|
let cleanedCount = 0;
|
|
277073
277074
|
try {
|
|
277074
277075
|
const lockEntries = fs2.readdirStringSync(locksDir).filter((f) => f.endsWith(".lock"));
|
|
@@ -279522,7 +279523,7 @@ function migrateDiscoveryCache(parsed) {
|
|
|
279522
279523
|
};
|
|
279523
279524
|
}
|
|
279524
279525
|
async function loadDiscoveryCache() {
|
|
279525
|
-
const fs2 =
|
|
279526
|
+
const fs2 = getFsImplementation();
|
|
279526
279527
|
const cachePath = getDiscoveryCachePath();
|
|
279527
279528
|
try {
|
|
279528
279529
|
const content = await fs2.readFile(cachePath, { encoding: "utf-8" });
|
|
@@ -279548,7 +279549,7 @@ async function loadDiscoveryCache() {
|
|
|
279548
279549
|
}
|
|
279549
279550
|
}
|
|
279550
279551
|
async function saveDiscoveryCache(cache3) {
|
|
279551
|
-
const fs2 =
|
|
279552
|
+
const fs2 = getFsImplementation();
|
|
279552
279553
|
const cachePath = getDiscoveryCachePath();
|
|
279553
279554
|
const tempPath = `${cachePath}.${randomBytes7(8).toString("hex")}.tmp`;
|
|
279554
279555
|
try {
|
|
@@ -302934,7 +302935,7 @@ async function processSlashCommand(inputString, precedingInputBlocks, imageConte
|
|
|
302934
302935
|
if (!hasCommand(commandName, context.options.commands)) {
|
|
302935
302936
|
let isFilePath = false;
|
|
302936
302937
|
try {
|
|
302937
|
-
await
|
|
302938
|
+
await getFsImplementation().stat(`/${commandName}`);
|
|
302938
302939
|
isFilePath = true;
|
|
302939
302940
|
} catch {}
|
|
302940
302941
|
if (looksLikeCommand(commandName) && !isFilePath) {
|
|
@@ -306613,7 +306614,7 @@ function getPlanSlug(sessionId) {
|
|
|
306613
306614
|
for (let i3 = 0;i3 < MAX_SLUG_RETRIES; i3++) {
|
|
306614
306615
|
slug = generateWordSlug();
|
|
306615
306616
|
const filePath = join67(plansDir, `${slug}.md`);
|
|
306616
|
-
if (!
|
|
306617
|
+
if (!getFsImplementation().existsSync(filePath)) {
|
|
306617
306618
|
break;
|
|
306618
306619
|
}
|
|
306619
306620
|
}
|
|
@@ -306637,7 +306638,7 @@ function getPlanFilePath(agentId) {
|
|
|
306637
306638
|
function getPlan(agentId) {
|
|
306638
306639
|
const filePath = getPlanFilePath(agentId);
|
|
306639
306640
|
try {
|
|
306640
|
-
return
|
|
306641
|
+
return getFsImplementation().readFileSync(filePath, { encoding: "utf-8" });
|
|
306641
306642
|
} catch (error42) {
|
|
306642
306643
|
if (isENOENT(error42))
|
|
306643
306644
|
return null;
|
|
@@ -306657,7 +306658,7 @@ async function copyPlanForResume(log, targetSessionId) {
|
|
|
306657
306658
|
setPlanSlug(sessionId, slug);
|
|
306658
306659
|
const planPath = join67(getPlansDirectory(), `${slug}.md`);
|
|
306659
306660
|
try {
|
|
306660
|
-
await
|
|
306661
|
+
await getFsImplementation().readFile(planPath, { encoding: "utf-8" });
|
|
306661
306662
|
return true;
|
|
306662
306663
|
} catch (e) {
|
|
306663
306664
|
if (!isENOENT(e)) {
|
|
@@ -306822,7 +306823,7 @@ var init_plans = __esm(() => {
|
|
|
306822
306823
|
plansPath = getDefaultPlansDirectory();
|
|
306823
306824
|
}
|
|
306824
306825
|
try {
|
|
306825
|
-
|
|
306826
|
+
getFsImplementation().mkdirSync(plansPath);
|
|
306826
306827
|
} catch (error42) {
|
|
306827
306828
|
logError2(error42);
|
|
306828
306829
|
}
|
|
@@ -316175,7 +316176,7 @@ ${stdout}`);
|
|
|
316175
316176
|
logForDebugging(`Shell snapshot created successfully (${snapshotSize} bytes)`);
|
|
316176
316177
|
registerCleanup(async () => {
|
|
316177
316178
|
try {
|
|
316178
|
-
await
|
|
316179
|
+
await getFsImplementation().unlink(shellSnapshotPath);
|
|
316179
316180
|
logForDebugging(`Cleaned up session snapshot: ${shellSnapshotPath}`);
|
|
316180
316181
|
} catch (error43) {
|
|
316181
316182
|
logForDebugging(`Error cleaning up session snapshot: ${error43}`);
|
|
@@ -316186,7 +316187,7 @@ ${stdout}`);
|
|
|
316186
316187
|
logForDebugging(`Shell snapshot file not found after creation: ${shellSnapshotPath}`);
|
|
316187
316188
|
logForDebugging(`Checking if parent directory still exists: ${snapshotsDir}`);
|
|
316188
316189
|
try {
|
|
316189
|
-
const dirContents = await
|
|
316190
|
+
const dirContents = await getFsImplementation().readdir(snapshotsDir);
|
|
316190
316191
|
logForDebugging(`Directory contains ${dirContents.length} files`);
|
|
316191
316192
|
} catch {
|
|
316192
316193
|
logForDebugging(`Parent directory does not exist or is not accessible: ${snapshotsDir}`);
|
|
@@ -316841,7 +316842,7 @@ async function exec3(command, abortSignal, shellType, options2) {
|
|
|
316841
316842
|
if (shouldUseSandbox) {
|
|
316842
316843
|
commandString = await SandboxManager2.wrapWithSandbox(commandString, sandboxBinShell, undefined, abortSignal);
|
|
316843
316844
|
try {
|
|
316844
|
-
const fs3 =
|
|
316845
|
+
const fs3 = getFsImplementation();
|
|
316845
316846
|
await fs3.mkdir(sandboxTmpDir, { mode: 448 });
|
|
316846
316847
|
} catch (error42) {
|
|
316847
316848
|
logForDebugging(`Failed to create ${sandboxTmpDir} directory: ${error42}`);
|
|
@@ -316929,10 +316930,10 @@ async function exec3(command, abortSignal, shellType, options2) {
|
|
|
316929
316930
|
}
|
|
316930
316931
|
}
|
|
316931
316932
|
function setCwd(path15, relativeTo) {
|
|
316932
|
-
const resolved = isAbsolute14(path15) ? path15 : resolve24(relativeTo ||
|
|
316933
|
+
const resolved = isAbsolute14(path15) ? path15 : resolve24(relativeTo || getFsImplementation().cwd(), path15);
|
|
316933
316934
|
let physicalPath;
|
|
316934
316935
|
try {
|
|
316935
|
-
physicalPath =
|
|
316936
|
+
physicalPath = getFsImplementation().realpathSync(resolved);
|
|
316936
316937
|
} catch (e) {
|
|
316937
316938
|
if (isENOENT(e)) {
|
|
316938
316939
|
throw new Error(`Path "${resolved}" does not exist`);
|
|
@@ -320248,7 +320249,7 @@ function checkDenyRuleForGuessedPath(strippedPath, cwd2, toolPermissionContext,
|
|
|
320248
320249
|
return null;
|
|
320249
320250
|
const tildeExpanded = expandTilde2(strippedPath);
|
|
320250
320251
|
const abs = isAbsolute15(tildeExpanded) ? tildeExpanded : resolve26(cwd2, tildeExpanded);
|
|
320251
|
-
const { resolvedPath } = safeResolvePath(
|
|
320252
|
+
const { resolvedPath } = safeResolvePath(getFsImplementation(), abs);
|
|
320252
320253
|
const permissionType = operationType === "read" ? "read" : "edit";
|
|
320253
320254
|
const denyRule = matchingRuleForInput(resolvedPath, toolPermissionContext, permissionType, "deny");
|
|
320254
320255
|
return denyRule ? { resolvedPath, rule: denyRule } : null;
|
|
@@ -320338,7 +320339,7 @@ function validatePath2(filePath, cwd2, toolPermissionContext, operationType) {
|
|
|
320338
320339
|
}
|
|
320339
320340
|
if (containsPathTraversal(normalizedPath)) {
|
|
320340
320341
|
const absolutePath2 = isAbsolute15(normalizedPath) ? normalizedPath : resolve26(cwd2, normalizedPath);
|
|
320341
|
-
const { resolvedPath: resolvedPath3, isCanonical: isCanonical2 } = safeResolvePath(
|
|
320342
|
+
const { resolvedPath: resolvedPath3, isCanonical: isCanonical2 } = safeResolvePath(getFsImplementation(), absolutePath2);
|
|
320342
320343
|
const result2 = isPathAllowed2(resolvedPath3, toolPermissionContext, operationType, isCanonical2 ? [resolvedPath3] : undefined);
|
|
320343
320344
|
return {
|
|
320344
320345
|
allowed: result2.allowed,
|
|
@@ -320348,7 +320349,7 @@ function validatePath2(filePath, cwd2, toolPermissionContext, operationType) {
|
|
|
320348
320349
|
}
|
|
320349
320350
|
const basePath = getGlobBaseDirectory2(normalizedPath);
|
|
320350
320351
|
const absoluteBasePath = isAbsolute15(basePath) ? basePath : resolve26(cwd2, basePath);
|
|
320351
|
-
const { resolvedPath: resolvedPath2 } = safeResolvePath(
|
|
320352
|
+
const { resolvedPath: resolvedPath2 } = safeResolvePath(getFsImplementation(), absoluteBasePath);
|
|
320352
320353
|
const permissionType = operationType === "read" ? "read" : "edit";
|
|
320353
320354
|
const denyRule = matchingRuleForInput(resolvedPath2, toolPermissionContext, permissionType, "deny");
|
|
320354
320355
|
if (denyRule !== null) {
|
|
@@ -320368,7 +320369,7 @@ function validatePath2(filePath, cwd2, toolPermissionContext, operationType) {
|
|
|
320368
320369
|
};
|
|
320369
320370
|
}
|
|
320370
320371
|
const absolutePath = isAbsolute15(normalizedPath) ? normalizedPath : resolve26(cwd2, normalizedPath);
|
|
320371
|
-
const { resolvedPath, isCanonical } = safeResolvePath(
|
|
320372
|
+
const { resolvedPath, isCanonical } = safeResolvePath(getFsImplementation(), absolutePath);
|
|
320372
320373
|
const result = isPathAllowed2(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
|
|
320373
320374
|
return {
|
|
320374
320375
|
allowed: result.allowed,
|
|
@@ -324353,7 +324354,7 @@ ${markdownContent}` : markdownContent;
|
|
|
324353
324354
|
};
|
|
324354
324355
|
}
|
|
324355
324356
|
async function findSkillMarkdownFiles(basePath) {
|
|
324356
|
-
const fs3 =
|
|
324357
|
+
const fs3 = getFsImplementation();
|
|
324357
324358
|
const visitedDirs = new Set;
|
|
324358
324359
|
const skillFiles = [];
|
|
324359
324360
|
async function walk(skillDirPath) {
|
|
@@ -324436,7 +324437,7 @@ async function findSkillMarkdownFiles(basePath) {
|
|
|
324436
324437
|
return skillFiles;
|
|
324437
324438
|
}
|
|
324438
324439
|
async function loadSkillsFromSkillsDir(basePath, source) {
|
|
324439
|
-
const fs3 =
|
|
324440
|
+
const fs3 = getFsImplementation();
|
|
324440
324441
|
const skillFiles = await findSkillMarkdownFiles(basePath);
|
|
324441
324442
|
const results = await Promise.all(skillFiles.map(async (skillFilePath) => {
|
|
324442
324443
|
try {
|
|
@@ -324589,7 +324590,7 @@ function onDynamicSkillsLoaded(callback) {
|
|
|
324589
324590
|
});
|
|
324590
324591
|
}
|
|
324591
324592
|
async function discoverSkillDirsForPaths(filePaths, cwd2) {
|
|
324592
|
-
const fs3 =
|
|
324593
|
+
const fs3 = getFsImplementation();
|
|
324593
324594
|
const resolvedCwd = cwd2.endsWith(pathSep) ? cwd2.slice(0, -1) : cwd2;
|
|
324594
324595
|
const newDirs = [];
|
|
324595
324596
|
for (const filePath of filePaths) {
|
|
@@ -329136,7 +329137,7 @@ var init_FileEditTool = __esm(() => {
|
|
|
329136
329137
|
if (fullFilePath.startsWith("\\\\") || fullFilePath.startsWith("//")) {
|
|
329137
329138
|
return { result: true };
|
|
329138
329139
|
}
|
|
329139
|
-
const fs3 =
|
|
329140
|
+
const fs3 = getFsImplementation();
|
|
329140
329141
|
try {
|
|
329141
329142
|
const { size } = await fs3.stat(fullFilePath);
|
|
329142
329143
|
if (size > MAX_EDIT_FILE_SIZE) {
|
|
@@ -329296,7 +329297,7 @@ String: ${old_string}`,
|
|
|
329296
329297
|
dynamicSkillDirTriggers
|
|
329297
329298
|
}, _, parentMessage) {
|
|
329298
329299
|
const { file_path, old_string, new_string, replace_all = false } = input;
|
|
329299
|
-
const fs3 =
|
|
329300
|
+
const fs3 = getFsImplementation();
|
|
329300
329301
|
const absoluteFilePath = expandPath(file_path);
|
|
329301
329302
|
const cwd2 = getCwd();
|
|
329302
329303
|
if (!isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE)) {
|
|
@@ -329991,7 +329992,7 @@ var init_FileWriteTool = __esm(() => {
|
|
|
329991
329992
|
if (fullFilePath.startsWith("\\\\") || fullFilePath.startsWith("//")) {
|
|
329992
329993
|
return { result: true };
|
|
329993
329994
|
}
|
|
329994
|
-
const fs3 =
|
|
329995
|
+
const fs3 = getFsImplementation();
|
|
329995
329996
|
let fileMtimeMs;
|
|
329996
329997
|
try {
|
|
329997
329998
|
const fileStat = await fs3.stat(fullFilePath);
|
|
@@ -330033,7 +330034,7 @@ var init_FileWriteTool = __esm(() => {
|
|
|
330033
330034
|
}
|
|
330034
330035
|
activateConditionalSkillsForPaths([fullFilePath], cwd2);
|
|
330035
330036
|
await diagnosticTracker.beforeFileEditedCompat(fullFilePath);
|
|
330036
|
-
await
|
|
330037
|
+
await getFsImplementation().mkdir(dir);
|
|
330037
330038
|
if (fileHistoryEnabled()) {
|
|
330038
330039
|
await fileHistoryTrackEdit(updateFileHistoryState, fullFilePath, parentMessage.uuid);
|
|
330039
330040
|
}
|
|
@@ -330653,7 +330654,7 @@ var init_GrepTool = __esm(() => {
|
|
|
330653
330654
|
},
|
|
330654
330655
|
async validateInput({ path: path15 }) {
|
|
330655
330656
|
if (path15) {
|
|
330656
|
-
const fs3 =
|
|
330657
|
+
const fs3 = getFsImplementation();
|
|
330657
330658
|
const absolutePath = expandPath(path15);
|
|
330658
330659
|
if (absolutePath.startsWith("\\\\") || absolutePath.startsWith("//")) {
|
|
330659
330660
|
return { result: true };
|
|
@@ -330888,7 +330889,7 @@ ${filenames.join(`
|
|
|
330888
330889
|
};
|
|
330889
330890
|
return { data: output2 };
|
|
330890
330891
|
}
|
|
330891
|
-
const stats = await Promise.allSettled(results.map((_) =>
|
|
330892
|
+
const stats = await Promise.allSettled(results.map((_) => getFsImplementation().stat(_)));
|
|
330892
330893
|
const sortedMatches = results.map((_, i3) => {
|
|
330893
330894
|
const r = stats[i3];
|
|
330894
330895
|
return [
|
|
@@ -331045,7 +331046,7 @@ var init_GlobTool = __esm(() => {
|
|
|
331045
331046
|
},
|
|
331046
331047
|
async validateInput({ path: path15 }) {
|
|
331047
331048
|
if (path15) {
|
|
331048
|
-
const fs3 =
|
|
331049
|
+
const fs3 = getFsImplementation();
|
|
331049
331050
|
const absolutePath = expandPath(path15);
|
|
331050
331051
|
if (absolutePath.startsWith("\\\\") || absolutePath.startsWith("//")) {
|
|
331051
331052
|
return { result: true };
|
|
@@ -331256,7 +331257,7 @@ function getToolResultFromCell(cell) {
|
|
|
331256
331257
|
}
|
|
331257
331258
|
async function readNotebook(notebookPath, cellId) {
|
|
331258
331259
|
const fullPath = expandPath(notebookPath);
|
|
331259
|
-
const buffer = await
|
|
331260
|
+
const buffer = await getFsImplementation().readFileBytes(fullPath);
|
|
331260
331261
|
const content = buffer.toString("utf-8");
|
|
331261
331262
|
const notebook = jsonParse(content);
|
|
331262
331263
|
const language = notebook.metadata.language_info?.name ?? "python";
|
|
@@ -364767,7 +364768,7 @@ var init_schemas4 = __esm(() => {
|
|
|
364767
364768
|
// src/tools/LSPTool/symbolContext.ts
|
|
364768
364769
|
function getSymbolAtPosition(filePath, line, character) {
|
|
364769
364770
|
try {
|
|
364770
|
-
const fs3 =
|
|
364771
|
+
const fs3 = getFsImplementation();
|
|
364771
364772
|
const absolutePath = expandPath(filePath);
|
|
364772
364773
|
const { buffer, bytesRead } = fs3.readSync(absolutePath, {
|
|
364773
364774
|
length: MAX_READ_BYTES
|
|
@@ -365449,7 +365450,7 @@ var init_LSPTool = __esm(() => {
|
|
|
365449
365450
|
errorCode: 3
|
|
365450
365451
|
};
|
|
365451
365452
|
}
|
|
365452
|
-
const fs3 =
|
|
365453
|
+
const fs3 = getFsImplementation();
|
|
365453
365454
|
const absolutePath = expandPath(input.filePath);
|
|
365454
365455
|
if (absolutePath.startsWith("\\\\") || absolutePath.startsWith("//")) {
|
|
365455
365456
|
return { result: true };
|
|
@@ -375317,7 +375318,7 @@ async function applySedEdit(simulatedEdit, toolUseContext, parentMessage) {
|
|
|
375317
375318
|
newContent
|
|
375318
375319
|
} = simulatedEdit;
|
|
375319
375320
|
const absoluteFilePath = expandPath(filePath);
|
|
375320
|
-
const fs3 =
|
|
375321
|
+
const fs3 = getFsImplementation();
|
|
375321
375322
|
const encoding = detectFileEncoding(absoluteFilePath);
|
|
375322
375323
|
let originalContent;
|
|
375323
375324
|
try {
|
|
@@ -382199,7 +382200,7 @@ function getAnthropicEnvMetadata() {
|
|
|
382199
382200
|
function getBuildAgeMinutes() {
|
|
382200
382201
|
if (false)
|
|
382201
382202
|
;
|
|
382202
|
-
const buildTime = new Date("2026-05-
|
|
382203
|
+
const buildTime = new Date("2026-05-18T14:17:30.701Z").getTime();
|
|
382203
382204
|
if (isNaN(buildTime))
|
|
382204
382205
|
return;
|
|
382205
382206
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -386342,7 +386343,7 @@ import { mkdir as mkdir26, readdir as readdir15, readFile as readFile29 } from "
|
|
|
386342
386343
|
import { join as join86 } from "path";
|
|
386343
386344
|
async function readPDF(filePath) {
|
|
386344
386345
|
try {
|
|
386345
|
-
const fs3 =
|
|
386346
|
+
const fs3 = getFsImplementation();
|
|
386346
386347
|
const stats = await fs3.stat(filePath);
|
|
386347
386348
|
const originalSize = stats.size;
|
|
386348
386349
|
if (originalSize === 0) {
|
|
@@ -386420,7 +386421,7 @@ async function isPdftoppmAvailable() {
|
|
|
386420
386421
|
}
|
|
386421
386422
|
async function extractPDFPages(filePath, options2) {
|
|
386422
386423
|
try {
|
|
386423
|
-
const fs3 =
|
|
386424
|
+
const fs3 = getFsImplementation();
|
|
386424
386425
|
const stats = await fs3.stat(filePath);
|
|
386425
386426
|
const originalSize = stats.size;
|
|
386426
386427
|
if (originalSize === 0) {
|
|
@@ -386899,7 +386900,7 @@ async function callInner(file_path, fullFilePath, resolvedFilePath, ext, offset,
|
|
|
386899
386900
|
` + ` cat "${file_path}" | jq '.cells[] | select(.cell_type=="code") | .source' # All code sources`);
|
|
386900
386901
|
}
|
|
386901
386902
|
await validateContentTokens(cellsJson, ext, maxTokens);
|
|
386902
|
-
const stats = await
|
|
386903
|
+
const stats = await getFsImplementation().stat(resolvedFilePath);
|
|
386903
386904
|
readFileState.set(fullFilePath, {
|
|
386904
386905
|
content: cellsJson,
|
|
386905
386906
|
timestamp: Math.floor(stats.mtimeMs),
|
|
@@ -386985,7 +386986,7 @@ async function callInner(file_path, fullFilePath, resolvedFilePath, ext, offset,
|
|
|
386985
386986
|
if (pageCount !== null && pageCount > PDF_AT_MENTION_INLINE_THRESHOLD) {
|
|
386986
386987
|
throw new Error(`This PDF has ${pageCount} pages, which is too many to read at once. ` + `Use the pages parameter to read specific page ranges (e.g., pages: "1-5"). ` + `Maximum ${PDF_MAX_PAGES_PER_READ} pages per request.`);
|
|
386987
386988
|
}
|
|
386988
|
-
const fs3 =
|
|
386989
|
+
const fs3 = getFsImplementation();
|
|
386989
386990
|
const stats = await fs3.stat(resolvedFilePath);
|
|
386990
386991
|
const shouldExtractPages = !isPDFSupported() || stats.size > PDF_EXTRACT_SIZE_THRESHOLD;
|
|
386991
386992
|
if (shouldExtractPages) {
|
|
@@ -387088,7 +387089,7 @@ async function callInner(file_path, fullFilePath, resolvedFilePath, ext, offset,
|
|
|
387088
387089
|
return { data };
|
|
387089
387090
|
}
|
|
387090
387091
|
async function readImageWithTokenBudget(filePath, maxTokens = getDefaultFileReadingLimits().maxTokens, maxBytes) {
|
|
387091
|
-
const imageBuffer = await
|
|
387092
|
+
const imageBuffer = await getFsImplementation().readFileBytes(filePath, maxBytes);
|
|
387092
387093
|
const originalSize = imageBuffer.length;
|
|
387093
387094
|
if (originalSize === 0) {
|
|
387094
387095
|
throw new Error(`Image file is empty: ${filePath}`);
|
|
@@ -389105,7 +389106,7 @@ async function tryGetPDFReference(filename) {
|
|
|
389105
389106
|
}
|
|
389106
389107
|
try {
|
|
389107
389108
|
const [stats, pageCount] = await Promise.all([
|
|
389108
|
-
|
|
389109
|
+
getFsImplementation().stat(filename),
|
|
389109
389110
|
getPDFPageCount(filename)
|
|
389110
389111
|
]);
|
|
389111
389112
|
const effectivePageCount = pageCount ?? Math.ceil(stats.size / (100 * 1024));
|
|
@@ -389136,7 +389137,7 @@ async function generateFileAttachment(filename, toolUseContext, successEventName
|
|
|
389136
389137
|
const ext = parse13(filename).ext.toLowerCase();
|
|
389137
389138
|
if (!isPDFExtension(ext)) {
|
|
389138
389139
|
try {
|
|
389139
|
-
const stats = await
|
|
389140
|
+
const stats = await getFsImplementation().stat(filename);
|
|
389140
389141
|
logEvent("tengu_attachment_file_too_large", {
|
|
389141
389142
|
size_bytes: stats.size,
|
|
389142
389143
|
mode
|
|
@@ -389757,7 +389758,7 @@ function getCommandNameFromFile(filePath, baseDir, pluginName) {
|
|
|
389757
389758
|
}
|
|
389758
389759
|
async function collectMarkdownFiles(dirPath, baseDir, loadedPaths) {
|
|
389759
389760
|
const files = [];
|
|
389760
|
-
const fs3 =
|
|
389761
|
+
const fs3 = getFsImplementation();
|
|
389761
389762
|
await walkPluginMarkdown(dirPath, async (fullPath) => {
|
|
389762
389763
|
if (isDuplicatePath(fs3, fullPath, loadedPaths))
|
|
389763
389764
|
return;
|
|
@@ -389922,7 +389923,7 @@ async function validatePluginSkillFilePath(pluginPath, skillFilePath) {
|
|
|
389922
389923
|
return true;
|
|
389923
389924
|
}
|
|
389924
389925
|
async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, pluginManifest, pluginPath, loadedPaths) {
|
|
389925
|
-
const fs3 =
|
|
389926
|
+
const fs3 = getFsImplementation();
|
|
389926
389927
|
const skills = [];
|
|
389927
389928
|
const directSkillPath = join88(skillsPath, "SKILL.md");
|
|
389928
389929
|
let directSkillContent = null;
|
|
@@ -390061,7 +390062,7 @@ var init_loadPluginCommands = __esm(() => {
|
|
|
390061
390062
|
logForDebugging(`Plugin ${plugin.name} has commandsPaths: ${plugin.commandsPaths.join(", ")}`);
|
|
390062
390063
|
const pathResults = await Promise.all(plugin.commandsPaths.map(async (commandPath) => {
|
|
390063
390064
|
try {
|
|
390064
|
-
const fs3 =
|
|
390065
|
+
const fs3 = getFsImplementation();
|
|
390065
390066
|
const stats = await fs3.stat(commandPath);
|
|
390066
390067
|
logForDebugging(`Checking commandPath ${commandPath} - isDirectory: ${stats.isDirectory()}, isFile: ${stats.isFile()}`);
|
|
390067
390068
|
if (stats.isDirectory()) {
|
|
@@ -390279,7 +390280,7 @@ async function getSessionPluginCachePath() {
|
|
|
390279
390280
|
sessionPluginCachePromise = (async () => {
|
|
390280
390281
|
const suffix = randomBytes10(8).toString("hex");
|
|
390281
390282
|
const dir = join89(tmpdir6(), `claude-plugin-session-${suffix}`);
|
|
390282
|
-
await
|
|
390283
|
+
await getFsImplementation().mkdir(dir);
|
|
390283
390284
|
sessionPluginCachePath = dir;
|
|
390284
390285
|
logForDebugging(`Created session plugin cache at ${dir}`);
|
|
390285
390286
|
return dir;
|
|
@@ -390303,7 +390304,7 @@ async function cleanupSessionPluginCache() {
|
|
|
390303
390304
|
}
|
|
390304
390305
|
async function atomicWriteToZipCache(targetPath, data) {
|
|
390305
390306
|
const dir = dirname38(targetPath);
|
|
390306
|
-
await
|
|
390307
|
+
await getFsImplementation().mkdir(dir);
|
|
390307
390308
|
const tmpName = `.${basename28(targetPath)}.tmp.${randomBytes10(4).toString("hex")}`;
|
|
390308
390309
|
const tmpPath = join89(dir, tmpName);
|
|
390309
390310
|
try {
|
|
@@ -390389,17 +390390,17 @@ async function collectFilesForZip(baseDir, relativePath, files, visited) {
|
|
|
390389
390390
|
}
|
|
390390
390391
|
}
|
|
390391
390392
|
async function extractZipToDirectory(zipPath, targetDir) {
|
|
390392
|
-
const zipBuf = await
|
|
390393
|
+
const zipBuf = await getFsImplementation().readFileBytes(zipPath);
|
|
390393
390394
|
const files = await unzipFile(zipBuf);
|
|
390394
390395
|
const modes = parseZipModes(zipBuf);
|
|
390395
|
-
await
|
|
390396
|
+
await getFsImplementation().mkdir(targetDir);
|
|
390396
390397
|
for (const [relPath, data] of Object.entries(files)) {
|
|
390397
390398
|
if (relPath.endsWith("/")) {
|
|
390398
|
-
await
|
|
390399
|
+
await getFsImplementation().mkdir(join89(targetDir, relPath));
|
|
390399
390400
|
continue;
|
|
390400
390401
|
}
|
|
390401
390402
|
const fullPath = join89(targetDir, relPath);
|
|
390402
|
-
await
|
|
390403
|
+
await getFsImplementation().mkdir(dirname38(fullPath));
|
|
390403
390404
|
await writeFile25(fullPath, data);
|
|
390404
390405
|
const mode = modes[relPath];
|
|
390405
390406
|
if (mode && mode & 73) {
|
|
@@ -391066,7 +391067,7 @@ function saveMarketplaceToSettings(name, entry, settingSource = "userSettings")
|
|
|
391066
391067
|
updateSettingsForSource(settingSource, { extraKnownMarketplaces: current });
|
|
391067
391068
|
}
|
|
391068
391069
|
async function loadKnownMarketplacesConfig() {
|
|
391069
|
-
const fs3 =
|
|
391070
|
+
const fs3 = getFsImplementation();
|
|
391070
391071
|
const configFile = getKnownMarketplacesFile();
|
|
391071
391072
|
try {
|
|
391072
391073
|
const content = await fs3.readFile(configFile, {
|
|
@@ -391109,7 +391110,7 @@ async function saveKnownMarketplacesConfig(config2) {
|
|
|
391109
391110
|
if (!parsed.success) {
|
|
391110
391111
|
throw new ConfigParseError(`Invalid marketplace config: ${parsed.error.message}`, configFile, config2);
|
|
391111
391112
|
}
|
|
391112
|
-
const fs3 =
|
|
391113
|
+
const fs3 = getFsImplementation();
|
|
391113
391114
|
const dir = join92(configFile, "..");
|
|
391114
391115
|
await fs3.mkdir(dir);
|
|
391115
391116
|
writeFileSync_DEPRECATED(configFile, jsonStringify(parsed.data, null, 2), {
|
|
@@ -391159,7 +391160,7 @@ async function registerSeedMarketplaces() {
|
|
|
391159
391160
|
async function readSeedKnownMarketplaces(seedDir) {
|
|
391160
391161
|
const seedJsonPath = join92(seedDir, "known_marketplaces.json");
|
|
391161
391162
|
try {
|
|
391162
|
-
const content = await
|
|
391163
|
+
const content = await getFsImplementation().readFile(seedJsonPath, {
|
|
391163
391164
|
encoding: "utf-8"
|
|
391164
391165
|
});
|
|
391165
391166
|
const parsed = KnownMarketplacesFileSchema().safeParse(jsonParse(content));
|
|
@@ -391230,7 +391231,7 @@ async function gitPull(cwd2, ref, options2) {
|
|
|
391230
391231
|
async function gitSubmoduleUpdate(cwd2, credentialArgs, env4, sparsePaths) {
|
|
391231
391232
|
if (sparsePaths && sparsePaths.length > 0)
|
|
391232
391233
|
return;
|
|
391233
|
-
const hasGitmodules = await
|
|
391234
|
+
const hasGitmodules = await getFsImplementation().stat(join92(cwd2, ".gitmodules")).then(() => true, () => false);
|
|
391234
391235
|
if (!hasGitmodules)
|
|
391235
391236
|
return;
|
|
391236
391237
|
const result = await execFileNoThrowWithCwd(gitExe(), [
|
|
@@ -391487,7 +391488,7 @@ async function reconcileSparseCheckout(cwd2, sparsePaths) {
|
|
|
391487
391488
|
return { code: 0, stderr: "" };
|
|
391488
391489
|
}
|
|
391489
391490
|
async function cacheMarketplaceFromGit(gitUrl, cachePath, ref, sparsePaths, onProgress, options2) {
|
|
391490
|
-
const fs3 =
|
|
391491
|
+
const fs3 = getFsImplementation();
|
|
391491
391492
|
const timeoutSec = Math.round(getPluginGitTimeoutMs() / 1000);
|
|
391492
391493
|
safeCallProgress(onProgress, `Refreshing marketplace cache (timeout: ${timeoutSec}s)…`);
|
|
391493
391494
|
const reconcileResult = await reconcileSparseCheckout(cachePath, sparsePaths);
|
|
@@ -391549,7 +391550,7 @@ function redactUrlCredentials(urlString) {
|
|
|
391549
391550
|
return urlString;
|
|
391550
391551
|
}
|
|
391551
391552
|
async function cacheMarketplaceFromUrl(url3, cachePath, customHeaders, onProgress) {
|
|
391552
|
-
const fs3 =
|
|
391553
|
+
const fs3 = getFsImplementation();
|
|
391553
391554
|
const redactedUrl = redactUrlCredentials(url3);
|
|
391554
391555
|
safeCallProgress(onProgress, `Downloading marketplace from ${redactedUrl}`);
|
|
391555
391556
|
logForDebugging(`Downloading marketplace from URL: ${redactedUrl}`);
|
|
@@ -391608,7 +391609,7 @@ function getCachePathForSource(source) {
|
|
|
391608
391609
|
return tempName;
|
|
391609
391610
|
}
|
|
391610
391611
|
async function parseFileWithSchema(filePath, schema) {
|
|
391611
|
-
const fs3 =
|
|
391612
|
+
const fs3 = getFsImplementation();
|
|
391612
391613
|
const content = await fs3.readFile(filePath, { encoding: "utf-8" });
|
|
391613
391614
|
let data;
|
|
391614
391615
|
try {
|
|
@@ -391623,7 +391624,7 @@ async function parseFileWithSchema(filePath, schema) {
|
|
|
391623
391624
|
return result.data;
|
|
391624
391625
|
}
|
|
391625
391626
|
async function loadAndCacheMarketplace(source, onProgress) {
|
|
391626
|
-
const fs3 =
|
|
391627
|
+
const fs3 = getFsImplementation();
|
|
391627
391628
|
const cacheDir = getMarketplacesCacheDir();
|
|
391628
391629
|
await fs3.mkdir(cacheDir);
|
|
391629
391630
|
let temporaryCachePath;
|
|
@@ -391830,7 +391831,7 @@ Tip: The shorthand "${resolvedSource.repo}" assumes github.com. ` + `For interna
|
|
|
391830
391831
|
const resolvedOld = resolve32(oldEntry.installLocation);
|
|
391831
391832
|
const resolvedNew = resolve32(cachePath);
|
|
391832
391833
|
if (resolvedOld === resolvedNew) {} else if (resolvedOld === cacheDir || resolvedOld.startsWith(cacheDir + sep23)) {
|
|
391833
|
-
const fs3 =
|
|
391834
|
+
const fs3 = getFsImplementation();
|
|
391834
391835
|
await fs3.rm(oldEntry.installLocation, { recursive: true, force: true });
|
|
391835
391836
|
} else {
|
|
391836
391837
|
logForDebugging(`Skipping cleanup of old installLocation (${oldEntry.installLocation}) — ` + `outside ${cacheDir}. The path is corrupted; leaving it alone and ` + `overwriting the config entry.`, { level: "warn" });
|
|
@@ -391858,7 +391859,7 @@ async function removeMarketplaceSource(name) {
|
|
|
391858
391859
|
}
|
|
391859
391860
|
delete config2[name];
|
|
391860
391861
|
await saveKnownMarketplacesConfig(config2);
|
|
391861
|
-
const fs3 =
|
|
391862
|
+
const fs3 = getFsImplementation();
|
|
391862
391863
|
const cacheDir = getMarketplacesCacheDir();
|
|
391863
391864
|
const cachePath = join92(cacheDir, name);
|
|
391864
391865
|
await fs3.rm(cachePath, { recursive: true, force: true });
|
|
@@ -391926,7 +391927,7 @@ async function readCachedMarketplace(installLocation) {
|
|
|
391926
391927
|
return await parseFileWithSchema(installLocation, PluginMarketplaceSchema());
|
|
391927
391928
|
}
|
|
391928
391929
|
async function getMarketplaceCacheOnly(name) {
|
|
391929
|
-
const fs3 =
|
|
391930
|
+
const fs3 = getFsImplementation();
|
|
391930
391931
|
const configFile = getKnownMarketplacesFile();
|
|
391931
391932
|
try {
|
|
391932
391933
|
const content = await fs3.readFile(configFile, { encoding: "utf-8" });
|
|
@@ -391949,7 +391950,7 @@ async function getPluginByIdCacheOnly(pluginId) {
|
|
|
391949
391950
|
if (!pluginName || !marketplaceName) {
|
|
391950
391951
|
return null;
|
|
391951
391952
|
}
|
|
391952
|
-
const fs3 =
|
|
391953
|
+
const fs3 = getFsImplementation();
|
|
391953
391954
|
const configFile = getKnownMarketplacesFile();
|
|
391954
391955
|
try {
|
|
391955
391956
|
const content = await fs3.readFile(configFile, { encoding: "utf-8" });
|
|
@@ -392220,7 +392221,7 @@ function migrateToSinglePluginFile() {
|
|
|
392220
392221
|
if (migrationCompleted) {
|
|
392221
392222
|
return;
|
|
392222
392223
|
}
|
|
392223
|
-
const fs3 =
|
|
392224
|
+
const fs3 = getFsImplementation();
|
|
392224
392225
|
const mainFilePath = getInstalledPluginsFilePath();
|
|
392225
392226
|
const v2FilePath = getInstalledPluginsV2FilePath();
|
|
392226
392227
|
try {
|
|
@@ -392267,7 +392268,7 @@ function migrateToSinglePluginFile() {
|
|
|
392267
392268
|
}
|
|
392268
392269
|
}
|
|
392269
392270
|
function cleanupLegacyCache(v2Data) {
|
|
392270
|
-
const fs3 =
|
|
392271
|
+
const fs3 = getFsImplementation();
|
|
392271
392272
|
const cachePath = getPluginCachePath();
|
|
392272
392273
|
try {
|
|
392273
392274
|
const referencedPaths = new Set;
|
|
@@ -392307,7 +392308,7 @@ function cleanupLegacyCache(v2Data) {
|
|
|
392307
392308
|
}
|
|
392308
392309
|
}
|
|
392309
392310
|
function readInstalledPluginsFileRaw() {
|
|
392310
|
-
const fs3 =
|
|
392311
|
+
const fs3 = getFsImplementation();
|
|
392311
392312
|
const filePath = getInstalledPluginsFilePath();
|
|
392312
392313
|
let fileContent;
|
|
392313
392314
|
try {
|
|
@@ -392371,7 +392372,7 @@ function loadInstalledPluginsV2() {
|
|
|
392371
392372
|
}
|
|
392372
392373
|
}
|
|
392373
392374
|
function saveInstalledPluginsV2(data) {
|
|
392374
|
-
const fs3 =
|
|
392375
|
+
const fs3 = getFsImplementation();
|
|
392375
392376
|
const filePath = getInstalledPluginsFilePath();
|
|
392376
392377
|
try {
|
|
392377
392378
|
fs3.mkdirSync(getPluginsDirectory());
|
|
@@ -392541,7 +392542,7 @@ async function getGitCommitSha(dirPath) {
|
|
|
392541
392542
|
return sha ?? undefined;
|
|
392542
392543
|
}
|
|
392543
392544
|
function getPluginVersionFromManifest(pluginCachePath, pluginId) {
|
|
392544
|
-
const fs3 =
|
|
392545
|
+
const fs3 = getFsImplementation();
|
|
392545
392546
|
const manifestPath = join93(pluginCachePath, ".claude-plugin", "plugin.json");
|
|
392546
392547
|
try {
|
|
392547
392548
|
const manifestContent = fs3.readFileSync(manifestPath, { encoding: "utf-8" });
|
|
@@ -392645,7 +392646,7 @@ async function migrateFromEnabledPlugins() {
|
|
|
392645
392646
|
const pluginCachePath = join93(cachePath, sanitizedName);
|
|
392646
392647
|
let dirEntries;
|
|
392647
392648
|
try {
|
|
392648
|
-
dirEntries = (await
|
|
392649
|
+
dirEntries = (await getFsImplementation().readdir(pluginCachePath)).map((e2) => typeof e2 === "string" ? e2 : e2.name);
|
|
392649
392650
|
} catch (e2) {
|
|
392650
392651
|
if (!isENOENT(e2))
|
|
392651
392652
|
throw e2;
|
|
@@ -392799,14 +392800,14 @@ async function cacheAndRegisterPlugin(pluginId, entry, scope = "user", projectPa
|
|
|
392799
392800
|
const versionedPath = getVersionedCachePath(pluginId, version2);
|
|
392800
392801
|
let finalPath = cacheResult.path;
|
|
392801
392802
|
if (cacheResult.path !== versionedPath) {
|
|
392802
|
-
await
|
|
392803
|
+
await getFsImplementation().mkdir(dirname42(versionedPath));
|
|
392803
392804
|
await rm8(versionedPath, { recursive: true, force: true });
|
|
392804
392805
|
const normalizedCachePath = cacheResult.path.endsWith(sep24) ? cacheResult.path : cacheResult.path + sep24;
|
|
392805
392806
|
const isSubdirectory = versionedPath.startsWith(normalizedCachePath);
|
|
392806
392807
|
if (isSubdirectory) {
|
|
392807
392808
|
const tempPath = join94(dirname42(cacheResult.path), `.claude-plugin-temp-${Date.now()}-${randomBytes11(4).toString("hex")}`);
|
|
392808
392809
|
await rename5(cacheResult.path, tempPath);
|
|
392809
|
-
await
|
|
392810
|
+
await getFsImplementation().mkdir(dirname42(versionedPath));
|
|
392810
392811
|
await rename5(tempPath, versionedPath);
|
|
392811
392812
|
} else {
|
|
392812
392813
|
await rename5(cacheResult.path, versionedPath);
|
|
@@ -393123,7 +393124,7 @@ async function resolvePluginPath(pluginId, version2) {
|
|
|
393123
393124
|
return version2 ? getVersionedCachePath(pluginId, version2) : legacyPath;
|
|
393124
393125
|
}
|
|
393125
393126
|
async function copyDir(src, dest) {
|
|
393126
|
-
await
|
|
393127
|
+
await getFsImplementation().mkdir(dest);
|
|
393127
393128
|
const entries = await readdir20(src, { withFileTypes: true });
|
|
393128
393129
|
for (const entry of entries) {
|
|
393129
393130
|
const srcPath = join95(src, entry.name);
|
|
@@ -393182,7 +393183,7 @@ async function copyPluginToVersionedCache(sourcePath, pluginId, version2, entry,
|
|
|
393182
393183
|
logForDebugging(`Using seed cache for ${pluginId}@${version2} at ${seedPath}`);
|
|
393183
393184
|
return seedPath;
|
|
393184
393185
|
}
|
|
393185
|
-
await
|
|
393186
|
+
await getFsImplementation().mkdir(dirname43(cachePath));
|
|
393186
393187
|
if (entry && typeof entry.source === "string" && marketplaceDir) {
|
|
393187
393188
|
const sourceDir = validatePathWithinBase(marketplaceDir, entry.source);
|
|
393188
393189
|
logForDebugging(`Copying source directory ${entry.source} for plugin ${pluginId}`);
|
|
@@ -393230,7 +393231,7 @@ function validateGitUrl(url3) {
|
|
|
393230
393231
|
}
|
|
393231
393232
|
async function installFromNpm(packageName, targetPath, options2 = {}) {
|
|
393232
393233
|
const npmCachePath = join95(getPluginsDirectory(), "npm-cache");
|
|
393233
|
-
await
|
|
393234
|
+
await getFsImplementation().mkdir(npmCachePath);
|
|
393234
393235
|
const packageSpec = options2.version ? `${packageName}@${options2.version}` : packageName;
|
|
393235
393236
|
const packagePath = join95(npmCachePath, "node_modules", packageName);
|
|
393236
393237
|
const needsInstall = !await pathExists(packagePath);
|
|
@@ -393425,7 +393426,7 @@ function generateTemporaryCacheNameForPlugin(source) {
|
|
|
393425
393426
|
}
|
|
393426
393427
|
async function cachePlugin(source, options2) {
|
|
393427
393428
|
const cachePath = getPluginCachePath();
|
|
393428
|
-
await
|
|
393429
|
+
await getFsImplementation().mkdir(cachePath);
|
|
393429
393430
|
const tempName = generateTemporaryCacheNameForPlugin(source);
|
|
393430
393431
|
const tempPath = join95(cachePath, tempName);
|
|
393431
393432
|
let shouldCleanup = false;
|
|
@@ -394814,7 +394815,7 @@ async function loadOutputStylesFromDirectory(outputStylesPath, pluginName, loade
|
|
|
394814
394815
|
return styles5;
|
|
394815
394816
|
}
|
|
394816
394817
|
async function loadOutputStyleFromFile(filePath, pluginName, loadedPaths) {
|
|
394817
|
-
const fs3 =
|
|
394818
|
+
const fs3 = getFsImplementation();
|
|
394818
394819
|
if (isDuplicatePath(fs3, filePath, loadedPaths)) {
|
|
394819
394820
|
return null;
|
|
394820
394821
|
}
|
|
@@ -394875,7 +394876,7 @@ var init_loadPluginOutputStyles = __esm(() => {
|
|
|
394875
394876
|
if (plugin.outputStylesPaths) {
|
|
394876
394877
|
for (const stylePath of plugin.outputStylesPaths) {
|
|
394877
394878
|
try {
|
|
394878
|
-
const fs3 =
|
|
394879
|
+
const fs3 = getFsImplementation();
|
|
394879
394880
|
const stats = await fs3.stat(stylePath);
|
|
394880
394881
|
if (stats.isDirectory()) {
|
|
394881
394882
|
const styles5 = await loadOutputStylesFromDirectory(stylePath, plugin.name, loadedPaths);
|
|
@@ -401228,7 +401229,7 @@ function isSymlinkTo({
|
|
|
401228
401229
|
processPwd,
|
|
401229
401230
|
originalCwd
|
|
401230
401231
|
}) {
|
|
401231
|
-
const { resolvedPath: resolvedProcessPwd, isSymlink: isProcessPwdSymlink } = safeResolvePath(
|
|
401232
|
+
const { resolvedPath: resolvedProcessPwd, isSymlink: isProcessPwdSymlink } = safeResolvePath(getFsImplementation(), processPwd);
|
|
401232
401233
|
return isProcessPwdSymlink ? resolvedProcessPwd === resolve35(originalCwd) : false;
|
|
401233
401234
|
}
|
|
401234
401235
|
function initialPermissionModeFromCLI({
|
|
@@ -402152,7 +402153,7 @@ function detectModeEntry(args) {
|
|
|
402152
402153
|
|
|
402153
402154
|
// src/projectOnboardingSteps.ts
|
|
402154
402155
|
function getSteps() {
|
|
402155
|
-
const hasRepoInstructions = findProjectInstructionFilePathInAncestors(getCwd(),
|
|
402156
|
+
const hasRepoInstructions = findProjectInstructionFilePathInAncestors(getCwd(), getFsImplementation().existsSync) !== null;
|
|
402156
402157
|
const isWorkspaceDirEmpty = isDirEmpty(getCwd());
|
|
402157
402158
|
return [
|
|
402158
402159
|
{
|
|
@@ -405303,7 +405304,7 @@ async function scanDirectory(dirPath) {
|
|
|
405303
405304
|
return cached3;
|
|
405304
405305
|
}
|
|
405305
405306
|
try {
|
|
405306
|
-
const fs3 =
|
|
405307
|
+
const fs3 = getFsImplementation();
|
|
405307
405308
|
const entries = await fs3.readdir(dirPath);
|
|
405308
405309
|
const directories = entries.filter((entry) => entry.isDirectory() && !entry.name.startsWith(".")).map((entry) => ({
|
|
405309
405310
|
name: entry.name,
|
|
@@ -405340,7 +405341,7 @@ async function scanDirectoryForPaths(dirPath, includeHidden = false) {
|
|
|
405340
405341
|
return cached3;
|
|
405341
405342
|
}
|
|
405342
405343
|
try {
|
|
405343
|
-
const fs3 =
|
|
405344
|
+
const fs3 = getFsImplementation();
|
|
405344
405345
|
const entries = await fs3.readdir(dirPath);
|
|
405345
405346
|
const paths2 = entries.filter((entry) => includeHidden || !entry.name.startsWith(".")).map((entry) => ({
|
|
405346
405347
|
name: entry.name,
|
|
@@ -407660,7 +407661,7 @@ async function loadRipgrepIgnorePatterns(repoRoot, cwd2) {
|
|
|
407660
407661
|
if (ignorePatternsCacheKey === cacheKey) {
|
|
407661
407662
|
return ignorePatternsCache;
|
|
407662
407663
|
}
|
|
407663
|
-
const fs3 =
|
|
407664
|
+
const fs3 = getFsImplementation();
|
|
407664
407665
|
const ignoreFiles = [".ignore", ".rgignore"];
|
|
407665
407666
|
const directories = [...new Set([repoRoot, cwd2])];
|
|
407666
407667
|
const ig = import_ignore3.default();
|
|
@@ -407931,7 +407932,7 @@ function startBackgroundCacheRefresh() {
|
|
|
407931
407932
|
});
|
|
407932
407933
|
}
|
|
407933
407934
|
async function getTopLevelPaths() {
|
|
407934
|
-
const fs3 =
|
|
407935
|
+
const fs3 = getFsImplementation();
|
|
407935
407936
|
const cwd2 = getCwd();
|
|
407936
407937
|
try {
|
|
407937
407938
|
const entries = await fs3.readdir(cwd2);
|
|
@@ -408076,7 +408077,7 @@ Use the Edit tool with file_path: {{docPath}}
|
|
|
408076
408077
|
REMEMBER: Only update if there is substantial new information. The Magic Doc header (# MAGIC DOC: {{docTitle}}) must remain unchanged.`;
|
|
408077
408078
|
}
|
|
408078
408079
|
async function loadMagicDocsPrompt() {
|
|
408079
|
-
const fs3 =
|
|
408080
|
+
const fs3 = getFsImplementation();
|
|
408080
408081
|
const promptPath = join103(getClaudeConfigHomeDir(), "magic-docs", "prompt.md");
|
|
408081
408082
|
try {
|
|
408082
408083
|
return await fs3.readFile(promptPath, { encoding: "utf-8" });
|
|
@@ -410430,7 +410431,7 @@ function buildPrimarySection() {
|
|
|
410430
410431
|
});
|
|
410431
410432
|
return [{
|
|
410432
410433
|
label: "Version",
|
|
410433
|
-
value: "0.9.
|
|
410434
|
+
value: "0.9.3"
|
|
410434
410435
|
}, {
|
|
410435
410436
|
label: "Session name",
|
|
410436
410437
|
value: nameValue
|
|
@@ -421936,7 +421937,7 @@ function removePathWithRetry(path18, options2) {
|
|
|
421936
421937
|
}
|
|
421937
421938
|
}
|
|
421938
421939
|
function getProviders() {
|
|
421939
|
-
const cwd2 =
|
|
421940
|
+
const cwd2 = getFsImplementation().cwd();
|
|
421940
421941
|
const projectDir = join109(getProjectsDir(), sanitizePath2(cwd2));
|
|
421941
421942
|
let providers = providerCache.get(projectDir);
|
|
421942
421943
|
if (!providers) {
|
|
@@ -422098,7 +422099,7 @@ function loadProjectGraph(cwd2) {
|
|
|
422098
422099
|
return projectGraph;
|
|
422099
422100
|
}
|
|
422100
422101
|
function getGlobalGraph() {
|
|
422101
|
-
const cwd2 =
|
|
422102
|
+
const cwd2 = getFsImplementation().cwd();
|
|
422102
422103
|
if (!projectGraph || Object.keys(projectGraph.entities).length === 0 && projectGraph.summaries.length === 0) {
|
|
422103
422104
|
return loadProjectGraph(cwd2);
|
|
422104
422105
|
}
|
|
@@ -422135,7 +422136,7 @@ async function getOrchestratedMemory(query2) {
|
|
|
422135
422136
|
if (queryWords.length === 0) {
|
|
422136
422137
|
return getGlobalGraphSummary();
|
|
422137
422138
|
}
|
|
422138
|
-
await initOrama(
|
|
422139
|
+
await initOrama(getFsImplementation().cwd());
|
|
422139
422140
|
if (oramaDb) {
|
|
422140
422141
|
try {
|
|
422141
422142
|
const results = await search2(oramaDb, { term: query2, limit: 20 });
|
|
@@ -422275,7 +422276,7 @@ Project Rules:
|
|
|
422275
422276
|
return summary;
|
|
422276
422277
|
}
|
|
422277
422278
|
function resetGlobalGraph() {
|
|
422278
|
-
const cwd2 =
|
|
422279
|
+
const cwd2 = getFsImplementation().cwd();
|
|
422279
422280
|
const { sqlite, json: json2 } = getProviders();
|
|
422280
422281
|
const emptyGraph = {
|
|
422281
422282
|
entities: {},
|
|
@@ -423097,7 +423098,7 @@ function isGuiEditor(editor) {
|
|
|
423097
423098
|
return classifyGuiEditor(editor) !== undefined;
|
|
423098
423099
|
}
|
|
423099
423100
|
function editFileInEditor(filePath) {
|
|
423100
|
-
const fs3 =
|
|
423101
|
+
const fs3 = getFsImplementation();
|
|
423101
423102
|
const inkInstance = instances_default.get(process.stdout);
|
|
423102
423103
|
if (!inkInstance) {
|
|
423103
423104
|
throw new Error("Ink instance not found - cannot pause rendering");
|
|
@@ -423163,7 +423164,7 @@ function recollapsePastedContent(editedPrompt, originalPrompt, pastedContents) {
|
|
|
423163
423164
|
return collapsed;
|
|
423164
423165
|
}
|
|
423165
423166
|
function editPromptInEditor(currentPrompt, pastedContents) {
|
|
423166
|
-
const fs3 =
|
|
423167
|
+
const fs3 = getFsImplementation();
|
|
423167
423168
|
const tempFile = generateTempFilePath();
|
|
423168
423169
|
try {
|
|
423169
423170
|
const expandedPrompt = pastedContents ? expandPastedTextRefs(currentPrompt, pastedContents) : currentPrompt;
|
|
@@ -423357,7 +423358,7 @@ function getReleaseTagUrl(version2 = publicBuildVersion) {
|
|
|
423357
423358
|
return `${VERBOO_RELEASES_URL}/tag/v${normalizePublicVersion(version2)}`;
|
|
423358
423359
|
}
|
|
423359
423360
|
function getPublicBuildVersion() {
|
|
423360
|
-
return "0.9.
|
|
423361
|
+
return "0.9.3";
|
|
423361
423362
|
}
|
|
423362
423363
|
var import_semver9, VERBOO_RELEASES_URL = "https://github.com/verbeux-ai/code/releases", fallbackBuildVersion, publicBuildVersion;
|
|
423363
423364
|
var init_version = __esm(() => {
|
|
@@ -426469,7 +426470,7 @@ async function performPluginUpdate({
|
|
|
426469
426470
|
scope,
|
|
426470
426471
|
projectPath
|
|
426471
426472
|
}) {
|
|
426472
|
-
const fs3 =
|
|
426473
|
+
const fs3 = getFsImplementation();
|
|
426473
426474
|
const oldVersion = installation.version;
|
|
426474
426475
|
let sourcePath;
|
|
426475
426476
|
let newVersion;
|
|
@@ -435867,7 +435868,7 @@ import { homedir as homedir28 } from "os";
|
|
|
435867
435868
|
import { resolve as resolve38 } from "path";
|
|
435868
435869
|
async function parseMarketplaceInput(input) {
|
|
435869
435870
|
const trimmed = input.trim();
|
|
435870
|
-
const fs3 =
|
|
435871
|
+
const fs3 = getFsImplementation();
|
|
435871
435872
|
const sshMatch = trimmed.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);
|
|
435872
435873
|
if (sshMatch?.[1]) {
|
|
435873
435874
|
const url3 = sshMatch[1];
|
|
@@ -436205,7 +436206,7 @@ async function saveInstallCountsCache(cache4) {
|
|
|
436205
436206
|
const tempPath = `${cachePath}.${randomBytes14(8).toString("hex")}.tmp`;
|
|
436206
436207
|
try {
|
|
436207
436208
|
const pluginsDir = getPluginsDirectory();
|
|
436208
|
-
await
|
|
436209
|
+
await getFsImplementation().mkdir(pluginsDir);
|
|
436209
436210
|
const content = jsonStringify(cache4, null, 2);
|
|
436210
436211
|
await writeFile35(tempPath, content, {
|
|
436211
436212
|
encoding: "utf-8",
|
|
@@ -440076,7 +440077,7 @@ async function writeToDisk(plugins) {
|
|
|
440076
440077
|
const filePath = getFlaggedPluginsPath();
|
|
440077
440078
|
const tempPath = `${filePath}.${randomBytes15(8).toString("hex")}.tmp`;
|
|
440078
440079
|
try {
|
|
440079
|
-
await
|
|
440080
|
+
await getFsImplementation().mkdir(getPluginsDirectory());
|
|
440080
440081
|
const content = jsonStringify({ plugins }, null, 2);
|
|
440081
440082
|
await writeFile36(tempPath, content, {
|
|
440082
440083
|
encoding: "utf-8",
|
|
@@ -478134,7 +478135,7 @@ async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
|
478134
478135
|
rss: ${toGB(diagnostics.memoryUsage.rss)} GB (total process)
|
|
478135
478136
|
${diagnostics.analysis.recommendation}`);
|
|
478136
478137
|
const dumpDir = getDesktopPath();
|
|
478137
|
-
await
|
|
478138
|
+
await getFsImplementation().mkdir(dumpDir);
|
|
478138
478139
|
const suffix = dumpNumber > 0 ? `-dump${dumpNumber}` : "";
|
|
478139
478140
|
const heapFilename = `${sessionId}${suffix}.heapsnapshot`;
|
|
478140
478141
|
const diagFilename = `${sessionId}${suffix}-diagnostics.json`;
|
|
@@ -478705,7 +478706,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
478705
478706
|
var call63 = async () => {
|
|
478706
478707
|
return {
|
|
478707
478708
|
type: "text",
|
|
478708
|
-
value: `${"99.0.0"} (built ${"2026-05-
|
|
478709
|
+
value: `${"99.0.0"} (built ${"2026-05-18T14:17:30.701Z"})`
|
|
478709
478710
|
};
|
|
478710
478711
|
}, version2, version_default;
|
|
478711
478712
|
var init_version2 = __esm(() => {
|
|
@@ -484632,7 +484633,7 @@ function migrateStatsCache(parsed) {
|
|
|
484632
484633
|
};
|
|
484633
484634
|
}
|
|
484634
484635
|
async function loadStatsCache() {
|
|
484635
|
-
const fs4 =
|
|
484636
|
+
const fs4 = getFsImplementation();
|
|
484636
484637
|
const cachePath = getStatsCachePath();
|
|
484637
484638
|
try {
|
|
484638
484639
|
const content = await fs4.readFile(cachePath, { encoding: "utf-8" });
|
|
@@ -484666,7 +484667,7 @@ async function loadStatsCache() {
|
|
|
484666
484667
|
}
|
|
484667
484668
|
}
|
|
484668
484669
|
async function saveStatsCache(cache5) {
|
|
484669
|
-
const fs4 =
|
|
484670
|
+
const fs4 = getFsImplementation();
|
|
484670
484671
|
const cachePath = getStatsCachePath();
|
|
484671
484672
|
const tempPath = `${cachePath}.${randomBytes16(8).toString("hex")}.tmp`;
|
|
484672
484673
|
try {
|
|
@@ -485353,7 +485354,7 @@ import { open as open16 } from "fs/promises";
|
|
|
485353
485354
|
import { basename as basename44, dirname as dirname55, join as join135, sep as sep31 } from "path";
|
|
485354
485355
|
async function processSessionFiles(sessionFiles, options2 = {}) {
|
|
485355
485356
|
const { fromDate, toDate } = options2;
|
|
485356
|
-
const fs4 =
|
|
485357
|
+
const fs4 = getFsImplementation();
|
|
485357
485358
|
const dailyActivityMap = new Map;
|
|
485358
485359
|
const dailyModelTokensMap = new Map;
|
|
485359
485360
|
const sessions = [];
|
|
@@ -485528,7 +485529,7 @@ async function processSessionFiles(sessionFiles, options2 = {}) {
|
|
|
485528
485529
|
}
|
|
485529
485530
|
async function getAllSessionFiles() {
|
|
485530
485531
|
const projectsDir = getProjectsDir();
|
|
485531
|
-
const fs4 =
|
|
485532
|
+
const fs4 = getFsImplementation();
|
|
485532
485533
|
let allEntries;
|
|
485533
485534
|
try {
|
|
485534
485535
|
allEntries = await fs4.readdir(projectsDir);
|
|
@@ -490421,7 +490422,7 @@ async function listRemoteAgentMetadata() {
|
|
|
490421
490422
|
function sessionIdExists(sessionId) {
|
|
490422
490423
|
const projectDir = getProjectDir3(getOriginalCwd());
|
|
490423
490424
|
const sessionFile = join137(projectDir, `${sessionId}.jsonl`);
|
|
490424
|
-
const fs4 =
|
|
490425
|
+
const fs4 = getFsImplementation();
|
|
490425
490426
|
try {
|
|
490426
490427
|
fs4.statSync(sessionFile);
|
|
490427
490428
|
return true;
|
|
@@ -491901,7 +491902,7 @@ async function fetchLogs(limit) {
|
|
|
491901
491902
|
return logs;
|
|
491902
491903
|
}
|
|
491903
491904
|
function appendEntryToFile(fullPath, entry) {
|
|
491904
|
-
const fs4 =
|
|
491905
|
+
const fs4 = getFsImplementation();
|
|
491905
491906
|
const line = jsonStringify(entry) + `
|
|
491906
491907
|
`;
|
|
491907
491908
|
try {
|
|
@@ -493492,7 +493493,7 @@ function truncateEntrypointContent(raw) {
|
|
|
493492
493493
|
};
|
|
493493
493494
|
}
|
|
493494
493495
|
async function ensureMemoryDirExists(memoryDir) {
|
|
493495
|
-
const fs4 =
|
|
493496
|
+
const fs4 = getFsImplementation();
|
|
493496
493497
|
try {
|
|
493497
493498
|
await fs4.mkdir(memoryDir);
|
|
493498
493499
|
} catch (e2) {
|
|
@@ -493501,7 +493502,7 @@ async function ensureMemoryDirExists(memoryDir) {
|
|
|
493501
493502
|
}
|
|
493502
493503
|
}
|
|
493503
493504
|
function logMemoryDirCounts(memoryDir, baseMetadata) {
|
|
493504
|
-
const fs4 =
|
|
493505
|
+
const fs4 = getFsImplementation();
|
|
493505
493506
|
fs4.readdir(memoryDir).then((dirents) => {
|
|
493506
493507
|
let fileCount = 0;
|
|
493507
493508
|
let subdirCount = 0;
|
|
@@ -493581,7 +493582,7 @@ function buildMemoryLines(displayName, memoryDir, extraGuidelines, skipIndex = f
|
|
|
493581
493582
|
}
|
|
493582
493583
|
function buildMemoryPrompt(params) {
|
|
493583
493584
|
const { displayName, memoryDir, extraGuidelines } = params;
|
|
493584
|
-
const fs4 =
|
|
493585
|
+
const fs4 = getFsImplementation();
|
|
493585
493586
|
const entrypoint = memoryDir + ENTRYPOINT_NAME;
|
|
493586
493587
|
let entrypointContent = "";
|
|
493587
493588
|
try {
|
|
@@ -493889,7 +493890,7 @@ async function ensureScratchpadDir() {
|
|
|
493889
493890
|
if (!isScratchpadEnabled()) {
|
|
493890
493891
|
throw new Error("Scratchpad directory feature is not enabled");
|
|
493891
493892
|
}
|
|
493892
|
-
const fs4 =
|
|
493893
|
+
const fs4 = getFsImplementation();
|
|
493893
493894
|
const scratchpadDir = getScratchpadDir();
|
|
493894
493895
|
await fs4.mkdir(scratchpadDir, { mode: 448 });
|
|
493895
493896
|
return scratchpadDir;
|
|
@@ -494638,7 +494639,7 @@ var init_filesystem = __esm(() => {
|
|
|
494638
494639
|
DIR_SEP = posix8.sep;
|
|
494639
494640
|
getClaudeTempDir = memoize_default(function getClaudeTempDir2() {
|
|
494640
494641
|
const baseTmpDir = process.env.CLAUDE_CODE_TMPDIR || (getPlatform() === "windows" ? tmpdir9() : "/tmp");
|
|
494641
|
-
const fs4 =
|
|
494642
|
+
const fs4 = getFsImplementation();
|
|
494642
494643
|
let resolvedBaseTmpDir = baseTmpDir;
|
|
494643
494644
|
try {
|
|
494644
494645
|
resolvedBaseTmpDir = fs4.realpathSync(baseTmpDir);
|
|
@@ -508169,8 +508170,6 @@ var init_types15 = __esm(() => {
|
|
|
508169
508170
|
sandbox: SandboxSettingsSchema().optional(),
|
|
508170
508171
|
feedbackSurveyRate: exports_external.number().min(0).max(1).optional().describe("Probability (0–1) that the session quality survey appears when eligible. 0.05 is a reasonable starting point."),
|
|
508171
508172
|
spinnerTipsEnabled: exports_external.boolean().optional().describe("Whether to show tips in the spinner"),
|
|
508172
|
-
sponsoredTipsEnabled: exports_external.boolean().optional().describe("Whether to show sponsored partner tips alongside regular tips (default: true). Disabling does not affect regular tips."),
|
|
508173
|
-
sponsoredTipsFrequency: exports_external.number().int().min(0).optional().describe("Show at most 1 sponsored tip per N spinner picks. Default 10. Set 0 to disable sponsored tips."),
|
|
508174
508173
|
spinnerVerbs: exports_external.object({
|
|
508175
508174
|
mode: exports_external.enum(["append", "replace"]),
|
|
508176
508175
|
verbs: exports_external.array(exports_external.string())
|
|
@@ -508490,7 +508489,7 @@ function hasManagedSettingsFile() {
|
|
|
508490
508489
|
} catch {}
|
|
508491
508490
|
try {
|
|
508492
508491
|
const dropInDir = getManagedSettingsDropInDir();
|
|
508493
|
-
const entries =
|
|
508492
|
+
const entries = getFsImplementation().readdirSync(dropInDir);
|
|
508494
508493
|
for (const d of entries) {
|
|
508495
508494
|
if (!(d.isFile() || d.isSymbolicLink()) || !d.name.endsWith(".json") || d.name.startsWith(".")) {
|
|
508496
508495
|
continue;
|
|
@@ -508539,7 +508538,7 @@ function loadManagedFileSettings() {
|
|
|
508539
508538
|
}
|
|
508540
508539
|
const dropInDir = getManagedSettingsDropInDir();
|
|
508541
508540
|
try {
|
|
508542
|
-
const entries =
|
|
508541
|
+
const entries = getFsImplementation().readdirSync(dropInDir).filter((d) => (d.isFile() || d.isSymbolicLink()) && d.name.endsWith(".json") && !d.name.startsWith(".")).map((d) => d.name).sort();
|
|
508543
508542
|
for (const name of entries) {
|
|
508544
508543
|
const { settings: settings2, errors: fileErrors } = parseSettingsFile(join147(dropInDir, name));
|
|
508545
508544
|
errors4.push(...fileErrors);
|
|
@@ -508562,7 +508561,7 @@ function getManagedFileSettingsPresence() {
|
|
|
508562
508561
|
let hasDropIns = false;
|
|
508563
508562
|
const dropInDir = getManagedSettingsDropInDir();
|
|
508564
508563
|
try {
|
|
508565
|
-
hasDropIns =
|
|
508564
|
+
hasDropIns = getFsImplementation().readdirSync(dropInDir).some((d) => (d.isFile() || d.isSymbolicLink()) && d.name.endsWith(".json") && !d.name.startsWith("."));
|
|
508566
508565
|
} catch {}
|
|
508567
508566
|
return { hasBase, hasDropIns };
|
|
508568
508567
|
}
|
|
@@ -508590,7 +508589,7 @@ function parseSettingsFile(path21) {
|
|
|
508590
508589
|
}
|
|
508591
508590
|
function parseSettingsFileUncached(path21) {
|
|
508592
508591
|
try {
|
|
508593
|
-
const { resolvedPath } = safeResolvePath(
|
|
508592
|
+
const { resolvedPath } = safeResolvePath(getFsImplementation(), path21);
|
|
508594
508593
|
const content = readFileSync7(resolvedPath);
|
|
508595
508594
|
if (content.trim() === "") {
|
|
508596
508595
|
return { settings: {}, errors: [] };
|
|
@@ -508721,7 +508720,7 @@ function updateSettingsForSource(source, settings) {
|
|
|
508721
508720
|
return { error: null };
|
|
508722
508721
|
}
|
|
508723
508722
|
try {
|
|
508724
|
-
|
|
508723
|
+
getFsImplementation().mkdirSync(dirname60(filePath));
|
|
508725
508724
|
let existingSettings = getSettingsForSourceUncached(source);
|
|
508726
508725
|
if (!existingSettings) {
|
|
508727
508726
|
let content = null;
|
|
@@ -509052,7 +509051,7 @@ function rawSettingsContainsKey(key) {
|
|
|
509052
509051
|
continue;
|
|
509053
509052
|
}
|
|
509054
509053
|
try {
|
|
509055
|
-
const { resolvedPath } = safeResolvePath(
|
|
509054
|
+
const { resolvedPath } = safeResolvePath(getFsImplementation(), filePath);
|
|
509056
509055
|
const content = readFileSync7(resolvedPath);
|
|
509057
509056
|
if (!content.trim()) {
|
|
509058
509057
|
continue;
|
|
@@ -509460,7 +509459,7 @@ function startGlobalConfigFreshnessWatcher() {
|
|
|
509460
509459
|
watchFile3(file2, { interval: CONFIG_FRESHNESS_POLL_MS, persistent: false }, (curr) => {
|
|
509461
509460
|
if (curr.mtimeMs <= globalConfigCache.mtime)
|
|
509462
509461
|
return;
|
|
509463
|
-
|
|
509462
|
+
getFsImplementation().readFile(file2, { encoding: "utf-8" }).then((content) => {
|
|
509464
509463
|
if (curr.mtimeMs <= globalConfigCache.mtime)
|
|
509465
509464
|
return;
|
|
509466
509465
|
const parsed = safeParseJSON(stripBOM2(content));
|
|
@@ -509495,7 +509494,7 @@ function getGlobalConfig() {
|
|
|
509495
509494
|
try {
|
|
509496
509495
|
let stats2 = null;
|
|
509497
509496
|
try {
|
|
509498
|
-
stats2 =
|
|
509497
|
+
stats2 = getFsImplementation().statSync(getGlobalClaudeFile());
|
|
509499
509498
|
} catch {}
|
|
509500
509499
|
const config3 = migrateConfigFields(getConfig2(getGlobalClaudeFile(), createDefaultGlobalConfig));
|
|
509501
509500
|
globalConfigCache = {
|
|
@@ -509528,7 +509527,7 @@ function getCustomApiKeyStatus(truncatedApiKey) {
|
|
|
509528
509527
|
}
|
|
509529
509528
|
function saveConfig(file2, config3, defaultConfig) {
|
|
509530
509529
|
const dir = dirname61(file2);
|
|
509531
|
-
const fs4 =
|
|
509530
|
+
const fs4 = getFsImplementation();
|
|
509532
509531
|
fs4.mkdirSync(dir);
|
|
509533
509532
|
const filteredConfig = pickBy_default(config3, (value, key) => jsonStringify(value) !== jsonStringify(defaultConfig[key]));
|
|
509534
509533
|
writeFileSyncAndFlush_DEPRECATED(file2, jsonStringify(filteredConfig, null, 2), {
|
|
@@ -509542,7 +509541,7 @@ function saveConfig(file2, config3, defaultConfig) {
|
|
|
509542
509541
|
function saveConfigWithLock(file2, createDefault, mergeFn) {
|
|
509543
509542
|
const defaultConfig = createDefault();
|
|
509544
509543
|
const dir = dirname61(file2);
|
|
509545
|
-
const fs4 =
|
|
509544
|
+
const fs4 = getFsImplementation();
|
|
509546
509545
|
fs4.mkdirSync(dir);
|
|
509547
509546
|
let release2;
|
|
509548
509547
|
try {
|
|
@@ -509655,7 +509654,7 @@ function getConfigBackupDir() {
|
|
|
509655
509654
|
return join149(getClaudeConfigHomeDir(), "backups");
|
|
509656
509655
|
}
|
|
509657
509656
|
function findMostRecentBackup(file2) {
|
|
509658
|
-
const fs4 =
|
|
509657
|
+
const fs4 = getFsImplementation();
|
|
509659
509658
|
const fileBase = basename48(file2);
|
|
509660
509659
|
const backupDir = getConfigBackupDir();
|
|
509661
509660
|
try {
|
|
@@ -509684,7 +509683,7 @@ function getConfig2(file2, createDefault, throwOnInvalid) {
|
|
|
509684
509683
|
if (!configReadingAllowed && true) {
|
|
509685
509684
|
throw new Error("Config accessed before allowed.");
|
|
509686
509685
|
}
|
|
509687
|
-
const fs4 =
|
|
509686
|
+
const fs4 = getFsImplementation();
|
|
509688
509687
|
try {
|
|
509689
509688
|
const fileContent = fs4.readFileSync(file2, {
|
|
509690
509689
|
encoding: "utf-8"
|
|
@@ -509986,7 +509985,6 @@ var init_config7 = __esm(() => {
|
|
|
509986
509985
|
"diffTool",
|
|
509987
509986
|
"env",
|
|
509988
509987
|
"tipsHistory",
|
|
509989
|
-
"sponsoredTipsHistory",
|
|
509990
509988
|
"todoFeatureEnabled",
|
|
509991
509989
|
"showExpandedTodos",
|
|
509992
509990
|
"messageIdleNotifThresholdMs",
|
|
@@ -510868,7 +510866,7 @@ function printStartupScreen(modelOverride) {
|
|
|
510868
510866
|
const home = process.env.HOME || process.env.USERPROFILE || "";
|
|
510869
510867
|
const cwd2 = process.cwd();
|
|
510870
510868
|
const displayCwd = home && cwd2.startsWith(home) ? `~${cwd2.slice(home.length)}` : cwd2;
|
|
510871
|
-
const version3 = "0.9.
|
|
510869
|
+
const version3 = "0.9.3";
|
|
510872
510870
|
const bold2 = `${ESC4}1m`;
|
|
510873
510871
|
const PURPLE = rgb3(...ACCENT);
|
|
510874
510872
|
const SOFT = rgb3(...CREAM);
|
|
@@ -520570,7 +520568,7 @@ function FilePermissionDialog({
|
|
|
520570
520568
|
return null;
|
|
520571
520569
|
}
|
|
520572
520570
|
const expandedPath = expandPath(path22);
|
|
520573
|
-
const fs4 =
|
|
520571
|
+
const fs4 = getFsImplementation();
|
|
520574
520572
|
const {
|
|
520575
520573
|
resolvedPath,
|
|
520576
520574
|
isSymlink
|
|
@@ -520759,7 +520757,7 @@ function SedEditPermissionRequest(t0) {
|
|
|
520759
520757
|
if ($2[3] !== filePath) {
|
|
520760
520758
|
t1 = (async () => {
|
|
520761
520759
|
const encoding = detectEncodingForResolvedPath(filePath);
|
|
520762
|
-
const raw = await
|
|
520760
|
+
const raw = await getFsImplementation().readFile(filePath, {
|
|
520763
520761
|
encoding
|
|
520764
520762
|
});
|
|
520765
520763
|
return {
|
|
@@ -524249,7 +524247,7 @@ function NotebookEditToolDiff(props) {
|
|
|
524249
524247
|
const $2 = import_react_compiler_runtime292.c(5);
|
|
524250
524248
|
let t0;
|
|
524251
524249
|
if ($2[0] !== props.notebook_path) {
|
|
524252
|
-
t0 =
|
|
524250
|
+
t0 = getFsImplementation().readFile(props.notebook_path, {
|
|
524253
524251
|
encoding: "utf-8"
|
|
524254
524252
|
}).then(_temp173).catch(_temp273);
|
|
524255
524253
|
$2[0] = props.notebook_path;
|
|
@@ -529135,7 +529133,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
529135
529133
|
function getSemverPart(version3) {
|
|
529136
529134
|
return `${import_semver12.major(version3, { loose: true })}.${import_semver12.minor(version3, { loose: true })}.${import_semver12.patch(version3, { loose: true })}`;
|
|
529137
529135
|
}
|
|
529138
|
-
function useUpdateNotification(updatedVersion, initialVersion = "0.9.
|
|
529136
|
+
function useUpdateNotification(updatedVersion, initialVersion = "0.9.3") {
|
|
529139
529137
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react221.useState(() => getSemverPart(initialVersion));
|
|
529140
529138
|
const [pendingNotification2, setPendingNotification] = import_react221.useState(null);
|
|
529141
529139
|
if (updatedVersion) {
|
|
@@ -529175,7 +529173,7 @@ function AutoUpdater({
|
|
|
529175
529173
|
return;
|
|
529176
529174
|
}
|
|
529177
529175
|
if (false) {}
|
|
529178
|
-
const currentVersion = "0.9.
|
|
529176
|
+
const currentVersion = "0.9.3";
|
|
529179
529177
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
529180
529178
|
let latestVersion = await getLatestVersion(channel2);
|
|
529181
529179
|
const isDisabled = isAutoUpdaterDisabled();
|
|
@@ -529526,17 +529524,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
529526
529524
|
const maxVersion = await getMaxVersion();
|
|
529527
529525
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
529528
529526
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
529529
|
-
if (gte("0.9.
|
|
529530
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${"0.9.
|
|
529527
|
+
if (gte("0.9.3", maxVersion)) {
|
|
529528
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${"0.9.3"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
529531
529529
|
setUpdateAvailable(false);
|
|
529532
529530
|
return;
|
|
529533
529531
|
}
|
|
529534
529532
|
latest = maxVersion;
|
|
529535
529533
|
}
|
|
529536
|
-
const hasUpdate = latest && !gte("0.9.
|
|
529534
|
+
const hasUpdate = latest && !gte("0.9.3", latest) && !shouldSkipVersion(latest);
|
|
529537
529535
|
setUpdateAvailable(!!hasUpdate);
|
|
529538
529536
|
if (hasUpdate) {
|
|
529539
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${"0.9.
|
|
529537
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${"0.9.3"} -> ${latest}`);
|
|
529540
529538
|
}
|
|
529541
529539
|
};
|
|
529542
529540
|
$2[0] = t1;
|
|
@@ -529570,7 +529568,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
529570
529568
|
wrap: "truncate",
|
|
529571
529569
|
children: [
|
|
529572
529570
|
"currentVersion: ",
|
|
529573
|
-
"0.9.
|
|
529571
|
+
"0.9.3"
|
|
529574
529572
|
]
|
|
529575
529573
|
});
|
|
529576
529574
|
$2[3] = verbose;
|
|
@@ -544890,12 +544888,12 @@ function convertFileNameToDate(filename) {
|
|
|
544890
544888
|
async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
|
|
544891
544889
|
const result = { messages: 0, errors: 0 };
|
|
544892
544890
|
try {
|
|
544893
|
-
const files2 = await
|
|
544891
|
+
const files2 = await getFsImplementation().readdir(dirPath);
|
|
544894
544892
|
for (const file2 of files2) {
|
|
544895
544893
|
try {
|
|
544896
544894
|
const timestamp = convertFileNameToDate(file2.name);
|
|
544897
544895
|
if (timestamp < cutoffDate) {
|
|
544898
|
-
await
|
|
544896
|
+
await getFsImplementation().unlink(join152(dirPath, file2.name));
|
|
544899
544897
|
if (isMessagePath) {
|
|
544900
544898
|
result.messages++;
|
|
544901
544899
|
} else {
|
|
@@ -544914,7 +544912,7 @@ async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
|
|
|
544914
544912
|
return result;
|
|
544915
544913
|
}
|
|
544916
544914
|
async function cleanupOldMessageFiles() {
|
|
544917
|
-
const fsImpl =
|
|
544915
|
+
const fsImpl = getFsImplementation();
|
|
544918
544916
|
const cutoffDate = getCutoffDate();
|
|
544919
544917
|
const errorPath = CACHE_PATHS.errors();
|
|
544920
544918
|
const baseCachePath = CACHE_PATHS.baseLogs();
|
|
@@ -544955,7 +544953,7 @@ async function cleanupOldSessionFiles() {
|
|
|
544955
544953
|
const cutoffDate = getCutoffDate();
|
|
544956
544954
|
const result = { messages: 0, errors: 0 };
|
|
544957
544955
|
const projectsDir = getProjectsDir();
|
|
544958
|
-
const fsImpl =
|
|
544956
|
+
const fsImpl = getFsImplementation();
|
|
544959
544957
|
let projectDirents;
|
|
544960
544958
|
try {
|
|
544961
544959
|
projectDirents = await fsImpl.readdir(projectsDir);
|
|
@@ -545037,7 +545035,7 @@ async function cleanupOldSessionFiles() {
|
|
|
545037
545035
|
async function cleanupSingleDirectory(dirPath, extension2, removeEmptyDir = true) {
|
|
545038
545036
|
const cutoffDate = getCutoffDate();
|
|
545039
545037
|
const result = { messages: 0, errors: 0 };
|
|
545040
|
-
const fsImpl =
|
|
545038
|
+
const fsImpl = getFsImplementation();
|
|
545041
545039
|
let dirents;
|
|
545042
545040
|
try {
|
|
545043
545041
|
dirents = await fsImpl.readdir(dirPath);
|
|
@@ -545066,7 +545064,7 @@ function cleanupOldPlanFiles() {
|
|
|
545066
545064
|
async function cleanupOldFileHistoryBackups() {
|
|
545067
545065
|
const cutoffDate = getCutoffDate();
|
|
545068
545066
|
const result = { messages: 0, errors: 0 };
|
|
545069
|
-
const fsImpl =
|
|
545067
|
+
const fsImpl = getFsImplementation();
|
|
545070
545068
|
try {
|
|
545071
545069
|
const configDir = getClaudeConfigHomeDir();
|
|
545072
545070
|
const fileHistoryStorageDir = join152(configDir, "file-history");
|
|
@@ -545100,7 +545098,7 @@ async function cleanupOldFileHistoryBackups() {
|
|
|
545100
545098
|
async function cleanupOldSessionEnvDirs() {
|
|
545101
545099
|
const cutoffDate = getCutoffDate();
|
|
545102
545100
|
const result = { messages: 0, errors: 0 };
|
|
545103
|
-
const fsImpl =
|
|
545101
|
+
const fsImpl = getFsImplementation();
|
|
545104
545102
|
try {
|
|
545105
545103
|
const configDir = getClaudeConfigHomeDir();
|
|
545106
545104
|
const sessionEnvBaseDir = join152(configDir, "session-env");
|
|
@@ -545131,7 +545129,7 @@ async function cleanupOldSessionEnvDirs() {
|
|
|
545131
545129
|
async function cleanupOldDebugLogs() {
|
|
545132
545130
|
const cutoffDate = getCutoffDate();
|
|
545133
545131
|
const result = { messages: 0, errors: 0 };
|
|
545134
|
-
const fsImpl =
|
|
545132
|
+
const fsImpl = getFsImplementation();
|
|
545135
545133
|
const debugDir = join152(getClaudeConfigHomeDir(), "debug");
|
|
545136
545134
|
let dirents;
|
|
545137
545135
|
try {
|
|
@@ -547442,7 +547440,7 @@ function dispose3() {
|
|
|
547442
547440
|
return closePromise;
|
|
547443
547441
|
}
|
|
547444
547442
|
async function getWatchablePaths() {
|
|
547445
|
-
const fs5 =
|
|
547443
|
+
const fs5 = getFsImplementation();
|
|
547446
547444
|
const paths2 = [];
|
|
547447
547445
|
const userSkillsPath = getSkillsPath("userSettings", "skills");
|
|
547448
547446
|
if (userSkillsPath) {
|
|
@@ -551010,71 +551008,6 @@ var init_usePromptsFromClaudeInChrome = __esm(() => {
|
|
|
551010
551008
|
}));
|
|
551011
551009
|
});
|
|
551012
551010
|
|
|
551013
|
-
// src/services/tips/sponsoredTips.ts
|
|
551014
|
-
function sponsoredTipsEnabled() {
|
|
551015
|
-
const settings = getSettings_DEPRECATED();
|
|
551016
|
-
if (settings.sponsoredTipsEnabled === false)
|
|
551017
|
-
return false;
|
|
551018
|
-
if (settings.sponsoredTipsFrequency === 0)
|
|
551019
|
-
return false;
|
|
551020
|
-
return true;
|
|
551021
|
-
}
|
|
551022
|
-
function getSponsoredTipsFrequency() {
|
|
551023
|
-
const settings = getSettings_DEPRECATED();
|
|
551024
|
-
const f = settings.sponsoredTipsFrequency;
|
|
551025
|
-
if (typeof f === "number" && f >= 0)
|
|
551026
|
-
return f;
|
|
551027
|
-
return DEFAULT_FREQUENCY;
|
|
551028
|
-
}
|
|
551029
|
-
function renderSponsoredTip(sponsor, body, ctx) {
|
|
551030
|
-
const green2 = color("success", ctx.theme);
|
|
551031
|
-
const label = sponsor.label ?? "Sponsored";
|
|
551032
|
-
const badge = green2(`${label} · ${sponsor.name}`);
|
|
551033
|
-
const text2 = green2(body);
|
|
551034
|
-
const url3 = sponsor.url ? ` ${source_default.dim(sponsor.url)}` : "";
|
|
551035
|
-
return `${badge} — ${text2}${url3}`;
|
|
551036
|
-
}
|
|
551037
|
-
var DEFAULT_FREQUENCY = 10, ATOMIC, sponsoredTips;
|
|
551038
|
-
var init_sponsoredTips = __esm(() => {
|
|
551039
|
-
init_source2();
|
|
551040
|
-
init_color();
|
|
551041
|
-
init_settings2();
|
|
551042
|
-
ATOMIC = {
|
|
551043
|
-
name: "Atomic Chat",
|
|
551044
|
-
url: "https://atomic.chat/"
|
|
551045
|
-
};
|
|
551046
|
-
sponsoredTips = [
|
|
551047
|
-
{
|
|
551048
|
-
id: "atomic-setup-local",
|
|
551049
|
-
sponsor: ATOMIC,
|
|
551050
|
-
content: async (ctx) => renderSponsoredTip(ATOMIC, "Setup free local models with Atomic Chat", ctx),
|
|
551051
|
-
cooldownSessions: 20,
|
|
551052
|
-
isRelevant: async () => sponsoredTipsEnabled()
|
|
551053
|
-
},
|
|
551054
|
-
{
|
|
551055
|
-
id: "atomic-free-access",
|
|
551056
|
-
sponsor: ATOMIC,
|
|
551057
|
-
content: async (ctx) => renderSponsoredTip(ATOMIC, "Atomic Chat local models give you free access to OpenClaude", ctx),
|
|
551058
|
-
cooldownSessions: 20,
|
|
551059
|
-
isRelevant: async () => sponsoredTipsEnabled()
|
|
551060
|
-
},
|
|
551061
|
-
{
|
|
551062
|
-
id: "atomic-turboquant-context",
|
|
551063
|
-
sponsor: ATOMIC,
|
|
551064
|
-
content: async (ctx) => renderSponsoredTip(ATOMIC, "Increase your context window with TurboQuant in Atomic Chat local models", ctx),
|
|
551065
|
-
cooldownSessions: 20,
|
|
551066
|
-
isRelevant: async () => sponsoredTipsEnabled()
|
|
551067
|
-
},
|
|
551068
|
-
{
|
|
551069
|
-
id: "atomic-ram-savings",
|
|
551070
|
-
sponsor: ATOMIC,
|
|
551071
|
-
content: async (ctx) => renderSponsoredTip(ATOMIC, "30% less RAM usage with Atomic Chat local models", ctx),
|
|
551072
|
-
cooldownSessions: 20,
|
|
551073
|
-
isRelevant: async () => sponsoredTipsEnabled()
|
|
551074
|
-
}
|
|
551075
|
-
];
|
|
551076
|
-
});
|
|
551077
|
-
|
|
551078
551011
|
// src/services/tips/tipHistory.ts
|
|
551079
551012
|
function recordTipShown(tipId) {
|
|
551080
551013
|
const numStartups = getGlobalConfig().numStartups;
|
|
@@ -551092,26 +551025,6 @@ function getSessionsSinceLastShown(tipId) {
|
|
|
551092
551025
|
return Infinity;
|
|
551093
551026
|
return config3.numStartups - lastShown;
|
|
551094
551027
|
}
|
|
551095
|
-
function recordSponsoredTipShown() {
|
|
551096
|
-
const numStartups = getGlobalConfig().numStartups;
|
|
551097
|
-
saveGlobalConfig((c6) => {
|
|
551098
|
-
const prev = c6.sponsoredTipsHistory ?? { lastShownAt: 0, totalShown: 0 };
|
|
551099
|
-
return {
|
|
551100
|
-
...c6,
|
|
551101
|
-
sponsoredTipsHistory: {
|
|
551102
|
-
lastShownAt: numStartups,
|
|
551103
|
-
totalShown: prev.totalShown + 1
|
|
551104
|
-
}
|
|
551105
|
-
};
|
|
551106
|
-
});
|
|
551107
|
-
}
|
|
551108
|
-
function getSessionsSinceLastSponsored() {
|
|
551109
|
-
const config3 = getGlobalConfig();
|
|
551110
|
-
const lastShown = config3.sponsoredTipsHistory?.lastShownAt;
|
|
551111
|
-
if (!lastShown)
|
|
551112
|
-
return Infinity;
|
|
551113
|
-
return config3.numStartups - lastShown;
|
|
551114
|
-
}
|
|
551115
551028
|
var init_tipHistory = __esm(() => {
|
|
551116
551029
|
init_config7();
|
|
551117
551030
|
});
|
|
@@ -551354,7 +551267,7 @@ async function getRelevantTips(context2) {
|
|
|
551354
551267
|
if (override?.excludeDefault && customTips.length > 0) {
|
|
551355
551268
|
return customTips;
|
|
551356
551269
|
}
|
|
551357
|
-
const tips = [...externalTips, ...internalOnlyTips
|
|
551270
|
+
const tips = [...externalTips, ...internalOnlyTips];
|
|
551358
551271
|
const isRelevant = await Promise.all(tips.map((_) => _.isRelevant(context2)));
|
|
551359
551272
|
const filtered = tips.filter((_, index) => isRelevant[index]).filter((_) => getSessionsSinceLastShown(_.id) >= _.cooldownSessions);
|
|
551360
551273
|
return [...filtered, ...customTips];
|
|
@@ -551388,7 +551301,6 @@ var init_tipRegistry = __esm(() => {
|
|
|
551388
551301
|
init_growthbook();
|
|
551389
551302
|
init_overageCreditGrant();
|
|
551390
551303
|
init_referral();
|
|
551391
|
-
init_sponsoredTips();
|
|
551392
551304
|
init_tipHistory();
|
|
551393
551305
|
externalTips = [
|
|
551394
551306
|
{
|
|
@@ -551861,12 +551773,6 @@ function selectTipWithLongestTimeSinceShown(availableTips) {
|
|
|
551861
551773
|
tipsWithSessions.sort((a2, b) => b.sessions - a2.sessions);
|
|
551862
551774
|
return tipsWithSessions[0]?.tip;
|
|
551863
551775
|
}
|
|
551864
|
-
function isSponsoredSlotEligible() {
|
|
551865
|
-
const frequency = getSponsoredTipsFrequency();
|
|
551866
|
-
if (frequency === 0)
|
|
551867
|
-
return false;
|
|
551868
|
-
return getSessionsSinceLastSponsored() >= frequency;
|
|
551869
|
-
}
|
|
551870
551776
|
async function getTipToShowOnSpinner(context2) {
|
|
551871
551777
|
if (getSettings_DEPRECATED().spinnerTipsEnabled === false) {
|
|
551872
551778
|
return;
|
|
@@ -551875,20 +551781,10 @@ async function getTipToShowOnSpinner(context2) {
|
|
|
551875
551781
|
if (tips.length === 0) {
|
|
551876
551782
|
return;
|
|
551877
551783
|
}
|
|
551878
|
-
|
|
551879
|
-
const regular = tips.filter((t) => !t.sponsor);
|
|
551880
|
-
if (sponsored.length > 0 && isSponsoredSlotEligible()) {
|
|
551881
|
-
const pick3 = selectTipWithLongestTimeSinceShown(sponsored);
|
|
551882
|
-
if (pick3)
|
|
551883
|
-
return pick3;
|
|
551884
|
-
}
|
|
551885
|
-
return selectTipWithLongestTimeSinceShown(regular);
|
|
551784
|
+
return selectTipWithLongestTimeSinceShown(tips);
|
|
551886
551785
|
}
|
|
551887
551786
|
function recordShownTip(tip) {
|
|
551888
551787
|
recordTipShown(tip.id);
|
|
551889
|
-
if (tip.sponsor) {
|
|
551890
|
-
recordSponsoredTipShown();
|
|
551891
|
-
}
|
|
551892
551788
|
logEvent("tengu_tip_shown", {
|
|
551893
551789
|
tipIdLength: tip.id,
|
|
551894
551790
|
cooldownSessions: tip.cooldownSessions
|
|
@@ -551896,7 +551792,6 @@ function recordShownTip(tip) {
|
|
|
551896
551792
|
}
|
|
551897
551793
|
var init_tipScheduler = __esm(() => {
|
|
551898
551794
|
init_settings2();
|
|
551899
|
-
init_sponsoredTips();
|
|
551900
551795
|
init_tipHistory();
|
|
551901
551796
|
init_tipRegistry();
|
|
551902
551797
|
});
|
|
@@ -562065,7 +561960,7 @@ function WelcomeV2() {
|
|
|
562065
561960
|
dimColor: true,
|
|
562066
561961
|
children: [
|
|
562067
561962
|
"v",
|
|
562068
|
-
"0.9.
|
|
561963
|
+
"0.9.3",
|
|
562069
561964
|
" "
|
|
562070
561965
|
]
|
|
562071
561966
|
})
|
|
@@ -562252,7 +562147,7 @@ function WelcomeV2() {
|
|
|
562252
562147
|
dimColor: true,
|
|
562253
562148
|
children: [
|
|
562254
562149
|
"v",
|
|
562255
|
-
"0.9.
|
|
562150
|
+
"0.9.3",
|
|
562256
562151
|
" "
|
|
562257
562152
|
]
|
|
562258
562153
|
})
|
|
@@ -562468,7 +562363,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
562468
562363
|
dimColor: true,
|
|
562469
562364
|
children: [
|
|
562470
562365
|
"v",
|
|
562471
|
-
"0.9.
|
|
562366
|
+
"0.9.3",
|
|
562472
562367
|
" "
|
|
562473
562368
|
]
|
|
562474
562369
|
});
|
|
@@ -562677,7 +562572,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
562677
562572
|
dimColor: true,
|
|
562678
562573
|
children: [
|
|
562679
562574
|
"v",
|
|
562680
|
-
"0.9.
|
|
562575
|
+
"0.9.3",
|
|
562681
562576
|
" "
|
|
562682
562577
|
]
|
|
562683
562578
|
});
|
|
@@ -563677,7 +563572,7 @@ function TrustDialog(t0) {
|
|
|
563677
563572
|
if ($2[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
563678
563573
|
t16 = /* @__PURE__ */ jsx_runtime476.jsx(ThemedText, {
|
|
563679
563574
|
bold: true,
|
|
563680
|
-
children:
|
|
563575
|
+
children: getFsImplementation().cwd()
|
|
563681
563576
|
});
|
|
563682
563577
|
t17 = /* @__PURE__ */ jsx_runtime476.jsxs(ThemedText, {
|
|
563683
563578
|
children: [
|
|
@@ -568554,10 +568449,10 @@ function getLogWriter(path24) {
|
|
|
568554
568449
|
writer = createJsonlWriter({
|
|
568555
568450
|
writeFn: (content) => {
|
|
568556
568451
|
try {
|
|
568557
|
-
|
|
568452
|
+
getFsImplementation().appendFileSync(path24, content);
|
|
568558
568453
|
} catch {
|
|
568559
|
-
|
|
568560
|
-
|
|
568454
|
+
getFsImplementation().mkdirSync(dir);
|
|
568455
|
+
getFsImplementation().appendFileSync(path24, content);
|
|
568561
568456
|
}
|
|
568562
568457
|
},
|
|
568563
568458
|
flushIntervalMs: 1000,
|
|
@@ -568575,7 +568470,7 @@ function appendToLog(path24, message) {
|
|
|
568575
568470
|
const messageWithTimestamp = {
|
|
568576
568471
|
timestamp: new Date().toISOString(),
|
|
568577
568472
|
...message,
|
|
568578
|
-
cwd:
|
|
568473
|
+
cwd: getFsImplementation().cwd(),
|
|
568579
568474
|
userType: process.env.USER_TYPE,
|
|
568580
568475
|
sessionId: getSessionId(),
|
|
568581
568476
|
version: "99.0.0"
|
|
@@ -568624,7 +568519,7 @@ function logMCPErrorImpl(serverName, error42) {
|
|
|
568624
568519
|
error: errorStr,
|
|
568625
568520
|
timestamp: new Date().toISOString(),
|
|
568626
568521
|
sessionId: getSessionId(),
|
|
568627
|
-
cwd:
|
|
568522
|
+
cwd: getFsImplementation().cwd()
|
|
568628
568523
|
};
|
|
568629
568524
|
getLogWriter(logFile).write(errorInfo);
|
|
568630
568525
|
}
|
|
@@ -568635,7 +568530,7 @@ function logMCPDebugImpl(serverName, message) {
|
|
|
568635
568530
|
debug: message,
|
|
568636
568531
|
timestamp: new Date().toISOString(),
|
|
568637
568532
|
sessionId: getSessionId(),
|
|
568638
|
-
cwd:
|
|
568533
|
+
cwd: getFsImplementation().cwd()
|
|
568639
568534
|
};
|
|
568640
568535
|
getLogWriter(logFile).write(debugInfo);
|
|
568641
568536
|
}
|
|
@@ -568726,7 +568621,7 @@ function shouldExtractMemory(messages) {
|
|
|
568726
568621
|
return false;
|
|
568727
568622
|
}
|
|
568728
568623
|
async function setupSessionMemoryFile(toolUseContext) {
|
|
568729
|
-
const fs5 =
|
|
568624
|
+
const fs5 = getFsImplementation();
|
|
568730
568625
|
const sessionMemoryDir = getSessionMemoryDir();
|
|
568731
568626
|
await fs5.mkdir(sessionMemoryDir, { mode: 448 });
|
|
568732
568627
|
const memoryPath = getSessionMemoryPath();
|
|
@@ -573248,8 +573143,8 @@ async function installPluginsForHeadless() {
|
|
|
573248
573143
|
clearPluginCache("headlessPluginInstall: seed marketplaces registered");
|
|
573249
573144
|
}
|
|
573250
573145
|
if (zipCacheMode) {
|
|
573251
|
-
await
|
|
573252
|
-
await
|
|
573146
|
+
await getFsImplementation().mkdir(getZipCacheMarketplacesDir());
|
|
573147
|
+
await getFsImplementation().mkdir(getZipCachePluginsDir());
|
|
573253
573148
|
}
|
|
573254
573149
|
const declaredCount = Object.keys(getDeclaredMarketplaces()).length;
|
|
573255
573150
|
const metrics = {
|
|
@@ -580089,7 +579984,7 @@ __export(exports_update, {
|
|
|
580089
579984
|
async function update() {
|
|
580090
579985
|
if (getAPIProvider() !== "firstParty") {
|
|
580091
579986
|
writeToStdout(source_default.yellow(`Auto-update is not available for third-party provider builds.
|
|
580092
|
-
`) + `Current version: ${"0.9.
|
|
579987
|
+
`) + `Current version: ${"0.9.3"}
|
|
580093
579988
|
|
|
580094
579989
|
` + `To update, reinstall from npm:
|
|
580095
579990
|
` + source_default.bold(` npm install -g ${"@verboo/code"}@latest`) + `
|
|
@@ -580100,7 +579995,7 @@ async function update() {
|
|
|
580100
579995
|
await gracefulShutdown(0);
|
|
580101
579996
|
}
|
|
580102
579997
|
logEvent("tengu_update_check", {});
|
|
580103
|
-
writeToStdout(`Current version: ${"0.9.
|
|
579998
|
+
writeToStdout(`Current version: ${"0.9.3"}
|
|
580104
579999
|
`);
|
|
580105
580000
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
580106
580001
|
writeToStdout(`Checking for updates to ${channel2} version...
|
|
@@ -580185,8 +580080,8 @@ async function update() {
|
|
|
580185
580080
|
writeToStdout(`Verboo Code is managed by Homebrew.
|
|
580186
580081
|
`);
|
|
580187
580082
|
const latest = await getLatestVersion(channel2);
|
|
580188
|
-
if (latest && !gte("0.9.
|
|
580189
|
-
writeToStdout(`Update available: ${"0.9.
|
|
580083
|
+
if (latest && !gte("0.9.3", latest)) {
|
|
580084
|
+
writeToStdout(`Update available: ${"0.9.3"} → ${latest}
|
|
580190
580085
|
`);
|
|
580191
580086
|
writeToStdout(`
|
|
580192
580087
|
`);
|
|
@@ -580202,8 +580097,8 @@ async function update() {
|
|
|
580202
580097
|
writeToStdout(`Verboo Code is managed by winget.
|
|
580203
580098
|
`);
|
|
580204
580099
|
const latest = await getLatestVersion(channel2);
|
|
580205
|
-
if (latest && !gte("0.9.
|
|
580206
|
-
writeToStdout(`Update available: ${"0.9.
|
|
580100
|
+
if (latest && !gte("0.9.3", latest)) {
|
|
580101
|
+
writeToStdout(`Update available: ${"0.9.3"} → ${latest}
|
|
580207
580102
|
`);
|
|
580208
580103
|
writeToStdout(`
|
|
580209
580104
|
`);
|
|
@@ -580219,8 +580114,8 @@ async function update() {
|
|
|
580219
580114
|
writeToStdout(`Verboo Code is managed by apk.
|
|
580220
580115
|
`);
|
|
580221
580116
|
const latest = await getLatestVersion(channel2);
|
|
580222
|
-
if (latest && !gte("0.9.
|
|
580223
|
-
writeToStdout(`Update available: ${"0.9.
|
|
580117
|
+
if (latest && !gte("0.9.3", latest)) {
|
|
580118
|
+
writeToStdout(`Update available: ${"0.9.3"} → ${latest}
|
|
580224
580119
|
`);
|
|
580225
580120
|
writeToStdout(`
|
|
580226
580121
|
`);
|
|
@@ -580273,11 +580168,11 @@ async function update() {
|
|
|
580273
580168
|
`);
|
|
580274
580169
|
await gracefulShutdown(1);
|
|
580275
580170
|
}
|
|
580276
|
-
if (result.latestVersion === "0.9.
|
|
580277
|
-
writeToStdout(source_default.green(`Verboo Code is up to date (${"0.9.
|
|
580171
|
+
if (result.latestVersion === "0.9.3") {
|
|
580172
|
+
writeToStdout(source_default.green(`Verboo Code is up to date (${"0.9.3"})`) + `
|
|
580278
580173
|
`);
|
|
580279
580174
|
} else {
|
|
580280
|
-
writeToStdout(source_default.green(`Successfully updated from ${"0.9.
|
|
580175
|
+
writeToStdout(source_default.green(`Successfully updated from ${"0.9.3"} to version ${result.latestVersion}`) + `
|
|
580281
580176
|
`);
|
|
580282
580177
|
await regenerateCompletionCache();
|
|
580283
580178
|
}
|
|
@@ -580337,12 +580232,12 @@ async function update() {
|
|
|
580337
580232
|
`);
|
|
580338
580233
|
await gracefulShutdown(1);
|
|
580339
580234
|
}
|
|
580340
|
-
if (latestVersion === "0.9.
|
|
580341
|
-
writeToStdout(source_default.green(`Verboo Code is up to date (${"0.9.
|
|
580235
|
+
if (latestVersion === "0.9.3") {
|
|
580236
|
+
writeToStdout(source_default.green(`Verboo Code is up to date (${"0.9.3"})`) + `
|
|
580342
580237
|
`);
|
|
580343
580238
|
await gracefulShutdown(0);
|
|
580344
580239
|
}
|
|
580345
|
-
writeToStdout(`New version available: ${latestVersion} (current: ${"0.9.
|
|
580240
|
+
writeToStdout(`New version available: ${latestVersion} (current: ${"0.9.3"})
|
|
580346
580241
|
`);
|
|
580347
580242
|
writeToStdout(`Installing update...
|
|
580348
580243
|
`);
|
|
@@ -580387,7 +580282,7 @@ async function update() {
|
|
|
580387
580282
|
logForDebugging(`update: Installation status: ${status2}`);
|
|
580388
580283
|
switch (status2) {
|
|
580389
580284
|
case "success":
|
|
580390
|
-
writeToStdout(source_default.green(`Successfully updated from ${"0.9.
|
|
580285
|
+
writeToStdout(source_default.green(`Successfully updated from ${"0.9.3"} to version ${latestVersion}`) + `
|
|
580391
580286
|
`);
|
|
580392
580287
|
await regenerateCompletionCache();
|
|
580393
580288
|
break;
|
|
@@ -580603,7 +580498,7 @@ function loadSettingsFromFlag(settingsFile) {
|
|
|
580603
580498
|
} else {
|
|
580604
580499
|
const {
|
|
580605
580500
|
resolvedPath: resolvedSettingsPath
|
|
580606
|
-
} = safeResolvePath(
|
|
580501
|
+
} = safeResolvePath(getFsImplementation(), settingsFile);
|
|
580607
580502
|
try {
|
|
580608
580503
|
readFileSync16(resolvedSettingsPath, "utf8");
|
|
580609
580504
|
} catch (e2) {
|
|
@@ -581642,7 +581537,7 @@ ${customInstructions}` : customInstructions;
|
|
|
581642
581537
|
is_native_binary: isInBundledMode()
|
|
581643
581538
|
});
|
|
581644
581539
|
logMemoryDiagnostics("start", {
|
|
581645
|
-
version: "0.9.
|
|
581540
|
+
version: "0.9.3",
|
|
581646
581541
|
debug: debug2,
|
|
581647
581542
|
debugToStderr,
|
|
581648
581543
|
print: print ?? false,
|
|
@@ -582448,7 +582343,7 @@ Usage: verboo --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
582448
582343
|
pendingHookMessages
|
|
582449
582344
|
}, renderAndRun);
|
|
582450
582345
|
}
|
|
582451
|
-
}).version(`0.9.
|
|
582346
|
+
}).version(`0.9.3 (${cliDesc})`, "-v, --version", "Output the version number");
|
|
582452
582347
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
582453
582348
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
582454
582349
|
if (canUserConfigureAdvisor()) {
|
|
@@ -583022,7 +582917,7 @@ if (false) {}
|
|
|
583022
582917
|
async function main2() {
|
|
583023
582918
|
const args = process.argv.slice(2);
|
|
583024
582919
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
583025
|
-
console.log(`${"0.9.
|
|
582920
|
+
console.log(`${"0.9.3"} (Verboo Code)`);
|
|
583026
582921
|
return;
|
|
583027
582922
|
}
|
|
583028
582923
|
if (!IS_VERBOO_CLI && args.includes("--provider")) {
|
|
@@ -583196,4 +583091,4 @@ async function main2() {
|
|
|
583196
583091
|
}
|
|
583197
583092
|
main2();
|
|
583198
583093
|
|
|
583199
|
-
//# debugId=
|
|
583094
|
+
//# debugId=4E239C30BCC1FD5B64756E2164756E21
|