import { Config } from '../config/index.js';
import type { JobData, JobExecution, JobExecutorDeps, CronMetrics, CronHealth, AddJobOptions, JobWithNextRun, CronRunHistoryRow } from './types.js';
export interface CronServiceConfig {
    filePath?: string;
    agentService?: any;
    messageBus?: any;
    /** Override run log directory (tests) */
    runsDir?: string;
}
export declare class CronService {
    private persistence;
    private executor;
    private runLogStore;
    private tasks;
    private initialized;
    private agentService;
    private messageBus;
    constructor(config?: CronServiceConfig);
    /**
     * Set dependencies for the executor
     */
    setDeps(deps: JobExecutorDeps): void;
    /**
     * Initialize the service and load all jobs
     */
    initialize(): Promise<void>;
    /**
     * Add a new job
     */
    addJob(schedule: string, options: AddJobOptions): Promise<{
        id: string;
        schedule: string;
    }>;
    /**
     * List all jobs with next run time
     */
    listJobs(): Promise<JobWithNextRun[]>;
    /**
     * Get a single job
     */
    getJob(id: string): Promise<JobData | null>;
    /**
     * Update a job
     */
    updateJob(id: string, updates: Partial<Omit<JobData, 'id' | 'created_at' | 'updated_at'>>): Promise<boolean>;
    /**
     * Remove a job
     */
    removeJob(id: string): Promise<boolean>;
    /**
     * Toggle job enabled state
     */
    toggleJob(id: string, enabled: boolean): Promise<boolean>;
    /**
     * Execution history for one job: merged in-memory (incl. running) + persisted JSONL.
     */
    getJobHistory(jobId: string, limit?: number): Promise<JobExecution[]>;
    /**
     * Latest runs across all jobs (persisted rows + optional job name).
     */
    getAllRunsHistory(limit?: number): Promise<CronRunHistoryRow[]>;
    /**
     * Get service metrics
     */
    getMetrics(): Promise<CronMetrics>;
    /**
     * Update config (hot reload)
     */
    updateConfig(_config: Config): void;
    /**
     * Health check
     */
    healthCheck(): Promise<CronHealth>;
    /**
     * Run a job immediately (manual trigger)
     */
    runJobNow(id: string): Promise<void>;
    /**
     * Stop all jobs and cleanup
     */
    stop(options?: {
        waitForRunning?: boolean;
        timeout?: number;
    }): Promise<void>;
    /**
     * Load and schedule all enabled jobs
     */
    private loadAllJobs;
    /**
     * Schedule a job with node-cron
     */
    private scheduleJob;
    /**
     * Execute a job with retry logic
     */
    private executeJob;
    /**
     * Cancel a scheduled task
     */
    private cancelTask;
}
