@opencode/client 2.3.0 → 2.3.1

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 (68) hide show
  1. package/dist/chunks/{contract-yk5evh6f.js → service-3v8v7cjx.js} +42 -28
  2. package/dist/chunks/{contract-sdjh9vmn.js → service-6hqrj29e.js} +5 -3
  3. package/dist/chunks/{contract-y2etg5bs.js → service-7f0py9js.js} +2 -2
  4. package/dist/chunks/{contract-8ye1ye6f.js → service-8ye1ye6f.js} +2 -2
  5. package/dist/chunks/{contract-15p82y03.js → service-anregfhs.js} +5 -5
  6. package/dist/chunks/service-az3r2kmr.js +30 -0
  7. package/dist/chunks/{contract-gecjxyvt.js → service-gecjxyvt.js} +1 -1
  8. package/dist/chunks/{contract-nwcpakzx.js → service-js54wxgp.js} +2 -2
  9. package/dist/chunks/{contract-tztyfz1b.js → service-mqnb71k6.js} +1 -1
  10. package/dist/chunks/{contract-2n8q20a3.js → service-n22dhmav.js} +17 -17
  11. package/dist/chunks/{contract-qdgaygb4.js → service-nmmc7qpz.js} +68 -32
  12. package/dist/chunks/{contract-ryy6kscr.js → service-ryy6kscr.js} +1 -1
  13. package/dist/chunks/{contract-ec62es4n.js → service-th5q8fjm.js} +2 -2
  14. package/dist/chunks/{contract-xqwq6bgr.js → service-xafd70ys.js} +1 -1
  15. package/dist/contract.js +1 -1
  16. package/dist/effect/api/api.d.ts +60 -38
  17. package/dist/effect/client.d.ts +11 -239
  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 +12 -240
  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 +14 -7
  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 +15 -8
  30. package/dist/promise/generated/client.js +4 -4
  31. package/dist/promise/generated/index.js +17 -13
  32. package/dist/promise/generated/types.d.ts +209 -135
  33. package/dist/promise/generated/types.js +8 -4
  34. package/dist/promise/index.js +22 -18
  35. package/dist/promise/media.d.ts +14 -7
  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.js +10 -10
  49. package/dist/solid/index.js +14 -14
  50. package/dist/solid/pty.js +1 -1
  51. package/dist/solid/retention.js +1 -1
  52. package/dist/solid/usage.js +1 -1
  53. package/package.json +4 -4
  54. package/dist/chunks/contract-b5ykzypt.js +0 -30
  55. /package/dist/chunks/{contract-3eaz3m83.js → service-3eaz3m83.js} +0 -0
  56. /package/dist/chunks/{contract-60xe5cbf.js → service-60xe5cbf.js} +0 -0
  57. /package/dist/chunks/{contract-6mptkzbc.js → service-6mptkzbc.js} +0 -0
  58. /package/dist/chunks/{contract-6mq2wh8y.js → service-6mq2wh8y.js} +0 -0
  59. /package/dist/chunks/{contract-6r38tsk5.js → service-6r38tsk5.js} +0 -0
  60. /package/dist/chunks/{contract-8s2anffy.js → service-8s2anffy.js} +0 -0
  61. /package/dist/chunks/{contract-9rqn6x4v.js → service-9rqn6x4v.js} +0 -0
  62. /package/dist/chunks/{contract-mwrzahmf.js → service-mwrzahmf.js} +0 -0
  63. /package/dist/chunks/{contract-qav6mfdz.js → service-qav6mfdz.js} +0 -0
  64. /package/dist/chunks/{contract-sxt88q69.js → service-sxt88q69.js} +0 -0
  65. /package/dist/chunks/{contract-ve4aws36.js → service-ve4aws36.js} +0 -0
  66. /package/dist/chunks/{contract-vyas3vgt.js → service-vyas3vgt.js} +0 -0
  67. /package/dist/chunks/{contract-xgnj2w4v.js → service-xgnj2w4v.js} +0 -0
  68. /package/dist/chunks/{contract-ydhz1zrh.js → service-ydhz1zrh.js} +0 -0
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  ClientApi2
3
- } from "./contract-60xe5cbf.js";
3
+ } from "./service-60xe5cbf.js";
4
4
  import {
5
- ClientError2
6
- } from "./contract-y2etg5bs.js";
5
+ ClientError3
6
+ } from "./service-7f0py9js.js";
7
7
  import {
8
8
  __export
9
- } from "./contract-9rqn6x4v.js";
9
+ } from "./service-9rqn6x4v.js";
10
10
 
