export declare const MAX_PENDING_TASK_ATTEMPTS = 3; export declare const MAX_RECOVERABLE_PENDING_TASK_AGE_MS: number; export declare class PendingTaskPayloadNotPersistableError extends Error { readonly code = "pending_task_attachment_not_persistable"; constructor(); } export declare const pendingTasksStore: import("../db/store-registry.js").Store; export declare function ensurePendingTasksTable(): Promise; export type PendingTaskStatus = "pending" | "processing" | "completed" | "failed"; export interface PendingTask { id: string; platform: string; externalThreadId: string; payload: string; ownerEmail: string; orgId: string | null; status: PendingTaskStatus; attempts: number; dispatchAttempts: number; lastDispatchAt: number | null; lastDispatchOutcome: string | null; dispatchScope: string | null; errorMessage: string | null; createdAt: number; updatedAt: number; completedAt: number | null; } export declare function insertPendingTask(input: { id: string; platform: string; externalThreadId: string; payload: string; ownerEmail: string; orgId?: string | null; externalEventKey?: string | null; dispatchScope?: string | null; }): Promise; export declare function isDuplicateEventError(err: unknown): boolean; export declare function getPendingTask(id: string): Promise; export interface ResolvedIntegrationSourceContext { platform: "slack"; sourceUrl: string; } type PendingTaskSourceRow = Pick; export declare function sourceContextFromPendingTask(task: PendingTaskSourceRow | null, ownerEmail: string, orgId: string | null): ResolvedIntegrationSourceContext | null; export declare function resolveIntegrationSourceContext(id: string, ownerEmail: string, orgId: string | null): Promise; export declare function claimPendingTask(id: string, options?: { dispatchOutcome?: string; }): Promise; export declare function recordPendingTaskDispatchAttempt(id: string, outcome: string): Promise; export declare function getNextPendingTaskForThread(platform: string, externalThreadId: string): Promise<{ id: string; dispatchScope: string | null; } | null>; export declare function markTaskCompleted(id: string): Promise; export declare function markTaskRetryable(id: string, errorMessage: string, options?: { resetAttempts?: boolean; }): Promise; export declare function stageTaskDeliveryPayload(id: string, payload: string): Promise; export declare function markTaskDeliveryRetryable(id: string, payload: string, errorMessage: string): Promise; export declare function failTaskDeliveryTransition(id: string, errorMessage: string): Promise; export declare function markTaskFailed(id: string, errorMessage: string): Promise; export {};