@archme/cli 0.12.0 → 0.12.2

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 CHANGED
@@ -9967,7 +9967,6 @@ var init_install = __esm({
9967
9967
  "ARCHME_SANDBOX_PROJECTS",
9968
9968
  "ARCHME_SANDBOX_RUNTIME",
9969
9969
  "ARCHME_SANDBOX_IMAGE",
9970
- "ARCHME_SANDBOX_SLOTS",
9971
9970
  "ARCHME_SANDBOX_BOX_MEMORY_MIB",
9972
9971
  "ARCHME_SANDBOX_VOLUME_GIB",
9973
9972
  "ARCHME_SANDBOX_MAX_MODEL_REQUESTS",
@@ -18110,7 +18109,7 @@ function expandHome(p, home2) {
18110
18109
  if (p.startsWith("~/")) return join20(home2, p.slice(2));
18111
18110
  return p;
18112
18111
  }
18113
- function readSandboxSettings(env, home2 = homedir6(), shippedImage = () => null) {
18112
+ function readSandboxSettings(env, concurrency, home2 = homedir6(), shippedImage = () => null) {
18114
18113
  const modeRaw = (env.ARCHME_SANDBOX ?? "").trim().toLowerCase() || "off";
18115
18114
  if (modeRaw !== "off" && modeRaw !== "shadow" && modeRaw !== "required") {
18116
18115
  throw new SandboxSettingsError(`ARCHME_SANDBOX must be off, shadow or required (got "${env.ARCHME_SANDBOX}")`);
@@ -18120,7 +18119,7 @@ function readSandboxSettings(env, home2 = homedir6(), shippedImage = () => null)
18120
18119
  projects: /* @__PURE__ */ new Set(),
18121
18120
  runtime: "apple-container",
18122
18121
  image: "",
18123
- slots: SANDBOX_DEFAULTS.slots,
18122
+ slots: concurrency,
18124
18123
  boxMemoryMiB: SANDBOX_DEFAULTS.boxMemoryMiB,
18125
18124
  boxCpus: SANDBOX_DEFAULTS.boxCpus,
18126
18125
  volumeGiB: SANDBOX_DEFAULTS.volumeGiB,
@@ -18133,6 +18132,14 @@ function readSandboxSettings(env, home2 = homedir6(), shippedImage = () => null)
18133
18132
  "ARCHME_SANDBOX=required needs network confinement (pf + the GitHub gatekeeper, step 19.3), which this release does not have; use ARCHME_SANDBOX=shadow"
18134
18133
  );
18135
18134
  }
18135
+ if (!Number.isInteger(concurrency)) {
18136
+ throw new SandboxSettingsError(`MAX_CONCURRENT_JOBS must be a whole number (got ${concurrency})`);
18137
+ }
18138
+ if (concurrency > MAX_SLOTS) {
18139
+ throw new SandboxSettingsError(
18140
+ `the sandbox supports at most ${MAX_SLOTS} concurrent jobs, but MAX_CONCURRENT_JOBS is ${concurrency}; lower MAX_CONCURRENT_JOBS to ${MAX_SLOTS} or less, or set ARCHME_SANDBOX=off`
18141
+ );
18142
+ }
18136
18143
  const runtime = (env.ARCHME_SANDBOX_RUNTIME ?? "").trim() || "apple-container";
18137
18144
  if (runtime !== "apple-container") {
18138
18145
  throw new SandboxSettingsError(`ARCHME_SANDBOX_RUNTIME must be apple-container (got "${runtime}")`);
@@ -18153,16 +18160,13 @@ function readSandboxSettings(env, home2 = homedir6(), shippedImage = () => null)
18153
18160
  const projects = new Set(
18154
18161
  (env.ARCHME_SANDBOX_PROJECTS ?? "").split(",").map((s) => s.trim()).filter(Boolean)
18155
18162
  );
18156
- if (projects.size === 0) {
18157
- throw new SandboxSettingsError("ARCHME_SANDBOX=shadow needs ARCHME_SANDBOX_PROJECTS (comma-separated project ids)");
18158
- }
18159
18163
  const tokenRaw = (env.ARCHME_SANDBOX_CLAUDE_TOKEN_FILE ?? "").trim();
18160
18164
  return {
18161
18165
  mode,
18162
18166
  projects,
18163
18167
  runtime: "apple-container",
18164
18168
  image,
18165
- slots: intEnv(env, "ARCHME_SANDBOX_SLOTS", SANDBOX_DEFAULTS.slots, { min: 1, max: MAX_SLOTS }),
18169
+ slots: concurrency,
18166
18170
  boxMemoryMiB: intEnv(env, "ARCHME_SANDBOX_BOX_MEMORY_MIB", SANDBOX_DEFAULTS.boxMemoryMiB, {
18167
18171
  min: SANDBOX_DEFAULTS.minBoxMemoryMiB
18168
18172
  }),
@@ -18175,7 +18179,7 @@ function readSandboxSettings(env, home2 = homedir6(), shippedImage = () => null)
18175
18179
  function shouldSandbox(settings, job, { isLocalRepo }) {
18176
18180
  if (settings.mode === "off") return { boxed: false, reason: "mode_off" };
18177
18181
  if (job.job_kind === "digest") return { boxed: false, reason: "digest" };
18178
- if (settings.mode === "shadow" && !settings.projects.has(job.project_id)) {
18182
+ if (settings.mode === "shadow" && settings.projects.size > 0 && !settings.projects.has(job.project_id)) {
18179
18183
  return { boxed: false, reason: "project_not_enrolled" };
18180
18184
  }
18181
18185
  if (isLocalRepo) return { boxed: false, reason: "local_repo" };
@@ -18193,7 +18197,6 @@ var init_setting = __esm({
18193
18197
  }
18194
18198
  };
18195
18199
  SANDBOX_DEFAULTS = {
18196
- slots: 2,
18197
18200
  boxMemoryMiB: 2048,
18198
18201
  boxCpus: 2,
18199
18202
  volumeGiB: 8,
@@ -21942,7 +21945,7 @@ async function runDaemon() {
21942
21945
  console.log(` max concurrent jobs: ${MAX_CONCURRENT_JOBS}`);
21943
21946
  let sandboxSettings;
21944
21947
  try {
21945
- sandboxSettings = readSandboxSettings(process.env, void 0, () => readShippedImage());
21948
+ sandboxSettings = readSandboxSettings(process.env, MAX_CONCURRENT_JOBS, void 0, () => readShippedImage());
21946
21949
  } catch (err4) {
21947
21950
  if (!(err4 instanceof SandboxSettingsError)) throw err4;
21948
21951
  console.error(err4.message);
@@ -21954,7 +21957,10 @@ async function runDaemon() {
21954
21957
  }
21955
21958
  exitDaemon(1);
21956
21959
  }
21957
- console.log(` sandbox: ${sandboxSettings.mode}${sandboxSettings.mode === "shadow" ? ` (projects: ${[...sandboxSettings.projects].join(", ")}; ${sandboxSettings.slots} slot(s))` : ""}`);
21960
+ if (process.env.ARCHME_SANDBOX_SLOTS !== void 0) {
21961
+ console.log(" ARCHME_SANDBOX_SLOTS is no longer read; sandbox slots follow MAX_CONCURRENT_JOBS");
21962
+ }
21963
+ console.log(` sandbox: ${sandboxSettings.mode}${sandboxSettings.mode === "shadow" ? ` (projects: ${sandboxSettings.projects.size ? [...sandboxSettings.projects].join(", ") : "all"}; ${sandboxSettings.slots} slot(s))` : ""}`);
21958
21964
  const bearerCfg = {
21959
21965
  supabaseUrl: SUPABASE_URL,
21960
21966
  anonKey: SUPABASE_ANON_KEY,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archme/cli",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "description": "Map your codebase into a living architecture diagram: run `archme init` in a repo to scan it, `archme daemon start` to keep it current on every commit.",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "image": "ghcr.io/architectme/archme-job",
3
- "digest": "sha256:3fdadf0491e1b3c684731c07cde23c9fe02e7d434505523eb1f2d88609af44ed"
3
+ "digest": "sha256:473c98e945f5825d49df4f1a1c8c384e24133182ac200d87d3161309816aaef3"
4
4
  }