import type { RuntimeBoardData, RuntimeProjectSummary, RuntimeProjectTaskCounts, RuntimeWorkspaceStateResponse } from "../core/api-contract.js";
import type { RuntimeConfigState } from "../config/runtime-config.js";
import { TerminalSessionManager } from "../terminal/session-manager.js";
export interface WorkspaceRegistryScope {
    workspaceId: string;
    workspacePath: string;
}
export interface CreateWorkspaceRegistryDependencies {
    cwd: string;
    loadRuntimeConfig: (cwd: string) => Promise<RuntimeConfigState>;
    hasGitRepository: (path: string) => boolean;
    pathIsDirectory: (path: string) => Promise<boolean>;
    onTerminalManagerReady?: (workspaceId: string, manager: TerminalSessionManager) => void;
}
export interface DisposeWorkspaceRegistryOptions {
    stopTerminalSessions?: boolean;
}
export interface ResolvedWorkspaceStreamTarget {
    workspaceId: string | null;
    workspacePath: string | null;
    removedRequestedWorkspacePath: string | null;
    didPruneProjects: boolean;
}
export interface RemovedWorkspaceNotice {
    workspaceId: string;
    repoPath: string;
    message: string;
}
export interface WorkspaceRegistry {
    getActiveWorkspaceId: () => string | null;
    getActiveWorkspacePath: () => string | null;
    getWorkspacePathById: (workspaceId: string) => string | null;
    rememberWorkspace: (workspaceId: string, repoPath: string) => void;
    getActiveRuntimeConfig: () => RuntimeConfigState;
    setActiveRuntimeConfig: (config: RuntimeConfigState) => void;
    loadScopedRuntimeConfig: (scope: WorkspaceRegistryScope) => Promise<RuntimeConfigState>;
    getTerminalManagerForWorkspace: (workspaceId: string) => TerminalSessionManager | null;
    ensureTerminalManagerForWorkspace: (workspaceId: string, repoPath: string) => Promise<TerminalSessionManager>;
    setActiveWorkspace: (workspaceId: string, repoPath: string) => Promise<void>;
    clearActiveWorkspace: () => void;
    disposeWorkspace: (workspaceId: string, options?: DisposeWorkspaceRegistryOptions) => {
        terminalManager: TerminalSessionManager | null;
        workspacePath: string | null;
    };
    summarizeProjectTaskCounts: (workspaceId: string, repoPath: string) => Promise<RuntimeProjectTaskCounts>;
    createProjectSummary: (input: {
        workspaceId: string;
        repoPath: string;
        taskCounts: RuntimeProjectTaskCounts;
    }) => RuntimeProjectSummary;
    buildWorkspaceStateSnapshot: (workspaceId: string, workspacePath: string) => Promise<RuntimeWorkspaceStateResponse>;
    buildProjectsPayload: (preferredCurrentProjectId: string | null) => Promise<{
        currentProjectId: string | null;
        projects: RuntimeProjectSummary[];
    }>;
    resolveWorkspaceForStream: (requestedWorkspaceId: string | null, options?: {
        onRemovedWorkspace?: (workspace: RemovedWorkspaceNotice) => void;
    }) => Promise<ResolvedWorkspaceStreamTarget>;
    listManagedWorkspaces: () => Array<{
        workspaceId: string;
        workspacePath: string | null;
        terminalManager: TerminalSessionManager;
    }>;
}
export declare function collectProjectWorktreeTaskIdsForRemoval(board: RuntimeBoardData): Set<string>;
export declare function createWorkspaceRegistry(deps: CreateWorkspaceRegistryDependencies): Promise<WorkspaceRegistry>;
//# sourceMappingURL=workspace-registry.d.ts.map