@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,426 @@
1
+ import { qName as isName } from 'xml-naming';
2
+
3
+ export default class DocTypeReader {
4
+ constructor(options, xmlVersion) {
5
+ this.suppressValidationErr = !options;
6
+ this.options = options;
7
+ this.xmlVersion = xmlVersion || 1.0;
8
+ }
9
+
10
+ setXmlVersion(xmlVersion = 1.0) {
11
+ this.xmlVersion = xmlVersion;
12
+ }
13
+ readDocType(xmlData, i) {
14
+ const entities = Object.create(null);
15
+ let entityCount = 0;
16
+
17
+ if (xmlData[i + 3] === 'O' &&
18
+ xmlData[i + 4] === 'C' &&
19
+ xmlData[i + 5] === 'T' &&
20
+ xmlData[i + 6] === 'Y' &&
21
+ xmlData[i + 7] === 'P' &&
22
+ xmlData[i + 8] === 'E') {
23
+ i = i + 9;
24
+ let angleBracketsCount = 1;
25
+ let hasBody = false, comment = false;
26
+ let quoteChar = null; // tracks an open SYSTEM/PUBLIC literal before the '[' body
27
+ let exp = "";
28
+ for (; i < xmlData.length; i++) {
29
+ // Inside a quoted external-identifier literal — XML allows '<'
30
+ // and '>' as plain data here, so they must not be interpreted
31
+ // as DOCTYPE structure until the matching quote closes.
32
+ if (quoteChar !== null) {
33
+ if (xmlData[i] === quoteChar) quoteChar = null;
34
+ exp += xmlData[i];
35
+ continue;
36
+ }
37
+ if (!hasBody && !comment && (xmlData[i] === '"' || xmlData[i] === "'")) {
38
+ quoteChar = xmlData[i];
39
+ exp += xmlData[i];
40
+ continue;
41
+ }
42
+
43
+ if (xmlData[i] === '<' && !comment) { //Determine the tag type
44
+ if (hasBody && hasSeq(xmlData, "!ENTITY", i)) {
45
+ i += 7;
46
+ let entityName, val;
47
+ [entityName, val, i] = this.readEntityExp(xmlData, i + 1, this.suppressValidationErr);
48
+ if (val.indexOf("&") === -1) { //Parameter entities are not supported
49
+ if (this.options.enabled !== false &&
50
+ this.options.maxEntityCount != null &&
51
+ entityCount >= this.options.maxEntityCount) {
52
+ throw new Error(
53
+ `Entity count (${entityCount + 1}) exceeds maximum allowed (${this.options.maxEntityCount})`
54
+ );
55
+ }
56
+ //const escaped = entityName.replace(/[.\-+*:]/g, '\\.');
57
+ //const escaped = entityName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
58
+ entities[entityName] = val;
59
+ entityCount++;
60
+ }
61
+ }
62
+ else if (hasBody && hasSeq(xmlData, "!ELEMENT", i)) {
63
+ i += 8;//Not supported
64
+ const { index } = this.readElementExp(xmlData, i + 1);
65
+ i = index;
66
+ } else if (hasBody && hasSeq(xmlData, "!ATTLIST", i)) {
67
+ i += 8;//Not supported
68
+ // const {index} = this.readAttlistExp(xmlData,i+1);
69
+ // i = index;
70
+ } else if (hasBody && hasSeq(xmlData, "!NOTATION", i)) {
71
+ i += 9;//Not supported
72
+ const { index } = this.readNotationExp(xmlData, i + 1, this.suppressValidationErr);
73
+ i = index;
74
+ } else if (hasSeq(xmlData, "!--", i)) comment = true;
75
+ else throw new Error(`Invalid DOCTYPE`);
76
+
77
+ angleBracketsCount++;
78
+ exp = "";
79
+ } else if (xmlData[i] === '>') { //Read tag content
80
+ if (comment) {
81
+ if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") {
82
+ comment = false;
83
+ angleBracketsCount--;
84
+ }
85
+ } else {
86
+ angleBracketsCount--;
87
+ }
88
+ if (angleBracketsCount === 0) {
89
+ break;
90
+ }
91
+ } else if (xmlData[i] === '[') {
92
+ hasBody = true;
93
+ } else {
94
+ exp += xmlData[i];
95
+ }
96
+ }
97
+ if (quoteChar !== null || angleBracketsCount !== 0) {
98
+ throw new Error(`Unclosed DOCTYPE`);
99
+ }
100
+ } else {
101
+ throw new Error(`Invalid Tag instead of DOCTYPE`);
102
+ }
103
+ return { entities, i };
104
+ }
105
+ readEntityExp(xmlData, i) {
106
+ //External entities are not supported
107
+ // <!ENTITY ext SYSTEM "http://normal-website.com" >
108
+
109
+ //Parameter entities are not supported
110
+ // <!ENTITY entityname "&anotherElement;">
111
+
112
+ //Internal entities are supported
113
+ // <!ENTITY entityname "replacement text">
114
+
115
+ // Skip leading whitespace after <!ENTITY
116
+ i = skipWhitespace(xmlData, i);
117
+
118
+ // Read entity name
119
+ const startIndex = i;
120
+ while (i < xmlData.length && !/\s/.test(xmlData[i]) && xmlData[i] !== '"' && xmlData[i] !== "'") {
121
+ i++;
122
+ }
123
+ let entityName = xmlData.substring(startIndex, i);
124
+
125
+ validateEntityName(entityName, { xmlVersion: this.xmlVersion });
126
+
127
+ // Skip whitespace after entity name
128
+ i = skipWhitespace(xmlData, i);
129
+
130
+ // Check for unsupported constructs (external entities or parameter entities)
131
+ if (!this.suppressValidationErr) {
132
+ if (xmlData.substring(i, i + 6).toUpperCase() === "SYSTEM") {
133
+ throw new Error("External entities are not supported");
134
+ } else if (xmlData[i] === "%") {
135
+ throw new Error("Parameter entities are not supported");
136
+ }
137
+ }
138
+
139
+ // Read entity value (internal entity)
140
+ let entityValue = "";
141
+ [i, entityValue] = this.readIdentifierVal(xmlData, i, "entity");
142
+
143
+ // Validate entity size
144
+ if (this.options.enabled !== false &&
145
+ this.options.maxEntitySize != null &&
146
+ entityValue.length > this.options.maxEntitySize) {
147
+ throw new Error(
148
+ `Entity "${entityName}" size (${entityValue.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`
149
+ );
150
+ }
151
+
152
+ i--;
153
+ return [entityName, entityValue, i];
154
+ }
155
+
156
+ readNotationExp(xmlData, i) {
157
+ // Skip leading whitespace after <!NOTATION
158
+ i = skipWhitespace(xmlData, i);
159
+
160
+ // Read notation name
161
+
162
+ const startIndex = i;
163
+ while (i < xmlData.length && !/\s/.test(xmlData[i])) {
164
+ i++;
165
+ }
166
+ let notationName = xmlData.substring(startIndex, i);
167
+
168
+ !this.suppressValidationErr && validateEntityName(notationName, { xmlVersion: this.xmlVersion });
169
+
170
+ // Skip whitespace after notation name
171
+ i = skipWhitespace(xmlData, i);
172
+
173
+ // Check identifier type (SYSTEM or PUBLIC)
174
+ const identifierType = xmlData.substring(i, i + 6).toUpperCase();
175
+ if (!this.suppressValidationErr && identifierType !== "SYSTEM" && identifierType !== "PUBLIC") {
176
+ throw new Error(`Expected SYSTEM or PUBLIC, found "${identifierType}"`);
177
+ }
178
+ i += identifierType.length;
179
+
180
+ // Skip whitespace after identifier type
181
+ i = skipWhitespace(xmlData, i);
182
+
183
+ // Read public identifier (if PUBLIC)
184
+ let publicIdentifier = null;
185
+ let systemIdentifier = null;
186
+
187
+ if (identifierType === "PUBLIC") {
188
+ [i, publicIdentifier] = this.readIdentifierVal(xmlData, i, "publicIdentifier");
189
+
190
+ // Skip whitespace after public identifier
191
+ i = skipWhitespace(xmlData, i);
192
+
193
+ // Optionally read system identifier
194
+ if (xmlData[i] === '"' || xmlData[i] === "'") {
195
+ [i, systemIdentifier] = this.readIdentifierVal(xmlData, i, "systemIdentifier");
196
+ }
197
+ } else if (identifierType === "SYSTEM") {
198
+ // Read system identifier (mandatory for SYSTEM)
199
+ [i, systemIdentifier] = this.readIdentifierVal(xmlData, i, "systemIdentifier");
200
+
201
+ if (!this.suppressValidationErr && !systemIdentifier) {
202
+ throw new Error("Missing mandatory system identifier for SYSTEM notation");
203
+ }
204
+ }
205
+
206
+ return { notationName, publicIdentifier, systemIdentifier, index: --i };
207
+ }
208
+
209
+ readIdentifierVal(xmlData, i, type) {
210
+ let identifierVal = "";
211
+ const startChar = xmlData[i];
212
+ if (startChar !== '"' && startChar !== "'") {
213
+ throw new Error(`Expected quoted string, found "${startChar}"`);
214
+ }
215
+ i++;
216
+
217
+ const startIndex = i;
218
+ while (i < xmlData.length && xmlData[i] !== startChar) {
219
+ i++;
220
+ }
221
+ identifierVal = xmlData.substring(startIndex, i);
222
+
223
+ if (xmlData[i] !== startChar) {
224
+ throw new Error(`Unterminated ${type} value`);
225
+ }
226
+ i++;
227
+ return [i, identifierVal];
228
+ }
229
+
230
+ readElementExp(xmlData, i) {
231
+ // <!ELEMENT br EMPTY>
232
+ // <!ELEMENT div ANY>
233
+ // <!ELEMENT title (#PCDATA)>
234
+ // <!ELEMENT book (title, author+)>
235
+ // <!ELEMENT name (content-model)>
236
+
237
+ // Skip leading whitespace after <!ELEMENT
238
+ i = skipWhitespace(xmlData, i);
239
+
240
+ // Read element name
241
+ const startIndex = i;
242
+ while (i < xmlData.length && !/\s/.test(xmlData[i])) {
243
+ i++;
244
+ }
245
+ let elementName = xmlData.substring(startIndex, i);
246
+
247
+ // Validate element name
248
+ if (!this.suppressValidationErr && !isName(elementName, { xmlVersion: this.xmlVersion })) {
249
+ throw new Error(`Invalid element name: "${elementName}"`);
250
+ }
251
+
252
+ // Skip whitespace after element name
253
+ i = skipWhitespace(xmlData, i);
254
+ let contentModel = "";
255
+ // Expect '(' to start content model
256
+ if (xmlData[i] === "E" && hasSeq(xmlData, "MPTY", i)) i += 4;
257
+ else if (xmlData[i] === "A" && hasSeq(xmlData, "NY", i)) i += 2;
258
+ else if (xmlData[i] === "(") {
259
+ i++; // Move past '('
260
+
261
+ // Read content model
262
+ const startIndex = i;
263
+ while (i < xmlData.length && xmlData[i] !== ")") {
264
+ i++;
265
+ }
266
+ contentModel = xmlData.substring(startIndex, i);
267
+
268
+ if (xmlData[i] !== ")") {
269
+ throw new Error("Unterminated content model");
270
+ }
271
+
272
+ } else if (!this.suppressValidationErr) {
273
+ throw new Error(`Invalid Element Expression, found "${xmlData[i]}"`);
274
+ }
275
+
276
+ return {
277
+ elementName,
278
+ contentModel: contentModel.trim(),
279
+ index: i
280
+ };
281
+ }
282
+
283
+ readAttlistExp(xmlData, i) {
284
+ // Skip leading whitespace after <!ATTLIST
285
+ i = skipWhitespace(xmlData, i);
286
+
287
+ // Read element name
288
+ let startIndex = i;
289
+ while (i < xmlData.length && !/\s/.test(xmlData[i])) {
290
+ i++;
291
+ }
292
+ let elementName = xmlData.substring(startIndex, i);
293
+
294
+ // Validate element name
295
+ validateEntityName(elementName, { xmlVersion: this.xmlVersion })
296
+
297
+ // Skip whitespace after element name
298
+ i = skipWhitespace(xmlData, i);
299
+
300
+ // Read attribute name
301
+ startIndex = i;
302
+ while (i < xmlData.length && !/\s/.test(xmlData[i])) {
303
+ i++;
304
+ }
305
+ let attributeName = xmlData.substring(startIndex, i);
306
+
307
+ // Validate attribute name
308
+ if (!validateEntityName(attributeName, { xmlVersion: this.xmlVersion })) {
309
+ throw new Error(`Invalid attribute name: "${attributeName}"`);
310
+ }
311
+
312
+ // Skip whitespace after attribute name
313
+ i = skipWhitespace(xmlData, i);
314
+
315
+ // Read attribute type
316
+ let attributeType = "";
317
+ if (xmlData.substring(i, i + 8).toUpperCase() === "NOTATION") {
318
+ attributeType = "NOTATION";
319
+ i += 8; // Move past "NOTATION"
320
+
321
+ // Skip whitespace after "NOTATION"
322
+ i = skipWhitespace(xmlData, i);
323
+
324
+ // Expect '(' to start the list of notations
325
+ if (xmlData[i] !== "(") {
326
+ throw new Error(`Expected '(', found "${xmlData[i]}"`);
327
+ }
328
+ i++; // Move past '('
329
+
330
+ // Read the list of allowed notations
331
+ let allowedNotations = [];
332
+ while (i < xmlData.length && xmlData[i] !== ")") {
333
+
334
+
335
+ const startIndex = i;
336
+ while (i < xmlData.length && xmlData[i] !== "|" && xmlData[i] !== ")") {
337
+ i++;
338
+ }
339
+ let notation = xmlData.substring(startIndex, i);
340
+
341
+ // Validate notation name
342
+ notation = notation.trim();
343
+ if (!validateEntityName(notation, { xmlVersion: this.xmlVersion })) {
344
+ throw new Error(`Invalid notation name: "${notation}"`);
345
+ }
346
+
347
+ allowedNotations.push(notation);
348
+
349
+ // Skip '|' separator or exit loop
350
+ if (xmlData[i] === "|") {
351
+ i++; // Move past '|'
352
+ i = skipWhitespace(xmlData, i); // Skip optional whitespace after '|'
353
+ }
354
+ }
355
+
356
+ if (xmlData[i] !== ")") {
357
+ throw new Error("Unterminated list of notations");
358
+ }
359
+ i++; // Move past ')'
360
+
361
+ // Store the allowed notations as part of the attribute type
362
+ attributeType += " (" + allowedNotations.join("|") + ")";
363
+ } else {
364
+ // Handle simple types (e.g., CDATA, ID, IDREF, etc.)
365
+ const startIndex = i;
366
+ while (i < xmlData.length && !/\s/.test(xmlData[i])) {
367
+ i++;
368
+ }
369
+ attributeType += xmlData.substring(startIndex, i);
370
+
371
+ // Validate simple attribute type
372
+ const validTypes = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"];
373
+ if (!this.suppressValidationErr && !validTypes.includes(attributeType.toUpperCase())) {
374
+ throw new Error(`Invalid attribute type: "${attributeType}"`);
375
+ }
376
+ }
377
+
378
+ // Skip whitespace after attribute type
379
+ i = skipWhitespace(xmlData, i);
380
+
381
+ // Read default value
382
+ let defaultValue = "";
383
+ if (xmlData.substring(i, i + 8).toUpperCase() === "#REQUIRED") {
384
+ defaultValue = "#REQUIRED";
385
+ i += 8;
386
+ } else if (xmlData.substring(i, i + 7).toUpperCase() === "#IMPLIED") {
387
+ defaultValue = "#IMPLIED";
388
+ i += 7;
389
+ } else {
390
+ [i, defaultValue] = this.readIdentifierVal(xmlData, i, "ATTLIST");
391
+ }
392
+
393
+ return {
394
+ elementName,
395
+ attributeName,
396
+ attributeType,
397
+ defaultValue,
398
+ index: i
399
+ }
400
+ }
401
+ }
402
+
403
+
404
+
405
+ const skipWhitespace = (data, index) => {
406
+ while (index < data.length && /\s/.test(data[index])) {
407
+ index++;
408
+ }
409
+ return index;
410
+ };
411
+
412
+
413
+
414
+ function hasSeq(data, seq, i) {
415
+ for (let j = 0; j < seq.length; j++) {
416
+ if (seq[j] !== data[i + j + 1]) return false;
417
+ }
418
+ return true;
419
+ }
420
+
421
+ function validateEntityName(name, xmlVersion) {
422
+ if (isName(name, { xmlVersion: xmlVersion }))
423
+ return name;
424
+ else
425
+ throw new Error(`Invalid entity name ${name}`);
426
+ }
@@ -0,0 +1,164 @@
1
+ import { DANGEROUS_PROPERTY_NAMES, criticalProperties } from "../util.js";
2
+ import { COMMON_HTML, CURRENCY } from '@nodable/entities';
3
+
4
+ const defaultOnDangerousProperty = (name) => {
5
+ if (DANGEROUS_PROPERTY_NAMES.includes(name)) {
6
+ return "__" + name;
7
+ }
8
+ return name;
9
+ };
10
+
11
+
12
+ export const defaultOptions = {
13
+ preserveOrder: false,
14
+ attributeNamePrefix: '@_',
15
+ attributesGroupName: false,
16
+ textNodeName: '#text',
17
+ ignoreAttributes: true,
18
+ removeNSPrefix: false, // remove NS from tag name or attribute name if true
19
+ allowBooleanAttributes: false, //a tag can have attributes without any value
20
+ //ignoreRootElement : false,
21
+ parseTagValue: true,
22
+ parseAttributeValue: false,
23
+ trimValues: true, //Trim string values of tag and attributes
24
+ cdataPropName: false,
25
+ numberParseOptions: {
26
+ hex: true,
27
+ leadingZeros: true,
28
+ eNotation: true,
29
+ unicode: false
30
+ },
31
+ tagValueProcessor: function (tagName, val) {
32
+ return val;
33
+ },
34
+ attributeValueProcessor: function (attrName, val) {
35
+ return val;
36
+ },
37
+ stopNodes: [], //nested tags will not be parsed even for errors
38
+ alwaysCreateTextNode: false,
39
+ isArray: () => false,
40
+ commentPropName: false,
41
+ unpairedTags: [],
42
+ processEntities: true,
43
+ htmlEntities: false,
44
+ entityDecoder: null,
45
+ ignoreDeclaration: false,
46
+ ignorePiTags: false,
47
+ transformTagName: false,
48
+ transformAttributeName: false,
49
+ updateTag: function (tagName, jPath, attrs) {
50
+ return tagName
51
+ },
52
+ // skipEmptyListItem: false
53
+ captureMetaData: false,
54
+ maxNestedTags: 100,
55
+ strictReservedNames: true,
56
+ jPath: true, // if true, pass jPath string to callbacks; if false, pass matcher instance
57
+ onDangerousProperty: defaultOnDangerousProperty
58
+ };
59
+
60
+
61
+ /**
62
+ * Validates that a property name is safe to use
63
+ * @param {string} propertyName - The property name to validate
64
+ * @param {string} optionName - The option field name (for error message)
65
+ * @throws {Error} If property name is dangerous
66
+ */
67
+ function validatePropertyName(propertyName, optionName) {
68
+ if (typeof propertyName !== 'string') {
69
+ return; // Only validate string property names
70
+ }
71
+
72
+ const normalized = propertyName.toLowerCase();
73
+ if (DANGEROUS_PROPERTY_NAMES.some(dangerous => normalized === dangerous.toLowerCase())) {
74
+ throw new Error(
75
+ `[SECURITY] Invalid ${optionName}: "${propertyName}" is a reserved JavaScript keyword that could cause prototype pollution`
76
+ );
77
+ }
78
+
79
+ if (criticalProperties.some(dangerous => normalized === dangerous.toLowerCase())) {
80
+ throw new Error(
81
+ `[SECURITY] Invalid ${optionName}: "${propertyName}" is a reserved JavaScript keyword that could cause prototype pollution`
82
+ );
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Normalizes processEntities option for backward compatibility
88
+ * @param {boolean|object} value
89
+ * @returns {object} Always returns normalized object
90
+ */
91
+ function normalizeProcessEntities(value, htmlEntities) {
92
+ // Boolean backward compatibility
93
+ if (typeof value === 'boolean') {
94
+ return {
95
+ enabled: value, // true or false
96
+ maxEntitySize: 10000,
97
+ maxExpansionDepth: 10000,
98
+ maxTotalExpansions: Infinity,
99
+ maxExpandedLength: 100000,
100
+ maxEntityCount: 1000,
101
+ allowedTags: null,
102
+ tagFilter: null,
103
+ appliesTo: "all",
104
+ };
105
+ }
106
+
107
+ // Object config - merge with defaults
108
+ if (typeof value === 'object' && value !== null) {
109
+ return {
110
+ enabled: value.enabled !== false,
111
+ maxEntitySize: Math.max(1, value.maxEntitySize ?? 10000),
112
+ maxExpansionDepth: Math.max(1, value.maxExpansionDepth ?? 10000),
113
+ maxTotalExpansions: Math.max(1, value.maxTotalExpansions ?? Infinity),
114
+ maxExpandedLength: Math.max(1, value.maxExpandedLength ?? 100000),
115
+ maxEntityCount: Math.max(1, value.maxEntityCount ?? 1000),
116
+ allowedTags: value.allowedTags ?? null,
117
+ tagFilter: value.tagFilter ?? null,
118
+ appliesTo: value.appliesTo ?? "all",
119
+ };
120
+ }
121
+
122
+ // Default to enabled with limits
123
+ return normalizeProcessEntities(true);
124
+ }
125
+
126
+ export const buildOptions = function (options) {
127
+ const built = Object.assign({}, defaultOptions, options);
128
+
129
+ // Validate property names to prevent prototype pollution
130
+ const propertyNameOptions = [
131
+ { value: built.attributeNamePrefix, name: 'attributeNamePrefix' },
132
+ { value: built.attributesGroupName, name: 'attributesGroupName' },
133
+ { value: built.textNodeName, name: 'textNodeName' },
134
+ { value: built.cdataPropName, name: 'cdataPropName' },
135
+ { value: built.commentPropName, name: 'commentPropName' }
136
+ ];
137
+
138
+ for (const { value, name } of propertyNameOptions) {
139
+ if (value) {
140
+ validatePropertyName(value, name);
141
+ }
142
+ }
143
+
144
+ if (built.onDangerousProperty === null) {
145
+ built.onDangerousProperty = defaultOnDangerousProperty;
146
+ }
147
+
148
+ // Always normalize processEntities for backward compatibility and validation
149
+ built.processEntities = normalizeProcessEntities(built.processEntities, built.htmlEntities);
150
+ built.unpairedTagsSet = new Set(built.unpairedTags);
151
+ // Convert old-style stopNodes for backward compatibility
152
+ if (built.stopNodes && Array.isArray(built.stopNodes)) {
153
+ built.stopNodes = built.stopNodes.map(node => {
154
+ if (typeof node === 'string' && node.startsWith('*.')) {
155
+ // Old syntax: *.tagname meant "tagname anywhere"
156
+ // Convert to new syntax: ..tagname
157
+ return '..' + node.substring(2);
158
+ }
159
+ return node;
160
+ });
161
+ }
162
+ //console.debug(built.processEntities)
163
+ return built;
164
+ };