pi-lens 4.4.4 → 4.4.5

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 (179) hide show
  1. package/CHANGELOG.md +440 -0
  2. package/README.md +13 -3
  3. package/config/dependency-cruiser-eager-allowlist.json +1 -0
  4. package/dist/chunk-22Y2BM7H.js +23 -0
  5. package/dist/{chunk-ATKJFDQN.js → chunk-27VWVB23.js} +12 -14
  6. package/dist/{chunk-S2HEXIWI.js → chunk-2FYKETQJ.js} +10 -6
  7. package/dist/{chunk-SRYEJNES.js → chunk-2LDMXL2M.js} +2 -2
  8. package/dist/{chunk-ZHH37KZL.js → chunk-2SDHYHHO.js} +17 -17
  9. package/dist/chunk-2Y6OJRSI.js +38 -0
  10. package/dist/chunk-3SNDVPOR.js +507 -0
  11. package/dist/{chunk-5OFV52AM.js → chunk-3WCEHYOI.js} +1 -1
  12. package/dist/chunk-44X7VIKR.js +73 -0
  13. package/dist/{chunk-DEL2U6CM.js → chunk-4FHUGDKU.js} +16 -14
  14. package/dist/{chunk-CT4MN5IU.js → chunk-4ODSZ35Z.js} +353 -359
  15. package/dist/{chunk-ZIVJBOO3.js → chunk-4U7GDSZQ.js} +2 -2
  16. package/dist/chunk-54NIOJJZ.js +25 -0
  17. package/dist/{chunk-N5FLEO7W.js → chunk-5DKE4HGX.js} +37 -37
  18. package/dist/{chunk-P63GXC37.js → chunk-5LRUKYFA.js} +31 -4
  19. package/dist/{chunk-HRNHZA3N.js → chunk-63NMUNYP.js} +12 -16
  20. package/dist/{chunk-HWCCCQNX.js → chunk-6XSESGWD.js} +13 -6
  21. package/dist/{chunk-UMS2MFPZ.js → chunk-72J27ICO.js} +2 -3
  22. package/dist/{chunk-ED36RF6Y.js → chunk-7FLRUH6B.js} +1 -1
  23. package/dist/chunk-7IYC4ENJ.js +297 -0
  24. package/dist/chunk-7WWQAW5P.js +30 -0
  25. package/dist/{chunk-3DA2JDOL.js → chunk-7ZS7MC24.js} +551 -203
  26. package/dist/{chunk-WMYE35PX.js → chunk-AHWA4AKM.js} +7 -5
  27. package/dist/{chunk-JW3YWBVB.js → chunk-AI3GP74G.js} +17 -19
  28. package/dist/{chunk-AGSS7277.js → chunk-APFJKOP6.js} +6 -23
  29. package/dist/{chunk-ZVUL7QYY.js → chunk-ASRAO7KG.js} +29 -32
  30. package/dist/{chunk-BW5KFIQC.js → chunk-AWQWXSW4.js} +1 -0
  31. package/dist/{chunk-TLX72JTG.js → chunk-CG5V25HX.js} +1 -1
  32. package/dist/chunk-CKEQFGLT.js +32 -0
  33. package/dist/{chunk-Y6GZHWSJ.js → chunk-COOUUC5W.js} +6 -6
  34. package/dist/{chunk-XTBDCR27.js → chunk-CPZ5JJW6.js} +4 -4
  35. package/dist/{chunk-RKKOYPRA.js → chunk-DS2USX5G.js} +13 -15
  36. package/dist/chunk-EA2ZRG44.js +27 -0
  37. package/dist/{chunk-GSLNCYGG.js → chunk-EDMLIW6W.js} +13 -14
  38. package/dist/{chunk-2EECBNC5.js → chunk-EIKRZ32J.js} +75 -0
  39. package/dist/chunk-EKNWOL2I.js +27 -0
  40. package/dist/{chunk-R3T7CLQ2.js → chunk-ELZRSR5N.js} +41 -41
  41. package/dist/{chunk-GMX5OS7B.js → chunk-EN5AM7PX.js} +11 -12
  42. package/dist/{chunk-3RKP3FMS.js → chunk-EWXXLS26.js} +226 -24
  43. package/dist/chunk-EX4EXBW7.js +37 -0
  44. package/dist/{chunk-XHJBS436.js → chunk-EXVXBSGN.js} +25 -25
  45. package/dist/{chunk-MZGQNL3Y.js → chunk-F7BO6FWH.js} +12 -13
  46. package/dist/{chunk-V35JG4JB.js → chunk-FEDWAYDS.js} +152 -334
  47. package/dist/{chunk-J64T55EI.js → chunk-FWZRGGGY.js} +73 -9
  48. package/dist/{chunk-T57LYLZT.js → chunk-G224FADB.js} +1 -1
  49. package/dist/chunk-G5UCJFT7.js +26 -0
  50. package/dist/{chunk-LLJNQKQW.js → chunk-GLW3YDZZ.js} +20 -13
  51. package/dist/{chunk-GXFV6MYU.js → chunk-GTDSYEA2.js} +72 -39
  52. package/dist/{chunk-DUO2TU77.js → chunk-GYRZ72R4.js} +10 -4
  53. package/dist/chunk-HYVXA3BB.js +49 -0
  54. package/dist/{chunk-W66O5E25.js → chunk-IEBJF3PN.js} +13 -15
  55. package/dist/{chunk-GAQ7OQG6.js → chunk-IL7K66ZQ.js} +83 -94
  56. package/dist/{chunk-T7FEBKXN.js → chunk-JWOVP5BL.js} +7 -9
  57. package/dist/{chunk-UBOQLVT2.js → chunk-K2GUZ4DN.js} +4 -4
  58. package/dist/{chunk-5VSF4UUQ.js → chunk-K4SZB56V.js} +34 -39
  59. package/dist/{chunk-7D6L4MTX.js → chunk-KCBRHV5E.js} +3 -3
  60. package/dist/{chunk-GSM5UU7A.js → chunk-KFXCL4OV.js} +38 -28
  61. package/dist/{chunk-J6MPGQTS.js → chunk-KJJAVH3X.js} +81 -15
  62. package/dist/{chunk-BWD5EPKO.js → chunk-KPVLQHCZ.js} +4 -6
  63. package/dist/{chunk-MPNJLASA.js → chunk-KX56K73G.js} +10 -13
  64. package/dist/{chunk-AWSCPCN2.js → chunk-LMCTHJ2H.js} +19 -19
  65. package/dist/{chunk-IWDLU6K3.js → chunk-MEFLGBCS.js} +4 -6
  66. package/dist/{chunk-TOY6QKOH.js → chunk-MKPCELNI.js} +17 -17
  67. package/dist/{chunk-POMLXPMY.js → chunk-N3PLNNCW.js} +1 -1
  68. package/dist/chunk-N5FBM25N.js +22 -0
  69. package/dist/{chunk-CYRKQRPM.js → chunk-NFNVDDGB.js} +2 -4
  70. package/dist/{chunk-RMLC67LF.js → chunk-NLIVE7L6.js} +2 -30
  71. package/dist/{chunk-24AKHFGP.js → chunk-OMJ3OFBJ.js} +6 -6
  72. package/dist/{chunk-IQWN5JCP.js → chunk-OZNCKLOX.js} +13 -14
  73. package/dist/chunk-P5XUGPIX.js +31 -0
  74. package/dist/{chunk-2KXTHF3M.js → chunk-PJXNTPB2.js} +253 -33
  75. package/dist/chunk-PKOXJIVT.js +88 -0
  76. package/dist/{chunk-DGUKIYSI.js → chunk-PP2A5V2T.js} +8 -10
  77. package/dist/{chunk-KAPJINKN.js → chunk-Q42LJANT.js} +2 -2
  78. package/dist/{chunk-UZ2XCLYS.js → chunk-Q4BKKOVC.js} +8 -8
  79. package/dist/{chunk-TIQ2PKDW.js → chunk-QT66NEYN.js} +4 -4
  80. package/dist/{chunk-U44DJXQP.js → chunk-RCHO5W7M.js} +15 -18
  81. package/dist/{chunk-YH5MVY2U.js → chunk-RG3MXTRI.js} +7 -7
  82. package/dist/chunk-RG7OODGM.js +57 -0
  83. package/dist/{chunk-OHKJ7PQF.js → chunk-RU34BA4D.js} +43 -39
  84. package/dist/{chunk-JMYYOTQG.js → chunk-S26LC76R.js} +13 -1
  85. package/dist/{chunk-XBJVAEEO.js → chunk-S55TEC7I.js} +3 -2
  86. package/dist/{chunk-RVK72CZX.js → chunk-SJHC3BCZ.js} +1397 -481
  87. package/dist/{chunk-IYNJ6YPZ.js → chunk-SNEUMLM7.js} +4 -4
  88. package/dist/{chunk-S67KYG37.js → chunk-T4NGVFYI.js} +2 -2
  89. package/dist/{chunk-YCWYO6TQ.js → chunk-THEXI2QO.js} +48 -45
  90. package/dist/{chunk-AMERCH6V.js → chunk-TL2TCJYL.js} +15 -16
  91. package/dist/{chunk-KUA4OJ5Y.js → chunk-TPYYEDP5.js} +823 -350
  92. package/dist/{chunk-YNE3RP52.js → chunk-TVZRLTG6.js} +8 -1
  93. package/dist/{chunk-ROYSX2S5.js → chunk-UCVMSOXF.js} +2 -2
  94. package/dist/chunk-UL5SXQVX.js +32 -0
  95. package/dist/{chunk-7HXE67BN.js → chunk-UO66IMVP.js} +2 -2
  96. package/dist/{chunk-VOOAPROD.js → chunk-UVY4TOJH.js} +3 -3
  97. package/dist/{chunk-RKBXZN3A.js → chunk-VIDEKABZ.js} +2 -2
  98. package/dist/{chunk-2FN63LPV.js → chunk-VITFDI3O.js} +13 -14
  99. package/dist/{chunk-6DLWKFEX.js → chunk-VUAVE3QC.js} +41 -42
  100. package/dist/{chunk-FM4RDMKT.js → chunk-WUY4BZEP.js} +10 -12
  101. package/dist/{chunk-SD4I7ZO4.js → chunk-X3UTCXAA.js} +43 -53
  102. package/dist/chunk-XHDBJODR.js +45 -0
  103. package/dist/{chunk-5IUSNGOC.js → chunk-XHLK33VM.js} +28 -21
  104. package/dist/{chunk-3KAZU3VR.js → chunk-XI34NWDI.js} +2 -2
  105. package/dist/{chunk-QBFBRV2B.js → chunk-XWFIHYCH.js} +4 -2
  106. package/dist/{chunk-JUKMK5Y4.js → chunk-Y2TPADJR.js} +10 -11
  107. package/dist/{chunk-EBC36LNN.js → chunk-Y5KTA2OB.js} +17 -17
  108. package/dist/{chunk-HYGZEMX6.js → chunk-YKVDBNPO.js} +11 -5
  109. package/dist/{chunk-KN35K52N.js → chunk-YSDPVDFC.js} +3 -3
  110. package/dist/chunk-YWNO5Q4R.js +44 -0
  111. package/dist/{chunk-US7ECLD7.js → chunk-YWWG4AQA.js} +119 -28
  112. package/dist/{chunk-O4NWQT6I.js → chunk-YXDCRUKQ.js} +4 -4
  113. package/dist/{chunk-XYURS6EN.js → chunk-YXGRRORB.js} +15 -17
  114. package/dist/{chunk-IUE7SSKV.js → chunk-ZAPSUBLU.js} +13 -7
  115. package/dist/{chunk-EUXZEFTV.js → chunk-ZPJM7DID.js} +3 -3
  116. package/dist/{chunk-5HSRT26B.js → chunk-ZSUX7KEM.js} +16 -15
  117. package/dist/index.js +37155 -32210
  118. package/dist/mcp/analyze-cli.js +11 -12
  119. package/dist/mcp/cli.js +46 -45
  120. package/dist/mcp/server.js +1210 -574
  121. package/dist/mcp/worker.js +65 -65
  122. package/dist/probes/installer.js +21 -23
  123. package/docs/adr/0010-trace-validation-session-lifecycle.md +390 -0
  124. package/docs/adr/README.md +1 -0
  125. package/docs/ast-grep_rules_catalog.md +5 -3
  126. package/docs/configuration.md +9 -0
  127. package/docs/engineering-principles.md +12 -0
  128. package/docs/environment-variables.md +20 -0
  129. package/docs/features.md +16 -1
  130. package/docs/globalconfig.md +37 -8
  131. package/docs/lsp-capability-matrix.md +105 -12
  132. package/docs/lsp-idle-eviction.md +37 -18
  133. package/docs/pi-lens-fixer.md +22 -1
  134. package/docs/pi-lens-investigator.md +14 -0
  135. package/docs/pi-lens-merge-policy.md +23 -10
  136. package/docs/pi-lens-monitor.md +64 -8
  137. package/docs/pi-lens-retro.md +2 -2
  138. package/docs/pi-lens-reviewer.md +48 -1
  139. package/docs/pi-lens-subagent.md +8 -1
  140. package/docs/release-qa-baseline.md +19 -7
  141. package/docs/servercapabilities.md +47 -47
  142. package/docs/settings.md +9 -5
  143. package/docs/subagent-compat.md +1 -1
  144. package/docs/usage.md +1 -0
  145. package/package.json +6 -4
  146. package/rules/ast-grep-rules/rule-tests/no-return-value-in-generator-test.yml +17 -0
  147. package/rules/ast-grep-rules/rule-tests/no-sql-in-code-execute-js-test.yml +86 -0
  148. package/rules/ast-grep-rules/rule-tests/no-sql-in-code-execute-test.yml +86 -0
  149. package/rules/ast-grep-rules/rule-tests/unchecked-numeric-parse-python-test.yml +15 -0
  150. package/rules/ast-grep-rules/rules/no-return-value-in-generator.yml +9 -4
  151. package/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +119 -0
  152. package/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +119 -0
  153. package/rules/ast-grep-rules/rules/unchecked-numeric-parse-python.yml +13 -2
  154. package/rules/rule-catalog.json +25 -1
  155. package/scripts/analyze-pi-lens-logs.mjs +15 -5
  156. package/scripts/lib/is-main-module.mjs +27 -0
  157. package/scripts/lib/scratch-home-env.mjs +21 -0
  158. package/scripts/rpc-load-check.mjs +4 -6
  159. package/scripts/warm-loader-cache.mjs +2 -5
  160. package/dist/chunk-3PTHXJXR.js +0 -28
  161. package/dist/chunk-3QED2P4V.js +0 -31
  162. package/dist/chunk-5WRPDP2A.js +0 -47
  163. package/dist/chunk-ABBOA7UD.js +0 -157
  164. package/dist/chunk-CUHSHSB6.js +0 -273
  165. package/dist/chunk-GL5LUMZE.js +0 -51
  166. package/dist/chunk-HAD7QRQI.js +0 -30
  167. package/dist/chunk-JORED7EX.js +0 -44
  168. package/dist/chunk-KYUB6QDC.js +0 -72
  169. package/dist/chunk-LZSEQW6A.js +0 -57
  170. package/dist/chunk-M2IFVFWU.js +0 -79
  171. package/dist/chunk-M2UD3LPU.js +0 -88
  172. package/dist/chunk-MBKQHGA7.js +0 -39
  173. package/dist/chunk-R7YOCSNV.js +0 -23
  174. package/dist/chunk-SKAMFC7A.js +0 -28
  175. package/dist/chunk-SYE6T2EB.js +0 -28
  176. package/dist/chunk-TRETHTQO.js +0 -26
  177. package/dist/chunk-UA7ZXYDR.js +0 -184
  178. package/dist/chunk-XTFDJI3T.js +0 -24
  179. package/dist/chunk-Z3CCVDUB.js +0 -76
