@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
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { FileEdit } from "@mrclrchtr/supi-code-runtime/api";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
createEvidenceList,
|
|
4
|
+
type EvidenceList,
|
|
5
|
+
knownEvidenceCount,
|
|
6
|
+
} from "../../analysis/evidence.ts";
|
|
3
7
|
import type { ApplyResult } from "../../analysis/refactor/apply.ts";
|
|
4
8
|
import { toDisplayPath } from "../../analysis/search/paths.ts";
|
|
5
9
|
import type { RefactorPlan } from "../../session/refactor-plans.ts";
|
|
@@ -74,7 +78,7 @@ export function assembleRefactorPlanDetails(
|
|
|
74
78
|
? ["After applying, use rename_symbol to rename any server-generated names"]
|
|
75
79
|
: []),
|
|
76
80
|
],
|
|
77
|
-
candidateCount: edits.metadata
|
|
81
|
+
candidateCount: knownEvidenceCount(edits.metadata),
|
|
78
82
|
confidence: evidenceSource,
|
|
79
83
|
provenance,
|
|
80
84
|
});
|
|
@@ -86,10 +90,8 @@ export function assembleRefactorPlanDetails(
|
|
|
86
90
|
key: "refactor.edits",
|
|
87
91
|
title: "Proposed edits",
|
|
88
92
|
items: edits.items,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
partialReason: edits.metadata.partialReason,
|
|
92
|
-
format: (edit) => formatEdit(edit, cwd),
|
|
93
|
+
evidence: edits.metadata,
|
|
94
|
+
format: (edit: (typeof edits.items)[number]) => formatEdit(edit, cwd),
|
|
93
95
|
}),
|
|
94
96
|
],
|
|
95
97
|
details: {
|
|
@@ -153,8 +155,9 @@ export function assembleRefactorApplyDetails(
|
|
|
153
155
|
key: "refactor.changedFiles",
|
|
154
156
|
title: "Changed files",
|
|
155
157
|
items: changedFiles,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
+
evidence: createEvidenceList({ key: "refactor.changedFiles", items: changedFiles })
|
|
159
|
+
.metadata,
|
|
160
|
+
format: (file: string) => file,
|
|
158
161
|
}),
|
|
159
162
|
]
|
|
160
163
|
: [],
|
|
@@ -5,10 +5,11 @@ export const ConfidenceSchema = Type.Enum(["semantic", "structural", "heuristic"
|
|
|
5
5
|
type: "string",
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
-
/** Canonical evidence counts
|
|
8
|
+
/** Canonical evidence counts and Evidence completeness state; readers never infer completeness. */
|
|
9
9
|
export const EvidenceListSchema = Type.Object(
|
|
10
10
|
{
|
|
11
11
|
key: Type.String(),
|
|
12
|
+
completeness: Type.Enum(["complete", "capped", "partial", "unbounded"], { type: "string" }),
|
|
12
13
|
totalCount: Type.Union([Type.Integer(), Type.Null()]),
|
|
13
14
|
shownCount: Type.Integer(),
|
|
14
15
|
omittedCount: Type.Union([Type.Integer(), Type.Null()]),
|
package/src/tool/result/types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ConfidenceMode, SourceRange } from "@mrclrchtr/supi-code-runtime/api";
|
|
2
2
|
import type { CapabilityWarningReport } from "../../analysis/capability/capability-warnings.ts";
|
|
3
|
-
import type { EvidenceListMetadata } from "../../analysis/evidence.ts";
|
|
3
|
+
import type { EvidenceListFacts, EvidenceListMetadata } from "../../analysis/evidence.ts";
|
|
4
4
|
import type { InstructionFilesMetadata } from "../../analysis/instruction-files.ts";
|
|
5
5
|
import type { ReadNextItem } from "../../analysis/read-next.ts";
|
|
6
6
|
import type { AutomaticPathExclusionDisplay } from "../../analysis/search/exclusions.ts";
|
|
@@ -10,6 +10,7 @@ import type {
|
|
|
10
10
|
StructuredScanSummary,
|
|
11
11
|
} from "../../analysis/search/pattern.ts";
|
|
12
12
|
import type { FileOutlineNotListed } from "../../analysis/target/types.ts";
|
|
13
|
+
import type { DiagnosticCoverage } from "../../diagnostics/coverage.ts";
|
|
13
14
|
import type {
|
|
14
15
|
HealthDiagnosticObservation,
|
|
15
16
|
HealthRefreshState,
|
|
@@ -43,12 +44,10 @@ export interface ToolDisplaySection {
|
|
|
43
44
|
key: string;
|
|
44
45
|
title: string;
|
|
45
46
|
lines: readonly string[];
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
/** Provider explanation for incomplete collection, when available. */
|
|
51
|
-
partialMessage?: string;
|
|
47
|
+
/** Canonical Evidence list facts previewed by this section. */
|
|
48
|
+
evidence: EvidenceListFacts;
|
|
49
|
+
/** Rows hidden by the view cap; a Display omission, not an Evidence atom count. */
|
|
50
|
+
displayOmittedCount: number;
|
|
52
51
|
/** Content counts are separate from canonical evidence when rows are grouped or framed. */
|
|
53
52
|
preview?: {
|
|
54
53
|
unit: "group" | "block";
|
|
@@ -143,7 +142,7 @@ export interface ResolveDetails {
|
|
|
143
142
|
/** Strict provider kind that produced a near-match result. */
|
|
144
143
|
requestedKind?: TargetSymbolKind;
|
|
145
144
|
confidence: ConfidenceMode;
|
|
146
|
-
/** Plain workflow
|
|
145
|
+
/** Plain workflow message: the failure for invalid-input and unavailable, the selection reason for candidates. */
|
|
147
146
|
message?: string;
|
|
148
147
|
targetCount: number;
|
|
149
148
|
omittedCount: number;
|
|
@@ -283,6 +282,8 @@ export interface HealthDetails {
|
|
|
283
282
|
serverInventoryScope: "workspace";
|
|
284
283
|
/** Diagnostic result scope and exact evidence boundary for this health call. */
|
|
285
284
|
diagnosticObservation: HealthDiagnosticObservation;
|
|
285
|
+
/** Shared coverage classification of `diagnosticObservation`; null when not requested. */
|
|
286
|
+
diagnosticCoverage: DiagnosticCoverage | null;
|
|
286
287
|
/** Current or most recent refresh, including typed maintenance scope and evidence. */
|
|
287
288
|
refresh: HealthRefreshState;
|
|
288
289
|
structuralAvailable: boolean;
|
package/src/tool/schemas.ts
CHANGED
|
@@ -9,31 +9,28 @@ import { CODE_FIND_AST_KINDS } from "./code_find/ast-kinds.ts";
|
|
|
9
9
|
export const ScopeParam = Type.String({
|
|
10
10
|
description: "Workspace-relative file or directory scope.",
|
|
11
11
|
});
|
|
12
|
-
export const FindScopesParam = Type.Array(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
);
|
|
19
|
-
const FileParam = Type.String({ description: "File path." });
|
|
12
|
+
export const FindScopesParam = Type.Array(Type.String(), {
|
|
13
|
+
description: "One or more workspace-relative search scopes.",
|
|
14
|
+
minItems: 1,
|
|
15
|
+
});
|
|
16
|
+
const FileParam = Type.String();
|
|
20
17
|
export const QueryParam = Type.String({
|
|
21
18
|
description: "Human or code reference to resolve or search for.",
|
|
22
19
|
minLength: 1,
|
|
23
20
|
});
|
|
24
|
-
const LineParam = Type.Integer({
|
|
25
|
-
const CharacterParam = Type.Integer({
|
|
26
|
-
description: "1-based UTF-16 column.",
|
|
27
|
-
minimum: 1,
|
|
28
|
-
});
|
|
21
|
+
const LineParam = Type.Integer({ minimum: 1 });
|
|
22
|
+
const CharacterParam = Type.Integer({ minimum: 1 });
|
|
29
23
|
export const MaxResultsParam = Type.Integer({
|
|
30
24
|
description: "Maximum displayed results.",
|
|
31
25
|
minimum: 1,
|
|
32
26
|
});
|
|
33
27
|
|
|
28
|
+
/** One home for the position convention; the leaf fields stay undescribed. */
|
|
29
|
+
const POSITION_DESCRIPTION = "1-based line and UTF-16 column.";
|
|
30
|
+
|
|
34
31
|
export const SourcePointParam = Type.Object(
|
|
35
32
|
{ file: FileParam, line: LineParam, character: CharacterParam },
|
|
36
|
-
{ additionalProperties: false },
|
|
33
|
+
{ additionalProperties: false, description: POSITION_DESCRIPTION },
|
|
37
34
|
);
|
|
38
35
|
|
|
39
36
|
const SymbolTargetParam = Type.Object(
|
|
@@ -47,10 +44,7 @@ const SymbolTargetParam = Type.Object(
|
|
|
47
44
|
}),
|
|
48
45
|
),
|
|
49
46
|
},
|
|
50
|
-
{
|
|
51
|
-
description: "Semantic symbol query.",
|
|
52
|
-
additionalProperties: false,
|
|
53
|
-
},
|
|
47
|
+
{ additionalProperties: false },
|
|
54
48
|
);
|
|
55
49
|
|
|
56
50
|
/**
|
|
@@ -152,11 +146,12 @@ const RangeParam = Type.Object(
|
|
|
152
146
|
},
|
|
153
147
|
{
|
|
154
148
|
additionalProperties: false,
|
|
155
|
-
description:
|
|
149
|
+
description:
|
|
150
|
+
"Source range with 1-based lines and UTF-16 columns; end is exclusive. Equal start and end mark a cursor position.",
|
|
156
151
|
},
|
|
157
152
|
);
|
|
158
153
|
|
|
159
|
-
const NewNameParam = Type.String({
|
|
154
|
+
const NewNameParam = Type.String({ minLength: 1 });
|
|
160
155
|
const ActionTitleParam = Type.String({
|
|
161
156
|
description:
|
|
162
157
|
"Exact action title from a previous ambiguous result; selects one of several matching actions.",
|
package/src/ui/footer.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* LSP footer stats-end contribution for code-intelligence.
|
|
3
3
|
*
|
|
4
|
-
* Provides the persistent "
|
|
4
|
+
* Provides the persistent "λ lsp • N ✓ • M open files" suffix on the
|
|
5
5
|
* footer stats line, after cost and context info. This was removed during the
|
|
6
6
|
* supi-lsp → supi-code-intelligence migration.
|
|
7
7
|
*/
|
|
@@ -55,9 +55,7 @@ export function registerLspFooterContribution(
|
|
|
55
55
|
placement: "stats-end",
|
|
56
56
|
priority: 100,
|
|
57
57
|
render: () => {
|
|
58
|
-
|
|
59
|
-
if (!text) return "";
|
|
60
|
-
return `| ${text}`;
|
|
58
|
+
return buildLspStatusText(lspState) ?? "";
|
|
61
59
|
},
|
|
62
60
|
});
|
|
63
61
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { resolve } from "node:path";
|
|
2
2
|
import type { DiagnosticEvidenceSummary } from "@mrclrchtr/supi-lsp/api";
|
|
3
|
+
import { classifyDiagnosticCoverage } from "../diagnostics/coverage.ts";
|
|
3
4
|
import type {
|
|
4
5
|
HealthDiagnosticObservation,
|
|
5
6
|
HealthWorkflowOutcome,
|
|
@@ -21,16 +22,12 @@ export function presentDiagnosticEvidence(observation: HealthDiagnosticObservati
|
|
|
21
22
|
return { summary: "Diagnostics not requested.", tone: "dim" };
|
|
22
23
|
const evidence = observation.evidence;
|
|
23
24
|
const counts = `${evidence.confirmed}/${evidence.requested} confirmed tracked files · ${evidence.unconfirmed} unconfirmed · ${evidence.failed} failed · ${evidence.removed} removed`;
|
|
25
|
+
const coverage = classifyDiagnosticCoverage(observation);
|
|
24
26
|
if (observation.kind === "unavailable")
|
|
25
27
|
return { counts, summary: `Diagnostics unavailable — ${observation.reason}`, tone: "warning" };
|
|
26
|
-
if (
|
|
28
|
+
if (coverage === "none")
|
|
27
29
|
return { counts, summary: "No tracked diagnostic evidence.", tone: "dim" };
|
|
28
|
-
|
|
29
|
-
evidence.confirmed === evidence.requested &&
|
|
30
|
-
evidence.unconfirmed === 0 &&
|
|
31
|
-
evidence.failed === 0 &&
|
|
32
|
-
evidence.removed === 0;
|
|
33
|
-
if (!confirmed)
|
|
30
|
+
if (coverage === "incomplete")
|
|
34
31
|
return {
|
|
35
32
|
counts,
|
|
36
33
|
summary: `Diagnostic evidence is incomplete${observation.kind === "partial" ? ` — ${observation.reason}` : "."}`,
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
3
3
|
import { type Component, Container, Spacer, Text } from "@earendil-works/pi-tui";
|
|
4
4
|
import {
|
|
5
|
+
type CandidateSelectionKey,
|
|
5
6
|
formatCandidateRow,
|
|
6
|
-
|
|
7
|
-
} from "../../tool/result/candidate-row.ts";
|
|
7
|
+
} from "../../tool/result/candidate-selection.ts";
|
|
8
8
|
import {
|
|
9
|
+
describeDisplayOmission,
|
|
9
10
|
MAX_TUI_DISPLAY_ITEMS,
|
|
10
11
|
readToolDisplaySections,
|
|
11
12
|
truncateDisplayText,
|
|
@@ -22,12 +23,6 @@ import {
|
|
|
22
23
|
type ToolResult,
|
|
23
24
|
} from "./common.ts";
|
|
24
25
|
|
|
25
|
-
/** Display-section keys that identify candidate-selection results. */
|
|
26
|
-
export type CandidateSelectionKey =
|
|
27
|
-
| "graph.candidates"
|
|
28
|
-
| "resolve.candidates"
|
|
29
|
-
| "orientation.candidates";
|
|
30
|
-
|
|
31
26
|
interface CandidateRow {
|
|
32
27
|
targetId: string;
|
|
33
28
|
name: string;
|
|
@@ -35,8 +30,6 @@ interface CandidateRow {
|
|
|
35
30
|
file: string;
|
|
36
31
|
line: number;
|
|
37
32
|
character: number;
|
|
38
|
-
rank: number;
|
|
39
|
-
container: string | null;
|
|
40
33
|
}
|
|
41
34
|
|
|
42
35
|
interface CandidateSelectionData {
|
|
@@ -78,16 +71,17 @@ function readCandidateSelection(
|
|
|
78
71
|
|
|
79
72
|
// A status or message alone is not a candidate-selection marker. Require a
|
|
80
73
|
// candidate key or a structured candidate collection before changing views.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
74
|
+
// Older persisted entries keep their key but fail strict evidence parsing;
|
|
75
|
+
// they still select this view and use its bounded legacy body.
|
|
76
|
+
const keyed =
|
|
77
|
+
display ||
|
|
78
|
+
evidence ||
|
|
79
|
+
hasRawKey(result.details?.displaySections, key) ||
|
|
80
|
+
hasRawKey(data?.evidenceLists, key);
|
|
81
|
+
if (!keyed && !structuredCandidates) return null;
|
|
82
|
+
|
|
83
|
+
const rows = candidateRowsFor(display, structuredCandidates);
|
|
84
|
+
const selectionEvidence = candidateEvidenceFor({ display, evidence });
|
|
91
85
|
const reason = selectionReason(result, data);
|
|
92
86
|
const structuredGuidance = readStructuredNextQueries(data);
|
|
93
87
|
const guidance = selectionGuidance(result, data, key);
|
|
@@ -110,57 +104,17 @@ function readCandidateSelection(
|
|
|
110
104
|
function candidateRowsFor(
|
|
111
105
|
display: ToolDisplaySection | null,
|
|
112
106
|
structuredCandidates: CandidateRow[] | null,
|
|
113
|
-
key: CandidateSelectionKey,
|
|
114
107
|
): string[] {
|
|
115
108
|
if (display?.lines.length) return [...display.lines];
|
|
116
|
-
return (structuredCandidates ?? []).map((candidate
|
|
117
|
-
formatCandidateRow(
|
|
118
|
-
candidate,
|
|
119
|
-
key === "graph.candidates" ? "handle-first" : "rank-first",
|
|
120
|
-
index + 1,
|
|
121
|
-
),
|
|
122
|
-
);
|
|
109
|
+
return (structuredCandidates ?? []).map((candidate) => formatCandidateRow(candidate));
|
|
123
110
|
}
|
|
124
111
|
|
|
112
|
+
/** Prefer canonical details evidence; a display section carries the same facts. */
|
|
125
113
|
function candidateEvidenceFor(input: {
|
|
126
114
|
display: ToolDisplaySection | null;
|
|
127
115
|
evidence: EvidenceEntry | null;
|
|
128
|
-
structuredCandidates: CandidateRow[] | null;
|
|
129
|
-
rows: string[];
|
|
130
|
-
key: CandidateSelectionKey;
|
|
131
116
|
}): EvidenceEntry | null {
|
|
132
|
-
|
|
133
|
-
if (input.evidence && input.structuredCandidates?.length) {
|
|
134
|
-
return evidenceForRows(input.evidence, input.rows.length);
|
|
135
|
-
}
|
|
136
|
-
if (input.display) return displayEvidence(input.display, input.key);
|
|
137
|
-
return input.evidence;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
function displayEvidence(display: ToolDisplaySection, key: CandidateSelectionKey): EvidenceEntry {
|
|
141
|
-
const shownCount = display.lines.length;
|
|
142
|
-
return {
|
|
143
|
-
key,
|
|
144
|
-
shownCount,
|
|
145
|
-
totalCount: display.totalCount,
|
|
146
|
-
omittedCount:
|
|
147
|
-
display.totalCount === null
|
|
148
|
-
? unknownOmittedCount(display.omittedCount, Math.max(0, display.shownCount - shownCount))
|
|
149
|
-
: Math.max(0, display.totalCount - shownCount),
|
|
150
|
-
partialReason: display.partialReason,
|
|
151
|
-
partialMessage: display.partialMessage,
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
function evidenceForRows(evidence: EvidenceEntry, shownCount: number): EvidenceEntry {
|
|
156
|
-
return {
|
|
157
|
-
...evidence,
|
|
158
|
-
shownCount,
|
|
159
|
-
omittedCount:
|
|
160
|
-
evidence.totalCount === null
|
|
161
|
-
? unknownOmittedCount(evidence.omittedCount, Math.max(0, evidence.shownCount - shownCount))
|
|
162
|
-
: Math.max(0, evidence.totalCount - shownCount),
|
|
163
|
-
};
|
|
117
|
+
return input.evidence ?? input.display?.evidence ?? null;
|
|
164
118
|
}
|
|
165
119
|
|
|
166
120
|
function readCandidateRows(value: unknown): CandidateRow[] | null {
|
|
@@ -169,6 +123,7 @@ function readCandidateRows(value: unknown): CandidateRow[] | null {
|
|
|
169
123
|
return rows.every((row): row is CandidateRow => row !== null) ? rows : null;
|
|
170
124
|
}
|
|
171
125
|
|
|
126
|
+
/** Rejects malformed persisted rows, including invalid optional rank and container. */
|
|
172
127
|
function readCandidateRow(value: unknown): CandidateRow | null {
|
|
173
128
|
const record = asRecord(value);
|
|
174
129
|
if (
|
|
@@ -192,8 +147,6 @@ function readCandidateRow(value: unknown): CandidateRow | null {
|
|
|
192
147
|
file: record.file,
|
|
193
148
|
line: record.line,
|
|
194
149
|
character: record.character,
|
|
195
|
-
rank: isCount(record.rank) ? record.rank : 0,
|
|
196
|
-
container: typeof record.container === "string" ? record.container : null,
|
|
197
150
|
};
|
|
198
151
|
}
|
|
199
152
|
|
|
@@ -278,14 +231,14 @@ class CandidateSelectionComponent implements Component {
|
|
|
278
231
|
invalidate(): void {}
|
|
279
232
|
|
|
280
233
|
private renderCollapsed(container: Container, width: number): string[] {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
234
|
+
if (this.selection.evidence) {
|
|
235
|
+
container.addChild(
|
|
236
|
+
new BoundedCandidateDisclosure(
|
|
237
|
+
formatEvidenceEntry(this.selection.evidence),
|
|
238
|
+
false,
|
|
239
|
+
this.theme,
|
|
240
|
+
),
|
|
241
|
+
);
|
|
289
242
|
}
|
|
290
243
|
this.appendTruncation(container);
|
|
291
244
|
return this.renderContainer(container, width);
|
|
@@ -316,16 +269,15 @@ class CandidateSelectionComponent implements Component {
|
|
|
316
269
|
private appendStructuredSelection(container: Container): void {
|
|
317
270
|
container.addChild(new Spacer(1));
|
|
318
271
|
const title = this.selection.display?.title ?? "Candidates";
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
container.addChild(new BoundedCandidateDisclosure(disclosure, true, this.theme));
|
|
272
|
+
container.addChild(new Text(this.theme.fg("dim", title), 0, 0));
|
|
273
|
+
if (this.selection.evidence) {
|
|
274
|
+
container.addChild(
|
|
275
|
+
new BoundedCandidateDisclosure(
|
|
276
|
+
`${formatEvidenceEntry(this.selection.evidence)}${hiddenRows(this.selection.display)}`,
|
|
277
|
+
true,
|
|
278
|
+
this.theme,
|
|
279
|
+
),
|
|
280
|
+
);
|
|
329
281
|
}
|
|
330
282
|
for (const row of this.selection.rows) {
|
|
331
283
|
container.addChild(new Text(this.theme.fg("muted", row), 0, 0));
|
|
@@ -350,20 +302,13 @@ class CandidateSelectionComponent implements Component {
|
|
|
350
302
|
}
|
|
351
303
|
}
|
|
352
304
|
|
|
353
|
-
function
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
const reason = entry.partialReason ? `; more may exist — ${entry.partialReason}` : "; partial";
|
|
357
|
-
return `${entry.shownCount}${omitted}${reason}`;
|
|
358
|
-
}
|
|
359
|
-
if (entry.omittedCount)
|
|
360
|
-
return `${entry.shownCount} of ${entry.totalCount}; ${entry.omittedCount} omitted`;
|
|
361
|
-
return `${entry.totalCount}`;
|
|
305
|
+
function hiddenRows(display: ToolDisplaySection | null): string {
|
|
306
|
+
const phrase = describeDisplayOmission(display?.displayOmittedCount ?? 0);
|
|
307
|
+
return phrase ? `; ${phrase}` : "";
|
|
362
308
|
}
|
|
363
309
|
|
|
364
|
-
function
|
|
365
|
-
|
|
366
|
-
return base !== null || omitted > 0 ? omitted : null;
|
|
310
|
+
function hasRawKey(value: unknown, key: CandidateSelectionKey): boolean {
|
|
311
|
+
return Array.isArray(value) && value.some((entry) => asRecord(entry)?.key === key);
|
|
367
312
|
}
|
|
368
313
|
|
|
369
314
|
function asRecord(value: unknown): Record<string, unknown> | null {
|
package/src/ui/tui/common.ts
CHANGED
|
@@ -9,7 +9,11 @@ import {
|
|
|
9
9
|
type ToolRenderResultOptions,
|
|
10
10
|
} from "@earendil-works/pi-coding-agent";
|
|
11
11
|
import { type Component, Container, Markdown, Spacer, Text } from "@earendil-works/pi-tui";
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
describeEvidenceList,
|
|
14
|
+
type EvidenceListFacts,
|
|
15
|
+
readEvidenceListFacts,
|
|
16
|
+
} from "../../analysis/evidence.ts";
|
|
13
17
|
import { truncateDisplayText } from "../../tool/result/display.ts";
|
|
14
18
|
import { renderToolDisplaySections } from "./display.ts";
|
|
15
19
|
import { renderExecutionError } from "./execution-error.ts";
|
|
@@ -72,86 +76,26 @@ export function evidenceLabel(key: string): string {
|
|
|
72
76
|
|
|
73
77
|
// ── Serialized evidence ──────────────────────────────────────────
|
|
74
78
|
|
|
75
|
-
/** Evidence
|
|
76
|
-
export
|
|
77
|
-
key: string;
|
|
78
|
-
shownCount: number;
|
|
79
|
-
totalCount: number | null;
|
|
80
|
-
omittedCount: number | null;
|
|
81
|
-
partialReason: string | null;
|
|
82
|
-
/** Provider explanation for incomplete collection, when available. */
|
|
83
|
-
partialMessage?: string;
|
|
84
|
-
invalidLocationCount?: number;
|
|
85
|
-
}
|
|
79
|
+
/** Evidence list facts projected by result assembly into tool details. */
|
|
80
|
+
export type EvidenceEntry = EvidenceListFacts;
|
|
86
81
|
|
|
87
82
|
/**
|
|
88
|
-
* Read only complete serialized evidence
|
|
89
|
-
*
|
|
90
|
-
* Renderers intentionally discard malformed or absent entries rather than
|
|
91
|
-
* reconstructing totals from candidate counts or omission hints.
|
|
83
|
+
* Read only complete, consistent serialized evidence facts from tool details.
|
|
84
|
+
* Renderers discard malformed entries rather than reconstructing totals.
|
|
92
85
|
*/
|
|
93
86
|
export function readEvidenceEntries(value: unknown): EvidenceEntry[] {
|
|
94
87
|
if (!Array.isArray(value)) return [];
|
|
95
88
|
return value.flatMap((entry) => {
|
|
96
|
-
const parsed =
|
|
89
|
+
const parsed = readEvidenceListFacts(entry);
|
|
97
90
|
return parsed ? [parsed] : [];
|
|
98
91
|
});
|
|
99
92
|
}
|
|
100
93
|
|
|
101
|
-
|
|
102
|
-
if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
|
|
103
|
-
const record = value as Record<string, unknown>;
|
|
104
|
-
const { key, shownCount, totalCount, omittedCount, partialReason, invalidLocationCount } = record;
|
|
105
|
-
if (
|
|
106
|
-
typeof key !== "string" ||
|
|
107
|
-
typeof shownCount !== "number" ||
|
|
108
|
-
!isNullableNumber(totalCount) ||
|
|
109
|
-
!isNullableNumber(omittedCount) ||
|
|
110
|
-
!isNullableString(partialReason) ||
|
|
111
|
-
!isOptionalCount(invalidLocationCount)
|
|
112
|
-
) {
|
|
113
|
-
return null;
|
|
114
|
-
}
|
|
115
|
-
return {
|
|
116
|
-
key,
|
|
117
|
-
shownCount,
|
|
118
|
-
totalCount,
|
|
119
|
-
omittedCount,
|
|
120
|
-
partialReason,
|
|
121
|
-
...(typeof record.partialMessage === "string" ? { partialMessage: record.partialMessage } : {}),
|
|
122
|
-
...(invalidLocationCount === undefined ? {} : { invalidLocationCount }),
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function isNullableNumber(value: unknown): value is number | null {
|
|
127
|
-
return value === null || typeof value === "number";
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function isNullableString(value: unknown): value is string | null {
|
|
131
|
-
return value === null || typeof value === "string";
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function isOptionalCount(value: unknown): value is number | undefined {
|
|
135
|
-
return (
|
|
136
|
-
value === undefined || (typeof value === "number" && Number.isInteger(value) && value >= 0)
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/** Format one assembled evidence list without recomputing its bounds. */
|
|
94
|
+
/** Format one assembled evidence list with the canonical phrase and its label. */
|
|
141
95
|
export function formatEvidenceEntry(entry: EvidenceEntry): string {
|
|
142
96
|
const label = evidenceLabel(entry.key);
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
shownCount: entry.shownCount,
|
|
146
|
-
totalCount: entry.totalCount,
|
|
147
|
-
omittedCount: entry.omittedCount,
|
|
148
|
-
partialReason: entry.partialReason,
|
|
149
|
-
label: singleCandidate ? "candidate" : label,
|
|
150
|
-
});
|
|
151
|
-
if (!entry.invalidLocationCount) return badge;
|
|
152
|
-
const noun = entry.invalidLocationCount === 1 ? "location" : "locations";
|
|
153
|
-
const reason = entry.partialReason ? ` — ${entry.partialReason}` : "";
|
|
154
|
-
return `${badge}; ${entry.invalidLocationCount} invalid provider ${noun} omitted${reason}`;
|
|
97
|
+
const singular = label === "candidates" ? "candidate" : label;
|
|
98
|
+
return describeEvidenceList(entry, { one: singular, other: label });
|
|
155
99
|
}
|
|
156
100
|
|
|
157
101
|
/** Append formatted evidence badge lines to a container. */
|
|
@@ -173,7 +117,9 @@ export function renderMarkdownDetail(
|
|
|
173
117
|
source: MarkdownSource,
|
|
174
118
|
theme: Theme,
|
|
175
119
|
): void {
|
|
176
|
-
|
|
120
|
+
// Persisted content can hold malformed blocks; skip anything that is not a text block.
|
|
121
|
+
const block = source.content?.find((c) => c?.type === "text" && typeof c.text === "string");
|
|
122
|
+
const markdownText = block?.text ?? "";
|
|
177
123
|
if (!markdownText) return;
|
|
178
124
|
container.addChild(new Spacer(1));
|
|
179
125
|
const divider = `${theme.fg("border", "────")} ${theme.fg("dim", "raw markdown")} ${theme.fg("border", "────")}`;
|
package/src/ui/tui/display.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { type Container, Text } from "@earendil-works/pi-tui";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
formatDisplaySectionBounds,
|
|
5
|
+
readToolDisplaySections,
|
|
6
|
+
truncateDisplayText,
|
|
7
|
+
} from "../../tool/result/display.ts";
|
|
5
8
|
|
|
6
9
|
/** Render bounded structured rows for an expanded TUI body. */
|
|
7
10
|
export function renderToolDisplaySections(
|
|
@@ -11,7 +14,7 @@ export function renderToolDisplaySections(
|
|
|
11
14
|
): void {
|
|
12
15
|
for (const section of readToolDisplaySections(value)) {
|
|
13
16
|
container.addChild(
|
|
14
|
-
new Text(theme.fg("dim", `${section.title}${
|
|
17
|
+
new Text(theme.fg("dim", `${section.title}${formatDisplaySectionBounds(section)}`), 0, 0),
|
|
15
18
|
);
|
|
16
19
|
for (const line of section.lines) {
|
|
17
20
|
container.addChild(new Text(theme.fg("muted", line), 0, 0));
|
|
@@ -19,27 +22,6 @@ export function renderToolDisplaySections(
|
|
|
19
22
|
}
|
|
20
23
|
}
|
|
21
24
|
|
|
22
|
-
function formatDisplayBounds(section: ToolDisplaySection): string {
|
|
23
|
-
const summary = section.preview?.evidenceSummary;
|
|
24
|
-
const prefix = summary ? `${summary}; ` : "";
|
|
25
|
-
const unit = section.preview?.unit;
|
|
26
|
-
const label = (count: number) => (unit ? ` preview ${unit}${count === 1 ? "" : "s"}` : "");
|
|
27
|
-
if (section.totalCount === null) {
|
|
28
|
-
const omitted = section.omittedCount
|
|
29
|
-
? `; ${section.omittedCount}${label(section.omittedCount)} collected omitted`
|
|
30
|
-
: "";
|
|
31
|
-
const reason = section.partialReason
|
|
32
|
-
? `; more may exist — ${section.partialReason}`
|
|
33
|
-
: "; partial";
|
|
34
|
-
const message = section.partialMessage ? `; ${section.partialMessage}` : "";
|
|
35
|
-
return ` (${prefix}${section.shownCount}${label(section.shownCount)}${omitted}${reason}${message})`;
|
|
36
|
-
}
|
|
37
|
-
if (section.omittedCount && section.omittedCount > 0) {
|
|
38
|
-
return ` (${prefix}${section.shownCount} of ${section.totalCount}${label(section.totalCount)}; ${section.omittedCount}${label(section.omittedCount)} omitted)`;
|
|
39
|
-
}
|
|
40
|
-
return ` (${prefix}${section.totalCount}${label(section.totalCount)})`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
25
|
/** Format one call argument for a compact human transcript row. */
|
|
44
26
|
export function formatCallValue(value: unknown, maxLength = 60): string | null {
|
|
45
27
|
if (typeof value !== "string" || value.length === 0) return null;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { EvidenceListMetadata } from "../../analysis/evidence.ts";
|
|
2
|
-
|
|
3
|
-
/** Candidate fields used by the three target-selection row formats. */
|
|
4
|
-
export interface CandidateRowData {
|
|
5
|
-
readonly targetId: string;
|
|
6
|
-
readonly name: string;
|
|
7
|
-
readonly kind: string | null;
|
|
8
|
-
readonly file: string;
|
|
9
|
-
readonly line: number;
|
|
10
|
-
readonly character: number;
|
|
11
|
-
readonly rank?: number;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/** The order used for the target id and rank in one candidate row. */
|
|
15
|
-
export type CandidateRowOrder = "handle-first" | "rank-first";
|
|
16
|
-
|
|
17
|
-
/** Format one candidate row for a serialized display section or TUI fallback. */
|
|
18
|
-
export function formatCandidateRow(
|
|
19
|
-
candidate: CandidateRowData,
|
|
20
|
-
order: CandidateRowOrder,
|
|
21
|
-
fallbackRank = 1,
|
|
22
|
-
): string {
|
|
23
|
-
const kind = candidate.kind ?? "unknown";
|
|
24
|
-
if (order === "handle-first") {
|
|
25
|
-
return `${candidate.targetId} — ${candidate.name} (${kind}) at ${candidate.file}:${candidate.line}:${candidate.character}`;
|
|
26
|
-
}
|
|
27
|
-
const rank = candidate.rank && candidate.rank > 0 ? candidate.rank : fallbackRank;
|
|
28
|
-
return `${rank}. ${candidate.name} (${kind}) — ${candidate.file}:${candidate.line}:${candidate.character} [${candidate.targetId}]`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/** Separate display omissions from incomplete provider collection in candidate output. */
|
|
32
|
-
export function formatPartialCandidateDisclosure(
|
|
33
|
-
evidence: Pick<
|
|
34
|
-
EvidenceListMetadata,
|
|
35
|
-
"shownCount" | "totalCount" | "omittedCount" | "partialMessage"
|
|
36
|
-
>,
|
|
37
|
-
): string | null {
|
|
38
|
-
if (evidence.totalCount !== null || !evidence.partialMessage) return null;
|
|
39
|
-
const { shownCount, omittedCount, partialMessage } = evidence;
|
|
40
|
-
const collectedCount = shownCount + (omittedCount ?? 0);
|
|
41
|
-
const noun = collectedCount === 1 ? "candidate" : "candidates";
|
|
42
|
-
const count =
|
|
43
|
-
omittedCount === null
|
|
44
|
-
? `${shownCount} collected ${noun}.`
|
|
45
|
-
: omittedCount === 0
|
|
46
|
-
? `all ${shownCount} collected ${noun}.`
|
|
47
|
-
: `${shownCount} of ${collectedCount} collected ${noun}; ${omittedCount} omitted.`;
|
|
48
|
-
return `Showing ${count}\nSearch completeness is unknown: ${partialMessage}`;
|
|
49
|
-
}
|