@opencode/sdk 0.0.0-dev-20659 → 0.0.0-dev-20665

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.
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  create3
3
- } from "./workerd-7hdbcq50.js";
3
+ } from "./contracts-c6nbbwj9.js";
4
4
  import {
5
5
  __export
6
- } from "./workerd-9rqn6x4v.js";
6
+ } from "./contracts-9rqn6x4v.js";
7
7
 
8
8
  // src/opencode.ts
9
9
  var exports_opencode = {};
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./workerd-9rqn6x4v.js";
3
+ } from "./contracts-9rqn6x4v.js";
4
4
 
5
5
  // src/internal/workerd.ts
6
6
  var exports_workerd = {};
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  create5
3
- } from "./workerd-2djeejkr.js";
3
+ } from "./contracts-zwh50n7b.js";
4
4
  import {
5
5
  __export
6
- } from "./workerd-9rqn6x4v.js";
6
+ } from "./contracts-9rqn6x4v.js";
7
7
 
8
8
  // src/effect/opencode.ts
9
9
  var exports_opencode2 = {};
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  create5
3
- } from "./workerd-2djeejkr.js";
3
+ } from "./contracts-zwh50n7b.js";
4
4
  import {
5
5
  __export
6
- } from "./workerd-9rqn6x4v.js";
6
+ } from "./contracts-9rqn6x4v.js";
7
7
 
8
8
  // src/promise.ts
9
9
  var exports_promise = {};
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./workerd-9rqn6x4v.js";
3
+ } from "./contracts-9rqn6x4v.js";
4
4
 
5
5
  // src/tool.ts
6
6
  var exports_tool2 = {};
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./workerd-9rqn6x4v.js";
3
+ } from "./contracts-9rqn6x4v.js";
4
4
 
5
5
  // src/effect/tool.ts
6
6
  var exports_tool = {};
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./workerd-9rqn6x4v.js";
3
+ } from "./contracts-9rqn6x4v.js";
4
4
 
5
5
  // src/internal/instances.ts
6
6
  var exports_instances = {};
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./workerd-9rqn6x4v.js";
3
+ } from "./contracts-9rqn6x4v.js";
4
4
 
5
5
  // src/internal/fetch.ts
6
6
  var exports_fetch = {};
@@ -9,8 +9,7 @@ __export(exports_fetch, {
9
9
  make: () => make3
10
10
  });
