@opencode/ai 2.0.13 → 2.0.15

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 (86) hide show
  1. package/README.md +115 -56
  2. package/dist/experimental/evaluation-client.d.ts +1 -1
  3. package/dist/experimental/evaluation-client.js +39 -3
  4. package/dist/experimental/evaluation.d.ts +4 -4
  5. package/dist/experimental/evaluation.js +2 -2
  6. package/dist/experimental/system-one.d.ts +3 -3
  7. package/dist/experimental/system-one.js +40 -51
  8. package/dist/generation.d.ts +69 -0
  9. package/dist/generation.js +84 -0
  10. package/dist/image-client.d.ts +6 -4
  11. package/dist/image-client.js +11 -11
  12. package/dist/image.d.ts +1040 -62
  13. package/dist/image.js +80 -52
  14. package/dist/index.d.ts +5 -2
  15. package/dist/index.js +3 -1
  16. package/dist/llm.d.ts +9 -1
  17. package/dist/media.d.ts +212 -0
  18. package/dist/media.js +228 -0
  19. package/dist/promise.d.ts +554 -0
  20. package/dist/promise.js +44 -0
  21. package/dist/protocols/anthropic-messages.js +7 -17
  22. package/dist/protocols/bedrock-converse.d.ts +4 -4
  23. package/dist/protocols/bedrock-converse.js +1 -6
  24. package/dist/protocols/gemini.d.ts +21 -0
  25. package/dist/protocols/gemini.js +42 -6
  26. package/dist/protocols/google-images.d.ts +9 -21
  27. package/dist/protocols/google-images.js +169 -132
  28. package/dist/protocols/meta-images.d.ts +7 -12
  29. package/dist/protocols/meta-images.js +92 -66
  30. package/dist/protocols/mistral-chat.js +7 -6
  31. package/dist/protocols/open-responses.d.ts +11 -3
  32. package/dist/protocols/open-responses.js +23 -12
  33. package/dist/protocols/openai-chat.d.ts +34 -1
  34. package/dist/protocols/openai-chat.js +100 -31
  35. package/dist/protocols/openai-images.d.ts +9 -20
  36. package/dist/protocols/openai-images.js +112 -142
  37. package/dist/protocols/shared.d.ts +17 -17
  38. package/dist/protocols/shared.js +32 -35
  39. package/dist/protocols/utils/bedrock-media.d.ts +2 -3
  40. package/dist/protocols/utils/bedrock-media.js +4 -4
  41. package/dist/protocols/utils/media-input.d.ts +10 -0
  42. package/dist/protocols/utils/media-input.js +17 -0
  43. package/dist/protocols/utils/responses-compaction.js +6 -5
  44. package/dist/protocols/utils/tool-stream.d.ts +27 -3
  45. package/dist/protocols/xai-images.d.ts +9 -15
  46. package/dist/protocols/xai-images.js +85 -83
  47. package/dist/protocols/zai-images.d.ts +9 -13
  48. package/dist/protocols/zai-images.js +59 -57
  49. package/dist/providers/amazon-bedrock.d.ts +2 -2
  50. package/dist/providers/cerebras.js +6 -1
  51. package/dist/providers/deepinfra.js +6 -1
  52. package/dist/providers/google-vertex.d.ts +7 -0
  53. package/dist/providers/google.d.ts +7 -0
  54. package/dist/providers/index.d.ts +1 -0
  55. package/dist/providers/index.js +1 -0
  56. package/dist/providers/openrouter.d.ts +19 -0
  57. package/dist/providers/openrouter.js +13 -1
  58. package/dist/providers/vercel-ai-gateway.d.ts +41 -0
  59. package/dist/providers/vercel-ai-gateway.js +85 -0
  60. package/dist/route/client.d.ts +9 -1
  61. package/dist/route/endpoint.d.ts +10 -10
  62. package/dist/route/executor-service.d.ts +12 -0
  63. package/dist/route/executor-service.js +3 -0
  64. package/dist/route/executor.d.ts +4 -9
  65. package/dist/route/executor.js +3 -3
  66. package/dist/route/index.d.ts +2 -0
  67. package/dist/route/index.js +2 -0
  68. package/dist/route/media-protocol.d.ts +45 -0
  69. package/dist/route/media-protocol.js +40 -0
  70. package/dist/route/media.d.ts +46 -0
  71. package/dist/route/media.js +64 -0
  72. package/dist/schema/errors.d.ts +13 -3
  73. package/dist/schema/errors.js +7 -0
  74. package/dist/schema/events.d.ts +563 -40
  75. package/dist/schema/events.js +35 -2
  76. package/dist/schema/messages.d.ts +98 -8
  77. package/dist/schema/messages.js +8 -6
  78. package/dist/schema/options.d.ts +2 -0
  79. package/dist/schema/options.js +3 -0
  80. package/dist/testing.d.ts +72 -8
  81. package/dist/utils/media-type.d.ts +6 -0
  82. package/dist/utils/media-type.js +49 -0
  83. package/dist/utils/sanitize.js +3 -1
  84. package/package.json +7 -3
  85. package/dist/protocols/utils/image-input.d.ts +0 -21
  86. package/dist/protocols/utils/image-input.js +0 -20
@@ -1,9 +1,10 @@
1
1
  import { Schema } from "effect";
2
2
  import { ContentBlockID, ToolCallID } from "./ids.js";
3
- import { Message, CompactionPart, ProviderMetadata, ToolOutput, ToolResultValue } from "./messages.js";
3
+ import { Message, CompactionPart, ToolOutput, ToolResultValue } from "./messages.js";
4
+ import { ProviderMetadata } from "./options.js";
5
+ import { Media } from "../media.js";
4
6
  export declare const FinishReason: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>;
5
7
  export type FinishReason = Schema.Schema.Type<typeof FinishReason>;
