import type { ACPSessionRecord, ACPState } from '@coralai/claude-code-agent';
import { type ActiveCardState, type RuntimeState, type TaskLease, type WorkerSlotState, type WorktreeEvidence } from './state.js';
export interface TaskRuntimeView {
    seq: string;
    lease: TaskLease | null;
    evidence: WorktreeEvidence | null;
    activeCard: ActiveCardState | null;
    slotName: string | null;
    slot: WorkerSlotState | null;
    session: ACPSessionRecord | null;
}
type RuntimePaths = {
    paths: {
        stateFile: string;
        acpStateFile?: string;
    };
    maxWorkers: number;
};
export declare class RuntimeStore {
    private readonly ctx;
    private migrated;
    constructor(ctx: RuntimePaths);
    readState(): RuntimeState;
    /**
     * @deprecated Use readState().sessions instead.
     * Compat shim — returns a thin view backed by RuntimeState.sessions.
     */
    readACPState(): ACPState;
    /**
     * @deprecated Use readState() instead.
     * Compat shim — both state and acpState reference the same underlying data.
     */
    read(): {
        state: RuntimeState;
        acpState: ACPState;
    };
    updateState(updatedBy: string, mutator: (state: RuntimeState) => void): RuntimeState;
    /**
     * @deprecated Use updateState() and mutate state.sessions instead.
     * Compat shim — mutates state.sessions through a thin ACPState view, then writes state.json.
     */
    updateACPState(updatedBy: string, mutator: (acpState: ACPState) => void): ACPState;
    /**
     * @deprecated Use updateState() instead.
     * Compat shim — applies mutator to both state and a thin acpState view, writes single file.
     */
    updateRuntime(updatedBy: string, mutator: (state: RuntimeState, acpState: ACPState) => void): {
        state: RuntimeState;
        acpState: ACPState;
    };
    getTask(seq: string, state?: RuntimeState): TaskRuntimeView;
    findSlotForTask(seq: string, state: RuntimeState): string | null;
    findAvailableSlot(state: RuntimeState, options?: {
        preferred?: string | null;
        exclude?: Set<string>;
    }): string | null;
    clearWorkerSlot(state: RuntimeState, slotName: string): void;
    releaseTaskProjection(state: RuntimeState, seq: string, options?: {
        dropLease?: boolean;
        phase?: TaskLease['phase'];
        keepWorktree?: boolean;
        pmStateObserved?: TaskLease['pmStateObserved'];
    }): void;
    /**
     * One-time migration: if state.sessions is empty and the legacy acp-state.json exists,
     * merge its sessions into state and persist.
     */
    private migrateACPStateOnce;
}
export {};
//# sourceMappingURL=runtimeStore.d.ts.map