@opencode-ai/ai 0.0.0-next-16255 → 0.0.0-next-16273

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 (42) hide show
  1. package/dist/llm.d.ts +60 -60
  2. package/dist/protocols/anthropic-messages.d.ts +303 -303
  3. package/dist/protocols/anthropic-messages.js +1 -0
  4. package/dist/protocols/bedrock-converse.d.ts +246 -242
  5. package/dist/protocols/gemini.d.ts +136 -132
  6. package/dist/protocols/gemini.js +1 -0
  7. package/dist/protocols/open-responses.d.ts +232 -232
  8. package/dist/protocols/openai-chat.d.ts +147 -141
  9. package/dist/protocols/openai-chat.js +1 -0
  10. package/dist/protocols/openai-compatible-chat.d.ts +48 -46
  11. package/dist/protocols/openai-compatible-responses.d.ts +56 -56
  12. package/dist/protocols/openai-responses.d.ts +388 -388
  13. package/dist/protocols/shared.d.ts +5 -4
  14. package/dist/protocols/shared.js +1 -0
  15. package/dist/protocols/utils/bedrock-media.d.ts +10 -10
  16. package/dist/protocols/utils/tool-stream.d.ts +180 -180
  17. package/dist/providers/amazon-bedrock.d.ts +109 -107
  18. package/dist/providers/anthropic-compatible.d.ts +145 -145
  19. package/dist/providers/anthropic.d.ts +145 -145
  20. package/dist/providers/azure.d.ts +112 -110
  21. package/dist/providers/cloudflare.d.ts +144 -138
  22. package/dist/providers/github-copilot.d.ts +112 -110
  23. package/dist/providers/google-vertex-chat.d.ts +48 -46
  24. package/dist/providers/google-vertex-messages.d.ts +145 -146
  25. package/dist/providers/google-vertex-responses.d.ts +56 -56
  26. package/dist/providers/google-vertex.d.ts +52 -50
  27. package/dist/providers/google.d.ts +52 -50
  28. package/dist/providers/openai-compatible-responses.d.ts +56 -56
  29. package/dist/providers/openai-compatible.d.ts +48 -46
  30. package/dist/providers/openai.d.ts +176 -174
  31. package/dist/providers/openrouter.d.ts +147 -141
  32. package/dist/providers/xai.d.ts +112 -110
  33. package/dist/route/client.d.ts +60 -60
  34. package/dist/schema/errors.d.ts +2 -6
  35. package/dist/schema/errors.js +2 -5
  36. package/dist/schema/events.d.ts +1117 -1115
  37. package/dist/schema/messages.d.ts +9 -9
  38. package/dist/schema/messages.js +3 -4
  39. package/dist/tool-runtime.js +1 -1
  40. package/dist/tool.d.ts +5 -4
  41. package/dist/tool.js +1 -0
  42. package/package.json +5 -5
@@ -211,139 +211,139 @@ export type AnthropicMessagesBody = Schema.Schema.Type<typeof AnthropicMessagesB
211
211
  * (once registered) Vertex Anthropic / Bedrock-hosted Anthropic passthrough.
212
212
  */
