@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.
- package/CHANGELOG.md +17 -0
- package/README.md +4 -2
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-core/package.json +3 -1
- package/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
- package/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
- package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
- package/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
- package/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
- package/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
- package/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +3 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
- package/node_modules/@mrclrchtr/supi-lsp/package.json +8 -8
- package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-cache.ts +102 -47
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-host.ts +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-refresh.ts +15 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-request.ts +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +46 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-disk-stamp.ts +60 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-state.ts +3 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-sync.ts +21 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-file-state.ts +17 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-semantic-input-barrier.ts +53 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +11 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-extends.ts +2 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-path.ts +2 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-scope.ts +14 -5
- package/node_modules/@mrclrchtr/supi-lsp/src/config/typescript-module.ts +17 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/evidence.ts +42 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-client-state.ts +2 -17
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-removal-ledger.ts +52 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +40 -20
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/typescript-file-local.ts +6 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +6 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-symbol-mapper.ts +13 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostic-surface.ts +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostics.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +17 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-transition-debug.ts +11 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +2 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +3 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm +0 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm.map +6 -6
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts +7 -7
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts.map +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts +7 -7
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm +0 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm.map +5 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +5 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/kotlin/tree-sitter-kotlin.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/latex/tree-sitter-latex.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-client.ts +1 -1
- package/node_modules/fast-xml-parser/CHANGELOG.md +886 -0
- package/node_modules/fast-xml-parser/LICENSE +21 -0
- package/node_modules/fast-xml-parser/README.md +204 -0
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.d.cts +774 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/README.md +92 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/package.json +57 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityDecoder.js +644 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityEncoder.js +239 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/all-entities.js +53 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entities.js +1139 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entityTries.js +60 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.d.ts +358 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.js +29 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/CHANGELOG.md +52 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/README.md +77 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.cjs +1 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.d.cts +270 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js +2 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/package.json +77 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.d.ts +270 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.js +609 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/ignoreAttributes.js +18 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/orderedJs2Xml.js +360 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/prettifyJs2Xml.js +0 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/util.js +23 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/README.md +632 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/package.json +56 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/html.js +102 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/log.js +98 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/nosql.js +114 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/redos.js +60 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/shell.js +105 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql-strict.js +47 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql.js +95 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/svg.js +81 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/xml.js +79 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.cjs +27 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.d.ts +103 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.js +292 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/util/decode-entities.js +48 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/README.md +947 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.cjs +1 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.d.cts +725 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js +2 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/package.json +79 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Expression.js +232 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/ExpressionSet.js +225 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Matcher.js +663 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.d.ts +589 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.js +30 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/CHANGELOG.md +63 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/README.md +113 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/README.md +142 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/anynum.js +135 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/digitTable.js +116 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/package.json +42 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/package.json +36 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/strnum.js +176 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/README.md +287 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/package.json +56 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.d.ts +108 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.js +382 -0
- package/node_modules/fast-xml-parser/package.json +93 -0
- package/node_modules/fast-xml-parser/src/cli/cli.js +97 -0
- package/node_modules/fast-xml-parser/src/cli/man.js +17 -0
- package/node_modules/fast-xml-parser/src/cli/read.js +43 -0
- package/node_modules/fast-xml-parser/src/fxp.d.ts +754 -0
- package/node_modules/fast-xml-parser/src/fxp.js +14 -0
- package/node_modules/fast-xml-parser/src/ignoreAttributes.js +18 -0
- package/node_modules/fast-xml-parser/src/util.js +61 -0
- package/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +16 -0
- package/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +106 -0
- package/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +61 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +69 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +103 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +100 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +154 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +94 -0
- package/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
- package/node_modules/fast-xml-parser/src/v6/TagPath.js +81 -0
- package/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +13 -0
- package/node_modules/fast-xml-parser/src/v6/XMLParser.js +83 -0
- package/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +235 -0
- package/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +210 -0
- package/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +111 -0
- package/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +116 -0
- package/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +121 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +105 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +22 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +19 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +38 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +13 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +14 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +6 -0
- package/node_modules/fast-xml-parser/src/validator.js +518 -0
- package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +6 -0
- package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +426 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +164 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +907 -0
- package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +77 -0
- package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +177 -0
- package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +54 -0
- package/package.json +10 -8
- package/src/analysis/evidence.ts +331 -73
- package/src/analysis/health/diagnostics.ts +66 -18
- package/src/analysis/health/evidence-reason.ts +44 -0
- package/src/analysis/search/pattern.ts +3 -3
- package/src/analysis/target/anchored.ts +3 -6
- package/src/analysis/target/symbol.ts +41 -47
- package/src/analysis/target/types.ts +4 -9
- package/src/analysis/workspace/cmake-parser.ts +207 -0
- package/src/analysis/workspace/cmake.ts +141 -0
- package/src/analysis/workspace/maven.ts +310 -0
- package/src/analysis/workspace/membership.ts +100 -26
- package/src/analysis/workspace/metadata.ts +6 -1
- package/src/analysis/workspace/observe.ts +6 -0
- package/src/analysis/workspace/types.ts +11 -3
- package/src/diagnostics/coverage.ts +49 -0
- package/src/diagnostics/evidence.ts +10 -2
- package/src/session/health-workflow.ts +6 -0
- package/src/session/input/common.ts +1 -1
- package/src/session/orientation/collect.ts +42 -7
- package/src/session/orientation/context-facts.ts +3 -3
- package/src/session/orientation/context-sections.ts +13 -15
- package/src/session/orientation/facts.ts +5 -8
- package/src/session/orientation-workflow.ts +4 -19
- package/src/session/target-workflow.ts +25 -18
- package/src/tool/code_find/result.ts +5 -7
- package/src/tool/code_graph/display.ts +5 -6
- package/src/tool/code_graph/format.ts +8 -24
- package/src/tool/code_graph/result.ts +16 -75
- package/src/tool/code_graph/section.ts +21 -33
- package/src/tool/code_graph/tui.ts +10 -5
- package/src/tool/code_health/diagnostic-tui.ts +49 -0
- package/src/tool/code_health/guidance.ts +27 -0
- package/src/tool/code_health/markdown.ts +60 -8
- package/src/tool/code_health/result.ts +20 -9
- package/src/tool/code_health/structured-schema.ts +14 -0
- package/src/tool/code_health/structured.ts +7 -1
- package/src/tool/code_health/tui.ts +33 -40
- package/src/tool/code_inspect/result.ts +23 -18
- package/src/tool/code_inspect/structured.ts +2 -19
- package/src/tool/code_orientation/result.ts +53 -100
- package/src/tool/code_orientation/structured-schema.ts +16 -12
- package/src/tool/code_orientation/structured-workspace.ts +13 -7
- package/src/tool/code_orientation/structured.ts +31 -39
- package/src/tool/code_orientation/workspace-format.ts +4 -10
- package/src/tool/code_orientation/workspace-instructions.ts +4 -5
- package/src/tool/code_orientation/workspace-observations.ts +2 -2
- package/src/tool/code_orientation/workspace-output.ts +16 -7
- package/src/tool/code_orientation/workspace-projects.ts +7 -10
- package/src/tool/code_orientation/workspace-sections.ts +13 -19
- package/src/tool/code_resolve/markdown.ts +4 -46
- package/src/tool/code_resolve/result.ts +43 -72
- package/src/tool/infra/truncate.ts +2 -16
- package/src/tool/result/candidate-selection.ts +141 -0
- package/src/tool/result/display.ts +41 -45
- package/src/tool/result/errors.ts +1 -0
- package/src/tool/result/model-budget.ts +26 -1
- package/src/tool/result/refactor.ts +11 -8
- package/src/tool/result/structured.ts +2 -1
- package/src/tool/result/types.ts +9 -8
- package/src/tool/schemas.ts +15 -20
- package/src/ui/footer.ts +2 -4
- package/src/ui/status-presentation.ts +4 -7
- package/src/ui/tui/candidate-selection.ts +40 -95
- package/src/ui/tui/common.ts +16 -70
- package/src/ui/tui/display.ts +6 -24
- 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] = '<'; // <
|
|
10
|
+
XML_UNSAFE_REPLACEMENT[62] = '>'; // >
|
|
11
|
+
XML_UNSAFE_REPLACEMENT[34] = '"'; // "
|
|
12
|
+
XML_UNSAFE_REPLACEMENT[39] = '''; // '
|
|
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
|
+
};
|