@herbertgao/pi-extensions 2026.8.11 → 2026.8.13

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 (476) hide show
  1. package/README.md +23 -10
  2. package/{node_modules/@herbertgao/pi-mermaid-open/LICENSE → THIRD_PARTY_NOTICES.md} +19 -1
  3. package/node_modules/@czottmann/pi-automode/CHANGELOG.md +15 -0
  4. package/node_modules/@czottmann/pi-automode/README.md +5 -3
  5. package/node_modules/@czottmann/pi-automode/docs/adr/ADR-001-permission-precedence-and-trust-boundaries.md +2 -0
  6. package/node_modules/@czottmann/pi-automode/docs/adr/ADR-002-global-config-in-extension-data-directory.md +60 -0
  7. package/node_modules/@czottmann/pi-automode/docs/adr/INDEX.md +1 -0
  8. package/node_modules/@czottmann/pi-automode/docs/automode-classifier-flow.md +4 -4
  9. package/node_modules/@czottmann/pi-automode/docs/configuration.md +20 -4
  10. package/node_modules/@czottmann/pi-automode/docs/observability-logging.md +1 -1
  11. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/bash.ts +692 -0
  12. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/config.ts +181 -3
  13. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/constants.ts +4 -1
  14. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/extension.ts +143 -36
  15. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/hard-deny.ts +103 -148
  16. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/paths.ts +32 -6
  17. package/node_modules/@czottmann/pi-automode/extensions/auto-mode/permissions.ts +344 -22
  18. package/node_modules/@czottmann/pi-automode/extensions/auto-mode.ts +1 -0
  19. package/node_modules/@czottmann/pi-automode/package.json +4 -1
  20. package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +2 -1
  21. package/node_modules/@herbertgao/pi-cc-extensions/README.md +2 -1
  22. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +4 -0
  23. package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +21 -1
  24. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/agent-summary/core.ts +1 -1
  25. package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/context.ts +19 -19
  26. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +4 -2
  27. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +2 -1
  28. package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/grouping.ts +10 -2
  29. package/node_modules/@herbertgao/pi-cc-extensions/package.json +3 -3
  30. package/node_modules/@herbertgao/pi-subagents/CHANGELOG.md +10 -0
  31. package/node_modules/@herbertgao/pi-subagents/README.md +21 -15
  32. package/node_modules/@herbertgao/pi-subagents/package.json +3 -3
  33. package/node_modules/@herbertgao/pi-subagents/src/agent-file-toggle.ts +11 -8
  34. package/node_modules/@herbertgao/pi-subagents/src/agent-manager.ts +184 -106
  35. package/node_modules/@herbertgao/pi-subagents/src/cross-extension-rpc.ts +31 -11
  36. package/node_modules/@herbertgao/pi-subagents/src/custom-agents.ts +9 -1
  37. package/node_modules/@herbertgao/pi-subagents/src/index.ts +156 -31
  38. package/node_modules/@herbertgao/pi-subagents/src/invocation-config.ts +17 -0
  39. package/node_modules/@herbertgao/pi-subagents/src/model-resolver.ts +14 -0
  40. package/node_modules/@herbertgao/pi-subagents/src/schedule.ts +8 -0
  41. package/node_modules/@herbertgao/pi-subagents/src/settings.ts +32 -1
  42. package/node_modules/@herbertgao/pi-subagents/src/types.ts +17 -2
  43. package/node_modules/@herbertgao/pi-subagents/src/ui/agent-widget.ts +23 -2
  44. package/node_modules/@herbertgao/pi-subagents/src/ui/conversation-viewer.ts +259 -24
  45. package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +2 -2
  46. package/node_modules/@luxusai/pi-hindsight/CHANGELOG.md +376 -0
  47. package/node_modules/@luxusai/pi-hindsight/README.md +92 -0
  48. package/node_modules/@luxusai/pi-hindsight/docs/adr/001-memory-lifecycle-and-scope.md +56 -0
  49. package/node_modules/@luxusai/pi-hindsight/docs/adr/002-explicit-routing-strategy-seam.md +169 -0
  50. package/node_modules/@luxusai/pi-hindsight/docs/adr/003-tui-memory-mode-vocabulary.md +107 -0
  51. package/node_modules/@luxusai/pi-hindsight/docs/adr/004-lifeos-dual-bank-design.md +89 -0
  52. package/node_modules/@luxusai/pi-hindsight/docs/adr/005-domain-banks-and-agent-first-surface.md +189 -0
  53. package/node_modules/@luxusai/pi-hindsight/docs/assets/logos/pi-hindsight-logo-dark.webp +0 -0
  54. package/node_modules/@luxusai/pi-hindsight/docs/assets/logos/pi-hindsight-logo-dark@2x.webp +0 -0
  55. package/node_modules/@luxusai/pi-hindsight/docs/coding-memory-evaluation.md +54 -0
  56. package/node_modules/@luxusai/pi-hindsight/docs/compatibility.md +75 -0
  57. package/node_modules/@luxusai/pi-hindsight/docs/hindsight-core-functions.md +300 -0
  58. package/node_modules/@luxusai/pi-hindsight/docs/mission-and-mental-model-quality.md +158 -0
  59. package/node_modules/@luxusai/pi-hindsight/docs/next-opt-out-design.md +164 -0
  60. package/node_modules/@luxusai/pi-hindsight/docs/risky-memory-modes.md +139 -0
  61. package/node_modules/@luxusai/pi-hindsight/docs/starter-mental-model-suggestions.md +74 -0
  62. package/node_modules/@luxusai/pi-hindsight/docs/surface-reference.md +261 -0
  63. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-operations.ts +151 -0
  64. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-selection.ts +18 -0
  65. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-settings-presenter.ts +46 -0
  66. package/node_modules/@luxusai/pi-hindsight/extensions/banks/bank-templates.ts +383 -0
  67. package/node_modules/@luxusai/pi-hindsight/extensions/banks/banking.ts +240 -0
  68. package/node_modules/@luxusai/pi-hindsight/extensions/banks/knowledge-page-seed.ts +176 -0
  69. package/node_modules/@luxusai/pi-hindsight/extensions/banks/retain-strategies.ts +178 -0
  70. package/node_modules/@luxusai/pi-hindsight/extensions/client/client-retry.ts +41 -0
  71. package/node_modules/@luxusai/pi-hindsight/extensions/client/client.ts +386 -0
  72. package/node_modules/@luxusai/pi-hindsight/extensions/client/fetch-compat.ts +39 -0
  73. package/node_modules/@luxusai/pi-hindsight/extensions/client/timeout.ts +34 -0
  74. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-defaults.ts +140 -0
  75. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-editing-model.ts +61 -0
  76. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-editing-registry.ts +925 -0
  77. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-field-paths.ts +247 -0
  78. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-normalize.ts +547 -0
  79. package/node_modules/@luxusai/pi-hindsight/extensions/config/config-writer.ts +480 -0
  80. package/node_modules/@luxusai/pi-hindsight/extensions/config/config.ts +182 -0
  81. package/node_modules/@luxusai/pi-hindsight/extensions/config/setup-gate.ts +86 -0
  82. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-execute.ts +1010 -0
  83. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-parse.ts +175 -0
  84. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-plan.ts +425 -0
  85. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-presentation.ts +210 -0
  86. package/node_modules/@luxusai/pi-hindsight/extensions/imports/import-sessions.ts +817 -0
  87. package/node_modules/@luxusai/pi-hindsight/extensions/index.ts +25 -0
  88. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/git-seed.ts +319 -0
  89. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-recall.ts +196 -0
  90. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-retain.ts +189 -0
  91. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle-runtime.ts +65 -0
  92. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/memory-lifecycle.ts +260 -0
  93. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/mental-models.ts +244 -0
  94. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/observation-scopes.ts +59 -0
  95. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall-cleanup.ts +82 -0
  96. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall-visibility.ts +45 -0
  97. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/recall.ts +331 -0
  98. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-cursor.ts +354 -0
  99. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-job-builder.ts +66 -0
  100. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain-receipts.ts +132 -0
  101. package/node_modules/@luxusai/pi-hindsight/extensions/lifecycle/retain.ts +228 -0
  102. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-bank-template-operations.ts +74 -0
  103. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-config-operations.ts +16 -0
  104. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-control-operations.ts +648 -0
  105. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-diagnostics-operations.ts +105 -0
  106. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-identity.ts +68 -0
  107. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-operation-service.ts +71 -0
  108. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-operation-types.ts +13 -0
  109. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-recall-operations.ts +162 -0
  110. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-retain-operations.ts +131 -0
  111. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-scope.ts +104 -0
  112. package/node_modules/@luxusai/pi-hindsight/extensions/operations/memory-session-operations.ts +37 -0
  113. package/node_modules/@luxusai/pi-hindsight/extensions/operations/operation-catalog.ts +893 -0
  114. package/node_modules/@luxusai/pi-hindsight/extensions/operations/reflect-presenter.ts +35 -0
  115. package/node_modules/@luxusai/pi-hindsight/extensions/operations/scope-migrate.ts +177 -0
  116. package/node_modules/@luxusai/pi-hindsight/extensions/operations/tools.ts +7 -0
  117. package/node_modules/@luxusai/pi-hindsight/extensions/queue/flush-presenter.ts +21 -0
  118. package/node_modules/@luxusai/pi-hindsight/extensions/queue/jsonl-queue-store.ts +112 -0
  119. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-delivery.ts +111 -0
  120. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-lock.ts +214 -0
  121. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue-operations.ts +70 -0
  122. package/node_modules/@luxusai/pi-hindsight/extensions/queue/queue.ts +392 -0
  123. package/node_modules/@luxusai/pi-hindsight/extensions/tui/bank-template-presentation.ts +45 -0
  124. package/node_modules/@luxusai/pi-hindsight/extensions/tui/commands.ts +9 -0
  125. package/node_modules/@luxusai/pi-hindsight/extensions/tui/guided-setup.ts +860 -0
  126. package/node_modules/@luxusai/pi-hindsight/extensions/tui/prefill-input.ts +105 -0
  127. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-flow.ts +189 -0
  128. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-server-probe.ts +299 -0
  129. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-actions.ts +201 -0
  130. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-facts.ts +47 -0
  131. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-render.ts +239 -0
  132. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui-types.ts +50 -0
  133. package/node_modules/@luxusai/pi-hindsight/extensions/tui/setup-tui.ts +259 -0
  134. package/node_modules/@luxusai/pi-hindsight/extensions/tui/tool-presenters.ts +77 -0
  135. package/node_modules/@luxusai/pi-hindsight/extensions/types.ts +534 -0
  136. package/node_modules/@luxusai/pi-hindsight/extensions/utils/diagnostics.ts +319 -0
  137. package/node_modules/@luxusai/pi-hindsight/extensions/utils/messages.ts +325 -0
  138. package/node_modules/@luxusai/pi-hindsight/extensions/utils/sanitize.ts +42 -0
  139. package/node_modules/@luxusai/pi-hindsight/extensions/utils/session-memory-meta.ts +244 -0
  140. package/node_modules/@luxusai/pi-hindsight/extensions/utils/session-operations.ts +56 -0
  141. package/node_modules/@luxusai/pi-hindsight/extensions/utils/session.ts +50 -0
  142. package/node_modules/@luxusai/pi-hindsight/extensions/utils/status-fields.ts +167 -0
  143. package/node_modules/@luxusai/pi-hindsight/extensions/utils/status-health.ts +207 -0
  144. package/node_modules/@luxusai/pi-hindsight/extensions/utils/status.ts +120 -0
  145. package/node_modules/@luxusai/pi-hindsight/extensions/version.ts +8 -0
  146. package/node_modules/@luxusai/pi-hindsight/package.json +118 -0
  147. package/node_modules/@luxusai/pi-hindsight/skills/hindsight-memory-doctor/SKILL.md +75 -0
  148. package/node_modules/@narumitw/pi-btw/dist/index.ts +143 -46
  149. package/node_modules/@narumitw/pi-btw/dist/index.ts.map +3 -3
  150. package/node_modules/@narumitw/pi-btw/package.json +6 -6
  151. package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +136 -22
  152. package/node_modules/{@herbertgao → @tifan}/pi-copy-response/README.md +2 -4
  153. package/node_modules/{@herbertgao → @tifan}/pi-copy-response/package.json +5 -15
  154. package/node_modules/{@herbertgao → @tifan}/pi-handoff/README.md +4 -6
  155. package/node_modules/@tifan/pi-handoff/package.json +43 -0
  156. package/node_modules/{@herbertgao → @tifan}/pi-handoff/src/index.ts +1 -1
  157. package/node_modules/{@herbertgao → @tifan}/pi-inline-skills/README.md +2 -4
  158. package/node_modules/{@herbertgao → @tifan}/pi-inline-skills/package.json +5 -15
  159. package/node_modules/{@herbertgao → @tifan}/pi-mermaid-open/README.md +5 -7
  160. package/node_modules/{@herbertgao → @tifan}/pi-mermaid-open/package.json +5 -19
  161. package/node_modules/{@herbertgao → @tifan}/pi-preferred-thinking/README.md +4 -6
  162. package/node_modules/{@herbertgao → @tifan}/pi-preferred-thinking/package.json +6 -16
  163. package/node_modules/{@herbertgao → @tifan}/pi-preferred-thinking/src/index.ts +1 -6
  164. package/node_modules/{@herbertgao → @tifan}/pi-recap/README.md +4 -6
  165. package/node_modules/@tifan/pi-recap/package.json +42 -0
  166. package/node_modules/{@herbertgao → @tifan}/pi-recap/src/models.ts +1 -6
  167. package/node_modules/{@herbertgao → @tifan}/pi-rename/README.md +13 -8
  168. package/node_modules/@tifan/pi-rename/package.json +47 -0
  169. package/node_modules/@tifan/pi-rename/src/herdr-label.ts +4 -0
  170. package/node_modules/{@herbertgao → @tifan}/pi-rename/src/index.ts +4 -16
  171. package/node_modules/{@herbertgao → @tifan}/pi-rename/src/models.ts +1 -6
  172. package/node_modules/{@herbertgao → @tifan}/pi-titlebar-spinner/README.md +2 -4
  173. package/node_modules/{@herbertgao → @tifan}/pi-titlebar-spinner/package.json +5 -15
  174. package/node_modules/pi-lens/CHANGELOG.md +96 -1
  175. package/node_modules/pi-lens/dist/clients/actionable-warnings-logger.js +2 -1
  176. package/node_modules/pi-lens/dist/clients/actionable-warnings.js +14 -5
  177. package/node_modules/pi-lens/dist/clients/advisory-provenance.js +48 -18
  178. package/node_modules/pi-lens/dist/clients/ast-grep-client.js +1 -3
  179. package/node_modules/pi-lens/dist/clients/atomic-write-staging.js +16 -4
  180. package/node_modules/pi-lens/dist/clients/bash-file-access.js +3 -1
  181. package/node_modules/pi-lens/dist/clients/biome-client.js +1 -3
  182. package/node_modules/pi-lens/dist/clients/blocker-freshness.js +21 -8
  183. package/node_modules/pi-lens/dist/clients/bounded-cache.js +24 -8
  184. package/node_modules/pi-lens/dist/clients/bounded-pid-file-lock.js +4 -3
  185. package/node_modules/pi-lens/dist/clients/cache-manager.js +6 -7
  186. package/node_modules/pi-lens/dist/clients/cache-observability.js +461 -66
  187. package/node_modules/pi-lens/dist/clients/call-graph.js +238 -63
  188. package/node_modules/pi-lens/dist/clients/codebase-model.js +13 -5
  189. package/node_modules/pi-lens/dist/clients/complexity-client.js +1 -3
  190. package/node_modules/pi-lens/dist/clients/dead-code-client.js +19 -8
  191. package/node_modules/pi-lens/dist/clients/dead-code-logger.js +1 -2
  192. package/node_modules/pi-lens/dist/clients/deadline-utils.js +3 -1
  193. package/node_modules/pi-lens/dist/clients/debug-heap.js +8 -1
  194. package/node_modules/pi-lens/dist/clients/degradation-ledger.js +1 -1
  195. package/node_modules/pi-lens/dist/clients/dependency-checker.js +11 -7
  196. package/node_modules/pi-lens/dist/clients/diagnostic-dispositions.js +39 -2
  197. package/node_modules/pi-lens/dist/clients/diagnostic-line-freshness.js +5 -1
  198. package/node_modules/pi-lens/dist/clients/dispatch/auxiliary-lsp.js +2 -3
  199. package/node_modules/pi-lens/dist/clients/dispatch/dispatcher.js +13 -1
  200. package/node_modules/pi-lens/dist/clients/dispatch/facts/function-facts.js +3 -1
  201. package/node_modules/pi-lens/dist/clients/dispatch/facts/import-facts.js +2 -1
  202. package/node_modules/pi-lens/dist/clients/dispatch/facts/tree-sitter-facts.js +1 -1
  203. package/node_modules/pi-lens/dist/clients/dispatch/integration.js +9 -4
  204. package/node_modules/pi-lens/dist/clients/dispatch/rules/error-swallowing.js +3 -1
  205. package/node_modules/pi-lens/dist/clients/dispatch/rules/pass-through-wrappers.js +6 -2
  206. package/node_modules/pi-lens/dist/clients/dispatch/rules/unsafe-boundary.js +31 -7
  207. package/node_modules/pi-lens/dist/clients/dispatch/runners/actionlint.js +5 -2
  208. package/node_modules/pi-lens/dist/clients/dispatch/runners/biome-check.js +10 -14
  209. package/node_modules/pi-lens/dist/clients/dispatch/runners/cpp-check.js +5 -1
  210. package/node_modules/pi-lens/dist/clients/dispatch/runners/dotnet-build.js +1 -1
  211. package/node_modules/pi-lens/dist/clients/dispatch/runners/elixir-check.js +3 -1
  212. package/node_modules/pi-lens/dist/clients/dispatch/runners/eslint.js +25 -6
  213. package/node_modules/pi-lens/dist/clients/dispatch/runners/fish-indent.js +1 -1
  214. package/node_modules/pi-lens/dist/clients/dispatch/runners/gleam-check.js +1 -1
  215. package/node_modules/pi-lens/dist/clients/dispatch/runners/golangci-lint.js +3 -1
  216. package/node_modules/pi-lens/dist/clients/dispatch/runners/hadolint.js +13 -8
  217. package/node_modules/pi-lens/dist/clients/dispatch/runners/helm-lint.js +4 -1
  218. package/node_modules/pi-lens/dist/clients/dispatch/runners/htmlhint.js +25 -10
  219. package/node_modules/pi-lens/dist/clients/dispatch/runners/javac.js +1 -1
  220. package/node_modules/pi-lens/dist/clients/dispatch/runners/ktlint.js +1 -1
  221. package/node_modules/pi-lens/dist/clients/dispatch/runners/lsp.js +1 -1
  222. package/node_modules/pi-lens/dist/clients/dispatch/runners/markdownlint.js +28 -4
  223. package/node_modules/pi-lens/dist/clients/dispatch/runners/mypy.js +6 -8
  224. package/node_modules/pi-lens/dist/clients/dispatch/runners/oxlint.js +212 -11
  225. package/node_modules/pi-lens/dist/clients/dispatch/runners/php-lint.js +1 -1
  226. package/node_modules/pi-lens/dist/clients/dispatch/runners/phpstan.js +8 -4
  227. package/node_modules/pi-lens/dist/clients/dispatch/runners/psscriptanalyzer.js +10 -6
  228. package/node_modules/pi-lens/dist/clients/dispatch/runners/pyright.js +23 -14
  229. package/node_modules/pi-lens/dist/clients/dispatch/runners/rust-clippy.js +1 -1
  230. package/node_modules/pi-lens/dist/clients/dispatch/runners/shellcheck.js +7 -9
  231. package/node_modules/pi-lens/dist/clients/dispatch/runners/shfmt.js +5 -2
  232. package/node_modules/pi-lens/dist/clients/dispatch/runners/sqlfluff.js +7 -7
  233. package/node_modules/pi-lens/dist/clients/dispatch/runners/stylelint.js +6 -8
  234. package/node_modules/pi-lens/dist/clients/dispatch/runners/terragrunt.js +13 -8
  235. package/node_modules/pi-lens/dist/clients/dispatch/runners/tflint.js +13 -8
  236. package/node_modules/pi-lens/dist/clients/dispatch/runners/tree-sitter.js +17 -3
  237. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/candidate-probe.js +7 -1
  238. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/runner-helpers.js +24 -1
  239. package/node_modules/pi-lens/dist/clients/dispatch/runners/utils/tool-failure.js +35 -0
  240. package/node_modules/pi-lens/dist/clients/dispatch/runners/yaml-rule-parser.js +1 -3
  241. package/node_modules/pi-lens/dist/clients/dispatch/runners/yamllint.js +6 -8
  242. package/node_modules/pi-lens/dist/clients/dispatch/runners/zig-check.js +1 -1
  243. package/node_modules/pi-lens/dist/clients/dispatch/suppress-writer.js +2 -1
  244. package/node_modules/pi-lens/dist/clients/dispatch/types.js +6 -1
  245. package/node_modules/pi-lens/dist/clients/dispatch/utils/lsp-diagnostics.js +6 -2
  246. package/node_modules/pi-lens/dist/clients/extension-log.js +5 -3
  247. package/node_modules/pi-lens/dist/clients/feature-hints.js +8 -1
  248. package/node_modules/pi-lens/dist/clients/file-kinds.js +34 -129
  249. package/node_modules/pi-lens/dist/clients/file-utils.js +17 -1
  250. package/node_modules/pi-lens/dist/clients/finding-delivery-gate.js +57 -2
  251. package/node_modules/pi-lens/dist/clients/formatters.js +144 -27
  252. package/node_modules/pi-lens/dist/clients/freshness.js +38 -0
  253. package/node_modules/pi-lens/dist/clients/git-guard.js +43 -13
  254. package/node_modules/pi-lens/dist/clients/go-client.js +1 -3
  255. package/node_modules/pi-lens/dist/clients/grammar-source.js +1 -1
  256. package/node_modules/pi-lens/dist/clients/gzip-stage-write.js +30 -4
  257. package/node_modules/pi-lens/dist/clients/host-edit-normalize.js +1 -3
  258. package/node_modules/pi-lens/dist/clients/install-diagnostics.js +4 -2
  259. package/node_modules/pi-lens/dist/clients/installer/index.js +86 -77
  260. package/node_modules/pi-lens/dist/clients/instance-reaper.js +5 -2
  261. package/node_modules/pi-lens/dist/clients/instance-registry.js +4 -2
  262. package/node_modules/pi-lens/dist/clients/jscpd-client.js +6 -1
  263. package/node_modules/pi-lens/dist/clients/knip-client.js +29 -15
  264. package/node_modules/pi-lens/dist/clients/language-profile.js +4 -1
  265. package/node_modules/pi-lens/dist/clients/latency-logger.js +13 -2
  266. package/node_modules/pi-lens/dist/clients/lens-config.js +1 -1
  267. package/node_modules/pi-lens/dist/clients/lens-map.js +8 -3
  268. package/node_modules/pi-lens/dist/clients/live-bus-emitter.js +1 -1
  269. package/node_modules/pi-lens/dist/clients/lsp/config.js +4 -6
  270. package/node_modules/pi-lens/dist/clients/lsp/edits.js +119 -32
  271. package/node_modules/pi-lens/dist/clients/lsp/index.js +94 -35
  272. package/node_modules/pi-lens/dist/clients/lsp/inferred-project.js +2 -1
  273. package/node_modules/pi-lens/dist/clients/lsp/jvm-runtime.js +4 -1
  274. package/node_modules/pi-lens/dist/clients/lsp/launch.js +11 -3
  275. package/node_modules/pi-lens/dist/clients/lsp/pending-aux-coverage.js +152 -0
  276. package/node_modules/pi-lens/dist/clients/lsp/server.js +19 -7
  277. package/node_modules/pi-lens/dist/clients/lsp/tsserver-sync.js +10 -2
  278. package/node_modules/pi-lens/dist/clients/lsp/workspace-diagnostics-cache.js +9 -4
  279. package/node_modules/pi-lens/dist/clients/lsp-document-symbols.js +1 -3
  280. package/node_modules/pi-lens/dist/clients/lsp-mutation.js +10 -20
  281. package/node_modules/pi-lens/dist/clients/mcp/host-shim.js +1 -1
  282. package/node_modules/pi-lens/dist/clients/memory-sampler.js +73 -7
  283. package/node_modules/pi-lens/dist/clients/metrics-client.js +1 -3
  284. package/node_modules/pi-lens/dist/clients/middle-man-analysis.js +8 -3
  285. package/node_modules/pi-lens/dist/clients/module-report-lsp.js +7 -1
  286. package/node_modules/pi-lens/dist/clients/module-report.js +14 -17
  287. package/node_modules/pi-lens/dist/clients/ndjson-logger.js +3 -5
  288. package/node_modules/pi-lens/dist/clients/opaque-mutation-scan.js +220 -0
  289. package/node_modules/pi-lens/dist/clients/package-manager.js +6 -1
  290. package/node_modules/pi-lens/dist/clients/pipeline.js +57 -9
  291. package/node_modules/pi-lens/dist/clients/project-conventions.js +2 -8
  292. package/node_modules/pi-lens/dist/clients/project-diagnostics/cache.js +10 -7
  293. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/call-graph-impact.js +2 -1
  294. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/gitleaks.js +3 -1
  295. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/runner-findings.js +13 -9
  296. package/node_modules/pi-lens/dist/clients/project-diagnostics/runner-adapters/trivy.js +3 -1
  297. package/node_modules/pi-lens/dist/clients/project-diagnostics/scanner.js +5 -2
  298. package/node_modules/pi-lens/dist/clients/project-lens-config.js +12 -5
  299. package/node_modules/pi-lens/dist/clients/project-snapshot-fingerprint.js +48 -0
  300. package/node_modules/pi-lens/dist/clients/project-snapshot-persist-worker.js +15 -1
  301. package/node_modules/pi-lens/dist/clients/project-snapshot.js +472 -66
  302. package/node_modules/pi-lens/dist/clients/read-expansion.js +12 -2
  303. package/node_modules/pi-lens/dist/clients/read-guard-logger.js +5 -4
  304. package/node_modules/pi-lens/dist/clients/read-guard-tool-lines.js +5 -2
  305. package/node_modules/pi-lens/dist/clients/read-guard.js +1 -1
  306. package/node_modules/pi-lens/dist/clients/resource-sampler.js +1 -1
  307. package/node_modules/pi-lens/dist/clients/reverse-deps.js +6 -5
  308. package/node_modules/pi-lens/dist/clients/review-graph/builder.js +42 -17
  309. package/node_modules/pi-lens/dist/clients/review-graph/git-identity.js +8 -2
  310. package/node_modules/pi-lens/dist/clients/review-graph/import-resolvers.js +10 -1
  311. package/node_modules/pi-lens/dist/clients/review-graph/query.js +2 -1
  312. package/node_modules/pi-lens/dist/clients/review-graph/tsconfig-paths.js +4 -2
  313. package/node_modules/pi-lens/dist/clients/review-graph/workspace-modules.js +2 -2
  314. package/node_modules/pi-lens/dist/clients/ruff-client.js +6 -5
  315. package/node_modules/pi-lens/dist/clients/runtime-agent-end.js +63 -31
  316. package/node_modules/pi-lens/dist/clients/runtime-context.js +12 -4
  317. package/node_modules/pi-lens/dist/clients/runtime-coordinator.js +83 -4
  318. package/node_modules/pi-lens/dist/clients/runtime-session.js +14 -0
  319. package/node_modules/pi-lens/dist/clients/runtime-tool-call.js +59 -3
  320. package/node_modules/pi-lens/dist/clients/runtime-tool-result.js +148 -34
  321. package/node_modules/pi-lens/dist/clients/runtime-turn.js +147 -6
  322. package/node_modules/pi-lens/dist/clients/rust-client.js +1 -3
  323. package/node_modules/pi-lens/dist/clients/safe-spawn.js +150 -11
  324. package/node_modules/pi-lens/dist/clients/security-scan-client.js +1 -3
  325. package/node_modules/pi-lens/dist/clients/session-summary.js +3 -1
  326. package/node_modules/pi-lens/dist/clients/sg-runner.js +1 -3
  327. package/node_modules/pi-lens/dist/clients/source-filter.js +10 -6
  328. package/node_modules/pi-lens/dist/clients/source-walker.js +1 -1
  329. package/node_modules/pi-lens/dist/clients/spawn-timeout-cooldown.js +96 -0
  330. package/node_modules/pi-lens/dist/clients/startup-scan.js +4 -1
  331. package/node_modules/pi-lens/dist/clients/tool-definition.js +7 -0
  332. package/node_modules/pi-lens/dist/clients/tool-policy.js +26 -11
  333. package/node_modules/pi-lens/dist/clients/tool-render.js +2 -1
  334. package/node_modules/pi-lens/dist/clients/tree-sitter-client.js +10 -4
  335. package/node_modules/pi-lens/dist/clients/tree-sitter-logger.js +2 -2
  336. package/node_modules/pi-lens/dist/clients/tree-sitter-symbol-extractor.js +12 -5
  337. package/node_modules/pi-lens/dist/clients/warm-attach.js +12 -5
  338. package/node_modules/pi-lens/dist/clients/widget-state.js +27 -11
  339. package/node_modules/pi-lens/dist/clients/word-index.js +3 -1
  340. package/node_modules/pi-lens/dist/clients/workspace-topology.js +8 -2
  341. package/node_modules/pi-lens/dist/clients/zizmor-config.js +9 -1
  342. package/node_modules/pi-lens/dist/i18n.js +13 -5
  343. package/node_modules/pi-lens/dist/index.js +10797 -8627
  344. package/node_modules/pi-lens/dist/mcp/server.js +3 -1
  345. package/node_modules/pi-lens/dist/tools/ast-grep-replace.js +68 -12
  346. package/node_modules/pi-lens/dist/tools/lens-diagnostic-mark.js +21 -7
  347. package/node_modules/pi-lens/dist/tools/lens-diagnostics.js +164 -35
  348. package/node_modules/pi-lens/dist/tools/lsp-diagnostics.js +24 -7
  349. package/node_modules/pi-lens/dist/tools/lsp-navigation.js +3 -1
  350. package/node_modules/pi-lens/dist/tools/module-report.js +1 -1
  351. package/node_modules/pi-lens/dist/tools/project-report.js +1 -1
  352. package/node_modules/pi-lens/dist/tools/symbol-search.js +5 -2
  353. package/node_modules/pi-lens/docs/durable-store-audit-1202.md +1 -1
  354. package/node_modules/pi-lens/docs/servercapabilities.md +1 -1
  355. package/node_modules/pi-lens/package.json +160 -156
  356. package/node_modules/pi-lens/rules/typos/_typos.toml +2 -2
  357. package/node_modules/pi-lens/scripts/analyze-pi-lens-logs.mjs +31 -13
  358. package/node_modules/pi-lens/scripts/download-grammars.js +9 -3
  359. package/node_modules/pi-lens/scripts/rpc-load-check.mjs +30 -9
  360. package/node_modules/pi-mcp-adapter/CHANGELOG.md +47 -0
  361. package/node_modules/pi-mcp-adapter/README.md +42 -13
  362. package/node_modules/pi-mcp-adapter/commands.ts +4 -2
  363. package/node_modules/pi-mcp-adapter/config.ts +45 -5
  364. package/node_modules/pi-mcp-adapter/direct-tools.ts +103 -92
  365. package/node_modules/pi-mcp-adapter/dist/agent-dir.d.ts +10 -0
  366. package/node_modules/pi-mcp-adapter/dist/agent-dir.js +63 -0
  367. package/node_modules/pi-mcp-adapter/dist/agent-dir.js.map +1 -0
  368. package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.d.ts +8 -0
  369. package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.js +356 -0
  370. package/node_modules/pi-mcp-adapter/dist/agent-plugin-loader.js.map +1 -0
  371. package/node_modules/pi-mcp-adapter/dist/config.d.ts +123 -0
  372. package/node_modules/pi-mcp-adapter/dist/config.js +1087 -0
  373. package/node_modules/pi-mcp-adapter/dist/config.js.map +1 -0
  374. package/node_modules/pi-mcp-adapter/dist/metadata-cache.d.ts +19 -0
  375. package/node_modules/pi-mcp-adapter/dist/metadata-cache.js +319 -0
  376. package/node_modules/pi-mcp-adapter/dist/metadata-cache.js.map +1 -0
  377. package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.d.ts +2 -0
  378. package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.js +156 -0
  379. package/node_modules/pi-mcp-adapter/dist/package-mcp-loader.js.map +1 -0
  380. package/node_modules/pi-mcp-adapter/dist/resource-tools.d.ts +1 -0
  381. package/node_modules/pi-mcp-adapter/dist/resource-tools.js +15 -0
  382. package/node_modules/pi-mcp-adapter/dist/resource-tools.js.map +1 -0
  383. package/node_modules/pi-mcp-adapter/dist/types.d.ts +564 -0
  384. package/node_modules/pi-mcp-adapter/dist/types.js +287 -0
  385. package/node_modules/pi-mcp-adapter/dist/types.js.map +1 -0
  386. package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.d.ts +6 -0
  387. package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.js +37 -0
  388. package/node_modules/pi-mcp-adapter/dist/ui-app-bridge-helpers.js.map +1 -0
  389. package/node_modules/pi-mcp-adapter/dist/ui-stream-types.d.ts +104 -0
  390. package/node_modules/pi-mcp-adapter/dist/ui-stream-types.js +59 -0
  391. package/node_modules/pi-mcp-adapter/dist/ui-stream-types.js.map +1 -0
  392. package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.d.ts +4 -0
  393. package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.js +27 -0
  394. package/node_modules/pi-mcp-adapter/dist/ui-tool-visibility.js.map +1 -0
  395. package/node_modules/pi-mcp-adapter/dist/utils.d.ts +32 -0
  396. package/node_modules/pi-mcp-adapter/dist/utils.js +338 -0
  397. package/node_modules/pi-mcp-adapter/dist/utils.js.map +1 -0
  398. package/node_modules/pi-mcp-adapter/failure-backoff.ts +23 -0
  399. package/node_modules/pi-mcp-adapter/index.ts +204 -82
  400. package/node_modules/pi-mcp-adapter/init.ts +41 -30
  401. package/node_modules/pi-mcp-adapter/lifecycle.ts +16 -8
  402. package/node_modules/pi-mcp-adapter/mcp-code.ts +2 -0
  403. package/node_modules/pi-mcp-adapter/mcp-oauth-provider.ts +66 -16
  404. package/node_modules/pi-mcp-adapter/mcp-output-guard.ts +95 -7
  405. package/node_modules/pi-mcp-adapter/mcp-probe.ts +18 -4
  406. package/node_modules/pi-mcp-adapter/mcp-references.ts +368 -0
  407. package/node_modules/pi-mcp-adapter/mcp-status.ts +8 -19
  408. package/node_modules/pi-mcp-adapter/metadata-cache.ts +20 -12
  409. package/node_modules/pi-mcp-adapter/namespace-tools.ts +276 -0
  410. package/node_modules/pi-mcp-adapter/package.json +24 -6
  411. package/node_modules/pi-mcp-adapter/proxy-modes.ts +66 -10
  412. package/node_modules/pi-mcp-adapter/search-ranking.ts +2 -0
  413. package/node_modules/pi-mcp-adapter/server-manager.ts +63 -12
  414. package/node_modules/pi-mcp-adapter/state.ts +1 -3
  415. package/node_modules/pi-mcp-adapter/tool-result-renderer.ts +16 -2
  416. package/node_modules/pi-mcp-adapter/types.ts +48 -1
  417. package/node_modules/pi-mcp-adapter/ui-server.ts +3 -19
  418. package/node_modules/pi-mcp-adapter/ui-session.ts +2 -1
  419. package/node_modules/pi-mcp-adapter/utils.ts +21 -19
  420. package/node_modules/pi-web-access/CHANGELOG.md +26 -0
  421. package/node_modules/pi-web-access/README.md +71 -14
  422. package/node_modules/pi-web-access/chrome-cookies.ts +115 -35
  423. package/node_modules/pi-web-access/credential-source.ts +6 -2
  424. package/node_modules/pi-web-access/curator-page.ts +5 -3
  425. package/node_modules/pi-web-access/curator-server.ts +2 -1
  426. package/node_modules/pi-web-access/extract.ts +89 -9
  427. package/node_modules/pi-web-access/fetch-params.ts +13 -0
  428. package/node_modules/pi-web-access/gemini-adc.ts +298 -0
  429. package/node_modules/pi-web-access/gemini-api.ts +59 -15
  430. package/node_modules/pi-web-access/gemini-search.ts +58 -18
  431. package/node_modules/pi-web-access/gemini-url-context.ts +3 -2
  432. package/node_modules/pi-web-access/gemini-web-config.ts +57 -7
  433. package/node_modules/pi-web-access/gemini-web.ts +9 -3
  434. package/node_modules/pi-web-access/github-api.ts +5 -4
  435. package/node_modules/pi-web-access/github-issue-pr.ts +700 -0
  436. package/node_modules/pi-web-access/index.ts +403 -297
  437. package/node_modules/pi-web-access/kimi-search.ts +234 -0
  438. package/node_modules/pi-web-access/openai-search.ts +118 -21
  439. package/node_modules/pi-web-access/package.json +3 -2
  440. package/node_modules/pi-web-access/ssrf-protection.ts +4 -1
  441. package/node_modules/pi-web-access/utils.ts +307 -1
  442. package/node_modules/pi-web-access/youtube-extract.ts +2 -2
  443. package/package.json +46 -37
  444. package/node_modules/@herbertgao/pi-copy-response/CHANGELOG.md +0 -49
  445. package/node_modules/@herbertgao/pi-copy-response/LICENSE +0 -22
  446. package/node_modules/@herbertgao/pi-handoff/CHANGELOG.md +0 -83
  447. package/node_modules/@herbertgao/pi-handoff/LICENSE +0 -22
  448. package/node_modules/@herbertgao/pi-handoff/package.json +0 -60
  449. package/node_modules/@herbertgao/pi-inline-skills/CHANGELOG.md +0 -57
  450. package/node_modules/@herbertgao/pi-inline-skills/LICENSE +0 -22
  451. package/node_modules/@herbertgao/pi-mermaid-open/CHANGELOG.md +0 -39
  452. package/node_modules/@herbertgao/pi-preferred-thinking/CHANGELOG.md +0 -63
  453. package/node_modules/@herbertgao/pi-preferred-thinking/LICENSE +0 -22
  454. package/node_modules/@herbertgao/pi-recap/CHANGELOG.md +0 -101
  455. package/node_modules/@herbertgao/pi-recap/LICENSE +0 -22
  456. package/node_modules/@herbertgao/pi-recap/package.json +0 -55
  457. package/node_modules/@herbertgao/pi-rename/CHANGELOG.md +0 -49
  458. package/node_modules/@herbertgao/pi-rename/LICENSE +0 -22
  459. package/node_modules/@herbertgao/pi-rename/package.json +0 -63
  460. package/node_modules/@herbertgao/pi-titlebar-spinner/CHANGELOG.md +0 -25
  461. package/node_modules/@herbertgao/pi-titlebar-spinner/LICENSE +0 -22
  462. /package/node_modules/{@herbertgao → @tifan}/pi-copy-response/src/index.ts +0 -0
  463. /package/node_modules/{@herbertgao → @tifan}/pi-handoff/src/complete-text.ts +0 -0
  464. /package/node_modules/{@herbertgao → @tifan}/pi-handoff/src/session-query.ts +0 -0
  465. /package/node_modules/{@herbertgao → @tifan}/pi-inline-skills/src/index.ts +0 -0
  466. /package/node_modules/{@herbertgao → @tifan}/pi-mermaid-open/herdr-plugin/herdr-plugin.toml +0 -0
  467. /package/node_modules/{@herbertgao → @tifan}/pi-mermaid-open/herdr-plugin/viewer.mjs +0 -0
  468. /package/node_modules/{@herbertgao → @tifan}/pi-mermaid-open/src/index.ts +0 -0
  469. /package/node_modules/{@herbertgao → @tifan}/pi-recap/src/index.ts +0 -0
  470. /package/node_modules/{@herbertgao → @tifan}/pi-recap/src/model-picker.ts +0 -0
  471. /package/node_modules/{@herbertgao → @tifan}/pi-recap/src/sanitize.ts +0 -0
  472. /package/node_modules/{@herbertgao → @tifan}/pi-recap/src/tui.ts +0 -0
  473. /package/node_modules/{@herbertgao → @tifan}/pi-rename/src/model-picker.ts +0 -0
  474. /package/node_modules/{@herbertgao → @tifan}/pi-rename/src/naming.ts +0 -0
  475. /package/node_modules/{@herbertgao → @tifan}/pi-rename/src/sanitize.ts +0 -0
  476. /package/node_modules/{@herbertgao → @tifan}/pi-titlebar-spinner/src/index.ts +0 -0
