/**
 * Agent Registry Management
 *
 * Simple file-based registry for agent identities and tasks.
 * Designed to be robust against corruption and failures.
 */
import { AgentIdentity, AgentTask } from '../types/agent.js';
export declare class AgentRegistryManager {
    private registry;
    private dirty;
    constructor();
    /** Load registry from disk, creating default if missing or invalid */
    private loadRegistry;
    /** Acquire cross-process lock using atomic mkdir */
    private acquireLock;
    /** Release cross-process lock */
    private releaseLock;
    /** Save registry to disk if dirty (with file locking and atomic write) */
    save(): void;
    /** Ensure registry directory exists */
    private ensureRegistryDir;
    /** Get all agents */
    getAgents(): AgentIdentity[];
    /** Get agent by ID */
    getAgent(id: string): AgentIdentity | undefined;
    /** Get agent by name */
    getAgentByName(name: string): AgentIdentity | undefined;
    /** Add or update agent */
    upsertAgent(agent: AgentIdentity): void;
    /** Remove agent by ID */
    removeAgent(id: string): boolean;
    /** Update agent status */
    updateAgentStatus(id: string, status: AgentIdentity['status']): boolean;
    /** Get all tasks */
    getTasks(): AgentTask[];
    /** Get task by ID */
    getTask(id: string): AgentTask | undefined;
    /** Get tasks for agent */
    getAgentTasks(agentId: string): AgentTask[];
    /** Add or replace task by ID */
    addTask(task: AgentTask): void;
    /** Update task */
    updateTask(id: string, updates: Partial<AgentTask>): boolean;
    /** Remove task */
    removeTask(id: string): boolean;
    /** Clean up old tasks, including stale pending/running tasks whose agents are gone/offline */
    cleanupOldTasks(maxAge?: number, staleRunningAge?: number): number;
    /** Mark offline agents that haven't heartbeated recently */
    markOfflineAgents(timeout?: number): number;
    /** Get registry path for debugging */
    getRegistryPath(): string;
    /** Get agent workspace directory */
    getAgentWorkspace(agentId: string): string;
    /** Ensure agent workspace exists */
    ensureAgentWorkspace(agentId: string): string;
}
//# sourceMappingURL=agent-registry.d.ts.map