@opencode-ai/ai 0.0.0-next-16671 → 0.0.0-next-16680

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 (73) hide show
  1. package/README.md +1 -1
  2. package/dist/image-client.d.ts +4 -4
  3. package/dist/image.d.ts +4 -4
  4. package/dist/image.js +2 -2
  5. package/dist/index.d.ts +2 -2
  6. package/dist/llm.d.ts +11 -11
  7. package/dist/llm.js +3 -3
  8. package/dist/protocols/anthropic-messages.js +8 -4
  9. package/dist/protocols/bedrock-converse.js +3 -5
  10. package/dist/protocols/google-images.js +2 -2
  11. package/dist/protocols/open-responses.d.ts +8 -8
  12. package/dist/protocols/open-responses.js +4 -9
  13. package/dist/protocols/openai-chat.d.ts +4 -4
  14. package/dist/protocols/openai-chat.js +3 -3
  15. package/dist/protocols/openai-compatible-chat.d.ts +2 -2
  16. package/dist/protocols/openai-compatible-responses.d.ts +2 -2
  17. package/dist/protocols/openai-images.js +2 -2
  18. package/dist/protocols/shared.d.ts +16 -16
  19. package/dist/protocols/shared.js +6 -6
  20. package/dist/protocols/utils/bedrock-media.d.ts +1 -1
  21. package/dist/protocols/utils/image-input.d.ts +5 -5
  22. package/dist/protocols/utils/image-input.js +2 -2
  23. package/dist/protocols/utils/tool-schema.d.ts +2 -2
  24. package/dist/protocols/utils/tool-stream.d.ts +7 -7
  25. package/dist/protocols/utils/tool-stream.js +2 -2
  26. package/dist/protocols/xai-images.js +2 -2
  27. package/dist/protocols/zai-images.js +2 -2
  28. package/dist/provider-error.d.ts +2 -2
  29. package/dist/provider-error.js +2 -2
  30. package/dist/provider-package.d.ts +2 -2
  31. package/dist/provider.d.ts +8 -8
  32. package/dist/providers/amazon-bedrock.d.ts +7 -7
  33. package/dist/providers/anthropic-compatible.d.ts +6 -6
  34. package/dist/providers/anthropic.d.ts +7 -7
  35. package/dist/providers/azure.d.ts +13 -13
  36. package/dist/providers/cloudflare.d.ts +8 -8
  37. package/dist/providers/github-copilot.d.ts +15 -15
  38. package/dist/providers/google-vertex-chat.d.ts +6 -6
  39. package/dist/providers/google-vertex-messages.d.ts +6 -6
  40. package/dist/providers/google-vertex-responses.d.ts +6 -6
  41. package/dist/providers/google-vertex.d.ts +6 -6
  42. package/dist/providers/google.d.ts +7 -7
  43. package/dist/providers/openai-compatible-responses.d.ts +6 -6
  44. package/dist/providers/openai-compatible.d.ts +20 -20
  45. package/dist/providers/openai.d.ts +19 -19
  46. package/dist/providers/openrouter.d.ts +11 -11
  47. package/dist/providers/xai.d.ts +19 -19
  48. package/dist/providers/zai.d.ts +4 -4
  49. package/dist/route/auth-options.d.ts +3 -3
  50. package/dist/route/auth.d.ts +4 -4
  51. package/dist/route/auth.js +4 -4
  52. package/dist/route/client.d.ts +18 -18
  53. package/dist/route/client.js +6 -6
  54. package/dist/route/executor.d.ts +3 -3
  55. package/dist/route/executor.js +4 -4
  56. package/dist/route/framing.d.ts +2 -2
  57. package/dist/route/index.d.ts +1 -1
  58. package/dist/route/protocol.d.ts +3 -3
  59. package/dist/route/transport/http.d.ts +1 -1
  60. package/dist/route/transport/index.d.ts +3 -3
  61. package/dist/route/transport/websocket.d.ts +10 -10
  62. package/dist/route/transport/websocket.js +3 -3
  63. package/dist/schema/errors.d.ts +6 -6
  64. package/dist/schema/errors.js +18 -18
  65. package/dist/schema/events.js +1 -1
  66. package/dist/schema/ids.d.ts +3 -3
  67. package/dist/schema/ids.js +4 -3
  68. package/dist/schema/messages.d.ts +2 -2
  69. package/dist/schema/messages.js +2 -2
  70. package/dist/schema/options.d.ts +38 -38
  71. package/dist/schema/options.js +31 -29
  72. package/dist/testing.d.ts +4 -4
  73. package/package.json +3 -3
@@ -3,7 +3,7 @@ import type { RouteDefaultsInput } from "../route/client";
3
3
  import { type ModelID } from "../schema";
4
4
  import { GoogleVertexShared } from "./google-vertex-shared";