6
- export { ProviderMetadata } from "./messages.js";
7
8
  declare const Usage_base: Schema.Class<Usage, Schema.Struct<{
8
9
  /** Effective input size of the final message iteration, when reported; not billed totals. */
9
10
  readonly contextTokens: Schema.optional<Schema.Number>;
@@ -72,6 +73,30 @@ export declare class Usage extends Usage_base {
72
73
  static from(input: UsageInput): Usage;
73
74
  }
74
75
  export type UsageInput = Usage | ConstructorParameters<typeof Usage>[0];
76
+ /**
77
+ * Usage reported by media routes. Providers bill images, video, speech, and transcription in different units, so
78
+ * each response carries the unit it was actually metered in instead of forcing everything into tokens.
79
+ */
80
+ export declare const MediaUsage: Schema.Union<readonly [Schema.Struct<{
81
+ readonly type: Schema.Literal<"tokens">;
82
+ readonly input: Schema.optional<Schema.Number>;
83
+ readonly output: Schema.optional<Schema.Number>;
84
+ readonly total: Schema.optional<Schema.Number>;
85
+ readonly details: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
86
+ }>, Schema.Struct<{
87
+ readonly type: Schema.Literal<"seconds">;
88
+ readonly seconds: Schema.Number;
89
+ }>, Schema.Struct<{
90
+ readonly type: Schema.Literal<"characters">;
91
+ readonly characters: Schema.Number;
92
+ }>, Schema.Struct<{
93
+ readonly type: Schema.Literal<"credits">;
94
+ readonly credits: Schema.Number;
95
+ }>, Schema.Struct<{
96
+ readonly type: Schema.Literal<"compute">;
97
+ readonly seconds: Schema.Number;
98
+ }>]>;
99
+ export type MediaUsage = Schema.Schema.Type<typeof MediaUsage>;
75
100
  declare const CompactionResponse_base: Schema.Class<CompactionResponse, Schema.Struct<{
76
101
  readonly replacement: Schema.$Array<typeof Message>;
77
102
  readonly usage: Schema.optional<typeof Usage>;
@@ -323,6 +348,44 @@ export declare const Finish: Schema.Struct<{
323
348
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
324
349
  }>;
325
350
  export type Finish = Schema.Schema.Type<typeof Finish>;
351
+ /** A generated media asset (image, audio, …) emitted by the model as first-class output rather than a tool result. */
352
+ export declare const MediaEvent: Schema.Struct<{
353
+ readonly type: Schema.tag<"media">;
354
+ readonly media: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
355
+ readonly source: Schema.Union<readonly [Schema.Struct<{
356
+ readonly type: Schema.Literal<"bytes">;
357
+ readonly data: Schema.Uint8Array;
358
+ readonly mediaType: Schema.String;
359
+ }>, Schema.Struct<{
360
+ readonly type: Schema.Literal<"base64">;
361
+ readonly data: Schema.String;
362
+ readonly mediaType: Schema.String;
363
+ }>, Schema.Struct<{
364
+ readonly type: Schema.Literal<"url">;
365
+ readonly url: Schema.String;
366
+ readonly mediaType: Schema.optional<Schema.String>;
367
+ readonly expiresAt: Schema.optional<Schema.Number>;
368
+ readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
369
+ }>, Schema.Struct<{
370
+ readonly type: Schema.Literal<"ref">;
371
+ readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
372
+ readonly id: Schema.String;
373
+ readonly mediaType: Schema.optional<Schema.String>;
374
+ }>]>;
375
+ readonly info: Schema.optional<Schema.Struct<{
376
+ readonly width: Schema.optional<Schema.Number>;
377
+ readonly height: Schema.optional<Schema.Number>;
378
+ readonly durationSeconds: Schema.optional<Schema.Number>;
379
+ readonly sampleRate: Schema.optional<Schema.Number>;
380
+ readonly channels: Schema.optional<Schema.Number>;
381
+ readonly encoding: Schema.optional<Schema.String>;
382
+ readonly format: Schema.optional<Schema.String>;
383
+ }>>;
384
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
385
+ }>, never, never>;
386
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
387
+ }>;
388
+ export type MediaEvent = Schema.Schema.Type<typeof MediaEvent>;
326
389
  export declare const ProviderErrorEvent: Schema.Struct<{
327
390
  readonly type: Schema.tag<"provider-error">;
328
391
  readonly message: Schema.String;
@@ -499,6 +562,41 @@ declare const llmEventTagged: Schema.toTaggedUnion<"type", readonly [Schema.refi
499
562
  readonly message: Schema.String;
500
563
  readonly error: Schema.optional<Schema.Defect>;
501
564
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
565
+ }>, Schema.Struct<{
566
+ readonly type: Schema.tag<"media">;
567
+ readonly media: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
568
+ readonly source: Schema.Union<readonly [Schema.Struct<{
569
+ readonly type: Schema.Literal<"bytes">;
570
+ readonly data: Schema.Uint8Array;
571
+ readonly mediaType: Schema.String;
572
+ }>, Schema.Struct<{
573
+ readonly type: Schema.Literal<"base64">;
574
+ readonly data: Schema.String;
575
+ readonly mediaType: Schema.String;
576
+ }>, Schema.Struct<{
577
+ readonly type: Schema.Literal<"url">;
578
+ readonly url: Schema.String;
579
+ readonly mediaType: Schema.optional<Schema.String>;
580
+ readonly expiresAt: Schema.optional<Schema.Number>;
581
+ readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
582
+ }>, Schema.Struct<{
583
+ readonly type: Schema.Literal<"ref">;
584
+ readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
585
+ readonly id: Schema.String;
586
+ readonly mediaType: Schema.optional<Schema.String>;
587
+ }>]>;
588
+ readonly info: Schema.optional<Schema.Struct<{
589
+ readonly width: Schema.optional<Schema.Number>;
590
+ readonly height: Schema.optional<Schema.Number>;
591
+ readonly durationSeconds: Schema.optional<Schema.Number>;
592
+ readonly sampleRate: Schema.optional<Schema.Number>;
593
+ readonly channels: Schema.optional<Schema.Number>;
594
+ readonly encoding: Schema.optional<Schema.String>;
595
+ readonly format: Schema.optional<Schema.String>;
596
+ }>>;
597
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
598
+ }>, never, never>;
599
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
502
600
  }>, Schema.Struct<{
503
601
  readonly type: Schema.tag<"step-finish">;
504
602
  readonly index: Schema.Number;
@@ -706,6 +804,41 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
706
804
  readonly message: Schema.String;
707
805
  readonly error: Schema.optional<Schema.Defect>;
708
806
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
807
+ }>, Schema.Struct<{
808
+ readonly type: Schema.tag<"media">;
809
+ readonly media: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
810
+ readonly source: Schema.Union<readonly [Schema.Struct<{
811
+ readonly type: Schema.Literal<"bytes">;
812
+ readonly data: Schema.Uint8Array;
813
+ readonly mediaType: Schema.String;
814
+ }>, Schema.Struct<{
815
+ readonly type: Schema.Literal<"base64">;
816
+ readonly data: Schema.String;
817
+ readonly mediaType: Schema.String;
818
+ }>, Schema.Struct<{
819
+ readonly type: Schema.Literal<"url">;
820
+ readonly url: Schema.String;
821
+ readonly mediaType: Schema.optional<Schema.String>;
822
+ readonly expiresAt: Schema.optional<Schema.Number>;
823
+ readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
824
+ }>, Schema.Struct<{
825
+ readonly type: Schema.Literal<"ref">;
826
+ readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
827
+ readonly id: Schema.String;
828
+ readonly mediaType: Schema.optional<Schema.String>;
829
+ }>]>;
830
+ readonly info: Schema.optional<Schema.Struct<{
831
+ readonly width: Schema.optional<Schema.Number>;
832
+ readonly height: Schema.optional<Schema.Number>;
833
+ readonly durationSeconds: Schema.optional<Schema.Number>;
834
+ readonly sampleRate: Schema.optional<Schema.Number>;
835
+ readonly channels: Schema.optional<Schema.Number>;
836
+ readonly encoding: Schema.optional<Schema.String>;
837
+ readonly format: Schema.optional<Schema.String>;
838
+ }>>;
839
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
840
+ }>, never, never>;
841
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
709
842
  }>, Schema.Struct<{
710
843
  readonly type: Schema.tag<"step-finish">;
711
844
  readonly index: Schema.Number;
@@ -729,7 +862,7 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
729
862
  readonly classification: Schema.optional<Schema.Literals<readonly ["context-overflow", "payload-too-large"]>>;
730
863
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
731
864
  }>]> & {
732
- readonly discriminants: readonly ["compaction", "step-start", "text-start", "text-delta", "text-end", "reasoning-start", "reasoning-delta", "reasoning-end", "tool-input-start", "tool-input-delta", "tool-input-end", "tool-input-error", "tool-call", "tool-result", "tool-error", "step-finish", "finish", "provider-error"];
865
+ readonly discriminants: readonly ["compaction", "step-start", "text-start", "text-delta", "text-end", "reasoning-start", "reasoning-delta", "reasoning-end", "tool-input-start", "tool-input-delta", "tool-input-end", "tool-input-error", "tool-call", "tool-result", "tool-error", "media", "step-finish", "finish", "provider-error"];
733
866
  readonly cases: {
734
867
  compaction: Schema.refine<{
735
868
  readonly type: "compaction";
@@ -915,6 +1048,42 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
915
1048
  readonly error: Schema.optional<Schema.Defect>;
916
1049
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
917
1050
  }>;
1051
+ media: Schema.Struct<{
1052
+ readonly type: Schema.tag<"media">;
1053
+ readonly media: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
1054
+ readonly source: Schema.Union<readonly [Schema.Struct<{
1055
+ readonly type: Schema.Literal<"bytes">;
1056
+ readonly data: Schema.Uint8Array;
1057
+ readonly mediaType: Schema.String;
1058
+ }>, Schema.Struct<{
1059
+ readonly type: Schema.Literal<"base64">;
1060
+ readonly data: Schema.String;
1061
+ readonly mediaType: Schema.String;
1062
+ }>, Schema.Struct<{
1063
+ readonly type: Schema.Literal<"url">;
1064
+ readonly url: Schema.String;
1065
+ readonly mediaType: Schema.optional<Schema.String>;
1066
+ readonly expiresAt: Schema.optional<Schema.Number>;
1067
+ readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
1068
+ }>, Schema.Struct<{
1069
+ readonly type: Schema.Literal<"ref">;
1070
+ readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
1071
+ readonly id: Schema.String;
1072
+ readonly mediaType: Schema.optional<Schema.String>;
1073
+ }>]>;
1074
+ readonly info: Schema.optional<Schema.Struct<{
1075
+ readonly width: Schema.optional<Schema.Number>;
1076
+ readonly height: Schema.optional<Schema.Number>;
1077
+ readonly durationSeconds: Schema.optional<Schema.Number>;
1078
+ readonly sampleRate: Schema.optional<Schema.Number>;
1079
+ readonly channels: Schema.optional<Schema.Number>;
1080
+ readonly encoding: Schema.optional<Schema.String>;
1081
+ readonly format: Schema.optional<Schema.String>;
1082
+ }>>;
1083
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1084
+ }>, never, never>;
1085
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
1086
+ }>;
918
1087
  "step-finish": Schema.Struct<{
919
1088
  readonly type: Schema.tag<"step-finish">;
920
1089
  readonly index: Schema.Number;
@@ -1110,6 +1279,14 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1110
1279
  };
1111
1280
  } | undefined;
