pi-lens 4.4.7 → 4.4.9

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 (186) hide show
  1. package/CHANGELOG-USER.md +31 -0
  2. package/CHANGELOG.md +327 -0
  3. package/README.md +13 -2
  4. package/config/dependency-cruiser-eager-allowlist.json +1 -1
  5. package/config/markdownlint/run-no-fix.mjs +36 -0
  6. package/dist/{chunk-4LM3VAZH.js → chunk-2VZ3VN3N.js} +2 -2
  7. package/dist/{chunk-PUZ3E2J4.js → chunk-3HTZDY3C.js} +8 -6
  8. package/dist/{chunk-RORGS5II.js → chunk-3NPWO5UO.js} +7 -13
  9. package/dist/{chunk-MNJIXFX4.js → chunk-47UCC4MM.js} +1 -1
  10. package/dist/chunk-4ENEJHF4.js +198 -0
  11. package/dist/chunk-5GEYJJHG.js +22 -0
  12. package/dist/{chunk-U6VN4NVL.js → chunk-5YSEQHJN.js} +3 -3
  13. package/dist/{chunk-6IR3ZYIB.js → chunk-6GPB3JLL.js} +3 -3
  14. package/dist/{chunk-MB6PXBUA.js → chunk-7R5GZIA6.js} +7 -15
  15. package/dist/{chunk-DH5JPM3K.js → chunk-7UTSNTWM.js} +10 -9
  16. package/dist/{chunk-24BILSZW.js → chunk-7YTRG6YW.js} +2 -2
  17. package/dist/{chunk-KW5JQPO5.js → chunk-AACN5GNE.js} +2 -2
  18. package/dist/{chunk-PKES3ISE.js → chunk-ACRJ2GZ5.js} +2 -2
  19. package/dist/{chunk-4ZYJHQMB.js → chunk-C3YRO3EU.js} +10 -12
  20. package/dist/{chunk-PQJFG24Z.js → chunk-CB7PEVOJ.js} +1300 -946
  21. package/dist/{chunk-ABPKUVA4.js → chunk-CDFJF5YD.js} +1 -1
  22. package/dist/{chunk-T7A2HK2B.js → chunk-CJS6WE66.js} +17 -18
  23. package/dist/{chunk-3YY7IXIL.js → chunk-CM6BDY4E.js} +14 -60
  24. package/dist/{chunk-RZOXUSPC.js → chunk-CZCAZVTD.js} +16 -2
  25. package/dist/chunk-DGKFWQK4.js +23 -0
  26. package/dist/{chunk-NA7SEXHE.js → chunk-E65WJVI5.js} +7 -9
  27. package/dist/{chunk-2TF6RXWB.js → chunk-EKNYSXFB.js} +8 -10
  28. package/dist/{chunk-RRV3FNNM.js → chunk-EY6LY2HO.js} +27 -30
  29. package/dist/{chunk-LBLBAFG3.js → chunk-F6BEQWAK.js} +17 -5
  30. package/dist/{chunk-4L36HG27.js → chunk-FGNSESAC.js} +12 -14
  31. package/dist/{chunk-3FRLWYBG.js → chunk-FRUBVFXV.js} +39 -42
  32. package/dist/{chunk-FB5SCCPT.js → chunk-G22UNQID.js} +14 -15
  33. package/dist/{chunk-LV4UMYVH.js → chunk-GQTQUNCG.js} +26 -27
  34. package/dist/{chunk-E7HJ56Y7.js → chunk-H3BVMK47.js} +64 -73
  35. package/dist/chunk-H6FLQ5NW.js +28 -0
  36. package/dist/{chunk-QHSNL7B2.js → chunk-HEA3EM23.js} +15 -19
  37. package/dist/{chunk-AWDSEDER.js → chunk-HSOBIN22.js} +2 -2
  38. package/dist/{chunk-EAOK7MIZ.js → chunk-HYSKJMZK.js} +17 -4
  39. package/dist/{chunk-VUZWQ7UG.js → chunk-IICERRFF.js} +46 -72
  40. package/dist/{chunk-OXOI55RU.js → chunk-IILEH3ZC.js} +8 -10
  41. package/dist/{chunk-ZKXQKGWZ.js → chunk-J3Q2NYJR.js} +4 -3
  42. package/dist/{chunk-YHC2O2WO.js → chunk-JUZ67QZQ.js} +20 -9
  43. package/dist/chunk-KR5VGMVT.js +25 -0
  44. package/dist/{chunk-F7K5IBZG.js → chunk-KV6GQOGN.js} +41 -44
  45. package/dist/{chunk-SNDXCFRS.js → chunk-KXMJLOZF.js} +25 -23
  46. package/dist/{chunk-CB4WHS4H.js → chunk-L4Y3ROKQ.js} +3 -3
  47. package/dist/{chunk-3F6BMY53.js → chunk-L6WBJGQS.js} +1 -1
  48. package/dist/{chunk-MPKRJBPK.js → chunk-L7O774U7.js} +30 -32
  49. package/dist/{chunk-URCQWAQ4.js → chunk-LAHHGNAY.js} +21 -21
  50. package/dist/{chunk-V63BC55Q.js → chunk-LT62P654.js} +1 -1
  51. package/dist/{chunk-ZMAUPOMG.js → chunk-LWOM6LVS.js} +34 -34
  52. package/dist/{chunk-HO6LWE2E.js → chunk-MKPDIAZH.js} +21 -1
  53. package/dist/{chunk-2PHMIAKO.js → chunk-MN635QYA.js} +3 -4
  54. package/dist/{chunk-KDX35VXP.js → chunk-MQ4PPCJB.js} +166 -149
  55. package/dist/{chunk-QOE342SU.js → chunk-MRLH4MYU.js} +2 -2
  56. package/dist/{chunk-CE6VMBCB.js → chunk-N56BNAA6.js} +20 -21
  57. package/dist/{chunk-L3CMBQMH.js → chunk-N5CEGQPG.js} +14 -17
  58. package/dist/{chunk-7E2563GA.js → chunk-NCLO6E6N.js} +13 -33
  59. package/dist/{chunk-J6JP25XU.js → chunk-NL5LSKVD.js} +4 -3
  60. package/dist/{chunk-U7BD2QL7.js → chunk-NMUSOZ2D.js} +10 -12
  61. package/dist/{chunk-BZARLRJW.js → chunk-NOWH2VA2.js} +8 -33
  62. package/dist/{chunk-U2SDMG7C.js → chunk-NUSXS6YB.js} +6 -5
  63. package/dist/{chunk-ZJTT47IG.js → chunk-OSEKJEUU.js} +2 -2
  64. package/dist/{chunk-FZKFVUEC.js → chunk-OUYAUXAT.js} +647 -355
  65. package/dist/{chunk-ZE3KXHS7.js → chunk-PBZNYHMM.js} +84 -4
  66. package/dist/{chunk-U5HPROLA.js → chunk-PIIUNJIT.js} +2 -4
  67. package/dist/chunk-PKLB2XJL.js +8 -0
  68. package/dist/{chunk-RC2Z6K47.js → chunk-PRHYIA6X.js} +15 -6
  69. package/dist/{chunk-RQS4QQSD.js → chunk-PXQ45SGD.js} +2 -2
  70. package/dist/chunk-Q6JQKWPK.js +25 -0
  71. package/dist/{chunk-F6X3YJWD.js → chunk-QB7T2PHK.js} +2 -2
  72. package/dist/{chunk-TIQJPRDD.js → chunk-QGITU23N.js} +3 -2
  73. package/dist/chunk-QJJKOHLH.js +57 -0
  74. package/dist/{chunk-4LOE5R5P.js → chunk-QP33NKYC.js} +18 -15
  75. package/dist/{chunk-N5WSK2K7.js → chunk-QVBOXT3L.js} +12 -17
  76. package/dist/{chunk-DPGEAHZT.js → chunk-RNJFRXEN.js} +10 -18
  77. package/dist/{chunk-EKWX4WD3.js → chunk-RNXOWDM6.js} +10 -10
  78. package/dist/{chunk-O4BJFESU.js → chunk-RTFMDIKV.js} +1 -1
  79. package/dist/{chunk-LS3QJRUB.js → chunk-SIQHOB6P.js} +11 -13
  80. package/dist/{chunk-3K2F6UDZ.js → chunk-SLSMJPEF.js} +43 -42
  81. package/dist/chunk-T5QSLSMM.js +50 -0
  82. package/dist/chunk-TGQDAG4B.js +88 -0
  83. package/dist/{chunk-4YHYPW2G.js → chunk-THYHUIDR.js} +44 -13
  84. package/dist/{chunk-YVHBNSME.js → chunk-TMNUTMT5.js} +1099 -1100
  85. package/dist/{chunk-WDBICWH3.js → chunk-TOE2RRCS.js} +1 -1
  86. package/dist/chunk-TYHPVE5H.js +25 -0
  87. package/dist/chunk-UAKO2M6B.js +73 -0
  88. package/dist/chunk-UC5AXW5Z.js +20 -0
  89. package/dist/chunk-UTJP6WOS.js +28 -0
  90. package/dist/{chunk-DQZFQSR5.js → chunk-UXTQ3QPD.js} +4 -4
  91. package/dist/chunk-UYXV5NIS.js +20 -0
  92. package/dist/{chunk-KKCK636N.js → chunk-V2WDBOLZ.js} +10 -12
  93. package/dist/{chunk-PR6PO3ES.js → chunk-V67D6TMU.js} +22 -20
  94. package/dist/{chunk-VSFLRN5Y.js → chunk-VCRVNLE7.js} +135 -2
  95. package/dist/{chunk-CPSR3AVL.js → chunk-VO4JFPTV.js} +2 -2
  96. package/dist/{chunk-XT2HTCJ5.js → chunk-VWLSU3XV.js} +6 -5
  97. package/dist/{chunk-WME2OQST.js → chunk-W5E72HJA.js} +66 -24
  98. package/dist/{chunk-LLS45EWB.js → chunk-W7TY6HYX.js} +6 -8
  99. package/dist/{chunk-CCV2EU7T.js → chunk-WSSLVMDA.js} +12 -13
  100. package/dist/{chunk-YISME6ON.js → chunk-WTB4GKMH.js} +10 -1
  101. package/dist/{chunk-KPPJTH44.js → chunk-X5BJ3G2P.js} +64 -35
  102. package/dist/{chunk-JMEKXFOL.js → chunk-XKFO2SZV.js} +39 -34
  103. package/dist/{chunk-HR3OJ3TH.js → chunk-XLAI7UYY.js} +84 -31
  104. package/dist/{chunk-H7OR7DFZ.js → chunk-XO756WE5.js} +53 -37
  105. package/dist/{chunk-F5Z6URKM.js → chunk-XVB3Q2PG.js} +2 -4
  106. package/dist/{chunk-R5MOQM2H.js → chunk-YOXCCJDF.js} +607 -366
  107. package/dist/{chunk-ZGSJDWQU.js → chunk-ZCQBNPRH.js} +2 -2
  108. package/dist/chunk-ZD4KVFXI.js +234 -0
  109. package/dist/{chunk-WGRJOXED.js → chunk-ZDMFGACN.js} +1295 -966
  110. package/dist/{chunk-OSTKYB55.js → chunk-ZMMHHXSW.js} +1 -1
  111. package/dist/{chunk-75GAYVNO.js → chunk-ZPM7ZIFL.js} +6 -6
  112. package/dist/{chunk-LUBPZN36.js → chunk-ZVCDHYWZ.js} +9 -11
  113. package/dist/{chunk-Y7F7IEE3.js → chunk-ZZN74OGD.js} +102 -7
  114. package/dist/{chunk-L5JYIU47.js → chunk-ZZSJAR76.js} +39 -20
  115. package/dist/index.js +10933 -8644
  116. package/dist/mcp/analyze-cli.js +12 -17
  117. package/dist/mcp/cli.js +43 -42
  118. package/dist/mcp/server.js +3073 -1147
  119. package/dist/mcp/worker.js +61 -61
  120. package/dist/probes/installer.js +18 -19
  121. package/docs/adr/0003-git-guard-latch-writer.md +11 -6
  122. package/docs/agent-tools.md +58 -16
  123. package/docs/alignment-families.md +29 -0
  124. package/docs/analysisall.md +1 -1
  125. package/docs/ast-grep_rules_catalog.md +6 -4
  126. package/docs/ci-bot-pr-checks.md +128 -0
  127. package/docs/configuration.md +150 -12
  128. package/docs/defect-shapes.md +107 -15
  129. package/docs/engineering-principles.md +27 -2
  130. package/docs/environment-variables.md +18 -1
  131. package/docs/features.md +14 -7
  132. package/docs/globalconfig.md +11 -3
  133. package/docs/invariants/git-guard-host.md +7 -3
  134. package/docs/invariants/language-config.md +15 -4
  135. package/docs/invariants/lsp-trust-exec.md +25 -4
  136. package/docs/invariants/paths-os.md +4 -2
  137. package/docs/invariants/session-telemetry.md +2 -2
  138. package/docs/language-coverage.md +1 -0
  139. package/docs/lsp-capability-matrix.md +167 -65
  140. package/docs/lsp-idle-eviction.md +4 -1
  141. package/docs/merge-queue-rollout.md +10 -8
  142. package/docs/module-report-read-symbol.md +34 -23
  143. package/docs/pi-lens-fixer.md +34 -17
  144. package/docs/pi-lens-investigator.md +3 -0
  145. package/docs/pi-lens-merge-policy.md +34 -17
  146. package/docs/pi-lens-monitor.md +9 -0
  147. package/docs/pi-lens-orchestration.md +4 -1
  148. package/docs/pi-lens-reviewer.md +6 -6
  149. package/docs/pi-lens-subagent.md +19 -3
  150. package/docs/public-api-stability.md +57 -7
  151. package/docs/release-qa-baseline.md +7 -4
  152. package/docs/schema/pi-lens-config-v1.json +21 -2
  153. package/docs/servercapabilities.md +3 -1
  154. package/docs/settings.md +11 -7
  155. package/docs/word-index.md +20 -7
  156. package/package.json +11 -4
  157. package/rules/ast-grep-rules/rule-tests/no-accumulating-spread-js-test.yml +37 -0
  158. package/rules/ast-grep-rules/rule-tests/ts-redundant-filter-map-test.yml +12 -1
  159. package/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-js-test.yml +12 -0
  160. package/rules/ast-grep-rules/rule-tests-disabled/filter-then-map-test.yml +25 -0
  161. package/rules/ast-grep-rules/rules/no-accumulating-spread-js.yml +49 -1
  162. package/rules/ast-grep-rules/rules/no-sql-in-code-execute-js.yml +1 -2
  163. package/rules/ast-grep-rules/rules/no-sql-in-code-execute.yml +1 -2
  164. package/rules/ast-grep-rules/rules/ts-redundant-filter-map.yml +9 -1
  165. package/rules/ast-grep-rules/rules-disabled/filter-then-map-js.yml +17 -0
  166. package/rules/ast-grep-rules/rules-disabled/filter-then-map.yml +36 -0
  167. package/rules/ast-grep-rules/self-scan-baseline.json +1 -1
  168. package/scripts/download-grammars.js +3 -2
  169. package/skills/pi-lens-lsp-navigation/SKILL.md +5 -1
  170. package/dist/chunk-46TNM7XZ.js +0 -88
  171. package/dist/chunk-72OKUXSD.js +0 -31
  172. package/dist/chunk-7GLOLOSH.js +0 -57
  173. package/dist/chunk-AKUUMGD5.js +0 -26
  174. package/dist/chunk-ASUXV767.js +0 -22
  175. package/dist/chunk-CTADOKYM.js +0 -25
  176. package/dist/chunk-GNSIWBAT.js +0 -106
  177. package/dist/chunk-HWDAVBFU.js +0 -49
  178. package/dist/chunk-JJ2RRESP.js +0 -58
  179. package/dist/chunk-KXF5R4UN.js +0 -48
  180. package/dist/chunk-LSC3VADM.js +0 -23
  181. package/dist/chunk-OE5ZBP7F.js +0 -443
  182. package/dist/chunk-SHLDT3OI.js +0 -27
  183. package/dist/chunk-UF7RTZSO.js +0 -27
  184. package/dist/chunk-W4WP2ERB.js +0 -30
  185. package/dist/chunk-YES5CACN.js +0 -73
  186. package/dist/chunk-Z2XAOKHK.js +0 -136
