//#region extensions/crypto/src/services/agent-keystore.d.ts /** * Agent Keystore — Secure storage for the agent's private key. * * The agent account is a HybridDeleGator smart account deployed by the user. * The agent's private key (delegate key) is what enables autonomous execution. * Losing this key means the agent can't execute; the user can still access * funds via their owner key. * * Storage hierarchy (checked in order): * 1. macOS Keychain — most secure, survives app reinstalls * 2. Encrypted file — AES-256-GCM with user passphrase * 3. In-memory only — lost on restart (for testing) * * The key is NEVER logged, written to unencrypted files, or sent over the network. */ interface AgentMeta { /** The HybridDeleGator smart account address. */ smartAccountAddress: string; /** The agent's EOA address (derived from the private key). */ agentAddress: string; /** The user's EOA address (owner of the smart account). */ ownerAddress: string; /** Chain the smart account was deployed on. */ chainId: number; /** ISO timestamp of creation. */ createdAt: string; /** Where the key is stored: 'keychain' | 'encrypted_file' | 'memory' */ storageMethod: 'keychain' | 'encrypted_file' | 'memory'; } declare function saveMeta(meta: AgentMeta): void; declare function loadMeta(): AgentMeta | null; /** * Store the agent's private key securely. * Tries: macOS Keychain → encrypted file → memory only. * * Returns the storage method used. */ declare function storeAgentKey(agentAddress: string, privateKey: string, passphrase?: string): 'keychain' | 'encrypted_file' | 'memory'; /** * Load the agent's private key. * Tries: memory cache → macOS Keychain → encrypted file (passphrase from arg or env). */ declare function loadAgentKey(passphrase?: string): string | null; /** * Check if an agent account exists (meta file present). */ declare function hasAgentAccount(): boolean; /** * Clear all agent data (for testing). */ declare function resetAgentKeystore(): void; //#endregion export { AgentMeta, hasAgentAccount, loadAgentKey, loadMeta, resetAgentKeystore, saveMeta, storeAgentKey }; //# sourceMappingURL=agent-keystore.d.mts.map