viberag 0.1.7 → 0.3.0
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 +149 -76
- package/dist/cli/commands/mcp-setup.d.ts +58 -9
- package/dist/cli/commands/mcp-setup.js +409 -113
- package/dist/cli/commands/useRagCommands.js +4 -1
- package/dist/cli/components/CleanWizard.js +110 -33
- package/dist/cli/components/InitWizard.js +37 -15
- package/dist/cli/components/McpSetupWizard.d.ts +6 -5
- package/dist/cli/components/McpSetupWizard.js +222 -246
- package/dist/cli/data/mcp-editors.d.ts +32 -17
- package/dist/cli/data/mcp-editors.js +114 -64
- package/dist/common/types.d.ts +6 -5
- package/dist/mcp/index.js +5 -1
- package/dist/mcp/server.js +2 -2
- package/dist/mcp/warmup.d.ts +5 -0
- package/dist/mcp/warmup.js +7 -0
- package/dist/rag/config/index.d.ts +4 -0
- package/dist/rag/config/index.js +37 -13
- package/dist/rag/embeddings/gemini.js +34 -7
- package/dist/rag/embeddings/index.d.ts +1 -0
- package/dist/rag/embeddings/index.js +1 -0
- package/dist/rag/embeddings/mistral.d.ts +2 -2
- package/dist/rag/embeddings/mistral.js +18 -5
- package/dist/rag/embeddings/openai.js +22 -3
- package/dist/rag/embeddings/validate.d.ts +22 -0
- package/dist/rag/embeddings/validate.js +148 -0
- package/dist/rag/index.d.ts +1 -1
- package/dist/rag/index.js +1 -1
- package/dist/rag/indexer/chunker.js +31 -19
- package/dist/rag/indexer/indexer.d.ts +10 -0
- package/dist/rag/indexer/indexer.js +88 -53
- package/dist/rag/search/index.d.ts +6 -0
- package/dist/rag/search/index.js +35 -9
- package/dist/rag/storage/index.d.ts +15 -1
- package/dist/rag/storage/index.js +108 -21
- package/package.json +32 -3
- package/dist/cli/__tests__/mcp-setup.test.d.ts +0 -6
- package/dist/cli/__tests__/mcp-setup.test.js +0 -597
- package/dist/rag/__tests__/grammar-smoke.test.d.ts +0 -9
- package/dist/rag/__tests__/grammar-smoke.test.js +0 -161
- package/dist/rag/__tests__/helpers.d.ts +0 -30
- package/dist/rag/__tests__/helpers.js +0 -67
- package/dist/rag/__tests__/merkle.test.d.ts +0 -5
- package/dist/rag/__tests__/merkle.test.js +0 -161
- package/dist/rag/__tests__/metadata-extraction.test.d.ts +0 -10
- package/dist/rag/__tests__/metadata-extraction.test.js +0 -202
- package/dist/rag/__tests__/multi-language.test.d.ts +0 -13
- package/dist/rag/__tests__/multi-language.test.js +0 -535
- package/dist/rag/__tests__/rag.test.d.ts +0 -10
- package/dist/rag/__tests__/rag.test.js +0 -311
- package/dist/rag/__tests__/search-exhaustive.test.d.ts +0 -9
- package/dist/rag/__tests__/search-exhaustive.test.js +0 -87
- package/dist/rag/__tests__/search-filters.test.d.ts +0 -10
- package/dist/rag/__tests__/search-filters.test.js +0 -250
- package/dist/rag/__tests__/search-modes.test.d.ts +0 -8
- package/dist/rag/__tests__/search-modes.test.js +0 -133
package/README.md
CHANGED
|
@@ -115,14 +115,10 @@ The wizard can auto-configure project-level configs and merge into global config
|
|
|
115
115
|
|
|
116
116
|
### Manual Setup Instructions
|
|
117
117
|
|
|
118
|
-
The following sections describe manual MCP server setup configurations for various editors
|
|
119
|
-
|
|
120
|
-
#### Project-Specific Configs
|
|
121
|
-
|
|
122
|
-
These editors use per-project config files that VibeRAG can auto-create.
|
|
118
|
+
The following sections describe manual MCP server setup configurations for various editors and agents.
|
|
123
119
|
|
|
124
120
|
<details>
|
|
125
|
-
<summary><strong>Claude Code</strong
|
|
121
|
+
<summary><strong>Claude Code</strong></summary>
|
|
126
122
|
|
|
127
123
|
**CLI Command:**
|
|
128
124
|
|
|
@@ -130,7 +126,7 @@ These editors use per-project config files that VibeRAG can auto-create.
|
|
|
130
126
|
claude mcp add viberag -- npx viberag-mcp
|
|
131
127
|
```
|
|
132
128
|
|
|
133
|
-
**
|
|
129
|
+
**Global Config:** `~/.claude.json`
|
|
134
130
|
|
|
135
131
|
```json
|
|
136
132
|
{
|
|
@@ -143,16 +139,7 @@ claude mcp add viberag -- npx viberag-mcp
|
|
|
143
139
|
}
|
|
144
140
|
```
|
|
145
141
|
|
|
146
|
-
**
|
|
147
|
-
|
|
148
|
-
[Documentation](https://docs.anthropic.com/en/docs/claude-code/mcp)
|
|
149
|
-
|
|
150
|
-
</details>
|
|
151
|
-
|
|
152
|
-
<details>
|
|
153
|
-
<summary><strong>Cursor</strong> — <code>.cursor/mcp.json</code></summary>
|
|
154
|
-
|
|
155
|
-
**Manual Setup:**
|
|
142
|
+
**Project Config:** `.mcp.json`
|
|
156
143
|
|
|
157
144
|
```json
|
|
158
145
|
{
|
|
@@ -165,16 +152,16 @@ claude mcp add viberag -- npx viberag-mcp
|
|
|
165
152
|
}
|
|
166
153
|
```
|
|
167
154
|
|
|
168
|
-
**Verify:**
|
|
155
|
+
**Verify:** Run `/mcp` in Claude Code, look for "viberag: connected"
|
|
169
156
|
|
|
170
|
-
[Documentation](https://docs.
|
|
157
|
+
[Documentation](https://docs.anthropic.com/en/docs/claude-code/mcp)
|
|
171
158
|
|
|
172
159
|
</details>
|
|
173
160
|
|
|
174
161
|
<details>
|
|
175
|
-
<summary><strong>
|
|
162
|
+
<summary><strong>Cursor</strong></summary>
|
|
176
163
|
|
|
177
|
-
**
|
|
164
|
+
**Global Config:** `~/.cursor/mcp.json`
|
|
178
165
|
|
|
179
166
|
```json
|
|
180
167
|
{
|
|
@@ -187,20 +174,11 @@ claude mcp add viberag -- npx viberag-mcp
|
|
|
187
174
|
}
|
|
188
175
|
```
|
|
189
176
|
|
|
190
|
-
**
|
|
191
|
-
|
|
192
|
-
[Documentation](https://docs.roocode.com/features/mcp/using-mcp-in-roo)
|
|
193
|
-
|
|
194
|
-
</details>
|
|
195
|
-
|
|
196
|
-
<details>
|
|
197
|
-
<summary><strong>VS Code Copilot</strong> — <code>.vscode/mcp.json</code></summary>
|
|
198
|
-
|
|
199
|
-
**Manual Setup:**
|
|
177
|
+
**Project Config:** `.cursor/mcp.json`
|
|
200
178
|
|
|
201
179
|
```json
|
|
202
180
|
{
|
|
203
|
-
"
|
|
181
|
+
"mcpServers": {
|
|
204
182
|
"viberag": {
|
|
205
183
|
"command": "npx",
|
|
206
184
|
"args": ["viberag-mcp"]
|
|
@@ -209,22 +187,14 @@ claude mcp add viberag -- npx viberag-mcp
|
|
|
209
187
|
}
|
|
210
188
|
```
|
|
211
189
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
**Verify:** Cmd/Ctrl+Shift+P → "MCP: List Servers", verify "viberag" appears
|
|
190
|
+
**Verify:** Settings → Cursor Settings → MCP, verify "viberag" shows with toggle enabled
|
|
215
191
|
|
|
216
|
-
[Documentation](https://
|
|
192
|
+
[Documentation](https://docs.cursor.com/context/model-context-protocol)
|
|
217
193
|
|
|
218
194
|
</details>
|
|
219
195
|
|
|
220
|
-
---
|
|
221
|
-
|
|
222
|
-
### Global Configs
|
|
223
|
-
|
|
224
|
-
These editors use global config files. VibeRAG can merge into existing configs.
|
|
225
|
-
|
|
226
196
|
<details>
|
|
227
|
-
<summary><strong>Gemini CLI</strong
|
|
197
|
+
<summary><strong>Gemini CLI</strong></summary>
|
|
228
198
|
|
|
229
199
|
**CLI Command:**
|
|
230
200
|
|
|
@@ -232,7 +202,20 @@ These editors use global config files. VibeRAG can merge into existing configs.
|
|
|
232
202
|
gemini mcp add viberag -- npx viberag-mcp
|
|
233
203
|
```
|
|
234
204
|
|
|
235
|
-
**
|
|
205
|
+
**Global Config:** `~/.gemini/settings.json`
|
|
206
|
+
|
|
207
|
+
```json
|
|
208
|
+
{
|
|
209
|
+
"mcpServers": {
|
|
210
|
+
"viberag": {
|
|
211
|
+
"command": "npx",
|
|
212
|
+
"args": ["viberag-mcp"]
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
**Project Config:** `.gemini/settings.json`
|
|
236
219
|
|
|
237
220
|
```json
|
|
238
221
|
{
|
|
@@ -252,22 +235,41 @@ gemini mcp add viberag -- npx viberag-mcp
|
|
|
252
235
|
</details>
|
|
253
236
|
|
|
254
237
|
<details>
|
|
255
|
-
<summary><strong>
|
|
238
|
+
<summary><strong>JetBrains IDEs</strong></summary>
|
|
239
|
+
|
|
240
|
+
**UI Setup:**
|
|
241
|
+
|
|
242
|
+
1. Open Settings → Tools → AI Assistant → MCP
|
|
243
|
+
2. Click "Add Server"
|
|
244
|
+
3. Set name: `viberag`
|
|
245
|
+
4. Set command: `npx`
|
|
246
|
+
5. Set args: `viberag-mcp`
|
|
247
|
+
|
|
248
|
+
**Verify:** Settings → Tools → AI Assistant → MCP, verify "viberag" shows green in Status column
|
|
249
|
+
|
|
250
|
+
[Documentation](https://www.jetbrains.com/help/ai-assistant/mcp.html)
|
|
251
|
+
|
|
252
|
+
</details>
|
|
253
|
+
|
|
254
|
+
<details>
|
|
255
|
+
<summary><strong>OpenAI Codex</strong></summary>
|
|
256
256
|
|
|
257
257
|
**CLI Command:**
|
|
258
258
|
|
|
259
259
|
```bash
|
|
260
|
-
codex mcp add viberag -- npx viberag-mcp
|
|
260
|
+
codex mcp add viberag -- npx -y viberag-mcp
|
|
261
261
|
```
|
|
262
262
|
|
|
263
|
-
**
|
|
263
|
+
**Global Config:** `~/.codex/config.toml`
|
|
264
264
|
|
|
265
265
|
```toml
|
|
266
266
|
[mcp_servers.viberag]
|
|
267
267
|
command = "npx"
|
|
268
|
-
args = ["viberag-mcp"]
|
|
268
|
+
args = ["-y", "viberag-mcp"]
|
|
269
269
|
```
|
|
270
270
|
|
|
271
|
+
> **Note:** The `-y` flag is required for npx to auto-confirm package installation
|
|
272
|
+
|
|
271
273
|
**Verify:** Run `/mcp` in Codex TUI, look for "viberag" in server list
|
|
272
274
|
|
|
273
275
|
[Documentation](https://codex.openai.com/docs/tools/mcp-servers)
|
|
@@ -275,11 +277,22 @@ args = ["viberag-mcp"]
|
|
|
275
277
|
</details>
|
|
276
278
|
|
|
277
279
|
<details>
|
|
278
|
-
<summary><strong>OpenCode</strong
|
|
280
|
+
<summary><strong>OpenCode</strong></summary>
|
|
281
|
+
|
|
282
|
+
**Global Config:** `~/.config/opencode/opencode.json` (Linux/macOS) or `%APPDATA%/opencode/opencode.json` (Windows)
|
|
279
283
|
|
|
280
|
-
|
|
284
|
+
```json
|
|
285
|
+
{
|
|
286
|
+
"mcp": {
|
|
287
|
+
"viberag": {
|
|
288
|
+
"type": "local",
|
|
289
|
+
"command": ["npx", "-y", "viberag-mcp"]
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
```
|
|
281
294
|
|
|
282
|
-
**
|
|
295
|
+
**Project Config:** `opencode.json`
|
|
283
296
|
|
|
284
297
|
```json
|
|
285
298
|
{
|
|
@@ -301,9 +314,11 @@ args = ["viberag-mcp"]
|
|
|
301
314
|
</details>
|
|
302
315
|
|
|
303
316
|
<details>
|
|
304
|
-
<summary><strong>
|
|
317
|
+
<summary><strong>Roo Code</strong></summary>
|
|
318
|
+
|
|
319
|
+
**Global Config:** UI only — Click MCP icon in Roo Code pane header → Edit Global MCP
|
|
305
320
|
|
|
306
|
-
**
|
|
321
|
+
**Project Config:** `.roo/mcp.json`
|
|
307
322
|
|
|
308
323
|
```json
|
|
309
324
|
{
|
|
@@ -316,22 +331,35 @@ args = ["viberag-mcp"]
|
|
|
316
331
|
}
|
|
317
332
|
```
|
|
318
333
|
|
|
319
|
-
**Verify:** Click
|
|
334
|
+
**Verify:** Click MCP icon in Roo Code pane header, verify "viberag" appears in server list
|
|
320
335
|
|
|
321
|
-
[Documentation](https://docs.
|
|
336
|
+
[Documentation](https://docs.roocode.com/features/mcp/using-mcp-in-roo)
|
|
322
337
|
|
|
323
338
|
</details>
|
|
324
339
|
|
|
325
340
|
<details>
|
|
326
|
-
<summary><strong>
|
|
341
|
+
<summary><strong>VS Code Copilot</strong></summary>
|
|
327
342
|
|
|
328
|
-
**Config:**
|
|
343
|
+
**Global Config:** Add to User `settings.json` under `mcp.servers`:
|
|
329
344
|
|
|
330
|
-
|
|
345
|
+
```json
|
|
346
|
+
{
|
|
347
|
+
"mcp": {
|
|
348
|
+
"servers": {
|
|
349
|
+
"viberag": {
|
|
350
|
+
"command": "npx",
|
|
351
|
+
"args": ["viberag-mcp"]
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
**Project Config:** `.vscode/mcp.json`
|
|
331
359
|
|
|
332
360
|
```json
|
|
333
361
|
{
|
|
334
|
-
"
|
|
362
|
+
"servers": {
|
|
335
363
|
"viberag": {
|
|
336
364
|
"command": "npx",
|
|
337
365
|
"args": ["viberag-mcp"]
|
|
@@ -340,37 +368,83 @@ args = ["viberag-mcp"]
|
|
|
340
368
|
}
|
|
341
369
|
```
|
|
342
370
|
|
|
343
|
-
> **Note:**
|
|
371
|
+
> **Note:** VS Code uses `"servers"` instead of `"mcpServers"`
|
|
344
372
|
|
|
345
|
-
**
|
|
373
|
+
> **Required:** Enable Agent Mode in VS Code settings:
|
|
374
|
+
>
|
|
375
|
+
> - Settings → search `chat.agent.enabled` → check the box, OR
|
|
376
|
+
> - Add `"chat.agent.enabled": true` to your User `settings.json`
|
|
346
377
|
|
|
347
|
-
|
|
378
|
+
**Verify:** Cmd/Ctrl+Shift+P → "MCP: List Servers", verify "viberag" appears
|
|
379
|
+
|
|
380
|
+
[Documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers)
|
|
348
381
|
|
|
349
382
|
</details>
|
|
350
383
|
|
|
351
|
-
|
|
384
|
+
<details>
|
|
385
|
+
<summary><strong>Windsurf</strong></summary>
|
|
386
|
+
|
|
387
|
+
**Global Config:** `~/.codeium/windsurf/mcp_config.json`
|
|
388
|
+
|
|
389
|
+
```json
|
|
390
|
+
{
|
|
391
|
+
"mcpServers": {
|
|
392
|
+
"viberag": {
|
|
393
|
+
"command": "npx",
|
|
394
|
+
"args": ["viberag-mcp"]
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
**Verify:** Click Plugins icon in Cascade panel, verify "viberag" shows in plugin list
|
|
352
401
|
|
|
353
|
-
|
|
402
|
+
[Documentation](https://docs.windsurf.com/windsurf/cascade/mcp)
|
|
403
|
+
|
|
404
|
+
</details>
|
|
354
405
|
|
|
355
406
|
<details>
|
|
356
|
-
<summary><strong>
|
|
407
|
+
<summary><strong>Zed</strong></summary>
|
|
357
408
|
|
|
358
|
-
**
|
|
409
|
+
**Global Config:** `~/.config/zed/settings.json`
|
|
359
410
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
411
|
+
```json
|
|
412
|
+
{
|
|
413
|
+
"context_servers": {
|
|
414
|
+
"viberag": {
|
|
415
|
+
"source": "custom",
|
|
416
|
+
"command": "npx",
|
|
417
|
+
"args": ["viberag-mcp"]
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
```
|
|
365
422
|
|
|
366
|
-
**
|
|
423
|
+
**Project Config:** `.zed/settings.json`
|
|
367
424
|
|
|
368
|
-
|
|
425
|
+
```json
|
|
426
|
+
{
|
|
427
|
+
"context_servers": {
|
|
428
|
+
"viberag": {
|
|
429
|
+
"source": "custom",
|
|
430
|
+
"command": "npx",
|
|
431
|
+
"args": ["viberag-mcp"]
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
> **Note:** Zed uses `"context_servers"` instead of `"mcpServers"` and requires `"source": "custom"` for non-extension servers
|
|
438
|
+
|
|
439
|
+
**Verify:** Open Agent Panel settings, verify "viberag" shows green indicator
|
|
440
|
+
|
|
441
|
+
[Documentation](https://zed.dev/docs/ai/mcp)
|
|
369
442
|
|
|
370
443
|
</details>
|
|
371
444
|
|
|
445
|
+
---
|
|
372
446
|
|
|
373
|
-
|
|
447
|
+
## Exposed MCP Tools
|
|
374
448
|
|
|
375
449
|
| Tool | Description |
|
|
376
450
|
| -------------------------- | ---------------------------------------------------- |
|
|
@@ -472,7 +546,6 @@ Check the file watcher for auto-indexing.
|
|
|
472
546
|
- Pending changes count
|
|
473
547
|
- Last update timestamp
|
|
474
548
|
|
|
475
|
-
|
|
476
549
|
## CLI Commands
|
|
477
550
|
|
|
478
551
|
VibeRAG includes a CLI for easy execution of initialization, indexing, setup, and other things you may want to manually control outside of agent use.
|
|
@@ -507,7 +580,7 @@ Choose your embedding provider during `/init`:
|
|
|
507
580
|
| Provider | Model | Dims | Cost | Get API Key |
|
|
508
581
|
| -------- | ---------------------- | ---- | --------- | ------------------------------------------------------- |
|
|
509
582
|
| Gemini | gemini-embedding-001 | 1536 | Free tier | [Google AI Studio](https://aistudio.google.com) |
|
|
510
|
-
| Mistral | codestral-embed |
|
|
583
|
+
| Mistral | codestral-embed | 1536 | $0.10/1M | [Mistral Console](https://console.mistral.ai/api-keys/) |
|
|
511
584
|
| OpenAI | text-embedding-3-small | 1536 | $0.02/1M | [OpenAI Platform](https://platform.openai.com/api-keys) |
|
|
512
585
|
|
|
513
586
|
- **Gemini** - Free tier available, great for getting started
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Functions for generating, writing, and merging MCP configurations
|
|
5
5
|
* for various AI coding tools.
|
|
6
|
+
*
|
|
7
|
+
* Note: Zed and VS Code use JSONC (JSON with Comments) for their config files.
|
|
8
|
+
* We strip comments before parsing to handle this.
|
|
6
9
|
*/
|
|
7
10
|
import { type EditorConfig, type EditorId } from '../data/mcp-editors.js';
|
|
8
11
|
/**
|
|
@@ -19,11 +22,21 @@ export interface McpSetupResult {
|
|
|
19
22
|
* Generate the viberag MCP server configuration object.
|
|
20
23
|
*/
|
|
21
24
|
export declare function generateViberagConfig(): object;
|
|
25
|
+
/**
|
|
26
|
+
* Generate Zed-specific viberag MCP server configuration.
|
|
27
|
+
* Zed requires: source="custom" for non-extension MCP servers.
|
|
28
|
+
*/
|
|
29
|
+
export declare function generateZedViberagConfig(): object;
|
|
22
30
|
/**
|
|
23
31
|
* Generate OpenCode-specific viberag MCP server configuration.
|
|
24
32
|
* OpenCode requires: type="local", command as array, no args key.
|
|
25
33
|
*/
|
|
26
34
|
export declare function generateOpenCodeViberagConfig(): object;
|
|
35
|
+
/**
|
|
36
|
+
* Generate Roo Code-specific viberag MCP server configuration.
|
|
37
|
+
* Roo Code supports alwaysAllow for auto-approving common operations.
|
|
38
|
+
*/
|
|
39
|
+
export declare function generateRooCodeViberagConfig(): object;
|
|
27
40
|
/**
|
|
28
41
|
* Generate complete MCP config for an editor.
|
|
29
42
|
*/
|
|
@@ -32,12 +45,33 @@ export declare function generateMcpConfig(editor: EditorConfig): object;
|
|
|
32
45
|
* Generate TOML config for OpenAI Codex.
|
|
33
46
|
*/
|
|
34
47
|
export declare function generateTomlConfig(): string;
|
|
48
|
+
/**
|
|
49
|
+
* Read existing TOML config file.
|
|
50
|
+
* Returns the raw content string, or null if file doesn't exist or can't be read.
|
|
51
|
+
*/
|
|
52
|
+
export declare function readTomlConfig(configPath: string): Promise<string | null>;
|
|
53
|
+
/**
|
|
54
|
+
* Check if viberag is already configured in a TOML config.
|
|
55
|
+
* Looks for [mcp_servers.viberag] section.
|
|
56
|
+
*/
|
|
57
|
+
export declare function hasViberagTomlConfig(content: string): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Merge viberag config into existing TOML content.
|
|
60
|
+
* Appends the viberag section if not present.
|
|
61
|
+
*/
|
|
62
|
+
export declare function mergeTomlConfig(existing: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* Remove viberag from a TOML config.
|
|
65
|
+
* Returns the modified content, or null if nothing to remove.
|
|
66
|
+
*/
|
|
67
|
+
export declare function removeViberagFromTomlConfig(content: string): string | null;
|
|
35
68
|
/**
|
|
36
69
|
* Check if a config file exists.
|
|
37
70
|
*/
|
|
38
71
|
export declare function configExists(configPath: string): Promise<boolean>;
|
|
39
72
|
/**
|
|
40
73
|
* Read existing config file as JSON.
|
|
74
|
+
* Handles JSONC (JSON with Comments) format used by Zed and VS Code.
|
|
41
75
|
*/
|
|
42
76
|
export declare function readJsonConfig(configPath: string): Promise<object | null>;
|
|
43
77
|
/**
|
|
@@ -51,23 +85,31 @@ export declare function hasViberagConfig(config: object, editor: EditorConfig):
|
|
|
51
85
|
/**
|
|
52
86
|
* Write MCP config to file, creating directories as needed.
|
|
53
87
|
*/
|
|
54
|
-
export declare function writeMcpConfig(editor: EditorConfig, projectRoot: string): Promise<McpSetupResult>;
|
|
88
|
+
export declare function writeMcpConfig(editor: EditorConfig, scope: 'global' | 'project', projectRoot: string): Promise<McpSetupResult>;
|
|
55
89
|
/**
|
|
56
90
|
* Generate manual setup instructions for an editor.
|
|
57
91
|
*/
|
|
58
|
-
export declare function getManualInstructions(editor: EditorConfig, projectRoot: string): string;
|
|
92
|
+
export declare function getManualInstructions(editor: EditorConfig, scope: 'global' | 'project', projectRoot: string): string;
|
|
59
93
|
/**
|
|
60
94
|
* Get a diff preview of the merge operation.
|
|
61
95
|
*/
|
|
62
|
-
export declare function getMergeDiff(editor: EditorConfig, projectRoot: string): Promise<{
|
|
96
|
+
export declare function getMergeDiff(editor: EditorConfig, scope: 'global' | 'project', projectRoot: string): Promise<{
|
|
63
97
|
before: string;
|
|
64
98
|
after: string;
|
|
65
99
|
configPath: string;
|
|
66
100
|
} | null>;
|
|
67
101
|
/**
|
|
68
|
-
* Check if viberag is already configured for an editor.
|
|
102
|
+
* Check if viberag is already configured for an editor at a specific scope.
|
|
69
103
|
*/
|
|
70
|
-
export declare function isAlreadyConfigured(editor: EditorConfig, projectRoot: string): Promise<boolean>;
|
|
104
|
+
export declare function isAlreadyConfigured(editor: EditorConfig, scope: 'global' | 'project', projectRoot: string): Promise<boolean>;
|
|
105
|
+
/**
|
|
106
|
+
* Check if viberag is configured at any scope for an editor.
|
|
107
|
+
* Returns info about which scopes are configured.
|
|
108
|
+
*/
|
|
109
|
+
export declare function getConfiguredScopes(editor: EditorConfig, projectRoot: string): Promise<{
|
|
110
|
+
global: boolean;
|
|
111
|
+
project: boolean;
|
|
112
|
+
}>;
|
|
71
113
|
/**
|
|
72
114
|
* Remove viberag from an existing config object.
|
|
73
115
|
* Returns the modified config, or null if nothing to remove.
|
|
@@ -87,14 +129,21 @@ export interface McpRemovalResult {
|
|
|
87
129
|
* Remove viberag from an editor's MCP config.
|
|
88
130
|
* Always keeps the config file, even if it becomes empty (no other servers).
|
|
89
131
|
*/
|
|
90
|
-
export declare function removeViberagConfig(editor: EditorConfig, projectRoot: string): Promise<McpRemovalResult>;
|
|
132
|
+
export declare function removeViberagConfig(editor: EditorConfig, scope: 'global' | 'project', projectRoot: string): Promise<McpRemovalResult>;
|
|
133
|
+
/**
|
|
134
|
+
* Info about a configured editor and its scope.
|
|
135
|
+
*/
|
|
136
|
+
export interface ConfiguredEditorInfo {
|
|
137
|
+
editor: EditorConfig;
|
|
138
|
+
scope: 'global' | 'project';
|
|
139
|
+
}
|
|
91
140
|
/**
|
|
92
141
|
* Find all editors that have viberag configured.
|
|
93
|
-
* Returns both project-scope and global-scope
|
|
142
|
+
* Returns both project-scope and global-scope configurations.
|
|
94
143
|
*/
|
|
95
144
|
export declare function findConfiguredEditors(projectRoot: string): Promise<{
|
|
96
|
-
projectScope:
|
|
97
|
-
globalScope:
|
|
145
|
+
projectScope: ConfiguredEditorInfo[];
|
|
146
|
+
globalScope: ConfiguredEditorInfo[];
|
|
98
147
|
}>;
|
|
99
148
|
/**
|
|
100
149
|
* Add an entry to .gitignore if not already present.
|