import { z } from 'zod';
import { type InferProvider } from './capability-definition.js';
import type { ConfigField } from '../interfaces/config-ui.js';
/**
 * Source enum for motion signals fed to the runner. Extensible — add
 * new variants here when new motion-trigger paths are wired in
 * (`wasm-cross-camera`, `event-bus-relay`, etc.). The runner uses
 * the variant for diagnostics + to route the cap-state event payload
 * (analyzer attaches detected `regions[]`; onboard does not — the
 * camera typically only reports a binary signal plus an optional
 * channel/AI class which lives in dedicated event channels).
 */
export declare const MotionSourceEnum: z.ZodEnum<{
    onboard: "onboard";
    analyzer: "analyzer";
}>;
export type MotionSource = z.infer<typeof MotionSourceEnum>;
/**
 * List of motion sources active on a camera. Empty array is valid:
 * "no source" — happens for battery cams without firmware motion when
 * the operator hasn't opted into the SW analyzer (would hold the
 * substream open continuously and defeat the sleep cycle). The runner
 * accepts the empty list as "no motion-driven phase transitions" and
 * relies on the operator-set `detectionMode` to drive activation
 * (`'always-on'`) — `'on-motion'` with no source effectively pins the
 * phase to `'watching'`, which is the desired battery-cam-without-
 * firmware behaviour.
 *
 * Single source of truth for the array shape — every consumer
 * (orchestrator, runner, settings UI, dispatch) imports from here.
 */
export declare const MotionSourcesSchema: z.ZodArray<z.ZodEnum<{
    onboard: "onboard";
    analyzer: "analyzer";
}>>;
export type MotionSources = z.infer<typeof MotionSourcesSchema>;
/**
 * Input shape for `pipeline-runner.reportMotion` cap method. Exported
 * so cap-side consumers (the orchestrator forward, the runner addon's
 * cap implementation, tests) can reuse the type instead of redeclaring
 * the field set.
 */
export declare const ReportMotionInputSchema: z.ZodObject<{
    deviceId: z.ZodNumber;
    detected: z.ZodBoolean;
    source: z.ZodDefault<z.ZodEnum<{
        onboard: "onboard";
        analyzer: "analyzer";
    }>>;
    regions: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
        bbox: z.ZodObject<{
            x: z.ZodNumber;
            y: z.ZodNumber;
            w: z.ZodNumber;
            h: z.ZodNumber;
        }, z.core.$strip>;
        pixelCount: z.ZodNumber;
        intensity: z.ZodNumber;
    }, z.core.$strip>>>>;
}, z.core.$strip>;
export type ReportMotionInput = z.infer<typeof ReportMotionInputSchema>;
/**
 * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
 * specific runner instance via `attachCamera`. Carries everything the
 * runner needs to subscribe to the local broker and execute inference.
 *
 * Stateless-pipeline model: the full pipeline content (`engine`, `steps`,
 * optional `audio`) travels with the attach payload. The runner keeps it
 * in RAM for the lifetime of the attach — on rebalance, edit, or
 * restart the orchestrator re-sends the latest snapshot.
 *
 * `engine`/`steps`/`audio` are optional during the additive migration
 * window; once orchestrator + UI are migrated they become required.
 */
