/** Stable, machine-readable SDK boundary error codes. */ export type MemoflowSdkErrorCode = 'MEMOFLOW_PAYLOAD_SERIALIZATION_ERROR' | 'MEMOFLOW_PAYLOAD_DESERIALIZATION_ERROR' | 'MEMOFLOW_PROTOCOL_VALIDATION_ERROR'; export type RemoteErrorCode = 'INVALID' | 'UNAUTHENTICATED' | 'UNAUTHORIZED' | 'NOT_FOUND' | 'CONFLICT' | 'STALE' | 'DUPLICATE_APPLIED' | 'UNSUPPORTED_CAPABILITY' | 'NONDETERMINISM' | 'RESOURCE_EXHAUSTED' | 'UNAVAILABLE' | 'DEADLINE' | 'INTERNAL'; export interface RemoteErrorDetail { schemaVersion: number; code: RemoteErrorCode; retryable: boolean; scope: 'REQUEST' | 'TASK' | 'WORKFLOW' | 'SESSION' | 'SYSTEM'; safeMessage: string; violations: Array<{ field: string; description: string; }>; retryAfterMs?: number; } export declare function parseRemoteErrorDetail(value: any): RemoteErrorDetail | undefined; export declare class RemoteError extends Error { readonly detail: RemoteErrorDetail; constructor(detail: RemoteErrorDetail); get code(): RemoteErrorCode; get retryable(): boolean; get scope(): RemoteErrorDetail['scope']; get retryAfterMs(): number | undefined; } export declare function remoteErrorFromGrpc(error: any): RemoteError | undefined; /** Base class for errors raised while crossing an SDK data/protocol boundary. */ export declare class MemoflowSdkError extends Error { readonly code: MemoflowSdkErrorCode; readonly operation: string; readonly field?: string | undefined; constructor(code: MemoflowSdkErrorCode, message: string, operation: string, field?: string | undefined, options?: ErrorOptions); } /** A user value could not be represented by the SDK's JSON payload contract. */ export declare class PayloadSerializationError extends MemoflowSdkError { constructor(operation: string, field?: string, reason?: string, options?: ErrorOptions); } /** Wire bytes could not be decoded under the SDK's JSON payload contract. */ export declare class PayloadDeserializationError extends MemoflowSdkError { constructor(operation: string, field?: string, reason?: string, options?: ErrorOptions); } /** A protobuf-shaped value violated an SDK-visible protocol invariant. */ export declare class ProtocolValidationError extends MemoflowSdkError { constructor(operation: string, field: string, reason: string, options?: ErrorOptions); }