opencode-rag-plugin 1.17.0 → 1.17.3

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/dist/tui.js CHANGED
@@ -212,7 +212,9 @@ function getConfigPath(worktree) {
212
212
  /** Read and parse a JSON file, returning undefined on failure. */
213
213
  function readJsonFile(filePath) {
214
214
  try {
215
- return JSON.parse(readFileSync(filePath, "utf-8"));
215
+ const raw = readFileSync(filePath, "utf-8");
216
+ const stripped = raw.charCodeAt(0) === 0xfeff ? raw.slice(1) : raw;
217
+ return JSON.parse(stripped);
216
218
  }
217
219
  catch {
218
220
  return undefined;
@@ -341,6 +343,8 @@ function buildSettingCategories(cfg, ro, providers) {
341
343
  const descRo = (ro.description ?? {});
342
344
  const docModeCfg = (cfg.documentationMode ?? {});
343
345
  const docModeRo = (ro.documentationMode ?? {});
346
+ const wikiModeCfg = (cfg.wikiMode ?? {});
347
+ const wikiModeRo = (ro.wikiMode ?? {});
344
348
  const embeddingCfg = (cfg.embedding ?? {});
345
349
  const embeddingRo = (ro.embedding ?? {});
346
350
  const tuiCfg = (cfg.tui ?? {});
@@ -471,6 +475,19 @@ function buildSettingCategories(cfg, ro, providers) {
471
475
  },
472
476
  ],
473
477
  },
478
+ {
479
+ id: "wiki",
480
+ label: "Wiki Mode",
481
+ description: "Configure the AI-maintained knowledge wiki that synthesizes codebase knowledge over time",
482
+ entries: [
483
+ {
484
+ path: ["wikiMode", "enabled"],
485
+ label: "Wiki mode",
486
+ type: "boolean",
487
+ currentValue: wikiModeRo.enabled ?? wikiModeCfg.enabled ?? false,
488
+ },
489
+ ],
490
+ },
474
491
  {
475
492
  id: "keybindings",
476
493
  label: "Keybindings",
@@ -30,6 +30,7 @@ export declare class LanceDbStore implements VectorStore {
30
30
  private db;
31
31
  private table;
32
32
  private tableInit;
33
+ private writeLock;
33
34
  /**
34
35
  * @param dbPath - Filesystem path to the LanceDB database directory.
35
36
  * @param vectorDimension - Dimension of the embedding vectors. Default: 384.
@@ -75,6 +75,7 @@ export class LanceDbStore {
75
75
  db = null;
76
76
  table = null;
77
77
  tableInit = null;
78
+ writeLock = Promise.resolve(void 0);
78
79
  /**
79
80
  * @param dbPath - Filesystem path to the LanceDB database directory.
80
81
  * @param vectorDimension - Dimension of the embedding vectors. Default: 384.
@@ -184,12 +185,17 @@ export class LanceDbStore {
184
185
  async addChunks(chunks) {
185
186
  if (chunks.length === 0)
186
187
  return;
188
+ const done = this.writeLock.then(() => this.addChunksInternal(chunks));
189
+ this.writeLock = done.catch(() => { });
187
190
  try {
188
- await this.addChunksInternal(chunks);
191
+ await done;
189
192
  }
190
193
  catch (err) {
194
+ this.writeLock = Promise.resolve();
191
195
  if (isCorruptionError(err) && await this.tryRepair()) {
192
- await this.addChunksInternal(chunks);
196
+ const retry = this.addChunksInternal(chunks);
197
+ this.writeLock = retry.catch(() => { });
198
+ await retry;
193
199
  return;
194
200
  }
195
201
  throw err;
package/dist/watcher.d.ts CHANGED
@@ -30,6 +30,8 @@ export interface CreateBackgroundIndexerOptions {
30
30
  keywordIndex?: KeywordIndex;
31
31
  /** Optional provider for generating LLM-based chunk descriptions. */
32
32
  descriptionProvider?: DescriptionProvider;
33
+ /** Embedding vector dimension — enables atomic rebuilds instead of destructive clear. */
34
+ dimension?: number;
33
35
  }
34
36
  /** The current operational status of the background indexer watcher. */
35
37
  export type WatcherStatus = {
package/dist/watcher.js CHANGED
@@ -28,7 +28,7 @@ function writeWatcherStatus(storePath, status) {
28
28
  * @returns A BackgroundIndexer handle with a close() method for shutdown.
29
29
  */
30
30
  export function createBackgroundIndexer(options) {
31
- const { cwd, storePath, config, store, embedder, logFilePath, logLevel, keywordIndex, descriptionProvider } = options;
31
+ const { cwd, storePath, config, store, embedder, logFilePath, logLevel, keywordIndex, descriptionProvider, dimension } = options;
32
32
  writeWatcherStatus(storePath, { running: false, lastRunAt: undefined });
33
33
  const ac = new AbortController();
34
34
  const updateStatus = (partial) => {
@@ -45,6 +45,7 @@ export function createBackgroundIndexer(options) {
45
45
  embedder,
46
46
  keywordIndex,
47
47
  descriptionProvider,
48
+ dimension,
48
49
  filterPaths,
49
50
  abortSignal: ac.signal,
50
51
  logger: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-rag-plugin",
3
- "version": "1.17.0",
3
+ "version": "1.17.3",
4
4
  "description": "OpenCode plugin for local-first RAG-based semantic code search",
5
5
  "type": "module",
6
6
  "main": "./dist/plugin-entry.js",