@opencode/ai 2.0.20 → 2.0.22

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 (59) hide show
  1. package/dist/cache-policy.js +22 -3
  2. package/dist/llm.d.ts +4 -0
  3. package/dist/promise.d.ts +8 -0
  4. package/dist/protocols/alibaba-chat.d.ts +20 -10
  5. package/dist/protocols/alibaba-chat.js +2 -1
  6. package/dist/protocols/anthropic-messages.js +14 -12
  7. package/dist/protocols/bedrock-converse.js +30 -1
  8. package/dist/protocols/open-responses.d.ts +4 -0
  9. package/dist/protocols/openai-chat.d.ts +122 -71
  10. package/dist/protocols/openai-chat.js +40 -37
  11. package/dist/protocols/openai-compatible-chat.d.ts +16 -10
  12. package/dist/protocols/openai-responses.js +4 -3
  13. package/dist/protocols/utils/cache.d.ts +5 -0
  14. package/dist/protocols/utils/cache.js +9 -1
  15. package/dist/protocols/utils/tool-stream.d.ts +12 -0
  16. package/dist/protocols/zai-chat.d.ts +20 -10
  17. package/dist/protocols/zai-chat.js +6 -3
  18. package/dist/provider-error.js +24 -6
  19. package/dist/providers/alibaba.d.ts +16 -10
  20. package/dist/providers/amazon-bedrock-mantle.d.ts +16 -10
  21. package/dist/providers/azure.d.ts +16 -10
  22. package/dist/providers/baseten.d.ts +32 -20
  23. package/dist/providers/cerebras.d.ts +32 -20
  24. package/dist/providers/cloudflare-ai-gateway.d.ts +32 -20
  25. package/dist/providers/cloudflare-ai-gateway.js +43 -35
  26. package/dist/providers/cloudflare-workers-ai.d.ts +32 -20
  27. package/dist/providers/deepinfra.d.ts +32 -20
  28. package/dist/providers/deepseek.d.ts +32 -20
  29. package/dist/providers/digitalocean.d.ts +469 -0
  30. package/dist/providers/digitalocean.js +53 -0
  31. package/dist/providers/fireworks.d.ts +32 -20
  32. package/dist/providers/google-vertex-chat.d.ts +16 -10
  33. package/dist/providers/google-vertex-messages.js +1 -1
  34. package/dist/providers/groq.d.ts +36 -20
  35. package/dist/providers/groq.js +1 -1
  36. package/dist/providers/index.d.ts +1 -0
  37. package/dist/providers/index.js +1 -0
  38. package/dist/providers/meta.d.ts +16 -10
  39. package/dist/providers/minimax.d.ts +16 -10
  40. package/dist/providers/moonshot.d.ts +16 -10
  41. package/dist/providers/openai-compatible.d.ts +16 -10
  42. package/dist/providers/openai.d.ts +16 -10
  43. package/dist/providers/openrouter.d.ts +68 -40
  44. package/dist/providers/openrouter.js +1 -13
  45. package/dist/providers/togetherai.d.ts +32 -20
  46. package/dist/providers/xai.d.ts +16 -10
  47. package/dist/providers/zai-coding-plan.d.ts +16 -10
  48. package/dist/providers/zai.d.ts +16 -10
  49. package/dist/route/client.d.ts +4 -0
  50. package/dist/route/executor.js +13 -6
  51. package/dist/route/transport/http.d.ts +2 -1
  52. package/dist/route/transport/http.js +28 -6
  53. package/dist/schema/events.d.ts +176 -0
  54. package/dist/schema/events.js +4 -0
  55. package/dist/schema/options.d.ts +11 -0
  56. package/dist/schema/options.js +15 -2
  57. package/dist/testing.d.ts +32 -0
  58. package/dist/tool-history.js +17 -3
  59. package/package.json +3 -3
@@ -325,6 +325,10 @@ export type ToolError = Schema.Schema.Type<typeof ToolError>;
325
325
  export declare const FinishReasonDetails: Schema.Struct<{
326
326
  readonly normalized: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>;
327
327
  readonly raw: Schema.optional<Schema.String>;
328
+ /** The provider's policy area for a content-filter finish, such as `cyber`. */
329
+ readonly category: Schema.optional<Schema.String>;
330
+ /** The provider's human-readable reason for a content-filter finish. */
331
+ readonly explanation: Schema.optional<Schema.String>;
328
332
  }>;
