/**
 * Milestone row parsed from an `M*.md` task file without sending full Markdown to the UI.
 */
interface DashboardTaskMilestoneSummary {
    filename: string;
    path: string;
    title: string;
    status: string;
    objective: string;
    totalTasks: number;
    completedTasks: number;
    modifiedAt: string;
}
/**
 * Task-plan row for the dashboard plan picker; `modifiedAt` comes from the newest milestone.
 */
interface DashboardTaskPlanSummary extends Record<"active", boolean> {
    name: string;
    path: string;
    modifiedAt: string;
    milestoneCount: number;
}
/**
 * Task browser response where `.active` is advisory and may name a missing plan.
 */
export interface DashboardTaskState {
    planRoot: string;
    /** Deprecated compatibility alias for callers still reading the old field name. */
    taskRoot: string;
    exists: boolean;
    active: string | null;
    activeExists: boolean;
    selectedPlan: string | null;
    plans: DashboardTaskPlanSummary[];
    milestones: DashboardTaskMilestoneSummary[];
}
export declare function buildDashboardTaskState(projectPath: string, requestedPlan: string | null): DashboardTaskState;
/**
 * Extract and validate the active task-plan name from the dashboard request body. Throws when
 * `body.plan` is missing, blank, or not a safe top-level plan name, so a malformed POST cannot select
 * or escape into an unintended directory.
 *
 * @param body - raw request body; must be JSON with a non-empty string `plan` field
 * @returns the trimmed, validated plan name guaranteed to be a single top-level directory segment
 */
export declare function readActiveTaskPlanBody(body: string): string;
/**
 * Persist the selected plan by writing the `.active` marker, but only for a plan that already
 * exists, so the dashboard can switch the active plan without ever creating task structure. Throws
 * when the plans directory is absent or the requested plan does not exist.
 *
 * @param projectPath - absolute project root whose `.goat-flow/plans` directory holds the plans
 * @param planName - validated top-level plan directory name to mark active; must already exist on disk
 */
export declare function writeActiveTaskPlan(projectPath: string, planName: string): void;
export {};
//# sourceMappingURL=dashboard-task-state.d.ts.map