11
11
  function make3(handler, dispose) {
12
- const requests = new Set;
13
- const shutdown = new AbortController;
12
+ const requests = new Map;
14
13
  const closed = new Error("OpenCode host is closed");
15
14
  let closePromise;
16
15
  const fetch = Object.assign((input, init) => {
@@ -19,13 +18,17 @@ function make3(handler, dispose) {
19
18
  const source = new Request(input, init);
20
19
  if (source.signal.aborted)
21
20
  return Promise.reject(source.signal.reason);
22
- const request = new Request(source, { signal: AbortSignal.any([source.signal, shutdown.signal]) });
21
+ const controller = new AbortController;
22
+ const abort = () => controller.abort(source.signal.reason);
23
+ source.signal.addEventListener("abort", abort, { once: true });
24
+ const request = new Request(source, { signal: controller.signal });
23
25
  const lifetime = Promise.withResolvers();
24
26
  const finish = () => {
25
- requests.delete(lifetime.promise);
27
+ source.signal.removeEventListener("abort", abort);
28
+ requests.delete(controller);
26
29
  lifetime.resolve();
27
30
  };
28
- requests.add(lifetime.promise);
31
+ requests.set(controller, lifetime.promise);
29
32
  const handled = handler(request);
30
33
  return rejectOnAbort(handled, request.signal).then((response) => trackResponse(response, request.signal, finish), (cause) => {
31
34
  handled.then(finish, finish);
@@ -38,8 +41,8 @@ function make3(handler, dispose) {
38
41
  if (closePromise)
39
42
  return closePromise;
40
43
  closePromise = Promise.resolve().then(async () => {
41
- shutdown.abort(closed);
42
- await Promise.allSettled(requests);
44
+ requests.forEach((_, controller) => controller.abort(closed));
45
+ await Promise.allSettled(requests.values());
43
46
  await dispose();
44
47
  });
45
48
  return closePromise;
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  layer4,
3
3
  context2
4
- } from "./workerd-ya9awdj2.js";
4
+ } from "./contracts-ya9awdj2.js";
5
5
  import {
6
6
  make3
7
- } from "./workerd-wyq33nd6.js";
7
+ } from "./contracts-yqn72msb.js";
8
8
  import {
9
9
  provide2,
10
10
  node2
11
- } from "./workerd-pqb0kjhx.js";
11
+ } from "./contracts-pqb0kjhx.js";
12
12
  import {
13
13
  __export
14
- } from "./workerd-9rqn6x4v.js";
14
+ } from "./contracts-9rqn6x4v.js";
15
15
 
16
16
  // src/internal/host.ts
17
17
  var exports_host = {};
package/dist/contracts.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  SessionMessage2,
27
27
  Skill2,
28
28
  Workspace2
29
- } from "./chunks/workerd-j1jhtwv7.js";
29
+ } from "./chunks/contracts-j1jhtwv7.js";
30
30
  export {
31
31
  AbsolutePath2 as AbsolutePath,
32
32
  Agent2 as Agent,
@@ -1,13 +1,13 @@
1
- import"../chunks/workerd-ya9awdj2.js";
2
- import"../chunks/workerd-wyq33nd6.js";
3
- import"../chunks/workerd-pqb0kjhx.js";
4
- import"../chunks/workerd-2djeejkr.js";
1
+ import"../chunks/contracts-ya9awdj2.js";
2
+ import"../chunks/contracts-yqn72msb.js";
3
+ import"../chunks/contracts-pqb0kjhx.js";
4
+ import"../chunks/contracts-zwh50n7b.js";
5
5
  import {
6
6
  exports_opencode2
7
- } from "../chunks/workerd-kz7a056s.js";
7
+ } from "../chunks/contracts-7cwevkyj.js";
8
8
  import {
9
9
  exports_tool
10
- } from "../chunks/workerd-n1hprnh9.js";
10
+ } from "../chunks/contracts-n1hprnh9.js";
11
11
  import {
12
12
  Agent2,
13
13
  Command2,
@@ -36,7 +36,7 @@ import {
36
36
  SessionMessage2,
37
37
  Skill2,
38
38
  Workspace2
39
- } from "../chunks/workerd-j1jhtwv7.js";
39
+ } from "../chunks/contracts-j1jhtwv7.js";
40
40
 
41
41
  // src/effect/index.ts
42
42
  import { ClientError } from "@opencode/client/effect";
@@ -3,11 +3,11 @@ import {
3
3
  Service2,
4
4
  layer2,
5
5
  exports_opencode2
6
- } from "../chunks/workerd-kz7a056s.js";
7
- import"../chunks/workerd-2djeejkr.js";
8
- import"../chunks/workerd-wyq33nd6.js";
9
- import"../chunks/workerd-pqb0kjhx.js";
10
- import"../chunks/workerd-ya9awdj2.js";
6
+ } from "../chunks/contracts-7cwevkyj.js";
7
+ import"../chunks/contracts-zwh50n7b.js";
8
+ import"../chunks/contracts-yqn72msb.js";
9
+ import"../chunks/contracts-pqb0kjhx.js";
10
+ import"../chunks/contracts-ya9awdj2.js";
11
11
  export {
12
12
  exports_opencode2 as OpenCode,
13
13
  Service2 as Service,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RegistrationError2,
3
3
  Error2
4
- } from "../chunks/workerd-n1hprnh9.js";
4
+ } from "../chunks/contracts-n1hprnh9.js";
5
5
  export {
6
6
  Error2 as Error,
7
7
  RegistrationError2 as RegistrationError
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  make2
3
- } from "../chunks/workerd-39225h8g.js";
4
- import"../chunks/workerd-ya9awdj2.js";
5
- import"../chunks/workerd-wyq33nd6.js";
6
- import"../chunks/workerd-pqb0kjhx.js";
7
- import"../chunks/workerd-2djeejkr.js";
3
+ } from "../chunks/contracts-39225h8g.js";
4
+ import"../chunks/contracts-ya9awdj2.js";
5
+ import"../chunks/contracts-yqn72msb.js";
6
+ import"../chunks/contracts-pqb0kjhx.js";
7
+ import"../chunks/contracts-zwh50n7b.js";
8
8
  import {
9
9
  create4,
10
10
  Service2
11
- } from "../chunks/workerd-kz7a056s.js";
11
+ } from "../chunks/contracts-7cwevkyj.js";
12
12
  import {
13
13
  __export
14
- } from "../chunks/workerd-9rqn6x4v.js";
14
+ } from "../chunks/contracts-9rqn6x4v.js";
15
15
 
