@mrclrchtr/supi-code-intelligence 11.4.0 → 13.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 (330) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +17 -9
  3. package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  4. package/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +1 -0
  5. package/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +51 -23
  6. package/node_modules/@mrclrchtr/supi-core/package.json +3 -1
  7. package/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
  8. package/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
  9. package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
  10. package/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
  11. package/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
  12. package/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
  13. package/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
  14. package/node_modules/@mrclrchtr/supi-lsp/README.md +21 -16
  15. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  16. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +1 -0
  17. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +51 -23
  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 +22 -3
  22. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
  23. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
  24. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
  25. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
  26. package/node_modules/@mrclrchtr/supi-lsp/package.json +8 -8
  27. package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +3 -2
  28. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-cache.ts +102 -47
  29. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-capabilities.ts +13 -3
  30. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-host.ts +8 -0
  31. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-refresh.ts +15 -1
  32. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-request.ts +1 -1
  33. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +71 -13
  34. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-disk-stamp.ts +60 -0
  35. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-state.ts +3 -0
  36. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-sync.ts +28 -6
  37. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-edit-capture.ts +258 -0
  38. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-file-state.ts +17 -3
  39. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-semantic-input-barrier.ts +53 -4
  40. package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +75 -14
  41. package/node_modules/@mrclrchtr/supi-lsp/src/config/capabilities.ts +8 -0
  42. package/node_modules/@mrclrchtr/supi-lsp/src/config/operation-support.ts +48 -79
  43. package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-extends.ts +2 -1
  44. package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-path.ts +2 -2
  45. package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-scope.ts +14 -5
  46. package/node_modules/@mrclrchtr/supi-lsp/src/config/typescript-module.ts +17 -0
  47. package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/evidence.ts +42 -0
  48. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-client-state.ts +2 -17
  49. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-removal-ledger.ts +52 -0
  50. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +43 -21
  51. package/node_modules/@mrclrchtr/supi-lsp/src/manager/typescript-file-local.ts +6 -1
  52. package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-refactor-provider.ts +21 -35
  53. package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +6 -1
  54. package/node_modules/@mrclrchtr/supi-lsp/src/provider/refactor-command-capture.ts +139 -0
  55. package/node_modules/@mrclrchtr/supi-lsp/src/provider/refactor-planning.ts +202 -47
  56. package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-symbol-mapper.ts +13 -3
  57. package/node_modules/@mrclrchtr/supi-lsp/src/session/route-boundary.ts +26 -0
  58. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostic-surface.ts +11 -0
  59. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostics.ts +1 -0
  60. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +74 -14
  61. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-rename.ts +3 -0
  62. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-transition-debug.ts +11 -1
  63. package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +24 -1
  64. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  65. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +1 -0
  66. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +51 -23
  67. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +3 -1
  68. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
  69. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
  70. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
  71. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
  72. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
  73. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
  74. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
  75. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs +50 -75
  76. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs.map +2 -2
  77. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js +50 -75
  78. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js.map +2 -2
  79. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm +0 -0
  80. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm.map +6 -6
  81. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/package.json +1 -1
  82. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs +50 -75
  83. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs.map +2 -2
  84. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts +7 -7
  85. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts.map +1 -1
  86. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts +7 -7
  87. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +1 -1
  88. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js +50 -75
  89. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js.map +2 -2
  90. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm +0 -0
  91. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm.map +5 -5
  92. package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +5 -5
  93. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/kotlin/tree-sitter-kotlin.wasm.json +1 -1
  94. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/latex/tree-sitter-latex.wasm.json +1 -1
  95. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm.json +1 -1
  96. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm.json +1 -1
  97. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm.json +1 -1
  98. package/node_modules/@mrclrchtr/supi-tree-sitter/src/coordinates.ts +16 -2
  99. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-client.ts +4 -3
  100. package/node_modules/@mrclrchtr/supi-tree-sitter/src/syntax-errors.ts +2 -0
  101. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/call-range.ts +94 -0
  102. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/call-sites.ts +26 -6
  103. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/callees.ts +6 -3
  104. package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/exports.ts +13 -4
  105. package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/runtime.ts +1 -9
  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 +41 -12
  230. package/src/analysis/search/pattern.ts +3 -3
  231. package/src/analysis/target/anchored-structural.ts +4 -1
  232. package/src/analysis/target/anchored.ts +3 -6
  233. package/src/analysis/target/symbol.ts +42 -48
  234. package/src/analysis/target/types.ts +4 -9
  235. package/src/analysis/workspace/cmake-parser.ts +207 -0
  236. package/src/analysis/workspace/cmake.ts +141 -0
  237. package/src/analysis/workspace/maven.ts +310 -0
  238. package/src/analysis/workspace/membership.ts +100 -26
  239. package/src/analysis/workspace/metadata.ts +6 -1
  240. package/src/analysis/workspace/observe.ts +6 -0
  241. package/src/analysis/workspace/types.ts +11 -3
  242. package/src/diagnostics/coverage.ts +49 -0
  243. package/src/diagnostics/evidence.ts +10 -2
  244. package/src/session/find-types.ts +8 -4
  245. package/src/session/find-workflow.ts +11 -16
  246. package/src/session/health-workflow.ts +6 -0
  247. package/src/session/input/common.ts +1 -1
  248. package/src/session/input/health-refactor.ts +48 -34
  249. package/src/session/input/workflows.ts +45 -46
  250. package/src/session/inspect/file-point.ts +2 -2
  251. package/src/session/inspect-types.ts +1 -1
  252. package/src/session/inspect-workflow.ts +3 -3
  253. package/src/session/orientation/collect.ts +42 -7
  254. package/src/session/orientation/context-facts.ts +3 -3
  255. package/src/session/orientation/context-sections.ts +13 -15
  256. package/src/session/orientation/facts.ts +5 -8
  257. package/src/session/orientation-workflow.ts +4 -19
  258. package/src/session/refactor-file-actions.ts +122 -0
  259. package/src/session/refactor-plan-pipeline.ts +152 -0
  260. package/src/session/refactor-plans.ts +18 -15
  261. package/src/session/refactor-types.ts +24 -12
  262. package/src/session/refactor-workflow.ts +68 -243
  263. package/src/session/target-workflow.ts +25 -18
  264. package/src/tool/code_find/execute.ts +6 -7
  265. package/src/tool/code_find/result.ts +5 -7
  266. package/src/tool/code_find/spec.ts +9 -16
  267. package/src/tool/code_find/tui.ts +12 -6
  268. package/src/tool/code_graph/display.ts +5 -6
  269. package/src/tool/code_graph/format.ts +8 -24
  270. package/src/tool/code_graph/result.ts +16 -75
  271. package/src/tool/code_graph/section.ts +21 -33
  272. package/src/tool/code_graph/spec.ts +6 -0
  273. package/src/tool/code_graph/tui.ts +10 -5
  274. package/src/tool/code_health/diagnostic-tui.ts +49 -0
  275. package/src/tool/code_health/guidance.ts +27 -0
  276. package/src/tool/code_health/markdown.ts +60 -8
  277. package/src/tool/code_health/result.ts +20 -9
  278. package/src/tool/code_health/spec.ts +6 -0
  279. package/src/tool/code_health/structured-schema.ts +18 -4
  280. package/src/tool/code_health/structured.ts +22 -18
  281. package/src/tool/code_health/tui.ts +33 -40
  282. package/src/tool/code_inspect/execute.ts +1 -1
  283. package/src/tool/code_inspect/markdown.ts +33 -6
  284. package/src/tool/code_inspect/result.ts +24 -19
  285. package/src/tool/code_inspect/spec.ts +14 -6
  286. package/src/tool/code_inspect/structured.ts +4 -21
  287. package/src/tool/code_inspect/tui.ts +2 -2
  288. package/src/tool/code_orientation/result.ts +53 -100
  289. package/src/tool/code_orientation/spec.ts +8 -0
  290. package/src/tool/code_orientation/structured-schema.ts +16 -12
  291. package/src/tool/code_orientation/structured-workspace.ts +13 -7
  292. package/src/tool/code_orientation/structured.ts +31 -39
  293. package/src/tool/code_orientation/workspace-format.ts +4 -10
  294. package/src/tool/code_orientation/workspace-instructions.ts +4 -5
  295. package/src/tool/code_orientation/workspace-observations.ts +2 -2
  296. package/src/tool/code_orientation/workspace-output.ts +16 -7
  297. package/src/tool/code_orientation/workspace-projects.ts +7 -10
  298. package/src/tool/code_orientation/workspace-sections.ts +13 -19
  299. package/src/tool/code_refactor_apply/result.ts +2 -1
  300. package/src/tool/code_refactor_apply/spec.ts +7 -0
  301. package/src/tool/code_refactor_plan/execute.ts +0 -2
  302. package/src/tool/code_refactor_plan/result.ts +23 -13
  303. package/src/tool/code_refactor_plan/spec.ts +8 -2
  304. package/src/tool/code_refactor_plan/structured.ts +59 -12
  305. package/src/tool/code_refactor_plan/tui.ts +14 -17
  306. package/src/tool/code_resolve/markdown.ts +5 -47
  307. package/src/tool/code_resolve/result.ts +43 -72
  308. package/src/tool/code_resolve/spec.ts +6 -0
  309. package/src/tool/infra/truncate.ts +2 -16
  310. package/src/tool/namespace.ts +14 -0
  311. package/src/tool/refactor-markdown.ts +55 -15
  312. package/src/tool/register.ts +3 -0
  313. package/src/tool/result/candidate-selection.ts +141 -0
  314. package/src/tool/result/display.ts +41 -45
  315. package/src/tool/result/errors.ts +1 -0
  316. package/src/tool/result/model-budget.ts +26 -1
  317. package/src/tool/result/refactor-preview.ts +118 -0
  318. package/src/tool/result/refactor-unavailable.ts +16 -0
  319. package/src/tool/result/refactor.ts +19 -10
  320. package/src/tool/result/structured.ts +2 -1
  321. package/src/tool/result/types.ts +9 -8
  322. package/src/tool/schemas.ts +76 -38
  323. package/src/tool/specs.ts +3 -0
  324. package/src/ui/footer.ts +2 -4
  325. package/src/ui/status-overlay.ts +1 -1
  326. package/src/ui/status-presentation.ts +4 -7
  327. package/src/ui/tui/candidate-selection.ts +40 -95
  328. package/src/ui/tui/common.ts +16 -70
  329. package/src/ui/tui/display.ts +6 -24
  330. package/src/tool/result/candidate-row.ts +0 -49
