UNPKG

taskflow-ai

Version:

TaskFlow AI - 智能PRD文档解析与任务管理助手,支持多模型AI协同、MCP编辑器集成,专为开发团队设计的CLI工具

99 lines (98 loc) 2.04 kB
/** * 安全存储系统 * 提供API密钥和敏感信息的加密存储 */ /** * 安全存储管理器 */ export declare class SecureStorage { private static instance; private readonly storageDir; private readonly encryptionConfig; private masterKey; private constructor(); static getInstance(): SecureStorage; /** * 设置主密钥 */ setMasterKey(password: string): void; /** * 验证主密钥 */ verifyMasterKey(password: string): boolean; /** * 存储API密钥 */ storeApiKey(provider: string, apiKey: string): void; /** * 获取API密钥 */ getApiKey(provider: string): string | null; /** * 删除API密钥 */ deleteApiKey(provider: string): boolean; /** * 列出所有存储的提供商 */ listProviders(): string[]; /** * 加密数据 */ private encrypt; /** * 解密数据 */ private decrypt; /** * 确保存储目录存在 */ private ensureStorageDir; /** * 清除所有存储的密钥 */ clearAll(): void; /** * 检查是否已初始化 */ isInitialized(): boolean; /** * 获取存储统计信息 */ getStats(): { totalKeys: number; storageSize: number; lastModified: Date | null; }; } /** * 便捷函数 */ export declare function getSecureStorage(): SecureStorage; /** * API密钥管理器 */ export declare class ApiKeyManager { private storage; constructor(); /** * 设置API密钥 */ setApiKey(provider: string, apiKey: string): Promise<void>; /** * 获取API密钥 */ getApiKey(provider: string): Promise<string | null>; /** * 删除API密钥 */ deleteApiKey(provider: string): Promise<boolean>; /** * 列出所有提供商 */ listProviders(): Promise<string[]>; /** * 检查API密钥是否存在 */ hasApiKey(provider: string): Promise<boolean>; }