@mrclrchtr/supi-code-intelligence 12.0.0 → 14.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 +35 -0
- package/README.md +7 -5
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +10 -0
- 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 +78 -13
- package/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +41 -9
- package/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
- package/node_modules/@mrclrchtr/supi-core/src/session.ts +3 -0
- package/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
- package/node_modules/@mrclrchtr/supi-core/src/side-run.ts +46 -0
- package/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
- package/node_modules/@mrclrchtr/supi-lsp/README.md +6 -2
- 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/query-result.ts +10 -0
- 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 +78 -13
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +41 -9
- 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 +3 -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/side-run.ts +46 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
- package/node_modules/@mrclrchtr/supi-lsp/package.json +8 -8
- package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-cache.ts +102 -47
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-host.ts +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-refresh.ts +20 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-request.ts +4 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-timing.ts +14 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-typescript.ts +8 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +50 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-disk-stamp.ts +60 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-state.ts +3 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-sync.ts +21 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-file-state.ts +17 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-input-admission.ts +7 -1
- 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 +12 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/client/transport.ts +24 -8
- package/node_modules/@mrclrchtr/supi-lsp/src/config/server-config.ts +5 -0
- 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 +17 -5
- package/node_modules/@mrclrchtr/supi-lsp/src/config/typescript-module.ts +17 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/debug-telemetry.ts +64 -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-project-info.ts +3 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-removal-ledger.ts +52 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-typescript-coverage.ts +27 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-workspace-symbol.ts +16 -112
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +561 -103
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/typescript-file-local.ts +6 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/workspace-symbol-collection.ts +163 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/workspace-symbol-row-limit.ts +72 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +6 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-symbol-mapper.ts +13 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-controller.ts +11 -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 +53 -9
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-transition-debug.ts +11 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +2 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/query-result.ts +10 -0
- 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 +78 -13
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +41 -9
- 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 +3 -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/side-run.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 +0 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm.json +3 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-client.ts +1 -1
- package/node_modules/fast-xml-parser/CHANGELOG.md +886 -0
- package/node_modules/fast-xml-parser/LICENSE +21 -0
- package/node_modules/fast-xml-parser/README.md +204 -0
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.d.cts +774 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/README.md +92 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/package.json +57 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityDecoder.js +644 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityEncoder.js +239 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/all-entities.js +53 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entities.js +1139 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entityTries.js +60 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.d.ts +358 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.js +29 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/CHANGELOG.md +52 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/README.md +77 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.cjs +1 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.d.cts +270 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js +2 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/package.json +77 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.d.ts +270 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.js +609 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/ignoreAttributes.js +18 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/orderedJs2Xml.js +360 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/prettifyJs2Xml.js +0 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/util.js +23 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/README.md +632 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/package.json +56 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/html.js +102 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/log.js +98 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/nosql.js +114 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/redos.js +60 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/shell.js +105 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql-strict.js +47 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql.js +95 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/svg.js +81 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/xml.js +79 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.cjs +27 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.d.ts +103 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.js +292 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/util/decode-entities.js +48 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/README.md +947 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.cjs +1 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.d.cts +725 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js +2 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/package.json +79 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Expression.js +232 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/ExpressionSet.js +225 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Matcher.js +663 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.d.ts +589 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.js +30 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/CHANGELOG.md +63 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/README.md +113 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/README.md +142 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/anynum.js +135 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/digitTable.js +116 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/package.json +42 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/package.json +36 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/strnum.js +176 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/README.md +287 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/package.json +56 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.d.ts +108 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.js +382 -0
- package/node_modules/fast-xml-parser/package.json +93 -0
- package/node_modules/fast-xml-parser/src/cli/cli.js +97 -0
- package/node_modules/fast-xml-parser/src/cli/man.js +17 -0
- package/node_modules/fast-xml-parser/src/cli/read.js +43 -0
- package/node_modules/fast-xml-parser/src/fxp.d.ts +754 -0
- package/node_modules/fast-xml-parser/src/fxp.js +14 -0
- package/node_modules/fast-xml-parser/src/ignoreAttributes.js +18 -0
- package/node_modules/fast-xml-parser/src/util.js +61 -0
- package/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +16 -0
- package/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +106 -0
- package/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +61 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +69 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +103 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +100 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +154 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +94 -0
- package/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
- package/node_modules/fast-xml-parser/src/v6/TagPath.js +81 -0
- package/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +13 -0
- package/node_modules/fast-xml-parser/src/v6/XMLParser.js +83 -0
- package/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +235 -0
- package/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +210 -0
- package/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +111 -0
- package/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +116 -0
- package/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +121 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +105 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +22 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +19 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +38 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +13 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +14 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +6 -0
- package/node_modules/fast-xml-parser/src/validator.js +518 -0
- package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +6 -0
- package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +426 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +164 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +907 -0
- package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +77 -0
- package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +177 -0
- package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +54 -0
- package/package.json +10 -8
- package/src/analysis/evidence.ts +331 -73
- package/src/analysis/health/diagnostics.ts +66 -18
- package/src/analysis/health/evidence-reason.ts +44 -0
- package/src/analysis/health/server-status.ts +32 -9
- package/src/analysis/health/signals.ts +1 -0
- package/src/analysis/instruction-files.ts +11 -7
- package/src/analysis/search/exclusions.ts +18 -4
- package/src/analysis/search/pattern.ts +3 -3
- package/src/analysis/target/anchored.ts +3 -6
- package/src/analysis/target/file-outline-omissions.ts +17 -2
- package/src/analysis/target/symbol-selection.ts +100 -0
- package/src/analysis/target/symbol.ts +83 -49
- package/src/analysis/target/types.ts +12 -10
- 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/app/app.ts +37 -21
- package/src/diagnostics/coverage.ts +49 -0
- package/src/diagnostics/evidence.ts +10 -2
- package/src/extension.ts +1 -2
- package/src/headless.ts +4 -2
- package/src/session/health-types.ts +2 -0
- package/src/session/health-workflow.ts +6 -0
- package/src/session/input/common.ts +1 -1
- package/src/session/orientation/collect.ts +42 -7
- package/src/session/orientation/context-facts.ts +3 -3
- package/src/session/orientation/context-sections.ts +13 -15
- package/src/session/orientation/facts.ts +5 -8
- package/src/session/orientation-types.ts +5 -0
- package/src/session/orientation-workflow.ts +12 -17
- package/src/session/target-workflow.ts +38 -25
- package/src/tool/code_find/render.ts +10 -11
- package/src/tool/code_find/result.ts +11 -8
- 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/structured.ts +3 -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 +63 -9
- package/src/tool/code_health/result.ts +20 -9
- package/src/tool/code_health/structured-schema.ts +15 -0
- package/src/tool/code_health/structured.ts +9 -1
- package/src/tool/code_health/tui.ts +33 -40
- package/src/tool/code_inspect/result.ts +23 -18
- package/src/tool/code_inspect/structured.ts +2 -19
- package/src/tool/code_orientation/markdown.ts +6 -1
- package/src/tool/code_orientation/result.ts +53 -100
- package/src/tool/code_orientation/structured-schema.ts +16 -12
- package/src/tool/code_orientation/structured-workspace.ts +13 -7
- package/src/tool/code_orientation/structured.ts +31 -39
- package/src/tool/code_orientation/workspace-format.ts +4 -10
- package/src/tool/code_orientation/workspace-instructions.ts +4 -5
- package/src/tool/code_orientation/workspace-observations.ts +2 -2
- package/src/tool/code_orientation/workspace-output.ts +16 -7
- package/src/tool/code_orientation/workspace-projects.ts +7 -10
- package/src/tool/code_orientation/workspace-sections.ts +13 -19
- package/src/tool/code_resolve/markdown.ts +4 -46
- package/src/tool/code_resolve/result.ts +45 -73
- package/src/tool/code_resolve/structured.ts +6 -1
- package/src/tool/infra/truncate.ts +2 -16
- package/src/tool/result/candidate-selection.ts +157 -0
- package/src/tool/result/display.ts +41 -45
- package/src/tool/result/errors.ts +1 -0
- package/src/tool/result/model-budget.ts +26 -1
- package/src/tool/result/refactor.ts +11 -8
- package/src/tool/result/structured.ts +2 -1
- package/src/tool/result/types.ts +9 -8
- package/src/tool/schemas.ts +15 -20
- package/src/ui/footer.ts +147 -44
- package/src/ui/status-overlay.ts +13 -8
- 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
|
@@ -25,12 +25,12 @@ export function applyMemberships(
|
|
|
25
25
|
issues: MetadataIssue[],
|
|
26
26
|
): ProjectDeclaration[] {
|
|
27
27
|
const compiled = configs.map((config) => compileConfig(config, issues));
|
|
28
|
-
const
|
|
28
|
+
const exactMatches = new Map<string, Set<string>>();
|
|
29
29
|
const result = projects.map((project) => ({
|
|
30
30
|
...project,
|
|
31
|
-
memberships: membershipsForProject(project, compiled,
|
|
31
|
+
memberships: membershipsForProject(project, compiled, exactMatches),
|
|
32
32
|
}));
|
|
33
|
-
|
|
33
|
+
reportUnmatchedExactPaths(compiled, exactMatches, issues);
|
|
34
34
|
return result;
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -60,6 +60,7 @@ function compilePattern(
|
|
|
60
60
|
value: string,
|
|
61
61
|
issues: MetadataIssue[],
|
|
62
62
|
): CompiledPattern | null {
|
|
63
|
+
if (config.kind === "maven-modules") return compileMavenModule(config, value, issues);
|
|
63
64
|
const negative = config.kind === "node-workspace" && value.startsWith("!");
|
|
64
65
|
const normalized = normalizeRelativePath(negative ? value.slice(1) : value);
|
|
65
66
|
if (
|
|
@@ -94,40 +95,88 @@ function compilePattern(
|
|
|
94
95
|
return { value, negative, glob: normalized };
|
|
95
96
|
}
|
|
96
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Resolve one Maven module path to an exact root-relative project directory.
|
|
100
|
+
*
|
|
101
|
+
* Maven module values are literal paths relative to the aggregator directory,
|
|
102
|
+
* optionally naming the module's `pom.xml`. Globs are not Maven syntax.
|
|
103
|
+
*/
|
|
104
|
+
function compileMavenModule(
|
|
105
|
+
config: WorkspaceConfig,
|
|
106
|
+
value: string,
|
|
107
|
+
issues: MetadataIssue[],
|
|
108
|
+
): CompiledPattern | null {
|
|
109
|
+
const disclose = (kind: MetadataIssue["kind"], reason: string) => {
|
|
110
|
+
issues.push(issue(config.manifestPath, config.field, kind, reason));
|
|
111
|
+
return null;
|
|
112
|
+
};
|
|
113
|
+
if (value.includes("${")) {
|
|
114
|
+
return disclose("dynamic", `Module path \`${value}\` uses property interpolation.`);
|
|
115
|
+
}
|
|
116
|
+
const slashed = value.replaceAll("\\", "/");
|
|
117
|
+
if (slashed.startsWith("/") || /^[A-Za-z]:/.test(slashed)) {
|
|
118
|
+
return disclose("unsupported", `Absolute module path \`${value}\` is not read.`);
|
|
119
|
+
}
|
|
120
|
+
let directory = path.posix
|
|
121
|
+
.normalize(path.posix.join(config.directory, slashed))
|
|
122
|
+
.replace(/\/+$/, "");
|
|
123
|
+
const basename = path.posix.basename(directory);
|
|
124
|
+
if (basename === "pom.xml") directory = path.posix.dirname(directory);
|
|
125
|
+
else if (basename.endsWith(".xml")) {
|
|
126
|
+
return disclose("unsupported", `Module path \`${value}\` names a non-pom.xml file.`);
|
|
127
|
+
}
|
|
128
|
+
if (directory === config.directory || (directory === "" && config.directory === ".")) {
|
|
129
|
+
return disclose("unsupported", `Module path \`${value}\` refers to the aggregator itself.`);
|
|
130
|
+
}
|
|
131
|
+
if (directory === ".." || directory.startsWith("../")) {
|
|
132
|
+
return disclose("unresolved", `Module path \`${value}\` points outside the observation root.`);
|
|
133
|
+
}
|
|
134
|
+
return { value, negative: false, glob: directory === "" ? "." : directory };
|
|
135
|
+
}
|
|
136
|
+
|
|
97
137
|
function membershipsForProject(
|
|
98
138
|
project: ProjectDeclaration,
|
|
99
139
|
configs: readonly CompiledConfig[],
|
|
100
|
-
|
|
140
|
+
exactMatches: Map<string, Set<string>>,
|
|
101
141
|
): ProjectMembership[] {
|
|
102
142
|
const memberships: ProjectMembership[] = [];
|
|
103
143
|
for (const compiled of configs) {
|
|
104
144
|
if (!supportsKind(compiled.config.kind, project.kind)) continue;
|
|
105
|
-
const
|
|
106
|
-
if (
|
|
107
|
-
if (compiled.config.kind === "go-work") {
|
|
108
|
-
const membership = matchGoUse(compiled, project, goMatches);
|
|
109
|
-
if (membership) memberships.push(membership);
|
|
110
|
-
continue;
|
|
111
|
-
}
|
|
112
|
-
if (isExcluded(compiled, relative)) continue;
|
|
113
|
-
const matched = lastMatchingPattern(compiled.patterns, relative);
|
|
114
|
-
if (!matched) continue;
|
|
115
|
-
memberships.push({
|
|
116
|
-
kind: compiled.config.kind,
|
|
117
|
-
manifestPath: compiled.config.manifestPath,
|
|
118
|
-
field: compiled.config.field,
|
|
119
|
-
value: matched.value,
|
|
120
|
-
});
|
|
145
|
+
const membership = membershipFor(compiled, project, exactMatches);
|
|
146
|
+
if (membership) memberships.push(membership);
|
|
121
147
|
}
|
|
122
148
|
return dedupeMemberships(memberships);
|
|
123
149
|
}
|
|
124
150
|
|
|
151
|
+
function membershipFor(
|
|
152
|
+
compiled: CompiledConfig,
|
|
153
|
+
project: ProjectDeclaration,
|
|
154
|
+
exactMatches: Map<string, Set<string>>,
|
|
155
|
+
): ProjectMembership | null {
|
|
156
|
+
if (compiled.config.kind === "maven-modules") {
|
|
157
|
+
return matchExactPath(compiled, project, exactMatches);
|
|
158
|
+
}
|
|
159
|
+
const relative = relativeDirectory(compiled.config.directory, project.directory);
|
|
160
|
+
if (relative === null) return null;
|
|
161
|
+
if (compiled.config.kind === "go-work") return matchGoUse(compiled, project, exactMatches);
|
|
162
|
+
if (isExcluded(compiled, relative)) return null;
|
|
163
|
+
const matched = lastMatchingPattern(compiled.patterns, relative);
|
|
164
|
+
if (!matched) return null;
|
|
165
|
+
return {
|
|
166
|
+
kind: compiled.config.kind,
|
|
167
|
+
manifestPath: compiled.config.manifestPath,
|
|
168
|
+
field: compiled.config.field,
|
|
169
|
+
value: matched.value,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
125
173
|
function supportsKind(
|
|
126
174
|
workspaceKind: WorkspaceConfig["kind"],
|
|
127
175
|
projectKind: ProjectDeclaration["kind"],
|
|
128
176
|
): boolean {
|
|
129
177
|
if (workspaceKind === "node-workspace") return projectKind === "node-package";
|
|
130
178
|
if (workspaceKind === "cargo-workspace") return projectKind === "rust-package";
|
|
179
|
+
if (workspaceKind === "maven-modules") return projectKind === "maven-project";
|
|
131
180
|
return projectKind === "go-module";
|
|
132
181
|
}
|
|
133
182
|
|
|
@@ -163,15 +212,33 @@ function patternMatches(pattern: CompiledPattern, relative: string): boolean {
|
|
|
163
212
|
}
|
|
164
213
|
}
|
|
165
214
|
|
|
215
|
+
/** Match a pre-resolved exact project directory, marking every spelling that resolves to it. */
|
|
216
|
+
function matchExactPath(
|
|
217
|
+
config: CompiledConfig,
|
|
218
|
+
project: ProjectDeclaration,
|
|
219
|
+
matches: Map<string, Set<string>>,
|
|
220
|
+
): ProjectMembership | null {
|
|
221
|
+
const matched = config.patterns.filter((pattern) => pattern.glob === project.directory);
|
|
222
|
+
for (const pattern of matched) markExactMatch(config.config.manifestPath, pattern.value, matches);
|
|
223
|
+
const first = matched[0];
|
|
224
|
+
if (!first) return null;
|
|
225
|
+
return {
|
|
226
|
+
kind: config.config.kind,
|
|
227
|
+
manifestPath: config.config.manifestPath,
|
|
228
|
+
field: config.config.field,
|
|
229
|
+
value: first.value,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
|
|
166
233
|
function matchGoUse(
|
|
167
234
|
config: CompiledConfig,
|
|
168
235
|
project: ProjectDeclaration,
|
|
169
|
-
|
|
236
|
+
exactMatches: Map<string, Set<string>>,
|
|
170
237
|
): ProjectMembership | null {
|
|
171
238
|
for (const pattern of config.patterns) {
|
|
172
239
|
const usePath = normalizeRelativePath(path.posix.join(config.config.directory, pattern.glob));
|
|
173
240
|
if (usePath !== project.directory) continue;
|
|
174
|
-
|
|
241
|
+
markExactMatch(config.config.manifestPath, pattern.value, exactMatches);
|
|
175
242
|
return {
|
|
176
243
|
kind: "go-work",
|
|
177
244
|
manifestPath: config.config.manifestPath,
|
|
@@ -182,19 +249,24 @@ function matchGoUse(
|
|
|
182
249
|
return null;
|
|
183
250
|
}
|
|
184
251
|
|
|
185
|
-
function
|
|
252
|
+
function markExactMatch(
|
|
253
|
+
manifestPath: string,
|
|
254
|
+
value: string,
|
|
255
|
+
matches: Map<string, Set<string>>,
|
|
256
|
+
): void {
|
|
186
257
|
const values = matches.get(manifestPath) ?? new Set<string>();
|
|
187
258
|
values.add(value);
|
|
188
259
|
matches.set(manifestPath, values);
|
|
189
260
|
}
|
|
190
261
|
|
|
191
|
-
function
|
|
262
|
+
function reportUnmatchedExactPaths(
|
|
192
263
|
configs: readonly CompiledConfig[],
|
|
193
264
|
matches: ReadonlyMap<string, Set<string>>,
|
|
194
265
|
issues: MetadataIssue[],
|
|
195
266
|
): void {
|
|
196
267
|
for (const compiled of configs) {
|
|
197
|
-
|
|
268
|
+
const kind = compiled.config.kind;
|
|
269
|
+
if (kind !== "go-work" && kind !== "maven-modules") continue;
|
|
198
270
|
const matched = matches.get(compiled.config.manifestPath) ?? new Set<string>();
|
|
199
271
|
for (const pattern of compiled.patterns) {
|
|
200
272
|
if (matched.has(pattern.value)) continue;
|
|
@@ -203,7 +275,9 @@ function reportUnmatchedGoUses(
|
|
|
203
275
|
compiled.config.manifestPath,
|
|
204
276
|
compiled.config.field,
|
|
205
277
|
"unresolved",
|
|
206
|
-
|
|
278
|
+
kind === "go-work"
|
|
279
|
+
? `go.work use path \`${pattern.value}\` has no observed go.mod project.`
|
|
280
|
+
: `Maven module path \`${pattern.value}\` has no observed pom.xml project.`,
|
|
207
281
|
),
|
|
208
282
|
);
|
|
209
283
|
}
|
|
@@ -5,6 +5,7 @@ import * as path from "node:path";
|
|
|
5
5
|
import type { CodeRequestControl } from "@mrclrchtr/supi-code-runtime/api";
|
|
6
6
|
import { parse as parseToml } from "smol-toml";
|
|
7
7
|
import { parseDocument } from "yaml";
|
|
8
|
+
import { parsePom } from "./maven.ts";
|
|
8
9
|
import type { MetadataReadResult, ParsedDocument } from "./metadata-types.ts";
|
|
9
10
|
import { isRecord, issue } from "./metadata-utils.ts";
|
|
10
11
|
import { errorMessage, relativeDirectory } from "./paths.ts";
|
|
@@ -25,6 +26,8 @@ const KIND_BY_BASENAME = new Map<string, MetadataDocumentKind>([
|
|
|
25
26
|
["Cargo.toml", "cargo"],
|
|
26
27
|
["go.mod", "go-mod"],
|
|
27
28
|
["go.work", "go-work"],
|
|
29
|
+
["pom.xml", "maven-pom"],
|
|
30
|
+
["CMakeLists.txt", "cmake-lists"],
|
|
28
31
|
]);
|
|
29
32
|
|
|
30
33
|
interface ReadOutcome {
|
|
@@ -105,7 +108,9 @@ function parseText(relativePath: string, kind: MetadataDocumentKind, text: strin
|
|
|
105
108
|
}
|
|
106
109
|
return complete(relativePath, kind, document.toJS());
|
|
107
110
|
}
|
|
108
|
-
if (kind === "go-mod" || kind === "go-work"
|
|
111
|
+
if (kind === "go-mod" || kind === "go-work" || kind === "cmake-lists")
|
|
112
|
+
return complete(relativePath, kind, text);
|
|
113
|
+
if (kind === "maven-pom") return complete(relativePath, kind, parsePom(text));
|
|
109
114
|
return complete(relativePath, kind, parseToml(text));
|
|
110
115
|
} catch (error) {
|
|
111
116
|
return failed(relativePath, kind, `Could not parse metadata: ${errorMessage(error)}`);
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/** Shared bounded workspace observation used by overview and Orientation surfaces. */
|
|
2
2
|
|
|
3
3
|
import * as path from "node:path";
|
|
4
|
+
import { readCMakeDocument } from "./cmake.ts";
|
|
4
5
|
import { readGoDocument } from "./go.ts";
|
|
5
6
|
import { collectInventory, DEFAULT_MAX_INVENTORY_ENTRIES } from "./inventory.ts";
|
|
7
|
+
import { readMavenDocument } from "./maven.ts";
|
|
6
8
|
import { applyMemberships } from "./membership.ts";
|
|
7
9
|
import { readMetadataDocuments } from "./metadata.ts";
|
|
8
10
|
import type { DocumentContribution, ParsedDocument } from "./metadata-types.ts";
|
|
@@ -133,6 +135,10 @@ function readDocument(document: ParsedDocument): DocumentContribution {
|
|
|
133
135
|
case "go-mod":
|
|
134
136
|
case "go-work":
|
|
135
137
|
return readGoDocument(document);
|
|
138
|
+
case "maven-pom":
|
|
139
|
+
return readMavenDocument(document);
|
|
140
|
+
case "cmake-lists":
|
|
141
|
+
return readCMakeDocument(document);
|
|
136
142
|
}
|
|
137
143
|
}
|
|
138
144
|
|
|
@@ -76,7 +76,9 @@ export type MetadataDocumentKind =
|
|
|
76
76
|
| "pyproject"
|
|
77
77
|
| "cargo"
|
|
78
78
|
| "go-mod"
|
|
79
|
-
| "go-work"
|
|
79
|
+
| "go-work"
|
|
80
|
+
| "maven-pom"
|
|
81
|
+
| "cmake-lists";
|
|
80
82
|
|
|
81
83
|
/** Metadata read outcome retained for provenance. */
|
|
82
84
|
export interface MetadataDocument {
|
|
@@ -117,12 +119,18 @@ export interface WorkspaceMetadataObservation {
|
|
|
117
119
|
}
|
|
118
120
|
|
|
119
121
|
/** Native project declaration kinds supported by this collector. */
|
|
120
|
-
export type ProjectKind =
|
|
122
|
+
export type ProjectKind =
|
|
123
|
+
| "node-package"
|
|
124
|
+
| "python-project"
|
|
125
|
+
| "rust-package"
|
|
126
|
+
| "go-module"
|
|
127
|
+
| "maven-project"
|
|
128
|
+
| "cmake-project";
|
|
121
129
|
|
|
122
130
|
/** How one configuration explicitly established project membership. */
|
|
123
131
|
export interface ProjectMembership {
|
|
124
132
|
/** Native workspace declaration family. */
|
|
125
|
-
readonly kind: "node-workspace" | "cargo-workspace" | "go-work";
|
|
133
|
+
readonly kind: "node-workspace" | "cargo-workspace" | "go-work" | "maven-modules";
|
|
126
134
|
/** Root-relative configuration or manifest path that declared membership. */
|
|
127
135
|
readonly manifestPath: string;
|
|
128
136
|
/** Exact declaring field or directive. */
|
package/src/app/app.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* feature wiring.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
9
|
+
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
10
10
|
import { WorkspaceCodeIntelligenceSession } from "../session/session.ts";
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -68,14 +68,44 @@ export function createSessionCache(): {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Keep a session informed about the instruction files its model already has, so directory
|
|
73
|
+
* `code_orientation` does not deliver them again. Shared by the full extension and the
|
|
74
|
+
* headless profile; without it every instruction file counts as unseen.
|
|
75
|
+
*
|
|
76
|
+
* Registers:
|
|
77
|
+
* - `session_start` / `session_tree` — rebuild surfaced directories and full reads from the branch
|
|
78
|
+
* - `before_agent_start` — record the context files Pi loaded into the system prompt
|
|
79
|
+
* - `tool_result` — record full `read` results
|
|
80
|
+
* - `session_compact` — reset, so instructions are delivered again
|
|
81
|
+
*/
|
|
82
|
+
export function registerInstructionDedup(
|
|
83
|
+
pi: ExtensionAPI,
|
|
84
|
+
getSession: (cwd: string) => WorkspaceCodeIntelligenceSession,
|
|
85
|
+
): void {
|
|
86
|
+
const restore = (_event: unknown, ctx: ExtensionContext): void => {
|
|
87
|
+
getSession(ctx.cwd).reconstructInstructionState(ctx.sessionManager.getBranch());
|
|
88
|
+
};
|
|
89
|
+
pi.on("session_start", restore);
|
|
90
|
+
pi.on("session_tree", restore);
|
|
91
|
+
pi.on("before_agent_start", (event, ctx) => {
|
|
92
|
+
getSession(ctx.cwd).captureNativeInstructionPaths(event.systemPromptOptions.contextFiles ?? []);
|
|
93
|
+
});
|
|
94
|
+
pi.on("tool_result", (event, ctx) => {
|
|
95
|
+
getSession(ctx.cwd).recordToolResult(event);
|
|
96
|
+
});
|
|
97
|
+
pi.on("session_compact", (_event, ctx) => {
|
|
98
|
+
getSession(ctx.cwd).resetInstructionDedup();
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
71
102
|
/**
|
|
72
103
|
* Create the code-intelligence app and wire it to pi lifecycle events.
|
|
73
104
|
*
|
|
74
105
|
* Registers:
|
|
75
|
-
* -
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* - `session_compact` — resets instruction dedup state
|
|
106
|
+
* - instruction deduplication, see {@link registerInstructionDedup}
|
|
107
|
+
* - `session_start` / `session_tree` — create the session for the cwd and
|
|
108
|
+
* restore overview state from the active branch
|
|
79
109
|
* - `session_shutdown` — releases all sessions and clears per-session stores
|
|
80
110
|
*/
|
|
81
111
|
export function createCodeIntelligenceApp(pi: ExtensionAPI): CodeIntelligenceApp {
|
|
@@ -93,13 +123,7 @@ export function createCodeIntelligenceApp(pi: ExtensionAPI): CodeIntelligenceApp
|
|
|
93
123
|
restoreBranchOverviewState(session, ctx.sessionManager.getBranch());
|
|
94
124
|
});
|
|
95
125
|
|
|
96
|
-
pi
|
|
97
|
-
sessions.get(ctx.cwd)?.recordToolResult(event);
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
pi.on("session_compact", (_event, ctx) => {
|
|
101
|
-
sessions.get(ctx.cwd)?.resetInstructionDedup();
|
|
102
|
-
});
|
|
126
|
+
registerInstructionDedup(pi, (cwd) => getOrCreateSession(sessions, cwd));
|
|
103
127
|
|
|
104
128
|
pi.on("session_shutdown", () => {
|
|
105
129
|
for (const session of sessions.values()) {
|
|
@@ -108,19 +132,11 @@ export function createCodeIntelligenceApp(pi: ExtensionAPI): CodeIntelligenceApp
|
|
|
108
132
|
sessions.clear();
|
|
109
133
|
});
|
|
110
134
|
|
|
111
|
-
/**
|
|
112
|
-
* Restore overview injection state from a branch.
|
|
113
|
-
*
|
|
114
|
-
* Reconstructs instruction-file state and checks whether this branch
|
|
115
|
-
* already contains a code-intelligence-overview custom message.
|
|
116
|
-
*/
|
|
135
|
+
/** Check whether this branch already contains a code-intelligence-overview custom message. */
|
|
117
136
|
function restoreBranchOverviewState(
|
|
118
137
|
session: WorkspaceCodeIntelligenceSession,
|
|
119
138
|
branch: unknown[],
|
|
120
139
|
): void {
|
|
121
|
-
session.reconstructInstructionState(
|
|
122
|
-
branch as Parameters<typeof session.reconstructInstructionState>[0],
|
|
123
|
-
);
|
|
124
140
|
session.restoreOverviewInjection(false);
|
|
125
141
|
for (const entry of branch as Array<{ type?: string; customType?: string }>) {
|
|
126
142
|
if (entry.type === "custom_message" && entry.customType === OVERVIEW_CUSTOM_TYPE) {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { DiagnosticEvidenceSummary } from "@mrclrchtr/supi-lsp/api";
|
|
2
|
+
import type { HealthDiagnosticObservation } from "../session/health-types.ts";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The single rule for complete diagnostic evidence: every requested file is confirmed. Unconfirmed,
|
|
6
|
+
* failed, and removed files all block completeness. A removed file blocks it because files that
|
|
7
|
+
* imported it may not have been re-checked yet (#371, #602).
|
|
8
|
+
*
|
|
9
|
+
* Collection uses it to choose a `completed` or `partial` observation, and
|
|
10
|
+
* {@link classifyDiagnosticCoverage} uses it for `confirmed`, so a `completed` observation is always
|
|
11
|
+
* `confirmed` or `none` coverage, never `incomplete`.
|
|
12
|
+
*/
|
|
13
|
+
export function allRequestedFilesConfirmed(
|
|
14
|
+
evidence: Omit<DiagnosticEvidenceSummary, "documents">,
|
|
15
|
+
): boolean {
|
|
16
|
+
return (
|
|
17
|
+
evidence.confirmed === evidence.requested &&
|
|
18
|
+
evidence.unconfirmed === 0 &&
|
|
19
|
+
evidence.failed === 0 &&
|
|
20
|
+
evidence.removed === 0
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* What a requested diagnostic observation establishes, derived only from its kind and exact
|
|
26
|
+
* evidence counts. Shared by the model-facing `code_health` output and the status inspector.
|
|
27
|
+
*
|
|
28
|
+
* - `unavailable`: no diagnostic result could be collected.
|
|
29
|
+
* - `none`: zero files were requested and no diagnostics exist, so nothing was checked.
|
|
30
|
+
* - `incomplete`: some requested files are unconfirmed, failed, or removed, or collection was partial.
|
|
31
|
+
* - `confirmed`: every requested file was confirmed. This never establishes project-wide validity.
|
|
32
|
+
*/
|
|
33
|
+
export type DiagnosticCoverage = "unavailable" | "none" | "incomplete" | "confirmed";
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Classify a collected observation. `partial` is never `confirmed`. Zero requested files with no
|
|
37
|
+
* entries is `none`, even for a `partial` observation. Uses the same completeness rule as
|
|
38
|
+
* collection ({@link allRequestedFilesConfirmed}), so `completed` never classifies as `incomplete`.
|
|
39
|
+
*/
|
|
40
|
+
export function classifyDiagnosticCoverage(
|
|
41
|
+
observation: Exclude<HealthDiagnosticObservation, { kind: "not-requested" }>,
|
|
42
|
+
): DiagnosticCoverage {
|
|
43
|
+
if (observation.kind === "unavailable") return "unavailable";
|
|
44
|
+
const evidence = observation.evidence;
|
|
45
|
+
if (evidence.requested === 0 && observation.entries.length === 0) return "none";
|
|
46
|
+
return observation.kind === "completed" && allRequestedFilesConfirmed(evidence)
|
|
47
|
+
? "confirmed"
|
|
48
|
+
: "incomplete";
|
|
49
|
+
}
|
|
@@ -15,12 +15,20 @@ export function mergeDiagnosticEvidence(
|
|
|
15
15
|
const byFile = new Map<string, DiagnosticEvidenceDocument>();
|
|
16
16
|
for (const document of [...previous.documents, ...latest.documents]) {
|
|
17
17
|
const file = cwd ? path.relative(cwd, path.resolve(cwd, document.file)) : document.file;
|
|
18
|
-
const next = {
|
|
18
|
+
const next: DiagnosticEvidenceDocument = {
|
|
19
|
+
file,
|
|
20
|
+
status: document.status,
|
|
21
|
+
...(document.reason ? { reason: document.reason } : {}),
|
|
22
|
+
};
|
|
19
23
|
const previousDocument = byFile.get(file);
|
|
20
24
|
if (
|
|
21
25
|
!previousDocument ||
|
|
22
26
|
policy === "latest" ||
|
|
23
|
-
evidenceStatusRank(next.status) > evidenceStatusRank(previousDocument.status)
|
|
27
|
+
evidenceStatusRank(next.status) > evidenceStatusRank(previousDocument.status) ||
|
|
28
|
+
// Equal rank: keep a known cause instead of a reason-less duplicate.
|
|
29
|
+
(next.status === previousDocument.status &&
|
|
30
|
+
previousDocument.reason === undefined &&
|
|
31
|
+
next.reason !== undefined)
|
|
24
32
|
) {
|
|
25
33
|
byFile.set(file, next);
|
|
26
34
|
}
|
package/src/extension.ts
CHANGED
|
@@ -85,9 +85,8 @@ export default function codeIntelligenceExtension(
|
|
|
85
85
|
?.setOverviewEnabledOnce(resolveOverviewEnabled(ctx.cwd, ctx.isProjectTrusted(), homeDir));
|
|
86
86
|
});
|
|
87
87
|
|
|
88
|
-
pi.on("before_agent_start", (
|
|
88
|
+
pi.on("before_agent_start", (_event, ctx) => {
|
|
89
89
|
const session = app.getSession(ctx.cwd) ?? app.createSession(ctx.cwd);
|
|
90
|
-
session.captureNativeInstructionPaths(event.systemPromptOptions.contextFiles ?? []);
|
|
91
90
|
session.setHomeDir(homeDir);
|
|
92
91
|
session.setGradleObserver(gradle.forContext(ctx));
|
|
93
92
|
if (!session.hasPinnedOverview()) {
|
package/src/headless.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import { createSessionCache } from "./app/app.ts";
|
|
2
|
+
import { createSessionCache, registerInstructionDedup } from "./app/app.ts";
|
|
3
3
|
import { registerGradleObservations } from "./gradle/consent.ts";
|
|
4
4
|
import { registerLspSessionLifecycle } from "./substrate/lsp/lifecycle.ts";
|
|
5
5
|
import { createLspAdapterState } from "./substrate/lsp/state.ts";
|
|
@@ -20,7 +20,8 @@ const inspectionToolNames = new Set<string>(HEADLESS_INSPECTION_TOOL_NAMES);
|
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Register the managed-child profile: six inspection tools backed by the shared
|
|
23
|
-
* Workspace provider host, without refactors, settings, UI, or
|
|
23
|
+
* Workspace provider host and instruction deduplication, without refactors, settings, UI, or
|
|
24
|
+
* overview state.
|
|
24
25
|
*/
|
|
25
26
|
export default function headlessInspectionProfile(pi: ExtensionAPI): void {
|
|
26
27
|
const sessions = createSessionCache();
|
|
@@ -34,6 +35,7 @@ export default function headlessInspectionProfile(pi: ExtensionAPI): void {
|
|
|
34
35
|
session.setGradleObserver(gradle.forContext(ctx));
|
|
35
36
|
session.setAutomaticPathPolicy(lspState.providerLease?.automaticPathPolicy ?? null);
|
|
36
37
|
});
|
|
38
|
+
registerInstructionDedup(pi, sessions.getOrCreate);
|
|
37
39
|
pi.on("session_shutdown", () => sessions.clear());
|
|
38
40
|
|
|
39
41
|
registerCodeIntelligenceTools(
|
|
@@ -41,6 +41,8 @@ export interface HealthServerInfo {
|
|
|
41
41
|
/** Actionable launch failure, distinct from process recovery status. */
|
|
42
42
|
readonly failureMessage?: string;
|
|
43
43
|
readonly ready: boolean;
|
|
44
|
+
/** Present while the background warm-up loads the route's projects; a symbol query waits for it. */
|
|
45
|
+
readonly loadingProjects?: true;
|
|
44
46
|
/** Negotiated operation support and SuPi planning limitations. */
|
|
45
47
|
readonly operationSupport?: ServerOperationSupportMap;
|
|
46
48
|
}
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
collectDiagnostics,
|
|
19
19
|
diagnosticScope,
|
|
20
20
|
isScopedFile,
|
|
21
|
+
reportedRemovedFiles,
|
|
21
22
|
} from "../analysis/health/diagnostics.ts";
|
|
22
23
|
import { describeStructuralState } from "../analysis/health/recovery.ts";
|
|
23
24
|
import { deriveWorkspaceSemanticHealthState } from "../analysis/health/semantic-state.ts";
|
|
@@ -143,6 +144,11 @@ export async function runHealthWorkflow(
|
|
|
143
144
|
};
|
|
144
145
|
|
|
145
146
|
throwIfAborted(control);
|
|
147
|
+
// A refresh report delivers retained removals once; passive reads keep them
|
|
148
|
+
// so a later refresh still reports them.
|
|
149
|
+
if (request.refresh === true && runtime) {
|
|
150
|
+
runtime.acknowledgeRemovedTrackedFiles(reportedRemovedFiles(diagnostics, deps.cwd));
|
|
151
|
+
}
|
|
146
152
|
return { kind: "completed", data };
|
|
147
153
|
}
|
|
148
154
|
function healthNeedsSemantic(included: readonly HealthSection[]): boolean {
|
|
@@ -173,7 +173,7 @@ export function parseTargetInput(
|
|
|
173
173
|
"A target selector must contain exactly one of `handle`, `anchor`, `symbol`, or `file`.",
|
|
174
174
|
);
|
|
175
175
|
}
|
|
176
|
-
const branch = selected[0];
|
|
176
|
+
const branch: TargetBranch = selected[0];
|
|
177
177
|
if (!allowed.includes(branch)) return invalid(`This workflow does not support target.${branch}.`);
|
|
178
178
|
|
|
179
179
|
switch (branch) {
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
createEvidenceList,
|
|
10
10
|
createPartialEvidenceList,
|
|
11
11
|
type EvidenceListMetadata,
|
|
12
|
+
toEvidenceListFacts,
|
|
12
13
|
} from "../../analysis/evidence.ts";
|
|
13
14
|
import {
|
|
14
15
|
type ReadNextItem,
|
|
@@ -237,19 +238,34 @@ function targetContextFacts(
|
|
|
237
238
|
: { file: toDisplayPath(cwd, uri) }),
|
|
238
239
|
range: publicRange(range),
|
|
239
240
|
})),
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
evidence: sourceEvidence(
|
|
242
|
+
"context.definitions",
|
|
243
|
+
treeContext.operations.definition,
|
|
244
|
+
treeContext.definition,
|
|
245
|
+
limit,
|
|
246
|
+
),
|
|
242
247
|
}
|
|
243
248
|
: {}),
|
|
244
249
|
},
|
|
245
250
|
sourceContext: {
|
|
246
|
-
outline: sourceSelection(
|
|
251
|
+
outline: sourceSelection(
|
|
252
|
+
"context.outline",
|
|
253
|
+
treeContext.operations.outline,
|
|
254
|
+
treeContext.outline,
|
|
255
|
+
limit,
|
|
256
|
+
),
|
|
247
257
|
imports: sourceSelection(
|
|
258
|
+
"context.imports",
|
|
248
259
|
treeContext.operations.imports,
|
|
249
260
|
treeContext.imports.map(({ moduleSpecifier }) => ({ moduleSpecifier })),
|
|
250
261
|
limit,
|
|
251
262
|
),
|
|
252
|
-
exports: sourceSelection(
|
|
263
|
+
exports: sourceSelection(
|
|
264
|
+
"context.exports",
|
|
265
|
+
treeContext.operations.exports,
|
|
266
|
+
treeContext.exports,
|
|
267
|
+
limit,
|
|
268
|
+
),
|
|
253
269
|
},
|
|
254
270
|
}
|
|
255
271
|
: {};
|
|
@@ -675,8 +691,9 @@ function publicRange(range: SourceRange): SourceRange {
|
|
|
675
691
|
};
|
|
676
692
|
}
|
|
677
693
|
|
|
678
|
-
/** These best-effort lists preserve availability separately from
|
|
694
|
+
/** These best-effort lists preserve availability separately from their Evidence list. */
|
|
679
695
|
function sourceSelection<T>(
|
|
696
|
+
key: string,
|
|
680
697
|
status: { status: "complete" | "partial" | "unavailable"; reason: string | null },
|
|
681
698
|
entries: readonly T[],
|
|
682
699
|
limit: number,
|
|
@@ -684,11 +701,29 @@ function sourceSelection<T>(
|
|
|
684
701
|
return {
|
|
685
702
|
...status,
|
|
686
703
|
entries: entries.slice(0, limit),
|
|
687
|
-
|
|
688
|
-
omittedCount: Math.max(0, entries.length - limit),
|
|
704
|
+
evidence: sourceEvidence(key, status, entries, limit),
|
|
689
705
|
};
|
|
690
706
|
}
|
|
691
707
|
|
|
708
|
+
/** A partial observation counts its collected atoms; more may exist. */
|
|
709
|
+
function sourceEvidence<T>(
|
|
710
|
+
key: string,
|
|
711
|
+
status: { status: string; reason: string | null },
|
|
712
|
+
entries: readonly T[],
|
|
713
|
+
limit: number,
|
|
714
|
+
) {
|
|
715
|
+
const params = { key, items: entries, maxResults: limit };
|
|
716
|
+
return toEvidenceListFacts(
|
|
717
|
+
status.status === "complete"
|
|
718
|
+
? createEvidenceList(params).metadata
|
|
719
|
+
: createPartialEvidenceList({
|
|
720
|
+
...params,
|
|
721
|
+
partialReason: "provider-limited",
|
|
722
|
+
...(status.reason ? { partialMessage: status.reason } : {}),
|
|
723
|
+
}).metadata,
|
|
724
|
+
);
|
|
725
|
+
}
|
|
726
|
+
|
|
692
727
|
function uniqueRecoveryRanges(
|
|
693
728
|
recovery: readonly { errorRanges: readonly SourceRange[] }[],
|
|
694
729
|
): SourceRange[] {
|
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
ModuleInfo,
|
|
10
10
|
} from "../../analysis/architecture/model.ts";
|
|
11
11
|
import { findModuleForPath } from "../../analysis/architecture/model.ts";
|
|
12
|
-
import type {
|
|
12
|
+
import type { CollectionPartialReason } from "../../analysis/evidence.ts";
|
|
13
13
|
import type { CodeProvider } from "../../analysis/provider.ts";
|
|
14
14
|
import type { OrientationProvenance, OrientationResultData } from "../orientation-types.ts";
|
|
15
15
|
import {
|
|
@@ -290,7 +290,7 @@ function appendRelationshipFacts(
|
|
|
290
290
|
edges: readonly DependencyEdge[];
|
|
291
291
|
status: "complete" | "partial" | "unavailable";
|
|
292
292
|
reason: string | null;
|
|
293
|
-
partialReason:
|
|
293
|
+
partialReason: CollectionPartialReason | undefined;
|
|
294
294
|
},
|
|
295
295
|
): void {
|
|
296
296
|
if (input.status === "unavailable") return;
|
|
@@ -318,7 +318,7 @@ function appendRelationshipFacts(
|
|
|
318
318
|
});
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
-
function topologyPartialReason(model: ArchitectureModel):
|
|
321
|
+
function topologyPartialReason(model: ArchitectureModel): CollectionPartialReason | undefined {
|
|
322
322
|
if (model.topology.status !== "partial") return undefined;
|
|
323
323
|
return model.topology.failedPackageManifestCount > 0 ? "filesystem-error" : "configuration-error";
|
|
324
324
|
}
|