@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,239 @@
1
+ // EntityEncoder.js
2
+ import { buildTries } from './entityTries.js';
3
+ // NOTE: no static import of ALL_ENTITIES / entities.js here — that import
4
+ // was the actual tree-shaking leak (see constructor comment below).
5
+
6
+ // Replacement strings indexed by char code — direct array access, no hashing
7
+ const XML_UNSAFE_REPLACEMENT = new Array(128);
8
+ XML_UNSAFE_REPLACEMENT[38] = '&'; // &
9
+ XML_UNSAFE_REPLACEMENT[60] = '&lt;'; // <
10
+ XML_UNSAFE_REPLACEMENT[62] = '&gt;'; // >
11
+ XML_UNSAFE_REPLACEMENT[34] = '&quot;'; // "
12
+ XML_UNSAFE_REPLACEMENT[39] = '&apos;'; // '
13
+
14
+ // Typed bitmask for O(1) "is this ASCII code XML-unsafe?" check
15
+ const IS_XML_UNSAFE = new Uint8Array(128);
16
+ IS_XML_UNSAFE[38] = 1;
17
+ IS_XML_UNSAFE[60] = 1;
18
+ IS_XML_UNSAFE[62] = 1;
19
+ IS_XML_UNSAFE[34] = 1;
20
+ IS_XML_UNSAFE[39] = 1;
21
+
22
+ // Fast pre-scan: bail out immediately if nothing needs encoding
23
+ const NEEDS_PROCESSING = /[&<>"'\u0080-\uFFFF]/;
24
+
25
+ export default class EntityEncoder {
26
+ constructor(options = {}) {
27
+ this.encodeXmlSafe = options.encodeXmlSafe !== false;
28
+ this.encodeAllNamed = options.encodeAllNamed !== false;
29
+ this.maxReplacements = options.maxReplacements || 0;
30
+ this.replacementsCount = 0;
31
+
32
+ // Tries are only built when named-entity encoding is actually requested,
33
+ // and only from what the caller explicitly hands in. There is no
34
+ // built-in default entity set imported here — that static import was
35
+ // exactly what pinned the entire ALL_ENTITIES data (all categories) into
36
+ // every consumer's bundle regardless of what they actually used. A `||`
37
+ // fallback to a statically-imported default does NOT tree-shake: the
38
+ // import is still "used" from the bundler's point of view even if the
39
+ // runtime branch never executes.
40
+ //
41
+ // BREAKING CHANGE from earlier versions: `new EntityEncoder()` with no
42
+ // `namedEntities` and `encodeAllNamed !== false` now throws instead of
43
+ // silently encoding the full built-in set. Callers who want the old
44
+ // "encode everything" behavior must opt in explicitly:
45
+ // import { ALL_ENTITIES } from '@nodable/entities';
46
+ // new EntityEncoder({ namedEntities: ALL_ENTITIES });
47
+ if (this.encodeAllNamed) {
48
+ if (!options.namedEntities) {
49
+ throw new Error(
50
+ '[EntityEncoder] encodeAllNamed is true but no `namedEntities` was ' +
51
+ 'provided. Pass a specific set (e.g. { ...COMMON_HTML, ...CURRENCY }) ' +
52
+ 'or the full built-in set via `namedEntities: ALL_ENTITIES` imported ' +
53
+ 'from \'@nodable/entities\'. This is required so bundlers can ' +
54
+ 'tree-shake unused entity categories out of your build; set ' +
55
+ '`encodeAllNamed: false` if you don\'t need named-entity encoding at all.'
56
+ );
57
+ }
58
+ const tries = buildTries(options.namedEntities);
59
+ this.trie1 = tries.trie1;
60
+ this.trie2 = tries.trie2;
61
+ this.trie3 = tries.trie3;
62
+ } else {
63
+ this.trie1 = null;
64
+ this.trie2 = null;
65
+ this.trie3 = null;
66
+ }
67
+ }
68
+
69
+ encode(str) {
70
+ if (typeof str !== 'string' || str.length === 0) return str;
71
+ if (!NEEDS_PROCESSING.test(str)) return str;
72
+
73
+ const maxRep = this.maxReplacements;
74
+ if (maxRep > 0 && this.replacementsCount >= maxRep) return str;
75
+
76
+ // Hoist to locals — avoids `this` property lookup inside the hot loop
77
+ const encodeXmlSafe = this.encodeXmlSafe;
78
+ const encodeAllNamed = this.encodeAllNamed;
79
+ const trie1 = this.trie1;
80
+ const trie2 = this.trie2;
81
+ const trie3 = this.trie3;
82
+
83
+ const len = str.length;
84
+
85
+ let result = '';
86
+ let last = 0;
87
+ let i = 0;
88
+ let limitReached = false;
89
+
90
+ // ── Main loop: runs to len-2 so trie3 never needs a bounds check ────────
91
+ // The last 2 characters are handled by the tail block below.
92
+ const mainEnd = len - 2; // i <= mainEnd guarantees i+1 and i+2 are valid
93
+
94
+ while (i <= mainEnd && !limitReached) {
95
+ const c0 = str.charCodeAt(i);
96
+
97
+ // ── ASCII branch ───────────────────────────────────────────────────
98
+ if (c0 < 128) {
99
+ if (encodeXmlSafe && IS_XML_UNSAFE[c0] === 1) {
100
+ result += str.substring(last, i) + XML_UNSAFE_REPLACEMENT[c0];
101
+ last = ++i;
102
+ if (maxRep > 0) {
103
+ this.replacementsCount++;
104
+ if (this.replacementsCount >= maxRep) {
105
+ limitReached = true;
106
+ break;
107
+ }
108
+ }
109
+ } else {
110
+ // Bulk-skip: advance to the next interesting position without
111
+ // touching the outer loop overhead on every safe character
112
+ i++;
113
+ while (i <= mainEnd && !limitReached) {
114
+ const c = str.charCodeAt(i);
115
+ if (c >= 128 || (encodeXmlSafe && IS_XML_UNSAFE[c] === 1)) break;
116
+ i++;
117
+ }
118
+ }
119
+ continue;
120
+ }
121
+
122
+ // ── Non-ASCII: integer-keyed trie lookup ───────────────────────────
123
+ // No bounds checks needed for c1/c2 because i <= mainEnd guarantees
124
+ // i+1 and i+2 are both within the string.
125
+ let matchedEntity = null;
126
+ let advance = 1;
127
+
128
+ if (encodeAllNamed) {
129
+ // Try 3-char match first (longest wins)
130
+ const mid3 = trie3.get(c0);
131
+ if (mid3 !== undefined) {
132
+ const c1 = str.charCodeAt(i + 1);
133
+ const inner3 = mid3.get(c1);
134
+ if (inner3 !== undefined) {
135
+ const c2 = str.charCodeAt(i + 2);
136
+ const candidate = inner3.get(c2);
137
+ if (candidate !== undefined) { matchedEntity = candidate; advance = 3; }
138
+ }
139
+ }
140
+
141
+ // Try 2-char match
142
+ if (matchedEntity === null) {
143
+ const inner2 = trie2.get(c0);
144
+ if (inner2 !== undefined) {
145
+ const c1 = str.charCodeAt(i + 1);
146
+ const candidate = inner2.get(c1);
147
+ if (candidate !== undefined) { matchedEntity = candidate; advance = 2; }
148
+ }
149
+ }
150
+
151
+ // Try 1-char match
152
+ if (matchedEntity === null) {
153
+ const candidate = trie1.get(c0);
154
+ if (candidate !== undefined) { matchedEntity = candidate; }
155
+ }
156
+ }
157
+
158
+ if (matchedEntity !== null) {
159
+ result += str.substring(last, i) + matchedEntity;
160
+ i += advance;
161
+ last = i;
162
+ if (maxRep > 0) {
163
+ this.replacementsCount++;
164
+ if (this.replacementsCount >= maxRep) {
165
+ limitReached = true;
166
+ break;
167
+ }
168
+ }
169
+ } else {
170
+ i++;
171
+ }
172
+ }
173
+
174
+ // ── Tail: handle the last 1-2 characters (no 3-char match possible) ────
175
+ while (i < len && !limitReached) {
176
+ const c0 = str.charCodeAt(i);
177
+
178
+ if (c0 < 128) {
179
+ if (encodeXmlSafe && IS_XML_UNSAFE[c0] === 1) {
180
+ result += str.substring(last, i) + XML_UNSAFE_REPLACEMENT[c0];
181
+ last = ++i;
182
+ if (maxRep > 0) {
183
+ this.replacementsCount++;
184
+ if (this.replacementsCount >= maxRep) {
185
+ limitReached = true;
186
+ break;
187
+ }
188
+ }
189
+ } else {
190
+ i++;
191
+ }
192
+ continue;
193
+ }
194
+
195
+ // Non-ASCII tail — only 2-char and 1-char matches are possible here
196
+ let matchedEntity = null;
197
+ let advance = 1;
198
+
199
+ if (encodeAllNamed) {
200
+ if (i + 1 < len) {
201
+ const inner2 = trie2.get(c0);
202
+ if (inner2 !== undefined) {
203
+ const c1 = str.charCodeAt(i + 1);
204
+ const candidate = inner2.get(c1);
205
+ if (candidate !== undefined) { matchedEntity = candidate; advance = 2; }
206
+ }
207
+ }
208
+
209
+ if (matchedEntity === null) {
210
+ const candidate = trie1.get(c0);
211
+ if (candidate !== undefined) { matchedEntity = candidate; }
212
+ }
213
+ }
214
+
215
+ if (matchedEntity !== null) {
216
+ result += str.substring(last, i) + matchedEntity;
217
+ i += advance;
218
+ last = i;
219
+ if (maxRep > 0) {
220
+ this.replacementsCount++;
221
+ if (this.replacementsCount >= maxRep) {
222
+ limitReached = true;
223
+ break;
224
+ }
225
+ }
226
+ } else {
227
+ i++;
228
+ }
229
+ }
230
+
231
+ // ── Flush any remaining literal suffix ────────────────────────────────
232
+ if (last < len) result += str.substring(last);
233
+ return result;
234
+ }
235
+
236
+ reset() {
237
+ this.replacementsCount = 0;
238
+ }
239
+ }
@@ -0,0 +1,53 @@
1
+ // all-entities.js
2
+ //
3
+ // ALL_ENTITIES lives in its OWN module, deliberately separate from
4
+ // entities.js. An object spread like `{ ...GREEK, ...CYRILLIC, ... }` is
5
+ // treated conservatively by bundlers (esbuild, Rollup, webpack) as a
6
+ // potential side effect — spreading can invoke getters or Symbol.iterator —
7
+ // so a module containing such a spread cannot be safely tree-shaken. If that
8
+ // spread lived inside entities.js alongside the individual category exports,
9
+ // its mere presence would pin every category into any bundle that imports
10
+ // even one of them, regardless of whether ALL_ENTITIES itself is ever used.
11
+ //
12
+ // Keeping it isolated here means:
13
+ // - `import { COMMON_HTML } from './entities.js'` tree-shakes cleanly —
14
+ // no other category is dragged in.
15
+ // - Only consumers who explicitly `import { ALL_ENTITIES } from
16
+ // './all-entities.js'` (re-exported from index.js for convenience) pay
17
+ // for the full merged set.
18
+
19
+ import {
20
+ BASIC_LATIN,
21
+ LATIN_ACCENTS,
22
+ LATIN_EXTENDED,
23
+ GREEK,
24
+ CYRILLIC,
25
+ MATH,
26
+ MATH_ADVANCED,
27
+ ARROWS,
28
+ SHAPES,
29
+ PUNCTUATION,
30
+ CURRENCY,
31
+ FRACTIONS,
32
+ MISC_SYMBOLS,
33
+ } from './entities.js';
34
+
35
+ /**
36
+ * All entities combined (if you need everything).
37
+ * @type {Record<string, string>}
38
+ */
39
+ export const ALL_ENTITIES = {
40
+ ...BASIC_LATIN,
41
+ ...LATIN_ACCENTS,
42
+ ...LATIN_EXTENDED,
43
+ ...GREEK,
44
+ ...CYRILLIC,
45
+ ...MATH,
46
+ ...MATH_ADVANCED,
47
+ ...ARROWS,
48
+ ...SHAPES,
49
+ ...PUNCTUATION,
50
+ ...CURRENCY,
51
+ ...FRACTIONS,
52
+ ...MISC_SYMBOLS,
53
+ };