@@ -3,7 +3,7 @@ import {
3
3
  isUnderDir,
4
4
  normalizeFilePath,
5
5
  pathsEqual
6
- } from "./chunk-3RKP3FMS.js";
6
+ } from "./chunk-EWXXLS26.js";
7
7
 
8
8
  // dist/clients/env-utils.js
9
9
  function isTestMode() {
@@ -503,6 +503,12 @@ function getGlobalPiLensLogDir() {
503
503
  return path.resolve(override);
504
504
  return resolveProbeHomeDir() ?? path.join(os.homedir(), ".pi-lens");
505
505
  }
506
+ function machineStateDir() {
507
+ const override = process.env.PI_LENS_HOME?.trim();
508
+ if (override)
509
+ return path.resolve(override);
510
+ return path.join(os.homedir(), ".pi-lens");
511
+ }
506
512
  function isTestProcessTargetingRealHome(file) {
507
513
  if (!process.env.VITEST)
508
514
  return false;
@@ -1230,6 +1236,7 @@ export {
1230
1236
  lazyEnvNumber,
1231
1237
  getProbeHomeRedirectEvent,
1232
1238
  getGlobalPiLensLogDir,
1239
+ machineStateDir,
1233
1240
  redactSecrets,
1234
1241
  getSinkWriteFailures,
1235
1242
  resetSinkWriteFailures,
@@ -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-HYGZEMX6.js";
4
+ } from "./chunk-YKVDBNPO.js";
5
5
  import {
6
6
  createSubsystemLogger
7
- } from "./chunk-POMLXPMY.js";
7
+ } from "./chunk-N3PLNNCW.js";
8
8
 
9
9
  // dist/clients/go-client.js
10
10
  import * as path from "node:path";
@@ -0,0 +1,32 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ getGlobalPiLensDir
4
+ } from "./chunk-TPYYEDP5.js";
5
+
6
+ // dist/clients/opengrep-rule-pack.js
7
+ import * as fs from "node:fs";
8
+ import * as path from "node:path";
9
+ var OPENGREP_REGISTRY_PACK_URL = "https://semgrep.dev/c/auto";
10
+ function cachedOpengrepPackPath() {
11
+ return path.join(getGlobalPiLensDir(), "rules", "opengrep-registry.yaml");
12
+ }
13
+ function resolveOpengrepRulePack() {
14
+ const cached = cachedOpengrepPackPath();
15
+ try {
16
+ if (fs.statSync(cached).size > 0)
17
+ return cached;
18
+ } catch {
19
+ }
20
+ return void 0;
21
+ }
22
+ function stripPackRuleIdPrefix(checkId, packPath) {
23
+ const prefix = `${path.dirname(packPath).replace(/^[\\/]+/, "").replace(/[\\/:]+/g, ".")}.`;
24
+ return checkId.startsWith(prefix) ? checkId.slice(prefix.length) : checkId;
25
+ }
26
+
27
+ export {
28
+ OPENGREP_REGISTRY_PACK_URL,
29
+ cachedOpengrepPackPath,
30
+ resolveOpengrepRulePack,
31
+ stripPackRuleIdPrefix
32
+ };
@@ -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-J6MPGQTS.js";
4
+ } from "./chunk-KJJAVH3X.js";
5
5
  import {
6
6
  lazyEnvNumber,
7
7
  toPositiveFinite
8
- } from "./chunk-YNE3RP52.js";
8
+ } from "./chunk-TVZRLTG6.js";
9
9
 
