import type { FileHeartbeatTaskRepositoryOptions, HeartbeatTask, HeartbeatTaskRunRecord, HeartbeatTaskRunRecordEntry, HeartbeatTaskStore } from './types.js';
import type { HeartbeatRunView, HeartbeatTaskView } from '../views/index.js';
export type FileHeartbeatTaskServiceOptions = {
    stateRoot: string;
} | {
    workspaceRoot: string;
    stateDir?: string;
} | FileHeartbeatTaskRepositoryOptions;
export type CreateHeartbeatTaskInput = {
    workspaceId?: string;
    id?: string;
    name?: string;
    task: string;
    enabled?: boolean;
    continuationMode?: HeartbeatTask['continuationMode'];
    intervalMs?: number;
    defer?: boolean;
    model?: string;
    maxSteps?: number;
    workspaceRoot?: string;
    stateDir?: string;
    searchIgnoreDirs?: string[];
    systemContext?: string;
};
export type UpdateHeartbeatTaskInput = {
    name?: string;
    task?: string;
    enabled?: boolean;
    continuationMode?: HeartbeatTask['continuationMode'];
    intervalMs?: number;
    model?: string | null;
    maxSteps?: number | null;
    searchIgnoreDirs?: string[];
    systemContext?: string;
};
/**
 * Heartbeat task service.
 *
 * This is the persistence boundary for durable heartbeat tasks, checkpoints,
 * run records, and operator-facing task/run projections. Hosts should call this
 * service, not the file repository.
 */
export declare class FileHeartbeatTaskService implements HeartbeatTaskStore {
    private readonly repository;
    constructor(options: FileHeartbeatTaskServiceOptions);
    listTasks(): Promise<HeartbeatTask[]>;
    saveTask(task: HeartbeatTask): Promise<void>;
    loadCheckpoint(task: HeartbeatTask): Promise<import("../../../index.js").AgentLoopCheckpoint | undefined>;
    saveCheckpoint(task: HeartbeatTask, checkpoint: Parameters<HeartbeatTaskStore['saveCheckpoint']>[1]): Promise<void>;
    saveRunRecord(record: Parameters<NonNullable<HeartbeatTaskStore['saveRunRecord']>>[0]): Promise<void>;
    listRunRecords(options?: Parameters<NonNullable<HeartbeatTaskStore['listRunRecords']>>[0]): Promise<HeartbeatTaskRunRecordEntry[]>;
    loadRunRecord(id: string): Promise<HeartbeatTaskRunRecordEntry | undefined>;
    listTaskViews(): Promise<HeartbeatTaskView[]>;
    listRunViews(options?: {
        taskId?: string;
        limit?: number;
    }): Promise<HeartbeatRunView[]>;
    createTask(input: CreateHeartbeatTaskInput): Promise<HeartbeatTaskView>;
    updateTask(taskId: string, input: UpdateHeartbeatTaskInput): Promise<HeartbeatTaskView>;
    deleteTask(taskId: string): Promise<HeartbeatTaskView>;
    resumeTask(taskId: string): Promise<HeartbeatTaskView>;
    readTask(taskId: string, options?: {
        runLimit?: number;
    }): Promise<{
        task: HeartbeatTaskView;
        runs: HeartbeatRunView[];
    }>;
    readRun(taskId: string, runId: string): Promise<HeartbeatRunView | undefined>;
    setTaskEnabled(taskId: string, enabled: boolean): Promise<HeartbeatTaskView>;
    triggerTaskRun(taskId: string): Promise<HeartbeatTaskView>;
    requireTask(taskId: string): Promise<HeartbeatTask>;
    projectTaskView(task: HeartbeatTask): HeartbeatTaskView;
    projectRunView(run: HeartbeatTaskRunRecordEntry): HeartbeatRunView;
    static projectTaskView(task: HeartbeatTask): HeartbeatTaskView;
    static projectRunView(run: HeartbeatTaskRunRecordEntry): HeartbeatRunView;
    static projectRunRecordView(record: HeartbeatTaskRunRecord): HeartbeatRunView;
    private static projectTaskStateView;
    private static projectResultView;
    private static taskLastRunTime;
    private static resolveTaskEnabledStatus;
    private static resolveTaskEnabledProgress;
    private static resolveHeartbeatRoot;
    private static createTaskId;
}
//# sourceMappingURL=service.d.ts.map