@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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as path from "node:path";
|
|
2
|
+
import { createEvidenceList, markEvidencePartial } from "../../analysis/evidence.ts";
|
|
2
3
|
import { toDisplayPath } from "../../analysis/search/paths.ts";
|
|
3
4
|
import type { InventoryEntry, WorkspaceObservation } from "../../analysis/workspace/types.ts";
|
|
4
5
|
import {
|
|
@@ -116,11 +117,9 @@ function collectionStatus(
|
|
|
116
117
|
...section,
|
|
117
118
|
status: "partial",
|
|
118
119
|
reason: state.reason,
|
|
119
|
-
evidenceLists: section.evidenceLists.map((list) =>
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
partialReason: state.partialReason,
|
|
123
|
-
})),
|
|
120
|
+
evidenceLists: section.evidenceLists.map((list) =>
|
|
121
|
+
markEvidencePartial(list, state.partialReason),
|
|
122
|
+
),
|
|
124
123
|
};
|
|
125
124
|
}
|
|
126
125
|
|
|
@@ -239,11 +238,14 @@ function directFileList(
|
|
|
239
238
|
directFiles: readonly InventoryEntry[],
|
|
240
239
|
fileLimit: number,
|
|
241
240
|
): OrientationSectionData {
|
|
242
|
-
const
|
|
243
|
-
.
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
241
|
+
const evidence = createEvidenceList({
|
|
242
|
+
key: "workspace.files",
|
|
243
|
+
items: directFiles,
|
|
244
|
+
maxResults: fileLimit,
|
|
245
|
+
});
|
|
246
|
+
const names = evidence.items.map((entry) =>
|
|
247
|
+
entry.kind === "symlink" ? `${code(entry.path)} (symlink)` : code(entry.path),
|
|
248
|
+
);
|
|
247
249
|
return {
|
|
248
250
|
key: "workspace.files",
|
|
249
251
|
title: "Direct files",
|
|
@@ -251,15 +253,7 @@ function directFileList(
|
|
|
251
253
|
reason: null,
|
|
252
254
|
confidence: "unavailable",
|
|
253
255
|
provenance: [{ source: "filesystem", detail: "included paths" }],
|
|
254
|
-
evidenceLists: [
|
|
255
|
-
{
|
|
256
|
-
key: "workspace.files",
|
|
257
|
-
totalCount: directFiles.length,
|
|
258
|
-
shownCount: names.length,
|
|
259
|
-
omittedCount: directFiles.length - names.length,
|
|
260
|
-
partialReason: null,
|
|
261
|
-
},
|
|
262
|
-
],
|
|
256
|
+
evidenceLists: [evidence.metadata],
|
|
263
257
|
items: [
|
|
264
258
|
{
|
|
265
259
|
kind: "paragraph",
|
|
@@ -4,7 +4,6 @@ import { renderEvidenceListMetadataDisclosure } from "../../analysis/evidence.ts
|
|
|
4
4
|
import { toDisplayPath } from "../../analysis/search/paths.ts";
|
|
5
5
|
import type { TargetProviderProvenance } from "../../session/target-store.ts";
|
|
6
6
|
import type { TargetWorkflowOutcome } from "../../session/target-workflow.ts";
|
|
7
|
-
import { formatPartialCandidateDisclosure } from "../result/candidate-row.ts";
|
|
8
7
|
import type { ResolveDetails } from "../result/types.ts";
|
|
9
8
|
import type { ResolveResultAssembly } from "./result.ts";
|
|
10
9
|
|
|
@@ -17,9 +16,10 @@ export function renderResolveResult(assembly: ResolveResultAssembly): string {
|
|
|
17
16
|
case "file-outline":
|
|
18
17
|
return renderFileOutline(assembly.details);
|
|
19
18
|
case "disambiguation":
|
|
20
|
-
return renderDisambiguation(assembly.details);
|
|
21
19
|
case "kind-mismatch":
|
|
22
|
-
|
|
20
|
+
if (!assembly.selection)
|
|
21
|
+
throw new Error(`Resolve ${outcome.kind} lacks a candidate selection`);
|
|
22
|
+
return assembly.selection.content;
|
|
23
23
|
case "invalid-input":
|
|
24
24
|
return `**Error:** ${outcome.message}`;
|
|
25
25
|
case "unavailable":
|
|
@@ -191,50 +191,8 @@ function appendUnknownLevelDisclosure(lines: string[], count: number): void {
|
|
|
191
191
|
);
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
function renderDisambiguation(details: ResolveDetails): string {
|
|
195
|
-
const lines = [
|
|
196
|
-
"# Multiple matches found",
|
|
197
|
-
"",
|
|
198
|
-
"Choose one handle, or narrow target.symbol with scope or symbolKind:",
|
|
199
|
-
"",
|
|
200
|
-
];
|
|
201
|
-
appendCandidates(lines, details);
|
|
202
|
-
appendDisclosure(lines, details);
|
|
203
|
-
return lines.join("\n");
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
function renderKindMismatch(details: ResolveDetails): string {
|
|
207
|
-
const lines = [
|
|
208
|
-
"# No exact symbol-kind match",
|
|
209
|
-
"",
|
|
210
|
-
`No query candidate was reported as provider kind \`${details.requestedKind ?? "unknown"}\`.`,
|
|
211
|
-
"Near matches:",
|
|
212
|
-
"",
|
|
213
|
-
];
|
|
214
|
-
appendCandidates(lines, details);
|
|
215
|
-
lines.push(
|
|
216
|
-
"",
|
|
217
|
-
"Retry without `symbolKind`, use an observed provider kind, or choose a handle explicitly.",
|
|
218
|
-
);
|
|
219
|
-
appendDisclosure(lines, details);
|
|
220
|
-
return lines.join("\n");
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
function appendCandidates(lines: string[], details: ResolveDetails): void {
|
|
224
|
-
for (const candidate of details.candidates ?? []) {
|
|
225
|
-
const kind = candidate.kind ? ` (\`${candidate.kind}\`)` : "";
|
|
226
|
-
const container = candidate.container ? ` in \`${candidate.container}\`` : "";
|
|
227
|
-
lines.push(
|
|
228
|
-
`${candidate.rank}. **${candidate.name}**${kind}${container} — \`${candidate.file}\`:${candidate.line}:${candidate.character}`,
|
|
229
|
-
` Target ID: \`${candidate.targetId}\``,
|
|
230
|
-
);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
194
|
function appendDisclosure(lines: string[], details: ResolveDetails): void {
|
|
235
195
|
const evidence = details.evidenceLists?.[0];
|
|
236
|
-
const disclosure = evidence
|
|
237
|
-
? (formatPartialCandidateDisclosure(evidence) ?? renderEvidenceListMetadataDisclosure(evidence))
|
|
238
|
-
: null;
|
|
196
|
+
const disclosure = evidence ? renderEvidenceListMetadataDisclosure(evidence) : null;
|
|
239
197
|
if (disclosure) lines.push("", disclosure);
|
|
240
198
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ConfidenceMode } from "@mrclrchtr/supi-code-runtime/api";
|
|
2
2
|
import type { EvidenceListMetadata } from "../../analysis/evidence.ts";
|
|
3
|
-
import { createEvidenceList } from "../../analysis/evidence.ts";
|
|
3
|
+
import { createEvidenceList, knownEvidenceCount } from "../../analysis/evidence.ts";
|
|
4
4
|
import { toDisplayPath } from "../../analysis/search/paths.ts";
|
|
5
5
|
import type { ResolveTargetInput } from "../../session/target-input.ts";
|
|
6
6
|
import type { TargetStoreEntry } from "../../session/target-store.ts";
|
|
@@ -11,7 +11,11 @@ import {
|
|
|
11
11
|
type ResultProvenance,
|
|
12
12
|
type ToolResultAssembly,
|
|
13
13
|
} from "../result/assembly.ts";
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
assembleCandidateSelection,
|
|
16
|
+
type CandidateSelection,
|
|
17
|
+
type SelectionCandidate,
|
|
18
|
+
} from "../result/candidate-selection.ts";
|
|
15
19
|
import { createToolDisplaySection } from "../result/display.ts";
|
|
16
20
|
import { scopedSymbolFailureMessage } from "../result/errors.ts";
|
|
17
21
|
import type {
|
|
@@ -27,6 +31,8 @@ export interface ResolveResultAssembly {
|
|
|
27
31
|
readonly assembled: ToolResultAssembly<TargetWorkflowOutcome>;
|
|
28
32
|
readonly details: ResolveDetails;
|
|
29
33
|
readonly displaySections: readonly ToolDisplaySection[];
|
|
34
|
+
/** Canonical Candidate selection for disambiguation and Symbol-kind mismatch. */
|
|
35
|
+
readonly selection: CandidateSelection<SelectionCandidate> | null;
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
interface ResolveProjection {
|
|
@@ -37,6 +43,7 @@ interface ResolveProjection {
|
|
|
37
43
|
readonly confidence: ConfidenceMode;
|
|
38
44
|
readonly evidence: EvidenceListMetadata | null;
|
|
39
45
|
readonly details: ResolveDetails;
|
|
46
|
+
readonly selection?: CandidateSelection<SelectionCandidate>;
|
|
40
47
|
}
|
|
41
48
|
|
|
42
49
|
/** Assemble resolved-target facts before markdown and TUI adapters render them. */
|
|
@@ -77,7 +84,8 @@ export function assembleResolveResult(
|
|
|
77
84
|
cwd,
|
|
78
85
|
assembled,
|
|
79
86
|
details,
|
|
80
|
-
displaySections: resolveDisplaySections(details),
|
|
87
|
+
displaySections: projection.selection?.displaySections ?? resolveDisplaySections(details),
|
|
88
|
+
selection: projection.selection ?? null,
|
|
81
89
|
});
|
|
82
90
|
}
|
|
83
91
|
|
|
@@ -125,18 +133,8 @@ function projectFileOutline(
|
|
|
125
133
|
outcome: Extract<TargetWorkflowOutcome, { kind: "file-outline" }>,
|
|
126
134
|
cwd: string,
|
|
127
135
|
): ResolveProjection {
|
|
128
|
-
const evidence = {
|
|
129
|
-
|
|
130
|
-
items: [...outcome.targets],
|
|
131
|
-
metadata: {
|
|
132
|
-
key: "resolve.targets",
|
|
133
|
-
totalCount: outcome.totalCount,
|
|
134
|
-
shownCount: outcome.targets.length,
|
|
135
|
-
omittedCount: outcome.omittedCount,
|
|
136
|
-
partialReason: outcome.partial ? ("provider-limited" as const) : null,
|
|
137
|
-
partialMessage: outcome.partial?.reason,
|
|
138
|
-
},
|
|
139
|
-
};
|
|
136
|
+
const evidence = { items: [...outcome.targets], metadata: outcome.targetEvidence };
|
|
137
|
+
const declarationCount = knownEvidenceCount(outcome.targetEvidence);
|
|
140
138
|
return {
|
|
141
139
|
key: "resolve.file-outline",
|
|
142
140
|
title: "File outline",
|
|
@@ -153,12 +151,12 @@ function projectFileOutline(
|
|
|
153
151
|
outlineErrorRanges: outcome.partial?.errorRanges,
|
|
154
152
|
outlineNotListed: outcome.notListed,
|
|
155
153
|
confidence: outcome.confidence,
|
|
156
|
-
targetCount:
|
|
157
|
-
omittedCount: evidence.metadata.omittedCount,
|
|
154
|
+
targetCount: declarationCount,
|
|
155
|
+
omittedCount: evidence.metadata.omittedCount ?? 0,
|
|
158
156
|
evidenceLists: [evidence.metadata],
|
|
159
157
|
targets: evidence.items.map((target) => toTargetDetails(target, cwd)),
|
|
160
158
|
nextQueries:
|
|
161
|
-
|
|
159
|
+
declarationCount > 0
|
|
162
160
|
? [
|
|
163
161
|
"Pass one declaration handle from the file outline as target.handle to code_graph, code_inspect, or code_refactor_plan",
|
|
164
162
|
]
|
|
@@ -171,45 +169,37 @@ function projectCandidateOutcome(
|
|
|
171
169
|
outcome: Extract<TargetWorkflowOutcome, { kind: "disambiguation" | "kind-mismatch" }>,
|
|
172
170
|
cwd: string,
|
|
173
171
|
): ResolveProjection {
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
totalCount: outcome.totalCount,
|
|
177
|
-
shownCount: outcome.candidates.length,
|
|
178
|
-
omittedCount: outcome.omittedCount,
|
|
179
|
-
partialReason: outcome.partialReason,
|
|
180
|
-
partialMessage: outcome.partialMessage,
|
|
181
|
-
};
|
|
182
|
-
const collectedCount = evidence.shownCount + (evidence.omittedCount ?? 0);
|
|
183
|
-
const mismatch = outcome.kind === "kind-mismatch";
|
|
172
|
+
const selection = assembleCandidateSelection({ outcome, key: "resolve.candidates", cwd });
|
|
173
|
+
const evidence = selection.evidence;
|
|
184
174
|
return {
|
|
185
175
|
key: "resolve.candidates",
|
|
186
|
-
title:
|
|
187
|
-
status:
|
|
188
|
-
items:
|
|
176
|
+
title: selection.title,
|
|
177
|
+
status: evidence.partialReason ? "partial" : "complete",
|
|
178
|
+
items: selection.candidates,
|
|
189
179
|
confidence: "semantic",
|
|
190
180
|
evidence,
|
|
181
|
+
selection,
|
|
191
182
|
details: {
|
|
192
183
|
resultKind: outcome.kind,
|
|
193
|
-
...(mismatch ? { requestedKind: outcome.requestedKind } : {}),
|
|
184
|
+
...(outcome.kind === "kind-mismatch" ? { requestedKind: outcome.requestedKind } : {}),
|
|
185
|
+
message: selection.message,
|
|
194
186
|
confidence: "semantic",
|
|
195
|
-
targetCount: evidence
|
|
196
|
-
omittedCount:
|
|
187
|
+
targetCount: knownEvidenceCount(evidence),
|
|
188
|
+
omittedCount: evidence.omittedCount ?? 0,
|
|
197
189
|
evidenceLists: [evidence],
|
|
198
190
|
targets: [],
|
|
199
|
-
candidates:
|
|
191
|
+
candidates: selection.candidates.map((candidate) => ({
|
|
200
192
|
targetId: candidate.targetId,
|
|
201
193
|
name: candidate.name,
|
|
202
194
|
kind: candidate.kind,
|
|
203
195
|
container: candidate.container,
|
|
204
|
-
file:
|
|
196
|
+
file: candidate.file,
|
|
205
197
|
line: candidate.line,
|
|
206
198
|
character: candidate.character,
|
|
207
199
|
rank: candidate.rank,
|
|
208
200
|
anchorKind: candidate.anchorKind,
|
|
209
201
|
})),
|
|
210
|
-
nextQueries:
|
|
211
|
-
? ["Retry without symbolKind, use an observed provider kind, or choose a near-match handle"]
|
|
212
|
-
: ["Choose one candidate handle, or narrow the symbol selector with scope or symbolKind"],
|
|
202
|
+
nextQueries: [...selection.nextQueries],
|
|
213
203
|
},
|
|
214
204
|
};
|
|
215
205
|
}
|
|
@@ -263,37 +253,21 @@ function toTargetDetails(
|
|
|
263
253
|
}
|
|
264
254
|
|
|
265
255
|
function resolveDisplaySections(details: ResolveDetails): ToolDisplaySection[] {
|
|
256
|
+
const evidence = details.evidenceLists?.[0];
|
|
257
|
+
if (!evidence) return [];
|
|
266
258
|
if (details.targets.length > 0) {
|
|
267
259
|
return [
|
|
268
260
|
createToolDisplaySection({
|
|
269
261
|
key: "resolve.targets",
|
|
270
262
|
title: "Targets",
|
|
271
263
|
items: details.targets,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
format: (target) =>
|
|
264
|
+
evidence,
|
|
265
|
+
format: (target: ResolveDetails["targets"][number]) =>
|
|
275
266
|
`${target.name ?? "anonymous"} (${target.nativeKind ?? target.kind ?? "unknown"}) — ${target.file}:${target.displayLine}:${target.displayCharacter} [${target.targetId}]`,
|
|
276
267
|
}),
|
|
277
268
|
];
|
|
278
269
|
}
|
|
279
270
|
|
|
280
|
-
if (details.candidates && details.candidates.length > 0) {
|
|
281
|
-
const evidence = details.evidenceLists?.find((entry) => entry.key === "resolve.candidates");
|
|
282
|
-
if (!evidence) return [];
|
|
283
|
-
return [
|
|
284
|
-
createToolDisplaySection({
|
|
285
|
-
key: "resolve.candidates",
|
|
286
|
-
title: "Candidates",
|
|
287
|
-
items: details.candidates,
|
|
288
|
-
totalCount: evidence.totalCount,
|
|
289
|
-
omittedCount: evidence.omittedCount,
|
|
290
|
-
partialReason: evidence.partialReason,
|
|
291
|
-
partialMessage: evidence.partialMessage,
|
|
292
|
-
format: (candidate) => formatCandidateRow(candidate, "rank-first"),
|
|
293
|
-
}),
|
|
294
|
-
];
|
|
295
|
-
}
|
|
296
|
-
|
|
297
271
|
return [];
|
|
298
272
|
}
|
|
299
273
|
|
|
@@ -329,8 +303,9 @@ export function finishResolveResult(
|
|
|
329
303
|
target?: ResolveTargetInput,
|
|
330
304
|
): CodeIntelResult {
|
|
331
305
|
if (outcome.kind === "unavailable") {
|
|
306
|
+
// A row-limit reason already names its next step; readiness recovery would contradict it.
|
|
332
307
|
const reason =
|
|
333
|
-
target && "symbol" in target && target.symbol.scope
|
|
308
|
+
target && "symbol" in target && target.symbol.scope && !outcome.rowLimited
|
|
334
309
|
? scopedSymbolFailureMessage(outcome.reason)
|
|
335
310
|
: outcome.reason;
|
|
336
311
|
throw new Error(reason);
|
|
@@ -345,19 +320,16 @@ export function finishResolveResult(
|
|
|
345
320
|
details: {
|
|
346
321
|
type: "resolve",
|
|
347
322
|
data: assembly.details,
|
|
348
|
-
status:
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
: outcome.kind === "kind-mismatch"
|
|
359
|
-
? { message: `No target matched provider kind ${outcome.requestedKind}.` }
|
|
360
|
-
: {}),
|
|
323
|
+
status: assembly.selection
|
|
324
|
+
? assembly.selection.status
|
|
325
|
+
: outcome.kind === "invalid-input"
|
|
326
|
+
? "invalid-input"
|
|
327
|
+
: "completed",
|
|
328
|
+
...(assembly.selection
|
|
329
|
+
? { message: assembly.selection.message }
|
|
330
|
+
: outcome.kind === "invalid-input"
|
|
331
|
+
? { message: outcome.message }
|
|
332
|
+
: {}),
|
|
361
333
|
displaySections: assembly.displaySections,
|
|
362
334
|
},
|
|
363
335
|
};
|
|
@@ -94,7 +94,12 @@ export function structuredResolveResult(
|
|
|
94
94
|
],
|
|
95
95
|
evidenceLists: (data.evidenceLists ?? []).map((evidence) => ({ ...evidence })),
|
|
96
96
|
nextQueries: data.nextQueries,
|
|
97
|
-
notes:
|
|
97
|
+
notes:
|
|
98
|
+
outcome.kind === "resolved"
|
|
99
|
+
? [...outcome.notes]
|
|
100
|
+
: outcome.kind === "disambiguation"
|
|
101
|
+
? [...(outcome.candidateNotes ?? [])]
|
|
102
|
+
: [],
|
|
98
103
|
...(data.message === undefined ? {} : { message: data.message }),
|
|
99
104
|
...(data.outlineFile === undefined ? {} : { file: data.outlineFile }),
|
|
100
105
|
...(data.requestedKind === undefined ? {} : { requestedKind: data.requestedKind }),
|
|
@@ -48,9 +48,7 @@ export function truncateToolContent(
|
|
|
48
48
|
return { text: `${result.content}${notice}`, truncated: true };
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
import {
|
|
52
|
-
import { tmpdir } from "node:os";
|
|
53
|
-
import { join } from "node:path";
|
|
51
|
+
import { writeSpillFile } from "@mrclrchtr/supi-core/spill";
|
|
54
52
|
import type { CodeIntelResult } from "../../types/index.ts";
|
|
55
53
|
import { boundModelContent } from "../result/model-budget.ts";
|
|
56
54
|
import type { ToolOutputTruncationDetails } from "../result/types.ts";
|
|
@@ -107,17 +105,5 @@ export function boundCodeToolResult(
|
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
function saveFullContent(content: string, toolName: string): string {
|
|
110
|
-
|
|
111
|
-
const spillPath = join(dir, `${toolName}-output.md`);
|
|
112
|
-
try {
|
|
113
|
-
writeFileSync(spillPath, content, "utf-8");
|
|
114
|
-
return spillPath;
|
|
115
|
-
} catch (error) {
|
|
116
|
-
try {
|
|
117
|
-
rmSync(dir, { recursive: true, force: true });
|
|
118
|
-
} catch {
|
|
119
|
-
/* Preserve the write error. */
|
|
120
|
-
}
|
|
121
|
-
throw error;
|
|
122
|
-
}
|
|
108
|
+
return writeSpillFile({ owner: "code-intelligence", name: `${toolName}-output.md`, content });
|
|
123
109
|
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Candidate selection: the one public result shape for target-selection
|
|
3
|
+
* outcomes (disambiguation and Symbol-kind mismatch) shared by code_graph,
|
|
4
|
+
* code_resolve, and code_orientation.
|
|
5
|
+
*
|
|
6
|
+
* The module owns the markdown, display section, status, message, and default
|
|
7
|
+
* next queries. Tools keep their own details type and structured content and
|
|
8
|
+
* may supply only recovery wording.
|
|
9
|
+
*/
|
|
10
|
+
import {
|
|
11
|
+
type EvidenceListMetadata,
|
|
12
|
+
type EvidenceNoun,
|
|
13
|
+
rekeyEvidence,
|
|
14
|
+
renderEvidenceListMetadataDisclosure,
|
|
15
|
+
} from "../../analysis/evidence.ts";
|
|
16
|
+
import { toDisplayPath } from "../../analysis/search/paths.ts";
|
|
17
|
+
import type { AnchorKind } from "../../session/target-store.ts";
|
|
18
|
+
import { createToolDisplaySection } from "./display.ts";
|
|
19
|
+
import type { ToolDisplaySection } from "./types.ts";
|
|
20
|
+
|
|
21
|
+
/** Candidate fields used by target-selection rows. */
|
|
22
|
+
export interface CandidateRowData {
|
|
23
|
+
readonly targetId: string;
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly kind: string | null;
|
|
26
|
+
readonly file: string;
|
|
27
|
+
readonly line: number;
|
|
28
|
+
readonly character: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** One target candidate as the session reports it, with an absolute file. */
|
|
32
|
+
export interface SelectionCandidate extends CandidateRowData {
|
|
33
|
+
readonly container: string | null;
|
|
34
|
+
readonly rank: number;
|
|
35
|
+
readonly anchorKind?: AnchorKind;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Target-selection outcome shared by the target-taking session workflows. */
|
|
39
|
+
export type CandidateSelectionOutcome<C extends SelectionCandidate = SelectionCandidate> =
|
|
40
|
+
| {
|
|
41
|
+
readonly kind: "disambiguation";
|
|
42
|
+
readonly candidates: readonly C[];
|
|
43
|
+
readonly candidateEvidence: EvidenceListMetadata;
|
|
44
|
+
/** Matches left out of the candidates on purpose; rendered as notes. */
|
|
45
|
+
readonly candidateNotes?: readonly string[];
|
|
46
|
+
}
|
|
47
|
+
| {
|
|
48
|
+
readonly kind: "kind-mismatch";
|
|
49
|
+
readonly requestedKind: string;
|
|
50
|
+
readonly candidates: readonly C[];
|
|
51
|
+
readonly candidateEvidence: EvidenceListMetadata;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** Public candidate evidence key for one tool. */
|
|
55
|
+
export type CandidateSelectionKey =
|
|
56
|
+
| "graph.candidates"
|
|
57
|
+
| "resolve.candidates"
|
|
58
|
+
| "orientation.candidates";
|
|
59
|
+
|
|
60
|
+
/** Inputs for {@link assembleCandidateSelection}. */
|
|
61
|
+
export interface CandidateSelectionInput<C extends SelectionCandidate> {
|
|
62
|
+
readonly outcome: CandidateSelectionOutcome<C>;
|
|
63
|
+
readonly key: CandidateSelectionKey;
|
|
64
|
+
readonly cwd: string;
|
|
65
|
+
/** Tool-specific next step replacing the default recovery wording. */
|
|
66
|
+
readonly recovery?: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Assembled candidate selection; tools project it into their own details and schema. */
|
|
70
|
+
export interface CandidateSelection<C extends SelectionCandidate> {
|
|
71
|
+
readonly content: string;
|
|
72
|
+
/** Section title: "Near matches" for a Symbol-kind mismatch, else "Candidates". */
|
|
73
|
+
readonly title: string;
|
|
74
|
+
/** Candidates with display-relative file paths, in rank order. */
|
|
75
|
+
readonly candidates: readonly C[];
|
|
76
|
+
/** Candidate Evidence list re-keyed to the tool's public key. */
|
|
77
|
+
readonly evidence: EvidenceListMetadata;
|
|
78
|
+
readonly displaySections: readonly ToolDisplaySection[];
|
|
79
|
+
/** Selection is not invalid usage, including for a Symbol-kind mismatch. */
|
|
80
|
+
readonly status: "disambiguation";
|
|
81
|
+
readonly message: string;
|
|
82
|
+
readonly nextQueries: readonly string[];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const CANDIDATE_NOUN: EvidenceNoun = { one: "candidate", other: "candidates" };
|
|
86
|
+
const DISAMBIGUATION_RECOVERY =
|
|
87
|
+
"Choose one candidate handle, or narrow the symbol selector with scope or symbolKind";
|
|
88
|
+
/**
|
|
89
|
+
* An incomplete list discloses its cause and the step that applies to it.
|
|
90
|
+
* Generic narrowing advice can contradict that step, for example by suggesting
|
|
91
|
+
* a scope the caller already set.
|
|
92
|
+
*/
|
|
93
|
+
const INCOMPLETE_DISAMBIGUATION_RECOVERY = "Choose one candidate handle";
|
|
94
|
+
const MISMATCH_RECOVERY =
|
|
95
|
+
"Retry without symbolKind, use an observed provider kind, or choose a near-match handle";
|
|
96
|
+
|
|
97
|
+
/** Assemble the canonical result for a target-selection outcome. */
|
|
98
|
+
export function assembleCandidateSelection<C extends SelectionCandidate>(
|
|
99
|
+
input: CandidateSelectionInput<C>,
|
|
100
|
+
): CandidateSelection<C> {
|
|
101
|
+
const { outcome, key, cwd } = input;
|
|
102
|
+
const mismatch = outcome.kind === "kind-mismatch";
|
|
103
|
+
const candidates = outcome.candidates.map((candidate) => ({
|
|
104
|
+
...candidate,
|
|
105
|
+
file: toDisplayPath(cwd, candidate.file),
|
|
106
|
+
}));
|
|
107
|
+
const evidence = rekeyEvidence(outcome.candidateEvidence, key);
|
|
108
|
+
const recovery =
|
|
109
|
+
input.recovery ??
|
|
110
|
+
(mismatch
|
|
111
|
+
? MISMATCH_RECOVERY
|
|
112
|
+
: evidence.partialReason === null
|
|
113
|
+
? DISAMBIGUATION_RECOVERY
|
|
114
|
+
: INCOMPLETE_DISAMBIGUATION_RECOVERY);
|
|
115
|
+
const title = mismatch ? "Near matches" : "Candidates";
|
|
116
|
+
|
|
117
|
+
const lines = mismatch
|
|
118
|
+
? [`# No target matched provider kind \`${outcome.requestedKind}\``, "", "Near matches:", ""]
|
|
119
|
+
: ["# Multiple targets match", ""];
|
|
120
|
+
for (const candidate of candidates) lines.push(formatCandidateMarkdownRow(candidate));
|
|
121
|
+
const disclosure = renderEvidenceListMetadataDisclosure(evidence, CANDIDATE_NOUN);
|
|
122
|
+
if (disclosure) lines.push("", disclosure);
|
|
123
|
+
const notes = outcome.kind === "disambiguation" ? (outcome.candidateNotes ?? []) : [];
|
|
124
|
+
for (const note of notes) lines.push("", `_Note: ${note}_`);
|
|
125
|
+
lines.push("", `${recovery}.`);
|
|
126
|
+
|
|
127
|
+
return Object.freeze({
|
|
128
|
+
content: lines.join("\n"),
|
|
129
|
+
title,
|
|
130
|
+
candidates,
|
|
131
|
+
evidence,
|
|
132
|
+
displaySections: [
|
|
133
|
+
createToolDisplaySection({
|
|
134
|
+
key,
|
|
135
|
+
title,
|
|
136
|
+
items: candidates,
|
|
137
|
+
evidence,
|
|
138
|
+
format: (candidate: C) => formatCandidateRow(candidate),
|
|
139
|
+
}),
|
|
140
|
+
],
|
|
141
|
+
status: "disambiguation" as const,
|
|
142
|
+
message: mismatch
|
|
143
|
+
? `No target matched provider kind ${outcome.requestedKind}.`
|
|
144
|
+
: "Multiple target matches require one candidate.",
|
|
145
|
+
nextQueries: [recovery],
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** Plain handle-first candidate row for TUI display sections and fallbacks. */
|
|
150
|
+
export function formatCandidateRow(candidate: CandidateRowData): string {
|
|
151
|
+
return `${candidate.targetId} — ${candidate.name} (${candidate.kind ?? "unknown"}) at ${candidate.file}:${candidate.line}:${candidate.character}`;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function formatCandidateMarkdownRow(candidate: SelectionCandidate): string {
|
|
155
|
+
const container = candidate.container ? ` in \`${candidate.container}\`` : "";
|
|
156
|
+
return `- \`${candidate.targetId}\` — **${candidate.name}** (\`${candidate.kind ?? "unknown"}\`)${container} at \`${candidate.file}\`:${candidate.line}:${candidate.character}`;
|
|
157
|
+
}
|