@opencode/ai 2.0.20 → 2.0.21

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.
@@ -133,7 +133,14 @@ declare const OpenRouterBody: Schema.StructWithRest<Schema.Struct<{
133
133
  }>]>>]>;
134
134
  }>, Schema.StructWithRest<Schema.Struct<{
135
135
  readonly role: Schema.Literal<"assistant">;
136
- readonly content: Schema.NullOr<Schema.String>;
136
+ readonly content: Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Struct<{
137
+ readonly type: Schema.Literal<"text">;
138
+ readonly text: Schema.String;
139
+ readonly cache_control: Schema.optional<Schema.Struct<{
140
+ readonly type: Schema.Literal<"ephemeral">;
141
+ readonly ttl: Schema.optional<Schema.String>;
142
+ }>>;
143
+ }>>]>>;
137
144
  readonly tool_calls: Schema.optional<Schema.$Array<Schema.Struct<{
138
145
  readonly id: Schema.String;
139
146
  readonly type: Schema.tag<"function">;
@@ -151,18 +158,17 @@ declare const OpenRouterBody: Schema.StructWithRest<Schema.Struct<{
151
158
  readonly reasoning: Schema.optional<Schema.String>;
152
159
  readonly reasoning_text: Schema.optional<Schema.String>;
153
160
  readonly reasoning_details: Schema.optional<Schema.Unknown>;
154
- readonly cache_control: Schema.optional<Schema.Struct<{
155
- readonly type: Schema.Literal<"ephemeral">;
156
- readonly ttl: Schema.optional<Schema.String>;
157
- }>>;
158
161
  }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>, Schema.Struct<{
159
162
  readonly role: Schema.Literal<"tool">;
160
163
  readonly tool_call_id: Schema.String;
161
- readonly content: Schema.String;
162
- readonly cache_control: Schema.optional<Schema.Struct<{
163
- readonly type: Schema.Literal<"ephemeral">;
164
- readonly ttl: Schema.optional<Schema.String>;
165
- }>>;
164
+ readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Struct<{
165
+ readonly type: Schema.Literal<"text">;
166
+ readonly text: Schema.String;
167
+ readonly cache_control: Schema.optional<Schema.Struct<{
168
+ readonly type: Schema.Literal<"ephemeral">;
169
+ readonly ttl: Schema.optional<Schema.String>;
170
+ }>>;
171
+ }>>]>;
166
172
  }>]>>;
167
173
  tools: Schema.optional<Schema.$Array<Schema.Struct<{
168
174
  readonly type: Schema.tag<"function">;
@@ -248,15 +254,18 @@ export declare const protocol: Protocol<{
248
254
  })[];
249
255
  } | {
250
256
  readonly [x: string]: unknown;
251
- readonly content: string | null;
257
+ readonly content: string | readonly {
258
+ readonly type: "text";
259
+ readonly text: string;
260
+ readonly cache_control?: {
261
+ readonly type: "ephemeral";
262
+ readonly ttl?: string | undefined;
263
+ } | undefined;
264
+ }[] | null;
252
265
  readonly role: "assistant";
253
266
  readonly reasoning?: string | undefined;
254
267
  readonly reasoning_content?: string | undefined;
255
268
  readonly reasoning_text?: string | undefined;
256
- readonly cache_control?: {
257
- readonly type: "ephemeral";
258
- readonly ttl?: string | undefined;
259
- } | undefined;
260
269
  readonly tool_calls?: readonly {
261
270
  readonly function: {
262
271
  readonly name: string;
@@ -272,13 +281,16 @@ export declare const protocol: Protocol<{
272
281
  }[] | undefined;
273
282
  readonly reasoning_details?: unknown;
274
283
  } | {
275
- readonly content: string;
276
284
  readonly role: "tool";
277
285
  readonly tool_call_id: string;
278
- readonly cache_control?: {
279
- readonly type: "ephemeral";
280
- readonly ttl?: string | undefined;
281
- } | undefined;
286
+ readonly content: string | readonly {
287
+ readonly type: "text";
288
+ readonly text: string;
289
+ readonly cache_control?: {
290
+ readonly type: "ephemeral";
291
+ readonly ttl?: string | undefined;
292
+ } | undefined;
293
+ }[];
282
294
  })[];
283
295
  readonly stream: true;
284
296
  readonly max_completion_tokens?: number | undefined;
@@ -433,15 +445,18 @@ export declare const route: Route<{
433
445
  })[];