@@ -1,32 +1,30 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
- import {
3
- scannerReportParentDir
4
- } from "./chunk-V63BC55Q.js";
5
2
  import {
6
3
  getSecretsLaneAllowlistPaths,
7
4
  isUnderSecretsLaneScratchTree,
8
5
  nestedWorktreeOffsets
9
- } from "./chunk-CPSR3AVL.js";
6
+ } from "./chunk-VO4JFPTV.js";
10
7
  import {
11
8
  SecurityScanClient
12
- } from "./chunk-ZE3KXHS7.js";
9
+ } from "./chunk-PBZNYHMM.js";
13
10
  import {
14
11
  collectTrackedFiles,
15
12
  collectUntrackedIgnoredIds,
16
13
  safeSpawnAsync
17
- } from "./chunk-YVHBNSME.js";
14
+ } from "./chunk-TMNUTMT5.js";
18
15
  import {
19
16
  escapeRegExp
20
- } from "./chunk-WME2OQST.js";
17
+ } from "./chunk-W5E72HJA.js";
21
18
  import {
22
19
  normalizeEphemeralMapKey,
23
- normalizeMapKey
24
- } from "./chunk-PQJFG24Z.js";
20
+ normalizeMapKey,
21
+ relativeInside,
22
+ walkUpDirs
23
+ } from "./chunk-CB7PEVOJ.js";
25
24
 
