import type { Adapter } from '../core/types.js';
export type ClientStatus = 'primaryActive' | 'active' | 'idle' | 'installed' | 'offline';
export type ClientSource = 'adapter-heartbeat' | 'manual' | 'env' | 'process' | 'recent-session' | 'heuristic' | 'none';
export interface ClientHeartbeatInput {
    displayName?: string;
    source?: 'adapter-heartbeat' | 'manual';
    metadata?: Record<string, unknown>;
}
export interface ClientRecord {
    clientId: string;
    displayName: string;
    state: ClientStatus;
    source: ClientSource;
    inferred: boolean;
    lastHeartbeat?: number;
    lastSeen?: number;
    lastExplicitState?: 'connected' | 'disconnected';
    confidence: number;
    evidence: string[];
    metadata: Record<string, unknown>;
}
export interface SkillDistributionSkillSummary {
    skillId: string;
    name: string;
    scope: string;
    rolloutStatus: string;
    riskClass: string;
}
export interface SkillDistributionClientSummary extends ClientRecord {
    eligibleForDistribution: boolean;
    distributableSkillIds: string[];
    distributableSkillNames: string[];
}
export interface SkillDistributionManifest {
    generatedAt: number;
    serverGoverned: true;
    policy: {
        allowedScopes: string[];
        excludedClientIds: string[];
        eligibleStates: ClientStatus[];
    };
    clients: SkillDistributionClientSummary[];
    skills: Array<SkillDistributionSkillSummary & {
        distributableClientIds: string[];
    }>;
    summary: {
        totalClients: number;
        eligibleClients: number;
        totalSkills: number;
        distributableSkills: number;
    };
}
export declare class ClientRegistry {
    private heartbeats;
    private cachedPsOutput;
    private lastPsScan;
    private readonly psTtlMs;
    private processScanUnavailable;
    recordHeartbeat(clientKey: string, input?: ClientHeartbeatInput): ClientRecord;
    recordDisconnect(clientKey: string, input?: ClientHeartbeatInput): ClientRecord;
    clear(clientKey: string): void;
    reconnect(clientKey: string): ClientRecord;
    syncAdapters(adapters: Adapter[]): void;
    listClients(adapters?: Adapter[]): ClientRecord[];
    getClient(clientKey: string, adapters?: Adapter[]): ClientRecord;
    getPrimaryClient(adapters?: Adapter[]): ClientRecord | undefined;
    listDistributionClients(adapters?: Adapter[]): ClientRecord[];
    buildSkillDistributionManifest(skills: SkillDistributionSkillSummary[], adapters?: Adapter[]): SkillDistributionManifest;
    private buildRecord;
    private isDistributionEligible;
    private isDistributableSkill;
    private resolveExplicitState;
    private detectHeuristic;
    private detectBootstrapSignal;
    private toBootstrapClientId;
    private getPrimaryCandidate;
    private detectCurrentClientId;
    private detectEnvSignal;
    private readProcessSnapshot;
    private disableProcessScanIfUnavailable;
    private resolveDescriptor;
    private safeMtime;
    private walkRecentMtime;
    private rankState;
    private rankSource;
}