213
213
  export declare const protocol: Protocol<{
214
- readonly messages: readonly (Schema.Struct.ReadonlySide<{
215
- readonly role: Schema.Literal<"user">;
216
- readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
217
- readonly type: Schema.tag<"text">;
218
- readonly text: Schema.String;
219
- readonly cache_control: Schema.optional<Schema.Struct<{
220
- readonly type: Schema.tag<"ephemeral">;
221
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
222
- }>>;
223
- }>, Schema.Struct<{
224
- readonly type: Schema.tag<"image">;
225
- readonly source: Schema.Struct<{
226
- readonly type: Schema.tag<"base64">;
227
- readonly media_type: Schema.String;
228
- readonly data: Schema.String;
229
- }>;
230
- readonly cache_control: Schema.optional<Schema.Struct<{
231
- readonly type: Schema.tag<"ephemeral">;
232
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
233
- }>>;
234
- }>, Schema.Struct<{
235
- readonly type: Schema.tag<"document">;
236
- readonly source: Schema.Struct<{
237
- readonly type: Schema.tag<"base64">;
238
- readonly media_type: Schema.Literal<"application/pdf">;
239
- readonly data: Schema.String;
240
- }>;
241
- readonly cache_control: Schema.optional<Schema.Struct<{
242
- readonly type: Schema.tag<"ephemeral">;
243
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
244
- }>>;
245
- }>, Schema.Struct<{
246
- readonly type: Schema.tag<"tool_result">;
247
- readonly tool_use_id: Schema.String;
248
- readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
249
- readonly type: Schema.tag<"text">;
250
- readonly text: Schema.String;
251
- readonly cache_control: Schema.optional<Schema.Struct<{
252
- readonly type: Schema.tag<"ephemeral">;
253
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
254
- }>>;
255
- }>, Schema.Struct<{
256
- readonly type: Schema.tag<"image">;
257
- readonly source: Schema.Struct<{
258
- readonly type: Schema.tag<"base64">;
259
- readonly media_type: Schema.String;
260
- readonly data: Schema.String;
261
- }>;
262
- readonly cache_control: Schema.optional<Schema.Struct<{
263
- readonly type: Schema.tag<"ephemeral">;
264
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
265
- }>>;
266
- }>, Schema.Struct<{
267
- readonly type: Schema.tag<"document">;
268
- readonly source: Schema.Struct<{
269
- readonly type: Schema.tag<"base64">;
270
- readonly media_type: Schema.Literal<"application/pdf">;
271
- readonly data: Schema.String;
272
- }>;
273
- readonly cache_control: Schema.optional<Schema.Struct<{
274
- readonly type: Schema.tag<"ephemeral">;
275
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
276
- }>>;
277
- }>]>>]>;
278
- readonly is_error: Schema.optional<Schema.Boolean>;
279
- readonly cache_control: Schema.optional<Schema.Struct<{
280
- readonly type: Schema.tag<"ephemeral">;
281
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
282
- }>>;
283
- }>]>>;
284
- }, "Type"> | Schema.Struct.ReadonlySide<{
285
- readonly role: Schema.Literal<"assistant">;
286
- readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
287
- readonly type: Schema.tag<"text">;
288
- readonly text: Schema.String;
289
- readonly cache_control: Schema.optional<Schema.Struct<{
290
- readonly type: Schema.tag<"ephemeral">;
291
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
292
- }>>;
293
- }>, Schema.Struct<{
294
- readonly type: Schema.tag<"thinking">;
295
- readonly thinking: Schema.String;
296
- readonly signature: Schema.optional<Schema.String>;
297
- readonly cache_control: Schema.optional<Schema.Struct<{
298
- readonly type: Schema.tag<"ephemeral">;
299
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
300
- }>>;
301
- }>, Schema.Struct<{
302
- readonly type: Schema.tag<"redacted_thinking">;
303
- readonly data: Schema.String;
304
- readonly cache_control: Schema.optional<Schema.Struct<{
305
- readonly type: Schema.tag<"ephemeral">;
306
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
307
- }>>;
308
- }>, Schema.Struct<{
309
- readonly type: Schema.tag<"tool_use">;
310
- readonly id: Schema.String;
311
- readonly name: Schema.String;
312
- readonly input: Schema.Unknown;
313
- readonly cache_control: Schema.optional<Schema.Struct<{
314
- readonly type: Schema.tag<"ephemeral">;
315
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
316
- }>>;
317
- }>, Schema.Struct<{
318
- readonly type: Schema.tag<"server_tool_use">;
319
- readonly id: Schema.String;
320
- readonly name: Schema.String;
321
- readonly input: Schema.Unknown;
322
- readonly cache_control: Schema.optional<Schema.Struct<{
323
- readonly type: Schema.tag<"ephemeral">;
324
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
325
- }>>;
326
- }>, Schema.Struct<{
327
- readonly type: Schema.Literals<readonly ["web_search_tool_result", "code_execution_tool_result", "web_fetch_tool_result"]>;
328
- readonly tool_use_id: Schema.String;
329
- readonly content: Schema.Unknown;
330
- readonly cache_control: Schema.optional<Schema.Struct<{
331
- readonly type: Schema.tag<"ephemeral">;
332
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
333
- }>>;
334
- }>]>>;
335
- }, "Type"> | Schema.Struct.ReadonlySide<{
336
- readonly role: Schema.Literal<"system">;
337
- readonly content: Schema.$Array<Schema.Struct<{
338
- readonly type: Schema.tag<"text">;
339
- readonly text: Schema.String;
340
- readonly cache_control: Schema.optional<Schema.Struct<{
341
- readonly type: Schema.tag<"ephemeral">;
342
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
343
- }>>;
344
- }>>;
345
- }, "Type">)[];
346
214
  readonly model: string;
