@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
@@ -726,10 +726,10 @@ declare module 'web-tree-sitter' {
726
726
  gotoFirstChildForIndex(goalIndex: number): boolean;
727
727
  /**
728
728
  * Move this cursor to the first child of its current node that contains or
729
- * starts after the given byte offset.
729
+ * starts after the given position.
730
730
  *
731
- * This returns the index of the child node if one was found, and returns
732
- * `null` if no such child was found.
731
+ * This returns `true` if the cursor successfully moved to a child node, and returns
732
+ * `false` if no such child was found.
733
733
  */
734
734
  gotoFirstChildForPosition(goalPosition: Point): boolean;
735
735
  /**
@@ -977,9 +977,9 @@ declare module 'web-tree-sitter' {
977
977
  * of in-progress matches.
978
978
  */
979
979
  didExceedMatchLimit(): boolean;
980
- /** Get the byte offset where the given pattern starts in the query's source. */
980
+ /** Get the index where the given pattern starts in the query's source. */
981
981
  startIndexForPattern(patternIndex: number): number;
982
- /** Get the byte offset where the given pattern ends in the query's source. */
982
+ /** Get the index where the given pattern ends in the query's source. */
983
983
  endIndexForPattern(patternIndex: number): number;
984
984
  /** Get the number of patterns in the query. */
985
985
  patternCount(): number;
@@ -990,12 +990,12 @@ declare module 'web-tree-sitter' {
990
990
  /** Check if a given pattern within a query has a single root node. */
991
991
  isPatternNonLocal(patternIndex: number): boolean;
992
992
  /**
993
- * Check if a given step in a query is 'definite'.
993
+ * Check if the step at the given index in the query's source is 'definite'.
994
994
  *
995
995
  * A query step is 'definite' if its parent pattern will be guaranteed to
996
996
  * match successfully once it reaches the step.
997
997
  */
998
- isPatternGuaranteedAtStep(byteIndex: number): boolean;
998
+ isPatternGuaranteedAtStep(index: number): boolean;
999
999
  }
1000
1000
  export class LookaheadIterator implements Iterable<string> {
1001
1001
  /**
@@ -53,6 +53,6 @@
53
53
  null,
54
54
  null
55
55
  ],
56
- "mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAsCVC,aAAaA;;;;aAKbC,gBAAgBA;;;;;;aAOhBC,WAAWA;cCrEVC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBCgBAC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmCZC,UAAUA;;;;;;;;;;;;;;;YAwBhBC,gBAAgBA;;;;;YAMhBC,s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;;;;;;;;;;;;kBCENC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAsEZC,UAAUA;;;;;aAMfC,eAAeA;;;;kBAKVC,cAAcA;;;;;;;;;;kBAYdC,YAAYA;;;;;;;;;;;;;;;kBAqBZC,UAAUA;;;;;;;;;;;;;cA2BfC,iBAAiBA;;;;;;;;aAAjBA,iBAAiBA;;;;;;;;;;;;aAajBC,aAAaA;;;;;;WAORC,oBAAoBA;;;;;;;;;WAOpBC,mBAAmBA;;;;cAmVvBC,KAAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCngBLC,iBAAiBA",
57
57
  "ignoreList": []
58
58
  }
@@ -726,10 +726,10 @@ declare module 'web-tree-sitter' {
726
726
  gotoFirstChildForIndex(goalIndex: number): boolean;
727
727
  /**
728
728
  * Move this cursor to the first child of its current node that contains or
729
- * starts after the given byte offset.
729
+ * starts after the given position.
730
730
  *
731
- * This returns the index of the child node if one was found, and returns
732
- * `null` if no such child was found.
731
+ * This returns `true` if the cursor successfully moved to a child node, and returns
732
+ * `false` if no such child was found.
733
733
  */
734
734
  gotoFirstChildForPosition(goalPosition: Point): boolean;
735
735
  /**
@@ -977,9 +977,9 @@ declare module 'web-tree-sitter' {
977
977
  * of in-progress matches.
978
978
  */
979
979
  didExceedMatchLimit(): boolean;
980
- /** Get the byte offset where the given pattern starts in the query's source. */
980
+ /** Get the index where the given pattern starts in the query's source. */
981
981
  startIndexForPattern(patternIndex: number): number;
982
- /** Get the byte offset where the given pattern ends in the query's source. */
982
+ /** Get the index where the given pattern ends in the query's source. */
983
983
  endIndexForPattern(patternIndex: number): number;
984
984
  /** Get the number of patterns in the query. */
985
985
  patternCount(): number;
@@ -990,12 +990,12 @@ declare module 'web-tree-sitter' {
990
990
  /** Check if a given pattern within a query has a single root node. */
991
991
  isPatternNonLocal(patternIndex: number): boolean;
992
992
  /**
993
- * Check if a given step in a query is 'definite'.
993
+ * Check if the step at the given index in the query's source is 'definite'.
994
994
  *
995
995
  * A query step is 'definite' if its parent pattern will be guaranteed to
996
996
  * match successfully once it reaches the step.
997
997
  */
998
- isPatternGuaranteedAtStep(byteIndex: number): boolean;
998
+ isPatternGuaranteedAtStep(index: number): boolean;
999
999
  }
1000
1000
  export class LookaheadIterator implements Iterable<string> {
1001
1001
  /**
@@ -53,6 +53,6 @@
53
53
  null,
54
54
  null
55
55
  ],
56
- "mappings": ";;;;;;kBASiBA,KAAKA;;;;;;;;;;kBAYLC,KAAKA;;;;;;;;;;;;;aAsCVC,aAAaA;;;;aAKbC,gBAAgBA;;;;;;aAOhBC,WAAWA;cCrEVC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBCgBAC,YAAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmCZC,UAAUA;;;;;;;;;;;;;;;YAwBhBC,gBAAgBA;;;;;YAMhBC,sBAAsBA;;;;;cAWpBC,MAAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WCvFFC,gBAAgBA;;;;;;;;;cAYpBC,QAAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCiBRC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cC1BJC,IAAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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  }
@@ -363,29 +363,17 @@ var Tree = class _Tree {
363
363
  };
364
364
 
365
365
  // src/tree_cursor.ts
366
- var finalizer3 = newFinalizer((address) => {
367
- C._ts_tree_cursor_delete_wasm(address);
366
+ var finalizer3 = newFinalizer((handles) => {
367
+ marshalTreeCursor({ handles });
368
+ C._ts_tree_cursor_delete_wasm(0);
368
369
  });
369
370
  var TreeCursor = class _TreeCursor {
370
371
  static {
371
372
  __name(this, "TreeCursor");
372
373
  }
373
374
  /** @internal */
374
- // @ts-expect-error: never read
375
- [0] = 0;
376
- // Internal handle for Wasm
377
- /** @internal */
378
- // @ts-expect-error: never read
379
- [1] = 0;
380
- // Internal handle for Wasm
381
- /** @internal */
382
- // @ts-expect-error: never read
383
- [2] = 0;
384
- // Internal handle for Wasm
385
- /** @internal */
386
- // @ts-expect-error: never read
387
- [3] = 0;
388
- // Internal handle for Wasm
375
+ handles = [0, 0, 0, 0];
376
+ // Internal handles for Wasm, shared with the finalizer.
389
377
  /** @internal */
390
378
  tree;
391
379
  /** @internal */
@@ -393,21 +381,20 @@ var TreeCursor = class _TreeCursor {
393
381
  assertInternal(internal);
394
382
  this.tree = tree;
395
383
  unmarshalTreeCursor(this);
396
- finalizer3?.register(this, this.tree[0], this);
384
+ finalizer3?.register(this, this.handles, this);
397
385
  }
398
386
  /** Creates a deep copy of the tree cursor. This allocates new memory. */
399
387
  copy() {
400
- const copy = new _TreeCursor(INTERNAL, this.tree);
388
+ marshalTreeCursor(this);
401
389
  C._ts_tree_cursor_copy_wasm(this.tree[0]);
402
- unmarshalTreeCursor(copy);
403
- return copy;
390
+ return new _TreeCursor(INTERNAL, this.tree);
404
391
  }
405
392
  /** Delete the tree cursor, freeing its resources. */
406
393
  delete() {
407
394
  finalizer3?.unregister(this);
408
395
  marshalTreeCursor(this);
409
396
  C._ts_tree_cursor_delete_wasm(this.tree[0]);
410
- this[0] = this[1] = this[2] = 0;
397
+ this.handles.fill(0);
411
398
  }
412
399
  /** Get the tree cursor's current {@link Node}. */
413
400
  get currentNode() {
@@ -618,10 +605,10 @@ var TreeCursor = class _TreeCursor {
618
605
  }
619
606
  /**
620
607
  * Move this cursor to the first child of its current node that contains or
621
- * starts after the given byte offset.
608
+ * starts after the given position.
622
609
  *
623
- * This returns the index of the child node if one was found, and returns
624
- * `null` if no such child was found.
610
+ * This returns `true` if the cursor successfully moved to a child node, and returns
611
+ * `false` if no such child was found.
625
612
  */
626
613
  gotoFirstChildForPosition(goalPosition) {
627
614
  marshalTreeCursor(this);
@@ -637,8 +624,9 @@ var TreeCursor = class _TreeCursor {
637
624
  reset(node) {
638
625
  marshalNode(node);
639
626
  marshalTreeCursor(this, TRANSFER_BUFFER + SIZE_OF_NODE);
640
- C._ts_tree_cursor_reset_wasm(this.tree[0]);
627
+ C._ts_tree_cursor_reset_wasm(node.tree[0]);
641
628
  unmarshalTreeCursor(this);
629
+ this.tree = node.tree;
642
630
  }
643
631
  /**
644
632
  * Re-initialize a tree cursor to the same position as another cursor.
@@ -651,6 +639,7 @@ var TreeCursor = class _TreeCursor {
651
639
  marshalTreeCursor(cursor, TRANSFER_BUFFER + SIZE_OF_CURSOR);
652
640
  C._ts_tree_cursor_reset_to_wasm(this.tree[0], cursor.tree[0]);
653
641
  unmarshalTreeCursor(this);
642
+ this.tree = cursor.tree;
654
643
  }
655
644
  };
656
645
 
@@ -1011,16 +1000,14 @@ var Node = class {
1011
1000
  if (!Array.isArray(types)) types = [types];
1012
1001
  const symbols = [];
1013
1002
  const typesBySymbol = this.tree.language.types;
1014
- for (const node_type of types) {
1015
- if (node_type == "ERROR") {
1016
- symbols.push(65535);
1017
- }
1018
- }
1019
1003
  for (let i2 = 0, n = typesBySymbol.length; i2 < n; i2++) {
1020
1004
  if (types.includes(typesBySymbol[i2])) {
1021
1005
  symbols.push(i2);
1022
1006
  }
1023
1007
  }
1008
+ if (types.includes("ERROR")) {
1009
+ symbols.push(65535);
1010
+ }
1024
1011
  const symbolsAddress = C._malloc(SIZE_OF_INT * symbols.length);
1025
1012
  for (let i2 = 0, n = symbols.length; i2 < n; i2++) {
1026
1013
  C.setValue(symbolsAddress + i2 * SIZE_OF_INT, symbols[i2], "i32");
@@ -1175,31 +1162,9 @@ var Node = class {
1175
1162
  * you want to keep and continue to use after an edit.
1176
1163
  */
1177
1164
  edit(edit) {
1178
- if (this.startIndex >= edit.oldEndIndex) {
1179
- this.startIndex = edit.newEndIndex + (this.startIndex - edit.oldEndIndex);
1180
- let subbedPointRow;
1181
- let subbedPointColumn;
1182
- if (this.startPosition.row > edit.oldEndPosition.row) {
1183
- subbedPointRow = this.startPosition.row - edit.oldEndPosition.row;
1184
- subbedPointColumn = this.startPosition.column;
1185
- } else {
1186
- subbedPointRow = 0;
1187
- subbedPointColumn = this.startPosition.column;
1188
- if (this.startPosition.column >= edit.oldEndPosition.column) {
1189
- subbedPointColumn = this.startPosition.column - edit.oldEndPosition.column;
1190
- }
1191
- }
1192
- if (subbedPointRow > 0) {
1193
- this.startPosition.row += subbedPointRow;
1194
- this.startPosition.column = subbedPointColumn;
1195
- } else {
1196
- this.startPosition.column += subbedPointColumn;
1197
- }
1198
- } else if (this.startIndex > edit.startIndex) {
1199
- this.startIndex = edit.newEndIndex;
1200
- this.startPosition.row = edit.newEndPosition.row;
1201
- this.startPosition.column = edit.newEndPosition.column;
1202
- }
1165
+ const { point, index } = edit.editPoint(this.startPosition, this.startIndex);
1166
+ this.startPosition = point;
1167
+ this.startIndex = index;
1203
1168
  }
1204
1169
  /** Get the S-expression representation of this node. */
1205
1170
  toString() {
@@ -1257,18 +1222,18 @@ function unmarshalNode(tree, address = TRANSFER_BUFFER) {
1257
1222
  return result;
1258
1223
  }
1259
1224
  __name(unmarshalNode, "unmarshalNode");
1260
- function marshalTreeCursor(cursor, address = TRANSFER_BUFFER) {
1261
- C.setValue(address + 0 * SIZE_OF_INT, cursor[0], "i32");
1262
- C.setValue(address + 1 * SIZE_OF_INT, cursor[1], "i32");
1263
- C.setValue(address + 2 * SIZE_OF_INT, cursor[2], "i32");
1264
- C.setValue(address + 3 * SIZE_OF_INT, cursor[3], "i32");
1225
+ function marshalTreeCursor({ handles }, address = TRANSFER_BUFFER) {
1226
+ C.setValue(address + 0 * SIZE_OF_INT, handles[0], "i32");
1227
+ C.setValue(address + 1 * SIZE_OF_INT, handles[1], "i32");
1228
+ C.setValue(address + 2 * SIZE_OF_INT, handles[2], "i32");
1229
+ C.setValue(address + 3 * SIZE_OF_INT, handles[3], "i32");
1265
1230
  }
1266
1231
  __name(marshalTreeCursor, "marshalTreeCursor");
1267
- function unmarshalTreeCursor(cursor) {
1268
- cursor[0] = C.getValue(TRANSFER_BUFFER + 0 * SIZE_OF_INT, "i32");
1269
- cursor[1] = C.getValue(TRANSFER_BUFFER + 1 * SIZE_OF_INT, "i32");
1270
- cursor[2] = C.getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32");
1271
- cursor[3] = C.getValue(TRANSFER_BUFFER + 3 * SIZE_OF_INT, "i32");
1232
+ function unmarshalTreeCursor({ handles }) {
1233
+ handles[0] = C.getValue(TRANSFER_BUFFER + 0 * SIZE_OF_INT, "i32");
1234
+ handles[1] = C.getValue(TRANSFER_BUFFER + 1 * SIZE_OF_INT, "i32");
1235
+ handles[2] = C.getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32");
1236
+ handles[3] = C.getValue(TRANSFER_BUFFER + 3 * SIZE_OF_INT, "i32");
1272
1237
  }
1273
1238
  __name(unmarshalTreeCursor, "unmarshalTreeCursor");
1274
1239
  function marshalPoint(address, point) {
@@ -2926,7 +2891,7 @@ async function Module2(moduleArg = {}) {
2926
2891
  Module["loadWebAssemblyModule"] = loadWebAssemblyModule;
2927
2892
  Module["LE_HEAP_STORE_I64"] = LE_HEAP_STORE_I64;
2928
2893
  var ASM_CONSTS = {};
2929
- var _malloc, _calloc, _realloc, _free, _ts_range_edit, _memcmp, _ts_language_symbol_count, _ts_language_state_count, _ts_language_abi_version, _ts_language_name, _ts_language_field_count, _ts_language_next_state, _ts_language_symbol_name, _ts_language_symbol_for_name, _strncmp, _ts_language_symbol_type, _ts_language_field_name_for_id, _ts_lookahead_iterator_new, _ts_lookahead_iterator_delete, _ts_lookahead_iterator_reset_state, _ts_lookahead_iterator_reset, _ts_lookahead_iterator_next, _ts_lookahead_iterator_current_symbol, _ts_point_edit, _ts_parser_delete, _ts_parser_reset, _ts_parser_set_language, _ts_parser_set_included_ranges, _ts_query_new, _ts_query_delete, _iswspace, _iswalnum, _ts_query_copy, _ts_query_pattern_count, _ts_query_capture_count, _ts_query_string_count, _ts_query_capture_name_for_id, _ts_query_capture_quantifier_for_id, _ts_query_string_value_for_id, _ts_query_predicates_for_pattern, _ts_query_start_byte_for_pattern, _ts_query_end_byte_for_pattern, _ts_query_is_pattern_rooted, _ts_query_is_pattern_non_local, _ts_query_is_pattern_guaranteed_at_step, _ts_query_disable_capture, _ts_query_disable_pattern, _ts_tree_copy, _ts_tree_delete, _ts_init, _ts_parser_new_wasm, _ts_parser_enable_logger_wasm, _ts_parser_parse_wasm, _ts_parser_included_ranges_wasm, _ts_language_type_is_named_wasm, _ts_language_type_is_visible_wasm, _ts_language_metadata_wasm, _ts_language_supertypes_wasm, _ts_language_subtypes_wasm, _ts_tree_root_node_wasm, _ts_tree_root_node_with_offset_wasm, _ts_tree_edit_wasm, _ts_tree_included_ranges_wasm, _ts_tree_get_changed_ranges_wasm, _ts_tree_cursor_new_wasm, _ts_tree_cursor_copy_wasm, _ts_tree_cursor_delete_wasm, _ts_tree_cursor_reset_wasm, _ts_tree_cursor_reset_to_wasm, _ts_tree_cursor_goto_first_child_wasm, _ts_tree_cursor_goto_last_child_wasm, _ts_tree_cursor_goto_first_child_for_index_wasm, _ts_tree_cursor_goto_first_child_for_position_wasm, _ts_tree_cursor_goto_next_sibling_wasm, _ts_tree_cursor_goto_previous_sibling_wasm, _ts_tree_cursor_goto_descendant_wasm, _ts_tree_cursor_goto_parent_wasm, _ts_tree_cursor_current_node_type_id_wasm, _ts_tree_cursor_current_node_state_id_wasm, _ts_tree_cursor_current_node_is_named_wasm, _ts_tree_cursor_current_node_is_missing_wasm, _ts_tree_cursor_current_node_id_wasm, _ts_tree_cursor_start_position_wasm, _ts_tree_cursor_end_position_wasm, _ts_tree_cursor_start_index_wasm, _ts_tree_cursor_end_index_wasm, _ts_tree_cursor_current_field_id_wasm, _ts_tree_cursor_current_depth_wasm, _ts_tree_cursor_current_descendant_index_wasm, _ts_tree_cursor_current_node_wasm, _ts_node_symbol_wasm, _ts_node_field_name_for_child_wasm, _ts_node_field_name_for_named_child_wasm, _ts_node_children_by_field_id_wasm, _ts_node_first_child_for_byte_wasm, _ts_node_first_named_child_for_byte_wasm, _ts_node_grammar_symbol_wasm, _ts_node_child_count_wasm, _ts_node_named_child_count_wasm, _ts_node_child_wasm, _ts_node_named_child_wasm, _ts_node_child_by_field_id_wasm, _ts_node_next_sibling_wasm, _ts_node_prev_sibling_wasm, _ts_node_next_named_sibling_wasm, _ts_node_prev_named_sibling_wasm, _ts_node_descendant_count_wasm, _ts_node_parent_wasm, _ts_node_child_with_descendant_wasm, _ts_node_descendant_for_index_wasm, _ts_node_named_descendant_for_index_wasm, _ts_node_descendant_for_position_wasm, _ts_node_named_descendant_for_position_wasm, _ts_node_start_point_wasm, _ts_node_end_point_wasm, _ts_node_start_index_wasm, _ts_node_end_index_wasm, _ts_node_to_string_wasm, _ts_node_children_wasm, _ts_node_named_children_wasm, _ts_node_descendants_of_type_wasm, _ts_node_is_named_wasm, _ts_node_has_changes_wasm, _ts_node_has_error_wasm, _ts_node_is_error_wasm, _ts_node_is_missing_wasm, _ts_node_is_extra_wasm, _ts_node_parse_state_wasm, _ts_node_next_parse_state_wasm, _ts_query_matches_wasm, _ts_query_captures_wasm, _memset, _memcpy, _memmove, _iswalpha, _iswblank, _iswdigit, _iswlower, _iswpunct, _iswupper, _iswxdigit, _memchr, _strlen, _strcmp, _strncat, _strncpy, _towlower, _towupper, _setThrew, __emscripten_stack_restore, __emscripten_stack_alloc, _emscripten_stack_get_current, ___wasm_apply_data_relocs;
2894
+ var _malloc, _calloc, _realloc, _free, _ts_range_edit, _memcmp, _ts_language_symbol_count, _ts_language_state_count, _ts_language_abi_version, _ts_language_name, _ts_language_field_count, _ts_language_next_state, _ts_language_symbol_name, _ts_language_symbol_for_name, _strncmp, _strlen, _ts_language_symbol_type, _ts_language_field_name_for_id, _ts_lookahead_iterator_new, _ts_lookahead_iterator_delete, _ts_lookahead_iterator_reset_state, _ts_lookahead_iterator_reset, _ts_lookahead_iterator_next, _ts_lookahead_iterator_current_symbol, _ts_point_edit, _ts_parser_delete, _ts_parser_reset, _ts_parser_set_language, _ts_parser_set_included_ranges, _ts_query_new, _ts_query_delete, _iswspace, _iswalnum, _ts_query_copy, _ts_query_pattern_count, _ts_query_capture_count, _ts_query_string_count, _ts_query_capture_name_for_id, _ts_query_capture_quantifier_for_id, _ts_query_string_value_for_id, _ts_query_predicates_for_pattern, _ts_query_start_byte_for_pattern, _ts_query_end_byte_for_pattern, _ts_query_is_pattern_rooted, _ts_query_is_pattern_non_local, _ts_query_is_pattern_guaranteed_at_step, _ts_query_disable_capture, _ts_query_disable_pattern, _ts_tree_copy, _ts_tree_delete, _ts_init, _ts_parser_new_wasm, _ts_parser_enable_logger_wasm, _ts_parser_parse_wasm, _ts_parser_included_ranges_wasm, _ts_language_type_is_named_wasm, _ts_language_type_is_visible_wasm, _ts_language_metadata_wasm, _ts_language_supertypes_wasm, _ts_language_subtypes_wasm, _ts_tree_root_node_wasm, _ts_tree_root_node_with_offset_wasm, _ts_tree_edit_wasm, _ts_tree_included_ranges_wasm, _ts_tree_get_changed_ranges_wasm, _ts_tree_cursor_new_wasm, _ts_tree_cursor_copy_wasm, _ts_tree_cursor_delete_wasm, _ts_tree_cursor_reset_wasm, _ts_tree_cursor_reset_to_wasm, _ts_tree_cursor_goto_first_child_wasm, _ts_tree_cursor_goto_last_child_wasm, _ts_tree_cursor_goto_first_child_for_index_wasm, _ts_tree_cursor_goto_first_child_for_position_wasm, _ts_tree_cursor_goto_next_sibling_wasm, _ts_tree_cursor_goto_previous_sibling_wasm, _ts_tree_cursor_goto_descendant_wasm, _ts_tree_cursor_goto_parent_wasm, _ts_tree_cursor_current_node_type_id_wasm, _ts_tree_cursor_current_node_state_id_wasm, _ts_tree_cursor_current_node_is_named_wasm, _ts_tree_cursor_current_node_is_missing_wasm, _ts_tree_cursor_current_node_id_wasm, _ts_tree_cursor_start_position_wasm, _ts_tree_cursor_end_position_wasm, _ts_tree_cursor_start_index_wasm, _ts_tree_cursor_end_index_wasm, _ts_tree_cursor_current_field_id_wasm, _ts_tree_cursor_current_depth_wasm, _ts_tree_cursor_current_descendant_index_wasm, _ts_tree_cursor_current_node_wasm, _ts_node_symbol_wasm, _ts_node_field_name_for_child_wasm, _ts_node_field_name_for_named_child_wasm, _ts_node_children_by_field_id_wasm, _ts_node_first_child_for_byte_wasm, _ts_node_first_named_child_for_byte_wasm, _ts_node_grammar_symbol_wasm, _ts_node_child_count_wasm, _ts_node_named_child_count_wasm, _ts_node_child_wasm, _ts_node_named_child_wasm, _ts_node_child_by_field_id_wasm, _ts_node_next_sibling_wasm, _ts_node_prev_sibling_wasm, _ts_node_next_named_sibling_wasm, _ts_node_prev_named_sibling_wasm, _ts_node_descendant_count_wasm, _ts_node_parent_wasm, _ts_node_child_with_descendant_wasm, _ts_node_descendant_for_index_wasm, _ts_node_named_descendant_for_index_wasm, _ts_node_descendant_for_position_wasm, _ts_node_named_descendant_for_position_wasm, _ts_node_start_point_wasm, _ts_node_end_point_wasm, _ts_node_start_index_wasm, _ts_node_end_index_wasm, _ts_node_to_string_wasm, _ts_node_children_wasm, _ts_node_named_children_wasm, _ts_node_descendants_of_type_wasm, _ts_node_is_named_wasm, _ts_node_has_changes_wasm, _ts_node_has_error_wasm, _ts_node_is_error_wasm, _ts_node_is_missing_wasm, _ts_node_is_extra_wasm, _ts_node_parse_state_wasm, _ts_node_next_parse_state_wasm, _ts_query_matches_wasm, _ts_query_captures_wasm, _memset, _memcpy, _memmove, _iswalpha, _iswblank, _iswdigit, _iswlower, _iswpunct, _iswupper, _iswxdigit, _memchr, _strcmp, _strncat, _strncpy, _towlower, _towupper, _setThrew, __emscripten_stack_restore, __emscripten_stack_alloc, _emscripten_stack_get_current, ___wasm_apply_data_relocs;
2930
2895
  function assignWasmExports(wasmExports2) {
2931
2896
  Module["_malloc"] = _malloc = wasmExports2["malloc"];
2932
2897
  Module["_calloc"] = _calloc = wasmExports2["calloc"];
@@ -2943,6 +2908,7 @@ async function Module2(moduleArg = {}) {
2943
2908
  Module["_ts_language_symbol_name"] = _ts_language_symbol_name = wasmExports2["ts_language_symbol_name"];
2944
2909
  Module["_ts_language_symbol_for_name"] = _ts_language_symbol_for_name = wasmExports2["ts_language_symbol_for_name"];
2945
2910
  Module["_strncmp"] = _strncmp = wasmExports2["strncmp"];
2911
+ Module["_strlen"] = _strlen = wasmExports2["strlen"];
2946
2912
  Module["_ts_language_symbol_type"] = _ts_language_symbol_type = wasmExports2["ts_language_symbol_type"];
2947
2913
  Module["_ts_language_field_name_for_id"] = _ts_language_field_name_for_id = wasmExports2["ts_language_field_name_for_id"];
2948
2914
  Module["_ts_lookahead_iterator_new"] = _ts_lookahead_iterator_new = wasmExports2["ts_lookahead_iterator_new"];
@@ -3070,7 +3036,6 @@ async function Module2(moduleArg = {}) {
3070
3036
  Module["_iswupper"] = _iswupper = wasmExports2["iswupper"];
3071
3037
  Module["_iswxdigit"] = _iswxdigit = wasmExports2["iswxdigit"];
3072
3038
  Module["_memchr"] = _memchr = wasmExports2["memchr"];
3073
- Module["_strlen"] = _strlen = wasmExports2["strlen"];
3074
3039
  Module["_strcmp"] = _strcmp = wasmExports2["strcmp"];
3075
3040
  Module["_strncat"] = _strncat = wasmExports2["strncat"];
3076
3041
  Module["_strncpy"] = _strncpy = wasmExports2["strncpy"];
@@ -3633,6 +3598,10 @@ function parsePattern(index, stepType, stepValueId, captureNames, stringValues,
3633
3598
  }
3634
3599
  }
3635
3600
  __name(parsePattern, "parsePattern");
3601
+ function indexForByteOffset(source, byteOffset) {
3602
+ return new TextEncoder().encodeInto(source, new Uint8Array(byteOffset)).read;
3603
+ }
3604
+ __name(indexForByteOffset, "indexForByteOffset");
3636
3605
  var finalizer5 = newFinalizer((address) => {
3637
3606
  C._ts_query_delete(address);
3638
3607
  });
@@ -3647,6 +3616,8 @@ var Query = class {
3647
3616
  exceededMatchLimit;
3648
3617
  /** @internal */
3649
3618
  textPredicates;
3619
+ /** @internal */
3620
+ source;
3650
3621
  /** The names of the captures used in the query. */
3651
3622
  captureNames;
3652
3623
  /** The quantifiers of the captures used in the query. */
@@ -3785,6 +3756,7 @@ var Query = class {
3785
3756
  this.captureNames = captureNames;
3786
3757
  this.captureQuantifiers = captureQuantifiers;
3787
3758
  this.textPredicates = textPredicates;
3759
+ this.source = source;
3788
3760
  this.predicates = predicates;
3789
3761
  this.setProperties = setProperties;
3790
3762
  this.assertedProperties = assertedProperties;
@@ -4021,23 +3993,25 @@ var Query = class {
4021
3993
  didExceedMatchLimit() {
4022
3994
  return this.exceededMatchLimit;
4023
3995
  }
4024
- /** Get the byte offset where the given pattern starts in the query's source. */
3996
+ /** Get the index where the given pattern starts in the query's source. */
4025
3997
  startIndexForPattern(patternIndex) {
4026
3998
  if (patternIndex >= this.predicates.length) {
4027
3999
  throw new Error(
4028
4000
  `Pattern index is ${patternIndex} but the pattern count is ${this.predicates.length}`
4029
4001
  );
4030
4002
  }
4031
- return C._ts_query_start_byte_for_pattern(this[0], patternIndex);
4003
+ const byteOffset = C._ts_query_start_byte_for_pattern(this[0], patternIndex);
4004
+ return indexForByteOffset(this.source, byteOffset);
4032
4005
  }
4033
- /** Get the byte offset where the given pattern ends in the query's source. */
4006
+ /** Get the index where the given pattern ends in the query's source. */
4034
4007
  endIndexForPattern(patternIndex) {
4035
4008
  if (patternIndex >= this.predicates.length) {
4036
4009
  throw new Error(
4037
4010
  `Pattern index is ${patternIndex} but the pattern count is ${this.predicates.length}`
4038
4011
  );
4039
4012
  }
4040
- return C._ts_query_end_byte_for_pattern(this[0], patternIndex);
4013
+ const byteOffset = C._ts_query_end_byte_for_pattern(this[0], patternIndex);
4014
+ return indexForByteOffset(this.source, byteOffset);
4041
4015
  }
4042
4016
  /** Get the number of patterns in the query. */
4043
4017
  patternCount() {
@@ -4056,13 +4030,14 @@ var Query = class {
4056
4030
  return C._ts_query_is_pattern_non_local(this[0], patternIndex) === 1;
4057
4031
  }
4058
4032
  /**
4059
- * Check if a given step in a query is 'definite'.
4033
+ * Check if the step at the given index in the query's source is 'definite'.
4060
4034
  *
4061
4035
  * A query step is 'definite' if its parent pattern will be guaranteed to
4062
4036
  * match successfully once it reaches the step.
4063
4037
  */
4064
- isPatternGuaranteedAtStep(byteIndex) {
4065
- return C._ts_query_is_pattern_guaranteed_at_step(this[0], byteIndex) === 1;
4038
+ isPatternGuaranteedAtStep(index) {
4039
+ const byteOffset = C.lengthBytesUTF8(this.source.slice(0, index));
4040
+ return C._ts_query_is_pattern_guaranteed_at_step(this[0], byteOffset) === 1;
4066
4041
  }
4067
4042
  };
4068
4043
  export {