@camstack/addon-mqtt-broker 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4668,63 +4668,7 @@ function _instanceof(cls, params = {}) {
4668
4668
  return inst;
4669
4669
  }
4670
4670
  //#endregion
4671
- //#region ../types/dist/index.mjs
4672
- /**
4673
- * Deep wiring healthcheck — snapshot of active reachability probes across
4674
- * every declared capability + widget of every installed plugin, on every
4675
- * node. Produced by the backend `WiringHealthService` and surfaced via
4676
- * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
4677
- *
4678
- * Unlike `/health` (process liveness), this reflects whether each cap/widget
4679
- * is actually *reachable* over the real cap-dispatch path. See spec
4680
- * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
4681
- */
4682
- /** What kind of target a probe addressed. */
4683
- var wiringProbeKindSchema = _enum([
4684
- "singleton",
4685
- "device",
4686
- "widget"
4687
- ]);
4688
- /** Result of probing a single (cap|widget [, device]) target. */
4689
- var wiringProbeResultSchema = object({
4690
- capName: string(),
4691
- kind: wiringProbeKindSchema,
4692
- deviceId: number().optional(),
4693
- reachable: boolean(),
4694
- latencyMs: number(),
4695
- error: string().optional()
4696
- });
4697
- /** Per-addon roll-up of cap + widget probe results. */
4698
- var wiringAddonHealthSchema = object({
4699
- addonId: string(),
4700
- caps: array(wiringProbeResultSchema).readonly(),
4701
- widgets: array(wiringProbeResultSchema).readonly()
4702
- });
4703
- /** Per-node roll-up. */
4704
- var wiringNodeHealthSchema = object({
4705
- nodeId: string(),
4706
- addons: array(wiringAddonHealthSchema).readonly()
4707
- });
4708
- object({
4709
- /** True only when every probed target is reachable. */
4710
- ok: boolean(),
4711
- /** True when at least one target is unreachable. */
4712
- degraded: boolean(),
4713
- checkedAt: string(),
4714
- nodes: array(wiringNodeHealthSchema).readonly(),
4715
- summary: object({
4716
- total: number(),
4717
- reachable: number(),
4718
- unreachable: number()
4719
- })
4720
- });
4721
- var MODEL_FORMATS = [
4722
- "onnx",
4723
- "coreml",
4724
- "openvino",
4725
- "tflite",
4726
- "pt"
4727
- ];
4671
+ //#region ../types/dist/sleep-D7JeS58T.mjs
4728
4672
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4729
4673
  EventCategory["SystemBoot"] = "system.boot";
4730
4674
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5022,6 +4966,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
5022
4966
  */
5023
4967
  EventCategory["PipelineEngineMetricsSnapshot"] = "pipeline.engine-metrics-snapshot";
5024
4968
  /**
4969
+ * Per-node detection-engine runtime-provisioning transition. Emitted by
4970
+ * the detection-pipeline provider on every state change of its lazy
4971
+ * engine-provisioning machine (idle → installing → verifying → ready,
4972
+ * or → failed with a `nextRetryAt`). Payload is the
4973
+ * `EngineProvisioningState` snapshot; `event.source.nodeId` carries the
4974
+ * node. The Pipeline page subscribes to drive a live "installing
4975
+ * OpenVINO… / ready" indicator per node without polling
4976
+ * `pipelineExecutor.getEngineProvisioning`. Telemetry-grade (D8): the UI
4977
+ * also reads the cap snapshot on mount / reconnect. Phase 2.
4978
+ */
4979
+ EventCategory["PipelineEngineProvisioning"] = "pipeline.engine-provisioning";
4980
+ /**
5025
4981
  * Cluster topology snapshot. Carries the same payload returned by
5026
4982
  * `nodes.topology` (every reachable node + addons + processes).
5027
4983
  * Emitted by the hub on any agent / addon lifecycle change
@@ -6035,7 +5991,7 @@ var ProfileSlotSchema = object({
6035
5991
  * Zod schema for StreamSourceEntry — the canonical stream descriptor
6036
5992
  * exposed by ICameraDevice.getStreamSources() and consumed by the broker.
6037
5993
  */