26
25
  // dist/clients/gitleaks-client.js
27
26
  import * as fs from "node:fs";
28
27
  import * as path from "node:path";
29
- import { mkdtempSync } from "node:fs";
30
28
  var EMPTY_RESULT = {
31
29
  success: false,
32
30
  findings: []
@@ -184,84 +182,60 @@ var GitleaksClient = class _GitleaksClient extends SecurityScanClient {
184
182
  }
185
183
  return this.dedupeScan(targetDir, () => this.runScan(targetDir));
186
184
  }
187
- async runScan(cwd) {
188
- const scannedAt = (/* @__PURE__ */ new Date()).toISOString();
185
+ runScan(cwd) {
189
186
  const bin = this.binaryPath ?? "gitleaks";
190
- const outDir = mkdtempSync(path.join(scannerReportParentDir(), "pi-lens-gitleaks-"));
191
- const reportPath = path.join(outDir, "gitleaks-report.json");
192
- try {
193
- const configPath = writeScopedGitleaksConfig(outDir, cwd);
194
- const result = await safeSpawnAsync(bin, [
195
- "detect",
196
- "--no-git",
197
- "--source",
198
- cwd,
199
- "--config",
200
- configPath,
201
- "--report-format",
202
- "json",
203
- "--report-path",
204
- reportPath,
205
- "--exit-code",
206
- "0",
207
- "--no-banner"
208
- ], { cwd, timeout: SCAN_TIMEOUT_MS });
209
- if (result.error) {
210
- this.log(`Scan error: ${result.error.message}`);
211
- return {
212
- ...EMPTY_RESULT,
213
- scannedAt,
214
- summary: result.error.message.slice(0, 200)
215
- };
216
- }
217
- if (!fs.existsSync(reportPath)) {
187
+ return this.runReportScan({
188
+ spawn: ({ outDir, reportPath }) => {
189
+ const configPath = writeScopedGitleaksConfig(outDir, cwd);
190
+ return safeSpawnAsync(bin, [
191
+ "detect",
192
+ "--no-git",
193
+ "--source",
194
+ cwd,
195
+ "--config",
196
+ configPath,
197
+ "--report-format",
198
+ "json",
199
+ "--report-path",
200
+ reportPath,
201
+ "--exit-code",
202
+ "0",
203
+ "--no-banner"
204
+ ], { cwd, timeout: SCAN_TIMEOUT_MS });
205
+ },
206
+ // gitleaks writes the report file even when nothing is found, so a
207
+ // missing file (the seam's no-report outcome) means the scan stopped
208
+ // before writing it.
209
+ parse: async (raw, scannedAt) => {
210
+ const rawFindings = parseGitleaksReport(raw);
211
+ const findings = await classifyAndFilterFindings(rawFindings, cwd);
218
212
  return {
219
- ...EMPTY_RESULT,
220
213
  success: true,
221
- scannedAt,
222
- summary: (result.stderr ?? "").trim().split("\n")[0] || "no report produced"
214
+ analyzed: true,
215
+ findings,
216
+ scannedAt
223
217
  };
224
- }
225
- const rawFindings = parseGitleaksReport(fs.readFileSync(reportPath, "utf-8"));
226
- const findings = await classifyAndFilterFindings(rawFindings, cwd);
227
- return {
228
- success: true,
229
- analyzed: true,
230
- findings,
231
- scannedAt
232
- };
233
- } catch (err) {
234
- return {
235
- ...EMPTY_RESULT,
236
- scannedAt,
237
- summary: err instanceof Error ? err.message.slice(0, 200) : String(err)
238
- };
239
- } finally {
240
- try {
241
- fs.rmSync(outDir, { recursive: true, force: true });
242
- } catch {
243
- }
244
- }
218
+ },
219
+ fail: (failure) => ({ ...EMPTY_RESULT, ...failure })
220
+ });
245
221
  }
246
222
  };
