/** * Normalized error model. * * Jira raw errors never reach the agent. Everything crossing the tool boundary * is mapped onto one of these codes so the agent (and `jam doctor`) can reason * about failures without parsing vendor-specific payloads. */ export declare const JAM_ERROR_CODES: readonly ["JIRA_AUTH_FAILED", "JIRA_PERMISSION_DENIED", "JQL_INVALID", "ISSUE_NOT_FOUND", "RATE_LIMITED", "CONTEXT_TOO_LARGE", "PARTIAL_RESULT", "CONFIG_INVALID", "JIRA_UNAVAILABLE", "JAM_SETUP_REQUIRED", "JAM_BINDINGS_UNREADABLE", "JAM_WRITE_SCOPE_VIOLATION", "JAM_WRITE_OPERATION_NOT_ALLOWED", "JAM_WRITE_FIELD_NOT_ALLOWED", "JAM_WRITE_TRANSITION_NOT_AVAILABLE", "JAM_WRITE_ISSUE_TYPE_NOT_AVAILABLE", "JAM_WRITE_REQUIRED_FIELD_UNSUPPORTED", "JAM_WRITE_VALUE_NOT_ALLOWED", "JAM_WRITE_SCHEMA_CHANGED", "JAM_WRITE_ASSIGNEE_NOT_FOUND", "JAM_WRITE_ASSIGNEE_AMBIGUOUS", "JAM_WRITE_ASSIGNEE_NOT_ASSIGNABLE", "JAM_WRITE_ASSIGNEE_ALREADY_SET", "JAM_WRITE_PLAN_NOT_FOUND", "JAM_WRITE_PLAN_EXPIRED", "JAM_WRITE_PLAN_TAMPERED", "JAM_WRITE_CONFLICT", "JAM_WRITE_VERIFICATION_FAILED", "JAM_WRITE_UNCERTAIN"]; export type JamErrorCode = (typeof JAM_ERROR_CODES)[number]; export type JamErrorPayload = { error: { code: JamErrorCode; message: string; details?: Record; }; }; export declare class JamError extends Error { readonly code: JamErrorCode; readonly details?: Record; constructor(code: JamErrorCode, message: string, details?: Record); toPayload(): JamErrorPayload; } /** * Coerce anything thrown into a JamError. Unknown failures become * JIRA_UNAVAILABLE rather than leaking a raw stack trace to the agent. */ export declare function toJamError(err: unknown): JamError;