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
@@ -4,22 +4,22 @@ import {
4
4
  readCargoDependencyNames,
5
5
  readCargoPackageName,
6
6
  readCargoWorkspaceMembers
7
- } from "./chunk-KNSOA43J.js";
7
+ } from "./chunk-J2DAHH4T.js";
8
8
  import {
9
9
  getProjectIgnoreMatcher,
10
10
  isExcludedDirName
11
- } from "./chunk-3PO4YYOX.js";
11
+ } from "./chunk-LURFD4HD.js";
12
12
  import {
13
13
  isJstsFactFile
14
- } from "./chunk-CQY2HEH7.js";
14
+ } from "./chunk-V4TFQY5G.js";
15
15
  import {
16
16
  getWorkspaceManifestMarkers
17
- } from "./chunk-LOEJFTF2.js";
17
+ } from "./chunk-D2LFEA5U.js";
18
18
  import {
19
19
  isWithinForm,
20
20
  normalizeMapKey,
21
21
  toPosix
22
- } from "./chunk-WLD6BGON.js";
22
+ } from "./chunk-ZSPVF7KI.js";
23
23
 
24
24
  // dist/clients/review-graph/workspace-modules.js
25
25
  import * as fs from "node:fs";
@@ -4,9 +4,9 @@ import {
4
4
  getOwnedLspService,
5
5
  peekOwnedLspService,
6
6
  resetOwnedLspService
7
- } from "./chunk-LQQNFCQJ.js";
8
- import "./chunk-7CLWC2UH.js";
9
- import "./chunk-WLD6BGON.js";
7
+ } from "./chunk-I65CQLCG.js";
8
+ import "./chunk-YVE5Q2UU.js";
9
+ import "./chunk-ZSPVF7KI.js";
10
10
  import "./chunk-NXL4FFQQ.js";
11
11
  export {
12
12
  configureLspServiceLifecycle,
@@ -1,10 +1,10 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  createToolchainAvailability
4
- } from "./chunk-QMWKSYWB.js";
4
+ } from "./chunk-CKJS2AUI.js";
5
5
  import {
6
6
  createSubsystemLogger
7
- } from "./chunk-NHA5K226.js";
7
+ } from "./chunk-CQNXALZJ.js";
8
8
 
9
9
  // dist/clients/go-client.js
10
10
  import * as path from "node:path";
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  resolveRunnerPath
4
- } from "./chunk-ZRQMENT4.js";
4
+ } from "./chunk-REZL4OM4.js";
5
5
  import {
6
6
  hashFileBytes
7
7
  } from "./chunk-CIA7X2PZ.js";
@@ -9,17 +9,17 @@ import {
9
9
  recordDegradationOnce,
10
10
  resolveLensToolName,
11
11
  translateGuidanceToolNames
12
- } from "./chunk-NHA5K226.js";
12
+ } from "./chunk-CQNXALZJ.js";
13
13
  import {
14
14
  freshnessFromMtime
15
15
  } from "./chunk-S26LC76R.js";
16
16
  import {
17
17
  logLatency
18
- } from "./chunk-7CLWC2UH.js";
18
+ } from "./chunk-YVE5Q2UU.js";
19
19
  import {
20
20
  normalizeMapKey,
21
21
  toProjectRelativePath
22
- } from "./chunk-WLD6BGON.js";
22
+ } from "./chunk-ZSPVF7KI.js";
23
23
 
24
24
  // dist/clients/advisory-provenance.js
25
25
  import * as fs from "node:fs";
