@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
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
// LSP settings registration for the code-intelligence umbrella extension.
|
|
2
|
+
//
|
|
3
|
+
// Always-on LSP policy: the global `lsp.enabled` and `lsp.active` keys
|
|
4
|
+
// are deprecated and ignored. Per-language disable via
|
|
5
|
+
// `lsp.servers.<language>.enabled: false` is the only supported opt-out.
|
|
6
|
+
//
|
|
7
|
+
// This settings section provides:
|
|
8
|
+
// - severity control
|
|
9
|
+
// - excluded patterns
|
|
10
|
+
// - a "Disabled Servers" submenu that writes per-language disable config
|
|
11
|
+
|
|
12
|
+
import { CONFIG_DIR_NAME, getSettingsListTheme } from "@earendil-works/pi-coding-agent";
|
|
13
|
+
import type { SettingItem } from "@earendil-works/pi-tui";
|
|
14
|
+
import { Container, Key, matchesKey, SettingsList, Text } from "@earendil-works/pi-tui";
|
|
15
|
+
|
|
16
|
+
type SettingsScope = "project" | "global";
|
|
17
|
+
|
|
18
|
+
import {
|
|
19
|
+
loadSupiConfigForScope,
|
|
20
|
+
registerConfigSettings,
|
|
21
|
+
writeSupiConfig,
|
|
22
|
+
} from "@mrclrchtr/supi-core/config";
|
|
23
|
+
import { type LspSettings, loadConfig } from "@mrclrchtr/supi-lsp/api";
|
|
24
|
+
|
|
25
|
+
const LSP_DEFAULTS: LspSettings = {
|
|
26
|
+
enabled: true,
|
|
27
|
+
severity: 1,
|
|
28
|
+
active: [],
|
|
29
|
+
exclude: [],
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
function severityLabel(severity: number): string {
|
|
33
|
+
switch (severity) {
|
|
34
|
+
case 1:
|
|
35
|
+
return "errors";
|
|
36
|
+
case 2:
|
|
37
|
+
return "warnings";
|
|
38
|
+
case 3:
|
|
39
|
+
return "info";
|
|
40
|
+
case 4:
|
|
41
|
+
return "hints";
|
|
42
|
+
default:
|
|
43
|
+
return "errors";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Discover configured servers from the defaults + effective LSP config. */
|
|
48
|
+
function getConfiguredServers(cwd: string): string[] {
|
|
49
|
+
try {
|
|
50
|
+
const config = loadConfig(cwd);
|
|
51
|
+
return Object.keys(config.servers);
|
|
52
|
+
} catch {
|
|
53
|
+
return ["typescript"];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Load the raw LSP section for a single scope to inspect the currently
|
|
59
|
+
* configured disabled servers from the persisted config.
|
|
60
|
+
*/
|
|
61
|
+
function getDisabledServersFromConfig(scope: SettingsScope, cwd: string): Set<string> {
|
|
62
|
+
const section = loadSupiConfigForScope(
|
|
63
|
+
"lsp",
|
|
64
|
+
cwd,
|
|
65
|
+
{ servers: {} as Record<string, { enabled?: boolean }> },
|
|
66
|
+
{ scope },
|
|
67
|
+
);
|
|
68
|
+
const servers = section.servers as Record<string, { enabled?: boolean }> | undefined;
|
|
69
|
+
const disabled = new Set<string>();
|
|
70
|
+
if (servers) {
|
|
71
|
+
for (const [name, srv] of Object.entries(servers)) {
|
|
72
|
+
if (srv.enabled === false) disabled.add(name);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return disabled;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function registerLspSettings(): void {
|
|
79
|
+
registerConfigSettings({
|
|
80
|
+
id: "lsp",
|
|
81
|
+
label: "LSP",
|
|
82
|
+
section: "lsp",
|
|
83
|
+
defaults: LSP_DEFAULTS,
|
|
84
|
+
buildItems: (settings, scope, cwd) => buildLspSettingItems(settings, scope, cwd),
|
|
85
|
+
// biome-ignore lint/complexity/useMaxParams: registerConfigSettings callback signature
|
|
86
|
+
persistChange: (_scope, _cwd, settingId, value, helpers) => {
|
|
87
|
+
switch (settingId) {
|
|
88
|
+
case "severity": {
|
|
89
|
+
const num = Number.parseInt(value.split(" ")[0] ?? "1", 10);
|
|
90
|
+
helpers.set("severity", Number.isNaN(num) ? 1 : num);
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
case "exclude": {
|
|
94
|
+
const patterns = value
|
|
95
|
+
.split(",")
|
|
96
|
+
.map((s) => s.trim())
|
|
97
|
+
.filter(Boolean);
|
|
98
|
+
if (patterns.length > 0) helpers.set("exclude", patterns);
|
|
99
|
+
else helpers.unset("exclude");
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function buildLspSettingItems(
|
|
108
|
+
settings: LspSettings,
|
|
109
|
+
scope: "project" | "global",
|
|
110
|
+
cwd: string,
|
|
111
|
+
): SettingItem[] {
|
|
112
|
+
return [
|
|
113
|
+
{
|
|
114
|
+
id: "severity",
|
|
115
|
+
label: "Inline Severity",
|
|
116
|
+
description: "Minimum diagnostic severity to show inline (1=errors, 4=hints)",
|
|
117
|
+
currentValue: `${settings.severity} (${severityLabel(settings.severity)})`,
|
|
118
|
+
values: ["1 (errors)", "2 (warnings)", "3 (info)", "4 (hints)"],
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: "disabled_servers",
|
|
122
|
+
label: "Disabled Servers",
|
|
123
|
+
description: "Press Enter to choose which language servers to disable",
|
|
124
|
+
currentValue: renderDisabledServersLabel(scope, cwd),
|
|
125
|
+
submenu: (_currentValue, done) => createDisabledServersSubmenu(scope, cwd, done),
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: "exclude",
|
|
129
|
+
label: "Exclude Patterns",
|
|
130
|
+
description: "Gitignore patterns to suppress LSP diagnostics",
|
|
131
|
+
currentValue: settings.exclude.length > 0 ? settings.exclude.join(", ") : "none",
|
|
132
|
+
submenu: (_currentValue, done) => createExcludeSubmenu(scope, cwd, settings, done),
|
|
133
|
+
},
|
|
134
|
+
];
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function renderDisabledServersLabel(scope: SettingsScope, cwd: string): string {
|
|
138
|
+
const disabled = getDisabledServersFromConfig(scope, cwd);
|
|
139
|
+
return disabled.size > 0 ? [...disabled].sort().join(", ") : "none disabled";
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function createDisabledServersSubmenu(
|
|
143
|
+
scope: SettingsScope,
|
|
144
|
+
cwd: string,
|
|
145
|
+
done: (value?: string) => void,
|
|
146
|
+
) {
|
|
147
|
+
const allServers = getConfiguredServers(cwd);
|
|
148
|
+
const disabledServers = getDisabledServersFromConfig(scope, cwd);
|
|
149
|
+
|
|
150
|
+
const items: SettingItem[] = allServers.map((name) => ({
|
|
151
|
+
id: name,
|
|
152
|
+
label: name,
|
|
153
|
+
currentValue: disabledServers.has(name) ? "disabled" : "enabled",
|
|
154
|
+
values: ["enabled", "disabled"],
|
|
155
|
+
}));
|
|
156
|
+
|
|
157
|
+
let dirty = false;
|
|
158
|
+
const container = new Container();
|
|
159
|
+
const header = new Text("Disabled Servers — per-language opt-out", 0, 0);
|
|
160
|
+
container.addChild(header);
|
|
161
|
+
const footer = new Text(
|
|
162
|
+
"Marking a server as disabled writes lsp.servers.<lang>.enabled: false for this scope",
|
|
163
|
+
0,
|
|
164
|
+
0,
|
|
165
|
+
);
|
|
166
|
+
container.addChild(footer);
|
|
167
|
+
|
|
168
|
+
const settingsList = new SettingsList(
|
|
169
|
+
items,
|
|
170
|
+
Math.min(items.length + 3, 15),
|
|
171
|
+
getSettingsListTheme(),
|
|
172
|
+
(id, newValue) => {
|
|
173
|
+
const idx = items.findIndex((i) => i.id === id);
|
|
174
|
+
if (idx >= 0 && items[idx].currentValue !== newValue) {
|
|
175
|
+
dirty = true;
|
|
176
|
+
items[idx].currentValue = newValue;
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
() => {},
|
|
180
|
+
{ enableSearch: true },
|
|
181
|
+
);
|
|
182
|
+
container.addChild(settingsList);
|
|
183
|
+
|
|
184
|
+
return {
|
|
185
|
+
render: (width: number) => container.render(width),
|
|
186
|
+
invalidate: () => container.invalidate(),
|
|
187
|
+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: single event handler dispatching keyboard shortcuts for the Disabled Servers submenu
|
|
188
|
+
handleInput: (data: string) => {
|
|
189
|
+
if (matchesKey(data, Key.escape)) {
|
|
190
|
+
if (!dirty) {
|
|
191
|
+
done();
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
// Write per-language enabled/disabled into lsp.servers
|
|
195
|
+
const currentSection = loadSupiConfigForScope(
|
|
196
|
+
"lsp",
|
|
197
|
+
cwd,
|
|
198
|
+
{ servers: {} as Record<string, { enabled?: boolean }> },
|
|
199
|
+
{ scope },
|
|
200
|
+
);
|
|
201
|
+
const servers =
|
|
202
|
+
(currentSection.servers as Record<string, Record<string, unknown>> | undefined) ?? {};
|
|
203
|
+
|
|
204
|
+
for (const item of items) {
|
|
205
|
+
if (item.currentValue === "disabled") {
|
|
206
|
+
servers[item.id] = { ...(servers[item.id] ?? {}), enabled: false };
|
|
207
|
+
} else {
|
|
208
|
+
const srv = servers[item.id];
|
|
209
|
+
if (srv) {
|
|
210
|
+
delete srv.enabled;
|
|
211
|
+
// If only `enabled` was the property, remove the whole entry
|
|
212
|
+
if (Object.keys(srv).length === 0) {
|
|
213
|
+
delete servers[item.id];
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
writeSupiConfig({ section: "lsp", scope, cwd }, { servers });
|
|
220
|
+
done();
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
settingsList.handleInput?.(data);
|
|
224
|
+
return true;
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function createExcludeSubmenu(
|
|
230
|
+
_scope: "project" | "global",
|
|
231
|
+
_cwd: string,
|
|
232
|
+
settings: LspSettings,
|
|
233
|
+
done: (value?: string) => void,
|
|
234
|
+
) {
|
|
235
|
+
const items: SettingItem[] = settings.exclude.map((pattern) => ({
|
|
236
|
+
id: pattern,
|
|
237
|
+
label: pattern,
|
|
238
|
+
currentValue: "enabled",
|
|
239
|
+
values: ["enabled", "disabled"],
|
|
240
|
+
}));
|
|
241
|
+
|
|
242
|
+
let dirty = false;
|
|
243
|
+
const container = new Container();
|
|
244
|
+
const header = new Text("Exclude Patterns — toggle off to remove", 0, 0);
|
|
245
|
+
container.addChild(header);
|
|
246
|
+
|
|
247
|
+
const footer = new Text(
|
|
248
|
+
`Add new patterns in ${CONFIG_DIR_NAME}/supi/config.json under lsp.exclude`,
|
|
249
|
+
0,
|
|
250
|
+
0,
|
|
251
|
+
);
|
|
252
|
+
container.addChild(footer);
|
|
253
|
+
|
|
254
|
+
const settingsList = new SettingsList(
|
|
255
|
+
items,
|
|
256
|
+
Math.min(items.length + 3, 15),
|
|
257
|
+
getSettingsListTheme(),
|
|
258
|
+
(id, newValue) => {
|
|
259
|
+
const idx = items.findIndex((i) => i.id === id);
|
|
260
|
+
if (idx >= 0 && items[idx].currentValue !== newValue) {
|
|
261
|
+
dirty = true;
|
|
262
|
+
items[idx].currentValue = newValue;
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
() => {},
|
|
266
|
+
);
|
|
267
|
+
container.addChild(settingsList);
|
|
268
|
+
|
|
269
|
+
return {
|
|
270
|
+
render: (width: number) => container.render(width),
|
|
271
|
+
invalidate: () => container.invalidate(),
|
|
272
|
+
handleInput: (data: string) => {
|
|
273
|
+
if (matchesKey(data, Key.escape)) {
|
|
274
|
+
if (!dirty) {
|
|
275
|
+
done();
|
|
276
|
+
return true;
|
|
277
|
+
}
|
|
278
|
+
const enabled = items.filter((i) => i.currentValue === "enabled").map((i) => i.id);
|
|
279
|
+
done(enabled.join(", ") || undefined);
|
|
280
|
+
return true;
|
|
281
|
+
}
|
|
282
|
+
settingsList.handleInput?.(data);
|
|
283
|
+
return true;
|
|
284
|
+
},
|
|
285
|
+
};
|
|
286
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Umbrella LSP adapter state for supi-code-intelligence.
|
|
2
|
+
//
|
|
3
|
+
// Mirrors the shape of supi-lsp's LspRuntimeState but owns its lifecycle
|
|
4
|
+
// through LspRuntimeController from @mrclrchtr/supi-lsp/api.
|
|
5
|
+
|
|
6
|
+
import type { LspRuntimeController } from "@mrclrchtr/supi-lsp/api";
|
|
7
|
+
|
|
8
|
+
/** LSP status overlay UI state (handle + close). */
|
|
9
|
+
export interface LspInspectorState {
|
|
10
|
+
handle: (() => void) | null;
|
|
11
|
+
close: (() => void) | null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* In-memory state for the umbrella LSP adapter.
|
|
16
|
+
*
|
|
17
|
+
* Wraps the LspRuntimeController and tracks session-level state
|
|
18
|
+
* for diagnostic injection, stale detection, and UI updates.
|
|
19
|
+
*/
|
|
20
|
+
export interface LspAdapterState {
|
|
21
|
+
controller: LspRuntimeController | null;
|
|
22
|
+
inlineSeverity: number;
|
|
23
|
+
inspector: LspInspectorState;
|
|
24
|
+
lastDiagnosticsFingerprint: string | null;
|
|
25
|
+
currentContextToken: string | null;
|
|
26
|
+
contextCounter: number;
|
|
27
|
+
lspActive: boolean;
|
|
28
|
+
staleSuspected: boolean;
|
|
29
|
+
lastWorkspaceChangeAt: number;
|
|
30
|
+
sentinelSnapshot: Map<string, number>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function createLspAdapterState(): LspAdapterState {
|
|
34
|
+
return {
|
|
35
|
+
controller: null,
|
|
36
|
+
inlineSeverity: 1,
|
|
37
|
+
inspector: { handle: null, close: null },
|
|
38
|
+
lastDiagnosticsFingerprint: null,
|
|
39
|
+
currentContextToken: null,
|
|
40
|
+
contextCounter: 0,
|
|
41
|
+
lspActive: false,
|
|
42
|
+
staleSuspected: false,
|
|
43
|
+
lastWorkspaceChangeAt: 0,
|
|
44
|
+
sentinelSnapshot: new Map(),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utilities for working with LSP Diagnostic types.
|
|
3
|
+
*
|
|
4
|
+
* vscode-languageserver-types v3.18.0 widened Diagnostic.message from
|
|
5
|
+
* `string` to `string | MarkupContent`. Use these helpers to safely
|
|
6
|
+
* extract the string representation without repeating the cast.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { Diagnostic } from "@mrclrchtr/supi-lsp/api";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Return the plain-text message from a Diagnostic, handling both
|
|
13
|
+
* the legacy `string` and new `MarkupContent` forms.
|
|
14
|
+
*/
|
|
15
|
+
export function diagnosticMessageString(d: Diagnostic): string {
|
|
16
|
+
return typeof d.message === "string" ? d.message : d.message.value;
|
|
17
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Tree-sitter session lifecycle — uses TreeSitterRuntimeController from @mrclrchtr/supi-tree-sitter/api.
|
|
2
|
+
|
|
3
|
+
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
4
|
+
import { getDefaultWorkspaceRuntime } from "@mrclrchtr/supi-code-runtime/api";
|
|
5
|
+
import { TreeSitterRuntimeController } from "@mrclrchtr/supi-tree-sitter/api";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Tree-sitter adapter state for the umbrella extension.
|
|
9
|
+
*/
|
|
10
|
+
export interface TsAdapterState {
|
|
11
|
+
controller: TreeSitterRuntimeController | null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function createTsAdapterState(): TsAdapterState {
|
|
15
|
+
return { controller: null };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Register Tree-sitter session lifecycle handlers.
|
|
20
|
+
*
|
|
21
|
+
* - session_start: creates TreeSitterRuntimeController, starts it, registers tools
|
|
22
|
+
* - session_shutdown: shuts down the controller
|
|
23
|
+
*/
|
|
24
|
+
export function registerTsSessionLifecycle(pi: ExtensionAPI, state: TsAdapterState): void {
|
|
25
|
+
pi.on("session_start", async (_event, ctx: ExtensionContext) => {
|
|
26
|
+
const cwd = ctx.cwd;
|
|
27
|
+
const runtime = getDefaultWorkspaceRuntime();
|
|
28
|
+
|
|
29
|
+
// Shut down any existing controller
|
|
30
|
+
if (state.controller) {
|
|
31
|
+
await state.controller.shutdown();
|
|
32
|
+
state.controller = null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const controller = new TreeSitterRuntimeController(cwd, runtime);
|
|
36
|
+
const result = await controller.start();
|
|
37
|
+
|
|
38
|
+
if (result.kind === "ready") {
|
|
39
|
+
state.controller = controller;
|
|
40
|
+
} else {
|
|
41
|
+
await controller.shutdown();
|
|
42
|
+
state.controller = null;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
pi.on("session_shutdown", async () => {
|
|
47
|
+
if (state.controller) {
|
|
48
|
+
await state.controller.shutdown();
|
|
49
|
+
state.controller = null;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool executor for code_find.
|
|
3
|
+
*
|
|
4
|
+
* Unified ranked code search with strict mode dispatch:
|
|
5
|
+
* - text (default): literal ripgrep
|
|
6
|
+
* - regex: ripgrep regex
|
|
7
|
+
* - ast: tree-sitter structured search
|
|
8
|
+
* - semantic: LSP workspace symbols
|
|
9
|
+
*
|
|
10
|
+
* Thin executor: validates params via pipeline, then delegates all
|
|
11
|
+
* modes to the pattern use-case.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type { CodeIntelResult, CodeIntelToolExecCtx } from "../../types/index.ts";
|
|
15
|
+
import { findModeKindRules } from "../infra/cross-field.ts";
|
|
16
|
+
import { unavailableSearchDetails } from "../infra/error-results.ts";
|
|
17
|
+
import {
|
|
18
|
+
gateSemanticReadiness,
|
|
19
|
+
resolveScopeParam,
|
|
20
|
+
runPipe,
|
|
21
|
+
validateParams,
|
|
22
|
+
} from "../infra/pipeline.ts";
|
|
23
|
+
import { emitToolProgress } from "../infra/progress.ts";
|
|
24
|
+
import { renderSemanticReadinessTimeout } from "../infra/readiness-message.ts";
|
|
25
|
+
import { executePattern } from "./orchestrate.ts";
|
|
26
|
+
|
|
27
|
+
export interface CodeFindToolParams {
|
|
28
|
+
query: string;
|
|
29
|
+
scope?: string;
|
|
30
|
+
mode?: "text" | "regex" | "ast" | "semantic";
|
|
31
|
+
kind?:
|
|
32
|
+
| "definition"
|
|
33
|
+
| "import"
|
|
34
|
+
| "export"
|
|
35
|
+
| "call"
|
|
36
|
+
| "type"
|
|
37
|
+
| "interface"
|
|
38
|
+
| "class"
|
|
39
|
+
| "method"
|
|
40
|
+
| "enum"
|
|
41
|
+
| "test";
|
|
42
|
+
contextLines?: number;
|
|
43
|
+
maxResults?: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export async function executeFindTool(
|
|
47
|
+
params: CodeFindToolParams,
|
|
48
|
+
ctx: CodeIntelToolExecCtx,
|
|
49
|
+
): Promise<CodeIntelResult> {
|
|
50
|
+
if (!params.query || params.query.trim().length === 0) {
|
|
51
|
+
return {
|
|
52
|
+
content: "**Error:** `code_find` requires a non-empty `query` parameter.",
|
|
53
|
+
details: unavailableSearchDetails(params.scope ?? null, [
|
|
54
|
+
"Provide a non-empty `query` parameter",
|
|
55
|
+
]),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
emitToolProgress(ctx.onUpdate, `code_find: searching for "${params.query}"...`);
|
|
60
|
+
|
|
61
|
+
const mode = params.mode ?? "text";
|
|
62
|
+
const needsSemanticReadiness = mode === "semantic";
|
|
63
|
+
|
|
64
|
+
return runPipe(
|
|
65
|
+
params,
|
|
66
|
+
ctx,
|
|
67
|
+
[
|
|
68
|
+
validateParams(findModeKindRules(), (msg) => ({
|
|
69
|
+
content: msg,
|
|
70
|
+
details: unavailableSearchDetails(params.scope ?? null, [
|
|
71
|
+
'Use `mode: "ast"` with `kind`, or remove `kind` for text/regex/semantic search',
|
|
72
|
+
]),
|
|
73
|
+
})),
|
|
74
|
+
resolveScopeParam((reason) => ({
|
|
75
|
+
content: `**Error:** ${reason}`,
|
|
76
|
+
details: unavailableSearchDetails(params.scope ?? null, [
|
|
77
|
+
"Verify the `scope` path exists and is within the workspace",
|
|
78
|
+
]),
|
|
79
|
+
})),
|
|
80
|
+
...(needsSemanticReadiness
|
|
81
|
+
? [
|
|
82
|
+
gateSemanticReadiness("code_find", {
|
|
83
|
+
onTimeout: () => ({
|
|
84
|
+
content: renderSemanticReadinessTimeout("code_find", 15_000),
|
|
85
|
+
details: unavailableSearchDetails(params.scope ?? null, [
|
|
86
|
+
"Retry shortly or check `code_health`",
|
|
87
|
+
]),
|
|
88
|
+
}),
|
|
89
|
+
throwOnUnavailable: true,
|
|
90
|
+
}),
|
|
91
|
+
]
|
|
92
|
+
: []),
|
|
93
|
+
],
|
|
94
|
+
async (p, c) => {
|
|
95
|
+
emitToolProgress(c.onUpdate, `code_find: ${mode} mode...`);
|
|
96
|
+
|
|
97
|
+
// AST mode requires structural provider
|
|
98
|
+
if (mode === "ast" && !c.session.getStructuralProvider()) {
|
|
99
|
+
throw new Error(
|
|
100
|
+
"code_find AST search is unavailable because no structural/tree-sitter provider is active for this workspace.",
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return executePattern(
|
|
105
|
+
{
|
|
106
|
+
pattern: p.query,
|
|
107
|
+
path: p.scope ?? c.cwd,
|
|
108
|
+
regex: mode === "regex",
|
|
109
|
+
kind: p.kind,
|
|
110
|
+
mode,
|
|
111
|
+
maxResults: p.maxResults ?? 8,
|
|
112
|
+
contextLines: p.contextLines ?? 1,
|
|
113
|
+
},
|
|
114
|
+
{ cwd: c.cwd, provider: c.session.getProvider(), signal: c.signal },
|
|
115
|
+
);
|
|
116
|
+
},
|
|
117
|
+
);
|
|
118
|
+
}
|