import { Command, Option } from "commander"; import { z } from "zod"; import type { FieldMetadata } from "./schema-introspection.js"; import { type ModelValidationConfig } from "./provider-validation.js"; export type { FieldMetadata }; /** * Configuration for command generation */ export interface CommandGenerationConfig { /** Zod schemas for each provider */ schemas: Record; /** Fields to exclude from option generation */ excludeFields?: string[]; /** Custom field configurations */ fieldOverrides?: Record>; /** Whether to make API key optional (when env vars are available) */ optionalApiKey?: boolean; } /** * Parsed CLI arguments with type information */ export interface ParsedArgs { provider: string; rawOptions: Record; parsedOptions: Record; validationErrors: string[]; } /** * Create a Commander option from a field's metadata */ export declare function createOptionFromField(field: string, metadata: FieldMetadata, config: CommandGenerationConfig): Option; /** * Add all schema-based options to a command */ export declare function addSchemaOptionsToCommand(command: Command, provider: string, config: CommandGenerationConfig): Command; /** * Create a provider-specific command with all options */ export declare function createProviderCommand(provider: string, config: CommandGenerationConfig, action?: (options: Record) => void | Promise): Command; /** * Parse and validate command line arguments against schema */ export declare function parseAndValidateArgs(args: string[], provider: string, config: CommandGenerationConfig): ParsedArgs; /** * Generate help text for a provider's options */ export declare function generateProviderHelp(provider: string, config: CommandGenerationConfig): string; /** * Create a models listing command */ export declare function createModelsCommand(modelRegistries: Record>, modelToProvider: Record): Command; /** * Batch create commands for all providers */ export declare function createProviderCommands(config: CommandGenerationConfig, actions?: Record) => void | Promise>): Record; /** * Configuration for complete CLI application */ export interface CLIApplicationConfig { /** Command generation config for schemas */ commandConfig: CommandGenerationConfig; /** Model validation config for capability checking */ modelConfig: ModelValidationConfig; /** Custom provider filter (e.g., exclude anthropic for bridging) */ providerFilter?: (providers: string[]) => string[]; /** Custom model data formatter */ formatModelInfo?: (model: string, data: any) => string; } /** * Create a complete models command with full functionality */ export declare function createCompleteModelsCommand(config: CLIApplicationConfig): Command; /** * Create a complete one-shot provider command with message handling */ export declare function createCompleteProviderCommand(provider: string, config: CLIApplicationConfig, executeAction: (provider: string, message: string, options: any, attachments?: any[]) => Promise): Command; /** * Create all provider commands for an application */ export declare function createCompleteProviderCommands(config: CLIApplicationConfig, executeAction: (provider: string, message: string, options: any, attachments?: any[]) => Promise): Record; //# sourceMappingURL=command-generation.d.ts.map