@herbertgao/pi-extensions 2026.9.0 → 2026.9.1

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 (293) hide show
  1. package/node_modules/@czottmann/pi-automode/CHANGELOG.md +13 -1
  2. package/node_modules/@czottmann/pi-automode/README.md +20 -0
  3. package/node_modules/@czottmann/pi-automode/docs/GLOSSARY.md +1 -1
  4. package/node_modules/@czottmann/pi-automode/docs/automode-classifier-flow.md +2 -1
  5. package/node_modules/@czottmann/pi-automode/docs/defaults.md +3 -2
  6. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/classifier.ts +38 -2
  7. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/constants.ts +5 -3
  8. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/extension.ts +11 -3
  9. package/node_modules/@czottmann/pi-automode/package.json +1 -1
  10. package/node_modules/@pi-plugins/fast-mode/README.md +5 -3
  11. package/node_modules/@pi-plugins/fast-mode/dist/index.d.mts.map +1 -1
  12. package/node_modules/@pi-plugins/fast-mode/dist/index.mjs +20 -55
  13. package/node_modules/@pi-plugins/fast-mode/dist/index.mjs.map +1 -1
  14. package/node_modules/@pi-plugins/fast-mode/package.json +1 -1
  15. package/node_modules/pi-lens/CHANGELOG.md +988 -0
  16. package/node_modules/pi-lens/README.md +3 -0
  17. package/node_modules/pi-lens/config/biome/core.jsonc +11 -2
  18. package/node_modules/pi-lens/config/dependency-cruiser-eager-allowlist.json +13 -1
  19. package/node_modules/pi-lens/dist/clients/actionable-warnings-logger.js +2 -2
  20. package/node_modules/pi-lens/dist/clients/actionable-warnings.js +927 -80
  21. package/node_modules/pi-lens/dist/clients/agent-behavior-client.js +13 -4
  22. package/node_modules/pi-lens/dist/clients/ast-grep-client.js +123 -3
  23. package/node_modules/pi-lens/dist/clients/ast-grep-rule-manager.js +60 -5
  24. package/node_modules/pi-lens/dist/clients/ast-grep-tool-logger.js +2 -2
  25. package/node_modules/pi-lens/dist/clients/bash-file-access.js +1 -3
  26. package/node_modules/pi-lens/dist/clients/biome-client.js +9 -2
  27. package/node_modules/pi-lens/dist/clients/blocker-freshness.js +14 -0
  28. package/node_modules/pi-lens/dist/clients/bootstrap.js +509 -73
  29. package/node_modules/pi-lens/dist/clients/bounded-cache.js +152 -12
  30. package/node_modules/pi-lens/dist/clients/bounded-telemetry.js +59 -4
  31. package/node_modules/pi-lens/dist/clients/bundled-resource-health.js +113 -0
  32. package/node_modules/pi-lens/dist/clients/bus-events-logger.js +2 -2
  33. package/node_modules/pi-lens/dist/clients/cache/rule-cache.js +31 -4
  34. package/node_modules/pi-lens/dist/clients/cache-manager.js +105 -6
  35. package/node_modules/pi-lens/dist/clients/cache-observability.js +44 -18
  36. package/node_modules/pi-lens/dist/clients/cargo-manifest.js +422 -0
  37. package/node_modules/pi-lens/dist/clients/cascade-logger.js +2 -2
  38. package/node_modules/pi-lens/dist/clients/code-quality-warnings.js +13 -3
  39. package/node_modules/pi-lens/dist/clients/complexity-client.js +16 -5
  40. package/node_modules/pi-lens/dist/clients/config-core/deny.js +221 -0
  41. package/node_modules/pi-lens/dist/clients/config-core/index.js +47 -0
  42. package/node_modules/pi-lens/dist/clients/config-core/merge.js +357 -0
  43. package/node_modules/pi-lens/dist/clients/config-core/normalize.js +340 -0
  44. package/node_modules/pi-lens/dist/clients/config-core/process-spec.js +248 -0
  45. package/node_modules/pi-lens/dist/clients/config-core/provenance.js +171 -0
  46. package/node_modules/pi-lens/dist/clients/config-core/records.js +218 -0
  47. package/node_modules/pi-lens/dist/clients/config-core/resolve.js +125 -0
  48. package/node_modules/pi-lens/dist/clients/config-core/safe-object.js +78 -0
  49. package/node_modules/pi-lens/dist/clients/config-core/schema.js +167 -0
  50. package/node_modules/pi-lens/dist/clients/config-diagnostic-codes.js +281 -0
  51. package/node_modules/pi-lens/dist/clients/config-locations.js +160 -0
  52. package/node_modules/pi-lens/dist/clients/config-resolve.js +789 -0
  53. package/node_modules/pi-lens/dist/clients/config-schema.js +197 -0
  54. package/node_modules/pi-lens/dist/clients/config-warn.js +407 -0
  55. package/node_modules/pi-lens/dist/clients/dead-code-client.js +19 -14
  56. package/node_modules/pi-lens/dist/clients/dead-code-logger.js +2 -2
  57. package/node_modules/pi-lens/dist/clients/deadline-utils.js +178 -0
  58. package/node_modules/pi-lens/dist/clients/debug-handles.js +2 -2
  59. package/node_modules/pi-lens/dist/clients/debug-heap.js +3 -3
  60. package/node_modules/pi-lens/dist/clients/deferred-lsp-work.js +106 -0
  61. package/node_modules/pi-lens/dist/clients/degradation-ledger.js +113 -7
  62. package/node_modules/pi-lens/dist/clients/dependency-checker.js +8 -19
  63. package/node_modules/pi-lens/dist/clients/diagnostic-line-freshness.js +12 -9
  64. package/node_modules/pi-lens/dist/clients/diagnostic-logger.js +14 -4
  65. package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +162 -18
  66. package/node_modules/pi-lens/dist/clients/dispatch/fact-store.js +97 -0
  67. package/node_modules/pi-lens/dist/clients/dispatch/integration.js +9 -7
  68. package/node_modules/pi-lens/dist/clients/dispatch/runners/actionlint.js +0 -1
  69. package/node_modules/pi-lens/dist/clients/dispatch/runners/ast-grep-napi.js +380 -26
  70. package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +0 -1
  71. package/node_modules/pi-lens/dist/clients/dispatch/runners/cpp-check.js +0 -1
  72. package/node_modules/pi-lens/dist/clients/dispatch/runners/credo.js +0 -1
  73. package/node_modules/pi-lens/dist/clients/dispatch/runners/cue-vet.js +0 -1
  74. package/node_modules/pi-lens/dist/clients/dispatch/runners/dart-analyze.js +0 -1
  75. package/node_modules/pi-lens/dist/clients/dispatch/runners/detekt.js +0 -1
  76. package/node_modules/pi-lens/dist/clients/dispatch/runners/dotnet-build.js +0 -1
  77. package/node_modules/pi-lens/dist/clients/dispatch/runners/elixir-check.js +0 -1
  78. package/node_modules/pi-lens/dist/clients/dispatch/runners/eslint.js +0 -1
  79. package/node_modules/pi-lens/dist/clients/dispatch/runners/fact-rules.js +0 -1
  80. package/node_modules/pi-lens/dist/clients/dispatch/runners/fish-indent.js +0 -1
  81. package/node_modules/pi-lens/dist/clients/dispatch/runners/gleam-check.js +0 -1
  82. package/node_modules/pi-lens/dist/clients/dispatch/runners/go-vet.js +1 -3
  83. package/node_modules/pi-lens/dist/clients/dispatch/runners/golangci-lint.js +0 -1
  84. package/node_modules/pi-lens/dist/clients/dispatch/runners/hadolint.js +0 -1
  85. package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-lint.js +0 -1
  86. package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-render.js +0 -1
  87. package/node_modules/pi-lens/dist/clients/dispatch/runners/htmlhint.js +0 -1
  88. package/node_modules/pi-lens/dist/clients/dispatch/runners/javac.js +0 -1
  89. package/node_modules/pi-lens/dist/clients/dispatch/runners/ktlint.js +0 -1
  90. package/node_modules/pi-lens/dist/clients/dispatch/runners/lsp.js +0 -1
  91. package/node_modules/pi-lens/dist/clients/dispatch/runners/markdownlint.js +0 -1
  92. package/node_modules/pi-lens/dist/clients/dispatch/runners/mypy.js +0 -1
  93. package/node_modules/pi-lens/dist/clients/dispatch/runners/oxlint.js +13 -18
  94. package/node_modules/pi-lens/dist/clients/dispatch/runners/php-lint.js +0 -1
  95. package/node_modules/pi-lens/dist/clients/dispatch/runners/phpstan.js +0 -1
  96. package/node_modules/pi-lens/dist/clients/dispatch/runners/prisma-validate.js +0 -1
  97. package/node_modules/pi-lens/dist/clients/dispatch/runners/psscriptanalyzer.js +0 -1
  98. package/node_modules/pi-lens/dist/clients/dispatch/runners/pyright.js +7 -4
  99. package/node_modules/pi-lens/dist/clients/dispatch/runners/rubocop.js +0 -1
  100. package/node_modules/pi-lens/dist/clients/dispatch/runners/ruff.js +0 -1
  101. package/node_modules/pi-lens/dist/clients/dispatch/runners/rust-clippy.js +1 -3
  102. package/node_modules/pi-lens/dist/clients/dispatch/runners/shellcheck.js +0 -1
  103. package/node_modules/pi-lens/dist/clients/dispatch/runners/shfmt.js +0 -1
  104. package/node_modules/pi-lens/dist/clients/dispatch/runners/spellcheck.js +0 -1
  105. package/node_modules/pi-lens/dist/clients/dispatch/runners/spotbugs.js +0 -1
  106. package/node_modules/pi-lens/dist/clients/dispatch/runners/sqlfluff.js +0 -1
  107. package/node_modules/pi-lens/dist/clients/dispatch/runners/stylelint.js +0 -1
  108. package/node_modules/pi-lens/dist/clients/dispatch/runners/swiftlint.js +0 -1
  109. package/node_modules/pi-lens/dist/clients/dispatch/runners/taplo.js +0 -1
  110. package/node_modules/pi-lens/dist/clients/dispatch/runners/terragrunt.js +0 -1
  111. package/node_modules/pi-lens/dist/clients/dispatch/runners/tflint.js +0 -1
  112. package/node_modules/pi-lens/dist/clients/dispatch/runners/tree-sitter.js +0 -1
  113. package/node_modules/pi-lens/dist/clients/dispatch/runners/trivy-config.js +0 -1
  114. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/availability-policy.js +3 -0
  115. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/diagnostic-parsers.js +3 -4
  116. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +194 -80
  117. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/toolchain-availability.js +84 -15
  118. package/node_modules/pi-lens/dist/clients/dispatch/runners/vale.js +0 -1
  119. package/node_modules/pi-lens/dist/clients/dispatch/runners/yamllint.js +0 -1
  120. package/node_modules/pi-lens/dist/clients/dispatch/runners/zig-check.js +0 -1
  121. package/node_modules/pi-lens/dist/clients/disposition-logger.js +3 -3
  122. package/node_modules/pi-lens/dist/clients/effective-config.js +403 -0
  123. package/node_modules/pi-lens/dist/clients/error-class.js +23 -0
  124. package/node_modules/pi-lens/dist/clients/event-loop-hold.js +274 -0
  125. package/node_modules/pi-lens/dist/clients/extension-log.js +2 -2
  126. package/node_modules/pi-lens/dist/clients/feature-hints.js +2 -1
  127. package/node_modules/pi-lens/dist/clients/file-time.js +6 -1
  128. package/node_modules/pi-lens/dist/clients/file-utils.js +112 -9
  129. package/node_modules/pi-lens/dist/clients/finding-delivery-gate.js +50 -13
  130. package/node_modules/pi-lens/dist/clients/format-service.js +6 -1
  131. package/node_modules/pi-lens/dist/clients/formatters.js +276 -102
  132. package/node_modules/pi-lens/dist/clients/freshness-cadence.js +17 -0
  133. package/node_modules/pi-lens/dist/clients/generated-artifacts.js +114 -19
  134. package/node_modules/pi-lens/dist/clients/generation-guard.js +4 -9
  135. package/node_modules/pi-lens/dist/clients/git-guard.js +1 -1
  136. package/node_modules/pi-lens/dist/clients/go-client.js +39 -0
  137. package/node_modules/pi-lens/dist/clients/gradle-ktfmt-style.js +252 -0
  138. package/node_modules/pi-lens/dist/clients/hashline-anchor.js +424 -0
  139. package/node_modules/pi-lens/dist/clients/hook-budgets.js +76 -0
  140. package/node_modules/pi-lens/dist/clients/host-edit-normalize.js +5 -2
  141. package/node_modules/pi-lens/dist/clients/host-ports.js +1 -1
  142. package/node_modules/pi-lens/dist/clients/installer/index.js +71 -52
  143. package/node_modules/pi-lens/dist/clients/instance-reaper.js +104 -230
  144. package/node_modules/pi-lens/dist/clients/instance-registry.js +6 -3
  145. package/node_modules/pi-lens/dist/clients/language-registry.js +595 -0
  146. package/node_modules/pi-lens/dist/clients/latency-logger.js +160 -2
  147. package/node_modules/pi-lens/dist/clients/ledger-bounds.js +13 -0
  148. package/node_modules/pi-lens/dist/clients/lens-config.js +141 -30
  149. package/node_modules/pi-lens/dist/clients/lens-engine.js +30 -37
  150. package/node_modules/pi-lens/dist/clients/lens-flag-registry.js +59 -6
  151. package/node_modules/pi-lens/dist/clients/log-cleanup.js +2 -2
  152. package/node_modules/pi-lens/dist/clients/lsp/aggregation.js +3 -1
  153. package/node_modules/pi-lens/dist/clients/lsp/client.js +168 -30
  154. package/node_modules/pi-lens/dist/clients/lsp/config.js +483 -158
  155. package/node_modules/pi-lens/dist/clients/lsp/diagnostic-binding.js +1 -1
  156. package/node_modules/pi-lens/dist/clients/lsp/edits.js +15 -2
  157. package/node_modules/pi-lens/dist/clients/lsp/index.js +676 -71
  158. package/node_modules/pi-lens/dist/clients/lsp/language.js +18 -169
  159. package/node_modules/pi-lens/dist/clients/lsp/launch.js +2 -1
  160. package/node_modules/pi-lens/dist/clients/lsp/pending-aux-coverage.js +5 -16
  161. package/node_modules/pi-lens/dist/clients/lsp/server.js +284 -147
  162. package/node_modules/pi-lens/dist/clients/lsp/session-roots.js +116 -23
  163. package/node_modules/pi-lens/dist/clients/lsp/spawn-history.js +2 -7
  164. package/node_modules/pi-lens/dist/clients/lsp/tsserver-sync.js +9 -2
  165. package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +1 -1
  166. package/node_modules/pi-lens/dist/clients/lsp-mutation.js +163 -21
  167. package/node_modules/pi-lens/dist/clients/map-with-concurrency.js +36 -0
  168. package/node_modules/pi-lens/dist/clients/mcp/analyze.js +33 -4
  169. package/node_modules/pi-lens/dist/clients/mcp/session.js +5 -16
  170. package/node_modules/pi-lens/dist/clients/memory-sampler.js +8 -3
  171. package/node_modules/pi-lens/dist/clients/middle-man-analysis.js +2 -4
  172. package/node_modules/pi-lens/dist/clients/module-report.js +20 -45
  173. package/node_modules/pi-lens/dist/clients/mutating-tool.js +651 -0
  174. package/node_modules/pi-lens/dist/clients/mutation-attribution.js +368 -0
  175. package/node_modules/pi-lens/dist/clients/mutation-bridge.js +240 -0
  176. package/node_modules/pi-lens/dist/clients/ndjson-logger.js +247 -20
  177. package/node_modules/pi-lens/dist/clients/observed-mutation-sources.js +101 -0
  178. package/node_modules/pi-lens/dist/clients/observed-mutation.js +1215 -0
  179. package/node_modules/pi-lens/dist/clients/opaque-mutation-scan.js +68 -22
  180. package/node_modules/pi-lens/dist/clients/opengrep-config.js +4 -0
  181. package/node_modules/pi-lens/dist/clients/package-manager.js +195 -26
  182. package/node_modules/pi-lens/dist/clients/partial-edit-apply.js +359 -80
  183. package/node_modules/pi-lens/dist/clients/path-attribution-telemetry.js +23 -7
  184. package/node_modules/pi-lens/dist/clients/path-keyed-map.js +21 -2
  185. package/node_modules/pi-lens/dist/clients/path-utils.js +428 -13
  186. package/node_modules/pi-lens/dist/clients/persist-debounce.js +8 -1
  187. package/node_modules/pi-lens/dist/clients/php-cs-fixer-config.js +114 -0
  188. package/node_modules/pi-lens/dist/clients/pipeline.js +77 -16
  189. package/node_modules/pi-lens/dist/clients/probe-home-state.js +228 -0
  190. package/node_modules/pi-lens/dist/clients/process-bridge.js +66 -0
  191. package/node_modules/pi-lens/dist/clients/process-snapshot.js +68 -0
  192. package/node_modules/pi-lens/dist/clients/project-diagnostics/fresh-fetch.js +4 -3
  193. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/runner-findings.js +27 -3
  194. package/node_modules/pi-lens/dist/clients/project-diagnostics/scanner.js +51 -20
  195. package/node_modules/pi-lens/dist/clients/project-lens-config.js +393 -122
  196. package/node_modules/pi-lens/dist/clients/project-snapshot.js +52 -24
  197. package/node_modules/pi-lens/dist/clients/python-environment.js +217 -0
  198. package/node_modules/pi-lens/dist/clients/python-provenance.js +639 -0
  199. package/node_modules/pi-lens/dist/clients/quiet-window.js +6 -1
  200. package/node_modules/pi-lens/dist/clients/read-bridge.js +13 -21
  201. package/node_modules/pi-lens/dist/clients/read-expansion.js +9 -46
  202. package/node_modules/pi-lens/dist/clients/read-guard-logger.js +15 -4
  203. package/node_modules/pi-lens/dist/clients/read-guard-tool-lines.js +364 -212
  204. package/node_modules/pi-lens/dist/clients/read-guard.js +21 -0
  205. package/node_modules/pi-lens/dist/clients/resource-sampler.js +195 -96
  206. package/node_modules/pi-lens/dist/clients/review-graph/builder.js +152 -109
  207. package/node_modules/pi-lens/dist/clients/review-graph/service.js +55 -3
  208. package/node_modules/pi-lens/dist/clients/review-graph/shared-extraction-ir.js +7 -15
  209. package/node_modules/pi-lens/dist/clients/review-graph/workspace-modules.js +10 -74
  210. package/node_modules/pi-lens/dist/clients/review-graph-logger.js +9 -3
  211. package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +18 -2
  212. package/node_modules/pi-lens/dist/clients/runtime-context.js +49 -16
  213. package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +25 -6
  214. package/node_modules/pi-lens/dist/clients/runtime-session.js +139 -22
  215. package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +168 -35
  216. package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +797 -243
  217. package/node_modules/pi-lens/dist/clients/runtime-turn.js +1028 -53
  218. package/node_modules/pi-lens/dist/clients/rust-client.js +31 -0
  219. package/node_modules/pi-lens/dist/clients/safe-spawn.js +33 -10
  220. package/node_modules/pi-lens/dist/clients/sanitize.js +7 -1
  221. package/node_modules/pi-lens/dist/clients/scratch-tree-policy.js +1 -3
  222. package/node_modules/pi-lens/dist/clients/security-scan-client.js +3 -0
  223. package/node_modules/pi-lens/dist/clients/session-lifecycle.js +1 -1
  224. package/node_modules/pi-lens/dist/clients/session-start-observability.js +79 -0
  225. package/node_modules/pi-lens/dist/clients/sessionstart-logger.js +12 -3
  226. package/node_modules/pi-lens/dist/clients/sgconfig.js +6 -1
  227. package/node_modules/pi-lens/dist/clients/skills-resolver.js +105 -0
  228. package/node_modules/pi-lens/dist/clients/smells-rollup.js +2 -2
  229. package/node_modules/pi-lens/dist/clients/string-utils.js +13 -0
  230. package/node_modules/pi-lens/dist/clients/subagent-mode.js +17 -4
  231. package/node_modules/pi-lens/dist/clients/test-runner-client.js +176 -39
  232. package/node_modules/pi-lens/dist/clients/test-runner-delivery.js +239 -0
  233. package/node_modules/pi-lens/dist/clients/tool-definition.js +41 -1
  234. package/node_modules/pi-lens/dist/clients/tool-policy.js +91 -21
  235. package/node_modules/pi-lens/dist/clients/tree-sitter-cache.js +40 -40
  236. package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +86 -48
  237. package/node_modules/pi-lens/dist/clients/tree-sitter-logger.js +2 -2
  238. package/node_modules/pi-lens/dist/clients/tree-sitter-query-loader.js +81 -1
  239. package/node_modules/pi-lens/dist/clients/tree-sitter-shared.js +51 -46
  240. package/node_modules/pi-lens/dist/clients/tree-sitter-symbol-extractor.js +28 -0
  241. package/node_modules/pi-lens/dist/clients/typos-config.js +5 -0
  242. package/node_modules/pi-lens/dist/clients/user-notify.js +6 -2
  243. package/node_modules/pi-lens/dist/clients/widget-state.js +191 -26
  244. package/node_modules/pi-lens/dist/clients/word-index-logger.js +2 -2
  245. package/node_modules/pi-lens/dist/clients/word-index-store.js +20 -5
  246. package/node_modules/pi-lens/dist/clients/word-index.js +243 -31
  247. package/node_modules/pi-lens/dist/clients/workspace-topology.js +8 -1
  248. package/node_modules/pi-lens/dist/clients/zizmor-config.js +3 -0
  249. package/node_modules/pi-lens/dist/index.js +64335 -54300
  250. package/node_modules/pi-lens/dist/mcp/analyze-cli.js +3 -1
  251. package/node_modules/pi-lens/dist/mcp/server.js +127 -5
  252. package/node_modules/pi-lens/dist/scripts/lib/process-scan.mjs +583 -0
  253. package/node_modules/pi-lens/dist/scripts/lib/skills-predicate.mjs +129 -0
  254. package/node_modules/pi-lens/dist/tools/effective-config.js +89 -0
  255. package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +95 -24
  256. package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +67 -80
  257. package/node_modules/pi-lens/dist/tools/lsp-navigation.js +37 -16
  258. package/node_modules/pi-lens/dist/tools/shared.js +0 -1
  259. package/node_modules/pi-lens/docs/agent-guide.md +64 -1
  260. package/node_modules/pi-lens/docs/configuration.md +222 -0
  261. package/node_modules/pi-lens/docs/dependencies.md +3 -3
  262. package/node_modules/pi-lens/docs/features.md +44 -5
  263. package/node_modules/pi-lens/docs/language-coverage.md +2 -2
  264. package/node_modules/pi-lens/docs/pi-lens-fixer.md +25 -0
  265. package/node_modules/pi-lens/docs/pi-lens-investigator.md +25 -0
  266. package/node_modules/pi-lens/docs/pi-lens-reviewer.md +27 -0
  267. package/node_modules/pi-lens/docs/pi-lens-subagent.md +38 -0
  268. package/node_modules/pi-lens/docs/pi-lens-warden.md +55 -0
  269. package/node_modules/pi-lens/docs/public-api-stability.md +359 -0
  270. package/node_modules/pi-lens/docs/release-qa-baseline.md +182 -0
  271. package/node_modules/pi-lens/docs/subagent-compat.md +110 -30
  272. package/node_modules/pi-lens/docs/tree-sitter_rules_catalog.md +2 -2
  273. package/node_modules/pi-lens/package.json +15 -23
  274. package/node_modules/pi-lens/rules/tree-sitter-queries/python/python-cross-language-method.yml +3 -3
  275. package/node_modules/pi-lens/rules/tree-sitter-queries/python/python-hallucinated-import.yml +2 -2
  276. package/node_modules/pi-lens/rules/tree-sitter-queries/python/python-sql-injection.yml +12 -2
  277. package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +192 -1
  278. package/node_modules/pi-lens/scripts/install-selftest.mjs +58 -2
  279. package/node_modules/pi-lens/scripts/lib/skills-predicate.mjs +129 -0
  280. package/node_modules/pi-lens/scripts/rpc-load-check.mjs +3 -1
  281. package/node_modules/pi-web-access/CHANGELOG.md +28 -0
  282. package/node_modules/pi-web-access/README.md +62 -15
  283. package/node_modules/pi-web-access/curator-page.ts +3 -1
  284. package/node_modules/pi-web-access/curator-server.ts +5 -1
  285. package/node_modules/pi-web-access/gemini-search.ts +8 -4
  286. package/node_modules/pi-web-access/github-extract.ts +242 -1
  287. package/node_modules/pi-web-access/index.ts +118 -64
  288. package/node_modules/pi-web-access/mistral-search.ts +281 -0
  289. package/node_modules/pi-web-access/package.json +2 -2
  290. package/node_modules/pi-web-access/perplexity.ts +14 -1
  291. package/node_modules/pi-web-access/utils.ts +23 -6
  292. package/node_modules/pi-web-access/xai-search.ts +96 -33
  293. package/package.json +5 -5
