export declare const MAX_AGENT_TEAM_CONTINUATIONS = 60; export declare const MAX_AGENT_TEAM_NO_PROGRESS_CONTINUATIONS = 3; export declare const RUN_DISPATCH_STUCK_AFTER_MS = 15000; export declare const RUN_PROCESSING_STUCK_AFTER_MS: number; export declare const RUN_RECONCILIATION_RETRY_AFTER_MS = 60000; export type AgentTeamRunQueueStatus = "queued" | "running" | "done" | "failed"; export interface AgentTeamRunPayload { description: string; instructions?: string; model?: string; agentRef?: string; parentThreadId?: string; parentRunId?: string; name?: string; allowedActionNames?: string[]; noProgressCount?: number; hitContinuationLimit?: boolean; transcriptRunIds?: string[]; turnId: string; } export interface AgentTeamRunQueueRow { taskId: string; threadId: string; runId: string; status: AgentTeamRunQueueStatus; ownerEmail: string | null; orgId: string | null; payload: AgentTeamRunPayload; continuationCount: number; attempts: number; createdAt: number; updatedAt: number; } export declare const agentTeamRunQueueStore: import("../db/store-registry.js").Store; export declare function ensureTable(): Promise; declare function getAffectedRowCount(result: unknown): number; export interface EnqueueAgentTeamRunInput { taskId: string; threadId: string; runId: string; ownerEmail?: string | null; orgId?: string | null; payload: AgentTeamRunPayload; } export declare function enqueueAgentTeamRun(input: EnqueueAgentTeamRunInput): Promise; export declare function claimAgentTeamRun(taskId: string, options?: { stuckAfterMs?: number; }): Promise; export declare function touchAgentTeamRun(taskId: string, claimedAttempts?: number): Promise; export declare function bumpAgentTeamContinuation(taskId: string, claimedAttempts?: number, options?: { requeue?: boolean; }): Promise; export declare function requeueAgentTeamRunContinuation(taskId: string, claimedAttempts: number, payload?: AgentTeamRunPayload): Promise; export declare function withCurrentAgentTeamRunAttempt(taskId: string, claimedAttempts: number, write: () => Promise, options?: { statuses?: readonly AgentTeamRunQueueStatus[]; expectedUpdatedAt?: number; revokeExecutionLease?: boolean; }): Promise<{ current: false; } | { current: true; value: T; }>; export declare function persistAgentTeamRunEventIfCurrent(input: { taskId: string; claimedAttempts: number; runId: string; seq: number; eventData: string; terminal: boolean; }): Promise; export declare function completeAgentTeamRun(taskId: string, status: "done" | "failed", claimedAttempts?: number, payload?: AgentTeamRunPayload): Promise; export declare function completeAgentTeamRunIfCurrent(taskId: string, status: "done" | "failed", expected: Pick): Promise; export declare function listActiveAgentTeamTaskIdsForOwner(owner: string, limit?: number): Promise; export declare function listStaleActiveAgentTeamRuns(updatedBefore: number, limit?: number, reconciliationAttemptedBefore?: number): Promise>; export declare function claimAgentTeamRunReconciliationAttempt(taskId: string, updatedBefore: number, reconciliationAttemptedBefore: number, attemptedAt?: number): Promise; export declare function getAgentTeamRunDispatchState(taskId: string): Promise; export declare const _agentTeamRunQueueForTests: { resetInit(): void; getAffectedRowCount: typeof getAffectedRowCount; }; export {};