@opencode/ai 2.0.19 → 2.0.20

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 (37) hide show
  1. package/dist/cache-policy.js +6 -0
  2. package/dist/llm.d.ts +1 -1
  3. package/dist/promise.d.ts +2 -2
  4. package/dist/protocols/alibaba-responses.d.ts +14 -14
  5. package/dist/protocols/anthropic-messages.js +2 -15
  6. package/dist/protocols/bedrock-converse.d.ts +1 -1
  7. package/dist/protocols/bedrock-converse.js +38 -12
  8. package/dist/protocols/meta-messages.d.ts +5 -1
  9. package/dist/protocols/meta-messages.js +11 -4
  10. package/dist/protocols/meta-responses.d.ts +16 -16
  11. package/dist/protocols/mistral-chat.d.ts +6 -0
  12. package/dist/protocols/mistral-chat.js +8 -5
  13. package/dist/protocols/open-responses.d.ts +31 -31
  14. package/dist/protocols/openai-compatible-responses.d.ts +2 -2
  15. package/dist/protocols/openai-responses.d.ts +22 -22
  16. package/dist/protocols/utils/claude-model.d.ts +8 -0
  17. package/dist/protocols/utils/claude-model.js +15 -0
  18. package/dist/protocols/utils/tool-stream.d.ts +3 -3
  19. package/dist/protocols/xai-responses.d.ts +14 -14
  20. package/dist/provider-error.d.ts +1 -0
  21. package/dist/provider-error.js +19 -1
  22. package/dist/providers/alibaba.d.ts +2 -2
  23. package/dist/providers/amazon-bedrock-mantle.d.ts +2 -2
  24. package/dist/providers/azure.d.ts +4 -4
  25. package/dist/providers/cloudflare-ai-gateway.d.ts +4 -4
  26. package/dist/providers/google-vertex-responses.d.ts +2 -2
  27. package/dist/providers/meta.d.ts +7 -3
  28. package/dist/providers/minimax.d.ts +2 -2
  29. package/dist/providers/moonshot.d.ts +2 -2
  30. package/dist/providers/openai-compatible-responses.d.ts +2 -2
  31. package/dist/providers/openai.d.ts +2 -2
  32. package/dist/providers/zai-coding-plan.d.ts +2 -2
  33. package/dist/route/client.d.ts +1 -1
  34. package/dist/route/executor.js +12 -8
  35. package/dist/schema/events.d.ts +30 -30
  36. package/dist/testing.d.ts +8 -8
  37. package/package.json +3 -3
