@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
|
@@ -11,6 +11,13 @@ export const CODE_REFACTOR_APPLY_TOOL_LABEL = "Code Refactor Apply";
|
|
|
11
11
|
export const codeRefactorApplySpec = {
|
|
12
12
|
name: CODE_REFACTOR_APPLY_TOOL_NAME,
|
|
13
13
|
label: CODE_REFACTOR_APPLY_TOOL_LABEL,
|
|
14
|
+
// Overwrites workspace files; a repeated planId is rejected because Apply consumes the plan.
|
|
15
|
+
annotations: {
|
|
16
|
+
readOnlyHint: false,
|
|
17
|
+
destructiveHint: true,
|
|
18
|
+
idempotentHint: true,
|
|
19
|
+
openWorldHint: false,
|
|
20
|
+
},
|
|
14
21
|
parameters: Type.Object(
|
|
15
22
|
{
|
|
16
23
|
planId: Type.String({
|
|
@@ -4,13 +4,11 @@ import type {
|
|
|
4
4
|
RefactorOperationInput,
|
|
5
5
|
RefactorPlanWorkflowInput,
|
|
6
6
|
} from "../../session/refactor-types.ts";
|
|
7
|
-
import type { RefactorTargetInput } from "../../session/target-input.ts";
|
|
8
7
|
import type { CodeIntelResult, CodeIntelToolExecCtx } from "../../types/index.ts";
|
|
9
8
|
import { toWorkflowControl } from "../infra/workflow-control.ts";
|
|
10
9
|
import { finishRefactorPlanResult } from "./result.ts";
|
|
11
10
|
|
|
12
11
|
export interface CodeRefactorPlanToolParams {
|
|
13
|
-
target: RefactorTargetInput;
|
|
14
12
|
operation: RefactorOperationInput;
|
|
15
13
|
}
|
|
16
14
|
|
|
@@ -5,7 +5,8 @@ import type { CodeIntelResult, CodeIntelToolExecCtx } from "../../types/index.ts
|
|
|
5
5
|
import { renderRefactorPlanResult } from "../refactor-markdown.ts";
|
|
6
6
|
import { searchErrorResult } from "../result/errors.ts";
|
|
7
7
|
import { assembleRefactorPlanDetails } from "../result/refactor.ts";
|
|
8
|
-
import {
|
|
8
|
+
import { refactorUnavailableReason } from "../result/refactor-unavailable.ts";
|
|
9
|
+
import { AMBIGUOUS_NEXT_ACTION, structuredRefactorPlan } from "./structured.ts";
|
|
9
10
|
|
|
10
11
|
type RefactorPlanOutcome = Awaited<ReturnType<CodeIntelToolExecCtx["session"]["planRefactor"]>>;
|
|
11
12
|
|
|
@@ -14,28 +15,37 @@ export function finishRefactorPlanResult(
|
|
|
14
15
|
outcome: RefactorPlanOutcome,
|
|
15
16
|
cwd: string,
|
|
16
17
|
): CodeIntelResult {
|
|
17
|
-
if (outcome.kind === "unavailable") throw new Error(outcome.reason);
|
|
18
|
+
if (outcome.kind === "unavailable") throw new Error(refactorUnavailableReason(outcome.reason));
|
|
18
19
|
if (outcome.kind === "invalid-input") {
|
|
19
20
|
return {
|
|
20
21
|
...searchErrorResult(`**Error:** ${outcome.message}`, {
|
|
21
|
-
nextQueries: ["Fix the
|
|
22
|
+
nextQueries: ["Fix the operation input and retry"],
|
|
22
23
|
message: outcome.message,
|
|
23
24
|
}),
|
|
24
25
|
structuredContent: structuredRefactorPlan(outcome, cwd),
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
28
|
if (outcome.kind === "ambiguous") {
|
|
28
|
-
const candidates = outcome.candidates
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
const candidates = outcome.candidates.map((candidate, index) => {
|
|
30
|
+
const label =
|
|
31
|
+
candidate.title === undefined
|
|
32
|
+
? candidate.description
|
|
33
|
+
: `${candidate.kind ? `\`${candidate.kind}\` — ` : ""}${JSON.stringify(candidate.title)}`;
|
|
34
|
+
const location =
|
|
35
|
+
candidate.file === undefined
|
|
36
|
+
? ""
|
|
37
|
+
: ` — first edit ${toDisplayPath(cwd, candidate.file)}:${candidate.line}`;
|
|
38
|
+
return `${index + 1}. ${label}${location}`;
|
|
39
|
+
});
|
|
34
40
|
return {
|
|
35
|
-
...searchErrorResult(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
...searchErrorResult(
|
|
42
|
+
`**Refactor ambiguous:**\n${candidates.join("\n")}\n\n${AMBIGUOUS_NEXT_ACTION}.`,
|
|
43
|
+
{
|
|
44
|
+
status: "disambiguation",
|
|
45
|
+
nextQueries: [AMBIGUOUS_NEXT_ACTION],
|
|
46
|
+
message: "Several matching actions produce different edits.",
|
|
47
|
+
},
|
|
48
|
+
),
|
|
39
49
|
structuredContent: structuredRefactorPlan(outcome, cwd),
|
|
40
50
|
};
|
|
41
51
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Type } from "typebox";
|
|
2
2
|
import type { CodeIntelToolExecCtx } from "../../types/index.ts";
|
|
3
|
-
import { RefactorOperationParam
|
|
3
|
+
import { RefactorOperationParam } from "../schemas.ts";
|
|
4
4
|
import { executeRefactorPlanTool } from "./execute.ts";
|
|
5
5
|
import { RefactorPlanOutputSchema } from "./structured.ts";
|
|
6
6
|
import { renderRefactorPlanCall, renderRefactorPlanResult } from "./tui.ts";
|
|
@@ -12,9 +12,15 @@ export const CODE_REFACTOR_PLAN_TOOL_LABEL = "Code Refactor Plan";
|
|
|
12
12
|
export const codeRefactorPlanSpec = {
|
|
13
13
|
name: CODE_REFACTOR_PLAN_TOOL_NAME,
|
|
14
14
|
label: CODE_REFACTOR_PLAN_TOOL_LABEL,
|
|
15
|
+
// Previews only: server-pushed edits are captured and refused; no file changes.
|
|
16
|
+
annotations: {
|
|
17
|
+
readOnlyHint: true,
|
|
18
|
+
destructiveHint: false,
|
|
19
|
+
idempotentHint: true,
|
|
20
|
+
openWorldHint: false,
|
|
21
|
+
},
|
|
15
22
|
parameters: Type.Object(
|
|
16
23
|
{
|
|
17
|
-
target: RefactorTargetParam,
|
|
18
24
|
operation: RefactorOperationParam,
|
|
19
25
|
},
|
|
20
26
|
{ additionalProperties: false },
|
|
@@ -23,9 +23,30 @@ const Edit = Type.Object(
|
|
|
23
23
|
},
|
|
24
24
|
{ additionalProperties: false },
|
|
25
25
|
);
|
|
26
|
+
const OnePosition = Type.Object(
|
|
27
|
+
{ line: Type.Integer({ minimum: 1 }), character: Type.Integer({ minimum: 1 }) },
|
|
28
|
+
{ additionalProperties: false },
|
|
29
|
+
);
|
|
30
|
+
const Action = Type.Object(
|
|
31
|
+
{
|
|
32
|
+
kind: Type.String(),
|
|
33
|
+
title: Type.String(),
|
|
34
|
+
provenance: Type.Optional(
|
|
35
|
+
Type.Union([Type.Literal("edit"), Type.Literal("captured-command")], {
|
|
36
|
+
description:
|
|
37
|
+
"edit: the action's own edit. captured-command: the edit the server pushed while running the action's command; SuPi refused it, so nothing was applied.",
|
|
38
|
+
}),
|
|
39
|
+
),
|
|
40
|
+
},
|
|
41
|
+
{ additionalProperties: false, description: "Server-reported code action kind and title." },
|
|
42
|
+
);
|
|
26
43
|
const Candidate = Type.Object(
|
|
27
44
|
{
|
|
28
45
|
description: Type.String(),
|
|
46
|
+
kind: Type.Optional(Type.String()),
|
|
47
|
+
title: Type.Optional(
|
|
48
|
+
Type.String({ description: "Pass back as the operation `title` to select this action." }),
|
|
49
|
+
),
|
|
29
50
|
file: Type.Optional(Type.String()),
|
|
30
51
|
line: Type.Optional(Type.Integer()),
|
|
31
52
|
character: Type.Optional(Type.Integer()),
|
|
@@ -37,6 +58,10 @@ const Candidate = Type.Object(
|
|
|
37
58
|
},
|
|
38
59
|
);
|
|
39
60
|
|
|
61
|
+
/** Guidance for choosing among matching code actions. */
|
|
62
|
+
export const AMBIGUOUS_NEXT_ACTION =
|
|
63
|
+
"Several matching actions produce different edits; repeat the call with one candidate's exact `title`";
|
|
64
|
+
|
|
40
65
|
/** Native plan data, including all edits rather than the bounded text preview. */
|
|
41
66
|
export const RefactorPlanOutputSchema = Type.Union([
|
|
42
67
|
Type.Object(
|
|
@@ -44,12 +69,27 @@ export const RefactorPlanOutputSchema = Type.Union([
|
|
|
44
69
|
kind: Type.Literal("completed"),
|
|
45
70
|
planId: Type.String(),
|
|
46
71
|
operation: Type.Enum([...PUBLIC_REFACTOR_OPERATION_NAMES], { type: "string" }),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
72
|
+
file: Type.String({ description: "File the operation was requested for." }),
|
|
73
|
+
target: Type.Optional(
|
|
74
|
+
Type.Object(
|
|
75
|
+
{ line: Type.Integer(), character: Type.Integer() },
|
|
76
|
+
{
|
|
77
|
+
additionalProperties: false,
|
|
78
|
+
description: "rename_symbol target; one-based line and UTF-16 character.",
|
|
79
|
+
},
|
|
80
|
+
),
|
|
81
|
+
),
|
|
82
|
+
range: Type.Optional(
|
|
83
|
+
Type.Object(
|
|
84
|
+
{ start: OnePosition, end: OnePosition },
|
|
85
|
+
{
|
|
86
|
+
additionalProperties: false,
|
|
87
|
+
description: "code_action range; one-based positions, end exclusive.",
|
|
88
|
+
},
|
|
89
|
+
),
|
|
50
90
|
),
|
|
51
91
|
newName: Type.Optional(Type.String()),
|
|
52
|
-
|
|
92
|
+
action: Type.Optional(Action),
|
|
53
93
|
edits: Type.Array(Edit),
|
|
54
94
|
fileCount: Type.Integer({ minimum: 0 }),
|
|
55
95
|
editCount: Type.Integer({ minimum: 0 }),
|
|
@@ -84,18 +124,20 @@ export function structuredRefactorPlan(
|
|
|
84
124
|
return {
|
|
85
125
|
kind: outcome.kind,
|
|
86
126
|
message: outcome.message,
|
|
87
|
-
nextAction: "Fix the
|
|
127
|
+
nextAction: "Fix the operation input and retry",
|
|
88
128
|
};
|
|
89
129
|
if (outcome.kind === "ambiguous")
|
|
90
130
|
return {
|
|
91
131
|
kind: outcome.kind,
|
|
92
132
|
candidates: outcome.candidates.map((candidate) => ({
|
|
93
133
|
description: candidate.description,
|
|
134
|
+
...(candidate.kind === undefined ? {} : { kind: candidate.kind }),
|
|
135
|
+
...(candidate.title === undefined ? {} : { title: candidate.title }),
|
|
94
136
|
...(candidate.file === undefined ? {} : { file: toDisplayPath(cwd, candidate.file) }),
|
|
95
137
|
...(candidate.line === undefined ? {} : { line: candidate.line }),
|
|
96
138
|
...(candidate.character === undefined ? {} : { character: candidate.character }),
|
|
97
139
|
})),
|
|
98
|
-
nextAction:
|
|
140
|
+
nextAction: AMBIGUOUS_NEXT_ACTION,
|
|
99
141
|
};
|
|
100
142
|
const plan = outcome.plan;
|
|
101
143
|
const operation = PUBLIC_REFACTOR_OPERATION_NAMES.find((name) => name === plan.operation);
|
|
@@ -104,13 +146,18 @@ export function structuredRefactorPlan(
|
|
|
104
146
|
kind: "completed",
|
|
105
147
|
planId: plan.id,
|
|
106
148
|
operation,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
149
|
+
file: toDisplayPath(cwd, plan.file),
|
|
150
|
+
...(plan.target === undefined ? {} : { target: { ...plan.target } }),
|
|
151
|
+
...(plan.range === undefined
|
|
152
|
+
? {}
|
|
153
|
+
: {
|
|
154
|
+
range: {
|
|
155
|
+
start: { ...plan.range.start },
|
|
156
|
+
end: { ...plan.range.end },
|
|
157
|
+
},
|
|
158
|
+
}),
|
|
112
159
|
...(plan.newName === undefined ? {} : { newName: plan.newName }),
|
|
113
|
-
...(plan.
|
|
160
|
+
...(plan.action === undefined ? {} : { action: { ...plan.action } }),
|
|
114
161
|
edits: plan.edits.edits.map((edit) => ({
|
|
115
162
|
file: toDisplayPath(cwd, edit.file),
|
|
116
163
|
range: {
|
|
@@ -16,28 +16,25 @@ export function renderRefactorPlanCall(
|
|
|
16
16
|
theme: Theme,
|
|
17
17
|
_context: ToolRendererContext | undefined,
|
|
18
18
|
): Text {
|
|
19
|
-
const params = (args ?? {}) as {
|
|
20
|
-
operation?: Record<string, { newName?: unknown } | undefined>;
|
|
21
|
-
target?: { anchor?: { file?: unknown }; handle?: unknown };
|
|
22
|
-
};
|
|
19
|
+
const params = (args ?? {}) as { operation?: Record<string, unknown> };
|
|
23
20
|
|
|
24
21
|
let content = theme.fg("toolTitle", "code_refactor_plan");
|
|
25
22
|
const operation = params.operation ? Object.entries(params.operation)[0] : undefined;
|
|
26
23
|
if (operation) {
|
|
27
24
|
content += ` ${theme.fg("accent", formatCallValue(operation[0], 40) ?? "operation")}`;
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (
|
|
25
|
+
const payload = (operation[1] ?? {}) as {
|
|
26
|
+
newName?: unknown;
|
|
27
|
+
kind?: unknown;
|
|
28
|
+
file?: unknown;
|
|
29
|
+
target?: { anchor?: { file?: unknown }; handle?: unknown };
|
|
30
|
+
};
|
|
31
|
+
const detail = formatCallValue(payload.newName) ?? formatCallValue(payload.kind);
|
|
32
|
+
if (detail) content += ` ${theme.fg("muted", detail)}`;
|
|
33
|
+
const location =
|
|
34
|
+
formatCallPath(payload.file) ??
|
|
35
|
+
formatCallPath(payload.target?.anchor?.file) ??
|
|
36
|
+
formatCallValue(payload.target?.handle);
|
|
37
|
+
if (location) content += ` ${theme.fg("muted", location)}`;
|
|
41
38
|
}
|
|
42
39
|
|
|
43
40
|
return new Text(content, 0, 0);
|
|
@@ -4,7 +4,6 @@ import { renderEvidenceListMetadataDisclosure } from "../../analysis/evidence.ts
|
|
|
4
4
|
import { toDisplayPath } from "../../analysis/search/paths.ts";
|
|
5
5
|
import type { TargetProviderProvenance } from "../../session/target-store.ts";
|
|
6
6
|
import type { TargetWorkflowOutcome } from "../../session/target-workflow.ts";
|
|
7
|
-
import { formatPartialCandidateDisclosure } from "../result/candidate-row.ts";
|
|
8
7
|
import type { ResolveDetails } from "../result/types.ts";
|
|
9
8
|
import type { ResolveResultAssembly } from "./result.ts";
|
|
10
9
|
|
|
@@ -17,9 +16,10 @@ export function renderResolveResult(assembly: ResolveResultAssembly): string {
|
|
|
17
16
|
case "file-outline":
|
|
18
17
|
return renderFileOutline(assembly.details);
|
|
19
18
|
case "disambiguation":
|
|
20
|
-
return renderDisambiguation(assembly.details);
|
|
21
19
|
case "kind-mismatch":
|
|
22
|
-
|
|
20
|
+
if (!assembly.selection)
|
|
21
|
+
throw new Error(`Resolve ${outcome.kind} lacks a candidate selection`);
|
|
22
|
+
return assembly.selection.content;
|
|
23
23
|
case "invalid-input":
|
|
24
24
|
return `**Error:** ${outcome.message}`;
|
|
25
25
|
case "unavailable":
|
|
@@ -158,7 +158,7 @@ function appendNotListed(lines: string[], details: ResolveDetails): void {
|
|
|
158
158
|
: []),
|
|
159
159
|
...(notListed.exportListNames
|
|
160
160
|
? [
|
|
161
|
-
`- ${plural(notListed.exportListNames.count, "name")} in export lists (${span(notListed.exportListNames)}). Read those lines, or find them with code_find
|
|
161
|
+
`- ${plural(notListed.exportListNames.count, "name")} in export lists (${span(notListed.exportListNames)}). Read those lines, or find them with code_find search.ast, kind "export", a name fragment as query, and scopes set to this file.`,
|
|
162
162
|
]
|
|
163
163
|
: []),
|
|
164
164
|
...(notListed.localDeclarations > 0
|
|
@@ -191,50 +191,8 @@ function appendUnknownLevelDisclosure(lines: string[], count: number): void {
|
|
|
191
191
|
);
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
function renderDisambiguation(details: ResolveDetails): string {
|
|
195
|
-
const lines = [
|
|
196
|
-
"# Multiple matches found",
|
|
197
|
-
"",
|
|
198
|
-
"Choose one handle, or narrow target.symbol with scope or symbolKind:",
|
|
199
|
-
"",
|
|
200
|
-
];
|
|
201
|
-
appendCandidates(lines, details);
|
|
202
|
-
appendDisclosure(lines, details);
|
|
203
|
-
return lines.join("\n");
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
function renderKindMismatch(details: ResolveDetails): string {
|
|
207
|
-
const lines = [
|
|
208
|
-
"# No exact symbol-kind match",
|
|
209
|
-
"",
|
|
210
|
-
`No query candidate was reported as provider kind \`${details.requestedKind ?? "unknown"}\`.`,
|
|
211
|
-
"Near matches:",
|
|
212
|
-
"",
|
|
213
|
-
];
|
|
214
|
-
appendCandidates(lines, details);
|
|
215
|
-
lines.push(
|
|
216
|
-
"",
|
|
217
|
-
"Retry without `symbolKind`, use an observed provider kind, or choose a handle explicitly.",
|
|
218
|
-
);
|
|
219
|
-
appendDisclosure(lines, details);
|
|
220
|
-
return lines.join("\n");
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
function appendCandidates(lines: string[], details: ResolveDetails): void {
|
|
224
|
-
for (const candidate of details.candidates ?? []) {
|
|
225
|
-
const kind = candidate.kind ? ` (\`${candidate.kind}\`)` : "";
|
|
226
|
-
const container = candidate.container ? ` in \`${candidate.container}\`` : "";
|
|
227
|
-
lines.push(
|
|
228
|
-
`${candidate.rank}. **${candidate.name}**${kind}${container} — \`${candidate.file}\`:${candidate.line}:${candidate.character}`,
|
|
229
|
-
` Target ID: \`${candidate.targetId}\``,
|
|
230
|
-
);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
194
|
function appendDisclosure(lines: string[], details: ResolveDetails): void {
|
|
235
195
|
const evidence = details.evidenceLists?.[0];
|
|
236
|
-
const disclosure = evidence
|
|
237
|
-
? (formatPartialCandidateDisclosure(evidence) ?? renderEvidenceListMetadataDisclosure(evidence))
|
|
238
|
-
: null;
|
|
196
|
+
const disclosure = evidence ? renderEvidenceListMetadataDisclosure(evidence) : null;
|
|
239
197
|
if (disclosure) lines.push("", disclosure);
|
|
240
198
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ConfidenceMode } from "@mrclrchtr/supi-code-runtime/api";
|
|
2
2
|
import type { EvidenceListMetadata } from "../../analysis/evidence.ts";
|
|
3
|
-
import { createEvidenceList } from "../../analysis/evidence.ts";
|
|
3
|
+
import { createEvidenceList, knownEvidenceCount } from "../../analysis/evidence.ts";
|
|
4
4
|
import { toDisplayPath } from "../../analysis/search/paths.ts";
|
|
5
5
|
import type { ResolveTargetInput } from "../../session/target-input.ts";
|
|
6
6
|
import type { TargetStoreEntry } from "../../session/target-store.ts";
|
|
@@ -11,7 +11,11 @@ import {
|
|
|
11
11
|
type ResultProvenance,
|
|
12
12
|
type ToolResultAssembly,
|
|
13
13
|
} from "../result/assembly.ts";
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
assembleCandidateSelection,
|
|
16
|
+
type CandidateSelection,
|
|
17
|
+
type SelectionCandidate,
|
|
18
|
+
} from "../result/candidate-selection.ts";
|
|
15
19
|
import { createToolDisplaySection } from "../result/display.ts";
|
|
16
20
|
import { scopedSymbolFailureMessage } from "../result/errors.ts";
|
|
17
21
|
import type {
|
|
@@ -27,6 +31,8 @@ export interface ResolveResultAssembly {
|
|
|
27
31
|
readonly assembled: ToolResultAssembly<TargetWorkflowOutcome>;
|
|
28
32
|
readonly details: ResolveDetails;
|
|
29
33
|
readonly displaySections: readonly ToolDisplaySection[];
|
|
34
|
+
/** Canonical Candidate selection for disambiguation and Symbol-kind mismatch. */
|
|
35
|
+
readonly selection: CandidateSelection<SelectionCandidate> | null;
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
interface ResolveProjection {
|
|
@@ -37,6 +43,7 @@ interface ResolveProjection {
|
|
|
37
43
|
readonly confidence: ConfidenceMode;
|
|
38
44
|
readonly evidence: EvidenceListMetadata | null;
|
|
39
45
|
readonly details: ResolveDetails;
|
|
46
|
+
readonly selection?: CandidateSelection<SelectionCandidate>;
|
|
40
47
|
}
|
|
41
48
|
|
|
42
49
|
/** Assemble resolved-target facts before markdown and TUI adapters render them. */
|
|
@@ -77,7 +84,8 @@ export function assembleResolveResult(
|
|
|
77
84
|
cwd,
|
|
78
85
|
assembled,
|
|
79
86
|
details,
|
|
80
|
-
displaySections: resolveDisplaySections(details),
|
|
87
|
+
displaySections: projection.selection?.displaySections ?? resolveDisplaySections(details),
|
|
88
|
+
selection: projection.selection ?? null,
|
|
81
89
|
});
|
|
82
90
|
}
|
|
83
91
|
|
|
@@ -125,18 +133,8 @@ function projectFileOutline(
|
|
|
125
133
|
outcome: Extract<TargetWorkflowOutcome, { kind: "file-outline" }>,
|
|
126
134
|
cwd: string,
|
|
127
135
|
): ResolveProjection {
|
|
128
|
-
const evidence = {
|
|
129
|
-
|
|
130
|
-
items: [...outcome.targets],
|
|
131
|
-
metadata: {
|
|
132
|
-
key: "resolve.targets",
|
|
133
|
-
totalCount: outcome.totalCount,
|
|
134
|
-
shownCount: outcome.targets.length,
|
|
135
|
-
omittedCount: outcome.omittedCount,
|
|
136
|
-
partialReason: outcome.partial ? ("provider-limited" as const) : null,
|
|
137
|
-
partialMessage: outcome.partial?.reason,
|
|
138
|
-
},
|
|
139
|
-
};
|
|
136
|
+
const evidence = { items: [...outcome.targets], metadata: outcome.targetEvidence };
|
|
137
|
+
const declarationCount = knownEvidenceCount(outcome.targetEvidence);
|
|
140
138
|
return {
|
|
141
139
|
key: "resolve.file-outline",
|
|
142
140
|
title: "File outline",
|
|
@@ -153,12 +151,12 @@ function projectFileOutline(
|
|
|
153
151
|
outlineErrorRanges: outcome.partial?.errorRanges,
|
|
154
152
|
outlineNotListed: outcome.notListed,
|
|
155
153
|
confidence: outcome.confidence,
|
|
156
|
-
targetCount:
|
|
157
|
-
omittedCount: evidence.metadata.omittedCount,
|
|
154
|
+
targetCount: declarationCount,
|
|
155
|
+
omittedCount: evidence.metadata.omittedCount ?? 0,
|
|
158
156
|
evidenceLists: [evidence.metadata],
|
|
159
157
|
targets: evidence.items.map((target) => toTargetDetails(target, cwd)),
|
|
160
158
|
nextQueries:
|
|
161
|
-
|
|
159
|
+
declarationCount > 0
|
|
162
160
|
? [
|
|
163
161
|
"Pass one declaration handle from the file outline as target.handle to code_graph, code_inspect, or code_refactor_plan",
|
|
164
162
|
]
|
|
@@ -171,45 +169,37 @@ function projectCandidateOutcome(
|
|
|
171
169
|
outcome: Extract<TargetWorkflowOutcome, { kind: "disambiguation" | "kind-mismatch" }>,
|
|
172
170
|
cwd: string,
|
|
173
171
|
): ResolveProjection {
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
totalCount: outcome.totalCount,
|
|
177
|
-
shownCount: outcome.candidates.length,
|
|
178
|
-
omittedCount: outcome.omittedCount,
|
|
179
|
-
partialReason: outcome.partialReason,
|
|
180
|
-
partialMessage: outcome.partialMessage,
|
|
181
|
-
};
|
|
182
|
-
const collectedCount = evidence.shownCount + (evidence.omittedCount ?? 0);
|
|
183
|
-
const mismatch = outcome.kind === "kind-mismatch";
|
|
172
|
+
const selection = assembleCandidateSelection({ outcome, key: "resolve.candidates", cwd });
|
|
173
|
+
const evidence = selection.evidence;
|
|
184
174
|
return {
|
|
185
175
|
key: "resolve.candidates",
|
|
186
|
-
title:
|
|
187
|
-
status:
|
|
188
|
-
items:
|
|
176
|
+
title: selection.title,
|
|
177
|
+
status: evidence.partialReason ? "partial" : "complete",
|
|
178
|
+
items: selection.candidates,
|
|
189
179
|
confidence: "semantic",
|
|
190
180
|
evidence,
|
|
181
|
+
selection,
|
|
191
182
|
details: {
|
|
192
183
|
resultKind: outcome.kind,
|
|
193
|
-
...(mismatch ? { requestedKind: outcome.requestedKind } : {}),
|
|
184
|
+
...(outcome.kind === "kind-mismatch" ? { requestedKind: outcome.requestedKind } : {}),
|
|
185
|
+
message: selection.message,
|
|
194
186
|
confidence: "semantic",
|
|
195
|
-
targetCount: evidence
|
|
196
|
-
omittedCount:
|
|
187
|
+
targetCount: knownEvidenceCount(evidence),
|
|
188
|
+
omittedCount: evidence.omittedCount ?? 0,
|
|
197
189
|
evidenceLists: [evidence],
|
|
198
190
|
targets: [],
|
|
199
|
-
candidates:
|
|
191
|
+
candidates: selection.candidates.map((candidate) => ({
|
|
200
192
|
targetId: candidate.targetId,
|
|
201
193
|
name: candidate.name,
|
|
202
194
|
kind: candidate.kind,
|
|
203
195
|
container: candidate.container,
|
|
204
|
-
file:
|
|
196
|
+
file: candidate.file,
|
|
205
197
|
line: candidate.line,
|
|
206
198
|
character: candidate.character,
|
|
207
199
|
rank: candidate.rank,
|
|
208
200
|
anchorKind: candidate.anchorKind,
|
|
209
201
|
})),
|
|
210
|
-
nextQueries:
|
|
211
|
-
? ["Retry without symbolKind, use an observed provider kind, or choose a near-match handle"]
|
|
212
|
-
: ["Choose one candidate handle, or narrow the symbol selector with scope or symbolKind"],
|
|
202
|
+
nextQueries: [...selection.nextQueries],
|
|
213
203
|
},
|
|
214
204
|
};
|
|
215
205
|
}
|
|
@@ -263,37 +253,21 @@ function toTargetDetails(
|
|
|
263
253
|
}
|
|
264
254
|
|
|
265
255
|
function resolveDisplaySections(details: ResolveDetails): ToolDisplaySection[] {
|
|
256
|
+
const evidence = details.evidenceLists?.[0];
|
|
257
|
+
if (!evidence) return [];
|
|
266
258
|
if (details.targets.length > 0) {
|
|
267
259
|
return [
|
|
268
260
|
createToolDisplaySection({
|
|
269
261
|
key: "resolve.targets",
|
|
270
262
|
title: "Targets",
|
|
271
263
|
items: details.targets,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
format: (target) =>
|
|
264
|
+
evidence,
|
|
265
|
+
format: (target: ResolveDetails["targets"][number]) =>
|
|
275
266
|
`${target.name ?? "anonymous"} (${target.nativeKind ?? target.kind ?? "unknown"}) — ${target.file}:${target.displayLine}:${target.displayCharacter} [${target.targetId}]`,
|
|
276
267
|
}),
|
|
277
268
|
];
|
|
278
269
|
}
|
|
279
270
|
|
|
280
|
-
if (details.candidates && details.candidates.length > 0) {
|
|
281
|
-
const evidence = details.evidenceLists?.find((entry) => entry.key === "resolve.candidates");
|
|
282
|
-
if (!evidence) return [];
|
|
283
|
-
return [
|
|
284
|
-
createToolDisplaySection({
|
|
285
|
-
key: "resolve.candidates",
|
|
286
|
-
title: "Candidates",
|
|
287
|
-
items: details.candidates,
|
|
288
|
-
totalCount: evidence.totalCount,
|
|
289
|
-
omittedCount: evidence.omittedCount,
|
|
290
|
-
partialReason: evidence.partialReason,
|
|
291
|
-
partialMessage: evidence.partialMessage,
|
|
292
|
-
format: (candidate) => formatCandidateRow(candidate, "rank-first"),
|
|
293
|
-
}),
|
|
294
|
-
];
|
|
295
|
-
}
|
|
296
|
-
|
|
297
271
|
return [];
|
|
298
272
|
}
|
|
299
273
|
|
|
@@ -345,19 +319,16 @@ export function finishResolveResult(
|
|
|
345
319
|
details: {
|
|
346
320
|
type: "resolve",
|
|
347
321
|
data: assembly.details,
|
|
348
|
-
status:
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
: outcome.kind === "kind-mismatch"
|
|
359
|
-
? { message: `No target matched provider kind ${outcome.requestedKind}.` }
|
|
360
|
-
: {}),
|
|
322
|
+
status: assembly.selection
|
|
323
|
+
? assembly.selection.status
|
|
324
|
+
: outcome.kind === "invalid-input"
|
|
325
|
+
? "invalid-input"
|
|
326
|
+
: "completed",
|
|
327
|
+
...(assembly.selection
|
|
328
|
+
? { message: assembly.selection.message }
|
|
329
|
+
: outcome.kind === "invalid-input"
|
|
330
|
+
? { message: outcome.message }
|
|
331
|
+
: {}),
|
|
361
332
|
displaySections: assembly.displaySections,
|
|
362
333
|
},
|
|
363
334
|
};
|
|
@@ -12,6 +12,12 @@ export const CODE_RESOLVE_TOOL_LABEL = "Code Resolve";
|
|
|
12
12
|
export const codeResolveSpec = {
|
|
13
13
|
name: CODE_RESOLVE_TOOL_NAME,
|
|
14
14
|
label: CODE_RESOLVE_TOOL_LABEL,
|
|
15
|
+
annotations: {
|
|
16
|
+
readOnlyHint: true,
|
|
17
|
+
destructiveHint: false,
|
|
18
|
+
idempotentHint: true,
|
|
19
|
+
openWorldHint: false,
|
|
20
|
+
},
|
|
15
21
|
outputSchema: ResolveOutputSchema,
|
|
16
22
|
parameters: Type.Object(
|
|
17
23
|
{
|
|
@@ -48,9 +48,7 @@ export function truncateToolContent(
|
|
|
48
48
|
return { text: `${result.content}${notice}`, truncated: true };
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
import {
|
|
52
|
-
import { tmpdir } from "node:os";
|
|
53
|
-
import { join } from "node:path";
|
|
51
|
+
import { writeSpillFile } from "@mrclrchtr/supi-core/spill";
|
|
54
52
|
import type { CodeIntelResult } from "../../types/index.ts";
|
|
55
53
|
import { boundModelContent } from "../result/model-budget.ts";
|
|
56
54
|
import type { ToolOutputTruncationDetails } from "../result/types.ts";
|
|
@@ -107,17 +105,5 @@ export function boundCodeToolResult(
|
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
function saveFullContent(content: string, toolName: string): string {
|
|
110
|
-
|
|
111
|
-
const spillPath = join(dir, `${toolName}-output.md`);
|
|
112
|
-
try {
|
|
113
|
-
writeFileSync(spillPath, content, "utf-8");
|
|
114
|
-
return spillPath;
|
|
115
|
-
} catch (error) {
|
|
116
|
-
try {
|
|
117
|
-
rmSync(dir, { recursive: true, force: true });
|
|
118
|
-
} catch {
|
|
119
|
-
/* Preserve the write error. */
|
|
120
|
-
}
|
|
121
|
-
throw error;
|
|
122
|
-
}
|
|
108
|
+
return writeSpillFile({ owner: "code-intelligence", name: `${toolName}-output.md`, content });
|
|
123
109
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ToolNamespace } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
|
|
3
|
+
/** Codemode namespace shared by every `code_*` tool. */
|
|
4
|
+
export const CODE_TOOL_NAMESPACE: ToolNamespace = {
|
|
5
|
+
name: "code",
|
|
6
|
+
description:
|
|
7
|
+
"Code-aware navigation, diagnostics, and refactoring through language servers and syntax trees.",
|
|
8
|
+
instructions: [
|
|
9
|
+
"Orient with code_orientation, discover with code_find, and pin exact targets with code_resolve.",
|
|
10
|
+
"Pass returned target handles to code_inspect, code_graph, or code_refactor_plan instead of re-resolving names.",
|
|
11
|
+
"Use code_health for diagnostics and language-server status.",
|
|
12
|
+
"Refactors are two steps: code_refactor_plan previews edits without writing files; code_refactor_apply writes one stored planId.",
|
|
13
|
+
].join("\n"),
|
|
14
|
+
};
|