import { z } from 'zod';
import { type InferProvider } from './capability-definition.js';
import { DeviceType } from '../device/device-type.js';
/**
 * Discriminated target for a WebRTC session. The client sends this
 * structured object instead of building / parsing brokerId strings;
 * the server resolves it to a brokerId via the assignments map.
 *
 * - `adaptive`: server picks the best broker for the device based on
 *   client hints (viewport, downlink).
 * - `profile`: pin the session to a profile slot (`high`/`mid`/`low`).
 *   The actual source can change as the operator reassigns the slot.
 * - `cam-stream`: pin the session to a specific source by camStreamId
 *   (e.g. `native:main`, `rtsp:sub`). Useful when the operator wants
 *   a stable view of a specific source regardless of profile bindings,
 *   or to consume a manually-activated stream that isn't profile-bound.
 */
export declare const WebrtcStreamTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
    kind: z.ZodLiteral<"adaptive">;
}, z.core.$strip>, z.ZodObject<{
    kind: z.ZodLiteral<"profile">;
    profile: z.ZodEnum<{
        high: "high";
        mid: "mid";
        low: "low";
    }>;
}, z.core.$strip>, z.ZodObject<{
    kind: z.ZodLiteral<"cam-stream">;
    camStreamId: z.ZodString;
}, z.core.$strip>], "kind">;
export type WebrtcStreamTarget = z.infer<typeof WebrtcStreamTargetSchema>;
/** A stream choice the UI can offer for a device. */
export declare const WebrtcStreamChoiceSchema: z.ZodObject<{
    id: z.ZodString;
    label: z.ZodString;
    target: z.ZodDiscriminatedUnion<[z.ZodObject<{
        kind: z.ZodLiteral<"adaptive">;
    }, z.core.$strip>, z.ZodObject<{
        kind: z.ZodLiteral<"profile">;
        profile: z.ZodEnum<{
            high: "high";
            mid: "mid";
            low: "low";
        }>;
    }, z.core.$strip>, z.ZodObject<{
        kind: z.ZodLiteral<"cam-stream">;
        camStreamId: z.ZodString;
    }, z.core.$strip>], "kind">;
    codec: z.ZodNullable<z.ZodString>;
    resolution: z.ZodNullable<z.ZodObject<{
        width: z.ZodNumber;
        height: z.ZodNumber;
    }, z.core.$strip>>;
    status: z.ZodNullable<z.ZodEnum<{
        error: "error";
        streaming: "streaming";
        stopped: "stopped";
        idle: "idle";
        connecting: "connecting";
    }>>;
    inputFps: z.ZodNullable<z.ZodNumber>;
    decodeFps: z.ZodNullable<z.ZodNumber>;
    bitrateKbps: z.ZodNullable<z.ZodNumber>;
}, z.core.$strip>;
export type WebrtcStreamChoice = z.infer<typeof WebrtcStreamChoiceSchema>;
/**
 * WebRTC session — device-scoped facade over the system `webrtc` cap.
 *
 * Exposes per-device signaling (`createSession`, `handleAnswer`,
 * `closeSession`) on the device proxy so UI / integrations can
 * negotiate a session by (deviceId, profile) instead of constructing
 * an opaque `${deviceId}/${profile}` streamId string. The provider is
 * registered by the stream-broker addon for every camera device with
 * at least one active profile slot; internally it resolves
 * `${deviceId}/${profile}` and forwards to the system webrtc provider.
 *
 * The system `webrtc` cap remains available for cross-device / raw
 * streamId callers (debugging, admin tools). Production UI should
 * prefer this device-scoped cap.
 */
export declare const webrtcSessionCapability: {
    readonly name: "webrtc-session";
    readonly scope: "device";
    readonly mode: "singleton";
    readonly deviceTypes: readonly [DeviceType.Camera];
    readonly methods: {
        /**
         * List available WebRTC streams for a device.
         * Returns adaptive (if any profile is assigned) + each assigned profile
         * with codec/resolution info. UI renders this directly — no hardcoded
         * profile names needed.
         */
        readonly listStreams: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
        }, z.core.$strip>, z.ZodArray<z.ZodObject<{
            id: z.ZodString;
            label: z.ZodString;
            target: z.ZodDiscriminatedUnion<[z.ZodObject<{
                kind: z.ZodLiteral<"adaptive">;
            }, z.core.$strip>, z.ZodObject<{
                kind: z.ZodLiteral<"profile">;
                profile: z.ZodEnum<{
                    high: "high";
                    mid: "mid";
                    low: "low";
                }>;
            }, z.core.$strip>, z.ZodObject<{
                kind: z.ZodLiteral<"cam-stream">;
                camStreamId: z.ZodString;
            }, z.core.$strip>], "kind">;
            codec: z.ZodNullable<z.ZodString>;
            resolution: z.ZodNullable<z.ZodObject<{
                width: z.ZodNumber;
                height: z.ZodNumber;
            }, z.core.$strip>>;
            status: z.ZodNullable<z.ZodEnum<{
                error: "error";
                streaming: "streaming";
                stopped: "stopped";
                idle: "idle";
                connecting: "connecting";
            }>>;
            inputFps: z.ZodNullable<z.ZodNumber>;
            decodeFps: z.ZodNullable<z.ZodNumber>;
            bitrateKbps: z.ZodNullable<z.ZodNumber>;
        }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
        /**
         * Open a WebRTC session against a specific target on the device.
         * `target.kind` discriminates between adaptive selection, a profile
         * slot, or a specific cam stream source — see `WebrtcStreamTarget`.
         * The server resolves the target to a live broker; clients never
         * build or parse brokerId strings.
         */
        readonly createSession: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
            target: z.ZodDiscriminatedUnion<[z.ZodObject<{
                kind: z.ZodLiteral<"adaptive">;
            }, z.core.$strip>, z.ZodObject<{
                kind: z.ZodLiteral<"profile">;
                profile: z.ZodEnum<{
                    high: "high";
                    mid: "mid";
                    low: "low";
                }>;
            }, z.core.$strip>, z.ZodObject<{
                kind: z.ZodLiteral<"cam-stream">;
                camStreamId: z.ZodString;
            }, z.core.$strip>], "kind">;
            hints: z.ZodOptional<z.ZodObject<{
                viewportWidth: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
                viewportHeight: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
                devicePixelRatio: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
                downlinkMbps: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
                prefersTier: z.ZodOptional<z.ZodOptional<z.ZodString>>;
            }, z.core.$strip>>;
        }, z.core.$strip>, z.ZodObject<{
            sessionId: z.ZodString;
            sdpOffer: z.ZodString;
        }, z.core.$strip>, "mutation">;
        readonly handleAnswer: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
            sessionId: z.ZodString;
            sdpAnswer: z.ZodString;
        }, z.core.$strip>, z.ZodVoid, "mutation">;
        readonly closeSession: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
            sessionId: z.ZodString;
        }, z.core.$strip>, z.ZodVoid, "mutation">;
        /** Whether the underlying provider supports adaptive bitrate for this profile. */
        readonly hasAdaptiveBitrate: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
            profile: z.ZodEnum<{
                high: "high";
                mid: "mid";
                low: "low";
            }>;
        }, z.core.$strip>, z.ZodBoolean, import("./capability-definition.js").CapabilityMethodKind>;
    };
};
export type IWebrtcSessionProvider = InferProvider<typeof webrtcSessionCapability>;
//# sourceMappingURL=webrtc-session.cap.d.ts.map