@tablation/crew 0.127.7 → 0.127.8
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/cli.js +14 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -12792,9 +12792,10 @@ var realExec = (bin, args, o) => execFileP2(bin, args, { env: o?.env ?? process.
|
|
|
12792
12792
|
var OPENSHELL_ATTACHABLE_LABEL = "openshell.ai/sandbox-attachable=true";
|
|
12793
12793
|
var OPENSHELL_WORKSPACE_LABEL = "openshell.ai/sandbox-attachable-workspace";
|
|
12794
12794
|
var VOLUME_ROOT = "/cache";
|
|
12795
|
+
var SANDBOX_WORKSPACE = "default";
|
|
12795
12796
|
var DEFAULT_CACHE_SETTINGS = {
|
|
12796
12797
|
engine: "docker",
|
|
12797
|
-
workspace:
|
|
12798
|
+
workspace: SANDBOX_WORKSPACE,
|
|
12798
12799
|
helperImage: "alpine/git:latest",
|
|
12799
12800
|
depsLockfile: "pnpm-lock.yaml"
|
|
12800
12801
|
};
|
|
@@ -12950,6 +12951,16 @@ var SandboxCache = class {
|
|
|
12950
12951
|
]);
|
|
12951
12952
|
return true;
|
|
12952
12953
|
}
|
|
12954
|
+
/** The workspace label the existing volume carries, or null when the volume is absent or unlabeled. A volume's labels cannot be changed in place. */
|
|
12955
|
+
async volumeWorkspace() {
|
|
12956
|
+
try {
|
|
12957
|
+
const { stdout } = await this.engine(["volume", "inspect", "--format", `{{index .Labels "${OPENSHELL_WORKSPACE_LABEL}"}}`, this.s.volume]);
|
|
12958
|
+
const v = stdout.trim();
|
|
12959
|
+
return v && v !== "<no value>" ? v : null;
|
|
12960
|
+
} catch {
|
|
12961
|
+
return null;
|
|
12962
|
+
}
|
|
12963
|
+
}
|
|
12953
12964
|
helper(image, script, args, env = {}, extra = []) {
|
|
12954
12965
|
const flags = Object.keys(env).flatMap((k) => ["-e", k]);
|
|
12955
12966
|
return this.engine(["run", "--rm", "--label", DOCKER_LABEL_OWNER, "-v", `${this.s.volume}:${VOLUME_ROOT}`, ...extra, ...flags, "--entrypoint", "sh", image, "-c", script, "sh", ...args], { ...process.env, ...env });
|
|
@@ -30742,6 +30753,8 @@ watermark: ${state.watermark()}
|
|
|
30742
30753
|
try {
|
|
30743
30754
|
const missing = unmirroredRepos(sandboxCacheRepos(route2, cfg.ship), await new SandboxCache(cacheSettings).list());
|
|
30744
30755
|
for (const r of missing) problems.push({ severity: "attention", kind: "sandbox_cache_unmirrored", route: route2.route, message: `${r} has no mirror in the cache volume ${cacheSettings.volume}, so sandboxed runs cannot clone it`, remedy: "see `crew sandbox cache` for the last refresh failure" });
|
|
30756
|
+
const labeled = await new SandboxCache(cacheSettings).volumeWorkspace();
|
|
30757
|
+
if (labeled !== null && labeled !== cacheSettings.workspace) problems.push({ severity: "blocker", kind: "sandbox_cache_workspace_mismatch", route: route2.route, message: `the cache volume ${cacheSettings.volume} is labeled for OpenShell workspace "${labeled}" but sandboxes are created in "${cacheSettings.workspace}", so the gateway refuses to mount it`, remedy: "run `crew sandbox cache --reset` to recreate the volume with the right label" });
|
|
30745
30758
|
} catch {
|
|
30746
30759
|
}
|
|
30747
30760
|
}
|
package/package.json
CHANGED