import { CoordinationService } from './service.js';
import type { AgentRegistryEntry } from '../types/coordination.js';
export interface AutoAgentConfig {
    sessionId?: string;
    heartbeatIntervalMs?: number;
    name?: string;
    capabilities?: string[];
    worktreeBranch?: string;
}
export interface AutoAgentResult {
    agent: AgentRegistryEntry;
    service: CoordinationService;
    cleanup: () => void;
}
/**
 * Manages automatic agent registration and lifecycle.
 * Registers the agent on initialization and handles heartbeat/exit cleanup.
 */
export declare class AutoAgentCoordinator {
    private service;
    private agentId;
    private heartbeatInterval?;
    private config;
    private cleanedUp;
    private exitHandlers;
    constructor(config: AutoAgentConfig);
    /**
     * Register agent and start heartbeat.
     */
    start(): Promise<AutoAgentResult>;
    /**
     * Start periodic heartbeat.
     */
    startHeartbeat(): void;
    /**
     * Register cleanup handlers for graceful shutdown.
     * Uses tracked handlers to prevent listener leaks on repeated start/cleanup cycles.
     */
    private registerExitHandlers;
    /**
     * Cleanup: stop heartbeat, mark agent as completed, remove exit handlers.
     * Safe to call multiple times (idempotent).
     */
    cleanup(): void;
    /**
     * Update agent status.
     */
    updateStatus(status: 'active' | 'idle' | 'completed' | 'failed', currentTask?: string): void;
    /**
     * Announce work on a resource.
     */
    announceWork(resource: string, intentType: 'editing' | 'reviewing' | 'refactoring' | 'testing' | 'documenting', options?: {
        description?: string;
        filesAffected?: string[];
        estimatedMinutes?: number;
    }): {
        announcement: import("../types/coordination.js").WorkAnnouncement;
        overlaps: import("../types/coordination.js").WorkOverlap[];
        suggestions: import("../types/coordination.js").CollaborationSuggestion[];
    };
    /**
     * Complete work on a resource.
     */
    completeWork(resource: string): void;
    /**
     * Check for overlaps on a resource.
     */
    checkOverlaps(resource: string): import('../types/coordination.js').WorkOverlap[];
    /**
     * Get the agent ID.
     */
    getAgentId(): string;
    /**
     * Get the coordination service.
     */
    getService(): CoordinationService;
}
/**
 * Factory function for creating auto agents.
 */
export declare function createAutoAgent(config: AutoAgentConfig): AutoAgentCoordinator;
//# sourceMappingURL=auto-agent.d.ts.map