MCP M5: lucisv-mcp ships in every platform vsix; the extension registers it with VS Code's agent mode; Agents guide

tools/release.sh builds -p lucisv_mcp for the host and every cross triple, stages lucisv-mcp[.exe] beside the two binaries (three per platform package, fifteen in the all-platforms one; the universal package still carries none), smoke-tests it (editors/vscode/mcp_smoke.js: initialize, tools/list ≥ 26, project_overview) loose and unzipped from the host and all-platforms packages; tools/audit_artifacts.sh audits the third name and rejects any other; prune_release_assets.sh unchanged (seven vsix names). editors/vscode/mcp.js: the three-rung binary ladder (lucisv.mcp.path → bundled → PATH), one McpStdioServerDefinition per workspace folder — the constructor is POSITIONAL (label, command, args, env, version) with cwd set afterwards; the plan's object form was wrong and is corrected — with `--root <folder> --index-cache <storage>`, refreshed on folder and setting changes, guarded so VS Code < 1.101 registers nothing but the command; a missing binary refused at resolve time with one output-channel line; the `lucisv.mcp.copyConfig` command puts the Claude Code / Cursor / VS Code snippet on the clipboard. package.json: contributes.mcpServerDefinitionProviders, lucisv.mcp.enabled/path, the command; engine stays ^1.82.0 (vsce 4 accepts). ci.yml runs node --test over the extension's unit tests. Docs: docs/site guides/agents.md with the tool table generated from the binary (site rebuilt), README paragraph, RELEASING.md, extension README/CHANGELOG (Unreleased), manual-acceptance rows 18–25 for the live-VS Code checks.

QA (Opus): API signature confirmed against VS Code 1.138's vscode.d.ts; 8 mutation checks caught by mcp_test.js; release.sh run end to end, vsix contents listed (three binaries, mcp.js, no test files), SHA256SUMS verified, the embedded binary smoke-tested, the vsix installed into an isolated profile. Gates: node --test 6/6, fmt clean.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
lucioandClaude Fable 5.1 committed 2026-09-23 15:59:07 -07:00
1 parent 23ec44455c
commit d4ec571958
41 files changed
+1639 -109

No files matched your search