434
446
  } | {
435
447
  readonly [x: string]: unknown;
436
- readonly content: string | null;
448
+ readonly content: string | readonly {
449
+ readonly type: "text";
450
+ readonly text: string;
451
+ readonly cache_control?: {
452
+ readonly type: "ephemeral";
453
+ readonly ttl?: string | undefined;
454
+ } | undefined;
455
+ }[] | null;
437
456
  readonly role: "assistant";
438
457
  readonly reasoning?: string | undefined;
439
458
  readonly reasoning_content?: string | undefined;
440
459
  readonly reasoning_text?: string | undefined;
441
- readonly cache_control?: {
442
- readonly type: "ephemeral";
443
- readonly ttl?: string | undefined;
444
- } | undefined;
445
460
  readonly tool_calls?: readonly {
446
461
  readonly function: {
447
462
  readonly name: string;
@@ -457,13 +472,16 @@ export declare const route: Route<{
457
472
  }[] | undefined;
458
473
  readonly reasoning_details?: unknown;
459
474
  } | {
460
- readonly content: string;
461
475
  readonly role: "tool";
462
476
  readonly tool_call_id: string;
463
- readonly cache_control?: {
464
- readonly type: "ephemeral";
465
- readonly ttl?: string | undefined;
466
- } | undefined;
477
+ readonly content: string | readonly {
478
+ readonly type: "text";
479
+ readonly text: string;
480
+ readonly cache_control?: {
481
+ readonly type: "ephemeral";
482
+ readonly ttl?: string | undefined;
483
+ } | undefined;
484
+ }[];
467
485
  })[];
468
486
  readonly stream: true;
469
487
  readonly max_completion_tokens?: number | undefined;
@@ -550,15 +568,18 @@ export declare const routes: Route<{
550
568
  })[];
551
569
  } | {
552
570
  readonly [x: string]: unknown;
553
- readonly content: string | null;
571
+ readonly content: string | readonly {
572
+ readonly type: "text";
573
+ readonly text: string;
574
+ readonly cache_control?: {
575
+ readonly type: "ephemeral";
576
+ readonly ttl?: string | undefined;
577
+ } | undefined;
578
+ }[] | null;
554
579
  readonly role: "assistant";
555
580
  readonly reasoning?: string | undefined;
556
581
  readonly reasoning_content?: string | undefined;
557
582
  readonly reasoning_text?: string | undefined;
558
- readonly cache_control?: {
559
- readonly type: "ephemeral";
560
- readonly ttl?: string | undefined;
561
- } | undefined;
562
583
  readonly tool_calls?: readonly {
563
584
  readonly function: {
564
585
  readonly name: string;
@@ -574,13 +595,16 @@ export declare const routes: Route<{
574
595
  }[] | undefined;
575
596
  readonly reasoning_details?: unknown;
576
597
  } | {
577
- readonly content: string;
578
598
  readonly role: "tool";
579
599
  readonly tool_call_id: string;
580
- readonly cache_control?: {
581
- readonly type: "ephemeral";
582
- readonly ttl?: string | undefined;
583
- } | undefined;
600
+ readonly content: string | readonly {
601
+ readonly type: "text";
602
+ readonly text: string;
603
+ readonly cache_control?: {
604
+ readonly type: "ephemeral";
605
+ readonly ttl?: string | undefined;
606
+ } | undefined;
607
+ }[];
584
608
  })[];
585
609
  readonly stream: true;
586
610
  readonly max_completion_tokens?: number | undefined;
@@ -58,15 +58,18 @@ export declare const route: Route<{
58
58
  })[];
59
59
  } | {
60
60
  readonly [x: string]: unknown;
61
- readonly content: string | null;
61
+ readonly content: string | readonly {
62
+ readonly type: "text";
63
+ readonly text: string;
64
+ readonly cache_control?: {
65
+ readonly type: "ephemeral";
66
+ readonly ttl?: string | undefined;
67
+ } | undefined;
68
+ }[] | null;
62
69
  readonly role: "assistant";
63
70
  readonly reasoning?: string | undefined;
64
71
  readonly reasoning_content?: string | undefined;
65
72
  readonly reasoning_text?: string | undefined;
66
- readonly cache_control?: {
67
- readonly type: "ephemeral";
68
- readonly ttl?: string | undefined;
69
- } | undefined;
70
73
  readonly tool_calls?: readonly {
71
74
  readonly function: {
72
75
  readonly name: string;
@@ -82,13 +85,16 @@ export declare const route: Route<{
82
85
  }[] | undefined;
83
86
  readonly reasoning_details?: unknown;
84
87
  } | {
85
- readonly content: string;
86
88
  readonly role: "tool";
87
89
  readonly tool_call_id: string;
88
- readonly cache_control?: {
89
- readonly type: "ephemeral";
90
- readonly ttl?: string | undefined;
91
- } | undefined;
90
+ readonly content: string | readonly {
91
+ readonly type: "text";
92
+ readonly text: string;
93
+ readonly cache_control?: {
94
+ readonly type: "ephemeral";
95
+ readonly ttl?: string | undefined;
96
+ } | undefined;
97
+ }[];
92
98
  })[];
93
99
  readonly stream: true;
94
100
  readonly max_completion_tokens?: number | undefined;
@@ -174,15 +180,18 @@ export declare const routes: Route<{
174
180
  })[];
