import type { AgentMeta } from "../settings.js"; /** * Attempt to acquire the lockfile for an exchange's agent-approve operation. * Returns void on success. Throws LOCK_HELD if another live process holds it. * Auto-clears stale locks (>5 min old OR dead PID). * * Exported so callers can hold the lock across multiple operations (e.g. the * full approve flow) before calling setAgent. */ export declare function acquireLock(exchange: string): void; export declare function releaseLock(exchange: string): void; /** * Returns the specific named agent, or the first non-partial agent when * agentName is omitted. */ export declare function getAgent(exchange: string, agentName?: string): AgentMeta | null; /** * Persist an agent meta entry for the given exchange. * Acquires a lockfile before writing to prevent concurrent races (AC-14). * * Re-entrant: if the calling process already holds the lock (e.g. the approve * flow acquired it at the start), this function writes directly without a * double-acquire or release. */ export declare function setAgent(exchange: string, meta: AgentMeta): void; /** * Delete an agent entry. Returns true if it existed and was removed, false if * it was already absent (idempotent per AC-4). */ export declare function deleteAgent(exchange: string, agentName: string): boolean; /** * List all registered agents, optionally filtered to a single exchange. */ export declare function listAgents(exchange?: string): Array<{ exchange: string; meta: AgentMeta; }>;