/**
 * Device Connection — WebSocket client for connecting a local machine
 * to the Flow Weaver platform as a mounted device.
 *
 * This is the transport layer. Packs register their own request handlers
 * on top of this connection (e.g., improve status, bot management).
 *
 * The platform relays Studio requests to connected devices and forwards
 * device events to Studio subscribers.
 */
export interface DeviceInfo {
    name: string;
    hostname: string;
    projectDir: string;
    platform: string;
    capabilities: string[];
    /** Pack names that contributed device handlers (for auto-install on platform) */
    packs?: string[];
}
export interface DeviceConnectionOptions {
    platformUrl: string;
    token: string;
    projectDir: string;
    deviceName?: string;
    onConnect?: () => void;
    onDisconnect?: (code: number) => void;
    onEvent?: (event: DeviceEvent) => void;
    logger?: (msg: string) => void;
}
export interface DeviceEvent {
    type: string;
    data: Record<string, unknown>;
    timestamp: number;
}
type RequestHandler = (method: string, params: Record<string, unknown>) => Promise<unknown>;
export declare class DeviceConnection {
    private ws;
    private heartbeatInterval;
    private reconnectTimeout;
    private requestHandlers;
    private connected;
    private shouldReconnect;
    private readonly options;
    private readonly deviceInfo;
    private readonly log;
    constructor(options: DeviceConnectionOptions);
    /**
     * Add a capability to advertise to the platform.
     */
    addCapability(capability: string): void;
    /**
     * Set the list of packs that contributed device handlers.
     * The platform uses this to auto-install packs in the user's workspace.
     */
    setPacks(packs: string[]): void;
    /**
     * Register a handler for incoming requests from the platform.
     */
    onRequest(method: string, handler: RequestHandler): void;
    /**
     * Connect to the platform. Reconnects automatically on disconnect.
     */
    connect(): Promise<void>;
    /**
     * Emit an event to the platform.
     */
    emit(event: DeviceEvent): void;
    /**
     * Disconnect from the platform. No auto-reconnect.
     */
    disconnect(): void;
    isConnected(): boolean;
    getDeviceInfo(): Readonly<DeviceInfo>;
    private send;
    private handleMessage;
    private scheduleReconnect;
}
export {};
//# sourceMappingURL=device-connection.d.ts.map