import { z } from 'zod';
import { type InferProvider } from './capability-definition.js';
import { DeviceType } from '../device/device-type.js';
/**
 * Per-class audio metrics aggregated over a sliding window.
 */
declare const AudioClassSummarySchema: z.ZodObject<{
    className: z.ZodString;
    hits: z.ZodNumber;
    avgScore: z.ZodNumber;
    peakScore: z.ZodNumber;
}, z.core.$strip>;
/**
 * Per-camera audio metrics snapshot — emitted by the analytics frame
 * handler on every `pipeline.audio-inference-result` event and
 * mirrored into the `audio-metrics` device-state slice. Symmetric
 * with `zone-analytics` snapshots for video — every consumer
 * (admin UI panel, automations, alert rules) reads via the
 * canonical `device.state.audioMetrics.value` reactive handle.
 *
 * Aggregates are computed over a rolling `windowSec` window
 * (default 60s). Past that window, classes drop out of `byClass`
 * and the level history shifts forward.
 */
declare const AudioMetricsSnapshotSchema: z.ZodObject<{
    ts: z.ZodNumber;
    windowSec: z.ZodNumber;
    level: z.ZodObject<{
        rms: z.ZodNumber;
        dbfs: z.ZodNumber;
    }, z.core.$strip>;
    peakDbfs: z.ZodNumber;
    avgDbfs: z.ZodNumber;
    current: z.ZodNullable<z.ZodObject<{
        className: z.ZodString;
        score: z.ZodNumber;
        timestamp: z.ZodNumber;
    }, z.core.$strip>>;
    byClass: z.ZodReadonly<z.ZodArray<z.ZodObject<{
        className: z.ZodString;
        hits: z.ZodNumber;
        avgScore: z.ZodNumber;
        peakScore: z.ZodNumber;
    }, z.core.$strip>>>;
}, z.core.$strip>;
export type AudioMetricsSnapshot = z.infer<typeof AudioMetricsSnapshotSchema>;
export type AudioClassSummary = z.infer<typeof AudioClassSummarySchema>;
/**
 * One sample on the audio-metrics history time-series. Captures the
 * subset of the live snapshot useful for charting: dB level, peak/avg
 * over the rolling window, and the dominant above-threshold class
 * (when any). Per-class hit breakdown lives on the snapshot but is
 * elided from the history sample to keep the buffer compact —
 * consumers needing class drill-down should pull `getCurrentSnapshot`.
 */
declare const AudioMetricsHistoryPointSchema: z.ZodObject<{
    ts: z.ZodNumber;
    dbfs: z.ZodNullable<z.ZodNumber>;
    peakDbfs: z.ZodNumber;
    avgDbfs: z.ZodNumber;
    topClass: z.ZodNullable<z.ZodString>;
    topScore: z.ZodNullable<z.ZodNumber>;
}, z.core.$strip>;
export type AudioMetricsHistoryPoint = z.infer<typeof AudioMetricsHistoryPointSchema>;
/**
 * Audio-metrics history payload — a series of `AudioMetricsHistoryPoint`
 * samples capped at `maxPoints` (default 1024). When the requested
 * `windowSec / sampleEveryMs` would exceed the cap, the provider
 * subsamples by bucketed averaging and reports the effective sample
 * spacing on `effectiveSampleEveryMs` so the UI can label the x-axis.
 */
declare const AudioMetricsHistorySchema: z.ZodObject<{
    points: z.ZodReadonly<z.ZodArray<z.ZodObject<{
        ts: z.ZodNumber;
        dbfs: z.ZodNullable<z.ZodNumber>;
        peakDbfs: z.ZodNumber;
        avgDbfs: z.ZodNumber;
        topClass: z.ZodNullable<z.ZodString>;
        topScore: z.ZodNullable<z.ZodNumber>;
    }, z.core.$strip>>>;
    effectiveSampleEveryMs: z.ZodNumber;
    windowMsActual: z.ZodNumber;
}, z.core.$strip>;
export type AudioMetricsHistory = z.infer<typeof AudioMetricsHistorySchema>;
/**
 * Audio Metrics capability — sliding-window aggregates over the
 * pipeline audio inference results. Hosted by `addon-pipeline-analytics`
 * (same addon that owns `zone-analytics`); the runtime-state slice
 * gives operators a live read on dB level + dominant classes without
 * a custom event subscription.
 */