215
+ readonly messages: readonly ({
216
+ readonly role: "user";
217
+ readonly content: readonly ({
218
+ readonly type: "text";
219
+ readonly text: string;
220
+ readonly cache_control?: {
221
+ readonly type: "ephemeral";
222
+ readonly ttl?: "1h" | "5m" | undefined;
223
+ } | undefined;
224
+ } | {
225
+ readonly type: "image";
226
+ readonly source: {
227
+ readonly type: "base64";
228
+ readonly media_type: string;
229
+ readonly data: string;
230
+ };
231
+ readonly cache_control?: {
232
+ readonly type: "ephemeral";
233
+ readonly ttl?: "1h" | "5m" | undefined;
234
+ } | undefined;
235
+ } | {
236
+ readonly type: "document";
237
+ readonly source: {
238
+ readonly type: "base64";
239
+ readonly media_type: "application/pdf";
240
+ readonly data: string;
241
+ };
242
+ readonly cache_control?: {
243
+ readonly type: "ephemeral";
244
+ readonly ttl?: "1h" | "5m" | undefined;
245
+ } | undefined;
246
+ } | {
247
+ readonly type: "tool_result";
248
+ readonly content: string | readonly ({
249
+ readonly type: "text";
250
+ readonly text: string;
251
+ readonly cache_control?: {
252
+ readonly type: "ephemeral";
253
+ readonly ttl?: "1h" | "5m" | undefined;
254
+ } | undefined;
255
+ } | {
256
+ readonly type: "image";
257
+ readonly source: {
258
+ readonly type: "base64";
259
+ readonly media_type: string;
260
+ readonly data: string;
261
+ };
262
+ readonly cache_control?: {
263
+ readonly type: "ephemeral";
264
+ readonly ttl?: "1h" | "5m" | undefined;
265
+ } | undefined;
266
+ } | {
267
+ readonly type: "document";
268
+ readonly source: {
269
+ readonly type: "base64";
270
+ readonly media_type: "application/pdf";
271
+ readonly data: string;
272
+ };
273
+ readonly cache_control?: {
274
+ readonly type: "ephemeral";
275
+ readonly ttl?: "1h" | "5m" | undefined;
276
+ } | undefined;
277
+ })[];
278
+ readonly tool_use_id: string;
279
+ readonly cache_control?: {
280
+ readonly type: "ephemeral";
281
+ readonly ttl?: "1h" | "5m" | undefined;
282
+ } | undefined;
283
+ readonly is_error?: boolean | undefined;
284
+ })[];
285
+ } | {
286
+ readonly role: "assistant";
287
+ readonly content: readonly ({
288
+ readonly type: "text";
289
+ readonly text: string;
290
+ readonly cache_control?: {
291
+ readonly type: "ephemeral";
292
+ readonly ttl?: "1h" | "5m" | undefined;
293
+ } | undefined;
294
+ } | {
295
+ readonly id: string;
296
+ readonly type: "tool_use";
297
+ readonly name: string;
298
+ readonly input: unknown;
299
+ readonly cache_control?: {
300
+ readonly type: "ephemeral";
301
+ readonly ttl?: "1h" | "5m" | undefined;
302
+ } | undefined;
303
+ } | {
304
+ readonly id: string;
305
+ readonly type: "server_tool_use";
306
+ readonly name: string;
307
+ readonly input: unknown;
308
+ readonly cache_control?: {
309
+ readonly type: "ephemeral";
310
+ readonly ttl?: "1h" | "5m" | undefined;
311
+ } | undefined;
312
+ } | {
313
+ readonly type: "web_search_tool_result" | "code_execution_tool_result" | "web_fetch_tool_result";
314
+ readonly content: unknown;
315
+ readonly tool_use_id: string;
316
+ readonly cache_control?: {
317
+ readonly type: "ephemeral";
318
+ readonly ttl?: "1h" | "5m" | undefined;
319
+ } | undefined;
320
+ } | {
321
+ readonly type: "thinking";
322
+ readonly thinking: string;
323
+ readonly cache_control?: {
324
+ readonly type: "ephemeral";
325
+ readonly ttl?: "1h" | "5m" | undefined;
326
+ } | undefined;
327
+ readonly signature?: string | undefined;
328
+ } | {
329
+ readonly data: string;
330
+ readonly type: "redacted_thinking";
331
+ readonly cache_control?: {
332
+ readonly type: "ephemeral";
333
+ readonly ttl?: "1h" | "5m" | undefined;
334
+ } | undefined;
335
+ })[];
336
+ } | {
337
+ readonly role: "system";
338
+ readonly content: readonly {
339
+ readonly type: "text";
340
+ readonly text: string;
341
+ readonly cache_control?: {
342
+ readonly type: "ephemeral";
343
+ readonly ttl?: "1h" | "5m" | undefined;
344
+ } | undefined;
345
+ }[];
346
+ })[];
347
347
  readonly stream: true;