1112
1281
  readonly namespace?: string | undefined;
1282
+ } | {
1283
+ readonly type: "media";
1284
+ readonly media: Media.Asset;
1285
+ readonly providerMetadata?: {
1286
+ readonly [x: string]: {
1287
+ readonly [x: string]: unknown;
1288
+ };
1289
+ } | undefined;
1113
1290
  } | {
1114
1291
  readonly type: "step-finish";
1115
1292
  readonly reason: {
@@ -1138,12 +1315,12 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1138
1315
  } | {
1139
1316
  readonly type: "provider-error";
1140
1317
  readonly message: string;
1318
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
1141
1319
  readonly providerMetadata?: {
1142
1320
  readonly [x: string]: {
1143
1321
  readonly [x: string]: unknown;
1144
1322
  };
1145
1323
  } | undefined;
1146
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
1147
1324
  }) => value is Extract<{
1148
1325
  readonly type: "compaction";
1149
1326
  readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
@@ -1351,6 +1528,16 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1351
1528
  readonly namespace?: string | undefined;
1352
1529
  }, {
1353
1530
  readonly type: Keys;
1531
+ }> | Extract<{
1532
+ readonly type: "media";
1533
+ readonly media: Media.Asset;
1534
+ readonly providerMetadata?: {
1535
+ readonly [x: string]: {
1536
+ readonly [x: string]: unknown;
1537
+ };
1538
+ } | undefined;
1539
+ }, {
1540
+ readonly type: Keys;
1354
1541
  }> | Extract<{
1355
1542
  readonly type: "step-finish";
1356
1543
  readonly reason: {
@@ -1383,12 +1570,12 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1383
1570
  }> | Extract<{
1384
1571
  readonly type: "provider-error";
1385
1572
  readonly message: string;
1573
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
1386
1574
  readonly providerMetadata?: {
1387
1575
  readonly [x: string]: {
1388
1576
  readonly [x: string]: unknown;
1389
1577
  };
1390
1578
  } | undefined;
1391
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
1392
1579
  }, {
1393
1580
  readonly type: Keys;
1394
1581
  }>;
@@ -1577,6 +1764,15 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1577
1764
  } | undefined;
1578
1765
  readonly namespace?: string | undefined;
1579
1766
  };
1767
+ media: (u: unknown) => u is {
1768
+ readonly type: "media";
1769
+ readonly media: Media.Asset;
1770
+ readonly providerMetadata?: {
1771
+ readonly [x: string]: {
1772
+ readonly [x: string]: unknown;
1773
+ };
1774
+ } | undefined;
1775
+ };
1580
1776
  "step-finish": (u: unknown) => u is {
1581
1777
  readonly type: "step-finish";
1582
1778
  readonly reason: {
@@ -1607,12 +1803,12 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1607
1803
  "provider-error": (u: unknown) => u is {
1608
1804
  readonly type: "provider-error";
1609
1805
  readonly message: string;
1806
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
1610
1807
  readonly providerMetadata?: {
1611
1808
  readonly [x: string]: {
1612
1809
  readonly [x: string]: unknown;
1613
1810
  };
1614
1811
  } | undefined;
1615
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
1616
1812
  };
1617
1813
  };
1618
1814
  readonly match: {
@@ -1801,6 +1997,15 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1801
1997
  } | undefined;
1802
1998
  readonly namespace?: string | undefined;
1803
1999
  }) => any;
2000
+ media: (value: {
2001
+ readonly type: "media";
2002
+ readonly media: Media.Asset;
2003
+ readonly providerMetadata?: {
2004
+ readonly [x: string]: {
2005
+ readonly [x: string]: unknown;
2006
+ };
2007
+ } | undefined;
2008
+ }) => any;
1804
2009
  "step-finish": (value: {
1805
2010
  readonly type: "step-finish";
1806
2011
  readonly reason: {
@@ -1831,12 +2036,12 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1831
2036
  "provider-error": (value: {
1832
2037
  readonly type: "provider-error";
1833
2038
  readonly message: string;
2039
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
1834
2040
  readonly providerMetadata?: {
1835
2041
  readonly [x: string]: {
1836
2042
  readonly [x: string]: unknown;
1837
2043
  };
1838
2044
  } | undefined;
1839
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
1840
2045
  }) => any;
1841
2046
  }>(value: ({
1842
2047
  readonly type: "compaction";
@@ -2007,6 +2212,14 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2007
2212
  };
2008
2213
  } | undefined;
2009
2214
  readonly namespace?: string | undefined;
2215
+ } | {
2216
+ readonly type: "media";
2217
+ readonly media: Media.Asset;
2218
+ readonly providerMetadata?: {
2219
+ readonly [x: string]: {
2220
+ readonly [x: string]: unknown;
2221
+ };
2222
+ } | undefined;
2010
2223
  } | {
2011
2224
  readonly type: "step-finish";
2012
2225
  readonly reason: {
@@ -2035,12 +2248,12 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2035
2248
  } | {
2036
2249
  readonly type: "provider-error";
2037
2250
  readonly message: string;
2251
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
2038
2252
  readonly providerMetadata?: {
2039
2253
  readonly [x: string]: {
2040
2254
  readonly [x: string]: unknown;
2041
2255
  };
2042
2256
  } | undefined;
2043
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
2044
2257
  }, cases: Cases): Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
2045
2258
  <Cases extends {
2046
2259
  compaction: (value: {
@@ -2227,6 +2440,15 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2227
2440
  } | undefined;
2228
2441
  readonly namespace?: string | undefined;
2229
2442
  }) => any;
2443
+ media: (value: {
2444
+ readonly type: "media";
2445
+ readonly media: Media.Asset;
2446
+ readonly providerMetadata?: {
2447
+ readonly [x: string]: {
2448
+ readonly [x: string]: unknown;
2449
+ };
2450
+ } | undefined;
2451
+ }) => any;
2230
2452
  "step-finish": (value: {
2231
2453
  readonly type: "step-finish";
2232
2454
  readonly reason: {
@@ -2257,12 +2479,12 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2257
2479
  "provider-error": (value: {
2258
2480
  readonly type: "provider-error";
2259
2481
  readonly message: string;
2482
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
2260
2483
  readonly providerMetadata?: {
2261
2484
  readonly [x: string]: {
2262
2485
  readonly [x: string]: unknown;
2263
2486
  };
2264
2487
  } | undefined;
2265
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
2266
2488
  }) => any;
2267
2489
  }>(cases: Cases): (value: ({
2268
2490
  readonly type: "compaction";
@@ -2433,6 +2655,14 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2433
2655
  };
2434
2656
  } | undefined;
2435
2657
  readonly namespace?: string | undefined;
2658
+ } | {
2659
+ readonly type: "media";
2660
+ readonly media: Media.Asset;
2661
+ readonly providerMetadata?: {
2662
+ readonly [x: string]: {
2663
+ readonly [x: string]: unknown;
2664
+ };
2665
+ } | undefined;
2436
2666
  } | {
2437
2667
  readonly type: "step-finish";
2438
2668
  readonly reason: {
@@ -2461,12 +2691,12 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2461
2691
  } | {
2462
2692
  readonly type: "provider-error";
2463
2693
  readonly message: string;
2694
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
2464
2695
  readonly providerMetadata?: {
2465
2696
  readonly [x: string]: {
2466
2697
  readonly [x: string]: unknown;
2467
2698
  };
2468
2699
  } | undefined;
2469
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
2470
2700
  }) => Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
2471
2701
  };
2472
2702
  readonly matchOrElse: {
@@ -2655,6 +2885,15 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2655
2885
  } | undefined;
2656
2886
  readonly namespace?: string | undefined;
2657
2887
  }) => any) | undefined;
