@alint-js/model-adapter-acp 0.6.0 → 0.7.0

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 (2) hide show
  1. package/dist/index.mjs +10 -6
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -269,7 +269,7 @@ var CompletionTurn = class {
269
269
  #cancelled;
270
270
  #cancelSession;
271
271
  #connection;
272
- #connectionDisposed = false;
272
+ #connectionDisposePromise;
273
273
  #deferredText;
274
274
  #finished = false;
275
275
  #options;
@@ -334,9 +334,10 @@ var CompletionTurn = class {
334
334
  if (this.#cancelled) throw this.#cancelled;
335
335
  }
336
336
  async #disposeConnection() {
337
- if (this.#connectionDisposed || this.#connection?.kind !== "stream") return;
338
- this.#connectionDisposed = true;
339
- await this.#connection.dispose?.();
337
+ const connection = this.#connection;
338
+ if (connection?.kind !== "stream") return;
339
+ this.#connectionDisposePromise ??= Promise.resolve().then(() => connection.dispose?.());
340
+ await this.#connectionDisposePromise;
340
341
  }
341
342
  #finish() {
342
343
  if (this.#finished) return;
@@ -428,8 +429,11 @@ var CompletionTurn = class {
428
429
  this.#options.bridges.delete(this.#bridge.id);
429
430
  await this.#bridge.close();
430
431
  }
431
- this.#finish();
432
- await this.#disposeConnection();
432
+ try {
433
+ await this.#disposeConnection();
434
+ } finally {
435
+ this.#finish();
436
+ }
433
437
  }
434
438
  }
435
439
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alint-js/model-adapter-acp",
3
3
  "type": "module",
4
- "version": "0.6.0",
4
+ "version": "0.7.0",
5
5
  "description": "OpenAI-compatible HTTP gateway for Agent Client Protocol coding agents",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -36,7 +36,7 @@
36
36
  "zod": "^4.4.3"
37
37
  },
38
38
  "devDependencies": {
39
- "@alint-js/core": "0.6.0"
39
+ "@alint-js/core": "0.7.0"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "tsdown",