247
223
  function isInsideNestedGitRepository(file, cwd) {
248
224
  const root = path.resolve(cwd);
249
225
  const absoluteFile = path.isAbsolute(file) ? path.resolve(file) : path.resolve(root, file);
250
- const relative2 = path.relative(root, absoluteFile);
251
- if (relative2 === ".." || relative2.startsWith(`..${path.sep}`) || path.isAbsolute(relative2))
226
+ if (relativeInside(root, absoluteFile) === void 0)
252
227
  return false;
253
- let directory = path.dirname(absoluteFile);
254
- while (directory !== root) {
228
+ for (const directory of walkUpDirs(path.dirname(absoluteFile), {
229
+ spelling: true
230
+ })) {
231
+ if (directory === root)
232
+ return false;
255
233
  try {
256
234
  if (fs.existsSync(path.join(directory, ".git")))
257
235
  return true;
258
236
  } catch {
259
237
  return false;
260
238
  }
261
- const parent = path.dirname(directory);
262
- if (parent === directory)
263
- return false;
264
- directory = parent;
265
239
  }
266
240
  return false;
267
241
  }
@@ -36,19 +36,17 @@ import {
36
36
  updateWordIndexDocumentForEdit,
37
37
  wordIndexKey,
38
38
  wordIndexPostingHits
39
- } from "./chunk-SNDXCFRS.js";
40
- import "./chunk-QOE342SU.js";
39
+ } from "./chunk-KXMJLOZF.js";
40
+ import "./chunk-MRLH4MYU.js";
41
41
  import "./chunk-AWQWXSW4.js";