348
348
  readonly max_tokens: number;
349
349
  readonly system?: readonly {
@@ -367,21 +367,21 @@ export declare const protocol: Protocol<{
367
367
  }[] | undefined;
368
368
  readonly temperature?: number | undefined;
369
369
  readonly stop_sequences?: readonly string[] | undefined;
370
- readonly thinking?: Schema.Struct.ReadonlySide<{
371
- readonly type: Schema.tag<"enabled">;
372
- readonly budget_tokens: Schema.Number;
373
- }, "Type"> | {
370
+ readonly thinking?: {
371
+ readonly type: "enabled";
372
+ readonly budget_tokens: number;
373
+ } | {
374
374
  readonly type: "adaptive";
375
375
  readonly display?: "summarized" | "omitted" | undefined;
376
- } | Schema.Struct.ReadonlySide<{
377
- readonly type: Schema.tag<"disabled">;
378
- }, "Type"> | undefined;
379
- readonly tool_choice?: Schema.Struct.ReadonlySide<{
380
- readonly type: Schema.Literals<readonly ["auto", "any", "none"]>;
381
- }, "Type"> | Schema.Struct.ReadonlySide<{
382
- readonly type: Schema.tag<"tool">;
383
- readonly name: Schema.String;
384
- }, "Type"> | undefined;
376
+ } | {
377
+ readonly type: "disabled";
378
+ } | undefined;
379
+ readonly tool_choice?: {
380
+ readonly type: "none" | "auto" | "any";
381
+ } | {
382
+ readonly type: "tool";
383
+ readonly name: string;
384
+ } | undefined;
385
385
  readonly top_k?: number | undefined;
386
386
  readonly top_p?: number | undefined;
387
387
  readonly output_config?: {
@@ -410,6 +410,15 @@ export declare const protocol: Protocol<{
410
410
  } | null | undefined;
411
411
  } | undefined;
412
412
  } | undefined;
413
+ readonly delta?: {
414
+ readonly type?: string | undefined;
415
+ readonly text?: string | undefined;
416
+ readonly thinking?: string | undefined;
417
+ readonly signature?: string | undefined;
418
+ readonly partial_json?: string | undefined;
419
+ readonly stop_reason?: string | null | undefined;
420
+ readonly stop_sequence?: string | null | undefined;
421
+ } | undefined;
413
422
  readonly index?: number | undefined;
414
423
  readonly usage?: {
415
424
  readonly [x: string]: unknown;
@@ -428,164 +437,155 @@ export declare const protocol: Protocol<{
428
437
  } | undefined;
429
438
  readonly content_block?: {
430
439
  readonly type: string;
431
- readonly text?: string | undefined;
432
- readonly name?: string | undefined;
433
- readonly data?: string | undefined;
434
- readonly content?: unknown;
435
440
  readonly id?: string | undefined;
441
+ readonly data?: string | undefined;
442
+ readonly name?: string | undefined;
443
+ readonly text?: string | undefined;
436
444
  readonly input?: unknown;
445
+ readonly content?: unknown;
437
446
  readonly thinking?: string | undefined;
438
447
  readonly signature?: string | undefined;
439
448
  readonly tool_use_id?: string | undefined;
440
449
  } | undefined;
441
- readonly delta?: {
442
- readonly type?: string | undefined;
443
- readonly text?: string | undefined;
444
- readonly thinking?: string | undefined;
445
- readonly signature?: string | undefined;
446
- readonly partial_json?: string | undefined;
447
- readonly stop_reason?: string | null | undefined;
448
- readonly stop_sequence?: string | null | undefined;
449
- } | undefined;
450
450
  }, {
451
451
  tools: Partial<Record<number, ToolStream.PendingTool>>;
452
452
  reasoningSignatures: {};
453
453
  lifecycle: Lifecycle.State;
454
454
  }>;
