loki-mode 11.17.49 → 11.17.51

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.
Files changed (71) hide show
  1. package/SKILL.md +2 -2
  2. package/VERSION +1 -1
  3. package/autonomy/lib/secure-scan.py +85 -5
  4. package/dashboard/__init__.py +1 -1
  5. package/docs/CLI-REFERENCE.md +1 -1
  6. package/docs/INSTALLATION.md +1 -1
  7. package/docs/v10/BOARD.md +30 -0
  8. package/docs/v10/DEPS.md +1 -0
  9. package/docs/v10/PROGRESS.md +6 -0
  10. package/loki-ts/dist/loki.js +1170 -1154
  11. package/mcp/__init__.py +1 -1
  12. package/package.json +2 -2
  13. package/packages/control-plane/dist/server.js +146 -106
  14. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  15. package/web-app/dist/assets/{AdminPage-s0UfQ54A.js → AdminPage-CDSL6lzQ.js} +1 -1
  16. package/web-app/dist/assets/{Avatar-C65GqVWB.js → Avatar-BG02zRCM.js} +1 -1
  17. package/web-app/dist/assets/{Badge-Bx6KyeF8.js → Badge-DZAAUjis.js} +1 -1
  18. package/web-app/dist/assets/{Button-Gp5vTh3P.js → Button-BXHri3Bg.js} +1 -1
  19. package/web-app/dist/assets/{CockpitPage-BknRMDid.js → CockpitPage-DzSQmo7Q.js} +1 -1
  20. package/web-app/dist/assets/{ComparePage-c-mU2XHA.js → ComparePage-Bo_nMN8K.js} +1 -1
  21. package/web-app/dist/assets/{ErrorBoundary-ngcvdCD8.js → ErrorBoundary-CTQU5X7k.js} +1 -1
  22. package/web-app/dist/assets/{EvidenceReceiptPanel-fKH6e1EW.js → EvidenceReceiptPanel-C4lQ99Wp.js} +1 -1
  23. package/web-app/dist/assets/{GitHubIssuesPanel-BpZ2v9n0.js → GitHubIssuesPanel-DkKxlaTB.js} +1 -1
  24. package/web-app/dist/assets/{GitHubPRsPanel-C6D5PLlR.js → GitHubPRsPanel-Br02sXlA.js} +1 -1
  25. package/web-app/dist/assets/{HomePage-BykPt2x_.js → HomePage-DjXhkhFt.js} +2 -2
  26. package/web-app/dist/assets/{LoginPage-CXNSVFwK.js → LoginPage-C4xmRk7J.js} +1 -1
  27. package/web-app/dist/assets/{MagicPage-BPm8lvGR.js → MagicPage-D_r38Yde.js} +1 -1
  28. package/web-app/dist/assets/{MetricsPage-B-Zue4zV.js → MetricsPage-B9Y1p-FE.js} +1 -1
  29. package/web-app/dist/assets/{NotFoundPage-CfbRFDzs.js → NotFoundPage-BTNNHLAC.js} +1 -1
  30. package/web-app/dist/assets/{ProjectPage-BJJ5ilR5.js → ProjectPage-DUUDqjbc.js} +3 -3
  31. package/web-app/dist/assets/{ProjectsPage-BihWTnjx.js → ProjectsPage-CxX842kz.js} +1 -1
  32. package/web-app/dist/assets/{SettingsPage-DEVFSLVd.js → SettingsPage-IUQeYuCB.js} +1 -1
  33. package/web-app/dist/assets/{ShowcasePage-BBkoZFps.js → ShowcasePage-DGYLnI8h.js} +1 -1
  34. package/web-app/dist/assets/{SystemSettingsPage-CzOE74Q7.js → SystemSettingsPage-Dl8x3Woj.js} +1 -1
  35. package/web-app/dist/assets/{TeamsPage-BdPX6dgE.js → TeamsPage-CJ4TPxjB.js} +1 -1
  36. package/web-app/dist/assets/{TemplatesPage-C8mVITpx.js → TemplatesPage-O8LCjJtq.js} +1 -1
  37. package/web-app/dist/assets/{TerminalOutput-Bc00RcJc.js → TerminalOutput-DGTWYoJB.js} +1 -1
  38. package/web-app/dist/assets/{activity-CDLuOW9_.js → activity-CNqE-ixm.js} +1 -1
  39. package/web-app/dist/assets/{bell-025wj1sV.js → bell-BEi_il9M.js} +1 -1
  40. package/web-app/dist/assets/{bot-DWh-OnmY.js → bot-CkFZ33Q-.js} +1 -1
  41. package/web-app/dist/assets/{check-l7LspX4l.js → check-C_qLIaF-.js} +1 -1
  42. package/web-app/dist/assets/{chevron-left-DKO1-YmL.js → chevron-left-B5XC_KnW.js} +1 -1
  43. package/web-app/dist/assets/{circle-alert-BfV2uDVQ.js → circle-alert-64ZS4s9j.js} +1 -1
  44. package/web-app/dist/assets/{clock-CCakP4hk.js → clock-BHdB3bZI.js} +1 -1
  45. package/web-app/dist/assets/{cloud-CaMXUXfG.js → cloud-dnsbryqT.js} +1 -1
  46. package/web-app/dist/assets/{code-xml-DUvRZwB9.js → code-xml-iLJ48no4.js} +1 -1
  47. package/web-app/dist/assets/{database-BHuS_k85.js → database-D2uC8Rxd.js} +1 -1
  48. package/web-app/dist/assets/{dollar-sign-BhXGrkPP.js → dollar-sign-B47Mg178.js} +1 -1
  49. package/web-app/dist/assets/{file-code-corner-A7mPiq0J.js → file-code-corner-Dlp_xnun.js} +1 -1
  50. package/web-app/dist/assets/{file-plus-CGbNX6r_.js → file-plus-VfERZYg5.js} +1 -1
  51. package/web-app/dist/assets/{globe-bPOnAxns.js → globe-BBduzaTh.js} +1 -1
  52. package/web-app/dist/assets/{hammer-BJg7R73E.js → hammer-QSASdDEK.js} +1 -1
  53. package/web-app/dist/assets/{index-DXT0GsX7.js → index-C0weGbNK.js} +3 -3
  54. package/web-app/dist/assets/{layers-CTHygTS7.js → layers-BAfPZ8HU.js} +1 -1
  55. package/web-app/dist/assets/{loader-circle-DKdXgG0q.js → loader-circle-DXqBgYWH.js} +1 -1
  56. package/web-app/dist/assets/{lock-053N_MGE.js → lock-LCsOKAUi.js} +1 -1
  57. package/web-app/dist/assets/{package-SA20Nj5k.js → package-BLUwVAd0.js} +1 -1
  58. package/web-app/dist/assets/{plus-D6Ay8g2_.js → plus-LHz4MkJH.js} +1 -1
  59. package/web-app/dist/assets/{refresh-cw-BWJ5g4al.js → refresh-cw-CnGPNK6c.js} +1 -1
  60. package/web-app/dist/assets/{rotate-ccw-FpwQ4jBk.js → rotate-ccw-D7EWVgA8.js} +1 -1
  61. package/web-app/dist/assets/{scroll-text-BfSXM3oJ.js → scroll-text-vVVQ3jTP.js} +1 -1
  62. package/web-app/dist/assets/{server-CWiRm4Ss.js → server-CVmxaWog.js} +1 -1
  63. package/web-app/dist/assets/{shield-alert-nFmFAjOa.js → shield-alert-DCrN0N7j.js} +1 -1
  64. package/web-app/dist/assets/{thumbs-up-DRcA4ke1.js → thumbs-up-BVtgLRAB.js} +1 -1
  65. package/web-app/dist/assets/{trash-2-ClXTj6YH.js → trash-2-BmSBvfQk.js} +1 -1
  66. package/web-app/dist/assets/{trending-down-Dd_CU85r.js → trending-down-BIIzpX-l.js} +1 -1
  67. package/web-app/dist/assets/{trending-up-Csbq5ve6.js → trending-up-D8z8AEPW.js} +1 -1
  68. package/web-app/dist/assets/{upload-D2aKAKqW.js → upload-50BgK2yG.js} +1 -1
  69. package/web-app/dist/assets/{usePolling-Cn5Z9_7V.js → usePolling-B33v_P8Z.js} +1 -1
  70. package/web-app/dist/assets/{user-Bt-F2IL3.js → user-DWe9X5rS.js} +1 -1
  71. package/web-app/dist/index.html +1 -1
