pi-lens 4.5.0 → 4.5.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.
Files changed (148) hide show
  1. package/CHANGELOG-USER.md +12 -12
  2. package/CHANGELOG.md +253 -0
  3. package/README.md +11 -2
  4. package/config/dependency-cruiser-eager-allowlist.json +1 -0
  5. package/dist/{chunk-ZULZS2I6.js → chunk-2ERVW2UF.js} +1115 -423
  6. package/dist/{chunk-BBSDJTOV.js → chunk-2K7BUOKS.js} +13 -13
  7. package/dist/{chunk-I2FYOZNW.js → chunk-3JJ4OAJI.js} +10 -10
  8. package/dist/{chunk-5JB4WENL.js → chunk-3UHGSUVL.js} +1 -1
  9. package/dist/{chunk-W26QZ3OM.js → chunk-463WN3VP.js} +10 -10
  10. package/dist/{chunk-4IZZEN63.js → chunk-4X3ML2UQ.js} +31 -34
  11. package/dist/{chunk-I3NZVAMN.js → chunk-5BI5YP57.js} +10 -10
  12. package/dist/{chunk-7U36VQL6.js → chunk-5Z4XLUFF.js} +3 -3
  13. package/dist/{chunk-DCA2MXVQ.js → chunk-62AJH3IN.js} +51 -29
  14. package/dist/{chunk-37IDWT6O.js → chunk-6F34GMP7.js} +16 -14
  15. package/dist/{chunk-VSQT6IHZ.js → chunk-6LIUVGOR.js} +28 -4
  16. package/dist/{chunk-27JQHK7Y.js → chunk-6REF4GCO.js} +1 -1
  17. package/dist/{chunk-INBK3HIT.js → chunk-7KRR24GO.js} +3 -3
  18. package/dist/{chunk-OZQQ3AIR.js → chunk-7OMOMBEQ.js} +9 -9
  19. package/dist/{chunk-ARTYCUGF.js → chunk-7ZFXICNN.js} +123 -20
  20. package/dist/{chunk-K4Z7MK6T.js → chunk-ABKRQVOY.js} +28 -52
  21. package/dist/{chunk-C5PLBTNR.js → chunk-ANSLRJBG.js} +1 -1
  22. package/dist/{chunk-HRLF35WL.js → chunk-AWMFBPGJ.js} +9 -9
  23. package/dist/{chunk-CXQYK4YT.js → chunk-BG7KHGNX.js} +2 -2
  24. package/dist/{chunk-ZI7YHV6I.js → chunk-BK2R2223.js} +10 -8
  25. package/dist/chunk-BXXC6KRR.js +107 -0
  26. package/dist/{chunk-QMWKSYWB.js → chunk-CKJS2AUI.js} +4 -4
  27. package/dist/{chunk-PPQHMSPH.js → chunk-COGU5KQJ.js} +15 -15
  28. package/dist/{chunk-NHA5K226.js → chunk-CQNXALZJ.js} +27 -6
  29. package/dist/{chunk-KZ732ZVW.js → chunk-CSZESDPP.js} +1 -1
  30. package/dist/chunk-CZ5TCJPB.js +98 -0
  31. package/dist/{chunk-LOEJFTF2.js → chunk-D2LFEA5U.js} +9 -2
  32. package/dist/chunk-D3KLF5CD.js +50 -0
  33. package/dist/{chunk-4DAHGU3V.js → chunk-ENJ2M76Y.js} +31 -29
  34. package/dist/{chunk-ZQSSO7LO.js → chunk-EQKF6BAK.js} +3 -3
  35. package/dist/{chunk-PFJLYRO3.js → chunk-F2SAP2FM.js} +40 -47
  36. package/dist/{chunk-ADYQRETD.js → chunk-F6QAJXQV.js} +2 -2
  37. package/dist/chunk-GR2QDWH5.js +25 -0
  38. package/dist/{chunk-LVLPA32Q.js → chunk-GVE5VZYQ.js} +48 -11
  39. package/dist/{chunk-AZG5UJYY.js → chunk-GWZZOJD2.js} +1 -1
  40. package/dist/chunk-GZS6VPIE.js +27 -0
  41. package/dist/chunk-H4B4SC7I.js +71 -0
  42. package/dist/{chunk-YCR6ZYTE.js → chunk-HA6TUJOE.js} +1 -1
  43. package/dist/{chunk-DI4AZZNY.js → chunk-HKPJTI47.js} +2 -2
  44. package/dist/{chunk-O6LCSHHI.js → chunk-HPKC55MA.js} +1 -1
  45. package/dist/{chunk-LQQNFCQJ.js → chunk-I65CQLCG.js} +1 -1
  46. package/dist/{chunk-P5MSLVUW.js → chunk-IDKLWVKY.js} +11 -11
  47. package/dist/chunk-IUM2Q7NF.js +25 -0
  48. package/dist/{chunk-L6BDRYUK.js → chunk-J24IS3KZ.js} +5 -5
  49. package/dist/{chunk-KNSOA43J.js → chunk-J2DAHH4T.js} +2 -2
  50. package/dist/{chunk-7ZVTFLCC.js → chunk-JBDZVOFL.js} +11 -11
  51. package/dist/{chunk-HIJ4CHFF.js → chunk-JC6NFC57.js} +3 -3
  52. package/dist/{chunk-K7O6AHSJ.js → chunk-JTHEUTW7.js} +11 -11
  53. package/dist/{chunk-KXGTLAUW.js → chunk-JWW3ODBN.js} +2 -2
  54. package/dist/{chunk-HIRBC72R.js → chunk-K3ZIYLHT.js} +4 -4
  55. package/dist/{chunk-6GLMMGCX.js → chunk-KDPZA2UE.js} +2 -3
  56. package/dist/{chunk-AXAR5ZW2.js → chunk-KMY2OU4T.js} +553 -434
  57. package/dist/{chunk-DFKOA74L.js → chunk-KQF7VT26.js} +10 -10
  58. package/dist/{chunk-S6MCMD27.js → chunk-KVGA7X76.js} +3 -3
  59. package/dist/{chunk-74AMPWNC.js → chunk-KW7O72AK.js} +2 -2
  60. package/dist/{chunk-UN72ZAJ5.js → chunk-LEQTVRSV.js} +9 -9
  61. package/dist/{chunk-B42AIWPJ.js → chunk-LKPSBM6S.js} +3 -3
  62. package/dist/{chunk-R4L7KZ7R.js → chunk-LKW2HFSZ.js} +9 -9
  63. package/dist/{chunk-3PO4YYOX.js → chunk-LURFD4HD.js} +4240 -3734
  64. package/dist/{chunk-PQXUZYTQ.js → chunk-M6ELTECW.js} +4 -4
  65. package/dist/{chunk-3QXFUP6T.js → chunk-MGVVYYKW.js} +12 -12
  66. package/dist/{chunk-CZJGAOKL.js → chunk-MQBKGRSB.js} +7 -7
  67. package/dist/{chunk-NNEQOC3U.js → chunk-MVG2ZEAO.js} +9 -7
  68. package/dist/{chunk-VWEBZ2JV.js → chunk-MY4XNNTX.js} +39 -41
  69. package/dist/{chunk-RIH3UBK4.js → chunk-N4AJVFRF.js} +11 -11
  70. package/dist/{chunk-TKOFTLGB.js → chunk-OFKKMXWM.js} +31 -36
  71. package/dist/{chunk-3PAS2ERX.js → chunk-OFZE4ANN.js} +8 -8
  72. package/dist/chunk-OLXBUTJR.js +61 -0
  73. package/dist/{chunk-6CFSDLHE.js → chunk-OZGEHOSG.js} +38 -17
  74. package/dist/{chunk-3TSMQZG6.js → chunk-PKGOROPQ.js} +40 -2
  75. package/dist/{chunk-OLWGYBYT.js → chunk-Q6D5QKRG.js} +17 -17
  76. package/dist/{chunk-QE7BJQ6K.js → chunk-QECLJFHI.js} +12 -17
  77. package/dist/{chunk-RJ3APNIP.js → chunk-QJA33VD5.js} +4 -4
  78. package/dist/{chunk-MOAVEPC4.js → chunk-R5XVJ6AN.js} +11 -11
  79. package/dist/{chunk-ZRQMENT4.js → chunk-REZL4OM4.js} +1 -1
  80. package/dist/{chunk-PKWEBMCA.js → chunk-RK5RBREN.js} +251 -201
  81. package/dist/chunk-RP5ZQTHO.js +86 -0
  82. package/dist/{chunk-J2ZB5MDS.js → chunk-RURPX2YV.js} +23 -23
  83. package/dist/chunk-TB5MGZLS.js +53 -0
  84. package/dist/chunk-TC63XRYP.js +27 -0
  85. package/dist/chunk-TJOYHAXJ.js +69 -0
  86. package/dist/{chunk-Q7J3JYJ2.js → chunk-TRXKDCBP.js} +13 -13
  87. package/dist/{chunk-6E5QLMWI.js → chunk-TTK37D7R.js} +22 -23
  88. package/dist/{chunk-XDNWR7SG.js → chunk-UH3QHLR5.js} +2 -2
  89. package/dist/{chunk-SCU62JLX.js → chunk-UNTJJ7GN.js} +7 -7
  90. package/dist/{chunk-O2MHF7QM.js → chunk-UPAFSETJ.js} +58 -63
  91. package/dist/{chunk-PQF6YGYB.js → chunk-UX75PTQW.js} +50 -31
  92. package/dist/{chunk-TWEOJE3D.js → chunk-V353PYMK.js} +1233 -576
  93. package/dist/{chunk-CQY2HEH7.js → chunk-V4TFQY5G.js} +2 -2
  94. package/dist/{chunk-B2OXE4AH.js → chunk-VC3W54G3.js} +446 -293
  95. package/dist/{chunk-JGUDT5KD.js → chunk-VSBCJVPC.js} +5 -5
  96. package/dist/{chunk-5HBQL7DH.js → chunk-WAQQGXVV.js} +3 -3
  97. package/dist/{chunk-7DPXUPRF.js → chunk-WLEVWR7Y.js} +2 -2
  98. package/dist/{chunk-QE5DJ7MX.js → chunk-WPMPVP5I.js} +4 -4
  99. package/dist/{chunk-KNJH6WJQ.js → chunk-WXNLFOC2.js} +7 -7
  100. package/dist/{chunk-XSC3BCN3.js → chunk-Y3ZNOZZS.js} +6 -6
  101. package/dist/{chunk-VGRGW4UL.js → chunk-YL6JQTWC.js} +29 -32
  102. package/dist/{chunk-7CLWC2UH.js → chunk-YVE5Q2UU.js} +86 -217
  103. package/dist/{chunk-LGH2HHZG.js → chunk-YZNARDMM.js} +42 -28
  104. package/dist/{chunk-NGNBJIUO.js → chunk-ZDWNFZJ2.js} +8 -8
  105. package/dist/{chunk-X33QECRJ.js → chunk-ZEUF7BIN.js} +2 -2
  106. package/dist/{chunk-2H5GHZKC.js → chunk-ZIF4WLWR.js} +45 -25
  107. package/dist/{chunk-WLD6BGON.js → chunk-ZSPVF7KI.js} +231 -24
  108. package/dist/{chunk-SDYLT45T.js → chunk-ZX6OKBVO.js} +2 -2
  109. package/dist/index.js +10566 -6819
  110. package/dist/mcp/analyze-cli.js +8 -8
  111. package/dist/mcp/cli.js +39 -41
  112. package/dist/mcp/server.js +1083 -685
  113. package/dist/mcp/worker.js +68 -59
  114. package/dist/probes/installer.js +21 -22
  115. package/docs/ci-bot-pr-checks.md +18 -9
  116. package/docs/ci.md +7 -0
  117. package/docs/configuration.md +24 -10
  118. package/docs/defect-shapes.md +61 -30
  119. package/docs/environment-variables.md +18 -9
  120. package/docs/globalconfig.md +17 -0
  121. package/docs/invariants/dispatch-runners.md +22 -0
  122. package/docs/invariants/lsp-trust-exec.md +33 -3
  123. package/docs/lsp-capability-matrix.md +23 -10
  124. package/docs/lsp-idle-eviction.md +7 -1
  125. package/docs/module-report-read-symbol.md +6 -2
  126. package/docs/pi-lens-merge-policy.md +3 -2
  127. package/docs/pi-lens-orchestration.md +2 -1
  128. package/docs/pi-lens-subagent.md +2 -1
  129. package/docs/release-qa-baseline.md +22 -17
  130. package/docs/servercapabilities.md +1 -1
  131. package/docs/settings.md +10 -2
  132. package/docs/tools.md +1 -1
  133. package/docs/usage.md +1 -0
  134. package/package.json +3 -3
  135. package/dist/chunk-2H7NFZ4Q.js +0 -25
  136. package/dist/chunk-5YJXF2IS.js +0 -56
  137. package/dist/chunk-7WKVCZI4.js +0 -69
  138. package/dist/chunk-BKWFDWYM.js +0 -46
  139. package/dist/chunk-G53LBDNU.js +0 -255
  140. package/dist/chunk-GCSDF5IE.js +0 -27
  141. package/dist/chunk-H5API74E.js +0 -67
  142. package/dist/chunk-HBX55MWO.js +0 -27
  143. package/dist/chunk-JOIKBUQN.js +0 -88
  144. package/dist/chunk-M2YMBT5G.js +0 -73
  145. package/dist/chunk-MJRGPEQ5.js +0 -25
  146. package/dist/chunk-QV3JPCMK.js +0 -17
  147. package/dist/chunk-TFKN5EIR.js +0 -27
  148. package/dist/chunk-UNP6Y4JV.js +0 -38
