opencode-rag-plugin 1.22.0 → 1.22.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.
@@ -183,6 +183,8 @@ export interface TuiConfig {
183
183
  fileListKeybinding: string;
184
184
  /** Keybinding to toggle the chunk viewer panel. */
185
185
  chunksKeybinding: string;
186
+ /** Keybinding to open the RAG settings dialog. Must be distinguishable by the terminal (see docs). */
187
+ settingsKeybinding: string;
186
188
  }
187
189
  /** Configuration for the standalone MCP (Model Context Protocol) server. */
188
190
  export interface McpConfig {
@@ -294,6 +294,7 @@ export const DEFAULT_CONFIG = {
294
294
  tui: {
295
295
  fileListKeybinding: "ctrl+enter",
296
296
  chunksKeybinding: "ctrl+alt+enter",
297
+ settingsKeybinding: "ctrl+shift+r",
297
298
  },
298
299
  logging: {
299
300
  level: "info",
@@ -49,6 +49,7 @@ export interface RuntimeOverrides {
49
49
  tui?: {
50
50
  fileListKeybinding?: string;
51
51
  chunksKeybinding?: string;
52
+ settingsKeybinding?: string;
52
53
  };
53
54
  }
54
55
  /** Load runtime overrides from the store directory. Returns empty object if none exist. */
@@ -149,6 +149,7 @@ export function applyRuntimeOverrides(cfg, overrides) {
149
149
  ...(merged.tui ?? {}),
150
150
  fileListKeybinding: overrides.tui.fileListKeybinding ?? merged.tui?.fileListKeybinding ?? DEFAULT_CONFIG.tui.fileListKeybinding,
151
151
  chunksKeybinding: overrides.tui.chunksKeybinding ?? merged.tui?.chunksKeybinding ?? DEFAULT_CONFIG.tui.chunksKeybinding,
152
+ settingsKeybinding: overrides.tui.settingsKeybinding ?? merged.tui?.settingsKeybinding ?? DEFAULT_CONFIG.tui.settingsKeybinding,
152
153
  };
153
154
  }
154
155
  return merged;
@@ -122,8 +122,7 @@ function dedupeSimilar(results, threshold) {
122
122
  if (sim > threshold) {
123
123
  const [keepIdx, removeIdx] = kept[i].score >= kept[j].score ? [i, j] : [j, i];
124
124
  const removedId = kept[removeIdx].chunk.id;
125
- kept.splice(removeIdx, 1);
126
- kept[keepIdx] = {
125
+ const keeper = {
127
126
  ...kept[keepIdx],
128
127
  optimized: {
129
128
  ...kept[keepIdx].optimized,
@@ -133,6 +132,14 @@ function dedupeSimilar(results, threshold) {
133
132
  ],
134
133
  },
135
134
  };
135
+ if (removeIdx < keepIdx) {
136
+ kept.splice(removeIdx, 1);
137
+ kept[keepIdx - 1] = keeper;
138
+ }
139
+ else {
140
+ kept[keepIdx] = keeper;
141
+ kept.splice(removeIdx, 1);
142
+ }
136
143
  changed = true;
137
144
  break;
138
145
  }
package/dist/tui.js CHANGED
@@ -162,6 +162,7 @@ function renderSidebar(theme, version, status, tuiConfig, tokenStats) {
162
162
  : `Watcher idle \u00B7 last ${formatRelativeTime(watcher.lastRunAt)}`;
163
163
  const fileListKey = tuiConfig?.fileListKeybinding ?? "ctrl+enter";
164
164
  const chunksKey = tuiConfig?.chunksKeybinding ?? "ctrl+alt+enter";
165
+ const settingsKey = tuiConfig?.settingsKeybinding ?? "ctrl+shift+r";
165
166
  return box({
166
167
  width: "100%",
167
168
  flexDirection: "column",
@@ -186,7 +187,7 @@ function renderSidebar(theme, version, status, tuiConfig, tokenStats) {
186
187
  text({ fg: theme.text }, [statusLine]),
187
188
  text({ fg: theme.textMuted }, [timeLine]),
188
189
  text({ fg: watcher.running ? theme.accent : theme.textMuted }, [watcherLine]),
189
- text({ fg: theme.textMuted }, ["Ctrl+Shift+R → Settings"]),
190
+ text({ fg: theme.textMuted }, [`${formatKeybinding(settingsKey)} → Settings`]),
190
191
  text({ fg: theme.textMuted }, [`${formatKeybinding(fileListKey)} → Add File List`]),
191
192
  text({ fg: theme.textMuted }, [`${formatKeybinding(chunksKey)} → Add Chunks`]),
192
193
  ...(tokenStats && tokenStats.queries > 0 ? [
@@ -589,6 +590,12 @@ function buildSettingCategories(cfg, ro, providers) {
589
590
  label: "Keybindings",
590
591
  description: "Configure keyboard shortcuts",
591
592
  entries: [
593
+ {
594
+ path: ["tui", "settingsKeybinding"],
595
+ label: "Open settings",
596
+ type: "string",
597
+ currentValue: tuiRo.settingsKeybinding ?? tuiCfg.settingsKeybinding ?? "ctrl+shift+r",
598
+ },
592
599
  {
593
600
  path: ["tui", "fileListKeybinding"],
594
601
  label: "Add file list",
@@ -951,10 +958,11 @@ const plugin = {
951
958
  // ignore
952
959
  }
953
960
  }
954
- // Register keybinding for settings dialog
961
+ // Register keybinding for settings dialog (configurable)
955
962
  try {
963
+ const settingsKey = tuiConfig?.settingsKeybinding ?? "ctrl+shift+r";
956
964
  api.keymap.registerLayer({
957
- bindings: [{ key: "ctrl+shift+r", cmd: "opencode-rag:settings" }],
965
+ bindings: [{ key: settingsKey, cmd: "opencode-rag:settings" }],
958
966
  commands: [
959
967
  {
960
968
  name: "opencode-rag:settings",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-rag-plugin",
3
- "version": "1.22.0",
3
+ "version": "1.22.1",
4
4
  "description": "OpenCode plugin for local-first RAG-based semantic code search",
5
5
  "type": "module",
6
6
  "main": "./dist/plugin-entry.js",