@mrclrchtr/supi-code-intelligence 12.0.0 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +4 -2
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-core/package.json +3 -1
- package/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
- package/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
- package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
- package/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
- package/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
- package/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
- package/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +3 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
- package/node_modules/@mrclrchtr/supi-lsp/package.json +8 -8
- package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-cache.ts +102 -47
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-host.ts +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-refresh.ts +15 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-request.ts +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +46 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-disk-stamp.ts +60 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-state.ts +3 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-sync.ts +21 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-file-state.ts +17 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-semantic-input-barrier.ts +53 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +11 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-extends.ts +2 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-path.ts +2 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-scope.ts +14 -5
- package/node_modules/@mrclrchtr/supi-lsp/src/config/typescript-module.ts +17 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/evidence.ts +42 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-client-state.ts +2 -17
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-removal-ledger.ts +52 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +40 -20
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/typescript-file-local.ts +6 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +6 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-symbol-mapper.ts +13 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostic-surface.ts +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostics.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +17 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-transition-debug.ts +11 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +2 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +3 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm +0 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm.map +6 -6
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts +7 -7
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts.map +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts +7 -7
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm +0 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm.map +5 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +5 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/kotlin/tree-sitter-kotlin.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/latex/tree-sitter-latex.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-client.ts +1 -1
- package/node_modules/fast-xml-parser/CHANGELOG.md +886 -0
- package/node_modules/fast-xml-parser/LICENSE +21 -0
- package/node_modules/fast-xml-parser/README.md +204 -0
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.d.cts +774 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/README.md +92 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/package.json +57 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityDecoder.js +644 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityEncoder.js +239 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/all-entities.js +53 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entities.js +1139 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entityTries.js +60 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.d.ts +358 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.js +29 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/CHANGELOG.md +52 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/README.md +77 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.cjs +1 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.d.cts +270 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js +2 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/package.json +77 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.d.ts +270 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.js +609 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/ignoreAttributes.js +18 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/orderedJs2Xml.js +360 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/prettifyJs2Xml.js +0 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/util.js +23 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/README.md +632 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/package.json +56 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/html.js +102 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/log.js +98 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/nosql.js +114 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/redos.js +60 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/shell.js +105 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql-strict.js +47 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql.js +95 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/svg.js +81 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/xml.js +79 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.cjs +27 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.d.ts +103 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.js +292 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/util/decode-entities.js +48 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/README.md +947 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.cjs +1 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.d.cts +725 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js +2 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/package.json +79 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Expression.js +232 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/ExpressionSet.js +225 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Matcher.js +663 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.d.ts +589 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.js +30 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/CHANGELOG.md +63 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/README.md +113 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/README.md +142 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/anynum.js +135 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/digitTable.js +116 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/package.json +42 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/package.json +36 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/strnum.js +176 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/README.md +287 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/package.json +56 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.d.ts +108 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.js +382 -0
- package/node_modules/fast-xml-parser/package.json +93 -0
- package/node_modules/fast-xml-parser/src/cli/cli.js +97 -0
- package/node_modules/fast-xml-parser/src/cli/man.js +17 -0
- package/node_modules/fast-xml-parser/src/cli/read.js +43 -0
- package/node_modules/fast-xml-parser/src/fxp.d.ts +754 -0
- package/node_modules/fast-xml-parser/src/fxp.js +14 -0
- package/node_modules/fast-xml-parser/src/ignoreAttributes.js +18 -0
- package/node_modules/fast-xml-parser/src/util.js +61 -0
- package/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +16 -0
- package/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +106 -0
- package/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +61 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +69 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +103 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +100 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +154 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +94 -0
- package/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
- package/node_modules/fast-xml-parser/src/v6/TagPath.js +81 -0
- package/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +13 -0
- package/node_modules/fast-xml-parser/src/v6/XMLParser.js +83 -0
- package/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +235 -0
- package/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +210 -0
- package/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +111 -0
- package/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +116 -0
- package/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +121 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +105 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +22 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +19 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +38 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +13 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +14 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +6 -0
- package/node_modules/fast-xml-parser/src/validator.js +518 -0
- package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +6 -0
- package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +426 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +164 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +907 -0
- package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +77 -0
- package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +177 -0
- package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +54 -0
- package/package.json +10 -8
- package/src/analysis/evidence.ts +331 -73
- package/src/analysis/health/diagnostics.ts +66 -18
- package/src/analysis/health/evidence-reason.ts +44 -0
- package/src/analysis/search/pattern.ts +3 -3
- package/src/analysis/target/anchored.ts +3 -6
- package/src/analysis/target/symbol.ts +41 -47
- package/src/analysis/target/types.ts +4 -9
- package/src/analysis/workspace/cmake-parser.ts +207 -0
- package/src/analysis/workspace/cmake.ts +141 -0
- package/src/analysis/workspace/maven.ts +310 -0
- package/src/analysis/workspace/membership.ts +100 -26
- package/src/analysis/workspace/metadata.ts +6 -1
- package/src/analysis/workspace/observe.ts +6 -0
- package/src/analysis/workspace/types.ts +11 -3
- package/src/diagnostics/coverage.ts +49 -0
- package/src/diagnostics/evidence.ts +10 -2
- package/src/session/health-workflow.ts +6 -0
- package/src/session/input/common.ts +1 -1
- package/src/session/orientation/collect.ts +42 -7
- package/src/session/orientation/context-facts.ts +3 -3
- package/src/session/orientation/context-sections.ts +13 -15
- package/src/session/orientation/facts.ts +5 -8
- package/src/session/orientation-workflow.ts +4 -19
- package/src/session/target-workflow.ts +25 -18
- package/src/tool/code_find/result.ts +5 -7
- package/src/tool/code_graph/display.ts +5 -6
- package/src/tool/code_graph/format.ts +8 -24
- package/src/tool/code_graph/result.ts +16 -75
- package/src/tool/code_graph/section.ts +21 -33
- package/src/tool/code_graph/tui.ts +10 -5
- package/src/tool/code_health/diagnostic-tui.ts +49 -0
- package/src/tool/code_health/guidance.ts +27 -0
- package/src/tool/code_health/markdown.ts +60 -8
- package/src/tool/code_health/result.ts +20 -9
- package/src/tool/code_health/structured-schema.ts +14 -0
- package/src/tool/code_health/structured.ts +7 -1
- package/src/tool/code_health/tui.ts +33 -40
- package/src/tool/code_inspect/result.ts +23 -18
- package/src/tool/code_inspect/structured.ts +2 -19
- package/src/tool/code_orientation/result.ts +53 -100
- package/src/tool/code_orientation/structured-schema.ts +16 -12
- package/src/tool/code_orientation/structured-workspace.ts +13 -7
- package/src/tool/code_orientation/structured.ts +31 -39
- package/src/tool/code_orientation/workspace-format.ts +4 -10
- package/src/tool/code_orientation/workspace-instructions.ts +4 -5
- package/src/tool/code_orientation/workspace-observations.ts +2 -2
- package/src/tool/code_orientation/workspace-output.ts +16 -7
- package/src/tool/code_orientation/workspace-projects.ts +7 -10
- package/src/tool/code_orientation/workspace-sections.ts +13 -19
- package/src/tool/code_resolve/markdown.ts +4 -46
- package/src/tool/code_resolve/result.ts +43 -72
- package/src/tool/infra/truncate.ts +2 -16
- package/src/tool/result/candidate-selection.ts +141 -0
- package/src/tool/result/display.ts +41 -45
- package/src/tool/result/errors.ts +1 -0
- package/src/tool/result/model-budget.ts +26 -1
- package/src/tool/result/refactor.ts +11 -8
- package/src/tool/result/structured.ts +2 -1
- package/src/tool/result/types.ts +9 -8
- package/src/tool/schemas.ts +15 -20
- package/src/ui/footer.ts +2 -4
- package/src/ui/status-presentation.ts +4 -7
- package/src/ui/tui/candidate-selection.ts +40 -95
- package/src/ui/tui/common.ts +16 -70
- package/src/ui/tui/display.ts +6 -24
- package/src/tool/result/candidate-row.ts +0 -49
|
@@ -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
|
|
|
@@ -345,19 +319,16 @@ export function finishResolveResult(
|
|
|
345
319
|
details: {
|
|
346
320
|
type: "resolve",
|
|
347
321
|
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
|
-
: {}),
|
|
322
|
+
status: assembly.selection
|
|
323
|
+
? assembly.selection.status
|
|
324
|
+
: outcome.kind === "invalid-input"
|
|
325
|
+
? "invalid-input"
|
|
326
|
+
: "completed",
|
|
327
|
+
...(assembly.selection
|
|
328
|
+
? { message: assembly.selection.message }
|
|
329
|
+
: outcome.kind === "invalid-input"
|
|
330
|
+
? { message: outcome.message }
|
|
331
|
+
: {}),
|
|
361
332
|
displaySections: assembly.displaySections,
|
|
362
333
|
},
|
|
363
334
|
};
|
|
@@ -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,141 @@
|
|
|
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
|
+
}
|
|
45
|
+
| {
|
|
46
|
+
readonly kind: "kind-mismatch";
|
|
47
|
+
readonly requestedKind: string;
|
|
48
|
+
readonly candidates: readonly C[];
|
|
49
|
+
readonly candidateEvidence: EvidenceListMetadata;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** Public candidate evidence key for one tool. */
|
|
53
|
+
export type CandidateSelectionKey =
|
|
54
|
+
| "graph.candidates"
|
|
55
|
+
| "resolve.candidates"
|
|
56
|
+
| "orientation.candidates";
|
|
57
|
+
|
|
58
|
+
/** Inputs for {@link assembleCandidateSelection}. */
|
|
59
|
+
export interface CandidateSelectionInput<C extends SelectionCandidate> {
|
|
60
|
+
readonly outcome: CandidateSelectionOutcome<C>;
|
|
61
|
+
readonly key: CandidateSelectionKey;
|
|
62
|
+
readonly cwd: string;
|
|
63
|
+
/** Tool-specific next step replacing the default recovery wording. */
|
|
64
|
+
readonly recovery?: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Assembled candidate selection; tools project it into their own details and schema. */
|
|
68
|
+
export interface CandidateSelection<C extends SelectionCandidate> {
|
|
69
|
+
readonly content: string;
|
|
70
|
+
/** Section title: "Near matches" for a Symbol-kind mismatch, else "Candidates". */
|
|
71
|
+
readonly title: string;
|
|
72
|
+
/** Candidates with display-relative file paths, in rank order. */
|
|
73
|
+
readonly candidates: readonly C[];
|
|
74
|
+
/** Candidate Evidence list re-keyed to the tool's public key. */
|
|
75
|
+
readonly evidence: EvidenceListMetadata;
|
|
76
|
+
readonly displaySections: readonly ToolDisplaySection[];
|
|
77
|
+
/** Selection is not invalid usage, including for a Symbol-kind mismatch. */
|
|
78
|
+
readonly status: "disambiguation";
|
|
79
|
+
readonly message: string;
|
|
80
|
+
readonly nextQueries: readonly string[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const CANDIDATE_NOUN: EvidenceNoun = { one: "candidate", other: "candidates" };
|
|
84
|
+
const DISAMBIGUATION_RECOVERY =
|
|
85
|
+
"Choose one candidate handle, or narrow the symbol selector with scope or symbolKind";
|
|
86
|
+
const MISMATCH_RECOVERY =
|
|
87
|
+
"Retry without symbolKind, use an observed provider kind, or choose a near-match handle";
|
|
88
|
+
|
|
89
|
+
/** Assemble the canonical result for a target-selection outcome. */
|
|
90
|
+
export function assembleCandidateSelection<C extends SelectionCandidate>(
|
|
91
|
+
input: CandidateSelectionInput<C>,
|
|
92
|
+
): CandidateSelection<C> {
|
|
93
|
+
const { outcome, key, cwd } = input;
|
|
94
|
+
const mismatch = outcome.kind === "kind-mismatch";
|
|
95
|
+
const candidates = outcome.candidates.map((candidate) => ({
|
|
96
|
+
...candidate,
|
|
97
|
+
file: toDisplayPath(cwd, candidate.file),
|
|
98
|
+
}));
|
|
99
|
+
const evidence = rekeyEvidence(outcome.candidateEvidence, key);
|
|
100
|
+
const recovery = input.recovery ?? (mismatch ? MISMATCH_RECOVERY : DISAMBIGUATION_RECOVERY);
|
|
101
|
+
const title = mismatch ? "Near matches" : "Candidates";
|
|
102
|
+
|
|
103
|
+
const lines = mismatch
|
|
104
|
+
? [`# No target matched provider kind \`${outcome.requestedKind}\``, "", "Near matches:", ""]
|
|
105
|
+
: ["# Multiple targets match", ""];
|
|
106
|
+
for (const candidate of candidates) lines.push(formatCandidateMarkdownRow(candidate));
|
|
107
|
+
const disclosure = renderEvidenceListMetadataDisclosure(evidence, CANDIDATE_NOUN);
|
|
108
|
+
if (disclosure) lines.push("", disclosure);
|
|
109
|
+
lines.push("", `${recovery}.`);
|
|
110
|
+
|
|
111
|
+
return Object.freeze({
|
|
112
|
+
content: lines.join("\n"),
|
|
113
|
+
title,
|
|
114
|
+
candidates,
|
|
115
|
+
evidence,
|
|
116
|
+
displaySections: [
|
|
117
|
+
createToolDisplaySection({
|
|
118
|
+
key,
|
|
119
|
+
title,
|
|
120
|
+
items: candidates,
|
|
121
|
+
evidence,
|
|
122
|
+
format: (candidate: C) => formatCandidateRow(candidate),
|
|
123
|
+
}),
|
|
124
|
+
],
|
|
125
|
+
status: "disambiguation" as const,
|
|
126
|
+
message: mismatch
|
|
127
|
+
? `No target matched provider kind ${outcome.requestedKind}.`
|
|
128
|
+
: "Multiple target matches require one candidate.",
|
|
129
|
+
nextQueries: [recovery],
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** Plain handle-first candidate row for TUI display sections and fallbacks. */
|
|
134
|
+
export function formatCandidateRow(candidate: CandidateRowData): string {
|
|
135
|
+
return `${candidate.targetId} — ${candidate.name} (${candidate.kind ?? "unknown"}) at ${candidate.file}:${candidate.line}:${candidate.character}`;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function formatCandidateMarkdownRow(candidate: SelectionCandidate): string {
|
|
139
|
+
const container = candidate.container ? ` in \`${candidate.container}\`` : "";
|
|
140
|
+
return `- \`${candidate.targetId}\` — **${candidate.name}** (\`${candidate.kind ?? "unknown"}\`)${container} at \`${candidate.file}\`:${candidate.line}:${candidate.character}`;
|
|
141
|
+
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
describeEvidenceList,
|
|
3
|
+
type EvidenceListMetadata,
|
|
4
|
+
readEvidenceListFacts,
|
|
5
|
+
toEvidenceListFacts,
|
|
6
|
+
} from "../../analysis/evidence.ts";
|
|
1
7
|
import type { ToolDisplaySection } from "./types.ts";
|
|
2
8
|
|
|
3
9
|
/** Maximum number of rows shown for one expanded TUI section. */
|
|
@@ -8,49 +14,53 @@ export const MAX_TUI_DISPLAY_LINE_LENGTH = 240;
|
|
|
8
14
|
|
|
9
15
|
/** Inputs for one bounded structured TUI section. */
|
|
10
16
|
export interface ToolDisplaySectionInput<T> {
|
|
11
|
-
key
|
|
17
|
+
/** Section key; defaults to the evidence key. */
|
|
18
|
+
key?: string;
|
|
12
19
|
title: string;
|
|
20
|
+
/** Rows to show; the view may hide some as Display omissions. */
|
|
13
21
|
items: readonly T[];
|
|
22
|
+
/** Canonical Evidence list metadata this section previews; only constructors produce it. */
|
|
23
|
+
evidence: EvidenceListMetadata;
|
|
14
24
|
format: (item: T) => string;
|
|
15
|
-
totalCount?: number | null;
|
|
16
|
-
omittedCount?: number | null;
|
|
17
|
-
partialReason?: string | null;
|
|
18
|
-
/** Provider explanation for incomplete collection, when available. */
|
|
19
|
-
partialMessage?: string;
|
|
20
25
|
maxItems?: number;
|
|
21
26
|
/** Explicit content-count meaning when display rows are not individual Evidence atoms. */
|
|
22
27
|
preview?: ToolDisplaySection["preview"];
|
|
23
28
|
}
|
|
24
29
|
|
|
25
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Build a bounded, serializable TUI section. Evidence facts are copied
|
|
32
|
+
* unchanged; rows the view cap hides are reported as a separate Display
|
|
33
|
+
* omission and never merged into evidence counts.
|
|
34
|
+
*/
|
|
26
35
|
export function createToolDisplaySection<T>(input: ToolDisplaySectionInput<T>): ToolDisplaySection {
|
|
27
36
|
const maxItems = Math.max(0, input.maxItems ?? MAX_TUI_DISPLAY_ITEMS);
|
|
28
37
|
const items = input.items.slice(0, maxItems);
|
|
29
|
-
const lines = items.map((item) => truncateDisplayText(input.format(item)));
|
|
30
|
-
const displayOmittedCount = Math.max(0, input.items.length - items.length);
|
|
31
|
-
let totalCount: number | null;
|
|
32
|
-
if (input.totalCount === undefined) totalCount = input.items.length;
|
|
33
|
-
else totalCount = input.totalCount;
|
|
34
|
-
const omittedCount =
|
|
35
|
-
totalCount === null
|
|
36
|
-
? input.omittedCount === null || input.omittedCount === undefined
|
|
37
|
-
? displayOmittedCount || null
|
|
38
|
-
: input.omittedCount + displayOmittedCount
|
|
39
|
-
: Math.max(0, totalCount - lines.length);
|
|
40
|
-
|
|
41
38
|
return {
|
|
42
|
-
key: input.key,
|
|
39
|
+
key: input.key ?? input.evidence.key,
|
|
43
40
|
title: input.title,
|
|
44
|
-
lines,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
omittedCount,
|
|
48
|
-
partialReason: input.partialReason ?? null,
|
|
49
|
-
...(input.partialMessage === undefined ? {} : { partialMessage: input.partialMessage }),
|
|
41
|
+
lines: items.map((item) => truncateDisplayText(input.format(item))),
|
|
42
|
+
evidence: toEvidenceListFacts(input.evidence),
|
|
43
|
+
displayOmittedCount: input.items.length - items.length,
|
|
50
44
|
...(input.preview ? { preview: { ...input.preview } } : {}),
|
|
51
45
|
};
|
|
52
46
|
}
|
|
53
47
|
|
|
48
|
+
/** Canonical Display omission phrase, e.g. `5 rows hidden in view`; null when none. */
|
|
49
|
+
export function describeDisplayOmission(count: number, unit = "row"): string | null {
|
|
50
|
+
return count > 0 ? `${count} ${unit}${count === 1 ? "" : "s"} hidden in view` : null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Canonical bounds suffix for one TUI section title, e.g. ` (3 of 5; 2 omitted)`. */
|
|
54
|
+
export function formatDisplaySectionBounds(section: ToolDisplaySection): string {
|
|
55
|
+
const unit = section.preview?.unit;
|
|
56
|
+
const parts = [
|
|
57
|
+
section.preview?.evidenceSummary ?? (unit ? null : describeEvidenceList(section.evidence)),
|
|
58
|
+
unit ? `${section.lines.length} preview ${unit}${section.lines.length === 1 ? "" : "s"}` : null,
|
|
59
|
+
describeDisplayOmission(section.displayOmittedCount, unit ? `preview ${unit}` : "row"),
|
|
60
|
+
].filter((part): part is string => Boolean(part));
|
|
61
|
+
return parts.length ? ` (${parts.join("; ")})` : "";
|
|
62
|
+
}
|
|
63
|
+
|
|
54
64
|
/** Keep structured TUI rows readable without parsing or emitting Markdown. */
|
|
55
65
|
export function truncateDisplayText(
|
|
56
66
|
value: string,
|
|
@@ -72,15 +82,14 @@ export function readToolDisplaySections(value: unknown): ToolDisplaySection[] {
|
|
|
72
82
|
return value.flatMap((entry) => {
|
|
73
83
|
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) return [];
|
|
74
84
|
const record = entry as Record<string, unknown>;
|
|
85
|
+
const evidence = readEvidenceListFacts(record.evidence);
|
|
75
86
|
if (
|
|
76
87
|
typeof record.key !== "string" ||
|
|
77
88
|
typeof record.title !== "string" ||
|
|
78
89
|
!Array.isArray(record.lines) ||
|
|
79
90
|
!record.lines.every((line) => typeof line === "string") ||
|
|
80
|
-
!
|
|
81
|
-
!
|
|
82
|
-
!isNullableCount(record.omittedCount) ||
|
|
83
|
-
!isNullableString(record.partialReason)
|
|
91
|
+
!evidence ||
|
|
92
|
+
!isCount(record.displayOmittedCount)
|
|
84
93
|
) {
|
|
85
94
|
return [];
|
|
86
95
|
}
|
|
@@ -92,13 +101,8 @@ export function readToolDisplaySections(value: unknown): ToolDisplaySection[] {
|
|
|
92
101
|
lines: record.lines
|
|
93
102
|
.slice(0, MAX_TUI_DISPLAY_ITEMS)
|
|
94
103
|
.map((line) => truncateDisplayText(line)),
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
omittedCount: record.omittedCount,
|
|
98
|
-
partialReason: record.partialReason,
|
|
99
|
-
...(typeof record.partialMessage === "string"
|
|
100
|
-
? { partialMessage: record.partialMessage }
|
|
101
|
-
: {}),
|
|
104
|
+
evidence,
|
|
105
|
+
displayOmittedCount: record.displayOmittedCount,
|
|
102
106
|
...(preview ? { preview } : {}),
|
|
103
107
|
},
|
|
104
108
|
];
|
|
@@ -120,11 +124,3 @@ function readPreview(value: unknown): ToolDisplaySection["preview"] {
|
|
|
120
124
|
function isCount(value: unknown): value is number {
|
|
121
125
|
return typeof value === "number" && Number.isInteger(value) && value >= 0;
|
|
122
126
|
}
|
|
123
|
-
|
|
124
|
-
function isNullableCount(value: unknown): value is number | null {
|
|
125
|
-
return value === null || isCount(value);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function isNullableString(value: unknown): value is string | null {
|
|
129
|
-
return value === null || typeof value === "string";
|
|
130
|
-
}
|
|
@@ -118,6 +118,7 @@ export function healthErrorResult(content: string, reason?: string): CodeIntelRe
|
|
|
118
118
|
serverInventoryAvailable: false,
|
|
119
119
|
serverInventoryScope: "workspace",
|
|
120
120
|
diagnosticObservation: { kind: "not-requested", entries: [] },
|
|
121
|
+
diagnosticCoverage: null,
|
|
121
122
|
refresh: {
|
|
122
123
|
kind: "not-attempted",
|
|
123
124
|
reason: reason ?? content,
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
import { classifyDiagnosticCoverage, type DiagnosticCoverage } from "../../diagnostics/coverage.ts";
|
|
2
|
+
import type { HealthDiagnosticScope } from "../../session/health-types.ts";
|
|
1
3
|
import type { CodeIntelResult } from "../../types/index.ts";
|
|
4
|
+
import {
|
|
5
|
+
DIAGNOSTIC_NEXT_ACTION,
|
|
6
|
+
isPassiveTrackedSnapshot,
|
|
7
|
+
PASSIVE_SNAPSHOT_NOTE,
|
|
8
|
+
} from "../code_health/guidance.ts";
|
|
2
9
|
import { formatSemanticHealthState } from "../code_health/semantic-state.ts";
|
|
3
10
|
import type { HealthDetails, SearchDetails } from "./types.ts";
|
|
4
11
|
|
|
@@ -168,6 +175,21 @@ function searchFacts(data: SearchDetails): string[] {
|
|
|
168
175
|
return lines;
|
|
169
176
|
}
|
|
170
177
|
|
|
178
|
+
/** Keep the zero-coverage and passive-snapshot guidance when the full markdown is truncated. */
|
|
179
|
+
function coverageNote(
|
|
180
|
+
coverage: DiagnosticCoverage,
|
|
181
|
+
scope: HealthDiagnosticScope,
|
|
182
|
+
refresh: HealthDetails["refresh"],
|
|
183
|
+
): string | null {
|
|
184
|
+
if (coverage === "none") {
|
|
185
|
+
return `No source diagnostics checked; this is not a clean result. Next: ${DIAGNOSTIC_NEXT_ACTION}.`;
|
|
186
|
+
}
|
|
187
|
+
if (coverage === "confirmed" && isPassiveTrackedSnapshot(scope, refresh)) {
|
|
188
|
+
return `${PASSIVE_SNAPSHOT_NOTE}.`;
|
|
189
|
+
}
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
|
|
171
193
|
function healthFacts(data: HealthDetails): string[] {
|
|
172
194
|
const observation = data.diagnosticObservation;
|
|
173
195
|
const lines = [
|
|
@@ -178,10 +200,13 @@ function healthFacts(data: HealthDetails): string[] {
|
|
|
178
200
|
if ("reason" in data.refresh) lines.push(`Refresh reason: ${data.refresh.reason}`);
|
|
179
201
|
if (observation.kind !== "not-requested") {
|
|
180
202
|
const scope = observation.scope;
|
|
203
|
+
const coverage = classifyDiagnosticCoverage(observation);
|
|
181
204
|
lines.push(
|
|
182
205
|
`Diagnostics: ${observation.kind}; ${scope.kind === "file" ? `file=${scope.path}` : `tracked-file snapshot; filter=${scope.filter ?? "none"}; not workspace-wide verification`}.`,
|
|
183
|
-
`Diagnostic coverage: requested=${observation.evidence.requested}, confirmed=${observation.evidence.confirmed}, unconfirmed=${observation.evidence.unconfirmed}, failed=${observation.evidence.failed}, removed=${observation.evidence.removed}.`,
|
|
206
|
+
`Diagnostic coverage: ${coverage}; requested=${observation.evidence.requested}, confirmed=${observation.evidence.confirmed}, unconfirmed=${observation.evidence.unconfirmed}, failed=${observation.evidence.failed}, removed=${observation.evidence.removed}.`,
|
|
184
207
|
);
|
|
208
|
+
const note = coverageNote(coverage, scope, data.refresh);
|
|
209
|
+
if (note) lines.push(note);
|
|
185
210
|
if ("reason" in observation) lines.push(`Diagnostic limitation: ${observation.reason}`);
|
|
186
211
|
if (observation.scopeStatus)
|
|
187
212
|
lines.push(`File scope status: ${JSON.stringify(observation.scopeStatus)}`);
|