6038
- var StreamSourceEntrySchema = object({
5994
+ var StreamSourceEntrySchema$1 = object({
6039
5995
  id: string(),
6040
5996
  label: string(),
6041
5997
  protocol: _enum([
@@ -6257,894 +6213,1080 @@ var ProfileRtspEntrySchema = object({
6257
6213
  codec: string().optional(),
6258
6214
  resolution: CamStreamResolutionSchema.optional()
6259
6215
  });
6260
- /**
6261
- * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6262
- * Named `RecordingWeekday` to avoid collision with the string-union
6263
- * `Weekday` exported from `interfaces/timezones.ts`.
6264
- */
6265
- var RecordingWeekdaySchema = number().int().min(0).max(6);
6266
- var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6267
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6268
- kind: literal("timeOfDay"),
6269
- start: string().regex(HHMM),
6270
- end: string().regex(HHMM),
6271
- /** Restrict to these weekdays; omit = every day. */
6272
- days: array(RecordingWeekdaySchema).optional()
6273
- })]);
6274
- var RecordingModeSchema = _enum([
6275
- "continuous",
6276
- "onMotion",
6277
- "onAudioThreshold"
6278
- ]);
6279
- /**
6280
- * First-class, authoritative per-camera storage mode the netta choice the UI
6281
- * reads directly (never inferred from `rules`):
6282
- * - `off` not recording.
6283
- * - `events` — record only around triggers (motion / audio threshold),
6284
- * with pre/post-buffer.
6285
- * - `continuous` record 24/7 within the schedule.
6286
- *
6287
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6288
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6289
- */
6290
- var RecordingStorageModeSchema = _enum([
6291
- "off",
6292
- "events",
6293
- "continuous"
6294
- ]);
6295
- /** Which detectors trigger an `events`-mode recording. */
6296
- var RecordingTriggersSchema = object({
6297
- motion: boolean().optional(),
6298
- audioThresholdDbfs: number().optional()
6299
- });
6300
- /**
6301
- * Mode of a single recording band the recorder per-band vocabulary.
6302
- *
6303
- * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6304
- * only ever `continuous` or `events`; "off" is expressed by the absence of a
6305
- * covering band, not by a band value.
6306
- */
6307
- var RecordingBandModeSchema = _enum(["continuous", "events"]);
6308
- /**
6309
- * Triggers for an `events`-mode band. Identical shape to
6310
- * `RecordingTriggersSchema`reuse that schema as the band trigger type so the
6311
- * two never drift.
6312
- */
6313
- var RecordingBandTriggersSchema = RecordingTriggersSchema;
6314
- /**
6315
- * A single mode-per-band window the canonical recorder band shape, the
6316
- * single source of truth re-used by `addon-pipeline/recorder`.
6317
- *
6318
- * `days` lists the weekdays the band covers (empty = every day, matching the
6319
- * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6320
- * span wraps past midnight (handled by the band engine).
6321
- */
6322
- var RecordingBandSchema = object({
6323
- days: array(RecordingWeekdaySchema),
6324
- start: string().regex(HHMM),
6325
- end: string().regex(HHMM),
6326
- mode: RecordingBandModeSchema,
6327
- triggers: RecordingBandTriggersSchema.optional(),
6328
- preBufferSec: number().min(0).optional(),
6329
- postBufferSec: number().min(0).optional()
6330
- });
6331
- var RecordingRuleSchema = object({
6332
- schedule: RecordingScheduleSchema,
6333
- mode: RecordingModeSchema,
6334
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6335
- preBufferSec: number().min(0).default(0),
6336
- /** Keep recording until this many seconds after the last trigger. */
6337
- postBufferSec: number().min(0).default(0),
6338
- /** Each new trigger restarts the post-buffer window. */
6339
- resetTimeoutOnNewEvent: boolean().default(true),
6340
- /** onAudioThreshold only dBFS level that counts as a trigger. */
6341
- thresholdDbfs: number().optional()
6342
- });
6343
- /**
6344
- * Per-device retention overrides. Every field is optional; an unset or `0`
6345
- * value inherits the node-wide recorder default. Only footage-lifetime limits
6346
- * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6347
- * (when the volume is too full to keep recording) is NOT a per-camera concern —
6348
- * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6349
- * shared by every camera writing to that volume.
6350
- */
6351
- var RecordingRetentionSchema = object({
6352
- maxAgeDays: number().min(0).optional(),
6353
- maxSizeGb: number().min(0).optional()
6354
- });
6355
- /**
6356
- * The full per-camera recording intent — the wire shape of a RecordingTarget.
6357
- *
6358
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6359
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6360
- * only for transition + migration (`migrateRulesToMode`); the policy engine
6361
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6362
- */
6363
- var RecordingConfigSchema = object({
6364
- enabled: boolean(),
6365
- /** Authoritative storage mode. Absent on legacy targets → derived once via
6366
- * `migrateRulesToMode`, then persisted. */
6367
- mode: RecordingStorageModeSchema.optional(),
6368
- profiles: array(CamProfileSchema).optional(),
6369
- segmentSeconds: number().int().positive().optional(),
6370
- /** Shared recording time-bands for `events` & `continuous` — record only when
6371
- * the wall-clock falls inside one of these windows. Omit or empty = always.
6372
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
6373
- schedules: array(RecordingScheduleSchema).optional(),
6374
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
6375
- * normalized into `schedules` on read and never written going forward. (Not
6376
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
6377
- schedule: RecordingScheduleSchema.optional(),
6378
- /** `events`-mode only — which detectors trigger a recording. */
6379
- triggers: RecordingTriggersSchema.optional(),
6380
- /** `events`-mode only — seconds retained before / after a trigger. */
6381
- preBufferSec: number().min(0).optional(),
6382
- postBufferSec: number().min(0).optional(),
6383
- /** DEPRECATED authoring input; retained for migration/transition. */
6384
- rules: array(RecordingRuleSchema).optional(),
6385
- /**
6386
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
6387
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
6388
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
6389
- * derived into bands once via `migrateConfigToBands`.
6390
- */
6391
- bands: array(RecordingBandSchema).optional(),
6392
- retention: RecordingRetentionSchema.optional()
6393
- });
6394
- /**
6395
- * `StorageLocationType` — an addon-declared id that identifies the *kind* of
6396
- * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
6397
- * so the persisted record schema and the consumer-facing cap can both consume it
6398
- * without forming a circular import. The `storage` cap re-exports it
6399
- * verbatim for back-compat.
6400
- *
6401
- * This Zod schema is the **authoritative source** for `StorageLocationType`.
6402
- * The TS alias in `./storage.ts` re-exports `z.infer<typeof
6403
- * StorageLocationTypeSchema>` so the wire surface (cap) and the legacy
6404
- * `IStorageProvider` interface stay in lockstep.
6405
- *
6406
- * The type is now an **open string** (not a closed enum) — addons declare
6407
- * their own location kinds via `StorageLocationDeclaration.id`. The regex
6408
- * enforces a safe id format: lowercase-start, alphanumeric + hyphens.
6409
- */
6410
- var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
6411
- /**
6412
- * Persisted record for a storage location instance. Operators can register
6413
- * multiple instances for multi-cardinality types (e.g. two `backups`
6414
- * locations with different `providerId`s). Cardinality is now declared per
6415
- * location via `StorageLocationDeclaration.cardinality` — the static
6416
- * `STORAGE_LOCATION_CARDINALITY` map has been removed.
6417
- *
6418
- * `id` is a stable namespaced string of the form `<type>:<slug>`.
6419
- * The default location for a type uses `id === <type>:default` by
6420
- * convention (the bare type ref like `'backups'` resolves to it).
6421
- *
6422
- * `isSystem: true` marks a location as orchestrator-seeded and
6423
- * undeletable. The bootstrap-installed defaults (one per type) carry
6424
- * this flag; operator-added locations don't. Editing the config of
6425
- * a system location is allowed (path migration, provider swap) but
6426
- * deleting it is rejected at the cap level.
6427
- */
6428
- var StorageLocationSchema = object({
6429
- id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
6430
- type: string(),
6431
- displayName: string().min(1),
6432
- providerId: string().min(1),
6433
- config: record(string(), unknown()),
6434
- /**
6435
- * Cluster node this location physically lives on. REQUIRED for node-local
6436
- * providers (filesystem — the path exists on one node's disk), null/absent
6437
- * for node-agnostic providers (S3/SFTP/WebDAV, reachable from any node).
6438
- * `'hub'` is the hub node. Validated against the provider's `nodeLocal`
6439
- * flag at upsert time, not here (the schema is provider-agnostic).
6440
- */
6441
- nodeId: string().optional(),
6442
- isDefault: boolean().default(false),
6443
- isSystem: boolean().default(false),
6444
- createdAt: number(),
6445
- updatedAt: number()
6446
- });
6447
- /**
6448
- * Reference accepted by consumer-facing `api.storage.*` calls.
6449
- * Either:
6450
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
6451
- * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
6452
- *
6453
- * The orchestrator's `resolveRef(ref)` handles both cases.
6454
- */
6455
- var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]);
6456
- /**
6457
- * `StorageLocationDeclaration` — a single storage-location entry declared by
6458
- * an addon in its `package.json` under `camstack.storageLocations`.
6459
- *
6460
- * Design intent:
6461
- * - **Addon declares its needs** — each addon describes the logical storage
6462
- * slots it requires (e.g. `recordings`, `recordingsLow`) without caring
6463
- * about the physical path.
6464
- * - **Kernel aggregates** — at boot the kernel collects declarations from all
6465
- * installed addons, deduplicates by `id`, and exposes the union via the
6466
- * storage-locations settings surface.
6467
- * - **Orchestrator seeds** — for every declared `id` the orchestrator ensures
6468
- * at least one instance named `<id>:default` is present, using
6469
- * `defaultsTo` to inherit the resolved root from another location when the
6470
- * declaration is a derivative slot (e.g. `recordingsLow` defaults to
6471
- * `recordings`).
6472
- * - **ids are global** — `id` values are shared across the entire deployment;
6473
- * two addons declaring the same `id` must agree on `cardinality` (validated
6474
- * at kernel aggregation time, not here).
6475
- */
6476
- var StorageLocationDeclarationSchema = object({
6477
- /**
6478
- * Global location identifier, e.g. `recordings` or `recordingsLow`.
6479
- * Must start with a lowercase letter and may contain letters, digits, and
6480
- * hyphens.
6481
- */
6482
- id: string().regex(/^[a-z][a-zA-Z0-9-]*$/, { message: "id must start with a lowercase letter and contain only letters, digits, or hyphens" }),
6483
- /** Human-readable name shown in the admin UI. */
6484
- displayName: string().min(1, { message: "displayName must not be empty" }),
6485
- /** Optional longer explanation of what data this location stores. */
6486
- description: string().optional(),
6487
- /**
6488
- * `single` — exactly one instance of this location is allowed system-wide
6489
- * (e.g. `logs`, `models`). The operator can edit it but not add more.
6490
- * `multi` — the operator may register several instances (e.g. a second
6491
- * `recordings` on a NAS for disk tiering); one is the default at any time.
6492
- */
6493
- cardinality: _enum(["single", "multi"]),
6494
- /**
6495
- * When set, the default instance for this location inherits its resolved
6496
- * root from the named location's default instance. Useful for derivative
6497
- * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
6498
- * configure the primary location.
6499
- */
6500
- defaultsTo: string().optional()
6501
- });
6502
- var DecoderStatsSchema = object({
6503
- inputFps: number(),
6504
- outputFps: number(),
6505
- avgDecodeTimeMs: number(),
6506
- droppedFrames: number()
6507
- });
6508
- var DecoderSessionConfigSchema = object({
6509
- codec: string(),
6510
- maxFps: number().default(0),
6511
- outputFormat: _enum([
6512
- "jpeg",
6513
- "rgb",
6514
- "bgr",
6515
- "yuv420",
6516
- "gray"
6517
- ]).default("jpeg"),
6518
- scale: number().default(1),
6519
- width: number().optional(),
6520
- height: number().optional(),
6216
+ var DeviceType = /* @__PURE__ */ function(DeviceType) {
6217
+ DeviceType["Camera"] = "camera";
6218
+ DeviceType["Hub"] = "hub";
6219
+ DeviceType["Light"] = "light";
6220
+ DeviceType["Siren"] = "siren";
6221
+ DeviceType["Switch"] = "switch";
6222
+ DeviceType["Sensor"] = "sensor";
6223
+ DeviceType["Thermostat"] = "thermostat";
6224
+ DeviceType["Button"] = "button";
6225
+ /** Generic stateless event emitter — carries a device's EXACT declared
6226
+ * event vocabulary verbatim (no normalization). Installed with the
6227
+ * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6228
+ * HA bus events (e.g. `zha_event`, generic). */
6229
+ DeviceType["EventEmitter"] = "event-emitter";
6230
+ /** Firmware/software update entity — current vs available version,
6231
+ * updatable flag, update state, and an install action. Installed with
6232
+ * the `update` cap. Sources: Homematic firmware-update channels (and
6233
+ * reusable by other providers, e.g. HA `update.*` entities). */
6234
+ DeviceType["Update"] = "update";
6235
+ DeviceType["Generic"] = "generic";
6236
+ /** Generic notification delivery target (HA `notify.<service>`, future
6237
+ * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6238
+ * endpoint; the `notifier` cap defines the send surface. */
6239
+ DeviceType["Notifier"] = "notifier";
6240
+ /** Pre-recorded action sequence with optional parameters
6241
+ * (HA `script.*`). Runnable via `script-runner` cap. */
6242
+ DeviceType["Script"] = "script";
6243
+ /** Automation rule (HA `automation.*`) enable/disable + manual
6244
+ * trigger surface exposed via `automation-control` cap. */
6245
+ DeviceType["Automation"] = "automation";
6246
+ /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6247
+ DeviceType["Lock"] = "lock";
6248
+ /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6249
+ * `valve.*`). `cover` cap with sub-roles for variant. */
6250
+ DeviceType["Cover"] = "cover";
6251
+ /** Pipe / water / gas valve with open/close/stop and optional
6252
+ * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6253
+ * modelled on the same open/closed lifecycle. */
6254
+ DeviceType["Valve"] = "valve";
6255
+ /** Humidifier / dehumidifier with on/off + target humidity + mode
6256
+ * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6257
+ * modelled on the same target / mode lifecycle. */
6258
+ DeviceType["Humidifier"] = "humidifier";
6259
+ /** Water heater / boiler with target temperature + operation mode +
6260
+ * away mode (HA `water_heater.*`). `water-heater` cap a
6261
+ * climate-family actuator. */
6262
+ DeviceType["WaterHeater"] = "water-heater";
6263
+ /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6264
+ DeviceType["Fan"] = "fan";
6265
+ /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6266
+ * the camera surface those use `Camera`. `media-player` cap. */
6267
+ DeviceType["MediaPlayer"] = "media-player";
6268
+ /** Security panel / alarm system (HA `alarm_control_panel.*`).
6269
+ * `alarm-panel` cap. */
6270
+ DeviceType["AlarmPanel"] = "alarm-panel";
6271
+ /** Generic user-settable input (HA `number` / `input_number` / `select`
6272
+ * / `input_select` / `text` / `input_text` / `input_datetime`).
6273
+ * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6274
+ * TextControl / DateTimeControl. */
6275
+ DeviceType["Control"] = "control";
6276
+ /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6277
+ * `presence` cap. */
6278
+ DeviceType["Presence"] = "presence";
6279
+ /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6280
+ * `weather` cap. */
6281
+ DeviceType["Weather"] = "weather";
6282
+ /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6283
+ DeviceType["Vacuum"] = "vacuum";
6284
+ /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6285
+ * `lawn-mower-control` cap. */
6286
+ DeviceType["LawnMower"] = "lawn-mower";
6287
+ /** Physical HA device group — parent container for entity-children
6288
+ * adopted from a single HA device entry. Not renderable as a
6289
+ * standalone device; exists only to anchor child entities. */
6290
+ DeviceType["Container"] = "container";
6291
+ /** Single still-image entity (HA `image.*`). Read-only display of an
6292
+ * `entity_picture` signed URL the browser loads directly. `image` cap. */
6293
+ DeviceType["Image"] = "image";
6294
+ return DeviceType;
6295
+ }({});
6296
+ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6297
+ DeviceFeature["BatteryOperated"] = "battery-operated";
6298
+ DeviceFeature["Rebootable"] = "rebootable";
6521
6299
  /**
6522
- * Identifier of the camera this decoder session serves. Optional
6523
- * because the cap is generic (any caller could request decode), but
6524
- * stream-broker passes it so decoder logs include `deviceId` for
6525
- * per-camera filtering when diagnosing failures (e.g. node-av
6526
- * sendPacket errors on a single hung camera).
6300
+ * Device supports an on-demand re-sync of its derived spec with its
6301
+ * upstream source drives the generic Re-sync button. The owning
6302
+ * provider implements the action via the `device-adoption.resync` cap.
6527
6303
  */
6528
- deviceId: number().int().nonnegative().optional(),
6304
+ DeviceFeature["Resyncable"] = "resyncable";
6305
+ DeviceFeature["NativeSnapshot"] = "native-snapshot";
6306
+ DeviceFeature["DoorbellButton"] = "doorbell-button";
6307
+ DeviceFeature["TwoWayAudio"] = "two-way-audio";
6308
+ DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6529
6309
  /**
6530
- * Free-form tag for log scoping. Stream-broker uses
6531
- * `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
6532
- * on every line so `grep tag=broker:5/high` filters one camera
6533
- * profile cleanly.
6310
+ * Camera supports the on-firmware autotrack subsystem (subject-
6311
+ * following). Distinct from `PanTiltZoom` because not every PTZ
6312
+ * camera ships autotrack the admin UI uses this flag to gate
6313
+ * the autotrack toggle / settings card without re-deriving from
6314
+ * the cap registry. Mirrors `ptz-autotrack` cap registration:
6315
+ * driver sets this feature when probe confirms the firmware
6316
+ * surface, and registers the cap in the same code path.
6534
6317
  */
6535
- tag: string().optional(),
6318
+ DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6536
6319
  /**
6537
- * Where the session delivers decoded frames (Phase 5 / D9):
6320
+ * Accessory exposes a "trigger on motion" toggle the parent camera's
6321
+ * motion detection automatically activates this device. Mirrors
6322
+ * `motion-trigger` cap registration: drivers set this feature in the
6323
+ * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6538
6324
  *
6539
- * - `'callback'` (default) the legacy pixel path: decoded frames are
6540
- * buffered as `DecodedFrame`s and drained via `pullFrames`.
6541
- * - `'shm'` the shared-memory frame plane: decoded frames are written
6542
- * into an OS shared-memory ring and drained as zero-pixel
6543
- * `FrameHandle`s via `pullHandles`. A session is one mode or the
6544
- * other — `pullFrames` returns nothing for an `'shm'` session and
6545
- * `pullHandles` returns nothing for a `'callback'` session.
6546
- */
6547
- frameSink: _enum(["callback", "shm"]).default("callback")
6548
- });
6549
- var EncodeProfileSchema = object({
6550
- video: object({
6551
- codec: _enum([
6552
- "h264",
6553
- "h265",
6554
- "copy"
6555
- ]),
6556
- profile: _enum([
6557
- "baseline",
6558
- "main",
6559
- "high"
6560
- ]).optional(),
6561
- width: number().int().positive().optional(),
6562
- height: number().int().positive().optional(),
6563
- fps: number().positive().optional(),
6564
- bitrateKbps: number().int().positive().optional(),
6565
- gopFrames: number().int().positive().optional(),
6566
- bf: number().int().min(0).optional(),
6567
- preset: _enum([
6568
- "ultrafast",
6569
- "superfast",
6570
- "veryfast",
6571
- "faster",
6572
- "fast",
6573
- "medium"
6574
- ]).optional(),
6575
- tune: _enum([
6576
- "zerolatency",
6577
- "film",
6578
- "animation"
6579
- ]).optional()
6580
- }),
6581
- audio: union([literal("passthrough"), object({
6582
- codec: _enum([
6583
- "opus",
6584
- "aac",
6585
- "pcmu",
6586
- "pcma",
6587
- "copy"
6588
- ]),
6589
- bitrateKbps: number().int().positive().optional(),
6590
- sampleRateHz: number().int().positive().optional(),
6591
- channels: union([literal(1), literal(2)]).optional()
6592
- })]),
6593
- /**
6594
- * ffmpeg input-side args, inserted between the fixed global flags
6595
- * (`-hide_banner -loglevel error`) and `-i pipe:0`. Free-text array
6596
- * — the widget surfaces a textarea + suggestion chips for the most-
6597
- * used demuxer/format options.
6598
- */
6599
- inputArgs: array(string()).optional(),
6600
- /**
6601
- * ffmpeg output-side args, inserted between the encode block and
6602
- * the final `-f <muxer> pipe:1`. Use for muxer options, bitstream
6603
- * filters, codec-specific overrides. Free-text array.
6325
+ * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6326
+ * fast scalar without binding fetch), notifier rules, and `listAll`
6327
+ * filters that want "all devices with on-motion behaviour".
6604
6328
  */
6605
- outputArgs: array(string()).optional()
6606
- });
6607
- var YAMNET_TO_MACRO = {
6608
- mapping: {
6609
- Speech: "speech",
6610
- "Child speech, kid speaking": "speech",
6611
- Conversation: "speech",
6612
- "Narration, monologue": "speech",
6613
- Babbling: "speech",
6614
- Whispering: "speech",
6615
- "Speech synthesizer": "speech",
6616
- Humming: "speech",
6617
- Rapping: "speech",
6618
- Singing: "speech",
6619
- Choir: "speech",
6620
- "Child singing": "speech",
6621
- Shout: "scream",
6622
- Bellow: "scream",
6623
- Yell: "scream",
6624
- Screaming: "scream",
6625
- "Children shouting": "scream",
6626
- Whoop: "scream",
6627
- "Crying, sobbing": "crying",
6628
- "Baby cry, infant cry": "crying",
6629
- Whimper: "crying",
6630
- "Wail, moan": "crying",
6631
- Groan: "crying",
6632
- Laughter: "laughter",
6633
- "Baby laughter": "laughter",
6634
- Giggle: "laughter",
6635
- Snicker: "laughter",
6636
- "Belly laugh": "laughter",
6637
- "Chuckle, chortle": "laughter",
6638
- Music: "music",
6639
- "Musical instrument": "music",
6640
- Guitar: "music",
6641
- Piano: "music",
6642
- Drum: "music",
6643
- "Drum kit": "music",
6644
- "Violin, fiddle": "music",
6645
- Flute: "music",
6646
- Saxophone: "music",
6647
- Trumpet: "music",
6648
- Synthesizer: "music",
6649
- "Pop music": "music",
6650
- "Rock music": "music",
6651
- "Hip hop music": "music",
6652
- "Classical music": "music",
6653
- Jazz: "music",
6654
- "Electronic music": "music",
6655
- "Background music": "music",
6656
- Dog: "dog",
6657
- Bark: "dog",
6658
- Yip: "dog",
6659
- Howl: "dog",
6660
- "Bow-wow": "dog",
6661
- Growling: "dog",
6662
- "Whimper (dog)": "dog",
6663
- Cat: "cat",
6664
- Purr: "cat",
6665
- Meow: "cat",
6666
- Hiss: "cat",
6667
- Caterwaul: "cat",
6668
- Bird: "bird",
6669
- "Bird vocalization, bird call, bird song": "bird",
6670
- "Chirp, tweet": "bird",
6671
- Squawk: "bird",
6672
- Crow: "bird",
6673
- Owl: "bird",
6674
- "Pigeon, dove": "bird",
6675
- Animal: "animal",
6676
- "Domestic animals, pets": "animal",
6677
- "Livestock, farm animals, working animals": "animal",
6678
- Horse: "animal",
6679
- "Cattle, bovinae": "animal",
6680
- Pig: "animal",
6681
- Sheep: "animal",
6682
- Goat: "animal",
6683
- Frog: "animal",
6684
- Insect: "animal",
6685
- Cricket: "animal",
6686
- Alarm: "alarm",
6687
- "Alarm clock": "alarm",
6688
- "Smoke detector, smoke alarm": "alarm",
6689
- "Fire alarm": "alarm",
6690
- Buzzer: "alarm",
6691
- "Civil defense siren": "alarm",
6692
- "Car alarm": "alarm",
6693
- Siren: "siren",
6694
- "Police car (siren)": "siren",
6695
- "Ambulance (siren)": "siren",
6696
- "Fire engine, fire truck (siren)": "siren",
6697
- "Emergency vehicle": "siren",
6698
- Foghorn: "siren",
6699
- Doorbell: "doorbell",
6700
- "Ding-dong": "doorbell",
6701
- Knock: "doorbell",
6702
- Tap: "doorbell",
6703
- Glass: "glass_breaking",
6704
- Shatter: "glass_breaking",
6705
- "Chink, clink": "glass_breaking",
6706
- "Gunshot, gunfire": "gunshot",
6707
- "Machine gun": "gunshot",
6708
- Explosion: "gunshot",
6709
- Fireworks: "gunshot",
6710
- Firecracker: "gunshot",
6711
- "Artillery fire": "gunshot",
6712
- "Cap gun": "gunshot",
6713
- Boom: "gunshot",
6714
- Vehicle: "vehicle",
6715
- Car: "vehicle",
6716
- Truck: "vehicle",
6717
- Bus: "vehicle",
6718
- Motorcycle: "vehicle",
6719
- "Car passing by": "vehicle",
6720
- "Vehicle horn, car horn, honking": "vehicle",
6721
- "Traffic noise, roadway noise": "vehicle",
6722
- Train: "vehicle",
6723
- Aircraft: "vehicle",
6724
- Helicopter: "vehicle",
6725
- Bicycle: "vehicle",
6726
- Skateboard: "vehicle",
6727
- Fire: "fire",
6728
- Crackle: "fire",
6729
- Water: "water",
6730
- Rain: "water",
6731
- Raindrop: "water",
6732
- "Rain on surface": "water",
6733
- Stream: "water",
6734
- Waterfall: "water",
6735
- Ocean: "water",
6736
- "Waves, surf": "water",
6737
- "Splash, splatter": "water",
6738
- Wind: "wind",
6739
- Thunderstorm: "wind",
6740
- Thunder: "wind",
6741
- "Wind noise (microphone)": "wind",
6742
- "Rustling leaves": "wind",
6743
- Door: "door",
6744
- "Sliding door": "door",
6745
- Slam: "door",
6746
- "Cupboard open or close": "door",
6747
- "Walk, footsteps": "footsteps",
6748
- Run: "footsteps",
6749
- Shuffle: "footsteps",
6750
- Crowd: "crowd",
6751
- Chatter: "crowd",
6752
- Cheering: "crowd",
6753
- Applause: "crowd",
6754
- "Children playing": "crowd",
6755
- "Hubbub, speech noise, speech babble": "crowd",
6756
- Telephone: "telephone",
6757
- "Telephone bell ringing": "telephone",
6758
- Ringtone: "telephone",
6759
- "Telephone dialing, DTMF": "telephone",
6760
- "Busy signal": "telephone",
6761
- Engine: "engine",
6762
- "Engine starting": "engine",
6763
- Idling: "engine",
6764
- "Accelerating, revving, vroom": "engine",
6765
- "Light engine (high frequency)": "engine",
6766
- "Medium engine (mid frequency)": "engine",
6767
- "Heavy engine (low frequency)": "engine",
6768
- "Lawn mower": "engine",
6769
- Chainsaw: "engine",
6770
- Hammer: "tools",
6771
- Jackhammer: "tools",
6772
- Sawing: "tools",
6773
- "Power tool": "tools",
6774
- Drill: "tools",
6775
- Sanding: "tools",
6776
- Silence: "silence"
6777
- },
6778
- preserveOriginal: false
6779
- };
6780
- var APPLE_SA_TO_MACRO = {
6781
- mapping: {
6782
- speech: "speech",
6783
- child_speech: "speech",
6784
- conversation: "speech",
6785
- whispering: "speech",
6786
- singing: "speech",
6787
- humming: "speech",
6788
- shout: "scream",
6789
- yell: "scream",
6790
- screaming: "scream",
6791
- crying: "crying",
6792
- baby_crying: "crying",
6793
- sobbing: "crying",
6794
- laughter: "laughter",
6795
- baby_laughter: "laughter",
6796
- giggling: "laughter",
6797
- music: "music",
6798
- guitar: "music",
6799
- piano: "music",
6800
- drums: "music",
6801
- dog_bark: "dog",
6802
- dog_bow_wow: "dog",
6803
- dog_growling: "dog",
6804
- dog_howl: "dog",
6805
- cat_meow: "cat",
6806
- cat_purr: "cat",
6807
- cat_hiss: "cat",
6808
- bird: "bird",
6809
- bird_chirp: "bird",
6810
- bird_squawk: "bird",
6811
- animal: "animal",
6812
- horse: "animal",
6813
- cow_moo: "animal",
6814
- insect: "animal",
6815
- alarm: "alarm",
6816
- smoke_alarm: "alarm",
6817
- fire_alarm: "alarm",
6818
- car_alarm: "alarm",
6819
- siren: "siren",
6820
- police_siren: "siren",
6821
- ambulance_siren: "siren",
6822
- doorbell: "doorbell",
6823
- door_knock: "doorbell",
6824
- knocking: "doorbell",
6825
- glass_breaking: "glass_breaking",
6826
- glass_shatter: "glass_breaking",
6827
- gunshot: "gunshot",
6828
- explosion: "gunshot",
6829
- fireworks: "gunshot",
6830
- car: "vehicle",
6831
- truck: "vehicle",
6832
- motorcycle: "vehicle",
6833
- car_horn: "vehicle",
6834
- vehicle_horn: "vehicle",
6835
- traffic: "vehicle",
6836
- fire: "fire",
6837
- fire_crackle: "fire",
6838
- water: "water",
6839
- rain: "water",
6840
- ocean: "water",
6841
- splash: "water",
6842
- wind: "wind",
6843
- thunder: "wind",
6844
- thunderstorm: "wind",
6845
- door: "door",
6846
- door_slam: "door",
6847
- sliding_door: "door",
6848
- footsteps: "footsteps",
6849
- walking: "footsteps",
6850
- running: "footsteps",
6851
- crowd: "crowd",
6852
- chatter: "crowd",
6853
- cheering: "crowd",
6854
- applause: "crowd",
6855
- telephone_ring: "telephone",
6856
- ringtone: "telephone",
6857
- engine: "engine",
6858
- engine_starting: "engine",
6859
- lawn_mower: "engine",
6860
- chainsaw: "engine",
6861
- hammer: "tools",
6862
- jackhammer: "tools",
6863
- drill: "tools",
6864
- power_tool: "tools",
6865
- silence: "silence"
6866
- },
6867
- preserveOriginal: false
6868
- };
6869
- var _macroLookup = /* @__PURE__ */ new Map();
6870
- for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6871
- for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6872
- var DeviceType = /* @__PURE__ */ function(DeviceType) {
6873
- DeviceType["Camera"] = "camera";
6874
- DeviceType["Hub"] = "hub";
6875
- DeviceType["Light"] = "light";
6876
- DeviceType["Siren"] = "siren";
6877
- DeviceType["Switch"] = "switch";
6878
- DeviceType["Sensor"] = "sensor";
6879
- DeviceType["Thermostat"] = "thermostat";
6880
- DeviceType["Button"] = "button";
6881
- /** Generic stateless event emitter — carries a device's EXACT declared
6882
- * event vocabulary verbatim (no normalization). Installed with the
6883
- * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6884
- * HA bus events (e.g. `zha_event`, generic). */
6885
- DeviceType["EventEmitter"] = "event-emitter";
6886
- /** Firmware/software update entity — current vs available version,
6887
- * updatable flag, update state, and an install action. Installed with
6888
- * the `update` cap. Sources: Homematic firmware-update channels (and
6889
- * reusable by other providers, e.g. HA `update.*` entities). */
6890
- DeviceType["Update"] = "update";
6891
- DeviceType["Generic"] = "generic";
6892
- /** Generic notification delivery target (HA `notify.<service>`, future
6893
- * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6894
- * endpoint; the `notifier` cap defines the send surface. */
6895
- DeviceType["Notifier"] = "notifier";
6896
- /** Pre-recorded action sequence with optional parameters
6897
- * (HA `script.*`). Runnable via `script-runner` cap. */
6898
- DeviceType["Script"] = "script";
6899
- /** Automation rule (HA `automation.*`) — enable/disable + manual
6900
- * trigger surface exposed via `automation-control` cap. */
6901
- DeviceType["Automation"] = "automation";
6902
- /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6903
- DeviceType["Lock"] = "lock";
6904
- /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6905
- * `valve.*`). `cover` cap with sub-roles for variant. */
6906
- DeviceType["Cover"] = "cover";
6907
- /** Pipe / water / gas valve with open/close/stop and optional
6908
- * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6909
- * modelled on the same open/closed lifecycle. */
6910
- DeviceType["Valve"] = "valve";
6911
- /** Humidifier / dehumidifier with on/off + target humidity + mode
6912
- * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6913
- * modelled on the same target / mode lifecycle. */
6914
- DeviceType["Humidifier"] = "humidifier";
6915
- /** Water heater / boiler with target temperature + operation mode +
6916
- * away mode (HA `water_heater.*`). `water-heater` cap — a
6917
- * climate-family actuator. */
6918
- DeviceType["WaterHeater"] = "water-heater";
6919
- /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6920
- DeviceType["Fan"] = "fan";
6921
- /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6922
- * the camera surface — those use `Camera`. `media-player` cap. */
6923
- DeviceType["MediaPlayer"] = "media-player";
6924
- /** Security panel / alarm system (HA `alarm_control_panel.*`).
6925
- * `alarm-panel` cap. */
6926
- DeviceType["AlarmPanel"] = "alarm-panel";
6927
- /** Generic user-settable input (HA `number` / `input_number` / `select`
6928
- * / `input_select` / `text` / `input_text` / `input_datetime`).
6929
- * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6930
- * TextControl / DateTimeControl. */
6931
- DeviceType["Control"] = "control";
6932
- /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6933
- * `presence` cap. */
6934
- DeviceType["Presence"] = "presence";
6935
- /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6936
- * `weather` cap. */
6937
- DeviceType["Weather"] = "weather";
6938
- /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6939
- DeviceType["Vacuum"] = "vacuum";
6940
- /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6941
- * `lawn-mower-control` cap. */
6942
- DeviceType["LawnMower"] = "lawn-mower";
6943
- /** Physical HA device group — parent container for entity-children
6944
- * adopted from a single HA device entry. Not renderable as a
6945
- * standalone device; exists only to anchor child entities. */
6946
- DeviceType["Container"] = "container";
6947
- /** Single still-image entity (HA `image.*`). Read-only display of an
6948
- * `entity_picture` signed URL the browser loads directly. `image` cap. */
6949
- DeviceType["Image"] = "image";
6950
- return DeviceType;
6329
+ DeviceFeature["MotionTrigger"] = "motion-trigger";
6330
+ /** Light supports rgb-triplet color via `color` cap. */
6331
+ DeviceFeature["LightColorRgb"] = "light-color-rgb";
6332
+ /** Light supports HSV color via `color` cap. */
6333
+ DeviceFeature["LightColorHsv"] = "light-color-hsv";
6334
+ /** Light supports color-temperature (mired) via `color` cap. */
6335
+ DeviceFeature["LightColorMired"] = "light-color-mired";
6336
+ /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6337
+ * targetHigh). Gates the range slider UI. */
6338
+ DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6339
+ /** Thermostat exposes target humidity and/or current humidity
6340
+ * readings. Gates the humidity controls. */
6341
+ DeviceFeature["ClimateHumidity"] = "climate-humidity";
6342
+ /** Thermostat exposes a fan-mode selector. */
6343
+ DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6344
+ /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6345
+ DeviceFeature["ClimatePreset"] = "climate-preset";
6346
+ /** Cover exposes intermediate position control (0..100). Gates the
6347
+ * position slider UI. */
6348
+ DeviceFeature["CoverPositionable"] = "cover-positionable";
6349
+ /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6350
+ DeviceFeature["CoverTilt"] = "cover-tilt";
6351
+ /** Valve exposes intermediate position control (0..100). Gates the
6352
+ * position slider / drag surface UI. */
6353
+ DeviceFeature["ValvePositionable"] = "valve-positionable";
6354
+ /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6355
+ DeviceFeature["FanSpeed"] = "fan-speed";
6356
+ /** Fan exposes a preset mode selector. */
6357
+ DeviceFeature["FanPreset"] = "fan-preset";
6358
+ /** Fan exposes blade direction (forward/reverse) — typical of
6359
+ * ceiling fans. */
6360
+ DeviceFeature["FanDirection"] = "fan-direction";
6361
+ /** Fan exposes an oscillation toggle. */
6362
+ DeviceFeature["FanOscillating"] = "fan-oscillating";
6363
+ /** Lock requires a PIN code on lock/unlock. Gates the code-entry
6364
+ * field on the UI lock-controls panel. */
6365
+ DeviceFeature["LockPinRequired"] = "lock-pin-required";
6366
+ /** Lock supports a latch-release ("open door") action distinct from
6367
+ * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
6368
+ * `supported_features`. Gates the Open Door button in the UI. */
6369
+ DeviceFeature["LockOpen"] = "lock-open";
6370
+ /** Media player exposes a seek-to-position surface. */
6371
+ DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
6372
+ /** Media player exposes a volume-level setter. */
6373
+ DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
6374
+ /** Media player exposes a mute toggle distinct from volume=0. */
6375
+ DeviceFeature["MediaPlayerMute"] = "media-player-mute";
6376
+ /** Media player exposes a shuffle toggle. */
6377
+ DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
6378
+ /** Media player exposes a repeat mode (off / all / one). */
6379
+ DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
6380
+ /** Media player exposes a source / input selector. */
6381
+ DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
6382
+ /** Media player exposes a play-arbitrary-media surface (URL / id). */
6383
+ DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
6384
+ /** Media player exposes next-track. */
6385
+ DeviceFeature["MediaPlayerNext"] = "media-player-next";
6386
+ /** Media player exposes previous-track. */
6387
+ DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
6388
+ /** Media player exposes stop distinct from pause. */
6389
+ DeviceFeature["MediaPlayerStop"] = "media-player-stop";
6390
+ /** Alarm panel requires a PIN code on arm/disarm. */
6391
+ DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
6392
+ /** Presence device carries GPS coordinates (lat/lng/accuracy) in
6393
+ * addition to a textual location. */
6394
+ DeviceFeature["PresenceGps"] = "presence-gps";
6395
+ /** Notifier accepts an inline / URL image attachment. */
6396
+ DeviceFeature["NotifierImage"] = "notifier-image";
6397
+ /** Notifier accepts a priority hint (high/normal/low). */
6398
+ DeviceFeature["NotifierPriority"] = "notifier-priority";
6399
+ /** Notifier accepts a free-form `data` payload for platform-specific
6400
+ * fields. */
6401
+ DeviceFeature["NotifierData"] = "notifier-data";
6402
+ /** Notifier supports interactive action buttons / callbacks. */
6403
+ DeviceFeature["NotifierActions"] = "notifier-actions";
6404
+ /** Notifier supports per-call recipient targeting (multi-user). */
6405
+ DeviceFeature["NotifierRecipients"] = "notifier-recipients";
6406
+ /** Script runner accepts a variables map on each run invocation. */
6407
+ DeviceFeature["ScriptVariables"] = "script-variables";
6408
+ /** Automation `trigger` accepts a skipCondition flag — fires the
6409
+ * automation's actions while bypassing its condition block. */
6410
+ DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
6411
+ return DeviceFeature;
6412
+ }({});
6413
+ /**
6414
+ * Semantic role a device plays within its parent. Populated by driver
6415
+ * addons when creating accessory devices (Reolink siren/floodlight/
6416
+ * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
6417
+ * admin UI to pick icons, labels, and widgets — a `Switch` with
6418
+ * `role: Floodlight` renders as a bulb with a brightness slider,
6419
+ * whereas a `Switch` with `role: Siren` renders as a klaxon.
6420
+ *
6421
+ * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
6422
+ * sqlite as a nullable TEXT column — old rows keep working unchanged.
6423
+ */
6424
+ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
6425
+ DeviceRole["Siren"] = "siren";
6426
+ DeviceRole["Floodlight"] = "floodlight";
6427
+ DeviceRole["Spotlight"] = "spotlight";
6428
+ DeviceRole["PirSensor"] = "pir-sensor";
6429
+ DeviceRole["Chime"] = "chime";
6430
+ DeviceRole["Autotrack"] = "autotrack";
6431
+ DeviceRole["Nightvision"] = "nightvision";
6432
+ DeviceRole["PrivacyMask"] = "privacy-mask";
6433
+ DeviceRole["Doorbell"] = "doorbell";
6434
+ /** Virtual HA toggle (input_boolean.*) — distinguishable from a
6435
+ * real Switch device for UI rendering / export adapters. */
6436
+ DeviceRole["BinaryHelper"] = "binary-helper";
6437
+ /** Generic motion / occupancy / moving event source. Distinct from
6438
+ * the camera accessory PirSensor role: that one is a camera child;
6439
+ * this is a standalone HA / 3rd-party motion sensor. */
6440
+ DeviceRole["MotionSensor"] = "motion-sensor";
6441
+ DeviceRole["ContactSensor"] = "contact-sensor";
6442
+ DeviceRole["LeakSensor"] = "leak-sensor";
6443
+ DeviceRole["SmokeSensor"] = "smoke-sensor";
6444
+ DeviceRole["COSensor"] = "co-sensor";
6445
+ DeviceRole["GasSensor"] = "gas-sensor";
6446
+ DeviceRole["TamperSensor"] = "tamper-sensor";
6447
+ DeviceRole["VibrationSensor"] = "vibration-sensor";
6448
+ DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
6449
+ DeviceRole["SoundSensor"] = "sound-sensor";
6450
+ /** Fallback for `binary_sensor` without a known `device_class`. */
6451
+ DeviceRole["BinarySensor"] = "binary-sensor";
6452
+ DeviceRole["TemperatureSensor"] = "temperature-sensor";
6453
+ DeviceRole["HumiditySensor"] = "humidity-sensor";
6454
+ DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
6455
+ DeviceRole["PressureSensor"] = "pressure-sensor";
6456
+ DeviceRole["PowerSensor"] = "power-sensor";
6457
+ DeviceRole["EnergySensor"] = "energy-sensor";
6458
+ DeviceRole["VoltageSensor"] = "voltage-sensor";
6459
+ DeviceRole["CurrentSensor"] = "current-sensor";
6460
+ DeviceRole["AirQualitySensor"] = "air-quality-sensor";
6461
+ /** Battery level (numeric % via `sensor` OR low-bool via
6462
+ * `binary_sensor` — the cap distinguishes via the value type). */
6463
+ DeviceRole["BatterySensor"] = "battery-sensor";
6464
+ /** Fallback for `sensor` numeric without a known `device_class`. */
6465
+ DeviceRole["NumericSensor"] = "numeric-sensor";
6466
+ /** String / enum state (HA `sensor` with `state_class: enum` or
6467
+ * `attributes.options`). */
6468
+ DeviceRole["EnumSensor"] = "enum-sensor";
6469
+ /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
6470
+ * or `date`). The slice carries the raw ISO string verbatim (hosted on
6471
+ * the `enum-sensor` cap); the UI renders it locale-formatted. */
6472
+ DeviceRole["DateTimeSensor"] = "datetime-sensor";
6473
+ /** Last-resort fallback when nothing else matches. */
6474
+ DeviceRole["GenericSensor"] = "generic-sensor";
6475
+ DeviceRole["NumericControl"] = "numeric-control";
6476
+ DeviceRole["SelectControl"] = "select-control";
6477
+ DeviceRole["TextControl"] = "text-control";
6478
+ DeviceRole["DateTimeControl"] = "datetime-control";
6479
+ /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
6480
+ * rich features (image, priority, channel routing). */
6481
+ DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
6482
+ /** Chat / messaging service (HA `notify.telegram_*`,
6483
+ * `notify.discord_*`, etc.). */
6484
+ DeviceRole["MessagingNotifier"] = "messaging-notifier";
6485
+ /** Email-based delivery (HA `notify.smtp`, etc.). */
6486
+ DeviceRole["EmailNotifier"] = "email-notifier";
6487
+ /** Fallback when the notifier service name doesn't match a known
6488
+ * pattern. */
6489
+ DeviceRole["GenericNotifier"] = "generic-notifier";
6490
+ return DeviceRole;
6951
6491
  }({});
