@atlasharness/atlascode 0.1.49 → 0.1.51
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.js +815 -341
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -26883,6 +26883,9 @@ function isClientRequestTimeout(err) {
|
|
|
26883
26883
|
return true;
|
|
26884
26884
|
if (e.name === "APIConnectionTimeoutError" || e.name === "APITimeoutError")
|
|
26885
26885
|
return true;
|
|
26886
|
+
const ctorName = e.constructor?.name;
|
|
26887
|
+
if (ctorName === "APIConnectionTimeoutError" || ctorName === "APITimeoutError")
|
|
26888
|
+
return true;
|
|
26886
26889
|
return false;
|
|
26887
26890
|
}
|
|
26888
26891
|
function shouldRetryModelError(err, signal) {
|
|
@@ -27084,7 +27087,7 @@ class OpenAIProvider {
|
|
|
27084
27087
|
}
|
|
27085
27088
|
if (lastErr) {
|
|
27086
27089
|
const message = lastErr instanceof Error ? lastErr.message || lastErr.name : String(lastErr);
|
|
27087
|
-
const code = lastErr
|
|
27090
|
+
const code = isClientRequestTimeout(lastErr) ? "TIMEOUT" : "API_ERROR";
|
|
27088
27091
|
yield { type: "error", code, message, retryable: shouldRetryModelError(lastErr, args.signal) };
|
|
27089
27092
|
return;
|
|
27090
27093
|
}
|
|
@@ -28664,7 +28667,8 @@ var SettingsSchema = () => object({
|
|
|
28664
28667
|
respectGitignore: boolean2().optional(),
|
|
28665
28668
|
defaultShell: union([literal("bash"), literal("powershell")]).optional(),
|
|
28666
28669
|
skipWebFetchPreflight: boolean2().optional(),
|
|
28667
|
-
search: object({ tavilyApiKey: string2().optional() }).optional()
|
|
28670
|
+
search: object({ tavilyApiKey: string2().optional() }).optional(),
|
|
28671
|
+
tui: object({ fullscreen: boolean2().optional() }).optional()
|
|
28668
28672
|
}).passthrough();
|
|
28669
28673
|
var init_types3 = __esm(() => {
|
|
28670
28674
|
init_zod();
|
|
@@ -28831,7 +28835,7 @@ var _provider3 = null;
|
|
|
28831
28835
|
|
|
28832
28836
|
// src/permissions/filesystem.ts
|
|
28833
28837
|
import { tmpdir } from "os";
|
|
28834
|
-
import { join as join4, posix, sep } from "path";
|
|
28838
|
+
import { join as join4, posix, resolve as resolve2, sep } from "path";
|
|
28835
28839
|
function expandPathLocal(path) {
|
|
28836
28840
|
return expandPath(path, getPermissionsBootstrapEnv().getCwd());
|
|
28837
28841
|
}
|
|
@@ -28965,11 +28969,36 @@ function checkPathSafetyForAutoEdit(path, precomputedPathsToCheck) {
|
|
|
28965
28969
|
}
|
|
28966
28970
|
return { safe: true };
|
|
28967
28971
|
}
|
|
28972
|
+
function isActiveWorktreeCwd(cwd) {
|
|
28973
|
+
const cached = worktreeCwdProbeCache.get(cwd);
|
|
28974
|
+
if (cached !== undefined) {
|
|
28975
|
+
return cached;
|
|
28976
|
+
}
|
|
28977
|
+
let active = false;
|
|
28978
|
+
try {
|
|
28979
|
+
const content = getFsImplementation().readFileSync(join4(cwd, ".git"), { encoding: "utf8" });
|
|
28980
|
+
const gitdirMatch = content.match(/^gitdir:\s*(.+)$/m);
|
|
28981
|
+
if (gitdirMatch?.[1]) {
|
|
28982
|
+
const gitdir = resolve2(cwd, gitdirMatch[1].trim());
|
|
28983
|
+
active = gitdir.lastIndexOf(sep + ".git" + sep + "worktrees" + sep) > 0;
|
|
28984
|
+
}
|
|
28985
|
+
} catch {
|
|
28986
|
+
active = false;
|
|
28987
|
+
}
|
|
28988
|
+
worktreeCwdProbeCache.set(cwd, active);
|
|
28989
|
+
return active;
|
|
28990
|
+
}
|
|
28968
28991
|
function allWorkingDirectories(context) {
|
|
28969
|
-
|
|
28970
|
-
|
|
28992
|
+
const originalCwd = getPermissionsBootstrapEnv().getOriginalCwd();
|
|
28993
|
+
const dirs = [
|
|
28994
|
+
originalCwd,
|
|
28971
28995
|
...context.additionalWorkingDirectories.keys()
|
|
28972
|
-
]
|
|
28996
|
+
];
|
|
28997
|
+
const cwd = getPermissionsBootstrapEnv().getCwd();
|
|
28998
|
+
if (cwd !== originalCwd && isActiveWorktreeCwd(cwd)) {
|
|
28999
|
+
dirs.push(cwd);
|
|
29000
|
+
}
|
|
29001
|
+
return new Set(dirs);
|
|
28973
29002
|
}
|
|
28974
29003
|
function getResolvedWorkingDirPaths(workingPath) {
|
|
28975
29004
|
const cached = _resolvedWorkingDirCache.get(workingPath);
|
|
@@ -29194,7 +29223,7 @@ function checkWritePermissionForTool(tool, input, toolPermissionContext, precomp
|
|
|
29194
29223
|
} : undefined
|
|
29195
29224
|
};
|
|
29196
29225
|
}
|
|
29197
|
-
var DANGEROUS_FILES, DANGEROUS_DIRECTORIES, _atlasTempDir = null, _resolvedWorkingDirCache;
|
|
29226
|
+
var DANGEROUS_FILES, DANGEROUS_DIRECTORIES, _atlasTempDir = null, worktreeCwdProbeCache, _resolvedWorkingDirCache;
|
|
29198
29227
|
var init_filesystem = __esm(() => {
|
|
29199
29228
|
init_shared();
|
|
29200
29229
|
DANGEROUS_FILES = [
|
|
@@ -29216,6 +29245,7 @@ var init_filesystem = __esm(() => {
|
|
|
29216
29245
|
".idea",
|
|
29217
29246
|
getConfigDirName()
|
|
29218
29247
|
];
|
|
29248
|
+
worktreeCwdProbeCache = new Map;
|
|
29219
29249
|
_resolvedWorkingDirCache = new Map;
|
|
29220
29250
|
});
|
|
29221
29251
|
|
|
@@ -30129,7 +30159,7 @@ var init_permissionUpdateSchema = __esm(() => {
|
|
|
30129
30159
|
|
|
30130
30160
|
// src/permissions/pathValidation.ts
|
|
30131
30161
|
import { homedir as homedir3 } from "os";
|
|
30132
|
-
import { dirname as dirname2, isAbsolute as isAbsolute2, resolve as
|
|
30162
|
+
import { dirname as dirname2, isAbsolute as isAbsolute2, resolve as resolve3 } from "path";
|
|
30133
30163
|
function formatDirectoryList(directories) {
|
|
30134
30164
|
const dirCount = directories.length;
|
|
30135
30165
|
if (dirCount <= MAX_DIRS_TO_LIST) {
|
|
@@ -30258,7 +30288,7 @@ function isPathAllowed(resolvedPath, context, operationType, precomputedPathsToC
|
|
|
30258
30288
|
}
|
|
30259
30289
|
function validateGlobPattern(cleanPath, cwd, toolPermissionContext, operationType) {
|
|
30260
30290
|
if (containsPathTraversal(cleanPath)) {
|
|
30261
|
-
const absolutePath = isAbsolute2(cleanPath) ? cleanPath :
|
|
30291
|
+
const absolutePath = isAbsolute2(cleanPath) ? cleanPath : resolve3(cwd, cleanPath);
|
|
30262
30292
|
const { resolvedPath, isCanonical } = safeResolvePath2(absolutePath);
|
|
30263
30293
|
const result = isPathAllowed(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
|
|
30264
30294
|
return {
|
|
@@ -30268,7 +30298,7 @@ function validateGlobPattern(cleanPath, cwd, toolPermissionContext, operationTyp
|
|
|
30268
30298
|
};
|
|
30269
30299
|
}
|
|
30270
30300
|
const basePath = getGlobBaseDirectory(cleanPath);
|
|
30271
|
-
const absoluteBasePath = isAbsolute2(basePath) ? basePath :
|
|
30301
|
+
const absoluteBasePath = isAbsolute2(basePath) ? basePath : resolve3(cwd, basePath);
|
|
30272
30302
|
const { resolvedPath, isCanonical } = safeResolvePath2(absoluteBasePath);
|
|
30273
30303
|
const result = isPathAllowed(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
|
|
30274
30304
|
return {
|
|
@@ -30347,7 +30377,7 @@ function validatePath(path, cwd, toolPermissionContext, operationType) {
|
|
|
30347
30377
|
}
|
|
30348
30378
|
return validateGlobPattern(cleanPath, cwd, toolPermissionContext, operationType);
|
|
30349
30379
|
}
|
|
30350
|
-
const absolutePath = isAbsolute2(cleanPath) ? cleanPath :
|
|
30380
|
+
const absolutePath = isAbsolute2(cleanPath) ? cleanPath : resolve3(cwd, cleanPath);
|
|
30351
30381
|
const { resolvedPath, isCanonical } = safeResolvePath2(absolutePath);
|
|
30352
30382
|
const result = isPathAllowed(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
|
|
30353
30383
|
return {
|
|
@@ -30936,7 +30966,7 @@ var init_validation = __esm(() => {
|
|
|
30936
30966
|
});
|
|
30937
30967
|
|
|
30938
30968
|
// src/engine/config/settings.ts
|
|
30939
|
-
import { dirname as dirname3, join as join5, resolve as
|
|
30969
|
+
import { dirname as dirname3, join as join5, resolve as resolve4 } from "path";
|
|
30940
30970
|
function getManagedSettingsFilePath() {
|
|
30941
30971
|
return join5(getManagedSettingsDir(), "managed-settings.json");
|
|
30942
30972
|
}
|
|
@@ -31022,14 +31052,14 @@ function parseSettingsFileUncached(path) {
|
|
|
31022
31052
|
function getSettingsRootPathForSource(source) {
|
|
31023
31053
|
switch (source) {
|
|
31024
31054
|
case "userSettings":
|
|
31025
|
-
return
|
|
31055
|
+
return resolve4(getAtlasConfigHomeDir());
|
|
31026
31056
|
case "policySettings":
|
|
31027
|
-
return
|
|
31057
|
+
return resolve4(getManagedSettingsDir());
|
|
31028
31058
|
case "projectSettings":
|
|
31029
31059
|
case "localSettings":
|
|
31030
|
-
return
|
|
31060
|
+
return resolve4(process.cwd());
|
|
31031
31061
|
case "flagSettings":
|
|
31032
|
-
return
|
|
31062
|
+
return resolve4(process.cwd());
|
|
31033
31063
|
}
|
|
31034
31064
|
}
|
|
31035
31065
|
function getUserSettingsFilePath() {
|
|
@@ -31159,7 +31189,7 @@ function loadSettingsFromDisk() {
|
|
|
31159
31189
|
}
|
|
31160
31190
|
const filePath = getSettingsFilePathForSource(source);
|
|
31161
31191
|
if (filePath) {
|
|
31162
|
-
const resolvedPath =
|
|
31192
|
+
const resolvedPath = resolve4(filePath);
|
|
31163
31193
|
if (!seenFiles.has(resolvedPath)) {
|
|
31164
31194
|
seenFiles.add(resolvedPath);
|
|
31165
31195
|
const { settings, errors } = parseSettingsFile(filePath);
|
|
@@ -33081,10 +33111,15 @@ class Project {
|
|
|
33081
33111
|
}
|
|
33082
33112
|
async appendToFile(filePath, data) {
|
|
33083
33113
|
try {
|
|
33084
|
-
|
|
33085
|
-
|
|
33086
|
-
|
|
33087
|
-
|
|
33114
|
+
try {
|
|
33115
|
+
await fsAppendFile(filePath, data, { mode: 384 });
|
|
33116
|
+
} catch {
|
|
33117
|
+
await mkdir(dirname6(filePath), { recursive: true, mode: 448 });
|
|
33118
|
+
await fsAppendFile(filePath, data, { mode: 384 });
|
|
33119
|
+
}
|
|
33120
|
+
} catch (err) {
|
|
33121
|
+
const code = err?.code;
|
|
33122
|
+
logForDebugging(`transcript write failed: ${filePath} — ${code ?? String(err)}`, { level: "error" });
|
|
33088
33123
|
}
|
|
33089
33124
|
}
|
|
33090
33125
|
async drainWriteQueue() {
|
|
@@ -46009,12 +46044,22 @@ var init_bashCommandHelpers = __esm(() => {
|
|
|
46009
46044
|
});
|
|
46010
46045
|
|
|
46011
46046
|
// src/engine/tools/bash/bashReadOnly.ts
|
|
46012
|
-
function
|
|
46047
|
+
function matchReadOnlyPrefix(command) {
|
|
46013
46048
|
const trimmed = command.trim();
|
|
46014
46049
|
if (trimmed.includes("&&") || trimmed.includes("||") || trimmed.includes(";") || trimmed.includes("|") || trimmed.includes("`") || trimmed.includes("$(") || trimmed.includes(">")) {
|
|
46015
|
-
return
|
|
46050
|
+
return null;
|
|
46016
46051
|
}
|
|
46017
|
-
|
|
46052
|
+
let best = null;
|
|
46053
|
+
for (const p of READ_ONLY_PREFIXES) {
|
|
46054
|
+
if (trimmed === p || trimmed.startsWith(p + " ")) {
|
|
46055
|
+
if (best === null || p.length > best.length)
|
|
46056
|
+
best = p;
|
|
46057
|
+
}
|
|
46058
|
+
}
|
|
46059
|
+
return best;
|
|
46060
|
+
}
|
|
46061
|
+
function isReadOnlyCommand(command) {
|
|
46062
|
+
return matchReadOnlyPrefix(command) !== null;
|
|
46018
46063
|
}
|
|
46019
46064
|
var READ_ONLY_PREFIXES;
|
|
46020
46065
|
var init_bashReadOnly = __esm(() => {
|
|
@@ -46450,9 +46495,9 @@ var init_permissionPersist = __esm(() => {
|
|
|
46450
46495
|
|
|
46451
46496
|
// src/engine/tools/bash/pathHelpers.ts
|
|
46452
46497
|
import { statSync as statSync2 } from "fs";
|
|
46453
|
-
import { dirname as dirname7, isAbsolute as isAbsolute3, resolve as
|
|
46498
|
+
import { dirname as dirname7, isAbsolute as isAbsolute3, resolve as resolve5 } from "path";
|
|
46454
46499
|
function getDirectoryForPath(path) {
|
|
46455
|
-
const absolutePath = isAbsolute3(path) ? path :
|
|
46500
|
+
const absolutePath = isAbsolute3(path) ? path : resolve5(getCwd(), path);
|
|
46456
46501
|
if (absolutePath.startsWith("\\\\") || absolutePath.startsWith("//")) {
|
|
46457
46502
|
return dirname7(absolutePath);
|
|
46458
46503
|
}
|
|
@@ -46470,13 +46515,13 @@ var init_pathHelpers = __esm(() => {
|
|
|
46470
46515
|
|
|
46471
46516
|
// src/engine/tools/bash/pathValidation.ts
|
|
46472
46517
|
import { homedir as homedir6 } from "os";
|
|
46473
|
-
import { isAbsolute as isAbsolute4, resolve as
|
|
46518
|
+
import { isAbsolute as isAbsolute4, resolve as resolve6 } from "path";
|
|
46474
46519
|
function checkDangerousRemovalPaths(command, args, cwd) {
|
|
46475
46520
|
const extractor = PATH_EXTRACTORS[command];
|
|
46476
46521
|
const paths = extractor(args);
|
|
46477
46522
|
for (const path of paths) {
|
|
46478
46523
|
const cleanPath = expandTilde(path.replace(/^['"]|['"]$/g, ""));
|
|
46479
|
-
const absolutePath = isAbsolute4(cleanPath) ? cleanPath :
|
|
46524
|
+
const absolutePath = isAbsolute4(cleanPath) ? cleanPath : resolve6(cwd, cleanPath);
|
|
46480
46525
|
if (isDangerousRemovalPath(absolutePath)) {
|
|
46481
46526
|
return {
|
|
46482
46527
|
behavior: "ask",
|
|
@@ -49619,7 +49664,7 @@ var init_shellProvider = () => {};
|
|
|
49619
49664
|
// src/executor/shell/Shell.ts
|
|
49620
49665
|
import { execFileSync, spawn } from "child_process";
|
|
49621
49666
|
import { accessSync, constants as fsConstants2 } from "fs";
|
|
49622
|
-
import { dirname as dirname8, isAbsolute as isAbsolute5, join as join13, resolve as
|
|
49667
|
+
import { dirname as dirname8, isAbsolute as isAbsolute5, join as join13, resolve as resolve7 } from "path";
|
|
49623
49668
|
function isExecutable(shellPath) {
|
|
49624
49669
|
try {
|
|
49625
49670
|
accessSync(shellPath, fsConstants2.X_OK);
|
|
@@ -49773,7 +49818,7 @@ async function exec(command, abortSignal, options) {
|
|
|
49773
49818
|
function setCwd(path, relativeTo) {
|
|
49774
49819
|
const bootstrap = getBootstrapStatePort();
|
|
49775
49820
|
const fsOps = getFsImplementation();
|
|
49776
|
-
const resolved = isAbsolute5(path) ? path :
|
|
49821
|
+
const resolved = isAbsolute5(path) ? path : resolve7(relativeTo || bootstrap.getCwd(), path);
|
|
49777
49822
|
let physicalPath;
|
|
49778
49823
|
try {
|
|
49779
49824
|
physicalPath = fsOps.realpathSync(resolved);
|
|
@@ -51871,7 +51916,7 @@ var init_config3 = __esm(() => {
|
|
|
51871
51916
|
});
|
|
51872
51917
|
|
|
51873
51918
|
// src/engine/permissions/permissionSetup.ts
|
|
51874
|
-
import { resolve as
|
|
51919
|
+
import { resolve as resolve8 } from "path";
|
|
51875
51920
|
function parseBaseToolsFromCLI(baseTools, deps = {}) {
|
|
51876
51921
|
const joinedInput = baseTools.join(" ").trim();
|
|
51877
51922
|
const preset = parseToolPreset(joinedInput);
|
|
@@ -51885,7 +51930,7 @@ function isSymlinkTo({
|
|
|
51885
51930
|
originalCwd
|
|
51886
51931
|
}) {
|
|
51887
51932
|
const { resolvedPath: resolvedProcessPwd, isSymlink: isProcessPwdSymlink } = safeResolvePath(getFsImplementation(), processPwd);
|
|
51888
|
-
return isProcessPwdSymlink ? resolvedProcessPwd ===
|
|
51933
|
+
return isProcessPwdSymlink ? resolvedProcessPwd === resolve8(originalCwd) : false;
|
|
51889
51934
|
}
|
|
51890
51935
|
function initialPermissionModeFromCLI({
|
|
51891
51936
|
permissionModeCli,
|
|
@@ -54344,7 +54389,7 @@ import {
|
|
|
54344
54389
|
join as join15,
|
|
54345
54390
|
normalize,
|
|
54346
54391
|
relative,
|
|
54347
|
-
resolve as
|
|
54392
|
+
resolve as resolve9,
|
|
54348
54393
|
sep as sep2
|
|
54349
54394
|
} from "path";
|
|
54350
54395
|
function getFileModificationTime(filePath) {
|
|
@@ -54472,7 +54517,7 @@ function writeFileSyncAndFlush_DEPRECATED(filePath, content, options = { encodin
|
|
|
54472
54517
|
let targetPath = filePath;
|
|
54473
54518
|
try {
|
|
54474
54519
|
const linkTarget = fs.readlinkSync(filePath);
|
|
54475
|
-
targetPath = isAbsolute6(linkTarget) ? linkTarget :
|
|
54520
|
+
targetPath = isAbsolute6(linkTarget) ? linkTarget : resolve9(dirname9(filePath), linkTarget);
|
|
54476
54521
|
logForDebugging(`Writing through symlink: ${filePath} -> ${targetPath}`);
|
|
54477
54522
|
} catch {}
|
|
54478
54523
|
const tempPath = `${targetPath}.tmp.${process.pid}.${Date.now()}`;
|
|
@@ -55290,7 +55335,7 @@ var init_sandbox_backend = __esm(() => {
|
|
|
55290
55335
|
// src/sandbox/createSandboxManager.ts
|
|
55291
55336
|
import { rmSync, statSync as statSync3 } from "fs";
|
|
55292
55337
|
import { readFile as readFile3 } from "fs/promises";
|
|
55293
|
-
import { join as join16, resolve as
|
|
55338
|
+
import { join as join16, resolve as resolve11, sep as sep3 } from "path";
|
|
55294
55339
|
function memoizeNoArg2(fn) {
|
|
55295
55340
|
let cached = false;
|
|
55296
55341
|
let value;
|
|
@@ -55333,18 +55378,18 @@ function createSandboxManager(deps, backend) {
|
|
|
55333
55378
|
const cwd = deps.getCwd();
|
|
55334
55379
|
const originalCwd = deps.getOriginalCwd();
|
|
55335
55380
|
if (cwd !== originalCwd) {
|
|
55336
|
-
denyWrite.push(
|
|
55337
|
-
denyWrite.push(
|
|
55381
|
+
denyWrite.push(resolve11(cwd, deps.getConfigDirName(), "settings.json"));
|
|
55382
|
+
denyWrite.push(resolve11(cwd, deps.getConfigDirName(), "settings.local.json"));
|
|
55338
55383
|
}
|
|
55339
|
-
denyWrite.push(
|
|
55384
|
+
denyWrite.push(resolve11(originalCwd, deps.getConfigDirName(), "skills"));
|
|
55340
55385
|
if (cwd !== originalCwd) {
|
|
55341
|
-
denyWrite.push(
|
|
55386
|
+
denyWrite.push(resolve11(cwd, deps.getConfigDirName(), "skills"));
|
|
55342
55387
|
}
|
|
55343
55388
|
bareGitRepoScrubPaths.length = 0;
|
|
55344
55389
|
const bareGitRepoFiles = ["HEAD", "objects", "refs", "hooks", "config"];
|
|
55345
55390
|
for (const dir of cwd === originalCwd ? [originalCwd] : [originalCwd, cwd]) {
|
|
55346
55391
|
for (const gitFile of bareGitRepoFiles) {
|
|
55347
|
-
const p =
|
|
55392
|
+
const p = resolve11(dir, gitFile);
|
|
55348
55393
|
try {
|
|
55349
55394
|
statSync3(p);
|
|
55350
55395
|
denyWrite.push(p);
|
|
@@ -55413,7 +55458,7 @@ function createSandboxManager(deps, backend) {
|
|
|
55413
55458
|
if (!gitdirMatch?.[1]) {
|
|
55414
55459
|
return null;
|
|
55415
55460
|
}
|
|
55416
|
-
const gitdir =
|
|
55461
|
+
const gitdir = resolve11(cwd, gitdirMatch[1].trim());
|
|
55417
55462
|
const marker = sep3 + ".git" + sep3 + "worktrees" + sep3;
|
|
55418
55463
|
const markerIndex = gitdir.lastIndexOf(marker);
|
|
55419
55464
|
if (markerIndex > 0) {
|
|
@@ -68270,7 +68315,7 @@ var init_mcp2 = __esm(() => {
|
|
|
68270
68315
|
var PROMPT = `Completely replaces the contents of a specific cell in a Jupyter notebook (.ipynb file) with new source. Jupyter notebooks are interactive documents that combine code, text, and visualizations, commonly used for data analysis and scientific computing. The notebook_path parameter must be an absolute path, not a relative path. The cell_number is 0-indexed. Use edit_mode=insert to add a new cell at the index specified by cell_number. Use edit_mode=delete to delete the cell at the index specified by cell_number.`;
|
|
68271
68316
|
|
|
68272
68317
|
// src/engine/tools/notebook/notebookEditTool.ts
|
|
68273
|
-
import { extname as extname4, isAbsolute as isAbsolute9, resolve as
|
|
68318
|
+
import { extname as extname4, isAbsolute as isAbsolute9, resolve as resolve12 } from "path";
|
|
68274
68319
|
var NOTEBOOK_EDIT_TOOL_INPUT_SCHEMA, NotebookEditTool;
|
|
68275
68320
|
var init_notebookEditTool = __esm(() => {
|
|
68276
68321
|
init_shared();
|
|
@@ -68386,7 +68431,7 @@ var init_notebookEditTool = __esm(() => {
|
|
|
68386
68431
|
edit_mode = "replace"
|
|
68387
68432
|
} = input;
|
|
68388
68433
|
const ctx = context;
|
|
68389
|
-
const fullPath = isAbsolute9(notebook_path) ? notebook_path :
|
|
68434
|
+
const fullPath = isAbsolute9(notebook_path) ? notebook_path : resolve12(getCwd(), notebook_path);
|
|
68390
68435
|
if (fullPath.startsWith("\\\\") || fullPath.startsWith("//")) {
|
|
68391
68436
|
return { result: true };
|
|
68392
68437
|
}
|
|
@@ -68490,7 +68535,7 @@ var init_notebookEditTool = __esm(() => {
|
|
|
68490
68535
|
} = args ?? {};
|
|
68491
68536
|
let cell_type = inputCellType;
|
|
68492
68537
|
const { readFileState } = context;
|
|
68493
|
-
const fullPath = isAbsolute9(notebook_path) ? notebook_path :
|
|
68538
|
+
const fullPath = isAbsolute9(notebook_path) ? notebook_path : resolve12(getCwd(), notebook_path);
|
|
68494
68539
|
try {
|
|
68495
68540
|
const { content, encoding, lineEndings } = readFileSyncWithMetadata(fullPath);
|
|
68496
68541
|
let notebook;
|
|
@@ -74905,7 +74950,7 @@ var init_skillModel = __esm(() => {
|
|
|
74905
74950
|
import { execFile as execFile5 } from "child_process";
|
|
74906
74951
|
import { readFileSync as readFileSync8, realpathSync as realpathSync4, statSync as statSync4 } from "fs";
|
|
74907
74952
|
import { readFile as readFile9, stat as stat6 } from "fs/promises";
|
|
74908
|
-
import { basename as basename6, dirname as dirname15, join as join29, resolve as
|
|
74953
|
+
import { basename as basename6, dirname as dirname15, join as join29, resolve as resolve13, sep as sep6 } from "path";
|
|
74909
74954
|
function getErrorMessage(code, signal) {
|
|
74910
74955
|
if (signal)
|
|
74911
74956
|
return signal;
|
|
@@ -74967,7 +75012,7 @@ function gitExe() {
|
|
|
74967
75012
|
function findGitRootImpl(startPath) {
|
|
74968
75013
|
if (typeof startPath !== "string")
|
|
74969
75014
|
startPath = String(startPath || "/tmp");
|
|
74970
|
-
let current =
|
|
75015
|
+
let current = resolve13(startPath);
|
|
74971
75016
|
const root = current.substring(0, current.indexOf(sep6) + 1) || sep6;
|
|
74972
75017
|
while (current !== root) {
|
|
74973
75018
|
try {
|
|
@@ -75006,9 +75051,9 @@ function resolveCanonicalRoot(gitRoot) {
|
|
|
75006
75051
|
if (!gitContent.startsWith("gitdir:")) {
|
|
75007
75052
|
return gitRoot;
|
|
75008
75053
|
}
|
|
75009
|
-
const worktreeGitDir =
|
|
75010
|
-
const commonDir =
|
|
75011
|
-
if (
|
|
75054
|
+
const worktreeGitDir = resolve13(gitRoot, gitContent.slice("gitdir:".length).trim());
|
|
75055
|
+
const commonDir = resolve13(worktreeGitDir, readFileSync8(join29(worktreeGitDir, "commondir"), "utf-8").trim());
|
|
75056
|
+
if (resolve13(dirname15(worktreeGitDir)) !== join29(commonDir, "worktrees")) {
|
|
75012
75057
|
return gitRoot;
|
|
75013
75058
|
}
|
|
75014
75059
|
const backlink = realpathSync4(readFileSync8(join29(worktreeGitDir, "gitdir"), "utf-8").trim());
|
|
@@ -75037,7 +75082,7 @@ function findCanonicalGitRoot(startPath) {
|
|
|
75037
75082
|
return resolved;
|
|
75038
75083
|
}
|
|
75039
75084
|
async function resolveGitDir(startPath) {
|
|
75040
|
-
const cwd =
|
|
75085
|
+
const cwd = resolve13(startPath ?? process.cwd());
|
|
75041
75086
|
const cached = resolveGitDirCache.get(cwd);
|
|
75042
75087
|
if (cached !== undefined) {
|
|
75043
75088
|
return cached;
|
|
@@ -75054,7 +75099,7 @@ async function resolveGitDir(startPath) {
|
|
|
75054
75099
|
const content = (await readFile9(gitPath, "utf-8")).trim();
|
|
75055
75100
|
if (content.startsWith("gitdir:")) {
|
|
75056
75101
|
const rawDir = content.slice("gitdir:".length).trim();
|
|
75057
|
-
const resolved =
|
|
75102
|
+
const resolved = resolve13(root, rawDir);
|
|
75058
75103
|
resolveGitDirCache.set(cwd, resolved);
|
|
75059
75104
|
return resolved;
|
|
75060
75105
|
}
|
|
@@ -75158,7 +75203,7 @@ async function resolveRefInDir(dir, ref) {
|
|
|
75158
75203
|
async function getCommonDir(gitDir) {
|
|
75159
75204
|
try {
|
|
75160
75205
|
const content = (await readFile9(join29(gitDir, "commondir"), "utf-8")).trim();
|
|
75161
|
-
return
|
|
75206
|
+
return resolve13(gitDir, content);
|
|
75162
75207
|
} catch {
|
|
75163
75208
|
return null;
|
|
75164
75209
|
}
|
|
@@ -75170,7 +75215,7 @@ async function readWorktreeHeadSha(worktreePath) {
|
|
|
75170
75215
|
if (!ptr.startsWith("gitdir:")) {
|
|
75171
75216
|
return null;
|
|
75172
75217
|
}
|
|
75173
|
-
gitDir =
|
|
75218
|
+
gitDir = resolve13(worktreePath, ptr.slice("gitdir:".length).trim());
|
|
75174
75219
|
} catch {
|
|
75175
75220
|
return null;
|
|
75176
75221
|
}
|
|
@@ -75183,6 +75228,42 @@ async function readWorktreeHeadSha(worktreePath) {
|
|
|
75183
75228
|
}
|
|
75184
75229
|
return head.sha;
|
|
75185
75230
|
}
|
|
75231
|
+
function parseWorktreeListPorcelain(out) {
|
|
75232
|
+
const entries = [];
|
|
75233
|
+
let current = null;
|
|
75234
|
+
for (const line of out.split(`
|
|
75235
|
+
`)) {
|
|
75236
|
+
const trimmed = line.trim();
|
|
75237
|
+
if (trimmed.startsWith("worktree ")) {
|
|
75238
|
+
if (current)
|
|
75239
|
+
entries.push(current);
|
|
75240
|
+
current = { worktreePath: trimmed.slice("worktree ".length), branch: null };
|
|
75241
|
+
continue;
|
|
75242
|
+
}
|
|
75243
|
+
if (!current || trimmed === "")
|
|
75244
|
+
continue;
|
|
75245
|
+
if (trimmed.startsWith("branch ")) {
|
|
75246
|
+
let ref = trimmed.slice("branch ".length);
|
|
75247
|
+
if (ref.startsWith("refs/heads/"))
|
|
75248
|
+
ref = ref.slice("refs/heads/".length);
|
|
75249
|
+
current.branch = ref;
|
|
75250
|
+
}
|
|
75251
|
+
}
|
|
75252
|
+
if (current)
|
|
75253
|
+
entries.push(current);
|
|
75254
|
+
return entries;
|
|
75255
|
+
}
|
|
75256
|
+
async function listWorktrees(repoRoot) {
|
|
75257
|
+
const { code, stdout, stderr } = await execFileNoThrowWithCwd(gitExe(), ["worktree", "list", "--porcelain"], {
|
|
75258
|
+
cwd: repoRoot,
|
|
75259
|
+
stdin: "ignore",
|
|
75260
|
+
env: { ...process.env, ...GIT_NO_PROMPT_ENV }
|
|
75261
|
+
});
|
|
75262
|
+
if (code !== 0) {
|
|
75263
|
+
throw new Error(`git worktree list failed (code ${code}): ${stderr.trim()}`);
|
|
75264
|
+
}
|
|
75265
|
+
return parseWorktreeListPorcelain(stdout);
|
|
75266
|
+
}
|
|
75186
75267
|
async function readRawSymref(gitDir, refPath, branchPrefix) {
|
|
75187
75268
|
try {
|
|
75188
75269
|
const content = (await readFile9(join29(gitDir, refPath), "utf-8")).trim();
|
|
@@ -75399,8 +75480,12 @@ function resetWorktreeGitCaches() {
|
|
|
75399
75480
|
resolveGitDirCache.clear();
|
|
75400
75481
|
_gitExe = null;
|
|
75401
75482
|
}
|
|
75402
|
-
var MS_IN_SECOND2 = 1000, SECONDS_IN_MINUTE2 = 60, _gitExe = null, GIT_ROOT_NOT_FOUND, findGitRootCache, canonicalRootCache, resolveGitDirCache;
|
|
75483
|
+
var MS_IN_SECOND2 = 1000, SECONDS_IN_MINUTE2 = 60, _gitExe = null, GIT_NO_PROMPT_ENV, GIT_ROOT_NOT_FOUND, findGitRootCache, canonicalRootCache, resolveGitDirCache;
|
|
75403
75484
|
var init_git = __esm(() => {
|
|
75485
|
+
GIT_NO_PROMPT_ENV = {
|
|
75486
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
75487
|
+
GIT_ASKPASS: ""
|
|
75488
|
+
};
|
|
75404
75489
|
GIT_ROOT_NOT_FOUND = Symbol("git-root-not-found");
|
|
75405
75490
|
findGitRootCache = new Map;
|
|
75406
75491
|
canonicalRootCache = new Map;
|
|
@@ -75408,8 +75493,16 @@ var init_git = __esm(() => {
|
|
|
75408
75493
|
});
|
|
75409
75494
|
|
|
75410
75495
|
// src/engine/worktree/worktree.ts
|
|
75411
|
-
import {
|
|
75412
|
-
|
|
75496
|
+
import {
|
|
75497
|
+
copyFile,
|
|
75498
|
+
mkdir as mkdir10,
|
|
75499
|
+
readdir as readdir4,
|
|
75500
|
+
realpath as realpath2,
|
|
75501
|
+
stat as stat7,
|
|
75502
|
+
symlink as symlink2,
|
|
75503
|
+
utimes
|
|
75504
|
+
} from "fs/promises";
|
|
75505
|
+
import { basename as basename7, dirname as dirname16, join as join30, resolve as resolve14 } from "path";
|
|
75413
75506
|
function validateWorktreeSlug(slug) {
|
|
75414
75507
|
if (slug.length > MAX_WORKTREE_SLUG_LENGTH) {
|
|
75415
75508
|
throw new Error(`Invalid worktree name: must be ${MAX_WORKTREE_SLUG_LENGTH} characters or fewer (got ${slug.length})`);
|
|
@@ -75676,6 +75769,53 @@ async function createWorktreeForSession(sessionId, slug, tmuxSessionName, option
|
|
|
75676
75769
|
};
|
|
75677
75770
|
return currentWorktreeSession;
|
|
75678
75771
|
}
|
|
75772
|
+
async function enterExistingWorktreeForSession(sessionId, requestedPath, tmuxSessionName) {
|
|
75773
|
+
const originalCwd = process.cwd();
|
|
75774
|
+
const gitRoot = findGitRoot(process.cwd());
|
|
75775
|
+
if (!gitRoot) {
|
|
75776
|
+
throw new Error("Cannot enter a worktree: not in a git repository. " + "Worktree isolation requires a git repository.");
|
|
75777
|
+
}
|
|
75778
|
+
const entries = await listWorktrees(gitRoot);
|
|
75779
|
+
const resolved = resolve14(requestedPath);
|
|
75780
|
+
const norm = async (p) => {
|
|
75781
|
+
try {
|
|
75782
|
+
return await realpath2(p);
|
|
75783
|
+
} catch {
|
|
75784
|
+
return p;
|
|
75785
|
+
}
|
|
75786
|
+
};
|
|
75787
|
+
const resolvedNorm = await norm(resolved);
|
|
75788
|
+
const entryNorms = await Promise.all(entries.map((e) => norm(e.worktreePath)));
|
|
75789
|
+
const matchIdx = entryNorms.indexOf(resolvedNorm);
|
|
75790
|
+
const match = matchIdx >= 0 ? entries[matchIdx] : undefined;
|
|
75791
|
+
if (!match) {
|
|
75792
|
+
let exists = false;
|
|
75793
|
+
try {
|
|
75794
|
+
await stat7(resolved);
|
|
75795
|
+
exists = true;
|
|
75796
|
+
} catch {
|
|
75797
|
+
exists = false;
|
|
75798
|
+
}
|
|
75799
|
+
if (!exists) {
|
|
75800
|
+
throw new Error(`Path does not exist: ${requestedPath}. ` + 'EnterWorktree "path" must point to an existing git worktree of this ' + 'repository. Use the "name" argument to create a new worktree instead.');
|
|
75801
|
+
}
|
|
75802
|
+
throw new Error(`${requestedPath} is not a registered worktree of this repository. ` + `Registered worktrees: ${entries.map((e) => e.worktreePath).join(", ")}. ` + 'Use the "name" argument to create a new worktree instead.');
|
|
75803
|
+
}
|
|
75804
|
+
const originalBranch = await getBranch();
|
|
75805
|
+
const headCommit = await readWorktreeHeadSha(match.worktreePath);
|
|
75806
|
+
currentWorktreeSession = {
|
|
75807
|
+
originalCwd,
|
|
75808
|
+
worktreePath: match.worktreePath,
|
|
75809
|
+
worktreeName: basename7(match.worktreePath),
|
|
75810
|
+
worktreeBranch: match.branch ?? undefined,
|
|
75811
|
+
originalBranch,
|
|
75812
|
+
originalHeadCommit: headCommit ?? undefined,
|
|
75813
|
+
sessionId,
|
|
75814
|
+
tmuxSessionName,
|
|
75815
|
+
usedSparsePaths: (getWorktreeSettings().sparsePaths?.length ?? 0) > 0
|
|
75816
|
+
};
|
|
75817
|
+
return currentWorktreeSession;
|
|
75818
|
+
}
|
|
75679
75819
|
async function keepWorktree() {
|
|
75680
75820
|
if (!currentWorktreeSession) {
|
|
75681
75821
|
return;
|
|
@@ -75728,13 +75868,15 @@ async function cleanupWorktree() {
|
|
|
75728
75868
|
});
|
|
75729
75869
|
}
|
|
75730
75870
|
}
|
|
75731
|
-
async function createAgentWorktree(slug) {
|
|
75871
|
+
async function createAgentWorktree(slug, options) {
|
|
75732
75872
|
validateWorktreeSlug(slug);
|
|
75873
|
+
const effectiveSlug = options?.sessionId ? `${slug}-${options.sessionId.slice(0, 8)}` : slug;
|
|
75874
|
+
validateWorktreeSlug(effectiveSlug);
|
|
75733
75875
|
const gitRoot = findCanonicalGitRoot(process.cwd());
|
|
75734
75876
|
if (!gitRoot) {
|
|
75735
75877
|
throw new Error("Cannot create agent worktree: not in a git repository. " + "Worktree isolation requires a git repository (new repo has no WorktreeCreate " + "hook 面; that forward seam lands with the tool-body / E-wave-end wave).");
|
|
75736
75878
|
}
|
|
75737
|
-
const { worktreePath, worktreeBranch, headCommit, existed } = await getOrCreateWorktree(gitRoot,
|
|
75879
|
+
const { worktreePath, worktreeBranch, headCommit, existed } = await getOrCreateWorktree(gitRoot, effectiveSlug);
|
|
75738
75880
|
if (!existed) {
|
|
75739
75881
|
logForDebugging(`Created agent worktree at: ${worktreePath} on branch: ${worktreeBranch}`);
|
|
75740
75882
|
await performPostCreationSetup(gitRoot, worktreePath);
|
|
@@ -75825,16 +75967,12 @@ async function cleanupStaleAgentWorktrees(cutoffDate) {
|
|
|
75825
75967
|
}
|
|
75826
75968
|
return removed;
|
|
75827
75969
|
}
|
|
75828
|
-
var VALID_WORKTREE_SLUG_SEGMENT, MAX_WORKTREE_SLUG_LENGTH = 64,
|
|
75970
|
+
var VALID_WORKTREE_SLUG_SEGMENT, MAX_WORKTREE_SLUG_LENGTH = 64, currentWorktreeSession = null, sleep7 = (ms) => new Promise((r) => setTimeout(r, ms)), EPHEMERAL_WORKTREE_PATTERNS;
|
|
75829
75971
|
var init_worktree = __esm(() => {
|
|
75830
75972
|
init_shared();
|
|
75831
75973
|
init_config();
|
|
75832
75974
|
init_git();
|
|
75833
75975
|
VALID_WORKTREE_SLUG_SEGMENT = /^[a-zA-Z0-9._-]+$/;
|
|
75834
|
-
GIT_NO_PROMPT_ENV = {
|
|
75835
|
-
GIT_TERMINAL_PROMPT: "0",
|
|
75836
|
-
GIT_ASKPASS: ""
|
|
75837
|
-
};
|
|
75838
75976
|
EPHEMERAL_WORKTREE_PATTERNS = [
|
|
75839
75977
|
/^agent-a[0-9a-f]{7}$/,
|
|
75840
75978
|
/^wf_[0-9a-f]{8}-[0-9a-f]{3}-\d+$/,
|
|
@@ -75868,9 +76006,9 @@ function memoize2(fn, resolver) {
|
|
|
75868
76006
|
|
|
75869
76007
|
// src/engine/skill/markdownLoader.ts
|
|
75870
76008
|
import { statSync as statSync5 } from "fs";
|
|
75871
|
-
import { lstat, readdir as readdir5, readFile as readFile10, stat as stat8, realpath as
|
|
76009
|
+
import { lstat, readdir as readdir5, readFile as readFile10, stat as stat8, realpath as realpath3 } from "fs/promises";
|
|
75872
76010
|
import { homedir as homedir12 } from "os";
|
|
75873
|
-
import { dirname as dirname17, join as join31, resolve as
|
|
76011
|
+
import { dirname as dirname17, join as join31, resolve as resolve15 } from "path";
|
|
75874
76012
|
function extractDescriptionFromMarkdown(content, defaultDescription = "Custom item") {
|
|
75875
76013
|
const lines = content.split(`
|
|
75876
76014
|
`);
|
|
@@ -75928,9 +76066,9 @@ function resolveStopBoundary(cwd) {
|
|
|
75928
76066
|
return findGitRoot(cwd);
|
|
75929
76067
|
}
|
|
75930
76068
|
function getProjectDirsUpToHome(subdir, cwd) {
|
|
75931
|
-
const home =
|
|
76069
|
+
const home = resolve15(homedir12()).normalize("NFC");
|
|
75932
76070
|
const gitRoot = resolveStopBoundary(cwd);
|
|
75933
|
-
let current =
|
|
76071
|
+
let current = resolve15(cwd);
|
|
75934
76072
|
const dirs = [];
|
|
75935
76073
|
while (true) {
|
|
75936
76074
|
if (normalizePathForComparison(current) === normalizePathForComparison(home)) {
|
|
@@ -75965,7 +76103,7 @@ async function findMarkdownFilesNative(dir, signal) {
|
|
|
75965
76103
|
try {
|
|
75966
76104
|
const stats = await stat8(currentDir, { bigint: true });
|
|
75967
76105
|
if (stats.isDirectory()) {
|
|
75968
|
-
const dirKey = stats.dev !== undefined && stats.ino !== undefined ? `${stats.dev}:${stats.ino}` : await
|
|
76106
|
+
const dirKey = stats.dev !== undefined && stats.ino !== undefined ? `${stats.dev}:${stats.ino}` : await realpath3(currentDir);
|
|
75969
76107
|
if (visitedDirs.has(dirKey)) {
|
|
75970
76108
|
logForDebugging(`Skipping already visited directory (circular symlink): ${currentDir}`);
|
|
75971
76109
|
return;
|
|
@@ -76342,7 +76480,7 @@ var init_gitignore = __esm(() => {
|
|
|
76342
76480
|
init_worktree2();
|
|
76343
76481
|
});
|
|
76344
76482
|
// src/engine/skill/loadSkillsDir.ts
|
|
76345
|
-
import { realpath as
|
|
76483
|
+
import { realpath as realpath4 } from "fs/promises";
|
|
76346
76484
|
import {
|
|
76347
76485
|
basename as basename8,
|
|
76348
76486
|
dirname as dirname18,
|
|
@@ -76353,7 +76491,7 @@ import {
|
|
|
76353
76491
|
} from "path";
|
|
76354
76492
|
async function getFileIdentity2(filePath) {
|
|
76355
76493
|
try {
|
|
76356
|
-
return await
|
|
76494
|
+
return await realpath4(filePath);
|
|
76357
76495
|
} catch {
|
|
76358
76496
|
return null;
|
|
76359
76497
|
}
|
|
@@ -78470,6 +78608,10 @@ var init_enterWorktreeTool = __esm(() => {
|
|
|
78470
78608
|
name: {
|
|
78471
78609
|
type: "string",
|
|
78472
78610
|
description: 'Optional name for the worktree. Each "/"-separated segment may contain only letters, digits, dots, underscores, and dashes; max 64 chars total. A random name is generated if not provided.'
|
|
78611
|
+
},
|
|
78612
|
+
path: {
|
|
78613
|
+
type: "string",
|
|
78614
|
+
description: "Optional path to an EXISTING git worktree of the current repository to enter without creating a new one (probed via `git worktree list`). If the path does not exist or is not a registered worktree of this repository, the call fails with an actionable error. When both name and path are given, name wins."
|
|
78473
78615
|
}
|
|
78474
78616
|
}
|
|
78475
78617
|
};
|
|
@@ -78484,7 +78626,10 @@ var init_enterWorktreeTool = __esm(() => {
|
|
|
78484
78626
|
isConcurrencySafe: () => false,
|
|
78485
78627
|
isReadOnly: () => false,
|
|
78486
78628
|
isDestructive: () => false,
|
|
78487
|
-
toAutoClassifierInput: (input) =>
|
|
78629
|
+
toAutoClassifierInput: (input) => {
|
|
78630
|
+
const i = input;
|
|
78631
|
+
return i.name ?? i.path ?? "";
|
|
78632
|
+
},
|
|
78488
78633
|
userFacingName: () => "Creating worktree",
|
|
78489
78634
|
checkPermissions: async (input) => ({
|
|
78490
78635
|
behavior: "allow",
|
|
@@ -78492,14 +78637,20 @@ var init_enterWorktreeTool = __esm(() => {
|
|
|
78492
78637
|
}),
|
|
78493
78638
|
description: async () => ENTER_WORKTREE_PROMPT,
|
|
78494
78639
|
async validateInput(input) {
|
|
78495
|
-
const { name } = input;
|
|
78496
|
-
if (name
|
|
78497
|
-
|
|
78640
|
+
const { name, path } = input;
|
|
78641
|
+
if (name !== undefined) {
|
|
78642
|
+
try {
|
|
78643
|
+
validateWorktreeSlug(name);
|
|
78644
|
+
} catch (e) {
|
|
78645
|
+
return { result: false, errorCode: 1, message: e.message };
|
|
78646
|
+
}
|
|
78498
78647
|
}
|
|
78499
|
-
|
|
78500
|
-
|
|
78501
|
-
|
|
78502
|
-
|
|
78648
|
+
if (path !== undefined && (typeof path !== "string" || path.length === 0)) {
|
|
78649
|
+
return {
|
|
78650
|
+
result: false,
|
|
78651
|
+
errorCode: 1,
|
|
78652
|
+
message: "`path` must be a non-empty string (an existing git worktree path of this repository)"
|
|
78653
|
+
};
|
|
78503
78654
|
}
|
|
78504
78655
|
return { result: true };
|
|
78505
78656
|
},
|
|
@@ -78513,6 +78664,20 @@ var init_enterWorktreeTool = __esm(() => {
|
|
|
78513
78664
|
process.chdir(mainRepoRoot);
|
|
78514
78665
|
setCwd(mainRepoRoot);
|
|
78515
78666
|
}
|
|
78667
|
+
if (input.path !== undefined) {
|
|
78668
|
+
const entered = await enterExistingWorktreeForSession(getSessionId(), input.path);
|
|
78669
|
+
process.chdir(entered.worktreePath);
|
|
78670
|
+
setCwd(entered.worktreePath);
|
|
78671
|
+
setOriginalCwd(getCwdState());
|
|
78672
|
+
const enteredBranchInfo = entered.worktreeBranch ? ` on branch ${entered.worktreeBranch}` : "";
|
|
78673
|
+
return {
|
|
78674
|
+
data: {
|
|
78675
|
+
worktreePath: entered.worktreePath,
|
|
78676
|
+
worktreeBranch: entered.worktreeBranch,
|
|
78677
|
+
message: `Entered existing worktree at ${entered.worktreePath}${enteredBranchInfo}. The session is now working in the worktree. Use ExitWorktree to leave mid-session, or exit the session to be prompted.`
|
|
78678
|
+
}
|
|
78679
|
+
};
|
|
78680
|
+
}
|
|
78516
78681
|
const slug = input.name ?? randomUUID15();
|
|
78517
78682
|
const worktreeSession = await createWorktreeForSession(getSessionId(), slug);
|
|
78518
78683
|
process.chdir(worktreeSession.worktreePath);
|
|
@@ -80222,6 +80387,22 @@ async function richCompactConversation(messages, context, cacheSafeParams, suppr
|
|
|
80222
80387
|
trigger: isAutoCompact ? "auto" : "manual",
|
|
80223
80388
|
customInstructions: customInstructions ?? null
|
|
80224
80389
|
}, context.abortController.signal);
|
|
80390
|
+
if (hookResult.blocked) {
|
|
80391
|
+
const skipReason = hookResult.blockingReason ?? "PreCompact hook blocked compaction";
|
|
80392
|
+
logForDebugging(`Compact skipped: PreCompact hook blocked (${skipReason})`, { level: "warn" });
|
|
80393
|
+
context.setSDKStatus?.(null);
|
|
80394
|
+
context.onCompactProgress?.({ type: "compact_end" });
|
|
80395
|
+
return {
|
|
80396
|
+
boundaryMarker: createCompactBoundaryMessage(preCompactTokenCount, messages.length),
|
|
80397
|
+
summaryMessages: [],
|
|
80398
|
+
attachments: [],
|
|
80399
|
+
hookResults: [],
|
|
80400
|
+
userDisplayMessage: `Compaction skipped: PreCompact hook blocked (${skipReason})`,
|
|
80401
|
+
preCompactTokenCount,
|
|
80402
|
+
compactionSkipped: true,
|
|
80403
|
+
compactSkipReason: skipReason
|
|
80404
|
+
};
|
|
80405
|
+
}
|
|
80225
80406
|
customInstructions = mergeHookInstructions(customInstructions, hookResult.newCustomInstructions);
|
|
80226
80407
|
const userDisplayMessage = hookResult.userDisplayMessage;
|
|
80227
80408
|
context.setStreamMode?.("requesting");
|
|
@@ -81398,8 +81579,9 @@ async function queryAgentLoop(deps, args) {
|
|
|
81398
81579
|
let recovered;
|
|
81399
81580
|
try {
|
|
81400
81581
|
const result = await deps.reactiveCompact({ messages, turn: turns });
|
|
81401
|
-
if (result)
|
|
81582
|
+
if (result && !result.compactionSkipped) {
|
|
81402
81583
|
recovered = buildPostCompactMessages(result);
|
|
81584
|
+
}
|
|
81403
81585
|
} catch (compactErr) {
|
|
81404
81586
|
logForDebugging(`[reactive-compact] consumer failed: ${errorMessage(compactErr)}`);
|
|
81405
81587
|
}
|
|
@@ -81690,6 +81872,7 @@ var init_engine = __esm(() => {
|
|
|
81690
81872
|
init_tools();
|
|
81691
81873
|
init_tools();
|
|
81692
81874
|
init_tools();
|
|
81875
|
+
init_tools();
|
|
81693
81876
|
init_skill();
|
|
81694
81877
|
init_skill();
|
|
81695
81878
|
init_skill();
|
|
@@ -85129,7 +85312,7 @@ var init_hooksWiring = __esm(() => {
|
|
|
85129
85312
|
// src/cli/print.ts
|
|
85130
85313
|
import { randomUUID as randomUUID21 } from "crypto";
|
|
85131
85314
|
import { readFile as readFile12 } from "node:fs/promises";
|
|
85132
|
-
import { join as join37, resolve as
|
|
85315
|
+
import { join as join37, resolve as resolve16 } from "path";
|
|
85133
85316
|
function bridgeMcpToolClientLocal(client) {
|
|
85134
85317
|
return {
|
|
85135
85318
|
async callTool(toolName, args, _signal) {
|
|
@@ -85201,7 +85384,7 @@ async function parseMcpConfigItemsLocal(items) {
|
|
|
85201
85384
|
object = JSON.parse(trimmed);
|
|
85202
85385
|
} catch {
|
|
85203
85386
|
try {
|
|
85204
|
-
const raw = await readFile12(
|
|
85387
|
+
const raw = await readFile12(resolve16(trimmed), "utf8");
|
|
85205
85388
|
object = JSON.parse(raw);
|
|
85206
85389
|
} catch {
|
|
85207
85390
|
object = null;
|
|
@@ -86684,7 +86867,7 @@ var init_autoMode2 = __esm(() => {
|
|
|
86684
86867
|
|
|
86685
86868
|
// src/cli/parse.ts
|
|
86686
86869
|
import { existsSync as existsSync8, readFileSync as readFileSync11, realpathSync as realpathSync6 } from "fs";
|
|
86687
|
-
import { dirname as dirname21, join as join40, resolve as
|
|
86870
|
+
import { dirname as dirname21, join as join40, resolve as resolve17 } from "path";
|
|
86688
86871
|
function resolveCliVersion(startDir) {
|
|
86689
86872
|
let dir;
|
|
86690
86873
|
try {
|
|
@@ -86727,11 +86910,11 @@ function readPromptFileInline(inline, file, label) {
|
|
|
86727
86910
|
process.exit(1);
|
|
86728
86911
|
}
|
|
86729
86912
|
try {
|
|
86730
|
-
return readFileSync11(
|
|
86913
|
+
return readFileSync11(resolve17(file), "utf8");
|
|
86731
86914
|
} catch (error) {
|
|
86732
86915
|
const code = error.code;
|
|
86733
86916
|
if (code === "ENOENT") {
|
|
86734
|
-
process.stderr.write(`Error: ${label} file not found: ${
|
|
86917
|
+
process.stderr.write(`Error: ${label} file not found: ${resolve17(file)}
|
|
86735
86918
|
`);
|
|
86736
86919
|
} else {
|
|
86737
86920
|
process.stderr.write(`Error reading ${label} file: ${error.message}
|
|
@@ -98306,12 +98489,12 @@ var init_gitConfigParser = () => {};
|
|
|
98306
98489
|
// src/tui/utils/git/gitFilesystem.ts
|
|
98307
98490
|
import { unwatchFile, watchFile } from "fs";
|
|
98308
98491
|
import { readdir as readdir7, readFile as readFile16, stat as stat13 } from "fs/promises";
|
|
98309
|
-
import { join as join47, resolve as
|
|
98492
|
+
import { join as join47, resolve as resolve18 } from "path";
|
|
98310
98493
|
function clearResolveGitDirCache() {
|
|
98311
98494
|
resolveGitDirCache2.clear();
|
|
98312
98495
|
}
|
|
98313
98496
|
async function resolveGitDir2(startPath) {
|
|
98314
|
-
const cwd =
|
|
98497
|
+
const cwd = resolve18(startPath ?? getCwd());
|
|
98315
98498
|
const cached = resolveGitDirCache2.get(cwd);
|
|
98316
98499
|
if (cached !== undefined) {
|
|
98317
98500
|
return cached;
|
|
@@ -98328,7 +98511,7 @@ async function resolveGitDir2(startPath) {
|
|
|
98328
98511
|
const content = (await readFile16(gitPath, "utf-8")).trim();
|
|
98329
98512
|
if (content.startsWith("gitdir:")) {
|
|
98330
98513
|
const rawDir = content.slice("gitdir:".length).trim();
|
|
98331
|
-
const resolved =
|
|
98514
|
+
const resolved = resolve18(root, rawDir);
|
|
98332
98515
|
resolveGitDirCache2.set(cwd, resolved);
|
|
98333
98516
|
return resolved;
|
|
98334
98517
|
}
|
|
@@ -98432,7 +98615,7 @@ async function resolveRefInDir2(dir, ref) {
|
|
|
98432
98615
|
async function getCommonDir2(gitDir) {
|
|
98433
98616
|
try {
|
|
98434
98617
|
const content = (await readFile16(join47(gitDir, "commondir"), "utf-8")).trim();
|
|
98435
|
-
return
|
|
98618
|
+
return resolve18(gitDir, content);
|
|
98436
98619
|
} catch {
|
|
98437
98620
|
return null;
|
|
98438
98621
|
}
|
|
@@ -98652,7 +98835,7 @@ async function readWorktreeHeadSha2(worktreePath) {
|
|
|
98652
98835
|
if (!ptr.startsWith("gitdir:")) {
|
|
98653
98836
|
return null;
|
|
98654
98837
|
}
|
|
98655
|
-
gitDir =
|
|
98838
|
+
gitDir = resolve18(worktreePath, ptr.slice("gitdir:".length).trim());
|
|
98656
98839
|
} catch {
|
|
98657
98840
|
return null;
|
|
98658
98841
|
}
|
|
@@ -99505,7 +99688,7 @@ var init_gitAvailability = __esm(() => {
|
|
|
99505
99688
|
|
|
99506
99689
|
// src/tui/utils/git.ts
|
|
99507
99690
|
import { readFileSync as readFileSync14, realpathSync as realpathSync7, statSync as statSync7 } from "fs";
|
|
99508
|
-
import { basename as basename9, dirname as dirname25, join as join49, resolve as
|
|
99691
|
+
import { basename as basename9, dirname as dirname25, join as join49, resolve as resolve19, sep as sep7 } from "path";
|
|
99509
99692
|
function createFindGitRoot() {
|
|
99510
99693
|
function wrapper(startPath) {
|
|
99511
99694
|
const result = findGitRootImpl2(startPath);
|
|
@@ -99641,7 +99824,7 @@ var init_git2 = __esm(() => {
|
|
|
99641
99824
|
logForDiagnosticsNoPII("info", "find_git_root_started");
|
|
99642
99825
|
if (typeof startPath !== "string")
|
|
99643
99826
|
startPath = String(startPath || "/tmp");
|
|
99644
|
-
let current =
|
|
99827
|
+
let current = resolve19(startPath);
|
|
99645
99828
|
const root = current.substring(0, current.indexOf(sep7) + 1) || sep7;
|
|
99646
99829
|
let statCount = 0;
|
|
99647
99830
|
while (current !== root) {
|
|
@@ -99691,9 +99874,9 @@ var init_git2 = __esm(() => {
|
|
|
99691
99874
|
if (!gitContent.startsWith("gitdir:")) {
|
|
99692
99875
|
return gitRoot;
|
|
99693
99876
|
}
|
|
99694
|
-
const worktreeGitDir =
|
|
99695
|
-
const commonDir =
|
|
99696
|
-
if (
|
|
99877
|
+
const worktreeGitDir = resolve19(gitRoot, gitContent.slice("gitdir:".length).trim());
|
|
99878
|
+
const commonDir = resolve19(worktreeGitDir, readFileSync14(join49(worktreeGitDir, "commondir"), "utf-8").trim());
|
|
99879
|
+
if (resolve19(dirname25(worktreeGitDir)) !== join49(commonDir, "worktrees")) {
|
|
99697
99880
|
return gitRoot;
|
|
99698
99881
|
}
|
|
99699
99882
|
const backlink = realpathSync7(readFileSync14(join49(worktreeGitDir, "gitdir"), "utf-8").trim());
|
|
@@ -99923,7 +100106,7 @@ var init_getWorktreePathsPortable = __esm(() => {
|
|
|
99923
100106
|
});
|
|
99924
100107
|
|
|
99925
100108
|
// src/tui/utils/sessionStoragePortable.ts
|
|
99926
|
-
import { open as fsOpen2, readdir as readdir9, realpath as
|
|
100109
|
+
import { open as fsOpen2, readdir as readdir9, realpath as realpath5, stat as stat14 } from "fs/promises";
|
|
99927
100110
|
function validateUuid(maybeUuid) {
|
|
99928
100111
|
if (typeof maybeUuid !== "string")
|
|
99929
100112
|
return null;
|
|
@@ -100235,7 +100418,7 @@ var init_sessionStoragePortable = __esm(() => {
|
|
|
100235
100418
|
|
|
100236
100419
|
// src/tui/utils/path.ts
|
|
100237
100420
|
import { homedir as homedir17 } from "os";
|
|
100238
|
-
import { dirname as dirname27, isAbsolute as isAbsolute11, join as join51, normalize as normalize3, relative as relative5, resolve as
|
|
100421
|
+
import { dirname as dirname27, isAbsolute as isAbsolute11, join as join51, normalize as normalize3, relative as relative5, resolve as resolve21 } from "path";
|
|
100239
100422
|
function expandPath2(path, baseDir) {
|
|
100240
100423
|
const actualBaseDir = baseDir ?? getCwd() ?? getFsImplementation2().cwd();
|
|
100241
100424
|
if (typeof path !== "string") {
|
|
@@ -100268,7 +100451,7 @@ function expandPath2(path, baseDir) {
|
|
|
100268
100451
|
if (isAbsolute11(processedPath)) {
|
|
100269
100452
|
return normalize3(processedPath).normalize("NFC");
|
|
100270
100453
|
}
|
|
100271
|
-
return
|
|
100454
|
+
return resolve21(actualBaseDir, processedPath).normalize("NFC");
|
|
100272
100455
|
}
|
|
100273
100456
|
function toRelativePath2(absolutePath) {
|
|
100274
100457
|
const relativePath = relative5(getCwd(), absolutePath);
|
|
@@ -121001,7 +121184,7 @@ __export(exports_teamMemPaths, {
|
|
|
121001
121184
|
isTeamMemPath: () => isTeamMemPath,
|
|
121002
121185
|
isTeamMemoryEnabled: () => isTeamMemoryEnabled
|
|
121003
121186
|
});
|
|
121004
|
-
import { dirname as dirname28, join as join55, resolve as
|
|
121187
|
+
import { dirname as dirname28, join as join55, resolve as resolve22, sep as sep10 } from "path";
|
|
121005
121188
|
function isTeamMemoryEnabled() {
|
|
121006
121189
|
if (!isAutoMemoryEnabled2()) {
|
|
121007
121190
|
return false;
|
|
@@ -121015,7 +121198,7 @@ function getTeamMemEntrypoint() {
|
|
|
121015
121198
|
return join55(getAutoMemPath2(), "team", "MEMORY.md");
|
|
121016
121199
|
}
|
|
121017
121200
|
function isTeamMemPath(filePath) {
|
|
121018
|
-
const resolvedPath =
|
|
121201
|
+
const resolvedPath = resolve22(filePath);
|
|
121019
121202
|
const teamDir = getTeamMemPath();
|
|
121020
121203
|
return resolvedPath.startsWith(teamDir);
|
|
121021
121204
|
}
|
|
@@ -121031,7 +121214,7 @@ var init_teamMemPaths = __esm(() => {
|
|
|
121031
121214
|
// src/tui/utils/config.ts
|
|
121032
121215
|
import { randomBytes as randomBytes5 } from "crypto";
|
|
121033
121216
|
import { unwatchFile as unwatchFile2, watchFile as watchFile2 } from "fs";
|
|
121034
|
-
import { basename as basename10, dirname as dirname29, join as join56, resolve as
|
|
121217
|
+
import { basename as basename10, dirname as dirname29, join as join56, resolve as resolve23 } from "path";
|
|
121035
121218
|
function createDefaultGlobalConfig() {
|
|
121036
121219
|
return {
|
|
121037
121220
|
numStartups: 0,
|
|
@@ -121090,7 +121273,7 @@ function computeTrustDialogAccepted() {
|
|
|
121090
121273
|
if (pathConfig?.hasTrustDialogAccepted) {
|
|
121091
121274
|
return true;
|
|
121092
121275
|
}
|
|
121093
|
-
const parentPath = normalizePathForConfigKey(
|
|
121276
|
+
const parentPath = normalizePathForConfigKey(resolve23(currentPath, ".."));
|
|
121094
121277
|
if (parentPath === currentPath) {
|
|
121095
121278
|
break;
|
|
121096
121279
|
}
|
|
@@ -121715,7 +121898,7 @@ var init_config6 = __esm(() => {
|
|
|
121715
121898
|
if (gitRoot) {
|
|
121716
121899
|
return normalizePathForConfigKey(gitRoot);
|
|
121717
121900
|
}
|
|
121718
|
-
return normalizePathForConfigKey(
|
|
121901
|
+
return normalizePathForConfigKey(resolve23(originalCwd));
|
|
121719
121902
|
});
|
|
121720
121903
|
});
|
|
121721
121904
|
|
|
@@ -121953,7 +122136,7 @@ var init_fileReadCache2 = __esm(() => {
|
|
|
121953
122136
|
|
|
121954
122137
|
// src/tui/utils/file.ts
|
|
121955
122138
|
import { chmodSync as chmodSync2, writeFileSync as fsWriteFileSync2 } from "fs";
|
|
121956
|
-
import { realpath as
|
|
122139
|
+
import { realpath as realpath6, stat as stat16 } from "fs/promises";
|
|
121957
122140
|
import { homedir as homedir20 } from "os";
|
|
121958
122141
|
import {
|
|
121959
122142
|
basename as basename11,
|
|
@@ -121963,7 +122146,7 @@ import {
|
|
|
121963
122146
|
join as join57,
|
|
121964
122147
|
normalize as normalize5,
|
|
121965
122148
|
relative as relative6,
|
|
121966
|
-
resolve as
|
|
122149
|
+
resolve as resolve24,
|
|
121967
122150
|
sep as sep11
|
|
121968
122151
|
} from "path";
|
|
121969
122152
|
async function pathExists2(path) {
|
|
@@ -122063,7 +122246,7 @@ async function suggestPathUnderCwd2(requestedPath) {
|
|
|
122063
122246
|
const cwdParent = dirname30(cwd);
|
|
122064
122247
|
let resolvedPath = requestedPath;
|
|
122065
122248
|
try {
|
|
122066
|
-
const resolvedDir = await
|
|
122249
|
+
const resolvedDir = await realpath6(dirname30(requestedPath));
|
|
122067
122250
|
resolvedPath = join57(resolvedDir, basename11(requestedPath));
|
|
122068
122251
|
} catch {}
|
|
122069
122252
|
const cwdParentPrefix = cwdParent === sep11 ? sep11 : cwdParent + sep11;
|
|
@@ -122123,7 +122306,7 @@ function writeFileSyncAndFlush_DEPRECATED2(filePath, content, options = { encodi
|
|
|
122123
122306
|
let targetPath = filePath;
|
|
122124
122307
|
try {
|
|
122125
122308
|
const linkTarget = fs.readlinkSync(filePath);
|
|
122126
|
-
targetPath = isAbsolute13(linkTarget) ? linkTarget :
|
|
122309
|
+
targetPath = isAbsolute13(linkTarget) ? linkTarget : resolve24(dirname30(filePath), linkTarget);
|
|
122127
122310
|
logForDebugging3(`Writing through symlink: ${filePath} -> ${targetPath}`);
|
|
122128
122311
|
} catch {}
|
|
122129
122312
|
const tempPath = `${targetPath}.tmp.${process.pid}.${Date.now()}`;
|
|
@@ -122497,6 +122680,7 @@ var isMcpServerCommandEntry = () => ({}), isMcpServerNameEntry = () => ({}), isM
|
|
|
122497
122680
|
outputStyle: string2().optional(),
|
|
122498
122681
|
language: string2().optional(),
|
|
122499
122682
|
theme: string2().optional(),
|
|
122683
|
+
tui: object({ fullscreen: boolean2().optional() }).optional(),
|
|
122500
122684
|
autoCompactWindow: discriminatedUnion("kind", [
|
|
122501
122685
|
object({ kind: literal("auto") }),
|
|
122502
122686
|
object({ kind: literal("off") }),
|
|
@@ -123513,7 +123697,7 @@ var init_settingsCache2 = __esm(() => {
|
|
|
123513
123697
|
});
|
|
123514
123698
|
|
|
123515
123699
|
// src/tui/utils/settings/settings.ts
|
|
123516
|
-
import { dirname as dirname32, join as join60, resolve as
|
|
123700
|
+
import { dirname as dirname32, join as join60, resolve as resolve25 } from "path";
|
|
123517
123701
|
function getManagedSettingsFilePath2() {
|
|
123518
123702
|
return join60(getManagedFilePath(), "managed-settings.json");
|
|
123519
123703
|
}
|
|
@@ -123601,15 +123785,15 @@ function parseSettingsFileUncached2(path) {
|
|
|
123601
123785
|
function getSettingsRootPathForSource2(source) {
|
|
123602
123786
|
switch (source) {
|
|
123603
123787
|
case "userSettings":
|
|
123604
|
-
return
|
|
123788
|
+
return resolve25(getAtlasConfigHomeDir3());
|
|
123605
123789
|
case "policySettings":
|
|
123606
123790
|
case "projectSettings":
|
|
123607
123791
|
case "localSettings": {
|
|
123608
|
-
return
|
|
123792
|
+
return resolve25(getOriginalCwd());
|
|
123609
123793
|
}
|
|
123610
123794
|
case "flagSettings": {
|
|
123611
123795
|
const path = getFlagSettingsPath();
|
|
123612
|
-
return path ? dirname32(
|
|
123796
|
+
return path ? dirname32(resolve25(path)) : resolve25(getOriginalCwd());
|
|
123613
123797
|
}
|
|
123614
123798
|
}
|
|
123615
123799
|
}
|
|
@@ -123890,7 +124074,7 @@ function loadSettingsFromDisk2() {
|
|
|
123890
124074
|
}
|
|
123891
124075
|
const filePath = getSettingsFilePathForSource2(source);
|
|
123892
124076
|
if (filePath) {
|
|
123893
|
-
const resolvedPath =
|
|
124077
|
+
const resolvedPath = resolve25(filePath);
|
|
123894
124078
|
if (!seenFiles.has(resolvedPath)) {
|
|
123895
124079
|
seenFiles.add(resolvedPath);
|
|
123896
124080
|
const { settings, errors } = parseSettingsFile2(filePath);
|
|
@@ -124058,11 +124242,31 @@ var init_settings3 = __esm(() => {
|
|
|
124058
124242
|
});
|
|
124059
124243
|
|
|
124060
124244
|
// src/tui/bootstrapState.ts
|
|
124061
|
-
|
|
124245
|
+
function addInvokedSkill(skillName, skillPath, content, agentId) {
|
|
124246
|
+
const key = _invokedSkillAgentKey(agentId);
|
|
124247
|
+
let bySkill = _invokedSkillsByAgent.get(key);
|
|
124248
|
+
if (!bySkill) {
|
|
124249
|
+
bySkill = new Map;
|
|
124250
|
+
_invokedSkillsByAgent.set(key, bySkill);
|
|
124251
|
+
}
|
|
124252
|
+
bySkill.set(skillName, {
|
|
124253
|
+
skillName,
|
|
124254
|
+
skillPath,
|
|
124255
|
+
content,
|
|
124256
|
+
invokedAt: Date.now()
|
|
124257
|
+
});
|
|
124258
|
+
}
|
|
124259
|
+
function clearInvokedSkillsForAgent(agentId) {
|
|
124260
|
+
_invokedSkillsByAgent.delete(_invokedSkillAgentKey(agentId));
|
|
124261
|
+
}
|
|
124262
|
+
function getInvokedSkillsForAgent(agentId) {
|
|
124263
|
+
return _invokedSkillsByAgent.get(_invokedSkillAgentKey(agentId)) ?? new Map;
|
|
124264
|
+
}
|
|
124265
|
+
var _spSectionCache, _agentColorMap, _invokedSkillsByAgent, _invokedSkillAgentKey = (agentId) => agentId ?? "__main__", addSlowOperation = () => ({}), flushInteractionTime = () => ({}), _activeTimeCounter, getActiveTimeCounter = () => _activeTimeCounter, getAdditionalDirectoriesForClaudeMd = () => [], getAgentColorMap = () => _agentColorMap, getAllowedSettingSources = () => ["userSettings"], getBudgetContinuationCount = () => ({}), getCodeEditToolDecisionCounter = () => ({}), getCommitCounter = () => ({}), getCurrentTurnTokenBudget = () => ({}), getDirectConnectServerUrl = () => null, getInitialMainLoopModel = () => {
|
|
124062
124266
|
const settings = getSettings_DEPRECATED() || {};
|
|
124063
124267
|
const defaultRole = settings.defaultRole || "small";
|
|
124064
124268
|
return getRoleModel(defaultRole) ?? null;
|
|
124065
|
-
}, getInlinePlugins = () => ({}),
|
|
124269
|
+
}, getInlinePlugins = () => ({}), _isRemoteMode = false, getIsRemoteMode = () => _isRemoteMode, getIsScrollDraining = () => ({}), getLastAPIRequest = () => ({}), getLastInteractionTime = () => ({}), _locCounter, getLocCounter = () => _locCounter, _mainLoopModelOverride = undefined, getMainLoopModelOverride = () => _mainLoopModelOverride, getPlanSlugCache = () => new Map, getPrCounter = () => ({}), getPromptId = () => ({}), getRegisteredHooks = () => [], getSdkAgentProgressSummariesEnabled = () => ({}), getSdkBetas = () => [], getSlowOperations = () => [], getTurnOutputTokens = () => 0, getUseCoworkPlugins = () => false, handlePlanModeTransition = () => ({}), hasShownLspRecommendationThisSession = () => ({}), isReplBridgeActive2 = () => ({}), markPostCompaction = () => ({}), markScrollActivity = () => ({}), registerHookCallbacks = () => ({}), resetTurnClassifierDuration = () => {
|
|
124066
124270
|
_turnClassifierDurationMs = 0;
|
|
124067
124271
|
_turnClassifierCount = 0;
|
|
124068
124272
|
}, resetTurnHookDuration = () => {
|
|
@@ -124089,6 +124293,7 @@ var init_bootstrapState = __esm(() => {
|
|
|
124089
124293
|
init_modelprovider2();
|
|
124090
124294
|
_spSectionCache = new Map;
|
|
124091
124295
|
_agentColorMap = new Map;
|
|
124296
|
+
_invokedSkillsByAgent = new Map;
|
|
124092
124297
|
_activeTimeCounter = {
|
|
124093
124298
|
add: (_v, _tags) => {},
|
|
124094
124299
|
observe: (_v, _tags) => {},
|
|
@@ -135438,6 +135643,12 @@ var init_earlyInput = __esm(() => {
|
|
|
135438
135643
|
|
|
135439
135644
|
// src/tui/utils/fullscreen.ts
|
|
135440
135645
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
135646
|
+
function setFullscreenRuntimeOverride(value) {
|
|
135647
|
+
fullscreenRuntimeOverride = value;
|
|
135648
|
+
}
|
|
135649
|
+
function getFullscreenRuntimeOverride() {
|
|
135650
|
+
return fullscreenRuntimeOverride;
|
|
135651
|
+
}
|
|
135441
135652
|
function isTmuxControlModeEnvHeuristic() {
|
|
135442
135653
|
if (!process.env.TMUX)
|
|
135443
135654
|
return false;
|
|
@@ -135470,6 +135681,9 @@ function isTmuxControlMode() {
|
|
|
135470
135681
|
return tmuxControlModeProbed ?? false;
|
|
135471
135682
|
}
|
|
135472
135683
|
function isFullscreenEnvEnabled() {
|
|
135684
|
+
if (fullscreenRuntimeOverride !== undefined) {
|
|
135685
|
+
return fullscreenRuntimeOverride;
|
|
135686
|
+
}
|
|
135473
135687
|
if (isEnvDefinedFalsy2(process.env.ATLAS_NO_FLICKER))
|
|
135474
135688
|
return false;
|
|
135475
135689
|
if (isEnvTruthy2(process.env.ATLAS_NO_FLICKER))
|
|
@@ -135507,7 +135721,7 @@ async function maybeGetTmuxMouseHint() {
|
|
|
135507
135721
|
return null;
|
|
135508
135722
|
return "tmux detected · scroll with PgUp/PgDn · or add 'set -g mouse on' to ~/.tmux.conf for wheel scroll";
|
|
135509
135723
|
}
|
|
135510
|
-
var loggedTmuxCcDisable = false, checkedTmuxMouseHint = false, tmuxControlModeProbed;
|
|
135724
|
+
var loggedTmuxCcDisable = false, checkedTmuxMouseHint = false, tmuxControlModeProbed, fullscreenRuntimeOverride;
|
|
135511
135725
|
var init_fullscreen = __esm(() => {
|
|
135512
135726
|
init_bootstrap();
|
|
135513
135727
|
init_debug();
|
|
@@ -162051,14 +162265,14 @@ var init_MessageResponse = __esm(() => {
|
|
|
162051
162265
|
|
|
162052
162266
|
// src/tui/commands/add-dir/validation.ts
|
|
162053
162267
|
import { stat as stat17 } from "fs/promises";
|
|
162054
|
-
import { dirname as dirname36, resolve as
|
|
162268
|
+
import { dirname as dirname36, resolve as resolve27 } from "path";
|
|
162055
162269
|
async function validateDirectoryForWorkspace(directoryPath, permissionContext) {
|
|
162056
162270
|
if (!directoryPath) {
|
|
162057
162271
|
return {
|
|
162058
162272
|
resultType: "emptyPath"
|
|
162059
162273
|
};
|
|
162060
162274
|
}
|
|
162061
|
-
const absolutePath =
|
|
162275
|
+
const absolutePath = resolve27(expandPath2(directoryPath));
|
|
162062
162276
|
try {
|
|
162063
162277
|
const stats = await stat17(absolutePath);
|
|
162064
162278
|
if (!stats.isDirectory()) {
|
|
@@ -162310,7 +162524,7 @@ var init_mailbox3 = __esm(() => {
|
|
|
162310
162524
|
});
|
|
162311
162525
|
|
|
162312
162526
|
// node_modules/readdirp/index.js
|
|
162313
|
-
import { lstat as lstat2, readdir as readdir10, realpath as
|
|
162527
|
+
import { lstat as lstat2, readdir as readdir10, realpath as realpath7, stat as stat18 } from "node:fs/promises";
|
|
162314
162528
|
import { join as pjoin, resolve as presolve, sep as psep } from "node:path";
|
|
162315
162529
|
import { Readable as Readable6 } from "node:stream";
|
|
162316
162530
|
function readdirp(root, options = {}) {
|
|
@@ -162533,7 +162747,7 @@ var init_readdirp = __esm(() => {
|
|
|
162533
162747
|
async _getSymlinkEntryType(entry) {
|
|
162534
162748
|
const full = entry.fullPath;
|
|
162535
162749
|
try {
|
|
162536
|
-
const entryRealPath = await
|
|
162750
|
+
const entryRealPath = await realpath7(full);
|
|
162537
162751
|
const entryRealPathStats = await lstat2(entryRealPath);
|
|
162538
162752
|
if (entryRealPathStats.isFile()) {
|
|
162539
162753
|
return "file";
|
|
@@ -164513,9 +164727,9 @@ var init_pluginOnlyPolicy = __esm(() => {
|
|
|
164513
164727
|
|
|
164514
164728
|
// src/tui/utils/markdownConfigLoader.ts
|
|
164515
164729
|
import { statSync as statSync9 } from "fs";
|
|
164516
|
-
import { lstat as lstat4, readdir as readdir12, readFile as readFile20, realpath as
|
|
164730
|
+
import { lstat as lstat4, readdir as readdir12, readFile as readFile20, realpath as realpath8, stat as stat22 } from "fs/promises";
|
|
164517
164731
|
import { homedir as homedir23 } from "os";
|
|
164518
|
-
import { dirname as dirname40, join as join67, resolve as
|
|
164732
|
+
import { dirname as dirname40, join as join67, resolve as resolve30, sep as sep14 } from "path";
|
|
164519
164733
|
function extractDescriptionFromMarkdown2(content, defaultDescription = "Custom item") {
|
|
164520
164734
|
const lines = content.split(`
|
|
164521
164735
|
`);
|
|
@@ -164597,9 +164811,9 @@ function resolveStopBoundary2(cwd) {
|
|
|
164597
164811
|
return cwdGitRoot;
|
|
164598
164812
|
}
|
|
164599
164813
|
function getProjectDirsUpToHome2(subdir, cwd) {
|
|
164600
|
-
const home =
|
|
164814
|
+
const home = resolve30(homedir23()).normalize("NFC");
|
|
164601
164815
|
const gitRoot = resolveStopBoundary2(cwd);
|
|
164602
|
-
let current =
|
|
164816
|
+
let current = resolve30(cwd);
|
|
164603
164817
|
const dirs = [];
|
|
164604
164818
|
while (true) {
|
|
164605
164819
|
if (normalizePathForComparison2(current) === normalizePathForComparison2(home)) {
|
|
@@ -164634,7 +164848,7 @@ async function findMarkdownFilesNative2(dir, signal) {
|
|
|
164634
164848
|
try {
|
|
164635
164849
|
const stats = await stat22(currentDir, { bigint: true });
|
|
164636
164850
|
if (stats.isDirectory()) {
|
|
164637
|
-
const dirKey = stats.dev !== undefined && stats.ino !== undefined ? `${stats.dev}:${stats.ino}` : await
|
|
164851
|
+
const dirKey = stats.dev !== undefined && stats.ino !== undefined ? `${stats.dev}:${stats.ino}` : await realpath8(currentDir);
|
|
164638
164852
|
if (visitedDirs.has(dirKey)) {
|
|
164639
164853
|
logForDebugging3(`Skipping already visited directory (circular symlink): ${currentDir}`);
|
|
164640
164854
|
return;
|
|
@@ -167786,7 +168000,7 @@ var init_readOnlyCommandValidation2 = __esm(() => {
|
|
|
167786
168000
|
|
|
167787
168001
|
// src/tui/utils/permissions/pathValidation.ts
|
|
167788
168002
|
import { homedir as homedir24 } from "os";
|
|
167789
|
-
import { dirname as dirname41, isAbsolute as isAbsolute16, resolve as
|
|
168003
|
+
import { dirname as dirname41, isAbsolute as isAbsolute16, resolve as resolve31 } from "path";
|
|
167790
168004
|
function expandTilde2(path) {
|
|
167791
168005
|
if (path === "~" || path.startsWith("~/") || process.platform === "win32" && path.startsWith("~\\")) {
|
|
167792
168006
|
return homedir24() + path.slice(1);
|
|
@@ -178802,6 +179016,7 @@ __export(exports_engineCompat, {
|
|
|
178802
179016
|
FORK_DIRECTIVE_PREFIX: () => FORK_DIRECTIVE_PREFIX,
|
|
178803
179017
|
FORK_SUBAGENT_TYPE: () => FORK_SUBAGENT_TYPE,
|
|
178804
179018
|
GENERAL_PURPOSE_AGENT: () => GENERAL_PURPOSE_AGENT,
|
|
179019
|
+
GIT_NO_PROMPT_ENV: () => GIT_NO_PROMPT_ENV,
|
|
178805
179020
|
GLOB_TOOL_NAME: () => GLOB_TOOL_NAME,
|
|
178806
179021
|
GREP_TOOL_NAME: () => GREP_TOOL_NAME,
|
|
178807
179022
|
GlobTool: () => GlobTool,
|
|
@@ -178993,6 +179208,7 @@ __export(exports_engineCompat, {
|
|
|
178993
179208
|
enqueuePendingNotification: () => enqueuePendingNotification,
|
|
178994
179209
|
enqueueSdkEvent: () => enqueueSdkEvent,
|
|
178995
179210
|
enqueueTaskNotification: () => enqueueTaskNotification,
|
|
179211
|
+
enterExistingWorktreeForSession: () => enterExistingWorktreeForSession,
|
|
178996
179212
|
estimateMessageTokens: () => estimateMessageTokens,
|
|
178997
179213
|
evaluateTimeBasedTrigger: () => evaluateTimeBasedTrigger,
|
|
178998
179214
|
evictTerminalTask: () => evictTerminalTask,
|
|
@@ -179215,6 +179431,7 @@ __export(exports_engineCompat, {
|
|
|
179215
179431
|
killTmuxSession: () => killTmuxSession,
|
|
179216
179432
|
listAllCronTasks: () => listAllCronTasks,
|
|
179217
179433
|
listTasks: () => listTasks,
|
|
179434
|
+
listWorktrees: () => listWorktrees,
|
|
179218
179435
|
loadAgentDefinitions: () => loadAgentDefinitions,
|
|
179219
179436
|
loadAllPermissionRulesFromDisk: () => loadAllPermissionRulesFromDisk,
|
|
179220
179437
|
loadManagedFileSettings: () => loadManagedFileSettings,
|
|
@@ -179232,6 +179449,7 @@ __export(exports_engineCompat, {
|
|
|
179232
179449
|
markMessagesAsReadByPredicate: () => markMessagesAsReadByPredicate,
|
|
179233
179450
|
markSessionMemoryInitialized: () => markSessionMemoryInitialized,
|
|
179234
179451
|
markTaskNotified: () => markTaskNotified,
|
|
179452
|
+
matchReadOnlyPrefix: () => matchReadOnlyPrefix,
|
|
179235
179453
|
matchSessionMode: () => matchSessionMode,
|
|
179236
179454
|
mcpInfoFromString: () => mcpInfoFromString2,
|
|
179237
179455
|
mergeAutoCompactOverrides: () => mergeAutoCompactOverrides,
|
|
@@ -179263,6 +179481,7 @@ __export(exports_engineCompat, {
|
|
|
179263
179481
|
parseSettingsFile: () => parseSettingsFile,
|
|
179264
179482
|
parseToolListFromCLI: () => parseToolListFromCLI,
|
|
179265
179483
|
parseToolPreset: () => parseToolPreset,
|
|
179484
|
+
parseWorktreeListPorcelain: () => parseWorktreeListPorcelain,
|
|
179266
179485
|
partialCompactConversation: () => partialCompactConversation,
|
|
179267
179486
|
partitionToolCalls: () => partitionToolCalls,
|
|
179268
179487
|
peek: () => peek,
|
|
@@ -197600,7 +197819,7 @@ var init_IdeOnboardingDialog = __esm(() => {
|
|
|
197600
197819
|
|
|
197601
197820
|
// src/tui/utils/ide.ts
|
|
197602
197821
|
import { createConnection } from "net";
|
|
197603
|
-
import { basename as basename19, join as join84, sep as pathSeparator, resolve as
|
|
197822
|
+
import { basename as basename19, join as join84, sep as pathSeparator, resolve as resolve32 } from "path";
|
|
197604
197823
|
function isProcessRunning3(pid) {
|
|
197605
197824
|
try {
|
|
197606
197825
|
process.kill(pid, 0);
|
|
@@ -197742,7 +197961,7 @@ async function getIdeLockfilesPaths() {
|
|
|
197742
197961
|
if (windowsHome) {
|
|
197743
197962
|
const converter = new WindowsToWSLConverter(process.env.WSL_DISTRO_NAME);
|
|
197744
197963
|
const wslPath = converter.toLocalPath(windowsHome);
|
|
197745
|
-
paths.push(
|
|
197964
|
+
paths.push(resolve32(wslPath, getConfigDirName2(), "ide"));
|
|
197746
197965
|
}
|
|
197747
197966
|
try {
|
|
197748
197967
|
const usersDir = "/mnt/c/Users";
|
|
@@ -197884,14 +198103,14 @@ async function detectIDEs(includeInvalid) {
|
|
|
197884
198103
|
if (!checkWSLDistroMatch(idePath, process.env.WSL_DISTRO_NAME)) {
|
|
197885
198104
|
return false;
|
|
197886
198105
|
}
|
|
197887
|
-
const resolvedOriginal =
|
|
198106
|
+
const resolvedOriginal = resolve32(localPath).normalize("NFC");
|
|
197888
198107
|
if (cwd === resolvedOriginal || cwd.startsWith(resolvedOriginal + pathSeparator)) {
|
|
197889
198108
|
return true;
|
|
197890
198109
|
}
|
|
197891
198110
|
const converter = new WindowsToWSLConverter(process.env.WSL_DISTRO_NAME);
|
|
197892
198111
|
localPath = converter.toLocalPath(idePath);
|
|
197893
198112
|
}
|
|
197894
|
-
const resolvedPath =
|
|
198113
|
+
const resolvedPath = resolve32(localPath).normalize("NFC");
|
|
197895
198114
|
if (getPlatform3() === "windows") {
|
|
197896
198115
|
const normalizedCwd = cwd.replace(/^[a-zA-Z]:/, (match) => match.toUpperCase());
|
|
197897
198116
|
const normalizedResolvedPath = resolvedPath.replace(/^[a-zA-Z]:/, (match) => match.toUpperCase());
|
|
@@ -209692,12 +209911,12 @@ var init_LSPDiagnosticRegistry = __esm(() => {
|
|
|
209692
209911
|
|
|
209693
209912
|
// src/tui/utils/plugins/lspPluginIntegration.ts
|
|
209694
209913
|
import { readFile as readFile26 } from "fs/promises";
|
|
209695
|
-
import { join as join89, relative as relative10, resolve as
|
|
209914
|
+
import { join as join89, relative as relative10, resolve as resolve33 } from "path";
|
|
209696
209915
|
function validatePathWithinPlugin(pluginPath, relativePath) {
|
|
209697
|
-
const resolvedPluginPath =
|
|
209698
|
-
const resolvedFilePath =
|
|
209916
|
+
const resolvedPluginPath = resolve33(pluginPath);
|
|
209917
|
+
const resolvedFilePath = resolve33(pluginPath, relativePath);
|
|
209699
209918
|
const rel = relative10(resolvedPluginPath, resolvedFilePath);
|
|
209700
|
-
if (rel.startsWith("..") ||
|
|
209919
|
+
if (rel.startsWith("..") || resolve33(rel) === rel) {
|
|
209701
209920
|
return null;
|
|
209702
209921
|
}
|
|
209703
209922
|
return resolvedFilePath;
|
|
@@ -215958,6 +216177,7 @@ var init_memoryTypes2 = __esm(() => {
|
|
|
215958
216177
|
"- If the memory names a file path: check the file exists.",
|
|
215959
216178
|
"- If the memory names a function or flag: grep for it.",
|
|
215960
216179
|
"- If the user is about to act on your recommendation (not just asking about history), verify first.",
|
|
216180
|
+
"- User-profile memories (who the user is, how they like to collaborate) are context, not instructions — when in doubt, trust observed behavior over the recalled preference, and ask rather than assume.",
|
|
215961
216181
|
"",
|
|
215962
216182
|
'"The memory says X exists" is not the same as "X exists now."',
|
|
215963
216183
|
"",
|
|
@@ -251332,7 +251552,7 @@ var init_readEditContext = __esm(() => {
|
|
|
251332
251552
|
});
|
|
251333
251553
|
|
|
251334
251554
|
// src/tui/tools/FileWriteTool/UI.tsx
|
|
251335
|
-
import { isAbsolute as isAbsolute20, relative as relative14, resolve as
|
|
251555
|
+
import { isAbsolute as isAbsolute20, relative as relative14, resolve as resolve35 } from "path";
|
|
251336
251556
|
function countLines(content) {
|
|
251337
251557
|
const parts = content.split(EOL);
|
|
251338
251558
|
return content.endsWith(EOL) ? parts.length - 1 : parts.length;
|
|
@@ -251656,7 +251876,7 @@ function WriteRejectionBody(t0) {
|
|
|
251656
251876
|
}
|
|
251657
251877
|
async function loadRejectionDiff(filePath, content) {
|
|
251658
251878
|
try {
|
|
251659
|
-
const fullFilePath = isAbsolute20(filePath) ? filePath :
|
|
251879
|
+
const fullFilePath = isAbsolute20(filePath) ? filePath : resolve35(getCwd(), filePath);
|
|
251660
251880
|
const handle = await openForScan(fullFilePath);
|
|
251661
251881
|
if (handle === null)
|
|
251662
251882
|
return {
|
|
@@ -257462,7 +257682,7 @@ var init_bashProvider = __esm(() => {
|
|
|
257462
257682
|
});
|
|
257463
257683
|
|
|
257464
257684
|
// src/tui/utils/shell/powershellDetection.ts
|
|
257465
|
-
import { realpath as
|
|
257685
|
+
import { realpath as realpath9, stat as stat32 } from "fs/promises";
|
|
257466
257686
|
async function probePath(p) {
|
|
257467
257687
|
try {
|
|
257468
257688
|
return (await stat32(p)).isFile() ? p : null;
|
|
@@ -257474,11 +257694,11 @@ async function findPowerShell() {
|
|
|
257474
257694
|
const pwshPath = await which("pwsh");
|
|
257475
257695
|
if (pwshPath) {
|
|
257476
257696
|
if (getPlatform3() === "linux") {
|
|
257477
|
-
const resolved = await
|
|
257697
|
+
const resolved = await realpath9(pwshPath).catch(() => pwshPath);
|
|
257478
257698
|
if (pwshPath.startsWith("/snap/") || resolved.startsWith("/snap/")) {
|
|
257479
257699
|
const direct = await probePath("/opt/microsoft/powershell/7/pwsh") ?? await probePath("/usr/bin/pwsh");
|
|
257480
257700
|
if (direct) {
|
|
257481
|
-
const directResolved = await
|
|
257701
|
+
const directResolved = await realpath9(direct).catch(() => direct);
|
|
257482
257702
|
if (!direct.startsWith("/snap/") && !directResolved.startsWith("/snap/")) {
|
|
257483
257703
|
return direct;
|
|
257484
257704
|
}
|
|
@@ -257569,8 +257789,8 @@ var init_powershellProvider = __esm(() => {
|
|
|
257569
257789
|
// src/tui/utils/Shell.ts
|
|
257570
257790
|
import { execFileSync as execFileSync4, spawn as spawn9 } from "child_process";
|
|
257571
257791
|
import { constants as fsConstants5, readFileSync as readFileSync19, unlinkSync as unlinkSync3 } from "fs";
|
|
257572
|
-
import { mkdir as mkdir27, open as open12, realpath as
|
|
257573
|
-
import { isAbsolute as isAbsolute25, resolve as
|
|
257792
|
+
import { mkdir as mkdir27, open as open12, realpath as realpath10 } from "fs/promises";
|
|
257793
|
+
import { isAbsolute as isAbsolute25, resolve as resolve36 } from "path";
|
|
257574
257794
|
import { join as posixJoin3 } from "path/posix";
|
|
257575
257795
|
import { accessSync as accessSync2 } from "fs";
|
|
257576
257796
|
function isExecutable2(shellPath) {
|
|
@@ -257655,12 +257875,12 @@ async function exec3(command, abortSignal, shellType, options) {
|
|
|
257655
257875
|
let commandString = builtCommand;
|
|
257656
257876
|
let cwd = pwd();
|
|
257657
257877
|
try {
|
|
257658
|
-
await
|
|
257878
|
+
await realpath10(cwd);
|
|
257659
257879
|
} catch {
|
|
257660
257880
|
const fallback = getOriginalCwd();
|
|
257661
257881
|
logForDebugging3(`Shell CWD "${cwd}" no longer exists, recovering to "${fallback}"`);
|
|
257662
257882
|
try {
|
|
257663
|
-
await
|
|
257883
|
+
await realpath10(fallback);
|
|
257664
257884
|
setCwdState(fallback);
|
|
257665
257885
|
cwd = fallback;
|
|
257666
257886
|
} catch {
|
|
@@ -257759,7 +257979,7 @@ async function exec3(command, abortSignal, shellType, options) {
|
|
|
257759
257979
|
}
|
|
257760
257980
|
}
|
|
257761
257981
|
function setCwd2(path, relativeTo) {
|
|
257762
|
-
const resolved = isAbsolute25(path) ? path :
|
|
257982
|
+
const resolved = isAbsolute25(path) ? path : resolve36(relativeTo || getFsImplementation2().cwd(), path);
|
|
257763
257983
|
let physicalPath;
|
|
257764
257984
|
try {
|
|
257765
257985
|
physicalPath = getFsImplementation2().realpathSync(resolved);
|
|
@@ -258360,7 +258580,7 @@ var init_UI8 = __esm(() => {
|
|
|
258360
258580
|
});
|
|
258361
258581
|
|
|
258362
258582
|
// src/tui/tools/NotebookEditTool/NotebookEditTool.ts
|
|
258363
|
-
import { extname as extname13, isAbsolute as isAbsolute26, resolve as
|
|
258583
|
+
import { extname as extname13, isAbsolute as isAbsolute26, resolve as resolve37 } from "path";
|
|
258364
258584
|
var inputSchema12, outputSchema10, NotebookEditTool2;
|
|
258365
258585
|
var init_NotebookEditTool = __esm(() => {
|
|
258366
258586
|
init_shared();
|
|
@@ -258474,7 +258694,7 @@ var init_NotebookEditTool = __esm(() => {
|
|
|
258474
258694
|
renderToolUseErrorMessage: renderToolUseErrorMessage5,
|
|
258475
258695
|
renderToolResultMessage: renderToolResultMessage8,
|
|
258476
258696
|
async validateInput({ notebook_path, cell_type, cell_id, edit_mode = "replace" }, toolUseContext) {
|
|
258477
|
-
const fullPath = isAbsolute26(notebook_path) ? notebook_path :
|
|
258697
|
+
const fullPath = isAbsolute26(notebook_path) ? notebook_path : resolve37(getCwd(), notebook_path);
|
|
258478
258698
|
if (fullPath.startsWith("\\\\") || fullPath.startsWith("//")) {
|
|
258479
258699
|
return { result: true };
|
|
258480
258700
|
}
|
|
@@ -258573,7 +258793,7 @@ var init_NotebookEditTool = __esm(() => {
|
|
|
258573
258793
|
cell_type,
|
|
258574
258794
|
edit_mode: originalEditMode
|
|
258575
258795
|
}, { readFileState, updateFileHistoryState }, _, parentMessage) {
|
|
258576
|
-
const fullPath = isAbsolute26(notebook_path) ? notebook_path :
|
|
258796
|
+
const fullPath = isAbsolute26(notebook_path) ? notebook_path : resolve37(getCwd(), notebook_path);
|
|
258577
258797
|
if (fileHistoryEnabled()) {
|
|
258578
258798
|
await fileHistoryTrackEdit(updateFileHistoryState, fullPath, parentMessage.uuid);
|
|
258579
258799
|
}
|
|
@@ -260490,7 +260710,7 @@ var init_fileStateCache = __esm(() => {
|
|
|
260490
260710
|
});
|
|
260491
260711
|
|
|
260492
260712
|
// src/tui/utils/hooks/hooksSettings.ts
|
|
260493
|
-
import { resolve as
|
|
260713
|
+
import { resolve as resolve38 } from "path";
|
|
260494
260714
|
function isHookEqual(a, b) {
|
|
260495
260715
|
if (a.type !== b.type)
|
|
260496
260716
|
return false;
|
|
@@ -260541,7 +260761,7 @@ function getAllHooks(appState) {
|
|
|
260541
260761
|
for (const source of sources) {
|
|
260542
260762
|
const filePath = getSettingsFilePathForSource2(source);
|
|
260543
260763
|
if (filePath) {
|
|
260544
|
-
const resolvedPath =
|
|
260764
|
+
const resolvedPath = resolve38(filePath);
|
|
260545
260765
|
if (seenFiles.has(resolvedPath)) {
|
|
260546
260766
|
continue;
|
|
260547
260767
|
}
|
|
@@ -314117,7 +314337,7 @@ var init_parser7 = __esm(() => {
|
|
|
314117
314337
|
});
|
|
314118
314338
|
|
|
314119
314339
|
// src/tui/tools/PowerShellTool/gitSafety.ts
|
|
314120
|
-
import { basename as basename29, posix as posix7, resolve as
|
|
314340
|
+
import { basename as basename29, posix as posix7, resolve as resolve39, sep as sep23 } from "path";
|
|
314121
314341
|
function resolveCwdReentry(normalized) {
|
|
314122
314342
|
if (!normalized.startsWith("../"))
|
|
314123
314343
|
return normalized;
|
|
@@ -314165,7 +314385,7 @@ function normalizeGitPathArg(arg) {
|
|
|
314165
314385
|
}
|
|
314166
314386
|
function resolveEscapingPathToCwdRelative(n) {
|
|
314167
314387
|
const cwd = getCwd();
|
|
314168
|
-
const abs =
|
|
314388
|
+
const abs = resolve39(cwd, n);
|
|
314169
314389
|
const cwdWithSep = cwd.endsWith(sep23) ? cwd : cwd + sep23;
|
|
314170
314390
|
const absLower = abs.toLowerCase();
|
|
314171
314391
|
const cwdLower = cwd.toLowerCase();
|
|
@@ -315405,7 +315625,7 @@ var init_modeValidation3 = __esm(() => {
|
|
|
315405
315625
|
|
|
315406
315626
|
// src/tui/tools/PowerShellTool/pathValidation.ts
|
|
315407
315627
|
import { homedir as homedir29 } from "os";
|
|
315408
|
-
import { isAbsolute as isAbsolute27, resolve as
|
|
315628
|
+
import { isAbsolute as isAbsolute27, resolve as resolve40 } from "path";
|
|
315409
315629
|
function matchesParam(paramLower, paramList) {
|
|
315410
315630
|
for (const p of paramList) {
|
|
315411
315631
|
if (p === paramLower || paramLower.length > 1 && p.startsWith(paramLower)) {
|
|
@@ -315513,7 +315733,7 @@ function checkDenyRuleForGuessedPath(strippedPath, cwd, toolPermissionContext, o
|
|
|
315513
315733
|
if (!strippedPath || strippedPath.includes("\x00"))
|
|
315514
315734
|
return null;
|
|
315515
315735
|
const tildeExpanded = expandTilde3(strippedPath);
|
|
315516
|
-
const abs = isAbsolute27(tildeExpanded) ? tildeExpanded :
|
|
315736
|
+
const abs = isAbsolute27(tildeExpanded) ? tildeExpanded : resolve40(cwd, tildeExpanded);
|
|
315517
315737
|
const { resolvedPath } = safeResolvePath3(getFsImplementation2(), abs);
|
|
315518
315738
|
const permissionType = operationType === "read" ? "read" : "edit";
|
|
315519
315739
|
const denyRule = matchingRuleForInput2(resolvedPath, toolPermissionContext, permissionType, "deny");
|
|
@@ -315603,7 +315823,7 @@ function validatePath3(filePath, cwd, toolPermissionContext, operationType) {
|
|
|
315603
315823
|
};
|
|
315604
315824
|
}
|
|
315605
315825
|
if (containsPathTraversal2(normalizedPath)) {
|
|
315606
|
-
const absolutePath = isAbsolute27(normalizedPath) ? normalizedPath :
|
|
315826
|
+
const absolutePath = isAbsolute27(normalizedPath) ? normalizedPath : resolve40(cwd, normalizedPath);
|
|
315607
315827
|
const { resolvedPath, isCanonical } = safeResolvePath3(getFsImplementation2(), absolutePath);
|
|
315608
315828
|
const result = isPathAllowed2(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
|
|
315609
315829
|
return {
|
|
@@ -315613,7 +315833,7 @@ function validatePath3(filePath, cwd, toolPermissionContext, operationType) {
|
|
|
315613
315833
|
};
|
|
315614
315834
|
}
|
|
315615
315835
|
const basePath = getGlobBaseDirectory2(normalizedPath);
|
|
315616
|
-
const absoluteBasePath = isAbsolute27(basePath) ? basePath :
|
|
315836
|
+
const absoluteBasePath = isAbsolute27(basePath) ? basePath : resolve40(cwd, basePath);
|
|
315617
315837
|
const { resolvedPath } = safeResolvePath3(getFsImplementation2(), absoluteBasePath);
|
|
315618
315838
|
const permissionType = operationType === "read" ? "read" : "edit";
|
|
315619
315839
|
const denyRule = matchingRuleForInput2(resolvedPath, toolPermissionContext, permissionType, "deny");
|
|
@@ -315633,7 +315853,7 @@ function validatePath3(filePath, cwd, toolPermissionContext, operationType) {
|
|
|
315633
315853
|
}
|
|
315634
315854
|
};
|
|
315635
315855
|
}
|
|
315636
|
-
const absolutePath = isAbsolute27(normalizedPath) ? normalizedPath :
|
|
315856
|
+
const absolutePath = isAbsolute27(normalizedPath) ? normalizedPath : resolve40(cwd, normalizedPath);
|
|
315637
315857
|
const { resolvedPath, isCanonical } = safeResolvePath3(getFsImplementation2(), absolutePath);
|
|
315638
315858
|
const result = isPathAllowed2(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
|
|
315639
315859
|
return {
|
|
@@ -317547,7 +317767,7 @@ var init_powershellSecurity = __esm(() => {
|
|
|
317547
317767
|
});
|
|
317548
317768
|
|
|
317549
317769
|
// src/tui/tools/PowerShellTool/powershellPermissions.ts
|
|
317550
|
-
import { resolve as
|
|
317770
|
+
import { resolve as resolve41 } from "path";
|
|
317551
317771
|
async function extractCommandName(command) {
|
|
317552
317772
|
const trimmed = command.trim();
|
|
317553
317773
|
if (!trimmed) {
|
|
@@ -318160,7 +318380,7 @@ async function powershellToolHasPermission(input, context) {
|
|
|
318160
318380
|
const canonical = resolveToCanonical(element.name);
|
|
318161
318381
|
if (canonical === "set-location" && element.args.length > 0) {
|
|
318162
318382
|
const target = element.args.find((a) => a.length === 0 || !PS_TOKENIZER_DASH_CHARS.has(a[0]));
|
|
318163
|
-
if (target &&
|
|
318383
|
+
if (target && resolve41(getCwd(), target) === getCwd()) {
|
|
318164
318384
|
return false;
|
|
318165
318385
|
}
|
|
318166
318386
|
}
|
|
@@ -323176,7 +323396,7 @@ function registerMCPSkillBuilders(b) {
|
|
|
323176
323396
|
var builders = null;
|
|
323177
323397
|
|
|
323178
323398
|
// src/tui/skills/loadSkillsDir.ts
|
|
323179
|
-
import { realpath as
|
|
323399
|
+
import { realpath as realpath11 } from "fs/promises";
|
|
323180
323400
|
import {
|
|
323181
323401
|
basename as basename30,
|
|
323182
323402
|
dirname as dirname56,
|
|
@@ -323205,7 +323425,7 @@ function estimateSkillFrontmatterTokens2(skill) {
|
|
|
323205
323425
|
}
|
|
323206
323426
|
async function getFileIdentity4(filePath) {
|
|
323207
323427
|
try {
|
|
323208
|
-
return await
|
|
323428
|
+
return await realpath11(filePath);
|
|
323209
323429
|
} catch {
|
|
323210
323430
|
return null;
|
|
323211
323431
|
}
|
|
@@ -326554,7 +326774,7 @@ var init_findRelevantMemories = __esm(() => {
|
|
|
326554
326774
|
|
|
326555
326775
|
// src/tui/utils/attachments.ts
|
|
326556
326776
|
import { readdir as readdir21, stat as stat37 } from "fs/promises";
|
|
326557
|
-
import { dirname as dirname58, parse as parse12, relative as relative21, resolve as
|
|
326777
|
+
import { dirname as dirname58, parse as parse12, relative as relative21, resolve as resolve42 } from "path";
|
|
326558
326778
|
import { randomUUID as randomUUID35 } from "crypto";
|
|
326559
326779
|
async function getAttachments(input, toolUseContext, ideSelection, queuedCommands, messages, querySource, options) {
|
|
326560
326780
|
if (isEnvTruthy2(process.env.ATLAS_DISABLE_ATTACHMENTS) || isEnvTruthy2(process.env.ATLAS_SIMPLE)) {
|
|
@@ -326975,7 +327195,7 @@ async function getSelectedLinesFromIDE(ideSelection, toolUseContext) {
|
|
|
326975
327195
|
];
|
|
326976
327196
|
}
|
|
326977
327197
|
function getDirectoriesToProcess(targetPath, originalCwd) {
|
|
326978
|
-
const targetDir = dirname58(
|
|
327198
|
+
const targetDir = dirname58(resolve42(targetPath));
|
|
326979
327199
|
const nestedDirs = [];
|
|
326980
327200
|
let currentDir = targetDir;
|
|
326981
327201
|
while (currentDir !== originalCwd && currentDir !== parse12(currentDir).root) {
|
|
@@ -327274,7 +327494,7 @@ async function getDynamicSkillAttachments(toolUseContext) {
|
|
|
327274
327494
|
const candidates = entries.filter((e) => e.isDirectory() || e.isSymbolicLink()).map((e) => e.name);
|
|
327275
327495
|
const checked = await Promise.all(candidates.map(async (name) => {
|
|
327276
327496
|
try {
|
|
327277
|
-
await stat37(
|
|
327497
|
+
await stat37(resolve42(skillDir, name, "SKILL.md"));
|
|
327278
327498
|
return name;
|
|
327279
327499
|
} catch {
|
|
327280
327500
|
return null;
|
|
@@ -329326,10 +329546,10 @@ var init_marketplaceHelpers = __esm(() => {
|
|
|
329326
329546
|
|
|
329327
329547
|
// src/tui/utils/plugins/officialMarketplaceGcs.ts
|
|
329328
329548
|
import { chmod as chmod5, mkdir as mkdir36, readFile as readFile41, rename as rename4, rm as rm7, writeFile as writeFile27 } from "fs/promises";
|
|
329329
|
-
import { dirname as dirname61, join as join116, resolve as
|
|
329549
|
+
import { dirname as dirname61, join as join116, resolve as resolve43, sep as sep24 } from "path";
|
|
329330
329550
|
async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCacheDir) {
|
|
329331
|
-
const cacheDir =
|
|
329332
|
-
const resolvedLoc =
|
|
329551
|
+
const cacheDir = resolve43(marketplacesCacheDir);
|
|
329552
|
+
const resolvedLoc = resolve43(installLocation);
|
|
329333
329553
|
if (resolvedLoc !== cacheDir && !resolvedLoc.startsWith(cacheDir + sep24)) {
|
|
329334
329554
|
logForDebugging3(`fetchOfficialMarketplaceFromGcs: refusing path outside cache dir: ${installLocation}`, { level: "error" });
|
|
329335
329555
|
return null;
|
|
@@ -329463,7 +329683,7 @@ var init_ascendMarketplace = __esm(() => {
|
|
|
329463
329683
|
});
|
|
329464
329684
|
|
|
329465
329685
|
// src/tui/utils/plugins/orphanScanner.ts
|
|
329466
|
-
import { join as join117, resolve as
|
|
329686
|
+
import { join as join117, resolve as resolve44, sep as sep25 } from "path";
|
|
329467
329687
|
function normalizeRepoRef(ref) {
|
|
329468
329688
|
let u = ref.trim();
|
|
329469
329689
|
const ssh = u.match(/^git@([^:]+):(.+)$/);
|
|
@@ -329507,7 +329727,7 @@ async function readOrphanManifestName(dirPath) {
|
|
|
329507
329727
|
}
|
|
329508
329728
|
async function scanOrphanedMarketplaces() {
|
|
329509
329729
|
const fs = getFsImplementation2();
|
|
329510
|
-
const cacheDir =
|
|
329730
|
+
const cacheDir = resolve44(getMarketplacesCacheDir());
|
|
329511
329731
|
let entries;
|
|
329512
329732
|
try {
|
|
329513
329733
|
entries = await fs.readdir(cacheDir);
|
|
@@ -329515,8 +329735,8 @@ async function scanOrphanedMarketplaces() {
|
|
|
329515
329735
|
return [];
|
|
329516
329736
|
}
|
|
329517
329737
|
const config = await loadKnownMarketplacesConfigSafe();
|
|
329518
|
-
const registered = new Set(Object.values(config).map((e) =>
|
|
329519
|
-
const seedDirs = getPluginSeedDirs().map((d) =>
|
|
329738
|
+
const registered = new Set(Object.values(config).map((e) => resolve44(e.installLocation)));
|
|
329739
|
+
const seedDirs = getPluginSeedDirs().map((d) => resolve44(d));
|
|
329520
329740
|
const orphans = [];
|
|
329521
329741
|
for (const entry of entries) {
|
|
329522
329742
|
if (!entry.isDirectory())
|
|
@@ -329554,7 +329774,7 @@ var init_orphanScanner = __esm(() => {
|
|
|
329554
329774
|
|
|
329555
329775
|
// src/tui/utils/plugins/marketplaceManager.ts
|
|
329556
329776
|
import { writeFile as writeFile28 } from "fs/promises";
|
|
329557
|
-
import { basename as basename35, dirname as dirname62, isAbsolute as isAbsolute31, join as join118, resolve as
|
|
329777
|
+
import { basename as basename35, dirname as dirname62, isAbsolute as isAbsolute31, join as join118, resolve as resolve45, sep as sep26 } from "path";
|
|
329558
329778
|
function getKnownMarketplacesFile() {
|
|
329559
329779
|
return join118(getPluginsDirectory(), "known_marketplaces.json");
|
|
329560
329780
|
}
|
|
@@ -330054,6 +330274,18 @@ async function cacheMarketplaceFromGit(gitUrl, cachePath, ref, sparsePaths, onPr
|
|
|
330054
330274
|
logPluginFetch("marketplace_pull", gitUrl, pullResult.code === 0 ? "success" : "failure", performance.now() - pullStarted, pullResult.code === 0 ? undefined : classifyFetchError(pullResult.stderr));
|
|
330055
330275
|
if (pullResult.code === 0)
|
|
330056
330276
|
return;
|
|
330277
|
+
if (isEnvTruthy2(process.env.ATLAS_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE)) {
|
|
330278
|
+
let cacheExists = false;
|
|
330279
|
+
try {
|
|
330280
|
+
await fs.stat(cachePath);
|
|
330281
|
+
cacheExists = true;
|
|
330282
|
+
} catch {}
|
|
330283
|
+
if (cacheExists) {
|
|
330284
|
+
logForDebugging3(`ATLAS_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE set: keeping stale marketplace cache at ${cachePath} after failed pull (${pullResult.stderr}); skipping re-clone`, { level: "warn" });
|
|
330285
|
+
safeCallProgress(onProgress, "Marketplace update failed; keeping existing cache (ATLAS_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE).");
|
|
330286
|
+
return;
|
|
330287
|
+
}
|
|
330288
|
+
}
|
|
330057
330289
|
logForDebugging3(`git pull failed, will re-clone: ${pullResult.stderr}`, {
|
|
330058
330290
|
level: "warn"
|
|
330059
330291
|
});
|
|
@@ -330340,14 +330572,14 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
330340
330572
|
break;
|
|
330341
330573
|
}
|
|
330342
330574
|
case "file": {
|
|
330343
|
-
const absPath =
|
|
330575
|
+
const absPath = resolve45(source.path);
|
|
330344
330576
|
marketplacePath = absPath;
|
|
330345
330577
|
temporaryCachePath = dirname62(dirname62(absPath));
|
|
330346
330578
|
cleanupNeeded = false;
|
|
330347
330579
|
break;
|
|
330348
330580
|
}
|
|
330349
330581
|
case "directory": {
|
|
330350
|
-
const absPath =
|
|
330582
|
+
const absPath = resolve45(source.path);
|
|
330351
330583
|
marketplacePath = findManifestInDir(absPath, "marketplace.json");
|
|
330352
330584
|
temporaryCachePath = absPath;
|
|
330353
330585
|
cleanupNeeded = false;
|
|
@@ -330379,8 +330611,8 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
330379
330611
|
throw new Error(`Failed to parse marketplace file at ${marketplacePath}: ${errorMessage2(e)}`);
|
|
330380
330612
|
}
|
|
330381
330613
|
const finalCachePath = join118(cacheDir, marketplace.name);
|
|
330382
|
-
const resolvedFinal =
|
|
330383
|
-
const resolvedCacheDir =
|
|
330614
|
+
const resolvedFinal = resolve45(finalCachePath);
|
|
330615
|
+
const resolvedCacheDir = resolve45(cacheDir);
|
|
330384
330616
|
if (!resolvedFinal.startsWith(resolvedCacheDir + sep26)) {
|
|
330385
330617
|
throw new Error(`Marketplace name '${marketplace.name}' resolves to a path outside the cache directory`);
|
|
330386
330618
|
}
|
|
@@ -330429,7 +330661,7 @@ async function captureResolvedSha(source, cachePath) {
|
|
|
330429
330661
|
async function addMarketplaceSource(source, onProgress) {
|
|
330430
330662
|
let resolvedSource = source;
|
|
330431
330663
|
if (isLocalMarketplaceSource(source) && !isAbsolute31(source.path)) {
|
|
330432
|
-
resolvedSource = { ...source, path:
|
|
330664
|
+
resolvedSource = { ...source, path: resolve45(source.path) };
|
|
330433
330665
|
}
|
|
330434
330666
|
if (!isSourceAllowedByPolicy(resolvedSource)) {
|
|
330435
330667
|
if (isSourceInBlocklist(resolvedSource)) {
|
|
@@ -330478,9 +330710,9 @@ Tip: The shorthand "${resolvedSource.repo}" assumes github.com. ` + `For interna
|
|
|
330478
330710
|
}
|
|
330479
330711
|
logForDebugging3(`Marketplace '${marketplace.name}' exists with different source — overwriting`);
|
|
330480
330712
|
if (!isLocalMarketplaceSource(oldEntry.source)) {
|
|
330481
|
-
const cacheDir =
|
|
330482
|
-
const resolvedOld =
|
|
330483
|
-
const resolvedNew =
|
|
330713
|
+
const cacheDir = resolve45(getMarketplacesCacheDir());
|
|
330714
|
+
const resolvedOld = resolve45(oldEntry.installLocation);
|
|
330715
|
+
const resolvedNew = resolve45(cachePath);
|
|
330484
330716
|
if (resolvedOld === resolvedNew) {} else if (resolvedOld === cacheDir || resolvedOld.startsWith(cacheDir + sep26)) {
|
|
330485
330717
|
const fs = getFsImplementation2();
|
|
330486
330718
|
await fs.rm(oldEntry.installLocation, { recursive: true, force: true });
|
|
@@ -330502,7 +330734,7 @@ Tip: The shorthand "${resolvedSource.repo}" assumes github.com. ` + `For interna
|
|
|
330502
330734
|
}
|
|
330503
330735
|
async function adoptOrphanMarketplace(dirName, overrideName) {
|
|
330504
330736
|
const fs = getFsImplementation2();
|
|
330505
|
-
const cacheDir =
|
|
330737
|
+
const cacheDir = resolve45(getMarketplacesCacheDir());
|
|
330506
330738
|
const dirPath = join118(cacheDir, dirName);
|
|
330507
330739
|
if (!fs.existsSync(dirPath) || !fs.statSync(dirPath).isDirectory()) {
|
|
330508
330740
|
throw new Error(`No marketplace directory named '${dirName}' in ${cacheDir}. ` + `Run \`plugin marketplace list\` to see unregistered directories.`);
|
|
@@ -330532,7 +330764,7 @@ async function adoptOrphanMarketplace(dirName, overrideName) {
|
|
|
330532
330764
|
await updateKnownMarketplacesConfig((existing) => {
|
|
330533
330765
|
const prior = existing[name];
|
|
330534
330766
|
if (prior) {
|
|
330535
|
-
if (
|
|
330767
|
+
if (resolve45(prior.installLocation) === resolve45(dirPath)) {
|
|
330536
330768
|
return;
|
|
330537
330769
|
}
|
|
330538
330770
|
throw new Error(`Marketplace name '${name}' is already registered at ` + `${prior.installLocation}. Remove it first ` + `(\`plugin marketplace remove ${name}\`) or adopt under a different name.`);
|
|
@@ -330763,8 +330995,8 @@ async function refreshMarketplace(name, onProgress, options) {
|
|
|
330763
330995
|
throw new Error(`Marketplace '${name}' is seed-managed (${seedDir}) and its content is ` + `controlled by the seed image. To update: ask your admin to update the seed.`);
|
|
330764
330996
|
}
|
|
330765
330997
|
if (!isLocalMarketplaceSource(source)) {
|
|
330766
|
-
const cacheDir =
|
|
330767
|
-
const resolvedLoc =
|
|
330998
|
+
const cacheDir = resolve45(getMarketplacesCacheDir());
|
|
330999
|
+
const resolvedLoc = resolve45(installLocation);
|
|
330768
331000
|
if (resolvedLoc !== cacheDir && !resolvedLoc.startsWith(cacheDir + sep26)) {
|
|
330769
331001
|
throw new Error(`Marketplace '${name}' has a corrupted installLocation ` + `(${installLocation}) — expected a path inside ${cacheDir}. ` + `This can happen after cross-platform path writes or manual edits ` + `to known_marketplaces.json. ` + `Run: claude plugin marketplace remove "${name}" and re-add it.`);
|
|
330770
331002
|
}
|
|
@@ -331768,14 +332000,14 @@ var init_pluginVersioning = __esm(() => {
|
|
|
331768
332000
|
// src/tui/utils/plugins/pluginInstallationHelpers.ts
|
|
331769
332001
|
import { randomBytes as randomBytes16 } from "crypto";
|
|
331770
332002
|
import { rename as rename6, rm as rm8 } from "fs/promises";
|
|
331771
|
-
import { dirname as dirname64, join as join121, resolve as
|
|
332003
|
+
import { dirname as dirname64, join as join121, resolve as resolve46, sep as sep27 } from "path";
|
|
331772
332004
|
function getCurrentTimestamp() {
|
|
331773
332005
|
return new Date().toISOString();
|
|
331774
332006
|
}
|
|
331775
332007
|
function validatePathWithinBase(basePath, relativePath) {
|
|
331776
|
-
const resolvedPath =
|
|
331777
|
-
const normalizedBase =
|
|
331778
|
-
if (!resolvedPath.startsWith(normalizedBase) && resolvedPath !==
|
|
332008
|
+
const resolvedPath = resolve46(basePath, relativePath);
|
|
332009
|
+
const normalizedBase = resolve46(basePath) + sep27;
|
|
332010
|
+
if (!resolvedPath.startsWith(normalizedBase) && resolvedPath !== resolve46(basePath)) {
|
|
331779
332011
|
throw new Error(`Path traversal detected: "${relativePath}" would escape the base directory`);
|
|
331780
332012
|
}
|
|
331781
332013
|
return resolvedPath;
|
|
@@ -332009,14 +332241,14 @@ import {
|
|
|
332009
332241
|
readdir as readdir24,
|
|
332010
332242
|
readFile as readFile43,
|
|
332011
332243
|
readlink,
|
|
332012
|
-
realpath as
|
|
332244
|
+
realpath as realpath12,
|
|
332013
332245
|
rename as rename7,
|
|
332014
332246
|
rm as rm9,
|
|
332015
332247
|
rmdir,
|
|
332016
332248
|
stat as stat40,
|
|
332017
332249
|
symlink as symlink5
|
|
332018
332250
|
} from "fs/promises";
|
|
332019
|
-
import { basename as basename36, dirname as dirname65, join as join122, relative as relative22, resolve as
|
|
332251
|
+
import { basename as basename36, dirname as dirname65, join as join122, relative as relative22, resolve as resolve47, sep as sep28 } from "path";
|
|
332020
332252
|
function getPluginCachePath() {
|
|
332021
332253
|
return join122(getPluginsDirectory(), "cache");
|
|
332022
332254
|
}
|
|
@@ -332073,14 +332305,14 @@ async function copyDir(src, dest) {
|
|
|
332073
332305
|
const linkTarget = await readlink(srcPath);
|
|
332074
332306
|
let resolvedTarget;
|
|
332075
332307
|
try {
|
|
332076
|
-
resolvedTarget = await
|
|
332308
|
+
resolvedTarget = await realpath12(srcPath);
|
|
332077
332309
|
} catch {
|
|
332078
332310
|
await symlink5(linkTarget, destPath);
|
|
332079
332311
|
continue;
|
|
332080
332312
|
}
|
|
332081
332313
|
let resolvedSrc;
|
|
332082
332314
|
try {
|
|
332083
|
-
resolvedSrc = await
|
|
332315
|
+
resolvedSrc = await realpath12(src);
|
|
332084
332316
|
} catch {
|
|
332085
332317
|
resolvedSrc = src;
|
|
332086
332318
|
}
|
|
@@ -332694,7 +332926,7 @@ async function createPluginFromPath(pluginPath, source, enabled, fallbackName, s
|
|
|
332694
332926
|
try {
|
|
332695
332927
|
mergedHooks = await loadPluginHooks2(standardHooksPath, manifest.name);
|
|
332696
332928
|
try {
|
|
332697
|
-
loadedHookPaths.add(await
|
|
332929
|
+
loadedHookPaths.add(await realpath12(standardHooksPath));
|
|
332698
332930
|
} catch {
|
|
332699
332931
|
loadedHookPaths.add(standardHooksPath);
|
|
332700
332932
|
}
|
|
@@ -332733,7 +332965,7 @@ async function createPluginFromPath(pluginPath, source, enabled, fallbackName, s
|
|
|
332733
332965
|
}
|
|
332734
332966
|
let normalizedPath;
|
|
332735
332967
|
try {
|
|
332736
|
-
normalizedPath = await
|
|
332968
|
+
normalizedPath = await realpath12(hookFilePath);
|
|
332737
332969
|
} catch {
|
|
332738
332970
|
normalizedPath = hookFilePath;
|
|
332739
332971
|
}
|
|
@@ -333370,7 +333602,7 @@ async function loadSessionOnlyPlugins(sessionPluginPaths) {
|
|
|
333370
333602
|
const errors = [];
|
|
333371
333603
|
for (const [index, pluginPath] of sessionPluginPaths.entries()) {
|
|
333372
333604
|
try {
|
|
333373
|
-
const resolvedPath =
|
|
333605
|
+
const resolvedPath = resolve47(pluginPath);
|
|
333374
333606
|
if (!await pathExists2(resolvedPath)) {
|
|
333375
333607
|
logForDebugging3(`Plugin path does not exist: ${resolvedPath}, skipping`, { level: "warn" });
|
|
333376
333608
|
errors.push({
|
|
@@ -335815,7 +336047,7 @@ ${skill.content}`).join(`
|
|
|
335815
336047
|
`);
|
|
335816
336048
|
return wrapMessagesInSystemReminder([
|
|
335817
336049
|
createUserMessage2({
|
|
335818
|
-
content: `The following skills were invoked in this session. Continue to
|
|
336050
|
+
content: `The following skills were previously invoked in this session (their content is re-surfaced here after compaction). They are provided for context only — do not re-execute these skills or perform their one-time setup actions (e.g., scheduling, creating files) again. Continue to apply their ongoing guidelines where still relevant:
|
|
335819
336051
|
|
|
335820
336052
|
${skillsContent}`,
|
|
335821
336053
|
isMeta: true
|
|
@@ -338449,7 +338681,7 @@ __export(exports_permissionSetup, {
|
|
|
338449
338681
|
verifyAutoModeGateAccess: () => verifyAutoModeGateAccess
|
|
338450
338682
|
});
|
|
338451
338683
|
import { relative as relative23 } from "path";
|
|
338452
|
-
import { resolve as
|
|
338684
|
+
import { resolve as resolve48 } from "path";
|
|
338453
338685
|
function isDangerousBashPermission(toolName, ruleContent) {
|
|
338454
338686
|
if (toolName !== BASH_TOOL_NAME2) {
|
|
338455
338687
|
return false;
|
|
@@ -338721,7 +338953,7 @@ function isSymlinkTo2({
|
|
|
338721
338953
|
originalCwd
|
|
338722
338954
|
}) {
|
|
338723
338955
|
const { resolvedPath: resolvedProcessPwd, isSymlink: isProcessPwdSymlink } = safeResolvePath3(getFsImplementation2(), processPwd);
|
|
338724
|
-
return isProcessPwdSymlink ? resolvedProcessPwd ===
|
|
338956
|
+
return isProcessPwdSymlink ? resolvedProcessPwd === resolve48(originalCwd) : false;
|
|
338725
338957
|
}
|
|
338726
338958
|
function initialPermissionModeFromCLI2({
|
|
338727
338959
|
permissionModeCli,
|
|
@@ -346342,6 +346574,65 @@ var init_color3 = __esm(() => {
|
|
|
346342
346574
|
color_default = color2;
|
|
346343
346575
|
});
|
|
346344
346576
|
|
|
346577
|
+
// src/tui/commands/tui/tui.ts
|
|
346578
|
+
var exports_tui = {};
|
|
346579
|
+
__export(exports_tui, {
|
|
346580
|
+
call: () => call7
|
|
346581
|
+
});
|
|
346582
|
+
var ON_ALIASES, OFF_ALIASES, USAGE = "Usage: /tui fullscreen|off (no argument = status)", call7 = (onDone, context, args) => {
|
|
346583
|
+
const arg = (args ?? "").trim().toLowerCase();
|
|
346584
|
+
if (arg === "") {
|
|
346585
|
+
const active = getFullscreenRuntimeOverride() ?? isFullscreenEnvEnabled();
|
|
346586
|
+
onDone(`Fullscreen rendering: ${active ? "on" : "off"} (this session) · ${USAGE}`, { display: "system" });
|
|
346587
|
+
return Promise.resolve(null);
|
|
346588
|
+
}
|
|
346589
|
+
let target;
|
|
346590
|
+
if (ON_ALIASES.includes(arg)) {
|
|
346591
|
+
target = true;
|
|
346592
|
+
} else if (OFF_ALIASES.includes(arg)) {
|
|
346593
|
+
target = false;
|
|
346594
|
+
} else {
|
|
346595
|
+
onDone(`Invalid /tui argument "${arg}". ${USAGE}`, { display: "system" });
|
|
346596
|
+
return Promise.resolve(null);
|
|
346597
|
+
}
|
|
346598
|
+
const { error } = updateSettingsForSource2("userSettings", {
|
|
346599
|
+
tui: { fullscreen: target }
|
|
346600
|
+
});
|
|
346601
|
+
if (error) {
|
|
346602
|
+
onDone(`Failed to persist fullscreen setting: ${error.message}`, {
|
|
346603
|
+
display: "system"
|
|
346604
|
+
});
|
|
346605
|
+
return Promise.resolve(null);
|
|
346606
|
+
}
|
|
346607
|
+
setFullscreenRuntimeOverride(target);
|
|
346608
|
+
context.setAppState((prev) => ({
|
|
346609
|
+
...prev,
|
|
346610
|
+
settings: { ...prev.settings, tui: { fullscreen: target } }
|
|
346611
|
+
}));
|
|
346612
|
+
onDone(target ? "Fullscreen rendering enabled for this session (in-session switch, no restart). Persisted to user settings." : "Fullscreen rendering disabled for this session (in-session switch, no restart). Persisted to user settings.", { display: "system" });
|
|
346613
|
+
return Promise.resolve(null);
|
|
346614
|
+
};
|
|
346615
|
+
var init_tui = __esm(() => {
|
|
346616
|
+
init_fullscreen();
|
|
346617
|
+
init_settings3();
|
|
346618
|
+
ON_ALIASES = ["fullscreen", "on", "true", "1"];
|
|
346619
|
+
OFF_ALIASES = ["off", "default", "reset", "false", "0"];
|
|
346620
|
+
});
|
|
346621
|
+
|
|
346622
|
+
// src/tui/commands/tui/index.ts
|
|
346623
|
+
var tui, tui_default;
|
|
346624
|
+
var init_tui2 = __esm(() => {
|
|
346625
|
+
tui = {
|
|
346626
|
+
type: "local-jsx",
|
|
346627
|
+
name: "tui",
|
|
346628
|
+
description: "Toggle fullscreen rendering for this session (no restart): /tui fullscreen|off, no argument = status",
|
|
346629
|
+
immediate: true,
|
|
346630
|
+
argumentHint: "<fullscreen|off>",
|
|
346631
|
+
load: () => Promise.resolve().then(() => (init_tui(), exports_tui))
|
|
346632
|
+
};
|
|
346633
|
+
tui_default = tui;
|
|
346634
|
+
});
|
|
346635
|
+
|
|
346345
346636
|
// src/tui/commands/commit.ts
|
|
346346
346637
|
function getPromptContent() {
|
|
346347
346638
|
const { commit: commitAttribution } = getAttributionTexts();
|
|
@@ -346427,7 +346718,7 @@ var init_commit = __esm(() => {
|
|
|
346427
346718
|
// src/tui/commands/copy/copy.tsx
|
|
346428
346719
|
var exports_copy = {};
|
|
346429
346720
|
__export(exports_copy, {
|
|
346430
|
-
call: () =>
|
|
346721
|
+
call: () => call8,
|
|
346431
346722
|
collectRecentAssistantTexts: () => collectRecentAssistantTexts,
|
|
346432
346723
|
fileExtension: () => fileExtension2
|
|
346433
346724
|
});
|
|
@@ -346755,7 +347046,7 @@ function _temp46(block, index) {
|
|
|
346755
347046
|
description: [block.lang, blockLines > 1 ? `${blockLines} lines` : undefined].filter(Boolean).join(", ") || undefined
|
|
346756
347047
|
};
|
|
346757
347048
|
}
|
|
346758
|
-
var import_compiler_runtime113, import_react81, jsx_dev_runtime138, COPY_DIR, RESPONSE_FILENAME = "response.md", MAX_LOOKBACK = 20,
|
|
347049
|
+
var import_compiler_runtime113, import_react81, jsx_dev_runtime138, COPY_DIR, RESPONSE_FILENAME = "response.md", MAX_LOOKBACK = 20, call8 = async (onDone, context, args) => {
|
|
346759
347050
|
const texts = collectRecentAssistantTexts(context.messages);
|
|
346760
347051
|
if (texts.length === 0) {
|
|
346761
347052
|
onDone("No assistant message to copy");
|
|
@@ -347396,7 +347687,7 @@ var init_CustomSelect = __esm(() => {
|
|
|
347396
347687
|
// src/tui/commands/autocompact/autocompact.tsx
|
|
347397
347688
|
var exports_autocompact = {};
|
|
347398
347689
|
__export(exports_autocompact, {
|
|
347399
|
-
call: () =>
|
|
347690
|
+
call: () => call9
|
|
347400
347691
|
});
|
|
347401
347692
|
function currentToOptionValue(setting) {
|
|
347402
347693
|
if (!setting || setting.kind === "auto")
|
|
@@ -347540,7 +347831,7 @@ function AutoCompactCommand({ onDone }) {
|
|
|
347540
347831
|
]
|
|
347541
347832
|
}, undefined, true, undefined, this);
|
|
347542
347833
|
}
|
|
347543
|
-
var React41, jsx_dev_runtime140, PRESET_TIERS,
|
|
347834
|
+
var React41, jsx_dev_runtime140, PRESET_TIERS, call9 = async (onDone, _context, args) => {
|
|
347544
347835
|
const raw = (args ?? "").trim();
|
|
347545
347836
|
if (raw === "") {
|
|
347546
347837
|
return /* @__PURE__ */ jsx_dev_runtime140.jsxDEV(AutoCompactCommand, {
|
|
@@ -347665,7 +347956,7 @@ var init_sessionMemoryUtils = __esm(() => {
|
|
|
347665
347956
|
// src/tui/commands/compact/compact.ts
|
|
347666
347957
|
var exports_compact = {};
|
|
347667
347958
|
__export(exports_compact, {
|
|
347668
|
-
call: () =>
|
|
347959
|
+
call: () => call10
|
|
347669
347960
|
});
|
|
347670
347961
|
async function compactViaReactive(messages, context, customInstructions, reactive) {
|
|
347671
347962
|
context.onCompactProgress?.({
|
|
@@ -347678,6 +347969,13 @@ async function compactViaReactive(messages, context, customInstructions, reactiv
|
|
|
347678
347969
|
executePreCompactHooks({ trigger: "manual", customInstructions: customInstructions || null }, context.abortController.signal),
|
|
347679
347970
|
getCacheSharingParams(context, messages)
|
|
347680
347971
|
]);
|
|
347972
|
+
if (hookResult.blocked) {
|
|
347973
|
+
const skipReason = hookResult.blockingReason ?? "PreCompact hook blocked compaction";
|
|
347974
|
+
return {
|
|
347975
|
+
type: "text",
|
|
347976
|
+
value: source_default.dim(`Compaction skipped: PreCompact hook blocked (${skipReason})`)
|
|
347977
|
+
};
|
|
347978
|
+
}
|
|
347681
347979
|
const mergedInstructions = mergeHookInstructions(customInstructions, hookResult.newCustomInstructions);
|
|
347682
347980
|
context.setStreamMode?.("requesting");
|
|
347683
347981
|
context.setResponseLength?.(() => 0);
|
|
@@ -347749,7 +348047,7 @@ async function getCacheSharingParams(context, forkContextMessages) {
|
|
|
347749
348047
|
forkContextMessages
|
|
347750
348048
|
};
|
|
347751
348049
|
}
|
|
347752
|
-
var reactiveCompact,
|
|
348050
|
+
var reactiveCompact, call10 = async (args, context) => {
|
|
347753
348051
|
const { abortController } = context;
|
|
347754
348052
|
let { messages } = context;
|
|
347755
348053
|
messages = getMessagesAfterCompactBoundary(messages);
|
|
@@ -347781,6 +348079,12 @@ var reactiveCompact, call9 = async (args, context) => {
|
|
|
347781
348079
|
const microcompactResult = await microcompactMessages(messages, context);
|
|
347782
348080
|
const messagesForCompact = microcompactResult.messages;
|
|
347783
348081
|
const result = await compactConversation(messagesForCompact, context, await getCacheSharingParams(context, messagesForCompact), false, customInstructions, false);
|
|
348082
|
+
if (result.compactionSkipped) {
|
|
348083
|
+
return {
|
|
348084
|
+
type: "text",
|
|
348085
|
+
value: source_default.dim(`Compaction skipped: PreCompact hook blocked (${result.compactSkipReason ?? "unknown"})`)
|
|
348086
|
+
};
|
|
348087
|
+
}
|
|
347784
348088
|
setLastSummarizedMessageId2(undefined);
|
|
347785
348089
|
suppressCompactWarning();
|
|
347786
348090
|
getUserContext.cache.clear?.();
|
|
@@ -348827,7 +349131,7 @@ var init_packageManagers = __esm(() => {
|
|
|
348827
349131
|
});
|
|
348828
349132
|
|
|
348829
349133
|
// src/tui/utils/doctorDiagnostic.ts
|
|
348830
|
-
import { readFile as readFile49, realpath as
|
|
349134
|
+
import { readFile as readFile49, realpath as realpath13 } from "fs/promises";
|
|
348831
349135
|
import { homedir as homedir33 } from "os";
|
|
348832
349136
|
import { delimiter as delimiter2, join as join134, posix as posix8, win32 as win322 } from "path";
|
|
348833
349137
|
function getNormalizedPaths() {
|
|
@@ -348883,7 +349187,7 @@ async function getInstallationPath() {
|
|
|
348883
349187
|
}
|
|
348884
349188
|
if (isInBundledMode2()) {
|
|
348885
349189
|
try {
|
|
348886
|
-
return await
|
|
349190
|
+
return await realpath13(process.execPath);
|
|
348887
349191
|
} catch {}
|
|
348888
349192
|
try {
|
|
348889
349193
|
const path = await which("atlas");
|
|
@@ -348942,7 +349246,7 @@ async function detectMultipleInstallations() {
|
|
|
348942
349246
|
if (globalBinExists) {
|
|
348943
349247
|
let isCurrentHomebrewInstallation = false;
|
|
348944
349248
|
try {
|
|
348945
|
-
const realPath = await
|
|
349249
|
+
const realPath = await realpath13(globalBinPath);
|
|
348946
349250
|
if (realPath.includes("/Caskroom/")) {
|
|
348947
349251
|
isCurrentHomebrewInstallation = detectHomebrew();
|
|
348948
349252
|
}
|
|
@@ -349486,7 +349790,7 @@ import {
|
|
|
349486
349790
|
mkdir as mkdir40,
|
|
349487
349791
|
readdir as readdir26,
|
|
349488
349792
|
readlink as readlink2,
|
|
349489
|
-
realpath as
|
|
349793
|
+
realpath as realpath14,
|
|
349490
349794
|
rename as rename8,
|
|
349491
349795
|
rm as rm10,
|
|
349492
349796
|
rmdir as rmdir2,
|
|
@@ -349496,7 +349800,7 @@ import {
|
|
|
349496
349800
|
writeFile as writeFile36
|
|
349497
349801
|
} from "fs/promises";
|
|
349498
349802
|
import { homedir as homedir34 } from "os";
|
|
349499
|
-
import { basename as basename42, delimiter as delimiter3, dirname as dirname69, join as join137, resolve as
|
|
349803
|
+
import { basename as basename42, delimiter as delimiter3, dirname as dirname69, join as join137, resolve as resolve49 } from "path";
|
|
349500
349804
|
function getPlatform4() {
|
|
349501
349805
|
const os = env5.platform;
|
|
349502
349806
|
const arch = process.arch === "x64" ? "x64" : process.arch === "arm64" ? "arm64" : null;
|
|
@@ -349844,8 +350148,8 @@ async function updateSymlink(symlinkPath, targetPath) {
|
|
|
349844
350148
|
if (symlinkExists) {
|
|
349845
350149
|
try {
|
|
349846
350150
|
const currentTarget = await readlink2(symlinkPath);
|
|
349847
|
-
const resolvedCurrentTarget =
|
|
349848
|
-
const resolvedTargetPath =
|
|
350151
|
+
const resolvedCurrentTarget = resolve49(dirname69(symlinkPath), currentTarget);
|
|
350152
|
+
const resolvedTargetPath = resolve49(targetPath);
|
|
349849
350153
|
if (resolvedCurrentTarget === resolvedTargetPath) {
|
|
349850
350154
|
return false;
|
|
349851
350155
|
}
|
|
@@ -349885,7 +350189,7 @@ async function checkInstall(force = false) {
|
|
|
349885
350189
|
const dirs = getBaseDirectories();
|
|
349886
350190
|
const messages = [];
|
|
349887
350191
|
const localBinDir = dirname69(dirs.executable);
|
|
349888
|
-
const resolvedLocalBinPath =
|
|
350192
|
+
const resolvedLocalBinPath = resolve49(localBinDir);
|
|
349889
350193
|
const platform = getPlatform4();
|
|
349890
350194
|
const isWindows = platform.startsWith("win32");
|
|
349891
350195
|
try {
|
|
@@ -349908,7 +350212,7 @@ async function checkInstall(force = false) {
|
|
|
349908
350212
|
} else {
|
|
349909
350213
|
try {
|
|
349910
350214
|
const target = await readlink2(dirs.executable);
|
|
349911
|
-
const absoluteTarget =
|
|
350215
|
+
const absoluteTarget = resolve49(dirname69(dirs.executable), target);
|
|
349912
350216
|
if (!await isPossibleClaudeBinary(absoluteTarget)) {
|
|
349913
350217
|
messages.push({
|
|
349914
350218
|
message: `AtlasCode symlink points to missing or invalid binary: ${target}`,
|
|
@@ -349936,7 +350240,7 @@ async function checkInstall(force = false) {
|
|
|
349936
350240
|
}
|
|
349937
350241
|
const isInCurrentPath = (process.env.PATH || "").split(delimiter3).some((entry) => {
|
|
349938
350242
|
try {
|
|
349939
|
-
const resolvedEntry =
|
|
350243
|
+
const resolvedEntry = resolve49(entry);
|
|
349940
350244
|
if (isWindows) {
|
|
349941
350245
|
return resolvedEntry.toLowerCase() === resolvedLocalBinPath.toLowerCase();
|
|
349942
350246
|
}
|
|
@@ -350015,7 +350319,7 @@ async function installLatestImpl(channelOrVersion, forceReinstall = false) {
|
|
|
350015
350319
|
async function getVersionFromSymlink(symlinkPath) {
|
|
350016
350320
|
try {
|
|
350017
350321
|
const target = await readlink2(symlinkPath);
|
|
350018
|
-
const absoluteTarget =
|
|
350322
|
+
const absoluteTarget = resolve49(dirname69(symlinkPath), target);
|
|
350019
350323
|
if (await isPossibleClaudeBinary(absoluteTarget)) {
|
|
350020
350324
|
return absoluteTarget;
|
|
350021
350325
|
}
|
|
@@ -350031,7 +350335,7 @@ async function lockCurrentVersion() {
|
|
|
350031
350335
|
if (!process.execPath.includes(dirs.versions)) {
|
|
350032
350336
|
return;
|
|
350033
350337
|
}
|
|
350034
|
-
const versionPath =
|
|
350338
|
+
const versionPath = resolve49(process.execPath);
|
|
350035
350339
|
try {
|
|
350036
350340
|
const lockfilePath = getLockFilePathFromVersionPath(dirs, versionPath);
|
|
350037
350341
|
await mkdir40(dirs.locks, { recursive: true });
|
|
@@ -350177,7 +350481,7 @@ async function cleanupOldVersions() {
|
|
|
350177
350481
|
versionFiles.push({
|
|
350178
350482
|
name: entry,
|
|
350179
350483
|
path: entryPath,
|
|
350180
|
-
resolvedPath:
|
|
350484
|
+
resolvedPath: resolve49(entryPath),
|
|
350181
350485
|
mtime: stats.mtime
|
|
350182
350486
|
});
|
|
350183
350487
|
} catch {}
|
|
@@ -350192,7 +350496,7 @@ async function cleanupOldVersions() {
|
|
|
350192
350496
|
const currentBinaryPath = process.execPath;
|
|
350193
350497
|
const protectedVersions = new Set;
|
|
350194
350498
|
if (currentBinaryPath && currentBinaryPath.includes(dirs.versions)) {
|
|
350195
|
-
protectedVersions.add(
|
|
350499
|
+
protectedVersions.add(resolve49(currentBinaryPath));
|
|
350196
350500
|
}
|
|
350197
350501
|
const currentSymlinkVersion = await getVersionFromSymlink(dirs.executable);
|
|
350198
350502
|
if (currentSymlinkVersion) {
|
|
@@ -350254,7 +350558,7 @@ async function isNpmSymlink(executablePath) {
|
|
|
350254
350558
|
let targetPath = executablePath;
|
|
350255
350559
|
const stats = await lstat6(executablePath);
|
|
350256
350560
|
if (stats.isSymbolicLink()) {
|
|
350257
|
-
targetPath = await
|
|
350561
|
+
targetPath = await realpath14(executablePath);
|
|
350258
350562
|
}
|
|
350259
350563
|
return targetPath.endsWith(".js") || targetPath.includes("node_modules");
|
|
350260
350564
|
}
|
|
@@ -354834,9 +355138,9 @@ var init_Settings = __esm(() => {
|
|
|
354834
355138
|
// src/tui/commands/config/config.tsx
|
|
354835
355139
|
var exports_config = {};
|
|
354836
355140
|
__export(exports_config, {
|
|
354837
|
-
call: () =>
|
|
355141
|
+
call: () => call11
|
|
354838
355142
|
});
|
|
354839
|
-
var jsx_dev_runtime153,
|
|
355143
|
+
var jsx_dev_runtime153, call11 = async (onDone, context) => {
|
|
354840
355144
|
return /* @__PURE__ */ jsx_dev_runtime153.jsxDEV(Settings, {
|
|
354841
355145
|
onClose: onDone,
|
|
354842
355146
|
context,
|
|
@@ -356072,7 +356376,7 @@ var projectView = () => ({});
|
|
|
356072
356376
|
// src/tui/commands/context/context.tsx
|
|
356073
356377
|
var exports_context = {};
|
|
356074
356378
|
__export(exports_context, {
|
|
356075
|
-
call: () =>
|
|
356379
|
+
call: () => call12
|
|
356076
356380
|
});
|
|
356077
356381
|
function toApiView(messages) {
|
|
356078
356382
|
let view = getMessagesAfterCompactBoundary(messages);
|
|
@@ -356082,7 +356386,7 @@ function toApiView(messages) {
|
|
|
356082
356386
|
}
|
|
356083
356387
|
return view;
|
|
356084
356388
|
}
|
|
356085
|
-
async function
|
|
356389
|
+
async function call12(onDone, context) {
|
|
356086
356390
|
const {
|
|
356087
356391
|
messages,
|
|
356088
356392
|
getAppState,
|
|
@@ -356118,7 +356422,7 @@ var init_context3 = __esm(() => {
|
|
|
356118
356422
|
// src/tui/commands/context/context-noninteractive.ts
|
|
356119
356423
|
var exports_context_noninteractive = {};
|
|
356120
356424
|
__export(exports_context_noninteractive, {
|
|
356121
|
-
call: () =>
|
|
356425
|
+
call: () => call13,
|
|
356122
356426
|
collectContextData: () => collectContextData
|
|
356123
356427
|
});
|
|
356124
356428
|
async function collectContextData(context) {
|
|
@@ -356142,7 +356446,7 @@ async function collectContextData(context) {
|
|
|
356142
356446
|
const appState = getAppState();
|
|
356143
356447
|
return analyzeContextUsage(compactedMessages, mainLoopModel, async () => appState.toolPermissionContext, tools, agentDefinitions, undefined, { options: { customSystemPrompt, appendSystemPrompt } }, undefined, apiView);
|
|
356144
356448
|
}
|
|
356145
|
-
async function
|
|
356449
|
+
async function call13(_args, context) {
|
|
356146
356450
|
const data = await collectContextData(context);
|
|
356147
356451
|
return {
|
|
356148
356452
|
type: "text",
|
|
@@ -356437,9 +356741,9 @@ var init_context4 = __esm(() => {
|
|
|
356437
356741
|
// src/tui/commands/cost/cost.ts
|
|
356438
356742
|
var exports_cost = {};
|
|
356439
356743
|
__export(exports_cost, {
|
|
356440
|
-
call: () =>
|
|
356744
|
+
call: () => call14
|
|
356441
356745
|
});
|
|
356442
|
-
var
|
|
356746
|
+
var call14 = async () => {
|
|
356443
356747
|
return { type: "text", value: formatTotalCost() };
|
|
356444
356748
|
};
|
|
356445
356749
|
var init_cost = __esm(() => {
|
|
@@ -356662,7 +356966,7 @@ var init_useTurnDiffs = __esm(() => {
|
|
|
356662
356966
|
});
|
|
356663
356967
|
|
|
356664
356968
|
// src/tui/components/diff/DiffDetailView.tsx
|
|
356665
|
-
import { resolve as
|
|
356969
|
+
import { resolve as resolve50 } from "path";
|
|
356666
356970
|
function DiffDetailView(t0) {
|
|
356667
356971
|
const $ = import_compiler_runtime130.c(53);
|
|
356668
356972
|
const {
|
|
@@ -356695,7 +356999,7 @@ function DiffDetailView(t0) {
|
|
|
356695
356999
|
let content;
|
|
356696
357000
|
let t2;
|
|
356697
357001
|
if ($[1] !== filePath) {
|
|
356698
|
-
const fullPath =
|
|
357002
|
+
const fullPath = resolve50(getCwd(), filePath);
|
|
356699
357003
|
content = readFileSafe2(fullPath);
|
|
356700
357004
|
t2 = content?.split(`
|
|
356701
357005
|
`)[0] ?? null;
|
|
@@ -357915,9 +358219,9 @@ var init_DiffDialog = __esm(() => {
|
|
|
357915
358219
|
// src/tui/commands/diff/diff.tsx
|
|
357916
358220
|
var exports_diff = {};
|
|
357917
358221
|
__export(exports_diff, {
|
|
357918
|
-
call: () =>
|
|
358222
|
+
call: () => call15
|
|
357919
358223
|
});
|
|
357920
|
-
var jsx_dev_runtime162,
|
|
358224
|
+
var jsx_dev_runtime162, call15 = async (onDone, context) => {
|
|
357921
358225
|
await Promise.resolve().then(() => init_DiffDialog());
|
|
357922
358226
|
return /* @__PURE__ */ jsx_dev_runtime162.jsxDEV(DiffDialog, {
|
|
357923
358227
|
messages: context.messages,
|
|
@@ -360115,9 +360419,9 @@ var init_Doctor = __esm(() => {
|
|
|
360115
360419
|
// src/tui/commands/doctor/doctor.tsx
|
|
360116
360420
|
var exports_doctor = {};
|
|
360117
360421
|
__export(exports_doctor, {
|
|
360118
|
-
call: () =>
|
|
360422
|
+
call: () => call16
|
|
360119
360423
|
});
|
|
360120
|
-
var jsx_dev_runtime169,
|
|
360424
|
+
var jsx_dev_runtime169, call16 = (onDone, _context, _args) => {
|
|
360121
360425
|
return Promise.resolve(/* @__PURE__ */ jsx_dev_runtime169.jsxDEV(Doctor, {
|
|
360122
360426
|
onDone
|
|
360123
360427
|
}, undefined, false, undefined, this));
|
|
@@ -360890,7 +361194,7 @@ var init_promptEditor = __esm(() => {
|
|
|
360890
361194
|
// src/tui/commands/memory/memory.tsx
|
|
360891
361195
|
var exports_memory = {};
|
|
360892
361196
|
__export(exports_memory, {
|
|
360893
|
-
call: () =>
|
|
361197
|
+
call: () => call17
|
|
360894
361198
|
});
|
|
360895
361199
|
import { mkdir as mkdir42, writeFile as writeFile37 } from "fs/promises";
|
|
360896
361200
|
function MemoryCommand({
|
|
@@ -360970,7 +361274,7 @@ ${editorHint}`, {
|
|
|
360970
361274
|
}, undefined, true, undefined, this)
|
|
360971
361275
|
}, undefined, false, undefined, this);
|
|
360972
361276
|
}
|
|
360973
|
-
var React48, jsx_dev_runtime171,
|
|
361277
|
+
var React48, jsx_dev_runtime171, call17 = async (onDone) => {
|
|
360974
361278
|
clearMemoryFileCaches();
|
|
360975
361279
|
await getMemoryFiles();
|
|
360976
361280
|
return /* @__PURE__ */ jsx_dev_runtime171.jsxDEV(MemoryCommand, {
|
|
@@ -361926,9 +362230,9 @@ var init_HelpV2 = __esm(() => {
|
|
|
361926
362230
|
// src/tui/commands/help/help.tsx
|
|
361927
362231
|
var exports_help = {};
|
|
361928
362232
|
__export(exports_help, {
|
|
361929
|
-
call: () =>
|
|
362233
|
+
call: () => call18
|
|
361930
362234
|
});
|
|
361931
|
-
var jsx_dev_runtime176,
|
|
362235
|
+
var jsx_dev_runtime176, call18 = async (onDone, {
|
|
361932
362236
|
options: {
|
|
361933
362237
|
commands
|
|
361934
362238
|
}
|
|
@@ -362135,7 +362439,7 @@ var init_IdeAutoConnectDialog = __esm(() => {
|
|
|
362135
362439
|
// src/tui/commands/ide/ide.tsx
|
|
362136
362440
|
var exports_ide = {};
|
|
362137
362441
|
__export(exports_ide, {
|
|
362138
|
-
call: () =>
|
|
362442
|
+
call: () => call19,
|
|
362139
362443
|
formatWorkspaceFolders: () => formatWorkspaceFolders
|
|
362140
362444
|
});
|
|
362141
362445
|
import * as path22 from "path";
|
|
@@ -362614,7 +362918,7 @@ function InstallOnMount(t0) {
|
|
|
362614
362918
|
import_react99.useEffect(t1, t2);
|
|
362615
362919
|
return null;
|
|
362616
362920
|
}
|
|
362617
|
-
async function
|
|
362921
|
+
async function call19(onDone, context, args) {
|
|
362618
362922
|
const {
|
|
362619
362923
|
options: {
|
|
362620
362924
|
dynamicMcpConfig
|
|
@@ -363394,11 +363698,11 @@ var init_template2 = __esm(() => {
|
|
|
363394
363698
|
// src/tui/commands/keybindings/keybindings.ts
|
|
363395
363699
|
var exports_keybindings = {};
|
|
363396
363700
|
__export(exports_keybindings, {
|
|
363397
|
-
call: () =>
|
|
363701
|
+
call: () => call20
|
|
363398
363702
|
});
|
|
363399
363703
|
import { mkdir as mkdir43, writeFile as writeFile38 } from "fs/promises";
|
|
363400
363704
|
import { dirname as dirname70 } from "path";
|
|
363401
|
-
async function
|
|
363705
|
+
async function call20() {
|
|
363402
363706
|
if (!isKeybindingCustomizationEnabled()) {
|
|
363403
363707
|
return {
|
|
363404
363708
|
type: "text",
|
|
@@ -363687,9 +363991,9 @@ var init_user = __esm(() => {
|
|
|
363687
363991
|
var exports_login = {};
|
|
363688
363992
|
__export(exports_login, {
|
|
363689
363993
|
Login: () => Login,
|
|
363690
|
-
call: () =>
|
|
363994
|
+
call: () => call21
|
|
363691
363995
|
});
|
|
363692
|
-
async function
|
|
363996
|
+
async function call21(onDone, context) {
|
|
363693
363997
|
return /* @__PURE__ */ jsx_dev_runtime180.jsxDEV(Login, {
|
|
363694
363998
|
onDone: async (success) => {
|
|
363695
363999
|
context.onChangeAPIKey();
|
|
@@ -363811,7 +364115,7 @@ var init_login2 = __esm(() => {
|
|
|
363811
364115
|
// src/tui/commands/logout/logout.tsx
|
|
363812
364116
|
var exports_logout = {};
|
|
363813
364117
|
__export(exports_logout, {
|
|
363814
|
-
call: () =>
|
|
364118
|
+
call: () => call22,
|
|
363815
364119
|
clearAuthRelatedCaches: () => clearAuthRelatedCaches,
|
|
363816
364120
|
performLogout: () => performLogout
|
|
363817
364121
|
});
|
|
@@ -363848,7 +364152,7 @@ async function clearAuthRelatedCaches() {
|
|
|
363848
364152
|
resetUserCache();
|
|
363849
364153
|
refreshGrowthBookAfterAuthChange();
|
|
363850
364154
|
}
|
|
363851
|
-
async function
|
|
364155
|
+
async function call22() {
|
|
363852
364156
|
await performLogout({
|
|
363853
364157
|
clearOnboarding: true
|
|
363854
364158
|
});
|
|
@@ -370020,7 +370324,7 @@ var init_mcp5 = __esm(() => {
|
|
|
370020
370324
|
// src/tui/commands/mcp/mcp.tsx
|
|
370021
370325
|
var exports_mcp = {};
|
|
370022
370326
|
__export(exports_mcp, {
|
|
370023
|
-
call: () =>
|
|
370327
|
+
call: () => call23
|
|
370024
370328
|
});
|
|
370025
370329
|
function MCPToggle(t0) {
|
|
370026
370330
|
const $ = import_compiler_runtime161.c(7);
|
|
@@ -370073,7 +370377,7 @@ function _temp235(c) {
|
|
|
370073
370377
|
function _temp89(s) {
|
|
370074
370378
|
return s.mcp.clients;
|
|
370075
370379
|
}
|
|
370076
|
-
async function
|
|
370380
|
+
async function call23(onDone, _context, args) {
|
|
370077
370381
|
if (args) {
|
|
370078
370382
|
const parts = args.trim().split(/\s+/);
|
|
370079
370383
|
if (parts[0] === "no-redirect") {
|
|
@@ -370279,7 +370583,7 @@ var init_releaseNotes = __esm(() => {
|
|
|
370279
370583
|
// src/tui/commands/release-notes/release-notes.ts
|
|
370280
370584
|
var exports_release_notes = {};
|
|
370281
370585
|
__export(exports_release_notes, {
|
|
370282
|
-
call: () =>
|
|
370586
|
+
call: () => call24
|
|
370283
370587
|
});
|
|
370284
370588
|
function formatReleaseNotes(notes) {
|
|
370285
370589
|
return notes.map(([version, notes]) => {
|
|
@@ -370292,7 +370596,7 @@ ${bulletPoints}`;
|
|
|
370292
370596
|
|
|
370293
370597
|
`);
|
|
370294
370598
|
}
|
|
370295
|
-
async function
|
|
370599
|
+
async function call24() {
|
|
370296
370600
|
let freshNotes = [];
|
|
370297
370601
|
try {
|
|
370298
370602
|
const timeoutPromise = new Promise((_, reject) => {
|
|
@@ -370483,9 +370787,9 @@ var init_generateSessionName = __esm(() => {
|
|
|
370483
370787
|
// src/tui/commands/rename/rename.ts
|
|
370484
370788
|
var exports_rename = {};
|
|
370485
370789
|
__export(exports_rename, {
|
|
370486
|
-
call: () =>
|
|
370790
|
+
call: () => call25
|
|
370487
370791
|
});
|
|
370488
|
-
async function
|
|
370792
|
+
async function call25(onDone, context, args) {
|
|
370489
370793
|
if (isTeammate2()) {
|
|
370490
370794
|
onDone("Cannot rename: This session is a swarm teammate. Teammate names are set by the team leader.", { display: "system" });
|
|
370491
370795
|
return null;
|
|
@@ -378452,7 +378756,7 @@ var init_crossProjectResume = __esm(() => {
|
|
|
378452
378756
|
// src/tui/commands/resume/resume.tsx
|
|
378453
378757
|
var exports_resume = {};
|
|
378454
378758
|
__export(exports_resume, {
|
|
378455
|
-
call: () =>
|
|
378759
|
+
call: () => call26,
|
|
378456
378760
|
filterResumableSessions: () => filterResumableSessions
|
|
378457
378761
|
});
|
|
378458
378762
|
function resumeHelpMessage(result) {
|
|
@@ -378638,7 +378942,7 @@ function ResumeCommand({
|
|
|
378638
378942
|
function filterResumableSessions(logs, currentSessionId) {
|
|
378639
378943
|
return logs.filter((l) => !l.isSidechain && getSessionIdFromLog(l) !== currentSessionId);
|
|
378640
378944
|
}
|
|
378641
|
-
var import_compiler_runtime179, React69, jsx_dev_runtime221,
|
|
378945
|
+
var import_compiler_runtime179, React69, jsx_dev_runtime221, call26 = async (onDone, context, args) => {
|
|
378642
378946
|
const onResume = async (sessionId, log, entrypoint) => {
|
|
378643
378947
|
try {
|
|
378644
378948
|
await context.resume?.(sessionId, log, entrypoint);
|
|
@@ -383036,7 +383340,7 @@ var init_server = __esm(() => {
|
|
|
383036
383340
|
// src/tui/commands/session/session.tsx
|
|
383037
383341
|
var exports_session = {};
|
|
383038
383342
|
__export(exports_session, {
|
|
383039
|
-
call: () =>
|
|
383343
|
+
call: () => call27
|
|
383040
383344
|
});
|
|
383041
383345
|
function SessionInfo(t0) {
|
|
383042
383346
|
const $ = import_compiler_runtime180.c(19);
|
|
@@ -383226,7 +383530,7 @@ function _temp241(e) {
|
|
|
383226
383530
|
function _temp105(s) {
|
|
383227
383531
|
return s.remoteSessionUrl;
|
|
383228
383532
|
}
|
|
383229
|
-
var import_compiler_runtime180, import_react131, jsx_dev_runtime222,
|
|
383533
|
+
var import_compiler_runtime180, import_react131, jsx_dev_runtime222, call27 = async (onDone) => {
|
|
383230
383534
|
return /* @__PURE__ */ jsx_dev_runtime222.jsxDEV(SessionInfo, {
|
|
383231
383535
|
onDone
|
|
383232
383536
|
}, undefined, false, undefined, this);
|
|
@@ -383582,9 +383886,9 @@ var init_SkillsMenu = __esm(() => {
|
|
|
383582
383886
|
// src/tui/commands/skills/skills.tsx
|
|
383583
383887
|
var exports_skills = {};
|
|
383584
383888
|
__export(exports_skills, {
|
|
383585
|
-
call: () =>
|
|
383889
|
+
call: () => call28
|
|
383586
383890
|
});
|
|
383587
|
-
async function
|
|
383891
|
+
async function call28(onDone, context) {
|
|
383588
383892
|
return /* @__PURE__ */ jsx_dev_runtime224.jsxDEV(SkillsMenu, {
|
|
383589
383893
|
onExit: onDone,
|
|
383590
383894
|
commands: context.options.commands
|
|
@@ -383611,9 +383915,9 @@ var init_skills3 = __esm(() => {
|
|
|
383611
383915
|
// src/tui/commands/status/status.tsx
|
|
383612
383916
|
var exports_status = {};
|
|
383613
383917
|
__export(exports_status, {
|
|
383614
|
-
call: () =>
|
|
383918
|
+
call: () => call29
|
|
383615
383919
|
});
|
|
383616
|
-
async function
|
|
383920
|
+
async function call29(onDone, context) {
|
|
383617
383921
|
return /* @__PURE__ */ jsx_dev_runtime225.jsxDEV(Settings, {
|
|
383618
383922
|
onClose: onDone,
|
|
383619
383923
|
context,
|
|
@@ -386809,9 +387113,9 @@ var init_BackgroundTasksDialog = __esm(() => {
|
|
|
386809
387113
|
// src/tui/commands/tasks/tasks.tsx
|
|
386810
387114
|
var exports_tasks = {};
|
|
386811
387115
|
__export(exports_tasks, {
|
|
386812
|
-
call: () =>
|
|
387116
|
+
call: () => call30
|
|
386813
387117
|
});
|
|
386814
|
-
async function
|
|
387118
|
+
async function call30(onDone, context) {
|
|
386815
387119
|
return /* @__PURE__ */ jsx_dev_runtime234.jsxDEV(BackgroundTasksDialog, {
|
|
386816
387120
|
toolUseContext: context,
|
|
386817
387121
|
onDone
|
|
@@ -387258,9 +387562,9 @@ var init_FileTaskDialog = __esm(() => {
|
|
|
387258
387562
|
// src/tui/commands/tasklist/tasklist.tsx
|
|
387259
387563
|
var exports_tasklist = {};
|
|
387260
387564
|
__export(exports_tasklist, {
|
|
387261
|
-
call: () =>
|
|
387565
|
+
call: () => call31
|
|
387262
387566
|
});
|
|
387263
|
-
async function
|
|
387567
|
+
async function call31(onDone, _context) {
|
|
387264
387568
|
return /* @__PURE__ */ jsx_dev_runtime236.jsxDEV(FileTaskDialog, {
|
|
387265
387569
|
onDone
|
|
387266
387570
|
}, undefined, false, undefined, this);
|
|
@@ -387307,9 +387611,9 @@ var init_terminalSetup2 = __esm(() => {
|
|
|
387307
387611
|
// src/tui/commands/usage/usage.tsx
|
|
387308
387612
|
var exports_usage2 = {};
|
|
387309
387613
|
__export(exports_usage2, {
|
|
387310
|
-
call: () =>
|
|
387614
|
+
call: () => call32
|
|
387311
387615
|
});
|
|
387312
|
-
var jsx_dev_runtime237,
|
|
387616
|
+
var jsx_dev_runtime237, call32 = async (onDone, context) => {
|
|
387313
387617
|
return /* @__PURE__ */ jsx_dev_runtime237.jsxDEV(Settings, {
|
|
387314
387618
|
onClose: onDone,
|
|
387315
387619
|
context,
|
|
@@ -387336,7 +387640,7 @@ var init_usage4 = __esm(() => {
|
|
|
387336
387640
|
// src/tui/commands/theme/theme.tsx
|
|
387337
387641
|
var exports_theme = {};
|
|
387338
387642
|
__export(exports_theme, {
|
|
387339
|
-
call: () =>
|
|
387643
|
+
call: () => call33
|
|
387340
387644
|
});
|
|
387341
387645
|
function ThemePickerCommand(t0) {
|
|
387342
387646
|
const $ = import_compiler_runtime189.c(8);
|
|
@@ -387386,7 +387690,7 @@ function ThemePickerCommand(t0) {
|
|
|
387386
387690
|
}
|
|
387387
387691
|
return t3;
|
|
387388
387692
|
}
|
|
387389
|
-
var import_compiler_runtime189, jsx_dev_runtime238,
|
|
387693
|
+
var import_compiler_runtime189, jsx_dev_runtime238, call33 = async (onDone, _context) => {
|
|
387390
387694
|
return /* @__PURE__ */ jsx_dev_runtime238.jsxDEV(ThemePickerCommand, {
|
|
387391
387695
|
onDone
|
|
387392
387696
|
}, undefined, false, undefined, this);
|
|
@@ -387414,9 +387718,9 @@ var init_theme3 = __esm(() => {
|
|
|
387414
387718
|
// src/tui/commands/vim/vim.ts
|
|
387415
387719
|
var exports_vim = {};
|
|
387416
387720
|
__export(exports_vim, {
|
|
387417
|
-
call: () =>
|
|
387721
|
+
call: () => call34
|
|
387418
387722
|
});
|
|
387419
|
-
var
|
|
387723
|
+
var call34 = async () => {
|
|
387420
387724
|
const config = getGlobalConfig();
|
|
387421
387725
|
let currentMode = config.editorMode || "normal";
|
|
387422
387726
|
if (currentMode === "emacs") {
|
|
@@ -388128,7 +388432,7 @@ var init_pluginOperations = __esm(() => {
|
|
|
388128
388432
|
// src/tui/commands/thinkback/thinkback.tsx
|
|
388129
388433
|
var exports_thinkback = {};
|
|
388130
388434
|
__export(exports_thinkback, {
|
|
388131
|
-
call: () =>
|
|
388435
|
+
call: () => call35,
|
|
388132
388436
|
playAnimation: () => playAnimation
|
|
388133
388437
|
});
|
|
388134
388438
|
import { readFile as readFile51 } from "fs/promises";
|
|
@@ -388666,7 +388970,7 @@ function ThinkbackFlow(t0) {
|
|
|
388666
388970
|
}
|
|
388667
388971
|
return t8;
|
|
388668
388972
|
}
|
|
388669
|
-
async function
|
|
388973
|
+
async function call35(onDone) {
|
|
388670
388974
|
return /* @__PURE__ */ jsx_dev_runtime239.jsxDEV(ThinkbackFlow, {
|
|
388671
388975
|
onDone
|
|
388672
388976
|
}, undefined, false, undefined, this);
|
|
@@ -388714,13 +389018,13 @@ var init_thinkback2 = __esm(() => {
|
|
|
388714
389018
|
// src/tui/commands/thinkback-play/thinkback-play.ts
|
|
388715
389019
|
var exports_thinkback_play = {};
|
|
388716
389020
|
__export(exports_thinkback_play, {
|
|
388717
|
-
call: () =>
|
|
389021
|
+
call: () => call36
|
|
388718
389022
|
});
|
|
388719
389023
|
import { join as join144 } from "path";
|
|
388720
389024
|
function getPluginId2() {
|
|
388721
389025
|
return `thinkback@${OFFICIAL_MARKETPLACE_NAME}`;
|
|
388722
389026
|
}
|
|
388723
|
-
async function
|
|
389027
|
+
async function call36() {
|
|
388724
389028
|
const v2Data = loadInstalledPluginsV2();
|
|
388725
389029
|
const pluginId = getPluginId2();
|
|
388726
389030
|
const installations = v2Data.plugins[pluginId];
|
|
@@ -391222,9 +391526,9 @@ var init_PermissionRuleList = __esm(() => {
|
|
|
391222
391526
|
// src/tui/commands/permissions/permissions.tsx
|
|
391223
391527
|
var exports_permissions2 = {};
|
|
391224
391528
|
__export(exports_permissions2, {
|
|
391225
|
-
call: () =>
|
|
391529
|
+
call: () => call37
|
|
391226
391530
|
});
|
|
391227
|
-
var jsx_dev_runtime247,
|
|
391531
|
+
var jsx_dev_runtime247, call37 = async (onDone, context) => {
|
|
391228
391532
|
return /* @__PURE__ */ jsx_dev_runtime247.jsxDEV(PermissionRuleList, {
|
|
391229
391533
|
onExit: onDone,
|
|
391230
391534
|
onRetryDenials: (commands) => {
|
|
@@ -391254,7 +391558,7 @@ var init_permissions8 = __esm(() => {
|
|
|
391254
391558
|
// src/tui/commands/plan/plan.tsx
|
|
391255
391559
|
var exports_plan = {};
|
|
391256
391560
|
__export(exports_plan, {
|
|
391257
|
-
call: () =>
|
|
391561
|
+
call: () => call38
|
|
391258
391562
|
});
|
|
391259
391563
|
function PlanDisplay(t0) {
|
|
391260
391564
|
const $ = import_compiler_runtime198.c(11);
|
|
@@ -391342,7 +391646,7 @@ function PlanDisplay(t0) {
|
|
|
391342
391646
|
}
|
|
391343
391647
|
return t5;
|
|
391344
391648
|
}
|
|
391345
|
-
async function
|
|
391649
|
+
async function call38(onDone, context, args) {
|
|
391346
391650
|
const {
|
|
391347
391651
|
getAppState,
|
|
391348
391652
|
setAppState
|
|
@@ -393180,9 +393484,9 @@ var init_HooksConfigMenu = __esm(() => {
|
|
|
393180
393484
|
// src/tui/commands/hooks/hooks.tsx
|
|
393181
393485
|
var exports_hooks = {};
|
|
393182
393486
|
__export(exports_hooks, {
|
|
393183
|
-
call: () =>
|
|
393487
|
+
call: () => call39
|
|
393184
393488
|
});
|
|
393185
|
-
var jsx_dev_runtime254,
|
|
393489
|
+
var jsx_dev_runtime254, call39 = async (onDone, context) => {
|
|
393186
393490
|
const appState = context.getAppState();
|
|
393187
393491
|
const permissionContext = appState.toolPermissionContext;
|
|
393188
393492
|
const toolNames = getTools2(permissionContext).map((tool) => tool.name);
|
|
@@ -393213,10 +393517,10 @@ var init_hooks5 = __esm(() => {
|
|
|
393213
393517
|
// src/tui/commands/files/files.ts
|
|
393214
393518
|
var exports_files4 = {};
|
|
393215
393519
|
__export(exports_files4, {
|
|
393216
|
-
call: () =>
|
|
393520
|
+
call: () => call40
|
|
393217
393521
|
});
|
|
393218
393522
|
import { relative as relative27 } from "path";
|
|
393219
|
-
async function
|
|
393523
|
+
async function call40(_args, context) {
|
|
393220
393524
|
const files = context.readFileState ? cacheKeys(context.readFileState) : [];
|
|
393221
393525
|
if (files.length === 0) {
|
|
393222
393526
|
return { type: "text", value: "No files in context" };
|
|
@@ -393248,7 +393552,7 @@ var init_files8 = __esm(() => {
|
|
|
393248
393552
|
// src/tui/commands/branch/branch.ts
|
|
393249
393553
|
var exports_branch = {};
|
|
393250
393554
|
__export(exports_branch, {
|
|
393251
|
-
call: () =>
|
|
393555
|
+
call: () => call41,
|
|
393252
393556
|
createFork: () => createFork,
|
|
393253
393557
|
deriveFirstPrompt: () => deriveFirstPrompt,
|
|
393254
393558
|
getUniqueForkName: () => getUniqueForkName
|
|
@@ -393357,7 +393661,7 @@ async function getUniqueForkName(baseName) {
|
|
|
393357
393661
|
}
|
|
393358
393662
|
return `${baseName} (Branch ${nextNumber})`;
|
|
393359
393663
|
}
|
|
393360
|
-
async function
|
|
393664
|
+
async function call41(onDone, context, args) {
|
|
393361
393665
|
const customTitle = args?.trim() || undefined;
|
|
393362
393666
|
const originalSessionId = getSessionId();
|
|
393363
393667
|
try {
|
|
@@ -399401,9 +399705,9 @@ var init_AgentsMenu = __esm(() => {
|
|
|
399401
399705
|
// src/tui/commands/agents/agents.tsx
|
|
399402
399706
|
var exports_agents2 = {};
|
|
399403
399707
|
__export(exports_agents2, {
|
|
399404
|
-
call: () =>
|
|
399708
|
+
call: () => call42
|
|
399405
399709
|
});
|
|
399406
|
-
async function
|
|
399710
|
+
async function call42(onDone, context) {
|
|
399407
399711
|
const appState = context.getAppState();
|
|
399408
399712
|
const permissionContext = appState.toolPermissionContext;
|
|
399409
399713
|
const tools = getTools2(permissionContext);
|
|
@@ -399566,7 +399870,7 @@ var init_refresh = __esm(() => {
|
|
|
399566
399870
|
|
|
399567
399871
|
// src/tui/utils/plugins/parseMarketplaceInput.ts
|
|
399568
399872
|
import { homedir as homedir37 } from "os";
|
|
399569
|
-
import { resolve as
|
|
399873
|
+
import { resolve as resolve51 } from "path";
|
|
399570
399874
|
function matchKnownGitHost(hostname) {
|
|
399571
399875
|
const host = hostname.toLowerCase();
|
|
399572
399876
|
for (const known of KNOWN_GIT_HOSTS) {
|
|
@@ -399618,7 +399922,7 @@ async function parseMarketplaceInput(input) {
|
|
|
399618
399922
|
const isWindows = process.platform === "win32";
|
|
399619
399923
|
const isWindowsPath = isWindows && (trimmed.startsWith(".\\") || trimmed.startsWith("..\\") || /^[a-zA-Z]:[/\\]/.test(trimmed));
|
|
399620
399924
|
if (trimmed.startsWith("./") || trimmed.startsWith("../") || trimmed.startsWith("/") || trimmed.startsWith("~") || isWindowsPath) {
|
|
399621
|
-
const resolvedPath =
|
|
399925
|
+
const resolvedPath = resolve51(trimmed.startsWith("~") ? trimmed.replace(/^~/, homedir37()) : trimmed);
|
|
399622
399926
|
let stats;
|
|
399623
399927
|
try {
|
|
399624
399928
|
stats = await fs.stat(resolvedPath);
|
|
@@ -409544,9 +409848,9 @@ var init_PluginSettings = __esm(() => {
|
|
|
409544
409848
|
// src/tui/commands/plugin/plugin.tsx
|
|
409545
409849
|
var exports_plugin = {};
|
|
409546
409850
|
__export(exports_plugin, {
|
|
409547
|
-
call: () =>
|
|
409851
|
+
call: () => call43
|
|
409548
409852
|
});
|
|
409549
|
-
async function
|
|
409853
|
+
async function call43(onDone, _context, args) {
|
|
409550
409854
|
return /* @__PURE__ */ jsx_dev_runtime294.jsxDEV(PluginSettings, {
|
|
409551
409855
|
onComplete: onDone,
|
|
409552
409856
|
args
|
|
@@ -409575,12 +409879,12 @@ var init_plugin3 = __esm(() => {
|
|
|
409575
409879
|
// src/tui/commands/reload-plugins/reload-plugins.ts
|
|
409576
409880
|
var exports_reload_plugins = {};
|
|
409577
409881
|
__export(exports_reload_plugins, {
|
|
409578
|
-
call: () =>
|
|
409882
|
+
call: () => call44
|
|
409579
409883
|
});
|
|
409580
409884
|
function n2(count, noun) {
|
|
409581
409885
|
return `${count} ${plural2(count, noun)}`;
|
|
409582
409886
|
}
|
|
409583
|
-
var
|
|
409887
|
+
var call44 = async (_args, context) => {
|
|
409584
409888
|
const r = await refreshActivePlugins(context.setAppState);
|
|
409585
409889
|
const parts = [
|
|
409586
409890
|
n2(r.enabled_count, "plugin"),
|
|
@@ -409618,9 +409922,9 @@ var init_reload_plugins2 = __esm(() => {
|
|
|
409618
409922
|
// src/tui/commands/rewind/rewind.ts
|
|
409619
409923
|
var exports_rewind = {};
|
|
409620
409924
|
__export(exports_rewind, {
|
|
409621
|
-
call: () =>
|
|
409925
|
+
call: () => call45
|
|
409622
409926
|
});
|
|
409623
|
-
async function
|
|
409927
|
+
async function call45(_args, context) {
|
|
409624
409928
|
if (context.openMessageSelector) {
|
|
409625
409929
|
context.openMessageSelector();
|
|
409626
409930
|
}
|
|
@@ -409793,9 +410097,9 @@ var init_heapDumpService = __esm(() => {
|
|
|
409793
410097
|
// src/tui/commands/heapdump/heapdump.ts
|
|
409794
410098
|
var exports_heapdump = {};
|
|
409795
410099
|
__export(exports_heapdump, {
|
|
409796
|
-
call: () =>
|
|
410100
|
+
call: () => call46
|
|
409797
410101
|
});
|
|
409798
|
-
async function
|
|
410102
|
+
async function call46() {
|
|
409799
410103
|
const result = await performHeapDump();
|
|
409800
410104
|
if (!result.success) {
|
|
409801
410105
|
return {
|
|
@@ -409828,7 +410132,7 @@ var init_heapdump2 = __esm(() => {
|
|
|
409828
410132
|
});
|
|
409829
410133
|
|
|
409830
410134
|
// src/tui/commands/version.ts
|
|
409831
|
-
var
|
|
410135
|
+
var call47 = async () => {
|
|
409832
410136
|
return {
|
|
409833
410137
|
type: "text",
|
|
409834
410138
|
value: MACRO.BUILD_TIME ? `${MACRO.VERSION} (built ${MACRO.BUILD_TIME})` : MACRO.VERSION
|
|
@@ -409841,7 +410145,7 @@ var init_version = __esm(() => {
|
|
|
409841
410145
|
description: "Print the version this session is running (not what autoupdate downloaded)",
|
|
409842
410146
|
isEnabled: () => true,
|
|
409843
410147
|
supportsNonInteractive: true,
|
|
409844
|
-
load: () => Promise.resolve({ call:
|
|
410148
|
+
load: () => Promise.resolve({ call: call47 })
|
|
409845
410149
|
};
|
|
409846
410150
|
version_default = version2;
|
|
409847
410151
|
});
|
|
@@ -410947,10 +411251,10 @@ var init_SandboxSettings = __esm(() => {
|
|
|
410947
411251
|
// src/tui/commands/sandbox-toggle/sandbox-toggle.tsx
|
|
410948
411252
|
var exports_sandbox_toggle = {};
|
|
410949
411253
|
__export(exports_sandbox_toggle, {
|
|
410950
|
-
call: () =>
|
|
411254
|
+
call: () => call48
|
|
410951
411255
|
});
|
|
410952
411256
|
import { relative as relative28 } from "path";
|
|
410953
|
-
async function
|
|
411257
|
+
async function call48(onDone, _context, args) {
|
|
410954
411258
|
const settings = getSettings_DEPRECATED();
|
|
410955
411259
|
const themeName = settings.theme || "light";
|
|
410956
411260
|
const platform = getPlatform3();
|
|
@@ -411057,9 +411361,9 @@ var init_sandbox_toggle2 = __esm(() => {
|
|
|
411057
411361
|
// src/tui/commands/stickers/stickers.ts
|
|
411058
411362
|
var exports_stickers = {};
|
|
411059
411363
|
__export(exports_stickers, {
|
|
411060
|
-
call: () =>
|
|
411364
|
+
call: () => call49
|
|
411061
411365
|
});
|
|
411062
|
-
async function
|
|
411366
|
+
async function call49() {
|
|
411063
411367
|
const url = "https://www.stickermule.com/claudecode";
|
|
411064
411368
|
const success = await openBrowser(url);
|
|
411065
411369
|
if (success) {
|
|
@@ -411593,13 +411897,13 @@ var init_concurrentSessions2 = __esm(() => {
|
|
|
411593
411897
|
// src/tui/commands/exit/exit.tsx
|
|
411594
411898
|
var exports_exit = {};
|
|
411595
411899
|
__export(exports_exit, {
|
|
411596
|
-
call: () =>
|
|
411900
|
+
call: () => call50
|
|
411597
411901
|
});
|
|
411598
411902
|
import { spawnSync as spawnSync5 } from "child_process";
|
|
411599
411903
|
function getRandomGoodbyeMessage2() {
|
|
411600
411904
|
return sample_default(GOODBYE_MESSAGES2) ?? "Goodbye!";
|
|
411601
411905
|
}
|
|
411602
|
-
async function
|
|
411906
|
+
async function call50(onDone) {
|
|
411603
411907
|
if (feature("BG_SESSIONS") && isBgSession2()) {
|
|
411604
411908
|
onDone();
|
|
411605
411909
|
spawnSync5("tmux", ["detach-client"], {
|
|
@@ -411898,7 +412202,7 @@ var init_exportRenderer = __esm(() => {
|
|
|
411898
412202
|
// src/tui/commands/export/export.tsx
|
|
411899
412203
|
var exports_export = {};
|
|
411900
412204
|
__export(exports_export, {
|
|
411901
|
-
call: () =>
|
|
412205
|
+
call: () => call51,
|
|
411902
412206
|
extractFirstPrompt: () => extractFirstPrompt2,
|
|
411903
412207
|
sanitizeFilename: () => sanitizeFilename
|
|
411904
412208
|
});
|
|
@@ -411941,7 +412245,7 @@ async function exportWithReactRenderer(context) {
|
|
|
411941
412245
|
const tools = context.options.tools || [];
|
|
411942
412246
|
return renderMessagesToPlainText(context.messages, tools);
|
|
411943
412247
|
}
|
|
411944
|
-
async function
|
|
412248
|
+
async function call51(onDone, context, args) {
|
|
411945
412249
|
const content = await exportWithReactRenderer(context);
|
|
411946
412250
|
const filename = args.trim();
|
|
411947
412251
|
if (filename) {
|
|
@@ -412006,7 +412310,7 @@ function shouldInferenceConfigCommandBeImmediate() {
|
|
|
412006
412310
|
// src/tui/commands/model/model.tsx
|
|
412007
412311
|
var exports_model = {};
|
|
412008
412312
|
__export(exports_model, {
|
|
412009
|
-
call: () =>
|
|
412313
|
+
call: () => call52
|
|
412010
412314
|
});
|
|
412011
412315
|
function ModelPickerWrapper(t0) {
|
|
412012
412316
|
const $ = import_compiler_runtime237.c(17);
|
|
@@ -412182,7 +412486,7 @@ function renderModelLabel(model) {
|
|
|
412182
412486
|
const rendered = renderDefaultModelSetting(model ?? getDefaultMainLoopModelSetting());
|
|
412183
412487
|
return model === null ? `${rendered} (default)` : rendered;
|
|
412184
412488
|
}
|
|
412185
|
-
var import_compiler_runtime237, React90, jsx_dev_runtime306,
|
|
412489
|
+
var import_compiler_runtime237, React90, jsx_dev_runtime306, call52 = async (onDone, _context, args) => {
|
|
412186
412490
|
args = args?.trim() || "";
|
|
412187
412491
|
if (COMMON_INFO_ARGS.includes(args)) {
|
|
412188
412492
|
return /* @__PURE__ */ jsx_dev_runtime306.jsxDEV(ShowModelAndClose, {
|
|
@@ -412241,7 +412545,7 @@ var init_model3 = __esm(() => {
|
|
|
412241
412545
|
// src/tui/commands/tag/tag.tsx
|
|
412242
412546
|
var exports_tag = {};
|
|
412243
412547
|
__export(exports_tag, {
|
|
412244
|
-
call: () =>
|
|
412548
|
+
call: () => call53
|
|
412245
412549
|
});
|
|
412246
412550
|
function ConfirmRemoveTag(t0) {
|
|
412247
412551
|
const $ = import_compiler_runtime238.c(11);
|
|
@@ -412459,7 +412763,7 @@ Examples:
|
|
|
412459
412763
|
React91.useEffect(t1, t2);
|
|
412460
412764
|
return null;
|
|
412461
412765
|
}
|
|
412462
|
-
async function
|
|
412766
|
+
async function call53(onDone, _context, args) {
|
|
412463
412767
|
args = args?.trim() || "";
|
|
412464
412768
|
if (COMMON_INFO_ARGS.includes(args) || COMMON_HELP_ARGS.includes(args)) {
|
|
412465
412769
|
return /* @__PURE__ */ jsx_dev_runtime307.jsxDEV(ShowHelp, {
|
|
@@ -412531,7 +412835,7 @@ var init_sessionlist = __esm(() => {
|
|
|
412531
412835
|
// src/tui/commands/effort/effort.tsx
|
|
412532
412836
|
var exports_effort = {};
|
|
412533
412837
|
__export(exports_effort, {
|
|
412534
|
-
call: () =>
|
|
412838
|
+
call: () => call54,
|
|
412535
412839
|
executeEffort: () => executeEffort,
|
|
412536
412840
|
showCurrentEffort: () => showCurrentEffort
|
|
412537
412841
|
});
|
|
@@ -412680,7 +412984,7 @@ function ApplyEffortAndClose(t0) {
|
|
|
412680
412984
|
React92.useEffect(t1, t2);
|
|
412681
412985
|
return null;
|
|
412682
412986
|
}
|
|
412683
|
-
async function
|
|
412987
|
+
async function call54(onDone, _context, args) {
|
|
412684
412988
|
args = args?.trim() || "";
|
|
412685
412989
|
if (COMMON_HELP_ARGS2.includes(args)) {
|
|
412686
412990
|
onDone(`Usage: /effort [low|medium|high|xhigh|max|auto]
|
|
@@ -415704,9 +416008,9 @@ var init_Stats = __esm(() => {
|
|
|
415704
416008
|
// src/tui/commands/stats/stats.tsx
|
|
415705
416009
|
var exports_stats = {};
|
|
415706
416010
|
__export(exports_stats, {
|
|
415707
|
-
call: () =>
|
|
416011
|
+
call: () => call55
|
|
415708
416012
|
});
|
|
415709
|
-
var jsx_dev_runtime310,
|
|
416013
|
+
var jsx_dev_runtime310, call55 = async (onDone) => {
|
|
415710
416014
|
return /* @__PURE__ */ jsx_dev_runtime310.jsxDEV(Stats2, {
|
|
415711
416015
|
onClose: onDone
|
|
415712
416016
|
}, undefined, false, undefined, this);
|
|
@@ -416458,9 +416762,9 @@ var init_useVoice = __esm(() => {
|
|
|
416458
416762
|
// src/tui/commands/voice/voice.ts
|
|
416459
416763
|
var exports_voice3 = {};
|
|
416460
416764
|
__export(exports_voice3, {
|
|
416461
|
-
call: () =>
|
|
416765
|
+
call: () => call56
|
|
416462
416766
|
});
|
|
416463
|
-
var LANG_HINT_MAX_SHOWS = 2,
|
|
416767
|
+
var LANG_HINT_MAX_SHOWS = 2, call56 = async () => {
|
|
416464
416768
|
if (!isVoiceModeEnabled()) {
|
|
416465
416769
|
return {
|
|
416466
416770
|
type: "text",
|
|
@@ -418797,6 +419101,7 @@ var init_commands5 = __esm(() => {
|
|
|
418797
419101
|
init_feedback2();
|
|
418798
419102
|
init_clear2();
|
|
418799
419103
|
init_color3();
|
|
419104
|
+
init_tui2();
|
|
418800
419105
|
init_commit();
|
|
418801
419106
|
init_copy2();
|
|
418802
419107
|
init_commit_push_pr();
|
|
@@ -418930,6 +419235,7 @@ var init_commands5 = __esm(() => {
|
|
|
418930
419235
|
stickers_default,
|
|
418931
419236
|
tag_default,
|
|
418932
419237
|
theme_default,
|
|
419238
|
+
tui_default,
|
|
418933
419239
|
feedback_default,
|
|
418934
419240
|
review_default,
|
|
418935
419241
|
rewind_default,
|
|
@@ -421648,7 +421954,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
421648
421954
|
// src/tui/utils/plans.ts
|
|
421649
421955
|
import { randomUUID as randomUUID40 } from "crypto";
|
|
421650
421956
|
import { copyFile as copyFile9, writeFile as writeFile47 } from "fs/promises";
|
|
421651
|
-
import { join as join160, resolve as
|
|
421957
|
+
import { join as join160, resolve as resolve53, sep as sep34 } from "path";
|
|
421652
421958
|
function getPlanSlug2(sessionId) {
|
|
421653
421959
|
const id = sessionId ?? getSessionId();
|
|
421654
421960
|
const cache = getPlanSlugCache();
|
|
@@ -421858,7 +422164,7 @@ var init_plans = __esm(() => {
|
|
|
421858
422164
|
let plansPath;
|
|
421859
422165
|
if (settingsDir) {
|
|
421860
422166
|
const cwd = getCwd();
|
|
421861
|
-
const resolved =
|
|
422167
|
+
const resolved = resolve53(cwd, settingsDir);
|
|
421862
422168
|
if (!resolved.startsWith(cwd + sep34) && resolved !== cwd) {
|
|
421863
422169
|
logError3(new Error(`plansDirectory must be within project root: ${settingsDir}`));
|
|
421864
422170
|
plansPath = join160(getAtlasConfigHomeDir3(), "plans");
|
|
@@ -421880,7 +422186,7 @@ var init_plans = __esm(() => {
|
|
|
421880
422186
|
// src/tui/utils/permissions/filesystem.ts
|
|
421881
422187
|
import { randomBytes as randomBytes21 } from "crypto";
|
|
421882
422188
|
import { homedir as homedir38, tmpdir as tmpdir11 } from "os";
|
|
421883
|
-
import { join as join161, normalize as normalize15, posix as posix9, sep as sep35 } from "path";
|
|
422189
|
+
import { join as join161, normalize as normalize15, posix as posix9, resolve as resolve54, sep as sep35 } from "path";
|
|
421884
422190
|
function normalizeCaseForComparison2(path) {
|
|
421885
422191
|
return path.toLowerCase();
|
|
421886
422192
|
}
|
|
@@ -422096,11 +422402,38 @@ function checkPathSafetyForAutoEdit2(path, precomputedPathsToCheck) {
|
|
|
422096
422402
|
}
|
|
422097
422403
|
return { safe: true };
|
|
422098
422404
|
}
|
|
422405
|
+
function isActiveWorktreeCwd2(cwd) {
|
|
422406
|
+
const cached = worktreeCwdProbeCache2.get(cwd);
|
|
422407
|
+
if (cached !== undefined) {
|
|
422408
|
+
return cached;
|
|
422409
|
+
}
|
|
422410
|
+
let active = false;
|
|
422411
|
+
try {
|
|
422412
|
+
const content = getFsImplementation2().readFileSync(join161(cwd, ".git"), {
|
|
422413
|
+
encoding: "utf8"
|
|
422414
|
+
});
|
|
422415
|
+
const gitdirMatch = content.match(/^gitdir:\s*(.+)$/m);
|
|
422416
|
+
if (gitdirMatch?.[1]) {
|
|
422417
|
+
const gitdir = resolve54(cwd, gitdirMatch[1].trim());
|
|
422418
|
+
active = gitdir.lastIndexOf(sep35 + ".git" + sep35 + "worktrees" + sep35) > 0;
|
|
422419
|
+
}
|
|
422420
|
+
} catch {
|
|
422421
|
+
active = false;
|
|
422422
|
+
}
|
|
422423
|
+
worktreeCwdProbeCache2.set(cwd, active);
|
|
422424
|
+
return active;
|
|
422425
|
+
}
|
|
422099
422426
|
function allWorkingDirectories2(context) {
|
|
422100
|
-
|
|
422101
|
-
|
|
422427
|
+
const originalCwd = getOriginalCwd();
|
|
422428
|
+
const dirs = [
|
|
422429
|
+
originalCwd,
|
|
422102
422430
|
...context.additionalWorkingDirectories.keys()
|
|
422103
|
-
]
|
|
422431
|
+
];
|
|
422432
|
+
const cwd = getCwd();
|
|
422433
|
+
if (cwd !== originalCwd && isActiveWorktreeCwd2(cwd)) {
|
|
422434
|
+
dirs.push(cwd);
|
|
422435
|
+
}
|
|
422436
|
+
return new Set(dirs);
|
|
422104
422437
|
}
|
|
422105
422438
|
function pathInAllowedWorkingPath2(path, toolPermissionContext, precomputedPathsToCheck) {
|
|
422106
422439
|
const pathsToCheck = precomputedPathsToCheck ?? getPathsForPermissionCheck2(path);
|
|
@@ -422723,7 +423056,7 @@ function checkReadableInternalPath2(absolutePath, input) {
|
|
|
422723
423056
|
}
|
|
422724
423057
|
return { behavior: "passthrough", message: "" };
|
|
422725
423058
|
}
|
|
422726
|
-
var import_ignore4, DANGEROUS_FILES2, DANGEROUS_DIRECTORIES2, DIR_SEP2, getAtlasTempDir2, getBundledSkillsRoot2, getResolvedWorkingDirPaths2;
|
|
423059
|
+
var import_ignore4, DANGEROUS_FILES2, DANGEROUS_DIRECTORIES2, DIR_SEP2, getAtlasTempDir2, getBundledSkillsRoot2, worktreeCwdProbeCache2, getResolvedWorkingDirPaths2;
|
|
422727
423060
|
var init_filesystem2 = __esm(() => {
|
|
422728
423061
|
init_shared();
|
|
422729
423062
|
init_configDir();
|
|
@@ -422782,6 +423115,7 @@ var init_filesystem2 = __esm(() => {
|
|
|
422782
423115
|
const nonce = randomBytes21(16).toString("hex");
|
|
422783
423116
|
return join161(getAtlasTempDir2(), "bundled-skills", MACRO.VERSION, nonce);
|
|
422784
423117
|
});
|
|
423118
|
+
worktreeCwdProbeCache2 = new Map;
|
|
422785
423119
|
getResolvedWorkingDirPaths2 = memoize_default(getPathsForPermissionCheck2);
|
|
422786
423120
|
});
|
|
422787
423121
|
|
|
@@ -427986,12 +428320,17 @@ async function executePreCompactHooks(compactData, signal, timeoutMs = TOOL_HOOK
|
|
|
427986
428320
|
}
|
|
427987
428321
|
}
|
|
427988
428322
|
}
|
|
428323
|
+
const blockedResults = results.filter((r) => r.blocked);
|
|
427989
428324
|
return {
|
|
427990
428325
|
newCustomInstructions: successfulOutputs.length > 0 ? successfulOutputs.join(`
|
|
427991
428326
|
|
|
427992
428327
|
`) : undefined,
|
|
427993
428328
|
userDisplayMessage: displayMessages.length > 0 ? displayMessages.join(`
|
|
427994
|
-
`) : undefined
|
|
428329
|
+
`) : undefined,
|
|
428330
|
+
...blockedResults.length > 0 ? {
|
|
428331
|
+
blocked: true,
|
|
428332
|
+
blockingReason: blockedResults.map((r) => r.systemMessage?.trim() || r.output.trim() || `PreCompact hook '${r.command}' blocked compaction`).join("; ")
|
|
428333
|
+
} : {}
|
|
427995
428334
|
};
|
|
427996
428335
|
}
|
|
427997
428336
|
async function executePostCompactHooks(compactData, signal, timeoutMs = TOOL_HOOK_EXECUTION_TIMEOUT_MS) {
|
|
@@ -429105,6 +429444,22 @@ async function compactConversation2(messages, context, cacheSafeParams, suppress
|
|
|
429105
429444
|
trigger: isAutoCompact ? "auto" : "manual",
|
|
429106
429445
|
customInstructions: customInstructions ?? null
|
|
429107
429446
|
}, context.abortController.signal);
|
|
429447
|
+
if (hookResult.blocked) {
|
|
429448
|
+
const skipReason = hookResult.blockingReason ?? "PreCompact hook blocked compaction";
|
|
429449
|
+
logForDebugging3(`Compact skipped: PreCompact hook blocked (${skipReason})`, { level: "warn" });
|
|
429450
|
+
context.setSDKStatus?.(null);
|
|
429451
|
+
context.onCompactProgress?.({ type: "compact_end" });
|
|
429452
|
+
return {
|
|
429453
|
+
boundaryMarker: createCompactBoundaryMessage2(isAutoCompact ? "auto" : "manual", preCompactTokenCount ?? 0, messages.at(-1)?.uuid),
|
|
429454
|
+
summaryMessages: [],
|
|
429455
|
+
attachments: [],
|
|
429456
|
+
hookResults: [],
|
|
429457
|
+
userDisplayMessage: `Compaction skipped: PreCompact hook blocked (${skipReason})`,
|
|
429458
|
+
preCompactTokenCount,
|
|
429459
|
+
compactionSkipped: true,
|
|
429460
|
+
compactSkipReason: skipReason
|
|
429461
|
+
};
|
|
429462
|
+
}
|
|
429108
429463
|
customInstructions = mergeHookInstructions2(customInstructions, hookResult.newCustomInstructions);
|
|
429109
429464
|
const userDisplayMessage = hookResult.userDisplayMessage;
|
|
429110
429465
|
context.setStreamMode?.("requesting");
|
|
@@ -429272,6 +429627,22 @@ async function partialCompactConversation2(allMessages, pivotIndex, context, cac
|
|
|
429272
429627
|
trigger: "manual",
|
|
429273
429628
|
customInstructions: null
|
|
429274
429629
|
}, context.abortController.signal);
|
|
429630
|
+
if (hookResult.blocked) {
|
|
429631
|
+
const skipReason = hookResult.blockingReason ?? "PreCompact hook blocked compaction";
|
|
429632
|
+
logForDebugging3(`Partial compact skipped: PreCompact hook blocked (${skipReason})`, { level: "warn" });
|
|
429633
|
+
context.setSDKStatus?.(null);
|
|
429634
|
+
context.onCompactProgress?.({ type: "compact_end" });
|
|
429635
|
+
return {
|
|
429636
|
+
boundaryMarker: createCompactBoundaryMessage2("manual", preCompactTokenCount ?? 0, allMessages.at(-1)?.uuid),
|
|
429637
|
+
summaryMessages: [],
|
|
429638
|
+
attachments: [],
|
|
429639
|
+
hookResults: [],
|
|
429640
|
+
userDisplayMessage: `Compaction skipped: PreCompact hook blocked (${skipReason})`,
|
|
429641
|
+
preCompactTokenCount,
|
|
429642
|
+
compactionSkipped: true,
|
|
429643
|
+
compactSkipReason: skipReason
|
|
429644
|
+
};
|
|
429645
|
+
}
|
|
429275
429646
|
let customInstructions;
|
|
429276
429647
|
if (hookResult.newCustomInstructions && userFeedback) {
|
|
429277
429648
|
customInstructions = `${hookResult.newCustomInstructions}
|
|
@@ -469376,7 +469747,7 @@ import {
|
|
|
469376
469747
|
rm as rm11,
|
|
469377
469748
|
writeFile as writeFile49
|
|
469378
469749
|
} from "fs/promises";
|
|
469379
|
-
import { join as join173, resolve as
|
|
469750
|
+
import { join as join173, resolve as resolve57, sep as sep41 } from "path";
|
|
469380
469751
|
function getBuiltinSnapshotRoot() {
|
|
469381
469752
|
return join173(getMarketplacesCacheDir(), "builtin-snapshots");
|
|
469382
469753
|
}
|
|
@@ -469388,7 +469759,7 @@ function isBuiltinSnapshotEntry(entry) {
|
|
|
469388
469759
|
return false;
|
|
469389
469760
|
if (entry.source.source !== "directory")
|
|
469390
469761
|
return false;
|
|
469391
|
-
const root =
|
|
469762
|
+
const root = resolve57(getBuiltinSnapshotRoot()) + sep41;
|
|
469392
469763
|
return entry.installLocation.startsWith(root);
|
|
469393
469764
|
}
|
|
469394
469765
|
async function installBuiltinSnapshotFallback(marketplaceName) {
|
|
@@ -471909,7 +472280,7 @@ var init_usePluginAutoupdateNotification = __esm(() => {
|
|
|
471909
472280
|
});
|
|
471910
472281
|
|
|
471911
472282
|
// src/tui/utils/plugins/reconciler.ts
|
|
471912
|
-
import { isAbsolute as isAbsolute34, resolve as
|
|
472283
|
+
import { isAbsolute as isAbsolute34, resolve as resolve58 } from "path";
|
|
471913
472284
|
function diffMarketplaces(declared, materialized, opts) {
|
|
471914
472285
|
const missing = [];
|
|
471915
472286
|
const sourceChanged = [];
|
|
@@ -472022,7 +472393,7 @@ function normalizeSource(source, projectRoot) {
|
|
|
472022
472393
|
const canonicalRoot = findCanonicalGitRoot2(base);
|
|
472023
472394
|
return {
|
|
472024
472395
|
...source,
|
|
472025
|
-
path:
|
|
472396
|
+
path: resolve58(canonicalRoot ?? base, source.path)
|
|
472026
472397
|
};
|
|
472027
472398
|
}
|
|
472028
472399
|
return source;
|
|
@@ -475986,6 +476357,10 @@ function REPL({
|
|
|
475986
476357
|
});
|
|
475987
476358
|
}
|
|
475988
476359
|
}, [autoUpdaterResult, addNotification]);
|
|
476360
|
+
const tuiFullscreenSeed = useAppState((s) => s.settings.tui?.fullscreen);
|
|
476361
|
+
import_react280.useEffect(() => {
|
|
476362
|
+
setFullscreenRuntimeOverride(tuiFullscreenSeed);
|
|
476363
|
+
}, [tuiFullscreenSeed]);
|
|
475989
476364
|
import_react280.useEffect(() => {
|
|
475990
476365
|
if (isFullscreenEnvEnabled()) {
|
|
475991
476366
|
maybeGetTmuxMouseHint().then((hint) => {
|
|
@@ -479485,7 +479860,7 @@ class FpsTracker {
|
|
|
479485
479860
|
}
|
|
479486
479861
|
|
|
479487
479862
|
// src/tui/utils/githubRepoPathMapping.ts
|
|
479488
|
-
import { realpath as
|
|
479863
|
+
import { realpath as realpath15 } from "fs/promises";
|
|
479489
479864
|
async function updateGithubRepoPathMapping() {
|
|
479490
479865
|
try {
|
|
479491
479866
|
const repo = await detectCurrentRepository();
|
|
@@ -479498,7 +479873,7 @@ async function updateGithubRepoPathMapping() {
|
|
|
479498
479873
|
const basePath = gitRoot ?? cwd;
|
|
479499
479874
|
let currentPath;
|
|
479500
479875
|
try {
|
|
479501
|
-
currentPath = (await
|
|
479876
|
+
currentPath = (await realpath15(basePath)).normalize("NFC");
|
|
479502
479877
|
} catch {
|
|
479503
479878
|
currentPath = basePath;
|
|
479504
479879
|
}
|
|
@@ -483686,6 +484061,103 @@ var init_keybindings3 = __esm(() => {
|
|
|
483686
484061
|
`);
|
|
483687
484062
|
});
|
|
483688
484063
|
|
|
484064
|
+
// src/tui/skills/bundled/lessPermissionPrompts.ts
|
|
484065
|
+
function extractToolCallFrequencies(messages) {
|
|
484066
|
+
const counts = new Map;
|
|
484067
|
+
for (const msg of messages) {
|
|
484068
|
+
const content = msg?.message?.content ?? msg?.content;
|
|
484069
|
+
if (!Array.isArray(content))
|
|
484070
|
+
continue;
|
|
484071
|
+
for (const block of content) {
|
|
484072
|
+
if (!block || typeof block !== "object")
|
|
484073
|
+
continue;
|
|
484074
|
+
const b = block;
|
|
484075
|
+
if (b.type !== "tool_use" || typeof b.name !== "string")
|
|
484076
|
+
continue;
|
|
484077
|
+
if (b.name === "Bash") {
|
|
484078
|
+
const command = b.input?.command;
|
|
484079
|
+
if (typeof command !== "string")
|
|
484080
|
+
continue;
|
|
484081
|
+
const prefix = matchReadOnlyPrefix(command);
|
|
484082
|
+
if (prefix === null)
|
|
484083
|
+
continue;
|
|
484084
|
+
const key = `Bash|${prefix}`;
|
|
484085
|
+
const entry = counts.get(key) ?? { toolName: "Bash", ruleContent: `${prefix}:*`, frequency: 0 };
|
|
484086
|
+
entry.frequency++;
|
|
484087
|
+
counts.set(key, entry);
|
|
484088
|
+
} else if (READONLY_BUILTIN_TOOLS.has(b.name) || b.name.startsWith("mcp__")) {
|
|
484089
|
+
const entry = counts.get(b.name) ?? { toolName: b.name, frequency: 0 };
|
|
484090
|
+
entry.frequency++;
|
|
484091
|
+
counts.set(b.name, entry);
|
|
484092
|
+
}
|
|
484093
|
+
}
|
|
484094
|
+
}
|
|
484095
|
+
return counts;
|
|
484096
|
+
}
|
|
484097
|
+
function buildAllowlistProposal(messages, limit = DEFAULT_LIMIT) {
|
|
484098
|
+
const sorted = [...extractToolCallFrequencies(messages).values()].sort((a, b) => b.frequency - a.frequency || (a.toolName + (a.ruleContent ?? "")).localeCompare(b.toolName + (b.ruleContent ?? ""))).slice(0, Math.max(1, limit));
|
|
484099
|
+
return sorted;
|
|
484100
|
+
}
|
|
484101
|
+
function writeAllowlistToSettings(candidates) {
|
|
484102
|
+
if (candidates.length === 0)
|
|
484103
|
+
return true;
|
|
484104
|
+
const ruleValues = candidates.map((c) => c.ruleContent ? { toolName: c.toolName, ruleContent: c.ruleContent } : { toolName: c.toolName });
|
|
484105
|
+
return addPermissionRulesToSettings2({ ruleValues, ruleBehavior: "allow" }, "userSettings");
|
|
484106
|
+
}
|
|
484107
|
+
function ruleString(c) {
|
|
484108
|
+
return c.ruleContent ? `${c.toolName}(${c.ruleContent})` : c.toolName;
|
|
484109
|
+
}
|
|
484110
|
+
async function runLessPermissionPrompts(args, context) {
|
|
484111
|
+
const parsed = args.trim() === "" ? NaN : parseInt(args.trim(), 10);
|
|
484112
|
+
const limit = Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_LIMIT;
|
|
484113
|
+
const candidates = buildAllowlistProposal(context?.messages ?? [], limit);
|
|
484114
|
+
if (candidates.length === 0) {
|
|
484115
|
+
return [{ type: "text", text: NO_CANDIDATES_MESSAGE }];
|
|
484116
|
+
}
|
|
484117
|
+
const written = writeAllowlistToSettings(candidates);
|
|
484118
|
+
const lines = candidates.map((c) => ` - \`${ruleString(c)}\` — seen ${c.frequency}× this session`);
|
|
484119
|
+
const head = written ? `Added ${candidates.length} allowlist rule(s) to user settings (permissions.allow):
|
|
484120
|
+
${lines.join(`
|
|
484121
|
+
`)}
|
|
484122
|
+
|
|
484123
|
+
These read-only calls will no longer prompt. To revoke, remove the entries from \`permissions.allow\` in user settings.json.` : `Found ${candidates.length} allowlist candidate(s) but the write was rejected (managed permission rules policy is active):
|
|
484124
|
+
${lines.join(`
|
|
484125
|
+
`)}
|
|
484126
|
+
|
|
484127
|
+
Ask your admin to add these rules, or re-run without the managed-policy override.`;
|
|
484128
|
+
return [
|
|
484129
|
+
{
|
|
484130
|
+
type: "text",
|
|
484131
|
+
text: `${head}
|
|
484132
|
+
|
|
484133
|
+
Report this summary to the user in one short message (no extra commentary).`
|
|
484134
|
+
}
|
|
484135
|
+
];
|
|
484136
|
+
}
|
|
484137
|
+
function registerLessPermissionPromptsSkill() {
|
|
484138
|
+
registerBundledSkill2({
|
|
484139
|
+
name: "less-permission-prompts",
|
|
484140
|
+
description: "Scan this session for frequent read-only tool calls and add matching allowlist rules to user settings so they stop prompting.",
|
|
484141
|
+
whenToUse: "Use when the user is tired of repeated permission prompts for the same read-only commands/tools (git status, ls, MCP read tools, …) and wants to allowlist them in one step.",
|
|
484142
|
+
argumentHint: "[max-rules]",
|
|
484143
|
+
userInvocable: true,
|
|
484144
|
+
disableModelInvocation: true,
|
|
484145
|
+
getPromptForCommand: runLessPermissionPrompts
|
|
484146
|
+
});
|
|
484147
|
+
}
|
|
484148
|
+
var READONLY_BUILTIN_TOOLS, DEFAULT_LIMIT = 10, NO_CANDIDATES_MESSAGE = "No read-only tool-call patterns were found in this session transcript to allowlist. Read-only Bash calls (e.g. `git status`, `ls`) and read-only built-in/MCP tools would appear here; write-class commands are never allowlisted by this skill. Try it in a session where you were prompted for the same read-only commands repeatedly.";
|
|
484149
|
+
var init_lessPermissionPrompts = __esm(() => {
|
|
484150
|
+
init_bundledSkills2();
|
|
484151
|
+
init_engine();
|
|
484152
|
+
init_permissionsLoader();
|
|
484153
|
+
READONLY_BUILTIN_TOOLS = new Set([
|
|
484154
|
+
"Read",
|
|
484155
|
+
"Glob",
|
|
484156
|
+
"Grep",
|
|
484157
|
+
"NotebookRead"
|
|
484158
|
+
]);
|
|
484159
|
+
});
|
|
484160
|
+
|
|
483689
484161
|
// src/tui/skills/bundled/loremIpsum.ts
|
|
483690
484162
|
function registerLoremIpsumSkill() {}
|
|
483691
484163
|
|
|
@@ -484741,6 +485213,7 @@ function initBundledSkills() {
|
|
|
484741
485213
|
registerSimplifySkill();
|
|
484742
485214
|
registerBatchSkill();
|
|
484743
485215
|
registerStuckSkill();
|
|
485216
|
+
registerLessPermissionPromptsSkill();
|
|
484744
485217
|
registerAscendGenerateSkill();
|
|
484745
485218
|
registerAscendDebugSkill();
|
|
484746
485219
|
registerAscendOptimizeSkill();
|
|
@@ -484764,6 +485237,7 @@ var init_bundled = __esm(() => {
|
|
|
484764
485237
|
init_batch();
|
|
484765
485238
|
init_debug2();
|
|
484766
485239
|
init_keybindings3();
|
|
485240
|
+
init_lessPermissionPrompts();
|
|
484767
485241
|
init_simplify();
|
|
484768
485242
|
init_updateConfig();
|
|
484769
485243
|
init_ascendGenerate();
|
|
@@ -487652,7 +488126,7 @@ import {
|
|
|
487652
488126
|
dirname as dirname87,
|
|
487653
488127
|
join as join184,
|
|
487654
488128
|
relative as relative38,
|
|
487655
|
-
resolve as
|
|
488129
|
+
resolve as resolve59,
|
|
487656
488130
|
sep as sep43
|
|
487657
488131
|
} from "path";
|
|
487658
488132
|
function git(marketplaceDir, args, timeoutMs = 2 * 60 * 1000) {
|
|
@@ -487665,8 +488139,8 @@ function gitFailureMessage(res) {
|
|
|
487665
488139
|
return (res.stderr || res.error || `exit code ${res.code}`).trim();
|
|
487666
488140
|
}
|
|
487667
488141
|
async function publishPluginToMarketplace(opts) {
|
|
487668
|
-
const pluginDir =
|
|
487669
|
-
const marketplaceDir =
|
|
488142
|
+
const pluginDir = resolve59(opts.pluginDir);
|
|
488143
|
+
const marketplaceDir = resolve59(opts.marketplaceDir);
|
|
487670
488144
|
const notes = [];
|
|
487671
488145
|
if (pluginDir === marketplaceDir || pluginDir.startsWith(marketplaceDir + sep43)) {
|
|
487672
488146
|
throw new Error(`Cannot publish "${pluginDir}": the plugin directory must not live inside the target marketplace (${marketplaceDir})`);
|
|
@@ -487797,9 +488271,9 @@ var init_marketplacePublish = __esm(() => {
|
|
|
487797
488271
|
import { userInfo as userInfo2 } from "os";
|
|
487798
488272
|
import { existsSync as existsSync15 } from "fs";
|
|
487799
488273
|
import { mkdir as mkdir57, writeFile as writeFile54 } from "fs/promises";
|
|
487800
|
-
import { dirname as dirname88, join as join185, resolve as
|
|
488274
|
+
import { dirname as dirname88, join as join185, resolve as resolve60 } from "path";
|
|
487801
488275
|
async function scaffoldMarketplace(opts) {
|
|
487802
|
-
const targetDir =
|
|
488276
|
+
const targetDir = resolve60(opts.targetDir);
|
|
487803
488277
|
const name = opts.name.trim();
|
|
487804
488278
|
const manifestDirName = getPluginManifestDirs()[0];
|
|
487805
488279
|
const marketplaceManifestPath = join185(targetDir, manifestDirName, "marketplace.json");
|
|
@@ -487885,7 +488359,7 @@ var init_marketplaceScaffold = __esm(() => {
|
|
|
487885
488359
|
});
|
|
487886
488360
|
|
|
487887
488361
|
// src/tui/cli/handlers/plugins.ts
|
|
487888
|
-
import { basename as basename65, dirname as dirname89, resolve as
|
|
488362
|
+
import { basename as basename65, dirname as dirname89, resolve as resolve61 } from "path";
|
|
487889
488363
|
function handleMarketplaceError(error, action) {
|
|
487890
488364
|
logError3(error);
|
|
487891
488365
|
cliError2(`${figures_default.cross} Failed to ${action}: ${errorMessage2(error)}`);
|
|
@@ -488237,7 +488711,7 @@ async function marketplaceUpdateHandler(name, options) {
|
|
|
488237
488711
|
async function marketplaceScaffoldHandler(options) {
|
|
488238
488712
|
if (options.cowork)
|
|
488239
488713
|
setUseCoworkPlugins(true);
|
|
488240
|
-
const targetDir =
|
|
488714
|
+
const targetDir = resolve61(options.target ?? process.cwd());
|
|
488241
488715
|
try {
|
|
488242
488716
|
const result = await scaffoldMarketplace({
|
|
488243
488717
|
name: options.name,
|
|
@@ -488262,8 +488736,8 @@ async function marketplacePublishHandler(options) {
|
|
|
488262
488736
|
setUseCoworkPlugins(true);
|
|
488263
488737
|
try {
|
|
488264
488738
|
const result = await publishPluginToMarketplace({
|
|
488265
|
-
pluginDir:
|
|
488266
|
-
marketplaceDir:
|
|
488739
|
+
pluginDir: resolve61(options.plugin),
|
|
488740
|
+
marketplaceDir: resolve61(options.marketplace),
|
|
488267
488741
|
version: options.version,
|
|
488268
488742
|
push: options.push
|
|
488269
488743
|
});
|
|
@@ -489479,7 +489953,7 @@ var init_update2 = __esm(() => {
|
|
|
489479
489953
|
|
|
489480
489954
|
// src/tui/main.tsx
|
|
489481
489955
|
import { readFileSync as readFileSync25 } from "fs";
|
|
489482
|
-
import { resolve as
|
|
489956
|
+
import { resolve as resolve62 } from "path";
|
|
489483
489957
|
function logManagedSettings() {
|
|
489484
489958
|
try {
|
|
489485
489959
|
const policySettings = getSettingsForSource2("policySettings");
|
|
@@ -490046,12 +490520,12 @@ ${getTmuxInstallInstructions3()}
|
|
|
490046
490520
|
process.exit(1);
|
|
490047
490521
|
}
|
|
490048
490522
|
try {
|
|
490049
|
-
const filePath =
|
|
490523
|
+
const filePath = resolve62(options.systemPromptFile);
|
|
490050
490524
|
systemPrompt = readFileSync25(filePath, "utf8");
|
|
490051
490525
|
} catch (error) {
|
|
490052
490526
|
const code = getErrnoCode2(error);
|
|
490053
490527
|
if (code === "ENOENT") {
|
|
490054
|
-
process.stderr.write(source_default.red(`Error: System prompt file not found: ${
|
|
490528
|
+
process.stderr.write(source_default.red(`Error: System prompt file not found: ${resolve62(options.systemPromptFile)}
|
|
490055
490529
|
`));
|
|
490056
490530
|
process.exit(1);
|
|
490057
490531
|
}
|
|
@@ -490068,12 +490542,12 @@ ${getTmuxInstallInstructions3()}
|
|
|
490068
490542
|
process.exit(1);
|
|
490069
490543
|
}
|
|
490070
490544
|
try {
|
|
490071
|
-
const filePath =
|
|
490545
|
+
const filePath = resolve62(options.appendSystemPromptFile);
|
|
490072
490546
|
appendSystemPrompt = readFileSync25(filePath, "utf8");
|
|
490073
490547
|
} catch (error) {
|
|
490074
490548
|
const code = getErrnoCode2(error);
|
|
490075
490549
|
if (code === "ENOENT") {
|
|
490076
|
-
process.stderr.write(source_default.red(`Error: Append system prompt file not found: ${
|
|
490550
|
+
process.stderr.write(source_default.red(`Error: Append system prompt file not found: ${resolve62(options.appendSystemPromptFile)}
|
|
490077
490551
|
`));
|
|
490078
490552
|
process.exit(1);
|
|
490079
490553
|
}
|
|
@@ -490123,7 +490597,7 @@ ${addendum}` : addendum;
|
|
|
490123
490597
|
errors = result.errors;
|
|
490124
490598
|
}
|
|
490125
490599
|
} else {
|
|
490126
|
-
const configPath =
|
|
490600
|
+
const configPath = resolve62(configItem);
|
|
490127
490601
|
const result = parseMcpConfigFromFilePath({
|
|
490128
490602
|
filePath: configPath,
|
|
490129
490603
|
expandVars: true,
|