/**
 * PlanService — CRUD for automation plans.
 *
 * A plan holds a list of proposed tasks for a repository.
 * Each task can become a thread when the human approves and starts it.
 */
import type { JaitDB } from "../db/connection.js";
import { automationPlans } from "../db/schema.js";
import type { PlanStatus, PlanTask } from "@jait/shared/types";
export type { PlanStatus, PlanTask, PlanTaskStatus } from "@jait/shared/types";
export interface CreatePlanParams {
    repoId: string;
    userId?: string;
    title: string;
    tasks?: PlanTask[];
}
export interface UpdatePlanParams {
    title?: string;
    status?: PlanStatus;
    tasks?: PlanTask[];
}
export type PlanRow = typeof automationPlans.$inferSelect;
export interface PlanWithTasks extends Omit<PlanRow, "tasks"> {
    tasks: PlanTask[];
}
export declare function newTaskId(): string;
export declare class PlanService {
    private db;
    constructor(db: JaitDB);
    create(params: CreatePlanParams): PlanWithTasks;
    getById(id: string): PlanWithTasks | undefined;
    listByRepo(repoId: string): PlanWithTasks[];
    listByUser(userId: string): PlanWithTasks[];
    update(id: string, params: UpdatePlanParams): PlanWithTasks | undefined;
    /** Update a single task within a plan */
    updateTask(planId: string, taskId: string, patch: Partial<PlanTask>): PlanWithTasks | undefined;
    delete(id: string): void;
}
//# sourceMappingURL=plans.d.ts.map