6952
- var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6953
- DeviceFeature["BatteryOperated"] = "battery-operated";
6954
- DeviceFeature["Rebootable"] = "rebootable";
6492
+ /**
6493
+ * Generic types for capability definitions.
6494
+ *
6495
+ * A capability is defined with Zod schemas for methods, events, and settings.
6496
+ * TypeScript types are inferred via z.infer<> — zero duplication.
6497
+ *
6498
+ * Pattern:
6499
+ * 1. Define Zod schemas for data, methods, settings
6500
+ * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
6501
+ * 3. Export type IProvider = InferProvider<typeof capabilityDef>
6502
+ * 4. Addon implements IProvider
6503
+ * 5. Registry auto-mounts tRPC router from definition.methods
6504
+ */
6505
+ /**
6506
+ * Output schema shared by the contribution + live methods.
6507
+ *
6508
+ * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
6509
+ * tabs[]) without importing from `../interfaces/config-ui.js` — a
6510
+ * concrete-but-lenient Zod object keeps tRPC output inference happy
6511
+ * (using `z.unknown()` here collapses unrelated router branches to
6512
+ * `unknown` when the generator re-inlines the huge AppRouter type).
6513
+ *
6514
+ * `.passthrough()` on sections/fields accepts whatever FormBuilder
6515
+ * extensions the caller adds (showWhen, displayScale, …) without
6516
+ * rebuilding every time a new field kind is introduced.
6517
+ */
6518
+ var ContributionSectionSchema = object({
6519
+ id: string(),
6520
+ title: string(),
6521
+ description: string().optional(),
6522
+ style: _enum(["card", "accordion"]).optional(),
6523
+ defaultCollapsed: boolean().optional(),
6524
+ columns: union([
6525
+ literal(1),
6526
+ literal(2),
6527
+ literal(3),
6528
+ literal(4)
6529
+ ]).optional(),
6530
+ tab: string().optional(),
6531
+ location: _enum(["settings", "top-tab"]).optional(),
6532
+ order: number().optional(),
6533
+ fields: array(any())
6534
+ });
6535
+ object({
6536
+ tabs: array(object({
6537
+ id: string(),
6538
+ label: string(),
6539
+ icon: string(),
6540
+ order: number().optional()
6541
+ })).optional(),
6542
+ sections: array(ContributionSectionSchema)
6543
+ }).nullable();
6544
+ object({ deviceId: number() }), object({ deviceId: number() }), object({
6545
+ deviceId: number(),
6546
+ patch: record(string(), unknown())
6547
+ }), object({ success: literal(true) });
6548
+ object({ deviceId: number() }), unknown().nullable();
6549
+ /** Shorthand to define a method schema */
6550
+ function method(input, output, options) {
6551
+ return {
6552
+ input,
6553
+ output,
6554
+ kind: options?.kind ?? "query",
6555
+ auth: options?.auth ?? "protected",
6556
+ ...options?.access !== void 0 ? { access: options.access } : {},
6557
+ timeoutMs: options?.timeoutMs
6558
+ };
6559
+ }
6560
+ var StaticDirOutputSchema = object({ staticDir: string() });
6561
+ var VersionOutputSchema = object({ version: string() });
6562
+ method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
6563
+ /**
6564
+ * device-ops — device-scoped cap that unifies the per-IDevice operations
6565
+ * previously routed through the `.device-ops` Moleculer bridge service.
6566
+ *
6567
+ * Each worker that hosts live `IDevice` instances auto-registers a native
6568
+ * provider for this cap (per device) backed by its local
6569
+ * `DeviceRegistry`. Hub-side callers reach it transparently through
6570
+ * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
6571
+ * `deviceId` + `nodeId` and dispatches through the standard cap-router,
6572
+ * so there's no parallel bridge path anymore.
6573
+ *
6574
+ * The surface is intentionally small — every method corresponds to a
6575
+ * single action on the live `IDevice` (or `ICameraDevice` for
6576
+ * `getStreamSources`). Richer orchestration (enable/disable with
6577
+ * integration plumbing, bulk updates) stays in the `device-manager` cap;
6578
+ * `device-ops` is the per-device primitive the device-manager routes to.
6579
+ */
6580
+ var StreamSourceEntrySchema = object({
6581
+ id: string(),
6582
+ label: string(),
6583
+ protocol: _enum([
6584
+ "rtsp",
6585
+ "rtmp",
6586
+ "annexb",
6587
+ "http-mjpeg",
6588
+ "webrtc",
6589
+ "custom"
6590
+ ]),
6591
+ url: string().optional(),
6592
+ resolution: object({
6593
+ width: number(),
6594
+ height: number()
6595
+ }).optional(),
6596
+ fps: number().optional(),
6597
+ bitrate: number().optional(),
6598
+ codec: string().optional(),
6599
+ profileHint: CamProfileSchema.optional(),
6600
+ sdp: string().optional()
6601
+ });
6602
+ var ConfigEntrySchema$1 = object({
6603
+ key: string(),
6604
+ value: unknown()
6605
+ });
6606
+ var RawStateResultSchema = object({
6607
+ /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
6608
+ source: string(),
6609
+ /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
6610
+ data: record(string(), unknown())
6611
+ });
6612
+ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
6613
+ deviceId: number(),
6614
+ values: record(string(), unknown())
6615
+ }), _void(), { kind: "mutation" }), method(object({
6616
+ deviceId: number(),
6617
+ action: string().min(1),
6618
+ input: unknown()
6619
+ }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
6620
+ //#endregion
6621
+ //#region ../types/dist/index.mjs
6622
+ /**
6623
+ * Deep wiring healthcheck — snapshot of active reachability probes across
6624
+ * every declared capability + widget of every installed plugin, on every
6625
+ * node. Produced by the backend `WiringHealthService` and surfaced via
6626
+ * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
6627
+ *
6628
+ * Unlike `/health` (process liveness), this reflects whether each cap/widget
6629
+ * is actually *reachable* over the real cap-dispatch path. See spec
6630
+ * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
6631
+ */
6632
+ /** What kind of target a probe addressed. */
6633
+ var wiringProbeKindSchema = _enum([
6634
+ "singleton",
6635
+ "device",
6636
+ "widget"
6637
+ ]);
6638
+ /** Result of probing a single (cap|widget [, device]) target. */
6639
+ var wiringProbeResultSchema = object({
6640
+ capName: string(),
6641
+ kind: wiringProbeKindSchema,
6642
+ deviceId: number().optional(),
6643
+ reachable: boolean(),
6644
+ latencyMs: number(),
6645
+ error: string().optional()
6646
+ });
6647
+ /** Per-addon roll-up of cap + widget probe results. */
6648
+ var wiringAddonHealthSchema = object({
6649
+ addonId: string(),
6650
+ caps: array(wiringProbeResultSchema).readonly(),
6651
+ widgets: array(wiringProbeResultSchema).readonly()
6652
+ });
6653
+ /** Per-node roll-up. */
6654
+ var wiringNodeHealthSchema = object({
6655
+ nodeId: string(),
6656
+ addons: array(wiringAddonHealthSchema).readonly()
6657
+ });
6658
+ object({
6659
+ /** True only when every probed target is reachable. */
6660
+ ok: boolean(),
6661
+ /** True when at least one target is unreachable. */
6662
+ degraded: boolean(),
6663
+ checkedAt: string(),
6664
+ nodes: array(wiringNodeHealthSchema).readonly(),
6665
+ summary: object({
6666
+ total: number(),
6667
+ reachable: number(),
6668
+ unreachable: number()
6669
+ })
6670
+ });
6671
+ var MODEL_FORMATS = [
6672
+ "onnx",
6673
+ "coreml",
6674
+ "openvino",
6675
+ "tflite",
6676
+ "pt"
6677
+ ];
6678
+ /**
6679
+ * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6680
+ * Named `RecordingWeekday` to avoid collision with the string-union
6681
+ * `Weekday` exported from `interfaces/timezones.ts`.
6682
+ */
6683
+ var RecordingWeekdaySchema = number().int().min(0).max(6);
6684
+ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6685
+ var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6686
+ kind: literal("timeOfDay"),
6687
+ start: string().regex(HHMM),
6688
+ end: string().regex(HHMM),
6689
+ /** Restrict to these weekdays; omit = every day. */
6690
+ days: array(RecordingWeekdaySchema).optional()
6691
+ })]);
6692
+ var RecordingModeSchema = _enum([
6693
+ "continuous",
6694
+ "onMotion",
6695
+ "onAudioThreshold"
6696
+ ]);
6697
+ /**
6698
+ * First-class, authoritative per-camera storage mode — the netta choice the UI
6699
+ * reads directly (never inferred from `rules`):
6700
+ * - `off` — not recording.
6701
+ * - `events` — record only around triggers (motion / audio threshold),
6702
+ * with pre/post-buffer.
6703
+ * - `continuous` — record 24/7 within the schedule.
6704
+ *
6705
+ * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6706
+ * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6707
+ */
6708
+ var RecordingStorageModeSchema = _enum([
6709
+ "off",
6710
+ "events",
6711
+ "continuous"
6712
+ ]);
6713
+ /** Which detectors trigger an `events`-mode recording. */
6714
+ var RecordingTriggersSchema = object({
6715
+ motion: boolean().optional(),
6716
+ audioThresholdDbfs: number().optional()
6717
+ });
6718
+ /**
6719
+ * Mode of a single recording band — the recorder per-band vocabulary.
6720
+ *
6721
+ * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6722
+ * only ever `continuous` or `events`; "off" is expressed by the absence of a
6723
+ * covering band, not by a band value.
6724
+ */
6725
+ var RecordingBandModeSchema = _enum(["continuous", "events"]);
6726
+ /**
6727
+ * Triggers for an `events`-mode band. Identical shape to
6728
+ * `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
6729
+ * two never drift.
6730
+ */
6731
+ var RecordingBandTriggersSchema = RecordingTriggersSchema;
6732
+ /**
6733
+ * A single mode-per-band window — the canonical recorder band shape, the
6734
+ * single source of truth re-used by `addon-pipeline/recorder`.
6735
+ *
6736
+ * `days` lists the weekdays the band covers (empty = every day, matching the
6737
+ * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6738
+ * span wraps past midnight (handled by the band engine).
6739
+ */
6740
+ var RecordingBandSchema = object({
6741
+ days: array(RecordingWeekdaySchema),
6742
+ start: string().regex(HHMM),
6743
+ end: string().regex(HHMM),
6744
+ mode: RecordingBandModeSchema,
6745
+ triggers: RecordingBandTriggersSchema.optional(),
6746
+ preBufferSec: number().min(0).optional(),
6747
+ postBufferSec: number().min(0).optional()
6748
+ });
6749
+ var RecordingRuleSchema = object({
6750
+ schedule: RecordingScheduleSchema,
6751
+ mode: RecordingModeSchema,
6752
+ /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6753
+ preBufferSec: number().min(0).default(0),
6754
+ /** Keep recording until this many seconds after the last trigger. */
6755
+ postBufferSec: number().min(0).default(0),
6756
+ /** Each new trigger restarts the post-buffer window. */
6757
+ resetTimeoutOnNewEvent: boolean().default(true),
6758
+ /** onAudioThreshold only — dBFS level that counts as a trigger. */
6759
+ thresholdDbfs: number().optional()
6760
+ });
6761
+ /**
6762
+ * Per-device retention overrides. Every field is optional; an unset or `0`
6763
+ * value inherits the node-wide recorder default. Only footage-lifetime limits
6764
+ * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6765
+ * (when the volume is too full to keep recording) is NOT a per-camera concern —
6766
+ * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6767
+ * shared by every camera writing to that volume.
6768
+ */
6769
+ var RecordingRetentionSchema = object({
6770
+ maxAgeDays: number().min(0).optional(),
6771
+ maxSizeGb: number().min(0).optional()
6772
+ });
6773
+ /**
6774
+ * The full per-camera recording intent — the wire shape of a RecordingTarget.
6775
+ *
6776
+ * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6777
+ * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6778
+ * only for transition + migration (`migrateRulesToMode`); the policy engine
6779
+ * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6780
+ */
6781
+ var RecordingConfigSchema = object({
6782
+ enabled: boolean(),
6783
+ /** Authoritative storage mode. Absent on legacy targets → derived once via
6784
+ * `migrateRulesToMode`, then persisted. */
6785
+ mode: RecordingStorageModeSchema.optional(),
6786
+ profiles: array(CamProfileSchema).optional(),
6787
+ segmentSeconds: number().int().positive().optional(),
6788
+ /** Shared recording time-bands for `events` & `continuous` — record only when
6789
+ * the wall-clock falls inside one of these windows. Omit or empty = always.
6790
+ * `continuous` compiles to one rule per band; `events` to band × trigger. */
6791
+ schedules: array(RecordingScheduleSchema).optional(),
6792
+ /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
6793
+ * normalized into `schedules` on read and never written going forward. (Not
6794
+ * tagged `@deprecated`: the normalization paths must read it cast-free.) */
6795
+ schedule: RecordingScheduleSchema.optional(),
6796
+ /** `events`-mode only — which detectors trigger a recording. */
6797
+ triggers: RecordingTriggersSchema.optional(),
6798
+ /** `events`-mode only — seconds retained before / after a trigger. */
6799
+ preBufferSec: number().min(0).optional(),
6800
+ postBufferSec: number().min(0).optional(),
6801
+ /** DEPRECATED authoring input; retained for migration/transition. */
6802
+ rules: array(RecordingRuleSchema).optional(),
6803
+ /**
6804
+ * AUTHORITATIVE mode-per-band recording model (recorder). When present it
6805
+ * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
6806
+ * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
6807
+ * derived into bands once via `migrateConfigToBands`.
6808
+ */
6809
+ bands: array(RecordingBandSchema).optional(),
6810
+ retention: RecordingRetentionSchema.optional()
6811
+ });
6812
+ /**
6813
+ * `StorageLocationType` — an addon-declared id that identifies the *kind* of
6814
+ * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
6815
+ * so the persisted record schema and the consumer-facing cap can both consume it
6816
+ * without forming a circular import. The `storage` cap re-exports it
6817
+ * verbatim for back-compat.
6818
+ *
6819
+ * This Zod schema is the **authoritative source** for `StorageLocationType`.
6820
+ * The TS alias in `./storage.ts` re-exports `z.infer<typeof
6821
+ * StorageLocationTypeSchema>` so the wire surface (cap) and the legacy
6822
+ * `IStorageProvider` interface stay in lockstep.
6823
+ *
6824
+ * The type is now an **open string** (not a closed enum) — addons declare
6825
+ * their own location kinds via `StorageLocationDeclaration.id`. The regex
6826
+ * enforces a safe id format: lowercase-start, alphanumeric + hyphens.
6827
+ */
6828
+ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
6829
+ /**
6830
+ * Persisted record for a storage location instance. Operators can register
6831
+ * multiple instances for multi-cardinality types (e.g. two `backups`
6832
+ * locations with different `providerId`s). Cardinality is now declared per
6833
+ * location via `StorageLocationDeclaration.cardinality` — the static
6834
+ * `STORAGE_LOCATION_CARDINALITY` map has been removed.
6835
+ *
6836
+ * `id` is a stable namespaced string of the form `<type>:<slug>`.
6837
+ * The default location for a type uses `id === <type>:default` by
6838
+ * convention (the bare type ref like `'backups'` resolves to it).
6839
+ *
6840
+ * `isSystem: true` marks a location as orchestrator-seeded and
6841
+ * undeletable. The bootstrap-installed defaults (one per type) carry
6842
+ * this flag; operator-added locations don't. Editing the config of
6843
+ * a system location is allowed (path migration, provider swap) but
6844
+ * deleting it is rejected at the cap level.
6845
+ */
6846
+ var StorageLocationSchema = object({
6847
+ id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
6848
+ type: string(),
6849
+ displayName: string().min(1),
6850
+ providerId: string().min(1),
6851
+ config: record(string(), unknown()),
6852
+ /**
6853
+ * Cluster node this location physically lives on. REQUIRED for node-local
6854
+ * providers (filesystem — the path exists on one node's disk), null/absent
6855
+ * for node-agnostic providers (S3/SFTP/WebDAV, reachable from any node).
6856
+ * `'hub'` is the hub node. Validated against the provider's `nodeLocal`
6857
+ * flag at upsert time, not here (the schema is provider-agnostic).
6858
+ */
6859
+ nodeId: string().optional(),
6860
+ isDefault: boolean().default(false),
6861
+ isSystem: boolean().default(false),
6862
+ createdAt: number(),
6863
+ updatedAt: number()
6864
+ });
6865
+ /**
6866
+ * Reference accepted by consumer-facing `api.storage.*` calls.
6867
+ * Either:
6868
+ * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
6869
+ * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
6870
+ *
6871
+ * The orchestrator's `resolveRef(ref)` handles both cases.
6872
+ */
6873
+ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]);
6874
+ /**
6875
+ * `StorageLocationDeclaration` — a single storage-location entry declared by
6876
+ * an addon in its `package.json` under `camstack.storageLocations`.
6877
+ *
6878
+ * Design intent:
6879
+ * - **Addon declares its needs** — each addon describes the logical storage
6880
+ * slots it requires (e.g. `recordings`, `recordingsLow`) without caring
6881
+ * about the physical path.
6882
+ * - **Kernel aggregates** — at boot the kernel collects declarations from all
6883
+ * installed addons, deduplicates by `id`, and exposes the union via the
6884
+ * storage-locations settings surface.
6885
+ * - **Orchestrator seeds** — for every declared `id` the orchestrator ensures
6886
+ * at least one instance named `<id>:default` is present, using
6887
+ * `defaultsTo` to inherit the resolved root from another location when the
6888
+ * declaration is a derivative slot (e.g. `recordingsLow` defaults to
6889
+ * `recordings`).
6890
+ * - **ids are global** — `id` values are shared across the entire deployment;
6891
+ * two addons declaring the same `id` must agree on `cardinality` (validated
6892
+ * at kernel aggregation time, not here).
6893
+ */
6894
+ var StorageLocationDeclarationSchema = object({
6895
+ /**
6896
+ * Global location identifier, e.g. `recordings` or `recordingsLow`.
6897
+ * Must start with a lowercase letter and may contain letters, digits, and
6898
+ * hyphens.
6899
+ */
6900
+ id: string().regex(/^[a-z][a-zA-Z0-9-]*$/, { message: "id must start with a lowercase letter and contain only letters, digits, or hyphens" }),
6901
+ /** Human-readable name shown in the admin UI. */
6902
+ displayName: string().min(1, { message: "displayName must not be empty" }),
6903
+ /** Optional longer explanation of what data this location stores. */
6904
+ description: string().optional(),
6905
+ /**
6906
+ * `single` — exactly one instance of this location is allowed system-wide
6907
+ * (e.g. `logs`, `models`). The operator can edit it but not add more.
6908
+ * `multi` — the operator may register several instances (e.g. a second
6909
+ * `recordings` on a NAS for disk tiering); one is the default at any time.
6910
+ */
6911
+ cardinality: _enum(["single", "multi"]),
6912
+ /**
6913
+ * When set, the default instance for this location inherits its resolved
6914
+ * root from the named location's default instance. Useful for derivative
6915
+ * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
6916
+ * configure the primary location.
6917
+ */
6918
+ defaultsTo: string().optional()
6919
+ });
6920
+ var DecoderStatsSchema = object({
6921
+ inputFps: number(),
6922
+ outputFps: number(),
6923
+ avgDecodeTimeMs: number(),
6924
+ droppedFrames: number()
6925
+ });
6926
+ var DecoderSessionConfigSchema = object({
6927
+ codec: string(),
6928
+ maxFps: number().default(0),
6929
+ outputFormat: _enum([
6930
+ "jpeg",
6931
+ "rgb",
6932
+ "bgr",
6933
+ "yuv420",
6934
+ "gray"
6935
+ ]).default("jpeg"),
6936
+ scale: number().default(1),
6937
+ width: number().optional(),
6938
+ height: number().optional(),
6955
6939
  /**
6956
- * Device supports an on-demand re-sync of its derived spec with its
6957
- * upstream source drives the generic Re-sync button. The owning
6958
- * provider implements the action via the `device-adoption.resync` cap.
6940
+ * Identifier of the camera this decoder session serves. Optional
6941
+ * because the cap is generic (any caller could request decode), but
6942
+ * stream-broker passes it so decoder logs include `deviceId` for
6943
+ * per-camera filtering when diagnosing failures (e.g. node-av
6944
+ * sendPacket errors on a single hung camera).
6959
6945
  */
6960
- DeviceFeature["Resyncable"] = "resyncable";
6961
- DeviceFeature["NativeSnapshot"] = "native-snapshot";
6962
- DeviceFeature["DoorbellButton"] = "doorbell-button";
6963
- DeviceFeature["TwoWayAudio"] = "two-way-audio";
6964
- DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6946
+ deviceId: number().int().nonnegative().optional(),
6965
6947
  /**
6966
- * Camera supports the on-firmware autotrack subsystem (subject-
6967
- * following). Distinct from `PanTiltZoom` because not every PTZ
6968
- * camera ships autotrack the admin UI uses this flag to gate
6969
- * the autotrack toggle / settings card without re-deriving from
6970
- * the cap registry. Mirrors `ptz-autotrack` cap registration:
6971
- * driver sets this feature when probe confirms the firmware
6972
- * surface, and registers the cap in the same code path.
6948
+ * Free-form tag for log scoping. Stream-broker uses
6949
+ * `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
6950
+ * on every line so `grep tag=broker:5/high` filters one camera
6951
+ * profile cleanly.
6973
6952
  */
6974
- DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6953
+ tag: string().optional(),
6975
6954
  /**
6976
- * Accessory exposes a "trigger on motion" toggle the parent camera's
6977
- * motion detection automatically activates this device. Mirrors
6978
- * `motion-trigger` cap registration: drivers set this feature in the
6979
- * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6955
+ * Where the session delivers decoded frames (Phase 5 / D9):
6980
6956
  *
6981
- * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6982
- * fast scalar without binding fetch), notifier rules, and `listAll`
6983
- * filters that want "all devices with on-motion behaviour".
6957
+ * - `'callback'` (default) the legacy pixel path: decoded frames are
6958
+ * buffered as `DecodedFrame`s and drained via `pullFrames`.
6959
+ * - `'shm'` the shared-memory frame plane: decoded frames are written
6960
+ * into an OS shared-memory ring and drained as zero-pixel
6961
+ * `FrameHandle`s via `pullHandles`. A session is one mode or the
6962
+ * other — `pullFrames` returns nothing for an `'shm'` session and
6963
+ * `pullHandles` returns nothing for a `'callback'` session.
6984
6964
  */
6985
- DeviceFeature["MotionTrigger"] = "motion-trigger";
6986
- /** Light supports rgb-triplet color via `color` cap. */
6987
- DeviceFeature["LightColorRgb"] = "light-color-rgb";
6988
- /** Light supports HSV color via `color` cap. */
6989
- DeviceFeature["LightColorHsv"] = "light-color-hsv";
6990
- /** Light supports color-temperature (mired) via `color` cap. */
6991
- DeviceFeature["LightColorMired"] = "light-color-mired";
6992
- /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6993
- * targetHigh). Gates the range slider UI. */
6994
- DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6995
- /** Thermostat exposes target humidity and/or current humidity
6996
- * readings. Gates the humidity controls. */
6997
- DeviceFeature["ClimateHumidity"] = "climate-humidity";
6998
- /** Thermostat exposes a fan-mode selector. */
6999
- DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
7000
- /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
7001
- DeviceFeature["ClimatePreset"] = "climate-preset";
7002
- /** Cover exposes intermediate position control (0..100). Gates the
7003
- * position slider UI. */
7004
- DeviceFeature["CoverPositionable"] = "cover-positionable";
7005
- /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
7006
- DeviceFeature["CoverTilt"] = "cover-tilt";
7007
- /** Valve exposes intermediate position control (0..100). Gates the
7008
- * position slider / drag surface UI. */
7009
- DeviceFeature["ValvePositionable"] = "valve-positionable";
7010
- /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
7011
- DeviceFeature["FanSpeed"] = "fan-speed";
7012
- /** Fan exposes a preset mode selector. */
7013
- DeviceFeature["FanPreset"] = "fan-preset";
7014
- /** Fan exposes blade direction (forward/reverse) — typical of
7015
- * ceiling fans. */
7016
- DeviceFeature["FanDirection"] = "fan-direction";
7017
- /** Fan exposes an oscillation toggle. */
7018
- DeviceFeature["FanOscillating"] = "fan-oscillating";
7019
- /** Lock requires a PIN code on lock/unlock. Gates the code-entry
7020
- * field on the UI lock-controls panel. */
7021
- DeviceFeature["LockPinRequired"] = "lock-pin-required";
7022
- /** Lock supports a latch-release ("open door") action distinct from
7023
- * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
7024
- * `supported_features`. Gates the Open Door button in the UI. */
7025
- DeviceFeature["LockOpen"] = "lock-open";
7026
- /** Media player exposes a seek-to-position surface. */
7027
- DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
7028
- /** Media player exposes a volume-level setter. */
7029
- DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
7030
- /** Media player exposes a mute toggle distinct from volume=0. */
7031
- DeviceFeature["MediaPlayerMute"] = "media-player-mute";
7032
- /** Media player exposes a shuffle toggle. */
7033
- DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
7034
- /** Media player exposes a repeat mode (off / all / one). */
7035
- DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
7036
- /** Media player exposes a source / input selector. */
7037
- DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
7038
- /** Media player exposes a play-arbitrary-media surface (URL / id). */
7039
- DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
7040
- /** Media player exposes next-track. */
7041
- DeviceFeature["MediaPlayerNext"] = "media-player-next";
7042
- /** Media player exposes previous-track. */
7043
- DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
7044
- /** Media player exposes stop distinct from pause. */
7045
- DeviceFeature["MediaPlayerStop"] = "media-player-stop";
7046
- /** Alarm panel requires a PIN code on arm/disarm. */
7047
- DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
7048
- /** Presence device carries GPS coordinates (lat/lng/accuracy) in
7049
- * addition to a textual location. */
7050
- DeviceFeature["PresenceGps"] = "presence-gps";
7051
- /** Notifier accepts an inline / URL image attachment. */
7052
- DeviceFeature["NotifierImage"] = "notifier-image";
7053
- /** Notifier accepts a priority hint (high/normal/low). */
7054
- DeviceFeature["NotifierPriority"] = "notifier-priority";
7055
- /** Notifier accepts a free-form `data` payload for platform-specific
7056
- * fields. */
7057
- DeviceFeature["NotifierData"] = "notifier-data";
7058
- /** Notifier supports interactive action buttons / callbacks. */
7059
- DeviceFeature["NotifierActions"] = "notifier-actions";
7060
- /** Notifier supports per-call recipient targeting (multi-user). */
7061
- DeviceFeature["NotifierRecipients"] = "notifier-recipients";
7062
- /** Script runner accepts a variables map on each run invocation. */
7063
- DeviceFeature["ScriptVariables"] = "script-variables";
7064
- /** Automation `trigger` accepts a skipCondition flag — fires the
7065
- * automation's actions while bypassing its condition block. */
7066
- DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
7067
- return DeviceFeature;
7068
- }({});
7069
- /**
7070
- * Semantic role a device plays within its parent. Populated by driver
7071
- * addons when creating accessory devices (Reolink siren/floodlight/
7072
- * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
7073
- * admin UI to pick icons, labels, and widgets — a `Switch` with
7074
- * `role: Floodlight` renders as a bulb with a brightness slider,
7075
- * whereas a `Switch` with `role: Siren` renders as a klaxon.
7076
- *
7077
- * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
7078
- * sqlite as a nullable TEXT column — old rows keep working unchanged.
7079
- */
7080
- var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
7081
- DeviceRole["Siren"] = "siren";
7082
- DeviceRole["Floodlight"] = "floodlight";
7083
- DeviceRole["Spotlight"] = "spotlight";
7084
- DeviceRole["PirSensor"] = "pir-sensor";
7085
- DeviceRole["Chime"] = "chime";
7086
- DeviceRole["Autotrack"] = "autotrack";
7087
- DeviceRole["Nightvision"] = "nightvision";
7088
- DeviceRole["PrivacyMask"] = "privacy-mask";
7089
- DeviceRole["Doorbell"] = "doorbell";
7090
- /** Virtual HA toggle (input_boolean.*) — distinguishable from a
7091
- * real Switch device for UI rendering / export adapters. */
7092
- DeviceRole["BinaryHelper"] = "binary-helper";
7093
- /** Generic motion / occupancy / moving event source. Distinct from
7094
- * the camera accessory PirSensor role: that one is a camera child;
7095
- * this is a standalone HA / 3rd-party motion sensor. */
7096
- DeviceRole["MotionSensor"] = "motion-sensor";
7097
- DeviceRole["ContactSensor"] = "contact-sensor";
7098
- DeviceRole["LeakSensor"] = "leak-sensor";
7099
- DeviceRole["SmokeSensor"] = "smoke-sensor";
7100
- DeviceRole["COSensor"] = "co-sensor";
7101
- DeviceRole["GasSensor"] = "gas-sensor";
7102
- DeviceRole["TamperSensor"] = "tamper-sensor";
7103
- DeviceRole["VibrationSensor"] = "vibration-sensor";
7104
- DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
7105
- DeviceRole["SoundSensor"] = "sound-sensor";
7106
- /** Fallback for `binary_sensor` without a known `device_class`. */
7107
- DeviceRole["BinarySensor"] = "binary-sensor";
7108
- DeviceRole["TemperatureSensor"] = "temperature-sensor";
7109
- DeviceRole["HumiditySensor"] = "humidity-sensor";
7110
- DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
7111
- DeviceRole["PressureSensor"] = "pressure-sensor";
7112
- DeviceRole["PowerSensor"] = "power-sensor";
7113
- DeviceRole["EnergySensor"] = "energy-sensor";
7114
- DeviceRole["VoltageSensor"] = "voltage-sensor";
7115
- DeviceRole["CurrentSensor"] = "current-sensor";
7116
- DeviceRole["AirQualitySensor"] = "air-quality-sensor";
7117
- /** Battery level (numeric % via `sensor` OR low-bool via
7118
- * `binary_sensor` — the cap distinguishes via the value type). */
7119
- DeviceRole["BatterySensor"] = "battery-sensor";
7120
- /** Fallback for `sensor` numeric without a known `device_class`. */
7121
- DeviceRole["NumericSensor"] = "numeric-sensor";
7122
- /** String / enum state (HA `sensor` with `state_class: enum` or
7123
- * `attributes.options`). */
7124
- DeviceRole["EnumSensor"] = "enum-sensor";
7125
- /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
7126
- * or `date`). The slice carries the raw ISO string verbatim (hosted on
7127
- * the `enum-sensor` cap); the UI renders it locale-formatted. */
7128
- DeviceRole["DateTimeSensor"] = "datetime-sensor";
7129
- /** Last-resort fallback when nothing else matches. */
7130
- DeviceRole["GenericSensor"] = "generic-sensor";
7131
- DeviceRole["NumericControl"] = "numeric-control";
7132
- DeviceRole["SelectControl"] = "select-control";
7133
- DeviceRole["TextControl"] = "text-control";
7134
- DeviceRole["DateTimeControl"] = "datetime-control";
7135
- /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
7136
- * rich features (image, priority, channel routing). */
7137
- DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
7138
- /** Chat / messaging service (HA `notify.telegram_*`,
7139
- * `notify.discord_*`, etc.). */
7140
- DeviceRole["MessagingNotifier"] = "messaging-notifier";
7141
- /** Email-based delivery (HA `notify.smtp`, etc.). */
7142
- DeviceRole["EmailNotifier"] = "email-notifier";
7143
- /** Fallback when the notifier service name doesn't match a known
7144
- * pattern. */
7145
- DeviceRole["GenericNotifier"] = "generic-notifier";
7146
- return DeviceRole;
7147
- }({});
6965
+ frameSink: _enum(["callback", "shm"]).default("callback")
6966
+ });
6967
+ var EncodeProfileSchema = object({
6968
+ video: object({
6969
+ codec: _enum([
6970
+ "h264",
6971
+ "h265",
6972
+ "copy"
6973
+ ]),
6974
+ profile: _enum([
6975
+ "baseline",
6976
+ "main",
6977
+ "high"
6978
+ ]).optional(),
6979
+ width: number().int().positive().optional(),
6980
+ height: number().int().positive().optional(),
6981
+ fps: number().positive().optional(),
6982
+ bitrateKbps: number().int().positive().optional(),
6983
+ gopFrames: number().int().positive().optional(),
6984
+ bf: number().int().min(0).optional(),
6985
+ preset: _enum([
6986
+ "ultrafast",
6987
+ "superfast",
6988
+ "veryfast",
6989
+ "faster",
6990
+ "fast",
6991
+ "medium"
6992
+ ]).optional(),
6993
+ tune: _enum([
6994
+ "zerolatency",
6995
+ "film",
6996
+ "animation"
6997
+ ]).optional()
6998
+ }),
6999
+ audio: union([literal("passthrough"), object({
7000
+ codec: _enum([
7001
+ "opus",
7002
+ "aac",
7003
+ "pcmu",
7004
+ "pcma",
7005
+ "copy"
7006
+ ]),
7007
+ bitrateKbps: number().int().positive().optional(),
7008
+ sampleRateHz: number().int().positive().optional(),
7009
+ channels: union([literal(1), literal(2)]).optional()
7010
+ })]),
7011
+ /**
7012
+ * ffmpeg input-side args, inserted between the fixed global flags
7013
+ * (`-hide_banner -loglevel error`) and `-i pipe:0`. Free-text array
7014
+ * the widget surfaces a textarea + suggestion chips for the most-
7015
+ * used demuxer/format options.
7016
+ */
7017
+ inputArgs: array(string()).optional(),
7018
+ /**
7019
+ * ffmpeg output-side args, inserted between the encode block and
7020
+ * the final `-f <muxer> pipe:1`. Use for muxer options, bitstream
7021
+ * filters, codec-specific overrides. Free-text array.
7022
+ */
7023
+ outputArgs: array(string()).optional()
7024
+ });
7025
+ var YAMNET_TO_MACRO = {
7026
+ mapping: {
7027
+ Speech: "speech",
7028
+ "Child speech, kid speaking": "speech",
7029
+ Conversation: "speech",
7030
+ "Narration, monologue": "speech",
7031
+ Babbling: "speech",
7032
+ Whispering: "speech",
7033
+ "Speech synthesizer": "speech",
7034
+ Humming: "speech",
7035
+ Rapping: "speech",
7036
+ Singing: "speech",
7037
+ Choir: "speech",
7038
+ "Child singing": "speech",
7039
+ Shout: "scream",
7040
+ Bellow: "scream",
7041
+ Yell: "scream",
7042
+ Screaming: "scream",
7043
+ "Children shouting": "scream",
7044
+ Whoop: "scream",
7045
+ "Crying, sobbing": "crying",
7046
+ "Baby cry, infant cry": "crying",
7047
+ Whimper: "crying",
7048
+ "Wail, moan": "crying",
7049
+ Groan: "crying",
7050
+ Laughter: "laughter",
7051
+ "Baby laughter": "laughter",
7052
+ Giggle: "laughter",
7053
+ Snicker: "laughter",
7054
+ "Belly laugh": "laughter",
7055
+ "Chuckle, chortle": "laughter",
7056
+ Music: "music",
7057
+ "Musical instrument": "music",
7058
+ Guitar: "music",
7059
+ Piano: "music",
7060
+ Drum: "music",
7061
+ "Drum kit": "music",
7062
+ "Violin, fiddle": "music",
7063
+ Flute: "music",
7064
+ Saxophone: "music",
7065
+ Trumpet: "music",
7066
+ Synthesizer: "music",
7067
+ "Pop music": "music",
7068
+ "Rock music": "music",
7069
+ "Hip hop music": "music",
7070
+ "Classical music": "music",
7071
+ Jazz: "music",
7072
+ "Electronic music": "music",
7073
+ "Background music": "music",
7074
+ Dog: "dog",
7075
+ Bark: "dog",
7076
+ Yip: "dog",
7077
+ Howl: "dog",
7078
+ "Bow-wow": "dog",
7079
+ Growling: "dog",
7080
+ "Whimper (dog)": "dog",
7081
+ Cat: "cat",
7082
+ Purr: "cat",
7083
+ Meow: "cat",
7084
+ Hiss: "cat",
7085
+ Caterwaul: "cat",
7086
+ Bird: "bird",
7087
+ "Bird vocalization, bird call, bird song": "bird",
7088
+ "Chirp, tweet": "bird",
7089
+ Squawk: "bird",
7090
+ Crow: "bird",
7091
+ Owl: "bird",
7092
+ "Pigeon, dove": "bird",
7093
+ Animal: "animal",
7094
+ "Domestic animals, pets": "animal",
7095
+ "Livestock, farm animals, working animals": "animal",
7096
+ Horse: "animal",
7097
+ "Cattle, bovinae": "animal",
7098
+ Pig: "animal",
7099
+ Sheep: "animal",
7100
+ Goat: "animal",
7101
+ Frog: "animal",
7102
+ Insect: "animal",
7103
+ Cricket: "animal",
7104
+ Alarm: "alarm",
7105
+ "Alarm clock": "alarm",
7106
+ "Smoke detector, smoke alarm": "alarm",
7107
+ "Fire alarm": "alarm",
7108
+ Buzzer: "alarm",
7109
+ "Civil defense siren": "alarm",
7110
+ "Car alarm": "alarm",
7111
+ Siren: "siren",
7112
+ "Police car (siren)": "siren",
7113
+ "Ambulance (siren)": "siren",
7114
+ "Fire engine, fire truck (siren)": "siren",
7115
+ "Emergency vehicle": "siren",
7116
+ Foghorn: "siren",
7117
+ Doorbell: "doorbell",
7118
+ "Ding-dong": "doorbell",
7119
+ Knock: "doorbell",
7120
+ Tap: "doorbell",
7121
+ Glass: "glass_breaking",
7122
+ Shatter: "glass_breaking",
7123
+ "Chink, clink": "glass_breaking",
7124
+ "Gunshot, gunfire": "gunshot",
7125
+ "Machine gun": "gunshot",
7126
+ Explosion: "gunshot",
7127
+ Fireworks: "gunshot",
7128
+ Firecracker: "gunshot",
7129
+ "Artillery fire": "gunshot",
7130
+ "Cap gun": "gunshot",
7131
+ Boom: "gunshot",
7132
+ Vehicle: "vehicle",
7133
+ Car: "vehicle",
7134
+ Truck: "vehicle",
7135
+ Bus: "vehicle",
7136
+ Motorcycle: "vehicle",
7137
+ "Car passing by": "vehicle",
7138
+ "Vehicle horn, car horn, honking": "vehicle",
7139
+ "Traffic noise, roadway noise": "vehicle",
7140
+ Train: "vehicle",
7141
+ Aircraft: "vehicle",
7142
+ Helicopter: "vehicle",
7143
+ Bicycle: "vehicle",
7144
+ Skateboard: "vehicle",
7145
+ Fire: "fire",
7146
+ Crackle: "fire",
7147
+ Water: "water",
7148
+ Rain: "water",
7149
+ Raindrop: "water",
7150
+ "Rain on surface": "water",
7151
+ Stream: "water",
7152
+ Waterfall: "water",
7153
+ Ocean: "water",
7154
+ "Waves, surf": "water",
7155
+ "Splash, splatter": "water",
7156
+ Wind: "wind",
7157
+ Thunderstorm: "wind",
7158
+ Thunder: "wind",
7159
+ "Wind noise (microphone)": "wind",
7160
+ "Rustling leaves": "wind",
7161
+ Door: "door",
7162
+ "Sliding door": "door",
7163
+ Slam: "door",
7164
+ "Cupboard open or close": "door",
7165
+ "Walk, footsteps": "footsteps",
7166
+ Run: "footsteps",
7167
+ Shuffle: "footsteps",
7168
+ Crowd: "crowd",
7169
+ Chatter: "crowd",
7170
+ Cheering: "crowd",
7171
+ Applause: "crowd",
7172
+ "Children playing": "crowd",
7173
+ "Hubbub, speech noise, speech babble": "crowd",
7174
+ Telephone: "telephone",
7175
+ "Telephone bell ringing": "telephone",
7176
+ Ringtone: "telephone",
7177
+ "Telephone dialing, DTMF": "telephone",
7178
+ "Busy signal": "telephone",
7179
+ Engine: "engine",
7180
+ "Engine starting": "engine",
7181
+ Idling: "engine",
7182
+ "Accelerating, revving, vroom": "engine",
7183
+ "Light engine (high frequency)": "engine",
7184
+ "Medium engine (mid frequency)": "engine",
7185
+ "Heavy engine (low frequency)": "engine",
7186
+ "Lawn mower": "engine",
7187
+ Chainsaw: "engine",
7188
+ Hammer: "tools",
7189
+ Jackhammer: "tools",
7190
+ Sawing: "tools",
7191
+ "Power tool": "tools",
7192
+ Drill: "tools",
7193
+ Sanding: "tools",
7194
+ Silence: "silence"
7195
+ },
7196
+ preserveOriginal: false
7197
+ };
7198
+ var APPLE_SA_TO_MACRO = {
7199
+ mapping: {
7200
+ speech: "speech",
7201
+ child_speech: "speech",
7202
+ conversation: "speech",
7203
+ whispering: "speech",
7204
+ singing: "speech",
7205
+ humming: "speech",
7206
+ shout: "scream",
7207
+ yell: "scream",
7208
+ screaming: "scream",
7209
+ crying: "crying",
7210
+ baby_crying: "crying",
7211
+ sobbing: "crying",
7212
+ laughter: "laughter",
7213
+ baby_laughter: "laughter",
7214
+ giggling: "laughter",
7215
+ music: "music",
7216
+ guitar: "music",
7217
+ piano: "music",
7218
+ drums: "music",
7219
+ dog_bark: "dog",
7220
+ dog_bow_wow: "dog",
7221
+ dog_growling: "dog",
7222
+ dog_howl: "dog",
7223
+ cat_meow: "cat",
7224
+ cat_purr: "cat",
7225
+ cat_hiss: "cat",
7226
+ bird: "bird",
7227
+ bird_chirp: "bird",
7228
+ bird_squawk: "bird",
7229
+ animal: "animal",
7230
+ horse: "animal",
7231
+ cow_moo: "animal",
7232
+ insect: "animal",
7233
+ alarm: "alarm",
7234
+ smoke_alarm: "alarm",
7235
+ fire_alarm: "alarm",
7236
+ car_alarm: "alarm",
7237
+ siren: "siren",
7238
+ police_siren: "siren",
7239
+ ambulance_siren: "siren",
7240
+ doorbell: "doorbell",
7241
+ door_knock: "doorbell",
7242
+ knocking: "doorbell",
7243
+ glass_breaking: "glass_breaking",
7244
+ glass_shatter: "glass_breaking",
7245
+ gunshot: "gunshot",
7246
+ explosion: "gunshot",
7247
+ fireworks: "gunshot",
7248
+ car: "vehicle",
7249
+ truck: "vehicle",
7250
+ motorcycle: "vehicle",
7251
+ car_horn: "vehicle",
7252
+ vehicle_horn: "vehicle",
7253
+ traffic: "vehicle",
7254
+ fire: "fire",
7255
+ fire_crackle: "fire",
7256
+ water: "water",
7257
+ rain: "water",
7258
+ ocean: "water",
7259
+ splash: "water",
7260
+ wind: "wind",
7261
+ thunder: "wind",
7262
+ thunderstorm: "wind",
7263
+ door: "door",
7264
+ door_slam: "door",
7265
+ sliding_door: "door",
7266
+ footsteps: "footsteps",
7267
+ walking: "footsteps",
7268
+ running: "footsteps",
7269
+ crowd: "crowd",
7270
+ chatter: "crowd",
7271
+ cheering: "crowd",
7272
+ applause: "crowd",
7273
+ telephone_ring: "telephone",
7274
+ ringtone: "telephone",
7275
+ engine: "engine",
7276
+ engine_starting: "engine",
7277
+ lawn_mower: "engine",
7278
+ chainsaw: "engine",
7279
+ hammer: "tools",
7280
+ jackhammer: "tools",
7281
+ drill: "tools",
7282
+ power_tool: "tools",
7283
+ silence: "silence"
7284
+ },
7285
+ preserveOriginal: false
7286
+ };
7287
+ var _macroLookup = /* @__PURE__ */ new Map();
7288
+ for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7289
+ for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7148
7290
  /**
7149
7291
  * Accessory device helpers — shared across drivers.
7150
7292
  *
@@ -7304,74 +7446,6 @@ object({
7304
7446
  });
7305
7447
  DeviceType.Sensor;
7306
7448
  /**
7307
- * Generic types for capability definitions.
7308
- *
7309
- * A capability is defined with Zod schemas for methods, events, and settings.
7310
- * TypeScript types are inferred via z.infer<> — zero duplication.
7311
- *
7312
- * Pattern:
7313
- * 1. Define Zod schemas for data, methods, settings
7314
- * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
7315
- * 3. Export type IProvider = InferProvider<typeof capabilityDef>
7316
- * 4. Addon implements IProvider
7317
- * 5. Registry auto-mounts tRPC router from definition.methods
7318
- */
7319
- /**
7320
- * Output schema shared by the contribution + live methods.
7321
- *
7322
- * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
7323
- * tabs[]) without importing from `../interfaces/config-ui.js` — a
7324
- * concrete-but-lenient Zod object keeps tRPC output inference happy
7325
- * (using `z.unknown()` here collapses unrelated router branches to
7326
- * `unknown` when the generator re-inlines the huge AppRouter type).
7327
- *
7328
- * `.passthrough()` on sections/fields accepts whatever FormBuilder
7329
- * extensions the caller adds (showWhen, displayScale, …) without
7330
- * rebuilding every time a new field kind is introduced.
7331
- */
7332
- var ContributionSectionSchema = object({
7333
- id: string(),
7334
- title: string(),
7335
- description: string().optional(),
7336
- style: _enum(["card", "accordion"]).optional(),
7337
- defaultCollapsed: boolean().optional(),
7338
- columns: union([
7339
- literal(1),
7340
- literal(2),
7341
- literal(3),
7342
- literal(4)
7343
- ]).optional(),
7344
- tab: string().optional(),
7345
- location: _enum(["settings", "top-tab"]).optional(),
7346
- order: number().optional(),
7347
- fields: array(any())
7348
- });
7349
- object({
7350
- tabs: array(object({
7351
- id: string(),
7352
- label: string(),
7353
- icon: string(),
7354
- order: number().optional()
7355
- })).optional(),
7356
- sections: array(ContributionSectionSchema)
7357
- }).nullable();
7358
- object({ deviceId: number() }), object({ deviceId: number() }), object({
7359
- deviceId: number(),
7360
- patch: record(string(), unknown())
7361
- }), object({ success: literal(true) });
7362
- object({ deviceId: number() }), unknown().nullable();
7363
- /** Shorthand to define a method schema */
7364
- function method(input, output, options) {
7365
- return {
7366
- input,
7367
- output,
7368
- kind: options?.kind ?? "query",
7369
- auth: options?.auth ?? "protected",
7370
- ...options?.access !== void 0 ? { access: options.access } : {},
7371
- timeoutMs: options?.timeoutMs
7372
- };
7373
- }
7374
- /**
7375
7449
  * Alarm-panel cap. Models HA `alarm_control_panel.*` on
7376
7450
  * `DeviceType.AlarmPanel`. State follows HA's canonical lifecycle
7377
7451
  * across disarmed / armed_(home|away|night|vacation|custom_bypass) /
@@ -9186,6 +9260,24 @@ var DetectorOutputSchema = object({
9186
9260
  inferenceMs: number(),
9187
9261
  modelId: string()
9188
9262
  });
9263
+ var EngineProvisioningSchema = object({
9264
+ runtimeId: _enum([
9265
+ "onnx",
9266
+ "openvino",
9267
+ "coreml"
9268
+ ]).nullable(),
9269
+ device: string().nullable(),
9270
+ state: _enum([
9271
+ "idle",
9272
+ "installing",
9273
+ "verifying",
9274
+ "ready",
9275
+ "failed"
9276
+ ]),
9277
+ progress: number().optional(),
9278
+ error: string().optional(),
9279
+ nextRetryAt: number().optional()
9280
+ });
9189
9281
  var PipelineStepInputSchema = lazy(() => object({
9190
9282
  addonId: string(),
9191
9283
  modelId: string(),
@@ -9254,7 +9346,7 @@ var PipelineRunResultBridge = custom();
9254
9346
  method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(_void(), PipelineEngineChoiceSchema, {
9255
9347
  kind: "mutation",
9256
9348
  auth: "admin"
9257
- }), method(_void(), record(string(), object({
9349
+ }), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
9258
9350
  modelId: string(),
9259
9351
  settings: record(string(), unknown()).readonly()
9260
9352
  }))), method(object({ steps: record(string(), object({
@@ -11355,9 +11447,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
11355
11447
  limit: number().optional(),
11356
11448
  tags: record(string(), string()).optional()
11357
11449
  }), array(LogEntrySchema).readonly());
11358
- var StaticDirOutputSchema = object({ staticDir: string() });
11359
- var VersionOutputSchema = object({ version: string() });
11360
- method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
11361
11450
  /**
11362
11451
  * Zod schemas for persisted record types.
11363
11452
  *
@@ -12909,7 +12998,10 @@ var AgentAddonConfigSchema = object({
12909
12998
  modelId: string(),
12910
12999
  settings: record(string(), unknown()).readonly()
12911
13000
  });
12912
- var AgentPipelineSettingsSchema = object({ addonDefaults: record(string(), AgentAddonConfigSchema).readonly() });
13001
+ var AgentPipelineSettingsSchema = object({
13002
+ addonDefaults: record(string(), AgentAddonConfigSchema).readonly(),
13003
+ maxCameras: number().int().nonnegative().nullable().default(null)
13004
+ });
12913
13005
  var CameraPipelineForAgentSchema = object({
12914
13006
  steps: array(PipelineStepInputSchema).readonly(),
12915
13007
  audio: object({
@@ -13011,6 +13103,133 @@ var GlobalMetricsSchema = object({
13011
13103
  * capability providers.
13012
13104
  */
