@sagentlab/navarch-runtime 0.1.153 → 0.1.154
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/bin/worktree-guard-hook.cjs +13 -2
- package/package.json +1 -1
|
@@ -320,11 +320,22 @@ function isCommentOrMarkupToken(command, start, token, heredocs) {
|
|
|
320
320
|
|
|
321
321
|
let rootEntries;
|
|
322
322
|
|
|
323
|
-
|
|
323
|
+
// Policy paths must remain candidates even when a sandbox hides root entries.
|
|
324
|
+
// Include home roots on both platforms, independently of the host OS.
|
|
325
|
+
const POLICY_ROOT_ENTRIES = [...new Set(
|
|
326
|
+
[...DEFAULT_SYSTEM_PREFIXES, "/home", "/Users", "/root", os.homedir()]
|
|
327
|
+
.map((prefix) => prefix.split("/")[1])
|
|
328
|
+
.filter(Boolean),
|
|
329
|
+
)];
|
|
330
|
+
|
|
331
|
+
/** Visible root entry names plus policy roots, or null if listing fails. */
|
|
324
332
|
function listRootEntries() {
|
|
325
333
|
if (rootEntries === undefined) {
|
|
326
334
|
try {
|
|
327
|
-
rootEntries =
|
|
335
|
+
rootEntries = [...new Set([
|
|
336
|
+
...POLICY_ROOT_ENTRIES,
|
|
337
|
+
...fs.readdirSync(path.parse(process.cwd()).root),
|
|
338
|
+
])];
|
|
328
339
|
} catch {
|
|
329
340
|
rootEntries = null;
|
|
330
341
|
}
|
package/package.json
CHANGED