@opencode-ai/ai 0.0.0-dev-17675 → 0.0.0-dev-17684

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 (58) hide show
  1. package/README.md +16 -4
  2. package/dist/cache-policy.js +3 -5
  3. package/dist/protocols/anthropic-messages.d.ts +25 -28
  4. package/dist/protocols/anthropic-messages.js +3 -3
  5. package/dist/protocols/gemini.d.ts +5 -9
  6. package/dist/protocols/gemini.js +2 -3
  7. package/dist/protocols/open-responses.d.ts +33 -33
  8. package/dist/protocols/open-responses.js +1 -1
  9. package/dist/protocols/openai-chat.d.ts +15 -15
  10. package/dist/protocols/openai-compatible-chat.d.ts +3 -3
  11. package/dist/protocols/openai-compatible-responses.d.ts +4 -4
  12. package/dist/protocols/openai-responses.d.ts +28 -28
  13. package/dist/protocols/openai-responses.js +1 -1
  14. package/dist/protocols/shared.d.ts +8 -14
  15. package/dist/protocols/shared.js +8 -14
  16. package/dist/protocols/utils/bedrock-cache.js +3 -4
  17. package/dist/protocols/utils/cache.js +3 -6
  18. package/dist/protocols/utils/open-responses-options.d.ts +10 -5
  19. package/dist/protocols/utils/open-responses-options.js +5 -3
  20. package/dist/protocols/utils/openai-options.d.ts +6 -4
  21. package/dist/protocols/utils/openai-options.js +3 -3
  22. package/dist/providers/amazon-bedrock-mantle.d.ts +18 -18
  23. package/dist/providers/amazon-bedrock.d.ts +3 -9
  24. package/dist/providers/anthropic-compatible.d.ts +11 -11
  25. package/dist/providers/anthropic.d.ts +12 -12
  26. package/dist/providers/azure.d.ts +15 -15
  27. package/dist/providers/cloudflare.d.ts +11 -11
  28. package/dist/providers/google-vertex-chat.d.ts +5 -5
  29. package/dist/providers/google-vertex-messages.d.ts +11 -11
  30. package/dist/providers/google-vertex-responses.d.ts +6 -6
  31. package/dist/providers/google-vertex-responses.js +1 -1
  32. package/dist/providers/google-vertex.d.ts +5 -7
  33. package/dist/providers/google-vertex.js +1 -1
  34. package/dist/providers/google.d.ts +4 -4
  35. package/dist/providers/open-responses-options.d.ts +1 -4
  36. package/dist/providers/openai-compatible-responses.d.ts +6 -6
  37. package/dist/providers/openai-compatible.d.ts +12 -12
  38. package/dist/providers/openai-options.d.ts +2 -4
  39. package/dist/providers/openai-options.js +3 -3
  40. package/dist/providers/openai.d.ts +19 -19
  41. package/dist/providers/openrouter.d.ts +15 -17
  42. package/dist/providers/openrouter.js +1 -1
  43. package/dist/providers/xai.d.ts +21 -23
  44. package/dist/providers/xai.js +1 -1
  45. package/dist/route/client.d.ts +1 -3
  46. package/dist/route/framing.d.ts +2 -2
  47. package/dist/route/protocol.d.ts +1 -2
  48. package/dist/route/protocol.js +1 -2
  49. package/dist/schema/errors.js +2 -1
  50. package/dist/schema/events.d.ts +5 -3
  51. package/dist/schema/events.js +5 -2
  52. package/dist/schema/ids.d.ts +0 -13
  53. package/dist/schema/ids.js +0 -9
  54. package/dist/schema/messages.d.ts +7 -7
  55. package/dist/schema/messages.js +5 -2
  56. package/dist/schema/options.d.ts +6 -8
  57. package/dist/schema/options.js +6 -18
  58. package/package.json +3 -3
@@ -81,7 +81,6 @@ export declare const routes: import("../route/client.js").Route<{
81
81
  } | undefined;
82
82
  })[];
83
83
  readonly stream: true;
84
- readonly stop?: readonly string[] | undefined;
85
84
  readonly max_completion_tokens?: number | undefined;
86
85
  readonly max_tokens?: number | undefined;