@@ -9,26 +9,26 @@ import {
9
9
  getDeadCodeClients,
10
10
  parseVultureOutput,
11
11
  stableFindingKey
12
- } from "./chunk-OZQQ3AIR.js";
12
+ } from "./chunk-7OMOMBEQ.js";
13
13
  import "./chunk-7U2IDNXN.js";
14
- import "./chunk-S6MCMD27.js";
15
- import "./chunk-SDYLT45T.js";
14
+ import "./chunk-KVGA7X76.js";
15
+ import "./chunk-ZX6OKBVO.js";
16
16
  import "./chunk-2APSZHHI.js";
17
- import "./chunk-LGH2HHZG.js";
18
- import "./chunk-KXGTLAUW.js";
17
+ import "./chunk-YZNARDMM.js";
18
+ import "./chunk-JWW3ODBN.js";
19
+ import "./chunk-J2DAHH4T.js";
20
+ import "./chunk-KDPZA2UE.js";
19
21
  import "./chunk-UYXV5NIS.js";
20
- import "./chunk-KNSOA43J.js";
21
- import "./chunk-6GLMMGCX.js";
22
- import "./chunk-3PO4YYOX.js";
23
- import "./chunk-5JB4WENL.js";
24
- import "./chunk-PQF6YGYB.js";
25
- import "./chunk-LOEJFTF2.js";
26
- import "./chunk-W26QZ3OM.js";
27
- import "./chunk-NHA5K226.js";
22
+ import "./chunk-LURFD4HD.js";
23
+ import "./chunk-3UHGSUVL.js";
24
+ import "./chunk-UX75PTQW.js";
25
+ import "./chunk-D2LFEA5U.js";
26
+ import "./chunk-463WN3VP.js";
27
+ import "./chunk-CQNXALZJ.js";
28
28
  import "./chunk-S26LC76R.js";
