@herbertgao/pi-extensions 2026.8.4 → 2026.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/README.md +4 -4
  2. package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +10 -2
  3. package/node_modules/@herbertgao/pi-cc-extensions/README.md +10 -2
  4. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +24 -0
  5. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +91 -1
  6. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/compact-thinking.ts +7 -3
  7. package/node_modules/@herbertgao/pi-cc-extensions/extensions/index.ts +7 -6
  8. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +21 -12
  9. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +4 -5
  10. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/markdown-enhance.ts +5 -8
  11. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +22 -12
  12. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/result.ts +2 -4
  13. package/node_modules/@herbertgao/pi-cc-extensions/package.json +3 -3
  14. package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +8 -0
  15. package/node_modules/@herbertgao/pi-subagents/package.json +8 -4
  16. package/node_modules/@herbertgao/pi-subagents/src/agent-color.ts +72 -67
  17. package/node_modules/@herbertgao/pi-subagents/src/agent-file-toggle.ts +255 -0
  18. package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +191 -3
  19. package/node_modules/@herbertgao/pi-subagents/src/agent-runner.ts +15 -2
  20. package/node_modules/@herbertgao/pi-subagents/src/index.ts +289 -113
  21. package/node_modules/@herbertgao/pi-subagents/src/output-file.ts +24 -1
  22. package/node_modules/@herbertgao/pi-subagents/src/ui/agent-widget.ts +24 -2
  23. package/node_modules/@herbertgao/pi-subagents/src/ui/schedule-menu.ts +9 -8
  24. package/node_modules/@herbertgao/pi-subagents/src/ui/select-item.ts +48 -0
  25. package/node_modules/@juicesharp/rpiv-ask-user-question/docs/keyboard.md +7 -0
  26. package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +2 -2
  27. package/node_modules/@juicesharp/rpiv-ask-user-question/state/build-questionnaire.ts +7 -0
  28. package/node_modules/@juicesharp/rpiv-ask-user-question/state/key-router.ts +16 -5
  29. package/node_modules/@juicesharp/rpiv-ask-user-question/state/questionnaire-session.ts +4 -2
  30. package/node_modules/@narumitw/pi-btw/README.md +8 -7
  31. package/node_modules/@narumitw/pi-btw/package.json +2 -2
  32. package/node_modules/@narumitw/pi-btw/src/menu.ts +1 -0
  33. package/node_modules/pi-lens/CHANGELOG.md +2440 -954
  34. package/node_modules/pi-lens/README.md +13 -0
  35. package/node_modules/pi-lens/dist/clients/actionable-warnings.js +73 -18
  36. package/node_modules/pi-lens/dist/clients/agent-behavior-client.js +21 -4
  37. package/node_modules/pi-lens/dist/clients/ast-grep-client.js +68 -16
  38. package/node_modules/pi-lens/dist/clients/ast-grep-types.js +0 -1
  39. package/node_modules/pi-lens/dist/clients/ast-grep-yaml-synth.js +37 -10
  40. package/node_modules/pi-lens/dist/clients/atomic-write-staging.js +63 -0
  41. package/node_modules/pi-lens/dist/clients/atomic-write.js +114 -14
  42. package/node_modules/pi-lens/dist/clients/bash-file-access.js +193 -23
  43. package/node_modules/pi-lens/dist/clients/biome-client.js +29 -25
  44. package/node_modules/pi-lens/dist/clients/bootstrap.js +11 -2
  45. package/node_modules/pi-lens/dist/clients/bounded-cache.js +34 -0
  46. package/node_modules/pi-lens/dist/clients/bounded-pid-file-lock.js +192 -0
  47. package/node_modules/pi-lens/dist/clients/bus-publish.js +10 -3
  48. package/node_modules/pi-lens/dist/clients/cache/rule-cache.js +47 -5
  49. package/node_modules/pi-lens/dist/clients/cache-manager.js +97 -9
  50. package/node_modules/pi-lens/dist/clients/cache-observability.js +301 -14
  51. package/node_modules/pi-lens/dist/clients/call-graph.js +449 -117
  52. package/node_modules/pi-lens/dist/clients/child-unref.js +85 -0
  53. package/node_modules/pi-lens/dist/clients/codebase-model.js +52 -23
  54. package/node_modules/pi-lens/dist/clients/collateral-test-role.js +40 -0
  55. package/node_modules/pi-lens/dist/clients/complexity-client.js +2 -1
  56. package/node_modules/pi-lens/dist/clients/console-guard-install.js +14 -0
  57. package/node_modules/pi-lens/dist/clients/cooperative-budget.js +42 -0
  58. package/node_modules/pi-lens/dist/clients/dead-code-client.js +2 -1
  59. package/node_modules/pi-lens/dist/clients/debug-handles.js +206 -0
  60. package/node_modules/pi-lens/dist/clients/debug-heap.js +167 -0
  61. package/node_modules/pi-lens/dist/clients/degradation-ledger.js +153 -0
  62. package/node_modules/pi-lens/dist/clients/dependency-checker.js +347 -75
  63. package/node_modules/pi-lens/dist/clients/diagnostic-dispositions.js +61 -11
  64. package/node_modules/pi-lens/dist/clients/diagnostics-publish.js +10 -3
  65. package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +63 -20
  66. package/node_modules/pi-lens/dist/clients/dispatch/facts/function-facts.js +23 -7
  67. package/node_modules/pi-lens/dist/clients/dispatch/facts/import-facts.js +8 -18
  68. package/node_modules/pi-lens/dist/clients/dispatch/facts/tree-sitter-facts.js +8 -5
  69. package/node_modules/pi-lens/dist/clients/dispatch/indent-detect.js +35 -0
  70. package/node_modules/pi-lens/dist/clients/dispatch/inline-suppressions.js +17 -8
  71. package/node_modules/pi-lens/dist/clients/dispatch/integration.js +1085 -681
  72. package/node_modules/pi-lens/dist/clients/dispatch/lazy.js +14 -0
  73. package/node_modules/pi-lens/dist/clients/dispatch/plan.js +11 -1
  74. package/node_modules/pi-lens/dist/clients/dispatch/rule-id-normalize.js +50 -0
  75. package/node_modules/pi-lens/dist/clients/dispatch/rule-policy.js +135 -0
  76. package/node_modules/pi-lens/dist/clients/dispatch/runners/ast-grep-napi.js +23 -5
  77. package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +5 -9
  78. package/node_modules/pi-lens/dist/clients/dispatch/runners/detekt.js +3 -2
  79. package/node_modules/pi-lens/dist/clients/dispatch/runners/hadolint.js +2 -1
  80. package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-lint.js +154 -0
  81. package/node_modules/pi-lens/dist/clients/dispatch/runners/htmlhint.js +3 -2
  82. package/node_modules/pi-lens/dist/clients/dispatch/runners/index.js +5 -1
  83. package/node_modules/pi-lens/dist/clients/dispatch/runners/lsp.js +14 -6
  84. package/node_modules/pi-lens/dist/clients/dispatch/runners/markdownlint.js +4 -9
  85. package/node_modules/pi-lens/dist/clients/dispatch/runners/pyright.js +9 -5
  86. package/node_modules/pi-lens/dist/clients/dispatch/runners/ruff.js +4 -8
  87. package/node_modules/pi-lens/dist/clients/dispatch/runners/shellcheck.js +2 -3
  88. package/node_modules/pi-lens/dist/clients/dispatch/runners/shfmt.js +2 -3
  89. package/node_modules/pi-lens/dist/clients/dispatch/runners/spotbugs.js +2 -1
  90. package/node_modules/pi-lens/dist/clients/dispatch/runners/taplo.js +2 -1
  91. package/node_modules/pi-lens/dist/clients/dispatch/runners/terragrunt.js +163 -0
  92. package/node_modules/pi-lens/dist/clients/dispatch/runners/tflint.js +37 -5
  93. package/node_modules/pi-lens/dist/clients/dispatch/runners/tree-sitter.js +3 -1
  94. package/node_modules/pi-lens/dist/clients/dispatch/runners/trivy-config.js +13 -7
  95. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/lazy-installer.js +3 -0
  96. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +277 -26
  97. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/spawn-outcome.js +22 -0
  98. package/node_modules/pi-lens/dist/clients/dispatch/runners/yaml-rule-parser.js +5 -4
  99. package/node_modules/pi-lens/dist/clients/disposition-publish.js +10 -3
  100. package/node_modules/pi-lens/dist/clients/durable-store.js +97 -0
  101. package/node_modules/pi-lens/dist/clients/event-loop-monitor.js +94 -3
  102. package/node_modules/pi-lens/dist/clients/extension-log.js +139 -0
  103. package/node_modules/pi-lens/dist/clients/extension-mode.js +73 -0
  104. package/node_modules/pi-lens/dist/clients/file-kinds.js +57 -0
  105. package/node_modules/pi-lens/dist/clients/file-role.js +18 -3
  106. package/node_modules/pi-lens/dist/clients/file-utils.js +56 -34
  107. package/node_modules/pi-lens/dist/clients/format-events-publish.js +16 -3
  108. package/node_modules/pi-lens/dist/clients/format-service.js +24 -8
  109. package/node_modules/pi-lens/dist/clients/formatters-lazy.js +8 -0
  110. package/node_modules/pi-lens/dist/clients/formatters.js +358 -61
  111. package/node_modules/pi-lens/dist/clients/generated-artifacts.js +148 -15
  112. package/node_modules/pi-lens/dist/clients/git-guard.js +681 -11
  113. package/node_modules/pi-lens/dist/clients/git-tracked-ignore.js +4 -0
  114. package/node_modules/pi-lens/dist/clients/go-client.js +2 -1
  115. package/node_modules/pi-lens/dist/clients/govulncheck-client.js +8 -0
  116. package/node_modules/pi-lens/dist/clients/grammar-source.js +12 -4
  117. package/node_modules/pi-lens/dist/clients/gzip-stage-write.js +21 -3
  118. package/node_modules/pi-lens/dist/clients/host-ports.js +31 -0
  119. package/node_modules/pi-lens/dist/clients/installer/index.js +390 -99
  120. package/node_modules/pi-lens/dist/clients/instance-reaper.js +142 -172
  121. package/node_modules/pi-lens/dist/clients/jscpd-client.js +31 -54
  122. package/node_modules/pi-lens/dist/clients/knip-client.js +15 -36
  123. package/node_modules/pi-lens/dist/clients/language-policy.js +14 -2
  124. package/node_modules/pi-lens/dist/clients/language-profile.js +13 -7
  125. package/node_modules/pi-lens/dist/clients/latency-logger.js +23 -1
  126. package/node_modules/pi-lens/dist/clients/lens-config.js +12 -1
  127. package/node_modules/pi-lens/dist/clients/lens-engine.js +86 -17
  128. package/node_modules/pi-lens/dist/clients/lens-events.js +27 -4
  129. package/node_modules/pi-lens/dist/clients/lens-flag-registry.js +8 -0
  130. package/node_modules/pi-lens/dist/clients/lens-map.js +94 -19
  131. package/node_modules/pi-lens/dist/clients/live-bus-emitter.js +30 -0
  132. package/node_modules/pi-lens/dist/clients/log-cleanup.js +2 -1
  133. package/node_modules/pi-lens/dist/clients/lsp/cascade-tier.js +1 -1
  134. package/node_modules/pi-lens/dist/clients/lsp/client.js +493 -48
  135. package/node_modules/pi-lens/dist/clients/lsp/config.js +13 -2
  136. package/node_modules/pi-lens/dist/clients/lsp/diagnostic-binding.js +86 -0
  137. package/node_modules/pi-lens/dist/clients/lsp/edits.js +1012 -121
  138. package/node_modules/pi-lens/dist/clients/lsp/index.js +1807 -780
  139. package/node_modules/pi-lens/dist/clients/lsp/launch.js +32 -26
  140. package/node_modules/pi-lens/dist/clients/lsp/path-utils.js +1 -1
  141. package/node_modules/pi-lens/dist/clients/lsp/ruby-drive-dirs.js +83 -0
  142. package/node_modules/pi-lens/dist/clients/lsp/server.js +196 -32
  143. package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +28 -4
  144. package/node_modules/pi-lens/dist/clients/lsp-lazy.js +8 -0
  145. package/node_modules/pi-lens/dist/clients/lsp-mutation.js +248 -0
  146. package/node_modules/pi-lens/dist/clients/mcp/analyze.js +123 -32
  147. package/node_modules/pi-lens/dist/clients/mcp/ipc.js +157 -24
  148. package/node_modules/pi-lens/dist/clients/mcp/session.js +216 -8
  149. package/node_modules/pi-lens/dist/clients/memory-sampler.js +115 -0
  150. package/node_modules/pi-lens/dist/clients/metrics-client.js +2 -1
  151. package/node_modules/pi-lens/dist/clients/metrics-history.js +2 -1
  152. package/node_modules/pi-lens/dist/clients/module-report-lsp.js +5 -0
  153. package/node_modules/pi-lens/dist/clients/module-report.js +168 -3
  154. package/node_modules/pi-lens/dist/clients/ndjson-logger.js +319 -118
  155. package/node_modules/pi-lens/dist/clients/opengrep-client.js +1 -1
  156. package/node_modules/pi-lens/dist/clients/partial-edit-apply.js +120 -5
  157. package/node_modules/pi-lens/dist/clients/path-utils.js +110 -9
  158. package/node_modules/pi-lens/dist/clients/pipeline.js +47 -13
  159. package/node_modules/pi-lens/dist/clients/print-mode.js +21 -0
  160. package/node_modules/pi-lens/dist/clients/project-changes.js +40 -0
  161. package/node_modules/pi-lens/dist/clients/project-diagnostics/cache.js +3 -2
  162. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/call-graph-impact.js +8 -0
  163. package/node_modules/pi-lens/dist/clients/project-diagnostics/scanner.js +21 -1
  164. package/node_modules/pi-lens/dist/clients/project-lens-config.js +86 -9
  165. package/node_modules/pi-lens/dist/clients/project-report.js +27 -13
  166. package/node_modules/pi-lens/dist/clients/project-snapshot.js +175 -20
  167. package/node_modules/pi-lens/dist/clients/project-trust.js +181 -0
  168. package/node_modules/pi-lens/dist/clients/quiet-window.js +18 -4
  169. package/node_modules/pi-lens/dist/clients/read-bridge.js +147 -0
  170. package/node_modules/pi-lens/dist/clients/read-guard-logger.js +159 -1
  171. package/node_modules/pi-lens/dist/clients/read-guard-tool-lines.js +150 -29
  172. package/node_modules/pi-lens/dist/clients/read-guard.js +185 -4
  173. package/node_modules/pi-lens/dist/clients/resource-sampler.js +70 -84
  174. package/node_modules/pi-lens/dist/clients/review-graph/builder.js +1122 -221
  175. package/node_modules/pi-lens/dist/clients/review-graph/git-identity.js +2 -1
  176. package/node_modules/pi-lens/dist/clients/review-graph/import-resolvers.js +21 -10
  177. package/node_modules/pi-lens/dist/clients/review-graph/symbol-id.js +46 -0
  178. package/node_modules/pi-lens/dist/clients/review-graph/tsconfig-paths.js +57 -6
  179. package/node_modules/pi-lens/dist/clients/review-graph/workspace-modules.js +51 -3
  180. package/node_modules/pi-lens/dist/clients/review-graph-logger.js +30 -1
  181. package/node_modules/pi-lens/dist/clients/ruff-client.js +27 -44
  182. package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +107 -73
  183. package/node_modules/pi-lens/dist/clients/runtime-context.js +36 -12
  184. package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +74 -6
  185. package/node_modules/pi-lens/dist/clients/runtime-session.js +405 -117
  186. package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +71 -48
  187. package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +218 -23
  188. package/node_modules/pi-lens/dist/clients/runtime-turn.js +237 -64
  189. package/node_modules/pi-lens/dist/clients/rust-client.js +2 -1
  190. package/node_modules/pi-lens/dist/clients/safe-spawn.js +777 -62
  191. package/node_modules/pi-lens/dist/clients/security-scan-client.js +2 -1
  192. package/node_modules/pi-lens/dist/clients/session-state-store.js +3 -2
  193. package/node_modules/pi-lens/dist/clients/sg-runner.js +284 -174
  194. package/node_modules/pi-lens/dist/clients/slow-fs.js +2 -1
  195. package/node_modules/pi-lens/dist/clients/smells-rollup.js +224 -0
  196. package/node_modules/pi-lens/dist/clients/source-filter.js +184 -20
  197. package/node_modules/pi-lens/dist/clients/source-walker.js +66 -10
  198. package/node_modules/pi-lens/dist/clients/startup-scan.js +15 -16
  199. package/node_modules/pi-lens/dist/clients/startup-timing.js +1 -1
  200. package/node_modules/pi-lens/dist/clients/test-runner-client.js +38 -8
  201. package/node_modules/pi-lens/dist/clients/tool-event.js +35 -0
  202. package/node_modules/pi-lens/dist/clients/tool-policy.js +388 -39
  203. package/node_modules/pi-lens/dist/clients/tool-render.js +155 -0
  204. package/node_modules/pi-lens/dist/clients/tree-sitter-cache.js +6 -1
  205. package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +419 -50
  206. package/node_modules/pi-lens/dist/clients/tree-sitter-logger.js +21 -0
  207. package/node_modules/pi-lens/dist/clients/tree-sitter-query-loader.js +7 -1
  208. package/node_modules/pi-lens/dist/clients/tree-sitter-shared.js +7 -2
  209. package/node_modules/pi-lens/dist/clients/tree-sitter-symbol-extractor.js +44 -7
  210. package/node_modules/pi-lens/dist/clients/user-notify.js +51 -0
  211. package/node_modules/pi-lens/dist/clients/vanished-instance-marker.js +57 -0
  212. package/node_modules/pi-lens/dist/clients/warm-attach.js +33 -13
  213. package/node_modules/pi-lens/dist/clients/widget-state.js +300 -43
  214. package/node_modules/pi-lens/dist/clients/word-index.js +391 -64
  215. package/node_modules/pi-lens/dist/clients/workspace-topology.js +89 -6
  216. package/node_modules/pi-lens/dist/index.js +49361 -36888
  217. package/node_modules/pi-lens/dist/mcp/analyze-cli.js +182 -29
  218. package/node_modules/pi-lens/dist/mcp/server.js +211 -44
  219. package/node_modules/pi-lens/dist/tools/ast-grep-search.js +93 -27
  220. package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +200 -36
  221. package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +153 -40
  222. package/node_modules/pi-lens/dist/tools/lsp-navigation.js +46 -3
  223. package/node_modules/pi-lens/dist/tools/module-report.js +9 -0
  224. package/node_modules/pi-lens/docs/agent-guide.md +2 -2
  225. package/node_modules/pi-lens/docs/agent-tools.md +21 -10
  226. package/node_modules/pi-lens/docs/analysisall.md +192 -0
  227. package/node_modules/pi-lens/docs/api-ports-inventory.md +165 -0
  228. package/node_modules/pi-lens/docs/ast-grep_rules_catalog.md +5 -2
  229. package/node_modules/pi-lens/docs/durable-store-audit-1202.md +32 -0
  230. package/node_modules/pi-lens/docs/environment-variables.md +44 -0
  231. package/node_modules/pi-lens/docs/fable.md +27 -0
  232. package/node_modules/pi-lens/docs/features.md +31 -2
  233. package/node_modules/pi-lens/docs/globalconfig.md +45 -1
  234. package/node_modules/pi-lens/docs/language-coverage.md +4 -3
  235. package/node_modules/pi-lens/docs/lsp-capability-matrix.md +2 -2
  236. package/node_modules/pi-lens/docs/mcp.md +37 -4
  237. package/node_modules/pi-lens/docs/servercapabilities.md +3 -3
  238. package/node_modules/pi-lens/docs/settings.md +12 -1
  239. package/node_modules/pi-lens/docs/tools.md +4 -1
  240. package/node_modules/pi-lens/docs/usage.md +18 -0
  241. package/node_modules/pi-lens/package.json +10 -10
  242. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-bare-except-test.yml +49 -0
  243. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-bare-host-path-in-win32-branch-test.yml +87 -0
  244. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-nested-links-test.yml +11 -1
  245. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-raw-json-store-write-test.yml +17 -0
  246. package/node_modules/pi-lens/rules/ast-grep-rules/rule-tests/no-win32-isabsolute-for-qualification-test.yml +16 -0
  247. package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-bare-except.yml +3 -15
  248. package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-bare-host-path-in-win32-branch.yml +25 -0
  249. package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-nested-links.yml +7 -0
  250. package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-raw-json-store-write.yml +30 -0
  251. package/node_modules/pi-lens/rules/ast-grep-rules/rules/no-win32-isabsolute-for-qualification.yml +23 -0
  252. package/node_modules/pi-lens/rules/tree-sitter-queries/tsx/no-nested-links.yml +4 -6
  253. package/node_modules/pi-lens/rules/tree-sitter-queries/typescript/duplicate-function-arg.yml +2 -2
  254. package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +55 -2
  255. package/node_modules/pi-mcp-adapter/CHANGELOG.md +25 -0
  256. package/node_modules/pi-mcp-adapter/README.md +34 -3
  257. package/node_modules/pi-mcp-adapter/agent-plugin-loader.ts +1 -1
  258. package/node_modules/pi-mcp-adapter/commands.ts +15 -7
  259. package/node_modules/pi-mcp-adapter/direct-tools.ts +54 -7
  260. package/node_modules/pi-mcp-adapter/host-html-template.ts +0 -8
  261. package/node_modules/pi-mcp-adapter/index.ts +8 -3
  262. package/node_modules/pi-mcp-adapter/init.ts +29 -5
  263. package/node_modules/pi-mcp-adapter/lifecycle.ts +0 -4
  264. package/node_modules/pi-mcp-adapter/mcp-auth-flow.ts +1 -2
  265. package/node_modules/pi-mcp-adapter/mcp-auth.ts +60 -2
  266. package/node_modules/pi-mcp-adapter/mcp-panel.ts +45 -9
  267. package/node_modules/pi-mcp-adapter/mcp-script-worker.mjs +22 -20
  268. package/node_modules/pi-mcp-adapter/metadata-cache.ts +27 -4
  269. package/node_modules/pi-mcp-adapter/npx-resolver.ts +81 -26
  270. package/node_modules/pi-mcp-adapter/package.json +3 -3
  271. package/node_modules/pi-mcp-adapter/proxy-modes.ts +108 -26
  272. package/node_modules/pi-mcp-adapter/search-ranking.ts +86 -7
  273. package/node_modules/pi-mcp-adapter/server-manager.ts +36 -7
  274. package/node_modules/pi-mcp-adapter/session-recovery.ts +8 -2
  275. package/node_modules/pi-mcp-adapter/tool-approval.ts +48 -7
  276. package/node_modules/pi-mcp-adapter/tool-metadata.ts +42 -4
  277. package/node_modules/pi-mcp-adapter/tool-result-renderer.ts +138 -12
  278. package/node_modules/pi-mcp-adapter/types.ts +93 -27
  279. package/node_modules/pi-mcp-adapter/ui-server.ts +20 -1
  280. package/package.json +11 -12
  281. package/node_modules/pi-lens/dist/clients/ast-grep-parser.js +0 -86
  282. package/node_modules/pi-lens/dist/clients/lsp/interactive-install.js +0 -367
  283. package/node_modules/pi-lens/dist/clients/lsp/lsp-index.js +0 -10
  284. package/node_modules/pi-lens/dist/clients/lsp/server-strategies.js +0 -5
  285. package/node_modules/pi-lens/dist/clients/project-metadata.js +0 -690
  286. package/node_modules/pi-lens/dist/clients/source-groups.js +0 -96
  287. package/node_modules/pi-lens/dist/clients/startup-marker.js +0 -6
  288. package/node_modules/pi-lens/dist/clients/types.js +0 -11
