@mrclrchtr/supi-code-intelligence 12.0.0 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +4 -2
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-core/package.json +3 -1
- package/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
- package/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
- package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
- package/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
- package/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
- package/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
- package/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +3 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
- package/node_modules/@mrclrchtr/supi-lsp/package.json +8 -8
- package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-cache.ts +102 -47
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-host.ts +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-refresh.ts +15 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-request.ts +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +46 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-disk-stamp.ts +60 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-state.ts +3 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-sync.ts +21 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-file-state.ts +17 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-semantic-input-barrier.ts +53 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +11 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-extends.ts +2 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-path.ts +2 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-scope.ts +14 -5
- package/node_modules/@mrclrchtr/supi-lsp/src/config/typescript-module.ts +17 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/evidence.ts +42 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-client-state.ts +2 -17
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-removal-ledger.ts +52 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +40 -20
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/typescript-file-local.ts +6 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +6 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-symbol-mapper.ts +13 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostic-surface.ts +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostics.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +17 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-transition-debug.ts +11 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +2 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +3 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/api.ts +4 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +22 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/retired-packages.ts +152 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/session.ts +1 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/shell-hints.ts +46 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/spill.ts +93 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm +0 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.wasm.map +6 -6
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts +7 -7
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts.map +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts +7 -7
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js +50 -75
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js.map +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm +0 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.wasm.map +5 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +5 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/kotlin/tree-sitter-kotlin.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/latex/tree-sitter-latex.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/sql/tree-sitter-sql.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/tsx/tree-sitter-tsx.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/resources/grammars/typescript/tree-sitter-typescript.wasm.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-client.ts +1 -1
- package/node_modules/fast-xml-parser/CHANGELOG.md +886 -0
- package/node_modules/fast-xml-parser/LICENSE +21 -0
- package/node_modules/fast-xml-parser/README.md +204 -0
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
- package/node_modules/fast-xml-parser/lib/fxp.d.cts +774 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
- package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/README.md +92 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/package.json +57 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityDecoder.js +644 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/EntityEncoder.js +239 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/all-entities.js +53 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entities.js +1139 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/entityTries.js +60 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.d.ts +358 -0
- package/node_modules/fast-xml-parser/node_modules/@nodable/entities/src/index.js +29 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/CHANGELOG.md +52 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/README.md +77 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.cjs +1 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.d.cts +270 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js +2 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/package.json +77 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.d.ts +270 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/fxb.js +609 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/ignoreAttributes.js +18 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/orderedJs2Xml.js +360 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/prettifyJs2Xml.js +0 -0
- package/node_modules/fast-xml-parser/node_modules/fast-xml-builder/src/util.js +23 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/README.md +632 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/package.json +56 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/html.js +102 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/log.js +98 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/nosql.js +114 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/redos.js +60 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/shell.js +105 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql-strict.js +47 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/sql.js +95 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/svg.js +81 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/contexts/xml.js +79 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.cjs +27 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.d.ts +103 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/index.js +292 -0
- package/node_modules/fast-xml-parser/node_modules/is-unsafe/src/util/decode-entities.js +48 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/README.md +947 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.cjs +1 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.d.cts +725 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js +2 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/lib/pem.min.js.map +1 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/package.json +79 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Expression.js +232 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/ExpressionSet.js +225 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/Matcher.js +663 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.d.ts +589 -0
- package/node_modules/fast-xml-parser/node_modules/path-expression-matcher/src/index.js +30 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/CHANGELOG.md +63 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/README.md +113 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/README.md +142 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/anynum.js +135 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/digitTable.js +116 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/node_modules/anynum/package.json +42 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/package.json +36 -0
- package/node_modules/fast-xml-parser/node_modules/strnum/strnum.js +176 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/LICENSE +21 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/README.md +287 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/package.json +56 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.d.ts +108 -0
- package/node_modules/fast-xml-parser/node_modules/xml-naming/src/index.js +382 -0
- package/node_modules/fast-xml-parser/package.json +93 -0
- package/node_modules/fast-xml-parser/src/cli/cli.js +97 -0
- package/node_modules/fast-xml-parser/src/cli/man.js +17 -0
- package/node_modules/fast-xml-parser/src/cli/read.js +43 -0
- package/node_modules/fast-xml-parser/src/fxp.d.ts +754 -0
- package/node_modules/fast-xml-parser/src/fxp.js +14 -0
- package/node_modules/fast-xml-parser/src/ignoreAttributes.js +18 -0
- package/node_modules/fast-xml-parser/src/util.js +61 -0
- package/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +16 -0
- package/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +106 -0
- package/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +61 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +69 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +103 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +100 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +154 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +94 -0
- package/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
- package/node_modules/fast-xml-parser/src/v6/TagPath.js +81 -0
- package/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +13 -0
- package/node_modules/fast-xml-parser/src/v6/XMLParser.js +83 -0
- package/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +235 -0
- package/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +210 -0
- package/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +111 -0
- package/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +116 -0
- package/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +121 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +105 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +22 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +19 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +38 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +13 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +14 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +6 -0
- package/node_modules/fast-xml-parser/src/validator.js +518 -0
- package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +6 -0
- package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +426 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +164 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +907 -0
- package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +77 -0
- package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +177 -0
- package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +54 -0
- package/package.json +10 -8
- package/src/analysis/evidence.ts +331 -73
- package/src/analysis/health/diagnostics.ts +66 -18
- package/src/analysis/health/evidence-reason.ts +44 -0
- package/src/analysis/search/pattern.ts +3 -3
- package/src/analysis/target/anchored.ts +3 -6
- package/src/analysis/target/symbol.ts +41 -47
- package/src/analysis/target/types.ts +4 -9
- package/src/analysis/workspace/cmake-parser.ts +207 -0
- package/src/analysis/workspace/cmake.ts +141 -0
- package/src/analysis/workspace/maven.ts +310 -0
- package/src/analysis/workspace/membership.ts +100 -26
- package/src/analysis/workspace/metadata.ts +6 -1
- package/src/analysis/workspace/observe.ts +6 -0
- package/src/analysis/workspace/types.ts +11 -3
- package/src/diagnostics/coverage.ts +49 -0
- package/src/diagnostics/evidence.ts +10 -2
- package/src/session/health-workflow.ts +6 -0
- package/src/session/input/common.ts +1 -1
- package/src/session/orientation/collect.ts +42 -7
- package/src/session/orientation/context-facts.ts +3 -3
- package/src/session/orientation/context-sections.ts +13 -15
- package/src/session/orientation/facts.ts +5 -8
- package/src/session/orientation-workflow.ts +4 -19
- package/src/session/target-workflow.ts +25 -18
- package/src/tool/code_find/result.ts +5 -7
- package/src/tool/code_graph/display.ts +5 -6
- package/src/tool/code_graph/format.ts +8 -24
- package/src/tool/code_graph/result.ts +16 -75
- package/src/tool/code_graph/section.ts +21 -33
- package/src/tool/code_graph/tui.ts +10 -5
- package/src/tool/code_health/diagnostic-tui.ts +49 -0
- package/src/tool/code_health/guidance.ts +27 -0
- package/src/tool/code_health/markdown.ts +60 -8
- package/src/tool/code_health/result.ts +20 -9
- package/src/tool/code_health/structured-schema.ts +14 -0
- package/src/tool/code_health/structured.ts +7 -1
- package/src/tool/code_health/tui.ts +33 -40
- package/src/tool/code_inspect/result.ts +23 -18
- package/src/tool/code_inspect/structured.ts +2 -19
- package/src/tool/code_orientation/result.ts +53 -100
- package/src/tool/code_orientation/structured-schema.ts +16 -12
- package/src/tool/code_orientation/structured-workspace.ts +13 -7
- package/src/tool/code_orientation/structured.ts +31 -39
- package/src/tool/code_orientation/workspace-format.ts +4 -10
- package/src/tool/code_orientation/workspace-instructions.ts +4 -5
- package/src/tool/code_orientation/workspace-observations.ts +2 -2
- package/src/tool/code_orientation/workspace-output.ts +16 -7
- package/src/tool/code_orientation/workspace-projects.ts +7 -10
- package/src/tool/code_orientation/workspace-sections.ts +13 -19
- package/src/tool/code_resolve/markdown.ts +4 -46
- package/src/tool/code_resolve/result.ts +43 -72
- package/src/tool/infra/truncate.ts +2 -16
- package/src/tool/result/candidate-selection.ts +141 -0
- package/src/tool/result/display.ts +41 -45
- package/src/tool/result/errors.ts +1 -0
- package/src/tool/result/model-budget.ts +26 -1
- package/src/tool/result/refactor.ts +11 -8
- package/src/tool/result/structured.ts +2 -1
- package/src/tool/result/types.ts +9 -8
- package/src/tool/schemas.ts +15 -20
- package/src/ui/footer.ts +2 -4
- package/src/ui/status-presentation.ts +4 -7
- package/src/ui/tui/candidate-selection.ts +40 -95
- package/src/ui/tui/common.ts +16 -70
- package/src/ui/tui/display.ts +6 -24
- package/src/tool/result/candidate-row.ts +0 -49
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import type ts from "typescript";
|
|
3
|
+
|
|
4
|
+
const require = createRequire(import.meta.url);
|
|
5
|
+
let cached: typeof ts | undefined;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Load the bundled TypeScript compiler API on first use.
|
|
9
|
+
*
|
|
10
|
+
* Evaluating `typescript` costs roughly 100 ms, and most sessions and tests that import this
|
|
11
|
+
* package never ask a tsconfig question. Callers stay synchronous, so this uses `require`
|
|
12
|
+
* rather than a dynamic `import()`.
|
|
13
|
+
*/
|
|
14
|
+
export function getTypeScript(): typeof ts {
|
|
15
|
+
cached ??= require("typescript") as typeof ts;
|
|
16
|
+
return cached;
|
|
17
|
+
}
|
|
@@ -5,10 +5,20 @@ export const TENTATIVE_PUSH_UNAVAILABLE_REASON =
|
|
|
5
5
|
/** A final evidence state for one tracked document. */
|
|
6
6
|
export type DiagnosticEvidenceStatus = "confirmed" | "unconfirmed" | "failed" | "removed";
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Why a document is not confirmed, when a specific cause is known.
|
|
10
|
+
*
|
|
11
|
+
* `disk-changed`: the file's disk metadata changed after its content was last
|
|
12
|
+
* read and diagnosed, for example through an edit outside Pi.
|
|
13
|
+
*/
|
|
14
|
+
export type DiagnosticEvidenceReason = "disk-changed";
|
|
15
|
+
|
|
8
16
|
/** Freshness evidence for one tracked document. */
|
|
9
17
|
export interface DiagnosticEvidenceDocument {
|
|
10
18
|
readonly file: string;
|
|
11
19
|
readonly status: DiagnosticEvidenceStatus;
|
|
20
|
+
/** Known cause for a non-confirmed status. */
|
|
21
|
+
readonly reason?: DiagnosticEvidenceReason;
|
|
12
22
|
}
|
|
13
23
|
|
|
14
24
|
/** Exact document coverage from a diagnostic snapshot or refresh attempt. */
|
|
@@ -35,3 +45,35 @@ export function summarizeDiagnosticEvidence(
|
|
|
35
45
|
for (const document of documents) counts[document.status]++;
|
|
36
46
|
return { ...counts, documents: [...documents] };
|
|
37
47
|
}
|
|
48
|
+
|
|
49
|
+
function evidenceStatusRank(status: DiagnosticEvidenceStatus): number {
|
|
50
|
+
switch (status) {
|
|
51
|
+
case "confirmed":
|
|
52
|
+
return 1;
|
|
53
|
+
case "unconfirmed":
|
|
54
|
+
return 2;
|
|
55
|
+
case "failed":
|
|
56
|
+
return 3;
|
|
57
|
+
case "removed":
|
|
58
|
+
return 4;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Choose the more conservative of two documents for the same file.
|
|
64
|
+
*
|
|
65
|
+
* The higher status rank wins. For equal rank, a known `reason` is kept so a
|
|
66
|
+
* reason-less duplicate from another route cannot drop it.
|
|
67
|
+
*/
|
|
68
|
+
export function preferEvidenceDocument(
|
|
69
|
+
existing: DiagnosticEvidenceDocument | undefined,
|
|
70
|
+
next: DiagnosticEvidenceDocument,
|
|
71
|
+
): DiagnosticEvidenceDocument {
|
|
72
|
+
if (!existing) return next;
|
|
73
|
+
const nextRank = evidenceStatusRank(next.status);
|
|
74
|
+
const existingRank = evidenceStatusRank(existing.status);
|
|
75
|
+
if (nextRank > existingRank) return next;
|
|
76
|
+
if (nextRank < existingRank) return existing;
|
|
77
|
+
if (existing.reason === undefined && next.reason !== undefined) return next;
|
|
78
|
+
return existing;
|
|
79
|
+
}
|
|
@@ -9,6 +9,7 @@ import { getDiagnosticFileState } from "../client/client-file-state.ts";
|
|
|
9
9
|
import {
|
|
10
10
|
type DiagnosticEvidenceDocument,
|
|
11
11
|
type DiagnosticEvidenceSummary,
|
|
12
|
+
preferEvidenceDocument,
|
|
12
13
|
summarizeDiagnosticEvidence,
|
|
13
14
|
} from "../diagnostics/evidence.ts";
|
|
14
15
|
|
|
@@ -82,23 +83,7 @@ function deduplicateEvidenceDocuments(
|
|
|
82
83
|
): DiagnosticEvidenceDocument[] {
|
|
83
84
|
const byFile = new Map<string, DiagnosticEvidenceDocument>();
|
|
84
85
|
for (const document of documents) {
|
|
85
|
-
|
|
86
|
-
if (!existing || evidenceStatusRank(document.status) > evidenceStatusRank(existing.status)) {
|
|
87
|
-
byFile.set(document.file, document);
|
|
88
|
-
}
|
|
86
|
+
byFile.set(document.file, preferEvidenceDocument(byFile.get(document.file), document));
|
|
89
87
|
}
|
|
90
88
|
return Array.from(byFile.values()).sort((a, b) => a.file.localeCompare(b.file));
|
|
91
89
|
}
|
|
92
|
-
|
|
93
|
-
function evidenceStatusRank(status: DiagnosticEvidenceDocument["status"]): number {
|
|
94
|
-
switch (status) {
|
|
95
|
-
case "confirmed":
|
|
96
|
-
return 1;
|
|
97
|
-
case "unconfirmed":
|
|
98
|
-
return 2;
|
|
99
|
-
case "failed":
|
|
100
|
-
return 3;
|
|
101
|
-
case "removed":
|
|
102
|
-
return 4;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as path from "node:path";
|
|
2
|
+
import { isWithinOrEqual } from "@mrclrchtr/supi-core/project";
|
|
3
|
+
import { getDiagnosticFileState } from "../client/client-file-state.ts";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Session-owned record of tracked files that disappeared from disk.
|
|
7
|
+
*
|
|
8
|
+
* Every path that clears tracked state for a missing file records the file here,
|
|
9
|
+
* including passive snapshot reads and background server-requested refreshes.
|
|
10
|
+
* The record survives until a caller acknowledges that a report showed the
|
|
11
|
+
* removal, so the removal does not depend on when the next refresh runs.
|
|
12
|
+
*
|
|
13
|
+
* Example: `rm src/a.ts`, then the TypeScript server sends
|
|
14
|
+
* `workspace/diagnostic/refresh`. The background refresh clears `src/a.ts`.
|
|
15
|
+
* A later `code_health({ refresh: true })` still reports it as removed.
|
|
16
|
+
*
|
|
17
|
+
* Entries come only from previously tracked files, so the record is bounded by
|
|
18
|
+
* the tracked-file state it replaces.
|
|
19
|
+
*/
|
|
20
|
+
export class RemovedTrackedFileLedger {
|
|
21
|
+
readonly #files = new Set<string>();
|
|
22
|
+
|
|
23
|
+
/** Record one removed tracked file. */
|
|
24
|
+
record(filePath: string): void {
|
|
25
|
+
this.#files.add(path.resolve(filePath));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Return retained removals within `scope`, sorted, without consuming them.
|
|
30
|
+
*
|
|
31
|
+
* Files that exist again are dropped: a recreated file is no longer removed.
|
|
32
|
+
*/
|
|
33
|
+
peek(scope: string | null = null): string[] {
|
|
34
|
+
for (const file of this.#files) {
|
|
35
|
+
if (getDiagnosticFileState(file) !== "removed") this.#files.delete(file);
|
|
36
|
+
}
|
|
37
|
+
const root = scope === null ? null : path.resolve(scope);
|
|
38
|
+
return Array.from(this.#files)
|
|
39
|
+
.filter((file) => root === null || isWithinOrEqual(root, file))
|
|
40
|
+
.sort((left, right) => left.localeCompare(right));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Forget removals that a delivered diagnostic report has shown. */
|
|
44
|
+
acknowledge(files: readonly string[]): void {
|
|
45
|
+
for (const file of files) this.#files.delete(path.resolve(file));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Forget every retained removal. */
|
|
49
|
+
clear(): void {
|
|
50
|
+
this.#files.clear();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
unavailableCodeQuery,
|
|
12
12
|
} from "@mrclrchtr/supi-code-runtime/api";
|
|
13
13
|
import * as projectRoots from "@mrclrchtr/supi-core/project";
|
|
14
|
-
import * as ts from "typescript";
|
|
15
14
|
import {
|
|
16
15
|
LspClient,
|
|
17
16
|
type LspClientLifecycleTransitionKind,
|
|
@@ -50,6 +49,7 @@ import type {
|
|
|
50
49
|
} from "../config/types.ts";
|
|
51
50
|
import { FileChangeType } from "../config/types.ts";
|
|
52
51
|
import { inspectTypeScriptLaunch } from "../config/typescript-launch.ts";
|
|
52
|
+
import { getTypeScript } from "../config/typescript-module.ts";
|
|
53
53
|
import { boundCwd } from "../debug-telemetry.ts";
|
|
54
54
|
import {
|
|
55
55
|
accumulateOutstandingDiagnostics,
|
|
@@ -60,6 +60,7 @@ import {
|
|
|
60
60
|
import {
|
|
61
61
|
type DiagnosticEvidenceDocument,
|
|
62
62
|
type DiagnosticEvidenceSummary,
|
|
63
|
+
preferEvidenceDocument,
|
|
63
64
|
summarizeDiagnosticEvidence,
|
|
64
65
|
} from "../diagnostics/evidence.ts";
|
|
65
66
|
import {
|
|
@@ -120,6 +121,7 @@ import {
|
|
|
120
121
|
type StartupRetryRouteResult,
|
|
121
122
|
} from "./manager-process-crash-report.ts";
|
|
122
123
|
import { buildProjectServerInfo } from "./manager-project-info.ts";
|
|
124
|
+
import { RemovedTrackedFileLedger } from "./manager-removal-ledger.ts";
|
|
123
125
|
import type {
|
|
124
126
|
ActiveCoverageSummaryEntry,
|
|
125
127
|
CoverageSummaryEntry,
|
|
@@ -400,6 +402,8 @@ export class LspManager {
|
|
|
400
402
|
private retiredRoutes = new Set<string>();
|
|
401
403
|
/** Runtime-owned cleanup for clients removed by route retirement. */
|
|
402
404
|
private retiredClientShutdowns = new Set<Promise<void>>();
|
|
405
|
+
/** Tracked files removed from disk until a diagnostic report shows them. */
|
|
406
|
+
private readonly removedTrackedFiles = new RemovedTrackedFileLedger();
|
|
403
407
|
/** Shared diagnostic-recovery restart for each replaceable client route. */
|
|
404
408
|
private pendingRestarts = new Map<string, Promise<{ files: string[]; restarted: boolean }>>();
|
|
405
409
|
/** Monotonic ownership generation for each replaceable client route. */
|
|
@@ -582,6 +586,14 @@ export class LspManager {
|
|
|
582
586
|
);
|
|
583
587
|
}
|
|
584
588
|
|
|
589
|
+
/** Return the open document text last synchronized to the server, without starting one. */
|
|
590
|
+
getOpenDocumentContent(filePath: string): string | null {
|
|
591
|
+
const resolvedPath = resolveSessionPath(this.cwd, filePath);
|
|
592
|
+
return (
|
|
593
|
+
this.getExistingClientForFile(resolvedPath)?.getOpenDocumentContent(resolvedPath) ?? null
|
|
594
|
+
);
|
|
595
|
+
}
|
|
596
|
+
|
|
585
597
|
/**
|
|
586
598
|
* Coverage gap for a project-wide TypeScript request answered by `client`.
|
|
587
599
|
*
|
|
@@ -732,6 +744,7 @@ export class LspManager {
|
|
|
732
744
|
},
|
|
733
745
|
this.cwd,
|
|
734
746
|
this.fileAssociations,
|
|
747
|
+
(filePath) => this.removedTrackedFiles.record(filePath),
|
|
735
748
|
);
|
|
736
749
|
return client;
|
|
737
750
|
}
|
|
@@ -1526,7 +1539,7 @@ export class LspManager {
|
|
|
1526
1539
|
try {
|
|
1527
1540
|
recordDebugEvent({
|
|
1528
1541
|
source: "lsp",
|
|
1529
|
-
level: outcome === "failure" || outcome === "exhausted" ? "warning" : "
|
|
1542
|
+
level: outcome === "failure" || outcome === "exhausted" ? "warning" : "info",
|
|
1530
1543
|
category: "runtime.recovery",
|
|
1531
1544
|
message: `LSP process-crash recovery ${outcome}`,
|
|
1532
1545
|
cwd: boundCwd(this.cwd),
|
|
@@ -2308,6 +2321,24 @@ export class LspManager {
|
|
|
2308
2321
|
closeFile(filePath: string): void {
|
|
2309
2322
|
closeFileAcrossClients(this.clients.values(), resolveSessionPath(this.cwd, filePath));
|
|
2310
2323
|
}
|
|
2324
|
+
/**
|
|
2325
|
+
* Return tracked files removed from disk since a report last showed them.
|
|
2326
|
+
*
|
|
2327
|
+
* The read does not consume the removals; call
|
|
2328
|
+
* {@link acknowledgeRemovedTrackedFiles} after a report delivered them.
|
|
2329
|
+
*/
|
|
2330
|
+
peekRemovedTrackedFiles(scope: string | null = null): string[] {
|
|
2331
|
+
this.pruneMissingFiles();
|
|
2332
|
+
return this.removedTrackedFiles.peek(
|
|
2333
|
+
scope === null ? null : resolveSessionPath(this.cwd, scope),
|
|
2334
|
+
);
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2337
|
+
/** Forget removals that a delivered diagnostic report has shown. */
|
|
2338
|
+
acknowledgeRemovedTrackedFiles(files: readonly string[]): void {
|
|
2339
|
+
this.removedTrackedFiles.acknowledge(files.map((file) => resolveSessionPath(this.cwd, file)));
|
|
2340
|
+
}
|
|
2341
|
+
|
|
2311
2342
|
/** Remove any missing files from open-document and diagnostic state. */
|
|
2312
2343
|
pruneMissingFiles(): string[] {
|
|
2313
2344
|
const removed = pruneMissingFilesFromClients(this.clients.values());
|
|
@@ -2627,6 +2658,7 @@ export class LspManager {
|
|
|
2627
2658
|
const shutdowns = clients.map((client) => client.shutdown().catch(() => {}));
|
|
2628
2659
|
await Promise.all([...shutdowns, ...this.retiredClientShutdowns]);
|
|
2629
2660
|
this.retiredClientShutdowns.clear();
|
|
2661
|
+
this.removedTrackedFiles.clear();
|
|
2630
2662
|
// Dispose every client so pending or active progress tokens and
|
|
2631
2663
|
// readiness promises cannot outlive the manager.
|
|
2632
2664
|
for (const client of clients) client.dispose();
|
|
@@ -2767,6 +2799,7 @@ export class LspManager {
|
|
|
2767
2799
|
snapshot.documents.map((document) => ({
|
|
2768
2800
|
file: relativeFilePathFromUri(document.uri, this.cwd),
|
|
2769
2801
|
status: document.status,
|
|
2802
|
+
...(document.reason ? { reason: document.reason } : {}),
|
|
2770
2803
|
})),
|
|
2771
2804
|
),
|
|
2772
2805
|
);
|
|
@@ -2821,6 +2854,7 @@ export class LspManager {
|
|
|
2821
2854
|
evidenceDocuments.push({
|
|
2822
2855
|
file: relativeFilePathFromUri(document.uri, this.cwd),
|
|
2823
2856
|
status: document.status,
|
|
2857
|
+
...(document.reason ? { reason: document.reason } : {}),
|
|
2824
2858
|
});
|
|
2825
2859
|
}
|
|
2826
2860
|
for (const entry of snapshot.entries) {
|
|
@@ -2898,6 +2932,7 @@ export class LspManager {
|
|
|
2898
2932
|
snapshot.documents.map((document) => ({
|
|
2899
2933
|
file: relativeFilePathFromUri(document.uri, this.cwd),
|
|
2900
2934
|
status: document.status,
|
|
2935
|
+
...(document.reason ? { reason: document.reason } : {}),
|
|
2901
2936
|
})),
|
|
2902
2937
|
);
|
|
2903
2938
|
const evidence = this.toWorkspaceDiagnosticEvidence(evidenceDocuments);
|
|
@@ -2942,7 +2977,7 @@ export class LspManager {
|
|
|
2942
2977
|
}
|
|
2943
2978
|
|
|
2944
2979
|
return {
|
|
2945
|
-
caseSensitiveFileNames:
|
|
2980
|
+
caseSensitiveFileNames: getTypeScript().sys.useCaseSensitiveFileNames,
|
|
2946
2981
|
counts: accumulator.counts,
|
|
2947
2982
|
basisCounts: accumulator.basisCounts,
|
|
2948
2983
|
entries: accumulator.entries,
|
|
@@ -2956,10 +2991,7 @@ export class LspManager {
|
|
|
2956
2991
|
for (const document of documents) {
|
|
2957
2992
|
const file = path.relative(this.cwd, path.resolve(this.cwd, document.file));
|
|
2958
2993
|
if (!this.isAutomaticScopePath(file)) continue;
|
|
2959
|
-
|
|
2960
|
-
if (!existing || evidenceStatusRank(document.status) > evidenceStatusRank(existing.status)) {
|
|
2961
|
-
byFile.set(file, { file, status: document.status });
|
|
2962
|
-
}
|
|
2994
|
+
byFile.set(file, preferEvidenceDocument(byFile.get(file), { ...document, file }));
|
|
2963
2995
|
}
|
|
2964
2996
|
return summarizeDiagnosticEvidence(
|
|
2965
2997
|
Array.from(byFile.values()).sort((a, b) => a.file.localeCompare(b.file)),
|
|
@@ -3520,6 +3552,7 @@ function collectClientDiagnosticEvidenceDocuments(
|
|
|
3520
3552
|
snapshot.documents.map((document) => ({
|
|
3521
3553
|
file: relativeFilePathFromUri(document.uri, cwd),
|
|
3522
3554
|
status: document.status,
|
|
3555
|
+
...(document.reason ? { reason: document.reason } : {}),
|
|
3523
3556
|
})),
|
|
3524
3557
|
);
|
|
3525
3558
|
}
|
|
@@ -3549,16 +3582,3 @@ function collectOutstandingDiagnosticSummaryEntries(
|
|
|
3549
3582
|
a.file.localeCompare(b.file),
|
|
3550
3583
|
);
|
|
3551
3584
|
}
|
|
3552
|
-
|
|
3553
|
-
function evidenceStatusRank(status: DiagnosticEvidenceDocument["status"]): number {
|
|
3554
|
-
switch (status) {
|
|
3555
|
-
case "confirmed":
|
|
3556
|
-
return 1;
|
|
3557
|
-
case "unconfirmed":
|
|
3558
|
-
return 2;
|
|
3559
|
-
case "failed":
|
|
3560
|
-
return 3;
|
|
3561
|
-
case "removed":
|
|
3562
|
-
return 4;
|
|
3563
|
-
}
|
|
3564
|
-
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as fs from "node:fs";
|
|
2
|
-
import ts from "typescript";
|
|
2
|
+
import type ts from "typescript";
|
|
3
|
+
import { getTypeScript } from "../config/typescript-module.ts";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Whether the identifier at `position` names a top-level declaration that only
|
|
@@ -22,6 +23,7 @@ export function isFileLocalTopLevelDeclaration(
|
|
|
22
23
|
} catch {
|
|
23
24
|
return false;
|
|
24
25
|
}
|
|
26
|
+
const ts = getTypeScript();
|
|
25
27
|
const sourceFile = ts.createSourceFile(filePath, text, ts.ScriptTarget.Latest, true);
|
|
26
28
|
if (!ts.isExternalModule(sourceFile)) return false;
|
|
27
29
|
let offset: number;
|
|
@@ -44,6 +46,7 @@ function topLevelDeclarationNameAt(
|
|
|
44
46
|
offset: number,
|
|
45
47
|
sourceFile: ts.SourceFile,
|
|
46
48
|
): string | null {
|
|
49
|
+
const ts = getTypeScript();
|
|
47
50
|
const names: ts.Identifier[] = [];
|
|
48
51
|
if (
|
|
49
52
|
ts.isFunctionDeclaration(statement) ||
|
|
@@ -63,6 +66,7 @@ function topLevelDeclarationNameAt(
|
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
function hasExportModifier(statement: ts.Statement): boolean {
|
|
69
|
+
const ts = getTypeScript();
|
|
66
70
|
return (
|
|
67
71
|
ts.canHaveModifiers(statement) &&
|
|
68
72
|
(ts.getModifiers(statement) ?? []).some(
|
|
@@ -75,6 +79,7 @@ function hasExportModifier(statement: ts.Statement): boolean {
|
|
|
75
79
|
|
|
76
80
|
/** `export { name }`, `export default name`, or `export = name` in this file. */
|
|
77
81
|
function exportedByName(sourceFile: ts.SourceFile, name: string): boolean {
|
|
82
|
+
const ts = getTypeScript();
|
|
78
83
|
return sourceFile.statements.some((statement) => {
|
|
79
84
|
if (ts.isExportAssignment(statement)) {
|
|
80
85
|
return ts.isIdentifier(statement.expression) && statement.expression.text === name;
|
|
@@ -83,7 +83,12 @@ export function createLspSemanticProvider(lsp: WorkspaceLspRuntime): SemanticPro
|
|
|
83
83
|
? await lsp.documentSymbols(filePath, control)
|
|
84
84
|
: await lsp.documentSymbols(filePath);
|
|
85
85
|
if (result.kind === "unavailable") return unavailableCodeQuery(result.reason);
|
|
86
|
-
|
|
86
|
+
// Anchor names against the text the server analyzed, not possibly newer disk content.
|
|
87
|
+
const symbols = await mapDocumentSymbols(
|
|
88
|
+
result.data,
|
|
89
|
+
filePath,
|
|
90
|
+
lsp.getOpenDocumentContent(filePath),
|
|
91
|
+
);
|
|
87
92
|
return result.kind === "partial"
|
|
88
93
|
? partialCodeQuery(symbols, result.reason)
|
|
89
94
|
: completedCodeQuery(symbols);
|
|
@@ -94,13 +94,19 @@ function symbolKindName(kind: number): string {
|
|
|
94
94
|
return SYMBOL_KIND_NAMES[kind] ?? "Unknown";
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* Flatten provider symbols while preserving declaration and name anchors.
|
|
99
|
+
* Name anchors are recovered from `sourceText` (the synchronized open-document
|
|
100
|
+
* text) when given; otherwise from disk, or the server `selectionRange` start.
|
|
101
|
+
*/
|
|
98
102
|
export async function mapDocumentSymbols(
|
|
99
103
|
symbols: DocumentSymbol[] | SymbolInformation[],
|
|
100
104
|
filePath: string,
|
|
105
|
+
sourceText?: string | null,
|
|
101
106
|
): Promise<DocumentCodeSymbol[]> {
|
|
102
107
|
return flattenDocumentSymbols(symbols, filePath, null, {
|
|
103
|
-
sourceLines:
|
|
108
|
+
sourceLines:
|
|
109
|
+
typeof sourceText === "string" ? splitLines(sourceText) : await readSourceLines(filePath),
|
|
104
110
|
parent: null,
|
|
105
111
|
});
|
|
106
112
|
}
|
|
@@ -169,12 +175,16 @@ function isSymbolInformation(
|
|
|
169
175
|
|
|
170
176
|
async function readSourceLines(filePath: string): Promise<readonly string[] | null> {
|
|
171
177
|
try {
|
|
172
|
-
return (await readFile(filePath, "utf-8"))
|
|
178
|
+
return splitLines(await readFile(filePath, "utf-8"));
|
|
173
179
|
} catch {
|
|
174
180
|
return null;
|
|
175
181
|
}
|
|
176
182
|
}
|
|
177
183
|
|
|
184
|
+
function splitLines(text: string): readonly string[] {
|
|
185
|
+
return text.split(/\r?\n/);
|
|
186
|
+
}
|
|
187
|
+
|
|
178
188
|
function resolveDocumentSymbolNameStart(
|
|
179
189
|
symbol: DocumentSymbol,
|
|
180
190
|
sourceLines: readonly string[] | null,
|
|
@@ -40,6 +40,17 @@ export interface WorkspaceLspDiagnosticSurface {
|
|
|
40
40
|
getOutstandingDiagnosticSummary(
|
|
41
41
|
maxSeverity?: number,
|
|
42
42
|
): WorkspaceDiagnosticSnapshot<OutstandingDiagnosticSummaryEntry>;
|
|
43
|
+
/**
|
|
44
|
+
* Return absolute paths of tracked files removed from disk within `scope`
|
|
45
|
+
* since a report last showed them.
|
|
46
|
+
*
|
|
47
|
+
* The read does not consume removals. Passive snapshots and background
|
|
48
|
+
* refreshes leave them in place, so a later report can still show them
|
|
49
|
+
* regardless of timing. Recreated files are dropped.
|
|
50
|
+
*/
|
|
51
|
+
peekRemovedTrackedFiles(scope?: string | null): readonly string[];
|
|
52
|
+
/** Forget removals after a delivered diagnostic report has shown them. */
|
|
53
|
+
acknowledgeRemovedTrackedFiles(files: readonly string[]): void;
|
|
43
54
|
/** Run best-effort recovery and retain final diagnostic evidence, including failures. */
|
|
44
55
|
recoverDiagnostics(options?: {
|
|
45
56
|
restartIfStillStale?: boolean;
|
|
@@ -73,6 +73,7 @@ export type {
|
|
|
73
73
|
} from "./runtime-diagnostic-surface.ts";
|
|
74
74
|
export {
|
|
75
75
|
type DiagnosticEvidenceDocument,
|
|
76
|
+
type DiagnosticEvidenceReason,
|
|
76
77
|
type DiagnosticEvidenceStatus,
|
|
77
78
|
type DiagnosticEvidenceSummary,
|
|
78
79
|
emptyProcessCrashRecoveryReport,
|
|
@@ -300,6 +301,10 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
|
|
|
300
301
|
return this.manager.getOpenDocumentVersion(this.resolveFilePath(filePath));
|
|
301
302
|
}
|
|
302
303
|
|
|
304
|
+
getOpenDocumentContent(filePath: string): string | null {
|
|
305
|
+
return this.manager.getOpenDocumentContent(this.resolveFilePath(filePath));
|
|
306
|
+
}
|
|
307
|
+
|
|
303
308
|
async captureCodeActionEdit(
|
|
304
309
|
filePath: string,
|
|
305
310
|
action: CodeAction,
|
|
@@ -575,6 +580,16 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
|
|
|
575
580
|
return this.manager.getOutstandingDiagnosticSummarySnapshot(maxSeverity);
|
|
576
581
|
}
|
|
577
582
|
|
|
583
|
+
/** Return retained tracked-file removals without consuming them. */
|
|
584
|
+
peekRemovedTrackedFiles(scope: string | null = null): readonly string[] {
|
|
585
|
+
return this.manager.peekRemovedTrackedFiles(scope);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/** Forget retained removals that a delivered report has shown. */
|
|
589
|
+
acknowledgeRemovedTrackedFiles(files: readonly string[]): void {
|
|
590
|
+
this.manager.acknowledgeRemovedTrackedFiles(files);
|
|
591
|
+
}
|
|
592
|
+
|
|
578
593
|
/** Retry failed routes and run a workspace-wide diagnostic recovery pass. */
|
|
579
594
|
async recoverDiagnostics(options?: {
|
|
580
595
|
restartIfStillStale?: boolean;
|
|
@@ -592,7 +607,7 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
|
|
|
592
607
|
const outcome = result.refreshFailureReason ? "failed" : "completed";
|
|
593
608
|
recordDebugEvent({
|
|
594
609
|
source: "lsp",
|
|
595
|
-
level: "
|
|
610
|
+
level: outcome === "failed" ? "warning" : "info",
|
|
596
611
|
category: "runtime.recovery",
|
|
597
612
|
message: `LSP diagnostic recovery ${outcome}`,
|
|
598
613
|
cwd: truncateIdentity(this.manager.getCwd()),
|
|
@@ -618,7 +633,7 @@ class DefaultWorkspaceLspRuntime implements WorkspaceLspRuntime {
|
|
|
618
633
|
if (isCodeRequestInterruption(error, options?.control)) {
|
|
619
634
|
recordDebugEvent({
|
|
620
635
|
source: "lsp",
|
|
621
|
-
level: "
|
|
636
|
+
level: "info",
|
|
622
637
|
category: "runtime.recovery",
|
|
623
638
|
message: "LSP diagnostic recovery cancelled",
|
|
624
639
|
cwd: truncateIdentity(this.manager.getCwd()),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
type DebugLevel,
|
|
2
3
|
recordDebugEvent,
|
|
3
4
|
truncateDebugIdentity as truncateIdentity,
|
|
4
5
|
} from "@mrclrchtr/supi-core/debug";
|
|
@@ -26,6 +27,15 @@ function boundedServerEntries(
|
|
|
26
27
|
}));
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Crashes warn; rare recovery and retirement snapshots are `info` so they persist
|
|
32
|
+
* by default. Frequent startup, readiness, and tracked-file transitions stay `debug`.
|
|
33
|
+
*/
|
|
34
|
+
function transitionLevel(kind: LspRuntimeTransition["kind"]): DebugLevel {
|
|
35
|
+
if (kind === "crash") return "warning";
|
|
36
|
+
return kind === "recovery" || kind === "retirement" ? "info" : "debug";
|
|
37
|
+
}
|
|
38
|
+
|
|
29
39
|
/** Record bounded aggregate telemetry for one runtime transition. */
|
|
30
40
|
export function recordLspRuntimeTransition(cwd: string, transition: LspRuntimeTransition): void {
|
|
31
41
|
const readyClients = transition.projectServers.filter(
|
|
@@ -37,7 +47,7 @@ export function recordLspRuntimeTransition(cwd: string, transition: LspRuntimeTr
|
|
|
37
47
|
);
|
|
38
48
|
recordDebugEvent({
|
|
39
49
|
source: "lsp",
|
|
40
|
-
level: transition.kind
|
|
50
|
+
level: transitionLevel(transition.kind),
|
|
41
51
|
category: "runtime.transition",
|
|
42
52
|
message: `LSP runtime transition: ${transition.kind}`,
|
|
43
53
|
cwd: truncateIdentity(cwd),
|
|
@@ -187,6 +187,8 @@ export interface WorkspaceLspRuntime extends WorkspaceLspDiagnosticSurface {
|
|
|
187
187
|
control?: CodeRequestControl,
|
|
188
188
|
): Promise<RoutedMutationResponse<CommandEditCaptureResult | null> | null>;
|
|
189
189
|
getOpenDocumentVersion(filePath: string): number | null;
|
|
190
|
+
/** Text last synchronized to the server for an open document, or null when not open. */
|
|
191
|
+
getOpenDocumentContent(filePath: string): string | null;
|
|
190
192
|
/**
|
|
191
193
|
* Wait for file readiness; an explicit refresh may make one shared route
|
|
192
194
|
* retry for this call without changing ordinary request recovery limits.
|
package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrclrchtr/supi-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0",
|
|
4
4
|
"description": "Shared settings, configuration, reporting, and session infrastructure",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -63,8 +63,10 @@
|
|
|
63
63
|
"./project": "./src/project.ts",
|
|
64
64
|
"./prompt-surface": "./src/prompt-surface.ts",
|
|
65
65
|
"./report": "./src/report.ts",
|
|
66
|
+
"./retired-packages": "./src/retired-packages.ts",
|
|
66
67
|
"./session": "./src/session.ts",
|
|
67
68
|
"./settings": "./src/settings.ts",
|
|
69
|
+
"./spill": "./src/spill.ts",
|
|
68
70
|
"./spinner-frames": "./src/spinner-frames.ts",
|
|
69
71
|
"./status-spinner": "./src/status-spinner.ts",
|
|
70
72
|
"./terminal": "./src/terminal.ts",
|
package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/api.ts
CHANGED
|
@@ -29,10 +29,14 @@ export * from "./prompt-surface.ts";
|
|
|
29
29
|
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
30
30
|
export * from "./report.ts";
|
|
31
31
|
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
32
|
+
export * from "./retired-packages.ts";
|
|
33
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
32
34
|
export * from "./session.ts";
|
|
33
35
|
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
34
36
|
export * from "./settings.ts";
|
|
35
37
|
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
38
|
+
export * from "./spill.ts";
|
|
39
|
+
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
36
40
|
export * from "./spinner-frames.ts";
|
|
37
41
|
// biome-ignore lint/performance/noReExportAll: intentional convenience barrel
|
|
38
42
|
export * from "./status-spinner.ts";
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Wrap content in an `<extension-context>` XML tag.
|
|
10
10
|
*
|
|
11
|
-
* @param source - Extension identifier (e.g. "supi-
|
|
11
|
+
* @param source - Extension identifier (e.g. "supi-lsp")
|
|
12
12
|
* @param content - The text content to wrap
|
|
13
13
|
* @param attrs - Optional additional attributes (rendered as key="value")
|
|
14
14
|
* @returns Formatted XML string
|