@mrclrchtr/supi-lsp
v2.4.1
Published
SuPi LSP extension — Language Server Protocol integration for pi
Maintainers
Readme
@mrclrchtr/supi-lsp
Language Server Protocol runtime library for the pi coding agent.
This is a library-only package — it has no pi extension surface and does not register public tools by itself. Public semantic code-intelligence behavior is exposed through @mrclrchtr/supi-code-intelligence's code_* tools.
Install
npm install @mrclrchtr/supi-lspWhat this package provides
@mrclrchtr/supi-lsp provides the semantic substrate used by SuPi's code-intelligence stack:
- a session-scoped
SessionLspService - LSP client lifecycle, transport, and workspace routing
- diagnostics collection, stale-diagnostic recovery, and summaries
- a shared
SemanticProvideradapter for the workspace runtime - operation-aware semantic refactor planning for first-wave precise text-edit operations
First-wave refactor mapping in the semantic provider:
rename_symboland legacyrenamealias →textDocument/renameupdate_imports→ precise organize-imports/source actions onlydelete_dead_code→ precise quickfix/refactor-rewrite actions onlyrename_file/move_file→ explicit unavailable results for now
The historical LSP status overlay is no longer part of this package. Substrate-owned status UX now lives in @mrclrchtr/supi-code-intelligence as the /supi-ci-status command.
Startup performance
Language servers start automatically when a PI session opens. By default, every server with matching source files in the project is started concurrently — in polyglot repos or monorepos with multiple language footprints, this parallel startup can cause a significant CPU spike.
To reduce startup overhead:
Disable specific language servers that you don't need. Only servers whose source files are detected in the project will be started. To explicitly exclude a language:
{ "lsp": { "servers": { "python": { "enabled": false }, "rust": { "enabled": false } } } }Add this to
.pi/supi/config.json(project) or~/.pi/agent/supi/config.json(global). Only the listed language servers are disabled; all others remain active.Note: The global
lsp.enabledswitch andlsp.activeallowlist were removed in v0.7.0. LSP is always-on by default. Per-languagelsp.servers.<language>.enabled: falseis the only supported way to opt out. If your config still haslsp.enabledorlsp.activekeys, they are ignored and a deprecation warning will appear at session start.Server discovery walks the project tree at depth 3 (skipping
node_modules,.git,.pnpm). Every detected language server starts in parallel viaPromise.all.
Architecture
@mrclrchtr/supi-lsp is the semantic substrate in SuPi's code-understanding stack.
It depends on @mrclrchtr/supi-core and @mrclrchtr/supi-code-runtime for shared
contracts, and provides a session-scoped LSP service that publishes semantic and
diagnostic capabilities into the shared workspace runtime.
supi-code-runtime ← shared contracts + workspace runtime
↑
supi-lsp ← LSP client + session-scoped service + runtime capabilities
↑
supi-code-intelligence ← public code_* tools over the semantic substratePackage surfaces
@mrclrchtr/supi-lsp/api— reusable session-scoped LSP service and related types@mrclrchtr/supi-lsp/provider/lsp-semantic-provider— sharedSemanticProvideradapter
Example:
import { getSessionLspService, toLspPosition } from "@mrclrchtr/supi-lsp/api";
const state = getSessionLspService("/project");
if (state.kind === "ready") {
const defs = await state.service.definition("src/index.ts", toLspPosition(6, 11));
}SessionLspService methods use raw 0-based LSP positions. Public code_* tools keep the user-facing 1-based coordinate UX.
Source
src/client/— LSP client, transport, refresh, and request handlingsrc/config/— server config, defaults, capabilities, and exported LSP protocol typessrc/diagnostics/— stale diagnostics, suppression diagnostics, and workspace sentinelssrc/manager/— manager lifecycle, routing, diagnostics, and recovery helperssrc/provider/lsp-semantic-provider.ts— sharedSemanticProvideradaptersrc/session/— service registry, runtime registration, scanner, and controller logicsrc/api.ts— reusable developer-facing surfacesrc/index.ts— package-root re-export surface