455
455
  export declare const route: Route<{
456
- readonly messages: readonly (Schema.Struct.ReadonlySide<{
457
- readonly role: Schema.Literal<"user">;
458
- readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
459
- readonly type: Schema.tag<"text">;
460
- readonly text: Schema.String;
461
- readonly cache_control: Schema.optional<Schema.Struct<{
462
- readonly type: Schema.tag<"ephemeral">;
463
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
464
- }>>;
465
- }>, Schema.Struct<{
466
- readonly type: Schema.tag<"image">;
467
- readonly source: Schema.Struct<{
468
- readonly type: Schema.tag<"base64">;
469
- readonly media_type: Schema.String;
470
- readonly data: Schema.String;
471
- }>;
472
- readonly cache_control: Schema.optional<Schema.Struct<{
473
- readonly type: Schema.tag<"ephemeral">;
474
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
475
- }>>;
476
- }>, Schema.Struct<{
477
- readonly type: Schema.tag<"document">;
478
- readonly source: Schema.Struct<{
479
- readonly type: Schema.tag<"base64">;
480
- readonly media_type: Schema.Literal<"application/pdf">;
481
- readonly data: Schema.String;
482
- }>;
483
- readonly cache_control: Schema.optional<Schema.Struct<{
484
- readonly type: Schema.tag<"ephemeral">;
485
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
486
- }>>;
487
- }>, Schema.Struct<{
488
- readonly type: Schema.tag<"tool_result">;
489
- readonly tool_use_id: Schema.String;
490
- readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
491
- readonly type: Schema.tag<"text">;
492
- readonly text: Schema.String;
493
- readonly cache_control: Schema.optional<Schema.Struct<{
494
- readonly type: Schema.tag<"ephemeral">;
495
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
496
- }>>;
497
- }>, Schema.Struct<{
498
- readonly type: Schema.tag<"image">;
499
- readonly source: Schema.Struct<{
500
- readonly type: Schema.tag<"base64">;
501
- readonly media_type: Schema.String;
502
- readonly data: Schema.String;
503
- }>;
504
- readonly cache_control: Schema.optional<Schema.Struct<{
505
- readonly type: Schema.tag<"ephemeral">;
506
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
507
- }>>;
508
- }>, Schema.Struct<{
509
- readonly type: Schema.tag<"document">;
510
- readonly source: Schema.Struct<{
511
- readonly type: Schema.tag<"base64">;
512
- readonly media_type: Schema.Literal<"application/pdf">;
513
- readonly data: Schema.String;
514
- }>;
515
- readonly cache_control: Schema.optional<Schema.Struct<{
516
- readonly type: Schema.tag<"ephemeral">;
517
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
518
- }>>;
519
- }>]>>]>;
520
- readonly is_error: Schema.optional<Schema.Boolean>;
521
- readonly cache_control: Schema.optional<Schema.Struct<{
522
- readonly type: Schema.tag<"ephemeral">;
523
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
524
- }>>;
525
- }>]>>;
526
- }, "Type"> | Schema.Struct.ReadonlySide<{
527
- readonly role: Schema.Literal<"assistant">;
528
- readonly content: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
529
- readonly type: Schema.tag<"text">;
530
- readonly text: Schema.String;
531
- readonly cache_control: Schema.optional<Schema.Struct<{
532
- readonly type: Schema.tag<"ephemeral">;
533
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
534
- }>>;
535
- }>, Schema.Struct<{
536
- readonly type: Schema.tag<"thinking">;
537
- readonly thinking: Schema.String;
538
- readonly signature: Schema.optional<Schema.String>;
539
- readonly cache_control: Schema.optional<Schema.Struct<{
540
- readonly type: Schema.tag<"ephemeral">;
541
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
542
- }>>;
543
- }>, Schema.Struct<{
544
- readonly type: Schema.tag<"redacted_thinking">;
545
- readonly data: Schema.String;
546
- readonly cache_control: Schema.optional<Schema.Struct<{
547
- readonly type: Schema.tag<"ephemeral">;
548
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
549
- }>>;
550
- }>, Schema.Struct<{
551
- readonly type: Schema.tag<"tool_use">;
552
- readonly id: Schema.String;
553
- readonly name: Schema.String;
554
- readonly input: Schema.Unknown;
555
- readonly cache_control: Schema.optional<Schema.Struct<{
556
- readonly type: Schema.tag<"ephemeral">;
557
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
558
- }>>;
559
- }>, Schema.Struct<{
560
- readonly type: Schema.tag<"server_tool_use">;
561
- readonly id: Schema.String;
562
- readonly name: Schema.String;
563
- readonly input: Schema.Unknown;
564
- readonly cache_control: Schema.optional<Schema.Struct<{
565
- readonly type: Schema.tag<"ephemeral">;
566
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
567
- }>>;
568
- }>, Schema.Struct<{
569
- readonly type: Schema.Literals<readonly ["web_search_tool_result", "code_execution_tool_result", "web_fetch_tool_result"]>;
570
- readonly tool_use_id: Schema.String;
571
- readonly content: Schema.Unknown;
572
- readonly cache_control: Schema.optional<Schema.Struct<{
573
- readonly type: Schema.tag<"ephemeral">;
574
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
575
- }>>;
576
- }>]>>;
577
- }, "Type"> | Schema.Struct.ReadonlySide<{
578
- readonly role: Schema.Literal<"system">;
579
- readonly content: Schema.$Array<Schema.Struct<{
580
- readonly type: Schema.tag<"text">;
581
- readonly text: Schema.String;
582
- readonly cache_control: Schema.optional<Schema.Struct<{
583
- readonly type: Schema.tag<"ephemeral">;
584
- readonly ttl: Schema.optional<Schema.Literals<readonly ["5m", "1h"]>>;
585
- }>>;
586
- }>>;
587
- }, "Type">)[];
588
456
  readonly model: string;