16
16
  // src/effect/workerd.ts
17
17
  var exports_workerd = {};
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import"./chunks/workerd-ya9awdj2.js";
2
- import"./chunks/workerd-wyq33nd6.js";
3
- import"./chunks/workerd-pqb0kjhx.js";
4
- import"./chunks/workerd-2djeejkr.js";
5
- import"./chunks/workerd-7hdbcq50.js";
1
+ import"./chunks/contracts-ya9awdj2.js";
2
+ import"./chunks/contracts-yqn72msb.js";
3
+ import"./chunks/contracts-pqb0kjhx.js";
4
+ import"./chunks/contracts-zwh50n7b.js";
5
+ import"./chunks/contracts-c6nbbwj9.js";
6
6
  import {
7
7
  exports_opencode
8
- } from "./chunks/workerd-5v2prbhp.js";
8
+ } from "./chunks/contracts-2fpqmf3a.js";
9
9
  import {
10
10
  exports_tool2
11
- } from "./chunks/workerd-hdqq71na.js";
11
+ } from "./chunks/contracts-hdqq71na.js";
12
12
  import {
13
13
  Agent2,
14
14
  Command2,
@@ -37,7 +37,7 @@ import {
37
37
  SessionMessage2,
38
38
  Skill2,
39
39
  Workspace2
40
- } from "./chunks/workerd-j1jhtwv7.js";
40
+ } from "./chunks/contracts-j1jhtwv7.js";
41
41
 
42
42
  // src/index.ts
43
43
  import { ClientError } from "@opencode/client";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  make3,
3
3
  exports_fetch
4
- } from "../chunks/workerd-wyq33nd6.js";
4
+ } from "../chunks/contracts-yqn72msb.js";
5
5
  export {
6
6
  exports_fetch as OwnedFetch,
7
7
  make3 as make
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  create5,
3
3
  exports_host
4
- } from "../chunks/workerd-2djeejkr.js";
5
- import"../chunks/workerd-wyq33nd6.js";
6
- import"../chunks/workerd-pqb0kjhx.js";
7
- import"../chunks/workerd-ya9awdj2.js";
4
+ } from "../chunks/contracts-zwh50n7b.js";
5
+ import"../chunks/contracts-yqn72msb.js";
6
+ import"../chunks/contracts-pqb0kjhx.js";
7
+ import"../chunks/contracts-ya9awdj2.js";
8
8
  export {
9
9
  exports_host as EmbeddedHost,
10
10
  create5 as create
@@ -3,7 +3,7 @@ import {
3
3
  node2,
4
4
  layer3,
5
5
  exports_instances
6
- } from "../chunks/workerd-pqb0kjhx.js";
6
+ } from "../chunks/contracts-pqb0kjhx.js";
7
7
  export {
8
8
  exports_instances as SdkInstances,
9
9
  layer3 as layer,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  make2,
3
3
  exports_workerd
4
- } from "../chunks/workerd-39225h8g.js";
4
+ } from "../chunks/contracts-39225h8g.js";
5
5
  export {
6
6
  exports_workerd as WorkerdProfile,
7
7
  make2 as make
package/dist/logging.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  layer4,
3
3
  context2
4
- } from "./chunks/workerd-ya9awdj2.js";
4
+ } from "./chunks/contracts-ya9awdj2.js";
5
5
  export {
6
6
  context2 as context,
7
7
  layer4 as layer
package/dist/opencode.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  create2
3
- } from "./chunks/workerd-5v2prbhp.js";
4
- import"./chunks/workerd-7hdbcq50.js";
5
- import"./chunks/workerd-2djeejkr.js";
6
- import"./chunks/workerd-wyq33nd6.js";
7
- import"./chunks/workerd-pqb0kjhx.js";
8
- import"./chunks/workerd-ya9awdj2.js";
3
+ } from "./chunks/contracts-2fpqmf3a.js";
4
+ import"./chunks/contracts-c6nbbwj9.js";
5
+ import"./chunks/contracts-zwh50n7b.js";
6
+ import"./chunks/contracts-yqn72msb.js";
7
+ import"./chunks/contracts-pqb0kjhx.js";
8
+ import"./chunks/contracts-ya9awdj2.js";
9
9
  export {
10
10
  create2 as create
11
11
  };
