import { type ActiveSession } from '../session/active.js';
import { serializeActiveSessionsForJson } from '../session/active.js';
import { readAuthHealthCache, type AuthVerdict } from '../auth-health.js';
import { readStatsCache } from '../devices/stats-cache.js';
export declare const FACTORY_PROJECTS: readonly [{
    readonly name: "Prix";
    readonly repo: "phnx-labs/prix";
}, {
    readonly name: "Rush App";
    readonly repo: "phnx-labs/rush";
}, {
    readonly name: "Rush CLI";
    readonly repo: "phnx-labs/rush-cli";
}, {
    readonly name: "Agents CLI";
    readonly repo: "phnx-labs/agi-cli";
}, {
    readonly name: "Linear CLI";
    readonly repo: "phnx-labs/linear-cli";
}];
export interface FactoryConfig {
    source: 'default' | 'file';
    ceiling: number;
    max_dispatch_per_tick: number;
    per_project: Record<string, {
        weight: number;
        cap: number;
    }>;
    idle_boxes: string[];
    digest: {
        times: string[];
        tz: string;
    };
}
export interface FactorySnapshot {
    generatedAt: string;
    sessions: ReturnType<typeof serializeActiveSessionsForJson>;
    queues: Record<string, {
        todo: number;
        inProgress: number;
        blocked: number;
    }>;
    prs: Array<{
        repo: string;
        number: number;
        ci: string;
        review: string;
        mergeable: string;
    }>;
    devices: Array<{
        name: string;
        load: number | null;
        idle: boolean;
    }>;
    recentRuns: Array<{
        routine: string;
        status: string;
        durationMs: number | null;
    }>;
    auth: {
        claude: AuthVerdict | null;
    };
    config: FactoryConfig;
}
export interface SnapshotDependencies {
    home: string;
    now: () => Date;
    activeSessions: () => Promise<ActiveSession[]>;
    run: (file: string, args: string[]) => Promise<string>;
    readAuth: () => ReturnType<typeof readAuthHealthCache>;
    readDeviceStats: () => ReturnType<typeof readStatsCache>;
}
export declare function readFactoryConfig(home: string): FactoryConfig;
export declare function queueCounts(todoPayload: unknown, openPayload: unknown): FactorySnapshot['queues'][string];
export declare function parsePullRequests(repo: string, payload: unknown): FactorySnapshot['prs'];
export declare function parseDevices(payload: unknown, cached?: ReturnType<typeof readStatsCache>): FactorySnapshot['devices'];
export declare function readRecentRuns(home: string, limit?: number): FactorySnapshot['recentRuns'];
export declare function buildFactorySnapshot(overrides?: Partial<SnapshotDependencies>): Promise<FactorySnapshot>;
