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/ReadMe.md +52 -5
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.js +1 -0
- package/dist/cli/commands/init-helpers.js +3 -0
- package/dist/cli/commands/status.js +3 -3
- package/dist/cli/commands/update.d.ts +15 -0
- package/dist/cli/commands/update.js +65 -0
- package/dist/cli/index.js +2 -1
- package/dist/core/auto-update-state.d.ts +33 -0
- package/dist/core/auto-update-state.js +69 -0
- package/dist/core/config.d.ts +18 -3
- package/dist/core/config.js +75 -5
- package/dist/core/runtime-overrides.js +3 -1
- package/dist/core/setup-runtime.js +61 -13
- package/dist/core/version-check.d.ts +76 -0
- package/dist/core/version-check.js +113 -2
- package/dist/embedder/cohere.d.ts +1 -1
- package/dist/embedder/cohere.js +2 -2
- package/dist/embedder/factory.js +1 -1
- package/dist/embedder/health.js +1 -1
- package/dist/embedder/ollama.d.ts +1 -1
- package/dist/embedder/ollama.js +2 -2
- package/dist/embedder/openai.d.ts +1 -1
- package/dist/embedder/openai.js +2 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/indexer/pipeline.js +15 -4
- package/dist/plugin.js +166 -19
- package/dist/tui.js +18 -1
- package/dist/vectorstore/lancedb.d.ts +1 -0
- package/dist/vectorstore/lancedb.js +8 -2
- package/dist/watcher.d.ts +2 -0
- package/dist/watcher.js +2 -1
- package/package.json +1 -1
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
|
-
|
|
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
|
|
191
|
+
await done;
|
|
189
192
|
}
|
|
190
193
|
catch (err) {
|
|
194
|
+
this.writeLock = Promise.resolve();
|
|
191
195
|
if (isCorruptionError(err) && await this.tryRepair()) {
|
|
192
|
-
|
|
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: {
|