/** * TorukSdkError — thrown when the SDK encounters a structural failure * (network down, abort, malformed response, unexpected HTTP status that * can't be expressed via the TorukErrorResponse envelope). * * For predictable API errors with a known code, callers should also * expect a TorukErrorResponse via the request envelope without a throw. * * Backward-compat (one minor cycle): `WORKFLOW_NOT_FOUND` and * `WORKFLOW_BUILD_FAILED` remain in the union as deprecated aliases for * `TASK_NOT_FOUND` and `TASK_BUILD_FAILED`. The SDK emits only the new * codes; the old strings are retained so existing consumer switch * statements continue to compile. Removed in the next major release. */ export type TorukSdkErrorCode = 'UNAUTHORIZED' | 'FORBIDDEN' | 'TASK_NOT_FOUND' | 'BAD_REQUEST' | 'TASK_BUILD_FAILED' | 'STREAMING_UNAVAILABLE' | 'RATE_LIMITED' | 'NETWORK' | 'ABORTED' | 'TIMEOUT' | 'STREAM_PARSE_ERROR' | 'MALFORMED_RESPONSE' /** SDK misconfiguration caught before any request (e.g. missing deploymentId). */ | 'CONFIGURATION' /** The deployment runtime plane has no endpoint for this operation. */ | 'UNSUPPORTED' /** The deployment does not exist, is a draft, or is not active. */ | 'DEPLOYMENT_NOT_FOUND' /** The session does not exist for this deployment and visitor. */ | 'SESSION_NOT_FOUND' /** * The artifact does not exist in a session this visitor owns. Core returns * the same not-found whether the artifact is missing, belongs to another * session, or belongs to another deployment or visitor — by design, so the * boundary reveals nothing. */ | 'ARTIFACT_NOT_FOUND' | 'UNKNOWN' /** @deprecated Use `TASK_NOT_FOUND`. */ | 'WORKFLOW_NOT_FOUND' /** @deprecated Use `TASK_BUILD_FAILED`. */ | 'WORKFLOW_BUILD_FAILED'; export type TorukSdkErrorInput = { message: string; code: TorukSdkErrorCode | string; status?: number; details?: unknown; requestId?: string; cause?: unknown; }; export declare class TorukSdkError extends Error { readonly code: string; readonly status?: number; readonly details?: unknown; readonly requestId?: string; constructor(input: TorukSdkErrorInput); }