import { type FinalTurnPreservation, type ProfileReplayScope, type ProfileTriState, type ProviderProfile, type ProviderProfileLayer, type ReasoningDisableForm, type ReasoningControlDialect, type ReasoningGeneration, type ReasoningOutputShape } from "./provider-profile.js"; import type { ReasoningStyle } from "./http.js"; import type { CachePolicyKind, LimitSource } from "./provider-profile.js"; export type CustomAuthType = "bearer" | "custom-headers" | "none-keyless"; /** Serializable wire subset a custom route may declare. */ export interface CustomProviderProfileSpec { readonly authType?: CustomAuthType | undefined; readonly keyEnv?: string | undefined; readonly baseUrlEnv?: string | undefined; /** Values may be literals or `${ENV_NAME}` references. */ readonly headers?: Readonly> | undefined; readonly tools?: ProfileTriState | undefined; readonly images?: ProfileTriState | undefined; readonly structuredOutput?: ProfileTriState | undefined; readonly streamOptions?: ProfileTriState | undefined; readonly reasoning?: { readonly generation?: ReasoningGeneration | undefined; readonly controlDialect?: ReasoningControlDialect | undefined; readonly acceptedEfforts?: readonly string[] | undefined; readonly disable?: ProfileTriState | undefined; readonly disableForm?: ReasoningDisableForm | undefined; readonly outputShapes?: readonly ReasoningOutputShape[] | undefined; readonly replayScope?: ProfileReplayScope | undefined; readonly finalTurnPreservation?: FinalTurnPreservation | undefined; } | undefined; readonly limits?: { readonly contextTokens?: number | undefined; readonly outputTokens?: number | undefined; readonly source?: LimitSource | undefined; } | undefined; readonly cache?: { readonly kind?: CachePolicyKind | undefined; readonly affinityField?: string | undefined; readonly isolationField?: string | undefined; readonly cacheAffectingFields?: readonly string[] | undefined; } | undefined; readonly usage?: { readonly cachedInput?: readonly string[] | undefined; readonly uncachedInput?: readonly string[] | undefined; readonly cacheWrite?: readonly string[] | undefined; readonly reasoningOutput?: readonly string[] | undefined; } | undefined; readonly terminal?: { readonly naturalEofAccepted?: boolean | undefined; } | undefined; } /** * Local, actionable validation. Nothing here performs a network call; the goal * is that an invalid declaration fails before any request is dispatched. */ export declare function validateCustomProviderProfile(raw: unknown): { spec?: CustomProviderProfileSpec; errors: string[]; }; /** Maps a validated spec onto the user-config evidence layer. */ export declare function customProfileLayer(spec: CustomProviderProfileSpec | undefined): ProviderProfileLayer | undefined; export declare function endpointPrivacyHash(baseUrl: string): string; /** * Conservative unknown unless declared; a custom endpoint that verifiably is * the direct DeepSeek API earns the documented V4 builtin layer as route * evidence below user declarations. */ export declare function resolveCustomProviderProfile(input: { id: string; model: string; baseUrl: string; profile?: CustomProviderProfileSpec | undefined; }): ProviderProfile; export declare function customProviderProfileFor(input: { provider: string; model: string; baseUrl: string; }): ProviderProfile | undefined; /** * Serializer style for the compatible path. Undeclared routes omit optional * reasoning controls entirely (send narrowly, parse broadly). */ export declare function customReasoningStyle(profile: CustomProviderProfileSpec | undefined): ReasoningStyle; /** Resolves `${ENV_NAME}` header references before dispatch; throws locally. */ export declare function resolveCustomHeaders(headers: Readonly> | undefined): Record | undefined;