@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
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { StringEnum } from "@earendil-works/pi-ai";
|
|
2
|
+
import { type TSchema, Type } from "typebox";
|
|
3
|
+
import type { CodeIntelligenceToolName } from "../types/index.ts";
|
|
4
|
+
|
|
5
|
+
const ScopeParam = Type.String({
|
|
6
|
+
description: "Workspace-relative path, package, or directory scope for the workflow query.",
|
|
7
|
+
});
|
|
8
|
+
const FileParam = Type.String({ description: "Target file path." });
|
|
9
|
+
const QueryParam = Type.String({
|
|
10
|
+
description: "Human or code reference to resolve or search for.",
|
|
11
|
+
});
|
|
12
|
+
const LineParam = Type.Number({ description: "1-based line.", minimum: 1 });
|
|
13
|
+
const CharacterParam = Type.Number({
|
|
14
|
+
description: "1-based UTF-16 column.",
|
|
15
|
+
minimum: 1,
|
|
16
|
+
});
|
|
17
|
+
const MaxResultsParam = Type.Number({
|
|
18
|
+
description: "Maximum number of ranked results.",
|
|
19
|
+
minimum: 1,
|
|
20
|
+
});
|
|
21
|
+
const SymbolParam = Type.String({ description: "Symbol name" });
|
|
22
|
+
const TargetIdParam = Type.String({
|
|
23
|
+
description:
|
|
24
|
+
"Resolved target handle from `code_resolve`. Takes precedence over file/line/character/symbol.",
|
|
25
|
+
});
|
|
26
|
+
const RangeParam = Type.Object(
|
|
27
|
+
{
|
|
28
|
+
start: Type.Object({ line: LineParam, character: CharacterParam }),
|
|
29
|
+
end: Type.Object({ line: LineParam, character: CharacterParam }),
|
|
30
|
+
},
|
|
31
|
+
{ description: "1-based selected source range for extract refactors." },
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Planned `code_resolve` parameters.
|
|
36
|
+
*
|
|
37
|
+
* Runtime rule for future executors:
|
|
38
|
+
* - require `query` or `file`
|
|
39
|
+
* - require `file` when `line` or `character` is provided
|
|
40
|
+
*/
|
|
41
|
+
export const CodeResolveParameters = Type.Object(
|
|
42
|
+
{
|
|
43
|
+
query: Type.Optional(QueryParam),
|
|
44
|
+
scope: Type.Optional(ScopeParam),
|
|
45
|
+
kind: Type.Optional(
|
|
46
|
+
StringEnum(
|
|
47
|
+
[
|
|
48
|
+
"symbol",
|
|
49
|
+
"function",
|
|
50
|
+
"class",
|
|
51
|
+
"interface",
|
|
52
|
+
"file",
|
|
53
|
+
"export",
|
|
54
|
+
"variable",
|
|
55
|
+
"method",
|
|
56
|
+
"const",
|
|
57
|
+
"enum",
|
|
58
|
+
],
|
|
59
|
+
{
|
|
60
|
+
description: "Preferred target kind when disambiguating the query.",
|
|
61
|
+
},
|
|
62
|
+
),
|
|
63
|
+
),
|
|
64
|
+
file: Type.Optional(FileParam),
|
|
65
|
+
line: Type.Optional(LineParam),
|
|
66
|
+
character: Type.Optional(CharacterParam),
|
|
67
|
+
maxResults: Type.Optional(MaxResultsParam),
|
|
68
|
+
},
|
|
69
|
+
{ additionalProperties: false },
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
/** Planned `code_inspect` parameters. Requires a precise point in one file. */
|
|
73
|
+
export const CodeInspectParameters = Type.Object(
|
|
74
|
+
{
|
|
75
|
+
file: FileParam,
|
|
76
|
+
line: LineParam,
|
|
77
|
+
character: CharacterParam,
|
|
78
|
+
maxResults: Type.Optional(MaxResultsParam),
|
|
79
|
+
},
|
|
80
|
+
{ additionalProperties: false },
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* `code_orientation` parameters.
|
|
85
|
+
*
|
|
86
|
+
* Runtime rules:
|
|
87
|
+
* - no focus means workspace-level orientation
|
|
88
|
+
* - `focus` is a workspace-relative path or discovered module name
|
|
89
|
+
* - `focus` + `line` + `character` resolves a real symbol target through the same path as `code_resolve`
|
|
90
|
+
* - `targetId` takes precedence over focus/coordinates; stale target IDs do not fall back
|
|
91
|
+
*/
|
|
92
|
+
export const CodeOrientationParameters = Type.Object(
|
|
93
|
+
{
|
|
94
|
+
focus: Type.Optional(
|
|
95
|
+
Type.String({
|
|
96
|
+
description:
|
|
97
|
+
"Workspace-relative path or discovered module name to orient around. Omit for project orientation.",
|
|
98
|
+
}),
|
|
99
|
+
),
|
|
100
|
+
targetId: Type.Optional(
|
|
101
|
+
Type.String({
|
|
102
|
+
description:
|
|
103
|
+
"Resolved target handle from `code_resolve`. Takes precedence over `focus`/`line`/`character`. If invalid or stale, the call errors and does not fall back to coordinates.",
|
|
104
|
+
}),
|
|
105
|
+
),
|
|
106
|
+
line: Type.Optional(
|
|
107
|
+
Type.Number({
|
|
108
|
+
description: "1-based line for symbol orientation. Requires `focus` and `character`.",
|
|
109
|
+
minimum: 1,
|
|
110
|
+
}),
|
|
111
|
+
),
|
|
112
|
+
character: Type.Optional(
|
|
113
|
+
Type.Number({
|
|
114
|
+
description: "1-based UTF-16 column for symbol orientation. Requires `focus` and `line`.",
|
|
115
|
+
minimum: 1,
|
|
116
|
+
}),
|
|
117
|
+
),
|
|
118
|
+
maxResults: Type.Optional(MaxResultsParam),
|
|
119
|
+
},
|
|
120
|
+
{ additionalProperties: false },
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Planned `code_find` parameters.
|
|
125
|
+
*
|
|
126
|
+
* Phase 0 intentionally excludes speculative natural-language search. A future phase
|
|
127
|
+
* may add it only after a real implementation exists.
|
|
128
|
+
*/
|
|
129
|
+
export const CodeFindParameters = Type.Object(
|
|
130
|
+
{
|
|
131
|
+
query: QueryParam,
|
|
132
|
+
scope: Type.Optional(ScopeParam),
|
|
133
|
+
mode: Type.Optional(
|
|
134
|
+
StringEnum(["text", "regex", "ast", "semantic"], {
|
|
135
|
+
description:
|
|
136
|
+
'Search mode. Omit for literal text search. mode: "ast" requires `kind`; mode: "text", mode: "regex", and mode: "semantic" do not accept `kind`.',
|
|
137
|
+
}),
|
|
138
|
+
),
|
|
139
|
+
kind: Type.Optional(
|
|
140
|
+
StringEnum(
|
|
141
|
+
[
|
|
142
|
+
"definition",
|
|
143
|
+
"import",
|
|
144
|
+
"export",
|
|
145
|
+
"call",
|
|
146
|
+
"type",
|
|
147
|
+
"interface",
|
|
148
|
+
"class",
|
|
149
|
+
"method",
|
|
150
|
+
"enum",
|
|
151
|
+
"test",
|
|
152
|
+
],
|
|
153
|
+
{
|
|
154
|
+
description:
|
|
155
|
+
'Only valid with `mode: "ast"`. Supported AST kinds: `definition`, `import`, `export`, `call`, `type`, `interface`, `class`, `method`, `enum`, `test`. AST `call` matches call-site identifiers by name, not by symbol identity.',
|
|
156
|
+
},
|
|
157
|
+
),
|
|
158
|
+
),
|
|
159
|
+
contextLines: Type.Optional(
|
|
160
|
+
Type.Number({ description: "Context lines to include around matches.", minimum: 0 }),
|
|
161
|
+
),
|
|
162
|
+
maxResults: Type.Optional(MaxResultsParam),
|
|
163
|
+
},
|
|
164
|
+
{ additionalProperties: false },
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* `code_graph` parameters.
|
|
169
|
+
*
|
|
170
|
+
* Phase 0 uses `references` rather than `callers` so the public contract stays honest
|
|
171
|
+
* until a true incoming-call hierarchy exists.
|
|
172
|
+
*
|
|
173
|
+
* Runtime rule for future executors:
|
|
174
|
+
* - require `targetId`, `file` + `line` + `character`, `symbol`, or `scope`
|
|
175
|
+
*/
|
|
176
|
+
export const CodeGraphParameters = Type.Object(
|
|
177
|
+
{
|
|
178
|
+
targetId: Type.Optional(TargetIdParam),
|
|
179
|
+
file: Type.Optional(FileParam),
|
|
180
|
+
line: Type.Optional(LineParam),
|
|
181
|
+
character: Type.Optional(CharacterParam),
|
|
182
|
+
symbol: Type.Optional(SymbolParam),
|
|
183
|
+
scope: Type.Optional(ScopeParam),
|
|
184
|
+
relations: Type.Optional(
|
|
185
|
+
Type.Array(
|
|
186
|
+
StringEnum(["all", "references", "callees", "imports", "exports", "implements", "tests"], {
|
|
187
|
+
description:
|
|
188
|
+
'Relation families to include in the graph. Use `"all"` to expand to every relation family. `callees` is direct structural outgoing-call evidence: source-shape calls in the enclosing scope, not symbol-identity resolution.',
|
|
189
|
+
}),
|
|
190
|
+
{
|
|
191
|
+
description: 'Requested relation families. Defaults to ["references"] when omitted.',
|
|
192
|
+
uniqueItems: true,
|
|
193
|
+
},
|
|
194
|
+
),
|
|
195
|
+
),
|
|
196
|
+
maxResults: Type.Optional(MaxResultsParam),
|
|
197
|
+
calleeDepth: Type.Optional(
|
|
198
|
+
StringEnum(["direct", "deep"], {
|
|
199
|
+
description:
|
|
200
|
+
'Depth for callee collection. `"direct"` (default): only direct calls from the enclosing scope, excluding nested function/callback scopes. `"deep"`: include all callees within the enclosing scope, including those inside nested scopes.',
|
|
201
|
+
}),
|
|
202
|
+
),
|
|
203
|
+
},
|
|
204
|
+
{ additionalProperties: false },
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Planned `code_impact` parameters.
|
|
209
|
+
*
|
|
210
|
+
* Runtime rule for future executors:
|
|
211
|
+
* - require at least one of `targetId`, `change`, or `changeSetFiles`
|
|
212
|
+
*/
|
|
213
|
+
export const CodeImpactParameters = Type.Object(
|
|
214
|
+
{
|
|
215
|
+
targetId: Type.Optional(
|
|
216
|
+
Type.String({ description: "Resolved target handle from `code_resolve`." }),
|
|
217
|
+
),
|
|
218
|
+
change: Type.Optional(
|
|
219
|
+
Type.String({ description: "Proposed change description for blast-radius analysis." }),
|
|
220
|
+
),
|
|
221
|
+
changeSetFiles: Type.Optional(
|
|
222
|
+
Type.Array(Type.String({ description: "Workspace-relative file in the change set." }), {
|
|
223
|
+
description:
|
|
224
|
+
"User-supplied files to analyze as the change set. This is not inferred from git and carries no line-level diff evidence.",
|
|
225
|
+
minItems: 1,
|
|
226
|
+
uniqueItems: true,
|
|
227
|
+
}),
|
|
228
|
+
),
|
|
229
|
+
includeTests: Type.Optional(
|
|
230
|
+
Type.Boolean({
|
|
231
|
+
description:
|
|
232
|
+
"Whether likely tests should be included in the impact set. changeSetFiles analysis uses semantic references when available plus deterministic conventions; target-based analysis may combine semantic references with deterministic conventions.",
|
|
233
|
+
}),
|
|
234
|
+
),
|
|
235
|
+
maxResults: Type.Optional(MaxResultsParam),
|
|
236
|
+
},
|
|
237
|
+
{ additionalProperties: false },
|
|
238
|
+
);
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Planned `code_refactor_plan` parameters.
|
|
242
|
+
*
|
|
243
|
+
* `operation` is the only intentional operation-style enum in the V2 skeleton.
|
|
244
|
+
* Phase 0 does not introduce a generic action mega-tool.
|
|
245
|
+
*
|
|
246
|
+
* Runtime rules for future executors:
|
|
247
|
+
* - require `targetId` or anchored `file` + `line` + `character`
|
|
248
|
+
* - `rename` (legacy alias), `rename_symbol`, and extract operations require `newName`
|
|
249
|
+
* - extract operations require `range`
|
|
250
|
+
*/
|
|
251
|
+
export const CodeRefactorParameters = Type.Object(
|
|
252
|
+
{
|
|
253
|
+
operation: StringEnum(["rename", "rename_symbol", "extract_function", "extract_variable"], {
|
|
254
|
+
description:
|
|
255
|
+
"Precise refactor operation to plan. `rename` is accepted as a compatibility alias for `rename_symbol`.",
|
|
256
|
+
}),
|
|
257
|
+
targetId: Type.Optional(
|
|
258
|
+
Type.String({ description: "Resolved target handle from `code_resolve`." }),
|
|
259
|
+
),
|
|
260
|
+
file: Type.Optional(FileParam),
|
|
261
|
+
line: Type.Optional(LineParam),
|
|
262
|
+
character: Type.Optional(CharacterParam),
|
|
263
|
+
range: Type.Optional(RangeParam),
|
|
264
|
+
newName: Type.Optional(
|
|
265
|
+
Type.String({ description: "New symbol name for rename/extract operations." }),
|
|
266
|
+
),
|
|
267
|
+
},
|
|
268
|
+
{ additionalProperties: false },
|
|
269
|
+
);
|
|
270
|
+
|
|
271
|
+
/** Planned `code_refactor_apply` parameters. `planId` is required. */
|
|
272
|
+
export const CodeApplyParameters = Type.Object(
|
|
273
|
+
{
|
|
274
|
+
planId: Type.String({
|
|
275
|
+
description: "Stored plan identifier returned by a previous refactor/plan step.",
|
|
276
|
+
}),
|
|
277
|
+
},
|
|
278
|
+
{ additionalProperties: false },
|
|
279
|
+
);
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Planned `code_health` parameters.
|
|
283
|
+
*
|
|
284
|
+
* This is the future diagnostics/status surface that will eventually replace direct
|
|
285
|
+
* public substrate diagnostics and recovery tools.
|
|
286
|
+
*/
|
|
287
|
+
export const CodeHealthParameters = Type.Object(
|
|
288
|
+
{
|
|
289
|
+
scope: Type.Optional(ScopeParam),
|
|
290
|
+
refresh: Type.Optional(
|
|
291
|
+
Type.Boolean({ description: "Refresh provider state before collecting health data." }),
|
|
292
|
+
),
|
|
293
|
+
include: Type.Optional(
|
|
294
|
+
Type.Array(
|
|
295
|
+
StringEnum(["diagnostics", "servers", "dirty", "coverage", "unused"], {
|
|
296
|
+
description: "Health signals to include.",
|
|
297
|
+
}),
|
|
298
|
+
{
|
|
299
|
+
description: "Requested health-signal sections.",
|
|
300
|
+
uniqueItems: true,
|
|
301
|
+
},
|
|
302
|
+
),
|
|
303
|
+
),
|
|
304
|
+
level: Type.Optional(
|
|
305
|
+
StringEnum(["summary", "detailed"], {
|
|
306
|
+
description: "Detail level for the health report.",
|
|
307
|
+
}),
|
|
308
|
+
),
|
|
309
|
+
coveragePath: Type.Optional(
|
|
310
|
+
Type.String({
|
|
311
|
+
description:
|
|
312
|
+
"Workspace-relative path to a coverage summary JSON file. Defaults to `coverage/coverage-summary.json`.",
|
|
313
|
+
}),
|
|
314
|
+
),
|
|
315
|
+
unusedPath: Type.Optional(
|
|
316
|
+
Type.String({
|
|
317
|
+
description: "Workspace-relative path to a knip JSON report. Defaults to `knip.json`.",
|
|
318
|
+
}),
|
|
319
|
+
),
|
|
320
|
+
},
|
|
321
|
+
{ additionalProperties: false },
|
|
322
|
+
);
|
|
323
|
+
|
|
324
|
+
export type WorkflowCodeToolSchemaKey = CodeIntelligenceToolName;
|
|
325
|
+
|
|
326
|
+
/** Code intelligence tool schemas keyed by public tool name. */
|
|
327
|
+
export const CODE_INTELLIGENCE_TOOL_SCHEMAS = {
|
|
328
|
+
code_resolve: CodeResolveParameters,
|
|
329
|
+
code_inspect: CodeInspectParameters,
|
|
330
|
+
code_orientation: CodeOrientationParameters,
|
|
331
|
+
code_find: CodeFindParameters,
|
|
332
|
+
code_graph: CodeGraphParameters,
|
|
333
|
+
code_impact: CodeImpactParameters,
|
|
334
|
+
code_refactor_plan: CodeRefactorParameters,
|
|
335
|
+
code_refactor_apply: CodeApplyParameters,
|
|
336
|
+
code_health: CodeHealthParameters,
|
|
337
|
+
} as const satisfies Record<CodeIntelligenceToolName, TSchema>;
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import type { TSchema } from "typebox";
|
|
2
|
+
import type {
|
|
3
|
+
CodeIntelligenceToolName,
|
|
4
|
+
CodeIntelResult,
|
|
5
|
+
CodeIntelToolExecCtx,
|
|
6
|
+
} from "../types/index.ts";
|
|
7
|
+
import { executeFindTool } from "./find/execute.ts";
|
|
8
|
+
import { executeGraphTool } from "./graph/execute.ts";
|
|
9
|
+
import { executeHealthTool } from "./health/execute.ts";
|
|
10
|
+
import { executeImpactTool } from "./impact/execute.ts";
|
|
11
|
+
import { emitToolProgress } from "./infra/progress.ts";
|
|
12
|
+
import { executeInspectTool } from "./inspect/execute.ts";
|
|
13
|
+
import { executeOrientationTool } from "./orientation/execute.ts";
|
|
14
|
+
import { executeRefactorApplyTool } from "./refactor-apply/execute.ts";
|
|
15
|
+
import { executeRefactorPlanTool } from "./refactor-plan/execute.ts";
|
|
16
|
+
import { executeResolveTool } from "./resolve/execute.ts";
|
|
17
|
+
import {
|
|
18
|
+
CodeApplyParameters,
|
|
19
|
+
CodeFindParameters,
|
|
20
|
+
CodeGraphParameters,
|
|
21
|
+
CodeHealthParameters,
|
|
22
|
+
CodeImpactParameters,
|
|
23
|
+
CodeInspectParameters,
|
|
24
|
+
CodeOrientationParameters,
|
|
25
|
+
CodeRefactorParameters,
|
|
26
|
+
CodeResolveParameters,
|
|
27
|
+
} from "./schemas.ts";
|
|
28
|
+
|
|
29
|
+
/** Substrate families that power a tool's implementation. */
|
|
30
|
+
export type ToolSubstrate = "semantic" | "structural" | "search" | "git" | "diagnostics";
|
|
31
|
+
|
|
32
|
+
/** Deployment phase for a tool. */
|
|
33
|
+
export type ToolPhase = "phase-1" | "phase-2" | "phase-3" | "phase-4" | "phase-5" | "phase-6";
|
|
34
|
+
|
|
35
|
+
/** Canonical spec for one code-intelligence tool — runtime registration config. */
|
|
36
|
+
export interface CodeIntelligenceToolDefinitionSpec {
|
|
37
|
+
name: CodeIntelligenceToolName;
|
|
38
|
+
label: string;
|
|
39
|
+
parameters: TSchema;
|
|
40
|
+
/** Per-spec line-limit override for the adapter's head truncation. */
|
|
41
|
+
maxLines?: number;
|
|
42
|
+
/** Per-spec byte-limit override for the adapter's head truncation. */
|
|
43
|
+
maxBytes?: number;
|
|
44
|
+
/** When true, oversized truncated output spills to a temp file. */
|
|
45
|
+
spillToTempFile?: boolean;
|
|
46
|
+
run: (params: unknown, ctx: CodeIntelToolExecCtx) => Promise<CodeIntelResult> | CodeIntelResult;
|
|
47
|
+
|
|
48
|
+
// ── Design metadata ────────────────────────────────────────────────
|
|
49
|
+
|
|
50
|
+
/** One-line purpose summary for docs and tests. */
|
|
51
|
+
purpose?: string;
|
|
52
|
+
/** Key into CODE_INTELLIGENCE_TOOL_SCHEMAS. */
|
|
53
|
+
schemaKey?: CodeIntelligenceToolName;
|
|
54
|
+
/** Concise schema summary for future maintainers. */
|
|
55
|
+
schemaDocs?: string;
|
|
56
|
+
/** Legacy tools this tool absorbed (empty for new tools). */
|
|
57
|
+
absorbsTools?: string[];
|
|
58
|
+
/** Legacy behaviors this tool absorbed. */
|
|
59
|
+
absorbsBehaviors?: string[];
|
|
60
|
+
/** Substrate families that power the implementation. */
|
|
61
|
+
substrates?: ToolSubstrate[];
|
|
62
|
+
/** Deployment phase. */
|
|
63
|
+
phase?: ToolPhase;
|
|
64
|
+
/** Explicit non-goals — what the tool intentionally does NOT do. */
|
|
65
|
+
nonGoals?: string[];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Canonical code-intelligence tool specs — runtime registration data.
|
|
70
|
+
*
|
|
71
|
+
* Prompt descriptions and guidelines live in {@link ./guidance.ts}.
|
|
72
|
+
*/
|
|
73
|
+
export const CODE_INTELLIGENCE_TOOL_SPECS = [
|
|
74
|
+
{
|
|
75
|
+
name: "code_resolve",
|
|
76
|
+
label: "Code Resolve",
|
|
77
|
+
parameters: CodeResolveParameters,
|
|
78
|
+
run: (params, ctx) =>
|
|
79
|
+
executeResolveTool(params as Parameters<typeof executeResolveTool>[0], ctx),
|
|
80
|
+
purpose:
|
|
81
|
+
"Resolve human or code references into precise file/range/symbol targets and stable target handles.",
|
|
82
|
+
schemaKey: "code_resolve",
|
|
83
|
+
schemaDocs:
|
|
84
|
+
"Accepts a query or file-based anchor plus optional scope/kind/maxResults. Later phases validate that line/character require file.",
|
|
85
|
+
absorbsTools: [],
|
|
86
|
+
absorbsBehaviors: [],
|
|
87
|
+
substrates: ["semantic", "search"],
|
|
88
|
+
phase: "phase-1",
|
|
89
|
+
nonGoals: ["Target handles do not persist across sessions."],
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: "code_inspect",
|
|
93
|
+
label: "Code Inspect",
|
|
94
|
+
parameters: CodeInspectParameters,
|
|
95
|
+
run: (params, ctx) =>
|
|
96
|
+
executeInspectTool(params as Parameters<typeof executeInspectTool>[0], ctx),
|
|
97
|
+
purpose:
|
|
98
|
+
"Inspect one precise point in code with best-effort syntax, symbol, hover, definition, diagnostics, and code-action facts.",
|
|
99
|
+
schemaKey: "code_inspect",
|
|
100
|
+
schemaDocs:
|
|
101
|
+
"Requires file, line, and character plus optional maxResults. It is the explicit point-inspection surface; code_orientation handles broader orientation.",
|
|
102
|
+
absorbsTools: [],
|
|
103
|
+
absorbsBehaviors: ["anchored orientation inspection"],
|
|
104
|
+
substrates: ["semantic", "structural", "diagnostics"],
|
|
105
|
+
phase: "phase-2",
|
|
106
|
+
nonGoals: [
|
|
107
|
+
"Does not accept targetId in this first pass; inspection stays point-based.",
|
|
108
|
+
"Does not apply code actions.",
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: "code_orientation",
|
|
113
|
+
label: "Code Orientation",
|
|
114
|
+
parameters: CodeOrientationParameters,
|
|
115
|
+
run: (params, ctx) =>
|
|
116
|
+
executeOrientationTool(params as Parameters<typeof executeOrientationTool>[0], ctx),
|
|
117
|
+
purpose:
|
|
118
|
+
"Orient around a project, discovered module, directory, file, or precise symbol before choosing surgical follow-up tools.",
|
|
119
|
+
schemaKey: "code_orientation",
|
|
120
|
+
schemaDocs:
|
|
121
|
+
"Accepts optional focus, targetId, line, character, and maxResults. Omitted focus returns workspace orientation; focus is path-first with discovered-module lookup; focus+line+character resolves a symbol; targetId wins over focus/coordinates.",
|
|
122
|
+
absorbsTools: ["code_brief", "code_context"],
|
|
123
|
+
absorbsBehaviors: [],
|
|
124
|
+
substrates: ["semantic", "structural", "diagnostics"],
|
|
125
|
+
phase: "phase-2",
|
|
126
|
+
nonGoals: [
|
|
127
|
+
"Does not provide relation, tests, or impact sections; use code_graph and code_impact.",
|
|
128
|
+
"Does not resolve bare symbol names; use code_resolve first.",
|
|
129
|
+
],
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "code_graph",
|
|
133
|
+
label: "Code Graph",
|
|
134
|
+
parameters: CodeGraphParameters,
|
|
135
|
+
spillToTempFile: true,
|
|
136
|
+
run: (params, ctx) => executeGraphTool(params as Parameters<typeof executeGraphTool>[0], ctx),
|
|
137
|
+
purpose:
|
|
138
|
+
"Show the graph of relationships touching a target, including references, callees, imports, exports, implementations, and tests.",
|
|
139
|
+
schemaKey: "code_graph",
|
|
140
|
+
schemaDocs:
|
|
141
|
+
"Accepts targetId plus relations and maxResults (per-relation result cap). Uses references rather than misleading callers labels.",
|
|
142
|
+
absorbsTools: ["code_references", "code_calls", "code_implementations"],
|
|
143
|
+
absorbsBehaviors: [],
|
|
144
|
+
substrates: ["semantic", "structural", "search"],
|
|
145
|
+
phase: "phase-3",
|
|
146
|
+
nonGoals: [
|
|
147
|
+
"Does not claim true incoming caller support until a real call hierarchy exists.",
|
|
148
|
+
"Does not collapse unrelated impact or search concerns into the graph surface.",
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: "code_impact",
|
|
153
|
+
label: "Code Impact",
|
|
154
|
+
parameters: CodeImpactParameters,
|
|
155
|
+
spillToTempFile: true,
|
|
156
|
+
run: (params, ctx) => executeImpactTool(params as Parameters<typeof executeImpactTool>[0], ctx),
|
|
157
|
+
purpose:
|
|
158
|
+
"Estimate blast radius for a target, user-supplied change set, or proposed change description, including likely tests and docs.",
|
|
159
|
+
schemaKey: "code_impact",
|
|
160
|
+
schemaDocs:
|
|
161
|
+
"Accepts targetId, change, or changeSetFiles plus includeTests/maxResults. Runtime validation later requires at least one primary subject.",
|
|
162
|
+
absorbsTools: [],
|
|
163
|
+
absorbsBehaviors: [],
|
|
164
|
+
substrates: ["semantic", "structural", "search", "diagnostics"],
|
|
165
|
+
phase: "phase-4",
|
|
166
|
+
nonGoals: [
|
|
167
|
+
"Does not guarantee perfect downstream impact inference without substrate evidence.",
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: "code_find",
|
|
172
|
+
label: "Code Find",
|
|
173
|
+
parameters: CodeFindParameters,
|
|
174
|
+
spillToTempFile: true,
|
|
175
|
+
run: (params, ctx) => executeFindTool(params as Parameters<typeof executeFindTool>[0], ctx),
|
|
176
|
+
purpose:
|
|
177
|
+
"Run unified ranked search across literal text, regex, AST, and semantic modes with one intent-level surface.",
|
|
178
|
+
schemaKey: "code_find",
|
|
179
|
+
schemaDocs:
|
|
180
|
+
"Requires query and supports scope, mode, kind, contextLines, and maxResults. Excludes speculative natural-language mode.",
|
|
181
|
+
absorbsTools: ["code_pattern"],
|
|
182
|
+
absorbsBehaviors: [],
|
|
183
|
+
substrates: ["semantic", "structural", "search"],
|
|
184
|
+
phase: "phase-2",
|
|
185
|
+
nonGoals: [
|
|
186
|
+
"Does not activate natural-language retrieval without a real implementation.",
|
|
187
|
+
"Removed code_pattern in Phase 2b (TNDM-057XHJ).",
|
|
188
|
+
],
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "code_refactor_plan",
|
|
192
|
+
label: "Code Refactor Plan",
|
|
193
|
+
parameters: CodeRefactorParameters,
|
|
194
|
+
run: async (params, ctx) => {
|
|
195
|
+
emitToolProgress(
|
|
196
|
+
ctx.onUpdate,
|
|
197
|
+
`code_refactor_plan: requesting ${(params as Record<string, unknown>).operation} plan from LSP...`,
|
|
198
|
+
);
|
|
199
|
+
return executeRefactorPlanTool(
|
|
200
|
+
params as Parameters<typeof executeRefactorPlanTool>[0],
|
|
201
|
+
ctx,
|
|
202
|
+
"code_refactor_plan",
|
|
203
|
+
);
|
|
204
|
+
},
|
|
205
|
+
purpose:
|
|
206
|
+
"Create precise refactor plans for named operations such as rename and extract refactors.",
|
|
207
|
+
schemaKey: "code_refactor_plan",
|
|
208
|
+
schemaDocs:
|
|
209
|
+
"Uses a scoped operation enum with target/file coordinates, optional selected range, and operation-specific options. This is the only intentional operation-style schema.",
|
|
210
|
+
absorbsTools: [],
|
|
211
|
+
absorbsBehaviors: [],
|
|
212
|
+
substrates: ["semantic", "structural", "search"],
|
|
213
|
+
phase: "phase-5",
|
|
214
|
+
nonGoals: [
|
|
215
|
+
"Does not introduce a broad action mega-tool.",
|
|
216
|
+
"code_refactor_plan is a pure planner; use code_refactor_apply to execute stored plans.",
|
|
217
|
+
],
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: "code_refactor_apply",
|
|
221
|
+
label: "Code Refactor Apply",
|
|
222
|
+
parameters: CodeApplyParameters,
|
|
223
|
+
run: (params, ctx) =>
|
|
224
|
+
executeRefactorApplyTool(params as Parameters<typeof executeRefactorApplyTool>[0], ctx),
|
|
225
|
+
purpose: "Apply a previously stored plan through explicit, fingerprint-checked mutation.",
|
|
226
|
+
schemaKey: "code_refactor_apply",
|
|
227
|
+
schemaDocs:
|
|
228
|
+
"Requires a planId. Enforces stale-plan rejection, validation, and fingerprint checks before mutation.",
|
|
229
|
+
absorbsTools: [],
|
|
230
|
+
absorbsBehaviors: [],
|
|
231
|
+
substrates: ["semantic", "search", "git"],
|
|
232
|
+
phase: "phase-5",
|
|
233
|
+
nonGoals: [
|
|
234
|
+
"Does not bypass plan validation or fingerprint checks.",
|
|
235
|
+
"Format/verify modes are not implemented; they return explicit unavailable outcomes when added later.",
|
|
236
|
+
],
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: "code_health",
|
|
240
|
+
label: "Code Health",
|
|
241
|
+
parameters: CodeHealthParameters,
|
|
242
|
+
run: (params, ctx) => executeHealthTool(params as Parameters<typeof executeHealthTool>[0], ctx),
|
|
243
|
+
purpose:
|
|
244
|
+
"Summarize diagnostics, provider state, dirty workspace signals, and maintenance cues from one workflow-oriented health surface.",
|
|
245
|
+
schemaKey: "code_health",
|
|
246
|
+
schemaDocs:
|
|
247
|
+
"Accepts scope, refresh, include sections, and detail level. It is the planned replacement for direct public diagnostic and recovery substrate access.",
|
|
248
|
+
absorbsTools: ["lsp_diagnostics", "lsp_recover"],
|
|
249
|
+
absorbsBehaviors: ["ci-status summary"],
|
|
250
|
+
substrates: ["semantic", "search", "git", "diagnostics"],
|
|
251
|
+
phase: "phase-6",
|
|
252
|
+
nonGoals: [
|
|
253
|
+
"Public lsp_* and tree_sitter_* tools were removed; only code_* tools remain on the public surface.",
|
|
254
|
+
"Does not act as a generic verification/test runner.",
|
|
255
|
+
],
|
|
256
|
+
},
|
|
257
|
+
] as const satisfies readonly CodeIntelligenceToolDefinitionSpec[];
|