@herbertgao/pi-extensions 2026.10.1 → 2026.10.3

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 (934) hide show
  1. package/README.md +14 -17
  2. package/THIRD_PARTY_NOTICES.md +2 -2
  3. package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-audit.md +2 -2
  4. package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-debt.md +2 -2
  5. package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-gain.md +1 -1
  6. package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-help.md +1 -1
  7. package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail-review.md +2 -2
  8. package/node_modules/@dietrichgebert/ponytail/.opencode/command/ponytail.md +1 -1
  9. package/node_modules/@dietrichgebert/ponytail/.qoder/rules/ponytail.md +21 -21
  10. package/node_modules/@dietrichgebert/ponytail/.qoder-plugin/plugin.json +1 -1
  11. package/node_modules/@dietrichgebert/ponytail/AGENTS.md +21 -21
  12. package/node_modules/@dietrichgebert/ponytail/README.md +68 -72
  13. package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-activate.js +7 -0
  14. package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-instructions.js +30 -30
  15. package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-map.js +103 -0
  16. package/node_modules/@dietrichgebert/ponytail/package.json +2 -2
  17. package/node_modules/@dietrichgebert/ponytail/skills/ponytail/SKILL.md +33 -101
  18. package/node_modules/@dietrichgebert/ponytail/skills/ponytail-audit/SKILL.md +89 -32
  19. package/node_modules/@dietrichgebert/ponytail/skills/ponytail-debt/SKILL.md +13 -12
  20. package/node_modules/@dietrichgebert/ponytail/skills/ponytail-gain/SKILL.md +17 -16
  21. package/node_modules/@dietrichgebert/ponytail/skills/ponytail-help/SKILL.md +9 -10
  22. package/node_modules/@dietrichgebert/ponytail/skills/ponytail-review/SKILL.md +96 -57
  23. package/node_modules/{remote-pi → @herbertgao/pi-agency}/LICENSE +1 -1
  24. package/node_modules/@herbertgao/pi-agency/README.md +40 -0
  25. package/node_modules/@herbertgao/pi-agency/package.json +53 -0
  26. package/node_modules/@herbertgao/pi-agency/src/index.ts +441 -0
  27. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/compact-thinking.ts +12 -12
  28. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +30 -6
  29. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +15 -9
  30. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +27 -9
  31. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/codemode.ts +4 -1
  32. package/node_modules/@herbertgao/pi-cc-extensions/package.json +2 -2
  33. package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +8 -0
  34. package/node_modules/@herbertgao/pi-subagents/README.md +1 -1
  35. package/node_modules/@herbertgao/pi-subagents/package.json +4 -5
  36. package/node_modules/@herbertgao/pi-subagents/src/index.ts +1 -1
  37. package/node_modules/@herbertgao/pi-subagents/src/invocation-config.ts +1 -1
  38. package/node_modules/@herbertgao/pi-subagents/src/mention-clone.ts +48 -72
  39. package/node_modules/@herbertgao/pi-subagents/src/nested-tools.ts +1 -1
  40. package/node_modules/@herbertgao/pi-subagents/src/output-file.ts +15 -6
  41. package/node_modules/@herbertgao/pi-subagents/src/workflow/collisions.ts +4 -1
  42. package/node_modules/@herbertgao/pi-subagents/src/workflow/json-schema.ts +9 -8
  43. package/node_modules/@narumitw/pi-caffeinate/dist/index.ts +6 -1
  44. package/node_modules/@narumitw/pi-caffeinate/dist/index.ts.map +2 -2
  45. package/node_modules/@narumitw/pi-caffeinate/package.json +3 -3
  46. package/node_modules/@narumitw/pi-caffeinate/src/dbus-inhibit.ts +13 -1
  47. package/node_modules/@tifan/pi-mermaid-open/package.json +5 -1
  48. package/node_modules/@tifan/pi-mermaid-open/src/index.ts +26 -9
  49. package/node_modules/@tifan/pi-recap/package.json +1 -1
  50. package/node_modules/@tifan/pi-recap/src/index.ts +104 -20
  51. package/node_modules/@tifan/pi-recap/src/models.ts +46 -4
  52. package/node_modules/pi-antigravity/README.md +23 -2
  53. package/node_modules/pi-antigravity/package.json +5 -3
  54. package/node_modules/pi-antigravity/src/diagnostics/diagnostics.ts +3 -2
  55. package/node_modules/pi-antigravity/src/features/generate-image.ts +72 -0
  56. package/node_modules/pi-antigravity/src/features/google-search.ts +71 -0
  57. package/node_modules/pi-antigravity/src/image/image.ts +86 -47
  58. package/node_modules/pi-antigravity/src/image/native.ts +69 -0
  59. package/node_modules/pi-antigravity/src/index.ts +52 -137
  60. package/node_modules/pi-antigravity/src/search/search.ts +130 -31
  61. package/node_modules/pi-antigravity/src/stream/stream.ts +162 -113
  62. package/node_modules/pi-antigravity/src/types/enums.ts +1 -0
  63. package/node_modules/pi-antigravity/src/types/types.ts +1 -1
  64. package/node_modules/pi-antigravity/src/utils/security.ts +47 -1
  65. package/node_modules/pi-antigravity/src/utils/util.ts +38 -6
  66. package/node_modules/pi-lens/CHANGELOG.md +1159 -0
  67. package/node_modules/pi-lens/README.md +116 -25
  68. package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +6 -2
  69. package/node_modules/pi-lens/dist/chunk-2BEMIWEW.js +51 -0
  70. package/node_modules/pi-lens/dist/chunk-2EECBNC5.js +89 -0
  71. package/node_modules/pi-lens/dist/chunk-2FQ62SPM.js +83 -0
  72. package/node_modules/pi-lens/dist/chunk-2UMYMRI3.js +118 -0
  73. package/node_modules/pi-lens/dist/chunk-34OCDWOS.js +48 -0
  74. package/node_modules/pi-lens/dist/chunk-3FERWMCH.js +144 -0
  75. package/node_modules/pi-lens/dist/chunk-3JL6IFD7.js +97 -0
  76. package/node_modules/pi-lens/dist/chunk-3JSEWUWI.js +327 -0
  77. package/node_modules/pi-lens/dist/chunk-3MED75HT.js +37 -0
  78. package/node_modules/pi-lens/dist/chunk-3MRXIJ6I.js +79 -0
  79. package/node_modules/pi-lens/dist/chunk-3P4PF2BX.js +2250 -0
  80. package/node_modules/pi-lens/dist/chunk-3PNFWVHT.js +201 -0
  81. package/node_modules/pi-lens/dist/chunk-3TTPKMEF.js +162 -0
  82. package/node_modules/pi-lens/dist/chunk-5JHXUETW.js +326 -0
  83. package/node_modules/pi-lens/dist/chunk-5W3R6LFT.js +24 -0
  84. package/node_modules/pi-lens/dist/chunk-64LU2OVH.js +341 -0
  85. package/node_modules/pi-lens/dist/chunk-6B5I6ICN.js +44 -0
  86. package/node_modules/pi-lens/dist/chunk-6P54TMWL.js +274 -0
  87. package/node_modules/pi-lens/dist/chunk-6UYA642J.js +145 -0
  88. package/node_modules/pi-lens/dist/chunk-6XX5HCLK.js +398 -0
  89. package/node_modules/pi-lens/dist/chunk-7AXO3ZDF.js +30 -0
  90. package/node_modules/pi-lens/dist/chunk-7BX5DWSA.js +1907 -0
  91. package/node_modules/pi-lens/dist/chunk-7ELY2CSM.js +902 -0
  92. package/node_modules/pi-lens/dist/chunk-7M4T5N3V.js +38 -0
  93. package/node_modules/pi-lens/dist/chunk-7U2IDNXN.js +37 -0
  94. package/node_modules/pi-lens/dist/chunk-ABBOA7UD.js +157 -0
  95. package/node_modules/pi-lens/dist/chunk-AFZYMAIV.js +756 -0
  96. package/node_modules/pi-lens/dist/chunk-ALQRYH6O.js +112 -0
  97. package/node_modules/pi-lens/dist/chunk-AXKPQ6ZI.js +1610 -0
  98. package/node_modules/pi-lens/dist/chunk-BHWHXMQ2.js +62 -0
  99. package/node_modules/pi-lens/dist/chunk-BJF25SUG.js +22 -0
  100. package/node_modules/pi-lens/dist/chunk-BNKLYOOO.js +18 -0
  101. package/node_modules/pi-lens/dist/chunk-BW5KFIQC.js +59 -0
  102. package/node_modules/pi-lens/dist/chunk-CBD2B5CP.js +599 -0
  103. package/node_modules/pi-lens/dist/chunk-CFYISHUW.js +42 -0
  104. package/node_modules/pi-lens/dist/chunk-CMU4RMJB.js +30 -0
  105. package/node_modules/pi-lens/dist/chunk-CULQYFLU.js +14 -0
  106. package/node_modules/pi-lens/dist/chunk-D65GOCJB.js +289 -0
  107. package/node_modules/pi-lens/dist/chunk-D6YF5HKX.js +59 -0
  108. package/node_modules/pi-lens/dist/chunk-DMS52BEP.js +342 -0
  109. package/node_modules/pi-lens/dist/chunk-ELVWJYRV.js +211 -0
  110. package/node_modules/pi-lens/dist/chunk-EUT3B22Y.js +27 -0
  111. package/node_modules/pi-lens/dist/chunk-F5VLZHUW.js +146 -0
  112. package/node_modules/pi-lens/dist/chunk-FC4RP4I2.js +12 -0
  113. package/node_modules/pi-lens/dist/chunk-FGALODG3.js +55 -0
  114. package/node_modules/pi-lens/dist/chunk-G3RLJYA2.js +2358 -0
  115. package/node_modules/pi-lens/dist/chunk-GAYGGICG.js +32 -0
  116. package/node_modules/pi-lens/dist/chunk-H2W2AXD3.js +419 -0
  117. package/node_modules/pi-lens/dist/chunk-H5EV3VMF.js +114 -0
  118. package/node_modules/pi-lens/dist/chunk-HREZQCT3.js +106 -0
  119. package/node_modules/pi-lens/dist/chunk-HSIRMK2D.js +517 -0
  120. package/node_modules/pi-lens/dist/chunk-IMSQR4WO.js +184 -0
  121. package/node_modules/pi-lens/dist/chunk-IQZXOZ7S.js +4816 -0
  122. package/node_modules/pi-lens/dist/chunk-IR6XFA5P.js +37 -0
  123. package/node_modules/pi-lens/dist/chunk-IUKPRZER.js +78 -0
  124. package/node_modules/pi-lens/dist/chunk-IUR76K6A.js +262 -0
  125. package/node_modules/pi-lens/dist/chunk-J3FZR3YY.js +98 -0
  126. package/node_modules/pi-lens/dist/chunk-J6DFZDFA.js +562 -0
  127. package/node_modules/pi-lens/dist/chunk-J7WJZ6W7.js +50 -0
  128. package/node_modules/pi-lens/dist/chunk-JONGANYH.js +202 -0
  129. package/node_modules/pi-lens/dist/chunk-KJCWXUUS.js +425 -0
  130. package/node_modules/pi-lens/dist/chunk-KJN4IOEJ.js +17 -0
  131. package/node_modules/pi-lens/dist/chunk-KMGPUKFD.js +25 -0
  132. package/node_modules/pi-lens/dist/chunk-LD7WFTRX.js +4533 -0
  133. package/node_modules/pi-lens/dist/chunk-LJDODBBZ.js +78 -0
  134. package/node_modules/pi-lens/dist/chunk-LNOMA3MP.js +169 -0
  135. package/node_modules/pi-lens/dist/chunk-MGIWSROG.js +2334 -0
  136. package/node_modules/pi-lens/dist/chunk-MQA2YBAH.js +308 -0
  137. package/node_modules/pi-lens/dist/chunk-MTDRLSI7.js +21720 -0
  138. package/node_modules/pi-lens/dist/chunk-N2IRDBZI.js +2355 -0
  139. package/node_modules/pi-lens/dist/chunk-N77WFUL7.js +50 -0
  140. package/node_modules/pi-lens/dist/chunk-N7YNJE5R.js +466 -0
  141. package/node_modules/pi-lens/dist/chunk-NABLC7W3.js +148 -0
  142. package/node_modules/pi-lens/dist/chunk-NFXP47RV.js +999 -0
  143. package/node_modules/pi-lens/dist/chunk-NJF2X5XF.js +45 -0
  144. package/node_modules/pi-lens/dist/chunk-NXL4FFQQ.js +47 -0
  145. package/node_modules/pi-lens/dist/chunk-O7HZX7CA.js +309 -0
  146. package/node_modules/pi-lens/dist/chunk-OC7LYAU5.js +708 -0
  147. package/node_modules/pi-lens/dist/chunk-OEX24ECI.js +348 -0
  148. package/node_modules/pi-lens/dist/chunk-OYOB3ZFG.js +78 -0
  149. package/node_modules/pi-lens/dist/chunk-OYTMZXRF.js +41 -0
  150. package/node_modules/pi-lens/dist/chunk-OZJINN4O.js +84 -0
  151. package/node_modules/pi-lens/dist/chunk-PCHDGUKT.js +23 -0
  152. package/node_modules/pi-lens/dist/chunk-QOZXJ4NA.js +3364 -0
  153. package/node_modules/pi-lens/dist/chunk-QYF5S6P6.js +45 -0
  154. package/node_modules/pi-lens/dist/chunk-RJFED73B.js +79 -0
  155. package/node_modules/pi-lens/dist/chunk-RTQNRM5X.js +27 -0
  156. package/node_modules/pi-lens/dist/chunk-S6AMWKPC.js +189 -0
  157. package/node_modules/pi-lens/dist/chunk-T4QZ6FEH.js +308 -0
  158. package/node_modules/pi-lens/dist/chunk-T54VJRAD.js +5456 -0
  159. package/node_modules/pi-lens/dist/chunk-TA5L5KWQ.js +167 -0
  160. package/node_modules/pi-lens/dist/chunk-TQFBZVCG.js +27 -0
  161. package/node_modules/pi-lens/dist/chunk-U52SAGRM.js +62 -0
  162. package/node_modules/pi-lens/dist/chunk-UEAHAMEI.js +5814 -0
  163. package/node_modules/pi-lens/dist/chunk-UGSMCQ4D.js +327 -0
  164. package/node_modules/pi-lens/dist/chunk-UOPVJQ4N.js +103 -0
  165. package/node_modules/pi-lens/dist/chunk-USHG4DLH.js +459 -0
  166. package/node_modules/pi-lens/dist/chunk-UXVNL3D7.js +23 -0
  167. package/node_modules/pi-lens/dist/chunk-V5MEBST3.js +4139 -0
  168. package/node_modules/pi-lens/dist/chunk-VGEVL5EQ.js +29 -0
  169. package/node_modules/pi-lens/dist/chunk-VPWKF3GN.js +87 -0
  170. package/node_modules/pi-lens/dist/chunk-VSMJK3ZJ.js +1250 -0
  171. package/node_modules/pi-lens/dist/chunk-VYKKMYVT.js +560 -0
  172. package/node_modules/pi-lens/dist/chunk-VZHJS6DR.js +442 -0
  173. package/node_modules/pi-lens/dist/chunk-WATC3IQR.js +213 -0
  174. package/node_modules/pi-lens/dist/chunk-WPE5FPGR.js +54 -0
  175. package/node_modules/pi-lens/dist/chunk-WSEWKCXU.js +188 -0
  176. package/node_modules/pi-lens/dist/chunk-WW5BLB74.js +659 -0
  177. package/node_modules/pi-lens/dist/chunk-XGUL4SLQ.js +406 -0
  178. package/node_modules/pi-lens/dist/chunk-XHSCVSOL.js +170 -0
  179. package/node_modules/pi-lens/dist/chunk-XIMYZ3JA.js +27 -0
  180. package/node_modules/pi-lens/dist/chunk-YLN4K6WD.js +385 -0
  181. package/node_modules/pi-lens/dist/chunk-Z3CCVDUB.js +76 -0
  182. package/node_modules/pi-lens/dist/chunk-Z54ZSOBZ.js +61 -0
  183. package/node_modules/pi-lens/dist/chunk-Z6BB4JLQ.js +478 -0
  184. package/node_modules/pi-lens/dist/chunk-Z7QQA2KT.js +27 -0
  185. package/node_modules/pi-lens/dist/chunk-ZETYB3XG.js +2626 -0
  186. package/node_modules/pi-lens/dist/chunk-ZMOMPX2Z.js +87 -0
  187. package/node_modules/pi-lens/dist/chunk-ZOEYVXSV.js +149 -0
  188. package/node_modules/pi-lens/dist/chunk-ZZUFZUQZ.js +12120 -0
  189. package/node_modules/pi-lens/dist/index.js +39712 -29876
  190. package/node_modules/pi-lens/dist/mcp/analyze-cli.js +186 -232
  191. package/node_modules/pi-lens/dist/mcp/cli.js +137 -98
  192. package/node_modules/pi-lens/dist/mcp/server.js +22688 -1573
  193. package/node_modules/pi-lens/dist/mcp/worker.js +97 -38
  194. package/node_modules/pi-lens/dist/probes/installer.js +135 -0
  195. package/node_modules/pi-lens/dist/workers/project-snapshot-persist-worker.js +22 -0
  196. package/node_modules/pi-lens/dist/workers/review-graph-persist-worker.js +15 -0
  197. package/node_modules/pi-lens/docs/agent-guide.md +13 -4
  198. package/node_modules/pi-lens/docs/agent-tools.md +42 -0
  199. package/node_modules/pi-lens/docs/ast-grep_rules_catalog.md +5 -4
  200. package/node_modules/pi-lens/docs/configuration.md +28 -2
  201. package/node_modules/pi-lens/docs/custom-rules.md +25 -2
  202. package/node_modules/pi-lens/docs/environment-variables.md +86 -8
  203. package/node_modules/pi-lens/docs/features.md +45 -5
  204. package/node_modules/pi-lens/docs/globalconfig.md +2 -1
  205. package/node_modules/pi-lens/docs/io-bridge-v2-migration.md +94 -0
  206. package/node_modules/pi-lens/docs/lsp-capability-matrix.md +37 -4
  207. package/node_modules/pi-lens/docs/lsp-idle-eviction.md +124 -0
  208. package/node_modules/pi-lens/docs/mcp.md +21 -5
  209. package/node_modules/pi-lens/docs/merge-queue-rollout.md +77 -0
  210. package/node_modules/pi-lens/docs/pi-lens-fixer.md +160 -88
  211. package/node_modules/pi-lens/docs/pi-lens-investigator.md +74 -26
  212. package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +736 -0
  213. package/node_modules/pi-lens/docs/pi-lens-monitor.md +75 -7
  214. package/node_modules/pi-lens/docs/pi-lens-retro.md +6 -4
  215. package/node_modules/pi-lens/docs/pi-lens-reviewer.md +189 -48
  216. package/node_modules/pi-lens/docs/pi-lens-subagent.md +246 -45
  217. package/node_modules/pi-lens/docs/pi-lens-warden.md +18 -7
  218. package/node_modules/pi-lens/docs/public-api-stability.md +55 -0
  219. package/node_modules/pi-lens/docs/release-qa-baseline.md +84 -17
  220. package/node_modules/pi-lens/docs/rfcs/3654-unified-io-bridge-v2.md +316 -0
  221. package/node_modules/pi-lens/docs/schema/pi-lens-config-v1.json +530 -0
  222. package/node_modules/pi-lens/docs/servercapabilities.md +56 -49
  223. package/node_modules/pi-lens/docs/settings.md +1 -0
  224. package/node_modules/pi-lens/docs/usage.md +5 -1
  225. package/node_modules/pi-lens/docs/word-index.md +6 -0
  226. package/node_modules/pi-lens/grammars/tree-sitter-bash.wasm +0 -0
  227. package/node_modules/pi-lens/grammars/tree-sitter-bash.wasm.json +3 -3
  228. package/node_modules/pi-lens/package.json +18 -6
  229. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/advisory-registry-subset-test.yml +41 -0
  230. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-identity-operator-on-literals-test.yml +12 -2
  231. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/throw-new-error-js-test.yml +2 -0
  232. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/throw-new-error-test.yml +2 -0
  233. package/node_modules/pi-lens/rules/ast-grep-rules/rules/advisory-registry-subset.yml +50 -0
  234. package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-identity-operator-on-literals.yml +20 -12
  235. package/node_modules/pi-lens/rules/ast-grep-rules/rules/throw-new-error-js.yml +2 -2
  236. package/node_modules/pi-lens/rules/ast-grep-rules/rules/throw-new-error.yml +2 -2
  237. package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +1275 -62
  238. package/node_modules/pi-lens/scripts/download-grammars.js +5 -0
  239. package/node_modules/pi-lens/scripts/grammars.lock.json +6 -1
  240. package/node_modules/pi-lens/scripts/install-selftest.mjs +33 -34
  241. package/node_modules/pi-lens/scripts/lib/host-provided-deps.mjs +13 -4
  242. package/node_modules/pi-lens/scripts/lib/web-tree-sitter-dir.mjs +18 -0
  243. package/node_modules/pi-web-access/CHANGELOG.md +28 -0
  244. package/node_modules/pi-web-access/README.md +10 -6
  245. package/node_modules/pi-web-access/ceramic.ts +219 -0
  246. package/node_modules/pi-web-access/curator-page.ts +3 -1
  247. package/node_modules/pi-web-access/curator-server.ts +1 -0
  248. package/node_modules/pi-web-access/dist/index.js +846 -588
  249. package/node_modules/pi-web-access/dist/mcp-cli.js +725 -516
  250. package/node_modules/pi-web-access/gemini-search.ts +8 -4
  251. package/node_modules/pi-web-access/github-extract.ts +34 -2
  252. package/node_modules/pi-web-access/index.ts +72 -30
  253. package/node_modules/pi-web-access/openai-search.ts +3 -3
  254. package/node_modules/pi-web-access/package.json +2 -2
  255. package/node_modules/pi-web-access/page-query.ts +6 -9
  256. package/node_modules/pi-web-access/parallel-mcp.ts +2 -0
  257. package/node_modules/pi-web-access/query-rewrite.ts +2 -2
  258. package/node_modules/pi-web-access/storage.ts +49 -0
  259. package/node_modules/pi-web-access/summary-review.ts +7 -6
  260. package/node_modules/pi-web-access/utils.ts +21 -6
  261. package/node_modules/pi-web-access/web-tool-core.ts +1 -0
  262. package/package.json +19 -19
  263. package/node_modules/@dietrichgebert/ponytail/README.es.md +0 -212
  264. package/node_modules/@dietrichgebert/ponytail/README.ja.md +0 -212
  265. package/node_modules/@dietrichgebert/ponytail/README.ko.md +0 -212
  266. package/node_modules/@dietrichgebert/ponytail/README.zh-CN.md +0 -212
  267. package/node_modules/pi-lens/dist/clients/actionable-warnings-logger.js +0 -35
  268. package/node_modules/pi-lens/dist/clients/actionable-warnings.js +0 -1610
  269. package/node_modules/pi-lens/dist/clients/advisory-provenance.js +0 -593
  270. package/node_modules/pi-lens/dist/clients/agent-behavior-client.js +0 -147
  271. package/node_modules/pi-lens/dist/clients/agent-nudge.js +0 -325
  272. package/node_modules/pi-lens/dist/clients/analysed-root.js +0 -1
  273. package/node_modules/pi-lens/dist/clients/ast-grep-client.js +0 -731
  274. package/node_modules/pi-lens/dist/clients/ast-grep-rule-manager.js +0 -146
  275. package/node_modules/pi-lens/dist/clients/ast-grep-tool-logger.js +0 -118
  276. package/node_modules/pi-lens/dist/clients/ast-grep-types.js +0 -10
  277. package/node_modules/pi-lens/dist/clients/ast-grep-yaml-synth.js +0 -154
  278. package/node_modules/pi-lens/dist/clients/atomic-write-staging.js +0 -75
  279. package/node_modules/pi-lens/dist/clients/atomic-write.js +0 -189
  280. package/node_modules/pi-lens/dist/clients/availability-probe-flight.js +0 -12
  281. package/node_modules/pi-lens/dist/clients/bash-file-access.js +0 -1056
  282. package/node_modules/pi-lens/dist/clients/biome-client.js +0 -357
  283. package/node_modules/pi-lens/dist/clients/blocker-freshness.js +0 -837
  284. package/node_modules/pi-lens/dist/clients/blocker-past-eof.js +0 -129
  285. package/node_modules/pi-lens/dist/clients/bootstrap.js +0 -569
  286. package/node_modules/pi-lens/dist/clients/bounded-cache.js +0 -190
  287. package/node_modules/pi-lens/dist/clients/bounded-pid-file-lock.js +0 -202
  288. package/node_modules/pi-lens/dist/clients/bounded-telemetry.js +0 -295
  289. package/node_modules/pi-lens/dist/clients/build-identity.js +0 -95
  290. package/node_modules/pi-lens/dist/clients/bundled-resource-health.js +0 -113
  291. package/node_modules/pi-lens/dist/clients/bus-events-logger.js +0 -105
  292. package/node_modules/pi-lens/dist/clients/bus-publish.js +0 -171
  293. package/node_modules/pi-lens/dist/clients/cache/rule-cache.js +0 -190
  294. package/node_modules/pi-lens/dist/clients/cache-manager.js +0 -524
  295. package/node_modules/pi-lens/dist/clients/cache-observability.js +0 -1313
  296. package/node_modules/pi-lens/dist/clients/call-graph.js +0 -852
  297. package/node_modules/pi-lens/dist/clients/cargo-manifest.js +0 -422
  298. package/node_modules/pi-lens/dist/clients/cascade-budget.js +0 -196
  299. package/node_modules/pi-lens/dist/clients/cascade-format.js +0 -315
  300. package/node_modules/pi-lens/dist/clients/cascade-logger.js +0 -31
  301. package/node_modules/pi-lens/dist/clients/cascade-types.js +0 -9
  302. package/node_modules/pi-lens/dist/clients/child-unref.js +0 -124
  303. package/node_modules/pi-lens/dist/clients/code-quality-warnings.js +0 -286
  304. package/node_modules/pi-lens/dist/clients/codebase-model.js +0 -173
  305. package/node_modules/pi-lens/dist/clients/collateral-test-role.js +0 -40
  306. package/node_modules/pi-lens/dist/clients/complexity-client.js +0 -462
  307. package/node_modules/pi-lens/dist/clients/config-core/deny.js +0 -221
  308. package/node_modules/pi-lens/dist/clients/config-core/index.js +0 -50
  309. package/node_modules/pi-lens/dist/clients/config-core/merge.js +0 -357
  310. package/node_modules/pi-lens/dist/clients/config-core/normalize.js +0 -340
  311. package/node_modules/pi-lens/dist/clients/config-core/process-spec.js +0 -248
  312. package/node_modules/pi-lens/dist/clients/config-core/provenance.js +0 -164
  313. package/node_modules/pi-lens/dist/clients/config-core/records.js +0 -218
  314. package/node_modules/pi-lens/dist/clients/config-core/resolve.js +0 -125
  315. package/node_modules/pi-lens/dist/clients/config-core/safe-object.js +0 -78
  316. package/node_modules/pi-lens/dist/clients/config-core/schema.js +0 -165
  317. package/node_modules/pi-lens/dist/clients/config-diagnostic-codes.js +0 -285
  318. package/node_modules/pi-lens/dist/clients/config-locations.js +0 -388
  319. package/node_modules/pi-lens/dist/clients/config-resolve.js +0 -798
  320. package/node_modules/pi-lens/dist/clients/config-schema.js +0 -251
  321. package/node_modules/pi-lens/dist/clients/config-warn.js +0 -407
  322. package/node_modules/pi-lens/dist/clients/console-guard-install.js +0 -26
  323. package/node_modules/pi-lens/dist/clients/cooperative-budget.js +0 -42
  324. package/node_modules/pi-lens/dist/clients/dead-code-client.js +0 -510
  325. package/node_modules/pi-lens/dist/clients/dead-code-logger.js +0 -30
  326. package/node_modules/pi-lens/dist/clients/deadline-utils.js +0 -280
  327. package/node_modules/pi-lens/dist/clients/debug-handles.js +0 -211
  328. package/node_modules/pi-lens/dist/clients/debug-heap.js +0 -174
  329. package/node_modules/pi-lens/dist/clients/deferred-lsp-work.js +0 -106
  330. package/node_modules/pi-lens/dist/clients/degradation-ledger.js +0 -426
  331. package/node_modules/pi-lens/dist/clients/demoted-finding-render.js +0 -169
  332. package/node_modules/pi-lens/dist/clients/dependency-checker.js +0 -885
  333. package/node_modules/pi-lens/dist/clients/deps/ast-grep-napi.js +0 -22
  334. package/node_modules/pi-lens/dist/clients/deps/js-yaml.js +0 -9
  335. package/node_modules/pi-lens/dist/clients/deps/minimatch.js +0 -4
  336. package/node_modules/pi-lens/dist/clients/deps/pi-tui.js +0 -14
  337. package/node_modules/pi-lens/dist/clients/deps/typebox.js +0 -14
  338. package/node_modules/pi-lens/dist/clients/deps/vscode-jsonrpc.js +0 -1
  339. package/node_modules/pi-lens/dist/clients/deps/web-tree-sitter.js +0 -24
  340. package/node_modules/pi-lens/dist/clients/diagnostic-dispositions.js +0 -630
  341. package/node_modules/pi-lens/dist/clients/diagnostic-line-freshness.js +0 -305
  342. package/node_modules/pi-lens/dist/clients/diagnostic-logger.js +0 -73
  343. package/node_modules/pi-lens/dist/clients/diagnostic-tracker.js +0 -105
  344. package/node_modules/pi-lens/dist/clients/diagnostics-publish.js +0 -230
  345. package/node_modules/pi-lens/dist/clients/dispatch/ast-grep-catalog.js +0 -65
  346. package/node_modules/pi-lens/dist/clients/dispatch/auxiliary-lsp.js +0 -343
  347. package/node_modules/pi-lens/dist/clients/dispatch/collect-later-tier.js +0 -35
  348. package/node_modules/pi-lens/dist/clients/dispatch/diagnostic-taxonomy.js +0 -66
  349. package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +0 -1269
  350. package/node_modules/pi-lens/dist/clients/dispatch/fact-provider-types.js +0 -1
  351. package/node_modules/pi-lens/dist/clients/dispatch/fact-rule-runner.js +0 -17
  352. package/node_modules/pi-lens/dist/clients/dispatch/fact-runner.js +0 -30
  353. package/node_modules/pi-lens/dist/clients/dispatch/fact-scheduler.js +0 -68
  354. package/node_modules/pi-lens/dist/clients/dispatch/fact-store.js +0 -377
  355. package/node_modules/pi-lens/dist/clients/dispatch/facts/comment-facts.js +0 -22
  356. package/node_modules/pi-lens/dist/clients/dispatch/facts/file-content.js +0 -19
  357. package/node_modules/pi-lens/dist/clients/dispatch/facts/function-facts.js +0 -348
  358. package/node_modules/pi-lens/dist/clients/dispatch/facts/import-facts.js +0 -204
  359. package/node_modules/pi-lens/dist/clients/dispatch/facts/tree-sitter-facts.js +0 -34
  360. package/node_modules/pi-lens/dist/clients/dispatch/facts/try-catch-facts.js +0 -119
  361. package/node_modules/pi-lens/dist/clients/dispatch/finding-policy.js +0 -339
  362. package/node_modules/pi-lens/dist/clients/dispatch/indent-detect.js +0 -417
  363. package/node_modules/pi-lens/dist/clients/dispatch/inline-suppressions.js +0 -89
  364. package/node_modules/pi-lens/dist/clients/dispatch/integration.js +0 -2377
  365. package/node_modules/pi-lens/dist/clients/dispatch/lazy.js +0 -11
  366. package/node_modules/pi-lens/dist/clients/dispatch/pending-runner-findings.js +0 -87
  367. package/node_modules/pi-lens/dist/clients/dispatch/plan.js +0 -278
  368. package/node_modules/pi-lens/dist/clients/dispatch/priorities.js +0 -20
  369. package/node_modules/pi-lens/dist/clients/dispatch/rule-id-normalize.js +0 -50
  370. package/node_modules/pi-lens/dist/clients/dispatch/rule-ignores.js +0 -69
  371. package/node_modules/pi-lens/dist/clients/dispatch/rule-policy.js +0 -135
  372. package/node_modules/pi-lens/dist/clients/dispatch/rules/async-noise.js +0 -40
  373. package/node_modules/pi-lens/dist/clients/dispatch/rules/async-unnecessary-wrapper.js +0 -27
  374. package/node_modules/pi-lens/dist/clients/dispatch/rules/cors-wildcard.js +0 -54
  375. package/node_modules/pi-lens/dist/clients/dispatch/rules/error-obscuring.js +0 -32
  376. package/node_modules/pi-lens/dist/clients/dispatch/rules/error-swallowing.js +0 -31
  377. package/node_modules/pi-lens/dist/clients/dispatch/rules/framework-call-noise.js +0 -67
  378. package/node_modules/pi-lens/dist/clients/dispatch/rules/high-complexity.js +0 -72
  379. package/node_modules/pi-lens/dist/clients/dispatch/rules/high-fan-out.js +0 -74
  380. package/node_modules/pi-lens/dist/clients/dispatch/rules/high-import-coupling.js +0 -37
  381. package/node_modules/pi-lens/dist/clients/dispatch/rules/missing-error-propagation.js +0 -62
  382. package/node_modules/pi-lens/dist/clients/dispatch/rules/no-commented-credentials.js +0 -52
  383. package/node_modules/pi-lens/dist/clients/dispatch/rules/pass-through-wrappers.js +0 -42
  384. package/node_modules/pi-lens/dist/clients/dispatch/rules/placeholder-comments.js +0 -40
  385. package/node_modules/pi-lens/dist/clients/dispatch/rules/unsafe-boundary.js +0 -126
  386. package/node_modules/pi-lens/dist/clients/dispatch/runner-context.js +0 -52
  387. package/node_modules/pi-lens/dist/clients/dispatch/runners/actionlint.js +0 -111
  388. package/node_modules/pi-lens/dist/clients/dispatch/runners/ast-grep-napi.js +0 -1196
  389. package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +0 -296
  390. package/node_modules/pi-lens/dist/clients/dispatch/runners/cpp-check.js +0 -219
  391. package/node_modules/pi-lens/dist/clients/dispatch/runners/credo.js +0 -82
  392. package/node_modules/pi-lens/dist/clients/dispatch/runners/cue-vet.js +0 -416
  393. package/node_modules/pi-lens/dist/clients/dispatch/runners/dart-analyze.js +0 -183
  394. package/node_modules/pi-lens/dist/clients/dispatch/runners/detekt.js +0 -176
  395. package/node_modules/pi-lens/dist/clients/dispatch/runners/dotnet-build.js +0 -164
  396. package/node_modules/pi-lens/dist/clients/dispatch/runners/elixir-check.js +0 -195
  397. package/node_modules/pi-lens/dist/clients/dispatch/runners/eslint.js +0 -137
  398. package/node_modules/pi-lens/dist/clients/dispatch/runners/fact-rules.js +0 -29
  399. package/node_modules/pi-lens/dist/clients/dispatch/runners/fish-indent.js +0 -69
  400. package/node_modules/pi-lens/dist/clients/dispatch/runners/gleam-check.js +0 -167
  401. package/node_modules/pi-lens/dist/clients/dispatch/runners/go-vet.js +0 -104
  402. package/node_modules/pi-lens/dist/clients/dispatch/runners/golangci-lint.js +0 -135
  403. package/node_modules/pi-lens/dist/clients/dispatch/runners/hadolint.js +0 -91
  404. package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-lint.js +0 -171
  405. package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-render.js +0 -940
  406. package/node_modules/pi-lens/dist/clients/dispatch/runners/htmlhint.js +0 -117
  407. package/node_modules/pi-lens/dist/clients/dispatch/runners/index.js +0 -108
  408. package/node_modules/pi-lens/dist/clients/dispatch/runners/javac.js +0 -99
  409. package/node_modules/pi-lens/dist/clients/dispatch/runners/ktlint.js +0 -110
  410. package/node_modules/pi-lens/dist/clients/dispatch/runners/lsp.js +0 -379
  411. package/node_modules/pi-lens/dist/clients/dispatch/runners/markdownlint.js +0 -167
  412. package/node_modules/pi-lens/dist/clients/dispatch/runners/mypy.js +0 -102
  413. package/node_modules/pi-lens/dist/clients/dispatch/runners/oxlint.js +0 -414
  414. package/node_modules/pi-lens/dist/clients/dispatch/runners/php-lint.js +0 -85
  415. package/node_modules/pi-lens/dist/clients/dispatch/runners/phpstan.js +0 -120
  416. package/node_modules/pi-lens/dist/clients/dispatch/runners/prisma-validate.js +0 -62
  417. package/node_modules/pi-lens/dist/clients/dispatch/runners/psscriptanalyzer.js +0 -445
  418. package/node_modules/pi-lens/dist/clients/dispatch/runners/pyright.js +0 -169
  419. package/node_modules/pi-lens/dist/clients/dispatch/runners/rubocop.js +0 -99
  420. package/node_modules/pi-lens/dist/clients/dispatch/runners/ruff.js +0 -88
  421. package/node_modules/pi-lens/dist/clients/dispatch/runners/rust-clippy.js +0 -256
  422. package/node_modules/pi-lens/dist/clients/dispatch/runners/shellcheck.js +0 -173
  423. package/node_modules/pi-lens/dist/clients/dispatch/runners/shfmt.js +0 -102
  424. package/node_modules/pi-lens/dist/clients/dispatch/runners/spellcheck.js +0 -128
  425. package/node_modules/pi-lens/dist/clients/dispatch/runners/spotbugs.js +0 -259
  426. package/node_modules/pi-lens/dist/clients/dispatch/runners/sqlfluff.js +0 -183
  427. package/node_modules/pi-lens/dist/clients/dispatch/runners/stylelint.js +0 -166
  428. package/node_modules/pi-lens/dist/clients/dispatch/runners/swiftlint.js +0 -163
  429. package/node_modules/pi-lens/dist/clients/dispatch/runners/taplo.js +0 -174
  430. package/node_modules/pi-lens/dist/clients/dispatch/runners/terragrunt.js +0 -168
  431. package/node_modules/pi-lens/dist/clients/dispatch/runners/tflint.js +0 -125
  432. package/node_modules/pi-lens/dist/clients/dispatch/runners/tree-sitter.js +0 -643
  433. package/node_modules/pi-lens/dist/clients/dispatch/runners/trivy-config.js +0 -253
  434. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/availability-policy.js +0 -496
  435. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/candidate-probe.js +0 -90
  436. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/diagnostic-parsers.js +0 -95
  437. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/lazy-installer.js +0 -274
  438. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +0 -1701
  439. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/spawn-outcome.js +0 -101
  440. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/tool-failure.js +0 -235
  441. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/toolchain-availability.js +0 -169
  442. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils.js +0 -15
  443. package/node_modules/pi-lens/dist/clients/dispatch/runners/vale.js +0 -128
  444. package/node_modules/pi-lens/dist/clients/dispatch/runners/yaml-rule-parser.js +0 -242
  445. package/node_modules/pi-lens/dist/clients/dispatch/runners/yamllint.js +0 -95
  446. package/node_modules/pi-lens/dist/clients/dispatch/runners/zig-check.js +0 -79
  447. package/node_modules/pi-lens/dist/clients/dispatch/suppress-writer.js +0 -79
  448. package/node_modules/pi-lens/dist/clients/dispatch/tool-profile.js +0 -30
  449. package/node_modules/pi-lens/dist/clients/dispatch/types.js +0 -21
  450. package/node_modules/pi-lens/dist/clients/dispatch/utils/format-utils.js +0 -45
  451. package/node_modules/pi-lens/dist/clients/dispatch/utils/lsp-diagnostics.js +0 -35
  452. package/node_modules/pi-lens/dist/clients/disposition-logger.js +0 -32
  453. package/node_modules/pi-lens/dist/clients/disposition-publish.js +0 -124
  454. package/node_modules/pi-lens/dist/clients/durable-store.js +0 -97
  455. package/node_modules/pi-lens/dist/clients/effective-config.js +0 -415
  456. package/node_modules/pi-lens/dist/clients/env-utils.js +0 -83
  457. package/node_modules/pi-lens/dist/clients/error-class.js +0 -23
  458. package/node_modules/pi-lens/dist/clients/eval-timestamp.js +0 -17
  459. package/node_modules/pi-lens/dist/clients/event-loop-hold.js +0 -274
  460. package/node_modules/pi-lens/dist/clients/event-loop-monitor.js +0 -250
  461. package/node_modules/pi-lens/dist/clients/extension-log.js +0 -504
  462. package/node_modules/pi-lens/dist/clients/extension-mode.js +0 -73
  463. package/node_modules/pi-lens/dist/clients/feature-hints.js +0 -103
  464. package/node_modules/pi-lens/dist/clients/file-kinds.js +0 -412
  465. package/node_modules/pi-lens/dist/clients/file-role.js +0 -134
  466. package/node_modules/pi-lens/dist/clients/file-time.js +0 -160
  467. package/node_modules/pi-lens/dist/clients/file-utils.js +0 -1032
  468. package/node_modules/pi-lens/dist/clients/finding-delivery-gate.js +0 -494
  469. package/node_modules/pi-lens/dist/clients/finding-identity.js +0 -88
  470. package/node_modules/pi-lens/dist/clients/fix-worklog.js +0 -103
  471. package/node_modules/pi-lens/dist/clients/format-events-publish.js +0 -343
  472. package/node_modules/pi-lens/dist/clients/format-service.js +0 -222
  473. package/node_modules/pi-lens/dist/clients/formatters-lazy.js +0 -9
  474. package/node_modules/pi-lens/dist/clients/formatters.js +0 -2032
  475. package/node_modules/pi-lens/dist/clients/freshness-cadence.js +0 -17
  476. package/node_modules/pi-lens/dist/clients/freshness.js +0 -38
  477. package/node_modules/pi-lens/dist/clients/generated-artifacts.js +0 -394
  478. package/node_modules/pi-lens/dist/clients/generation-guard.js +0 -215
  479. package/node_modules/pi-lens/dist/clients/git-guard.js +0 -1136
  480. package/node_modules/pi-lens/dist/clients/git-tracked-ignore.js +0 -243
  481. package/node_modules/pi-lens/dist/clients/gitleaks-client.js +0 -509
  482. package/node_modules/pi-lens/dist/clients/go-client.js +0 -104
  483. package/node_modules/pi-lens/dist/clients/govulncheck-client.js +0 -605
  484. package/node_modules/pi-lens/dist/clients/gradle-ktfmt-style.js +0 -348
  485. package/node_modules/pi-lens/dist/clients/grammar-source.js +0 -465
  486. package/node_modules/pi-lens/dist/clients/gzip-stage-write.js +0 -135
  487. package/node_modules/pi-lens/dist/clients/hashline-anchor.js +0 -424
  488. package/node_modules/pi-lens/dist/clients/hook-budgets.js +0 -76
  489. package/node_modules/pi-lens/dist/clients/host-edit-normalize.js +0 -140
  490. package/node_modules/pi-lens/dist/clients/host-ports.js +0 -39
  491. package/node_modules/pi-lens/dist/clients/indent-retarget.js +0 -154
  492. package/node_modules/pi-lens/dist/clients/inline-blocker-dispositions.js +0 -186
  493. package/node_modules/pi-lens/dist/clients/install-diagnostics.js +0 -156
  494. package/node_modules/pi-lens/dist/clients/installer/index.js +0 -5416
  495. package/node_modules/pi-lens/dist/clients/installer/managed-tool-refresh-session.js +0 -58
  496. package/node_modules/pi-lens/dist/clients/installer/managed-tool-refresh.js +0 -783
  497. package/node_modules/pi-lens/dist/clients/instance-reaper-state.js +0 -7
  498. package/node_modules/pi-lens/dist/clients/instance-reaper.js +0 -1137
  499. package/node_modules/pi-lens/dist/clients/instance-registry-lock.js +0 -145
  500. package/node_modules/pi-lens/dist/clients/instance-registry.js +0 -773
  501. package/node_modules/pi-lens/dist/clients/jscpd-client.js +0 -378
  502. package/node_modules/pi-lens/dist/clients/json-cache-read.js +0 -65
  503. package/node_modules/pi-lens/dist/clients/knip-client.js +0 -788
  504. package/node_modules/pi-lens/dist/clients/language-policy.js +0 -252
  505. package/node_modules/pi-lens/dist/clients/language-profile.js +0 -361
  506. package/node_modules/pi-lens/dist/clients/language-registry.js +0 -603
  507. package/node_modules/pi-lens/dist/clients/latency-logger.js +0 -727
  508. package/node_modules/pi-lens/dist/clients/lazy-import.js +0 -21
  509. package/node_modules/pi-lens/dist/clients/ledger-bounds.js +0 -54
  510. package/node_modules/pi-lens/dist/clients/lens-config.js +0 -404
  511. package/node_modules/pi-lens/dist/clients/lens-engine.js +0 -358
  512. package/node_modules/pi-lens/dist/clients/lens-events.js +0 -125
  513. package/node_modules/pi-lens/dist/clients/lens-flag-registry.js +0 -467
  514. package/node_modules/pi-lens/dist/clients/lens-map.js +0 -1156
  515. package/node_modules/pi-lens/dist/clients/live-bus-emitter.js +0 -74
  516. package/node_modules/pi-lens/dist/clients/log-cleanup.js +0 -222
  517. package/node_modules/pi-lens/dist/clients/lsp/aggregation.js +0 -178
  518. package/node_modules/pi-lens/dist/clients/lsp/cascade-tier.js +0 -421
  519. package/node_modules/pi-lens/dist/clients/lsp/client.js +0 -4593
  520. package/node_modules/pi-lens/dist/clients/lsp/config.js +0 -691
  521. package/node_modules/pi-lens/dist/clients/lsp/content-limits.js +0 -41
  522. package/node_modules/pi-lens/dist/clients/lsp/diagnostic-binding.js +0 -225
  523. package/node_modules/pi-lens/dist/clients/lsp/document-drift.js +0 -467
  524. package/node_modules/pi-lens/dist/clients/lsp/edits.js +0 -1219
  525. package/node_modules/pi-lens/dist/clients/lsp/index.js +0 -8305
  526. package/node_modules/pi-lens/dist/clients/lsp/inferred-project.js +0 -216
  527. package/node_modules/pi-lens/dist/clients/lsp/jvm-runtime.js +0 -298
  528. package/node_modules/pi-lens/dist/clients/lsp/language.js +0 -63
  529. package/node_modules/pi-lens/dist/clients/lsp/launch.js +0 -746
  530. package/node_modules/pi-lens/dist/clients/lsp/lombok.js +0 -158
  531. package/node_modules/pi-lens/dist/clients/lsp/path-utils.js +0 -5
  532. package/node_modules/pi-lens/dist/clients/lsp/pending-aux-coverage.js +0 -251
  533. package/node_modules/pi-lens/dist/clients/lsp/position-encoding.js +0 -61
  534. package/node_modules/pi-lens/dist/clients/lsp/ruby-drive-dirs.js +0 -83
  535. package/node_modules/pi-lens/dist/clients/lsp/server.js +0 -3290
  536. package/node_modules/pi-lens/dist/clients/lsp/session-roots.js +0 -192
  537. package/node_modules/pi-lens/dist/clients/lsp/spawn-history.js +0 -17
  538. package/node_modules/pi-lens/dist/clients/lsp/sync-kind.js +0 -56
  539. package/node_modules/pi-lens/dist/clients/lsp/tsserver-sync.js +0 -332
  540. package/node_modules/pi-lens/dist/clients/lsp/wait-policy/capability-snapshot.js +0 -1
  541. package/node_modules/pi-lens/dist/clients/lsp/wait-policy/classification.js +0 -85
  542. package/node_modules/pi-lens/dist/clients/lsp/wait-policy/index.js +0 -10
  543. package/node_modules/pi-lens/dist/clients/lsp/wait-policy/strategies.js +0 -392
  544. package/node_modules/pi-lens/dist/clients/lsp/watch-queue.js +0 -61
  545. package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +0 -639
  546. package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-session.js +0 -30
  547. package/node_modules/pi-lens/dist/clients/lsp/workspace-sweep-hold.js +0 -184
  548. package/node_modules/pi-lens/dist/clients/lsp-budget.js +0 -186
  549. package/node_modules/pi-lens/dist/clients/lsp-document-symbols.js +0 -110
  550. package/node_modules/pi-lens/dist/clients/lsp-lazy.js +0 -9
  551. package/node_modules/pi-lens/dist/clients/lsp-mutation.js +0 -396
  552. package/node_modules/pi-lens/dist/clients/lsp-status.js +0 -59
  553. package/node_modules/pi-lens/dist/clients/map-with-concurrency.js +0 -40
  554. package/node_modules/pi-lens/dist/clients/mcp/analyze.js +0 -420
  555. package/node_modules/pi-lens/dist/clients/mcp/host-shim.js +0 -31
  556. package/node_modules/pi-lens/dist/clients/mcp/ipc.js +0 -523
  557. package/node_modules/pi-lens/dist/clients/mcp/review.js +0 -197
  558. package/node_modules/pi-lens/dist/clients/mcp/session.js +0 -412
  559. package/node_modules/pi-lens/dist/clients/memory-sampler.js +0 -208
  560. package/node_modules/pi-lens/dist/clients/message-end-attribution.js +0 -30
  561. package/node_modules/pi-lens/dist/clients/metrics-client.js +0 -107
  562. package/node_modules/pi-lens/dist/clients/metrics-history.js +0 -327
  563. package/node_modules/pi-lens/dist/clients/middle-man-analysis.js +0 -263
  564. package/node_modules/pi-lens/dist/clients/model-provider.js +0 -53
  565. package/node_modules/pi-lens/dist/clients/module-report-lsp.js +0 -189
  566. package/node_modules/pi-lens/dist/clients/module-report.js +0 -2150
  567. package/node_modules/pi-lens/dist/clients/mutating-tool.js +0 -651
  568. package/node_modules/pi-lens/dist/clients/mutation-attribution.js +0 -368
  569. package/node_modules/pi-lens/dist/clients/mutation-bridge.js +0 -240
  570. package/node_modules/pi-lens/dist/clients/ndjson-logger.js +0 -734
  571. package/node_modules/pi-lens/dist/clients/observed-mutation-sources.js +0 -101
  572. package/node_modules/pi-lens/dist/clients/observed-mutation.js +0 -1253
  573. package/node_modules/pi-lens/dist/clients/oldtext-autopatch.js +0 -128
  574. package/node_modules/pi-lens/dist/clients/opaque-mutation-scan.js +0 -496
  575. package/node_modules/pi-lens/dist/clients/opengrep-client.js +0 -333
  576. package/node_modules/pi-lens/dist/clients/opengrep-config.js +0 -76
  577. package/node_modules/pi-lens/dist/clients/package-manager.js +0 -607
  578. package/node_modules/pi-lens/dist/clients/package-root.js +0 -38
  579. package/node_modules/pi-lens/dist/clients/partial-edit-apply.js +0 -439
  580. package/node_modules/pi-lens/dist/clients/path-attribution-telemetry.js +0 -43
  581. package/node_modules/pi-lens/dist/clients/path-keyed-map.js +0 -108
  582. package/node_modules/pi-lens/dist/clients/path-utils.js +0 -1244
  583. package/node_modules/pi-lens/dist/clients/performance-report.js +0 -331
  584. package/node_modules/pi-lens/dist/clients/persist-debounce.js +0 -70
  585. package/node_modules/pi-lens/dist/clients/persistent-reverify.js +0 -271
  586. package/node_modules/pi-lens/dist/clients/php-cs-fixer-config.js +0 -119
  587. package/node_modules/pi-lens/dist/clients/pipeline.js +0 -1480
  588. package/node_modules/pi-lens/dist/clients/post-autofix-notice.js +0 -37
  589. package/node_modules/pi-lens/dist/clients/print-mode.js +0 -21
  590. package/node_modules/pi-lens/dist/clients/probe-home-state.js +0 -228
  591. package/node_modules/pi-lens/dist/clients/process-bridge.js +0 -66
  592. package/node_modules/pi-lens/dist/clients/process-singletons.js +0 -210
  593. package/node_modules/pi-lens/dist/clients/process-snapshot.js +0 -68
  594. package/node_modules/pi-lens/dist/clients/project-changes.js +0 -181
  595. package/node_modules/pi-lens/dist/clients/project-conventions.js +0 -171
  596. package/node_modules/pi-lens/dist/clients/project-diagnostics/cache.js +0 -137
  597. package/node_modules/pi-lens/dist/clients/project-diagnostics/extractors.js +0 -109
  598. package/node_modules/pi-lens/dist/clients/project-diagnostics/fresh-fetch.js +0 -668
  599. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/call-graph-impact.js +0 -118
  600. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/dead-code.js +0 -47
  601. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/gitleaks.js +0 -40
  602. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/govulncheck.js +0 -34
  603. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/jscpd.js +0 -38
  604. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/knip.js +0 -47
  605. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/madge.js +0 -48
  606. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/opengrep.js +0 -40
  607. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/runner-findings.js +0 -127
  608. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/trivy.js +0 -81
  609. package/node_modules/pi-lens/dist/clients/project-diagnostics/scanner.js +0 -520
  610. package/node_modules/pi-lens/dist/clients/project-diagnostics/types.js +0 -1
  611. package/node_modules/pi-lens/dist/clients/project-lens-config.js +0 -807
  612. package/node_modules/pi-lens/dist/clients/project-report.js +0 -701
  613. package/node_modules/pi-lens/dist/clients/project-scale.js +0 -237
  614. package/node_modules/pi-lens/dist/clients/project-scan-policy.js +0 -11
  615. package/node_modules/pi-lens/dist/clients/project-snapshot-fingerprint.js +0 -48
  616. package/node_modules/pi-lens/dist/clients/project-snapshot-persist-worker.js +0 -20
  617. package/node_modules/pi-lens/dist/clients/project-snapshot.js +0 -1653
  618. package/node_modules/pi-lens/dist/clients/project-trust.js +0 -181
  619. package/node_modules/pi-lens/dist/clients/python-environment.js +0 -217
  620. package/node_modules/pi-lens/dist/clients/python-provenance.js +0 -639
  621. package/node_modules/pi-lens/dist/clients/quiet-window-config.js +0 -47
  622. package/node_modules/pi-lens/dist/clients/quiet-window.js +0 -236
  623. package/node_modules/pi-lens/dist/clients/read-bridge.js +0 -139
  624. package/node_modules/pi-lens/dist/clients/read-expansion.js +0 -266
  625. package/node_modules/pi-lens/dist/clients/read-guard-logger.js +0 -251
  626. package/node_modules/pi-lens/dist/clients/read-guard-tool-lines.js +0 -1306
  627. package/node_modules/pi-lens/dist/clients/read-guard.js +0 -1561
  628. package/node_modules/pi-lens/dist/clients/recent-touches.js +0 -240
  629. package/node_modules/pi-lens/dist/clients/redact/secrets.js +0 -449
  630. package/node_modules/pi-lens/dist/clients/resource-sampler.js +0 -628
  631. package/node_modules/pi-lens/dist/clients/reverse-deps.js +0 -270
  632. package/node_modules/pi-lens/dist/clients/review-graph/builder.js +0 -5126
  633. package/node_modules/pi-lens/dist/clients/review-graph/format.js +0 -33
  634. package/node_modules/pi-lens/dist/clients/review-graph/git-identity.js +0 -163
  635. package/node_modules/pi-lens/dist/clients/review-graph/import-resolvers.js +0 -481
  636. package/node_modules/pi-lens/dist/clients/review-graph/persist-worker.js +0 -10
  637. package/node_modules/pi-lens/dist/clients/review-graph/query.js +0 -244
  638. package/node_modules/pi-lens/dist/clients/review-graph/revision-drift.js +0 -21
  639. package/node_modules/pi-lens/dist/clients/review-graph/service.js +0 -96
  640. package/node_modules/pi-lens/dist/clients/review-graph/shared-extraction-ir.js +0 -82
  641. package/node_modules/pi-lens/dist/clients/review-graph/symbol-id.js +0 -103
  642. package/node_modules/pi-lens/dist/clients/review-graph/tsconfig-paths.js +0 -299
  643. package/node_modules/pi-lens/dist/clients/review-graph/types.js +0 -1
  644. package/node_modules/pi-lens/dist/clients/review-graph/workspace-modules.js +0 -449
  645. package/node_modules/pi-lens/dist/clients/review-graph-logger.js +0 -81
  646. package/node_modules/pi-lens/dist/clients/ruff-client.js +0 -179
  647. package/node_modules/pi-lens/dist/clients/rules-scanner.js +0 -131
  648. package/node_modules/pi-lens/dist/clients/run-duration.js +0 -55
  649. package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +0 -746
  650. package/node_modules/pi-lens/dist/clients/runtime-config.js +0 -77
  651. package/node_modules/pi-lens/dist/clients/runtime-context.js +0 -211
  652. package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +0 -1324
  653. package/node_modules/pi-lens/dist/clients/runtime-session.js +0 -2485
  654. package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +0 -1295
  655. package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +0 -2049
  656. package/node_modules/pi-lens/dist/clients/runtime-turn.js +0 -3767
  657. package/node_modules/pi-lens/dist/clients/rust-client.js +0 -97
  658. package/node_modules/pi-lens/dist/clients/safe-spawn.js +0 -2357
  659. package/node_modules/pi-lens/dist/clients/sanitize.js +0 -286
  660. package/node_modules/pi-lens/dist/clients/scan-utils.js +0 -25
  661. package/node_modules/pi-lens/dist/clients/scratch-tree-policy.js +0 -165
  662. package/node_modules/pi-lens/dist/clients/search-read-registration.js +0 -94
  663. package/node_modules/pi-lens/dist/clients/secret-findings.js +0 -114
  664. package/node_modules/pi-lens/dist/clients/security-scan-client.js +0 -352
  665. package/node_modules/pi-lens/dist/clients/session-event-guard.js +0 -297
  666. package/node_modules/pi-lens/dist/clients/session-lifecycle.js +0 -484
  667. package/node_modules/pi-lens/dist/clients/session-start-observability.js +0 -94
  668. package/node_modules/pi-lens/dist/clients/session-state-store.js +0 -101
  669. package/node_modules/pi-lens/dist/clients/session-summary.js +0 -15
  670. package/node_modules/pi-lens/dist/clients/sessionstart-logger.js +0 -27
  671. package/node_modules/pi-lens/dist/clients/sg-runner.js +0 -876
  672. package/node_modules/pi-lens/dist/clients/sgconfig.js +0 -347
  673. package/node_modules/pi-lens/dist/clients/shared-checkout-guard.js +0 -338
  674. package/node_modules/pi-lens/dist/clients/single-flight.js +0 -158
  675. package/node_modules/pi-lens/dist/clients/situational-tool-telemetry.js +0 -108
  676. package/node_modules/pi-lens/dist/clients/skills-resolver.js +0 -141
  677. package/node_modules/pi-lens/dist/clients/slow-fs.js +0 -138
  678. package/node_modules/pi-lens/dist/clients/smells-rollup.js +0 -231
  679. package/node_modules/pi-lens/dist/clients/source-filter.js +0 -596
  680. package/node_modules/pi-lens/dist/clients/source-walker.js +0 -211
  681. package/node_modules/pi-lens/dist/clients/spawn-output-cap.js +0 -120
  682. package/node_modules/pi-lens/dist/clients/spawn-timeout-cooldown.js +0 -110
  683. package/node_modules/pi-lens/dist/clients/stale-marker.js +0 -17
  684. package/node_modules/pi-lens/dist/clients/startup-scan.js +0 -400
  685. package/node_modules/pi-lens/dist/clients/startup-timing.js +0 -130
  686. package/node_modules/pi-lens/dist/clients/string-utils.js +0 -33
  687. package/node_modules/pi-lens/dist/clients/subagent-mode.js +0 -111
  688. package/node_modules/pi-lens/dist/clients/symbol-containment.js +0 -24
  689. package/node_modules/pi-lens/dist/clients/symbol-types.js +0 -5
  690. package/node_modules/pi-lens/dist/clients/test-runner-client.js +0 -2507
  691. package/node_modules/pi-lens/dist/clients/test-runner-delivery.js +0 -287
  692. package/node_modules/pi-lens/dist/clients/todo-scanner.js +0 -229
  693. package/node_modules/pi-lens/dist/clients/tool-agreement.js +0 -423
  694. package/node_modules/pi-lens/dist/clients/tool-config.js +0 -249
  695. package/node_modules/pi-lens/dist/clients/tool-cwd.js +0 -270
  696. package/node_modules/pi-lens/dist/clients/tool-definition.js +0 -47
  697. package/node_modules/pi-lens/dist/clients/tool-event.js +0 -105
  698. package/node_modules/pi-lens/dist/clients/tool-policy.js +0 -2755
  699. package/node_modules/pi-lens/dist/clients/tool-probe.js +0 -53
  700. package/node_modules/pi-lens/dist/clients/tool-render.js +0 -156
  701. package/node_modules/pi-lens/dist/clients/tool-set-policy.js +0 -118
  702. package/node_modules/pi-lens/dist/clients/tree-sitter-cache.js +0 -364
  703. package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +0 -4195
  704. package/node_modules/pi-lens/dist/clients/tree-sitter-logger.js +0 -100
  705. package/node_modules/pi-lens/dist/clients/tree-sitter-navigator.js +0 -269
  706. package/node_modules/pi-lens/dist/clients/tree-sitter-query-loader.js +0 -569
  707. package/node_modules/pi-lens/dist/clients/tree-sitter-shared.js +0 -158
  708. package/node_modules/pi-lens/dist/clients/tree-sitter-symbol-extractor.js +0 -1265
  709. package/node_modules/pi-lens/dist/clients/trivy-client.js +0 -467
  710. package/node_modules/pi-lens/dist/clients/tui-fit.js +0 -50
  711. package/node_modules/pi-lens/dist/clients/turn-context.js +0 -52
  712. package/node_modules/pi-lens/dist/clients/turn-end/lane.js +0 -51
  713. package/node_modules/pi-lens/dist/clients/turn-end/lanes/govulncheck.js +0 -112
  714. package/node_modules/pi-lens/dist/clients/turn-end/lanes/secrets.js +0 -204
  715. package/node_modules/pi-lens/dist/clients/turn-summary-render.js +0 -72
  716. package/node_modules/pi-lens/dist/clients/turn-summary.js +0 -132
  717. package/node_modules/pi-lens/dist/clients/typos-config.js +0 -29
  718. package/node_modules/pi-lens/dist/clients/user-notify.js +0 -51
  719. package/node_modules/pi-lens/dist/clients/vanished-instance-marker.js +0 -57
  720. package/node_modules/pi-lens/dist/clients/warm-attach.js +0 -305
  721. package/node_modules/pi-lens/dist/clients/widget-state.js +0 -1808
  722. package/node_modules/pi-lens/dist/clients/word-index-logger.js +0 -49
  723. package/node_modules/pi-lens/dist/clients/word-index-store.js +0 -459
  724. package/node_modules/pi-lens/dist/clients/word-index.js +0 -2080
  725. package/node_modules/pi-lens/dist/clients/workspace-topology.js +0 -443
  726. package/node_modules/pi-lens/dist/clients/write-ordering-guard.js +0 -65
  727. package/node_modules/pi-lens/dist/clients/zizmor-config.js +0 -340
  728. package/node_modules/pi-lens/dist/i18n.js +0 -69
  729. package/node_modules/pi-lens/dist/mcp/build-staleness.js +0 -124
  730. package/node_modules/pi-lens/dist/scripts/lib/process-scan.mjs +0 -583
  731. package/node_modules/pi-lens/dist/scripts/lib/skills-predicate.mjs +0 -129
  732. package/node_modules/pi-lens/dist/scripts/lib/web-tree-sitter-dir.mjs +0 -123
  733. package/node_modules/pi-lens/dist/tools/activate-tools.js +0 -87
  734. package/node_modules/pi-lens/dist/tools/ast-grep-outline.js +0 -137
  735. package/node_modules/pi-lens/dist/tools/ast-grep-replace.js +0 -244
  736. package/node_modules/pi-lens/dist/tools/ast-grep-search.js +0 -762
  737. package/node_modules/pi-lens/dist/tools/effective-config.js +0 -90
  738. package/node_modules/pi-lens/dist/tools/lens-diagnostic-mark.js +0 -375
  739. package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +0 -2571
  740. package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +0 -1745
  741. package/node_modules/pi-lens/dist/tools/lsp-navigation.js +0 -1367
  742. package/node_modules/pi-lens/dist/tools/lsp-structured-output.js +0 -294
  743. package/node_modules/pi-lens/dist/tools/module-report.js +0 -382
  744. package/node_modules/pi-lens/dist/tools/project-report.js +0 -86
  745. package/node_modules/pi-lens/dist/tools/render-compact.js +0 -374
  746. package/node_modules/pi-lens/dist/tools/scan-progress.js +0 -53
  747. package/node_modules/pi-lens/dist/tools/shared.js +0 -29
  748. package/node_modules/pi-lens/dist/tools/symbol-search.js +0 -155
  749. package/node_modules/pi-web-access/opencode-session-headers.ts +0 -24
  750. package/node_modules/remote-pi/README.md +0 -675
  751. package/node_modules/remote-pi/dist/actions/handlers.d.ts +0 -122
  752. package/node_modules/remote-pi/dist/actions/handlers.js +0 -160
  753. package/node_modules/remote-pi/dist/actions/handlers.js.map +0 -1
  754. package/node_modules/remote-pi/dist/actions/registry.d.ts +0 -39
  755. package/node_modules/remote-pi/dist/actions/registry.js +0 -58
  756. package/node_modules/remote-pi/dist/actions/registry.js.map +0 -1
  757. package/node_modules/remote-pi/dist/bin/supervisord.d.ts +0 -2
  758. package/node_modules/remote-pi/dist/bin/supervisord.js +0 -86
  759. package/node_modules/remote-pi/dist/bin/supervisord.js.map +0 -1
  760. package/node_modules/remote-pi/dist/commands/builtin_mirror.d.ts +0 -58
  761. package/node_modules/remote-pi/dist/commands/builtin_mirror.js +0 -71
  762. package/node_modules/remote-pi/dist/commands/builtin_mirror.js.map +0 -1
  763. package/node_modules/remote-pi/dist/commands/list_commands.d.ts +0 -60
  764. package/node_modules/remote-pi/dist/commands/list_commands.js +0 -73
  765. package/node_modules/remote-pi/dist/commands/list_commands.js.map +0 -1
  766. package/node_modules/remote-pi/dist/config.d.ts +0 -62
  767. package/node_modules/remote-pi/dist/config.js +0 -115
  768. package/node_modules/remote-pi/dist/config.js.map +0 -1
  769. package/node_modules/remote-pi/dist/daemon/client.d.ts +0 -20
  770. package/node_modules/remote-pi/dist/daemon/client.js +0 -131
  771. package/node_modules/remote-pi/dist/daemon/client.js.map +0 -1
  772. package/node_modules/remote-pi/dist/daemon/control_protocol.d.ts +0 -176
  773. package/node_modules/remote-pi/dist/daemon/control_protocol.js +0 -63
  774. package/node_modules/remote-pi/dist/daemon/control_protocol.js.map +0 -1
  775. package/node_modules/remote-pi/dist/daemon/cron_log.d.ts +0 -45
  776. package/node_modules/remote-pi/dist/daemon/cron_log.js +0 -72
  777. package/node_modules/remote-pi/dist/daemon/cron_log.js.map +0 -1
  778. package/node_modules/remote-pi/dist/daemon/cron_registry.d.ts +0 -80
  779. package/node_modules/remote-pi/dist/daemon/cron_registry.js +0 -194
  780. package/node_modules/remote-pi/dist/daemon/cron_registry.js.map +0 -1
  781. package/node_modules/remote-pi/dist/daemon/id.d.ts +0 -24
  782. package/node_modules/remote-pi/dist/daemon/id.js +0 -36
  783. package/node_modules/remote-pi/dist/daemon/id.js.map +0 -1
  784. package/node_modules/remote-pi/dist/daemon/install.d.ts +0 -170
  785. package/node_modules/remote-pi/dist/daemon/install.js +0 -547
  786. package/node_modules/remote-pi/dist/daemon/install.js.map +0 -1
  787. package/node_modules/remote-pi/dist/daemon/registry.d.ts +0 -63
  788. package/node_modules/remote-pi/dist/daemon/registry.js +0 -153
  789. package/node_modules/remote-pi/dist/daemon/registry.js.map +0 -1
  790. package/node_modules/remote-pi/dist/daemon/rpc_child.d.ts +0 -194
  791. package/node_modules/remote-pi/dist/daemon/rpc_child.js +0 -389
  792. package/node_modules/remote-pi/dist/daemon/rpc_child.js.map +0 -1
  793. package/node_modules/remote-pi/dist/daemon/supervisor.d.ts +0 -93
  794. package/node_modules/remote-pi/dist/daemon/supervisor.js +0 -596
  795. package/node_modules/remote-pi/dist/daemon/supervisor.js.map +0 -1
  796. package/node_modules/remote-pi/dist/extension_ui_bridge.d.ts +0 -26
  797. package/node_modules/remote-pi/dist/extension_ui_bridge.js +0 -341
  798. package/node_modules/remote-pi/dist/extension_ui_bridge.js.map +0 -1
  799. package/node_modules/remote-pi/dist/index.d.ts +0 -213
  800. package/node_modules/remote-pi/dist/index.js +0 -4996
  801. package/node_modules/remote-pi/dist/index.js.map +0 -1
  802. package/node_modules/remote-pi/dist/mcp/mesh_result.d.ts +0 -10
  803. package/node_modules/remote-pi/dist/mcp/mesh_result.js +0 -42
  804. package/node_modules/remote-pi/dist/mcp/mesh_result.js.map +0 -1
  805. package/node_modules/remote-pi/dist/mcp/mesh_server.d.ts +0 -16
  806. package/node_modules/remote-pi/dist/mcp/mesh_server.js +0 -327
  807. package/node_modules/remote-pi/dist/mcp/mesh_server.js.map +0 -1
  808. package/node_modules/remote-pi/dist/mesh/canonical.d.ts +0 -30
  809. package/node_modules/remote-pi/dist/mesh/canonical.js +0 -61
  810. package/node_modules/remote-pi/dist/mesh/canonical.js.map +0 -1
  811. package/node_modules/remote-pi/dist/mesh/client.d.ts +0 -18
  812. package/node_modules/remote-pi/dist/mesh/client.js +0 -125
  813. package/node_modules/remote-pi/dist/mesh/client.js.map +0 -1
  814. package/node_modules/remote-pi/dist/mesh/encoding.d.ts +0 -38
  815. package/node_modules/remote-pi/dist/mesh/encoding.js +0 -216
  816. package/node_modules/remote-pi/dist/mesh/encoding.js.map +0 -1
  817. package/node_modules/remote-pi/dist/mesh/self_revoke.d.ts +0 -73
  818. package/node_modules/remote-pi/dist/mesh/self_revoke.js +0 -401
  819. package/node_modules/remote-pi/dist/mesh/self_revoke.js.map +0 -1
  820. package/node_modules/remote-pi/dist/mesh/siblings.d.ts +0 -49
  821. package/node_modules/remote-pi/dist/mesh/siblings.js +0 -159
  822. package/node_modules/remote-pi/dist/mesh/siblings.js.map +0 -1
  823. package/node_modules/remote-pi/dist/mesh/types.d.ts +0 -34
  824. package/node_modules/remote-pi/dist/mesh/types.js +0 -11
  825. package/node_modules/remote-pi/dist/mesh/types.js.map +0 -1
  826. package/node_modules/remote-pi/dist/mesh/verify.d.ts +0 -17
  827. package/node_modules/remote-pi/dist/mesh/verify.js +0 -86
  828. package/node_modules/remote-pi/dist/mesh/verify.js.map +0 -1
  829. package/node_modules/remote-pi/dist/pairing/crypto.d.ts +0 -8
  830. package/node_modules/remote-pi/dist/pairing/crypto.js +0 -22
  831. package/node_modules/remote-pi/dist/pairing/crypto.js.map +0 -1
  832. package/node_modules/remote-pi/dist/pairing/handshake.d.ts +0 -28
  833. package/node_modules/remote-pi/dist/pairing/handshake.js +0 -113
  834. package/node_modules/remote-pi/dist/pairing/handshake.js.map +0 -1
  835. package/node_modules/remote-pi/dist/pairing/noise-sha256.d.ts +0 -16
  836. package/node_modules/remote-pi/dist/pairing/noise-sha256.js +0 -103
  837. package/node_modules/remote-pi/dist/pairing/noise-sha256.js.map +0 -1
  838. package/node_modules/remote-pi/dist/pairing/qr.d.ts +0 -59
  839. package/node_modules/remote-pi/dist/pairing/qr.js +0 -125
  840. package/node_modules/remote-pi/dist/pairing/qr.js.map +0 -1
  841. package/node_modules/remote-pi/dist/pairing/storage.d.ts +0 -120
  842. package/node_modules/remote-pi/dist/pairing/storage.js +0 -604
  843. package/node_modules/remote-pi/dist/pairing/storage.js.map +0 -1
  844. package/node_modules/remote-pi/dist/protocol/codec.d.ts +0 -7
  845. package/node_modules/remote-pi/dist/protocol/codec.js +0 -49
  846. package/node_modules/remote-pi/dist/protocol/codec.js.map +0 -1
  847. package/node_modules/remote-pi/dist/protocol/types.d.ts +0 -393
  848. package/node_modules/remote-pi/dist/protocol/types.js +0 -2
  849. package/node_modules/remote-pi/dist/protocol/types.js.map +0 -1
  850. package/node_modules/remote-pi/dist/rooms.d.ts +0 -29
  851. package/node_modules/remote-pi/dist/rooms.js +0 -57
  852. package/node_modules/remote-pi/dist/rooms.js.map +0 -1
  853. package/node_modules/remote-pi/dist/session/address.d.ts +0 -49
  854. package/node_modules/remote-pi/dist/session/address.js +0 -58
  855. package/node_modules/remote-pi/dist/session/address.js.map +0 -1
  856. package/node_modules/remote-pi/dist/session/agent_bridge.d.ts +0 -55
  857. package/node_modules/remote-pi/dist/session/agent_bridge.js +0 -146
  858. package/node_modules/remote-pi/dist/session/agent_bridge.js.map +0 -1
  859. package/node_modules/remote-pi/dist/session/bridge.d.ts +0 -37
  860. package/node_modules/remote-pi/dist/session/bridge.js +0 -130
  861. package/node_modules/remote-pi/dist/session/bridge.js.map +0 -1
  862. package/node_modules/remote-pi/dist/session/broker.d.ts +0 -189
  863. package/node_modules/remote-pi/dist/session/broker.js +0 -507
  864. package/node_modules/remote-pi/dist/session/broker.js.map +0 -1
  865. package/node_modules/remote-pi/dist/session/broker_remote.d.ts +0 -74
  866. package/node_modules/remote-pi/dist/session/broker_remote.js +0 -583
  867. package/node_modules/remote-pi/dist/session/broker_remote.js.map +0 -1
  868. package/node_modules/remote-pi/dist/session/cwd_lock.d.ts +0 -33
  869. package/node_modules/remote-pi/dist/session/cwd_lock.js +0 -126
  870. package/node_modules/remote-pi/dist/session/cwd_lock.js.map +0 -1
  871. package/node_modules/remote-pi/dist/session/envelope.d.ts +0 -33
  872. package/node_modules/remote-pi/dist/session/envelope.js +0 -117
  873. package/node_modules/remote-pi/dist/session/envelope.js.map +0 -1
  874. package/node_modules/remote-pi/dist/session/global_config.d.ts +0 -33
  875. package/node_modules/remote-pi/dist/session/global_config.js +0 -73
  876. package/node_modules/remote-pi/dist/session/global_config.js.map +0 -1
  877. package/node_modules/remote-pi/dist/session/ipc.d.ts +0 -27
  878. package/node_modules/remote-pi/dist/session/ipc.js +0 -22
  879. package/node_modules/remote-pi/dist/session/ipc.js.map +0 -1
  880. package/node_modules/remote-pi/dist/session/leader_election.d.ts +0 -32
  881. package/node_modules/remote-pi/dist/session/leader_election.js +0 -106
  882. package/node_modules/remote-pi/dist/session/leader_election.js.map +0 -1
  883. package/node_modules/remote-pi/dist/session/local_config.d.ts +0 -55
  884. package/node_modules/remote-pi/dist/session/local_config.js +0 -157
  885. package/node_modules/remote-pi/dist/session/local_config.js.map +0 -1
  886. package/node_modules/remote-pi/dist/session/mesh_message.d.ts +0 -20
  887. package/node_modules/remote-pi/dist/session/mesh_message.js +0 -28
  888. package/node_modules/remote-pi/dist/session/mesh_message.js.map +0 -1
  889. package/node_modules/remote-pi/dist/session/mesh_node.d.ts +0 -116
  890. package/node_modules/remote-pi/dist/session/mesh_node.js +0 -573
  891. package/node_modules/remote-pi/dist/session/mesh_node.js.map +0 -1
  892. package/node_modules/remote-pi/dist/session/peer.d.ts +0 -139
  893. package/node_modules/remote-pi/dist/session/peer.js +0 -451
  894. package/node_modules/remote-pi/dist/session/peer.js.map +0 -1
  895. package/node_modules/remote-pi/dist/session/peer_inventory.d.ts +0 -13
  896. package/node_modules/remote-pi/dist/session/peer_inventory.js +0 -48
  897. package/node_modules/remote-pi/dist/session/peer_inventory.js.map +0 -1
  898. package/node_modules/remote-pi/dist/session/peer_limits.d.ts +0 -9
  899. package/node_modules/remote-pi/dist/session/peer_limits.js +0 -21
  900. package/node_modules/remote-pi/dist/session/peer_limits.js.map +0 -1
  901. package/node_modules/remote-pi/dist/session/setup_wizard.d.ts +0 -39
  902. package/node_modules/remote-pi/dist/session/setup_wizard.js +0 -63
  903. package/node_modules/remote-pi/dist/session/setup_wizard.js.map +0 -1
  904. package/node_modules/remote-pi/dist/session/tool_gate.d.ts +0 -5
  905. package/node_modules/remote-pi/dist/session/tool_gate.js +0 -11
  906. package/node_modules/remote-pi/dist/session/tool_gate.js.map +0 -1
  907. package/node_modules/remote-pi/dist/session/tools.d.ts +0 -24
  908. package/node_modules/remote-pi/dist/session/tools.js +0 -252
  909. package/node_modules/remote-pi/dist/session/tools.js.map +0 -1
  910. package/node_modules/remote-pi/dist/session/wizard.d.ts +0 -13
  911. package/node_modules/remote-pi/dist/session/wizard.js +0 -20
  912. package/node_modules/remote-pi/dist/session/wizard.js.map +0 -1
  913. package/node_modules/remote-pi/dist/settings.d.ts +0 -15
  914. package/node_modules/remote-pi/dist/settings.js +0 -52
  915. package/node_modules/remote-pi/dist/settings.js.map +0 -1
  916. package/node_modules/remote-pi/dist/transport/peer_channel.d.ts +0 -37
  917. package/node_modules/remote-pi/dist/transport/peer_channel.js +0 -98
  918. package/node_modules/remote-pi/dist/transport/peer_channel.js.map +0 -1
  919. package/node_modules/remote-pi/dist/transport/pi_forward_client.d.ts +0 -29
  920. package/node_modules/remote-pi/dist/transport/pi_forward_client.js +0 -62
  921. package/node_modules/remote-pi/dist/transport/pi_forward_client.js.map +0 -1
  922. package/node_modules/remote-pi/dist/transport/relay_client.d.ts +0 -91
  923. package/node_modules/remote-pi/dist/transport/relay_client.js +0 -206
  924. package/node_modules/remote-pi/dist/transport/relay_client.js.map +0 -1
  925. package/node_modules/remote-pi/dist/ui/footer.d.ts +0 -32
  926. package/node_modules/remote-pi/dist/ui/footer.js +0 -34
  927. package/node_modules/remote-pi/dist/ui/footer.js.map +0 -1
  928. package/node_modules/remote-pi/docs/daemon.md +0 -289
  929. package/node_modules/remote-pi/package.json +0 -92
  930. package/node_modules/remote-pi/service-templates/launchd.plist.template +0 -35
  931. package/node_modules/remote-pi/service-templates/systemd.service.template +0 -19
  932. package/node_modules/remote-pi/service-templates/task-launcher.vbs.template +0 -10
  933. package/node_modules/remote-pi/service-templates/task-scheduler.xml.template +0 -38
  934. package/node_modules/remote-pi/skills/agent-network/SKILL.md +0 -310
