@opencode/client 2.2.2 → 2.2.3

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 (67) hide show
  1. package/dist/chunks/{pty-handoff-0e3ghr9a.js → contract-0e3ghr9a.js} +2 -2
  2. package/dist/chunks/{pty-handoff-8ye1ye6f.js → contract-2ny4vxct.js} +2 -2
  3. package/dist/chunks/{pty-handoff-15p82y03.js → contract-9j12j8xw.js} +5 -5
  4. package/dist/chunks/{pty-handoff-5d2vkjb7.js → contract-bhbt909k.js} +9 -9
  5. package/dist/chunks/{pty-handoff-f6hq5twr.js → contract-fh77hmr5.js} +72 -8
  6. package/dist/chunks/{pty-handoff-pgwvv4px.js → contract-gcmv0c13.js} +2 -2
  7. package/dist/chunks/{pty-handoff-gecjxyvt.js → contract-gecjxyvt.js} +1 -1
  8. package/dist/chunks/{pty-handoff-wcnmkks2.js → contract-gmh1mc73.js} +4 -4
  9. package/dist/chunks/{pty-handoff-bb4rz2ry.js → contract-gxr0nf8c.js} +6 -6
  10. package/dist/chunks/{pty-handoff-kdshn947.js → contract-kdshn947.js} +1 -1
  11. package/dist/chunks/contract-mwrzahmf.js +38 -0
  12. package/dist/chunks/{pty-handoff-ryy6kscr.js → contract-ryy6kscr.js} +1 -1
  13. package/dist/chunks/{pty-handoff-gne7h7mq.js → contract-v1h0xkyr.js} +42 -1
  14. package/dist/contract.js +1 -1
  15. package/dist/effect/client.d.ts +24 -0
  16. package/dist/effect/client.js +8 -8
  17. package/dist/effect/generated/client-error.js +1 -1
  18. package/dist/effect/generated/client.d.ts +24 -0
  19. package/dist/effect/generated/client.js +5 -5
  20. package/dist/effect/generated/index.js +4 -4
  21. package/dist/effect/index.js +8 -8
  22. package/dist/effect/rpc.js +4 -4
  23. package/dist/effect/service.js +6 -6
  24. package/dist/promise/client.js +7 -7
  25. package/dist/promise/generated/client-error.js +1 -1
  26. package/dist/promise/generated/client.js +2 -2
  27. package/dist/promise/generated/index.js +4 -4
  28. package/dist/promise/generated/types.d.ts +25 -7
  29. package/dist/promise/generated/types.js +1 -1
  30. package/dist/promise/index.d.ts +1 -0
  31. package/dist/promise/index.js +15 -9
  32. package/dist/promise/media.d.ts +356 -0
  33. package/dist/promise/media.js +8 -0
  34. package/dist/promise/rpc.js +2 -2
  35. package/dist/promise/service.js +6 -6
  36. package/dist/pty-handoff.js +4 -4
  37. package/dist/rpc-runtime.js +1 -1
  38. package/dist/service-contender.js +1 -1
  39. package/dist/service-probe.js +3 -3
  40. package/dist/service-timing.js +1 -1
  41. package/dist/service-version.js +1 -1
  42. package/dist/service.js +1 -1
  43. package/dist/shared-events.js +1 -1
  44. package/dist/solid/connection.js +1 -1
  45. package/dist/solid/data.d.ts +2 -0
  46. package/dist/solid/data.js +10 -9
  47. package/dist/solid/index.js +20 -13
  48. package/dist/solid/pty.d.ts +66 -0
  49. package/dist/solid/pty.js +8 -2
  50. package/dist/solid/retention.js +1 -1
  51. package/dist/solid/usage.js +1 -1
  52. package/package.json +4 -4
  53. /package/dist/chunks/{pty-handoff-60xe5cbf.js → contract-60xe5cbf.js} +0 -0
  54. /package/dist/chunks/{pty-handoff-6mptkzbc.js → contract-6mptkzbc.js} +0 -0
  55. /package/dist/chunks/{pty-handoff-6mq2wh8y.js → contract-6mq2wh8y.js} +0 -0
  56. /package/dist/chunks/{pty-handoff-m2eywc8w.js → contract-6r38tsk5.js} +0 -0
  57. /package/dist/chunks/{pty-handoff-8s2anffy.js → contract-8s2anffy.js} +0 -0
  58. /package/dist/chunks/{pty-handoff-9rqn6x4v.js → contract-9rqn6x4v.js} +0 -0
  59. /package/dist/chunks/{pty-handoff-cvg5j6d1.js → contract-cvg5j6d1.js} +0 -0
  60. /package/dist/chunks/{pty-handoff-nwcpakzx.js → contract-nwcpakzx.js} +0 -0
  61. /package/dist/chunks/{pty-handoff-qav6mfdz.js → contract-qav6mfdz.js} +0 -0
  62. /package/dist/chunks/{pty-handoff-sxt88q69.js → contract-sxt88q69.js} +0 -0
  63. /package/dist/chunks/{pty-handoff-ve4aws36.js → contract-ve4aws36.js} +0 -0
  64. /package/dist/chunks/{pty-handoff-vyas3vgt.js → contract-vyas3vgt.js} +0 -0
  65. /package/dist/chunks/{pty-handoff-xgnj2w4v.js → contract-xgnj2w4v.js} +0 -0
  66. /package/dist/chunks/{pty-handoff-y2etg5bs.js → contract-y2etg5bs.js} +0 -0
  67. /package/dist/chunks/{pty-handoff-ydhz1zrh.js → contract-ydhz1zrh.js} +0 -0