@@ -1,38 +1,22 @@
1
- import type { EvidenceListMetadata } from "../../analysis/evidence.ts";
1
+ import { describeEvidenceList, type EvidenceListFacts } from "../../analysis/evidence.ts";
2
2
 
3
- /** Format graph counts and all known limits in one place. */
3
+ /** Canonical evidence phrase for one graph list, plus its external-location count. */
4
4
  export function formatGraphEvidence(
5
- metadata: Omit<EvidenceListMetadata, "partialReason"> & { partialReason: string | null },
6
- noun: "locations" | "call sites" | "candidates",
5
+ facts: EvidenceListFacts,
6
+ noun: "locations" | "call sites",
7
7
  externalCount = 0,
8
8
  ): string {
9
- const { shownCount, totalCount, omittedCount, partialReason, invalidLocationCount } = metadata;
10
- const count = totalCount ?? shownCount;
11
- const label = count === 1 ? singularGraphNoun(noun) : noun;
12
- let text =
13
- totalCount === null
14
- ? `${shownCount} ${label} shown${omittedCount ? `; ${omittedCount} collected omitted` : ""}; more may exist — ${partialReason}`
15
- : omittedCount
16
- ? `${shownCount} of ${totalCount} ${label} shown; ${omittedCount} omitted`
17
- : `${totalCount} ${label}`;
18
- if (externalCount > 0)
19
- text += `; ${externalCount} external location${externalCount === 1 ? "" : "s"}`;
20
- if (metadata.partialMessage) text += ` — ${metadata.partialMessage}`;
21
- if (invalidLocationCount) {
22
- const invalidNoun = invalidLocationCount === 1 ? "location" : "locations";
23
- text += `; ${invalidLocationCount} invalid provider ${invalidNoun} omitted (invalid-provider-location)`;
24
- }
25
- return text;
9
+ const text = describeEvidenceList(facts, { one: singularGraphNoun(noun), other: noun });
10
+ if (externalCount === 0) return text;
11
+ return `${text}; ${externalCount} external location${externalCount === 1 ? "" : "s"}`;
26
12
  }