5
5
  import type { OpenResponsesProviderOptionsInput } from "./open-responses-options";
6
- export declare const id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
6
+ export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
7
7
  export type Config = RouteDefaultsInput & GoogleVertexShared.OAuthOptions & {
8
8
  readonly baseURL?: string;
9
9
  readonly location?: string;
@@ -107,15 +107,15 @@ export declare const routes: import("../route").Route<{
107
107
  readonly max_output_tokens?: number | undefined;
108
108
  }, import("../route/transport/http").HttpPrepared<string>>[];
109
109
  export declare const configure: (input?: Config) => {
110
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
111
- model: (modelID: string | ModelID) => import("..").Model<OpenResponsesProviderOptionsInput>;
110
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
111
+ model: (modelID: string | ModelID) => import("..").LanguageModel<OpenResponsesProviderOptionsInput>;
112
112
  configure: (input?: Config) => /*elided*/ any;
113
113
  };
114
114
  export declare const provider: {
115
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
115
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
116
116
  configure: (input?: Config) => {
117
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
118
- model: (modelID: string | ModelID) => import("..").Model<OpenResponsesProviderOptionsInput>;
117
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
118
+ model: (modelID: string | ModelID) => import("..").LanguageModel<OpenResponsesProviderOptionsInput>;
119
119
  configure: /*elided*/ any;
120
120
  };
121
121
  };
@@ -5,7 +5,7 @@ import { type ModelID } from "../schema";
5
5
  import { GoogleVertexShared } from "./google-vertex-shared";
6
6
  export type GeminiOptionsInput = Gemini.OptionsInput;
7
7
  export type GeminiProviderOptionsInput = Gemini.ProviderOptionsInput;
8
- export declare const id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
8
+ export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
9
9
  export type Config = RouteDefaultsInput & GoogleVertexShared.ApiKeyOptions & {
10
10
  readonly baseURL?: string;
11
11
  readonly location?: string;
@@ -97,15 +97,15 @@ export declare const routes: Route<{
97
97
  } | undefined;
98
98
  }, import("../route/transport/http").HttpPrepared<string>>[];
99
99
  export declare const configure: (input?: Config) => {
100
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
101
- model: (modelID: string | ModelID) => import("..").Model<Gemini.ProviderOptionsInput>;
100
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
101
+ model: (modelID: string | ModelID) => import("..").LanguageModel<Gemini.ProviderOptionsInput>;
102
102
  configure: (input?: Config) => /*elided*/ any;
103
103
  };
104
104
  export declare const provider: {
105
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
105
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
106
106
  configure: (input?: Config) => {
107
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
108
- model: (modelID: string | ModelID) => import("..").Model<Gemini.ProviderOptionsInput>;
107
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
108
+ model: (modelID: string | ModelID) => import("..").LanguageModel<Gemini.ProviderOptionsInput>;
109
109
  configure: /*elided*/ any;
110
110
  };
111
111
  };
@@ -6,7 +6,7 @@ import { Gemini } from "../protocols/gemini";
6
6
  export type { GoogleImageOptions } from "../protocols/google-images";
7
7
  export type GeminiOptionsInput = Gemini.OptionsInput;
8
8
  export type GeminiProviderOptionsInput = Gemini.ProviderOptionsInput;
9
- export declare const id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
9
+ export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
10
10
  export declare const routes: import("../route").Route<{
11
11
  readonly contents: readonly {
12
12
  readonly role: "user" | "model";
@@ -89,18 +89,18 @@ export interface Settings extends ProviderPackage.Settings {
89
89
  readonly providerOptions?: Gemini.ProviderOptionsInput;
90
90
  }
91
91
  export declare const configure: (input?: Config) => {
92
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
93
- model: (modelID: string | ModelID) => import("..").Model<Gemini.ProviderOptionsInput>;
92
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
93
+ model: (modelID: string | ModelID) => import("..").LanguageModel<Gemini.ProviderOptionsInput>;
94
94
  image: (modelID: string | ModelID) => import("..").ImageModel<import("./google").GoogleImageOptions>;
95
95
  configure: (input?: Config) => /*elided*/ any;
96
96
  };
97
97
  export declare const provider: {
98
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
99
- model: (modelID: string | ModelID) => import("..").Model<Gemini.ProviderOptionsInput>;
98
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
99
+ model: (modelID: string | ModelID) => import("..").LanguageModel<Gemini.ProviderOptionsInput>;
100
100
  image: (modelID: string | ModelID) => import("..").ImageModel<import("./google").GoogleImageOptions>;
101
101
  configure: (input?: Config) => {
102
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
103
- model: (modelID: string | ModelID) => import("..").Model<Gemini.ProviderOptionsInput>;
102
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
103
+ model: (modelID: string | ModelID) => import("..").LanguageModel<Gemini.ProviderOptionsInput>;
104
104
  image: (modelID: string | ModelID) => import("..").ImageModel<import("./google").GoogleImageOptions>;
105
105
  configure: /*elided*/ any;
106
106
  };
@@ -4,7 +4,7 @@ import type { RouteDefaultsInput } from "../route/client";
4
4
  import { type ModelID } from "../schema";
5
5
  import type { OpenResponsesProviderOptionsInput } from "./open-responses-options";
6
6
  export type { OpenResponsesOptionsInput, OpenResponsesProviderOptionsInput } from "./open-responses-options";
7
- export declare const id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
7
+ export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
8
8
  export type Config = RouteDefaultsInput & ProviderAuthOption<"optional"> & {
9
9
  readonly provider?: string;
10
10
  readonly baseURL: string;
@@ -105,15 +105,15 @@ export declare const routes: import("../route").Route<{
105
105
  readonly max_output_tokens?: number | undefined;
106
106
  }, import("../route/transport/http").HttpPrepared<string>>[];
107
107
  export declare const configure: (input: Config) => {
108
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
109
- model: (modelID: string | ModelID) => import("..").Model<OpenResponsesProviderOptionsInput>;
108
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
109
+ model: (modelID: string | ModelID) => import("..").LanguageModel<OpenResponsesProviderOptionsInput>;
110
110
  configure: (input: Config) => /*elided*/ any;
111
111
  };
112
112
  export declare const provider: {
113
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
113
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
114
114
  configure: (input: Config) => {
115
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
116
- model: (modelID: string | ModelID) => import("..").Model<OpenResponsesProviderOptionsInput>;
115
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
116
+ model: (modelID: string | ModelID) => import("..").LanguageModel<OpenResponsesProviderOptionsInput>;
117
117
  configure: /*elided*/ any;
118
118
  };
119
119
  };
@@ -3,7 +3,7 @@ import type { RouteDefaultsInput } from "../route/client";
3
3
  import { type ProviderAuthOption } from "../route/auth-options";
4
4
  import type { ProviderPackage } from "../provider-package";
5
5
  import type { OpenAIProviderOptionsInput } from "./openai-options";
6
- export declare const id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
6
+ export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
7
7
  type GenericModelOptions = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
8
8
  readonly provider?: string;
9
9
  readonly baseURL: string;
@@ -115,52 +115,52 @@ export declare const routes: import("../route").Route<{
115
115
  readonly presence_penalty?: number | undefined;
116
116
  }, import("../route/transport/http").HttpPrepared<string>>[];
117
117
  export declare const configure: (input: GenericModelOptions) => {
118
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
119
- model: (modelID: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
118
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
119
+ model: (modelID: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
120
120
  configure: (input: GenericModelOptions) => /*elided*/ any;
121
121
  };
122
122
  export declare const provider: {
123
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
123
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
124
124
  configure: (input: GenericModelOptions) => {
125
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
126
- model: (modelID: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
125
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
126
+ model: (modelID: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
127
127
  configure: /*elided*/ any;
128
128
  };
129
129
  };
130
130
  export declare const model: ProviderPackage.Definition<Settings, OpenAIProviderOptionsInput>["model"];
131
131
  export declare const baseten: {
132
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
133
- model: (modelID: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
132
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
133
+ model: (modelID: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
134
134
  configure: (input?: FamilyModelOptions) => /*elided*/ any;
135
135
  };
136
136
  export declare const cerebras: {
137
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
138
- model: (modelID: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
137
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
138
+ model: (modelID: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
139
139
  configure: (input?: FamilyModelOptions) => /*elided*/ any;
140
140
  };
141
141
  export declare const deepinfra: {
142
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
143
- model: (modelID: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
142
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
143
+ model: (modelID: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
144
144
  configure: (input?: FamilyModelOptions) => /*elided*/ any;
145
145
  };
146
146
  export declare const deepseek: {
147
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
148
- model: (modelID: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
147
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
148
+ model: (modelID: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
149
149
  configure: (input?: FamilyModelOptions) => /*elided*/ any;
150
150
  };
151
151
  export declare const fireworks: {
152
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
153
- model: (modelID: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
152
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
153
+ model: (modelID: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
154
154
  configure: (input?: FamilyModelOptions) => /*elided*/ any;
155
155
  };
156
156
  export declare const groq: {
157
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
158
- model: (modelID: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
157
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
158
+ model: (modelID: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
159
159
  configure: (input?: FamilyModelOptions) => /*elided*/ any;
160
160
  };
161
161
  export declare const togetherai: {
162
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
163
- model: (modelID: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
162
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
163
+ model: (modelID: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
164
164
  configure: (input?: FamilyModelOptions) => /*elided*/ any;
165
165
  };
166
166
  export {};
@@ -6,7 +6,7 @@ import { type OpenAIProviderOptionsInput } from "./openai-options";
6
6
  import { type OpenAIImageString } from "../protocols/openai-images";
7
7
  export type { OpenAIOptionsInput, OpenAIResponseIncludable } from "./openai-options";
8
8
  export type { OpenAIImageOptions } from "../protocols/openai-images";
9
- export declare const id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
9
+ export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
10
10
  export declare const routes: (Route<{
11
11
  readonly model: string;
12
12
  readonly messages: readonly ({
@@ -341,34 +341,34 @@ export interface Settings extends ProviderPackage.Settings {
341
341
  readonly providerOptions?: OpenAIProviderOptionsInput;
342
342
  }
343
343
  export declare const configure: (input?: Config) => {
344
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
345
- model: (id: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
346
- responses: (id: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
347
- responsesWebSocket: (id: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
348
- chat: (id: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
344
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
345
+ model: (id: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
346
+ responses: (id: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
347
+ responsesWebSocket: (id: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
348
+ chat: (id: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
349
349
  image: (modelID: string | ModelID) => import("..").ImageModel<import("./openai").OpenAIImageOptions>;
350
350
  configure: (input?: Config) => /*elided*/ any;
351
351
  };
352
352
  export declare const provider: {
353
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
354
- model: (id: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
355
- responses: (id: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
356
- responsesWebSocket: (id: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
357
- chat: (id: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
353
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
354
+ model: (id: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
355
+ responses: (id: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
356
+ responsesWebSocket: (id: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
357
+ chat: (id: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
358
358
  image: (modelID: string | ModelID) => import("..").ImageModel<import("./openai").OpenAIImageOptions>;
359
359
  configure: (input?: Config) => {
360
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
361
- model: (id: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
362
- responses: (id: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
363
- responsesWebSocket: (id: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
364
- chat: (id: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
360
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
361
+ model: (id: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
362
+ responses: (id: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
363
+ responsesWebSocket: (id: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
364
+ chat: (id: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
365
365
  image: (modelID: string | ModelID) => import("..").ImageModel<import("./openai").OpenAIImageOptions>;
366
366
  configure: /*elided*/ any;
367
367
  };
368
368
  };
369
369
  export declare const model: ProviderPackage.Definition<Settings, OpenAIProviderOptionsInput>["model"];
370
370
  export declare const chatModel: ProviderPackage.Definition<Settings, OpenAIProviderOptionsInput>["model"];
371
- export declare const responses: (id: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
372
- export declare const responsesWebSocket: (id: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
373
- export declare const chat: (id: string | ModelID) => import("..").Model<OpenAIProviderOptionsInput>;
371
+ export declare const responses: (id: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
372
+ export declare const responsesWebSocket: (id: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
373
+ export declare const chat: (id: string | ModelID) => import("..").LanguageModel<OpenAIProviderOptionsInput>;
374
374
  export declare const image: (modelID: string | ModelID) => import("..").ImageModel<import("./openai").OpenAIImageOptions>;
@@ -9,7 +9,7 @@ export declare const profile: {
9
9
  readonly provider: "openrouter";
10
10
  readonly baseURL: "https://openrouter.ai/api/v1";
11
11
  };
12
- export declare const id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
12
+ export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
13
13
  type OpenRouterString<Known extends string> = Known | (string & {});
14
14
  export interface OpenRouterProviderRouting {
15
15
  readonly [key: string]: unknown;
@@ -80,7 +80,7 @@ export interface OpenRouterOptions {
80
80
  export type OpenRouterProviderOptionsInput = ProviderOptions & {
81
81
  readonly openrouter?: OpenRouterOptions;
82
82
  };
83
- export type ModelOptions = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
83
+ export type LanguageModelOptions = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
84
84
  readonly baseURL?: string;
85
85
  readonly providerOptions?: OpenRouterProviderOptionsInput;
86
86
  };
@@ -511,17 +511,17 @@ export declare const routes: Route<{
511
511
  readonly frequency_penalty?: number | undefined;
512
512
  readonly presence_penalty?: number | undefined;
513
513
  }, import("../route/transport/http").HttpPrepared<string>>[];
514
- export declare const configure: (input?: ModelOptions) => {
515
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
516
- model: (modelID: string | ModelID) => import("..").Model<OpenRouterProviderOptionsInput>;
517
- configure: (input?: ModelOptions) => /*elided*/ any;
514
+ export declare const configure: (input?: LanguageModelOptions) => {
515
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
516
+ model: (modelID: string | ModelID) => import("..").LanguageModel<OpenRouterProviderOptionsInput>;
517
+ configure: (input?: LanguageModelOptions) => /*elided*/ any;
518
518
  };
519
519
  export declare const provider: {
520
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
521
- model: (modelID: string | ModelID) => import("..").Model<OpenRouterProviderOptionsInput>;
522
- configure: (input?: ModelOptions) => {
523
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
524
- model: (modelID: string | ModelID) => import("..").Model<OpenRouterProviderOptionsInput>;
520
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
521
+ model: (modelID: string | ModelID) => import("..").LanguageModel<OpenRouterProviderOptionsInput>;
522
+ configure: (input?: LanguageModelOptions) => {
523
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
524
+ model: (modelID: string | ModelID) => import("..").LanguageModel<OpenRouterProviderOptionsInput>;
525
525
  configure: /*elided*/ any;
526
526
  };
527
527
  };
@@ -3,11 +3,11 @@ import { Route, type RouteDefaultsInput } from "../route/client";
3
3
  import { type ModelID, type ProviderOptions } from "../schema";
4
4
  import type { OpenAIOptionsInput } from "./openai-options";
5
5
  import type { ProviderPackage } from "../provider-package";
6
- export declare const id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
6
+ export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
7
7
  export type XAIProviderOptionsInput = ProviderOptions & {
8
8
  readonly xai?: OpenAIOptionsInput;
9
9
  };
10
- export type ModelOptions = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
10
+ export type LanguageModelOptions = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
11
11
  readonly baseURL?: string;
12
12
  readonly providerOptions?: XAIProviderOptionsInput;
13
13
  };
@@ -219,30 +219,30 @@ export declare const routes: (Route<{
219
219
  readonly prompt_cache_key?: string | undefined;
220
220
  readonly max_output_tokens?: number | undefined;
221
221
  }, import("../route/transport/http").HttpPrepared<string>>)[];
222
- export declare const configure: (input?: ModelOptions) => {
223
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
224
- model: (modelID: string | ModelID) => import("..").Model<XAIProviderOptionsInput>;
225
- responses: (modelID: string | ModelID) => import("..").Model<XAIProviderOptionsInput>;
226
- chat: (modelID: string | ModelID) => import("..").Model<XAIProviderOptionsInput>;
222
+ export declare const configure: (input?: LanguageModelOptions) => {
223
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
224
+ model: (modelID: string | ModelID) => import("..").LanguageModel<XAIProviderOptionsInput>;
225
+ responses: (modelID: string | ModelID) => import("..").LanguageModel<XAIProviderOptionsInput>;
226
+ chat: (modelID: string | ModelID) => import("..").LanguageModel<XAIProviderOptionsInput>;
227
227
  image: (modelID: string | ModelID) => import("..").ImageModel<import("./xai").XAIImageOptions>;
228
- configure: (input?: ModelOptions) => /*elided*/ any;
228
+ configure: (input?: LanguageModelOptions) => /*elided*/ any;
229
229
  };
230
230
  export declare const provider: {
231
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
232
- model: (modelID: string | ModelID) => import("..").Model<XAIProviderOptionsInput>;
233
- responses: (modelID: string | ModelID) => import("..").Model<XAIProviderOptionsInput>;
234
- chat: (modelID: string | ModelID) => import("..").Model<XAIProviderOptionsInput>;
231
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
232
+ model: (modelID: string | ModelID) => import("..").LanguageModel<XAIProviderOptionsInput>;
233
+ responses: (modelID: string | ModelID) => import("..").LanguageModel<XAIProviderOptionsInput>;
234
+ chat: (modelID: string | ModelID) => import("..").LanguageModel<XAIProviderOptionsInput>;
235
235
  image: (modelID: string | ModelID) => import("..").ImageModel<import("./xai").XAIImageOptions>;
236
- configure: (input?: ModelOptions) => {
237
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
238
- model: (modelID: string | ModelID) => import("..").Model<XAIProviderOptionsInput>;
239
- responses: (modelID: string | ModelID) => import("..").Model<XAIProviderOptionsInput>;
240
- chat: (modelID: string | ModelID) => import("..").Model<XAIProviderOptionsInput>;
236
+ configure: (input?: LanguageModelOptions) => {
237
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
238
+ model: (modelID: string | ModelID) => import("..").LanguageModel<XAIProviderOptionsInput>;
239
+ responses: (modelID: string | ModelID) => import("..").LanguageModel<XAIProviderOptionsInput>;
240
+ chat: (modelID: string | ModelID) => import("..").LanguageModel<XAIProviderOptionsInput>;
241
241
  image: (modelID: string | ModelID) => import("..").ImageModel<import("./xai").XAIImageOptions>;
242
242
  configure: /*elided*/ any;
243
243
  };
244
244
  };
245
245
  export declare const model: ProviderPackage.Definition<Settings, XAIProviderOptionsInput>["model"];
246
- export declare const responses: (modelID: string | ModelID) => import("..").Model<XAIProviderOptionsInput>;
247
- export declare const chat: (modelID: string | ModelID) => import("..").Model<XAIProviderOptionsInput>;
246
+ export declare const responses: (modelID: string | ModelID) => import("..").LanguageModel<XAIProviderOptionsInput>;
247
+ export declare const chat: (modelID: string | ModelID) => import("..").LanguageModel<XAIProviderOptionsInput>;
248
248
  export declare const image: (modelID: string | ModelID) => import("..").ImageModel<import("./xai").XAIImageOptions>;
@@ -1,6 +1,6 @@
1
1
  import { type ProviderAuthOption } from "../route/auth-options";
2
2
  import { HttpOptions, type ModelID } from "../schema";
3
- export declare const id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
3
+ export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
4
4
  export type Config = ProviderAuthOption<"optional"> & {
5
5
  readonly baseURL?: string;
6
6
  readonly headers?: Record<string, string>;
@@ -8,15 +8,15 @@ export type Config = ProviderAuthOption<"optional"> & {
8
8
  };
9
9
  export type { ZAIImageOptions } from "../protocols/zai-images";
10
10
  export declare const configure: (input?: Config) => {
11
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
11
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
12
12
  image: (modelID: string | ModelID) => import("..").ImageModel<import("./zai").ZAIImageOptions>;
13
13
  configure: (input?: Config) => /*elided*/ any;
14
14
  };
15
15
  export declare const provider: {
16
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
16
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
17
17
  image: (modelID: string | ModelID) => import("..").ImageModel<import("./zai").ZAIImageOptions>;
18
18
  configure: (input?: Config) => {
19
- id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
19
+ id: string & import("effect/Brand").Brand<"AI.ProviderID">;
20
20
  image: (modelID: string | ModelID) => import("..").ImageModel<import("./zai").ZAIImageOptions>;
21
21
  configure: /*elided*/ any;
22
22
  };
@@ -14,9 +14,9 @@ export type RequiredApiKeyAuth = {
14
14
  readonly auth?: never;
15
15
  };
16
16
  export type ProviderAuthOption<Mode extends ApiKeyMode> = AuthOverride | (Mode extends "optional" ? OptionalApiKeyAuth : RequiredApiKeyAuth);
17
- export type ModelOptions<Base, Mode extends ApiKeyMode> = Omit<Base, "apiKey" | "auth"> & ProviderAuthOption<Mode>;
18
- export type ModelArgs<Base, Mode extends ApiKeyMode> = Mode extends "optional" ? readonly [options?: ModelOptions<Base, Mode>] : readonly [options: ModelOptions<Base, Mode>];
19
- export type ModelFactory<Base, Mode extends ApiKeyMode, Model> = (id: string, ...args: ModelArgs<Base, Mode>) => Model;
17
+ export type LanguageModelOptions<Base, Mode extends ApiKeyMode> = Omit<Base, "apiKey" | "auth"> & ProviderAuthOption<Mode>;
18
+ export type LanguageModelArgs<Base, Mode extends ApiKeyMode> = Mode extends "optional" ? readonly [options?: LanguageModelOptions<Base, Mode>] : readonly [options: LanguageModelOptions<Base, Mode>];
19
+ export type LanguageModelFactory<Base, Mode extends ApiKeyMode, LanguageModel> = (id: string, ...args: LanguageModelArgs<Base, Mode>) => LanguageModel;
20
20
  /**
21
21
  * Require at least one of the keys in `T`. Use for option shapes where any
22
22
  * subset of fields is acceptable but at least one must be present (e.g. Azure
@@ -1,13 +1,13 @@
1
1
  import { Config, Effect, Redacted } from "effect";
2
2
  import { Headers } from "effect/unstable/http";
3
- import { LLMError, type HttpOptions } from "../schema";
3
+ import { AIError, type HttpOptions } from "../schema";
4
4
  export declare class MissingCredentialError extends Error {
5
5
  readonly source: string;
6
6
  readonly _tag = "MissingCredentialError";
7
7
  constructor(source: string);
8
8
  }
9
9
  export type CredentialError = MissingCredentialError | Config.ConfigError;
10
- export type AuthError = CredentialError | LLMError;
10
+ export type AuthError = CredentialError | AIError;
11
11
  type Secret = string | Redacted.Redacted | Config.Config<string | Redacted.Redacted>;
12
12
  export interface AuthInput {
13
13
  readonly request: {
@@ -39,7 +39,7 @@ export declare const effect: (load: Effect.Effect<Redacted.Redacted, CredentialE
39
39
  export declare const none: Definition;
40
40
  export declare const headers: (input: Headers.Input) => Definition;
41
41
  export declare const remove: (name: string) => Definition;
42
- export declare const custom: (apply: (input: AuthInput) => Effect.Effect<Headers.Headers, LLMError>) => Definition;
42
+ export declare const custom: (apply: (input: AuthInput) => Effect.Effect<Headers.Headers, AIError>) => Definition;
43
43
  export declare const passthrough: Definition;
44
44
  export declare function bearer(source: Secret | Credential): Definition;
45
45
  export declare const apiKey: typeof bearer;
@@ -47,5 +47,5 @@ export declare function header(name: string): (source: Secret | Credential) => D
47
47
  export declare function header(name: string, source: Secret | Credential): Definition;
48
48
  export declare function bearerHeader(name: string): (source: Secret | Credential) => Definition;
49
49
  export declare function bearerHeader(name: string, source: Secret | Credential): Definition;
50
- export declare const toEffect: (input: Definition) => (authInput: AuthInput) => Effect.Effect<Headers.Headers, LLMError>;
50
+ export declare const toEffect: (input: Definition) => (authInput: AuthInput) => Effect.Effect<Headers.Headers, AIError>;
51
51
  export * as Auth from "./auth";
@@ -1,6 +1,6 @@
1
1
  import { Config, Effect, Redacted } from "effect";
2
2
  import { Headers } from "effect/unstable/http";
3
- import { AuthenticationReason, InvalidRequestReason, LLMError } from "../schema";
3
+ import { AuthenticationReason, InvalidRequestReason, AIError } from "../schema";
4
4
  export class MissingCredentialError extends Error {
5
5
  source;
6
6
  _tag = "MissingCredentialError";
@@ -73,9 +73,9 @@ export function bearerHeader(name, source) {
73
73
  return render;
74
74
  return render(source);
75
75
  }
76
- const toLLMError = (error) => {
76
+ const toAIError = (error) => {
77
77
  if (error instanceof MissingCredentialError || error instanceof Config.ConfigError) {
78
- return new LLMError({
78
+ return new AIError({
79
79
  module: "Auth",
80
80
  method: "apply",
81
81
  reason: error instanceof MissingCredentialError
@@ -85,5 +85,5 @@ const toLLMError = (error) => {
85
85
  }
86
86
  return error;
87
87
  };
88
- export const toEffect = (input) => (authInput) => input.apply(authInput).pipe(Effect.mapError(toLLMError));
88
+ export const toEffect = (input) => (authInput) => input.apply(authInput).pipe(Effect.mapError(toAIError));
89
89
  export * as Auth from "./auth";
@@ -6,13 +6,13 @@ import { Framing } from "./framing";
6
6
  import { HttpTransport } from "./transport";
7
7
  import type { HttpRequestTransform, Transport, TransportRuntime } from "./transport";
8
8
  import type { Protocol } from "./protocol";
9
- import type { LLMError, ProtocolID, ProviderOptions } from "../schema";
10
- import { GenerationOptions, HttpOptions, LLMRequest, LLMResponse, Model, ModelLimits, LLMEvent, ProviderID } from "../schema";
9
+ import type { ProtocolID, ProviderOptions } from "../schema";
10
+ import { AIError, GenerationOptions, HttpOptions, LLMRequest, LLMResponse, LanguageModel, LanguageModelLimits, LLMEvent, ProviderID } from "../schema";
11
11
  export interface RouteBody<Body> {
12
12
  /** Schema for the validated provider-native body sent as the JSON request. */
13
13
  readonly schema: Schema.Codec<Body, unknown>;
14
14
  /** Build the provider-native body from a common `LLMRequest`. */
15
- readonly from: (request: LLMRequest) => Effect.Effect<Body, LLMError>;
15
+ readonly from: (request: LLMRequest) => Effect.Effect<Body, AIError>;
16
16
  }
17
17
  export interface Route<Body, Prepared = unknown> {
18
18
  readonly id: string;
@@ -26,24 +26,24 @@ export interface Route<Body, Prepared = unknown> {
26
26
  readonly defaults: RouteDefaults;
27
27
  readonly body: RouteBody<Body>;
28
28
  readonly with: (patch: RoutePatch<Body, Prepared>) => Route<Body, Prepared>;
29
- readonly model: <Options extends ProviderOptions = ProviderOptions>(input: RouteMappedModelInput) => Model<Options>;
30
- readonly prepareTransport: (body: Body, request: LLMRequest, options?: StreamOptions) => Effect.Effect<Prepared, LLMError>;
31
- readonly streamPrepared: (prepared: Prepared, request: LLMRequest, runtime: TransportRuntime) => Stream.Stream<LLMEvent, LLMError>;
29
+ readonly model: <Options extends ProviderOptions = ProviderOptions>(input: RouteMappedLanguageModelInput) => LanguageModel<Options>;
30
+ readonly prepareTransport: (body: Body, request: LLMRequest, options?: StreamOptions) => Effect.Effect<Prepared, AIError>;
31
+ readonly streamPrepared: (prepared: Prepared, request: LLMRequest, runtime: TransportRuntime) => Stream.Stream<LLMEvent, AIError>;
32
32
  }
33
33
  export type AnyRoute = Route<any, any>;
34
34
  export type HttpOptionsInput = HttpOptions.Input;
35
- export type RouteModelInput = Omit<Model.Input, "provider" | "route">;
36
- export type RouteRoutedModelInput = Omit<Model.Input, "route">;
35
+ export type RouteLanguageModelInput = Omit<LanguageModel.Input, "provider" | "route">;
36
+ export type RouteRoutedLanguageModelInput = Omit<LanguageModel.Input, "route">;
37
37
  export interface RouteDefaults {
38
38
  readonly headers?: Record<string, string>;
39
- readonly limits?: ModelLimits;
39
+ readonly limits?: LanguageModelLimits;
40
40
  readonly generation?: GenerationOptions;
41
41
  readonly providerOptions?: ProviderOptions;
42
42
  readonly http?: HttpOptions;
43
43
  }
44
44
  export interface RouteDefaultsInput {
45
45
  readonly headers?: Record<string, string>;
46
- readonly limits?: ModelLimits.Input;
46
+ readonly limits?: LanguageModelLimits.Input;
47
47
  readonly generation?: GenerationOptions.Input;
48
48
  readonly providerOptions?: ProviderOptions;
49
49
  readonly http?: HttpOptions.Input;
@@ -55,7 +55,7 @@ export interface RoutePatch<Body, Prepared> extends RouteDefaultsInput {
55
55
  readonly transport?: Transport<Body, Prepared, unknown>;
56
56
  readonly endpoint?: EndpointPatch<Body>;
57
57
  }
58
- type RouteMappedModelInput = RouteModelInput | RouteRoutedModelInput;
58
+ type RouteMappedLanguageModelInput = RouteLanguageModelInput | RouteRoutedLanguageModelInput;
59
59
  export declare const generationOptions: (input: GenerationOptions.Input | undefined) => GenerationOptions | undefined;
60
60
  export declare const httpOptions: (input: HttpOptionsInput | undefined) => HttpOptions | undefined;
61
61
  export interface Interface {
@@ -66,10 +66,10 @@ export interface StreamOptions {
66
66
  readonly transform?: HttpRequestTransform;
67
67
  }
68
68
  export interface StreamMethod {
69
- (request: LLMRequest, options?: StreamOptions): Stream.Stream<LLMEvent, LLMError>;
69
+ (request: LLMRequest, options?: StreamOptions): Stream.Stream<LLMEvent, AIError>;
70
70
  }
71
71
  export interface GenerateMethod {
72
- (request: LLMRequest, options?: StreamOptions): Effect.Effect<LLMResponse, LLMError>;
72
+ (request: LLMRequest, options?: StreamOptions): Effect.Effect<LLMResponse, AIError>;
73
73
  }
74
74
  declare const Service_base: Context.ServiceClass<Service, "@opencode/LLMClient", Interface>;
75
75
  export declare class Service extends Service_base {
@@ -140,7 +140,7 @@ export declare const compileRequest: (request: LLMRequest) => Effect.Effect<{
140
140
  id: string;
141
141
  route: string;
142
142
  protocol: string;
143
- model: Model<{
143
+ model: LanguageModel<{
144
144
  readonly [x: string]: {
145
145
  readonly [x: string]: unknown;
146
146
  };
@@ -149,9 +149,9 @@ export declare const compileRequest: (request: LLMRequest) => Effect.Effect<{
149
149
  metadata: {
150
150
  transport: string;
151
151
  };
152
- }, LLMError, never>;
153
- export declare function stream(request: LLMRequest, options?: StreamOptions): Stream.Stream<LLMEvent, LLMError>;
154
- export declare function generate(request: LLMRequest, options?: StreamOptions): Effect.Effect<LLMResponse, LLMError>;
152
+ }, AIError, never>;
153
+ export declare function stream(request: LLMRequest, options?: StreamOptions): Stream.Stream<LLMEvent, AIError>;
154
+ export declare function generate(request: LLMRequest, options?: StreamOptions): Effect.Effect<LLMResponse, AIError>;
155
155
  export declare const streamRequest: (request: LLMRequest, options?: StreamOptions) => Stream.Stream<{
156
156
  readonly type: "step-start";
157
157
  readonly index: number;
@@ -333,7 +333,7 @@ export declare const streamRequest: (request: LLMRequest, options?: StreamOption
333
333
  };
334
334
  } | undefined;
335
335
  readonly classification?: "context-overflow" | "payload-too-large" | undefined;
336
- }, LLMError, Service>;
336
+ }, AIError, Service>;
337
337
  export declare const layer: Layer.Layer<Service, never, RequestExecutor.Service>;
338
338
  export declare const Route: {
339
339
  readonly make: typeof make;