import { type CronRunLogEntry } from "./run-log.js";
import { type CronTaskRunQueueItem, type CronTaskRunQueueStepResumeState, type CronTaskRunQueueStepRetryPolicy, type CronTaskRunQueueStep, type CronTaskRunQueueStepStatus, type CronTaskRunQueueStatus } from "./task-run-queue.js";
import type { CronJob, CronRunStatus, CronTaskRepairRecoveryAction, CronTaskGraphRepairReplay, CronTaskWorkflowGraph } from "./types.js";
export type CronTaskRunDetailControls = {
    canCancel: boolean;
    canRetry: boolean;
    canClearStaleLease: boolean;
};
export type CronTaskRunDetailExecution = {
    source?: "model" | "direct-tool" | "direct-text" | "queue";
    adapter?: string;
    modelUsed?: boolean;
    model?: string;
    modelSource?: string;
    provider?: string;
    deliveryStatus?: string;
    delivered?: boolean;
    summary?: string;
    error?: string;
    durationMs?: number;
    usage?: CronRunLogEntry["usage"];
};
export type CronTaskRunRepairRecommendation = {
    action: CronTaskRepairRecoveryAction;
    label: string;
    reason: string;
    priority: "primary" | "secondary";
    sourceNodeId?: string;
    setupPath?: string;
    setupCommand?: string;
    requiresInput?: "trusted_source";
};
export type CronTaskRunStepControlAction = "cancel" | "retry" | "clear-stale";
export type CronTaskRunStepControl = {
    available: true;
    action: CronTaskRunStepControlAction;
    label: string;
    reason: string;
} | {
    available: false;
    label: string;
    reason: string;
};
export type CronTaskRunStepDetail = {
    id: string;
    status: CronTaskRunQueueStepStatus;
    attempt: number;
    maxAttempts: number;
    retryPolicy?: CronTaskRunQueueStepRetryPolicy;
    nextRetryAtMs?: number;
    resume?: CronTaskRunQueueStepResumeState;
    createdAtMs: number;
    startedAtMs?: number;
    completedAtMs?: number;
    durationMs?: number;
    leaseOwner?: string;
    leaseExpiresAtMs?: number;
    leaseExpired: boolean;
    leaseRemainingMs?: number;
    checkpoint?: Record<string, unknown>;
    error?: string;
    control: CronTaskRunStepControl;
};
export type CronTaskRunDetail = {
    runId: string;
    jobId: string;
    jobName: string;
    agentId?: string;
    sessionKey?: string;
    status: CronTaskRunQueueStatus | CronRunStatus | "unknown";
    trigger?: string;
    queuedAtMs?: number;
    startedAtMs?: number;
    completedAtMs?: number;
    updatedAtMs?: number;
    error?: string;
    queueRun?: CronTaskRunQueueItem;
    job?: CronJob;
    logEntry?: CronRunLogEntry;
    activeStep?: CronTaskRunQueueStep;
    stepDetails: CronTaskRunStepDetail[];
    leaseExpired: boolean;
    controls: CronTaskRunDetailControls;
    recommendedRepairActions?: CronTaskRunRepairRecommendation[];
    execution: CronTaskRunDetailExecution;
    workflowGraph?: CronTaskWorkflowGraph;
    repairReplay?: CronTaskGraphRepairReplay;
    transcriptPath?: string;
};
export declare function readCronTaskRunDetail(params: {
    storePath: string;
    runId: string;
    nowMs: number;
    jobs?: CronJob[];
}): Promise<CronTaskRunDetail | null>;