457
+ readonly messages: readonly ({
458
+ readonly role: "user";
459
+ readonly content: readonly ({
460
+ readonly type: "text";
461
+ readonly text: string;
462
+ readonly cache_control?: {
463
+ readonly type: "ephemeral";
464
+ readonly ttl?: "1h" | "5m" | undefined;
465
+ } | undefined;
466
+ } | {
467
+ readonly type: "image";
468
+ readonly source: {
469
+ readonly type: "base64";
470
+ readonly media_type: string;
471
+ readonly data: string;
472
+ };
473
+ readonly cache_control?: {
474
+ readonly type: "ephemeral";
475
+ readonly ttl?: "1h" | "5m" | undefined;
476
+ } | undefined;
477
+ } | {
478
+ readonly type: "document";
479
+ readonly source: {
480
+ readonly type: "base64";
481
+ readonly media_type: "application/pdf";
482
+ readonly data: string;
483
+ };
484
+ readonly cache_control?: {
485
+ readonly type: "ephemeral";
486
+ readonly ttl?: "1h" | "5m" | undefined;
487
+ } | undefined;
488
+ } | {
489
+ readonly type: "tool_result";
490
+ readonly content: string | readonly ({
491
+ readonly type: "text";
492
+ readonly text: string;
493
+ readonly cache_control?: {
494
+ readonly type: "ephemeral";
495
+ readonly ttl?: "1h" | "5m" | undefined;
496
+ } | undefined;
497
+ } | {
498
+ readonly type: "image";
499
+ readonly source: {
500
+ readonly type: "base64";
501
+ readonly media_type: string;
502
+ readonly data: string;
503
+ };
504
+ readonly cache_control?: {
505
+ readonly type: "ephemeral";
506
+ readonly ttl?: "1h" | "5m" | undefined;
507
+ } | undefined;
508
+ } | {
509
+ readonly type: "document";
510
+ readonly source: {
511
+ readonly type: "base64";
512
+ readonly media_type: "application/pdf";
513
+ readonly data: string;
514
+ };
515
+ readonly cache_control?: {
516
+ readonly type: "ephemeral";
517
+ readonly ttl?: "1h" | "5m" | undefined;
518
+ } | undefined;
519
+ })[];
520
+ readonly tool_use_id: string;
521
+ readonly cache_control?: {
522
+ readonly type: "ephemeral";
523
+ readonly ttl?: "1h" | "5m" | undefined;
524
+ } | undefined;
525
+ readonly is_error?: boolean | undefined;
526
+ })[];
527
+ } | {
528
+ readonly role: "assistant";
529
+ readonly content: readonly ({
530
+ readonly type: "text";
531
+ readonly text: string;
532
+ readonly cache_control?: {
533
+ readonly type: "ephemeral";
534
+ readonly ttl?: "1h" | "5m" | undefined;
535
+ } | undefined;
536
+ } | {
537
+ readonly id: string;
538
+ readonly type: "tool_use";
539
+ readonly name: string;
540
+ readonly input: unknown;
541
+ readonly cache_control?: {
542
+ readonly type: "ephemeral";
543
+ readonly ttl?: "1h" | "5m" | undefined;
544
+ } | undefined;
545
+ } | {
546
+ readonly id: string;
547
+ readonly type: "server_tool_use";
548
+ readonly name: string;
549
+ readonly input: unknown;
550
+ readonly cache_control?: {
551
+ readonly type: "ephemeral";
552
+ readonly ttl?: "1h" | "5m" | undefined;
553
+ } | undefined;
554
+ } | {
555
+ readonly type: "web_search_tool_result" | "code_execution_tool_result" | "web_fetch_tool_result";
556
+ readonly content: unknown;
557
+ readonly tool_use_id: string;
558
+ readonly cache_control?: {
559
+ readonly type: "ephemeral";
560
+ readonly ttl?: "1h" | "5m" | undefined;
561
+ } | undefined;
562
+ } | {
563
+ readonly type: "thinking";
564
+ readonly thinking: string;
565
+ readonly cache_control?: {
566
+ readonly type: "ephemeral";
567
+ readonly ttl?: "1h" | "5m" | undefined;
568
+ } | undefined;
569
+ readonly signature?: string | undefined;
570
+ } | {
571
+ readonly data: string;
572
+ readonly type: "redacted_thinking";
573
+ readonly cache_control?: {
574
+ readonly type: "ephemeral";
575
+ readonly ttl?: "1h" | "5m" | undefined;
576
+ } | undefined;
577
+ })[];
578
+ } | {
579
+ readonly role: "system";
580
+ readonly content: readonly {
581
+ readonly type: "text";
582
+ readonly text: string;
583
+ readonly cache_control?: {
584
+ readonly type: "ephemeral";
585
+ readonly ttl?: "1h" | "5m" | undefined;
586
+ } | undefined;
587
+ }[];
588
+ })[];
589
589
  readonly stream: true;
