import { z } from '#compiled/zod/index.js';
import type { PaginationOptions, ResolveData } from './shared.js';
/**
 * Fields within eventData that hold ref/payload data per event type.
 * When resolveData is 'none', only these fields are stripped — all other
 * metadata (stepName, workflowName, etc.) is preserved.
 */
export declare const EVENT_DATA_REF_FIELDS: Record<string, string[]>;
/**
 * Strip ref/payload fields from eventData based on resolveData setting.
 * When resolveData is 'none', removes only large data fields (refs) from
 * eventData while preserving metadata like stepName, workflowName, etc.
 */
export declare function stripEventDataRefs(event: Event, resolveData: ResolveData): Event;
export declare const EventTypeSchema: z.ZodEnum<{
    run_created: "run_created";
    run_completed: "run_completed";
    run_failed: "run_failed";
    step_created: "step_created";
    step_completed: "step_completed";
    step_failed: "step_failed";
    step_retrying: "step_retrying";
    hook_created: "hook_created";
    hook_received: "hook_received";
    run_started: "run_started";
    run_cancelled: "run_cancelled";
    step_started: "step_started";
    hook_disposed: "hook_disposed";
    hook_conflict: "hook_conflict";
    wait_created: "wait_created";
    wait_completed: "wait_completed";
}>;
export declare const BaseEventSchema: z.ZodObject<{
    eventType: z.ZodEnum<{
        run_created: "run_created";
        run_completed: "run_completed";
        run_failed: "run_failed";
        step_created: "step_created";
        step_completed: "step_completed";
        step_failed: "step_failed";
        step_retrying: "step_retrying";
        hook_created: "hook_created";
        hook_received: "hook_received";
        run_started: "run_started";
        run_cancelled: "run_cancelled";
        step_started: "step_started";
        hook_disposed: "hook_disposed";
        hook_conflict: "hook_conflict";
        wait_created: "wait_created";
        wait_completed: "wait_completed";
    }>;
    correlationId: z.ZodOptional<z.ZodString>;
    specVersion: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
declare const HookReceivedEventSchema: z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"hook_received">;
    correlationId: z.ZodString;
    eventData: z.ZodObject<{
        token: z.ZodOptional<z.ZodString>;
        payload: z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>;
    }, z.core.$strip>;
}, z.core.$strip>;
/**
 * Event created by World implementations when a hook_created request
 * conflicts with an existing hook token. This event is NOT user-creatable -
 * it is only returned by the World when a token conflict is detected.
 *
 * When the hook consumer sees this event, it should reject any awaited
 * promises with a HookTokenConflictError.
 */
