vim-todo-ai-bridge 1.0.1 → 1.0.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.
Files changed (3) hide show
  1. package/README.md +4 -2
  2. package/package.json +1 -1
  3. package/server.js +5 -1
package/README.md CHANGED
@@ -51,7 +51,7 @@ OMP stores credentials in its local credential store. For API-key providers, omp
51
51
  Requires Node.js 20.19 or newer. Run this in a terminal and keep it open:
52
52
 
53
53
  ```sh
54
- npx -y vim-todo-ai-bridge
54
+ npx -y vim-todo-ai-bridge@latest
55
55
  ```
56
56
 
57
57
  The bridge starts `omp --mode rpc --no-session --no-tools` and listens on `http://127.0.0.1:43197`. Set `AI_BRIDGE_HOST` or `AI_BRIDGE_PORT` to change the address.
@@ -60,7 +60,7 @@ If `omp` is not on `PATH`, set the executable before starting the bridge (PowerS
60
60
 
61
61
  ```powershell
62
62
  $env:OMP_BIN = "C:\path\to\omp.exe"
63
- npx -y vim-todo-ai-bridge
63
+ npx -y vim-todo-ai-bridge@latest
64
64
  ```
65
65
 
66
66
  ### 4. Connect the extension
@@ -87,3 +87,5 @@ npm start --prefix ai-bridge
87
87
  - `Sign in to a provider with omp first`: run `omp`, then `/login <provider>`.
88
88
  - `No authenticated omp model is available`: run `omp models` and sign in to a provider that lists models.
89
89
  - The bridge is reachable but completion fails: keep the bridge terminal open and read its `[omp]` stderr lines.
90
+ - Slow suggestions: use a fast model from the available-model list. Typing cancels obsolete completions; requests have a 7-second bridge deadline and an 8-second extension deadline. Timeouts appear beside the suggestions instead of leaving an indefinite spinner.
91
+ - **Test AI** uses the autocomplete prompt and displays elapsed time. After upgrading the bridge, stop the old process and restart it; `/health` includes its version.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vim-todo-ai-bridge",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Local omp RPC bridge for vim-todo-list",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
package/server.js CHANGED
@@ -18,6 +18,8 @@ function readOmpArgs() {
18
18
  }
19
19
 
20
20
  const OMP_BIN = process.env.OMP_BIN || 'omp';
21
+ const OMP_DEFAULT_MODEL_IDS = ['claude-haiku-5-5', 'claude-haiku-4-5'];
22
+ let completeSeq = 0;
21
23
  const OMP_ARGS = readOmpArgs();
22
24
  const OMP_PROVIDER_IDS = {
23
25
  openai: 'openai',
@@ -206,7 +208,7 @@ class OmpRpcClient {
206
208
  String(candidate.id) === requestedValue ||
207
209
  modelSelector(modelProviderId(candidate), candidate) === requestedValue
208
210
  )
209
- : matches[0];
211
+ : OMP_DEFAULT_MODEL_IDS.map((id) => matches.find((c) => String(c.id) === id)).find(Boolean) || matches[0];
210
212
  if (!model) {
211
213
  throw new Error(
212
214
  requestedValue
@@ -234,7 +236,9 @@ class OmpRpcClient {
234
236
  }
235
237
 
236
238
  async complete(provider, requestedModel, prompt) {
239
+ const seq = ++completeSeq;
237
240
  const run = this.requestQueue.catch(() => undefined).then(async () => {
241
+ if (seq !== completeSeq) throw new Error('superseded by a newer completion request');
238
242
  const model = await this.resolveModel(provider, requestedModel);
239
243
  await this.request('new_session');
240
244
  await this.request('set_model', {