import { EventEmitter } from 'events';
import { ScheduledMessage } from '../../types/index.js';
import { TmuxService } from '../agent/tmux.service.js';
import { AgentRegistrationService } from '../agent/agent-registration.service.js';
import { StorageService } from '../core/storage.service.js';
export declare class MessageSchedulerService extends EventEmitter {
    private activeTimers;
    private _legacyTmuxService;
    private storageService;
    private agentRegistrationService;
    private logger;
    private messageQueue;
    private isProcessingQueue;
    constructor(tmuxService: TmuxService, storageService: StorageService);
    /**
     * Set the AgentRegistrationService for reliable message delivery.
     * Called after both services are constructed to avoid circular dependencies.
     *
     * @param service - The AgentRegistrationService instance
     */
    setAgentRegistrationService(service: AgentRegistrationService): void;
    /**
     * Start the scheduler - load all active messages and schedule them
     */
    start(): Promise<void>;
    /**
     * Schedule a new message
     */
    scheduleMessage(message: ScheduledMessage): void;
    /**
     * Cancel a scheduled message
     */
    cancelMessage(messageId: string): void;
    /**
     * Reschedule all active messages (used when messages are updated)
     */
    rescheduleAllMessages(): Promise<void>;
    /**
     * Cancel all scheduled messages
     */
    cancelAllMessages(): void;
    /**
     * Get statistics about active schedules
     */
    getStats(): {
        activeSchedules: number;
        scheduledMessageIds: string[];
    };
    /**
     * Resolve the runtime type for a target session by looking up the team member.
     * Falls back to claude-code if the member is not found.
     *
     * @param sessionName - The session name to look up
     * @returns The runtime type for the session
     */
    private resolveRuntimeType;
    /**
     * Execute a scheduled message using reliable delivery via AgentRegistrationService.
     * Falls back to fire-and-forget if AgentRegistrationService is not available.
     */
    private executeMessage;
    /**
     * Execute message through sequential queue to prevent race conditions between simultaneous messages
     */
    private executeMessageSequentially;
    /**
     * Process the message queue sequentially
     */
    private processMessageQueue;
    /**
     * Load all active messages from storage and schedule them
     */
    private loadAndScheduleAllMessages;
    /**
     * Convert delay amount and unit to milliseconds
     */
    private getDelayInMilliseconds;
    /**
     * Validate that a project still exists in the system
     */
    private validateProjectExists;
    /**
     * Add continuation instructions to scheduled messages to handle interruptions gracefully
     */
    private addContinuationInstructions;
    /**
     * Clean up orphaned scheduled messages for non-existent projects
     */
    cleanupOrphanedMessages(): Promise<{
        found: number;
        deactivated: number;
        errors: string[];
    }>;
    /**
     * Clean up all timers
     */
    cleanup(): void;
}
//# sourceMappingURL=message-scheduler.service.d.ts.map