@verboo/code 0.9.3 → 0.9.4
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 +344 -273
- 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 = getFsImplementation2();
|
|
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 getFsImplementation2() {
|
|
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
|
+
getFsImplementation2().mkdirSync(dir);
|
|
17112
17112
|
} catch {}
|
|
17113
17113
|
}
|
|
17114
|
-
|
|
17114
|
+
getFsImplementation2().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(getFsImplementation2().cwd())),
|
|
17375
|
+
errors: () => join4(paths.cache, getProjectDir(getFsImplementation2().cwd()), "errors"),
|
|
17376
|
+
messages: () => join4(paths.cache, getProjectDir(getFsImplementation2().cwd()), "messages"),
|
|
17377
|
+
mcpLogs: (serverName) => join4(paths.cache, getProjectDir(getFsImplementation2().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 = getFsImplementation2().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 getFsImplementation2().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
|
+
getFsImplementation2().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
|
+
getFsImplementation2().unlinkSync(storagePath);
|
|
18488
18488
|
return true;
|
|
18489
18489
|
} catch (e) {
|
|
18490
18490
|
const code = getErrnoCode(e);
|
|
@@ -40502,7 +40502,6 @@ var init_env = __esm(() => {
|
|
|
40502
40502
|
init_combinedAbortSignal();
|
|
40503
40503
|
init_envUtils();
|
|
40504
40504
|
init_findExecutable();
|
|
40505
|
-
init_fsOperations();
|
|
40506
40505
|
init_which();
|
|
40507
40506
|
getGlobalClaudeFile = memoize_default(() => {
|
|
40508
40507
|
const oauthSuffix = fileSuffixForOauthConfig();
|
|
@@ -42146,7 +42145,7 @@ function logForDiagnosticsNoPII(level, event, data) {
|
|
|
42146
42145
|
event,
|
|
42147
42146
|
data: data ?? {}
|
|
42148
42147
|
};
|
|
42149
|
-
const fs2 =
|
|
42148
|
+
const fs2 = getFsImplementation2();
|
|
42150
42149
|
const line = jsonStringify(entry) + `
|
|
42151
42150
|
`;
|
|
42152
42151
|
try {
|
|
@@ -43210,7 +43209,7 @@ function isLocalHost(host) {
|
|
|
43210
43209
|
return hostWithoutPort === "localhost" || /^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(hostWithoutPort);
|
|
43211
43210
|
}
|
|
43212
43211
|
function isCurrentDirectoryBareGitRepo() {
|
|
43213
|
-
const fs2 =
|
|
43212
|
+
const fs2 = getFsImplementation2();
|
|
43214
43213
|
const cwd2 = getCwd();
|
|
43215
43214
|
const gitPath = join13(cwd2, ".git");
|
|
43216
43215
|
try {
|
|
@@ -43427,7 +43426,7 @@ var init_platform2 = __esm(() => {
|
|
|
43427
43426
|
}
|
|
43428
43427
|
if (process.platform === "linux") {
|
|
43429
43428
|
try {
|
|
43430
|
-
const procVersion =
|
|
43429
|
+
const procVersion = getFsImplementation2().readFileSync("/proc/version", { encoding: "utf8" });
|
|
43431
43430
|
if (procVersion.toLowerCase().includes("microsoft") || procVersion.toLowerCase().includes("wsl")) {
|
|
43432
43431
|
return "wsl";
|
|
43433
43432
|
}
|
|
@@ -43447,7 +43446,7 @@ var init_platform2 = __esm(() => {
|
|
|
43447
43446
|
return;
|
|
43448
43447
|
}
|
|
43449
43448
|
try {
|
|
43450
|
-
const procVersion =
|
|
43449
|
+
const procVersion = getFsImplementation2().readFileSync("/proc/version", {
|
|
43451
43450
|
encoding: "utf8"
|
|
43452
43451
|
});
|
|
43453
43452
|
const wslVersionMatch = procVersion.match(/WSL(\d+)/i);
|
|
@@ -44103,7 +44102,7 @@ var init_sessionStoragePortable = __esm(() => {
|
|
|
44103
44102
|
import { homedir as homedir6 } from "os";
|
|
44104
44103
|
import { dirname as dirname7, isAbsolute as isAbsolute2, join as join16, normalize, relative, resolve as resolve7 } from "path";
|
|
44105
44104
|
function expandPath(path10, baseDir) {
|
|
44106
|
-
const actualBaseDir = baseDir ?? getCwd() ??
|
|
44105
|
+
const actualBaseDir = baseDir ?? getCwd() ?? getFsImplementation2().cwd();
|
|
44107
44106
|
if (typeof path10 !== "string") {
|
|
44108
44107
|
throw new TypeError(`Path must be a string, received ${typeof path10}`);
|
|
44109
44108
|
}
|
|
@@ -44146,7 +44145,7 @@ function getDirectoryForPath(path10) {
|
|
|
44146
44145
|
return dirname7(absolutePath);
|
|
44147
44146
|
}
|
|
44148
44147
|
try {
|
|
44149
|
-
const stats =
|
|
44148
|
+
const stats = getFsImplementation2().statSync(absolutePath);
|
|
44150
44149
|
if (stats.isDirectory()) {
|
|
44151
44150
|
return absolutePath;
|
|
44152
44151
|
}
|
|
@@ -55908,7 +55907,7 @@ var init_v4 = __esm(() => {
|
|
|
55908
55907
|
|
|
55909
55908
|
// src/utils/fileRead.ts
|
|
55910
55909
|
function detectEncodingForResolvedPath(resolvedPath) {
|
|
55911
|
-
const { buffer, bytesRead } =
|
|
55910
|
+
const { buffer, bytesRead } = getFsImplementation2().readSync(resolvedPath, {
|
|
55912
55911
|
length: 4096
|
|
55913
55912
|
});
|
|
55914
55913
|
if (bytesRead === 0) {
|
|
@@ -55939,7 +55938,7 @@ function detectLineEndingsForString(content) {
|
|
|
55939
55938
|
return crlfCount > lfCount ? "CRLF" : "LF";
|
|
55940
55939
|
}
|
|
55941
55940
|
function readFileSyncWithMetadata(filePath) {
|
|
55942
|
-
const fs2 =
|
|
55941
|
+
const fs2 = getFsImplementation2();
|
|
55943
55942
|
const { resolvedPath, isSymlink } = safeResolvePath(fs2, filePath);
|
|
55944
55943
|
if (isSymlink) {
|
|
55945
55944
|
logForDebugging(`Reading through symlink: ${filePath} -> ${resolvedPath}`);
|
|
@@ -56043,7 +56042,7 @@ class FileReadCache {
|
|
|
56043
56042
|
sizeCalculation: (value) => Math.max(1, Buffer.byteLength(value.content))
|
|
56044
56043
|
});
|
|
56045
56044
|
readFile(filePath) {
|
|
56046
|
-
const fs2 =
|
|
56045
|
+
const fs2 = getFsImplementation2();
|
|
56047
56046
|
let stats;
|
|
56048
56047
|
try {
|
|
56049
56048
|
stats = fs2.statSync(filePath);
|
|
@@ -56117,7 +56116,7 @@ async function pathExists(path10) {
|
|
|
56117
56116
|
}
|
|
56118
56117
|
function readFileSafe(filepath) {
|
|
56119
56118
|
try {
|
|
56120
|
-
const fs2 =
|
|
56119
|
+
const fs2 = getFsImplementation2();
|
|
56121
56120
|
return fs2.readFileSync(filepath, { encoding: "utf8" });
|
|
56122
56121
|
} catch (error41) {
|
|
56123
56122
|
logError2(error41);
|
|
@@ -56125,11 +56124,11 @@ function readFileSafe(filepath) {
|
|
|
56125
56124
|
}
|
|
56126
56125
|
}
|
|
56127
56126
|
function getFileModificationTime(filePath) {
|
|
56128
|
-
const fs2 =
|
|
56127
|
+
const fs2 = getFsImplementation2();
|
|
56129
56128
|
return Math.floor(fs2.statSync(filePath).mtimeMs);
|
|
56130
56129
|
}
|
|
56131
56130
|
async function getFileModificationTimeAsync(filePath) {
|
|
56132
|
-
const s = await
|
|
56131
|
+
const s = await getFsImplementation2().stat(filePath);
|
|
56133
56132
|
return Math.floor(s.mtimeMs);
|
|
56134
56133
|
}
|
|
56135
56134
|
function writeTextContent(filePath, content, encoding, endings) {
|
|
@@ -56145,7 +56144,7 @@ function writeTextContent(filePath, content, encoding, endings) {
|
|
|
56145
56144
|
}
|
|
56146
56145
|
function detectFileEncoding(filePath) {
|
|
56147
56146
|
try {
|
|
56148
|
-
const fs2 =
|
|
56147
|
+
const fs2 = getFsImplementation2();
|
|
56149
56148
|
const { resolvedPath } = safeResolvePath(fs2, filePath);
|
|
56150
56149
|
return detectEncodingForResolvedPath(resolvedPath);
|
|
56151
56150
|
} catch (error41) {
|
|
@@ -56161,7 +56160,7 @@ function detectFileEncoding(filePath) {
|
|
|
56161
56160
|
}
|
|
56162
56161
|
function detectLineEndings(filePath, encoding = "utf8") {
|
|
56163
56162
|
try {
|
|
56164
|
-
const fs2 =
|
|
56163
|
+
const fs2 = getFsImplementation2();
|
|
56165
56164
|
const { resolvedPath } = safeResolvePath(fs2, filePath);
|
|
56166
56165
|
const { buffer, bytesRead } = fs2.readSync(resolvedPath, { length: 4096 });
|
|
56167
56166
|
const content = buffer.toString(encoding, 0, bytesRead);
|
|
@@ -56193,7 +56192,7 @@ function getDisplayPath(filePath) {
|
|
|
56193
56192
|
return filePath;
|
|
56194
56193
|
}
|
|
56195
56194
|
function findSimilarFile(filePath) {
|
|
56196
|
-
const fs2 =
|
|
56195
|
+
const fs2 = getFsImplementation2();
|
|
56197
56196
|
try {
|
|
56198
56197
|
const dir = dirname8(filePath);
|
|
56199
56198
|
const fileBaseName = basename3(filePath, extname(filePath));
|
|
@@ -56262,7 +56261,7 @@ function stripLineNumberPrefix(line) {
|
|
|
56262
56261
|
}
|
|
56263
56262
|
function isDirEmpty(dirPath) {
|
|
56264
56263
|
try {
|
|
56265
|
-
return
|
|
56264
|
+
return getFsImplementation2().isDirEmptySync(dirPath);
|
|
56266
56265
|
} catch (e) {
|
|
56267
56266
|
return isENOENT(e);
|
|
56268
56267
|
}
|
|
@@ -56272,7 +56271,7 @@ function readFileSyncCached(filePath) {
|
|
|
56272
56271
|
return content;
|
|
56273
56272
|
}
|
|
56274
56273
|
function writeFileSyncAndFlush_DEPRECATED(filePath, content, options = { encoding: "utf-8" }) {
|
|
56275
|
-
const fs2 =
|
|
56274
|
+
const fs2 = getFsImplementation2();
|
|
56276
56275
|
let targetPath = filePath;
|
|
56277
56276
|
try {
|
|
56278
56277
|
const linkTarget = fs2.readlinkSync(filePath);
|
|
@@ -56351,19 +56350,19 @@ function getDesktopPath() {
|
|
|
56351
56350
|
if (windowsHome) {
|
|
56352
56351
|
const wslPath = windowsHome.replace(/^[A-Z]:/, "");
|
|
56353
56352
|
const desktopPath2 = `/mnt/c${wslPath}/Desktop`;
|
|
56354
|
-
if (
|
|
56353
|
+
if (getFsImplementation2().existsSync(desktopPath2)) {
|
|
56355
56354
|
return desktopPath2;
|
|
56356
56355
|
}
|
|
56357
56356
|
}
|
|
56358
56357
|
try {
|
|
56359
56358
|
const usersDir = "/mnt/c/Users";
|
|
56360
|
-
const userDirs =
|
|
56359
|
+
const userDirs = getFsImplementation2().readdirSync(usersDir);
|
|
56361
56360
|
for (const user of userDirs) {
|
|
56362
56361
|
if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
|
|
56363
56362
|
continue;
|
|
56364
56363
|
}
|
|
56365
56364
|
const potentialDesktopPath = join18(usersDir, user.name, "Desktop");
|
|
56366
|
-
if (
|
|
56365
|
+
if (getFsImplementation2().existsSync(potentialDesktopPath)) {
|
|
56367
56366
|
return potentialDesktopPath;
|
|
56368
56367
|
}
|
|
56369
56368
|
}
|
|
@@ -56372,14 +56371,14 @@ function getDesktopPath() {
|
|
|
56372
56371
|
}
|
|
56373
56372
|
}
|
|
56374
56373
|
const desktopPath = join18(homeDir, "Desktop");
|
|
56375
|
-
if (
|
|
56374
|
+
if (getFsImplementation2().existsSync(desktopPath)) {
|
|
56376
56375
|
return desktopPath;
|
|
56377
56376
|
}
|
|
56378
56377
|
return homeDir;
|
|
56379
56378
|
}
|
|
56380
56379
|
function isFileWithinReadSizeLimit(filePath, maxSizeBytes = MAX_OUTPUT_SIZE) {
|
|
56381
56380
|
try {
|
|
56382
|
-
const stats =
|
|
56381
|
+
const stats = getFsImplementation2().statSync(filePath);
|
|
56383
56382
|
return stats.size <= maxSizeBytes;
|
|
56384
56383
|
} catch {
|
|
56385
56384
|
return false;
|
|
@@ -58674,7 +58673,7 @@ function profileReport() {
|
|
|
58674
58673
|
if (DETAILED_PROFILING) {
|
|
58675
58674
|
const path10 = getStartupPerfLogPath();
|
|
58676
58675
|
const dir = dirname10(path10);
|
|
58677
|
-
const fs2 =
|
|
58676
|
+
const fs2 = getFsImplementation2();
|
|
58678
58677
|
fs2.mkdirSync(dir);
|
|
58679
58678
|
writeFileSync_DEPRECATED(path10, getReport(), {
|
|
58680
58679
|
encoding: "utf8",
|
|
@@ -88460,7 +88459,7 @@ var init_caCerts = __esm(() => {
|
|
|
88460
88459
|
}
|
|
88461
88460
|
if (extraCertsPath) {
|
|
88462
88461
|
try {
|
|
88463
|
-
const extraCert =
|
|
88462
|
+
const extraCert = getFsImplementation2().readFileSync(extraCertsPath, {
|
|
88464
88463
|
encoding: "utf8"
|
|
88465
88464
|
});
|
|
88466
88465
|
certs.push(extraCert);
|
|
@@ -110873,7 +110872,7 @@ var init_mtls = __esm(() => {
|
|
|
110873
110872
|
const config2 = {};
|
|
110874
110873
|
if (process.env.CLAUDE_CODE_CLIENT_CERT) {
|
|
110875
110874
|
try {
|
|
110876
|
-
config2.cert =
|
|
110875
|
+
config2.cert = getFsImplementation2().readFileSync(process.env.CLAUDE_CODE_CLIENT_CERT, { encoding: "utf8" });
|
|
110877
110876
|
logForDebugging("mTLS: Loaded client certificate from CLAUDE_CODE_CLIENT_CERT");
|
|
110878
110877
|
} catch (error41) {
|
|
110879
110878
|
logForDebugging(`mTLS: Failed to load client certificate: ${error41}`, {
|
|
@@ -110883,7 +110882,7 @@ var init_mtls = __esm(() => {
|
|
|
110883
110882
|
}
|
|
110884
110883
|
if (process.env.CLAUDE_CODE_CLIENT_KEY) {
|
|
110885
110884
|
try {
|
|
110886
|
-
config2.key =
|
|
110885
|
+
config2.key = getFsImplementation2().readFileSync(process.env.CLAUDE_CODE_CLIENT_KEY, { encoding: "utf8" });
|
|
110887
110886
|
logForDebugging("mTLS: Loaded client key from CLAUDE_CODE_CLIENT_KEY");
|
|
110888
110887
|
} catch (error41) {
|
|
110889
110888
|
logForDebugging(`mTLS: Failed to load client key: ${error41}`, {
|
|
@@ -138075,7 +138074,7 @@ function maybePersistTokenForSubprocesses(path10, token, tokenName) {
|
|
|
138075
138074
|
}
|
|
138076
138075
|
function readTokenFromWellKnownFile(path10, tokenName) {
|
|
138077
138076
|
try {
|
|
138078
|
-
const fsOps =
|
|
138077
|
+
const fsOps = getFsImplementation2();
|
|
138079
138078
|
const token = fsOps.readFileSync(path10, { encoding: "utf8" }).trim();
|
|
138080
138079
|
if (!token) {
|
|
138081
138080
|
return null;
|
|
@@ -138113,7 +138112,7 @@ function getCredentialFromFd({
|
|
|
138113
138112
|
return null;
|
|
138114
138113
|
}
|
|
138115
138114
|
try {
|
|
138116
|
-
const fsOps =
|
|
138115
|
+
const fsOps = getFsImplementation2();
|
|
138117
138116
|
const fdPath = process.platform === "darwin" || process.platform === "freebsd" ? `/dev/fd/${fd}` : `/proc/self/fd/${fd}`;
|
|
138118
138117
|
const token = fsOps.readFileSync(fdPath, { encoding: "utf8" }).trim();
|
|
138119
138118
|
if (!token) {
|
|
@@ -153632,7 +153631,7 @@ function isPathAllowed(resolvedPath, context, operationType, precomputedPathsToC
|
|
|
153632
153631
|
function validateGlobPattern(cleanPath, cwd2, toolPermissionContext, operationType) {
|
|
153633
153632
|
if (containsPathTraversal(cleanPath)) {
|
|
153634
153633
|
const absolutePath = isAbsolute5(cleanPath) ? cleanPath : resolve15(cwd2, cleanPath);
|
|
153635
|
-
const { resolvedPath: resolvedPath2, isCanonical: isCanonical2 } = safeResolvePath(
|
|
153634
|
+
const { resolvedPath: resolvedPath2, isCanonical: isCanonical2 } = safeResolvePath(getFsImplementation2(), absolutePath);
|
|
153636
153635
|
const result2 = isPathAllowed(resolvedPath2, toolPermissionContext, operationType, isCanonical2 ? [resolvedPath2] : undefined);
|
|
153637
153636
|
return {
|
|
153638
153637
|
allowed: result2.allowed,
|
|
@@ -153642,7 +153641,7 @@ function validateGlobPattern(cleanPath, cwd2, toolPermissionContext, operationTy
|
|
|
153642
153641
|
}
|
|
153643
153642
|
const basePath = getGlobBaseDirectory(cleanPath);
|
|
153644
153643
|
const absoluteBasePath = isAbsolute5(basePath) ? basePath : resolve15(cwd2, basePath);
|
|
153645
|
-
const { resolvedPath, isCanonical } = safeResolvePath(
|
|
153644
|
+
const { resolvedPath, isCanonical } = safeResolvePath(getFsImplementation2(), absoluteBasePath);
|
|
153646
153645
|
const result = isPathAllowed(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
|
|
153647
153646
|
return {
|
|
153648
153647
|
allowed: result.allowed,
|
|
@@ -153721,7 +153720,7 @@ function validatePath(path11, cwd2, toolPermissionContext, operationType) {
|
|
|
153721
153720
|
return validateGlobPattern(cleanPath, cwd2, toolPermissionContext, operationType);
|
|
153722
153721
|
}
|
|
153723
153722
|
const absolutePath = isAbsolute5(cleanPath) ? cleanPath : resolve15(cwd2, cleanPath);
|
|
153724
|
-
const { resolvedPath, isCanonical } = safeResolvePath(
|
|
153723
|
+
const { resolvedPath, isCanonical } = safeResolvePath(getFsImplementation2(), absolutePath);
|
|
153725
153724
|
const result = isPathAllowed(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
|
|
153726
153725
|
return {
|
|
153727
153726
|
allowed: result.allowed,
|
|
@@ -156934,7 +156933,7 @@ async function generateMcpConfig(manifest, extractedPath, userConfig = {}) {
|
|
|
156934
156933
|
return mcpConfig;
|
|
156935
156934
|
}
|
|
156936
156935
|
async function loadCacheMetadata(cacheDir, source) {
|
|
156937
|
-
const fs2 =
|
|
156936
|
+
const fs2 = getFsImplementation2();
|
|
156938
156937
|
const metadataPath = getMetadataPath(cacheDir, source);
|
|
156939
156938
|
try {
|
|
156940
156939
|
const content = await fs2.readFile(metadataPath, { encoding: "utf-8" });
|
|
@@ -156953,7 +156952,7 @@ async function loadCacheMetadata(cacheDir, source) {
|
|
|
156953
156952
|
}
|
|
156954
156953
|
async function saveCacheMetadata(cacheDir, source, metadata) {
|
|
156955
156954
|
const metadataPath = getMetadataPath(cacheDir, source);
|
|
156956
|
-
await
|
|
156955
|
+
await getFsImplementation2().mkdir(cacheDir);
|
|
156957
156956
|
await writeFile3(metadataPath, jsonStringify(metadata, null, 2), "utf-8");
|
|
156958
156957
|
}
|
|
156959
156958
|
async function downloadMcpb(url3, destPath, onProgress) {
|
|
@@ -156998,7 +156997,7 @@ async function extractMcpbContents(unzipped, extractPath, modes, onProgress) {
|
|
|
156998
156997
|
if (onProgress) {
|
|
156999
156998
|
onProgress("Extracting files...");
|
|
157000
156999
|
}
|
|
157001
|
-
await
|
|
157000
|
+
await getFsImplementation2().mkdir(extractPath);
|
|
157002
157001
|
let filesWritten = 0;
|
|
157003
157002
|
const entries = Object.entries(unzipped).filter(([k]) => !k.endsWith("/"));
|
|
157004
157003
|
const totalFiles = entries.length;
|
|
@@ -157006,7 +157005,7 @@ async function extractMcpbContents(unzipped, extractPath, modes, onProgress) {
|
|
|
157006
157005
|
const fullPath = join31(extractPath, filePath);
|
|
157007
157006
|
const dir = dirname17(fullPath);
|
|
157008
157007
|
if (dir !== extractPath) {
|
|
157009
|
-
await
|
|
157008
|
+
await getFsImplementation2().mkdir(dir);
|
|
157010
157009
|
}
|
|
157011
157010
|
const isTextFile = filePath.endsWith(".json") || filePath.endsWith(".js") || filePath.endsWith(".ts") || filePath.endsWith(".txt") || filePath.endsWith(".md") || filePath.endsWith(".yml") || filePath.endsWith(".yaml");
|
|
157012
157011
|
if (isTextFile) {
|
|
@@ -157030,7 +157029,7 @@ async function extractMcpbContents(unzipped, extractPath, modes, onProgress) {
|
|
|
157030
157029
|
}
|
|
157031
157030
|
}
|
|
157032
157031
|
async function checkMcpbChanged(source, pluginPath) {
|
|
157033
|
-
const fs2 =
|
|
157032
|
+
const fs2 = getFsImplementation2();
|
|
157034
157033
|
const cacheDir = getMcpbCacheDir(pluginPath);
|
|
157035
157034
|
const metadata = await loadCacheMetadata(cacheDir, source);
|
|
157036
157035
|
if (!metadata) {
|
|
@@ -157071,7 +157070,7 @@ async function checkMcpbChanged(source, pluginPath) {
|
|
|
157071
157070
|
return false;
|
|
157072
157071
|
}
|
|
157073
157072
|
async function loadMcpbFile(source, pluginPath, pluginId, onProgress, providedUserConfig, forceConfigDialog) {
|
|
157074
|
-
const fs2 =
|
|
157073
|
+
const fs2 = getFsImplementation2();
|
|
157075
157074
|
const cacheDir = getMcpbCacheDir(pluginPath);
|
|
157076
157075
|
await fs2.mkdir(cacheDir);
|
|
157077
157076
|
logForDebugging(`Loading MCPB from source: ${source}`);
|
|
@@ -157417,7 +157416,7 @@ var init_pluginOptionsStorage = __esm(() => {
|
|
|
157417
157416
|
// src/utils/plugins/walkPluginMarkdown.ts
|
|
157418
157417
|
import { join as join32 } from "path";
|
|
157419
157418
|
async function walkPluginMarkdown(rootDir, onFile, opts = {}) {
|
|
157420
|
-
const fs2 =
|
|
157419
|
+
const fs2 = getFsImplementation2();
|
|
157421
157420
|
const label = opts.logLabel ?? "plugin";
|
|
157422
157421
|
async function scan(dirPath, namespace) {
|
|
157423
157422
|
try {
|
|
@@ -157461,7 +157460,7 @@ async function loadAgentsFromDirectory(agentsPath, pluginName, sourceName, plugi
|
|
|
157461
157460
|
return agents;
|
|
157462
157461
|
}
|
|
157463
157462
|
async function loadAgentFromFile(filePath, pluginName, namespace, sourceName, pluginPath, pluginManifest, loadedPaths) {
|
|
157464
|
-
const fs2 =
|
|
157463
|
+
const fs2 = getFsImplementation2();
|
|
157465
157464
|
if (isDuplicatePath(fs2, filePath, loadedPaths)) {
|
|
157466
157465
|
return null;
|
|
157467
157466
|
}
|
|
@@ -157603,7 +157602,7 @@ var init_loadPluginAgents = __esm(() => {
|
|
|
157603
157602
|
if (plugin.agentsPaths) {
|
|
157604
157603
|
const pathResults = await Promise.all(plugin.agentsPaths.map(async (agentPath) => {
|
|
157605
157604
|
try {
|
|
157606
|
-
const fs2 =
|
|
157605
|
+
const fs2 = getFsImplementation2();
|
|
157607
157606
|
const stats = await fs2.stat(agentPath);
|
|
157608
157607
|
if (stats.isDirectory()) {
|
|
157609
157608
|
const agents = await loadAgentsFromDirectory(agentPath, plugin.name, plugin.source, plugin.path, plugin.manifest, loadedPaths);
|
|
@@ -164726,7 +164725,7 @@ function handleMemoryFileReadError(error41, filePath) {
|
|
|
164726
164725
|
}
|
|
164727
164726
|
async function safelyReadMemoryFileAsync(filePath, type, includeBasePath) {
|
|
164728
164727
|
try {
|
|
164729
|
-
const fs2 =
|
|
164728
|
+
const fs2 = getFsImplementation2();
|
|
164730
164729
|
const rawContent = await fs2.readFile(filePath, { encoding: "utf-8" });
|
|
164731
164730
|
return parseMemoryFileContent(rawContent, filePath, type, includeBasePath);
|
|
164732
164731
|
} catch (error41) {
|
|
@@ -164806,7 +164805,7 @@ function isClaudeMdExcluded(filePath, type) {
|
|
|
164806
164805
|
return import_picomatch.default.isMatch(normalizedPath, expandedPatterns, matchOpts);
|
|
164807
164806
|
}
|
|
164808
164807
|
function resolveExcludePatterns(patterns) {
|
|
164809
|
-
const fs2 =
|
|
164808
|
+
const fs2 = getFsImplementation2();
|
|
164810
164809
|
const expanded = patterns.map((p) => p.replaceAll("\\", "/"));
|
|
164811
164810
|
for (const normalized of expanded) {
|
|
164812
164811
|
if (!normalized.startsWith("/")) {
|
|
@@ -164833,7 +164832,7 @@ async function processMemoryFile(filePath, type, processedPaths, includeExternal
|
|
|
164833
164832
|
if (isClaudeMdExcluded(filePath, type)) {
|
|
164834
164833
|
return [];
|
|
164835
164834
|
}
|
|
164836
|
-
const { resolvedPath, isSymlink } = safeResolvePath(
|
|
164835
|
+
const { resolvedPath, isSymlink } = safeResolvePath(getFsImplementation2(), filePath);
|
|
164837
164836
|
processedPaths.add(normalizedPath);
|
|
164838
164837
|
if (isSymlink) {
|
|
164839
164838
|
processedPaths.add(normalizePathForComparison(resolvedPath));
|
|
@@ -164869,7 +164868,7 @@ async function processMdRules({
|
|
|
164869
164868
|
return [];
|
|
164870
164869
|
}
|
|
164871
164870
|
try {
|
|
164872
|
-
const fs2 =
|
|
164871
|
+
const fs2 = getFsImplementation2();
|
|
164873
164872
|
const { resolvedPath: resolvedRulesDir, isSymlink } = safeResolvePath(fs2, rulesDir);
|
|
164874
164873
|
visitedDirs.add(rulesDir);
|
|
164875
164874
|
if (isSymlink) {
|
|
@@ -164958,7 +164957,7 @@ async function getManagedAndUserConditionalRules(targetPath, processedPaths) {
|
|
|
164958
164957
|
async function getMemoryFilesForNestedDirectory(dir, targetPath, processedPaths) {
|
|
164959
164958
|
const result = [];
|
|
164960
164959
|
if (isSettingSourceEnabled("projectSettings")) {
|
|
164961
|
-
const projectPath = getProjectInstructionFilePath(dir,
|
|
164960
|
+
const projectPath = getProjectInstructionFilePath(dir, getFsImplementation2().existsSync);
|
|
164962
164961
|
result.push(...await processMemoryFile(projectPath, "Project", processedPaths, false));
|
|
164963
164962
|
const dotClaudePath = join36(dir, ".claude", "CLAUDE.md");
|
|
164964
164963
|
result.push(...await processMemoryFile(dotClaudePath, "Project", processedPaths, false));
|
|
@@ -165259,7 +165258,7 @@ var init_claudemd = __esm(() => {
|
|
|
165259
165258
|
for (const dir of dirs.reverse()) {
|
|
165260
165259
|
const skipProject = isNestedWorktree && pathInWorkingPath(dir, canonicalRoot) && !pathInWorkingPath(dir, gitRoot);
|
|
165261
165260
|
if (isSettingSourceEnabled("projectSettings") && !skipProject) {
|
|
165262
|
-
const projectPath = getProjectInstructionFilePath(dir,
|
|
165261
|
+
const projectPath = getProjectInstructionFilePath(dir, getFsImplementation2().existsSync);
|
|
165263
165262
|
result.push(...await processMemoryFile(projectPath, "Project", processedPaths, includeExternal));
|
|
165264
165263
|
const dotClaudePath = join36(dir, ".claude", "CLAUDE.md");
|
|
165265
165264
|
result.push(...await processMemoryFile(dotClaudePath, "Project", processedPaths, includeExternal));
|
|
@@ -165280,7 +165279,7 @@ var init_claudemd = __esm(() => {
|
|
|
165280
165279
|
if (isEnvTruthy(process.env.CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD)) {
|
|
165281
165280
|
const additionalDirs = getAdditionalDirectoriesForClaudeMd();
|
|
165282
165281
|
for (const dir of additionalDirs) {
|
|
165283
|
-
const projectPath = getProjectInstructionFilePath(dir,
|
|
165282
|
+
const projectPath = getProjectInstructionFilePath(dir, getFsImplementation2().existsSync);
|
|
165284
165283
|
result.push(...await processMemoryFile(projectPath, "Project", processedPaths, includeExternal));
|
|
165285
165284
|
const dotClaudePath = join36(dir, ".claude", "CLAUDE.md");
|
|
165286
165285
|
result.push(...await processMemoryFile(dotClaudePath, "Project", processedPaths, includeExternal));
|
|
@@ -165976,7 +165975,7 @@ async function waitForSessionMemoryExtraction() {
|
|
|
165976
165975
|
}
|
|
165977
165976
|
}
|
|
165978
165977
|
async function getSessionMemoryContent() {
|
|
165979
|
-
const fs2 =
|
|
165978
|
+
const fs2 = getFsImplementation2();
|
|
165980
165979
|
const memoryPath = getSessionMemoryPath();
|
|
165981
165980
|
try {
|
|
165982
165981
|
const content = await fs2.readFile(memoryPath, { encoding: "utf-8" });
|
|
@@ -170638,7 +170637,7 @@ function getSettingsForSourceLenient_FOR_EDITING_ONLY_NOT_FOR_READING(source) {
|
|
|
170638
170637
|
return null;
|
|
170639
170638
|
}
|
|
170640
170639
|
try {
|
|
170641
|
-
const { resolvedPath } = safeResolvePath(
|
|
170640
|
+
const { resolvedPath } = safeResolvePath(getFsImplementation2(), filePath);
|
|
170642
170641
|
const content = readFileSync7(resolvedPath);
|
|
170643
170642
|
if (content.trim() === "") {
|
|
170644
170643
|
return {};
|
|
@@ -174112,6 +174111,7 @@ function getStreamStats(state) {
|
|
|
174112
174111
|
// src/services/api/openaiShim.ts
|
|
174113
174112
|
var exports_openaiShim = {};
|
|
174114
174113
|
__export(exports_openaiShim, {
|
|
174114
|
+
setOpenAIShimRouterStatusHandler: () => setOpenAIShimRouterStatusHandler,
|
|
174115
174115
|
createOpenAIShimClient: () => createOpenAIShimClient
|
|
174116
174116
|
});
|
|
174117
174117
|
import { randomUUID as randomUUID4 } from "crypto";
|
|
@@ -174581,6 +174581,9 @@ function repairPossiblyTruncatedObjectJson(raw) {
|
|
|
174581
174581
|
return null;
|
|
174582
174582
|
}
|
|
174583
174583
|
}
|
|
174584
|
+
function setOpenAIShimRouterStatusHandler(fn) {
|
|
174585
|
+
routerStatusHandler = fn;
|
|
174586
|
+
}
|
|
174584
174587
|
async function* openaiStreamToAnthropic(response, model2, signal) {
|
|
174585
174588
|
const messageId = makeMessageId2();
|
|
174586
174589
|
let contentBlockIndex = 0;
|
|
@@ -174592,6 +174595,7 @@ async function* openaiStreamToAnthropic(response, model2, signal) {
|
|
|
174592
174595
|
let lastStopReason = null;
|
|
174593
174596
|
let hasEmittedFinalUsage = false;
|
|
174594
174597
|
let hasProcessedFinishReason = false;
|
|
174598
|
+
let routerWarmingActive = false;
|
|
174595
174599
|
const streamState = createStreamState();
|
|
174596
174600
|
yield {
|
|
174597
174601
|
type: "message_start",
|
|
@@ -174702,6 +174706,14 @@ async function* openaiStreamToAnthropic(response, model2, signal) {
|
|
|
174702
174706
|
} catch {
|
|
174703
174707
|
continue;
|
|
174704
174708
|
}
|
|
174709
|
+
const routerStatus = chunk.router_status;
|
|
174710
|
+
if (typeof routerStatus === "string") {
|
|
174711
|
+
if (routerStatus === "warming" && !routerWarmingActive) {
|
|
174712
|
+
routerWarmingActive = true;
|
|
174713
|
+
routerStatusHandler?.("warming-up");
|
|
174714
|
+
}
|
|
174715
|
+
continue;
|
|
174716
|
+
}
|
|
174705
174717
|
const inStreamError = chunk.error;
|
|
174706
174718
|
if (inStreamError && typeof inStreamError === "object") {
|
|
174707
174719
|
const message = typeof inStreamError.message === "string" ? inStreamError.message : "Provider returned an in-stream error";
|
|
@@ -174715,6 +174727,10 @@ async function* openaiStreamToAnthropic(response, model2, signal) {
|
|
|
174715
174727
|
throw APIError.generate(response.status ?? 200, errorPayload, message, response.headers);
|
|
174716
174728
|
}
|
|
174717
174729
|
const chunkUsage = convertChunkUsage(chunk.usage);
|
|
174730
|
+
if (routerWarmingActive && Array.isArray(chunk.choices) && chunk.choices.length > 0) {
|
|
174731
|
+
routerWarmingActive = false;
|
|
174732
|
+
routerStatusHandler?.(null);
|
|
174733
|
+
}
|
|
174718
174734
|
for (const choice of chunk.choices ?? []) {
|
|
174719
174735
|
const delta = choice.delta;
|
|
174720
174736
|
if (delta.reasoning_content != null && delta.reasoning_content !== "") {
|
|
@@ -175505,7 +175521,7 @@ function createOpenAIShimClient(options2) {
|
|
|
175505
175521
|
messages: beta.messages
|
|
175506
175522
|
};
|
|
175507
175523
|
}
|
|
175508
|
-
var GITHUB_429_MAX_RETRIES = 3, GITHUB_429_BASE_DELAY_SEC = 1, GITHUB_429_MAX_DELAY_SEC = 32, GEMINI_API_HOST = "generativelanguage.googleapis.com", COPILOT_HEADERS2, JSON_REPAIR_SUFFIXES, OpenAIShimStream;
|
|
175524
|
+
var GITHUB_429_MAX_RETRIES = 3, GITHUB_429_BASE_DELAY_SEC = 1, GITHUB_429_MAX_DELAY_SEC = 32, GEMINI_API_HOST = "generativelanguage.googleapis.com", COPILOT_HEADERS2, JSON_REPAIR_SUFFIXES, routerStatusHandler = null, OpenAIShimStream;
|
|
175509
175525
|
var init_openaiShim = __esm(() => {
|
|
175510
175526
|
init_sdk();
|
|
175511
175527
|
init_codexCredentials();
|
|
@@ -196259,7 +196275,7 @@ function getCronFilePath(dir) {
|
|
|
196259
196275
|
return join40(dir ?? getProjectRoot(), CRON_FILE_REL);
|
|
196260
196276
|
}
|
|
196261
196277
|
async function readCronTasks(dir) {
|
|
196262
|
-
const fs2 =
|
|
196278
|
+
const fs2 = getFsImplementation2();
|
|
196263
196279
|
let raw;
|
|
196264
196280
|
try {
|
|
196265
196281
|
raw = await fs2.readFile(getCronFilePath(dir), { encoding: "utf-8" });
|
|
@@ -212141,7 +212157,7 @@ async function loadPluginMcpServers(plugin, errors4 = []) {
|
|
|
212141
212157
|
return Object.keys(servers).length > 0 ? servers : undefined;
|
|
212142
212158
|
}
|
|
212143
212159
|
async function loadMcpServersFromFile(pluginPath, relativePath) {
|
|
212144
|
-
const fs2 =
|
|
212160
|
+
const fs2 = getFsImplementation2();
|
|
212145
212161
|
const filePath = join43(pluginPath, relativePath);
|
|
212146
212162
|
let content;
|
|
212147
212163
|
try {
|
|
@@ -213213,7 +213229,7 @@ function parseMcpConfig(params) {
|
|
|
213213
213229
|
}
|
|
213214
213230
|
function parseMcpConfigFromFilePath(params) {
|
|
213215
213231
|
const { filePath, expandVars, scope } = params;
|
|
213216
|
-
const fs2 =
|
|
213232
|
+
const fs2 = getFsImplementation2();
|
|
213217
213233
|
let configContent;
|
|
213218
213234
|
try {
|
|
213219
213235
|
configContent = fs2.readFileSync(filePath, { encoding: "utf8" });
|
|
@@ -216340,7 +216356,7 @@ function buildCommonPluginDirectoryPaths(ideName) {
|
|
|
216340
216356
|
}
|
|
216341
216357
|
async function detectPluginDirectories(ideName) {
|
|
216342
216358
|
const foundDirectories = [];
|
|
216343
|
-
const fs2 =
|
|
216359
|
+
const fs2 = getFsImplementation2();
|
|
216344
216360
|
const pluginDirPaths = buildCommonPluginDirectoryPaths(ideName);
|
|
216345
216361
|
const idePatterns = ideNameToDirMap[ideName.toLowerCase()];
|
|
216346
216362
|
if (!idePatterns) {
|
|
@@ -216379,7 +216395,7 @@ async function isJetBrainsPluginInstalled(ideType) {
|
|
|
216379
216395
|
for (const dir of pluginDirs) {
|
|
216380
216396
|
const pluginPath = join48(dir, PLUGIN_PREFIX);
|
|
216381
216397
|
try {
|
|
216382
|
-
await
|
|
216398
|
+
await getFsImplementation2().stat(pluginPath);
|
|
216383
216399
|
return true;
|
|
216384
216400
|
} catch {}
|
|
216385
216401
|
}
|
|
@@ -217473,12 +217489,12 @@ async function getSortedIdeLockfiles() {
|
|
|
217473
217489
|
const ideLockFilePaths = await getIdeLockfilesPaths();
|
|
217474
217490
|
const allLockfiles = await Promise.all(ideLockFilePaths.map(async (ideLockFilePath) => {
|
|
217475
217491
|
try {
|
|
217476
|
-
const entries = await
|
|
217492
|
+
const entries = await getFsImplementation2().readdir(ideLockFilePath);
|
|
217477
217493
|
const lockEntries = entries.filter((file2) => file2.name.endsWith(".lock"));
|
|
217478
217494
|
const stats = await Promise.all(lockEntries.map(async (file2) => {
|
|
217479
217495
|
const fullPath = join49(ideLockFilePath, file2.name);
|
|
217480
217496
|
try {
|
|
217481
|
-
const fileStat = await
|
|
217497
|
+
const fileStat = await getFsImplementation2().stat(fullPath);
|
|
217482
217498
|
return { path: fullPath, mtime: fileStat.mtime };
|
|
217483
217499
|
} catch {
|
|
217484
217500
|
return null;
|
|
@@ -217500,7 +217516,7 @@ async function getSortedIdeLockfiles() {
|
|
|
217500
217516
|
}
|
|
217501
217517
|
async function readIdeLockfile(path12) {
|
|
217502
217518
|
try {
|
|
217503
|
-
const content = await
|
|
217519
|
+
const content = await getFsImplementation2().readFile(path12, {
|
|
217504
217520
|
encoding: "utf-8"
|
|
217505
217521
|
});
|
|
217506
217522
|
let workspaceFolders = [];
|
|
@@ -217578,7 +217594,7 @@ async function getIdeLockfilesPaths() {
|
|
|
217578
217594
|
}
|
|
217579
217595
|
try {
|
|
217580
217596
|
const usersDir = "/mnt/c/Users";
|
|
217581
|
-
const userDirs = await
|
|
217597
|
+
const userDirs = await getFsImplementation2().readdir(usersDir);
|
|
217582
217598
|
for (const user of userDirs) {
|
|
217583
217599
|
if (!user.isDirectory() && !user.isSymbolicLink()) {
|
|
217584
217600
|
continue;
|
|
@@ -217604,7 +217620,7 @@ async function cleanupStaleIdeLockfiles() {
|
|
|
217604
217620
|
const lockfileInfo = await readIdeLockfile(lockfilePath);
|
|
217605
217621
|
if (!lockfileInfo) {
|
|
217606
217622
|
try {
|
|
217607
|
-
await
|
|
217623
|
+
await getFsImplementation2().unlink(lockfilePath);
|
|
217608
217624
|
} catch (error42) {
|
|
217609
217625
|
logError2(error42);
|
|
217610
217626
|
}
|
|
@@ -217631,7 +217647,7 @@ async function cleanupStaleIdeLockfiles() {
|
|
|
217631
217647
|
}
|
|
217632
217648
|
if (shouldDelete) {
|
|
217633
217649
|
try {
|
|
217634
|
-
await
|
|
217650
|
+
await getFsImplementation2().unlink(lockfilePath);
|
|
217635
217651
|
} catch (error42) {
|
|
217636
217652
|
logError2(error42);
|
|
217637
217653
|
}
|
|
@@ -217901,7 +217917,7 @@ async function getVSCodeIDECommand(ideType) {
|
|
|
217901
217917
|
const parentExecutable = getVSCodeIDECommandByParentProcess();
|
|
217902
217918
|
if (parentExecutable) {
|
|
217903
217919
|
try {
|
|
217904
|
-
await
|
|
217920
|
+
await getFsImplementation2().stat(parentExecutable);
|
|
217905
217921
|
return parentExecutable;
|
|
217906
217922
|
} catch {}
|
|
217907
217923
|
}
|
|
@@ -218077,7 +218093,7 @@ async function installFromArtifactory(command) {
|
|
|
218077
218093
|
const npmrcAuthPrefix = `//${artifactoryBaseUrl.replace(/^https?:\/\//, "")}/api/npm/npm-all/:_authToken=`;
|
|
218078
218094
|
const npmrcPath = join49(os3.homedir(), ".npmrc");
|
|
218079
218095
|
let authToken = null;
|
|
218080
|
-
const fs2 =
|
|
218096
|
+
const fs2 = getFsImplementation2();
|
|
218081
218097
|
try {
|
|
218082
218098
|
const npmrcContent = await fs2.readFile(npmrcPath, {
|
|
218083
218099
|
encoding: "utf8"
|
|
@@ -218117,7 +218133,7 @@ async function installFromArtifactory(command) {
|
|
|
218117
218133
|
},
|
|
218118
218134
|
responseType: "stream"
|
|
218119
218135
|
});
|
|
218120
|
-
const writeStream =
|
|
218136
|
+
const writeStream = getFsImplementation2().createWriteStream(tempVsixPath);
|
|
218121
218137
|
await new Promise((resolve19, reject2) => {
|
|
218122
218138
|
vsixResponse.data.pipe(writeStream);
|
|
218123
218139
|
writeStream.on("finish", resolve19);
|
|
@@ -218565,7 +218581,7 @@ function getTokenFromFileDescriptor() {
|
|
|
218565
218581
|
return null;
|
|
218566
218582
|
}
|
|
218567
218583
|
try {
|
|
218568
|
-
const fsOps =
|
|
218584
|
+
const fsOps = getFsImplementation2();
|
|
218569
218585
|
const fdPath = process.platform === "darwin" || process.platform === "freebsd" ? `/dev/fd/${fd2}` : `/proc/self/fd/${fd2}`;
|
|
218570
218586
|
const token = fsOps.readFileSync(fdPath, { encoding: "utf8" }).trim();
|
|
218571
218587
|
if (!token) {
|
|
@@ -270838,7 +270854,7 @@ async function getImageFromClipboard() {
|
|
|
270838
270854
|
if (saveResult.exitCode !== 0) {
|
|
270839
270855
|
return null;
|
|
270840
270856
|
}
|
|
270841
|
-
let imageBuffer =
|
|
270857
|
+
let imageBuffer = getFsImplementation2().readFileBytesSync(screenshotPath);
|
|
270842
270858
|
if (imageBuffer.length >= 2 && imageBuffer[0] === 66 && imageBuffer[1] === 77) {
|
|
270843
270859
|
const sharp = await getImageProcessor();
|
|
270844
270860
|
imageBuffer = await sharp(imageBuffer).png().toBuffer();
|
|
@@ -270911,11 +270927,11 @@ async function tryReadImageFromPath(text) {
|
|
|
270911
270927
|
let imageBuffer;
|
|
270912
270928
|
try {
|
|
270913
270929
|
if (isAbsolute11(imagePath)) {
|
|
270914
|
-
imageBuffer =
|
|
270930
|
+
imageBuffer = getFsImplementation2().readFileBytesSync(imagePath);
|
|
270915
270931
|
} else {
|
|
270916
270932
|
const clipboardPath = await getImagePathFromClipboard();
|
|
270917
270933
|
if (clipboardPath && imagePath === basename11(clipboardPath)) {
|
|
270918
|
-
imageBuffer =
|
|
270934
|
+
imageBuffer = getFsImplementation2().readFileBytesSync(clipboardPath);
|
|
270919
270935
|
}
|
|
270920
270936
|
}
|
|
270921
270937
|
} catch (e) {
|
|
@@ -271041,7 +271057,7 @@ function evictOldestIfAtCap() {
|
|
|
271041
271057
|
}
|
|
271042
271058
|
}
|
|
271043
271059
|
async function cleanupOldImageCaches() {
|
|
271044
|
-
const fsImpl =
|
|
271060
|
+
const fsImpl = getFsImplementation2();
|
|
271045
271061
|
const baseDir = join54(getClaudeConfigHomeDir(), IMAGE_STORE_DIR);
|
|
271046
271062
|
const currentSessionId = getSessionId();
|
|
271047
271063
|
try {
|
|
@@ -275837,7 +275853,7 @@ async function writeIfMissing(path12, content, mode) {
|
|
|
275837
275853
|
async function ensureLocalPackageEnvironment() {
|
|
275838
275854
|
try {
|
|
275839
275855
|
const localInstallDir = getLocalInstallDir();
|
|
275840
|
-
await
|
|
275856
|
+
await getFsImplementation2().mkdir(localInstallDir);
|
|
275841
275857
|
await writeIfMissing(join55(localInstallDir, "package.json"), jsonStringify({ name: "verboo-local", version: "0.0.1", private: true }, null, 2));
|
|
275842
275858
|
const wrapperPath = getLocalClaudePath();
|
|
275843
275859
|
const created = await writeIfMissing(wrapperPath, `#!/bin/sh
|
|
@@ -276260,7 +276276,7 @@ async function getInstallationPath() {
|
|
|
276260
276276
|
} catch {}
|
|
276261
276277
|
try {
|
|
276262
276278
|
const nativeBinaryPath = join57(homedir18(), ".local", "bin", getCliBinaryName());
|
|
276263
|
-
await
|
|
276279
|
+
await getFsImplementation2().stat(nativeBinaryPath);
|
|
276264
276280
|
return nativeBinaryPath;
|
|
276265
276281
|
} catch {}
|
|
276266
276282
|
return "native";
|
|
@@ -276282,7 +276298,7 @@ function getInvokedBinary() {
|
|
|
276282
276298
|
}
|
|
276283
276299
|
}
|
|
276284
276300
|
async function detectMultipleInstallations() {
|
|
276285
|
-
const fs2 =
|
|
276301
|
+
const fs2 = getFsImplementation2();
|
|
276286
276302
|
const installations = [];
|
|
276287
276303
|
const localPath = await getDetectedLocalInstallDir();
|
|
276288
276304
|
if (localPath) {
|
|
@@ -276659,7 +276675,7 @@ async function downloadVersionFromArtifactory(version2, stagingPath) {
|
|
|
276659
276675
|
if (!ARTIFACTORY_REGISTRY_URL) {
|
|
276660
276676
|
throw new Error("Internal artifactory registry URL is not configured");
|
|
276661
276677
|
}
|
|
276662
|
-
const fs2 =
|
|
276678
|
+
const fs2 = getFsImplementation2();
|
|
276663
276679
|
await fs2.rm(stagingPath, { recursive: true, force: true });
|
|
276664
276680
|
const platform4 = getPlatform2();
|
|
276665
276681
|
const platformPackageName = `${undefined}-${platform4}`;
|
|
@@ -276789,7 +276805,7 @@ async function downloadAndVerifyBinary(binaryUrl, expectedChecksum, binaryPath,
|
|
|
276789
276805
|
throw lastError ?? new Error("Download failed after all retries");
|
|
276790
276806
|
}
|
|
276791
276807
|
async function downloadVersionFromBinaryRepo(version2, stagingPath, baseUrl, authConfig) {
|
|
276792
|
-
const fs2 =
|
|
276808
|
+
const fs2 = getFsImplementation2();
|
|
276793
276809
|
await fs2.rm(stagingPath, { recursive: true, force: true });
|
|
276794
276810
|
const platform4 = getPlatform2();
|
|
276795
276811
|
const startTime2 = Date.now();
|
|
@@ -276921,7 +276937,7 @@ function isClaudeProcess(pid, expectedExecPath) {
|
|
|
276921
276937
|
}
|
|
276922
276938
|
}
|
|
276923
276939
|
function readLockContent(lockFilePath) {
|
|
276924
|
-
const fs2 =
|
|
276940
|
+
const fs2 = getFsImplementation2();
|
|
276925
276941
|
try {
|
|
276926
276942
|
const content = fs2.readFileSync(lockFilePath, { encoding: "utf8" });
|
|
276927
276943
|
if (!content || content.trim() === "") {
|
|
@@ -276949,7 +276965,7 @@ function isLockActive(lockFilePath) {
|
|
|
276949
276965
|
logForDebugging(`Lock PID ${pid} is running but does not appear to be Claude - treating as stale`);
|
|
276950
276966
|
return false;
|
|
276951
276967
|
}
|
|
276952
|
-
const fs2 =
|
|
276968
|
+
const fs2 = getFsImplementation2();
|
|
276953
276969
|
try {
|
|
276954
276970
|
const stats = fs2.statSync(lockFilePath);
|
|
276955
276971
|
const age = Date.now() - stats.mtimeMs;
|
|
@@ -276962,7 +276978,7 @@ function isLockActive(lockFilePath) {
|
|
|
276962
276978
|
return true;
|
|
276963
276979
|
}
|
|
276964
276980
|
function writeLockFile(lockFilePath, content) {
|
|
276965
|
-
const fs2 =
|
|
276981
|
+
const fs2 = getFsImplementation2();
|
|
276966
276982
|
const tempPath = `${lockFilePath}.tmp.${process.pid}.${Date.now()}`;
|
|
276967
276983
|
try {
|
|
276968
276984
|
writeFileSync_DEPRECATED(tempPath, jsonStringify(content, null, 2), {
|
|
@@ -276978,7 +276994,7 @@ function writeLockFile(lockFilePath, content) {
|
|
|
276978
276994
|
}
|
|
276979
276995
|
}
|
|
276980
276996
|
async function tryAcquireLock(versionPath, lockFilePath) {
|
|
276981
|
-
const fs2 =
|
|
276997
|
+
const fs2 = getFsImplementation2();
|
|
276982
276998
|
const versionName = basename12(versionPath);
|
|
276983
276999
|
if (isLockActive(lockFilePath)) {
|
|
276984
277000
|
const existingContent = readLockContent(lockFilePath);
|
|
@@ -277042,7 +277058,7 @@ async function withLock(versionPath, lockFilePath, callback) {
|
|
|
277042
277058
|
}
|
|
277043
277059
|
}
|
|
277044
277060
|
function getAllLockInfo(locksDir) {
|
|
277045
|
-
const fs2 =
|
|
277061
|
+
const fs2 = getFsImplementation2();
|
|
277046
277062
|
const lockInfos = [];
|
|
277047
277063
|
try {
|
|
277048
277064
|
const lockFiles = fs2.readdirStringSync(locksDir).filter((f) => f.endsWith(".lock"));
|
|
@@ -277069,7 +277085,7 @@ function getAllLockInfo(locksDir) {
|
|
|
277069
277085
|
return lockInfos;
|
|
277070
277086
|
}
|
|
277071
277087
|
function cleanupStaleLocks(locksDir) {
|
|
277072
|
-
const fs2 =
|
|
277088
|
+
const fs2 = getFsImplementation2();
|
|
277073
277089
|
let cleanedCount = 0;
|
|
277074
277090
|
try {
|
|
277075
277091
|
const lockEntries = fs2.readdirStringSync(locksDir).filter((f) => f.endsWith(".lock"));
|
|
@@ -279523,7 +279539,7 @@ function migrateDiscoveryCache(parsed) {
|
|
|
279523
279539
|
};
|
|
279524
279540
|
}
|
|
279525
279541
|
async function loadDiscoveryCache() {
|
|
279526
|
-
const fs2 =
|
|
279542
|
+
const fs2 = getFsImplementation2();
|
|
279527
279543
|
const cachePath = getDiscoveryCachePath();
|
|
279528
279544
|
try {
|
|
279529
279545
|
const content = await fs2.readFile(cachePath, { encoding: "utf-8" });
|
|
@@ -279549,7 +279565,7 @@ async function loadDiscoveryCache() {
|
|
|
279549
279565
|
}
|
|
279550
279566
|
}
|
|
279551
279567
|
async function saveDiscoveryCache(cache3) {
|
|
279552
|
-
const fs2 =
|
|
279568
|
+
const fs2 = getFsImplementation2();
|
|
279553
279569
|
const cachePath = getDiscoveryCachePath();
|
|
279554
279570
|
const tempPath = `${cachePath}.${randomBytes7(8).toString("hex")}.tmp`;
|
|
279555
279571
|
try {
|
|
@@ -286040,7 +286056,7 @@ var init_coreSchemas = __esm(() => {
|
|
|
286040
286056
|
"unknown",
|
|
286041
286057
|
"max_output_tokens"
|
|
286042
286058
|
]));
|
|
286043
|
-
SDKStatusSchema = lazySchema(() => exports_external.union([exports_external.literal("compacting"), exports_external.null()]));
|
|
286059
|
+
SDKStatusSchema = lazySchema(() => exports_external.union([exports_external.literal("compacting"), exports_external.literal("warming-up"), exports_external.null()]));
|
|
286044
286060
|
SDKUserMessageContentSchema = lazySchema(() => exports_external.object({
|
|
286045
286061
|
type: exports_external.literal("user"),
|
|
286046
286062
|
message: APIUserMessagePlaceholder(),
|
|
@@ -302935,7 +302951,7 @@ async function processSlashCommand(inputString, precedingInputBlocks, imageConte
|
|
|
302935
302951
|
if (!hasCommand(commandName, context.options.commands)) {
|
|
302936
302952
|
let isFilePath = false;
|
|
302937
302953
|
try {
|
|
302938
|
-
await
|
|
302954
|
+
await getFsImplementation2().stat(`/${commandName}`);
|
|
302939
302955
|
isFilePath = true;
|
|
302940
302956
|
} catch {}
|
|
302941
302957
|
if (looksLikeCommand(commandName) && !isFilePath) {
|
|
@@ -306614,7 +306630,7 @@ function getPlanSlug(sessionId) {
|
|
|
306614
306630
|
for (let i3 = 0;i3 < MAX_SLUG_RETRIES; i3++) {
|
|
306615
306631
|
slug = generateWordSlug();
|
|
306616
306632
|
const filePath = join67(plansDir, `${slug}.md`);
|
|
306617
|
-
if (!
|
|
306633
|
+
if (!getFsImplementation2().existsSync(filePath)) {
|
|
306618
306634
|
break;
|
|
306619
306635
|
}
|
|
306620
306636
|
}
|
|
@@ -306638,7 +306654,7 @@ function getPlanFilePath(agentId) {
|
|
|
306638
306654
|
function getPlan(agentId) {
|
|
306639
306655
|
const filePath = getPlanFilePath(agentId);
|
|
306640
306656
|
try {
|
|
306641
|
-
return
|
|
306657
|
+
return getFsImplementation2().readFileSync(filePath, { encoding: "utf-8" });
|
|
306642
306658
|
} catch (error42) {
|
|
306643
306659
|
if (isENOENT(error42))
|
|
306644
306660
|
return null;
|
|
@@ -306658,7 +306674,7 @@ async function copyPlanForResume(log, targetSessionId) {
|
|
|
306658
306674
|
setPlanSlug(sessionId, slug);
|
|
306659
306675
|
const planPath = join67(getPlansDirectory(), `${slug}.md`);
|
|
306660
306676
|
try {
|
|
306661
|
-
await
|
|
306677
|
+
await getFsImplementation2().readFile(planPath, { encoding: "utf-8" });
|
|
306662
306678
|
return true;
|
|
306663
306679
|
} catch (e) {
|
|
306664
306680
|
if (!isENOENT(e)) {
|
|
@@ -306823,7 +306839,7 @@ var init_plans = __esm(() => {
|
|
|
306823
306839
|
plansPath = getDefaultPlansDirectory();
|
|
306824
306840
|
}
|
|
306825
306841
|
try {
|
|
306826
|
-
|
|
306842
|
+
getFsImplementation2().mkdirSync(plansPath);
|
|
306827
306843
|
} catch (error42) {
|
|
306828
306844
|
logError2(error42);
|
|
306829
306845
|
}
|
|
@@ -316176,7 +316192,7 @@ ${stdout}`);
|
|
|
316176
316192
|
logForDebugging(`Shell snapshot created successfully (${snapshotSize} bytes)`);
|
|
316177
316193
|
registerCleanup(async () => {
|
|
316178
316194
|
try {
|
|
316179
|
-
await
|
|
316195
|
+
await getFsImplementation2().unlink(shellSnapshotPath);
|
|
316180
316196
|
logForDebugging(`Cleaned up session snapshot: ${shellSnapshotPath}`);
|
|
316181
316197
|
} catch (error43) {
|
|
316182
316198
|
logForDebugging(`Error cleaning up session snapshot: ${error43}`);
|
|
@@ -316187,7 +316203,7 @@ ${stdout}`);
|
|
|
316187
316203
|
logForDebugging(`Shell snapshot file not found after creation: ${shellSnapshotPath}`);
|
|
316188
316204
|
logForDebugging(`Checking if parent directory still exists: ${snapshotsDir}`);
|
|
316189
316205
|
try {
|
|
316190
|
-
const dirContents = await
|
|
316206
|
+
const dirContents = await getFsImplementation2().readdir(snapshotsDir);
|
|
316191
316207
|
logForDebugging(`Directory contains ${dirContents.length} files`);
|
|
316192
316208
|
} catch {
|
|
316193
316209
|
logForDebugging(`Parent directory does not exist or is not accessible: ${snapshotsDir}`);
|
|
@@ -316842,7 +316858,7 @@ async function exec3(command, abortSignal, shellType, options2) {
|
|
|
316842
316858
|
if (shouldUseSandbox) {
|
|
316843
316859
|
commandString = await SandboxManager2.wrapWithSandbox(commandString, sandboxBinShell, undefined, abortSignal);
|
|
316844
316860
|
try {
|
|
316845
|
-
const fs3 =
|
|
316861
|
+
const fs3 = getFsImplementation2();
|
|
316846
316862
|
await fs3.mkdir(sandboxTmpDir, { mode: 448 });
|
|
316847
316863
|
} catch (error42) {
|
|
316848
316864
|
logForDebugging(`Failed to create ${sandboxTmpDir} directory: ${error42}`);
|
|
@@ -316930,10 +316946,10 @@ async function exec3(command, abortSignal, shellType, options2) {
|
|
|
316930
316946
|
}
|
|
316931
316947
|
}
|
|
316932
316948
|
function setCwd(path15, relativeTo) {
|
|
316933
|
-
const resolved = isAbsolute14(path15) ? path15 : resolve24(relativeTo ||
|
|
316949
|
+
const resolved = isAbsolute14(path15) ? path15 : resolve24(relativeTo || getFsImplementation2().cwd(), path15);
|
|
316934
316950
|
let physicalPath;
|
|
316935
316951
|
try {
|
|
316936
|
-
physicalPath =
|
|
316952
|
+
physicalPath = getFsImplementation2().realpathSync(resolved);
|
|
316937
316953
|
} catch (e) {
|
|
316938
316954
|
if (isENOENT(e)) {
|
|
316939
316955
|
throw new Error(`Path "${resolved}" does not exist`);
|
|
@@ -320249,7 +320265,7 @@ function checkDenyRuleForGuessedPath(strippedPath, cwd2, toolPermissionContext,
|
|
|
320249
320265
|
return null;
|
|
320250
320266
|
const tildeExpanded = expandTilde2(strippedPath);
|
|
320251
320267
|
const abs = isAbsolute15(tildeExpanded) ? tildeExpanded : resolve26(cwd2, tildeExpanded);
|
|
320252
|
-
const { resolvedPath } = safeResolvePath(
|
|
320268
|
+
const { resolvedPath } = safeResolvePath(getFsImplementation2(), abs);
|
|
320253
320269
|
const permissionType = operationType === "read" ? "read" : "edit";
|
|
320254
320270
|
const denyRule = matchingRuleForInput(resolvedPath, toolPermissionContext, permissionType, "deny");
|
|
320255
320271
|
return denyRule ? { resolvedPath, rule: denyRule } : null;
|
|
@@ -320339,7 +320355,7 @@ function validatePath2(filePath, cwd2, toolPermissionContext, operationType) {
|
|
|
320339
320355
|
}
|
|
320340
320356
|
if (containsPathTraversal(normalizedPath)) {
|
|
320341
320357
|
const absolutePath2 = isAbsolute15(normalizedPath) ? normalizedPath : resolve26(cwd2, normalizedPath);
|
|
320342
|
-
const { resolvedPath: resolvedPath3, isCanonical: isCanonical2 } = safeResolvePath(
|
|
320358
|
+
const { resolvedPath: resolvedPath3, isCanonical: isCanonical2 } = safeResolvePath(getFsImplementation2(), absolutePath2);
|
|
320343
320359
|
const result2 = isPathAllowed2(resolvedPath3, toolPermissionContext, operationType, isCanonical2 ? [resolvedPath3] : undefined);
|
|
320344
320360
|
return {
|
|
320345
320361
|
allowed: result2.allowed,
|
|
@@ -320349,7 +320365,7 @@ function validatePath2(filePath, cwd2, toolPermissionContext, operationType) {
|
|
|
320349
320365
|
}
|
|
320350
320366
|
const basePath = getGlobBaseDirectory2(normalizedPath);
|
|
320351
320367
|
const absoluteBasePath = isAbsolute15(basePath) ? basePath : resolve26(cwd2, basePath);
|
|
320352
|
-
const { resolvedPath: resolvedPath2 } = safeResolvePath(
|
|
320368
|
+
const { resolvedPath: resolvedPath2 } = safeResolvePath(getFsImplementation2(), absoluteBasePath);
|
|
320353
320369
|
const permissionType = operationType === "read" ? "read" : "edit";
|
|
320354
320370
|
const denyRule = matchingRuleForInput(resolvedPath2, toolPermissionContext, permissionType, "deny");
|
|
320355
320371
|
if (denyRule !== null) {
|
|
@@ -320369,7 +320385,7 @@ function validatePath2(filePath, cwd2, toolPermissionContext, operationType) {
|
|
|
320369
320385
|
};
|
|
320370
320386
|
}
|
|
320371
320387
|
const absolutePath = isAbsolute15(normalizedPath) ? normalizedPath : resolve26(cwd2, normalizedPath);
|
|
320372
|
-
const { resolvedPath, isCanonical } = safeResolvePath(
|
|
320388
|
+
const { resolvedPath, isCanonical } = safeResolvePath(getFsImplementation2(), absolutePath);
|
|
320373
320389
|
const result = isPathAllowed2(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
|
|
320374
320390
|
return {
|
|
320375
320391
|
allowed: result.allowed,
|
|
@@ -324354,7 +324370,7 @@ ${markdownContent}` : markdownContent;
|
|
|
324354
324370
|
};
|
|
324355
324371
|
}
|
|
324356
324372
|
async function findSkillMarkdownFiles(basePath) {
|
|
324357
|
-
const fs3 =
|
|
324373
|
+
const fs3 = getFsImplementation2();
|
|
324358
324374
|
const visitedDirs = new Set;
|
|
324359
324375
|
const skillFiles = [];
|
|
324360
324376
|
async function walk(skillDirPath) {
|
|
@@ -324437,7 +324453,7 @@ async function findSkillMarkdownFiles(basePath) {
|
|
|
324437
324453
|
return skillFiles;
|
|
324438
324454
|
}
|
|
324439
324455
|
async function loadSkillsFromSkillsDir(basePath, source) {
|
|
324440
|
-
const fs3 =
|
|
324456
|
+
const fs3 = getFsImplementation2();
|
|
324441
324457
|
const skillFiles = await findSkillMarkdownFiles(basePath);
|
|
324442
324458
|
const results = await Promise.all(skillFiles.map(async (skillFilePath) => {
|
|
324443
324459
|
try {
|
|
@@ -324590,7 +324606,7 @@ function onDynamicSkillsLoaded(callback) {
|
|
|
324590
324606
|
});
|
|
324591
324607
|
}
|
|
324592
324608
|
async function discoverSkillDirsForPaths(filePaths, cwd2) {
|
|
324593
|
-
const fs3 =
|
|
324609
|
+
const fs3 = getFsImplementation2();
|
|
324594
324610
|
const resolvedCwd = cwd2.endsWith(pathSep) ? cwd2.slice(0, -1) : cwd2;
|
|
324595
324611
|
const newDirs = [];
|
|
324596
324612
|
for (const filePath of filePaths) {
|
|
@@ -329137,7 +329153,7 @@ var init_FileEditTool = __esm(() => {
|
|
|
329137
329153
|
if (fullFilePath.startsWith("\\\\") || fullFilePath.startsWith("//")) {
|
|
329138
329154
|
return { result: true };
|
|
329139
329155
|
}
|
|
329140
|
-
const fs3 =
|
|
329156
|
+
const fs3 = getFsImplementation2();
|
|
329141
329157
|
try {
|
|
329142
329158
|
const { size } = await fs3.stat(fullFilePath);
|
|
329143
329159
|
if (size > MAX_EDIT_FILE_SIZE) {
|
|
@@ -329297,7 +329313,7 @@ String: ${old_string}`,
|
|
|
329297
329313
|
dynamicSkillDirTriggers
|
|
329298
329314
|
}, _, parentMessage) {
|
|
329299
329315
|
const { file_path, old_string, new_string, replace_all = false } = input;
|
|
329300
|
-
const fs3 =
|
|
329316
|
+
const fs3 = getFsImplementation2();
|
|
329301
329317
|
const absoluteFilePath = expandPath(file_path);
|
|
329302
329318
|
const cwd2 = getCwd();
|
|
329303
329319
|
if (!isEnvTruthy(process.env.CLAUDE_CODE_SIMPLE)) {
|
|
@@ -329992,7 +330008,7 @@ var init_FileWriteTool = __esm(() => {
|
|
|
329992
330008
|
if (fullFilePath.startsWith("\\\\") || fullFilePath.startsWith("//")) {
|
|
329993
330009
|
return { result: true };
|
|
329994
330010
|
}
|
|
329995
|
-
const fs3 =
|
|
330011
|
+
const fs3 = getFsImplementation2();
|
|
329996
330012
|
let fileMtimeMs;
|
|
329997
330013
|
try {
|
|
329998
330014
|
const fileStat = await fs3.stat(fullFilePath);
|
|
@@ -330034,7 +330050,7 @@ var init_FileWriteTool = __esm(() => {
|
|
|
330034
330050
|
}
|
|
330035
330051
|
activateConditionalSkillsForPaths([fullFilePath], cwd2);
|
|
330036
330052
|
await diagnosticTracker.beforeFileEditedCompat(fullFilePath);
|
|
330037
|
-
await
|
|
330053
|
+
await getFsImplementation2().mkdir(dir);
|
|
330038
330054
|
if (fileHistoryEnabled()) {
|
|
330039
330055
|
await fileHistoryTrackEdit(updateFileHistoryState, fullFilePath, parentMessage.uuid);
|
|
330040
330056
|
}
|
|
@@ -330654,7 +330670,7 @@ var init_GrepTool = __esm(() => {
|
|
|
330654
330670
|
},
|
|
330655
330671
|
async validateInput({ path: path15 }) {
|
|
330656
330672
|
if (path15) {
|
|
330657
|
-
const fs3 =
|
|
330673
|
+
const fs3 = getFsImplementation2();
|
|
330658
330674
|
const absolutePath = expandPath(path15);
|
|
330659
330675
|
if (absolutePath.startsWith("\\\\") || absolutePath.startsWith("//")) {
|
|
330660
330676
|
return { result: true };
|
|
@@ -330889,7 +330905,7 @@ ${filenames.join(`
|
|
|
330889
330905
|
};
|
|
330890
330906
|
return { data: output2 };
|
|
330891
330907
|
}
|
|
330892
|
-
const stats = await Promise.allSettled(results.map((_) =>
|
|
330908
|
+
const stats = await Promise.allSettled(results.map((_) => getFsImplementation2().stat(_)));
|
|
330893
330909
|
const sortedMatches = results.map((_, i3) => {
|
|
330894
330910
|
const r = stats[i3];
|
|
330895
330911
|
return [
|
|
@@ -331046,7 +331062,7 @@ var init_GlobTool = __esm(() => {
|
|
|
331046
331062
|
},
|
|
331047
331063
|
async validateInput({ path: path15 }) {
|
|
331048
331064
|
if (path15) {
|
|
331049
|
-
const fs3 =
|
|
331065
|
+
const fs3 = getFsImplementation2();
|
|
331050
331066
|
const absolutePath = expandPath(path15);
|
|
331051
331067
|
if (absolutePath.startsWith("\\\\") || absolutePath.startsWith("//")) {
|
|
331052
331068
|
return { result: true };
|
|
@@ -331257,7 +331273,7 @@ function getToolResultFromCell(cell) {
|
|
|
331257
331273
|
}
|
|
331258
331274
|
async function readNotebook(notebookPath, cellId) {
|
|
331259
331275
|
const fullPath = expandPath(notebookPath);
|
|
331260
|
-
const buffer = await
|
|
331276
|
+
const buffer = await getFsImplementation2().readFileBytes(fullPath);
|
|
331261
331277
|
const content = buffer.toString("utf-8");
|
|
331262
331278
|
const notebook = jsonParse(content);
|
|
331263
331279
|
const language = notebook.metadata.language_info?.name ?? "python";
|
|
@@ -364768,7 +364784,7 @@ var init_schemas4 = __esm(() => {
|
|
|
364768
364784
|
// src/tools/LSPTool/symbolContext.ts
|
|
364769
364785
|
function getSymbolAtPosition(filePath, line, character) {
|
|
364770
364786
|
try {
|
|
364771
|
-
const fs3 =
|
|
364787
|
+
const fs3 = getFsImplementation2();
|
|
364772
364788
|
const absolutePath = expandPath(filePath);
|
|
364773
364789
|
const { buffer, bytesRead } = fs3.readSync(absolutePath, {
|
|
364774
364790
|
length: MAX_READ_BYTES
|
|
@@ -365450,7 +365466,7 @@ var init_LSPTool = __esm(() => {
|
|
|
365450
365466
|
errorCode: 3
|
|
365451
365467
|
};
|
|
365452
365468
|
}
|
|
365453
|
-
const fs3 =
|
|
365469
|
+
const fs3 = getFsImplementation2();
|
|
365454
365470
|
const absolutePath = expandPath(input.filePath);
|
|
365455
365471
|
if (absolutePath.startsWith("\\\\") || absolutePath.startsWith("//")) {
|
|
365456
365472
|
return { result: true };
|
|
@@ -375318,7 +375334,7 @@ async function applySedEdit(simulatedEdit, toolUseContext, parentMessage) {
|
|
|
375318
375334
|
newContent
|
|
375319
375335
|
} = simulatedEdit;
|
|
375320
375336
|
const absoluteFilePath = expandPath(filePath);
|
|
375321
|
-
const fs3 =
|
|
375337
|
+
const fs3 = getFsImplementation2();
|
|
375322
375338
|
const encoding = detectFileEncoding(absoluteFilePath);
|
|
375323
375339
|
let originalContent;
|
|
375324
375340
|
try {
|
|
@@ -382200,7 +382216,7 @@ function getAnthropicEnvMetadata() {
|
|
|
382200
382216
|
function getBuildAgeMinutes() {
|
|
382201
382217
|
if (false)
|
|
382202
382218
|
;
|
|
382203
|
-
const buildTime = new Date("2026-05-
|
|
382219
|
+
const buildTime = new Date("2026-05-19T20:11:05.617Z").getTime();
|
|
382204
382220
|
if (isNaN(buildTime))
|
|
382205
382221
|
return;
|
|
382206
382222
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -386343,7 +386359,7 @@ import { mkdir as mkdir26, readdir as readdir15, readFile as readFile29 } from "
|
|
|
386343
386359
|
import { join as join86 } from "path";
|
|
386344
386360
|
async function readPDF(filePath) {
|
|
386345
386361
|
try {
|
|
386346
|
-
const fs3 =
|
|
386362
|
+
const fs3 = getFsImplementation2();
|
|
386347
386363
|
const stats = await fs3.stat(filePath);
|
|
386348
386364
|
const originalSize = stats.size;
|
|
386349
386365
|
if (originalSize === 0) {
|
|
@@ -386421,7 +386437,7 @@ async function isPdftoppmAvailable() {
|
|
|
386421
386437
|
}
|
|
386422
386438
|
async function extractPDFPages(filePath, options2) {
|
|
386423
386439
|
try {
|
|
386424
|
-
const fs3 =
|
|
386440
|
+
const fs3 = getFsImplementation2();
|
|
386425
386441
|
const stats = await fs3.stat(filePath);
|
|
386426
386442
|
const originalSize = stats.size;
|
|
386427
386443
|
if (originalSize === 0) {
|
|
@@ -386900,7 +386916,7 @@ async function callInner(file_path, fullFilePath, resolvedFilePath, ext, offset,
|
|
|
386900
386916
|
` + ` cat "${file_path}" | jq '.cells[] | select(.cell_type=="code") | .source' # All code sources`);
|
|
386901
386917
|
}
|
|
386902
386918
|
await validateContentTokens(cellsJson, ext, maxTokens);
|
|
386903
|
-
const stats = await
|
|
386919
|
+
const stats = await getFsImplementation2().stat(resolvedFilePath);
|
|
386904
386920
|
readFileState.set(fullFilePath, {
|
|
386905
386921
|
content: cellsJson,
|
|
386906
386922
|
timestamp: Math.floor(stats.mtimeMs),
|
|
@@ -386986,7 +387002,7 @@ async function callInner(file_path, fullFilePath, resolvedFilePath, ext, offset,
|
|
|
386986
387002
|
if (pageCount !== null && pageCount > PDF_AT_MENTION_INLINE_THRESHOLD) {
|
|
386987
387003
|
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.`);
|
|
386988
387004
|
}
|
|
386989
|
-
const fs3 =
|
|
387005
|
+
const fs3 = getFsImplementation2();
|
|
386990
387006
|
const stats = await fs3.stat(resolvedFilePath);
|
|
386991
387007
|
const shouldExtractPages = !isPDFSupported() || stats.size > PDF_EXTRACT_SIZE_THRESHOLD;
|
|
386992
387008
|
if (shouldExtractPages) {
|
|
@@ -387089,7 +387105,7 @@ async function callInner(file_path, fullFilePath, resolvedFilePath, ext, offset,
|
|
|
387089
387105
|
return { data };
|
|
387090
387106
|
}
|
|
387091
387107
|
async function readImageWithTokenBudget(filePath, maxTokens = getDefaultFileReadingLimits().maxTokens, maxBytes) {
|
|
387092
|
-
const imageBuffer = await
|
|
387108
|
+
const imageBuffer = await getFsImplementation2().readFileBytes(filePath, maxBytes);
|
|
387093
387109
|
const originalSize = imageBuffer.length;
|
|
387094
387110
|
if (originalSize === 0) {
|
|
387095
387111
|
throw new Error(`Image file is empty: ${filePath}`);
|
|
@@ -389106,7 +389122,7 @@ async function tryGetPDFReference(filename) {
|
|
|
389106
389122
|
}
|
|
389107
389123
|
try {
|
|
389108
389124
|
const [stats, pageCount] = await Promise.all([
|
|
389109
|
-
|
|
389125
|
+
getFsImplementation2().stat(filename),
|
|
389110
389126
|
getPDFPageCount(filename)
|
|
389111
389127
|
]);
|
|
389112
389128
|
const effectivePageCount = pageCount ?? Math.ceil(stats.size / (100 * 1024));
|
|
@@ -389137,7 +389153,7 @@ async function generateFileAttachment(filename, toolUseContext, successEventName
|
|
|
389137
389153
|
const ext = parse13(filename).ext.toLowerCase();
|
|
389138
389154
|
if (!isPDFExtension(ext)) {
|
|
389139
389155
|
try {
|
|
389140
|
-
const stats = await
|
|
389156
|
+
const stats = await getFsImplementation2().stat(filename);
|
|
389141
389157
|
logEvent("tengu_attachment_file_too_large", {
|
|
389142
389158
|
size_bytes: stats.size,
|
|
389143
389159
|
mode
|
|
@@ -389758,7 +389774,7 @@ function getCommandNameFromFile(filePath, baseDir, pluginName) {
|
|
|
389758
389774
|
}
|
|
389759
389775
|
async function collectMarkdownFiles(dirPath, baseDir, loadedPaths) {
|
|
389760
389776
|
const files = [];
|
|
389761
|
-
const fs3 =
|
|
389777
|
+
const fs3 = getFsImplementation2();
|
|
389762
389778
|
await walkPluginMarkdown(dirPath, async (fullPath) => {
|
|
389763
389779
|
if (isDuplicatePath(fs3, fullPath, loadedPaths))
|
|
389764
389780
|
return;
|
|
@@ -389923,7 +389939,7 @@ async function validatePluginSkillFilePath(pluginPath, skillFilePath) {
|
|
|
389923
389939
|
return true;
|
|
389924
389940
|
}
|
|
389925
389941
|
async function loadSkillsFromDirectory(skillsPath, pluginName, sourceName, pluginManifest, pluginPath, loadedPaths) {
|
|
389926
|
-
const fs3 =
|
|
389942
|
+
const fs3 = getFsImplementation2();
|
|
389927
389943
|
const skills = [];
|
|
389928
389944
|
const directSkillPath = join88(skillsPath, "SKILL.md");
|
|
389929
389945
|
let directSkillContent = null;
|
|
@@ -390062,7 +390078,7 @@ var init_loadPluginCommands = __esm(() => {
|
|
|
390062
390078
|
logForDebugging(`Plugin ${plugin.name} has commandsPaths: ${plugin.commandsPaths.join(", ")}`);
|
|
390063
390079
|
const pathResults = await Promise.all(plugin.commandsPaths.map(async (commandPath) => {
|
|
390064
390080
|
try {
|
|
390065
|
-
const fs3 =
|
|
390081
|
+
const fs3 = getFsImplementation2();
|
|
390066
390082
|
const stats = await fs3.stat(commandPath);
|
|
390067
390083
|
logForDebugging(`Checking commandPath ${commandPath} - isDirectory: ${stats.isDirectory()}, isFile: ${stats.isFile()}`);
|
|
390068
390084
|
if (stats.isDirectory()) {
|
|
@@ -390280,7 +390296,7 @@ async function getSessionPluginCachePath() {
|
|
|
390280
390296
|
sessionPluginCachePromise = (async () => {
|
|
390281
390297
|
const suffix = randomBytes10(8).toString("hex");
|
|
390282
390298
|
const dir = join89(tmpdir6(), `claude-plugin-session-${suffix}`);
|
|
390283
|
-
await
|
|
390299
|
+
await getFsImplementation2().mkdir(dir);
|
|
390284
390300
|
sessionPluginCachePath = dir;
|
|
390285
390301
|
logForDebugging(`Created session plugin cache at ${dir}`);
|
|
390286
390302
|
return dir;
|
|
@@ -390304,7 +390320,7 @@ async function cleanupSessionPluginCache() {
|
|
|
390304
390320
|
}
|
|
390305
390321
|
async function atomicWriteToZipCache(targetPath, data) {
|
|
390306
390322
|
const dir = dirname38(targetPath);
|
|
390307
|
-
await
|
|
390323
|
+
await getFsImplementation2().mkdir(dir);
|
|
390308
390324
|
const tmpName = `.${basename28(targetPath)}.tmp.${randomBytes10(4).toString("hex")}`;
|
|
390309
390325
|
const tmpPath = join89(dir, tmpName);
|
|
390310
390326
|
try {
|
|
@@ -390390,17 +390406,17 @@ async function collectFilesForZip(baseDir, relativePath, files, visited) {
|
|
|
390390
390406
|
}
|
|
390391
390407
|
}
|
|
390392
390408
|
async function extractZipToDirectory(zipPath, targetDir) {
|
|
390393
|
-
const zipBuf = await
|
|
390409
|
+
const zipBuf = await getFsImplementation2().readFileBytes(zipPath);
|
|
390394
390410
|
const files = await unzipFile(zipBuf);
|
|
390395
390411
|
const modes = parseZipModes(zipBuf);
|
|
390396
|
-
await
|
|
390412
|
+
await getFsImplementation2().mkdir(targetDir);
|
|
390397
390413
|
for (const [relPath, data] of Object.entries(files)) {
|
|
390398
390414
|
if (relPath.endsWith("/")) {
|
|
390399
|
-
await
|
|
390415
|
+
await getFsImplementation2().mkdir(join89(targetDir, relPath));
|
|
390400
390416
|
continue;
|
|
390401
390417
|
}
|
|
390402
390418
|
const fullPath = join89(targetDir, relPath);
|
|
390403
|
-
await
|
|
390419
|
+
await getFsImplementation2().mkdir(dirname38(fullPath));
|
|
390404
390420
|
await writeFile25(fullPath, data);
|
|
390405
390421
|
const mode = modes[relPath];
|
|
390406
390422
|
if (mode && mode & 73) {
|
|
@@ -391067,7 +391083,7 @@ function saveMarketplaceToSettings(name, entry, settingSource = "userSettings")
|
|
|
391067
391083
|
updateSettingsForSource(settingSource, { extraKnownMarketplaces: current });
|
|
391068
391084
|
}
|
|
391069
391085
|
async function loadKnownMarketplacesConfig() {
|
|
391070
|
-
const fs3 =
|
|
391086
|
+
const fs3 = getFsImplementation2();
|
|
391071
391087
|
const configFile = getKnownMarketplacesFile();
|
|
391072
391088
|
try {
|
|
391073
391089
|
const content = await fs3.readFile(configFile, {
|
|
@@ -391110,7 +391126,7 @@ async function saveKnownMarketplacesConfig(config2) {
|
|
|
391110
391126
|
if (!parsed.success) {
|
|
391111
391127
|
throw new ConfigParseError(`Invalid marketplace config: ${parsed.error.message}`, configFile, config2);
|
|
391112
391128
|
}
|
|
391113
|
-
const fs3 =
|
|
391129
|
+
const fs3 = getFsImplementation2();
|
|
391114
391130
|
const dir = join92(configFile, "..");
|
|
391115
391131
|
await fs3.mkdir(dir);
|
|
391116
391132
|
writeFileSync_DEPRECATED(configFile, jsonStringify(parsed.data, null, 2), {
|
|
@@ -391160,7 +391176,7 @@ async function registerSeedMarketplaces() {
|
|
|
391160
391176
|
async function readSeedKnownMarketplaces(seedDir) {
|
|
391161
391177
|
const seedJsonPath = join92(seedDir, "known_marketplaces.json");
|
|
391162
391178
|
try {
|
|
391163
|
-
const content = await
|
|
391179
|
+
const content = await getFsImplementation2().readFile(seedJsonPath, {
|
|
391164
391180
|
encoding: "utf-8"
|
|
391165
391181
|
});
|
|
391166
391182
|
const parsed = KnownMarketplacesFileSchema().safeParse(jsonParse(content));
|
|
@@ -391231,7 +391247,7 @@ async function gitPull(cwd2, ref, options2) {
|
|
|
391231
391247
|
async function gitSubmoduleUpdate(cwd2, credentialArgs, env4, sparsePaths) {
|
|
391232
391248
|
if (sparsePaths && sparsePaths.length > 0)
|
|
391233
391249
|
return;
|
|
391234
|
-
const hasGitmodules = await
|
|
391250
|
+
const hasGitmodules = await getFsImplementation2().stat(join92(cwd2, ".gitmodules")).then(() => true, () => false);
|
|
391235
391251
|
if (!hasGitmodules)
|
|
391236
391252
|
return;
|
|
391237
391253
|
const result = await execFileNoThrowWithCwd(gitExe(), [
|
|
@@ -391488,7 +391504,7 @@ async function reconcileSparseCheckout(cwd2, sparsePaths) {
|
|
|
391488
391504
|
return { code: 0, stderr: "" };
|
|
391489
391505
|
}
|
|
391490
391506
|
async function cacheMarketplaceFromGit(gitUrl, cachePath, ref, sparsePaths, onProgress, options2) {
|
|
391491
|
-
const fs3 =
|
|
391507
|
+
const fs3 = getFsImplementation2();
|
|
391492
391508
|
const timeoutSec = Math.round(getPluginGitTimeoutMs() / 1000);
|
|
391493
391509
|
safeCallProgress(onProgress, `Refreshing marketplace cache (timeout: ${timeoutSec}s)…`);
|
|
391494
391510
|
const reconcileResult = await reconcileSparseCheckout(cachePath, sparsePaths);
|
|
@@ -391550,7 +391566,7 @@ function redactUrlCredentials(urlString) {
|
|
|
391550
391566
|
return urlString;
|
|
391551
391567
|
}
|
|
391552
391568
|
async function cacheMarketplaceFromUrl(url3, cachePath, customHeaders, onProgress) {
|
|
391553
|
-
const fs3 =
|
|
391569
|
+
const fs3 = getFsImplementation2();
|
|
391554
391570
|
const redactedUrl = redactUrlCredentials(url3);
|
|
391555
391571
|
safeCallProgress(onProgress, `Downloading marketplace from ${redactedUrl}`);
|
|
391556
391572
|
logForDebugging(`Downloading marketplace from URL: ${redactedUrl}`);
|
|
@@ -391609,7 +391625,7 @@ function getCachePathForSource(source) {
|
|
|
391609
391625
|
return tempName;
|
|
391610
391626
|
}
|
|
391611
391627
|
async function parseFileWithSchema(filePath, schema) {
|
|
391612
|
-
const fs3 =
|
|
391628
|
+
const fs3 = getFsImplementation2();
|
|
391613
391629
|
const content = await fs3.readFile(filePath, { encoding: "utf-8" });
|
|
391614
391630
|
let data;
|
|
391615
391631
|
try {
|
|
@@ -391624,7 +391640,7 @@ async function parseFileWithSchema(filePath, schema) {
|
|
|
391624
391640
|
return result.data;
|
|
391625
391641
|
}
|
|
391626
391642
|
async function loadAndCacheMarketplace(source, onProgress) {
|
|
391627
|
-
const fs3 =
|
|
391643
|
+
const fs3 = getFsImplementation2();
|
|
391628
391644
|
const cacheDir = getMarketplacesCacheDir();
|
|
391629
391645
|
await fs3.mkdir(cacheDir);
|
|
391630
391646
|
let temporaryCachePath;
|
|
@@ -391831,7 +391847,7 @@ Tip: The shorthand "${resolvedSource.repo}" assumes github.com. ` + `For interna
|
|
|
391831
391847
|
const resolvedOld = resolve32(oldEntry.installLocation);
|
|
391832
391848
|
const resolvedNew = resolve32(cachePath);
|
|
391833
391849
|
if (resolvedOld === resolvedNew) {} else if (resolvedOld === cacheDir || resolvedOld.startsWith(cacheDir + sep23)) {
|
|
391834
|
-
const fs3 =
|
|
391850
|
+
const fs3 = getFsImplementation2();
|
|
391835
391851
|
await fs3.rm(oldEntry.installLocation, { recursive: true, force: true });
|
|
391836
391852
|
} else {
|
|
391837
391853
|
logForDebugging(`Skipping cleanup of old installLocation (${oldEntry.installLocation}) — ` + `outside ${cacheDir}. The path is corrupted; leaving it alone and ` + `overwriting the config entry.`, { level: "warn" });
|
|
@@ -391859,7 +391875,7 @@ async function removeMarketplaceSource(name) {
|
|
|
391859
391875
|
}
|
|
391860
391876
|
delete config2[name];
|
|
391861
391877
|
await saveKnownMarketplacesConfig(config2);
|
|
391862
|
-
const fs3 =
|
|
391878
|
+
const fs3 = getFsImplementation2();
|
|
391863
391879
|
const cacheDir = getMarketplacesCacheDir();
|
|
391864
391880
|
const cachePath = join92(cacheDir, name);
|
|
391865
391881
|
await fs3.rm(cachePath, { recursive: true, force: true });
|
|
@@ -391927,7 +391943,7 @@ async function readCachedMarketplace(installLocation) {
|
|
|
391927
391943
|
return await parseFileWithSchema(installLocation, PluginMarketplaceSchema());
|
|
391928
391944
|
}
|
|
391929
391945
|
async function getMarketplaceCacheOnly(name) {
|
|
391930
|
-
const fs3 =
|
|
391946
|
+
const fs3 = getFsImplementation2();
|
|
391931
391947
|
const configFile = getKnownMarketplacesFile();
|
|
391932
391948
|
try {
|
|
391933
391949
|
const content = await fs3.readFile(configFile, { encoding: "utf-8" });
|
|
@@ -391950,7 +391966,7 @@ async function getPluginByIdCacheOnly(pluginId) {
|
|
|
391950
391966
|
if (!pluginName || !marketplaceName) {
|
|
391951
391967
|
return null;
|
|
391952
391968
|
}
|
|
391953
|
-
const fs3 =
|
|
391969
|
+
const fs3 = getFsImplementation2();
|
|
391954
391970
|
const configFile = getKnownMarketplacesFile();
|
|
391955
391971
|
try {
|
|
391956
391972
|
const content = await fs3.readFile(configFile, { encoding: "utf-8" });
|
|
@@ -392221,7 +392237,7 @@ function migrateToSinglePluginFile() {
|
|
|
392221
392237
|
if (migrationCompleted) {
|
|
392222
392238
|
return;
|
|
392223
392239
|
}
|
|
392224
|
-
const fs3 =
|
|
392240
|
+
const fs3 = getFsImplementation2();
|
|
392225
392241
|
const mainFilePath = getInstalledPluginsFilePath();
|
|
392226
392242
|
const v2FilePath = getInstalledPluginsV2FilePath();
|
|
392227
392243
|
try {
|
|
@@ -392268,7 +392284,7 @@ function migrateToSinglePluginFile() {
|
|
|
392268
392284
|
}
|
|
392269
392285
|
}
|
|
392270
392286
|
function cleanupLegacyCache(v2Data) {
|
|
392271
|
-
const fs3 =
|
|
392287
|
+
const fs3 = getFsImplementation2();
|
|
392272
392288
|
const cachePath = getPluginCachePath();
|
|
392273
392289
|
try {
|
|
392274
392290
|
const referencedPaths = new Set;
|
|
@@ -392308,7 +392324,7 @@ function cleanupLegacyCache(v2Data) {
|
|
|
392308
392324
|
}
|
|
392309
392325
|
}
|
|
392310
392326
|
function readInstalledPluginsFileRaw() {
|
|
392311
|
-
const fs3 =
|
|
392327
|
+
const fs3 = getFsImplementation2();
|
|
392312
392328
|
const filePath = getInstalledPluginsFilePath();
|
|
392313
392329
|
let fileContent;
|
|
392314
392330
|
try {
|
|
@@ -392372,7 +392388,7 @@ function loadInstalledPluginsV2() {
|
|
|
392372
392388
|
}
|
|
392373
392389
|
}
|
|
392374
392390
|
function saveInstalledPluginsV2(data) {
|
|
392375
|
-
const fs3 =
|
|
392391
|
+
const fs3 = getFsImplementation2();
|
|
392376
392392
|
const filePath = getInstalledPluginsFilePath();
|
|
392377
392393
|
try {
|
|
392378
392394
|
fs3.mkdirSync(getPluginsDirectory());
|
|
@@ -392542,7 +392558,7 @@ async function getGitCommitSha(dirPath) {
|
|
|
392542
392558
|
return sha ?? undefined;
|
|
392543
392559
|
}
|
|
392544
392560
|
function getPluginVersionFromManifest(pluginCachePath, pluginId) {
|
|
392545
|
-
const fs3 =
|
|
392561
|
+
const fs3 = getFsImplementation2();
|
|
392546
392562
|
const manifestPath = join93(pluginCachePath, ".claude-plugin", "plugin.json");
|
|
392547
392563
|
try {
|
|
392548
392564
|
const manifestContent = fs3.readFileSync(manifestPath, { encoding: "utf-8" });
|
|
@@ -392646,7 +392662,7 @@ async function migrateFromEnabledPlugins() {
|
|
|
392646
392662
|
const pluginCachePath = join93(cachePath, sanitizedName);
|
|
392647
392663
|
let dirEntries;
|
|
392648
392664
|
try {
|
|
392649
|
-
dirEntries = (await
|
|
392665
|
+
dirEntries = (await getFsImplementation2().readdir(pluginCachePath)).map((e2) => typeof e2 === "string" ? e2 : e2.name);
|
|
392650
392666
|
} catch (e2) {
|
|
392651
392667
|
if (!isENOENT(e2))
|
|
392652
392668
|
throw e2;
|
|
@@ -392800,14 +392816,14 @@ async function cacheAndRegisterPlugin(pluginId, entry, scope = "user", projectPa
|
|
|
392800
392816
|
const versionedPath = getVersionedCachePath(pluginId, version2);
|
|
392801
392817
|
let finalPath = cacheResult.path;
|
|
392802
392818
|
if (cacheResult.path !== versionedPath) {
|
|
392803
|
-
await
|
|
392819
|
+
await getFsImplementation2().mkdir(dirname42(versionedPath));
|
|
392804
392820
|
await rm8(versionedPath, { recursive: true, force: true });
|
|
392805
392821
|
const normalizedCachePath = cacheResult.path.endsWith(sep24) ? cacheResult.path : cacheResult.path + sep24;
|
|
392806
392822
|
const isSubdirectory = versionedPath.startsWith(normalizedCachePath);
|
|
392807
392823
|
if (isSubdirectory) {
|
|
392808
392824
|
const tempPath = join94(dirname42(cacheResult.path), `.claude-plugin-temp-${Date.now()}-${randomBytes11(4).toString("hex")}`);
|
|
392809
392825
|
await rename5(cacheResult.path, tempPath);
|
|
392810
|
-
await
|
|
392826
|
+
await getFsImplementation2().mkdir(dirname42(versionedPath));
|
|
392811
392827
|
await rename5(tempPath, versionedPath);
|
|
392812
392828
|
} else {
|
|
392813
392829
|
await rename5(cacheResult.path, versionedPath);
|
|
@@ -393124,7 +393140,7 @@ async function resolvePluginPath(pluginId, version2) {
|
|
|
393124
393140
|
return version2 ? getVersionedCachePath(pluginId, version2) : legacyPath;
|
|
393125
393141
|
}
|
|
393126
393142
|
async function copyDir(src, dest) {
|
|
393127
|
-
await
|
|
393143
|
+
await getFsImplementation2().mkdir(dest);
|
|
393128
393144
|
const entries = await readdir20(src, { withFileTypes: true });
|
|
393129
393145
|
for (const entry of entries) {
|
|
393130
393146
|
const srcPath = join95(src, entry.name);
|
|
@@ -393183,7 +393199,7 @@ async function copyPluginToVersionedCache(sourcePath, pluginId, version2, entry,
|
|
|
393183
393199
|
logForDebugging(`Using seed cache for ${pluginId}@${version2} at ${seedPath}`);
|
|
393184
393200
|
return seedPath;
|
|
393185
393201
|
}
|
|
393186
|
-
await
|
|
393202
|
+
await getFsImplementation2().mkdir(dirname43(cachePath));
|
|
393187
393203
|
if (entry && typeof entry.source === "string" && marketplaceDir) {
|
|
393188
393204
|
const sourceDir = validatePathWithinBase(marketplaceDir, entry.source);
|
|
393189
393205
|
logForDebugging(`Copying source directory ${entry.source} for plugin ${pluginId}`);
|
|
@@ -393231,7 +393247,7 @@ function validateGitUrl(url3) {
|
|
|
393231
393247
|
}
|
|
393232
393248
|
async function installFromNpm(packageName, targetPath, options2 = {}) {
|
|
393233
393249
|
const npmCachePath = join95(getPluginsDirectory(), "npm-cache");
|
|
393234
|
-
await
|
|
393250
|
+
await getFsImplementation2().mkdir(npmCachePath);
|
|
393235
393251
|
const packageSpec = options2.version ? `${packageName}@${options2.version}` : packageName;
|
|
393236
393252
|
const packagePath = join95(npmCachePath, "node_modules", packageName);
|
|
393237
393253
|
const needsInstall = !await pathExists(packagePath);
|
|
@@ -393426,7 +393442,7 @@ function generateTemporaryCacheNameForPlugin(source) {
|
|
|
393426
393442
|
}
|
|
393427
393443
|
async function cachePlugin(source, options2) {
|
|
393428
393444
|
const cachePath = getPluginCachePath();
|
|
393429
|
-
await
|
|
393445
|
+
await getFsImplementation2().mkdir(cachePath);
|
|
393430
393446
|
const tempName = generateTemporaryCacheNameForPlugin(source);
|
|
393431
393447
|
const tempPath = join95(cachePath, tempName);
|
|
393432
393448
|
let shouldCleanup = false;
|
|
@@ -394815,7 +394831,7 @@ async function loadOutputStylesFromDirectory(outputStylesPath, pluginName, loade
|
|
|
394815
394831
|
return styles5;
|
|
394816
394832
|
}
|
|
394817
394833
|
async function loadOutputStyleFromFile(filePath, pluginName, loadedPaths) {
|
|
394818
|
-
const fs3 =
|
|
394834
|
+
const fs3 = getFsImplementation2();
|
|
394819
394835
|
if (isDuplicatePath(fs3, filePath, loadedPaths)) {
|
|
394820
394836
|
return null;
|
|
394821
394837
|
}
|
|
@@ -394876,7 +394892,7 @@ var init_loadPluginOutputStyles = __esm(() => {
|
|
|
394876
394892
|
if (plugin.outputStylesPaths) {
|
|
394877
394893
|
for (const stylePath of plugin.outputStylesPaths) {
|
|
394878
394894
|
try {
|
|
394879
|
-
const fs3 =
|
|
394895
|
+
const fs3 = getFsImplementation2();
|
|
394880
394896
|
const stats = await fs3.stat(stylePath);
|
|
394881
394897
|
if (stats.isDirectory()) {
|
|
394882
394898
|
const styles5 = await loadOutputStylesFromDirectory(stylePath, plugin.name, loadedPaths);
|
|
@@ -395898,7 +395914,7 @@ function stripCallerFieldFromAssistantMessage(message) {
|
|
|
395898
395914
|
id: block2.id,
|
|
395899
395915
|
name: block2.name,
|
|
395900
395916
|
input: block2.input,
|
|
395901
|
-
...
|
|
395917
|
+
...block2.extra_content ? { extra_content: block2.extra_content } : {}
|
|
395902
395918
|
};
|
|
395903
395919
|
})
|
|
395904
395920
|
}
|
|
@@ -396175,7 +396191,7 @@ function normalizeMessagesForAPI(messages, tools = []) {
|
|
|
396175
396191
|
...restBlock,
|
|
396176
396192
|
name: canonicalName,
|
|
396177
396193
|
input: normalizedInput,
|
|
396178
|
-
...
|
|
396194
|
+
...extra_content ? { extra_content } : {}
|
|
396179
396195
|
};
|
|
396180
396196
|
}
|
|
396181
396197
|
return {
|
|
@@ -396183,7 +396199,7 @@ function normalizeMessagesForAPI(messages, tools = []) {
|
|
|
396183
396199
|
id: block2.id,
|
|
396184
396200
|
name: canonicalName,
|
|
396185
396201
|
input: normalizedInput,
|
|
396186
|
-
...
|
|
396202
|
+
...block2.extra_content ? { extra_content: block2.extra_content } : {}
|
|
396187
396203
|
};
|
|
396188
396204
|
}
|
|
396189
396205
|
return block2;
|
|
@@ -398322,7 +398338,6 @@ Goal: Write your final plan to the plan file (the only file you can edit).
|
|
|
398322
398338
|
- End with the single verification command
|
|
398323
398339
|
- **Hard limit: 40 lines.** If the plan is longer, delete prose — not file paths.`;
|
|
398324
398340
|
var init_messages3 = __esm(() => {
|
|
398325
|
-
init_providers();
|
|
398326
398341
|
init_isObject();
|
|
398327
398342
|
init_last();
|
|
398328
398343
|
init_prompt2();
|
|
@@ -401229,7 +401244,7 @@ function isSymlinkTo({
|
|
|
401229
401244
|
processPwd,
|
|
401230
401245
|
originalCwd
|
|
401231
401246
|
}) {
|
|
401232
|
-
const { resolvedPath: resolvedProcessPwd, isSymlink: isProcessPwdSymlink } = safeResolvePath(
|
|
401247
|
+
const { resolvedPath: resolvedProcessPwd, isSymlink: isProcessPwdSymlink } = safeResolvePath(getFsImplementation2(), processPwd);
|
|
401233
401248
|
return isProcessPwdSymlink ? resolvedProcessPwd === resolve35(originalCwd) : false;
|
|
401234
401249
|
}
|
|
401235
401250
|
function initialPermissionModeFromCLI({
|
|
@@ -402153,7 +402168,7 @@ function detectModeEntry(args) {
|
|
|
402153
402168
|
|
|
402154
402169
|
// src/projectOnboardingSteps.ts
|
|
402155
402170
|
function getSteps() {
|
|
402156
|
-
const hasRepoInstructions = findProjectInstructionFilePathInAncestors(getCwd(),
|
|
402171
|
+
const hasRepoInstructions = findProjectInstructionFilePathInAncestors(getCwd(), getFsImplementation2().existsSync) !== null;
|
|
402157
402172
|
const isWorkspaceDirEmpty = isDirEmpty(getCwd());
|
|
402158
402173
|
return [
|
|
402159
402174
|
{
|
|
@@ -405304,7 +405319,7 @@ async function scanDirectory(dirPath) {
|
|
|
405304
405319
|
return cached3;
|
|
405305
405320
|
}
|
|
405306
405321
|
try {
|
|
405307
|
-
const fs3 =
|
|
405322
|
+
const fs3 = getFsImplementation2();
|
|
405308
405323
|
const entries = await fs3.readdir(dirPath);
|
|
405309
405324
|
const directories = entries.filter((entry) => entry.isDirectory() && !entry.name.startsWith(".")).map((entry) => ({
|
|
405310
405325
|
name: entry.name,
|
|
@@ -405341,7 +405356,7 @@ async function scanDirectoryForPaths(dirPath, includeHidden = false) {
|
|
|
405341
405356
|
return cached3;
|
|
405342
405357
|
}
|
|
405343
405358
|
try {
|
|
405344
|
-
const fs3 =
|
|
405359
|
+
const fs3 = getFsImplementation2();
|
|
405345
405360
|
const entries = await fs3.readdir(dirPath);
|
|
405346
405361
|
const paths2 = entries.filter((entry) => includeHidden || !entry.name.startsWith(".")).map((entry) => ({
|
|
405347
405362
|
name: entry.name,
|
|
@@ -407661,7 +407676,7 @@ async function loadRipgrepIgnorePatterns(repoRoot, cwd2) {
|
|
|
407661
407676
|
if (ignorePatternsCacheKey === cacheKey) {
|
|
407662
407677
|
return ignorePatternsCache;
|
|
407663
407678
|
}
|
|
407664
|
-
const fs3 =
|
|
407679
|
+
const fs3 = getFsImplementation2();
|
|
407665
407680
|
const ignoreFiles = [".ignore", ".rgignore"];
|
|
407666
407681
|
const directories = [...new Set([repoRoot, cwd2])];
|
|
407667
407682
|
const ig = import_ignore3.default();
|
|
@@ -407932,7 +407947,7 @@ function startBackgroundCacheRefresh() {
|
|
|
407932
407947
|
});
|
|
407933
407948
|
}
|
|
407934
407949
|
async function getTopLevelPaths() {
|
|
407935
|
-
const fs3 =
|
|
407950
|
+
const fs3 = getFsImplementation2();
|
|
407936
407951
|
const cwd2 = getCwd();
|
|
407937
407952
|
try {
|
|
407938
407953
|
const entries = await fs3.readdir(cwd2);
|
|
@@ -408077,7 +408092,7 @@ Use the Edit tool with file_path: {{docPath}}
|
|
|
408077
408092
|
REMEMBER: Only update if there is substantial new information. The Magic Doc header (# MAGIC DOC: {{docTitle}}) must remain unchanged.`;
|
|
408078
408093
|
}
|
|
408079
408094
|
async function loadMagicDocsPrompt() {
|
|
408080
|
-
const fs3 =
|
|
408095
|
+
const fs3 = getFsImplementation2();
|
|
408081
408096
|
const promptPath = join103(getClaudeConfigHomeDir(), "magic-docs", "prompt.md");
|
|
408082
408097
|
try {
|
|
408083
408098
|
return await fs3.readFile(promptPath, { encoding: "utf-8" });
|
|
@@ -410431,7 +410446,7 @@ function buildPrimarySection() {
|
|
|
410431
410446
|
});
|
|
410432
410447
|
return [{
|
|
410433
410448
|
label: "Version",
|
|
410434
|
-
value: "0.9.
|
|
410449
|
+
value: "0.9.4"
|
|
410435
410450
|
}, {
|
|
410436
410451
|
label: "Session name",
|
|
410437
410452
|
value: nameValue
|
|
@@ -421937,7 +421952,7 @@ function removePathWithRetry(path18, options2) {
|
|
|
421937
421952
|
}
|
|
421938
421953
|
}
|
|
421939
421954
|
function getProviders() {
|
|
421940
|
-
const cwd2 =
|
|
421955
|
+
const cwd2 = getFsImplementation2().cwd();
|
|
421941
421956
|
const projectDir = join109(getProjectsDir(), sanitizePath2(cwd2));
|
|
421942
421957
|
let providers = providerCache.get(projectDir);
|
|
421943
421958
|
if (!providers) {
|
|
@@ -422099,7 +422114,7 @@ function loadProjectGraph(cwd2) {
|
|
|
422099
422114
|
return projectGraph;
|
|
422100
422115
|
}
|
|
422101
422116
|
function getGlobalGraph() {
|
|
422102
|
-
const cwd2 =
|
|
422117
|
+
const cwd2 = getFsImplementation2().cwd();
|
|
422103
422118
|
if (!projectGraph || Object.keys(projectGraph.entities).length === 0 && projectGraph.summaries.length === 0) {
|
|
422104
422119
|
return loadProjectGraph(cwd2);
|
|
422105
422120
|
}
|
|
@@ -422136,7 +422151,7 @@ async function getOrchestratedMemory(query2) {
|
|
|
422136
422151
|
if (queryWords.length === 0) {
|
|
422137
422152
|
return getGlobalGraphSummary();
|
|
422138
422153
|
}
|
|
422139
|
-
await initOrama(
|
|
422154
|
+
await initOrama(getFsImplementation2().cwd());
|
|
422140
422155
|
if (oramaDb) {
|
|
422141
422156
|
try {
|
|
422142
422157
|
const results = await search2(oramaDb, { term: query2, limit: 20 });
|
|
@@ -422276,7 +422291,7 @@ Project Rules:
|
|
|
422276
422291
|
return summary;
|
|
422277
422292
|
}
|
|
422278
422293
|
function resetGlobalGraph() {
|
|
422279
|
-
const cwd2 =
|
|
422294
|
+
const cwd2 = getFsImplementation2().cwd();
|
|
422280
422295
|
const { sqlite, json: json2 } = getProviders();
|
|
422281
422296
|
const emptyGraph = {
|
|
422282
422297
|
entities: {},
|
|
@@ -423098,7 +423113,7 @@ function isGuiEditor(editor) {
|
|
|
423098
423113
|
return classifyGuiEditor(editor) !== undefined;
|
|
423099
423114
|
}
|
|
423100
423115
|
function editFileInEditor(filePath) {
|
|
423101
|
-
const fs3 =
|
|
423116
|
+
const fs3 = getFsImplementation2();
|
|
423102
423117
|
const inkInstance = instances_default.get(process.stdout);
|
|
423103
423118
|
if (!inkInstance) {
|
|
423104
423119
|
throw new Error("Ink instance not found - cannot pause rendering");
|
|
@@ -423164,7 +423179,7 @@ function recollapsePastedContent(editedPrompt, originalPrompt, pastedContents) {
|
|
|
423164
423179
|
return collapsed;
|
|
423165
423180
|
}
|
|
423166
423181
|
function editPromptInEditor(currentPrompt, pastedContents) {
|
|
423167
|
-
const fs3 =
|
|
423182
|
+
const fs3 = getFsImplementation2();
|
|
423168
423183
|
const tempFile = generateTempFilePath();
|
|
423169
423184
|
try {
|
|
423170
423185
|
const expandedPrompt = pastedContents ? expandPastedTextRefs(currentPrompt, pastedContents) : currentPrompt;
|
|
@@ -423358,7 +423373,7 @@ function getReleaseTagUrl(version2 = publicBuildVersion) {
|
|
|
423358
423373
|
return `${VERBOO_RELEASES_URL}/tag/v${normalizePublicVersion(version2)}`;
|
|
423359
423374
|
}
|
|
423360
423375
|
function getPublicBuildVersion() {
|
|
423361
|
-
return "0.9.
|
|
423376
|
+
return "0.9.4";
|
|
423362
423377
|
}
|
|
423363
423378
|
var import_semver9, VERBOO_RELEASES_URL = "https://github.com/verbeux-ai/code/releases", fallbackBuildVersion, publicBuildVersion;
|
|
423364
423379
|
var init_version = __esm(() => {
|
|
@@ -426470,7 +426485,7 @@ async function performPluginUpdate({
|
|
|
426470
426485
|
scope,
|
|
426471
426486
|
projectPath
|
|
426472
426487
|
}) {
|
|
426473
|
-
const fs3 =
|
|
426488
|
+
const fs3 = getFsImplementation2();
|
|
426474
426489
|
const oldVersion = installation.version;
|
|
426475
426490
|
let sourcePath;
|
|
426476
426491
|
let newVersion;
|
|
@@ -435868,7 +435883,7 @@ import { homedir as homedir28 } from "os";
|
|
|
435868
435883
|
import { resolve as resolve38 } from "path";
|
|
435869
435884
|
async function parseMarketplaceInput(input) {
|
|
435870
435885
|
const trimmed = input.trim();
|
|
435871
|
-
const fs3 =
|
|
435886
|
+
const fs3 = getFsImplementation2();
|
|
435872
435887
|
const sshMatch = trimmed.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);
|
|
435873
435888
|
if (sshMatch?.[1]) {
|
|
435874
435889
|
const url3 = sshMatch[1];
|
|
@@ -436206,7 +436221,7 @@ async function saveInstallCountsCache(cache4) {
|
|
|
436206
436221
|
const tempPath = `${cachePath}.${randomBytes14(8).toString("hex")}.tmp`;
|
|
436207
436222
|
try {
|
|
436208
436223
|
const pluginsDir = getPluginsDirectory();
|
|
436209
|
-
await
|
|
436224
|
+
await getFsImplementation2().mkdir(pluginsDir);
|
|
436210
436225
|
const content = jsonStringify(cache4, null, 2);
|
|
436211
436226
|
await writeFile35(tempPath, content, {
|
|
436212
436227
|
encoding: "utf-8",
|
|
@@ -440077,7 +440092,7 @@ async function writeToDisk(plugins) {
|
|
|
440077
440092
|
const filePath = getFlaggedPluginsPath();
|
|
440078
440093
|
const tempPath = `${filePath}.${randomBytes15(8).toString("hex")}.tmp`;
|
|
440079
440094
|
try {
|
|
440080
|
-
await
|
|
440095
|
+
await getFsImplementation2().mkdir(getPluginsDirectory());
|
|
440081
440096
|
const content = jsonStringify({ plugins }, null, 2);
|
|
440082
440097
|
await writeFile36(tempPath, content, {
|
|
440083
440098
|
encoding: "utf-8",
|
|
@@ -478135,7 +478150,7 @@ async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
|
478135
478150
|
rss: ${toGB(diagnostics.memoryUsage.rss)} GB (total process)
|
|
478136
478151
|
${diagnostics.analysis.recommendation}`);
|
|
478137
478152
|
const dumpDir = getDesktopPath();
|
|
478138
|
-
await
|
|
478153
|
+
await getFsImplementation2().mkdir(dumpDir);
|
|
478139
478154
|
const suffix = dumpNumber > 0 ? `-dump${dumpNumber}` : "";
|
|
478140
478155
|
const heapFilename = `${sessionId}${suffix}.heapsnapshot`;
|
|
478141
478156
|
const diagFilename = `${sessionId}${suffix}-diagnostics.json`;
|
|
@@ -478706,7 +478721,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
478706
478721
|
var call63 = async () => {
|
|
478707
478722
|
return {
|
|
478708
478723
|
type: "text",
|
|
478709
|
-
value: `${"99.0.0"} (built ${"2026-05-
|
|
478724
|
+
value: `${"99.0.0"} (built ${"2026-05-19T20:11:05.617Z"})`
|
|
478710
478725
|
};
|
|
478711
478726
|
}, version2, version_default;
|
|
478712
478727
|
var init_version2 = __esm(() => {
|
|
@@ -484633,7 +484648,7 @@ function migrateStatsCache(parsed) {
|
|
|
484633
484648
|
};
|
|
484634
484649
|
}
|
|
484635
484650
|
async function loadStatsCache() {
|
|
484636
|
-
const fs4 =
|
|
484651
|
+
const fs4 = getFsImplementation2();
|
|
484637
484652
|
const cachePath = getStatsCachePath();
|
|
484638
484653
|
try {
|
|
484639
484654
|
const content = await fs4.readFile(cachePath, { encoding: "utf-8" });
|
|
@@ -484667,7 +484682,7 @@ async function loadStatsCache() {
|
|
|
484667
484682
|
}
|
|
484668
484683
|
}
|
|
484669
484684
|
async function saveStatsCache(cache5) {
|
|
484670
|
-
const fs4 =
|
|
484685
|
+
const fs4 = getFsImplementation2();
|
|
484671
484686
|
const cachePath = getStatsCachePath();
|
|
484672
484687
|
const tempPath = `${cachePath}.${randomBytes16(8).toString("hex")}.tmp`;
|
|
484673
484688
|
try {
|
|
@@ -485354,7 +485369,7 @@ import { open as open16 } from "fs/promises";
|
|
|
485354
485369
|
import { basename as basename44, dirname as dirname55, join as join135, sep as sep31 } from "path";
|
|
485355
485370
|
async function processSessionFiles(sessionFiles, options2 = {}) {
|
|
485356
485371
|
const { fromDate, toDate } = options2;
|
|
485357
|
-
const fs4 =
|
|
485372
|
+
const fs4 = getFsImplementation2();
|
|
485358
485373
|
const dailyActivityMap = new Map;
|
|
485359
485374
|
const dailyModelTokensMap = new Map;
|
|
485360
485375
|
const sessions = [];
|
|
@@ -485529,7 +485544,7 @@ async function processSessionFiles(sessionFiles, options2 = {}) {
|
|
|
485529
485544
|
}
|
|
485530
485545
|
async function getAllSessionFiles() {
|
|
485531
485546
|
const projectsDir = getProjectsDir();
|
|
485532
|
-
const fs4 =
|
|
485547
|
+
const fs4 = getFsImplementation2();
|
|
485533
485548
|
let allEntries;
|
|
485534
485549
|
try {
|
|
485535
485550
|
allEntries = await fs4.readdir(projectsDir);
|
|
@@ -490422,7 +490437,7 @@ async function listRemoteAgentMetadata() {
|
|
|
490422
490437
|
function sessionIdExists(sessionId) {
|
|
490423
490438
|
const projectDir = getProjectDir3(getOriginalCwd());
|
|
490424
490439
|
const sessionFile = join137(projectDir, `${sessionId}.jsonl`);
|
|
490425
|
-
const fs4 =
|
|
490440
|
+
const fs4 = getFsImplementation2();
|
|
490426
490441
|
try {
|
|
490427
490442
|
fs4.statSync(sessionFile);
|
|
490428
490443
|
return true;
|
|
@@ -491902,7 +491917,7 @@ async function fetchLogs(limit) {
|
|
|
491902
491917
|
return logs;
|
|
491903
491918
|
}
|
|
491904
491919
|
function appendEntryToFile(fullPath, entry) {
|
|
491905
|
-
const fs4 =
|
|
491920
|
+
const fs4 = getFsImplementation2();
|
|
491906
491921
|
const line = jsonStringify(entry) + `
|
|
491907
491922
|
`;
|
|
491908
491923
|
try {
|
|
@@ -493493,7 +493508,7 @@ function truncateEntrypointContent(raw) {
|
|
|
493493
493508
|
};
|
|
493494
493509
|
}
|
|
493495
493510
|
async function ensureMemoryDirExists(memoryDir) {
|
|
493496
|
-
const fs4 =
|
|
493511
|
+
const fs4 = getFsImplementation2();
|
|
493497
493512
|
try {
|
|
493498
493513
|
await fs4.mkdir(memoryDir);
|
|
493499
493514
|
} catch (e2) {
|
|
@@ -493502,7 +493517,7 @@ async function ensureMemoryDirExists(memoryDir) {
|
|
|
493502
493517
|
}
|
|
493503
493518
|
}
|
|
493504
493519
|
function logMemoryDirCounts(memoryDir, baseMetadata) {
|
|
493505
|
-
const fs4 =
|
|
493520
|
+
const fs4 = getFsImplementation2();
|
|
493506
493521
|
fs4.readdir(memoryDir).then((dirents) => {
|
|
493507
493522
|
let fileCount = 0;
|
|
493508
493523
|
let subdirCount = 0;
|
|
@@ -493582,7 +493597,7 @@ function buildMemoryLines(displayName, memoryDir, extraGuidelines, skipIndex = f
|
|
|
493582
493597
|
}
|
|
493583
493598
|
function buildMemoryPrompt(params) {
|
|
493584
493599
|
const { displayName, memoryDir, extraGuidelines } = params;
|
|
493585
|
-
const fs4 =
|
|
493600
|
+
const fs4 = getFsImplementation2();
|
|
493586
493601
|
const entrypoint = memoryDir + ENTRYPOINT_NAME;
|
|
493587
493602
|
let entrypointContent = "";
|
|
493588
493603
|
try {
|
|
@@ -493890,7 +493905,7 @@ async function ensureScratchpadDir() {
|
|
|
493890
493905
|
if (!isScratchpadEnabled()) {
|
|
493891
493906
|
throw new Error("Scratchpad directory feature is not enabled");
|
|
493892
493907
|
}
|
|
493893
|
-
const fs4 =
|
|
493908
|
+
const fs4 = getFsImplementation2();
|
|
493894
493909
|
const scratchpadDir = getScratchpadDir();
|
|
493895
493910
|
await fs4.mkdir(scratchpadDir, { mode: 448 });
|
|
493896
493911
|
return scratchpadDir;
|
|
@@ -494639,7 +494654,7 @@ var init_filesystem = __esm(() => {
|
|
|
494639
494654
|
DIR_SEP = posix8.sep;
|
|
494640
494655
|
getClaudeTempDir = memoize_default(function getClaudeTempDir2() {
|
|
494641
494656
|
const baseTmpDir = process.env.CLAUDE_CODE_TMPDIR || (getPlatform() === "windows" ? tmpdir9() : "/tmp");
|
|
494642
|
-
const fs4 =
|
|
494657
|
+
const fs4 = getFsImplementation2();
|
|
494643
494658
|
let resolvedBaseTmpDir = baseTmpDir;
|
|
494644
494659
|
try {
|
|
494645
494660
|
resolvedBaseTmpDir = fs4.realpathSync(baseTmpDir);
|
|
@@ -505252,12 +505267,15 @@ async function* ask({
|
|
|
505252
505267
|
orphanedPermission,
|
|
505253
505268
|
...{}
|
|
505254
505269
|
});
|
|
505270
|
+
const { setOpenAIShimRouterStatusHandler: setOpenAIShimRouterStatusHandler2 } = await Promise.resolve().then(() => (init_openaiShim(), exports_openaiShim));
|
|
505271
|
+
setOpenAIShimRouterStatusHandler2(setSDKStatus ? (s) => setSDKStatus(s) : null);
|
|
505255
505272
|
try {
|
|
505256
505273
|
yield* engine.submitMessage(prompt, {
|
|
505257
505274
|
uuid: promptUuid,
|
|
505258
505275
|
isMeta
|
|
505259
505276
|
});
|
|
505260
505277
|
} finally {
|
|
505278
|
+
setOpenAIShimRouterStatusHandler2(null);
|
|
505261
505279
|
setReadFileCache(engine.getReadFileState());
|
|
505262
505280
|
}
|
|
505263
505281
|
}
|
|
@@ -508489,7 +508507,7 @@ function hasManagedSettingsFile() {
|
|
|
508489
508507
|
} catch {}
|
|
508490
508508
|
try {
|
|
508491
508509
|
const dropInDir = getManagedSettingsDropInDir();
|
|
508492
|
-
const entries =
|
|
508510
|
+
const entries = getFsImplementation2().readdirSync(dropInDir);
|
|
508493
508511
|
for (const d of entries) {
|
|
508494
508512
|
if (!(d.isFile() || d.isSymbolicLink()) || !d.name.endsWith(".json") || d.name.startsWith(".")) {
|
|
508495
508513
|
continue;
|
|
@@ -508538,7 +508556,7 @@ function loadManagedFileSettings() {
|
|
|
508538
508556
|
}
|
|
508539
508557
|
const dropInDir = getManagedSettingsDropInDir();
|
|
508540
508558
|
try {
|
|
508541
|
-
const entries =
|
|
508559
|
+
const entries = getFsImplementation2().readdirSync(dropInDir).filter((d) => (d.isFile() || d.isSymbolicLink()) && d.name.endsWith(".json") && !d.name.startsWith(".")).map((d) => d.name).sort();
|
|
508542
508560
|
for (const name of entries) {
|
|
508543
508561
|
const { settings: settings2, errors: fileErrors } = parseSettingsFile(join147(dropInDir, name));
|
|
508544
508562
|
errors4.push(...fileErrors);
|
|
@@ -508561,7 +508579,7 @@ function getManagedFileSettingsPresence() {
|
|
|
508561
508579
|
let hasDropIns = false;
|
|
508562
508580
|
const dropInDir = getManagedSettingsDropInDir();
|
|
508563
508581
|
try {
|
|
508564
|
-
hasDropIns =
|
|
508582
|
+
hasDropIns = getFsImplementation2().readdirSync(dropInDir).some((d) => (d.isFile() || d.isSymbolicLink()) && d.name.endsWith(".json") && !d.name.startsWith("."));
|
|
508565
508583
|
} catch {}
|
|
508566
508584
|
return { hasBase, hasDropIns };
|
|
508567
508585
|
}
|
|
@@ -508589,7 +508607,7 @@ function parseSettingsFile(path21) {
|
|
|
508589
508607
|
}
|
|
508590
508608
|
function parseSettingsFileUncached(path21) {
|
|
508591
508609
|
try {
|
|
508592
|
-
const { resolvedPath } = safeResolvePath(
|
|
508610
|
+
const { resolvedPath } = safeResolvePath(getFsImplementation2(), path21);
|
|
508593
508611
|
const content = readFileSync7(resolvedPath);
|
|
508594
508612
|
if (content.trim() === "") {
|
|
508595
508613
|
return { settings: {}, errors: [] };
|
|
@@ -508720,7 +508738,7 @@ function updateSettingsForSource(source, settings) {
|
|
|
508720
508738
|
return { error: null };
|
|
508721
508739
|
}
|
|
508722
508740
|
try {
|
|
508723
|
-
|
|
508741
|
+
getFsImplementation2().mkdirSync(dirname60(filePath));
|
|
508724
508742
|
let existingSettings = getSettingsForSourceUncached(source);
|
|
508725
508743
|
if (!existingSettings) {
|
|
508726
508744
|
let content = null;
|
|
@@ -509051,7 +509069,7 @@ function rawSettingsContainsKey(key) {
|
|
|
509051
509069
|
continue;
|
|
509052
509070
|
}
|
|
509053
509071
|
try {
|
|
509054
|
-
const { resolvedPath } = safeResolvePath(
|
|
509072
|
+
const { resolvedPath } = safeResolvePath(getFsImplementation2(), filePath);
|
|
509055
509073
|
const content = readFileSync7(resolvedPath);
|
|
509056
509074
|
if (!content.trim()) {
|
|
509057
509075
|
continue;
|
|
@@ -509459,7 +509477,7 @@ function startGlobalConfigFreshnessWatcher() {
|
|
|
509459
509477
|
watchFile3(file2, { interval: CONFIG_FRESHNESS_POLL_MS, persistent: false }, (curr) => {
|
|
509460
509478
|
if (curr.mtimeMs <= globalConfigCache.mtime)
|
|
509461
509479
|
return;
|
|
509462
|
-
|
|
509480
|
+
getFsImplementation2().readFile(file2, { encoding: "utf-8" }).then((content) => {
|
|
509463
509481
|
if (curr.mtimeMs <= globalConfigCache.mtime)
|
|
509464
509482
|
return;
|
|
509465
509483
|
const parsed = safeParseJSON(stripBOM2(content));
|
|
@@ -509494,7 +509512,7 @@ function getGlobalConfig() {
|
|
|
509494
509512
|
try {
|
|
509495
509513
|
let stats2 = null;
|
|
509496
509514
|
try {
|
|
509497
|
-
stats2 =
|
|
509515
|
+
stats2 = getFsImplementation2().statSync(getGlobalClaudeFile());
|
|
509498
509516
|
} catch {}
|
|
509499
509517
|
const config3 = migrateConfigFields(getConfig2(getGlobalClaudeFile(), createDefaultGlobalConfig));
|
|
509500
509518
|
globalConfigCache = {
|
|
@@ -509527,7 +509545,7 @@ function getCustomApiKeyStatus(truncatedApiKey) {
|
|
|
509527
509545
|
}
|
|
509528
509546
|
function saveConfig(file2, config3, defaultConfig) {
|
|
509529
509547
|
const dir = dirname61(file2);
|
|
509530
|
-
const fs4 =
|
|
509548
|
+
const fs4 = getFsImplementation2();
|
|
509531
509549
|
fs4.mkdirSync(dir);
|
|
509532
509550
|
const filteredConfig = pickBy_default(config3, (value, key) => jsonStringify(value) !== jsonStringify(defaultConfig[key]));
|
|
509533
509551
|
writeFileSyncAndFlush_DEPRECATED(file2, jsonStringify(filteredConfig, null, 2), {
|
|
@@ -509541,7 +509559,7 @@ function saveConfig(file2, config3, defaultConfig) {
|
|
|
509541
509559
|
function saveConfigWithLock(file2, createDefault, mergeFn) {
|
|
509542
509560
|
const defaultConfig = createDefault();
|
|
509543
509561
|
const dir = dirname61(file2);
|
|
509544
|
-
const fs4 =
|
|
509562
|
+
const fs4 = getFsImplementation2();
|
|
509545
509563
|
fs4.mkdirSync(dir);
|
|
509546
509564
|
let release2;
|
|
509547
509565
|
try {
|
|
@@ -509654,7 +509672,7 @@ function getConfigBackupDir() {
|
|
|
509654
509672
|
return join149(getClaudeConfigHomeDir(), "backups");
|
|
509655
509673
|
}
|
|
509656
509674
|
function findMostRecentBackup(file2) {
|
|
509657
|
-
const fs4 =
|
|
509675
|
+
const fs4 = getFsImplementation2();
|
|
509658
509676
|
const fileBase = basename48(file2);
|
|
509659
509677
|
const backupDir = getConfigBackupDir();
|
|
509660
509678
|
try {
|
|
@@ -509683,7 +509701,7 @@ function getConfig2(file2, createDefault, throwOnInvalid) {
|
|
|
509683
509701
|
if (!configReadingAllowed && true) {
|
|
509684
509702
|
throw new Error("Config accessed before allowed.");
|
|
509685
509703
|
}
|
|
509686
|
-
const fs4 =
|
|
509704
|
+
const fs4 = getFsImplementation2();
|
|
509687
509705
|
try {
|
|
509688
509706
|
const fileContent = fs4.readFileSync(file2, {
|
|
509689
509707
|
encoding: "utf-8"
|
|
@@ -510866,7 +510884,7 @@ function printStartupScreen(modelOverride) {
|
|
|
510866
510884
|
const home = process.env.HOME || process.env.USERPROFILE || "";
|
|
510867
510885
|
const cwd2 = process.cwd();
|
|
510868
510886
|
const displayCwd = home && cwd2.startsWith(home) ? `~${cwd2.slice(home.length)}` : cwd2;
|
|
510869
|
-
const version3 = "0.9.
|
|
510887
|
+
const version3 = "0.9.4";
|
|
510870
510888
|
const bold2 = `${ESC4}1m`;
|
|
510871
510889
|
const PURPLE = rgb3(...ACCENT);
|
|
510872
510890
|
const SOFT = rgb3(...CREAM);
|
|
@@ -520568,7 +520586,7 @@ function FilePermissionDialog({
|
|
|
520568
520586
|
return null;
|
|
520569
520587
|
}
|
|
520570
520588
|
const expandedPath = expandPath(path22);
|
|
520571
|
-
const fs4 =
|
|
520589
|
+
const fs4 = getFsImplementation2();
|
|
520572
520590
|
const {
|
|
520573
520591
|
resolvedPath,
|
|
520574
520592
|
isSymlink
|
|
@@ -520757,7 +520775,7 @@ function SedEditPermissionRequest(t0) {
|
|
|
520757
520775
|
if ($2[3] !== filePath) {
|
|
520758
520776
|
t1 = (async () => {
|
|
520759
520777
|
const encoding = detectEncodingForResolvedPath(filePath);
|
|
520760
|
-
const raw = await
|
|
520778
|
+
const raw = await getFsImplementation2().readFile(filePath, {
|
|
520761
520779
|
encoding
|
|
520762
520780
|
});
|
|
520763
520781
|
return {
|
|
@@ -524247,7 +524265,7 @@ function NotebookEditToolDiff(props) {
|
|
|
524247
524265
|
const $2 = import_react_compiler_runtime292.c(5);
|
|
524248
524266
|
let t0;
|
|
524249
524267
|
if ($2[0] !== props.notebook_path) {
|
|
524250
|
-
t0 =
|
|
524268
|
+
t0 = getFsImplementation2().readFile(props.notebook_path, {
|
|
524251
524269
|
encoding: "utf-8"
|
|
524252
524270
|
}).then(_temp173).catch(_temp273);
|
|
524253
524271
|
$2[0] = props.notebook_path;
|
|
@@ -529133,7 +529151,7 @@ var init_useVoiceEnabled = __esm(() => {
|
|
|
529133
529151
|
function getSemverPart(version3) {
|
|
529134
529152
|
return `${import_semver12.major(version3, { loose: true })}.${import_semver12.minor(version3, { loose: true })}.${import_semver12.patch(version3, { loose: true })}`;
|
|
529135
529153
|
}
|
|
529136
|
-
function useUpdateNotification(updatedVersion, initialVersion = "0.9.
|
|
529154
|
+
function useUpdateNotification(updatedVersion, initialVersion = "0.9.4") {
|
|
529137
529155
|
const [lastNotifiedSemver, setLastNotifiedSemver] = import_react221.useState(() => getSemverPart(initialVersion));
|
|
529138
529156
|
const [pendingNotification2, setPendingNotification] = import_react221.useState(null);
|
|
529139
529157
|
if (updatedVersion) {
|
|
@@ -529173,7 +529191,7 @@ function AutoUpdater({
|
|
|
529173
529191
|
return;
|
|
529174
529192
|
}
|
|
529175
529193
|
if (false) {}
|
|
529176
|
-
const currentVersion = "0.9.
|
|
529194
|
+
const currentVersion = "0.9.4";
|
|
529177
529195
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
529178
529196
|
let latestVersion = await getLatestVersion(channel2);
|
|
529179
529197
|
const isDisabled = isAutoUpdaterDisabled();
|
|
@@ -529524,17 +529542,17 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
529524
529542
|
const maxVersion = await getMaxVersion();
|
|
529525
529543
|
if (maxVersion && latest && gt(latest, maxVersion)) {
|
|
529526
529544
|
logForDebugging(`PackageManagerAutoUpdater: maxVersion ${maxVersion} is set, capping update from ${latest} to ${maxVersion}`);
|
|
529527
|
-
if (gte("0.9.
|
|
529528
|
-
logForDebugging(`PackageManagerAutoUpdater: current version ${"0.9.
|
|
529545
|
+
if (gte("0.9.4", maxVersion)) {
|
|
529546
|
+
logForDebugging(`PackageManagerAutoUpdater: current version ${"0.9.4"} is already at or above maxVersion ${maxVersion}, skipping update`);
|
|
529529
529547
|
setUpdateAvailable(false);
|
|
529530
529548
|
return;
|
|
529531
529549
|
}
|
|
529532
529550
|
latest = maxVersion;
|
|
529533
529551
|
}
|
|
529534
|
-
const hasUpdate = latest && !gte("0.9.
|
|
529552
|
+
const hasUpdate = latest && !gte("0.9.4", latest) && !shouldSkipVersion(latest);
|
|
529535
529553
|
setUpdateAvailable(!!hasUpdate);
|
|
529536
529554
|
if (hasUpdate) {
|
|
529537
|
-
logForDebugging(`PackageManagerAutoUpdater: Update available ${"0.9.
|
|
529555
|
+
logForDebugging(`PackageManagerAutoUpdater: Update available ${"0.9.4"} -> ${latest}`);
|
|
529538
529556
|
}
|
|
529539
529557
|
};
|
|
529540
529558
|
$2[0] = t1;
|
|
@@ -529568,7 +529586,7 @@ function PackageManagerAutoUpdater(t0) {
|
|
|
529568
529586
|
wrap: "truncate",
|
|
529569
529587
|
children: [
|
|
529570
529588
|
"currentVersion: ",
|
|
529571
|
-
"0.9.
|
|
529589
|
+
"0.9.4"
|
|
529572
529590
|
]
|
|
529573
529591
|
});
|
|
529574
529592
|
$2[3] = verbose;
|
|
@@ -543547,10 +543565,21 @@ function convertStatusMessage(msg) {
|
|
|
543547
543565
|
if (!msg.status) {
|
|
543548
543566
|
return null;
|
|
543549
543567
|
}
|
|
543568
|
+
let content;
|
|
543569
|
+
switch (msg.status) {
|
|
543570
|
+
case "compacting":
|
|
543571
|
+
content = "Compacting conversation…";
|
|
543572
|
+
break;
|
|
543573
|
+
case "warming-up":
|
|
543574
|
+
content = "Warming up vast.ai worker (cold start, ~1–3 min)…";
|
|
543575
|
+
break;
|
|
543576
|
+
default:
|
|
543577
|
+
content = `Status: ${msg.status}`;
|
|
543578
|
+
}
|
|
543550
543579
|
return {
|
|
543551
543580
|
type: "system",
|
|
543552
543581
|
subtype: "informational",
|
|
543553
|
-
content
|
|
543582
|
+
content,
|
|
543554
543583
|
level: "info",
|
|
543555
543584
|
uuid: msg.uuid,
|
|
543556
543585
|
timestamp: new Date().toISOString()
|
|
@@ -543682,6 +543711,7 @@ function useRemoteSession({
|
|
|
543682
543711
|
}, [setAppState]);
|
|
543683
543712
|
const responseTimeoutRef = import_react256.useRef(null);
|
|
543684
543713
|
const isCompactingRef = import_react256.useRef(false);
|
|
543714
|
+
const isWarmingUpRef = import_react256.useRef(false);
|
|
543685
543715
|
const managerRef = import_react256.useRef(null);
|
|
543686
543716
|
const hasUpdatedTitleRef = import_react256.useRef(false);
|
|
543687
543717
|
const sentUUIDsRef = import_react256.useRef(new BoundedUUIDSet(50));
|
|
@@ -543732,10 +543762,13 @@ function useRemoteSession({
|
|
|
543732
543762
|
}
|
|
543733
543763
|
if (sdkMessage.subtype === "status") {
|
|
543734
543764
|
const wasCompacting = isCompactingRef.current;
|
|
543765
|
+
const wasWarming = isWarmingUpRef.current;
|
|
543735
543766
|
isCompactingRef.current = sdkMessage.status === "compacting";
|
|
543736
|
-
|
|
543767
|
+
isWarmingUpRef.current = sdkMessage.status === "warming-up";
|
|
543768
|
+
if (wasCompacting && isCompactingRef.current)
|
|
543769
|
+
return;
|
|
543770
|
+
if (wasWarming && isWarmingUpRef.current)
|
|
543737
543771
|
return;
|
|
543738
|
-
}
|
|
543739
543772
|
}
|
|
543740
543773
|
if (sdkMessage.subtype === "compact_boundary") {
|
|
543741
543774
|
isCompactingRef.current = false;
|
|
@@ -543918,7 +543951,7 @@ function useRemoteSession({
|
|
|
543918
543951
|
}
|
|
543919
543952
|
}
|
|
543920
543953
|
if (!config3?.viewerOnly) {
|
|
543921
|
-
const timeoutMs = isCompactingRef.current ? COMPACTION_TIMEOUT_MS : RESPONSE_TIMEOUT_MS;
|
|
543954
|
+
const timeoutMs = isCompactingRef.current || isWarmingUpRef.current ? COMPACTION_TIMEOUT_MS : RESPONSE_TIMEOUT_MS;
|
|
543922
543955
|
responseTimeoutRef.current = setTimeout((setMessages2, manager2) => {
|
|
543923
543956
|
logForDebugging("[useRemoteSession] Response timeout - attempting reconnect");
|
|
543924
543957
|
const warningMessage = createSystemMessage("Remote session may be unresponsive. Attempting to reconnect…", "warning");
|
|
@@ -544888,12 +544921,12 @@ function convertFileNameToDate(filename) {
|
|
|
544888
544921
|
async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
|
|
544889
544922
|
const result = { messages: 0, errors: 0 };
|
|
544890
544923
|
try {
|
|
544891
|
-
const files2 = await
|
|
544924
|
+
const files2 = await getFsImplementation2().readdir(dirPath);
|
|
544892
544925
|
for (const file2 of files2) {
|
|
544893
544926
|
try {
|
|
544894
544927
|
const timestamp = convertFileNameToDate(file2.name);
|
|
544895
544928
|
if (timestamp < cutoffDate) {
|
|
544896
|
-
await
|
|
544929
|
+
await getFsImplementation2().unlink(join152(dirPath, file2.name));
|
|
544897
544930
|
if (isMessagePath) {
|
|
544898
544931
|
result.messages++;
|
|
544899
544932
|
} else {
|
|
@@ -544912,7 +544945,7 @@ async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
|
|
|
544912
544945
|
return result;
|
|
544913
544946
|
}
|
|
544914
544947
|
async function cleanupOldMessageFiles() {
|
|
544915
|
-
const fsImpl =
|
|
544948
|
+
const fsImpl = getFsImplementation2();
|
|
544916
544949
|
const cutoffDate = getCutoffDate();
|
|
544917
544950
|
const errorPath = CACHE_PATHS.errors();
|
|
544918
544951
|
const baseCachePath = CACHE_PATHS.baseLogs();
|
|
@@ -544953,7 +544986,7 @@ async function cleanupOldSessionFiles() {
|
|
|
544953
544986
|
const cutoffDate = getCutoffDate();
|
|
544954
544987
|
const result = { messages: 0, errors: 0 };
|
|
544955
544988
|
const projectsDir = getProjectsDir();
|
|
544956
|
-
const fsImpl =
|
|
544989
|
+
const fsImpl = getFsImplementation2();
|
|
544957
544990
|
let projectDirents;
|
|
544958
544991
|
try {
|
|
544959
544992
|
projectDirents = await fsImpl.readdir(projectsDir);
|
|
@@ -545035,7 +545068,7 @@ async function cleanupOldSessionFiles() {
|
|
|
545035
545068
|
async function cleanupSingleDirectory(dirPath, extension2, removeEmptyDir = true) {
|
|
545036
545069
|
const cutoffDate = getCutoffDate();
|
|
545037
545070
|
const result = { messages: 0, errors: 0 };
|
|
545038
|
-
const fsImpl =
|
|
545071
|
+
const fsImpl = getFsImplementation2();
|
|
545039
545072
|
let dirents;
|
|
545040
545073
|
try {
|
|
545041
545074
|
dirents = await fsImpl.readdir(dirPath);
|
|
@@ -545064,7 +545097,7 @@ function cleanupOldPlanFiles() {
|
|
|
545064
545097
|
async function cleanupOldFileHistoryBackups() {
|
|
545065
545098
|
const cutoffDate = getCutoffDate();
|
|
545066
545099
|
const result = { messages: 0, errors: 0 };
|
|
545067
|
-
const fsImpl =
|
|
545100
|
+
const fsImpl = getFsImplementation2();
|
|
545068
545101
|
try {
|
|
545069
545102
|
const configDir = getClaudeConfigHomeDir();
|
|
545070
545103
|
const fileHistoryStorageDir = join152(configDir, "file-history");
|
|
@@ -545098,7 +545131,7 @@ async function cleanupOldFileHistoryBackups() {
|
|
|
545098
545131
|
async function cleanupOldSessionEnvDirs() {
|
|
545099
545132
|
const cutoffDate = getCutoffDate();
|
|
545100
545133
|
const result = { messages: 0, errors: 0 };
|
|
545101
|
-
const fsImpl =
|
|
545134
|
+
const fsImpl = getFsImplementation2();
|
|
545102
545135
|
try {
|
|
545103
545136
|
const configDir = getClaudeConfigHomeDir();
|
|
545104
545137
|
const sessionEnvBaseDir = join152(configDir, "session-env");
|
|
@@ -545129,7 +545162,7 @@ async function cleanupOldSessionEnvDirs() {
|
|
|
545129
545162
|
async function cleanupOldDebugLogs() {
|
|
545130
545163
|
const cutoffDate = getCutoffDate();
|
|
545131
545164
|
const result = { messages: 0, errors: 0 };
|
|
545132
|
-
const fsImpl =
|
|
545165
|
+
const fsImpl = getFsImplementation2();
|
|
545133
545166
|
const debugDir = join152(getClaudeConfigHomeDir(), "debug");
|
|
545134
545167
|
let dirents;
|
|
545135
545168
|
try {
|
|
@@ -547440,7 +547473,7 @@ function dispose3() {
|
|
|
547440
547473
|
return closePromise;
|
|
547441
547474
|
}
|
|
547442
547475
|
async function getWatchablePaths() {
|
|
547443
|
-
const fs5 =
|
|
547476
|
+
const fs5 = getFsImplementation2();
|
|
547444
547477
|
const paths2 = [];
|
|
547445
547478
|
const userSkillsPath = getSkillsPath("userSettings", "skills");
|
|
547446
547479
|
if (userSkillsPath) {
|
|
@@ -557793,6 +557826,44 @@ function REPL({
|
|
|
557793
557826
|
const [spinnerMessage, setSpinnerMessage] = import_react314.useState(null);
|
|
557794
557827
|
const [spinnerColor, setSpinnerColor] = import_react314.useState(null);
|
|
557795
557828
|
const [spinnerShimmerColor, setSpinnerShimmerColor] = import_react314.useState(null);
|
|
557829
|
+
import_react314.useEffect(() => {
|
|
557830
|
+
const warmingMessages = [
|
|
557831
|
+
"\uD83D\uDD25 Verboo Intelligence is firing up the engines",
|
|
557832
|
+
"☕ Verboo Intelligence is brewing a fresh cup",
|
|
557833
|
+
"\uD83E\uDDE0 Verboo Intelligence is waking up the neurons",
|
|
557834
|
+
"\uD83D\uDE80 Verboo Intelligence is fueling the rockets",
|
|
557835
|
+
"⚡ Verboo Intelligence is charging its capacitors",
|
|
557836
|
+
"\uD83E\uDDBE Verboo Intelligence is stretching its muscles",
|
|
557837
|
+
"✨ Verboo Intelligence is summoning brilliance",
|
|
557838
|
+
"\uD83C\uDFA9 Verboo Intelligence is putting on the thinking cap",
|
|
557839
|
+
"\uD83E\uDE84 Verboo Intelligence is polishing the wand",
|
|
557840
|
+
"\uD83D\uDD2E Verboo Intelligence is polishing the crystal ball",
|
|
557841
|
+
"\uD83D\uDEE0️ Verboo Intelligence is calibrating sensors",
|
|
557842
|
+
"\uD83D\uDCDA Verboo Intelligence is loading wisdom modules",
|
|
557843
|
+
"\uD83C\uDFAF Verboo Intelligence is locking onto the target",
|
|
557844
|
+
"\uD83C\uDFAC Verboo Intelligence is setting the scene",
|
|
557845
|
+
"\uD83C\uDFAA Verboo Intelligence is rolling out the red carpet"
|
|
557846
|
+
];
|
|
557847
|
+
let cancelled = false;
|
|
557848
|
+
Promise.resolve().then(() => (init_openaiShim(), exports_openaiShim)).then((mod) => {
|
|
557849
|
+
if (cancelled)
|
|
557850
|
+
return;
|
|
557851
|
+
mod.setOpenAIShimRouterStatusHandler((status2) => {
|
|
557852
|
+
if (status2 === "warming-up") {
|
|
557853
|
+
const msg = warmingMessages[Math.floor(Math.random() * warmingMessages.length)];
|
|
557854
|
+
setSpinnerMessage(msg);
|
|
557855
|
+
} else {
|
|
557856
|
+
setSpinnerMessage(null);
|
|
557857
|
+
}
|
|
557858
|
+
});
|
|
557859
|
+
});
|
|
557860
|
+
return () => {
|
|
557861
|
+
cancelled = true;
|
|
557862
|
+
Promise.resolve().then(() => (init_openaiShim(), exports_openaiShim)).then((mod) => {
|
|
557863
|
+
mod.setOpenAIShimRouterStatusHandler(null);
|
|
557864
|
+
});
|
|
557865
|
+
};
|
|
557866
|
+
}, []);
|
|
557796
557867
|
const [isMessageSelectorVisible, setIsMessageSelectorVisible] = import_react314.useState(false);
|
|
557797
557868
|
const [messageSelectorPreselect, setMessageSelectorPreselect] = import_react314.useState(undefined);
|
|
557798
557869
|
const [showCostDialog, setShowCostDialog] = import_react314.useState(false);
|
|
@@ -561960,7 +562031,7 @@ function WelcomeV2() {
|
|
|
561960
562031
|
dimColor: true,
|
|
561961
562032
|
children: [
|
|
561962
562033
|
"v",
|
|
561963
|
-
"0.9.
|
|
562034
|
+
"0.9.4",
|
|
561964
562035
|
" "
|
|
561965
562036
|
]
|
|
561966
562037
|
})
|
|
@@ -562147,7 +562218,7 @@ function WelcomeV2() {
|
|
|
562147
562218
|
dimColor: true,
|
|
562148
562219
|
children: [
|
|
562149
562220
|
"v",
|
|
562150
|
-
"0.9.
|
|
562221
|
+
"0.9.4",
|
|
562151
562222
|
" "
|
|
562152
562223
|
]
|
|
562153
562224
|
})
|
|
@@ -562363,7 +562434,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
562363
562434
|
dimColor: true,
|
|
562364
562435
|
children: [
|
|
562365
562436
|
"v",
|
|
562366
|
-
"0.9.
|
|
562437
|
+
"0.9.4",
|
|
562367
562438
|
" "
|
|
562368
562439
|
]
|
|
562369
562440
|
});
|
|
@@ -562572,7 +562643,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
562572
562643
|
dimColor: true,
|
|
562573
562644
|
children: [
|
|
562574
562645
|
"v",
|
|
562575
|
-
"0.9.
|
|
562646
|
+
"0.9.4",
|
|
562576
562647
|
" "
|
|
562577
562648
|
]
|
|
562578
562649
|
});
|
|
@@ -563572,7 +563643,7 @@ function TrustDialog(t0) {
|
|
|
563572
563643
|
if ($2[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
563573
563644
|
t16 = /* @__PURE__ */ jsx_runtime476.jsx(ThemedText, {
|
|
563574
563645
|
bold: true,
|
|
563575
|
-
children:
|
|
563646
|
+
children: getFsImplementation2().cwd()
|
|
563576
563647
|
});
|
|
563577
563648
|
t17 = /* @__PURE__ */ jsx_runtime476.jsxs(ThemedText, {
|
|
563578
563649
|
children: [
|
|
@@ -568449,10 +568520,10 @@ function getLogWriter(path24) {
|
|
|
568449
568520
|
writer = createJsonlWriter({
|
|
568450
568521
|
writeFn: (content) => {
|
|
568451
568522
|
try {
|
|
568452
|
-
|
|
568523
|
+
getFsImplementation2().appendFileSync(path24, content);
|
|
568453
568524
|
} catch {
|
|
568454
|
-
|
|
568455
|
-
|
|
568525
|
+
getFsImplementation2().mkdirSync(dir);
|
|
568526
|
+
getFsImplementation2().appendFileSync(path24, content);
|
|
568456
568527
|
}
|
|
568457
568528
|
},
|
|
568458
568529
|
flushIntervalMs: 1000,
|
|
@@ -568470,7 +568541,7 @@ function appendToLog(path24, message) {
|
|
|
568470
568541
|
const messageWithTimestamp = {
|
|
568471
568542
|
timestamp: new Date().toISOString(),
|
|
568472
568543
|
...message,
|
|
568473
|
-
cwd:
|
|
568544
|
+
cwd: getFsImplementation2().cwd(),
|
|
568474
568545
|
userType: process.env.USER_TYPE,
|
|
568475
568546
|
sessionId: getSessionId(),
|
|
568476
568547
|
version: "99.0.0"
|
|
@@ -568519,7 +568590,7 @@ function logMCPErrorImpl(serverName, error42) {
|
|
|
568519
568590
|
error: errorStr,
|
|
568520
568591
|
timestamp: new Date().toISOString(),
|
|
568521
568592
|
sessionId: getSessionId(),
|
|
568522
|
-
cwd:
|
|
568593
|
+
cwd: getFsImplementation2().cwd()
|
|
568523
568594
|
};
|
|
568524
568595
|
getLogWriter(logFile).write(errorInfo);
|
|
568525
568596
|
}
|
|
@@ -568530,7 +568601,7 @@ function logMCPDebugImpl(serverName, message) {
|
|
|
568530
568601
|
debug: message,
|
|
568531
568602
|
timestamp: new Date().toISOString(),
|
|
568532
568603
|
sessionId: getSessionId(),
|
|
568533
|
-
cwd:
|
|
568604
|
+
cwd: getFsImplementation2().cwd()
|
|
568534
568605
|
};
|
|
568535
568606
|
getLogWriter(logFile).write(debugInfo);
|
|
568536
568607
|
}
|
|
@@ -568621,7 +568692,7 @@ function shouldExtractMemory(messages) {
|
|
|
568621
568692
|
return false;
|
|
568622
568693
|
}
|
|
568623
568694
|
async function setupSessionMemoryFile(toolUseContext) {
|
|
568624
|
-
const fs5 =
|
|
568695
|
+
const fs5 = getFsImplementation2();
|
|
568625
568696
|
const sessionMemoryDir = getSessionMemoryDir();
|
|
568626
568697
|
await fs5.mkdir(sessionMemoryDir, { mode: 448 });
|
|
568627
568698
|
const memoryPath = getSessionMemoryPath();
|
|
@@ -573143,8 +573214,8 @@ async function installPluginsForHeadless() {
|
|
|
573143
573214
|
clearPluginCache("headlessPluginInstall: seed marketplaces registered");
|
|
573144
573215
|
}
|
|
573145
573216
|
if (zipCacheMode) {
|
|
573146
|
-
await
|
|
573147
|
-
await
|
|
573217
|
+
await getFsImplementation2().mkdir(getZipCacheMarketplacesDir());
|
|
573218
|
+
await getFsImplementation2().mkdir(getZipCachePluginsDir());
|
|
573148
573219
|
}
|
|
573149
573220
|
const declaredCount = Object.keys(getDeclaredMarketplaces()).length;
|
|
573150
573221
|
const metrics = {
|
|
@@ -579984,7 +580055,7 @@ __export(exports_update, {
|
|
|
579984
580055
|
async function update() {
|
|
579985
580056
|
if (getAPIProvider() !== "firstParty") {
|
|
579986
580057
|
writeToStdout(source_default.yellow(`Auto-update is not available for third-party provider builds.
|
|
579987
|
-
`) + `Current version: ${"0.9.
|
|
580058
|
+
`) + `Current version: ${"0.9.4"}
|
|
579988
580059
|
|
|
579989
580060
|
` + `To update, reinstall from npm:
|
|
579990
580061
|
` + source_default.bold(` npm install -g ${"@verboo/code"}@latest`) + `
|
|
@@ -579995,7 +580066,7 @@ async function update() {
|
|
|
579995
580066
|
await gracefulShutdown(0);
|
|
579996
580067
|
}
|
|
579997
580068
|
logEvent("tengu_update_check", {});
|
|
579998
|
-
writeToStdout(`Current version: ${"0.9.
|
|
580069
|
+
writeToStdout(`Current version: ${"0.9.4"}
|
|
579999
580070
|
`);
|
|
580000
580071
|
const channel2 = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
580001
580072
|
writeToStdout(`Checking for updates to ${channel2} version...
|
|
@@ -580080,8 +580151,8 @@ async function update() {
|
|
|
580080
580151
|
writeToStdout(`Verboo Code is managed by Homebrew.
|
|
580081
580152
|
`);
|
|
580082
580153
|
const latest = await getLatestVersion(channel2);
|
|
580083
|
-
if (latest && !gte("0.9.
|
|
580084
|
-
writeToStdout(`Update available: ${"0.9.
|
|
580154
|
+
if (latest && !gte("0.9.4", latest)) {
|
|
580155
|
+
writeToStdout(`Update available: ${"0.9.4"} → ${latest}
|
|
580085
580156
|
`);
|
|
580086
580157
|
writeToStdout(`
|
|
580087
580158
|
`);
|
|
@@ -580097,8 +580168,8 @@ async function update() {
|
|
|
580097
580168
|
writeToStdout(`Verboo Code is managed by winget.
|
|
580098
580169
|
`);
|
|
580099
580170
|
const latest = await getLatestVersion(channel2);
|
|
580100
|
-
if (latest && !gte("0.9.
|
|
580101
|
-
writeToStdout(`Update available: ${"0.9.
|
|
580171
|
+
if (latest && !gte("0.9.4", latest)) {
|
|
580172
|
+
writeToStdout(`Update available: ${"0.9.4"} → ${latest}
|
|
580102
580173
|
`);
|
|
580103
580174
|
writeToStdout(`
|
|
580104
580175
|
`);
|
|
@@ -580114,8 +580185,8 @@ async function update() {
|
|
|
580114
580185
|
writeToStdout(`Verboo Code is managed by apk.
|
|
580115
580186
|
`);
|
|
580116
580187
|
const latest = await getLatestVersion(channel2);
|
|
580117
|
-
if (latest && !gte("0.9.
|
|
580118
|
-
writeToStdout(`Update available: ${"0.9.
|
|
580188
|
+
if (latest && !gte("0.9.4", latest)) {
|
|
580189
|
+
writeToStdout(`Update available: ${"0.9.4"} → ${latest}
|
|
580119
580190
|
`);
|
|
580120
580191
|
writeToStdout(`
|
|
580121
580192
|
`);
|
|
@@ -580168,11 +580239,11 @@ async function update() {
|
|
|
580168
580239
|
`);
|
|
580169
580240
|
await gracefulShutdown(1);
|
|
580170
580241
|
}
|
|
580171
|
-
if (result.latestVersion === "0.9.
|
|
580172
|
-
writeToStdout(source_default.green(`Verboo Code is up to date (${"0.9.
|
|
580242
|
+
if (result.latestVersion === "0.9.4") {
|
|
580243
|
+
writeToStdout(source_default.green(`Verboo Code is up to date (${"0.9.4"})`) + `
|
|
580173
580244
|
`);
|
|
580174
580245
|
} else {
|
|
580175
|
-
writeToStdout(source_default.green(`Successfully updated from ${"0.9.
|
|
580246
|
+
writeToStdout(source_default.green(`Successfully updated from ${"0.9.4"} to version ${result.latestVersion}`) + `
|
|
580176
580247
|
`);
|
|
580177
580248
|
await regenerateCompletionCache();
|
|
580178
580249
|
}
|
|
@@ -580232,12 +580303,12 @@ async function update() {
|
|
|
580232
580303
|
`);
|
|
580233
580304
|
await gracefulShutdown(1);
|
|
580234
580305
|
}
|
|
580235
|
-
if (latestVersion === "0.9.
|
|
580236
|
-
writeToStdout(source_default.green(`Verboo Code is up to date (${"0.9.
|
|
580306
|
+
if (latestVersion === "0.9.4") {
|
|
580307
|
+
writeToStdout(source_default.green(`Verboo Code is up to date (${"0.9.4"})`) + `
|
|
580237
580308
|
`);
|
|
580238
580309
|
await gracefulShutdown(0);
|
|
580239
580310
|
}
|
|
580240
|
-
writeToStdout(`New version available: ${latestVersion} (current: ${"0.9.
|
|
580311
|
+
writeToStdout(`New version available: ${latestVersion} (current: ${"0.9.4"})
|
|
580241
580312
|
`);
|
|
580242
580313
|
writeToStdout(`Installing update...
|
|
580243
580314
|
`);
|
|
@@ -580282,7 +580353,7 @@ async function update() {
|
|
|
580282
580353
|
logForDebugging(`update: Installation status: ${status2}`);
|
|
580283
580354
|
switch (status2) {
|
|
580284
580355
|
case "success":
|
|
580285
|
-
writeToStdout(source_default.green(`Successfully updated from ${"0.9.
|
|
580356
|
+
writeToStdout(source_default.green(`Successfully updated from ${"0.9.4"} to version ${latestVersion}`) + `
|
|
580286
580357
|
`);
|
|
580287
580358
|
await regenerateCompletionCache();
|
|
580288
580359
|
break;
|
|
@@ -580498,7 +580569,7 @@ function loadSettingsFromFlag(settingsFile) {
|
|
|
580498
580569
|
} else {
|
|
580499
580570
|
const {
|
|
580500
580571
|
resolvedPath: resolvedSettingsPath
|
|
580501
|
-
} = safeResolvePath(
|
|
580572
|
+
} = safeResolvePath(getFsImplementation2(), settingsFile);
|
|
580502
580573
|
try {
|
|
580503
580574
|
readFileSync16(resolvedSettingsPath, "utf8");
|
|
580504
580575
|
} catch (e2) {
|
|
@@ -581537,7 +581608,7 @@ ${customInstructions}` : customInstructions;
|
|
|
581537
581608
|
is_native_binary: isInBundledMode()
|
|
581538
581609
|
});
|
|
581539
581610
|
logMemoryDiagnostics("start", {
|
|
581540
|
-
version: "0.9.
|
|
581611
|
+
version: "0.9.4",
|
|
581541
581612
|
debug: debug2,
|
|
581542
581613
|
debugToStderr,
|
|
581543
581614
|
print: print ?? false,
|
|
@@ -582343,7 +582414,7 @@ Usage: verboo --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
582343
582414
|
pendingHookMessages
|
|
582344
582415
|
}, renderAndRun);
|
|
582345
582416
|
}
|
|
582346
|
-
}).version(`0.9.
|
|
582417
|
+
}).version(`0.9.4 (${cliDesc})`, "-v, --version", "Output the version number");
|
|
582347
582418
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
582348
582419
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
582349
582420
|
if (canUserConfigureAdvisor()) {
|
|
@@ -582917,7 +582988,7 @@ if (false) {}
|
|
|
582917
582988
|
async function main2() {
|
|
582918
582989
|
const args = process.argv.slice(2);
|
|
582919
582990
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
582920
|
-
console.log(`${"0.9.
|
|
582991
|
+
console.log(`${"0.9.4"} (Verboo Code)`);
|
|
582921
582992
|
return;
|
|
582922
582993
|
}
|
|
582923
582994
|
if (!IS_VERBOO_CLI && args.includes("--provider")) {
|
|
@@ -583091,4 +583162,4 @@ async function main2() {
|
|
|
583091
583162
|
}
|
|
583092
583163
|
main2();
|
|
583093
583164
|
|
|
583094
|
-
//# debugId=
|
|
583165
|
+
//# debugId=94DCB71FC361235664756E2164756E21
|