@mrclrchtr/supi-code-intelligence 1.16.0 → 2.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/README.md +373 -63
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +6 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/abort-utils.ts +31 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +8 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +10 -4
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +1 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +1 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +6 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/model-selection.ts +134 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +9 -2
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +109 -4
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +5 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/spinner-frames.ts +11 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/status-spinner.ts +68 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +3 -2
- package/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +7 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +56 -2
- package/node_modules/@mrclrchtr/supi-code-runtime/src/evidence-badge.ts +40 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/index.ts +5 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +76 -3
- package/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/runtime.ts +37 -2
- package/node_modules/@mrclrchtr/supi-core/package.json +6 -1
- package/node_modules/@mrclrchtr/supi-core/src/abort-utils.ts +31 -0
- package/node_modules/@mrclrchtr/supi-core/src/api.ts +8 -0
- package/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +10 -4
- package/node_modules/@mrclrchtr/supi-core/src/config.ts +1 -0
- package/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +1 -1
- package/node_modules/@mrclrchtr/supi-core/src/index.ts +6 -0
- package/node_modules/@mrclrchtr/supi-core/src/model-selection.ts +134 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +9 -2
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +109 -4
- package/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +5 -1
- package/node_modules/@mrclrchtr/supi-core/src/spinner-frames.ts +11 -0
- package/node_modules/@mrclrchtr/supi-core/src/status-spinner.ts +68 -0
- package/node_modules/@mrclrchtr/supi-lsp/README.md +44 -56
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +6 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/abort-utils.ts +31 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +10 -4
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +6 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/model-selection.ts +134 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +9 -2
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +109 -4
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +5 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/spinner-frames.ts +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/status-spinner.ts +68 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +3 -2
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +7 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +56 -2
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/evidence-badge.ts +40 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/index.ts +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +76 -3
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/runtime.ts +37 -2
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +6 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/abort-utils.ts +31 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/api.ts +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +10 -4
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/config.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/index.ts +6 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/model-selection.ts +134 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +9 -2
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +109 -4
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +5 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/spinner-frames.ts +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/status-spinner.ts +68 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.d.ts +21 -2
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.d.ts +2 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/vscode-languageserver-protocol/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/package.json +4 -31
- package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +27 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-refresh.ts +5 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +246 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/transport.ts +4 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/config/capabilities.ts +3 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/config/config.ts +4 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/config/lsp-settings.ts +102 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/config/server-actions.ts +59 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/config/server-config.ts +4 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/index.ts +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/capability-index.ts +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-project-info.ts +2 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +115 -26
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/lsp-semantic-provider.ts +177 -134
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/refactor-planning.ts +214 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-controller.ts +320 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registration.ts +26 -5
- package/node_modules/@mrclrchtr/supi-lsp/src/session/service-registry.ts +81 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/summary.ts +2 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/README.md +18 -37
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +6 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/abort-utils.ts +31 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/api.ts +8 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +10 -4
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/config.ts +1 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/index.ts +6 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/model-selection.ts +134 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +9 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +109 -4
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +5 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/spinner-frames.ts +11 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/src/status-spinner.ts +68 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +3 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +7 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/capability/types.ts +56 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/evidence-badge.ts +40 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/index.ts +5 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +76 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/workspace/runtime.ts +37 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +6 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/abort-utils.ts +31 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/api.ts +8 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/config/config-settings.ts +10 -4
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/config.ts +1 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/index.ts +6 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/model-selection.ts +134 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +9 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings/settings-ui.ts +109 -4
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +5 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/spinner-frames.ts +11 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/status-spinner.ts +68 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/LICENSE +21 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/README.md +265 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs +4661 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.cjs.map +7 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js +4605 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/debug/web-tree-sitter.js.map +7 -0
- 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 +57 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/package.json +100 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs +4063 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.cjs.map +7 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts +1025 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.cts.map +58 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts +1025 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +58 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js +4007 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/web-tree-sitter/web-tree-sitter.js.map +7 -0
- 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 +55 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +6 -12
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/api.ts +29 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/index.ts +28 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/language.ts +5 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/provider/tree-sitter-provider.ts +14 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/runtime-controller.ts +157 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/session.ts +8 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/call-sites.ts +86 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/callees.ts +35 -16
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/structure.ts +1 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/types.ts +10 -0
- package/package.json +14 -9
- package/src/{model.ts → analysis/architecture/discovery.ts} +15 -72
- package/src/analysis/architecture/model.ts +76 -0
- package/src/analysis/brief/directory.ts +324 -0
- package/src/analysis/brief/enrich.ts +157 -0
- package/src/analysis/brief/file.ts +84 -0
- package/src/analysis/brief/inventory.ts +177 -0
- package/src/analysis/brief/main.ts +176 -0
- package/src/analysis/brief/models.ts +75 -0
- package/src/{brief.ts → analysis/brief/public-brief.ts} +21 -26
- package/src/analysis/brief/summarize.ts +208 -0
- package/src/analysis/brief/types.ts +27 -0
- package/src/{use-case/generate-brief.ts → analysis/brief/use-case.ts} +67 -144
- package/src/analysis/coverage/coverage-warnings.ts +224 -0
- package/src/analysis/evidence.ts +91 -0
- package/src/{semantic-action-helpers.ts → analysis/helpers.ts} +4 -4
- package/src/analysis/provider.ts +186 -0
- package/src/analysis/read-next.ts +126 -0
- package/src/analysis/readiness.ts +73 -0
- package/src/{refactor → analysis/refactor}/safety.ts +1 -1
- package/src/{use-case/support/semantic-references.ts → analysis/references/semantic-refs.ts} +58 -26
- package/src/analysis/search/pattern.ts +345 -0
- package/src/analysis/search/ripgrep.ts +473 -0
- package/src/{git-context.ts → analysis/signals/git.ts} +20 -7
- package/src/{prioritization-signals.ts → analysis/signals/project.ts} +33 -19
- package/src/analysis/target/anchored.ts +349 -0
- package/src/analysis/target/bridge.ts +152 -0
- package/src/analysis/target/file-resolution.ts +125 -0
- package/src/{targeting/resolve-file.ts → analysis/target/file.ts} +40 -20
- package/src/{planner → analysis/target}/planner.ts +30 -20
- package/src/{targeting → analysis/target}/query.ts +17 -3
- package/src/analysis/target/resolve-common.ts +115 -0
- package/src/analysis/target/service.ts +229 -0
- package/src/analysis/target/symbol.ts +196 -0
- package/src/{targeting → analysis/target}/types.ts +17 -1
- package/src/analysis/tests/likely-tests.ts +174 -0
- package/src/analysis/tests/test-discovery.ts +540 -0
- package/src/analysis/tests/vitest.ts +87 -0
- package/src/api.ts +34 -41
- package/src/app/app.ts +125 -0
- package/src/app/manager.ts +65 -0
- package/src/extension.ts +132 -1
- package/src/index.ts +1 -57
- package/src/session/refactor-plans.ts +82 -0
- package/src/session/session.ts +300 -0
- package/src/session/target-store.ts +293 -0
- package/src/substrate/lsp/diagnostic-injection.ts +218 -0
- package/src/substrate/lsp/lifecycle.ts +66 -0
- package/src/substrate/lsp/overrides.ts +132 -0
- package/src/substrate/lsp/recovery.ts +55 -0
- package/src/substrate/lsp/settings.ts +286 -0
- package/src/substrate/lsp/state.ts +46 -0
- package/src/substrate/lsp/utils.ts +17 -0
- package/src/substrate/tree-sitter/lifecycle.ts +52 -0
- package/src/tool/find/execute.ts +118 -0
- package/src/{presentation/markdown/pattern.ts → tool/find/markdown.ts} +102 -53
- package/src/{use-case/generate-pattern.ts → tool/find/orchestrate.ts} +67 -33
- package/src/tool/find/semantic-search.ts +114 -0
- package/src/tool/find/tui.ts +39 -0
- package/src/tool/graph/callees.ts +87 -0
- package/src/tool/graph/calls-md.ts +54 -0
- package/src/tool/graph/collect-relation.ts +371 -0
- package/src/tool/graph/execute.ts +95 -0
- package/src/tool/graph/implementations-md.ts +79 -0
- package/src/tool/graph/implementations.ts +76 -0
- package/src/tool/graph/markdown-base.ts +243 -0
- package/src/tool/graph/orchestrate.ts +285 -0
- package/src/tool/graph/references-md.ts +34 -0
- package/src/tool/graph/references.ts +81 -0
- package/src/tool/graph/tui.ts +120 -0
- package/src/tool/graph/types.ts +97 -0
- package/src/tool/guidance.ts +96 -49
- package/src/tool/health/execute.ts +76 -0
- package/src/tool/health/markdown.ts +280 -0
- package/src/tool/health/orchestrate.ts +159 -0
- package/src/tool/health/sections/diagnostics.ts +182 -0
- package/src/tool/health/sections/recovery.ts +89 -0
- package/src/tool/health/sections/signals.ts +89 -0
- package/src/tool/health/tui.ts +137 -0
- package/src/tool/impact/analysis.ts +247 -0
- package/src/tool/impact/change-set-impact.ts +151 -0
- package/src/tool/impact/execute.ts +98 -0
- package/src/tool/impact/file-level-impact.ts +81 -0
- package/src/tool/impact/markdown.ts +283 -0
- package/src/tool/impact/orchestrate.ts +97 -0
- package/src/tool/impact/result.ts +21 -0
- package/src/tool/impact/single-impact.ts +89 -0
- package/src/tool/impact/tui.ts +39 -0
- package/src/tool/impact/types.ts +34 -0
- package/src/tool/infra/cross-field.ts +335 -0
- package/src/tool/infra/error-results.ts +199 -0
- package/src/tool/infra/pipeline.ts +311 -0
- package/src/tool/infra/progress.ts +21 -0
- package/src/tool/infra/readiness-message.ts +5 -0
- package/src/tool/infra/truncate.ts +49 -0
- package/src/tool/inspect/execute.ts +76 -0
- package/src/tool/inspect/markdown.ts +169 -0
- package/src/tool/inspect/orchestrate.ts +156 -0
- package/src/tool/inspect/tui.ts +36 -0
- package/src/tool/orientation/deps.ts +63 -0
- package/src/tool/orientation/execute.ts +50 -0
- package/src/tool/orientation/markdown.ts +35 -0
- package/src/tool/orientation/mode.ts +88 -0
- package/src/tool/orientation/orchestrate.ts +478 -0
- package/src/tool/orientation/precise-target.ts +257 -0
- package/src/tool/orientation/tui.ts +131 -0
- package/src/{refactor/apply-workspace-edit.ts → tool/refactor-apply/apply.ts} +39 -16
- package/src/tool/refactor-apply/execute.ts +20 -0
- package/src/tool/refactor-apply/markdown.ts +118 -0
- package/src/tool/refactor-apply/orchestrate.ts +89 -0
- package/src/tool/refactor-apply/tui.ts +51 -0
- package/src/tool/refactor-plan/execute.ts +73 -0
- package/src/tool/refactor-plan/markdown.ts +118 -0
- package/src/tool/refactor-plan/orchestrate.ts +363 -0
- package/src/tool/refactor-plan/tui.ts +42 -0
- package/src/tool/register.ts +123 -0
- package/src/tool/resolve/execute.ts +82 -0
- package/src/tool/resolve/markdown.ts +150 -0
- package/src/tool/resolve/orchestrate.ts +134 -0
- package/src/tool/resolve/tui.ts +40 -0
- package/src/tool/schemas.ts +337 -0
- package/src/tool/specs.ts +257 -0
- package/src/types/details.ts +188 -0
- package/src/types/execution.ts +60 -0
- package/src/types/index.ts +28 -0
- package/src/{intent/types.ts → types/tool-names.ts} +15 -14
- package/src/ui/footer.ts +52 -0
- package/src/ui/markdown/brief.ts +218 -0
- package/src/ui/markdown/gather.ts +177 -0
- package/src/{use-case/build-overview.ts → ui/markdown/overview-data.ts} +2 -2
- package/src/{presentation → ui}/markdown/overview.ts +2 -2
- package/src/ui/markdown/types.ts +80 -0
- package/{node_modules/@mrclrchtr/supi-lsp/src/ui/renderer.ts → src/ui/message-renderer.ts} +11 -10
- package/src/ui/status-command.ts +260 -0
- package/src/ui/status-overlay.ts +500 -0
- package/src/ui/tui/common.ts +220 -0
- package/src/ui/tui/index.ts +37 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/extension.ts +0 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/format.ts +0 -373
- package/node_modules/@mrclrchtr/supi-lsp/src/handlers/diagnostic-injection.ts +0 -182
- package/node_modules/@mrclrchtr/supi-lsp/src/handlers/session-lifecycle.ts +0 -149
- package/node_modules/@mrclrchtr/supi-lsp/src/handlers/status-command.ts +0 -38
- package/node_modules/@mrclrchtr/supi-lsp/src/handlers/workspace-recovery.ts +0 -92
- package/node_modules/@mrclrchtr/supi-lsp/src/lsp.ts +0 -37
- package/node_modules/@mrclrchtr/supi-lsp/src/session/lsp-state.ts +0 -93
- package/node_modules/@mrclrchtr/supi-lsp/src/session/settings-registration.ts +0 -296
- package/node_modules/@mrclrchtr/supi-lsp/src/session/tree-persist.ts +0 -75
- package/node_modules/@mrclrchtr/supi-lsp/src/tool/guidance.ts +0 -69
- package/node_modules/@mrclrchtr/supi-lsp/src/tool/names.ts +0 -27
- package/node_modules/@mrclrchtr/supi-lsp/src/tool/overrides.ts +0 -204
- package/node_modules/@mrclrchtr/supi-lsp/src/tool/register-tools.ts +0 -69
- package/node_modules/@mrclrchtr/supi-lsp/src/tool/service-actions.ts +0 -399
- package/node_modules/@mrclrchtr/supi-lsp/src/tool/tool-specs.ts +0 -248
- package/node_modules/@mrclrchtr/supi-lsp/src/ui/ui.ts +0 -360
- package/node_modules/@mrclrchtr/supi-lsp/src/workspace-change.ts +0 -40
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/extension.ts +0 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/formatting.ts +0 -104
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/guidance.ts +0 -35
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/handlers.ts +0 -196
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/register-tools.ts +0 -107
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/tool-specs.ts +0 -117
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tree-sitter.ts +0 -47
- package/src/brief-focused.ts +0 -563
- package/src/code-intelligence.ts +0 -70
- package/src/pattern-structured.ts +0 -194
- package/src/presentation/markdown/affected.ts +0 -170
- package/src/presentation/markdown/brief.ts +0 -174
- package/src/presentation/markdown/map.ts +0 -54
- package/src/presentation/markdown/refactor.ts +0 -27
- package/src/presentation/markdown/relations.ts +0 -121
- package/src/resolve-target.ts +0 -130
- package/src/search-helpers.ts +0 -303
- package/src/substrates/types.ts +0 -30
- package/src/target-resolution.ts +0 -122
- package/src/targeting/resolve-anchored.ts +0 -80
- package/src/targeting/resolve-symbol.ts +0 -110
- package/src/tool/execute-affected.ts +0 -71
- package/src/tool/execute-brief.ts +0 -59
- package/src/tool/execute-map.ts +0 -35
- package/src/tool/execute-pattern.ts +0 -29
- package/src/tool/execute-refactor.ts +0 -101
- package/src/tool/execute-relations.ts +0 -79
- package/src/tool/register-tools.ts +0 -32
- package/src/tool/tool-specs.ts +0 -190
- package/src/tool/validation.ts +0 -43
- package/src/types.ts +0 -169
- package/src/use-case/generate-affected.ts +0 -297
- package/src/use-case/generate-map.ts +0 -176
- package/src/use-case/generate-relations.ts +0 -438
- package/src/use-case/types.ts +0 -43
- package/src/workspace/request-context.ts +0 -139
- /package/src/{query-params.ts → tool/params.ts} +0 -0
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import { type TSchema, Type } from "typebox";
|
|
2
|
-
import type { ServerCapabilities } from "../config/types.ts";
|
|
3
|
-
import type { SessionLspService } from "../session/service-registry.ts";
|
|
4
|
-
import {
|
|
5
|
-
LSP_CODE_ACTIONS_TOOL,
|
|
6
|
-
LSP_DEFINITION_TOOL,
|
|
7
|
-
LSP_DIAGNOSTICS_TOOL,
|
|
8
|
-
LSP_DOCUMENT_SYMBOLS_TOOL,
|
|
9
|
-
LSP_HOVER_TOOL,
|
|
10
|
-
LSP_IMPLEMENTATION_TOOL,
|
|
11
|
-
LSP_RECOVER_TOOL,
|
|
12
|
-
LSP_REFERENCES_TOOL,
|
|
13
|
-
LSP_RENAME_TOOL,
|
|
14
|
-
LSP_WORKSPACE_SYMBOLS_TOOL,
|
|
15
|
-
type LspToolName,
|
|
16
|
-
} from "./names.ts";
|
|
17
|
-
import {
|
|
18
|
-
executeCodeActions,
|
|
19
|
-
executeDefinition,
|
|
20
|
-
executeDiagnostics,
|
|
21
|
-
executeDocumentSymbols,
|
|
22
|
-
executeHover,
|
|
23
|
-
executeImplementation,
|
|
24
|
-
executeRecover,
|
|
25
|
-
executeReferences,
|
|
26
|
-
executeRename,
|
|
27
|
-
executeWorkspaceSymbols,
|
|
28
|
-
} from "./service-actions.ts";
|
|
29
|
-
|
|
30
|
-
// Shared parameter builders
|
|
31
|
-
const FileParam = Type.String({ description: "File path" });
|
|
32
|
-
const LineParam = Type.Number({ description: "1-based line", minimum: 1 });
|
|
33
|
-
const CharacterParam = Type.Number({ description: "1-based column", minimum: 1 });
|
|
34
|
-
const QueryParam = Type.String({ description: "Symbol query" });
|
|
35
|
-
const NewNameParam = Type.String({ description: "New name" });
|
|
36
|
-
|
|
37
|
-
// Parameter schemas
|
|
38
|
-
const PositionParams = Type.Object(
|
|
39
|
-
{ file: FileParam, line: LineParam, character: CharacterParam },
|
|
40
|
-
{ additionalProperties: false },
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
const RenameParams = Type.Object(
|
|
44
|
-
{ file: FileParam, line: LineParam, character: CharacterParam, newName: NewNameParam },
|
|
45
|
-
{ additionalProperties: false },
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
const DocumentSymbolsParameters = Type.Object({ file: FileParam }, { additionalProperties: false });
|
|
49
|
-
|
|
50
|
-
const WorkspaceSymbolsParameters = Type.Object(
|
|
51
|
-
{ query: QueryParam },
|
|
52
|
-
{ additionalProperties: false },
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
const DiagnosticsParameters = Type.Object(
|
|
56
|
-
{ file: Type.Optional(FileParam) },
|
|
57
|
-
{ additionalProperties: false },
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
const RecoverParameters = Type.Object({}, { additionalProperties: false });
|
|
61
|
-
|
|
62
|
-
export interface LspToolDefinitionSpec {
|
|
63
|
-
name: LspToolName;
|
|
64
|
-
label: string;
|
|
65
|
-
description: string;
|
|
66
|
-
promptSnippet: string;
|
|
67
|
-
basePromptGuidelines: string[];
|
|
68
|
-
parameters: TSchema;
|
|
69
|
-
run: (service: SessionLspService, cwd: string, params: unknown) => Promise<string>;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export const LSP_TOOL_DEFINITION_SPECS = [
|
|
73
|
-
{
|
|
74
|
-
name: LSP_HOVER_TOOL,
|
|
75
|
-
label: "LSP Hover",
|
|
76
|
-
description: "Semantic hover/type info at a file position.",
|
|
77
|
-
promptSnippet: "lsp_hover — hover/type info",
|
|
78
|
-
basePromptGuidelines: ["Use lsp_hover(file,line,character) for semantic hover/type info."],
|
|
79
|
-
parameters: PositionParams,
|
|
80
|
-
run: (service, cwd, params) =>
|
|
81
|
-
executeHover(service, cwd, params as Parameters<typeof executeHover>[2]),
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: LSP_DEFINITION_TOOL,
|
|
85
|
-
label: "LSP Definition",
|
|
86
|
-
description: "Jump to a symbol definition at a file position.",
|
|
87
|
-
promptSnippet: "lsp_definition — jump to definition",
|
|
88
|
-
basePromptGuidelines: [
|
|
89
|
-
"Use lsp_definition(file,line,character) to jump to a symbol definition.",
|
|
90
|
-
],
|
|
91
|
-
parameters: PositionParams,
|
|
92
|
-
run: (service, cwd, params) =>
|
|
93
|
-
executeDefinition(service, cwd, params as Parameters<typeof executeDefinition>[2]),
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
name: LSP_REFERENCES_TOOL,
|
|
97
|
-
label: "LSP References",
|
|
98
|
-
description: "Find semantic references to a symbol at a file position.",
|
|
99
|
-
promptSnippet: "lsp_references — semantic references",
|
|
100
|
-
basePromptGuidelines: ["Use lsp_references(file,line,character) for semantic references."],
|
|
101
|
-
parameters: PositionParams,
|
|
102
|
-
run: (service, cwd, params) =>
|
|
103
|
-
executeReferences(service, cwd, params as Parameters<typeof executeReferences>[2]),
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
name: LSP_IMPLEMENTATION_TOOL,
|
|
107
|
-
label: "LSP Implementation",
|
|
108
|
-
description: "Find implementations from a file position.",
|
|
109
|
-
promptSnippet: "lsp_implementation — implementations",
|
|
110
|
-
basePromptGuidelines: ["Use lsp_implementation(file,line,character) for implementations."],
|
|
111
|
-
parameters: PositionParams,
|
|
112
|
-
run: (service, cwd, params) =>
|
|
113
|
-
executeImplementation(service, cwd, params as Parameters<typeof executeImplementation>[2]),
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
name: LSP_DOCUMENT_SYMBOLS_TOOL,
|
|
117
|
-
label: "LSP Document Symbols",
|
|
118
|
-
description: "List semantic declarations in one file.",
|
|
119
|
-
promptSnippet: "lsp_document_symbols — one-file semantic outline",
|
|
120
|
-
basePromptGuidelines: ["Use lsp_document_symbols(file) for one-file semantic declarations."],
|
|
121
|
-
parameters: DocumentSymbolsParameters,
|
|
122
|
-
run: (service, cwd, params) =>
|
|
123
|
-
executeDocumentSymbols(service, cwd, params as Parameters<typeof executeDocumentSymbols>[2]),
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
name: LSP_WORKSPACE_SYMBOLS_TOOL,
|
|
127
|
-
label: "LSP Workspace Symbols",
|
|
128
|
-
description: "Find symbol declarations by name across the project.",
|
|
129
|
-
promptSnippet: "lsp_workspace_symbols — project symbol lookup",
|
|
130
|
-
basePromptGuidelines: ["Use lsp_workspace_symbols(query) to find declarations by name."],
|
|
131
|
-
parameters: WorkspaceSymbolsParameters,
|
|
132
|
-
run: (service, cwd, params) =>
|
|
133
|
-
executeWorkspaceSymbols(
|
|
134
|
-
service,
|
|
135
|
-
cwd,
|
|
136
|
-
params as Parameters<typeof executeWorkspaceSymbols>[2],
|
|
137
|
-
),
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
name: LSP_DIAGNOSTICS_TOOL,
|
|
141
|
-
label: "LSP Diagnostics",
|
|
142
|
-
description: "Show semantic diagnostics for one file or the workspace.",
|
|
143
|
-
promptSnippet: "lsp_diagnostics — semantic diagnostics",
|
|
144
|
-
basePromptGuidelines: ["Use lsp_diagnostics(file?) for semantic diagnostics."],
|
|
145
|
-
parameters: DiagnosticsParameters,
|
|
146
|
-
run: (service, cwd, params) =>
|
|
147
|
-
executeDiagnostics(service, cwd, params as Parameters<typeof executeDiagnostics>[2]),
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
name: LSP_RENAME_TOOL,
|
|
151
|
-
label: "LSP Rename",
|
|
152
|
-
description: "Plan a semantic rename from a file position.",
|
|
153
|
-
promptSnippet: "lsp_rename — semantic rename plan",
|
|
154
|
-
basePromptGuidelines: [
|
|
155
|
-
"Use lsp_rename(file,line,character,newName) to plan a semantic rename.",
|
|
156
|
-
],
|
|
157
|
-
parameters: RenameParams,
|
|
158
|
-
run: (service, cwd, params) =>
|
|
159
|
-
executeRename(service, cwd, params as Parameters<typeof executeRename>[2]),
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
name: LSP_CODE_ACTIONS_TOOL,
|
|
163
|
-
label: "LSP Code Actions",
|
|
164
|
-
description: "List code fixes/refactors at a file position.",
|
|
165
|
-
promptSnippet: "lsp_code_actions — quick fixes/refactors",
|
|
166
|
-
basePromptGuidelines: ["Use lsp_code_actions(file,line,character) for quick fixes/refactors."],
|
|
167
|
-
parameters: PositionParams,
|
|
168
|
-
run: (service, cwd, params) =>
|
|
169
|
-
executeCodeActions(service, cwd, params as Parameters<typeof executeCodeActions>[2]),
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
name: LSP_RECOVER_TOOL,
|
|
173
|
-
label: "LSP Recover",
|
|
174
|
-
description: "Refresh LSP diagnostics after workspace changes.",
|
|
175
|
-
promptSnippet: "lsp_recover — refresh stale diagnostics",
|
|
176
|
-
basePromptGuidelines: [
|
|
177
|
-
"Use lsp_recover() when diagnostics look stale after workspace changes.",
|
|
178
|
-
],
|
|
179
|
-
parameters: RecoverParameters,
|
|
180
|
-
run: (service) => executeRecover(service),
|
|
181
|
-
},
|
|
182
|
-
] as const satisfies readonly LspToolDefinitionSpec[];
|
|
183
|
-
|
|
184
|
-
const LSP_TOOL_SPEC_MAP = new Map<LspToolName, LspToolDefinitionSpec>(
|
|
185
|
-
LSP_TOOL_DEFINITION_SPECS.map((spec) => [spec.name, spec]),
|
|
186
|
-
);
|
|
187
|
-
|
|
188
|
-
export function getLspToolDefinitionSpec(toolName: LspToolName): LspToolDefinitionSpec {
|
|
189
|
-
const spec = LSP_TOOL_SPEC_MAP.get(toolName);
|
|
190
|
-
if (!spec) {
|
|
191
|
-
throw new Error(`Unknown LSP tool: ${toolName}`);
|
|
192
|
-
}
|
|
193
|
-
return spec;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
interface LspServerSupportedActionSpec {
|
|
197
|
-
label: string;
|
|
198
|
-
isSupported: (capabilities: ServerCapabilities | null | undefined) => boolean;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
const LSP_SERVER_SUPPORTED_ACTION_SPECS: readonly LspServerSupportedActionSpec[] = [
|
|
202
|
-
{
|
|
203
|
-
label: "diagnostics [optional file]",
|
|
204
|
-
isSupported: () => true,
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
label: "hover(file,line,char)",
|
|
208
|
-
isSupported: (capabilities) => Boolean(capabilities?.hoverProvider),
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
label: "definition(file,line,char)",
|
|
212
|
-
isSupported: (capabilities) => Boolean(capabilities?.definitionProvider),
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
label: "references(file,line,char)",
|
|
216
|
-
isSupported: (capabilities) => Boolean(capabilities?.referencesProvider),
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
label: "implementation(file,line,char)",
|
|
220
|
-
isSupported: (capabilities) => Boolean(capabilities?.implementationProvider),
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
label: "symbols(file)",
|
|
224
|
-
isSupported: (capabilities) => Boolean(capabilities?.documentSymbolProvider),
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
label: "workspace_symbols(query)",
|
|
228
|
-
isSupported: (capabilities) => Boolean(capabilities?.workspaceSymbolProvider),
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
label: "rename(file,line,char,newName)",
|
|
232
|
-
isSupported: (capabilities) => Boolean(capabilities?.renameProvider),
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
label: "code_actions(file,line,char)",
|
|
236
|
-
isSupported: (capabilities) => Boolean(capabilities?.codeActionProvider),
|
|
237
|
-
},
|
|
238
|
-
] as const;
|
|
239
|
-
|
|
240
|
-
export function getSupportedLspServerActions(
|
|
241
|
-
capabilities: ServerCapabilities | null | undefined,
|
|
242
|
-
): string[] {
|
|
243
|
-
if (!capabilities) return [];
|
|
244
|
-
|
|
245
|
-
return LSP_SERVER_SUPPORTED_ACTION_SPECS.filter((spec) => spec.isSupported(capabilities)).map(
|
|
246
|
-
(spec) => spec.label,
|
|
247
|
-
);
|
|
248
|
-
}
|
|
@@ -1,360 +0,0 @@
|
|
|
1
|
-
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import { DynamicBorder } from "@earendil-works/pi-coding-agent";
|
|
3
|
-
import type { OverlayHandle } from "@earendil-works/pi-tui";
|
|
4
|
-
import { Container, Spacer, Text } from "@earendil-works/pi-tui";
|
|
5
|
-
import type { Diagnostic, ProjectServerInfo } from "../config/types.ts";
|
|
6
|
-
import { DiagnosticSeverity } from "../config/types.ts";
|
|
7
|
-
import type { LspManager } from "../manager/manager.ts";
|
|
8
|
-
import type { OutstandingDiagnosticSummaryEntry } from "../manager/manager-types.ts";
|
|
9
|
-
|
|
10
|
-
export interface LspInspectorState {
|
|
11
|
-
handle: OverlayHandle | null;
|
|
12
|
-
close: (() => void) | null;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function updateLspUi(
|
|
16
|
-
ctx: ExtensionContext,
|
|
17
|
-
manager: LspManager,
|
|
18
|
-
inlineSeverity: number,
|
|
19
|
-
servers: ProjectServerInfo[],
|
|
20
|
-
): void {
|
|
21
|
-
const diagnostics = manager.getOutstandingDiagnosticSummary(inlineSeverity);
|
|
22
|
-
|
|
23
|
-
ctx.ui.setStatus("lsp", buildLspStatus(ctx, servers, diagnostics));
|
|
24
|
-
ctx.ui.setWidget(
|
|
25
|
-
"lsp",
|
|
26
|
-
hasWidgetContent(diagnostics)
|
|
27
|
-
? (_tui, theme) => buildLspWidgetComponent(theme, diagnostics)
|
|
28
|
-
: undefined,
|
|
29
|
-
{ placement: "belowEditor" },
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// biome-ignore lint/complexity/useMaxParams: overlay inputs travel together
|
|
34
|
-
export function toggleLspStatusOverlay(
|
|
35
|
-
ctx: ExtensionContext,
|
|
36
|
-
manager: LspManager,
|
|
37
|
-
inlineSeverity: number,
|
|
38
|
-
inspector: LspInspectorState,
|
|
39
|
-
servers: ProjectServerInfo[],
|
|
40
|
-
): void {
|
|
41
|
-
if (inspector.handle && inspector.close) {
|
|
42
|
-
inspector.close();
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
void ctx.ui
|
|
47
|
-
.custom<void>(
|
|
48
|
-
(_tui, theme, _kb, done) => {
|
|
49
|
-
inspector.close = () => done(undefined);
|
|
50
|
-
return createLspInspectorComponent(theme, manager, inlineSeverity, servers);
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
overlay: true,
|
|
54
|
-
overlayOptions: {
|
|
55
|
-
anchor: "right-center",
|
|
56
|
-
width: "60%",
|
|
57
|
-
minWidth: 72,
|
|
58
|
-
maxHeight: "90%",
|
|
59
|
-
margin: { right: 1, top: 1, bottom: 1 },
|
|
60
|
-
nonCapturing: true,
|
|
61
|
-
},
|
|
62
|
-
onHandle: (handle) => {
|
|
63
|
-
inspector.handle = handle;
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
)
|
|
67
|
-
.finally(() => {
|
|
68
|
-
inspector.handle = null;
|
|
69
|
-
inspector.close = null;
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function createLspInspectorComponent(
|
|
74
|
-
theme: ExtensionContext["ui"]["theme"],
|
|
75
|
-
manager: LspManager,
|
|
76
|
-
inlineSeverity: number,
|
|
77
|
-
servers: ProjectServerInfo[],
|
|
78
|
-
): { render: (width: number) => string[]; invalidate: () => void } {
|
|
79
|
-
return {
|
|
80
|
-
render: (width) =>
|
|
81
|
-
buildLspInspectorContainer({
|
|
82
|
-
theme,
|
|
83
|
-
manager,
|
|
84
|
-
inlineSeverity,
|
|
85
|
-
servers,
|
|
86
|
-
width,
|
|
87
|
-
}).render(width),
|
|
88
|
-
invalidate: () => {},
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
interface LspInspectorContainerInput {
|
|
93
|
-
theme: ExtensionContext["ui"]["theme"];
|
|
94
|
-
manager: LspManager;
|
|
95
|
-
inlineSeverity: number;
|
|
96
|
-
servers: ProjectServerInfo[];
|
|
97
|
-
width: number;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function buildLspInspectorContainer(input: LspInspectorContainerInput): Container {
|
|
101
|
-
const diagnostics = input.manager.getOutstandingDiagnosticSummary(input.inlineSeverity);
|
|
102
|
-
const detailedDiagnostics = input.manager.getOutstandingDiagnostics(input.inlineSeverity);
|
|
103
|
-
const container = new Container();
|
|
104
|
-
|
|
105
|
-
const { theme, servers, width } = input;
|
|
106
|
-
|
|
107
|
-
container.addChild(new DynamicBorder((s: string) => theme.fg("accent", s)));
|
|
108
|
-
container.addChild(
|
|
109
|
-
new Text(
|
|
110
|
-
theme.fg("accent", theme.bold(" λ LSP")) + theme.fg("dim", " inspector /lsp-status toggles"),
|
|
111
|
-
1,
|
|
112
|
-
0,
|
|
113
|
-
),
|
|
114
|
-
);
|
|
115
|
-
|
|
116
|
-
if (servers.length === 0 && diagnostics.length === 0) {
|
|
117
|
-
container.addChild(
|
|
118
|
-
new Text(theme.fg("dim", "no LSP servers available for this project"), 1, 0),
|
|
119
|
-
);
|
|
120
|
-
container.addChild(new DynamicBorder((s: string) => theme.fg("accent", s)));
|
|
121
|
-
return container;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
container.addChild(new Text(buildOverlaySummaryLine(theme, servers, diagnostics), 1, 0));
|
|
125
|
-
container.addChild(new Spacer(1));
|
|
126
|
-
container.addChild(
|
|
127
|
-
buildOverlaySection(theme, "Servers", buildOverlayServerLines(theme, servers)),
|
|
128
|
-
);
|
|
129
|
-
container.addChild(new Spacer(1));
|
|
130
|
-
container.addChild(
|
|
131
|
-
buildOverlaySection(
|
|
132
|
-
theme,
|
|
133
|
-
diagnostics.length > 0 ? "Problems" : "Diagnostics",
|
|
134
|
-
buildOverlayDiagnosticLines(theme, diagnostics, detailedDiagnostics, width),
|
|
135
|
-
),
|
|
136
|
-
);
|
|
137
|
-
container.addChild(new Spacer(1));
|
|
138
|
-
container.addChild(new DynamicBorder((s: string) => theme.fg("accent", s)));
|
|
139
|
-
|
|
140
|
-
return container;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
function buildLspStatus(
|
|
144
|
-
ctx: ExtensionContext,
|
|
145
|
-
servers: ProjectServerInfo[],
|
|
146
|
-
diagnostics: OutstandingDiagnosticSummaryEntry[],
|
|
147
|
-
): string | undefined {
|
|
148
|
-
const runningServers = servers.filter((server) => server.status === "running").length;
|
|
149
|
-
const openFiles = servers.reduce((sum, server) => sum + server.openFiles.length, 0);
|
|
150
|
-
const totals = collectDiagnosticTotals(diagnostics);
|
|
151
|
-
|
|
152
|
-
if (runningServers === 0 && openFiles === 0 && diagnostics.length === 0) {
|
|
153
|
-
return undefined;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
const { theme } = ctx.ui;
|
|
157
|
-
const parts = [theme.fg("accent", "λ lsp")];
|
|
158
|
-
if (runningServers > 0) parts.push(theme.fg("dim", pluralize(runningServers, "server")));
|
|
159
|
-
if (openFiles > 0) parts.push(theme.fg("dim", pluralize(openFiles, "open file")));
|
|
160
|
-
if (totals.errors > 0) parts.push(theme.fg("error", pluralize(totals.errors, "error")));
|
|
161
|
-
if (totals.warnings > 0) parts.push(theme.fg("warning", pluralize(totals.warnings, "warning")));
|
|
162
|
-
if (totals.information > 0) parts.push(theme.fg("accent", pluralize(totals.information, "info")));
|
|
163
|
-
if (totals.hints > 0) parts.push(theme.fg("dim", pluralize(totals.hints, "hint")));
|
|
164
|
-
return parts.join(theme.fg("dim", " • "));
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function hasWidgetContent(diagnostics: OutstandingDiagnosticSummaryEntry[]): boolean {
|
|
168
|
-
return diagnostics.length > 0;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
function buildLspWidgetComponent(
|
|
172
|
-
theme: ExtensionContext["ui"]["theme"],
|
|
173
|
-
diagnostics: OutstandingDiagnosticSummaryEntry[],
|
|
174
|
-
): Container {
|
|
175
|
-
const container = new Container();
|
|
176
|
-
|
|
177
|
-
for (const line of buildWidgetDiagnosticLines(theme, diagnostics)) {
|
|
178
|
-
container.addChild(new Text(line, 0, 0));
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
return container;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
function buildWidgetDiagnosticLines(
|
|
185
|
-
theme: ExtensionContext["ui"]["theme"],
|
|
186
|
-
diagnostics: OutstandingDiagnosticSummaryEntry[],
|
|
187
|
-
): string[] {
|
|
188
|
-
if (diagnostics.length === 1) {
|
|
189
|
-
const [entry] = diagnostics;
|
|
190
|
-
if (!entry) return [];
|
|
191
|
-
return [
|
|
192
|
-
`${theme.fg("error", "●")} ${entry.file} ${theme.fg("dim", `— ${formatDiagnosticCounts(entry)}`)}`,
|
|
193
|
-
];
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const totals = collectDiagnosticTotals(diagnostics);
|
|
197
|
-
const counts: string[] = [];
|
|
198
|
-
if (totals.errors > 0) counts.push(theme.fg("error", pluralize(totals.errors, "error")));
|
|
199
|
-
if (totals.warnings > 0) counts.push(theme.fg("warning", pluralize(totals.warnings, "warning")));
|
|
200
|
-
if (totals.information > 0)
|
|
201
|
-
counts.push(theme.fg("accent", pluralize(totals.information, "info")));
|
|
202
|
-
if (totals.hints > 0) counts.push(theme.fg("dim", pluralize(totals.hints, "hint")));
|
|
203
|
-
|
|
204
|
-
const visibleFiles = diagnostics.slice(0, 2).map((entry) => entry.file);
|
|
205
|
-
const remaining = diagnostics.length - visibleFiles.length;
|
|
206
|
-
const suffix = remaining > 0 ? `${theme.fg("dim", ` +${remaining} more`)}` : "";
|
|
207
|
-
|
|
208
|
-
return [
|
|
209
|
-
`${theme.fg("accent", theme.bold("λ LSP diagnostics"))} ${theme.fg("dim", `— ${pluralize(diagnostics.length, "file")}`)} ${counts.join(theme.fg("dim", " • "))}`,
|
|
210
|
-
`${theme.fg("error", "↳")} ${visibleFiles.join(", ")}${suffix}`,
|
|
211
|
-
];
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
function buildOverlaySummaryLine(
|
|
215
|
-
theme: ExtensionContext["ui"]["theme"],
|
|
216
|
-
servers: ProjectServerInfo[],
|
|
217
|
-
diagnostics: OutstandingDiagnosticSummaryEntry[],
|
|
218
|
-
): string {
|
|
219
|
-
const runningServers = servers.filter((server) => server.status === "running").length;
|
|
220
|
-
const openFiles = servers.reduce((sum, server) => sum + server.openFiles.length, 0);
|
|
221
|
-
const totals = collectDiagnosticTotals(diagnostics);
|
|
222
|
-
|
|
223
|
-
const parts = [
|
|
224
|
-
theme.fg(
|
|
225
|
-
"dim",
|
|
226
|
-
`${pluralize(runningServers, "server")} • ${pluralize(openFiles, "open file")}`,
|
|
227
|
-
),
|
|
228
|
-
];
|
|
229
|
-
if (totals.errors > 0) {
|
|
230
|
-
parts.push(theme.fg("error", pluralize(totals.errors, "error")));
|
|
231
|
-
} else if (totals.warnings > 0) {
|
|
232
|
-
parts.push(theme.fg("warning", pluralize(totals.warnings, "warning")));
|
|
233
|
-
} else if (totals.information > 0) {
|
|
234
|
-
parts.push(theme.fg("accent", pluralize(totals.information, "info")));
|
|
235
|
-
} else if (totals.hints > 0) {
|
|
236
|
-
parts.push(theme.fg("dim", pluralize(totals.hints, "hint")));
|
|
237
|
-
} else {
|
|
238
|
-
parts.push(theme.fg("success", "clean"));
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
return parts.join(theme.fg("dim", " "));
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
function buildOverlaySection(
|
|
245
|
-
theme: ExtensionContext["ui"]["theme"],
|
|
246
|
-
title: string,
|
|
247
|
-
lines: string[],
|
|
248
|
-
): Container {
|
|
249
|
-
const container = new Container();
|
|
250
|
-
container.addChild(new Text(theme.fg("accent", theme.bold(` ${title}`)), 1, 0));
|
|
251
|
-
for (const line of lines) {
|
|
252
|
-
container.addChild(new Text(line, 2, 0));
|
|
253
|
-
}
|
|
254
|
-
return container;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
function buildOverlayServerLines(
|
|
258
|
-
theme: ExtensionContext["ui"]["theme"],
|
|
259
|
-
servers: ProjectServerInfo[],
|
|
260
|
-
): string[] {
|
|
261
|
-
if (servers.length === 0) {
|
|
262
|
-
return [theme.fg("dim", "no LSP servers available for this project")];
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
return servers.flatMap((server) => {
|
|
266
|
-
const statusColor =
|
|
267
|
-
server.status === "running" ? "success" : server.status === "error" ? "error" : "warning";
|
|
268
|
-
const actions =
|
|
269
|
-
server.supportedActions.length > 0 ? server.supportedActions.join(", ") : "none";
|
|
270
|
-
const fileTypes = server.fileTypes.map((entry) => `.${entry}`).join(", ");
|
|
271
|
-
const openFiles =
|
|
272
|
-
server.openFiles.length > 0 ? server.openFiles.slice(0, 3).join(", ") : "none";
|
|
273
|
-
const remaining = server.openFiles.length - Math.min(server.openFiles.length, 3);
|
|
274
|
-
const suffix = remaining > 0 ? theme.fg("dim", ` +${remaining} more`) : "";
|
|
275
|
-
|
|
276
|
-
return [
|
|
277
|
-
`${theme.fg("accent", "◆")} ${server.name} ${theme.fg(statusColor, server.status)} ${theme.fg("dim", `— root: ${server.root}`)}`,
|
|
278
|
-
`${theme.fg("dim", "↳")} files: ${fileTypes}`,
|
|
279
|
-
`${theme.fg("dim", "↳")} actions: ${actions}`,
|
|
280
|
-
`${theme.fg("dim", "↳")} open: ${openFiles}${suffix}`,
|
|
281
|
-
];
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: pre-existing — v3.18.0 MarkupContent extraction pushes it over
|
|
286
|
-
function buildOverlayDiagnosticLines(
|
|
287
|
-
theme: ExtensionContext["ui"]["theme"],
|
|
288
|
-
diagnostics: OutstandingDiagnosticSummaryEntry[],
|
|
289
|
-
detailedDiagnostics: Array<{ file: string; diagnostics: Diagnostic[] }>,
|
|
290
|
-
width: number,
|
|
291
|
-
): string[] {
|
|
292
|
-
if (diagnostics.length === 0) {
|
|
293
|
-
return [theme.fg("success", "✓ no outstanding diagnostics")];
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
const lines: string[] = [];
|
|
297
|
-
const maxFiles = 5;
|
|
298
|
-
const maxMessagesPerFile = 5;
|
|
299
|
-
// Budget for prefix: 2 spaces + tree char + space + line:col + space + Text paddingX(2)*2
|
|
300
|
-
const maxMessageLen = Math.max(24, width - 18);
|
|
301
|
-
|
|
302
|
-
for (const entry of detailedDiagnostics.slice(0, maxFiles)) {
|
|
303
|
-
const summary = diagnostics.find((d) => d.file === entry.file);
|
|
304
|
-
const countLabel = summary ? formatDiagnosticCounts(summary) : "";
|
|
305
|
-
lines.push(`${theme.fg("error", "●")} ${entry.file} ${theme.fg("dim", `— ${countLabel}`)}`);
|
|
306
|
-
|
|
307
|
-
for (const diag of entry.diagnostics.slice(0, maxMessagesPerFile)) {
|
|
308
|
-
const line = diag.range.start.line + 1;
|
|
309
|
-
const col = diag.range.start.character + 1;
|
|
310
|
-
const sevColor = diag.severity === DiagnosticSeverity.Error ? "error" : "warning";
|
|
311
|
-
const messageText = typeof diag.message === "string" ? diag.message : diag.message.value;
|
|
312
|
-
const message = truncate(messageText, maxMessageLen);
|
|
313
|
-
lines.push(` ${theme.fg(sevColor, "└")} ${line}:${col} ${theme.fg("dim", message)}`);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
const remainingMessages = entry.diagnostics.length - maxMessagesPerFile;
|
|
317
|
-
if (remainingMessages > 0) {
|
|
318
|
-
lines.push(` ${theme.fg("dim", `└ +${remainingMessages} more`)}`);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
const remainingFiles = diagnostics.length - Math.min(diagnostics.length, maxFiles);
|
|
323
|
-
if (remainingFiles > 0) {
|
|
324
|
-
lines.push(theme.fg("dim", `↳ +${remainingFiles} more file${remainingFiles === 1 ? "" : "s"}`));
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
return lines;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
function truncate(text: string, maxLength: number): string {
|
|
331
|
-
if (text.length <= maxLength) return text;
|
|
332
|
-
return `${text.slice(0, maxLength - 1)}…`;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
function formatDiagnosticCounts(entry: OutstandingDiagnosticSummaryEntry): string {
|
|
336
|
-
const counts: string[] = [];
|
|
337
|
-
if (entry.errors > 0) counts.push(pluralize(entry.errors, "error"));
|
|
338
|
-
if (entry.warnings > 0) counts.push(pluralize(entry.warnings, "warning"));
|
|
339
|
-
if (entry.information > 0) counts.push(pluralize(entry.information, "info"));
|
|
340
|
-
if (entry.hints > 0) counts.push(pluralize(entry.hints, "hint"));
|
|
341
|
-
return counts.join(", ");
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
function collectDiagnosticTotals(
|
|
345
|
-
diagnostics: OutstandingDiagnosticSummaryEntry[],
|
|
346
|
-
): Pick<OutstandingDiagnosticSummaryEntry, "errors" | "warnings" | "information" | "hints"> {
|
|
347
|
-
return diagnostics.reduce(
|
|
348
|
-
(totals, entry) => ({
|
|
349
|
-
errors: totals.errors + entry.errors,
|
|
350
|
-
warnings: totals.warnings + entry.warnings,
|
|
351
|
-
information: totals.information + entry.information,
|
|
352
|
-
hints: totals.hints + entry.hints,
|
|
353
|
-
}),
|
|
354
|
-
{ errors: 0, warnings: 0, information: 0, hints: 0 },
|
|
355
|
-
);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
function pluralize(count: number, word: string): string {
|
|
359
|
-
return `${count} ${word}${count === 1 ? "" : "s"}`;
|
|
360
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// Workspace change tracking helpers shared by handlers/session-lifecycle.ts,
|
|
2
|
-
// handlers/diagnostic-injection.ts, and handlers/workspace-recovery.ts.
|
|
3
|
-
|
|
4
|
-
import * as path from "node:path";
|
|
5
|
-
import { clearTsconfigCache } from "./config/tsconfig-scope.ts";
|
|
6
|
-
import type { FileEvent } from "./config/types.ts";
|
|
7
|
-
import { syncWorkspaceSentinelSnapshot } from "./diagnostics/workspace-sentinels.ts";
|
|
8
|
-
import type { LspRuntimeState } from "./session/lsp-state.ts";
|
|
9
|
-
|
|
10
|
-
/** Update the state's workspace-change tracking fields after a file modification. */
|
|
11
|
-
export function markWorkspaceChange(state: LspRuntimeState): void {
|
|
12
|
-
state.lastWorkspaceChangeAt = Date.now();
|
|
13
|
-
state.staleSuspected = true;
|
|
14
|
-
state.lastDiagnosticsFingerprint = null;
|
|
15
|
-
state.currentContextToken = null;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/** Notify the LSP manager about file changes and reset pull-diagnostic state. */
|
|
19
|
-
export function softRecoverWorkspaceChanges(state: LspRuntimeState, changes: FileEvent[]): boolean {
|
|
20
|
-
if (!state.manager || changes.length === 0) return false;
|
|
21
|
-
|
|
22
|
-
clearTsconfigCache();
|
|
23
|
-
state.manager.clearAllPullResultIds();
|
|
24
|
-
state.manager.notifyWorkspaceFileChanges(changes);
|
|
25
|
-
markWorkspaceChange(state);
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** Sync the sentinel-file snapshot and recover from any detected changes. */
|
|
30
|
-
export function refreshWorkspaceSentinels(state: LspRuntimeState, cwd: string): boolean {
|
|
31
|
-
const { snapshot, changes } = syncWorkspaceSentinelSnapshot(cwd, state.sentinelSnapshot);
|
|
32
|
-
state.sentinelSnapshot = snapshot;
|
|
33
|
-
return softRecoverWorkspaceChanges(state, changes);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/** Check whether a given file path's extension suggests tsconfig-scope invalidation. */
|
|
37
|
-
export function shouldInvalidateTsconfigScopeCache(filePath: string): boolean {
|
|
38
|
-
const ext = path.extname(filePath).toLowerCase();
|
|
39
|
-
return ext === ".json" || ext === ".jsonc";
|
|
40
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./tree-sitter.ts";
|