+49 -30
View File
@@ -8,7 +8,7 @@ it lives in the appendix at the bottom.
## Cross-platform builds (`--cross`)
`tools/release.sh --cross` adds, next to the host (Apple Silicon) pair:
`tools/release.sh --cross` adds, next to the host (Apple Silicon) binaries:
`x86_64-apple-darwin` (Intel Mac), `x86_64-unknown-linux-musl` and
`aarch64-unknown-linux-musl` (any x86-64 / ARM64 Linux — statically linked,
no glibc dependency) and `x86_64-pc-windows-gnu`
@@ -22,12 +22,16 @@ runs on RHEL 8.x (verified for 8.10 by symbol audit:
install). The static musl build runs there too — the gnu build exists
for shops that require a native glibc link.
`--cross` also turns each cross-built pair into a **platform-specific `.vsix`**
that carries those two binaries inside it, so installing the extension needs no
Every build — host and each cross target — produces **three binaries**:
`lucisv` (the CLI), `lucisv-server` (the language server) and `lucisv-mcp`
(the MCP server for coding agents, `docs/features/mcp-packaging/README.md`).
`--cross` also turns each cross-built set into a **platform-specific `.vsix`**
that carries those three binaries inside it, so installing the extension needs no
separate binary install (`docs/features/editor-platform-vsix/README.md`). The
platform-independent `.vsix` — the same JavaScript, no binaries, server looked
up on `PATH` — is still built as the universal fallback, and one more package,
`lucisv-<version>-all.vsix`, carries **all five pairs at once**.
`lucisv-<version>-all.vsix`, carries **all five sets at once**.
| package | rust triple |
|---|---|
@@ -68,7 +72,7 @@ rustc, which lacks the cross std libs). The musl build links with
toolchain's `lib/` — its own rpath misses `libLLVM.dylib` in rustup's
layout. The Windows build needs mingw-w64 for the import libraries
(`libkernel32.a` and friends); rust's self-contained mode does not carry
them. Only the host binaries can be smoke-tested here (the Intel-Mac pair
them. Only the host binaries can be smoke-tested here (the Intel-Mac set
also runs under Rosetta and is); Linux and Windows artifacts are
file-type- and DLL-audited, not executed.
@@ -78,7 +82,7 @@ Four files, one number. Keep them identical.
| File | What to change |
|---|---|
| `Cargo.toml` | `[workspace.package] version` — **all eight crates inherit it** via `version.workspace = true`, so this is the only Rust edit |
| `Cargo.toml` | `[workspace.package] version` — **all nine crates inherit it** via `version.workspace = true`, so this is the only Rust edit |
| `Cargo.lock` | regenerated by any `cargo` command; run `cargo check --workspace` and commit the result |
| `editors/vscode/package.json` | `"version"` |
| `editors/vscode/package-lock.json` | `"version"` in **both** places (the top level and the `packages[""]` entry) |
@@ -119,27 +123,40 @@ verification error or a crash there is a release blocker by definition.
tools/release.sh # or: tools/release.sh -o /some/other/dir
```
It builds `--release`, copies the two binaries into `dist/` under
It builds `--release`, copies the three binaries into `dist/` under
version-and-host names, smoke-tests the server binary with
`editors/vscode/smoke.js`, packages the extension into `dist/lucisv-<version>.vsix`
and into the host's platform package, smoke-tests the server *unzipped out of*
that package, and writes `dist/SHA256SUMS`. `dist/` is gitignored and is
`editors/vscode/smoke.js` and the MCP server with `editors/vscode/mcp_smoke.js`
(initialize, `tools/list` with at least 26 tools, one `project_overview` over a
tiny temporary project), packages the extension into `dist/lucisv-<version>.vsix`
and into the host's platform package, runs both smoke tests again against the
binaries *unzipped out of* that package (and, with `--cross`, out of the `all`
package), and writes `dist/SHA256SUMS`. `dist/` is gitignored and is
deleted and recreated on every run.
```
dist/
lucisv-0.7.0-aarch64-apple-darwin
lucisv-server-0.7.0-aarch64-apple-darwin
lucisv-0.7.0.vsix # universal: no binaries, server from PATH
lucisv-0.7.0-darwin-arm64.vsix # the same extension with the pair inside
lucisv-0.56.0-aarch64-apple-darwin
lucisv-server-0.56.0-aarch64-apple-darwin
lucisv-mcp-0.56.0-aarch64-apple-darwin
lucisv-0.56.0.vsix # universal: no binaries, servers from PATH
lucisv-0.56.0-darwin-arm64.vsix # the same extension with the three inside
SHA256SUMS
```
With `--cross` the loose binaries appear for all six triples, the remaining four
platform packages (`darwin-x64`, `linux-x64`, `linux-arm64`, `win32-x64`) join
them, and so does the all-platforms `lucisv-<version>-all.vsix` — twelve
them, and so does the all-platforms `lucisv-<version>-all.vsix` — eighteen
binaries and **seven** `.vsix` files, plus `SHA256SUMS`. The `all` package needs
all five pairs to exist, so it is the one artifact a plain run cannot produce.
all five sets to exist, so it is the one artifact a plain run cannot produce.
| artifact | per triple | in a platform `.vsix` | in the `all` `.vsix` |
|---|---|---|---|
| `lucisv` | `lucisv-<version>-<triple>[.exe]` | `bin/lucisv[.exe]` | `bin/<platform>-<arch>/lucisv[.exe]` |
| `lucisv-server` | `lucisv-server-<version>-<triple>[.exe]` | `bin/lucisv-server[.exe]` | `bin/<platform>-<arch>/lucisv-server[.exe]` |
| `lucisv-mcp` | `lucisv-mcp-<version>-<triple>[.exe]` | `bin/lucisv-mcp[.exe]` | `bin/<platform>-<arch>/lucisv-mcp[.exe]` |
`tools/audit_artifacts.sh` gives all three the same audit per triple and fails
on any other name.
Verify the checksums the way a downloader would:
@@ -161,7 +178,7 @@ The script runs, inside `editors/vscode/`:
```bash
npm ci # 8 packages, exact lockfile
npx @vscode/vsce package --out ../../dist/lucisv-<version>.vsix
# then, per platform, with the two binaries staged in editors/vscode/bin/:
# then, per platform, with the three binaries staged in editors/vscode/bin/:
npx @vscode/vsce package --target darwin-arm64 \
--out ../../dist/lucisv-<version>-darwin-arm64.vsix
```
@@ -180,24 +197,25 @@ npx @vscode/vsce package --target darwin-arm64 \
a packaging regression — it reproduces with a two-file toy extension. The fix
is to package from a plain path, which is why `release.sh` packages inside the
repo and only writes its *output* to `-o`.
- `.vscodeignore` keeps `smoke.js`, `restart_test.js`, `.vscode/**` and
`.gitignore` out of the package. It must **not** exclude `bin/`, which is
- `.vscodeignore` keeps `smoke.js`, `mcp_smoke.js`, every `*_test.js`,
`.vscode/**` and `.gitignore` out of the package. It must **not** exclude `bin/`, which is
where the platform packages' binaries are staged — nor `restart.js`, which
`extension.js` requires at runtime (an extension that ships without it fails
to activate). Check that after any change to it:
`unzip -l dist/lucisv-<version>.vsix | grep -E 'smoke|restart_test'` must
print nothing, `unzip -l dist/lucisv-<version>.vsix | grep restart.js` must
print `extension/restart.js`, and
to activate), nor `mcp.js`, for the same reason. Check that after any change
to it: `unzip -l dist/lucisv-<version>.vsix | grep -E 'smoke|_test'` must
print nothing, `unzip -l dist/lucisv-<version>.vsix | grep -E 'restart.js|mcp.js'`
must print `extension/restart.js` and `extension/mcp.js`, and
`unzip -l dist/lucisv-<version>.vsix | grep syntaxes` must print the grammar —
without it, hover cards ship unhighlighted.
- **`editors/vscode/bin/` is transient.** `release.sh` stages one platform's
pair into it (or, for the `all` package, all five pairs into
three binaries into it (or, for the `all` package, all five sets into
`bin/<platform>-<arch>/` subdirectories), packages, and removes it again, with
an `EXIT` trap so a failed run cannot leave binaries in the working tree; it is
gitignored as a second line of defence. Every package is then asserted with
`unzip -Z1 <vsix> 'extension/bin/*'`: nothing for the universal one, exactly
`lucisv` and `lucisv-server` (`.exe` for `win32-x64`) for a platform one, and
exactly ten entries under five subdirectories for the `all` one — Info-ZIP's
`lucisv`, `lucisv-server` and `lucisv-mcp` (`.exe` for `win32-x64`) for a
platform one, and exactly fifteen entries under five subdirectories for the
`all` one — Info-ZIP's
`*` matches `/`, so one pattern covers both layouts. A stale `bin/` would
otherwise ship one platform's server to another's users.
@@ -213,14 +231,15 @@ code --install-extension dist/lucisv-0.7.0-darwin-arm64.vsix # binaries inside
code --install-extension dist/lucisv-0.7.0.vsix # or: server from PATH
```
The platform package is the one to hand a user: it carries `lucisv` and
`lucisv-server` for that machine, so the two `install -m 755` lines above become
The platform package is the one to hand a user: it carries `lucisv`,
`lucisv-server` and `lucisv-mcp` for that machine, so the two `install -m 755` lines above become
optional. Pick the package by machine — `darwin-arm64`, `darwin-x64`,
`linux-x64`, `linux-arm64`, `win32-x64`. When the machine is *not* known in
advance — a mixed fleet, an offline mirror, Alpine — hand over
`lucisv-<version>-all.vsix` instead: same binaries, all five platforms in the
one file, at ~13 MB rather than ~3 MB. The universal `lucisv-<version>.vsix`
remains the no-binaries fallback.
one file, several times the size of a platform package (a platform package
measured 6.8 MB at 0.56.0 with the three binaries; `lucisv-mcp` is 1.9 MB of
that). The universal `lucisv-<version>.vsix` remains the no-binaries fallback.
Publishing means attaching the seven `.vsix` packages plus `SHA256SUMS` to a
git tag / release page on `git.luci.ooo` — the CI release does exactly that