/** * Models.json configuration types and schema * * Supports custom providers and models (Ollama, vLLM, LM Studio, proxies) * * File location: ~/.xopc/models.json (or XOPC_MODELS_JSON env var) */ import { z } from 'zod'; export { resolveModelsJsonPath as getModelsJsonPath } from './paths.js'; export declare const OpenRouterRoutingSchema: z.ZodObject<{ only: z.ZodOptional>; order: z.ZodOptional>; }, z.core.$strip>; export declare const VercelGatewayRoutingSchema: z.ZodObject<{ only: z.ZodOptional>; order: z.ZodOptional>; }, z.core.$strip>; export declare const OpenAICompletionsCompatSchema: z.ZodObject<{ supportsStore: z.ZodOptional; supportsDeveloperRole: z.ZodOptional; supportsReasoningEffort: z.ZodOptional; supportsUsageInStreaming: z.ZodOptional; maxTokensField: z.ZodOptional>; requiresToolResultName: z.ZodOptional; requiresAssistantAfterToolResult: z.ZodOptional; requiresThinkingAsText: z.ZodOptional; requiresMistralToolIds: z.ZodOptional; thinkingFormat: z.ZodOptional>; openRouterRouting: z.ZodOptional>; order: z.ZodOptional>; }, z.core.$strip>>; vercelGatewayRouting: z.ZodOptional>; order: z.ZodOptional>; }, z.core.$strip>>; supportsStrictMode: z.ZodOptional; }, z.core.$strip>; export declare const OpenAIResponsesCompatSchema: z.ZodObject<{}, z.core.$strip>; export declare const OpenAICompatSchema: z.ZodUnion; supportsDeveloperRole: z.ZodOptional; supportsReasoningEffort: z.ZodOptional; supportsUsageInStreaming: z.ZodOptional; maxTokensField: z.ZodOptional>; requiresToolResultName: z.ZodOptional; requiresAssistantAfterToolResult: z.ZodOptional; requiresThinkingAsText: z.ZodOptional; requiresMistralToolIds: z.ZodOptional; thinkingFormat: z.ZodOptional>; openRouterRouting: z.ZodOptional>; order: z.ZodOptional>; }, z.core.$strip>>; vercelGatewayRouting: z.ZodOptional>; order: z.ZodOptional>; }, z.core.$strip>>; supportsStrictMode: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>]>; export declare const ImageGenerationCapabilitiesSchema: z.ZodObject<{ generate: z.ZodOptional; supportsSize: z.ZodOptional; supportsAspectRatio: z.ZodOptional; supportsResolution: z.ZodOptional; }, z.core.$strict>>; edit: z.ZodOptional; supportsSize: z.ZodOptional; supportsAspectRatio: z.ZodOptional; }, z.core.$strict>>; geometry: z.ZodOptional>; aspectRatios: z.ZodOptional>; resolutions: z.ZodOptional>>; }, z.core.$strict>>; output: z.ZodOptional>>; formats: z.ZodOptional>>; backgrounds: z.ZodOptional>>; }, z.core.$strict>>; }, z.core.$strict>; export declare const ImageGenerationModelSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodOptional; capabilities: z.ZodObject<{ generate: z.ZodOptional; supportsSize: z.ZodOptional; supportsAspectRatio: z.ZodOptional; supportsResolution: z.ZodOptional; }, z.core.$strict>>; edit: z.ZodOptional; supportsSize: z.ZodOptional; supportsAspectRatio: z.ZodOptional; }, z.core.$strict>>; geometry: z.ZodOptional>; aspectRatios: z.ZodOptional>; resolutions: z.ZodOptional>>; }, z.core.$strict>>; output: z.ZodOptional>>; formats: z.ZodOptional>>; backgrounds: z.ZodOptional>>; }, z.core.$strict>>; }, z.core.$strict>; defaults: z.ZodOptional; size: z.ZodOptional; outputFormat: z.ZodOptional>; }, z.core.$strict>>; }, z.core.$strict>; export declare const ImageGenerationProviderSchema: z.ZodObject<{ api: z.ZodLiteral<"openai-images">; name: z.ZodString; documentationUrl: z.ZodOptional; apiKeyUrl: z.ZodOptional; defaultModel: z.ZodString; auth: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"bearer">; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"header">; headerName: z.ZodString; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"none">; }, z.core.$strict>], "type">; paths: z.ZodOptional; edits: z.ZodOptional; }, z.core.$strict>>; network: z.ZodOptional; }, z.core.$strict>>; models: z.ZodArray; capabilities: z.ZodObject<{ generate: z.ZodOptional; supportsSize: z.ZodOptional; supportsAspectRatio: z.ZodOptional; supportsResolution: z.ZodOptional; }, z.core.$strict>>; edit: z.ZodOptional; supportsSize: z.ZodOptional; supportsAspectRatio: z.ZodOptional; }, z.core.$strict>>; geometry: z.ZodOptional>; aspectRatios: z.ZodOptional>; resolutions: z.ZodOptional>>; }, z.core.$strict>>; output: z.ZodOptional>>; formats: z.ZodOptional>>; backgrounds: z.ZodOptional>>; }, z.core.$strict>>; }, z.core.$strict>; defaults: z.ZodOptional; size: z.ZodOptional; outputFormat: z.ZodOptional>; }, z.core.$strict>>; }, z.core.$strict>>; }, z.core.$strict>; export declare const CustomModelSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodOptional; api: z.ZodOptional>; reasoning: z.ZodOptional; input: z.ZodOptional>>; contextWindow: z.ZodOptional; maxTokens: z.ZodOptional; cost: z.ZodOptional>; headers: z.ZodOptional>; compat: z.ZodOptional; supportsDeveloperRole: z.ZodOptional; supportsReasoningEffort: z.ZodOptional; supportsUsageInStreaming: z.ZodOptional; maxTokensField: z.ZodOptional>; requiresToolResultName: z.ZodOptional; requiresAssistantAfterToolResult: z.ZodOptional; requiresThinkingAsText: z.ZodOptional; requiresMistralToolIds: z.ZodOptional; thinkingFormat: z.ZodOptional>; openRouterRouting: z.ZodOptional>; order: z.ZodOptional>; }, z.core.$strip>>; vercelGatewayRouting: z.ZodOptional>; order: z.ZodOptional>; }, z.core.$strip>>; supportsStrictMode: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>]>>; }, z.core.$strip>; export declare const ModelOverrideSchema: z.ZodObject<{ name: z.ZodOptional; reasoning: z.ZodOptional; input: z.ZodOptional>>; contextWindow: z.ZodOptional; maxTokens: z.ZodOptional; cost: z.ZodOptional; output: z.ZodOptional; cacheRead: z.ZodOptional; cacheWrite: z.ZodOptional; }, z.core.$strip>>; headers: z.ZodOptional>; compat: z.ZodOptional; supportsDeveloperRole: z.ZodOptional; supportsReasoningEffort: z.ZodOptional; supportsUsageInStreaming: z.ZodOptional; maxTokensField: z.ZodOptional>; requiresToolResultName: z.ZodOptional; requiresAssistantAfterToolResult: z.ZodOptional; requiresThinkingAsText: z.ZodOptional; requiresMistralToolIds: z.ZodOptional; thinkingFormat: z.ZodOptional>; openRouterRouting: z.ZodOptional>; order: z.ZodOptional>; }, z.core.$strip>>; vercelGatewayRouting: z.ZodOptional>; order: z.ZodOptional>; }, z.core.$strip>>; supportsStrictMode: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>]>>; }, z.core.$strip>; export declare const ProviderConfigSchema: z.ZodObject<{ baseUrl: z.ZodOptional; apiKey: z.ZodOptional; api: z.ZodOptional>; headers: z.ZodOptional>; authHeader: z.ZodOptional; models: z.ZodOptional; api: z.ZodOptional>; reasoning: z.ZodOptional; input: z.ZodOptional>>; contextWindow: z.ZodOptional; maxTokens: z.ZodOptional; cost: z.ZodOptional>; headers: z.ZodOptional>; compat: z.ZodOptional; supportsDeveloperRole: z.ZodOptional; supportsReasoningEffort: z.ZodOptional; supportsUsageInStreaming: z.ZodOptional; maxTokensField: z.ZodOptional>; requiresToolResultName: z.ZodOptional; requiresAssistantAfterToolResult: z.ZodOptional; requiresThinkingAsText: z.ZodOptional; requiresMistralToolIds: z.ZodOptional; thinkingFormat: z.ZodOptional>; openRouterRouting: z.ZodOptional>; order: z.ZodOptional>; }, z.core.$strip>>; vercelGatewayRouting: z.ZodOptional>; order: z.ZodOptional>; }, z.core.$strip>>; supportsStrictMode: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>]>>; }, z.core.$strip>>>; modelOverrides: z.ZodOptional; reasoning: z.ZodOptional; input: z.ZodOptional>>; contextWindow: z.ZodOptional; maxTokens: z.ZodOptional; cost: z.ZodOptional; output: z.ZodOptional; cacheRead: z.ZodOptional; cacheWrite: z.ZodOptional; }, z.core.$strip>>; headers: z.ZodOptional>; compat: z.ZodOptional; supportsDeveloperRole: z.ZodOptional; supportsReasoningEffort: z.ZodOptional; supportsUsageInStreaming: z.ZodOptional; maxTokensField: z.ZodOptional>; requiresToolResultName: z.ZodOptional; requiresAssistantAfterToolResult: z.ZodOptional; requiresThinkingAsText: z.ZodOptional; requiresMistralToolIds: z.ZodOptional; thinkingFormat: z.ZodOptional>; openRouterRouting: z.ZodOptional>; order: z.ZodOptional>; }, z.core.$strip>>; vercelGatewayRouting: z.ZodOptional>; order: z.ZodOptional>; }, z.core.$strip>>; supportsStrictMode: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>]>>; }, z.core.$strip>>>; modelDiscovery: z.ZodOptional>; imageGeneration: z.ZodOptional; name: z.ZodString; documentationUrl: z.ZodOptional; apiKeyUrl: z.ZodOptional; defaultModel: z.ZodString; auth: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"bearer">; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"header">; headerName: z.ZodString; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"none">; }, z.core.$strict>], "type">; paths: z.ZodOptional; edits: z.ZodOptional; }, z.core.$strict>>; network: z.ZodOptional; }, z.core.$strict>>; models: z.ZodArray; capabilities: z.ZodObject<{ generate: z.ZodOptional; supportsSize: z.ZodOptional; supportsAspectRatio: z.ZodOptional; supportsResolution: z.ZodOptional; }, z.core.$strict>>; edit: z.ZodOptional; supportsSize: z.ZodOptional; supportsAspectRatio: z.ZodOptional; }, z.core.$strict>>; geometry: z.ZodOptional>; aspectRatios: z.ZodOptional>; resolutions: z.ZodOptional>>; }, z.core.$strict>>; output: z.ZodOptional>>; formats: z.ZodOptional>>; backgrounds: z.ZodOptional>>; }, z.core.$strict>>; }, z.core.$strict>; defaults: z.ZodOptional; size: z.ZodOptional; outputFormat: z.ZodOptional>; }, z.core.$strict>>; }, z.core.$strict>>; }, z.core.$strict>>; }, z.core.$strip>; export declare const ModelsJsonSchema: z.ZodObject<{ providers: z.ZodRecord; apiKey: z.ZodOptional; api: z.ZodOptional>; headers: z.ZodOptional>; authHeader: z.ZodOptional; models: z.ZodOptional; api: z.ZodOptional>; reasoning: z.ZodOptional; input: z.ZodOptional>>; contextWindow: z.ZodOptional; maxTokens: z.ZodOptional; cost: z.ZodOptional>; headers: z.ZodOptional>; compat: z.ZodOptional; supportsDeveloperRole: z.ZodOptional; supportsReasoningEffort: z.ZodOptional; supportsUsageInStreaming: z.ZodOptional; maxTokensField: z.ZodOptional>; requiresToolResultName: z.ZodOptional; requiresAssistantAfterToolResult: z.ZodOptional; requiresThinkingAsText: z.ZodOptional; requiresMistralToolIds: z.ZodOptional; thinkingFormat: z.ZodOptional>; openRouterRouting: z.ZodOptional>; order: z.ZodOptional>; }, z.core.$strip>>; vercelGatewayRouting: z.ZodOptional>; order: z.ZodOptional>; }, z.core.$strip>>; supportsStrictMode: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>]>>; }, z.core.$strip>>>; modelOverrides: z.ZodOptional; reasoning: z.ZodOptional; input: z.ZodOptional>>; contextWindow: z.ZodOptional; maxTokens: z.ZodOptional; cost: z.ZodOptional; output: z.ZodOptional; cacheRead: z.ZodOptional; cacheWrite: z.ZodOptional; }, z.core.$strip>>; headers: z.ZodOptional>; compat: z.ZodOptional; supportsDeveloperRole: z.ZodOptional; supportsReasoningEffort: z.ZodOptional; supportsUsageInStreaming: z.ZodOptional; maxTokensField: z.ZodOptional>; requiresToolResultName: z.ZodOptional; requiresAssistantAfterToolResult: z.ZodOptional; requiresThinkingAsText: z.ZodOptional; requiresMistralToolIds: z.ZodOptional; thinkingFormat: z.ZodOptional>; openRouterRouting: z.ZodOptional>; order: z.ZodOptional>; }, z.core.$strip>>; vercelGatewayRouting: z.ZodOptional>; order: z.ZodOptional>; }, z.core.$strip>>; supportsStrictMode: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>]>>; }, z.core.$strip>>>; modelDiscovery: z.ZodOptional>; imageGeneration: z.ZodOptional; name: z.ZodString; documentationUrl: z.ZodOptional; apiKeyUrl: z.ZodOptional; defaultModel: z.ZodString; auth: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"bearer">; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"header">; headerName: z.ZodString; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"none">; }, z.core.$strict>], "type">; paths: z.ZodOptional; edits: z.ZodOptional; }, z.core.$strict>>; network: z.ZodOptional; }, z.core.$strict>>; models: z.ZodArray; capabilities: z.ZodObject<{ generate: z.ZodOptional; supportsSize: z.ZodOptional; supportsAspectRatio: z.ZodOptional; supportsResolution: z.ZodOptional; }, z.core.$strict>>; edit: z.ZodOptional; supportsSize: z.ZodOptional; supportsAspectRatio: z.ZodOptional; }, z.core.$strict>>; geometry: z.ZodOptional>; aspectRatios: z.ZodOptional>; resolutions: z.ZodOptional>>; }, z.core.$strict>>; output: z.ZodOptional>>; formats: z.ZodOptional>>; backgrounds: z.ZodOptional>>; }, z.core.$strict>>; }, z.core.$strict>; defaults: z.ZodOptional; size: z.ZodOptional; outputFormat: z.ZodOptional>; }, z.core.$strict>>; }, z.core.$strict>>; }, z.core.$strict>>; }, z.core.$strip>>; }, z.core.$strip>; export type OpenRouterRouting = z.infer; export type VercelGatewayRouting = z.infer; export type OpenAICompletionsCompat = z.infer; export type OpenAIResponsesCompat = z.infer; export type OpenAICompat = z.infer; export type ImageGenerationModelConfig = z.infer; export type ImageGenerationProviderConfig = z.infer; export type CustomModel = z.infer; export type ModelOverride = z.infer; export type ProviderConfig = z.infer; export type ModelsJsonConfig = z.infer; export interface ValidationError { path: string; message: string; severity: 'error' | 'warning'; } export interface ValidationResult { valid: boolean; errors: ValidationError[]; } export declare function validateModelsConfig(config: unknown): ValidationResult; export declare function getDefaultModelValues(): Required>; /** * Load models.json from disk */ export declare function loadModelsJson(path?: string): { config: ModelsJsonConfig; error?: string; }; /** * Save models.json to disk */ export declare function saveModelsJson(path: string, config: ModelsJsonConfig): { success: boolean; error?: string; }; /** * Check if models.json exists */ export declare function modelsJsonExists(path?: string): boolean;