42
42
  import "./chunk-QYF5S6P6.js";
43
- import "./chunk-RZOXUSPC.js";
44
- import "./chunk-KPPJTH44.js";
45
- import "./chunk-J6JP25XU.js";
46
- import "./chunk-WME2OQST.js";
47
- import "./chunk-KXF5R4UN.js";
43
+ import "./chunk-CZCAZVTD.js";
44
+ import "./chunk-X5BJ3G2P.js";
45
+ import "./chunk-NL5LSKVD.js";
46
+ import "./chunk-W5E72HJA.js";
48
47
  import "./chunk-S26LC76R.js";
49
- import "./chunk-Z2XAOKHK.js";
50
- import "./chunk-VSFLRN5Y.js";
51
- import "./chunk-PQJFG24Z.js";
48
+ import "./chunk-VCRVNLE7.js";
49
+ import "./chunk-CB7PEVOJ.js";
52
50
  import "./chunk-NXL4FFQQ.js";
53
51
  export {
54
52
  WORD_INDEX_FORMAT_VERSION,
@@ -1,11 +1,12 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  logExtension
4
- } from "./chunk-KXF5R4UN.js";
4
+ } from "./chunk-W5E72HJA.js";
5
5
  import {
6
6
  findNearestMarkerRoot,
7
+ realpathOrResolve,
7
8
  walkUpDirs
8
- } from "./chunk-PQJFG24Z.js";
9
+ } from "./chunk-CB7PEVOJ.js";
9
10
 
10
11
  // dist/clients/cargo-manifest.js
11
12
  import { readFile } from "node:fs/promises";
@@ -141,7 +142,7 @@ function readWorkspacePackageEdition(content) {
141
142
  return parseTomlScalarString(workspaceSection, "edition");
142
143
  }
143
144
  async function resolveCargoPackageEdition(filePath, homeDir = os.homedir()) {
144
- const startDir = path.dirname(path.resolve(filePath));
145
+ const startDir = path.dirname(realpathOrResolve(filePath));
145
146
  const packageDir = findNearestMarkerRoot(startDir, ["Cargo.toml"], {
146
147
  homeDir
147
148
  });
@@ -1,32 +1,35 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ SecurityScanClient
4
+ } from "./chunk-PBZNYHMM.js";
2
5
  import {
3
6
  firstOutputLine,
4
7
  spawnFailedWithNoOutput
5
- } from "./chunk-JJ2RRESP.js";
6
- import {
7
- SecurityScanClient
8
- } from "./chunk-ZE3KXHS7.js";
8
+ } from "./chunk-ZZN74OGD.js";
9
9
  import {
10
10
  probeToolAsync
11
- } from "./chunk-3F6BMY53.js";
11
+ } from "./chunk-L6WBJGQS.js";
12
12
  import {
13
13
  INSTALL_TRANSIENT_MAX_ATTEMPTS,
14
14
  classifyProbeFailure,
15
15
  describeProbeEvidence,
16
16
  logAvailabilityDecision,
17
17
  startHostStallSampler
18
- } from "./chunk-KW5JQPO5.js";
18
+ } from "./chunk-AACN5GNE.js";
19
19
  import {
20
20
  isUntrustedProjectPath,
21
21
  recordProjectCommandRefusal,
22
22
  safeSpawnAsync
23
- } from "./chunk-YVHBNSME.js";
23
+ } from "./chunk-TMNUTMT5.js";
24
24
  import {
25
25
  assertInstallAllowed
26
- } from "./chunk-U5HPROLA.js";
26
+ } from "./chunk-PIIUNJIT.js";
27
27
  import {
28
28
  recordDegradationOnce
29
- } from "./chunk-WME2OQST.js";
29
+ } from "./chunk-W5E72HJA.js";
30
+ import {
31
+ isToolInstallDisabled
32
+ } from "./chunk-VCRVNLE7.js";
30
33
 
31
34
  // dist/clients/govulncheck-client.js
32
35
  import * as fs from "node:fs";
