/** * Config file management for agentsmarket CLI. * * Stores agent identity + network preference in ~/.config/agentsmarket/ * * Storage layout: * mnemonic.txt — 12-word BIP-39 phrase (primary backup, import to Trust Wallet) * agent.key — secp256k1 private key hex (convenience, derived from mnemonic) * config.json — public info (agent_id, network, created_at) * * MVP: file-based storage with 0700 dir / 0600 file permissions. * Production: migrate to OS keychain (macOS Keychain / Linux libsecret / * Windows Credential Manager) via @napi-rs/keyring. */ export type Network = 'base-sepolia' | 'base-mainnet'; export interface Config { /** EVM address (0x-prefixed, 40 hex chars). Used for signing + USDC payments. */ agent_id: string; /** Blockchain network. The marketplace runs on Base mainnet; this field is * recorded rather than obeyed — the API base URL is fixed in lib/http.ts. * Kept for display in `agentsmarket info`, which is why it must be truthful. * `base-sepolia` remains accepted so older configs still load. */ network: Network; /** ISO 8601 timestamp of agent creation. */ created_at: string; } export declare function getConfigDir(): string; export declare function getKeyPath(): string; export declare function getMnemonicPath(): string; export declare function getConfigPath(): string; export declare function loadConfig(): Config | null; export declare function saveConfig(config: Config): void; export declare function savePrivateKey(hexPrivateKey: string): void; export declare function loadPrivateKeyHex(): string; /** * The wallet that can sign a purchase, or null when there is none. * * The same key the EIP-191 request is signed with, so the buyer in the request * and the buyer in the permit cannot drift apart. A missing key is a normal * state (a CI job that passed no key at all), so it is a null return rather * than a throw. */ export declare function tryLoadWallet(): { address: string; privateKey: string; } | null; /** * Must agree with `loadPrivateKeyHex`. When either side took the key from a * different source than the other took the address, the server derived the * buyer from one key while the permit named another — `shared_link` came out * from two different `buyerAddress` values and every run failed INVALID_LINK. */ export declare function getActiveAgentId(): string; export declare function isTreasuryMode(): boolean; export declare function saveMnemonic(mnemonic: string): void; export declare function loadMnemonic(): string; export declare function configExists(): boolean; export declare function keyExists(): boolean; export declare function mnemonicExists(): boolean;