@mrclrchtr/supi-code-intelligence 11.4.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 +39 -0
- package/README.md +17 -9
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +1 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +51 -23
- 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/README.md +21 -16
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +51 -23
- 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 +3 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-cache.ts +102 -47
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-capabilities.ts +13 -3
- 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 +71 -13
- 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 +28 -6
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-edit-capture.ts +258 -0
- 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 +75 -14
- package/node_modules/@mrclrchtr/supi-lsp/src/config/capabilities.ts +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/config/operation-support.ts +48 -79
- 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 +43 -21
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/typescript-file-local.ts +6 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-refactor-provider.ts +21 -35
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +6 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/refactor-command-capture.ts +139 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/refactor-planning.ts +202 -47
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-symbol-mapper.ts +13 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/session/route-boundary.ts +26 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostic-surface.ts +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostics.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +74 -14
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-rename.ts +3 -0
- 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 +24 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +1 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +51 -23
- 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/coordinates.ts +16 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-client.ts +4 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/syntax-errors.ts +2 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/call-range.ts +94 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/call-sites.ts +26 -6
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/callees.ts +6 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/exports.ts +13 -4
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/runtime.ts +1 -9
- package/node_modules/fast-xml-parser/CHANGELOG.md +886 -0
- package/node_modules/fast-xml-parser/LICENSE +21 -0
- package/node_modules/fast-xml-parser/README.md +204 -0
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.d.cts +774 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/README.md +92 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/package.json +57 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityDecoder.js +644 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityEncoder.js +239 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/all-entities.js +53 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entities.js +1139 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entityTries.js +60 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.d.ts +358 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.js +29 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/CHANGELOG.md +52 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/README.md +77 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.cjs +1 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.d.cts +270 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js +2 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/package.json +77 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.d.ts +270 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.js +609 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/ignoreAttributes.js +18 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/orderedJs2Xml.js +360 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/prettifyJs2Xml.js +0 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/util.js +23 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/README.md +632 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/package.json +56 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/html.js +102 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/log.js +98 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/nosql.js +114 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/redos.js +60 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/shell.js +105 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql-strict.js +47 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql.js +95 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/svg.js +81 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/xml.js +79 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.cjs +27 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.d.ts +103 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.js +292 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/util/decode-entities.js +48 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/README.md +947 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.cjs +1 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.d.cts +725 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js +2 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/package.json +79 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Expression.js +232 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/ExpressionSet.js +225 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Matcher.js +663 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.d.ts +589 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.js +30 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/CHANGELOG.md +63 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/README.md +113 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/README.md +142 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/anynum.js +135 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/digitTable.js +116 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/package.json +42 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/package.json +36 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/strnum.js +176 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/README.md +287 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/package.json +56 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.d.ts +108 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.js +382 -0
- package/node_modules/fast-xml-parser/package.json +93 -0
- package/node_modules/fast-xml-parser/src/cli/cli.js +97 -0
- package/node_modules/fast-xml-parser/src/cli/man.js +17 -0
- package/node_modules/fast-xml-parser/src/cli/read.js +43 -0
- package/node_modules/fast-xml-parser/src/fxp.d.ts +754 -0
- package/node_modules/fast-xml-parser/src/fxp.js +14 -0
- package/node_modules/fast-xml-parser/src/ignoreAttributes.js +18 -0
- package/node_modules/fast-xml-parser/src/util.js +61 -0
- package/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +16 -0
- package/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +106 -0
- package/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +61 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +69 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +103 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +100 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +154 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +94 -0
- package/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
- package/node_modules/fast-xml-parser/src/v6/TagPath.js +81 -0
- package/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +13 -0
- package/node_modules/fast-xml-parser/src/v6/XMLParser.js +83 -0
- package/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +235 -0
- package/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +210 -0
- package/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +111 -0
- package/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +116 -0
- package/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +121 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +105 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +22 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +19 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +38 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +13 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +14 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +6 -0
- package/node_modules/fast-xml-parser/src/validator.js +518 -0
- package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +6 -0
- package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +426 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +164 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +907 -0
- package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +77 -0
- package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +177 -0
- package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +54 -0
- package/package.json +10 -8
- package/src/analysis/evidence.ts +331 -73
- package/src/analysis/health/diagnostics.ts +66 -18
- package/src/analysis/health/evidence-reason.ts +44 -0
- package/src/analysis/health/server-status.ts +41 -12
- package/src/analysis/search/pattern.ts +3 -3
- package/src/analysis/target/anchored-structural.ts +4 -1
- package/src/analysis/target/anchored.ts +3 -6
- package/src/analysis/target/symbol.ts +42 -48
- 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/find-types.ts +8 -4
- package/src/session/find-workflow.ts +11 -16
- package/src/session/health-workflow.ts +6 -0
- package/src/session/input/common.ts +1 -1
- package/src/session/input/health-refactor.ts +48 -34
- package/src/session/input/workflows.ts +45 -46
- package/src/session/inspect/file-point.ts +2 -2
- package/src/session/inspect-types.ts +1 -1
- package/src/session/inspect-workflow.ts +3 -3
- 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/refactor-file-actions.ts +122 -0
- package/src/session/refactor-plan-pipeline.ts +152 -0
- package/src/session/refactor-plans.ts +18 -15
- package/src/session/refactor-types.ts +24 -12
- package/src/session/refactor-workflow.ts +68 -243
- package/src/session/target-workflow.ts +25 -18
- package/src/tool/code_find/execute.ts +6 -7
- package/src/tool/code_find/result.ts +5 -7
- package/src/tool/code_find/spec.ts +9 -16
- package/src/tool/code_find/tui.ts +12 -6
- 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/spec.ts +6 -0
- package/src/tool/code_graph/tui.ts +10 -5
- package/src/tool/code_health/diagnostic-tui.ts +49 -0
- package/src/tool/code_health/guidance.ts +27 -0
- package/src/tool/code_health/markdown.ts +60 -8
- package/src/tool/code_health/result.ts +20 -9
- package/src/tool/code_health/spec.ts +6 -0
- package/src/tool/code_health/structured-schema.ts +18 -4
- package/src/tool/code_health/structured.ts +22 -18
- package/src/tool/code_health/tui.ts +33 -40
- package/src/tool/code_inspect/execute.ts +1 -1
- package/src/tool/code_inspect/markdown.ts +33 -6
- package/src/tool/code_inspect/result.ts +24 -19
- package/src/tool/code_inspect/spec.ts +14 -6
- package/src/tool/code_inspect/structured.ts +4 -21
- package/src/tool/code_inspect/tui.ts +2 -2
- package/src/tool/code_orientation/result.ts +53 -100
- package/src/tool/code_orientation/spec.ts +8 -0
- 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_refactor_apply/result.ts +2 -1
- package/src/tool/code_refactor_apply/spec.ts +7 -0
- package/src/tool/code_refactor_plan/execute.ts +0 -2
- package/src/tool/code_refactor_plan/result.ts +23 -13
- package/src/tool/code_refactor_plan/spec.ts +8 -2
- package/src/tool/code_refactor_plan/structured.ts +59 -12
- package/src/tool/code_refactor_plan/tui.ts +14 -17
- package/src/tool/code_resolve/markdown.ts +5 -47
- package/src/tool/code_resolve/result.ts +43 -72
- package/src/tool/code_resolve/spec.ts +6 -0
- package/src/tool/infra/truncate.ts +2 -16
- package/src/tool/namespace.ts +14 -0
- package/src/tool/refactor-markdown.ts +55 -15
- package/src/tool/register.ts +3 -0
- 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-preview.ts +118 -0
- package/src/tool/result/refactor-unavailable.ts +16 -0
- package/src/tool/result/refactor.ts +19 -10
- package/src/tool/result/structured.ts +2 -1
- package/src/tool/result/types.ts +9 -8
- package/src/tool/schemas.ts +76 -38
- package/src/tool/specs.ts +3 -0
- package/src/ui/footer.ts +2 -4
- package/src/ui/status-overlay.ts +1 -1
- 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
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
|
@@ -4,40 +4,33 @@ import {
|
|
|
4
4
|
type PublicRefactorOperationName,
|
|
5
5
|
} from "../session/refactor-types.ts";
|
|
6
6
|
import { TARGET_SYMBOL_KINDS } from "../session/target-input.ts";
|
|
7
|
+
import { CODE_FIND_AST_KINDS } from "./code_find/ast-kinds.ts";
|
|
7
8
|
|
|
8
9
|
export const ScopeParam = Type.String({
|
|
9
10
|
description: "Workspace-relative file or directory scope.",
|
|
10
11
|
});
|
|
11
|
-
export const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
);
|
|
18
|
-
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();
|
|
19
17
|
export const QueryParam = Type.String({
|
|
20
18
|
description: "Human or code reference to resolve or search for.",
|
|
21
19
|
minLength: 1,
|
|
22
20
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"AST mode: name or import module-specifier substring. Semantic mode: workspace-symbol query.",
|
|
26
|
-
minLength: 1,
|
|
27
|
-
});
|
|
28
|
-
const LineParam = Type.Integer({ description: "1-based line.", minimum: 1 });
|
|
29
|
-
const CharacterParam = Type.Integer({
|
|
30
|
-
description: "1-based UTF-16 column.",
|
|
31
|
-
minimum: 1,
|
|
32
|
-
});
|
|
21
|
+
const LineParam = Type.Integer({ minimum: 1 });
|
|
22
|
+
const CharacterParam = Type.Integer({ minimum: 1 });
|
|
33
23
|
export const MaxResultsParam = Type.Integer({
|
|
34
24
|
description: "Maximum displayed results.",
|
|
35
25
|
minimum: 1,
|
|
36
26
|
});
|
|
37
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
|
+
|
|
38
31
|
export const SourcePointParam = Type.Object(
|
|
39
32
|
{ file: FileParam, line: LineParam, character: CharacterParam },
|
|
40
|
-
{ additionalProperties: false },
|
|
33
|
+
{ additionalProperties: false, description: POSITION_DESCRIPTION },
|
|
41
34
|
);
|
|
42
35
|
|
|
43
36
|
const SymbolTargetParam = Type.Object(
|
|
@@ -51,10 +44,7 @@ const SymbolTargetParam = Type.Object(
|
|
|
51
44
|
}),
|
|
52
45
|
),
|
|
53
46
|
},
|
|
54
|
-
{
|
|
55
|
-
description: "Semantic symbol query.",
|
|
56
|
-
additionalProperties: false,
|
|
57
|
-
},
|
|
47
|
+
{ additionalProperties: false },
|
|
58
48
|
);
|
|
59
49
|
|
|
60
50
|
/**
|
|
@@ -74,6 +64,29 @@ function exactOneSelector(properties: Record<string, TSchema>, description: stri
|
|
|
74
64
|
});
|
|
75
65
|
}
|
|
76
66
|
|
|
67
|
+
export const FindSearchParam = exactOneSelector(
|
|
68
|
+
{
|
|
69
|
+
ast: Type.Object(
|
|
70
|
+
{
|
|
71
|
+
kind: Type.Enum(CODE_FIND_AST_KINDS, {
|
|
72
|
+
type: "string",
|
|
73
|
+
description: "AST structure kind.",
|
|
74
|
+
}),
|
|
75
|
+
query: Type.String({
|
|
76
|
+
description: "Name or import module-specifier substring.",
|
|
77
|
+
minLength: 1,
|
|
78
|
+
}),
|
|
79
|
+
},
|
|
80
|
+
{ additionalProperties: false, description: "Structural search over syntax trees." },
|
|
81
|
+
),
|
|
82
|
+
semantic: Type.Object(
|
|
83
|
+
{ query: Type.String({ description: "Workspace-symbol query.", minLength: 1 }) },
|
|
84
|
+
{ additionalProperties: false, description: "Language-server workspace-symbol search." },
|
|
85
|
+
),
|
|
86
|
+
},
|
|
87
|
+
"Exactly one search mode.",
|
|
88
|
+
);
|
|
89
|
+
|
|
77
90
|
export const ResolveTargetParam = exactOneSelector(
|
|
78
91
|
{
|
|
79
92
|
anchor: SourcePointParam,
|
|
@@ -112,7 +125,7 @@ export const OrientationFocusParam = exactOneSelector(
|
|
|
112
125
|
"Exactly one Orientation focus.",
|
|
113
126
|
);
|
|
114
127
|
|
|
115
|
-
|
|
128
|
+
const RefactorTargetParam = exactOneSelector(
|
|
116
129
|
{
|
|
117
130
|
handle: Type.String({ description: "Target handle from a previous code tool result." }),
|
|
118
131
|
anchor: SourcePointParam,
|
|
@@ -131,28 +144,53 @@ const RangeParam = Type.Object(
|
|
|
131
144
|
{ additionalProperties: false },
|
|
132
145
|
),
|
|
133
146
|
},
|
|
134
|
-
{
|
|
147
|
+
{
|
|
148
|
+
additionalProperties: false,
|
|
149
|
+
description:
|
|
150
|
+
"Source range with 1-based lines and UTF-16 columns; end is exclusive. Equal start and end mark a cursor position.",
|
|
151
|
+
},
|
|
135
152
|
);
|
|
136
153
|
|
|
137
|
-
const NewNameParam = Type.String({
|
|
154
|
+
const NewNameParam = Type.String({ minLength: 1 });
|
|
155
|
+
const ActionTitleParam = Type.String({
|
|
156
|
+
description:
|
|
157
|
+
"Exact action title from a previous ambiguous result; selects one of several matching actions.",
|
|
158
|
+
minLength: 1,
|
|
159
|
+
});
|
|
138
160
|
|
|
139
161
|
const RefactorOperationProperties = {
|
|
140
|
-
rename_symbol: Type.Object(
|
|
141
|
-
|
|
142
|
-
{
|
|
143
|
-
{ additionalProperties: false },
|
|
144
|
-
),
|
|
145
|
-
extract_variable: Type.Object(
|
|
146
|
-
{ newName: NewNameParam, range: RangeParam },
|
|
147
|
-
{ additionalProperties: false },
|
|
162
|
+
rename_symbol: Type.Object(
|
|
163
|
+
{ target: RefactorTargetParam, newName: NewNameParam },
|
|
164
|
+
{ additionalProperties: false, description: "Rename one symbol across the workspace." },
|
|
148
165
|
),
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
166
|
+
code_action: Type.Object(
|
|
167
|
+
{
|
|
168
|
+
file: FileParam,
|
|
169
|
+
range: RangeParam,
|
|
170
|
+
kind: Type.String({
|
|
171
|
+
description:
|
|
172
|
+
'CodeActionKind prefix under "refactor", such as "refactor.extract" or "refactor.inline". Sub-kinds match.',
|
|
173
|
+
pattern: "^refactor(\\..+)?$",
|
|
174
|
+
}),
|
|
175
|
+
title: Type.Optional(ActionTitleParam),
|
|
176
|
+
},
|
|
152
177
|
{
|
|
153
178
|
additionalProperties: false,
|
|
154
|
-
description:
|
|
179
|
+
description:
|
|
180
|
+
"Server refactor action for one range. Generated names (e.g. extracted variables) appear in the preview; rename them afterwards with rename_symbol.",
|
|
181
|
+
},
|
|
182
|
+
),
|
|
183
|
+
source_action: Type.Object(
|
|
184
|
+
{
|
|
185
|
+
file: FileParam,
|
|
186
|
+
kind: Type.String({
|
|
187
|
+
description:
|
|
188
|
+
'CodeActionKind prefix under "source", such as "source.organizeImports" or "source.fixAll". Sub-kinds match.',
|
|
189
|
+
pattern: "^source(\\..+)?$",
|
|
190
|
+
}),
|
|
191
|
+
title: Type.Optional(ActionTitleParam),
|
|
155
192
|
},
|
|
193
|
+
{ additionalProperties: false, description: "Server source action for one whole file." },
|
|
156
194
|
),
|
|
157
195
|
} satisfies Record<PublicRefactorOperationName, TSchema>;
|
|
158
196
|
|
package/src/tool/specs.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ToolAnnotations } from "@earendil-works/pi-coding-agent";
|
|
1
2
|
import type { Component } from "@earendil-works/pi-tui";
|
|
2
3
|
import type { TSchema } from "typebox";
|
|
3
4
|
import type {
|
|
@@ -27,6 +28,8 @@ export type CodeToolRendererFn = (...args: any[]) => Component;
|
|
|
27
28
|
export interface CodeIntelligenceToolDefinitionSpec {
|
|
28
29
|
name: CodeIntelligenceToolName;
|
|
29
30
|
label: string;
|
|
31
|
+
/** Audited behavior hints for permission extensions (MCP tool-annotation semantics). */
|
|
32
|
+
annotations: ToolAnnotations;
|
|
30
33
|
parameters: TSchema;
|
|
31
34
|
/** Machine-readable success and recoverable-input outcomes for programmatic callers. */
|
|
32
35
|
outputSchema?: TSchema;
|
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
|
|
package/src/ui/status-overlay.ts
CHANGED
|
@@ -618,7 +618,7 @@ export class CiStatusDialog {
|
|
|
618
618
|
text(
|
|
619
619
|
t.fg(
|
|
620
620
|
"dim",
|
|
621
|
-
` ${operation}: server ${support.server}; SuPi ${support.supi}${support.reason ? ` — ${support.reason}` : ""}`,
|
|
621
|
+
` ${operation}: server ${support.server}; SuPi ${support.supi}${support.kinds?.length ? `; kinds ${support.kinds.join(", ")}` : ""}${support.anyKind ? "; may return any kind" : ""}${support.reason ? ` — ${support.reason}` : ""}`,
|
|
622
622
|
),
|
|
623
623
|
);
|
|
624
624
|
}
|
|
@@ -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", "────")}`;
|