@@ -62,6 +62,9 @@ export declare const make: (options?: {
62
62
  };
63
63
  readonly tz: string;
64
64
  readonly if?: {
65
+ readonly type: "code";
66
+ readonly code: string;
67
+ } | {
65
68
  readonly type: "shell";
66
69
  readonly run: string;
67
70
  readonly is?: string | undefined;
@@ -69,6 +72,9 @@ export declare const make: (options?: {
69
72
  readonly changes?: boolean | undefined;
70
73
  } | undefined;
71
74
  readonly until?: {
75
+ readonly type: "code";
76
+ readonly code: string;
77
+ } | {
72
78
  readonly type: "shell";
73
79
  readonly run: string;
74
80
  readonly is?: string | undefined;
@@ -116,6 +122,9 @@ export declare const make: (options?: {
116
122
  };
117
123
  readonly tz: string;
118
124
  readonly if?: {
125
+ readonly type: "code";
126
+ readonly code: string;
127
+ } | {
119
128
  readonly type: "shell";
120
129
  readonly run: string;
121
130
  readonly is?: string | undefined;
@@ -123,6 +132,9 @@ export declare const make: (options?: {
123
132
  readonly changes?: boolean | undefined;
124
133
  } | undefined;
125
134
  readonly until?: {
135
+ readonly type: "code";
136
+ readonly code: string;
137
+ } | {
126
138
  readonly type: "shell";
127
139
  readonly run: string;
128
140
  readonly is?: string | undefined;
@@ -169,6 +181,9 @@ export declare const make: (options?: {
169
181
  };
170
182
  readonly tz: string;
171
183
  readonly if?: {
184
+ readonly type: "code";
185
+ readonly code: string;
186
+ } | {
172
187
  readonly type: "shell";
173
188
  readonly run: string;
174
189
  readonly is?: string | undefined;
@@ -176,6 +191,9 @@ export declare const make: (options?: {
176
191
  readonly changes?: boolean | undefined;
177
192
  } | undefined;
178
193
  readonly until?: {
194
+ readonly type: "code";
195
+ readonly code: string;
196
+ } | {
179
197
  readonly type: "shell";
180
198
  readonly run: string;
181
199
  readonly is?: string | undefined;
@@ -222,6 +240,9 @@ export declare const make: (options?: {
222
240
  };
223
241
  readonly tz: string;
224
242
  readonly if?: {
243
+ readonly type: "code";
244
+ readonly code: string;
245
+ } | {
225
246
  readonly type: "shell";
226
247
  readonly run: string;
227
248
  readonly is?: string | undefined;
@@ -229,6 +250,9 @@ export declare const make: (options?: {
229
250
  readonly changes?: boolean | undefined;
230
251
  } | undefined;
231
252
  readonly until?: {
253
+ readonly type: "code";
254
+ readonly code: string;
255
+ } | {
232
256
  readonly type: "shell";
233
257
  readonly run: string;
234
258
  readonly is?: string | undefined;
@@ -1,8 +1,8 @@
1
1
  import {
2
- make4
3
- } from "../../chunks/pty-handoff-bb4rz2ry.js";
4
- import"../../chunks/pty-handoff-y2etg5bs.js";
5
- import"../../chunks/pty-handoff-60xe5cbf.js";
2
+ make3
3
+ } from "../../chunks/contract-gxr0nf8c.js";
4
+ import"../../chunks/contract-y2etg5bs.js";
5
+ import"../../chunks/contract-60xe5cbf.js";
6
6
  export {
7
- make4 as make
7
+ make3 as make
8
8
  };
@@ -1,11 +1,11 @@
1
- import"../../chunks/pty-handoff-6mptkzbc.js";
1
+ import"../../chunks/contract-6mptkzbc.js";
2
2
  import {
3
3
  exports_client2
4
- } from "../../chunks/pty-handoff-bb4rz2ry.js";
4
+ } from "../../chunks/contract-gxr0nf8c.js";
5
5
  import {
6
6
  ClientError2
7
- } from "../../chunks/pty-handoff-y2etg5bs.js";
8
- import"../../chunks/pty-handoff-60xe5cbf.js";
7
+ } from "../../chunks/contract-y2etg5bs.js";
8
+ import"../../chunks/contract-60xe5cbf.js";
9
9
  export {
10
10
  ClientError2 as ClientError,
11
11
  exports_client2 as OpenCode
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  ClientError2
3
- } from "../chunks/pty-handoff-y2etg5bs.js";
4
- import"../chunks/pty-handoff-60xe5cbf.js";
5
- import"../chunks/pty-handoff-bb4rz2ry.js";
6
- import"../chunks/pty-handoff-6mptkzbc.js";
7
- import"../chunks/pty-handoff-gecjxyvt.js";
8
- import"../chunks/pty-handoff-ryy6kscr.js";
9
- import"../chunks/pty-handoff-15p82y03.js";
3
+ } from "../chunks/contract-y2etg5bs.js";
4
+ import"../chunks/contract-60xe5cbf.js";
5
+ import"../chunks/contract-gxr0nf8c.js";
6
+ import"../chunks/contract-6mptkzbc.js";
7
+ import"../chunks/contract-gecjxyvt.js";
8
+ import"../chunks/contract-ryy6kscr.js";
9
+ import"../chunks/contract-9j12j8xw.js";
10
10
  import {
11
11
  exports_client
12
- } from "../chunks/pty-handoff-5d2vkjb7.js";
12
+ } from "../chunks/contract-bhbt909k.js";
13
13
 
14
14
  // src/effect/index.ts
15
15
  import { Agent } from "@opencode/schema/agent";
@@ -1,11 +1,11 @@
1
1
  import {
2
- make3,
2
+ make4,
3
3
  aborted2,
4
4
  exports_rpc
5
- } from "../chunks/pty-handoff-15p82y03.js";
6
- import"../chunks/pty-handoff-ryy6kscr.js";
5
+ } from "../chunks/contract-9j12j8xw.js";
6
+ import"../chunks/contract-ryy6kscr.js";
7
7
  export {
8
8
  exports_rpc as RpcClientRuntime,
9
9
  aborted2 as aborted,
10
- make3 as make
10
+ make4 as make
11
11
  };
@@ -1,28 +1,28 @@
1
1
  import {
2
2
  spawnServiceContender2,
3
3
  contenderPool2
4
- } from "../chunks/pty-handoff-ve4aws36.js";
4
+ } from "../chunks/contract-ve4aws36.js";
5
5
  import {
6
6
  defaultEnsureTiming2,
7
7
  ensureTiming2
8
- } from "../chunks/pty-handoff-xgnj2w4v.js";
8
+ } from "../chunks/contract-xgnj2w4v.js";
9
9
  import {
10
10
  matchesVersion2
11
- } from "../chunks/pty-handoff-sxt88q69.js";
11
+ } from "../chunks/contract-sxt88q69.js";
12
12
  import {
13
13
  decide2,
14
14
  fallback2,
15
15
  same2,
16
16
  probeResult2,
17
17
  headers2
18
- } from "../chunks/pty-handoff-8ye1ye6f.js";
18
+ } from "../chunks/contract-2ny4vxct.js";
19
19
  import {
20
20
  prepare2,
21
21
  environment2,
22
22
  complete2,
23
23
  clear2
24
- } from "../chunks/pty-handoff-pgwvv4px.js";
25
- import"../chunks/pty-handoff-qav6mfdz.js";
24
+ } from "../chunks/contract-gcmv0c13.js";
25
+ import"../chunks/contract-qav6mfdz.js";
26
26
 
27
27
  // src/effect/service.ts
28
28
  import { Effect, FileSystem, Option, Schedule, Schema } from "effect";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  make5,
3
3
  exports_client3
4
- } from "../chunks/pty-handoff-wcnmkks2.js";
5
- import"../chunks/pty-handoff-kdshn947.js";
6
- import"../chunks/pty-handoff-vyas3vgt.js";
7
- import"../chunks/pty-handoff-0e3ghr9a.js";
8
- import"../chunks/pty-handoff-nwcpakzx.js";
9
- import"../chunks/pty-handoff-cvg5j6d1.js";
10
- import"../chunks/pty-handoff-gecjxyvt.js";
4
+ } from "../chunks/contract-gmh1mc73.js";
5
+ import"../chunks/contract-vyas3vgt.js";
6
+ import"../chunks/contract-0e3ghr9a.js";
7
+ import"../chunks/contract-nwcpakzx.js";
8
+ import"../chunks/contract-gecjxyvt.js";
9
+ import"../chunks/contract-kdshn947.js";
10
+ import"../chunks/contract-cvg5j6d1.js";
11
11
  export {
12
12
  exports_client3 as OpenCode,
13
13
  make5 as make
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ClientError3
3
- } from "../../chunks/pty-handoff-nwcpakzx.js";
3
+ } from "../../chunks/contract-nwcpakzx.js";
4
4
  export {
5
5
  ClientError3 as ClientError
6
6
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  make6
3
- } from "../../chunks/pty-handoff-0e3ghr9a.js";
4
- import"../../chunks/pty-handoff-nwcpakzx.js";
3
+ } from "../../chunks/contract-0e3ghr9a.js";
4
+ import"../../chunks/contract-nwcpakzx.js";
5
5
  export {
6
6
  make6 as make
7
7
  };
@@ -1,10 +1,10 @@
1
- import"../../chunks/pty-handoff-vyas3vgt.js";
1
+ import"../../chunks/contract-vyas3vgt.js";
2
2
  import {
3
3
  exports_client4
4
- } from "../../chunks/pty-handoff-0e3ghr9a.js";
4
+ } from "../../chunks/contract-0e3ghr9a.js";
5
5
  import {
6
6
  ClientError3
7
- } from "../../chunks/pty-handoff-nwcpakzx.js";
7
+ } from "../../chunks/contract-nwcpakzx.js";
8
8
  import {
9
9
  isInvalidRequestError2,
10
10
  isUnauthorizedError2,
@@ -45,7 +45,7 @@ import {
45
45
  isShellNotFoundError2,
46
46
  isWorktreeError2,
47
47
  isVcsInitNotSupportedError2
48
- } from "../../chunks/pty-handoff-cvg5j6d1.js";
48
+ } from "../../chunks/contract-cvg5j6d1.js";
49
49
  export {
50
50
  ClientError3 as ClientError,
51
51
  exports_client4 as OpenCode,
@@ -485,6 +485,10 @@ export type ScheduleConditionShell = {
485
485
  matches?: string;
486
486
  changes?: boolean;
487
487
  };
488
+ export type ScheduleConditionCode = {
489
+ type: "code";
490
+ code: string;
491
+ };
488
492
  export type ScheduleActionPrompt = {
489
493
  type: "prompt";
490
494
  prompt: string;
@@ -1224,7 +1228,7 @@ export type ScheduleWhenEvery = {
1224
1228
  every: ScheduleDuration;
1225
1229
  tz?: string;
1226
1230
  };
1227
- export type ScheduleCondition = ScheduleConditionShell;
1231
+ export type ScheduleCondition = ScheduleConditionShell | ScheduleConditionCode;
1228
1232
  export type ScheduleAction = ScheduleActionPrompt;
1229
1233
  export type VcsInfo = {
1230
1234
  provider?: string;
@@ -3162,7 +3166,7 @@ export type ConfigEntry = {
3162
3166
  timezone?: string;
3163
3167
  permissions?: PermissionRuleset;
3164
3168
  policies?: Array<{
3165
- action: "provider.use" | "tool.use" | "integration.use";
3169
+ action: "provider.use" | "tool.use" | "integration.connect" | "integration.use" | "mcp.use" | "skill.use" | "plugin.use";
3166
3170
  resource: string;
3167
3171
  effect: "allow" | "deny";
3168
3172
  }>;
@@ -3419,7 +3423,7 @@ export type ConfigEntry = {
3419
3423
  subagent_depth?: number;
3420
3424
  location_idle_timeout?: string | false;
3421
3425
  policies?: Array<{
3422
- action: "provider.use" | "tool.use" | "integration.use";
3426
+ action: "provider.use" | "tool.use" | "integration.connect" | "integration.use" | "mcp.use" | "skill.use" | "plugin.use";
3423
3427
  resource: string;
3424
3428
  effect: "allow" | "deny";
3425
3429
  }>;
@@ -5398,18 +5402,32 @@ export type ExperimentalScheduleCreateInput = {
5398
5402
  readonly every?: never;
5399
5403
  readonly tz?: string;
5400
5404
  }) | undefined;
5401
- readonly if?: {
5405
+ readonly if?: ({
5402
5406
  readonly run: string;
5403
5407
  readonly is?: string;
5404
5408
  readonly matches?: string;
5405
5409
  readonly changes?: boolean;
5406
- } | undefined;
5407
- readonly until?: {
5410
+ readonly code?: never;
5411
+ } | {
5412
+ readonly code: string;
5413
+ readonly run?: never;
5414
+ readonly is?: never;
5415
+ readonly matches?: never;
5416
+ readonly changes?: never;
5417
+ }) | undefined;
5418
+ readonly until?: ({
5408
5419
  readonly run: string;
5409
5420
  readonly is?: string;
5410
5421
  readonly matches?: string;
5411
5422
  readonly changes?: boolean;
5412
- } | undefined;
5423
+ readonly code?: never;
5424
+ } | {
5425
+ readonly code: string;
5426
+ readonly run?: never;
5427
+ readonly is?: never;
5428
+ readonly matches?: never;
5429
+ readonly changes?: never;
5430
+ }) | undefined;
5413
5431
  readonly ends?: {
5414
5432
  readonly after?: string;
5415
5433
  readonly at?: string;
@@ -38,7 +38,7 @@ import {
38
38
  isShellNotFoundError2,
39
39
  isWorktreeError2,
40
40
  isVcsInitNotSupportedError2
41
- } from "../../chunks/pty-handoff-cvg5j6d1.js";
41
+ } from "../../chunks/contract-cvg5j6d1.js";
42
42
  export {
43
43
  isAgentNotFoundError2 as isAgentNotFoundError,
44
44
  isCommandExecutionError2 as isCommandExecutionError,
@@ -1,6 +1,7 @@
1
1
  import type { OpenCode } from "./client.js";
2
2
  export * from "./generated/index.js";
3
3
  export { OpenCode } from "./client.js";
4
+ export { mediaHashFromUri, withMediaRefs, type MediaRequestOptions } from "./media.js";
4
5
  export type { AgentApi, CommandApi, ConfigApi, EventApi, IntegrationApi, ModelApi, PluginApi, ProviderApi, ReferenceApi, RpcApi, RpcCallOptions, RpcClient, RpcEventPayload, WebSearchApi, SessionApi, SkillApi, } from "./api.js";
5
6
  export type { EventSubscribeOutput as OpenCodeEvent } from "./generated/types.js";
6
7
  export type { MediaFileAttachment as PromptMediaFileAttachment, Attachment as PromptAttachment, } from "@opencode/schema/prompt";
@@ -1,13 +1,18 @@
1
- import"../chunks/pty-handoff-m2eywc8w.js";
1
+ import"../chunks/contract-6r38tsk5.js";
2
+ import {
3
+ mediaHashFromUri2,
4
+ withMediaRefs2
5
+ } from "../chunks/contract-mwrzahmf.js";
2
6
  import {
3
7
  exports_client3
4
- } from "../chunks/pty-handoff-wcnmkks2.js";
5
- import"../chunks/pty-handoff-kdshn947.js";
6
- import"../chunks/pty-handoff-vyas3vgt.js";
7
- import"../chunks/pty-handoff-0e3ghr9a.js";
8
+ } from "../chunks/contract-gmh1mc73.js";
9
+ import"../chunks/contract-vyas3vgt.js";
10
+ import"../chunks/contract-0e3ghr9a.js";
8
11
  import {
9
12
  ClientError3
10
- } from "../chunks/pty-handoff-nwcpakzx.js";
13
+ } from "../chunks/contract-nwcpakzx.js";
14
+ import"../chunks/contract-gecjxyvt.js";
15
+ import"../chunks/contract-kdshn947.js";
11
16
  import {
12
17
  isInvalidRequestError2,
13
18
  isUnauthorizedError2,
@@ -48,8 +53,7 @@ import {
48
53
  isShellNotFoundError2,
49
54
  isWorktreeError2,
50
55
  isVcsInitNotSupportedError2
51
- } from "../chunks/pty-handoff-cvg5j6d1.js";
52
- import"../chunks/pty-handoff-gecjxyvt.js";
56
+ } from "../chunks/contract-cvg5j6d1.js";
53
57
  export {
54
58
  ClientError3 as ClientError,
55
59
  exports_client3 as OpenCode,
@@ -91,5 +95,7 @@ export {
91
95
  isUnknownError2 as isUnknownError,
92
96
  isUnsupportedModelError2 as isUnsupportedModelError,
93
97
  isVcsInitNotSupportedError2 as isVcsInitNotSupportedError,
94
- isWorktreeError2 as isWorktreeError
98
+ isWorktreeError2 as isWorktreeError,
99
+ mediaHashFromUri2 as mediaHashFromUri,
100
+ withMediaRefs2 as withMediaRefs
95
101
  };