import { type StoragePolicy } from "./storage-policy.js";
export interface ScheduledTask {
    id: string;
    name: string;
    cron: string;
    prompt: string;
    storagePolicies?: StoragePolicy[];
    storagePolicyMode?: "auto" | "off";
    skillRef?: string;
    /** IANA timezone for this task's cron (e.g. "UTC", "Asia/Shanghai"). Falls back to scheduler default. */
    timezone?: string;
    enabled: boolean;
    lastRun?: string;
    lastStatus?: "ok" | "error";
    /** Total number of runs */
    runCount?: number;
    /** Number of successful runs */
    successCount?: number;
}
export type TaskHandler = (task: ScheduledTask) => Promise<void>;
export declare class Scheduler {
    private tasksFile;
    private jobs;
    private handler;
    private startedAt;
    private defaultTimezone?;
    constructor(workspace: string, defaultTimezone?: string);
    setHandler(handler: TaskHandler): void;
    /** Load tasks from disk and start enabled cron jobs */
    start(): void;
    stop(): void;
    loadTasks(): ScheduledTask[];
    private saveTasks;
    addTask(name: string, cronExpr: string, prompt: string, timezone?: string): ScheduledTask;
    removeTask(id: string): boolean;
    updateTask(id: string, patch: {
        name?: string;
        cron?: string;
        prompt?: string;
        timezone?: string;
        enabled?: boolean;
        storagePolicyMode?: "auto" | "off";
    }): ScheduledTask | null;
    toggleTask(id: string, enabled: boolean): ScheduledTask | null;
    updateTaskStatus(id: string, status: "ok" | "error"): void;
    linkSkill(taskId: string, skillRef: string): boolean;
    getTask(id: string): ScheduledTask | undefined;
    getNextRun(): Date | null;
    formatTaskList(): string;
    private scheduleJob;
}
