@mrclrchtr/supi-code-intelligence 12.0.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 (268) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +4 -2
  3. package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  4. package/node_modules/@mrclrchtr/supi-core/package.json +3 -1
  5. package/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
  6. package/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
  7. package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
  8. package/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
  9. package/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
  10. package/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
  11. package/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
  12. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  13. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +3 -1
  14. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
  15. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
  16. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
  17. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
  18. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
  19. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
  20. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
  21. package/node_modules/@mrclrchtr/supi-lsp/package.json +8 -8
  22. package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +1 -0
  23. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-cache.ts +102 -47
  24. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-host.ts +8 -0
  25. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-refresh.ts +15 -1
  26. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-request.ts +1 -1
  27. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +46 -4
  28. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-disk-stamp.ts +60 -0
  29. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-state.ts +3 -0
  30. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-sync.ts +21 -1
  31. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-file-state.ts +17 -3
  32. package/node_modules/@mrclrchtr/supi-lsp/src/client/client-semantic-input-barrier.ts +53 -4
  33. package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +11 -3
  34. package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-extends.ts +2 -1
  35. package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-path.ts +2 -2
  36. package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-scope.ts +14 -5
  37. package/node_modules/@mrclrchtr/supi-lsp/src/config/typescript-module.ts +17 -0
  38. package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/evidence.ts +42 -0
  39. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-client-state.ts +2 -17
  40. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-removal-ledger.ts +52 -0
  41. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +40 -20
  42. package/node_modules/@mrclrchtr/supi-lsp/src/manager/typescript-file-local.ts +6 -1
  43. package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +6 -1
  44. package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-symbol-mapper.ts +13 -3
  45. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostic-surface.ts +11 -0
  46. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostics.ts +1 -0
  47. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +17 -2
  48. package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-transition-debug.ts +11 -1
  49. package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +2 -0
  50. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  51. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +3 -1
  52. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
  53. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
  54. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
  55. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
  56. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
  57. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
  58. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
  59. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs +50 -75
  60. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs.map +2 -2
  61. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js +50 -75
  62. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js.map +2 -2
  63. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm +0 -0
  64. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm.map +6 -6
  65. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/package.json +1 -1
  66. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs +50 -75
  67. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs.map +2 -2
  68. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts +7 -7
  69. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts.map +1 -1
  70. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts +7 -7
  71. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +1 -1
  72. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js +50 -75
  73. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js.map +2 -2
  74. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm +0 -0
  75. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm.map +5 -5
  76. package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +5 -5
  77. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/kotlin/tree-sitter-kotlin.wasm.json +1 -1
  78. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/latex/tree-sitter-latex.wasm.json +1 -1
  79. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm.json +1 -1
  80. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm.json +1 -1
  81. package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm.json +1 -1
  82. package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-client.ts +1 -1
  83. package/node_modules/fast-xml-parser/CHANGELOG.md +886 -0
  84. package/node_modules/fast-xml-parser/LICENSE +21 -0
  85. package/node_modules/fast-xml-parser/README.md +204 -0
  86. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
  87. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
  88. package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
  89. package/node_modules/fast-xml-parser/lib/fxp.d.cts +774 -0
  90. package/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
  91. package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
  92. package/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
  93. package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
  94. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
  95. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
  96. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/README.md +92 -0
  97. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/package.json +57 -0
  98. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityDecoder.js +644 -0
  99. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityEncoder.js +239 -0
  100. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/all-entities.js +53 -0
  101. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entities.js +1139 -0
  102. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entityTries.js +60 -0
  103. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.d.ts +358 -0
  104. package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.js +29 -0
  105. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/CHANGELOG.md +52 -0
  106. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/LICENSE +21 -0
  107. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/README.md +77 -0
  108. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.cjs +1 -0
  109. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.d.cts +270 -0
  110. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js +2 -0
  111. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -0
  112. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/package.json +77 -0
  113. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.d.ts +270 -0
  114. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.js +609 -0
  115. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/ignoreAttributes.js +18 -0
  116. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/orderedJs2Xml.js +360 -0
  117. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/prettifyJs2Xml.js +0 -0
  118. package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/util.js +23 -0
  119. package/node_modules/fast-xml-parser/node_modules/is-unsafe/LICENSE +21 -0
  120. package/node_modules/fast-xml-parser/node_modules/is-unsafe/README.md +632 -0
  121. package/node_modules/fast-xml-parser/node_modules/is-unsafe/package.json +56 -0
  122. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/html.js +102 -0
  123. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/log.js +98 -0
  124. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/nosql.js +114 -0
  125. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/redos.js +60 -0
  126. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/shell.js +105 -0
  127. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql-strict.js +47 -0
  128. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql.js +95 -0
  129. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/svg.js +81 -0
  130. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/xml.js +79 -0
  131. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.cjs +27 -0
  132. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.d.ts +103 -0
  133. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.js +292 -0
  134. package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/util/decode-entities.js +48 -0
  135. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/LICENSE +21 -0
  136. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/README.md +947 -0
  137. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.cjs +1 -0
  138. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.d.cts +725 -0
  139. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js +2 -0
  140. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -0
  141. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/package.json +79 -0
  142. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Expression.js +232 -0
  143. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/ExpressionSet.js +225 -0
  144. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Matcher.js +663 -0
  145. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.d.ts +589 -0
  146. package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.js +30 -0
  147. package/node_modules/fast-xml-parser/node_modules/strnum/CHANGELOG.md +63 -0
  148. package/node_modules/fast-xml-parser/node_modules/strnum/LICENSE +21 -0
  149. package/node_modules/fast-xml-parser/node_modules/strnum/README.md +113 -0
  150. package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/LICENSE +21 -0
  151. package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/README.md +142 -0
  152. package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/anynum.js +135 -0
  153. package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/digitTable.js +116 -0
  154. package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/package.json +42 -0
  155. package/node_modules/fast-xml-parser/node_modules/strnum/package.json +36 -0
  156. package/node_modules/fast-xml-parser/node_modules/strnum/strnum.js +176 -0
  157. package/node_modules/fast-xml-parser/node_modules/xml-naming/LICENSE +21 -0
  158. package/node_modules/fast-xml-parser/node_modules/xml-naming/README.md +287 -0
  159. package/node_modules/fast-xml-parser/node_modules/xml-naming/package.json +56 -0
  160. package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.d.ts +108 -0
  161. package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.js +382 -0
  162. package/node_modules/fast-xml-parser/package.json +93 -0
  163. package/node_modules/fast-xml-parser/src/cli/cli.js +97 -0
  164. package/node_modules/fast-xml-parser/src/cli/man.js +17 -0
  165. package/node_modules/fast-xml-parser/src/cli/read.js +43 -0
  166. package/node_modules/fast-xml-parser/src/fxp.d.ts +754 -0
  167. package/node_modules/fast-xml-parser/src/fxp.js +14 -0
  168. package/node_modules/fast-xml-parser/src/ignoreAttributes.js +18 -0
  169. package/node_modules/fast-xml-parser/src/util.js +61 -0
  170. package/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +16 -0
  171. package/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +106 -0
  172. package/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +61 -0
  173. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +69 -0
  174. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +103 -0
  175. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +100 -0
  176. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +154 -0
  177. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +94 -0
  178. package/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
  179. package/node_modules/fast-xml-parser/src/v6/TagPath.js +81 -0
  180. package/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +13 -0
  181. package/node_modules/fast-xml-parser/src/v6/XMLParser.js +83 -0
  182. package/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +235 -0
  183. package/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +210 -0
  184. package/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +111 -0
  185. package/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +116 -0
  186. package/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +121 -0
  187. package/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +105 -0
  188. package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +22 -0
  189. package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +19 -0
  190. package/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +38 -0
  191. package/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +13 -0
  192. package/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +14 -0
  193. package/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +6 -0
  194. package/node_modules/fast-xml-parser/src/validator.js +518 -0
  195. package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +6 -0
  196. package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +426 -0
  197. package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +164 -0
  198. package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +907 -0
  199. package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +77 -0
  200. package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +177 -0
  201. package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +54 -0
  202. package/package.json +10 -8
  203. package/src/analysis/evidence.ts +331 -73
  204. package/src/analysis/health/diagnostics.ts +66 -18
  205. package/src/analysis/health/evidence-reason.ts +44 -0
  206. package/src/analysis/search/pattern.ts +3 -3
  207. package/src/analysis/target/anchored.ts +3 -6
  208. package/src/analysis/target/symbol.ts +41 -47
  209. package/src/analysis/target/types.ts +4 -9
  210. package/src/analysis/workspace/cmake-parser.ts +207 -0
  211. package/src/analysis/workspace/cmake.ts +141 -0
  212. package/src/analysis/workspace/maven.ts +310 -0
  213. package/src/analysis/workspace/membership.ts +100 -26
  214. package/src/analysis/workspace/metadata.ts +6 -1
  215. package/src/analysis/workspace/observe.ts +6 -0
  216. package/src/analysis/workspace/types.ts +11 -3
  217. package/src/diagnostics/coverage.ts +49 -0
  218. package/src/diagnostics/evidence.ts +10 -2
  219. package/src/session/health-workflow.ts +6 -0
  220. package/src/session/input/common.ts +1 -1
  221. package/src/session/orientation/collect.ts +42 -7
  222. package/src/session/orientation/context-facts.ts +3 -3
  223. package/src/session/orientation/context-sections.ts +13 -15
  224. package/src/session/orientation/facts.ts +5 -8
  225. package/src/session/orientation-workflow.ts +4 -19
  226. package/src/session/target-workflow.ts +25 -18
  227. package/src/tool/code_find/result.ts +5 -7
  228. package/src/tool/code_graph/display.ts +5 -6
  229. package/src/tool/code_graph/format.ts +8 -24
  230. package/src/tool/code_graph/result.ts +16 -75
  231. package/src/tool/code_graph/section.ts +21 -33
  232. package/src/tool/code_graph/tui.ts +10 -5
  233. package/src/tool/code_health/diagnostic-tui.ts +49 -0
  234. package/src/tool/code_health/guidance.ts +27 -0
  235. package/src/tool/code_health/markdown.ts +60 -8
  236. package/src/tool/code_health/result.ts +20 -9
  237. package/src/tool/code_health/structured-schema.ts +14 -0
  238. package/src/tool/code_health/structured.ts +7 -1
  239. package/src/tool/code_health/tui.ts +33 -40
  240. package/src/tool/code_inspect/result.ts +23 -18
  241. package/src/tool/code_inspect/structured.ts +2 -19
  242. package/src/tool/code_orientation/result.ts +53 -100
  243. package/src/tool/code_orientation/structured-schema.ts +16 -12
  244. package/src/tool/code_orientation/structured-workspace.ts +13 -7
  245. package/src/tool/code_orientation/structured.ts +31 -39
  246. package/src/tool/code_orientation/workspace-format.ts +4 -10
  247. package/src/tool/code_orientation/workspace-instructions.ts +4 -5
  248. package/src/tool/code_orientation/workspace-observations.ts +2 -2
  249. package/src/tool/code_orientation/workspace-output.ts +16 -7
  250. package/src/tool/code_orientation/workspace-projects.ts +7 -10
  251. package/src/tool/code_orientation/workspace-sections.ts +13 -19
  252. package/src/tool/code_resolve/markdown.ts +4 -46
  253. package/src/tool/code_resolve/result.ts +43 -72
  254. package/src/tool/infra/truncate.ts +2 -16
  255. package/src/tool/result/candidate-selection.ts +141 -0
  256. package/src/tool/result/display.ts +41 -45
  257. package/src/tool/result/errors.ts +1 -0
  258. package/src/tool/result/model-budget.ts +26 -1
  259. package/src/tool/result/refactor.ts +11 -8
  260. package/src/tool/result/structured.ts +2 -1
  261. package/src/tool/result/types.ts +9 -8
  262. package/src/tool/schemas.ts +15 -20
  263. package/src/ui/footer.ts +2 -4
  264. package/src/ui/status-presentation.ts +4 -7
  265. package/src/ui/tui/candidate-selection.ts +40 -95
  266. package/src/ui/tui/common.ts +16 -70
  267. package/src/ui/tui/display.ts +6 -24
  268. package/src/tool/result/candidate-row.ts +0 -49