@@ -1,32 +1,32 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  getStartupScanMaxSourceFilesDerived
4
- } from "./chunk-ADYQRETD.js";
4
+ } from "./chunk-F6QAJXQV.js";
5
5
  import {
6
6
  shouldRecurseIntoDir,
7
7
  walkTreeStackAsync,
8
8
  walkTreeStackSync
9
- } from "./chunk-74AMPWNC.js";
9
+ } from "./chunk-KW7O72AK.js";
10
10
  import {
11
11
  getProjectIgnoreMatcher
12
- } from "./chunk-3PO4YYOX.js";
12
+ } from "./chunk-LURFD4HD.js";
13
13
  import {
14
14
  isJstsFactFile
15
- } from "./chunk-CQY2HEH7.js";
15
+ } from "./chunk-V4TFQY5G.js";
16
16
  import {
17
17
  getDirectoryMarkers,
18
18
  registerWorkspaceTopologyReset
19
- } from "./chunk-LOEJFTF2.js";
19
+ } from "./chunk-D2LFEA5U.js";
20
20
  import {
21
21
  lazyEnvNumber
22
- } from "./chunk-7CLWC2UH.js";
22
+ } from "./chunk-YVE5Q2UU.js";
23
23
  import {
24
24
  BoundedLruCache,
25
25
  isAtOrAboveHomeDir,
26
26
  normalizeMapKey,
27
27
  realpathOrResolve,
28
28
  walkUpDirs
29
- } from "./chunk-WLD6BGON.js";
29
+ } from "./chunk-ZSPVF7KI.js";
30
30
 
31
31
  // dist/clients/startup-scan.js
32
32
  import * as os from "node:os";
@@ -1,14 +1,14 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  getSourceFiles
4
- } from "./chunk-27JQHK7Y.js";
4
+ } from "./chunk-6REF4GCO.js";
5
5
  import {
6
6
  readDirEntriesSafe,
7
7
  shouldRecurseIntoDir
8
- } from "./chunk-74AMPWNC.js";
8
+ } from "./chunk-KW7O72AK.js";
9
9
  import {
10
10
  getProjectIgnoreMatcher
11
- } from "./chunk-3PO4YYOX.js";
11
+ } from "./chunk-LURFD4HD.js";
12
12
  import {
13
13
  CODE_KINDS,
14
14
  DOTNET_CSHARP_ROOT_MARKERS,
@@ -17,18 +17,18 @@ import {
17
17
  LEAN_ROOT_MARKERS,
18
18
  TERRAGRUNT_FILENAMES,
19
19
  detectFileKind
20
- } from "./chunk-CQY2HEH7.js";
20
+ } from "./chunk-V4TFQY5G.js";
21
21
  import {
22
22
  findNearestDirWithAnyBasename,
23
23
  registerWorkspaceTopologyReset
24
- } from "./chunk-LOEJFTF2.js";
24
+ } from "./chunk-D2LFEA5U.js";
25
25
  import {
26
26
  BoundedLruCache,
27
27
  direntsHaveMarkerGlobMatch,
28
28
  isUnderDir,
29
29
  normalizeMapKey,
30
30
  realpathOrResolve
31
- } from "./chunk-WLD6BGON.js";
31
+ } from "./chunk-ZSPVF7KI.js";
32
32
 
33
33
  // dist/clients/language-profile.js
34
34
  import * as fs from "node:fs";
@@ -2,56 +2,53 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  resolveToolCommandWithInstallFallback,
4
4
  ruffConfigArgs
5
- } from "./chunk-PKWEBMCA.js";
6
- import "./chunk-AXAR5ZW2.js";
7
- import "./chunk-7WKVCZI4.js";
8
- import "./chunk-2H5GHZKC.js";
9
- import "./chunk-QV3JPCMK.js";
10
- import "./chunk-NNEQOC3U.js";
11
- import "./chunk-CXQYK4YT.js";
12
- import "./chunk-ZQSSO7LO.js";
13
- import "./chunk-AZG5UJYY.js";
14
- import "./chunk-P5MSLVUW.js";
15
- import "./chunk-ADYQRETD.js";
16
- import "./chunk-DI4AZZNY.js";
5
+ } from "./chunk-RK5RBREN.js";
6
+ import "./chunk-KMY2OU4T.js";
7
+ import "./chunk-ZIF4WLWR.js";
8
+ import "./chunk-BG7KHGNX.js";
9
+ import "./chunk-EQKF6BAK.js";
10
+ import "./chunk-GWZZOJD2.js";
11
+ import "./chunk-MVG2ZEAO.js";
12
+ import "./chunk-IDKLWVKY.js";
13
+ import "./chunk-F6QAJXQV.js";
14
+ import "./chunk-HKPJTI47.js";
17
15
  import "./chunk-2APSZHHI.js";
18
16
  import "./chunk-2BEMIWEW.js";
19
17
  import "./chunk-IJYGIDF4.js";