@@ -15,6 +15,11 @@
15
15
  * remaining wall-clock budget.
16
16
  * - OPT-IN: disabled by default (budget 0) until validated in a real pi session;
17
17
  * enable with PI_LENS_MODULE_REPORT_LSP_BUDGET_MS.
18
+ *
19
+ * PARKED BY DECISION (#1090, 2026-08-12): zero live importers by design —
20
+ * efe3d2a5 unwired module_report's LSP path (#256) and re-homed live
21
+ * enrichment to #236 (LSP-confirmed graph edges). Kept for that future
22
+ * implementation; do not re-flag in dead-code sweeps while #236 is open.
18
23
  */
19
24
  import { withinRemaining } from "./deadline-utils.js";
20
25
  import { uriToPath } from "./path-utils.js";
@@ -37,10 +37,23 @@ import { detectFileKind } from "./file-kinds.js";
37
37
  import { logLatency } from "./latency-logger.js";
38
38
  import { annotateMiddleMan } from "./middle-man-analysis.js";
39
39
  import { normalizeMapKey, toProjectRelativePath } from "./path-utils.js";
40
+ import { loadCallGraph, } from "./call-graph.js";
40
41
  import { resolveImportToFiles } from "./review-graph/import-resolvers.js";
41
42
  import { buildSymbolId } from "./review-graph/symbol-id.js";
42
43
  import { getSharedTreeSitterClient, resolveTreeSitterLanguage, } from "./tree-sitter-shared.js";
43
44
  import { TreeSitterSymbolExtractor, } from "./tree-sitter-symbol-extractor.js";
45
+ // NOTE: live-LSP enrichment is NO LONGER called on this read path (#256). Firing
46
+ // LSP per read — speculatively, on the agent's fan-out path — repeatedly OOM'd
47
+ // pi. The enrichment logic is kept as a separate module (clients/module-report-
48
+ // lsp.ts) to be re-homed in #236, where LSP writes provenance-tagged edges INTO
49
+ // the review graph (computed once, persisted) so this path just reads them.
50
+ /** Hard payload bound for the per-symbol who-uses-this section. */
51
+ export const MAX_MODULE_REPORT_REFS = 100;
52
+ function normalizeMaxRefsPerSymbol(value) {
53
+ if (value === undefined || !Number.isFinite(value))
54
+ return 10;
55
+ return Math.min(MAX_MODULE_REPORT_REFS, Math.max(1, Math.floor(value)));
56
+ }
44
57
  // kind -> tree-sitter languageId. The languageId keys BOTH the grammar map
45
58
  // (tree-sitter-client) and SYMBOL_QUERIES (tree-sitter-symbol-extractor), so it
46
59
  // must match a key present in both. jsts/cxx are extension-split kinds resolved
@@ -225,7 +238,9 @@ function resolveUsedBy(graph, symbolNodeId, cap, projectRoot) {
225
238
  symbol,
226
239
  line,
227
240
  relation: edge.kind,
228
- ...(edge.resolution ? { resolution: edge.resolution } : {}),
241
+ ...(edge.resolution && edge.resolution !== "unresolved"
242
+ ? { resolution: edge.resolution }
243
+ : {}),
229
244
  });