@@ -0,0 +1,77 @@
1
+ /* global Uint8Array */
2
+ import { buildOptions } from './OptionsBuilder.js';
3
+ import OrderedObjParser from './OrderedObjParser.js';
4
+ import prettify from './node2json.js';
5
+ import { validate } from "../validator.js";
6
+ import XmlNode from './xmlNode.js';
7
+
8
+ export default class XMLParser {
9
+
10
+ constructor(options) {
11
+ this.externalEntities = {};
12
+ this.options = buildOptions(options);
13
+
14
+ }
15
+ /**
16
+ * Parse XML dats to JS object
17
+ * @param {string|Uint8Array} xmlData
18
+ * @param {boolean|Object} validationOption
19
+ */
20
+ parse(xmlData, validationOption) {
21
+ if (typeof xmlData !== "string" && xmlData.toString) {
22
+ if (xmlData instanceof Uint8Array &&
23
+ !(typeof Buffer !== "undefined" && Buffer.isBuffer(xmlData))) {
24
+ xmlData = new TextDecoder("utf-8", { ignoreBOM: true }).decode(xmlData);
25
+ } else {
26
+ xmlData = xmlData.toString();
27
+ }
28
+ } else if (typeof xmlData !== "string") {
29
+ throw new Error("XML data is accepted in String or Bytes[] form.")
30
+ }
31
+
32
+ if (validationOption) {
33
+ if (validationOption === true) validationOption = {}; //validate with default options
34
+
35
+ const result = validate(xmlData, validationOption);
36
+ if (result !== true) {
37
+ throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`)
38
+ }
39
+ }
40
+ const orderedObjParser = new OrderedObjParser(this.options, this.externalEntities);
41
+ // orderedObjParser.entityDecoder.setExternalEntities(this.externalEntities);
42
+ const orderedResult = orderedObjParser.parseXml(xmlData);
43
+ if (this.options.preserveOrder || orderedResult === undefined) return orderedResult;
44
+ else return prettify(orderedResult, this.options, orderedObjParser.matcher, orderedObjParser.readonlyMatcher);
45
+ }
46
+
47
+ /**
48
+ * Add Entity which is not by default supported by this library
49
+ * @param {string} key
50
+ * @param {string} value
51
+ */
52
+ addEntity(key, value) {
53
+ if (value.indexOf("&") !== -1) {
54
+ throw new Error("Entity value can't have '&'")
55
+ } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) {
56
+ throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'")
57
+ } else if (value === "&") {
58
+ throw new Error("An entity with value '&' is not permitted");
59
+ } else {
60
+ this.externalEntities[key] = value;
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Returns a Symbol that can be used to access the metadata
66
+ * property on a node.
67
+ *
68
+ * If Symbol is not available in the environment, an ordinary property is used
69
+ * and the name of the property is here returned.
70
+ *
71
+ * The XMLMetaData property is only present when `captureMetaData`
72
+ * is true in the options.
73
+ */
74
+ static getMetaDataSymbol() {
75
+ return XmlNode.getMetaDataSymbol();
76
+ }
77
+ }
@@ -0,0 +1,177 @@
1
+ 'use strict';
2
+
3
+ import XmlNode from './xmlNode.js';
4
+ import { Matcher } from 'path-expression-matcher';
5
+
6
+ const METADATA_SYMBOL = XmlNode.getMetaDataSymbol();
7
+
8
+ /**
9
+ * Helper function to strip attribute prefix from attribute map
10
+ * @param {object} attrs - Attributes with prefix (e.g., {"@_class": "code"})
11
+ * @param {string} prefix - Attribute prefix to remove (e.g., "@_")
12
+ * @returns {object} Attributes without prefix (e.g., {"class": "code"})
13
+ */
14
+ function stripAttributePrefix(attrs, prefix) {
15
+ if (!attrs || typeof attrs !== 'object') return {};
16
+ if (!prefix) return attrs;
17
+
18
+ const rawAttrs = {};
19
+ for (const key in attrs) {
20
+ if (key.startsWith(prefix)) {
21
+ const rawName = key.substring(prefix.length);
22
+ rawAttrs[rawName] = attrs[key];
23
+ } else {
24
+ // Attribute without prefix (shouldn't normally happen, but be safe)
25
+ rawAttrs[key] = attrs[key];
26
+ }
27
+ }
28
+ return rawAttrs;
29
+ }
30
+
31
+ /**
32
+ *
33
+ * @param {array} node
34
+ * @param {any} options
35
+ * @param {Matcher} matcher - Path matcher instance
36
+ * @returns
37
+ */
38
+ export default function prettify(node, options, matcher, readonlyMatcher) {
39
+ return compress(node, options, matcher, readonlyMatcher);
40
+ }
41
+
42
+ /**
43
+ * @param {array} arr
44
+ * @param {object} options
45
+ * @param {Matcher} matcher - Path matcher instance
46
+ * @returns object
47
+ */
48
+ function compress(arr, options, matcher, readonlyMatcher) {
49
+ let text;
50
+ const compressedObj = {}; //This is intended to be a plain object
51
+ for (let i = 0; i < arr.length; i++) {
52
+ const tagObj = arr[i];
53
+ const property = propName(tagObj);
54
+
55
+ // Push current property to matcher WITH RAW ATTRIBUTES (no prefix)
56
+ if (property !== undefined && property !== options.textNodeName) {
57
+ const rawAttrs = stripAttributePrefix(
58
+ tagObj[":@"] || {},
59
+ options.attributeNamePrefix
60
+ );
61
+ matcher.push(property, rawAttrs);
62
+ }
63
+
64
+ if (property === options.textNodeName) {
65
+ if (text === undefined) text = tagObj[property];
66
+ else text += "" + tagObj[property];
67
+ } else if (property === undefined) {
68
+ continue;
69
+ } else if (tagObj[property]) {
70
+
71
+ let val = compress(tagObj[property], options, matcher, readonlyMatcher);
72
+ const isLeaf = isLeafTag(val, options);
73
+
74
+ if (Object.keys(val).length === 0 && options.alwaysCreateTextNode) {
75
+ val[options.textNodeName] = "";
76
+ }
77
+
78
+ if (tagObj[":@"]) {
79
+ assignAttributes(val, tagObj[":@"], readonlyMatcher, options);
80
+ } else if (Object.keys(val).length === 1 && val[options.textNodeName] !== undefined && !options.alwaysCreateTextNode) {
81
+ val = val[options.textNodeName];
82
+ } else if (Object.keys(val).length === 0) {
83
+ if (options.alwaysCreateTextNode) val[options.textNodeName] = "";
84
+ else val = "";
85
+ }
86
+
87
+ if (tagObj[METADATA_SYMBOL] !== undefined && typeof val === "object" && val !== null) {
88
+ val[METADATA_SYMBOL] = tagObj[METADATA_SYMBOL]; // copy over metadata
89
+ }
90
+
91
+
92
+ if (compressedObj[property] !== undefined && Object.prototype.hasOwnProperty.call(compressedObj, property)) {
93
+ if (!Array.isArray(compressedObj[property])) {
94
+ compressedObj[property] = [compressedObj[property]];
95
+ }
96
+ compressedObj[property].push(val);
97
+ } else {
98
+ //TODO: if a node is not an array, then check if it should be an array
99
+ //also determine if it is a leaf node
100
+
101
+ // Pass jPath string or readonlyMatcher based on options.jPath setting
102
+ const jPathOrMatcher = options.jPath ? readonlyMatcher.toString() : readonlyMatcher;
103
+ if (options.isArray(property, jPathOrMatcher, isLeaf)) {
104
+ compressedObj[property] = [val];
105
+ } else {
106
+ compressedObj[property] = val;
107
+ }
108
+ }
109
+
110
+ // Pop property from matcher after processing
111
+ if (property !== undefined && property !== options.textNodeName) {
112
+ matcher.pop();
113
+ }
114
+ }
115
+
116
+ }
117
+ // if(text && text.length > 0) compressedObj[options.textNodeName] = text;
118
+ if (typeof text === "string") {
119
+ if (text.length > 0) compressedObj[options.textNodeName] = text;
120
+ } else if (text !== undefined) compressedObj[options.textNodeName] = text;
121
+
122
+
123
+ return compressedObj;
124
+ }
125
+
126
+ function propName(obj) {
127
+ const keys = Object.keys(obj);
128
+ for (let i = 0; i < keys.length; i++) {
129
+ const key = keys[i];
130
+ if (key !== ":@") return key;
131
+ }
132
+ }
133
+
134
+ function assignAttributes(obj, attrMap, readonlyMatcher, options) {
135
+ if (attrMap) {
136
+ const keys = Object.keys(attrMap);
137
+ const len = keys.length; //don't make it inline
138
+ for (let i = 0; i < len; i++) {
139
+ const atrrName = keys[i]; // This is the PREFIXED name (e.g., "@_class")
140
+
141
+ // Strip prefix for matcher path (for isArray callback)
142
+ const rawAttrName = atrrName.startsWith(options.attributeNamePrefix)
143
+ ? atrrName.substring(options.attributeNamePrefix.length)
144
+ : atrrName;
145
+
146
+ // For attributes, we need to create a temporary path
147
+ // Pass jPath string or matcher based on options.jPath setting
148
+ const jPathOrMatcher = options.jPath
149
+ ? readonlyMatcher.toString() + "." + rawAttrName
150
+ : readonlyMatcher;
151
+
152
+ if (options.isArray(atrrName, jPathOrMatcher, true, true)) {
153
+ obj[atrrName] = [attrMap[atrrName]];
154
+ } else {
155
+ obj[atrrName] = attrMap[atrrName];
156
+ }
157
+ }
158
+ }
159
+ }
160
+
161
+ function isLeafTag(obj, options) {
162
+ const { textNodeName } = options;
163
+ const propCount = Object.keys(obj).length;
164
+
165
+ if (propCount === 0) {
166
+ return true;
167
+ }
168
+
169
+ if (
170
+ propCount === 1 &&
171
+ (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)
172
+ ) {
173
+ return true;
174
+ }
175
+
176
+ return false;
177
+ }
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ let METADATA_SYMBOL;
4
+
5
+ if (typeof Symbol !== "function") {
6
+ METADATA_SYMBOL = "@@xmlMetadata";
7
+ } else {
8
+ METADATA_SYMBOL = Symbol("XML Node Metadata");
9
+ }
10
+
11
+ export default class XmlNode {
12
+ constructor(tagname) {
13
+ this.tagname = tagname;
14
+ this.child = []; //nested tags, text, cdata, comments in order
15
+ this[":@"] = Object.create(null); //attributes map
16
+ }
17
+ add(key, val) {
18
+ // this.child.push( {name : key, val: val, isCdata: isCdata });
19
+ if (key === "__proto__") key = "#__proto__";
20
+ this.child.push({ [key]: val });
21
+ }
22
+ addChild(node, startIndex) {
23
+ if (node.tagname === "__proto__") node.tagname = "#__proto__";
24
+ if (node[":@"] && Object.keys(node[":@"]).length > 0) {
25
+ this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] });
26
+ } else {
27
+ this.child.push({ [node.tagname]: node.child });
28
+ }
29
+ // if requested, add the startIndex
30
+ this.addStartIndex(startIndex);
31
+ }
32
+
33
+ addStartIndex(startIndex) {
34
+ if (startIndex !== undefined) {
35
+ // Note: for now we just overwrite the metadata. If we had more complex metadata,
36
+ // we might need to do an object append here: metadata = { ...metadata, startIndex }
37
+ this.child[this.child.length - 1][METADATA_SYMBOL] = { startIndex };
38
+ }
39
+ }
40
+
41
+ addEndIndex(endIndex) {
42
+ const lastChild = this.child[this.child.length - 1];
43
+ // endIndex is write-once: when updateTag drops a node, the last child is a
44
+ // previously completed sibling whose endIndex must not be overwritten
45
+ if (lastChild !== undefined && lastChild[METADATA_SYMBOL] !== undefined
46
+ && lastChild[METADATA_SYMBOL].endIndex === undefined) {
47
+ lastChild[METADATA_SYMBOL].endIndex = endIndex;
48
+ }
49
+ }
50
+ /** symbol used for metadata */
51
+ static getMetaDataSymbol() {
52
+ return METADATA_SYMBOL;
53
+ }
54
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-code-intelligence",
3
- "version": "12.0.0",
3
+ "version": "13.0.0",
4
4
  "description": "LSP and AST navigation, search, diagnostics, and refactoring",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -40,19 +40,21 @@
40
40
  "gradle-helper/README.md"
41
41
  ],
42
42
  "dependencies": {
43
- "ignore": "^7.0.12",
44
- "smol-toml": "^1.9.1",
45
- "yaml": "^2.9.0",
46
- "@mrclrchtr/supi-code-runtime": "12.0.0",
47
- "@mrclrchtr/supi-lsp": "12.0.0",
48
- "@mrclrchtr/supi-tree-sitter": "12.0.0",
49
- "@mrclrchtr/supi-core": "12.0.0"
43
+ "fast-xml-parser": "5.12.0",
44
+ "ignore": "7.0.14",
45
+ "smol-toml": "1.9.1",
46
+ "yaml": "2.9.1",
47
+ "@mrclrchtr/supi-code-runtime": "13.0.0",
48
+ "@mrclrchtr/supi-lsp": "13.0.0",
49
+ "@mrclrchtr/supi-tree-sitter": "13.0.0",
50
+ "@mrclrchtr/supi-core": "13.0.0"
50
51
  },
51
52
  "bundledDependencies": [
52
53
  "@mrclrchtr/supi-code-runtime",
53
54
  "@mrclrchtr/supi-core",
54
55
  "@mrclrchtr/supi-lsp",
55
56
  "@mrclrchtr/supi-tree-sitter",
57
+ "fast-xml-parser",
56
58
  "ignore",
57
59
  "smol-toml",
58
60
  "yaml"