@@ -69,6 +72,14 @@ var GovulncheckClient = class _GovulncheckClient extends SecurityScanClient {
69
72
  if (!assertInstallAllowed("govulncheck go install")) {
70
73
  return false;
71
74
  }
75
+ if (isToolInstallDisabled()) {
76
+ recordDegradationOnce({
77
+ kind: "install-disabled",
78
+ subject: "govulncheck",
79
+ reason: "installation disabled by PI_LENS_DISABLE_TOOL_INSTALL=1"
80
+ });
81
+ return false;
82
+ }
72
83
  const goProbeStartedAt = Date.now();
73
84
  const goSampler = startHostStallSampler();
74
85
  let goOnPath;
@@ -0,0 +1,25 @@
1
+ import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
+ import {
3
+ GovulncheckClient,
4
+ parseGovulncheckJson
5
+ } from "./chunk-JUZ67QZQ.js";
6
+ import "./chunk-PBZNYHMM.js";
7
+ import "./chunk-ZZN74OGD.js";
8
+ import "./chunk-LT62P654.js";
9
+ import "./chunk-L6WBJGQS.js";
10
+ import "./chunk-AACN5GNE.js";
11
+ import "./chunk-TMNUTMT5.js";
12
+ import "./chunk-AWQWXSW4.js";
13
+ import "./chunk-X5BJ3G2P.js";
14
+ import "./chunk-NL5LSKVD.js";
15
+ import "./chunk-PIIUNJIT.js";
16
+ import "./chunk-W5E72HJA.js";
17
+ import "./chunk-S26LC76R.js";
18
+ import "./chunk-VCRVNLE7.js";
19
+ import "./chunk-LJDODBBZ.js";
20
+ import "./chunk-CB7PEVOJ.js";
21
+ import "./chunk-NXL4FFQQ.js";
22
+ export {
23
+ GovulncheckClient,
24
+ parseGovulncheckJson
25
+ };
@@ -1,82 +1,79 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
- import {
3
- formatToolFailure
4
- } from "./chunk-Y7F7IEE3.js";
5
- import "./chunk-JJ2RRESP.js";
6
- import {
7
- scannerReportParentDir
8
- } from "./chunk-V63BC55Q.js";
9
2
  import {
10
3
  nestedWorktreeOffsets
11
- } from "./chunk-CPSR3AVL.js";
4
+ } from "./chunk-VO4JFPTV.js";
5
+ import {
6
+ formatToolFailure
7
+ } from "./chunk-ZZN74OGD.js";
12
8
  import {
13
9
  createAvailabilityChecker,
14
10
  findManagedNodeToolBinary,
15
11
  resolveAvailableOrInstall
16
- } from "./chunk-7E2563GA.js";
17
- import "./chunk-MB6PXBUA.js";
18
- import "./chunk-R5MOQM2H.js";
19
- import "./chunk-24BILSZW.js";
20
- import "./chunk-PR6PO3ES.js";
21
- import "./chunk-RC2Z6K47.js";
22
- import "./chunk-PKES3ISE.js";
23
- import "./chunk-ZKXQKGWZ.js";
24
- import "./chunk-U6VN4NVL.js";
25
- import "./chunk-TIQJPRDD.js";
26
- import "./chunk-YISME6ON.js";
27
- import "./chunk-O4BJFESU.js";
12
+ } from "./chunk-NCLO6E6N.js";
13
+ import "./chunk-7R5GZIA6.js";
14
+ import "./chunk-YOXCCJDF.js";
15
+ import "./chunk-7YTRG6YW.js";
16
+ import "./chunk-V67D6TMU.js";
17
+ import {
18
+ scannerReportParentDir
19
+ } from "./chunk-LT62P654.js";
20
+ import "./chunk-PRHYIA6X.js";
21
+ import "./chunk-ACRJ2GZ5.js";
22
+ import "./chunk-J3Q2NYJR.js";
23
+ import "./chunk-5YSEQHJN.js";
24
+ import "./chunk-QGITU23N.js";
25
+ import "./chunk-WTB4GKMH.js";
26
+ import "./chunk-RTFMDIKV.js";
28
27
  import "./chunk-CKEQFGLT.js";
29
- import "./chunk-HO6LWE2E.js";
30
- import "./chunk-SNDXCFRS.js";
28
+ import "./chunk-KXMJLOZF.js";
31
29
  import {
32
30
  getJscpdMaxEntriesDerived
33
- } from "./chunk-QOE342SU.js";
31
+ } from "./chunk-MRLH4MYU.js";
32
+ import "./chunk-MKPDIAZH.js";
34
33
  import "./chunk-2BEMIWEW.js";
35
34
  import "./chunk-IJYGIDF4.js";
36
- import "./chunk-KDX35VXP.js";
37
- import "./chunk-DPGEAHZT.js";
35
+ import "./chunk-MQ4PPCJB.js";
36
+ import "./chunk-RNJFRXEN.js";
38
37
  import {
39
38
  findNodeToolBinary
40
- } from "./chunk-NA7SEXHE.js";
39
+ } from "./chunk-E65WJVI5.js";
41
40
  import {
42
41
  getIsolatedNpxSpawnOptions
43
- } from "./chunk-3F6BMY53.js";
44
- import "./chunk-KW5JQPO5.js";
45
- import "./chunk-PUZ3E2J4.js";
46
- import "./chunk-ABPKUVA4.js";
47
- import "./chunk-EKWX4WD3.js";
42
+ } from "./chunk-L6WBJGQS.js";
43
+ import "./chunk-UYXV5NIS.js";
44
+ import "./chunk-AACN5GNE.js";
45
+ import "./chunk-3HTZDY3C.js";
46
+ import "./chunk-CDFJF5YD.js";
47
+ import "./chunk-RNXOWDM6.js";
48
48
  import {
49
49
  shouldRecurseIntoDir,
50
50
  walkTreeStackSync
51
- } from "./chunk-ZGSJDWQU.js";
51
+ } from "./chunk-ZCQBNPRH.js";
52
52
  import {
53
53
  getExcludedDirGlobs,
54
54
  getProjectIgnoreGlobs,
55
55
  getProjectIgnoreMatcher,
56
56
  safeSpawnAsync
57
- } from "./chunk-YVHBNSME.js";
57
+ } from "./chunk-TMNUTMT5.js";
58
58
  import "./chunk-AWQWXSW4.js";