export declare const audioMetricsCapability: {
    readonly name: "audio-metrics";
    readonly scope: "device";
    readonly mode: "singleton";
    readonly deviceTypes: readonly [DeviceType.Camera];
    readonly methods: {
        /** Latest snapshot for this device. Null until the analytics
         *  pipeline has processed at least one audio window. */
        readonly getCurrentSnapshot: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
        }, z.core.$strip>, z.ZodNullable<z.ZodObject<{
            ts: z.ZodNumber;
            windowSec: z.ZodNumber;
            level: z.ZodObject<{
                rms: z.ZodNumber;
                dbfs: z.ZodNumber;
            }, z.core.$strip>;
            peakDbfs: z.ZodNumber;
            avgDbfs: z.ZodNumber;
            current: z.ZodNullable<z.ZodObject<{
                className: z.ZodString;
                score: z.ZodNumber;
                timestamp: z.ZodNumber;
            }, z.core.$strip>>;
            byClass: z.ZodReadonly<z.ZodArray<z.ZodObject<{
                className: z.ZodString;
                hits: z.ZodNumber;
                avgScore: z.ZodNumber;
                peakScore: z.ZodNumber;
            }, z.core.$strip>>>;
        }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
        /**
         * Time-series view of recent audio-metrics samples. The provider
         * keeps an in-memory ring of ~1Hz samples (matching the slice-
         * write rate) capped at `MAX_HISTORY_POINTS_KEPT` (provider-side).
         * `windowSec` selects how far back to read; `sampleEveryMs`
         * downsamples by bucketed averaging when finer than the kept
         * granularity. Empty `points` array on freshly-booted providers
         * with no audio yet — same convention as `getCurrentSnapshot`.
         */
        readonly getHistory: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
            windowSec: z.ZodOptional<z.ZodNumber>;
            sampleEveryMs: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>, z.ZodObject<{
            points: z.ZodReadonly<z.ZodArray<z.ZodObject<{
                ts: z.ZodNumber;
                dbfs: z.ZodNullable<z.ZodNumber>;
                peakDbfs: z.ZodNumber;
                avgDbfs: z.ZodNumber;
                topClass: z.ZodNullable<z.ZodString>;
                topScore: z.ZodNullable<z.ZodNumber>;
            }, z.core.$strip>>>;
            effectiveSampleEveryMs: z.ZodNumber;
            windowMsActual: z.ZodNumber;
        }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
    };
    /** Reactive runtime-state mirror — live `device.state.audioMetrics.value`. */
    readonly runtimeState: z.ZodObject<{
        ts: z.ZodNumber;
        windowSec: z.ZodNumber;
        level: z.ZodObject<{
            rms: z.ZodNumber;
            dbfs: z.ZodNumber;
        }, z.core.$strip>;
        peakDbfs: z.ZodNumber;
        avgDbfs: z.ZodNumber;
        current: z.ZodNullable<z.ZodObject<{
            className: z.ZodString;
            score: z.ZodNumber;
            timestamp: z.ZodNumber;
        }, z.core.$strip>>;
        byClass: z.ZodReadonly<z.ZodArray<z.ZodObject<{
            className: z.ZodString;
            hits: z.ZodNumber;
            avgScore: z.ZodNumber;
            peakScore: z.ZodNumber;
        }, z.core.$strip>>>;
    }, z.core.$strip>;
};
export type IAudioMetricsProvider = InferProvider<typeof audioMetricsCapability>;
export { AudioMetricsSnapshotSchema, AudioClassSummarySchema, AudioMetricsHistoryPointSchema, AudioMetricsHistorySchema, };
//# sourceMappingURL=audio-metrics.cap.d.ts.map