import type { CallbackAttemptOutcome } from "./callback-transport.js"; /** * Store-neutral claim metadata shared by durable callback and Watch outboxes. * Persistence adapters deliberately choose their own status names and fields. */ export interface DurableNotificationLease { attempt: number; attemptId: string; attemptedAt: string; leaseExpiresAt: string; } export declare function createDurableNotificationLease(input: { previousAttempts: number; attemptId: string; attemptedAt: string; leaseBaseMs: number; leaseMs: number; }): DurableNotificationLease; export type DurableNotificationRetryDecision = { state: "retryable"; attempt: number; } | { state: "waiting"; attempt: number; retry_at?: string; } | { state: "in_flight"; attempt: number; lease_expires_at?: string; } | { state: "non_retryable"; attempt: number; } | { state: "settled"; attempt: number; } | { state: "exhausted"; attempt: number; }; export type DurableNotificationRetryFacts = { phase: "ready"; attempt: number; maxAttempts?: number; } | { phase: "retry_wait"; attempt: number; nowMs: number; retryAt?: string; retryAuthorized: boolean; maxAttempts?: number; } | { phase: "leased"; attempt: number; nowMs: number; leaseExpiresAt?: string; maxAttempts?: number; } | { phase: "settled"; attempt: number; }; /** * Decide whether a durable notification attempt may be claimed. The caller * supplies only persisted facts plus its clock observation; no I/O or Store * shape is owned here. */ export declare function decideDurableNotificationRetry(facts: DurableNotificationRetryFacts): DurableNotificationRetryDecision; export type DurableNotificationSettlement = { state: "accepted"; outcome: Extract; } | { state: "superseded"; outcome: Exclude; } | { state: "failed"; outcome: Exclude; retryAuthorized: boolean; }; /** * Reduce one authoritative transport outcome into a Store-neutral settlement. * Conversation and Watch adapters retain their distinct status/error schemas. */ export declare function reduceDurableNotificationSettlement(input: { attempt: number; outcome: CallbackAttemptOutcome; retryEnabled: boolean; maxRetryAttempts?: number; supersede?: boolean; }): DurableNotificationSettlement;