import { z } from 'zod'; import type { DappEventSubscriptionState } from './eventSubscription.ts'; export declare const DappEventWakeOutboxStateSchema: "network.xyo.dapp.event.wake.outbox.state" & { readonly __schema: true; }; export declare const DappEventWakeGenerationZod: z.ZodNumber; export declare const DappEventWakeDispatchLimitZod: z.ZodNumber; export declare const DappEventWakeOutboxScopeZod: z.ZodObject<{ streamId: z.ZodString; partitionId: z.ZodString; subscriptionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; }, z.core.$strict>; export type DappEventWakeOutboxScope = z.infer; export declare const DappEventWakeOutboxClearStateZod: z.ZodObject<{ status: z.ZodLiteral<"clear">; generation: z.ZodNumber; streamId: z.ZodString; partitionId: z.ZodString; subscriptionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; schema: z.ZodLiteral<"network.xyo.dapp.event.wake.outbox.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>; export declare const DappEventWakeOutboxPendingStateZod: z.ZodObject<{ status: z.ZodLiteral<"pending">; requestedCursor: z.ZodNumber; observedTail: z.ZodNumber; generation: z.ZodNumber; streamId: z.ZodString; partitionId: z.ZodString; subscriptionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; schema: z.ZodLiteral<"network.xyo.dapp.event.wake.outbox.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>; export declare const DappEventWakeOutboxStateZod: z.ZodDiscriminatedUnion<[z.ZodObject<{ status: z.ZodLiteral<"clear">; generation: z.ZodNumber; streamId: z.ZodString; partitionId: z.ZodString; subscriptionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; schema: z.ZodLiteral<"network.xyo.dapp.event.wake.outbox.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>, z.ZodObject<{ status: z.ZodLiteral<"pending">; requestedCursor: z.ZodNumber; observedTail: z.ZodNumber; generation: z.ZodNumber; streamId: z.ZodString; partitionId: z.ZodString; subscriptionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; schema: z.ZodLiteral<"network.xyo.dapp.event.wake.outbox.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>], "status">; export type DappEventWakeOutboxState = z.infer; export type DappEventWakeOutboxClearState = z.infer; export type DappEventWakeOutboxPendingState = z.infer; export declare const DappEventSubscriptionWakeRequestResultZod: z.ZodObject<{ subscription: z.ZodDiscriminatedUnion<[z.ZodObject<{ status: z.ZodLiteral<"idle">; cursor: z.ZodNumber; fenceEpoch: z.ZodNumber; retryCount: z.ZodNumber; subscriptionId: z.ZodString; streamId: z.ZodString; partitionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; retryLimit: z.ZodNumber; schema: z.ZodLiteral<"network.xyo.dapp.event.subscription.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>, z.ZodObject<{ status: z.ZodLiteral<"scheduled">; cursor: z.ZodNumber; fenceEpoch: z.ZodNumber; retryCount: z.ZodNumber; subscriptionId: z.ZodString; streamId: z.ZodString; partitionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; retryLimit: z.ZodNumber; schema: z.ZodLiteral<"network.xyo.dapp.event.subscription.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>, z.ZodObject<{ status: z.ZodLiteral<"running">; leaseExpiresAt: z.ZodNumber; cursor: z.ZodNumber; fenceEpoch: z.ZodNumber; retryCount: z.ZodNumber; subscriptionId: z.ZodString; streamId: z.ZodString; partitionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; retryLimit: z.ZodNumber; schema: z.ZodLiteral<"network.xyo.dapp.event.subscription.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>, z.ZodObject<{ status: z.ZodLiteral<"blocked">; blockedRecord: z.ZodObject<{ sequence: z.ZodNumber; eventId: z.ZodString; eventFingerprint: z.ZodString; reasonCode: z.ZodString; }, z.core.$strict>; cursor: z.ZodNumber; fenceEpoch: z.ZodNumber; retryCount: z.ZodNumber; subscriptionId: z.ZodString; streamId: z.ZodString; partitionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; retryLimit: z.ZodNumber; schema: z.ZodLiteral<"network.xyo.dapp.event.subscription.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>], "status">; outbox: z.ZodDiscriminatedUnion<[z.ZodObject<{ status: z.ZodLiteral<"clear">; generation: z.ZodNumber; streamId: z.ZodString; partitionId: z.ZodString; subscriptionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; schema: z.ZodLiteral<"network.xyo.dapp.event.wake.outbox.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>, z.ZodObject<{ status: z.ZodLiteral<"pending">; requestedCursor: z.ZodNumber; observedTail: z.ZodNumber; generation: z.ZodNumber; streamId: z.ZodString; partitionId: z.ZodString; subscriptionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; schema: z.ZodLiteral<"network.xyo.dapp.event.wake.outbox.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>], "status">; }, z.core.$strict>; export interface DappEventSubscriptionWakeRequestResult { readonly outbox: DappEventWakeOutboxState; readonly subscription: DappEventSubscriptionState; } export declare const DappEventSubscriptionWakePortRequestInputZod: z.ZodObject<{ observedTail: z.ZodNumber; subscriptionId: z.ZodString; }, z.core.$strict>; export declare const DappEventSubscriptionWakePortPendingInputZod: z.ZodObject<{ limit: z.ZodNumber; }, z.core.$strict>; export declare const DappEventSubscriptionWakePortCompleteInputZod: z.ZodObject<{ expected: z.ZodObject<{ status: z.ZodLiteral<"pending">; requestedCursor: z.ZodNumber; observedTail: z.ZodNumber; generation: z.ZodNumber; streamId: z.ZodString; partitionId: z.ZodString; subscriptionId: z.ZodString; consumerId: z.ZodString; consumerVersion: z.ZodString; schema: z.ZodLiteral<"network.xyo.dapp.event.wake.outbox.state" & { readonly __schema: true; }>; schemaVersion: z.ZodLiteral<1>; }, z.core.$strict>; }, z.core.$strict>; export type DappEventSubscriptionWakePortRequestInput = z.infer; export type DappEventSubscriptionWakePortPendingInput = z.infer; export type DappEventSubscriptionWakePortCompleteInput = z.infer; export declare const DappEventWakeOutboxTransitionIssueCodes: readonly ["event-wake-outbox.generation-exhausted", "event-wake-outbox.generation-stale", "event-wake-outbox.scope-mismatch", "event-wake-outbox.tail-behind-cursor"]; export declare const DappEventWakeOutboxTransitionIssueCodeZod: z.ZodEnum<{ "event-wake-outbox.generation-exhausted": "event-wake-outbox.generation-exhausted"; "event-wake-outbox.generation-stale": "event-wake-outbox.generation-stale"; "event-wake-outbox.scope-mismatch": "event-wake-outbox.scope-mismatch"; "event-wake-outbox.tail-behind-cursor": "event-wake-outbox.tail-behind-cursor"; }>; export type DappEventWakeOutboxTransitionIssueCode = z.infer; export declare class DappEventWakeOutboxTransitionError extends Error { readonly code: DappEventWakeOutboxTransitionIssueCode; constructor(code: DappEventWakeOutboxTransitionIssueCode, message: string); } /** * Provider-neutral durable scheduling boundary. * * `request` atomically schedules the subscription and persists its pending * outbox generation. `pending` is finite and `complete` clears only the exact * generation whose disposable wake delivery succeeded. */ export interface DappEventSubscriptionWakePort { complete(input: DappEventSubscriptionWakePortCompleteInput): Promise; pending(input: DappEventSubscriptionWakePortPendingInput & { readonly signal?: AbortSignal; }): AsyncIterable; request(input: DappEventSubscriptionWakePortRequestInput): Promise; } export declare function createDappEventWakeOutboxState(definitionValue: unknown): DappEventWakeOutboxClearState; /** * Atomically make lag schedulable and retain one coalescing pending wake. * A pending generation remains sufficient when the tail grows because a wake * always drains current durable state rather than trusting its tail snapshot. */ export declare function requestDappEventSubscriptionWake(input: { readonly outbox: unknown; readonly subscription: unknown; readonly tail: unknown; }): DappEventSubscriptionWakeRequestResult; /** Clear one delivered generation without allowing a stale delivery to clear a newer request. */ export declare function completeDappEventSubscriptionWake(stateValue: unknown, generationValue: unknown): DappEventWakeOutboxClearState; export declare function verifyDappEventSubscriptionWakeRequestResult(value: unknown): DappEventSubscriptionWakeRequestResult; //# sourceMappingURL=eventWakeOutbox.d.ts.map