10
10
  // dist/clients/project-scale.js
11
11
  var DEFAULT_PROJECT_SCALE_BASE = 2e3;
@@ -1,9 +1,9 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  createSubsystemLogger
4
- } from "./chunk-POMLXPMY.js";
5
- import "./chunk-YNE3RP52.js";
6
- import "./chunk-3RKP3FMS.js";
4
+ } from "./chunk-N3PLNNCW.js";
5
+ import "./chunk-TVZRLTG6.js";
6
+ import "./chunk-EWXXLS26.js";
7
7
  import "./chunk-NXL4FFQQ.js";
8
8
 
9
9
  // dist/clients/metrics-client.js
@@ -2,11 +2,11 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  classifyRunOutcome,
4
4
  firstOutputLine
5
- } from "./chunk-S67KYG37.js";
5
+ } from "./chunk-T4NGVFYI.js";
6
6
  import {
7
7
  incrementDegradationCount,
8
8
  truncateForLedger
9
- } from "./chunk-J64T55EI.js";
9
+ } from "./chunk-FWZRGGGY.js";
10
10
 
11
11
  // dist/clients/dispatch/types.js
12
12
  function spanOverlapsModifiedRanges(startLine, endLine, ranges) {
@@ -1,22 +1,21 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  collectSourceFiles
4
- } from "./chunk-DGUKIYSI.js";
5
- import "./chunk-XBJVAEEO.js";
6
- import "./chunk-KUA4OJ5Y.js";
4
+ } from "./chunk-PP2A5V2T.js";
5
+ import "./chunk-S55TEC7I.js";
6
+ import "./chunk-TPYYEDP5.js";
7
7
  import "./chunk-QYF5S6P6.js";
