@lousy-agents/agent-shell 5.23.2 → 5.23.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +122 -44
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2015,6 +2015,15 @@ function assertWindowsAclRemediationAllowed() {
|
|
|
2015
2015
|
|
|
2016
2016
|
const runtimePlatform = process.versions.bun ? (0,external_node_os_namespaceObject.platform)() : undefined;
|
|
2017
2017
|
const bunPosix = runtimePlatform === "darwin" || runtimePlatform === "linux" ? runtimePlatform : undefined;
|
|
2018
|
+
function nativeResult(input, result) {
|
|
2019
|
+
if (result.path !== undefined)
|
|
2020
|
+
return result.path;
|
|
2021
|
+
const errno = -(result.errno);
|
|
2022
|
+
const code = (0,external_node_util_namespaceObject.getSystemErrorName)(errno);
|
|
2023
|
+
throw Object.assign(new Error(`${code}: realpath '${input}'`), {
|
|
2024
|
+
code, errno, syscall: "realpath", path: input,
|
|
2025
|
+
});
|
|
2026
|
+
}
|
|
2018
2027
|
function realpath_resolve(input, native) {
|
|
2019
2028
|
if (native && process.platform === "win32") {
|
|
2020
2029
|
try {
|
|
@@ -2061,14 +2070,7 @@ function realpath_resolve(input, native) {
|
|
|
2061
2070
|
const binding = native_getNativeBinding();
|
|
2062
2071
|
if (binding?.canonicalizePath) {
|
|
2063
2072
|
// Ordinary resolution normalizes both the input and each expanded symlink.
|
|
2064
|
-
|
|
2065
|
-
if (result.path !== undefined)
|
|
2066
|
-
return result.path;
|
|
2067
|
-
const errno = -(result.errno);
|
|
2068
|
-
const code = (0,external_node_util_namespaceObject.getSystemErrorName)(errno);
|
|
2069
|
-
throw Object.assign(new Error(`${code}: realpath '${input}'`), {
|
|
2070
|
-
code, errno, syscall: "realpath", path: input,
|
|
2071
|
-
});
|
|
2073
|
+
return nativeResult(input, binding.canonicalizePath(input, !native));
|
|
2072
2074
|
}
|
|
2073
2075
|
if (getFsSafeNativeConfig().mode === "require") {
|
|
2074
2076
|
throw new errors_FsSafeError("helper-unavailable", "native fs-safe canonicalization is unavailable");
|
|
@@ -2081,10 +2083,19 @@ function realpath_resolve(input, native) {
|
|
|
2081
2083
|
const realpath_realpathSync = Object.assign((input) => realpath_resolve(input, false), {
|
|
2082
2084
|
native: (input) => realpath_resolve(input, true),
|
|
2083
2085
|
});
|
|
2084
|
-
/**
|
|
2086
|
+
/** POSIX async canonicalization retains Bun's native path and record-lock semantics. */
|
|
2085
2087
|
async function realpath_realpathNative(input) {
|
|
2086
|
-
if (bunPosix)
|
|
2087
|
-
|
|
2088
|
+
if (bunPosix) {
|
|
2089
|
+
if (input.includes("\0")) {
|
|
2090
|
+
throw Object.assign(new TypeError("realpath input must not contain null bytes"), { code: "ERR_INVALID_ARG_VALUE" });
|
|
2091
|
+
}
|
|
2092
|
+
const binding = native_getNativeBinding();
|
|
2093
|
+
if (binding?.canonicalizePathAsync)
|
|
2094
|
+
return nativeResult(input, await binding.canonicalizePathAsync(input, false));
|
|
2095
|
+
if (binding?.canonicalizePath || getFsSafeNativeConfig().mode === "require") {
|
|
2096
|
+
throw new errors_FsSafeError("helper-unavailable", "native fs-safe canonicalization is unavailable");
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2088
2099
|
try {
|
|
2089
2100
|
return await promises_namespaceObject.realpath(input);
|
|
2090
2101
|
}
|
|
@@ -2191,6 +2202,7 @@ function assertStatObservationSync(inspect, expected, initial, platform = proces
|
|
|
2191
2202
|
|
|
2192
2203
|
|
|
2193
2204
|
|
|
2205
|
+
|
|
2194
2206
|
// Numeric metadata is retained for existing internal consumers; rounded IDs
|
|
2195
2207
|
// must never become authority for a later comparison.
|
|
2196
2208
|
const exactGuardIdentities = new WeakMap();
|
|
@@ -2298,7 +2310,15 @@ async function createNearestExistingDirectoryGuard(rootReal, targetPath, options
|
|
|
2298
2310
|
}
|
|
2299
2311
|
// Recovery receipts must retain every identity bit, including on Windows.
|
|
2300
2312
|
async function directory_guard_inspectDirectoryIdentity(dir, expected) {
|
|
2301
|
-
|
|
2313
|
+
if (process.platform === "win32")
|
|
2314
|
+
return directory_guard_inspectDirectoryIdentitySync(dir, expected);
|
|
2315
|
+
const operationPath = directoryOperationPath(dir);
|
|
2316
|
+
return strict_file_identity_inspectFileIdentity(async () => {
|
|
2317
|
+
const stat = await promises_namespaceObject.lstat(operationPath, { bigint: true });
|
|
2318
|
+
if (stat.isSymbolicLink() || !stat.isDirectory())
|
|
2319
|
+
throw root_errors_directoryComponentNotDirectoryError();
|
|
2320
|
+
return stat;
|
|
2321
|
+
}, expected);
|
|
2302
2322
|
}
|
|
2303
2323
|
function directoryOperationPath(dir) {
|
|
2304
2324
|
windows_path_alias_assertNoWindowsPathAlias(dir, "filesystem");
|
|
@@ -4942,7 +4962,7 @@ async function readBoundedAsync(maxBytes, readChunk, options = {}) {
|
|
|
4942
4962
|
let total = 0;
|
|
4943
4963
|
const { observeRegularFileSize, createLimitError } = options;
|
|
4944
4964
|
const allocate = options.unpooled ? Buffer.allocUnsafeSlow : undefined;
|
|
4945
|
-
const size = options.initialSize ?? observeRegularFileSize?.();
|
|
4965
|
+
const size = options.initialSize ?? await observeRegularFileSize?.();
|
|
4946
4966
|
let buffer = size === undefined ? createScratchBuffer(maxBytes, allocate) : createInitialBuffer(maxBytes, size, allocate);
|
|
4947
4967
|
if (size !== undefined) {
|
|
4948
4968
|
const bytesRead = await readChunk(buffer, buffer.length);
|
|
@@ -4950,7 +4970,7 @@ async function readBoundedAsync(maxBytes, readChunk, options = {}) {
|
|
|
4950
4970
|
return finishReadBuffer(buffer, 0, allocate);
|
|
4951
4971
|
// Short reads can occur before EOF. Only use the size shortcut on this
|
|
4952
4972
|
// initial read; virtual files can report zero or stale sizes thereafter.
|
|
4953
|
-
const currentSize = bytesRead < buffer.length ? observeRegularFileSize?.() : undefined;
|
|
4973
|
+
const currentSize = bytesRead < buffer.length ? await observeRegularFileSize?.() : undefined;
|
|
4954
4974
|
total = addReadBytes(total, bytesRead, maxBytes, createLimitError);
|
|
4955
4975
|
if (currentSize !== undefined && currentSize > 0 && bytesRead >= currentSize)
|
|
4956
4976
|
return finishReadBuffer(buffer, total, allocate);
|
|
@@ -4981,12 +5001,12 @@ function readFileHandleBoundedWithSize(handle, maxBytes, initialSize) {
|
|
|
4981
5001
|
return (await handle.read(scratch, 0, length, null)).bytesRead;
|
|
4982
5002
|
}, {
|
|
4983
5003
|
initialSize,
|
|
4984
|
-
observeRegularFileSize: fd === undefined ? undefined : () =>
|
|
5004
|
+
observeRegularFileSize: fd === undefined ? undefined : () => regularFileSizeAsync(fd),
|
|
4985
5005
|
});
|
|
4986
5006
|
}
|
|
4987
5007
|
function regularFileSize(fd) {
|
|
4988
5008
|
try {
|
|
4989
|
-
const stat =
|
|
5009
|
+
const stat = fs.fstatSync(fd);
|
|
4990
5010
|
return stat.isFile() && Number.isSafeInteger(stat.size) && stat.size >= 0
|
|
4991
5011
|
? stat.size : undefined;
|
|
4992
5012
|
}
|
|
@@ -4995,6 +5015,17 @@ function regularFileSize(fd) {
|
|
|
4995
5015
|
return undefined;
|
|
4996
5016
|
}
|
|
4997
5017
|
}
|
|
5018
|
+
async function regularFileSizeAsync(fd) {
|
|
5019
|
+
try {
|
|
5020
|
+
const stat = await new Promise((resolve, reject) => {
|
|
5021
|
+
external_node_fs_namespaceObject.fstat(fd, (error, value) => error ? reject(error) : resolve(value));
|
|
5022
|
+
});
|
|
5023
|
+
return stat.isFile() && Number.isSafeInteger(stat.size) && stat.size >= 0 ? stat.size : undefined;
|
|
5024
|
+
}
|
|
5025
|
+
catch {
|
|
5026
|
+
return undefined;
|
|
5027
|
+
}
|
|
5028
|
+
}
|
|
4998
5029
|
function readDescriptorChunk(fd, scratch, length) {
|
|
4999
5030
|
return new Promise((resolve, reject) => {
|
|
5000
5031
|
fs.read(fd, scratch, 0, length, null, (error, bytesRead) => {
|
|
@@ -5011,7 +5042,7 @@ async function readFileDescriptorBounded(fd, maxBytes) {
|
|
|
5011
5042
|
normalizeMaxBytes(maxBytes);
|
|
5012
5043
|
return await readBoundedAsync(maxBytes, async (scratch, length) => {
|
|
5013
5044
|
return await readDescriptorChunk(fd, scratch, length);
|
|
5014
|
-
}, { observeRegularFileSize: () =>
|
|
5045
|
+
}, { observeRegularFileSize: () => regularFileSizeAsync(fd) });
|
|
5015
5046
|
}
|
|
5016
5047
|
function readBoundedSync(maxBytes, readChunk, options = {}) {
|
|
5017
5048
|
byte_budget_normalizeMaxBytes(maxBytes);
|
|
@@ -9424,7 +9455,8 @@ function* traverseRootPath(params, { mode = "native", observation: observationOu
|
|
|
9424
9455
|
windows_path_alias_assertNoWindowsPathAlias(rootPath);
|
|
9425
9456
|
windows_path_alias_assertNoWindowsPathAlias(absolutePath);
|
|
9426
9457
|
windows_path_alias_assertNoWindowsPathAlias(rootCanonicalPath);
|
|
9427
|
-
observeRoot
|
|
9458
|
+
if (observeRoot)
|
|
9459
|
+
yield* wait(observeRoot(rootCanonicalPath));
|
|
9428
9460
|
const context = createLexicalTraversalContext(yield* prepareRootTraversal(input, rootPath, rootCanonicalPath, absolutePath, rawAbsolutePath, synchronous));
|
|
9429
9461
|
const { state } = context;
|
|
9430
9462
|
const observation = createLexicalTraversalObservation(context, observationOutput?.request);
|
|
@@ -9615,6 +9647,8 @@ function assertInsideBoundary(params) {
|
|
|
9615
9647
|
|
|
9616
9648
|
|
|
9617
9649
|
|
|
9650
|
+
|
|
9651
|
+
|
|
9618
9652
|
const root_context_ensureTrailingSep = (value) => value.endsWith(external_node_path_namespaceObject.sep) ? value : value + external_node_path_namespaceObject.sep;
|
|
9619
9653
|
function assertValidRootRelativePath(relativePath) {
|
|
9620
9654
|
path_assertNoNulPathInput(relativePath, "relative path contains a NUL byte");
|
|
@@ -9638,21 +9672,24 @@ async function expandRelativePathWithHome(relativePath) {
|
|
|
9638
9672
|
}
|
|
9639
9673
|
const rawHome = process.env.HOME || process.env.USERPROFILE || external_node_os_namespaceObject.homedir();
|
|
9640
9674
|
windows_path_alias_assertNoWindowsPathAlias(rawHome, "filesystem", "home path uses a Windows filesystem namespace alias");
|
|
9641
|
-
|
|
9675
|
+
let home = cachedHomePath?.raw === rawHome ? cachedHomePath.real : undefined;
|
|
9676
|
+
if (home === undefined) {
|
|
9642
9677
|
let realHome = rawHome;
|
|
9643
9678
|
try {
|
|
9644
|
-
|
|
9679
|
+
const homePath = windows_path_alias_pathForWindowsFilesystem(rawHome);
|
|
9680
|
+
realHome = process.platform === "win32" ? realpath_realpathSync.native(homePath) : await realpath_realpathNative(homePath);
|
|
9645
9681
|
}
|
|
9646
9682
|
catch {
|
|
9647
9683
|
// If the home dir cannot be canonicalized, keep lexical expansion behavior.
|
|
9648
9684
|
}
|
|
9649
9685
|
cachedHomePath = { raw: rawHome, real: realHome };
|
|
9686
|
+
home = realHome;
|
|
9650
9687
|
}
|
|
9651
9688
|
if (homeOnly) {
|
|
9652
|
-
windows_path_alias_assertNoWindowsPathAlias(
|
|
9653
|
-
return
|
|
9689
|
+
windows_path_alias_assertNoWindowsPathAlias(home, "filesystem", "home path uses a Windows filesystem namespace alias");
|
|
9690
|
+
return home;
|
|
9654
9691
|
}
|
|
9655
|
-
const expanded = `${root_context_ensureTrailingSep(
|
|
9692
|
+
const expanded = `${root_context_ensureTrailingSep(home)}${relativePath.slice(2)}`;
|
|
9656
9693
|
windows_path_alias_assertNoWindowsPathAlias(expanded, "filesystem", "expanded path uses a Windows filesystem namespace alias");
|
|
9657
9694
|
return expanded;
|
|
9658
9695
|
}
|
|
@@ -9665,14 +9702,17 @@ async function resolveRootContext(rootDir) {
|
|
|
9665
9702
|
let rootStat;
|
|
9666
9703
|
let rootIdentity;
|
|
9667
9704
|
try {
|
|
9668
|
-
|
|
9705
|
+
const rootPath = windows_path_alias_pathForWindowsFilesystem(absolutePathWithRawSegments(rootDir));
|
|
9706
|
+
rootReal = process.platform === "win32" ? realpath_realpathSync.native(rootPath) : await realpath_realpathNative(rootPath);
|
|
9669
9707
|
windows_path_alias_assertNoWindowsPathAlias(rootReal, "filesystem", "canonical root path uses a Windows filesystem namespace alias");
|
|
9670
|
-
|
|
9671
|
-
const stat = external_node_fs_namespaceObject.statSync(rootReal, { bigint: true });
|
|
9708
|
+
const inspect = (stat) => {
|
|
9672
9709
|
if (!stat.isDirectory())
|
|
9673
9710
|
throw new errors_FsSafeError("invalid-path", "root dir is not a directory");
|
|
9674
9711
|
return stat;
|
|
9675
|
-
}
|
|
9712
|
+
};
|
|
9713
|
+
rootStat = await strict_file_identity_inspectFileIdentity(() => process.platform === "win32"
|
|
9714
|
+
? inspect(external_node_fs_namespaceObject.statSync(rootReal, { bigint: true }))
|
|
9715
|
+
: promises_namespaceObject.stat(rootReal, { bigint: true }).then(inspect));
|
|
9676
9716
|
rootIdentity = { dev: rootStat.dev, ino: rootStat.ino };
|
|
9677
9717
|
}
|
|
9678
9718
|
catch (err) {
|
|
@@ -9732,7 +9772,15 @@ function root_context_assertRootIdentityCurrentSync(root, observe) {
|
|
|
9732
9772
|
}
|
|
9733
9773
|
}
|
|
9734
9774
|
async function assertRootIdentityCurrent(root, observe) {
|
|
9735
|
-
|
|
9775
|
+
if (process.platform === "win32")
|
|
9776
|
+
return root_context_assertRootIdentityCurrentSync(root, observe);
|
|
9777
|
+
try {
|
|
9778
|
+
const stat = await directory_guard_inspectDirectoryIdentity(root.rootReal, { dev: root.rootIdentity.dev, ino: root.rootIdentity.ino });
|
|
9779
|
+
observe?.(stat);
|
|
9780
|
+
}
|
|
9781
|
+
catch (error) {
|
|
9782
|
+
throw rootPathChangedError(error instanceof Error ? error : undefined);
|
|
9783
|
+
}
|
|
9736
9784
|
}
|
|
9737
9785
|
/**
|
|
9738
9786
|
* Observe the current Root with an exact, operation-local receipt.
|
|
@@ -16868,7 +16916,8 @@ async function recordPreOpenFileChange(error, handle, filePath, before, opened)
|
|
|
16868
16916
|
return;
|
|
16869
16917
|
try {
|
|
16870
16918
|
await strict_file_identity_inspectFileIdentity(async () => before);
|
|
16871
|
-
const current = await strict_file_identity_inspectFileIdentity(() =>
|
|
16919
|
+
const current = await strict_file_identity_inspectFileIdentity(() => process.platform === "win32"
|
|
16920
|
+
? external_node_fs_namespaceObject.fstatSync(handle.fd, { bigint: true }) : handle.stat({ bigint: true }), opened);
|
|
16872
16921
|
if (current.isFile() && [0n, 1n].includes(current.nlink) &&
|
|
16873
16922
|
(before.dev !== current.dev || before.ino !== current.ino)) {
|
|
16874
16923
|
// A stale pathname sample is not proof that its former inode was unlinked.
|
|
@@ -16884,7 +16933,8 @@ async function recordOpenedFileFailure(error, handle, filePath, identity) {
|
|
|
16884
16933
|
!identity.isFile() || identity.nlink > 1n)
|
|
16885
16934
|
return;
|
|
16886
16935
|
try {
|
|
16887
|
-
const current = await strict_file_identity_inspectFileIdentity(() =>
|
|
16936
|
+
const current = await strict_file_identity_inspectFileIdentity(() => process.platform === "win32"
|
|
16937
|
+
? external_node_fs_namespaceObject.fstatSync(handle.fd, { bigint: true }) : handle.stat({ bigint: true }), identity);
|
|
16888
16938
|
if (current.isFile() && current.nlink === 0n)
|
|
16889
16939
|
recordFileObservationFailure(error, `unlinked:${filePath}`);
|
|
16890
16940
|
}
|
|
@@ -16916,8 +16966,7 @@ async function openLocalFileDescriptor(filePath, options) {
|
|
|
16916
16966
|
// Reject directories before opening so we never surface EISDIR to callers (e.g. tool
|
|
16917
16967
|
// results that get sent to messaging channels). See openclaw/openclaw#31186.
|
|
16918
16968
|
try {
|
|
16919
|
-
|
|
16920
|
-
const stat = external_node_fs_namespaceObject.lstatSync(filePath, { bigint: true });
|
|
16969
|
+
const inspect = (stat) => {
|
|
16921
16970
|
observedBeforeOpen = true;
|
|
16922
16971
|
if (stat.isSymbolicLink() && options?.symlinks !== "follow-within-root") {
|
|
16923
16972
|
throw new errors_FsSafeError("symlink", "symlink not allowed");
|
|
@@ -16926,7 +16975,10 @@ async function openLocalFileDescriptor(filePath, options) {
|
|
|
16926
16975
|
throw new errors_FsSafeError("not-file", "not a file");
|
|
16927
16976
|
}
|
|
16928
16977
|
return stat;
|
|
16929
|
-
}
|
|
16978
|
+
};
|
|
16979
|
+
preOpenStat = process.platform === "win32"
|
|
16980
|
+
? strict_file_identity_inspectFileIdentitySync(() => inspect(external_node_fs_namespaceObject.lstatSync(filePath, { bigint: true })))
|
|
16981
|
+
: await strict_file_identity_inspectFileIdentity(async () => inspect(await promises_namespaceObject.lstat(filePath, { bigint: true })));
|
|
16930
16982
|
}
|
|
16931
16983
|
catch (err) {
|
|
16932
16984
|
if (err instanceof errors_FsSafeError || observedBeforeOpen) {
|
|
@@ -16963,12 +17015,16 @@ async function openLocalFileDescriptor(filePath, options) {
|
|
|
16963
17015
|
let openedIdentity;
|
|
16964
17016
|
let identity;
|
|
16965
17017
|
try {
|
|
16966
|
-
|
|
16967
|
-
openedIdentity =
|
|
16968
|
-
if (!
|
|
17018
|
+
const inspect = (stat) => {
|
|
17019
|
+
openedIdentity = stat;
|
|
17020
|
+
if (!stat.isFile())
|
|
16969
17021
|
throw new errors_FsSafeError("not-file", "not a file");
|
|
16970
|
-
return
|
|
16971
|
-
}
|
|
17022
|
+
return stat;
|
|
17023
|
+
};
|
|
17024
|
+
const expected = preOpenStat && !preOpenStat.isSymbolicLink() ? preOpenStat : undefined;
|
|
17025
|
+
identity = process.platform === "win32"
|
|
17026
|
+
? strict_file_identity_inspectFileIdentitySync(() => inspect(external_node_fs_namespaceObject.fstatSync(handle.fd, { bigint: true })), expected)
|
|
17027
|
+
: await strict_file_identity_inspectFileIdentity(async () => inspect(await handle.stat({ bigint: true })), expected);
|
|
16972
17028
|
}
|
|
16973
17029
|
catch (error) {
|
|
16974
17030
|
if (openedIdentity && [0n, 1n].includes(openedIdentity.nlink)) {
|
|
@@ -19869,6 +19925,8 @@ async function movePathNative(root, params, paths, overwrite = false) {
|
|
|
19869
19925
|
|
|
19870
19926
|
|
|
19871
19927
|
|
|
19928
|
+
|
|
19929
|
+
|
|
19872
19930
|
function resolveFinalOpenedRealPath(filePath) {
|
|
19873
19931
|
try {
|
|
19874
19932
|
return realpath_realpathSync.native(filePath);
|
|
@@ -19892,6 +19950,12 @@ function inspectOpenedPathIdentitySync(filePath, symlinks) {
|
|
|
19892
19950
|
}
|
|
19893
19951
|
return stat;
|
|
19894
19952
|
}
|
|
19953
|
+
async function inspectOpenedPathIdentity(filePath, symlinks) {
|
|
19954
|
+
const stat = await (symlinks === "follow-within-root" ? promises_namespaceObject.stat(filePath, { bigint: true }) : promises_namespaceObject.lstat(filePath, { bigint: true }));
|
|
19955
|
+
if (stat.isSymbolicLink() && symlinks !== "follow-within-root")
|
|
19956
|
+
throw new errors_FsSafeError("symlink", "symlink not allowed");
|
|
19957
|
+
return stat;
|
|
19958
|
+
}
|
|
19895
19959
|
async function admitRootReadHandle(params) {
|
|
19896
19960
|
try {
|
|
19897
19961
|
if (params.hardlinks !== "allow" && params.opened.stat.nlink > 1) {
|
|
@@ -19900,14 +19964,20 @@ async function admitRootReadHandle(params) {
|
|
|
19900
19964
|
if (params.beforeFinalFence) {
|
|
19901
19965
|
await params.beforeFinalFence(params.filePath, params.opened.handle);
|
|
19902
19966
|
}
|
|
19903
|
-
|
|
19904
|
-
|
|
19967
|
+
function* admit() {
|
|
19968
|
+
const synchronous = process.platform === "win32";
|
|
19969
|
+
if (synchronous)
|
|
19970
|
+
root_context_assertRootIdentityCurrentSync(params.root);
|
|
19971
|
+
else
|
|
19972
|
+
yield* wait(assertRootIdentityCurrent(params.root));
|
|
19905
19973
|
let realPath;
|
|
19906
19974
|
try {
|
|
19907
|
-
const current =
|
|
19975
|
+
const current = synchronous
|
|
19976
|
+
? strict_file_identity_inspectFileIdentitySync(() => inspectOpenedPathIdentitySync(params.filePath, params.symlinks), params.identity)
|
|
19977
|
+
: yield* wait(strict_file_identity_inspectFileIdentity(() => inspectOpenedPathIdentity(params.filePath, params.symlinks), params.identity));
|
|
19908
19978
|
if (params.hardlinks !== "allow" && current.nlink > 1n)
|
|
19909
19979
|
throw hardlinkedPathNotAllowedError();
|
|
19910
|
-
const canonicalPath = resolveFinalOpenedRealPath(params.filePath);
|
|
19980
|
+
const canonicalPath = synchronous ? resolveFinalOpenedRealPath(params.filePath) : yield* wait(realpath_realpathNative(params.filePath));
|
|
19911
19981
|
windows_path_alias_assertNoWindowsPathAlias(canonicalPath, "filesystem", "resolved file path uses a Windows filesystem namespace alias");
|
|
19912
19982
|
const admittedRealPath = root_boundary_admitPathInsideRoot({
|
|
19913
19983
|
rootPath: params.root.rootReal,
|
|
@@ -19919,7 +19989,9 @@ async function admitRootReadHandle(params) {
|
|
|
19919
19989
|
}
|
|
19920
19990
|
// This is a fresh no-follow observation even when canonicalPath and
|
|
19921
19991
|
// filePath have the same spelling; realpath may have raced a replacement.
|
|
19922
|
-
const canonical =
|
|
19992
|
+
const canonical = synchronous
|
|
19993
|
+
? strict_file_identity_inspectFileIdentitySync(() => inspectOpenedPathIdentitySync(canonicalPath, undefined), params.identity)
|
|
19994
|
+
: yield* wait(strict_file_identity_inspectFileIdentity(() => inspectOpenedPathIdentity(canonicalPath), params.identity));
|
|
19923
19995
|
if (params.hardlinks !== "allow" && canonical.nlink > 1n)
|
|
19924
19996
|
throw hardlinkedPathNotAllowedError();
|
|
19925
19997
|
realPath = admittedRealPath.path;
|
|
@@ -19930,9 +20002,15 @@ async function admitRootReadHandle(params) {
|
|
|
19930
20002
|
: error;
|
|
19931
20003
|
}
|
|
19932
20004
|
params.afterPathIdentityCheck?.(params.filePath, params.opened.handle);
|
|
19933
|
-
|
|
20005
|
+
if (synchronous)
|
|
20006
|
+
root_context_assertRootIdentityCurrentSync(params.root);
|
|
20007
|
+
else
|
|
20008
|
+
yield* wait(assertRootIdentityCurrent(params.root));
|
|
19934
20009
|
return { ...params.opened, realPath };
|
|
19935
20010
|
}
|
|
20011
|
+
try {
|
|
20012
|
+
return process.platform === "win32" ? atomic_io_runSync(admit()) : await runAsync(admit());
|
|
20013
|
+
}
|
|
19936
20014
|
catch (error) {
|
|
19937
20015
|
if (params.identity.nlink <= 1n) {
|
|
19938
20016
|
await recordOpenedFileFailure(error, params.opened.handle, params.filePath, params.identity);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lousy-agents/agent-shell",
|
|
3
|
-
"version": "5.23.
|
|
3
|
+
"version": "5.23.4",
|
|
4
4
|
"description": "A flight recorder for npm script execution",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"typecheck": "tsc --noEmit"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@openclaw/fs-safe": "0.27.
|
|
40
|
+
"@openclaw/fs-safe": "0.27.2",
|
|
41
41
|
"zod": "4.6.7"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|