27
13
 
28
- function singularGraphNoun(noun: "locations" | "call sites" | "candidates"): string {
14
+ function singularGraphNoun(noun: "locations" | "call sites"): string {
29
15
  switch (noun) {
30
16
  case "locations":
31
17
  return "location";
32
18
  case "call sites":
33
19
  return "call site";
34
- case "candidates":
35
- return "candidate";
36
20
  }
37
21
  }
38
22
 
@@ -1,5 +1,5 @@
1
1
  import type { ConfidenceMode } from "@mrclrchtr/supi-code-runtime/api";
2
- import type { EvidenceList, EvidenceListMetadata } from "../../analysis/evidence.ts";
2
+ import type { EvidenceList } from "../../analysis/evidence.ts";
3
3
  import { toDisplayPath } from "../../analysis/search/paths.ts";
4
4
  import type { GraphSection } from "../../session/graph-types.ts";
5
5
  import {
@@ -8,12 +8,9 @@ import {
8
8
  type ResultProvenance,
9
9
  type ToolResultAssembly,
10
10
  } from "../result/assembly.ts";
11
- import { formatCandidateRow, formatPartialCandidateDisclosure } from "../result/candidate-row.ts";
12
- import { createToolDisplaySection } from "../result/display.ts";
13
11
  import type { ToolDisplaySection } from "../result/types.ts";
14
12
  import type { GraphDetails, GraphFileGroup, GraphSectionDetails } from "./details.ts";
15
13
  import { graphDisplaySection } from "./display.ts";
16
- import { formatGraphEvidence } from "./format.ts";
17
14
  import { graphReadNext } from "./read-next.ts";
18
15
  import { type AssembledGraphSection, assembleGraphSection } from "./section.ts";
19
16
  import { structuredGraphCandidates, structuredGraphResult } from "./structured.ts";
@@ -155,6 +152,7 @@ function graphConfidence(sections: readonly AssembledGraphSection[]): Confidence
155
152
  }
156
153
 
157
154
  import type { CodeIntelResult, CodeIntelToolExecCtx } from "../../types/index.ts";
155
+ import { assembleCandidateSelection } from "../result/candidate-selection.ts";
158
156
  import { searchErrorResult } from "../result/errors.ts";
159
157
  import { renderGraphResult } from "./markdown.ts";
160
158
 
@@ -203,88 +201,31 @@ export function finishGraphResult(outcome: GraphOutcome, cwd: string): CodeIntel
203
201
  }
204
202
 