8
- import "./chunk-DUO2TU77.js";
9
- import "./chunk-J6MPGQTS.js";
10
- import "./chunk-5HSRT26B.js";
11
- import "./chunk-2EECBNC5.js";
12
- import "./chunk-J64T55EI.js";
13
- import "./chunk-POMLXPMY.js";
14
- import "./chunk-JMYYOTQG.js";
15
- import "./chunk-QBFBRV2B.js";
16
- import "./chunk-YNE3RP52.js";
8
+ import "./chunk-GYRZ72R4.js";
9
+ import "./chunk-KJJAVH3X.js";
10
+ import "./chunk-ZSUX7KEM.js";
11
+ import "./chunk-EIKRZ32J.js";
12
+ import "./chunk-FWZRGGGY.js";
13
+ import "./chunk-N3PLNNCW.js";
14
+ import "./chunk-S26LC76R.js";
15
+ import "./chunk-XWFIHYCH.js";
16
+ import "./chunk-TVZRLTG6.js";
17
17
  import "./chunk-LJDODBBZ.js";
18
- import "./chunk-ABBOA7UD.js";
19
- import "./chunk-3RKP3FMS.js";
18
+ import "./chunk-EWXXLS26.js";
20
19
  import "./chunk-NXL4FFQQ.js";
21
20
 
22
21
  // dist/clients/todo-scanner.js
@@ -4,78 +4,77 @@ import {
4
4
  } from "./chunk-7U2IDNXN.js";
5
5
  import {
6
6
  formatToolFailure
7
- } from "./chunk-RKBXZN3A.js";
7
+ } from "./chunk-VIDEKABZ.js";
8
8
  import {
9
9
  spawnFailedWithNoOutput
10
- } from "./chunk-S67KYG37.js";
10
+ } from "./chunk-T4NGVFYI.js";
11
11
  import {
12
12
  createAvailabilityChecker,
13
13
  findManagedNodeToolBinary,
14
14
  getManagedToolEnvironment,
15
15
  resolveAvailableOrInstall
16
- } from "./chunk-ZHH37KZL.js";
17
- import "./chunk-Y6GZHWSJ.js";
18
- import "./chunk-3DA2JDOL.js";
19
- import "./chunk-HWCCCQNX.js";
20
- import "./chunk-CUHSHSB6.js";
21
- import {
22
- canonicalDirectory,
23
- listNestedLinkedWorktreeRoots
24
- } from "./chunk-UA7ZXYDR.js";
25
- import "./chunk-T7FEBKXN.js";
26
- import "./chunk-MPNJLASA.js";
27
- import "./chunk-GXFV6MYU.js";
28
- import "./chunk-FM4RDMKT.js";
29
- import "./chunk-RMLC67LF.js";
30
- import "./chunk-W66O5E25.js";
31
- import "./chunk-7HXE67BN.js";
32
- import "./chunk-Z3CCVDUB.js";
16
+ } from "./chunk-2SDHYHHO.js";
17
+ import "./chunk-COOUUC5W.js";
18
+ import "./chunk-7ZS7MC24.js";
19
+ import "./chunk-6XSESGWD.js";
20
+ import "./chunk-3SNDVPOR.js";
21
+ import "./chunk-JWOVP5BL.js";
22
+ import "./chunk-7IYC4ENJ.js";
23
+ import "./chunk-KX56K73G.js";
24
+ import "./chunk-2Y6OJRSI.js";
25
+ import "./chunk-WUY4BZEP.js";
26
+ import "./chunk-GTDSYEA2.js";
27
+ import "./chunk-UL5SXQVX.js";
28
+ import "./chunk-CKEQFGLT.js";
29
+ import "./chunk-NLIVE7L6.js";
30
+ import "./chunk-IEBJF3PN.js";
31
+ import "./chunk-UO66IMVP.js";
33
32
  import "./chunk-2BEMIWEW.js";
