@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
@@ -1,3 +1,9 @@
1
+ import {
2
+ describeEvidenceList,
3
+ type EvidenceListMetadata,
4
+ readEvidenceListFacts,
5
+ toEvidenceListFacts,
6
+ } from "../../analysis/evidence.ts";
1
7
  import type { ToolDisplaySection } from "./types.ts";
2
8
 
3
9
  /** Maximum number of rows shown for one expanded TUI section. */
@@ -8,49 +14,53 @@ export const MAX_TUI_DISPLAY_LINE_LENGTH = 240;
8
14
 
9
15
  /** Inputs for one bounded structured TUI section. */
10
16
  export interface ToolDisplaySectionInput<T> {
11
- key: string;
17
+ /** Section key; defaults to the evidence key. */
18
+ key?: string;
12
19
  title: string;
20
+ /** Rows to show; the view may hide some as Display omissions. */
13
21
  items: readonly T[];
22
+ /** Canonical Evidence list metadata this section previews; only constructors produce it. */
23
+ evidence: EvidenceListMetadata;
14
24
  format: (item: T) => string;
15
- totalCount?: number | null;
16
- omittedCount?: number | null;
17
- partialReason?: string | null;
18
- /** Provider explanation for incomplete collection, when available. */
19
- partialMessage?: string;
20
25
  maxItems?: number;
21
26
  /** Explicit content-count meaning when display rows are not individual Evidence atoms. */
22
27
  preview?: ToolDisplaySection["preview"];
23
28
  }
24
29
 
25
- /** Build a bounded, serializable TUI section from collected facts. */
30
+ /**
31
+ * Build a bounded, serializable TUI section. Evidence facts are copied
32
+ * unchanged; rows the view cap hides are reported as a separate Display
33
+ * omission and never merged into evidence counts.
34
+ */
26
35
  export function createToolDisplaySection<T>(input: ToolDisplaySectionInput<T>): ToolDisplaySection {
27
36
  const maxItems = Math.max(0, input.maxItems ?? MAX_TUI_DISPLAY_ITEMS);
28
37
  const items = input.items.slice(0, maxItems);
29
- const lines = items.map((item) => truncateDisplayText(input.format(item)));
30
- const displayOmittedCount = Math.max(0, input.items.length - items.length);
31
- let totalCount: number | null;
32
- if (input.totalCount === undefined) totalCount = input.items.length;
33
- else totalCount = input.totalCount;
34
- const omittedCount =
35
- totalCount === null
36
- ? input.omittedCount === null || input.omittedCount === undefined
37
- ? displayOmittedCount || null
38
- : input.omittedCount + displayOmittedCount
39
- : Math.max(0, totalCount - lines.length);
40
-
41
38
  return {
42
- key: input.key,
39
+ key: input.key ?? input.evidence.key,
43
40
  title: input.title,
44
- lines,
45
- shownCount: lines.length,
46
- totalCount,
47
- omittedCount,
48
- partialReason: input.partialReason ?? null,
49
- ...(input.partialMessage === undefined ? {} : { partialMessage: input.partialMessage }),
41
+ lines: items.map((item) => truncateDisplayText(input.format(item))),
42
+ evidence: toEvidenceListFacts(input.evidence),
43
+ displayOmittedCount: input.items.length - items.length,
50
44
  ...(input.preview ? { preview: { ...input.preview } } : {}),
51
45
  };
52
46
  }
53
47
 
48
+ /** Canonical Display omission phrase, e.g. `5 rows hidden in view`; null when none. */
49
+ export function describeDisplayOmission(count: number, unit = "row"): string | null {
50
+ return count > 0 ? `${count} ${unit}${count === 1 ? "" : "s"} hidden in view` : null;
51
+ }
52
+
53
+ /** Canonical bounds suffix for one TUI section title, e.g. ` (3 of 5; 2 omitted)`. */
54
+ export function formatDisplaySectionBounds(section: ToolDisplaySection): string {
55
+ const unit = section.preview?.unit;
56
+ const parts = [
57
+ section.preview?.evidenceSummary ?? (unit ? null : describeEvidenceList(section.evidence)),
58
+ unit ? `${section.lines.length} preview ${unit}${section.lines.length === 1 ? "" : "s"}` : null,
59
+ describeDisplayOmission(section.displayOmittedCount, unit ? `preview ${unit}` : "row"),
60
+ ].filter((part): part is string => Boolean(part));
61
+ return parts.length ? ` (${parts.join("; ")})` : "";
62
+ }
63
+
54
64
  /** Keep structured TUI rows readable without parsing or emitting Markdown. */
