@octocodeai/octocode-engine 16.6.2 → 17.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 +121 -119
- package/dist/lsp/client.d.ts +17 -9
- package/dist/lsp/client.js +25 -25
- package/dist/lsp/config.js +1 -1
- package/dist/lsp/lspClientPool.d.ts +2 -0
- package/dist/lsp/lspClientPool.js +9 -4
- package/dist/lsp/manager.js +25 -3
- package/dist/lsp/native.d.ts +2 -1
- package/dist/lsp/resolver.js +10 -4
- package/dist/lsp/serverManifest.d.ts +9 -8
- package/dist/lsp/serverManifest.js +49 -11
- package/dist/lsp/serverManifestData.js +85 -22
- package/dist/lsp/serverProvisioner.js +13 -4
- package/dist/lsp/types.d.ts +11 -0
- package/dist/security/commandValidator.js +3 -3
- package/dist/security/contentSanitizer.js +4 -3
- package/dist/security/discoveryFilter.js +3 -0
- package/dist/security/ignoredPathFilter.js +5 -2
- package/dist/security/pathValidator.js +17 -19
- package/dist/security/registry.js +27 -9
- package/dist/security/securityConstants.js +7 -1
- package/dist/security/withSecurityValidation.d.ts +1 -1
- package/dist/security/withSecurityValidation.js +15 -3
- package/docs/LSP_SERVER_LIFECYCLE.md +258 -0
- package/index.d.ts +57 -93
- package/index.js +2 -2
- package/package.json +15 -11
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
[](https://github.com/modelcontextprotocol/servers)
|
|
7
7
|
[](https://deepwiki.com/bgauryy/octocode)
|
|
8
|
+
|
|
8
9
|
[](https://octocode.ai)
|
|
9
10
|
[](https://www.youtube.com/@Octocode-ai)
|
|
10
11
|
|
|
@@ -12,9 +13,7 @@
|
|
|
12
13
|
|
|
13
14
|
**Evidence-first code research for AI agents and developers.**
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Run it as a **CLI** or an **MCP server**. A **Rust engine** keeps every call fast and token-efficient, minifying and skeletonizing code so an agent reads the shape of a file instead of every byte, from a single file to a mega-repo. It is also the best tool for **cross-repository research and exploration across millions of repositories**.
|
|
16
|
+
Evidence from your **local workspace** and **external** sources (GitHub repos, PRs, npm). One toolset: ripgrep + AST search, trees, precise reads, and LSP — as a **CLI** or **MCP server**, backed by a **Rust engine** for fast, token-efficient results across single files or mega-repos.
|
|
18
17
|
|
|
19
18
|
---
|
|
20
19
|
|
|
@@ -33,48 +32,50 @@ Run it as a **CLI** or an **MCP server**. A **Rust engine** keeps every call fas
|
|
|
33
32
|
- [Skills](#skills)
|
|
34
33
|
- [Architecture](#architecture)
|
|
35
34
|
- [Documentation](#documentation)
|
|
35
|
+
- [Troubleshooting](#troubleshooting)
|
|
36
36
|
|
|
37
37
|
---
|
|
38
38
|
|
|
39
39
|
## Quick Start
|
|
40
40
|
|
|
41
|
-
**1.
|
|
41
|
+
**1. Run the Octocode CLI with `npx`**
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
|
-
|
|
44
|
+
npx octocode --help
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
**2. Authenticate with GitHub** — optional, but unlocks private repositories and higher API rate limits:
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
|
-
octocode auth login
|
|
50
|
+
npx octocode auth login
|
|
51
|
+
npx octocode status # verify the active token source
|
|
51
52
|
```
|
|
52
53
|
|
|
53
|
-
**3. Choose your interface.** The same engine and
|
|
54
|
+
**3. Choose your interface.** The same engine and 12 tools run identically either way.
|
|
54
55
|
|
|
55
56
|
**🖥️ CLI** — research straight from your terminal:
|
|
56
57
|
|
|
57
58
|
```bash
|
|
58
|
-
octocode
|
|
59
|
+
npx octocode
|
|
59
60
|
```
|
|
60
61
|
|
|
61
|
-
**🤖 MCP** —
|
|
62
|
-
|
|
63
|
-
- **Cursor / VS Code** — one-click install:
|
|
62
|
+
**🤖 MCP** — one-click install:
|
|
64
63
|
|
|
65
|
-
|
|
64
|
+
- [<img src="https://cursor.com/deeplink/mcp-install-dark.svg" alt="Install in Cursor">](https://cursor.com/en/install-mcp?name=octocode&config=eyJjb21tYW5kIjoibnB4IiwidHlwZSI6InN0ZGlvIiwiYXJncyI6WyJAb2N0b2NvZGVhaS9tY3BAbGF0ZXN0Il19)
|
|
65
|
+
- [<img src="https://img.shields.io/badge/VS_Code-Install_Server-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white" alt="Install in VS Code">](https://insiders.vscode.dev/redirect/mcp/install?name=octocode&config=%7B%22command%22%3A%22npx%22%2C%22type%22%3A%22stdio%22%2C%22args%22%3A%5B%22%40octocodeai%2Fmcp%40latest%22%5D%7D)
|
|
66
|
+
- [<img src="https://img.shields.io/badge/VS_Code_Insiders-Install_Server-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white" alt="Install in VS Code Insiders">](https://insiders.vscode.dev/redirect/mcp/install?name=octocode&config=%7B%22command%22%3A%22npx%22%2C%22type%22%3A%22stdio%22%2C%22args%22%3A%5B%22%40octocodeai%2Fmcp%40latest%22%5D%7D&quality=insiders)
|
|
67
|
+
- [<img src="https://img.shields.io/badge/Windsurf-Install_Server-1a1a1a?style=flat-square&logoColor=white" alt="Install in Windsurf">](windsurf://mcp/install?name=octocode&config=%7B%22command%22%3A%22npx%22%2C%22type%22%3A%22stdio%22%2C%22args%22%3A%5B%22%40octocodeai%2Fmcp%40latest%22%5D%7D)
|
|
68
|
+
- [<img src="https://kiro.dev/images/add-to-kiro.svg" alt="Install in Kiro">](https://kiro.dev/launch/mcp/add?name=octocode&config=%7B%22command%22%3A%22npx%22%2C%22type%22%3A%22stdio%22%2C%22args%22%3A%5B%22%40octocodeai%2Fmcp%40latest%22%5D%7D)
|
|
69
|
+
- [<img src="https://goose-docs.ai/img/extension-install-dark.svg" alt="Install in Goose">](https://goose-docs.ai/extension?cmd=npx&arg=%40octocodeai%2Fmcp%40latest&id=octocode&name=octocode&description=Evidence-first%20code%20research%20for%20AI%20agents)
|
|
70
|
+
- [<img src="https://files.lmstudio.ai/deeplink/mcp-install-light.svg" alt="Install in LM Studio">](https://lmstudio.ai/install-mcp?name=octocode&config=eyJjb21tYW5kIjoibnB4IiwidHlwZSI6InN0ZGlvIiwiYXJncyI6WyJAb2N0b2NvZGVhaS9tY3BAbGF0ZXN0Il19)
|
|
66
71
|
|
|
67
|
-
|
|
72
|
+
**Claude Code:**
|
|
68
73
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
- **Any other client** — interactive installer:
|
|
74
|
+
```bash
|
|
75
|
+
claude mcp add-json octocode --scope user '{"command":"npx","type":"stdio","args":["@octocodeai/mcp@latest"]}'
|
|
76
|
+
```
|
|
74
77
|
|
|
75
|
-
|
|
76
|
-
octocode install
|
|
77
|
-
```
|
|
78
|
+
**Any other client:** `npx octocode install`
|
|
78
79
|
|
|
79
80
|
➡️ Learn more at **[octocode.ai](https://octocode.ai)**.
|
|
80
81
|
|
|
@@ -104,8 +105,7 @@ Octocode is useful whenever the next coding step depends on finding and proving
|
|
|
104
105
|
| **Semantic navigation** | Resolve definitions, references, callers/callees, call hierarchy, hovers, symbols, diagnostics, and type relationships through LSP. |
|
|
105
106
|
| **Structural matching** | Run AST-shaped searches with patterns or YAML rules so comments and strings do not become false positives. |
|
|
106
107
|
| **Large-file context** | Minify, skeletonize, or paginate code so agents spend tokens on relevant structure instead of boilerplate. |
|
|
107
|
-
| **
|
|
108
|
-
| **Agent workflows** | Expose the same engine through MCP, CLI, OQL, and Agent Skills so assistants and humans use one evidence model. |
|
|
108
|
+
| **Agent workflows** | Same engine via MCP, CLI, OQL, and Agent Skills. |
|
|
109
109
|
|
|
110
110
|
See [Quick Start](#quick-start) to install in your terminal or AI assistant.
|
|
111
111
|
|
|
@@ -113,7 +113,7 @@ See [Quick Start](#quick-start) to install in your terminal or AI assistant.
|
|
|
113
113
|
|
|
114
114
|
## Tools
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
**12 always-on tools** (same on [MCP](#mcp) and [CLI](#cli)). Local tools on by default (`ENABLE_LOCAL=false` to disable). `ghCloneRepo` is MCP opt-in (`ENABLE_CLONE=true`), CLI on by default. Flags: [Configuration](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md).
|
|
117
117
|
|
|
118
118
|
**Token knobs.** `concise:true` returns path/title-only lists. `minify` controls file read density: `symbols` = skeleton with line numbers, `standard` = comments/blanks stripped (default), `none` = exact bytes.
|
|
119
119
|
|
|
@@ -136,7 +136,6 @@ Octocode ships **14 research tools**; the same implementations run identically o
|
|
|
136
136
|
| `localViewStructure` | Browse a local directory tree: depth, filters, pagination, metadata. | `concise` |
|
|
137
137
|
| `localFindFiles` | Find local files and directories by name, path, regex, extension, size, time, permissions, type. | |
|
|
138
138
|
| `localGetFileContent` | Read a local file or region: exact slice, match string, line range, or paginated chars. | `minify` |
|
|
139
|
-
| `localBinaryInspect` | Inspect archives, compressed streams, and native binaries: inspect (format/symbols/imports/deps), list, extract, decompress, strings. | |
|
|
140
139
|
|
|
141
140
|
### Package Search
|
|
142
141
|
|
|
@@ -148,37 +147,52 @@ Octocode ships **14 research tools**; the same implementations run identically o
|
|
|
148
147
|
|
|
149
148
|
| Tool | What it does |
|
|
150
149
|
|------|--------------|
|
|
151
|
-
| `lspGetSemantics` | Typed semantic navigation. Raw tools support `definition`, `references`, `callers`, `callees`, `callHierarchy`, `hover`, `documentSymbols`, `typeDefinition`, `implementation`, `workspaceSymbol`, `supertypes`, `subtypes`, and `diagnostic`. The CLI uses `octocode search <file> --op <type>` for semantics and `octocode search <file> --symbols` for file or directory symbol outlines. Navigation runs through installed language servers (see the [LSP Tools Reference](https://github.com/bgauryy/octocode/blob/main/docs/
|
|
150
|
+
| `lspGetSemantics` | Typed semantic navigation. Raw tools support `definition`, `references`, `callers`, `callees`, `callHierarchy`, `hover`, `documentSymbols`, `typeDefinition`, `implementation`, `workspaceSymbol`, `supertypes`, `subtypes`, and `diagnostic`. The CLI uses `npx octocode search <file> --op <type>` for semantics and `npx octocode search <file> --symbols` for file or directory symbol outlines. Navigation runs through installed language servers (see the [LSP Tools Reference](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_TOOLS.md#lsp-tools-reference)). |
|
|
152
151
|
|
|
153
152
|
### OQL Search
|
|
154
153
|
|
|
155
154
|
| Tool | What it does |
|
|
156
155
|
|------|--------------|
|
|
157
|
-
| `oqlSearch` | Runs typed OQL queries across code, content, structure, files, semantics, repositories, packages, pull requests, commits,
|
|
156
|
+
| `oqlSearch` | Runs typed OQL queries across code, content, structure, files, semantics, repositories, packages, pull requests, commits, diff, research, graph, and materialization targets. |
|
|
158
157
|
|
|
159
|
-
Full schemas, fields, and examples for every tool live in [`docs/
|
|
158
|
+
Full schemas, fields, and examples for every tool live in [`docs/OCTOCODE_TOOLS.md`](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_TOOLS.md) (linked under [Documentation](#documentation)).
|
|
160
159
|
|
|
161
160
|
---
|
|
162
161
|
|
|
163
162
|
## MCP
|
|
164
163
|
|
|
165
|
-
The MCP server exposes the Octocode tool catalog directly to your AI assistant over stdio.
|
|
166
|
-
|
|
167
|
-
**Install:** see [Quick Start](#quick-start) for one-click badges, the `claude mcp add-json` command, or the interactive `octocode install` (non-interactive: `octocode install --ide cursor|claude-code|…`).
|
|
164
|
+
The MCP server exposes the Octocode tool catalog directly to your AI assistant over stdio.
|
|
168
165
|
|
|
169
166
|
https://github.com/user-attachments/assets/de8d14c0-2ead-46ed-895e-09144c9b5071
|
|
170
167
|
|
|
171
168
|
### Manual Configuration
|
|
172
169
|
|
|
173
|
-
Add to your MCP client config
|
|
170
|
+
Add to your MCP client config. Pick the package that matches the version you want:
|
|
171
|
+
|
|
172
|
+
**New Octocode (Rust-powered engine)** — use `@octocodeai/mcp`:
|
|
174
173
|
|
|
175
174
|
```json
|
|
176
175
|
{
|
|
177
|
-
"
|
|
178
|
-
"
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
176
|
+
"octocode": {
|
|
177
|
+
"command": "npx",
|
|
178
|
+
"type": "stdio",
|
|
179
|
+
"args": [
|
|
180
|
+
"@octocodeai/mcp@latest"
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Classic octocode-mcp** — use `octocode-mcp`:
|
|
187
|
+
|
|
188
|
+
```json
|
|
189
|
+
{
|
|
190
|
+
"octocode": {
|
|
191
|
+
"command": "npx",
|
|
192
|
+
"type": "stdio",
|
|
193
|
+
"args": [
|
|
194
|
+
"octocode-mcp@latest"
|
|
195
|
+
]
|
|
182
196
|
}
|
|
183
197
|
}
|
|
184
198
|
```
|
|
@@ -192,9 +206,9 @@ Add a GitHub token and options under `env` — see [Authentication](#authenticat
|
|
|
192
206
|
Same research engine, no MCP client needed. Local paths route to local tools; `owner/repo[/path]` routes to GitHub.
|
|
193
207
|
|
|
194
208
|
```bash
|
|
195
|
-
octocode auth login # authenticate once
|
|
196
|
-
octocode status # verify setup
|
|
197
|
-
octocode --help # full usage
|
|
209
|
+
npx octocode auth login # authenticate once
|
|
210
|
+
npx octocode status # verify setup
|
|
211
|
+
npx octocode --help # full usage
|
|
198
212
|
```
|
|
199
213
|
|
|
200
214
|
### Commands
|
|
@@ -203,22 +217,22 @@ octocode --help # full usage
|
|
|
203
217
|
|
|
204
218
|
| Command | What it does |
|
|
205
219
|
|---------|--------------|
|
|
206
|
-
| `octocode search <term> <path\|owner/repo>` | Text, regex, AST structural (`--pattern`), or full OQL (`--query`) |
|
|
207
|
-
| `octocode search <path\|owner/repo> --tree` | Browse directory or repository structure |
|
|
208
|
-
| `octocode search <file>` | Read file content; `--content-view exact\|compact\|symbols` or `--raw` |
|
|
209
|
-
| `octocode search <file> --symbols` | Symbol outline for a file or source tree |
|
|
210
|
-
| `octocode search --query <oql-json>` | Full OQL across all target types (code, commits, PRs, packages,
|
|
220
|
+
| `npx octocode search <term> <path\|owner/repo>` | Text, regex, AST structural (`--pattern`), or full OQL (`--query`) |
|
|
221
|
+
| `npx octocode search <path\|owner/repo> --tree` | Browse directory or repository structure |
|
|
222
|
+
| `npx octocode search <file>` | Read file content; `--content-view exact\|compact\|symbols` or `--raw` |
|
|
223
|
+
| `npx octocode search <file> --symbols` | Symbol outline for a file or source tree |
|
|
224
|
+
| `npx octocode search --query <oql-json>` | Full OQL across all target types (code, commits, PRs, packages, …) |
|
|
211
225
|
|
|
212
226
|
#### More commands
|
|
213
227
|
|
|
214
|
-
- **GitHub & npm** — `search <…> --target repositories|packages|pullRequests|commits|
|
|
215
|
-
- **LSP** — `search <file> --op definition|references|callers|callees|hover|diagnostic|callHierarchy` (`--symbol`, `--line` to narrow)
|
|
216
|
-
- **Cache & clone** — `clone`, `
|
|
217
|
-
- **Skills** — `skill --list | --name <skill> | --add <github-
|
|
218
|
-
- **Language servers** — `lsp-server list|install|status|uninstall`
|
|
219
|
-
- **Setup & introspection** — `install`, `auth`, `status`, `tools`, `context`
|
|
228
|
+
- **GitHub & npm** — `npx octocode search <…> --target repositories|packages|pullRequests|commits|diff`
|
|
229
|
+
- **LSP** — `npx octocode search <file> --op definition|references|callers|callees|hover|diagnostic|callHierarchy` (`--symbol`, `--line` to narrow)
|
|
230
|
+
- **Cache & clone** — `npx octocode clone`, `npx octocode cache fetch|status|clear`
|
|
231
|
+
- **Skills** — `npx octocode skill --list | --name <skill> | --add <github-path> | --install-all`
|
|
232
|
+
- **Language servers** — `npx octocode lsp-server list|install|status|uninstall|clean`
|
|
233
|
+
- **Setup & introspection** — `npx octocode install`, `npx octocode auth`, `npx octocode status`, `npx octocode tools`, `npx octocode context`
|
|
220
234
|
|
|
221
|
-
Full syntax, flags, and exit codes: [CLI
|
|
235
|
+
Full syntax, flags, and exit codes: [Octocode CLI Guide](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_CLI.md)
|
|
222
236
|
|
|
223
237
|
---
|
|
224
238
|
|
|
@@ -234,7 +248,7 @@ environment variables > <octocode-home>/.octocoderc > built-in defaults
|
|
|
234
248
|
2. **Global config**: `<octocode-home>/.octocoderc`, machine-wide defaults read by **both the CLI and the MCP server**.
|
|
235
249
|
3. **Built-in defaults**: used when neither is set.
|
|
236
250
|
|
|
237
|
-
**Octocode home** (`<octocode-home>`) holds the global config, encrypted credentials, sessions, stats, and tmp materialization caches.
|
|
251
|
+
**Octocode home** (`<octocode-home>`) holds the global config, encrypted credentials, sessions, stats, and tmp materialization caches. It defaults by platform and can be overridden with `OCTOCODE_HOME`:
|
|
238
252
|
|
|
239
253
|
| Platform | Location |
|
|
240
254
|
|----------|----------|
|
|
@@ -242,7 +256,7 @@ environment variables > <octocode-home>/.octocoderc > built-in defaults
|
|
|
242
256
|
| Linux | `${XDG_CONFIG_HOME:-~/.config}/.octocode` |
|
|
243
257
|
| Windows | `%APPDATA%\.octocode` |
|
|
244
258
|
|
|
245
|
-
Set values as MCP `env` entries (per client; these win over `.octocoderc`) or globally in `<octocode-home>/.octocoderc` (JSON with comments). **Tokens never go in `.octocoderc`** — use `env` or `octocode auth login`.
|
|
259
|
+
Set values as MCP `env` entries (per client; these win over `.octocoderc`) or globally in `<octocode-home>/.octocoderc` (JSON with comments). **Tokens never go in `.octocoderc`** — use `env` or `npx octocode auth login`.
|
|
246
260
|
|
|
247
261
|
### Common settings
|
|
248
262
|
|
|
@@ -250,6 +264,7 @@ The **Scope** column shows where a setting applies: `Both`, or `MCP` (the CLI ig
|
|
|
250
264
|
|
|
251
265
|
| Env var | `.octocoderc` key | Default | Scope | What it does |
|
|
252
266
|
|---------|-------------------|---------|-------|--------------|
|
|
267
|
+
| `OCTOCODE_HOME` | env only | platform default | Both | Overrides the Octocode data directory for config, credentials, sessions, stats, and caches. |
|
|
253
268
|
| `OCTOCODE_TOKEN` / `GH_TOKEN` / `GITHUB_TOKEN` | env only | unset | Both | GitHub token, in priority order. Tokens stay in env, never in `.octocoderc`. |
|
|
254
269
|
| `GITHUB_API_URL` | `github.apiUrl` | `https://api.github.com` | Both | API endpoint; use `/api/v3` for GitHub Enterprise. |
|
|
255
270
|
| `ENABLE_LOCAL` | `local.enabled` | `true` | Both | Turns local filesystem + LSP tools on/off; set `false` to disable. |
|
|
@@ -263,19 +278,19 @@ The **Scope** column shows where a setting applies: `Both`, or `MCP` (the CLI ig
|
|
|
263
278
|
|
|
264
279
|
> **Local defaults on; clone differs by surface.** Both CLI and MCP default local tools on; set `ENABLE_LOCAL=false` to disable them. The **CLI** defaults clone on, while the **MCP server** requires `ENABLE_CLONE=true`.
|
|
265
280
|
|
|
266
|
-
Per-project overrides and custom LSP servers live in a workspace `.octocode/` folder. For the full `.octocoderc` schema, a ready-to-copy example, clone-cache tuning, GitHub Enterprise setup, and precedence details, see the [Configuration Reference](https://github.com/bgauryy/octocode/blob/main/docs/
|
|
281
|
+
Per-project overrides and custom LSP servers live in a workspace `.octocode/` folder. For the full `.octocoderc` schema, a ready-to-copy example, clone-cache tuning, GitHub Enterprise setup, and precedence details, see the [Configuration Reference](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md).
|
|
267
282
|
|
|
268
283
|
---
|
|
269
284
|
|
|
270
285
|
## Authentication Methods
|
|
271
286
|
|
|
272
|
-
GitHub-backed tools require authentication. Any one method is enough. Full details: [Authentication Setup](https://github.com/bgauryy/octocode/blob/main/docs/
|
|
287
|
+
GitHub-backed tools require authentication. Any one method is enough. Full details: [Authentication Setup](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md).
|
|
273
288
|
|
|
274
289
|
### Option 1: Octocode CLI (Recommended)
|
|
275
290
|
|
|
276
291
|
```bash
|
|
277
|
-
octocode auth login
|
|
278
|
-
octocode status # verify the active token source
|
|
292
|
+
npx octocode auth login
|
|
293
|
+
npx octocode status # verify the active token source
|
|
279
294
|
```
|
|
280
295
|
|
|
281
296
|
Interactive login lets you choose Octocode browser OAuth or `gh auth login`. Octocode OAuth credentials are stored encrypted on disk.
|
|
@@ -314,7 +329,7 @@ Create a token at [github.com/settings/tokens](https://github.com/settings/token
|
|
|
314
329
|
- **Schema validation** runs before any tool executes; untrusted input size and shape are bounded.
|
|
315
330
|
- **Credentials.** GitHub auth via env tokens, AES-256-GCM-encrypted on-disk OAuth, or the `gh` CLI; tokens are never logged.
|
|
316
331
|
|
|
317
|
-
**Full security model, pipeline, and threat coverage: [SECURITY.md](https://github.com/bgauryy/octocode/blob/main/docs/SECURITY.md).** Related: [Authentication](https://github.com/bgauryy/octocode/blob/main/docs/
|
|
332
|
+
**Full security model, pipeline, and threat coverage: [SECURITY.md](https://github.com/bgauryy/octocode/blob/main/docs/SECURITY.md).** Related: [Authentication](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md) · [Configuration](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md) · [Credentials](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md#github-token)
|
|
318
333
|
|
|
319
334
|
---
|
|
320
335
|
|
|
@@ -336,31 +351,19 @@ Four code-intelligence axes; three are native to the Rust engine and need no ext
|
|
|
336
351
|
## Skills
|
|
337
352
|
|
|
338
353
|
> [Agent Skills](https://agentskills.io/what-are-skills) are a lightweight, open format for extending AI agent capabilities.
|
|
339
|
-
> Browse and install on [**skills.sh/bgauryy/octocode-mcp**](https://www.skills.sh/bgauryy/octocode-mcp)
|
|
354
|
+
> Browse and install on [**skills.sh/bgauryy/octocode-mcp**](https://www.skills.sh/bgauryy/octocode-mcp)
|
|
340
355
|
|
|
341
|
-
|
|
356
|
+
**1 skill** under [`skills/`](https://github.com/bgauryy/octocode/tree/main/skills), bundled in the `octocode` package. Start with ⭐ [Research](https://www.skills.sh/bgauryy/octocode-mcp/octocode-research) for evidence-first code work.
|
|
342
357
|
|
|
343
358
|
```bash
|
|
344
|
-
npx octocode skill --list
|
|
345
|
-
npx octocode skill --name octocode-
|
|
346
|
-
npx octocode skill --
|
|
347
|
-
npx octocode skill --name octocode-engineer --all --dry-run # preview before installing everywhere
|
|
348
|
-
npx octocode skill --add owner/repo/skills/my-skill # any GitHub folder
|
|
359
|
+
npx octocode skill --list
|
|
360
|
+
npx octocode skill --name octocode-research
|
|
361
|
+
npx octocode skill --help
|
|
349
362
|
```
|
|
350
363
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
|
354
|
-
|-------|-----------|-------------|
|
|
355
|
-
| [**CLI**](https://www.skills.sh/bgauryy/octocode-mcp/octocode) | `octocode/` | You want to research code from the terminal without MCP: local, GitHub, npm, file, repo, PR, or package lookup. |
|
|
356
|
-
| ⭐ [**Engineer**](https://www.skills.sh/bgauryy/octocode-mcp/octocode-engineer) | `octocode-engineer/` | You need to understand, implement, review, refactor, or audit code. The default for "work on this code." |
|
|
357
|
-
| [**Loop**](https://www.skills.sh/bgauryy/octocode-mcp/octocode-loop) | `octocode-loop/` | The goal and research path are clear and the work needs grounded Act -> Observe -> Learn -> Repeat loops until evidence converges. |
|
|
358
|
-
| [**Brainstorming**](https://www.skills.sh/bgauryy/octocode-mcp/octocode-brainstorming) | `octocode-brainstorming/` | The idea is fuzzy: validate prior art, check whether something is worth building, or produce a decision brief. |
|
|
359
|
-
| [**RFC Generator**](https://www.skills.sh/bgauryy/octocode-mcp/octocode-rfc-generator) | `octocode-rfc-generator/` | You need a design doc, RFC, architecture proposal, migration plan, or rollout plan before coding. |
|
|
360
|
-
| [**Roast**](https://www.skills.sh/bgauryy/octocode-mcp/octocode-roast) | `octocode-roast/` | You want brutal but actionable code critique with severity-ranked findings and fixes. |
|
|
361
|
-
| [**Skills**](https://www.skills.sh/bgauryy/octocode-mcp/octocode-skills) | `octocode-skills/` | You are working on Agent Skills themselves: find, evaluate, install, lint, create, or update `SKILL.md` folders. |
|
|
362
|
-
| [**Awareness**](https://www.skills.sh/bgauryy/octocode-mcp/octocode-awareness) | `octocode-awareness/` | You need memory, file locks, or verify-before-conclude across runs or concurrent agents in a shared/dirty repo. |
|
|
363
|
-
| [**Stats**](https://www.skills.sh/bgauryy/octocode-mcp/octocode-stats) | `octocode-stats/` | You want to visualize Octocode usage: tokens/chars saved, cache hits, errors, and rate limits from `stats.json`. |
|
|
364
|
+
| Skill | Install | Use when |
|
|
365
|
+
|-------|---------|----------|
|
|
366
|
+
| ⭐ [**Research**](https://www.skills.sh/bgauryy/octocode-mcp/octocode-research) | `npx octocode skill --name octocode-research` | Evidence-first research, review, refactor, architecture. |
|
|
364
367
|
|
|
365
368
|
---
|
|
366
369
|
|
|
@@ -400,64 +403,63 @@ client → sanitize inputs (Rust) → run tool (GitHub / FS / LSP) → sanitize
|
|
|
400
403
|
| Directory | npm package | Role |
|
|
401
404
|
|-----------|-------------|------|
|
|
402
405
|
| [`packages/octocode`](https://github.com/bgauryy/octocode/tree/main/packages/octocode) | `octocode` | CLI: quick commands, raw tool runner, skill installs, auth/login/logout, install, status, context. |
|
|
403
|
-
| [`packages/octocode-mcp`](https://github.com/bgauryy/octocode/tree/main/packages/octocode-mcp) |
|
|
406
|
+
| [`packages/octocode-mcp`](https://github.com/bgauryy/octocode/tree/main/packages/octocode-mcp) | `@octocodeai/mcp` | MCP server (stdio) that registers the tool catalog for AI assistants. |
|
|
404
407
|
| [`packages/octocode-tools-core`](https://github.com/bgauryy/octocode/tree/main/packages/octocode-tools-core) | `@octocodeai/octocode-tools-core` | Shared tool core: implementations, GitHub client, credentials and token resolution, session, pagination, security bridge. |
|
|
405
408
|
| [`packages/octocode-engine`](https://github.com/bgauryy/octocode/tree/main/packages/octocode-engine) | `@octocodeai/octocode-engine` | Rust/napi native engine: security scanning, minification, signatures, structural AST, ripgrep/diff/YAML, LSP. |
|
|
409
|
+
| [`packages/octocode-config`](https://github.com/bgauryy/octocode/tree/main/packages/octocode-config) | `@octocodeai/config` | Zero-dep env + config loader: `getOctocodeHome`, `.env` parsing, `.octocoderc` reading. Single source used by every package and skill. |
|
|
406
410
|
| [`packages/octocode-vscode`](https://github.com/bgauryy/octocode/tree/main/packages/octocode-vscode) | `octocode-mcp-vscode` | VS Code extension: GitHub OAuth + multi-editor MCP install. |
|
|
407
411
|
|
|
412
|
+
`packages/octocode-benchmark` (private, not published) holds benchmark methodology, evals, and run artifacts — see [Documentation](#documentation).
|
|
413
|
+
|
|
408
414
|
---
|
|
409
415
|
|
|
410
416
|
## Documentation
|
|
411
417
|
|
|
412
|
-
Website: **[octocode.ai](https://octocode.ai)** · Product docs: **[github.com/bgauryy/octocode/tree/main/docs](https://github.com/bgauryy/octocode/tree/main/docs)
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
- [
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
**Security, CLI & Skills**
|
|
440
|
-
- [Security Model](https://github.com/bgauryy/octocode/blob/main/docs/SECURITY.md)
|
|
441
|
-
- [CLI Reference](https://github.com/bgauryy/octocode/blob/main/docs/cli/REFERENCE.md)
|
|
442
|
-
- [Skills Guide](https://github.com/bgauryy/octocode/blob/main/docs/SKILLS_GUIDE.md)
|
|
443
|
-
- [Skills Index](https://github.com/bgauryy/octocode/blob/main/skills/README.md)
|
|
444
|
-
|
|
445
|
-
**Shared Internals**
|
|
446
|
-
- [Credentials Architecture](https://github.com/bgauryy/octocode/blob/main/docs/mcp/CREDENTIALS.md) · [Session Persistence](https://github.com/bgauryy/octocode/blob/main/docs/mcp/SESSION.md)
|
|
418
|
+
Website: **[octocode.ai](https://octocode.ai)** · Product docs: **[github.com/bgauryy/octocode/tree/main/docs](https://github.com/bgauryy/octocode/tree/main/docs)**. This section is the canonical documentation index; benchmark methodology, evals, and run artifacts live in [`packages/octocode-benchmark`](https://github.com/bgauryy/octocode/tree/main/packages/octocode-benchmark).
|
|
419
|
+
|
|
420
|
+
| Area | Docs |
|
|
421
|
+
|---|---|
|
|
422
|
+
| MCP server | [Octocode MCP Server](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_MCP.md) · [Configuration](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md) · [Authentication](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md) |
|
|
423
|
+
| Tools and workflows | [Octocode Tools Reference](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_TOOLS.md) · [Octocode Research Skill](https://github.com/bgauryy/octocode/tree/main/skills/octocode-research) · [Search Guide](https://github.com/bgauryy/octocode/blob/main/docs/context/SEARCH_GUIDE.md) |
|
|
424
|
+
| CLI and query language | [Octocode CLI Guide](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_CLI.md) · [Octocode Query Language](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_QUERY_LANGUAGE.md) · [OQL Research Graph Flow](https://github.com/bgauryy/octocode/blob/main/docs/context/OQL_RESEARCH_GRAPH_FLOW.md) |
|
|
425
|
+
| Skills | [Skills](https://github.com/bgauryy/octocode/tree/main/skills) |
|
|
426
|
+
| Development and security | [Security Model](https://github.com/bgauryy/octocode/blob/main/docs/SECURITY.md) · [LSP Server Lifecycle](https://github.com/bgauryy/octocode/blob/main/docs/LSP_SERVER_LIFECYCLE.md) |
|
|
427
|
+
| Benchmarks and evals | [Benchmark Summary](https://github.com/bgauryy/octocode/blob/main/packages/octocode-benchmark/BENCHMARK.md) · [Unified CLI/Tool/OQL Eval](https://github.com/bgauryy/octocode/blob/main/packages/octocode-benchmark/benchmark/octocode/README.md) · [Benchmark Runbook](https://github.com/bgauryy/octocode/blob/main/packages/octocode-benchmark/recipes/agent-benchmark-runbook.md) · [Support Matrix](https://github.com/bgauryy/octocode/blob/main/docs/LSP_SERVER_LIFECYCLE.md#full-format-support-matrix) |
|
|
428
|
+
| Shared internals | [Credentials Architecture](https://github.com/bgauryy/octocode/blob/main/docs/CONFIGURATION.md#github-token) · [Session Persistence](https://github.com/bgauryy/octocode/blob/main/docs/OCTOCODE_MCP.md#session-persistence) |
|
|
429
|
+
|
|
430
|
+
---
|
|
431
|
+
|
|
432
|
+
## Troubleshooting
|
|
433
|
+
|
|
434
|
+
Having Node.js issues? Run:
|
|
435
|
+
|
|
436
|
+
```bash
|
|
437
|
+
npx node-doctor check --json
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
Read the output and fix accordingly.
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
## Agent Workflows
|
|
447
445
|
|
|
448
446
|
### Recommended dev mode: Pi + Octocode
|
|
449
447
|
|
|
450
448
|
[Pi](https://github.com/earendil-works/pi) is a fast, local-first coding agent whose stated philosophy is *"CLI tools with READMEs (Skills) over MCP."* Pairing it with Octocode gives a lean, evidence-driven dev loop — **Pi edits, Octocode researches**. Two routes, pick by how much surface you need:
|
|
451
449
|
|
|
452
|
-
- **Skill route — recommended, leanest.** Drop the [`octocode-
|
|
450
|
+
- **Skill route — recommended, leanest.** Drop the [`octocode-research`](https://www.skills.sh/bgauryy/octocode-mcp/octocode-research) skill into Pi's global skills dir. It drives the Octocode **CLI** directly — no MCP transport, minimal token overhead — and Pi auto-discovers it:
|
|
453
451
|
|
|
454
452
|
```bash
|
|
455
|
-
npx octocode skill --name octocode-
|
|
453
|
+
npx octocode skill --name octocode-research --platform pi
|
|
456
454
|
```
|
|
457
455
|
|
|
458
|
-
- **Adapter route — full tool surface.** Install [`pi-mcp-adapter`](https://github.com/nicobailon/pi-mcp-adapter) to expose
|
|
456
|
+
- **Adapter route — full tool surface.** Install [`pi-mcp-adapter`](https://github.com/nicobailon/pi-mcp-adapter) to expose Octocode MCP tools behind a single ~200-token proxy tool, so servers stay disconnected until a tool is actually called. Enable clone tools with `ENABLE_CLONE=true`.
|
|
457
|
+
|
|
458
|
+
### Research-driven loop
|
|
459
|
+
|
|
460
|
+
Most agent failures start before implementation: the agent guesses the owner of a behavior, trusts a snippet without reading the exact source, or edits before proving blast radius. Prefer a cheaper loop first: orient with trees and discovery output, search with Octocode, read exact evidence, use AST/LSP when identity matters, then patch and verify.
|
|
459
461
|
|
|
460
|
-
|
|
462
|
+
That shape keeps the editing surface small while preserving context for what matters: file anchors, symbols, call paths, PR/history evidence, package sources, and the verification command that proves the change. In short, the host edits, Octocode is the map, and skills encode the habit.
|
|
461
463
|
|
|
462
464
|
### The Manifest
|
|
463
465
|
|
package/dist/lsp/client.d.ts
CHANGED
|
@@ -1,22 +1,31 @@
|
|
|
1
|
-
import type { CallHierarchyItem, CodeSnippet, ExactPosition, IncomingCall, LanguageServerConfig, OutgoingCall } from './types.js';
|
|
1
|
+
import type { CallHierarchyItem, CodeSnippet, ExactPosition, IncomingCall, LanguageServerConfig, LspReadiness, OutgoingCall } from './types.js';
|
|
2
2
|
export declare class LSPClient {
|
|
3
3
|
private readonly nativeClient;
|
|
4
4
|
private readonly command;
|
|
5
5
|
private initialized;
|
|
6
|
+
private lastReadiness;
|
|
6
7
|
constructor(config: LanguageServerConfig);
|
|
7
8
|
start(): Promise<void>;
|
|
8
9
|
stop(): Promise<void>;
|
|
9
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Wait for the server to finish post-`initialized` indexing and record the
|
|
12
|
+
* readiness signal. Runtime tolerance: until the native addon is rebuilt with
|
|
13
|
+
* the readiness return, the old binding resolves to `undefined` — treat that
|
|
14
|
+
* as the conservative `settledFallback` (we cannot confirm indexing finished).
|
|
15
|
+
*/
|
|
16
|
+
waitForReady(timeoutMs?: number): Promise<LspReadiness>;
|
|
17
|
+
/**
|
|
18
|
+
* The readiness recorded by the most recent `waitForReady`, or `undefined`
|
|
19
|
+
* if it was never called (e.g. servers that answer immediately and skip the
|
|
20
|
+
* readiness wait). A zero-results semantic query on a client whose readiness
|
|
21
|
+
* is not `progressIdle` may be "not indexed yet" rather than a true absence.
|
|
22
|
+
*/
|
|
23
|
+
getReadiness(): LspReadiness | undefined;
|
|
10
24
|
gotoDefinition(filePath: string, position: ExactPosition, content?: string): Promise<CodeSnippet[]>;
|
|
11
|
-
getDefinition(filePath: string, position: ExactPosition, content?: string): Promise<CodeSnippet[]>;
|
|
12
25
|
findReferences(filePath: string, position: ExactPosition, includeDeclaration?: boolean, content?: string): Promise<CodeSnippet[]>;
|
|
13
|
-
getHover(filePath: string, position: ExactPosition, content?: string): Promise<unknown>;
|
|
14
26
|
hover(filePath: string, position: ExactPosition, content?: string): Promise<unknown>;
|
|
15
|
-
getTypeDefinition(filePath: string, position: ExactPosition, content?: string): Promise<CodeSnippet[]>;
|
|
16
27
|
typeDefinition(filePath: string, position: ExactPosition, content?: string): Promise<CodeSnippet[]>;
|
|
17
|
-
getImplementation(filePath: string, position: ExactPosition, content?: string): Promise<CodeSnippet[]>;
|
|
18
28
|
implementation(filePath: string, position: ExactPosition, content?: string): Promise<CodeSnippet[]>;
|
|
19
|
-
getDocumentSymbols(filePath: string, content?: string): Promise<unknown>;
|
|
20
29
|
documentSymbols(filePath: string, content?: string): Promise<unknown>;
|
|
21
30
|
prepareCallHierarchy(filePath: string, position: ExactPosition, content?: string): Promise<CallHierarchyItem[]>;
|
|
22
31
|
getIncomingCalls(item: CallHierarchyItem): Promise<IncomingCall[]>;
|
|
@@ -26,9 +35,8 @@ export declare class LSPClient {
|
|
|
26
35
|
typeHierarchySupertypes(item: unknown): Promise<unknown[]>;
|
|
27
36
|
typeHierarchySubtypes(item: unknown): Promise<unknown[]>;
|
|
28
37
|
getDiagnostics(filePath: string, content?: string): Promise<unknown>;
|
|
29
|
-
hasCapability(
|
|
38
|
+
hasCapability(capability: string): boolean;
|
|
30
39
|
getRecentStderr(): string[];
|
|
31
40
|
openDocument(filePath: string, content?: string): Promise<void>;
|
|
32
|
-
ensureDocumentSynced(filePath: string, content?: string): Promise<void>;
|
|
33
41
|
closeDocument(filePath: string): Promise<void>;
|
|
34
42
|
}
|
package/dist/lsp/client.js
CHANGED
|
@@ -5,6 +5,7 @@ export class LSPClient {
|
|
|
5
5
|
nativeClient;
|
|
6
6
|
command;
|
|
7
7
|
initialized = false;
|
|
8
|
+
lastReadiness;
|
|
8
9
|
constructor(config) {
|
|
9
10
|
this.command = config.command;
|
|
10
11
|
this.nativeClient = new nativeBinding.NativeLspClient({
|
|
@@ -31,13 +32,27 @@ export class LSPClient {
|
|
|
31
32
|
await this.nativeClient.stop();
|
|
32
33
|
this.initialized = false;
|
|
33
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Wait for the server to finish post-`initialized` indexing and record the
|
|
37
|
+
* readiness signal. Runtime tolerance: until the native addon is rebuilt with
|
|
38
|
+
* the readiness return, the old binding resolves to `undefined` — treat that
|
|
39
|
+
* as the conservative `settledFallback` (we cannot confirm indexing finished).
|
|
40
|
+
*/
|
|
34
41
|
async waitForReady(timeoutMs = 45_000) {
|
|
35
|
-
await this.nativeClient.waitForReady(timeoutMs);
|
|
42
|
+
const readiness = await this.nativeClient.waitForReady(timeoutMs);
|
|
43
|
+
this.lastReadiness = readiness ?? 'settledFallback';
|
|
44
|
+
return this.lastReadiness;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The readiness recorded by the most recent `waitForReady`, or `undefined`
|
|
48
|
+
* if it was never called (e.g. servers that answer immediately and skip the
|
|
49
|
+
* readiness wait). A zero-results semantic query on a client whose readiness
|
|
50
|
+
* is not `progressIdle` may be "not indexed yet" rather than a true absence.
|
|
51
|
+
*/
|
|
52
|
+
getReadiness() {
|
|
53
|
+
return this.lastReadiness;
|
|
36
54
|
}
|
|
37
55
|
async gotoDefinition(filePath, position, content) {
|
|
38
|
-
return this.getDefinition(filePath, position, content);
|
|
39
|
-
}
|
|
40
|
-
async getDefinition(filePath, position, content) {
|
|
41
56
|
await this.openDocument(filePath, content);
|
|
42
57
|
return (await this.nativeClient.getDefinition(filePath, position.line, position.character));
|
|
43
58
|
}
|
|
@@ -45,34 +60,22 @@ export class LSPClient {
|
|
|
45
60
|
await this.openDocument(filePath, content);
|
|
46
61
|
return (await this.nativeClient.getReferences(filePath, position.line, position.character, includeDeclaration));
|
|
47
62
|
}
|
|
48
|
-
async
|
|
63
|
+
async hover(filePath, position, content) {
|
|
49
64
|
await this.openDocument(filePath, content);
|
|
50
65
|
return this.nativeClient.getHover(filePath, position.line, position.character);
|
|
51
66
|
}
|
|
52
|
-
async
|
|
53
|
-
return this.getHover(filePath, position, content);
|
|
54
|
-
}
|
|
55
|
-
async getTypeDefinition(filePath, position, content) {
|
|
67
|
+
async typeDefinition(filePath, position, content) {
|
|
56
68
|
await this.openDocument(filePath, content);
|
|
57
69
|
return (await this.nativeClient.getTypeDefinition(filePath, position.line, position.character));
|
|
58
70
|
}
|
|
59
|
-
async
|
|
60
|
-
return this.getTypeDefinition(filePath, position, content);
|
|
61
|
-
}
|
|
62
|
-
async getImplementation(filePath, position, content) {
|
|
71
|
+
async implementation(filePath, position, content) {
|
|
63
72
|
await this.openDocument(filePath, content);
|
|
64
73
|
return (await this.nativeClient.getImplementation(filePath, position.line, position.character));
|
|
65
74
|
}
|
|
66
|
-
async
|
|
67
|
-
return this.getImplementation(filePath, position, content);
|
|
68
|
-
}
|
|
69
|
-
async getDocumentSymbols(filePath, content) {
|
|
75
|
+
async documentSymbols(filePath, content) {
|
|
70
76
|
await this.openDocument(filePath, content);
|
|
71
77
|
return this.nativeClient.getDocumentSymbols(filePath);
|
|
72
78
|
}
|
|
73
|
-
async documentSymbols(filePath, content) {
|
|
74
|
-
return this.getDocumentSymbols(filePath, content);
|
|
75
|
-
}
|
|
76
79
|
async prepareCallHierarchy(filePath, position, content) {
|
|
77
80
|
await this.openDocument(filePath, content);
|
|
78
81
|
const result = await this.nativeClient.prepareCallHierarchy(filePath, position.line, position.character);
|
|
@@ -107,17 +110,14 @@ export class LSPClient {
|
|
|
107
110
|
await this.openDocument(filePath, content);
|
|
108
111
|
return this.nativeClient.getDiagnostics(filePath);
|
|
109
112
|
}
|
|
110
|
-
hasCapability(
|
|
113
|
+
hasCapability(capability) {
|
|
111
114
|
return (this.initialized &&
|
|
112
|
-
(this.nativeClient.hasCapability?.(
|
|
115
|
+
(this.nativeClient.hasCapability?.(capability) ?? true));
|
|
113
116
|
}
|
|
114
117
|
getRecentStderr() {
|
|
115
118
|
return this.nativeClient.getRecentStderr?.() ?? [];
|
|
116
119
|
}
|
|
117
120
|
async openDocument(filePath, content) {
|
|
118
|
-
await this.ensureDocumentSynced(filePath, content ?? (await fs.readFile(filePath, 'utf8')));
|
|
119
|
-
}
|
|
120
|
-
async ensureDocumentSynced(filePath, content) {
|
|
121
121
|
await this.nativeClient.openDocument(filePath, content ?? (await fs.readFile(filePath, 'utf8')));
|
|
122
122
|
}
|
|
123
123
|
async closeDocument(filePath) {
|
package/dist/lsp/config.js
CHANGED
|
@@ -137,7 +137,7 @@ function withBundledJsServer(config) {
|
|
|
137
137
|
}
|
|
138
138
|
// 2) Language-keyed: a different bundled server than the native default
|
|
139
139
|
// (e.g. pyright for Python); use the bundled server's own launch args.
|
|
140
|
-
const byLanguage = config.languageId
|
|
140
|
+
const byLanguage = path.basename(config.command) === config.command && config.languageId
|
|
141
141
|
? BUNDLED_BY_LANGUAGE[config.languageId]
|
|
142
142
|
: undefined;
|
|
143
143
|
if (byLanguage) {
|
|
@@ -21,7 +21,9 @@ export declare class LspClientPool<T extends PooledClient> {
|
|
|
21
21
|
clearAll(): Promise<void>;
|
|
22
22
|
size(): number;
|
|
23
23
|
keys(): PoolKey[];
|
|
24
|
+
has(key: PoolKey): boolean;
|
|
24
25
|
private resetIdleTimer;
|
|
25
26
|
private startIdleTimer;
|
|
26
27
|
}
|
|
28
|
+
export declare function serializeKey(key: PoolKey): string;
|
|
27
29
|
export {};
|