@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [14.0.0]
|
|
4
|
+
|
|
5
|
+
- The LSP footer moved to the right side of the footer path line and is shorter: `λ 3✓ 1⟳ ◫43` instead of `λ lsp • 3 ✓ • 1 ⟳ • 43 open files`. Route counts are colored by severity (`✓` success, `⟳` accent, `↻` and `⊘` warning, `✗` error). The file count covers files synchronized to a language server, not files open in an editor; it uses `◫`, the Nerd Font file-with-eye outline (U+F0DCB), or `f` depending on the footer `icons` setting, and ASCII mode writes `lsp 3ok`. When LSP startup fails, the footer shows `λ ✗ config` for a configuration error and `λ ✗ unavailable` otherwise, instead of disappearing. Pi's built-in footer and other custom footers now show the LSP status too, on their extension status line. The footer renders the last published runtime state instead of re-querying every route on each render, and a route whose server command is missing or fails to start shows up without waiting for another state change.
|
|
6
|
+
- Symbol queries on TypeScript workspaces with several projects no longer return a short candidate list as complete. The language server searches only projects it has loaded, and the first query stopped after loading one. A query for `toolDescription` could list 13 of 26 declarations, and a name declared in two projects could be selected automatically from the one that was loaded. Every project root (up to 96) is now loaded before a symbol result is reported complete; roots past that limit are reported as a coverage limit ([#615](https://github.com/mrclrchtr/supi/issues/615)). Loading starts in the background when the TypeScript server is ready and takes a few seconds once per session. A symbol query that arrives earlier waits for it. While it runs, the LSP footer counts the TypeScript route under `⟳` instead of `✓`, and `code_health` and the `/supi-ci-status` inspector show it as `loading projects`; structured `code_health` servers carry `loadingProjects: true`. The opened files (one per project root) count as tracked files in `code_health` from then on, also in sessions that never run a symbol query ([#618](https://github.com/mrclrchtr/supi/issues/618)).
|
|
7
|
+
- `code_graph` references on a native TypeScript workspace no longer miss a test project whose first file in directory order is one the project excludes, such as `__tests__/fixtures/server.mjs`. Project warm-up opened only that file, which does not keep the project loaded, so references to `limitWorkspaceSymbolWarmRoots` came back provider-limited with `packages/supi-lsp/__tests__/tsconfig.json` is not loaded, and symbol queries could miss names declared only in that project. Warm-up now opens the project's next file and records the skipped one as a `workspace-symbol.warm-probe` debug event with outcome `excluded`. A project that includes the queried file but has no file of its own, such as a `__tests__/tsconfig.json` without tests, is no longer reported as not loaded: there was no file to open, so the advice could not be followed ([#616](https://github.com/mrclrchtr/supi/issues/616)).
|
|
8
|
+
- Several `code_*` calls in one parallel block no longer fail with `No routed LSP client could complete …` when together they open more than 32 new files, for example long candidate lists. Up to 1,024 first opens may now wait per language server. If that limit is reached, the result names the cause (`LSP could not open <file> for references: LSP input admission queue is full.`) instead of reporting a missing route.
|
|
9
|
+
- Two new LSP debug events are kept in the session file: `document.open-failed` (warning) names the server, file, and reason when a language server could not open a file, and `workspace-symbol.warm-pass` (info) summarizes one project warm-up pass with root counts and duration. Before, a failed open left no trace, and the per-file warm-up probes were `debug` events that high-volume request timings pushed out of the buffer.
|
|
10
|
+
- LSP batch operations no longer record one `request.timing` debug event per completed request. A diagnostic refresh over every open document and a project warm-up pass now report their completed requests on their own event (`diagnostics.timing` `refresh-open`, `workspace-symbol.warm-pass`) as `requests`, keyed by method with `count`, `totalMs`, and `maxMs`. Before, one refresh over 46 open documents recorded 46 near-identical timings and filled most of the 100-event debug buffer. Failed, timed-out, and cancelled requests are still recorded individually ([#619](https://github.com/mrclrchtr/supi/issues/619)).
|
|
11
|
+
- A project warm-up pass records far fewer debug events. It publishes one `runtime.transition` for all files it opened instead of one per file, and records a `workspace-symbol.warm-probe` event only for a file that did not load its project (`open-failed`, `probe-unavailable`, `inferred`); loaded projects are counted in `workspace-symbol.warm-pass`. Before, one pass over 46 projects recorded about 90 such events. The LSP footer therefore updates its open-file count less often during the pass ([#619](https://github.com/mrclrchtr/supi/issues/619)).
|
|
12
|
+
- A TypeScript symbol result at the native server's limit of 256 rows is reported as provider-limited instead of complete, so a target is not selected automatically from a truncated list. The limit is not applied to typescript-language-server (tsserver), which returns every match. The native server sorts exact names first and cuts afterwards, so a cut answer whose last row has another name still holds every declaration of the queried name. Such a result selects the only declaration of that name, with a note that partial-name matches may be missing: `code_resolve` for `git` scoped to `packages/supi-extras/src` resolves `footer-git-status.ts:102` instead of listing six candidates. Otherwise, when the query already has a scope, the note points to an anchor target (file, line, character) instead of suggesting a scope. If no row of a cut answer lies in the scope, the `code_resolve` failure no longer appends the readiness next steps, whose `target.file` advice led back to the same query ([#617](https://github.com/mrclrchtr/supi/issues/617), [#622](https://github.com/mrclrchtr/supi/issues/622)).
|
|
13
|
+
- A candidate list that is incomplete (for example provider-limited) ends with `Choose one candidate handle.` instead of also suggesting to narrow with `scope` or `symbolKind`. The list's own note names the step that applies, and the generic advice could contradict it ([#617](https://github.com/mrclrchtr/supi/issues/617)).
|
|
14
|
+
- A semantic `code_find` result that may be incomplete now states why: `more may exist — provider-limited; <reason>`, the same wording `code_resolve` uses. Before, it showed only `provider-limited`. The separate line about results excluded by the automatic path policy is omitted in that case, because the reason already contains it.
|
|
15
|
+
- Several reasons for an incomplete symbol result are no longer joined as `.;`. A reason that ends a sentence is followed by a space.
|
|
16
|
+
- Directory `code_orientation` in managed child sessions (Agent Runs and Reviewer Sessions) no longer repeats an instruction file the session already has: one loaded into its system prompt, or one it read in full with `read`. After a compaction the files are delivered again. The parent session already behaved this way ([#612](https://github.com/mrclrchtr/supi/issues/612)).
|
|
17
|
+
- Directory `code_orientation` names the instruction files it does not repeat: `Instruction files already supplied in this session, not repeated: …`. Before, the missing `## Instructions` section could not be told apart from a discovery failure. The workspace-root file is not listed, because nearly every session already has it.
|
|
18
|
+
- The note about results excluded by the automatic path policy is shorter: it names at most two example paths, and a path is written once unless the observed and canonical forms differ. Structured output still lists every collected example.
|
|
19
|
+
- Symbol targets in `code_resolve`, `code_graph`, and `code_orientation` select the only case-sensitive exact-name match instead of listing partial-name matches as candidates. A query for `registerSettings` no longer returns `# Multiple targets match` because `registerLspSettings` also exists; the result carries a note naming the matches that were not selected. An exact-name match that only imports or re-exports the name, such as the `alias` symbol TypeScript 6 and earlier report for `export { foo } from "./foo"`, no longer counts as a second declaration. Several declarations of one name still list candidates, now without the partial-name matches, which a note names instead. Incomplete provider results list every match.
|
|
20
|
+
|
|
21
|
+
## [13.0.0]
|
|
22
|
+
|
|
23
|
+
- **Breaking:** every `code_*` evidence list in structured details now carries `completeness`: `complete`, `capped`, `partial`, or `unbounded`. Scripts can read it directly instead of inferring completeness from a null `totalCount`. `code_orientation` source lists and context definitions replace `collectedCount`/`omittedCount` with one `evidence` list. Expanded TUI sections report rows hidden by the 20-row view separately (for example `25 of 30; 5 omitted; 5 rows hidden in view`), instead of adding them to the evidence omission count. Structured TUI chrome from sessions saved before this change falls back to the markdown output on resume.
|
|
24
|
+
- `code_graph`, `code_resolve`, and `code_orientation` report ambiguous targets and symbol-kind mismatches the same way: a `# Multiple targets match` or ``# No target matched provider kind `X` `` heading, one handle-first row per candidate with its container (``- `handle` — **name** (`kind`) in `Container` at `file`:line:col``), and a closing recovery sentence. All three set `details.status` to `disambiguation`, so the TUI shows "Choose a target". Previously `code_graph` reported a kind mismatch as invalid input, and `code_orientation` reported both cases as completed. Structured output schemas are unchanged.
|
|
25
|
+
- Workspace Overview and workspace/directory `code_orientation` now list Maven projects from `pom.xml` (model versions 4.0.0 and 4.1.0) as `maven-project`, identified by `project.artifactId`, and show `modules`/`subprojects` aggregation as `maven-modules` memberships. Parent inheritance is never treated as membership. The POM is read statically: Maven is not run, and properties, parents, and profiles are not resolved. Interpolated, profile-scoped, out-of-root, and unmatched module paths are reported as limitations ([#534](https://github.com/mrclrchtr/supi/issues/534)).
|
|
26
|
+
- Workspace Overview and workspace/directory `code_orientation` now list CMake projects (`cmake-project`) from `CMakeLists.txt` files that contain exactly one top-level `project()` call with a literal name. Repeated calls, calls inside conditions, functions, or macros, and variable-based names are disclosed instead of guessed. Targets and `add_subdirectory()` are not reported, and CMake is never run ([#535](https://github.com/mrclrchtr/supi/issues/535)).
|
|
27
|
+
- `code_health` no longer reports a clean result when no source diagnostics were checked. With zero requested files it says `No source diagnostics checked (0 tracked files).` and suggests an exact-file `refresh: true` check or the project's own typecheck. A clean result now names the confirmed file count and scope, and a snapshot with removed files is reported as incomplete. Removed files also make the diagnostic observation `partial` instead of `completed`, with a limitation that names them and suggests another `refresh: true` run, so `kind: "completed"` never appears beside `coverage: "incomplete"` ([#602](https://github.com/mrclrchtr/supi/issues/602)). A tracked-file snapshot read without `refresh: true` notes that it reflects the last LSP synchronization and may miss edits made outside Pi. Structured output adds `diagnostics.coverage` (`unavailable`, `none`, `incomplete`, or `confirmed`), using the same classification as the `/supi-ci-status` inspector ([#465](https://github.com/mrclrchtr/supi/issues/465)).
|
|
28
|
+
- `code_health` now reports a deleted tracked file as `removed` regardless of when the deletion happened. Previously the removal was lost if a passive read or a server-requested background diagnostic refresh ran first, typically within about half a second, and the next `refresh: true` call reported a clean result. A passive call (without `refresh`) also shows the removal but keeps it, and the next `refresh: true` call reports it once. Recreated files are no longer reported as removed ([#606](https://github.com/mrclrchtr/supi/issues/606)).
|
|
29
|
+
- A passive `code_health` tracked-file snapshot (without `refresh: true`) no longer reports a file as `confirmed` after it changed on disk outside Pi, for example through bash, an editor, or git. The snapshot compares each file's disk metadata with its last diagnosed read; a changed file is `unconfirmed`, the observation is `partial`, and the limitation names the file and suggests `refresh: true`. Its earlier diagnostics stay listed as possibly stale. A refresh or any later semantic request re-reads the file and restores `confirmed`, without a document change when only the metadata changed. Structured evidence documents add an optional `reason: "disk-changed"`. Edits that affect other files through imports are still not detected passively ([#599](https://github.com/mrclrchtr/supi/issues/599)).
|
|
30
|
+
- The collapsed `code_health` line no longer emits an empty styled span after section counts, so `tui_render` `marked` output reads `[success][bold]3[/bold][/success]` without a trailing `[muted][/muted]`.
|
|
31
|
+
- Truncation wording is the same in markdown, candidate lists, graph summaries, and TUI headers. For example, provider-limited candidate searches now read `1 candidate; 1 collected omitted; more may exist — provider-limited; <reason>` instead of a separate "Search completeness is unknown" sentence.
|
|
32
|
+
- `code_orientation` snapshots and truncated `code_*` output files are now written to one private per-user directory, `$TMPDIR/supi-<uid>/`, instead of a new `supi-*` directory per call. Identical content reuses one file, so repeated Workspace Overviews of an unchanged workspace share one snapshot; captures no longer record the per-call collection deadline. SuPi never deletes these files; the OS temp purge does ([#597](https://github.com/mrclrchtr/supi/issues/597)).
|
|
33
|
+
- Symbol name anchors from document symbols are computed against the text synchronized to the language server instead of the file on disk, so `code_resolve` and file outlines no longer point at the wrong column after unsaved or concurrent edits ([#594](https://github.com/mrclrchtr/supi/issues/594)).
|
|
34
|
+
- `code_graph` no longer drops TUI sections and evidence lines when a provider-limited relation list also excluded invalid provider locations.
|
|
35
|
+
- Starting Code Intelligence is about 100 ms faster: the TypeScript compiler API is loaded only when a tsconfig question is asked.
|
|
36
|
+
- `code_*` tool schemas are shorter (repeated position and default descriptions removed), so every request sends less prompt text. Call shapes and validation are unchanged.
|
|
37
|
+
|
|
3
38
|
## [12.0.0]
|
|
4
39
|
|
|
5
40
|
- **Breaking:** `code_find` takes one `search` selector instead of flat `query`, `mode`, and `kind`: `search: { ast: { kind, query } }` or `search: { semantic: { query } }`. A semantic search can no longer carry an AST kind. `scope` is renamed to `scopes`, because it takes a list; `code_resolve` and `code_health` keep the single-path `scope`. Migration: `{ query, mode: "ast", kind, scope }` becomes `{ search: { ast: { kind, query } }, scopes }`.
|
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ code_health({ scope: "packages/api/src/index.ts", refresh: true })
|
|
|
76
76
|
|
|
77
77
|
Important tool rules:
|
|
78
78
|
|
|
79
|
-
- **Resolve:** new target handles require semantic readiness. A comment or whitespace point is not a symbol; use `code_inspect` there. Handles are session-local and become stale when file contents change. Resolve the symbol again rather than reuse a stale handle.
|
|
79
|
+
- **Resolve:** new target handles require semantic readiness. A comment or whitespace point is not a symbol; use `code_inspect` there. Handles are session-local and become stale when file contents change. Resolve the symbol again rather than reuse a stale handle. A symbol query selects the only case-sensitive exact-name match, even beside partial-name matches such as `fooBar` for `foo`, and names those in a note. Exact-name matches inside an import statement or export list are bindings, not declarations, and do not count. With several declarations of one name it lists only those as candidates and names the other matches in a note. An incomplete provider result lists every match, exact names first, before the display cap. Provider order stays unchanged within exact-name and other matches. An incomplete provider result never selects a target automatically.
|
|
80
80
|
- **Graph:** relations are `references` (default), `callees`, and `implements`. Use `["all"]` for all three. Callee depth is `direct` by default; `deep` includes nested scopes, not transitive calls. Callees match source shape, not symbol identity. Counts include each distinct call site; repeated expressions share one agent-output row with all shown line/column coordinates. Each relation reports its counts and limits once. Relation status describes evidence collection, not display size: a fully collected relation remains `complete` when `maxResults` hides sites; `shownCount`, `totalCount`, and `omittedCount` disclose that cap. Actual evidence gaps remain `partial`, and unavailable capabilities remain `unavailable`. Capped references select one site per file per round in stable file/source order, then display the selected sites grouped by file; `maxResults` still counts individual references, not files. This distributes the available slots without ranking semantic importance or promising that every file is represented. Provider-limited results have unknown totals; invalid locations are disclosed separately. Callee previews shorten receiver argument lists from syntax without changing grouping by the full expression. Matching previews get local expression numbers so distinct source expressions remain clear. Unavailable references and implementations keep the provider reason. If no provider exists, the result names that gap. Unavailable callees keep the provider reason and a source-inspection next step. Ambiguous targets ask for candidate selection, not input correction. Candidate limits retain exact totals, or unknown totals when the provider returns partial data. Agent output and both transcript views disclose omissions. Only shown candidates receive target handles. The human transcript shows the resolved target and per-relation evidence types and status. The expanded view groups up to 20 sites per relation by file, without a duplicate Markdown body. If this display limit hides returned sites, the transcript links to a temporary file with all returned evidence. This file does not include evidence beyond `maxResults`, and its path does not add text to an otherwise complete agent result. Reference read-next suggestions use selected sites and prefer different files not already covered by the target recommendation. Merged read ranges use neutral guidance.
|
|
81
81
|
- **Find:** AST mode requires `kind`: `definition`, `import`, `export`, `call`, `type`, `interface`, `class`, `method`, or `enum`. Semantic mode does not accept `kind`. A supplied `scope` is a non-empty array.
|
|
82
82
|
- **Health:** `include` accepts `diagnostics` and `servers` (both by default); `level` is `summary` (default) or `detailed`. Server inventory and route counts remain workspace-wide, even with a diagnostic scope. A diagnostic snapshot does not prove that the whole workspace is clean. Tsconfig and jsconfig coverage applies only to TypeScript and JavaScript-family files; other-language files have no `Tsconfig` label.
|
|
@@ -134,8 +134,10 @@ Automatic collection stays within the session working directory. Ancestor Git ro
|
|
|
134
134
|
- Git inventories contain tracked and non-ignored untracked files. Tracked files remain eligible when ignore rules match them. Configured exclusions still apply.
|
|
135
135
|
- Without Git, collection uses accessible files and configured exclusions. Directory names do not determine project roles or generated-file status.
|
|
136
136
|
- Symbolic links are recorded, not followed. An explicit ignored or excluded directory can be observed separately. This does not change automatic inclusion elsewhere.
|
|
137
|
-
- Metadata readers cover Node `package.json` and workspace declarations, Python `[project]` in `pyproject.toml`, Rust `Cargo.toml`,
|
|
138
|
-
-
|
|
137
|
+
- Metadata readers cover Node `package.json` and workspace declarations, Python `[project]` in `pyproject.toml`, Rust `Cargo.toml`, Go `go.mod` / `go.work`, Maven `pom.xml`, and CMake `project()` in `CMakeLists.txt`. They do not run build tools or project code.
|
|
138
|
+
- Maven `pom.xml` reading is static and supports model versions 4.0.0 and 4.1.0. Identity is the literal `project.artifactId`; groupId/version coordinates, the display `<name>`, dependencies, and plugins are not reported. Aggregation comes only from `project.modules.module` (4.0.0) or `project.subprojects.subproject` (4.1.0), matched as exact paths relative to the aggregator directory; a trailing `pom.xml` names its directory. `<parent>` inheritance never establishes membership. Property interpolation (`${…}`), custom XML entities, profile-scoped modules, out-of-root paths, and unmatched modules are disclosed, not resolved. Parent resolution, profile activation, and Maven 4 implicit subproject discovery are not modeled.
|
|
139
|
+
- A CMake project is reported only for exactly one top-level `project()` call with a literal name; its literal `DESCRIPTION` is kept. Repeated calls, calls inside control blocks, functions, or macros, and names that use variables or generator expressions are disclosed instead of selected. `CMakeLists.txt` files without `project()`, targets, `add_subdirectory()`, included files, presets, and configured build trees are not observed. The CMake File API and configure/build steps are not used.
|
|
140
|
+
- Unsupported, dynamic, inherited, malformed, and unresolved declarations are disclosed. Go replacement directives and unsupported quoted-string escapes are not interpreted. Native project kinds remain separate; nearby Python, Rust, Maven, or CMake projects do not become Node workspace members, and Maven modules match only `pom.xml` projects.
|
|
139
141
|
- Project declaration groups share their observed kind and project-relative identity source. Identical membership declarations share their native kind, source field, and value. List limits and omission counts still apply to individual declarations and memberships, not groups. A membership group refers to listed projects only when their identities match exactly; otherwise it lists member paths.
|
|
140
142
|
- Explicit directory results keep project identity, direct directories/files, the focused project's declared paths (manifest entry points), applicable instructions, and collection problems inline. Without `maxResults`, direct files are listed in full as one compact line, until the navigation budget applies the default cap. Complete ancillary sections (extension counts, nested declarations, memberships, and dependency topology) move to captured details, named in one note. Incomplete ancillary observations remain inline. Root-focused Orientation also keeps project declarations and memberships inline for workspace navigation.
|
|
141
143
|
- Captured directory diagrams retain separate dependency categories and declared values. Unique declared-name matches do not prove installed dependency resolution or runtime architecture.
|
|
@@ -265,7 +267,7 @@ Press `h` (or F6) to **Refresh health**: run the existing workspace-scoped sessi
|
|
|
265
267
|
|
|
266
268
|
Press `r` to reload the passive snapshot, `a` to collapse details, and Escape to close. Opening, rendering, expanding details, and reloading do not enroll files, start or retry routes, or request fresh diagnostics. Only one reload, check, or health action runs at a time; scrolling and details remain usable while the spinner runs. Closing aborts the caller's wait and prevents subsequent snapshot collection or late UI updates; shared LSP work may still settle independently. Scrolling, Tab, confirmation, and cancel actions honor Pi's configured keybindings. Configured actions take priority over `c`/F5 and `h`/F6; the inspector advertises an available shortcut for each action, or marks it unbound. The viewport adjusts to terminal size, with controls kept visible.
|
|
267
269
|
|
|
268
|
-
The inspector does not replace the footer or add editor widgets. The extension's separate LSP footer contribution remains active. Outside the interactive terminal, use `code_health`.
|
|
270
|
+
The inspector does not replace the footer or add editor widgets. The extension's separate LSP footer contribution remains active: `λ 2✓ 1⟳ ◫17` on the right side of the footer path line counts ready routes (`✓`), routes still in progress (`⟳`), and files synchronized to a language server (`◫`; a Nerd Font file icon or `f`, depending on the footer `icons` setting). Recovering (`↻`), failed (`✗`), and unavailable (`⊘`) routes appear in warning or error colors, and a failed LSP startup shows `λ ✗ config` or `λ ✗ unavailable`. Without the SuPi footer, Pi's extension status line shows the same text. A route is in progress while its server starts or indexes, and while the TypeScript project warm-up after startup loads its projects; during the warm-up the route answers queries, and only symbol queries wait. The inspector and `code_health` name that state `loading projects`. Outside the interactive terminal, use `code_health`.
|
|
269
271
|
|
|
270
272
|
The package registers **Code Intelligence** and **LSP** settings. If `@mrclrchtr/supi-settings` is installed, use `/supi-settings` to edit them. A standalone Code Intelligence install does not include that settings UI.
|
|
271
273
|
|
|
@@ -342,7 +344,7 @@ Tool results and the hidden overview enter Pi's model context and can be saved i
|
|
|
342
344
|
|
|
343
345
|
The package-root export also re-exports types; prefer `/api`. See [the type exports](src/api.ts) for the complete list.
|
|
344
346
|
|
|
345
|
-
The headless factory registers only `code_resolve`, `code_inspect`, `code_orientation`, `code_graph`, `code_find`, and `code_health` for managed child sessions. It adds no refactor tools, settings, commands, UI, or overview. It is a tool profile, not a filesystem sandbox.
|
|
347
|
+
The headless factory registers only `code_resolve`, `code_inspect`, `code_orientation`, `code_graph`, `code_find`, and `code_health` for managed child sessions. It adds no refactor tools, settings, commands, UI, or overview. Directory orientation skips instruction files the child session already has, by the same rules as the full extension. It is a tool profile, not a filesystem sandbox.
|
|
346
348
|
|
|
347
349
|
## See it in action
|
|
348
350
|
|
|
@@ -14,6 +14,16 @@ export interface CodeQueryPartialMetadata {
|
|
|
14
14
|
* answer.
|
|
15
15
|
*/
|
|
16
16
|
readonly exclusionOnly?: boolean;
|
|
17
|
+
/** A provider cut its answer at a row limit; a narrower scope cannot avoid it. */
|
|
18
|
+
readonly rowLimit?: {
|
|
19
|
+
/**
|
|
20
|
+
* True when every declaration whose name equals the query is still in the
|
|
21
|
+
* result, though partial-name matches may be missing: the provider sorted
|
|
22
|
+
* exact names first. Set only when no provider failed and no coverage gap
|
|
23
|
+
* was observed, so exact-name selection stays sound.
|
|
24
|
+
*/
|
|
25
|
+
readonly exactNamesComplete: boolean;
|
|
26
|
+
};
|
|
17
27
|
}
|
|
18
28
|
|
|
19
29
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrclrchtr/supi-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.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",
|
|
@@ -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
|
|
@@ -16,8 +16,17 @@ export interface DebugRegistryConfig {
|
|
|
16
16
|
agentAccess: DebugAgentAccess;
|
|
17
17
|
/** Whether Agent Run retrospective capture is explicitly enabled. */
|
|
18
18
|
agentRunRetrospectivesEnabled: boolean;
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Maximum number of session-local events to keep in memory. `debug` events
|
|
21
|
+
* are evicted first; higher levels keep at most half of the buffer.
|
|
22
|
+
*/
|
|
20
23
|
maxEvents: number;
|
|
24
|
+
/**
|
|
25
|
+
* Minimum level forwarded to persistence sinks. Lower-level events stay in the
|
|
26
|
+
* live retained buffer only, so high-volume `debug` telemetry does not grow
|
|
27
|
+
* session files.
|
|
28
|
+
*/
|
|
29
|
+
persistLevel: DebugLevel;
|
|
21
30
|
}
|
|
22
31
|
|
|
23
32
|
export const DEBUG_REGISTRY_DEFAULTS: DebugRegistryConfig = {
|
|
@@ -25,8 +34,11 @@ export const DEBUG_REGISTRY_DEFAULTS: DebugRegistryConfig = {
|
|
|
25
34
|
agentAccess: "sanitized",
|
|
26
35
|
agentRunRetrospectivesEnabled: false,
|
|
27
36
|
maxEvents: 100,
|
|
37
|
+
persistLevel: "info",
|
|
28
38
|
};
|
|
29
39
|
|
|
40
|
+
const DEBUG_LEVEL_RANK: Record<DebugLevel, number> = { debug: 0, info: 1, warning: 2, error: 3 };
|
|
41
|
+
|
|
30
42
|
export interface DebugEventInput {
|
|
31
43
|
/** Opaque identity for events directly owned by one public Tool call. */
|
|
32
44
|
operationId?: string;
|
|
@@ -137,12 +149,51 @@ function normalizeMaxEvents(value: number): number {
|
|
|
137
149
|
return Math.floor(value);
|
|
138
150
|
}
|
|
139
151
|
|
|
152
|
+
function isSummary(event: DebugEvent): boolean {
|
|
153
|
+
return event.level !== "debug";
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function groupKey(event: DebugEvent): string {
|
|
157
|
+
return `${event.source}\u0000${event.category}`;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Return the index of the oldest event in the largest source/category group of
|
|
162
|
+
* one tier, so a high-volume category evicts its own events before rare ones.
|
|
163
|
+
*/
|
|
164
|
+
function evictionIndex(events: readonly DebugEvent[], summaryTier: boolean): number {
|
|
165
|
+
const counts = new Map<string, number>();
|
|
166
|
+
let largest = 0;
|
|
167
|
+
for (const event of events) {
|
|
168
|
+
if (isSummary(event) !== summaryTier) continue;
|
|
169
|
+
const key = groupKey(event);
|
|
170
|
+
const count = (counts.get(key) ?? 0) + 1;
|
|
171
|
+
counts.set(key, count);
|
|
172
|
+
largest = Math.max(largest, count);
|
|
173
|
+
}
|
|
174
|
+
return events.findIndex(
|
|
175
|
+
(event) => isSummary(event) === summaryTier && counts.get(groupKey(event)) === largest,
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Evict down to `maxEvents`. A `debug` event goes first, so high-volume
|
|
181
|
+
* timings cannot push out a summary recorded moments earlier. Higher-level
|
|
182
|
+
* events keep at most half the buffer; past that one of them goes instead, so
|
|
183
|
+
* recent `debug` events stay visible too. Within the chosen tier, the oldest
|
|
184
|
+
* event of the largest source/category group goes, so one flooding category
|
|
185
|
+
* such as `request.timing` cannot push out every other category.
|
|
186
|
+
*/
|
|
140
187
|
function trimToMaxEvents(state: DebugRegistryState): void {
|
|
141
188
|
const maxEvents = normalizeMaxEvents(state.config.maxEvents);
|
|
142
|
-
|
|
143
|
-
|
|
189
|
+
const summaryShare = Math.floor(maxEvents / 2);
|
|
190
|
+
let summaries = state.events.filter(isSummary).length;
|
|
191
|
+
while (state.events.length > maxEvents) {
|
|
192
|
+
const evictSummary = summaries > summaryShare;
|
|
193
|
+
const index = evictionIndex(state.events, evictSummary);
|
|
194
|
+
if (evictSummary) summaries--;
|
|
195
|
+
state.events.splice(Math.max(index, 0), 1);
|
|
144
196
|
}
|
|
145
|
-
state.events.splice(0, state.events.length - maxEvents);
|
|
146
197
|
}
|
|
147
198
|
|
|
148
199
|
/** Return whether a debug level is recognized by the registry. */
|
|
@@ -150,6 +201,10 @@ export function isDebugLevel(value: unknown): value is DebugLevel {
|
|
|
150
201
|
return value === "debug" || value === "info" || value === "warning" || value === "error";
|
|
151
202
|
}
|
|
152
203
|
|
|
204
|
+
function shouldPersist(state: DebugRegistryState, level: DebugLevel): boolean {
|
|
205
|
+
return DEBUG_LEVEL_RANK[level] >= DEBUG_LEVEL_RANK[state.config.persistLevel];
|
|
206
|
+
}
|
|
207
|
+
|
|
153
208
|
/** Return whether a value has the exact 16-byte base64url Debug Operation ID form. */
|
|
154
209
|
export function isDebugOperationId(value: unknown): value is string {
|
|
155
210
|
return typeof value === "string" && DEBUG_OPERATION_ID_RE.test(value);
|
|
@@ -194,6 +249,9 @@ export function configureDebugRegistry(config: Partial<DebugRegistryConfig>): De
|
|
|
194
249
|
...state.config,
|
|
195
250
|
...config,
|
|
196
251
|
maxEvents: normalizeMaxEvents(config.maxEvents ?? state.config.maxEvents),
|
|
252
|
+
persistLevel: isDebugLevel(config.persistLevel)
|
|
253
|
+
? config.persistLevel
|
|
254
|
+
: state.config.persistLevel,
|
|
197
255
|
};
|
|
198
256
|
trimToMaxEvents(state);
|
|
199
257
|
return getDebugRegistryConfig();
|
|
@@ -210,16 +268,22 @@ export function isDebugRegistryEnabled(): boolean {
|
|
|
210
268
|
}
|
|
211
269
|
|
|
212
270
|
/**
|
|
213
|
-
* Return whether
|
|
214
|
-
* must be enabled,
|
|
271
|
+
* Return whether an event at `level` would reach the session file now: Debug
|
|
272
|
+
* must be enabled, at least one persistence sink must be registered, and the
|
|
273
|
+
* persistence threshold must admit the level.
|
|
215
274
|
*/
|
|
216
|
-
export function
|
|
275
|
+
export function canPersistDebugEvent(level: DebugLevel = "info"): boolean {
|
|
217
276
|
const state = getState();
|
|
218
|
-
return (
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
277
|
+
return state.config.enabled && state.persistenceSinks.size > 0 && shouldPersist(state, level);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Return whether a retrospective can be captured: an `info` event must be
|
|
282
|
+
* persistable (see {@link canPersistDebugEvent}) and the explicit Agent Run
|
|
283
|
+
* retrospective opt-in must be enabled.
|
|
284
|
+
*/
|
|
285
|
+
export function canRecordAgentRunRetrospective(): boolean {
|
|
286
|
+
return getState().config.agentRunRetrospectivesEnabled && canPersistDebugEvent("info");
|
|
223
287
|
}
|
|
224
288
|
|
|
225
289
|
/** Best-effort redaction helper for data exposed through sanitized debug views. */
|
|
@@ -283,7 +347,8 @@ export function recordDebugEvent(input: DebugEventInput): DebugEvent | null {
|
|
|
283
347
|
// Debug-event consumers must not alter producer behavior.
|
|
284
348
|
}
|
|
285
349
|
}
|
|
286
|
-
|
|
350
|
+
const sinks = shouldPersist(state, event.level) ? state.persistenceSinks : [];
|
|
351
|
+
for (const sink of sinks) {
|
|
287
352
|
try {
|
|
288
353
|
sink(toSanitizedView(event));
|
|
289
354
|
} catch {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// Shared footer contribution registry for SuPi extensions.
|
|
2
2
|
//
|
|
3
|
-
// Extensions register
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
// alongside the built-in metrics. Extensions can use PI's status API as a
|
|
3
|
+
// Extensions register text chunks with a placement hint. The custom footer in
|
|
4
|
+
// supi-extras reads these contributions and renders them alongside the
|
|
5
|
+
// built-in metrics. Extensions can use PI's status API with the same key as a
|
|
7
6
|
// fallback when the custom footer is not installed.
|
|
8
7
|
|
|
9
8
|
import { createRegistry } from "./registry-utils.ts";
|
|
@@ -11,8 +10,33 @@ import { createRegistry } from "./registry-utils.ts";
|
|
|
11
10
|
/** Event emitted when a dynamic footer contribution needs a new render. */
|
|
12
11
|
export const FOOTER_INVALIDATE_EVENT = "supi:footer:invalidate";
|
|
13
12
|
|
|
14
|
-
/**
|
|
15
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Where the contribution should appear in the footer.
|
|
15
|
+
*
|
|
16
|
+
* - `path-end`: right side of the workspace line (path and Git), for workspace state
|
|
17
|
+
* - `stats`: inside the cache section of the session line
|
|
18
|
+
* - `stats-end`: own sections after context usage on the session line
|
|
19
|
+
* - `model-start`: right side of the session line, before the model name
|
|
20
|
+
* - `status`: extension status line below the footer
|
|
21
|
+
*/
|
|
22
|
+
export type FooterPlacement = "path-end" | "stats" | "stats-end" | "model-start" | "status";
|
|
23
|
+
|
|
24
|
+
/** Icon set selected by the footer `icons` setting. */
|
|
25
|
+
export type FooterGlyphMode = "nerd" | "unicode" | "ascii";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Theme color names accepted by {@link FooterRenderContext.style}.
|
|
29
|
+
* Matches the Pi `ThemeColor` names SuPi contributions use.
|
|
30
|
+
*/
|
|
31
|
+
export type FooterColor = "accent" | "dim" | "muted" | "text" | "success" | "warning" | "error";
|
|
32
|
+
|
|
33
|
+
/** Render inputs supplied by the custom footer. */
|
|
34
|
+
export interface FooterRenderContext {
|
|
35
|
+
/** Apply a theme color. */
|
|
36
|
+
style: (color: FooterColor, text: string) => string;
|
|
37
|
+
/** Resolved icon mode; contributions choose matching glyphs. */
|
|
38
|
+
glyphMode: FooterGlyphMode;
|
|
39
|
+
}
|
|
16
40
|
|
|
17
41
|
/** A single footer contribution registered by an extension. */
|
|
18
42
|
export interface FooterContribution {
|
|
@@ -21,15 +45,18 @@ export interface FooterContribution {
|
|
|
21
45
|
* A same-key Pi status is treated as this contribution's built-in-footer fallback.
|
|
22
46
|
*/
|
|
23
47
|
key: string;
|
|
24
|
-
/** Which footer
|
|
48
|
+
/** Which footer area this belongs to. */
|
|
25
49
|
placement: FooterPlacement;
|
|
26
50
|
/**
|
|
27
51
|
* Sort order within the placement (lower values render further left). Default: 100.
|
|
28
52
|
* Priority 0 is reserved for the turn cache-hit part so it stays adjacent to CH.
|
|
29
53
|
*/
|
|
30
54
|
priority?: number;
|
|
31
|
-
/**
|
|
32
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Return the text for this contribution; empty hides it. Called on every render.
|
|
57
|
+
* Callers without a footer context (for example tests) may omit `ctx`.
|
|
58
|
+
*/
|
|
59
|
+
render: (ctx?: FooterRenderContext) => string;
|
|
33
60
|
}
|
|
34
61
|
|
|
35
62
|
const registry = createRegistry<FooterContribution>("footer-contributions");
|
|
@@ -57,6 +84,11 @@ export const footerContributions = {
|
|
|
57
84
|
.sort(sortByPriority);
|
|
58
85
|
},
|
|
59
86
|
|
|
87
|
+
/** Get every registered contribution regardless of placement. */
|
|
88
|
+
getAll(): FooterContribution[] {
|
|
89
|
+
return registry.getAll();
|
|
90
|
+
},
|
|
91
|
+
|
|
60
92
|
/** Remove all contributions (primarily for tests). */
|
|
61
93
|
clear(): void {
|
|
62
94
|
registry.clear();
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// supi-core retired-packages domain — warn when a retired SuPi package is still declared.
|
|
2
|
+
//
|
|
3
|
+
// Retired packages keep loading after an upgrade until the user removes them, and their
|
|
4
|
+
// surfaces can shadow the package that absorbed them. Detection reads the declared Pi
|
|
5
|
+
// packages per scope, the same view `pi remove` acts on, and never infers identity from paths.
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
ExtensionAPI,
|
|
9
|
+
ExtensionContext,
|
|
10
|
+
PackageSource,
|
|
11
|
+
} from "@earendil-works/pi-coding-agent";
|
|
12
|
+
import { SettingsManager } from "@earendil-works/pi-coding-agent";
|
|
13
|
+
import { recordDebugEvent } from "./debug-registry.ts";
|
|
14
|
+
|
|
15
|
+
/** A retired npm package and the package that now ships its features. */
|
|
16
|
+
export interface RetiredPackage {
|
|
17
|
+
/** npm package name, e.g. `"@mrclrchtr/supi-cache"`. */
|
|
18
|
+
name: string;
|
|
19
|
+
/** npm package name that absorbed it, e.g. `"@mrclrchtr/supi-debug"`. */
|
|
20
|
+
replacement: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Pi settings scope of a package declaration. */
|
|
24
|
+
export type PackageDeclarationScope = "user" | "project";
|
|
25
|
+
|
|
26
|
+
/** One declaration of a retired package found in Pi settings. */
|
|
27
|
+
export interface RetiredPackageDeclaration {
|
|
28
|
+
package: RetiredPackage;
|
|
29
|
+
scope: PackageDeclarationScope;
|
|
30
|
+
/** Exact command that removes this declaration. */
|
|
31
|
+
removeCommand: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Declared Pi packages per scope. Omit `project` when the project is not trusted. */
|
|
35
|
+
export interface DeclaredPackages {
|
|
36
|
+
user: readonly PackageSource[];
|
|
37
|
+
project?: readonly PackageSource[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Options for {@link warnRetiredPackages}. */
|
|
41
|
+
export interface WarnRetiredPackagesOptions {
|
|
42
|
+
/** Debug event source, e.g. `"supi-debug"`. */
|
|
43
|
+
source: string;
|
|
44
|
+
/** Override Pi's agent directory (tests). */
|
|
45
|
+
agentDir?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const WARNED_KEY = Symbol.for("@mrclrchtr/supi-core/retired-packages-warned");
|
|
49
|
+
const NPM_PREFIX = "npm:";
|
|
50
|
+
const NPM_NAME_RE = /^(@[^/\s]+\/[^@\s]+|[^@\s]+)(?:@.+)?$/;
|
|
51
|
+
|
|
52
|
+
/** npm package name of a Pi package source, ignoring version pins; `undefined` for non-npm sources. */
|
|
53
|
+
export function npmPackageName(source: PackageSource): string | undefined {
|
|
54
|
+
const value = (typeof source === "string" ? source : source.source).trim();
|
|
55
|
+
if (!value.startsWith(NPM_PREFIX)) return undefined;
|
|
56
|
+
return NPM_NAME_RE.exec(value.slice(NPM_PREFIX.length).trim())?.[1];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Find declarations of retired packages, project scope first (Pi's load precedence). */
|
|
60
|
+
export function findRetiredPackageDeclarations(
|
|
61
|
+
declared: DeclaredPackages,
|
|
62
|
+
retired: readonly RetiredPackage[],
|
|
63
|
+
): RetiredPackageDeclaration[] {
|
|
64
|
+
const scopes: Array<[PackageDeclarationScope, readonly PackageSource[] | undefined]> = [
|
|
65
|
+
["project", declared.project],
|
|
66
|
+
["user", declared.user],
|
|
67
|
+
];
|
|
68
|
+
const found: RetiredPackageDeclaration[] = [];
|
|
69
|
+
for (const [scope, sources] of scopes) {
|
|
70
|
+
const names = new Set((sources ?? []).map(npmPackageName));
|
|
71
|
+
for (const pkg of retired) {
|
|
72
|
+
if (!names.has(pkg.name)) continue;
|
|
73
|
+
const local = scope === "project" ? " --local" : "";
|
|
74
|
+
found.push({ package: pkg, scope, removeCommand: `pi remove npm:${pkg.name}${local}` });
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return found;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Format one bounded, actionable warning for one retired package. */
|
|
81
|
+
export function formatRetiredPackageWarning(
|
|
82
|
+
pkg: RetiredPackage,
|
|
83
|
+
declarations: readonly RetiredPackageDeclaration[],
|
|
84
|
+
): string {
|
|
85
|
+
const commands = declarations.map((declaration) => ` ${declaration.removeCommand}`);
|
|
86
|
+
return [
|
|
87
|
+
`${pkg.name} is retired; ${pkg.replacement} now ships its features, and the old package can override them. Remove it:`,
|
|
88
|
+
...commands,
|
|
89
|
+
].join("\n");
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function warnedNames(): Set<string> {
|
|
93
|
+
const store = globalThis as Record<symbol, Set<string> | undefined>;
|
|
94
|
+
store[WARNED_KEY] ??= new Set();
|
|
95
|
+
return store[WARNED_KEY];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function readDeclaredPackages(
|
|
99
|
+
ctx: Pick<ExtensionContext, "cwd" | "isProjectTrusted">,
|
|
100
|
+
agentDir: string | undefined,
|
|
101
|
+
): DeclaredPackages {
|
|
102
|
+
const projectTrusted = ctx.isProjectTrusted();
|
|
103
|
+
const settings = SettingsManager.create(ctx.cwd, agentDir, { projectTrusted });
|
|
104
|
+
return {
|
|
105
|
+
user: settings.getGlobalSettings().packages ?? [],
|
|
106
|
+
...(projectTrusted ? { project: settings.getProjectSettings().packages ?? [] } : {}),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Warn once per Pi process for each retired package that is still declared in user or
|
|
112
|
+
* trusted project settings. Shows a UI warning, or writes to stderr without UI, and records
|
|
113
|
+
* a `retired-package` Debug event. Never throws; unreadable settings skip the check.
|
|
114
|
+
*/
|
|
115
|
+
export function warnRetiredPackages(
|
|
116
|
+
pi: ExtensionAPI,
|
|
117
|
+
retired: readonly RetiredPackage[],
|
|
118
|
+
options: WarnRetiredPackagesOptions,
|
|
119
|
+
): void {
|
|
120
|
+
pi.on("session_start", (_event, ctx) => {
|
|
121
|
+
const warned = warnedNames();
|
|
122
|
+
const pending = retired.filter((pkg) => !warned.has(pkg.name));
|
|
123
|
+
if (pending.length === 0) return;
|
|
124
|
+
|
|
125
|
+
let declarations: RetiredPackageDeclaration[];
|
|
126
|
+
try {
|
|
127
|
+
declarations = findRetiredPackageDeclarations(
|
|
128
|
+
readDeclaredPackages(ctx, options.agentDir),
|
|
129
|
+
pending,
|
|
130
|
+
);
|
|
131
|
+
} catch {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
for (const pkg of pending) {
|
|
136
|
+
const matches = declarations.filter((declaration) => declaration.package === pkg);
|
|
137
|
+
if (matches.length === 0) continue;
|
|
138
|
+
warned.add(pkg.name);
|
|
139
|
+
const message = formatRetiredPackageWarning(pkg, matches);
|
|
140
|
+
if (ctx.hasUI) ctx.ui.notify(message, "warning");
|
|
141
|
+
else process.stderr.write(`${message}\n`);
|
|
142
|
+
recordDebugEvent({
|
|
143
|
+
source: options.source,
|
|
144
|
+
level: "warning",
|
|
145
|
+
category: "retired-package",
|
|
146
|
+
message: `${pkg.name} is retired but still declared`,
|
|
147
|
+
cwd: ctx.cwd,
|
|
148
|
+
data: { name: pkg.name, replacement: pkg.replacement, scopes: matches.map((m) => m.scope) },
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
@@ -56,3 +56,6 @@ export {
|
|
|
56
56
|
createSessionNameTracker,
|
|
57
57
|
getActiveBranchEntries,
|
|
58
58
|
} from "./session-utils.ts";
|
|
59
|
+
export { BSD_SED_HINT, BSD_SED_HINT_MARKER, registerShellHints } from "./shell-hints.ts";
|
|
60
|
+
export type { SideRunEvent } from "./side-run.ts";
|
|
61
|
+
export { runSideRun, SIDE_RUN_END_EVENT, SIDE_RUN_START_EVENT } from "./side-run.ts";
|
|
@@ -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
|
+
}
|