@@ -160,6 +160,11 @@ var init_redact = __esm(() => {
160
160
  [/eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g, "[REDACTED:JWT]"],
161
161
  [/\bSG\.[A-Za-z0-9_-]{16,}\.[A-Za-z0-9_-]{16,}/g, "[REDACTED:SENDGRID_KEY]"],
162
162
  [/\bSK[0-9a-f]{32}\b/g, "[REDACTED:TWILIO_KEY]"],
163
+ [/\bpypi-AgEI[A-Za-z0-9_-]{50,}/g, "[REDACTED:PYPI_TOKEN]"],
164
+ [/\bshp(?:at|ca|pa|ss)_[a-f0-9]{32}\b/g, "[REDACTED:SHOPIFY_TOKEN]"],
165
+ [/\bPMAK-[a-f0-9]{24}-[a-f0-9]{34}\b/g, "[REDACTED:POSTMAN_KEY]"],
166
+ [/\bdapi[a-f0-9]{32}(?:-\d)?\b/g, "[REDACTED:DATABRICKS_TOKEN]"],
167
+ [/\bkey-[a-f0-9]{32}\b/g, "[REDACTED:MAILGUN_KEY]"],
163
168
  [/\bdckr_pat_[A-Za-z0-9_-]{20,}/g, "[REDACTED:DOCKER_TOKEN]"],
164
169
  [/\bdop_v1_[a-f0-9]{64}\b/g, "[REDACTED:DIGITALOCEAN_TOKEN]"],
165
170
  [/\bya29\.[A-Za-z0-9_-]{20,}/g, "[REDACTED:GOOGLE_OAUTH_TOKEN]"],
@@ -7615,8 +7620,8 @@ var init_paths = __esm(() => {
7615
7620
 
7616
7621
  // ../../loki-ts/src/engine10/cache.ts
7617
7622
  import { createHash as createHash6 } from "crypto";
7618
- import { existsSync as existsSync15, mkdirSync as mkdirSync5, readFileSync as readFileSync18, writeFileSync as writeFileSync8 } from "fs";
7619
- import { resolve as resolve8 } from "path";
7623
+ import { existsSync as existsSync15, mkdirSync as mkdirSync5, readdirSync as readdirSync9, readFileSync as readFileSync18, statSync as statSync12, unlinkSync as unlinkSync3, writeFileSync as writeFileSync8 } from "fs";
7624
+ import { basename as basename8, resolve as resolve8 } from "path";
7620
7625
  function repoKey(originUrl, repoDir) {
7621
7626
  const basis = originUrl && originUrl.trim() !== "" ? originUrl : resolve8(repoDir);
7622
7627
  return createHash6("sha256").update(basis).digest("hex");
@@ -7799,12 +7804,12 @@ var init_price_table = __esm(() => {
7799
7804
  });
7800
7805
 
7801
7806
  // ../../loki-ts/src/providers/provider_cost.ts
7802
- import { existsSync as existsSync16, mkdirSync as mkdirSync6, readdirSync as readdirSync9, readFileSync as readFileSync20, renameSync as renameSync4, writeFileSync as writeFileSync9 } from "fs";
7807
+ import { existsSync as existsSync16, mkdirSync as mkdirSync6, readdirSync as readdirSync10, readFileSync as readFileSync20, renameSync as renameSync4, writeFileSync as writeFileSync9 } from "fs";
7803
7808
  import { dirname as dirname7, join as join27 } from "path";
7804
7809
  function withArchivedCosts(lokiRoot, ids, keep = () => true) {
7805
7810
  let files = [];
7806
7811
  try {
7807
- files = readdirSync9(join27(lokiRoot, "metrics"));
7812
+ files = readdirSync10(join27(lokiRoot, "metrics"));
7808
7813
  } catch {}
7809
7814
  return [...new Set([...ids, ...ids.flatMap((id) => files.filter((f) => f.startsWith(`result-cost-${id}-q`) && f.endsWith(".json")).map((f) => f.slice("result-cost-".length, -".json".length)).filter(keep))])];
7810
7815
  }
@@ -7869,7 +7874,7 @@ function routerMode(env = process.env) {
7869
7874
  var routerEnabled = (env = process.env) => routerMode(env) === "on";
7870
7875
 
7871
7876
  // ../../loki-ts/src/engine10/cost.ts
7872
- import { readdirSync as readdirSync10, readFileSync as readFileSync21 } from "fs";
7877
+ import { readdirSync as readdirSync11, readFileSync as readFileSync21 } from "fs";
7873
7878
  import { join as join28 } from "path";
7874
7879
  function routerTelemetryOn(env = process.env) {
7875
7880
  return routerEnabled(env);
@@ -8030,8 +8035,8 @@ import {
8030
8035
  readSync as readSync4,
8031
8036
  renameSync as renameSync5,
8032
8037
  rmSync as rmSync5,
8033
- statSync as statSync12,
8034
- unlinkSync as unlinkSync3,
8038
+ statSync as statSync13,
8039
+ unlinkSync as unlinkSync4,
8035
8040
  writeFileSync as writeFileSync11,
8036
8041
  writeSync as writeSync3
8037
8042
  } from "fs";
@@ -8069,13 +8074,23 @@ function atomicWriteJson(target, data) {
8069
8074
  function tmpPathFor(target) {
8070
8075
  return `${target}.tmp.${process.pid}.${++_tmpCounter}`;
8071
8076
  }
8077
+ function atomicWriteText(target, body, opts = {}) {
8078
+ if (opts.durable === false) {
8079
+ mkdirSync8(dirname8(target), { recursive: true });
8080
+ const tmp = tmpPathFor(target);
8081
+ writeFileSync11(tmp, body);
8082
+ renameSync5(tmp, target);
8083
+ return;
8084
+ }
8085
+ durableWriteThenRename(target, body);
8086
+ }
8072
8087
  var _tmpCounter = 0, _appendChains;
8073
8088
  var init_atomic = __esm(() => {
8074
8089
  _appendChains = new Map;
8075
8090
  });
8076
8091
 
8077
8092
  // ../../loki-ts/src/runner/budget.ts
8078
- import { existsSync as existsSync17, mkdirSync as mkdirSync9, readdirSync as readdirSync11, readFileSync as readFileSync22, writeFileSync as writeFileSync12 } from "fs";
8093
+ import { existsSync as existsSync17, mkdirSync as mkdirSync9, readdirSync as readdirSync12, readFileSync as readFileSync22, writeFileSync as writeFileSync12 } from "fs";
8079
8094
  import { dirname as dirname9, join as join29, resolve as resolve10 } from "path";
8080
8095
  import { fileURLToPath as fileURLToPath2 } from "url";
8081
8096
  function loadDefaultMaxCostUsd(dataDirs = [["..", "..", "data"], ["..", "data"]]) {
@@ -8234,7 +8249,7 @@ var init_types = __esm(() => {
8234
8249
  var init_decision = () => {};
8235
8250
 
8236
8251
  // ../../loki-ts/src/project_model/schema.ts
8237
- import { existsSync as existsSync18, lstatSync as lstatSync6, realpathSync as realpathSync14, statSync as statSync13 } from "fs";
8252
+ import { existsSync as existsSync18, lstatSync as lstatSync6, realpathSync as realpathSync14, statSync as statSync14 } from "fs";
8238
8253
  import { isAbsolute, join as join30, normalize, sep as sep9 } from "path";
8239
8254
  function safeRel(p) {
8240
8255
  const n2 = normalize(p.trim()).split(sep9).join("/").replace(/\/$/, "");
@@ -8258,7 +8273,7 @@ function checkCitation(repoDir, raw2) {
8258
8273
  if (rel === null)
8259
8274
  return `citation "${raw2}" is not a repo-relative path`;
8260
8275
  const abs = join30(repoDir, rel);
8261
- if (!existsSync18(abs) || !statSync13(abs).isFile() || !insideRepo(repoDir, rel))
8276
+ if (!existsSync18(abs) || !statSync14(abs).isFile() || !insideRepo(repoDir, rel))
8262
8277
  return `citation "${raw2}" names a file that does not exist`;
8263
8278
  return null;
8264
8279
  }
@@ -8298,7 +8313,7 @@ function checkDir(repoDir, v, where, errs) {
8298
8313
  return ".";
8299
8314
  }
8300
8315
  const abs = join30(repoDir, rel);
8301
- if (!existsSync18(abs) || !statSync13(abs).isDirectory() || !insideRepo(repoDir, rel))
8316
+ if (!existsSync18(abs) || !statSync14(abs).isDirectory() || !insideRepo(repoDir, rel))
8302
8317
  errs.push(`${where}: directory "${rel}" does not exist`);
8303
8318
  return rel;
8304
8319
  }
@@ -8657,9 +8672,9 @@ var init_model_rank = __esm(() => {
8657
8672
 
8658
8673
  // ../../loki-ts/src/engine10/sizing.ts
8659
8674
  import { existsSync as existsSync20, readFileSync as readFileSync25 } from "fs";
8660
- import { basename as basename8 } from "path";
8675
+ import { basename as basename9 } from "path";
8661
8676
  function namedFiles(task, map) {
8662
- return (map?.files ?? []).filter((f) => task.toLowerCase().includes(basename8(f).toLowerCase()));
8677
+ return (map?.files ?? []).filter((f) => task.toLowerCase().includes(basename9(f).toLowerCase()));
8663
8678
  }
8664
8679
  function sizeTask(task, map, tests) {
8665
8680
  const named = namedFiles(task, map).length;
@@ -8696,9 +8711,27 @@ function hasRelevantTests(task, map, tests, impacted) {
8696
8711
  likely.push(...speedLikelyFiles(task, map));
8697
8712
  return likely.length > 0 && impacted(tests, likely).length > 0;
8698
8713
  }
8699
- var LARGE_NAMED_FILES = 8, smallMaxChars = (env = process.env) => Number(env.LOKI_E10_SMALL_MAX_CHARS) > 0 ? Number(env.LOKI_E10_SMALL_MAX_CHARS) : 600, smallTaskPath = (size, relevantTests) => size === "small" && relevantTests ? "lean" : "wall", knob = (v, words) => words.includes((v ?? "").toLowerCase()), planMode = (env = process.env) => knob(env.LOKI_E10_PLAN, ["0", "off", "never", "false"]) ? "never" : knob(env.LOKI_E10_PLAN, ["1", "on", "always", "true"]) ? "always" : "auto", wallEnabled = (env = process.env) => !knob(env.LOKI_E10_WALL, ["0", "off", "false"]), wallLimitS = (size, env = process.env) => {
8700
- const n2 = Number(env.LOKI_E10_WALL_LIMIT_S);
8701
- return Number.isFinite(n2) && n2 > 0 ? Math.min(300, n2) : size === "small" ? 90 : 180;
8714
+ var LARGE_NAMED_FILES = 8, noted, noteOnce = (name, raw2, why) => {
8715
+ if (raw2 === undefined || !raw2.trim() || noted.has(name + raw2))
8716
+ return;
8717
+ noted.add(name + raw2);
8718
+ process.stderr.write(`loki: ${name}="${raw2}" ${why}
8719
+ `);
8720
+ }, smallMaxChars = (env = process.env) => {
8721
+ const n2 = Number(env.LOKI_E10_SMALL_MAX_CHARS);
8722
+ if (n2 > 0)
8723
+ return n2;
8724
+ noteOnce("LOKI_E10_SMALL_MAX_CHARS", env.LOKI_E10_SMALL_MAX_CHARS, "is not a positive number; using 600");
8725
+ return 600;
8726
+ }, smallTaskPath = (size, relevantTests) => size === "small" && relevantTests ? "lean" : "wall", knob = (v, words) => words.includes((v ?? "").toLowerCase()), planMode = (env = process.env) => knob(env.LOKI_E10_PLAN, ["0", "off", "never", "false"]) ? "never" : knob(env.LOKI_E10_PLAN, ["1", "on", "always", "true"]) ? "always" : "auto", wallEnabled = (env = process.env) => !knob(env.LOKI_E10_WALL, ["0", "off", "false"]), wallLimitS = (size, env = process.env) => {
8727
+ const raw2 = env.LOKI_E10_WALL_LIMIT_S, n2 = Number(raw2), dflt = size === "small" ? 90 : 180;
8728
+ if (Number.isFinite(n2) && n2 > 0) {
8729
+ if (n2 > 300)
8730
+ noteOnce("LOKI_E10_WALL_LIMIT_S", raw2, "exceeds the 300s maximum; using 300");
8731
+ return Math.min(300, n2);
8732
+ }
8733
+ noteOnce("LOKI_E10_WALL_LIMIT_S", raw2, `is not a positive number; using ${dflt}`);
8734
+ return dflt;
8702
8735
  }, resolveModelAlias, wallModel = (env = process.env) => resolveModelAlias(env.LOKI_E10_WALL_TIER || "sonnet"), wallFirstModel = (size, env = process.env) => {
8703
8736
  if (knob(env.LOKI_E10_WALL_FIRST, ["0", "off", "false"]) || env.LOKI_E10_WALL_TIER || env.LOKI_MODEL_OVERRIDE || env.LOKI_E10_WALL_CONCURRENT === "1")
8704
8737
  return wallModel(env);
@@ -8709,6 +8742,7 @@ var init_sizing = __esm(() => {
8709
8742
  init_lean_select();
8710
8743
  init_claude_model();
8711
8744
  init_model_rank();
8745
+ noted = new Set;
8712
8746
  resolveModelAlias = resolveClaudeModel;
8713
8747
  });
8714
8748
 
@@ -8870,9 +8904,9 @@ var init_scope = __esm(() => {
8870
8904
  });
8871
8905
 
8872
8906
  // ../../loki-ts/src/util/test_file_text.ts
8873
- import { basename as basename9 } from "path";
8907
+ import { basename as basename10 } from "path";
8874
8908
  function isTestFile(rel) {
8875
- const name = basename9(rel);
8909
+ const name = basename10(rel);
8876
8910
  return JS_TEST_RE.test(name) || PY_TEST_RE.test(name) || GO_TEST_RE.test(name);
8877
8911
  }
8878
8912
  var JS_TEST_RE, PY_TEST_RE, GO_TEST_RE;
@@ -8883,8 +8917,8 @@ var init_test_file_text = __esm(() => {
8883
8917
  });
8884
8918
 
8885
8919
  // ../../loki-ts/src/engine10/testmap.ts
8886
- import { existsSync as existsSync22, lstatSync as lstatSync8, readdirSync as readdirSync12, readFileSync as readFileSync27, realpathSync as realpathSync15 } from "fs";
8887
- import { basename as basename10, extname, isAbsolute as isAbsolute2, join as join36, relative, sep as sep10 } from "path";
8920
+ import { existsSync as existsSync22, lstatSync as lstatSync8, readdirSync as readdirSync13, readFileSync as readFileSync27, realpathSync as realpathSync15 } from "fs";
8921
+ import { basename as basename11, extname, isAbsolute as isAbsolute2, join as join36, relative, sep as sep10 } from "path";
8888
8922
  function projectInterpreter(root) {
8889
8923
  const ve = process.env["VIRTUAL_ENV"], inRepo = (p) => {
8890
8924
  try {
@@ -8921,7 +8955,7 @@ var init_testmap = __esm(() => {
8921
8955
 
8922
8956
  // ../../loki-ts/src/util/check_result.ts
8923
8957
  import { existsSync as existsSync23, mkdirSync as mkdirSync12, readFileSync as readFileSync28, realpathSync as realpathSync16, renameSync as renameSync7, writeFileSync as writeFileSync15 } from "fs";
8924
- import { basename as basename11, isAbsolute as isAbsolute3, join as join37 } from "path";
8958
+ import { basename as basename12, isAbsolute as isAbsolute3, join as join37 } from "path";
8925
8959
  function plainTestEnv(base = process.env) {
8926
8960
  const e = {};
8927
8961
  for (const [k, v] of Object.entries(tokenFreeEnv(base)))
@@ -8939,7 +8973,7 @@ function ran(raw2, path, ok) {
8939
8973
  if (blk) {
8940
8974
  const c = n2(blk, /(?:#|\u2139) pass (\d+)/) + n2(blk, /(?:#|\u2139) fail (\d+)/);
8941
8975
  const nm = out2.match(/^(?:ok \d+ - |\u2714 )(\S+\.[cm]?[jt]s)(?: \(|$)/m)?.[1];
8942
- return c === 1 && nm && (!path || basename11(nm) === basename11(path)) ? 0 : c;
8976
+ return c === 1 && nm && (!path || basename12(nm) === basename12(path)) ? 0 : c;
8943
8977
  }
8944
8978
  const cg = cargoTrailer(out2);
8945
8979
  if (cg.length)
@@ -9030,16 +9064,16 @@ function goRunner(cmd, args) {
9030
9064
  let k = 0;
9031
9065
  for (;k < t.length; k++) {
9032
9066
  const x = t[k];
9033
- if (/^[A-Za-z_]\w*=/.test(x) || /^(?:env|command|exec|time|nohup)$/.test(basename11(x)))
9067
+ if (/^[A-Za-z_]\w*=/.test(x) || /^(?:env|command|exec|time|nohup)$/.test(basename12(x)))
9034
9068
  continue;
9035
- if (/^-/.test(x) && k > 0 && basename11(t[k - 1]) === "env") {
9069
+ if (/^-/.test(x) && k > 0 && basename12(t[k - 1]) === "env") {
9036
9070
  if (x === "-u" || x === "-C" || x === "-S")
9037
9071
  k++;
9038
9072
  continue;
9039
9073
  }
9040
9074
  break;
9041
9075
  }
9042
- if (t[k] !== undefined && basename11(t[k]) === "go")
9076
+ if (t[k] !== undefined && basename12(t[k]) === "go")
9043
9077
  return { runner: "go" };
9044
9078
  }
9045
9079
  return {};
@@ -9471,7 +9505,7 @@ var init_check_result = __esm(() => {
9471
9505
 
9472
9506
  // ../../loki-ts/src/util/receipt_signer.ts
9473
9507
  import { createHash as createHash8, randomBytes as randomBytes3, createPrivateKey, createPublicKey as createPublicKey2, generateKeyPairSync, sign, verify as verify2 } from "crypto";
9474
- import { chmodSync as chmodSync4, linkSync, mkdirSync as mkdirSync13, readdirSync as readdirSync13, readFileSync as readFileSync29, renameSync as renameSync8, statSync as statSync14, unlinkSync as unlinkSync4, writeFileSync as writeFileSync16 } from "fs";
9508
+ import { chmodSync as chmodSync4, linkSync, mkdirSync as mkdirSync13, readdirSync as readdirSync14, readFileSync as readFileSync29, renameSync as renameSync8, statSync as statSync15, unlinkSync as unlinkSync5, writeFileSync as writeFileSync16 } from "fs";
9475
9509
  import { homedir as homedir8 } from "os";
9476
9510
  import { spawnSync as spawnSync2 } from "child_process";
9477
9511
  import { dirname as dirname12, join as join38 } from "path";
@@ -9500,7 +9534,7 @@ function loadSigningKey(generate = true) {
9500
9534
  pem = readFileSync29(file);
9501
9535
  if (!given) {
9502
9536
  for (const [f, m] of [[file, 384], [dirname12(file), 448]])
9503
- if (statSync14(f).mode & 63)
9537
+ if (statSync15(f).mode & 63)
9504
9538
  chmodSync4(f, m);
9505
9539
  }
9506
9540
  } catch (e) {
@@ -9518,7 +9552,7 @@ function loadSigningKey(generate = true) {
9518
9552
  if (l.code !== "EEXIST")
9519
9553
  throw l;
9520
9554
  } finally {
9521
- unlinkSync4(tmp);
9555
+ unlinkSync5(tmp);
9522
9556
  }
9523
9557
  pem = readFileSync29(file);
9524
9558
  }
@@ -10455,8 +10489,8 @@ var init_state = __esm(() => {
10455
10489
 
10456
10490
  // ../../loki-ts/src/runner/repo_profile.ts
10457
10491
  import { spawnSync as spawnSync3 } from "child_process";
10458
- import { existsSync as existsSync24, lstatSync as lstatSync10, readFileSync as readFileSync30, mkdirSync as mkdirSync14, readdirSync as readdirSync14, renameSync as renameSync9, rmSync as rmSync8, writeFileSync as writeFileSync17 } from "fs";
10459
- import { basename as basename12, join as join39, resolve as resolve13, isAbsolute as isAbsolute4 } from "path";
10492
+ import { existsSync as existsSync24, lstatSync as lstatSync10, readFileSync as readFileSync30, mkdirSync as mkdirSync14, readdirSync as readdirSync15, renameSync as renameSync9, rmSync as rmSync8, writeFileSync as writeFileSync17 } from "fs";
10493
+ import { basename as basename13, join as join39, resolve as resolve13, isAbsolute as isAbsolute4 } from "path";
10460
10494
  function detectFormatters(repoDir) {
10461
10495
  const out2 = [];
10462
10496
  const has = (...fs2) => fs2.some((f) => existsSync24(join39(repoDir, f)));
@@ -10468,7 +10502,7 @@ function detectFormatters(repoDir) {
10468
10502
  prettierKey = pj !== "" && "prettier" in JSON.parse(pj);
10469
10503
  } catch {}
10470
10504
  const local = join39(repoDir, "node_modules", ".bin", "prettier");
10471
- if ((prettierKey || readdirSync14(repoDir).some((f) => /^(\.prettierrc(\.[a-z0-9]+)?|prettier\.config\.[cm]?[jt]s)$/.test(f))) && existsSync24(local))
10505
+ if ((prettierKey || readdirSync15(repoDir).some((f) => /^(\.prettierrc(\.[a-z0-9]+)?|prettier\.config\.[cm]?[jt]s)$/.test(f))) && existsSync24(local))
10472
10506
  out2.push({ tool: "prettier", argv: [local, "--write"], exts: /\.(?:[cm]?[jt]sx?|json|css|scss|md|ya?ml|html)$/ });
10473
10507
  if (has("go.mod"))
10474
10508
  out2.push({ tool: "gofmt", argv: ["gofmt", "-w"], exts: /\.go$/ });
@@ -10634,9 +10668,9 @@ var init_context = __esm(() => {
10634
10668
  });
10635
10669
 
10636
10670
  // ../../loki-ts/src/util/steer.ts
10637
- import { appendFileSync as appendFileSync2, closeSync as closeSync8, constants as constants2, fstatSync as fstatSync6, readdirSync as readdirSync15, lstatSync as lstatSync11, mkdirSync as mkdirSync15, linkSync as linkSync2, openSync as openSync8, readFileSync as readFileSync31, readSync as readSync7, renameSync as renameSync10, statSync as statSync15, lutimesSync, rmSync as rmSync9, unlinkSync as unlinkSync5, writeFileSync as writeFileSync18, existsSync as existsSync25 } from "fs";
10671
+ import { appendFileSync as appendFileSync2, closeSync as closeSync8, constants as constants2, fstatSync as fstatSync6, readdirSync as readdirSync16, lstatSync as lstatSync11, mkdirSync as mkdirSync15, linkSync as linkSync2, openSync as openSync8, readFileSync as readFileSync31, readSync as readSync7, renameSync as renameSync10, statSync as statSync16, lutimesSync, rmSync as rmSync9, unlinkSync as unlinkSync6, writeFileSync as writeFileSync18, existsSync as existsSync25 } from "fs";
10638
10672
  import { createHash as createHash9, randomBytes as randomBytes4 } from "crypto";
10639
- import { basename as basename13, join as join40 } from "path";
10673
+ import { basename as basename14, join as join40 } from "path";
10640
10674
  function archiveTo(logs, prefix, src, link = linkSync2, onLinked) {
10641
10675
  for (let i = 0;; i++) {
10642
10676
  const name = i === 0 ? `${prefix}.md` : `${prefix}-${i}.md`;
@@ -10655,7 +10689,7 @@ function archiveTo(logs, prefix, src, link = linkSync2, onLinked) {
10655
10689
  }
10656
10690
  onLinked?.(name);
10657
10691
  try {
10658
- unlinkSync5(src);
10692
+ unlinkSync6(src);
10659
10693
  } catch {}
10660
10694
  return name;
10661
10695
  }
@@ -10664,11 +10698,11 @@ function orphanAlreadyArchived(logs, claim) {
10664
10698
  const c = lstatSync11(claim);
10665
10699
  if (!c.isFile())
10666
10700
  return false;
10667
- for (const a of readdirSync15(logs)) {
10701
+ for (const a of readdirSync16(logs)) {
10668
10702
  if (!/^human-input-.*\.md$/.test(a))
10669
10703
  continue;
10670
10704
  try {
10671
- const s = statSync15(join40(logs, a));
10705
+ const s = statSync16(join40(logs, a));
10672
10706
  if (s.ino !== c.ino || s.dev !== c.dev)
10673
10707
  continue;
10674
10708
  if (/^human-input-(ORPHAN|REJECTED)-/.test(a) || existsSync25(appliedMarker(logs, a)))
@@ -10680,7 +10714,7 @@ function orphanAlreadyArchived(logs, claim) {
10680
10714
  function sweepOrphans(logs, stamp2, unapplied, link, nowMs = Date.now()) {
10681
10715
  let names;
10682
10716
  try {
10683
- names = readdirSync15(logs);
10717
+ names = readdirSync16(logs);
10684
10718
  } catch {
10685
10719
  return;
10686
10720
  }
@@ -10688,7 +10722,7 @@ function sweepOrphans(logs, stamp2, unapplied, link, nowMs = Date.now()) {
10688
10722
  for (const n2 of names)
10689
10723
  if (n2.startsWith(".applied-") && !present.has(n2.slice(".applied-".length))) {
10690
10724
  try {
10691
- unlinkSync5(join40(logs, n2));
10725
+ unlinkSync6(join40(logs, n2));
10692
10726
  } catch {}
10693
10727
  }
10694
10728
  for (const n2 of names) {
@@ -10705,7 +10739,7 @@ function sweepOrphans(logs, stamp2, unapplied, link, nowMs = Date.now()) {
10705
10739
  if (alive) {
10706
10740
  let ageMs = 0;
10707
10741
  try {
10708
- ageMs = nowMs - statSync15(join40(logs, n2)).mtimeMs;
10742
+ ageMs = nowMs - statSync16(join40(logs, n2)).mtimeMs;
10709
10743
  } catch {
10710
10744
  continue;
10711
10745
  }
@@ -10714,7 +10748,7 @@ function sweepOrphans(logs, stamp2, unapplied, link, nowMs = Date.now()) {
10714
10748
  }
10715
10749
  try {
10716
10750
  if (orphanAlreadyArchived(logs, join40(logs, n2))) {
10717
- unlinkSync5(join40(logs, n2));
10751
+ unlinkSync6(join40(logs, n2));
10718
10752
  continue;
10719
10753
  }
10720
10754
  archiveTo(logs, `human-input-ORPHAN-${stamp2}`, join40(logs, n2), link);
@@ -10773,7 +10807,7 @@ function consumeSteer(repoDir, env = process.env, now2 = () => new Date, sink, h
10773
10807
  return reject("NOTFILE", "not a regular file");
10774
10808
  try {
10775
10809
  if (!lstatSync11(claimed, { throwIfNoEntry: false })?.isDirectory())
10776
- unlinkSync5(claimed);
10810
+ unlinkSync6(claimed);
10777
10811
  } catch {}
10778
10812
  claimed = "";
10779
10813
  unapplied("not a regular file");
@@ -10833,7 +10867,7 @@ function consumeSteer(repoDir, env = process.env, now2 = () => new Date, sink, h
10833
10867
  archiveTo(join40(repoDir, ".loki", "logs"), `human-input-${now2().toISOString().replace(/[-:]/g, "").replace(/\..*/, "")}`, claimed, hooks2?.link);
10834
10868
  unapplied("logs dir unwritable or file unreadable");
10835
10869
  } catch {
10836
- unapplied(`steer stranded at .loki/logs/${basename13(claimed)}`);
10870
+ unapplied(`steer stranded at .loki/logs/${basename14(claimed)}`);
10837
10871
  }
10838
10872
  } else
10839
10873
  try {
@@ -10918,7 +10952,7 @@ var init_steer = __esm(() => {
10918
10952
 
10919
10953
  // ../../loki-ts/src/util/run_outputs.ts
10920
10954
  import { createHash as createHash10 } from "crypto";
10921
- import { existsSync as existsSync26, mkdirSync as mkdirSync16, readdirSync as readdirSync16, readFileSync as readFileSync32, statSync as statSync16, writeFileSync as writeFileSync19 } from "fs";
10955
+ import { existsSync as existsSync26, mkdirSync as mkdirSync16, readdirSync as readdirSync17, readFileSync as readFileSync32, statSync as statSync17, writeFileSync as writeFileSync19 } from "fs";
10922
10956
  import { join as join41, resolve as resolve14 } from "path";
10923
10957
  function intentRevisionsBlock(revs) {
10924
10958
  const r = (revs ?? []).filter((r2) => r2.unapplied !== true).map(({ rev, source, actor, sha: sha2 }) => ({ rev, source, actor, sha: sha2 }));
@@ -11122,13 +11156,23 @@ var init_spec_file = __esm(() => {
11122
11156
  SPEC_DIR = join42(".loki", "specs");
11123
11157
  });
11124
11158
 
11125
- // ../../loki-ts/src/engine10/pr_body.ts
11159
+ // ../../loki-ts/src/util/reviewer_brief.ts
11126
11160
  function aiTrailers(i, env = process.env) {
11127
11161
  if (!markingOn(env))
11128
11162
  return [];
11129
11163
  return ["AI-Generated: true", `AI-Provider: ${clean2(i.provider)}`, `AI-Model: ${clean2(i.model)}`, `Loki-Receipt: ${clean2(i.receiptRel)}`];
11130
11164
  }
11131
- var markingOn = (env) => env["LOKI_AI_MARKING"] === "1", cleanFull = (v) => v.replace(/[\u0000-\u001f\u007f\u2028\u2029]+/g, " ").replace(/\s+/g, " ").trim(), clean2 = (v) => cleanFull(v).slice(0, 100) || "unknown";
11165
+ var markingOn = (env) => /^(1|true|yes)$/i.test((env["LOKI_AI_MARKING"] ?? "").trim()), cleanFull = (v) => v.replace(/[\u0000-\u001f\u007f\u2028\u2029]+/g, " ").replace(/\s+/g, " ").trim(), clean2 = (v) => cleanFull(v).slice(0, 100) || "unknown";
11166
+ var init_reviewer_brief = __esm(() => {
11167
+ init_repomap();
11168
+ init_testmap();
11169
+ init_safe_git();
11170
+ });
11171
+
11172
+ // ../../loki-ts/src/engine10/pr_body.ts
11173
+ var init_pr_body = __esm(() => {
11174
+ init_reviewer_brief();
11175
+ });
11132
11176
 
11133
11177
  // ../../loki-ts/src/util/run_cap.ts
11134
11178
  var MAX_SCOPE_BYTES;
@@ -11141,7 +11185,7 @@ var init_run_cap = __esm(() => {
11141
11185
  // ../../loki-ts/src/util/mutation_proof.ts
11142
11186
  import { existsSync as existsSync27, mkdirSync as mkdirSync17, mkdtempSync as mkdtempSync3, readFileSync as readFileSync34, rmSync as rmSync10, symlinkSync, writeFileSync as writeFileSync20 } from "fs";
11143
11187
  import { tmpdir as tmpdir4 } from "os";
11144
- import { basename as basename14, dirname as dirname13, isAbsolute as isAbsolute6, join as join43, relative as relative3 } from "path";
11188
+ import { basename as basename15, dirname as dirname13, isAbsolute as isAbsolute6, join as join43, relative as relative3 } from "path";
11145
11189
  function mutationProof(i) {
11146
11190
  const rels = i.wallFiles.map((f) => isAbsolute6(f.path) ? relative3(i.repoDir, f.path) : f.path);
11147
11191
  if (rels.length === 0)
@@ -11166,7 +11210,7 @@ function mutationProof(i) {
11166
11210
  if (add3.status !== 0)
11167
11211
  return np("could not create the base worktree");
11168
11212
  for (const rel of rels) {
11169
- const sealed = join43(i.runDir, "wall", basename14(rel)), src = existsSync27(sealed) ? sealed : join43(i.repoDir, rel);
11213
+ const sealed = join43(i.runDir, "wall", basename15(rel)), src = existsSync27(sealed) ? sealed : join43(i.repoDir, rel);
11170
11214
  if (!existsSync27(src))
11171
11215
  return np(`Wall file missing: ${rel}`);
11172
11216
  mkdirSync17(dirname13(join43(wt, rel)), { recursive: true });
@@ -11321,7 +11365,7 @@ var init_shell = __esm(() => {
11321
11365
  });
11322
11366
 
11323
11367
  // ../../loki-ts/src/util/python.ts
11324
- import { accessSync, constants as constants3, existsSync as existsSync28, mkdtempSync as mkdtempSync4, readFileSync as readFileSync35, realpathSync as realpathSync18, rmSync as rmSync11, statSync as statSync17 } from "fs";
11368
+ import { accessSync, constants as constants3, existsSync as existsSync28, mkdtempSync as mkdtempSync4, readFileSync as readFileSync35, realpathSync as realpathSync18, rmSync as rmSync11, statSync as statSync18 } from "fs";
11325
11369
  import { spawnSync as spawnSync4 } from "child_process";
11326
11370
  import { tmpdir as tmpdir5 } from "os";
11327
11371
  async function findPython3() {
@@ -11348,7 +11392,7 @@ function resolvePython3() {
11348
11392
  const cand = `${dir}/python3`;
11349
11393
  try {
11350
11394
  accessSync(cand, constants3.X_OK);
11351
- if (statSync17(cand).isFile())
11395
+ if (statSync18(cand).isFile())
11352
11396
  return cand;
11353
11397
  } catch {}
11354
11398
  }
@@ -11679,7 +11723,7 @@ var init_wall_manifest = __esm(() => {
11679
11723
 
11680
11724
  // ../../loki-ts/src/features/wall_manifest_wire.ts
11681
11725
  import { createHash as createHash12 } from "crypto";
11682
- import { basename as basename15, dirname as dirname14 } from "path";
11726
+ import { basename as basename16, dirname as dirname14 } from "path";
11683
11727
  function blobEntries(ls) {
11684
11728
  const out2 = [];
11685
11729
  for (const raw2 of ls.toString("latin1").split("\x00")) {
@@ -11709,12 +11753,12 @@ function wallManifestFor(repoDir, tree, task, env = process.env) {
11709
11753
  return null;
11710
11754
  const low = task.toLowerCase().replace(/\\/g, "/");
11711
11755
  const token = (n2) => new RegExp(`(?<![A-Za-z0-9_])${n2.toLowerCase().replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(?![A-Za-z0-9_])`).test(low);
11712
- const dirModule = (e) => /^(index|__init__|mod|main)\.[^.]+$/.test(basename15(e.path)) && e.path.includes("/") && token(dirname14(e.path));
11713
- const matched = all.filter((e) => SOURCE.test(e.path) && (token(basename15(e.path)) || token(e.path) || token(basename15(e.path).replace(/\.[^.]*$/, "")) || dirModule(e)));
11756
+ const dirModule = (e) => /^(index|__init__|mod|main)\.[^.]+$/.test(basename16(e.path)) && e.path.includes("/") && token(dirname14(e.path));
11757
+ const matched = all.filter((e) => SOURCE.test(e.path) && (token(basename16(e.path)) || token(e.path) || token(basename16(e.path).replace(/\.[^.]*$/, "")) || dirModule(e)));
11714
11758
  const spans = (p) => [...low.matchAll(new RegExp(`(?<![A-Za-z0-9_])${p.toLowerCase().replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(?![A-Za-z0-9_])`, "g"))].map((m) => [m.index, m.index + m[0].length]);
11715
11759
  const occ = new Map(matched.map((e) => [e, spans(e.path)]));
11716
11760
  const exact = (e) => occ.get(e).some(([s, t]) => !matched.some((o) => o !== e && o.path.length > e.path.length && occ.get(o).some(([s2, t2]) => s2 <= s && t <= t2)));
11717
- const byPath2 = matched.filter(exact).sort((a, b) => b.path.length - a.path.length), byBase = matched.filter((e) => !byPath2.includes(e) && token(basename15(e.path)));
11761
+ const byPath2 = matched.filter(exact).sort((a, b) => b.path.length - a.path.length), byBase = matched.filter((e) => !byPath2.includes(e) && token(basename16(e.path)));
11718
11762
  const named = [...byPath2, ...byBase, ...matched.filter((e) => !byPath2.includes(e) && !byBase.includes(e))].slice(0, MAX_NAMED);
11719
11763
  const tests = all.filter((e) => TESTISH.test(e.path)).slice(0, MAX_FILES), listed = tests.filter((e) => !SOURCE.test(e.path));
11720
11764
  const want = [...new Set([...all.filter((e) => CONFIG.test(e.path)), ...tests.filter((e) => SOURCE.test(e.path)), ...named])];
@@ -11773,7 +11817,7 @@ Example: test('name', () => { assert.strictEqual(fn(1), 2); }); Run: node --tes
11773
11817
  import { createHash as createHash13 } from "crypto";
11774
11818
  import { appendFileSync as appendFileSync3, copyFileSync as copyFileSync2, existsSync as existsSync29, mkdirSync as mkdirSync18, readFileSync as readFileSync36, rmSync as rmSync12, writeFileSync as writeFileSync21 } from "fs";
11775
11819
  import { tmpdir as tmpdir6 } from "os";
11776
- import { basename as basename16, join as join44, relative as relative4 } from "path";
11820
+ import { basename as basename17, join as join44, relative as relative4 } from "path";
11777
11821
  function wallHoldoutRatio(env = process.env) {
11778
11822
  if (env["LOKI_WALL_HOLDOUT"]?.trim() === "0")
11779
11823
  return 0;
@@ -11818,7 +11862,7 @@ function stageHoldout(dir, repoDir) {
11818
11862
  man = JSON.parse(readFileSync36(join44(dir, MANIFEST), "utf8"));
11819
11863
  } catch {}
11820
11864
  if (!man)
11821
- return { tests, missing: [`holdout store unreadable: ${basename16(dir)}`], cleanup: () => {} };
11865
+ return { tests, missing: [`holdout store unreadable: ${basename17(dir)}`], cleanup: () => {} };
11822
11866
  mkdirSync18(man.targetDir, { recursive: true });
11823
11867
  man.files.forEach((f, i) => {
11824
11868
  const src = join44(dir, f.name);
@@ -12249,9 +12293,9 @@ import { execFileSync as execFileSync3 } from "child_process";
12249
12293
  import { mkdtempSync as mkdtempSync5, readFileSync as readFileSync38, rmSync as rmSync13 } from "fs";
12250
12294
  import { tmpdir as tmpdir7 } from "os";
12251
12295
  import { join as join46 } from "path";
12252
- import { basename as basename17 } from "path";
12296
+ import { basename as basename18 } from "path";
12253
12297
  function classifyAssertDelta(inp) {
12254
- const f = basename17(inp.path);
12298
+ const f = basename18(inp.path);
12255
12299
  if (!/^(test_.*|.*_test)\.py$/.test(f))
12256
12300
  return WEAKENED;
12257
12301
  if (inp.headCounts.run !== inp.baseCounts.run || inp.headCounts.skipped !== inp.baseCounts.skipped)
@@ -12514,7 +12558,7 @@ var init_runner_errors = __esm(() => {
12514
12558
  import { spawnSync as spawnSync5 } from "child_process";
12515
12559
  import { mkdtempSync as mkdtempSync6, realpathSync as realpathSync19, rmSync as rmSync14 } from "fs";
12516
12560
  import { tmpdir as tmpdir8 } from "os";
12517
- import { basename as basename18, extname as extname2, join as join47 } from "path";
12561
+ import { basename as basename19, extname as extname2, join as join47 } from "path";
12518
12562
  function changedFilesNamed(out2, repoDir, changed) {
12519
12563
  return changed.filter((f) => {
12520
12564
  if (out2.includes(f) || out2.includes(join47(repoDir, f)))
@@ -12524,7 +12568,7 @@ function changedFilesNamed(out2, repoDir, changed) {
12524
12568
  return true;
12525
12569
  if (extname2(f) === ".go" && segs.length > 1 && suffixes(segs.slice(0, -1), 1).some((d) => new RegExp(`(?<=[\\w-])/${esc(d)}(?![\\w./-])`).test(out2)))
12526
12570
  return true;
12527
- const stem = basename18(f, extname2(f));
12571
+ const stem = basename19(f, extname2(f));
12528
12572
  if (stem.length < 2 || stem === "index" || stem === "__init__")
12529
12573
  return false;
12530
12574
  return new RegExp(`(?<![\\w-])${esc(stem)}(?![\\w-])`).test(out2);
@@ -12816,7 +12860,7 @@ app_runner_stop >/dev/null 2>&1
12816
12860
  });
12817
12861
 
12818
12862
  // ../../loki-ts/src/util/secure_scan.ts
12819
- import { existsSync as existsSync31, mkdirSync as mkdirSync20, mkdtempSync as mkdtempSync7, readFileSync as readFileSync40, realpathSync as realpathSync20, rmSync as rmSync15, statSync as statSync18, writeFileSync as writeFileSync23 } from "fs";
12863
+ import { existsSync as existsSync31, mkdirSync as mkdirSync20, mkdtempSync as mkdtempSync7, readFileSync as readFileSync40, realpathSync as realpathSync20, rmSync as rmSync15, statSync as statSync19, writeFileSync as writeFileSync23 } from "fs";
12820
12864
  import { tmpdir as tmpdir9 } from "os";
12821
12865
  import { dirname as dirname16, join as join50, resolve as resolve15, sep as sep11 } from "path";
12822
12866
  function fail(error) {
@@ -12992,7 +13036,7 @@ async function scanAddedLines(repoDir, opts = {}) {
12992
13036
  return fail("secure-scan: git ls-files failed");
12993
13037
  for (const p of untracked.split("\x00").filter(Boolean)) {
12994
13038
  try {
12995
- const st = statSync18(join50(repoDir, p));
13039
+ const st = statSync19(join50(repoDir, p));
12996
13040
  if (!st.isFile() || st.size > MAX_ADDED_FILE_BYTES)
12997
13041
  continue;
12998
13042
  const lines2 = new Map;
@@ -13060,13 +13104,6 @@ var init_secure_scan = __esm(() => {
13060
13104
  // ../../loki-ts/src/runner/retry_class.ts
13061
13105
  var init_retry_class = () => {};
13062
13106
 
13063
- // ../../loki-ts/src/util/reviewer_brief.ts
13064
- var init_reviewer_brief = __esm(() => {
13065
- init_repomap();
13066
- init_testmap();
13067
- init_safe_git();
13068
- });
13069
-
13070
13107
  // ../../loki-ts/src/version.ts
13071
13108
  var init_version = __esm(() => {
13072
13109
  init_paths();
@@ -13163,7 +13200,7 @@ var init_route_block = __esm(() => {
13163
13200
  // ../../loki-ts/src/features/visual_evidence.ts
13164
13201
  import { spawn as spawn7 } from "child_process";
13165
13202
  import { createHash as createHash14, randomBytes as randomBytes5 } from "crypto";
13166
- import { existsSync as existsSync32, lstatSync as lstatSync12, mkdirSync as mkdirSync21, readdirSync as readdirSync17, readFileSync as readFileSync41, writeFileSync as writeFileSync24 } from "fs";
13203
+ import { existsSync as existsSync32, lstatSync as lstatSync12, mkdirSync as mkdirSync21, readdirSync as readdirSync18, readFileSync as readFileSync41, writeFileSync as writeFileSync24 } from "fs";
13167
13204
  import { createServer } from "net";
13168
13205
  import { dirname as dirname17, isAbsolute as isAbsolute8, join as join51, normalize as normalize3, relative as relative6, sep as sep12 } from "path";
13169
13206
  function routeFor(file) {
@@ -13265,7 +13302,7 @@ async function recordE2eMedia(repoDir, runDir, relDir, base, routes, ms, signal)
13265
13302
  return { rels: [], skipped: "playwright e2e video and trace skipped: the run failed or timed out" };
13266
13303
  const rels = [];
13267
13304
  const walk = (d) => {
13268
- for (const e of readdirSync17(d, { withFileTypes: true })) {
13305
+ for (const e of readdirSync18(d, { withFileTypes: true })) {
13269
13306
  const full = join51(d, e.name);
13270
13307
  if (e.isDirectory())
13271
13308
  walk(full);
@@ -13519,6 +13556,7 @@ var init_pr = __esm(() => {
13519
13556
  init_hooks();
13520
13557
  init_reviewer_body();
13521
13558
  init_route_block();
13559
+ init_pr_body();
13522
13560
  init_visual_evidence();
13523
13561
  init_before_after();
13524
13562
  init_intent_card();
@@ -14245,9 +14283,9 @@ function runnerCmd(t, repoDir) {
14245
14283
  return [cmd, [...pre, "-m", "pytest", "-q", t.path], interpreter];
14246
14284
  }
14247
14285
  case "vitest":
14248
- return ["npx", ["vitest", "run", t.path]];
14286
+ return ["npx", ["--no-install", "vitest", "run", t.path]];
14249
14287
  case "jest":
14250
- return ["npx", ["jest", t.path]];
14288
+ return ["npx", ["--no-install", "jest", t.path]];
14251
14289
  case "bun":
14252
14290
  return ["bun", ["test", t.path]];
14253
14291
  case "node":
@@ -14411,10 +14449,10 @@ async function runLintChecks(ctx, changed, signal, checks, opts = {}) {
14411
14449
  for (const g of groupByPackage(api, ctx.repoDir, changed.filter((f) => /\.(ts|tsx|js|jsx)$/.test(f)))) {
14412
14450
  const sfx = g.root === "." ? "" : `:${g.root}`, co = g.root === "." ? opts : { ...opts, cwd: g.cwd };
14413
14451
  if (existsSync37(join57(g.cwd, "tsconfig.json")))
14414
- await runCheck(ctx, `lint:tsc${sfx}`, "npx", ["tsc", "--noEmit", "-p", "."], signal, checks, { ...co, kind: "static" });
14452
+ await runCheck(ctx, `lint:tsc${sfx}`, "npx", ["--no-install", "tsc", "--noEmit", "-p", "."], signal, checks, { ...co, kind: "static" });
14415
14453
  if (ESLINT_CONFIGS.some((f) => existsSync37(join57(g.cwd, f)))) {
14416
- const c = await runCheck(ctx, `lint:eslint${sfx}`, "npx", ["eslint", ...g.rel], signal, checks, { ...co, kind: "static" });
14417
- if (await excuseLint(ctx, signal, c, "eslint", "npx", ["eslint"], g.cwd, g.rel, co))
14454
+ const c = await runCheck(ctx, `lint:eslint${sfx}`, "npx", ["--no-install", "eslint", ...g.rel], signal, checks, { ...co, kind: "static" });
14455
+ if (await excuseLint(ctx, signal, c, "eslint", "npx", ["--no-install", "eslint"], g.cwd, g.rel, co))
14418
14456
  pre.push(c.name);
14419
14457
  }
14420
14458
  }
@@ -14593,7 +14631,7 @@ ${x}` : c.cmd };
14593
14631
  });
14594
14632
 
14595
14633
  // ../../loki-ts/src/project_model/conventions.ts
14596
- import { existsSync as existsSync38, readdirSync as readdirSync18, readFileSync as readFileSync45 } from "fs";
14634
+ import { existsSync as existsSync38, readdirSync as readdirSync19, readFileSync as readFileSync45 } from "fs";
14597
14635
  import { dirname as dirname22, join as join58 } from "path";
14598
14636
  function parseJsonc(text2) {
14599
14637
  let out2 = "", i = 0;
@@ -14635,7 +14673,7 @@ function moduleOf(file, depth = 0) {
14635
14673
  function readPackageConventions(pkgDir, runner = null) {
14636
14674
  let names = [];
14637
14675
  try {
14638
- names = readdirSync18(pkgDir).filter((f) => f.endsWith(".json")).sort((x, y) => x.length - y.length || x.localeCompare(y));
14676
+ names = readdirSync19(pkgDir).filter((f) => f.endsWith(".json")).sort((x, y) => x.length - y.length || x.localeCompare(y));
14639
14677
  } catch {
14640
14678
  return null;
14641
14679
  }
@@ -14679,7 +14717,7 @@ var init_conventions = () => {};
14679
14717
 
14680
14718
  // ../../loki-ts/src/engine10/stages/wall.ts
14681
14719
  import { spawnSync as spawnSync7 } from "child_process";
14682
- import { existsSync as existsSync39, mkdirSync as mkdirSync25, mkdtempSync as mkdtempSync11, readFileSync as readFileSync46, readdirSync as readdirSync19, rmSync as rmSync19, writeFileSync as writeFileSync28 } from "fs";
14720
+ import { existsSync as existsSync39, mkdirSync as mkdirSync25, mkdtempSync as mkdtempSync11, readFileSync as readFileSync46, readdirSync as readdirSync20, rmSync as rmSync19, writeFileSync as writeFileSync28 } from "fs";
14683
14721
  import { tmpdir as tmpdir12 } from "os";
14684
14722
  import { dirname as dirname23, join as join59, relative as relative8 } from "path";
14685
14723
 
@@ -14805,7 +14843,7 @@ async function wallAuthor(ctx, signal, retry) {
14805
14843
  rmSync19(cwd, { recursive: true, force: true });
14806
14844
  return done({ status: "failed", data: { iteration_ids: [iterationId], model }, reason: "wall session aborted, killed, or timed out", killed: true });
14807
14845
  }
14808
- const all = readdirSync19(cwd).filter((f) => f.startsWith(WALL_PREFIX)), held = stashHoldout({ runId: ctx.runId, repoDir: ctx.repoDir, srcDir: cwd, targetDir, names: all.filter((n2) => !conventionViolation(conv2, n2, readFileSync46(join59(cwd, n2), "utf8"))), runnerOf: (n2) => guessRunner(n2, runners) }), generated = all.filter((n2) => !held?.names.has(n2));
14846
+ const all = readdirSync20(cwd).filter((f) => f.startsWith(WALL_PREFIX)), held = stashHoldout({ runId: ctx.runId, repoDir: ctx.repoDir, srcDir: cwd, targetDir, names: all.filter((n2) => !conventionViolation(conv2, n2, readFileSync46(join59(cwd, n2), "utf8"))), runnerOf: (n2) => guessRunner(n2, runners) }), generated = all.filter((n2) => !held?.names.has(n2));
14809
14847
  const sealedDir = join59(ctx.runDir, "wall");
14810
14848
  if (generated.length > 0)
14811
14849
  mkdirSync25(sealedDir, { recursive: true });
@@ -14920,7 +14958,7 @@ var init_wall = __esm(() => {
14920
14958
  });
14921
14959
 
14922
14960
  // ../../loki-ts/src/e10ext/discard.ts
14923
- import { chmodSync as chmodSync5, closeSync as closeSync9, lstatSync as lstatSync15, mkdirSync as mkdirSync26, openSync as openSync9, readFileSync as readFileSync47, realpathSync as realpathSync23, rmdirSync, unlinkSync as unlinkSync6, writeFileSync as writeFileSync29 } from "fs";
14961
+ import { chmodSync as chmodSync5, closeSync as closeSync9, lstatSync as lstatSync15, mkdirSync as mkdirSync26, openSync as openSync9, readFileSync as readFileSync47, realpathSync as realpathSync23, rmdirSync, unlinkSync as unlinkSync7, writeFileSync as writeFileSync29 } from "fs";
14924
14962
  import { dirname as dirname24, join as join60, relative as relative9, sep as sep13 } from "path";
14925
14963
  function safeRestore(repoDir, f, want, mode) {
14926
14964
  const root = realpathSync23(repoDir), fp = join60(root, f), rel = relative9(root, dirname24(fp));
@@ -14953,7 +14991,7 @@ function safeRestore(repoDir, f, want, mode) {
14953
14991
  if (st.isDirectory())
14954
14992
  rmdirSync(fp);
14955
14993
  else
14956
- unlinkSync6(fp);
14994
+ unlinkSync7(fp);
14957
14995
  }
14958
14996
  const fd = openSync9(fp, "wx", mode);
14959
14997
  try {
@@ -15047,7 +15085,7 @@ var init_commit_filter = __esm(() => {
15047
15085
  });
15048
15086
 
15049
15087
  // ../../loki-ts/src/e10ext/scope.ts
15050
- import { basename as basename20, dirname as dirname26 } from "path";
15088
+ import { basename as basename21, dirname as dirname26 } from "path";
15051
15089
  function contractText(o) {
15052
15090
  const c = o.intake?.contract_snapshot?.contract;
15053
15091
  return Array.isArray(c?.criteria) ? c.criteria.map((x) => typeof x?.text === "string" ? x.text : "").join(`
@@ -15062,7 +15100,7 @@ function outsideScope(o, staged) {
15062
15100
  ${typeof o.intake?.task === "string" ? o.intake.task : ""}
15063
15101
  ${contractText(o)}`, pre = o.intake?.preexisting_dirty ?? {};
15064
15102
  const toks = surfaceTokens(text2), plannedDirs = new Set(rel.map((r) => dirname26(r)).filter((d) => d !== "."));
15065
- return staged.filter(({ st, f }) => st !== "A" && !isTestFile(f) && !Object.hasOwn(pre, f) && !rel.includes(f) && !mentions(text2, f) && !mentions(text2, basename20(f)) && !plannedDirs.has(dirname26(f)) && !dirSegs(f).some((d) => toks.has(d))).map(({ f }) => f);
15103
+ return staged.filter(({ st, f }) => st !== "A" && !isTestFile(f) && !Object.hasOwn(pre, f) && !rel.includes(f) && !mentions(text2, f) && !mentions(text2, basename21(f)) && !plannedDirs.has(dirname26(f)) && !dirSegs(f).some((d) => toks.has(d))).map(({ f }) => f);
15066
15104
  }
15067
15105
  function flagOutsideScope(o, staged) {
15068
15106
  const unit = unitFlags(staged, process.env, o.intake?.preexisting_dirty ?? {});
@@ -15077,7 +15115,7 @@ var init_scope2 = __esm(() => {
15077
15115
  });
15078
15116
 
15079
15117
  // ../../loki-ts/src/council/role_agents.ts
15080
- import { existsSync as existsSync40, readdirSync as readdirSync20, readFileSync as readFileSync48 } from "fs";
15118
+ import { existsSync as existsSync40, readdirSync as readdirSync21, readFileSync as readFileSync48 } from "fs";
15081
15119
  import { homedir as homedir9 } from "os";
15082
15120
  import { join as join61 } from "path";
15083
15121
  function agentDirs(repoDir, env = process.env) {
@@ -15102,7 +15140,7 @@ function loadRoleAgent(repoDir, role, env = process.env) {
15102
15140
  continue;
15103
15141
  let names;
15104
15142
  try {
15105
- names = readdirSync20(d).filter((n2) => n2.endsWith(".md") && !n2.startsWith(".")).sort();
15143
+ names = readdirSync21(d).filter((n2) => n2.endsWith(".md") && !n2.startsWith(".")).sort();
15106
15144
  } catch {
15107
15145
  continue;
15108
15146
  }
@@ -15204,12 +15242,12 @@ var init_colors = __esm(() => {
15204
15242
  });
15205
15243
 
15206
15244
  // ../../loki-ts/src/util/run_summary.ts
15207
- import { existsSync as existsSync41, mkdirSync as mkdirSync28, readFileSync as readFileSync49, renameSync as renameSync12, statSync as statSync19, writeFileSync as writeFileSync30 } from "fs";
15245
+ import { existsSync as existsSync41, mkdirSync as mkdirSync28, readFileSync as readFileSync49, renameSync as renameSync12, statSync as statSync20, writeFileSync as writeFileSync30 } from "fs";
15208
15246
  import { join as join63 } from "path";
15209
15247
  function readRiskRecord(repoDir, sinceMs = 0) {
15210
15248
  try {
15211
15249
  const p = join63(repoDir, ".loki", "state", "risk-tier.json");
15212
- if (statSync19(p).mtimeMs < sinceMs)
15250
+ if (statSync20(p).mtimeMs < sinceMs)
15213
15251
  return null;
15214
15252
  const r = JSON.parse(readFileSync49(p, "utf8"));
15215
15253
  return r && typeof r === "object" ? r : null;
@@ -15547,7 +15585,7 @@ var init_contract = __esm(() => {
15547
15585
 
15548
15586
  // ../../loki-ts/src/features/speed/seal_group.ts
15549
15587
  import { createHash as createHash17 } from "crypto";
15550
- import { existsSync as existsSync44, mkdirSync as mkdirSync30, readdirSync as readdirSync21, readFileSync as readFileSync52, renameSync as renameSync13, statSync as statSync20, writeFileSync as writeFileSync32 } from "fs";
15588
+ import { existsSync as existsSync44, mkdirSync as mkdirSync30, readdirSync as readdirSync22, readFileSync as readFileSync52, renameSync as renameSync13, statSync as statSync21, writeFileSync as writeFileSync32 } from "fs";
15551
15589
  import { dirname as dirname28, join as join66 } from "path";
15552
15590
  function sealGroup(runDir, rh) {
15553
15591
  const manifestPath = join66(runDir, "group", "manifest.json");
@@ -15637,7 +15675,7 @@ async function verifyGroup(receiptPath, receipt, rh, verifyOne, deps = {}) {
15637
15675
  return bad(`unit ${id} is out of order (index ${String(e["index"])} at position ${i})`);
15638
15676
  let bytes;
15639
15677
  try {
15640
- if (!statSync20(dir).isDirectory())
15678
+ if (!statSync21(dir).isDirectory())
15641
15679
  return bad(`unit ${id} is not a directory`);
15642
15680
  bytes = readFileSync52(rp);
15643
15681
  } catch {
@@ -15676,7 +15714,7 @@ var ID_RE, PASSING, sha3 = (b) => createHash17("sha256").update(b).digest("hex")
15676
15714
  }
15677
15715
  }, dirNames = (d) => {
15678
15716
  try {
15679
- return readdirSync21(d).filter((n3) => !n3.startsWith(".")).sort();
15717
+ return readdirSync22(d).filter((n3) => !n3.startsWith(".")).sort();
15680
15718
  } catch {
15681
15719
  return null;
15682
15720
  }
@@ -15688,8 +15726,8 @@ var init_seal_group = __esm(() => {
15688
15726
  });
15689
15727
 
15690
15728
  // ../../loki-ts/src/supply/supply_guard.ts
15691
- import { existsSync as existsSync45, readFileSync as readFileSync53, statSync as statSync21 } from "fs";
15692
- import { basename as basename21, join as join67 } from "path";
15729
+ import { existsSync as existsSync45, readFileSync as readFileSync53, statSync as statSync22 } from "fs";
15730
+ import { basename as basename22, join as join67 } from "path";
15693
15731
  function supplyEnabled(env) {
15694
15732
  return env["LOKI_SUPPLY_GUARD"] !== "0";
15695
15733
  }
@@ -15701,14 +15739,14 @@ function supplyVerdict(verdict, r) {
15701
15739
  return r.blocked && verdict === "VERIFIED" ? "FAILED" : verdict;
15702
15740
  }
15703
15741
  function isManifestPath(path) {
15704
- return MANIFESTS.test(basename21(path));
15742
+ return MANIFESTS.test(basename22(path));
15705
15743
  }
15706
15744
  function readDeclared(repoDir) {
15707
15745
  const p = join67(repoDir, ".loki", DECLARED_FILE);
15708
15746
  if (!existsSync45(p))
15709
15747
  return { deps: [], problem: null };
15710
15748
  try {
15711
- if (statSync21(p).size > MAX_FILE_BYTES)
15749
+ if (statSync22(p).size > MAX_FILE_BYTES)
15712
15750
  return { deps: [], problem: "declaration file too large" };
15713
15751
  const j = JSON.parse(readFileSync53(p, "utf8"));
15714
15752
  if (!Array.isArray(j))
@@ -15917,7 +15955,7 @@ var MIN_AGE_DAYS = 7, DECLARED_FILE = "supply-declared.json", MAX_CHECKED = 50,
15917
15955
  }
15918
15956
  }, PUBLIC_HOSTS, hostOf = (u) => u.trim().toLowerCase().replace(/^[a-z][a-z0-9+.-]*:\/\//, "").replace(/^www\./, "").split(/[/?#\s]/)[0].replace(/^[^@]*@/, "").replace(/:\d+$/, ""), privateUrl = (u) => /[a-z0-9]/i.test(u) && !PUBLIC_HOSTS.has(hostOf(u)), readSmall = (p) => {
15919
15957
  try {
15920
- return statSync21(p).size <= MAX_FILE_BYTES ? readFileSync53(p, "utf8") : "";
15958
+ return statSync22(p).size <= MAX_FILE_BYTES ? readFileSync53(p, "utf8") : "";
15921
15959
  } catch {
15922
15960
  return "";
15923
15961
  }
@@ -15933,8 +15971,8 @@ var init_supply_guard = __esm(() => {
15933
15971
 
15934
15972
  // ../../loki-ts/src/engine10/stages/seal.ts
15935
15973
  import { createHash as createHash18 } from "crypto";
15936
- import { existsSync as existsSync46, readdirSync as readdirSync22, mkdirSync as mkdirSync31, readFileSync as readFileSync54, writeFileSync as writeFileSync33 } from "fs";
15937
- import { basename as basename22, isAbsolute as isAbsolute11, join as join68, relative as relative10 } from "path";
15974
+ import { existsSync as existsSync46, readdirSync as readdirSync23, mkdirSync as mkdirSync31, readFileSync as readFileSync54 } from "fs";
15975
+ import { basename as basename23, isAbsolute as isAbsolute11, join as join68, relative as relative10 } from "path";
15938
15976
  function sanitizeReason(s) {
15939
15977
  const collapsed = s.replace(/[\x00-\x1f\x7f]+/g, " ").trim();
15940
15978
  const capped = collapsed.length > 500 ? `${collapsed.slice(0, 500)}...` : collapsed;
@@ -16020,6 +16058,7 @@ var init_seal = __esm(() => {
16020
16058
  init_spec_file();
16021
16059
  init_steer();
16022
16060
  init_run_outputs();
16061
+ init_pr_body();
16023
16062
  init_mutation_proof();
16024
16063
  init_wall();
16025
16064
  init_assert_delta();
@@ -16042,6 +16081,7 @@ var init_seal = __esm(() => {
16042
16081
  init_seal_group();
16043
16082
  init_supply_guard();
16044
16083
  init_hooks();
16084
+ init_atomic();
16045
16085
  init_safe_git();
16046
16086
  DEEP_NOT_PROVEN = ["full suite", "app boot", "council", "security scan"];
16047
16087
  commitStage = {
@@ -16125,8 +16165,8 @@ var init_seal = __esm(() => {
16125
16165
  notProven.add(`Wall test not executed: ${wallNotRun} file(s), no reason recorded`);
16126
16166
  if (wallNotRun > 0) {
16127
16167
  try {
16128
- const kept = new Set((Array.isArray(o.wall?.files) ? o.wall.files : []).map((f) => basename22(String(f.path))));
16129
- for (const n3 of readdirSync22(join68(ctx.runDir, "wall")).sort())
16168
+ const kept = new Set((Array.isArray(o.wall?.files) ? o.wall.files : []).map((f) => basename23(String(f.path))));
16169
+ for (const n3 of readdirSync23(join68(ctx.runDir, "wall")).sort())
16130
16170
  if (!kept.has(n3))
16131
16171
  notProven.add(`wall test discarded: ${n3} (not_run)`);
16132
16172
  } catch {}
@@ -16268,9 +16308,9 @@ var init_seal = __esm(() => {
16268
16308
  const receipt = { ...body, receipt_sha256: hash, verification: { jwt: sig.jwt, kid: sig.kid } };
16269
16309
  mkdirSync31(ctx.runDir, { recursive: true });
16270
16310
  const path = join68(ctx.runDir, "receipt.json");
16271
- writeFileSync33(path, JSON.stringify(receipt, null, 2) + `
16311
+ atomicWriteText(path, JSON.stringify(receipt, null, 2) + `
16272
16312
  `);
16273
- writeFileSync33(join68(ctx.runDir, "receipt.md"), renderReceiptMd(receipt));
16313
+ atomicWriteText(join68(ctx.runDir, "receipt.md"), renderReceiptMd(receipt));
16274
16314
  recordRun(process.env, ctx.repoDir, ranModel(o.implement, ctx.model, o.fix), verdict, cost.usd, cost.unmetered === true, totalS);
16275
16315
  try {
16276
16316
  hooks.sealed?.(ctx.runDir, JSON.parse(JSON.stringify(receipt), (_k, v) => v && typeof v === "object" ? Object.freeze(v) : v));
@@ -16296,7 +16336,7 @@ var init_seal = __esm(() => {
16296
16336
 
16297
16337
  // ../../loki-ts/src/util/composite_seal.ts
16298
16338
  import { existsSync as existsSync47, readFileSync as readFileSync55 } from "fs";
16299
- import { basename as basename23, dirname as dirname30, join as join69 } from "path";
16339
+ import { basename as basename24, dirname as dirname30, join as join69 } from "path";
16300
16340
  function logProblem(runDir, integ) {
16301
16341
  if (typeof integ["log_sha256"] !== "string")
16302
16342
  return null;
@@ -16418,8 +16458,8 @@ var init_keys_cmd = __esm(() => {
16418
16458
  });
16419
16459
 
16420
16460
  // ../../loki-ts/src/engine10/verify_cmd.ts
16421
- import { existsSync as existsSync48, readFileSync as readFileSync56, renameSync as renameSync14, statSync as statSync23, writeFileSync as writeFileSync34 } from "fs";
16422
- import { basename as basename24, dirname as dirname31, join as join70 } from "path";
16461
+ import { existsSync as existsSync48, readFileSync as readFileSync56, renameSync as renameSync14, statSync as statSync24, writeFileSync as writeFileSync33 } from "fs";
16462
+ import { basename as basename25, dirname as dirname31, join as join70 } from "path";
16423
16463
  import { createHash as createHash19, createPublicKey as createPublicKey4, verify as verify4 } from "crypto";
16424
16464
  function pubFor(kid, given) {
16425
16465
  if (given)
@@ -16601,7 +16641,7 @@ var init_verify_cmd = __esm(() => {
16601
16641
  });
16602
16642
 
16603
16643
  // src/server/app.ts
16604
- import { existsSync as existsSync50, readFileSync as readFileSync59, statSync as statSync24 } from "fs";
16644
+ import { existsSync as existsSync50, readFileSync as readFileSync59, statSync as statSync25 } from "fs";
16605
16645
  import { join as join73, resolve as resolve16, sep as sep15 } from "path";
16606
16646
 
16607
16647
  // node_modules/hono/dist/request/constants.js
@@ -27694,7 +27734,7 @@ function createApp(opts) {
27694
27734
  return c.json({ error: "not found" }, 404);
27695
27735
  const root = resolve16(uiDir);
27696
27736
  const f = resolve16(root, `.${p}`);
27697
- if (f.startsWith(root + sep15) && existsSync50(f) && statSync24(f).isFile())
27737
+ if (f.startsWith(root + sep15) && existsSync50(f) && statSync25(f).isFile())
27698
27738
  return new Response(Bun.file(f));
27699
27739
  if (/\.[a-z0-9]+$/i.test(p))
27700
27740
  return c.json({ error: "not found" }, 404);