29
- import "./chunk-7CLWC2UH.js";
29
+ import "./chunk-YVE5Q2UU.js";
30
30
  import "./chunk-LJDODBBZ.js";
31
- import "./chunk-WLD6BGON.js";
31
+ import "./chunk-ZSPVF7KI.js";
32
32
  import "./chunk-NXL4FFQQ.js";
33
33
  export {
34
34
  DEAD_CODE_DELTA_MAX_SHOWN,
@@ -8,6 +8,7 @@ import {
8
8
  getGlobalPiLensLogDir,
9
9
  getMaxLogSizeMB,
10
10
  getProbeHomeRedirectEvent,
11
+ getProcessSingleton,
11
12
  getProcessSingletonResets,
12
13
  getSinkOptionConflicts,
13
14
  getSinkRotations,
@@ -18,11 +19,11 @@ import {
18
19
  logLatency,
19
20
  resetSinkRotations,
20
21
  resetSinkWriteFailures
21
- } from "./chunk-7CLWC2UH.js";
22
+ } from "./chunk-YVE5Q2UU.js";
22
23
  import {
23
24
  getPathIdentityFallbacks,
24
25
  resetPathIdentityFallbacks
25
- } from "./chunk-WLD6BGON.js";
26
+ } from "./chunk-ZSPVF7KI.js";
26
27
 
27
28
  // dist/clients/extension-log.js
28
29
  import * as path from "node:path";
