@treedy/lsp-mcp 0.2.5 → 0.2.7

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 CHANGED
@@ -40,7 +40,7 @@ git_diagnostics
40
40
  - Language-specific refactor tools where needed:
41
41
  - Python: `python_move`, `python_change_signature`, `python_function_signature`
42
42
  - TypeScript: `typescript_move`, `typescript_function_signature`
43
- - Meta/admin tools: `status`, `list_backends`, `check_versions`, `update_backend`, `reload_config`, `switch_workspace`, `switch_workspace_for_language`, `discover_language_workspaces`, `doctor`, `expand_result`
43
+ - Meta/admin tools: `status`, `list_backends`, `check_versions`, `update_backend`, `reload_config`, `switch_workspace`, `switch_workspace_for_language`, `discover_language_workspaces`, `semantic_session_start`, `doctor`, `expand_result`
44
44
  - Built-in prompts for agent workflows and best practices
45
45
 
46
46
  ## Tool Model (Current)
@@ -49,8 +49,14 @@ git_diagnostics
49
49
 
50
50
  Use these directly; language is inferred from file/path:
51
51
 
52
- - Navigation: `hover`, `definition`, `references`, `peek_definition`, `workspace_symbol`
53
- - Editing support: `completions`, `signature_help`, `rename`, `code_action`, `run_code_action`
52
+ - Navigation: `hover`, `definition`, `implementation`, `type_definition`, `call_hierarchy`, `type_hierarchy`, `document_highlight`, `selection_range`, `folding_range`, `document_link`, `linked_editing_range`, `semantic_tokens`, `moniker`, `references`, `peek_definition`, `workspace_symbol`
53
+ - `type_hierarchy`, `semantic_tokens`, `linked_editing_range`, and `inlay_hint_resolve` use strict backend methods when available, otherwise return explicit `fallback_used=true` + `approximate=true` results.
54
+ - Hinting: `inlay_hints`, `inlay_hint_resolve`, `read_file_with_hints`
55
+ - Composite semantic workflow: `semantic_navigate` (optional search -> definition -> references -> read_file_with_hints)
56
+ - `mode='deep'` (default) runs full workflow; `mode='fast'` skips heavy hint reads unless explicitly requested
57
+ - `strategy='balanced'|'definition_first'|'references_first'` controls step ordering for latency/recall tradeoffs
58
+ - Incremental diagnostics: `diagnostics_delta` (delta vs previous diagnostics snapshot)
59
+ - Editing support: `completions`, `signature_help`, `prepare_rename`, `rename`, `code_action`, `run_code_action`, `code_lens`
54
60
  - Analysis: `diagnostics`, `git_diagnostics`, `symbols`, `search`, `summarize_file`, `read_file_with_hints`, `project_structure`
55
61
  - Sync/edit loop: `update_document`
56
62
 
@@ -63,7 +69,13 @@ For large repos, use preview arguments to reduce token usage:
63
69
 
64
70
  - `search` / `workspace_symbol`: `preview_limit` or `page_size` (default `200`), plus `cursor` for next page
65
71
  - `diagnostics`: `preview_limit` or `page_size` (default `200`), `summary_only` (default `false`), plus `cursor`
72
+ - `diagnostics_delta`: `preview_limit`/`page_size` plus optional `severity`, `source`, `hotspot_limit` filters, and `cursor` for paged change items
73
+ - Returns `delta.file_summary[]` and `delta.top_hotspots[]` for per-file triage in large workspaces
66
74
  - `doctor`: `page_size` (default `50`) plus `cursor` for long environment reports
75
+ - `doctor`: set `check_latest_versions=true` to probe registry latest version drift (slower, network-dependent)
76
+ - `doctor`: use `capability_snapshot_id` to reuse probed capability matrix and skip repeated backend capability probing
77
+ - Strict semantic errors include structured `recovery_plan[]` (`type`, `tool`, `args`, `command`) and cost fields: `latency_ms`, `result_size`, `truncated`, `cursor_available`
78
+ - Semantic responses include `confidence` and `confidence_reason` for fallback/approximation awareness
67
79
  - `project_structure`: `max_depth` (default `3`), `max_entries` (default `300`)
68
80
  - `summarize_file`: `max_symbols` (default `200`)
69
81
  - `read_file_with_hints`: `start_line` (default `1`), `max_lines` (default `300`)
@@ -74,6 +86,40 @@ Paged responses include:
74
86
  - `next`: ready-to-call arguments for the next page (via `expand_result`)
75
87
  - Cursors are signed and expire automatically (TTL-based) for safer paging.