34
33
  import "./chunk-IJYGIDF4.js";
35
34
  import {
36
35
  logSessionStart
37
- } from "./chunk-GAQ7OQG6.js";
38
- import "./chunk-DEL2U6CM.js";
36
+ } from "./chunk-IL7K66ZQ.js";
37
+ import "./chunk-4FHUGDKU.js";
39
38
  import {
40
39
  findLocalBinUpwards,
41
40
  localBinPath
42
- } from "./chunk-5VSF4UUQ.js";
43
- import "./chunk-3KAZU3VR.js";
41
+ } from "./chunk-K4SZB56V.js";
42
+ import "./chunk-XI34NWDI.js";
44
43
  import {
45
44
  createAvailabilityLatch,
46
45
  describeUnavailability
47
- } from "./chunk-P63GXC37.js";
48
- import "./chunk-HRNHZA3N.js";
49
- import "./chunk-TLX72JTG.js";
50
- import "./chunk-DGUKIYSI.js";
51
- import "./chunk-XBJVAEEO.js";
46
+ } from "./chunk-5LRUKYFA.js";
47
+ import "./chunk-63NMUNYP.js";
48
+ import "./chunk-CG5V25HX.js";
49
+ import "./chunk-PP2A5V2T.js";
50
+ import "./chunk-S55TEC7I.js";
52
51
  import {
52
+ canonicalDirectory,
53
53
  getProjectDataDir,
54
+ listNestedLinkedWorktreeRoots,
54
55
  safeSpawnAsync
55
- } from "./chunk-KUA4OJ5Y.js";
56
- import "./chunk-BW5KFIQC.js";
56
+ } from "./chunk-TPYYEDP5.js";
57
+ import "./chunk-AWQWXSW4.js";
57
58
  import "./chunk-QYF5S6P6.js";
58
- import "./chunk-DUO2TU77.js";
59
- import "./chunk-J6MPGQTS.js";
60
- import "./chunk-5HSRT26B.js";
61
- import "./chunk-M2IFVFWU.js";
62
- import "./chunk-2EECBNC5.js";
59
+ import "./chunk-GYRZ72R4.js";
60
+ import "./chunk-KJJAVH3X.js";
61
+ import "./chunk-ZSUX7KEM.js";
62
+ import "./chunk-EIKRZ32J.js";
63
63
  import {
64
64
  incrementDegradationCount
65
- } from "./chunk-J64T55EI.js";
65
+ } from "./chunk-FWZRGGGY.js";
66
66
  import {
67
67
  createSubsystemLogger
68
- } from "./chunk-POMLXPMY.js";
69
- import "./chunk-JMYYOTQG.js";
70
- import "./chunk-QBFBRV2B.js";
71
- import "./chunk-YNE3RP52.js";
68
+ } from "./chunk-N3PLNNCW.js";
69
+ import "./chunk-S26LC76R.js";
70
+ import "./chunk-XWFIHYCH.js";
71
+ import "./chunk-TVZRLTG6.js";
72
72
  import "./chunk-LJDODBBZ.js";
73
- import "./chunk-ABBOA7UD.js";
74
73
  import {
75
74
  findNearestMarkerRoot,
76
75
  normalizeEphemeralMapKey,
77
76
  normalizeFilePath
78
- } from "./chunk-3RKP3FMS.js";
77
+ } from "./chunk-EWXXLS26.js";
79
78
  import "./chunk-NXL4FFQQ.js";
80
79
 
81
80
  // dist/clients/knip-client.js
@@ -1,4 +1,7 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ walkUpDirs
4
+ } from "./chunk-EWXXLS26.js";
2
5
  import {
3
6
  __export
4
7
  } from "./chunk-NXL4FFQQ.js";
