@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
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Shell hints — explain BSD sed script errors once per session.
|
|
2
|
+
//
|
|
3
|
+
// On macOS, `sed` is BSD sed: `-i` requires a backup-suffix argument and script errors read
|
|
4
|
+
// `sed: 1: "...": ...`. Agents trained on GNU sed retry the same shape repeatedly. This hook adds
|
|
5
|
+
// one hint to the first matching bash result in a session. It costs no context until it fires.
|
|
6
|
+
|
|
7
|
+
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
8
|
+
|
|
9
|
+
/** Marker that identifies the hint in tool results and on the session branch. */
|
|
10
|
+
export const BSD_SED_HINT_MARKER = "[supi shell hint]";
|
|
11
|
+
|
|
12
|
+
/** Text appended to the first BSD sed script error in a session. */
|
|
13
|
+
export const BSD_SED_HINT = `${BSD_SED_HINT_MARKER} This is BSD sed (macOS): \`sed -i\` needs a suffix argument (\`sed -i '' ...\`), and the substitute delimiter must not occur in the pattern. Prefer the edit tool for file changes when it is available, or \`gsed\` if installed.`;
|
|
14
|
+
|
|
15
|
+
const BSD_SED_ERROR = /^sed: (?:\d+: |-i may not be used|-I or -i may not be used)/m;
|
|
16
|
+
|
|
17
|
+
function resultText(content: readonly { type: string; text?: string }[]): string {
|
|
18
|
+
return content.map((part) => (part.type === "text" ? (part.text ?? "") : "")).join("\n");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function hintAlreadyShown(ctx: ExtensionContext): boolean {
|
|
22
|
+
return ctx.sessionManager
|
|
23
|
+
.getBranch()
|
|
24
|
+
.some(
|
|
25
|
+
(entry) =>
|
|
26
|
+
entry.type === "message" &&
|
|
27
|
+
entry.message.role === "toolResult" &&
|
|
28
|
+
JSON.stringify(entry.message.content).includes(BSD_SED_HINT_MARKER),
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Register a `tool_result` hook that appends {@link BSD_SED_HINT} to the first bash result in a
|
|
34
|
+
* session that contains a BSD sed script error. Safe to register from several extensions: the hook
|
|
35
|
+
* skips results that already carry the hint and sessions whose branch already shows it.
|
|
36
|
+
* Usable directly as a child-session extension factory.
|
|
37
|
+
*/
|
|
38
|
+
export function registerShellHints(pi: ExtensionAPI): void {
|
|
39
|
+
pi.on("tool_result", (event, ctx) => {
|
|
40
|
+
if (event.toolName !== "bash") return;
|
|
41
|
+
const text = resultText(event.content);
|
|
42
|
+
if (!BSD_SED_ERROR.test(text) || text.includes(BSD_SED_HINT_MARKER)) return;
|
|
43
|
+
if (hintAlreadyShown(ctx)) return;
|
|
44
|
+
return { content: [...event.content, { type: "text", text: BSD_SED_HINT }] };
|
|
45
|
+
});
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Side-run signal shared over `pi.events`.
|
|
2
|
+
//
|
|
3
|
+
// A side run is agent work whose result the session will not continue from,
|
|
4
|
+
// such as a run on a branch that is abandoned afterwards. Listeners use the
|
|
5
|
+
// signal to skip work tied to the run's result, for example prompt suggestions.
|
|
6
|
+
|
|
7
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
8
|
+
|
|
9
|
+
/** Event emitted on `pi.events` when a side run starts. Payload: {@link SideRunEvent}. */
|
|
10
|
+
export const SIDE_RUN_START_EVENT = "supi:side-run:start";
|
|
11
|
+
|
|
12
|
+
/** Event emitted on `pi.events` when a side run ends. Payload: {@link SideRunEvent}. */
|
|
13
|
+
export const SIDE_RUN_END_EVENT = "supi:side-run:end";
|
|
14
|
+
|
|
15
|
+
/** Payload of {@link SIDE_RUN_START_EVENT} and {@link SIDE_RUN_END_EVENT}. */
|
|
16
|
+
export interface SideRunEvent {
|
|
17
|
+
/** Emitting package, such as `supi-debug`. */
|
|
18
|
+
readonly source: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Run `run` as a side run: emit {@link SIDE_RUN_START_EVENT} before it and
|
|
23
|
+
* {@link SIDE_RUN_END_EVENT} after it, also when it throws.
|
|
24
|
+
*
|
|
25
|
+
* After a session replacement or reload the captured `pi` is stale and its
|
|
26
|
+
* `events.emit` throws. That end signal is dropped instead of masking the
|
|
27
|
+
* run's result; listeners reset their side-run state on `session_start` and
|
|
28
|
+
* `session_shutdown`.
|
|
29
|
+
*/
|
|
30
|
+
export async function runSideRun<T>(
|
|
31
|
+
pi: Pick<ExtensionAPI, "events">,
|
|
32
|
+
source: string,
|
|
33
|
+
run: () => Promise<T>,
|
|
34
|
+
): Promise<T> {
|
|
35
|
+
const payload: SideRunEvent = { source };
|
|
36
|
+
pi.events.emit(SIDE_RUN_START_EVENT, payload);
|
|
37
|
+
try {
|
|
38
|
+
return await run();
|
|
39
|
+
} finally {
|
|
40
|
+
try {
|
|
41
|
+
pi.events.emit(SIDE_RUN_END_EVENT, payload);
|
|
42
|
+
} catch {
|
|
43
|
+
// Stale extension instance after session replacement; see JSDoc.
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// supi-core spill domain — create-only temp files for full tool output (#597).
|
|
2
|
+
//
|
|
3
|
+
// SuPi never deletes spill files. Instead, it writes few of them: one private base directory per
|
|
4
|
+
// user, content-addressed names, and reuse for identical content. The OS temp purge owns their
|
|
5
|
+
// lifetime, so paths returned to the model stay readable for the session.
|
|
6
|
+
|
|
7
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
8
|
+
import { lstatSync, mkdirSync, mkdtempSync, renameSync, writeFileSync } from "node:fs";
|
|
9
|
+
import { tmpdir } from "node:os";
|
|
10
|
+
import { extname, join } from "node:path";
|
|
11
|
+
|
|
12
|
+
/** Input for {@link writeSpillFile}. */
|
|
13
|
+
export interface SpillFileOptions {
|
|
14
|
+
/** Producer id used as sub-directory, e.g. `"agent"`. Lowercase letters, digits, and dashes. */
|
|
15
|
+
owner: string;
|
|
16
|
+
/** Descriptive file name, e.g. `"snapshot.md"`. The content hash is inserted before the extension. */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Full content to persist: text (written as UTF-8) or raw bytes. */
|
|
19
|
+
content: string | Uint8Array;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const SEGMENT = /^[a-z0-9][a-z0-9-]*$/;
|
|
23
|
+
const FILE_NAME = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Persist full output that did not fit inline and return its absolute path.
|
|
27
|
+
*
|
|
28
|
+
* Layout: `$TMPDIR/supi-<uid>/<owner>/<stem>-<sha256 prefix><ext>`. Identical content maps to the
|
|
29
|
+
* same file, which is reused. Both directories must be real directories owned by the current
|
|
30
|
+
* user without group/other access; otherwise the file falls back to a fresh `mkdtemp`
|
|
31
|
+
* directory, as before. Files are created with mode `0600` and published atomically by rename.
|
|
32
|
+
*/
|
|
33
|
+
export function writeSpillFile({ owner, name, content }: SpillFileOptions): string {
|
|
34
|
+
if (!SEGMENT.test(owner)) throw new Error(`Invalid spill owner: ${owner}`);
|
|
35
|
+
if (!FILE_NAME.test(name)) throw new Error(`Invalid spill file name: ${name}`);
|
|
36
|
+
const extension = extname(name);
|
|
37
|
+
const stem = name.slice(0, name.length - extension.length);
|
|
38
|
+
const hash = createHash("sha256").update(content).digest("hex").slice(0, 32);
|
|
39
|
+
const fileName = `${stem}-${hash}${extension}`;
|
|
40
|
+
|
|
41
|
+
const directory = privateSpillDirectory(owner);
|
|
42
|
+
if (!directory) {
|
|
43
|
+
const fallback = join(mkdtempSync(join(tmpdir(), `supi-${owner}-`)), fileName);
|
|
44
|
+
writeFileSync(fallback, content, { encoding: "utf8", mode: 0o600, flag: "wx" });
|
|
45
|
+
return fallback;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const target = join(directory, fileName);
|
|
49
|
+
if (isRegularFile(target)) return target;
|
|
50
|
+
const staging = join(directory, `.${fileName}.${process.pid}.${randomBytes(4).toString("hex")}`);
|
|
51
|
+
writeFileSync(staging, content, { encoding: "utf8", mode: 0o600, flag: "wx" });
|
|
52
|
+
// Atomic publish; a concurrent writer of the same hash replaces it with identical bytes.
|
|
53
|
+
renameSync(staging, target);
|
|
54
|
+
return target;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Return the validated private spill directory for `owner`, or undefined when it is unsafe. */
|
|
58
|
+
function privateSpillDirectory(owner: string): string | undefined {
|
|
59
|
+
const uid = process.getuid?.();
|
|
60
|
+
const base = join(tmpdir(), uid === undefined ? "supi" : `supi-${uid}`);
|
|
61
|
+
if (!ensurePrivateDirectory(base, uid)) return undefined;
|
|
62
|
+
const directory = join(base, owner);
|
|
63
|
+
return ensurePrivateDirectory(directory, uid) ? directory : undefined;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Create `path` with mode `0700` if missing, then accept it only when it is a real directory
|
|
68
|
+
* (not a symlink) owned by `uid` with no group/other permissions. Never modifies or removes an
|
|
69
|
+
* existing entry. Ownership and mode checks are skipped where POSIX ids are unavailable.
|
|
70
|
+
*/
|
|
71
|
+
function ensurePrivateDirectory(path: string, uid: number | undefined): boolean {
|
|
72
|
+
try {
|
|
73
|
+
mkdirSync(path, { mode: 0o700 });
|
|
74
|
+
} catch (error) {
|
|
75
|
+
if ((error as NodeJS.ErrnoException).code !== "EEXIST") return false;
|
|
76
|
+
}
|
|
77
|
+
try {
|
|
78
|
+
const stats = lstatSync(path);
|
|
79
|
+
if (!stats.isDirectory() || stats.isSymbolicLink()) return false;
|
|
80
|
+
if (uid === undefined) return true;
|
|
81
|
+
return stats.uid === uid && (stats.mode & 0o077) === 0;
|
|
82
|
+
} catch {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function isRegularFile(path: string): boolean {
|
|
88
|
+
try {
|
|
89
|
+
return lstatSync(path).isFile();
|
|
90
|
+
} catch {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrclrchtr/supi-lsp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"description": "Language Server Protocol runtime for SuPi code intelligence",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"!__tests__"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"ignore": "
|
|
36
|
-
"semver": "
|
|
35
|
+
"ignore": "7.0.14",
|
|
36
|
+
"semver": "7.8.6",
|
|
37
37
|
"typescript": "6.0.3",
|
|
38
|
-
"vscode-jsonrpc": "
|
|
39
|
-
"vscode-languageserver-protocol": "
|
|
40
|
-
"vscode-languageserver-types": "
|
|
41
|
-
"@mrclrchtr/supi-code-runtime": "
|
|
42
|
-
"@mrclrchtr/supi-core": "
|
|
38
|
+
"vscode-jsonrpc": "10.0.0",
|
|
39
|
+
"vscode-languageserver-protocol": "3.18.5",
|
|
40
|
+
"vscode-languageserver-types": "3.18.5",
|
|
41
|
+
"@mrclrchtr/supi-code-runtime": "14.0.0",
|
|
42
|
+
"@mrclrchtr/supi-core": "14.0.0"
|
|
43
43
|
},
|
|
44
44
|
"bundledDependencies": [
|
|
45
45
|
"@mrclrchtr/supi-code-runtime",
|
|
@@ -5,9 +5,14 @@ import {
|
|
|
5
5
|
isTentativePushEntry,
|
|
6
6
|
isValidPublishDiagnosticsParams,
|
|
7
7
|
} from "./client-diagnostic-evidence.ts";
|
|
8
|
+
import { type DiskStamp, sameDiskStamp } from "./client-disk-stamp.ts";
|
|
8
9
|
import type { ClientDiagnosticSnapshot, OpenDocumentState } from "./client-document-state.ts";
|
|
9
10
|
import { hasCurrentDiagnosticEvidence } from "./client-document-state.ts";
|
|
10
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
type DiagnosticFileState,
|
|
13
|
+
type DiagnosticFileStatus,
|
|
14
|
+
getDiagnosticFileStatus,
|
|
15
|
+
} from "./client-file-state.ts";
|
|
11
16
|
|
|
12
17
|
interface ApplyPushOptions {
|
|
13
18
|
store: Map<string, DiagnosticCacheEntry>;
|
|
@@ -119,15 +124,39 @@ function buildPushCacheEntry(
|
|
|
119
124
|
};
|
|
120
125
|
}
|
|
121
126
|
|
|
122
|
-
/**
|
|
123
|
-
export
|
|
127
|
+
/** Options for one client diagnostic snapshot. */
|
|
128
|
+
export interface BuildClientDiagnosticSnapshotOptions {
|
|
124
129
|
store: ReadonlyMap<string, DiagnosticCacheEntry>;
|
|
125
130
|
openDocuments: ReadonlyMap<string, OpenDocumentState>;
|
|
126
131
|
failedDocuments: ReadonlySet<string>;
|
|
127
132
|
evidenceRevision: number;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
133
|
+
/** Stamp of the last verified disk read for one URI, when one exists. */
|
|
134
|
+
observedDiskStamp?: (uri: string) => DiskStamp | undefined;
|
|
135
|
+
/** File-status seam; defaults to one stat per URI. */
|
|
136
|
+
readFileStatus?: (filePath: string) => DiagnosticFileStatus;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** Per-URI disk facts shared by every projection of one snapshot. */
|
|
140
|
+
interface SnapshotFileFacts {
|
|
141
|
+
readonly state: DiagnosticFileState;
|
|
142
|
+
/** The file's disk stamp differs from the last verified read. */
|
|
143
|
+
readonly diskChanged: boolean;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Build one client snapshot without dropping empty-cache freshness.
|
|
148
|
+
*
|
|
149
|
+
* Passive and side-effect free: one stat per URI, no synchronization, request,
|
|
150
|
+
* or enrollment. A document whose disk stamp differs from its last verified
|
|
151
|
+
* read is reported unconfirmed with reason `disk-changed`. Metadata can only
|
|
152
|
+
* withdraw confirmation; a later content read restores it.
|
|
153
|
+
*/
|
|
154
|
+
export function buildClientDiagnosticSnapshot(
|
|
155
|
+
options: BuildClientDiagnosticSnapshotOptions,
|
|
156
|
+
): ClientDiagnosticSnapshot {
|
|
157
|
+
const facts = createFileFactsReader(options);
|
|
158
|
+
const documents = collectDocumentFreshness(options, facts);
|
|
159
|
+
const cache = collectCachedDiagnostics(options, facts);
|
|
131
160
|
return {
|
|
132
161
|
entries: cache.entries,
|
|
133
162
|
documents,
|
|
@@ -135,42 +164,65 @@ export function buildClientDiagnosticSnapshot(options: {
|
|
|
135
164
|
};
|
|
136
165
|
}
|
|
137
166
|
|
|
138
|
-
function
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
167
|
+
function createFileFactsReader(
|
|
168
|
+
options: BuildClientDiagnosticSnapshotOptions,
|
|
169
|
+
): (uri: string) => SnapshotFileFacts {
|
|
170
|
+
const readFileStatus = options.readFileStatus ?? getDiagnosticFileStatus;
|
|
171
|
+
const cache = new Map<string, SnapshotFileFacts>();
|
|
172
|
+
return (uri) => {
|
|
173
|
+
const cached = cache.get(uri);
|
|
174
|
+
if (cached) return cached;
|
|
175
|
+
const status = readFileStatus(uriToFile(uri));
|
|
176
|
+
const observed = options.observedDiskStamp?.(uri);
|
|
177
|
+
const facts = {
|
|
178
|
+
state: status.state,
|
|
179
|
+
diskChanged:
|
|
180
|
+
status.state === "present" &&
|
|
181
|
+
observed !== undefined &&
|
|
182
|
+
(status.stamp === undefined || !sameDiskStamp(observed, status.stamp)),
|
|
183
|
+
};
|
|
184
|
+
cache.set(uri, facts);
|
|
185
|
+
return facts;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function collectDocumentFreshness(
|
|
190
|
+
options: BuildClientDiagnosticSnapshotOptions,
|
|
191
|
+
facts: (uri: string) => SnapshotFileFacts,
|
|
192
|
+
): ClientDiagnosticSnapshot["documents"] {
|
|
193
|
+
const open = collectOpenDocumentFreshness(options, facts);
|
|
145
194
|
return [
|
|
146
195
|
...open.documents,
|
|
147
|
-
...collectFailedDocumentFreshness(options.failedDocuments, open.uris),
|
|
148
|
-
...collectUntrackedCacheFreshness(options.store, open.uris, options.failedDocuments),
|
|
196
|
+
...collectFailedDocumentFreshness(options.failedDocuments, open.uris, facts),
|
|
197
|
+
...collectUntrackedCacheFreshness(options.store, open.uris, options.failedDocuments, facts),
|
|
149
198
|
];
|
|
150
199
|
}
|
|
151
200
|
|
|
152
|
-
function collectOpenDocumentFreshness(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
evidenceRevision: number;
|
|
157
|
-
}): { documents: ClientDiagnosticSnapshot["documents"]; uris: ReadonlySet<string> } {
|
|
201
|
+
function collectOpenDocumentFreshness(
|
|
202
|
+
options: BuildClientDiagnosticSnapshotOptions,
|
|
203
|
+
facts: (uri: string) => SnapshotFileFacts,
|
|
204
|
+
): { documents: ClientDiagnosticSnapshot["documents"]; uris: ReadonlySet<string> } {
|
|
158
205
|
const documents: ClientDiagnosticSnapshot["documents"] = [];
|
|
159
206
|
const uris = new Set<string>();
|
|
160
207
|
for (const [uri, document] of options.openDocuments) {
|
|
161
208
|
uris.add(uri);
|
|
162
209
|
const entry = options.store.get(uri);
|
|
163
|
-
const fileState =
|
|
210
|
+
const { state: fileState, diskChanged } = facts(uri);
|
|
164
211
|
const current = hasCurrentDiagnosticEvidence(document, entry, options.evidenceRevision);
|
|
165
212
|
const failed = options.failedDocuments.has(uri);
|
|
166
213
|
// A current tentative push maps to unconfirmed, not to a new public
|
|
167
214
|
// status: it matches the synchronization but cannot confirm it yet, so
|
|
168
215
|
// it must not claim current snapshot or document state (issue #351).
|
|
169
216
|
const tentative = current && isTentativePushEntry(entry);
|
|
217
|
+
const status = statusForDocument(fileState, current && !diskChanged, failed, tentative);
|
|
170
218
|
documents.push({
|
|
171
219
|
uri,
|
|
172
|
-
current: fileState === "present" && current && !failed && !tentative,
|
|
173
|
-
status
|
|
220
|
+
current: fileState === "present" && current && !failed && !tentative && !diskChanged,
|
|
221
|
+
status,
|
|
222
|
+
// Name the cause only where it alone withdrew confirmation.
|
|
223
|
+
...(diskChanged && status === "unconfirmed" && current && !tentative
|
|
224
|
+
? { reason: "disk-changed" as const }
|
|
225
|
+
: {}),
|
|
174
226
|
});
|
|
175
227
|
}
|
|
176
228
|
return { documents, uris };
|
|
@@ -179,16 +231,14 @@ function collectOpenDocumentFreshness(options: {
|
|
|
179
231
|
function collectFailedDocumentFreshness(
|
|
180
232
|
failedDocuments: ReadonlySet<string>,
|
|
181
233
|
openUris: ReadonlySet<string>,
|
|
234
|
+
facts: (uri: string) => SnapshotFileFacts,
|
|
182
235
|
): ClientDiagnosticSnapshot["documents"] {
|
|
183
236
|
return Array.from(failedDocuments)
|
|
184
237
|
.filter((uri) => !openUris.has(uri))
|
|
185
238
|
.map((uri) => ({
|
|
186
239
|
uri,
|
|
187
240
|
current: false,
|
|
188
|
-
status:
|
|
189
|
-
getDiagnosticFileState(uriToFile(uri)) === "removed"
|
|
190
|
-
? ("removed" as const)
|
|
191
|
-
: ("failed" as const),
|
|
241
|
+
status: facts(uri).state === "removed" ? ("removed" as const) : ("failed" as const),
|
|
192
242
|
}));
|
|
193
243
|
}
|
|
194
244
|
|
|
@@ -196,23 +246,27 @@ function collectUntrackedCacheFreshness(
|
|
|
196
246
|
store: ReadonlyMap<string, DiagnosticCacheEntry>,
|
|
197
247
|
openUris: ReadonlySet<string>,
|
|
198
248
|
failedDocuments: ReadonlySet<string>,
|
|
249
|
+
facts: (uri: string) => SnapshotFileFacts,
|
|
199
250
|
): ClientDiagnosticSnapshot["documents"] {
|
|
200
251
|
return Array.from(store.keys())
|
|
201
252
|
.filter((uri) => !openUris.has(uri) && !failedDocuments.has(uri))
|
|
202
|
-
.map((uri) =>
|
|
203
|
-
uri
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
? ("
|
|
210
|
-
:
|
|
211
|
-
|
|
253
|
+
.map((uri) => {
|
|
254
|
+
const state = facts(uri).state;
|
|
255
|
+
return {
|
|
256
|
+
uri,
|
|
257
|
+
current: false,
|
|
258
|
+
status:
|
|
259
|
+
state === "removed"
|
|
260
|
+
? ("removed" as const)
|
|
261
|
+
: state === "unreadable"
|
|
262
|
+
? ("failed" as const)
|
|
263
|
+
: ("unconfirmed" as const),
|
|
264
|
+
};
|
|
265
|
+
});
|
|
212
266
|
}
|
|
213
267
|
|
|
214
268
|
function statusForDocument(
|
|
215
|
-
fileState:
|
|
269
|
+
fileState: DiagnosticFileState,
|
|
216
270
|
current: boolean,
|
|
217
271
|
failed: boolean,
|
|
218
272
|
tentative: boolean,
|
|
@@ -223,27 +277,28 @@ function statusForDocument(
|
|
|
223
277
|
return "confirmed";
|
|
224
278
|
}
|
|
225
279
|
|
|
226
|
-
function collectCachedDiagnostics(
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}): {
|
|
280
|
+
function collectCachedDiagnostics(
|
|
281
|
+
options: BuildClientDiagnosticSnapshotOptions,
|
|
282
|
+
facts: (uri: string) => SnapshotFileFacts,
|
|
283
|
+
): {
|
|
231
284
|
entries: ClientDiagnosticSnapshot["entries"];
|
|
232
285
|
current: boolean;
|
|
233
286
|
} {
|
|
234
287
|
const entries: ClientDiagnosticSnapshot["entries"] = [];
|
|
235
288
|
let current = true;
|
|
236
289
|
for (const [uri, entry] of options.store) {
|
|
237
|
-
|
|
290
|
+
const fileFacts = facts(uri);
|
|
291
|
+
if (fileFacts.state === "removed") continue;
|
|
238
292
|
const entryCurrent = hasCurrentDiagnosticEvidence(
|
|
239
293
|
options.openDocuments.get(uri),
|
|
240
294
|
entry,
|
|
241
295
|
options.evidenceRevision,
|
|
242
296
|
);
|
|
243
297
|
// A current tentative error is useful partial evidence. Keep its entry
|
|
244
|
-
// non-current so it cannot establish a clean or settled result.
|
|
298
|
+
// non-current so it cannot establish a clean or settled result. The same
|
|
299
|
+
// applies to diagnostics of content that changed on disk since.
|
|
245
300
|
const tentative = entryCurrent && isTentativePushEntry(entry);
|
|
246
|
-
const confirmed = entryCurrent && !tentative;
|
|
301
|
+
const confirmed = entryCurrent && !tentative && !fileFacts.diskChanged;
|
|
247
302
|
current &&= confirmed;
|
|
248
303
|
if (entry.diagnostics.length > 0) {
|
|
249
304
|
entries.push({ uri, diagnostics: entry.diagnostics, current: confirmed });
|
|
@@ -15,4 +15,12 @@ export interface ClientDiagnosticsHost {
|
|
|
15
15
|
diagnosticRequestAdapter: DiagnosticRequestAdapter;
|
|
16
16
|
documentSync(): NormalizedDocumentSync;
|
|
17
17
|
sendNotification(method: string, params: unknown): void;
|
|
18
|
+
/**
|
|
19
|
+
* Observe one tracked file whose state was cleared because it no longer exists.
|
|
20
|
+
*
|
|
21
|
+
* Every clear path reports here (passive prune, semantic input barrier, and
|
|
22
|
+
* refresh resynchronization), so the owner can retain the removal until a
|
|
23
|
+
* diagnostic report shows it.
|
|
24
|
+
*/
|
|
25
|
+
onTrackedFileRemoved?(filePath: string): void;
|
|
18
26
|
}
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
} from "@mrclrchtr/supi-code-runtime/api";
|
|
9
9
|
import { fileToUri, uriToFile } from "@mrclrchtr/supi-core/path";
|
|
10
10
|
import type { TextDocumentIdentifier } from "../config/types.ts";
|
|
11
|
+
import type { RequestTimingBatch } from "../debug-telemetry.ts";
|
|
11
12
|
import {
|
|
12
13
|
type DiagnosticEvidenceSummary,
|
|
13
14
|
summarizeDiagnosticEvidence,
|
|
@@ -29,6 +30,7 @@ import type {
|
|
|
29
30
|
import { isDiagnosticRequestInvalidated } from "./client-diagnostic-request.ts";
|
|
30
31
|
import { DiagnosticObserver, isDiagnosticTimeout } from "./client-diagnostic-timing.ts";
|
|
31
32
|
import type { DiagnosticWaitRegistry } from "./client-diagnostic-waiters.ts";
|
|
33
|
+
import { type DiskStamp, statDiskStampSync } from "./client-disk-stamp.ts";
|
|
32
34
|
import {
|
|
33
35
|
fingerprintDocumentContent,
|
|
34
36
|
hasConfirmedDiagnosticEvidence,
|
|
@@ -238,18 +240,23 @@ function classifyReusableDocuments(options: {
|
|
|
238
240
|
diagnosticStore: ReadonlyMap<string, DiagnosticCacheEntry>;
|
|
239
241
|
evidenceRevision: number;
|
|
240
242
|
failedFiles: ReadonlySet<string>;
|
|
243
|
+
/** Record the pre-read stamp of a document whose content equals the read. */
|
|
244
|
+
recordDiskStamp: (uri: string, content: string, stamp: DiskStamp | undefined) => void;
|
|
241
245
|
}): {
|
|
242
246
|
reusableUris: Set<string>;
|
|
243
247
|
retainedUris: Set<string>;
|
|
244
248
|
preloadedContent: Map<string, string>;
|
|
249
|
+
preloadedStamps: Map<string, DiskStamp>;
|
|
245
250
|
} {
|
|
246
251
|
const reusableUris = new Set<string>();
|
|
247
252
|
const retainedUris = new Set<string>();
|
|
248
253
|
const preloadedContent = new Map<string, string>();
|
|
254
|
+
const preloadedStamps = new Map<string, DiskStamp>();
|
|
249
255
|
for (const [uri, document] of options.openDocuments) {
|
|
250
256
|
const filePath = uriToFile(uri);
|
|
251
257
|
if (options.failedFiles.has(filePath)) continue;
|
|
252
258
|
let content: string;
|
|
259
|
+
const stamp = statDiskStampSync(filePath);
|
|
253
260
|
try {
|
|
254
261
|
content = readFileSync(filePath, "utf-8");
|
|
255
262
|
} catch {
|
|
@@ -258,8 +265,11 @@ function classifyReusableDocuments(options: {
|
|
|
258
265
|
}
|
|
259
266
|
if (fingerprintDocumentContent(content) !== document.contentFingerprint) {
|
|
260
267
|
preloadedContent.set(uri, content);
|
|
268
|
+
if (stamp) preloadedStamps.set(uri, stamp);
|
|
261
269
|
continue;
|
|
262
270
|
}
|
|
271
|
+
// Unchanged content: the read verifies the document, so its stamp is current.
|
|
272
|
+
options.recordDiskStamp(uri, content, stamp);
|
|
263
273
|
if (
|
|
264
274
|
hasConfirmedDiagnosticEvidence(
|
|
265
275
|
document,
|
|
@@ -272,7 +282,7 @@ function classifyReusableDocuments(options: {
|
|
|
272
282
|
retainedUris.add(uri);
|
|
273
283
|
}
|
|
274
284
|
}
|
|
275
|
-
return { reusableUris, retainedUris, preloadedContent };
|
|
285
|
+
return { reusableUris, retainedUris, preloadedContent, preloadedStamps };
|
|
276
286
|
}
|
|
277
287
|
|
|
278
288
|
interface ClientDiagnosticRefreshOptions {
|
|
@@ -290,6 +300,8 @@ interface ClientDiagnosticRefreshOptions {
|
|
|
290
300
|
readonly noteInputContentChange: () => number;
|
|
291
301
|
/** Keep the shared semantic barrier's verified disk observation current. */
|
|
292
302
|
readonly observeDiskContent: (uri: string, content: string) => boolean;
|
|
303
|
+
/** Record a pre-read disk stamp when the document now equals that read. */
|
|
304
|
+
readonly recordDiskStamp: (uri: string, content: string, stamp: DiskStamp | undefined) => void;
|
|
293
305
|
/** Send one save for an externally observed disk change. */
|
|
294
306
|
readonly noteExternalDiskChange: (uri: string, content: string) => void;
|
|
295
307
|
readonly clearFile: (uri: string) => void;
|
|
@@ -303,6 +315,7 @@ interface ClientDiagnosticRefreshOptions {
|
|
|
303
315
|
signal?: AbortSignal;
|
|
304
316
|
deadline?: number;
|
|
305
317
|
operationId?: string;
|
|
318
|
+
requestTimings?: RequestTimingBatch;
|
|
306
319
|
}) => Promise<boolean>;
|
|
307
320
|
readonly options: { maxWaitMs?: number; quietMs?: number } & CodeRequestControl;
|
|
308
321
|
/** Push-publication telemetry surface for this client. */
|
|
@@ -332,6 +345,7 @@ function prepareRefreshDocuments(
|
|
|
332
345
|
diagnosticStore: options.diagnosticStore,
|
|
333
346
|
evidenceRevision,
|
|
334
347
|
failedFiles: options.failedFiles(),
|
|
348
|
+
recordDiskStamp: options.recordDiskStamp,
|
|
335
349
|
});
|
|
336
350
|
const { reusableUris, retainedUris } = classification;
|
|
337
351
|
const documentsToResynchronize = new Map(
|
|
@@ -348,10 +362,12 @@ function prepareRefreshDocuments(
|
|
|
348
362
|
documentSync: options.host.documentSync(),
|
|
349
363
|
noteInputContentChange: options.noteInputContentChange,
|
|
350
364
|
observeDiskContent: options.observeDiskContent,
|
|
365
|
+
recordDiskStamp: options.recordDiskStamp,
|
|
351
366
|
noteExternalDiskChange: options.noteExternalDiskChange,
|
|
352
367
|
sendNotification: (method, params) => options.host.sendNotification(method, params),
|
|
353
368
|
uriToFile,
|
|
354
369
|
preloadedContent: classification.preloadedContent,
|
|
370
|
+
preloadedStamps: classification.preloadedStamps,
|
|
355
371
|
clearFile: options.clearFile,
|
|
356
372
|
invalidateEvidence: options.invalidateEvidence,
|
|
357
373
|
markUnversionedSyncMoment: options.markUnversionedSyncMoment,
|
|
@@ -487,6 +503,7 @@ export async function refreshClientOpenDiagnostics(
|
|
|
487
503
|
synchronizations: requestSynchronizations,
|
|
488
504
|
syncStart,
|
|
489
505
|
maxWaitMs,
|
|
506
|
+
requestTimings: observer.requestTimings,
|
|
490
507
|
});
|
|
491
508
|
failedPullUris = new Set(request.failedPullUris);
|
|
492
509
|
const source = requestSourceFor(options.host, requestSynchronizations);
|
|
@@ -546,6 +563,7 @@ async function collectPullEvidenceForRefresh(options: {
|
|
|
546
563
|
synchronizations: readonly DiagnosticSynchronization[];
|
|
547
564
|
syncStart: number;
|
|
548
565
|
maxWaitMs: number;
|
|
566
|
+
requestTimings: RequestTimingBatch | undefined;
|
|
549
567
|
}): Promise<{ completed: boolean; failedPullUris: ReadonlySet<string>; timedOut: boolean }> {
|
|
550
568
|
const { options: refresh, synchronizations, syncStart, maxWaitMs } = options;
|
|
551
569
|
try {
|
|
@@ -563,6 +581,7 @@ async function collectPullEvidenceForRefresh(options: {
|
|
|
563
581
|
signal: pullOptions.signal,
|
|
564
582
|
deadline: pullOptions.deadline,
|
|
565
583
|
operationId: pullOptions.operationId,
|
|
584
|
+
requestTimings: options.requestTimings,
|
|
566
585
|
}),
|
|
567
586
|
});
|
|
568
587
|
const failedPullUris = new Set(result.failedUris);
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
throwIfCodeRequestInterrupted,
|
|
4
4
|
} from "@mrclrchtr/supi-code-runtime/api";
|
|
5
5
|
import type { DocumentDiagnosticReport } from "../config/types.ts";
|
|
6
|
+
import type { RequestTimingBatch } from "../debug-telemetry.ts";
|
|
6
7
|
import { raceRequestControl } from "../session/readiness.ts";
|
|
7
8
|
|
|
8
9
|
/** Evidence source used by an explicit diagnostic request. */
|
|
@@ -30,6 +31,8 @@ export interface DiagnosticPullRequest {
|
|
|
30
31
|
/** Adapter cancellation stops adapter work, not the owned transport. */
|
|
31
32
|
readonly signal?: AbortSignal;
|
|
32
33
|
readonly operationId?: string;
|
|
34
|
+
/** Batch that collects this request's completed protocol timings. */
|
|
35
|
+
readonly requestTimings?: RequestTimingBatch;
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
/** Result returned by one request adapter. */
|
|
@@ -196,7 +199,7 @@ export class DiagnosticRequestScheduler {
|
|
|
196
199
|
return;
|
|
197
200
|
}
|
|
198
201
|
execution.result.then(job.resolve, job.reject).catch(() => {});
|
|
199
|
-
execution.settled
|
|
202
|
+
void execution.settled
|
|
200
203
|
.catch(() => {})
|
|
201
204
|
.then(() => {
|
|
202
205
|
if (this.#active !== job) return;
|