import { AICapabilities, AIInterface, AIMessage, AIModel, AIResponse, ChatOptions, ClaudeCliOptions, CompletionOptions, EmbeddingOptions, EmbeddingResponse, ImageDescriptionOptions, ImageEmbeddingOptions, ImageGenerationOptions, ImageGenerationResponse, MessageOptions, TTSOptions, TTSResponse, VideoGenerationJob, VideoGenerationOptions, VideoGenerationResult, VideoGenerationStatusResult, Voice, VoiceCloneOptions, VoiceDesignOptions, VoiceListOptions } from '../types'; /** * Claude CLI provider implementation that shells out to the Claude Code CLI. * Supports chat completions, streaming, and leverages Claude Max subscription. * Does not support embeddings (use OpenAI or another provider for embeddings). * * If ANTHROPIC_API_KEY environment variable is set, automatically falls back to * using the Anthropic provider to avoid macOS keychain password prompts. */ export declare class ClaudeCliProvider implements AIInterface { private options; private cliPath; private anthropicFallback; /** * Creates a new Claude CLI provider instance * @param options - Configuration options for the Claude CLI provider */ constructor(options: ClaudeCliOptions); /** * Checks if ANTHROPIC_API_KEY is available and initializes fallback provider if needed * @private */ private initializeFallback; /** * Finds the Claude CLI binary in PATH or uses custom cliPath * Does NOT execute the CLI during detection to avoid keychain prompts * @throws {AIError} When CLI cannot be found * @private */ private findCli; /** * Normalizes model name to full model ID or short name * @private */ private normalizeModel; /** * Execute Claude CLI command and return parsed JSON output * @private */ private executeCommand; /** * Execute Claude CLI command with streaming output * @private */ private executeStreamingCommand; /** * Maps messages to a single prompt for CLI * @private */ private mapMessagesToPrompt; /** * Maps CLI errors to standardized error types * @private */ private mapCliError; /** * Generate a chat completion using Claude CLI * @param messages - Array of conversation messages * @param options - Optional configuration for the chat completion * @returns Promise resolving to the AI response with content and metadata * @throws {AIError} When the CLI execution fails * * @example * ```typescript * const response = await provider.chat([ * { role: 'system', content: 'You are a helpful assistant.' }, * { role: 'user', content: 'Explain quantum computing' } * ], { * model: 'sonnet' * }); * ``` */ chat(messages: AIMessage[], options?: ChatOptions): Promise; /** * Generate a text completion (delegates to chat) */ complete(prompt: string, options?: CompletionOptions): Promise; /** * Simple message interface for single-turn interactions with optional history * * @param text - The message text to send * @param options - Configuration options including history, model, etc. * @returns Promise resolving to the response content string * * @example * ```typescript * // Simple usage * const response = await provider.message('Hello!'); * * // With history * const response = await provider.message('What was my question?', { * history: [ * { role: 'user', content: 'What is 2+2?' }, * { role: 'assistant', content: '4' } * ] * }); * ``` */ message(text: string, options?: MessageOptions): Promise; /** * Embeddings are not supported by Claude CLI or Anthropic */ embed(_text: string | string[], _options?: EmbeddingOptions): Promise; /** * Image embeddings are not supported by Claude CLI */ embedImage(_image: string | Buffer, _options?: ImageEmbeddingOptions): Promise; /** * Image description is not yet implemented for Claude CLI * Note: Claude supports vision, but this would require significant implementation */ describeImage(_image: string | Buffer, _prompt?: string, _options?: ImageDescriptionOptions): Promise; /** * Image generation is not supported by Claude */ generateImage(_prompt: string, _options?: ImageGenerationOptions): Promise; /** * Stream chat completion using Claude CLI */ stream(messages: AIMessage[], options?: ChatOptions): AsyncIterable; /** * Count tokens in text (approximation) */ countTokens(text: string): Promise; /** * Get available models (static list of Claude models) */ getModels(): Promise; /** * Get provider capabilities */ getCapabilities(): Promise; submitVideoGenerationJob(_options: VideoGenerationOptions): Promise; getVideoGenerationJob(_handle: VideoGenerationJob): Promise; fetchVideoGenerationResult(_handle: VideoGenerationJob): Promise; cancelVideoGenerationJob(_handle: VideoGenerationJob): Promise; validateVideoGenerationAccess(): Promise; synthesizeSpeech(_text: string, _options?: TTSOptions): Promise; streamSpeech(_text: string, _options?: TTSOptions): AsyncIterable; cloneVoice(_options: VoiceCloneOptions): Promise; designVoice(_options: VoiceDesignOptions): Promise; getVoices(_options?: VoiceListOptions): Promise; } //# sourceMappingURL=claude-cli.d.ts.map