@mrclrchtr/supi-code-intelligence 1.16.1 → 2.0.1
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/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,182 +0,0 @@
|
|
|
1
|
-
// Diagnostic injection handlers — before_agent_start and context.
|
|
2
|
-
//
|
|
3
|
-
// Extracted from lsp.ts to keep each orchestration concern in its own module.
|
|
4
|
-
|
|
5
|
-
import type {
|
|
6
|
-
BeforeAgentStartEvent,
|
|
7
|
-
BeforeAgentStartEventResult,
|
|
8
|
-
ContextEvent,
|
|
9
|
-
ExtensionAPI,
|
|
10
|
-
ExtensionContext,
|
|
11
|
-
} from "@earendil-works/pi-coding-agent";
|
|
12
|
-
import { pruneAndReorderContextMessages, restorePromptContent } from "@mrclrchtr/supi-core/context";
|
|
13
|
-
import type { Diagnostic } from "../config/types.ts";
|
|
14
|
-
import {
|
|
15
|
-
diagnosticsContextFingerprint,
|
|
16
|
-
formatDiagnosticsContext,
|
|
17
|
-
MAX_DETAILED_DIAGNOSTICS,
|
|
18
|
-
} from "../diagnostics/diagnostic-context.ts";
|
|
19
|
-
import { formatDiagnosticsDisplayContent } from "../diagnostics/diagnostic-display.ts";
|
|
20
|
-
import { assessStaleDiagnostics } from "../diagnostics/stale-diagnostics.ts";
|
|
21
|
-
// Force re-open files with module-resolution errors
|
|
22
|
-
import { forceResyncStaleModuleFiles } from "../manager/manager-stale-resync.ts";
|
|
23
|
-
import type { OutstandingDiagnosticSummaryEntry } from "../manager/manager-types.ts";
|
|
24
|
-
import {
|
|
25
|
-
ensureLspToolsActive,
|
|
26
|
-
type LspRuntimeState,
|
|
27
|
-
refreshProjectServers,
|
|
28
|
-
removeLspTools,
|
|
29
|
-
} from "../session/lsp-state.ts";
|
|
30
|
-
import { persistLspInactiveState } from "../session/tree-persist.ts";
|
|
31
|
-
import { updateLspUi } from "../ui/ui.ts";
|
|
32
|
-
import { refreshWorkspaceSentinels } from "../workspace-change.ts";
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Register handlers for before_agent_start (diagnostic injection) and context
|
|
36
|
-
* (lsp-context message pruning / prompt-content restoration).
|
|
37
|
-
*/
|
|
38
|
-
export function registerDiagnosticInjectionHandlers(
|
|
39
|
-
pi: ExtensionAPI,
|
|
40
|
-
state: LspRuntimeState,
|
|
41
|
-
): void {
|
|
42
|
-
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: before_agent_start coordinates sentinel recovery, pruning, refresh, and diagnostic injection.
|
|
43
|
-
pi.on("before_agent_start", async (_event: BeforeAgentStartEvent, ctx: ExtensionContext) => {
|
|
44
|
-
if (!state.manager || !state.lspActive) {
|
|
45
|
-
removeLspTools(pi);
|
|
46
|
-
if (!state.manager && state.lspActive) {
|
|
47
|
-
persistLspInactiveState(pi, state);
|
|
48
|
-
}
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
ensureLspToolsActive(pi);
|
|
53
|
-
|
|
54
|
-
refreshWorkspaceSentinels(state, ctx.cwd);
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Two-pass prune/refresh pattern:
|
|
58
|
-
*
|
|
59
|
-
* 1. Prune files deleted since the last turn and send didClose.
|
|
60
|
-
* 2. Re-sync remaining open docs and wait for diagnostics to settle.
|
|
61
|
-
* 3. Prune *again* — late publishDiagnostics notifications (already
|
|
62
|
-
* in-flight when step 1 ran) may have re-created stale entries for
|
|
63
|
-
* files that no longer exist. `getAllDiagnostics()` also filters
|
|
64
|
-
* by existence, so this second pass is belt-and-suspenders.
|
|
65
|
-
*/
|
|
66
|
-
state.manager.pruneMissingFiles();
|
|
67
|
-
try {
|
|
68
|
-
await state.manager.refreshOpenDiagnostics();
|
|
69
|
-
} catch {
|
|
70
|
-
// Refresh failures must not prevent agent startup
|
|
71
|
-
}
|
|
72
|
-
state.manager.pruneMissingFiles();
|
|
73
|
-
|
|
74
|
-
try {
|
|
75
|
-
await forceResyncStaleModuleFiles(state.manager, ctx.cwd);
|
|
76
|
-
} catch {
|
|
77
|
-
// Best-effort: don't fail the agent turn
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
refreshProjectServers(state);
|
|
81
|
-
updateLspUi(ctx, state.manager, state.inlineSeverity, state.projectServers);
|
|
82
|
-
|
|
83
|
-
const diagnostics = state.manager.getOutstandingDiagnosticSummary(state.inlineSeverity);
|
|
84
|
-
const totalDiags = diagnostics.reduce((sum, d) => sum + d.total, 0);
|
|
85
|
-
const detailed =
|
|
86
|
-
totalDiags <= MAX_DETAILED_DIAGNOSTICS
|
|
87
|
-
? state.manager.getOutstandingDiagnostics(state.inlineSeverity)
|
|
88
|
-
: undefined;
|
|
89
|
-
const staleAssessment = state.staleSuspected
|
|
90
|
-
? assessStaleDiagnostics(state.manager.getOutstandingDiagnostics(4))
|
|
91
|
-
: { suspected: false, matchedFiles: [], warning: null };
|
|
92
|
-
state.staleSuspected = staleAssessment.suspected;
|
|
93
|
-
|
|
94
|
-
const staleWarning = staleAssessment.suspected ? staleAssessment.warning : null;
|
|
95
|
-
const content = formatDiagnosticsContext(diagnostics, 3, detailed, staleWarning);
|
|
96
|
-
const fingerprint = diagnosticsContextFingerprint(content);
|
|
97
|
-
|
|
98
|
-
if (!content) {
|
|
99
|
-
state.lastDiagnosticsFingerprint = null;
|
|
100
|
-
state.currentContextToken = null;
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (fingerprint === state.lastDiagnosticsFingerprint) {
|
|
105
|
-
state.currentContextToken = null;
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
state.lastDiagnosticsFingerprint = fingerprint;
|
|
110
|
-
state.currentContextToken = `lsp-context-${++state.contextCounter}`;
|
|
111
|
-
|
|
112
|
-
return buildDiagnosticResult(
|
|
113
|
-
diagnostics,
|
|
114
|
-
detailed,
|
|
115
|
-
state.inlineSeverity,
|
|
116
|
-
state.currentContextToken,
|
|
117
|
-
staleWarning,
|
|
118
|
-
);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
pi.on("context", (event: ContextEvent) => {
|
|
122
|
-
const messages = pruneAndReorderContextMessages(
|
|
123
|
-
event.messages as Array<{
|
|
124
|
-
role?: string;
|
|
125
|
-
customType?: string;
|
|
126
|
-
content?: unknown;
|
|
127
|
-
details?: unknown;
|
|
128
|
-
}>,
|
|
129
|
-
"lsp-context",
|
|
130
|
-
state.currentContextToken,
|
|
131
|
-
);
|
|
132
|
-
const contextMessages = restorePromptContent(
|
|
133
|
-
messages,
|
|
134
|
-
"lsp-context",
|
|
135
|
-
state.currentContextToken,
|
|
136
|
-
) as typeof event.messages;
|
|
137
|
-
|
|
138
|
-
if (
|
|
139
|
-
contextMessages.length === event.messages.length &&
|
|
140
|
-
contextMessages.every((message, index) => message === event.messages[index])
|
|
141
|
-
) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
return { messages: contextMessages };
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/** Build the `lsp-context` custom message used to surface outstanding diagnostics. */
|
|
149
|
-
// biome-ignore lint/complexity/useMaxParams: wrapper groups the prompt payload fields in one place.
|
|
150
|
-
function buildDiagnosticResult(
|
|
151
|
-
diagnostics: OutstandingDiagnosticSummaryEntry[],
|
|
152
|
-
detailed:
|
|
153
|
-
| {
|
|
154
|
-
file: string;
|
|
155
|
-
diagnostics: Diagnostic[];
|
|
156
|
-
}[]
|
|
157
|
-
| undefined,
|
|
158
|
-
severity: number,
|
|
159
|
-
token: string,
|
|
160
|
-
staleWarning?: string | null,
|
|
161
|
-
): BeforeAgentStartEventResult {
|
|
162
|
-
return {
|
|
163
|
-
message: {
|
|
164
|
-
customType: "lsp-context",
|
|
165
|
-
content: formatDiagnosticsDisplayContent(diagnostics, detailed),
|
|
166
|
-
display: true,
|
|
167
|
-
details: {
|
|
168
|
-
contextToken: token,
|
|
169
|
-
promptContent: formatDiagnosticsContext(diagnostics, 3, detailed, staleWarning),
|
|
170
|
-
inlineSeverity: severity,
|
|
171
|
-
...(staleWarning ? { staleWarning } : {}),
|
|
172
|
-
diagnostics: diagnostics.map((d) => ({
|
|
173
|
-
file: d.file,
|
|
174
|
-
errors: d.errors,
|
|
175
|
-
warnings: d.warnings,
|
|
176
|
-
information: d.information,
|
|
177
|
-
hints: d.hints,
|
|
178
|
-
})),
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
};
|
|
182
|
-
}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
// Session lifecycle handlers — session_start, session_shutdown, and agent_end.
|
|
2
|
-
//
|
|
3
|
-
// Extracted from lsp.ts to keep each orchestration concern in its own module.
|
|
4
|
-
|
|
5
|
-
import type {
|
|
6
|
-
AgentEndEvent,
|
|
7
|
-
ExtensionAPI,
|
|
8
|
-
ExtensionContext,
|
|
9
|
-
SessionStartEvent,
|
|
10
|
-
} from "@earendil-works/pi-coding-agent";
|
|
11
|
-
import type { WorkspaceRuntime } from "@mrclrchtr/supi-code-runtime/api";
|
|
12
|
-
import { loadConfig, resolveLanguageAlias } from "../config/config.ts";
|
|
13
|
-
import { clearTsconfigCache } from "../config/tsconfig-scope.ts";
|
|
14
|
-
import { scanWorkspaceSentinels } from "../diagnostics/workspace-sentinels.ts";
|
|
15
|
-
import { LspManager } from "../manager/manager.ts";
|
|
16
|
-
import {
|
|
17
|
-
disableLspState,
|
|
18
|
-
ensureLspToolsActive,
|
|
19
|
-
type LspRuntimeState,
|
|
20
|
-
refreshProjectServers,
|
|
21
|
-
} from "../session/lsp-state.ts";
|
|
22
|
-
import {
|
|
23
|
-
registerLspCapabilities,
|
|
24
|
-
unregisterLspCapabilities,
|
|
25
|
-
} from "../session/runtime-registration.ts";
|
|
26
|
-
import {
|
|
27
|
-
scanMissingServers,
|
|
28
|
-
scanProjectCapabilities,
|
|
29
|
-
startDetectedServers,
|
|
30
|
-
} from "../session/scanner.ts";
|
|
31
|
-
import {
|
|
32
|
-
clearSessionLspService,
|
|
33
|
-
SessionLspService,
|
|
34
|
-
setSessionLspServiceState,
|
|
35
|
-
} from "../session/service-registry.ts";
|
|
36
|
-
import { loadLspSettings } from "../session/settings-registration.ts";
|
|
37
|
-
import { persistLspActiveState, persistLspInactiveState } from "../session/tree-persist.ts";
|
|
38
|
-
import { buildLspToolPromptSurfaces } from "../tool/guidance.ts";
|
|
39
|
-
import { registerLspTools } from "../tool/register-tools.ts";
|
|
40
|
-
import { updateLspUi } from "../ui/ui.ts";
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Register session lifecycle handlers (start, shutdown, and agent-end cleanup).
|
|
44
|
-
*
|
|
45
|
-
* - `session_start`: initialises the LspManager, starts detected servers, wires
|
|
46
|
-
* dynamic tool guidance, publishes runtime capabilities, and syncs UI state.
|
|
47
|
-
* - `session_shutdown`: tears down the manager and clears runtime state.
|
|
48
|
-
* - `agent_end`: refreshes project-server info and updates the LSP status UI.
|
|
49
|
-
*/
|
|
50
|
-
export function registerSessionLifecycleHandlers(
|
|
51
|
-
pi: ExtensionAPI,
|
|
52
|
-
state: LspRuntimeState,
|
|
53
|
-
runtime: WorkspaceRuntime,
|
|
54
|
-
): void {
|
|
55
|
-
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: session_start orchestrates setup, server detection, settings, and persistence.
|
|
56
|
-
pi.on("session_start", async (_event: SessionStartEvent, ctx: ExtensionContext) => {
|
|
57
|
-
if (state.manager) {
|
|
58
|
-
clearSessionLspService(state.manager.getCwd());
|
|
59
|
-
await state.manager.shutdownAll();
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const cwd = ctx.cwd;
|
|
63
|
-
clearTsconfigCache();
|
|
64
|
-
const lspSettings = loadLspSettings(cwd);
|
|
65
|
-
|
|
66
|
-
if (!lspSettings.enabled) {
|
|
67
|
-
clearSessionLspService(cwd);
|
|
68
|
-
disableLspState(pi, state);
|
|
69
|
-
persistLspInactiveState(pi, state);
|
|
70
|
-
setSessionLspServiceState(cwd, { kind: "disabled" });
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
state.inlineSeverity = lspSettings.severity;
|
|
75
|
-
|
|
76
|
-
const config = loadConfig(cwd);
|
|
77
|
-
|
|
78
|
-
// Apply server allowlist filter from supi shared config
|
|
79
|
-
if (lspSettings.active.length > 0) {
|
|
80
|
-
const allowList = new Set(lspSettings.active.map(resolveLanguageAlias));
|
|
81
|
-
for (const name of Object.keys(config.servers)) {
|
|
82
|
-
if (!allowList.has(name)) {
|
|
83
|
-
delete config.servers[name];
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
clearSessionLspService(cwd);
|
|
89
|
-
state.manager = new LspManager(config, cwd);
|
|
90
|
-
state.manager.setExcludePatterns(lspSettings.exclude ?? []);
|
|
91
|
-
setSessionLspServiceState(cwd, { kind: "pending" });
|
|
92
|
-
state.detectedServers = scanProjectCapabilities(config, cwd);
|
|
93
|
-
state.manager.registerDetectedServers(state.detectedServers);
|
|
94
|
-
await startDetectedServers(state.manager, state.detectedServers);
|
|
95
|
-
|
|
96
|
-
const missing = scanMissingServers(config, cwd);
|
|
97
|
-
if (missing.length > 0) {
|
|
98
|
-
const parts = missing.map((m) => `${m.name} (${m.command})`);
|
|
99
|
-
ctx.ui.notify(
|
|
100
|
-
`LSP server not found for: ${parts.join(", ")}. Install the server to enable language intelligence.`,
|
|
101
|
-
"warning",
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
state.sentinelSnapshot = scanWorkspaceSentinels(cwd);
|
|
106
|
-
state.lastWorkspaceChangeAt = 0;
|
|
107
|
-
state.staleSuspected = false;
|
|
108
|
-
refreshProjectServers(state);
|
|
109
|
-
state.lastDiagnosticsFingerprint = null;
|
|
110
|
-
state.currentContextToken = null;
|
|
111
|
-
state.lspActive = true;
|
|
112
|
-
const service = new SessionLspService(state.manager);
|
|
113
|
-
setSessionLspServiceState(cwd, { kind: "ready", service });
|
|
114
|
-
registerLspCapabilities(runtime, cwd, service);
|
|
115
|
-
registerLspTools(pi, buildLspToolPromptSurfaces(state.projectServers, cwd));
|
|
116
|
-
ensureLspToolsActive(pi);
|
|
117
|
-
persistLspActiveState(pi, state);
|
|
118
|
-
updateLspUi(ctx, state.manager, state.inlineSeverity, state.projectServers);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
pi.on("session_shutdown", async () => {
|
|
122
|
-
clearTsconfigCache();
|
|
123
|
-
if (state.manager) {
|
|
124
|
-
const cwd = state.manager.getCwd();
|
|
125
|
-
unregisterLspCapabilities(runtime, cwd);
|
|
126
|
-
clearSessionLspService(cwd);
|
|
127
|
-
await state.manager.shutdownAll();
|
|
128
|
-
state.manager = null;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
state.inspector.close?.();
|
|
132
|
-
state.detectedServers = [];
|
|
133
|
-
state.projectServers = [];
|
|
134
|
-
state.lastDiagnosticsFingerprint = null;
|
|
135
|
-
state.currentContextToken = null;
|
|
136
|
-
state.staleSuspected = false;
|
|
137
|
-
state.lastWorkspaceChangeAt = 0;
|
|
138
|
-
state.sentinelSnapshot = new Map();
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
pi.on("agent_end", async (_event: AgentEndEvent, ctx: ExtensionContext) => {
|
|
142
|
-
state.currentContextToken = null;
|
|
143
|
-
refreshProjectServers(state);
|
|
144
|
-
|
|
145
|
-
if (state.manager) {
|
|
146
|
-
updateLspUi(ctx, state.manager, state.inlineSeverity, state.projectServers);
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// LSP status command — /lsp-status overlay.
|
|
2
|
-
//
|
|
3
|
-
// Extracted from lsp.ts to keep each orchestration concern in its own module.
|
|
4
|
-
|
|
5
|
-
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
6
|
-
import { type LspRuntimeState, refreshProjectServers } from "../session/lsp-state.ts";
|
|
7
|
-
import { getLspDisabledMessage, loadLspSettings } from "../session/settings-registration.ts";
|
|
8
|
-
import { toggleLspStatusOverlay } from "../ui/ui.ts";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Register the /lsp-status command that opens an LSP inspector overlay.
|
|
12
|
-
*/
|
|
13
|
-
export function registerLspStatusCommand(pi: ExtensionAPI, state: LspRuntimeState): void {
|
|
14
|
-
pi.registerCommand("lsp-status", {
|
|
15
|
-
description: "Show detected LSP servers, roots, open files, and diagnostics",
|
|
16
|
-
handler: async (_args: string, ctx: ExtensionContext) => {
|
|
17
|
-
const lspSettings = loadLspSettings(ctx.cwd);
|
|
18
|
-
if (!lspSettings.enabled) {
|
|
19
|
-
ctx.ui.notify(getLspDisabledMessage(ctx.cwd), "warning");
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (!state.manager) {
|
|
24
|
-
ctx.ui.notify("LSP not initialized", "warning");
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
refreshProjectServers(state);
|
|
29
|
-
toggleLspStatusOverlay(
|
|
30
|
-
ctx,
|
|
31
|
-
state.manager,
|
|
32
|
-
state.inlineSeverity,
|
|
33
|
-
state.inspector,
|
|
34
|
-
state.projectServers,
|
|
35
|
-
);
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
// Workspace recovery handler — tool_result event.
|
|
2
|
-
//
|
|
3
|
-
// Extracted from lsp.ts to keep each orchestration concern in its own module.
|
|
4
|
-
|
|
5
|
-
import type {
|
|
6
|
-
ExtensionAPI,
|
|
7
|
-
ExtensionContext,
|
|
8
|
-
ToolResultEvent,
|
|
9
|
-
} from "@earendil-works/pi-coding-agent";
|
|
10
|
-
import { clearTsconfigCache } from "../config/tsconfig-scope.ts";
|
|
11
|
-
import { FileChangeType, type FileEvent } from "../config/types.ts";
|
|
12
|
-
import {
|
|
13
|
-
isWorkspaceRecoveryTrigger,
|
|
14
|
-
syncWorkspaceSentinelSnapshot,
|
|
15
|
-
} from "../diagnostics/workspace-sentinels.ts";
|
|
16
|
-
import {
|
|
17
|
-
isLspAwareTool,
|
|
18
|
-
type LspRuntimeState,
|
|
19
|
-
refreshProjectServers,
|
|
20
|
-
} from "../session/lsp-state.ts";
|
|
21
|
-
import { updateLspUi } from "../ui/ui.ts";
|
|
22
|
-
import { fileToUri, resolveSessionPath } from "../utils.ts";
|
|
23
|
-
import {
|
|
24
|
-
shouldInvalidateTsconfigScopeCache,
|
|
25
|
-
softRecoverWorkspaceChanges,
|
|
26
|
-
} from "../workspace-change.ts";
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Register the tool_result handler that detects workspace changes from
|
|
30
|
-
* write / edit tool results and recovers LSP state accordingly.
|
|
31
|
-
*/
|
|
32
|
-
export function registerWorkspaceRecoveryHandler(pi: ExtensionAPI, state: LspRuntimeState): void {
|
|
33
|
-
pi.on("tool_result", async (event: ToolResultEvent, ctx: ExtensionContext) => {
|
|
34
|
-
if (!state.manager) return;
|
|
35
|
-
|
|
36
|
-
const recoveryTriggered = recoverWorkspaceChangesFromToolResult(state, ctx.cwd, {
|
|
37
|
-
toolName: event.toolName,
|
|
38
|
-
isError: event.isError,
|
|
39
|
-
input: (event as { input?: unknown }).input,
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
if (recoveryTriggered || isLspAwareTool(event.toolName)) {
|
|
43
|
-
refreshProjectServers(state);
|
|
44
|
-
updateLspUi(ctx, state.manager, state.inlineSeverity, state.projectServers);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Determine whether a tool result (write/edit) should trigger workspace recovery.
|
|
51
|
-
*
|
|
52
|
-
* Returns true and recovers when the file is:
|
|
53
|
-
* - a sentinel file (package.json, tsconfig, lockfile, .d.ts)
|
|
54
|
-
* - a source file whose extension matches an active language server's file types
|
|
55
|
-
* - a .json / .jsonc file (tsconfig cache invalidation)
|
|
56
|
-
*/
|
|
57
|
-
function recoverWorkspaceChangesFromToolResult(
|
|
58
|
-
state: LspRuntimeState,
|
|
59
|
-
cwd: string,
|
|
60
|
-
event: { toolName: string; isError: boolean; input?: unknown },
|
|
61
|
-
): boolean {
|
|
62
|
-
if (!state.manager || event.isError) return false;
|
|
63
|
-
if (event.toolName !== "write" && event.toolName !== "edit") return false;
|
|
64
|
-
if (!event.input || typeof event.input !== "object") return false;
|
|
65
|
-
|
|
66
|
-
const pathValue = (event.input as { path?: unknown }).path;
|
|
67
|
-
if (typeof pathValue !== "string") return false;
|
|
68
|
-
|
|
69
|
-
const resolvedPath = resolveSessionPath(cwd, pathValue);
|
|
70
|
-
if (shouldInvalidateTsconfigScopeCache(resolvedPath)) {
|
|
71
|
-
clearTsconfigCache();
|
|
72
|
-
}
|
|
73
|
-
const fileEvent: FileEvent = { uri: fileToUri(resolvedPath), type: FileChangeType.Changed };
|
|
74
|
-
|
|
75
|
-
// Sentinel files (package.json, tsconfig.json, lockfiles, .d.ts)
|
|
76
|
-
if (isWorkspaceRecoveryTrigger(resolvedPath, cwd)) {
|
|
77
|
-
if (resolvedPath.endsWith(".d.ts")) {
|
|
78
|
-
return softRecoverWorkspaceChanges(state, [fileEvent]);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const { snapshot, changes } = syncWorkspaceSentinelSnapshot(cwd, state.sentinelSnapshot);
|
|
82
|
-
state.sentinelSnapshot = snapshot;
|
|
83
|
-
return softRecoverWorkspaceChanges(state, changes.length > 0 ? changes : [fileEvent]);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// Source files matching an active language server's file types
|
|
87
|
-
if (state.manager.hasServerForExtension(resolvedPath)) {
|
|
88
|
-
return softRecoverWorkspaceChanges(state, [fileEvent]);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// LSP Extension for pi — wires together the expert semantic toolset and all
|
|
2
|
-
// event/behaviour handlers. Handler registration is delegated to focused
|
|
3
|
-
// modules so each orchestration concern lives in its own file.
|
|
4
|
-
|
|
5
|
-
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
6
|
-
import { getDefaultWorkspaceRuntime } from "@mrclrchtr/supi-code-runtime/api";
|
|
7
|
-
import { registerDiagnosticInjectionHandlers } from "./handlers/diagnostic-injection.ts";
|
|
8
|
-
import { registerSessionLifecycleHandlers } from "./handlers/session-lifecycle.ts";
|
|
9
|
-
import { registerLspStatusCommand } from "./handlers/status-command.ts";
|
|
10
|
-
import { registerWorkspaceRecoveryHandler } from "./handlers/workspace-recovery.ts";
|
|
11
|
-
import { createRuntimeState } from "./session/lsp-state.ts";
|
|
12
|
-
import { registerLspSettings } from "./session/settings-registration.ts";
|
|
13
|
-
import { registerTreePersistHandlers } from "./session/tree-persist.ts";
|
|
14
|
-
import { defaultLspToolPromptSurfaces } from "./tool/guidance.ts";
|
|
15
|
-
import { registerLspAwareToolOverrides } from "./tool/overrides.ts";
|
|
16
|
-
import { registerLspTools } from "./tool/register-tools.ts";
|
|
17
|
-
import { registerLspMessageRenderer } from "./ui/renderer.ts";
|
|
18
|
-
|
|
19
|
-
export default function lspExtension(pi: ExtensionAPI) {
|
|
20
|
-
registerLspSettings();
|
|
21
|
-
const state = createRuntimeState();
|
|
22
|
-
const runtime = getDefaultWorkspaceRuntime();
|
|
23
|
-
|
|
24
|
-
registerLspAwareToolOverrides(pi, {
|
|
25
|
-
getInlineSeverity: () => state.inlineSeverity,
|
|
26
|
-
getManager: () => state.manager,
|
|
27
|
-
isActive: () => state.lspActive,
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
registerLspTools(pi, defaultLspToolPromptSurfaces);
|
|
31
|
-
registerSessionLifecycleHandlers(pi, state, runtime);
|
|
32
|
-
registerDiagnosticInjectionHandlers(pi, state);
|
|
33
|
-
registerWorkspaceRecoveryHandler(pi, state);
|
|
34
|
-
registerTreePersistHandlers(pi, state);
|
|
35
|
-
registerLspStatusCommand(pi, state);
|
|
36
|
-
registerLspMessageRenderer(pi);
|
|
37
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
// LSP extension runtime state and tool management helpers.
|
|
2
|
-
// Extracted from lsp.ts to keep file sizes within Biome limits.
|
|
3
|
-
|
|
4
|
-
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
5
|
-
import type { DetectedProjectServer, ProjectServerInfo } from "../config/server-config.ts";
|
|
6
|
-
import type { LspManager } from "../manager/manager.ts";
|
|
7
|
-
import { LSP_TOOL_NAMES } from "../tool/names.ts";
|
|
8
|
-
import type { LspInspectorState } from "../ui/ui.ts";
|
|
9
|
-
import { introspectCapabilities } from "./scanner.ts";
|
|
10
|
-
import { clearSessionLspService } from "./service-registry.ts";
|
|
11
|
-
|
|
12
|
-
export interface LspRuntimeState {
|
|
13
|
-
manager: LspManager | null;
|
|
14
|
-
inlineSeverity: number;
|
|
15
|
-
inspector: LspInspectorState;
|
|
16
|
-
detectedServers: DetectedProjectServer[];
|
|
17
|
-
projectServers: ProjectServerInfo[];
|
|
18
|
-
lastDiagnosticsFingerprint: string | null;
|
|
19
|
-
currentContextToken: string | null;
|
|
20
|
-
contextCounter: number;
|
|
21
|
-
lspActive: boolean;
|
|
22
|
-
sentinelSnapshot: Map<string, number>;
|
|
23
|
-
staleSuspected: boolean;
|
|
24
|
-
lastWorkspaceChangeAt: number;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function createRuntimeState(): LspRuntimeState {
|
|
28
|
-
return {
|
|
29
|
-
manager: null,
|
|
30
|
-
inlineSeverity: 1,
|
|
31
|
-
inspector: { handle: null, close: null },
|
|
32
|
-
detectedServers: [],
|
|
33
|
-
projectServers: [],
|
|
34
|
-
lastDiagnosticsFingerprint: null,
|
|
35
|
-
currentContextToken: null,
|
|
36
|
-
contextCounter: 0,
|
|
37
|
-
lspActive: false,
|
|
38
|
-
sentinelSnapshot: new Map(),
|
|
39
|
-
staleSuspected: false,
|
|
40
|
-
lastWorkspaceChangeAt: 0,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function refreshProjectServers(state: LspRuntimeState): void {
|
|
45
|
-
if (!state.manager) {
|
|
46
|
-
state.projectServers = [];
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
state.projectServers = introspectCapabilities(state.manager, state.detectedServers);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function isLspAwareTool(toolName: string): boolean {
|
|
53
|
-
return (
|
|
54
|
-
LSP_TOOL_NAMES.includes(toolName as (typeof LSP_TOOL_NAMES)[number]) ||
|
|
55
|
-
toolName === "read" ||
|
|
56
|
-
toolName === "write" ||
|
|
57
|
-
toolName === "edit"
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function disableLspState(pi: ExtensionAPI, state: LspRuntimeState): void {
|
|
62
|
-
if (state.manager) {
|
|
63
|
-
clearSessionLspService(state.manager.getCwd());
|
|
64
|
-
}
|
|
65
|
-
state.inspector.close?.();
|
|
66
|
-
state.manager = null;
|
|
67
|
-
state.detectedServers = [];
|
|
68
|
-
state.projectServers = [];
|
|
69
|
-
state.lastDiagnosticsFingerprint = null;
|
|
70
|
-
state.currentContextToken = null;
|
|
71
|
-
state.staleSuspected = false;
|
|
72
|
-
state.lastWorkspaceChangeAt = 0;
|
|
73
|
-
state.sentinelSnapshot = new Map();
|
|
74
|
-
state.lspActive = false;
|
|
75
|
-
removeLspTools(pi);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function removeLspTools(pi: ExtensionAPI): void {
|
|
79
|
-
const activeTools = pi.getActiveTools();
|
|
80
|
-
const nextTools = activeTools.filter(
|
|
81
|
-
(toolName: string) => !LSP_TOOL_NAMES.includes(toolName as (typeof LSP_TOOL_NAMES)[number]),
|
|
82
|
-
);
|
|
83
|
-
if (nextTools.length !== activeTools.length) {
|
|
84
|
-
pi.setActiveTools(nextTools);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export function ensureLspToolsActive(pi: ExtensionAPI): void {
|
|
89
|
-
const activeTools = pi.getActiveTools();
|
|
90
|
-
const missing = LSP_TOOL_NAMES.filter((toolName) => !activeTools.includes(toolName));
|
|
91
|
-
if (missing.length === 0) return;
|
|
92
|
-
pi.setActiveTools([...activeTools, ...missing]);
|
|
93
|
-
}
|