87
86
  readonly tools?: readonly {
@@ -98,9 +97,10 @@ export declare const routes: import("../route/client.js").Route<{
98
97
  readonly ttl?: string | undefined;
99
98
  } | undefined;
100
99
  }[] | undefined;
100
+ readonly stop?: readonly string[] | undefined;
101
101
  readonly temperature?: number | undefined;
102
102
  readonly seed?: number | undefined;
103
- readonly tool_choice?: "required" | "none" | "auto" | {
103
+ readonly tool_choice?: "required" | "auto" | "none" | {
104
104
  readonly type: "function";
105
105
  readonly function: {
106
106
  readonly name: string;
@@ -112,57 +112,57 @@ export declare const routes: import("../route/client.js").Route<{
112
112
  readonly include_usage: boolean;
113
113
  } | undefined;
114
114
  readonly prompt_cache_key?: string | undefined;
115
- readonly reasoning_effort?: string | undefined;
115
+ readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
116
116
  readonly frequency_penalty?: number | undefined;
117
117
  readonly presence_penalty?: number | undefined;
118
118
  }, import("../route/transport/http.js").HttpPrepared<string>>[];
119
119
  export declare const configure: (input: GenericModelOptions) => {
120
120
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
121
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
121
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
122
122
  configure: (input: GenericModelOptions) => /*elided*/ any;
123
123
  };
124
124
  export declare const provider: {
125
125
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
126
126
  configure: (input: GenericModelOptions) => {
127
127
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
128
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
128
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
129
129
  configure: /*elided*/ any;
130
130
  };
131
131
  };
132
132
  export declare const model: ProviderPackage.Definition<Settings, OpenAIProviderOptionsInput>["model"];
133
133
  export declare const baseten: {
134
134
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
135
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
135
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
136
136
  configure: (input?: FamilyModelOptions) => /*elided*/ any;
137
137
  };
138
138
  export declare const cerebras: {
139
139
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
140
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
140
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
141
141
  configure: (input?: FamilyModelOptions) => /*elided*/ any;
142
142
  };
143
143
  export declare const deepinfra: {
144
144
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
145
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
145
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
146
146
  configure: (input?: FamilyModelOptions) => /*elided*/ any;
147
147
  };
148
148
  export declare const deepseek: {
149
149
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
150
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
150
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
151
151
  configure: (input?: FamilyModelOptions) => /*elided*/ any;
152
152
  };
153
153
  export declare const fireworks: {
154
154
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
155
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
155
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
156
156
  configure: (input?: FamilyModelOptions) => /*elided*/ any;
157
157
  };
158
158
  export declare const groq: {
159
159
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
160
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
160
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
161
161
  configure: (input?: FamilyModelOptions) => /*elided*/ any;
162
162
  };
163
163
  export declare const togetherai: {
164
164
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
165
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
165
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
166
166
  configure: (input?: FamilyModelOptions) => /*elided*/ any;
167
167
  };
168
168
  export {};
@@ -1,10 +1,8 @@
1
- import type { ProviderOptions } from "../schema/index.js";
1
+ import { type ProviderOptions } from "../schema/index.js";
2
2
  import type { OpenResponsesOptionsInput } from "./open-responses-options.js";
3
3
  export type { OpenAIResponseIncludable, OpenAIServiceTier } from "../protocols/utils/openai-options.js";
4
4
  export type OpenAIOptionsInput = OpenResponsesOptionsInput;
5
- export type OpenAIProviderOptionsInput = ProviderOptions & {
6
- readonly openai?: OpenAIOptionsInput;
7
- };
5
+ export type OpenAIProviderOptionsInput = OpenAIOptionsInput;
8
6
  export declare const gpt5DefaultOptions: (modelID: string, options?: {
9
7
  readonly textVerbosity?: boolean;
10
8
  }) => ProviderOptions | undefined;
@@ -1,7 +1,7 @@
1
1
  import { mergeProviderOptions } from "../schema/index.js";
2
2
  const definedEntries = (input) => Object.entries(input).filter((entry) => entry[1] !== undefined);
3
3
  const openAIProviderOptions = (options) => {
4
- const openai = Object.fromEntries(definedEntries({
4
+ const result = Object.fromEntries(definedEntries({
5
5
  store: options?.store,
6
6
  reasoningEffort: options?.reasoningEffort,
7
7
  reasoningSummary: options?.reasoningSummary,
@@ -9,9 +9,9 @@ const openAIProviderOptions = (options) => {
9
9
  textVerbosity: options?.textVerbosity,
10
10
  serviceTier: options?.serviceTier,
11
11
  }));
12
- if (Object.keys(openai).length === 0)
12
+ if (Object.keys(result).length === 0)
13
13
  return undefined;
14
- return { openai };
14
+ return result;
15
15
  };
16
16
  export const gpt5DefaultOptions = (modelID, options = {}) => {
17
17
  const id = modelID.toLowerCase();
@@ -69,7 +69,6 @@ export declare const routes: (Route<{
69
69
  } | undefined;
70
70
  })[];
71
71
  readonly stream: true;
72
- readonly stop?: readonly string[] | undefined;
73
72
  readonly max_completion_tokens?: number | undefined;
74
73
  readonly max_tokens?: number | undefined;
75
74
  readonly tools?: readonly {
@@ -86,9 +85,10 @@ export declare const routes: (Route<{
86
85
  readonly ttl?: string | undefined;
87
86
  } | undefined;
88
87
  }[] | undefined;
88
+ readonly stop?: readonly string[] | undefined;
89
89
  readonly temperature?: number | undefined;
90
90
  readonly seed?: number | undefined;
91
- readonly tool_choice?: "required" | "none" | "auto" | {
91
+ readonly tool_choice?: "required" | "auto" | "none" | {
92
92
  readonly type: "function";
93
93
  readonly function: {
94
94
  readonly name: string;
@@ -100,7 +100,7 @@ export declare const routes: (Route<{
100
100
  readonly include_usage: boolean;
101
101
  } | undefined;
102
102
  readonly prompt_cache_key?: string | undefined;
103
- readonly reasoning_effort?: string | undefined;
103
+ readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
104
104
  readonly frequency_penalty?: number | undefined;
105
105
  readonly presence_penalty?: number | undefined;
106
106
  }, import("../route/transport/http.js").HttpPrepared<string>> | Route<{
@@ -175,7 +175,7 @@ export declare const routes: (Route<{
175
175
  readonly instructions?: string | undefined;
176
176
  readonly reasoning?: {
177
177
  readonly summary?: "auto" | "concise" | "detailed" | undefined;
178
- readonly effort?: string | undefined;
178
+ readonly effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
179
179
  } | undefined;
180
180
  readonly tools?: readonly ({
181
181
  readonly type: "function";
@@ -190,22 +190,22 @@ export declare const routes: (Route<{
190
190
  readonly size?: string | undefined;
191
191
  readonly action?: "generate" | "auto" | "edit" | undefined;
192
192
  readonly output_format?: "png" | "jpeg" | "webp" | undefined;
193
- readonly quality?: "low" | "medium" | "high" | "auto" | undefined;
193
+ readonly quality?: "auto" | "low" | "medium" | "high" | undefined;
194
194
  readonly background?: "auto" | "opaque" | "transparent" | undefined;
195
195
  readonly output_compression?: number | undefined;
196
196
  readonly input_fidelity?: "low" | "high" | undefined;
197
197
  readonly partial_images?: number | undefined;
198
198
  })[] | undefined;
199
199
  readonly text?: {
200
- readonly verbosity?: "low" | "medium" | "high" | undefined;
200
+ readonly verbosity?: import("../protocols/utils/open-responses-options.js").TextVerbosity | undefined;
201
201
  } | undefined;
202
202
  readonly temperature?: number | undefined;
203
- readonly tool_choice?: "required" | "none" | "auto" | {
203
+ readonly tool_choice?: "required" | "auto" | "none" | {
204
204
  readonly type: "function";
205
205
  readonly name: string;
206
206
  } | {
207
207
  readonly type: "allowed_tools";
208
- readonly mode: "required" | "none" | "auto";
208
+ readonly mode: "required" | "auto" | "none";
209
209
  readonly tools: readonly {
210
210
  readonly type: "function";
211
211
  readonly name: string;
@@ -249,29 +249,29 @@ export interface Settings extends ProviderPackage.Settings {
249
249
  }
250
250
  export declare const configure: (input?: Config) => {
251
251
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
252
- model: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
253
- responses: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
254
- chat: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
252
+ model: (id: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
253
+ responses: (id: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
254
+ chat: (id: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
255
255
  image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
256
256
  configure: (input?: Config) => /*elided*/ any;
257
257
  };
258
258
  export declare const provider: {
259
259
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
260
- model: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
261
- responses: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
262
- chat: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
260
+ model: (id: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
261
+ responses: (id: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
262
+ chat: (id: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
263
263
  image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
264
264
  configure: (input?: Config) => {
265
265
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
266
- model: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
267
- responses: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
268
- chat: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
266
+ model: (id: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
267
+ responses: (id: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
268
+ chat: (id: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
269
269
  image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
270
270
  configure: /*elided*/ any;
271
271
  };
272
272
  };
273
273
  export declare const model: ProviderPackage.Definition<Settings, OpenAIProviderOptionsInput>["model"];
274
274
  export declare const chatModel: ProviderPackage.Definition<Settings, OpenAIProviderOptionsInput>["model"];
275
- export declare const responses: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
276
- export declare const chat: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
275
+ export declare const responses: (id: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
276
+ export declare const chat: (id: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
277
277
  export declare const image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
@@ -2,7 +2,7 @@ import { Schema } from "effect";
2
2
  import { Route, type RouteDefaultsInput } from "../route/client.js";
3
3
  import { Protocol } from "../route/protocol.js";
4
4
  import { type ProviderAuthOption } from "../route/auth-options.js";
5
- import { type ModelID, type ProviderOptions } from "../schema/index.js";
5
+ import { type ModelID } from "../schema/index.js";
6
6
  import type { ProviderPackage } from "../provider-package.js";
7
7
  import * as OpenAIChat from "../protocols/openai-chat.js";
8
8
  export declare const profile: {
@@ -76,9 +76,7 @@ export interface OpenRouterOptions {
76
76
  engine?: OpenRouterString<"native" | "exa">;
77
77
  }>;
78
78
  }
79
- export type OpenRouterProviderOptionsInput = ProviderOptions & {
80
- readonly openrouter?: OpenRouterOptions;
81
- };
79
+ export type OpenRouterProviderOptionsInput = OpenRouterOptions;
82
80
  export type LanguageModelOptions = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
83
81
  readonly baseURL?: string;
84
82
  readonly providerOptions?: OpenRouterProviderOptionsInput;
@@ -172,7 +170,7 @@ declare const OpenRouterBody: Schema.StructWithRest<Schema.Struct<{
172
170
  }>>;
173
171
  store: Schema.optional<Schema.Boolean>;
174
172
  prompt_cache_key: Schema.optional<Schema.String>;
175
- reasoning_effort: Schema.optional<Schema.String>;
173
+ reasoning_effort: Schema.optional<Schema.declare<import("../protocols/utils/open-responses-options.js").ReasoningEffort, import("../protocols/utils/open-responses-options.js").ReasoningEffort>>;
176
174
  max_completion_tokens: Schema.optional<Schema.Number>;
177
175
  max_tokens: Schema.optional<Schema.Number>;
178
176
  temperature: Schema.optional<Schema.Number>;
@@ -246,7 +244,6 @@ export declare const protocol: Protocol<{
246
244
  } | undefined;
247
245
  })[];
248
246
  readonly stream: true;
249
- readonly stop?: readonly string[] | undefined;
250
247
  readonly max_completion_tokens?: number | undefined;
251
248
  readonly max_tokens?: number | undefined;
252
249
  readonly tools?: readonly {
@@ -263,9 +260,10 @@ export declare const protocol: Protocol<{
263
260
  readonly ttl?: string | undefined;
264
261
  } | undefined;
265
262
  }[] | undefined;
263
+ readonly stop?: readonly string[] | undefined;
266
264
  readonly temperature?: number | undefined;
267
265
  readonly seed?: number | undefined;
268
- readonly tool_choice?: "required" | "none" | "auto" | {
266
+ readonly tool_choice?: "required" | "auto" | "none" | {
269
267
  readonly type: "function";
270
268
  readonly function: {
271
269
  readonly name: string;
@@ -277,7 +275,7 @@ export declare const protocol: Protocol<{
277
275
  readonly include_usage: boolean;
278
276
  } | undefined;
279
277
  readonly prompt_cache_key?: string | undefined;
280
- readonly reasoning_effort?: string | undefined;
278
+ readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
281
279
  readonly frequency_penalty?: number | undefined;
282
280
  readonly presence_penalty?: number | undefined;
283
281
  }, string, {
@@ -386,7 +384,6 @@ export declare const route: Route<{
386
384
  } | undefined;
387
385
  })[];
388
386
  readonly stream: true;
389
- readonly stop?: readonly string[] | undefined;
390
387
  readonly max_completion_tokens?: number | undefined;
391
388
  readonly max_tokens?: number | undefined;
392
389
  readonly tools?: readonly {
@@ -403,9 +400,10 @@ export declare const route: Route<{
403
400
  readonly ttl?: string | undefined;
404
401
  } | undefined;
405
402
  }[] | undefined;
403
+ readonly stop?: readonly string[] | undefined;
406
404
  readonly temperature?: number | undefined;
407
405
  readonly seed?: number | undefined;
408
- readonly tool_choice?: "required" | "none" | "auto" | {
406
+ readonly tool_choice?: "required" | "auto" | "none" | {
409
407
  readonly type: "function";
410
408
  readonly function: {
411
409
  readonly name: string;
@@ -417,7 +415,7 @@ export declare const route: Route<{
417
415
  readonly include_usage: boolean;
418
416
  } | undefined;
419
417
  readonly prompt_cache_key?: string | undefined;
420
- readonly reasoning_effort?: string | undefined;
418
+ readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
421
419
  readonly frequency_penalty?: number | undefined;
422
420
  readonly presence_penalty?: number | undefined;
423
421
  }, import("../route/transport/http.js").HttpPrepared<string>>;
@@ -484,7 +482,6 @@ export declare const routes: Route<{
484
482
  } | undefined;
485
483
  })[];
486
484
  readonly stream: true;
487
- readonly stop?: readonly string[] | undefined;
488
485
  readonly max_completion_tokens?: number | undefined;
489
486
  readonly max_tokens?: number | undefined;
490
487
  readonly tools?: readonly {
@@ -501,9 +498,10 @@ export declare const routes: Route<{
501
498
  readonly ttl?: string | undefined;
502
499
  } | undefined;
503
500
  }[] | undefined;
501
+ readonly stop?: readonly string[] | undefined;
504
502
  readonly temperature?: number | undefined;
505
503
  readonly seed?: number | undefined;
506
- readonly tool_choice?: "required" | "none" | "auto" | {
504
+ readonly tool_choice?: "required" | "auto" | "none" | {
507
505
  readonly type: "function";
508
506
  readonly function: {
509
507
  readonly name: string;
@@ -515,21 +513,21 @@ export declare const routes: Route<{
515
513
  readonly include_usage: boolean;
516
514
  } | undefined;
517
515
  readonly prompt_cache_key?: string | undefined;
518
- readonly reasoning_effort?: string | undefined;
516
+ readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
519
517
  readonly frequency_penalty?: number | undefined;
520
518
  readonly presence_penalty?: number | undefined;
521
519
  }, import("../route/transport/http.js").HttpPrepared<string>>[];
522
520
  export declare const configure: (input?: LanguageModelOptions) => {
523
521
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
524
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenRouterProviderOptionsInput>;
522
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenRouterOptions>;
525
523
  configure: (input?: LanguageModelOptions) => /*elided*/ any;
526
524
  };
527
525
  export declare const provider: {
528
526
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
529
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenRouterProviderOptionsInput>;
527
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenRouterOptions>;
530
528
  configure: (input?: LanguageModelOptions) => {
531
529
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
532
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenRouterProviderOptionsInput>;
530
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenRouterOptions>;
533
531
  configure: /*elided*/ any;
534
532
  };
535
533
  };
@@ -42,7 +42,7 @@ export const protocol = Protocol.make({
42
42
  return {
43
43
  ...body,
44
44
  messages,
45
- ...bodyOptions(request.providerOptions?.openrouter),
45
+ ...bodyOptions(request.providerOptions),
46
46
  ...(request.promptCacheKey ? { prompt_cache_key: request.promptCacheKey } : {}),
47
47
  };
48
48
  })),
@@ -1,12 +1,10 @@
1
1
  import { type ProviderAuthOption } from "../route/auth-options.js";
2
2
  import { Route, type RouteDefaultsInput } from "../route/client.js";
3
- import { type ModelID, type ProviderOptions } from "../schema/index.js";
3
+ import { type ModelID } from "../schema/index.js";
4
4
  import type { OpenAIOptionsInput } from "./openai-options.js";
5
5
  import type { ProviderPackage } from "../provider-package.js";
6
6
  export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
7
- export type XAIProviderOptionsInput = ProviderOptions & {
8
- readonly xai?: OpenAIOptionsInput;
9
- };
7
+ export type XAIProviderOptionsInput = OpenAIOptionsInput;
10
8
  export type LanguageModelOptions = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
11
9
  readonly baseURL?: string;
12
10
  readonly providerOptions?: XAIProviderOptionsInput;
@@ -79,7 +77,6 @@ export declare const routes: (Route<{
79
77
  } | undefined;
80
78
  })[];
81
79
  readonly stream: true;
82
- readonly stop?: readonly string[] | undefined;
83
80
  readonly max_completion_tokens?: number | undefined;
84
81
  readonly max_tokens?: number | undefined;
85
82
  readonly tools?: readonly {
@@ -96,9 +93,10 @@ export declare const routes: (Route<{
96
93
  readonly ttl?: string | undefined;
97
94
  } | undefined;
98
95
  }[] | undefined;
96
+ readonly stop?: readonly string[] | undefined;
99
97
  readonly temperature?: number | undefined;
100
98
  readonly seed?: number | undefined;
101
- readonly tool_choice?: "required" | "none" | "auto" | {
99
+ readonly tool_choice?: "required" | "auto" | "none" | {
102
100
  readonly type: "function";
103
101
  readonly function: {
104
102
  readonly name: string;
@@ -110,7 +108,7 @@ export declare const routes: (Route<{
110
108
  readonly include_usage: boolean;
111
109
  } | undefined;
112
110
  readonly prompt_cache_key?: string | undefined;
113
- readonly reasoning_effort?: string | undefined;
111
+ readonly reasoning_effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
114
112
  readonly frequency_penalty?: number | undefined;
115
113
  readonly presence_penalty?: number | undefined;
116
114
  }, import("../route/transport/http.js").HttpPrepared<string>> | Route<{
@@ -185,7 +183,7 @@ export declare const routes: (Route<{
185
183
  readonly instructions?: string | undefined;
186
184
  readonly reasoning?: {
187
185
  readonly summary?: "auto" | "concise" | "detailed" | undefined;
188
- readonly effort?: string | undefined;
186
+ readonly effort?: import("../protocols/utils/open-responses-options.js").ReasoningEffort | undefined;
189
187
  } | undefined;
190
188
  readonly tools?: readonly ({
191
189
  readonly type: "function";
@@ -200,22 +198,22 @@ export declare const routes: (Route<{
200
198
  readonly size?: string | undefined;
201
199
  readonly action?: "generate" | "auto" | "edit" | undefined;
202
200
  readonly output_format?: "png" | "jpeg" | "webp" | undefined;
203
- readonly quality?: "low" | "medium" | "high" | "auto" | undefined;
201
+ readonly quality?: "auto" | "low" | "medium" | "high" | undefined;
204
202
  readonly background?: "auto" | "opaque" | "transparent" | undefined;
205
203
  readonly output_compression?: number | undefined;
206
204
  readonly input_fidelity?: "low" | "high" | undefined;
207
205
  readonly partial_images?: number | undefined;
208
206
  })[] | undefined;
209
207
  readonly text?: {
210
- readonly verbosity?: "low" | "medium" | "high" | undefined;
208
+ readonly verbosity?: import("../protocols/utils/open-responses-options.js").TextVerbosity | undefined;
211
209
  } | undefined;
212
210
  readonly temperature?: number | undefined;
213
- readonly tool_choice?: "required" | "none" | "auto" | {
211
+ readonly tool_choice?: "required" | "auto" | "none" | {
214
212
  readonly type: "function";
215
213
  readonly name: string;
216
214
  } | {
217
215
  readonly type: "allowed_tools";
218
- readonly mode: "required" | "none" | "auto";
216
+ readonly mode: "required" | "auto" | "none";
219
217
  readonly tools: readonly {
220
218
  readonly type: "function";
221
219
  readonly name: string;
@@ -235,28 +233,28 @@ export declare const routes: (Route<{
235
233
  }, import("../route/transport/http.js").HttpPrepared<string>>)[];
236
234
  export declare const configure: (input?: LanguageModelOptions) => {
237
235
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
238
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
239
- responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
240
- chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
236
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
237
+ responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
238
+ chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
241
239
  image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/xai-images.js").XAIImageOptions>;
242
240
  configure: (input?: LanguageModelOptions) => /*elided*/ any;
243
241
  };
244
242
  export declare const provider: {
245
243
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
246
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
247
- responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
248
- chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
244
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
245
+ responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
246
+ chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
249
247
  image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/xai-images.js").XAIImageOptions>;
250
248
  configure: (input?: LanguageModelOptions) => {
251
249
  id: string & import("effect/Brand").Brand<"AI.ProviderID">;
252
- model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
253
- responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
254
- chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
250
+ model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
251
+ responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
252
+ chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
255
253
  image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/xai-images.js").XAIImageOptions>;
256
254
  configure: /*elided*/ any;
257
255
  };
258
256
  };
259
257
  export declare const model: ProviderPackage.Definition<Settings, XAIProviderOptionsInput>["model"];
260
- export declare const responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
261
- export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
258
+ export declare const responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
259
+ export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput>;
262
260
  export declare const image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/xai-images.js").XAIImageOptions>;
@@ -15,7 +15,7 @@ const responsesRoute = Route.make({
15
15
  protocol: OpenAIResponses.protocol,
16
16
  endpoint: Endpoint.path("/responses", { baseURL: OpenAICompatibleProfiles.profiles.xai.baseURL }),
17
17
  transport: OpenAIResponses.httpTransport,
18
- defaults: { providerOptions: { xai: { store: false } } },
18
+ defaults: { providerOptions: { store: false } },
19
19
  });
20
20
  const chatRoute = Route.make({
21
21
  id: "openai-compatible-chat",
@@ -142,9 +142,7 @@ export declare const compileRequest: (request: LLMRequest) => Effect.Effect<{
142
142
  route: string;
143
143
  protocol: string;
144
144
  model: LanguageModel<{
145
- readonly [x: string]: {
146
- readonly [x: string]: unknown;
147
- };
145
+ readonly [x: string]: unknown;
148
146
  }>;
149
147
  body: any;
150
148
  metadata: {
@@ -11,8 +11,8 @@ import type { AIError } from "../schema/index.js";
11
11
  * - AWS event stream — length-prefixed binary frames with CRC checksums.
12
12
  * Each emitted frame is one parsed binary event record.
13
13
  *
14
- * The frame type is opaque to this layer; the protocol's `decode` step turns
15
- * a frame into a typed chunk.
14
+ * The frame type is opaque to this layer; the protocol's event schema decodes
15
+ * each frame before its state machine handles it.
16
16
  */
17
17
  export interface Definition<Frame> {
18
18
  readonly id: string;
@@ -69,8 +69,7 @@ export interface ProtocolStream<Frame, Event, State> {
69
69
  *
70
70
  * Provider implementations should usually call `Protocol.make({ ... })`
71
71
  * without explicit type arguments; the schemas and parser functions are the
72
- * source of truth. The constructor remains as the public seam for future
73
- * cross-cutting concerns such as tracing or instrumentation.
72
+ * source of truth.
74
73
  */
75
74
  export declare const make: <Body, Frame, Event, State>(input: Protocol<Body, Frame, Event, State>) => Protocol<Body, Frame, Event, State>;
76
75
  export declare const jsonEvent: <const S extends Schema.Top>(schema: S) => Schema.fromJsonString<S>;
@@ -9,8 +9,7 @@ import { Schema } from "effect";
9
9
  *
10
10
  * Provider implementations should usually call `Protocol.make({ ... })`
11
11
  * without explicit type arguments; the schemas and parser functions are the
12
- * source of truth. The constructor remains as the public seam for future
13
- * cross-cutting concerns such as tracing or instrumentation.
12
+ * source of truth.
14
13
  */
15
14
  export const make = (input) => input;
16
15
  export const jsonEvent = (schema) => Schema.fromJsonString(schema);
@@ -1,6 +1,7 @@
1
1
  import { Schema } from "effect";
2
2
  import { Tool } from "@opencode-ai/schema/tool";
3
- import { ModelID, ProviderID, ProviderMetadata, RouteID } from "./ids.js";
3
+ import { ModelID, ProviderID, RouteID } from "./ids.js";
4
+ import { ProviderMetadata } from "./messages.js";
4
5
  export const ProviderFailureClassification = Schema.Literals(["context-overflow", "payload-too-large"]);
5
6
  export class HttpRequestDetails extends Schema.Class("AI.HttpRequestDetails")({
6
7
  method: Schema.String,
@@ -1,6 +1,9 @@
1
1
  import { Schema } from "effect";
2
- import { ContentBlockID, ProviderMetadata, ToolCallID } from "./ids.js";
3
- import { Message, ToolOutput, ToolResultValue } from "./messages.js";
2
+ import { ContentBlockID, ToolCallID } from "./ids.js";
3
+ import { Message, ProviderMetadata, ToolOutput, ToolResultValue } from "./messages.js";
4
+ export declare const FinishReason: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>;
5
+ export type FinishReason = Schema.Schema.Type<typeof FinishReason>;
6
+ export { ProviderMetadata } from "./messages.js";
4
7
  declare const Usage_base: Schema.Class<Usage, Schema.Struct<{
5
8
  readonly inputTokens: Schema.optional<Schema.Number>;
6
9
  readonly outputTokens: Schema.optional<Schema.Number>;
@@ -4584,4 +4587,3 @@ export declare namespace LLMResponse {
4584
4587
  /** Concatenate reasoning text from a response or collected event list. */
4585
4588
  const reasoning: (response: Output) => string;
4586
4589
  }
4587
- export {};
@@ -1,7 +1,10 @@
1
1
  import { Schema } from "effect";
2
- import { ContentBlockID, FinishReason, ProviderMetadata, ToolCallID } from "./ids.js";
3
- import { Message, ToolCallPart, ToolOutput, ToolResultPart, ToolResultValue } from "./messages.js";
2
+ import { LLM } from "@opencode-ai/schema/llm";
3
+ import { ContentBlockID, ToolCallID } from "./ids.js";
4
+ import { Message, ProviderMetadata, ToolCallPart, ToolOutput, ToolResultPart, ToolResultValue, } from "./messages.js";
4
5
  import { ProviderFailureClassification } from "./errors.js";
6
+ export const FinishReason = LLM.FinishReason;
7
+ export { ProviderMetadata } from "./messages.js";
5
8
  /**
6
9
  * Token usage reported by an LLM provider.
7
10
  *
@@ -1,6 +1,4 @@
1
1
  import { Schema } from "effect";
2
- import { ProviderMetadata } from "@opencode-ai/schema/ai";
3
- export { ProviderMetadata };
4
2
  /** Stable string identifier for a protocol implementation. */
5
3
  export declare const ProtocolID: Schema.String;
6
4
  export type ProtocolID = Schema.Schema.Type<typeof ProtocolID>;
@@ -17,14 +15,3 @@ export declare const ContentBlockID: Schema.String;
17
15
  export type ContentBlockID = Schema.Schema.Type<typeof ContentBlockID>;
18
16
  export declare const ToolCallID: Schema.String;
19
17
  export type ToolCallID = Schema.Schema.Type<typeof ToolCallID>;
20
- export declare const ReasoningEfforts: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
21
- export declare const ReasoningEffort: Schema.String;
22
- export type ReasoningEffort = Schema.Schema.Type<typeof ReasoningEffort>;
23
- export declare const TextVerbosity: Schema.Literals<readonly ["low", "medium", "high"]>;
24
- export type TextVerbosity = Schema.Schema.Type<typeof TextVerbosity>;
25
- export declare const MessageRole: Schema.Literals<readonly ["system", "user", "assistant", "tool"]>;
26
- export type MessageRole = Schema.Schema.Type<typeof MessageRole>;
27
- export declare const FinishReason: Schema.Literals<readonly ["stop", "length", "tool-calls", "content-filter", "error", "unknown"]>;
28
- export type FinishReason = Schema.Schema.Type<typeof FinishReason>;
29
- export declare const JsonSchema: Schema.$Record<Schema.String, Schema.Unknown>;
30
- export type JsonSchema = Schema.Schema.Type<typeof JsonSchema>;