20
- import "./chunk-B2OXE4AH.js";
18
+ import "./chunk-VC3W54G3.js";
21
19
  import {
22
20
  resolveToolCwd
23
- } from "./chunk-LVLPA32Q.js";
24
- import "./chunk-LGH2HHZG.js";
25
- import "./chunk-KXGTLAUW.js";
21
+ } from "./chunk-GVE5VZYQ.js";
22
+ import "./chunk-YZNARDMM.js";
23
+ import "./chunk-JWW3ODBN.js";
24
+ import "./chunk-J2DAHH4T.js";
25
+ import "./chunk-KDPZA2UE.js";
26
+ import "./chunk-Y3ZNOZZS.js";
27
+ import "./chunk-6REF4GCO.js";
28
+ import "./chunk-LKW2HFSZ.js";
29
+ import "./chunk-KW7O72AK.js";
26
30
  import "./chunk-TQWRH25U.js";
27
31
  import "./chunk-UYXV5NIS.js";
28
- import "./chunk-KNSOA43J.js";
29
- import "./chunk-6GLMMGCX.js";
30
- import "./chunk-XSC3BCN3.js";
31
- import "./chunk-27JQHK7Y.js";
32
- import "./chunk-R4L7KZ7R.js";
33
- import "./chunk-74AMPWNC.js";
34
32
  import {
35
33
  safeSpawnAsync
36
- } from "./chunk-3PO4YYOX.js";
37
- import "./chunk-5JB4WENL.js";
34
+ } from "./chunk-LURFD4HD.js";
35
+ import "./chunk-3UHGSUVL.js";
38
36
  import "./chunk-QYF5S6P6.js";
37
+ import "./chunk-UX75PTQW.js";
39
38
  import {
40
39
  isFileKind
41
- } from "./chunk-CQY2HEH7.js";
42
- import "./chunk-PQF6YGYB.js";
43
- import "./chunk-LOEJFTF2.js";
44
- import "./chunk-CIA7X2PZ.js";
45
- import "./chunk-W26QZ3OM.js";
40
+ } from "./chunk-V4TFQY5G.js";
41
+ import "./chunk-D2LFEA5U.js";
42
+ import "./chunk-463WN3VP.js";
46
43
  import {
47
44
  createSubsystemLogger
48
- } from "./chunk-NHA5K226.js";
45
+ } from "./chunk-CQNXALZJ.js";
49
46
  import "./chunk-S26LC76R.js";
50
- import "./chunk-7CLWC2UH.js";
47
+ import "./chunk-YVE5Q2UU.js";
51
48
  import "./chunk-LJDODBBZ.js";
52
49
  import {
53
50
  pathsEqual
54
- } from "./chunk-WLD6BGON.js";
51
+ } from "./chunk-ZSPVF7KI.js";
55
52
  import "./chunk-NXL4FFQQ.js";
56
53
 
57
54
  // dist/clients/ruff-client.js
@@ -2,9 +2,8 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  isWithinIdentity,
4
4
  normalizeFilePath,
5
- normalizeLoggedPath,
6
- pathsEqual
7
- } from "./chunk-WLD6BGON.js";
5
+ normalizeLoggedPath
6
+ } from "./chunk-ZSPVF7KI.js";
8
7
 
9
8
  // dist/clients/env-utils.js
10
9
  function isTestMode() {
@@ -47,6 +46,71 @@ function lazyEnvNumber(envName, fallback) {
47
46
  };
48
47
  }
49
48
 
