@mrclrchtr/supi-code-intelligence 12.0.0 → 14.0.0

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 (307) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +7 -5
  3. package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  4. package/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +10 -0
  5. package/node_modules/@mrclrchtr/supi-core/package.json +3 -1
  6. package/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
  7. package/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
  8. package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +78 -13
  9. package/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +41 -9
  10. package/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
  11. package/node_modules/@mrclrchtr/supi-core/src/session.ts +3 -0
  12. package/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
  13. package/node_modules/@mrclrchtr/supi-core/src/side-run.ts +46 -0
  14. package/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
  15. package/node_modules/@mrclrchtr/supi-lsp/README.md +6 -2
  16. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  17. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +10 -0
  18. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +3 -1
  19. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
  20. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
  21. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +78 -13
  22. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +41 -9
  23. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
  24. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/session.ts +3 -0
  25. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
  26. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/side-run.ts +46 -0
  27. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
  28. package/node_modules/@mrclrchtr/supi-lsp/package.json +8 -8
  29. package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +1 -0
  30. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-cache.ts +102 -47
  31. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-host.ts +8 -0
  32. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-refresh.ts +20 -1
  33. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-request.ts +4 -1
  34. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-timing.ts +14 -1
  35. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-typescript.ts +8 -1
  36. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +50 -4
  37. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-disk-stamp.ts +60 -0
  38. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-state.ts +3 -0
  39. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-sync.ts +21 -1
  40. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-file-state.ts +17 -3
  41. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-input-admission.ts +7 -1
  42. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-semantic-input-barrier.ts +53 -4
  43. package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +12 -3
  44. package/node_modules/@mrclrchtr/supi-lsp/src/client/transport.ts +24 -8
  45. package/node_modules/@mrclrchtr/supi-lsp/src/config/server-config.ts +5 -0
  46. package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-extends.ts +2 -1
  47. package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-path.ts +2 -2
  48. package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-scope.ts +17 -5
  49. package/node_modules/@mrclrchtr/supi-lsp/src/config/typescript-module.ts +17 -0
  50. package/node_modules/@mrclrchtr/supi-lsp/src/debug-telemetry.ts +64 -0
  51. package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/evidence.ts +42 -0
  52. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-client-state.ts +2 -17
  53. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-project-info.ts +3 -0
  54. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-removal-ledger.ts +52 -0
  55. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-typescript-coverage.ts +27 -2
  56. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-workspace-symbol.ts +16 -112
  57. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +561 -103
  58. package/node_modules/@mrclrchtr/supi-lsp/src/manager/typescript-file-local.ts +6 -1
  59. package/node_modules/@mrclrchtr/supi-lsp/src/manager/workspace-symbol-collection.ts +163 -0
  60. package/node_modules/@mrclrchtr/supi-lsp/src/manager/workspace-symbol-row-limit.ts +72 -0
  61. package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +6 -1
  62. package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-symbol-mapper.ts +13 -3
  63. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-controller.ts +11 -0
  64. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostic-surface.ts +11 -0
  65. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostics.ts +1 -0
  66. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +53 -9
  67. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-transition-debug.ts +11 -1
  68. package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +2 -0
  69. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  70. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +10 -0
  71. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +3 -1
  72. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
  73. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
  74. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +78 -13
  75. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +41 -9
  76. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
  77. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/session.ts +3 -0
  78. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
  79. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/side-run.ts +46 -0
  80. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
  81. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs +50 -75
  82. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs.map +2 -2
  83. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js +50 -75
  84. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js.map +2 -2
  85. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm +0 -0
  86. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm.map +6 -6
  87. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/package.json +1 -1
  88. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs +50 -75
  89. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs.map +2 -2
  90. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts +7 -7
  91. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts.map +1 -1
  92. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts +7 -7
  93. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +1 -1
  94. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js +50 -75
  95. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js.map +2 -2
  96. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm +0 -0
  97. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm.map +5 -5
  98. package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +5 -5
  99. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/kotlin/tree-sitter-kotlin.wasm.json +1 -1
  100. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/latex/tree-sitter-latex.wasm.json +1 -1
  101. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm +0 -0
  102. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm.json +3 -3
  103. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm.json +1 -1
  104. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm.json +1 -1
  105. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-client.ts +1 -1
  106. package/node_modules/fast-xml-parser/CHANGELOG.md +886 -0
  107. package/node_modules/fast-xml-parser/LICENSE +21 -0
  108. package/node_modules/fast-xml-parser/README.md +204 -0
  109. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
  110. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
  111. package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
  112. package/node_modules/fast-xml-parser/lib/fxp.d.cts +774 -0
  113. package/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
  114. package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
  115. package/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
  116. package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
  117. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
  118. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
  119. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/README.md +92 -0
  120. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/package.json +57 -0
  121. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityDecoder.js +644 -0
  122. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityEncoder.js +239 -0
  123. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/all-entities.js +53 -0
  124. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entities.js +1139 -0
  125. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entityTries.js +60 -0
  126. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.d.ts +358 -0
  127. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.js +29 -0
  128. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/CHANGELOG.md +52 -0
  129. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/LICENSE +21 -0
  130. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/README.md +77 -0
  131. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.cjs +1 -0
  132. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.d.cts +270 -0
  133. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js +2 -0
  134. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -0
  135. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/package.json +77 -0
  136. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.d.ts +270 -0
  137. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.js +609 -0
  138. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/ignoreAttributes.js +18 -0
  139. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/orderedJs2Xml.js +360 -0
  140. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/prettifyJs2Xml.js +0 -0
  141. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/util.js +23 -0
  142. package/node_modules/fast-xml-parser/node_modules/is-unsafe/LICENSE +21 -0
  143. package/node_modules/fast-xml-parser/node_modules/is-unsafe/README.md +632 -0
  144. package/node_modules/fast-xml-parser/node_modules/is-unsafe/package.json +56 -0
  145. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/html.js +102 -0
  146. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/log.js +98 -0
  147. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/nosql.js +114 -0
  148. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/redos.js +60 -0
  149. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/shell.js +105 -0
  150. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql-strict.js +47 -0
  151. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql.js +95 -0
  152. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/svg.js +81 -0
  153. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/xml.js +79 -0
  154. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.cjs +27 -0
  155. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.d.ts +103 -0
  156. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.js +292 -0
  157. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/util/decode-entities.js +48 -0
  158. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/LICENSE +21 -0
  159. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/README.md +947 -0
  160. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.cjs +1 -0
  161. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.d.cts +725 -0
  162. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js +2 -0
  163. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -0
  164. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/package.json +79 -0
  165. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Expression.js +232 -0
  166. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/ExpressionSet.js +225 -0
  167. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Matcher.js +663 -0
  168. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.d.ts +589 -0
  169. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.js +30 -0
  170. package/node_modules/fast-xml-parser/node_modules/strnum/CHANGELOG.md +63 -0
  171. package/node_modules/fast-xml-parser/node_modules/strnum/LICENSE +21 -0
  172. package/node_modules/fast-xml-parser/node_modules/strnum/README.md +113 -0
  173. package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/LICENSE +21 -0
  174. package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/README.md +142 -0
  175. package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/anynum.js +135 -0
  176. package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/digitTable.js +116 -0
  177. package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/package.json +42 -0
  178. package/node_modules/fast-xml-parser/node_modules/strnum/package.json +36 -0
  179. package/node_modules/fast-xml-parser/node_modules/strnum/strnum.js +176 -0
  180. package/node_modules/fast-xml-parser/node_modules/xml-naming/LICENSE +21 -0
  181. package/node_modules/fast-xml-parser/node_modules/xml-naming/README.md +287 -0
  182. package/node_modules/fast-xml-parser/node_modules/xml-naming/package.json +56 -0
  183. package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.d.ts +108 -0
  184. package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.js +382 -0
  185. package/node_modules/fast-xml-parser/package.json +93 -0
  186. package/node_modules/fast-xml-parser/src/cli/cli.js +97 -0
  187. package/node_modules/fast-xml-parser/src/cli/man.js +17 -0
  188. package/node_modules/fast-xml-parser/src/cli/read.js +43 -0
  189. package/node_modules/fast-xml-parser/src/fxp.d.ts +754 -0
  190. package/node_modules/fast-xml-parser/src/fxp.js +14 -0
  191. package/node_modules/fast-xml-parser/src/ignoreAttributes.js +18 -0
  192. package/node_modules/fast-xml-parser/src/util.js +61 -0
  193. package/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +16 -0
  194. package/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +106 -0
  195. package/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +61 -0
  196. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +69 -0
  197. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +103 -0
  198. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +100 -0
  199. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +154 -0
  200. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +94 -0
  201. package/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
  202. package/node_modules/fast-xml-parser/src/v6/TagPath.js +81 -0
  203. package/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +13 -0
  204. package/node_modules/fast-xml-parser/src/v6/XMLParser.js +83 -0
  205. package/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +235 -0
  206. package/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +210 -0
  207. package/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +111 -0
  208. package/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +116 -0
  209. package/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +121 -0
  210. package/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +105 -0
  211. package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +22 -0
  212. package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +19 -0
  213. package/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +38 -0
  214. package/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +13 -0
  215. package/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +14 -0
  216. package/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +6 -0
  217. package/node_modules/fast-xml-parser/src/validator.js +518 -0
  218. package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +6 -0
  219. package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +426 -0
  220. package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +164 -0
  221. package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +907 -0
  222. package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +77 -0
  223. package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +177 -0
  224. package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +54 -0
  225. package/package.json +10 -8
  226. package/src/analysis/evidence.ts +331 -73
  227. package/src/analysis/health/diagnostics.ts +66 -18
  228. package/src/analysis/health/evidence-reason.ts +44 -0
  229. package/src/analysis/health/server-status.ts +32 -9
  230. package/src/analysis/health/signals.ts +1 -0
  231. package/src/analysis/instruction-files.ts +11 -7
  232. package/src/analysis/search/exclusions.ts +18 -4
  233. package/src/analysis/search/pattern.ts +3 -3
  234. package/src/analysis/target/anchored.ts +3 -6
  235. package/src/analysis/target/file-outline-omissions.ts +17 -2
  236. package/src/analysis/target/symbol-selection.ts +100 -0
  237. package/src/analysis/target/symbol.ts +83 -49
  238. package/src/analysis/target/types.ts +12 -10
  239. package/src/analysis/workspace/cmake-parser.ts +207 -0
  240. package/src/analysis/workspace/cmake.ts +141 -0
  241. package/src/analysis/workspace/maven.ts +310 -0
  242. package/src/analysis/workspace/membership.ts +100 -26
  243. package/src/analysis/workspace/metadata.ts +6 -1
  244. package/src/analysis/workspace/observe.ts +6 -0
  245. package/src/analysis/workspace/types.ts +11 -3
  246. package/src/app/app.ts +37 -21
  247. package/src/diagnostics/coverage.ts +49 -0
  248. package/src/diagnostics/evidence.ts +10 -2
  249. package/src/extension.ts +1 -2
  250. package/src/headless.ts +4 -2
  251. package/src/session/health-types.ts +2 -0
  252. package/src/session/health-workflow.ts +6 -0
  253. package/src/session/input/common.ts +1 -1
  254. package/src/session/orientation/collect.ts +42 -7
  255. package/src/session/orientation/context-facts.ts +3 -3
  256. package/src/session/orientation/context-sections.ts +13 -15
  257. package/src/session/orientation/facts.ts +5 -8
  258. package/src/session/orientation-types.ts +5 -0
  259. package/src/session/orientation-workflow.ts +12 -17
  260. package/src/session/target-workflow.ts +38 -25
  261. package/src/tool/code_find/render.ts +10 -11
  262. package/src/tool/code_find/result.ts +11 -8
  263. package/src/tool/code_graph/display.ts +5 -6
  264. package/src/tool/code_graph/format.ts +8 -24
  265. package/src/tool/code_graph/result.ts +16 -75
  266. package/src/tool/code_graph/section.ts +21 -33
  267. package/src/tool/code_graph/structured.ts +3 -0
  268. package/src/tool/code_graph/tui.ts +10 -5
  269. package/src/tool/code_health/diagnostic-tui.ts +49 -0
  270. package/src/tool/code_health/guidance.ts +27 -0
  271. package/src/tool/code_health/markdown.ts +63 -9
  272. package/src/tool/code_health/result.ts +20 -9
  273. package/src/tool/code_health/structured-schema.ts +15 -0
  274. package/src/tool/code_health/structured.ts +9 -1
  275. package/src/tool/code_health/tui.ts +33 -40
  276. package/src/tool/code_inspect/result.ts +23 -18
  277. package/src/tool/code_inspect/structured.ts +2 -19
  278. package/src/tool/code_orientation/markdown.ts +6 -1
  279. package/src/tool/code_orientation/result.ts +53 -100
  280. package/src/tool/code_orientation/structured-schema.ts +16 -12
  281. package/src/tool/code_orientation/structured-workspace.ts +13 -7
  282. package/src/tool/code_orientation/structured.ts +31 -39
  283. package/src/tool/code_orientation/workspace-format.ts +4 -10
  284. package/src/tool/code_orientation/workspace-instructions.ts +4 -5
  285. package/src/tool/code_orientation/workspace-observations.ts +2 -2
  286. package/src/tool/code_orientation/workspace-output.ts +16 -7
  287. package/src/tool/code_orientation/workspace-projects.ts +7 -10
  288. package/src/tool/code_orientation/workspace-sections.ts +13 -19
  289. package/src/tool/code_resolve/markdown.ts +4 -46
  290. package/src/tool/code_resolve/result.ts +45 -73
  291. package/src/tool/code_resolve/structured.ts +6 -1
  292. package/src/tool/infra/truncate.ts +2 -16
  293. package/src/tool/result/candidate-selection.ts +157 -0
  294. package/src/tool/result/display.ts +41 -45
  295. package/src/tool/result/errors.ts +1 -0
  296. package/src/tool/result/model-budget.ts +26 -1
  297. package/src/tool/result/refactor.ts +11 -8
  298. package/src/tool/result/structured.ts +2 -1
  299. package/src/tool/result/types.ts +9 -8
  300. package/src/tool/schemas.ts +15 -20
  301. package/src/ui/footer.ts +147 -44
  302. package/src/ui/status-overlay.ts +13 -8
  303. package/src/ui/status-presentation.ts +4 -7
  304. package/src/ui/tui/candidate-selection.ts +40 -95
  305. package/src/ui/tui/common.ts +16 -70
  306. package/src/ui/tui/display.ts +6 -24
  307. package/src/tool/result/candidate-row.ts +0 -49
