@opencode-ai/client 0.0.0-next-15388 → 0.0.0-next-15391

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.
@@ -21,10 +21,12 @@ export const start = Effect.fn("service.start")(function* (options = {}) {
21
21
  const compatible = yield* discover(options);
22
22
  if (compatible !== undefined)
23
23
  return compatible;
24
- const mismatched = yield* find(options);
25
- yield* Effect.sync(() => options.onStart?.(mismatched === undefined ? "missing" : "version-mismatch", mismatched?.info));
26
- if (mismatched !== undefined)
27
- yield* kill(mismatched.info, options).pipe(Effect.ignore);
24
+ const existing = yield* find(options);
25
+ if (existing?.version !== undefined && (options.version === undefined || existing.version === options.version))
26
+ return existing.endpoint;
27
+ yield* Effect.sync(() => options.onStart?.(existing === undefined ? "missing" : "version-mismatch", existing?.info));
28
+ if (existing !== undefined)
29
+ yield* kill(existing.info, options).pipe(Effect.ignore);
28
30
  const [command, ...args] = options.command ?? ["opencode", "serve", "--service"];
29
31
  if (command === undefined)
30
32
  return yield* Effect.fail(new Error("Missing service command"));
@@ -99,7 +101,7 @@ const probe = Effect.fnUntraced(function* (info, version, allowLegacy = false) {
99
101
  return undefined;
100
102
  if (version !== undefined && health.value.version !== version)
101
103
  return undefined;
102
- return { info, endpoint };
104
+ return { info, endpoint, version: health.value.version };
103
105
  }
104
106
  if (!allowLegacy ||
105
107
  Option.isNone(decodeLegacyHealth(body)) ||
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/client",
4
- "version": "0.0.0-next-15388",
4
+ "version": "0.0.0-next-15391",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -45,8 +45,8 @@
45
45
  "typecheck": "tsgo --noEmit"
46
46
  },
47
47
  "dependencies": {
48
- "@opencode-ai/schema": "0.0.0-next-15388",
49
- "@opencode-ai/protocol": "0.0.0-next-15388"
48
+ "@opencode-ai/schema": "0.0.0-next-15391",
49
+ "@opencode-ai/protocol": "0.0.0-next-15391"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "effect": "4.0.0-beta.83"
@@ -58,7 +58,7 @@
58
58
  },
59
59
  "devDependencies": {
60
60
  "@effect/platform-node": "4.0.0-beta.83",
61
- "@opencode-ai/httpapi-codegen": "0.0.0-next-15388",
61
+ "@opencode-ai/httpapi-codegen": "0.0.0-next-15391",
62
62
  "@tsconfig/bun": "1.0.9",
63
63
  "@types/bun": "1.3.13",
64
64
  "@typescript/native-preview": "7.0.0-dev.20251207.1",