@@ -372,14 +373,20 @@ var INFORMATIONAL_DEGRADATION_KINDS = /* @__PURE__ */ new Set([
372
373
  // #3952: both are the idle-eviction POLICY answering, not a timer that
373
374
  // failed. `lsp-idle-eviction` is the memory bound releasing a client that
374
375
  // respawns on the next request; `lsp-idle-eviction-declined` is the
375
- // declaration `unmeasured`/`resident` doing its job, once per server, so a
376
- // nominal session writes up to one row per non-`transparent` server (32 of
377
- // the 49 built-ins today). A `⚠` per server on every healthy session is
376
+ // declaration `resident` doing its job, once per server, so a
377
+ // nominal session writes up to one row per `resident` server (the five
378
+ // held indexers today, #5700). A `⚠` per server on every healthy session is
378
379
  // the cry-wolf shape #2505 rejected; the sibling that DOES stand out is a
379
380
  // measurement whose arm never reached the policy, and that one reads as a
380
381
  // missing row, not as a warning here.
381
382
  "lsp-idle-eviction",
382
- "lsp-idle-eviction-declined"
383
+ "lsp-idle-eviction-declined",
384
+ // #5700: the open-document cap closing a cold document is the resident
385
+ // budget working; the server reopens it on the next touch.
386
+ "lsp-open-document-cap",
387
+ // #5733: a group that outlived its leader at shutdown was SIGKILLed; the
388
+ // ladder ending it is the design working.
389
+ "held-group-outlived-leader"
383
390
  ]);
384
391
  function renderDegradationLines(summary = getDegradationSummary()) {
385
392
  if (!isRenderableSummary(summary))
@@ -628,6 +635,7 @@ var LENS_FLAGS = [
628
635
  globalOptInFlag("lens-compact-lsp-status", "Opt-in (#3099): collapse the footer LSP status to one state glyph per group (LSP \u2713 green, LSP \u2717 red, dim LSP \u2717 when nothing is warm) instead of listing the active server names. Default off. Also via ui.compactLspStatus=true in ~/.pi-lens/config.json.", "ui.compactLspStatus"),
629
636
  globalOptInFlag("lens-hide-lsp-status", "Opt-in (#3099): publish no pi-lens-lsp footer status at all, so a host that renders extension statuses stops showing the key. Outranks lens-compact-lsp-status when both are set. Default off. Also via ui.hideLspStatus=true in ~/.pi-lens/config.json.", "ui.hideLspStatus"),
630
637
  globalOptInFlag("lens-compact-widget", "Opt-in (#3959): render the pi-lens widget as ONE summary line (languages + error/warning totals) instead of also stacking file rows, the suppressed count and blocker details below it. Default off. Also via ui.compactWidget=true in ~/.pi-lens/config.json.", "ui.compactWidget"),
638
+ globalOptInFlag("lens-issues-status", "Opt-in: publish a compact pi-lens-issues footer status (\u25CF<N>E, !<N>W, \u26A0 <N> unchecked, \u2713 clean) projected from the widget header. Default off. Also via ui.issuesStatus=true in ~/.pi-lens/config.json.", "ui.issuesStatus"),
631
639
  {
632
640
  name: "no-lazy-tools",
633
641
  description: 'Keep every pi-lens tool active for the whole session. Same as tools.lazy=false in ~/.pi-lens/config.json; the default tools.lazy=true starts the situational tools inactive on every model, and tools.lazy="auto" only on models that support mid-conversation system messages.',
@@ -1031,6 +1039,17 @@ function readToolConfig(raw, warnInvalid) {
1031
1039
  return Object.keys(result).length > 0 ? result : void 0;
1032
1040
  }
1033
1041
 
1042
+ // dist/clients/spawn-abort-scope.js
1043
+ import { AsyncLocalStorage } from "node:async_hooks";
1044
+ var FAMILY = "spawn-abort-scope";
1045
+ var VERSION = 1;
1046
+ var scopes = getProcessSingleton(FAMILY, VERSION, () => ({
1047
+ abort: new AsyncLocalStorage(),
1048
+ cooldown: new AsyncLocalStorage()
1049
+ }));
1050
+ var spawnAbortScope = scopes.abort;
1051
+ var spawnCooldownScope = scopes.cooldown;
1052
+
1034
1053
  export {
1035
1054
  logExtension,
1036
1055
  createSubsystemLogger,
@@ -1045,6 +1064,8 @@ export {
1045
1064
  getDegradationSummary,
1046
1065
  renderDegradationLines,
1047
1066
  resetDegradationLedger,
1067
+ spawnAbortScope,
1068
+ spawnCooldownScope,
1048
1069
  compareOrdinal,
1049
1070
  escapeRegExp,
1050
1071
  LENS_FLAGS,
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  withTreeSitterRoot
4
- } from "./chunk-37IDWT6O.js";
4
+ } from "./chunk-6F34GMP7.js";
5
5
 
6
6
  // dist/clients/dispatch/facts/tree-sitter-facts.js
7
7
  var withFactTree = withTreeSitterRoot;
@@ -0,0 +1,98 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ normalizeMapKey
4
+ } from "./chunk-ZSPVF7KI.js";
5
+
6
+ // dist/clients/dispatch/collect-later-tier.js
7
+ var COLLECT_LATER_THRESHOLD_MS = 5e3;
8
+ var slowRunners = /* @__PURE__ */ new Map();
9
+ function runnerFlightKey(projectRoot, runnerId) {
10
+ return `${normalizeMapKey(projectRoot)}\0${runnerId}`;
11
+ }
12
+ function classifyObservedRunner(projectRoot, runnerId, dispatch) {
13
+ const runnerKey = runnerFlightKey(projectRoot, runnerId);
14
+ const flight = flights.get(runnerKey);
15
+ return slowRunners.has(runnerKey) || flight !== void 0 && (flight.owner === void 0 || flight.owner !== dispatch) ? "collect-later" : "inline";
16
+ }
17
+ function observeRunnerLatency(options) {
18
+ const normalizedProjectRoot = normalizeMapKey(options.projectRoot);
19
+ const runnerKey = runnerFlightKey(normalizedProjectRoot, options.runnerId);
20
+ if (options.timedOut === true || options.durationMs > COLLECT_LATER_THRESHOLD_MS) {
21
+ slowRunners.set(runnerKey, {
22
+ projectRoot: normalizedProjectRoot,
23
+ runnerId: options.runnerId
24
+ });
25
+ return "collect-later";
26
+ }
27
+ slowRunners.delete(runnerKey);
28
+ return "inline";
29
+ }
30
+ var flights = /* @__PURE__ */ new Map();
31
+ var DROPPED_BY_RESET = {
32
+ status: "skipped",
33
+ diagnostics: [],
34
+ semantic: "none"
35
+ };
36
+ function runCollectLater(options) {
37
+ const flightKey = runnerFlightKey(options.projectRoot, options.runnerId);
38
+ const flight = flights.get(flightKey);
39
+ if (flight) {
40
+ const fileKey = normalizeMapKey(options.filePath);
41
+ const queued = flight.queued.get(fileKey);
42
+ if (queued) {
43
+ queued.start = options.start;
44
+ return { promise: queued.promise, coalesced: true };
45
+ }
46
+ const slot = {
47
+ start: options.start,
48
+ promise: Promise.allSettled([flight.tail]).then(() => startQueued(flightKey, flight, fileKey, slot))
49
+ };
50
+ flight.queued.set(fileKey, slot);
51
+ chain(flightKey, flight, slot.promise);
52
+ return { promise: slot.promise, coalesced: true };
53
+ }
54
+ const promise = options.start();
55
+ holdFlight(flightKey, promise);
56
+ return { promise, coalesced: false };
57
+ }
58
+ function holdFlight(flightKey, promise, owner) {
59
+ const held = flights.get(flightKey);
60
+ if (held) {
61
+ chain(flightKey, held, Promise.allSettled([held.tail, promise]));
62
+ return;
63
+ }
64
+ const started = { tail: promise, queued: /* @__PURE__ */ new Map(), owner };
65
+ flights.set(flightKey, started);
66
+ chain(flightKey, started, promise);
67
+ }
68
+ function flightTail(flightKey) {
69
+ return flights.get(flightKey)?.tail;
70
+ }
71
+ function startQueued(flightKey, flight, fileKey, slot) {
72
+ if (flights.get(flightKey) !== flight)
73
+ return DROPPED_BY_RESET;
74
+ flight.queued.delete(fileKey);
75
+ return slot.start();
76
+ }
77
+ function chain(flightKey, flight, run) {
78
+ flight.tail = run;
79
+ void Promise.allSettled([run]).then(() => {
80
+ if (flight.tail === run && flights.get(flightKey) === flight)
81
+ flights.delete(flightKey);
82
+ });
83
+ }
84
+ function resetObservedRunnerLatency() {
85
+ slowRunners.clear();
86
+ flights.clear();
87
+ }
88
+
89
+ export {
90
+ COLLECT_LATER_THRESHOLD_MS,
91
+ runnerFlightKey,
92
+ classifyObservedRunner,
93
+ observeRunnerLatency,
94
+ runCollectLater,
95
+ holdFlight,
96
+ flightTail,
97
+ resetObservedRunnerLatency
98
+ };
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-S26LC76R.js";
7
7
  import {
8
8
  logLatency
9
- } from "./chunk-7CLWC2UH.js";
9
+ } from "./chunk-YVE5Q2UU.js";
10
10
  import {
11
11
  isWindowsPath,
12
12
  nameMatchesMarkerGlob,
@@ -14,7 +14,7 @@ import {
14
14
  realpathOrResolve,
15
15
  toPosix,
16
16
  walkUpDirs
17
- } from "./chunk-WLD6BGON.js";
17
+ } from "./chunk-ZSPVF7KI.js";
18
18
 
19
19
  // dist/clients/workspace-topology.js
20
20
  import * as fs2 from "node:fs";
@@ -82,6 +82,12 @@ function configSearchDirs(startDir, homeDir = os.homedir(), stopAtGitRoot = fals
82
82
  }
83
83
  return dirs;
84
84
  }