@@ -730,7 +730,7 @@ function retirePullSource(state, identifier) {
730
730
  for (const source of [state.pullResultIds, state.pullRequestSequences]) {
731
731
  if (!source)
732
732
  continue;
733
- for (const key of [...source.keys()]) {
733
+ for (const key of source.keys()) {
734
734
  if (key.endsWith(suffix))
735
735
  source.delete(key);
736
736
  }
@@ -947,7 +947,7 @@ function scanSentContent(content) {
947
947
  * read on the notification path (I1). Bounded by the same file-size gates the
948
948
  * caller already applies to the content it hands us.
949
949
  */
950
- function recordSentContent(state, normalizedPath, version, content) {
950
+ function recordSentContent(state, normalizedPath, version, content, coalescedCount = 0) {
951
951
  const scan = scanSentContent(content);
952
952
  const previous = state.documentContentHashes.get(normalizedPath);
953
953
  if (previous && previous.version > version) {
@@ -1049,6 +1049,7 @@ function recordSentContent(state, normalizedPath, version, content) {
1049
1049
  version,
1050
1050
  contentLength: content.length,
1051
1051
  contentLineCount: scan.lfNewlineCount + 1,
1052
+ ...(coalescedCount > 0 && { coalescedCount }),
1052
1053
  },
1053
1054
  });
1054
1055
  }
@@ -1423,14 +1424,33 @@ export function setupIncomingHandlers(state, initialization) {
1423
1424
  if (state.serverEditsAllowed <= 0 || !params?.edit) {
1424
1425
  return { applied: false, failureReason: "edit not solicited" };
1425
1426
  }
1426
- const context = (state.activeMutationDepth ?? 0) === 1
1427
- ? state.activeMutationContext
1428
- : undefined;
1427
+ // #2450 fix round 3 (F3) removed a `depth === 1` re-check here as
1428
+ // dead code. It is not dead — it moved to the WRITE side, where it
1429
+ // is the live invariant: `state.activeMutationContext` is assigned
1430
+ // only by `syncMutationContextSlot` (below in this file), which
1431
+ // populates it exactly when `activeMutationDepth === 1` and
1432
+ // empties it on every other frame transition. The depth test
1433
+ // therefore still runs, on each entry and each unwind; repeating
1434
+ // it here would be a second copy of the same predicate, not an
1435
+ // independent gate. What this handler reads is consequently either
1436
+ // the context of the single frame currently in flight or
1437
+ // `undefined` — never a settled frame's context, and never a
1438
+ // context belonging to some other window that is still open
1439
+ // (#2479 review rounds 2/3).
1440
+ const context = state.activeMutationContext;
1441
+ // `workspace/applyEdit` is only ever honored inside the
1442
+ // `serverEditsAllowed` window this handler just checked, which is
1443
+ // opened exclusively by an executeCommand call — so a fallback here is
1444
+ // always executeCommand-solicited, never a bare edit (#2450). This
1445
+ // fallback context carries no runtime/cacheManager (there is no live
1446
+ // reference to those singletons at this call site); lsp-mutation.ts's
1447
+ // bookkeepLspMutation falls back to the mutation bridge for exactly
1448
+ // that reason rather than silently dropping the write's bookkeeping.
1429
1449
  const telemetryContext = context ?? {
1430
1450
  cwd: state.root,
1431
1451
  correlationId: newLspMutationCorrelationId(),
1432
1452
  tool: "lsp-workspace-applyEdit",
1433
- source: "lsp-edit",
1453
+ source: "lsp-execute-command",
1434
1454
  };
1435
1455
  try {
1436
1456
  await applyWorkspaceEdit(params.edit, state.root, {
@@ -2430,7 +2450,7 @@ export function handleNotifyExternalChange(state, filePath, type) {
2430
2450
  const uri = state.openDocumentUris?.get(normalizedPath) ?? pathToFileURL(filePath).href;
2431
2451
  state.watchQueue.enqueue(uri, type);
2432
2452
  }
2433
- export async function handleNotifyOpen(state, filePath, content, languageId, preserveDiagnostics = false, silent = false) {
2453
+ async function handleNotifyOpenOnce(state, filePath, content, languageId, preserveDiagnostics = false, silent = false, coalescedCount = 0) {
2434
2454
  if (!isClientAlive(state))
2435
2455
  return;
2436
2456
  const normalizedPath = normalizeMapKey(filePath);
@@ -2478,7 +2498,7 @@ export async function handleNotifyOpen(state, filePath, content, languageId, pre
2478
2498
  // #1669 review F7: only mirror the send locally once it actually left
2479
2499
  // the process — see safeSendNotification's doc comment.
2480
2500
  if (reopenSent)
2481
- recordSentContent(state, normalizedPath, version, content);
2501
+ recordSentContent(state, normalizedPath, version, content, coalescedCount);
2482
2502
  state.openDocuments.add(normalizedPath);
2483
2503
  state.openDocumentUris?.set(normalizedPath, uri);
2484
2504
  return;
@@ -2488,7 +2508,7 @@ export async function handleNotifyOpen(state, filePath, content, languageId, pre
2488
2508
  contentChanges: buildContentChanges(state, normalizedPath, content),
2489
2509
  });
2490
2510
  if (changeSent)
2491
- recordSentContent(state, normalizedPath, version, content);
2511
+ recordSentContent(state, normalizedPath, version, content, coalescedCount);
2492
2512
  return;
2493
2513
  }
2494
2514
  state.pendingOpens.add(normalizedPath);
@@ -2523,7 +2543,7 @@ export async function handleNotifyOpen(state, filePath, content, languageId, pre
2523
2543
  return;
2524
2544
  const openSent = await safeSendNotification(state.connection, "textDocument/didOpen", { textDocument: { uri, languageId, version: 0, text: content } });
2525
2545
  if (openSent)
2526
- recordSentContent(state, normalizedPath, 0, content);
2546
+ recordSentContent(state, normalizedPath, 0, content, coalescedCount);
2527
2547
  state.pendingOpens.delete(normalizedPath);
2528
2548
  state.openDocuments.add(normalizedPath);
2529
2549
  state.closedDocuments?.delete(normalizedPath);
@@ -2547,7 +2567,81 @@ export async function handleNotifyOpen(state, filePath, content, languageId, pre
2547
2567
  },
2548
2568
  });
2549
2569
  }
2550
- async function handleNotifyChangeOnce(state, filePath, content, normalizedPath) {
2570
+ /**
2571
+ * Replace only notifications that have not started a transport write. A
2572
+ * microtask starts the first entry so a synchronous burst of callers installs
2573
+ * one latest entry before any bytes are handed to vscode-jsonrpc. Once an
2574
+ * entry starts, it runs to completion; LSP has no cancellation/acknowledgement
2575
+ * for notifications, so dropping a started write could violate didOpen before
2576
+ * didChange ordering or leave a partial message in the pipe.
2577
+ */
2578
+ function enqueueDocumentNotify(state, normalizedPath, run) {
2579
+ let queue = state.notifyChangeQueues.get(normalizedPath);
2580
+ if (!queue) {
2581
+ queue = { running: false };
2582
+ state.notifyChangeQueues.set(normalizedPath, queue);
2583
+ }
2584
+ return new Promise((resolve, reject) => {
2585
+ const previous = queue?.pending;
2586
+ // Keep superseded callers attached to the replacement's completion. The
2587
+ // notification is dropped, but callers such as the auxiliary backlog
2588
+ // ledger must not observe completion before the newest content is sent.
2589
+ const waiters = previous?.waiters ?? [];
2590
+ waiters.push({ resolve, reject });
2591
+ queue.pending = {
2592
+ run,
2593
+ waiters,
2594
+ coalescedCount: (previous?.coalescedCount ?? 0) + (previous ? 1 : 0),
2595
+ };
2596
+ if (queue.running)
2597
+ return;
2598
+ queue.running = true;
2599
+ // Let same-turn callers replace the unwritten entry before the runner
2600
+ // invokes the transport. Different path queues still start independently.
2601
+ void Promise.resolve().then(async () => {
2602
+ try {
2603
+ for (;;) {
2604
+ const next = queue.pending;
2605
+ if (!next)
2606
+ break;
2607
+ queue.pending = undefined;
2608
+ try {
2609
+ await next.run(next.coalescedCount);
2610
+ for (const waiter of next.waiters)
2611
+ waiter.resolve();
2612
+ }
2613
+ catch (error) {
2614
+ for (const waiter of next.waiters)
2615
+ waiter.reject(error);
2616
+ }
2617
+ }
2618
+ }
2619
+ finally {
2620
+ queue.running = false;
2621
+ if (!queue.pending &&
2622
+ state.notifyChangeQueues.get(normalizedPath) === queue) {
2623
+ state.notifyChangeQueues.delete(normalizedPath);
2624
+ }
2625
+ }
2626
+ });
2627
+ });
2628
+ }
2629
+ /** Drop unwritten document notifications when a client is torn down. */
2630
+ function cancelDocumentNotifyQueues(state) {
2631
+ for (const queue of state.notifyChangeQueues.values()) {
2632
+ for (const waiter of queue.pending?.waiters ?? [])
2633
+ waiter.resolve();
2634
+ queue.pending = undefined;
2635
+ }
2636
+ state.notifyChangeQueues.clear();
2637
+ }
2638
+ export function handleNotifyOpen(state, filePath, content, languageId, preserveDiagnostics = false, silent = false) {
2639
+ if (!isClientAlive(state))
2640
+ return Promise.resolve();
2641
+ const normalizedPath = normalizeMapKey(filePath);
2642
+ return enqueueDocumentNotify(state, normalizedPath, (coalescedCount) => handleNotifyOpenOnce(state, filePath, content, languageId, preserveDiagnostics, silent, coalescedCount));
2643
+ }
2644
+ async function handleNotifyChangeOnce(state, filePath, content, normalizedPath, coalescedCount = 0) {
2551
2645
  if (!isClientAlive(state))
2552
2646
  return;
2553
2647
  const uri = state.openDocumentUris?.get(normalizedPath) ?? pathToFileURL(filePath).href;
@@ -2566,7 +2660,7 @@ async function handleNotifyChangeOnce(state, filePath, content, normalizedPath)
2566
2660
  state.documentOpenedAt.set(normalizedPath, Date.now());
2567
2661
  state.diagnosticPublicationCounts.set(normalizedPath, 0);
2568
2662
  if (fallbackOpenSent)
2569
- recordSentContent(state, normalizedPath, 0, content);
2663
+ recordSentContent(state, normalizedPath, 0, content, coalescedCount);
2570
2664
  state.openDocuments.add(normalizedPath);
2571
2665
  state.openDocumentUris?.set(normalizedPath, uri);
2572
2666
  return;
@@ -2581,7 +2675,7 @@ async function handleNotifyChangeOnce(state, filePath, content, normalizedPath)
2581
2675
  contentChanges: buildContentChanges(state, normalizedPath, content),
2582
2676
  });
2583
2677
  if (changeSent)
2584
- recordSentContent(state, normalizedPath, version, content);
2678
+ recordSentContent(state, normalizedPath, version, content, coalescedCount);
2585
2679
  }
2586
2680
  /**
2587
2681
  * #2113: serialize the read/build/send/record transaction per document. The
@@ -2592,17 +2686,7 @@ export function handleNotifyChange(state, filePath, content) {
2592
2686
  if (!isClientAlive(state))
2593
2687
  return Promise.resolve();
2594
2688
  const normalizedPath = normalizeMapKey(filePath);
2595
- const previous = state.notifyChangeQueues.get(normalizedPath) ?? Promise.resolve();
2596
- const queued = previous
2597
- .catch(() => undefined)
2598
- .then(() => handleNotifyChangeOnce(state, filePath, content, normalizedPath));
2599
- const settled = queued.finally(() => {
2600
- if (state.notifyChangeQueues.get(normalizedPath) === settled) {
2601
- state.notifyChangeQueues.delete(normalizedPath);
2602
- }
2603
- });
2604
- state.notifyChangeQueues.set(normalizedPath, settled);
2605
- return settled;
2689
+ return enqueueDocumentNotify(state, normalizedPath, (coalescedCount) => handleNotifyChangeOnce(state, filePath, content, normalizedPath, coalescedCount));
2606
2690
  }
2607
2691
  /** Close a document through the same lifecycle path exposed by the client. */
2608
2692
  export async function closeDocument(state, filePath) {
@@ -2739,6 +2823,9 @@ async function clientShutdownOnce(state, options) {
2739
2823
  state.pendingOpens.clear();
2740
2824
  state.openDocuments.clear();
2741
2825
  state.openDocumentUris?.clear();
2826
+ // #2357: superseded notifications that have not started writing are moot
2827
+ // once this client is dead; resolve their callers and release the queue.
2828
+ cancelDocumentNotifyQueues(state);
2742
2829
  // #1412 L1: mirror openDocuments' clear — a shut-down/evicted client's
2743
2830
  // probe memo is moot along with everything else document-scoped.
2744
2831
  state.projectIdentityProbedFiles?.clear();
@@ -3183,6 +3270,35 @@ async function clientPingLiveness(state, timeoutMs = LIVENESS_PING_TIMEOUT_MS) {
3183
3270
  }
3184
3271
  return isClientAlive(state);
3185
3272
  }
3273
+ // #2479: `activeMutationContext` is DERIVED state, not a stack. The frame that
3274
+ // takes `activeMutationDepth` 0 -> 1 owns the context for its whole lifetime
3275
+ // (`mutationContextOwner`); the slot merely exposes that owner while it is the
3276
+ // ONLY frame in flight. Deeper or overlapping frames therefore empty the slot
3277
+ // for as long as they are open — concurrent and nested commands deliberately
3278
+ // do not cross-correlate — and it refills by itself when they unwind, with no
3279
+ // frame having to remember anything.
3280
+ //
3281
+ // Recomputing beats saving and restoring because these frames do not nest:
3282
+ // `LSPClient.executeCommand` and `LSPService.executeCommand` fan out with no
3283
+ // mutex, parallel `lsp_navigation` calls with `apply: true` overlap, and #449
3284
+ // light mode shares one client across agents. With A (the owner), B and C
3285
+ // overlapping and the MIDDLE one settling first, a per-frame restore hands A's
3286
+ // context back while C's window is the open one — and `LspMutationContext`
3287
+ // carries a cwd plus a directly-threaded runtime/cacheManager, with
3288
+ // `readTurnState` / `appendProjectChange` cwd-scoped, so that routes a live
3289
+ // edit's bookkeeping into another project's change log (strictly worse than
3290
+ // the honest fallback the pre-#2479 code gave). An owner-liveness flag does
3291
+ // not fix it either: it answers "is an owner live", not "does the slot belong
3292
+ // to the window this edit is in" — and C's own unwind then puts back the
3293
+ // `undefined` it saved while the owner is still running, resurrecting #2479
3294
+ // (review round 3). Deriving answers the second question by construction, and
3295
+ // "no command in flight == no context" — the invariant the
3296
+ // `serverEditsAllowed` gate on `workspace/applyEdit` is paired with — falls
3297
+ // out of it with no depth-0 special case.
3298
+ function syncMutationContextSlot(state) {
3299
+ state.activeMutationContext =
3300
+ state.activeMutationDepth === 1 ? state.mutationContextOwner : undefined;
3301
+ }
3186
3302
  // Run an advertised server command via workspace/executeCommand, with the
3187
3303
  // generous EXECUTE_COMMAND_TIMEOUT_MS anti-deadlock backstop. Preserves the
3188
3304
  // hardening invariants: allowlist-by-advertisement (only commands the server
@@ -3201,10 +3317,20 @@ export async function runServerCommand(state, command, args, timeoutMs = EXECUTE
3201
3317
  }
3202
3318
  state.serverEditsAllowed += 1;
3203
3319
  state.activeMutationDepth = (state.activeMutationDepth ?? 0) + 1;
3204
- if (state.activeMutationDepth === 1)
3205
- state.activeMutationContext = mutationContext;
3206
- else
3207
- state.activeMutationContext = undefined;
3320
+ // #2479: the frame that takes the depth to 1 owns the context; the slot is
3321
+ // derived from that owner (see `syncMutationContextSlot` above). The
3322
+ // pre-#2479 shape only ever CLEARED the slot, and only once the depth
3323
+ // returned to 0, so a nested `executeCommand` unwinding from depth 2 back
3324
+ // to 1 left the OUTER call without its own context for the rest of its
3325
+ // window: every server-initiated `applyEdit` it still solicited read
3326
+ // `undefined`, fell to the mutation bridge, and carried the generic
3327
+ // `agent-tool:lsp-workspace-applyEdit` receipt instead of the outer
3328
+ // operation's own (`lsp-rename` / `lsp-execute-command`).
3329
+ const isMutationContextOwner = state.activeMutationDepth === 1;
3330
+ if (isMutationContextOwner) {
3331
+ state.mutationContextOwner = mutationContext;
3332
+ }
3333
+ syncMutationContextSlot(state);
3208
3334
  try {
3209
3335
  let result;
3210
3336
  try {
@@ -3231,8 +3357,15 @@ export async function runServerCommand(state, command, args, timeoutMs = EXECUTE
3231
3357
  finally {
3232
3358
  state.serverEditsAllowed -= 1;
3233
3359
  state.activeMutationDepth = Math.max(0, (state.activeMutationDepth ?? 0) - 1);
3234
- if (state.activeMutationDepth === 0)
3235
- state.activeMutationContext = undefined;
3360
+ // The owner drops its context; every frame then resyncs. Both the
3361
+ // hand-back to a still-live owner once the deeper frames unwind and
3362
+ // the empty slot while more than one frame is open are consequences of
3363
+ // the derivation, not separate rules each frame has to get right
3364
+ // (#2479 review rounds 2/3).
3365
+ if (isMutationContextOwner) {
3366
+ state.mutationContextOwner = undefined;
3367
+ }
3368
+ syncMutationContextSlot(state);
3236
3369
  }
3237
3370
  }
3238
3371
  // #1412 H1/H2: read-only sibling of runServerCommand for telemetry/identity
@@ -3694,6 +3827,8 @@ export async function createLSPClient(options) {
3694
3827
  checkAlive: () => checkProcessAlive(),
3695
3828
  /** #1277: cheap request round-trip proving the server still responds. */
3696
3829
  pingLiveness: (timeoutMs) => clientPingLiveness(state, timeoutMs),
3830
+ /** #2358: the OS pid of the live server process (see interface doc). */
3831
+ getProcessPid: () => lspProcess.pid,
3697
3832
  notify: {
3698
3833
  async open(filePath, content, languageId, preserveDiagnostics, silent) {
3699
3834
  return handleNotifyOpen(state, filePath, content, languageId, preserveDiagnostics, silent);
@@ -3842,6 +3977,9 @@ export async function createLSPClient(options) {
3842
3977
  isDocumentOpen(filePath) {
3843
3978
  return state.openDocuments.has(normalizeMapKey(filePath));
3844
3979
  },
3980
+ openDocumentPaths() {
3981
+ return [...state.openDocuments];
3982
+ },
3845
3983
  isBusy() {
3846
3984
  return (activeRequestsByConnection.get(connection) ?? 0) > 0;
3847
3985
  },