@@ -12,19 +15,14 @@ function getPackageRoot(importMetaUrl) {
12
15
  const cached = packageRootCache.get(importMetaUrl);
13
16
  if (cached)
14
17
  return cached;
15
- let current = path.dirname(fileURLToPath(importMetaUrl));
16
- while (true) {
17
- if (fs.existsSync(path.join(current, "package.json"))) {
18
- packageRootCache.set(importMetaUrl, current);
19
- return current;
20
- }
21
- const parent = path.dirname(current);
22
- if (parent === current) {
23
- packageRootCache.set(importMetaUrl, current);
24
- return current;
25
- }
26
- current = parent;
18
+ let root = "";
19
+ for (const dir of walkUpDirs(path.dirname(fileURLToPath(importMetaUrl)))) {
20
+ root = dir;
21
+ if (fs.existsSync(path.join(dir, "package.json")))
22
+ break;
27
23
  }
24
+ packageRootCache.set(importMetaUrl, root);
25
+ return root;
28
26
  }
29
27
  function resolvePackagePath(importMetaUrl, ...segments) {
30
28
  return path.join(getPackageRoot(importMetaUrl), ...segments);
@@ -1,56 +1,52 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
- import {
3
- stripAnsi
4
- } from "./chunk-6HWVI6MI.js";
5
2
  import {
6
3
  augmentPythonEnvironment,
7
4
  detectPythonEnvironment,
8
5
  emitBounded
9
- } from "./chunk-CUHSHSB6.js";
10
- import {
11
- resolveGitCheckout
12
- } from "./chunk-UA7ZXYDR.js";
6
+ } from "./chunk-3SNDVPOR.js";
13
7
  import {
14
- PathKeyedMap
15
- } from "./chunk-Z3CCVDUB.js";
8
+ stripAnsi
9
+ } from "./chunk-6HWVI6MI.js";
16
10
  import {
17
11
  resolveToolCwd
18
- } from "./chunk-DEL2U6CM.js";
12
+ } from "./chunk-4FHUGDKU.js";
19
13
  import {
20
14
  findGlobalBinary,
21
15
  findLocalBinAt,
22
16
  localBinPath
23
- } from "./chunk-5VSF4UUQ.js";
17
+ } from "./chunk-K4SZB56V.js";
24
18
  import {
25
19
  getIsolatedNpxSpawnOptions
26
- } from "./chunk-3KAZU3VR.js";
20
+ } from "./chunk-XI34NWDI.js";
27
21
  import {
28
22
  resolveLanguageRootForFile
29
- } from "./chunk-HRNHZA3N.js";
23
+ } from "./chunk-63NMUNYP.js";
30
24
  import {
25
+ resolveGitCheckout,
31
26
  safeSpawn,
32
27
  safeSpawnAsync
33
- } from "./chunk-KUA4OJ5Y.js";
28
+ } from "./chunk-TPYYEDP5.js";
34
29
  import {
30
+ DOTNET_CSHARP_ROOT_MARKERS,
35
31
  detectFileKind
36
- } from "./chunk-DUO2TU77.js";
32
+ } from "./chunk-GYRZ72R4.js";
37
33
  import {
34
+ PathKeyedMap,
38
35
  detectFileRole
39
- } from "./chunk-J6MPGQTS.js";
36
+ } from "./chunk-KJJAVH3X.js";
40
37
  import {
41
38
  findNearestDirWithAnyBasename
42
- } from "./chunk-5HSRT26B.js";
39
+ } from "./chunk-ZSUX7KEM.js";
43
40
  import {
44
41
  LEDGER_FIELD_MAX,
45
42
  recordDegradationOnce
46
- } from "./chunk-J64T55EI.js";
43
+ } from "./chunk-FWZRGGGY.js";
47
44
  import {
48
45
  createSubsystemLogger
49
- } from "./chunk-POMLXPMY.js";
50
- import {
51
- BoundedFifoMap
52
- } from "./chunk-ABBOA7UD.js";
46
+ } from "./chunk-N3PLNNCW.js";
53
47
  import {
48
+ BoundedFifoMap,
49
+ direntsHaveMarkerGlobMatch,
54
50
  findNearestMarkerRootDetailed,
55
51
  isRealGitMarker,
56
52
  isUnderDir,
@@ -58,8 +54,9 @@ import {
58
54
  normalizeEphemeralMapKey,
59
55
  normalizeMapKey,
60
56
  pathsEqual,
57
+ realpathOrResolve,
61
58
  toPosix
62
- } from "./chunk-3RKP3FMS.js";
59
+ } from "./chunk-EWXXLS26.js";
63
60
 
64
61
  // dist/clients/test-runner-client.js
65
62
  import { createHash } from "node:crypto";
@@ -311,7 +308,8 @@ var RUNNERS = {
311
308
  },
312
309
  dotnet: {
313
310
  kinds: ["csharp", "fsharp"],
314
- configFiles: ["*.csproj", "*.sln"],
311
+ // #4806: the .NET marker seam, not a private copy of it.
312
+ configFiles: [...DOTNET_CSHARP_ROOT_MARKERS],
315
313
  command: "dotnet",
316
314
  args: (_testFile, _cwd) => ["test", "--no-build"],
317
315
  parseJson: false
@@ -404,23 +402,16 @@ var MAX_FAILED_TARGETS_PER_RUNNER = 32;
404
402
  var MAX_FAILED_TARGET_CHECKS_PER_SELECTION = 8;
405
403
  var FAILED_TARGET_DETAIL_CAP_PER_TURN = 8;
406
404
  function canonicalFailedPath(filePath) {
407
- const absolute = path.resolve(filePath);
408
- try {
409
- return normalizeMapKey(fs.realpathSync.native(absolute));
410
- } catch {
411
- return normalizeMapKey(absolute);
412
- }
405
+ return normalizeMapKey(realpathOrResolve(filePath));
413
406
  }
414
407
  function canonicalProjectRoot(cwd) {
415
- const absolute = path.resolve(cwd);
416
- try {
417
- return {
418
- key: normalizeEphemeralMapKey(fs.realpathSync.native(absolute)),
419
- resolved: true
420
- };
421
- } catch {
422
- return { key: normalizeEphemeralMapKey(absolute), resolved: false };
423
- }
408
+ return {
409
+ key: normalizeEphemeralMapKey(realpathOrResolve(cwd)),
410
+ // A cwd that is not on disk still has an identity (its nearest existing
411
+ // ancestor plus the tail), but is a guess about a path that may later be
412
+ // a link: `getCanonicalProjectRoot` memoizes only a resolved one (#2077).
413
+ resolved: fs.existsSync(cwd)
414
+ };
424
415
  }
425
416
  var MAX_CANONICAL_ROOT_MEMO_ENTRIES = 512;
426
417
  function filesystemErrorCode(error) {
@@ -458,7 +449,7 @@ function parsePytestSummary(output) {
458
449
  }
459
450
  }
460
451
  const durationMatch = /in\s+([\d.]+)s/.exec(summaryLine);
461
- const duration = durationMatch ? Math.round(Number.parseFloat(durationMatch[1]) * 1e3) : void 0;
452
+ const duration = durationMatch ? toMeasuredDurationMs(Number.parseFloat(durationMatch[1]) * 1e3) : void 0;
462
453
  return { passed, failed, skipped, duration };
463
454
  }
