import { EventEmitter } from 'events';
import { StorageService } from '../core/storage.service.js';
import { TmuxService } from '../agent/tmux.service.js';
import type { EventBusService } from '../event-bus/event-bus.service.js';
import { TerminalGateway } from '../../websocket/terminal.gateway.js';
export interface TeamActivityData {
    orchestrator: {
        sessionName: string;
        running: boolean;
        lastCheck: string;
    };
    members: Array<{
        teamId: string;
        teamName: string;
        memberId: string;
        memberName: string;
        role: string;
        sessionName: string;
        agentStatus: 'active' | 'inactive' | 'activating';
        workingStatus: 'in_progress' | 'idle';
        lastActivityCheck: string;
        activityDetected: boolean;
        currentTask?: {
            id: string;
            taskName: string;
            status: string;
            assignedAt: string;
        };
        lastTerminalOutput?: string;
    }>;
}
export declare class TeamActivityWebSocketService extends EventEmitter {
    private storageService;
    private _legacyTmuxService;
    private terminalGateway;
    private backgroundTimer;
    private cachedActivityData;
    private eventBus;
    private eventUnsubscribe;
    private logger;
    private readonly BACKGROUND_REFRESH_INTERVAL;
    private readonly MAX_OUTPUT_SIZE;
    private readonly SESSION_CHECK_TIMEOUT;
    /**
     * V3-only as of spec 2026-05-06-task-management-v1-deprecation.md.
     * The legacy `taskTrackingService` constructor parameter has been removed.
     * In-progress task data is read from TaskPoolService; activity-trigger
     * events are subscribed via EventBusService when {@link setEventBus} is
     * called during boot.
     *
     * @param storageService - Provides team membership data
     * @param tmuxService - Legacy backward-compat (kept dormant)
     */
    constructor(storageService: StorageService, tmuxService: TmuxService);
    /**
     * Wire the EventBus so this service can react to V3 WorkItem
     * lifecycle events (`workitem:queued` / `task:done_by_worker`) the
     * same way it used to react to TaskTrackingService's `task_assigned`
     * / `task_completed` emitter events.
     *
     * Call once during application boot, after the EventBus is created
     * but before {@link start}. Idempotent — calling again replaces the
     * subscription.
     *
     * @param bus - The shared EventBusService
     */
    setEventBus(bus: EventBusService): void;
    /**
     * Set the terminal gateway for broadcasting WebSocket events
     */
    setTerminalGateway(terminalGateway: TerminalGateway): void;
    /**
     * Start the event-driven activity monitoring with background refresh
     */
    start(): void;
    /**
     * Stop the activity monitoring
     */
    stop(): void;
    /**
     * Perform comprehensive activity check and broadcast changes
     */
    private performActivityCheck;
    /**
     * Gather comprehensive team activity data (optimized with bulk session checking)
     */
    private gatherActivityData;
    /**
     * Check if session exists using PTY backend
     */
    private checkSessionWithTimeout;
    /**
     * Detect activity by comparing terminal output
     */
    private detectActivity;
    /**
     * Check if activity data has meaningfully changed
     */
    private hasActivityChanged;
    /**
     * Broadcast orchestrator status update.
     * Maps the internal `running` boolean to the `agentStatus` string that
     * the frontend useOrchestratorStatus hook expects.
     */
    private broadcastOrchestratorUpdate;
    /**
     * Broadcast member status updates
     */
    private broadcastMemberUpdates;
    /**
     * Broadcast comprehensive team activity update
     */
    private broadcastTeamActivityUpdate;
    /**
     * Get cached activity data (for immediate responses)
     */
    getCachedActivityData(): TeamActivityData | null;
    /**
     * Force refresh activity data (for manual triggers)
     */
    forceRefresh(): Promise<void>;
}
//# sourceMappingURL=team-activity-websocket.service.d.ts.map