/** * Scampi configuration management * * Handles reading/writing ~/.scampi/config.json */ /** * Scampi configuration schema */ export interface ScampiConfig { /** LLM provider name (e.g., "zai") */ provider: string; /** API key for the provider */ apiKey: string; /** Model configuration */ models: { /** Primary model for complex tasks (e.g., "glm-4.7") */ primary: string; /** Flash model for fast tasks (e.g., "glm-4.6v-flash") */ flash: string; }; /** Maximum concurrent API requests */ concurrency: number; /** Request timeout in milliseconds (default: 30000) */ timeout?: number; } /** * Get the path to the Scampi configuration directory * * @returns Absolute path to ~/.scampi/ */ export declare function getConfigDir(): string; /** * Get the path to the Scampi configuration file * * @returns Absolute path to ~/.scampi/config.json */ export declare function getConfigPath(): string; /** * Check if the configuration file exists * * @returns true if ~/.scampi/config.json exists, false otherwise */ export declare function configExists(): boolean; /** * Load configuration from ~/.scampi/config.json * * @returns The loaded configuration, or null if the file doesn't exist or is invalid */ export declare function loadConfig(): ScampiConfig | null; /** * Save configuration to ~/.scampi/config.json * * Creates the ~/.scampi directory if it doesn't exist. * * **File Permissions (Unix/Linux/macOS only):** * - Directory permissions: 0o700 (rwx------) - readable, writable, and executable only by the owner * - File permissions: 0o600 (rw-------) - readable and writable only by the owner * * These restrictive permissions protect the API key stored in the config file from being * read by other users on the system. * * **Windows Limitation:** * On Windows, the file permission modes (0o700 for directory, 0o600 for file) are set but * silently ignored by Node.js. Windows does not use Unix-style permission bits. To protect * the API key on Windows, ensure the config directory (~/.scampi) is located in your user * profile (typically C:\Users\), which has Windows ACLs that restrict access by * default. * * @param config - The configuration to save * @throws Error if writing fails */ export declare function saveConfig(config: ScampiConfig): void; /** * Create a default configuration template * * @returns A default ScampiConfig with placeholder values */ export declare function createDefaultConfig(): ScampiConfig; //# sourceMappingURL=index.d.ts.map