@commonlyai/cli 0.1.389 → 0.1.390
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/package.json
CHANGED
|
@@ -148,7 +148,8 @@ const WORK_CUES = [PARALLEL_READS_CUE, ROW_SLICING_CUE, BACKGROUND_PROCESS_CUE];
|
|
|
148
148
|
const RUNTIME_CREDENTIAL_PLACEHOLDER = '${COMMONLY_AGENT_TOKEN}';
|
|
149
149
|
|
|
150
150
|
// A workspace seat's sandbox.filesystem.read-outside, with `~` expanded the way
|
|
151
|
-
// bwrap.js expands it.
|
|
151
|
+
// bwrap.js expands it. resolveHostReadDirectories refuses anything still
|
|
152
|
+
// relative, naming the entry, before the turn spawns.
|
|
152
153
|
const workspaceReadOutside = (env) => {
|
|
153
154
|
const declared = env?.sandbox?.filesystem?.['read-outside'];
|
|
154
155
|
if (!Array.isArray(declared)) return [];
|
|
@@ -625,6 +625,11 @@ export const resolveHostReadDirectories = (entries, home = homedir(), { fold = t
|
|
|
625
625
|
try {
|
|
626
626
|
const canonicalHome = canonicalPath(home);
|
|
627
627
|
return entries.map((entry) => {
|
|
628
|
+
// A relative entry would resolve against the CLI's own folder, which is
|
|
629
|
+
// no folder the operator named (CodeRabbit on #4111). Callers expand ~/.
|
|
630
|
+
if (typeof entry !== 'string' || !isAbsolute(entry)) {
|
|
631
|
+
throw new Error(`refusing sandbox.filesystem.read-outside ${entry}: name a folder by its absolute path or by ~/.`);
|
|
632
|
+
}
|
|
628
633
|
const canonical = canonicalPath(entry);
|
|
629
634
|
let reason = hostReadRefusal(canonical, canonicalHome);
|
|
630
635
|
if (!reason && only && !only.some((allowed) => foldedWithin(join(canonicalHome, allowed), canonical))) {
|
|
@@ -797,10 +802,12 @@ export const buildSeatbeltProfile = ({
|
|
|
797
802
|
`(allow file-read* file-test-existence ${subpath(path)})`,
|
|
798
803
|
`(allow file-read-metadata file-test-existence (path-ancestors "${escapeSbplString(path)}"))`,
|
|
799
804
|
].join('\n'))).join('\n');
|
|
800
|
-
// The adapter's own read-only inputs,
|
|
805
|
+
// The adapter's own read-only inputs, stated again after the host dot denies.
|
|
806
|
+
// Built from the adapter's list itself, so a folder the seat also names keeps
|
|
807
|
+
// the adapter's view of it, dot files included (CodeRabbit on #4111).
|
|
801
808
|
const adapterReadOnlyRules = resolvedReadOnlyPaths.map((path) => (
|
|
802
809
|
`(allow file-read* file-test-existence ${literal(path)})`
|
|
803
|
-
)).concat(
|
|
810
|
+
)).concat([...new Set(readOnlyDirectories.map(realpathOrSelf))].map((path) => (
|
|
804
811
|
`(allow file-read* file-test-existence ${subpath(path)})`
|
|
805
812
|
))).join('\n');
|
|
806
813
|
// A symlinked entry is held at both its name and its target, so the write
|