11
11
  // src/effect/generated/client.ts
12
- var exports_client2 = {};
13
- __export(exports_client2, {
14
- make: () => make4
12
+ var exports_client4 = {};
13
+ __export(exports_client4, {
14
+ make: () => make6
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 ClientError2({ cause: error }) : error;
20
+ var mapClientError = (error) => HttpClientError.isHttpClientError(error) || Schema.isSchemaError(error) || Sse.Retry.is(error) ? new ClientError3({ 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)));
@@ -284,12 +284,27 @@ var EndpointExperimentalGenerateImage = (raw) => (input) => preserveEffect()(raw
284
284
  resolution: input["resolution"]
285
285
  }
286
286
  }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
287
+ var EndpointExperimentalGenerateVideoCreate = (raw) => (input) => preserveEffect()(raw["generate.video.create"]({
288
+ payload: {
289
+ model: input["model"],
290
+ prompt: input["prompt"],
291
+ start: input["start"],
292
+ end: input["end"],
293
+ references: input["references"],
294
+ duration: input["duration"],
295
+ aspect: input["aspect"],
296
+ resolution: input["resolution"],
297
+ sound: input["sound"]
298
+ }
299
+ }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
300
+ var EndpointExperimentalGenerateVideoGet = (raw) => (input) => preserveEffect()(raw["generate.video.get"]({ params: { id: input["id"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
287
301
  var EndpointExperimentalGenerateDecisions = (raw) => (input) => preserveEffect()(raw["generate.decisions"]({
288
302
  payload: { model: input["model"], input: input["input"], questions: input["questions"] }
289
303
  }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
290
304
  var adaptGroupExperimentalGenerate = (raw) => ({
291
305
  text: EndpointExperimentalGenerateText(raw),
292
306
  image: EndpointExperimentalGenerateImage(raw),
307
+ video: { create: EndpointExperimentalGenerateVideoCreate(raw), get: EndpointExperimentalGenerateVideoGet(raw) },
293
308
  decisions: EndpointExperimentalGenerateDecisions(raw)
294
309
  });
295
310
  var EndpointExperimentalVoiceModels = (raw) => () => preserveEffect()(raw["voice.models"]({}).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
@@ -548,22 +563,21 @@ var EndpointExperimentalPersistentPtyConnectToken = (raw) => (input) => preserve
548
563
  params: { ptyID: input["ptyID"] },
549
564
  headers: { "x-opencode-ticket": input["x-opencode-ticket"] }
550
565
  }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
551
- var EndpointExperimentalScheduleCreate = (raw) => (input) => preserveEffect()(raw["schedule.create"]({
566
+ var EndpointExperimentalAutomationCreate = (raw) => (input) => preserveEffect()(raw["automation.create"]({
552
567
  payload: {
553
568
  sessionID: input["sessionID"],
569
+ directory: input["directory"],
554
570
  name: input["name"],
555
- when: input["when"],
556
- if: input["if"],
557
- until: input["until"],
558
- ends: input["ends"],
559
- prompt: input["prompt"]
571
+ trigger: input["trigger"],
572
+ action: input["action"],
573
+ expires: input["expires"]
560
574
  }
561
575
  }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
562
- var EndpointExperimentalScheduleList = (raw) => (input) => preserveEffect()(raw["schedule.list"]({ query: { sessionID: input["sessionID"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
563
- var EndpointExperimentalScheduleGet = (raw) => (input) => preserveEffect()(raw["schedule.get"]({ params: { scheduleID: input["scheduleID"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
564
- var EndpointExperimentalSchedulePause = (raw) => (input) => preserveEffect()(raw["schedule.pause"]({ params: { scheduleID: input["scheduleID"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
565
- var EndpointExperimentalScheduleResume = (raw) => (input) => preserveEffect()(raw["schedule.resume"]({ params: { scheduleID: input["scheduleID"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
566
- var EndpointExperimentalScheduleDelete = (raw) => (input) => preserveEffect()(raw["schedule.delete"]({ params: { scheduleID: input["scheduleID"] } }).pipe(Effect.mapError(mapClientError)));
576
+ var EndpointExperimentalAutomationList = (raw) => (input) => preserveEffect()(raw["automation.list"]({ query: { sessionID: input?.["sessionID"], directory: input?.["directory"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
577
+ var EndpointExperimentalAutomationGet = (raw) => (input) => preserveEffect()(raw["automation.get"]({ params: { automationID: input["automationID"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
578
+ var EndpointExperimentalAutomationPause = (raw) => (input) => preserveEffect()(raw["automation.pause"]({ params: { automationID: input["automationID"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
579
+ var EndpointExperimentalAutomationResume = (raw) => (input) => preserveEffect()(raw["automation.resume"]({ params: { automationID: input["automationID"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
580
+ var EndpointExperimentalAutomationDelete = (raw) => (input) => preserveEffect()(raw["automation.delete"]({ params: { automationID: input["automationID"] } }).pipe(Effect.mapError(mapClientError)));
567
581
  var EndpointExperimentalArtifactsProviders = (raw) => (input) => preserveEffect()(raw["artifacts.providers"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
568
582
  var EndpointExperimentalArtifactsList = (raw) => (input) => preserveEffect()(raw["artifacts.list"]({
569
583
  query: { location: input?.["location"], sessionID: input?.["sessionID"], provider: input?.["provider"] }
@@ -612,13 +626,13 @@ var adaptGroupExperimental = (raw) => ({
612
626
  remove: EndpointExperimentalPersistentPtyRemove(raw),
613
627
  connectToken: EndpointExperimentalPersistentPtyConnectToken(raw)
614
628
  },
615
- schedule: {
616
- create: EndpointExperimentalScheduleCreate(raw),
617
- list: EndpointExperimentalScheduleList(raw),
618
- get: EndpointExperimentalScheduleGet(raw),
619
- pause: EndpointExperimentalSchedulePause(raw),
620
- resume: EndpointExperimentalScheduleResume(raw),
621
- delete: EndpointExperimentalScheduleDelete(raw)
629
+ automation: {
630
+ create: EndpointExperimentalAutomationCreate(raw),
631
+ list: EndpointExperimentalAutomationList(raw),
632
+ get: EndpointExperimentalAutomationGet(raw),
633
+ pause: EndpointExperimentalAutomationPause(raw),
634
+ resume: EndpointExperimentalAutomationResume(raw),
635
+ delete: EndpointExperimentalAutomationDelete(raw)
622
636
  },
623
637
  artifacts: {
624
638
  providers: EndpointExperimentalArtifactsProviders(raw),
@@ -832,6 +846,6 @@ var adaptClient = (raw) => {
832
846
  }
833
847
  };
834
848
  };
835
- var make4 = (options) => HttpApiClient.make(ClientApi2, options).pipe(Effect.map(adaptClient));
849
+ var make6 = (options) => HttpApiClient.make(ClientApi2, options).pipe(Effect.map(adaptClient));
836
850
 
837
- export { make4, exports_client2 };
851
+ export { make6, exports_client4 };
@@ -22,11 +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
+ var isVideoNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "VideoNotFoundError";
25
27
  var isIntegrationNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "IntegrationNotFoundError";
26
28
  var isIntegrationAttemptNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "IntegrationAttemptNotFoundError";
27
29
  var isIntegrationMethodNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "IntegrationMethodNotFoundError";
28
30
  var isMcpServerNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "McpServerNotFoundError";
29
- var isForbiddenError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ForbiddenError";
30
31
  var isProjectNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ProjectNotFoundError";
31
32
  var isPermissionSavedNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "PermissionSavedNotFoundError";
32
33
  var isPermissionNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "PermissionNotFoundError";
@@ -35,10 +36,11 @@ var isRpcError2 = (value) => typeof value === "object" && value !== null && ("_t
35
36
  var isRpcInternalError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "RpcInternalError";
36
37
  var isPtyNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "PtyNotFoundError";
37
38
  var isPtyFeatureUnsupportedError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "PtyFeatureUnsupportedError";
38
- var isScheduleNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ScheduleNotFoundError";
39
+ var isBlobNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "BlobNotFoundError";
40
+ var isAutomationNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "AutomationNotFoundError";
39
41
  var isArtifactNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ArtifactNotFoundError";
40
42
  var isShellNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ShellNotFoundError";
41
43
  var isWorktreeError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "WorktreeError";
42
44
  var isVcsInitNotSupportedError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "VcsInitNotSupportedError";
43
45
 
44
- export { isInvalidRequestError2, isUnauthorizedError2, isLocationNotFoundError2, isServiceUnavailableError2, isAgentNotFoundError2, isPluginNotFoundError2, isInvalidCursorError2, isSessionNotFoundError2, isMessageNotFoundError2, isConflictError2, isCommandNotFoundError2, isCommandExecutionError2, isSessionBusyError2, isUnknownError2, isFormNotFoundError2, isFormInvalidAnswerError2, isFormAlreadySettledError2, isSkillNotFoundError2, isInstructionEntryValueTooLargeError2, isProviderNotFoundError2, isModelNotFoundError2, isUnsupportedModelError2, isProviderRequestError2, isIntegrationNotFoundError2, isIntegrationAttemptNotFoundError2, isIntegrationMethodNotFoundError2, isMcpServerNotFoundError2, isForbiddenError2, isProjectNotFoundError2, isPermissionSavedNotFoundError2, isPermissionNotFoundError2, isFileNotFoundError2, isRpcError2, isRpcInternalError2, isPtyNotFoundError2, isPtyFeatureUnsupportedError2, isScheduleNotFoundError2, isArtifactNotFoundError2, isShellNotFoundError2, isWorktreeError2, isVcsInitNotSupportedError2 };
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 };
@@ -1,9 +1,9 @@
1
1
  // src/effect/generated/client-error.ts
2
2
  import { Schema } from "effect";
3
3
 
4
- class ClientError2 extends Schema.TaggedError()("ClientError", {
4
+ class ClientError3 extends Schema.TaggedError()("ClientError", {
5
5
  cause: Schema.Defect()
6
6
  }) {
7
7
  }
8
8
 
9
- export { ClientError2 };
9
+ export { ClientError3 };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  defaultEnsureTiming2
3
- } from "./contract-xgnj2w4v.js";
3
+ } from "./service-xgnj2w4v.js";
4
4
  import {
5
5
  matchesVersion2
6
- } from "./contract-sxt88q69.js";
6
+ } from "./service-sxt88q69.js";
7
7
 
8
8
  // src/service-probe.ts
9
9
  import { homedir } from "node:os";
@@ -3,20 +3,20 @@ import {
3
3
  readError2,
4
4
  event2,
5
5
  eventType2
6
- } from "./contract-ryy6kscr.js";
6
+ } from "./service-ryy6kscr.js";
7
7
  import {
8
8
  __export
9
- } from "./contract-9rqn6x4v.js";
9
+ } from "./service-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: () => make3
16
+ make: () => make5
17
17
  });
18
18
  import { Effect, Stream } from "effect";
19
- function make3(call, subscribe) {
19
+ function make5(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 { make3, aborted2, exports_rpc };
62
+ export { make5, aborted2, exports_rpc };
@@ -0,0 +1,30 @@
1
+ import {
2
+ make7
3
+ } from "./service-gecjxyvt.js";
4
+ import {
5
+ make3
6
+ } from "./service-nmmc7qpz.js";
7
+ import {
8
+ makeRpc2
9
+ } from "./service-xafd70ys.js";
10
+ import {
11
+ __export
12
+ } from "./service-9rqn6x4v.js";
13
+
14
+ // src/promise/client.ts
15
+ var exports_client = {};
16
+ __export(exports_client, {
17
+ OpenCode: () => exports_client,
18
+ make: () => make2
19
+ });
20
+ function make2(options) {
21
+ const raw = make3(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 { make2, exports_client };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./contract-9rqn6x4v.js";
3
+ } from "./service-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 ClientError3 extends Error {
2
+ class ClientError2 extends Error {
3
3
  reason;
4
4
  name = "ClientError";
5
5
  constructor(reason, options) {
@@ -9,4 +9,4 @@ class ClientError3 extends Error {
9
9
  }
10
10
  }
11
11
 
12
- export { ClientError3 };
12
+ export { ClientError2 };
@@ -4,7 +4,7 @@ import {
4
4
  isFormNotFoundError2,
5
5
  isFormAlreadySettledError2,
6
6
  isPermissionNotFoundError2
7
- } from "./contract-sdjh9vmn.js";
7
+ } from "./service-6hqrj29e.js";
8
8
 
9
9
  // src/solid/data.ts
10
10
  import { Worktree } from "@opencode/schema/worktree";
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  make7
3
- } from "./contract-gecjxyvt.js";
3
+ } from "./service-gecjxyvt.js";
4
4
  import {
5
- ClientError2
6
- } from "./contract-y2etg5bs.js";
5
+ ClientError3
6
+ } from "./service-7f0py9js.js";
7
7
  import {
8
- make4
9
- } from "./contract-yk5evh6f.js";
8
+ make6
9
+ } from "./service-3v8v7cjx.js";
10
10
  import {
11
- make3,
11
+ make5,
12
12
  aborted2
13
- } from "./contract-15p82y03.js";
13
+ } from "./service-anregfhs.js";
14
14
  import {
15
15
  __export
16
- } from "./contract-9rqn6x4v.js";
16
+ } from "./service-9rqn6x4v.js";
17
17
 
18
18
  // src/effect/client.ts
19
- var exports_client = {};
20
- __export(exports_client, {
21
- OpenCode: () => exports_client,
22
- make: () => make2
19
+ var exports_client3 = {};
20
+ __export(exports_client3, {
21
+ OpenCode: () => exports_client3,
22
+ make: () => make4
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 make2 = Effect.fn("OpenCode.make")(function* (options) {
31
+ var make4 = Effect.fn("OpenCode.make")(function* (options) {
32
32
  const httpClient = yield* HttpClient.HttpClient;
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))));
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))));
34
34
  const context = yield* Effect.context();
35
35
  const native = raw.event.subscribe();
36
36
 
@@ -41,12 +41,12 @@ var make2 = 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 ClientError2({ 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 ClientError3({ cause: error })))));
45
45
  return {
46
46
  ...raw,
47
47
  event: { ...raw.event, subscribe },
48
- rpc: Object.assign(make3((input, options) => raw.rpc.call(input).pipe(Effect.provideService(CurrentHeaders, options?.headers)), subscribe), raw.rpc)
48
+ rpc: Object.assign(make5((input, options) => raw.rpc.call(input).pipe(Effect.provideService(CurrentHeaders, options?.headers)), subscribe), raw.rpc)
49
49
  };
50
50
  });
51
51
 
52
- export { make2, exports_client };
52
+ export { make4, exports_client3 };
@@ -1,17 +1,17 @@
1
1
  import {
2
- ClientError3
3
- } from "./contract-nwcpakzx.js";
2
+ ClientError2
3
+ } from "./service-js54wxgp.js";
4
4
  import {
5
5
  __export
6
- } from "./contract-9rqn6x4v.js";
6
+ } from "./service-9rqn6x4v.js";
7
7
 
8
8
  // src/promise/generated/client.ts
9
- var exports_client4 = {};
10
- __export(exports_client4, {
11
- make: () => make6
9
+ var exports_client2 = {};
10
+ __export(exports_client2, {
11
+ make: () => make3
12
12
  });
13
13
  var maxSseEventBytes = 16 * 1024 * 1024;
14
- function make6(options) {
14
+ function make3(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 make6(options) {
44
44
  const prepared = prepare(descriptor, requestOptions);
45
45
  return await fetch(prepared.url, prepared.init);
46
46
  } catch (cause) {
47
- throw new ClientError3("Transport", { cause });
47
+ throw new ClientError2("Transport", { cause });
48
48
  }
49
49
  };
50
50
  const responseError = async (response, descriptor) => {
@@ -53,7 +53,7 @@ function make6(options) {
53
53
  try {
54
54
  await response.body?.cancel();
55
55
  } catch {}
56
- throw new ClientError3("UnexpectedStatus", { cause: { status: response.status }, detail: String(response.status) });
56
+ throw new ClientError2("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 make6(options) {
78
78
  try {
79
79
  await response.body?.cancel();
80
80
  } catch {}
81
- throw new ClientError3("UnsupportedContentType", { detail: response.headers.get("content-type") });
81
+ throw new ClientError2("UnsupportedContentType", { detail: response.headers.get("content-type") });
82
82
  }
83
83
  if (response.body === null)
84
- throw new ClientError3("MalformedResponse");
84
+ throw new ClientError2("MalformedResponse");
85
85
  const reader = response.body.getReader();
86
86
  const decoder = new TextDecoder;
87
87
  let buffer = "";
@@ -91,13 +91,13 @@ function make6(options) {
91
91
  try {
92
92
  next = await reader.read();
93
93
  } catch (cause) {
94
- throw new ClientError3("Transport", { cause });
94
+ throw new ClientError2("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 ClientError3("SseEventTooLarge");
100
+ throw new ClientError2("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 make6(options) {
124
124
  try {
125
125
  yield JSON.parse(data);
126
126
  } catch (cause) {
127
- throw new ClientError3("MalformedResponse", { cause });
127
+ throw new ClientError2("MalformedResponse", { cause });
128
128
  }
129
129
  }
130
130
  boundary = buffer.indexOf(`
@@ -648,6 +648,33 @@ function make6(options) {
648
648
  declaredStatuses: [400, 401, 404, 422, 502, 503],
649
649
  empty: false
650
650
  }, requestOptions).then((value) => value.data),
651
+ video: {
652
+ create: (input, requestOptions) => request({
653
+ method: "POST",
654
+ path: `/api/experimental/generate/video`,
655
+ body: {
656
+ model: input["model"],
657
+ prompt: input["prompt"],
658
+ start: input["start"],
659
+ end: input["end"],
660
+ references: input["references"],
661
+ duration: input["duration"],
662
+ aspect: input["aspect"],
663
+ resolution: input["resolution"],
664
+ sound: input["sound"]
665
+ },
666
+ successStatus: 200,
667
+ declaredStatuses: [400, 401, 403, 404, 422, 502, 503],
668
+ empty: false
669
+ }, requestOptions).then((value) => value.data),
670
+ get: (input, requestOptions) => request({
671
+ method: "GET",
672
+ path: `/api/experimental/generate/video/${encodeURIComponent(input.id)}`,
673
+ successStatus: 200,
674
+ declaredStatuses: [400, 401, 403, 404],
675
+ empty: false
676
+ }, requestOptions).then((value) => value.data)
677
+ },
651
678
  decisions: (input, requestOptions) => request({
652
679
  method: "POST",
653
680
  path: `/api/experimental/generate/decisions`,
@@ -856,18 +883,27 @@ function make6(options) {
856
883
  binary: true
857
884
  }, requestOptions)
858
885
  },
859
- schedule: {
886
+ blob: {
887
+ get: (input, requestOptions) => request({
888
+ method: "GET",
889
+ path: `/api/experimental/blob/${encodeURIComponent(input.id)}`,
890
+ successStatus: 200,
891
+ declaredStatuses: [400, 401, 404],
892
+ empty: false,
893
+ binary: true
894
+ }, requestOptions)
895
+ },
896
+ automation: {
860
897
  create: (input, requestOptions) => request({
861
898
  method: "POST",
862
- path: `/api/experimental/schedule`,
899
+ path: `/api/experimental/automation`,
863
900
  body: {
864
901
  sessionID: input["sessionID"],
902
+ directory: input["directory"],
865
903
  name: input["name"],
866
- when: input["when"],
867
- if: input["if"],
868
- until: input["until"],
869
- ends: input["ends"],
870
- prompt: input["prompt"]
904
+ trigger: input["trigger"],
905
+ action: input["action"],
906
+ expires: input["expires"]
871
907
  },
872
908
  successStatus: 200,
873
909
  declaredStatuses: [400, 401, 403, 404],
@@ -875,36 +911,36 @@ function make6(options) {
875
911
  }, requestOptions).then((value) => value.data),
876
912
  list: (input, requestOptions) => request({
877
913
  method: "GET",
878
- path: `/api/experimental/schedule`,
879
- query: { sessionID: input["sessionID"] },
914
+ path: `/api/experimental/automation`,
915
+ query: { sessionID: input?.["sessionID"], directory: input?.["directory"] },
880
916
  successStatus: 200,
881
917
  declaredStatuses: [400, 401, 403, 404],
882
918
  empty: false
883
919
  }, requestOptions).then((value) => value.data),
884
920
  get: (input, requestOptions) => request({
885
921
  method: "GET",
886
- path: `/api/experimental/schedule/${encodeURIComponent(input.scheduleID)}`,
922
+ path: `/api/experimental/automation/${encodeURIComponent(input.automationID)}`,
887
923
  successStatus: 200,
888
924
  declaredStatuses: [400, 401, 403, 404],
889
925
  empty: false
890
926
  }, requestOptions).then((value) => value.data),
891
927
  pause: (input, requestOptions) => request({
892
928
  method: "POST",
893
- path: `/api/experimental/schedule/${encodeURIComponent(input.scheduleID)}/pause`,
929
+ path: `/api/experimental/automation/${encodeURIComponent(input.automationID)}/pause`,
894
930
  successStatus: 200,
895
931
  declaredStatuses: [400, 401, 403, 404],
896
932
  empty: false
897
933
  }, requestOptions).then((value) => value.data),
898
934
  resume: (input, requestOptions) => request({
899
935
  method: "POST",
900
- path: `/api/experimental/schedule/${encodeURIComponent(input.scheduleID)}/resume`,
936
+ path: `/api/experimental/automation/${encodeURIComponent(input.automationID)}/resume`,
901
937
  successStatus: 200,
902
938
  declaredStatuses: [400, 401, 403, 404],
903
939
  empty: false
904
940
  }, requestOptions).then((value) => value.data),
905
941
  delete: (input, requestOptions) => request({
906
942
  method: "DELETE",
907
- path: `/api/experimental/schedule/${encodeURIComponent(input.scheduleID)}`,
943
+ path: `/api/experimental/automation/${encodeURIComponent(input.automationID)}`,
908
944
  successStatus: 204,
909
945
  declaredStatuses: [400, 401, 403, 404],
910
946
  empty: true
@@ -1782,20 +1818,20 @@ async function json(response) {
1782
1818
  try {
1783
1819
  await response.body?.cancel();
1784
1820
  } catch {}
1785
- throw new ClientError3("UnsupportedContentType", { detail: response.headers.get("content-type") });
1821
+ throw new ClientError2("UnsupportedContentType", { detail: response.headers.get("content-type") });
1786
1822
  }
1787
1823
  let text;
1788
1824
  try {
1789
1825
  text = await response.text();
1790
1826
  } catch (cause) {
1791
- throw new ClientError3("Transport", { cause });
1827
+ throw new ClientError2("Transport", { cause });
1792
1828
  }
1793
1829
  if (text === "")
1794
- throw new ClientError3("MalformedResponse");
1830
+ throw new ClientError2("MalformedResponse");
1795
1831
  try {
1796
1832
  return JSON.parse(text);
1797
1833
  } catch (cause) {
1798
- throw new ClientError3("MalformedResponse", { cause });
1834
+ throw new ClientError2("MalformedResponse", { cause });
1799
1835
  }
1800
1836
  }
1801
1837
  function declared(body) {
@@ -1808,4 +1844,4 @@ function isContentType(response, expected) {
1808
1844
  return response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase() === expected;
1809
1845
  }
1810
1846
 
1811
- export { make6, exports_client4 };
1847
+ export { make3, exports_client2 };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./contract-9rqn6x4v.js";
3
+ } from "./service-9rqn6x4v.js";
4
4
 
5
5
  // src/rpc-runtime.ts
6
6
  var exports_rpc_runtime = {};
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  headers2
3
- } from "./contract-8ye1ye6f.js";
3
+ } from "./service-8ye1ye6f.js";
4
4
  import {
5
5
  __export
6
- } from "./contract-9rqn6x4v.js";
6
+ } from "./service-9rqn6x4v.js";
7
7
 
8
8
  // src/pty-handoff.ts
9
9
  var exports_pty_handoff = {};
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  isRpcError2,
3
3
  isRpcInternalError2
4
- } from "./contract-sdjh9vmn.js";
4
+ } from "./service-6hqrj29e.js";
5
5
 
6
6
  // src/promise/rpc.ts
7
7
  function makeRpc2(raw, events) {
package/dist/contract.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  effectOmitEndpoints2,
5
5
  groupNames2,
6
6
  promiseOmitEndpoints2
7
- } from "./chunks/contract-60xe5cbf.js";
7
+ } from "./chunks/service-60xe5cbf.js";
8
8
  export {
9
9
  ClientApi2 as ClientApi,
10
10
  clientNamespace2 as clientNamespace,