package/dist/promise.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  create3,
3
3
  exports_promise
4
- } from "./chunks/workerd-7hdbcq50.js";
5
- import"./chunks/workerd-2djeejkr.js";
6
- import"./chunks/workerd-wyq33nd6.js";
7
- import"./chunks/workerd-pqb0kjhx.js";
8
- import"./chunks/workerd-ya9awdj2.js";
4
+ } from "./chunks/contracts-c6nbbwj9.js";
5
+ import"./chunks/contracts-zwh50n7b.js";
6
+ import"./chunks/contracts-yqn72msb.js";
7
+ import"./chunks/contracts-pqb0kjhx.js";
8
+ import"./chunks/contracts-ya9awdj2.js";
9
9
  export {
10
10
  exports_promise as PromiseSdk,
11
11
  create3 as create
package/dist/tool.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RegistrationError3,
3
3
  Error3
4
- } from "./chunks/workerd-hdqq71na.js";
4
+ } from "./chunks/contracts-hdqq71na.js";
5
5
  export {
6
6
  Error3 as Error,
7
7
  RegistrationError3 as RegistrationError
package/dist/workerd.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  make2
3
- } from "./chunks/workerd-39225h8g.js";
4
- import"./chunks/workerd-ya9awdj2.js";
5
- import"./chunks/workerd-wyq33nd6.js";
6
- import"./chunks/workerd-pqb0kjhx.js";
7
- import"./chunks/workerd-2djeejkr.js";
3
+ } from "./chunks/contracts-39225h8g.js";
4
+ import"./chunks/contracts-ya9awdj2.js";
5
+ import"./chunks/contracts-yqn72msb.js";
6
+ import"./chunks/contracts-pqb0kjhx.js";
7
+ import"./chunks/contracts-zwh50n7b.js";
8
8
  import {
9
9
  create3
10
- } from "./chunks/workerd-7hdbcq50.js";
10
+ } from "./chunks/contracts-c6nbbwj9.js";
11
11
  import {
12
12
  __export
13
- } from "./chunks/workerd-9rqn6x4v.js";
13
+ } from "./chunks/contracts-9rqn6x4v.js";
14
14
 
15
15
  // src/workerd.ts
16
16
  var exports_workerd = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "0.0.0-dev-20659",
3
+ "version": "0.0.0-dev-20665",
4
4
  "name": "@opencode/sdk",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -40,18 +40,18 @@
40
40
  "verify:package": "bun run script/verify-package.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@opencode/client": "0.0.0-dev-20659",
44
- "@opencode/core": "0.0.0-dev-20659",
45
- "@opencode/plugin": "0.0.0-dev-20659",
46
- "@opencode/schema": "0.0.0-dev-20659",
47
- "@opencode/server": "0.0.0-dev-20659",
48
- "@opencode/util": "0.0.0-dev-20659",
43
+ "@opencode/client": "0.0.0-dev-20665",
44
+ "@opencode/core": "0.0.0-dev-20665",
45
+ "@opencode/plugin": "0.0.0-dev-20665",
46
+ "@opencode/schema": "0.0.0-dev-20665",
47
+ "@opencode/server": "0.0.0-dev-20665",
48
+ "@opencode/util": "0.0.0-dev-20665",
49
49
  "effect": "4.0.0-rc.112"
50
50
  },
51
51
  "devDependencies": {
52
- "@opencode/ai": "0.0.0-dev-20659",
53
- "@opencode/httpapi-codegen": "0.0.0-dev-20659",
54
- "@opencode/protocol": "0.0.0-dev-20659",
52
+ "@opencode/ai": "0.0.0-dev-20665",
53
+ "@opencode/httpapi-codegen": "0.0.0-dev-20665",
54
+ "@opencode/protocol": "0.0.0-dev-20665",
55
55
  "@tsconfig/bun": "1.0.9",
56
56
  "@types/bun": "1.4.0",
57
57
  "@typescript/native-preview": "7.0.0-dev.20251207.1"