/**
 * @fileoverview API types and error handling.
 *
 * Defines the standardized API response envelope (ApiResponse), error codes,
 * hook event types from Claude Code's hooks system, and utility functions
 * for error message extraction. Used by all route modules in `src/web/routes/`.
 *
 * Key exports:
 * - ApiResponse<T> — discriminated union envelope (success with data or error with code)
 * - ApiErrorCode — enum of standard error codes with user-friendly messages
 * - HookEventType — union of Claude Code hook event names (idle_prompt, stop, etc.)
 * - createErrorResponse() — factory for consistent error responses
 * - getErrorMessage() — safe extraction from unknown catch values
 * - CaseInfo, QuickStartResponse — case folder metadata types
 *
 * No dependencies on other domain modules. Consumed by all route modules
 * and validated via Zod schemas in `src/web/schemas.ts`.
 */
/**
 * Standard error codes for API responses
 */
export declare enum ApiErrorCode {
    /** Resource not found */
    NOT_FOUND = "NOT_FOUND",
    /** Invalid input provided */
    INVALID_INPUT = "INVALID_INPUT",
    /** Authentication required or failed */
    UNAUTHORIZED = "UNAUTHORIZED",
    /** Session is currently busy */
    SESSION_BUSY = "SESSION_BUSY",
    /** Request conflicts with current state (e.g. already running) */
    CONFLICT = "CONFLICT",
    /** Resource already exists */
    ALREADY_EXISTS = "ALREADY_EXISTS",
    /** Too many requests / rate limited */
    RATE_LIMITED = "RATE_LIMITED",
    /** Operation could not be completed (well-formed but unprocessable) */
    OPERATION_FAILED = "OPERATION_FAILED",
    /** Internal server error */
    INTERNAL_ERROR = "INTERNAL_ERROR"
}
/** HTTP status for an API error code (defaults to 400 for unknown codes). */
export declare function httpStatusForErrorCode(code: ApiErrorCode): number;
/**
 * Hook event types triggered by Claude Code's hooks system
 */
export type HookEventType = 'idle_prompt' | 'permission_prompt' | 'elicitation_dialog' | 'stop' | 'teammate_idle' | 'task_completed';
/**
 * Standard API response wrapper (discriminated union for type safety)
 * @template T Type of the data payload
 */
export type ApiResponse<T = unknown> = {
    success: true;
    data?: T;
} | {
    success: false;
    error: string;
    errorCode: ApiErrorCode;
};
/**
 * Creates a standardized error response
 * @param code Error code
 * @param details Optional detailed error message
 * @returns Formatted error response
 */
export declare function createErrorResponse(code: ApiErrorCode, details?: string): ApiResponse<never>;
/**
 * Information about a case folder
 */
export interface CaseInfo {
    /** Case name */
    name: string;
    /** Full path to case folder */
    path: string;
    /** Whether CLAUDE.md exists */
    hasClaudeMd?: boolean;
}
/**
 * Safely extracts an error message from an unknown caught value.
 * Handles the TypeScript 4.4+ unknown error type in catch blocks.
 *
 * @param error The caught error (type unknown in strict mode)
 * @returns A string error message
 *
 * @example
 * ```typescript
 * try {
 *   await riskyOperation();
 * } catch (err) {
 *   console.error('Failed:', getErrorMessage(err));
 * }
 * ```
 */
export declare function getErrorMessage(error: unknown): string;
//# sourceMappingURL=api.d.ts.map