import { type SessionRetryRequest, type SessionRetryResponse, type TurnExecutionPolicyV1 } from "@opengeni/contracts"; import { type Database, type SessionActivityDatabase } from "./database.js"; import * as schema from "./schema.js"; export declare class SessionRetryConflictError extends Error { readonly code: "RETRY_STALE_FAILURE" | "RETRY_EXECUTION_UNRESOLVED" | "RETRY_PAUSED" | "RETRY_SANDBOX_RECOVERY_REQUIRED" | "RETRY_TOOL_OUTCOME_UNKNOWN" | "RETRY_UNSUPPORTED_FAILURE"; constructor(code: "RETRY_STALE_FAILURE" | "RETRY_EXECUTION_UNRESOLVED" | "RETRY_PAUSED" | "RETRY_SANDBOX_RECOVERY_REQUIRED" | "RETRY_TOOL_OUTCOME_UNKNOWN" | "RETRY_UNSUPPORTED_FAILURE", message: string); } /** Authorized receipt reads precede mutable model/billing admission checks. */ export declare function getSessionRetryReceiptInTransaction(db: Database, input: { workspaceId: string; sessionId: string; subjectId: string; request: SessionRetryRequest; }): Promise; type EffectiveSandboxRecoveryBlocked = (db: Database, session: typeof schema.sessions.$inferSelect) => Promise; /** The root composition binds the canonical effective-route guard. Keep this * leaf independent of the root barrel; there is no permissive default. */ export declare function createRetryFailedSessionInTransaction(sessionEffectiveSandboxRecoveryBlocked: EffectiveSandboxRecoveryBlocked): (db: SessionActivityDatabase, input: Parameters[1]) => Promise<{ outcome: "accepted" | "replayed"; turnId: string; failureEventId: string; } & { eventIds: string[]; }>; /** Caller owns the tenant/activity transaction and authorization. No provider I/O. */ declare function retryFailedSessionInTransaction(db: SessionActivityDatabase, input: { accountId: string; workspaceId: string; sessionId: string; subjectId: string; request: SessionRetryRequest; executionPolicy: TurnExecutionPolicyV1; }, sessionEffectiveSandboxRecoveryBlocked: EffectiveSandboxRecoveryBlocked): Promise; export {};