230
245
  if (out.length >= cap)
231
246
  break;
@@ -1143,6 +1158,120 @@ function extractCallbacks(root, entries, languageId, warnings) {
1143
1158
  }
1144
1159
  return callbacks.slice(0, callbackCap);
1145
1160
  }
1161
+ const CALL_GRAPH_DEFAULT_ENTRY_CAP = 20;
1162
+ const CALL_GRAPH_MAX_ENTRY_CAP = 100;
1163
+ function unavailableCallGraph(reason) {
1164
+ return {
1165
+ available: false,
1166
+ reason,
1167
+ callers: [],
1168
+ callees: [],
1169
+ truncated: false,
1170
+ coverage: { status: "unavailable", complete: false },
1171
+ };
1172
+ }
1173
+ function callGraphCoverage(coverage) {
1174
+ const languages = coverage.languages;
1175
+ const complete = coverage.complete && Object.values(languages ?? {}).every((status) => status === "complete");
1176
+ return {
1177
+ status: complete ? "complete" : "partial",
1178
+ complete,
1179
+ totalEvidence: coverage.totalEvidence,
1180
+ callsEvidence: coverage.callsEvidence,
1181
+ referencesEvidence: coverage.referencesEvidence,
1182
+ eligibleEvidence: coverage.eligibleEvidence,
1183
+ resolvedEvidence: coverage.resolvedEvidence,
1184
+ unresolvedEvidence: coverage.unresolvedEvidence,
1185
+ typeOnlyEvidence: coverage.typeOnlyEvidence,
1186
+ unsupportedEvidence: coverage.unsupportedEvidence,
1187
+ sameFileEvidence: coverage.sameFileEvidence,
1188
+ duplicateEvidence: coverage.duplicateEvidence,
1189
+ ...(languages ? { languages } : {}),
1190
+ };
1191
+ }
1192
+ function callGraphRelation(edge, kind, projectRoot) {
1193
+ const caller = kind === "caller";
1194
+ return {
1195
+ symbolId: caller ? edge.callerKey : edge.calleeKey,
1196
+ targetSymbolId: caller ? edge.calleeKey : edge.callerKey,
1197
+ file: toDisplayPath(caller ? edge.callerFile : edge.calleeFile, projectRoot),
1198
+ ...(caller
1199
+ ? {
1200
+ symbol: edge.callerSymbol,
1201
+ kind: edge.callerKind,
1202
+ line: edge.callerLine,
1203
+ }
1204
+ : {
1205
+ symbol: edge.calleeSymbol,
1206
+ kind: edge.calleeKind,
1207
+ line: edge.calleeLine,
1208
+ }),
1209
+ ...(edge.evidenceKind ? { evidenceKind: edge.evidenceKind } : {}),
1210
+ ...(edge.resolution ? { resolution: edge.resolution } : {}),
1211
+ ...(edge.evidenceCount && edge.evidenceCount > 1
1212
+ ? { evidenceCount: edge.evidenceCount }
1213
+ : {}),
1214
+ ...(edge.weight !== 1 ? { weight: edge.weight } : {}),
1215
+ };
1216
+ }
1217
+ /**
1218
+ * Read the separately persisted FunctionCallGraph projection. This accessor is
1219
+ * deliberately conservative: the module-report path never walks/builds the
1220
+ * review graph, and a changed source file invalidates the projection rather
1221
+ * than being reported as a clean zero-call result.
1222
+ */
1223
+ function readCallGraph(projectRoot, normalizedPath, maxEntries, graphFileCap, identity, reviewGraph) {
1224
+ if (graphFileCap !== undefined)
1225
+ return unavailableCallGraph("file-cap");
1226
+ // The canonical review graph is the only freshness authority. This path is
1227
+ // read-only: do not walk source files or compare an independent mtime map.
1228
+ if (!reviewGraph)
1229
+ return unavailableCallGraph("review-graph-missing");
1230
+ if (reviewGraph.persistCoverage?.partial || reviewGraph.persistCoverage?.inProgress) {
1231
+ return unavailableCallGraph("partial");
1232
+ }
1233
+ if (!identity)
1234
+ return unavailableCallGraph("identity-missing");
1235
+ if (!reviewGraph.fileNodes.has(normalizedPath))
1236
+ return unavailableCallGraph("stale");
1237
+ const cached = loadCallGraph(projectRoot, identity);
1238
+ if (!cached)
1239
+ return unavailableCallGraph("stale");
1240
+ const callers = [];
1241
+ const callees = [];
1242
+ for (const edge of cached.graph.edges) {
1243
+ if (normalizeMapKey(edge.calleeFile) === normalizedPath) {
1244
+ callers.push(callGraphRelation(edge, "caller", projectRoot));
1245
+ }
1246
+ if (normalizeMapKey(edge.callerFile) === normalizedPath) {
1247
+ callees.push(callGraphRelation(edge, "callee", projectRoot));
1248
+ }
1249
+ }
1250
+ const stable = (left, right) => left.targetSymbolId.localeCompare(right.targetSymbolId) ||
1251
+ (left.line ?? 0) - (right.line ?? 0) ||
1252
+ left.symbolId.localeCompare(right.symbolId);
1253
+ callers.sort(stable);
1254
+ callees.sort(stable);
1255
+ return {
1256
+ available: true,
1257
+ callers: callers.slice(0, maxEntries),
1258
+ callees: callees.slice(0, maxEntries),
1259
+ truncated: callers.length > maxEntries || callees.length > maxEntries,
1260
+ coverage: callGraphCoverage(cached.graph.coverage ?? {
1261
+ totalEvidence: cached.graph.totalRefs,
1262
+ callsEvidence: cached.graph.totalRefs,
1263
+ referencesEvidence: 0,
1264
+ eligibleEvidence: cached.graph.totalRefs,
1265
+ resolvedEvidence: cached.graph.totalRefs,
1266
+ unresolvedEvidence: cached.graph.unresolvedRefs,
1267
+ typeOnlyEvidence: 0,
1268
+ unsupportedEvidence: 0,
1269
+ sameFileEvidence: 0,
1270
+ duplicateEvidence: 0,
1271
+ complete: false,
1272
+ }),
1273
+ };
1274
+ }
1146
1275
  function unavailableReport(displayPath, error) {
1147
1276
  return {
1148
1277
  available: false,
@@ -1168,7 +1297,8 @@ function unavailableReport(displayPath, error) {
1168
1297
  */
1169
1298
  export async function moduleReport(file, cwd, options) {
1170
1299
  const startedAt = Date.now();
1171
- const maxRefs = Math.max(1, options?.maxRefsPerSymbol ?? 10);
1300
+ const maxRefs = normalizeMaxRefsPerSymbol(options?.maxRefsPerSymbol);
1301
+ const maxCallGraphEntries = Math.min(CALL_GRAPH_MAX_ENTRY_CAP, Math.max(1, Math.floor(options?.maxCallGraphEntries ?? CALL_GRAPH_DEFAULT_ENTRY_CAP)));
1172
1302
  const absPath = path.resolve(cwd, file);
1173
1303
  const normalizedPath = normalizeMapKey(absPath);
1174
1304
  let content;
@@ -1199,13 +1329,26 @@ export async function moduleReport(file, cwd, options) {
1199
1329
  // jsts) and two racing builds OOM'd pi (#256). Cold cache → outline-only.
1200
1330
  let graph;
1201
1331
  let graphFileCap;
1332
+ let callGraphIdentity;
1202
1333
  try {
1203
- const { getCachedReviewGraph, getReviewGraphSizeSkipVerdict } = await import("./review-graph/builder.js");
1334
+ const { getCachedReviewGraph, getReviewGraphCacheIdentity, getReviewGraphSizeSkipVerdict, } = await import("./review-graph/builder.js");
1204
1335
  graph = getCachedReviewGraph(cwd);
1205
1336
  graphFileCap = getReviewGraphSizeSkipVerdict(cwd)?.maxFileCount;
1337
+ callGraphIdentity = graph
1338
+ ? (() => {
1339
+ const identity = getReviewGraphCacheIdentity(cwd, graph);
1340
+ return identity
1341
+ ? {
1342
+ reviewGraphVersion: identity.version,
1343
+ reviewGraphSignature: identity.signature,
1344
+ }
1345
+ : undefined;
1346
+ })()
1347
+ : undefined;
1206
1348
  }
1207
1349
  catch {
1208
1350
  graph = undefined;
1351
+ callGraphIdentity = undefined;
1209
1352
  }
1210
1353
  // Drop function-local declarations (a nested const/arrow/function) from the
1211
1354
  // outline — they're implementation detail of a parent symbol, not navigable
@@ -1277,6 +1420,9 @@ export async function moduleReport(file, cwd, options) {
1277
1420
  const blastRadius = options?.blastRadius && graph && hasGraphNode
1278
1421
  ? await computeBlastRadius(graph, normalizedPath, cwd, Math.max(1, options.blastRadiusDepth ?? 3))
1279
1422
  : undefined;
1423
+ const callGraph = options?.callGraph
1424
+ ? readCallGraph(cwd, normalizedPath, maxCallGraphEntries, graphFileCap, callGraphIdentity, graph)
1425
+ : undefined;
1280
1426
  const view = options?.view ?? "default";
1281
1427
  const summaryView = view === "summary";
1282
1428
  // "compact" computes the same full data as "default" — it's a rendering
@@ -1297,6 +1443,11 @@ export async function moduleReport(file, cwd, options) {
1297
1443
  const blastRadiusProvenance = blastRadius
1298
1444
  ? "cached-review-graph"
1299
1445
  : unavailableGraphProvenance;
1446
+ const callGraphProvenance = callGraph?.available
1447
+ ? "cached-call-graph"
1448
+ : callGraph?.reason === "file-cap"
1449
+ ? "unavailable:file-cap"
1450
+ : "none";
1300
1451
  const report = {
1301
1452
  available: entries.length > 0 || hasGraphNode,
1302
1453
  staleness: entries.length === 0 && !hasGraphNode ? "unavailable" : "fresh",
@@ -1318,6 +1469,7 @@ export async function moduleReport(file, cwd, options) {
1318
1469
  ...(summaryView ? { view: "summary" } : {}),
1319
1470
  ...(compactView ? { view: "compact" } : {}),
1320
1471
  ...(blastRadius && !summaryView ? { blastRadius } : {}),
1472
+ ...(callGraph ? { callGraph } : {}),
1321
1473
  ...(graph ? { graphBuiltAt: graph.builtAt } : {}),
1322
1474
  provenance: {
1323
1475
  symbols: languageId ? "syntax" : "none",
@@ -1329,6 +1481,7 @@ export async function moduleReport(file, cwd, options) {
1329
1481
  ...(options?.blastRadius
1330
1482
  ? { blastRadius: blastRadiusProvenance }
1331
1483
  : {}),
1484
+ ...(options?.callGraph ? { callGraph: callGraphProvenance } : {}),
1332
1485
  },
1333
1486
  semantic: {
1334
1487
  // Provenance of who-uses-this / references. The AST review graph is the
@@ -1472,6 +1625,18 @@ export function renderCompactModuleReport(report) {
1472
1625
  lines.push(compactCallbackLine(callback, width));
1473
1626
  }
1474
1627
  }
1628
+ if (report.callGraph) {
1629
+ const callGraph = report.callGraph;
1630
+ const suffix = callGraph.truncated ? " (truncated)" : "";
1631
+ lines.push("CALL GRAPH:");
1632
+ if (!callGraph.available) {
1633
+ lines.push(` unavailable (${callGraph.reason ?? "unknown"})`);
1634
+ }
1635
+ else {
1636
+ lines.push(` callers: ${callGraph.callers.length} · callees: ${callGraph.callees.length}` +
1637
+ ` · coverage: ${callGraph.coverage.status}${suffix}`);
1638
+ }
1639
+ }
1475
1640
  if (report.recommendedReads.length > 0) {
1476
1641
  lines.push("RECOMMENDED:");
1477
1642
  for (const r of report.recommendedReads) {