@opencode-ai/ai 0.0.0-next-17239 → 0.0.0-next-17250
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.
- package/dist/cache-policy.d.ts +1 -1
- package/dist/cache-policy.js +2 -2
- package/dist/image-client.d.ts +3 -3
- package/dist/image-client.js +1 -1
- package/dist/image.d.ts +2 -2
- package/dist/image.js +2 -2
- package/dist/index.d.ts +18 -18
- package/dist/index.js +12 -12
- package/dist/llm.d.ts +8 -8
- package/dist/llm.js +3 -3
- package/dist/protocols/anthropic-messages.d.ts +7 -7
- package/dist/protocols/anthropic-messages.js +13 -13
- package/dist/protocols/bedrock-converse.d.ts +10 -10
- package/dist/protocols/bedrock-converse.js +14 -14
- package/dist/protocols/bedrock-event-stream.d.ts +2 -2
- package/dist/protocols/bedrock-event-stream.js +3 -3
- package/dist/protocols/gemini.d.ts +6 -6
- package/dist/protocols/gemini.js +11 -11
- package/dist/protocols/google-images.d.ts +3 -3
- package/dist/protocols/google-images.js +5 -5
- package/dist/protocols/index.d.ts +9 -9
- package/dist/protocols/index.js +9 -9
- package/dist/protocols/open-responses.d.ts +7 -7
- package/dist/protocols/open-responses.js +10 -10
- package/dist/protocols/openai-chat.d.ts +7 -7
- package/dist/protocols/openai-chat.js +13 -13
- package/dist/protocols/openai-compatible-chat.d.ts +3 -3
- package/dist/protocols/openai-compatible-chat.js +5 -5
- package/dist/protocols/openai-compatible-responses.d.ts +3 -3
- package/dist/protocols/openai-compatible-responses.js +4 -4
- package/dist/protocols/openai-images.d.ts +3 -3
- package/dist/protocols/openai-images.js +6 -6
- package/dist/protocols/openai-responses.d.ts +7 -7
- package/dist/protocols/openai-responses.js +12 -12
- package/dist/protocols/shared.d.ts +7 -7
- package/dist/protocols/shared.js +3 -3
- package/dist/protocols/utils/bedrock-auth.d.ts +2 -2
- package/dist/protocols/utils/bedrock-auth.js +3 -3
- package/dist/protocols/utils/bedrock-cache.d.ts +4 -4
- package/dist/protocols/utils/bedrock-cache.js +2 -2
- package/dist/protocols/utils/bedrock-media.d.ts +2 -2
- package/dist/protocols/utils/bedrock-media.js +2 -2
- package/dist/protocols/utils/gemini-tool-schema.d.ts +1 -1
- package/dist/protocols/utils/gemini-tool-schema.js +2 -2
- package/dist/protocols/utils/image-input.d.ts +2 -2
- package/dist/protocols/utils/image-input.js +1 -1
- package/dist/protocols/utils/lifecycle.d.ts +2 -2
- package/dist/protocols/utils/lifecycle.js +2 -2
- package/dist/protocols/utils/open-responses-options.d.ts +2 -2
- package/dist/protocols/utils/open-responses-options.js +2 -2
- package/dist/protocols/utils/openai-options.d.ts +3 -3
- package/dist/protocols/utils/openai-options.js +3 -3
- package/dist/protocols/utils/tool-schema.d.ts +1 -1
- package/dist/protocols/utils/tool-schema.js +2 -2
- package/dist/protocols/utils/tool-stream.d.ts +9 -9
- package/dist/protocols/utils/tool-stream.js +3 -3
- package/dist/protocols/xai-images.d.ts +3 -3
- package/dist/protocols/xai-images.js +5 -5
- package/dist/protocols/zai-images.d.ts +3 -3
- package/dist/protocols/zai-images.js +5 -5
- package/dist/protocols.d.ts +1 -1
- package/dist/protocols.js +1 -1
- package/dist/provider-error.d.ts +1 -1
- package/dist/provider-error.js +1 -1
- package/dist/provider-package.d.ts +2 -2
- package/dist/provider-package.js +1 -1
- package/dist/provider.d.ts +2 -2
- package/dist/provider.js +1 -1
- package/dist/providers/amazon-bedrock/mantle/chat.d.ts +2 -2
- package/dist/providers/amazon-bedrock/mantle/chat.js +1 -1
- package/dist/providers/amazon-bedrock/mantle/responses.d.ts +2 -2
- package/dist/providers/amazon-bedrock/mantle/responses.js +1 -1
- package/dist/providers/amazon-bedrock/mantle.d.ts +2 -2
- package/dist/providers/amazon-bedrock/mantle.js +1 -1
- package/dist/providers/amazon-bedrock-mantle.d.ts +17 -17
- package/dist/providers/amazon-bedrock-mantle.js +6 -6
- package/dist/providers/amazon-bedrock.d.ts +9 -9
- package/dist/providers/amazon-bedrock.js +3 -3
- package/dist/providers/anthropic-compatible.d.ts +10 -10
- package/dist/providers/anthropic-compatible.js +4 -4
- package/dist/providers/anthropic.d.ts +10 -10
- package/dist/providers/anthropic.js +4 -4
- package/dist/providers/azure/chat.d.ts +2 -2
- package/dist/providers/azure/chat.js +1 -1
- package/dist/providers/azure/responses.d.ts +2 -2
- package/dist/providers/azure/responses.js +1 -1
- package/dist/providers/azure.d.ts +14 -14
- package/dist/providers/azure.js +7 -7
- package/dist/providers/cloudflare.d.ts +12 -12
- package/dist/providers/cloudflare.js +4 -4
- package/dist/providers/google-vertex/chat.d.ts +2 -2
- package/dist/providers/google-vertex/chat.js +1 -1
- package/dist/providers/google-vertex/gemini.d.ts +2 -2
- package/dist/providers/google-vertex/gemini.js +1 -1
- package/dist/providers/google-vertex/messages.d.ts +2 -2
- package/dist/providers/google-vertex/messages.js +1 -1
- package/dist/providers/google-vertex/responses.d.ts +2 -2
- package/dist/providers/google-vertex/responses.js +1 -1
- package/dist/providers/google-vertex-chat.d.ts +9 -9
- package/dist/providers/google-vertex-chat.js +3 -3
- package/dist/providers/google-vertex-messages.d.ts +8 -8
- package/dist/providers/google-vertex-messages.js +8 -8
- package/dist/providers/google-vertex-responses.d.ts +9 -9
- package/dist/providers/google-vertex-responses.js +3 -3
- package/dist/providers/google-vertex-shared.d.ts +2 -2
- package/dist/providers/google-vertex-shared.js +2 -2
- package/dist/providers/google-vertex.d.ts +8 -8
- package/dist/providers/google-vertex.js +7 -7
- package/dist/providers/google.d.ts +15 -15
- package/dist/providers/google.js +4 -4
- package/dist/providers/index.d.ts +18 -18
- package/dist/providers/index.js +18 -18
- package/dist/providers/open-responses-options.d.ts +3 -3
- package/dist/providers/open-responses-options.js +1 -1
- package/dist/providers/openai/chat.d.ts +2 -2
- package/dist/providers/openai/chat.js +1 -1
- package/dist/providers/openai/responses.d.ts +2 -2
- package/dist/providers/openai/responses.js +1 -1
- package/dist/providers/openai-compatible/responses.d.ts +1 -1
- package/dist/providers/openai-compatible/responses.js +1 -1
- package/dist/providers/openai-compatible-responses.d.ts +10 -10
- package/dist/providers/openai-compatible-responses.js +3 -3
- package/dist/providers/openai-compatible.d.ts +16 -16
- package/dist/providers/openai-compatible.js +4 -4
- package/dist/providers/openai-options.d.ts +4 -4
- package/dist/providers/openai-options.js +2 -2
- package/dist/providers/openai.d.ts +30 -30
- package/dist/providers/openai.js +6 -6
- package/dist/providers/openrouter.d.ts +11 -11
- package/dist/providers/openrouter.js +10 -10
- package/dist/providers/xai.d.ts +23 -23
- package/dist/providers/xai.js +9 -9
- package/dist/providers/zai.d.ts +7 -7
- package/dist/providers/zai.js +3 -3
- package/dist/providers.d.ts +1 -1
- package/dist/providers.js +1 -1
- package/dist/route/auth-options.d.ts +2 -2
- package/dist/route/auth-options.js +2 -2
- package/dist/route/auth.d.ts +2 -2
- package/dist/route/auth.js +2 -2
- package/dist/route/client.d.ts +11 -11
- package/dist/route/client.js +9 -9
- package/dist/route/endpoint.d.ts +2 -2
- package/dist/route/endpoint.js +2 -2
- package/dist/route/executor.d.ts +3 -3
- package/dist/route/executor.js +3 -3
- package/dist/route/framing.d.ts +2 -2
- package/dist/route/framing.js +2 -2
- package/dist/route/index.d.ts +16 -16
- package/dist/route/index.js +9 -9
- package/dist/route/protocol.d.ts +2 -2
- package/dist/route/protocol.js +1 -1
- package/dist/route/transport/http.d.ts +3 -3
- package/dist/route/transport/http.js +5 -5
- package/dist/route/transport/index.d.ts +8 -8
- package/dist/route/transport/index.js +4 -4
- package/dist/route/transport/websocket.d.ts +2 -2
- package/dist/route/transport/websocket.js +2 -2
- package/dist/route.d.ts +1 -1
- package/dist/route.js +1 -1
- package/dist/schema/errors.js +1 -1
- package/dist/schema/events.d.ts +2 -2
- package/dist/schema/events.js +3 -3
- package/dist/schema/index.d.ts +5 -5
- package/dist/schema/index.js +5 -5
- package/dist/schema/messages.d.ts +3 -3
- package/dist/schema/messages.js +3 -3
- package/dist/schema/options.d.ts +2 -2
- package/dist/schema/options.js +2 -2
- package/dist/testing.d.ts +20 -20
- package/dist/testing.js +3 -3
- package/dist/tool-runtime.d.ts +2 -2
- package/dist/tool-runtime.js +2 -2
- package/dist/tool.d.ts +3 -3
- package/dist/tool.js +2 -2
- package/package.json +3 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type ProviderAuthOption } from "../route/auth-options";
|
|
2
|
-
import type { Route, RouteDefaultsInput } from "../route/client";
|
|
3
|
-
import type { ProviderPackage } from "../provider-package";
|
|
4
|
-
import { ToolDefinition, type ModelID } from "../schema";
|
|
5
|
-
import { type OpenAIProviderOptionsInput } from "./openai-options";
|
|
6
|
-
import { type OpenAIImageString } from "../protocols/openai-images";
|
|
7
|
-
export type { OpenAIOptionsInput, OpenAIResponseIncludable } from "./openai-options";
|
|
8
|
-
export type { OpenAIImageOptions } from "../protocols/openai-images";
|
|
1
|
+
import { type ProviderAuthOption } from "../route/auth-options.js";
|
|
2
|
+
import type { Route, RouteDefaultsInput } from "../route/client.js";
|
|
3
|
+
import type { ProviderPackage } from "../provider-package.js";
|
|
4
|
+
import { ToolDefinition, type ModelID } from "../schema/index.js";
|
|
5
|
+
import { type OpenAIProviderOptionsInput } from "./openai-options.js";
|
|
6
|
+
import { type OpenAIImageString } from "../protocols/openai-images.js";
|
|
7
|
+
export type { OpenAIOptionsInput, OpenAIResponseIncludable } from "./openai-options.js";
|
|
8
|
+
export type { OpenAIImageOptions } from "../protocols/openai-images.js";
|
|
9
9
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
10
10
|
export declare const routes: (Route<{
|
|
11
11
|
readonly model: string;
|
|
@@ -103,7 +103,7 @@ export declare const routes: (Route<{
|
|
|
103
103
|
readonly reasoning_effort?: string | undefined;
|
|
104
104
|
readonly frequency_penalty?: number | undefined;
|
|
105
105
|
readonly presence_penalty?: number | undefined;
|
|
106
|
-
}, import("../route/transport/http").HttpPrepared<string>> | Route<{
|
|
106
|
+
}, import("../route/transport/http.js").HttpPrepared<string>> | Route<{
|
|
107
107
|
readonly input: readonly ({
|
|
108
108
|
readonly type: "reasoning";
|
|
109
109
|
readonly summary: readonly {
|
|
@@ -209,7 +209,7 @@ export declare const routes: (Route<{
|
|
|
209
209
|
readonly prompt_cache_key?: string | undefined;
|
|
210
210
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
211
211
|
readonly max_output_tokens?: number | undefined;
|
|
212
|
-
}, import("../route/transport/http").HttpPrepared<string>> | Route<{
|
|
212
|
+
}, import("../route/transport/http.js").HttpPrepared<string>> | Route<{
|
|
213
213
|
readonly input: readonly ({
|
|
214
214
|
readonly type: "reasoning";
|
|
215
215
|
readonly summary: readonly {
|
|
@@ -315,7 +315,7 @@ export declare const routes: (Route<{
|
|
|
315
315
|
readonly prompt_cache_key?: string | undefined;
|
|
316
316
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
317
317
|
readonly max_output_tokens?: number | undefined;
|
|
318
|
-
}, import("../route/transport/websocket").JsonPrepared>)[];
|
|
318
|
+
}, import("../route/transport/websocket.js").JsonPrepared>)[];
|
|
319
319
|
export type Config = RouteDefaultsInput & ProviderAuthOption<"optional"> & {
|
|
320
320
|
readonly baseURL?: string;
|
|
321
321
|
readonly queryParams?: Record<string, string>;
|
|
@@ -343,33 +343,33 @@ export interface Settings extends ProviderPackage.Settings {
|
|
|
343
343
|
}
|
|
344
344
|
export declare const configure: (input?: Config) => {
|
|
345
345
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
346
|
-
model: (id: string | ModelID) => import("
|
|
347
|
-
responses: (id: string | ModelID) => import("
|
|
348
|
-
responsesWebSocket: (id: string | ModelID) => import("
|
|
349
|
-
chat: (id: string | ModelID) => import("
|
|
350
|
-
image: (modelID: string | ModelID) => import("
|
|
346
|
+
model: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
|
|
347
|
+
responses: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
|
|
348
|
+
responsesWebSocket: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
|
|
349
|
+
chat: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
|
|
350
|
+
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
351
351
|
configure: (input?: Config) => /*elided*/ any;
|
|
352
352
|
};
|
|
353
353
|
export declare const provider: {
|
|
354
354
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
355
|
-
model: (id: string | ModelID) => import("
|
|
356
|
-
responses: (id: string | ModelID) => import("
|
|
357
|
-
responsesWebSocket: (id: string | ModelID) => import("
|
|
358
|
-
chat: (id: string | ModelID) => import("
|
|
359
|
-
image: (modelID: string | ModelID) => import("
|
|
355
|
+
model: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
|
|
356
|
+
responses: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
|
|
357
|
+
responsesWebSocket: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
|
|
358
|
+
chat: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
|
|
359
|
+
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
360
360
|
configure: (input?: Config) => {
|
|
361
361
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
362
|
-
model: (id: string | ModelID) => import("
|
|
363
|
-
responses: (id: string | ModelID) => import("
|
|
364
|
-
responsesWebSocket: (id: string | ModelID) => import("
|
|
365
|
-
chat: (id: string | ModelID) => import("
|
|
366
|
-
image: (modelID: string | ModelID) => import("
|
|
362
|
+
model: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
|
|
363
|
+
responses: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
|
|
364
|
+
responsesWebSocket: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
|
|
365
|
+
chat: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
|
|
366
|
+
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
367
367
|
configure: /*elided*/ any;
|
|
368
368
|
};
|
|
369
369
|
};
|
|
370
370
|
export declare const model: ProviderPackage.Definition<Settings, OpenAIProviderOptionsInput>["model"];
|
|
371
371
|
export declare const chatModel: ProviderPackage.Definition<Settings, OpenAIProviderOptionsInput>["model"];
|
|
372
|
-
export declare const responses: (id: string | ModelID) => import("
|
|
373
|
-
export declare const responsesWebSocket: (id: string | ModelID) => import("
|
|
374
|
-
export declare const chat: (id: string | ModelID) => import("
|
|
375
|
-
export declare const image: (modelID: string | ModelID) => import("
|
|
372
|
+
export declare const responses: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
|
|
373
|
+
export declare const responsesWebSocket: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
|
|
374
|
+
export declare const chat: (id: string | ModelID) => import("../schema/options.js").LanguageModel<OpenAIProviderOptionsInput>;
|
|
375
|
+
export declare const image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
package/dist/providers/openai.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AuthOptions } from "../route/auth-options";
|
|
2
|
-
import { HttpOptions, ProviderID, ToolDefinition, mergeHttpOptions } from "../schema";
|
|
3
|
-
import * as OpenAIChat from "../protocols/openai-chat";
|
|
4
|
-
import * as OpenAIResponses from "../protocols/openai-responses";
|
|
5
|
-
import { withOpenAIOptions } from "./openai-options";
|
|
6
|
-
import { OpenAIImages } from "../protocols/openai-images";
|
|
1
|
+
import { AuthOptions } from "../route/auth-options.js";
|
|
2
|
+
import { HttpOptions, ProviderID, ToolDefinition, mergeHttpOptions } from "../schema/index.js";
|
|
3
|
+
import * as OpenAIChat from "../protocols/openai-chat.js";
|
|
4
|
+
import * as OpenAIResponses from "../protocols/openai-responses.js";
|
|
5
|
+
import { withOpenAIOptions } from "./openai-options.js";
|
|
6
|
+
import { OpenAIImages } from "../protocols/openai-images.js";
|
|
7
7
|
export const id = ProviderID.make("openai");
|
|
8
8
|
export const routes = [OpenAIResponses.route, OpenAIResponses.webSocketRoute, OpenAIChat.route];
|
|
9
9
|
export const imageGeneration = (options = {}) => ToolDefinition.make({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { Route, type RouteDefaultsInput } from "../route/client";
|
|
3
|
-
import { Protocol } from "../route/protocol";
|
|
4
|
-
import { type ProviderAuthOption } from "../route/auth-options";
|
|
5
|
-
import { type ModelID, type ProviderOptions } from "../schema";
|
|
6
|
-
import type { ProviderPackage } from "../provider-package";
|
|
7
|
-
import * as OpenAIChat from "../protocols/openai-chat";
|
|
2
|
+
import { Route, type RouteDefaultsInput } from "../route/client.js";
|
|
3
|
+
import { Protocol } from "../route/protocol.js";
|
|
4
|
+
import { type ProviderAuthOption } from "../route/auth-options.js";
|
|
5
|
+
import { type ModelID, type ProviderOptions } from "../schema/index.js";
|
|
6
|
+
import type { ProviderPackage } from "../provider-package.js";
|
|
7
|
+
import * as OpenAIChat from "../protocols/openai-chat.js";
|
|
8
8
|
export declare const profile: {
|
|
9
9
|
readonly provider: "openrouter";
|
|
10
10
|
readonly baseURL: "https://openrouter.ai/api/v1";
|
|
@@ -420,7 +420,7 @@ export declare const route: Route<{
|
|
|
420
420
|
readonly reasoning_effort?: string | undefined;
|
|
421
421
|
readonly frequency_penalty?: number | undefined;
|
|
422
422
|
readonly presence_penalty?: number | undefined;
|
|
423
|
-
}, import("../route/transport/http").HttpPrepared<string>>;
|
|
423
|
+
}, import("../route/transport/http.js").HttpPrepared<string>>;
|
|
424
424
|
export declare const routes: Route<{
|
|
425
425
|
readonly [x: string]: any;
|
|
426
426
|
readonly model: string;
|
|
@@ -518,18 +518,18 @@ export declare const routes: Route<{
|
|
|
518
518
|
readonly reasoning_effort?: string | undefined;
|
|
519
519
|
readonly frequency_penalty?: number | undefined;
|
|
520
520
|
readonly presence_penalty?: number | undefined;
|
|
521
|
-
}, import("../route/transport/http").HttpPrepared<string>>[];
|
|
521
|
+
}, import("../route/transport/http.js").HttpPrepared<string>>[];
|
|
522
522
|
export declare const configure: (input?: LanguageModelOptions) => {
|
|
523
523
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
524
|
-
model: (modelID: string | ModelID) => import("
|
|
524
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenRouterProviderOptionsInput>;
|
|
525
525
|
configure: (input?: LanguageModelOptions) => /*elided*/ any;
|
|
526
526
|
};
|
|
527
527
|
export declare const provider: {
|
|
528
528
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
529
|
-
model: (modelID: string | ModelID) => import("
|
|
529
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenRouterProviderOptionsInput>;
|
|
530
530
|
configure: (input?: LanguageModelOptions) => {
|
|
531
531
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
532
|
-
model: (modelID: string | ModelID) => import("
|
|
532
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenRouterProviderOptionsInput>;
|
|
533
533
|
configure: /*elided*/ any;
|
|
534
534
|
};
|
|
535
535
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import { Route } from "../route/client";
|
|
3
|
-
import { Endpoint } from "../route/endpoint";
|
|
4
|
-
import { Framing } from "../route/framing";
|
|
5
|
-
import { Protocol } from "../route/protocol";
|
|
6
|
-
import { AuthOptions } from "../route/auth-options";
|
|
7
|
-
import { ProviderID } from "../schema";
|
|
8
|
-
import * as OpenAICompatibleProfiles from "./openai-compatible-profile";
|
|
9
|
-
import * as OpenAIChat from "../protocols/openai-chat";
|
|
10
|
-
import { newBreakpoints, ttlBucket } from "../protocols/utils/cache";
|
|
11
|
-
import { isRecord } from "../protocols/shared";
|
|
2
|
+
import { Route } from "../route/client.js";
|
|
3
|
+
import { Endpoint } from "../route/endpoint.js";
|
|
4
|
+
import { Framing } from "../route/framing.js";
|
|
5
|
+
import { Protocol } from "../route/protocol.js";
|
|
6
|
+
import { AuthOptions } from "../route/auth-options.js";
|
|
7
|
+
import { ProviderID } from "../schema/index.js";
|
|
8
|
+
import * as OpenAICompatibleProfiles from "./openai-compatible-profile.js";
|
|
9
|
+
import * as OpenAIChat from "../protocols/openai-chat.js";
|
|
10
|
+
import { newBreakpoints, ttlBucket } from "../protocols/utils/cache.js";
|
|
11
|
+
import { isRecord } from "../protocols/shared.js";
|
|
12
12
|
export const profile = OpenAICompatibleProfiles.profiles.openrouter;
|
|
13
13
|
export const id = ProviderID.make(profile.provider);
|
|
14
14
|
const ADAPTER = "openrouter";
|
package/dist/providers/xai.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type ProviderAuthOption } from "../route/auth-options";
|
|
2
|
-
import { Route, type RouteDefaultsInput } from "../route/client";
|
|
3
|
-
import { type ModelID, type ProviderOptions } from "../schema";
|
|
4
|
-
import type { OpenAIOptionsInput } from "./openai-options";
|
|
5
|
-
import type { ProviderPackage } from "../provider-package";
|
|
1
|
+
import { type ProviderAuthOption } from "../route/auth-options.js";
|
|
2
|
+
import { Route, type RouteDefaultsInput } from "../route/client.js";
|
|
3
|
+
import { type ModelID, type ProviderOptions } from "../schema/index.js";
|
|
4
|
+
import type { OpenAIOptionsInput } from "./openai-options.js";
|
|
5
|
+
import type { ProviderPackage } from "../provider-package.js";
|
|
6
6
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
7
7
|
export type XAIProviderOptionsInput = ProviderOptions & {
|
|
8
8
|
readonly xai?: OpenAIOptionsInput;
|
|
@@ -16,7 +16,7 @@ export interface Settings extends ProviderPackage.Settings {
|
|
|
16
16
|
readonly baseURL?: string;
|
|
17
17
|
readonly providerOptions?: XAIProviderOptionsInput;
|
|
18
18
|
}
|
|
19
|
-
export type { XAIImageOptions } from "../protocols/xai-images";
|
|
19
|
+
export type { XAIImageOptions } from "../protocols/xai-images.js";
|
|
20
20
|
export declare const routes: (Route<{
|
|
21
21
|
readonly model: string;
|
|
22
22
|
readonly messages: readonly ({
|
|
@@ -113,7 +113,7 @@ export declare const routes: (Route<{
|
|
|
113
113
|
readonly reasoning_effort?: string | undefined;
|
|
114
114
|
readonly frequency_penalty?: number | undefined;
|
|
115
115
|
readonly presence_penalty?: number | undefined;
|
|
116
|
-
}, import("../route/transport/http").HttpPrepared<string>> | Route<{
|
|
116
|
+
}, import("../route/transport/http.js").HttpPrepared<string>> | Route<{
|
|
117
117
|
readonly input: readonly ({
|
|
118
118
|
readonly type: "reasoning";
|
|
119
119
|
readonly summary: readonly {
|
|
@@ -219,31 +219,31 @@ export declare const routes: (Route<{
|
|
|
219
219
|
readonly prompt_cache_key?: string | undefined;
|
|
220
220
|
readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
|
|
221
221
|
readonly max_output_tokens?: number | undefined;
|
|
222
|
-
}, import("../route/transport/http").HttpPrepared<string>>)[];
|
|
222
|
+
}, import("../route/transport/http.js").HttpPrepared<string>>)[];
|
|
223
223
|
export declare const configure: (input?: LanguageModelOptions) => {
|
|
224
224
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
225
|
-
model: (modelID: string | ModelID) => import("
|
|
226
|
-
responses: (modelID: string | ModelID) => import("
|
|
227
|
-
chat: (modelID: string | ModelID) => import("
|
|
228
|
-
image: (modelID: string | ModelID) => import("
|
|
225
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
|
|
226
|
+
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
|
|
227
|
+
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
|
|
228
|
+
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/xai-images.js").XAIImageOptions>;
|
|
229
229
|
configure: (input?: LanguageModelOptions) => /*elided*/ any;
|
|
230
230
|
};
|
|
231
231
|
export declare const provider: {
|
|
232
232
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
233
|
-
model: (modelID: string | ModelID) => import("
|
|
234
|
-
responses: (modelID: string | ModelID) => import("
|
|
235
|
-
chat: (modelID: string | ModelID) => import("
|
|
236
|
-
image: (modelID: string | ModelID) => import("
|
|
233
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
|
|
234
|
+
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
|
|
235
|
+
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
|
|
236
|
+
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/xai-images.js").XAIImageOptions>;
|
|
237
237
|
configure: (input?: LanguageModelOptions) => {
|
|
238
238
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
239
|
-
model: (modelID: string | ModelID) => import("
|
|
240
|
-
responses: (modelID: string | ModelID) => import("
|
|
241
|
-
chat: (modelID: string | ModelID) => import("
|
|
242
|
-
image: (modelID: string | ModelID) => import("
|
|
239
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
|
|
240
|
+
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
|
|
241
|
+
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
|
|
242
|
+
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/xai-images.js").XAIImageOptions>;
|
|
243
243
|
configure: /*elided*/ any;
|
|
244
244
|
};
|
|
245
245
|
};
|
|
246
246
|
export declare const model: ProviderPackage.Definition<Settings, XAIProviderOptionsInput>["model"];
|
|
247
|
-
export declare const responses: (modelID: string | ModelID) => import("
|
|
248
|
-
export declare const chat: (modelID: string | ModelID) => import("
|
|
249
|
-
export declare const image: (modelID: string | ModelID) => import("
|
|
247
|
+
export declare const responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
|
|
248
|
+
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<XAIProviderOptionsInput>;
|
|
249
|
+
export declare const image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/xai-images.js").XAIImageOptions>;
|
package/dist/providers/xai.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { AuthOptions } from "../route/auth-options";
|
|
2
|
-
import { Route } from "../route/client";
|
|
3
|
-
import { Endpoint } from "../route/endpoint";
|
|
4
|
-
import { HttpOptions, ProviderID } from "../schema";
|
|
5
|
-
import * as OpenAICompatibleProfiles from "./openai-compatible-profile";
|
|
6
|
-
import * as OpenAICompatibleChat from "../protocols/openai-compatible-chat";
|
|
7
|
-
import * as OpenAIChat from "../protocols/openai-chat";
|
|
8
|
-
import * as OpenAIResponses from "../protocols/openai-responses";
|
|
9
|
-
import { XAIImages } from "../protocols/xai-images";
|
|
1
|
+
import { AuthOptions } from "../route/auth-options.js";
|
|
2
|
+
import { Route } from "../route/client.js";
|
|
3
|
+
import { Endpoint } from "../route/endpoint.js";
|
|
4
|
+
import { HttpOptions, ProviderID } from "../schema/index.js";
|
|
5
|
+
import * as OpenAICompatibleProfiles from "./openai-compatible-profile.js";
|
|
6
|
+
import * as OpenAICompatibleChat from "../protocols/openai-compatible-chat.js";
|
|
7
|
+
import * as OpenAIChat from "../protocols/openai-chat.js";
|
|
8
|
+
import * as OpenAIResponses from "../protocols/openai-responses.js";
|
|
9
|
+
import { XAIImages } from "../protocols/xai-images.js";
|
|
10
10
|
export const id = ProviderID.make("xai");
|
|
11
11
|
const responsesRoute = Route.make({
|
|
12
12
|
id: "openai-responses",
|
package/dist/providers/zai.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { type ProviderAuthOption } from "../route/auth-options";
|
|
2
|
-
import { HttpOptions, type ModelID } from "../schema";
|
|
1
|
+
import { type ProviderAuthOption } from "../route/auth-options.js";
|
|
2
|
+
import { HttpOptions, type ModelID } from "../schema/index.js";
|
|
3
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>;
|
|
7
7
|
readonly http?: HttpOptions.Input;
|
|
8
8
|
};
|
|
9
|
-
export type { ZAIImageOptions } from "../protocols/zai-images";
|
|
9
|
+
export type { ZAIImageOptions } from "../protocols/zai-images.js";
|
|
10
10
|
export declare const configure: (input?: Config) => {
|
|
11
11
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
12
|
-
image: (modelID: string | ModelID) => import("
|
|
12
|
+
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/zai-images.js").ZAIImageOptions>;
|
|
13
13
|
configure: (input?: Config) => /*elided*/ any;
|
|
14
14
|
};
|
|
15
15
|
export declare const provider: {
|
|
16
16
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
17
|
-
image: (modelID: string | ModelID) => import("
|
|
17
|
+
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/zai-images.js").ZAIImageOptions>;
|
|
18
18
|
configure: (input?: Config) => {
|
|
19
19
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
20
|
-
image: (modelID: string | ModelID) => import("
|
|
20
|
+
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/zai-images.js").ZAIImageOptions>;
|
|
21
21
|
configure: /*elided*/ any;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
export declare const image: (modelID: string | ModelID) => import("
|
|
24
|
+
export declare const image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/zai-images.js").ZAIImageOptions>;
|
package/dist/providers/zai.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ZAIImages } from "../protocols/zai-images";
|
|
2
|
-
import { AuthOptions } from "../route/auth-options";
|
|
3
|
-
import { HttpOptions, ProviderID } from "../schema";
|
|
1
|
+
import { ZAIImages } from "../protocols/zai-images.js";
|
|
2
|
+
import { AuthOptions } from "../route/auth-options.js";
|
|
3
|
+
import { HttpOptions, ProviderID } from "../schema/index.js";
|
|
4
4
|
export const id = ProviderID.make("zai");
|
|
5
5
|
const auth = (options) => AuthOptions.bearer(options, "ZAI_API_KEY");
|
|
6
6
|
export const configure = (input = {}) => {
|
package/dist/providers.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./providers/index";
|
|
1
|
+
export * from "./providers/index.js";
|
package/dist/providers.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./providers/index";
|
|
1
|
+
export * from "./providers/index.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Config, Redacted } from "effect";
|
|
2
|
-
import { Auth } from "./auth";
|
|
2
|
+
import { Auth } from "./auth.js";
|
|
3
3
|
export type ApiKeyMode = "optional" | "required";
|
|
4
4
|
export type AuthOverride = {
|
|
5
5
|
readonly auth: Auth.Definition;
|
|
@@ -31,4 +31,4 @@ export type AtLeastOne<T> = {
|
|
|
31
31
|
* a bearer token.
|
|
32
32
|
*/
|
|
33
33
|
export declare const bearer: (options: ProviderAuthOption<"optional">, envVar: string | ReadonlyArray<string>) => Auth.Definition;
|
|
34
|
-
export * as AuthOptions from "./auth-options";
|
|
34
|
+
export * as AuthOptions from "./auth-options.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Auth } from "./auth";
|
|
1
|
+
import { Auth } from "./auth.js";
|
|
2
2
|
/**
|
|
3
3
|
* Standard bearer-auth resolution for providers: honor an explicit `auth`
|
|
4
4
|
* override, otherwise resolve `apiKey` (option > config var) and apply it as
|
|
@@ -11,4 +11,4 @@ export const bearer = (options, envVar) => {
|
|
|
11
11
|
.reduce((auth, name) => auth.orElse(Auth.config(name)), Auth.optional("apiKey" in options ? options.apiKey : undefined, "apiKey"))
|
|
12
12
|
.bearer();
|
|
13
13
|
};
|
|
14
|
-
export * as AuthOptions from "./auth-options";
|
|
14
|
+
export * as AuthOptions from "./auth-options.js";
|
package/dist/route/auth.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Config, Effect, Redacted } from "effect";
|
|
2
2
|
import { Headers } from "effect/unstable/http";
|
|
3
|
-
import { AIError, type HttpOptions } from "../schema";
|
|
3
|
+
import { AIError, type HttpOptions } from "../schema/index.js";
|
|
4
4
|
export declare class MissingCredentialError extends Error {
|
|
5
5
|
readonly source: string;
|
|
6
6
|
readonly _tag = "MissingCredentialError";
|
|
@@ -48,4 +48,4 @@ export declare function header(name: string, source: Secret | Credential): Defin
|
|
|
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
50
|
export declare const toEffect: (input: Definition) => (authInput: AuthInput) => Effect.Effect<Headers.Headers, AIError>;
|
|
51
|
-
export * as Auth from "./auth";
|
|
51
|
+
export * as Auth from "./auth.js";
|
package/dist/route/auth.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Config, Effect, Redacted } from "effect";
|
|
2
2
|
import { Headers } from "effect/unstable/http";
|
|
3
|
-
import { AuthenticationReason, InvalidRequestReason, AIError } from "../schema";
|
|
3
|
+
import { AuthenticationReason, InvalidRequestReason, AIError } from "../schema/index.js";
|
|
4
4
|
export class MissingCredentialError extends Error {
|
|
5
5
|
source;
|
|
6
6
|
_tag = "MissingCredentialError";
|
|
@@ -86,4 +86,4 @@ const toAIError = (error) => {
|
|
|
86
86
|
return error;
|
|
87
87
|
};
|
|
88
88
|
export const toEffect = (input) => (authInput) => input.apply(authInput).pipe(Effect.mapError(toAIError));
|
|
89
|
-
export * as Auth from "./auth";
|
|
89
|
+
export * as Auth from "./auth.js";
|
package/dist/route/client.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Context, Effect, Layer, Schema, Stream } from "effect";
|
|
2
|
-
import { Auth } from "./auth";
|
|
3
|
-
import { Endpoint, type EndpointPatch } from "./endpoint";
|
|
4
|
-
import { RequestExecutor } from "./executor";
|
|
5
|
-
import { Framing } from "./framing";
|
|
6
|
-
import { HttpTransport } from "./transport";
|
|
7
|
-
import type { HttpMiddleware, Transport, TransportRuntime } from "./transport";
|
|
8
|
-
import type { Protocol } from "./protocol";
|
|
9
|
-
import type { ProtocolID, ProviderOptions } from "../schema";
|
|
10
|
-
import { AIError, GenerationOptions, HttpOptions, LLMRequest, LLMResponse, LanguageModel, LanguageModelLimits, LLMEvent, ProviderID } from "../schema";
|
|
2
|
+
import { Auth } from "./auth.js";
|
|
3
|
+
import { Endpoint, type EndpointPatch } from "./endpoint.js";
|
|
4
|
+
import { RequestExecutor } from "./executor.js";
|
|
5
|
+
import { Framing } from "./framing.js";
|
|
6
|
+
import { HttpTransport } from "./transport/index.js";
|
|
7
|
+
import type { HttpMiddleware, Transport, TransportRuntime } from "./transport/index.js";
|
|
8
|
+
import type { Protocol } from "./protocol.js";
|
|
9
|
+
import type { ProtocolID, ProviderOptions } from "../schema/index.js";
|
|
10
|
+
import { AIError, GenerationOptions, HttpOptions, LLMRequest, LLMResponse, LanguageModel, LanguageModelLimits, LLMEvent, ProviderID } from "../schema/index.js";
|
|
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>;
|
|
@@ -311,7 +311,7 @@ export declare const streamRequest: (request: LLMRequest, options?: StreamOption
|
|
|
311
311
|
readonly [x: string]: unknown;
|
|
312
312
|
};
|
|
313
313
|
} | undefined;
|
|
314
|
-
readonly usage?: import("
|
|
314
|
+
readonly usage?: import("../schema/events.js").Usage | undefined;
|
|
315
315
|
} | {
|
|
316
316
|
readonly type: "finish";
|
|
317
317
|
readonly reason: {
|
|
@@ -323,7 +323,7 @@ export declare const streamRequest: (request: LLMRequest, options?: StreamOption
|
|
|
323
323
|
readonly [x: string]: unknown;
|
|
324
324
|
};
|
|
325
325
|
} | undefined;
|
|
326
|
-
readonly usage?: import("
|
|
326
|
+
readonly usage?: import("../schema/events.js").Usage | undefined;
|
|
327
327
|
} | {
|
|
328
328
|
readonly type: "provider-error";
|
|
329
329
|
readonly message: string;
|
package/dist/route/client.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Cause, Context, Effect, Layer, Schema, Stream } from "effect";
|
|
2
2
|
import * as Option from "effect/Option";
|
|
3
|
-
import { Auth } from "./auth";
|
|
4
|
-
import { Endpoint } from "./endpoint";
|
|
5
|
-
import { RequestExecutor } from "./executor";
|
|
6
|
-
import { Framing } from "./framing";
|
|
7
|
-
import { HttpTransport } from "./transport";
|
|
8
|
-
import { WebSocketExecutor } from "./transport";
|
|
9
|
-
import { applyCachePolicy } from "../cache-policy";
|
|
10
|
-
import * as ProviderShared from "../protocols/shared";
|
|
11
|
-
import { AIError, GenerationOptions, HttpOptions, LLMRequest, LLMResponse, LanguageModel, LanguageModelLimits, LLMEvent, InvalidProviderOutputReason, ProviderID, mergeGenerationOptions, mergeHttpOptions, mergeProviderOptions, } from "../schema";
|
|
3
|
+
import { Auth } from "./auth.js";
|
|
4
|
+
import { Endpoint } from "./endpoint.js";
|
|
5
|
+
import { RequestExecutor } from "./executor.js";
|
|
6
|
+
import { Framing } from "./framing.js";
|
|
7
|
+
import { HttpTransport } from "./transport/index.js";
|
|
8
|
+
import { WebSocketExecutor } from "./transport/index.js";
|
|
9
|
+
import { applyCachePolicy } from "../cache-policy.js";
|
|
10
|
+
import * as ProviderShared from "../protocols/shared.js";
|
|
11
|
+
import { AIError, GenerationOptions, HttpOptions, LLMRequest, LLMResponse, LanguageModel, LanguageModelLimits, LLMEvent, InvalidProviderOutputReason, ProviderID, mergeGenerationOptions, mergeHttpOptions, mergeProviderOptions, } from "../schema/index.js";
|
|
12
12
|
const makeRouteLanguageModel = (route, mapped) => {
|
|
13
13
|
const provider = route.provider ?? ("provider" in mapped ? mapped.provider : undefined);
|
|
14
14
|
if (!provider)
|
package/dist/route/endpoint.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LLMRequest } from "../schema";
|
|
1
|
+
import type { LLMRequest } from "../schema/index.js";
|
|
2
2
|
export interface EndpointInput<Body> {
|
|
3
3
|
readonly request: LLMRequest;
|
|
4
4
|
readonly body: Body;
|
|
@@ -25,4 +25,4 @@ export type EndpointPatch<Body> = Partial<Definition<Body>>;
|
|
|
25
25
|
export declare const path: <Body>(value: EndpointPart<Body>, options?: Omit<Definition<Body>, "path">) => Definition<Body>;
|
|
26
26
|
export declare const merge: <Body>(base: Definition<Body>, patch: EndpointPatch<Body>) => Definition<Body>;
|
|
27
27
|
export declare const render: <Body>(endpoint: Definition<Body>, input: EndpointInput<Body>) => URL;
|
|
28
|
-
export * as Endpoint from "./endpoint";
|
|
28
|
+
export * as Endpoint from "./endpoint.js";
|
package/dist/route/endpoint.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as ProviderShared from "../protocols/shared";
|
|
1
|
+
import * as ProviderShared from "../protocols/shared.js";
|
|
2
2
|
/** Construct an `Endpoint` from a path string or path function. */
|
|
3
3
|
export const path = (value, options = {}) => ({
|
|
4
4
|
...options,
|
|
@@ -18,4 +18,4 @@ export const render = (endpoint, input) => {
|
|
|
18
18
|
url.searchParams.set(key, value);
|
|
19
19
|
return url;
|
|
20
20
|
};
|
|
21
|
-
export * as Endpoint from "./endpoint";
|
|
21
|
+
export * as Endpoint from "./endpoint.js";
|
package/dist/route/executor.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context, Effect, Layer } from "effect";
|
|
2
2
|
import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/unstable/http";
|
|
3
|
-
import { AIError, TransportReason } from "../schema";
|
|
3
|
+
import { AIError, TransportReason } from "../schema/index.js";
|
|
4
4
|
export interface Interface {
|
|
5
5
|
readonly execute: (request: HttpClientRequest.HttpClientRequest, middleware?: HttpMiddleware) => Effect.Effect<HttpClientResponse.HttpClientResponse, AIError>;
|
|
6
6
|
}
|
|
@@ -16,7 +16,7 @@ export declare const classifyHttpFailure: (input: {
|
|
|
16
16
|
readonly code?: string | undefined;
|
|
17
17
|
readonly responseHeaders?: Record<string, string> | undefined;
|
|
18
18
|
readonly responseBody?: string | undefined;
|
|
19
|
-
}) => import("
|
|
19
|
+
}) => import("../schema/errors.js").InvalidRequestReason | import("../schema/errors.js").NoRouteReason | import("../schema/errors.js").AuthenticationReason | import("../schema/errors.js").RateLimitReason | import("../schema/errors.js").QuotaExceededReason | import("../schema/errors.js").ContentPolicyReason | import("../schema/errors.js").ProviderInternalReason | TransportReason | import("../schema/errors.js").InvalidProviderOutputReason | import("../schema/errors.js").UnknownProviderReason;
|
|
20
20
|
export declare const layer: Layer.Layer<Service, never, HttpClient.HttpClient>;
|
|
21
21
|
export declare const fetchLayer: Layer.Layer<Service, never, never>;
|
|
22
|
-
export * as RequestExecutor from "./executor";
|
|
22
|
+
export * as RequestExecutor from "./executor.js";
|
package/dist/route/executor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Cause, Context, Effect, Layer, Option, Schema } from "effect";
|
|
2
2
|
import { FetchHttpClient, Headers, HttpClient, HttpClientError, HttpClientRequest, HttpClientResponse, } from "effect/unstable/http";
|
|
3
|
-
import { HttpContext, HttpRateLimitDetails, HttpRequestDetails, HttpResponseDetails, AIError, TransportReason, } from "../schema";
|
|
4
|
-
import { classifyProviderFailure } from "../provider-error";
|
|
3
|
+
import { HttpContext, HttpRateLimitDetails, HttpRequestDetails, HttpResponseDetails, AIError, TransportReason, } from "../schema/index.js";
|
|
4
|
+
import { classifyProviderFailure } from "../provider-error.js";
|
|
5
5
|
export class Service extends Context.Service()("@opencode/AI/RequestExecutor") {
|
|
6
6
|
}
|
|
7
7
|
const BODY_LIMIT = 16_384;
|
|
@@ -264,4 +264,4 @@ export const layer = Layer.effect(Service, Effect.gen(function* () {
|
|
|
264
264
|
});
|
|
265
265
|
}));
|
|
266
266
|
export const fetchLayer = layer.pipe(Layer.provide(FetchHttpClient.layer));
|
|
267
|
-
export * as RequestExecutor from "./executor";
|
|
267
|
+
export * as RequestExecutor from "./executor.js";
|
package/dist/route/framing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Stream } from "effect";
|
|
2
|
-
import type { AIError } from "../schema";
|
|
2
|
+
import type { AIError } from "../schema/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Decode a streaming HTTP response body into provider-protocol frames.
|
|
5
5
|
*
|
|
@@ -20,4 +20,4 @@ export interface Definition<Frame> {
|
|
|
20
20
|
}
|
|
21
21
|
/** Server-Sent Events framing. Used by every JSON-streaming HTTP provider. */
|
|
22
22
|
export declare const sse: Definition<string>;
|
|
23
|
-
export * as Framing from "./framing";
|
|
23
|
+
export * as Framing from "./framing.js";
|
package/dist/route/framing.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as ProviderShared from "../protocols/shared";
|
|
1
|
+
import * as ProviderShared from "../protocols/shared.js";
|
|
2
2
|
/** Server-Sent Events framing. Used by every JSON-streaming HTTP provider. */
|
|
3
3
|
export const sse = { id: "sse", frame: ProviderShared.sseFraming };
|
|
4
|
-
export * as Framing from "./framing";
|
|
4
|
+
export * as Framing from "./framing.js";
|
package/dist/route/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export { Route, LLMClient } from "./client";
|
|
2
|
-
export type { Route as RouteShape, RouteLanguageModelInput, RouteRoutedLanguageModelInput, RouteDefaults, RouteDefaultsInput, AnyRoute, Interface as LLMClientShape, Service as LLMClientService, StreamOptions, } from "./client";
|
|
3
|
-
export * from "./executor";
|
|
4
|
-
export { Auth } from "./auth";
|
|
5
|
-
export { AuthOptions } from "./auth-options";
|
|
6
|
-
export { Endpoint } from "./endpoint";
|
|
7
|
-
export { Framing } from "./framing";
|
|
8
|
-
export { Protocol } from "./protocol";
|
|
9
|
-
export { HttpTransport, WebSocketExecutor, WebSocketTransport } from "./transport";
|
|
10
|
-
export * as Transport from "./transport";
|
|
11
|
-
export type { Definition as AuthShape, AuthInput, Credential, CredentialError } from "./auth";
|
|
12
|
-
export type { ApiKeyMode, AuthOverride, ProviderAuthOption } from "./auth-options";
|
|
13
|
-
export type { Definition as EndpointFn, EndpointInput } from "./endpoint";
|
|
14
|
-
export type { Definition as FramingDef } from "./framing";
|
|
15
|
-
export type { Protocol as ProtocolDef } from "./protocol";
|
|
16
|
-
export type { HttpHandler, HttpMiddleware, Transport as TransportDef, TransportRuntime } from "./transport";
|
|
1
|
+
export { Route, LLMClient } from "./client.js";
|
|
2
|
+
export type { Route as RouteShape, RouteLanguageModelInput, RouteRoutedLanguageModelInput, RouteDefaults, RouteDefaultsInput, AnyRoute, Interface as LLMClientShape, Service as LLMClientService, StreamOptions, } from "./client.js";
|
|
3
|
+
export * from "./executor.js";
|
|
4
|
+
export { Auth } from "./auth.js";
|
|
5
|
+
export { AuthOptions } from "./auth-options.js";
|
|
6
|
+
export { Endpoint } from "./endpoint.js";
|
|
7
|
+
export { Framing } from "./framing.js";
|
|
8
|
+
export { Protocol } from "./protocol.js";
|
|
9
|
+
export { HttpTransport, WebSocketExecutor, WebSocketTransport } from "./transport/index.js";
|
|
10
|
+
export * as Transport from "./transport/index.js";
|
|
11
|
+
export type { Definition as AuthShape, AuthInput, Credential, CredentialError } from "./auth.js";
|
|
12
|
+
export type { ApiKeyMode, AuthOverride, ProviderAuthOption } from "./auth-options.js";
|
|
13
|
+
export type { Definition as EndpointFn, EndpointInput } from "./endpoint.js";
|
|
14
|
+
export type { Definition as FramingDef } from "./framing.js";
|
|
15
|
+
export type { Protocol as ProtocolDef } from "./protocol.js";
|
|
16
|
+
export type { HttpHandler, HttpMiddleware, Transport as TransportDef, TransportRuntime } from "./transport/index.js";
|