@namzu/lsp
v0.3.3
Published
Language-server-backed code navigation for @namzu/sdk. Resolves definitions and references through a real language server over stdio, so an agent asked for call sites gets symbol resolution rather than regex matches.
Downloads
405
Readme
Language-server-backed code navigation for Namzu agents.
Install · Usage · Documentation
Code navigation for an agent — definitions, references, symbols and diagnostics — served by a real language server rather than by grep. One server per language, routed by file extension, disposed with the session. If either protocol stream closes while the process remains alive, in-flight and later calls fail immediately and the process remains owned until disposal.
Install
pnpm add @namzu/sdk @namzu/lsp@namzu/sdk is a peer dependency. Install both.
Usage
import { RoutingCodeNavigationProvider } from '@namzu/lsp'
import { getCodeNavigationTools, toolset } from '@namzu/sdk'
const rootDir = process.cwd()
const codeNavigation = new RoutingCodeNavigationProvider({
routes: [
{ extensions: ['.ts', '.tsx'], server: { command: 'ts-server', args: ['--stdio'], rootDir } },
{ extensions: ['.py'], server: { command: 'py-server', rootDir } },
],
})
const tools = toolset('lsp', getCodeNavigationTools(codeNavigation))
// …and when the session is over:
await codeNavigation.dispose()Documentation
License
FSL-1.1-MIT, converting to MIT two years after each release.
