@opencode/ai 0.0.0-dev-19594 → 0.0.0-dev-19596

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 (56) hide show
  1. package/dist/cache-policy.js +10 -2
  2. package/dist/effort-updates.d.ts +12 -0
  3. package/dist/effort-updates.js +23 -0
  4. package/dist/protocols/alibaba-messages.d.ts +4 -1
  5. package/dist/protocols/anthropic-messages.d.ts +11 -2
  6. package/dist/protocols/anthropic-messages.js +48 -17
  7. package/dist/protocols/meta-messages.d.ts +4 -1
  8. package/dist/protocols/meta-responses.d.ts +2 -2
  9. package/dist/protocols/open-responses.d.ts +9 -2
  10. package/dist/protocols/open-responses.js +17 -2
  11. package/dist/protocols/openai-chat.d.ts +7 -7
  12. package/dist/protocols/openai-compatible-chat.d.ts +1 -1
  13. package/dist/protocols/openai-compatible-responses.d.ts +1 -1
  14. package/dist/protocols/openai-responses.d.ts +56 -25
  15. package/dist/protocols/openai-responses.js +23 -4
  16. package/dist/protocols/utils/open-responses-options.d.ts +2 -4
  17. package/dist/protocols/utils/open-responses-options.js +2 -2
  18. package/dist/protocols/utils/responses-compaction.js +3 -1
  19. package/dist/protocols/xai-responses.d.ts +1 -1
  20. package/dist/protocols/zai-chat.d.ts +1 -1
  21. package/dist/protocols/zai-messages.d.ts +4 -1
  22. package/dist/providers/alibaba.d.ts +12 -9
  23. package/dist/providers/amazon-bedrock-mantle.d.ts +2 -2
  24. package/dist/providers/anthropic-compatible.d.ts +4 -1
  25. package/dist/providers/anthropic.d.ts +4 -1
  26. package/dist/providers/azure.d.ts +13 -3
  27. package/dist/providers/baseten.d.ts +2 -2
  28. package/dist/providers/cerebras.d.ts +2 -2
  29. package/dist/providers/cloudflare-ai-gateway.d.ts +2 -2
  30. package/dist/providers/cloudflare-workers-ai.d.ts +2 -2
  31. package/dist/providers/deepinfra.d.ts +2 -2
  32. package/dist/providers/deepseek.d.ts +2 -2
  33. package/dist/providers/fireworks.d.ts +2 -2
  34. package/dist/providers/google-vertex-chat.d.ts +1 -1
  35. package/dist/providers/google-vertex-messages.d.ts +4 -1
  36. package/dist/providers/google-vertex-responses.d.ts +1 -1
  37. package/dist/providers/groq.d.ts +2 -2
  38. package/dist/providers/meta.d.ts +6 -3
  39. package/dist/providers/minimax.d.ts +6 -3
  40. package/dist/providers/moonshot.d.ts +6 -3
  41. package/dist/providers/openai-compatible-responses.d.ts +1 -1
  42. package/dist/providers/openai-compatible.d.ts +1 -1
  43. package/dist/providers/openai.d.ts +7 -2
  44. package/dist/providers/openrouter.d.ts +4 -4
  45. package/dist/providers/togetherai.d.ts +2 -2
  46. package/dist/providers/xai.d.ts +1 -1
  47. package/dist/providers/zai-coding-plan.d.ts +6 -3
  48. package/dist/providers/zai.d.ts +1 -1
  49. package/dist/route/client.d.ts +1 -0
  50. package/dist/route/client.js +3 -1
  51. package/dist/route/protocol.d.ts +2 -0
  52. package/dist/schema/messages.d.ts +22 -3
  53. package/dist/schema/messages.js +9 -1
  54. package/dist/schema/options.d.ts +5 -0
  55. package/dist/schema/options.js +4 -0
  56. package/package.json +3 -3