464
455
  var TestRunnerClient = class {
@@ -471,10 +462,10 @@ var TestRunnerClient = class {
471
462
  // never memoized (#2077): the fallback key is a guess about a path that does
472
463
  // not exist yet, so memoizing it would pin an alias probed before its
473
464
  // symlink was created to a stale verdict for the instance's life. Re-probing
474
- // costs one failing realpath per call, and only for a cwd that does not
475
- // resolve — a state where `detectRunner` already walks node_modules on every
476
- // call. Keep the memo bounded so pathological spelling churn cannot grow it
477
- // without limit.
465
+ // costs one failing existence probe plus the ancestor walk per call, and only
466
+ // for a cwd that does not resolve — a state where `detectRunner` already
467
+ // walks node_modules on every call. Keep the memo bounded so pathological
468
+ // spelling churn cannot grow it without limit.
478
469
  canonicalRootMemo = new BoundedFifoMap(MAX_CANONICAL_ROOT_MEMO_ENTRIES);
479
470
  availableRunners = new PathKeyedMap(normalizeEphemeralMapKey);
480
471
  failedTestsByRunner = /* @__PURE__ */ new Map();
@@ -725,8 +716,7 @@ var TestRunnerClient = class {
725
716
  const found = config.configFiles.some((cf) => {
726
717
  if (cf.includes("*")) {
727
718
  try {
728
- const files = fs.readdirSync(cwd);
729
- return files.some((f) => new RegExp(cf.replace(/\*/g, ".*")).test(f));
719
+ return direntsHaveMarkerGlobMatch(fs.readdirSync(cwd, { withFileTypes: true }), cf);
730
720
  } catch {
731
721
  return false;
732
722
  }
@@ -1473,11 +1463,11 @@ var TestRunnerClient = class {
1473
1463
  }
1474
1464
  const span = maxEnd - minStart;
1475
1465
  if (Number.isFinite(span) && span > 0)
1476
- return Math.round(span);
1466
+ return toMeasuredDurationMs(span);
1477
1467
  if (assertionTotal > 0)
1478
- return Math.round(assertionTotal);
1468
+ return toMeasuredDurationMs(assertionTotal);
1479
1469
  if (Number.isFinite(span) && span === 0)
1480
- return 0;
1470
+ return toMeasuredDurationMs(span);
1481
1471
  return void 0;
1482
1472
  }
1483
1473
  // --- Vitest Parser ---
@@ -1584,7 +1574,7 @@ ${stderr}`;
1584
1574
  const minutes = Number.parseInt(clockMatch[2], 10);
1585
1575
  const seconds = Number.parseInt(clockMatch[3], 10);
1586
1576
  const millis = clockMatch[4] ? Number.parseInt(clockMatch[4].padEnd(3, "0"), 10) : 0;
1587
- duration = ((hours * 60 + minutes) * 60 + seconds) * 1e3 + millis;
1577
+ duration = toMeasuredDurationMs(((hours * 60 + minutes) * 60 + seconds) * 1e3 + millis);
1588
1578
  } else {
1589
1579
  const legacyMatch = output.match(/^Time:\s*([\d.]+)\s*(seconds?|s|ms|milliseconds?|minutes?)\b/im);
1590
1580
  if (legacyMatch) {
@@ -1592,7 +1582,7 @@ ${stderr}`;
1592
1582
  const unit = legacyMatch[2].toLowerCase();
1593
1583
  const scale = unit.startsWith("ms") || unit.startsWith("milli") ? 1 : unit.startsWith("min") ? 6e4 : 1e3;
1594
1584
  if (Number.isFinite(value) && value > 0) {
1595
- duration = Math.round(value * scale);
1585
+ duration = toMeasuredDurationMs(value * scale);
1596
1586
  }
1597
1587
  }
1598
1588
  }
@@ -1627,7 +1617,7 @@ ${stderr}`;
1627
1617
  }
1628
1618
  const durationMatch = output.match(/Finished in\s+([\d.]+)\s+seconds?/i);
1629
1619
  if (durationMatch) {
1630
- duration = Math.round(Number.parseFloat(durationMatch[1]) * 1e3);
1620
+ duration = toMeasuredDurationMs(Number.parseFloat(durationMatch[1]) * 1e3);
1631
1621
  }
1632
1622
  const failures = [];
1633
1623
  const failureRegex = /^[^\S\n]*\d+\)\s+(.+?)\s*\(([^)]+)\)\s*$/gm;
@@ -1809,7 +1799,7 @@ ${stderr}`;
1809
1799
  if (!dotnetTime)
1810
1800
  return void 0;
1811
1801
  if (/^\s*</.test(dotnetTime[1]))
1812
- return 0;
1802
+ return toMeasuredDurationMs(0);
1813
1803
  let total = 0;
1814
1804
  let tokens = 0;
1815
1805
  const units = {
@@ -0,0 +1,45 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ DEPENDENCY_DRIFT_MAX_DELIVERIES,
4
+ _getForwardImportParsesForTests,
5
+ collectForwardImportMtimes,
6
+ extractForwardImportPaths,
7
+ extractForwardImports,
8
+ sweepInlineBlockerFreshness
9
+ } from "./chunk-FEDWAYDS.js";
10
+ import "./chunk-CPZ5JJW6.js";
11
+ import "./chunk-7IYC4ENJ.js";
12
+ import "./chunk-KX56K73G.js";
13
+ import "./chunk-YWWG4AQA.js";
14
+ import "./chunk-Z54ZSOBZ.js";
15
+ import "./chunk-2Y6OJRSI.js";
16
+ import "./chunk-WUY4BZEP.js";
17
+ import "./chunk-GTDSYEA2.js";
18
+ import "./chunk-CKEQFGLT.js";
19
+ import "./chunk-NLIVE7L6.js";
20
+ import "./chunk-APFJKOP6.js";
21
+ import "./chunk-5LRUKYFA.js";
22
+ import "./chunk-TPYYEDP5.js";
23
+ import "./chunk-GYRZ72R4.js";
24
+ import "./chunk-KJJAVH3X.js";
25
+ import "./chunk-ZSUX7KEM.js";
26
+ import "./chunk-EIKRZ32J.js";
27
+ import "./chunk-FWZRGGGY.js";
28
+ import "./chunk-N3PLNNCW.js";
29
+ import {
30
+ MTIME_DRIFT_TOLERANCE_MS
31
+ } from "./chunk-S26LC76R.js";
32
+ import "./chunk-XWFIHYCH.js";
33
+ import "./chunk-TVZRLTG6.js";
34
+ import "./chunk-LJDODBBZ.js";
35
+ import "./chunk-EWXXLS26.js";
36
+ import "./chunk-NXL4FFQQ.js";
37
+ export {
38
+ DEPENDENCY_DRIFT_MAX_DELIVERIES,
39
+ MTIME_DRIFT_TOLERANCE_MS,
40
+ _getForwardImportParsesForTests,
41
+ collectForwardImportMtimes,
42
+ extractForwardImportPaths,
43
+ extractForwardImports,
44
+ sweepInlineBlockerFreshness
45
+ };
@@ -1,38 +1,39 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  scannerReportParentDir
4
- } from "./chunk-ED36RF6Y.js";
4
+ } from "./chunk-7FLRUH6B.js";
5
5
  import {
6
6
  getScratchTreeDirNames
7
- } from "./chunk-BWD5EPKO.js";
7
+ } from "./chunk-KPVLQHCZ.js";
8
8
  import {
9
9
  SecurityScanClient
10
- } from "./chunk-TIQ2PKDW.js";
10
+ } from "./chunk-QT66NEYN.js";
11
11
  import {
12
12
  resolveOpengrepConfig
13
- } from "./chunk-HWCCCQNX.js";
14
- import "./chunk-UA7ZXYDR.js";
15
- import "./chunk-3KAZU3VR.js";
16
- import "./chunk-P63GXC37.js";
13
+ } from "./chunk-6XSESGWD.js";
14
+ import {
15
+ stripPackRuleIdPrefix
16
+ } from "./chunk-UL5SXQVX.js";
17
+ import "./chunk-XI34NWDI.js";
18
+ import "./chunk-5LRUKYFA.js";
17
19
  import {
18
20
  safeSpawnAsync
19
- } from "./chunk-KUA4OJ5Y.js";
20
- import "./chunk-BW5KFIQC.js";
21
- import "./chunk-J6MPGQTS.js";
22
- import "./chunk-5HSRT26B.js";
23
- import "./chunk-2EECBNC5.js";
21
+ } from "./chunk-TPYYEDP5.js";
22
+ import "./chunk-AWQWXSW4.js";
23
+ import "./chunk-KJJAVH3X.js";
24
+ import "./chunk-ZSUX7KEM.js";
25
+ import "./chunk-EIKRZ32J.js";
24
26
  import {
25
27
  recordDegradationOnce
26
- } from "./chunk-J64T55EI.js";
27
- import "./chunk-POMLXPMY.js";
28
- import "./chunk-JMYYOTQG.js";
29
- import "./chunk-QBFBRV2B.js";
30
- import "./chunk-YNE3RP52.js";
28
+ } from "./chunk-FWZRGGGY.js";
29
+ import "./chunk-N3PLNNCW.js";
30
+ import "./chunk-S26LC76R.js";
31
+ import "./chunk-XWFIHYCH.js";
32
+ import "./chunk-TVZRLTG6.js";
31
33
  import "./chunk-LJDODBBZ.js";