85
+ function holdsCanonicalProjectConfig(startDir, homeDir = os.homedir()) {
86
+ return configSearchDirs(startDir, homeDir, true).some((dir) => {
87
+ const candidate = path.join(dir, CANONICAL_PROJECT_CONFIG_FILE);
88
+ return fs.existsSync(candidate) && fs.statSync(candidate, { throwIfNoEntry: false })?.isFile() === true && !isResolvedGlobalConfigPath(candidate);
89
+ });
90
+ }
85
91
  function defaultGlobalConfigExists(file) {
86
92
  try {
87
93
  return fs.statSync(file).isFile();
@@ -467,6 +473,7 @@ export {
467
473
  PROJECT_CONFIG_BASENAMES,
468
474
  GLOBAL_CONFIG_LOCATIONS,
469
475
  configSearchDirs,
476
+ holdsCanonicalProjectConfig,
470
477
  getProductionGlobalConfigResolution,
471
478
  getPiLensGlobalConfigPath,
472
479
  isResolvedGlobalConfigPath,
@@ -0,0 +1,50 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ GovulncheckClient,
4
+ parseGovulncheckJson
5
+ } from "./chunk-OFZE4ANN.js";
6
+ import "./chunk-BK2R2223.js";
7
+ import "./chunk-7KRR24GO.js";
8
+ import "./chunk-ZX6OKBVO.js";
9
+ import "./chunk-RK5RBREN.js";
10
+ import "./chunk-KMY2OU4T.js";
11
+ import "./chunk-ZIF4WLWR.js";
12
+ import "./chunk-BG7KHGNX.js";
13
+ import "./chunk-EQKF6BAK.js";
14
+ import "./chunk-GWZZOJD2.js";
15
+ import "./chunk-MVG2ZEAO.js";
16
+ import "./chunk-IDKLWVKY.js";
17
+ import "./chunk-F6QAJXQV.js";
18
+ import "./chunk-HKPJTI47.js";
19
+ import "./chunk-2APSZHHI.js";
20
+ import "./chunk-2BEMIWEW.js";
21
+ import "./chunk-IJYGIDF4.js";
22
+ import "./chunk-VC3W54G3.js";
23
+ import "./chunk-GVE5VZYQ.js";
24
+ import "./chunk-YZNARDMM.js";
25
+ import "./chunk-JWW3ODBN.js";
26
+ import "./chunk-J2DAHH4T.js";
27
+ import "./chunk-KDPZA2UE.js";
28
+ import "./chunk-Y3ZNOZZS.js";
29
+ import "./chunk-6REF4GCO.js";
30
+ import "./chunk-LKW2HFSZ.js";
31
+ import "./chunk-KW7O72AK.js";
32
+ import "./chunk-TQWRH25U.js";
33
+ import "./chunk-UYXV5NIS.js";
34
+ import "./chunk-LURFD4HD.js";
35
+ import "./chunk-3UHGSUVL.js";
36
+ import "./chunk-QYF5S6P6.js";
37
+ import "./chunk-UX75PTQW.js";
38
+ import "./chunk-V4TFQY5G.js";
39
+ import "./chunk-D2LFEA5U.js";
40
+ import "./chunk-463WN3VP.js";
41
+ import "./chunk-CQNXALZJ.js";
42
+ import "./chunk-S26LC76R.js";
43
+ import "./chunk-YVE5Q2UU.js";
44
+ import "./chunk-LJDODBBZ.js";
45
+ import "./chunk-ZSPVF7KI.js";
46
+ import "./chunk-NXL4FFQQ.js";
47
+ export {
48
+ GovulncheckClient,
49
+ parseGovulncheckJson
50
+ };
@@ -11,11 +11,7 @@ import {
11
11
  getLSPService,
12
12
  isLspRequestTimeoutError,
13
13
  rankFilesByReverseDependencyCentrality
14
- } from "./chunk-TWEOJE3D.js";
15
- import {
16
- notePersistWorkerMessageFault,
17
- readWorkerHeapStatistics
18
- } from "./chunk-NNEQOC3U.js";
14
+ } from "./chunk-V353PYMK.js";
19
15
  import {
20
16
  buildQualifiedName,
21
17
  findOwnerName
@@ -31,50 +27,54 @@ import {
31
27
  resolveProjectReferenceImport,
32
28
  resolveWorkspacePackageImport,
33
29
  symbolExtractionGrammar
34
- } from "./chunk-ARTYCUGF.js";
30
+ } from "./chunk-7ZFXICNN.js";
35
31
  import {
36
32
  classifyTreeSitterWasmError,
37
33
  getSharedTreeSitterClient,
38
34
  logTreeSitterCacheStats,
39
35
  withTreeSitterRoot
40
- } from "./chunk-37IDWT6O.js";
36
+ } from "./chunk-6F34GMP7.js";
37
+ import {
38
+ notePersistWorkerMessageFault,
39
+ readWorkerHeapStatistics
40
+ } from "./chunk-MVG2ZEAO.js";
41
41
  import {
42
42
  getReviewGraphMaxFilesDerived
43
- } from "./chunk-ADYQRETD.js";
43
+ } from "./chunk-F6QAJXQV.js";
44
+ import {
45
+ hashContentBytes,
46
+ hashFileBytes
47
+ } from "./chunk-CIA7X2PZ.js";
44
48
  import {
45
49
  readGzipStageWorkerResult,
46
50
  reapStageFile
47
51
  } from "./chunk-IJYGIDF4.js";
