@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
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { DiagnosticEvidenceSummary } from "@mrclrchtr/supi-lsp/api";
|
|
1
|
+
import type { DiagnosticEvidenceSummary, ServerOperationSupport } from "@mrclrchtr/supi-lsp/api";
|
|
2
2
|
import type { Static } from "typebox";
|
|
3
|
+
import { classifyDiagnosticCoverage } from "../../diagnostics/coverage.ts";
|
|
3
4
|
import type {
|
|
4
5
|
HealthData,
|
|
5
6
|
HealthDiagnosticScope,
|
|
@@ -19,7 +20,11 @@ function copyEvidence(value: DiagnosticEvidenceSummary) {
|
|
|
19
20
|
unconfirmed: value.unconfirmed,
|
|
20
21
|
failed: value.failed,
|
|
21
22
|
removed: value.removed,
|
|
22
|
-
documents: value.documents.map(({ file, status }) => ({
|
|
23
|
+
documents: value.documents.map(({ file, status, reason }) => ({
|
|
24
|
+
file,
|
|
25
|
+
status,
|
|
26
|
+
...(reason === undefined ? {} : { reason }),
|
|
27
|
+
})),
|
|
23
28
|
};
|
|
24
29
|
}
|
|
25
30
|
function copyScope(value: HealthDiagnosticScope) {
|
|
@@ -151,6 +156,7 @@ export function structuredHealthResult(data: HealthData): Output {
|
|
|
151
156
|
entries,
|
|
152
157
|
scope: copyScope(observation.scope),
|
|
153
158
|
evidence: copyEvidence(observation.evidence),
|
|
159
|
+
coverage: classifyDiagnosticCoverage(observation),
|
|
154
160
|
...(observation.kind === "completed" ? {} : { reason: observation.reason }),
|
|
155
161
|
...(observation.scopeStatus
|
|
156
162
|
? {
|
|
@@ -166,10 +172,8 @@ export function structuredHealthResult(data: HealthData): Output {
|
|
|
166
172
|
const operations = [
|
|
167
173
|
"rename_symbol",
|
|
168
174
|
"prepare_rename",
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"update_imports",
|
|
172
|
-
"delete_dead_code",
|
|
175
|
+
"code_action",
|
|
176
|
+
"source_action",
|
|
173
177
|
"code_action_resolve",
|
|
174
178
|
] as const;
|
|
175
179
|
const servers = data.servers.map(
|
|
@@ -197,18 +201,7 @@ export function structuredHealthResult(data: HealthData): Output {
|
|
|
197
201
|
operationSupport: Object.fromEntries(
|
|
198
202
|
operations.flatMap((key) => {
|
|
199
203
|
const item = operationSupport[key];
|
|
200
|
-
return item
|
|
201
|
-
? [
|
|
202
|
-
[
|
|
203
|
-
key,
|
|
204
|
-
{
|
|
205
|
-
server: item.server,
|
|
206
|
-
supi: item.supi,
|
|
207
|
-
...(item.reason === undefined ? {} : { reason: item.reason }),
|
|
208
|
-
},
|
|
209
|
-
],
|
|
210
|
-
]
|
|
211
|
-
: [];
|
|
204
|
+
return item ? [[key, structuredOperationSupport(item)]] : [];
|
|
212
205
|
}),
|
|
213
206
|
),
|
|
214
207
|
}
|
|
@@ -254,3 +247,14 @@ export function structuredHealthResult(data: HealthData): Output {
|
|
|
254
247
|
: {}),
|
|
255
248
|
} as Output;
|
|
256
249
|
}
|
|
250
|
+
|
|
251
|
+
/** Copy one operation-support entry, omitting absent optional fields. */
|
|
252
|
+
function structuredOperationSupport(item: ServerOperationSupport) {
|
|
253
|
+
return {
|
|
254
|
+
server: item.server,
|
|
255
|
+
supi: item.supi,
|
|
256
|
+
...(item.reason === undefined ? {} : { reason: item.reason }),
|
|
257
|
+
...(item.kinds === undefined ? {} : { kinds: [...item.kinds] }),
|
|
258
|
+
...(item.anyKind ? { anyKind: true } : {}),
|
|
259
|
+
};
|
|
260
|
+
}
|
|
@@ -23,6 +23,12 @@ import {
|
|
|
23
23
|
type ToolRendererContext,
|
|
24
24
|
type ToolResult,
|
|
25
25
|
} from "../../ui/tui/common.ts";
|
|
26
|
+
import {
|
|
27
|
+
buildEmptyDiagnosticSummary,
|
|
28
|
+
diagnosticScopeKind,
|
|
29
|
+
readDiagnosticEvidence,
|
|
30
|
+
readRecord,
|
|
31
|
+
} from "./diagnostic-tui.ts";
|
|
26
32
|
import type { CodeHealthToolParams } from "./execute.ts";
|
|
27
33
|
import {
|
|
28
34
|
isPendingFileReadiness,
|
|
@@ -140,16 +146,10 @@ function buildCompactSummary(data: Record<string, unknown> | null, theme: Theme)
|
|
|
140
146
|
const semanticRequested = sections.some(
|
|
141
147
|
(section) => section.key === "diagnostics" || section.key === "servers",
|
|
142
148
|
);
|
|
143
|
-
const fileReadinessPending = isPendingFileReadiness(data);
|
|
144
149
|
const segments = sections.map((section) =>
|
|
145
|
-
|
|
146
|
-
section,
|
|
147
|
-
section
|
|
148
|
-
? formatCompactDiagnosticEvidence(readDiagnosticEvidence(data), diagnosticScopeKind(data))
|
|
149
|
-
: null,
|
|
150
|
-
theme,
|
|
151
|
-
fileReadinessPending,
|
|
152
|
-
),
|
|
150
|
+
section.key === "diagnostics"
|
|
151
|
+
? formatCompactDiagnostics(section, data, theme)
|
|
152
|
+
: formatSectionSummary(section, null, theme, false),
|
|
153
153
|
);
|
|
154
154
|
if (semanticRequested) {
|
|
155
155
|
const semanticStatus = readSemanticStatus(data);
|
|
@@ -171,6 +171,25 @@ function buildCompactSummary(data: Record<string, unknown> | null, theme: Theme)
|
|
|
171
171
|
return new Text(segments.join(` ${dot} `), 0, 0);
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
+
/** Compact diagnostics segment; zero or incomplete coverage never renders as a green count. */
|
|
175
|
+
function formatCompactDiagnostics(
|
|
176
|
+
section: HealthSectionSummary,
|
|
177
|
+
data: Record<string, unknown> | null,
|
|
178
|
+
theme: Theme,
|
|
179
|
+
): string {
|
|
180
|
+
const label = theme.fg("dim", sectionLabel(section.key));
|
|
181
|
+
const scopeKind = diagnosticScopeKind(data);
|
|
182
|
+
if (data?.diagnosticCoverage === "none") {
|
|
183
|
+
const files = scopeKind === "file" ? "requested" : "tracked";
|
|
184
|
+
return `${label} ${theme.fg("muted", `none checked (0 ${files} files)`)}`;
|
|
185
|
+
}
|
|
186
|
+
const evidence = formatCompactDiagnosticEvidence(readDiagnosticEvidence(data), scopeKind);
|
|
187
|
+
if (data?.diagnosticCoverage === "incomplete" && section.status === "complete") {
|
|
188
|
+
return `${label} ${theme.fg("warning", "incomplete")}${evidence ? ` (${evidence})` : ""}`;
|
|
189
|
+
}
|
|
190
|
+
return formatSectionSummary(section, evidence, theme, isPendingFileReadiness(data));
|
|
191
|
+
}
|
|
192
|
+
|
|
174
193
|
function formatSectionSummary(
|
|
175
194
|
section: HealthSectionSummary,
|
|
176
195
|
coverage: string | null,
|
|
@@ -188,8 +207,9 @@ function formatSectionSummary(
|
|
|
188
207
|
return `${theme.fg("dim", label)} ${theme.fg("warning", "partial")}${coverageSuffix}`;
|
|
189
208
|
}
|
|
190
209
|
|
|
191
|
-
const suffix =
|
|
192
|
-
|
|
210
|
+
const suffix =
|
|
211
|
+
section.key === "diagnostics" && !coverage ? theme.fg("muted", " with issues") : "";
|
|
212
|
+
return `${theme.fg("dim", label)} ${theme.fg("success", theme.bold(`${section.itemCount}`))}${suffix}${coverageSuffix}`;
|
|
193
213
|
}
|
|
194
214
|
|
|
195
215
|
function buildStatusBar(data: Record<string, unknown> | null, theme: Theme): Text {
|
|
@@ -221,28 +241,6 @@ function buildStatusBar(data: Record<string, unknown> | null, theme: Theme): Tex
|
|
|
221
241
|
return new Text(lines.join(" "), 0, 0);
|
|
222
242
|
}
|
|
223
243
|
|
|
224
|
-
function diagnosticEmptySummary(data: Record<string, unknown> | null): string {
|
|
225
|
-
return diagnosticScopeKind(data) === "file"
|
|
226
|
-
? "No errors or warnings for file"
|
|
227
|
-
: "No reported issues in tracked files";
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function diagnosticScopeKind(data: Record<string, unknown> | null): string | null {
|
|
231
|
-
const observation = readRecord(data?.diagnosticObservation);
|
|
232
|
-
const scope = readRecord(observation?.scope);
|
|
233
|
-
return typeof scope?.kind === "string" ? scope.kind : null;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
function readDiagnosticEvidence(
|
|
237
|
-
data: Record<string, unknown> | null,
|
|
238
|
-
): Record<string, unknown> | null {
|
|
239
|
-
return readRecord(readRecord(data?.diagnosticObservation)?.evidence);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
function readRecord(value: unknown): Record<string, unknown> | null {
|
|
243
|
-
return typeof value === "object" && value !== null ? (value as Record<string, unknown>) : null;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
244
|
interface RenderedCapabilityWarning {
|
|
247
245
|
message: string;
|
|
248
246
|
language?: string;
|
|
@@ -306,19 +304,14 @@ function buildDiagnosticSummary(data: Record<string, unknown> | null, theme: The
|
|
|
306
304
|
return new Text(theme.fg("warning", withDiagnosticScope(label, data)), 0, 0);
|
|
307
305
|
}
|
|
308
306
|
const trackedFiles = diagnosticScopeKind(data) === "tracked-files";
|
|
307
|
+
if (data?.diagnosticCoverage === "none") return buildEmptyDiagnosticSummary(data, theme);
|
|
309
308
|
if (section.status === "partial") {
|
|
310
309
|
const coverage = formatDiagnosticEvidence(readDiagnosticEvidence(data));
|
|
311
310
|
const label = trackedFiles ? "Tracked-file diagnostics partial" : "Diagnostics partial";
|
|
312
311
|
const summary = coverage ? `${label} (${coverage})` : label;
|
|
313
312
|
return new Text(theme.fg("warning", withDiagnosticScope(summary, data)), 0, 0);
|
|
314
313
|
}
|
|
315
|
-
if (section.itemCount === 0)
|
|
316
|
-
return new Text(
|
|
317
|
-
theme.fg("success", withDiagnosticScope(diagnosticEmptySummary(data), data)),
|
|
318
|
-
0,
|
|
319
|
-
0,
|
|
320
|
-
);
|
|
321
|
-
}
|
|
314
|
+
if (section.itemCount === 0) return buildEmptyDiagnosticSummary(data, theme);
|
|
322
315
|
|
|
323
316
|
const fileLabel = `${trackedFiles ? "tracked " : ""}${section.itemCount === 1 ? "file" : "files"}`;
|
|
324
317
|
return new Text(
|
|
@@ -32,13 +32,13 @@ function renderNode(
|
|
|
32
32
|
appendSyntaxRecovery(lines, observation.recovery);
|
|
33
33
|
const node = observation.data;
|
|
34
34
|
if (!node) {
|
|
35
|
-
lines.push("_No syntax node at this
|
|
35
|
+
lines.push("_No syntax node at this anchor._", "");
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
38
|
lines.push(
|
|
39
39
|
`- \`${node.type}\` L${node.startLine}:${node.startCharacter}–L${node.endLine}:${node.endCharacter}`,
|
|
40
40
|
);
|
|
41
|
-
if (node.text) lines
|
|
41
|
+
if (node.text) appendNodeText(lines, node);
|
|
42
42
|
if (node.ancestry.length > 0) {
|
|
43
43
|
lines.push(
|
|
44
44
|
`Ancestry: ${node.ancestry.map((ancestor) => `\`${ancestor.type} L${ancestor.startLine}:${ancestor.startCharacter}–L${ancestor.endLine}:${ancestor.endCharacter}\``).join(" > ")}`,
|
|
@@ -47,6 +47,33 @@ function renderNode(
|
|
|
47
47
|
lines.push("");
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
/** Preview bounds for syntax-node text; a whitespace anchor selects the whole file's root node. */
|
|
51
|
+
const NODE_TEXT_MAX_LINES = 12;
|
|
52
|
+
const NODE_TEXT_MAX_CHARACTERS = 1200;
|
|
53
|
+
|
|
54
|
+
/** Print a bounded preview of the node text; the range above locates the rest. */
|
|
55
|
+
function appendNodeText(
|
|
56
|
+
lines: string[],
|
|
57
|
+
node: { text: string; startLine: number; endLine: number },
|
|
58
|
+
): void {
|
|
59
|
+
const textLines = node.text.split("\n");
|
|
60
|
+
let shown = textLines.slice(0, NODE_TEXT_MAX_LINES).join("\n");
|
|
61
|
+
// Array.from keeps surrogate pairs whole when a single long line is cut.
|
|
62
|
+
const characters = Array.from(shown);
|
|
63
|
+
if (characters.length > NODE_TEXT_MAX_CHARACTERS) {
|
|
64
|
+
shown = characters.slice(0, NODE_TEXT_MAX_CHARACTERS).join("");
|
|
65
|
+
}
|
|
66
|
+
lines.push("```text", shown, "```");
|
|
67
|
+
if (shown.length === node.text.length) return;
|
|
68
|
+
const preview =
|
|
69
|
+
textLines.length > NODE_TEXT_MAX_LINES
|
|
70
|
+
? `first ${NODE_TEXT_MAX_LINES} of ${textLines.length} lines`
|
|
71
|
+
: `first ${NODE_TEXT_MAX_CHARACTERS} characters`;
|
|
72
|
+
lines.push(
|
|
73
|
+
`_Node text shortened to the ${preview}; read L${node.startLine}–L${node.endLine} for the rest._`,
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
50
77
|
function renderEnclosingSymbol(
|
|
51
78
|
lines: string[],
|
|
52
79
|
observation: InspectResultAssembly["data"]["sections"]["enclosingSymbol"],
|
|
@@ -60,7 +87,7 @@ function renderEnclosingSymbol(
|
|
|
60
87
|
appendSyntaxRecovery(lines, observation.recovery);
|
|
61
88
|
const symbol = observation.data;
|
|
62
89
|
if (!symbol) {
|
|
63
|
-
lines.push("_No provider-reported declaration encloses this
|
|
90
|
+
lines.push("_No provider-reported declaration encloses this anchor._", "");
|
|
64
91
|
return;
|
|
65
92
|
}
|
|
66
93
|
lines.push(
|
|
@@ -79,7 +106,7 @@ function renderHover(
|
|
|
79
106
|
return;
|
|
80
107
|
}
|
|
81
108
|
appendPartial(lines, observation);
|
|
82
|
-
lines.push(observation.data ?? "_No hover result at this
|
|
109
|
+
lines.push(observation.data ?? "_No hover result at this anchor._", "");
|
|
83
110
|
}
|
|
84
111
|
|
|
85
112
|
function renderDefinitions(lines: string[], assembly: InspectResultAssembly): void {
|
|
@@ -88,7 +115,7 @@ function renderDefinitions(lines: string[], assembly: InspectResultAssembly): vo
|
|
|
88
115
|
if (appendUnavailable(lines, observation)) return;
|
|
89
116
|
appendPartial(lines, observation);
|
|
90
117
|
if (assembly.displayedDefinitions.length === 0) {
|
|
91
|
-
lines.push("_No definition result at this
|
|
118
|
+
lines.push("_No definition result at this anchor._");
|
|
92
119
|
} else {
|
|
93
120
|
for (const definition of assembly.displayedDefinitions) {
|
|
94
121
|
lines.push(`- ${formatDefinition(definition, assembly.data)}`);
|
|
@@ -109,7 +136,7 @@ function formatDefinition(
|
|
|
109
136
|
return `\`${definition.file}:${definition.line}:${definition.character}\``;
|
|
110
137
|
}
|
|
111
138
|
if (definition.line === focus.line && definition.character === focus.character)
|
|
112
|
-
return "Same
|
|
139
|
+
return "Same anchor";
|
|
113
140
|
return `L${definition.line}:${definition.character}`;
|
|
114
141
|
}
|
|
115
142
|
|
|
@@ -109,9 +109,9 @@ function buildInspectDisplaySections(input: {
|
|
|
109
109
|
key: "inspect.node",
|
|
110
110
|
title: "Syntax node",
|
|
111
111
|
items: [node],
|
|
112
|
-
|
|
112
|
+
evidence: observationEvidence("inspect.node", data.sections.node),
|
|
113
|
+
format: (item: typeof node) =>
|
|
113
114
|
`${item.type} at ${data.relPath}:${item.startLine}:${item.startCharacter}–${item.endLine}:${item.endCharacter}${item.text ? ` — ${truncateDisplayText(item.text, 160)}` : ""}`,
|
|
114
|
-
partialReason: observationReason(data.sections.node),
|
|
115
115
|
}),
|
|
116
116
|
);
|
|
117
117
|
}
|
|
@@ -123,9 +123,9 @@ function buildInspectDisplaySections(input: {
|
|
|
123
123
|
key: "inspect.enclosingSymbol",
|
|
124
124
|
title: "Enclosing symbol",
|
|
125
125
|
items: [symbol],
|
|
126
|
-
|
|
126
|
+
evidence: observationEvidence("inspect.enclosingSymbol", data.sections.enclosingSymbol),
|
|
127
|
+
format: (item: typeof symbol) =>
|
|
127
128
|
`${item.name} (${item.kind}) L${item.startLine}:${item.startCharacter}–L${item.endLine}:${item.endCharacter}`,
|
|
128
|
-
partialReason: observationReason(data.sections.enclosingSymbol),
|
|
129
129
|
}),
|
|
130
130
|
);
|
|
131
131
|
}
|
|
@@ -136,36 +136,33 @@ function buildInspectDisplaySections(input: {
|
|
|
136
136
|
key: "inspect.hover",
|
|
137
137
|
title: "Hover",
|
|
138
138
|
items: [data.sections.hover.data],
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
evidence: observationEvidence("inspect.hover", data.sections.hover),
|
|
140
|
+
format: (hover: string) => truncateDisplayText(hover, 240),
|
|
141
141
|
}),
|
|
142
142
|
);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
if (input.displayedDefinitions.length > 0) {
|
|
145
|
+
if (input.definitionEvidence && input.displayedDefinitions.length > 0) {
|
|
146
146
|
sections.push(
|
|
147
147
|
createToolDisplaySection({
|
|
148
148
|
key: "inspect.definitions",
|
|
149
149
|
title: "Definitions",
|
|
150
150
|
items: input.displayedDefinitions,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
format: (definition) => `${definition.file}:${definition.line}:${definition.character}`,
|
|
151
|
+
evidence: input.definitionEvidence.metadata,
|
|
152
|
+
format: (definition: InspectDefinition) =>
|
|
153
|
+
`${definition.file}:${definition.line}:${definition.character}`,
|
|
155
154
|
}),
|
|
156
155
|
);
|
|
157
156
|
}
|
|
158
157
|
|
|
159
|
-
if (input.displayedDiagnostics.length > 0) {
|
|
158
|
+
if (input.diagnosticEvidence && input.displayedDiagnostics.length > 0) {
|
|
160
159
|
sections.push(
|
|
161
160
|
createToolDisplaySection({
|
|
162
161
|
key: "inspect.diagnostics",
|
|
163
162
|
title: "Diagnostics",
|
|
164
163
|
items: input.displayedDiagnostics,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
partialReason: input.diagnosticEvidence?.metadata.partialReason,
|
|
168
|
-
format: (diagnostic) =>
|
|
164
|
+
evidence: input.diagnosticEvidence.metadata,
|
|
165
|
+
format: (diagnostic: InspectDiagnostic) =>
|
|
169
166
|
`L${diagnostic.line}:${diagnostic.character} ${formatDiagnosticSeverity(diagnostic.severity)}: ${truncateDisplayText(diagnostic.message, 200)}`,
|
|
170
167
|
}),
|
|
171
168
|
);
|
|
@@ -174,8 +171,16 @@ function buildInspectDisplaySections(input: {
|
|
|
174
171
|
return sections;
|
|
175
172
|
}
|
|
176
173
|
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
/** One Point inspection observation is one Evidence atom. */
|
|
175
|
+
function observationEvidence<T>(key: string, observation: InspectObservation<T>) {
|
|
176
|
+
return observation.kind === "partial"
|
|
177
|
+
? createPartialEvidenceList({
|
|
178
|
+
key,
|
|
179
|
+
items: [key],
|
|
180
|
+
partialReason: "provider-limited",
|
|
181
|
+
partialMessage: observation.reason,
|
|
182
|
+
}).metadata
|
|
183
|
+
: createEvidenceList({ key, items: [key] }).metadata;
|
|
179
184
|
}
|
|
180
185
|
|
|
181
186
|
function formatDiagnosticSeverity(severity: number): string {
|
|
@@ -336,7 +341,7 @@ type InspectOutcome = Awaited<ReturnType<CodeIntelToolExecCtx["session"]["inspec
|
|
|
336
341
|
export function finishInspectResult(outcome: InspectOutcome): CodeIntelResult {
|
|
337
342
|
if (outcome.kind === "unavailable") throw new Error(outcome.reason);
|
|
338
343
|
if (outcome.kind === "invalid-input") {
|
|
339
|
-
const nextQueries = ["Provide an existing file and exact 1-based
|
|
344
|
+
const nextQueries = ["Provide an existing file and exact 1-based anchor"];
|
|
340
345
|
return {
|
|
341
346
|
...inspectErrorResult(`**Error:** ${outcome.message}`, {
|
|
342
347
|
focusTarget: "invalid input",
|
|
@@ -12,15 +12,23 @@ export const CODE_INSPECT_TOOL_LABEL = "Code Inspect";
|
|
|
12
12
|
export const codeInspectSpec = {
|
|
13
13
|
name: CODE_INSPECT_TOOL_NAME,
|
|
14
14
|
label: CODE_INSPECT_TOOL_LABEL,
|
|
15
|
+
annotations: {
|
|
16
|
+
readOnlyHint: true,
|
|
17
|
+
destructiveHint: false,
|
|
18
|
+
idempotentHint: true,
|
|
19
|
+
openWorldHint: false,
|
|
20
|
+
},
|
|
15
21
|
outputSchema: InspectOutputSchema,
|
|
16
22
|
parameters: Type.Object(
|
|
17
23
|
{
|
|
18
|
-
|
|
19
|
-
maxResults: Type.Optional(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
anchor: SourcePointParam,
|
|
25
|
+
maxResults: Type.Optional(
|
|
26
|
+
Type.Integer({
|
|
27
|
+
...MaxResultsParam,
|
|
28
|
+
description:
|
|
29
|
+
"Maximum entries per definition or diagnostic list; does not limit syntax or hover text.",
|
|
30
|
+
}),
|
|
31
|
+
),
|
|
24
32
|
},
|
|
25
33
|
{ additionalProperties: false },
|
|
26
34
|
),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Static, type TSchema, Type } from "typebox";
|
|
2
|
+
import { toEvidenceListFacts } from "../../analysis/evidence.ts";
|
|
2
3
|
import type { InspectObservation } from "../../session/inspect-types.ts";
|
|
3
4
|
import { ConfidenceSchema, EvidenceListSchema, RecoveryRangeSchema } from "../result/structured.ts";
|
|
4
5
|
import type { InspectResultAssembly } from "./result.ts";
|
|
@@ -78,7 +79,7 @@ export const InspectOutputSchema = Type.Union([
|
|
|
78
79
|
Type.Object(
|
|
79
80
|
{
|
|
80
81
|
kind: Type.Literal("completed"),
|
|
81
|
-
|
|
82
|
+
anchor: Type.Object(
|
|
82
83
|
{ file: Type.String(), line: Type.Integer(), character: Type.Integer() },
|
|
83
84
|
{ additionalProperties: false },
|
|
84
85
|
),
|
|
@@ -141,7 +142,7 @@ export function structuredInspectResult(
|
|
|
141
142
|
const { data, assembled } = assembly;
|
|
142
143
|
return {
|
|
143
144
|
kind: "completed",
|
|
144
|
-
|
|
145
|
+
anchor: { file: data.relPath, line: data.line, character: data.character },
|
|
145
146
|
confidence: data.confidence,
|
|
146
147
|
diagnosticWindow: {
|
|
147
148
|
startLine: data.diagnosticWindow.startLine,
|
|
@@ -203,25 +204,7 @@ export function structuredInspectResult(
|
|
|
203
204
|
),
|
|
204
205
|
),
|
|
205
206
|
},
|
|
206
|
-
evidenceLists: assembled.evidenceLists.map(
|
|
207
|
-
({
|
|
208
|
-
key,
|
|
209
|
-
totalCount,
|
|
210
|
-
shownCount,
|
|
211
|
-
omittedCount,
|
|
212
|
-
partialReason,
|
|
213
|
-
partialMessage,
|
|
214
|
-
invalidLocationCount,
|
|
215
|
-
}) => ({
|
|
216
|
-
key,
|
|
217
|
-
totalCount,
|
|
218
|
-
shownCount,
|
|
219
|
-
omittedCount,
|
|
220
|
-
partialReason,
|
|
221
|
-
...(partialMessage === undefined ? {} : { partialMessage }),
|
|
222
|
-
...(invalidLocationCount === undefined ? {} : { invalidLocationCount }),
|
|
223
|
-
}),
|
|
224
|
-
),
|
|
207
|
+
evidenceLists: assembled.evidenceLists.map(toEvidenceListFacts),
|
|
225
208
|
provenance: assembled.provenance.map(({ source, capability }) => ({
|
|
226
209
|
source: source as "semantic" | "structural",
|
|
227
210
|
capability: capability ?? "",
|
|
@@ -16,11 +16,11 @@ export function renderInspectCall(
|
|
|
16
16
|
_context: ToolRendererContext | undefined,
|
|
17
17
|
): Text {
|
|
18
18
|
const params = (args ?? {}) as {
|
|
19
|
-
|
|
19
|
+
anchor?: { file?: unknown; line?: unknown; character?: unknown };
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
let content = theme.fg("toolTitle", "code_inspect");
|
|
23
|
-
const point = params.
|
|
23
|
+
const point = params.anchor;
|
|
24
24
|
if (point && typeof point === "object") {
|
|
25
25
|
const file = formatCallPath(point.file);
|
|
26
26
|
if (file) content += ` ${theme.fg("accent", file)}`;
|