UNPKG

cline-sdk

Version:

Comprehensive SDK for Cline - AI-powered development assistant with database integration, execution modes, and custom functions

128 lines 4.22 kB
/** * Cline SDK Configuration System * Handles API keys, settings, and tool configurations */ import { ExecutionMode } from "../modes/execution-modes"; export type AnthropicModel = "claude-3-sonnet-20240229" | "claude-3-haiku-20240307" | "claude-3-opus-20240229" | "claude-3-5-sonnet-20241022" | "claude-3-5-haiku-20241022"; export type OpenAIModel = "gpt-4" | "gpt-4-turbo" | "gpt-4o" | "gpt-4o-mini" | "gpt-3.5-turbo"; export type OllamaModel = "llama3" | "llama3.1" | "llama3.2" | "codellama" | "mistral" | "gemma" | "qwen" | "deepseek-coder"; export type BedrockModel = "anthropic.claude-3-sonnet-20240229-v1:0" | "anthropic.claude-3-haiku-20240307-v1:0" | "anthropic.claude-3-opus-20240229-v1:0" | "anthropic.claude-3-5-sonnet-20241022-v2:0"; export type VertexModel = "gemini-1.5-pro" | "gemini-1.5-flash" | "gemini-1.0-pro"; export type SupportedModel = AnthropicModel | OpenAIModel | OllamaModel | BedrockModel | VertexModel | string; export interface ClineConfig { apiProvider: "anthropic" | "openai" | "openrouter" | "ollama" | "bedrock" | "vertex" | "gemini" | "deepseek" | "qwen" | "mistral"; apiKey?: string; apiBaseUrl?: string; model?: SupportedModel; providerConfig?: { bedrock?: { region: string; accessKeyId?: string; secretAccessKey?: string; modelId?: string; }; vertex?: { projectId: string; location: string; credentials?: any; }; openrouter?: { httpReferer?: string; xTitle?: string; }; ollama?: { host: string; port?: number; }; customHeaders?: Record<string, string>; }; enabledTools: string[]; enableCustomFunctions: boolean; enableDatabase: boolean; maxRequestsPerTask: number; timeout: number; executionMode: ExecutionMode; storageType: "local" | "supabase"; workingDirectory: string; alwaysAllowReadOnly: boolean; supabase?: { url: string; anonKey: string; serviceKey?: string; bucketName: string; projectPath?: string; }; database?: { host: string; port: number; database: string; username: string; password: string; ssl?: boolean | object; maxConnections?: number; idleTimeoutMillis?: number; connectionTimeoutMillis?: number; permissions: { allowRead: boolean; allowWrite: boolean; allowDelete: boolean; allowSchemaChanges: boolean; allowRLSManagement: boolean; restrictedTables: string[]; allowedTables: string[]; }; }; customInstructions?: string; temperature?: number; maxTokens?: number; useCache?: boolean; anthropicVersion?: string; streaming?: boolean; reasoning?: boolean; imageSupport?: boolean; functionCalling?: boolean; requestTimeout?: number; rateLimiting?: { enabled: boolean; requestsPerMinute?: number; requestsPerHour?: number; }; costLimits?: { maxCostPerTask?: number; maxCostPerDay?: number; alertThreshold?: number; }; retry?: { enabled: boolean; maxAttempts?: number; waitTimeMs?: number; exponentialBackoff?: boolean; retryOnErrors?: string[]; }; } export declare class ClineConfigManager { private configPath; private config; constructor(configDir?: string); private loadConfig; private getDefaultConfig; getConfig(): ClineConfig; updateConfig(updates: Partial<ClineConfig>): void; setApiKey(apiKey: string): void; setWorkingDirectory(directory: string): void; enableTool(toolName: string): void; disableTool(toolName: string): void; private saveConfig; getConfigPath(): string; validateModel(): { valid: boolean; errors: string[]; }; private getModelValidation; validateConfig(): { valid: boolean; errors: string[]; }; static fromEnvironment(): ClineConfigManager; } //# sourceMappingURL=cline-config.d.ts.map