48
52
  import {
49
53
  collectSourceFilesWithBudgetAsync
50
- } from "./chunk-R4L7KZ7R.js";
54
+ } from "./chunk-LKW2HFSZ.js";
51
55
  import {
52
56
  collectUntrackedIgnoredIds,
53
57
  createGitIdentityResolver,
54
58
  getProjectDataDir,
55
59
  isStaleStageFile,
56
60
  resolveGitIdentity
57
- } from "./chunk-3PO4YYOX.js";
58
- import {
59
- KIND_EXTENSIONS,
60
- detectFileKind
61
- } from "./chunk-CQY2HEH7.js";
61
+ } from "./chunk-LURFD4HD.js";
62
62
  import {
63
63
  detectFileRole
64
- } from "./chunk-PQF6YGYB.js";
64
+ } from "./chunk-UX75PTQW.js";
65
65
  import {
66
- hashContentBytes,
67
- hashFileBytes
68
- } from "./chunk-CIA7X2PZ.js";
66
+ KIND_EXTENSIONS,
67
+ detectFileKind
68
+ } from "./chunk-V4TFQY5G.js";
69
69
  import {
70
70
  withBudget,
71
71
  writeFileAtomic
72
- } from "./chunk-W26QZ3OM.js";
72
+ } from "./chunk-463WN3VP.js";
73
73
  import {
74
74
  compareOrdinal,
75
75
  escapeRegExp,
76
76
  incrementDegradationCount
77
- } from "./chunk-NHA5K226.js";
77
+ } from "./chunk-CQNXALZJ.js";
78
78
  import {
79
79
  createNdjsonLogger,
80
80
  getGlobalPiLensLogDir,
@@ -84,10 +84,10 @@ import {
84
84
  lazyEnvNumber,
85
85
  logLatency,
86
86
  nonNegativeIntEnv
87
- } from "./chunk-7CLWC2UH.js";
87
+ } from "./chunk-YVE5Q2UU.js";
88
88
  import {
89
89
  FactStore
90
- } from "./chunk-O6LCSHHI.js";
90
+ } from "./chunk-HPKC55MA.js";
91
91
  import {
92
92
  BoundedFifoMap,
93
93
  BoundedLruCache,
@@ -99,7 +99,7 @@ import {
99
99
  relativeInside,
100
100
  toPosix,
101
101
  toProjectRelativePath
102
- } from "./chunk-WLD6BGON.js";
102
+ } from "./chunk-ZSPVF7KI.js";
103
103
 
104
104
  // dist/clients/review-graph/builder.js
105
105
  import { createHash as createHash2 } from "node:crypto";
@@ -381,7 +381,7 @@ function clearReviewGraphFileIr(cwd) {
381
381
  }
382
382
 
383
383
  // dist/clients/review-graph/builder.js