13013
13105
  var CapabilityBindingsSchema = record(string(), string());
13106
+ /** Source block — always present; derives from the stream catalog. */
13107
+ var CameraSourceStatusSchema = object({ streams: array(object({
13108
+ camStreamId: string(),
13109
+ codec: string(),
13110
+ width: number(),
13111
+ height: number(),
13112
+ fps: number(),
13113
+ kind: string()
13114
+ })).readonly() });
13115
+ /** Assignment block — always present (orchestrator-local, no remote call). */
13116
+ var CameraAssignmentStatusSchema = object({
13117
+ detectionNodeId: string().nullable(),
13118
+ decoderNodeId: string().nullable(),
13119
+ audioNodeId: string().nullable(),
13120
+ pinned: object({
13121
+ detection: boolean(),
13122
+ decoder: boolean(),
13123
+ audio: boolean()
13124
+ }),
13125
+ reasons: object({
13126
+ detection: string().optional(),
13127
+ decoder: string().optional(),
13128
+ audio: string().optional()
13129
+ })
13130
+ });
13131
+ /** Broker block — null when the broker stage is unreachable or inactive. */
13132
+ var CameraBrokerStatusSchema = object({
13133
+ profiles: array(object({
13134
+ profile: string(),
13135
+ status: string(),
13136
+ codec: string(),
13137
+ width: number(),
13138
+ height: number(),
13139
+ subscribers: number(),
13140
+ inFps: number(),
13141
+ outFps: number()
13142
+ })).readonly(),
13143
+ webrtcSessions: number(),
13144
+ rtspRestream: boolean()
13145
+ });
13146
+ /** Shared-memory ring statistics within the decoder block. */
13147
+ var CameraDecoderShmSchema = object({
13148
+ framesWritten: number(),
13149
+ getFrameHits: number(),
13150
+ getFrameMisses: number(),
13151
+ budgetMb: number()
13152
+ });
13153
+ /** Decoder block — null when the decoder stage is unreachable or inactive. */
13154
+ var CameraDecoderStatusSchema = object({
13155
+ nodeId: string(),
13156
+ formats: array(string()).readonly(),
13157
+ sessionCount: number(),
13158
+ shm: CameraDecoderShmSchema
13159
+ });
13160
+ /** Motion block — null when motion detection is not active for this device. */
13161
+ var CameraMotionStatusSchema = object({
13162
+ enabled: boolean(),
13163
+ fps: number()
13164
+ });
13165
+ /** Detection provisioning sub-block. */
13166
+ var CameraDetectionProvisioningSchema = object({
13167
+ state: _enum([
13168
+ "idle",
13169
+ "installing",
13170
+ "verifying",
13171
+ "ready",
13172
+ "failed"
13173
+ ]),
13174
+ error: string().optional()
13175
+ });
13176
+ /** Detection phase — derived from the runner's engine phase. */
13177
+ var CameraDetectionPhaseSchema = _enum([
13178
+ "idle",
13179
+ "watching",
13180
+ "active"
13181
+ ]);
13182
+ /** Detection block — null when no detection node is assigned or reachable. */
13183
+ var CameraDetectionStatusSchema = object({
13184
+ nodeId: string(),
13185
+ engine: object({
13186
+ backend: string(),
13187
+ device: string()
13188
+ }),
13189
+ phase: CameraDetectionPhaseSchema,
13190
+ configuredFps: number(),
13191
+ actualFps: number(),
13192
+ queueDepth: number(),
13193
+ avgInferenceMs: number(),
13194
+ provisioning: CameraDetectionProvisioningSchema
13195
+ });
13196
+ /** Audio block — null when no audio node is assigned or reachable. */
13197
+ var CameraAudioStatusSchema = object({
13198
+ nodeId: string(),
13199
+ enabled: boolean()
13200
+ });
13201
+ /** Recording block — null when no recording cap is active for this device. */
13202
+ var CameraRecordingStatusSchema = object({
13203
+ mode: _enum([
13204
+ "off",
13205
+ "continuous",
13206
+ "events"
13207
+ ]),
13208
+ active: boolean(),
13209
+ storageBytes: number()
13210
+ });
13211
+ /**
13212
+ * Aggregated per-camera pipeline status — server-composed, single call.
13213
+ *
13214
+ * The `assignment` and `source` blocks are always present.
13215
+ * Every other block is `null` when the stage is inactive or unreachable
13216
+ * during the bounded parallel fan-out in the orchestrator implementation.
13217
+ *
13218
+ * See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
13219
+ */
13220
+ var CameraStatusSchema = object({
13221
+ deviceId: number(),
13222
+ assignment: CameraAssignmentStatusSchema,
13223
+ source: CameraSourceStatusSchema,
13224
+ broker: CameraBrokerStatusSchema.nullable(),
13225
+ decoder: CameraDecoderStatusSchema.nullable(),
13226
+ motion: CameraMotionStatusSchema.nullable(),
13227
+ detection: CameraDetectionStatusSchema.nullable(),
13228
+ audio: CameraAudioStatusSchema.nullable(),
13229
+ recording: CameraRecordingStatusSchema.nullable(),
13230
+ /** Unix timestamp (ms) when this snapshot was composed server-side. */
13231
+ fetchedAt: number()
13232
+ });
13014
13233
  method(object({
13015
13234
  deviceId: number(),
13016
13235
  agentNodeId: string()
@@ -13078,6 +13297,12 @@ method(object({
13078
13297
  }), {
13079
13298
  kind: "mutation",
13080
13299
  auth: "admin"
13300
+ }), method(object({
13301
+ agentNodeId: string(),
13302
+ maxCameras: number().int().nonnegative().nullable()
13303
+ }), object({ success: literal(true) }), {
13304
+ kind: "mutation",
13305
+ auth: "admin"
13081
13306
  }), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
13082
13307
  deviceId: number(),
13083
13308
  addonId: string(),
@@ -13103,7 +13328,7 @@ method(object({
13103
13328
  }), method(object({
13104
13329
  deviceId: number(),
13105
13330
  agentNodeId: string().optional()
13106
- }), CameraPipelineConfigSchema), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
13331
+ }), CameraPipelineConfigSchema), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
13107
13332
  name: string(),
13108
13333
  description: string().optional(),
13109
13334
  config: CameraPipelineConfigSchema
@@ -13590,7 +13815,7 @@ method(object({
13590
13815
  }), _void(), {
13591
13816
  kind: "mutation",
13592
13817
  auth: "admin"
13593
- }), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
13818
+ }), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
13594
13819
  deviceId: number(),
