opencode-rag-plugin 1.3.5 → 1.3.6

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 CHANGED
@@ -1,68 +1,40 @@
1
1
  # OpenCodeRAG
2
2
 
3
- > A RAG (Retrieval-Augmented Generation) plugin for [OpenCode](https://opencode.ai) that adds **semantic code search** powered by locally-hosted embedding models.
3
+ OpenCodeRAG is a RAG (Retrieval-Augmented Generation) plugin for semantic code search powered by locally-hosted embedding models.
4
+ It features a seamless integration with [OpenCode](https://opencode.ai) and offers a CLI interface for external usage.
4
5
 
5
- **Published on npm: [`opencode-rag-plugin`](https://www.npmjs.com/package/opencode-rag-plugin)**
6
+ [![npm version](https://img.shields.io/npm/v/opencode-rag-plugin.svg)](https://www.npmjs.com/package/opencode-rag-plugin)
6
7
 
7
- > ⚠️ **Do not confuse with `opencode-rag`** that is a discontinued project by a different author.
8
+ > ⚠️ **Note:** Don't confuse this with the npm-package `opencode-rag`, which is a discontinued project of a different author. Ensure you are using **`opencode-rag-plugin`**.
8
9
 
9
- OpenCodeRAG reduces token usage by replacing expensive file-read tool calls with targeted, vector-similarity-based chunk retrieval. Large codebases and files on a local dedicated GPU benefit most in terms of performance, but even a modern CPU handles most workloads without a GPU.
10
+ **Why Using OpenCodeRAG?**
11
+ OpenCodeRAG aims to reduce LLM token usage by replacing expensive full-file reads with targeted, vector-similarity-based chunk retrieval.
12
+ Large codebases benefit massively in performance. It runs perfectly on a local dedicated GPU, but modern CPUs handle most workloads just fine.
13
+ When using only locally hosted embedding models and LLMs, your codebase also remains 100% private.
10
14
 
11
15
  ---
12
16
 
13
17
  ## Table of Contents
14
18
 
15
- - [Features](#features)
16
- - [Prerequisites](#prerequisites)
17
- - [Quick Start](#quick-start)
18
- - [Installation](#installation)
19
- - [Global Installation (Recommended)](#global-installation-recommended)
20
- - [Per-Workspace Setup](#per-workspace-setup)
21
- - [Manual Installation](#manual-installation)
22
- - [Uninstallation](#uninstallation)
23
- - [Configuration](#configuration)
24
- - [Embedding Providers](#embedding-providers)
25
- - [Logging](#logging)
26
- - [Usage](#usage)
27
- - [CLI](#cli)
28
- - [OpenCode Plugin](#opencode-plugin)
29
- - [Architecture](#architecture)
30
- - [Tech Stack](#tech-stack)
31
- - [Chunking Language Support](#chunking-language-support)
32
- - [Adding Custom Chunkers](#adding-custom-chunkers)
33
- - [Data Model](#data-model)
34
- - [Vector Store](#vector-store)
35
- - [Development](#development)
36
- - [Privacy](#privacy)
19
+ - [Quick Start](#-quick-start)
20
+ - [How it Works](#-how-it-works)
21
+ - [OpenCode Integration](#-opencode-integration)
22
+ - [Configuration](#-configuration)
23
+ - [CLI Usage (Standalone)](#-cli-interface)
24
+ - [Supported Languages](#-supported-languages)
25
+ - [Developer Guide & Architecture](#-developer-guide--architecture)
26
+ - [Privacy & Security](#-privacy--security)
37
27
 
38
28
  ---
39
29
 
40
- ## Features
41
-
42
- | Feature | Description |
43
- |---------|-------------|
44
- | **AST-aware chunking** | Splits code into functions, classes, and methods via tree-sitter for 16 languages; regex-based for Markdown, Razor, `.sln`, and LaTeX; line-based fallback for everything else |
45
- | **Incremental indexing** | Skips unchanged files, removes deleted entries, re-indexes only what changed |
46
- | **Watch mode** | `index --watch` debounces file changes and re-indexes automatically |
47
- | **Pluggable chunkers** | Add custom language chunkers via config file or programmatic API |
48
- | **Configurable embeddings** | Ollama (default, fully local) or any OpenAI-compatible provider; configurable batch size |
49
- | **Hybrid search** | TF×IDF keyword index fused with vector similarity — better precision on identifiers and function names |
50
- | **Local vector store** | LanceDB with L2 distance scoring; in-memory mode for testing |
51
- | **CLI** | `index`, `query`, `clear`, `status` commands |
52
- | **OpenCode integration** | Auto-injects relevant code chunks into each message; suggests related files; exposes a retrieval tool the agent can call directly |
53
-
54
- ---
55
-
56
- ## Prerequisites
57
-
58
- - **[OpenCode](https://opencode.ai)** installed and configured
59
- - **Node.js v22+** (required for native ESM and `fetch`)
60
- - **[Ollama](https://ollama.ai)** running locally with an embedding model (default: `nomic-embed-text`)
61
- — or any OpenAI-compatible embedding API
30
+ ## Quick Start
62
31
 
63
- ---
32
+ ### Prerequisites
33
+ - **Node.js v22+** (required for native ESM and `fetch`).
34
+ - **[Ollama](https://ollama.ai)** running locally (default model: `embeddinggemma`) OR an OpenAI-compatible API.
35
+ - **[OpenCode](https://opencode.ai)** if you want to use the automated agent features.
64
36
 
65
- ## Quick Start
37
+ ### Installation
66
38
 
67
39
  ```bash
68
40
  # 1. Clone the repository
@@ -73,371 +45,171 @@ cd OpenCodeRAG
73
45
  ./install.sh # Linux/macOS
74
46
  .\install.ps1 # Windows
75
47
 
76
- # 3. Go to your project and initialize
48
+ # 3. Initialize in your project
77
49
  cd /path/to/your/project
78
50
  opencode-rag init
79
51
 
80
- # 4. Index the workspace
81
- opencode-rag index
82
-
83
- # 5. Restart OpenCode — the plugin is active
84
- ```
85
-
86
- ---
87
-
88
- ## Installation
89
-
90
- ### Global Installation (Recommended)
91
-
92
- Clone the repository and run the platform-specific install script:
93
-
94
- ```bash
95
- # Linux/macOS
96
- ./install.sh
97
-
98
- # Windows
99
- .\install.ps1
100
- ```
101
-
102
- The script will:
103
- 1. Build the plugin from source (`npm run build`)
104
- 2. Install it into OpenCode's runtime (`~/.opencode/node_modules/`)
105
- 3. Register it in the global OpenCode config (`~/.config/opencode/opencode.jsonc`)
106
-
107
- **Restart OpenCode after installation.**
108
-
109
- ---
52
+ # 4. Edit configuration file (optional), e.g.
53
+ nano opencoderag.json
110
54
 
111
- ### Per-Workspace Setup
112
-
113
- ```bash
114
- cd your-workspace
115
- opencode-rag init
55
+ # 4. Index your workspace
56
+ opencode-rag index
116
57
  ```
117
58
 
118
- Bootstraps the current directory with all required files and a sample configuration.
119
- Add `--skip-install` to generate the files only, without installing dependencies.
59
+ *(To uninstall, simply run `./install.sh uninstall` or `.\install.ps1 uninstall`)*
120
60
 
121
61
  ---
122
62
 
123
- ### Manual Installation
63
+ ## How it Works
124
64
 
125
- If you prefer to build and install without the script:
126
-
127
- ```bash
128
- npm run build
129
- npm pack
130
-
131
- # Install into OpenCode's runtime
132
- npm install --prefix ~/.opencode/ opencode-rag-plugin-1.2.0.tgz
133
- npm install --prefix ~/.config/opencode/ opencode-rag-plugin-1.2.0.tgz
134
-
135
- # Then add "opencode-rag-plugin" to the plugins array in:
136
- # ~/.config/opencode/opencode.jsonc
137
- ```
65
+ OpenCodeRAG intelligently processes your query in OpenCode and your codebase for high-precision retrieval:
66
+ 1. **AST-aware chunking:** Intelligently splits code into functions, methods, and classes using `tree-sitter`.
67
+ 2. **Local Vector Database:** Uses LanceDB to store embeddings locally without any cloud dependencies.
68
+ 3. **Hybrid Search:** Combines TF×IDF keyword matching with vector similarity for superior precision on identifiers.
69
+ 4. **Incremental Indexing:** Only updates files that have changed, ensuring that the vector database stays up-to-date.
138
70
 
139
71
  ---
140
72
 
141
- ### Uninstallation
73
+ ## OpenCode Integration
142
74
 
143
- ```bash
144
- # Linux/macOS
145
- ./install.sh uninstall
75
+ When are using OpenCode, the plugin enhances your agent with two main features:
146
76
 
147
- # Windows
148
- .\install.ps1 uninstall
149
- ```
150
-
151
- **Restart OpenCode after uninstalling.**
77
+ ### 1. Auto-Injection (Background Context)
78
+ After every message you send, the plugin effectively searches your vector-indexed codebase:
79
+ - **High-confidence results (score ≥ 0.75):** Actual code chunks are injected directly into your prompt, giving the agent instant context without a tool-call round-trip.
80
+ - **Lower-confidence results:** A compact list of suggested files is appended instead (e.g., `src/plugin.ts (lines 10-42)`).
152
81
 
153
- > **Automatic dependencies:** `apache-arrow` (LanceDB peer dependency) and `tree-sitter-wasm` (pre-built WASM grammars) are installed automatically.
82
+ ### 2. Direct Tool Call (`opencode-rag-context`)
83
+ Any OpenCode agent can actively invoke the RAG tool to fetch specific code chunks, filter by exact file paths, or target specific programming languages.
154
84
 
155
85
  ---
156
86
 
157
87
  ## Configuration
158
88
 
159
- Create `opencode-rag.json` in your project root (auto-detected), or point to it explicitly with `--config ./path/to/config.json`.
160
-
161
- The repository's own [`opencode-rag.json`](./opencode-rag.json) is a complete, annotated example covering all available options.
162
-
163
- **Partial overrides are supported:** only the keys you set are applied — everything else falls back to defaults. Sections are deep-merged.
164
-
165
- ---
89
+ Running `opencode-rag init` creates the config file `opencode-rag.json` in your project root. You only need to define the values you want to override.
166
90
 
167
91
  ### Embedding Providers
92
+ ```json
93
+ {
94
+ "embedding": {
95
+ "provider": "ollama",
96
+ "baseUrl": "http://localhost:11434/api",
97
+ "timeoutMs": 30000
98
+ }
99
+ }
100
+ ```
101
+ * **Ollama (Default):** Local, private, no API key needed. *(Increase `timeoutMs` if your model has a slow cold start)*.
102
+ * **OpenAI:** Set `provider` to `"openai"`, change `baseUrl` to `"https://api.openai.com/v1"`, and provide your `apiKey`.
168
103
 
169
- | Provider | `baseUrl` | Notes |
170
- |----------|-----------|-------|
171
- | `ollama` | `http://localhost:11434/api` | **Default.** No API key required. |
172
- | `openai` | `https://api.openai.com/v1` | Requires `apiKey`. Sends all texts in one batch request. |
173
-
174
- - `embedding.timeoutMs` defaults to `30000` ms. Increase it if your local model has a slow cold start.
175
- - Ollama sends one request per batch to `/api/embed`. Set `embedding.proxy.url` to route through a standard HTTP proxy.
104
+ ### Plugin Settings
176
105
 
177
- ---
106
+ | Option | Default | Description |
107
+ |--------|---------|-------------|
108
+ | `openCode.readOverride` | `false` | If `true`, overrides OpenCode's default file reader to append RAG chunks as supplementary context. |
109
+ | `openCode.autoInject.enabled` | `true` | Turn background auto-injection on/off. |
110
+ | `openCode.autoInject.minScore` | `0.75` | Minimum relevance score to inject actual code (0–1). |
111
+ | `retrieval.topK` | `10` | Default number of chunks fetched per query. |
112
+ | `retrieval.hybridSearch.enabled` | `true` | Enables combined TF×IDF + vector search. |
178
113
 
179
- ### Logging
114
+ <details>
115
+ <summary>View Logging Configuration</summary>
180
116
 
181
117
  ```json
182
118
  {
183
119
  "logging": {
184
- "level": "info",
120
+ "level": "info", // Options: "debug", "info", or "error"
185
121
  "logFilePath": "./.opencode/opencode-rag.log"
186
122
  }
187
123
  }
188
124
  ```
125
+ </details>
189
126
 
190
- | Option | Default | Description |
191
- |--------|---------|-------------|
192
- | `level` | `"info"` | `"debug"`, `"info"`, or `"error"` |
193
- | `logFilePath` | `"./.opencode/opencode-rag.log"` | Relative paths resolve against the workspace root |
127
+ ### `AGENTS.md` Setup
128
+ To ensure the OpenCode agent knows how to leverage the plugin, add this snippet to your workspace's `AGENTS.md`:
194
129
 
195
- The `LOG_FILE_PATH` environment variable is a fallback when no config value is set. Config takes precedence over the env var.
130
+ <details>
131
+ <summary>Click to view the AGENTS.md snippet</summary>
196
132
 
197
- ---
133
+ ```markdown
134
+ ## OpenCodeRAG Plugin
135
+
136
+ This workspace has OpenCodeRAG installed for semantic code retrieval.
198
137
 
199
- ## Usage
138
+ ### `opencode-rag-context` tool
139
+ Before planning, editing, or answering questions, use this tool to retrieve relevant code chunks with file paths, line ranges, and surrounding implementation.
140
+ - `query` (required) — narrow, specific search, e.g. `"authentication middleware setup"`
141
+ - `pathHints` (optional) — up to 10 path filters, e.g. `["src/auth/"]`
142
+ - `languageHints` (optional) — up to 10 language filters, e.g. `["typescript"]`
143
+ - `topK` (optional) — result count (1–25, default 10)
200
144
 
201
- OpenCodeRAG provides two interfaces:
145
+ ### File suggestions
146
+ After each user message, a `chat.message` hook appends up to 10 relevant file suggestions. Look for lines like `src/file.ts (typescript, lines 10-42)` at the bottom of user input.
202
147
 
203
- | Interface | Best for |
204
- |-----------|----------|
205
- | **CLI** | Manual indexing, searching, and diagnostics |
206
- | **OpenCode plugin** | Automatic retrieval and file suggestions while chatting |
148
+ ### Indexing
149
+ - Changed files are auto-indexed in the background.
150
+ - If searches return no results, run `opencode-rag index` in the terminal.
151
+ ```
152
+ </details>
207
153
 
208
154
  ---
209
155
 
210
- ### CLI
156
+ ## CLI Interface
157
+
158
+ The CLI interface (`opencode-rag`) provides full access to build, manage, and search your project's vector database, even without opening OpenCode.
159
+ This is mainly intended for testing/debugging purposes, but can also be integrated into your own applications or scripts.
211
160
 
212
161
  ```bash
213
162
  # Index the workspace (incremental by default)
214
163
  opencode-rag index
215
164
 
216
- # Force a complete re-index
217
- opencode-rag index --force
218
-
219
- # Watch for changes and re-index automatically
165
+ # Watch for file changes and re-index automatically
220
166
  opencode-rag index --watch
221
167
 
222
- # Semantic search
223
- opencode-rag query "How is authentication handled?"
224
- opencode-rag query "error handling" --top-k 5
168
+ # Force a complete rebuild of the index
169
+ opencode-rag index --force
225
170
 
226
- # Show index statistics
227
- opencode-rag status
171
+ # Semantic search directly from the terminal
172
+ opencode-rag query "How is authentication handled?" --top-k 5
228
173
 
229
- # Clear all indexed data
174
+ # Show index statistics or clear data
175
+ opencode-rag status
230
176
  opencode-rag clear
231
-
232
- # Use a custom config file
233
- opencode-rag index --config ./my-config.json
234
- ```
235
-
236
- **Example `status` output:**
237
- ```
238
- Indexed chunks: 1247
239
- Store path: /home/user/project/.opencode/rag_db
240
- Embedding provider: ollama
241
- Embedding model: nomic-embed-text
242
- Manifest status: ok
243
- Manifest entries: 42
244
- Last indexed: 2026-05-28 10:45:02
245
- Up-to-date files: 42
246
- Pending files: 0
247
- Keyword index: enabled (1274 chunks)
248
- ```
249
-
250
- #### How Incremental Indexing Works
251
-
252
- A manifest is stored at `<vectorStore.path>/manifest.json` and tracks file hashes, chunk counts, and the last successful index timestamp.
253
-
254
- - Only **changed files** are re-embedded; **deleted files** are removed from the store.
255
- - If the manifest is missing or corrupt while the store already has data, the next pass **clears and rebuilds** the entire store to prevent duplicates.
256
-
257
- #### Watch Mode
258
-
259
- ```bash
260
- opencode-rag index --watch
261
177
  ```
262
178
 
263
- - Runs a full initial index pass, then listens for `add`, `change`, `unlink`, and `unlinkDir` events.
264
- - Changes are debounced (300 ms) before triggering an incremental pass.
265
- - If a pass is already running, one follow-up pass is queued and starts immediately after.
266
- - The watcher ignores excluded directories, the vector store path, and the manifest file itself.
267
- - Press `Ctrl+C` to stop.
268
-
269
179
  ---
270
180
 
271
- ### OpenCode Plugin
272
-
273
- Once installed, the plugin registers two hooks:
274
-
275
- | Hook | What it does |
276
- |------|-------------|
277
- | `opencode-rag-context` | A retrieval tool the agent can call directly to fetch code chunks with file paths and line ranges |
278
- | `chat.message` | After each user message, retrieves relevant files and appends them to the message |
279
-
280
- #### Auto-Injection
181
+ ## Supported Languages
281
182
 
282
- After each message you send, the plugin:
183
+ OpenCodeRAG uses advanced AST (Abstract Syntax Tree) parsing via `tree-sitter` for major languages, falling back to regex or line-based chunking for others.
283
184
 
284
- 1. Extracts your message text
285
- 2. Runs semantic retrieval against the indexed workspace
286
- 3. **High-confidence results** (relevance `autoInject.minScore`, default `0.75`): injects the actual code chunks directly into the message — the agent gets context without a tool-call round-trip:
287
- ```
288
- ---
289
- **Auto-retrieved code context** _(context: 2 chunks, 1 file, relevance 0.88–0.92)_
290
- ---
291
- [src/auth.ts:12-30] (typescript, score: 0.92)
292
- ```typescript
293
- function login() { ... }
294
- ```
295
- ---
296
- ```
297
- 4. **No high-confidence results**: falls back to a compact file list (max 10 files):
298
- ```
299
- src/plugin.ts (typescript, lines 10-42, relevance 0.87)
300
- src/core/config.ts (typescript, lines 66-145, relevance 0.72)
301
- ```
302
-
303
- This eliminates a tool-call round-trip for roughly 70% of code-related messages. The agent can still call `opencode-rag-context` for more targeted or additional context.
304
-
305
- > **Note:** Retrieval errors are silently caught — a failed search will never break the chat.
185
+ * **AST Support:** TypeScript, JavaScript, Python, Java, Go, Rust, C, C++, C#, Ruby, Kotlin, Swift, JSON, XML, HTML, CSS.
186
+ * **Regex / Structure Support:** Markdown, Razor, `.sln`, LaTeX, PDF, Word (`.docx`/`.doc`), Excel.
187
+ * **Fallback:** Raw text blocks (100 lines/chunk).
306
188
 
307
189
  ---
308
190
 
309
- #### Plugin Configuration Reference
310
-
311
- | Option | Default | Description |
312
- |--------|---------|-------------|
313
- | `openCode.readOverride` | `false` | When `true`, registers a RAG-backed `read` tool that shadows OpenCode's built-in file reader — returns full file contents with relevant RAG chunks appended as supplementary context |
314
- | `openCode.maxContextChunks` | `5` | Maximum chunks returned by `opencode-rag-context` |
315
- | `openCode.autoInject.enabled` | `true` | Enable or disable auto-injection |
316
- | `openCode.autoInject.minScore` | `0.75` | Minimum relevance score for auto-injection (0–1) |
317
- | `openCode.autoInject.maxChunks` | `3` | Maximum chunks to inject per message |
318
- | `openCode.autoInject.maxTokens` | `2000` | Token budget for injected content (~4 chars/token) |
319
- | `retrieval.topK` | `10` | Chunks fetched per query (controls file suggestion breadth) |
320
- | `retrieval.hybridSearch.enabled` | `true` | Enable or disable hybrid TF×IDF + vector search |
321
- | `retrieval.hybridSearch.keywordWeight` | `0.4` | Keyword weight in hybrid fusion (0–1; higher = more keyword influence) |
322
-
323
- ---
324
-
325
- #### AGENTS.md Snippet
326
-
327
- Add this section to your workspace's `AGENTS.md` so the agent knows how to use the plugin:
328
-
329
- ```markdown
330
- ## OpenCodeRAG Plugin
331
-
332
- This workspace has OpenCodeRAG installed for semantic code retrieval.
333
-
334
- ### `opencode-rag-context` tool
335
- Before planning, editing, or answering questions, use this tool to retrieve relevant
336
- code chunks with file paths, line ranges, and surrounding implementation.
337
- - `query` (required) — narrow, specific search, e.g. `"authentication middleware setup"`
338
- - `pathHints` (optional) — up to 10 path filters, e.g. `["src/auth/"]`
339
- - `languageHints` (optional) — up to 10 language filters, e.g. `["typescript"]`
340
- - `topK` (optional) — result count (1–25, default 10)
341
-
342
- ### File suggestions
343
- After each user message, a `chat.message` hook appends up to 10 relevant file
344
- suggestions. Look for lines like `src/file.ts (typescript, lines 10-42)` at the
345
- bottom of user input.
346
-
347
- ### Indexing
348
- - Changed files are auto-indexed in the background (debounced 5 s).
349
- - If searches return no results, the workspace may not be indexed yet —
350
- run `opencode-rag index` from the terminal (or `npx opencode-rag-plugin`).
351
- - Files under 1 KB, excluded extensions, and excluded directories
352
- (`node_modules`, `.git`, `.opencode`, `dist`, etc.) are silently skipped.
353
- ```
354
-
355
- The plugin also injects a reminder about `opencode-rag-context` into the agent's system prompt via `experimental.chat.system.transform`.
356
-
357
- ---
191
+ ## Developer Guide
358
192
 
359
- ## Architecture
193
+ Developers are welcome! If you fixed a bug or implemented a new feature, just submit your pull request to this repository.
360
194
 
195
+ ### Architecture Flow
196
+ ```text
197
+ Workspace Files ──> Chunker (tree-sitter/regex) ──> Chunks
198
+
199
+ Chunks ──> Embedder (Ollama/OpenAI) ──> Vectors
200
+
201
+ Vectors ──> VectorStore (LanceDB) <──> Indexer / Retriever ──> CLI / Agent Context
361
202
  ```
362
- Workspace Files
363
-
364
-
365
- ┌──────────────┐
366
- │ Chunker │ AST-based (tree-sitter) or line-based fallback
367
- └──────┬───────┘
368
- │ chunks
369
-
370
- ┌──────────────┐
371
- │ Embedder │ Ollama / OpenAI-compatible API
372
- └──────┬───────┘
373
- │ vectors
374
-
375
- ┌──────────────┐
376
- │ VectorStore │ LanceDB (local files or memory:// for tests)
377
- └──────┬───────┘
378
- │ + manifest.json
379
-
380
- ┌──────────────┐
381
- │ Indexer/Retr.│ incremental index or query/search
382
- └──────┬───────┘
383
- │ results
384
-
385
- LLM Context
386
- ```
387
-
388
- ---
389
-
390
- ## Tech Stack
391
-
392
- | Layer | Technology |
393
- |-------|------------|
394
- | Runtime | Node.js v22 + tsx (ESM) |
395
- | Language | TypeScript 5.8 |
396
- | Chunking | web-tree-sitter (WASM) + tree-sitter-wasm grammars |
397
- | Embeddings | Ollama / OpenAI-compatible (native fetch) |
398
- | Vector DB | LanceDB (`@lancedb/lancedb`) |
399
- | CLI | commander |
400
- | Tests | Node built-in test runner (`node --test`) |
401
- | Package manager | npm (with `--legacy-peer-deps`) |
402
203
 
403
- ---
204
+ ### Tech Stack
205
+ - **Runtime:** Node.js v22 + `tsx` (ESM), TypeScript 5.8
206
+ - **Chunking:** `web-tree-sitter` (WASM) + grammars
207
+ - **Vector DB:** LanceDB (`@lancedb/lancedb`) stored locally (`.opencode/rag_db`)
208
+ - **Tests:** Node built-in test runner (`npm test`)
404
209
 
405
- ## Chunking Language Support
406
-
407
- | Language | Strategy | Captures |
408
- |----------|----------|---------|
409
- | TypeScript | AST (tree-sitter) | functions, methods, classes, interfaces |
410
- | JavaScript | AST (tree-sitter) | functions, classes, arrow functions, exports |
411
- | Python | AST (tree-sitter) | functions, classes, decorated definitions |
412
- | Java | AST (tree-sitter) | methods, classes, interfaces, enums |
413
- | Go | AST (tree-sitter) | functions, methods, type declarations |
414
- | Rust | AST (tree-sitter) | functions, structs, enums, traits, impl blocks, modules, types |
415
- | C | AST (tree-sitter) | functions, structs, enums, unions, typedefs |
416
- | C++ | AST (tree-sitter) | functions, classes, structs, enums, namespaces, templates |
417
- | C# | AST (tree-sitter) | classes, interfaces, structs, enums, methods, namespaces, records |
418
- | Ruby | AST (tree-sitter) | methods, classes, modules, singleton methods |
419
- | Kotlin | AST (tree-sitter) | functions, classes, interfaces, objects, properties |
420
- | Swift | AST (tree-sitter) | functions, classes, structs, enums, protocols, extensions, variables |
421
- | JSON | AST (tree-sitter) | key-value pairs |
422
- | XML | AST (tree-sitter) | elements (1 chunk per root element) |
423
- | HTML | AST (tree-sitter) | `<script>` / `<style>` blocks |
424
- | CSS | AST (tree-sitter) | rule sets, at-rules, media, keyframes |
425
- | Razor | Regex (brace matching) | `@code` / `@functions` blocks, template regions |
426
- | Markdown | Regex heading split | h1/h2 sections + trailing content |
427
- | Solution (`.sln`) | Regex (section boundary) | project entries and global sections |
428
- | LaTeX | Regex section split | chapter/section/subsection/subsubsection boundaries |
429
- | PDF | Paragraph-based | groups small paragraphs, splits oversized ones |
430
- | Word (`.docx`) | Paragraph-based | extracts via mammoth; groups small paragraphs, splits oversized |
431
- | Word (`.doc`) | Paragraph-based | extracts via word-extractor; groups small paragraphs, splits oversized |
432
- | Excel (`.xls`/`.xlsx`) | Row-batch | extracts CSV per sheet via `@e965/xlsx`; splits by sheet, then by row batch |
433
- | *(other)* | Line-based (100 lines/chunk) | raw text blocks |
434
210
 
435
211
  ### Adding Custom Chunkers
436
-
437
- Custom chunkers can be registered without modifying the project source.
438
-
439
- **Via config file** — add to `opencode-rag.json`:
440
-
212
+ You can easily inject custom chunkers without modifying the source code via `opencode-rag.json`:
441
213
  ```json
442
214
  {
443
215
  "chunkers": [
@@ -446,84 +218,10 @@ Custom chunkers can be registered without modifying the project source.
446
218
  }
447
219
  ```
448
220
 
449
- The module path is resolved relative to the config file. The module must export (as default or named) an object implementing the `Chunker` interface:
450
-
451
- ```typescript
452
- interface Chunker {
453
- readonly language: string;
454
- readonly fileExtensions?: string[];
455
- chunk(filePath: string, content: string): Promise<Chunk[]>;
456
- }
457
- ```
458
-
459
- **Via programmatic API:**
460
-
461
- ```typescript
462
- import { registerChunker } from "opencode-rag-plugin/library";
463
- registerChunker(myChunker, [".xyz"]); // second arg overrides fileExtensions
464
- ```
465
-
466
- > If a built-in chunker already handles the requested extension, the new registration is skipped and a warning is emitted.
467
-
468
- ---
469
-
470
- ## Data Model
471
-
472
- ```typescript
473
- interface Chunk {
474
- id: string;
475
- content: string;
476
- embedding?: number[];
477
- metadata: {
478
- filePath: string;
479
- startLine: number;
480
- endLine: number;
481
- language: string;
482
- };
483
- }
484
-
485
- interface SearchResult {
486
- chunk: Chunk;
487
- score: number; // 1 / (1 + L2_distance), range [0, 1]
488
- }
489
- ```
490
-
491
221
  ---
492
222
 
493
- ## Vector Store
494
-
495
- LanceDB stores chunks in a `chunks` table with columns: `id`, `content`, `embedding` (vector), `filePath`, `startLine`, `endLine`, `language`.
496
-
497
- | Mode | Description |
498
- |------|-------------|
499
- | **Disk** | Files written to `vectorStore.path` (default: `.opencode/rag_db`) |
500
- | **Memory** | `memory://` URI — for tests only; data is lost when the process exits |
501
-
502
- Additional details:
503
- - Schema is auto-inferred from a seed row on first table creation
504
- - L2 distance search; score = `1 / (1 + distance)`
505
- - File paths are normalized to absolute forward-slash paths
506
- - `manifest.json` in the store directory tracks indexed files for incremental updates
507
-
508
- ---
509
-
510
- ## Development
511
-
512
- ```bash
513
- # TypeScript typecheck
514
- npm run typecheck
515
-
516
- # Run all tests
517
- npm test
518
-
519
- # Run a specific test file
520
- node --import tsx --test src/__tests__/chunker/fallback.test.ts
521
- ```
522
-
523
- Tests use Node's built-in runner (`node:test`) with `tsx` for TypeScript imports. No external test library is required.
524
-
525
- ---
223
+ ## Privacy & Security
526
224
 
527
- ## Privacy
225
+ **100% Local Processing by Default.**
226
+ Whether you use it via CLI or as an agent plugin, OpenCodeRAG honors privacy strictly. Embeddings are generated locally by Ollama, and the vector database (LanceDB) is stored right in your project's directory. **No source code or embeddings ever leave your machine** unless you explicitly configure a third-party API like OpenAI.
528
227
 
529
- All processing runs locally. By default, embeddings are generated by Ollama on your own machine. **No data leaves your machine** unless you configure a remote embedding API.
@@ -1,13 +1,34 @@
1
1
  import { uuid } from "./uuid.js";
2
+ import { createRequire } from "node:module";
3
+ import { pathToFileURL } from "node:url";
4
+ import path from "node:path";
2
5
  const MAX_CHUNK_CHARS = 4000;
3
6
  const MIN_GROUP_CHARS = 300;
4
7
  const PARAGRAPH_SPLIT = /\n\s*\n/;
8
+ function getStandardFontsUrl() {
9
+ const require = createRequire(import.meta.url);
10
+ const pkgJson = require.resolve("pdfjs-dist/package.json");
11
+ const fontsDir = path.join(path.dirname(pkgJson), "standard_fonts");
12
+ const url = pathToFileURL(fontsDir).href;
13
+ return url.endsWith("/") ? url : url + "/";
14
+ }
5
15
  async function createPdfDocument(buffer) {
6
- const { DOMMatrix } = await import("canvas");
7
- globalThis.DOMMatrix ??= DOMMatrix;
8
- globalThis.DOMMatrixReadOnly ??= DOMMatrix;
16
+ try {
17
+ const { DOMMatrix } = await import("canvas");
18
+ globalThis.DOMMatrix ??= DOMMatrix;
19
+ globalThis.DOMMatrixReadOnly ??= DOMMatrix;
20
+ }
21
+ catch {
22
+ const { default: CSSMatrix } = await import("@thednp/dommatrix");
23
+ globalThis.DOMMatrix ??= CSSMatrix;
24
+ globalThis.DOMMatrixReadOnly ??= CSSMatrix;
25
+ }
9
26
  const { getDocument } = await import("pdfjs-dist/legacy/build/pdf.mjs");
10
- const loadingTask = getDocument({ data: new Uint8Array(buffer) });
27
+ const loadingTask = getDocument({
28
+ data: new Uint8Array(buffer),
29
+ standardFontDataUrl: getStandardFontsUrl(),
30
+ verbosity: 0,
31
+ });
11
32
  return loadingTask.promise;
12
33
  }
13
34
  export async function extractPdfText(buffer) {
@@ -1 +1 @@
1
- {"version":3,"file":"pdf.js","sourceRoot":"","sources":["../../src/chunker/pdf.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,MAAM,eAAe,GAAG,SAAS,CAAC;AAElC,KAAK,UAAU,iBAAiB,CAAC,MAAc;IAC7C,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC7C,UAAU,CAAC,SAAS,KAAK,SAAmD,CAAC;IAC7E,UAAU,CAAC,iBAAiB,KAAK,SAA2D,CAAC;IAE7F,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,iCAAiC,CAAC,CAAC;IACxE,MAAM,WAAW,GAAG,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAClE,OAAO,WAAW,CAAC,OAAO,CAAC;AAC7B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAAc;IACjD,MAAM,GAAG,GAAG,MAAM,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAClC,MAAM,OAAO,GAAG,M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,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-rag-plugin",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "OpenCode plugin for local-first RAG-based semantic code search",
5
5
  "type": "module",
6
6
  "main": "./dist/plugin-entry.js",
@@ -72,6 +72,7 @@
72
72
  "@e965/xlsx": "^0.20.3",
73
73
  "@lancedb/lancedb": "^0.29.0",
74
74
  "apache-arrow": "18.1.0",
75
+ "@thednp/dommatrix": "^3.0.4",
75
76
  "canvas": "^3.2.3",
76
77
  "chokidar": "^4.0.3",
77
78
  "commander": "^13.1.0",