59
59
  import "./chunk-QYF5S6P6.js";
60
- import "./chunk-RZOXUSPC.js";
61
- import "./chunk-KPPJTH44.js";
62
- import "./chunk-J6JP25XU.js";
63
- import "./chunk-U5HPROLA.js";
60
+ import "./chunk-CZCAZVTD.js";
61
+ import "./chunk-X5BJ3G2P.js";
62
+ import "./chunk-NL5LSKVD.js";
63
+ import "./chunk-PIIUNJIT.js";
64
64
  import {
65
+ createSubsystemLogger,
65
66
  incrementDegradationCount
66
- } from "./chunk-WME2OQST.js";
67
- import {
68
- createSubsystemLogger
69
- } from "./chunk-KXF5R4UN.js";
67
+ } from "./chunk-W5E72HJA.js";
70
68
  import "./chunk-S26LC76R.js";
71
- import "./chunk-Z2XAOKHK.js";
72
- import "./chunk-VSFLRN5Y.js";
69
+ import "./chunk-VCRVNLE7.js";
73
70
  import "./chunk-LJDODBBZ.js";
74
71
  import {
75
72
  isAtOrAboveHomeDir,
76
73
  isFullyQualified,
77
74
  realpathOrResolve,
78
75
  toPosix
79
- } from "./chunk-PQJFG24Z.js";
76
+ } from "./chunk-CB7PEVOJ.js";
80
77
  import "./chunk-NXL4FFQQ.js";
81
78
 
82
79
  // dist/clients/jscpd-client.js
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
2
2
  import {
3
3
  getWordIndexMaxFilesDerived
4
- } from "./chunk-QOE342SU.js";
4
+ } from "./chunk-MRLH4MYU.js";
5
5
  import {
6
6
  createSingleFlight
7
7
  } from "./chunk-AWQWXSW4.js";
@@ -11,30 +11,29 @@ import {
11
11
  yieldIfOverBudget
12
12
  } from "./chunk-QYF5S6P6.js";
13
13
  import {
14
- KIND_EXTENSIONS
15
- } from "./chunk-RZOXUSPC.js";
14
+ KIND_EXTENSIONS,
15
+ SPECIAL_FILENAMES
16
+ } from "./chunk-CZCAZVTD.js";
16
17
  import {
17
18
  PathKeyedMap,
18
19
  isTestFileName
19
- } from "./chunk-KPPJTH44.js";
20
+ } from "./chunk-X5BJ3G2P.js";
20
21
  import {
21
22
  incrementDegradationCount
22
- } from "./chunk-WME2OQST.js";
23
- import {
24
- logLatency
25
- } from "./chunk-Z2XAOKHK.js";
23
+ } from "./chunk-W5E72HJA.js";
26
24
  import {
27
25
  createNdjsonLogger,
28
26
  getGlobalPiLensLogDir,
29
27
  getMaxLogSizeMB,
30
- isTestMode
31
- } from "./chunk-VSFLRN5Y.js";
28
+ isTestMode,
29
+ logLatency
30
+ } from "./chunk-VCRVNLE7.js";
32
31
  import {
33
32
  isAtOrAboveHomeDir,
34
33
  normalizeEphemeralMapKey,
35
34
  normalizeFilePath,
36
35
  realpathOrResolve
37
- } from "./chunk-PQJFG24Z.js";
36
+ } from "./chunk-CB7PEVOJ.js";
38
37
 
39
38
  // dist/clients/word-index.js
40
39
  import * as fs from "node:fs";
@@ -861,11 +860,12 @@ async function updateWordIndexDocumentAsyncUnsafe(index, doc, shouldContinue) {
861
860
  }
862
861
  var WORD_INDEX_MAX_BYTES = 512 * 1024;
863
862
  async function collectWordIndexDocs(root, shouldContinue = () => true, preflightFiles) {
864
- const { collectSourceFilesAsync } = await import("./chunk-U7BD2QL7.js");
863
+ const { collectSourceFilesAsync } = await import("./chunk-NMUSOZ2D.js");
865
864
  const maxFiles = preflightFiles?.length ?? getWordIndexMaxFilesDerived(root);
866
865
  const files = preflightFiles ? preflightFiles.map((file) => file.path) : await collectSourceFilesAsync(root, {
867
866
  maxFiles,
868
- prioritizeCodeKinds: true
867
+ prioritizeCodeKinds: true,
868
+ includeNamedFiles: true
869
869
  });
870
870
  const truncated = preflightFiles?.truncated ?? files.length === maxFiles;
871
871
  const docs = Object.assign([], { truncated, skipped: 0 });
@@ -910,12 +910,13 @@ async function refreshWordIndexIncrementally(index, root, shouldContinue = () =>
910
910
  timings: { sourceWalkMs: 0, statWalkMs: 0, refreshReadsMs: 0 }
911
911
  };
912
912
  }
913
- const { collectSourceFilesAsync } = await import("./chunk-U7BD2QL7.js");
913
+ const { collectSourceFilesAsync } = await import("./chunk-NMUSOZ2D.js");
914
914
  const maxFiles = getWordIndexMaxFilesDerived(root);
915
915
  const sourceWalkStartMs = Date.now();
