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