2888
+ media?: ((value: {
2889
+ readonly type: "media";
2890
+ readonly media: Media.Asset;
2891
+ readonly providerMetadata?: {
2892
+ readonly [x: string]: {
2893
+ readonly [x: string]: unknown;
2894
+ };
2895
+ } | undefined;
2896
+ }) => any) | undefined;
2658
2897
  "step-finish"?: ((value: {
2659
2898
  readonly type: "step-finish";
2660
2899
  readonly reason: {
@@ -2685,14 +2924,14 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2685
2924
  "provider-error"?: ((value: {
2686
2925
  readonly type: "provider-error";
2687
2926
  readonly message: string;
2927
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
2688
2928
  readonly providerMetadata?: {
2689
2929
  readonly [x: string]: {
2690
2930
  readonly [x: string]: unknown;
2691
2931
  };
2692
2932
  } | undefined;
2693
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
2694
2933
  }) => any) | undefined;
2695
- } & { [K in Exclude<keyof Cases, "compaction" | "finish" | "tool-call" | "tool-result" | "step-start" | "text-start" | "text-delta" | "text-end" | "reasoning-start" | "reasoning-delta" | "reasoning-end" | "tool-input-start" | "tool-input-delta" | "tool-input-end" | "tool-input-error" | "tool-error" | "step-finish" | "provider-error">]: never; }, OrElse extends (value: Exclude<{
2934
+ } & { [K in Exclude<keyof Cases, "compaction" | "finish" | "media" | "tool-call" | "tool-result" | "step-start" | "text-start" | "text-delta" | "text-end" | "reasoning-start" | "reasoning-delta" | "reasoning-end" | "tool-input-start" | "tool-input-delta" | "tool-input-end" | "tool-input-error" | "tool-error" | "step-finish" | "provider-error">]: never; }, OrElse extends (value: Exclude<{
2696
2935
  readonly type: "compaction";
2697
2936
  readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
2698
2937
  readonly id?: string | undefined;
@@ -2899,6 +3138,16 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2899
3138
  readonly namespace?: string | undefined;
2900
3139
  }, {
2901
3140
  readonly type: keyof Cases;
3141
+ }> | Exclude<{
3142
+ readonly type: "media";
3143
+ readonly media: Media.Asset;
3144
+ readonly providerMetadata?: {
3145
+ readonly [x: string]: {
3146
+ readonly [x: string]: unknown;
3147
+ };
3148
+ } | undefined;
3149
+ }, {
3150
+ readonly type: keyof Cases;
2902
3151
  }> | Exclude<{
2903
3152
  readonly type: "step-finish";
2904
3153
  readonly reason: {
@@ -2931,12 +3180,12 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2931
3180
  }> | Exclude<{
2932
3181
  readonly type: "provider-error";
2933
3182
  readonly message: string;
3183
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
2934
3184
  readonly providerMetadata?: {
2935
3185
  readonly [x: string]: {
2936
3186
  readonly [x: string]: unknown;
2937
3187
  };
2938
3188
  } | undefined;
2939
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
2940
3189
  }, {
2941
3190
  readonly type: keyof Cases;
2942
3191
  }>) => any>(value: ({
@@ -3108,6 +3357,14 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3108
3357
  };
3109
3358
  } | undefined;
3110
3359
  readonly namespace?: string | undefined;
3360
+ } | {
3361
+ readonly type: "media";
3362
+ readonly media: Media.Asset;
3363
+ readonly providerMetadata?: {
3364
+ readonly [x: string]: {
3365
+ readonly [x: string]: unknown;
3366
+ };
3367
+ } | undefined;
3111
3368
  } | {
3112
3369
  readonly type: "step-finish";
3113
3370
  readonly reason: {
@@ -3136,12 +3393,12 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3136
3393
  } | {
3137
3394
  readonly type: "provider-error";
3138
3395
  readonly message: string;
3396
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
3139
3397
  readonly providerMetadata?: {
3140
3398
  readonly [x: string]: {
3141
3399
  readonly [x: string]: unknown;
3142
3400
  };
3143
3401
  } | undefined;
3144
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
3145
3402
  }, cases: Cases, orElse: OrElse): import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
3146
3403
  <Cases extends {
3147
3404
  compaction?: ((value: {
@@ -3328,6 +3585,15 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3328
3585
  } | undefined;
3329
3586
  readonly namespace?: string | undefined;
3330
3587
  }) => any) | undefined;
3588
+ media?: ((value: {
3589
+ readonly type: "media";
3590
+ readonly media: Media.Asset;
3591
+ readonly providerMetadata?: {
3592
+ readonly [x: string]: {
3593
+ readonly [x: string]: unknown;
3594
+ };
3595
+ } | undefined;
3596
+ }) => any) | undefined;
3331
3597
  "step-finish"?: ((value: {
3332
3598
  readonly type: "step-finish";
3333
3599
  readonly reason: {
@@ -3358,14 +3624,14 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3358
3624
  "provider-error"?: ((value: {
3359
3625
  readonly type: "provider-error";
3360
3626
  readonly message: string;
3627
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
3361
3628
  readonly providerMetadata?: {
3362
3629
  readonly [x: string]: {
3363
3630
  readonly [x: string]: unknown;
3364
3631
  };
3365
3632
  } | undefined;
3366
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
3367
3633
  }) => any) | undefined;
3368
- } & { [K in Exclude<keyof Cases, "compaction" | "finish" | "tool-call" | "tool-result" | "step-start" | "text-start" | "text-delta" | "text-end" | "reasoning-start" | "reasoning-delta" | "reasoning-end" | "tool-input-start" | "tool-input-delta" | "tool-input-end" | "tool-input-error" | "tool-error" | "step-finish" | "provider-error">]: never; }, OrElse extends (value: Exclude<{
3634
+ } & { [K in Exclude<keyof Cases, "compaction" | "finish" | "media" | "tool-call" | "tool-result" | "step-start" | "text-start" | "text-delta" | "text-end" | "reasoning-start" | "reasoning-delta" | "reasoning-end" | "tool-input-start" | "tool-input-delta" | "tool-input-end" | "tool-input-error" | "tool-error" | "step-finish" | "provider-error">]: never; }, OrElse extends (value: Exclude<{
3369
3635
  readonly type: "compaction";
3370
3636
  readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
3371
3637
  readonly id?: string | undefined;
@@ -3572,6 +3838,16 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3572
3838
  readonly namespace?: string | undefined;
3573
3839
  }, {
3574
3840
  readonly type: keyof Cases;
3841
+ }> | Exclude<{
3842
+ readonly type: "media";
3843
+ readonly media: Media.Asset;
3844
+ readonly providerMetadata?: {
3845
+ readonly [x: string]: {
3846
+ readonly [x: string]: unknown;
3847
+ };
3848
+ } | undefined;
3849
+ }, {
3850
+ readonly type: keyof Cases;
3575
3851
  }> | Exclude<{
3576
3852
  readonly type: "step-finish";
3577
3853
  readonly reason: {
@@ -3604,12 +3880,12 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3604
3880
  }> | Exclude<{
3605
3881
  readonly type: "provider-error";
3606
3882
  readonly message: string;
3883
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
3607
3884
  readonly providerMetadata?: {
3608
3885
  readonly [x: string]: {
3609
3886
  readonly [x: string]: unknown;
3610
3887
  };
3611
3888
  } | undefined;
3612
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
3613
3889
  }, {
3614
3890
  readonly type: keyof Cases;
3615
3891
  }>) => any>(cases: Cases, orElse: OrElse): (value: ({
@@ -3781,6 +4057,14 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3781
4057
  };
3782
4058
  } | undefined;
3783
4059
  readonly namespace?: string | undefined;
4060
+ } | {
4061
+ readonly type: "media";
4062
+ readonly media: Media.Asset;
4063
+ readonly providerMetadata?: {
4064
+ readonly [x: string]: {
4065
+ readonly [x: string]: unknown;
4066
+ };
4067
+ } | undefined;
3784
4068
  } | {
3785
4069
  readonly type: "step-finish";
3786
4070
  readonly reason: {
@@ -3809,12 +4093,12 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3809
4093
  } | {
3810
4094
  readonly type: "provider-error";
3811
4095
  readonly message: string;
4096
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
3812
4097
  readonly providerMetadata?: {
3813
4098
  readonly [x: string]: {
3814
4099
  readonly [x: string]: unknown;
3815
4100
  };
3816
4101
  } | undefined;
3817
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
3818
4102
  }) => import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
3819
4103
  };
3820
4104
  } & {
@@ -4017,6 +4301,23 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
4017
4301
  } | undefined;
4018
4302
  readonly namespace?: string | undefined;
4019
4303
  };
4304
+ media: (input: {
4305
+ readonly media: Media.Asset;
4306
+ readonly type?: "media" | undefined;
4307
+ readonly providerMetadata?: {
4308
+ readonly [x: string]: {
4309
+ readonly [x: string]: unknown;
4310
+ };
4311
+ } | undefined;
4312
+ }, options?: Schema.MakeOptions) => {
4313
+ readonly type: "media";
4314
+ readonly media: Media.Asset;
4315
+ readonly providerMetadata?: {
4316
+ readonly [x: string]: {
4317
+ readonly [x: string]: unknown;
4318
+ };
4319
+ } | undefined;
4320
+ };
4020
4321
  stepFinish: (input: WithUsage<StepFinish>) => {
4021
4322
  readonly type: "step-finish";
4022
4323
  readonly reason: {
@@ -4047,21 +4348,21 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
4047
4348
  providerError: (input: {
4048
4349
  readonly message: string;
4049
4350
  readonly type?: "provider-error" | undefined;
4351
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
4050
4352
  readonly providerMetadata?: {
4051
4353
  readonly [x: string]: {
4052
4354
  readonly [x: string]: unknown;
4053
4355
  };
4054
4356
  } | undefined;
4055
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
4056
4357
  }, options?: Schema.MakeOptions) => {
4057
4358
  readonly type: "provider-error";
4058
4359
  readonly message: string;
4360
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
4059
4361
  readonly providerMetadata?: {
4060
4362
  readonly [x: string]: {
4061
4363
  readonly [x: string]: unknown;
4062
4364
  };
4063
4365
  } | undefined;
4064
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
4065
4366
  };
4066
4367
  is: {
4067
4368
  compaction: (u: unknown) => u is {
@@ -4248,6 +4549,15 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
4248
4549
  } | undefined;
4249
4550
  readonly namespace?: string | undefined;
4250
4551
  };
4552
+ media: (u: unknown) => u is {
4553
+ readonly type: "media";
4554
+ readonly media: Media.Asset;
4555
+ readonly providerMetadata?: {
4556
+ readonly [x: string]: {
4557
+ readonly [x: string]: unknown;
4558
+ };
4559
+ } | undefined;
4560
+ };
4251
4561
  stepFinish: (u: unknown) => u is {
4252
4562
  readonly type: "step-finish";
4253
4563
  readonly reason: {
@@ -4278,12 +4588,12 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
4278
4588
  providerError: (u: unknown) => u is {
4279
4589
  readonly type: "provider-error";
4280
4590
  readonly message: string;
4591
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
4281
4592
  readonly providerMetadata?: {
4282
4593
  readonly [x: string]: {
4283
4594
  readonly [x: string]: unknown;
4284
4595
  };
4285
4596
  } | undefined;
4286
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
4287
4597
  };
4288
4598
  };
4289
4599
  };
@@ -4479,6 +4789,41 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
4479
4789
  readonly message: Schema.String;
4480
4790
  readonly error: Schema.optional<Schema.Defect>;
4481
4791
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
4792
+ }>, Schema.Struct<{
4793
+ readonly type: Schema.tag<"media">;
4794
+ readonly media: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
4795
+ readonly source: Schema.Union<readonly [Schema.Struct<{
4796
+ readonly type: Schema.Literal<"bytes">;
4797
+ readonly data: Schema.Uint8Array;
4798
+ readonly mediaType: Schema.String;
4799
+ }>, Schema.Struct<{
4800
+ readonly type: Schema.Literal<"base64">;
4801
+ readonly data: Schema.String;
4802
+ readonly mediaType: Schema.String;
4803
+ }>, Schema.Struct<{
4804
+ readonly type: Schema.Literal<"url">;
4805
+ readonly url: Schema.String;
4806
+ readonly mediaType: Schema.optional<Schema.String>;
4807
+ readonly expiresAt: Schema.optional<Schema.Number>;
4808
+ readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
4809
+ }>, Schema.Struct<{
4810
+ readonly type: Schema.Literal<"ref">;
4811
+ readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
4812
+ readonly id: Schema.String;
4813
+ readonly mediaType: Schema.optional<Schema.String>;
4814
+ }>]>;
4815
+ readonly info: Schema.optional<Schema.Struct<{
4816
+ readonly width: Schema.optional<Schema.Number>;
4817
+ readonly height: Schema.optional<Schema.Number>;
4818
+ readonly durationSeconds: Schema.optional<Schema.Number>;
4819
+ readonly sampleRate: Schema.optional<Schema.Number>;
4820
+ readonly channels: Schema.optional<Schema.Number>;
4821
+ readonly encoding: Schema.optional<Schema.String>;
4822
+ readonly format: Schema.optional<Schema.String>;
4823
+ }>>;
4824
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
4825
+ }>, never, never>;
4826
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
4482
4827
  }>, Schema.Struct<{
4483
4828
  readonly type: Schema.tag<"step-finish">;
4484
4829
  readonly index: Schema.Number;
@@ -4502,7 +4847,7 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
4502
4847
  readonly classification: Schema.optional<Schema.Literals<readonly ["context-overflow", "payload-too-large"]>>;
4503
4848
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
4504
4849
  }>]> & {
4505
- readonly discriminants: readonly ["compaction", "step-start", "text-start", "text-delta", "text-end", "reasoning-start", "reasoning-delta", "reasoning-end", "tool-input-start", "tool-input-delta", "tool-input-end", "tool-input-error", "tool-call", "tool-result", "tool-error", "step-finish", "finish", "provider-error"];
4850
+ readonly discriminants: readonly ["compaction", "step-start", "text-start", "text-delta", "text-end", "reasoning-start", "reasoning-delta", "reasoning-end", "tool-input-start", "tool-input-delta", "tool-input-end", "tool-input-error", "tool-call", "tool-result", "tool-error", "media", "step-finish", "finish", "provider-error"];
4506
4851
  readonly cases: {
4507
4852
  compaction: Schema.refine<{
4508
4853
  readonly type: "compaction";
@@ -4688,6 +5033,42 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
4688
5033
  readonly error: Schema.optional<Schema.Defect>;
4689
5034
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
4690
5035
  }>;
5036
+ media: Schema.Struct<{
5037
+ readonly type: Schema.tag<"media">;
5038
+ readonly media: Schema.decodeTo<Schema.declare<Media.Asset, Media.Asset>, Schema.Struct<{
5039
+ readonly source: Schema.Union<readonly [Schema.Struct<{
5040
+ readonly type: Schema.Literal<"bytes">;
5041
+ readonly data: Schema.Uint8Array;
5042
+ readonly mediaType: Schema.String;
5043
+ }>, Schema.Struct<{
5044
+ readonly type: Schema.Literal<"base64">;
5045
+ readonly data: Schema.String;
5046
+ readonly mediaType: Schema.String;
5047
+ }>, Schema.Struct<{
5048
+ readonly type: Schema.Literal<"url">;
5049
+ readonly url: Schema.String;
5050
+ readonly mediaType: Schema.optional<Schema.String>;
5051
+ readonly expiresAt: Schema.optional<Schema.Number>;
5052
+ readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
5053
+ }>, Schema.Struct<{
5054
+ readonly type: Schema.Literal<"ref">;
5055
+ readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
5056
+ readonly id: Schema.String;
5057
+ readonly mediaType: Schema.optional<Schema.String>;
5058
+ }>]>;
5059
+ readonly info: Schema.optional<Schema.Struct<{
5060
+ readonly width: Schema.optional<Schema.Number>;
5061
+ readonly height: Schema.optional<Schema.Number>;
5062
+ readonly durationSeconds: Schema.optional<Schema.Number>;
5063
+ readonly sampleRate: Schema.optional<Schema.Number>;
5064
+ readonly channels: Schema.optional<Schema.Number>;
5065
+ readonly encoding: Schema.optional<Schema.String>;
5066
+ readonly format: Schema.optional<Schema.String>;
5067
+ }>>;
5068
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
5069
+ }>, never, never>;
5070
+ readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
5071
+ }>;
4691
5072
  "step-finish": Schema.Struct<{
4692
5073
  readonly type: Schema.tag<"step-finish">;
4693
5074
  readonly index: Schema.Number;
@@ -4883,6 +5264,14 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
4883
5264
  };
4884
5265
  } | undefined;
4885
5266
  readonly namespace?: string | undefined;
5267
+ } | {
5268
+ readonly type: "media";
5269
+ readonly media: Media.Asset;
5270
+ readonly providerMetadata?: {
5271
+ readonly [x: string]: {
5272
+ readonly [x: string]: unknown;
5273
+ };
5274
+ } | undefined;
4886
5275
  } | {
4887
5276
  readonly type: "step-finish";
4888
5277
  readonly reason: {
@@ -4911,12 +5300,12 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
4911
5300
  } | {
4912
5301
  readonly type: "provider-error";
4913
5302
  readonly message: string;
5303
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
4914
5304
  readonly providerMetadata?: {
4915
5305
  readonly [x: string]: {
4916
5306
  readonly [x: string]: unknown;
4917
5307
  };
4918
5308
  } | undefined;
4919
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
4920
5309
  }) => value is Extract<{
4921
5310
  readonly type: "compaction";
4922
5311
  readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
@@ -5124,6 +5513,16 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5124
5513
  readonly namespace?: string | undefined;
5125
5514
  }, {
5126
5515
  readonly type: Keys;
5516
+ }> | Extract<{
5517
+ readonly type: "media";
5518
+ readonly media: Media.Asset;
5519
+ readonly providerMetadata?: {
5520
+ readonly [x: string]: {
5521
+ readonly [x: string]: unknown;
5522
+ };
5523
+ } | undefined;
5524
+ }, {
5525
+ readonly type: Keys;
5127
5526
  }> | Extract<{
5128
5527
  readonly type: "step-finish";
5129
5528
  readonly reason: {
@@ -5156,12 +5555,12 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5156
5555
  }> | Extract<{
5157
5556
  readonly type: "provider-error";
5158
5557
  readonly message: string;
5558
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
5159
5559
  readonly providerMetadata?: {
5160
5560
  readonly [x: string]: {
5161
5561
  readonly [x: string]: unknown;
5162
5562
  };
5163
5563
  } | undefined;
5164
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
5165
5564
  }, {
5166
5565
  readonly type: Keys;
5167
5566
  }>;
@@ -5350,6 +5749,15 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5350
5749
  } | undefined;
5351
5750
  readonly namespace?: string | undefined;
5352
5751
  };
5752
+ media: (u: unknown) => u is {
5753
+ readonly type: "media";
5754
+ readonly media: Media.Asset;
5755
+ readonly providerMetadata?: {
5756
+ readonly [x: string]: {
5757
+ readonly [x: string]: unknown;
5758
+ };
5759
+ } | undefined;
5760
+ };
5353
5761
  "step-finish": (u: unknown) => u is {
5354
5762
  readonly type: "step-finish";
5355
5763
  readonly reason: {
@@ -5380,12 +5788,12 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5380
5788
  "provider-error": (u: unknown) => u is {
5381
5789
  readonly type: "provider-error";
5382
5790
  readonly message: string;
5791
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
5383
5792
  readonly providerMetadata?: {
5384
5793
  readonly [x: string]: {
5385
5794
  readonly [x: string]: unknown;
5386
5795
  };
5387
5796
  } | undefined;
5388
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
5389
5797
  };
5390
5798
  };
5391
5799
  readonly match: {
@@ -5574,6 +5982,15 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5574
5982
  } | undefined;
5575
5983
  readonly namespace?: string | undefined;
5576
5984
  }) => any;
5985
+ media: (value: {
5986
+ readonly type: "media";
5987
+ readonly media: Media.Asset;
5988
+ readonly providerMetadata?: {
5989
+ readonly [x: string]: {
5990
+ readonly [x: string]: unknown;
5991
+ };
5992
+ } | undefined;
5993
+ }) => any;
5577
5994
  "step-finish": (value: {
5578
5995
  readonly type: "step-finish";
5579
5996
  readonly reason: {
@@ -5604,12 +6021,12 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5604
6021
  "provider-error": (value: {
5605
6022
  readonly type: "provider-error";
5606
6023
  readonly message: string;
6024
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
5607
6025
  readonly providerMetadata?: {
5608
6026
  readonly [x: string]: {
5609
6027
  readonly [x: string]: unknown;
5610
6028
  };
5611
6029
  } | undefined;
5612
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
5613
6030
  }) => any;
5614
6031
  }>(value: ({
5615
6032
  readonly type: "compaction";
@@ -5780,6 +6197,14 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5780
6197
  };
5781
6198
  } | undefined;
5782
6199
  readonly namespace?: string | undefined;
6200
+ } | {
6201
+ readonly type: "media";
6202
+ readonly media: Media.Asset;
6203
+ readonly providerMetadata?: {
6204
+ readonly [x: string]: {
6205
+ readonly [x: string]: unknown;
6206
+ };
6207
+ } | undefined;
5783
6208
  } | {
5784
6209
  readonly type: "step-finish";
5785
6210
  readonly reason: {
@@ -5808,12 +6233,12 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5808
6233
  } | {
5809
6234
  readonly type: "provider-error";
5810
6235
  readonly message: string;
6236
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
5811
6237
  readonly providerMetadata?: {
5812
6238
  readonly [x: string]: {
5813
6239
  readonly [x: string]: unknown;
5814
6240
  };
5815
6241
  } | undefined;
5816
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
5817
6242
  }, cases: Cases): Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
5818
6243
  <Cases extends {
5819
6244
  compaction: (value: {
@@ -6000,6 +6425,15 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6000
6425
  } | undefined;
6001
6426
  readonly namespace?: string | undefined;
6002
6427
  }) => any;
6428
+ media: (value: {
6429
+ readonly type: "media";
6430
+ readonly media: Media.Asset;
6431
+ readonly providerMetadata?: {
6432
+ readonly [x: string]: {
6433
+ readonly [x: string]: unknown;
6434
+ };
6435
+ } | undefined;
6436
+ }) => any;
6003
6437
  "step-finish": (value: {
6004
6438
  readonly type: "step-finish";
6005
6439
  readonly reason: {
@@ -6030,12 +6464,12 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6030
6464
  "provider-error": (value: {
6031
6465
  readonly type: "provider-error";
6032
6466
  readonly message: string;
6467
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
6033
6468
  readonly providerMetadata?: {
6034
6469
  readonly [x: string]: {
6035
6470
  readonly [x: string]: unknown;
6036
6471
  };
6037
6472
  } | undefined;
6038
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
6039
6473
  }) => any;
6040
6474
  }>(cases: Cases): (value: ({
6041
6475
  readonly type: "compaction";
@@ -6206,6 +6640,14 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6206
6640
  };
6207
6641
  } | undefined;
6208
6642
  readonly namespace?: string | undefined;
6643
+ } | {
6644
+ readonly type: "media";
6645
+ readonly media: Media.Asset;
6646
+ readonly providerMetadata?: {
6647
+ readonly [x: string]: {
6648
+ readonly [x: string]: unknown;
6649
+ };
6650
+ } | undefined;
6209
6651
  } | {
6210
6652
  readonly type: "step-finish";
6211
6653
  readonly reason: {
@@ -6234,12 +6676,12 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6234
6676
  } | {
6235
6677
  readonly type: "provider-error";
6236
6678
  readonly message: string;
6679
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
6237
6680
  readonly providerMetadata?: {
6238
6681
  readonly [x: string]: {
6239
6682
  readonly [x: string]: unknown;
6240
6683
  };
6241
6684
  } | undefined;
6242
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
6243
6685
  }) => Cases[keyof Cases] extends (value: any) => infer R ? import("effect/Unify").Unify<R> : never;
6244
6686
  };
6245
6687
  readonly matchOrElse: {
@@ -6428,6 +6870,15 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6428
6870
  } | undefined;
6429
6871
  readonly namespace?: string | undefined;
6430
6872
  }) => any) | undefined;
6873
+ media?: ((value: {
6874
+ readonly type: "media";
6875
+ readonly media: Media.Asset;
6876
+ readonly providerMetadata?: {
6877
+ readonly [x: string]: {
6878
+ readonly [x: string]: unknown;
6879
+ };
6880
+ } | undefined;
6881
+ }) => any) | undefined;
6431
6882
  "step-finish"?: ((value: {
6432
6883
  readonly type: "step-finish";
6433
6884
  readonly reason: {
@@ -6458,14 +6909,14 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6458
6909
  "provider-error"?: ((value: {
6459
6910
  readonly type: "provider-error";
6460
6911
  readonly message: string;
6912
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
6461
6913
  readonly providerMetadata?: {
6462
6914
  readonly [x: string]: {
6463
6915
  readonly [x: string]: unknown;
6464
6916
  };
6465
6917
  } | undefined;
6466
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
6467
6918
  }) => any) | undefined;
6468
- } & { [K in Exclude<keyof Cases, "compaction" | "finish" | "tool-call" | "tool-result" | "step-start" | "text-start" | "text-delta" | "text-end" | "reasoning-start" | "reasoning-delta" | "reasoning-end" | "tool-input-start" | "tool-input-delta" | "tool-input-end" | "tool-input-error" | "tool-error" | "step-finish" | "provider-error">]: never; }, OrElse extends (value: Exclude<{
6919
+ } & { [K in Exclude<keyof Cases, "compaction" | "finish" | "media" | "tool-call" | "tool-result" | "step-start" | "text-start" | "text-delta" | "text-end" | "reasoning-start" | "reasoning-delta" | "reasoning-end" | "tool-input-start" | "tool-input-delta" | "tool-input-end" | "tool-input-error" | "tool-error" | "step-finish" | "provider-error">]: never; }, OrElse extends (value: Exclude<{
6469
6920
  readonly type: "compaction";
6470
6921
  readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
6471
6922
  readonly id?: string | undefined;
@@ -6672,6 +7123,16 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6672
7123
  readonly namespace?: string | undefined;
6673
7124
  }, {
6674
7125
  readonly type: keyof Cases;
7126
+ }> | Exclude<{
7127
+ readonly type: "media";
7128
+ readonly media: Media.Asset;
7129
+ readonly providerMetadata?: {
7130
+ readonly [x: string]: {
7131
+ readonly [x: string]: unknown;
7132
+ };
7133
+ } | undefined;
7134
+ }, {
7135
+ readonly type: keyof Cases;
6675
7136
  }> | Exclude<{
6676
7137
  readonly type: "step-finish";
6677
7138
  readonly reason: {
@@ -6704,12 +7165,12 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6704
7165
  }> | Exclude<{
6705
7166
  readonly type: "provider-error";
6706
7167
  readonly message: string;
7168
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
6707
7169
  readonly providerMetadata?: {
6708
7170
  readonly [x: string]: {
6709
7171
  readonly [x: string]: unknown;
6710
7172
  };
6711
7173
  } | undefined;
6712
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
6713
7174
  }, {
6714
7175
  readonly type: keyof Cases;
6715
7176
  }>) => any>(value: ({
@@ -6881,6 +7342,14 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6881
7342
  };
6882
7343
  } | undefined;
6883
7344
  readonly namespace?: string | undefined;
7345
+ } | {
7346
+ readonly type: "media";
7347
+ readonly media: Media.Asset;
7348
+ readonly providerMetadata?: {
7349
+ readonly [x: string]: {
7350
+ readonly [x: string]: unknown;
7351
+ };
7352
+ } | undefined;
6884
7353
  } | {
6885
7354
  readonly type: "step-finish";
6886
7355
  readonly reason: {
@@ -6909,12 +7378,12 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6909
7378
  } | {
6910
7379
  readonly type: "provider-error";
6911
7380
  readonly message: string;
7381
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
6912
7382
  readonly providerMetadata?: {
6913
7383
  readonly [x: string]: {
6914
7384
  readonly [x: string]: unknown;
6915
7385
  };
6916
7386
  } | undefined;
6917
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
6918
7387
  }, cases: Cases, orElse: OrElse): import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
6919
7388
  <Cases extends {
6920
7389
  compaction?: ((value: {
@@ -7101,6 +7570,15 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7101
7570
  } | undefined;
7102
7571
  readonly namespace?: string | undefined;
7103
7572
  }) => any) | undefined;
7573
+ media?: ((value: {
7574
+ readonly type: "media";
7575
+ readonly media: Media.Asset;
7576
+ readonly providerMetadata?: {
7577
+ readonly [x: string]: {
7578
+ readonly [x: string]: unknown;
7579
+ };
7580
+ } | undefined;
7581
+ }) => any) | undefined;
7104
7582
  "step-finish"?: ((value: {
7105
7583
  readonly type: "step-finish";
7106
7584
  readonly reason: {
@@ -7131,14 +7609,14 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7131
7609
  "provider-error"?: ((value: {
7132
7610
  readonly type: "provider-error";
7133
7611
  readonly message: string;
7612
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
7134
7613
  readonly providerMetadata?: {
7135
7614
  readonly [x: string]: {
7136
7615
  readonly [x: string]: unknown;
7137
7616
  };
7138
7617
  } | undefined;
7139
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
7140
7618
  }) => any) | undefined;
7141
- } & { [K in Exclude<keyof Cases, "compaction" | "finish" | "tool-call" | "tool-result" | "step-start" | "text-start" | "text-delta" | "text-end" | "reasoning-start" | "reasoning-delta" | "reasoning-end" | "tool-input-start" | "tool-input-delta" | "tool-input-end" | "tool-input-error" | "tool-error" | "step-finish" | "provider-error">]: never; }, OrElse extends (value: Exclude<{
7619
+ } & { [K in Exclude<keyof Cases, "compaction" | "finish" | "media" | "tool-call" | "tool-result" | "step-start" | "text-start" | "text-delta" | "text-end" | "reasoning-start" | "reasoning-delta" | "reasoning-end" | "tool-input-start" | "tool-input-delta" | "tool-input-end" | "tool-input-error" | "tool-error" | "step-finish" | "provider-error">]: never; }, OrElse extends (value: Exclude<{
7142
7620
  readonly type: "compaction";
7143
7621
  readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
7144
7622
  readonly id?: string | undefined;
@@ -7345,6 +7823,16 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7345
7823
  readonly namespace?: string | undefined;
7346
7824
  }, {
7347
7825
  readonly type: keyof Cases;
7826
+ }> | Exclude<{
7827
+ readonly type: "media";
7828
+ readonly media: Media.Asset;
7829
+ readonly providerMetadata?: {
7830
+ readonly [x: string]: {
7831
+ readonly [x: string]: unknown;
7832
+ };
7833
+ } | undefined;
7834
+ }, {
7835
+ readonly type: keyof Cases;
7348
7836
  }> | Exclude<{
7349
7837
  readonly type: "step-finish";
7350
7838
  readonly reason: {
@@ -7377,12 +7865,12 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7377
7865
  }> | Exclude<{
7378
7866
  readonly type: "provider-error";
7379
7867
  readonly message: string;
7868
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
7380
7869
  readonly providerMetadata?: {
7381
7870
  readonly [x: string]: {
7382
7871
  readonly [x: string]: unknown;
7383
7872
  };
7384
7873
  } | undefined;
7385
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
7386
7874
  }, {
7387
7875
  readonly type: keyof Cases;
7388
7876
  }>) => any>(cases: Cases, orElse: OrElse): (value: ({
@@ -7554,6 +8042,14 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7554
8042
  };
7555
8043
  } | undefined;
7556
8044
  readonly namespace?: string | undefined;
8045
+ } | {
8046
+ readonly type: "media";
8047
+ readonly media: Media.Asset;
8048
+ readonly providerMetadata?: {
8049
+ readonly [x: string]: {
8050
+ readonly [x: string]: unknown;
8051
+ };
8052
+ } | undefined;
7557
8053
  } | {
7558
8054
  readonly type: "step-finish";
7559
8055
  readonly reason: {
@@ -7582,12 +8078,12 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7582
8078
  } | {
7583
8079
  readonly type: "provider-error";
7584
8080
  readonly message: string;
8081
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
7585
8082
  readonly providerMetadata?: {
7586
8083
  readonly [x: string]: {
7587
8084
  readonly [x: string]: unknown;
7588
8085
  };
7589
8086
  } | undefined;
7590
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
7591
8087
  }) => import("effect/Unify").Unify<{ [K_1 in keyof Cases]-?: NonNullable<Cases[K_1]> extends (...args: Array<any>) => infer R ? R : never; }[keyof Cases] | ReturnType<OrElse>>;
7592
8088
  };
7593
8089
  } & {
@@ -7790,6 +8286,23 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7790
8286
  } | undefined;
7791
8287
  readonly namespace?: string | undefined;
7792
8288
  };
8289
+ media: (input: {
8290
+ readonly media: Media.Asset;
8291
+ readonly type?: "media" | undefined;
8292
+ readonly providerMetadata?: {
8293
+ readonly [x: string]: {
8294
+ readonly [x: string]: unknown;
8295
+ };
8296
+ } | undefined;
8297
+ }, options?: Schema.MakeOptions) => {
8298
+ readonly type: "media";
8299
+ readonly media: Media.Asset;
8300
+ readonly providerMetadata?: {
8301
+ readonly [x: string]: {
8302
+ readonly [x: string]: unknown;
8303
+ };
8304
+ } | undefined;
8305
+ };
7793
8306
  stepFinish: (input: WithUsage<StepFinish>) => {
7794
8307
  readonly type: "step-finish";
7795
8308
  readonly reason: {
@@ -7820,21 +8333,21 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7820
8333
  providerError: (input: {
7821
8334
  readonly message: string;
7822
8335
  readonly type?: "provider-error" | undefined;
8336
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
7823
8337
  readonly providerMetadata?: {
7824
8338
  readonly [x: string]: {
7825
8339
  readonly [x: string]: unknown;
7826
8340
  };
7827
8341
  } | undefined;
7828
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
7829
8342
  }, options?: Schema.MakeOptions) => {
7830
8343
  readonly type: "provider-error";
7831
8344
  readonly message: string;
8345
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
7832
8346
  readonly providerMetadata?: {
7833
8347
  readonly [x: string]: {
7834
8348
  readonly [x: string]: unknown;
7835
8349
  };
7836
8350
  } | undefined;
7837
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
7838
8351
  };
7839
8352
  is: {
7840
8353
  compaction: (u: unknown) => u is {
@@ -8021,6 +8534,15 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
8021
8534
  } | undefined;
8022
8535
  readonly namespace?: string | undefined;
8023
8536
  };
8537
+ media: (u: unknown) => u is {
8538
+ readonly type: "media";
8539
+ readonly media: Media.Asset;
8540
+ readonly providerMetadata?: {
8541
+ readonly [x: string]: {
8542
+ readonly [x: string]: unknown;
8543
+ };
8544
+ } | undefined;
8545
+ };
8024
8546
  stepFinish: (u: unknown) => u is {
8025
8547
  readonly type: "step-finish";
8026
8548
  readonly reason: {
@@ -8051,12 +8573,12 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
8051
8573
  providerError: (u: unknown) => u is {
8052
8574
  readonly type: "provider-error";
8053
8575
  readonly message: string;
8576
+ readonly classification?: "context-overflow" | "payload-too-large" | undefined;
8054
8577
  readonly providerMetadata?: {
8055
8578
  readonly [x: string]: {
8056
8579
  readonly [x: string]: unknown;
8057
8580
  };
8058
8581
  } | undefined;
8059
- readonly classification?: "context-overflow" | "payload-too-large" | undefined;
8060
8582
  };
8061
8583
  };
8062
8584
  }>;
@@ -8121,3 +8643,4 @@ export declare namespace LLMResponse {
8121
8643
  /** Concatenate reasoning text from a response or collected event list. */
8122
8644
  const reasoning: (response: Output) => string;
8123
8645
  }
8646
+ export {};