329
333
  export type FinishReasonDetails = Schema.Schema.Type<typeof FinishReasonDetails>;
330
334
  export declare const StepFinish: Schema.Struct<{
@@ -333,6 +337,10 @@ export declare const StepFinish: Schema.Struct<{
333
337
  readonly reason: Schema.Struct<{
334
338
  readonly normalized: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>;
335
339
  readonly raw: Schema.optional<Schema.String>;
340
+ /** The provider's policy area for a content-filter finish, such as `cyber`. */
341
+ readonly category: Schema.optional<Schema.String>;
342
+ /** The provider's human-readable reason for a content-filter finish. */
343
+ readonly explanation: Schema.optional<Schema.String>;
336
344
  }>;
337
345
  readonly usage: Schema.optional<typeof Usage>;
338
346
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
@@ -343,6 +351,10 @@ export declare const Finish: Schema.Struct<{
343
351
  readonly reason: Schema.Struct<{
344
352
  readonly normalized: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>;
345
353
  readonly raw: Schema.optional<Schema.String>;
354
+ /** The provider's policy area for a content-filter finish, such as `cyber`. */
355
+ readonly category: Schema.optional<Schema.String>;
356
+ /** The provider's human-readable reason for a content-filter finish. */
357
+ readonly explanation: Schema.optional<Schema.String>;
346
358
  }>;
347
359
  readonly usage: Schema.optional<typeof Usage>;
348
360
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
@@ -601,6 +613,10 @@ declare const llmEventTagged: Schema.toTaggedUnion<"type", readonly [Schema.refi
601
613
  readonly reason: Schema.Struct<{
602
614
  readonly normalized: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>;
603
615
  readonly raw: Schema.optional<Schema.String>;
616
+ /** The provider's policy area for a content-filter finish, such as `cyber`. */
617
+ readonly category: Schema.optional<Schema.String>;
618
+ /** The provider's human-readable reason for a content-filter finish. */
619
+ readonly explanation: Schema.optional<Schema.String>;
604
620
  }>;
605
621
  readonly usage: Schema.optional<typeof Usage>;
606
622
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
@@ -609,6 +625,10 @@ declare const llmEventTagged: Schema.toTaggedUnion<"type", readonly [Schema.refi
609
625
  readonly reason: Schema.Struct<{
610
626
  readonly normalized: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>;
611
627
  readonly raw: Schema.optional<Schema.String>;
628
+ /** The provider's policy area for a content-filter finish, such as `cyber`. */
629
+ readonly category: Schema.optional<Schema.String>;
630
+ /** The provider's human-readable reason for a content-filter finish. */
631
+ readonly explanation: Schema.optional<Schema.String>;
612
632
  }>;
613
633
  readonly usage: Schema.optional<typeof Usage>;
614
634
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
@@ -842,6 +862,10 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
842
862
  readonly reason: Schema.Struct<{
843
863
  readonly normalized: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>;
844
864
  readonly raw: Schema.optional<Schema.String>;
865
+ /** The provider's policy area for a content-filter finish, such as `cyber`. */
866
+ readonly category: Schema.optional<Schema.String>;
867
+ /** The provider's human-readable reason for a content-filter finish. */
868
+ readonly explanation: Schema.optional<Schema.String>;
845
869
  }>;
846
870
  readonly usage: Schema.optional<typeof Usage>;
847
871
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
@@ -850,6 +874,10 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
850
874
  readonly reason: Schema.Struct<{
851
875
  readonly normalized: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>;
852
876
  readonly raw: Schema.optional<Schema.String>;
877
+ /** The provider's policy area for a content-filter finish, such as `cyber`. */
878
+ readonly category: Schema.optional<Schema.String>;
879
+ /** The provider's human-readable reason for a content-filter finish. */
880
+ readonly explanation: Schema.optional<Schema.String>;
853
881
  }>;
854
882
  readonly usage: Schema.optional<typeof Usage>;
855
883
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
@@ -1086,6 +1114,10 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1086
1114
  readonly reason: Schema.Struct<{
1087
1115
  readonly normalized: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>;
1088
1116
  readonly raw: Schema.optional<Schema.String>;
1117
+ /** The provider's policy area for a content-filter finish, such as `cyber`. */
1118
+ readonly category: Schema.optional<Schema.String>;
1119
+ /** The provider's human-readable reason for a content-filter finish. */
1120
+ readonly explanation: Schema.optional<Schema.String>;
1089
1121
  }>;
1090
1122
  readonly usage: Schema.optional<typeof Usage>;
1091
1123
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
@@ -1095,6 +1127,10 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1095
1127
  readonly reason: Schema.Struct<{
1096
1128
  readonly normalized: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>;
1097
1129
  readonly raw: Schema.optional<Schema.String>;
1130
+ /** The provider's policy area for a content-filter finish, such as `cyber`. */
1131
+ readonly category: Schema.optional<Schema.String>;
1132
+ /** The provider's human-readable reason for a content-filter finish. */
1133
+ readonly explanation: Schema.optional<Schema.String>;
1098
1134
  }>;
1099
1135
  readonly usage: Schema.optional<typeof Usage>;
1100
1136
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
@@ -1288,6 +1324,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1288
1324
  readonly reason: {
1289
1325
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
1290
1326
  readonly raw?: string | undefined;
1327
+ readonly category?: string | undefined;
1328
+ readonly explanation?: string | undefined;
1291
1329
  };
1292
1330
  readonly index: number;
1293
1331
  readonly providerMetadata?: {
@@ -1301,6 +1339,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1301
1339
  readonly reason: {
1302
1340
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
1303
1341
  readonly raw?: string | undefined;
1342
+ readonly category?: string | undefined;
1343
+ readonly explanation?: string | undefined;
1304
1344
  };
1305
1345
  readonly providerMetadata?: {
1306
1346
  readonly [x: string]: {
@@ -1539,6 +1579,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1539
1579
  readonly reason: {
1540
1580
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
1541
1581
  readonly raw?: string | undefined;
1582
+ readonly category?: string | undefined;
1583
+ readonly explanation?: string | undefined;
1542
1584
  };
1543
1585
  readonly index: number;
1544
1586
  readonly providerMetadata?: {
@@ -1554,6 +1596,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1554
1596
  readonly reason: {
1555
1597
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
1556
1598
  readonly raw?: string | undefined;
1599
+ readonly category?: string | undefined;
1600
+ readonly explanation?: string | undefined;
1557
1601
  };
1558
1602
  readonly providerMetadata?: {
1559
1603
  readonly [x: string]: {
@@ -1774,6 +1818,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1774
1818
  readonly reason: {
1775
1819
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
1776
1820
  readonly raw?: string | undefined;
1821
+ readonly category?: string | undefined;
1822
+ readonly explanation?: string | undefined;
1777
1823
  };
1778
1824
  readonly index: number;
1779
1825
  readonly providerMetadata?: {
@@ -1788,6 +1834,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1788
1834
  readonly reason: {
1789
1835
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
1790
1836
  readonly raw?: string | undefined;
1837
+ readonly category?: string | undefined;
1838
+ readonly explanation?: string | undefined;
1791
1839
  };
1792
1840
  readonly providerMetadata?: {
1793
1841
  readonly [x: string]: {
@@ -2007,6 +2055,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2007
2055
  readonly reason: {
2008
2056
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
2009
2057
  readonly raw?: string | undefined;
2058
+ readonly category?: string | undefined;
2059
+ readonly explanation?: string | undefined;
2010
2060
  };
2011
2061
  readonly index: number;
2012
2062
  readonly providerMetadata?: {
@@ -2021,6 +2071,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2021
2071
  readonly reason: {
2022
2072
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
2023
2073
  readonly raw?: string | undefined;
2074
+ readonly category?: string | undefined;
2075
+ readonly explanation?: string | undefined;
2024
2076
  };
2025
2077
  readonly providerMetadata?: {
2026
2078
  readonly [x: string]: {
@@ -2221,6 +2273,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2221
2273
  readonly reason: {
2222
2274
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
2223
2275
  readonly raw?: string | undefined;
2276
+ readonly category?: string | undefined;
2277
+ readonly explanation?: string | undefined;
2224
2278
  };
2225
2279
  readonly index: number;
2226
2280
  readonly providerMetadata?: {
@@ -2234,6 +2288,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2234
2288
  readonly reason: {
2235
2289
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
2236
2290
  readonly raw?: string | undefined;
2291
+ readonly category?: string | undefined;
2292
+ readonly explanation?: string | undefined;
2237
2293
  };
2238
2294
  readonly providerMetadata?: {
2239
2295
  readonly [x: string]: {
@@ -2450,6 +2506,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2450
2506
  readonly reason: {
2451
2507
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
2452
2508
  readonly raw?: string | undefined;
2509
+ readonly category?: string | undefined;
2510
+ readonly explanation?: string | undefined;
2453
2511
  };
2454
2512
  readonly index: number;
2455
2513
  readonly providerMetadata?: {
@@ -2464,6 +2522,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2464
2522
  readonly reason: {
2465
2523
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
2466
2524
  readonly raw?: string | undefined;
2525
+ readonly category?: string | undefined;
2526
+ readonly explanation?: string | undefined;
2467
2527
  };
2468
2528
  readonly providerMetadata?: {
2469
2529
  readonly [x: string]: {
@@ -2664,6 +2724,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2664
2724
  readonly reason: {
2665
2725
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
2666
2726
  readonly raw?: string | undefined;
2727
+ readonly category?: string | undefined;
2728
+ readonly explanation?: string | undefined;
2667
2729
  };
2668
2730
  readonly index: number;
2669
2731
  readonly providerMetadata?: {
@@ -2677,6 +2739,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2677
2739
  readonly reason: {
2678
2740
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
2679
2741
  readonly raw?: string | undefined;
2742
+ readonly category?: string | undefined;
2743
+ readonly explanation?: string | undefined;
2680
2744
  };
2681
2745
  readonly providerMetadata?: {
2682
2746
  readonly [x: string]: {
@@ -2895,6 +2959,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2895
2959
  readonly reason: {
2896
2960
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
2897
2961
  readonly raw?: string | undefined;
2962
+ readonly category?: string | undefined;
2963
+ readonly explanation?: string | undefined;
2898
2964
  };
2899
2965
  readonly index: number;
2900
2966
  readonly providerMetadata?: {
@@ -2909,6 +2975,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2909
2975
  readonly reason: {
2910
2976
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
2911
2977
  readonly raw?: string | undefined;
2978
+ readonly category?: string | undefined;
2979
+ readonly explanation?: string | undefined;
2912
2980
  };
2913
2981
  readonly providerMetadata?: {
2914
2982
  readonly [x: string]: {
@@ -3149,6 +3217,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3149
3217
  readonly reason: {
3150
3218
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
3151
3219
  readonly raw?: string | undefined;
3220
+ readonly category?: string | undefined;
3221
+ readonly explanation?: string | undefined;
3152
3222
  };
3153
3223
  readonly index: number;
3154
3224
  readonly providerMetadata?: {
@@ -3164,6 +3234,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3164
3234
  readonly reason: {
3165
3235
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
3166
3236
  readonly raw?: string | undefined;
3237
+ readonly category?: string | undefined;
3238
+ readonly explanation?: string | undefined;
3167
3239
  };
3168
3240
  readonly providerMetadata?: {
3169
3241
  readonly [x: string]: {
@@ -3366,6 +3438,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3366
3438
  readonly reason: {
3367
3439
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
3368
3440
  readonly raw?: string | undefined;
3441
+ readonly category?: string | undefined;
3442
+ readonly explanation?: string | undefined;
3369
3443
  };
3370
3444
  readonly index: number;
3371
3445
  readonly providerMetadata?: {
@@ -3379,6 +3453,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3379
3453
  readonly reason: {
3380
3454
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
3381
3455
  readonly raw?: string | undefined;
3456
+ readonly category?: string | undefined;
3457
+ readonly explanation?: string | undefined;
3382
3458
  };
3383
3459
  readonly providerMetadata?: {
3384
3460
  readonly [x: string]: {
@@ -3595,6 +3671,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3595
3671
  readonly reason: {
3596
3672
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
3597
3673
  readonly raw?: string | undefined;
3674
+ readonly category?: string | undefined;
3675
+ readonly explanation?: string | undefined;
3598
3676
  };
3599
3677
  readonly index: number;
3600
3678
  readonly providerMetadata?: {
@@ -3609,6 +3687,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3609
3687
  readonly reason: {
3610
3688
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
3611
3689
  readonly raw?: string | undefined;
3690
+ readonly category?: string | undefined;
3691
+ readonly explanation?: string | undefined;
3612
3692
  };
3613
3693
  readonly providerMetadata?: {
3614
3694
  readonly [x: string]: {
@@ -3849,6 +3929,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3849
3929
  readonly reason: {
3850
3930
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
3851
3931
  readonly raw?: string | undefined;
3932
+ readonly category?: string | undefined;
3933
+ readonly explanation?: string | undefined;
3852
3934
  };
3853
3935
  readonly index: number;
3854
3936
  readonly providerMetadata?: {
@@ -3864,6 +3946,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3864
3946
  readonly reason: {
3865
3947
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
3866
3948
  readonly raw?: string | undefined;
3949
+ readonly category?: string | undefined;
3950
+ readonly explanation?: string | undefined;
3867
3951
  };
3868
3952
  readonly providerMetadata?: {
3869
3953
  readonly [x: string]: {
@@ -4066,6 +4150,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
4066
4150
  readonly reason: {
4067
4151
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
4068
4152
  readonly raw?: string | undefined;
4153
+ readonly category?: string | undefined;
4154
+ readonly explanation?: string | undefined;
4069
4155
  };
4070
4156
  readonly index: number;
4071
4157
  readonly providerMetadata?: {
@@ -4079,6 +4165,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
4079
4165
  readonly reason: {
4080
4166
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
4081
4167
  readonly raw?: string | undefined;
4168
+ readonly category?: string | undefined;
4169
+ readonly explanation?: string | undefined;
4082
4170
  };
4083
4171
  readonly providerMetadata?: {
4084
4172
  readonly [x: string]: {
@@ -4319,6 +4407,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
4319
4407
  readonly reason: {
4320
4408
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
4321
4409
  readonly raw?: string | undefined;
4410
+ readonly category?: string | undefined;
4411
+ readonly explanation?: string | undefined;
4322
4412
  };
4323
4413
  readonly index: number;
4324
4414
  readonly providerMetadata?: {
@@ -4333,6 +4423,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
4333
4423
  readonly reason: {
4334
4424
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
4335
4425
  readonly raw?: string | undefined;
4426
+ readonly category?: string | undefined;
4427
+ readonly explanation?: string | undefined;
4336
4428
  };
4337
4429
  readonly providerMetadata?: {
4338
4430
  readonly [x: string]: {
@@ -4559,6 +4651,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
4559
4651
  readonly reason: {
4560
4652
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
4561
4653
  readonly raw?: string | undefined;
4654
+ readonly category?: string | undefined;
4655
+ readonly explanation?: string | undefined;
4562
4656
  };
4563
4657
  readonly index: number;
4564
4658
  readonly providerMetadata?: {
@@ -4573,6 +4667,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
4573
4667
  readonly reason: {
4574
4668
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
4575
4669
  readonly raw?: string | undefined;
4670
+ readonly category?: string | undefined;
4671
+ readonly explanation?: string | undefined;
4576
4672
  };
4577
4673
  readonly providerMetadata?: {
4578
4674
  readonly [x: string]: {
@@ -4825,6 +4921,10 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
4825
4921
  readonly reason: Schema.Struct<{
4826
4922
  readonly normalized: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>;
4827
4923
  readonly raw: Schema.optional<Schema.String>;
4924
+ /** The provider's policy area for a content-filter finish, such as `cyber`. */
4925
+ readonly category: Schema.optional<Schema.String>;
4926
+ /** The provider's human-readable reason for a content-filter finish. */
4927
+ readonly explanation: Schema.optional<Schema.String>;
4828
4928
  }>;
4829
4929
  readonly usage: Schema.optional<typeof Usage>;
4830
4930
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
@@ -4833,6 +4933,10 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
4833
4933
  readonly reason: Schema.Struct<{
4834
4934
  readonly normalized: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>;
4835
4935
  readonly raw: Schema.optional<Schema.String>;
4936
+ /** The provider's policy area for a content-filter finish, such as `cyber`. */
4937
+ readonly category: Schema.optional<Schema.String>;
4938
+ /** The provider's human-readable reason for a content-filter finish. */
4939
+ readonly explanation: Schema.optional<Schema.String>;
4836
4940
  }>;
4837
4941
  readonly usage: Schema.optional<typeof Usage>;
4838
4942
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
@@ -5069,6 +5173,10 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5069
5173
  readonly reason: Schema.Struct<{
5070
5174
  readonly normalized: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>;
5071
5175
  readonly raw: Schema.optional<Schema.String>;
5176
+ /** The provider's policy area for a content-filter finish, such as `cyber`. */
5177
+ readonly category: Schema.optional<Schema.String>;
5178
+ /** The provider's human-readable reason for a content-filter finish. */
5179
+ readonly explanation: Schema.optional<Schema.String>;
5072
5180
  }>;
5073
5181
  readonly usage: Schema.optional<typeof Usage>;
5074
5182
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
@@ -5078,6 +5186,10 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5078
5186
  readonly reason: Schema.Struct<{
5079
5187
  readonly normalized: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>;
5080
5188
  readonly raw: Schema.optional<Schema.String>;
5189
+ /** The provider's policy area for a content-filter finish, such as `cyber`. */
5190
+ readonly category: Schema.optional<Schema.String>;
5191
+ /** The provider's human-readable reason for a content-filter finish. */
5192
+ readonly explanation: Schema.optional<Schema.String>;
5081
5193
  }>;
5082
5194
  readonly usage: Schema.optional<typeof Usage>;
5083
5195
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
@@ -5271,6 +5383,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5271
5383
  readonly reason: {
5272
5384
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
5273
5385
  readonly raw?: string | undefined;
5386
+ readonly category?: string | undefined;
5387
+ readonly explanation?: string | undefined;
5274
5388
  };
5275
5389
  readonly index: number;
5276
5390
  readonly providerMetadata?: {
@@ -5284,6 +5398,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5284
5398
  readonly reason: {
5285
5399
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
5286
5400
  readonly raw?: string | undefined;
5401
+ readonly category?: string | undefined;
5402
+ readonly explanation?: string | undefined;
5287
5403
  };
5288
5404
  readonly providerMetadata?: {
5289
5405
  readonly [x: string]: {
@@ -5522,6 +5638,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5522
5638
  readonly reason: {
5523
5639
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
5524
5640
  readonly raw?: string | undefined;
5641
+ readonly category?: string | undefined;
5642
+ readonly explanation?: string | undefined;
5525
5643
  };
5526
5644
  readonly index: number;
5527
5645
  readonly providerMetadata?: {
@@ -5537,6 +5655,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5537
5655
  readonly reason: {
5538
5656
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
5539
5657
  readonly raw?: string | undefined;
5658
+ readonly category?: string | undefined;
5659
+ readonly explanation?: string | undefined;
5540
5660
  };
5541
5661
  readonly providerMetadata?: {
5542
5662
  readonly [x: string]: {
@@ -5757,6 +5877,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5757
5877
  readonly reason: {
5758
5878
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
5759
5879
  readonly raw?: string | undefined;
5880
+ readonly category?: string | undefined;
5881
+ readonly explanation?: string | undefined;
5760
5882
  };
5761
5883
  readonly index: number;
5762
5884
  readonly providerMetadata?: {
@@ -5771,6 +5893,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5771
5893
  readonly reason: {
5772
5894
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
5773
5895
  readonly raw?: string | undefined;
5896
+ readonly category?: string | undefined;
5897
+ readonly explanation?: string | undefined;
5774
5898
  };
5775
5899
  readonly providerMetadata?: {
5776
5900
  readonly [x: string]: {
@@ -5990,6 +6114,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5990
6114
  readonly reason: {
5991
6115
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
5992
6116
  readonly raw?: string | undefined;
6117
+ readonly category?: string | undefined;
6118
+ readonly explanation?: string | undefined;
5993
6119
  };
5994
6120
  readonly index: number;
5995
6121
  readonly providerMetadata?: {
@@ -6004,6 +6130,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6004
6130
  readonly reason: {
6005
6131
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
6006
6132
  readonly raw?: string | undefined;
6133
+ readonly category?: string | undefined;
6134
+ readonly explanation?: string | undefined;
6007
6135
  };
6008
6136
  readonly providerMetadata?: {
6009
6137
  readonly [x: string]: {
@@ -6204,6 +6332,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6204
6332
  readonly reason: {
6205
6333
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
6206
6334
  readonly raw?: string | undefined;
6335
+ readonly category?: string | undefined;
6336
+ readonly explanation?: string | undefined;
6207
6337
  };
6208
6338
  readonly index: number;
6209
6339
  readonly providerMetadata?: {
@@ -6217,6 +6347,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6217
6347
  readonly reason: {
6218
6348
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
6219
6349
  readonly raw?: string | undefined;
6350
+ readonly category?: string | undefined;
6351
+ readonly explanation?: string | undefined;
6220
6352
  };
6221
6353
  readonly providerMetadata?: {
6222
6354
  readonly [x: string]: {
@@ -6433,6 +6565,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6433
6565
  readonly reason: {
6434
6566
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
6435
6567
  readonly raw?: string | undefined;
6568
+ readonly category?: string | undefined;
6569
+ readonly explanation?: string | undefined;
6436
6570
  };
6437
6571
  readonly index: number;
6438
6572
  readonly providerMetadata?: {
@@ -6447,6 +6581,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6447
6581
  readonly reason: {
6448
6582
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
6449
6583
  readonly raw?: string | undefined;
6584
+ readonly category?: string | undefined;
6585
+ readonly explanation?: string | undefined;
6450
6586
  };
6451
6587
  readonly providerMetadata?: {
6452
6588
  readonly [x: string]: {
@@ -6647,6 +6783,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6647
6783
  readonly reason: {
6648
6784
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
6649
6785
  readonly raw?: string | undefined;
6786
+ readonly category?: string | undefined;
6787
+ readonly explanation?: string | undefined;
6650
6788
  };
6651
6789
  readonly index: number;
6652
6790
  readonly providerMetadata?: {
@@ -6660,6 +6798,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6660
6798
  readonly reason: {
6661
6799
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
6662
6800
  readonly raw?: string | undefined;
6801
+ readonly category?: string | undefined;
6802
+ readonly explanation?: string | undefined;
6663
6803
  };
6664
6804
  readonly providerMetadata?: {
6665
6805
  readonly [x: string]: {
@@ -6878,6 +7018,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6878
7018
  readonly reason: {
6879
7019
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
6880
7020
  readonly raw?: string | undefined;
7021
+ readonly category?: string | undefined;
7022
+ readonly explanation?: string | undefined;
6881
7023
  };
6882
7024
  readonly index: number;
6883
7025
  readonly providerMetadata?: {
@@ -6892,6 +7034,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6892
7034
  readonly reason: {
6893
7035
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
6894
7036
  readonly raw?: string | undefined;
7037
+ readonly category?: string | undefined;
7038
+ readonly explanation?: string | undefined;
6895
7039
  };
6896
7040
  readonly providerMetadata?: {
6897
7041
  readonly [x: string]: {
@@ -7132,6 +7276,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7132
7276
  readonly reason: {
7133
7277
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
7134
7278
  readonly raw?: string | undefined;
7279
+ readonly category?: string | undefined;
7280
+ readonly explanation?: string | undefined;
7135
7281
  };
7136
7282
  readonly index: number;
7137
7283
  readonly providerMetadata?: {
@@ -7147,6 +7293,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7147
7293
  readonly reason: {
7148
7294
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
7149
7295
  readonly raw?: string | undefined;
7296
+ readonly category?: string | undefined;
7297
+ readonly explanation?: string | undefined;
7150
7298
  };
7151
7299
  readonly providerMetadata?: {
7152
7300
  readonly [x: string]: {
@@ -7349,6 +7497,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7349
7497
  readonly reason: {
7350
7498
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
7351
7499
  readonly raw?: string | undefined;
7500
+ readonly category?: string | undefined;
7501
+ readonly explanation?: string | undefined;
7352
7502
  };
7353
7503
  readonly index: number;
7354
7504
  readonly providerMetadata?: {
@@ -7362,6 +7512,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7362
7512
  readonly reason: {
7363
7513
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
7364
7514
  readonly raw?: string | undefined;
7515
+ readonly category?: string | undefined;
7516
+ readonly explanation?: string | undefined;
7365
7517
  };
7366
7518
  readonly providerMetadata?: {
7367
7519
  readonly [x: string]: {
@@ -7578,6 +7730,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7578
7730
  readonly reason: {
7579
7731
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
7580
7732
  readonly raw?: string | undefined;
7733
+ readonly category?: string | undefined;
7734
+ readonly explanation?: string | undefined;
7581
7735
  };
7582
7736
  readonly index: number;
7583
7737
  readonly providerMetadata?: {
@@ -7592,6 +7746,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7592
7746
  readonly reason: {
7593
7747
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
7594
7748
  readonly raw?: string | undefined;
7749
+ readonly category?: string | undefined;
7750
+ readonly explanation?: string | undefined;
7595
7751
  };
7596
7752
  readonly providerMetadata?: {
7597
7753
  readonly [x: string]: {
@@ -7832,6 +7988,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7832
7988
  readonly reason: {
7833
7989
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
7834
7990
  readonly raw?: string | undefined;
7991
+ readonly category?: string | undefined;
7992
+ readonly explanation?: string | undefined;
7835
7993
  };
7836
7994
  readonly index: number;
7837
7995
  readonly providerMetadata?: {
@@ -7847,6 +8005,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7847
8005
  readonly reason: {
7848
8006
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
7849
8007
  readonly raw?: string | undefined;
8008
+ readonly category?: string | undefined;
8009
+ readonly explanation?: string | undefined;
7850
8010
  };
7851
8011
  readonly providerMetadata?: {
7852
8012
  readonly [x: string]: {
@@ -8049,6 +8209,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
8049
8209
  readonly reason: {
8050
8210
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
8051
8211
  readonly raw?: string | undefined;
8212
+ readonly category?: string | undefined;
8213
+ readonly explanation?: string | undefined;
8052
8214
  };
8053
8215
  readonly index: number;
8054
8216
  readonly providerMetadata?: {
@@ -8062,6 +8224,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
8062
8224
  readonly reason: {
8063
8225
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
8064
8226
  readonly raw?: string | undefined;
8227
+ readonly category?: string | undefined;
8228
+ readonly explanation?: string | undefined;
8065
8229
  };
8066
8230
  readonly providerMetadata?: {
8067
8231
  readonly [x: string]: {
@@ -8302,6 +8466,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
8302
8466
  readonly reason: {
8303
8467
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
8304
8468
  readonly raw?: string | undefined;
8469
+ readonly category?: string | undefined;
8470
+ readonly explanation?: string | undefined;
8305
8471
  };
8306
8472
  readonly index: number;
8307
8473
  readonly providerMetadata?: {
@@ -8316,6 +8482,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
8316
8482
  readonly reason: {
8317
8483
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
8318
8484
  readonly raw?: string | undefined;
8485
+ readonly category?: string | undefined;
8486
+ readonly explanation?: string | undefined;
8319
8487
  };
8320
8488
  readonly providerMetadata?: {
8321
8489
  readonly [x: string]: {
@@ -8542,6 +8710,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
8542
8710
  readonly reason: {
8543
8711
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
8544
8712
  readonly raw?: string | undefined;
8713
+ readonly category?: string | undefined;
8714
+ readonly explanation?: string | undefined;
8545
8715
  };
8546
8716
  readonly index: number;
8547
8717
  readonly providerMetadata?: {
@@ -8556,6 +8726,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
8556
8726
  readonly reason: {
8557
8727
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
8558
8728
  readonly raw?: string | undefined;
8729
+ readonly category?: string | undefined;
8730
+ readonly explanation?: string | undefined;
8559
8731
  };
8560
8732
  readonly providerMetadata?: {
8561
8733
  readonly [x: string]: {
@@ -8580,6 +8752,10 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
8580
8752
  readonly finishReason: Schema.Struct<{
8581
8753
  readonly normalized: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>;
8582
8754
  readonly raw: Schema.optional<Schema.String>;
8755
+ /** The provider's policy area for a content-filter finish, such as `cyber`. */
8756
+ readonly category: Schema.optional<Schema.String>;
8757
+ /** The provider's human-readable reason for a content-filter finish. */
8758
+ readonly explanation: Schema.optional<Schema.String>;
8583
8759
  }>;
8584
8760
  }>, {}>;
8585
8761
  export declare class LLMResponse extends LLMResponse_base {