/**
 * CronManager — minimal 5-field cron scheduler.
 *
 * Story 5.1 — OpenLife v1.3 Agent OS Integration.
 *
 * 5-field cron syntax: `minute hour day-of-month month day-of-week`
 *   - * (any)
 *   - n (literal)
 *   - n-m (range)
 *   - n,m (list)
 *   - * /n (step)
 *
 * Storage: `.openlife/crons.json` (atomic via AtomicWriter).
 *
 * Lifecycle: jobs are persisted; start() polls every 30s (or
 * tickIntervalMs) and fires any job whose due-time falls inside the
 * last interval. Idempotent start/stop.
 *
 * The trigger payload is dispatched via an optional `executor` callback
 * supplied at construction time. By default, the cron only logs the fire
 * event to `.openlife/cron-events.jsonl` — operators can wire QueueScheduler
 * or any other dispatcher.
 */
export interface CronJob {
    id: string;
    expression: string;
    payload: Record<string, unknown>;
    status: 'active' | 'paused';
    createdAt: string;
    lastFiredAt?: string;
}
export interface CronExecutor {
    execute(job: CronJob): Promise<void> | void;
}
export interface CronManagerOptions {
    stateDir?: string;
    tickIntervalMs?: number;
    executor?: CronExecutor;
}
export declare class CronManager {
    private readonly file;
    private readonly eventsFile;
    private readonly tickIntervalMs;
    private readonly executor?;
    private timer;
    private lastTickAt;
    constructor(opts?: CronManagerOptions);
    private read;
    private write;
    list(): CronJob[];
    create(id: string, expression: string, payload?: Record<string, unknown>): CronJob;
    remove(id: string): boolean;
    pause(id: string): boolean;
    resume(id: string): boolean;
    private setStatus;
    /** Manually fire a job (regardless of schedule). */
    runNow(id: string): Promise<{
        ok: boolean;
        error?: string;
    }>;
    start(): void;
    stop(): void;
    /** Run one tick — fire any active jobs whose due-time falls in the last interval. */
    tick(now?: Date): Promise<string[]>;
    private fire;
}
export interface CronFields {
    minutes: Set<number>;
    hours: Set<number>;
    daysOfMonth: Set<number>;
    months: Set<number>;
    daysOfWeek: Set<number>;
}
export interface CronParseResult {
    ok: boolean;
    fields?: CronFields;
    error?: string;
}
export declare function parseCronExpression(expr: string): CronParseResult;
export declare function matchesCron(fields: CronFields, d: Date): boolean;