590
590
  readonly max_tokens: number;
591
591
  readonly system?: readonly {
@@ -609,21 +609,21 @@ export declare const route: Route<{
609
609
  }[] | undefined;
610
610
  readonly temperature?: number | undefined;
611
611
  readonly stop_sequences?: readonly string[] | undefined;
612
- readonly thinking?: Schema.Struct.ReadonlySide<{
613
- readonly type: Schema.tag<"enabled">;
614
- readonly budget_tokens: Schema.Number;
615
- }, "Type"> | {
612
+ readonly thinking?: {
613
+ readonly type: "enabled";
614
+ readonly budget_tokens: number;
615
+ } | {
616
616
  readonly type: "adaptive";
617
617
  readonly display?: "summarized" | "omitted" | undefined;
618
- } | Schema.Struct.ReadonlySide<{
619
- readonly type: Schema.tag<"disabled">;
620
- }, "Type"> | undefined;
621
- readonly tool_choice?: Schema.Struct.ReadonlySide<{
622
- readonly type: Schema.Literals<readonly ["auto", "any", "none"]>;
623
- }, "Type"> | Schema.Struct.ReadonlySide<{
624
- readonly type: Schema.tag<"tool">;
625
- readonly name: Schema.String;
626
- }, "Type"> | undefined;
618
+ } | {
619
+ readonly type: "disabled";
620
+ } | undefined;
621
+ readonly tool_choice?: {
622
+ readonly type: "none" | "auto" | "any";
623
+ } | {
624
+ readonly type: "tool";
625
+ readonly name: string;
626
+ } | undefined;
627
627
  readonly top_k?: number | undefined;
628
628
  readonly top_p?: number | undefined;
629
629
  readonly output_config?: {
@@ -1,4 +1,5 @@
1
1
  import { Effect, Schema } from "effect";
2
+ import { Tool } from "@opencode-ai/schema/tool";
2
3
  import { Route } from "../route/client";
3
4
  import { Auth } from "../route/auth";
4
5
  import { Endpoint } from "../route/endpoint";