declare const HookConflictEventSchema: z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"hook_conflict">;
    correlationId: z.ZodString;
    eventData: z.ZodObject<{
        token: z.ZodString;
        conflictingRunId: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>;
/**
 * Event created when a workflow run is first created. The World implementation
 * atomically creates both the event and the run entity with status 'pending'.
 */
declare const RunCreatedEventSchema: z.ZodObject<{
    correlationId: z.ZodOptional<z.ZodString>;
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"run_created">;
    eventData: z.ZodObject<{
        deploymentId: z.ZodString;
        workflowName: z.ZodString;
        input: z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>;
        executionContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
    }, z.core.$strip>;
}, z.core.$strip>;
export declare const CreateEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
    correlationId: z.ZodOptional<z.ZodString>;
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"run_created">;
    eventData: z.ZodObject<{
        deploymentId: z.ZodString;
        workflowName: z.ZodString;
        input: z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>;
        executionContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    correlationId: z.ZodOptional<z.ZodString>;
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"run_started">;
    eventData: z.ZodOptional<z.ZodObject<{
        input: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>>;
        deploymentId: z.ZodOptional<z.ZodString>;
        workflowName: z.ZodOptional<z.ZodString>;
        executionContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
    }, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
    correlationId: z.ZodOptional<z.ZodString>;
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"run_completed">;
    eventData: z.ZodObject<{
        output: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    correlationId: z.ZodOptional<z.ZodString>;
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"run_failed">;
    eventData: z.ZodObject<{
        error: z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>;
        errorCode: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    correlationId: z.ZodOptional<z.ZodString>;
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"run_cancelled">;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"step_created">;
    correlationId: z.ZodString;
    eventData: z.ZodObject<{
        stepName: z.ZodString;
        input: z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"step_completed">;
    correlationId: z.ZodString;
    eventData: z.ZodObject<{
        stepName: z.ZodOptional<z.ZodString>;
        result: z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"step_failed">;
    correlationId: z.ZodString;
    eventData: z.ZodObject<{
        stepName: z.ZodOptional<z.ZodString>;
        error: z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"step_retrying">;
    correlationId: z.ZodString;
    eventData: z.ZodObject<{
        stepName: z.ZodOptional<z.ZodString>;
        error: z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>;
        retryAfter: z.ZodOptional<z.ZodCoercedDate<unknown>>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"step_started">;
    correlationId: z.ZodString;
    eventData: z.ZodOptional<z.ZodObject<{
        stepName: z.ZodOptional<z.ZodString>;
        attempt: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"hook_created">;
    correlationId: z.ZodString;
    eventData: z.ZodObject<{
        token: z.ZodString;
        metadata: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>>;
        isWebhook: z.ZodOptional<z.ZodBoolean>;
        isSystem: z.ZodOptional<z.ZodBoolean>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"hook_received">;
    correlationId: z.ZodString;
    eventData: z.ZodObject<{
        token: z.ZodOptional<z.ZodString>;
        payload: z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"hook_disposed">;
    correlationId: z.ZodString;
    eventData: z.ZodOptional<z.ZodObject<{
        token: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"wait_created">;
    correlationId: z.ZodString;
    eventData: z.ZodObject<{
        resumeAt: z.ZodCoercedDate<unknown>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"wait_completed">;
    correlationId: z.ZodString;
    eventData: z.ZodOptional<z.ZodObject<{
        resumeAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
    }, z.core.$strip>>;
}, z.core.$strip>], "eventType">;
export declare const EventSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
    correlationId: z.ZodOptional<z.ZodString>;
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"run_created">;
    eventData: z.ZodObject<{
        deploymentId: z.ZodString;
        workflowName: z.ZodString;
        input: z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>;
        executionContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    correlationId: z.ZodOptional<z.ZodString>;
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"run_started">;
    eventData: z.ZodOptional<z.ZodObject<{
        input: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>>;
        deploymentId: z.ZodOptional<z.ZodString>;
        workflowName: z.ZodOptional<z.ZodString>;
        executionContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
    }, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
    correlationId: z.ZodOptional<z.ZodString>;
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"run_completed">;
    eventData: z.ZodObject<{
        output: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    correlationId: z.ZodOptional<z.ZodString>;
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"run_failed">;
    eventData: z.ZodObject<{
        error: z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>;
        errorCode: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    correlationId: z.ZodOptional<z.ZodString>;
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"run_cancelled">;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"step_created">;
    correlationId: z.ZodString;
    eventData: z.ZodObject<{
        stepName: z.ZodString;
        input: z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"step_completed">;
    correlationId: z.ZodString;
    eventData: z.ZodObject<{
        stepName: z.ZodOptional<z.ZodString>;
        result: z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"step_failed">;
    correlationId: z.ZodString;
    eventData: z.ZodObject<{
        stepName: z.ZodOptional<z.ZodString>;
        error: z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"step_retrying">;
    correlationId: z.ZodString;
    eventData: z.ZodObject<{
        stepName: z.ZodOptional<z.ZodString>;
        error: z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>;
        retryAfter: z.ZodOptional<z.ZodCoercedDate<unknown>>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"step_started">;
    correlationId: z.ZodString;
    eventData: z.ZodOptional<z.ZodObject<{
        stepName: z.ZodOptional<z.ZodString>;
        attempt: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"hook_created">;
    correlationId: z.ZodString;
    eventData: z.ZodObject<{
        token: z.ZodString;
        metadata: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>>;
        isWebhook: z.ZodOptional<z.ZodBoolean>;
        isSystem: z.ZodOptional<z.ZodBoolean>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"hook_received">;
    correlationId: z.ZodString;
    eventData: z.ZodObject<{
        token: z.ZodOptional<z.ZodString>;
        payload: z.ZodUnion<readonly [z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>]>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"hook_disposed">;
    correlationId: z.ZodString;
    eventData: z.ZodOptional<z.ZodObject<{
        token: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"hook_conflict">;
    correlationId: z.ZodString;
    eventData: z.ZodObject<{
        token: z.ZodString;
        conflictingRunId: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"wait_created">;
    correlationId: z.ZodString;
    eventData: z.ZodObject<{
        resumeAt: z.ZodCoercedDate<unknown>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    specVersion: z.ZodOptional<z.ZodNumber>;
    eventType: z.ZodLiteral<"wait_completed">;
    correlationId: z.ZodString;
    eventData: z.ZodOptional<z.ZodObject<{
        resumeAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
    }, z.core.$strip>>;
}, z.core.$strip>], "eventType">, z.ZodObject<{
    runId: z.ZodString;
    eventId: z.ZodString;
    createdAt: z.ZodCoercedDate<unknown>;
    specVersion: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>>;
export type Event = z.infer<typeof EventSchema>;
export type HookReceivedEvent = z.infer<typeof HookReceivedEventSchema>;
export type HookConflictEvent = z.infer<typeof HookConflictEventSchema>;
/**
 * Union of all possible event request types.
 * @internal Use CreateEventRequest or RunCreatedEventRequest instead.
 */
export type AnyEventRequest = z.infer<typeof CreateEventSchema>;
/**
 * Event request for creating a new workflow run.
 * Can be used with a client-generated runId or null for server-generated.
 */
export type RunCreatedEventRequest = z.infer<typeof RunCreatedEventSchema>;
/**
 * Event request types that require an existing runId.
 * This is the common case for all events except run_created.
 */
export type CreateEventRequest = Exclude<AnyEventRequest, RunCreatedEventRequest>;
export interface CreateEventParams {
    v1Compat?: boolean;
    resolveData?: ResolveData;
    /** Request ID (x-vercel-id when on Vercel) for correlating request logs with workflow events. */
    requestId?: string;
}
/**
 * Result of creating an event. Includes the created event and optionally
 * the entity that was created or updated as a result of the event, with any updates applied to it.
 *
 * Note: `event` is optional to support legacy runs where event storage is skipped.
 */
export interface EventResult {
    /** The created event (optional for legacy compatibility) */
    event?: Event;
    /** The workflow run entity (for run_* events) */
    run?: import('./runs.js').WorkflowRun;
    /** The step entity (for step_* events) */
    step?: import('./steps.js').Step;
    /** The hook entity (for hook_created events) */
    hook?: import('./hooks.js').Hook;
    /** The wait entity (for wait_created/wait_completed events) */
    wait?: import('./waits.js').Wait;
    /**
     * All events up to this point, with data resolved. When populated
     * on a run_started response, the runtime uses these to skip the
     * initial events.list call and reduce TTFB.
     */
    events?: Event[];
    /** Pagination cursor for `events`, matching events.list semantics. */
    cursor?: string | null;
    /** Whether additional event pages are available for `events`. */
    hasMore?: boolean;
}
export interface GetEventParams {
    resolveData?: ResolveData;
}
export interface ListEventsParams {
    runId: string;
    pagination?: PaginationOptions;
    resolveData?: ResolveData;
}
export interface ListEventsByCorrelationIdParams {
    correlationId: string;
    pagination?: PaginationOptions;
    resolveData?: ResolveData;
}
export {};
//# sourceMappingURL=events.d.ts.map