/**
 * Factory Service
 *
 * Provides data for the 3D Factory visualization by detecting running
 * Claude CLI instances and gathering usage statistics.
 *
 * @module services/factory
 */
/**
 * Claude instance data structure
 */
export interface ClaudeInstance {
    id: string;
    pid: string;
    projectName: string;
    projectPath: string;
    summary: string;
    cpuPercent: number;
    status: 'active' | 'idle' | 'dormant';
    lastActivity: string;
    color: string;
    currentTask: string;
    activity: string;
    lastTool: string;
    recentTools: string[];
    sessionTokens: number;
    tokenPercent: number;
}
/**
 * Claude instances response structure
 */
export interface ClaudeInstancesResponse {
    timestamp: string;
    totalInstances: number;
    activeCount: number;
    idleCount: number;
    dormantCount: number;
    totalSessionTokens: number;
    instances: ClaudeInstance[];
}
/**
 * Usage statistics response structure
 */
export interface UsageStatsResponse {
    timestamp: string;
    today: {
        date: string;
        messages: number;
        sessions: number;
        toolCalls: number;
        tokens: number;
    };
    totals: {
        sessions: number;
        messages: number;
        firstSession?: string;
    };
    modelUsage: Array<{
        model: string;
        inputTokens: number;
        outputTokens: number;
        cacheReadTokens: number;
        cacheWriteTokens: number;
    }>;
    recentDays: Array<{
        date: string;
        tokens: number;
    }>;
}
/**
 * Combined factory agent data (from both teams and Claude processes)
 */
export interface FactoryAgent {
    id: string;
    sessionName: string;
    name: string;
    projectName: string;
    status: 'active' | 'idle' | 'dormant';
    cpuPercent: number;
    activity?: string;
    sessionTokens: number;
}
/**
 * Combined factory state response (teams + Claude instances)
 */
export interface FactoryStateResponse {
    timestamp: string;
    agents: FactoryAgent[];
    projects: string[];
    stats: {
        activeCount: number;
        idleCount: number;
        dormantCount: number;
        totalTokens: number;
    };
}
/**
 * Factory Service for 3D visualization data
 */
export declare class FactoryService {
    private statusCache;
    private avatarColors;
    /**
     * Get information about all running Claude CLI instances
     *
     * @returns Promise resolving to Claude instances data
     */
    getClaudeInstances(): Promise<ClaudeInstancesResponse>;
    /**
     * Get combined factory state from both Crewly teams and Claude processes.
     * This merges data from:
     * 1. Crewly teams (managed agents)
     * 2. Standalone Claude Code processes
     *
     * @returns Promise resolving to combined factory state
     */
    getFactoryState(): Promise<FactoryStateResponse>;
    /**
     * Maps team member status to factory visualization status
     *
     * @param agentStatus - Agent connection status (active, inactive, activating)
     * @param workingStatus - Agent working status (idle, in_progress)
     * @returns Mapped status for factory visualization
     */
    private mapTeamMemberStatus;
    /**
     * Get usage statistics from Claude session files
     *
     * @returns Promise resolving to usage statistics
     */
    getUsageStats(): Promise<UsageStatsResponse>;
    /**
     * Get Claude processes from ps command
     */
    private getClaudeProcesses;
    /**
     * Find session directory from process cwd
     */
    private findSessionForProcess;
    /**
     * Get session details including current task and tokens
     */
    private getSessionDetails;
    /**
     * Get real-time token usage from JSONL session files
     */
    private getRealTimeUsage;
    /**
     * Determine instance status with hysteresis
     */
    private determineStatus;
    /**
     * Get avatar color for an instance
     */
    private getAvatarColor;
}
//# sourceMappingURL=factory.service.d.ts.map