49
+ // dist/clients/process-singletons.js
50
+ var SINGLETON_HOST_KEY = /* @__PURE__ */ Symbol.for("pi-lens.process-singletons.v1");
51
+ var SINGLETON_SCHEMA = "pi-lens.process-singletons";
52
+ var PROCESS_SINGLETON_RESET_KIND = "process-singleton-reset";
53
+ var singletonHost = globalThis;
54
+ function container() {
55
+ const existing = singletonHost[SINGLETON_HOST_KEY];
56
+ if (existing instanceof Map)
57
+ return existing;
58
+ const fresh = /* @__PURE__ */ new Map();
59
+ singletonHost[SINGLETON_HOST_KEY] = fresh;
60
+ return fresh;
61
+ }
62
+ function isAdoptable(cell2, version) {
63
+ if (!cell2 || typeof cell2 !== "object")
64
+ return false;
65
+ const candidate = cell2;
66
+ return candidate.schema === SINGLETON_SCHEMA && candidate.version === version && candidate.value !== void 0;
67
+ }
68
+ var PROCESS_SINGLETON_RESET_LOG_FAMILY = "process-singleton-reset-log";
69
+ var RESET_LOG_FAMILY = PROCESS_SINGLETON_RESET_LOG_FAMILY;
70
+ var RESET_LOG_VERSION = 1;
71
+ var RESET_LOG_CAP = 16;
72
+ function resetLog() {
73
+ return getProcessSingleton(RESET_LOG_FAMILY, RESET_LOG_VERSION, () => ({
74
+ entries: []
75
+ }));
76
+ }
77
+ function recordIncompatibleCell(family, wantedVersion, found) {
78
+ if (family === RESET_LOG_FAMILY)
79
+ return;
80
+ const log = resetLog();
81
+ if (log.entries.some((entry) => entry.family === family))
82
+ return;
83
+ if (log.entries.length >= RESET_LOG_CAP)
84
+ return;
85
+ log.entries.push({
86
+ family,
87
+ reason: `incompatible process singleton discarded (found schema=${String(found.schema)} version=${String(found.version)}, this build wants schema=${SINGLETON_SCHEMA} version=${wantedVersion})`
88
+ });
89
+ }
90
+ function getProcessSingletonResets() {
91
+ return resetLog().entries.map((entry) => ({ ...entry }));
92
+ }
93
+ function getProcessSingleton(family, version, create, onIncompatible) {
94
+ const cells = container();
95
+ const existing = cells.get(family);
96
+ if (isAdoptable(existing, version))
97
+ return existing.value;
98
+ if (existing !== void 0) {
99
+ recordIncompatibleCell(family, version, existing);
100
+ onIncompatible?.(existing.value);
101
+ }
102
+ const value = create();
103
+ cells.set(family, { schema: SINGLETON_SCHEMA, version, value });
104
+ return value;
105
+ }
106
+ var EVALUATION_ORDINAL_FAMILY = "module-evaluation-ordinal";
107
+ var EVALUATION_ORDINAL_VERSION = 1;
108
+ function nextModuleEvaluationOrdinal() {
109
+ const state2 = getProcessSingleton(EVALUATION_ORDINAL_FAMILY, EVALUATION_ORDINAL_VERSION, () => ({ evaluations: 0 }));
110
+ state2.evaluations += 1;
111
+ return state2.evaluations;
112
+ }
113
+
50
114
  // dist/clients/redact/secrets.js
51
115
  var PEM_BEGIN = "-----BEGIN ";
52
116
  var PEM_DELIMITER = "-----";
@@ -435,80 +499,19 @@ function redactSecrets(text) {
435
499
  return redactJwtSecrets(redactTokenSecrets(redactPrivateKeyBlocks(text)));
436
500
  }
437
501
 
