@openclaw/mxc-sandbox 2026.9.1 → 2026.9.3
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 +22 -17
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -131,6 +131,12 @@ function resolveMxcBinaryPath(configOverride) {
|
|
|
131
131
|
return found;
|
|
132
132
|
}
|
|
133
133
|
//#endregion
|
|
134
|
+
//#region extensions/mxc/src/path-comparison.ts
|
|
135
|
+
function normalizeMxcPathForComparison(value) {
|
|
136
|
+
const resolved = path.resolve(value);
|
|
137
|
+
return process.platform === "win32" ? resolved.toLowerCase() : resolved;
|
|
138
|
+
}
|
|
139
|
+
//#endregion
|
|
134
140
|
//#region extensions/mxc/src/workspace-skill-mounts.ts
|
|
135
141
|
const MATERIALIZED_SANDBOX_SKILLS_WORKSPACE_PARTS = [".openclaw", "sandbox-skills"];
|
|
136
142
|
function containerJoin(root, ...parts) {
|
|
@@ -204,6 +210,13 @@ var MxcFsBridge = class {
|
|
|
204
210
|
...params.maxBytes === void 0 ? {} : { maxBytes: params.maxBytes }
|
|
205
211
|
});
|
|
206
212
|
}
|
|
213
|
+
async readDirectory(params) {
|
|
214
|
+
const target = this.resolveTarget(params);
|
|
215
|
+
return (await (await root(target.mount.hostRoot)).list(target.mountRelativePath, { withFileTypes: true })).map(({ name, isDirectory }) => ({
|
|
216
|
+
name,
|
|
217
|
+
isDirectory
|
|
218
|
+
}));
|
|
219
|
+
}
|
|
207
220
|
async writeFile(params) {
|
|
208
221
|
const target = this.resolveTarget(params);
|
|
209
222
|
this.ensureWritable(target, "write files");
|
|
@@ -299,7 +312,7 @@ function resolveWorkspaceMounts(sandbox) {
|
|
|
299
312
|
containerRoot,
|
|
300
313
|
writable: false
|
|
301
314
|
}];
|
|
302
|
-
if (sandbox.workspaceAccess === "ro" &&
|
|
315
|
+
if (sandbox.workspaceAccess === "ro" && normalizeMxcPathForComparison(agentWorkspaceDir) !== normalizeMxcPathForComparison(workspaceDir)) mounts.push({
|
|
303
316
|
hostRoot: agentWorkspaceDir,
|
|
304
317
|
containerRoot: agentWorkspaceDir,
|
|
305
318
|
writable: false
|
|
@@ -324,7 +337,7 @@ function normalizeMxcProtectedSkillMount(mount) {
|
|
|
324
337
|
function dedupeAndSortMounts(mounts) {
|
|
325
338
|
const deduped = /* @__PURE__ */ new Map();
|
|
326
339
|
for (const mount of mounts) {
|
|
327
|
-
const key = `${
|
|
340
|
+
const key = `${normalizeMxcPathForComparison(mount.hostRoot)}::${normalizeMxcPathForComparison(mount.containerRoot)}`;
|
|
328
341
|
if (!deduped.has(key)) deduped.set(key, mount);
|
|
329
342
|
}
|
|
330
343
|
return [...deduped.values()].toSorted((left, right) => {
|
|
@@ -338,11 +351,7 @@ function resolveRelativeParentPath(relativePath) {
|
|
|
338
351
|
return parent === "." || parent === "" ? null : parent;
|
|
339
352
|
}
|
|
340
353
|
function isSameMountRoot(first, second) {
|
|
341
|
-
return
|
|
342
|
-
}
|
|
343
|
-
function normalizePathForComparison$1(value) {
|
|
344
|
-
const resolved = path.resolve(value);
|
|
345
|
-
return process.platform === "win32" ? resolved.toLowerCase() : resolved;
|
|
354
|
+
return normalizeMxcPathForComparison(first) === normalizeMxcPathForComparison(second);
|
|
346
355
|
}
|
|
347
356
|
//#endregion
|
|
348
357
|
//#region extensions/mxc/src/sandbox-baseline.ts
|
|
@@ -646,7 +655,7 @@ function resolveWorkspaceReadwritePathSpecs(workspace) {
|
|
|
646
655
|
function resolveWorkspaceReadonlyPathSpecs(workspace) {
|
|
647
656
|
if (workspace.workspaceAccess === "rw") return [];
|
|
648
657
|
const readonlyPathSpecs = [requiredFilesystemPath(workspace.workspaceDir)];
|
|
649
|
-
if (workspace.workspaceAccess === "ro" &&
|
|
658
|
+
if (workspace.workspaceAccess === "ro" && normalizeMxcPathForComparison(workspace.agentWorkspaceDir) !== normalizeMxcPathForComparison(workspace.workspaceDir)) readonlyPathSpecs.push(requiredFilesystemPath(workspace.agentWorkspaceDir));
|
|
650
659
|
return readonlyPathSpecs;
|
|
651
660
|
}
|
|
652
661
|
function resolveBaselineReadonlyPathSpecs(baseline, context) {
|
|
@@ -656,9 +665,9 @@ function resolveMxcProtectedSkillPolicyPaths(context) {
|
|
|
656
665
|
const deduped = /* @__PURE__ */ new Map();
|
|
657
666
|
for (const mount of resolveMxcProtectedSkillMounts(context)) {
|
|
658
667
|
const hostPath = path.resolve(mount.hostPath);
|
|
659
|
-
deduped.set(
|
|
668
|
+
deduped.set(normalizeMxcPathForComparison(hostPath), hostPath);
|
|
660
669
|
const containerPath = path.resolve(mount.containerPath);
|
|
661
|
-
deduped.set(
|
|
670
|
+
deduped.set(normalizeMxcPathForComparison(containerPath), containerPath);
|
|
662
671
|
}
|
|
663
672
|
return [...deduped.values()];
|
|
664
673
|
}
|
|
@@ -676,7 +685,7 @@ function resolveMxcProtectedSkillMounts(context) {
|
|
|
676
685
|
function resolveExistingFilesystemPaths(pathSpecs, accessLabel) {
|
|
677
686
|
const deduped = /* @__PURE__ */ new Map();
|
|
678
687
|
for (const pathSpec of pathSpecs) {
|
|
679
|
-
const key =
|
|
688
|
+
const key = normalizeMxcPathForComparison(pathSpec.path);
|
|
680
689
|
const existing = deduped.get(key);
|
|
681
690
|
if (existing) {
|
|
682
691
|
existing.required ||= pathSpec.required;
|
|
@@ -740,14 +749,10 @@ function assertNoMxcReadwriteReadonlyOverlap(params) {
|
|
|
740
749
|
for (const readwritePath of params.readwritePaths) for (const readonlyPath of params.readonlyPaths) if (pathsOverlap(readwritePath, readonlyPath)) throw new Error(`MXC readwrite path ${readwritePath} overlaps read-only path ${readonlyPath}. Windows MXC cannot safely enforce nested read-only overlays under writable paths.`);
|
|
741
750
|
}
|
|
742
751
|
function pathsOverlap(first, second) {
|
|
743
|
-
const left =
|
|
744
|
-
const right =
|
|
752
|
+
const left = normalizeMxcPathForComparison(first);
|
|
753
|
+
const right = normalizeMxcPathForComparison(second);
|
|
745
754
|
return isPathInside(left, right) || isPathInside(right, left);
|
|
746
755
|
}
|
|
747
|
-
function normalizePathForComparison(value) {
|
|
748
|
-
const resolved = path.resolve(value);
|
|
749
|
-
return process.platform === "win32" ? resolved.toLowerCase() : resolved;
|
|
750
|
-
}
|
|
751
756
|
function hostPathExists(candidatePath) {
|
|
752
757
|
try {
|
|
753
758
|
statSync(candidatePath);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/mxc-sandbox",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.3",
|
|
4
4
|
"description": "OpenClaw MXC sandbox execution plugin for MXC-capable hosts",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"minHostVersion": ">=2026.6.11"
|
|
22
22
|
},
|
|
23
23
|
"compat": {
|
|
24
|
-
"pluginApi": ">=2026.9.
|
|
24
|
+
"pluginApi": ">=2026.9.3"
|
|
25
25
|
},
|
|
26
26
|
"build": {
|
|
27
|
-
"openclawVersion": "2026.9.
|
|
27
|
+
"openclawVersion": "2026.9.3",
|
|
28
28
|
"bundledDist": false,
|
|
29
29
|
"staticAssets": [
|
|
30
30
|
{
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"README.md"
|
|
48
48
|
],
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"openclaw": ">=2026.9.
|
|
50
|
+
"openclaw": ">=2026.9.3"
|
|
51
51
|
},
|
|
52
52
|
"peerDependenciesMeta": {
|
|
53
53
|
"openclaw": {
|