175
181
  } | {
176
182
  readonly [x: string]: unknown;
177
- readonly content: string | null;
183
+ readonly content: string | readonly {
184
+ readonly type: "text";
185
+ readonly text: string;
186
+ readonly cache_control?: {
187
+ readonly type: "ephemeral";
188
+ readonly ttl?: string | undefined;
189
+ } | undefined;
190
+ }[] | null;
178
191
  readonly role: "assistant";
179
192
  readonly reasoning?: string | undefined;
180
193
  readonly reasoning_content?: string | undefined;
181
194
  readonly reasoning_text?: string | undefined;
182
- readonly cache_control?: {
183
- readonly type: "ephemeral";
184
- readonly ttl?: string | undefined;
185
- } | undefined;
186
195
  readonly tool_calls?: readonly {
187
196
  readonly function: {
188
197
  readonly name: string;
@@ -198,13 +207,16 @@ export declare const routes: Route<{
198
207
  }[] | undefined;
199
208
  readonly reasoning_details?: unknown;
200
209
  } | {
201
- readonly content: string;
202
210
  readonly role: "tool";
203
211
  readonly tool_call_id: string;
204
- readonly cache_control?: {
205
- readonly type: "ephemeral";
206
- readonly ttl?: string | undefined;
207
- } | undefined;
212
+ readonly content: string | readonly {
213
+ readonly type: "text";
214
+ readonly text: string;
215
+ readonly cache_control?: {
216
+ readonly type: "ephemeral";
217
+ readonly ttl?: string | undefined;
218
+ } | undefined;
219
+ }[];
208
220
  })[];
209
221
  readonly stream: true;
210
222
  readonly max_completion_tokens?: number | undefined;
@@ -66,15 +66,18 @@ export declare const routes: (Route<{
66
66
  })[];
67
67
  } | {
68
68
  readonly [x: string]: unknown;
69
- readonly content: string | null;
69
+ readonly content: string | readonly {
70
+ readonly type: "text";
71
+ readonly text: string;
72
+ readonly cache_control?: {
73
+ readonly type: "ephemeral";
74
+ readonly ttl?: string | undefined;
75
+ } | undefined;
76
+ }[] | null;
70
77
  readonly role: "assistant";
71
78
  readonly reasoning?: string | undefined;
72
79
  readonly reasoning_content?: string | undefined;
73
80
  readonly reasoning_text?: string | undefined;
74
- readonly cache_control?: {
75
- readonly type: "ephemeral";
76
- readonly ttl?: string | undefined;
77
- } | undefined;
78
81
  readonly tool_calls?: readonly {
79
82
  readonly function: {
80
83
  readonly name: string;
@@ -90,13 +93,16 @@ export declare const routes: (Route<{
90
93
  }[] | undefined;
91
94
  readonly reasoning_details?: unknown;
92
95
  } | {
93
- readonly content: string;
94
96
  readonly role: "tool";
95
97
  readonly tool_call_id: string;
96
- readonly cache_control?: {
97
- readonly type: "ephemeral";
98
- readonly ttl?: string | undefined;
99
- } | undefined;
98
+ readonly content: string | readonly {
99
+ readonly type: "text";
100
+ readonly text: string;
101
+ readonly cache_control?: {
102
+ readonly type: "ephemeral";
103
+ readonly ttl?: string | undefined;
104
+ } | undefined;
105
+ }[];
100
106
  })[];
101
107
  readonly stream: true;
102
108
  readonly max_completion_tokens?: number | undefined;
@@ -230,15 +230,18 @@ export declare const routes: (Route<{
230
230
  })[];
231
231
  } | {
232
232
  readonly [x: string]: unknown;
233
- readonly content: string | null;
233
+ readonly content: string | readonly {
234
+ readonly type: "text";
235
+ readonly text: string;
236
+ readonly cache_control?: {
237
+ readonly type: "ephemeral";
238
+ readonly ttl?: string | undefined;
239
+ } | undefined;
240
+ }[] | null;
234
241
  readonly role: "assistant";
235
242
  readonly reasoning?: string | undefined;
236
243
  readonly reasoning_content?: string | undefined;
237
244
  readonly reasoning_text?: string | undefined;
238
- readonly cache_control?: {
239
- readonly type: "ephemeral";
240
- readonly ttl?: string | undefined;
241
- } | undefined;
242
245
  readonly tool_calls?: readonly {
243
246
  readonly function: {
244
247
  readonly name: string;
@@ -254,13 +257,16 @@ export declare const routes: (Route<{
254
257
  }[] | undefined;
255
258
  readonly reasoning_details?: unknown;
256
259
  } | {
257
- readonly content: string;
258
260
  readonly role: "tool";
259
261
  readonly tool_call_id: string;
260
- readonly cache_control?: {
261
- readonly type: "ephemeral";
262
- readonly ttl?: string | undefined;
263
- } | undefined;
262
+ readonly content: string | readonly {
263
+ readonly type: "text";
264
+ readonly text: string;
265
+ readonly cache_control?: {
266
+ readonly type: "ephemeral";
267
+ readonly ttl?: string | undefined;
268
+ } | undefined;
269
+ }[];
264
270
  })[];
265
271
  readonly stream: true;
266
272
  readonly max_completion_tokens?: number | undefined;
@@ -60,15 +60,18 @@ export declare const routes: Route<{
60
60
  })[];
61
61
  } | {
62
62
  readonly [x: string]: unknown;
63
- readonly content: string | null;
63
+ readonly content: string | readonly {
64
+ readonly type: "text";
65
+ readonly text: string;
66
+ readonly cache_control?: {
67
+ readonly type: "ephemeral";
68
+ readonly ttl?: string | undefined;
69
+ } | undefined;
70
+ }[] | null;
64
71
  readonly role: "assistant";
65
72
  readonly reasoning?: string | undefined;
66
73
  readonly reasoning_content?: string | undefined;
67
74
  readonly reasoning_text?: string | undefined;
68
- readonly cache_control?: {
69
- readonly type: "ephemeral";
70
- readonly ttl?: string | undefined;
71
- } | undefined;
72
75
  readonly tool_calls?: readonly {
73
76
  readonly function: {
74
77
  readonly name: string;
@@ -84,13 +87,16 @@ export declare const routes: Route<{
84
87
  }[] | undefined;
85
88
  readonly reasoning_details?: unknown;
86
89
  } | {
87
- readonly content: string;
88
90
  readonly role: "tool";
89
91
  readonly tool_call_id: string;
90
- readonly cache_control?: {
91
- readonly type: "ephemeral";
92
- readonly ttl?: string | undefined;
93
- } | undefined;
92
+ readonly content: string | readonly {
93
+ readonly type: "text";
94
+ readonly text: string;
95
+ readonly cache_control?: {
96
+ readonly type: "ephemeral";
97
+ readonly ttl?: string | undefined;
98
+ } | undefined;
99
+ }[];
94
100
  })[];
95
101
  readonly stream: true;
96
102
  readonly max_completion_tokens?: number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "2.0.20",
3
+ "version": "2.0.21",
4
4
  "name": "@opencode/ai",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "devDependencies": {
35
35
  "@clack/prompts": "1.0.0-alpha.1",
36
36
  "@effect/platform-node": "4.0.0-rc.112",
37
- "@opencode/http-recorder": "2.0.20",
37
+ "@opencode/http-recorder": "2.0.21",
38
38
  "@tsconfig/bun": "1.0.9",
39
39
  "@types/bun": "1.4.0",
40
40
  "@typescript/native-preview": "7.0.0-dev.20251207.1",
@@ -44,7 +44,7 @@
44
44
  "@aws-sdk/credential-providers": "3.1057.0",
45
45
  "@smithy/eventstream-codec": "4.2.14",
46
46
  "@smithy/util-utf8": "4.2.2",
47
- "@opencode/schema": "2.0.20",
47
+ "@opencode/schema": "2.0.21",
48
48
  "aws4fetch": "1.0.20",
49
49
  "effect": "4.0.0-rc.112",
50
50
  "google-auth-library": "10.5.0"