@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
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
type ToolResult,
|
|
20
20
|
} from "../../ui/tui/common.ts";
|
|
21
21
|
import {
|
|
22
|
+
describeDisplayOmission,
|
|
22
23
|
MAX_TUI_DISPLAY_ITEMS,
|
|
23
24
|
readToolDisplaySections,
|
|
24
25
|
truncateDisplayText,
|
|
@@ -182,11 +183,15 @@ function sectionSummary(
|
|
|
182
183
|
): string {
|
|
183
184
|
if (section.unavailable) return `${section.label}: unavailable`;
|
|
184
185
|
if (!metadata) return `${section.label}: evidence unavailable`;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
?
|
|
188
|
-
|
|
189
|
-
|
|
186
|
+
const summary = formatGraphEvidence(
|
|
187
|
+
metadata,
|
|
188
|
+
section.rel === "callees" ? "call sites" : "locations",
|
|
189
|
+
section.externalCount,
|
|
190
|
+
);
|
|
191
|
+
// View-hidden rows are a Display omission; the evidence counts are unchanged.
|
|
192
|
+
const hiddenPhrase = describeDisplayOmission(display?.displayOmittedCount ?? 0);
|
|
193
|
+
const hidden = hiddenPhrase ? `; ${hiddenPhrase}` : "";
|
|
194
|
+
return `${section.label}: ${summary}${hidden}`;
|
|
190
195
|
}
|
|
191
196
|
|
|
192
197
|
function readSections(value: unknown): SectionView[] {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** Diagnostic-section readers and empty-result summary for the code_health TUI. */
|
|
2
|
+
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
3
|
+
import { Text } from "@earendil-works/pi-tui";
|
|
4
|
+
import { formatDiagnosticEvidence, withDiagnosticScope } from "./scope.ts";
|
|
5
|
+
|
|
6
|
+
/** An empty entry list is clean only when the shared coverage classification is `confirmed`. */
|
|
7
|
+
export function buildEmptyDiagnosticSummary(
|
|
8
|
+
data: Record<string, unknown> | null,
|
|
9
|
+
theme: Theme,
|
|
10
|
+
): Text {
|
|
11
|
+
const coverage = data?.diagnosticCoverage;
|
|
12
|
+
if (coverage === "none") {
|
|
13
|
+
const files = diagnosticScopeKind(data) === "file" ? "requested" : "tracked";
|
|
14
|
+
const label = `No source diagnostics checked (0 ${files} files)`;
|
|
15
|
+
return new Text(theme.fg("dim", withDiagnosticScope(label, data)), 0, 0);
|
|
16
|
+
}
|
|
17
|
+
if (coverage === "incomplete") {
|
|
18
|
+
const counts = formatDiagnosticEvidence(readDiagnosticEvidence(data));
|
|
19
|
+
const label = `Diagnostic evidence incomplete${counts ? ` (${counts})` : ""}`;
|
|
20
|
+
return new Text(theme.fg("warning", withDiagnosticScope(label, data)), 0, 0);
|
|
21
|
+
}
|
|
22
|
+
return new Text(
|
|
23
|
+
theme.fg("success", withDiagnosticScope(diagnosticEmptySummary(data), data)),
|
|
24
|
+
0,
|
|
25
|
+
0,
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function diagnosticEmptySummary(data: Record<string, unknown> | null): string {
|
|
30
|
+
return diagnosticScopeKind(data) === "file"
|
|
31
|
+
? "No errors or warnings for file"
|
|
32
|
+
: "No reported issues in tracked files";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function diagnosticScopeKind(data: Record<string, unknown> | null): string | null {
|
|
36
|
+
const observation = readRecord(data?.diagnosticObservation);
|
|
37
|
+
const scope = readRecord(observation?.scope);
|
|
38
|
+
return typeof scope?.kind === "string" ? scope.kind : null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function readDiagnosticEvidence(
|
|
42
|
+
data: Record<string, unknown> | null,
|
|
43
|
+
): Record<string, unknown> | null {
|
|
44
|
+
return readRecord(readRecord(data?.diagnosticObservation)?.evidence);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function readRecord(value: unknown): Record<string, unknown> | null {
|
|
48
|
+
return typeof value === "object" && value !== null ? (value as Record<string, unknown>) : null;
|
|
49
|
+
}
|
|
@@ -1,6 +1,33 @@
|
|
|
1
|
+
import type { HealthDiagnosticScope, HealthRefreshState } from "../../session/health-types.ts";
|
|
2
|
+
|
|
1
3
|
export const toolDescription =
|
|
2
4
|
"Report live diagnostics and language-server health. Use refresh:true when you need fresh diagnostic evidence; without it, diagnostics may be a tracked-file snapshot. Diagnostic snapshots do not prove that the whole workspace is clean; server inventory and route-status counts are always workspace-wide.";
|
|
3
5
|
|
|
4
6
|
export const promptSnippet = "check live diagnostics and language-server health";
|
|
5
7
|
|
|
6
8
|
export const promptGuidelines: string[] = [];
|
|
9
|
+
|
|
10
|
+
/** Next action for missing diagnostic evidence: file-level LSP check versus project-wide compiler check. */
|
|
11
|
+
export const DIAGNOSTIC_NEXT_ACTION =
|
|
12
|
+
"for a file-level LSP check, call `code_health` with `scope` set to that file and `refresh: true`; for project-wide validation, run the project's own typecheck or build";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Exact-file scopes request live diagnostics; only a tracked-file snapshot read without a refresh
|
|
16
|
+
* in this call can lag edits made outside Pi.
|
|
17
|
+
*/
|
|
18
|
+
export function isPassiveTrackedSnapshot(
|
|
19
|
+
scope: HealthDiagnosticScope,
|
|
20
|
+
refresh: HealthRefreshState,
|
|
21
|
+
): boolean {
|
|
22
|
+
return (
|
|
23
|
+
scope.kind === "tracked-files" && refresh.kind !== "completed" && refresh.kind !== "failed"
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A passive tracked-file snapshot reflects the last synchronization. Files whose disk metadata
|
|
29
|
+
* changed since then are already reported as unconfirmed; this note covers what a stat cannot
|
|
30
|
+
* show: effects of those edits on other files and same-size rewrites within one timestamp tick.
|
|
31
|
+
*/
|
|
32
|
+
export const PASSIVE_SNAPSHOT_NOTE =
|
|
33
|
+
"This tracked-file snapshot reflects the last LSP synchronization; files changed on disk since then are unconfirmed, but effects of outside edits on other files may not be included. Use `refresh: true` for current evidence";
|
|
@@ -7,7 +7,13 @@ import {
|
|
|
7
7
|
formatProjectServerRouteSummary,
|
|
8
8
|
formatProjectServerStatusReason,
|
|
9
9
|
} from "../../analysis/health/server-status.ts";
|
|
10
|
+
import { classifyDiagnosticCoverage } from "../../diagnostics/coverage.ts";
|
|
10
11
|
import { makeRelative, renderFileScopeStatus } from "./file-scope-markdown.ts";
|
|
12
|
+
import {
|
|
13
|
+
DIAGNOSTIC_NEXT_ACTION,
|
|
14
|
+
isPassiveTrackedSnapshot,
|
|
15
|
+
PASSIVE_SNAPSHOT_NOTE,
|
|
16
|
+
} from "./guidance.ts";
|
|
11
17
|
import {
|
|
12
18
|
formatProcessCrashRecovery,
|
|
13
19
|
formatRefreshElapsed,
|
|
@@ -287,22 +293,68 @@ function renderDiagnosticObservation(lines: string[], data: HealthData, cwd: str
|
|
|
287
293
|
}
|
|
288
294
|
return;
|
|
289
295
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
296
|
+
const coverage = classifyDiagnosticCoverage(observation);
|
|
297
|
+
if (coverage === "none") {
|
|
298
|
+
renderNoDiagnosticEvidence(lines, observation);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
if (coverage === "incomplete") {
|
|
302
|
+
renderIncompleteDiagnosticEvidence(lines, data, observation, cwd);
|
|
297
303
|
return;
|
|
298
304
|
}
|
|
299
305
|
if (observation.entries.length === 0) {
|
|
300
|
-
lines.push(
|
|
306
|
+
lines.push(confirmedCleanText(observation.scope, observation.evidence.confirmed, cwd));
|
|
307
|
+
} else {
|
|
308
|
+
renderDiagnosticEntries(lines, data, cwd);
|
|
309
|
+
}
|
|
310
|
+
if (isPassiveTrackedSnapshot(observation.scope, data.refresh)) {
|
|
311
|
+
// A blank line keeps the note out of the preceding diagnostic list item.
|
|
312
|
+
lines.push("", `${PASSIVE_SNAPSHOT_NOTE}.`);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
type CollectedObservation = Extract<HealthData["diagnostics"], { kind: "completed" | "partial" }>;
|
|
317
|
+
|
|
318
|
+
/** Zero requested files: nothing was checked, so no clean wording is allowed. */
|
|
319
|
+
function renderNoDiagnosticEvidence(lines: string[], observation: CollectedObservation): void {
|
|
320
|
+
const files = observation.scope.kind === "file" ? "requested" : "tracked";
|
|
321
|
+
lines.push(
|
|
322
|
+
`No source diagnostics checked (0 ${files} files). Running servers and source discovery are not diagnostic confirmation.`,
|
|
323
|
+
);
|
|
324
|
+
if (observation.kind === "partial") lines.push(`Limitation: ${asSentence(observation.reason)}`);
|
|
325
|
+
lines.push(`Next: ${DIAGNOSTIC_NEXT_ACTION}.`);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/** Some requested files lack confirmation: keep reported messages visible as partial results. */
|
|
329
|
+
function renderIncompleteDiagnosticEvidence(
|
|
330
|
+
lines: string[],
|
|
331
|
+
data: HealthData,
|
|
332
|
+
observation: CollectedObservation,
|
|
333
|
+
cwd: string,
|
|
334
|
+
): void {
|
|
335
|
+
const { confirmed, requested, removed } = observation.evidence;
|
|
336
|
+
lines.push(
|
|
337
|
+
observation.kind === "partial"
|
|
338
|
+
? `Diagnostics partially collected — ${asSentence(observation.reason)}`
|
|
339
|
+
: `Diagnostic evidence is incomplete — ${confirmed} of ${requested} requested file${plural(requested)} confirmed${removed > 0 ? `, ${removed} removed` : ""}.`,
|
|
340
|
+
);
|
|
341
|
+
if (observation.entries.length === 0) {
|
|
342
|
+
lines.push("No errors or warnings were reported, but this is not a clean result.");
|
|
301
343
|
return;
|
|
302
344
|
}
|
|
345
|
+
lines.push("");
|
|
346
|
+
lines.push("Partial results:");
|
|
303
347
|
renderDiagnosticEntries(lines, data, cwd);
|
|
304
348
|
}
|
|
305
349
|
|
|
350
|
+
function confirmedCleanText(scope: HealthDiagnosticScope, confirmed: number, cwd: string): string {
|
|
351
|
+
if (scope.kind === "file") {
|
|
352
|
+
return `No errors or warnings in confirmed file \`${makeRelative(cwd, scope.path)}\`. This is a file-level LSP check, not project-wide validation.`;
|
|
353
|
+
}
|
|
354
|
+
const under = scope.filter ? ` under \`${makeRelative(cwd, scope.filter)}\`` : "";
|
|
355
|
+
return `No errors or warnings in ${confirmed} confirmed tracked file${plural(confirmed)}${under}. Untracked files were not checked; run the project's own typecheck or build for project-wide validation.`;
|
|
356
|
+
}
|
|
357
|
+
|
|
306
358
|
function currentRefreshAttempt(data: HealthData): HealthRefreshAttempt | null {
|
|
307
359
|
return data.refresh.kind === "completed" || data.refresh.kind === "failed" ? data.refresh : null;
|
|
308
360
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ConfidenceMode } from "@mrclrchtr/supi-code-runtime/api";
|
|
2
|
+
import { createEvidenceList, createPartialEvidenceList } from "../../analysis/evidence.ts";
|
|
2
3
|
import {
|
|
3
4
|
countProjectServerRouteStatuses,
|
|
4
5
|
formatProjectServerCompiler,
|
|
@@ -6,6 +7,7 @@ import {
|
|
|
6
7
|
formatProjectServerRoot,
|
|
7
8
|
formatProjectServerStatusReason,
|
|
8
9
|
} from "../../analysis/health/server-status.ts";
|
|
10
|
+
import { classifyDiagnosticCoverage } from "../../diagnostics/coverage.ts";
|
|
9
11
|
import type { HealthData, HealthSection } from "../../session/health-types.ts";
|
|
10
12
|
import {
|
|
11
13
|
assembleToolResult,
|
|
@@ -82,6 +84,10 @@ export function assembleHealthResult(input: HealthData, cwd?: string): HealthRes
|
|
|
82
84
|
serverInventoryAvailable: data.serverInventoryAvailable,
|
|
83
85
|
serverInventoryScope: "workspace",
|
|
84
86
|
diagnosticObservation: data.diagnostics,
|
|
87
|
+
diagnosticCoverage:
|
|
88
|
+
data.diagnostics.kind === "not-requested"
|
|
89
|
+
? null
|
|
90
|
+
: classifyDiagnosticCoverage(data.diagnostics),
|
|
85
91
|
refresh: data.refresh,
|
|
86
92
|
structuralAvailable: structuralCapabilityReady(data),
|
|
87
93
|
structuralStatus: data.structuralStatus,
|
|
@@ -103,9 +109,7 @@ function buildHealthDisplaySections(data: HealthData, cwd?: string): ToolDisplay
|
|
|
103
109
|
key: "health.diagnostics",
|
|
104
110
|
title: "Diagnostics",
|
|
105
111
|
items: data.diagnostics.entries,
|
|
106
|
-
|
|
107
|
-
omittedCount: data.diagnostics.kind === "completed" ? 0 : null,
|
|
108
|
-
partialReason: diagnosticPartialReason(data),
|
|
112
|
+
evidence: diagnosticEvidence(data),
|
|
109
113
|
format: formatDiagnosticEntry,
|
|
110
114
|
}),
|
|
111
115
|
);
|
|
@@ -117,8 +121,8 @@ function buildHealthDisplaySections(data: HealthData, cwd?: string): ToolDisplay
|
|
|
117
121
|
key: "health.servers",
|
|
118
122
|
title: "Servers",
|
|
119
123
|
items: data.servers,
|
|
120
|
-
|
|
121
|
-
format: (server) => {
|
|
124
|
+
evidence: createEvidenceList({ key: "health.servers", items: data.servers }).metadata,
|
|
125
|
+
format: (server: HealthData["servers"][number]) => {
|
|
122
126
|
const root = cwd ? formatProjectServerRoot(cwd, server.root) : server.root;
|
|
123
127
|
const compiler = formatProjectServerCompiler(server.typescript);
|
|
124
128
|
const support = [
|
|
@@ -137,10 +141,17 @@ function buildHealthDisplaySections(data: HealthData, cwd?: string): ToolDisplay
|
|
|
137
141
|
return sections;
|
|
138
142
|
}
|
|
139
143
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
+
/** Every collected diagnostic file is shown; an incomplete observation may hide more. */
|
|
145
|
+
function diagnosticEvidence(data: HealthData) {
|
|
146
|
+
const params = { key: "health.diagnostics", items: data.diagnostics.entries };
|
|
147
|
+
const observation = data.diagnostics;
|
|
148
|
+
return observation.kind === "partial" || observation.kind === "unavailable"
|
|
149
|
+
? createPartialEvidenceList({
|
|
150
|
+
...params,
|
|
151
|
+
partialReason: "provider-limited",
|
|
152
|
+
partialMessage: observation.reason,
|
|
153
|
+
}).metadata
|
|
154
|
+
: createEvidenceList(params).metadata;
|
|
144
155
|
}
|
|
145
156
|
|
|
146
157
|
function formatDiagnosticEntry(entry: HealthData["diagnostics"]["entries"][number]): string {
|
|
@@ -18,6 +18,13 @@ const evidence = object({
|
|
|
18
18
|
object({
|
|
19
19
|
file: Type.String(),
|
|
20
20
|
status: Type.Enum(["confirmed", "unconfirmed", "failed", "removed"], { type: "string" }),
|
|
21
|
+
reason: Type.Optional(
|
|
22
|
+
Type.Enum(["disk-changed"], {
|
|
23
|
+
type: "string",
|
|
24
|
+
description:
|
|
25
|
+
"Known cause of a non-confirmed status. disk-changed = the file changed on disk after its last diagnosis.",
|
|
26
|
+
}),
|
|
27
|
+
),
|
|
21
28
|
}),
|
|
22
29
|
),
|
|
23
30
|
});
|
|
@@ -55,6 +62,11 @@ const diagnosticEntry = object({
|
|
|
55
62
|
),
|
|
56
63
|
),
|
|
57
64
|
});
|
|
65
|
+
const coverage = Type.Enum(["unavailable", "none", "incomplete", "confirmed"], {
|
|
66
|
+
type: "string",
|
|
67
|
+
description:
|
|
68
|
+
"What the evidence establishes: none = zero files checked; incomplete = some requested files unconfirmed, failed, or removed; confirmed = every requested file confirmed (never project-wide validation).",
|
|
69
|
+
});
|
|
58
70
|
const diagnostics = Type.Union([
|
|
59
71
|
object({ kind: Type.Literal("not-requested"), entries: Type.Array(diagnosticEntry) }),
|
|
60
72
|
object({
|
|
@@ -62,6 +74,7 @@ const diagnostics = Type.Union([
|
|
|
62
74
|
scope,
|
|
63
75
|
entries: Type.Array(diagnosticEntry),
|
|
64
76
|
evidence,
|
|
77
|
+
coverage,
|
|
65
78
|
scopeStatus: Type.Optional(scopeStatus),
|
|
66
79
|
}),
|
|
67
80
|
object({
|
|
@@ -69,6 +82,7 @@ const diagnostics = Type.Union([
|
|
|
69
82
|
scope,
|
|
70
83
|
entries: Type.Array(diagnosticEntry),
|
|
71
84
|
evidence,
|
|
85
|
+
coverage,
|
|
72
86
|
reason: Type.String(),
|
|
73
87
|
scopeStatus: Type.Optional(scopeStatus),
|
|
74
88
|
}),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DiagnosticEvidenceSummary, ServerOperationSupport } from "@mrclrchtr/supi-lsp/api";
|
|
2
2
|
import type { Static } from "typebox";
|
|
3
|
+
import { classifyDiagnosticCoverage } from "../../diagnostics/coverage.ts";
|
|
3
4
|
import type {
|
|
4
5
|
HealthData,
|
|
5
6
|
HealthDiagnosticScope,
|
|
@@ -19,7 +20,11 @@ function copyEvidence(value: DiagnosticEvidenceSummary) {
|
|
|
19
20
|
unconfirmed: value.unconfirmed,
|
|
20
21
|
failed: value.failed,
|
|
21
22
|
removed: value.removed,
|
|
22
|
-
documents: value.documents.map(({ file, status }) => ({
|
|
23
|
+
documents: value.documents.map(({ file, status, reason }) => ({
|
|
24
|
+
file,
|
|
25
|
+
status,
|
|
26
|
+
...(reason === undefined ? {} : { reason }),
|
|
27
|
+
})),
|
|
23
28
|
};
|
|
24
29
|
}
|
|
25
30
|
function copyScope(value: HealthDiagnosticScope) {
|
|
@@ -151,6 +156,7 @@ export function structuredHealthResult(data: HealthData): Output {
|
|
|
151
156
|
entries,
|
|
152
157
|
scope: copyScope(observation.scope),
|
|
153
158
|
evidence: copyEvidence(observation.evidence),
|
|
159
|
+
coverage: classifyDiagnosticCoverage(observation),
|
|
154
160
|
...(observation.kind === "completed" ? {} : { reason: observation.reason }),
|
|
155
161
|
...(observation.scopeStatus
|
|
156
162
|
? {
|
|
@@ -23,6 +23,12 @@ import {
|
|
|
23
23
|
type ToolRendererContext,
|
|
24
24
|
type ToolResult,
|
|
25
25
|
} from "../../ui/tui/common.ts";
|
|
26
|
+
import {
|
|
27
|
+
buildEmptyDiagnosticSummary,
|
|
28
|
+
diagnosticScopeKind,
|
|
29
|
+
readDiagnosticEvidence,
|
|
30
|
+
readRecord,
|
|
31
|
+
} from "./diagnostic-tui.ts";
|
|
26
32
|
import type { CodeHealthToolParams } from "./execute.ts";
|
|
27
33
|
import {
|
|
28
34
|
isPendingFileReadiness,
|
|
@@ -140,16 +146,10 @@ function buildCompactSummary(data: Record<string, unknown> | null, theme: Theme)
|
|
|
140
146
|
const semanticRequested = sections.some(
|
|
141
147
|
(section) => section.key === "diagnostics" || section.key === "servers",
|
|
142
148
|
);
|
|
143
|
-
const fileReadinessPending = isPendingFileReadiness(data);
|
|
144
149
|
const segments = sections.map((section) =>
|
|
145
|
-
|
|
146
|
-
section,
|
|
147
|
-
section
|
|
148
|
-
? formatCompactDiagnosticEvidence(readDiagnosticEvidence(data), diagnosticScopeKind(data))
|
|
149
|
-
: null,
|
|
150
|
-
theme,
|
|
151
|
-
fileReadinessPending,
|
|
152
|
-
),
|
|
150
|
+
section.key === "diagnostics"
|
|
151
|
+
? formatCompactDiagnostics(section, data, theme)
|
|
152
|
+
: formatSectionSummary(section, null, theme, false),
|
|
153
153
|
);
|
|
154
154
|
if (semanticRequested) {
|
|
155
155
|
const semanticStatus = readSemanticStatus(data);
|
|
@@ -171,6 +171,25 @@ function buildCompactSummary(data: Record<string, unknown> | null, theme: Theme)
|
|
|
171
171
|
return new Text(segments.join(` ${dot} `), 0, 0);
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
+
/** Compact diagnostics segment; zero or incomplete coverage never renders as a green count. */
|
|
175
|
+
function formatCompactDiagnostics(
|
|
176
|
+
section: HealthSectionSummary,
|
|
177
|
+
data: Record<string, unknown> | null,
|
|
178
|
+
theme: Theme,
|
|
179
|
+
): string {
|
|
180
|
+
const label = theme.fg("dim", sectionLabel(section.key));
|
|
181
|
+
const scopeKind = diagnosticScopeKind(data);
|
|
182
|
+
if (data?.diagnosticCoverage === "none") {
|
|
183
|
+
const files = scopeKind === "file" ? "requested" : "tracked";
|
|
184
|
+
return `${label} ${theme.fg("muted", `none checked (0 ${files} files)`)}`;
|
|
185
|
+
}
|
|
186
|
+
const evidence = formatCompactDiagnosticEvidence(readDiagnosticEvidence(data), scopeKind);
|
|
187
|
+
if (data?.diagnosticCoverage === "incomplete" && section.status === "complete") {
|
|
188
|
+
return `${label} ${theme.fg("warning", "incomplete")}${evidence ? ` (${evidence})` : ""}`;
|
|
189
|
+
}
|
|
190
|
+
return formatSectionSummary(section, evidence, theme, isPendingFileReadiness(data));
|
|
191
|
+
}
|
|
192
|
+
|
|
174
193
|
function formatSectionSummary(
|
|
175
194
|
section: HealthSectionSummary,
|
|
176
195
|
coverage: string | null,
|
|
@@ -188,8 +207,9 @@ function formatSectionSummary(
|
|
|
188
207
|
return `${theme.fg("dim", label)} ${theme.fg("warning", "partial")}${coverageSuffix}`;
|
|
189
208
|
}
|
|
190
209
|
|
|
191
|
-
const suffix =
|
|
192
|
-
|
|
210
|
+
const suffix =
|
|
211
|
+
section.key === "diagnostics" && !coverage ? theme.fg("muted", " with issues") : "";
|
|
212
|
+
return `${theme.fg("dim", label)} ${theme.fg("success", theme.bold(`${section.itemCount}`))}${suffix}${coverageSuffix}`;
|
|
193
213
|
}
|
|
194
214
|
|
|
195
215
|
function buildStatusBar(data: Record<string, unknown> | null, theme: Theme): Text {
|
|
@@ -221,28 +241,6 @@ function buildStatusBar(data: Record<string, unknown> | null, theme: Theme): Tex
|
|
|
221
241
|
return new Text(lines.join(" "), 0, 0);
|
|
222
242
|
}
|
|
223
243
|
|
|
224
|
-
function diagnosticEmptySummary(data: Record<string, unknown> | null): string {
|
|
225
|
-
return diagnosticScopeKind(data) === "file"
|
|
226
|
-
? "No errors or warnings for file"
|
|
227
|
-
: "No reported issues in tracked files";
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function diagnosticScopeKind(data: Record<string, unknown> | null): string | null {
|
|
231
|
-
const observation = readRecord(data?.diagnosticObservation);
|
|
232
|
-
const scope = readRecord(observation?.scope);
|
|
233
|
-
return typeof scope?.kind === "string" ? scope.kind : null;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
function readDiagnosticEvidence(
|
|
237
|
-
data: Record<string, unknown> | null,
|
|
238
|
-
): Record<string, unknown> | null {
|
|
239
|
-
return readRecord(readRecord(data?.diagnosticObservation)?.evidence);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
function readRecord(value: unknown): Record<string, unknown> | null {
|
|
243
|
-
return typeof value === "object" && value !== null ? (value as Record<string, unknown>) : null;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
244
|
interface RenderedCapabilityWarning {
|
|
247
245
|
message: string;
|
|
248
246
|
language?: string;
|
|
@@ -306,19 +304,14 @@ function buildDiagnosticSummary(data: Record<string, unknown> | null, theme: The
|
|
|
306
304
|
return new Text(theme.fg("warning", withDiagnosticScope(label, data)), 0, 0);
|
|
307
305
|
}
|
|
308
306
|
const trackedFiles = diagnosticScopeKind(data) === "tracked-files";
|
|
307
|
+
if (data?.diagnosticCoverage === "none") return buildEmptyDiagnosticSummary(data, theme);
|
|
309
308
|
if (section.status === "partial") {
|
|
310
309
|
const coverage = formatDiagnosticEvidence(readDiagnosticEvidence(data));
|
|
311
310
|
const label = trackedFiles ? "Tracked-file diagnostics partial" : "Diagnostics partial";
|
|
312
311
|
const summary = coverage ? `${label} (${coverage})` : label;
|
|
313
312
|
return new Text(theme.fg("warning", withDiagnosticScope(summary, data)), 0, 0);
|
|
314
313
|
}
|
|
315
|
-
if (section.itemCount === 0)
|
|
316
|
-
return new Text(
|
|
317
|
-
theme.fg("success", withDiagnosticScope(diagnosticEmptySummary(data), data)),
|
|
318
|
-
0,
|
|
319
|
-
0,
|
|
320
|
-
);
|
|
321
|
-
}
|
|
314
|
+
if (section.itemCount === 0) return buildEmptyDiagnosticSummary(data, theme);
|
|
322
315
|
|
|
323
316
|
const fileLabel = `${trackedFiles ? "tracked " : ""}${section.itemCount === 1 ? "file" : "files"}`;
|
|
324
317
|
return new Text(
|
|
@@ -109,9 +109,9 @@ function buildInspectDisplaySections(input: {
|
|
|
109
109
|
key: "inspect.node",
|
|
110
110
|
title: "Syntax node",
|
|
111
111
|
items: [node],
|
|
112
|
-
|
|
112
|
+
evidence: observationEvidence("inspect.node", data.sections.node),
|
|
113
|
+
format: (item: typeof node) =>
|
|
113
114
|
`${item.type} at ${data.relPath}:${item.startLine}:${item.startCharacter}–${item.endLine}:${item.endCharacter}${item.text ? ` — ${truncateDisplayText(item.text, 160)}` : ""}`,
|
|
114
|
-
partialReason: observationReason(data.sections.node),
|
|
115
115
|
}),
|
|
116
116
|
);
|
|
117
117
|
}
|
|
@@ -123,9 +123,9 @@ function buildInspectDisplaySections(input: {
|
|
|
123
123
|
key: "inspect.enclosingSymbol",
|
|
124
124
|
title: "Enclosing symbol",
|
|
125
125
|
items: [symbol],
|
|
126
|
-
|
|
126
|
+
evidence: observationEvidence("inspect.enclosingSymbol", data.sections.enclosingSymbol),
|
|
127
|
+
format: (item: typeof symbol) =>
|
|
127
128
|
`${item.name} (${item.kind}) L${item.startLine}:${item.startCharacter}–L${item.endLine}:${item.endCharacter}`,
|
|
128
|
-
partialReason: observationReason(data.sections.enclosingSymbol),
|
|
129
129
|
}),
|
|
130
130
|
);
|
|
131
131
|
}
|
|
@@ -136,36 +136,33 @@ function buildInspectDisplaySections(input: {
|
|
|
136
136
|
key: "inspect.hover",
|
|
137
137
|
title: "Hover",
|
|
138
138
|
items: [data.sections.hover.data],
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
evidence: observationEvidence("inspect.hover", data.sections.hover),
|
|
140
|
+
format: (hover: string) => truncateDisplayText(hover, 240),
|
|
141
141
|
}),
|
|
142
142
|
);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
if (input.displayedDefinitions.length > 0) {
|
|
145
|
+
if (input.definitionEvidence && input.displayedDefinitions.length > 0) {
|
|
146
146
|
sections.push(
|
|
147
147
|
createToolDisplaySection({
|
|
148
148
|
key: "inspect.definitions",
|
|
149
149
|
title: "Definitions",
|
|
150
150
|
items: input.displayedDefinitions,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
format: (definition) => `${definition.file}:${definition.line}:${definition.character}`,
|
|
151
|
+
evidence: input.definitionEvidence.metadata,
|
|
152
|
+
format: (definition: InspectDefinition) =>
|
|
153
|
+
`${definition.file}:${definition.line}:${definition.character}`,
|
|
155
154
|
}),
|
|
156
155
|
);
|
|
157
156
|
}
|
|
158
157
|
|
|
159
|
-
if (input.displayedDiagnostics.length > 0) {
|
|
158
|
+
if (input.diagnosticEvidence && input.displayedDiagnostics.length > 0) {
|
|
160
159
|
sections.push(
|
|
161
160
|
createToolDisplaySection({
|
|
162
161
|
key: "inspect.diagnostics",
|
|
163
162
|
title: "Diagnostics",
|
|
164
163
|
items: input.displayedDiagnostics,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
partialReason: input.diagnosticEvidence?.metadata.partialReason,
|
|
168
|
-
format: (diagnostic) =>
|
|
164
|
+
evidence: input.diagnosticEvidence.metadata,
|
|
165
|
+
format: (diagnostic: InspectDiagnostic) =>
|
|
169
166
|
`L${diagnostic.line}:${diagnostic.character} ${formatDiagnosticSeverity(diagnostic.severity)}: ${truncateDisplayText(diagnostic.message, 200)}`,
|
|
170
167
|
}),
|
|
171
168
|
);
|
|
@@ -174,8 +171,16 @@ function buildInspectDisplaySections(input: {
|
|
|
174
171
|
return sections;
|
|
175
172
|
}
|
|
176
173
|
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
/** One Point inspection observation is one Evidence atom. */
|
|
175
|
+
function observationEvidence<T>(key: string, observation: InspectObservation<T>) {
|
|
176
|
+
return observation.kind === "partial"
|
|
177
|
+
? createPartialEvidenceList({
|
|
178
|
+
key,
|
|
179
|
+
items: [key],
|
|
180
|
+
partialReason: "provider-limited",
|
|
181
|
+
partialMessage: observation.reason,
|
|
182
|
+
}).metadata
|
|
183
|
+
: createEvidenceList({ key, items: [key] }).metadata;
|
|
179
184
|
}
|
|
180
185
|
|
|
181
186
|
function formatDiagnosticSeverity(severity: number): string {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Static, type TSchema, Type } from "typebox";
|
|
2
|
+
import { toEvidenceListFacts } from "../../analysis/evidence.ts";
|
|
2
3
|
import type { InspectObservation } from "../../session/inspect-types.ts";
|
|
3
4
|
import { ConfidenceSchema, EvidenceListSchema, RecoveryRangeSchema } from "../result/structured.ts";
|
|
4
5
|
import type { InspectResultAssembly } from "./result.ts";
|
|
@@ -203,25 +204,7 @@ export function structuredInspectResult(
|
|
|
203
204
|
),
|
|
204
205
|
),
|
|
205
206
|
},
|
|
206
|
-
evidenceLists: assembled.evidenceLists.map(
|
|
207
|
-
({
|
|
208
|
-
key,
|
|
209
|
-
totalCount,
|
|
210
|
-
shownCount,
|
|
211
|
-
omittedCount,
|
|
212
|
-
partialReason,
|
|
213
|
-
partialMessage,
|
|
214
|
-
invalidLocationCount,
|
|
215
|
-
}) => ({
|
|
216
|
-
key,
|
|
217
|
-
totalCount,
|
|
218
|
-
shownCount,
|
|
219
|
-
omittedCount,
|
|
220
|
-
partialReason,
|
|
221
|
-
...(partialMessage === undefined ? {} : { partialMessage }),
|
|
222
|
-
...(invalidLocationCount === undefined ? {} : { invalidLocationCount }),
|
|
223
|
-
}),
|
|
224
|
-
),
|
|
207
|
+
evidenceLists: assembled.evidenceLists.map(toEvidenceListFacts),
|
|
225
208
|
provenance: assembled.provenance.map(({ source, capability }) => ({
|
|
226
209
|
source: source as "semantic" | "structural",
|
|
227
210
|
capability: capability ?? "",
|