import { EventEmitter } from 'events';
import { TeamActivityWebSocketService } from './team-activity-websocket.service.js';
import type { EventBusService } from '../event-bus/event-bus.service.js';
/**
 * Service that watches the teams directory for changes and triggers
 * real-time WebSocket updates when agent registrations or team status changes occur.
 *
 * Watches: ~/.crewly/teams/{team-id}/config.json files
 */
export declare class TeamsJsonWatcherService extends EventEmitter {
    private logger;
    private teamActivityService;
    private eventBusService;
    private watcher;
    private teamWatchers;
    private debounceTimer;
    private readonly DEBOUNCE_DELAY;
    private teamsDir;
    private lastTeamsData;
    constructor();
    /**
     * Set the TeamActivityWebSocketService instance to trigger when team changes occur
     */
    setTeamActivityService(teamActivityService: TeamActivityWebSocketService): void;
    /**
     * Set the EventBusService instance for publishing agent lifecycle events
     */
    setEventBusService(service: EventBusService): void;
    /**
     * Start watching the teams directory for changes
     */
    start(): void;
    /**
     * Watch existing team directories for config.json changes
     */
    private watchExistingTeamDirs;
    /**
     * Watch a specific team directory for config.json changes
     */
    private watchTeamDir;
    /**
     * Stop watching a specific team directory
     */
    private unwatchTeamDir;
    /**
     * Handle changes in the teams directory (new teams added/removed)
     */
    private handleTeamsDirChange;
    /**
     * Handle changes in a team's config.json
     */
    private handleTeamConfigChange;
    /**
     * Stop watching the teams directory
     */
    stop(): void;
    /**
     * Handle teams.json file changes with debouncing
     */
    private handleTeamsJsonChange;
    /**
     * Process the actual teams change after debouncing
     */
    private processTeamsJsonChange;
    /**
     * Determine if the teams change should trigger an activity refresh
     * Only session/activity-relevant changes should trigger tmux commands
     */
    private shouldTriggerActivityRefresh;
    /**
     * Read all teams from the directory structure
     */
    private readTeamsFromDirectory;
    /**
     * Compare old and new teams data and publish granular agent lifecycle events
     * to the event bus for each status change detected.
     */
    private publishAgentEvents;
    /**
     * Compare old and new teams data to detect activity-relevant changes
     * Returns true if changes affect session status or activity monitoring
     */
    private hasActivityRelevantChanges;
    /**
     * Trigger team activity update through TeamActivityWebSocketService
     */
    private triggerTeamActivityUpdate;
    /**
     * Get watcher status information
     */
    getStatus(): {
        isWatching: boolean;
        teamsDir: string;
        dirExists: boolean;
        teamCount: number;
        watchedTeams: string[];
    };
    /**
     * Force trigger a team activity update (for testing or manual refresh)
     */
    forceTrigger(reason?: string): void;
    /**
     * Cleanup resources
     */
    private cleanup;
}
//# sourceMappingURL=teams-json-watcher.service.d.ts.map