@appchy/jarvis 0.1.61 → 0.1.62

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/bin.js CHANGED
@@ -126,7 +126,7 @@ function register(program) {
126
126
 
127
127
  // src/commands/init.ts
128
128
  import { execSync as execSync4 } from "child_process";
129
- import { createInterface as createInterface2 } from "readline";
129
+ import { createInterface as createInterface3 } from "readline";
130
130
  import fs10 from "fs";
131
131
  import os6 from "os";
132
132
  import path10 from "path";
@@ -1228,8 +1228,10 @@ function sleep(ms) {
1228
1228
 
1229
1229
  // src/graph/graphify.ts
1230
1230
  import { spawnSync } from "child_process";
1231
+ import { accessSync, constants } from "fs";
1231
1232
  import { homedir } from "os";
1232
- import { delimiter, dirname, join } from "path";
1233
+ import { delimiter, join } from "path";
1234
+ import { createInterface as createInterface2 } from "readline";
1233
1235
  var BIN = "graphify";
1234
1236
  var PACKAGE = "graphifyy";
1235
1237
  var UV = "uv";
@@ -1244,11 +1246,20 @@ function runnable(bin, spawn3) {
1244
1246
  const probe = spawn3(bin, ["--help"], { stdio: "ignore" });
1245
1247
  return probe.error?.code !== "ENOENT";
1246
1248
  }
1247
- function locate(bin, spawn3) {
1249
+ function isExecutable(path22) {
1250
+ try {
1251
+ accessSync(path22, constants.X_OK);
1252
+ return true;
1253
+ } catch {
1254
+ return false;
1255
+ }
1256
+ }
1257
+ function locate(bin, options) {
1258
+ const spawn3 = options.spawn ?? spawnSync;
1259
+ const executable = options.executable ?? isExecutable;
1248
1260
  if (runnable(bin, spawn3)) return { command: bin, strayDir: null };
1249
1261
  for (const dir of TOOL_DIRS) {
1250
- const candidate = join(dir, bin);
1251
- if (runnable(candidate, spawn3)) return { command: candidate, strayDir: dir };
1262
+ if (executable(join(dir, bin))) return { command: join(dir, bin), strayDir: dir };
1252
1263
  }
1253
1264
  return { command: null, strayDir: null };
1254
1265
  }
@@ -1256,31 +1267,44 @@ function reachInto(dir) {
1256
1267
  process.env.PATH = `${dir}${delimiter}${process.env.PATH ?? ""}`;
1257
1268
  }
1258
1269
  function resolveGraphify(options = {}) {
1259
- const spawn3 = options.spawn ?? spawnSync;
1260
- const tool = locate(BIN, spawn3);
1261
- const uv = locate(UV, spawn3);
1270
+ const tool = locate(BIN, options);
1262
1271
  return {
1263
1272
  onPath: tool.command !== null && tool.strayDir === null,
1264
- strayPath: tool.strayDir ? join(tool.strayDir, BIN) : null,
1265
- uv: uv.command
1273
+ strayDir: tool.strayDir
1266
1274
  };
1267
1275
  }
1276
+ function findUv(options = {}) {
1277
+ return locate(UV, options).command;
1278
+ }
1279
+ async function confirmAtTerminal(req) {
1280
+ if (!process.stdin.isTTY) return false;
1281
+ const question = req.needsUv ? ` Install ${BIN}, and ${UV} (from ${UV_INSTALLER}) which installs it? [Y/n] ` : ` Install ${BIN} now with ${UV}? [Y/n] `;
1282
+ const rl = createInterface2({ input: process.stdin, output: process.stderr });
1283
+ const answer = await new Promise((resolve10) => {
1284
+ rl.question(question, (input) => resolve10(input.trim().toLowerCase()));
1285
+ });
1286
+ rl.close();
1287
+ return answer === "" || answer === "y" || answer === "yes";
1288
+ }
1268
1289
  function installGraphify(req, options = {}) {
1269
1290
  const spawn3 = options.spawn ?? spawnSync;
1270
1291
  const install = spawn3(req.uv, ["tool", "install", PACKAGE], { stdio: "inherit" });
1271
1292
  if (install.status !== 0) {
1272
1293
  return {
1273
1294
  installed: false,
1274
- strayPath: null,
1295
+ strayDir: null,
1275
1296
  problem: `\`${req.uv} tool install ${PACKAGE}\` did not succeed. Run it by hand to see why.`
1276
1297
  };
1277
1298
  }
1278
- const after = locate(BIN, spawn3);
1279
- return {
1280
- installed: true,
1281
- strayPath: after.strayDir ? join(after.strayDir, BIN) : null,
1282
- problem: null
1283
- };
1299
+ const after = locate(BIN, options);
1300
+ if (after.command === null) {
1301
+ return {
1302
+ installed: false,
1303
+ strayDir: null,
1304
+ problem: `\`${req.uv} tool install ${PACKAGE}\` reported success, but nothing here can run ${BIN}. Ask uv where it put it: \`${req.uv} tool dir --bin\`.`
1305
+ };
1306
+ }
1307
+ return { installed: true, strayDir: after.strayDir, problem: null };
1284
1308
  }
1285
1309
  function installUv(options = {}) {
1286
1310
  const spawn3 = options.spawn ?? spawnSync;
@@ -1296,40 +1320,57 @@ function installUv(options = {}) {
1296
1320
  if (ran.status !== 0) {
1297
1321
  return { uv: null, problem: `the uv installer did not succeed. See ${UV_INSTALLER}.` };
1298
1322
  }
1299
- const after = locate(UV, spawn3);
1323
+ const after = locate(UV, options);
1300
1324
  if (after.command === null) {
1301
1325
  return { uv: null, problem: `uv installed but nothing here can run it. See ${UV_INSTALLER}.` };
1302
1326
  }
1303
1327
  if (after.strayDir) reachInto(after.strayDir);
1304
1328
  return { uv: after.command, problem: null };
1305
1329
  }
1306
- function ensureGraphify(options = {}) {
1330
+ async function ensureGraphify(options = {}) {
1307
1331
  const state2 = resolveGraphify(options);
1308
1332
  if (state2.onPath) return;
1309
- if (state2.strayPath) {
1310
- const dir = dirname(state2.strayPath);
1311
- reachInto(dir);
1333
+ if (state2.strayDir) {
1334
+ reachInto(state2.strayDir);
1312
1335
  process.stderr.write(
1313
- `[data] found ${BIN} in ${dir} \u2014 using it for this build.
1336
+ `[data] found ${BIN} in ${state2.strayDir} \u2014 using it for this build.
1314
1337
  [data] add that directory to your PATH to stop this being a surprise.
1315
1338
  `
1316
1339
  );
1317
1340
  return;
1318
1341
  }
1319
- if (!state2.uv) {
1342
+ const found = findUv(options);
1343
+ process.stderr.write(
1344
+ found ? `[data] ${BIN} is needed to read this repo's code and is not installed.
1345
+ ` : `[data] ${BIN} is needed to read this repo's code and is not installed, and neither is
1346
+ [data] \`uv\`, which installs it.
1347
+ `
1348
+ );
1349
+ const confirm3 = options.confirm ?? confirmAtTerminal;
1350
+ if (!await confirm3({ needsUv: found === null })) {
1320
1351
  process.stderr.write(
1321
- `[data] ${BIN} is needed to read this repo's code and is not installed, and neither is \`uv\`,
1322
- [data] which installs it. Install uv (https://docs.astral.sh/uv/), then re-run this build \u2014
1323
- [data] or run \`jarvis init\`, which offers to install both. Building the rest of the map anyway.
1352
+ found ? `[data] left alone. \`uv tool install ${PACKAGE}\` adds it. Building the rest of the map anyway.
1353
+ ` : `[data] left alone. Install uv (https://docs.astral.sh/uv/), then \`uv tool install ${PACKAGE}\`.
1354
+ [data] Building the rest of the map anyway.
1324
1355
  `
1325
1356
  );
1326
1357
  return;
1327
1358
  }
1328
- process.stderr.write(
1329
- `[data] ${BIN} is not installed \u2014 installing it with \`uv tool install ${PACKAGE}\`.
1330
- `
1331
- );
1332
- const installed = installGraphify({ uv: state2.uv }, options);
1359
+ let uv = found;
1360
+ if (uv === null) {
1361
+ process.stderr.write(`[data] installing uv \u2026
1362
+ `);
1363
+ const gotUv = installUv(options);
1364
+ if (!gotUv.uv) {
1365
+ process.stderr.write(`[data] ${gotUv.problem} Building the rest of the map anyway.
1366
+ `);
1367
+ return;
1368
+ }
1369
+ uv = gotUv.uv;
1370
+ }
1371
+ process.stderr.write(`[data] installing ${BIN} with \`uv tool install ${PACKAGE}\`.
1372
+ `);
1373
+ const installed = installGraphify({ uv }, options);
1333
1374
  if (!installed.installed) {
1334
1375
  process.stderr.write(
1335
1376
  `[data] ${installed.problem}
@@ -1338,9 +1379,9 @@ function ensureGraphify(options = {}) {
1338
1379
  );
1339
1380
  return;
1340
1381
  }
1341
- if (installed.strayPath) reachInto(dirname(installed.strayPath));
1382
+ if (installed.strayDir) reachInto(installed.strayDir);
1342
1383
  process.stderr.write(
1343
- installed.strayPath ? `[data] ${BIN} installed to ${dirname(installed.strayPath)}, which is not on your PATH. Add it there.
1384
+ installed.strayDir ? `[data] ${BIN} installed to ${installed.strayDir}, which is not on your PATH. Add it there.
1344
1385
  ` : `[data] ${BIN} installed.
1345
1386
  `
1346
1387
  );
@@ -2294,29 +2335,28 @@ async function setUpMapTool(prompts) {
2294
2335
  console.log(" graphify is ready \u2713 this machine can build a map\n");
2295
2336
  return;
2296
2337
  }
2297
- if (state2.strayPath) {
2338
+ if (state2.strayDir) {
2298
2339
  console.log(
2299
2340
  ` graphify is INSTALLED but not on PATH \u2014 it is at
2300
- ${state2.strayPath}, and your shell cannot see it.
2301
- 'jarvis build graph' finds it anyway; nothing else will. Fix it for good:
2302
- uv tool update-shell (then open a new shell)
2303
- or for this shell only:
2304
- export PATH="${path10.dirname(state2.strayPath)}:$PATH"
2305
- `
2341
+ ${path10.join(state2.strayDir, "graphify")}, and your shell cannot see it.
2342
+ 'jarvis build graph' finds it anyway; nothing else will.
2343
+ ` + putItOnPath(state2.strayDir)
2306
2344
  );
2307
2345
  return;
2308
2346
  }
2347
+ const uv = findUv();
2348
+ const needsUv = uv === null;
2309
2349
  console.log(
2310
- state2.uv ? " graphify is not installed, so this machine cannot build a map yet." : " graphify is not installed, and neither is uv, which installs it."
2350
+ needsUv ? " graphify is not installed, and neither is uv, which installs it." : " graphify is not installed, so this machine cannot build a map yet."
2311
2351
  );
2312
- if (!await prompts.confirmGraphifyInstall({ needsUv: state2.uv === null })) {
2352
+ if (!await prompts.confirmGraphifyInstall({ needsUv })) {
2313
2353
  console.log(
2314
- state2.uv ? " left alone. Install it whenever: uv tool install graphifyy\n" : " left alone. Install uv (https://docs.astral.sh/uv/), then:\n uv tool install graphifyy\n"
2354
+ needsUv ? " left alone. Install uv (https://docs.astral.sh/uv/), then:\n uv tool install graphifyy\n" : " left alone. Install it whenever: uv tool install graphifyy\n"
2315
2355
  );
2316
2356
  return;
2317
2357
  }
2318
- let uv = state2.uv;
2319
- if (!uv) {
2358
+ let installer = uv;
2359
+ if (installer === null) {
2320
2360
  console.log(" installing uv \u2026");
2321
2361
  const gotUv = installUv();
2322
2362
  if (!gotUv.uv) {
@@ -2325,21 +2365,27 @@ async function setUpMapTool(prompts) {
2325
2365
  `);
2326
2366
  return;
2327
2367
  }
2328
- uv = gotUv.uv;
2368
+ installer = gotUv.uv;
2329
2369
  }
2330
2370
  console.log(" installing graphify \u2026");
2331
- const installed = installGraphify({ uv });
2371
+ const installed = installGraphify({ uv: installer });
2332
2372
  if (!installed.installed) {
2333
2373
  console.log(` ${installed.problem}
2334
2374
  `);
2335
2375
  return;
2336
2376
  }
2337
2377
  console.log(
2338
- installed.strayPath ? ` installed \u2713 \u2014 at ${installed.strayPath}, which your shell cannot see.
2339
- Put it where it can: uv tool update-shell (then open a new shell)
2340
- ` : " installed \u2713 this machine can build a map\n"
2378
+ installed.strayDir ? ` installed \u2713 \u2014 into ${installed.strayDir}, which your shell cannot see.
2379
+ ` + putItOnPath(installed.strayDir) : " installed \u2713 this machine can build a map\n"
2341
2380
  );
2342
2381
  }
2382
+ function putItOnPath(dir) {
2383
+ return ` Fix it for good:
2384
+ uv tool update-shell (then open a new shell)
2385
+ or for this shell only:
2386
+ export PATH="${dir}:$PATH"
2387
+ `;
2388
+ }
2343
2389
  function reportLocalOnly() {
2344
2390
  console.log(" \u2714 Done. This machine works in any repo that has a work/ tree:");
2345
2391
  console.log(" the board, the map, the session block, the rules that arrive on edit,");
@@ -2463,7 +2509,7 @@ function rootsEqual(a, b) {
2463
2509
  return true;
2464
2510
  }
2465
2511
  async function readlineQuestion2(question) {
2466
- const rl = createInterface2({ input: process.stdin, output: process.stdout });
2512
+ const rl = createInterface3({ input: process.stdin, output: process.stdout });
2467
2513
  return new Promise((resolve10) => {
2468
2514
  rl.question(question, (input) => {
2469
2515
  rl.close();
@@ -2532,15 +2578,9 @@ function readLocalRoots() {
2532
2578
  }
2533
2579
  function defaultPrompts() {
2534
2580
  return {
2535
- // With nothing at the other end of stdin the answer is no, never a hang and never a silent
2536
- // yes: a scripted setup must not block on a question, and must not install software on a
2537
- // machine where nobody was there to agree to it.
2538
- async confirmGraphifyInstall(req) {
2539
- if (!process.stdin.isTTY) return false;
2540
- const question = req.needsUv ? " Install both now? uv comes from https://astral.sh/uv/install.sh [Y/n] " : " Install it now with uv? [Y/n] ";
2541
- const answer = (await readlineQuestion2(question)).trim().toLowerCase();
2542
- return answer === "" || answer === "y" || answer === "yes";
2543
- },
2581
+ // The same question a build asks, asked the same way including taking a stdin nobody is
2582
+ // holding as a no, so a scripted setup neither blocks nor installs unattended.
2583
+ confirmGraphifyInstall: confirmAtTerminal,
2544
2584
  async pickRoots(candidates) {
2545
2585
  const savedDefaults = candidates.filter((c) => c.saved).map((c) => c.path);
2546
2586
  const defaults = savedDefaults.length > 0 ? savedDefaults : candidates.filter((c) => c.exists).map((c) => c.path);
@@ -2552,7 +2592,7 @@ function defaultPrompts() {
2552
2592
  };
2553
2593
  }
2554
2594
  async function promptList(question, fallback) {
2555
- const rl = createInterface2({ input: process.stdin, output: process.stdout });
2595
+ const rl = createInterface3({ input: process.stdin, output: process.stdout });
2556
2596
  const answer = await new Promise((resolve10) => {
2557
2597
  rl.question(question, (input) => resolve10(input.trim()));
2558
2598
  });
@@ -2600,7 +2640,7 @@ async function runPair() {
2600
2640
  }
2601
2641
 
2602
2642
  // src/commands/unpair.ts
2603
- import { createInterface as createInterface3 } from "readline";
2643
+ import { createInterface as createInterface4 } from "readline";
2604
2644
 
2605
2645
  // src/mcp.ts
2606
2646
  import { execFile } from "child_process";
@@ -2707,7 +2747,7 @@ function register5(program) {
2707
2747
  });
2708
2748
  }
2709
2749
  async function confirm(question) {
2710
- const rl = createInterface3({ input: process.stdin, output: process.stdout });
2750
+ const rl = createInterface4({ input: process.stdin, output: process.stdout });
2711
2751
  const answer = await new Promise((resolve10) => {
2712
2752
  rl.question(question, (input) => resolve10(input.trim()));
2713
2753
  });
@@ -2882,10 +2922,10 @@ function publish(ctx, channel, payload2) {
2882
2922
 
2883
2923
  // src/graph/repo.ts
2884
2924
  import { homedir as homedir2 } from "os";
2885
- import { dirname as dirname2, resolve } from "path";
2925
+ import { dirname, resolve } from "path";
2886
2926
  import { fileURLToPath } from "url";
2887
2927
  function resolveVendor() {
2888
- process.env["JARVIS_DATA_VENDOR"] ??= resolve(dirname2(fileURLToPath(import.meta.url)), "data");
2928
+ process.env["JARVIS_DATA_VENDOR"] ??= resolve(dirname(fileURLToPath(import.meta.url)), "data");
2889
2929
  return process.env["JARVIS_DATA_VENDOR"];
2890
2930
  }
2891
2931
  function resolveRepo(repo) {
@@ -2908,7 +2948,7 @@ import { chmodSync, existsSync as existsSync3, readFileSync as readFileSync2, re
2908
2948
  import { createRequire } from "module";
2909
2949
  import { randomUUID } from "crypto";
2910
2950
  import { homedir as homedir3 } from "os";
2911
- import { dirname as dirname3, join as join2 } from "path";
2951
+ import { dirname as dirname2, join as join2 } from "path";
2912
2952
  import { promisify as promisify2 } from "util";
2913
2953
  var run2 = promisify2(execFile2);
2914
2954
  var require2 = createRequire(import.meta.url);
@@ -2957,7 +2997,7 @@ function ensureSpawnHelperIsExecutable() {
2957
2997
  try {
2958
2998
  const entry = require2.resolve("node-pty");
2959
2999
  const helper = join2(
2960
- dirname3(entry),
3000
+ dirname2(entry),
2961
3001
  "..",
2962
3002
  "prebuilds",
2963
3003
  `${process.platform}-${process.arch}`,
@@ -4989,17 +5029,17 @@ async function createWorkItem2(ctx, req, options) {
4989
5029
  // src/harness.ts
4990
5030
  import { spawnSync as spawnSync2 } from "child_process";
4991
5031
  import { existsSync as existsSync4 } from "fs";
4992
- import { dirname as dirname4, join as join5 } from "path";
5032
+ import { dirname as dirname3, join as join5 } from "path";
4993
5033
  import { fileURLToPath as fileURLToPath2 } from "url";
4994
5034
  var ENTRY = join5("harness", "work.py");
4995
5035
  var INTERPRETERS = ["python3", "python"];
4996
5036
  var OLDEST = [3, 9];
4997
5037
  var INSTALLED = ["jarvis", "work"];
4998
5038
  function payload() {
4999
- let dir = dirname4(fileURLToPath2(import.meta.url));
5039
+ let dir = dirname3(fileURLToPath2(import.meta.url));
5000
5040
  for (let up = 0; up < 6; up++) {
5001
5041
  if (existsSync4(join5(dir, ENTRY))) return join5(dir, ENTRY);
5002
- const parent = dirname4(dir);
5042
+ const parent = dirname3(dir);
5003
5043
  if (parent === dir) break;
5004
5044
  dir = parent;
5005
5045
  }
@@ -6091,13 +6131,13 @@ function edgeMatchesConfidence(edge, backendName, confidence) {
6091
6131
  // ../../packages/data/src/config.ts
6092
6132
  import { existsSync as existsSync5, readFileSync as readFileSync4 } from "fs";
6093
6133
  import { readFile as readFile4 } from "fs/promises";
6094
- import { dirname as dirname6, resolve as resolve4 } from "path";
6134
+ import { dirname as dirname5, resolve as resolve4 } from "path";
6095
6135
  import { fileURLToPath as fileURLToPath3 } from "url";
6096
6136
  import { createJiti } from "jiti";
6097
6137
 
6098
6138
  // ../../packages/data/src/persistences/local.ts
6099
6139
  import { mkdir, readFile as readFile3, writeFile } from "fs/promises";
6100
- import { dirname as dirname5, join as join7, resolve as resolve3 } from "path";
6140
+ import { dirname as dirname4, join as join7, resolve as resolve3 } from "path";
6101
6141
  function localFiles(options = {}) {
6102
6142
  const root = options.root ?? ".data";
6103
6143
  const rel = {
@@ -6123,7 +6163,7 @@ function localFiles(options = {}) {
6123
6163
  },
6124
6164
  save: async (ctx, key, bytes) => {
6125
6165
  const path22 = pathOf(ctx, key);
6126
- await mkdir(dirname5(path22), { recursive: true });
6166
+ await mkdir(dirname4(path22), { recursive: true });
6127
6167
  await writeFile(path22, bytes, "utf8");
6128
6168
  },
6129
6169
  locate: (ctx, key) => pathOf(ctx, key)
@@ -6153,7 +6193,7 @@ async function loadConfig2(cwd) {
6153
6193
  };
6154
6194
  }
6155
6195
  }
6156
- const parent = dirname6(dir);
6196
+ const parent = dirname5(dir);
6157
6197
  if (parent === dir) break;
6158
6198
  dir = parent;
6159
6199
  }
@@ -6169,10 +6209,10 @@ async function importConfig(path22) {
6169
6209
  }
6170
6210
  var PACKAGE_NAME = "@jarvis/data";
6171
6211
  function packageRoot() {
6172
- let dir = dirname6(fileURLToPath3(import.meta.url));
6212
+ let dir = dirname5(fileURLToPath3(import.meta.url));
6173
6213
  for (; ; ) {
6174
6214
  if (existsSync5(resolve4(dir, "package.json"))) return dir;
6175
- const parent = dirname6(dir);
6215
+ const parent = dirname5(dir);
6176
6216
  if (parent === dir) return dir;
6177
6217
  dir = parent;
6178
6218
  }
@@ -10077,7 +10117,7 @@ import { createRequire as createRequire2 } from "module";
10077
10117
  var _require = createRequire2(import.meta.url);
10078
10118
  var VERSION2 = _require("../package.json").version ?? "0.0.0";
10079
10119
  var IS_DEV = String(_require("../package.json").name ?? "").endsWith("-dev");
10080
- var SHA = "f9a4c4a";
10120
+ var SHA = "f9de50c";
10081
10121
  var BUILT = "2026-09-09";
10082
10122
  var BUILD = SHA ?? "source";
10083
10123
  var BUILD_LABEL = `${SHA ? `${VERSION2} (${SHA}${BUILT ? ` ${BUILT}` : ""})` : `${VERSION2} (source)`}${IS_DEV ? " \u2014 development build" : ""}`;
@@ -10931,7 +10971,7 @@ function register13(program) {
10931
10971
  // src/commands/uninstall.ts
10932
10972
  import fs17 from "fs";
10933
10973
  import path18 from "path";
10934
- import { createInterface as createInterface4 } from "readline";
10974
+ import { createInterface as createInterface5 } from "readline";
10935
10975
  function register14(program) {
10936
10976
  program.command("uninstall").description("Stop the agent, remove the OS service, and wipe local config + identity").option("--keep-data", "Skip the data-wipe prompt; preserve skills/prompts/cache/settings").option("--purge", "Skip the prompt and wipe ALL local data (skills, prompts, cache, settings)").action(async (opts) => {
10937
10977
  try {
@@ -10984,7 +11024,7 @@ function removeDir(p) {
10984
11024
  }
10985
11025
  }
10986
11026
  function confirm2(prompt) {
10987
- const rl = createInterface4({ input: process.stdin, output: process.stdout });
11027
+ const rl = createInterface5({ input: process.stdin, output: process.stdout });
10988
11028
  return new Promise((resolve10) => {
10989
11029
  rl.question(prompt, (answer) => {
10990
11030
  rl.close();
@@ -11107,7 +11147,7 @@ function register17(program) {
11107
11147
 
11108
11148
  // src/graph/build.ts
11109
11149
  import { mkdirSync as mkdirSync2, readFileSync as readFileSync6, rmSync, statSync as statSync3, writeFileSync as writeFileSync3 } from "fs";
11110
- import { dirname as dirname7, resolve as resolve8 } from "path";
11150
+ import { dirname as dirname6, resolve as resolve8 } from "path";
11111
11151
 
11112
11152
  // src/graph/ratchet.ts
11113
11153
  import { execFileSync as execFileSync3 } from "child_process";
@@ -11240,7 +11280,7 @@ async function runBuild(cwd, argv = []) {
11240
11280
  }
11241
11281
  async function build(cwd, gate = false) {
11242
11282
  const config2 = await loadConfig2(cwd);
11243
- if (config2.backend?.name === "graphify") ensureGraphify();
11283
+ if (config2.backend?.name === "graphify") await ensureGraphify();
11244
11284
  const { graph: graph2, diagnostics, ledger } = await buildGraph(config2);
11245
11285
  const findings = await runEnforcers(config2, graph2);
11246
11286
  const full = graph2.toJSON();
@@ -11273,7 +11313,8 @@ ${formatLedger(ledger)}
11273
11313
  const report2 = ratchet(readBaseline(config2.repoRoot), [...diagnostics, ...findings]);
11274
11314
  process.stdout.write(`${describe(report2, config2.repoRoot)}
11275
11315
  `);
11276
- if (report2.passed) writeBaseline(config2.repoRoot, tightened(readBaseline(config2.repoRoot), report2));
11316
+ if (report2.passed)
11317
+ writeBaseline(config2.repoRoot, tightened(readBaseline(config2.repoRoot), report2));
11277
11318
  if (!report2.passed) return 1;
11278
11319
  }
11279
11320
  return errors > 0 ? 1 : 0;
@@ -11282,7 +11323,7 @@ var DEFAULT_STALE_MS = 10 * 60 * 1e3;
11282
11323
  function acquireBuildLock(repoRoot, options = {}) {
11283
11324
  const staleMs = options.staleMs ?? DEFAULT_STALE_MS;
11284
11325
  const lockPath = options.lockPath ?? resolve8(repoRoot, ".data", "build.lock");
11285
- mkdirSync2(dirname7(lockPath), { recursive: true });
11326
+ mkdirSync2(dirname6(lockPath), { recursive: true });
11286
11327
  const stamp = () => writeFileSync3(lockPath, `${process.pid}
11287
11328
  `, { flag: "wx" });
11288
11329
  try {
@@ -12113,7 +12154,7 @@ import { basename as basename3 } from "path";
12113
12154
  // src/ui/server.ts
12114
12155
  import { createServer as createServer2 } from "http";
12115
12156
  import { readFile as readFile7 } from "fs/promises";
12116
- import { basename as basename2, dirname as dirname8, extname, join as join9, resolve as resolve9 } from "path";
12157
+ import { basename as basename2, dirname as dirname7, extname, join as join9, resolve as resolve9 } from "path";
12117
12158
  import { fileURLToPath as fileURLToPath4 } from "url";
12118
12159
 
12119
12160
  // src/ui/machine.ts
@@ -12140,7 +12181,7 @@ async function readMachine(req) {
12140
12181
  }
12141
12182
 
12142
12183
  // src/ui/server.ts
12143
- var ASSETS = resolve9(dirname8(fileURLToPath4(import.meta.url)), "ui");
12184
+ var ASSETS = resolve9(dirname7(fileURLToPath4(import.meta.url)), "ui");
12144
12185
  var TYPES = {
12145
12186
  ".html": "text/html; charset=utf-8",
12146
12187
  ".js": "text/javascript; charset=utf-8",