import { z } from '#compiled/zod/index.js';
import type { PaginatedResponse, PaginationOptions } from './shared.js';
export declare const AnalyticsRunSchema: z.ZodObject<{
    runId: z.ZodString;
    status: z.ZodEnum<{
        pending: "pending";
        running: "running";
        completed: "completed";
        failed: "failed";
        cancelled: "cancelled";
    }>;
    deploymentId: z.ZodString;
    workflowName: z.ZodString;
    specVersion: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
    attributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
    createdAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
    updatedAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
    startedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
    completedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
    errorCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    workflowCoreVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    workflowEncryptionEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
}, z.core.$strip>;
export declare const AnalyticsStepSchema: z.ZodObject<{
    runId: z.ZodString;
    stepId: z.ZodString;
    stepName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    status: z.ZodEnum<{
        pending: "pending";
        running: "running";
        completed: "completed";
        failed: "failed";
        cancelled: "cancelled";
    }>;
    attempt: z.ZodOptional<z.ZodNumber>;
    createdAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
    updatedAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
    startedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
    completedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
    retryAfter: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
    errorCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    workflowCoreVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    workflowEncryptionEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
}, z.core.$strip>;
export declare const AnalyticsEventSchema: z.ZodObject<{
    runId: z.ZodString;
    eventId: z.ZodString;
    eventType: z.ZodEnum<{
        run_created: "run_created";
        run_started: "run_started";
        run_completed: "run_completed";
        run_failed: "run_failed";
        run_cancelled: "run_cancelled";
        attr_set: "attr_set";
        step_created: "step_created";
        step_completed: "step_completed";
        step_failed: "step_failed";
        step_retrying: "step_retrying";
        step_started: "step_started";
        hook_created: "hook_created";
        hook_received: "hook_received";
        hook_disposed: "hook_disposed";
        hook_conflict: "hook_conflict";
        wait_created: "wait_created";
        wait_completed: "wait_completed";
    }>;
    correlationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    entityId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    stepName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    workflowName: z.ZodString;
    deploymentId: z.ZodString;
    specVersion: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
    runCreatedAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
    createdAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
    region: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    vercelId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    requestId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    resumeAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
    retryAfter: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
    errorCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    workflowCoreVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    isWebhook: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
    isSystem: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
    workflowEncryptionEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
}, z.core.$strip>;
export declare const AnalyticsHookSchema: z.ZodObject<{
    runId: z.ZodString;
    hookId: z.ZodString;
    status: z.ZodEnum<{
        created: "created";
        received: "received";
        disposed: "disposed";
        conflict: "conflict";
    }>;
    createdAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
    updatedAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
    receivedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
    disposedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
    isWebhook: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
    isSystem: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
    workflowCoreVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    workflowEncryptionEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
}, z.core.$strip>;
export declare const AnalyticsWaitSchema: z.ZodObject<{
    runId: z.ZodString;
    waitId: z.ZodString;
    status: z.ZodEnum<{
        completed: "completed";
        waiting: "waiting";
    }>;
    resumeAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
    createdAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
    updatedAt: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
    completedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>>>;
    workflowCoreVersion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
    workflowEncryptionEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
}, z.core.$strip>;
export declare const AnalyticsAttributeKeySchema: z.ZodObject<{
    key: z.ZodString;
    runCount: z.ZodCoercedNumber<unknown>;
    firstSeenAt: z.ZodCoercedDate<unknown>;
    lastSeenAt: z.ZodCoercedDate<unknown>;
}, z.core.$strip>;
export type AnalyticsRun = z.infer<typeof AnalyticsRunSchema>;
export type AnalyticsStep = z.infer<typeof AnalyticsStepSchema>;
export type AnalyticsEvent = z.infer<typeof AnalyticsEventSchema>;
export type AnalyticsHook = z.infer<typeof AnalyticsHookSchema>;
export type AnalyticsWait = z.infer<typeof AnalyticsWaitSchema>;
export type AnalyticsAttributeKey = z.infer<typeof AnalyticsAttributeKeySchema>;
export interface AnalyticsListRunsParams {
    workflowName?: string;
    status?: AnalyticsRun['status'];
    /**
     * Bound the listing to runs active between `startTime` and `endTime`
     * (ISO 8601 timestamps). Both must be provided together. A bounded window
     * lets the backend prune its scan — the ClickHouse-backed Vercel
     * implementation is significantly faster with one. Requesting a window
     * older than the plan's observability lookback fails with
     * `observability-upgrade-required`.
     */
    startTime?: string;
    endTime?: string;
    /**
     * Restrict the listing to runs whose latest attribute snapshot matches
     * every provided key=value pair (up to 8 pairs). Matching is
     * latest-write-wins: a run whose attribute moved from `v1` to `v2` no
     * longer matches `v1`. Reserved `$`-prefixed keys may be used in filters
     * even though user writes to that namespace are rejected.
     */
    attributes?: Record<string, string>;
    pagination?: PaginationOptions;
}
export interface AnalyticsListAttributesParams {
    workflowName?: string;
    /**
     * Bound the listing to attribute writes between `startTime` and `endTime`
     * (ISO 8601 timestamps). Both must be provided together. Requesting a
     * window older than the plan's observability lookback fails with
     * `observability-upgrade-required`.
     */
    startTime?: string;
    endTime?: string;
    pagination?: PaginationOptions;
}
export interface AnalyticsListRunScopedParams {
    runId: string;
    pagination?: PaginationOptions;
}
export interface AnalyticsListEventsParams extends AnalyticsListRunScopedParams {
    eventType?: AnalyticsEvent['eventType'];
    correlationId?: string;
}
export interface AnalyticsListEventsByCorrelationIdParams {
    correlationId: string;
    pagination?: PaginationOptions;
}
export interface AnalyticsListHooksParams {
    runId: string;
    pagination?: PaginationOptions;
}
export interface AnalyticsListWaitsParams extends AnalyticsListRunScopedParams {
    status?: AnalyticsWait['status'];
}
export interface Analytics {
    runs: {
        get(runId: string): Promise<AnalyticsRun>;
        list(params?: AnalyticsListRunsParams): Promise<PaginatedResponse<AnalyticsRun>>;
    };
    attributes: {
        /**
         * List the distinct attribute keys observed on runs in the window,
         * with run counts and first/last seen timestamps. Ordered
         * alphabetically by key.
         */
        list(params?: AnalyticsListAttributesParams): Promise<PaginatedResponse<AnalyticsAttributeKey>>;
    };
    steps: {
        get(runId: string, stepId: string): Promise<AnalyticsStep>;
        list(params: AnalyticsListRunScopedParams): Promise<PaginatedResponse<AnalyticsStep>>;
    };
    events: {
        get(runId: string, eventId: string): Promise<AnalyticsEvent>;
        list(params: AnalyticsListEventsParams): Promise<PaginatedResponse<AnalyticsEvent>>;
        listByCorrelationId(params: AnalyticsListEventsByCorrelationIdParams): Promise<PaginatedResponse<AnalyticsEvent>>;
    };
    hooks: {
        get(hookId: string, params?: {
            runId?: string;
        }): Promise<AnalyticsHook>;
        list(params: AnalyticsListHooksParams): Promise<PaginatedResponse<AnalyticsHook>>;
    };
    waits: {
        get(runId: string, waitId: string): Promise<AnalyticsWait>;
        list(params: AnalyticsListWaitsParams): Promise<PaginatedResponse<AnalyticsWait>>;
    };
}
//# sourceMappingURL=analytics.d.ts.map