@opencode/client 2.2.3 → 2.2.5

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/{contract-v1h0xkyr.js → rpc-runtime-3eaz3m83.js} +1 -25
  2. package/dist/chunks/{contract-gxr0nf8c.js → rpc-runtime-6ffmhce9.js} +46 -11
  3. package/dist/chunks/{contract-y2etg5bs.js → rpc-runtime-7f0py9js.js} +2 -2
  4. package/dist/chunks/{contract-2ny4vxct.js → rpc-runtime-8ye1ye6f.js} +2 -2
  5. package/dist/chunks/{contract-9j12j8xw.js → rpc-runtime-anregfhs.js} +5 -5
  6. package/dist/chunks/{contract-gecjxyvt.js → rpc-runtime-gecjxyvt.js} +1 -1
  7. package/dist/chunks/{contract-nwcpakzx.js → rpc-runtime-js54wxgp.js} +2 -2
  8. package/dist/chunks/{contract-ryy6kscr.js → rpc-runtime-ryy6kscr.js} +1 -1
  9. package/dist/chunks/{contract-fh77hmr5.js → rpc-runtime-sbaynanj.js} +1 -1
  10. package/dist/chunks/{contract-cvg5j6d1.js → rpc-runtime-sdjh9vmn.js} +3 -1
  11. package/dist/chunks/{contract-0e3ghr9a.js → rpc-runtime-t2ajednw.js} +93 -21
  12. package/dist/chunks/{contract-gcmv0c13.js → rpc-runtime-tq7qack3.js} +2 -2
  13. package/dist/chunks/{contract-bhbt909k.js → rpc-runtime-vrtmt90e.js} +17 -17
  14. package/dist/chunks/rpc-runtime-wbnz2gjn.js +30 -0
  15. package/dist/chunks/{contract-kdshn947.js → rpc-runtime-xqwq6bgr.js} +1 -1
  16. package/dist/contract.js +1 -1
  17. package/dist/effect/api/api.d.ts +93 -3
  18. package/dist/effect/client.d.ts +58 -2
  19. package/dist/effect/client.js +12 -12
  20. package/dist/effect/generated/client-error.js +3 -3
  21. package/dist/effect/generated/client.d.ts +58 -2
  22. package/dist/effect/generated/client.js +5 -5
  23. package/dist/effect/generated/index.js +8 -8
  24. package/dist/effect/index.js +12 -12
  25. package/dist/effect/rpc.js +4 -4
  26. package/dist/effect/service.js +6 -6
  27. package/dist/promise/client.d.ts +10 -1
  28. package/dist/promise/client.js +11 -11
  29. package/dist/promise/generated/client-error.js +3 -3
  30. package/dist/promise/generated/client.d.ts +10 -1
  31. package/dist/promise/generated/client.js +4 -4
  32. package/dist/promise/generated/index.js +12 -8
  33. package/dist/promise/generated/types.d.ts +148 -5
  34. package/dist/promise/generated/types.js +5 -1
  35. package/dist/promise/index.js +17 -13
  36. package/dist/promise/media.d.ts +10 -1
  37. package/dist/promise/media.js +1 -1
  38. package/dist/promise/rpc.js +2 -2
  39. package/dist/promise/service.js +6 -6
  40. package/dist/pty-handoff.js +4 -4
  41. package/dist/rpc-runtime.js +1 -1
  42. package/dist/service-contender.js +1 -1
  43. package/dist/service-probe.js +3 -3
  44. package/dist/service-timing.js +1 -1
  45. package/dist/service-version.js +1 -1
  46. package/dist/service.js +1 -1
  47. package/dist/shared-events.js +1 -1
  48. package/dist/solid/connection.js +1 -1
  49. package/dist/solid/data.js +10 -10
  50. package/dist/solid/index.js +14 -16
  51. package/dist/solid/pty.d.ts +1 -9
  52. package/dist/solid/pty.js +1 -3
  53. package/dist/solid/retention.js +1 -1
  54. package/dist/solid/usage.js +1 -1
  55. package/package.json +4 -4
  56. package/dist/chunks/contract-gmh1mc73.js +0 -30
  57. /package/dist/chunks/{contract-60xe5cbf.js → rpc-runtime-60xe5cbf.js} +0 -0
  58. /package/dist/chunks/{contract-6mptkzbc.js → rpc-runtime-6mptkzbc.js} +0 -0
  59. /package/dist/chunks/{contract-6mq2wh8y.js → rpc-runtime-6mq2wh8y.js} +0 -0
  60. /package/dist/chunks/{contract-6r38tsk5.js → rpc-runtime-6r38tsk5.js} +0 -0
  61. /package/dist/chunks/{contract-8s2anffy.js → rpc-runtime-8s2anffy.js} +0 -0
  62. /package/dist/chunks/{contract-9rqn6x4v.js → rpc-runtime-9rqn6x4v.js} +0 -0
  63. /package/dist/chunks/{contract-mwrzahmf.js → rpc-runtime-mwrzahmf.js} +0 -0
  64. /package/dist/chunks/{contract-qav6mfdz.js → rpc-runtime-qav6mfdz.js} +0 -0
  65. /package/dist/chunks/{contract-sxt88q69.js → rpc-runtime-sxt88q69.js} +0 -0
  66. /package/dist/chunks/{contract-ve4aws36.js → rpc-runtime-ve4aws36.js} +0 -0
  67. /package/dist/chunks/{contract-vyas3vgt.js → rpc-runtime-vyas3vgt.js} +0 -0
  68. /package/dist/chunks/{contract-xgnj2w4v.js → rpc-runtime-xgnj2w4v.js} +0 -0
  69. /package/dist/chunks/{contract-ydhz1zrh.js → rpc-runtime-ydhz1zrh.js} +0 -0