384
- var REVIEW_GRAPH_VERSION = "v8";
384
+ var REVIEW_GRAPH_VERSION = "v9";
385
385
  var MAIN_KINDS = /* @__PURE__ */ new Set([
386
386
  "jsts",
387
387
  "python",
@@ -2287,8 +2287,10 @@ function flushReviewGraphPersistsForTests() {
2287
2287
  writePendingOnMainThread(key, pending);
2288
2288
  }
2289
2289
  }
2290
+ var REVIEW_GRAPH_PERSIST_WAIT_MS = 2e3;
2290
2291
  async function waitForReviewGraphPersistsForTests() {
2291
- for (let attempts = 0; attempts < 200 && (_workerRequests.size > 0 || _checkpointWorkerRequests.size > 0); attempts++) {
2292
+ const deadlineAt = Date.now() + REVIEW_GRAPH_PERSIST_WAIT_MS;
2293
+ while (Date.now() < deadlineAt && (_workerRequests.size > 0 || _checkpointWorkerRequests.size > 0)) {
2292
2294
  await new Promise((resolve2) => setTimeout(resolve2, 10));
2293
2295
  }
2294
2296
  }
@@ -2486,8 +2488,8 @@ async function ensureReviewGraphFacts(filePath, cwd, facts, contentOverride) {
2486
2488
  }
2487
2489
  try {
2488
2490
  const [{ importFactProvider }, { functionFactProvider }] = await Promise.all([
2489
- import("./chunk-TFKN5EIR.js"),
2490
- import("./chunk-HBX55MWO.js")
2491
+ import("./chunk-GZS6VPIE.js"),
2492
+ import("./chunk-TC63XRYP.js")
2491
2493
  ]);
2492
2494
  await importFactProvider.run(ctx, facts);
2493
2495
  await functionFactProvider.run(ctx, facts);
@@ -2847,7 +2849,7 @@ function addTreeSitterFile(graph, cwd, filePath, languageId, extracted, ignoredI
2847
2849
  symbolName: symbol.name,
2848
2850
  symbolKind: symbol.kind,
2849
2851
  ...qualifiedName ? { qualifiedName } : {},
2850
- exported: symbol.isExported,
2852
+ ...symbol.isExported === void 0 ? {} : { exported: symbol.isExported },
2851
2853
  metadata: {
2852
2854
  line: symbol.line,
2853
2855
  endLine: symbol.endLine,
@@ -4094,7 +4096,7 @@ function extractSymbolsAndRefsFromGraph(graph) {
4094
4096
  line: numberMetadata(node, "line") ?? 1,
4095
4097
  endLine: numberMetadata(node, "endLine"),
4096
4098
  column: numberMetadata(node, "column") ?? 1,
4097
- isExported: node.exported === true
4099
+ isExported: node.exported
4098
4100
  };
4099
4101
  nodeSymbols.set(node.id, sym);
4100
4102
  const list = allSymbols.get(node.filePath) ?? [];
@@ -1,15 +1,15 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  getGlobalPiLensDir
4
- } from "./chunk-3PO4YYOX.js";
4
+ } from "./chunk-LURFD4HD.js";
5
5
  import {
6
6
  getTurnId
7
- } from "./chunk-7CLWC2UH.js";
7
+ } from "./chunk-YVE5Q2UU.js";
8
8
  import {
9
9
  BoundedFifoMap,
10
10
  realpathOrResolve,
11
11
  walkUpDirs
12
- } from "./chunk-WLD6BGON.js";
12
+ } from "./chunk-ZSPVF7KI.js";
13
13
  import {
14
14
  __export
15
15
  } from "./chunk-NXL4FFQQ.js";
@@ -5,65 +5,62 @@ import {
5
5
  import {
6
6
  formatToolFailure,
7
7
  spawnFailedWithNoOutput
8
- } from "./chunk-SDYLT45T.js";
8
+ } from "./chunk-ZX6OKBVO.js";
9
9
  import {
10
- createAvailabilityChecker,
11
- findManagedNodeToolBinary,
12
10
  getManagedToolEnvironment,
13
- resolveAvailableOrInstall
14
- } from "./chunk-PKWEBMCA.js";
15
- import "./chunk-AXAR5ZW2.js";
16
- import "./chunk-7WKVCZI4.js";
17
- import "./chunk-2H5GHZKC.js";
18
- import "./chunk-QV3JPCMK.js";
19
- import "./chunk-NNEQOC3U.js";
20
- import "./chunk-CXQYK4YT.js";
21
- import "./chunk-ZQSSO7LO.js";
22
- import "./chunk-AZG5UJYY.js";
23
- import "./chunk-P5MSLVUW.js";
24
- import "./chunk-ADYQRETD.js";
25
- import "./chunk-DI4AZZNY.js";
11
+ resolveToolCommandWithInstallFallback,
12
+ toolBinaryVerdict
13
+ } from "./chunk-RK5RBREN.js";
14
+ import "./chunk-KMY2OU4T.js";
15
+ import "./chunk-ZIF4WLWR.js";
16
+ import "./chunk-BG7KHGNX.js";
17
+ import "./chunk-EQKF6BAK.js";
18
+ import "./chunk-GWZZOJD2.js";
19
+ import "./chunk-MVG2ZEAO.js";
20
+ import "./chunk-IDKLWVKY.js";
21
+ import "./chunk-F6QAJXQV.js";
22
+ import "./chunk-HKPJTI47.js";
26
23
  import "./chunk-2APSZHHI.js";
27
24
  import "./chunk-2BEMIWEW.js";
28
25
  import "./chunk-IJYGIDF4.js";
