@atlasharness/atlascode 0.1.50 → 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 +709 -331
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -28667,7 +28667,8 @@ var SettingsSchema = () => object({
|
|
|
28667
28667
|
respectGitignore: boolean2().optional(),
|
|
28668
28668
|
defaultShell: union([literal("bash"), literal("powershell")]).optional(),
|
|
28669
28669
|
skipWebFetchPreflight: boolean2().optional(),
|
|
28670
|
-
search: object({ tavilyApiKey: string2().optional() }).optional()
|
|
28670
|
+
search: object({ tavilyApiKey: string2().optional() }).optional(),
|
|
28671
|
+
tui: object({ fullscreen: boolean2().optional() }).optional()
|
|
28671
28672
|
}).passthrough();
|
|
28672
28673
|
var init_types3 = __esm(() => {
|
|
28673
28674
|
init_zod();
|
|
@@ -28834,7 +28835,7 @@ var _provider3 = null;
|
|
|
28834
28835
|
|
|
28835
28836
|
// src/permissions/filesystem.ts
|
|
28836
28837
|
import { tmpdir } from "os";
|
|
28837
|
-
import { join as join4, posix, sep } from "path";
|
|
28838
|
+
import { join as join4, posix, resolve as resolve2, sep } from "path";
|
|
28838
28839
|
function expandPathLocal(path) {
|
|
28839
28840
|
return expandPath(path, getPermissionsBootstrapEnv().getCwd());
|
|
28840
28841
|
}
|
|
@@ -28968,11 +28969,36 @@ function checkPathSafetyForAutoEdit(path, precomputedPathsToCheck) {
|
|
|
28968
28969
|
}
|
|
28969
28970
|
return { safe: true };
|
|
28970
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
|
+
}
|
|
28971
28991
|
function allWorkingDirectories(context) {
|
|
28972
|
-
|
|
28973
|
-
|
|
28992
|
+
const originalCwd = getPermissionsBootstrapEnv().getOriginalCwd();
|
|
28993
|
+
const dirs = [
|
|
28994
|
+
originalCwd,
|
|
28974
28995
|
...context.additionalWorkingDirectories.keys()
|
|
28975
|
-
]
|
|
28996
|
+
];
|
|
28997
|
+
const cwd = getPermissionsBootstrapEnv().getCwd();
|
|
28998
|
+
if (cwd !== originalCwd && isActiveWorktreeCwd(cwd)) {
|
|
28999
|
+
dirs.push(cwd);
|
|
29000
|
+
}
|
|
29001
|
+
return new Set(dirs);
|
|
28976
29002
|
}
|
|
28977
29003
|
function getResolvedWorkingDirPaths(workingPath) {
|
|
28978
29004
|
const cached = _resolvedWorkingDirCache.get(workingPath);
|
|
@@ -29197,7 +29223,7 @@ function checkWritePermissionForTool(tool, input, toolPermissionContext, precomp
|
|
|
29197
29223
|
} : undefined
|
|
29198
29224
|
};
|
|
29199
29225
|
}
|
|
29200
|
-
var DANGEROUS_FILES, DANGEROUS_DIRECTORIES, _atlasTempDir = null, _resolvedWorkingDirCache;
|
|
29226
|
+
var DANGEROUS_FILES, DANGEROUS_DIRECTORIES, _atlasTempDir = null, worktreeCwdProbeCache, _resolvedWorkingDirCache;
|
|
29201
29227
|
var init_filesystem = __esm(() => {
|
|
29202
29228
|
init_shared();
|
|
29203
29229
|
DANGEROUS_FILES = [
|
|
@@ -29219,6 +29245,7 @@ var init_filesystem = __esm(() => {
|
|
|
29219
29245
|
".idea",
|
|
29220
29246
|
getConfigDirName()
|
|
29221
29247
|
];
|
|
29248
|
+
worktreeCwdProbeCache = new Map;
|
|
29222
29249
|
_resolvedWorkingDirCache = new Map;
|
|
29223
29250
|
});
|
|
29224
29251
|
|
|
@@ -30132,7 +30159,7 @@ var init_permissionUpdateSchema = __esm(() => {
|
|
|
30132
30159
|
|
|
30133
30160
|
// src/permissions/pathValidation.ts
|
|
30134
30161
|
import { homedir as homedir3 } from "os";
|
|
30135
|
-
import { dirname as dirname2, isAbsolute as isAbsolute2, resolve as
|
|
30162
|
+
import { dirname as dirname2, isAbsolute as isAbsolute2, resolve as resolve3 } from "path";
|
|
30136
30163
|
function formatDirectoryList(directories) {
|
|
30137
30164
|
const dirCount = directories.length;
|
|
30138
30165
|
if (dirCount <= MAX_DIRS_TO_LIST) {
|
|
@@ -30261,7 +30288,7 @@ function isPathAllowed(resolvedPath, context, operationType, precomputedPathsToC
|
|
|
30261
30288
|
}
|
|
30262
30289
|
function validateGlobPattern(cleanPath, cwd, toolPermissionContext, operationType) {
|
|
30263
30290
|
if (containsPathTraversal(cleanPath)) {
|
|
30264
|
-
const absolutePath = isAbsolute2(cleanPath) ? cleanPath :
|
|
30291
|
+
const absolutePath = isAbsolute2(cleanPath) ? cleanPath : resolve3(cwd, cleanPath);
|
|
30265
30292
|
const { resolvedPath, isCanonical } = safeResolvePath2(absolutePath);
|
|
30266
30293
|
const result = isPathAllowed(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
|
|
30267
30294
|
return {
|
|
@@ -30271,7 +30298,7 @@ function validateGlobPattern(cleanPath, cwd, toolPermissionContext, operationTyp
|
|
|
30271
30298
|
};
|
|
30272
30299
|
}
|
|
30273
30300
|
const basePath = getGlobBaseDirectory(cleanPath);
|
|
30274
|
-
const absoluteBasePath = isAbsolute2(basePath) ? basePath :
|
|
30301
|
+
const absoluteBasePath = isAbsolute2(basePath) ? basePath : resolve3(cwd, basePath);
|
|
30275
30302
|
const { resolvedPath, isCanonical } = safeResolvePath2(absoluteBasePath);
|
|
30276
30303
|
const result = isPathAllowed(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
|
|
30277
30304
|
return {
|
|
@@ -30350,7 +30377,7 @@ function validatePath(path, cwd, toolPermissionContext, operationType) {
|
|
|
30350
30377
|
}
|
|
30351
30378
|
return validateGlobPattern(cleanPath, cwd, toolPermissionContext, operationType);
|
|
30352
30379
|
}
|
|
30353
|
-
const absolutePath = isAbsolute2(cleanPath) ? cleanPath :
|
|
30380
|
+
const absolutePath = isAbsolute2(cleanPath) ? cleanPath : resolve3(cwd, cleanPath);
|
|
30354
30381
|
const { resolvedPath, isCanonical } = safeResolvePath2(absolutePath);
|
|
30355
30382
|
const result = isPathAllowed(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
|
|
30356
30383
|
return {
|
|
@@ -30939,7 +30966,7 @@ var init_validation = __esm(() => {
|
|
|
30939
30966
|
});
|
|
30940
30967
|
|
|
30941
30968
|
// src/engine/config/settings.ts
|
|
30942
|
-
import { dirname as dirname3, join as join5, resolve as
|
|
30969
|
+
import { dirname as dirname3, join as join5, resolve as resolve4 } from "path";
|
|
30943
30970
|
function getManagedSettingsFilePath() {
|
|
30944
30971
|
return join5(getManagedSettingsDir(), "managed-settings.json");
|
|
30945
30972
|
}
|
|
@@ -31025,14 +31052,14 @@ function parseSettingsFileUncached(path) {
|
|
|
31025
31052
|
function getSettingsRootPathForSource(source) {
|
|
31026
31053
|
switch (source) {
|
|
31027
31054
|
case "userSettings":
|
|
31028
|
-
return
|
|
31055
|
+
return resolve4(getAtlasConfigHomeDir());
|
|
31029
31056
|
case "policySettings":
|
|
31030
|
-
return
|
|
31057
|
+
return resolve4(getManagedSettingsDir());
|
|
31031
31058
|
case "projectSettings":
|
|
31032
31059
|
case "localSettings":
|
|
31033
|
-
return
|
|
31060
|
+
return resolve4(process.cwd());
|
|
31034
31061
|
case "flagSettings":
|
|
31035
|
-
return
|
|
31062
|
+
return resolve4(process.cwd());
|
|
31036
31063
|
}
|
|
31037
31064
|
}
|
|
31038
31065
|
function getUserSettingsFilePath() {
|
|
@@ -31162,7 +31189,7 @@ function loadSettingsFromDisk() {
|
|
|
31162
31189
|
}
|
|
31163
31190
|
const filePath = getSettingsFilePathForSource(source);
|
|
31164
31191
|
if (filePath) {
|
|
31165
|
-
const resolvedPath =
|
|
31192
|
+
const resolvedPath = resolve4(filePath);
|
|
31166
31193
|
if (!seenFiles.has(resolvedPath)) {
|
|
31167
31194
|
seenFiles.add(resolvedPath);
|
|
31168
31195
|
const { settings, errors } = parseSettingsFile(filePath);
|
|
@@ -46017,12 +46044,22 @@ var init_bashCommandHelpers = __esm(() => {
|
|
|
46017
46044
|
});
|
|
46018
46045
|
|
|
46019
46046
|
// src/engine/tools/bash/bashReadOnly.ts
|
|
46020
|
-
function
|
|
46047
|
+
function matchReadOnlyPrefix(command) {
|
|
46021
46048
|
const trimmed = command.trim();
|
|
46022
46049
|
if (trimmed.includes("&&") || trimmed.includes("||") || trimmed.includes(";") || trimmed.includes("|") || trimmed.includes("`") || trimmed.includes("$(") || trimmed.includes(">")) {
|
|
46023
|
-
return
|
|
46050
|
+
return null;
|
|
46051
|
+
}
|
|
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
|
+
}
|
|
46024
46058
|
}
|
|
46025
|
-
return
|
|
46059
|
+
return best;
|
|
46060
|
+
}
|
|
46061
|
+
function isReadOnlyCommand(command) {
|
|
46062
|
+
return matchReadOnlyPrefix(command) !== null;
|
|
46026
46063
|
}
|
|
46027
46064
|
var READ_ONLY_PREFIXES;
|
|
46028
46065
|
var init_bashReadOnly = __esm(() => {
|
|
@@ -46458,9 +46495,9 @@ var init_permissionPersist = __esm(() => {
|
|
|
46458
46495
|
|
|
46459
46496
|
// src/engine/tools/bash/pathHelpers.ts
|
|
46460
46497
|
import { statSync as statSync2 } from "fs";
|
|
46461
|
-
import { dirname as dirname7, isAbsolute as isAbsolute3, resolve as
|
|
46498
|
+
import { dirname as dirname7, isAbsolute as isAbsolute3, resolve as resolve5 } from "path";
|
|
46462
46499
|
function getDirectoryForPath(path) {
|
|
46463
|
-
const absolutePath = isAbsolute3(path) ? path :
|
|
46500
|
+
const absolutePath = isAbsolute3(path) ? path : resolve5(getCwd(), path);
|
|
46464
46501
|
if (absolutePath.startsWith("\\\\") || absolutePath.startsWith("//")) {
|
|
46465
46502
|
return dirname7(absolutePath);
|
|
46466
46503
|
}
|
|
@@ -46478,13 +46515,13 @@ var init_pathHelpers = __esm(() => {
|
|
|
46478
46515
|
|
|
46479
46516
|
// src/engine/tools/bash/pathValidation.ts
|
|
46480
46517
|
import { homedir as homedir6 } from "os";
|
|
46481
|
-
import { isAbsolute as isAbsolute4, resolve as
|
|
46518
|
+
import { isAbsolute as isAbsolute4, resolve as resolve6 } from "path";
|
|
46482
46519
|
function checkDangerousRemovalPaths(command, args, cwd) {
|
|
46483
46520
|
const extractor = PATH_EXTRACTORS[command];
|
|
46484
46521
|
const paths = extractor(args);
|
|
46485
46522
|
for (const path of paths) {
|
|
46486
46523
|
const cleanPath = expandTilde(path.replace(/^['"]|['"]$/g, ""));
|
|
46487
|
-
const absolutePath = isAbsolute4(cleanPath) ? cleanPath :
|
|
46524
|
+
const absolutePath = isAbsolute4(cleanPath) ? cleanPath : resolve6(cwd, cleanPath);
|
|
46488
46525
|
if (isDangerousRemovalPath(absolutePath)) {
|
|
46489
46526
|
return {
|
|
46490
46527
|
behavior: "ask",
|
|
@@ -49627,7 +49664,7 @@ var init_shellProvider = () => {};
|
|
|
49627
49664
|
// src/executor/shell/Shell.ts
|
|
49628
49665
|
import { execFileSync, spawn } from "child_process";
|
|
49629
49666
|
import { accessSync, constants as fsConstants2 } from "fs";
|
|
49630
|
-
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";
|
|
49631
49668
|
function isExecutable(shellPath) {
|
|
49632
49669
|
try {
|
|
49633
49670
|
accessSync(shellPath, fsConstants2.X_OK);
|
|
@@ -49781,7 +49818,7 @@ async function exec(command, abortSignal, options) {
|
|
|
49781
49818
|
function setCwd(path, relativeTo) {
|
|
49782
49819
|
const bootstrap = getBootstrapStatePort();
|
|
49783
49820
|
const fsOps = getFsImplementation();
|
|
49784
|
-
const resolved = isAbsolute5(path) ? path :
|
|
49821
|
+
const resolved = isAbsolute5(path) ? path : resolve7(relativeTo || bootstrap.getCwd(), path);
|
|
49785
49822
|
let physicalPath;
|
|
49786
49823
|
try {
|
|
49787
49824
|
physicalPath = fsOps.realpathSync(resolved);
|
|
@@ -51879,7 +51916,7 @@ var init_config3 = __esm(() => {
|
|
|
51879
51916
|
});
|
|
51880
51917
|
|
|
51881
51918
|
// src/engine/permissions/permissionSetup.ts
|
|
51882
|
-
import { resolve as
|
|
51919
|
+
import { resolve as resolve8 } from "path";
|
|
51883
51920
|
function parseBaseToolsFromCLI(baseTools, deps = {}) {
|
|
51884
51921
|
const joinedInput = baseTools.join(" ").trim();
|
|
51885
51922
|
const preset = parseToolPreset(joinedInput);
|
|
@@ -51893,7 +51930,7 @@ function isSymlinkTo({
|
|
|
51893
51930
|
originalCwd
|
|
51894
51931
|
}) {
|
|
51895
51932
|
const { resolvedPath: resolvedProcessPwd, isSymlink: isProcessPwdSymlink } = safeResolvePath(getFsImplementation(), processPwd);
|
|
51896
|
-
return isProcessPwdSymlink ? resolvedProcessPwd ===
|
|
51933
|
+
return isProcessPwdSymlink ? resolvedProcessPwd === resolve8(originalCwd) : false;
|
|
51897
51934
|
}
|
|
51898
51935
|
function initialPermissionModeFromCLI({
|
|
51899
51936
|
permissionModeCli,
|
|
@@ -54352,7 +54389,7 @@ import {
|
|
|
54352
54389
|
join as join15,
|
|
54353
54390
|
normalize,
|
|
54354
54391
|
relative,
|
|
54355
|
-
resolve as
|
|
54392
|
+
resolve as resolve9,
|
|
54356
54393
|
sep as sep2
|
|
54357
54394
|
} from "path";
|
|
54358
54395
|
function getFileModificationTime(filePath) {
|
|
@@ -54480,7 +54517,7 @@ function writeFileSyncAndFlush_DEPRECATED(filePath, content, options = { encodin
|
|
|
54480
54517
|
let targetPath = filePath;
|
|
54481
54518
|
try {
|
|
54482
54519
|
const linkTarget = fs.readlinkSync(filePath);
|
|
54483
|
-
targetPath = isAbsolute6(linkTarget) ? linkTarget :
|
|
54520
|
+
targetPath = isAbsolute6(linkTarget) ? linkTarget : resolve9(dirname9(filePath), linkTarget);
|
|
54484
54521
|
logForDebugging(`Writing through symlink: ${filePath} -> ${targetPath}`);
|
|
54485
54522
|
} catch {}
|
|
54486
54523
|
const tempPath = `${targetPath}.tmp.${process.pid}.${Date.now()}`;
|
|
@@ -55298,7 +55335,7 @@ var init_sandbox_backend = __esm(() => {
|
|
|
55298
55335
|
// src/sandbox/createSandboxManager.ts
|
|
55299
55336
|
import { rmSync, statSync as statSync3 } from "fs";
|
|
55300
55337
|
import { readFile as readFile3 } from "fs/promises";
|
|
55301
|
-
import { join as join16, resolve as
|
|
55338
|
+
import { join as join16, resolve as resolve11, sep as sep3 } from "path";
|
|
55302
55339
|
function memoizeNoArg2(fn) {
|
|
55303
55340
|
let cached = false;
|
|
55304
55341
|
let value;
|
|
@@ -55341,18 +55378,18 @@ function createSandboxManager(deps, backend) {
|
|
|
55341
55378
|
const cwd = deps.getCwd();
|
|
55342
55379
|
const originalCwd = deps.getOriginalCwd();
|
|
55343
55380
|
if (cwd !== originalCwd) {
|
|
55344
|
-
denyWrite.push(
|
|
55345
|
-
denyWrite.push(
|
|
55381
|
+
denyWrite.push(resolve11(cwd, deps.getConfigDirName(), "settings.json"));
|
|
55382
|
+
denyWrite.push(resolve11(cwd, deps.getConfigDirName(), "settings.local.json"));
|
|
55346
55383
|
}
|
|
55347
|
-
denyWrite.push(
|
|
55384
|
+
denyWrite.push(resolve11(originalCwd, deps.getConfigDirName(), "skills"));
|
|
55348
55385
|
if (cwd !== originalCwd) {
|
|
55349
|
-
denyWrite.push(
|
|
55386
|
+
denyWrite.push(resolve11(cwd, deps.getConfigDirName(), "skills"));
|
|
55350
55387
|
}
|
|
55351
55388
|
bareGitRepoScrubPaths.length = 0;
|
|
55352
55389
|
const bareGitRepoFiles = ["HEAD", "objects", "refs", "hooks", "config"];
|
|
55353
55390
|
for (const dir of cwd === originalCwd ? [originalCwd] : [originalCwd, cwd]) {
|
|
55354
55391
|
for (const gitFile of bareGitRepoFiles) {
|
|
55355
|
-
const p =
|
|
55392
|
+
const p = resolve11(dir, gitFile);
|
|
55356
55393
|
try {
|
|
55357
55394
|
statSync3(p);
|
|
55358
55395
|
denyWrite.push(p);
|
|
@@ -55421,7 +55458,7 @@ function createSandboxManager(deps, backend) {
|
|
|
55421
55458
|
if (!gitdirMatch?.[1]) {
|
|
55422
55459
|
return null;
|
|
55423
55460
|
}
|
|
55424
|
-
const gitdir =
|
|
55461
|
+
const gitdir = resolve11(cwd, gitdirMatch[1].trim());
|
|
55425
55462
|
const marker = sep3 + ".git" + sep3 + "worktrees" + sep3;
|
|
55426
55463
|
const markerIndex = gitdir.lastIndexOf(marker);
|
|
55427
55464
|
if (markerIndex > 0) {
|
|
@@ -68278,7 +68315,7 @@ var init_mcp2 = __esm(() => {
|
|
|
68278
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.`;
|
|
68279
68316
|
|
|
68280
68317
|
// src/engine/tools/notebook/notebookEditTool.ts
|
|
68281
|
-
import { extname as extname4, isAbsolute as isAbsolute9, resolve as
|
|
68318
|
+
import { extname as extname4, isAbsolute as isAbsolute9, resolve as resolve12 } from "path";
|
|
68282
68319
|
var NOTEBOOK_EDIT_TOOL_INPUT_SCHEMA, NotebookEditTool;
|
|
68283
68320
|
var init_notebookEditTool = __esm(() => {
|
|
68284
68321
|
init_shared();
|
|
@@ -68394,7 +68431,7 @@ var init_notebookEditTool = __esm(() => {
|
|
|
68394
68431
|
edit_mode = "replace"
|
|
68395
68432
|
} = input;
|
|
68396
68433
|
const ctx = context;
|
|
68397
|
-
const fullPath = isAbsolute9(notebook_path) ? notebook_path :
|
|
68434
|
+
const fullPath = isAbsolute9(notebook_path) ? notebook_path : resolve12(getCwd(), notebook_path);
|
|
68398
68435
|
if (fullPath.startsWith("\\\\") || fullPath.startsWith("//")) {
|
|
68399
68436
|
return { result: true };
|
|
68400
68437
|
}
|
|
@@ -68498,7 +68535,7 @@ var init_notebookEditTool = __esm(() => {
|
|
|
68498
68535
|
} = args ?? {};
|
|
68499
68536
|
let cell_type = inputCellType;
|
|
68500
68537
|
const { readFileState } = context;
|
|
68501
|
-
const fullPath = isAbsolute9(notebook_path) ? notebook_path :
|
|
68538
|
+
const fullPath = isAbsolute9(notebook_path) ? notebook_path : resolve12(getCwd(), notebook_path);
|
|
68502
68539
|
try {
|
|
68503
68540
|
const { content, encoding, lineEndings } = readFileSyncWithMetadata(fullPath);
|
|
68504
68541
|
let notebook;
|
|
@@ -74913,7 +74950,7 @@ var init_skillModel = __esm(() => {
|
|
|
74913
74950
|
import { execFile as execFile5 } from "child_process";
|
|
74914
74951
|
import { readFileSync as readFileSync8, realpathSync as realpathSync4, statSync as statSync4 } from "fs";
|
|
74915
74952
|
import { readFile as readFile9, stat as stat6 } from "fs/promises";
|
|
74916
|
-
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";
|
|
74917
74954
|
function getErrorMessage(code, signal) {
|
|
74918
74955
|
if (signal)
|
|
74919
74956
|
return signal;
|
|
@@ -74975,7 +75012,7 @@ function gitExe() {
|
|
|
74975
75012
|
function findGitRootImpl(startPath) {
|
|
74976
75013
|
if (typeof startPath !== "string")
|
|
74977
75014
|
startPath = String(startPath || "/tmp");
|
|
74978
|
-
let current =
|
|
75015
|
+
let current = resolve13(startPath);
|
|
74979
75016
|
const root = current.substring(0, current.indexOf(sep6) + 1) || sep6;
|
|
74980
75017
|
while (current !== root) {
|
|
74981
75018
|
try {
|
|
@@ -75014,9 +75051,9 @@ function resolveCanonicalRoot(gitRoot) {
|
|
|
75014
75051
|
if (!gitContent.startsWith("gitdir:")) {
|
|
75015
75052
|
return gitRoot;
|
|
75016
75053
|
}
|
|
75017
|
-
const worktreeGitDir =
|
|
75018
|
-
const commonDir =
|
|
75019
|
-
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")) {
|
|
75020
75057
|
return gitRoot;
|
|
75021
75058
|
}
|
|
75022
75059
|
const backlink = realpathSync4(readFileSync8(join29(worktreeGitDir, "gitdir"), "utf-8").trim());
|
|
@@ -75045,7 +75082,7 @@ function findCanonicalGitRoot(startPath) {
|
|
|
75045
75082
|
return resolved;
|
|
75046
75083
|
}
|
|
75047
75084
|
async function resolveGitDir(startPath) {
|
|
75048
|
-
const cwd =
|
|
75085
|
+
const cwd = resolve13(startPath ?? process.cwd());
|
|
75049
75086
|
const cached = resolveGitDirCache.get(cwd);
|
|
75050
75087
|
if (cached !== undefined) {
|
|
75051
75088
|
return cached;
|
|
@@ -75062,7 +75099,7 @@ async function resolveGitDir(startPath) {
|
|
|
75062
75099
|
const content = (await readFile9(gitPath, "utf-8")).trim();
|
|
75063
75100
|
if (content.startsWith("gitdir:")) {
|
|
75064
75101
|
const rawDir = content.slice("gitdir:".length).trim();
|
|
75065
|
-
const resolved =
|
|
75102
|
+
const resolved = resolve13(root, rawDir);
|
|
75066
75103
|
resolveGitDirCache.set(cwd, resolved);
|
|
75067
75104
|
return resolved;
|
|
75068
75105
|
}
|
|
@@ -75166,7 +75203,7 @@ async function resolveRefInDir(dir, ref) {
|
|
|
75166
75203
|
async function getCommonDir(gitDir) {
|
|
75167
75204
|
try {
|
|
75168
75205
|
const content = (await readFile9(join29(gitDir, "commondir"), "utf-8")).trim();
|
|
75169
|
-
return
|
|
75206
|
+
return resolve13(gitDir, content);
|
|
75170
75207
|
} catch {
|
|
75171
75208
|
return null;
|
|
75172
75209
|
}
|
|
@@ -75178,7 +75215,7 @@ async function readWorktreeHeadSha(worktreePath) {
|
|
|
75178
75215
|
if (!ptr.startsWith("gitdir:")) {
|
|
75179
75216
|
return null;
|
|
75180
75217
|
}
|
|
75181
|
-
gitDir =
|
|
75218
|
+
gitDir = resolve13(worktreePath, ptr.slice("gitdir:".length).trim());
|
|
75182
75219
|
} catch {
|
|
75183
75220
|
return null;
|
|
75184
75221
|
}
|
|
@@ -75191,6 +75228,42 @@ async function readWorktreeHeadSha(worktreePath) {
|
|
|
75191
75228
|
}
|
|
75192
75229
|
return head.sha;
|
|
75193
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
|
+
}
|
|
75194
75267
|
async function readRawSymref(gitDir, refPath, branchPrefix) {
|
|
75195
75268
|
try {
|
|
75196
75269
|
const content = (await readFile9(join29(gitDir, refPath), "utf-8")).trim();
|
|
@@ -75407,8 +75480,12 @@ function resetWorktreeGitCaches() {
|
|
|
75407
75480
|
resolveGitDirCache.clear();
|
|
75408
75481
|
_gitExe = null;
|
|
75409
75482
|
}
|
|
75410
|
-
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;
|
|
75411
75484
|
var init_git = __esm(() => {
|
|
75485
|
+
GIT_NO_PROMPT_ENV = {
|
|
75486
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
75487
|
+
GIT_ASKPASS: ""
|
|
75488
|
+
};
|
|
75412
75489
|
GIT_ROOT_NOT_FOUND = Symbol("git-root-not-found");
|
|
75413
75490
|
findGitRootCache = new Map;
|
|
75414
75491
|
canonicalRootCache = new Map;
|
|
@@ -75416,8 +75493,16 @@ var init_git = __esm(() => {
|
|
|
75416
75493
|
});
|
|
75417
75494
|
|
|
75418
75495
|
// src/engine/worktree/worktree.ts
|
|
75419
|
-
import {
|
|
75420
|
-
|
|
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";
|
|
75421
75506
|
function validateWorktreeSlug(slug) {
|
|
75422
75507
|
if (slug.length > MAX_WORKTREE_SLUG_LENGTH) {
|
|
75423
75508
|
throw new Error(`Invalid worktree name: must be ${MAX_WORKTREE_SLUG_LENGTH} characters or fewer (got ${slug.length})`);
|
|
@@ -75684,6 +75769,53 @@ async function createWorktreeForSession(sessionId, slug, tmuxSessionName, option
|
|
|
75684
75769
|
};
|
|
75685
75770
|
return currentWorktreeSession;
|
|
75686
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
|
+
}
|
|
75687
75819
|
async function keepWorktree() {
|
|
75688
75820
|
if (!currentWorktreeSession) {
|
|
75689
75821
|
return;
|
|
@@ -75736,13 +75868,15 @@ async function cleanupWorktree() {
|
|
|
75736
75868
|
});
|
|
75737
75869
|
}
|
|
75738
75870
|
}
|
|
75739
|
-
async function createAgentWorktree(slug) {
|
|
75871
|
+
async function createAgentWorktree(slug, options) {
|
|
75740
75872
|
validateWorktreeSlug(slug);
|
|
75873
|
+
const effectiveSlug = options?.sessionId ? `${slug}-${options.sessionId.slice(0, 8)}` : slug;
|
|
75874
|
+
validateWorktreeSlug(effectiveSlug);
|
|
75741
75875
|
const gitRoot = findCanonicalGitRoot(process.cwd());
|
|
75742
75876
|
if (!gitRoot) {
|
|
75743
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).");
|
|
75744
75878
|
}
|
|
75745
|
-
const { worktreePath, worktreeBranch, headCommit, existed } = await getOrCreateWorktree(gitRoot,
|
|
75879
|
+
const { worktreePath, worktreeBranch, headCommit, existed } = await getOrCreateWorktree(gitRoot, effectiveSlug);
|
|
75746
75880
|
if (!existed) {
|
|
75747
75881
|
logForDebugging(`Created agent worktree at: ${worktreePath} on branch: ${worktreeBranch}`);
|
|
75748
75882
|
await performPostCreationSetup(gitRoot, worktreePath);
|
|
@@ -75833,16 +75967,12 @@ async function cleanupStaleAgentWorktrees(cutoffDate) {
|
|
|
75833
75967
|
}
|
|
75834
75968
|
return removed;
|
|
75835
75969
|
}
|
|
75836
|
-
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;
|
|
75837
75971
|
var init_worktree = __esm(() => {
|
|
75838
75972
|
init_shared();
|
|
75839
75973
|
init_config();
|
|
75840
75974
|
init_git();
|
|
75841
75975
|
VALID_WORKTREE_SLUG_SEGMENT = /^[a-zA-Z0-9._-]+$/;
|
|
75842
|
-
GIT_NO_PROMPT_ENV = {
|
|
75843
|
-
GIT_TERMINAL_PROMPT: "0",
|
|
75844
|
-
GIT_ASKPASS: ""
|
|
75845
|
-
};
|
|
75846
75976
|
EPHEMERAL_WORKTREE_PATTERNS = [
|
|
75847
75977
|
/^agent-a[0-9a-f]{7}$/,
|
|
75848
75978
|
/^wf_[0-9a-f]{8}-[0-9a-f]{3}-\d+$/,
|
|
@@ -75876,9 +76006,9 @@ function memoize2(fn, resolver) {
|
|
|
75876
76006
|
|
|
75877
76007
|
// src/engine/skill/markdownLoader.ts
|
|
75878
76008
|
import { statSync as statSync5 } from "fs";
|
|
75879
|
-
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";
|
|
75880
76010
|
import { homedir as homedir12 } from "os";
|
|
75881
|
-
import { dirname as dirname17, join as join31, resolve as
|
|
76011
|
+
import { dirname as dirname17, join as join31, resolve as resolve15 } from "path";
|
|
75882
76012
|
function extractDescriptionFromMarkdown(content, defaultDescription = "Custom item") {
|
|
75883
76013
|
const lines = content.split(`
|
|
75884
76014
|
`);
|
|
@@ -75936,9 +76066,9 @@ function resolveStopBoundary(cwd) {
|
|
|
75936
76066
|
return findGitRoot(cwd);
|
|
75937
76067
|
}
|
|
75938
76068
|
function getProjectDirsUpToHome(subdir, cwd) {
|
|
75939
|
-
const home =
|
|
76069
|
+
const home = resolve15(homedir12()).normalize("NFC");
|
|
75940
76070
|
const gitRoot = resolveStopBoundary(cwd);
|
|
75941
|
-
let current =
|
|
76071
|
+
let current = resolve15(cwd);
|
|
75942
76072
|
const dirs = [];
|
|
75943
76073
|
while (true) {
|
|
75944
76074
|
if (normalizePathForComparison(current) === normalizePathForComparison(home)) {
|
|
@@ -75973,7 +76103,7 @@ async function findMarkdownFilesNative(dir, signal) {
|
|
|
75973
76103
|
try {
|
|
75974
76104
|
const stats = await stat8(currentDir, { bigint: true });
|
|
75975
76105
|
if (stats.isDirectory()) {
|
|
75976
|
-
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);
|
|
75977
76107
|
if (visitedDirs.has(dirKey)) {
|
|
75978
76108
|
logForDebugging(`Skipping already visited directory (circular symlink): ${currentDir}`);
|
|
75979
76109
|
return;
|
|
@@ -76350,7 +76480,7 @@ var init_gitignore = __esm(() => {
|
|
|
76350
76480
|
init_worktree2();
|
|
76351
76481
|
});
|
|
76352
76482
|
// src/engine/skill/loadSkillsDir.ts
|
|
76353
|
-
import { realpath as
|
|
76483
|
+
import { realpath as realpath4 } from "fs/promises";
|
|
76354
76484
|
import {
|
|
76355
76485
|
basename as basename8,
|
|
76356
76486
|
dirname as dirname18,
|
|
@@ -76361,7 +76491,7 @@ import {
|
|
|
76361
76491
|
} from "path";
|
|
76362
76492
|
async function getFileIdentity2(filePath) {
|
|
76363
76493
|
try {
|
|
76364
|
-
return await
|
|
76494
|
+
return await realpath4(filePath);
|
|
76365
76495
|
} catch {
|
|
76366
76496
|
return null;
|
|
76367
76497
|
}
|
|
@@ -78478,6 +78608,10 @@ var init_enterWorktreeTool = __esm(() => {
|
|
|
78478
78608
|
name: {
|
|
78479
78609
|
type: "string",
|
|
78480
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."
|
|
78481
78615
|
}
|
|
78482
78616
|
}
|
|
78483
78617
|
};
|
|
@@ -78492,7 +78626,10 @@ var init_enterWorktreeTool = __esm(() => {
|
|
|
78492
78626
|
isConcurrencySafe: () => false,
|
|
78493
78627
|
isReadOnly: () => false,
|
|
78494
78628
|
isDestructive: () => false,
|
|
78495
|
-
toAutoClassifierInput: (input) =>
|
|
78629
|
+
toAutoClassifierInput: (input) => {
|
|
78630
|
+
const i = input;
|
|
78631
|
+
return i.name ?? i.path ?? "";
|
|
78632
|
+
},
|
|
78496
78633
|
userFacingName: () => "Creating worktree",
|
|
78497
78634
|
checkPermissions: async (input) => ({
|
|
78498
78635
|
behavior: "allow",
|
|
@@ -78500,14 +78637,20 @@ var init_enterWorktreeTool = __esm(() => {
|
|
|
78500
78637
|
}),
|
|
78501
78638
|
description: async () => ENTER_WORKTREE_PROMPT,
|
|
78502
78639
|
async validateInput(input) {
|
|
78503
|
-
const { name } = input;
|
|
78504
|
-
if (name
|
|
78505
|
-
|
|
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
|
+
}
|
|
78506
78647
|
}
|
|
78507
|
-
|
|
78508
|
-
|
|
78509
|
-
|
|
78510
|
-
|
|
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
|
+
};
|
|
78511
78654
|
}
|
|
78512
78655
|
return { result: true };
|
|
78513
78656
|
},
|
|
@@ -78521,6 +78664,20 @@ var init_enterWorktreeTool = __esm(() => {
|
|
|
78521
78664
|
process.chdir(mainRepoRoot);
|
|
78522
78665
|
setCwd(mainRepoRoot);
|
|
78523
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
|
+
}
|
|
78524
78681
|
const slug = input.name ?? randomUUID15();
|
|
78525
78682
|
const worktreeSession = await createWorktreeForSession(getSessionId(), slug);
|
|
78526
78683
|
process.chdir(worktreeSession.worktreePath);
|
|
@@ -81715,6 +81872,7 @@ var init_engine = __esm(() => {
|
|
|
81715
81872
|
init_tools();
|
|
81716
81873
|
init_tools();
|
|
81717
81874
|
init_tools();
|
|
81875
|
+
init_tools();
|
|
81718
81876
|
init_skill();
|
|
81719
81877
|
init_skill();
|
|
81720
81878
|
init_skill();
|
|
@@ -85154,7 +85312,7 @@ var init_hooksWiring = __esm(() => {
|
|
|
85154
85312
|
// src/cli/print.ts
|
|
85155
85313
|
import { randomUUID as randomUUID21 } from "crypto";
|
|
85156
85314
|
import { readFile as readFile12 } from "node:fs/promises";
|
|
85157
|
-
import { join as join37, resolve as
|
|
85315
|
+
import { join as join37, resolve as resolve16 } from "path";
|
|
85158
85316
|
function bridgeMcpToolClientLocal(client) {
|
|
85159
85317
|
return {
|
|
85160
85318
|
async callTool(toolName, args, _signal) {
|
|
@@ -85226,7 +85384,7 @@ async function parseMcpConfigItemsLocal(items) {
|
|
|
85226
85384
|
object = JSON.parse(trimmed);
|
|
85227
85385
|
} catch {
|
|
85228
85386
|
try {
|
|
85229
|
-
const raw = await readFile12(
|
|
85387
|
+
const raw = await readFile12(resolve16(trimmed), "utf8");
|
|
85230
85388
|
object = JSON.parse(raw);
|
|
85231
85389
|
} catch {
|
|
85232
85390
|
object = null;
|
|
@@ -86709,7 +86867,7 @@ var init_autoMode2 = __esm(() => {
|
|
|
86709
86867
|
|
|
86710
86868
|
// src/cli/parse.ts
|
|
86711
86869
|
import { existsSync as existsSync8, readFileSync as readFileSync11, realpathSync as realpathSync6 } from "fs";
|
|
86712
|
-
import { dirname as dirname21, join as join40, resolve as
|
|
86870
|
+
import { dirname as dirname21, join as join40, resolve as resolve17 } from "path";
|
|
86713
86871
|
function resolveCliVersion(startDir) {
|
|
86714
86872
|
let dir;
|
|
86715
86873
|
try {
|
|
@@ -86752,11 +86910,11 @@ function readPromptFileInline(inline, file, label) {
|
|
|
86752
86910
|
process.exit(1);
|
|
86753
86911
|
}
|
|
86754
86912
|
try {
|
|
86755
|
-
return readFileSync11(
|
|
86913
|
+
return readFileSync11(resolve17(file), "utf8");
|
|
86756
86914
|
} catch (error) {
|
|
86757
86915
|
const code = error.code;
|
|
86758
86916
|
if (code === "ENOENT") {
|
|
86759
|
-
process.stderr.write(`Error: ${label} file not found: ${
|
|
86917
|
+
process.stderr.write(`Error: ${label} file not found: ${resolve17(file)}
|
|
86760
86918
|
`);
|
|
86761
86919
|
} else {
|
|
86762
86920
|
process.stderr.write(`Error reading ${label} file: ${error.message}
|
|
@@ -98331,12 +98489,12 @@ var init_gitConfigParser = () => {};
|
|
|
98331
98489
|
// src/tui/utils/git/gitFilesystem.ts
|
|
98332
98490
|
import { unwatchFile, watchFile } from "fs";
|
|
98333
98491
|
import { readdir as readdir7, readFile as readFile16, stat as stat13 } from "fs/promises";
|
|
98334
|
-
import { join as join47, resolve as
|
|
98492
|
+
import { join as join47, resolve as resolve18 } from "path";
|
|
98335
98493
|
function clearResolveGitDirCache() {
|
|
98336
98494
|
resolveGitDirCache2.clear();
|
|
98337
98495
|
}
|
|
98338
98496
|
async function resolveGitDir2(startPath) {
|
|
98339
|
-
const cwd =
|
|
98497
|
+
const cwd = resolve18(startPath ?? getCwd());
|
|
98340
98498
|
const cached = resolveGitDirCache2.get(cwd);
|
|
98341
98499
|
if (cached !== undefined) {
|
|
98342
98500
|
return cached;
|
|
@@ -98353,7 +98511,7 @@ async function resolveGitDir2(startPath) {
|
|
|
98353
98511
|
const content = (await readFile16(gitPath, "utf-8")).trim();
|
|
98354
98512
|
if (content.startsWith("gitdir:")) {
|
|
98355
98513
|
const rawDir = content.slice("gitdir:".length).trim();
|
|
98356
|
-
const resolved =
|
|
98514
|
+
const resolved = resolve18(root, rawDir);
|
|
98357
98515
|
resolveGitDirCache2.set(cwd, resolved);
|
|
98358
98516
|
return resolved;
|
|
98359
98517
|
}
|
|
@@ -98457,7 +98615,7 @@ async function resolveRefInDir2(dir, ref) {
|
|
|
98457
98615
|
async function getCommonDir2(gitDir) {
|
|
98458
98616
|
try {
|
|
98459
98617
|
const content = (await readFile16(join47(gitDir, "commondir"), "utf-8")).trim();
|
|
98460
|
-
return
|
|
98618
|
+
return resolve18(gitDir, content);
|
|
98461
98619
|
} catch {
|
|
98462
98620
|
return null;
|
|
98463
98621
|
}
|
|
@@ -98677,7 +98835,7 @@ async function readWorktreeHeadSha2(worktreePath) {
|
|
|
98677
98835
|
if (!ptr.startsWith("gitdir:")) {
|
|
98678
98836
|
return null;
|
|
98679
98837
|
}
|
|
98680
|
-
gitDir =
|
|
98838
|
+
gitDir = resolve18(worktreePath, ptr.slice("gitdir:".length).trim());
|
|
98681
98839
|
} catch {
|
|
98682
98840
|
return null;
|
|
98683
98841
|
}
|
|
@@ -99530,7 +99688,7 @@ var init_gitAvailability = __esm(() => {
|
|
|
99530
99688
|
|
|
99531
99689
|
// src/tui/utils/git.ts
|
|
99532
99690
|
import { readFileSync as readFileSync14, realpathSync as realpathSync7, statSync as statSync7 } from "fs";
|
|
99533
|
-
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";
|
|
99534
99692
|
function createFindGitRoot() {
|
|
99535
99693
|
function wrapper(startPath) {
|
|
99536
99694
|
const result = findGitRootImpl2(startPath);
|
|
@@ -99666,7 +99824,7 @@ var init_git2 = __esm(() => {
|
|
|
99666
99824
|
logForDiagnosticsNoPII("info", "find_git_root_started");
|
|
99667
99825
|
if (typeof startPath !== "string")
|
|
99668
99826
|
startPath = String(startPath || "/tmp");
|
|
99669
|
-
let current =
|
|
99827
|
+
let current = resolve19(startPath);
|
|
99670
99828
|
const root = current.substring(0, current.indexOf(sep7) + 1) || sep7;
|
|
99671
99829
|
let statCount = 0;
|
|
99672
99830
|
while (current !== root) {
|
|
@@ -99716,9 +99874,9 @@ var init_git2 = __esm(() => {
|
|
|
99716
99874
|
if (!gitContent.startsWith("gitdir:")) {
|
|
99717
99875
|
return gitRoot;
|
|
99718
99876
|
}
|
|
99719
|
-
const worktreeGitDir =
|
|
99720
|
-
const commonDir =
|
|
99721
|
-
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")) {
|
|
99722
99880
|
return gitRoot;
|
|
99723
99881
|
}
|
|
99724
99882
|
const backlink = realpathSync7(readFileSync14(join49(worktreeGitDir, "gitdir"), "utf-8").trim());
|
|
@@ -99948,7 +100106,7 @@ var init_getWorktreePathsPortable = __esm(() => {
|
|
|
99948
100106
|
});
|
|
99949
100107
|
|
|
99950
100108
|
// src/tui/utils/sessionStoragePortable.ts
|
|
99951
|
-
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";
|
|
99952
100110
|
function validateUuid(maybeUuid) {
|
|
99953
100111
|
if (typeof maybeUuid !== "string")
|
|
99954
100112
|
return null;
|
|
@@ -100260,7 +100418,7 @@ var init_sessionStoragePortable = __esm(() => {
|
|
|
100260
100418
|
|
|
100261
100419
|
// src/tui/utils/path.ts
|
|
100262
100420
|
import { homedir as homedir17 } from "os";
|
|
100263
|
-
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";
|
|
100264
100422
|
function expandPath2(path, baseDir) {
|
|
100265
100423
|
const actualBaseDir = baseDir ?? getCwd() ?? getFsImplementation2().cwd();
|
|
100266
100424
|
if (typeof path !== "string") {
|
|
@@ -100293,7 +100451,7 @@ function expandPath2(path, baseDir) {
|
|
|
100293
100451
|
if (isAbsolute11(processedPath)) {
|
|
100294
100452
|
return normalize3(processedPath).normalize("NFC");
|
|
100295
100453
|
}
|
|
100296
|
-
return
|
|
100454
|
+
return resolve21(actualBaseDir, processedPath).normalize("NFC");
|
|
100297
100455
|
}
|
|
100298
100456
|
function toRelativePath2(absolutePath) {
|
|
100299
100457
|
const relativePath = relative5(getCwd(), absolutePath);
|
|
@@ -121026,7 +121184,7 @@ __export(exports_teamMemPaths, {
|
|
|
121026
121184
|
isTeamMemPath: () => isTeamMemPath,
|
|
121027
121185
|
isTeamMemoryEnabled: () => isTeamMemoryEnabled
|
|
121028
121186
|
});
|
|
121029
|
-
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";
|
|
121030
121188
|
function isTeamMemoryEnabled() {
|
|
121031
121189
|
if (!isAutoMemoryEnabled2()) {
|
|
121032
121190
|
return false;
|
|
@@ -121040,7 +121198,7 @@ function getTeamMemEntrypoint() {
|
|
|
121040
121198
|
return join55(getAutoMemPath2(), "team", "MEMORY.md");
|
|
121041
121199
|
}
|
|
121042
121200
|
function isTeamMemPath(filePath) {
|
|
121043
|
-
const resolvedPath =
|
|
121201
|
+
const resolvedPath = resolve22(filePath);
|
|
121044
121202
|
const teamDir = getTeamMemPath();
|
|
121045
121203
|
return resolvedPath.startsWith(teamDir);
|
|
121046
121204
|
}
|
|
@@ -121056,7 +121214,7 @@ var init_teamMemPaths = __esm(() => {
|
|
|
121056
121214
|
// src/tui/utils/config.ts
|
|
121057
121215
|
import { randomBytes as randomBytes5 } from "crypto";
|
|
121058
121216
|
import { unwatchFile as unwatchFile2, watchFile as watchFile2 } from "fs";
|
|
121059
|
-
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";
|
|
121060
121218
|
function createDefaultGlobalConfig() {
|
|
121061
121219
|
return {
|
|
121062
121220
|
numStartups: 0,
|
|
@@ -121115,7 +121273,7 @@ function computeTrustDialogAccepted() {
|
|
|
121115
121273
|
if (pathConfig?.hasTrustDialogAccepted) {
|
|
121116
121274
|
return true;
|
|
121117
121275
|
}
|
|
121118
|
-
const parentPath = normalizePathForConfigKey(
|
|
121276
|
+
const parentPath = normalizePathForConfigKey(resolve23(currentPath, ".."));
|
|
121119
121277
|
if (parentPath === currentPath) {
|
|
121120
121278
|
break;
|
|
121121
121279
|
}
|
|
@@ -121740,7 +121898,7 @@ var init_config6 = __esm(() => {
|
|
|
121740
121898
|
if (gitRoot) {
|
|
121741
121899
|
return normalizePathForConfigKey(gitRoot);
|
|
121742
121900
|
}
|
|
121743
|
-
return normalizePathForConfigKey(
|
|
121901
|
+
return normalizePathForConfigKey(resolve23(originalCwd));
|
|
121744
121902
|
});
|
|
121745
121903
|
});
|
|
121746
121904
|
|
|
@@ -121978,7 +122136,7 @@ var init_fileReadCache2 = __esm(() => {
|
|
|
121978
122136
|
|
|
121979
122137
|
// src/tui/utils/file.ts
|
|
121980
122138
|
import { chmodSync as chmodSync2, writeFileSync as fsWriteFileSync2 } from "fs";
|
|
121981
|
-
import { realpath as
|
|
122139
|
+
import { realpath as realpath6, stat as stat16 } from "fs/promises";
|
|
121982
122140
|
import { homedir as homedir20 } from "os";
|
|
121983
122141
|
import {
|
|
121984
122142
|
basename as basename11,
|
|
@@ -121988,7 +122146,7 @@ import {
|
|
|
121988
122146
|
join as join57,
|
|
121989
122147
|
normalize as normalize5,
|
|
121990
122148
|
relative as relative6,
|
|
121991
|
-
resolve as
|
|
122149
|
+
resolve as resolve24,
|
|
121992
122150
|
sep as sep11
|
|
121993
122151
|
} from "path";
|
|
121994
122152
|
async function pathExists2(path) {
|
|
@@ -122088,7 +122246,7 @@ async function suggestPathUnderCwd2(requestedPath) {
|
|
|
122088
122246
|
const cwdParent = dirname30(cwd);
|
|
122089
122247
|
let resolvedPath = requestedPath;
|
|
122090
122248
|
try {
|
|
122091
|
-
const resolvedDir = await
|
|
122249
|
+
const resolvedDir = await realpath6(dirname30(requestedPath));
|
|
122092
122250
|
resolvedPath = join57(resolvedDir, basename11(requestedPath));
|
|
122093
122251
|
} catch {}
|
|
122094
122252
|
const cwdParentPrefix = cwdParent === sep11 ? sep11 : cwdParent + sep11;
|
|
@@ -122148,7 +122306,7 @@ function writeFileSyncAndFlush_DEPRECATED2(filePath, content, options = { encodi
|
|
|
122148
122306
|
let targetPath = filePath;
|
|
122149
122307
|
try {
|
|
122150
122308
|
const linkTarget = fs.readlinkSync(filePath);
|
|
122151
|
-
targetPath = isAbsolute13(linkTarget) ? linkTarget :
|
|
122309
|
+
targetPath = isAbsolute13(linkTarget) ? linkTarget : resolve24(dirname30(filePath), linkTarget);
|
|
122152
122310
|
logForDebugging3(`Writing through symlink: ${filePath} -> ${targetPath}`);
|
|
122153
122311
|
} catch {}
|
|
122154
122312
|
const tempPath = `${targetPath}.tmp.${process.pid}.${Date.now()}`;
|
|
@@ -122522,6 +122680,7 @@ var isMcpServerCommandEntry = () => ({}), isMcpServerNameEntry = () => ({}), isM
|
|
|
122522
122680
|
outputStyle: string2().optional(),
|
|
122523
122681
|
language: string2().optional(),
|
|
122524
122682
|
theme: string2().optional(),
|
|
122683
|
+
tui: object({ fullscreen: boolean2().optional() }).optional(),
|
|
122525
122684
|
autoCompactWindow: discriminatedUnion("kind", [
|
|
122526
122685
|
object({ kind: literal("auto") }),
|
|
122527
122686
|
object({ kind: literal("off") }),
|
|
@@ -123538,7 +123697,7 @@ var init_settingsCache2 = __esm(() => {
|
|
|
123538
123697
|
});
|
|
123539
123698
|
|
|
123540
123699
|
// src/tui/utils/settings/settings.ts
|
|
123541
|
-
import { dirname as dirname32, join as join60, resolve as
|
|
123700
|
+
import { dirname as dirname32, join as join60, resolve as resolve25 } from "path";
|
|
123542
123701
|
function getManagedSettingsFilePath2() {
|
|
123543
123702
|
return join60(getManagedFilePath(), "managed-settings.json");
|
|
123544
123703
|
}
|
|
@@ -123626,15 +123785,15 @@ function parseSettingsFileUncached2(path) {
|
|
|
123626
123785
|
function getSettingsRootPathForSource2(source) {
|
|
123627
123786
|
switch (source) {
|
|
123628
123787
|
case "userSettings":
|
|
123629
|
-
return
|
|
123788
|
+
return resolve25(getAtlasConfigHomeDir3());
|
|
123630
123789
|
case "policySettings":
|
|
123631
123790
|
case "projectSettings":
|
|
123632
123791
|
case "localSettings": {
|
|
123633
|
-
return
|
|
123792
|
+
return resolve25(getOriginalCwd());
|
|
123634
123793
|
}
|
|
123635
123794
|
case "flagSettings": {
|
|
123636
123795
|
const path = getFlagSettingsPath();
|
|
123637
|
-
return path ? dirname32(
|
|
123796
|
+
return path ? dirname32(resolve25(path)) : resolve25(getOriginalCwd());
|
|
123638
123797
|
}
|
|
123639
123798
|
}
|
|
123640
123799
|
}
|
|
@@ -123915,7 +124074,7 @@ function loadSettingsFromDisk2() {
|
|
|
123915
124074
|
}
|
|
123916
124075
|
const filePath = getSettingsFilePathForSource2(source);
|
|
123917
124076
|
if (filePath) {
|
|
123918
|
-
const resolvedPath =
|
|
124077
|
+
const resolvedPath = resolve25(filePath);
|
|
123919
124078
|
if (!seenFiles.has(resolvedPath)) {
|
|
123920
124079
|
seenFiles.add(resolvedPath);
|
|
123921
124080
|
const { settings, errors } = parseSettingsFile2(filePath);
|
|
@@ -135484,6 +135643,12 @@ var init_earlyInput = __esm(() => {
|
|
|
135484
135643
|
|
|
135485
135644
|
// src/tui/utils/fullscreen.ts
|
|
135486
135645
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
135646
|
+
function setFullscreenRuntimeOverride(value) {
|
|
135647
|
+
fullscreenRuntimeOverride = value;
|
|
135648
|
+
}
|
|
135649
|
+
function getFullscreenRuntimeOverride() {
|
|
135650
|
+
return fullscreenRuntimeOverride;
|
|
135651
|
+
}
|
|
135487
135652
|
function isTmuxControlModeEnvHeuristic() {
|
|
135488
135653
|
if (!process.env.TMUX)
|
|
135489
135654
|
return false;
|
|
@@ -135516,6 +135681,9 @@ function isTmuxControlMode() {
|
|
|
135516
135681
|
return tmuxControlModeProbed ?? false;
|
|
135517
135682
|
}
|
|
135518
135683
|
function isFullscreenEnvEnabled() {
|
|
135684
|
+
if (fullscreenRuntimeOverride !== undefined) {
|
|
135685
|
+
return fullscreenRuntimeOverride;
|
|
135686
|
+
}
|
|
135519
135687
|
if (isEnvDefinedFalsy2(process.env.ATLAS_NO_FLICKER))
|
|
135520
135688
|
return false;
|
|
135521
135689
|
if (isEnvTruthy2(process.env.ATLAS_NO_FLICKER))
|
|
@@ -135553,7 +135721,7 @@ async function maybeGetTmuxMouseHint() {
|
|
|
135553
135721
|
return null;
|
|
135554
135722
|
return "tmux detected · scroll with PgUp/PgDn · or add 'set -g mouse on' to ~/.tmux.conf for wheel scroll";
|
|
135555
135723
|
}
|
|
135556
|
-
var loggedTmuxCcDisable = false, checkedTmuxMouseHint = false, tmuxControlModeProbed;
|
|
135724
|
+
var loggedTmuxCcDisable = false, checkedTmuxMouseHint = false, tmuxControlModeProbed, fullscreenRuntimeOverride;
|
|
135557
135725
|
var init_fullscreen = __esm(() => {
|
|
135558
135726
|
init_bootstrap();
|
|
135559
135727
|
init_debug();
|
|
@@ -162097,14 +162265,14 @@ var init_MessageResponse = __esm(() => {
|
|
|
162097
162265
|
|
|
162098
162266
|
// src/tui/commands/add-dir/validation.ts
|
|
162099
162267
|
import { stat as stat17 } from "fs/promises";
|
|
162100
|
-
import { dirname as dirname36, resolve as
|
|
162268
|
+
import { dirname as dirname36, resolve as resolve27 } from "path";
|
|
162101
162269
|
async function validateDirectoryForWorkspace(directoryPath, permissionContext) {
|
|
162102
162270
|
if (!directoryPath) {
|
|
162103
162271
|
return {
|
|
162104
162272
|
resultType: "emptyPath"
|
|
162105
162273
|
};
|
|
162106
162274
|
}
|
|
162107
|
-
const absolutePath =
|
|
162275
|
+
const absolutePath = resolve27(expandPath2(directoryPath));
|
|
162108
162276
|
try {
|
|
162109
162277
|
const stats = await stat17(absolutePath);
|
|
162110
162278
|
if (!stats.isDirectory()) {
|
|
@@ -162356,7 +162524,7 @@ var init_mailbox3 = __esm(() => {
|
|
|
162356
162524
|
});
|
|
162357
162525
|
|
|
162358
162526
|
// node_modules/readdirp/index.js
|
|
162359
|
-
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";
|
|
162360
162528
|
import { join as pjoin, resolve as presolve, sep as psep } from "node:path";
|
|
162361
162529
|
import { Readable as Readable6 } from "node:stream";
|
|
162362
162530
|
function readdirp(root, options = {}) {
|
|
@@ -162579,7 +162747,7 @@ var init_readdirp = __esm(() => {
|
|
|
162579
162747
|
async _getSymlinkEntryType(entry) {
|
|
162580
162748
|
const full = entry.fullPath;
|
|
162581
162749
|
try {
|
|
162582
|
-
const entryRealPath = await
|
|
162750
|
+
const entryRealPath = await realpath7(full);
|
|
162583
162751
|
const entryRealPathStats = await lstat2(entryRealPath);
|
|
162584
162752
|
if (entryRealPathStats.isFile()) {
|
|
162585
162753
|
return "file";
|
|
@@ -164559,9 +164727,9 @@ var init_pluginOnlyPolicy = __esm(() => {
|
|
|
164559
164727
|
|
|
164560
164728
|
// src/tui/utils/markdownConfigLoader.ts
|
|
164561
164729
|
import { statSync as statSync9 } from "fs";
|
|
164562
|
-
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";
|
|
164563
164731
|
import { homedir as homedir23 } from "os";
|
|
164564
|
-
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";
|
|
164565
164733
|
function extractDescriptionFromMarkdown2(content, defaultDescription = "Custom item") {
|
|
164566
164734
|
const lines = content.split(`
|
|
164567
164735
|
`);
|
|
@@ -164643,9 +164811,9 @@ function resolveStopBoundary2(cwd) {
|
|
|
164643
164811
|
return cwdGitRoot;
|
|
164644
164812
|
}
|
|
164645
164813
|
function getProjectDirsUpToHome2(subdir, cwd) {
|
|
164646
|
-
const home =
|
|
164814
|
+
const home = resolve30(homedir23()).normalize("NFC");
|
|
164647
164815
|
const gitRoot = resolveStopBoundary2(cwd);
|
|
164648
|
-
let current =
|
|
164816
|
+
let current = resolve30(cwd);
|
|
164649
164817
|
const dirs = [];
|
|
164650
164818
|
while (true) {
|
|
164651
164819
|
if (normalizePathForComparison2(current) === normalizePathForComparison2(home)) {
|
|
@@ -164680,7 +164848,7 @@ async function findMarkdownFilesNative2(dir, signal) {
|
|
|
164680
164848
|
try {
|
|
164681
164849
|
const stats = await stat22(currentDir, { bigint: true });
|
|
164682
164850
|
if (stats.isDirectory()) {
|
|
164683
|
-
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);
|
|
164684
164852
|
if (visitedDirs.has(dirKey)) {
|
|
164685
164853
|
logForDebugging3(`Skipping already visited directory (circular symlink): ${currentDir}`);
|
|
164686
164854
|
return;
|
|
@@ -167832,7 +168000,7 @@ var init_readOnlyCommandValidation2 = __esm(() => {
|
|
|
167832
168000
|
|
|
167833
168001
|
// src/tui/utils/permissions/pathValidation.ts
|
|
167834
168002
|
import { homedir as homedir24 } from "os";
|
|
167835
|
-
import { dirname as dirname41, isAbsolute as isAbsolute16, resolve as
|
|
168003
|
+
import { dirname as dirname41, isAbsolute as isAbsolute16, resolve as resolve31 } from "path";
|
|
167836
168004
|
function expandTilde2(path) {
|
|
167837
168005
|
if (path === "~" || path.startsWith("~/") || process.platform === "win32" && path.startsWith("~\\")) {
|
|
167838
168006
|
return homedir24() + path.slice(1);
|
|
@@ -178848,6 +179016,7 @@ __export(exports_engineCompat, {
|
|
|
178848
179016
|
FORK_DIRECTIVE_PREFIX: () => FORK_DIRECTIVE_PREFIX,
|
|
178849
179017
|
FORK_SUBAGENT_TYPE: () => FORK_SUBAGENT_TYPE,
|
|
178850
179018
|
GENERAL_PURPOSE_AGENT: () => GENERAL_PURPOSE_AGENT,
|
|
179019
|
+
GIT_NO_PROMPT_ENV: () => GIT_NO_PROMPT_ENV,
|
|
178851
179020
|
GLOB_TOOL_NAME: () => GLOB_TOOL_NAME,
|
|
178852
179021
|
GREP_TOOL_NAME: () => GREP_TOOL_NAME,
|
|
178853
179022
|
GlobTool: () => GlobTool,
|
|
@@ -179039,6 +179208,7 @@ __export(exports_engineCompat, {
|
|
|
179039
179208
|
enqueuePendingNotification: () => enqueuePendingNotification,
|
|
179040
179209
|
enqueueSdkEvent: () => enqueueSdkEvent,
|
|
179041
179210
|
enqueueTaskNotification: () => enqueueTaskNotification,
|
|
179211
|
+
enterExistingWorktreeForSession: () => enterExistingWorktreeForSession,
|
|
179042
179212
|
estimateMessageTokens: () => estimateMessageTokens,
|
|
179043
179213
|
evaluateTimeBasedTrigger: () => evaluateTimeBasedTrigger,
|
|
179044
179214
|
evictTerminalTask: () => evictTerminalTask,
|
|
@@ -179261,6 +179431,7 @@ __export(exports_engineCompat, {
|
|
|
179261
179431
|
killTmuxSession: () => killTmuxSession,
|
|
179262
179432
|
listAllCronTasks: () => listAllCronTasks,
|
|
179263
179433
|
listTasks: () => listTasks,
|
|
179434
|
+
listWorktrees: () => listWorktrees,
|
|
179264
179435
|
loadAgentDefinitions: () => loadAgentDefinitions,
|
|
179265
179436
|
loadAllPermissionRulesFromDisk: () => loadAllPermissionRulesFromDisk,
|
|
179266
179437
|
loadManagedFileSettings: () => loadManagedFileSettings,
|
|
@@ -179278,6 +179449,7 @@ __export(exports_engineCompat, {
|
|
|
179278
179449
|
markMessagesAsReadByPredicate: () => markMessagesAsReadByPredicate,
|
|
179279
179450
|
markSessionMemoryInitialized: () => markSessionMemoryInitialized,
|
|
179280
179451
|
markTaskNotified: () => markTaskNotified,
|
|
179452
|
+
matchReadOnlyPrefix: () => matchReadOnlyPrefix,
|
|
179281
179453
|
matchSessionMode: () => matchSessionMode,
|
|
179282
179454
|
mcpInfoFromString: () => mcpInfoFromString2,
|
|
179283
179455
|
mergeAutoCompactOverrides: () => mergeAutoCompactOverrides,
|
|
@@ -179309,6 +179481,7 @@ __export(exports_engineCompat, {
|
|
|
179309
179481
|
parseSettingsFile: () => parseSettingsFile,
|
|
179310
179482
|
parseToolListFromCLI: () => parseToolListFromCLI,
|
|
179311
179483
|
parseToolPreset: () => parseToolPreset,
|
|
179484
|
+
parseWorktreeListPorcelain: () => parseWorktreeListPorcelain,
|
|
179312
179485
|
partialCompactConversation: () => partialCompactConversation,
|
|
179313
179486
|
partitionToolCalls: () => partitionToolCalls,
|
|
179314
179487
|
peek: () => peek,
|
|
@@ -197646,7 +197819,7 @@ var init_IdeOnboardingDialog = __esm(() => {
|
|
|
197646
197819
|
|
|
197647
197820
|
// src/tui/utils/ide.ts
|
|
197648
197821
|
import { createConnection } from "net";
|
|
197649
|
-
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";
|
|
197650
197823
|
function isProcessRunning3(pid) {
|
|
197651
197824
|
try {
|
|
197652
197825
|
process.kill(pid, 0);
|
|
@@ -197788,7 +197961,7 @@ async function getIdeLockfilesPaths() {
|
|
|
197788
197961
|
if (windowsHome) {
|
|
197789
197962
|
const converter = new WindowsToWSLConverter(process.env.WSL_DISTRO_NAME);
|
|
197790
197963
|
const wslPath = converter.toLocalPath(windowsHome);
|
|
197791
|
-
paths.push(
|
|
197964
|
+
paths.push(resolve32(wslPath, getConfigDirName2(), "ide"));
|
|
197792
197965
|
}
|
|
197793
197966
|
try {
|
|
197794
197967
|
const usersDir = "/mnt/c/Users";
|
|
@@ -197930,14 +198103,14 @@ async function detectIDEs(includeInvalid) {
|
|
|
197930
198103
|
if (!checkWSLDistroMatch(idePath, process.env.WSL_DISTRO_NAME)) {
|
|
197931
198104
|
return false;
|
|
197932
198105
|
}
|
|
197933
|
-
const resolvedOriginal =
|
|
198106
|
+
const resolvedOriginal = resolve32(localPath).normalize("NFC");
|
|
197934
198107
|
if (cwd === resolvedOriginal || cwd.startsWith(resolvedOriginal + pathSeparator)) {
|
|
197935
198108
|
return true;
|
|
197936
198109
|
}
|
|
197937
198110
|
const converter = new WindowsToWSLConverter(process.env.WSL_DISTRO_NAME);
|
|
197938
198111
|
localPath = converter.toLocalPath(idePath);
|
|
197939
198112
|
}
|
|
197940
|
-
const resolvedPath =
|
|
198113
|
+
const resolvedPath = resolve32(localPath).normalize("NFC");
|
|
197941
198114
|
if (getPlatform3() === "windows") {
|
|
197942
198115
|
const normalizedCwd = cwd.replace(/^[a-zA-Z]:/, (match) => match.toUpperCase());
|
|
197943
198116
|
const normalizedResolvedPath = resolvedPath.replace(/^[a-zA-Z]:/, (match) => match.toUpperCase());
|
|
@@ -209738,12 +209911,12 @@ var init_LSPDiagnosticRegistry = __esm(() => {
|
|
|
209738
209911
|
|
|
209739
209912
|
// src/tui/utils/plugins/lspPluginIntegration.ts
|
|
209740
209913
|
import { readFile as readFile26 } from "fs/promises";
|
|
209741
|
-
import { join as join89, relative as relative10, resolve as
|
|
209914
|
+
import { join as join89, relative as relative10, resolve as resolve33 } from "path";
|
|
209742
209915
|
function validatePathWithinPlugin(pluginPath, relativePath) {
|
|
209743
|
-
const resolvedPluginPath =
|
|
209744
|
-
const resolvedFilePath =
|
|
209916
|
+
const resolvedPluginPath = resolve33(pluginPath);
|
|
209917
|
+
const resolvedFilePath = resolve33(pluginPath, relativePath);
|
|
209745
209918
|
const rel = relative10(resolvedPluginPath, resolvedFilePath);
|
|
209746
|
-
if (rel.startsWith("..") ||
|
|
209919
|
+
if (rel.startsWith("..") || resolve33(rel) === rel) {
|
|
209747
209920
|
return null;
|
|
209748
209921
|
}
|
|
209749
209922
|
return resolvedFilePath;
|
|
@@ -216004,6 +216177,7 @@ var init_memoryTypes2 = __esm(() => {
|
|
|
216004
216177
|
"- If the memory names a file path: check the file exists.",
|
|
216005
216178
|
"- If the memory names a function or flag: grep for it.",
|
|
216006
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.",
|
|
216007
216181
|
"",
|
|
216008
216182
|
'"The memory says X exists" is not the same as "X exists now."',
|
|
216009
216183
|
"",
|
|
@@ -251378,7 +251552,7 @@ var init_readEditContext = __esm(() => {
|
|
|
251378
251552
|
});
|
|
251379
251553
|
|
|
251380
251554
|
// src/tui/tools/FileWriteTool/UI.tsx
|
|
251381
|
-
import { isAbsolute as isAbsolute20, relative as relative14, resolve as
|
|
251555
|
+
import { isAbsolute as isAbsolute20, relative as relative14, resolve as resolve35 } from "path";
|
|
251382
251556
|
function countLines(content) {
|
|
251383
251557
|
const parts = content.split(EOL);
|
|
251384
251558
|
return content.endsWith(EOL) ? parts.length - 1 : parts.length;
|
|
@@ -251702,7 +251876,7 @@ function WriteRejectionBody(t0) {
|
|
|
251702
251876
|
}
|
|
251703
251877
|
async function loadRejectionDiff(filePath, content) {
|
|
251704
251878
|
try {
|
|
251705
|
-
const fullFilePath = isAbsolute20(filePath) ? filePath :
|
|
251879
|
+
const fullFilePath = isAbsolute20(filePath) ? filePath : resolve35(getCwd(), filePath);
|
|
251706
251880
|
const handle = await openForScan(fullFilePath);
|
|
251707
251881
|
if (handle === null)
|
|
251708
251882
|
return {
|
|
@@ -257508,7 +257682,7 @@ var init_bashProvider = __esm(() => {
|
|
|
257508
257682
|
});
|
|
257509
257683
|
|
|
257510
257684
|
// src/tui/utils/shell/powershellDetection.ts
|
|
257511
|
-
import { realpath as
|
|
257685
|
+
import { realpath as realpath9, stat as stat32 } from "fs/promises";
|
|
257512
257686
|
async function probePath(p) {
|
|
257513
257687
|
try {
|
|
257514
257688
|
return (await stat32(p)).isFile() ? p : null;
|
|
@@ -257520,11 +257694,11 @@ async function findPowerShell() {
|
|
|
257520
257694
|
const pwshPath = await which("pwsh");
|
|
257521
257695
|
if (pwshPath) {
|
|
257522
257696
|
if (getPlatform3() === "linux") {
|
|
257523
|
-
const resolved = await
|
|
257697
|
+
const resolved = await realpath9(pwshPath).catch(() => pwshPath);
|
|
257524
257698
|
if (pwshPath.startsWith("/snap/") || resolved.startsWith("/snap/")) {
|
|
257525
257699
|
const direct = await probePath("/opt/microsoft/powershell/7/pwsh") ?? await probePath("/usr/bin/pwsh");
|
|
257526
257700
|
if (direct) {
|
|
257527
|
-
const directResolved = await
|
|
257701
|
+
const directResolved = await realpath9(direct).catch(() => direct);
|
|
257528
257702
|
if (!direct.startsWith("/snap/") && !directResolved.startsWith("/snap/")) {
|
|
257529
257703
|
return direct;
|
|
257530
257704
|
}
|
|
@@ -257615,8 +257789,8 @@ var init_powershellProvider = __esm(() => {
|
|
|
257615
257789
|
// src/tui/utils/Shell.ts
|
|
257616
257790
|
import { execFileSync as execFileSync4, spawn as spawn9 } from "child_process";
|
|
257617
257791
|
import { constants as fsConstants5, readFileSync as readFileSync19, unlinkSync as unlinkSync3 } from "fs";
|
|
257618
|
-
import { mkdir as mkdir27, open as open12, realpath as
|
|
257619
|
-
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";
|
|
257620
257794
|
import { join as posixJoin3 } from "path/posix";
|
|
257621
257795
|
import { accessSync as accessSync2 } from "fs";
|
|
257622
257796
|
function isExecutable2(shellPath) {
|
|
@@ -257701,12 +257875,12 @@ async function exec3(command, abortSignal, shellType, options) {
|
|
|
257701
257875
|
let commandString = builtCommand;
|
|
257702
257876
|
let cwd = pwd();
|
|
257703
257877
|
try {
|
|
257704
|
-
await
|
|
257878
|
+
await realpath10(cwd);
|
|
257705
257879
|
} catch {
|
|
257706
257880
|
const fallback = getOriginalCwd();
|
|
257707
257881
|
logForDebugging3(`Shell CWD "${cwd}" no longer exists, recovering to "${fallback}"`);
|
|
257708
257882
|
try {
|
|
257709
|
-
await
|
|
257883
|
+
await realpath10(fallback);
|
|
257710
257884
|
setCwdState(fallback);
|
|
257711
257885
|
cwd = fallback;
|
|
257712
257886
|
} catch {
|
|
@@ -257805,7 +257979,7 @@ async function exec3(command, abortSignal, shellType, options) {
|
|
|
257805
257979
|
}
|
|
257806
257980
|
}
|
|
257807
257981
|
function setCwd2(path, relativeTo) {
|
|
257808
|
-
const resolved = isAbsolute25(path) ? path :
|
|
257982
|
+
const resolved = isAbsolute25(path) ? path : resolve36(relativeTo || getFsImplementation2().cwd(), path);
|
|
257809
257983
|
let physicalPath;
|
|
257810
257984
|
try {
|
|
257811
257985
|
physicalPath = getFsImplementation2().realpathSync(resolved);
|
|
@@ -258406,7 +258580,7 @@ var init_UI8 = __esm(() => {
|
|
|
258406
258580
|
});
|
|
258407
258581
|
|
|
258408
258582
|
// src/tui/tools/NotebookEditTool/NotebookEditTool.ts
|
|
258409
|
-
import { extname as extname13, isAbsolute as isAbsolute26, resolve as
|
|
258583
|
+
import { extname as extname13, isAbsolute as isAbsolute26, resolve as resolve37 } from "path";
|
|
258410
258584
|
var inputSchema12, outputSchema10, NotebookEditTool2;
|
|
258411
258585
|
var init_NotebookEditTool = __esm(() => {
|
|
258412
258586
|
init_shared();
|
|
@@ -258520,7 +258694,7 @@ var init_NotebookEditTool = __esm(() => {
|
|
|
258520
258694
|
renderToolUseErrorMessage: renderToolUseErrorMessage5,
|
|
258521
258695
|
renderToolResultMessage: renderToolResultMessage8,
|
|
258522
258696
|
async validateInput({ notebook_path, cell_type, cell_id, edit_mode = "replace" }, toolUseContext) {
|
|
258523
|
-
const fullPath = isAbsolute26(notebook_path) ? notebook_path :
|
|
258697
|
+
const fullPath = isAbsolute26(notebook_path) ? notebook_path : resolve37(getCwd(), notebook_path);
|
|
258524
258698
|
if (fullPath.startsWith("\\\\") || fullPath.startsWith("//")) {
|
|
258525
258699
|
return { result: true };
|
|
258526
258700
|
}
|
|
@@ -258619,7 +258793,7 @@ var init_NotebookEditTool = __esm(() => {
|
|
|
258619
258793
|
cell_type,
|
|
258620
258794
|
edit_mode: originalEditMode
|
|
258621
258795
|
}, { readFileState, updateFileHistoryState }, _, parentMessage) {
|
|
258622
|
-
const fullPath = isAbsolute26(notebook_path) ? notebook_path :
|
|
258796
|
+
const fullPath = isAbsolute26(notebook_path) ? notebook_path : resolve37(getCwd(), notebook_path);
|
|
258623
258797
|
if (fileHistoryEnabled()) {
|
|
258624
258798
|
await fileHistoryTrackEdit(updateFileHistoryState, fullPath, parentMessage.uuid);
|
|
258625
258799
|
}
|
|
@@ -260536,7 +260710,7 @@ var init_fileStateCache = __esm(() => {
|
|
|
260536
260710
|
});
|
|
260537
260711
|
|
|
260538
260712
|
// src/tui/utils/hooks/hooksSettings.ts
|
|
260539
|
-
import { resolve as
|
|
260713
|
+
import { resolve as resolve38 } from "path";
|
|
260540
260714
|
function isHookEqual(a, b) {
|
|
260541
260715
|
if (a.type !== b.type)
|
|
260542
260716
|
return false;
|
|
@@ -260587,7 +260761,7 @@ function getAllHooks(appState) {
|
|
|
260587
260761
|
for (const source of sources) {
|
|
260588
260762
|
const filePath = getSettingsFilePathForSource2(source);
|
|
260589
260763
|
if (filePath) {
|
|
260590
|
-
const resolvedPath =
|
|
260764
|
+
const resolvedPath = resolve38(filePath);
|
|
260591
260765
|
if (seenFiles.has(resolvedPath)) {
|
|
260592
260766
|
continue;
|
|
260593
260767
|
}
|
|
@@ -314163,7 +314337,7 @@ var init_parser7 = __esm(() => {
|
|
|
314163
314337
|
});
|
|
314164
314338
|
|
|
314165
314339
|
// src/tui/tools/PowerShellTool/gitSafety.ts
|
|
314166
|
-
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";
|
|
314167
314341
|
function resolveCwdReentry(normalized) {
|
|
314168
314342
|
if (!normalized.startsWith("../"))
|
|
314169
314343
|
return normalized;
|
|
@@ -314211,7 +314385,7 @@ function normalizeGitPathArg(arg) {
|
|
|
314211
314385
|
}
|
|
314212
314386
|
function resolveEscapingPathToCwdRelative(n) {
|
|
314213
314387
|
const cwd = getCwd();
|
|
314214
|
-
const abs =
|
|
314388
|
+
const abs = resolve39(cwd, n);
|
|
314215
314389
|
const cwdWithSep = cwd.endsWith(sep23) ? cwd : cwd + sep23;
|
|
314216
314390
|
const absLower = abs.toLowerCase();
|
|
314217
314391
|
const cwdLower = cwd.toLowerCase();
|
|
@@ -315451,7 +315625,7 @@ var init_modeValidation3 = __esm(() => {
|
|
|
315451
315625
|
|
|
315452
315626
|
// src/tui/tools/PowerShellTool/pathValidation.ts
|
|
315453
315627
|
import { homedir as homedir29 } from "os";
|
|
315454
|
-
import { isAbsolute as isAbsolute27, resolve as
|
|
315628
|
+
import { isAbsolute as isAbsolute27, resolve as resolve40 } from "path";
|
|
315455
315629
|
function matchesParam(paramLower, paramList) {
|
|
315456
315630
|
for (const p of paramList) {
|
|
315457
315631
|
if (p === paramLower || paramLower.length > 1 && p.startsWith(paramLower)) {
|
|
@@ -315559,7 +315733,7 @@ function checkDenyRuleForGuessedPath(strippedPath, cwd, toolPermissionContext, o
|
|
|
315559
315733
|
if (!strippedPath || strippedPath.includes("\x00"))
|
|
315560
315734
|
return null;
|
|
315561
315735
|
const tildeExpanded = expandTilde3(strippedPath);
|
|
315562
|
-
const abs = isAbsolute27(tildeExpanded) ? tildeExpanded :
|
|
315736
|
+
const abs = isAbsolute27(tildeExpanded) ? tildeExpanded : resolve40(cwd, tildeExpanded);
|
|
315563
315737
|
const { resolvedPath } = safeResolvePath3(getFsImplementation2(), abs);
|
|
315564
315738
|
const permissionType = operationType === "read" ? "read" : "edit";
|
|
315565
315739
|
const denyRule = matchingRuleForInput2(resolvedPath, toolPermissionContext, permissionType, "deny");
|
|
@@ -315649,7 +315823,7 @@ function validatePath3(filePath, cwd, toolPermissionContext, operationType) {
|
|
|
315649
315823
|
};
|
|
315650
315824
|
}
|
|
315651
315825
|
if (containsPathTraversal2(normalizedPath)) {
|
|
315652
|
-
const absolutePath = isAbsolute27(normalizedPath) ? normalizedPath :
|
|
315826
|
+
const absolutePath = isAbsolute27(normalizedPath) ? normalizedPath : resolve40(cwd, normalizedPath);
|
|
315653
315827
|
const { resolvedPath, isCanonical } = safeResolvePath3(getFsImplementation2(), absolutePath);
|
|
315654
315828
|
const result = isPathAllowed2(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
|
|
315655
315829
|
return {
|
|
@@ -315659,7 +315833,7 @@ function validatePath3(filePath, cwd, toolPermissionContext, operationType) {
|
|
|
315659
315833
|
};
|
|
315660
315834
|
}
|
|
315661
315835
|
const basePath = getGlobBaseDirectory2(normalizedPath);
|
|
315662
|
-
const absoluteBasePath = isAbsolute27(basePath) ? basePath :
|
|
315836
|
+
const absoluteBasePath = isAbsolute27(basePath) ? basePath : resolve40(cwd, basePath);
|
|
315663
315837
|
const { resolvedPath } = safeResolvePath3(getFsImplementation2(), absoluteBasePath);
|
|
315664
315838
|
const permissionType = operationType === "read" ? "read" : "edit";
|
|
315665
315839
|
const denyRule = matchingRuleForInput2(resolvedPath, toolPermissionContext, permissionType, "deny");
|
|
@@ -315679,7 +315853,7 @@ function validatePath3(filePath, cwd, toolPermissionContext, operationType) {
|
|
|
315679
315853
|
}
|
|
315680
315854
|
};
|
|
315681
315855
|
}
|
|
315682
|
-
const absolutePath = isAbsolute27(normalizedPath) ? normalizedPath :
|
|
315856
|
+
const absolutePath = isAbsolute27(normalizedPath) ? normalizedPath : resolve40(cwd, normalizedPath);
|
|
315683
315857
|
const { resolvedPath, isCanonical } = safeResolvePath3(getFsImplementation2(), absolutePath);
|
|
315684
315858
|
const result = isPathAllowed2(resolvedPath, toolPermissionContext, operationType, isCanonical ? [resolvedPath] : undefined);
|
|
315685
315859
|
return {
|
|
@@ -317593,7 +317767,7 @@ var init_powershellSecurity = __esm(() => {
|
|
|
317593
317767
|
});
|
|
317594
317768
|
|
|
317595
317769
|
// src/tui/tools/PowerShellTool/powershellPermissions.ts
|
|
317596
|
-
import { resolve as
|
|
317770
|
+
import { resolve as resolve41 } from "path";
|
|
317597
317771
|
async function extractCommandName(command) {
|
|
317598
317772
|
const trimmed = command.trim();
|
|
317599
317773
|
if (!trimmed) {
|
|
@@ -318206,7 +318380,7 @@ async function powershellToolHasPermission(input, context) {
|
|
|
318206
318380
|
const canonical = resolveToCanonical(element.name);
|
|
318207
318381
|
if (canonical === "set-location" && element.args.length > 0) {
|
|
318208
318382
|
const target = element.args.find((a) => a.length === 0 || !PS_TOKENIZER_DASH_CHARS.has(a[0]));
|
|
318209
|
-
if (target &&
|
|
318383
|
+
if (target && resolve41(getCwd(), target) === getCwd()) {
|
|
318210
318384
|
return false;
|
|
318211
318385
|
}
|
|
318212
318386
|
}
|
|
@@ -323222,7 +323396,7 @@ function registerMCPSkillBuilders(b) {
|
|
|
323222
323396
|
var builders = null;
|
|
323223
323397
|
|
|
323224
323398
|
// src/tui/skills/loadSkillsDir.ts
|
|
323225
|
-
import { realpath as
|
|
323399
|
+
import { realpath as realpath11 } from "fs/promises";
|
|
323226
323400
|
import {
|
|
323227
323401
|
basename as basename30,
|
|
323228
323402
|
dirname as dirname56,
|
|
@@ -323251,7 +323425,7 @@ function estimateSkillFrontmatterTokens2(skill) {
|
|
|
323251
323425
|
}
|
|
323252
323426
|
async function getFileIdentity4(filePath) {
|
|
323253
323427
|
try {
|
|
323254
|
-
return await
|
|
323428
|
+
return await realpath11(filePath);
|
|
323255
323429
|
} catch {
|
|
323256
323430
|
return null;
|
|
323257
323431
|
}
|
|
@@ -326600,7 +326774,7 @@ var init_findRelevantMemories = __esm(() => {
|
|
|
326600
326774
|
|
|
326601
326775
|
// src/tui/utils/attachments.ts
|
|
326602
326776
|
import { readdir as readdir21, stat as stat37 } from "fs/promises";
|
|
326603
|
-
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";
|
|
326604
326778
|
import { randomUUID as randomUUID35 } from "crypto";
|
|
326605
326779
|
async function getAttachments(input, toolUseContext, ideSelection, queuedCommands, messages, querySource, options) {
|
|
326606
326780
|
if (isEnvTruthy2(process.env.ATLAS_DISABLE_ATTACHMENTS) || isEnvTruthy2(process.env.ATLAS_SIMPLE)) {
|
|
@@ -327021,7 +327195,7 @@ async function getSelectedLinesFromIDE(ideSelection, toolUseContext) {
|
|
|
327021
327195
|
];
|
|
327022
327196
|
}
|
|
327023
327197
|
function getDirectoriesToProcess(targetPath, originalCwd) {
|
|
327024
|
-
const targetDir = dirname58(
|
|
327198
|
+
const targetDir = dirname58(resolve42(targetPath));
|
|
327025
327199
|
const nestedDirs = [];
|
|
327026
327200
|
let currentDir = targetDir;
|
|
327027
327201
|
while (currentDir !== originalCwd && currentDir !== parse12(currentDir).root) {
|
|
@@ -327320,7 +327494,7 @@ async function getDynamicSkillAttachments(toolUseContext) {
|
|
|
327320
327494
|
const candidates = entries.filter((e) => e.isDirectory() || e.isSymbolicLink()).map((e) => e.name);
|
|
327321
327495
|
const checked = await Promise.all(candidates.map(async (name) => {
|
|
327322
327496
|
try {
|
|
327323
|
-
await stat37(
|
|
327497
|
+
await stat37(resolve42(skillDir, name, "SKILL.md"));
|
|
327324
327498
|
return name;
|
|
327325
327499
|
} catch {
|
|
327326
327500
|
return null;
|
|
@@ -329372,10 +329546,10 @@ var init_marketplaceHelpers = __esm(() => {
|
|
|
329372
329546
|
|
|
329373
329547
|
// src/tui/utils/plugins/officialMarketplaceGcs.ts
|
|
329374
329548
|
import { chmod as chmod5, mkdir as mkdir36, readFile as readFile41, rename as rename4, rm as rm7, writeFile as writeFile27 } from "fs/promises";
|
|
329375
|
-
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";
|
|
329376
329550
|
async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCacheDir) {
|
|
329377
|
-
const cacheDir =
|
|
329378
|
-
const resolvedLoc =
|
|
329551
|
+
const cacheDir = resolve43(marketplacesCacheDir);
|
|
329552
|
+
const resolvedLoc = resolve43(installLocation);
|
|
329379
329553
|
if (resolvedLoc !== cacheDir && !resolvedLoc.startsWith(cacheDir + sep24)) {
|
|
329380
329554
|
logForDebugging3(`fetchOfficialMarketplaceFromGcs: refusing path outside cache dir: ${installLocation}`, { level: "error" });
|
|
329381
329555
|
return null;
|
|
@@ -329509,7 +329683,7 @@ var init_ascendMarketplace = __esm(() => {
|
|
|
329509
329683
|
});
|
|
329510
329684
|
|
|
329511
329685
|
// src/tui/utils/plugins/orphanScanner.ts
|
|
329512
|
-
import { join as join117, resolve as
|
|
329686
|
+
import { join as join117, resolve as resolve44, sep as sep25 } from "path";
|
|
329513
329687
|
function normalizeRepoRef(ref) {
|
|
329514
329688
|
let u = ref.trim();
|
|
329515
329689
|
const ssh = u.match(/^git@([^:]+):(.+)$/);
|
|
@@ -329553,7 +329727,7 @@ async function readOrphanManifestName(dirPath) {
|
|
|
329553
329727
|
}
|
|
329554
329728
|
async function scanOrphanedMarketplaces() {
|
|
329555
329729
|
const fs = getFsImplementation2();
|
|
329556
|
-
const cacheDir =
|
|
329730
|
+
const cacheDir = resolve44(getMarketplacesCacheDir());
|
|
329557
329731
|
let entries;
|
|
329558
329732
|
try {
|
|
329559
329733
|
entries = await fs.readdir(cacheDir);
|
|
@@ -329561,8 +329735,8 @@ async function scanOrphanedMarketplaces() {
|
|
|
329561
329735
|
return [];
|
|
329562
329736
|
}
|
|
329563
329737
|
const config = await loadKnownMarketplacesConfigSafe();
|
|
329564
|
-
const registered = new Set(Object.values(config).map((e) =>
|
|
329565
|
-
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));
|
|
329566
329740
|
const orphans = [];
|
|
329567
329741
|
for (const entry of entries) {
|
|
329568
329742
|
if (!entry.isDirectory())
|
|
@@ -329600,7 +329774,7 @@ var init_orphanScanner = __esm(() => {
|
|
|
329600
329774
|
|
|
329601
329775
|
// src/tui/utils/plugins/marketplaceManager.ts
|
|
329602
329776
|
import { writeFile as writeFile28 } from "fs/promises";
|
|
329603
|
-
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";
|
|
329604
329778
|
function getKnownMarketplacesFile() {
|
|
329605
329779
|
return join118(getPluginsDirectory(), "known_marketplaces.json");
|
|
329606
329780
|
}
|
|
@@ -330100,6 +330274,18 @@ async function cacheMarketplaceFromGit(gitUrl, cachePath, ref, sparsePaths, onPr
|
|
|
330100
330274
|
logPluginFetch("marketplace_pull", gitUrl, pullResult.code === 0 ? "success" : "failure", performance.now() - pullStarted, pullResult.code === 0 ? undefined : classifyFetchError(pullResult.stderr));
|
|
330101
330275
|
if (pullResult.code === 0)
|
|
330102
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
|
+
}
|
|
330103
330289
|
logForDebugging3(`git pull failed, will re-clone: ${pullResult.stderr}`, {
|
|
330104
330290
|
level: "warn"
|
|
330105
330291
|
});
|
|
@@ -330386,14 +330572,14 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
330386
330572
|
break;
|
|
330387
330573
|
}
|
|
330388
330574
|
case "file": {
|
|
330389
|
-
const absPath =
|
|
330575
|
+
const absPath = resolve45(source.path);
|
|
330390
330576
|
marketplacePath = absPath;
|
|
330391
330577
|
temporaryCachePath = dirname62(dirname62(absPath));
|
|
330392
330578
|
cleanupNeeded = false;
|
|
330393
330579
|
break;
|
|
330394
330580
|
}
|
|
330395
330581
|
case "directory": {
|
|
330396
|
-
const absPath =
|
|
330582
|
+
const absPath = resolve45(source.path);
|
|
330397
330583
|
marketplacePath = findManifestInDir(absPath, "marketplace.json");
|
|
330398
330584
|
temporaryCachePath = absPath;
|
|
330399
330585
|
cleanupNeeded = false;
|
|
@@ -330425,8 +330611,8 @@ async function loadAndCacheMarketplace(source, onProgress) {
|
|
|
330425
330611
|
throw new Error(`Failed to parse marketplace file at ${marketplacePath}: ${errorMessage2(e)}`);
|
|
330426
330612
|
}
|
|
330427
330613
|
const finalCachePath = join118(cacheDir, marketplace.name);
|
|
330428
|
-
const resolvedFinal =
|
|
330429
|
-
const resolvedCacheDir =
|
|
330614
|
+
const resolvedFinal = resolve45(finalCachePath);
|
|
330615
|
+
const resolvedCacheDir = resolve45(cacheDir);
|
|
330430
330616
|
if (!resolvedFinal.startsWith(resolvedCacheDir + sep26)) {
|
|
330431
330617
|
throw new Error(`Marketplace name '${marketplace.name}' resolves to a path outside the cache directory`);
|
|
330432
330618
|
}
|
|
@@ -330475,7 +330661,7 @@ async function captureResolvedSha(source, cachePath) {
|
|
|
330475
330661
|
async function addMarketplaceSource(source, onProgress) {
|
|
330476
330662
|
let resolvedSource = source;
|
|
330477
330663
|
if (isLocalMarketplaceSource(source) && !isAbsolute31(source.path)) {
|
|
330478
|
-
resolvedSource = { ...source, path:
|
|
330664
|
+
resolvedSource = { ...source, path: resolve45(source.path) };
|
|
330479
330665
|
}
|
|
330480
330666
|
if (!isSourceAllowedByPolicy(resolvedSource)) {
|
|
330481
330667
|
if (isSourceInBlocklist(resolvedSource)) {
|
|
@@ -330524,9 +330710,9 @@ Tip: The shorthand "${resolvedSource.repo}" assumes github.com. ` + `For interna
|
|
|
330524
330710
|
}
|
|
330525
330711
|
logForDebugging3(`Marketplace '${marketplace.name}' exists with different source — overwriting`);
|
|
330526
330712
|
if (!isLocalMarketplaceSource(oldEntry.source)) {
|
|
330527
|
-
const cacheDir =
|
|
330528
|
-
const resolvedOld =
|
|
330529
|
-
const resolvedNew =
|
|
330713
|
+
const cacheDir = resolve45(getMarketplacesCacheDir());
|
|
330714
|
+
const resolvedOld = resolve45(oldEntry.installLocation);
|
|
330715
|
+
const resolvedNew = resolve45(cachePath);
|
|
330530
330716
|
if (resolvedOld === resolvedNew) {} else if (resolvedOld === cacheDir || resolvedOld.startsWith(cacheDir + sep26)) {
|
|
330531
330717
|
const fs = getFsImplementation2();
|
|
330532
330718
|
await fs.rm(oldEntry.installLocation, { recursive: true, force: true });
|
|
@@ -330548,7 +330734,7 @@ Tip: The shorthand "${resolvedSource.repo}" assumes github.com. ` + `For interna
|
|
|
330548
330734
|
}
|
|
330549
330735
|
async function adoptOrphanMarketplace(dirName, overrideName) {
|
|
330550
330736
|
const fs = getFsImplementation2();
|
|
330551
|
-
const cacheDir =
|
|
330737
|
+
const cacheDir = resolve45(getMarketplacesCacheDir());
|
|
330552
330738
|
const dirPath = join118(cacheDir, dirName);
|
|
330553
330739
|
if (!fs.existsSync(dirPath) || !fs.statSync(dirPath).isDirectory()) {
|
|
330554
330740
|
throw new Error(`No marketplace directory named '${dirName}' in ${cacheDir}. ` + `Run \`plugin marketplace list\` to see unregistered directories.`);
|
|
@@ -330578,7 +330764,7 @@ async function adoptOrphanMarketplace(dirName, overrideName) {
|
|
|
330578
330764
|
await updateKnownMarketplacesConfig((existing) => {
|
|
330579
330765
|
const prior = existing[name];
|
|
330580
330766
|
if (prior) {
|
|
330581
|
-
if (
|
|
330767
|
+
if (resolve45(prior.installLocation) === resolve45(dirPath)) {
|
|
330582
330768
|
return;
|
|
330583
330769
|
}
|
|
330584
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.`);
|
|
@@ -330809,8 +330995,8 @@ async function refreshMarketplace(name, onProgress, options) {
|
|
|
330809
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.`);
|
|
330810
330996
|
}
|
|
330811
330997
|
if (!isLocalMarketplaceSource(source)) {
|
|
330812
|
-
const cacheDir =
|
|
330813
|
-
const resolvedLoc =
|
|
330998
|
+
const cacheDir = resolve45(getMarketplacesCacheDir());
|
|
330999
|
+
const resolvedLoc = resolve45(installLocation);
|
|
330814
331000
|
if (resolvedLoc !== cacheDir && !resolvedLoc.startsWith(cacheDir + sep26)) {
|
|
330815
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.`);
|
|
330816
331002
|
}
|
|
@@ -331814,14 +332000,14 @@ var init_pluginVersioning = __esm(() => {
|
|
|
331814
332000
|
// src/tui/utils/plugins/pluginInstallationHelpers.ts
|
|
331815
332001
|
import { randomBytes as randomBytes16 } from "crypto";
|
|
331816
332002
|
import { rename as rename6, rm as rm8 } from "fs/promises";
|
|
331817
|
-
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";
|
|
331818
332004
|
function getCurrentTimestamp() {
|
|
331819
332005
|
return new Date().toISOString();
|
|
331820
332006
|
}
|
|
331821
332007
|
function validatePathWithinBase(basePath, relativePath) {
|
|
331822
|
-
const resolvedPath =
|
|
331823
|
-
const normalizedBase =
|
|
331824
|
-
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)) {
|
|
331825
332011
|
throw new Error(`Path traversal detected: "${relativePath}" would escape the base directory`);
|
|
331826
332012
|
}
|
|
331827
332013
|
return resolvedPath;
|
|
@@ -332055,14 +332241,14 @@ import {
|
|
|
332055
332241
|
readdir as readdir24,
|
|
332056
332242
|
readFile as readFile43,
|
|
332057
332243
|
readlink,
|
|
332058
|
-
realpath as
|
|
332244
|
+
realpath as realpath12,
|
|
332059
332245
|
rename as rename7,
|
|
332060
332246
|
rm as rm9,
|
|
332061
332247
|
rmdir,
|
|
332062
332248
|
stat as stat40,
|
|
332063
332249
|
symlink as symlink5
|
|
332064
332250
|
} from "fs/promises";
|
|
332065
|
-
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";
|
|
332066
332252
|
function getPluginCachePath() {
|
|
332067
332253
|
return join122(getPluginsDirectory(), "cache");
|
|
332068
332254
|
}
|
|
@@ -332119,14 +332305,14 @@ async function copyDir(src, dest) {
|
|
|
332119
332305
|
const linkTarget = await readlink(srcPath);
|
|
332120
332306
|
let resolvedTarget;
|
|
332121
332307
|
try {
|
|
332122
|
-
resolvedTarget = await
|
|
332308
|
+
resolvedTarget = await realpath12(srcPath);
|
|
332123
332309
|
} catch {
|
|
332124
332310
|
await symlink5(linkTarget, destPath);
|
|
332125
332311
|
continue;
|
|
332126
332312
|
}
|
|
332127
332313
|
let resolvedSrc;
|
|
332128
332314
|
try {
|
|
332129
|
-
resolvedSrc = await
|
|
332315
|
+
resolvedSrc = await realpath12(src);
|
|
332130
332316
|
} catch {
|
|
332131
332317
|
resolvedSrc = src;
|
|
332132
332318
|
}
|
|
@@ -332740,7 +332926,7 @@ async function createPluginFromPath(pluginPath, source, enabled, fallbackName, s
|
|
|
332740
332926
|
try {
|
|
332741
332927
|
mergedHooks = await loadPluginHooks2(standardHooksPath, manifest.name);
|
|
332742
332928
|
try {
|
|
332743
|
-
loadedHookPaths.add(await
|
|
332929
|
+
loadedHookPaths.add(await realpath12(standardHooksPath));
|
|
332744
332930
|
} catch {
|
|
332745
332931
|
loadedHookPaths.add(standardHooksPath);
|
|
332746
332932
|
}
|
|
@@ -332779,7 +332965,7 @@ async function createPluginFromPath(pluginPath, source, enabled, fallbackName, s
|
|
|
332779
332965
|
}
|
|
332780
332966
|
let normalizedPath;
|
|
332781
332967
|
try {
|
|
332782
|
-
normalizedPath = await
|
|
332968
|
+
normalizedPath = await realpath12(hookFilePath);
|
|
332783
332969
|
} catch {
|
|
332784
332970
|
normalizedPath = hookFilePath;
|
|
332785
332971
|
}
|
|
@@ -333416,7 +333602,7 @@ async function loadSessionOnlyPlugins(sessionPluginPaths) {
|
|
|
333416
333602
|
const errors = [];
|
|
333417
333603
|
for (const [index, pluginPath] of sessionPluginPaths.entries()) {
|
|
333418
333604
|
try {
|
|
333419
|
-
const resolvedPath =
|
|
333605
|
+
const resolvedPath = resolve47(pluginPath);
|
|
333420
333606
|
if (!await pathExists2(resolvedPath)) {
|
|
333421
333607
|
logForDebugging3(`Plugin path does not exist: ${resolvedPath}, skipping`, { level: "warn" });
|
|
333422
333608
|
errors.push({
|
|
@@ -338495,7 +338681,7 @@ __export(exports_permissionSetup, {
|
|
|
338495
338681
|
verifyAutoModeGateAccess: () => verifyAutoModeGateAccess
|
|
338496
338682
|
});
|
|
338497
338683
|
import { relative as relative23 } from "path";
|
|
338498
|
-
import { resolve as
|
|
338684
|
+
import { resolve as resolve48 } from "path";
|
|
338499
338685
|
function isDangerousBashPermission(toolName, ruleContent) {
|
|
338500
338686
|
if (toolName !== BASH_TOOL_NAME2) {
|
|
338501
338687
|
return false;
|
|
@@ -338767,7 +338953,7 @@ function isSymlinkTo2({
|
|
|
338767
338953
|
originalCwd
|
|
338768
338954
|
}) {
|
|
338769
338955
|
const { resolvedPath: resolvedProcessPwd, isSymlink: isProcessPwdSymlink } = safeResolvePath3(getFsImplementation2(), processPwd);
|
|
338770
|
-
return isProcessPwdSymlink ? resolvedProcessPwd ===
|
|
338956
|
+
return isProcessPwdSymlink ? resolvedProcessPwd === resolve48(originalCwd) : false;
|
|
338771
338957
|
}
|
|
338772
338958
|
function initialPermissionModeFromCLI2({
|
|
338773
338959
|
permissionModeCli,
|
|
@@ -346388,6 +346574,65 @@ var init_color3 = __esm(() => {
|
|
|
346388
346574
|
color_default = color2;
|
|
346389
346575
|
});
|
|
346390
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
|
+
|
|
346391
346636
|
// src/tui/commands/commit.ts
|
|
346392
346637
|
function getPromptContent() {
|
|
346393
346638
|
const { commit: commitAttribution } = getAttributionTexts();
|
|
@@ -346473,7 +346718,7 @@ var init_commit = __esm(() => {
|
|
|
346473
346718
|
// src/tui/commands/copy/copy.tsx
|
|
346474
346719
|
var exports_copy = {};
|
|
346475
346720
|
__export(exports_copy, {
|
|
346476
|
-
call: () =>
|
|
346721
|
+
call: () => call8,
|
|
346477
346722
|
collectRecentAssistantTexts: () => collectRecentAssistantTexts,
|
|
346478
346723
|
fileExtension: () => fileExtension2
|
|
346479
346724
|
});
|
|
@@ -346801,7 +347046,7 @@ function _temp46(block, index) {
|
|
|
346801
347046
|
description: [block.lang, blockLines > 1 ? `${blockLines} lines` : undefined].filter(Boolean).join(", ") || undefined
|
|
346802
347047
|
};
|
|
346803
347048
|
}
|
|
346804
|
-
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) => {
|
|
346805
347050
|
const texts = collectRecentAssistantTexts(context.messages);
|
|
346806
347051
|
if (texts.length === 0) {
|
|
346807
347052
|
onDone("No assistant message to copy");
|
|
@@ -347442,7 +347687,7 @@ var init_CustomSelect = __esm(() => {
|
|
|
347442
347687
|
// src/tui/commands/autocompact/autocompact.tsx
|
|
347443
347688
|
var exports_autocompact = {};
|
|
347444
347689
|
__export(exports_autocompact, {
|
|
347445
|
-
call: () =>
|
|
347690
|
+
call: () => call9
|
|
347446
347691
|
});
|
|
347447
347692
|
function currentToOptionValue(setting) {
|
|
347448
347693
|
if (!setting || setting.kind === "auto")
|
|
@@ -347586,7 +347831,7 @@ function AutoCompactCommand({ onDone }) {
|
|
|
347586
347831
|
]
|
|
347587
347832
|
}, undefined, true, undefined, this);
|
|
347588
347833
|
}
|
|
347589
|
-
var React41, jsx_dev_runtime140, PRESET_TIERS,
|
|
347834
|
+
var React41, jsx_dev_runtime140, PRESET_TIERS, call9 = async (onDone, _context, args) => {
|
|
347590
347835
|
const raw = (args ?? "").trim();
|
|
347591
347836
|
if (raw === "") {
|
|
347592
347837
|
return /* @__PURE__ */ jsx_dev_runtime140.jsxDEV(AutoCompactCommand, {
|
|
@@ -347711,7 +347956,7 @@ var init_sessionMemoryUtils = __esm(() => {
|
|
|
347711
347956
|
// src/tui/commands/compact/compact.ts
|
|
347712
347957
|
var exports_compact = {};
|
|
347713
347958
|
__export(exports_compact, {
|
|
347714
|
-
call: () =>
|
|
347959
|
+
call: () => call10
|
|
347715
347960
|
});
|
|
347716
347961
|
async function compactViaReactive(messages, context, customInstructions, reactive) {
|
|
347717
347962
|
context.onCompactProgress?.({
|
|
@@ -347802,7 +348047,7 @@ async function getCacheSharingParams(context, forkContextMessages) {
|
|
|
347802
348047
|
forkContextMessages
|
|
347803
348048
|
};
|
|
347804
348049
|
}
|
|
347805
|
-
var reactiveCompact,
|
|
348050
|
+
var reactiveCompact, call10 = async (args, context) => {
|
|
347806
348051
|
const { abortController } = context;
|
|
347807
348052
|
let { messages } = context;
|
|
347808
348053
|
messages = getMessagesAfterCompactBoundary(messages);
|
|
@@ -348886,7 +349131,7 @@ var init_packageManagers = __esm(() => {
|
|
|
348886
349131
|
});
|
|
348887
349132
|
|
|
348888
349133
|
// src/tui/utils/doctorDiagnostic.ts
|
|
348889
|
-
import { readFile as readFile49, realpath as
|
|
349134
|
+
import { readFile as readFile49, realpath as realpath13 } from "fs/promises";
|
|
348890
349135
|
import { homedir as homedir33 } from "os";
|
|
348891
349136
|
import { delimiter as delimiter2, join as join134, posix as posix8, win32 as win322 } from "path";
|
|
348892
349137
|
function getNormalizedPaths() {
|
|
@@ -348942,7 +349187,7 @@ async function getInstallationPath() {
|
|
|
348942
349187
|
}
|
|
348943
349188
|
if (isInBundledMode2()) {
|
|
348944
349189
|
try {
|
|
348945
|
-
return await
|
|
349190
|
+
return await realpath13(process.execPath);
|
|
348946
349191
|
} catch {}
|
|
348947
349192
|
try {
|
|
348948
349193
|
const path = await which("atlas");
|
|
@@ -349001,7 +349246,7 @@ async function detectMultipleInstallations() {
|
|
|
349001
349246
|
if (globalBinExists) {
|
|
349002
349247
|
let isCurrentHomebrewInstallation = false;
|
|
349003
349248
|
try {
|
|
349004
|
-
const realPath = await
|
|
349249
|
+
const realPath = await realpath13(globalBinPath);
|
|
349005
349250
|
if (realPath.includes("/Caskroom/")) {
|
|
349006
349251
|
isCurrentHomebrewInstallation = detectHomebrew();
|
|
349007
349252
|
}
|
|
@@ -349545,7 +349790,7 @@ import {
|
|
|
349545
349790
|
mkdir as mkdir40,
|
|
349546
349791
|
readdir as readdir26,
|
|
349547
349792
|
readlink as readlink2,
|
|
349548
|
-
realpath as
|
|
349793
|
+
realpath as realpath14,
|
|
349549
349794
|
rename as rename8,
|
|
349550
349795
|
rm as rm10,
|
|
349551
349796
|
rmdir as rmdir2,
|
|
@@ -349555,7 +349800,7 @@ import {
|
|
|
349555
349800
|
writeFile as writeFile36
|
|
349556
349801
|
} from "fs/promises";
|
|
349557
349802
|
import { homedir as homedir34 } from "os";
|
|
349558
|
-
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";
|
|
349559
349804
|
function getPlatform4() {
|
|
349560
349805
|
const os = env5.platform;
|
|
349561
349806
|
const arch = process.arch === "x64" ? "x64" : process.arch === "arm64" ? "arm64" : null;
|
|
@@ -349903,8 +350148,8 @@ async function updateSymlink(symlinkPath, targetPath) {
|
|
|
349903
350148
|
if (symlinkExists) {
|
|
349904
350149
|
try {
|
|
349905
350150
|
const currentTarget = await readlink2(symlinkPath);
|
|
349906
|
-
const resolvedCurrentTarget =
|
|
349907
|
-
const resolvedTargetPath =
|
|
350151
|
+
const resolvedCurrentTarget = resolve49(dirname69(symlinkPath), currentTarget);
|
|
350152
|
+
const resolvedTargetPath = resolve49(targetPath);
|
|
349908
350153
|
if (resolvedCurrentTarget === resolvedTargetPath) {
|
|
349909
350154
|
return false;
|
|
349910
350155
|
}
|
|
@@ -349944,7 +350189,7 @@ async function checkInstall(force = false) {
|
|
|
349944
350189
|
const dirs = getBaseDirectories();
|
|
349945
350190
|
const messages = [];
|
|
349946
350191
|
const localBinDir = dirname69(dirs.executable);
|
|
349947
|
-
const resolvedLocalBinPath =
|
|
350192
|
+
const resolvedLocalBinPath = resolve49(localBinDir);
|
|
349948
350193
|
const platform = getPlatform4();
|
|
349949
350194
|
const isWindows = platform.startsWith("win32");
|
|
349950
350195
|
try {
|
|
@@ -349967,7 +350212,7 @@ async function checkInstall(force = false) {
|
|
|
349967
350212
|
} else {
|
|
349968
350213
|
try {
|
|
349969
350214
|
const target = await readlink2(dirs.executable);
|
|
349970
|
-
const absoluteTarget =
|
|
350215
|
+
const absoluteTarget = resolve49(dirname69(dirs.executable), target);
|
|
349971
350216
|
if (!await isPossibleClaudeBinary(absoluteTarget)) {
|
|
349972
350217
|
messages.push({
|
|
349973
350218
|
message: `AtlasCode symlink points to missing or invalid binary: ${target}`,
|
|
@@ -349995,7 +350240,7 @@ async function checkInstall(force = false) {
|
|
|
349995
350240
|
}
|
|
349996
350241
|
const isInCurrentPath = (process.env.PATH || "").split(delimiter3).some((entry) => {
|
|
349997
350242
|
try {
|
|
349998
|
-
const resolvedEntry =
|
|
350243
|
+
const resolvedEntry = resolve49(entry);
|
|
349999
350244
|
if (isWindows) {
|
|
350000
350245
|
return resolvedEntry.toLowerCase() === resolvedLocalBinPath.toLowerCase();
|
|
350001
350246
|
}
|
|
@@ -350074,7 +350319,7 @@ async function installLatestImpl(channelOrVersion, forceReinstall = false) {
|
|
|
350074
350319
|
async function getVersionFromSymlink(symlinkPath) {
|
|
350075
350320
|
try {
|
|
350076
350321
|
const target = await readlink2(symlinkPath);
|
|
350077
|
-
const absoluteTarget =
|
|
350322
|
+
const absoluteTarget = resolve49(dirname69(symlinkPath), target);
|
|
350078
350323
|
if (await isPossibleClaudeBinary(absoluteTarget)) {
|
|
350079
350324
|
return absoluteTarget;
|
|
350080
350325
|
}
|
|
@@ -350090,7 +350335,7 @@ async function lockCurrentVersion() {
|
|
|
350090
350335
|
if (!process.execPath.includes(dirs.versions)) {
|
|
350091
350336
|
return;
|
|
350092
350337
|
}
|
|
350093
|
-
const versionPath =
|
|
350338
|
+
const versionPath = resolve49(process.execPath);
|
|
350094
350339
|
try {
|
|
350095
350340
|
const lockfilePath = getLockFilePathFromVersionPath(dirs, versionPath);
|
|
350096
350341
|
await mkdir40(dirs.locks, { recursive: true });
|
|
@@ -350236,7 +350481,7 @@ async function cleanupOldVersions() {
|
|
|
350236
350481
|
versionFiles.push({
|
|
350237
350482
|
name: entry,
|
|
350238
350483
|
path: entryPath,
|
|
350239
|
-
resolvedPath:
|
|
350484
|
+
resolvedPath: resolve49(entryPath),
|
|
350240
350485
|
mtime: stats.mtime
|
|
350241
350486
|
});
|
|
350242
350487
|
} catch {}
|
|
@@ -350251,7 +350496,7 @@ async function cleanupOldVersions() {
|
|
|
350251
350496
|
const currentBinaryPath = process.execPath;
|
|
350252
350497
|
const protectedVersions = new Set;
|
|
350253
350498
|
if (currentBinaryPath && currentBinaryPath.includes(dirs.versions)) {
|
|
350254
|
-
protectedVersions.add(
|
|
350499
|
+
protectedVersions.add(resolve49(currentBinaryPath));
|
|
350255
350500
|
}
|
|
350256
350501
|
const currentSymlinkVersion = await getVersionFromSymlink(dirs.executable);
|
|
350257
350502
|
if (currentSymlinkVersion) {
|
|
@@ -350313,7 +350558,7 @@ async function isNpmSymlink(executablePath) {
|
|
|
350313
350558
|
let targetPath = executablePath;
|
|
350314
350559
|
const stats = await lstat6(executablePath);
|
|
350315
350560
|
if (stats.isSymbolicLink()) {
|
|
350316
|
-
targetPath = await
|
|
350561
|
+
targetPath = await realpath14(executablePath);
|
|
350317
350562
|
}
|
|
350318
350563
|
return targetPath.endsWith(".js") || targetPath.includes("node_modules");
|
|
350319
350564
|
}
|
|
@@ -354893,9 +355138,9 @@ var init_Settings = __esm(() => {
|
|
|
354893
355138
|
// src/tui/commands/config/config.tsx
|
|
354894
355139
|
var exports_config = {};
|
|
354895
355140
|
__export(exports_config, {
|
|
354896
|
-
call: () =>
|
|
355141
|
+
call: () => call11
|
|
354897
355142
|
});
|
|
354898
|
-
var jsx_dev_runtime153,
|
|
355143
|
+
var jsx_dev_runtime153, call11 = async (onDone, context) => {
|
|
354899
355144
|
return /* @__PURE__ */ jsx_dev_runtime153.jsxDEV(Settings, {
|
|
354900
355145
|
onClose: onDone,
|
|
354901
355146
|
context,
|
|
@@ -356131,7 +356376,7 @@ var projectView = () => ({});
|
|
|
356131
356376
|
// src/tui/commands/context/context.tsx
|
|
356132
356377
|
var exports_context = {};
|
|
356133
356378
|
__export(exports_context, {
|
|
356134
|
-
call: () =>
|
|
356379
|
+
call: () => call12
|
|
356135
356380
|
});
|
|
356136
356381
|
function toApiView(messages) {
|
|
356137
356382
|
let view = getMessagesAfterCompactBoundary(messages);
|
|
@@ -356141,7 +356386,7 @@ function toApiView(messages) {
|
|
|
356141
356386
|
}
|
|
356142
356387
|
return view;
|
|
356143
356388
|
}
|
|
356144
|
-
async function
|
|
356389
|
+
async function call12(onDone, context) {
|
|
356145
356390
|
const {
|
|
356146
356391
|
messages,
|
|
356147
356392
|
getAppState,
|
|
@@ -356177,7 +356422,7 @@ var init_context3 = __esm(() => {
|
|
|
356177
356422
|
// src/tui/commands/context/context-noninteractive.ts
|
|
356178
356423
|
var exports_context_noninteractive = {};
|
|
356179
356424
|
__export(exports_context_noninteractive, {
|
|
356180
|
-
call: () =>
|
|
356425
|
+
call: () => call13,
|
|
356181
356426
|
collectContextData: () => collectContextData
|
|
356182
356427
|
});
|
|
356183
356428
|
async function collectContextData(context) {
|
|
@@ -356201,7 +356446,7 @@ async function collectContextData(context) {
|
|
|
356201
356446
|
const appState = getAppState();
|
|
356202
356447
|
return analyzeContextUsage(compactedMessages, mainLoopModel, async () => appState.toolPermissionContext, tools, agentDefinitions, undefined, { options: { customSystemPrompt, appendSystemPrompt } }, undefined, apiView);
|
|
356203
356448
|
}
|
|
356204
|
-
async function
|
|
356449
|
+
async function call13(_args, context) {
|
|
356205
356450
|
const data = await collectContextData(context);
|
|
356206
356451
|
return {
|
|
356207
356452
|
type: "text",
|
|
@@ -356496,9 +356741,9 @@ var init_context4 = __esm(() => {
|
|
|
356496
356741
|
// src/tui/commands/cost/cost.ts
|
|
356497
356742
|
var exports_cost = {};
|
|
356498
356743
|
__export(exports_cost, {
|
|
356499
|
-
call: () =>
|
|
356744
|
+
call: () => call14
|
|
356500
356745
|
});
|
|
356501
|
-
var
|
|
356746
|
+
var call14 = async () => {
|
|
356502
356747
|
return { type: "text", value: formatTotalCost() };
|
|
356503
356748
|
};
|
|
356504
356749
|
var init_cost = __esm(() => {
|
|
@@ -356721,7 +356966,7 @@ var init_useTurnDiffs = __esm(() => {
|
|
|
356721
356966
|
});
|
|
356722
356967
|
|
|
356723
356968
|
// src/tui/components/diff/DiffDetailView.tsx
|
|
356724
|
-
import { resolve as
|
|
356969
|
+
import { resolve as resolve50 } from "path";
|
|
356725
356970
|
function DiffDetailView(t0) {
|
|
356726
356971
|
const $ = import_compiler_runtime130.c(53);
|
|
356727
356972
|
const {
|
|
@@ -356754,7 +356999,7 @@ function DiffDetailView(t0) {
|
|
|
356754
356999
|
let content;
|
|
356755
357000
|
let t2;
|
|
356756
357001
|
if ($[1] !== filePath) {
|
|
356757
|
-
const fullPath =
|
|
357002
|
+
const fullPath = resolve50(getCwd(), filePath);
|
|
356758
357003
|
content = readFileSafe2(fullPath);
|
|
356759
357004
|
t2 = content?.split(`
|
|
356760
357005
|
`)[0] ?? null;
|
|
@@ -357974,9 +358219,9 @@ var init_DiffDialog = __esm(() => {
|
|
|
357974
358219
|
// src/tui/commands/diff/diff.tsx
|
|
357975
358220
|
var exports_diff = {};
|
|
357976
358221
|
__export(exports_diff, {
|
|
357977
|
-
call: () =>
|
|
358222
|
+
call: () => call15
|
|
357978
358223
|
});
|
|
357979
|
-
var jsx_dev_runtime162,
|
|
358224
|
+
var jsx_dev_runtime162, call15 = async (onDone, context) => {
|
|
357980
358225
|
await Promise.resolve().then(() => init_DiffDialog());
|
|
357981
358226
|
return /* @__PURE__ */ jsx_dev_runtime162.jsxDEV(DiffDialog, {
|
|
357982
358227
|
messages: context.messages,
|
|
@@ -360174,9 +360419,9 @@ var init_Doctor = __esm(() => {
|
|
|
360174
360419
|
// src/tui/commands/doctor/doctor.tsx
|
|
360175
360420
|
var exports_doctor = {};
|
|
360176
360421
|
__export(exports_doctor, {
|
|
360177
|
-
call: () =>
|
|
360422
|
+
call: () => call16
|
|
360178
360423
|
});
|
|
360179
|
-
var jsx_dev_runtime169,
|
|
360424
|
+
var jsx_dev_runtime169, call16 = (onDone, _context, _args) => {
|
|
360180
360425
|
return Promise.resolve(/* @__PURE__ */ jsx_dev_runtime169.jsxDEV(Doctor, {
|
|
360181
360426
|
onDone
|
|
360182
360427
|
}, undefined, false, undefined, this));
|
|
@@ -360949,7 +361194,7 @@ var init_promptEditor = __esm(() => {
|
|
|
360949
361194
|
// src/tui/commands/memory/memory.tsx
|
|
360950
361195
|
var exports_memory = {};
|
|
360951
361196
|
__export(exports_memory, {
|
|
360952
|
-
call: () =>
|
|
361197
|
+
call: () => call17
|
|
360953
361198
|
});
|
|
360954
361199
|
import { mkdir as mkdir42, writeFile as writeFile37 } from "fs/promises";
|
|
360955
361200
|
function MemoryCommand({
|
|
@@ -361029,7 +361274,7 @@ ${editorHint}`, {
|
|
|
361029
361274
|
}, undefined, true, undefined, this)
|
|
361030
361275
|
}, undefined, false, undefined, this);
|
|
361031
361276
|
}
|
|
361032
|
-
var React48, jsx_dev_runtime171,
|
|
361277
|
+
var React48, jsx_dev_runtime171, call17 = async (onDone) => {
|
|
361033
361278
|
clearMemoryFileCaches();
|
|
361034
361279
|
await getMemoryFiles();
|
|
361035
361280
|
return /* @__PURE__ */ jsx_dev_runtime171.jsxDEV(MemoryCommand, {
|
|
@@ -361985,9 +362230,9 @@ var init_HelpV2 = __esm(() => {
|
|
|
361985
362230
|
// src/tui/commands/help/help.tsx
|
|
361986
362231
|
var exports_help = {};
|
|
361987
362232
|
__export(exports_help, {
|
|
361988
|
-
call: () =>
|
|
362233
|
+
call: () => call18
|
|
361989
362234
|
});
|
|
361990
|
-
var jsx_dev_runtime176,
|
|
362235
|
+
var jsx_dev_runtime176, call18 = async (onDone, {
|
|
361991
362236
|
options: {
|
|
361992
362237
|
commands
|
|
361993
362238
|
}
|
|
@@ -362194,7 +362439,7 @@ var init_IdeAutoConnectDialog = __esm(() => {
|
|
|
362194
362439
|
// src/tui/commands/ide/ide.tsx
|
|
362195
362440
|
var exports_ide = {};
|
|
362196
362441
|
__export(exports_ide, {
|
|
362197
|
-
call: () =>
|
|
362442
|
+
call: () => call19,
|
|
362198
362443
|
formatWorkspaceFolders: () => formatWorkspaceFolders
|
|
362199
362444
|
});
|
|
362200
362445
|
import * as path22 from "path";
|
|
@@ -362673,7 +362918,7 @@ function InstallOnMount(t0) {
|
|
|
362673
362918
|
import_react99.useEffect(t1, t2);
|
|
362674
362919
|
return null;
|
|
362675
362920
|
}
|
|
362676
|
-
async function
|
|
362921
|
+
async function call19(onDone, context, args) {
|
|
362677
362922
|
const {
|
|
362678
362923
|
options: {
|
|
362679
362924
|
dynamicMcpConfig
|
|
@@ -363453,11 +363698,11 @@ var init_template2 = __esm(() => {
|
|
|
363453
363698
|
// src/tui/commands/keybindings/keybindings.ts
|
|
363454
363699
|
var exports_keybindings = {};
|
|
363455
363700
|
__export(exports_keybindings, {
|
|
363456
|
-
call: () =>
|
|
363701
|
+
call: () => call20
|
|
363457
363702
|
});
|
|
363458
363703
|
import { mkdir as mkdir43, writeFile as writeFile38 } from "fs/promises";
|
|
363459
363704
|
import { dirname as dirname70 } from "path";
|
|
363460
|
-
async function
|
|
363705
|
+
async function call20() {
|
|
363461
363706
|
if (!isKeybindingCustomizationEnabled()) {
|
|
363462
363707
|
return {
|
|
363463
363708
|
type: "text",
|
|
@@ -363746,9 +363991,9 @@ var init_user = __esm(() => {
|
|
|
363746
363991
|
var exports_login = {};
|
|
363747
363992
|
__export(exports_login, {
|
|
363748
363993
|
Login: () => Login,
|
|
363749
|
-
call: () =>
|
|
363994
|
+
call: () => call21
|
|
363750
363995
|
});
|
|
363751
|
-
async function
|
|
363996
|
+
async function call21(onDone, context) {
|
|
363752
363997
|
return /* @__PURE__ */ jsx_dev_runtime180.jsxDEV(Login, {
|
|
363753
363998
|
onDone: async (success) => {
|
|
363754
363999
|
context.onChangeAPIKey();
|
|
@@ -363870,7 +364115,7 @@ var init_login2 = __esm(() => {
|
|
|
363870
364115
|
// src/tui/commands/logout/logout.tsx
|
|
363871
364116
|
var exports_logout = {};
|
|
363872
364117
|
__export(exports_logout, {
|
|
363873
|
-
call: () =>
|
|
364118
|
+
call: () => call22,
|
|
363874
364119
|
clearAuthRelatedCaches: () => clearAuthRelatedCaches,
|
|
363875
364120
|
performLogout: () => performLogout
|
|
363876
364121
|
});
|
|
@@ -363907,7 +364152,7 @@ async function clearAuthRelatedCaches() {
|
|
|
363907
364152
|
resetUserCache();
|
|
363908
364153
|
refreshGrowthBookAfterAuthChange();
|
|
363909
364154
|
}
|
|
363910
|
-
async function
|
|
364155
|
+
async function call22() {
|
|
363911
364156
|
await performLogout({
|
|
363912
364157
|
clearOnboarding: true
|
|
363913
364158
|
});
|
|
@@ -370079,7 +370324,7 @@ var init_mcp5 = __esm(() => {
|
|
|
370079
370324
|
// src/tui/commands/mcp/mcp.tsx
|
|
370080
370325
|
var exports_mcp = {};
|
|
370081
370326
|
__export(exports_mcp, {
|
|
370082
|
-
call: () =>
|
|
370327
|
+
call: () => call23
|
|
370083
370328
|
});
|
|
370084
370329
|
function MCPToggle(t0) {
|
|
370085
370330
|
const $ = import_compiler_runtime161.c(7);
|
|
@@ -370132,7 +370377,7 @@ function _temp235(c) {
|
|
|
370132
370377
|
function _temp89(s) {
|
|
370133
370378
|
return s.mcp.clients;
|
|
370134
370379
|
}
|
|
370135
|
-
async function
|
|
370380
|
+
async function call23(onDone, _context, args) {
|
|
370136
370381
|
if (args) {
|
|
370137
370382
|
const parts = args.trim().split(/\s+/);
|
|
370138
370383
|
if (parts[0] === "no-redirect") {
|
|
@@ -370338,7 +370583,7 @@ var init_releaseNotes = __esm(() => {
|
|
|
370338
370583
|
// src/tui/commands/release-notes/release-notes.ts
|
|
370339
370584
|
var exports_release_notes = {};
|
|
370340
370585
|
__export(exports_release_notes, {
|
|
370341
|
-
call: () =>
|
|
370586
|
+
call: () => call24
|
|
370342
370587
|
});
|
|
370343
370588
|
function formatReleaseNotes(notes) {
|
|
370344
370589
|
return notes.map(([version, notes]) => {
|
|
@@ -370351,7 +370596,7 @@ ${bulletPoints}`;
|
|
|
370351
370596
|
|
|
370352
370597
|
`);
|
|
370353
370598
|
}
|
|
370354
|
-
async function
|
|
370599
|
+
async function call24() {
|
|
370355
370600
|
let freshNotes = [];
|
|
370356
370601
|
try {
|
|
370357
370602
|
const timeoutPromise = new Promise((_, reject) => {
|
|
@@ -370542,9 +370787,9 @@ var init_generateSessionName = __esm(() => {
|
|
|
370542
370787
|
// src/tui/commands/rename/rename.ts
|
|
370543
370788
|
var exports_rename = {};
|
|
370544
370789
|
__export(exports_rename, {
|
|
370545
|
-
call: () =>
|
|
370790
|
+
call: () => call25
|
|
370546
370791
|
});
|
|
370547
|
-
async function
|
|
370792
|
+
async function call25(onDone, context, args) {
|
|
370548
370793
|
if (isTeammate2()) {
|
|
370549
370794
|
onDone("Cannot rename: This session is a swarm teammate. Teammate names are set by the team leader.", { display: "system" });
|
|
370550
370795
|
return null;
|
|
@@ -378511,7 +378756,7 @@ var init_crossProjectResume = __esm(() => {
|
|
|
378511
378756
|
// src/tui/commands/resume/resume.tsx
|
|
378512
378757
|
var exports_resume = {};
|
|
378513
378758
|
__export(exports_resume, {
|
|
378514
|
-
call: () =>
|
|
378759
|
+
call: () => call26,
|
|
378515
378760
|
filterResumableSessions: () => filterResumableSessions
|
|
378516
378761
|
});
|
|
378517
378762
|
function resumeHelpMessage(result) {
|
|
@@ -378697,7 +378942,7 @@ function ResumeCommand({
|
|
|
378697
378942
|
function filterResumableSessions(logs, currentSessionId) {
|
|
378698
378943
|
return logs.filter((l) => !l.isSidechain && getSessionIdFromLog(l) !== currentSessionId);
|
|
378699
378944
|
}
|
|
378700
|
-
var import_compiler_runtime179, React69, jsx_dev_runtime221,
|
|
378945
|
+
var import_compiler_runtime179, React69, jsx_dev_runtime221, call26 = async (onDone, context, args) => {
|
|
378701
378946
|
const onResume = async (sessionId, log, entrypoint) => {
|
|
378702
378947
|
try {
|
|
378703
378948
|
await context.resume?.(sessionId, log, entrypoint);
|
|
@@ -383095,7 +383340,7 @@ var init_server = __esm(() => {
|
|
|
383095
383340
|
// src/tui/commands/session/session.tsx
|
|
383096
383341
|
var exports_session = {};
|
|
383097
383342
|
__export(exports_session, {
|
|
383098
|
-
call: () =>
|
|
383343
|
+
call: () => call27
|
|
383099
383344
|
});
|
|
383100
383345
|
function SessionInfo(t0) {
|
|
383101
383346
|
const $ = import_compiler_runtime180.c(19);
|
|
@@ -383285,7 +383530,7 @@ function _temp241(e) {
|
|
|
383285
383530
|
function _temp105(s) {
|
|
383286
383531
|
return s.remoteSessionUrl;
|
|
383287
383532
|
}
|
|
383288
|
-
var import_compiler_runtime180, import_react131, jsx_dev_runtime222,
|
|
383533
|
+
var import_compiler_runtime180, import_react131, jsx_dev_runtime222, call27 = async (onDone) => {
|
|
383289
383534
|
return /* @__PURE__ */ jsx_dev_runtime222.jsxDEV(SessionInfo, {
|
|
383290
383535
|
onDone
|
|
383291
383536
|
}, undefined, false, undefined, this);
|
|
@@ -383641,9 +383886,9 @@ var init_SkillsMenu = __esm(() => {
|
|
|
383641
383886
|
// src/tui/commands/skills/skills.tsx
|
|
383642
383887
|
var exports_skills = {};
|
|
383643
383888
|
__export(exports_skills, {
|
|
383644
|
-
call: () =>
|
|
383889
|
+
call: () => call28
|
|
383645
383890
|
});
|
|
383646
|
-
async function
|
|
383891
|
+
async function call28(onDone, context) {
|
|
383647
383892
|
return /* @__PURE__ */ jsx_dev_runtime224.jsxDEV(SkillsMenu, {
|
|
383648
383893
|
onExit: onDone,
|
|
383649
383894
|
commands: context.options.commands
|
|
@@ -383670,9 +383915,9 @@ var init_skills3 = __esm(() => {
|
|
|
383670
383915
|
// src/tui/commands/status/status.tsx
|
|
383671
383916
|
var exports_status = {};
|
|
383672
383917
|
__export(exports_status, {
|
|
383673
|
-
call: () =>
|
|
383918
|
+
call: () => call29
|
|
383674
383919
|
});
|
|
383675
|
-
async function
|
|
383920
|
+
async function call29(onDone, context) {
|
|
383676
383921
|
return /* @__PURE__ */ jsx_dev_runtime225.jsxDEV(Settings, {
|
|
383677
383922
|
onClose: onDone,
|
|
383678
383923
|
context,
|
|
@@ -386868,9 +387113,9 @@ var init_BackgroundTasksDialog = __esm(() => {
|
|
|
386868
387113
|
// src/tui/commands/tasks/tasks.tsx
|
|
386869
387114
|
var exports_tasks = {};
|
|
386870
387115
|
__export(exports_tasks, {
|
|
386871
|
-
call: () =>
|
|
387116
|
+
call: () => call30
|
|
386872
387117
|
});
|
|
386873
|
-
async function
|
|
387118
|
+
async function call30(onDone, context) {
|
|
386874
387119
|
return /* @__PURE__ */ jsx_dev_runtime234.jsxDEV(BackgroundTasksDialog, {
|
|
386875
387120
|
toolUseContext: context,
|
|
386876
387121
|
onDone
|
|
@@ -387317,9 +387562,9 @@ var init_FileTaskDialog = __esm(() => {
|
|
|
387317
387562
|
// src/tui/commands/tasklist/tasklist.tsx
|
|
387318
387563
|
var exports_tasklist = {};
|
|
387319
387564
|
__export(exports_tasklist, {
|
|
387320
|
-
call: () =>
|
|
387565
|
+
call: () => call31
|
|
387321
387566
|
});
|
|
387322
|
-
async function
|
|
387567
|
+
async function call31(onDone, _context) {
|
|
387323
387568
|
return /* @__PURE__ */ jsx_dev_runtime236.jsxDEV(FileTaskDialog, {
|
|
387324
387569
|
onDone
|
|
387325
387570
|
}, undefined, false, undefined, this);
|
|
@@ -387366,9 +387611,9 @@ var init_terminalSetup2 = __esm(() => {
|
|
|
387366
387611
|
// src/tui/commands/usage/usage.tsx
|
|
387367
387612
|
var exports_usage2 = {};
|
|
387368
387613
|
__export(exports_usage2, {
|
|
387369
|
-
call: () =>
|
|
387614
|
+
call: () => call32
|
|
387370
387615
|
});
|
|
387371
|
-
var jsx_dev_runtime237,
|
|
387616
|
+
var jsx_dev_runtime237, call32 = async (onDone, context) => {
|
|
387372
387617
|
return /* @__PURE__ */ jsx_dev_runtime237.jsxDEV(Settings, {
|
|
387373
387618
|
onClose: onDone,
|
|
387374
387619
|
context,
|
|
@@ -387395,7 +387640,7 @@ var init_usage4 = __esm(() => {
|
|
|
387395
387640
|
// src/tui/commands/theme/theme.tsx
|
|
387396
387641
|
var exports_theme = {};
|
|
387397
387642
|
__export(exports_theme, {
|
|
387398
|
-
call: () =>
|
|
387643
|
+
call: () => call33
|
|
387399
387644
|
});
|
|
387400
387645
|
function ThemePickerCommand(t0) {
|
|
387401
387646
|
const $ = import_compiler_runtime189.c(8);
|
|
@@ -387445,7 +387690,7 @@ function ThemePickerCommand(t0) {
|
|
|
387445
387690
|
}
|
|
387446
387691
|
return t3;
|
|
387447
387692
|
}
|
|
387448
|
-
var import_compiler_runtime189, jsx_dev_runtime238,
|
|
387693
|
+
var import_compiler_runtime189, jsx_dev_runtime238, call33 = async (onDone, _context) => {
|
|
387449
387694
|
return /* @__PURE__ */ jsx_dev_runtime238.jsxDEV(ThemePickerCommand, {
|
|
387450
387695
|
onDone
|
|
387451
387696
|
}, undefined, false, undefined, this);
|
|
@@ -387473,9 +387718,9 @@ var init_theme3 = __esm(() => {
|
|
|
387473
387718
|
// src/tui/commands/vim/vim.ts
|
|
387474
387719
|
var exports_vim = {};
|
|
387475
387720
|
__export(exports_vim, {
|
|
387476
|
-
call: () =>
|
|
387721
|
+
call: () => call34
|
|
387477
387722
|
});
|
|
387478
|
-
var
|
|
387723
|
+
var call34 = async () => {
|
|
387479
387724
|
const config = getGlobalConfig();
|
|
387480
387725
|
let currentMode = config.editorMode || "normal";
|
|
387481
387726
|
if (currentMode === "emacs") {
|
|
@@ -388187,7 +388432,7 @@ var init_pluginOperations = __esm(() => {
|
|
|
388187
388432
|
// src/tui/commands/thinkback/thinkback.tsx
|
|
388188
388433
|
var exports_thinkback = {};
|
|
388189
388434
|
__export(exports_thinkback, {
|
|
388190
|
-
call: () =>
|
|
388435
|
+
call: () => call35,
|
|
388191
388436
|
playAnimation: () => playAnimation
|
|
388192
388437
|
});
|
|
388193
388438
|
import { readFile as readFile51 } from "fs/promises";
|
|
@@ -388725,7 +388970,7 @@ function ThinkbackFlow(t0) {
|
|
|
388725
388970
|
}
|
|
388726
388971
|
return t8;
|
|
388727
388972
|
}
|
|
388728
|
-
async function
|
|
388973
|
+
async function call35(onDone) {
|
|
388729
388974
|
return /* @__PURE__ */ jsx_dev_runtime239.jsxDEV(ThinkbackFlow, {
|
|
388730
388975
|
onDone
|
|
388731
388976
|
}, undefined, false, undefined, this);
|
|
@@ -388773,13 +389018,13 @@ var init_thinkback2 = __esm(() => {
|
|
|
388773
389018
|
// src/tui/commands/thinkback-play/thinkback-play.ts
|
|
388774
389019
|
var exports_thinkback_play = {};
|
|
388775
389020
|
__export(exports_thinkback_play, {
|
|
388776
|
-
call: () =>
|
|
389021
|
+
call: () => call36
|
|
388777
389022
|
});
|
|
388778
389023
|
import { join as join144 } from "path";
|
|
388779
389024
|
function getPluginId2() {
|
|
388780
389025
|
return `thinkback@${OFFICIAL_MARKETPLACE_NAME}`;
|
|
388781
389026
|
}
|
|
388782
|
-
async function
|
|
389027
|
+
async function call36() {
|
|
388783
389028
|
const v2Data = loadInstalledPluginsV2();
|
|
388784
389029
|
const pluginId = getPluginId2();
|
|
388785
389030
|
const installations = v2Data.plugins[pluginId];
|
|
@@ -391281,9 +391526,9 @@ var init_PermissionRuleList = __esm(() => {
|
|
|
391281
391526
|
// src/tui/commands/permissions/permissions.tsx
|
|
391282
391527
|
var exports_permissions2 = {};
|
|
391283
391528
|
__export(exports_permissions2, {
|
|
391284
|
-
call: () =>
|
|
391529
|
+
call: () => call37
|
|
391285
391530
|
});
|
|
391286
|
-
var jsx_dev_runtime247,
|
|
391531
|
+
var jsx_dev_runtime247, call37 = async (onDone, context) => {
|
|
391287
391532
|
return /* @__PURE__ */ jsx_dev_runtime247.jsxDEV(PermissionRuleList, {
|
|
391288
391533
|
onExit: onDone,
|
|
391289
391534
|
onRetryDenials: (commands) => {
|
|
@@ -391313,7 +391558,7 @@ var init_permissions8 = __esm(() => {
|
|
|
391313
391558
|
// src/tui/commands/plan/plan.tsx
|
|
391314
391559
|
var exports_plan = {};
|
|
391315
391560
|
__export(exports_plan, {
|
|
391316
|
-
call: () =>
|
|
391561
|
+
call: () => call38
|
|
391317
391562
|
});
|
|
391318
391563
|
function PlanDisplay(t0) {
|
|
391319
391564
|
const $ = import_compiler_runtime198.c(11);
|
|
@@ -391401,7 +391646,7 @@ function PlanDisplay(t0) {
|
|
|
391401
391646
|
}
|
|
391402
391647
|
return t5;
|
|
391403
391648
|
}
|
|
391404
|
-
async function
|
|
391649
|
+
async function call38(onDone, context, args) {
|
|
391405
391650
|
const {
|
|
391406
391651
|
getAppState,
|
|
391407
391652
|
setAppState
|
|
@@ -393239,9 +393484,9 @@ var init_HooksConfigMenu = __esm(() => {
|
|
|
393239
393484
|
// src/tui/commands/hooks/hooks.tsx
|
|
393240
393485
|
var exports_hooks = {};
|
|
393241
393486
|
__export(exports_hooks, {
|
|
393242
|
-
call: () =>
|
|
393487
|
+
call: () => call39
|
|
393243
393488
|
});
|
|
393244
|
-
var jsx_dev_runtime254,
|
|
393489
|
+
var jsx_dev_runtime254, call39 = async (onDone, context) => {
|
|
393245
393490
|
const appState = context.getAppState();
|
|
393246
393491
|
const permissionContext = appState.toolPermissionContext;
|
|
393247
393492
|
const toolNames = getTools2(permissionContext).map((tool) => tool.name);
|
|
@@ -393272,10 +393517,10 @@ var init_hooks5 = __esm(() => {
|
|
|
393272
393517
|
// src/tui/commands/files/files.ts
|
|
393273
393518
|
var exports_files4 = {};
|
|
393274
393519
|
__export(exports_files4, {
|
|
393275
|
-
call: () =>
|
|
393520
|
+
call: () => call40
|
|
393276
393521
|
});
|
|
393277
393522
|
import { relative as relative27 } from "path";
|
|
393278
|
-
async function
|
|
393523
|
+
async function call40(_args, context) {
|
|
393279
393524
|
const files = context.readFileState ? cacheKeys(context.readFileState) : [];
|
|
393280
393525
|
if (files.length === 0) {
|
|
393281
393526
|
return { type: "text", value: "No files in context" };
|
|
@@ -393307,7 +393552,7 @@ var init_files8 = __esm(() => {
|
|
|
393307
393552
|
// src/tui/commands/branch/branch.ts
|
|
393308
393553
|
var exports_branch = {};
|
|
393309
393554
|
__export(exports_branch, {
|
|
393310
|
-
call: () =>
|
|
393555
|
+
call: () => call41,
|
|
393311
393556
|
createFork: () => createFork,
|
|
393312
393557
|
deriveFirstPrompt: () => deriveFirstPrompt,
|
|
393313
393558
|
getUniqueForkName: () => getUniqueForkName
|
|
@@ -393416,7 +393661,7 @@ async function getUniqueForkName(baseName) {
|
|
|
393416
393661
|
}
|
|
393417
393662
|
return `${baseName} (Branch ${nextNumber})`;
|
|
393418
393663
|
}
|
|
393419
|
-
async function
|
|
393664
|
+
async function call41(onDone, context, args) {
|
|
393420
393665
|
const customTitle = args?.trim() || undefined;
|
|
393421
393666
|
const originalSessionId = getSessionId();
|
|
393422
393667
|
try {
|
|
@@ -399460,9 +399705,9 @@ var init_AgentsMenu = __esm(() => {
|
|
|
399460
399705
|
// src/tui/commands/agents/agents.tsx
|
|
399461
399706
|
var exports_agents2 = {};
|
|
399462
399707
|
__export(exports_agents2, {
|
|
399463
|
-
call: () =>
|
|
399708
|
+
call: () => call42
|
|
399464
399709
|
});
|
|
399465
|
-
async function
|
|
399710
|
+
async function call42(onDone, context) {
|
|
399466
399711
|
const appState = context.getAppState();
|
|
399467
399712
|
const permissionContext = appState.toolPermissionContext;
|
|
399468
399713
|
const tools = getTools2(permissionContext);
|
|
@@ -399625,7 +399870,7 @@ var init_refresh = __esm(() => {
|
|
|
399625
399870
|
|
|
399626
399871
|
// src/tui/utils/plugins/parseMarketplaceInput.ts
|
|
399627
399872
|
import { homedir as homedir37 } from "os";
|
|
399628
|
-
import { resolve as
|
|
399873
|
+
import { resolve as resolve51 } from "path";
|
|
399629
399874
|
function matchKnownGitHost(hostname) {
|
|
399630
399875
|
const host = hostname.toLowerCase();
|
|
399631
399876
|
for (const known of KNOWN_GIT_HOSTS) {
|
|
@@ -399677,7 +399922,7 @@ async function parseMarketplaceInput(input) {
|
|
|
399677
399922
|
const isWindows = process.platform === "win32";
|
|
399678
399923
|
const isWindowsPath = isWindows && (trimmed.startsWith(".\\") || trimmed.startsWith("..\\") || /^[a-zA-Z]:[/\\]/.test(trimmed));
|
|
399679
399924
|
if (trimmed.startsWith("./") || trimmed.startsWith("../") || trimmed.startsWith("/") || trimmed.startsWith("~") || isWindowsPath) {
|
|
399680
|
-
const resolvedPath =
|
|
399925
|
+
const resolvedPath = resolve51(trimmed.startsWith("~") ? trimmed.replace(/^~/, homedir37()) : trimmed);
|
|
399681
399926
|
let stats;
|
|
399682
399927
|
try {
|
|
399683
399928
|
stats = await fs.stat(resolvedPath);
|
|
@@ -409603,9 +409848,9 @@ var init_PluginSettings = __esm(() => {
|
|
|
409603
409848
|
// src/tui/commands/plugin/plugin.tsx
|
|
409604
409849
|
var exports_plugin = {};
|
|
409605
409850
|
__export(exports_plugin, {
|
|
409606
|
-
call: () =>
|
|
409851
|
+
call: () => call43
|
|
409607
409852
|
});
|
|
409608
|
-
async function
|
|
409853
|
+
async function call43(onDone, _context, args) {
|
|
409609
409854
|
return /* @__PURE__ */ jsx_dev_runtime294.jsxDEV(PluginSettings, {
|
|
409610
409855
|
onComplete: onDone,
|
|
409611
409856
|
args
|
|
@@ -409634,12 +409879,12 @@ var init_plugin3 = __esm(() => {
|
|
|
409634
409879
|
// src/tui/commands/reload-plugins/reload-plugins.ts
|
|
409635
409880
|
var exports_reload_plugins = {};
|
|
409636
409881
|
__export(exports_reload_plugins, {
|
|
409637
|
-
call: () =>
|
|
409882
|
+
call: () => call44
|
|
409638
409883
|
});
|
|
409639
409884
|
function n2(count, noun) {
|
|
409640
409885
|
return `${count} ${plural2(count, noun)}`;
|
|
409641
409886
|
}
|
|
409642
|
-
var
|
|
409887
|
+
var call44 = async (_args, context) => {
|
|
409643
409888
|
const r = await refreshActivePlugins(context.setAppState);
|
|
409644
409889
|
const parts = [
|
|
409645
409890
|
n2(r.enabled_count, "plugin"),
|
|
@@ -409677,9 +409922,9 @@ var init_reload_plugins2 = __esm(() => {
|
|
|
409677
409922
|
// src/tui/commands/rewind/rewind.ts
|
|
409678
409923
|
var exports_rewind = {};
|
|
409679
409924
|
__export(exports_rewind, {
|
|
409680
|
-
call: () =>
|
|
409925
|
+
call: () => call45
|
|
409681
409926
|
});
|
|
409682
|
-
async function
|
|
409927
|
+
async function call45(_args, context) {
|
|
409683
409928
|
if (context.openMessageSelector) {
|
|
409684
409929
|
context.openMessageSelector();
|
|
409685
409930
|
}
|
|
@@ -409852,9 +410097,9 @@ var init_heapDumpService = __esm(() => {
|
|
|
409852
410097
|
// src/tui/commands/heapdump/heapdump.ts
|
|
409853
410098
|
var exports_heapdump = {};
|
|
409854
410099
|
__export(exports_heapdump, {
|
|
409855
|
-
call: () =>
|
|
410100
|
+
call: () => call46
|
|
409856
410101
|
});
|
|
409857
|
-
async function
|
|
410102
|
+
async function call46() {
|
|
409858
410103
|
const result = await performHeapDump();
|
|
409859
410104
|
if (!result.success) {
|
|
409860
410105
|
return {
|
|
@@ -409887,7 +410132,7 @@ var init_heapdump2 = __esm(() => {
|
|
|
409887
410132
|
});
|
|
409888
410133
|
|
|
409889
410134
|
// src/tui/commands/version.ts
|
|
409890
|
-
var
|
|
410135
|
+
var call47 = async () => {
|
|
409891
410136
|
return {
|
|
409892
410137
|
type: "text",
|
|
409893
410138
|
value: MACRO.BUILD_TIME ? `${MACRO.VERSION} (built ${MACRO.BUILD_TIME})` : MACRO.VERSION
|
|
@@ -409900,7 +410145,7 @@ var init_version = __esm(() => {
|
|
|
409900
410145
|
description: "Print the version this session is running (not what autoupdate downloaded)",
|
|
409901
410146
|
isEnabled: () => true,
|
|
409902
410147
|
supportsNonInteractive: true,
|
|
409903
|
-
load: () => Promise.resolve({ call:
|
|
410148
|
+
load: () => Promise.resolve({ call: call47 })
|
|
409904
410149
|
};
|
|
409905
410150
|
version_default = version2;
|
|
409906
410151
|
});
|
|
@@ -411006,10 +411251,10 @@ var init_SandboxSettings = __esm(() => {
|
|
|
411006
411251
|
// src/tui/commands/sandbox-toggle/sandbox-toggle.tsx
|
|
411007
411252
|
var exports_sandbox_toggle = {};
|
|
411008
411253
|
__export(exports_sandbox_toggle, {
|
|
411009
|
-
call: () =>
|
|
411254
|
+
call: () => call48
|
|
411010
411255
|
});
|
|
411011
411256
|
import { relative as relative28 } from "path";
|
|
411012
|
-
async function
|
|
411257
|
+
async function call48(onDone, _context, args) {
|
|
411013
411258
|
const settings = getSettings_DEPRECATED();
|
|
411014
411259
|
const themeName = settings.theme || "light";
|
|
411015
411260
|
const platform = getPlatform3();
|
|
@@ -411116,9 +411361,9 @@ var init_sandbox_toggle2 = __esm(() => {
|
|
|
411116
411361
|
// src/tui/commands/stickers/stickers.ts
|
|
411117
411362
|
var exports_stickers = {};
|
|
411118
411363
|
__export(exports_stickers, {
|
|
411119
|
-
call: () =>
|
|
411364
|
+
call: () => call49
|
|
411120
411365
|
});
|
|
411121
|
-
async function
|
|
411366
|
+
async function call49() {
|
|
411122
411367
|
const url = "https://www.stickermule.com/claudecode";
|
|
411123
411368
|
const success = await openBrowser(url);
|
|
411124
411369
|
if (success) {
|
|
@@ -411652,13 +411897,13 @@ var init_concurrentSessions2 = __esm(() => {
|
|
|
411652
411897
|
// src/tui/commands/exit/exit.tsx
|
|
411653
411898
|
var exports_exit = {};
|
|
411654
411899
|
__export(exports_exit, {
|
|
411655
|
-
call: () =>
|
|
411900
|
+
call: () => call50
|
|
411656
411901
|
});
|
|
411657
411902
|
import { spawnSync as spawnSync5 } from "child_process";
|
|
411658
411903
|
function getRandomGoodbyeMessage2() {
|
|
411659
411904
|
return sample_default(GOODBYE_MESSAGES2) ?? "Goodbye!";
|
|
411660
411905
|
}
|
|
411661
|
-
async function
|
|
411906
|
+
async function call50(onDone) {
|
|
411662
411907
|
if (feature("BG_SESSIONS") && isBgSession2()) {
|
|
411663
411908
|
onDone();
|
|
411664
411909
|
spawnSync5("tmux", ["detach-client"], {
|
|
@@ -411957,7 +412202,7 @@ var init_exportRenderer = __esm(() => {
|
|
|
411957
412202
|
// src/tui/commands/export/export.tsx
|
|
411958
412203
|
var exports_export = {};
|
|
411959
412204
|
__export(exports_export, {
|
|
411960
|
-
call: () =>
|
|
412205
|
+
call: () => call51,
|
|
411961
412206
|
extractFirstPrompt: () => extractFirstPrompt2,
|
|
411962
412207
|
sanitizeFilename: () => sanitizeFilename
|
|
411963
412208
|
});
|
|
@@ -412000,7 +412245,7 @@ async function exportWithReactRenderer(context) {
|
|
|
412000
412245
|
const tools = context.options.tools || [];
|
|
412001
412246
|
return renderMessagesToPlainText(context.messages, tools);
|
|
412002
412247
|
}
|
|
412003
|
-
async function
|
|
412248
|
+
async function call51(onDone, context, args) {
|
|
412004
412249
|
const content = await exportWithReactRenderer(context);
|
|
412005
412250
|
const filename = args.trim();
|
|
412006
412251
|
if (filename) {
|
|
@@ -412065,7 +412310,7 @@ function shouldInferenceConfigCommandBeImmediate() {
|
|
|
412065
412310
|
// src/tui/commands/model/model.tsx
|
|
412066
412311
|
var exports_model = {};
|
|
412067
412312
|
__export(exports_model, {
|
|
412068
|
-
call: () =>
|
|
412313
|
+
call: () => call52
|
|
412069
412314
|
});
|
|
412070
412315
|
function ModelPickerWrapper(t0) {
|
|
412071
412316
|
const $ = import_compiler_runtime237.c(17);
|
|
@@ -412241,7 +412486,7 @@ function renderModelLabel(model) {
|
|
|
412241
412486
|
const rendered = renderDefaultModelSetting(model ?? getDefaultMainLoopModelSetting());
|
|
412242
412487
|
return model === null ? `${rendered} (default)` : rendered;
|
|
412243
412488
|
}
|
|
412244
|
-
var import_compiler_runtime237, React90, jsx_dev_runtime306,
|
|
412489
|
+
var import_compiler_runtime237, React90, jsx_dev_runtime306, call52 = async (onDone, _context, args) => {
|
|
412245
412490
|
args = args?.trim() || "";
|
|
412246
412491
|
if (COMMON_INFO_ARGS.includes(args)) {
|
|
412247
412492
|
return /* @__PURE__ */ jsx_dev_runtime306.jsxDEV(ShowModelAndClose, {
|
|
@@ -412300,7 +412545,7 @@ var init_model3 = __esm(() => {
|
|
|
412300
412545
|
// src/tui/commands/tag/tag.tsx
|
|
412301
412546
|
var exports_tag = {};
|
|
412302
412547
|
__export(exports_tag, {
|
|
412303
|
-
call: () =>
|
|
412548
|
+
call: () => call53
|
|
412304
412549
|
});
|
|
412305
412550
|
function ConfirmRemoveTag(t0) {
|
|
412306
412551
|
const $ = import_compiler_runtime238.c(11);
|
|
@@ -412518,7 +412763,7 @@ Examples:
|
|
|
412518
412763
|
React91.useEffect(t1, t2);
|
|
412519
412764
|
return null;
|
|
412520
412765
|
}
|
|
412521
|
-
async function
|
|
412766
|
+
async function call53(onDone, _context, args) {
|
|
412522
412767
|
args = args?.trim() || "";
|
|
412523
412768
|
if (COMMON_INFO_ARGS.includes(args) || COMMON_HELP_ARGS.includes(args)) {
|
|
412524
412769
|
return /* @__PURE__ */ jsx_dev_runtime307.jsxDEV(ShowHelp, {
|
|
@@ -412590,7 +412835,7 @@ var init_sessionlist = __esm(() => {
|
|
|
412590
412835
|
// src/tui/commands/effort/effort.tsx
|
|
412591
412836
|
var exports_effort = {};
|
|
412592
412837
|
__export(exports_effort, {
|
|
412593
|
-
call: () =>
|
|
412838
|
+
call: () => call54,
|
|
412594
412839
|
executeEffort: () => executeEffort,
|
|
412595
412840
|
showCurrentEffort: () => showCurrentEffort
|
|
412596
412841
|
});
|
|
@@ -412739,7 +412984,7 @@ function ApplyEffortAndClose(t0) {
|
|
|
412739
412984
|
React92.useEffect(t1, t2);
|
|
412740
412985
|
return null;
|
|
412741
412986
|
}
|
|
412742
|
-
async function
|
|
412987
|
+
async function call54(onDone, _context, args) {
|
|
412743
412988
|
args = args?.trim() || "";
|
|
412744
412989
|
if (COMMON_HELP_ARGS2.includes(args)) {
|
|
412745
412990
|
onDone(`Usage: /effort [low|medium|high|xhigh|max|auto]
|
|
@@ -415763,9 +416008,9 @@ var init_Stats = __esm(() => {
|
|
|
415763
416008
|
// src/tui/commands/stats/stats.tsx
|
|
415764
416009
|
var exports_stats = {};
|
|
415765
416010
|
__export(exports_stats, {
|
|
415766
|
-
call: () =>
|
|
416011
|
+
call: () => call55
|
|
415767
416012
|
});
|
|
415768
|
-
var jsx_dev_runtime310,
|
|
416013
|
+
var jsx_dev_runtime310, call55 = async (onDone) => {
|
|
415769
416014
|
return /* @__PURE__ */ jsx_dev_runtime310.jsxDEV(Stats2, {
|
|
415770
416015
|
onClose: onDone
|
|
415771
416016
|
}, undefined, false, undefined, this);
|
|
@@ -416517,9 +416762,9 @@ var init_useVoice = __esm(() => {
|
|
|
416517
416762
|
// src/tui/commands/voice/voice.ts
|
|
416518
416763
|
var exports_voice3 = {};
|
|
416519
416764
|
__export(exports_voice3, {
|
|
416520
|
-
call: () =>
|
|
416765
|
+
call: () => call56
|
|
416521
416766
|
});
|
|
416522
|
-
var LANG_HINT_MAX_SHOWS = 2,
|
|
416767
|
+
var LANG_HINT_MAX_SHOWS = 2, call56 = async () => {
|
|
416523
416768
|
if (!isVoiceModeEnabled()) {
|
|
416524
416769
|
return {
|
|
416525
416770
|
type: "text",
|
|
@@ -418856,6 +419101,7 @@ var init_commands5 = __esm(() => {
|
|
|
418856
419101
|
init_feedback2();
|
|
418857
419102
|
init_clear2();
|
|
418858
419103
|
init_color3();
|
|
419104
|
+
init_tui2();
|
|
418859
419105
|
init_commit();
|
|
418860
419106
|
init_copy2();
|
|
418861
419107
|
init_commit_push_pr();
|
|
@@ -418989,6 +419235,7 @@ var init_commands5 = __esm(() => {
|
|
|
418989
419235
|
stickers_default,
|
|
418990
419236
|
tag_default,
|
|
418991
419237
|
theme_default,
|
|
419238
|
+
tui_default,
|
|
418992
419239
|
feedback_default,
|
|
418993
419240
|
review_default,
|
|
418994
419241
|
rewind_default,
|
|
@@ -421707,7 +421954,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
421707
421954
|
// src/tui/utils/plans.ts
|
|
421708
421955
|
import { randomUUID as randomUUID40 } from "crypto";
|
|
421709
421956
|
import { copyFile as copyFile9, writeFile as writeFile47 } from "fs/promises";
|
|
421710
|
-
import { join as join160, resolve as
|
|
421957
|
+
import { join as join160, resolve as resolve53, sep as sep34 } from "path";
|
|
421711
421958
|
function getPlanSlug2(sessionId) {
|
|
421712
421959
|
const id = sessionId ?? getSessionId();
|
|
421713
421960
|
const cache = getPlanSlugCache();
|
|
@@ -421917,7 +422164,7 @@ var init_plans = __esm(() => {
|
|
|
421917
422164
|
let plansPath;
|
|
421918
422165
|
if (settingsDir) {
|
|
421919
422166
|
const cwd = getCwd();
|
|
421920
|
-
const resolved =
|
|
422167
|
+
const resolved = resolve53(cwd, settingsDir);
|
|
421921
422168
|
if (!resolved.startsWith(cwd + sep34) && resolved !== cwd) {
|
|
421922
422169
|
logError3(new Error(`plansDirectory must be within project root: ${settingsDir}`));
|
|
421923
422170
|
plansPath = join160(getAtlasConfigHomeDir3(), "plans");
|
|
@@ -421939,7 +422186,7 @@ var init_plans = __esm(() => {
|
|
|
421939
422186
|
// src/tui/utils/permissions/filesystem.ts
|
|
421940
422187
|
import { randomBytes as randomBytes21 } from "crypto";
|
|
421941
422188
|
import { homedir as homedir38, tmpdir as tmpdir11 } from "os";
|
|
421942
|
-
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";
|
|
421943
422190
|
function normalizeCaseForComparison2(path) {
|
|
421944
422191
|
return path.toLowerCase();
|
|
421945
422192
|
}
|
|
@@ -422155,11 +422402,38 @@ function checkPathSafetyForAutoEdit2(path, precomputedPathsToCheck) {
|
|
|
422155
422402
|
}
|
|
422156
422403
|
return { safe: true };
|
|
422157
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
|
+
}
|
|
422158
422426
|
function allWorkingDirectories2(context) {
|
|
422159
|
-
|
|
422160
|
-
|
|
422427
|
+
const originalCwd = getOriginalCwd();
|
|
422428
|
+
const dirs = [
|
|
422429
|
+
originalCwd,
|
|
422161
422430
|
...context.additionalWorkingDirectories.keys()
|
|
422162
|
-
]
|
|
422431
|
+
];
|
|
422432
|
+
const cwd = getCwd();
|
|
422433
|
+
if (cwd !== originalCwd && isActiveWorktreeCwd2(cwd)) {
|
|
422434
|
+
dirs.push(cwd);
|
|
422435
|
+
}
|
|
422436
|
+
return new Set(dirs);
|
|
422163
422437
|
}
|
|
422164
422438
|
function pathInAllowedWorkingPath2(path, toolPermissionContext, precomputedPathsToCheck) {
|
|
422165
422439
|
const pathsToCheck = precomputedPathsToCheck ?? getPathsForPermissionCheck2(path);
|
|
@@ -422782,7 +423056,7 @@ function checkReadableInternalPath2(absolutePath, input) {
|
|
|
422782
423056
|
}
|
|
422783
423057
|
return { behavior: "passthrough", message: "" };
|
|
422784
423058
|
}
|
|
422785
|
-
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;
|
|
422786
423060
|
var init_filesystem2 = __esm(() => {
|
|
422787
423061
|
init_shared();
|
|
422788
423062
|
init_configDir();
|
|
@@ -422841,6 +423115,7 @@ var init_filesystem2 = __esm(() => {
|
|
|
422841
423115
|
const nonce = randomBytes21(16).toString("hex");
|
|
422842
423116
|
return join161(getAtlasTempDir2(), "bundled-skills", MACRO.VERSION, nonce);
|
|
422843
423117
|
});
|
|
423118
|
+
worktreeCwdProbeCache2 = new Map;
|
|
422844
423119
|
getResolvedWorkingDirPaths2 = memoize_default(getPathsForPermissionCheck2);
|
|
422845
423120
|
});
|
|
422846
423121
|
|
|
@@ -469472,7 +469747,7 @@ import {
|
|
|
469472
469747
|
rm as rm11,
|
|
469473
469748
|
writeFile as writeFile49
|
|
469474
469749
|
} from "fs/promises";
|
|
469475
|
-
import { join as join173, resolve as
|
|
469750
|
+
import { join as join173, resolve as resolve57, sep as sep41 } from "path";
|
|
469476
469751
|
function getBuiltinSnapshotRoot() {
|
|
469477
469752
|
return join173(getMarketplacesCacheDir(), "builtin-snapshots");
|
|
469478
469753
|
}
|
|
@@ -469484,7 +469759,7 @@ function isBuiltinSnapshotEntry(entry) {
|
|
|
469484
469759
|
return false;
|
|
469485
469760
|
if (entry.source.source !== "directory")
|
|
469486
469761
|
return false;
|
|
469487
|
-
const root =
|
|
469762
|
+
const root = resolve57(getBuiltinSnapshotRoot()) + sep41;
|
|
469488
469763
|
return entry.installLocation.startsWith(root);
|
|
469489
469764
|
}
|
|
469490
469765
|
async function installBuiltinSnapshotFallback(marketplaceName) {
|
|
@@ -472005,7 +472280,7 @@ var init_usePluginAutoupdateNotification = __esm(() => {
|
|
|
472005
472280
|
});
|
|
472006
472281
|
|
|
472007
472282
|
// src/tui/utils/plugins/reconciler.ts
|
|
472008
|
-
import { isAbsolute as isAbsolute34, resolve as
|
|
472283
|
+
import { isAbsolute as isAbsolute34, resolve as resolve58 } from "path";
|
|
472009
472284
|
function diffMarketplaces(declared, materialized, opts) {
|
|
472010
472285
|
const missing = [];
|
|
472011
472286
|
const sourceChanged = [];
|
|
@@ -472118,7 +472393,7 @@ function normalizeSource(source, projectRoot) {
|
|
|
472118
472393
|
const canonicalRoot = findCanonicalGitRoot2(base);
|
|
472119
472394
|
return {
|
|
472120
472395
|
...source,
|
|
472121
|
-
path:
|
|
472396
|
+
path: resolve58(canonicalRoot ?? base, source.path)
|
|
472122
472397
|
};
|
|
472123
472398
|
}
|
|
472124
472399
|
return source;
|
|
@@ -476082,6 +476357,10 @@ function REPL({
|
|
|
476082
476357
|
});
|
|
476083
476358
|
}
|
|
476084
476359
|
}, [autoUpdaterResult, addNotification]);
|
|
476360
|
+
const tuiFullscreenSeed = useAppState((s) => s.settings.tui?.fullscreen);
|
|
476361
|
+
import_react280.useEffect(() => {
|
|
476362
|
+
setFullscreenRuntimeOverride(tuiFullscreenSeed);
|
|
476363
|
+
}, [tuiFullscreenSeed]);
|
|
476085
476364
|
import_react280.useEffect(() => {
|
|
476086
476365
|
if (isFullscreenEnvEnabled()) {
|
|
476087
476366
|
maybeGetTmuxMouseHint().then((hint) => {
|
|
@@ -479581,7 +479860,7 @@ class FpsTracker {
|
|
|
479581
479860
|
}
|
|
479582
479861
|
|
|
479583
479862
|
// src/tui/utils/githubRepoPathMapping.ts
|
|
479584
|
-
import { realpath as
|
|
479863
|
+
import { realpath as realpath15 } from "fs/promises";
|
|
479585
479864
|
async function updateGithubRepoPathMapping() {
|
|
479586
479865
|
try {
|
|
479587
479866
|
const repo = await detectCurrentRepository();
|
|
@@ -479594,7 +479873,7 @@ async function updateGithubRepoPathMapping() {
|
|
|
479594
479873
|
const basePath = gitRoot ?? cwd;
|
|
479595
479874
|
let currentPath;
|
|
479596
479875
|
try {
|
|
479597
|
-
currentPath = (await
|
|
479876
|
+
currentPath = (await realpath15(basePath)).normalize("NFC");
|
|
479598
479877
|
} catch {
|
|
479599
479878
|
currentPath = basePath;
|
|
479600
479879
|
}
|
|
@@ -483782,6 +484061,103 @@ var init_keybindings3 = __esm(() => {
|
|
|
483782
484061
|
`);
|
|
483783
484062
|
});
|
|
483784
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
|
+
|
|
483785
484161
|
// src/tui/skills/bundled/loremIpsum.ts
|
|
483786
484162
|
function registerLoremIpsumSkill() {}
|
|
483787
484163
|
|
|
@@ -484837,6 +485213,7 @@ function initBundledSkills() {
|
|
|
484837
485213
|
registerSimplifySkill();
|
|
484838
485214
|
registerBatchSkill();
|
|
484839
485215
|
registerStuckSkill();
|
|
485216
|
+
registerLessPermissionPromptsSkill();
|
|
484840
485217
|
registerAscendGenerateSkill();
|
|
484841
485218
|
registerAscendDebugSkill();
|
|
484842
485219
|
registerAscendOptimizeSkill();
|
|
@@ -484860,6 +485237,7 @@ var init_bundled = __esm(() => {
|
|
|
484860
485237
|
init_batch();
|
|
484861
485238
|
init_debug2();
|
|
484862
485239
|
init_keybindings3();
|
|
485240
|
+
init_lessPermissionPrompts();
|
|
484863
485241
|
init_simplify();
|
|
484864
485242
|
init_updateConfig();
|
|
484865
485243
|
init_ascendGenerate();
|
|
@@ -487748,7 +488126,7 @@ import {
|
|
|
487748
488126
|
dirname as dirname87,
|
|
487749
488127
|
join as join184,
|
|
487750
488128
|
relative as relative38,
|
|
487751
|
-
resolve as
|
|
488129
|
+
resolve as resolve59,
|
|
487752
488130
|
sep as sep43
|
|
487753
488131
|
} from "path";
|
|
487754
488132
|
function git(marketplaceDir, args, timeoutMs = 2 * 60 * 1000) {
|
|
@@ -487761,8 +488139,8 @@ function gitFailureMessage(res) {
|
|
|
487761
488139
|
return (res.stderr || res.error || `exit code ${res.code}`).trim();
|
|
487762
488140
|
}
|
|
487763
488141
|
async function publishPluginToMarketplace(opts) {
|
|
487764
|
-
const pluginDir =
|
|
487765
|
-
const marketplaceDir =
|
|
488142
|
+
const pluginDir = resolve59(opts.pluginDir);
|
|
488143
|
+
const marketplaceDir = resolve59(opts.marketplaceDir);
|
|
487766
488144
|
const notes = [];
|
|
487767
488145
|
if (pluginDir === marketplaceDir || pluginDir.startsWith(marketplaceDir + sep43)) {
|
|
487768
488146
|
throw new Error(`Cannot publish "${pluginDir}": the plugin directory must not live inside the target marketplace (${marketplaceDir})`);
|
|
@@ -487893,9 +488271,9 @@ var init_marketplacePublish = __esm(() => {
|
|
|
487893
488271
|
import { userInfo as userInfo2 } from "os";
|
|
487894
488272
|
import { existsSync as existsSync15 } from "fs";
|
|
487895
488273
|
import { mkdir as mkdir57, writeFile as writeFile54 } from "fs/promises";
|
|
487896
|
-
import { dirname as dirname88, join as join185, resolve as
|
|
488274
|
+
import { dirname as dirname88, join as join185, resolve as resolve60 } from "path";
|
|
487897
488275
|
async function scaffoldMarketplace(opts) {
|
|
487898
|
-
const targetDir =
|
|
488276
|
+
const targetDir = resolve60(opts.targetDir);
|
|
487899
488277
|
const name = opts.name.trim();
|
|
487900
488278
|
const manifestDirName = getPluginManifestDirs()[0];
|
|
487901
488279
|
const marketplaceManifestPath = join185(targetDir, manifestDirName, "marketplace.json");
|
|
@@ -487981,7 +488359,7 @@ var init_marketplaceScaffold = __esm(() => {
|
|
|
487981
488359
|
});
|
|
487982
488360
|
|
|
487983
488361
|
// src/tui/cli/handlers/plugins.ts
|
|
487984
|
-
import { basename as basename65, dirname as dirname89, resolve as
|
|
488362
|
+
import { basename as basename65, dirname as dirname89, resolve as resolve61 } from "path";
|
|
487985
488363
|
function handleMarketplaceError(error, action) {
|
|
487986
488364
|
logError3(error);
|
|
487987
488365
|
cliError2(`${figures_default.cross} Failed to ${action}: ${errorMessage2(error)}`);
|
|
@@ -488333,7 +488711,7 @@ async function marketplaceUpdateHandler(name, options) {
|
|
|
488333
488711
|
async function marketplaceScaffoldHandler(options) {
|
|
488334
488712
|
if (options.cowork)
|
|
488335
488713
|
setUseCoworkPlugins(true);
|
|
488336
|
-
const targetDir =
|
|
488714
|
+
const targetDir = resolve61(options.target ?? process.cwd());
|
|
488337
488715
|
try {
|
|
488338
488716
|
const result = await scaffoldMarketplace({
|
|
488339
488717
|
name: options.name,
|
|
@@ -488358,8 +488736,8 @@ async function marketplacePublishHandler(options) {
|
|
|
488358
488736
|
setUseCoworkPlugins(true);
|
|
488359
488737
|
try {
|
|
488360
488738
|
const result = await publishPluginToMarketplace({
|
|
488361
|
-
pluginDir:
|
|
488362
|
-
marketplaceDir:
|
|
488739
|
+
pluginDir: resolve61(options.plugin),
|
|
488740
|
+
marketplaceDir: resolve61(options.marketplace),
|
|
488363
488741
|
version: options.version,
|
|
488364
488742
|
push: options.push
|
|
488365
488743
|
});
|
|
@@ -489575,7 +489953,7 @@ var init_update2 = __esm(() => {
|
|
|
489575
489953
|
|
|
489576
489954
|
// src/tui/main.tsx
|
|
489577
489955
|
import { readFileSync as readFileSync25 } from "fs";
|
|
489578
|
-
import { resolve as
|
|
489956
|
+
import { resolve as resolve62 } from "path";
|
|
489579
489957
|
function logManagedSettings() {
|
|
489580
489958
|
try {
|
|
489581
489959
|
const policySettings = getSettingsForSource2("policySettings");
|
|
@@ -490142,12 +490520,12 @@ ${getTmuxInstallInstructions3()}
|
|
|
490142
490520
|
process.exit(1);
|
|
490143
490521
|
}
|
|
490144
490522
|
try {
|
|
490145
|
-
const filePath =
|
|
490523
|
+
const filePath = resolve62(options.systemPromptFile);
|
|
490146
490524
|
systemPrompt = readFileSync25(filePath, "utf8");
|
|
490147
490525
|
} catch (error) {
|
|
490148
490526
|
const code = getErrnoCode2(error);
|
|
490149
490527
|
if (code === "ENOENT") {
|
|
490150
|
-
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)}
|
|
490151
490529
|
`));
|
|
490152
490530
|
process.exit(1);
|
|
490153
490531
|
}
|
|
@@ -490164,12 +490542,12 @@ ${getTmuxInstallInstructions3()}
|
|
|
490164
490542
|
process.exit(1);
|
|
490165
490543
|
}
|
|
490166
490544
|
try {
|
|
490167
|
-
const filePath =
|
|
490545
|
+
const filePath = resolve62(options.appendSystemPromptFile);
|
|
490168
490546
|
appendSystemPrompt = readFileSync25(filePath, "utf8");
|
|
490169
490547
|
} catch (error) {
|
|
490170
490548
|
const code = getErrnoCode2(error);
|
|
490171
490549
|
if (code === "ENOENT") {
|
|
490172
|
-
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)}
|
|
490173
490551
|
`));
|
|
490174
490552
|
process.exit(1);
|
|
490175
490553
|
}
|
|
@@ -490219,7 +490597,7 @@ ${addendum}` : addendum;
|
|
|
490219
490597
|
errors = result.errors;
|
|
490220
490598
|
}
|
|
490221
490599
|
} else {
|
|
490222
|
-
const configPath =
|
|
490600
|
+
const configPath = resolve62(configItem);
|
|
490223
490601
|
const result = parseMcpConfigFromFilePath({
|
|
490224
490602
|
filePath: configPath,
|
|
490225
490603
|
expandVars: true,
|