declare const RunnerCameraConfigSchema: z.ZodObject<{
    deviceId: z.ZodNumber;
    detectionMode: z.ZodDefault<z.ZodEnum<{
        disabled: "disabled";
        "always-on": "always-on";
        "on-motion": "on-motion";
    }>>;
    audioMode: z.ZodDefault<z.ZodEnum<{
        disabled: "disabled";
        "always-on": "always-on";
        "on-motion": "on-motion";
    }>>;
    motionCooldownMs: z.ZodDefault<z.ZodNumber>;
    motionFps: z.ZodDefault<z.ZodNumber>;
    detectionFps: z.ZodDefault<z.ZodNumber>;
    motionStreamId: z.ZodString;
    detectionStreamId: z.ZodString;
    motionSources: z.ZodDefault<z.ZodArray<z.ZodEnum<{
        onboard: "onboard";
        analyzer: "analyzer";
    }>>>;
    pipelineEnabled: z.ZodDefault<z.ZodBoolean>;
    engine: z.ZodOptional<z.ZodObject<{
        runtime: z.ZodEnum<{
            node: "node";
            python: "python";
        }>;
        backend: z.ZodString;
        format: z.ZodEnum<{
            onnx: "onnx";
            coreml: "coreml";
            openvino: "openvino";
            tflite: "tflite";
            pt: "pt";
        }>;
        device: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    steps: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodType<import("./pipeline-executor.cap.js").PipelineStepInputOutput, unknown, z.core.$ZodTypeInternals<import("./pipeline-executor.cap.js").PipelineStepInputOutput, unknown>>>>>;
    audio: z.ZodOptional<z.ZodNullable<z.ZodObject<{
        engine: z.ZodObject<{
            runtime: z.ZodEnum<{
                node: "node";
                python: "python";
            }>;
            backend: z.ZodString;
            format: z.ZodEnum<{
                onnx: "onnx";
                coreml: "coreml";
                openvino: "openvino";
                tflite: "tflite";
                pt: "pt";
            }>;
            device: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>;
        modelId: z.ZodString;
        enabled: z.ZodBoolean;
    }, z.core.$strip>>>;
    zones: z.ZodDefault<z.ZodReadonly<z.ZodArray<z.ZodObject<{
        id: z.ZodString;
        name: z.ZodString;
        kind: z.ZodDefault<z.ZodEnum<{
            polygon: "polygon";
            tripwire: "tripwire";
        }>>;
        polygon: z.ZodReadonly<z.ZodArray<z.ZodObject<{
            x: z.ZodNumber;
            y: z.ZodNumber;
        }, z.core.$strip>>>;
        color: z.ZodDefault<z.ZodString>;
    }, z.core.$strip>>>>;
}, z.core.$strip>;
/**
 * Per-device settings UI fields the runner cap owns. Co-located with
 * the Zod data schema so a single change to defaults / ranges /
 * options propagates to both the wire contract AND the rendered UI.
 *
 * Consumers spread this into their own ConfigUISchema sections
 * (e.g. orchestrator's deviceSettingsSchema) instead of redeclaring
 * the fields. The ranges are read from the `*Field` constants above
 * so values stay in sync with `RunnerCameraConfigSchema`.
 *
 * Fields NOT included here are intentional — they're either internal
 * wire (motionStreamId, detectionStreamId) or live in a different
 * config surface (priority, motionStreamProfile/detectionStreamProfile
 * — the orchestrator transforms them into stream IDs before dispatch).
 */
export declare const RunnerCameraDeviceUIFields: readonly ConfigField[];
/**
 * Runtime load summary returned by `getLocalLoad`. Used by the orchestrator's
 * load-balancing levels (L2 capacity-based, L3 hardware-aware) to decide
 * which agent should receive a new camera assignment.
 */
declare const RunnerLocalLoadSchema: z.ZodObject<{
    nodeId: z.ZodString;
    attachedCameras: z.ZodNumber;
    activeCameras: z.ZodNumber;
    avgInferenceFps: z.ZodNumber;
    avgInferenceTimeMs: z.ZodNumber;
    queueDepthTotal: z.ZodNumber;
    hardware: z.ZodObject<{
        hasGpu: z.ZodBoolean;
        inferenceBackend: z.ZodOptional<z.ZodString>;
        cpuCores: z.ZodOptional<z.ZodNumber>;
    }, z.core.$strip>;
}, z.core.$strip>;
/**
 * Aggregate runtime metrics for the runner's whole local pool. Mirrors the
 * legacy `OrchestratorMetricsSchema` shape so existing dashboards keep
 * working unchanged when they switch to reading from the runner cap.
 */
declare const RunnerLocalMetricsSchema: z.ZodObject<{
    nodeId: z.ZodString;
    activeCameras: z.ZodNumber;
    throttledCameras: z.ZodNumber;
    avgInferenceTimeMs: z.ZodNumber;
    queueDepth: z.ZodNumber;
}, z.core.$strip>;
/**
 * Pipeline Runner capability — runtime detection workhorse.
 *
 * One instance per node. Receives camera assignments from
 * `addon-pipeline-orchestrator`, subscribes to the local stream-broker for
 * decoded frames, drains motion + detection queues, calls the local
 * `motion-detection` and `pipeline-executor` capabilities, and emits typed
 * `pipeline.inference-result` and `detection.motion-analysis` events on
 * the bus.
 *
 * Distinct from `pipeline-orchestrator` (the hub-side load balancer) — the
 * runner has zero knowledge of other agents, no global state, and never
 * makes assignment decisions itself.
 */
export declare const pipelineRunnerCapability: {
    readonly name: "pipeline-runner";
    readonly scope: "system";
    readonly mode: "singleton";
    readonly methods: {
        /** Attach a camera to this runner. Subscribes to local broker. */
        readonly attachCamera: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
            detectionMode: z.ZodDefault<z.ZodEnum<{
                disabled: "disabled";
                "always-on": "always-on";
                "on-motion": "on-motion";
            }>>;
            audioMode: z.ZodDefault<z.ZodEnum<{
                disabled: "disabled";
                "always-on": "always-on";
                "on-motion": "on-motion";
            }>>;
            motionCooldownMs: z.ZodDefault<z.ZodNumber>;
            motionFps: z.ZodDefault<z.ZodNumber>;
            detectionFps: z.ZodDefault<z.ZodNumber>;
            motionStreamId: z.ZodString;
            detectionStreamId: z.ZodString;
            motionSources: z.ZodDefault<z.ZodArray<z.ZodEnum<{
                onboard: "onboard";
                analyzer: "analyzer";
            }>>>;
            pipelineEnabled: z.ZodDefault<z.ZodBoolean>;
            engine: z.ZodOptional<z.ZodObject<{
                runtime: z.ZodEnum<{
                    node: "node";
                    python: "python";
                }>;
                backend: z.ZodString;
                format: z.ZodEnum<{
                    onnx: "onnx";
                    coreml: "coreml";
                    openvino: "openvino";
                    tflite: "tflite";
                    pt: "pt";
                }>;
                device: z.ZodOptional<z.ZodString>;
            }, z.core.$strip>>;
            steps: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodType<import("./pipeline-executor.cap.js").PipelineStepInputOutput, unknown, z.core.$ZodTypeInternals<import("./pipeline-executor.cap.js").PipelineStepInputOutput, unknown>>>>>;
            audio: z.ZodOptional<z.ZodNullable<z.ZodObject<{
                engine: z.ZodObject<{
                    runtime: z.ZodEnum<{
                        node: "node";
                        python: "python";
                    }>;
                    backend: z.ZodString;
                    format: z.ZodEnum<{
                        onnx: "onnx";
                        coreml: "coreml";
                        openvino: "openvino";
                        tflite: "tflite";
                        pt: "pt";
                    }>;
                    device: z.ZodOptional<z.ZodString>;
                }, z.core.$strip>;
                modelId: z.ZodString;
                enabled: z.ZodBoolean;
            }, z.core.$strip>>>;
            zones: z.ZodDefault<z.ZodReadonly<z.ZodArray<z.ZodObject<{
                id: z.ZodString;
                name: z.ZodString;
                kind: z.ZodDefault<z.ZodEnum<{
                    polygon: "polygon";
                    tripwire: "tripwire";
                }>>;
                polygon: z.ZodReadonly<z.ZodArray<z.ZodObject<{
                    x: z.ZodNumber;
                    y: z.ZodNumber;
                }, z.core.$strip>>>;
                color: z.ZodDefault<z.ZodString>;
            }, z.core.$strip>>>>;
        }, z.core.$strip>, z.ZodObject<{
            success: z.ZodLiteral<true>;
        }, z.core.$strip>, "mutation">;
        /** Detach a camera. Unsubscribes from local broker, clears queues. */
        readonly detachCamera: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
        }, z.core.$strip>, z.ZodObject<{
            success: z.ZodLiteral<true>;
        }, z.core.$strip>, "mutation">;
        /**
         * Report an external motion event for a camera. Drives the runner's
         * phase machine: every `detected: true` clears + rearms the
         * cooldown timer (`motionCooldownMs`); when the timer expires the
         * camera returns to `watching`. `detected: false` is a no-op —
         * onboard sources never send an explicit clear, the timer is the
         * single closure path.
         *
         * `source` discriminates which motion path triggered the event so
         * the runner can attach the right metadata to the cap-state event
         * (analyzer carries `regions[]`, onboard does not). `regions` is
         * populated only for `source: 'analyzer'` — the analyzer's
         * frame-diff result. Always-on cameras silently ignore
         * reportMotion calls.
         */
        readonly reportMotion: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
            detected: z.ZodBoolean;
            source: z.ZodDefault<z.ZodEnum<{
                onboard: "onboard";
                analyzer: "analyzer";
            }>>;
            regions: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
                bbox: z.ZodObject<{
                    x: z.ZodNumber;
                    y: z.ZodNumber;
                    w: z.ZodNumber;
                    h: z.ZodNumber;
                }, z.core.$strip>;
                pixelCount: z.ZodNumber;
                intensity: z.ZodNumber;
            }, z.core.$strip>>>>;
        }, z.core.$strip>, z.ZodObject<{
            success: z.ZodLiteral<true>;
        }, z.core.$strip>, "mutation">;
        /** Return load summary used by the orchestrator's load balancer. */
        readonly getLocalLoad: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodObject<{
            nodeId: z.ZodString;
            attachedCameras: z.ZodNumber;
            activeCameras: z.ZodNumber;
            avgInferenceFps: z.ZodNumber;
            avgInferenceTimeMs: z.ZodNumber;
            queueDepthTotal: z.ZodNumber;
            hardware: z.ZodObject<{
                hasGpu: z.ZodBoolean;
                inferenceBackend: z.ZodOptional<z.ZodString>;
                cpuCores: z.ZodOptional<z.ZodNumber>;
            }, z.core.$strip>;
        }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
        /** Return aggregate runtime metrics for this runner instance. */
        readonly getLocalMetrics: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodObject<{
            nodeId: z.ZodString;
            activeCameras: z.ZodNumber;
            throttledCameras: z.ZodNumber;
            avgInferenceTimeMs: z.ZodNumber;
            queueDepth: z.ZodNumber;
        }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
        /** Per-camera metrics for cameras attached to this runner. */
        readonly getCameraMetrics: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            deviceId: z.ZodNumber;
        }, z.core.$strip>, z.ZodNullable<z.ZodObject<{
            detectionMode: z.ZodEnum<{
                disabled: "disabled";
                "always-on": "always-on";
                "on-motion": "on-motion";
            }>;
            configuredFps: z.ZodNumber;
            actualFps: z.ZodNumber;
            queueDepth: z.ZodNumber;
            avgInferenceTimeMs: z.ZodNumber;
            droppedFrames: z.ZodNumber;
            phase: z.ZodEnum<{
                idle: "idle";
                watching: "watching";
                active: "active";
            }>;
        }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
        /** All per-camera metrics in one round-trip. */
        readonly getAllCameraMetrics: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodReadonly<z.ZodArray<z.ZodObject<{
            detectionMode: z.ZodEnum<{
                disabled: "disabled";
                "always-on": "always-on";
                "on-motion": "on-motion";
            }>;
            configuredFps: z.ZodNumber;
            actualFps: z.ZodNumber;
            queueDepth: z.ZodNumber;
            avgInferenceTimeMs: z.ZodNumber;
            droppedFrames: z.ZodNumber;
            phase: z.ZodEnum<{
                idle: "idle";
                watching: "watching";
                active: "active";
            }>;
            deviceId: z.ZodNumber;
        }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
        /** List the deviceIds currently attached to this runner. */
        readonly getLocalCameras: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodReadonly<z.ZodArray<z.ZodNumber>>, import("./capability-definition.js").CapabilityMethodKind>;
    };
};
export type IPipelineRunnerProvider = InferProvider<typeof pipelineRunnerCapability>;
export { RunnerCameraConfigSchema, RunnerLocalLoadSchema, RunnerLocalMetricsSchema };
//# sourceMappingURL=pipeline-runner.cap.d.ts.map