32
- import "./chunk-ABBOA7UD.js";
33
34
  import {
34
35
  realpathOrResolve
35
- } from "./chunk-3RKP3FMS.js";
36
+ } from "./chunk-EWXXLS26.js";
36
37
  import "./chunk-NXL4FFQQ.js";
37
38
 
38
39
  // dist/clients/opengrep-client.js
@@ -65,7 +66,7 @@ var OpengrepClient = class _OpengrepClient extends SecurityScanClient {
65
66
  return this.ensureViaInstaller(["--version"]);
66
67
  }
67
68
  /**
68
- * Scan a directory tree with opengrep's rule set (local config or `auto`).
69
+ * Scan a directory tree with opengrep's rule set (local config, else the refreshed pack, else `auto`).
69
70
  * Re-entrancy safe: concurrent calls against the same root share a single
70
71
  * opengrep process (mirrors `GitleaksClient`/`JscpdClient`).
71
72
  */
@@ -86,6 +87,7 @@ var OpengrepClient = class _OpengrepClient extends SecurityScanClient {
86
87
  const scannedAt = (/* @__PURE__ */ new Date()).toISOString();
87
88
  const bin = this.binaryPath ?? "opengrep";
88
89
  const resolved = _OpengrepClient.resolveConfig(cwd);
90
+ const packPath = resolved.source === "pack" ? resolved.configArg : void 0;
89
91
  const outDir = mkdtempSync(path.join(scannerReportParentDir(), "pi-lens-opengrep-"));
90
92
  const reportPath = path.join(outDir, "opengrep-report.json");
91
93
  try {
@@ -177,7 +179,12 @@ var OpengrepClient = class _OpengrepClient extends SecurityScanClient {
177
179
  ...report.partial ? { partial: true } : {},
178
180
  ...report.partial ? { summary: report.partial.reason } : {},
179
181
  ...report.partial && report.scanned.length === 0 ? { reason: "partial-no-paths" } : {},
180
- findings: report.findings,
182
+ // The cached pack is loaded from a path, so Opengrep prefixes its rule
183
+ // ids with it; report the registry-form id instead.
184
+ findings: packPath ? report.findings.map((finding) => ({
185
+ ...finding,
186
+ checkId: stripPackRuleIdPrefix(finding.checkId, packPath)
187
+ })) : report.findings,
181
188
  scannedAt
182
189
  };
183
190
  } catch (err) {