@@ -1,1032 +0,0 @@
1
- /**
2
- * Shared file path utilities for pi-lens
3
- */
4
- import * as fs from "node:fs";
5
- import { createHash } from "node:crypto";
6
- import * as os from "node:os";
7
- import * as path from "node:path";
8
- import { Minimatch } from "./deps/minimatch.js";
9
- import { detectFileRole } from "./file-role.js";
10
- import { FRESHNESS_CADENCE_MS } from "./freshness-cadence.js";
11
- import { isInSpawnTimeoutCooldown, noteSpawnTimeout, } from "./spawn-timeout-cooldown.js";
12
- import { collectTrackedFiles, getTrackedFilesSnapshot, } from "./git-tracked-ignore.js";
13
- import { getGlobalIgnorePatterns, getPiLensGlobalConfigPath, } from "./lens-config.js";
14
- import { homeRelativePath, isExternalOrVendorFile, isUnderDir, normalizeEphemeralMapKey, normalizeFilePath, toProjectRelativePath, } from "./path-utils.js";
15
- import { findPiLensConfigInDir, findPiLensProjectConfig, loadPiLensConfigInDir, loadPiLensProjectConfig, } from "./project-lens-config.js";
16
- import { safeSpawnAsync } from "./safe-spawn.js";
17
- /**
18
- * Return the directory where pi-lens stores project-specific data
19
- * (caches, indexes, worklogs, etc.).
20
- *
21
- * Default: reuse <project>/.pi-lens if it already exists, otherwise use
22
- * ~/.pi-lens/projects/<project-slug>
23
- *
24
- * Override: set PILENS_DATA_DIR=/some/path — each project gets its own
25
- * subdirectory named after a sanitized form of its absolute path, e.g.
26
- * PILENS_DATA_DIR=~/.pi-lens/projects
27
- * → ~/.pi-lens/projects/home-user-myapp-<8-hex-hash>/
28
- *
29
- * This keeps project folders clean and avoids creating .pi-lens folders
30
- * inside user projects.
31
- */
32
- export function getProjectDataDir(cwd) {
33
- const legacyProjectDir = path.join(cwd, ".pi-lens");
34
- const configuredBase = process.env.PILENS_DATA_DIR?.trim();
35
- if (!configuredBase && fs.existsSync(legacyProjectDir)) {
36
- return legacyProjectDir;
37
- }
38
- const base = configuredBase || path.join(getGlobalPiLensDir(), "projects");
39
- const resolvedBase = base.trim();
40
- const memoKey = `${resolvedBase}\0${path.resolve(cwd)}`;
41
- const cached = settledDataDirs.get(memoKey);
42
- if (cached !== undefined)
43
- return cached;
44
- const canonical = canonicalProjectRoot(cwd);
45
- const readable = projectDataDirReadableSlug(canonical.root);
46
- const hash = projectDataDirRootHash(canonical.root);
47
- const slug = `${readable || "default"}-${hash}`;
48
- const dir = path.join(resolvedBase, slug);
49
- const settled = settleProjectDataDir(resolvedBase, readable || "default", dir, memoKey, canonical.fallback);
50
- return settled;
51
- }
52
- /**
53
- * The human-readable half of the project data-dir slug: the absolute root
54
- * with separators folded to dashes and anything else stripped.
55
- *
56
- * #2874: this form ALONE is not an identity — `src/pi-lens` and
57
- * `src/pi/lens` fold to the same string. It is only ever combined with
58
- * {@link projectDataDirRootHash}. Never use it as a directory name alone.
59
- */
60
- function projectDataDirReadableSlug(canonicalRoot) {
61
- const normalized = normalizeFilePath(canonicalRoot);
62
- return normalized
63
- .replace(/^[a-z]:/i, "") // strip Windows drive letter
64
- .replace(/\/+/g, "-") // separators → dashes
65
- .replace(/[^A-Za-z0-9-]/g, "") // strip anything else
66
- .replace(/^-+/, "") // trim leading dashes
67
- .replace(/-+$/, ""); // trim trailing dashes
68
- }
69
- /**
70
- * The canonical root is the resolved absolute path for both slug halves.
71
- * `realpathSync` is probed only to expose a fallback boundary failure; using
72
- * its result would let one root spelling change identity when the boundary
73
- * recovers. The hash is the first 8 hex chars of SHA-256 over that root. A
74
- * collision needs the same readable slug and the same 32-bit prefix, so the
75
- * practical collision population is readable-slug twin pairs. Pinned on
76
- * purpose because changing it renames every directory.
77
- */
78
- function canonicalProjectRoot(cwd) {
79
- const resolved = path.resolve(cwd);
80
- try {
81
- // Probe the root, but keep the resolved spelling as the identity in both
82
- // success and fallback cases. Resolving only on success would let a
83
- // transient boundary failure choose a second data directory.
84
- fs.realpathSync(resolved);
85
- }
86
- catch {
87
- // Best-effort: the root may not exist yet.
88
- return { root: resolved, fallback: true };
89
- }
90
- return { root: resolved, fallback: false };
91
- }
92
- function projectDataDirRootHash(canonicalRoot) {
93
- return createHash("sha256").update(canonicalRoot).digest("hex").slice(0, 8);
94
- }
95
- const pendingDataDirMigrations = [];
96
- const settledDataDirs = new Map();
97
- export function resetProjectDataDirSessionState() {
98
- pendingDataDirMigrations.splice(0);
99
- }
100
- /**
101
- * One-time upgrade from a pre-#2874 slug directory to its hashed name.
102
- * When the old directory exists and the new one does not, the state moves
103
- * with one atomic `renameSync` (same parent, so same filesystem). When both
104
- * exist the new one wins and nothing moves. Either case queues one
105
- * {@link ProjectDataDirMigration} for the session-start drain, which emits
106
- * the `data_dir_migrated` record. Best-effort throughout: on any failure the
107
- * caller gets the pre-existing directory and behavior is unchanged.
108
- *
109
- * No ledger import here on purpose: `probe-home-state.ts` documents that a
110
- * direct edge between this module and `degradation-ledger.ts` in either
111
- * direction adds `no-client-cycles` violations, so the record is emitted by
112
- * the drain site in `runtime-session.ts` instead.
113
- */
114
- function settleProjectDataDir(base, oldSlug, dir, memoKey, identityFallback) {
115
- const oldDir = path.join(base, oldSlug);
116
- const newExists = fs.existsSync(dir);
117
- const oldExists = fs.existsSync(oldDir);
118
- if (!oldExists) {
119
- if (identityFallback && pendingDataDirMigrations.length < 32) {
120
- pendingDataDirMigrations.push({
121
- to: dir,
122
- outcome: "identity-fallback",
123
- });
124
- }
125
- // Steady state: nothing to migrate from.
126
- settledDataDirs.set(memoKey, dir);
127
- return dir;
128
- }
129
- if (!newExists) {
130
- try {
131
- fs.renameSync(oldDir, dir);
132
- }
133
- catch (error) {
134
- if (error.code === "ENOENT") {
135
- if (fs.existsSync(dir)) {
136
- settledDataDirs.set(memoKey, dir);
137
- return dir;
138
- }
139
- if (fs.existsSync(oldDir))
140
- return oldDir;
141
- return dir;
142
- }
143
- // Best-effort: retain the old directory and publish one bounded
144
- // failure notice for this process's memo key.
145
- if (pendingDataDirMigrations.length < 32) {
146
- pendingDataDirMigrations.push({
147
- to: dir,
148
- outcome: "rename-failed",
149
- });
150
- }
151
- settledDataDirs.set(memoKey, oldDir);
152
- return oldDir;
153
- }
154
- }
155
- // Either the rename just moved the state, or both directories already
156
- // existed and the new one wins. Queue one migration for the drain.
157
- settledDataDirs.set(memoKey, dir);
158
- if (pendingDataDirMigrations.length < 32) {
159
- pendingDataDirMigrations.push({
160
- to: dir,
161
- outcome: newExists ? "coexisting" : "renamed",
162
- });
163
- }
164
- return dir;
165
- }
166
- /**
167
- * Drain the queued {@link ProjectDataDirMigration}s, clearing the queue.
168
- * Called once per session start by `handleSessionStart`; each queued outcome is
169
- * therefore recorded at most once per session. Test-only callers must not rely
170
- * on queue depth across drains.
171
- */
172
- export function drainProjectDataDirMigrations() {
173
- return pendingDataDirMigrations.splice(0);
174
- }
175
- /**
176
- * Test-only reset for the settled-directory memo. The memo is a pure
177
- * performance cache (one `existsSync` pair saved per latched directory), so
178
- * clearing it changes no observable behavior — it lets a test stage an
179
- * old-slug directory AFTER learning the new name, then resolve again.
180
- */
181
- export function _resetProjectDataDirMemoForTests() {
182
- settledDataDirs.clear();
183
- }
184
- /**
185
- * The project-data path to SHOW an agent or a human, for a file that
186
- * {@link getProjectDataDir} owns.
187
- *
188
- * #2521: the turn-end actionable-warnings advisory told the agent to read a
189
- * hardcoded `.pi-lens/cache/actionable-warnings.json`, but that spelling is
190
- * only correct in the LEGACY arm of `getProjectDataDir` — a project with no
191
- * `.pi-lens/` directory (the common case) stores the report under
192
- * `~/.pi-lens/projects/<slug>/cache/`, and a `PILENS_DATA_DIR` project stores
193
- * it somewhere else again. Agents followed the advisory literally and got
194
- * `cat: .pi-lens/cache/actionable-warnings.json: No such file or directory`.
195
- *
196
- * Any instructional string that NAMES a project-data location must be built
197
- * here, so the displayed path and the written path can never disagree. Guarded
198
- * by `tests/clients/data-dir-display-path-sweep.test.ts`.
199
- *
200
- * Two output shapes, matching `toRunnerDisplayPath`'s convention
201
- * (`clients/dispatch/runner-context.ts`) so one advisory never mixes styles:
202
- * - under `cwd` → a `/`-separated path relative to it
203
- * (`.pi-lens/cache/actionable-warnings.json`), which is what the legacy
204
- * arm produces and what an agent can paste straight into a shell.
205
- * - anywhere else → absolute, `/`-separated, and `~`-folded via
206
- * {@link homeRelativePath} so the default `~/.pi-lens/projects/...` store
207
- * does not leak the account name into agent context (#2440 F5).
208
- *
209
- * Pure string work on top of `getProjectDataDir`'s own resolution: it never
210
- * stats the target, so it is safe to call for a file that has not been written
211
- * yet and cannot throw on a surface whose whole job is to render a hint.
212
- *
213
- * The relative-or-absolute decision reuses `toProjectRelativePath`
214
- * (`clients/path-utils.ts`) — the same shape-aware, non-stat'ing primitive
215
- * `toRunnerDisplayPath` (`clients/dispatch/runner-context.ts`) composes for
216
- * the analogous "relative path if under this root, else something else"
217
- * decision — rather than a second hand-rolled `path.relative` fold. It is NOT
218
- * `toRunnerDisplayPath` itself: that helper routes its result through
219
- * `normalizeMapKey`, which on win32 calls `realpathSync.native()` (or, for a
220
- * not-yet-existing path, lowercases the unresolved tail) — exactly the
221
- * stat-and-mutate-casing behavior this function's contract above rules out.
222
- */
223
- export function displayProjectDataPath(cwd, ...segments) {
224
- const absolute = path.resolve(getProjectDataDir(cwd), ...segments);
225
- const absolutePosix = absolute.replace(/\\/g, "/");
226
- const relative = toProjectRelativePath(absolute, cwd);
227
- if (relative !== absolutePosix) {
228
- return relative;
229
- }
230
- // `toProjectRelativePath` fell back to the (posix-ified) absolute path —
231
- // `absolute` is not under `cwd`. Fold `~` so the default
232
- // `~/.pi-lens/projects/...` store does not leak the account name into
233
- // agent context (#2440 F5). Posix-ify BEFORE the fold: `homeRelativePath`
234
- // deliberately returns a path that is not under `$HOME` unchanged,
235
- // separators included, so a `PILENS_DATA_DIR=D:\lens-data` store would
236
- // otherwise render with backslashes while the legacy arm above renders
237
- // with forward ones — `absolutePosix` is already folded, so this is a
238
- // no-op fold, not a second one.
239
- return homeRelativePath(absolutePosix);
240
- }
241
- /**
242
- * Machine-global pi-lens directory: `~/.pi-lens/` by default.
243
- *
244
- * Used for tool binaries (`~/.pi-lens/tools/`, `~/.pi-lens/bin/`), the
245
- * cross-process instance registry (`instances.json`, #449/#525) and the
246
- * orphan-backstop lease beside it, the auto-install probe cache, the
247
- * canonical global config (`config.json`), LSP server storage (intelephense's
248
- * index, PSES's per-PID session dir) and JVM runtimes — state that is
249
- * intentionally NOT project-scoped, because it spans every project pi-lens
250
- * has touched.
251
- *
252
- * Override: set `PI_LENS_HOME=/some/path` to relocate this ENTIRE root (every
253
- * caller routes through this one function, so one env var covers all of
254
- * them — see #525). Tests MUST set this to a per-worker temp dir in
255
- * `tests/support/vitest-setup.ts` rather than mocking each caller separately;
256
- * otherwise a test that exercises `registerInstance`/`sweepOrphans` or any
257
- * logger writes into the developer's REAL `~/.pi-lens` (dogfooded live: a
258
- * test-fixture instance survived in the real `instances.json` for 17h).
259
- *
260
- * DELIBERATELY cwd-INDEPENDENT (#2506 round 3). Its sibling
261
- * `getGlobalPiLensLogDir()` (`probe-home-state.ts`) carries the probe-home
262
- * redirect; this one must not, because the things resolved here are shared
263
- * machine state a session needs to KEEP: a pi session running from an agent
264
- * worktree or a throwaway temp project must still find the tools it already
265
- * installed and must still register in the one `instances.json` every other
266
- * pi-lens process on the box reads. Redirecting THIS function (as round 2 of
267
- * #2506 did) would silently give every worktree its own empty tool tree and
268
- * its own private registry, so the reaper could never see across them — a
269
- * worse defect than the telemetry pollution the redirect exists to stop.
270
- *
271
- * Distinct from `getProjectDataDir(cwd)`, which respects `PILENS_DATA_DIR`
272
- * (project-scoped) and produces per-project subdirectories. Callers writing
273
- * project caches, snapshots, or worklogs should use `getProjectDataDir(cwd)`
274
- * instead — `PI_LENS_HOME` is the MACHINE-scoped sibling of that override.
275
- * `getProjectDataDir` composes through THIS function, not the log one: a
276
- * probe's project caches are already isolated by its own path slug, and a
277
- * worktree session keeping its warm caches is the same "do not break the
278
- * session" argument as the tools above.
279
- */
280
- export function getGlobalPiLensDir() {
281
- const override = process.env.PI_LENS_HOME?.trim();
282
- if (override)
283
- return path.resolve(override);
284
- return path.join(os.homedir(), ".pi-lens");
285
- }
286
- /**
287
- * Directories to exclude from all scans (build outputs, dependencies, caches).
288
- * Used consistently across all scanners to avoid noise from generated files.
289
- */
290
- export const EXCLUDED_DIRS = [
291
- "node_modules",
292
- ".git",
293
- "dist",
294
- "build",
295
- ".turbo",
296
- ".cache",
297
- "target",
298
- "out",
299
- ".parcel-cache",
300
- ".svelte-kit",
301
- ".nuxt",
302
- ".yarn",
303
- ".pnpm-store",
304
- ".gradle",
305
- ".next",
306
- ".pi-lens",
307
- ".pi", // pi agent directory
308
- // The SAME agent, rebranded: pi derives its config-dir name as
309
- // `pkg.piConfig?.configDir || ".pi"` (pi-coding-agent 0.85.1,
310
- // `dist/bundle/chunks/chunk-JVUZSMYM.js`), so a redistribution spells its
311
- // `<configDir>/agent/sessions` history `.omp/agent/sessions` instead.
312
- // #3112: a project-local one was walked entry-by-entry and spent the whole
313
- // startup-scan entry budget, so a five-file project reported
314
- // `too-many-entries` and never warmed its caches.
315
- ".omp",
316
- ".ruff_cache", // Python linter cache
317
- ".worktrees",
318
- ".claude",
319
- ".codex",
320
- ".rescue",
321
- ".agents",
322
- ".gstack",
323
- ".superpowers",
324
- ".guardrails",
325
- ".playwright-cli",
326
- ".playwright-mcp",
327
- ".vscode",
328
- "venv",
329
- ".venv",
330
- "coverage",
331
- "__pycache__",
332
- ".tox",
333
- ".pytest_cache",
334
- "*.dSYM",
335
- // Vendored upstream source conventions — universally too large to scan
336
- "vendor", // Go modules, PHP Composer, Ruby Bundler
337
- "third_party", // Chromium/Google convention (llama.cpp, sherpa-onnx, gRPC, TF)
338
- "third-party",
339
- "vendors",
340
- ];
341
- function resolveGitIgnoreRoot(startDir) {
342
- const fallback = path.resolve(startDir);
343
- let current = fallback;
344
- while (true) {
345
- if (fs.existsSync(path.join(current, ".git")))
346
- return current;
347
- const parent = path.dirname(current);
348
- if (parent === current)
349
- return fallback;
350
- current = parent;
351
- }
352
- }
353
- function collapseSlashes(value) {
354
- let out = "";
355
- let previousWasSlash = false;
356
- for (const ch of value) {
357
- if (ch === "/") {
358
- if (!previousWasSlash)
359
- out += ch;
360
- previousWasSlash = true;
361
- continue;
362
- }
363
- out += ch === "\\" ? "/" : ch;
364
- previousWasSlash = false;
365
- }
366
- return out;
367
- }
368
- function stripLeadingDotSlash(value) {
369
- return value.startsWith("./") ? value.slice(2) : value;
370
- }
371
- function stripTrailingSlashes(value) {
372
- let end = value.length;
373
- while (end > 0 && value[end - 1] === "/")
374
- end -= 1;
375
- return value.slice(0, end);
376
- }
377
- function stripLeadingSlashes(value) {
378
- let start = 0;
379
- while (start < value.length && value[start] === "/")
380
- start += 1;
381
- return value.slice(start);
382
- }
383
- function normalizeIgnorePath(value) {
384
- return collapseSlashes(stripLeadingDotSlash(value));
385
- }
386
- function stripTrailingSpaces(value) {
387
- // Good-enough gitignore whitespace handling: unescaped trailing spaces are ignored.
388
- let end = value.length;
389
- while (end > 0 && value[end - 1] === " " && value[end - 2] !== "\\")
390
- end -= 1;
391
- return value.slice(0, end).replace(/\\ /g, " ");
392
- }
393
- function parseGitignoreContent(content, layer) {
394
- const patterns = [];
395
- for (const rawLine of content.split(/\r?\n/)) {
396
- let line = stripTrailingSpaces(rawLine.trimStart());
397
- if (!line || line.startsWith("#"))
398
- continue;
399
- let negated = false;
400
- if (line.startsWith("!")) {
401
- negated = true;
402
- line = line.slice(1);
403
- }
404
- line = normalizeIgnorePath(line);
405
- if (!line)
406
- continue;
407
- const directoryOnly = line.endsWith("/");
408
- if (directoryOnly)
409
- line = stripTrailingSlashes(line);
410
- const rooted = line.startsWith("/");
411
- if (rooted)
412
- line = stripLeadingSlashes(line);
413
- if (!line)
414
- continue;
415
- patterns.push({
416
- pattern: line,
417
- negated,
418
- directoryOnly,
419
- rooted,
420
- hasSlash: line.includes("/"),
421
- layer,
422
- });
423
- }
424
- return patterns;
425
- }
426
- function expandGitignorePattern(pattern) {
427
- const body = pattern.pattern;
428
- if (pattern.directoryOnly) {
429
- if (pattern.rooted || pattern.hasSlash)
430
- return [body, `${body}/**`];
431
- return [body, `${body}/**`, `**/${body}`, `**/${body}/**`];
432
- }
433
- if (pattern.rooted || pattern.hasSlash)
434
- return [body];
435
- return [body, `**/${body}`];
436
- }
437
- function matchesGitignorePattern(pattern, relativePath, isDirectory, matchExpanded) {
438
- const candidate = stripLeadingSlashes(normalizeIgnorePath(relativePath));
439
- if (!candidate)
440
- return false;
441
- const candidates = isDirectory ? [candidate, `${candidate}/`] : [candidate];
442
- return expandGitignorePattern(pattern).some((expanded) => {
443
- if (isDirectory && expanded.endsWith("/**")) {
444
- const prefix = expanded.slice(0, -3);
445
- if (candidate === prefix || candidate.startsWith(`${prefix}/`))
446
- return true;
447
- }
448
- return candidates.some((value) => matchExpanded(value, expanded));
449
- });
450
- }
451
- function readGitignorePatterns(rootDir, layer = "gitignore") {
452
- const gitignorePath = path.join(rootDir, ".gitignore");
453
- try {
454
- return parseGitignoreContent(fs.readFileSync(gitignorePath, "utf-8"), layer);
455
- }
456
- catch {
457
- return [];
458
- }
459
- }
460
- function ancestorDirsBetween(rootDir, targetDir) {
461
- const relative = path.relative(rootDir, targetDir);
462
- if (relative.startsWith("..") || path.isAbsolute(relative))
463
- return [];
464
- const dirs = [rootDir];
465
- if (!relative)
466
- return dirs;
467
- let current = rootDir;
468
- for (const segment of relative.split(path.sep).filter(Boolean)) {
469
- current = path.join(current, segment);
470
- dirs.push(current);
471
- }
472
- return dirs;
473
- }
474
- function buildProjectIgnoreMatcher(resolvedRoot, patterns) {
475
- const consumedIgnoreSources = new Map();
476
- // `signature` lets a caller that already statted the file reuse that one
477
- // stat (#2016's class on this seam: never re-derive a value you just
478
- // computed). Callers with no signature in hand still pay their own stat.
479
- const rememberIgnoreSource = (filePath, signature = fileFreshnessSignature(filePath)) => {
480
- consumedIgnoreSources.set(filePath, { path: filePath, ...signature });
481
- };
482
- rememberIgnoreSource(path.join(resolvedRoot, ".gitignore"));
483
- const nestedCache = new Map();
484
- // #783: layer a NESTED `.pi-lens.json`'s `ignore` field the same way a
485
- // nested `.gitignore` is already layered — each ancestor directory between
486
- // `resolvedRoot` and the target is checked for its OWN config file (no
487
- // upward walk; `findPiLensConfigInDir`/`loadPiLensConfigInDir` look only
488
- // directly in `dir`), and its `ignore` patterns are anchored to `dir` (same
489
- // anchoring semantics as a `.gitignore` living in that directory) and
490
- // tagged `"pilens"` so #703's tracked-file-rescue rule still skips them.
491
- // `loadPiLensConfigInDir` reuses `project-lens-config.ts`'s own
492
- // path+mtime cache, so this never re-reads/re-parses JSON that some other
493
- // caller (or the root-config lookup above) already loaded.
494
- const patternsForDir = (dir) => {
495
- if (dir === resolvedRoot)
496
- return patterns;
497
- const cached = nestedCache.get(dir);
498
- const now = Date.now();
499
- // #2071: inside the cadence window this directory's rules are frozen, so
500
- // no stat runs and every verdict already memoized under `dir` stays
501
- // derivable from exactly these patterns. Before this gate the freshness
502
- // check ran per call while `patternMemo` did not, which is what let a
503
- // fresh path and a memoized path in the same directory return opposite
504
- // verdicts for the same rule. Externally edited nested sources are
505
- // therefore picked up within PROJECT_IGNORE_FRESHNESS_CADENCE_MS, the
506
- // same bound #2159 already accepted for the root sources.
507
- // pi-authored `.gitignore` writes keep their instant path through
508
- // `invalidateProjectIgnoreMatcherForPath`.
509
- if (cached !== undefined &&
510
- now - cached.checkedAtMs < PROJECT_IGNORE_FRESHNESS_CADENCE_MS) {
511
- return cached.patterns;
512
- }
513
- const gitignoreSig = gitignoreSignature(dir);
514
- // One stat, two consumers. `rememberIgnoreSource` used to stat the same
515
- // file a second time on the line below this one.
516
- rememberIgnoreSource(path.join(dir, ".gitignore"), gitignoreSig);
517
- // #1105: gate on size too. `findPiLensConfigInDir` returns `size` alongside
518
- // `mtimeMs` (both from one stat), and `gitignoreSignature` reads both for
519
- // the nested `.gitignore`, so an mtime-preserving, length-changing edit to
520
- // EITHER nested source can no longer replay stale patterns for this subtree.
521
- const pilensInfo = findPiLensConfigInDir(dir);
522
- const pilensMtime = pilensInfo?.mtimeMs ?? -1;
523
- const pilensSize = pilensInfo?.size ?? -1;
524
- if (cached?.gitignoreMtimeMs === gitignoreSig.mtimeMs &&
525
- cached?.gitignoreSize === gitignoreSig.size &&
526
- cached?.pilensMtimeMs === pilensMtime &&
527
- cached?.pilensSize === pilensSize) {
528
- // Unchanged: re-arm the shared clock so the next window is measured
529
- // from this check, not from the build that first populated the entry.
530
- cached.checkedAtMs = now;
531
- return cached.patterns;
532
- }
533
- const nestedConfig = loadPiLensConfigInDir(dir);
534
- const nextPatterns = [
535
- ...readGitignorePatterns(dir),
536
- ...parseGitignoreContent(nestedConfig.ignore.join("\n"), "pilens"),
537
- ];
538
- nestedCache.set(dir, {
539
- checkedAtMs: now,
540
- gitignoreMtimeMs: gitignoreSig.mtimeMs,
541
- gitignoreSize: gitignoreSig.size,
542
- pilensMtimeMs: pilensMtime,
543
- pilensSize: pilensSize,
544
- patterns: nextPatterns,
545
- });
546
- // #2071: drift is the SINGLE trigger. The rules under `dir` just changed,
547
- // so every verdict computed under the superseded rules dies in the same
548
- // step that supersedes them. `cached === undefined` is a first build, not
549
- // a change, and has no verdicts to drop.
550
- if (cached !== undefined)
551
- dropVerdictsUnder(dir);
552
- return nextPatterns;
553
- };
554
- // Per-matcher path → pattern-verdict memo. The matcher itself is cached by
555
- // `getProjectIgnoreMatcher` keyed on `.gitignore` size+mtime (#1105), so this
556
- // Map's lifetime is bounded to a single set of ignore rules — when any
557
- // `.gitignore` changes, the matcher is rebuilt and the memo is dropped
558
- // with it. Without this memo, every background scan (comment scan, knip,
559
- // jscpd, call-graph, source-filter, pipeline) recomputes O(ancestorDirs ×
560
- // patterns) per file, multiplying into 2-3s of pure CPU on a 2k-file
561
- // project. With it, the second visitor of the same path is O(1).
562
- //
563
- // #703: this memoizes only the PATTERN verdict (which is deterministic —
564
- // it never changes for a given matcher instance), NOT the tracked-aware
565
- // final verdict. The tracked-files set can transition from "not yet
566
- // primed" to "primed" mid-process (a walker calls `ensureTrackedIndex()`
567
- // partway through the matcher's lifetime), so baking the tracked check
568
- // into this memo would let an early, pre-priming call poison every later
569
- // lookup of the same path for this matcher's entire cache lifetime. The
570
- // tracked-set lookup itself is a cheap Set#has over syntactically-folded
571
- // keys (see `isTrackedAndRescued` — no `realpathSync` anywhere in this
572
- // function), and — critically — it's only ever paid for paths a pattern
573
- // already flagged as ignored, so it doesn't reintroduce the per-file cost
574
- // this memo exists to avoid for the common (not-ignored) case.
575
- const patternMemo = new Map();
576
- /**
577
- * Drop every memoized verdict at or below `subtree`, leaving `nestedCache`
578
- * alone. `patternsForDir` calls this the moment it rebuilds a directory's
579
- * patterns, which is why it must NOT evict the entry that rebuild just
580
- * wrote. `invalidateSubtree` layers the eviction on top for the write-hook
581
- * path, where the caller knows the source changed but has not re-read it.
582
- */
583
- function dropVerdictsUnder(subtree) {
584
- const resolvedSubtree = path.resolve(subtree);
585
- for (const key of patternMemo.keys()) {
586
- const memoPath = key.slice(2);
587
- const relative = path.relative(resolvedSubtree, memoPath);
588
- if (!relative ||
589
- (!relative.startsWith("..") && !path.isAbsolute(relative))) {
590
- patternMemo.delete(key);
591
- }
592
- }
593
- }
594
- const invalidateSubtree = (subtree) => {
595
- dropVerdictsUnder(subtree);
596
- nestedCache.delete(path.resolve(subtree));
597
- };
598
- // Compile expanded gitignore globs once per matcher instance. Relative-path
599
- // resolution remains outside this cache, so nested ignore scopes cannot leak
600
- // verdicts between sibling trees. The instance lifetime bounds this map.
601
- const gitignoreGlobOptions = {
602
- dot: true,
603
- nocase: process.platform === "win32",
604
- };
605
- const compiledGlobs = new Map();
606
- const matchExpanded = (value, expanded) => {
607
- let compiled = compiledGlobs.get(expanded);
608
- if (compiled === undefined) {
609
- compiled = new Minimatch(expanded, gitignoreGlobOptions);
610
- compiledGlobs.set(expanded, compiled);
611
- }
612
- return compiled.match(value);
613
- };
614
- // #703 perf follow-up: `normalizeEphemeralMapKey` (cheap slash-fold +
615
- // Windows-lowercase, zero fs I/O), NOT `normalizeMapKey` (realpath-backed).
616
- // This runs on every `isIgnored` call that reaches this branch — walks
617
- // over this repo alone visit thousands of pattern-ignored compiled
618
- // `*.js`/`*.d.ts` files, and `dispatch/integration.ts`'s per-edit cascade
619
- // check hits it too — so a `realpathSync` here would violate the
620
- // event-loop/slow-FS discipline `isIgnored` is required to keep (#462: 75x
621
- // slower on 9p/drvfs). Both `resolved` (this matcher's own `path.resolve`,
622
- // never realpath'd) and the tracked-set's keys (`git-tracked-ignore.ts`,
623
- // realpath'd ONCE per fetch on the shared root, not per file) are
624
- // self-consistent within one process/session, which is exactly
625
- // `normalizeEphemeralMapKey`'s contract — see that function's doc and
626
- // `git-tracked-ignore.ts`'s module doc for the full reasoning. Accepted
627
- // edge case: a symlinked or 8.3-short-name project root can make the cheap
628
- // fold miss even after the fetch side's one realpath — the file then stays
629
- // pattern-ignored, i.e. degrades to today's (pre-#703) behavior, which is
630
- // consistent with this whole feature's fail-open contract.
631
- function isTrackedAndRescued(resolved) {
632
- const snapshot = getTrackedFilesSnapshot(resolvedRoot);
633
- if (!snapshot)
634
- return false; // never primed / git unavailable: fail-open to pattern-only
635
- return snapshot.has(normalizeEphemeralMapKey(resolved));
636
- }
637
- return {
638
- rootDir: resolvedRoot,
639
- patterns,
640
- getConsumedIgnoreSources: () => [...consumedIgnoreSources.values()],
641
- refreshConsumedIgnoreSource(filePath) {
642
- // The freshness sweep refreshes this baseline after invalidation.
643
- if (consumedIgnoreSources.has(filePath))
644
- rememberIgnoreSource(filePath);
645
- },
646
- invalidateSubtree,
647
- ensureTrackedIndex() {
648
- return collectTrackedFiles(resolvedRoot).then(() => undefined);
649
- },
650
- isIgnored(filePath, isDirectory = false) {
651
- const resolved = path.resolve(filePath);
652
- // Two namespaces (D: for directory queries, F: for file queries)
653
- // because gitignore semantics differ for trailing-slash patterns.
654
- const memoKey = (isDirectory ? "D:" : "F:") + resolved;
655
- let verdict = patternMemo.get(memoKey);
656
- if (verdict === undefined) {
657
- const rootRelative = path.relative(resolvedRoot, resolved);
658
- if (!rootRelative ||
659
- rootRelative.startsWith("..") ||
660
- path.isAbsolute(rootRelative)) {
661
- verdict = { ignored: false, layer: undefined };
662
- }
663
- else {
664
- let ignored = false;
665
- let layer;
666
- const patternDirs = ancestorDirsBetween(resolvedRoot, path.dirname(resolved));
667
- for (const dir of patternDirs) {
668
- const dirPatterns = patternsForDir(dir);
669
- if (dirPatterns.length === 0)
670
- continue;
671
- const relative = path.relative(dir, resolved);
672
- const normalized = normalizeIgnorePath(relative);
673
- for (const pattern of dirPatterns) {
674
- if (!matchesGitignorePattern(pattern, normalized, isDirectory, matchExpanded))
675
- continue;
676
- ignored = !pattern.negated;
677
- layer = pattern.layer;
678
- }
679
- }
680
- verdict = { ignored, layer };
681
- }
682
- patternMemo.set(memoKey, verdict);
683
- }
684
- if (!verdict.ignored)
685
- return false;
686
- // #703 layer semantics: a winning positive match from `global` or
687
- // `gitignore` emulates git, so it inherits git's "a tracked file is
688
- // never ignored" rule. A winning match from `pilens` is pi-lens-native
689
- // intent and stays excluded regardless of tracked status. Directory
690
- // queries are never tracked-rescued — the tracked set is a file-id
691
- // set, not a directory set.
692
- if (!isDirectory &&
693
- verdict.layer !== "pilens" &&
694
- isTrackedAndRescued(resolved)) {
695
- return false;
696
- }
697
- return true;
698
- },
699
- };
700
- }
701
- export function createProjectIgnoreMatcher(rootDir, extraPatterns = [], globalPatterns = []) {
702
- const resolvedRoot = resolveGitIgnoreRoot(rootDir);
703
- // Precedence is gitignore order: LATER patterns override earlier ones. So
704
- // global (lowest) → project .gitignore → project .pi-lens.json (highest),
705
- // which lets a project `!negation` re-include a globally-ignored path (#252).
706
- // Each layer is tagged (#703) so `isIgnored` can tell a git-emulating match
707
- // (`global`/`gitignore` — subject to "a tracked file is never ignored")
708
- // apart from pi-lens-native intent (`pilens` — excludes regardless).
709
- const patterns = [
710
- ...parseGitignoreContent(globalPatterns.join("\n"), "global"),
711
- ...readGitignorePatterns(resolvedRoot, "gitignore"),
712
- ...parseGitignoreContent(extraPatterns.join("\n"), "pilens"),
713
- ];
714
- return buildProjectIgnoreMatcher(resolvedRoot, patterns);
715
- }
716
- const projectIgnoreMatcherCache = new Map();
717
- /**
718
- * Nested ignore sources are checked at most once per root per cadence window.
719
- * Sourced from the shared leaf (`freshness-cadence.ts`) rather than owning the
720
- * value: `project-lens-config.ts`'s no-config discovery cache (#2483 round 2)
721
- * needs the same cadence and cannot import it FROM here, because this module
722
- * already imports `project-lens-config.ts` (the `clients/` acyclic-imports
723
- * rule would reject the reverse edge). Re-exported under this name so the
724
- * existing test imports (`tests/clients/project-ignore-freshness.test.ts` and
725
- * siblings) are unaffected.
726
- */
727
- export const PROJECT_IGNORE_FRESHNESS_CADENCE_MS = FRESHNESS_CADENCE_MS;
728
- function fileFreshnessSignature(filePath) {
729
- try {
730
- const stat = fs.statSync(filePath);
731
- return { mtimeMs: stat.mtimeMs, size: stat.size };
732
- }
733
- catch {
734
- return { mtimeMs: -1, size: -1 };
735
- }
736
- }
737
- function globalConfigSignature() {
738
- return fileFreshnessSignature(getPiLensGlobalConfigPath());
739
- }
740
- function gitignoreSignature(rootDir) {
741
- return fileFreshnessSignature(path.join(rootDir, ".gitignore"));
742
- }
743
- function hasIgnoreSourceDrift(sources) {
744
- return sources.some((source) => {
745
- const current = fileFreshnessSignature(source.path);
746
- return current.mtimeMs !== source.mtimeMs || current.size !== source.size;
747
- });
748
- }
749
- /**
750
- * The project config file found by the same upward walk as the loader. Cache
751
- * invalidation must track the actual file found, not only a file directly under
752
- * the git root: nested worktrees/submodules can legitimately inherit a
753
- * `.pi-lens.json` from a parent directory.
754
- */
755
- function lensConfigInfo(rootDir) {
756
- const info = findPiLensProjectConfig(rootDir);
757
- return info
758
- ? { info, path: info.path, mtimeMs: info.mtimeMs, size: info.size }
759
- : { info, path: undefined, mtimeMs: -1, size: -1 };
760
- }
761
- export function getProjectIgnoreMatcher(rootDir) {
762
- const resolvedRoot = resolveGitIgnoreRoot(rootDir);
763
- const gitignoreSig = gitignoreSignature(resolvedRoot);
764
- const lensConfig = lensConfigInfo(resolvedRoot);
765
- const globalSig = globalConfigSignature();
766
- const cached = projectIgnoreMatcherCache.get(resolvedRoot);
767
- // A path can be discovered during the previous matcher lookup. Publish only
768
- // previously unseen sources so a walk cannot replace a pre-edit baseline.
769
- //
770
- // This runs BEFORE the sweep below, and the order is load-bearing. A nested
771
- // source can only be published on a call AFTER the one that consumed it.
772
- // With the publish second, the sweep never saw a source during the window in
773
- // which it was discovered, yet still reset `lastIgnoreFreshnessCheckMs`, so
774
- // the first sweep that could see it ran a FULL cadence later. Pickup was up
775
- // to 2x cadence, not 1x: measured stale at 2 s and 3 s, fresh at 4 s. The
776
- // baseline is protected by the `known` set, not by the ordering, so moving
777
- // the publish earlier cannot let a walk overwrite a pre-edit baseline.
778
- if (cached) {
779
- const known = new Set(cached.ignoreSources.map((source) => source.path));
780
- for (const source of cached.matcher.getConsumedIgnoreSources()) {
781
- if (!known.has(source.path))
782
- cached.ignoreSources.push(source);
783
- }
784
- }
785
- if (cached &&
786
- Date.now() - cached.lastIgnoreFreshnessCheckMs >=
787
- PROJECT_IGNORE_FRESHNESS_CADENCE_MS) {
788
- cached.lastIgnoreFreshnessCheckMs = Date.now();
789
- if (hasIgnoreSourceDrift(cached.ignoreSources)) {
790
- for (const source of cached.ignoreSources) {
791
- if (hasIgnoreSourceDrift([source])) {
792
- const sourceIndex = cached.ignoreSources.findIndex((cachedSource) => cachedSource.path === source.path);
793
- invalidateProjectIgnoreMatcherForPath(source.path);
794
- cached.matcher.refreshConsumedIgnoreSource(source.path);
795
- const refreshedSource = cached.matcher
796
- .getConsumedIgnoreSources()
797
- .find((current) => current.path === source.path);
798
- if (sourceIndex !== -1 && refreshedSource !== undefined) {
799
- cached.ignoreSources.splice(sourceIndex, 1, refreshedSource);
800
- }
801
- }
802
- }
803
- }
804
- }
805
- if (cached?.gitignoreMtimeMs === gitignoreSig.mtimeMs &&
806
- cached?.gitignoreSize === gitignoreSig.size &&
807
- cached?.lensConfigPath === lensConfig.path &&
808
- cached?.lensConfigMtimeMs === lensConfig.mtimeMs &&
809
- cached?.lensConfigSize === lensConfig.size &&
810
- cached?.globalConfigMtimeMs === globalSig.mtimeMs &&
811
- cached?.globalConfigSize === globalSig.size) {
812
- return cached.matcher;
813
- }
814
- // Load both configs fresh on cache miss. On a cache HIT (the common case)
815
- // none of this runs — the only per-call cost is the size:mtimeMs stats above
816
- // (size is free from the same stat). The project loader is itself
817
- // size:mtimeMs-cached; the global loader re-parses, but only here on miss
818
- // (when some tracked signature changed).
819
- const projectConfig = loadPiLensProjectConfig(resolvedRoot, lensConfig.info);
820
- const matcher = createProjectIgnoreMatcher(resolvedRoot, projectConfig.ignore, getGlobalIgnorePatterns());
821
- projectIgnoreMatcherCache.set(resolvedRoot, {
822
- ignoreSources: [...matcher.getConsumedIgnoreSources()],
823
- lastIgnoreFreshnessCheckMs: Date.now(),
824
- gitignoreMtimeMs: gitignoreSig.mtimeMs,
825
- gitignoreSize: gitignoreSig.size,
826
- lensConfigPath: lensConfig.path,
827
- lensConfigMtimeMs: lensConfig.mtimeMs,
828
- lensConfigSize: lensConfig.size,
829
- globalConfigMtimeMs: globalSig.mtimeMs,
830
- globalConfigSize: globalSig.size,
831
- matcher,
832
- });
833
- return matcher;
834
- }
835
- /**
836
- * Invalidate the cached matcher state affected by a written `.gitignore`.
837
- *
838
- * Root changes discard the whole matcher because they change its base pattern
839
- * set. Nested changes evict only verdicts in that directory's subtree; the
840
- * matcher and compiled-glob memo remain reusable for unrelated trees.
841
- */
842
- export function invalidateProjectIgnoreMatcherForPath(filePath) {
843
- const resolvedPath = path.resolve(filePath);
844
- if (path.basename(resolvedPath).toLowerCase() !== ".gitignore")
845
- return;
846
- for (const [cachedRoot, cached] of projectIgnoreMatcherCache) {
847
- if (!isUnderDir(resolvedPath, cachedRoot))
848
- continue;
849
- if (normalizeFilePath(resolvedPath) ===
850
- normalizeFilePath(path.join(cachedRoot, ".gitignore"))) {
851
- projectIgnoreMatcherCache.delete(cachedRoot);
852
- continue;
853
- }
854
- cached.matcher.invalidateSubtree(path.dirname(resolvedPath));
855
- }
856
- }
857
- export function isPathIgnoredByProject(filePath, rootDir, isDirectory = false) {
858
- return getProjectIgnoreMatcher(rootDir).isIgnored(filePath, isDirectory);
859
- }
860
- /**
861
- * "Is this a project-source path pi-lens's bookkeeping should care about" —
862
- * the `isPathIgnoredByProject` + `isExternalOrVendorFile` pair, previously
863
- * hand-duplicated at each of its 2 call sites (`registerReadBridge` and
864
- * `registerMutationBridge` in `index.ts`, both #2423). Consolidated here
865
- * (#2450 review round 2, F4) when a THIRD call site — `tools/lsp-navigation.ts`
866
- * threading the same gate onto its directly-threaded `LspMutationContext`, so
867
- * the direct LSP-mutation path and the mutation-bridge fallback path apply
868
- * the identical gate instead of the fallback silently being narrower. A
869
- * caller still layers its own `no-read-guard`-style flag check on top; that
870
- * flag has no file path to check against, so it stays outside this helper.
871
- */
872
- export function isRecordableProjectPath(filePath, projectRoot) {
873
- if (isPathIgnoredByProject(filePath, projectRoot, false))
874
- return false;
875
- if (isExternalOrVendorFile(filePath, projectRoot))
876
- return false;
877
- return true;
878
- }
879
- const projectIgnoreGlobsCache = new Map();
880
- export function getProjectIgnoreGlobs(rootDir) {
881
- const resolvedRoot = path.resolve(rootDir);
882
- const signature = gitignoreSignature(resolvedRoot);
883
- const cached = projectIgnoreGlobsCache.get(resolvedRoot);
884
- if (cached &&
885
- cached.mtimeMs === signature.mtimeMs &&
886
- cached.size === signature.size) {
887
- return cached.globs;
888
- }
889
- const globs = readGitignorePatterns(resolvedRoot)
890
- .filter((pattern) => !pattern.negated)
891
- .flatMap((pattern) => expandGitignorePattern(pattern));
892
- projectIgnoreGlobsCache.set(resolvedRoot, { ...signature, globs });
893
- return globs;
894
- }
895
- /**
896
- * Read simple directory-name entries from a root .gitignore.
897
- *
898
- * Prefer createProjectIgnoreMatcher() for path-aware gitignore matching. This
899
- * helper is kept for callers/tests that only need simple directory names.
900
- */
901
- export function readGitignoreDirs(rootDir) {
902
- return readGitignorePatterns(rootDir)
903
- .filter((entry) => !entry.negated &&
904
- !entry.pattern.includes("*") &&
905
- !entry.pattern.includes("?") &&
906
- !entry.pattern.includes("[") &&
907
- !entry.pattern.includes("/"))
908
- .map((entry) => entry.pattern);
909
- }
910
- function globToRegExp(glob) {
911
- // Directory names use the same `*`-only dialect as read-guard exemptions.
912
- // Collapse adjacent stars before compiling to avoid nullable-group
913
- // backtracking on a non-matching name (#2622).
914
- const escaped = glob
915
- .replace(/\*+/g, "*")
916
- .replace(/[.+^${}()|[\]\\]/g, "\\$&")
917
- .replace(/\*/g, ".*")
918
- .replace(/\?/g, ".");
919
- return new RegExp(`^${escaped}$`, "i");
920
- }
921
- /**
922
- * Match directory name against exclusion patterns.
923
- * Supports exact names and lightweight glob patterns (for example `*.dSYM`).
924
- */
925
- export function isExcludedDirName(dirName, extraPatterns = []) {
926
- const candidate = dirName.trim();
927
- if (!candidate)
928
- return false;
929
- const patterns = [...EXCLUDED_DIRS, ...extraPatterns]
930
- .map((p) => p.trim())
931
- .filter((p) => p.length > 0);
932
- const candidateLower = candidate.toLowerCase();
933
- for (const pattern of patterns) {
934
- const patLower = pattern.toLowerCase();
935
- if (!patLower.includes("*") && !patLower.includes("?")) {
936
- if (candidateLower === patLower)
937
- return true;
938
- continue;
939
- }
940
- if (globToRegExp(pattern).test(candidate))
941
- return true;
942
- }
943
- return false;
944
- }
945
- /**
946
- * Convert excluded directory names into glob patterns used by scanners.
947
- */
948
- export function getExcludedDirGlobs() {
949
- return EXCLUDED_DIRS.map((dir) => `**/${dir}/**`);
950
- }
951
- /**
952
- * Shared Knip ignore patterns derived from central exclusions.
953
- */
954
- export function getKnipIgnorePatterns() {
955
- return [
956
- ...getExcludedDirGlobs(),
957
- "**/*.test.ts",
958
- "**/*.test.tsx",
959
- "**/*.test.js",
960
- "**/*.test.jsx",
961
- "**/*.spec.ts",
962
- "**/*.spec.tsx",
963
- "**/*.spec.js",
964
- "**/*.spec.jsx",
965
- "**/*.poc.test.ts",
966
- "**/*.poc.test.tsx",
967
- "**/__tests__/**",
968
- "**/tests/**",
969
- ];
970
- }
971
- /**
972
- * Spawn a command and detect whether it modified a file on disk.
973
- * Returns 1 if the file content changed after the command ran, 0 otherwise.
974
- * Useful for auto-fix tools (ESLint, Stylelint, RuboCop, etc.).
975
- */
976
- export async function detectFileChangedAfterCommand(filePath, command, args, cwd, ignoreStatuses = []) {
977
- let before = "";
978
- try {
979
- before = fs.readFileSync(filePath, "utf-8");
980
- }
981
- catch {
982
- return 0;
983
- }
984
- // #1995: a command cooling down after a spawn timeout must not be handed
985
- // a second budget - autofix is one of the lanes that paid twice for a
986
- // wedged .cmd shim. Return "no fix applied" (an honest not-checked).
987
- if (isInSpawnTimeoutCooldown(command))
988
- return 0;
989
- const result = await safeSpawnAsync(command, args, {
990
- timeout: 30000,
991
- cwd,
992
- });
993
- if (result.error)
994
- return 0;
995
- if (result.failure === "timeout") {
996
- noteSpawnTimeout({
997
- tool: path.basename(command).replace(/\.[^.]+$/, ""),
998
- command,
999
- phase: "autofix",
1000
- durationMs: 30000,
1001
- teardown: result.timeoutTeardown,
1002
- });
1003
- return 0;
1004
- }
1005
- if (result.status !== 0 && !ignoreStatuses.includes(result.status ?? -1)) {
1006
- return 0;
1007
- }
1008
- try {
1009
- const after = fs.readFileSync(filePath, "utf-8");
1010
- return before !== after ? 1 : 0;
1011
- }
1012
- catch {
1013
- return 0;
1014
- }
1015
- }
1016
- /**
1017
- * Check if file path is a test/fixture/mock file.
1018
- * Used by secrets scanner, rate command, and dispatch runners
1019
- * to skip these files (false positives on fake credentials, etc).
1020
- *
1021
- * Delegate naming/directory classification to file-role (#2928). Fixtures,
1022
- * mocks and test helpers remain this skip gate's separate policy.
1023
- */
1024
- export function isTestFile(filePath) {
1025
- if (detectFileRole(filePath) === "test")
1026
- return true;
1027
- const normalized = filePath.replace(/\\/g, "/");
1028
- return (normalized.includes("test-utils") ||
1029
- normalized.startsWith("test-") ||
1030
- normalized.includes(".fixture.") ||
1031
- normalized.includes(".mock."));
1032
- }