// Error Types and Actions
export { ErrorType } from "./error-type.js"
export { AppErrorAction } from "./app-error-action.js"

// Error Codes
export {
  AppErrorCode,
  type AppErrorCodeDefinition,
  type AppErrorCodeKey,
} from "./app-error-code.js"

// Error Definitions
export {
  AppError,
  type AppErrorDefinition,
  type AppErrorKey,
  getErrorMessage,
  getErrorByKey,
} from "./app-error.js"

// Exception Classes
export { BaseException, type ExceptionContext } from "./base-exception.js"
export {
  AppException,
  DownstreamException,
  // Convenience factory functions
  invalidParameter,
  unauthorizedAccess,
  notFound,
  badRequest,
  internalServerError,
  validationFailure,
  tooManyRequests,
  jwtAuthenticationFailure,
  invalidApiKey,
  subscriptionNotFound,
  subscriptionLimitReached,
  optimizationNotFound,
  optimizationLimitExceeded,
  githubApiError,
  githubInstallationNotFound,
  databaseError,
  externalServiceError,
  missingRequiredFields,
  conflict,
  unprocessableEntity,
  missingAuthorizationHeader,
  missingUserId,
  unauthorized,
  githubNotCollaborator,
  githubBranchNotFound,
  githubPrNotFound,
  githubInstallationError,
  optimizationRejected,
  subscriptionInactive,
  forbidden,
} from "./app-exception.js"

// Global Exception Handler
export {
  GlobalExceptionHandler,
  type ErrorDTO,
  type ResponseDTO,
} from "./global-exception-handler.js"
