/**
 * Re-run handler for the orchestrator.
 *
 * Loads an original completed run, retrieves its webhook payload from
 * object storage, re-fetches the lock file at the original SHA, and
 * dispatches a new run with parent_run_id linkage.
 *
 * This is NOT a reuse of processWebhook -- it's a separate, simpler function
 * that skips dedup, normalization, trigger matching, and changed files fetching.
 * It goes directly to: lock file parse -> job expansion -> dispatch.
 */
import { type ColdStore } from '@kici-dev/shared';
import type { Kysely } from 'kysely';
import type { Database } from '../db/types.js';
import type { LogStorage } from '../reporting/log-storage.js';
import type { ProviderRegistry } from '../provider-registry.js';
import type { Dispatcher } from '../agent/dispatcher.js';
import type { ExecutionTracker } from '../reporting/execution-tracker.js';
import type { JobQueue } from '../queue/job-queue.js';
import type { PlatformClient } from '../ws/platform-client.js';
import type { CheckRunReporter } from '../reporting/check-run-reporter.js';
import type { RunCoordinator } from '../cluster/coordinator.js';
import type { SecretResolver } from '../secrets/secret-resolver.js';
import type { EventRouter } from '../events/event-router.js';
import type { AgentRegistry } from '../agent/registry.js';
import type { SourceCache } from '../cache/index.js';
import type { BuildCoordinator } from '../cache/index.js';
import type { DepCache } from '../cache/index.js';
import type { PendingBuildTracker } from '../cache/index.js';
/**
 * Thrown when a rerun is attempted on an archived run AND the cold-store
 * replay path failed (chunk missing, contentHash mismatch, S3 outage, or
 * cold-store probe disabled). Phase F replaced the Phase-C "rerun is
 * blocked" semantics with a real replay path; this error now signals
 * a genuine "we tried to bring the row back and could not".
 *
 * The WS dashboard handler maps this to a structured response that the
 * Platform proxy surfaces as HTTP 410 (`errorCode: 'runArchivedNotRerunnable'`).
 */
export declare class RunArchivedNotRerunnableError extends Error {
    readonly runId: string;
    readonly code: "runArchivedNotRerunnable";
    constructor(runId: string);
}
export interface RerunDeps {
    db: Kysely<Database>;
    logStorage: LogStorage;
    providerRegistry: ProviderRegistry;
    executionTracker: ExecutionTracker;
    dispatcher: Dispatcher;
    jobQueue: JobQueue;
    platformClient: PlatformClient | null;
    checkRunReporter: CheckRunReporter | null;
    coordinator: RunCoordinator | null;
    secretResolver: SecretResolver | null;
    eventRouter: EventRouter | null;
    agentRegistry: AgentRegistry;
    sourceCache: SourceCache | null;
    depCache: DepCache | null;
    buildCoordinator: BuildCoordinator | null;
    pendingBuilds: PendingBuildTracker | null;
    /**
     * Phase F — when set, a PG miss on `originalRunId` triggers a
     * cold-store replay of the chunk containing the row, then a re-read.
     * `null` keeps the legacy "throw RunArchivedNotRerunnableError on PG
     * miss" path for deployments without cold-store wired up.
     */
    coldStore: ColdStore | null;
}
export declare function handleRerun(originalRunId: string, triggeredBy: string | null, deps: RerunDeps, 
/**
 * Phase F — routing key for the original run, forwarded by Platform
 * via the WS `run.rerun.request` payload. Required to address the
 * cold-store chunk under the right tenant prefix.
 */
routingKeyHint?: string): Promise<{
    newRunId: string;
}>;
//# sourceMappingURL=rerun.d.ts.map