import { z } from 'zod';
import { type InferProvider } from './capability-definition.js';
import { DeviceType } from '../device/device-type.js';
/**
 * Camera streams — device-scoped facade over the system `stream-broker`.
 *
 * Mirrors the slice of broker state relevant to a single device:
 *   - `getCameraStreams()`: the pool of physical streams published for
 *     this device. UI uses it to populate the "Camera Stream" dropdown
 *     under each quality section.
 *   - `getBrokerStreams()`: the (up to 3) profile slots `high/mid/low`
 *     with their current assignment + runtime status. UI uses it for
 *     the WebRTC quality picker, recording target selection, etc.
 *
 * Registered for every camera device that has at least one published
 * cam stream. The provider is owned by the stream-broker addon; reads
 * go against the broker's in-memory registries. Mutations (assign /
 * unassign / publish / retract) do NOT live here — they stay on the
 * system `stream-broker` cap so cross-device / addon-driven flows keep
 * a single namespace.
 */
export declare const cameraStreamsCapability: {
    readonly name: "camera-streams";
    readonly scope: "device";
    readonly mode: "singleton";
    readonly deviceTypes: readonly [DeviceType.Camera];
    readonly methods: {
        readonly getCameraStreams: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
        }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
            camStreamId: z.ZodString;
            deviceId: z.ZodNumber;
            kind: z.ZodEnum<{
                "pull-rtsp": "pull-rtsp";
                "pull-rtmp": "pull-rtmp";
                "pull-http": "pull-http";
                "pull-rfc4571": "pull-rfc4571";
                "push-annexb": "push-annexb";
            }>;
            url: z.ZodOptional<z.ZodString>;
            codec: z.ZodOptional<z.ZodString>;
            resolution: z.ZodOptional<z.ZodObject<{
                width: z.ZodNumber;
                height: z.ZodNumber;
            }, z.core.$strip>>;
            fps: z.ZodOptional<z.ZodNumber>;
            label: z.ZodOptional<z.ZodString>;
            deviceFeatures: z.ZodOptional<z.ZodArray<z.ZodString>>;
            autoEligible: z.ZodOptional<z.ZodBoolean>;
            metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
        readonly getBrokerStreams: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
        }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
            deviceId: z.ZodNumber;
            profile: z.ZodEnum<{
                high: "high";
                mid: "mid";
                low: "low";
            }>;
            brokerId: z.ZodString;
            sourceCamStreamId: z.ZodNullable<z.ZodString>;
            status: z.ZodEnum<{
                error: "error";
                streaming: "streaming";
                idle: "idle";
                connecting: "connecting";
                unassigned: "unassigned";
            }>;
            resolution: z.ZodOptional<z.ZodObject<{
                width: z.ZodNumber;
                height: z.ZodNumber;
            }, z.core.$strip>>;
            codec: z.ZodOptional<z.ZodString>;
            preBufferSec: z.ZodOptional<z.ZodNumber>;
            errorMessage: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
        /**
         * Per-device RTSP restream entries. Returns the broker's published
         * RTSP URLs (one per `${deviceId}/${profile}`) for THIS device only,
         * including the rendered `url` field with the RTSP token applied.
         * Consumers (snapshot wrapper, recording, external probes) use this
         * to pick a stream URL without scanning the whole cluster.
         *
         * The system `stream-broker.getAllRtspEntries({hostname?})` still
         * exists for whole-cluster use cases (admin dashboard, settings
         * exports). This device-scoped accessor is the supported handle for
         * code that already has a `deviceId` in hand — keeps device-keyed
         * filtering server-side and rides the DeviceProxy auto-injection.
         */
        readonly getRtspEntries: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
            hostname: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
            brokerId: z.ZodString;
            url: z.ZodString;
            mutedUrl: z.ZodString;
            enabled: z.ZodBoolean;
        }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
    };
    readonly events: {
        /** Fires on publishCameraStream / retractCameraStream. */
        readonly onCamStreamsChanged: import("./capability-definition.js").CapabilityEventSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
            camStreams: z.ZodReadonly<z.ZodArray<z.ZodObject<{
                camStreamId: z.ZodString;
                deviceId: z.ZodNumber;
                kind: z.ZodEnum<{
                    "pull-rtsp": "pull-rtsp";
                    "pull-rtmp": "pull-rtmp";
                    "pull-http": "pull-http";
                    "pull-rfc4571": "pull-rfc4571";
                    "push-annexb": "push-annexb";
                }>;
                url: z.ZodOptional<z.ZodString>;
                codec: z.ZodOptional<z.ZodString>;
                resolution: z.ZodOptional<z.ZodObject<{
                    width: z.ZodNumber;
                    height: z.ZodNumber;
                }, z.core.$strip>>;
                fps: z.ZodOptional<z.ZodNumber>;
                label: z.ZodOptional<z.ZodString>;
                deviceFeatures: z.ZodOptional<z.ZodArray<z.ZodString>>;
                autoEligible: z.ZodOptional<z.ZodBoolean>;
                metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
            }, z.core.$strip>>>;
        }, z.core.$strip>>;
        /** Fires on assignProfile / unassignProfile / runtime status change. */
        readonly onProfileSlotsChanged: import("./capability-definition.js").CapabilityEventSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
            profileSlots: z.ZodReadonly<z.ZodArray<z.ZodObject<{
                deviceId: z.ZodNumber;
                profile: z.ZodEnum<{
                    high: "high";
                    mid: "mid";
                    low: "low";
                }>;
                brokerId: z.ZodString;
                sourceCamStreamId: z.ZodNullable<z.ZodString>;
                status: z.ZodEnum<{
                    error: "error";
                    streaming: "streaming";
                    idle: "idle";
                    connecting: "connecting";
                    unassigned: "unassigned";
                }>;
                resolution: z.ZodOptional<z.ZodObject<{
                    width: z.ZodNumber;
                    height: z.ZodNumber;
                }, z.core.$strip>>;
                codec: z.ZodOptional<z.ZodString>;
                preBufferSec: z.ZodOptional<z.ZodNumber>;
                errorMessage: z.ZodOptional<z.ZodString>;
            }, z.core.$strip>>>;
        }, z.core.$strip>>;
    };
    /**
     * Per-device live stream-broker state. Persistent settings (RTSP
     * tokens, profile assignments, pre-buffer config, RTSP-enabled toggles,
     * streamingDebug) stay in the broker's addon store — they survive
     * restarts. The slice below carries ONLY what's truly runtime:
     *
     *   - `online` — at least one profile slot is currently `'streaming'`.
     *     Drivers without a firmware liveness signal (RTSP, ONVIF…) can
     *     subscribe and mirror this into `state.deviceStatus.online`.
     *   - `slotStatuses` — current `ProfileSlotStatus` per profile,
     *     mirroring the runtime-mutable subset of `ProfileSlot`.
     *   - `slotErrors` — last error message per profile (only set when the
     *     corresponding slot is in `'error'`).
     *   - `lastChangedAt` — freshness signal for consumers that want to
     *     reason about how stale the slice is.
     *
     * Written by the stream-broker manager on every transition that
     * affects these aggregates. Read via `device.state.cameraStreams.<field>`
     * (BaseDevice proxy) or, cross-process, via
     * `device-state.getCapSlice({deviceId, capName: 'camera-streams'})`.
     * The cap's `onChanged` event fires automatically on each write so
     * subscribers get push semantics for free.
     */
    readonly runtimeState: z.ZodObject<{
        online: z.ZodBoolean;
        slotStatuses: z.ZodObject<{
            high: z.ZodOptional<z.ZodEnum<{
                error: "error";
                streaming: "streaming";
                idle: "idle";
                connecting: "connecting";
                unassigned: "unassigned";
            }>>;
            mid: z.ZodOptional<z.ZodEnum<{
                error: "error";
                streaming: "streaming";
                idle: "idle";
                connecting: "connecting";
                unassigned: "unassigned";
            }>>;
            low: z.ZodOptional<z.ZodEnum<{
                error: "error";
                streaming: "streaming";
                idle: "idle";
                connecting: "connecting";
                unassigned: "unassigned";
            }>>;
        }, z.core.$strip>;
        slotErrors: z.ZodObject<{
            high: z.ZodOptional<z.ZodString>;
            mid: z.ZodOptional<z.ZodString>;
            low: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>;
        lastChangedAt: z.ZodNumber;
    }, z.core.$strip>;
};
export type ICameraStreamsProvider = InferProvider<typeof cameraStreamsCapability>;
//# sourceMappingURL=camera-streams.cap.d.ts.map