205
203
  function finishGraphCandidates(
206
- input: Extract<GraphOutcome, { kind: "disambiguation" | "kind-mismatch" }>,
204
+ outcome: Extract<GraphOutcome, { kind: "disambiguation" | "kind-mismatch" }>,
207
205
  cwd: string,
208
206
  ): CodeIntelResult {
209
- const outcome = {
210
- ...input,
211
- candidates: input.candidates.map((candidate) => ({
212
- ...candidate,
213
- file: toDisplayPath(cwd, candidate.file),
214
- })),
215
- };
216
- const lines = [
217
- outcome.kind === "kind-mismatch"
218
- ? `**No target matched provider kind \`${outcome.requestedKind}\`. Near matches:**`
219
- : "**Target is ambiguous. Choose one candidate handle:**",
220
- "",
221
- ];
222
- for (const candidate of outcome.candidates) {
223
- lines.push(
224
- `- \`${candidate.targetId}\` — ${candidate.name} (\`${candidate.kind ?? "unknown"}\`) at ${candidate.file}:${candidate.line}:${candidate.character}`,
225
- );
226
- }
227
- const evidence = graphCandidateEvidence(outcome);
228
- lines.push(
229
- "",
230
- formatPartialCandidateDisclosure(evidence) ?? formatGraphEvidence(evidence, "candidates"),
231
- );
232
- if (outcome.kind === "kind-mismatch") {
233
- lines.push(
234
- "",
235
- "Retry without `symbolKind`, use an observed provider kind, or choose a handle.",
236
- );
237
- }
238
- const displaySections = [
239
- createToolDisplaySection({
240
- key: "graph.candidates",
241
- title: "Candidates",
242
- items: outcome.candidates,
243
- totalCount: evidence.totalCount,
244
- omittedCount: evidence.omittedCount,
245
- partialReason: evidence.partialReason,
246
- partialMessage: evidence.partialMessage,
247
- format: (candidate) => formatCandidateRow(candidate, "handle-first"),
248
- }),
249
- ];
250
- const nextQueries =
251
- outcome.kind === "kind-mismatch"
252
- ? ["Retry without symbolKind, use an observed provider kind, or choose a near-match handle"]
253
- : ["Choose one candidate handle, or narrow the symbol selector with scope or symbolKind"];
254
- const message =
255
- outcome.kind === "kind-mismatch"
256
- ? `No target matched provider kind ${outcome.requestedKind}.`
257
- : "The target is ambiguous.";
207
+ const selection = assembleCandidateSelection({ outcome, key: "graph.candidates", cwd });
208
+ const nextQueries = [...selection.nextQueries];
258
209
  return {
259
- ...searchErrorResult(lines.join("\n"), {
210
+ ...searchErrorResult(selection.content, {
260
211
  confidence: "semantic",
261
- evidenceLists: [evidence],
212
+ evidenceLists: [selection.evidence],
262
213
  nextQueries,
263
- status: outcome.kind === "disambiguation" ? "disambiguation" : "invalid-input",
264
- message,
265
- displaySections,
214
+ status: selection.status,
215
+ message: selection.message,
216
+ displaySections: selection.displaySections,
266
217
  }),
267
- structuredContent: structuredGraphCandidates(outcome, evidence, { message, nextQueries }),
268
- };
269
- }
270
-
271
- function graphCandidateEvidence(
272
- outcome: Extract<GraphOutcome, { kind: "disambiguation" | "kind-mismatch" }>,
273
- ): EvidenceListMetadata {
274
- return {
275
- key: "graph.candidates",
276
- totalCount: outcome.totalCount,
277
- shownCount: outcome.candidates.length,
278
- omittedCount: outcome.omittedCount,
279
- partialReason: outcome.partialReason,
280
- partialMessage: outcome.partialMessage,
218
+ structuredContent: structuredGraphCandidates(
219
+ { ...outcome, candidates: [...selection.candidates] },
220
+ selection.evidence,
221
+ { message: selection.message, nextQueries },
222
+ ),
281
223
  };
282
224
  }
283
225
 
284
226
  function hasHiddenDisplayEvidence(assembly: GraphResultAssembly): boolean {
285
227
  return assembly.sections.some(
286
228
  (section, index) =>
287
- section.kind === "ok" &&
288
- assembly.displaySections[index].shownCount < section.evidence.items.length,
229
+ section.kind === "ok" && assembly.displaySections[index].displayOmittedCount > 0,
289
230
  );
290
231
  }
@@ -61,29 +61,21 @@ export function assembleGraphSection(
61
61
  };
62
62
  }
63
63
  case "callees": {
64
- const evidence = section.data.recovery
65
- ? createPartialEvidenceList({
66
- key: "callees.calls",
67
- items: [...section.data.calls],
68
- maxResults,
69
- partialReason: "provider-limited",
70
- })
71
- : createEvidenceList({
72
- key: "callees.calls",
73
- items: [...section.data.calls],
74
- maxResults,
75
- });
76
64
  return {
77
65
  ...section,
78
66
  evidence: section.data.recovery
79
- ? {
80
- ...evidence,
81
- metadata: {
82
- ...evidence.metadata,
83
- partialMessage: recoveryMessage(section.data.recovery, cwd),
84
- },
85
- }
86
- : evidence,
67
+ ? createPartialEvidenceList({
68
+ key: "callees.calls",
69
+ items: [...section.data.calls],
70
+ maxResults,
71
+ partialReason: "provider-limited",
72
+ partialMessage: recoveryMessage(section.data.recovery, cwd),
73
+ })
74
+ : createEvidenceList({
75
+ key: "callees.calls",
76
+ items: [...section.data.calls],
77
+ maxResults,
78
+ }),
87
79
  };
88
80
  }
89
81
  case "implements":
@@ -109,20 +101,16 @@ function createRelationEvidenceList<T>(params: {
109
101
  partialReason: RelationLocationPartialReason | null;
110
102
  partialMessage: string | null;
111
103
  }): EvidenceList<T> {
112
- const evidence =
113
- params.partialReason === "provider-limited"
114
- ? createPartialEvidenceList({ ...params, partialReason: params.partialReason })
115
- : createEvidenceList(params);
116
- if (params.partialReason === null) return evidence;
117
- return {
118
- ...evidence,
119
- metadata: {
120
- ...evidence.metadata,
121
- partialReason: params.partialReason,
122
- invalidLocationCount: params.invalidLocationCount,
123
- ...(params.partialMessage ? { partialMessage: params.partialMessage } : {}),
124
- },
104
+ const common = {
105
+ key: params.key,
106
+ items: params.items,
107
+ maxResults: params.maxResults,
108
+ invalidLocationCount: params.invalidLocationCount,
109
+ ...(params.partialMessage ? { partialMessage: params.partialMessage } : {}),
125
110
  };
111
+ return params.partialReason === "provider-limited"
112
+ ? createPartialEvidenceList({ ...common, partialReason: "provider-limited" })
113
+ : createEvidenceList(common);
126
114
  }
127
115
 
128
116
  function recoveryMessage(
@@ -12,6 +12,12 @@ export const CODE_GRAPH_TOOL_LABEL = "Code Graph";
12
12
  export const codeGraphSpec = {
13
13
  name: CODE_GRAPH_TOOL_NAME,
14
14
  label: CODE_GRAPH_TOOL_LABEL,
15
+ annotations: {
16
+ readOnlyHint: true,
17
+ destructiveHint: false,
18
+ idempotentHint: true,
19
+ openWorldHint: false,
20
+ },
15
21
  outputSchema: GraphOutputSchema,
16
22
  parameters: Type.Object(
17
23
  {
@@ -19,6 +19,7 @@ import {
19
19
  type ToolResult,
20
20
  } from "../../ui/tui/common.ts";
21
21
  import {
22
+ describeDisplayOmission,
22
23
  MAX_TUI_DISPLAY_ITEMS,
23
24
  readToolDisplaySections,
24
25
  truncateDisplayText,
@@ -182,11 +183,15 @@ function sectionSummary(
182
183
  ): string {
183
184
  if (section.unavailable) return `${section.label}: unavailable`;
184
185
  if (!metadata) return `${section.label}: evidence unavailable`;
185
- // The display has its own bounded row count; the underlying evidence total is unchanged.
186
- const shown = display
187
- ? { ...metadata, shownCount: display.shownCount, omittedCount: display.omittedCount }
188
- : metadata;
189
- return `${section.label}: ${formatGraphEvidence(shown, section.rel === "callees" ? "call sites" : "locations", section.externalCount)}`;
186
+ const summary = formatGraphEvidence(
187
+ metadata,
188
+ section.rel === "callees" ? "call sites" : "locations",
189
+ section.externalCount,
190
+ );
191
+ // View-hidden rows are a Display omission; the evidence counts are unchanged.
192
+ const hiddenPhrase = describeDisplayOmission(display?.displayOmittedCount ?? 0);
193
+ const hidden = hiddenPhrase ? `; ${hiddenPhrase}` : "";
194
+ return `${section.label}: ${summary}${hidden}`;
190
195
  }
191
196
 
192
197
  function readSections(value: unknown): SectionView[] {
@@ -0,0 +1,49 @@
1
+ /** Diagnostic-section readers and empty-result summary for the code_health TUI. */
2
+ import type { Theme } from "@earendil-works/pi-coding-agent";
3
+ import { Text } from "@earendil-works/pi-tui";
4
+ import { formatDiagnosticEvidence, withDiagnosticScope } from "./scope.ts";
5
+
6
+ /** An empty entry list is clean only when the shared coverage classification is `confirmed`. */
7
+ export function buildEmptyDiagnosticSummary(
8
+ data: Record<string, unknown> | null,
9
+ theme: Theme,
10
+ ): Text {
11
+ const coverage = data?.diagnosticCoverage;
12
+ if (coverage === "none") {
13
+ const files = diagnosticScopeKind(data) === "file" ? "requested" : "tracked";
14
+ const label = `No source diagnostics checked (0 ${files} files)`;
15
+ return new Text(theme.fg("dim", withDiagnosticScope(label, data)), 0, 0);
16
+ }
17
+ if (coverage === "incomplete") {
18
+ const counts = formatDiagnosticEvidence(readDiagnosticEvidence(data));
19
+ const label = `Diagnostic evidence incomplete${counts ? ` (${counts})` : ""}`;
20
+ return new Text(theme.fg("warning", withDiagnosticScope(label, data)), 0, 0);
21
+ }
22
+ return new Text(
23
+ theme.fg("success", withDiagnosticScope(diagnosticEmptySummary(data), data)),
24
+ 0,
25
+ 0,
26
+ );
27
+ }
28
+
29
+ function diagnosticEmptySummary(data: Record<string, unknown> | null): string {
30
+ return diagnosticScopeKind(data) === "file"
31
+ ? "No errors or warnings for file"
32
+ : "No reported issues in tracked files";
33
+ }
34
+
35
+ export function diagnosticScopeKind(data: Record<string, unknown> | null): string | null {
36
+ const observation = readRecord(data?.diagnosticObservation);
37
+ const scope = readRecord(observation?.scope);
38
+ return typeof scope?.kind === "string" ? scope.kind : null;
39
+ }
40
+
41
+ export function readDiagnosticEvidence(
42
+ data: Record<string, unknown> | null,
43
+ ): Record<string, unknown> | null {
44
+ return readRecord(readRecord(data?.diagnosticObservation)?.evidence);
45
+ }
46
+
47
+ export function readRecord(value: unknown): Record<string, unknown> | null {
48
+ return typeof value === "object" && value !== null ? (value as Record<string, unknown>) : null;
49
+ }
@@ -1,6 +1,33 @@
1
+ import type { HealthDiagnosticScope, HealthRefreshState } from "../../session/health-types.ts";
2
+
1
3
  export const toolDescription =
2
4
  "Report live diagnostics and language-server health. Use refresh:true when you need fresh diagnostic evidence; without it, diagnostics may be a tracked-file snapshot. Diagnostic snapshots do not prove that the whole workspace is clean; server inventory and route-status counts are always workspace-wide.";
3
5
 
4
6
  export const promptSnippet = "check live diagnostics and language-server health";
5
7
 
6
8
  export const promptGuidelines: string[] = [];
9
+
10
+ /** Next action for missing diagnostic evidence: file-level LSP check versus project-wide compiler check. */
11
+ export const DIAGNOSTIC_NEXT_ACTION =
12
+ "for a file-level LSP check, call `code_health` with `scope` set to that file and `refresh: true`; for project-wide validation, run the project's own typecheck or build";
13
+
14
+ /**
15
+ * Exact-file scopes request live diagnostics; only a tracked-file snapshot read without a refresh
16
+ * in this call can lag edits made outside Pi.
17
+ */
18
+ export function isPassiveTrackedSnapshot(
19
+ scope: HealthDiagnosticScope,
20
+ refresh: HealthRefreshState,
21
+ ): boolean {
22
+ return (
23
+ scope.kind === "tracked-files" && refresh.kind !== "completed" && refresh.kind !== "failed"
24
+ );
25
+ }
26
+
27
+ /**
28
+ * A passive tracked-file snapshot reflects the last synchronization. Files whose disk metadata
29
+ * changed since then are already reported as unconfirmed; this note covers what a stat cannot
30
+ * show: effects of those edits on other files and same-size rewrites within one timestamp tick.
31
+ */
32
+ export const PASSIVE_SNAPSHOT_NOTE =
33
+ "This tracked-file snapshot reflects the last LSP synchronization; files changed on disk since then are unconfirmed, but effects of outside edits on other files may not be included. Use `refresh: true` for current evidence";
@@ -7,7 +7,13 @@ import {
7
7
  formatProjectServerRouteSummary,
8
8
  formatProjectServerStatusReason,
9
9
  } from "../../analysis/health/server-status.ts";
10
+ import { classifyDiagnosticCoverage } from "../../diagnostics/coverage.ts";
10
11
  import { makeRelative, renderFileScopeStatus } from "./file-scope-markdown.ts";
12
+ import {
13
+ DIAGNOSTIC_NEXT_ACTION,
14
+ isPassiveTrackedSnapshot,
15
+ PASSIVE_SNAPSHOT_NOTE,
16
+ } from "./guidance.ts";
11
17
  import {
12
18
  formatProcessCrashRecovery,
13
19
  formatRefreshElapsed,
@@ -287,22 +293,68 @@ function renderDiagnosticObservation(lines: string[], data: HealthData, cwd: str
287
293
  }
288
294
  return;
289
295
  }
290
- if (observation.kind === "partial") {
291
- lines.push(`Diagnostics partially collected — ${asSentence(observation.reason)}`);
292
- if (observation.entries.length > 0) {
293
- lines.push("");
294
- lines.push("Partial results:");
295
- renderDiagnosticEntries(lines, data, cwd);
296
- }
296
+ const coverage = classifyDiagnosticCoverage(observation);
297
+ if (coverage === "none") {
298
+ renderNoDiagnosticEvidence(lines, observation);
299
+ return;
300
+ }
301
+ if (coverage === "incomplete") {
302
+ renderIncompleteDiagnosticEvidence(lines, data, observation, cwd);
297
303
  return;
298
304
  }
299
305
  if (observation.entries.length === 0) {
300
- lines.push("No errors or warnings reported in this scope.");
306
+ lines.push(confirmedCleanText(observation.scope, observation.evidence.confirmed, cwd));
307
+ } else {
308
+ renderDiagnosticEntries(lines, data, cwd);
309
+ }
310
+ if (isPassiveTrackedSnapshot(observation.scope, data.refresh)) {
311
+ // A blank line keeps the note out of the preceding diagnostic list item.
312
+ lines.push("", `${PASSIVE_SNAPSHOT_NOTE}.`);
313
+ }
314
+ }
315
+
316
+ type CollectedObservation = Extract<HealthData["diagnostics"], { kind: "completed" | "partial" }>;
317
+
318
+ /** Zero requested files: nothing was checked, so no clean wording is allowed. */
319
+ function renderNoDiagnosticEvidence(lines: string[], observation: CollectedObservation): void {
320
+ const files = observation.scope.kind === "file" ? "requested" : "tracked";
321
+ lines.push(
322
+ `No source diagnostics checked (0 ${files} files). Running servers and source discovery are not diagnostic confirmation.`,
323
+ );
324
+ if (observation.kind === "partial") lines.push(`Limitation: ${asSentence(observation.reason)}`);
325
+ lines.push(`Next: ${DIAGNOSTIC_NEXT_ACTION}.`);
326
+ }
327
+
328
+ /** Some requested files lack confirmation: keep reported messages visible as partial results. */
329
+ function renderIncompleteDiagnosticEvidence(
330
+ lines: string[],
331
+ data: HealthData,
332
+ observation: CollectedObservation,
333
+ cwd: string,
334
+ ): void {
335
+ const { confirmed, requested, removed } = observation.evidence;
336
+ lines.push(
337
+ observation.kind === "partial"
338
+ ? `Diagnostics partially collected — ${asSentence(observation.reason)}`
339
+ : `Diagnostic evidence is incomplete — ${confirmed} of ${requested} requested file${plural(requested)} confirmed${removed > 0 ? `, ${removed} removed` : ""}.`,
340
+ );
341
+ if (observation.entries.length === 0) {
342
+ lines.push("No errors or warnings were reported, but this is not a clean result.");
301
343
  return;
302
344
  }
345
+ lines.push("");
346
+ lines.push("Partial results:");
303
347
  renderDiagnosticEntries(lines, data, cwd);
304
348
  }
305
349
 
350
+ function confirmedCleanText(scope: HealthDiagnosticScope, confirmed: number, cwd: string): string {
351
+ if (scope.kind === "file") {
352
+ return `No errors or warnings in confirmed file \`${makeRelative(cwd, scope.path)}\`. This is a file-level LSP check, not project-wide validation.`;
353
+ }
354
+ const under = scope.filter ? ` under \`${makeRelative(cwd, scope.filter)}\`` : "";
355
+ return `No errors or warnings in ${confirmed} confirmed tracked file${plural(confirmed)}${under}. Untracked files were not checked; run the project's own typecheck or build for project-wide validation.`;
356
+ }
357
+
306
358
  function currentRefreshAttempt(data: HealthData): HealthRefreshAttempt | null {
307
359
  return data.refresh.kind === "completed" || data.refresh.kind === "failed" ? data.refresh : null;
308
360
  }
@@ -1,4 +1,5 @@
1
1
  import type { ConfidenceMode } from "@mrclrchtr/supi-code-runtime/api";
2
+ import { createEvidenceList, createPartialEvidenceList } from "../../analysis/evidence.ts";
2
3
  import {
3
4
  countProjectServerRouteStatuses,
4
5
  formatProjectServerCompiler,
@@ -6,6 +7,7 @@ import {
6
7
  formatProjectServerRoot,
7
8
  formatProjectServerStatusReason,
8
9
  } from "../../analysis/health/server-status.ts";
10
+ import { classifyDiagnosticCoverage } from "../../diagnostics/coverage.ts";
9
11
  import type { HealthData, HealthSection } from "../../session/health-types.ts";
10
12
  import {
11
13
  assembleToolResult,
@@ -82,6 +84,10 @@ export function assembleHealthResult(input: HealthData, cwd?: string): HealthRes
82
84
  serverInventoryAvailable: data.serverInventoryAvailable,
83
85
  serverInventoryScope: "workspace",
84
86
  diagnosticObservation: data.diagnostics,
87
+ diagnosticCoverage:
88
+ data.diagnostics.kind === "not-requested"
89
+ ? null
90
+ : classifyDiagnosticCoverage(data.diagnostics),
85
91
  refresh: data.refresh,
86
92
  structuralAvailable: structuralCapabilityReady(data),
87
93
  structuralStatus: data.structuralStatus,
@@ -103,9 +109,7 @@ function buildHealthDisplaySections(data: HealthData, cwd?: string): ToolDisplay
103
109
  key: "health.diagnostics",
104
110
  title: "Diagnostics",
105
111
  items: data.diagnostics.entries,
106
- totalCount: data.diagnostics.kind === "completed" ? data.diagnostics.entries.length : null,
107
- omittedCount: data.diagnostics.kind === "completed" ? 0 : null,
108
- partialReason: diagnosticPartialReason(data),
112
+ evidence: diagnosticEvidence(data),
109
113
  format: formatDiagnosticEntry,
110
114
  }),
111
115
  );
@@ -117,8 +121,8 @@ function buildHealthDisplaySections(data: HealthData, cwd?: string): ToolDisplay
117
121
  key: "health.servers",
118
122
  title: "Servers",
119
123
  items: data.servers,
120
- totalCount: data.servers.length,
121
- format: (server) => {
124
+ evidence: createEvidenceList({ key: "health.servers", items: data.servers }).metadata,
125
+ format: (server: HealthData["servers"][number]) => {
122
126
  const root = cwd ? formatProjectServerRoot(cwd, server.root) : server.root;
123
127
  const compiler = formatProjectServerCompiler(server.typescript);
124
128
  const support = [
@@ -137,10 +141,17 @@ function buildHealthDisplaySections(data: HealthData, cwd?: string): ToolDisplay
137
141
  return sections;
138
142
  }
139
143
 
140
- function diagnosticPartialReason(data: HealthData): string | null {
141
- return data.diagnostics.kind === "partial" || data.diagnostics.kind === "unavailable"
142
- ? data.diagnostics.reason
143
- : null;
144
+ /** Every collected diagnostic file is shown; an incomplete observation may hide more. */
145
+ function diagnosticEvidence(data: HealthData) {
146
+ const params = { key: "health.diagnostics", items: data.diagnostics.entries };
147
+ const observation = data.diagnostics;
148
+ return observation.kind === "partial" || observation.kind === "unavailable"
149
+ ? createPartialEvidenceList({
150
+ ...params,
151
+ partialReason: "provider-limited",
152
+ partialMessage: observation.reason,
153
+ }).metadata
154
+ : createEvidenceList(params).metadata;
144
155
  }
145
156
 
146
157
  function formatDiagnosticEntry(entry: HealthData["diagnostics"]["entries"][number]): string {
@@ -12,6 +12,12 @@ export const CODE_HEALTH_TOOL_LABEL = "Code Health";
12
12
  export const codeHealthSpec = {
13
13
  name: CODE_HEALTH_TOOL_NAME,
14
14
  label: CODE_HEALTH_TOOL_LABEL,
15
+ annotations: {
16
+ readOnlyHint: true,
17
+ destructiveHint: false,
18
+ idempotentHint: true,
19
+ openWorldHint: false,
20
+ },
15
21
  parameters: Type.Object(
16
22
  {
17
23
  scope: Type.Optional(ScopeParam),
@@ -18,6 +18,13 @@ const evidence = object({
18
18
  object({
19
19
  file: Type.String(),
20
20
  status: Type.Enum(["confirmed", "unconfirmed", "failed", "removed"], { type: "string" }),
21
+ reason: Type.Optional(
22
+ Type.Enum(["disk-changed"], {
23
+ type: "string",
24
+ description:
25
+ "Known cause of a non-confirmed status. disk-changed = the file changed on disk after its last diagnosis.",
26
+ }),
27
+ ),
21
28
  }),
22
29
  ),
23
30
  });
@@ -55,6 +62,11 @@ const diagnosticEntry = object({
55
62
  ),
56
63
  ),
57
64
  });
65
+ const coverage = Type.Enum(["unavailable", "none", "incomplete", "confirmed"], {
66
+ type: "string",
67
+ description:
68
+ "What the evidence establishes: none = zero files checked; incomplete = some requested files unconfirmed, failed, or removed; confirmed = every requested file confirmed (never project-wide validation).",
69
+ });
58
70
  const diagnostics = Type.Union([
59
71
  object({ kind: Type.Literal("not-requested"), entries: Type.Array(diagnosticEntry) }),
60
72
  object({
@@ -62,6 +74,7 @@ const diagnostics = Type.Union([
62
74
  scope,
63
75
  entries: Type.Array(diagnosticEntry),
64
76
  evidence,
77
+ coverage,
65
78
  scopeStatus: Type.Optional(scopeStatus),
66
79
  }),
67
80
  object({
@@ -69,6 +82,7 @@ const diagnostics = Type.Union([
69
82
  scope,
70
83
  entries: Type.Array(diagnosticEntry),
71
84
  evidence,
85
+ coverage,
72
86
  reason: Type.String(),
73
87
  scopeStatus: Type.Optional(scopeStatus),
74
88
  }),
@@ -77,14 +91,14 @@ const operation = object({
77
91
  server: Type.Enum(["advertised", "not-advertised", "unknown"], { type: "string" }),
78
92
  supi: Type.Enum(["supported", "limited", "unsupported"], { type: "string" }),
79
93
  reason: Type.Optional(Type.String()),
94
+ kinds: Type.Optional(Type.Array(Type.String())),
95
+ anyKind: Type.Optional(Type.Boolean()),
80
96
  });
81
97
  const support = object({
82
98
  rename_symbol: Type.Optional(operation),
83
99
  prepare_rename: Type.Optional(operation),
84
- extract_function: Type.Optional(operation),
85
- extract_variable: Type.Optional(operation),
86
- update_imports: Type.Optional(operation),
87
- delete_dead_code: Type.Optional(operation),
100
+ code_action: Type.Optional(operation),
101
+ source_action: Type.Optional(operation),
88
102
  code_action_resolve: Type.Optional(operation),
89
103
  });
90
104
  const server = object({