import type pino from "pino";
import type { AgentSnapshotPayload, SessionInboundMessage, SessionOutboundMessage, WorkspaceDescriptorPayload } from "./messages.js";
import type { PersistedProjectRecord, PersistedWorkspaceRecord } from "./workspace-registry.js";
type FetchWorkspacesRequestMessage = Extract<SessionInboundMessage, {
    type: "fetch_workspaces_request";
}>;
type FetchWorkspacesRequestFilter = NonNullable<FetchWorkspacesRequestMessage["filter"]>;
type FetchWorkspacesResponsePayload = Extract<SessionOutboundMessage, {
    type: "fetch_workspaces_response";
}>["payload"];
type FetchWorkspacesResponseEntry = FetchWorkspacesResponsePayload["entries"][number];
type FetchWorkspacesResponsePageInfo = FetchWorkspacesResponsePayload["pageInfo"];
export type WorkspaceUpdatesFilter = FetchWorkspacesRequestFilter;
export interface WorkspaceDirectoryDeps {
    logger: pino.Logger;
    projectRegistry: {
        list(): Promise<PersistedProjectRecord[]>;
    };
    workspaceRegistry: {
        list(): Promise<PersistedWorkspaceRecord[]>;
    };
    listAgentPayloads(): Promise<AgentSnapshotPayload[]>;
    isProviderVisibleToClient(provider: string): boolean;
    buildWorkspaceDescriptor(input: {
        workspace: PersistedWorkspaceRecord;
        projectRecord?: PersistedProjectRecord | null;
        includeGitData: boolean;
    }): Promise<WorkspaceDescriptorPayload>;
}
export declare function summarizeFetchWorkspacesEntries(entries: Iterable<FetchWorkspacesResponseEntry>): {
    count: number;
    projectIds: string[];
    statusCounts: Record<string, number>;
    workspaces: Array<{
        id: string;
        projectId: string;
        projectDisplayName: string;
        name: string;
        status: FetchWorkspacesResponseEntry["status"];
        workspaceKind: FetchWorkspacesResponseEntry["workspaceKind"];
        activityAt: string | null;
    }>;
};
export declare class WorkspaceDirectory {
    private readonly deps;
    private readonly archivingByWorkspaceId;
    /**
     * Per-workspace last-seen winning bucket + entered-at. Persists across
     * `buildDescriptorMap` calls inside the daemon process; reset on cold start.
     * Server-internal; never crosses the wire.
     */
    private readonly bucketHistoryByWorkspaceId;
    private readonly pager;
    constructor(deps: WorkspaceDirectoryDeps);
    markArchiving(workspaceIds: Iterable<string>, archivingAt: string): void;
    clearArchiving(workspaceIds: Iterable<string>): void;
    buildDescriptorMap(options: {
        includeGitData: boolean;
        workspaceIds?: Iterable<string>;
    }): Promise<Map<string, WorkspaceDescriptorPayload>>;
    private resolveStatusEnteredAt;
    private findNewestAgentTimestampInBucket;
    resolveRegisteredWorkspaceIdForCwd(cwd: string, workspaces: PersistedWorkspaceRecord[]): string;
    listDescriptors(): Promise<WorkspaceDescriptorPayload[]>;
    matchesFilter(input: {
        workspace: WorkspaceDescriptorPayload;
        filter: FetchWorkspacesRequestFilter | undefined;
    }): boolean;
    listFetchEntries(request: FetchWorkspacesRequestMessage): Promise<{
        entries: FetchWorkspacesResponseEntry[];
        pageInfo: FetchWorkspacesResponsePageInfo;
    }>;
}
export {};
//# sourceMappingURL=workspace-directory.d.ts.map