55
65
  export function truncateDisplayText(
56
66
  value: string,
@@ -72,15 +82,14 @@ export function readToolDisplaySections(value: unknown): ToolDisplaySection[] {
72
82
  return value.flatMap((entry) => {
73
83
  if (typeof entry !== "object" || entry === null || Array.isArray(entry)) return [];
74
84
  const record = entry as Record<string, unknown>;
85
+ const evidence = readEvidenceListFacts(record.evidence);
75
86
  if (
76
87
  typeof record.key !== "string" ||
77
88
  typeof record.title !== "string" ||
78
89
  !Array.isArray(record.lines) ||
79
90
  !record.lines.every((line) => typeof line === "string") ||
80
- !isCount(record.shownCount) ||
81
- !isNullableCount(record.totalCount) ||
82
- !isNullableCount(record.omittedCount) ||
83
- !isNullableString(record.partialReason)
91
+ !evidence ||
92
+ !isCount(record.displayOmittedCount)
84
93
  ) {
85
94
  return [];
86
95
  }
@@ -92,13 +101,8 @@ export function readToolDisplaySections(value: unknown): ToolDisplaySection[] {
92
101
  lines: record.lines
93
102
  .slice(0, MAX_TUI_DISPLAY_ITEMS)
94
103
  .map((line) => truncateDisplayText(line)),
95
- shownCount: record.shownCount,
96
- totalCount: record.totalCount,
97
- omittedCount: record.omittedCount,
98
- partialReason: record.partialReason,
99
- ...(typeof record.partialMessage === "string"
100
- ? { partialMessage: record.partialMessage }
101
- : {}),
104
+ evidence,
105
+ displayOmittedCount: record.displayOmittedCount,
102
106
  ...(preview ? { preview } : {}),
103
107
  },
104
108
  ];
@@ -120,11 +124,3 @@ function readPreview(value: unknown): ToolDisplaySection["preview"] {
120
124
  function isCount(value: unknown): value is number {
121
125
  return typeof value === "number" && Number.isInteger(value) && value >= 0;
122
126
  }
123
-
124
- function isNullableCount(value: unknown): value is number | null {
125
- return value === null || isCount(value);
126
- }
127
-
128
- function isNullableString(value: unknown): value is string | null {
129
- return value === null || typeof value === "string";
130
- }
@@ -118,6 +118,7 @@ export function healthErrorResult(content: string, reason?: string): CodeIntelRe
118
118
  serverInventoryAvailable: false,
119
119
  serverInventoryScope: "workspace",
120
120
  diagnosticObservation: { kind: "not-requested", entries: [] },
121
+ diagnosticCoverage: null,
121
122
  refresh: {
122
123
  kind: "not-attempted",
123
124
  reason: reason ?? content,
@@ -1,4 +1,11 @@
1
+ import { classifyDiagnosticCoverage, type DiagnosticCoverage } from "../../diagnostics/coverage.ts";
2
+ import type { HealthDiagnosticScope } from "../../session/health-types.ts";
1
3
  import type { CodeIntelResult } from "../../types/index.ts";
4
+ import {
5
+ DIAGNOSTIC_NEXT_ACTION,
6
+ isPassiveTrackedSnapshot,
7
+ PASSIVE_SNAPSHOT_NOTE,
8
+ } from "../code_health/guidance.ts";
2
9
  import { formatSemanticHealthState } from "../code_health/semantic-state.ts";
3
10
  import type { HealthDetails, SearchDetails } from "./types.ts";
4
11
 
@@ -168,6 +175,21 @@ function searchFacts(data: SearchDetails): string[] {
168
175
  return lines;
169
176
  }
170
177
 
178
+ /** Keep the zero-coverage and passive-snapshot guidance when the full markdown is truncated. */
179
+ function coverageNote(
180
+ coverage: DiagnosticCoverage,
181
+ scope: HealthDiagnosticScope,
182
+ refresh: HealthDetails["refresh"],
183
+ ): string | null {
184
+ if (coverage === "none") {
185
+ return `No source diagnostics checked; this is not a clean result. Next: ${DIAGNOSTIC_NEXT_ACTION}.`;
186
+ }
187
+ if (coverage === "confirmed" && isPassiveTrackedSnapshot(scope, refresh)) {
188
+ return `${PASSIVE_SNAPSHOT_NOTE}.`;
189
+ }
190
+ return null;
191
+ }
192
+
171
193
  function healthFacts(data: HealthDetails): string[] {
172
194
  const observation = data.diagnosticObservation;
173
195
  const lines = [
@@ -178,10 +200,13 @@ function healthFacts(data: HealthDetails): string[] {
178
200
  if ("reason" in data.refresh) lines.push(`Refresh reason: ${data.refresh.reason}`);
179
201
  if (observation.kind !== "not-requested") {
180
202
  const scope = observation.scope;
203
+ const coverage = classifyDiagnosticCoverage(observation);
181
204
  lines.push(
182
205
  `Diagnostics: ${observation.kind}; ${scope.kind === "file" ? `file=${scope.path}` : `tracked-file snapshot; filter=${scope.filter ?? "none"}; not workspace-wide verification`}.`,
183
- `Diagnostic coverage: requested=${observation.evidence.requested}, confirmed=${observation.evidence.confirmed}, unconfirmed=${observation.evidence.unconfirmed}, failed=${observation.evidence.failed}, removed=${observation.evidence.removed}.`,
206
+ `Diagnostic coverage: ${coverage}; requested=${observation.evidence.requested}, confirmed=${observation.evidence.confirmed}, unconfirmed=${observation.evidence.unconfirmed}, failed=${observation.evidence.failed}, removed=${observation.evidence.removed}.`,
184
207
  );
208
+ const note = coverageNote(coverage, scope, data.refresh);
209
+ if (note) lines.push(note);
185
210
  if ("reason" in observation) lines.push(`Diagnostic limitation: ${observation.reason}`);
186
211
  if (observation.scopeStatus)
187
212
  lines.push(`File scope status: ${JSON.stringify(observation.scopeStatus)}`);
@@ -1,5 +1,9 @@
1
1
  import type { FileEdit } from "@mrclrchtr/supi-code-runtime/api";
2
- import { createEvidenceList, type EvidenceList } from "../../analysis/evidence.ts";
2
+ import {
3
+ createEvidenceList,
4
+ type EvidenceList,
5
+ knownEvidenceCount,
6
+ } from "../../analysis/evidence.ts";
3
7
  import type { ApplyResult } from "../../analysis/refactor/apply.ts";
4
8
  import { toDisplayPath } from "../../analysis/search/paths.ts";
5
9
  import type { RefactorPlan } from "../../session/refactor-plans.ts";
@@ -74,7 +78,7 @@ export function assembleRefactorPlanDetails(
74
78
  ? ["After applying, use rename_symbol to rename any server-generated names"]
75
79
  : []),
76
80
  ],
77
- candidateCount: edits.metadata.totalCount ?? edits.metadata.shownCount,
81
+ candidateCount: knownEvidenceCount(edits.metadata),
78
82
  confidence: evidenceSource,
79
83
  provenance,
80
84
  });
@@ -86,10 +90,8 @@ export function assembleRefactorPlanDetails(
86
90
  key: "refactor.edits",
87
91
  title: "Proposed edits",
88
92
  items: edits.items,
89
- totalCount: edits.metadata.totalCount,
90
- omittedCount: edits.metadata.omittedCount,
91
- partialReason: edits.metadata.partialReason,
92
- format: (edit) => formatEdit(edit, cwd),
93
+ evidence: edits.metadata,
94
+ format: (edit: (typeof edits.items)[number]) => formatEdit(edit, cwd),
93
95
  }),
94
96
  ],
95
97
  details: {
@@ -153,8 +155,9 @@ export function assembleRefactorApplyDetails(
153
155
  key: "refactor.changedFiles",
154
156
  title: "Changed files",
155
157
  items: changedFiles,
156
- totalCount: changedFiles.length,
157
- format: (file) => file,
158
+ evidence: createEvidenceList({ key: "refactor.changedFiles", items: changedFiles })
159
+ .metadata,
160
+ format: (file: string) => file,
158
161
  }),
159
162
  ]
160
163
  : [],
@@ -5,10 +5,11 @@ export const ConfidenceSchema = Type.Enum(["semantic", "structural", "heuristic"
5
5
  type: "string",
6
6
  });
7
7
 
8
- /** Canonical evidence counts; null totals mean collection could not establish completeness. */
8
+ /** Canonical evidence counts and Evidence completeness state; readers never infer completeness. */
9
9
  export const EvidenceListSchema = Type.Object(
10
10
  {
11
11
  key: Type.String(),
12
+ completeness: Type.Enum(["complete", "capped", "partial", "unbounded"], { type: "string" }),
12
13
  totalCount: Type.Union([Type.Integer(), Type.Null()]),
13
14
  shownCount: Type.Integer(),
14
15
  omittedCount: Type.Union([Type.Integer(), Type.Null()]),
@@ -1,6 +1,6 @@
1
1
  import type { ConfidenceMode, SourceRange } from "@mrclrchtr/supi-code-runtime/api";
2
2
  import type { CapabilityWarningReport } from "../../analysis/capability/capability-warnings.ts";
3
- import type { EvidenceListMetadata } from "../../analysis/evidence.ts";
3
+ import type { EvidenceListFacts, EvidenceListMetadata } from "../../analysis/evidence.ts";
4
4
  import type { InstructionFilesMetadata } from "../../analysis/instruction-files.ts";
5
5
  import type { ReadNextItem } from "../../analysis/read-next.ts";
6
6
  import type { AutomaticPathExclusionDisplay } from "../../analysis/search/exclusions.ts";
@@ -10,6 +10,7 @@ import type {
10
10
  StructuredScanSummary,
11
11
  } from "../../analysis/search/pattern.ts";
12
12
  import type { FileOutlineNotListed } from "../../analysis/target/types.ts";
13
+ import type { DiagnosticCoverage } from "../../diagnostics/coverage.ts";
13
14
  import type {
14
15
  HealthDiagnosticObservation,
15
16
  HealthRefreshState,
@@ -43,12 +44,10 @@ export interface ToolDisplaySection {
43
44
  key: string;
44
45
  title: string;
45
46
  lines: readonly string[];
46
- shownCount: number;
47
- totalCount: number | null;
48
- omittedCount: number | null;
49
- partialReason: string | null;
50
- /** Provider explanation for incomplete collection, when available. */
51
- partialMessage?: string;
47
+ /** Canonical Evidence list facts previewed by this section. */
48
+ evidence: EvidenceListFacts;
49
+ /** Rows hidden by the view cap; a Display omission, not an Evidence atom count. */
50
+ displayOmittedCount: number;
52
51
  /** Content counts are separate from canonical evidence when rows are grouped or framed. */
53
52
  preview?: {
54
53
  unit: "group" | "block";
@@ -143,7 +142,7 @@ export interface ResolveDetails {
143
142
  /** Strict provider kind that produced a near-match result. */
144
143
  requestedKind?: TargetSymbolKind;
145
144
  confidence: ConfidenceMode;
146
- /** Plain workflow failure message, present for invalid-input and unavailable results. */
145
+ /** Plain workflow message: the failure for invalid-input and unavailable, the selection reason for candidates. */
147
146
  message?: string;
148
147
  targetCount: number;
149
148
  omittedCount: number;
@@ -283,6 +282,8 @@ export interface HealthDetails {
283
282
  serverInventoryScope: "workspace";
284
283
  /** Diagnostic result scope and exact evidence boundary for this health call. */
285
284
  diagnosticObservation: HealthDiagnosticObservation;
285
+ /** Shared coverage classification of `diagnosticObservation`; null when not requested. */
286
+ diagnosticCoverage: DiagnosticCoverage | null;
286
287
  /** Current or most recent refresh, including typed maintenance scope and evidence. */
287
288
  refresh: HealthRefreshState;
288
289
  structuralAvailable: boolean;
@@ -9,31 +9,28 @@ import { CODE_FIND_AST_KINDS } from "./code_find/ast-kinds.ts";
9
9
  export const ScopeParam = Type.String({
10
10
  description: "Workspace-relative file or directory scope.",
11
11
  });
12
- export const FindScopesParam = Type.Array(
13
- Type.String({ description: "Workspace-relative search scope." }),
14
- {
15
- description: "One or more workspace-relative search scopes.",
16
- minItems: 1,
17
- },
18
- );
19
- const FileParam = Type.String({ description: "File path." });
12
+ export const FindScopesParam = Type.Array(Type.String(), {
13
+ description: "One or more workspace-relative search scopes.",
14
+ minItems: 1,
15
+ });
16
+ const FileParam = Type.String();
20
17
  export const QueryParam = Type.String({
21
18
  description: "Human or code reference to resolve or search for.",
22
19
  minLength: 1,
23
20
  });
24
- const LineParam = Type.Integer({ description: "1-based line.", minimum: 1 });
25
- const CharacterParam = Type.Integer({
26
- description: "1-based UTF-16 column.",
27
- minimum: 1,
28
- });
21
+ const LineParam = Type.Integer({ minimum: 1 });
22
+ const CharacterParam = Type.Integer({ minimum: 1 });
29
23
  export const MaxResultsParam = Type.Integer({
30
24
  description: "Maximum displayed results.",
31
25
  minimum: 1,
32
26
  });
33
27
 
28
+ /** One home for the position convention; the leaf fields stay undescribed. */
29
+ const POSITION_DESCRIPTION = "1-based line and UTF-16 column.";
30
+
34
31
  export const SourcePointParam = Type.Object(
35
32
  { file: FileParam, line: LineParam, character: CharacterParam },
36
- { additionalProperties: false },
33
+ { additionalProperties: false, description: POSITION_DESCRIPTION },
37
34
  );
38
35
 
39
36
  const SymbolTargetParam = Type.Object(
@@ -47,10 +44,7 @@ const SymbolTargetParam = Type.Object(
47
44
  }),
48
45
  ),
49
46
  },
50
- {
51
- description: "Semantic symbol query.",
52
- additionalProperties: false,
53
- },
47
+ { additionalProperties: false },
54
48
  );
55
49
 
56
50
  /**
@@ -152,11 +146,12 @@ const RangeParam = Type.Object(
152
146
  },
153
147
  {
154
148
  additionalProperties: false,
155
- description: "Source range; end is exclusive. Equal start and end mark a cursor position.",
149
+ description:
150
+ "Source range with 1-based lines and UTF-16 columns; end is exclusive. Equal start and end mark a cursor position.",
156
151
  },
157
152
  );
158
153
 
159
- const NewNameParam = Type.String({ description: "New symbol name.", minLength: 1 });
154
+ const NewNameParam = Type.String({ minLength: 1 });
160
155
  const ActionTitleParam = Type.String({
161
156
  description:
162
157
  "Exact action title from a previous ambiguous result; selects one of several matching actions.",
package/src/ui/footer.ts CHANGED
@@ -1,68 +1,171 @@
1
1
  /**
2
- * LSP footer stats-end contribution for code-intelligence.
2
+ * LSP footer contribution for code-intelligence.
3
3
  *
4
- * Provides the persistent "| λ lsp • N ✓ • M open files" suffix on the
5
- * footer stats line, after cost and context info. This was removed during the
6
- * supi-lsp → supi-code-intelligence migration.
4
+ * Shows workspace LSP state on the right side of the footer path line, for
5
+ * example `λ 3✓ ◫43` (three ready routes, 43 tracked files).
6
+ *
7
+ * The text comes from the controller's latest published lifecycle snapshot.
8
+ * Rendering never queries the runtime, because route status can require
9
+ * file-system probes and the footer renders often. The same text is published
10
+ * through Pi's status API so the built-in footer and other custom footers
11
+ * show it too; the SuPi footer skips that same-key status.
7
12
  */
8
13
 
9
- import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
10
- import { footerContributions } from "@mrclrchtr/supi-core/footer-registry";
11
- import { countProjectServerRouteStatuses } from "../analysis/health/server-status.ts";
14
+ import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
15
+ import {
16
+ FOOTER_INVALIDATE_EVENT,
17
+ type FooterColor,
18
+ type FooterGlyphMode,
19
+ type FooterRenderContext,
20
+ footerContributions,
21
+ } from "@mrclrchtr/supi-core/footer-registry";
22
+ import type { LspRuntimeController } from "@mrclrchtr/supi-lsp/api";
23
+ import {
24
+ classifyProjectServerRoute,
25
+ type ProjectServerRouteState,
26
+ } from "../analysis/health/server-status.ts";
12
27
  import { LSP_STATE_CHANGE_EVENT, type LspAdapterState } from "../substrate/lsp/state.ts";
13
28
 
14
- /** Build the LSP status text: "λ lsp • 3 ✓ • 1 ⟳ • 1 ✗ • 2 open files" */
15
- export function buildLspStatusText(lspState: LspAdapterState): string | undefined {
16
- const controller = lspState.controller;
17
- const runtime = controller?.workspaceRuntime;
18
- if (!runtime) return undefined;
19
-
20
- const servers = runtime.getProjectServers();
21
- const openFiles = servers.reduce((sum, s) => sum + s.openFiles.length, 0);
22
-
23
- // Aggregate server states
24
- const ready = servers.filter((s) => s.status === "running" && s.ready).length;
25
- const starting = servers.filter((s) => s.status === "running" && !s.ready).length;
26
- const routeCounts = countProjectServerRouteStatuses(servers);
27
-
28
- const hasServers =
29
- ready + starting + routeCounts.recovering + routeCounts.error + routeCounts.unavailable > 0;
30
- if (!hasServers && openFiles === 0) return undefined;
31
-
32
- const parts = ["λ lsp"];
33
- if (ready > 0) parts.push(`${ready} ✓`);
34
- if (starting > 0) parts.push(`${starting} ⟳`);
35
- if (routeCounts.recovering > 0) parts.push(`${routeCounts.recovering} ↻`);
36
- if (routeCounts.error > 0) parts.push(`${routeCounts.error} ✗`);
37
- if (routeCounts.unavailable > 0) parts.push(`${routeCounts.unavailable} ⊘`);
38
- if (openFiles > 0) parts.push(`${openFiles} ${openFiles === 1 ? "open file" : "open files"}`);
39
- return parts.join(" • ");
29
+ type CountedState = Exclude<ProjectServerRouteState, "loading">;
30
+
31
+ interface LspFooterGlyphs {
32
+ label: string;
33
+ /** Tracked-file prefix, written directly before the count. */
34
+ files: string;
35
+ states: Record<CountedState, string>;
36
+ }
37
+
38
+ const UNICODE_GLYPHS: LspFooterGlyphs = {
39
+ label: "λ",
40
+ files: "◫",
41
+ states: { ready: "✓", starting: "⟳", recovering: "↻", error: "✗", unavailable: "⊘" },
42
+ };
43
+
44
+ const GLYPHS: Record<FooterGlyphMode, LspFooterGlyphs> = {
45
+ // U+F0DCB: Material Design file outline.
46
+ nerd: { ...UNICODE_GLYPHS, files: "\u{F0DCB}" },
47
+ unicode: UNICODE_GLYPHS,
48
+ ascii: {
49
+ label: "lsp",
50
+ files: "f",
51
+ states: { ready: "ok", starting: "~", recovering: "r", error: "x", unavailable: "-" },
52
+ },
53
+ };
54
+
55
+ /** Display order and color of each counted route state. `loading` counts as starting. */
56
+ const ROUTE_PARTS: ReadonlyArray<{ state: CountedState; color: FooterColor }> = [
57
+ { state: "ready", color: "success" },
58
+ { state: "starting", color: "accent" },
59
+ { state: "recovering", color: "warning" },
60
+ { state: "error", color: "error" },
61
+ { state: "unavailable", color: "warning" },
62
+ ];
63
+
64
+ const plainContext: FooterRenderContext = { style: (_color, text) => text, glyphMode: "unicode" };
65
+
66
+ type LspFooterController = Pick<
67
+ LspRuntimeController,
68
+ "kind" | "latestLifecycleTransition" | "getConfigurationError"
69
+ >;
70
+
71
+ /**
72
+ * Build the LSP status text, for example `λ 3✓ 1⟳ 1✗ ◫2`.
73
+ *
74
+ * A controller that could not start shows `✗ config` for a configuration error
75
+ * and `✗ unavailable` otherwise. A disabled or absent controller shows nothing.
76
+ */
77
+ export function buildLspStatusText(
78
+ lspState: LspAdapterState,
79
+ ctx: FooterRenderContext = plainContext,
80
+ ): string | undefined {
81
+ const controller = lspState.controller as LspFooterController | null;
82
+ if (!controller) return undefined;
83
+ const { style } = ctx;
84
+ const glyphs = GLYPHS[ctx.glyphMode];
85
+ const label = style("dim", glyphs.label);
86
+ const failure = glyphs.states.error;
87
+
88
+ if (controller.kind === "unavailable") {
89
+ const cause = controller.getConfigurationError() ? "config" : "unavailable";
90
+ return `${label} ${style("error", `${failure} ${cause}`)}`;
91
+ }
92
+ if (controller.kind !== "ready" && controller.kind !== "pending") return undefined;
93
+
94
+ const servers = controller.latestLifecycleTransition?.projectServers ?? [];
95
+ const counts = countRouteStates(servers);
96
+ const trackedFiles = servers.reduce((sum, server) => sum + server.openFiles.length, 0);
97
+ if (counts.size === 0 && trackedFiles === 0) return undefined;
98
+
99
+ const parts = [label];
100
+ for (const { state, color } of ROUTE_PARTS) {
101
+ const count = counts.get(state);
102
+ if (count) parts.push(style(color, `${count}${glyphs.states[state]}`));
103
+ }
104
+ if (trackedFiles > 0) parts.push(style("dim", `${glyphs.files}${trackedFiles}`));
105
+ return parts.join(" ");
40
106
  }
41
107
 
42
- // ── Footer stats contribution ───────────────────────────────────────────
108
+ function countRouteStates(
109
+ servers: readonly Parameters<typeof classifyProjectServerRoute>[0][],
110
+ ): Map<CountedState, number> {
111
+ const counts = new Map<CountedState, number>();
112
+ for (const server of servers) {
113
+ const state = classifyProjectServerRoute(server);
114
+ // A route that still loads its projects answers queries but is not done yet.
115
+ const counted = state === "loading" ? "starting" : state;
116
+ counts.set(counted, (counts.get(counted) ?? 0) + 1);
117
+ }
118
+ return counts;
119
+ }
120
+
121
+ // ── Footer contribution ─────────────────────────────────────────────────
43
122
 
44
123
  const FOOTER_KEY = "lsp-status";
45
124
 
46
- /** Register the LSP stats-end footer contribution for the given adapter state. */
125
+ /** Register the LSP footer contribution and its Pi status fallback. */
47
126
  export function registerLspFooterContribution(
48
127
  pi: ExtensionAPI,
49
128
  lspState: LspAdapterState,
50
129
  ): {
51
130
  dispose: () => void;
52
131
  } {
132
+ let statusUi: ExtensionContext["ui"] | undefined;
133
+
53
134
  footerContributions.register({
54
135
  key: FOOTER_KEY,
55
- placement: "stats-end",
136
+ placement: "path-end",
56
137
  priority: 100,
57
- render: () => {
58
- const text = buildLspStatusText(lspState);
59
- if (!text) return "";
60
- return `| ${text}`;
61
- },
138
+ render: (ctx) => buildLspStatusText(lspState, ctx) ?? "",
62
139
  });
63
140
 
64
- // Trigger TUI re-render when server states change.
65
- const handler = () => pi.events.emit("supi:lsp:invalidate", {});
141
+ const publishStatus = () => {
142
+ if (!statusUi) return;
143
+ const theme = statusUi.theme;
144
+ const text = buildLspStatusText(lspState, {
145
+ style: (color, value) => theme.fg(color, value),
146
+ glyphMode: "unicode",
147
+ });
148
+ try {
149
+ statusUi.setStatus(FOOTER_KEY, text);
150
+ } catch {
151
+ // Pi may be shutting down while the status changes.
152
+ }
153
+ };
154
+
155
+ pi.on("session_start", (_event, ctx) => {
156
+ statusUi = ctx.mode === "tui" ? ctx.ui : undefined;
157
+ publishStatus();
158
+ });
159
+ pi.on("session_shutdown", () => {
160
+ statusUi?.setStatus(FOOTER_KEY, undefined);
161
+ statusUi = undefined;
162
+ });
163
+
164
+ // Re-render when the runtime publishes a new snapshot.
165
+ const handler = () => {
166
+ publishStatus();
167
+ pi.events.emit(FOOTER_INVALIDATE_EVENT, {});
168
+ };
66
169
  lspState.stateChanges.addEventListener(LSP_STATE_CHANGE_EVENT, handler);
67
170
 
68
171
  return {
@@ -73,7 +176,7 @@ export function registerLspFooterContribution(
73
176
  };
74
177
  }
75
178
 
76
- /** Remove the LSP stats footer contribution. */
179
+ /** Remove the LSP footer contribution. */
77
180
  export function unregisterLspFooterContribution(): void {
78
181
  footerContributions.unregister(FOOTER_KEY);
79
182
  }
@@ -22,6 +22,7 @@ import type {
22
22
  WorkspaceDiagnosticCheckReport,
23
23
  } from "../analysis/health/check.ts";
24
24
  import {
25
+ classifyProjectServerRoute,
25
26
  countProjectServerRouteStatuses,
26
27
  formatProjectServerCompiler,
27
28
  formatProjectServerRoot,
@@ -405,18 +406,16 @@ export class CiStatusDialog {
405
406
  private summaryLine(): string {
406
407
  const t = this.deps.theme;
407
408
  if (this.refreshError) return t.fg("error", this.refreshFailure());
408
- const ready = this.data.servers.filter(
409
- (server) => server.status === "running" && server.ready,
410
- ).length;
411
- const starting = this.data.servers.filter(
412
- (server) => server.status === "running" && !server.ready,
413
- ).length;
409
+ const states = this.data.servers.map(classifyProjectServerRoute);
410
+ const ready = states.filter((state) => state === "ready").length;
411
+ const starting = states.filter((state) => state === "starting").length;
412
+ const loading = states.filter((state) => state === "loading").length;
414
413
  const counts = countProjectServerRouteStatuses(this.data.servers);
415
414
  const entries = this.data.diagnostics.entries;
416
415
  const errors = entries.reduce((sum, entry) => sum + entry.errors, 0);
417
416
  const warnings = entries.reduce((sum, entry) => sum + entry.warnings, 0);
418
417
  return [
419
- `${ready} ready${starting ? ` · ${starting} starting` : ""}`,
418
+ `${ready} ready${starting ? ` · ${starting} starting` : ""}${loading ? ` · ${loading} loading projects` : ""}`,
420
419
  errors ? t.fg("error", countLabel(errors, "error")) : "",
421
420
  warnings ? t.fg("warning", countLabel(warnings, "warning")) : "",
422
421
  counts.recovering
@@ -585,7 +584,13 @@ export class CiStatusDialog {
585
584
  private addServer(server: ProjectServerInfo, text: (value: string) => void): void {
586
585
  const t = this.deps.theme;
587
586
  const state =
588
- server.status === "running" ? (server.ready ? "ready" : "starting") : server.status;
587
+ server.status !== "running"
588
+ ? server.status
589
+ : !server.ready
590
+ ? "starting"
591
+ : server.loadingProjects
592
+ ? "loading projects"
593
+ : "ready";
589
594
  text(
590
595
  t.fg(
591
596
  state === "ready" ? "success" : state === "error" ? "error" : "warning",