76
88
 
89
+ Strict semantic error shape (example):
90
+
91
+ ```json
92
+ {
93
+ "error": "LANGUAGE_WORKSPACE_REQUIRED",
94
+ "error_code": "LANGUAGE_WORKSPACE_REQUIRED",
95
+ "tool": "hover",
96
+ "strict_mode": true,
97
+ "resolved_language": "typescript",
98
+ "resolved_workspace": null,
99
+ "next_step": "Call switch_workspace_for_language(language='typescript', path='/abs/project/root') before using semantic tools.",
100
+ "recovery_plan": [
101
+ {
102
+ "step": 1,
103
+ "action": "set_language_workspace",
104
+ "type": "tool_call",
105
+ "tool": "switch_workspace_for_language",
106
+ "args": {
107
+ "language": "typescript",
108
+ "path": "/abs/project/root"
109
+ },
110
+ "command": "switch_workspace_for_language(language='typescript', path='/abs/project/root')",
111
+ "reason": "Semantic tools require an explicit per-language workspace mapping."
112
+ }
113
+ ],
114
+ "latency_ms": null,
115
+ "result_size": 0,
116
+ "cursor_available": false,
117
+ "truncated": false,
118
+ "confidence": 0.25,
119
+ "confidence_reason": "Strict workspace precondition failed; no semantic result available."
120
+ }
121
+ ```
122
+
77
123
  ### Language-specific tools
78
124
 
79
125
  - Python-only: `python_move`, `python_change_signature`, `python_function_signature`
@@ -81,10 +127,79 @@ Paged responses include:
81
127
 
82
128
  ### Server/meta tools
83
129
 
84
- - `status`, `list_backends`, `start_backend`, `update_backend`, `check_versions`, `reload_config`, `switch_python_backend`, `switch_workspace`, `switch_workspace_for_language`, `discover_language_workspaces`, `doctor`, `expand_result`
130
+ - `status`, `list_backends`, `start_backend`, `update_backend`, `check_versions`, `reload_config`, `switch_python_backend`, `switch_workspace`, `switch_workspace_for_language`, `discover_language_workspaces`, `semantic_session_start`, `doctor`, `expand_result`
85
131
  - `discover_language_workspaces` input: `root` (optional), `max_depth` (optional, default `2`), `apply` (optional, default `false`)
132
+ - `semantic_session_start` input: `language` (optional), `workspace` (optional), `file` (optional), `start_backend` (optional, default `true`)
86
133
  - In mixed-language monorepos, semantic tools require language workspace mapping (set via `switch_workspace_for_language` or `discover_language_workspaces(..., apply=true)`).
87
134
  - `doctor` now includes `workspaceDependencyChecks.language_workspace_discovery` with suggested per-language workspace commands.
135
+ - `doctor` includes `backendPackageDrift` to show installed backend version vs latest policy and upgrade next steps.
136
+ - `doctor` includes `backendVersionSummary` (stable schema with `schema_version`, `counts`, `by_language`, `lookup_stats`) for quick LLM triage.
137
+ - `doctor` includes `workspaceDependencyChecks.python_bundled_runtime` in bundled mode, with optional executable probe results when `probe_backends=true`.
138
+ - `doctor` includes `benchmarkInsights` from the latest benchmark report (`.tmp/benchmark-latest.json` by default) for runtime budget recommendations.
139
+ - If baseline exists (`.tmp/benchmark-baseline.json` by default), `benchmarkInsights.trend` includes regression/improvement deltas.
140
+ - `doctor` includes `llmSemanticDefaults` with ready-to-use parameter presets for:
141
+ - `semantic_navigate` (`mode`, `strategy`, `page_size`, `reference_preview`, `hint_max_lines`)
142
+ - `diagnostics_delta` (`page_size`, `preview_limit`, `hotspot_limit`)
143
+ - plus `rationale[]` explaining why these defaults were chosen
144
+
145
+ Example fields exposed for client/LLM orchestration:
146
+
147
+ ```json
148
+ {
149
+ "backend_runtime_mode": "registry",
150
+ "backend_packages": [
151
+ {
152
+ "language": "typescript",
153
+ "package": "@treedy/typescript-lsp-mcp",
154
+ "package_ref": "@treedy/typescript-lsp-mcp@latest",
155
+ "registry": "npm",
156
+ "resolver": "npx",
157
+ "provider": "typescript-lsp-mcp",
158
+ "install_command": "npx --yes @treedy/typescript-lsp-mcp@latest",
159
+ "update_command": "npx --yes @treedy/typescript-lsp-mcp@latest",
160
+ "default_channel": "latest",
161
+ "auto_update_enabled": true,
162
+ "minimum_supported_version": "0.1.0"
163
+ }
164
+ ],
165
+ "backendPackageDrift": {
166
+ "typescript": {
167
+ "installed_version": "0.2.0",
168
+ "minimum_supported_version": "0.1.0",
169
+ "minimum_status": "supported",
170
+ "drift_status": "policy_aligned",
171
+ "latest_registry_version": "0.2.0",
172
+ "latest_status": "up_to_date",
173
+ "next_step": "No action needed.",
174
+ "latest_next_step": "Installed version matches latest policy."
175
+ }
176
+ },
177
+ "backendVersionSummary": {
178
+ "schema_version": 1,
179
+ "check_latest_versions": true,
180
+ "lookup_stats": {
181
+ "schema_version": 1,
182
+ "enabled": true,
183
+ "cache_ttl_ms": 300000,
184
+ "requested": 3,
185
+ "cache_hits": 2,
186
+ "inflight_hits": 0,
187
+ "executed": 1,
188
+ "succeeded": 1,
189
+ "failed": 0,
190
+ "skipped": 0
191
+ },
192
+ "counts": {
193
+ "languages": 3,
194
+ "below_minimum": 0,
195
+ "outdated": 0,
196
+ "policy_drift": 0,
197
+ "bundled_static": 0,
198
+ "unknown_latest": 0
199
+ }
200
+ }
201
+ }
202
+ ```
88
203
 
