import type { TurnHandle } from '../../types/stream.js'; import type { RunOptions } from '../Runtime.js'; import type { RunStore } from './RunStore.js'; import type { RunRef } from './types.js'; export interface SweepRuntime { run(opts: RunOptions): TurnHandle; getRunStore(): RunStore; } export interface RecoverOrphanedRunsOptions { olderThan?: Date | number; } export interface RecoverOrphanedRunsReport { recovered: RunRef[]; skippedLive: number; } export interface SweepDeadlinesOptions { now?: Date | number; } /** * Re-enter `running` runs whose execution lease is stale (crashed replica). * Live leases are left alone. Re-entry is `Runtime.run({ sessionId, runId })` * — the same fail-closed resume path as any other addressed run. */ export declare function recoverOrphanedRuns(runtime: SweepRuntime, options?: RecoverOrphanedRunsOptions): Promise; /** * Deliver the timeout outcome to paused runs whose `waitingFor.deadline` is in * the past. InterruptRequest has no configured outcome field; the default is a * structured deny (`reason: 'deadline-expired'`) through signalDelivery. */ export declare function sweepDeadlines(runtime: SweepRuntime, options?: SweepDeadlinesOptions): Promise;