@@ -40,30 +40,6 @@ function persistentPtyFrame2(size, data) {
40
40
  frame.set(data, 5);
41
41
  return frame;
42
42
  }
43
- function createPtyClient2(api, options) {
44
- return {
45
- async connect(input) {
46
- const result = await api.pty.connect.token({
47
- ptyID: input.ptyID,
48
- location: input.location,
49
- "x-opencode-ticket": "1"
50
- });
51
- const baseUrl = new URL(options.url);
52
- if (!baseUrl.pathname.endsWith("/"))
53
- baseUrl.pathname += "/";
54
- const url = new URL(`api/pty/${encodeURIComponent(input.ptyID)}/connect`, baseUrl);
55
- if (input.location?.directory)
56
- url.searchParams.set("location[directory]", input.location.directory);
57
- if (input.cursor !== undefined)
58
- url.searchParams.set("cursor", String(input.cursor));
59
- url.searchParams.set("ticket", result.data.ticket);
60
- url.protocol = url.protocol === "https:" ? "wss:" : "ws:";
61
- const socket = options.openSocket?.(url) ?? new WebSocket(url);
62
- socket.binaryType = "arraybuffer";
63
- return socket;
64
- }
65
- };
66
- }
67
43
  function createPersistentPtyClient2(api, options) {
68
44
  return {
69
45
  async connect(input) {
@@ -88,4 +64,4 @@ function createPersistentPtyClient2(api, options) {
88
64
  };
89
65
  }
90
66
 
91
- export { PersistentPtyMessage2, decodePersistentPtyMessage2, persistentPtyFrame2, createPtyClient2, createPersistentPtyClient2 };
67
+ export { PersistentPtyMessage2, decodePersistentPtyMessage2, persistentPtyFrame2, createPersistentPtyClient2 };
@@ -1,23 +1,23 @@
1
1
  import {
2
2
  ClientApi2
3
- } from "./contract-60xe5cbf.js";
3
+ } from "./rpc-runtime-60xe5cbf.js";
4
4
  import {
5
- ClientError2
6
- } from "./contract-y2etg5bs.js";
5
+ ClientError3
6
+ } from "./rpc-runtime-7f0py9js.js";
7
7
  import {
8
8
  __export
9
- } from "./contract-9rqn6x4v.js";
9
+ } from "./rpc-runtime-9rqn6x4v.js";
10
10
 