29
26
  import {
30
27
  logSessionStart
31
- } from "./chunk-B2OXE4AH.js";
32
- import "./chunk-LVLPA32Q.js";
28
+ } from "./chunk-VC3W54G3.js";
29
+ import "./chunk-GVE5VZYQ.js";
33
30
  import {
34
31
  findLocalBinUpwards,
32
+ isProjectLocalBinPath,
35
33
  localBinPath
36
- } from "./chunk-LGH2HHZG.js";
37
- import "./chunk-KXGTLAUW.js";
38
- import "./chunk-TQWRH25U.js";
39
- import "./chunk-UYXV5NIS.js";
40
- import "./chunk-KNSOA43J.js";
34
+ } from "./chunk-YZNARDMM.js";
35
+ import "./chunk-JWW3ODBN.js";
36
+ import "./chunk-J2DAHH4T.js";
41
37
  import {
42
38
  createAvailabilityLatch,
43
39
  describeUnavailability
44
- } from "./chunk-6GLMMGCX.js";
45
- import "./chunk-XSC3BCN3.js";
46
- import "./chunk-27JQHK7Y.js";
47
- import "./chunk-R4L7KZ7R.js";
48
- import "./chunk-74AMPWNC.js";
40
+ } from "./chunk-KDPZA2UE.js";
41
+ import "./chunk-Y3ZNOZZS.js";
42
+ import "./chunk-6REF4GCO.js";
43
+ import "./chunk-LKW2HFSZ.js";
44
+ import "./chunk-KW7O72AK.js";
45
+ import "./chunk-TQWRH25U.js";
46
+ import "./chunk-UYXV5NIS.js";
49
47
  import {
50
48
  getProjectDataDir,
51
49
  listNestedLinkedWorktreeRoots,
52
50
  safeSpawnAsync
53
- } from "./chunk-3PO4YYOX.js";
54
- import "./chunk-5JB4WENL.js";
51
+ } from "./chunk-LURFD4HD.js";
52
+ import "./chunk-3UHGSUVL.js";
55
53
  import "./chunk-QYF5S6P6.js";
56
- import "./chunk-CQY2HEH7.js";
57
- import "./chunk-PQF6YGYB.js";
58
- import "./chunk-LOEJFTF2.js";
59
- import "./chunk-CIA7X2PZ.js";
60
- import "./chunk-W26QZ3OM.js";
54
+ import "./chunk-UX75PTQW.js";
55
+ import "./chunk-V4TFQY5G.js";
56
+ import "./chunk-D2LFEA5U.js";
57
+ import "./chunk-463WN3VP.js";
61
58
  import {
62
59
  createSubsystemLogger,
63
60
  incrementDegradationCount
64
- } from "./chunk-NHA5K226.js";
61
+ } from "./chunk-CQNXALZJ.js";
65
62
  import "./chunk-S26LC76R.js";
66
- import "./chunk-7CLWC2UH.js";
63
+ import "./chunk-YVE5Q2UU.js";
67
64
  import "./chunk-LJDODBBZ.js";
68
65
  import {
69
66
  findNearestMarkerRoot,
@@ -71,7 +68,7 @@ import {
71
68
  normalizeEphemeralMapKey,
72
69
  normalizeFilePath,
73
70
  realpathOrResolve
74
- } from "./chunk-WLD6BGON.js";
71
+ } from "./chunk-ZSPVF7KI.js";
75
72
  import "./chunk-NXL4FFQQ.js";
76
73
 
77
74
  // dist/clients/knip-client.js
@@ -179,11 +176,6 @@ function nestedWorktreeScope(targetDir) {
179
176
  }
180
177
  var MAX_RECORDED_TOOLCHAINS = 32;
181
178
  var KnipClient = class {
182
- knipAvailability = createAvailabilityChecker("knip", ".cmd", ["--version"], {
183
- environment: (cwd) => getManagedToolEnvironment("knip", cwd),
184
- unclassifiedFailureOutcome: "missing",
185
- fastPath: () => findManagedNodeToolBinary("knip")
186
- });
187
179
  /**
188
180
  * Client-side memo. Only a DURABLE verdict is latched — a transient probe
189
181
  * failure expires, so an installed knip becomes available again without a
@@ -289,13 +281,14 @@ var KnipClient = class {
289
281
  }
290
282
  async doEnsureAvailable() {
291
283
  const cwd = process.cwd();
292
- const resolved = await resolveAvailableOrInstall(this.knipAvailability, "knip", cwd);
284
+ const resolved = await resolveToolCommandWithInstallFallback(cwd, "knip");
293
285
  if (resolved !== null) {
294
- this.knipCommand = resolved;
286
+ if (!isProjectLocalBinPath(resolved, cwd))
287
+ this.knipCommand = resolved;
295
288
  this.availabilityLatch.noteAvailable();
296
289
  return true;
297
290
  }
298
- const verdict = this.knipAvailability.getVerdict(cwd);
291
+ const verdict = toolBinaryVerdict("knip", cwd);
299
292
  this.availabilityLatch.noteUnavailable(verdict.outcome ?? "missing", verdict.cause ?? "not-found");
300
293
  return false;
301
294
  }
@@ -304,7 +297,7 @@ var KnipClient = class {
304
297
  * failure must never be reported as "install knip" — knip is on disk.
305
298
  */
306
299
  unavailableResult() {
307
- const verdict = this.knipAvailability.getVerdict(process.cwd());
300
+ const verdict = toolBinaryVerdict("knip", process.cwd());
308
301
  const transient = verdict.outcome === "transient";
309
302
  const retryAfterMs = verdict.retryAtMs ? Math.max(0, verdict.retryAtMs - Date.now()) : void 0;
310
303
  return {
@@ -1,11 +1,11 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  loadPiLensProjectConfig
4
- } from "./chunk-PQF6YGYB.js";
4
+ } from "./chunk-UX75PTQW.js";
5
5
  import {
6
6
  lazyEnvNumber,
7
7
  toPositiveFinite
8
- } from "./chunk-7CLWC2UH.js";
8
+ } from "./chunk-YVE5Q2UU.js";
9
9
 
10
10
  // dist/clients/project-scale.js
11
11
  var DEFAULT_PROJECT_SCALE_BASE = 2e3;