/**
 * First-class plan execution mode — attach plans to projects, materialize steps,
 * claim/execute one step at a time, track progress. Portable contract for hosted bridge.
 */
import type { Database } from "bun:sqlite";
import type { Task, TaskPriority } from "../types/index.js";
export declare const PLAN_EXECUTION_SCHEMA = "todos.plan_execution.v1";
export declare const PLAN_EXECUTION_MODES: readonly ["sequential", "parallel"];
export type PlanExecutionMode = (typeof PLAN_EXECUTION_MODES)[number];
export interface PlanStepInput {
    title: string;
    description?: string;
    priority?: TaskPriority;
    estimated_minutes?: number;
    tags?: string[];
}
export interface PlanExecutionManifest {
    schema_version: typeof PLAN_EXECUTION_SCHEMA;
    plan_id: string;
    plan_name: string;
    project_id: string | null;
    execution_mode: PlanExecutionMode;
    root_task_id: string;
    step_task_ids: string[];
    created_at: string;
}
export interface PlanExecutionState {
    schema_version: typeof PLAN_EXECUTION_SCHEMA;
    plan_id: string;
    plan_name: string;
    project_id: string | null;
    execution_mode: PlanExecutionMode;
    plan_status: string;
    total_steps: number;
    pending: number;
    in_progress: number;
    completed: number;
    failed: number;
    percent_complete: number;
    current_step: Task | null;
    ready_steps: Task[];
    steps: Array<{
        id: string;
        title: string;
        status: string;
        short_id: string | null;
        position: number;
    }>;
}
export interface AttachPlanInput {
    plan_id: string;
    project_id: string;
    execution_mode?: PlanExecutionMode;
}
export interface MaterializePlanInput {
    plan_id: string;
    steps: PlanStepInput[];
    execution_mode?: PlanExecutionMode;
    agent_id?: string;
}
export declare function resolvePlanRef(planRef: string, db?: Database): string | null;
export declare function attachPlanToProject(input: AttachPlanInput, db?: Database): PlanExecutionManifest;
export declare function materializePlanSteps(input: MaterializePlanInput, db?: Database): PlanExecutionManifest;
export declare function getPlanExecutionState(planRef: string, db?: Database): PlanExecutionState | null;
export declare function claimPlanStep(planRef: string, agentId: string, db?: Database): Task | null;
export declare function exportPlanExecutionContract(planRef: string, db?: Database): Record<string, unknown> | null;
export declare function createPlanWithSteps(name: string, steps: PlanStepInput[], opts?: {
    project_id?: string;
    execution_mode?: PlanExecutionMode;
    agent_id?: string;
}, db?: Database): PlanExecutionManifest;
//# sourceMappingURL=plan-execution.d.ts.map