@opencode/client 2.3.1 → 2.4.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 (69) hide show
  1. package/dist/chunks/{service-anregfhs.js → service-timing-15p82y03.js} +5 -5
  2. package/dist/chunks/{service-nmmc7qpz.js → service-timing-2bkgs6c9.js} +53 -22
  3. package/dist/chunks/{service-8ye1ye6f.js → service-timing-8ye1ye6f.js} +2 -2
  4. package/dist/chunks/{service-mqnb71k6.js → service-timing-99sx9v8v.js} +114 -4
  5. package/dist/chunks/{service-th5q8fjm.js → service-timing-bt02d992.js} +2 -2
  6. package/dist/chunks/{service-6hqrj29e.js → service-timing-d8dhy2yj.js} +3 -2
  7. package/dist/chunks/{service-n22dhmav.js → service-timing-dsejcdh4.js} +17 -17
  8. package/dist/chunks/{service-gecjxyvt.js → service-timing-gecjxyvt.js} +1 -1
  9. package/dist/chunks/{service-js54wxgp.js → service-timing-nwcpakzx.js} +2 -2
  10. package/dist/chunks/{service-xafd70ys.js → service-timing-p88pr19t.js} +1 -1
  11. package/dist/chunks/{service-ryy6kscr.js → service-timing-ryy6kscr.js} +1 -1
  12. package/dist/chunks/service-timing-v9zwsg2r.js +30 -0
  13. package/dist/chunks/{service-7f0py9js.js → service-timing-y2etg5bs.js} +2 -2
  14. package/dist/chunks/{service-3v8v7cjx.js → service-timing-zrgqmrbq.js} +20 -11
  15. package/dist/contract.js +1 -1
  16. package/dist/effect/api/api.d.ts +52 -1
  17. package/dist/effect/client.d.ts +81 -3
  18. package/dist/effect/client.js +12 -12
  19. package/dist/effect/generated/client-error.js +3 -3
  20. package/dist/effect/generated/client.d.ts +81 -3
  21. package/dist/effect/generated/client.js +5 -5
  22. package/dist/effect/generated/index.js +8 -8
  23. package/dist/effect/index.js +12 -12
  24. package/dist/effect/rpc.js +4 -4
  25. package/dist/effect/service.js +6 -6
  26. package/dist/promise/client.d.ts +7 -1
  27. package/dist/promise/client.js +11 -11
  28. package/dist/promise/generated/client-error.js +3 -3
  29. package/dist/promise/generated/client.d.ts +7 -1
  30. package/dist/promise/generated/client.js +4 -4
  31. package/dist/promise/generated/index.js +13 -11
  32. package/dist/promise/generated/types.d.ts +149 -58
  33. package/dist/promise/generated/types.js +4 -2
  34. package/dist/promise/index.js +17 -15
  35. package/dist/promise/media.d.ts +7 -1
  36. package/dist/promise/media.js +1 -1
  37. package/dist/promise/rpc.js +2 -2
  38. package/dist/promise/service.js +6 -6
  39. package/dist/pty-handoff.js +4 -4
  40. package/dist/rpc-runtime.js +1 -1
  41. package/dist/service-contender.js +1 -1
  42. package/dist/service-probe.js +3 -3
  43. package/dist/service-timing.js +1 -1
  44. package/dist/service-version.js +1 -1
  45. package/dist/service.js +1 -1
  46. package/dist/shared-events.js +1 -1
  47. package/dist/solid/connection.js +1 -1
  48. package/dist/solid/data.d.ts +7 -1
  49. package/dist/solid/data.js +10 -10
  50. package/dist/solid/index.js +14 -14
  51. package/dist/solid/pty.js +1 -1
  52. package/dist/solid/retention.js +1 -1
  53. package/dist/solid/usage.js +1 -1
  54. package/package.json +4 -4
  55. package/dist/chunks/service-az3r2kmr.js +0 -30
  56. /package/dist/chunks/{service-3eaz3m83.js → service-timing-3eaz3m83.js} +0 -0
  57. /package/dist/chunks/{service-60xe5cbf.js → service-timing-60xe5cbf.js} +0 -0
  58. /package/dist/chunks/{service-6mptkzbc.js → service-timing-6mptkzbc.js} +0 -0
  59. /package/dist/chunks/{service-6mq2wh8y.js → service-timing-6mq2wh8y.js} +0 -0
  60. /package/dist/chunks/{service-6r38tsk5.js → service-timing-6r38tsk5.js} +0 -0
  61. /package/dist/chunks/{service-8s2anffy.js → service-timing-8s2anffy.js} +0 -0
  62. /package/dist/chunks/{service-9rqn6x4v.js → service-timing-9rqn6x4v.js} +0 -0
  63. /package/dist/chunks/{service-mwrzahmf.js → service-timing-mwrzahmf.js} +0 -0
  64. /package/dist/chunks/{service-qav6mfdz.js → service-timing-qav6mfdz.js} +0 -0
  65. /package/dist/chunks/{service-sxt88q69.js → service-timing-sxt88q69.js} +0 -0
  66. /package/dist/chunks/{service-ve4aws36.js → service-timing-ve4aws36.js} +0 -0
  67. /package/dist/chunks/{service-vyas3vgt.js → service-timing-vyas3vgt.js} +0 -0
  68. /package/dist/chunks/{service-xgnj2w4v.js → service-timing-xgnj2w4v.js} +0 -0
  69. /package/dist/chunks/{service-ydhz1zrh.js → service-timing-ydhz1zrh.js} +0 -0