438
- // dist/clients/process-singletons.js
439
- var SINGLETON_HOST_KEY = /* @__PURE__ */ Symbol.for("pi-lens.process-singletons.v1");
440
- var SINGLETON_SCHEMA = "pi-lens.process-singletons";
441
- var PROCESS_SINGLETON_RESET_KIND = "process-singleton-reset";
442
- var singletonHost = globalThis;
443
- function container() {
444
- const existing = singletonHost[SINGLETON_HOST_KEY];
445
- if (existing instanceof Map)
446
- return existing;
447
- const fresh = /* @__PURE__ */ new Map();
448
- singletonHost[SINGLETON_HOST_KEY] = fresh;
449
- return fresh;
450
- }
451
- function isAdoptable(cell, version) {
452
- if (!cell || typeof cell !== "object")
453
- return false;
454
- const candidate = cell;
455
- return candidate.schema === SINGLETON_SCHEMA && candidate.version === version && candidate.value !== void 0;
456
- }
457
- var PROCESS_SINGLETON_RESET_LOG_FAMILY = "process-singleton-reset-log";
458
- var RESET_LOG_FAMILY = PROCESS_SINGLETON_RESET_LOG_FAMILY;
459
- var RESET_LOG_VERSION = 1;
460
- var RESET_LOG_CAP = 16;
461
- function resetLog() {
462
- return getProcessSingleton(RESET_LOG_FAMILY, RESET_LOG_VERSION, () => ({
463
- entries: []
464
- }));
465
- }
466
- function recordIncompatibleCell(family, wantedVersion, found) {
467
- if (family === RESET_LOG_FAMILY)
468
- return;
469
- const log = resetLog();
470
- if (log.entries.some((entry) => entry.family === family))
471
- return;
472
- if (log.entries.length >= RESET_LOG_CAP)
473
- return;
474
- log.entries.push({
475
- family,
476
- reason: `incompatible process singleton discarded (found schema=${String(found.schema)} version=${String(found.version)}, this build wants schema=${SINGLETON_SCHEMA} version=${wantedVersion})`
477
- });
478
- }
479
- function getProcessSingletonResets() {
480
- return resetLog().entries.map((entry) => ({ ...entry }));
481
- }
482
- function getProcessSingleton(family, version, create, onIncompatible) {
483
- const cells = container();
484
- const existing = cells.get(family);
485
- if (isAdoptable(existing, version))
486
- return existing.value;
487
- if (existing !== void 0) {
488
- recordIncompatibleCell(family, version, existing);
489
- onIncompatible?.(existing.value);
490
- }
491
- const value = create();
492
- cells.set(family, { schema: SINGLETON_SCHEMA, version, value });
493
- return value;
494
- }
495
- var EVALUATION_ORDINAL_FAMILY = "module-evaluation-ordinal";
496
- var EVALUATION_ORDINAL_VERSION = 1;
497
- function nextModuleEvaluationOrdinal() {
498
- const state2 = getProcessSingleton(EVALUATION_ORDINAL_FAMILY, EVALUATION_ORDINAL_VERSION, () => ({ evaluations: 0 }));
499
- state2.evaluations += 1;
500
- return state2.evaluations;
501
- }
502
-
503
502
  // dist/clients/latency-logger.js
504
- import * as path4 from "node:path";
503
+ import * as path3 from "node:path";
505
504
 
506
505
  // dist/clients/probe-home-state.js
507
506
  import * as os from "node:os";
508
507
  import * as path from "node:path";
509
- var RESOLUTION_SLOT = /* @__PURE__ */ Symbol.for("pi-lens.probe-home-state.resolution");
508
+ function cell() {
509
+ return getProcessSingleton("probe-home-resolution", 1, () => ({
510
+ resolution: void 0
511
+ }));
512
+ }
510
513
  function getProbeHomeResolution() {
511
- return globalThis[RESOLUTION_SLOT];
514
+ return cell().resolution;
512
515
  }
