/**
 * Cloud REST Controller
 *
 * Handles HTTP requests for CrewlyAI Cloud integration.
 * Provides endpoints for connecting, disconnecting, checking status,
 * and fetching premium templates from CrewlyAI Cloud.
 *
 * @module controllers/cloud/cloud.controller
 */
import type { Request, Response, NextFunction } from 'express';
/** Payload sent to the Cloud during the handshake after connect. */
export interface CloudHandshakePayload {
    /** Unique device ID from ~/.crewly/device.json */
    deviceId: string;
    /** Human-readable device name (hostname) */
    deviceName: string;
    /** Active teams on this OSS instance */
    teams: Array<{
        id: string;
        name: string;
        memberCount: number;
        activeAgents: number;
    }>;
    /** Crewly version (from package.json) */
    version: string;
    /** ISO timestamp of this handshake */
    timestamp: string;
}
/**
 * POST /api/cloud/connect
 *
 * Connect to CrewlyAI Cloud with the provided URL and authentication token.
 * After a successful connect, sends device metadata and active team lists
 * to the Cloud via the handshake endpoint.
 *
 * @param req - Request with body: { cloudUrl?, token, refreshToken? }
 * @param res - Response returning { success, data: { tier } }
 * @param next - Next function for error propagation
 */
export declare function connectToCloud(req: Request, res: Response, next: NextFunction): Promise<void>;
/**
 * POST /api/cloud/disconnect
 *
 * Disconnect from CrewlyAI Cloud and clear stored credentials.
 *
 * @param req - Express request (no body required)
 * @param res - Response returning { success: true }
 * @param next - Next function for error propagation
 */
export declare function disconnectFromCloud(req: Request, res: Response, next: NextFunction): Promise<void>;
/**
 * GET /api/cloud/status
 *
 * Get the current CrewlyAI Cloud connection status and subscription tier.
 *
 * @param req - Express request (no params required)
 * @param res - Response returning { success, data: CloudStatus }
 * @param next - Next function for error propagation
 */
export declare function getCloudStatus(req: Request, res: Response, next: NextFunction): Promise<void>;
/**
 * GET /api/cloud/license/verify
 *
 * Verify the current user's license tier and return the list of features
 * their subscription entitles them to. Used by the CLI license interceptor
 * and any client that needs to gate premium functionality.
 *
 * Returns `valid: true` when connected to Cloud with an active subscription,
 * or `valid: false` with free-tier features when disconnected.
 *
 * @param req - Express request (no params required)
 * @param res - Response returning { success, data: { valid, tier, features } }
 * @param next - Next function for error propagation
 */
export declare function verifyLicense(req: Request, res: Response, next: NextFunction): Promise<void>;
/**
 * POST /api/cloud/validate
 *
 * Validate a JWT access token locally by verifying its HMAC signature
 * and expiry. Returns user profile from the token payload.
 *
 * Falls back to proxying to the Cloud API if CREWLY_CLOUD_API_BASE
 * is explicitly set (for OSS→Cloud validation).
 *
 * @param req - Request with Authorization: Bearer <token> header
 * @param res - Response returning { success, data: { id, email, displayName, plan } }
 * @param next - Next function for error propagation
 */
export declare function validateCloudToken(req: Request, res: Response, next: NextFunction): Promise<void>;
/**
 * GET /api/cloud/device-id
 *
 * Return the persistent device identity (UUID + hostname) from
 * DeviceIdentityService. The frontend uses this to include the
 * correct deviceId in heartbeats to the Cloud API, preventing
 * duplicate device registrations.
 *
 * @param req - Express request (no params required)
 * @param res - Response returning { success, data: { deviceId, deviceName } }
 * @param next - Next function for error propagation
 */
export declare function getDeviceId(req: Request, res: Response, next: NextFunction): Promise<void>;
/**
 * POST /api/cloud/refresh
 *
 * Exchange a valid refresh token for a new access token.
 *
 * @param req - Request with body: { refreshToken }
 * @param res - Response returning { success, data: { accessToken, expiresIn } }
 * @param next - Next function for error propagation
 */
export declare function refreshCloudToken(req: Request, res: Response, next: NextFunction): Promise<void>;
/**
 * GET /api/cloud/templates
 *
 * Fetch available premium templates from CrewlyAI Cloud.
 * Requires an active cloud connection.
 *
 * @param req - Express request (no params required)
 * @param res - Response returning { success, data: CloudTemplateSummary[] }
 * @param next - Next function for error propagation
 */
export declare function getCloudTemplates(req: Request, res: Response, next: NextFunction): Promise<void>;
/**
 * POST /api/cloud/send
 *
 * Send a message to another device via the Cloud Sync message queue.
 * Requires an active CloudSyncService (i.e. connected to Cloud).
 *
 * @param req - Request with body: { toDeviceId, type, payload }
 * @param res - Response returning { success, message }
 * @param next - Next function for error propagation
 */
export declare function sendCloudMessage(req: Request, res: Response, next: NextFunction): Promise<void>;
/**
 * GET /api/cloud/devices
 *
 * List devices from CloudSyncService. Returns all devices visible to
 * the current user's Cloud account with an `isLocal` flag for the
 * current machine.
 *
 * @param req - Express request
 * @param res - Response with device list
 * @param _next - Express next function
 */
export declare function getDevicesFromSync(req: Request, res: Response, _next: NextFunction): Promise<void>;
//# sourceMappingURL=cloud.controller.d.ts.map