@@ -3,20 +3,20 @@ import {
3
3
  readError2,
4
4
  event2,
5
5
  eventType2
6
- } from "./service-ryy6kscr.js";
6
+ } from "./service-timing-ryy6kscr.js";
7
7
  import {
8
8
  __export
9
- } from "./service-9rqn6x4v.js";
9
+ } from "./service-timing-9rqn6x4v.js";
10
10
 
11
11
  // src/effect/rpc.ts
12
12
  var exports_rpc = {};
13
13
  __export(exports_rpc, {
14
14
  RpcClientRuntime: () => exports_rpc,
15
15
  aborted: () => aborted2,
16
- make: () => make5
16
+ make: () => make3
17
17
  });
18
18
  import { Effect, Stream } from "effect";
19
- function make5(call, subscribe) {
19
+ function make3(call, subscribe) {
20
20
  return (definition) => {
21
21
  const methods = Object.fromEntries(Object.entries(definition.methods).map(([name, method]) => [
22
22
  name,
@@ -59,4 +59,4 @@ function aborted2(signal) {
59
59
  });
60
60
  }
61
61
 
62
- export { make5, aborted2, exports_rpc };
62
+ export { make3, aborted2, exports_rpc };
@@ -1,17 +1,17 @@
1
1
  import {
2
- ClientError2
3
- } from "./service-js54wxgp.js";
2
+ ClientError3
3
+ } from "./service-timing-nwcpakzx.js";
4
4
  import {
5
5
  __export
6
- } from "./service-9rqn6x4v.js";
6
+ } from "./service-timing-9rqn6x4v.js";
7
7
 
8
8
  // src/promise/generated/client.ts
9
- var exports_client2 = {};
10
- __export(exports_client2, {
11
- make: () => make3
9
+ var exports_client4 = {};
10
+ __export(exports_client4, {
11
+ make: () => make6
12
12
  });
13
13
  var maxSseEventBytes = 16 * 1024 * 1024;
14
- function make3(options) {
14
+ function make6(options) {
15
15
  const fetch = options.fetch ?? globalThis.fetch;
16
16
  const prepare = (descriptor, requestOptions) => {
17
17
  const baseUrl = new URL(options.baseUrl);
@@ -44,7 +44,7 @@ function make3(options) {
44
44
  const prepared = prepare(descriptor, requestOptions);
45
45
  return await fetch(prepared.url, prepared.init);
46
46
  } catch (cause) {
47
- throw new ClientError2("Transport", { cause });
47
+ throw new ClientError3("Transport", { cause });
48
48
  }
49
49
  };
50
50
  const responseError = async (response, descriptor) => {
@@ -53,7 +53,7 @@ function make3(options) {
53
53
  try {
54
54
  await response.body?.cancel();
55
55
  } catch {}
56
- throw new ClientError2("UnexpectedStatus", { cause: { status: response.status }, detail: String(response.status) });
56
+ throw new ClientError3("UnexpectedStatus", { cause: { status: response.status }, detail: String(response.status) });
57
57
  };
58
58
  const request = async (descriptor, requestOptions) => {
59
59
  const response = await execute(descriptor, requestOptions);
@@ -78,10 +78,10 @@ function make3(options) {
78
78
  try {
79
79
  await response.body?.cancel();
80
80
  } catch {}
81
- throw new ClientError2("UnsupportedContentType", { detail: response.headers.get("content-type") });
81
+ throw new ClientError3("UnsupportedContentType", { detail: response.headers.get("content-type") });
82
82
  }
83
83
  if (response.body === null)
84
- throw new ClientError2("MalformedResponse");
84
+ throw new ClientError3("MalformedResponse");
85
85
  const reader = response.body.getReader();
86
86
  const decoder = new TextDecoder;
87
87
  let buffer = "";
@@ -91,13 +91,13 @@ function make3(options) {
91
91
  try {
92
92
  next = await reader.read();
93
93
  } catch (cause) {
94
- throw new ClientError2("Transport", { cause });
94
+ throw new ClientError3("Transport", { cause });
95
95
  }
96
96
  if (!next.done)
97
97
  requestOptions?.onActivity?.();
98
98
  buffer += decoder.decode(next.value, { stream: !next.done });
99
99
  if (buffer.length > maxSseEventBytes)
100
- throw new ClientError2("SseEventTooLarge");
100
+ throw new ClientError3("SseEventTooLarge");
101
101
  const trailingCarriageReturn = !next.done && buffer.endsWith("\r");
102
102
  if (trailingCarriageReturn)
103
103
  buffer = buffer.slice(0, -1);
@@ -124,7 +124,7 @@ function make3(options) {
124
124
  try {
125
125
  yield JSON.parse(data);
126
126
  } catch (cause) {
127
- throw new ClientError2("MalformedResponse", { cause });
127
+ throw new ClientError3("MalformedResponse", { cause });
128
128
  }
129
129
  }
130
130
  boundary = buffer.indexOf(`
@@ -664,14 +664,14 @@ function make3(options) {
664
664
  sound: input["sound"]
665
665
  },
666
666
  successStatus: 200,
667
- declaredStatuses: [400, 401, 403, 404, 422, 502, 503],
667
+ declaredStatuses: [400, 401, 404, 422, 502, 503],
668
668
  empty: false
669
669
  }, requestOptions).then((value) => value.data),
670
670
  get: (input, requestOptions) => request({
671
671
  method: "GET",
672
672
  path: `/api/experimental/generate/video/${encodeURIComponent(input.id)}`,
673
673
  successStatus: 200,
674
- declaredStatuses: [400, 401, 403, 404],
674
+ declaredStatuses: [400, 401, 404],
675
675
  empty: false
676
676
  }, requestOptions).then((value) => value.data)
677
677
  },
@@ -1031,7 +1031,38 @@ function make3(options) {
1031
1031
  successStatus: 200,
1032
1032
  declaredStatuses: [400, 401, 404],
1033
1033
  empty: false
1034
- }, requestOptions).then((value) => value.data)
1034
+ }, requestOptions).then((value) => value.data),
1035
+ cancel: (input, requestOptions) => request({
1036
+ method: "POST",
1037
+ path: `/api/experimental/job/${encodeURIComponent(input.id)}/cancel`,
1038
+ successStatus: 204,
1039
+ declaredStatuses: [400, 401],
1040
+ empty: true
1041
+ }, requestOptions)
1042
+ },
1043
+ machine: {
1044
+ list: (requestOptions) => request({
1045
+ method: "GET",
1046
+ path: `/api/experimental/machine`,
1047
+ successStatus: 200,
1048
+ declaredStatuses: [400, 401, 403],
1049
+ empty: false
1050
+ }, requestOptions).then((value) => value.data),
1051
+ add: (input, requestOptions) => request({
1052
+ method: "POST",
1053
+ path: `/api/experimental/machine`,
1054
+ body: { name: input["name"], reach: input["reach"], replace: input["replace"] },
1055
+ successStatus: 200,
1056
+ declaredStatuses: [400, 401, 403, 404, 409],
1057
+ empty: false
1058
+ }, requestOptions).then((value) => value.data),
1059
+ remove: (input, requestOptions) => request({
1060
+ method: "DELETE",
1061
+ path: `/api/experimental/machine/${encodeURIComponent(input.name)}`,
1062
+ successStatus: 204,
1063
+ declaredStatuses: [400, 401, 403, 404],
1064
+ empty: true
1065
+ }, requestOptions)
1035
1066
  },
1036
1067
  migration: {
1037
1068
  v1: {
@@ -1818,20 +1849,20 @@ async function json(response) {
1818
1849
  try {
1819
1850
  await response.body?.cancel();
1820
1851
  } catch {}
1821
- throw new ClientError2("UnsupportedContentType", { detail: response.headers.get("content-type") });
1852
+ throw new ClientError3("UnsupportedContentType", { detail: response.headers.get("content-type") });
1822
1853
  }
1823
1854
  let text;
1824
1855
  try {
1825
1856
  text = await response.text();
1826
1857
  } catch (cause) {
1827
- throw new ClientError2("Transport", { cause });
1858
+ throw new ClientError3("Transport", { cause });
1828
1859
  }
1829
1860
  if (text === "")
1830
- throw new ClientError2("MalformedResponse");
1861
+ throw new ClientError3("MalformedResponse");
1831
1862
  try {
1832
1863
  return JSON.parse(text);
1833
1864
  } catch (cause) {
1834
- throw new ClientError2("MalformedResponse", { cause });
1865
+ throw new ClientError3("MalformedResponse", { cause });
1835
1866
  }
1836
1867
  }
1837
1868
  function declared(body) {
@@ -1844,4 +1875,4 @@ function isContentType(response, expected) {
1844
1875
  return response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase() === expected;
1845
1876
  }
1846
1877
 
1847
- export { make3, exports_client2 };
1878
+ export { make6, exports_client4 };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  defaultEnsureTiming2
3
- } from "./service-xgnj2w4v.js";
3
+ } from "./service-timing-xgnj2w4v.js";
4
4
  import {
5
5
  matchesVersion2
6
- } from "./service-sxt88q69.js";
6
+ } from "./service-timing-sxt88q69.js";
7
7
 
8
8
  // src/service-probe.ts
9
9
  import { homedir } from "node:os";
@@ -4,7 +4,7 @@ import {
4
4
  isFormNotFoundError2,
5
5
  isFormAlreadySettledError2,
6
6
  isPermissionNotFoundError2
7
- } from "./service-6hqrj29e.js";
7
+ } from "./service-timing-d8dhy2yj.js";
8
8
 
9
9
  // src/solid/data.ts
10
10
  import { Worktree } from "@opencode/schema/worktree";
@@ -132,6 +132,7 @@ function createSync() {
132
132
  };
133
133
  }
134
134
  var CHILD_PAGE = 200;
135
+ var SEQUENCE_HANDOFF_MS = 250;
135
136
  var DELETED_SESSION_LIMIT = 512;
136
137
  function createData2(config) {
137
138
  const api = config.api;
@@ -196,7 +197,9 @@ function createData2(config) {
196
197
  info: {},
197
198
  permission: {}
198
199
  },
199
- location: {}
200
+ location: {},
201
+ job: {},
202
+ jobTree: {}
200
203
  });
201
204
  const [defaultLocation, setDefaultLocation] = createSignal({ directory: config.directory });
202
205
  const sessions = createMemo(() => Object.values(store.session.info).toSorted((a, b) => b.time.updated - a.time.updated));
@@ -205,6 +208,7 @@ function createData2(config) {
205
208
  const stored = (message) => omitFiles() ? omitMessageFileData(message) : message;
206
209
  const sync = createSync();
207
210
  let activeUpdates;
211
+ const jobUpdates = new Map;
208
212
  const pendingUpdates = new Map;
209
213
  function setSessionActive(sessionID, status) {
210
214
  activeUpdates?.set(sessionID, status);
@@ -276,11 +280,11 @@ function createData2(config) {
276
280
  };
277
281
  promise.then(settle, settle);
278
282
  }
279
- function sendAdmission(sessionID, send, gate) {
283
+ function sendAdmission(sessionID, send, gate, link) {
280
284
  const created = creating.get(sessionID);
281
285
  const previous = sending.get(sessionID);
282
286
  const request = Promise.resolve().then(() => Promise.all([gate, created, previous])).then(send);
283
- track(sending, sessionID, request.catch(() => {
287
+ track(sending, sessionID, (link?.(request) ?? request).catch(() => {
284
288
  return;
285
289
  }));
286
290
  return request;
@@ -486,6 +490,7 @@ function createData2(config) {
486
490
  }
487
491
  function removeSession(sessionID) {
488
492
  activeUpdates?.set(sessionID, undefined);
493
+ removeJobTree(sessionID);
489
494
  store.session.pending[sessionID]?.forEach((item) => outbox.delete(item.id));
490
495
  messageIndex.delete(sessionID);
491
496
  sync.invalidate(`session:${sessionID}`);
@@ -542,6 +547,32 @@ function createData2(config) {
542
547
  }));
543
548
  refresh(() => result.location.vcs.sync());
544
549
  refresh(() => result.project.sync());
550
+ Object.keys(store.jobTree).forEach((sessionID) => {
551
+ result.job.invalidate(sessionID);
552
+ refresh(() => result.job.sync(sessionID));
553
+ });
554
+ return;
555
+ }
556
+ case "experimental.job.updated": {
557
+ const info = event.data.info;
558
+ const running = info.status === "running";
559
+ jobUpdates.forEach((updates) => updates.set(info.id, running ? info : undefined));
560
+ if (!running) {
561
+ if (!store.job[info.id])
562
+ return;
563
+ setStore(produce((draft) => {
564
+ delete draft.job[info.id];
565
+ Object.values(draft.jobTree).forEach((members) => delete members[info.id]);
566
+ }));
567
+ return;
568
+ }
569
+ setStore(produce((draft) => {
570
+ draft.job[info.id] = info;
571
+ Object.entries(draft.jobTree).forEach(([rootID, members]) => {
572
+ if (jobWithin(info, rootID))
573
+ members[info.id] = true;
574
+ });
575
+ }));
545
576
  return;
546
577
  }
547
578
  case "project.updated":
@@ -1266,6 +1297,31 @@ function createData2(config) {
1266
1297
  data: Object.fromEntries(response.data.map((info) => [info.id, { ...info, location: ref }]))
1267
1298
  };
1268
1299
  });
1300
+ function withinTree(sessionID, ancestorID) {
1301
+ const seen = new Set;
1302
+ let current = sessionID;
1303
+ while (current && !seen.has(current)) {
1304
+ if (current === ancestorID)
1305
+ return true;
1306
+ seen.add(current);
1307
+ current = store.session.info[current]?.parentID;
1308
+ }
1309
+ return false;
1310
+ }
1311
+ function jobWithin(job, ancestorID) {
1312
+ return withinTree(job.sessionID, ancestorID) || job.kind === "subagent" && withinTree(job.childSessionID, ancestorID);
1313
+ }
1314
+ function removeJobTree(rootID) {
1315
+ jobUpdates.delete(rootID);
1316
+ sync.invalidate(`job:${rootID}`);
1317
+ const members = store.jobTree[rootID];
1318
+ if (!members)
1319
+ return;
1320
+ setStore(produce((draft) => {
1321
+ Object.keys(members).forEach((id) => delete draft.job[id]);
1322
+ delete draft.jobTree[rootID];
1323
+ }));
1324
+ }
1269
1325
  const result = {
1270
1326
  on: config.event.on,
1271
1327
  listen: config.event.listen,
@@ -1466,6 +1522,18 @@ function createData2(config) {
1466
1522
  compacting.set(input.sessionID, { id, observed, request });
1467
1523
  return request;
1468
1524
  },
1525
+ sequence(sessionID, send, prepare) {
1526
+ const left = Promise.withResolvers();
1527
+ return sendAdmission(sessionID, async () => {
1528
+ await prepare?.();
1529
+ const request = send();
1530
+ left.resolve();
1531
+ return request;
1532
+ }, undefined, (request) => Promise.race([
1533
+ request,
1534
+ left.promise.then(() => new Promise((resolve) => setTimeout(resolve, SEQUENCE_HANDOFF_MS)))
1535
+ ]));
1536
+ },
1469
1537
  prompt(input) {
1470
1538
  const { gate, prepare, ...request } = input;
1471
1539
  const id = request.id ?? SessionMessage.ID.create();
@@ -1750,6 +1818,48 @@ function createData2(config) {
1750
1818
  sync: shells.sync,
1751
1819
  invalidate: shells.invalidate
1752
1820
  },
1821
+ job: {
1822
+ list(sessionID) {
1823
+ const members = store.jobTree[sessionID];
1824
+ return Object.values(store.job).filter((job) => members?.[job.id] || jobWithin(job, sessionID));
1825
+ },
1826
+ sync(sessionID) {
1827
+ return sync.run(`job:${sessionID}`, async () => {
1828
+ const updates = new Map;
1829
+ jobUpdates.set(sessionID, updates);
1830
+ const list = await api().experimental.job.list({ sessionID, descendants: true, status: "running" }).catch((error) => {
1831
+ if (jobUpdates.get(sessionID) === updates)
1832
+ jobUpdates.delete(sessionID);
1833
+ return evictMissing(error);
1834
+ });
1835
+ if (jobUpdates.get(sessionID) !== updates)
1836
+ return;
1837
+ jobUpdates.delete(sessionID);
1838
+ const listed = new Map(list.map((job) => [job.id, job]));
1839
+ const next = new Map(listed);
1840
+ updates.forEach((info, id) => {
1841
+ if (!info)
1842
+ return next.delete(id);
1843
+ if (listed.has(id) || jobWithin(info, sessionID))
1844
+ next.set(id, info);
1845
+ });
1846
+ const previous = store.jobTree[sessionID] ?? {};
1847
+ setStore(produce((draft) => {
1848
+ Object.values(draft.job).forEach((job) => {
1849
+ if (next.has(job.id))
1850
+ return;
1851
+ if (previous[job.id] || jobWithin(job, sessionID))
1852
+ delete draft.job[job.id];
1853
+ });
1854
+ next.forEach((job, id) => draft.job[id] = job);
1855
+ draft.jobTree[sessionID] = Object.fromEntries([...next.keys()].map((id) => [id, true]));
1856
+ }));
1857
+ });
1858
+ },
1859
+ invalidate(sessionID) {
1860
+ sync.invalidate(`job:${sessionID}`);
1861
+ }
1862
+ },
1753
1863
  location: {
1754
1864
  info(ref) {
1755
1865
  return store.location[locationKey2(ref ?? defaultLocation())]?.info;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  headers2
3
- } from "./service-8ye1ye6f.js";
3
+ } from "./service-timing-8ye1ye6f.js";
4
4
  import {
5
5
  __export
6
- } from "./service-9rqn6x4v.js";
6
+ } from "./service-timing-9rqn6x4v.js";
7
7
 
8
8
  // src/pty-handoff.ts
9
9
  var exports_pty_handoff = {};
@@ -22,12 +22,12 @@ var isProviderNotFoundError2 = (value) => typeof value === "object" && value !==
22
22
  var isModelNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ModelNotFoundError";
23
23
  var isUnsupportedModelError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "UnsupportedModelError";
24
24
  var isProviderRequestError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ProviderRequestError";
25
- var isForbiddenError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ForbiddenError";
26
25
  var isVideoNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "VideoNotFoundError";
27
26
  var isIntegrationNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "IntegrationNotFoundError";
28
27
  var isIntegrationAttemptNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "IntegrationAttemptNotFoundError";
29
28
  var isIntegrationMethodNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "IntegrationMethodNotFoundError";
30
29
  var isMcpServerNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "McpServerNotFoundError";
30
+ var isForbiddenError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ForbiddenError";
31
31
  var isProjectNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ProjectNotFoundError";
32
32
  var isPermissionSavedNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "PermissionSavedNotFoundError";
33
33
  var isPermissionNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "PermissionNotFoundError";
@@ -39,8 +39,9 @@ var isPtyFeatureUnsupportedError2 = (value) => typeof value === "object" && valu
39
39
  var isBlobNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "BlobNotFoundError";
40
40
  var isAutomationNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "AutomationNotFoundError";
41
41
  var isArtifactNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ArtifactNotFoundError";
42
+ var isMachineNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "MachineNotFoundError";
42
43
  var isShellNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ShellNotFoundError";
43
44
  var isWorktreeError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "WorktreeError";
44
45
  var isVcsInitNotSupportedError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "VcsInitNotSupportedError";
45
46
 
46
- export { isInvalidRequestError2, isUnauthorizedError2, isLocationNotFoundError2, isServiceUnavailableError2, isAgentNotFoundError2, isPluginNotFoundError2, isInvalidCursorError2, isSessionNotFoundError2, isMessageNotFoundError2, isConflictError2, isCommandNotFoundError2, isCommandExecutionError2, isSessionBusyError2, isUnknownError2, isFormNotFoundError2, isFormInvalidAnswerError2, isFormAlreadySettledError2, isSkillNotFoundError2, isInstructionEntryValueTooLargeError2, isProviderNotFoundError2, isModelNotFoundError2, isUnsupportedModelError2, isProviderRequestError2, isForbiddenError2, isVideoNotFoundError2, isIntegrationNotFoundError2, isIntegrationAttemptNotFoundError2, isIntegrationMethodNotFoundError2, isMcpServerNotFoundError2, isProjectNotFoundError2, isPermissionSavedNotFoundError2, isPermissionNotFoundError2, isFileNotFoundError2, isRpcError2, isRpcInternalError2, isPtyNotFoundError2, isPtyFeatureUnsupportedError2, isBlobNotFoundError2, isAutomationNotFoundError2, isArtifactNotFoundError2, isShellNotFoundError2, isWorktreeError2, isVcsInitNotSupportedError2 };
47
+ export { isInvalidRequestError2, isUnauthorizedError2, isLocationNotFoundError2, isServiceUnavailableError2, isAgentNotFoundError2, isPluginNotFoundError2, isInvalidCursorError2, isSessionNotFoundError2, isMessageNotFoundError2, isConflictError2, isCommandNotFoundError2, isCommandExecutionError2, isSessionBusyError2, isUnknownError2, isFormNotFoundError2, isFormInvalidAnswerError2, isFormAlreadySettledError2, isSkillNotFoundError2, isInstructionEntryValueTooLargeError2, isProviderNotFoundError2, isModelNotFoundError2, isUnsupportedModelError2, isProviderRequestError2, isVideoNotFoundError2, isIntegrationNotFoundError2, isIntegrationAttemptNotFoundError2, isIntegrationMethodNotFoundError2, isMcpServerNotFoundError2, isForbiddenError2, isProjectNotFoundError2, isPermissionSavedNotFoundError2, isPermissionNotFoundError2, isFileNotFoundError2, isRpcError2, isRpcInternalError2, isPtyNotFoundError2, isPtyFeatureUnsupportedError2, isBlobNotFoundError2, isAutomationNotFoundError2, isArtifactNotFoundError2, isMachineNotFoundError2, isShellNotFoundError2, isWorktreeError2, isVcsInitNotSupportedError2 };
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  make7
3
- } from "./service-gecjxyvt.js";
3
+ } from "./service-timing-gecjxyvt.js";
4
4
  import {
5
- ClientError3
6
- } from "./service-7f0py9js.js";
5
+ ClientError2
6
+ } from "./service-timing-y2etg5bs.js";
7
7
  import {
8
- make6
9
- } from "./service-3v8v7cjx.js";
8
+ make4
9
+ } from "./service-timing-zrgqmrbq.js";
10
10
  import {
11
- make5,
11
+ make3,
12
12
  aborted2
13
- } from "./service-anregfhs.js";
13
+ } from "./service-timing-15p82y03.js";
14
14
  import {
15
15
  __export
16
- } from "./service-9rqn6x4v.js";
16
+ } from "./service-timing-9rqn6x4v.js";
17
17
 
18
18
  // src/effect/client.ts
19
- var exports_client3 = {};
20
- __export(exports_client3, {
21
- OpenCode: () => exports_client3,
22
- make: () => make4
19
+ var exports_client = {};
20
+ __export(exports_client, {
21
+ OpenCode: () => exports_client,
22
+ make: () => make2
23
23
  });
24
24
  import { Cause, Context, Effect, Stream } from "effect";
25
25
  import { HttpClient, HttpClientRequest } from "effect/http";
@@ -28,9 +28,9 @@ var CurrentHeaders = Context.Reference("@opencode/client/effect/rpc/headers", {
28
28
  return;
29
29
  }
30
30
  });
31
- var make4 = Effect.fn("OpenCode.make")(function* (options) {
31
+ var make2 = Effect.fn("OpenCode.make")(function* (options) {
32
32
  const httpClient = yield* HttpClient.HttpClient;
33
- const raw = yield* make6(options).pipe(Effect.provideService(HttpClient.HttpClient, HttpClient.mapRequestEffect(httpClient, (request) => Effect.map(CurrentHeaders, (headers) => headers ? HttpClientRequest.setHeaders(request, new Headers(headers)) : request))));
33
+ const raw = yield* make4(options).pipe(Effect.provideService(HttpClient.HttpClient, HttpClient.mapRequestEffect(httpClient, (request) => Effect.map(CurrentHeaders, (headers) => headers ? HttpClientRequest.setHeaders(request, new Headers(headers)) : request))));
34
34
  const context = yield* Effect.context();
35
35
  const native = raw.event.subscribe();
36
36
 
@@ -41,12 +41,12 @@ var make4 = Effect.fn("OpenCode.make")(function* (options) {
41
41
  }
42
42
  }
43
43
  const shared = make7((signal) => Stream.toAsyncIterableWith(native.pipe(Stream.interruptWhen(aborted2(signal)), Stream.catchCause((cause) => Stream.fail(new EventFailure(cause)))), context));
44
- const subscribe = (input) => Stream.fromAsyncIterable(shared.subscribe({ types: input?.types }), (error) => error).pipe(Stream.catch((error) => Stream.failCause(error instanceof EventFailure ? error.cause : Cause.fail(new ClientError3({ cause: error })))));
44
+ const subscribe = (input) => Stream.fromAsyncIterable(shared.subscribe({ types: input?.types }), (error) => error).pipe(Stream.catch((error) => Stream.failCause(error instanceof EventFailure ? error.cause : Cause.fail(new ClientError2({ cause: error })))));
45
45
  return {
46
46
  ...raw,
47
47
  event: { ...raw.event, subscribe },
48
- rpc: Object.assign(make5((input, options) => raw.rpc.call(input).pipe(Effect.provideService(CurrentHeaders, options?.headers)), subscribe), raw.rpc)
48
+ rpc: Object.assign(make3((input, options) => raw.rpc.call(input).pipe(Effect.provideService(CurrentHeaders, options?.headers)), subscribe), raw.rpc)
49
49
  };
50
50
  });
51
51
 
52
- export { make4, exports_client3 };
52
+ export { make2, exports_client };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./service-9rqn6x4v.js";
3
+ } from "./service-timing-9rqn6x4v.js";
4
4
 
5
5
  // src/shared-events.ts
6
6
  var exports_shared_events = {};
@@ -1,5 +1,5 @@
1
1
  // src/promise/generated/client-error.ts
2
- class ClientError2 extends Error {
2
+ class ClientError3 extends Error {
3
3
  reason;
4
4
  name = "ClientError";
5
5
  constructor(reason, options) {
@@ -9,4 +9,4 @@ class ClientError2 extends Error {
9
9
  }
10
10
  }
11
11
 
12
- export { ClientError2 };
12
+ export { ClientError3 };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  isRpcError2,
3
3
  isRpcInternalError2
4
- } from "./service-6hqrj29e.js";
4
+ } from "./service-timing-d8dhy2yj.js";
5
5
 
6
6
  // src/promise/rpc.ts
7
7
  function makeRpc2(raw, events) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./service-9rqn6x4v.js";
3
+ } from "./service-timing-9rqn6x4v.js";
4
4
 
5
5
  // src/rpc-runtime.ts
6
6
  var exports_rpc_runtime = {};
@@ -0,0 +1,30 @@
1
+ import {
2
+ make7
3
+ } from "./service-timing-gecjxyvt.js";
4
+ import {
5
+ make6
6
+ } from "./service-timing-2bkgs6c9.js";
7
+ import {
8
+ makeRpc2
9
+ } from "./service-timing-p88pr19t.js";
10
+ import {
11
+ __export
12
+ } from "./service-timing-9rqn6x4v.js";
13
+
14
+ // src/promise/client.ts
15
+ var exports_client3 = {};
16
+ __export(exports_client3, {
17
+ OpenCode: () => exports_client3,
18
+ make: () => make5
19
+ });
20
+ function make5(options) {
21
+ const raw = make6(options);
22
+ const events = make7((signal, onActivity) => raw.event.subscribe(undefined, { signal, onActivity }));
23
+ return {
24
+ ...raw,
25
+ rpc: Object.assign(makeRpc2(raw, events), raw.rpc),
26
+ event: events
27
+ };
28
+ }
29
+
30
+ export { make5, exports_client3 };
@@ -1,9 +1,9 @@
1
1
  // src/effect/generated/client-error.ts
2
2
  import { Schema } from "effect";
3
3
 
4
- class ClientError3 extends Schema.TaggedError()("ClientError", {
4
+ class ClientError2 extends Schema.TaggedError()("ClientError", {
5
5
  cause: Schema.Defect()
6
6
  }) {
7
7
  }
8
8
 
9
- export { ClientError3 };
9
+ export { ClientError2 };
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  ClientApi2
3
- } from "./service-60xe5cbf.js";
3
+ } from "./service-timing-60xe5cbf.js";
4
4
  import {
5
- ClientError3
6
- } from "./service-7f0py9js.js";
5
+ ClientError2
6
+ } from "./service-timing-y2etg5bs.js";
7
7
  import {
8
8
  __export
9
- } from "./service-9rqn6x4v.js";
9
+ } from "./service-timing-9rqn6x4v.js";
10
10
 
11
11
  // src/effect/generated/client.ts
12
- var exports_client4 = {};
13
- __export(exports_client4, {
14
- make: () => make6
12
+ var exports_client2 = {};
13
+ __export(exports_client2, {
14
+ make: () => make4
15
15
  });
16
16
  import { Effect, Stream, Schema } from "effect";
17
17
  import { Sse } from "effect/encoding";
18
18
  import { HttpClientError } from "effect/http";
19
19
  import { HttpApiClient } from "effect/http-api";
20
- var mapClientError = (error) => HttpClientError.isHttpClientError(error) || Schema.isSchemaError(error) || Sse.Retry.is(error) ? new ClientError3({ cause: error }) : error;
20
+ var mapClientError = (error) => HttpClientError.isHttpClientError(error) || Schema.isSchemaError(error) || Sse.Retry.is(error) ? new ClientError2({ cause: error }) : error;
21
21
  var preserveEffect = () => (effect) => effect;
22
22
  var preserveStream = () => (stream) => stream;
23
23
  var EndpointServerInfo = (raw) => () => preserveEffect()(raw["server.info"]({}).pipe(Effect.mapError(mapClientError)));
@@ -613,6 +613,10 @@ var EndpointExperimentalJobList = (raw) => (input) => preserveEffect()(raw["job.
613
613
  descendants: input?.["descendants"]
614
614
  }
615
615
  }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
616
+ var EndpointExperimentalJobCancel = (raw) => (input) => preserveEffect()(raw["job.cancel"]({ params: { id: input["id"] } }).pipe(Effect.mapError(mapClientError)));
617
+ var EndpointExperimentalMachineList = (raw) => () => preserveEffect()(raw["machine.list"]({}).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
618
+ var EndpointExperimentalMachineAdd = (raw) => (input) => preserveEffect()(raw["machine.add"]({ payload: { name: input["name"], reach: input["reach"], replace: input["replace"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
619
+ var EndpointExperimentalMachineRemove = (raw) => (input) => preserveEffect()(raw["machine.remove"]({ params: { name: input["name"] } }).pipe(Effect.mapError(mapClientError)));
616
620
  var adaptGroupExperimental = (raw) => ({
617
621
  persistentPty: {
618
622
  read: EndpointExperimentalPersistentPtyRead(raw),
@@ -642,7 +646,12 @@ var adaptGroupExperimental = (raw) => ({
642
646
  update: EndpointExperimentalArtifactsUpdate(raw),
643
647
  delete: EndpointExperimentalArtifactsDelete(raw)
644
648
  },
645
- job: { list: EndpointExperimentalJobList(raw) }
649
+ job: { list: EndpointExperimentalJobList(raw), cancel: EndpointExperimentalJobCancel(raw) },
650
+ machine: {
651
+ list: EndpointExperimentalMachineList(raw),
652
+ add: EndpointExperimentalMachineAdd(raw),
653
+ remove: EndpointExperimentalMachineRemove(raw)
654
+ }
646
655
  });
647
656
  var EndpointShellList = (raw) => (input) => preserveEffect()(raw["shell.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
648
657
  var EndpointShellCreate = (raw) => (input) => preserveEffect()(raw["shell.create"]({
@@ -846,6 +855,6 @@ var adaptClient = (raw) => {
846
855
  }
847
856
  };
848
857
  };
849
- var make6 = (options) => HttpApiClient.make(ClientApi2, options).pipe(Effect.map(adaptClient));
858
+ var make4 = (options) => HttpApiClient.make(ClientApi2, options).pipe(Effect.map(adaptClient));
850
859
 
851
- export { make6, exports_client4 };
860
+ export { make4, exports_client2 };