@@ -114,7 +114,7 @@ export declare const route: Route<{
114
114
  readonly frequency_penalty?: number | undefined;
115
115
  readonly presence_penalty?: number | undefined;
116
116
  readonly prompt_cache_key?: string | undefined;
117
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
117
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
118
118
  readonly store?: boolean | undefined;
119
119
  readonly stream_options?: {
120
120
  readonly include_usage: boolean;
@@ -213,7 +213,7 @@ export declare const routes: Route<{
213
213
  readonly frequency_penalty?: number | undefined;
214
214
  readonly presence_penalty?: number | undefined;
215
215
  readonly prompt_cache_key?: string | undefined;
216
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
216
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
217
217
  readonly store?: boolean | undefined;
218
218
  readonly stream_options?: {
219
219
  readonly include_usage: boolean;
@@ -108,7 +108,7 @@ export declare const route: Route<{
108
108
  readonly frequency_penalty?: number | undefined;
109
109
  readonly presence_penalty?: number | undefined;
110
110
  readonly prompt_cache_key?: string | undefined;
111
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
111
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
112
112
  readonly store?: boolean | undefined;
113
113
  readonly stream_options?: {
114
114
  readonly include_usage: boolean;
@@ -207,7 +207,7 @@ export declare const routes: Route<{
207
207
  readonly frequency_penalty?: number | undefined;
208
208
  readonly presence_penalty?: number | undefined;
209
209
  readonly prompt_cache_key?: string | undefined;
210
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
210
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
211
211
  readonly store?: boolean | undefined;
212
212
  readonly stream_options?: {
213
213
  readonly include_usage: boolean;
@@ -104,7 +104,7 @@ export declare const route: Route<{
104
104
  readonly frequency_penalty?: number | undefined;
105
105
  readonly presence_penalty?: number | undefined;
106
106
  readonly prompt_cache_key?: string | undefined;
107
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
107
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
108
108
  readonly store?: boolean | undefined;
109
109
  readonly stream_options?: {
110
110
  readonly include_usage: boolean;
@@ -203,7 +203,7 @@ export declare const routes: Route<{
203
203
  readonly frequency_penalty?: number | undefined;
204
204
  readonly presence_penalty?: number | undefined;
205
205
  readonly prompt_cache_key?: string | undefined;
206
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
206
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
207
207
  readonly store?: boolean | undefined;
208
208
  readonly stream_options?: {
209
209
  readonly include_usage: boolean;
@@ -104,7 +104,7 @@ export declare const route: Route<{
104
104
  readonly frequency_penalty?: number | undefined;
105
105
  readonly presence_penalty?: number | undefined;
106
106
  readonly prompt_cache_key?: string | undefined;
107
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
107
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
108
108
  readonly store?: boolean | undefined;
109
109
  readonly stream_options?: {
110
110
  readonly include_usage: boolean;
@@ -203,7 +203,7 @@ export declare const routes: Route<{
203
203
  readonly frequency_penalty?: number | undefined;
204
204
  readonly presence_penalty?: number | undefined;
205
205
  readonly prompt_cache_key?: string | undefined;
206
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
206
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
207
207
  readonly store?: boolean | undefined;
208
208
  readonly stream_options?: {
209
209
  readonly include_usage: boolean;
@@ -104,7 +104,7 @@ export declare const route: Route<{
104
104
  readonly frequency_penalty?: number | undefined;
105
105
  readonly presence_penalty?: number | undefined;
106
106
  readonly prompt_cache_key?: string | undefined;
107
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
107
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
108
108
  readonly store?: boolean | undefined;
109
109
  readonly stream_options?: {
110
110
  readonly include_usage: boolean;
@@ -203,7 +203,7 @@ export declare const routes: Route<{
203
203
  readonly frequency_penalty?: number | undefined;
204
204
  readonly presence_penalty?: number | undefined;
205
205
  readonly prompt_cache_key?: string | undefined;
206
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
206
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
207
207
  readonly store?: boolean | undefined;
208
208
  readonly stream_options?: {
209
209
  readonly include_usage: boolean;
@@ -109,7 +109,7 @@ export declare const routes: Route<{
109
109
  readonly frequency_penalty?: number | undefined;
110
110
  readonly presence_penalty?: number | undefined;
111
111
  readonly prompt_cache_key?: string | undefined;
112
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
112
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
113
113
  readonly store?: boolean | undefined;
114
114
  readonly stream_options?: {
115
115
  readonly include_usage: boolean;
@@ -218,7 +218,6 @@ export declare const routes: Route<{
218
218
  readonly content: string | null;
219
219
  })[];
220
220
  } | {
221
- readonly role: "system";
222
221
  readonly content: readonly {
223
222
  readonly type: "text";
224
223
  readonly text: string;
@@ -227,6 +226,10 @@ export declare const routes: Route<{
227
226
  readonly ttl?: "1h" | "5m" | undefined;
228
227
  } | undefined;
229
228
  }[];
229
+ readonly role: "system";
230
+ readonly output_config?: {
231
+ readonly effort: string;
232
+ } | undefined;
230
233
  })[];
231
234
  temperature?: number | undefined;
232
235
  stream: true;
@@ -138,7 +138,7 @@ export declare const routes: Route<{
138
138
  readonly instructions?: string | undefined;
139
139
  readonly reasoning?: {
140
140
  readonly summary?: "auto" | "concise" | "detailed" | undefined;
141
- readonly effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
141
+ readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
142
142
  } | undefined;
143
143
  readonly tools?: readonly {
144
144
  readonly type: "function";
@@ -116,7 +116,7 @@ export declare const protocol: Protocol<{
116
116
  readonly presence_penalty?: number | undefined;
117
117
  readonly prompt_cache_key?: string | undefined;
118
118
  readonly parallel_tool_calls?: boolean | undefined;
119
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
119
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
120
120
  readonly store?: boolean | undefined;
121
121
  readonly stream_options?: {
122
122
  readonly include_usage: boolean;
@@ -287,7 +287,7 @@ export declare const route: Route<{
287
287
  readonly presence_penalty?: number | undefined;
288
288
  readonly prompt_cache_key?: string | undefined;
289
289
  readonly parallel_tool_calls?: boolean | undefined;
290
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
290
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
291
291
  readonly store?: boolean | undefined;
292
292
  readonly stream_options?: {
293
293
  readonly include_usage: boolean;
@@ -130,7 +130,7 @@ export declare const routes: (Route<{
130
130
  readonly frequency_penalty?: number | undefined;
131
131
  readonly presence_penalty?: number | undefined;
132
132
  readonly prompt_cache_key?: string | undefined;
133
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
133
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
134
134
  readonly store?: boolean | undefined;
135
135
  readonly stream_options?: {
136
136
  readonly include_usage: boolean;
@@ -264,7 +264,7 @@ export declare const routes: (Route<{
264
264
  readonly instructions?: string | undefined;
265
265
  readonly reasoning?: {
266
266
  readonly summary?: "auto" | "concise" | "detailed" | undefined;
267
- readonly effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
267
+ readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
268
268
  } | undefined;
269
269
  readonly tools?: readonly ({
270
270
  readonly type: "function";
@@ -500,7 +500,6 @@ export declare const routes: (Route<{
500
500
  readonly content: string | null;
501
501
  })[];
502
502
  } | {
503
- readonly role: "system";
504
503
  readonly content: readonly {
505
504
  readonly type: "text";
506
505
  readonly text: string;
@@ -509,6 +508,10 @@ export declare const routes: (Route<{
509
508
  readonly ttl?: "1h" | "5m" | undefined;
510
509
  } | undefined;
511
510
  }[];
511
+ readonly role: "system";
512
+ readonly output_config?: {
513
+ readonly effort: string;
514
+ } | undefined;
512
515
  })[];
513
516
  readonly stream: true;
514
517
  readonly metadata?: {
@@ -209,7 +209,6 @@ export declare const routes: (Route<{
209
209
  readonly content: string | null;
210
210
  })[];
211
211
  } | {
212
- readonly role: "system";
213
212
  readonly content: readonly {
214
213
  readonly type: "text";
215
214
  readonly text: string;
@@ -218,6 +217,10 @@ export declare const routes: (Route<{
218
217
  readonly ttl?: "1h" | "5m" | undefined;
219
218
  } | undefined;
220
219
  }[];
220
+ readonly role: "system";
221
+ readonly output_config?: {
222
+ readonly effort: string;
223
+ } | undefined;
221
224
  })[];
222
225
  readonly stream: true;
223
226
  readonly metadata?: {
@@ -423,7 +426,7 @@ export declare const routes: (Route<{
423
426
  readonly instructions?: string | undefined;
424
427
  readonly reasoning?: {
425
428
  readonly summary?: "auto" | "concise" | "detailed" | undefined;
426
- readonly effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
429
+ readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
427
430
  } | undefined;
428
431
  readonly tools?: readonly {
429
432
  readonly type: "function";
@@ -561,7 +564,7 @@ export declare const routes: (Route<{
561
564
  readonly frequency_penalty?: number | undefined;
562
565
  readonly presence_penalty?: number | undefined;
563
566
  readonly prompt_cache_key?: string | undefined;
564
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
567
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
565
568
  readonly store?: boolean | undefined;
566
569
  readonly stream_options?: {
567
570
  readonly include_usage: boolean;
@@ -207,7 +207,6 @@ export declare const routes: (Route<{
207
207
  readonly content: string | null;
208
208
  })[];
209
209
  } | {
210
- readonly role: "system";
211
210
  readonly content: readonly {
212
211
  readonly type: "text";
213
212
  readonly text: string;
@@ -216,6 +215,10 @@ export declare const routes: (Route<{
216
215
  readonly ttl?: "1h" | "5m" | undefined;
217
216
  } | undefined;
218
217
  }[];
218
+ readonly role: "system";
219
+ readonly output_config?: {
220
+ readonly effort: string;
221
+ } | undefined;
219
222
  })[];
220
223
  readonly stream: true;
221
224
  readonly metadata?: {
@@ -421,7 +424,7 @@ export declare const routes: (Route<{
421
424
  readonly instructions?: string | undefined;
422
425
  readonly reasoning?: {
423
426
  readonly summary?: "auto" | "concise" | "detailed" | undefined;
424
- readonly effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
427
+ readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
425
428
  } | undefined;
426
429
  readonly tools?: readonly {
427
430
  readonly type: "function";
@@ -559,7 +562,7 @@ export declare const routes: (Route<{
559
562
  readonly frequency_penalty?: number | undefined;
560
563
  readonly presence_penalty?: number | undefined;
561
564
  readonly prompt_cache_key?: string | undefined;
562
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
565
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
563
566
  readonly store?: boolean | undefined;
564
567
  readonly stream_options?: {
565
568
  readonly include_usage: boolean;
@@ -136,7 +136,7 @@ export declare const routes: import("../route/client.js").Route<{
136
136
  readonly instructions?: string | undefined;
137
137
  readonly reasoning?: {
138
138
  readonly summary?: "auto" | "concise" | "detailed" | undefined;
139
- readonly effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
139
+ readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
140
140
  } | undefined;
141
141
  readonly tools?: readonly {
142
142
  readonly type: "function";
@@ -106,7 +106,7 @@ export declare const routes: import("../route/client.js").Route<{
106
106
  readonly frequency_penalty?: number | undefined;
107
107
  readonly presence_penalty?: number | undefined;
108
108
  readonly prompt_cache_key?: string | undefined;
109
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
109
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
110
110
  readonly store?: boolean | undefined;
111
111
  readonly stream_options?: {
112
112
  readonly include_usage: boolean;
@@ -100,7 +100,7 @@ export declare const routes: (Route<{
100
100
  readonly frequency_penalty?: number | undefined;
101
101
  readonly presence_penalty?: number | undefined;
102
102
  readonly prompt_cache_key?: string | undefined;
103
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
103
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
104
104
  readonly store?: boolean | undefined;
105
105
  readonly stream_options?: {
106
106
  readonly include_usage: boolean;
@@ -144,6 +144,11 @@ export declare const routes: (Route<{
144
144
  readonly error?: unknown;
145
145
  readonly arguments?: string | undefined;
146
146
  readonly server_label?: string | undefined;
147
+ } | {
148
+ readonly type: "configuration_update";
149
+ readonly reasoning: {
150
+ readonly effort: import("../schema/options.js").ReasoningEffort;
151
+ };
147
152
  } | {
148
153
  readonly type: "reasoning";
149
154
  readonly summary: readonly {
@@ -255,7 +260,7 @@ export declare const routes: (Route<{
255
260
  readonly instructions?: string | undefined;
256
261
  readonly reasoning?: {
257
262
  readonly summary?: "auto" | "concise" | "detailed" | undefined;
258
- readonly effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
263
+ readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
259
264
  } | undefined;
260
265
  readonly tools?: readonly ({
261
266
  readonly type: "function";
@@ -166,7 +166,7 @@ declare const OpenRouterBody: Schema.StructWithRest<Schema.Struct<{
166
166
  }>>;
167
167
  store: Schema.optional<Schema.Boolean>;
168
168
  prompt_cache_key: Schema.optional<Schema.String>;
169
- reasoning_effort: Schema.optional<Schema.declare<import("../protocols/utils/open-responses-options.js").ReasoningEffort, import("../protocols/utils/open-responses-options.js").ReasoningEffort>>;
169
+ reasoning_effort: Schema.optional<Schema.declare<import("../schema/options.js").ReasoningEffort, import("../schema/options.js").ReasoningEffort>>;
170
170
  tool_stream: Schema.optional<Schema.Boolean>;
171
171
  max_completion_tokens: Schema.optional<Schema.Number>;
172
172
  max_tokens: Schema.optional<Schema.Number>;
@@ -271,7 +271,7 @@ export declare const protocol: Protocol<{
271
271
  readonly frequency_penalty?: number | undefined;
272
272
  readonly presence_penalty?: number | undefined;
273
273
  readonly prompt_cache_key?: string | undefined;
274
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
274
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
275
275
  readonly store?: boolean | undefined;
276
276
  readonly stream_options?: {
277
277
  readonly include_usage: boolean;
@@ -438,7 +438,7 @@ export declare const route: Route<{
438
438
  readonly frequency_penalty?: number | undefined;
439
439
  readonly presence_penalty?: number | undefined;
440
440
  readonly prompt_cache_key?: string | undefined;
441
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
441
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
442
442
  readonly store?: boolean | undefined;
443
443
  readonly stream_options?: {
444
444
  readonly include_usage: boolean;
@@ -538,7 +538,7 @@ export declare const routes: Route<{
538
538
  readonly frequency_penalty?: number | undefined;
539
539
  readonly presence_penalty?: number | undefined;
540
540
  readonly prompt_cache_key?: string | undefined;
541
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
541
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
542
542
  readonly store?: boolean | undefined;
543
543
  readonly stream_options?: {
544
544
  readonly include_usage: boolean;
@@ -104,7 +104,7 @@ export declare const route: Route<{
104
104
  readonly frequency_penalty?: number | undefined;
105
105
  readonly presence_penalty?: number | undefined;
106
106
  readonly prompt_cache_key?: string | undefined;
107
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
107
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
108
108
  readonly store?: boolean | undefined;
109
109
  readonly stream_options?: {
110
110
  readonly include_usage: boolean;
@@ -203,7 +203,7 @@ export declare const routes: Route<{
203
203
  readonly frequency_penalty?: number | undefined;
204
204
  readonly presence_penalty?: number | undefined;
205
205
  readonly prompt_cache_key?: string | undefined;
206
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
206
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
207
207
  readonly store?: boolean | undefined;
208
208
  readonly stream_options?: {
209
209
  readonly include_usage: boolean;
@@ -111,7 +111,7 @@ export declare const routes: (Route<{
111
111
  readonly frequency_penalty?: number | undefined;
112
112
  readonly presence_penalty?: number | undefined;
113
113
  readonly prompt_cache_key?: string | undefined;
114
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
114
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
115
115
  readonly store?: boolean | undefined;
116
116
  readonly stream_options?: {
117
117
  readonly include_usage: boolean;
@@ -140,7 +140,7 @@ export declare const routes: (Route<{
140
140
  readonly instructions?: string | undefined;
141
141
  readonly reasoning?: {
142
142
  readonly summary?: "auto" | "concise" | "detailed" | undefined;
143
- readonly effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
143
+ readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
144
144
  } | undefined;
145
145
  readonly tools?: readonly {
146
146
  readonly type: "function";
@@ -279,7 +279,7 @@ export declare const routes: (Route<{
279
279
  readonly frequency_penalty?: number | undefined;
280
280
  readonly presence_penalty?: number | undefined;
281
281
  readonly prompt_cache_key?: string | undefined;
282
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
282
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
283
283
  readonly store?: boolean | undefined;
284
284
  readonly stream_options?: {
285
285
  readonly include_usage: boolean;
@@ -466,7 +466,6 @@ export declare const routes: (Route<{
466
466
  readonly content: string | null;
467
467
  })[];
468
468
  } | {
469
- readonly role: "system";
470
469
  readonly content: readonly {
471
470
  readonly type: "text";
472
471
  readonly text: string;
@@ -475,6 +474,10 @@ export declare const routes: (Route<{
475
474
  readonly ttl?: "1h" | "5m" | undefined;
476
475
  } | undefined;
477
476
  }[];
477
+ readonly role: "system";
478
+ readonly output_config?: {
479
+ readonly effort: string;
480
+ } | undefined;
478
481
  })[];
479
482
  readonly stream: true;
480
483
  readonly metadata?: {
@@ -111,7 +111,7 @@ export declare const routes: Route<{
111
111
  readonly frequency_penalty?: number | undefined;
112
112
  readonly presence_penalty?: number | undefined;
113
113
  readonly prompt_cache_key?: string | undefined;
114
- readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
114
+ readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
115
115
  readonly store?: boolean | undefined;
116
116
  readonly stream_options?: {
117
117
  readonly include_usage: boolean;
@@ -30,6 +30,7 @@ export interface Route<Body, Prepared = unknown, Compact extends CompactionOpera
30
30
  readonly transport: Transport<Body, Prepared, unknown>;
31
31
  readonly defaults: RouteDefaults;
32
32
  readonly body: RouteBody<Body>;
33
+ readonly supportsEffortUpdates?: (request: LLMRequest) => boolean;
33
34
  readonly with: {
34
35
  <Next extends CompactionOperations | undefined>(patch: RoutePatch<Body, Prepared> & {
35
36
  readonly compact: Next;
@@ -5,6 +5,7 @@ import { RequestExecutor } from "./executor.js";
5
5
  import { Framing } from "./framing.js";
6
6
  import { HttpTransport } from "./transport/index.js";
7
7
  import { applyCachePolicy } from "../cache-policy.js";
8
+ import { applyEffortUpdates } from "../effort-updates.js";
8
9
  import { normalizeToolHistory } from "../tool-history.js";
9
10
  import { sanitizeSurrogates } from "../utils/sanitize.js";
10
11
  import * as ProviderShared from "../protocols/shared.js";
@@ -120,6 +121,7 @@ function makeFromTransport(input) {
120
121
  transport: routeInput.transport,
121
122
  defaults: routeInput.defaults ?? {},
122
123
  body: protocol.body,
124
+ supportsEffortUpdates: protocol.supportsEffortUpdates,
123
125
  with: (patch) => {
124
126
  const { compact, id, provider, providerMetadataKey, auth, transport, endpoint, ...defaults } = patch;
125
127
  return build({
@@ -212,7 +214,7 @@ const prepareRequest = (request) => {
212
214
  const sanitized = LLMRequest.update(original, sanitizeSurrogates({ ...LLMRequest.input(original), model: undefined }));
213
215
  // Deduplicate per sibling level; a tool and a namespace may share a name.
214
216
  const dedupe = (tools) => [...new Map(tools.map((tool) => [`${tool.type}:${tool.name}`, tool])).values()].map((tool) => tool.type === "tool" ? tool : { ...tool, tools: dedupe(tool.tools) });
215
- const resolved = applyCachePolicy(LLMRequest.update(sanitized, { tools: dedupe(sanitized.tools) }));
217
+ const resolved = applyCachePolicy(applyEffortUpdates(LLMRequest.update(sanitized, { tools: dedupe(sanitized.tools) })));
216
218
  const headers = resolved.model.route.headers?.({ request: resolved });
217
219
  return headers === undefined
218
220
  ? resolved
@@ -40,6 +40,8 @@ export interface Protocol<Body, Frame, Event, State> {
40
40
  readonly body: ProtocolBody<Body>;
41
41
  /** Response side: streaming state machine. */
42
42
  readonly stream: ProtocolStream<Frame, Event, State>;
43
+ /** Whether `body.from` lowers `Message.effort(...)` markers; wrappers around another `body.from` must forward it. */
44
+ readonly supportsEffortUpdates?: (request: LLMRequest) => boolean;
43
45
  }
44
46
  export interface ProtocolBody<Body> {
45
47
  /** Schema for the validated provider-native body sent as the JSON request. */
@@ -1,6 +1,6 @@
1
1
  import { Schema } from "effect";
2
2
  import { Tool } from "@opencode/schema/tool";
3
- import { CacheHint, GenerationOptions, HttpOptions, type LanguageModel } from "./options.js";
3
+ import { CacheHint, GenerationOptions, HttpOptions, type LanguageModel, ReasoningEffort } from "./options.js";
4
4
  export declare const MessageRole: Schema.Literals<readonly ["system", "user", "assistant", "tool"]>;
5
5
  export type MessageRole = Schema.Schema.Type<typeof MessageRole>;
6
6
  export declare const ProviderMetadata: Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>;
@@ -247,6 +247,13 @@ export declare const CompactionPart: Schema.refine<{
247
247
  }>> & {
248
248
  make: (input: Omit<CompactionPart, "type" | "encrypted" | "text"> & CompactionContent) => CompactionPart;
249
249
  };
250
+ /** Reasoning effort changed here, from `previous` to `effort`; `undefined` is the model default. */
251
+ export declare const EffortPart: Schema.Struct<{
252
+ readonly type: Schema.Literal<"effort">;
253
+ readonly effort: Schema.optional<Schema.declare<ReasoningEffort, ReasoningEffort>>;
254
+ readonly previous: Schema.optional<Schema.declare<ReasoningEffort, ReasoningEffort>>;
255
+ }>;
256
+ export type EffortPart = Schema.Schema.Type<typeof EffortPart>;
250
257
  export declare const ContentPart: Schema.toTaggedUnion<"type", readonly [Schema.Struct<{
251
258
  readonly type: Schema.Literal<"text">;
252
259
  readonly text: Schema.String;
@@ -353,7 +360,11 @@ export declare const ContentPart: Schema.toTaggedUnion<"type", readonly [Schema.
353
360
  readonly text: Schema.optional<Schema.NullOr<Schema.String>>;
354
361
  }>> & {
355
362
  make: (input: Omit<CompactionPart, "type" | "encrypted" | "text"> & CompactionContent) => CompactionPart;
356
- }]>;
363
+ }, Schema.Struct<{
364
+ readonly type: Schema.Literal<"effort">;
365
+ readonly effort: Schema.optional<Schema.declare<ReasoningEffort, ReasoningEffort>>;
366
+ readonly previous: Schema.optional<Schema.declare<ReasoningEffort, ReasoningEffort>>;
367
+ }>]>;
357
368
  export type ContentPart = Schema.Schema.Type<typeof ContentPart>;
358
369
  declare const Message_base: Schema.Class<Message, Schema.Struct<{
359
370
  readonly id: Schema.optional<Schema.String>;
@@ -464,7 +475,11 @@ declare const Message_base: Schema.Class<Message, Schema.Struct<{
464
475
  readonly text: Schema.optional<Schema.NullOr<Schema.String>>;
465
476
  }>> & {
466
477
  make: (input: Omit<CompactionPart, "type" | "encrypted" | "text"> & CompactionContent) => CompactionPart;
467
- }]>>;
478
+ }, Schema.Struct<{
479
+ readonly type: Schema.Literal<"effort">;
480
+ readonly effort: Schema.optional<Schema.declare<ReasoningEffort, ReasoningEffort>>;
481
+ readonly previous: Schema.optional<Schema.declare<ReasoningEffort, ReasoningEffort>>;
482
+ }>]>>;
468
483
  readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
469
484
  readonly providerMetadata: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Unknown>>>;
470
485
  readonly native: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
@@ -489,6 +504,10 @@ export declare namespace Message {
489
504
  * updates; pass that untrusted content through ordinary user/tool channels.
490
505
  */
491
506
  const system: (content: SystemContentInput) => Message;
507
+ const effort: (input: {
508
+ readonly effort?: ReasoningEffort;
509
+ readonly previous?: ReasoningEffort;
510
+ }) => Message;
492
511
  const tool: (result: ToolResultPart | Parameters<typeof ToolResultPart.make>[0]) => Message;
493
512
  }
494
513
  declare const toolDefinitionFields: {
@@ -1,6 +1,6 @@
1
1
  import { Schema } from "effect";
2
2
  import { Tool } from "@opencode/schema/tool";
3
- import { CacheHint, CachePolicy, GenerationOptions, HttpOptions, JsonSchema, LanguageModelSchema, ProviderOptions, } from "./options.js";
3
+ import { CacheHint, CachePolicy, GenerationOptions, HttpOptions, JsonSchema, LanguageModelSchema, ProviderOptions, ReasoningEffort, } from "./options.js";
4
4
  import { ProviderID } from "./ids.js";
5
5
  export const MessageRole = Schema.Literals(["system", "user", "assistant", "tool"]);
6
6
  export const ProviderMetadata = Schema.Record(Schema.String, Schema.Record(Schema.String, Schema.Unknown)).annotate({
@@ -158,6 +158,12 @@ const compactionPartSchema = Schema.Struct({
158
158
  export const CompactionPart = Object.assign(compactionPartSchema, {
159
159
  make: (input) => Schema.decodeUnknownSync(compactionPartSchema)({ type: "compaction", ...input }),
160
160
  });
161
+ /** Reasoning effort changed here, from `previous` to `effort`; `undefined` is the model default. */
162
+ export const EffortPart = Schema.Struct({
163
+ type: Schema.Literal("effort"),
164
+ effort: Schema.optional(ReasoningEffort),
165
+ previous: Schema.optional(ReasoningEffort),
166
+ }).annotate({ identifier: "LLM.Content.Effort" });
161
167
  export const ContentPart = Schema.Union([
162
168
  TextPart,
163
169
  MediaPart,
@@ -165,6 +171,7 @@ export const ContentPart = Schema.Union([
165
171
  ToolResultPart,
166
172
  ReasoningPart,
167
173
  CompactionPart,
174
+ EffortPart,
168
175
  ]).pipe(Schema.toTaggedUnion("type"));
169
176
  export class Message extends Schema.Class("LLM.Message")({
170
177
  id: Schema.optional(Schema.String),
@@ -192,6 +199,7 @@ export class Message extends Schema.Class("LLM.Message")({
192
199
  * updates; pass that untrusted content through ordinary user/tool channels.
193
200
  */
194
201
  Message.system = (content) => Message.make({ role: "system", content });
202
+ Message.effort = (input) => Message.make({ role: "system", content: [{ type: "effort", effort: input.effort, previous: input.previous }] });
195
203
  Message.tool = (result) => Message.make({ role: "tool", content: ["type" in result ? result : ToolResultPart.make(result)] });
196
204
  })(Message || (Message = {}));
197
205
  const toolDefinitionFields = {
@@ -65,6 +65,9 @@ export declare namespace LanguageModelDefaults {
65
65
  /** Normalize selected-model request defaults without applying precedence. */
66
66
  const make: (input: Input) => LanguageModelDefaults;
67
67
  }
68
+ export declare const ReasoningEfforts: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
69
+ export type ReasoningEffort = (typeof ReasoningEfforts)[number] | (string & {});
70
+ export declare const ReasoningEffort: Schema.declare<ReasoningEffort, ReasoningEffort>;
68
71
  export declare const LanguageModelToolSchemaCompatibility: Schema.Literals<readonly ["gemini", "moonshot"]>;
69
72
  export type LanguageModelToolSchemaCompatibility = Schema.Schema.Type<typeof LanguageModelToolSchemaCompatibility>;
70
73
  export declare const LanguageModelMaxTokensFieldCompatibility: Schema.Literals<readonly ["max_completion_tokens", "max_tokens"]>;
@@ -84,6 +87,8 @@ declare const LanguageModelCompatibility_base: Schema.Class<LanguageModelCompati
84
87
  readonly requireSignature: Schema.optional<Schema.Boolean>;
85
88
  /** Supports Anthropic's thinking-prefix mismatch controls. Overrides model-ID detection. */
86
89
  readonly supportsThinkingBlockBinding: Schema.optional<Schema.Boolean>;
90
+ /** Supports per-message effort updates. Overrides model-ID detection. */
91
+ readonly supportsEffortUpdates: Schema.optional<Schema.Boolean>;
87
92
  }>, {}>;
88
93
  export declare class LanguageModelCompatibility extends LanguageModelCompatibility_base {
89
94
  }
@@ -94,6 +94,8 @@ export class LanguageModelDefaults extends Schema.Class("LLM.LanguageModelDefaul
94
94
  });
95
95
  };
96
96
  })(LanguageModelDefaults || (LanguageModelDefaults = {}));
97
+ export const ReasoningEfforts = ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
98
+ export const ReasoningEffort = Schema.declare((value) => typeof value === "string", { title: "ReasoningEffort" });
97
99
  export const LanguageModelToolSchemaCompatibility = Schema.Literals(["gemini", "moonshot"]);
98
100
  export const LanguageModelMaxTokensFieldCompatibility = Schema.Literals(["max_completion_tokens", "max_tokens"]);
99
101
  export class LanguageModelCompatibility extends Schema.Class("LLM.LanguageModelCompatibility")({
@@ -111,6 +113,8 @@ export class LanguageModelCompatibility extends Schema.Class("LLM.LanguageModelC
111
113
  requireSignature: Schema.optional(Schema.Boolean),
112
114
  /** Supports Anthropic's thinking-prefix mismatch controls. Overrides model-ID detection. */
113
115
  supportsThinkingBlockBinding: Schema.optional(Schema.Boolean),
116
+ /** Supports per-message effort updates. Overrides model-ID detection. */
117
+ supportsEffortUpdates: Schema.optional(Schema.Boolean),
114
118
  }) {
115
119
  }
116
120
  (function (LanguageModelCompatibility) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "0.0.0-dev-19594",
3
+ "version": "0.0.0-dev-19596",
4
4
  "name": "@opencode/ai",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,7 +30,7 @@
30
30
  "devDependencies": {
31
31
  "@clack/prompts": "1.0.0-alpha.1",
32
32
  "@effect/platform-node": "4.0.0-rc.112",
33
- "@opencode/http-recorder": "0.0.0-dev-19594",
33
+ "@opencode/http-recorder": "0.0.0-dev-19596",
34
34
  "@tsconfig/bun": "1.0.9",
35
35
  "@types/bun": "1.4.0",
36
36
  "@typescript/native-preview": "7.0.0-dev.20251207.1",
@@ -40,7 +40,7 @@
40
40
  "@aws-sdk/credential-providers": "3.1057.0",
41
41
  "@smithy/eventstream-codec": "4.2.14",
42
42
  "@smithy/util-utf8": "4.2.2",
43
- "@opencode/schema": "0.0.0-dev-19594",
43
+ "@opencode/schema": "0.0.0-dev-19596",
44
44
  "aws4fetch": "1.0.20",
45
45
  "effect": "4.0.0-rc.112",
46
46
  "google-auth-library": "10.5.0"