@openclaw/mxc-sandbox 2026.9.6 → 2026.9.7
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/assets/icon.png +0 -0
- package/dist/index.js +49 -139
- package/package.json +4 -4
package/assets/icon.png
CHANGED
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -10,11 +10,11 @@ import { createWritableRenameTargetResolver, registerSandboxBackend, resolvePref
|
|
|
10
10
|
import * as fs$1 from "node:fs";
|
|
11
11
|
import fs, { lstatSync, mkdtempSync, readFileSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
12
12
|
import { createHash, randomBytes } from "node:crypto";
|
|
13
|
-
import {
|
|
13
|
+
import { extractErrorCode, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
14
|
+
import { isPathInside, removePathWithinRoot, resolvePathPrefixSync, root } from "openclaw/plugin-sdk/file-access-runtime";
|
|
14
15
|
import { runCommandBuffered } from "openclaw/plugin-sdk/process-runtime";
|
|
15
16
|
import { FsSafeError } from "openclaw/plugin-sdk/security-runtime";
|
|
16
17
|
import { fileURLToPath } from "node:url";
|
|
17
|
-
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
18
18
|
import { execFileSync } from "node:child_process";
|
|
19
19
|
//#region extensions/mxc/src/config.ts
|
|
20
20
|
const MXC_CONTAINMENTS = ["process", "processcontainer"];
|
|
@@ -102,23 +102,6 @@ function resolveSdkBinDir() {
|
|
|
102
102
|
} catch {}
|
|
103
103
|
return null;
|
|
104
104
|
}
|
|
105
|
-
function buildSearchPaths(binary, sdkBinDir) {
|
|
106
|
-
return sdkBinDir ? [path$1.join(sdkBinDir, binary)] : [];
|
|
107
|
-
}
|
|
108
|
-
/** SDK-owned search paths for wxc-exec on Windows. */
|
|
109
|
-
function wxcSearchPaths() {
|
|
110
|
-
return buildSearchPaths("wxc-exec.exe", resolveSdkBinDir());
|
|
111
|
-
}
|
|
112
|
-
function findBinary(searchPaths) {
|
|
113
|
-
for (const p of searchPaths) if (fs$1.existsSync(p)) return p;
|
|
114
|
-
return null;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Resolves the MXC executor binary path.
|
|
118
|
-
* @param configOverride Optional user-configured path override.
|
|
119
|
-
* @returns Absolute path to the binary.
|
|
120
|
-
* @throws If the binary cannot be found.
|
|
121
|
-
*/
|
|
122
105
|
function resolveMxcBinaryPath(configOverride) {
|
|
123
106
|
if (configOverride) {
|
|
124
107
|
const resolvedOverride = path$1.win32.isAbsolute(configOverride) ? configOverride : path$1.resolve(configOverride);
|
|
@@ -126,9 +109,10 @@ function resolveMxcBinaryPath(configOverride) {
|
|
|
126
109
|
return resolvedOverride;
|
|
127
110
|
}
|
|
128
111
|
const binaryName = "wxc-exec.exe";
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
112
|
+
const sdkBinDir = resolveSdkBinDir();
|
|
113
|
+
const binaryPath = sdkBinDir ? path$1.join(sdkBinDir, binaryName) : void 0;
|
|
114
|
+
if (!binaryPath || !fs$1.existsSync(binaryPath)) throw new Error(`MXC executor "${binaryName}" not found. Install @microsoft/mxc-sdk or set mxcBinaryPath in config.`);
|
|
115
|
+
return binaryPath;
|
|
132
116
|
}
|
|
133
117
|
//#endregion
|
|
134
118
|
//#region extensions/mxc/src/path-comparison.ts
|
|
@@ -192,7 +176,7 @@ var MxcFsBridge = class {
|
|
|
192
176
|
this.sandbox = sandbox;
|
|
193
177
|
this.resolveRenameTargets = createWritableRenameTargetResolver((target) => this.resolveTarget(target), (target, action) => this.ensureWritable(target, action));
|
|
194
178
|
this.defaultContainerRoot = path.resolve(sandbox.containerWorkdir);
|
|
195
|
-
this.protectedSkillMounts = resolveMxcProtectedSkillMounts
|
|
179
|
+
this.protectedSkillMounts = resolveMxcProtectedSkillMounts(sandbox);
|
|
196
180
|
this.workspaceMounts = resolveWorkspaceMounts(sandbox);
|
|
197
181
|
}
|
|
198
182
|
resolvePath(params) {
|
|
@@ -306,14 +290,11 @@ function resolveWorkspaceMounts(sandbox) {
|
|
|
306
290
|
const containerRoot = path.resolve(sandbox.containerWorkdir);
|
|
307
291
|
const workspaceDir = path.resolve(sandbox.workspaceDir);
|
|
308
292
|
const agentWorkspaceDir = path.resolve(sandbox.agentWorkspaceDir);
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
writable: true
|
|
313
|
-
}] : [{
|
|
314
|
-
hostRoot: workspaceDir,
|
|
293
|
+
const writable = sandbox.workspaceAccess === "rw";
|
|
294
|
+
const mounts = [{
|
|
295
|
+
hostRoot: writable ? agentWorkspaceDir : workspaceDir,
|
|
315
296
|
containerRoot,
|
|
316
|
-
writable
|
|
297
|
+
writable
|
|
317
298
|
}];
|
|
318
299
|
if (sandbox.workspaceAccess === "ro" && normalizeMxcPathForComparison(agentWorkspaceDir) !== normalizeMxcPathForComparison(workspaceDir)) mounts.push({
|
|
319
300
|
hostRoot: agentWorkspaceDir,
|
|
@@ -322,20 +303,17 @@ function resolveWorkspaceMounts(sandbox) {
|
|
|
322
303
|
});
|
|
323
304
|
return dedupeAndSortMounts(mounts);
|
|
324
305
|
}
|
|
325
|
-
function resolveMxcProtectedSkillMounts
|
|
306
|
+
function resolveMxcProtectedSkillMounts(sandbox) {
|
|
326
307
|
return dedupeAndSortMounts(resolveMxcReadOnlySkillMounts({
|
|
327
308
|
agentWorkspaceDir: sandbox.agentWorkspaceDir,
|
|
328
309
|
skillsWorkspaceDir: sandbox.skillsWorkspaceDir,
|
|
329
310
|
workdir: sandbox.containerWorkdir,
|
|
330
311
|
workspaceAccess: sandbox.workspaceAccess
|
|
331
|
-
}).map(
|
|
332
|
-
}
|
|
333
|
-
function normalizeMxcProtectedSkillMount(mount) {
|
|
334
|
-
return {
|
|
312
|
+
}).map((mount) => ({
|
|
335
313
|
hostRoot: path.resolve(mount.hostPath),
|
|
336
314
|
containerRoot: path.resolve(mount.containerPath),
|
|
337
315
|
writable: false
|
|
338
|
-
};
|
|
316
|
+
})));
|
|
339
317
|
}
|
|
340
318
|
function dedupeAndSortMounts(mounts) {
|
|
341
319
|
const deduped = /* @__PURE__ */ new Map();
|
|
@@ -400,22 +378,14 @@ function resolveSandboxTempDir(env = {}) {
|
|
|
400
378
|
}
|
|
401
379
|
function resolveBaselineReadonlyPaths(env) {
|
|
402
380
|
const systemRoot = firstNonBlankEnv(env.SystemRoot, env.WINDIR) ?? "C:\\Windows";
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
381
|
+
const programFiles = firstNonBlankEnv(env.ProgramFiles, env.ProgramW6432) ?? "C:\\Program Files";
|
|
382
|
+
const programFilesX86 = firstNonBlankEnv(env["ProgramFiles(x86)"]) ?? "C:\\Program Files (x86)";
|
|
383
|
+
return [.../* @__PURE__ */ new Set([
|
|
384
|
+
programFiles,
|
|
385
|
+
programFilesX86,
|
|
406
386
|
win32.join(systemRoot, "System32"),
|
|
407
387
|
win32.join(systemRoot, "SysWOW64")
|
|
408
|
-
]);
|
|
409
|
-
}
|
|
410
|
-
function dedupeStable(values) {
|
|
411
|
-
const deduped = [];
|
|
412
|
-
const seen = /* @__PURE__ */ new Set();
|
|
413
|
-
for (const value of values) {
|
|
414
|
-
if (seen.has(value)) continue;
|
|
415
|
-
seen.add(value);
|
|
416
|
-
deduped.push(value);
|
|
417
|
-
}
|
|
418
|
-
return deduped;
|
|
388
|
+
])];
|
|
419
389
|
}
|
|
420
390
|
//#endregion
|
|
421
391
|
//#region extensions/mxc/src/windows-command.ts
|
|
@@ -592,7 +562,7 @@ function buildMxcContainerConfig(params) {
|
|
|
592
562
|
lifecycle: { destroyOnExit: true },
|
|
593
563
|
process: {
|
|
594
564
|
commandLine: buildCommandLine(params.command, params.args ?? []),
|
|
595
|
-
cwd:
|
|
565
|
+
cwd: params.workdir,
|
|
596
566
|
env: processEnv,
|
|
597
567
|
timeout: resolveProcessTimeoutSeconds(params.config, params.baseline) * 1e3
|
|
598
568
|
},
|
|
@@ -666,7 +636,7 @@ function resolveBaselineReadonlyPathSpecs(baseline, context) {
|
|
|
666
636
|
}
|
|
667
637
|
function resolveMxcProtectedSkillPolicyPaths(context) {
|
|
668
638
|
const deduped = /* @__PURE__ */ new Map();
|
|
669
|
-
for (const mount of
|
|
639
|
+
for (const mount of resolveMxcReadOnlySkillMounts(context)) {
|
|
670
640
|
const hostPath = path.resolve(mount.hostPath);
|
|
671
641
|
deduped.set(normalizeMxcPathForComparison(hostPath), hostPath);
|
|
672
642
|
const containerPath = path.resolve(mount.containerPath);
|
|
@@ -677,14 +647,6 @@ function resolveMxcProtectedSkillPolicyPaths(context) {
|
|
|
677
647
|
function resolveProtectedSkillPolicyPathSpecs(context) {
|
|
678
648
|
return resolveMxcProtectedSkillPolicyPaths(context).map((candidatePath) => optionalFilesystemPath(candidatePath));
|
|
679
649
|
}
|
|
680
|
-
function resolveMxcProtectedSkillMounts(context) {
|
|
681
|
-
return resolveMxcReadOnlySkillMounts({
|
|
682
|
-
agentWorkspaceDir: context.agentWorkspaceDir,
|
|
683
|
-
skillsWorkspaceDir: context.skillsWorkspaceDir,
|
|
684
|
-
workdir: context.workdir,
|
|
685
|
-
workspaceAccess: context.workspaceAccess
|
|
686
|
-
});
|
|
687
|
-
}
|
|
688
650
|
function resolveExistingFilesystemPaths(pathSpecs, accessLabel) {
|
|
689
651
|
const deduped = /* @__PURE__ */ new Map();
|
|
690
652
|
for (const pathSpec of pathSpecs) {
|
|
@@ -741,9 +703,6 @@ function processContainerName(runtimeId) {
|
|
|
741
703
|
const hash = createHash("sha256").update(runtimeId).digest("hex").slice(0, 8);
|
|
742
704
|
return `${runtimeId.slice(0, PROCESS_CONTAINER_NAME_MAX_LEN - hash.length - 1)}-${hash}`;
|
|
743
705
|
}
|
|
744
|
-
function resolveProcessCwd(workdir) {
|
|
745
|
-
return workdir;
|
|
746
|
-
}
|
|
747
706
|
function resolveProcessTimeoutSeconds(config, baseline) {
|
|
748
707
|
if (config.timeoutSecondsConfigured === true) return Math.min(config.timeoutSeconds, baseline.process.timeoutSeconds);
|
|
749
708
|
return baseline.process.timeoutSeconds;
|
|
@@ -761,11 +720,11 @@ function hostPathExists(candidatePath) {
|
|
|
761
720
|
statSync(candidatePath);
|
|
762
721
|
return true;
|
|
763
722
|
} catch (err) {
|
|
764
|
-
if (isNodeError$
|
|
723
|
+
if (isNodeError$1(err)) return false;
|
|
765
724
|
throw err;
|
|
766
725
|
}
|
|
767
726
|
}
|
|
768
|
-
function isNodeError$
|
|
727
|
+
function isNodeError$1(err) {
|
|
769
728
|
return err instanceof Error && "code" in err;
|
|
770
729
|
}
|
|
771
730
|
//#endregion
|
|
@@ -808,31 +767,21 @@ const SandboxPolicyLayerSchema = z.object({
|
|
|
808
767
|
process: processPolicySchema.optional()
|
|
809
768
|
}).strict();
|
|
810
769
|
function loadSandboxBaselinePolicy(options = {}) {
|
|
811
|
-
const
|
|
812
|
-
|
|
813
|
-
label: policyPath,
|
|
814
|
-
policy: readSandboxPolicyFile(policyPath)
|
|
815
|
-
});
|
|
816
|
-
const merged = mergeSandboxPolicyLayers(sources);
|
|
770
|
+
const layers = (options.policyPaths ?? []).map(readSandboxPolicyFile);
|
|
771
|
+
const merged = mergeSandboxPolicyLayers(layers);
|
|
817
772
|
const resolved = resolveSandboxBaseline(merged);
|
|
818
773
|
return {
|
|
819
774
|
...resolved,
|
|
820
775
|
process: {
|
|
821
776
|
...resolved.process,
|
|
822
|
-
timeoutSecondsConfigured:
|
|
777
|
+
timeoutSecondsConfigured: layers.some((policy) => policy.process?.timeoutSeconds !== void 0)
|
|
823
778
|
},
|
|
824
779
|
configuredPaths: merged.configuredPaths
|
|
825
780
|
};
|
|
826
781
|
}
|
|
827
782
|
function readSandboxPolicyFile(policyPath) {
|
|
828
|
-
let parsed;
|
|
829
783
|
try {
|
|
830
|
-
|
|
831
|
-
} catch (err) {
|
|
832
|
-
throw policyFileError(policyPath, err);
|
|
833
|
-
}
|
|
834
|
-
try {
|
|
835
|
-
return parseSandboxPolicyLayer(parsed, policyPath);
|
|
784
|
+
return parseSandboxPolicyLayer(JSON.parse(readFileSync(policyPath, "utf-8")), policyPath);
|
|
836
785
|
} catch (err) {
|
|
837
786
|
throw policyFileError(policyPath, err);
|
|
838
787
|
}
|
|
@@ -845,41 +794,27 @@ function parseSandboxPolicyLayer(value, sourceLabel) {
|
|
|
845
794
|
const readwritePaths = normalizeConfiguredPaths(filesystem?.additionalReadwritePaths, sourceLabel, "filesystem.additionalReadwritePaths");
|
|
846
795
|
return {
|
|
847
796
|
...parsed.data,
|
|
848
|
-
filesystem: filesystem ? {
|
|
849
|
-
...filesystem,
|
|
850
|
-
...readonlyPaths.length > 0 ? { additionalReadonlyPaths: readonlyPaths.map((entry) => entry.path) } : {},
|
|
851
|
-
...readwritePaths.length > 0 ? { additionalReadwritePaths: readwritePaths.map((entry) => entry.path) } : {}
|
|
852
|
-
} : void 0,
|
|
853
797
|
configuredPaths: {
|
|
854
798
|
readonlyPaths,
|
|
855
799
|
readwritePaths
|
|
856
800
|
}
|
|
857
801
|
};
|
|
858
802
|
}
|
|
859
|
-
function mergeSandboxPolicyLayers(
|
|
803
|
+
function mergeSandboxPolicyLayers(layers) {
|
|
860
804
|
const timeoutCandidates = [DEFAULT_SANDBOX_BASELINE.process.timeoutSeconds];
|
|
861
|
-
const filesystem = {
|
|
862
|
-
restrictToProjectDir: DEFAULT_SANDBOX_BASELINE.filesystem.restrictToProjectDir,
|
|
863
|
-
additionalReadonlyPaths: [],
|
|
864
|
-
additionalReadwritePaths: []
|
|
865
|
-
};
|
|
866
805
|
const configuredPathMaps = {
|
|
867
806
|
readonlyPaths: /* @__PURE__ */ new Map(),
|
|
868
807
|
readwritePaths: /* @__PURE__ */ new Map()
|
|
869
808
|
};
|
|
870
|
-
for (const
|
|
871
|
-
mergeFilesystemPolicy(filesystem, policy.filesystem);
|
|
809
|
+
for (const policy of layers) {
|
|
872
810
|
mergeConfiguredPathEntries(configuredPathMaps.readonlyPaths, policy.configuredPaths.readonlyPaths);
|
|
873
811
|
mergeConfiguredPathEntries(configuredPathMaps.readwritePaths, policy.configuredPaths.readwritePaths);
|
|
874
812
|
const timeoutSeconds = policy.process?.timeoutSeconds;
|
|
875
|
-
if (timeoutSeconds !== void 0)
|
|
876
|
-
assertPositiveFiniteNumber(timeoutSeconds, `${label}.process.timeoutSeconds`);
|
|
877
|
-
timeoutCandidates.push(timeoutSeconds);
|
|
878
|
-
}
|
|
813
|
+
if (timeoutSeconds !== void 0) timeoutCandidates.push(timeoutSeconds);
|
|
879
814
|
}
|
|
880
815
|
return {
|
|
881
816
|
filesystem: {
|
|
882
|
-
|
|
817
|
+
restrictToProjectDir: DEFAULT_SANDBOX_BASELINE.filesystem.restrictToProjectDir,
|
|
883
818
|
additionalReadonlyPaths: [...configuredPathMaps.readonlyPaths.values()].map((entry) => entry.path),
|
|
884
819
|
additionalReadwritePaths: [...configuredPathMaps.readwritePaths.values()].map((entry) => entry.path)
|
|
885
820
|
},
|
|
@@ -890,10 +825,6 @@ function mergeSandboxPolicyLayers(sources) {
|
|
|
890
825
|
}
|
|
891
826
|
};
|
|
892
827
|
}
|
|
893
|
-
function mergeFilesystemPolicy(target, layer) {
|
|
894
|
-
if (!target || !layer) return;
|
|
895
|
-
target.restrictToProjectDir = mostRestrictiveBoolean(DEFAULT_SANDBOX_BASELINE.filesystem.restrictToProjectDir, target.restrictToProjectDir, layer.restrictToProjectDir);
|
|
896
|
-
}
|
|
897
828
|
function mergeConfiguredPathEntries(target, entries) {
|
|
898
829
|
for (const entry of entries) {
|
|
899
830
|
const existing = target.get(entry.path);
|
|
@@ -936,21 +867,15 @@ function assertConfiguredPathExists(pathValue, source) {
|
|
|
936
867
|
try {
|
|
937
868
|
statSync(pathValue);
|
|
938
869
|
} catch (err) {
|
|
939
|
-
if (isNodeError
|
|
870
|
+
if (isNodeError(err)) {
|
|
940
871
|
if (err.code === "ENOENT") throw new Error(`Sandbox policy path ${pathValue} configured by ${source} does not exist on the host. Create the path or update the policy file.`, { cause: err });
|
|
941
872
|
throw new Error(`Sandbox policy path ${pathValue} configured by ${source} is not accessible on the host: ${formatErrorMessage(err)}`, { cause: err });
|
|
942
873
|
}
|
|
943
874
|
throw err;
|
|
944
875
|
}
|
|
945
876
|
}
|
|
946
|
-
function mostRestrictiveBoolean(defaultValue, ...values) {
|
|
947
|
-
return defaultValue || values.some((value) => value === true);
|
|
948
|
-
}
|
|
949
|
-
function assertPositiveFiniteNumber(value, label) {
|
|
950
|
-
if (typeof value !== "number" || !Number.isFinite(value) || value < 1) throw new TypeError(`Sandbox policy field ${label} must be a positive number.`);
|
|
951
|
-
}
|
|
952
877
|
function policyFileError(policyPath, err) {
|
|
953
|
-
if (isNodeError
|
|
878
|
+
if (isNodeError(err) && err.code === "ENOENT") return new Error(`Configured sandbox policy file ${policyPath} does not exist. Remove it from mxcPolicyPaths or create the file.`, { cause: err });
|
|
954
879
|
return new Error(`Failed to load sandbox policy file at ${policyPath}: ${formatErrorMessage(err)}`, { cause: err instanceof Error ? err : void 0 });
|
|
955
880
|
}
|
|
956
881
|
function formatSandboxPolicyIssue(sourceLabel, issue) {
|
|
@@ -974,7 +899,7 @@ function formatIssuePath(pathSegments) {
|
|
|
974
899
|
}
|
|
975
900
|
return label;
|
|
976
901
|
}
|
|
977
|
-
function isNodeError
|
|
902
|
+
function isNodeError(err) {
|
|
978
903
|
return err instanceof Error && "code" in err;
|
|
979
904
|
}
|
|
980
905
|
//#endregion
|
|
@@ -1019,15 +944,12 @@ function cleanupLauncherPayloadFile(token) {
|
|
|
1019
944
|
function createSandboxTempDir(hostEnv) {
|
|
1020
945
|
return mkdtempSync(path.join(resolveSandboxTempDir(hostEnv), "openclaw-mxc-sandbox-"));
|
|
1021
946
|
}
|
|
1022
|
-
function assertWorkdirInsideWorkspace(workspaceDir, workdir) {
|
|
1023
|
-
const workspace = realpathForExistingPath(workspaceDir, "sandbox workspace");
|
|
1024
|
-
const candidate = realpathForPotentialPath(workdir);
|
|
1025
|
-
if (isPathInside(workspace, candidate)) return candidate;
|
|
1026
|
-
throw new Error(`MXC sandbox workdir ${workdir} is outside the sandbox workspace ${workspaceDir}. Use a workdir inside the sandbox workspace.`);
|
|
1027
|
-
}
|
|
1028
947
|
function resolveWorkdirInsideWorkspace(workspaceDir, workdir) {
|
|
1029
|
-
const
|
|
948
|
+
const workspace = realpathForExistingPath(workspaceDir, "sandbox workspace");
|
|
1030
949
|
try {
|
|
950
|
+
const { existingPath, unresolvedSegments } = resolvePathPrefixSync(workdir);
|
|
951
|
+
const candidate = path.join(existingPath, ...unresolvedSegments);
|
|
952
|
+
if (!isPathInside(workspace, candidate)) throw new Error(`MXC sandbox workdir ${workdir} is outside the sandbox workspace ${workspaceDir}. Use a workdir inside the sandbox workspace.`);
|
|
1031
953
|
if (statSync(candidate).isDirectory()) return candidate;
|
|
1032
954
|
} catch (err) {
|
|
1033
955
|
if (isMissingPathError(err)) throw new Error(`MXC sandbox workdir ${workdir} does not exist.`, { cause: err });
|
|
@@ -1043,22 +965,9 @@ function realpathForExistingPath(value, label) {
|
|
|
1043
965
|
throw err;
|
|
1044
966
|
}
|
|
1045
967
|
}
|
|
1046
|
-
function realpathForPotentialPath(value) {
|
|
1047
|
-
const resolved = path.resolve(value);
|
|
1048
|
-
try {
|
|
1049
|
-
return realpathSync(resolved);
|
|
1050
|
-
} catch (err) {
|
|
1051
|
-
if (!isMissingPathError(err)) throw err;
|
|
1052
|
-
const parent = path.dirname(resolved);
|
|
1053
|
-
if (parent === resolved) throw new Error(`MXC sandbox workdir ${value} does not exist.`, { cause: err });
|
|
1054
|
-
return path.join(realpathForPotentialPath(parent), path.basename(resolved));
|
|
1055
|
-
}
|
|
1056
|
-
}
|
|
1057
|
-
function isNodeError(err) {
|
|
1058
|
-
return err instanceof Error && "code" in err;
|
|
1059
|
-
}
|
|
1060
968
|
function isMissingPathError(err) {
|
|
1061
|
-
|
|
969
|
+
const code = extractErrorCode(err);
|
|
970
|
+
return code === "ENOENT" || code === "ENOTDIR";
|
|
1062
971
|
}
|
|
1063
972
|
function buildMxcLauncherOptions(config, usePty) {
|
|
1064
973
|
const options = {
|
|
@@ -1162,13 +1071,14 @@ function createMxcSandboxBackendHandle(params) {
|
|
|
1162
1071
|
const runtimeWorkdir = resolveMxcRuntimeWorkdir(workspace, effectiveWorkdir);
|
|
1163
1072
|
const baselineContext = resolveCurrentBaselineContext(workspace.activeWorkspaceDir);
|
|
1164
1073
|
const sandboxTempDir = createSandboxTempDir(baselineContext.hostEnv);
|
|
1165
|
-
|
|
1166
|
-
args: cmdParams.args,
|
|
1167
|
-
script: cmdParams.script,
|
|
1168
|
-
tempDir: sandboxTempDir
|
|
1169
|
-
});
|
|
1170
|
-
const execInput = cmdParams.stdin === void 0 ? Buffer.alloc(0) : toBuffer(cmdParams.stdin);
|
|
1074
|
+
let commandBridge;
|
|
1171
1075
|
try {
|
|
1076
|
+
commandBridge = createWindowsCommandBridge({
|
|
1077
|
+
args: cmdParams.args,
|
|
1078
|
+
script: cmdParams.script,
|
|
1079
|
+
tempDir: sandboxTempDir
|
|
1080
|
+
});
|
|
1081
|
+
const execInput = cmdParams.stdin === void 0 ? Buffer.alloc(0) : toBuffer(cmdParams.stdin);
|
|
1172
1082
|
const payloadFile = createMxcLauncherPayload(restrictiveConfig, buildMxcContainerConfig({
|
|
1173
1083
|
config: restrictiveConfig,
|
|
1174
1084
|
baseline,
|
|
@@ -1214,7 +1124,7 @@ function createMxcSandboxBackendHandle(params) {
|
|
|
1214
1124
|
cleanupLauncherPayloadFile(payloadFile);
|
|
1215
1125
|
}
|
|
1216
1126
|
} finally {
|
|
1217
|
-
commandBridge
|
|
1127
|
+
commandBridge?.cleanup();
|
|
1218
1128
|
rmSync(sandboxTempDir, {
|
|
1219
1129
|
force: true,
|
|
1220
1130
|
recursive: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/mxc-sandbox",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.7",
|
|
4
4
|
"description": "OpenClaw MXC sandbox execution plugin for MXC-capable hosts",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"minHostVersion": ">=2026.6.11"
|
|
23
23
|
},
|
|
24
24
|
"compat": {
|
|
25
|
-
"pluginApi": ">=2026.9.
|
|
25
|
+
"pluginApi": ">=2026.9.7"
|
|
26
26
|
},
|
|
27
27
|
"build": {
|
|
28
|
-
"openclawVersion": "2026.9.
|
|
28
|
+
"openclawVersion": "2026.9.7",
|
|
29
29
|
"bundledDist": false,
|
|
30
30
|
"staticAssets": [
|
|
31
31
|
{
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"assets/activity.svg"
|
|
51
51
|
],
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"openclaw": ">=2026.9.
|
|
53
|
+
"openclaw": ">=2026.9.7"
|
|
54
54
|
},
|
|
55
55
|
"peerDependenciesMeta": {
|
|
56
56
|
"openclaw": {
|