import { type AutomationPolicyContext, type AutomationRunResult } from './runner';
export type AutomationScheduleKind = 'once' | 'interval' | 'cron';
export interface AutomationSchedule {
    kind: AutomationScheduleKind;
    display: string;
    runAt?: string;
    minutes?: number;
    expr?: string;
}
export interface AutomationJob {
    id: string;
    name: string;
    prompt: string;
    schedule: AutomationSchedule;
    scriptCommand?: string;
    createdAt: string;
    updatedAt: string;
    nextRunAt?: string;
    lastRunAt?: string;
    enabled: boolean;
}
export interface AutomationRunUpdate {
    outputPath?: string;
    success?: boolean;
    summary?: string;
}
export interface CreateAutomationJobInput {
    name: string;
    prompt: string;
    schedule: string;
    scriptCommand?: string;
}
export declare function parseAutomationSchedule(value: string, now?: Date): AutomationSchedule;
export declare function computeNextAutomationRun(schedule: AutomationSchedule, lastRunAt?: string, now?: Date): string | undefined;
export declare function createAutomationJob(projectDir: string, input: CreateAutomationJobInput, now?: Date): Promise<AutomationJob>;
export declare function listAutomationJobs(projectDir: string): Promise<AutomationJob[]>;
export declare function saveAutomationJobs(projectDir: string, jobs: AutomationJob[]): Promise<void>;
export declare function listDueAutomationJobs(projectDir: string, now?: Date): Promise<AutomationJob[]>;
export declare function markAutomationJobRun(projectDir: string, jobId: string, update?: AutomationRunUpdate, now?: Date): Promise<AutomationJob>;
export interface AutomationRunLogEntry {
    jobId: string;
    name?: string;
    ranAt: string;
    success?: boolean;
    outputPath?: string;
}
export declare function readAutomationRunLog(projectDir: string, limit?: number): Promise<AutomationRunLogEntry[]>;
export interface DueJobResult {
    jobId: string;
    name: string;
    run: AutomationRunResult;
    markedJob: AutomationJob;
}
export declare function deleteAutomationJob(projectDir: string, jobId: string): Promise<boolean>;
export interface UpdateAutomationJobInput {
    enabled?: boolean;
    name?: string;
    prompt?: string;
    schedule?: string;
    scriptCommand?: string | null;
}
export declare function updateAutomationJob(projectDir: string, jobId: string, input: UpdateAutomationJobInput, now?: Date): Promise<AutomationJob | null>;
export declare function executeDueJobs(projectDir: string, policy?: AutomationPolicyContext, now?: Date): Promise<DueJobResult[]>;
//# sourceMappingURL=jobs.d.ts.map