import type { ProviderFactory } from '@wrongstack/core/registry'; import type { Logger, ModelsRegistry, Provider, ProviderConfig } from '@wrongstack/core/types'; import { type CompatibilityQuirks } from './openai-compatible.js'; export { AnthropicProvider, type AnthropicProviderOptions } from './anthropic.js'; export { OpenAIProvider, type OpenAIProviderOptions } from './openai.js'; export { AiGatewayProvider, createAiGatewayProviderFactory, convertAiSdkStreamPart, convertMessages as convertMessagesToAiSdk, convertTools as convertToolsToAiSdk, convertUsage as convertAiSdkUsage, toProviderError as convertAiSdkProviderError, type AiGatewayFactoryOptions, type AiGatewayProviderOptions, } from './ai-gateway.js'; export { MiniMaxProvider, type MiniMaxProviderOptions } from './minimax.js'; export { OpenCodeGoProvider, type OpenCodeGoProviderOptions } from './opencode-go.js'; export { OpenAICompatibleProvider, type OpenAICompatibleOptions, type CompatibilityQuirks, } from './openai-compatible.js'; export { TRUSTED_PROVIDER_PRESETS, buildProviderConfigFromPreset, getTrustedProviderPreset, isTrustedProviderId, listTrustedProviderPresetIds, rehydrateCanonicalProviderConfig, resolvePresetForAlias, type TrustedProviderPreset, } from './trusted-presets.js'; export { GoogleProvider, type GoogleProviderOptions } from './google.js'; export { codexOutputCap, OpenAICodexProvider, type OpenAICodexProviderOptions, type CodexCredentials, type CodexOAuthTokens, refreshCodexAccessToken, extractAccountId, resolveCodexUrl, resolveCodexModelsUrl, } from './openai-codex.js'; export { AnthropicOAuthProvider, type AnthropicOAuthProviderOptions, type AnthropicOAuthCredentials, type AnthropicOAuthTokens, refreshAnthropicOAuthToken, CLAUDE_CODE_SYSTEM_PROMPT, } from './anthropic-oauth.js'; export { GitHubCopilotProvider, type GitHubCopilotProviderOptions, type CopilotCredentials, type CopilotTokenResult, refreshCopilotToken, copilotBaseUrlFromToken, } from './github-copilot.js'; export { WireAdapter, type WireAdapterStreamOptions } from './wire-adapter.js'; export { isDebugStreamEnabled, setDebugStreamEnabled, setDebugStreamCallback, pushDebugChunkStats, defaultDebugStreamCallback, type DebugStreamStats, type DebugStreamCallback, } from './stream-debug-state.js'; export { WireFormatProvider, defineWireFormat, createWireFormatFactory, type WireFormatConfig, type WireFactoryOptions, } from './wire-format.js'; export { mistralWireFormat } from './presets/mistral.js'; export { anthropicWireFormat } from './presets/anthropic.js'; export { ANTHROPIC_MAX_BREAKPOINTS, capAnthropicCacheBreakpoints } from './cache-breakpoint-cap.js'; export { openaiWireFormat } from './presets/openai.js'; export { googleWireFormat } from './presets/google.js'; export { ollamaWireFormat, vllmWireFormat, lmstudioWireFormat } from './presets/local-llm.js'; export { capabilitiesFor, catalogProviderIdFor, CATALOG_ALIAS_BY_PROVIDER_TYPE, } from './capabilities.js'; export { type BuildBodyContext, clearModelOutputLimitResolver, installCatalogModelOutputLimits, type InstallCatalogOutputLimitsOptions, type ModelOutputLimitResolver, REQUIRED_FIELD_LAST_RESORT_MAX_OUTPUT, resolveCatalogMaxOutput, resolveMaxOutputTokens, resolveRequiredMaxOutputTokens, setModelOutputLimitResolver, } from './model-output-limits.js'; export { capabilitiesForFamily, CAPABILITIES_BY_FAMILY } from './family-capabilities.js'; export { LOCAL_PROVIDER_DEFINITIONS, PROVIDER_DEFINITIONS, projectCompatibleProviderPresets, projectLocalProviderPresets, projectPopularProviderCatalog, resolveProviderDefinition, type CompatibleProviderProjection, type LocalProviderPresetProjection, type PopularProviderProjection, type ProviderCatalogMetadata, type ProviderDefinition, type OpenAICompatiblePolicyId, type ProviderReferral, type ProviderUsage, } from './provider-definitions.js'; export { parseProviderHttpError } from './error-parse.js'; export { normalizeAnthropic, normalizeOpenAI } from './stop-reason.js'; export { toolsToAnthropic } from './tool-format/to-anthropic.js'; export { contentFromAnthropic } from './tool-format/from-anthropic.js'; export { toolsToOpenAI, messagesToOpenAI, type OpenAIMessage, type OpenAIToolCall, type ConvertOptions, } from './tool-format/to-openai.js'; export { contentFromOpenAI, type OpenAIChoice } from './tool-format/from-openai.js'; export { discoverOpenAICompatibleModels, mapCompatibleModel, resolveDiscoveryTargets, type DiscoverOptions, type DiscoveryTarget, } from './auto-discover.js'; /** * Built-in tuning for known openai-compatible providers that aren't in the * models.dev catalog. Lets a named provider (e.g. omniroute) come with the * right base URL, wire quirks, and model auto-discovery without the user * having to hand-configure any of it. */ export interface CompatiblePreset { /** Default base URL when the config omits one. */ defaultBaseUrl?: string | undefined; /** Wire quirks merged UNDER any user-supplied quirks. */ quirks?: CompatibilityQuirks | undefined; /** Fetch `{baseUrl}/models` at boot and inject the result into the catalog. */ autoDiscover?: boolean | undefined; } export declare const COMPATIBLE_PRESETS: Record; export interface BuildFactoriesOptions { registry: ModelsRegistry; /** Used to log unsupported families during boot. */ log?: Logger | undefined; } /** Rotated-token payload handed to the OAuth persister after a refresh. */ export interface OAuthRefreshedTokens { accessToken: string; /** Refresh token — not present for all OAuth families (e.g. GitHub Copilot). Callers who need it already hold it. */ refreshToken?: string | undefined; expiresAt: number; /** ChatGPT account id (codex only); undefined for other OAuth families. */ accountId?: string | undefined; } export declare function setOAuthTokenPersister(fn: ((providerId: string, creds: OAuthRefreshedTokens) => void) | undefined): void; /** * Known openai-compatible provider ids with tuned wire-format presets. * * Presets are exported directly for manual use: * ``` * import { mistralWireFormat } from '@wrongstack/providers'; * const factory = createWireFormatFactory(mistralWireFormat); * ``` */ /** * Build one ProviderFactory per provider known to models.dev. The factory's * `create(cfg)` resolves the wire-family at construction time and returns the * matching transport. Unsupported families return a stub that throws when * complete() is called, so the system can still boot. */ /** * Wrap a provider so the catalog-resolved `Capabilities` overlay is * applied after construction. The factory itself was created with the * family default; `capabilitiesFor(registry, ...)` layers per-model * facts on top — `ModelsDevModel.limit.output` for `maxOutput`, which * drives Chimera's `Request.maxTokens`. * * Failures inside the resolution step are swallowed: the family default * stands, and the per-request `resolveMaxOutputTokens` lookup still reaches * the catalog for `req.model`. The diagnostic lives at DEBUG so a healthy * boot stays quiet. */ export declare function withCatalogCapabilities(registry: ModelsRegistry, providerId: string, provider: Provider, cfg: ProviderConfig, log?: Logger): Promise; export declare function buildProviderFactoriesFromRegistry(opts: BuildFactoriesOptions): Promise; /** * Build a Provider purely from config — no models.dev lookup at all. * Used for user-defined providers and offline operation. */ export declare function makeProviderFromConfig(id: string, cfg: ProviderConfig): Provider; //# sourceMappingURL=index.d.ts.map