11
11
  // src/effect/generated/client.ts
12
- var exports_client2 = {};
13
- __export(exports_client2, {
14
- make: () => make3
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)));
@@ -540,7 +540,7 @@ var EndpointExperimentalPersistentPtyHandoff = (raw) => () => preserveEffect()(r
540
540
  var EndpointExperimentalPersistentPtyGet = (raw) => (input) => preserveEffect()(raw["persistentPty.get"]({ params: { ptyID: input["ptyID"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
541
541
  var EndpointExperimentalPersistentPtyUpdate = (raw) => (input) => preserveEffect()(raw["persistentPty.update"]({
542
542
  params: { ptyID: input["ptyID"] },
543
- payload: { attachmentID: input["attachmentID"], size: input["size"] }
543
+ payload: { attachmentID: input["attachmentID"], size: input["size"], title: input["title"] }
544
544
  }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
545
545
  var EndpointExperimentalPersistentPtySnapshot = (raw) => (input) => preserveEffect()(raw["persistentPty.snapshot"]({ params: { ptyID: input["ptyID"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
546
546
  var EndpointExperimentalPersistentPtyRemove = (raw) => (input) => preserveEffect()(raw["persistentPty.remove"]({ params: { ptyID: input["ptyID"] } }).pipe(Effect.mapError(mapClientError)));
@@ -564,6 +564,33 @@ var EndpointExperimentalScheduleGet = (raw) => (input) => preserveEffect()(raw["
564
564
  var EndpointExperimentalSchedulePause = (raw) => (input) => preserveEffect()(raw["schedule.pause"]({ params: { scheduleID: input["scheduleID"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
565
565
  var EndpointExperimentalScheduleResume = (raw) => (input) => preserveEffect()(raw["schedule.resume"]({ params: { scheduleID: input["scheduleID"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
566
566
  var EndpointExperimentalScheduleDelete = (raw) => (input) => preserveEffect()(raw["schedule.delete"]({ params: { scheduleID: input["scheduleID"] } }).pipe(Effect.mapError(mapClientError)));
567
+ var EndpointExperimentalArtifactsProviders = (raw) => (input) => preserveEffect()(raw["artifacts.providers"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
568
+ var EndpointExperimentalArtifactsList = (raw) => (input) => preserveEffect()(raw["artifacts.list"]({
569
+ query: { location: input?.["location"], sessionID: input?.["sessionID"], provider: input?.["provider"] }
570
+ }).pipe(Effect.mapError(mapClientError)));
571
+ var EndpointExperimentalArtifactsCreate = (raw) => (input) => preserveEffect()(raw["artifacts.create"]({
572
+ query: { location: input["location"] },
573
+ payload: {
574
+ title: input["title"],
575
+ files: input["files"],
576
+ entry: input["entry"],
577
+ provider: input["provider"],
578
+ sessionID: input["sessionID"]
579
+ }
580
+ }).pipe(Effect.mapError(mapClientError)));
581
+ var EndpointExperimentalArtifactsGet = (raw) => (input) => preserveEffect()(raw["artifacts.get"]({
582
+ params: { artifactID: input["artifactID"] },
583
+ query: { location: input["location"] }
584
+ }).pipe(Effect.mapError(mapClientError)));
585
+ var EndpointExperimentalArtifactsUpdate = (raw) => (input) => preserveEffect()(raw["artifacts.update"]({
586
+ params: { artifactID: input["artifactID"] },
587
+ query: { location: input["location"] },
588
+ payload: { title: input["title"], files: input["files"], entry: input["entry"], sessionID: input["sessionID"] }
589
+ }).pipe(Effect.mapError(mapClientError)));
590
+ var EndpointExperimentalArtifactsDelete = (raw) => (input) => preserveEffect()(raw["artifacts.delete"]({
591
+ params: { artifactID: input["artifactID"] },
592
+ query: { location: input["location"] }
593
+ }).pipe(Effect.mapError(mapClientError)));
567
594
  var adaptGroupExperimental = (raw) => ({
568
595
  persistentPty: {
569
596
  read: EndpointExperimentalPersistentPtyRead(raw),
@@ -584,6 +611,14 @@ var adaptGroupExperimental = (raw) => ({
584
611
  pause: EndpointExperimentalSchedulePause(raw),
585
612
  resume: EndpointExperimentalScheduleResume(raw),
586
613
  delete: EndpointExperimentalScheduleDelete(raw)
614
+ },
615
+ artifacts: {
616
+ providers: EndpointExperimentalArtifactsProviders(raw),
617
+ list: EndpointExperimentalArtifactsList(raw),
618
+ create: EndpointExperimentalArtifactsCreate(raw),
619
+ get: EndpointExperimentalArtifactsGet(raw),
620
+ update: EndpointExperimentalArtifactsUpdate(raw),
621
+ delete: EndpointExperimentalArtifactsDelete(raw)
587
622
  }
588
623
  });
589
624
  var EndpointShellList = (raw) => (input) => preserveEffect()(raw["shell.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
@@ -788,6 +823,6 @@ var adaptClient = (raw) => {
788
823
  }
789
824
  };
790
825
  };
791
- var make3 = (options) => HttpApiClient.make(ClientApi2, options).pipe(Effect.map(adaptClient));
826
+ var make6 = (options) => HttpApiClient.make(ClientApi2, options).pipe(Effect.map(adaptClient));
792
827
 
793
- export { make3, exports_client2 };
828
+ export { make6, exports_client4 };
@@ -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 "./rpc-runtime-xgnj2w4v.js";
4
4
  import {
5
5
  matchesVersion2
6
- } from "./contract-sxt88q69.js";
6
+ } from "./rpc-runtime-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 "./rpc-runtime-ryy6kscr.js";
7
7
  import {
8
8
  __export
9
- } from "./contract-9rqn6x4v.js";
9
+ } from "./rpc-runtime-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: () => make4
16
+ make: () => make5
17
17
  });
18
18
  import { Effect, Stream } from "effect";
19
- function make4(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 { make4, aborted2, exports_rpc };
62
+ export { make5, aborted2, exports_rpc };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./contract-9rqn6x4v.js";
3
+ } from "./rpc-runtime-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 };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __export
3
- } from "./contract-9rqn6x4v.js";
3
+ } from "./rpc-runtime-9rqn6x4v.js";
4
4
 
5
5
  // src/rpc-runtime.ts
6
6
  var exports_rpc_runtime = {};
@@ -4,7 +4,7 @@ import {
4
4
  isFormNotFoundError2,
5
5
  isFormAlreadySettledError2,
6
6
  isPermissionNotFoundError2
7
- } from "./contract-cvg5j6d1.js";
7
+ } from "./rpc-runtime-sdjh9vmn.js";
8
8
 
9
9
  // src/solid/data.ts
10
10
  import { Worktree } from "@opencode/schema/worktree";
@@ -34,9 +34,11 @@ var isFileNotFoundError2 = (value) => typeof value === "object" && value !== nul
34
34
  var isRpcError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "RpcError";
35
35
  var isRpcInternalError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "RpcInternalError";
36
36
  var isPtyNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "PtyNotFoundError";
37
+ var isPtyFeatureUnsupportedError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "PtyFeatureUnsupportedError";
37
38
  var isScheduleNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ScheduleNotFoundError";
39
+ var isArtifactNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ArtifactNotFoundError";
38
40
  var isShellNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ShellNotFoundError";
39
41
  var isWorktreeError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "WorktreeError";
40
42
  var isVcsInitNotSupportedError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "VcsInitNotSupportedError";
41
43
 
42
- 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, isScheduleNotFoundError2, isShellNotFoundError2, isWorktreeError2, isVcsInitNotSupportedError2 };
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 };
@@ -1,17 +1,17 @@
1
1
  import {
2
- ClientError3
3
- } from "./contract-nwcpakzx.js";
2
+ ClientError2
3
+ } from "./rpc-runtime-js54wxgp.js";
4
4
  import {
5
5
  __export
6
- } from "./contract-9rqn6x4v.js";
6
+ } from "./rpc-runtime-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(`
@@ -818,9 +818,9 @@ function make6(options) {
818
818
  update: (input, requestOptions) => request({
819
819
  method: "PUT",
820
820
  path: `/api/experimental/persistent-pty/${encodeURIComponent(input.ptyID)}`,
821
- body: { attachmentID: input["attachmentID"], size: input["size"] },
821
+ body: { attachmentID: input["attachmentID"], size: input["size"], title: input["title"] },
822
822
  successStatus: 200,
823
- declaredStatuses: [400, 401, 404, 503],
823
+ declaredStatuses: [400, 401, 404, 501, 503],
824
824
  empty: false
825
825
  }, requestOptions).then((value) => value.data),
826
826
  snapshot: (input, requestOptions) => request({
@@ -910,6 +910,78 @@ function make6(options) {
910
910
  empty: true
911
911
  }, requestOptions)
912
912
  },
913
+ artifacts: {
914
+ providers: (input, requestOptions) => request({
915
+ method: "GET",
916
+ path: `/api/experimental/artifacts/providers`,
917
+ query: { location: input?.["location"] },
918
+ successStatus: 200,
919
+ declaredStatuses: [400, 401, 403, 404, 503],
920
+ empty: false
921
+ }, requestOptions),
922
+ list: (input, requestOptions) => request({
923
+ method: "GET",
924
+ path: `/api/experimental/artifacts`,
925
+ query: { location: input?.["location"], sessionID: input?.["sessionID"], provider: input?.["provider"] },
926
+ successStatus: 200,
927
+ declaredStatuses: [400, 401, 403, 404, 503],
928
+ empty: false
929
+ }, requestOptions),
930
+ create: (input, requestOptions) => request({
931
+ method: "POST",
932
+ path: `/api/experimental/artifacts`,
933
+ query: { location: input["location"] },
934
+ body: {
935
+ title: input["title"],
936
+ files: input["files"],
937
+ entry: input["entry"],
938
+ provider: input["provider"],
939
+ sessionID: input["sessionID"]
940
+ },
941
+ successStatus: 200,
942
+ declaredStatuses: [400, 401, 403, 404, 503],
943
+ empty: false
944
+ }, requestOptions),
945
+ get: (input, requestOptions) => request({
946
+ method: "GET",
947
+ path: `/api/experimental/artifacts/${encodeURIComponent(input.artifactID)}`,
948
+ query: { location: input["location"] },
949
+ successStatus: 200,
950
+ declaredStatuses: [400, 401, 403, 404, 503],
951
+ empty: false
952
+ }, requestOptions),
953
+ update: (input, requestOptions) => request({
954
+ method: "PATCH",
955
+ path: `/api/experimental/artifacts/${encodeURIComponent(input.artifactID)}`,
956
+ query: { location: input["location"] },
957
+ body: {
958
+ title: input["title"],
959
+ files: input["files"],
960
+ entry: input["entry"],
961
+ sessionID: input["sessionID"]
962
+ },
963
+ successStatus: 200,
964
+ declaredStatuses: [400, 401, 403, 404, 503],
965
+ empty: false
966
+ }, requestOptions),
967
+ delete: (input, requestOptions) => request({
968
+ method: "DELETE",
969
+ path: `/api/experimental/artifacts/${encodeURIComponent(input.artifactID)}`,
970
+ query: { location: input["location"] },
971
+ successStatus: 204,
972
+ declaredStatuses: [400, 401, 403, 404, 503],
973
+ empty: true
974
+ }, requestOptions),
975
+ view: (input, requestOptions) => request({
976
+ method: "GET",
977
+ path: `/api/experimental/artifacts/${encodeURIComponent(input.artifactID)}/view/${encodePath(input.path)}`,
978
+ query: { location: input["location"] },
979
+ successStatus: 200,
980
+ declaredStatuses: [400, 401, 403, 404, 503],
981
+ empty: false,
982
+ binary: true
983
+ }, requestOptions)
984
+ },
913
985
  migration: {
914
986
  v1: {
915
987
  status: (requestOptions) => request({
@@ -1695,20 +1767,20 @@ async function json(response) {
1695
1767
  try {
1696
1768
  await response.body?.cancel();
1697
1769
  } catch {}
1698
- throw new ClientError3("UnsupportedContentType", { detail: response.headers.get("content-type") });
1770
+ throw new ClientError2("UnsupportedContentType", { detail: response.headers.get("content-type") });
1699
1771
  }
1700
1772
  let text;
1701
1773
  try {
1702
1774
  text = await response.text();
1703
1775
  } catch (cause) {
1704
- throw new ClientError3("Transport", { cause });
1776
+ throw new ClientError2("Transport", { cause });
1705
1777
  }
1706
1778
  if (text === "")
1707
- throw new ClientError3("MalformedResponse");
1779
+ throw new ClientError2("MalformedResponse");
1708
1780
  try {
1709
1781
  return JSON.parse(text);
1710
1782
  } catch (cause) {
1711
- throw new ClientError3("MalformedResponse", { cause });
1783
+ throw new ClientError2("MalformedResponse", { cause });
1712
1784
  }
1713
1785
  }
1714
1786
  function declared(body) {
@@ -1721,4 +1793,4 @@ function isContentType(response, expected) {
1721
1793
  return response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase() === expected;
1722
1794
  }
1723
1795
 
1724
- export { make6, exports_client4 };
1796
+ export { make3, exports_client2 };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  headers2
3
- } from "./contract-2ny4vxct.js";
3
+ } from "./rpc-runtime-8ye1ye6f.js";
4
4
  import {
5
5
  __export
6
- } from "./contract-9rqn6x4v.js";
6
+ } from "./rpc-runtime-9rqn6x4v.js";
7
7
 
8
8
  // src/pty-handoff.ts
9
9
  var exports_pty_handoff = {};
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  make7
3
- } from "./contract-gecjxyvt.js";
3
+ } from "./rpc-runtime-gecjxyvt.js";
4
4
  import {
5
- ClientError2
6
- } from "./contract-y2etg5bs.js";
5
+ ClientError3
6
+ } from "./rpc-runtime-7f0py9js.js";
7
7
  import {
8
- make3
9
- } from "./contract-gxr0nf8c.js";
8
+ make6
9
+ } from "./rpc-runtime-6ffmhce9.js";
10
10
  import {
11
- make4,
11
+ make5,
12
12
  aborted2
13
- } from "./contract-9j12j8xw.js";
13
+ } from "./rpc-runtime-anregfhs.js";
14
14
  import {
15
15
  __export
16
- } from "./contract-9rqn6x4v.js";
16
+ } from "./rpc-runtime-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* make3(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(make4((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 };
@@ -0,0 +1,30 @@
1
+ import {
2
+ make7
3
+ } from "./rpc-runtime-gecjxyvt.js";
4
+ import {
5
+ make3
6
+ } from "./rpc-runtime-t2ajednw.js";
7
+ import {
8
+ makeRpc2
9
+ } from "./rpc-runtime-xqwq6bgr.js";
10
+ import {
11
+ __export
12
+ } from "./rpc-runtime-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,7 +1,7 @@
1
1
  import {
2
2
  isRpcError2,
3
3
  isRpcInternalError2
4
- } from "./contract-cvg5j6d1.js";
4
+ } from "./rpc-runtime-sdjh9vmn.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/rpc-runtime-60xe5cbf.js";
8
8
  export {
9
9
  ClientApi2 as ClientApi,
10
10
  clientNamespace2 as clientNamespace,