import type { Logger } from "pino";
import { z } from "zod";
import type { PersistedProjectKind, PersistedWorkspaceKind } from "./workspace-registry-model.js";
declare const PersistedProjectRecordSchema: z.ZodObject<{
    projectId: z.ZodString;
    rootPath: z.ZodString;
    kind: z.ZodEnum<["git", "non_git"]>;
    displayName: z.ZodString;
    createdAt: z.ZodString;
    updatedAt: z.ZodString;
    archivedAt: z.ZodNullable<z.ZodString>;
    worktreeParentDir: z.ZodOptional<z.ZodNullable<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
    kind: "git" | "non_git";
    createdAt: string;
    updatedAt: string;
    archivedAt: string | null;
    projectId: string;
    displayName: string;
    rootPath: string;
    worktreeParentDir?: string | null | undefined;
}, {
    kind: "git" | "non_git";
    createdAt: string;
    updatedAt: string;
    archivedAt: string | null;
    projectId: string;
    displayName: string;
    rootPath: string;
    worktreeParentDir?: string | null | undefined;
}>;
declare const PersistedWorkspaceRecordSchema: z.ZodObject<{
    workspaceId: z.ZodString;
    projectId: z.ZodString;
    cwd: z.ZodString;
    kind: z.ZodEnum<["local_checkout", "worktree", "directory"]>;
    displayName: z.ZodString;
    createdAt: z.ZodString;
    updatedAt: z.ZodString;
    archivedAt: z.ZodNullable<z.ZodString>;
}, "strip", z.ZodTypeAny, {
    kind: "local_checkout" | "worktree" | "directory";
    cwd: string;
    createdAt: string;
    updatedAt: string;
    archivedAt: string | null;
    projectId: string;
    workspaceId: string;
    displayName: string;
}, {
    kind: "local_checkout" | "worktree" | "directory";
    cwd: string;
    createdAt: string;
    updatedAt: string;
    archivedAt: string | null;
    projectId: string;
    workspaceId: string;
    displayName: string;
}>;
export type PersistedProjectRecord = z.infer<typeof PersistedProjectRecordSchema>;
export type PersistedWorkspaceRecord = z.infer<typeof PersistedWorkspaceRecordSchema>;
export interface ProjectRegistry {
    initialize(): Promise<void>;
    existsOnDisk(): Promise<boolean>;
    list(): Promise<PersistedProjectRecord[]>;
    get(projectId: string): Promise<PersistedProjectRecord | null>;
    upsert(record: PersistedProjectRecord): Promise<void>;
    archive(projectId: string, archivedAt: string): Promise<void>;
    remove(projectId: string): Promise<void>;
}
export interface WorkspaceRegistry {
    initialize(): Promise<void>;
    existsOnDisk(): Promise<boolean>;
    list(): Promise<PersistedWorkspaceRecord[]>;
    get(workspaceId: string): Promise<PersistedWorkspaceRecord | null>;
    upsert(record: PersistedWorkspaceRecord): Promise<void>;
    archive(workspaceId: string, archivedAt: string): Promise<void>;
    remove(workspaceId: string): Promise<void>;
}
type RegistryRecord = PersistedProjectRecord | PersistedWorkspaceRecord;
declare class FileBackedRegistry<TRecord extends RegistryRecord> {
    private readonly filePath;
    private readonly logger;
    private readonly schema;
    private readonly getId;
    private loaded;
    private readonly cache;
    private persistQueue;
    constructor(options: {
        filePath: string;
        logger: Logger;
        schema: z.ZodSchema<TRecord>;
        getId: (record: TRecord) => string;
        component: string;
    });
    initialize(): Promise<void>;
    existsOnDisk(): Promise<boolean>;
    list(): Promise<TRecord[]>;
    get(id: string): Promise<TRecord | null>;
    upsert(record: TRecord): Promise<void>;
    archive(id: string, archivedAt: string): Promise<void>;
    remove(id: string): Promise<void>;
    private load;
    private persist;
    private enqueuePersist;
}
export declare class FileBackedProjectRegistry extends FileBackedRegistry<PersistedProjectRecord> implements ProjectRegistry {
    constructor(filePath: string, logger: Logger);
}
export declare class FileBackedWorkspaceRegistry extends FileBackedRegistry<PersistedWorkspaceRecord> implements WorkspaceRegistry {
    constructor(filePath: string, logger: Logger);
}
export declare function createPersistedProjectRecord(input: {
    projectId: string;
    rootPath: string;
    kind: PersistedProjectKind;
    displayName: string;
    createdAt: string;
    updatedAt: string;
    archivedAt?: string | null;
    worktreeParentDir?: string | null;
}): PersistedProjectRecord;
export declare function createPersistedWorkspaceRecord(input: {
    workspaceId: string;
    projectId: string;
    cwd: string;
    kind: PersistedWorkspaceKind;
    displayName: string;
    createdAt: string;
    updatedAt: string;
    archivedAt?: string | null;
}): PersistedWorkspaceRecord;
export {};
//# sourceMappingURL=workspace-registry.d.ts.map