import type { RuntimeAwakeConfig, RuntimeAwakeMetadata, RuntimeAwakeRequest } from '../../../lib/runtime-web/runtime-awake';
import { MqttConnectionState } from './mqtt-client';
/**
 * Runtime Dev CLI configuration.
 *
 * Extends RuntimeAwakeConfig with pre-resolved metadata from CloudFormation.
 * The metadata (iotEndpoint, sessionTableName, payloadBucketName) is now
 * resolved by MetadataResolver before being passed to this config.
 *
 * @see Requirements 1.2, 6.4
 */
export interface RuntimeAwakeCliConfig extends RuntimeAwakeConfig {
    /**
     * IoT Core endpoint (from resolved metadata).
     * Format: {prefix}-ats.iot.{region}.amazonaws.com
     */
    readonly iotEndpoint: string;
    /**
     * Session table name (from resolved metadata).
     * The actual DynamoDB table name from CloudFormation outputs.
     */
    readonly sessionTableName: string;
    /**
     * Payload bucket name (from resolved metadata).
     * The actual S3 bucket name from CloudFormation outputs.
     */
    readonly payloadBucketName: string;
}
/**
 * Runtime Dev CLI options.
 */
export interface RuntimeDevOptions {
    /** Override inspector port */
    readonly inspectorPort?: number;
    /** Disable hot reload */
    readonly noHotReload?: boolean;
    /** Enable debug mode (full payload logging) */
    readonly debug?: boolean;
    /** Override dev ID */
    readonly devId?: string;
}
/**
 * Runtime Dev CLI state.
 */
export type RuntimeDevState = 'idle' | 'starting' | 'running' | 'stopping' | 'stopped';
/**
 * Console UI for Awake Lambda Development.
 *
 * Provides formatted console output for connection status,
 * incoming requests, and execution results.
 *
 * @see Requirements 4.1
 */
export declare class RuntimeAwakeConsoleUI {
    private requestCount;
    private successCount;
    private errorCount;
    private startTime;
    /**
     * Display startup banner.
     */
    displayStartup(config: RuntimeAwakeCliConfig, devId: string, inspectorPort: number): void;
    /**
     * Display connection status change.
     */
    displayConnectionStatus(state: MqttConnectionState, error?: Error): void;
    /**
     * Display incoming request.
     */
    displayIncomingRequest(request: RuntimeAwakeRequest): void;
    /**
     * Display execution result.
     */
    displayExecutionResult(requestId: string, success: boolean, durationMs: number, statusCode?: number, errorType?: string): void;
    /**
     * Display hot reload event.
     */
    displayHotReload(changedFiles: string[], durationMs: number): void;
    /**
     * Display shutdown message.
     */
    displayShutdown(): void;
    /**
     * Display error message.
     */
    displayError(message: string, error?: Error): void;
    /**
     * Display warning message.
     */
    displayWarning(message: string): void;
    /**
     * Display info message.
     */
    displayInfo(message: string): void;
}
/**
 * Awake Lambda Development CLI Runtime.
 *
 * Main class that orchestrates all Live Dev components:
 * - MQTT client for cloud communication
 * - Handler resolver for local execution
 * - Worker manager for debuggable execution
 * - Hot reload manager for code changes
 * - Session registry for session management
 * - Signal handler for graceful shutdown
 *
 * @see Requirements 4.1, 6.1
 *
 * @example
 * ```typescript
 * const runtime = new RuntimeAwakeRun(config, options);
 * await runtime.start();
 *
 * // Runtime runs until Ctrl+C
 * // Graceful shutdown is handled automatically
 * ```
 */