@@ -1266,8 +1266,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1266
1266
  } | {
1267
1267
  readonly id: string;
1268
1268
  readonly type: "tool-error";
1269
- readonly name: string;
1270
1269
  readonly message: string;
1270
+ readonly name: string;
1271
1271
  readonly error?: unknown;
1272
1272
  readonly providerMetadata?: {
1273
1273
  readonly [x: string]: {
@@ -1513,8 +1513,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1513
1513
  }> | Extract<{
1514
1514
  readonly id: string;
1515
1515
  readonly type: "tool-error";
1516
- readonly name: string;
1517
1516
  readonly message: string;
1517
+ readonly name: string;
1518
1518
  readonly error?: unknown;
1519
1519
  readonly providerMetadata?: {
1520
1520
  readonly [x: string]: {
@@ -1750,8 +1750,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1750
1750
  "tool-error": (u: unknown) => u is {
1751
1751
  readonly id: string;
1752
1752
  readonly type: "tool-error";
1753
- readonly name: string;
1754
1753
  readonly message: string;
1754
+ readonly name: string;
1755
1755
  readonly error?: unknown;
1756
1756
  readonly providerMetadata?: {
1757
1757
  readonly [x: string]: {
@@ -1983,8 +1983,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
1983
1983
  "tool-error": (value: {
1984
1984
  readonly id: string;
1985
1985
  readonly type: "tool-error";
1986
- readonly name: string;
1987
1986
  readonly message: string;
1987
+ readonly name: string;
1988
1988
  readonly error?: unknown;
1989
1989
  readonly providerMetadata?: {
1990
1990
  readonly [x: string]: {
@@ -2199,8 +2199,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2199
2199
  } | {
2200
2200
  readonly id: string;
2201
2201
  readonly type: "tool-error";
2202
- readonly name: string;
2203
2202
  readonly message: string;
2203
+ readonly name: string;
2204
2204
  readonly error?: unknown;
2205
2205
  readonly providerMetadata?: {
2206
2206
  readonly [x: string]: {
@@ -2426,8 +2426,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2426
2426
  "tool-error": (value: {
2427
2427
  readonly id: string;
2428
2428
  readonly type: "tool-error";
2429
- readonly name: string;
2430
2429
  readonly message: string;
2430
+ readonly name: string;
2431
2431
  readonly error?: unknown;
2432
2432
  readonly providerMetadata?: {
2433
2433
  readonly [x: string]: {
@@ -2642,8 +2642,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2642
2642
  } | {
2643
2643
  readonly id: string;
2644
2644
  readonly type: "tool-error";
2645
- readonly name: string;
2646
2645
  readonly message: string;
2646
+ readonly name: string;
2647
2647
  readonly error?: unknown;
2648
2648
  readonly providerMetadata?: {
2649
2649
  readonly [x: string]: {
@@ -2871,8 +2871,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
2871
2871
  "tool-error"?: ((value: {
2872
2872
  readonly id: string;
2873
2873
  readonly type: "tool-error";
2874
- readonly name: string;
2875
2874
  readonly message: string;
2875
+ readonly name: string;
2876
2876
  readonly error?: unknown;
2877
2877
  readonly providerMetadata?: {
2878
2878
  readonly [x: string]: {
@@ -3123,8 +3123,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3123
3123
  }> | Exclude<{
3124
3124
  readonly id: string;
3125
3125
  readonly type: "tool-error";
3126
- readonly name: string;
3127
3126
  readonly message: string;
3127
+ readonly name: string;
3128
3128
  readonly error?: unknown;
3129
3129
  readonly providerMetadata?: {
3130
3130
  readonly [x: string]: {
@@ -3344,8 +3344,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3344
3344
  } | {
3345
3345
  readonly id: string;
3346
3346
  readonly type: "tool-error";
3347
- readonly name: string;
3348
3347
  readonly message: string;
3348
+ readonly name: string;
3349
3349
  readonly error?: unknown;
3350
3350
  readonly providerMetadata?: {
3351
3351
  readonly [x: string]: {
@@ -3571,8 +3571,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3571
3571
  "tool-error"?: ((value: {
3572
3572
  readonly id: string;
3573
3573
  readonly type: "tool-error";
3574
- readonly name: string;
3575
3574
  readonly message: string;
3575
+ readonly name: string;
3576
3576
  readonly error?: unknown;
3577
3577
  readonly providerMetadata?: {
3578
3578
  readonly [x: string]: {
@@ -3823,8 +3823,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
3823
3823
  }> | Exclude<{
3824
3824
  readonly id: string;
3825
3825
  readonly type: "tool-error";
3826
- readonly name: string;
3827
3826
  readonly message: string;
3827
+ readonly name: string;
3828
3828
  readonly error?: unknown;
3829
3829
  readonly providerMetadata?: {
3830
3830
  readonly [x: string]: {
@@ -4044,8 +4044,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
4044
4044
  } | {
4045
4045
  readonly id: string;
4046
4046
  readonly type: "tool-error";
4047
- readonly name: string;
4048
4047
  readonly message: string;
4048
+ readonly name: string;
4049
4049
  readonly error?: unknown;
4050
4050
  readonly providerMetadata?: {
4051
4051
  readonly [x: string]: {
@@ -4287,8 +4287,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
4287
4287
  toolError: (input: WithID<ToolError, ToolCallID>) => {
4288
4288
  readonly id: string;
4289
4289
  readonly type: "tool-error";
4290
- readonly name: string;
4291
4290
  readonly message: string;
4291
+ readonly name: string;
4292
4292
  readonly error?: unknown;
4293
4293
  readonly providerMetadata?: {
4294
4294
  readonly [x: string]: {
@@ -4535,8 +4535,8 @@ export declare const LLMEvent: Schema.Union<readonly [Schema.refine<{
4535
4535
  toolError: (u: unknown) => u is {
4536
4536
  readonly id: string;
4537
4537
  readonly type: "tool-error";
4538
- readonly name: string;
4539
4538
  readonly message: string;
4539
+ readonly name: string;
4540
4540
  readonly error?: unknown;
4541
4541
  readonly providerMetadata?: {
4542
4542
  readonly [x: string]: {
@@ -5249,8 +5249,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5249
5249
  } | {
5250
5250
  readonly id: string;
5251
5251
  readonly type: "tool-error";
5252
- readonly name: string;
5253
5252
  readonly message: string;
5253
+ readonly name: string;
5254
5254
  readonly error?: unknown;
5255
5255
  readonly providerMetadata?: {
5256
5256
  readonly [x: string]: {
@@ -5496,8 +5496,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5496
5496
  }> | Extract<{
5497
5497
  readonly id: string;
5498
5498
  readonly type: "tool-error";
5499
- readonly name: string;
5500
5499
  readonly message: string;
5500
+ readonly name: string;
5501
5501
  readonly error?: unknown;
5502
5502
  readonly providerMetadata?: {
5503
5503
  readonly [x: string]: {
@@ -5733,8 +5733,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5733
5733
  "tool-error": (u: unknown) => u is {
5734
5734
  readonly id: string;
5735
5735
  readonly type: "tool-error";
5736
- readonly name: string;
5737
5736
  readonly message: string;
5737
+ readonly name: string;
5738
5738
  readonly error?: unknown;
5739
5739
  readonly providerMetadata?: {
5740
5740
  readonly [x: string]: {
@@ -5966,8 +5966,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
5966
5966
  "tool-error": (value: {
5967
5967
  readonly id: string;
5968
5968
  readonly type: "tool-error";
5969
- readonly name: string;
5970
5969
  readonly message: string;
5970
+ readonly name: string;
5971
5971
  readonly error?: unknown;
5972
5972
  readonly providerMetadata?: {
5973
5973
  readonly [x: string]: {
@@ -6182,8 +6182,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6182
6182
  } | {
6183
6183
  readonly id: string;
6184
6184
  readonly type: "tool-error";
6185
- readonly name: string;
6186
6185
  readonly message: string;
6186
+ readonly name: string;
6187
6187
  readonly error?: unknown;
6188
6188
  readonly providerMetadata?: {
6189
6189
  readonly [x: string]: {
@@ -6409,8 +6409,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6409
6409
  "tool-error": (value: {
6410
6410
  readonly id: string;
6411
6411
  readonly type: "tool-error";
6412
- readonly name: string;
6413
6412
  readonly message: string;
6413
+ readonly name: string;
6414
6414
  readonly error?: unknown;
6415
6415
  readonly providerMetadata?: {
6416
6416
  readonly [x: string]: {
@@ -6625,8 +6625,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6625
6625
  } | {
6626
6626
  readonly id: string;
6627
6627
  readonly type: "tool-error";
6628
- readonly name: string;
6629
6628
  readonly message: string;
6629
+ readonly name: string;
6630
6630
  readonly error?: unknown;
6631
6631
  readonly providerMetadata?: {
6632
6632
  readonly [x: string]: {
@@ -6854,8 +6854,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
6854
6854
  "tool-error"?: ((value: {
6855
6855
  readonly id: string;
6856
6856
  readonly type: "tool-error";
6857
- readonly name: string;
6858
6857
  readonly message: string;
6858
+ readonly name: string;
6859
6859
  readonly error?: unknown;
6860
6860
  readonly providerMetadata?: {
6861
6861
  readonly [x: string]: {
@@ -7106,8 +7106,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7106
7106
  }> | Exclude<{
7107
7107
  readonly id: string;
7108
7108
  readonly type: "tool-error";
7109
- readonly name: string;
7110
7109
  readonly message: string;
7110
+ readonly name: string;
7111
7111
  readonly error?: unknown;
7112
7112
  readonly providerMetadata?: {
7113
7113
  readonly [x: string]: {
@@ -7327,8 +7327,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7327
7327
  } | {
7328
7328
  readonly id: string;
7329
7329
  readonly type: "tool-error";
7330
- readonly name: string;
7331
7330
  readonly message: string;
7331
+ readonly name: string;
7332
7332
  readonly error?: unknown;
7333
7333
  readonly providerMetadata?: {
7334
7334
  readonly [x: string]: {
@@ -7554,8 +7554,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7554
7554
  "tool-error"?: ((value: {
7555
7555
  readonly id: string;
7556
7556
  readonly type: "tool-error";
7557
- readonly name: string;
7558
7557
  readonly message: string;
7558
+ readonly name: string;
7559
7559
  readonly error?: unknown;
7560
7560
  readonly providerMetadata?: {
7561
7561
  readonly [x: string]: {
@@ -7806,8 +7806,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
7806
7806
  }> | Exclude<{
7807
7807
  readonly id: string;
7808
7808
  readonly type: "tool-error";
7809
- readonly name: string;
7810
7809
  readonly message: string;
7810
+ readonly name: string;
7811
7811
  readonly error?: unknown;
7812
7812
  readonly providerMetadata?: {
7813
7813
  readonly [x: string]: {
@@ -8027,8 +8027,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
8027
8027
  } | {
8028
8028
  readonly id: string;
8029
8029
  readonly type: "tool-error";
8030
- readonly name: string;
8031
8030
  readonly message: string;
8031
+ readonly name: string;
8032
8032
  readonly error?: unknown;
8033
8033
  readonly providerMetadata?: {
8034
8034
  readonly [x: string]: {
@@ -8270,8 +8270,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
8270
8270
  toolError: (input: WithID<ToolError, ToolCallID>) => {
8271
8271
  readonly id: string;
8272
8272
  readonly type: "tool-error";
8273
- readonly name: string;
8274
8273
  readonly message: string;
8274
+ readonly name: string;
8275
8275
  readonly error?: unknown;
8276
8276
  readonly providerMetadata?: {
8277
8277
  readonly [x: string]: {
@@ -8518,8 +8518,8 @@ declare const LLMResponse_base: Schema.Class<LLMResponse, Schema.Struct<{
8518
8518
  toolError: (u: unknown) => u is {
8519
8519
  readonly id: string;
8520
8520
  readonly type: "tool-error";
8521
- readonly name: string;
8522
8521
  readonly message: string;
8522
+ readonly name: string;
8523
8523
  readonly error?: unknown;
8524
8524
  readonly providerMetadata?: {
8525
8525
  readonly [x: string]: {
package/dist/testing.d.ts CHANGED
@@ -206,8 +206,8 @@ export declare const complete: (options: {
206
206
  } | {
207
207
  readonly id: string;
208
208
  readonly type: "tool-error";
209
- readonly name: string;
210
209
  readonly message: string;
210
+ readonly name: string;
211
211
  readonly error?: unknown;
212
212
  readonly providerMetadata?: {
213
213
  readonly [x: string]: {
@@ -418,8 +418,8 @@ export declare const stop: (...events: readonly LLMEvent[]) => (({
418
418
  } | {
419
419
  readonly id: string;
420
420
  readonly type: "tool-error";
421
- readonly name: string;
422
421
  readonly message: string;
422
+ readonly name: string;
423
423
  readonly error?: unknown;
424
424
  readonly providerMetadata?: {
425
425
  readonly [x: string]: {
@@ -630,8 +630,8 @@ export declare const toolCalls: (...events: readonly LLMEvent[]) => (({
630
630
  } | {
631
631
  readonly id: string;
632
632
  readonly type: "tool-error";
633
- readonly name: string;
634
633
  readonly message: string;
634
+ readonly name: string;
635
635
  readonly error?: unknown;
636
636
  readonly providerMetadata?: {
637
637
  readonly [x: string]: {
@@ -842,8 +842,8 @@ export declare const text: (value: string, id: string) => (({
842
842
  } | {
843
843
  readonly id: string;
844
844
  readonly type: "tool-error";
845
- readonly name: string;
846
845
  readonly message: string;
846
+ readonly name: string;
847
847
  readonly error?: unknown;
848
848
  readonly providerMetadata?: {
849
849
  readonly [x: string]: {
@@ -1054,8 +1054,8 @@ export declare const textWithUsage: (value: string, id: string, inputTokens: num
1054
1054
  } | {
1055
1055
  readonly id: string;
1056
1056
  readonly type: "tool-error";
1057
- readonly name: string;
1058
1057
  readonly message: string;
1058
+ readonly name: string;
1059
1059
  readonly error?: unknown;
1060
1060
  readonly providerMetadata?: {
1061
1061
  readonly [x: string]: {
@@ -1266,8 +1266,8 @@ export declare const tool: (id: string, name: string, input: unknown) => (({
1266
1266
  } | {
1267
1267
  readonly id: string;
1268
1268
  readonly type: "tool-error";
1269
- readonly name: string;
1270
1269
  readonly message: string;
1270
+ readonly name: string;
1271
1271
  readonly error?: unknown;
1272
1272
  readonly providerMetadata?: {
1273
1273
  readonly [x: string]: {
@@ -1478,8 +1478,8 @@ export declare const failAfter: (error: AIError, ...events: readonly LLMEvent[])
1478
1478
  } | {
1479
1479
  readonly id: string;
1480
1480
  readonly type: "tool-error";
1481
- readonly name: string;
1482
1481
  readonly message: string;
1482
+ readonly name: string;
1483
1483
  readonly error?: unknown;
1484
1484
  readonly providerMetadata?: {
1485
1485
  readonly [x: string]: {
@@ -1690,8 +1690,8 @@ export declare const hangAfter: (...events: readonly LLMEvent[]) => Stream.Strea
1690
1690
  } | {
1691
1691
  readonly id: string;
1692
1692
  readonly type: "tool-error";
1693
- readonly name: string;
1694
1693
  readonly message: string;
1694
+ readonly name: string;
1695
1695
  readonly error?: unknown;
1696
1696
  readonly providerMetadata?: {
1697
1697
  readonly [x: string]: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "2.0.19",
3
+ "version": "2.0.20",
4
4
  "name": "@opencode/ai",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "devDependencies": {
35
35
  "@clack/prompts": "1.0.0-alpha.1",
36
36
  "@effect/platform-node": "4.0.0-rc.112",
37
- "@opencode/http-recorder": "2.0.19",
37
+ "@opencode/http-recorder": "2.0.20",
38
38
  "@tsconfig/bun": "1.0.9",
39
39
  "@types/bun": "1.4.0",
40
40
  "@typescript/native-preview": "7.0.0-dev.20251207.1",
@@ -44,7 +44,7 @@
44
44
  "@aws-sdk/credential-providers": "3.1057.0",
45
45
  "@smithy/eventstream-codec": "4.2.14",
46
46
  "@smithy/util-utf8": "4.2.2",
47
- "@opencode/schema": "2.0.19",
47
+ "@opencode/schema": "2.0.20",
48
48
  "aws4fetch": "1.0.20",
49
49
  "effect": "4.0.0-rc.112",
50
50
  "google-auth-library": "10.5.0"