513
516
  function getProbeHomeRedirectEvent() {
514
517
  return getProbeHomeResolution()?.event;
@@ -531,13 +534,12 @@ function isTestProcessTargetingRealHome(file) {
531
534
  return isWithinIdentity(path.dirname(path.resolve(file)), path.join(os.homedir(), ".pi-lens"));
532
535
  }
533
536
  function resolveProbeHomeDir() {
534
- const slot = globalThis;
535
- const cached = slot[RESOLUTION_SLOT];
536
- if (cached)
537
- return cached.probeHome;
537
+ const memo = cell();
538
+ if (memo.resolution)
539
+ return memo.resolution.probeHome;
538
540
  const cwd = process.cwd();
539
541
  const probeHome = computeProbeHomeDir(cwd);
540
- slot[RESOLUTION_SLOT] = {
542
+ memo.resolution = {
541
543
  probeHome,
542
544
  event: probeHome ? { probeHome } : void 0
543
545
  };
@@ -1060,143 +1062,10 @@ function createNdjsonLogger(options) {
1060
1062
  };
1061
1063
  }
1062
1064
 
1063
- // dist/clients/log-cleanup.js
1064
- import * as fs2 from "node:fs";
1065
- import * as path3 from "node:path";
1066
- var LOG_DIR = getGlobalPiLensLogDir();
1067
- var LOGS_SUBDIR = path3.join(LOG_DIR, "logs");
1068
- function getManagedLogFiles(dir = LOG_DIR) {
1069
- const names = /* @__PURE__ */ new Set();
1070
- for (const absPath of getRegisteredLogFiles()) {
1071
- if (pathsEqual(path3.dirname(absPath), dir)) {
1072
- names.add(path3.basename(absPath));
1073
- }
1074
- }
1075
- try {
1076
- if (fs2.existsSync(dir)) {
1077
- for (const entry of fs2.readdirSync(dir)) {
1078
- if (entry.endsWith(".log") && !ROTATED_BACKUP_RE.test(entry)) {
1079
- names.add(entry);
1080
- }
1081
- }
1082
- }
1083
- } catch {
1084
- }
1085
- return [...names].sort((a, b) => a.localeCompare(b));
1086
- }
1087
- var ROTATED_BACKUP_RE = /(\.\d{4}-\d{2}-\d{2}T.*\.log|\.log\..+)$/;
1065
+ // dist/clients/log-rotation-limits.js
1088
1066
  function getMaxLogSizeMB() {
1089
1067
  return Math.max(1, Number.parseInt(process.env.PI_LENS_MAX_LOG_SIZE_MB ?? "10", 10) || 10);
1090
1068
  }
1091
- function getConfig() {
1092
- return {
1093
- retentionDays: Math.max(1, Number.parseInt(process.env.PI_LENS_LOG_RETENTION_DAYS ?? "7", 10) || 7),
1094
- maxSizeMB: getMaxLogSizeMB()
1095
- };
1096
- }
1097
- function getFileAgeDays(filePath) {
1098
- try {
1099
- const stats = fs2.statSync(filePath);
1100
- const ageMs = Date.now() - stats.mtime.getTime();
1101
- return ageMs / (1e3 * 60 * 60 * 24);
1102
- } catch {
1103
- return 0;
1104
- }
1105
- }
1106
- function getFileSizeMB(filePath) {
1107
- try {
1108
- const stats = fs2.statSync(filePath);
1109
- return stats.size / (1024 * 1024);
1110
- } catch {
1111
- return 0;
1112
- }
1113
- }
1114
- function cleanupOldLogs(directory, pattern, retentionDays) {
1115
- const config = getConfig();
1116
- const maxAge = retentionDays ?? config.retentionDays;
1117
- const deleted = [];
1118
- const errors = [];
1119
- try {
1120
- if (!fs2.existsSync(directory)) {
1121
- return { deleted, errors };
1122
- }
1123
- const files = fs2.readdirSync(directory);
1124
- for (const file of files) {
1125
- if (!pattern.test(file))
1126
- continue;
1127
- const filePath = path3.join(directory, file);
1128
- const ageDays = getFileAgeDays(filePath);
1129
- if (ageDays > maxAge) {
1130
- try {
1131
- fs2.unlinkSync(filePath);
1132
- deleted.push(file);
1133
- } catch (err) {
1134
- errors.push(`${file}: ${err}`);
1135
- }
1136
- }
1137
- }
1138
- } catch (err) {
1139
- errors.push(`Directory read failed: ${err}`);
1140
- }
1141
- return { deleted, errors };
1142
- }
1143
- function rotateLogIfNeeded(logFile, maxSizeMB) {
1144
- const config = getConfig();
1145
- const maxSize = maxSizeMB ?? config.maxSizeMB;
1146
- const sizeMB = getFileSizeMB(logFile);
1147
- if (sizeMB < maxSize) {
1148
- return { rotated: false };
1149
- }
1150
- try {
1151
- const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
1152
- const ext = path3.extname(logFile);
1153
- const base = logFile.slice(0, -ext.length);
1154
- const backupFile = `${base}.${timestamp}${ext}`;
1155
- fs2.renameSync(logFile, backupFile);
1156
- fs2.writeFileSync(logFile, "", "utf8");
1157
- return { rotated: true, newFile: backupFile };
1158
- } catch {
1159
- return { rotated: false };
1160
- }
1161
- }
1162
- function runLogCleanup(dbg) {
1163
- const config = getConfig();
1164
- const results = {
1165
- cleaned: 0,
1166
- rotated: 0,
1167
- report: ""
1168
- };
1169
- const dailyLogs = cleanupOldLogs(LOGS_SUBDIR, /\.jsonl$/, config.retentionDays);
1170
- results.cleaned += dailyLogs.deleted.length;
1171
- const rotatedLogs = cleanupOldLogs(LOG_DIR, ROTATED_BACKUP_RE, config.retentionDays);
1172
- results.cleaned += rotatedLogs.deleted.length;
1173
- const mainLogs = getManagedLogFiles().map((name) => path3.join(LOG_DIR, name));
1174
- for (const logFile of mainLogs) {
1175
- const rotation = rotateLogIfNeeded(logFile, config.maxSizeMB);
1176
- if (rotation.rotated) {
1177
- results.rotated++;
1178
- if (rotation.newFile) {
1179
- const sizeMB = getFileSizeMB(rotation.newFile);
1180
- dbg?.(`log_cleanup: rotated ${path3.basename(logFile)} (${sizeMB.toFixed(1)}MB) \u2192 ${path3.basename(rotation.newFile)}`);
1181
- }
1182
- }
1183
- }
1184
- const parts = [];
1185
- if (dailyLogs.deleted.length > 0) {
1186
- parts.push(`${dailyLogs.deleted.length} daily logs`);
1187
- }
1188
- if (rotatedLogs.deleted.length > 0) {
1189
- parts.push(`${rotatedLogs.deleted.length} rotated logs`);
1190
- }
1191
- if (results.rotated > 0) {
1192
- parts.push(`${results.rotated} active logs rotated`);
1193
- }
1194
- results.report = parts.length > 0 ? `log_cleanup: removed ${parts.join(", ")} (retention: ${config.retentionDays}d, maxSize: ${config.maxSizeMB}MB)` : `log_cleanup: no cleanup needed (retention: ${config.retentionDays}d, maxSize: ${config.maxSizeMB}MB)`;
1195
- if (dailyLogs.errors.length > 0 || rotatedLogs.errors.length > 0) {
1196
- dbg?.(`log_cleanup errors: ${[...dailyLogs.errors, ...rotatedLogs.errors].join("; ")}`);
1197
- }
1198
- return results;
1199
- }
1200
1069
 
1201
1070
  // dist/clients/turn-context.js
1202
1071
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -1238,7 +1107,7 @@ function getTurnId() {
1238
1107
 
1239
1108
  // dist/clients/latency-logger.js
1240
1109
  var LATENCY_LOG_DIR = getGlobalPiLensLogDir();
1241
- var LATENCY_LOG_FILE = path4.join(LATENCY_LOG_DIR, "latency.log");
1110
+ var LATENCY_LOG_FILE = path3.join(LATENCY_LOG_DIR, "latency.log");
1242
1111
  var writer = createNdjsonLogger({
1243
1112
  filePath: LATENCY_LOG_FILE,
1244
1113
  maxBytes: getMaxLogSizeMB() * 1024 * 1024
@@ -1358,10 +1227,16 @@ export {
1358
1227
  toPositiveFinite,
1359
1228
  nonNegativeIntEnv,
1360
1229
  lazyEnvNumber,
1230
+ PROCESS_SINGLETON_RESET_KIND,
1231
+ getProcessSingletonResets,
1232
+ getProcessSingleton,
1233
+ nextModuleEvaluationOrdinal,
1361
1234
  getProbeHomeRedirectEvent,
1362
1235
  getGlobalPiLensLogDir,
1363
1236
  machineStateDir,
1237
+ getMaxLogSizeMB,
1364
1238
  redactSecrets,
1239
+ getRegisteredLogFiles,
1365
1240
  getSinkWriteFailures,
1366
1241
  resetSinkWriteFailures,
1367
1242
  getSinkRotations,
@@ -1369,12 +1244,6 @@ export {
1369
1244
  getSinkTruncateRefusals,
1370
1245
  getSinkOptionConflicts,
1371
1246
  createNdjsonLogger,
1372
- getMaxLogSizeMB,
1373
- runLogCleanup,
1374
- PROCESS_SINGLETON_RESET_KIND,
1375
- getProcessSingletonResets,
1376
- getProcessSingleton,
1377
- nextModuleEvaluationOrdinal,
1378
1247
  setTurnContextSession,
1379
1248
  beginTurnContext,
1380
1249
  getTurnId,