UNPKG

@elevenlabs/convai-cli

Version:

CLI tool to manage ElevenLabs conversational AI agents

86 lines 3.44 kB
export declare const LOCK_FILE_AGENTS_KEY = "agents"; export interface LockFileAgent { id: string; hash: string; } export interface LockFileData { agents: Record<string, Record<string, LockFileAgent>>; tools: Record<string, LockFileAgent>; } /** * Calculates the MD5 hash of a configuration object. * * @param config - The configuration object * @returns The hexadecimal representation of the MD5 hash */ export declare function calculateConfigHash(config: unknown): string; /** * Reads an agent configuration file. * * @param filePath - The path to the JSON configuration file * @returns A promise that resolves to the agent configuration object * @throws {Error} If the configuration file is not found or contains invalid JSON */ export declare function readAgentConfig<T = Record<string, unknown>>(filePath: string): Promise<T>; /** * Writes an agent configuration to a file. * * @param filePath - The path to write the JSON configuration file * @param config - The object containing the agent configuration * @throws {Error} If there is an error writing the file */ export declare function writeAgentConfig(filePath: string, config: unknown): Promise<void>; /** * Loads the lock file. If it doesn't exist or is invalid, returns a default structure. * * @param lockFilePath - Path to the lock file * @returns Promise that resolves to the lock file data */ export declare function loadLockFile(lockFilePath: string): Promise<LockFileData>; /** * Saves the lock data to the lock file. * * @param lockFilePath - Path to the lock file * @param lockData - The lock data to save * @throws {Error} If there is an error writing the file */ export declare function saveLockFile(lockFilePath: string, lockData: LockFileData): Promise<void>; /** * Retrieves agent ID and hash from lock data by agent name and tag. * * @param lockData - The lock file data * @param agentName - The agent name * @param tag - The environment tag * @returns The agent data if found, undefined otherwise */ export declare function getAgentFromLock(lockData: LockFileData, agentName: string, tag: string): LockFileAgent | undefined; /** * Updates or adds an agent's ID and hash in the lock data. * * @param lockData - The lock file data to update * @param agentName - The agent name * @param tag - The environment tag * @param agentId - The agent ID * @param configHash - The configuration hash */ export declare function updateAgentInLock(lockData: LockFileData, agentName: string, tag: string, agentId: string, configHash: string): void; /** * Updates or adds a tool's ID and hash in the lock data. * * @param lockData - The lock file data to update * @param toolName - The tool name * @param toolId - The tool ID * @param configHash - The configuration hash */ export declare function updateToolInLock(lockData: LockFileData, toolName: string, toolId: string, configHash: string): void; /** * Retrieves tool ID and hash from lock data by tool name. * * @param lockData - The lock file data * @param toolName - The tool name * @returns The tool data if found, undefined otherwise */ export declare function getToolFromLock(lockData: LockFileData, toolName: string): LockFileAgent | undefined; export declare function toCamelCaseKeys<T = unknown>(value: T, skipHeaderConversion?: boolean): T; export declare function toSnakeCaseKeys<T = unknown>(value: T): T; //# sourceMappingURL=utils.d.ts.map