export declare class RuntimeAwakeRun {
    /** Configuration */
    private readonly config;
    /** Options */
    private readonly options;
    /** Resolved developer ID */
    private readonly devId;
    /** Current state */
    private state;
    /** Console UI */
    private readonly ui;
    /** MQTT client */
    private mqttClient;
    /** Handler resolver */
    private handlerResolver;
    /** Worker manager */
    private workerManager;
    /** Payload handler */
    private payloadHandler;
    /** Hot reload manager */
    private hotReloadManager;
    /** Session registry */
    private sessionRegistry;
    /** Signal handler */
    private signalHandler;
    /** Heartbeat interval */
    private heartbeatInterval;
    /** CLI version */
    private readonly cliVersion;
    /**
     * Create a new RuntimeAwakeRuntime.
     *
     * @param config - Live Dev configuration
     * @param options - CLI options
     */
    constructor(config: RuntimeAwakeCliConfig, options?: RuntimeDevOptions);
    /**
     * Get current state.
     */
    getState(): RuntimeDevState;
    /**
     * Start Awake Lambda Development mode.
     *
     * Initializes all components, registers session, and starts
     * listening for requests.
     *
     * @see Requirements 4.1, 6.1
     */
    start(): Promise<void>;
    /**
     * Stop Awake Lambda Development mode.
     *
     * Gracefully shuts down all components and deregisters session.
     *
     * @see Requirements 6.4
     */
    stop(): Promise<void>;
    /**
     * Initialize all components.
     *
     * @param inspectorPort - Inspector port for debugger
     * @private
     */
    private initializeComponents;
    /**
     * Register session in the session registry.
     *
     * @private
     * @see Requirements 6.1
     */
    private registerSession;
    /**
     * Deregister session from the session registry.
     *
     * @private
     * @see Requirements 6.4
     */
    private deregisterSession;
    /**
     * Start heartbeat interval.
     *
     * @private
     */
    private startHeartbeat;
    /**
     * Setup signal handlers for graceful shutdown.
     *
     * @private
     * @see Requirements 6.4
     */
    private setupSignalHandlers;
    /**
     * Connect to MQTT broker.
     *
     * @private
     */
    private connectMqtt;
    /**
     * Run until shutdown signal received.
     *
     * @private
     */
    private runUntilShutdown;
    /**
     * Handle an incoming request from MQTT.
     *
     * Resolves the handler, executes it, and publishes the response.
     *
     * @param request - Live Dev request message
     * @private
     *
     * @see Requirements 4.6, 4.7, 4.8
     */
    private handleRequest;
    /**
     * Download event payload from S3 if it's an S3 reference.
     *
     * @param request - Live Dev request
     * @returns The actual event payload
     * @private
     *
     * @see Requirements 2.3, 15.3
     */
    private downloadEventPayload;
    /**
     * Resolve handler from request.
     *
     * @param request - Live Dev request
     * @returns Resolved handler information
     * @private
     *
     * @see Requirements 4.6
     */
    private resolveHandler;
    /**
     * Execute handler in worker process.
     *
     * @param resolved - Resolved handler information
     * @param event - Lambda event
     * @param context - Lambda context
     * @param request - Original request
     * @returns Handler result
     * @private
     *
     * @see Requirements 4.7
     */
    private executeHandler;
    /**
     * Publish response to MQTT.
     *
     * @param request - Original request
     * @param result - Execution result
     * @param startTime - Request start time
     * @private
     *
     * @see Requirements 4.8
     */
    private publishResponse;
    /**
     * Handle request error and publish error response.
     *
     * @param request - Original request
     * @param error - Error that occurred
     * @param startTime - Request start time
     * @private
     */
    private handleRequestError;
}
/**
 * Start Awake Lambda Development mode.
 *
 * Main entry point for the `runtime dev` command.
 * Expects pre-resolved metadata from MetadataResolver.
 *
 * @param config - Live Dev configuration with pre-resolved metadata
 * @param options - CLI options
 * @returns Promise that resolves when Live Dev stops
 *
 * @see Requirements 1.2, 4.1, 6.1, 6.4
 *
 * @example
 * ```typescript
 * // First resolve metadata using MetadataResolver
 * const resolver = new MetadataResolver(resolverConfig);
 * const result = await resolver.resolve();
 *
 * // Create config with resolved metadata
 * const config = createRuntimeDevConfig(runtimeAwakeConfig, result.metadata);
 *
 * // Start Live Dev
 * await startRuntimeAwake(config, { inspectorPort: 9229 });
 * ```
 */
export declare function startRuntimeAwake(config: RuntimeAwakeCliConfig, options?: RuntimeDevOptions): Promise<void>;
/**
 * Create a RuntimeDevCliConfig from a RuntimeAwakeConfig and pre-resolved metadata.
 *
 * Combines the user's RuntimeAwakeConfig with metadata that has been resolved
 * by MetadataResolver from CloudFormation outputs, cache, or local patterns.
 *
 * This function is the bridge between the MetadataResolver and the RuntimeAwakeRuntime.
 * The metadata should already be validated before being passed here.
 *
 * @param config - User's Live Dev configuration
 * @param metadata - Pre-resolved metadata from MetadataResolver
 * @returns Complete CLI configuration ready for RuntimeAwakeRuntime
 *
 * @see Requirements 1.2, 6.4
 *
 * @example
 * ```typescript
 * // Resolve metadata first
 * const resolver = new MetadataResolver(resolverConfig);
 * const result = await resolver.resolve();
 *
 * // Create runtime config with resolved metadata
 * const runtimeConfig = createRuntimeDevConfig(runtimeAwakeConfig, result.metadata);
 *
 * // Start Live Dev with validated metadata
 * const runtime = new RuntimeAwakeRuntime(runtimeConfig);
 * await runtime.start();
 * ```
 */
export declare function createRuntimeDevConfig(config: RuntimeAwakeConfig, metadata: RuntimeAwakeMetadata): RuntimeAwakeCliConfig;
