import { ActivityDuplex } from '../types/activity'; import { CollationFaultType, CollationStage } from '../types/collator'; import { DurableChildErrorType, DurableContinueAsNewErrorType, DurableProxyErrorType, DurableSleepErrorType, DurableWaitForAllErrorType, DurableWaitForErrorType } from '../types/error'; /** * Error classification for dispatcher logging. * * FATAL — lease expired, invariant violation, corrupt state. * The activity must stop immediately; message is NOT acked. * RETRYABLE — transient infrastructure error (DB timeout, network). * Normal retry/backoff applies. * TERMINAL — permanent failure (user code threw, max retries exceeded). * Message is acked; job is marked failed. * COLLATION — duplicate delivery detected via GUID ledger. * Silent ack; no work needed. */ export declare enum ErrorCategory { FATAL = "fatal", RETRYABLE = "retryable", TERMINAL = "terminal", COLLATION = "collation" } export declare function classifyError(error: unknown): ErrorCategory; declare class GetStateError extends Error { jobId: string; code: number; constructor(jobId: string); } declare class SetStateError extends Error { constructor(); } declare class DurableWaitForError extends Error { code: number; signalId: string; workflowId: string; index: number; workflowDimension: string; type: string; constructor(params: DurableWaitForErrorType); } declare class DurableProxyError extends Error { activityName: string; arguments: string[]; headers?: Record; backoffCoefficient: number; code: number; index: number; initialInterval: number; maximumAttempts: number; maximumInterval: number; originJobId: string | null; parentWorkflowId: string; expire: number; startToCloseTimeout: number; workflowDimension: string; workflowId: string; workflowTopic: string; type: string; constructor(params: DurableProxyErrorType); } declare class DurableChildError extends Error { await: boolean; entity: string; arguments: string[]; backoffCoefficient: number; code: number; expire: number; initialInterval: number; persistent: boolean; signalIn: boolean; workflowDimension: string; index: number; maximumAttempts: number; maximumInterval: number; originJobId: string | null; parentWorkflowId: string; workflowId: string; workflowTopic: string; taskQueue: string; workflowName: string; type: string; constructor(params: DurableChildErrorType); } declare class DurableWaitForAllError extends Error { items: any[]; code: number; workflowDimension: string; size: number; index: number; originJobId: string | null; parentWorkflowId: string; workflowId: string; workflowTopic: string; type: string; constructor(params: DurableWaitForAllErrorType); } declare class DurableSleepError extends Error { workflowId: string; code: number; duration: number; index: number; workflowDimension: string; type: string; constructor(params: DurableSleepErrorType); } declare class DurableContinueAsNewError extends Error { workflowId: string; code: number; arguments: any[]; index: number; workflowDimension: string; type: string; constructor(params: DurableContinueAsNewErrorType); } declare class DurableTimeoutError extends Error { code: number; type: string; constructor(message: string, stack?: string); } declare class DurableMaxedError extends Error { code: number; type: string; constructor(message: string, stackTrace?: string); } declare class DurableFatalError extends Error { code: number; type: string; constructor(message: string, stackTrace?: string); } declare class DurableRetryError extends Error { code: number; type: string; constructor(message: string, stackTrace?: string); } declare class MapDataError extends Error { constructor(); } declare class RegisterTimeoutError extends Error { constructor(); } declare class DuplicateJobError extends Error { jobId: string; constructor(jobId: string); } declare class InactiveJobError extends Error { jobId: string; activityId: string; status: number; constructor(jobId: string, status: number, activityId: string); } declare class GenerationalError extends Error { expected: string; actual: string; jobId: string; activityId: string; dimensionalAddress: string; constructor(expected: string, actual: string, jobId: string, activityId: string, dimensionalAddress: string); } declare class ExecActivityError extends Error { constructor(); } declare class LeaseExpiredError extends Error { code: number; type: string; deadlineMs: number; reservationTimeoutS: number; constructor(deadlineMs: number, reservationTimeoutS: number); } declare class CollationError extends Error { status: number; leg: ActivityDuplex; stage: CollationStage; fault: CollationFaultType; constructor(status: number, leg: ActivityDuplex, stage: CollationStage, fault?: CollationFaultType); } export { CollationError, DurableChildError, DurableContinueAsNewError, DurableFatalError, DurableMaxedError, DurableProxyError, DurableRetryError, DurableSleepError, DurableTimeoutError, DurableWaitForAllError, DurableWaitForError, DuplicateJobError, ExecActivityError, GenerationalError, GetStateError, InactiveJobError, LeaseExpiredError, MapDataError, RegisterTimeoutError, SetStateError, };