import { readAcpSessionEntry } from "../acp/runtime/session-meta.js";
import { loadSessionStore, resolveStorePath } from "../config/sessions.js";
import { isCronJobActive } from "../cron/active-jobs.js";
import { readCronRunLogEntriesSync, resolveCronRunLogPath } from "../cron/run-log.js";
import type { CronRunLogEntry } from "../cron/run-log.js";
import { loadCronStoreSync, resolveCronStorePath } from "../cron/store.js";
import type { CronStoreFile } from "../cron/types.js";
import { getAgentRunContext } from "../infra/agent-events.js";
import { parseAgentSessionKey } from "../routing/session-key.js";
import { deleteTaskRecordById, ensureTaskRegistryReady, getTaskById, listTaskRecords, markTaskLostById, markTaskTerminalById, maybeDeliverTaskTerminalUpdate, resolveTaskForLookupToken, setTaskCleanupAfterById } from "./runtime-internal.js";
import type { TaskAuditSummary } from "./task-registry.audit.js";
import type { TaskRecord, TaskRegistrySummary } from "./task-registry.types.js";
type TaskRegistryMaintenanceRuntime = {
    readAcpSessionEntry: typeof readAcpSessionEntry;
    loadSessionStore: typeof loadSessionStore;
    resolveStorePath: typeof resolveStorePath;
    isCronJobActive: typeof isCronJobActive;
    getAgentRunContext: typeof getAgentRunContext;
    parseAgentSessionKey: typeof parseAgentSessionKey;
    deleteTaskRecordById: typeof deleteTaskRecordById;
    ensureTaskRegistryReady: typeof ensureTaskRegistryReady;
    getTaskById: typeof getTaskById;
    listTaskRecords: typeof listTaskRecords;
    markTaskLostById: typeof markTaskLostById;
    markTaskTerminalById: typeof markTaskTerminalById;
    maybeDeliverTaskTerminalUpdate: typeof maybeDeliverTaskTerminalUpdate;
    resolveTaskForLookupToken: typeof resolveTaskForLookupToken;
    setTaskCleanupAfterById: typeof setTaskCleanupAfterById;
    isCronRuntimeAuthoritative: () => boolean;
    resolveCronStorePath: typeof resolveCronStorePath;
    loadCronStoreSync: typeof loadCronStoreSync;
    resolveCronRunLogPath: typeof resolveCronRunLogPath;
    readCronRunLogEntriesSync: typeof readCronRunLogEntriesSync;
};
export type TaskRegistryMaintenanceSummary = {
    reconciled: number;
    recovered: number;
    cleanupStamped: number;
    pruned: number;
};
type CronRecoveryContext = {
    storePath: string;
    store?: CronStoreFile | null;
    runLogsByJobId: Map<string, CronRunLogEntry[]>;
};
export declare function reconcileTaskRecordForOperatorInspection(task: TaskRecord, context?: CronRecoveryContext): TaskRecord;
export declare function reconcileInspectableTasks(): TaskRecord[];
export declare function getInspectableTaskRegistrySummary(): TaskRegistrySummary;
export declare function getInspectableTaskAuditSummary(): TaskAuditSummary;
export declare function reconcileTaskLookupToken(token: string): TaskRecord | undefined;
export declare function previewTaskRegistryMaintenance(): TaskRegistryMaintenanceSummary;
export declare function runTaskRegistryMaintenance(): Promise<TaskRegistryMaintenanceSummary>;
export declare function sweepTaskRegistry(): Promise<TaskRegistryMaintenanceSummary>;
export declare function startTaskRegistryMaintenance(): void;
export declare function stopTaskRegistryMaintenance(): void;
export declare const stopTaskRegistryMaintenanceForTests: typeof stopTaskRegistryMaintenance;
export declare function setTaskRegistryMaintenanceRuntimeForTests(runtime: TaskRegistryMaintenanceRuntime): void;
export declare function resetTaskRegistryMaintenanceRuntimeForTests(): void;
export declare function configureTaskRegistryMaintenance(options: {
    cronStorePath?: string;
    cronRuntimeAuthoritative?: boolean;
}): void;
export declare function getReconciledTaskById(taskId: string): TaskRecord | undefined;
export {};