@@ -3,11 +3,9 @@
3
3
  // and notification/request dispatching through vscode-jsonrpc's MessageConnection.
4
4
  // biome-ignore-all lint/style/noExcessiveLinesPerFile: Transport lifetime and protocol handling stay together.
5
5
 
6
+ import { performance } from "node:perf_hooks";
6
7
  import type { Readable, Writable } from "node:stream";
7
- import {
8
- type CodeRequestControl,
9
- CodeRequestDeadlineError,
10
- } from "@mrclrchtr/supi-code-runtime/api";
8
+ import { CodeRequestDeadlineError } from "@mrclrchtr/supi-code-runtime/api";
11
9
  import {
12
10
  startDebugTimer,
13
11
  truncateDebugIdentity as truncateIdentity,
@@ -22,7 +20,11 @@ import {
22
20
  StreamMessageReader,
23
21
  StreamMessageWriter,
24
22
  } from "vscode-jsonrpc/node";
25
- import { boundCwd, LSP_REQUEST_TIMEOUT_ERROR_CODE } from "../debug-telemetry.ts";
23
+ import {
24
+ type BatchedRequestControl,
25
+ boundCwd,
26
+ LSP_REQUEST_TIMEOUT_ERROR_CODE,
27
+ } from "../debug-telemetry.ts";
26
28
 
27
29
  const DEFAULT_TIMEOUT_MS = 30_000;
28
30
 
@@ -112,7 +114,7 @@ export class JsonRpcClient {
112
114
  sendRequestOwned(
113
115
  method: string,
114
116
  params?: unknown,
115
- options?: { timeoutMs?: number } & CodeRequestControl,
117
+ options?: { timeoutMs?: number } & BatchedRequestControl,
116
118
  ): { result: Promise<unknown>; settled: Promise<void> } {
117
119
  let settle!: () => void;
118
120
  const settled = new Promise<void>((resolve) => {
@@ -133,12 +135,20 @@ export class JsonRpcClient {
133
135
  return { result, settled };
134
136
  }
135
137
 
136
- /** Send a request and wait for the correlated response, optionally overriding the timeout. */
138
+ /**
139
+ * Send a request and wait for the correlated response, optionally overriding
140
+ * the timeout. With `requestTimings`, a completed request adds its duration
141
+ * to that batch instead of recording its own `request.timing` event.
142
+ */
137
143
  // biome-ignore lint/complexity/noExcessiveLinesPerFunction: Request timeout and cancellation races stay together.
138
144
  sendRequest(
139
145
  method: string,
140
146
  params?: unknown,
141
- options?: { timeoutMs?: number; onSettled?: () => void; owned?: boolean } & CodeRequestControl,
147
+ options?: {
148
+ timeoutMs?: number;
149
+ onSettled?: () => void;
150
+ owned?: boolean;
151
+ } & BatchedRequestControl,
142
152
  ): Promise<unknown> {
143
153
  const timeoutMs = options?.timeoutMs ?? this.timeoutMs;
144
154
  const owned = options?.owned === true;
@@ -147,6 +157,8 @@ export class JsonRpcClient {
147
157
  const methodClass = classifyRequestMethod(method);
148
158
  const boundedMethod = truncateIdentity(method);
149
159
  const timer = startDebugTimer();
160
+ const requestTimings = timer.enabled ? options?.requestTimings : undefined;
161
+ const startedAt = requestTimings ? performance.now() : 0;
150
162
  // A request cancelled before dispatch must not produce protocol traffic.
151
163
  if (signal?.aborted) {
152
164
  const result = rejectUndispatchedRequest(
@@ -259,6 +271,10 @@ export class JsonRpcClient {
259
271
  ])
260
272
  .then(
261
273
  (result) => {
274
+ if (requestTimings) {
275
+ requestTimings.add(boundedMethod, performance.now() - startedAt);
276
+ return result;
277
+ }
262
278
  recordRequestTiming(
263
279
  timer,
264
280
  options?.operationId,
@@ -70,6 +70,11 @@ export interface ProjectServerInfo extends DetectedProjectServer {
70
70
  openFiles: string[];
71
71
  /** Whether the LSP server is currently not indexing and ready to serve queries. */
72
72
  ready: boolean;
73
+ /**
74
+ * Present while the background warm-up loads the route's projects. The route
75
+ * answers queries; a symbol query waits for the pass.
76
+ */
77
+ loadingProjects?: true;
73
78
  /** Negotiated operation support, when the route has a capability snapshot. */
74
79
  operationSupport?: ServerOperationSupportMap;
75
80
  }
@@ -1,6 +1,6 @@
1
1
  import * as path from "node:path";
2
- import ts from "typescript";
3
2
  import { normalizeTsconfigPath as normalizePath } from "./tsconfig-path.ts";
3
+ import { getTypeScript } from "./typescript-module.ts";
4
4
 
5
5
  /**
6
6
  * Collect recognized local project configs declared by `extends`, including
@@ -15,6 +15,7 @@ export function collectExtendedProjectConfigs(configPath: string): Set<string> {
15
15
  if (visited.has(normalizedConfigPath)) return;
16
16
  visited.add(normalizedConfigPath);
17
17
 
18
+ const ts = getTypeScript();
18
19
  const config = ts.readConfigFile(currentConfigPath, ts.sys.readFile).config;
19
20
  if (!config || typeof config !== "object") return;
20
21
 
@@ -1,8 +1,8 @@
1
1
  import * as path from "node:path";
2
- import ts from "typescript";
2
+ import { getTypeScript } from "./typescript-module.ts";
3
3
 
4
4
  /** Normalize a path for tsconfig cache keys and comparisons. */
5
5
  export function normalizeTsconfigPath(target: string): string {
6
6
  const resolved = path.resolve(target).replaceAll("\\", "/");
7
- return ts.sys.useCaseSensitiveFileNames ? resolved : resolved.toLowerCase();
7
+ return getTypeScript().sys.useCaseSensitiveFileNames ? resolved : resolved.toLowerCase();
8
8
  }
@@ -6,9 +6,10 @@
6
6
  // to suppress LSP errors on files that TypeScript itself would not include.
7
7
 
8
8
  import * as path from "node:path";
9
- import ts from "typescript";
9
+ import type ts from "typescript";
10
10
  import { collectExtendedProjectConfigs } from "./tsconfig-extends.ts";
11
11
  import { normalizeTsconfigPath as normalizePath } from "./tsconfig-path.ts";
12
+ import { getTypeScript } from "./typescript-module.ts";
12
13
 
13
14
  export { isProjectConfigFileName } from "./tsconfig-extends.ts";
14
15
 
@@ -74,7 +75,7 @@ export function isTsconfigApplicableFile(filePath: string): boolean {
74
75
  const nearestConfigCache = new Map<string, string | null>();
75
76
  const parsedConfigCache = new Map<string, ParsedProjectConfigCacheEntry>();
76
77
 
77
- const tsInternal = ts as typeof ts & {
78
+ type TypeScriptInternal = typeof ts & {
78
79
  getFileMatcherPatterns?: (
79
80
  configDir: string,
80
81
  excludes: readonly string[] | undefined,
@@ -91,6 +92,10 @@ const tsInternal = ts as typeof ts & {
91
92
  ) => ReadonlyArray<ReadonlyArray<string>>;
92
93
  };
93
94
 
95
+ function getTypeScriptInternal(): TypeScriptInternal {
96
+ return getTypeScript() as TypeScriptInternal;
97
+ }
98
+
94
99
  /**
95
100
  * Check whether a file is excluded by its nearest tsconfig.json or jsconfig.json.
96
101
  *
@@ -122,7 +127,7 @@ export function isFileExcludedByTsconfig(filePath: string, cwd: string): boolean
122
127
  * project config without re-deriving the scope logic.
123
128
  */
124
129
  export function getFileScopeDecision(filePath: string, cwd: string): FileScopeDecision {
125
- const caseSensitiveFileNames = ts.sys.useCaseSensitiveFileNames;
130
+ const caseSensitiveFileNames = getTypeScript().sys.useCaseSensitiveFileNames;
126
131
  const absolutePath = path.resolve(cwd, filePath);
127
132
  if (isOutOfTree(cwd, absolutePath)) {
128
133
  return {
@@ -172,6 +177,9 @@ export function projectConfigIncludesFile(configPath: string, filePath: string):
172
177
  return parsed !== null && decideFileScope(parsed, path.resolve(filePath)).included;
173
178
  }
174
179
 
180
+ /** Normalized paths of the files in a project config's program; undefined when it cannot be parsed. */
181
+ export const projectFileNames = (config: string) => parseProjectConfig(config)?.fileNames;
182
+
175
183
  function isOutOfTree(cwd: string, absolutePath: string): boolean {
176
184
  const relative = path.relative(path.resolve(cwd), absolutePath);
177
185
  return relative.startsWith(`..${path.sep}`) || relative === "..";
@@ -212,6 +220,7 @@ function findNearestProjectConfig(startDir: string, rootDir: string): string | n
212
220
  }
213
221
 
214
222
  function getLocalProjectConfig(directory: string): string | null {
223
+ const ts = getTypeScript();
215
224
  const tsconfigPath = path.join(directory, "tsconfig.json");
216
225
  if (ts.sys.fileExists(tsconfigPath)) return tsconfigPath;
217
226
 
@@ -230,6 +239,7 @@ function parseProjectConfig(configPath: string): ParsedProjectConfig | null {
230
239
  parsed: null,
231
240
  dependencies: collectExtendedProjectConfigs(configPath),
232
241
  };
242
+ const ts = getTypeScript();
233
243
  const parsed = ts.getParsedCommandLineOfConfigFile(configPath, {}, createParseConfigHost());
234
244
  if (!parsed) {
235
245
  parsedConfigCache.set(normalizedConfigPath, cacheEntry);
@@ -343,6 +353,7 @@ function decideFileScope(
343
353
  }
344
354
 
345
355
  function getSupportedExtensions(options: ts.CompilerOptions): string[] {
356
+ const tsInternal = getTypeScriptInternal();
346
357
  return tsInternal.getSupportedExtensions
347
358
  ? [...tsInternal.getSupportedExtensions(options, undefined).flat()]
348
359
  : [".ts", ".tsx", ".d.ts", ".cts", ".d.cts", ".mts", ".d.mts"];
@@ -353,12 +364,13 @@ function getFileMatcherPatterns(
353
364
  excludeSpecs: readonly string[] | undefined,
354
365
  includeSpecs: readonly string[] | undefined,
355
366
  ): { includeFilePattern?: string; excludePattern?: string } {
367
+ const tsInternal = getTypeScriptInternal();
356
368
  return tsInternal.getFileMatcherPatterns
357
369
  ? tsInternal.getFileMatcherPatterns(
358
370
  configDir,
359
371
  excludeSpecs,
360
372
  includeSpecs,
361
- ts.sys.useCaseSensitiveFileNames,
373
+ tsInternal.sys.useCaseSensitiveFileNames,
362
374
  path.parse(configDir).root,
363
375
  )
364
376
  : {};
@@ -366,7 +378,7 @@ function getFileMatcherPatterns(
366
378
 
367
379
  function createParseConfigHost(): ts.ParseConfigFileHost {
368
380
  return {
369
- ...ts.sys,
381
+ ...getTypeScript().sys,
370
382
  onUnRecoverableConfigFileDiagnostic: () => {
371
383
  // Treat invalid configs as unsupported rather than surfacing a secondary
372
384
  // filter failure to the agent.
@@ -0,0 +1,17 @@
1
+ import { createRequire } from "node:module";
2
+ import type ts from "typescript";
3
+
4
+ const require = createRequire(import.meta.url);
5
+ let cached: typeof ts | undefined;
6
+
7
+ /**
8
+ * Load the bundled TypeScript compiler API on first use.
9
+ *
10
+ * Evaluating `typescript` costs roughly 100 ms, and most sessions and tests that import this
11
+ * package never ask a tsconfig question. Callers stay synchronous, so this uses `require`
12
+ * rather than a dynamic `import()`.
13
+ */
14
+ export function getTypeScript(): typeof ts {
15
+ cached ??= require("typescript") as typeof ts;
16
+ return cached;
17
+ }
@@ -4,6 +4,7 @@
4
4
  // identity for local protocol diagnosis. Each identity string and list uses
5
5
  // the shared bounds.
6
6
 
7
+ import type { CodeRequestControl } from "@mrclrchtr/supi-code-runtime/api";
7
8
  import { truncateDebugIdentity } from "@mrclrchtr/supi-core/debug";
8
9
 
9
10
  /** Maximum number of server entries in one bounded LSP debug payload. */
@@ -29,3 +30,66 @@ export function boundCwd(cwd: string | undefined): string | undefined {
29
30
  export function boundServerNames(names: readonly string[]): string[] {
30
31
  return names.slice(0, MAX_SERVERS).map(truncateDebugIdentity);
31
32
  }
33
+
34
+ /** Maximum number of distinct methods one batch reports by name. */
35
+ const MAX_BATCH_METHODS = 16;
36
+ const OTHER_BATCH_METHODS = "other";
37
+
38
+ /** Completed-request totals for one method of a batch operation. */
39
+ export interface RequestTimingTotals {
40
+ readonly count: number;
41
+ readonly totalMs: number;
42
+ readonly maxMs: number;
43
+ }
44
+
45
+ /**
46
+ * Completed-request timings of one batch operation, such as a diagnostic
47
+ * refresh over every open document or a workspace-symbol warm-up pass.
48
+ *
49
+ * A batch sends one request per document. Recording each as its own
50
+ * `request.timing` event fills the Debug buffer with near-identical events, so
51
+ * the transport adds completed requests here instead and the batch's summary
52
+ * event reports them through `snapshot()`. Failed, timed-out, and cancelled
53
+ * requests still record their own event. A request that completes after its
54
+ * batch reported is not recorded.
55
+ */
56
+ export class RequestTimingBatch {
57
+ readonly #methods = new Map<string, { count: number; totalMs: number; maxMs: number }>();
58
+
59
+ /** Add one completed request. */
60
+ add(method: string, durationMs: number): void {
61
+ const known = this.#methods.has(method) || this.#methods.size < MAX_BATCH_METHODS;
62
+ const key = known ? method : OTHER_BATCH_METHODS;
63
+ const totals = this.#methods.get(key) ?? { count: 0, totalMs: 0, maxMs: 0 };
64
+ const elapsed = Number.isFinite(durationMs) ? Math.max(0, durationMs) : 0;
65
+ totals.count++;
66
+ totals.totalMs += elapsed;
67
+ totals.maxMs = Math.max(totals.maxMs, elapsed);
68
+ this.#methods.set(key, totals);
69
+ }
70
+
71
+ /** Totals by method, or `undefined` when no request completed. */
72
+ snapshot(): Record<string, RequestTimingTotals> | undefined {
73
+ if (this.#methods.size === 0) return undefined;
74
+ return Object.fromEntries(
75
+ Array.from(this.#methods, ([method, totals]) => [
76
+ method,
77
+ {
78
+ count: totals.count,
79
+ totalMs: roundDuration(totals.totalMs),
80
+ maxMs: roundDuration(totals.maxMs),
81
+ },
82
+ ]),
83
+ );
84
+ }
85
+ }
86
+
87
+ /** Request control that also routes completed-request timings into a batch. */
88
+ export interface BatchedRequestControl extends CodeRequestControl {
89
+ /** Collects completed request timings instead of one event per request. */
90
+ readonly requestTimings?: RequestTimingBatch;
91
+ }
92
+
93
+ function roundDuration(value: number): number {
94
+ return Math.round(value * 10) / 10;
95
+ }
@@ -5,10 +5,20 @@ export const TENTATIVE_PUSH_UNAVAILABLE_REASON =
5
5
  /** A final evidence state for one tracked document. */
6
6
  export type DiagnosticEvidenceStatus = "confirmed" | "unconfirmed" | "failed" | "removed";
7
7
 
8
+ /**
9
+ * Why a document is not confirmed, when a specific cause is known.
10
+ *
11
+ * `disk-changed`: the file's disk metadata changed after its content was last
12
+ * read and diagnosed, for example through an edit outside Pi.
13
+ */
14
+ export type DiagnosticEvidenceReason = "disk-changed";
15
+
8
16
  /** Freshness evidence for one tracked document. */
9
17
  export interface DiagnosticEvidenceDocument {
10
18
  readonly file: string;
11
19
  readonly status: DiagnosticEvidenceStatus;
20
+ /** Known cause for a non-confirmed status. */
21
+ readonly reason?: DiagnosticEvidenceReason;
12
22
  }
13
23
 
14
24
  /** Exact document coverage from a diagnostic snapshot or refresh attempt. */
@@ -35,3 +45,35 @@ export function summarizeDiagnosticEvidence(
35
45
  for (const document of documents) counts[document.status]++;
36
46
  return { ...counts, documents: [...documents] };
37
47
  }
48
+
49
+ function evidenceStatusRank(status: DiagnosticEvidenceStatus): number {
50
+ switch (status) {
51
+ case "confirmed":
52
+ return 1;
53
+ case "unconfirmed":
54
+ return 2;
55
+ case "failed":
56
+ return 3;
57
+ case "removed":
58
+ return 4;
59
+ }
60
+ }
61
+
62
+ /**
63
+ * Choose the more conservative of two documents for the same file.
64
+ *
65
+ * The higher status rank wins. For equal rank, a known `reason` is kept so a
66
+ * reason-less duplicate from another route cannot drop it.
67
+ */
68
+ export function preferEvidenceDocument(
69
+ existing: DiagnosticEvidenceDocument | undefined,
70
+ next: DiagnosticEvidenceDocument,
71
+ ): DiagnosticEvidenceDocument {
72
+ if (!existing) return next;
73
+ const nextRank = evidenceStatusRank(next.status);
74
+ const existingRank = evidenceStatusRank(existing.status);
75
+ if (nextRank > existingRank) return next;
76
+ if (nextRank < existingRank) return existing;
77
+ if (existing.reason === undefined && next.reason !== undefined) return next;
78
+ return existing;
79
+ }
@@ -9,6 +9,7 @@ import { getDiagnosticFileState } from "../client/client-file-state.ts";
9
9
  import {
10
10
  type DiagnosticEvidenceDocument,
11
11
  type DiagnosticEvidenceSummary,
12
+ preferEvidenceDocument,
12
13
  summarizeDiagnosticEvidence,
13
14
  } from "../diagnostics/evidence.ts";
14
15
 
@@ -82,23 +83,7 @@ function deduplicateEvidenceDocuments(
82
83
  ): DiagnosticEvidenceDocument[] {
83
84
  const byFile = new Map<string, DiagnosticEvidenceDocument>();
84
85
  for (const document of documents) {
85
- const existing = byFile.get(document.file);
86
- if (!existing || evidenceStatusRank(document.status) > evidenceStatusRank(existing.status)) {
87
- byFile.set(document.file, document);
88
- }
86
+ byFile.set(document.file, preferEvidenceDocument(byFile.get(document.file), document));
89
87
  }
90
88
  return Array.from(byFile.values()).sort((a, b) => a.file.localeCompare(b.file));
91
89
  }
92
-
93
- function evidenceStatusRank(status: DiagnosticEvidenceDocument["status"]): number {
94
- switch (status) {
95
- case "confirmed":
96
- return 1;
97
- case "unconfirmed":
98
- return 2;
99
- case "failed":
100
- return 3;
101
- case "removed":
102
- return 4;
103
- }
104
- }
@@ -16,6 +16,8 @@ interface ProjectServerInfoInput {
16
16
  statusReason?: ProjectServerStatusReason;
17
17
  typescript?: TypeScriptSelection;
18
18
  failureMessage?: string;
19
+ /** The background warm-up is loading this route's projects. */
20
+ loadingProjects?: boolean;
19
21
  /** Filter files from ambient project status without changing explicit routing. */
20
22
  includeOpenFile?: (file: string) => boolean;
21
23
  }
@@ -51,6 +53,7 @@ export function buildProjectServerInfo(
51
53
  .filter((file) => input.includeOpenFile?.(file) ?? true)
52
54
  .map((file) => displayRelativeFilePath(file, cwd)) ?? [],
53
55
  ready: input.client?.ready ?? false,
56
+ ...(input.loadingProjects ? { loadingProjects: true as const } : {}),
54
57
  operationSupport: getServerOperationSupport(input.client?.serverCapabilities ?? null),
55
58
  };
56
59
  }
@@ -0,0 +1,52 @@
1
+ import * as path from "node:path";
2
+ import { isWithinOrEqual } from "@mrclrchtr/supi-core/project";
3
+ import { getDiagnosticFileState } from "../client/client-file-state.ts";
4
+
5
+ /**
6
+ * Session-owned record of tracked files that disappeared from disk.
7
+ *
8
+ * Every path that clears tracked state for a missing file records the file here,
9
+ * including passive snapshot reads and background server-requested refreshes.
10
+ * The record survives until a caller acknowledges that a report showed the
11
+ * removal, so the removal does not depend on when the next refresh runs.
12
+ *
13
+ * Example: `rm src/a.ts`, then the TypeScript server sends
14
+ * `workspace/diagnostic/refresh`. The background refresh clears `src/a.ts`.
15
+ * A later `code_health({ refresh: true })` still reports it as removed.
16
+ *
17
+ * Entries come only from previously tracked files, so the record is bounded by
18
+ * the tracked-file state it replaces.
19
+ */
20
+ export class RemovedTrackedFileLedger {
21
+ readonly #files = new Set<string>();
22
+
23
+ /** Record one removed tracked file. */
24
+ record(filePath: string): void {
25
+ this.#files.add(path.resolve(filePath));
26
+ }
27
+
28
+ /**
29
+ * Return retained removals within `scope`, sorted, without consuming them.
30
+ *
31
+ * Files that exist again are dropped: a recreated file is no longer removed.
32
+ */
33
+ peek(scope: string | null = null): string[] {
34
+ for (const file of this.#files) {
35
+ if (getDiagnosticFileState(file) !== "removed") this.#files.delete(file);
36
+ }
37
+ const root = scope === null ? null : path.resolve(scope);
38
+ return Array.from(this.#files)
39
+ .filter((file) => root === null || isWithinOrEqual(root, file))
40
+ .sort((left, right) => left.localeCompare(right));
41
+ }
42
+
43
+ /** Forget removals that a delivered diagnostic report has shown. */
44
+ acknowledge(files: readonly string[]): void {
45
+ for (const file of files) this.#files.delete(path.resolve(file));
46
+ }
47
+
48
+ /** Forget every retained removal. */
49
+ clear(): void {
50
+ this.#files.clear();
51
+ }
52
+ }
@@ -1,7 +1,11 @@
1
1
  import * as path from "node:path";
2
2
  import { collectExtendedProjectConfigs } from "../config/tsconfig-extends.ts";
3
3
  import { normalizeTsconfigPath } from "../config/tsconfig-path.ts";
4
- import { getFileScopeDecision, projectConfigIncludesFile } from "../config/tsconfig-scope.ts";
4
+ import {
5
+ getFileScopeDecision,
6
+ projectConfigIncludesFile,
7
+ projectFileNames,
8
+ } from "../config/tsconfig-scope.ts";
5
9
  import { type AutomaticLspPathPolicy, walkAutomaticLspTree } from "../workspace-path-policy.ts";
6
10
 
7
11
  /** Directory depth searched for project configs below a TypeScript route root. */
@@ -43,6 +47,9 @@ export function discoverTypeScriptProjectConfigs(
43
47
  * Base configs extended by another discovered config are skipped: their
44
48
  * default include usually spans the whole tree while they own only root
45
49
  * tooling files, so counting them would mark nearly every answer partial.
50
+ *
51
+ * Projects that own no file are skipped too: their program holds only files of
52
+ * other projects, and no open file or answer could ever show them as loaded.
46
53
  */
47
54
  export function findUnloadedTypeScriptProjects(options: {
48
55
  readonly file: string;
@@ -64,11 +71,29 @@ export function findUnloadedTypeScriptProjects(options: {
64
71
  return options.configs.filter((config) => {
65
72
  const key = normalizeTsconfigPath(config);
66
73
  return (
67
- !loaded.has(key) && !baseConfigs.has(key) && projectConfigIncludesFile(config, options.file)
74
+ !loaded.has(key) &&
75
+ !baseConfigs.has(key) &&
76
+ projectConfigIncludesFile(config, options.file) &&
77
+ ownsProgramFile(config, options.cwd)
68
78
  );
69
79
  });
70
80
  }
71
81
 
82
+ /**
83
+ * Whether a project config is the nearest config of a file in its own program.
84
+ * A test config that includes `../src` before any test exists owns none.
85
+ */
86
+ function ownsProgramFile(config: string, cwd: string): boolean {
87
+ const key = normalizeTsconfigPath(config);
88
+ // Program file names are normalized, so the tree root must be too.
89
+ const root = normalizeTsconfigPath(cwd);
90
+ for (const file of projectFileNames(config) ?? []) {
91
+ const nearest = getFileScopeDecision(file, root).configPath;
92
+ if (nearest && normalizeTsconfigPath(nearest) === key) return true;
93
+ }
94
+ return false;
95
+ }
96
+
72
97
  /**
73
98
  * Other projects that tsserver's implementation search skips for `file`.
74
99
  *
@@ -1,28 +1,13 @@
1
1
  import { type Dirent, realpathSync, statSync } from "node:fs";
2
2
  import * as path from "node:path";
3
- import {
4
- type CodeQueryResult,
5
- type CodeRequestControl,
6
- completedCodeQuery,
7
- partialCodeQuery,
8
- unavailableCodeQuery,
9
- } from "@mrclrchtr/supi-code-runtime/api";
10
3
  import { isWithinOrEqual } from "@mrclrchtr/supi-core/project";
11
- import type { LspClient } from "../client/client.ts";
12
- import type {
13
- DocumentSymbol,
14
- Position,
15
- SymbolInformation,
16
- WorkspaceSymbol,
17
- } from "../config/types.ts";
4
+ import type { DocumentSymbol, Position, SymbolInformation } from "../config/types.ts";
18
5
  import {
19
6
  type AutomaticLspPathPolicy,
20
7
  createDefaultAutomaticLspPathPolicy,
21
8
  walkAutomaticLspTree,
22
9
  } from "../workspace-path-policy.ts";
23
10
 
24
- type WorkspaceSymbolLike = SymbolInformation | WorkspaceSymbol;
25
-
26
11
  const DEFAULT_WARM_FILE_DEPTH = 4;
27
12
  const DEFAULT_MARKER_SCAN_DEPTH = 6;
28
13
  /** Candidates per marker root; later candidates help only when earlier ones land outside the project. */
@@ -58,109 +43,28 @@ export function getWorkspaceSymbolWarmPosition(
58
43
  return null;
59
44
  }
60
45
 
61
- export interface WorkspaceSymbolCollection {
62
- results: WorkspaceSymbolLike[];
63
- hasSupport: boolean;
64
- completedClientCount: number;
65
- failures: string[];
66
- /** Results removed by the automatic path policy. */
67
- excludedCount?: number;
68
- /** Bounded paths removed by the automatic path policy. */
69
- excludedExamples?: string[];
70
- /** Known coverage limits: the server may not have loaded every project in scope. */
71
- coverageGap?: string;
72
- }
46
+ /** Project roots one all-roots warm-up pass opens for a route. */
47
+ const MAX_WARM_ROOTS = 96;
73
48
 
74
49
  /**
75
- * Mark a collection whose warm-up never reached a configured project.
76
- * The server answered only from inferred projects of the opened probe files,
77
- * so an empty or short result does not prove a symbol is absent.
50
+ * Bound an all-roots warm-up pass. Roots past the limit stay unopened, and the
51
+ * returned gap says so: their symbols may be missing from the result.
78
52
  */
79
- export function workspaceSymbolCoverageGap(
80
- collection: WorkspaceSymbolCollection,
81
- inferredProbeCount: number,
82
- ): WorkspaceSymbolCollection {
83
- const noun = `file${inferredProbeCount === 1 ? "" : "s"}`;
53
+ export function limitWorkspaceSymbolWarmRoots(targets: readonly WorkspaceSymbolWarmTarget[]): {
54
+ targets: WorkspaceSymbolWarmTarget[];
55
+ gap: string | null;
56
+ } {
57
+ const roots = [...new Set(targets.map((target) => target.projectRoot))];
58
+ if (roots.length <= MAX_WARM_ROOTS) return { targets: [...targets], gap: null };
59
+ const kept = new Set(roots.slice(0, MAX_WARM_ROOTS));
84
60
  return {
85
- ...collection,
86
- coverageGap:
87
- `Workspace-symbol coverage is limited: ${inferredProbeCount} opened warm-up ${noun} ` +
88
- "loaded only inferred projects, not a configured project. Open a project source file and retry.",
61
+ targets: targets.filter((target) => kept.has(target.projectRoot)),
62
+ gap:
63
+ `Workspace-symbol coverage is limited: ${roots.length - MAX_WARM_ROOTS} of ${roots.length} ` +
64
+ "project roots were not opened. Pass a narrower scope and retry.",
89
65
  };
90
66
  }
91
67
 
92
- export async function collectWorkspaceSymbols(
93
- clients: Iterable<LspClient>,
94
- query: string,
95
- control?: CodeRequestControl,
96
- ): Promise<WorkspaceSymbolCollection> {
97
- const results: WorkspaceSymbolLike[] = [];
98
- const failures: string[] = [];
99
- let hasSupport = false;
100
- let completedClientCount = 0;
101
-
102
- for (const client of clients) {
103
- if (client.status !== "running") continue;
104
- if (!client.serverCapabilities?.workspaceSymbolProvider) continue;
105
- hasSupport = true;
106
- const result = await client.workspaceSymbol(query, control);
107
- if (result.kind === "unavailable") {
108
- failures.push(result.reason);
109
- continue;
110
- }
111
- completedClientCount++;
112
- results.push(...(result.data ?? []));
113
- if (result.kind === "partial") failures.push(result.reason);
114
- }
115
-
116
- return { results, hasSupport, completedClientCount, failures };
117
- }
118
-
119
- function workspaceSymbolExclusionReason(collection: WorkspaceSymbolCollection): string | null {
120
- const excludedCount = collection.excludedCount ?? 0;
121
- if (excludedCount === 0) return null;
122
- const noun = `workspace-symbol result${excludedCount === 1 ? "" : "s"}`;
123
- // Paths belong to typed metadata so consumers can distinguish observed aliases from navigation.
124
- return `Automatic path policy excluded ${excludedCount} ${noun}.`;
125
- }
126
-
127
- /** Project one multi-client collection into the shared typed query contract. */
128
- export function workspaceSymbolCollectionResult(
129
- collection: WorkspaceSymbolCollection,
130
- ): CodeQueryResult<WorkspaceSymbolLike[]> {
131
- if (!collection.hasSupport) {
132
- return unavailableCodeQuery("No active LSP client supports workspace-symbol requests.");
133
- }
134
- if (collection.completedClientCount === 0) {
135
- return unavailableCodeQuery(
136
- collection.failures.join("; ") || "No workspace-symbol request completed.",
137
- );
138
- }
139
- const exclusion = workspaceSymbolExclusionReason(collection);
140
- if (collection.failures.length > 0 || exclusion || collection.coverageGap) {
141
- const excludedCount = collection.excludedCount ?? 0;
142
- const exclusionOnly = collection.failures.length === 0 && !collection.coverageGap;
143
- const metadata =
144
- excludedCount > 0
145
- ? {
146
- automaticPathExclusion: {
147
- excludedCount,
148
- examples: [...(collection.excludedExamples ?? [])],
149
- },
150
- ...(exclusionOnly ? { exclusionOnly: true } : {}),
151
- }
152
- : undefined;
153
- return partialCodeQuery(
154
- collection.results,
155
- [collection.failures.join("; "), collection.coverageGap, exclusion]
156
- .filter(Boolean)
157
- .join("; "),
158
- metadata,
159
- );
160
- }
161
- return completedCodeQuery(collection.results);
162
- }
163
-
164
68
  /**
165
69
  * Choose files to open so a workspace-symbol server loads the projects under `root`.
166
70
  *