@ai-sdk/harness-opencode 1.0.55 → 1.0.57

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @ai-sdk/harness-opencode
2
2
 
3
+ ## 1.0.57
4
+
5
+ ### Patch Changes
6
+
7
+ - @ai-sdk/harness@1.0.56
8
+ - @ai-sdk/provider-utils@5.0.19
9
+
10
+ ## 1.0.56
11
+
12
+ ### Patch Changes
13
+
14
+ - 8f10600: fix(harness): rename harness bridge `detach` to `stop` and `shutdown` to `destroy` for clarity
15
+ - Updated dependencies [2c0a8aa]
16
+ - Updated dependencies [861d423]
17
+ - Updated dependencies [8f10600]
18
+ - @ai-sdk/harness@1.0.55
19
+
3
20
  ## 1.0.55
4
21
 
5
22
  ### Patch Changes
@@ -39,7 +39,7 @@ function parseEnvList(value) {
39
39
  var ENV_TRUTHY = /* @__PURE__ */ new Set(["1", "true", "yes", "on"]);
40
40
  var WS_OPEN = 1;
41
41
  async function runBridge(options) {
42
- const { bridgeType, bridgeStateDir: bridgeStateDir2, onStart, onDetach } = options;
42
+ const { bridgeType, bridgeStateDir: bridgeStateDir2, onStart, onStop, onDestroy } = options;
43
43
  const expectedToken = options.token ?? procEnv.BRIDGE_CHANNEL_TOKEN ?? "";
44
44
  const bridgeWsPort = options.port ?? parseInt(procEnv.BRIDGE_WS_PORT ?? "0", 10);
45
45
  const bridgeMetaPath = `${bridgeStateDir2}/bridge-meta.json`;
@@ -340,17 +340,18 @@ async function runBridge(options) {
340
340
  replay(ws, msg.lastSeenEventId);
341
341
  activeSocketReadyForLiveEvents = true;
342
342
  return;
343
- case "shutdown":
343
+ case "destroy":
344
344
  currentTurnState = "done";
345
345
  void writeBridgeMeta("done");
346
- drainThenExit(ws, 1e3, "shutdown");
346
+ await onDestroy?.();
347
+ drainThenExit(ws, 1e3, "destroy");
347
348
  return;
348
- case "detach": {
349
+ case "stop": {
349
350
  currentTurnState = "done";
350
351
  void writeBridgeMeta("done");
351
- const data = await onDetach?.() ?? {};
352
- sendControl({ type: "bridge-detach", data });
353
- drainThenExit(ws, 1e3, "detach");
352
+ const data = await onStop?.() ?? {};
353
+ sendControl({ type: "bridge-stop", data });
354
+ drainThenExit(ws, 1e3, "stop");
354
355
  return;
355
356
  }
356
357
  }
@@ -1488,7 +1489,7 @@ await runBridge({
1488
1489
  bridgeType: "opencode",
1489
1490
  bridgeStateDir,
1490
1491
  onStart: runTurn,
1491
- onDetach: () => runtime.sessionId ? { openCodeSessionId: runtime.sessionId } : {}
1492
+ onStop: () => runtime.sessionId ? { openCodeSessionId: runtime.sessionId } : {}
1492
1493
  });
1493
1494
  async function runTurn(start, turn) {
1494
1495
  const emit = (msg) => turn.emit(msg);