@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,5 +1,6 @@
1
1
  import { resolve } from "node:path";
2
2
  import type { DiagnosticEvidenceSummary } from "@mrclrchtr/supi-lsp/api";
3
+ import { classifyDiagnosticCoverage } from "../diagnostics/coverage.ts";
3
4
  import type {
4
5
  HealthDiagnosticObservation,
5
6
  HealthWorkflowOutcome,
@@ -21,16 +22,12 @@ export function presentDiagnosticEvidence(observation: HealthDiagnosticObservati
21
22
  return { summary: "Diagnostics not requested.", tone: "dim" };
22
23
  const evidence = observation.evidence;
23
24
  const counts = `${evidence.confirmed}/${evidence.requested} confirmed tracked files · ${evidence.unconfirmed} unconfirmed · ${evidence.failed} failed · ${evidence.removed} removed`;
25
+ const coverage = classifyDiagnosticCoverage(observation);
24
26
  if (observation.kind === "unavailable")
25
27
  return { counts, summary: `Diagnostics unavailable — ${observation.reason}`, tone: "warning" };
26
- if (evidence.requested === 0)
28
+ if (coverage === "none")
27
29
  return { counts, summary: "No tracked diagnostic evidence.", tone: "dim" };
28
- const confirmed =
29
- evidence.confirmed === evidence.requested &&
30
- evidence.unconfirmed === 0 &&
31
- evidence.failed === 0 &&
32
- evidence.removed === 0;
33
- if (!confirmed)
30
+ if (coverage === "incomplete")
34
31
  return {
35
32
  counts,
36
33
  summary: `Diagnostic evidence is incomplete${observation.kind === "partial" ? ` — ${observation.reason}` : "."}`,
@@ -2,10 +2,11 @@
2
2
  import type { Theme } from "@earendil-works/pi-coding-agent";
3
3
  import { type Component, Container, Spacer, Text } from "@earendil-works/pi-tui";
4
4
  import {
5
+ type CandidateSelectionKey,
5
6
  formatCandidateRow,
6
- formatPartialCandidateDisclosure,
7
- } from "../../tool/result/candidate-row.ts";
7
+ } from "../../tool/result/candidate-selection.ts";
8
8
  import {
9
+ describeDisplayOmission,
9
10
  MAX_TUI_DISPLAY_ITEMS,
10
11
  readToolDisplaySections,
11
12
  truncateDisplayText,
@@ -22,12 +23,6 @@ import {
22
23
  type ToolResult,
23
24
  } from "./common.ts";
24
25
 
25
- /** Display-section keys that identify candidate-selection results. */
26
- export type CandidateSelectionKey =
27
- | "graph.candidates"
28
- | "resolve.candidates"
29
- | "orientation.candidates";
30
-
31
26
  interface CandidateRow {
32
27
  targetId: string;
33
28
  name: string;
@@ -35,8 +30,6 @@ interface CandidateRow {
35
30
  file: string;
36
31
  line: number;
37
32
  character: number;
38
- rank: number;
39
- container: string | null;
40
33
  }
41
34
 
42
35
  interface CandidateSelectionData {
@@ -78,16 +71,17 @@ function readCandidateSelection(
78
71
 
79
72
  // A status or message alone is not a candidate-selection marker. Require a
80
73
  // candidate key or a structured candidate collection before changing views.
81
- if (!display && !evidence && !structuredCandidates) return null;
82
-
83
- const rows = candidateRowsFor(display, structuredCandidates, key);
84
- const selectionEvidence = candidateEvidenceFor({
85
- display,
86
- evidence,
87
- structuredCandidates,
88
- rows,
89
- key,
90
- });
74
+ // Older persisted entries keep their key but fail strict evidence parsing;
75
+ // they still select this view and use its bounded legacy body.
76
+ const keyed =
77
+ display ||
78
+ evidence ||
79
+ hasRawKey(result.details?.displaySections, key) ||
80
+ hasRawKey(data?.evidenceLists, key);
81
+ if (!keyed && !structuredCandidates) return null;
82
+
83
+ const rows = candidateRowsFor(display, structuredCandidates);
84
+ const selectionEvidence = candidateEvidenceFor({ display, evidence });
91
85
  const reason = selectionReason(result, data);
92
86
  const structuredGuidance = readStructuredNextQueries(data);
93
87
  const guidance = selectionGuidance(result, data, key);
@@ -110,57 +104,17 @@ function readCandidateSelection(
110
104
  function candidateRowsFor(
111
105
  display: ToolDisplaySection | null,
112
106
  structuredCandidates: CandidateRow[] | null,
113
- key: CandidateSelectionKey,
114
107
  ): string[] {
115
108
  if (display?.lines.length) return [...display.lines];
116
- return (structuredCandidates ?? []).map((candidate, index) =>
117
- formatCandidateRow(
118
- candidate,
119
- key === "graph.candidates" ? "handle-first" : "rank-first",
120
- index + 1,
121
- ),
122
- );
109
+ return (structuredCandidates ?? []).map((candidate) => formatCandidateRow(candidate));
123
110
  }
124
111
 
112
+ /** Prefer canonical details evidence; a display section carries the same facts. */
125
113
  function candidateEvidenceFor(input: {
126
114
  display: ToolDisplaySection | null;
127
115
  evidence: EvidenceEntry | null;
128
- structuredCandidates: CandidateRow[] | null;
129
- rows: string[];
130
- key: CandidateSelectionKey;
131
116
  }): EvidenceEntry | null {
132
- if (input.display?.lines.length) return displayEvidence(input.display, input.key);
133
- if (input.evidence && input.structuredCandidates?.length) {
134
- return evidenceForRows(input.evidence, input.rows.length);
135
- }
136
- if (input.display) return displayEvidence(input.display, input.key);
137
- return input.evidence;
138
- }
139
-
140
- function displayEvidence(display: ToolDisplaySection, key: CandidateSelectionKey): EvidenceEntry {
141
- const shownCount = display.lines.length;
142
- return {
143
- key,
144
- shownCount,
145
- totalCount: display.totalCount,
146
- omittedCount:
147
- display.totalCount === null
148
- ? unknownOmittedCount(display.omittedCount, Math.max(0, display.shownCount - shownCount))
149
- : Math.max(0, display.totalCount - shownCount),
150
- partialReason: display.partialReason,
151
- partialMessage: display.partialMessage,
152
- };
153
- }
154
-
155
- function evidenceForRows(evidence: EvidenceEntry, shownCount: number): EvidenceEntry {
156
- return {
157
- ...evidence,
158
- shownCount,
159
- omittedCount:
160
- evidence.totalCount === null
161
- ? unknownOmittedCount(evidence.omittedCount, Math.max(0, evidence.shownCount - shownCount))
162
- : Math.max(0, evidence.totalCount - shownCount),
163
- };
117
+ return input.evidence ?? input.display?.evidence ?? null;
164
118
  }
165
119
 
166
120
  function readCandidateRows(value: unknown): CandidateRow[] | null {
@@ -169,6 +123,7 @@ function readCandidateRows(value: unknown): CandidateRow[] | null {
169
123
  return rows.every((row): row is CandidateRow => row !== null) ? rows : null;
170
124
  }
171
125
 
126
+ /** Rejects malformed persisted rows, including invalid optional rank and container. */
172
127
  function readCandidateRow(value: unknown): CandidateRow | null {
173
128
  const record = asRecord(value);
174
129
  if (
@@ -192,8 +147,6 @@ function readCandidateRow(value: unknown): CandidateRow | null {
192
147
  file: record.file,
193
148
  line: record.line,
194
149
  character: record.character,
195
- rank: isCount(record.rank) ? record.rank : 0,
196
- container: typeof record.container === "string" ? record.container : null,
197
150
  };
198
151
  }
199
152
 
@@ -278,14 +231,14 @@ class CandidateSelectionComponent implements Component {
278
231
  invalidate(): void {}
279
232
 
280
233
  private renderCollapsed(container: Container, width: number): string[] {
281
- const disclosure = this.selection.evidence
282
- ? formatPartialCandidateDisclosure(this.selection.evidence)
283
- : null;
284
- if (disclosure) {
285
- container.addChild(new BoundedCandidateDisclosure(disclosure, false, this.theme));
286
- } else if (this.selection.evidence) {
287
- const summary = formatEvidenceEntry(this.selection.evidence);
288
- container.addChild(new Text(this.theme.fg("muted", summary), 0, 0));
234
+ if (this.selection.evidence) {
235
+ container.addChild(
236
+ new BoundedCandidateDisclosure(
237
+ formatEvidenceEntry(this.selection.evidence),
238
+ false,
239
+ this.theme,
240
+ ),
241
+ );
289
242
  }
290
243
  this.appendTruncation(container);
291
244
  return this.renderContainer(container, width);
@@ -316,16 +269,15 @@ class CandidateSelectionComponent implements Component {
316
269
  private appendStructuredSelection(container: Container): void {
317
270
  container.addChild(new Spacer(1));
318
271
  const title = this.selection.display?.title ?? "Candidates";
319
- const disclosure = this.selection.evidence
320
- ? formatPartialCandidateDisclosure(this.selection.evidence)
321
- : null;
322
- const bounds =
323
- !disclosure && this.selection.evidence ? formatSectionBounds(this.selection.evidence) : "";
324
- container.addChild(
325
- new Text(this.theme.fg("dim", `${title}${bounds ? ` (${bounds})` : ""}`), 0, 0),
326
- );
327
- if (disclosure) {
328
- container.addChild(new BoundedCandidateDisclosure(disclosure, true, this.theme));
272
+ container.addChild(new Text(this.theme.fg("dim", title), 0, 0));
273
+ if (this.selection.evidence) {
274
+ container.addChild(
275
+ new BoundedCandidateDisclosure(
276
+ `${formatEvidenceEntry(this.selection.evidence)}${hiddenRows(this.selection.display)}`,
277
+ true,
278
+ this.theme,
279
+ ),
280
+ );
329
281
  }
330
282
  for (const row of this.selection.rows) {
331
283
  container.addChild(new Text(this.theme.fg("muted", row), 0, 0));
@@ -350,20 +302,13 @@ class CandidateSelectionComponent implements Component {
350
302
  }
351
303
  }
352
304
 
353
- function formatSectionBounds(entry: EvidenceEntry): string {
354
- if (entry.totalCount === null) {
355
- const omitted = entry.omittedCount ? `; ${entry.omittedCount} collected omitted` : "";
356
- const reason = entry.partialReason ? `; more may exist — ${entry.partialReason}` : "; partial";
357
- return `${entry.shownCount}${omitted}${reason}`;
358
- }
359
- if (entry.omittedCount)
360
- return `${entry.shownCount} of ${entry.totalCount}; ${entry.omittedCount} omitted`;
361
- return `${entry.totalCount}`;
305
+ function hiddenRows(display: ToolDisplaySection | null): string {
306
+ const phrase = describeDisplayOmission(display?.displayOmittedCount ?? 0);
307
+ return phrase ? `; ${phrase}` : "";
362
308
  }
363
309
 
364
- function unknownOmittedCount(base: number | null, additional: number): number | null {
365
- const omitted = (base ?? 0) + additional;
366
- return base !== null || omitted > 0 ? omitted : null;
310
+ function hasRawKey(value: unknown, key: CandidateSelectionKey): boolean {
311
+ return Array.isArray(value) && value.some((entry) => asRecord(entry)?.key === key);
367
312
  }
368
313
 
369
314
  function asRecord(value: unknown): Record<string, unknown> | null {
@@ -9,7 +9,11 @@ import {
9
9
  type ToolRenderResultOptions,
10
10
  } from "@earendil-works/pi-coding-agent";
11
11
  import { type Component, Container, Markdown, Spacer, Text } from "@earendil-works/pi-tui";
12
- import { formatEvidenceBadge } from "@mrclrchtr/supi-core/evidence-badge";
12
+ import {
13
+ describeEvidenceList,
14
+ type EvidenceListFacts,
15
+ readEvidenceListFacts,
16
+ } from "../../analysis/evidence.ts";
13
17
  import { truncateDisplayText } from "../../tool/result/display.ts";
14
18
  import { renderToolDisplaySections } from "./display.ts";
15
19
  import { renderExecutionError } from "./execution-error.ts";
@@ -72,86 +76,26 @@ export function evidenceLabel(key: string): string {
72
76
 
73
77
  // ── Serialized evidence ──────────────────────────────────────────
74
78
 
75
- /** Evidence metadata projected by result assembly into tool details. */
76
- export interface EvidenceEntry {
77
- key: string;
78
- shownCount: number;
79
- totalCount: number | null;
80
- omittedCount: number | null;
81
- partialReason: string | null;
82
- /** Provider explanation for incomplete collection, when available. */
83
- partialMessage?: string;
84
- invalidLocationCount?: number;
85
- }
79
+ /** Evidence list facts projected by result assembly into tool details. */
80
+ export type EvidenceEntry = EvidenceListFacts;
86
81
 
87
82
  /**
88
- * Read only complete serialized evidence metadata from tool details.
89
- *
90
- * Renderers intentionally discard malformed or absent entries rather than
91
- * reconstructing totals from candidate counts or omission hints.
83
+ * Read only complete, consistent serialized evidence facts from tool details.
84
+ * Renderers discard malformed entries rather than reconstructing totals.
92
85
  */
93
86
  export function readEvidenceEntries(value: unknown): EvidenceEntry[] {
94
87
  if (!Array.isArray(value)) return [];
95
88
  return value.flatMap((entry) => {
96
- const parsed = readEvidenceEntry(entry);
89
+ const parsed = readEvidenceListFacts(entry);
97
90
  return parsed ? [parsed] : [];
98
91
  });
99
92
  }
100
93
 
101
- function readEvidenceEntry(value: unknown): EvidenceEntry | null {
102
- if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
103
- const record = value as Record<string, unknown>;
104
- const { key, shownCount, totalCount, omittedCount, partialReason, invalidLocationCount } = record;
105
- if (
106
- typeof key !== "string" ||
107
- typeof shownCount !== "number" ||
108
- !isNullableNumber(totalCount) ||
109
- !isNullableNumber(omittedCount) ||
110
- !isNullableString(partialReason) ||
111
- !isOptionalCount(invalidLocationCount)
112
- ) {
113
- return null;
114
- }
115
- return {
116
- key,
117
- shownCount,
118
- totalCount,
119
- omittedCount,
120
- partialReason,
121
- ...(typeof record.partialMessage === "string" ? { partialMessage: record.partialMessage } : {}),
122
- ...(invalidLocationCount === undefined ? {} : { invalidLocationCount }),
123
- };
124
- }
125
-
126
- function isNullableNumber(value: unknown): value is number | null {
127
- return value === null || typeof value === "number";
128
- }
129
-
130
- function isNullableString(value: unknown): value is string | null {
131
- return value === null || typeof value === "string";
132
- }
133
-
134
- function isOptionalCount(value: unknown): value is number | undefined {
135
- return (
136
- value === undefined || (typeof value === "number" && Number.isInteger(value) && value >= 0)
137
- );
138
- }
139
-
140
- /** Format one assembled evidence list without recomputing its bounds. */
94
+ /** Format one assembled evidence list with the canonical phrase and its label. */
141
95
  export function formatEvidenceEntry(entry: EvidenceEntry): string {
142
96
  const label = evidenceLabel(entry.key);
143
- const singleCandidate = label === "candidates" && (entry.totalCount ?? entry.shownCount) === 1;
144
- const badge = formatEvidenceBadge({
145
- shownCount: entry.shownCount,
146
- totalCount: entry.totalCount,
147
- omittedCount: entry.omittedCount,
148
- partialReason: entry.partialReason,
149
- label: singleCandidate ? "candidate" : label,
150
- });
151
- if (!entry.invalidLocationCount) return badge;
152
- const noun = entry.invalidLocationCount === 1 ? "location" : "locations";
153
- const reason = entry.partialReason ? ` — ${entry.partialReason}` : "";
154
- return `${badge}; ${entry.invalidLocationCount} invalid provider ${noun} omitted${reason}`;
97
+ const singular = label === "candidates" ? "candidate" : label;
98
+ return describeEvidenceList(entry, { one: singular, other: label });
155
99
  }
156
100
 
157
101
  /** Append formatted evidence badge lines to a container. */
@@ -173,7 +117,9 @@ export function renderMarkdownDetail(
173
117
  source: MarkdownSource,
174
118
  theme: Theme,
175
119
  ): void {
176
- const markdownText = source.content?.find((c) => c.type === "text")?.text ?? "";
120
+ // Persisted content can hold malformed blocks; skip anything that is not a text block.
121
+ const block = source.content?.find((c) => c?.type === "text" && typeof c.text === "string");
122
+ const markdownText = block?.text ?? "";
177
123
  if (!markdownText) return;
178
124
  container.addChild(new Spacer(1));
179
125
  const divider = `${theme.fg("border", "────")} ${theme.fg("dim", "raw markdown")} ${theme.fg("border", "────")}`;
@@ -1,7 +1,10 @@
1
1
  import type { Theme } from "@earendil-works/pi-coding-agent";
2
2
  import { type Container, Text } from "@earendil-works/pi-tui";
3
- import { readToolDisplaySections, truncateDisplayText } from "../../tool/result/display.ts";
4
- import type { ToolDisplaySection } from "../../tool/result/types.ts";
3
+ import {
4
+ formatDisplaySectionBounds,
5
+ readToolDisplaySections,
6
+ truncateDisplayText,
7
+ } from "../../tool/result/display.ts";
5
8
 
6
9
  /** Render bounded structured rows for an expanded TUI body. */
7
10
  export function renderToolDisplaySections(
@@ -11,7 +14,7 @@ export function renderToolDisplaySections(
11
14
  ): void {
12
15
  for (const section of readToolDisplaySections(value)) {
13
16
  container.addChild(
14
- new Text(theme.fg("dim", `${section.title}${formatDisplayBounds(section)}`), 0, 0),
17
+ new Text(theme.fg("dim", `${section.title}${formatDisplaySectionBounds(section)}`), 0, 0),
15
18
  );
16
19
  for (const line of section.lines) {
17
20
  container.addChild(new Text(theme.fg("muted", line), 0, 0));
@@ -19,27 +22,6 @@ export function renderToolDisplaySections(
19
22
  }
20
23
  }
21
24
 
22
- function formatDisplayBounds(section: ToolDisplaySection): string {
23
- const summary = section.preview?.evidenceSummary;
24
- const prefix = summary ? `${summary}; ` : "";
25
- const unit = section.preview?.unit;
26
- const label = (count: number) => (unit ? ` preview ${unit}${count === 1 ? "" : "s"}` : "");
27
- if (section.totalCount === null) {
28
- const omitted = section.omittedCount
29
- ? `; ${section.omittedCount}${label(section.omittedCount)} collected omitted`
30
- : "";
31
- const reason = section.partialReason
32
- ? `; more may exist — ${section.partialReason}`
33
- : "; partial";
34
- const message = section.partialMessage ? `; ${section.partialMessage}` : "";
35
- return ` (${prefix}${section.shownCount}${label(section.shownCount)}${omitted}${reason}${message})`;
36
- }
37
- if (section.omittedCount && section.omittedCount > 0) {
38
- return ` (${prefix}${section.shownCount} of ${section.totalCount}${label(section.totalCount)}; ${section.omittedCount}${label(section.omittedCount)} omitted)`;
39
- }
40
- return ` (${prefix}${section.totalCount}${label(section.totalCount)})`;
41
- }
42
-
43
25
  /** Format one call argument for a compact human transcript row. */
44
26
  export function formatCallValue(value: unknown, maxLength = 60): string | null {
45
27
  if (typeof value !== "string" || value.length === 0) return null;
@@ -1,49 +0,0 @@
1
- import type { EvidenceListMetadata } from "../../analysis/evidence.ts";
2
-
3
- /** Candidate fields used by the three target-selection row formats. */
4
- export interface CandidateRowData {
5
- readonly targetId: string;
6
- readonly name: string;
7
- readonly kind: string | null;
8
- readonly file: string;
9
- readonly line: number;
10
- readonly character: number;
11
- readonly rank?: number;
12
- }
13
-
14
- /** The order used for the target id and rank in one candidate row. */
15
- export type CandidateRowOrder = "handle-first" | "rank-first";
16
-
17
- /** Format one candidate row for a serialized display section or TUI fallback. */
18
- export function formatCandidateRow(
19
- candidate: CandidateRowData,
20
- order: CandidateRowOrder,
21
- fallbackRank = 1,
22
- ): string {
23
- const kind = candidate.kind ?? "unknown";
24
- if (order === "handle-first") {
25
- return `${candidate.targetId} — ${candidate.name} (${kind}) at ${candidate.file}:${candidate.line}:${candidate.character}`;
26
- }
27
- const rank = candidate.rank && candidate.rank > 0 ? candidate.rank : fallbackRank;
28
- return `${rank}. ${candidate.name} (${kind}) — ${candidate.file}:${candidate.line}:${candidate.character} [${candidate.targetId}]`;
29
- }
30
-
31
- /** Separate display omissions from incomplete provider collection in candidate output. */
32
- export function formatPartialCandidateDisclosure(
33
- evidence: Pick<
34
- EvidenceListMetadata,
35
- "shownCount" | "totalCount" | "omittedCount" | "partialMessage"
36
- >,
37
- ): string | null {
38
- if (evidence.totalCount !== null || !evidence.partialMessage) return null;
39
- const { shownCount, omittedCount, partialMessage } = evidence;
40
- const collectedCount = shownCount + (omittedCount ?? 0);
41
- const noun = collectedCount === 1 ? "candidate" : "candidates";
42
- const count =
43
- omittedCount === null
44
- ? `${shownCount} collected ${noun}.`
45
- : omittedCount === 0
46
- ? `all ${shownCount} collected ${noun}.`
47
- : `${shownCount} of ${collectedCount} collected ${noun}; ${omittedCount} omitted.`;
48
- return `Showing ${count}\nSearch completeness is unknown: ${partialMessage}`;
49
- }