@@ -3,7 +3,7 @@ import path from "node:path";
3
3
  import { URL } from "node:url";
4
4
  import { isUnderDir, normalizeEphemeralMapKey, normalizeMapKey, pathsEqual, uriToDiskPath, uriToPath, } from "./path-utils.js";
5
5
  import { convertCharacterOffset, lineTextAt, } from "./position-encoding.js";
6
- import { recordLspMutation, } from "../lsp-mutation.js";
6
+ import { recordLspMutation } from "../lsp-mutation.js";
7
7
  import { detectLineEnding, normalizeToLF, restoreLineEndings, } from "../host-edit-normalize.js";
8
8
  function isRecord(value) {
9
9
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -27,7 +27,7 @@ function isRange(value) {
27
27
  return comparePosition(value.start, value.end) <= 0;
28
28
  }
29
29
  function isTextEdit(value) {
30
- return isRecord(value) && isRange(value.range) && typeof value.newText === "string";
30
+ return (isRecord(value) && isRange(value.range) && typeof value.newText === "string");
31
31
  }
32
32
  function parseTextEdits(value, context) {
33
33
  if (!Array.isArray(value))
@@ -39,7 +39,9 @@ function parseTextEdits(value, context) {
39
39
  function parseVersion(value, context) {
40
40
  if (value === undefined || value === null)
41
41
  return value;
42
- if (!Number.isFinite(value) || !Number.isInteger(value) || value < 0) {
42
+ if (!Number.isFinite(value) ||
43
+ !Number.isInteger(value) ||
44
+ value < 0) {
43
45
  throw new Error(`${context}.version must be a nonnegative integer or null`);
44
46
  }
45
47
  return value;
@@ -92,7 +94,8 @@ function parseWorkspaceEdit(edit) {
92
94
  parseTextEdits(edits, `changes[${uri}]`);
93
95
  }
94
96
  }
95
- if (edit.documentChanges !== undefined && !Array.isArray(edit.documentChanges)) {
97
+ if (edit.documentChanges !== undefined &&
98
+ !Array.isArray(edit.documentChanges)) {
96
99
  throw new Error("workspace edit documentChanges must be an array");
97
100
  }
98
101
  for (const [index, change] of (edit.documentChanges ?? []).entries()) {
@@ -109,7 +112,8 @@ function parseWorkspaceEdit(edit) {
109
112
  parseResourceOptions(change.options, "create");
110
113
  break;
111
114
  case "rename":
112
- if (typeof change.oldUri !== "string" || typeof change.newUri !== "string") {
115
+ if (typeof change.oldUri !== "string" ||
116
+ typeof change.newUri !== "string") {
113
117
  throw new Error("rename requires oldUri and newUri strings");
114
118
  }
115
119
  parseResourceOptions(change.options, "rename");
@@ -128,7 +132,7 @@ function formatRange(range) {
128
132
  return `${range.start.line + 1}:${range.start.character + 1}-${range.end.line + 1}:${range.end.character + 1}`;
129
133
  }
130
134
  export function rangesOverlap(a, b) {
131
- return comparePosition(a.start, b.end) < 0 && comparePosition(b.start, a.end) < 0;
135
+ return (comparePosition(a.start, b.end) < 0 && comparePosition(b.start, a.end) < 0);
132
136
  }
133
137
  function positionsEqual(a, b) {
134
138
  return a.line === b.line && a.character === b.character;
@@ -233,7 +237,10 @@ function utf16Position(content, position, encoding) {
233
237
  if (encoding === "utf-32" && offset > 0 && offset < line.length) {
234
238
  const previous = line.charCodeAt(offset - 1);
235
239
  const current = line.charCodeAt(offset);
236
- if (previous >= 0xd800 && previous <= 0xdbff && current >= 0xdc00 && current <= 0xdfff)
240
+ if (previous >= 0xd800 &&
241
+ previous <= 0xdbff &&
242
+ current >= 0xdc00 &&
243
+ current <= 0xdfff)
237
244
  continue;
238
245
  }
239
246
  if (convertCharacterOffset(encoding, line, offset) === position.character) {
@@ -287,12 +294,17 @@ export function applyTextEditsToString(content, edits, positionEncoding = "utf-1
287
294
  const { start, end } = edit.range;
288
295
  if (start.line === end.line) {
289
296
  const line = lines[start.line] ?? "";
290
- lines[start.line] = line.slice(0, start.character) + edit.newText + line.slice(end.character);
297
+ lines[start.line] =
298
+ line.slice(0, start.character) +
299
+ edit.newText +
300
+ line.slice(end.character);
291
301
  continue;
292
302
  }
293
303
  const startLine = lines[start.line] ?? "";
294
304
  const endLine = lines[end.line] ?? "";
295
- const replacement = startLine.slice(0, start.character) + edit.newText + endLine.slice(end.character);
305
+ const replacement = startLine.slice(0, start.character) +
306
+ edit.newText +
307
+ endLine.slice(end.character);
296
308
  lines.splice(start.line, end.line - start.line + 1, ...replacement.split("\n"));
297
309
  }
298
310
  return lines.join("\n");
@@ -306,7 +318,9 @@ export async function normalizeWorkspaceEditToUtf16(edit, positionEncoding, cwd)
306
318
  // followed by a text edit at newDir/file.ts: the destination is not on disk
307
319
  // yet, but its content is available through the virtual move.
308
320
  const planned = planWorkspaceEdit(edit, true);
309
- const prepared = await preflightWorkspaceEdit(planned, cwd, { positionEncoding });
321
+ const prepared = await preflightWorkspaceEdit(planned, cwd, {
322
+ positionEncoding,
323
+ });
310
324
  const normalizedByOrigin = new Map();
311
325
  for (const op of planned) {
312
326
  if (op.kind !== "text")
@@ -317,7 +331,8 @@ export async function normalizeWorkspaceEditToUtf16(edit, positionEncoding, cwd)
317
331
  }
318
332
  const changes = {};
319
333
  for (const uri of Object.keys(edit.changes ?? {})) {
320
- changes[uri] = normalizedByOrigin.get(textEditOriginKey({ kind: "changes", uri, edits: [] })) ?? [];
334
+ changes[uri] =
335
+ normalizedByOrigin.get(textEditOriginKey({ kind: "changes", uri, edits: [] })) ?? [];
321
336
  }
322
337
  const documentChanges = [];
323
338
  for (const [index, change] of (edit.documentChanges ?? []).entries()) {
@@ -360,7 +375,14 @@ export function flattenWorkspaceTextEdits(edit) {
360
375
  return new Map([...buckets.values()].map(({ uri, edits }) => [uri, edits]));
361
376
  }
362
377
  function textEditKey(uri, edit) {
363
- return [pathIndexKey(uri), edit.range.start.line, edit.range.start.character, edit.range.end.line, edit.range.end.character, edit.newText].join(":");
378
+ return [
379
+ pathIndexKey(uri),
380
+ edit.range.start.line,
381
+ edit.range.start.character,
382
+ edit.range.end.line,
383
+ edit.range.end.character,
384
+ edit.newText,
385
+ ].join(":");
364
386
  }
365
387
  export function mergeWorkspaceTextEditsByPriority(entries) {
366
388
  const merged = new Map();
@@ -387,7 +409,9 @@ export function mergeWorkspaceTextEditsByPriority(entries) {
387
409
  const kept = bucket.edits;
388
410
  for (const edit of edits) {
389
411
  inputEditCount += 1;
390
- const exactKey = isEmptyRange(edit.range) ? undefined : textEditKey(uri, edit);
412
+ const exactKey = isEmptyRange(edit.range)
413
+ ? undefined
414
+ : textEditKey(uri, edit);
391
415
  if (exactKey !== undefined && seenExact.has(exactKey))
392
416
  continue;
393
417
  if (kept.some((existing) => rangesOverlap(existing.range, edit.range))) {
@@ -426,11 +450,24 @@ function textEditOriginKey(origin) {
426
450
  function parseResource(change) {
427
451
  const kind = change.kind;
428
452
  if (kind === "create")
429
- return { kind, uri: change.uri, options: parseResourceOptions(change.options, kind) };
453
+ return {
454
+ kind,
455
+ uri: change.uri,
456
+ options: parseResourceOptions(change.options, kind),
457
+ };
430
458
  if (kind === "rename")
431
- return { kind, oldUri: change.oldUri, newUri: change.newUri, options: parseResourceOptions(change.options, kind) };
459
+ return {
460
+ kind,
461
+ oldUri: change.oldUri,
462
+ newUri: change.newUri,
463
+ options: parseResourceOptions(change.options, kind),
464
+ };
432
465
  if (kind === "delete")
433
- return { kind, uri: change.uri, options: parseResourceOptions(change.options, kind) };
466
+ return {
467
+ kind,
468
+ uri: change.uri,
469
+ options: parseResourceOptions(change.options, kind),
470
+ };
434
471
  throw new Error(`unsupported workspace resource operation: ${String(kind)}`);
435
472
  }
436
473
  function planWorkspaceEdit(edit, trackOrigins = false) {
@@ -484,7 +521,9 @@ function planWorkspaceEdit(edit, trackOrigins = false) {
484
521
  // fires for numeric `op.version`) still validates it.
485
522
  const existingNumeric = typeof existing.version === "number" ? existing.version : undefined;
486
523
  const incomingNumeric = typeof version === "number" ? version : undefined;
487
- if (existingNumeric !== undefined && incomingNumeric !== undefined && existingNumeric !== incomingNumeric) {
524
+ if (existingNumeric !== undefined &&
525
+ incomingNumeric !== undefined &&
526
+ existingNumeric !== incomingNumeric) {
488
527
  throw new Error(`conflicting text document versions for ${uri}`);
489
528
  }
490
529
  existing.edits.push(...edits);
@@ -519,7 +558,12 @@ function planWorkspaceEdit(edit, trackOrigins = false) {
519
558
  });
520
559
  }
521
560
  else {
522
- ops.push({ kind: "text", uri: item.uri, edits: item.edits, version: item.version });
561
+ ops.push({
562
+ kind: "text",
563
+ uri: item.uri,
564
+ edits: item.edits,
565
+ version: item.version,
566
+ });
523
567
  }
524
568
  };
525
569
  const flushSubtree = (uri) => {
@@ -621,7 +665,9 @@ export function summarizeWorkspaceEdit(edit, cwd) {
621
665
  continue;
622
666
  if (change.kind === "create" && typeof change.uri === "string")
623
667
  lines.push(`Create ${relativeToCwd(uriToPath(change.uri), cwd)}`);
624
- else if (change.kind === "rename" && typeof change.oldUri === "string" && typeof change.newUri === "string")
668
+ else if (change.kind === "rename" &&
669
+ typeof change.oldUri === "string" &&
670
+ typeof change.newUri === "string")
625
671
  lines.push(`Rename ${relativeToCwd(uriToPath(change.oldUri), cwd)} → ${relativeToCwd(uriToPath(change.newUri), cwd)}`);
626
672
  else if (change.kind === "delete" && typeof change.uri === "string")
627
673
  lines.push(`Delete ${relativeToCwd(uriToPath(change.uri), cwd)}`);
@@ -721,7 +767,8 @@ async function createWorkspaceUriConfiner(cwd) {
721
767
  let filePath = "";
722
768
  try {
723
769
  const parsed = new URL(uri);
724
- if (parsed.protocol !== "file:" || (parsed.host !== "" && parsed.hostname !== "localhost"))
770
+ if (parsed.protocol !== "file:" ||
771
+ (parsed.host !== "" && parsed.hostname !== "localhost"))
725
772
  throw new Error("URI must be a local file URI");
726
773
  filePath = uriToPath(uri);
727
774
  }
@@ -779,7 +826,8 @@ async function preflightWorkspaceEdit(planned, cwd, options) {
779
826
  const clearTombstonesUnder = (filePath) => {
780
827
  for (let index = virtualTombstones.length - 1; index >= 0; index--) {
781
828
  const tombstone = virtualTombstones[index];
782
- if (pathsEqual(tombstone.path, filePath) || isUnderDir(tombstone.path, filePath)) {
829
+ if (pathsEqual(tombstone.path, filePath) ||
830
+ isUnderDir(tombstone.path, filePath)) {
783
831
  virtualTombstones.splice(index, 1);
784
832
  }
785
833
  }
@@ -789,14 +837,20 @@ async function preflightWorkspaceEdit(planned, cwd, options) {
789
837
  return { exists: false, directory: false };
790
838
  const physicalPath = resolveVirtualPath(filePath);
791
839
  if (!physicalPath) {
792
- return virtualOverrides.get(normalizeMapKey(filePath)) ?? { exists: false, directory: false };
840
+ return (virtualOverrides.get(normalizeMapKey(filePath)) ?? {
841
+ exists: false,
842
+ directory: false,
843
+ });
793
844
  }
794
845
  const key = normalizeMapKey(physicalPath);
795
846
  const known = virtual.get(key);
796
847
  if (known)
797
848
  return known;
798
849
  const stat = await lstatOrMissing(physicalPath);
799
- const value = { exists: Boolean(stat), directory: stat?.isDirectory() ?? false };
850
+ const value = {
851
+ exists: Boolean(stat),
852
+ directory: stat?.isDirectory() ?? false,
853
+ };
800
854
  virtual.set(key, value);
801
855
  return value;
802
856
  };
@@ -880,7 +934,8 @@ async function preflightWorkspaceEdit(planned, cwd, options) {
880
934
  // treat a same-key-different-case pair as a real rename below.
881
935
  const oldDisk = uriToDiskPath(op.oldUri);
882
936
  const newDisk = uriToDiskPath(op.newUri);
883
- if (path.resolve(oldDisk).replace(/\\/g, "/") === path.resolve(newDisk).replace(/\\/g, "/")) {
937
+ if (path.resolve(oldDisk).replace(/\\/g, "/") ===
938
+ path.resolve(newDisk).replace(/\\/g, "/")) {
884
939
  throw new Error("rename source and destination must differ");
885
940
  }
886
941
  const source = await stateFor(oldPath);
@@ -953,7 +1008,11 @@ async function preflightWorkspaceEdit(planned, cwd, options) {
953
1008
  // resolves through this virtual move to the original physical path.
954
1009
  // This preserves ordered workspace-edit semantics without walking the
955
1010
  // entire subtree during preflight.
956
- virtualMoves.push({ from: oldPath, to: newPath, directory: source.directory });
1011
+ virtualMoves.push({
1012
+ from: oldPath,
1013
+ to: newPath,
1014
+ directory: source.directory,
1015
+ });
957
1016
  }
958
1017
  continue;
959
1018
  }
@@ -1047,7 +1106,11 @@ export async function applyWorkspaceEdit(edit, cwd, options = {}) {
1047
1106
  const start = Math.min(...edits.map((item) => item.range.start.line + 1));
1048
1107
  const end = Math.max(...edits.map((item) => item.range.end.line + 1));
1049
1108
  touchedFiles.add(filePath);
1050
- fileDetails.push({ filePath, range: { start, end }, importsChanged: importsSignature(content) !== importsSignature(updated) });
1109
+ fileDetails.push({
1110
+ filePath,
1111
+ range: { start, end },
1112
+ importsChanged: importsSignature(content) !== importsSignature(updated),
1113
+ });
1051
1114
  markApplied(op);
1052
1115
  descriptions.push(`Applied ${edits.length} edit(s) to ${relativeToCwd(filePath, cwd)}`);
1053
1116
  }
@@ -1062,7 +1125,11 @@ export async function applyWorkspaceEdit(edit, cwd, options = {}) {
1062
1125
  else
1063
1126
  await fs.writeFile(diskPath, "", { flag: "wx" });
1064
1127
  touchedFiles.add(filePath);
1065
- fileDetails.push({ filePath, range: { start: 1, end: 1 }, importsChanged: false });
1128
+ fileDetails.push({
1129
+ filePath,
1130
+ range: { start: 1, end: 1 },
1131
+ importsChanged: false,
1132
+ });
1066
1133
  markApplied(op);
1067
1134
  descriptions.push(`Created ${relativeToCwd(filePath, cwd)}`);
1068
1135
  }
@@ -1079,16 +1146,31 @@ export async function applyWorkspaceEdit(edit, cwd, options = {}) {
1079
1146
  await fs.rename(oldDisk, newDisk);
1080
1147
  touchedFiles.add(oldPath);
1081
1148
  touchedFiles.add(newPath);
1082
- fileDetails.push({ filePath: oldPath, range: { start: 1, end: 1 }, importsChanged: true }, { filePath: newPath, range: { start: 1, end: 1 }, importsChanged: true });
1149
+ fileDetails.push({
1150
+ filePath: oldPath,
1151
+ range: { start: 1, end: 1 },
1152
+ importsChanged: true,
1153
+ }, {
1154
+ filePath: newPath,
1155
+ range: { start: 1, end: 1 },
1156
+ importsChanged: true,
1157
+ });
1083
1158
  markApplied(op);
1084
1159
  descriptions.push(`Renamed ${relativeToCwd(oldPath, cwd)} → ${relativeToCwd(newPath, cwd)}`);
1085
1160
  }
1086
1161
  else {
1087
1162
  const filePath = uriToPath(op.uri);
1088
1163
  const diskPath = uriToDiskPath(op.uri);
1089
- await fs.rm(diskPath, { recursive: op.options?.recursive === true, force: false });
1164
+ await fs.rm(diskPath, {
1165
+ recursive: op.options?.recursive === true,
1166
+ force: false,
1167
+ });
1090
1168
  touchedFiles.add(filePath);
1091
- fileDetails.push({ filePath, range: { start: 1, end: 1 }, importsChanged: true });
1169
+ fileDetails.push({
1170
+ filePath,
1171
+ range: { start: 1, end: 1 },
1172
+ importsChanged: true,
1173
+ });
1092
1174
  markApplied(op);
1093
1175
  descriptions.push(`Deleted ${relativeToCwd(filePath, cwd)}`);
1094
1176
  }
@@ -1097,11 +1179,16 @@ export async function applyWorkspaceEdit(edit, cwd, options = {}) {
1097
1179
  catch (err) {
1098
1180
  const partial = makeResult();
1099
1181
  if (options.mutationContext && options.observe !== false) {
1100
- recordLspMutation(options.mutationContext, { results: [partial], status: "failed" });
1182
+ recordLspMutation(options.mutationContext, {
1183
+ results: [partial],
1184
+ status: "failed",
1185
+ });
1101
1186
  }
1102
1187
  const already = [...touchedFiles];
1103
1188
  if (already.length > 0) {
1104
- const alreadyList = already.map((f) => ` • ${relativeToCwd(f, cwd)}`).join("\n");
1189
+ const alreadyList = already
1190
+ .map((f) => ` • ${relativeToCwd(f, cwd)}`)
1191
+ .join("\n");
1105
1192
  const failure = new Error(`Workspace edit failed mid-application — ${already.length} file(s) already written, no rollback performed:\n${alreadyList}\nCause: ${err instanceof Error ? err.message : String(err)}`);
1106
1193
  failure.appliedWorkspaceEdit = partial;
1107
1194
  throw failure;
@@ -12,7 +12,7 @@ import * as nodeFs from "node:fs";
12
12
  import fs from "node:fs/promises";
13
13
  import path from "node:path";
14
14
  import { pathToFileURL, URL } from "node:url";
15
- import { getProjectIgnoreMatcher, isExcludedDirName, } from "../file-utils.js";
15
+ import { getProjectIgnoreMatcher, isExcludedDirName } from "../file-utils.js";
16
16
  import { recordLsp } from "../widget-state.js";
17
17
  import { applyAuxiliarySuppressions } from "../dispatch/auxiliary-lsp.js";
18
18
  import { detectFileRole } from "../file-role.js";
@@ -25,11 +25,12 @@ import { shouldPreferPullOnlyDiagnostics } from "../lsp-budget.js";
25
25
  import { withDeadline, withTimeout } from "../deadline-utils.js";
26
26
  import { acquireWorkspaceSweepHold, clearWorkspaceSweepHoldForSessionStart, } from "./workspace-sweep-hold.js";
27
27
  import { DocumentDriftTracker, fingerprintDocumentContent, } from "./document-drift.js";
28
+ import { markPendingAuxiliaryCoverage } from "./pending-aux-coverage.js";
28
29
  import { isAtOrAboveHomeDir, isWindowsPath, normalizeMapKey, uriToPath, } from "../path-utils.js";
29
- import { recordLspMutation, } from "../lsp-mutation.js";
30
+ import { recordLspMutation } from "../lsp-mutation.js";
30
31
  import { createLSPClient } from "./client.js";
31
32
  import { auxiliaryCoverageGap, bindingStateLabel, composeBoundToCurrentDisk, createDiskBindingCache, hashDiagnosticContent, resolveTouchVerdict, touchCoverageGap, } from "./diagnostic-binding.js";
32
- import { getServersForFileWithConfig, getServerInitOverride } from "./config.js";
33
+ import { getServersForFileWithConfig, getServerInitOverride, } from "./config.js";
33
34
  import { getLanguageId } from "./language.js";
34
35
  import { LSP_SERVERS, enforceLspRootCeiling, hasProjectBoundaryMarker, isDirectLspCommandTemporarilyUnavailable, resetClassicTsRepairGuard, } from "./server.js";
35
36
  import { classifyCascadeWaitTier, classifyServerWaitTier, getStrategy, } from "./wait-policy/index.js";
@@ -37,8 +38,8 @@ const WORKSPACE_ATTRIBUTION_CLIENT_CAP = 16;
37
38
  import { raceToCompletion } from "./aggregation.js";
38
39
  import { applyWorkspaceEdit, mergeWorkspaceTextEditsByPriority, summarizeWorkspaceEdit, validateWorkspaceEdit, } from "./edits.js";
39
40
  import { buildScopeKey, createWorkspaceDiagnosticsCacheContext, } from "./workspace-diagnostics-cache.js";
40
- import { attemptTsserverSyncDiagnostics, } from "./tsserver-sync.js";
41
- import { isWarmAttached, tryWarmAttachedDiagnostics, } from "../warm-attach.js";
41
+ import { attemptTsserverSyncDiagnostics } from "./tsserver-sync.js";
42
+ import { isWarmAttached, tryWarmAttachedDiagnostics } from "../warm-attach.js";
42
43
  import { getSuccessfulLspSpawnDurationMs, recordSuccessfulLspSpawn, } from "./spawn-history.js";
43
44
  function destinationUriPreservingSpelling(oldUri, oldFilePath, newFilePath) {
44
45
  const canonical = pathToFileURL(newFilePath);
@@ -475,7 +476,9 @@ function notifyWedgedMs() {
475
476
  const AUX_NOTIFY_INFLIGHT_DEFAULT = 8;
476
477
  function auxNotifyInflightLimit(info) {
477
478
  const perServer = info.notifyInflightLimit;
478
- if (typeof perServer === "number" && Number.isFinite(perServer) && perServer > 0) {
479
+ if (typeof perServer === "number" &&
480
+ Number.isFinite(perServer) &&
481
+ perServer > 0) {
479
482
  return Math.floor(perServer);
480
483
  }
481
484
  const raw = Number(process.env.PI_LENS_LSP_AUX_NOTIFY_INFLIGHT);
@@ -904,8 +907,12 @@ export class LSPService {
904
907
  client.isAlive() &&
905
908
  client.isBusy?.() !== true &&
906
909
  (this.clientLeases.get(candidateKey) ?? 0) === 0)
907
- .sort(([a], [b]) => (this.clientLastUsedAt.get(a) ?? this.state.clientSpawnedAt.get(a) ?? 0) -
908
- (this.clientLastUsedAt.get(b) ?? this.state.clientSpawnedAt.get(b) ?? 0));
910
+ .sort(([a], [b]) => (this.clientLastUsedAt.get(a) ??
911
+ this.state.clientSpawnedAt.get(a) ??
912
+ 0) -
913
+ (this.clientLastUsedAt.get(b) ??
914
+ this.state.clientSpawnedAt.get(b) ??
915
+ 0));
909
916
  const victim = idle[0];
910
917
  if (!victim) {
911
918
  logSessionStart(`lsp client ceiling ${getLspClientCeiling()}: spawn declined; all clients are in use`);
@@ -1601,7 +1608,8 @@ export class LSPService {
1601
1608
  });
1602
1609
  const noteSpawnInFlight = (serverId) => {
1603
1610
  const knownDurationMs = getSuccessfulLspSpawnDurationMs(serverId);
1604
- if (knownDurationMs !== undefined && knownDurationMs > effectiveMaxWaitMs * 2) {
1611
+ if (knownDurationMs !== undefined &&
1612
+ knownDurationMs > effectiveMaxWaitMs * 2) {
1605
1613
  // Let a completion microtask already queued by the acquisition win
1606
1614
  // before the shortcut decision is observed by Promise.race.
1607
1615
  queueMicrotask(() => knownSlowResolve?.());
@@ -1868,6 +1876,34 @@ export class LSPService {
1868
1876
  }
1869
1877
  return false;
1870
1878
  }
1879
+ /**
1880
+ * #2001/#2002 collect-later: read-only cached-diagnostics probe for the
1881
+ * turn-end late-auxiliary delivery (`clients/runtime-turn.ts`). Like
1882
+ * `isServerAliveForFile`, this NEVER creates or warms a client — it only
1883
+ * resolves each requested server's root and reads the already-connected
1884
+ * client's cached diagnostics for `filePath`. Servers with no live client
1885
+ * are simply absent from the returned map (the caller drops those pairs
1886
+ * silently); a present server maps to its cache contents, possibly empty
1887
+ * (still scanning).
1888
+ */
1889
+ async readCachedDiagnosticsForServers(filePath, serverIds) {
1890
+ const out = new Map();
1891
+ if (this.checkDestroyed() || serverIds.size === 0)
1892
+ return out;
1893
+ for (const server of getServersForFileWithConfig(filePath)) {
1894
+ if (!serverIds.has(server.id) || out.has(server.id))
1895
+ continue;
1896
+ const root = await this.resolveServerRoot(server, filePath);
1897
+ if (!root)
1898
+ continue;
1899
+ const key = `${server.id}:${normalizeMapKey(root)}`;
1900
+ const client = this.state.clients.get(key);
1901
+ if (!client?.isAlive())
1902
+ continue;
1903
+ out.set(server.id, client.getDiagnostics(filePath));
1904
+ }
1905
+ return out;
1906
+ }
1871
1907
  /**
1872
1908
  * #1668: deliver a `workspace/didChangeWatchedFiles` event for a disk
1873
1909
  * change the client did not author through open-document sync — a bash
@@ -2262,8 +2298,7 @@ export class LSPService {
2262
2298
  // single death may feed BOTH accumulators (the window above AND
2263
2299
  // runtimeExitCounts here), but neither alters the other's threshold,
2264
2300
  // so the fast path's trip point is exactly what it was.
2265
- if (uptimeMs != null &&
2266
- uptimeMs < RUNTIME_EXIT_UPTIME_THRESHOLD_MS) {
2301
+ if (uptimeMs != null && uptimeMs < RUNTIME_EXIT_UPTIME_THRESHOLD_MS) {
2267
2302
  const rCount = (this.runtimeExitCounts.get(key) ?? 0) + 1;
2268
2303
  this.runtimeExitCounts.set(key, rCount);
2269
2304
  const rCooldown = Math.min(BROKEN_BASE_COOLDOWN_MS * 2 ** (rCount - 1), BROKEN_MAX_COOLDOWN_MS);
@@ -2941,7 +2976,8 @@ export class LSPService {
2941
2976
  // stall was long enough that #743's demotion is the honest
2942
2977
  // verdict, not a latency artifact.
2943
2978
  const outstandingMs = Date.now() - writeStartedAt;
2944
- if (outstandingMs > budget && outstandingMs <= notifyWedgedMs()) {
2979
+ if (outstandingMs > budget &&
2980
+ outstandingMs <= notifyWedgedMs()) {
2945
2981
  this.retractNotifyWriteBackpressure(clientKey, entry.info.id, filePath, outstandingMs, client);
2946
2982
  }
2947
2983
  }, release);
@@ -3157,7 +3193,9 @@ export class LSPService {
3157
3193
  // slow aux (opengrep) can't override the per-edit cap. Resolves as soon
3158
3194
  // as a server publishes; this is just its individual deadline. (#242)
3159
3195
  const perServerTimeout = (serverId) => {
3160
- const launchVariant = spawned.find((entry) => entry.client.serverId === serverId)?.client.getLaunchVariant?.();
3196
+ const launchVariant = spawned
3197
+ .find((entry) => entry.client.serverId === serverId)
3198
+ ?.client.getLaunchVariant?.();
3161
3199
  const strategy = getStrategy(serverId, launchVariant);
3162
3200
  let strategyWait = strategy.aggregateWaitMs;
3163
3201
  // #645: a `workspaceIndexing` server (marksman) only needs the
@@ -3319,7 +3357,8 @@ export class LSPService {
3319
3357
  const isWarmupTouch = source === "lsp_sweep_warmup";
3320
3358
  // #743: per-server — a server we DID push to still gets the
3321
3359
  // version-baseline wait even when a sibling was debounced away.
3322
- const wait = !notifySkippedServerIds.has(entry.info.id) && Number.isFinite(baseline)
3360
+ const wait = !notifySkippedServerIds.has(entry.info.id) &&
3361
+ Number.isFinite(baseline)
3323
3362
  ? entry.client.waitForDiagnostics(filePath, serverTimeout, {
3324
3363
  minVersion: baseline,
3325
3364
  ...(pullOnly && { pullOnly: true }),
@@ -3463,6 +3502,24 @@ export class LSPService {
3463
3502
  const uncovered = auxiliaryCoverageGap(outcomes);
3464
3503
  if (uncovered.length > 0)
3465
3504
  auxUnconfirmedServerIds = uncovered;
3505
+ // #2001/#2002 collect-later: an auxiliary with NO publication
3506
+ // evidence for this content (`cut_off` — our grace timer won; or
3507
+ // `silent` — its own budget lapsed with nothing published) may still
3508
+ // publish into its client cache seconds later. Mark the pair so the
3509
+ // NEXT turn_end can probe the cache and deliver the late findings
3510
+ // instead of dropping them on the floor. Exclusions mirror the
3511
+ // coverage-gap policy: `answered` already rode along, a #1493-exempt
3512
+ // scanner's stored findings are bound to exactly these bytes (its
3513
+ // answer is already carried), and DEFERRED servers never received
3514
+ // this content at all (#1459) — their cache describes the PREVIOUS
3515
+ // revision and probing it would replay stale findings.
3516
+ const collectLaterServerIds = outcomes
3517
+ .filter((o) => !o.publishedThisContent &&
3518
+ (o.outcome === "cut_off" || o.outcome === "silent"))
3519
+ .map((o) => o.serverId);
3520
+ if (collectLaterServerIds.length > 0) {
3521
+ markPendingAuxiliaryCoverage(filePath, collectLaterServerIds);
3522
+ }
3466
3523
  logLatency({
3467
3524
  type: "phase",
3468
3525
  phase: "lsp_aux_wait_outcome",
@@ -3706,7 +3763,7 @@ export class LSPService {
3706
3763
  return true;
3707
3764
  }
3708
3765
  try {
3709
- return entry.client.getAllDiagnostics?.().has(normalizedPath) === true;
3766
+ return (entry.client.getAllDiagnostics?.().has(normalizedPath) === true);
3710
3767
  }
3711
3768
  catch {
3712
3769
  // Fail closed: an unreadable cache is not evidence of an answer.
@@ -3963,9 +4020,8 @@ export class LSPService {
3963
4020
  diagnosticsTimedOut = false;
3964
4021
  retractPrimaryTimeoutAttribution(); // #1549
3965
4022
  syncConfirmed = true;
3966
- collected = syncResult.length > 0
3967
- ? mergeLspDiagnostics(syncResult)
3968
- : [];
4023
+ collected =
4024
+ syncResult.length > 0 ? mergeLspDiagnostics(syncResult) : [];
3969
4025
  logLatency({
3970
4026
  type: "phase",
3971
4027
  phase: "lsp_tsserver_sync_confirm",
@@ -4030,7 +4086,8 @@ export class LSPService {
4030
4086
  getStrategy(spawned[0].client.serverId, spawned[0].client.getLaunchVariant?.()).silentOnClean === true) {
4031
4087
  try {
4032
4088
  const snapshots = await this.getCapabilitySnapshots(filePath);
4033
- if (classifyCascadeWaitTier(this, filePath, snapshots) === "tier3-silent") {
4089
+ if (classifyCascadeWaitTier(this, filePath, snapshots) ===
4090
+ "tier3-silent") {
4034
4091
  // #1277: same liveness precondition as the aggregate gate above —
4035
4092
  // `tier3-silent` is a static capability classification and can't
4036
4093
  // distinguish "silent because clean" from "silent because wedged".
@@ -4183,7 +4240,9 @@ export class LSPService {
4183
4240
  metadata: {
4184
4241
  source,
4185
4242
  clientScope,
4186
- ...(brokenSkippedServerIds.length > 0 && { brokenSkippedServerIds }),
4243
+ ...(brokenSkippedServerIds.length > 0 && {
4244
+ brokenSkippedServerIds,
4245
+ }),
4187
4246
  // #1586: the deferrals this touch is actually uncovered for. The raw
4188
4247
  // gate action keeps its own record in `lsp_notify_resync_deferred`;
4189
4248
  // this row exists to prove a blackout, and a scanner already bound to
@@ -4588,7 +4647,8 @@ export class LSPService {
4588
4647
  return (found ?? {
4589
4648
  serverId: entry.info.id,
4590
4649
  launchVariant: entry.client.getLaunchVariant?.(),
4591
- waitMs: getStrategy(entry.info.id, entry.client.getLaunchVariant?.()).aggregateWaitMs,
4650
+ waitMs: getStrategy(entry.info.id, entry.client.getLaunchVariant?.())
4651
+ .aggregateWaitMs,
4592
4652
  diagnosticCount: 0,
4593
4653
  diagnostics: [],
4594
4654
  });
@@ -5307,21 +5367,23 @@ export class LSPService {
5307
5367
  ...applied,
5308
5368
  files,
5309
5369
  operationTotal: applied.operationTotal + renameApplied.operationTotal,
5310
- appliedOperationTotal: applied.appliedOperationTotal + renameApplied.appliedOperationTotal,
5370
+ appliedOperationTotal: applied.appliedOperationTotal +
5371
+ renameApplied.appliedOperationTotal,
5311
5372
  appliedOperationIndexes: [
5312
5373
  ...applied.appliedOperationIndexes,
5313
5374
  ...renameApplied.appliedOperationIndexes.map((index) => applied.operationTotal + index),
5314
5375
  ],
5315
5376
  operationCounts: {
5316
- textEdits: applied.operationCounts.textEdits + renameApplied.operationCounts.textEdits,
5317
- create: applied.operationCounts.create + renameApplied.operationCounts.create,
5318
- rename: applied.operationCounts.rename + renameApplied.operationCounts.rename,
5319
- delete: applied.operationCounts.delete + renameApplied.operationCounts.delete,
5377
+ textEdits: applied.operationCounts.textEdits +
5378
+ renameApplied.operationCounts.textEdits,
5379
+ create: applied.operationCounts.create +
5380
+ renameApplied.operationCounts.create,
5381
+ rename: applied.operationCounts.rename +
5382
+ renameApplied.operationCounts.rename,
5383
+ delete: applied.operationCounts.delete +
5384
+ renameApplied.operationCounts.delete,
5320
5385
  },
5321
- fileDetails: [
5322
- ...applied.fileDetails,
5323
- ...renameApplied.fileDetails,
5324
- ],
5386
+ fileDetails: [...applied.fileDetails, ...renameApplied.fileDetails],
5325
5387
  },
5326
5388
  ],
5327
5389
  status: "success",
@@ -6136,9 +6198,7 @@ export class LSPService {
6136
6198
  return;
6137
6199
  }
6138
6200
  // Fast path: one project-wide pull for the whole group (opt-in).
6139
- if (!isWarmAttached() &&
6140
- workspacePullEnabled &&
6141
- !group.multiServer) {
6201
+ if (!isWarmAttached() && workspacePullEnabled && !group.multiServer) {
6142
6202
  const pulled = await this.tryWorkspacePull(group.files, perFileMs, cacheServedKeys);
6143
6203
  if (pulled) {
6144
6204
  // #1782: an explicit zero-diagnostic answer for a file this
@@ -6468,8 +6528,7 @@ export class LSPService {
6468
6528
  }
6469
6529
  return true;
6470
6530
  }));
6471
- client.pruneDiagnostics((filePath, ts) => !existingPaths.has(filePath) ||
6472
- now - ts > CASCADE_DIAGNOSTICS_TTL_MS);
6531
+ client.pruneDiagnostics((filePath, ts) => !existingPaths.has(filePath) || now - ts > CASCADE_DIAGNOSTICS_TTL_MS);
6473
6532
  const clientDiags = client.getAllDiagnostics();
6474
6533
  for (const [filePath, entry] of clientDiags) {
6475
6534
  const existing = all.get(filePath);
@@ -175,7 +175,8 @@ export async function demoteInferredProjectSweepResults(results, cwd, service, s
175
175
  out.push(result);
176
176
  continue;
177
177
  }
178
- if (identityCache.size >= INFERRED_PROJECT_PROBE_BUDGET && !identityCache.has(result.filePath)) {
178
+ if (identityCache.size >= INFERRED_PROJECT_PROBE_BUDGET &&
179
+ !identityCache.has(result.filePath)) {
179
180
  budgetExhausted = true;
180
181
  out.push(result);
181
182
  continue;
@@ -114,7 +114,10 @@ export function discoverJdkHome(roots = candidateRoots(), javaHome = process.env
114
114
  const resolved = jdkHomeFrom(dir);
115
115
  if (!resolved)
116
116
  continue;
117
- found.push({ home: resolved, major: parseMajorVersion(path.basename(dir)) });
117
+ found.push({
118
+ home: resolved,
119
+ major: parseMajorVersion(path.basename(dir)),
120
+ });
118
121
  }
119
122
  }
120
123
  // Require a parseable major ≥ 17 (jdtls's floor). An explicit JAVA_HOME is