13595
13820
  values: record(string(), unknown())
13596
13821
  }), object({ success: literal(true) }), {
@@ -14272,7 +14497,20 @@ var DiskSpaceInfoSchema = object({
14272
14497
  var PidResourceStatsSchema = object({
14273
14498
  pid: number(),
14274
14499
  cpu: number(),
14275
- memory: number()
14500
+ memory: number(),
14501
+ /**
14502
+ * Private (anonymous) resident bytes — the per-process V8 heap + native
14503
+ * allocations NOT shared with other processes (Linux RssAnon). This is the
14504
+ * "real" per-runner cost; summing it across runners is meaningful, unlike
14505
+ * `memory` (RSS), which double-counts the shared mmap'd framework code.
14506
+ * Undefined where /proc is unavailable (e.g. macOS).
14507
+ */
14508
+ privateBytes: number().optional(),
14509
+ /**
14510
+ * Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
14511
+ * code shared copy-on-write across runners. Undefined on macOS.
14512
+ */
14513
+ sharedBytes: number().optional()
14276
14514
  });
14277
14515
  var AddonInstanceSchema = object({
14278
14516
  addonId: string(),
@@ -14321,6 +14559,17 @@ var KillProcessResultSchema = object({
14321
14559
  reason: string().optional(),
14322
14560
  signal: _enum(["SIGTERM", "SIGKILL"]).optional()
14323
14561
  });
14562
+ var DumpHeapSnapshotInputSchema = object({
14563
+ /** The addon whose runner should dump a heap snapshot. */
14564
+ addonId: string() });
14565
+ var DumpHeapSnapshotResultSchema = object({
14566
+ success: boolean(),
14567
+ /** Path of the written .heapsnapshot inside the runner's container/host. */
14568
+ path: string().optional(),
14569
+ /** Process pid that was signalled. */
14570
+ pid: number().optional(),
14571
+ reason: string().optional()
14572
+ });
14324
14573
  var SystemMetricsSchema = object({
14325
14574
  cpuPercent: number(),
14326
14575
  memoryPercent: number(),
@@ -14334,6 +14583,9 @@ var SystemMetricsSchema = object({
14334
14583
  method(_void(), SystemResourceSnapshotSchema), method(_void(), SystemResourceSnapshotSchema.nullable()), method(_void(), SystemMetricsSchema), method(object({ dirPath: string() }), DiskSpaceInfoSchema), method(_void(), MetricsGpuInfoSchema.nullable()), method(_void(), number().nullable()), method(object({ pids: array(number()) }), array(PidResourceStatsSchema)), method(_void(), array(AddonInstanceSchema).readonly()), method(object({ addonId: string() }), PidResourceStatsSchema.nullable()), method(_void(), array(NodeProcessSchema).readonly()), method(KillProcessInputSchema, KillProcessResultSchema, {
14335
14584
  kind: "mutation",
14336
14585
  auth: "admin"
14586
+ }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
14587
+ kind: "mutation",
14588
+ auth: "admin"
14337
14589
  });
14338
14590
  var PtzPresetSchema = object({
14339
14591
  id: string(),
@@ -14700,63 +14952,6 @@ method(object({
14700
14952
  auth: "admin"
14701
14953
  });
14702
14954
  /**
14703
- * device-ops — device-scoped cap that unifies the per-IDevice operations
14704
- * previously routed through the `.device-ops` Moleculer bridge service.
14705
- *
14706
- * Each worker that hosts live `IDevice` instances auto-registers a native
14707
- * provider for this cap (per device) backed by its local
14708
- * `DeviceRegistry`. Hub-side callers reach it transparently through
14709
- * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
14710
- * `deviceId` + `nodeId` and dispatches through the standard cap-router,
14711
- * so there's no parallel bridge path anymore.
14712
- *
14713
- * The surface is intentionally small — every method corresponds to a
14714
- * single action on the live `IDevice` (or `ICameraDevice` for
14715
- * `getStreamSources`). Richer orchestration (enable/disable with
14716
- * integration plumbing, bulk updates) stays in the `device-manager` cap;
14717
- * `device-ops` is the per-device primitive the device-manager routes to.
14718
- */
14719
- var StreamSourceEntrySchema$1 = object({
14720
- id: string(),
14721
- label: string(),
14722
- protocol: _enum([
14723
- "rtsp",
14724
- "rtmp",
14725
- "annexb",
14726
- "http-mjpeg",
14727
- "webrtc",
14728
- "custom"
14729
- ]),
14730
- url: string().optional(),
14731
- resolution: object({
14732
- width: number(),
14733
- height: number()
14734
- }).optional(),
14735
- fps: number().optional(),
14736
- bitrate: number().optional(),
14737
- codec: string().optional(),
14738
- profileHint: CamProfileSchema.optional(),
14739
- sdp: string().optional()
14740
- });
14741
- var ConfigEntrySchema$1 = object({
14742
- key: string(),
14743
- value: unknown()
14744
- });
14745
- var RawStateResultSchema = object({
14746
- /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
14747
- source: string(),
14748
- /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
14749
- data: record(string(), unknown())
14750
- });
14751
- method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
14752
- deviceId: number(),
14753
- values: record(string(), unknown())
14754
- }), _void(), { kind: "mutation" }), method(object({
14755
- deviceId: number(),
14756
- action: string().min(1),
14757
- input: unknown()
14758
- }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
14759
- /**
14760
14955
  * camera-credentials — device-scoped cap exposing the camera's network
14761
14956
  * + auth surface in a vendor-neutral shape.
14762
14957
  *
@@ -18439,6 +18634,12 @@ Object.freeze({
18439
18634
  addonId: null,
18440
18635
  access: "view"
18441
18636
  },
18637
+ "metricsProvider.dumpHeapSnapshot": {
18638
+ capName: "metrics-provider",
18639
+ capScope: "system",
18640
+ addonId: null,
18641
+ access: "create"
18642
+ },
18442
18643
  "metricsProvider.getAddonStats": {
18443
18644
  capName: "metrics-provider",
18444
18645
  capScope: "system",
@@ -18895,6 +19096,12 @@ Object.freeze({
18895
19096
  addonId: null,
18896
19097
  access: "view"
18897
19098
  },
19099
+ "pipelineExecutor.getEngineProvisioning": {
19100
+ capName: "pipeline-executor",
19101
+ capScope: "system",
19102
+ addonId: null,
19103
+ access: "view"
19104
+ },
18898
19105
  "pipelineExecutor.getGlobalPipelineConfig": {
18899
19106
  capName: "pipeline-executor",
18900
19107
  capScope: "system",
@@ -19099,6 +19306,18 @@ Object.freeze({
19099
19306
  addonId: null,
19100
19307
  access: "view"
19101
19308
  },
19309
+ "pipelineOrchestrator.getCameraStatus": {
19310
+ capName: "pipeline-orchestrator",
19311
+ capScope: "system",
19312
+ addonId: null,
19313
+ access: "view"
19314
+ },
19315
+ "pipelineOrchestrator.getCameraStatuses": {
19316
+ capName: "pipeline-orchestrator",
19317
+ capScope: "system",
19318
+ addonId: null,
19319
+ access: "view"
19320
+ },
19102
19321
  "pipelineOrchestrator.getCameraStepOverrides": {
19103
19322
  capName: "pipeline-orchestrator",
19104
19323
  capScope: "system",
@@ -19183,6 +19402,12 @@ Object.freeze({
19183
19402
  addonId: null,
19184
19403
  access: "create"
19185
19404
  },
19405
+ "pipelineOrchestrator.setAgentMaxCameras": {
19406
+ capName: "pipeline-orchestrator",
19407
+ capScope: "system",
19408
+ addonId: null,
19409
+ access: "create"
19410
+ },
19186
19411
  "pipelineOrchestrator.setCameraPipelineForAgent": {
19187
19412
  capName: "pipeline-orchestrator",
19188
19413
  capScope: "system",