export type PipeDispatchMode = 'current' | 'historical' | 'test' | 'validate' | 'stage' | 'verify-stage'; export interface PipeGrantInputs { source: string; mode: PipeDispatchMode; code_ref: string; force: boolean; resume_upload: boolean; limit: string; recovery_run_id: string; candidate_id: string; } export interface PipeDispatchInputs { source: string; mode: PipeDispatchMode; code_ref: string; pipe_token: string; request_id: string; force: 'true' | 'false'; resume_upload: 'true' | 'false'; limit: string; recovery_run_id: string; candidate_id: string; } export interface WorkflowRunSummary { databaseId: number; displayTitle: string; status: string; conclusion: string | null; url: string; } export interface WorkflowRunState { attempt: number; status: string; conclusion: string | null; url: string; createdAt: string; updatedAt: string; } export interface WorkflowArtifactSummary { id: number; name: string; expired: boolean; } export declare const MAX_UPSTREAM_DEFER_ATTEMPTS = 12; export declare function upstreamQueueKey(inputs: PipeGrantInputs): string; export declare function deferredQueueKey(name: string): string | null; export declare function deferredMarkerAttempt(name: string): number | null; export declare function canAttachToDeferredRun(markerAttempt: number, state: WorkflowRunState, duplicateCreatedAt: string): boolean; export declare function selectDeferredUpstreamArtifact(artifacts: WorkflowArtifactSummary[], runId: number, attempt: number): WorkflowArtifactSummary | null; export declare function workflowDispatchArgs(repo: string): string[]; export declare function workflowDispatchInputs(inputs: PipeGrantInputs, pipeToken: string, requestId: string): PipeDispatchInputs; export declare function selectPipeWorkflowRun(runs: WorkflowRunSummary[], requestId: string): WorkflowRunSummary | null; export declare function assertSafePipeRef(ref: string): void;