@mrclrchtr/supi-code-intelligence 12.0.0 → 14.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 +35 -0
- package/README.md +7 -5
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +10 -0
- 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 +78 -13
- package/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +41 -9
- package/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
- package/node_modules/@mrclrchtr/supi-core/src/session.ts +3 -0
- package/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
- package/node_modules/@mrclrchtr/supi-core/src/side-run.ts +46 -0
- package/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
- package/node_modules/@mrclrchtr/supi-lsp/README.md +6 -2
- 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-code-runtime/src/query-result.ts +10 -0
- 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 +78 -13
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +41 -9
- 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 +3 -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/side-run.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 +20 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-request.ts +4 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-timing.ts +14 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-typescript.ts +8 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +50 -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-input-admission.ts +7 -1
- 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 +12 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/client/transport.ts +24 -8
- package/node_modules/@mrclrchtr/supi-lsp/src/config/server-config.ts +5 -0
- 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 +17 -5
- package/node_modules/@mrclrchtr/supi-lsp/src/config/typescript-module.ts +17 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/debug-telemetry.ts +64 -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-project-info.ts +3 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-removal-ledger.ts +52 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-typescript-coverage.ts +27 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-workspace-symbol.ts +16 -112
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +561 -103
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/typescript-file-local.ts +6 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/workspace-symbol-collection.ts +163 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/workspace-symbol-row-limit.ts +72 -0
- 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-controller.ts +11 -0
- 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 +53 -9
- 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-code-runtime/src/query-result.ts +10 -0
- 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 +78 -13
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +41 -9
- 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 +3 -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/side-run.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 +0 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm.json +3 -3
- 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/health/server-status.ts +32 -9
- package/src/analysis/health/signals.ts +1 -0
- package/src/analysis/instruction-files.ts +11 -7
- package/src/analysis/search/exclusions.ts +18 -4
- package/src/analysis/search/pattern.ts +3 -3
- package/src/analysis/target/anchored.ts +3 -6
- package/src/analysis/target/file-outline-omissions.ts +17 -2
- package/src/analysis/target/symbol-selection.ts +100 -0
- package/src/analysis/target/symbol.ts +83 -49
- package/src/analysis/target/types.ts +12 -10
- 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/app/app.ts +37 -21
- package/src/diagnostics/coverage.ts +49 -0
- package/src/diagnostics/evidence.ts +10 -2
- package/src/extension.ts +1 -2
- package/src/headless.ts +4 -2
- package/src/session/health-types.ts +2 -0
- 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-types.ts +5 -0
- package/src/session/orientation-workflow.ts +12 -17
- package/src/session/target-workflow.ts +38 -25
- package/src/tool/code_find/render.ts +10 -11
- package/src/tool/code_find/result.ts +11 -8
- 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/structured.ts +3 -0
- 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 +63 -9
- package/src/tool/code_health/result.ts +20 -9
- package/src/tool/code_health/structured-schema.ts +15 -0
- package/src/tool/code_health/structured.ts +9 -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/markdown.ts +6 -1
- 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 +45 -73
- package/src/tool/code_resolve/structured.ts +6 -1
- package/src/tool/infra/truncate.ts +2 -16
- package/src/tool/result/candidate-selection.ts +157 -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 +147 -44
- package/src/ui/status-overlay.ts +13 -8
- 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
|
@@ -19,6 +19,7 @@ export function collectServers(
|
|
|
19
19
|
...(server.typescript ? { typescript: server.typescript } : {}),
|
|
20
20
|
...(server.failureMessage ? { failureMessage: server.failureMessage } : {}),
|
|
21
21
|
ready: server.ready,
|
|
22
|
+
...(server.loadingProjects ? { loadingProjects: true as const } : {}),
|
|
22
23
|
...(server.operationSupport ? { operationSupport: server.operationSupport } : {}),
|
|
23
24
|
}));
|
|
24
25
|
}
|
|
@@ -57,6 +57,9 @@ export function isValidInstructionFileName(name: unknown): name is string {
|
|
|
57
57
|
* When the project is not trusted, all project-configured instruction files
|
|
58
58
|
* are rejected so a repository-authored path cannot cause reads outside the
|
|
59
59
|
* workspace root.
|
|
60
|
+
*
|
|
61
|
+
* `known` lists files the session already has (loaded natively, read in full, or
|
|
62
|
+
* delivered by an earlier orientation), so callers can say why they are not repeated.
|
|
60
63
|
*/
|
|
61
64
|
export function findInstructionFilesForDirectory(options: {
|
|
62
65
|
directory: string;
|
|
@@ -66,7 +69,7 @@ export function findInstructionFilesForDirectory(options: {
|
|
|
66
69
|
surfacedDirectories: Set<string>;
|
|
67
70
|
/** Whether project-local configuration is trusted. */
|
|
68
71
|
projectTrusted: boolean;
|
|
69
|
-
}): InstructionFileMatch[] {
|
|
72
|
+
}): { matches: InstructionFileMatch[]; known: InstructionFileMatch[] } {
|
|
70
73
|
const cwd = path.resolve(options.cwd);
|
|
71
74
|
const directory = path.resolve(options.directory);
|
|
72
75
|
|
|
@@ -74,21 +77,22 @@ export function findInstructionFilesForDirectory(options: {
|
|
|
74
77
|
options.projectTrusted && Array.isArray(options.fileNames)
|
|
75
78
|
? options.fileNames.filter(isValidInstructionFileName)
|
|
76
79
|
: [];
|
|
77
|
-
if (validNames.length === 0) return [];
|
|
78
|
-
if (!isDirectoryWithinCwd(directory, cwd)) return [];
|
|
80
|
+
if (validNames.length === 0) return { matches: [], known: [] };
|
|
81
|
+
if (!isDirectoryWithinCwd(directory, cwd)) return { matches: [], known: [] };
|
|
79
82
|
|
|
80
83
|
const dirs = collectDirsShallowestFirst(directory, cwd);
|
|
81
84
|
const matches: InstructionFileMatch[] = [];
|
|
85
|
+
const known: InstructionFileMatch[] = [];
|
|
82
86
|
|
|
83
87
|
for (const dir of dirs) {
|
|
84
|
-
if (options.surfacedDirectories.has(dir)) continue;
|
|
85
88
|
const match = findFirstInstructionFile(dir, cwd, validNames);
|
|
86
89
|
if (!match) continue;
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
const seen =
|
|
91
|
+
options.surfacedDirectories.has(dir) || options.nativeContextPaths.has(match.absolutePath);
|
|
92
|
+
(seen ? known : matches).push(match);
|
|
89
93
|
}
|
|
90
94
|
|
|
91
|
-
return matches;
|
|
95
|
+
return { matches, known };
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
function isDirectoryWithinCwd(directory: string, cwd: string): boolean {
|
|
@@ -28,11 +28,26 @@ export function displayAutomaticPathExclusion(
|
|
|
28
28
|
: undefined;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
/**
|
|
31
|
+
/** Examples named in prose; structured output keeps every collected example. */
|
|
32
|
+
const MAX_PROSE_EXAMPLES = 2;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Explain which observed path was excluded even when a matching canonical source was retained.
|
|
36
|
+
* A path that is already canonical is named once.
|
|
37
|
+
*/
|
|
32
38
|
export function describeExcludedPath(
|
|
33
39
|
example: AutomaticPathExclusionDisplay["examples"][number],
|
|
34
40
|
): string {
|
|
35
|
-
return
|
|
41
|
+
return example.observedPath === example.canonicalPath
|
|
42
|
+
? `\`${example.canonicalPath}\``
|
|
43
|
+
: `observed \`${example.observedPath}\` → canonical \`${example.canonicalPath}\``;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Render the bounded ` Excluded path examples: …` suffix, or an empty string without examples. */
|
|
47
|
+
export function describeExcludedPathExamples(exclusion: AutomaticPathExclusionDisplay): string {
|
|
48
|
+
if (exclusion.examples.length === 0) return "";
|
|
49
|
+
const shown = exclusion.examples.slice(0, MAX_PROSE_EXAMPLES).map(describeExcludedPath);
|
|
50
|
+
return ` Excluded path examples: ${shown.join(", ")}.`;
|
|
36
51
|
}
|
|
37
52
|
|
|
38
53
|
/** Preserve provider failure reasons and append path explanations from typed metadata only. */
|
|
@@ -42,6 +57,5 @@ export function describePartialQuery(
|
|
|
42
57
|
cwd: string,
|
|
43
58
|
): string {
|
|
44
59
|
const exclusion = displayAutomaticPathExclusion(metadata?.automaticPathExclusion, cwd);
|
|
45
|
-
|
|
46
|
-
return `${reason} Excluded path examples: ${exclusion.examples.map(describeExcludedPath).join(", ")}.`;
|
|
60
|
+
return exclusion ? `${reason}${describeExcludedPathExamples(exclusion)}` : reason;
|
|
47
61
|
}
|
|
@@ -2,7 +2,7 @@ import type { StructuralProvider as StructuralSubstrate } from "@mrclrchtr/supi-
|
|
|
2
2
|
import type { AutomaticLspPathPolicy } from "@mrclrchtr/supi-lsp/api";
|
|
3
3
|
import type { StructuralSearchOperation } from "@mrclrchtr/supi-tree-sitter/api";
|
|
4
4
|
import type { CodeFindAstKind } from "../../tool/code_find/ast-kinds.ts";
|
|
5
|
-
import type {
|
|
5
|
+
import type { CollectionPartialReason } from "../evidence.ts";
|
|
6
6
|
import {
|
|
7
7
|
type AstScanExclusion,
|
|
8
8
|
type AstScanOperations,
|
|
@@ -46,7 +46,7 @@ export interface StructuredScanSummary {
|
|
|
46
46
|
|
|
47
47
|
export interface StructuredPatternResult {
|
|
48
48
|
readonly matches: readonly StructuredMatch[];
|
|
49
|
-
readonly partialReason:
|
|
49
|
+
readonly partialReason: CollectionPartialReason | null;
|
|
50
50
|
/** Per-file parse/analysis failures surfaced to the agent. */
|
|
51
51
|
readonly failures: readonly StructuredFailure[];
|
|
52
52
|
readonly scan: StructuredScanSummary;
|
|
@@ -190,7 +190,7 @@ export async function getStructuredPatternMatches(
|
|
|
190
190
|
|
|
191
191
|
function primaryPartialReason(
|
|
192
192
|
limitations: readonly StructuredScanLimitation[],
|
|
193
|
-
):
|
|
193
|
+
): CollectionPartialReason {
|
|
194
194
|
if (limitations.some((limitation) => limitation.reason === "timeout")) return "timeout";
|
|
195
195
|
if (limitations.some((limitation) => limitation.reason === "safety-limit")) {
|
|
196
196
|
return "safety-limit";
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
} from "@mrclrchtr/supi-code-runtime/api";
|
|
19
19
|
import type { AnchorKind } from "../../session/target-store.ts";
|
|
20
20
|
import type { AnchoredResolutionSource } from "../../types/index.ts";
|
|
21
|
+
import { createEvidenceList, type EvidenceListMetadata } from "../evidence.ts";
|
|
21
22
|
import { resolveFromStructural } from "./anchored-structural.ts";
|
|
22
23
|
import {
|
|
23
24
|
canonicalFileDeclarationKind,
|
|
@@ -133,9 +134,7 @@ async function candidatesFromSymbols(
|
|
|
133
134
|
): Promise<{
|
|
134
135
|
kind: "disambiguation";
|
|
135
136
|
candidates: DisambiguationCandidateData[];
|
|
136
|
-
|
|
137
|
-
omittedCount: number;
|
|
138
|
-
partialReason: null;
|
|
137
|
+
candidateEvidence: EvidenceListMetadata;
|
|
139
138
|
}> {
|
|
140
139
|
const candidates = await Promise.all(
|
|
141
140
|
matched.map(async (s, idx) => {
|
|
@@ -162,9 +161,7 @@ async function candidatesFromSymbols(
|
|
|
162
161
|
return {
|
|
163
162
|
kind: "disambiguation",
|
|
164
163
|
candidates,
|
|
165
|
-
|
|
166
|
-
omittedCount: 0,
|
|
167
|
-
partialReason: null,
|
|
164
|
+
candidateEvidence: createEvidenceList({ key: "target.candidates", items: candidates }).metadata,
|
|
168
165
|
};
|
|
169
166
|
}
|
|
170
167
|
|
|
@@ -21,7 +21,7 @@ interface SourceSpan {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/** Statements that bind names the file does not declare itself. */
|
|
24
|
-
interface BindingRanges {
|
|
24
|
+
export interface BindingRanges {
|
|
25
25
|
readonly imports: readonly SourceSpan[];
|
|
26
26
|
/** Specifiers of `export { … }` lists, with or without `from`. */
|
|
27
27
|
readonly exportLists: readonly SourceSpan[];
|
|
@@ -58,6 +58,18 @@ export async function collectBindingRanges(
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Whether a 1-based position lies in an import statement or an export list, where a name is
|
|
63
|
+
* bound or forwarded but not declared.
|
|
64
|
+
*/
|
|
65
|
+
export function isBindingPosition(
|
|
66
|
+
ranges: BindingRanges,
|
|
67
|
+
position: { line: number; character: number },
|
|
68
|
+
): boolean {
|
|
69
|
+
const target = { displayLine: position.line, displayCharacter: position.character };
|
|
70
|
+
return [...ranges.imports, ...ranges.exportLists].some((range) => containsTarget(range, target));
|
|
71
|
+
}
|
|
72
|
+
|
|
61
73
|
/**
|
|
62
74
|
* Split discovered declarations into the listed outline and counted omissions.
|
|
63
75
|
*
|
|
@@ -131,7 +143,10 @@ function containsLines(outer: SourceSpan, inner: SourceSpan): boolean {
|
|
|
131
143
|
return inner.startLine >= outer.startLine && inner.endLine <= outer.endLine;
|
|
132
144
|
}
|
|
133
145
|
|
|
134
|
-
function containsTarget(
|
|
146
|
+
function containsTarget(
|
|
147
|
+
range: SourceSpan,
|
|
148
|
+
target: Pick<ResolvedTargetData, "displayLine" | "displayCharacter">,
|
|
149
|
+
): boolean {
|
|
135
150
|
const { displayLine: line, displayCharacter: character } = target;
|
|
136
151
|
const afterStart =
|
|
137
152
|
line > range.startLine || (line === range.startLine && character >= range.startCharacter);
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Automatic selection among exact-name symbol matches: which matches declare the name, and how
|
|
3
|
+
* the unselected ones are disclosed.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as path from "node:path";
|
|
7
|
+
import type {
|
|
8
|
+
CodeRequestControl,
|
|
9
|
+
CodeSymbol,
|
|
10
|
+
StructuralProvider as StructuralSubstrate,
|
|
11
|
+
} from "@mrclrchtr/supi-code-runtime/api";
|
|
12
|
+
import { collectBindingRanges, isBindingPosition } from "./file-outline-omissions.ts";
|
|
13
|
+
|
|
14
|
+
/** Exact-name matches checked for import/export-list bindings; each costs a syntax query. */
|
|
15
|
+
const MAX_BINDING_CHECKS = 8;
|
|
16
|
+
const MAX_NOTE_NAMES = 3;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Drop exact-name matches that only import or re-export the name, such as the `alias` symbol
|
|
20
|
+
* tsserver reports for `export { foo } from "./foo"`. Keeps every match when the syntax
|
|
21
|
+
* provider is absent, when a file cannot be classified, or when no declaration would remain.
|
|
22
|
+
*/
|
|
23
|
+
export async function declarationsAmong(
|
|
24
|
+
exact: readonly CodeSymbol[],
|
|
25
|
+
structural: StructuralSubstrate | undefined,
|
|
26
|
+
control?: CodeRequestControl,
|
|
27
|
+
): Promise<readonly CodeSymbol[]> {
|
|
28
|
+
if (!structural || exact.length > MAX_BINDING_CHECKS) return exact;
|
|
29
|
+
const files = [...new Set(exact.map((candidate) => candidate.file))];
|
|
30
|
+
const ranges = new Map(
|
|
31
|
+
await Promise.all(
|
|
32
|
+
files.map(
|
|
33
|
+
async (file) => [file, await collectBindingRanges(file, structural, control)] as const,
|
|
34
|
+
),
|
|
35
|
+
),
|
|
36
|
+
);
|
|
37
|
+
const declared = exact.filter((candidate) => {
|
|
38
|
+
const fileRanges = ranges.get(candidate.file);
|
|
39
|
+
return (
|
|
40
|
+
!fileRanges ||
|
|
41
|
+
!isBindingPosition(fileRanges, candidate.nameAnchor ?? candidate.declarationAnchor)
|
|
42
|
+
);
|
|
43
|
+
});
|
|
44
|
+
return declared.length > 0 ? declared : exact;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Name what was passed over for the selected match: bindings of its name and partial names. */
|
|
48
|
+
export function unselectedNote(
|
|
49
|
+
candidates: readonly CodeSymbol[],
|
|
50
|
+
selected: CodeSymbol,
|
|
51
|
+
symbol: string,
|
|
52
|
+
): string | undefined {
|
|
53
|
+
const others = candidates.filter((candidate) => candidate !== selected);
|
|
54
|
+
const parts = describeOthers(others, symbol);
|
|
55
|
+
if (!parts) return undefined;
|
|
56
|
+
const subject = others.some((candidate) => candidate.name === symbol)
|
|
57
|
+
? "declaration of that name"
|
|
58
|
+
: "exact-name match";
|
|
59
|
+
return `Selected the only ${subject}; ${parts} ${others.length === 1 ? "was" : "were"} not selected.`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Name the matches left out of a candidate list that holds only declarations of the name. */
|
|
63
|
+
export function unlistedNote(
|
|
64
|
+
candidates: readonly CodeSymbol[],
|
|
65
|
+
listed: readonly CodeSymbol[],
|
|
66
|
+
symbol: string,
|
|
67
|
+
): string | undefined {
|
|
68
|
+
const others = candidates.filter((candidate) => !listed.includes(candidate));
|
|
69
|
+
const parts = describeOthers(others, symbol);
|
|
70
|
+
if (!parts) return undefined;
|
|
71
|
+
// No count: the candidate disclosure already states it.
|
|
72
|
+
return `Listing declarations named \`${symbol}\`; ${parts} ${others.length === 1 ? "is" : "are"} not listed.`;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function describeOthers(others: readonly CodeSymbol[], symbol: string): string | undefined {
|
|
76
|
+
const bindings = others.filter((candidate) => candidate.name === symbol);
|
|
77
|
+
const partial = others.filter((candidate) => candidate.name !== symbol);
|
|
78
|
+
const parts: string[] = [];
|
|
79
|
+
if (bindings.length > 0) {
|
|
80
|
+
const files = [...new Set(bindings.map((candidate) => path.basename(candidate.file)))];
|
|
81
|
+
parts.push(
|
|
82
|
+
`${count(bindings.length, "import or export-list binding")} of that name (${listed(files)})`,
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
if (partial.length > 0) {
|
|
86
|
+
const names = [...new Set(partial.map((candidate) => candidate.name))];
|
|
87
|
+
parts.push(`${count(partial.length, "partial-name match", "es")} (${listed(names)})`);
|
|
88
|
+
}
|
|
89
|
+
return parts.length > 0 ? parts.join(" and ") : undefined;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function count(n: number, noun: string, plural = "s"): string {
|
|
93
|
+
return `${n} ${noun}${n === 1 ? "" : plural}`;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function listed(values: readonly string[]): string {
|
|
97
|
+
const shown = values.slice(0, MAX_NOTE_NAMES).map((value) => `\`${value}\``);
|
|
98
|
+
if (values.length > MAX_NOTE_NAMES) shown.push(`${values.length - MAX_NOTE_NAMES} more`);
|
|
99
|
+
return shown.join(", ");
|
|
100
|
+
}
|
|
@@ -13,17 +13,16 @@ import {
|
|
|
13
13
|
type CodeSymbol,
|
|
14
14
|
isCodeRequestInterruption,
|
|
15
15
|
type SemanticProvider as SemanticSubstrate,
|
|
16
|
+
type StructuralProvider as StructuralSubstrate,
|
|
16
17
|
} from "@mrclrchtr/supi-code-runtime/api";
|
|
17
18
|
import { isWithinOrEqual } from "@mrclrchtr/supi-core/project";
|
|
18
19
|
import type { TargetSymbolKind } from "../../session/target-input.ts";
|
|
19
20
|
import type { AnchorKind } from "../../session/target-store.ts";
|
|
21
|
+
import { createEvidenceList, createPartialEvidenceList } from "../evidence.ts";
|
|
20
22
|
import { describePartialQuery } from "../search/exclusions.ts";
|
|
21
23
|
import { normalizePath } from "../search/paths.ts";
|
|
22
|
-
import
|
|
23
|
-
|
|
24
|
-
TargetCandidateCompleteness,
|
|
25
|
-
TargetOutcome,
|
|
26
|
-
} from "./types.ts";
|
|
24
|
+
import { declarationsAmong, unlistedNote, unselectedNote } from "./symbol-selection.ts";
|
|
25
|
+
import type { DisambiguationCandidateData, TargetOutcome } from "./types.ts";
|
|
27
26
|
|
|
28
27
|
const MAX_CANDIDATES = 8; // default fallback when maxResults is not provided
|
|
29
28
|
const NON_EXPORTED_KINDS = new Set(["Variable", "Field", "Property"]);
|
|
@@ -118,6 +117,8 @@ export async function resolveSymbolTarget(
|
|
|
118
117
|
exportedOnly?: boolean;
|
|
119
118
|
maxResults?: number;
|
|
120
119
|
control?: CodeRequestControl;
|
|
120
|
+
/** Syntax provider used to tell declarations from import and export-list bindings. */
|
|
121
|
+
structural?: StructuralSubstrate;
|
|
121
122
|
},
|
|
122
123
|
): Promise<TargetOutcome> {
|
|
123
124
|
const scopePath = options?.path ? normalizePath(options.path, cwd) : null;
|
|
@@ -151,7 +152,7 @@ export async function resolveSymbolTarget(
|
|
|
151
152
|
return buildCandidateOutcome({
|
|
152
153
|
kind: "kind-mismatch",
|
|
153
154
|
candidates: eligible,
|
|
154
|
-
|
|
155
|
+
discovery: candidateDiscovery(result, cwd),
|
|
155
156
|
semantic,
|
|
156
157
|
cwd,
|
|
157
158
|
maxResults: options.maxResults,
|
|
@@ -160,24 +161,28 @@ export async function resolveSymbolTarget(
|
|
|
160
161
|
});
|
|
161
162
|
}
|
|
162
163
|
return resolveCandidates({
|
|
164
|
+
symbol,
|
|
163
165
|
candidates: exactKind,
|
|
164
|
-
|
|
166
|
+
discovery: candidateDiscovery(result, cwd),
|
|
165
167
|
exclusionNote: exclusionOnlyNote(result, cwd),
|
|
166
168
|
semantic,
|
|
167
169
|
cwd,
|
|
168
170
|
maxResults: options.maxResults,
|
|
169
171
|
control: options.control,
|
|
172
|
+
structural: options.structural,
|
|
170
173
|
});
|
|
171
174
|
}
|
|
172
175
|
|
|
173
176
|
return resolveCandidates({
|
|
177
|
+
symbol,
|
|
174
178
|
candidates: eligible,
|
|
175
|
-
|
|
179
|
+
discovery: candidateDiscovery(result, cwd),
|
|
176
180
|
exclusionNote: exclusionOnlyNote(result, cwd),
|
|
177
181
|
semantic,
|
|
178
182
|
cwd,
|
|
179
183
|
maxResults: options?.maxResults,
|
|
180
184
|
control: options?.control,
|
|
185
|
+
structural: options?.structural,
|
|
181
186
|
});
|
|
182
187
|
}
|
|
183
188
|
|
|
@@ -190,43 +195,56 @@ function normalizeProviderKind(kind: string): string {
|
|
|
190
195
|
}
|
|
191
196
|
|
|
192
197
|
async function resolveCandidates(
|
|
193
|
-
options: CandidateOutcomeBase &
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
+
options: CandidateOutcomeBase & {
|
|
199
|
+
/** The queried name; one case-sensitive exact match wins over partial-name matches. */
|
|
200
|
+
symbol: string;
|
|
201
|
+
discovery: CandidateDiscovery;
|
|
202
|
+
/** Disclosure for a unique match beside policy-excluded rows. */
|
|
203
|
+
exclusionNote?: string;
|
|
204
|
+
},
|
|
198
205
|
): Promise<TargetOutcome> {
|
|
199
|
-
const {
|
|
200
|
-
candidates,
|
|
201
|
-
semantic,
|
|
202
|
-
cwd,
|
|
203
|
-
maxResults,
|
|
204
|
-
control,
|
|
205
|
-
totalCount,
|
|
206
|
-
partialReason,
|
|
207
|
-
partialMessage,
|
|
208
|
-
exclusionNote,
|
|
209
|
-
} = options;
|
|
206
|
+
const { candidates, semantic, cwd, maxResults, control, discovery, exclusionNote } = options;
|
|
210
207
|
const ranged = candidates.filter(
|
|
211
208
|
(candidate) =>
|
|
212
209
|
candidate.declarationAnchor.line > 0 || candidate.declarationAnchor.character > 0,
|
|
213
210
|
);
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
211
|
+
// Workspace-symbol providers match substrings, so a query for `foo` also returns `fooBar`.
|
|
212
|
+
const exact = ranged.filter((candidate) => candidate.name === options.symbol);
|
|
213
|
+
const complete = discovery.partialMessage === null;
|
|
214
|
+
// A row-limited answer may lack partial-name matches but holds every exact name.
|
|
215
|
+
const exactComplete = complete || discovery.exactNamesComplete;
|
|
216
|
+
const declared =
|
|
217
|
+
exactComplete && exact.length > 1
|
|
218
|
+
? await declarationsAmong(exact, options.structural, control)
|
|
219
|
+
: exact;
|
|
220
|
+
const selected =
|
|
221
|
+
complete && ranged.length === 1
|
|
222
|
+
? ranged[0]
|
|
223
|
+
: exactComplete && declared.length === 1
|
|
224
|
+
? declared[0]
|
|
225
|
+
: undefined;
|
|
226
|
+
if (selected) {
|
|
227
|
+
const resolved = resolvedTarget(await refineResolvedSymbolAnchor(selected, semantic, control));
|
|
228
|
+
// Unselected rows stay disclosed: bindings, partial-name matches, policy exclusions, and the row limit.
|
|
229
|
+
const notes = [
|
|
230
|
+
unselectedNote(candidates, selected, options.symbol),
|
|
231
|
+
exclusionNote ?? discovery.partialMessage ?? undefined,
|
|
232
|
+
].filter((note): note is string => note !== undefined);
|
|
233
|
+
return notes.length > 0 ? { ...resolved, notes } : resolved;
|
|
218
234
|
}
|
|
219
|
-
|
|
235
|
+
// Several declarations of the queried name: partial-name matches cannot be meant.
|
|
236
|
+
const listed = exactComplete && declared.length > 1 ? declared : candidates;
|
|
237
|
+
const outcome = await buildCandidateOutcome({
|
|
220
238
|
kind: "disambiguation",
|
|
221
|
-
candidates,
|
|
239
|
+
candidates: listed,
|
|
222
240
|
semantic,
|
|
223
241
|
cwd,
|
|
224
242
|
maxResults,
|
|
225
|
-
|
|
226
|
-
partialReason,
|
|
227
|
-
partialMessage,
|
|
243
|
+
discovery,
|
|
228
244
|
control,
|
|
229
245
|
});
|
|
246
|
+
const note = unlistedNote(candidates, listed, options.symbol);
|
|
247
|
+
return note ? { ...outcome, candidateNotes: [note] } : outcome;
|
|
230
248
|
}
|
|
231
249
|
|
|
232
250
|
function resolvedTarget(candidate: CodeSymbol): Extract<TargetOutcome, { kind: "resolved" }> {
|
|
@@ -256,23 +274,32 @@ interface CandidateOutcomeBase {
|
|
|
256
274
|
cwd: string;
|
|
257
275
|
maxResults?: number;
|
|
258
276
|
control?: CodeRequestControl;
|
|
277
|
+
structural?: StructuralSubstrate;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Candidate collection status before the cap: exact when the provider was
|
|
282
|
+
* complete or removed only policy-excluded rows; otherwise provider-limited.
|
|
283
|
+
*/
|
|
284
|
+
interface CandidateDiscovery {
|
|
285
|
+
readonly partialMessage: string | null;
|
|
286
|
+
/** Every exact-name declaration is present although the result is partial. */
|
|
287
|
+
readonly exactNamesComplete: boolean;
|
|
259
288
|
}
|
|
260
289
|
|
|
261
|
-
function
|
|
290
|
+
function candidateDiscovery(
|
|
262
291
|
result: Exclude<CodeQueryResult<CodeSymbol[]>, { kind: "unavailable" }>,
|
|
263
|
-
totalCount: number,
|
|
264
292
|
cwd: string,
|
|
265
|
-
):
|
|
293
|
+
): CandidateDiscovery {
|
|
266
294
|
// Policy exclusions alone remove only rows the workspace marked out of
|
|
267
295
|
// automatic scope; the retained in-policy rows are complete. Failures and
|
|
268
296
|
// coverage gaps keep the total unknown.
|
|
269
297
|
return result.kind === "partial" && result.metadata?.exclusionOnly !== true
|
|
270
298
|
? {
|
|
271
|
-
totalCount: null,
|
|
272
|
-
partialReason: "provider-limited",
|
|
273
299
|
partialMessage: describePartialQuery(result.reason, result.metadata, cwd),
|
|
300
|
+
exactNamesComplete: result.metadata?.rowLimit?.exactNamesComplete === true,
|
|
274
301
|
}
|
|
275
|
-
: {
|
|
302
|
+
: { partialMessage: null, exactNamesComplete: false };
|
|
276
303
|
}
|
|
277
304
|
|
|
278
305
|
/** Describe exclusion-only evidence so a resolved target still discloses dropped rows. */
|
|
@@ -284,9 +311,7 @@ function exclusionOnlyNote(
|
|
|
284
311
|
return describePartialQuery(result.reason, result.metadata, cwd);
|
|
285
312
|
}
|
|
286
313
|
|
|
287
|
-
type CandidateOutcomeOptions = CandidateOutcomeBase &
|
|
288
|
-
Omit<TargetCandidateCompleteness, "omittedCount"> &
|
|
289
|
-
(
|
|
314
|
+
type CandidateOutcomeOptions = CandidateOutcomeBase & { discovery: CandidateDiscovery } & (
|
|
290
315
|
| { kind: "disambiguation"; requestedKind?: never }
|
|
291
316
|
| { kind: "kind-mismatch"; requestedKind: TargetSymbolKind }
|
|
292
317
|
);
|
|
@@ -306,6 +331,7 @@ function emptySymbolOutcome(
|
|
|
306
331
|
return {
|
|
307
332
|
kind: "unavailable",
|
|
308
333
|
reason: `Symbol discovery for \`${symbol}\` is incomplete: ${describePartialQuery(result.reason, result.metadata, cwd)}`,
|
|
334
|
+
...(result.metadata?.rowLimit ? { rowLimited: true as const } : {}),
|
|
309
335
|
};
|
|
310
336
|
}
|
|
311
337
|
return {
|
|
@@ -322,17 +348,25 @@ async function buildCandidateOutcome(
|
|
|
322
348
|
options: CandidateOutcomeOptions,
|
|
323
349
|
): Promise<Extract<TargetOutcome, { kind: "disambiguation" | "kind-mismatch" }>> {
|
|
324
350
|
const cap = options.maxResults ?? MAX_CANDIDATES;
|
|
351
|
+
const { partialMessage } = options.discovery;
|
|
352
|
+
const bounded =
|
|
353
|
+
partialMessage === null
|
|
354
|
+
? createEvidenceList({ key: "target.candidates", items: options.candidates, maxResults: cap })
|
|
355
|
+
: createPartialEvidenceList({
|
|
356
|
+
key: "target.candidates",
|
|
357
|
+
items: options.candidates,
|
|
358
|
+
maxResults: cap,
|
|
359
|
+
partialReason: "provider-limited",
|
|
360
|
+
partialMessage,
|
|
361
|
+
});
|
|
325
362
|
const refined = await Promise.all(
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
363
|
+
bounded.items.map((candidate) =>
|
|
364
|
+
refineResolvedSymbolAnchor(candidate, options.semantic, options.control),
|
|
365
|
+
),
|
|
329
366
|
);
|
|
330
367
|
const common = {
|
|
331
368
|
candidates: toDisambiguationCandidates(refined, options.cwd),
|
|
332
|
-
|
|
333
|
-
omittedCount: Math.max(0, options.candidates.length - cap),
|
|
334
|
-
partialReason: options.partialReason,
|
|
335
|
-
partialMessage: options.partialMessage,
|
|
369
|
+
candidateEvidence: bounded.metadata,
|
|
336
370
|
};
|
|
337
371
|
return options.kind === "kind-mismatch"
|
|
338
372
|
? {
|
|
@@ -13,6 +13,7 @@ import type {
|
|
|
13
13
|
} from "@mrclrchtr/supi-code-runtime/api";
|
|
14
14
|
import type { TargetSymbolKind } from "../../session/target-input.ts";
|
|
15
15
|
import type { AnchorKind, TargetProviderProvenance } from "../../session/target-store.ts";
|
|
16
|
+
import type { EvidenceListMetadata } from "../evidence.ts";
|
|
16
17
|
|
|
17
18
|
export type { TargetProviderProvenance } from "../../session/target-store.ts";
|
|
18
19
|
|
|
@@ -167,16 +168,12 @@ export interface DisambiguationCandidateData {
|
|
|
167
168
|
anchorKind: AnchorKind;
|
|
168
169
|
}
|
|
169
170
|
|
|
170
|
-
/** Completeness
|
|
171
|
+
/** Completeness of a bounded candidate collection, keyed `target.candidates`. */
|
|
171
172
|
export interface TargetCandidateCompleteness {
|
|
172
|
-
/**
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
|
|
176
|
-
/** Why the provider cannot establish an exact candidate total. */
|
|
177
|
-
partialReason: "provider-limited" | null;
|
|
178
|
-
/** Provider explanation for incomplete discovery, when available. */
|
|
179
|
-
partialMessage?: string;
|
|
173
|
+
/** Candidate Evidence list metadata; consumers re-key it, never rebuild it. */
|
|
174
|
+
candidateEvidence: EvidenceListMetadata;
|
|
175
|
+
/** Matches left out of `candidates` on purpose, such as partial names beside exact ones. */
|
|
176
|
+
candidateNotes?: readonly string[];
|
|
180
177
|
}
|
|
181
178
|
|
|
182
179
|
/**
|
|
@@ -202,5 +199,10 @@ export type TargetOutcome =
|
|
|
202
199
|
requestedKind: TargetSymbolKind;
|
|
203
200
|
candidates: DisambiguationCandidateData[];
|
|
204
201
|
} & TargetCandidateCompleteness)
|
|
205
|
-
| {
|
|
202
|
+
| {
|
|
203
|
+
kind: "unavailable";
|
|
204
|
+
reason: string;
|
|
205
|
+
/** A provider row limit, not readiness, left the result incomplete; the reason names the next step. */
|
|
206
|
+
rowLimited?: true;
|
|
207
|
+
}
|
|
206
208
|
| { kind: "error"; message: string };
|