89
204
  ## Prompts (Skills)
90
205
 
@@ -109,6 +224,8 @@ You can configure with env vars or `.lsp-mcp.json` in your workspace.
109
224
  | `LSP_MCP_TYPESCRIPT_ENABLED` | `true` | Enable TypeScript backend |
110
225
  | `LSP_MCP_VUE_ENABLED` | `true` | Enable Vue backend |
111
226
  | `LSP_MCP_AUTO_UPDATE` | `true` | Update backend packages to latest on startup/update |
227
+ | `LSP_MCP_BACKEND_RUNTIME_MODE` | `registry` | Backend runtime strategy: `registry` (default), `auto`, `bundled` |
228
+ | `LSP_MCP_REQUIRE_BUNDLED_BACKENDS` | `false` | Legacy strict bundled mode (equivalent to runtime mode `bundled`) |
112
229
  | `LSP_MCP_EAGER_START` | `false` | Start all enabled backends when server boots |
113
230
  | `LSP_MCP_IDLE_TIMEOUT` | `600` | Backend idle timeout in seconds |
114
231
 
@@ -123,14 +240,18 @@ When `LSP_MCP_AUTO_UPDATE=true`:
123
240
 
124
241
  ### Runtime dependency expectations
125
242
 
126
- - Lean mode (default): backend packages are fetched when first used.
243
+ - Lean mode (default): backend packages are fetched when first used (`LSP_MCP_BACKEND_RUNTIME_MODE=registry`).
244
+ - Bundled mode: set `LSP_MCP_BACKEND_RUNTIME_MODE=bundled` or `LSP_MCP_REQUIRE_BUNDLED_BACKENDS=true`.
127
245
  - Required host tools:
128
- - TypeScript/Vue/Pyright backends: `node` + `npx`
129
- - Python backend: `uv` (or `uvx`)
246
+ - TypeScript/Vue/Pyright backends: `node` + `npx`
247
+ - Python backend: `uv` (or `uvx`)
130
248
  - Vue semantic features additionally require project-local deps in the Vue workspace:
131
249
  - `typescript`
132
250
  - `@vue/language-server`
133
251
  - Use `doctor` to get structured dependency checks and install commands.
252
+ - Optional benchmark paths:
253
+ - `LSP_MCP_BENCHMARK_REPORT_PATH` (default `.tmp/benchmark-latest.json`)
254
+ - `LSP_MCP_BENCHMARK_BASELINE_PATH` (default `.tmp/benchmark-baseline.json`)
134
255
 
135
256
  ## Better Out-of-Box Experience (Recommended)
136
257
 
@@ -146,6 +267,11 @@ When `LSP_MCP_AUTO_UPDATE=true`:
146
267
  # Install deps
147
268
  bun install
148
269
 
270
+ # Machine-readable benchmark report
271
+ bun run benchmark:report
272
+ # Optional trend diff (compare with .tmp/benchmark-baseline.json)
273
+ bun run benchmark:diff
274
+
149
275
  # Build local dist/ (lean default, no bundled backends)
150
276
  bun run build
151
277