916
916
  const walked = await collectSourceFilesAsync(root, {
917
917
  maxFiles,
918
- prioritizeCodeKinds: true
918
+ prioritizeCodeKinds: true,
919
+ includeNamedFiles: true
919
920
  });
920
921
  const sourceWalkMs = Date.now() - sourceWalkStartMs;
921
922
  if (!shouldContinue())
@@ -1097,33 +1098,34 @@ function parseWordIndexQuery(query) {
1097
1098
  }
1098
1099
  return { terms: termParts.join(" "), filters };
1099
1100
  }
1100
- function resolveLangExtensions(value) {
1101
+ function resolveLangMatcher(value) {
1101
1102
  const kind = value.toLowerCase();
1102
1103
  const extensions = KIND_EXTENSIONS[kind];
1103
1104
  if (!extensions) {
1104
1105
  const known = Object.keys(KIND_EXTENSIONS).sort((a, b) => a < b ? -1 : a > b ? 1 : 0).join(", ");
1105
1106
  throw new WordIndexQueryError(`Unknown lang: "${value}" in word-index query \u2014 supported languages: ${known}.`);
1106
1107
  }
1107
- return extensions;
1108
+ const named = SPECIAL_FILENAMES.flatMap((entry) => entry.kind === kind ? [entry.pattern] : []);
1109
+ return (file) => extensions.includes(path2.extname(file).toLowerCase()) || named.some((pattern) => pattern.test(path2.basename(file)));
1108
1110
  }
1109
1111
  function normalizeExtFilterValue(value) {
1110
1112
  return `.${value.replace(/^\.+/, "").toLowerCase()}`;
1111
1113
  }
1112
1114
  function resolveWordIndexFilter(filter) {
1113
1115
  if (filter.key === "lang") {
1114
- const extensions = resolveLangExtensions(filter.value);
1116
+ const matchesLang = resolveLangMatcher(filter.value);
1115
1117
  return {
1116
1118
  key: filter.key,
1117
1119
  negated: filter.negated,
1118
- test: (file) => extensions.includes(path2.extname(file).toLowerCase())
1120
+ test: matchesLang
1119
1121
  };
1120
1122
  }
1121
1123
  if (filter.key === "ext") {
1122
- const normalized = normalizeExtFilterValue(filter.value);
1124
+ const suffix = normalizeExtFilterValue(filter.value);
1123
1125
  return {
1124
1126
  key: filter.key,
1125
1127
  negated: filter.negated,
1126
- test: (file) => path2.extname(file).toLowerCase() === normalized
1128
+ test: (_file, displayPath) => displayPath.toLowerCase().endsWith(suffix)
1127
1129
  };
1128
1130
  }
1129
1131
  const needle = wordIndexKey(filter.value);
@@ -1750,7 +1752,7 @@ function triggerBackgroundWordIndexBuild(cwd, dbg, options = {}) {
1750
1752
  void (async () => {
1751
1753
  const startMs = Date.now();
1752
1754
  try {
1753
- const { loadProjectSnapshot, saveProjectSnapshot, PROJECT_SNAPSHOT_VERSION } = await import("./chunk-CCV2EU7T.js");
1755
+ const { loadProjectSnapshot, saveProjectSnapshot, PROJECT_SNAPSHOT_VERSION } = await import("./chunk-WSSLVMDA.js");
1754
1756
  const docs = await collectWordIndexDocs(key);
1755
1757
  const index = await buildWordIndexAsync(docs);
1756
1758
  const existing = loadProjectSnapshot(key);
@@ -1817,7 +1819,7 @@ function getWordIndexPersistScheduler() {
1817
1819
  async function writeWordIndexSnapshot(cwd, index, dbg) {
1818
1820
  const persistStartedAt = Date.now();
1819
1821
  try {
1820
- const { loadProjectSnapshot, saveProjectSnapshot, PROJECT_SNAPSHOT_VERSION } = await import("./chunk-CCV2EU7T.js");
1822
+ const { loadProjectSnapshot, saveProjectSnapshot, PROJECT_SNAPSHOT_VERSION } = await import("./chunk-WSSLVMDA.js");
1821
1823
  const existing = loadProjectSnapshot(cwd);
1822
1824
  const snapshot = existing ?? {
1823
1825
  version: PROJECT_SNAPSHOT_VERSION,
@@ -2,18 +2,18 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  createAvailabilityProbeFlight,
4
4
  probeToolAsync
5
- } from "./chunk-3F6BMY53.js";
5
+ } from "./chunk-L6WBJGQS.js";
6
6
  import {
7
7
  classifyProbeFailure,
8
8
  createAvailabilityLatch,
9
9
  logAvailabilityDecision,
10
10
  startHostStallSampler
11
- } from "./chunk-KW5JQPO5.js";
11
+ } from "./chunk-AACN5GNE.js";
12
12
  import {
13
13
  createGenerationSource,
14
14
  isUntrustedProjectPath,
15
15
  recordProjectCommandRefusal
16
- } from "./chunk-YVHBNSME.js";
16
+ } from "./chunk-TMNUTMT5.js";
17
17
  import {
18
18
  createSingleFlight
19
19
  } from "./chunk-AWQWXSW4.js";
@@ -2,7 +2,7 @@ import { createRequire as __pilensCreateRequire } from "node:module"; const requ
2
2
  import {
3
3
  getGlobalPiLensDir,
4
4
  safeSpawnAsync
5
- } from "./chunk-YVHBNSME.js";
5
+ } from "./chunk-TMNUTMT5.js";
6
6
  import {
7
7
  createSingleFlight
8
8
  } from "./chunk-AWQWXSW4.js";