/**
 * Totem error class hierarchy.
 *
 * Every Totem error includes:
 * - A clear message with [Totem Error] prefix
 * - A recoveryHint telling the user exactly how to fix it
 * - A code for programmatic handling
 */
export type TotemErrorCode = 'CONFIG_MISSING' | 'CONFIG_INVALID' | 'DATABASE_CORRUPT' | 'DATABASE_MISMATCH' | 'EMBEDDING_UNAVAILABLE' | 'ORCHESTRATOR_UNAVAILABLE' | 'COMPILE_FAILED' | 'PARSE_FAILED' | 'SYNC_FAILED' | 'GIT_FAILED' | 'NO_LESSONS' | 'NO_LESSONS_DIR' | 'NO_RULES' | 'SHIELD_FAILED' | 'LINT_LESSONS_FAILED' | 'DRIFT_FAILED' | 'TEST_FAILED' | 'CHECK_FAILED' | 'MCP_ERROR' | 'UPGRADE_HASH_NOT_FOUND' | 'UPGRADE_HASH_AMBIGUOUS' | 'STAGED_READ_FAILED' | 'UPGRADE_CLOUD_UNSUPPORTED' | 'STALE_MANIFEST' | 'FLAG_CONFLICT' | 'HOOKS_LOAD_FAILED' | 'SESSION_ID_WRITE_FAILED' | 'SESSION_ID_READ_FAILED' | 'BADGE_VERIFICATION_FAILED' | 'CLAIM_DISCIPLINE_FAILED' | 'GATE_INVALID' | 'PARITY_DRIFT_DETECTED' | 'MAIL_SEND_FAILED' | 'BASH_RESOLUTION_FAILED';
export declare class TotemError extends Error {
    readonly code: TotemErrorCode;
    readonly recoveryHint: string;
    constructor(code: TotemErrorCode, message: string, recoveryHint: string, cause?: unknown);
}
export declare class TotemConfigError extends TotemError {
    constructor(message: string, recoveryHint: string, code?: 'CONFIG_MISSING' | 'CONFIG_INVALID', cause?: unknown);
}
export declare class TotemDatabaseError extends TotemError {
    constructor(message: string, recoveryHint: string, code?: 'DATABASE_CORRUPT' | 'DATABASE_MISMATCH', cause?: unknown);
}
export declare class TotemCompileError extends TotemError {
    constructor(message: string, recoveryHint: string, cause?: unknown);
}
export declare class TotemParseError extends TotemError {
    constructor(message: string, recoveryHint: string, cause?: unknown);
}
export declare class TotemOrchestratorError extends TotemError {
    constructor(message: string, recoveryHint: string, cause?: unknown);
}
export declare class TotemGitError extends TotemError {
    constructor(message: string, recoveryHint: string, cause?: unknown);
}
/** Extract a human-readable message from an unknown thrown value. */
export declare function getErrorMessage(err: unknown): string;
/**
 * Re-throw as TotemParseError, preserving already-wrapped errors.
 * Use in catch blocks where AST engine failures must fail-closed.
 */
export declare function rethrowAsParseError(label: string, err: unknown, hint: string): never;
//# sourceMappingURL=errors.d.ts.map