@camstack/addon-static-turn 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.
@@ -4628,63 +4628,7 @@ function _instanceof(cls, params = {}) {
4628
4628
  return inst;
4629
4629
  }
4630
4630
  //#endregion
4631
- //#region ../types/dist/index.mjs
4632
- /**
4633
- * Deep wiring healthcheck — snapshot of active reachability probes across
4634
- * every declared capability + widget of every installed plugin, on every
4635
- * node. Produced by the backend `WiringHealthService` and surfaced via
4636
- * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
4637
- *
4638
- * Unlike `/health` (process liveness), this reflects whether each cap/widget
4639
- * is actually *reachable* over the real cap-dispatch path. See spec
4640
- * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
4641
- */
4642
- /** What kind of target a probe addressed. */
4643
- var wiringProbeKindSchema = _enum([
4644
- "singleton",
4645
- "device",
4646
- "widget"
4647
- ]);
4648
- /** Result of probing a single (cap|widget [, device]) target. */
4649
- var wiringProbeResultSchema = object({
4650
- capName: string(),
4651
- kind: wiringProbeKindSchema,
4652
- deviceId: number().optional(),
4653
- reachable: boolean(),
4654
- latencyMs: number(),
4655
- error: string().optional()
4656
- });
4657
- /** Per-addon roll-up of cap + widget probe results. */
4658
- var wiringAddonHealthSchema = object({
4659
- addonId: string(),
4660
- caps: array(wiringProbeResultSchema).readonly(),
4661
- widgets: array(wiringProbeResultSchema).readonly()
4662
- });
4663
- /** Per-node roll-up. */
4664
- var wiringNodeHealthSchema = object({
4665
- nodeId: string(),
4666
- addons: array(wiringAddonHealthSchema).readonly()
4667
- });
4668
- object({
4669
- /** True only when every probed target is reachable. */
4670
- ok: boolean(),
4671
- /** True when at least one target is unreachable. */
4672
- degraded: boolean(),
4673
- checkedAt: string(),
4674
- nodes: array(wiringNodeHealthSchema).readonly(),
4675
- summary: object({
4676
- total: number(),
4677
- reachable: number(),
4678
- unreachable: number()
4679
- })
4680
- });
4681
- var MODEL_FORMATS = [
4682
- "onnx",
4683
- "coreml",
4684
- "openvino",
4685
- "tflite",
4686
- "pt"
4687
- ];
4631
+ //#region ../types/dist/sleep-D7JeS58T.mjs
4688
4632
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4689
4633
  EventCategory["SystemBoot"] = "system.boot";
4690
4634
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -4982,6 +4926,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
4982
4926
  */
4983
4927
  EventCategory["PipelineEngineMetricsSnapshot"] = "pipeline.engine-metrics-snapshot";
4984
4928
  /**
4929
+ * Per-node detection-engine runtime-provisioning transition. Emitted by
4930
+ * the detection-pipeline provider on every state change of its lazy
4931
+ * engine-provisioning machine (idle → installing → verifying → ready,
4932
+ * or → failed with a `nextRetryAt`). Payload is the
4933
+ * `EngineProvisioningState` snapshot; `event.source.nodeId` carries the
4934
+ * node. The Pipeline page subscribes to drive a live "installing
4935
+ * OpenVINO… / ready" indicator per node without polling
4936
+ * `pipelineExecutor.getEngineProvisioning`. Telemetry-grade (D8): the UI
4937
+ * also reads the cap snapshot on mount / reconnect. Phase 2.
4938
+ */
4939
+ EventCategory["PipelineEngineProvisioning"] = "pipeline.engine-provisioning";
4940
+ /**
4985
4941
  * Cluster topology snapshot. Carries the same payload returned by
4986
4942
  * `nodes.topology` (every reachable node + addons + processes).
4987
4943
  * Emitted by the hub on any agent / addon lifecycle change
@@ -5995,7 +5951,7 @@ var ProfileSlotSchema = object({
5995
5951
  * Zod schema for StreamSourceEntry — the canonical stream descriptor
5996
5952
  * exposed by ICameraDevice.getStreamSources() and consumed by the broker.
5997
5953
  */
5998
- var StreamSourceEntrySchema = object({
5954
+ var StreamSourceEntrySchema$1 = object({
5999
5955
  id: string(),
6000
5956
  label: string(),
6001
5957
  protocol: _enum([
@@ -6217,894 +6173,1080 @@ var ProfileRtspEntrySchema = object({
6217
6173
  codec: string().optional(),
6218
6174
  resolution: CamStreamResolutionSchema.optional()
6219
6175
  });
6220
- /**
6221
- * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6222
- * Named `RecordingWeekday` to avoid collision with the string-union
6223
- * `Weekday` exported from `interfaces/timezones.ts`.
6224
- */
6225
- var RecordingWeekdaySchema = number().int().min(0).max(6);
6226
- var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6227
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6228
- kind: literal("timeOfDay"),
6229
- start: string().regex(HHMM),
6230
- end: string().regex(HHMM),
6231
- /** Restrict to these weekdays; omit = every day. */
6232
- days: array(RecordingWeekdaySchema).optional()
6233
- })]);
6234
- var RecordingModeSchema = _enum([
6235
- "continuous",
6236
- "onMotion",
6237
- "onAudioThreshold"
6238
- ]);
6239
- /**
6240
- * First-class, authoritative per-camera storage mode the netta choice the UI
6241
- * reads directly (never inferred from `rules`):
6242
- * - `off` not recording.
6243
- * - `events` — record only around triggers (motion / audio threshold),
6244
- * with pre/post-buffer.
6245
- * - `continuous` record 24/7 within the schedule.
6246
- *
6247
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6248
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6249
- */
6250
- var RecordingStorageModeSchema = _enum([
6251
- "off",
6252
- "events",
6253
- "continuous"
6254
- ]);
6255
- /** Which detectors trigger an `events`-mode recording. */
6256
- var RecordingTriggersSchema = object({
6257
- motion: boolean().optional(),
6258
- audioThresholdDbfs: number().optional()
6259
- });
6260
- /**
6261
- * Mode of a single recording band the recorder per-band vocabulary.
6262
- *
6263
- * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6264
- * only ever `continuous` or `events`; "off" is expressed by the absence of a
6265
- * covering band, not by a band value.
6266
- */
6267
- var RecordingBandModeSchema = _enum(["continuous", "events"]);
6268
- /**
6269
- * Triggers for an `events`-mode band. Identical shape to
6270
- * `RecordingTriggersSchema`reuse that schema as the band trigger type so the
6271
- * two never drift.
6272
- */
6273
- var RecordingBandTriggersSchema = RecordingTriggersSchema;
6274
- /**
6275
- * A single mode-per-band window the canonical recorder band shape, the
6276
- * single source of truth re-used by `addon-pipeline/recorder`.
6277
- *
6278
- * `days` lists the weekdays the band covers (empty = every day, matching the
6279
- * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6280
- * span wraps past midnight (handled by the band engine).
6281
- */
6282
- var RecordingBandSchema = object({
6283
- days: array(RecordingWeekdaySchema),
6284
- start: string().regex(HHMM),
6285
- end: string().regex(HHMM),
6286
- mode: RecordingBandModeSchema,
6287
- triggers: RecordingBandTriggersSchema.optional(),
6288
- preBufferSec: number().min(0).optional(),
6289
- postBufferSec: number().min(0).optional()
6290
- });
6291
- var RecordingRuleSchema = object({
6292
- schedule: RecordingScheduleSchema,
6293
- mode: RecordingModeSchema,
6294
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6295
- preBufferSec: number().min(0).default(0),
6296
- /** Keep recording until this many seconds after the last trigger. */
6297
- postBufferSec: number().min(0).default(0),
6298
- /** Each new trigger restarts the post-buffer window. */
6299
- resetTimeoutOnNewEvent: boolean().default(true),
6300
- /** onAudioThreshold only dBFS level that counts as a trigger. */
6301
- thresholdDbfs: number().optional()
6302
- });
6303
- /**
6304
- * Per-device retention overrides. Every field is optional; an unset or `0`
6305
- * value inherits the node-wide recorder default. Only footage-lifetime limits
6306
- * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6307
- * (when the volume is too full to keep recording) is NOT a per-camera concern —
6308
- * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6309
- * shared by every camera writing to that volume.
6310
- */
6311
- var RecordingRetentionSchema = object({
6312
- maxAgeDays: number().min(0).optional(),
6313
- maxSizeGb: number().min(0).optional()
6314
- });
6315
- /**
6316
- * The full per-camera recording intent — the wire shape of a RecordingTarget.
6317
- *
6318
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6319
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6320
- * only for transition + migration (`migrateRulesToMode`); the policy engine
6321
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6322
- */
6323
- var RecordingConfigSchema = object({
6324
- enabled: boolean(),
6325
- /** Authoritative storage mode. Absent on legacy targets → derived once via
6326
- * `migrateRulesToMode`, then persisted. */
6327
- mode: RecordingStorageModeSchema.optional(),
6328
- profiles: array(CamProfileSchema).optional(),
6329
- segmentSeconds: number().int().positive().optional(),
6330
- /** Shared recording time-bands for `events` & `continuous` — record only when
6331
- * the wall-clock falls inside one of these windows. Omit or empty = always.
6332
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
6333
- schedules: array(RecordingScheduleSchema).optional(),
6334
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
6335
- * normalized into `schedules` on read and never written going forward. (Not
6336
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
6337
- schedule: RecordingScheduleSchema.optional(),
6338
- /** `events`-mode only — which detectors trigger a recording. */
6339
- triggers: RecordingTriggersSchema.optional(),
6340
- /** `events`-mode only — seconds retained before / after a trigger. */
6341
- preBufferSec: number().min(0).optional(),
6342
- postBufferSec: number().min(0).optional(),
6343
- /** DEPRECATED authoring input; retained for migration/transition. */
6344
- rules: array(RecordingRuleSchema).optional(),
6345
- /**
6346
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
6347
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
6348
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
6349
- * derived into bands once via `migrateConfigToBands`.
6350
- */
6351
- bands: array(RecordingBandSchema).optional(),
6352
- retention: RecordingRetentionSchema.optional()
6353
- });
6354
- /**
6355
- * `StorageLocationType` — an addon-declared id that identifies the *kind* of
6356
- * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
6357
- * so the persisted record schema and the consumer-facing cap can both consume it
6358
- * without forming a circular import. The `storage` cap re-exports it
6359
- * verbatim for back-compat.
6360
- *
6361
- * This Zod schema is the **authoritative source** for `StorageLocationType`.
6362
- * The TS alias in `./storage.ts` re-exports `z.infer<typeof
6363
- * StorageLocationTypeSchema>` so the wire surface (cap) and the legacy
6364
- * `IStorageProvider` interface stay in lockstep.
6365
- *
6366
- * The type is now an **open string** (not a closed enum) — addons declare
6367
- * their own location kinds via `StorageLocationDeclaration.id`. The regex
6368
- * enforces a safe id format: lowercase-start, alphanumeric + hyphens.
6369
- */
6370
- var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
6371
- /**
6372
- * Persisted record for a storage location instance. Operators can register
6373
- * multiple instances for multi-cardinality types (e.g. two `backups`
6374
- * locations with different `providerId`s). Cardinality is now declared per
6375
- * location via `StorageLocationDeclaration.cardinality` — the static
6376
- * `STORAGE_LOCATION_CARDINALITY` map has been removed.
6377
- *
6378
- * `id` is a stable namespaced string of the form `<type>:<slug>`.
6379
- * The default location for a type uses `id === <type>:default` by
6380
- * convention (the bare type ref like `'backups'` resolves to it).
6381
- *
6382
- * `isSystem: true` marks a location as orchestrator-seeded and
6383
- * undeletable. The bootstrap-installed defaults (one per type) carry
6384
- * this flag; operator-added locations don't. Editing the config of
6385
- * a system location is allowed (path migration, provider swap) but
6386
- * deleting it is rejected at the cap level.
6387
- */
6388
- var StorageLocationSchema = object({
6389
- id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
6390
- type: string(),
6391
- displayName: string().min(1),
6392
- providerId: string().min(1),
6393
- config: record(string(), unknown()),
6394
- /**
6395
- * Cluster node this location physically lives on. REQUIRED for node-local
6396
- * providers (filesystem — the path exists on one node's disk), null/absent
6397
- * for node-agnostic providers (S3/SFTP/WebDAV, reachable from any node).
6398
- * `'hub'` is the hub node. Validated against the provider's `nodeLocal`
6399
- * flag at upsert time, not here (the schema is provider-agnostic).
6400
- */
6401
- nodeId: string().optional(),
6402
- isDefault: boolean().default(false),
6403
- isSystem: boolean().default(false),
6404
- createdAt: number(),
6405
- updatedAt: number()
6406
- });
6407
- /**
6408
- * Reference accepted by consumer-facing `api.storage.*` calls.
6409
- * Either:
6410
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
6411
- * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
6412
- *
6413
- * The orchestrator's `resolveRef(ref)` handles both cases.
6414
- */
6415
- var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]);
6416
- /**
6417
- * `StorageLocationDeclaration` — a single storage-location entry declared by
6418
- * an addon in its `package.json` under `camstack.storageLocations`.
6419
- *
6420
- * Design intent:
6421
- * - **Addon declares its needs** — each addon describes the logical storage
6422
- * slots it requires (e.g. `recordings`, `recordingsLow`) without caring
6423
- * about the physical path.
6424
- * - **Kernel aggregates** — at boot the kernel collects declarations from all
6425
- * installed addons, deduplicates by `id`, and exposes the union via the
6426
- * storage-locations settings surface.
6427
- * - **Orchestrator seeds** — for every declared `id` the orchestrator ensures
6428
- * at least one instance named `<id>:default` is present, using
6429
- * `defaultsTo` to inherit the resolved root from another location when the
6430
- * declaration is a derivative slot (e.g. `recordingsLow` defaults to
6431
- * `recordings`).
6432
- * - **ids are global** — `id` values are shared across the entire deployment;
6433
- * two addons declaring the same `id` must agree on `cardinality` (validated
6434
- * at kernel aggregation time, not here).
6435
- */
6436
- var StorageLocationDeclarationSchema = object({
6437
- /**
6438
- * Global location identifier, e.g. `recordings` or `recordingsLow`.
6439
- * Must start with a lowercase letter and may contain letters, digits, and
6440
- * hyphens.
6441
- */
6442
- id: string().regex(/^[a-z][a-zA-Z0-9-]*$/, { message: "id must start with a lowercase letter and contain only letters, digits, or hyphens" }),
6443
- /** Human-readable name shown in the admin UI. */
6444
- displayName: string().min(1, { message: "displayName must not be empty" }),
6445
- /** Optional longer explanation of what data this location stores. */
6446
- description: string().optional(),
6447
- /**
6448
- * `single` — exactly one instance of this location is allowed system-wide
6449
- * (e.g. `logs`, `models`). The operator can edit it but not add more.
6450
- * `multi` — the operator may register several instances (e.g. a second
6451
- * `recordings` on a NAS for disk tiering); one is the default at any time.
6452
- */
6453
- cardinality: _enum(["single", "multi"]),
6454
- /**
6455
- * When set, the default instance for this location inherits its resolved
6456
- * root from the named location's default instance. Useful for derivative
6457
- * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
6458
- * configure the primary location.
6459
- */
6460
- defaultsTo: string().optional()
6461
- });
6462
- var DecoderStatsSchema = object({
6463
- inputFps: number(),
6464
- outputFps: number(),
6465
- avgDecodeTimeMs: number(),
6466
- droppedFrames: number()
6467
- });
6468
- var DecoderSessionConfigSchema = object({
6469
- codec: string(),
6470
- maxFps: number().default(0),
6471
- outputFormat: _enum([
6472
- "jpeg",
6473
- "rgb",
6474
- "bgr",
6475
- "yuv420",
6476
- "gray"
6477
- ]).default("jpeg"),
6478
- scale: number().default(1),
6479
- width: number().optional(),
6480
- height: number().optional(),
6176
+ var DeviceType = /* @__PURE__ */ function(DeviceType) {
6177
+ DeviceType["Camera"] = "camera";
6178
+ DeviceType["Hub"] = "hub";
6179
+ DeviceType["Light"] = "light";
6180
+ DeviceType["Siren"] = "siren";
6181
+ DeviceType["Switch"] = "switch";
6182
+ DeviceType["Sensor"] = "sensor";
6183
+ DeviceType["Thermostat"] = "thermostat";
6184
+ DeviceType["Button"] = "button";
6185
+ /** Generic stateless event emitter — carries a device's EXACT declared
6186
+ * event vocabulary verbatim (no normalization). Installed with the
6187
+ * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6188
+ * HA bus events (e.g. `zha_event`, generic). */
6189
+ DeviceType["EventEmitter"] = "event-emitter";
6190
+ /** Firmware/software update entity — current vs available version,
6191
+ * updatable flag, update state, and an install action. Installed with
6192
+ * the `update` cap. Sources: Homematic firmware-update channels (and
6193
+ * reusable by other providers, e.g. HA `update.*` entities). */
6194
+ DeviceType["Update"] = "update";
6195
+ DeviceType["Generic"] = "generic";
6196
+ /** Generic notification delivery target (HA `notify.<service>`, future
6197
+ * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6198
+ * endpoint; the `notifier` cap defines the send surface. */
6199
+ DeviceType["Notifier"] = "notifier";
6200
+ /** Pre-recorded action sequence with optional parameters
6201
+ * (HA `script.*`). Runnable via `script-runner` cap. */
6202
+ DeviceType["Script"] = "script";
6203
+ /** Automation rule (HA `automation.*`) enable/disable + manual
6204
+ * trigger surface exposed via `automation-control` cap. */
6205
+ DeviceType["Automation"] = "automation";
6206
+ /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6207
+ DeviceType["Lock"] = "lock";
6208
+ /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6209
+ * `valve.*`). `cover` cap with sub-roles for variant. */
6210
+ DeviceType["Cover"] = "cover";
6211
+ /** Pipe / water / gas valve with open/close/stop and optional
6212
+ * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6213
+ * modelled on the same open/closed lifecycle. */
6214
+ DeviceType["Valve"] = "valve";
6215
+ /** Humidifier / dehumidifier with on/off + target humidity + mode
6216
+ * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6217
+ * modelled on the same target / mode lifecycle. */
6218
+ DeviceType["Humidifier"] = "humidifier";
6219
+ /** Water heater / boiler with target temperature + operation mode +
6220
+ * away mode (HA `water_heater.*`). `water-heater` cap a
6221
+ * climate-family actuator. */
6222
+ DeviceType["WaterHeater"] = "water-heater";
6223
+ /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6224
+ DeviceType["Fan"] = "fan";
6225
+ /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6226
+ * the camera surface those use `Camera`. `media-player` cap. */
6227
+ DeviceType["MediaPlayer"] = "media-player";
6228
+ /** Security panel / alarm system (HA `alarm_control_panel.*`).
6229
+ * `alarm-panel` cap. */
6230
+ DeviceType["AlarmPanel"] = "alarm-panel";
6231
+ /** Generic user-settable input (HA `number` / `input_number` / `select`
6232
+ * / `input_select` / `text` / `input_text` / `input_datetime`).
6233
+ * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6234
+ * TextControl / DateTimeControl. */
6235
+ DeviceType["Control"] = "control";
6236
+ /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6237
+ * `presence` cap. */
6238
+ DeviceType["Presence"] = "presence";
6239
+ /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6240
+ * `weather` cap. */
6241
+ DeviceType["Weather"] = "weather";
6242
+ /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6243
+ DeviceType["Vacuum"] = "vacuum";
6244
+ /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6245
+ * `lawn-mower-control` cap. */
6246
+ DeviceType["LawnMower"] = "lawn-mower";
6247
+ /** Physical HA device group — parent container for entity-children
6248
+ * adopted from a single HA device entry. Not renderable as a
6249
+ * standalone device; exists only to anchor child entities. */
6250
+ DeviceType["Container"] = "container";
6251
+ /** Single still-image entity (HA `image.*`). Read-only display of an
6252
+ * `entity_picture` signed URL the browser loads directly. `image` cap. */
6253
+ DeviceType["Image"] = "image";
6254
+ return DeviceType;
6255
+ }({});
6256
+ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6257
+ DeviceFeature["BatteryOperated"] = "battery-operated";
6258
+ DeviceFeature["Rebootable"] = "rebootable";
6481
6259
  /**
6482
- * Identifier of the camera this decoder session serves. Optional
6483
- * because the cap is generic (any caller could request decode), but
6484
- * stream-broker passes it so decoder logs include `deviceId` for
6485
- * per-camera filtering when diagnosing failures (e.g. node-av
6486
- * sendPacket errors on a single hung camera).
6260
+ * Device supports an on-demand re-sync of its derived spec with its
6261
+ * upstream source drives the generic Re-sync button. The owning
6262
+ * provider implements the action via the `device-adoption.resync` cap.
6487
6263
  */
6488
- deviceId: number().int().nonnegative().optional(),
6264
+ DeviceFeature["Resyncable"] = "resyncable";
6265
+ DeviceFeature["NativeSnapshot"] = "native-snapshot";
6266
+ DeviceFeature["DoorbellButton"] = "doorbell-button";
6267
+ DeviceFeature["TwoWayAudio"] = "two-way-audio";
6268
+ DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6489
6269
  /**
6490
- * Free-form tag for log scoping. Stream-broker uses
6491
- * `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
6492
- * on every line so `grep tag=broker:5/high` filters one camera
6493
- * profile cleanly.
6270
+ * Camera supports the on-firmware autotrack subsystem (subject-
6271
+ * following). Distinct from `PanTiltZoom` because not every PTZ
6272
+ * camera ships autotrack the admin UI uses this flag to gate
6273
+ * the autotrack toggle / settings card without re-deriving from
6274
+ * the cap registry. Mirrors `ptz-autotrack` cap registration:
6275
+ * driver sets this feature when probe confirms the firmware
6276
+ * surface, and registers the cap in the same code path.
6494
6277
  */
6495
- tag: string().optional(),
6278
+ DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6496
6279
  /**
6497
- * Where the session delivers decoded frames (Phase 5 / D9):
6280
+ * Accessory exposes a "trigger on motion" toggle the parent camera's
6281
+ * motion detection automatically activates this device. Mirrors
6282
+ * `motion-trigger` cap registration: drivers set this feature in the
6283
+ * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6498
6284
  *
6499
- * - `'callback'` (default) the legacy pixel path: decoded frames are
6500
- * buffered as `DecodedFrame`s and drained via `pullFrames`.
6501
- * - `'shm'` the shared-memory frame plane: decoded frames are written
6502
- * into an OS shared-memory ring and drained as zero-pixel
6503
- * `FrameHandle`s via `pullHandles`. A session is one mode or the
6504
- * other — `pullFrames` returns nothing for an `'shm'` session and
6505
- * `pullHandles` returns nothing for a `'callback'` session.
6506
- */
6507
- frameSink: _enum(["callback", "shm"]).default("callback")
6508
- });
6509
- var EncodeProfileSchema = object({
6510
- video: object({
6511
- codec: _enum([
6512
- "h264",
6513
- "h265",
6514
- "copy"
6515
- ]),
6516
- profile: _enum([
6517
- "baseline",
6518
- "main",
6519
- "high"
6520
- ]).optional(),
6521
- width: number().int().positive().optional(),
6522
- height: number().int().positive().optional(),
6523
- fps: number().positive().optional(),
6524
- bitrateKbps: number().int().positive().optional(),
6525
- gopFrames: number().int().positive().optional(),
6526
- bf: number().int().min(0).optional(),
6527
- preset: _enum([
6528
- "ultrafast",
6529
- "superfast",
6530
- "veryfast",
6531
- "faster",
6532
- "fast",
6533
- "medium"
6534
- ]).optional(),
6535
- tune: _enum([
6536
- "zerolatency",
6537
- "film",
6538
- "animation"
6539
- ]).optional()
6540
- }),
6541
- audio: union([literal("passthrough"), object({
6542
- codec: _enum([
6543
- "opus",
6544
- "aac",
6545
- "pcmu",
6546
- "pcma",
6547
- "copy"
6548
- ]),
6549
- bitrateKbps: number().int().positive().optional(),
6550
- sampleRateHz: number().int().positive().optional(),
6551
- channels: union([literal(1), literal(2)]).optional()
6552
- })]),
6553
- /**
6554
- * ffmpeg input-side args, inserted between the fixed global flags
6555
- * (`-hide_banner -loglevel error`) and `-i pipe:0`. Free-text array
6556
- * — the widget surfaces a textarea + suggestion chips for the most-
6557
- * used demuxer/format options.
6558
- */
6559
- inputArgs: array(string()).optional(),
6560
- /**
6561
- * ffmpeg output-side args, inserted between the encode block and
6562
- * the final `-f <muxer> pipe:1`. Use for muxer options, bitstream
6563
- * filters, codec-specific overrides. Free-text array.
6285
+ * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6286
+ * fast scalar without binding fetch), notifier rules, and `listAll`
6287
+ * filters that want "all devices with on-motion behaviour".
6564
6288
  */
6565
- outputArgs: array(string()).optional()
6566
- });
6567
- var YAMNET_TO_MACRO = {
6568
- mapping: {
6569
- Speech: "speech",
6570
- "Child speech, kid speaking": "speech",
6571
- Conversation: "speech",
6572
- "Narration, monologue": "speech",
6573
- Babbling: "speech",
6574
- Whispering: "speech",
6575
- "Speech synthesizer": "speech",
6576
- Humming: "speech",
6577
- Rapping: "speech",
6578
- Singing: "speech",
6579
- Choir: "speech",
6580
- "Child singing": "speech",
6581
- Shout: "scream",
6582
- Bellow: "scream",
6583
- Yell: "scream",
6584
- Screaming: "scream",
6585
- "Children shouting": "scream",
6586
- Whoop: "scream",
6587
- "Crying, sobbing": "crying",
6588
- "Baby cry, infant cry": "crying",
6589
- Whimper: "crying",
6590
- "Wail, moan": "crying",
6591
- Groan: "crying",
6592
- Laughter: "laughter",
6593
- "Baby laughter": "laughter",
6594
- Giggle: "laughter",
6595
- Snicker: "laughter",
6596
- "Belly laugh": "laughter",
6597
- "Chuckle, chortle": "laughter",
6598
- Music: "music",
6599
- "Musical instrument": "music",
6600
- Guitar: "music",
6601
- Piano: "music",
6602
- Drum: "music",
6603
- "Drum kit": "music",
6604
- "Violin, fiddle": "music",
6605
- Flute: "music",
6606
- Saxophone: "music",
6607
- Trumpet: "music",
6608
- Synthesizer: "music",
6609
- "Pop music": "music",
6610
- "Rock music": "music",
6611
- "Hip hop music": "music",
6612
- "Classical music": "music",
6613
- Jazz: "music",
6614
- "Electronic music": "music",
6615
- "Background music": "music",
6616
- Dog: "dog",
6617
- Bark: "dog",
6618
- Yip: "dog",
6619
- Howl: "dog",
6620
- "Bow-wow": "dog",
6621
- Growling: "dog",
6622
- "Whimper (dog)": "dog",
6623
- Cat: "cat",
6624
- Purr: "cat",
6625
- Meow: "cat",
6626
- Hiss: "cat",
6627
- Caterwaul: "cat",
6628
- Bird: "bird",
6629
- "Bird vocalization, bird call, bird song": "bird",
6630
- "Chirp, tweet": "bird",
6631
- Squawk: "bird",
6632
- Crow: "bird",
6633
- Owl: "bird",
6634
- "Pigeon, dove": "bird",
6635
- Animal: "animal",
6636
- "Domestic animals, pets": "animal",
6637
- "Livestock, farm animals, working animals": "animal",
6638
- Horse: "animal",
6639
- "Cattle, bovinae": "animal",
6640
- Pig: "animal",
6641
- Sheep: "animal",
6642
- Goat: "animal",
6643
- Frog: "animal",
6644
- Insect: "animal",
6645
- Cricket: "animal",
6646
- Alarm: "alarm",
6647
- "Alarm clock": "alarm",
6648
- "Smoke detector, smoke alarm": "alarm",
6649
- "Fire alarm": "alarm",
6650
- Buzzer: "alarm",
6651
- "Civil defense siren": "alarm",
6652
- "Car alarm": "alarm",
6653
- Siren: "siren",
6654
- "Police car (siren)": "siren",
6655
- "Ambulance (siren)": "siren",
6656
- "Fire engine, fire truck (siren)": "siren",
6657
- "Emergency vehicle": "siren",
6658
- Foghorn: "siren",
6659
- Doorbell: "doorbell",
6660
- "Ding-dong": "doorbell",
6661
- Knock: "doorbell",
6662
- Tap: "doorbell",
6663
- Glass: "glass_breaking",
6664
- Shatter: "glass_breaking",
6665
- "Chink, clink": "glass_breaking",
6666
- "Gunshot, gunfire": "gunshot",
6667
- "Machine gun": "gunshot",
6668
- Explosion: "gunshot",
6669
- Fireworks: "gunshot",
6670
- Firecracker: "gunshot",
6671
- "Artillery fire": "gunshot",
6672
- "Cap gun": "gunshot",
6673
- Boom: "gunshot",
6674
- Vehicle: "vehicle",
6675
- Car: "vehicle",
6676
- Truck: "vehicle",
6677
- Bus: "vehicle",
6678
- Motorcycle: "vehicle",
6679
- "Car passing by": "vehicle",
6680
- "Vehicle horn, car horn, honking": "vehicle",
6681
- "Traffic noise, roadway noise": "vehicle",
6682
- Train: "vehicle",
6683
- Aircraft: "vehicle",
6684
- Helicopter: "vehicle",
6685
- Bicycle: "vehicle",
6686
- Skateboard: "vehicle",
6687
- Fire: "fire",
6688
- Crackle: "fire",
6689
- Water: "water",
6690
- Rain: "water",
6691
- Raindrop: "water",
6692
- "Rain on surface": "water",
6693
- Stream: "water",
6694
- Waterfall: "water",
6695
- Ocean: "water",
6696
- "Waves, surf": "water",
6697
- "Splash, splatter": "water",
6698
- Wind: "wind",
6699
- Thunderstorm: "wind",
6700
- Thunder: "wind",
6701
- "Wind noise (microphone)": "wind",
6702
- "Rustling leaves": "wind",
6703
- Door: "door",
6704
- "Sliding door": "door",
6705
- Slam: "door",
6706
- "Cupboard open or close": "door",
6707
- "Walk, footsteps": "footsteps",
6708
- Run: "footsteps",
6709
- Shuffle: "footsteps",
6710
- Crowd: "crowd",
6711
- Chatter: "crowd",
6712
- Cheering: "crowd",
6713
- Applause: "crowd",
6714
- "Children playing": "crowd",
6715
- "Hubbub, speech noise, speech babble": "crowd",
6716
- Telephone: "telephone",
6717
- "Telephone bell ringing": "telephone",
6718
- Ringtone: "telephone",
6719
- "Telephone dialing, DTMF": "telephone",
6720
- "Busy signal": "telephone",
6721
- Engine: "engine",
6722
- "Engine starting": "engine",
6723
- Idling: "engine",
6724
- "Accelerating, revving, vroom": "engine",
6725
- "Light engine (high frequency)": "engine",
6726
- "Medium engine (mid frequency)": "engine",
6727
- "Heavy engine (low frequency)": "engine",
6728
- "Lawn mower": "engine",
6729
- Chainsaw: "engine",
6730
- Hammer: "tools",
6731
- Jackhammer: "tools",
6732
- Sawing: "tools",
6733
- "Power tool": "tools",
6734
- Drill: "tools",
6735
- Sanding: "tools",
6736
- Silence: "silence"
6737
- },
6738
- preserveOriginal: false
6739
- };
6740
- var APPLE_SA_TO_MACRO = {
6741
- mapping: {
6742
- speech: "speech",
6743
- child_speech: "speech",
6744
- conversation: "speech",
6745
- whispering: "speech",
6746
- singing: "speech",
6747
- humming: "speech",
6748
- shout: "scream",
6749
- yell: "scream",
6750
- screaming: "scream",
6751
- crying: "crying",
6752
- baby_crying: "crying",
6753
- sobbing: "crying",
6754
- laughter: "laughter",
6755
- baby_laughter: "laughter",
6756
- giggling: "laughter",
6757
- music: "music",
6758
- guitar: "music",
6759
- piano: "music",
6760
- drums: "music",
6761
- dog_bark: "dog",
6762
- dog_bow_wow: "dog",
6763
- dog_growling: "dog",
6764
- dog_howl: "dog",
6765
- cat_meow: "cat",
6766
- cat_purr: "cat",
6767
- cat_hiss: "cat",
6768
- bird: "bird",
6769
- bird_chirp: "bird",
6770
- bird_squawk: "bird",
6771
- animal: "animal",
6772
- horse: "animal",
6773
- cow_moo: "animal",
6774
- insect: "animal",
6775
- alarm: "alarm",
6776
- smoke_alarm: "alarm",
6777
- fire_alarm: "alarm",
6778
- car_alarm: "alarm",
6779
- siren: "siren",
6780
- police_siren: "siren",
6781
- ambulance_siren: "siren",
6782
- doorbell: "doorbell",
6783
- door_knock: "doorbell",
6784
- knocking: "doorbell",
6785
- glass_breaking: "glass_breaking",
6786
- glass_shatter: "glass_breaking",
6787
- gunshot: "gunshot",
6788
- explosion: "gunshot",
6789
- fireworks: "gunshot",
6790
- car: "vehicle",
6791
- truck: "vehicle",
6792
- motorcycle: "vehicle",
6793
- car_horn: "vehicle",
6794
- vehicle_horn: "vehicle",
6795
- traffic: "vehicle",
6796
- fire: "fire",
6797
- fire_crackle: "fire",
6798
- water: "water",
6799
- rain: "water",
6800
- ocean: "water",
6801
- splash: "water",
6802
- wind: "wind",
6803
- thunder: "wind",
6804
- thunderstorm: "wind",
6805
- door: "door",
6806
- door_slam: "door",
6807
- sliding_door: "door",
6808
- footsteps: "footsteps",
6809
- walking: "footsteps",
6810
- running: "footsteps",
6811
- crowd: "crowd",
6812
- chatter: "crowd",
6813
- cheering: "crowd",
6814
- applause: "crowd",
6815
- telephone_ring: "telephone",
6816
- ringtone: "telephone",
6817
- engine: "engine",
6818
- engine_starting: "engine",
6819
- lawn_mower: "engine",
6820
- chainsaw: "engine",
6821
- hammer: "tools",
6822
- jackhammer: "tools",
6823
- drill: "tools",
6824
- power_tool: "tools",
6825
- silence: "silence"
6826
- },
6827
- preserveOriginal: false
6828
- };
6829
- var _macroLookup = /* @__PURE__ */ new Map();
6830
- for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6831
- for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6832
- var DeviceType = /* @__PURE__ */ function(DeviceType) {
6833
- DeviceType["Camera"] = "camera";
6834
- DeviceType["Hub"] = "hub";
6835
- DeviceType["Light"] = "light";
6836
- DeviceType["Siren"] = "siren";
6837
- DeviceType["Switch"] = "switch";
6838
- DeviceType["Sensor"] = "sensor";
6839
- DeviceType["Thermostat"] = "thermostat";
6840
- DeviceType["Button"] = "button";
6841
- /** Generic stateless event emitter — carries a device's EXACT declared
6842
- * event vocabulary verbatim (no normalization). Installed with the
6843
- * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6844
- * HA bus events (e.g. `zha_event`, generic). */
6845
- DeviceType["EventEmitter"] = "event-emitter";
6846
- /** Firmware/software update entity — current vs available version,
6847
- * updatable flag, update state, and an install action. Installed with
6848
- * the `update` cap. Sources: Homematic firmware-update channels (and
6849
- * reusable by other providers, e.g. HA `update.*` entities). */
6850
- DeviceType["Update"] = "update";
6851
- DeviceType["Generic"] = "generic";
6852
- /** Generic notification delivery target (HA `notify.<service>`, future
6853
- * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6854
- * endpoint; the `notifier` cap defines the send surface. */
6855
- DeviceType["Notifier"] = "notifier";
6856
- /** Pre-recorded action sequence with optional parameters
6857
- * (HA `script.*`). Runnable via `script-runner` cap. */
6858
- DeviceType["Script"] = "script";
6859
- /** Automation rule (HA `automation.*`) — enable/disable + manual
6860
- * trigger surface exposed via `automation-control` cap. */
6861
- DeviceType["Automation"] = "automation";
6862
- /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6863
- DeviceType["Lock"] = "lock";
6864
- /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6865
- * `valve.*`). `cover` cap with sub-roles for variant. */
6866
- DeviceType["Cover"] = "cover";
6867
- /** Pipe / water / gas valve with open/close/stop and optional
6868
- * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6869
- * modelled on the same open/closed lifecycle. */
6870
- DeviceType["Valve"] = "valve";
6871
- /** Humidifier / dehumidifier with on/off + target humidity + mode
6872
- * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6873
- * modelled on the same target / mode lifecycle. */
6874
- DeviceType["Humidifier"] = "humidifier";
6875
- /** Water heater / boiler with target temperature + operation mode +
6876
- * away mode (HA `water_heater.*`). `water-heater` cap — a
6877
- * climate-family actuator. */
6878
- DeviceType["WaterHeater"] = "water-heater";
6879
- /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6880
- DeviceType["Fan"] = "fan";
6881
- /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6882
- * the camera surface — those use `Camera`. `media-player` cap. */
6883
- DeviceType["MediaPlayer"] = "media-player";
6884
- /** Security panel / alarm system (HA `alarm_control_panel.*`).
6885
- * `alarm-panel` cap. */
6886
- DeviceType["AlarmPanel"] = "alarm-panel";
6887
- /** Generic user-settable input (HA `number` / `input_number` / `select`
6888
- * / `input_select` / `text` / `input_text` / `input_datetime`).
6889
- * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6890
- * TextControl / DateTimeControl. */
6891
- DeviceType["Control"] = "control";
6892
- /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6893
- * `presence` cap. */
6894
- DeviceType["Presence"] = "presence";
6895
- /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6896
- * `weather` cap. */
6897
- DeviceType["Weather"] = "weather";
6898
- /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6899
- DeviceType["Vacuum"] = "vacuum";
6900
- /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6901
- * `lawn-mower-control` cap. */
6902
- DeviceType["LawnMower"] = "lawn-mower";
6903
- /** Physical HA device group — parent container for entity-children
6904
- * adopted from a single HA device entry. Not renderable as a
6905
- * standalone device; exists only to anchor child entities. */
6906
- DeviceType["Container"] = "container";
6907
- /** Single still-image entity (HA `image.*`). Read-only display of an
6908
- * `entity_picture` signed URL the browser loads directly. `image` cap. */
6909
- DeviceType["Image"] = "image";
6910
- return DeviceType;
6289
+ DeviceFeature["MotionTrigger"] = "motion-trigger";
6290
+ /** Light supports rgb-triplet color via `color` cap. */
6291
+ DeviceFeature["LightColorRgb"] = "light-color-rgb";
6292
+ /** Light supports HSV color via `color` cap. */
6293
+ DeviceFeature["LightColorHsv"] = "light-color-hsv";
6294
+ /** Light supports color-temperature (mired) via `color` cap. */
6295
+ DeviceFeature["LightColorMired"] = "light-color-mired";
6296
+ /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6297
+ * targetHigh). Gates the range slider UI. */
6298
+ DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6299
+ /** Thermostat exposes target humidity and/or current humidity
6300
+ * readings. Gates the humidity controls. */
6301
+ DeviceFeature["ClimateHumidity"] = "climate-humidity";
6302
+ /** Thermostat exposes a fan-mode selector. */
6303
+ DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6304
+ /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6305
+ DeviceFeature["ClimatePreset"] = "climate-preset";
6306
+ /** Cover exposes intermediate position control (0..100). Gates the
6307
+ * position slider UI. */
6308
+ DeviceFeature["CoverPositionable"] = "cover-positionable";
6309
+ /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6310
+ DeviceFeature["CoverTilt"] = "cover-tilt";
6311
+ /** Valve exposes intermediate position control (0..100). Gates the
6312
+ * position slider / drag surface UI. */
6313
+ DeviceFeature["ValvePositionable"] = "valve-positionable";
6314
+ /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6315
+ DeviceFeature["FanSpeed"] = "fan-speed";
6316
+ /** Fan exposes a preset mode selector. */
6317
+ DeviceFeature["FanPreset"] = "fan-preset";
6318
+ /** Fan exposes blade direction (forward/reverse) — typical of
6319
+ * ceiling fans. */
6320
+ DeviceFeature["FanDirection"] = "fan-direction";
6321
+ /** Fan exposes an oscillation toggle. */
6322
+ DeviceFeature["FanOscillating"] = "fan-oscillating";
6323
+ /** Lock requires a PIN code on lock/unlock. Gates the code-entry
6324
+ * field on the UI lock-controls panel. */
6325
+ DeviceFeature["LockPinRequired"] = "lock-pin-required";
6326
+ /** Lock supports a latch-release ("open door") action distinct from
6327
+ * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
6328
+ * `supported_features`. Gates the Open Door button in the UI. */
6329
+ DeviceFeature["LockOpen"] = "lock-open";
6330
+ /** Media player exposes a seek-to-position surface. */
6331
+ DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
6332
+ /** Media player exposes a volume-level setter. */
6333
+ DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
6334
+ /** Media player exposes a mute toggle distinct from volume=0. */
6335
+ DeviceFeature["MediaPlayerMute"] = "media-player-mute";
6336
+ /** Media player exposes a shuffle toggle. */
6337
+ DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
6338
+ /** Media player exposes a repeat mode (off / all / one). */
6339
+ DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
6340
+ /** Media player exposes a source / input selector. */
6341
+ DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
6342
+ /** Media player exposes a play-arbitrary-media surface (URL / id). */
6343
+ DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
6344
+ /** Media player exposes next-track. */
6345
+ DeviceFeature["MediaPlayerNext"] = "media-player-next";
6346
+ /** Media player exposes previous-track. */
6347
+ DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
6348
+ /** Media player exposes stop distinct from pause. */
6349
+ DeviceFeature["MediaPlayerStop"] = "media-player-stop";
6350
+ /** Alarm panel requires a PIN code on arm/disarm. */
6351
+ DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
6352
+ /** Presence device carries GPS coordinates (lat/lng/accuracy) in
6353
+ * addition to a textual location. */
6354
+ DeviceFeature["PresenceGps"] = "presence-gps";
6355
+ /** Notifier accepts an inline / URL image attachment. */
6356
+ DeviceFeature["NotifierImage"] = "notifier-image";
6357
+ /** Notifier accepts a priority hint (high/normal/low). */
6358
+ DeviceFeature["NotifierPriority"] = "notifier-priority";
6359
+ /** Notifier accepts a free-form `data` payload for platform-specific
6360
+ * fields. */
6361
+ DeviceFeature["NotifierData"] = "notifier-data";
6362
+ /** Notifier supports interactive action buttons / callbacks. */
6363
+ DeviceFeature["NotifierActions"] = "notifier-actions";
6364
+ /** Notifier supports per-call recipient targeting (multi-user). */
6365
+ DeviceFeature["NotifierRecipients"] = "notifier-recipients";
6366
+ /** Script runner accepts a variables map on each run invocation. */
6367
+ DeviceFeature["ScriptVariables"] = "script-variables";
6368
+ /** Automation `trigger` accepts a skipCondition flag — fires the
6369
+ * automation's actions while bypassing its condition block. */
6370
+ DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
6371
+ return DeviceFeature;
6372
+ }({});
6373
+ /**
6374
+ * Semantic role a device plays within its parent. Populated by driver
6375
+ * addons when creating accessory devices (Reolink siren/floodlight/
6376
+ * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
6377
+ * admin UI to pick icons, labels, and widgets — a `Switch` with
6378
+ * `role: Floodlight` renders as a bulb with a brightness slider,
6379
+ * whereas a `Switch` with `role: Siren` renders as a klaxon.
6380
+ *
6381
+ * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
6382
+ * sqlite as a nullable TEXT column — old rows keep working unchanged.
6383
+ */
6384
+ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
6385
+ DeviceRole["Siren"] = "siren";
6386
+ DeviceRole["Floodlight"] = "floodlight";
6387
+ DeviceRole["Spotlight"] = "spotlight";
6388
+ DeviceRole["PirSensor"] = "pir-sensor";
6389
+ DeviceRole["Chime"] = "chime";
6390
+ DeviceRole["Autotrack"] = "autotrack";
6391
+ DeviceRole["Nightvision"] = "nightvision";
6392
+ DeviceRole["PrivacyMask"] = "privacy-mask";
6393
+ DeviceRole["Doorbell"] = "doorbell";
6394
+ /** Virtual HA toggle (input_boolean.*) — distinguishable from a
6395
+ * real Switch device for UI rendering / export adapters. */
6396
+ DeviceRole["BinaryHelper"] = "binary-helper";
6397
+ /** Generic motion / occupancy / moving event source. Distinct from
6398
+ * the camera accessory PirSensor role: that one is a camera child;
6399
+ * this is a standalone HA / 3rd-party motion sensor. */
6400
+ DeviceRole["MotionSensor"] = "motion-sensor";
6401
+ DeviceRole["ContactSensor"] = "contact-sensor";
6402
+ DeviceRole["LeakSensor"] = "leak-sensor";
6403
+ DeviceRole["SmokeSensor"] = "smoke-sensor";
6404
+ DeviceRole["COSensor"] = "co-sensor";
6405
+ DeviceRole["GasSensor"] = "gas-sensor";
6406
+ DeviceRole["TamperSensor"] = "tamper-sensor";
6407
+ DeviceRole["VibrationSensor"] = "vibration-sensor";
6408
+ DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
6409
+ DeviceRole["SoundSensor"] = "sound-sensor";
6410
+ /** Fallback for `binary_sensor` without a known `device_class`. */
6411
+ DeviceRole["BinarySensor"] = "binary-sensor";
6412
+ DeviceRole["TemperatureSensor"] = "temperature-sensor";
6413
+ DeviceRole["HumiditySensor"] = "humidity-sensor";
6414
+ DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
6415
+ DeviceRole["PressureSensor"] = "pressure-sensor";
6416
+ DeviceRole["PowerSensor"] = "power-sensor";
6417
+ DeviceRole["EnergySensor"] = "energy-sensor";
6418
+ DeviceRole["VoltageSensor"] = "voltage-sensor";
6419
+ DeviceRole["CurrentSensor"] = "current-sensor";
6420
+ DeviceRole["AirQualitySensor"] = "air-quality-sensor";
6421
+ /** Battery level (numeric % via `sensor` OR low-bool via
6422
+ * `binary_sensor` — the cap distinguishes via the value type). */
6423
+ DeviceRole["BatterySensor"] = "battery-sensor";
6424
+ /** Fallback for `sensor` numeric without a known `device_class`. */
6425
+ DeviceRole["NumericSensor"] = "numeric-sensor";
6426
+ /** String / enum state (HA `sensor` with `state_class: enum` or
6427
+ * `attributes.options`). */
6428
+ DeviceRole["EnumSensor"] = "enum-sensor";
6429
+ /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
6430
+ * or `date`). The slice carries the raw ISO string verbatim (hosted on
6431
+ * the `enum-sensor` cap); the UI renders it locale-formatted. */
6432
+ DeviceRole["DateTimeSensor"] = "datetime-sensor";
6433
+ /** Last-resort fallback when nothing else matches. */
6434
+ DeviceRole["GenericSensor"] = "generic-sensor";
6435
+ DeviceRole["NumericControl"] = "numeric-control";
6436
+ DeviceRole["SelectControl"] = "select-control";
6437
+ DeviceRole["TextControl"] = "text-control";
6438
+ DeviceRole["DateTimeControl"] = "datetime-control";
6439
+ /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
6440
+ * rich features (image, priority, channel routing). */
6441
+ DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
6442
+ /** Chat / messaging service (HA `notify.telegram_*`,
6443
+ * `notify.discord_*`, etc.). */
6444
+ DeviceRole["MessagingNotifier"] = "messaging-notifier";
6445
+ /** Email-based delivery (HA `notify.smtp`, etc.). */
6446
+ DeviceRole["EmailNotifier"] = "email-notifier";
6447
+ /** Fallback when the notifier service name doesn't match a known
6448
+ * pattern. */
6449
+ DeviceRole["GenericNotifier"] = "generic-notifier";
6450
+ return DeviceRole;
6911
6451
  }({});
6912
- var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6913
- DeviceFeature["BatteryOperated"] = "battery-operated";
6914
- DeviceFeature["Rebootable"] = "rebootable";
6452
+ /**
6453
+ * Generic types for capability definitions.
6454
+ *
6455
+ * A capability is defined with Zod schemas for methods, events, and settings.
6456
+ * TypeScript types are inferred via z.infer<> — zero duplication.
6457
+ *
6458
+ * Pattern:
6459
+ * 1. Define Zod schemas for data, methods, settings
6460
+ * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
6461
+ * 3. Export type IProvider = InferProvider<typeof capabilityDef>
6462
+ * 4. Addon implements IProvider
6463
+ * 5. Registry auto-mounts tRPC router from definition.methods
6464
+ */
6465
+ /**
6466
+ * Output schema shared by the contribution + live methods.
6467
+ *
6468
+ * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
6469
+ * tabs[]) without importing from `../interfaces/config-ui.js` — a
6470
+ * concrete-but-lenient Zod object keeps tRPC output inference happy
6471
+ * (using `z.unknown()` here collapses unrelated router branches to
6472
+ * `unknown` when the generator re-inlines the huge AppRouter type).
6473
+ *
6474
+ * `.passthrough()` on sections/fields accepts whatever FormBuilder
6475
+ * extensions the caller adds (showWhen, displayScale, …) without
6476
+ * rebuilding every time a new field kind is introduced.
6477
+ */
6478
+ var ContributionSectionSchema = object({
6479
+ id: string(),
6480
+ title: string(),
6481
+ description: string().optional(),
6482
+ style: _enum(["card", "accordion"]).optional(),
6483
+ defaultCollapsed: boolean().optional(),
6484
+ columns: union([
6485
+ literal(1),
6486
+ literal(2),
6487
+ literal(3),
6488
+ literal(4)
6489
+ ]).optional(),
6490
+ tab: string().optional(),
6491
+ location: _enum(["settings", "top-tab"]).optional(),
6492
+ order: number().optional(),
6493
+ fields: array(any())
6494
+ });
6495
+ object({
6496
+ tabs: array(object({
6497
+ id: string(),
6498
+ label: string(),
6499
+ icon: string(),
6500
+ order: number().optional()
6501
+ })).optional(),
6502
+ sections: array(ContributionSectionSchema)
6503
+ }).nullable();
6504
+ object({ deviceId: number() }), object({ deviceId: number() }), object({
6505
+ deviceId: number(),
6506
+ patch: record(string(), unknown())
6507
+ }), object({ success: literal(true) });
6508
+ object({ deviceId: number() }), unknown().nullable();
6509
+ /** Shorthand to define a method schema */
6510
+ function method(input, output, options) {
6511
+ return {
6512
+ input,
6513
+ output,
6514
+ kind: options?.kind ?? "query",
6515
+ auth: options?.auth ?? "protected",
6516
+ ...options?.access !== void 0 ? { access: options.access } : {},
6517
+ timeoutMs: options?.timeoutMs
6518
+ };
6519
+ }
6520
+ var StaticDirOutputSchema = object({ staticDir: string() });
6521
+ var VersionOutputSchema = object({ version: string() });
6522
+ method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
6523
+ /**
6524
+ * device-ops — device-scoped cap that unifies the per-IDevice operations
6525
+ * previously routed through the `.device-ops` Moleculer bridge service.
6526
+ *
6527
+ * Each worker that hosts live `IDevice` instances auto-registers a native
6528
+ * provider for this cap (per device) backed by its local
6529
+ * `DeviceRegistry`. Hub-side callers reach it transparently through
6530
+ * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
6531
+ * `deviceId` + `nodeId` and dispatches through the standard cap-router,
6532
+ * so there's no parallel bridge path anymore.
6533
+ *
6534
+ * The surface is intentionally small — every method corresponds to a
6535
+ * single action on the live `IDevice` (or `ICameraDevice` for
6536
+ * `getStreamSources`). Richer orchestration (enable/disable with
6537
+ * integration plumbing, bulk updates) stays in the `device-manager` cap;
6538
+ * `device-ops` is the per-device primitive the device-manager routes to.
6539
+ */
6540
+ var StreamSourceEntrySchema = object({
6541
+ id: string(),
6542
+ label: string(),
6543
+ protocol: _enum([
6544
+ "rtsp",
6545
+ "rtmp",
6546
+ "annexb",
6547
+ "http-mjpeg",
6548
+ "webrtc",
6549
+ "custom"
6550
+ ]),
6551
+ url: string().optional(),
6552
+ resolution: object({
6553
+ width: number(),
6554
+ height: number()
6555
+ }).optional(),
6556
+ fps: number().optional(),
6557
+ bitrate: number().optional(),
6558
+ codec: string().optional(),
6559
+ profileHint: CamProfileSchema.optional(),
6560
+ sdp: string().optional()
6561
+ });
6562
+ var ConfigEntrySchema$1 = object({
6563
+ key: string(),
6564
+ value: unknown()
6565
+ });
6566
+ var RawStateResultSchema = object({
6567
+ /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
6568
+ source: string(),
6569
+ /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
6570
+ data: record(string(), unknown())
6571
+ });
6572
+ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
6573
+ deviceId: number(),
6574
+ values: record(string(), unknown())
6575
+ }), _void(), { kind: "mutation" }), method(object({
6576
+ deviceId: number(),
6577
+ action: string().min(1),
6578
+ input: unknown()
6579
+ }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
6580
+ //#endregion
6581
+ //#region ../types/dist/index.mjs
6582
+ /**
6583
+ * Deep wiring healthcheck — snapshot of active reachability probes across
6584
+ * every declared capability + widget of every installed plugin, on every
6585
+ * node. Produced by the backend `WiringHealthService` and surfaced via
6586
+ * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
6587
+ *
6588
+ * Unlike `/health` (process liveness), this reflects whether each cap/widget
6589
+ * is actually *reachable* over the real cap-dispatch path. See spec
6590
+ * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
6591
+ */
6592
+ /** What kind of target a probe addressed. */
6593
+ var wiringProbeKindSchema = _enum([
6594
+ "singleton",
6595
+ "device",
6596
+ "widget"
6597
+ ]);
6598
+ /** Result of probing a single (cap|widget [, device]) target. */
6599
+ var wiringProbeResultSchema = object({
6600
+ capName: string(),
6601
+ kind: wiringProbeKindSchema,
6602
+ deviceId: number().optional(),
6603
+ reachable: boolean(),
6604
+ latencyMs: number(),
6605
+ error: string().optional()
6606
+ });
6607
+ /** Per-addon roll-up of cap + widget probe results. */
6608
+ var wiringAddonHealthSchema = object({
6609
+ addonId: string(),
6610
+ caps: array(wiringProbeResultSchema).readonly(),
6611
+ widgets: array(wiringProbeResultSchema).readonly()
6612
+ });
6613
+ /** Per-node roll-up. */
6614
+ var wiringNodeHealthSchema = object({
6615
+ nodeId: string(),
6616
+ addons: array(wiringAddonHealthSchema).readonly()
6617
+ });
6618
+ object({
6619
+ /** True only when every probed target is reachable. */
6620
+ ok: boolean(),
6621
+ /** True when at least one target is unreachable. */
6622
+ degraded: boolean(),
6623
+ checkedAt: string(),
6624
+ nodes: array(wiringNodeHealthSchema).readonly(),
6625
+ summary: object({
6626
+ total: number(),
6627
+ reachable: number(),
6628
+ unreachable: number()
6629
+ })
6630
+ });
6631
+ var MODEL_FORMATS = [
6632
+ "onnx",
6633
+ "coreml",
6634
+ "openvino",
6635
+ "tflite",
6636
+ "pt"
6637
+ ];
6638
+ /**
6639
+ * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6640
+ * Named `RecordingWeekday` to avoid collision with the string-union
6641
+ * `Weekday` exported from `interfaces/timezones.ts`.
6642
+ */
6643
+ var RecordingWeekdaySchema = number().int().min(0).max(6);
6644
+ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6645
+ var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6646
+ kind: literal("timeOfDay"),
6647
+ start: string().regex(HHMM),
6648
+ end: string().regex(HHMM),
6649
+ /** Restrict to these weekdays; omit = every day. */
6650
+ days: array(RecordingWeekdaySchema).optional()
6651
+ })]);
6652
+ var RecordingModeSchema = _enum([
6653
+ "continuous",
6654
+ "onMotion",
6655
+ "onAudioThreshold"
6656
+ ]);
6657
+ /**
6658
+ * First-class, authoritative per-camera storage mode — the netta choice the UI
6659
+ * reads directly (never inferred from `rules`):
6660
+ * - `off` — not recording.
6661
+ * - `events` — record only around triggers (motion / audio threshold),
6662
+ * with pre/post-buffer.
6663
+ * - `continuous` — record 24/7 within the schedule.
6664
+ *
6665
+ * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6666
+ * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6667
+ */
6668
+ var RecordingStorageModeSchema = _enum([
6669
+ "off",
6670
+ "events",
6671
+ "continuous"
6672
+ ]);
6673
+ /** Which detectors trigger an `events`-mode recording. */
6674
+ var RecordingTriggersSchema = object({
6675
+ motion: boolean().optional(),
6676
+ audioThresholdDbfs: number().optional()
6677
+ });
6678
+ /**
6679
+ * Mode of a single recording band — the recorder per-band vocabulary.
6680
+ *
6681
+ * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6682
+ * only ever `continuous` or `events`; "off" is expressed by the absence of a
6683
+ * covering band, not by a band value.
6684
+ */
6685
+ var RecordingBandModeSchema = _enum(["continuous", "events"]);
6686
+ /**
6687
+ * Triggers for an `events`-mode band. Identical shape to
6688
+ * `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
6689
+ * two never drift.
6690
+ */
6691
+ var RecordingBandTriggersSchema = RecordingTriggersSchema;
6692
+ /**
6693
+ * A single mode-per-band window — the canonical recorder band shape, the
6694
+ * single source of truth re-used by `addon-pipeline/recorder`.
6695
+ *
6696
+ * `days` lists the weekdays the band covers (empty = every day, matching the
6697
+ * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6698
+ * span wraps past midnight (handled by the band engine).
6699
+ */
6700
+ var RecordingBandSchema = object({
6701
+ days: array(RecordingWeekdaySchema),
6702
+ start: string().regex(HHMM),
6703
+ end: string().regex(HHMM),
6704
+ mode: RecordingBandModeSchema,
6705
+ triggers: RecordingBandTriggersSchema.optional(),
6706
+ preBufferSec: number().min(0).optional(),
6707
+ postBufferSec: number().min(0).optional()
6708
+ });
6709
+ var RecordingRuleSchema = object({
6710
+ schedule: RecordingScheduleSchema,
6711
+ mode: RecordingModeSchema,
6712
+ /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6713
+ preBufferSec: number().min(0).default(0),
6714
+ /** Keep recording until this many seconds after the last trigger. */
6715
+ postBufferSec: number().min(0).default(0),
6716
+ /** Each new trigger restarts the post-buffer window. */
6717
+ resetTimeoutOnNewEvent: boolean().default(true),
6718
+ /** onAudioThreshold only — dBFS level that counts as a trigger. */
6719
+ thresholdDbfs: number().optional()
6720
+ });
6721
+ /**
6722
+ * Per-device retention overrides. Every field is optional; an unset or `0`
6723
+ * value inherits the node-wide recorder default. Only footage-lifetime limits
6724
+ * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6725
+ * (when the volume is too full to keep recording) is NOT a per-camera concern —
6726
+ * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6727
+ * shared by every camera writing to that volume.
6728
+ */
6729
+ var RecordingRetentionSchema = object({
6730
+ maxAgeDays: number().min(0).optional(),
6731
+ maxSizeGb: number().min(0).optional()
6732
+ });
6733
+ /**
6734
+ * The full per-camera recording intent — the wire shape of a RecordingTarget.
6735
+ *
6736
+ * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6737
+ * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6738
+ * only for transition + migration (`migrateRulesToMode`); the policy engine
6739
+ * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6740
+ */
6741
+ var RecordingConfigSchema = object({
6742
+ enabled: boolean(),
6743
+ /** Authoritative storage mode. Absent on legacy targets → derived once via
6744
+ * `migrateRulesToMode`, then persisted. */
6745
+ mode: RecordingStorageModeSchema.optional(),
6746
+ profiles: array(CamProfileSchema).optional(),
6747
+ segmentSeconds: number().int().positive().optional(),
6748
+ /** Shared recording time-bands for `events` & `continuous` — record only when
6749
+ * the wall-clock falls inside one of these windows. Omit or empty = always.
6750
+ * `continuous` compiles to one rule per band; `events` to band × trigger. */
6751
+ schedules: array(RecordingScheduleSchema).optional(),
6752
+ /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
6753
+ * normalized into `schedules` on read and never written going forward. (Not
6754
+ * tagged `@deprecated`: the normalization paths must read it cast-free.) */
6755
+ schedule: RecordingScheduleSchema.optional(),
6756
+ /** `events`-mode only — which detectors trigger a recording. */
6757
+ triggers: RecordingTriggersSchema.optional(),
6758
+ /** `events`-mode only — seconds retained before / after a trigger. */
6759
+ preBufferSec: number().min(0).optional(),
6760
+ postBufferSec: number().min(0).optional(),
6761
+ /** DEPRECATED authoring input; retained for migration/transition. */
6762
+ rules: array(RecordingRuleSchema).optional(),
6763
+ /**
6764
+ * AUTHORITATIVE mode-per-band recording model (recorder). When present it
6765
+ * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
6766
+ * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
6767
+ * derived into bands once via `migrateConfigToBands`.
6768
+ */
6769
+ bands: array(RecordingBandSchema).optional(),
6770
+ retention: RecordingRetentionSchema.optional()
6771
+ });
6772
+ /**
6773
+ * `StorageLocationType` — an addon-declared id that identifies the *kind* of
6774
+ * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
6775
+ * so the persisted record schema and the consumer-facing cap can both consume it
6776
+ * without forming a circular import. The `storage` cap re-exports it
6777
+ * verbatim for back-compat.
6778
+ *
6779
+ * This Zod schema is the **authoritative source** for `StorageLocationType`.
6780
+ * The TS alias in `./storage.ts` re-exports `z.infer<typeof
6781
+ * StorageLocationTypeSchema>` so the wire surface (cap) and the legacy
6782
+ * `IStorageProvider` interface stay in lockstep.
6783
+ *
6784
+ * The type is now an **open string** (not a closed enum) — addons declare
6785
+ * their own location kinds via `StorageLocationDeclaration.id`. The regex
6786
+ * enforces a safe id format: lowercase-start, alphanumeric + hyphens.
6787
+ */
6788
+ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
6789
+ /**
6790
+ * Persisted record for a storage location instance. Operators can register
6791
+ * multiple instances for multi-cardinality types (e.g. two `backups`
6792
+ * locations with different `providerId`s). Cardinality is now declared per
6793
+ * location via `StorageLocationDeclaration.cardinality` — the static
6794
+ * `STORAGE_LOCATION_CARDINALITY` map has been removed.
6795
+ *
6796
+ * `id` is a stable namespaced string of the form `<type>:<slug>`.
6797
+ * The default location for a type uses `id === <type>:default` by
6798
+ * convention (the bare type ref like `'backups'` resolves to it).
6799
+ *
6800
+ * `isSystem: true` marks a location as orchestrator-seeded and
6801
+ * undeletable. The bootstrap-installed defaults (one per type) carry
6802
+ * this flag; operator-added locations don't. Editing the config of
6803
+ * a system location is allowed (path migration, provider swap) but
6804
+ * deleting it is rejected at the cap level.
6805
+ */
6806
+ var StorageLocationSchema = object({
6807
+ id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
6808
+ type: string(),
6809
+ displayName: string().min(1),
6810
+ providerId: string().min(1),
6811
+ config: record(string(), unknown()),
6812
+ /**
6813
+ * Cluster node this location physically lives on. REQUIRED for node-local
6814
+ * providers (filesystem — the path exists on one node's disk), null/absent
6815
+ * for node-agnostic providers (S3/SFTP/WebDAV, reachable from any node).
6816
+ * `'hub'` is the hub node. Validated against the provider's `nodeLocal`
6817
+ * flag at upsert time, not here (the schema is provider-agnostic).
6818
+ */
6819
+ nodeId: string().optional(),
6820
+ isDefault: boolean().default(false),
6821
+ isSystem: boolean().default(false),
6822
+ createdAt: number(),
6823
+ updatedAt: number()
6824
+ });
6825
+ /**
6826
+ * Reference accepted by consumer-facing `api.storage.*` calls.
6827
+ * Either:
6828
+ * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
6829
+ * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
6830
+ *
6831
+ * The orchestrator's `resolveRef(ref)` handles both cases.
6832
+ */
6833
+ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]);
6834
+ /**
6835
+ * `StorageLocationDeclaration` — a single storage-location entry declared by
6836
+ * an addon in its `package.json` under `camstack.storageLocations`.
6837
+ *
6838
+ * Design intent:
6839
+ * - **Addon declares its needs** — each addon describes the logical storage
6840
+ * slots it requires (e.g. `recordings`, `recordingsLow`) without caring
6841
+ * about the physical path.
6842
+ * - **Kernel aggregates** — at boot the kernel collects declarations from all
6843
+ * installed addons, deduplicates by `id`, and exposes the union via the
6844
+ * storage-locations settings surface.
6845
+ * - **Orchestrator seeds** — for every declared `id` the orchestrator ensures
6846
+ * at least one instance named `<id>:default` is present, using
6847
+ * `defaultsTo` to inherit the resolved root from another location when the
6848
+ * declaration is a derivative slot (e.g. `recordingsLow` defaults to
6849
+ * `recordings`).
6850
+ * - **ids are global** — `id` values are shared across the entire deployment;
6851
+ * two addons declaring the same `id` must agree on `cardinality` (validated
6852
+ * at kernel aggregation time, not here).
6853
+ */
6854
+ var StorageLocationDeclarationSchema = object({
6855
+ /**
6856
+ * Global location identifier, e.g. `recordings` or `recordingsLow`.
6857
+ * Must start with a lowercase letter and may contain letters, digits, and
6858
+ * hyphens.
6859
+ */
6860
+ id: string().regex(/^[a-z][a-zA-Z0-9-]*$/, { message: "id must start with a lowercase letter and contain only letters, digits, or hyphens" }),
6861
+ /** Human-readable name shown in the admin UI. */
6862
+ displayName: string().min(1, { message: "displayName must not be empty" }),
6863
+ /** Optional longer explanation of what data this location stores. */
6864
+ description: string().optional(),
6865
+ /**
6866
+ * `single` — exactly one instance of this location is allowed system-wide
6867
+ * (e.g. `logs`, `models`). The operator can edit it but not add more.
6868
+ * `multi` — the operator may register several instances (e.g. a second
6869
+ * `recordings` on a NAS for disk tiering); one is the default at any time.
6870
+ */
6871
+ cardinality: _enum(["single", "multi"]),
6872
+ /**
6873
+ * When set, the default instance for this location inherits its resolved
6874
+ * root from the named location's default instance. Useful for derivative
6875
+ * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
6876
+ * configure the primary location.
6877
+ */
6878
+ defaultsTo: string().optional()
6879
+ });
6880
+ var DecoderStatsSchema = object({
6881
+ inputFps: number(),
6882
+ outputFps: number(),
6883
+ avgDecodeTimeMs: number(),
6884
+ droppedFrames: number()
6885
+ });
6886
+ var DecoderSessionConfigSchema = object({
6887
+ codec: string(),
6888
+ maxFps: number().default(0),
6889
+ outputFormat: _enum([
6890
+ "jpeg",
6891
+ "rgb",
6892
+ "bgr",
6893
+ "yuv420",
6894
+ "gray"
6895
+ ]).default("jpeg"),
6896
+ scale: number().default(1),
6897
+ width: number().optional(),
6898
+ height: number().optional(),
6915
6899
  /**
6916
- * Device supports an on-demand re-sync of its derived spec with its
6917
- * upstream source drives the generic Re-sync button. The owning
6918
- * provider implements the action via the `device-adoption.resync` cap.
6900
+ * Identifier of the camera this decoder session serves. Optional
6901
+ * because the cap is generic (any caller could request decode), but
6902
+ * stream-broker passes it so decoder logs include `deviceId` for
6903
+ * per-camera filtering when diagnosing failures (e.g. node-av
6904
+ * sendPacket errors on a single hung camera).
6919
6905
  */
6920
- DeviceFeature["Resyncable"] = "resyncable";
6921
- DeviceFeature["NativeSnapshot"] = "native-snapshot";
6922
- DeviceFeature["DoorbellButton"] = "doorbell-button";
6923
- DeviceFeature["TwoWayAudio"] = "two-way-audio";
6924
- DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6906
+ deviceId: number().int().nonnegative().optional(),
6925
6907
  /**
6926
- * Camera supports the on-firmware autotrack subsystem (subject-
6927
- * following). Distinct from `PanTiltZoom` because not every PTZ
6928
- * camera ships autotrack the admin UI uses this flag to gate
6929
- * the autotrack toggle / settings card without re-deriving from
6930
- * the cap registry. Mirrors `ptz-autotrack` cap registration:
6931
- * driver sets this feature when probe confirms the firmware
6932
- * surface, and registers the cap in the same code path.
6908
+ * Free-form tag for log scoping. Stream-broker uses
6909
+ * `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
6910
+ * on every line so `grep tag=broker:5/high` filters one camera
6911
+ * profile cleanly.
6933
6912
  */
6934
- DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6913
+ tag: string().optional(),
6935
6914
  /**
6936
- * Accessory exposes a "trigger on motion" toggle the parent camera's
6937
- * motion detection automatically activates this device. Mirrors
6938
- * `motion-trigger` cap registration: drivers set this feature in the
6939
- * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6915
+ * Where the session delivers decoded frames (Phase 5 / D9):
6940
6916
  *
6941
- * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6942
- * fast scalar without binding fetch), notifier rules, and `listAll`
6943
- * filters that want "all devices with on-motion behaviour".
6917
+ * - `'callback'` (default) the legacy pixel path: decoded frames are
6918
+ * buffered as `DecodedFrame`s and drained via `pullFrames`.
6919
+ * - `'shm'` the shared-memory frame plane: decoded frames are written
6920
+ * into an OS shared-memory ring and drained as zero-pixel
6921
+ * `FrameHandle`s via `pullHandles`. A session is one mode or the
6922
+ * other — `pullFrames` returns nothing for an `'shm'` session and
6923
+ * `pullHandles` returns nothing for a `'callback'` session.
6944
6924
  */
6945
- DeviceFeature["MotionTrigger"] = "motion-trigger";
6946
- /** Light supports rgb-triplet color via `color` cap. */
6947
- DeviceFeature["LightColorRgb"] = "light-color-rgb";
6948
- /** Light supports HSV color via `color` cap. */
6949
- DeviceFeature["LightColorHsv"] = "light-color-hsv";
6950
- /** Light supports color-temperature (mired) via `color` cap. */
6951
- DeviceFeature["LightColorMired"] = "light-color-mired";
6952
- /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6953
- * targetHigh). Gates the range slider UI. */
6954
- DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6955
- /** Thermostat exposes target humidity and/or current humidity
6956
- * readings. Gates the humidity controls. */
6957
- DeviceFeature["ClimateHumidity"] = "climate-humidity";
6958
- /** Thermostat exposes a fan-mode selector. */
6959
- DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6960
- /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6961
- DeviceFeature["ClimatePreset"] = "climate-preset";
6962
- /** Cover exposes intermediate position control (0..100). Gates the
6963
- * position slider UI. */
6964
- DeviceFeature["CoverPositionable"] = "cover-positionable";
6965
- /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6966
- DeviceFeature["CoverTilt"] = "cover-tilt";
6967
- /** Valve exposes intermediate position control (0..100). Gates the
6968
- * position slider / drag surface UI. */
6969
- DeviceFeature["ValvePositionable"] = "valve-positionable";
6970
- /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6971
- DeviceFeature["FanSpeed"] = "fan-speed";
6972
- /** Fan exposes a preset mode selector. */
6973
- DeviceFeature["FanPreset"] = "fan-preset";
6974
- /** Fan exposes blade direction (forward/reverse) — typical of
6975
- * ceiling fans. */
6976
- DeviceFeature["FanDirection"] = "fan-direction";
6977
- /** Fan exposes an oscillation toggle. */
6978
- DeviceFeature["FanOscillating"] = "fan-oscillating";
6979
- /** Lock requires a PIN code on lock/unlock. Gates the code-entry
6980
- * field on the UI lock-controls panel. */
6981
- DeviceFeature["LockPinRequired"] = "lock-pin-required";
6982
- /** Lock supports a latch-release ("open door") action distinct from
6983
- * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
6984
- * `supported_features`. Gates the Open Door button in the UI. */
6985
- DeviceFeature["LockOpen"] = "lock-open";
6986
- /** Media player exposes a seek-to-position surface. */
6987
- DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
6988
- /** Media player exposes a volume-level setter. */
6989
- DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
6990
- /** Media player exposes a mute toggle distinct from volume=0. */
6991
- DeviceFeature["MediaPlayerMute"] = "media-player-mute";
6992
- /** Media player exposes a shuffle toggle. */
6993
- DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
6994
- /** Media player exposes a repeat mode (off / all / one). */
6995
- DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
6996
- /** Media player exposes a source / input selector. */
6997
- DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
6998
- /** Media player exposes a play-arbitrary-media surface (URL / id). */
6999
- DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
7000
- /** Media player exposes next-track. */
7001
- DeviceFeature["MediaPlayerNext"] = "media-player-next";
7002
- /** Media player exposes previous-track. */
7003
- DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
7004
- /** Media player exposes stop distinct from pause. */
7005
- DeviceFeature["MediaPlayerStop"] = "media-player-stop";
7006
- /** Alarm panel requires a PIN code on arm/disarm. */
7007
- DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
7008
- /** Presence device carries GPS coordinates (lat/lng/accuracy) in
7009
- * addition to a textual location. */
7010
- DeviceFeature["PresenceGps"] = "presence-gps";
7011
- /** Notifier accepts an inline / URL image attachment. */
7012
- DeviceFeature["NotifierImage"] = "notifier-image";
7013
- /** Notifier accepts a priority hint (high/normal/low). */
7014
- DeviceFeature["NotifierPriority"] = "notifier-priority";
7015
- /** Notifier accepts a free-form `data` payload for platform-specific
7016
- * fields. */
7017
- DeviceFeature["NotifierData"] = "notifier-data";
7018
- /** Notifier supports interactive action buttons / callbacks. */
7019
- DeviceFeature["NotifierActions"] = "notifier-actions";
7020
- /** Notifier supports per-call recipient targeting (multi-user). */
7021
- DeviceFeature["NotifierRecipients"] = "notifier-recipients";
7022
- /** Script runner accepts a variables map on each run invocation. */
7023
- DeviceFeature["ScriptVariables"] = "script-variables";
7024
- /** Automation `trigger` accepts a skipCondition flag — fires the
7025
- * automation's actions while bypassing its condition block. */
7026
- DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
7027
- return DeviceFeature;
7028
- }({});
7029
- /**
7030
- * Semantic role a device plays within its parent. Populated by driver
7031
- * addons when creating accessory devices (Reolink siren/floodlight/
7032
- * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
7033
- * admin UI to pick icons, labels, and widgets — a `Switch` with
7034
- * `role: Floodlight` renders as a bulb with a brightness slider,
7035
- * whereas a `Switch` with `role: Siren` renders as a klaxon.
7036
- *
7037
- * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
7038
- * sqlite as a nullable TEXT column — old rows keep working unchanged.
7039
- */
7040
- var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
7041
- DeviceRole["Siren"] = "siren";
7042
- DeviceRole["Floodlight"] = "floodlight";
7043
- DeviceRole["Spotlight"] = "spotlight";
7044
- DeviceRole["PirSensor"] = "pir-sensor";
7045
- DeviceRole["Chime"] = "chime";
7046
- DeviceRole["Autotrack"] = "autotrack";
7047
- DeviceRole["Nightvision"] = "nightvision";
7048
- DeviceRole["PrivacyMask"] = "privacy-mask";
7049
- DeviceRole["Doorbell"] = "doorbell";
7050
- /** Virtual HA toggle (input_boolean.*) — distinguishable from a
7051
- * real Switch device for UI rendering / export adapters. */
7052
- DeviceRole["BinaryHelper"] = "binary-helper";
7053
- /** Generic motion / occupancy / moving event source. Distinct from
7054
- * the camera accessory PirSensor role: that one is a camera child;
7055
- * this is a standalone HA / 3rd-party motion sensor. */
7056
- DeviceRole["MotionSensor"] = "motion-sensor";
7057
- DeviceRole["ContactSensor"] = "contact-sensor";
7058
- DeviceRole["LeakSensor"] = "leak-sensor";
7059
- DeviceRole["SmokeSensor"] = "smoke-sensor";
7060
- DeviceRole["COSensor"] = "co-sensor";
7061
- DeviceRole["GasSensor"] = "gas-sensor";
7062
- DeviceRole["TamperSensor"] = "tamper-sensor";
7063
- DeviceRole["VibrationSensor"] = "vibration-sensor";
7064
- DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
7065
- DeviceRole["SoundSensor"] = "sound-sensor";
7066
- /** Fallback for `binary_sensor` without a known `device_class`. */
7067
- DeviceRole["BinarySensor"] = "binary-sensor";
7068
- DeviceRole["TemperatureSensor"] = "temperature-sensor";
7069
- DeviceRole["HumiditySensor"] = "humidity-sensor";
7070
- DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
7071
- DeviceRole["PressureSensor"] = "pressure-sensor";
7072
- DeviceRole["PowerSensor"] = "power-sensor";
7073
- DeviceRole["EnergySensor"] = "energy-sensor";
7074
- DeviceRole["VoltageSensor"] = "voltage-sensor";
7075
- DeviceRole["CurrentSensor"] = "current-sensor";
7076
- DeviceRole["AirQualitySensor"] = "air-quality-sensor";
7077
- /** Battery level (numeric % via `sensor` OR low-bool via
7078
- * `binary_sensor` — the cap distinguishes via the value type). */
7079
- DeviceRole["BatterySensor"] = "battery-sensor";
7080
- /** Fallback for `sensor` numeric without a known `device_class`. */
7081
- DeviceRole["NumericSensor"] = "numeric-sensor";
7082
- /** String / enum state (HA `sensor` with `state_class: enum` or
7083
- * `attributes.options`). */
7084
- DeviceRole["EnumSensor"] = "enum-sensor";
7085
- /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
7086
- * or `date`). The slice carries the raw ISO string verbatim (hosted on
7087
- * the `enum-sensor` cap); the UI renders it locale-formatted. */
7088
- DeviceRole["DateTimeSensor"] = "datetime-sensor";
7089
- /** Last-resort fallback when nothing else matches. */
7090
- DeviceRole["GenericSensor"] = "generic-sensor";
7091
- DeviceRole["NumericControl"] = "numeric-control";
7092
- DeviceRole["SelectControl"] = "select-control";
7093
- DeviceRole["TextControl"] = "text-control";
7094
- DeviceRole["DateTimeControl"] = "datetime-control";
7095
- /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
7096
- * rich features (image, priority, channel routing). */
7097
- DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
7098
- /** Chat / messaging service (HA `notify.telegram_*`,
7099
- * `notify.discord_*`, etc.). */
7100
- DeviceRole["MessagingNotifier"] = "messaging-notifier";
7101
- /** Email-based delivery (HA `notify.smtp`, etc.). */
7102
- DeviceRole["EmailNotifier"] = "email-notifier";
7103
- /** Fallback when the notifier service name doesn't match a known
7104
- * pattern. */
7105
- DeviceRole["GenericNotifier"] = "generic-notifier";
7106
- return DeviceRole;
7107
- }({});
6925
+ frameSink: _enum(["callback", "shm"]).default("callback")
6926
+ });
6927
+ var EncodeProfileSchema = object({
6928
+ video: object({
6929
+ codec: _enum([
6930
+ "h264",
6931
+ "h265",
6932
+ "copy"
6933
+ ]),
6934
+ profile: _enum([
6935
+ "baseline",
6936
+ "main",
6937
+ "high"
6938
+ ]).optional(),
6939
+ width: number().int().positive().optional(),
6940
+ height: number().int().positive().optional(),
6941
+ fps: number().positive().optional(),
6942
+ bitrateKbps: number().int().positive().optional(),
6943
+ gopFrames: number().int().positive().optional(),
6944
+ bf: number().int().min(0).optional(),
6945
+ preset: _enum([
6946
+ "ultrafast",
6947
+ "superfast",
6948
+ "veryfast",
6949
+ "faster",
6950
+ "fast",
6951
+ "medium"
6952
+ ]).optional(),
6953
+ tune: _enum([
6954
+ "zerolatency",
6955
+ "film",
6956
+ "animation"
6957
+ ]).optional()
6958
+ }),
6959
+ audio: union([literal("passthrough"), object({
6960
+ codec: _enum([
6961
+ "opus",
6962
+ "aac",
6963
+ "pcmu",
6964
+ "pcma",
6965
+ "copy"
6966
+ ]),
6967
+ bitrateKbps: number().int().positive().optional(),
6968
+ sampleRateHz: number().int().positive().optional(),
6969
+ channels: union([literal(1), literal(2)]).optional()
6970
+ })]),
6971
+ /**
6972
+ * ffmpeg input-side args, inserted between the fixed global flags
6973
+ * (`-hide_banner -loglevel error`) and `-i pipe:0`. Free-text array
6974
+ * the widget surfaces a textarea + suggestion chips for the most-
6975
+ * used demuxer/format options.
6976
+ */
6977
+ inputArgs: array(string()).optional(),
6978
+ /**
6979
+ * ffmpeg output-side args, inserted between the encode block and
6980
+ * the final `-f <muxer> pipe:1`. Use for muxer options, bitstream
6981
+ * filters, codec-specific overrides. Free-text array.
6982
+ */
6983
+ outputArgs: array(string()).optional()
6984
+ });
6985
+ var YAMNET_TO_MACRO = {
6986
+ mapping: {
6987
+ Speech: "speech",
6988
+ "Child speech, kid speaking": "speech",
6989
+ Conversation: "speech",
6990
+ "Narration, monologue": "speech",
6991
+ Babbling: "speech",
6992
+ Whispering: "speech",
6993
+ "Speech synthesizer": "speech",
6994
+ Humming: "speech",
6995
+ Rapping: "speech",
6996
+ Singing: "speech",
6997
+ Choir: "speech",
6998
+ "Child singing": "speech",
6999
+ Shout: "scream",
7000
+ Bellow: "scream",
7001
+ Yell: "scream",
7002
+ Screaming: "scream",
7003
+ "Children shouting": "scream",
7004
+ Whoop: "scream",
7005
+ "Crying, sobbing": "crying",
7006
+ "Baby cry, infant cry": "crying",
7007
+ Whimper: "crying",
7008
+ "Wail, moan": "crying",
7009
+ Groan: "crying",
7010
+ Laughter: "laughter",
7011
+ "Baby laughter": "laughter",
7012
+ Giggle: "laughter",
7013
+ Snicker: "laughter",
7014
+ "Belly laugh": "laughter",
7015
+ "Chuckle, chortle": "laughter",
7016
+ Music: "music",
7017
+ "Musical instrument": "music",
7018
+ Guitar: "music",
7019
+ Piano: "music",
7020
+ Drum: "music",
7021
+ "Drum kit": "music",
7022
+ "Violin, fiddle": "music",
7023
+ Flute: "music",
7024
+ Saxophone: "music",
7025
+ Trumpet: "music",
7026
+ Synthesizer: "music",
7027
+ "Pop music": "music",
7028
+ "Rock music": "music",
7029
+ "Hip hop music": "music",
7030
+ "Classical music": "music",
7031
+ Jazz: "music",
7032
+ "Electronic music": "music",
7033
+ "Background music": "music",
7034
+ Dog: "dog",
7035
+ Bark: "dog",
7036
+ Yip: "dog",
7037
+ Howl: "dog",
7038
+ "Bow-wow": "dog",
7039
+ Growling: "dog",
7040
+ "Whimper (dog)": "dog",
7041
+ Cat: "cat",
7042
+ Purr: "cat",
7043
+ Meow: "cat",
7044
+ Hiss: "cat",
7045
+ Caterwaul: "cat",
7046
+ Bird: "bird",
7047
+ "Bird vocalization, bird call, bird song": "bird",
7048
+ "Chirp, tweet": "bird",
7049
+ Squawk: "bird",
7050
+ Crow: "bird",
7051
+ Owl: "bird",
7052
+ "Pigeon, dove": "bird",
7053
+ Animal: "animal",
7054
+ "Domestic animals, pets": "animal",
7055
+ "Livestock, farm animals, working animals": "animal",
7056
+ Horse: "animal",
7057
+ "Cattle, bovinae": "animal",
7058
+ Pig: "animal",
7059
+ Sheep: "animal",
7060
+ Goat: "animal",
7061
+ Frog: "animal",
7062
+ Insect: "animal",
7063
+ Cricket: "animal",
7064
+ Alarm: "alarm",
7065
+ "Alarm clock": "alarm",
7066
+ "Smoke detector, smoke alarm": "alarm",
7067
+ "Fire alarm": "alarm",
7068
+ Buzzer: "alarm",
7069
+ "Civil defense siren": "alarm",
7070
+ "Car alarm": "alarm",
7071
+ Siren: "siren",
7072
+ "Police car (siren)": "siren",
7073
+ "Ambulance (siren)": "siren",
7074
+ "Fire engine, fire truck (siren)": "siren",
7075
+ "Emergency vehicle": "siren",
7076
+ Foghorn: "siren",
7077
+ Doorbell: "doorbell",
7078
+ "Ding-dong": "doorbell",
7079
+ Knock: "doorbell",
7080
+ Tap: "doorbell",
7081
+ Glass: "glass_breaking",
7082
+ Shatter: "glass_breaking",
7083
+ "Chink, clink": "glass_breaking",
7084
+ "Gunshot, gunfire": "gunshot",
7085
+ "Machine gun": "gunshot",
7086
+ Explosion: "gunshot",
7087
+ Fireworks: "gunshot",
7088
+ Firecracker: "gunshot",
7089
+ "Artillery fire": "gunshot",
7090
+ "Cap gun": "gunshot",
7091
+ Boom: "gunshot",
7092
+ Vehicle: "vehicle",
7093
+ Car: "vehicle",
7094
+ Truck: "vehicle",
7095
+ Bus: "vehicle",
7096
+ Motorcycle: "vehicle",
7097
+ "Car passing by": "vehicle",
7098
+ "Vehicle horn, car horn, honking": "vehicle",
7099
+ "Traffic noise, roadway noise": "vehicle",
7100
+ Train: "vehicle",
7101
+ Aircraft: "vehicle",
7102
+ Helicopter: "vehicle",
7103
+ Bicycle: "vehicle",
7104
+ Skateboard: "vehicle",
7105
+ Fire: "fire",
7106
+ Crackle: "fire",
7107
+ Water: "water",
7108
+ Rain: "water",
7109
+ Raindrop: "water",
7110
+ "Rain on surface": "water",
7111
+ Stream: "water",
7112
+ Waterfall: "water",
7113
+ Ocean: "water",
7114
+ "Waves, surf": "water",
7115
+ "Splash, splatter": "water",
7116
+ Wind: "wind",
7117
+ Thunderstorm: "wind",
7118
+ Thunder: "wind",
7119
+ "Wind noise (microphone)": "wind",
7120
+ "Rustling leaves": "wind",
7121
+ Door: "door",
7122
+ "Sliding door": "door",
7123
+ Slam: "door",
7124
+ "Cupboard open or close": "door",
7125
+ "Walk, footsteps": "footsteps",
7126
+ Run: "footsteps",
7127
+ Shuffle: "footsteps",
7128
+ Crowd: "crowd",
7129
+ Chatter: "crowd",
7130
+ Cheering: "crowd",
7131
+ Applause: "crowd",
7132
+ "Children playing": "crowd",
7133
+ "Hubbub, speech noise, speech babble": "crowd",
7134
+ Telephone: "telephone",
7135
+ "Telephone bell ringing": "telephone",
7136
+ Ringtone: "telephone",
7137
+ "Telephone dialing, DTMF": "telephone",
7138
+ "Busy signal": "telephone",
7139
+ Engine: "engine",
7140
+ "Engine starting": "engine",
7141
+ Idling: "engine",
7142
+ "Accelerating, revving, vroom": "engine",
7143
+ "Light engine (high frequency)": "engine",
7144
+ "Medium engine (mid frequency)": "engine",
7145
+ "Heavy engine (low frequency)": "engine",
7146
+ "Lawn mower": "engine",
7147
+ Chainsaw: "engine",
7148
+ Hammer: "tools",
7149
+ Jackhammer: "tools",
7150
+ Sawing: "tools",
7151
+ "Power tool": "tools",
7152
+ Drill: "tools",
7153
+ Sanding: "tools",
7154
+ Silence: "silence"
7155
+ },
7156
+ preserveOriginal: false
7157
+ };
7158
+ var APPLE_SA_TO_MACRO = {
7159
+ mapping: {
7160
+ speech: "speech",
7161
+ child_speech: "speech",
7162
+ conversation: "speech",
7163
+ whispering: "speech",
7164
+ singing: "speech",
7165
+ humming: "speech",
7166
+ shout: "scream",
7167
+ yell: "scream",
7168
+ screaming: "scream",
7169
+ crying: "crying",
7170
+ baby_crying: "crying",
7171
+ sobbing: "crying",
7172
+ laughter: "laughter",
7173
+ baby_laughter: "laughter",
7174
+ giggling: "laughter",
7175
+ music: "music",
7176
+ guitar: "music",
7177
+ piano: "music",
7178
+ drums: "music",
7179
+ dog_bark: "dog",
7180
+ dog_bow_wow: "dog",
7181
+ dog_growling: "dog",
7182
+ dog_howl: "dog",
7183
+ cat_meow: "cat",
7184
+ cat_purr: "cat",
7185
+ cat_hiss: "cat",
7186
+ bird: "bird",
7187
+ bird_chirp: "bird",
7188
+ bird_squawk: "bird",
7189
+ animal: "animal",
7190
+ horse: "animal",
7191
+ cow_moo: "animal",
7192
+ insect: "animal",
7193
+ alarm: "alarm",
7194
+ smoke_alarm: "alarm",
7195
+ fire_alarm: "alarm",
7196
+ car_alarm: "alarm",
7197
+ siren: "siren",
7198
+ police_siren: "siren",
7199
+ ambulance_siren: "siren",
7200
+ doorbell: "doorbell",
7201
+ door_knock: "doorbell",
7202
+ knocking: "doorbell",
7203
+ glass_breaking: "glass_breaking",
7204
+ glass_shatter: "glass_breaking",
7205
+ gunshot: "gunshot",
7206
+ explosion: "gunshot",
7207
+ fireworks: "gunshot",
7208
+ car: "vehicle",
7209
+ truck: "vehicle",
7210
+ motorcycle: "vehicle",
7211
+ car_horn: "vehicle",
7212
+ vehicle_horn: "vehicle",
7213
+ traffic: "vehicle",
7214
+ fire: "fire",
7215
+ fire_crackle: "fire",
7216
+ water: "water",
7217
+ rain: "water",
7218
+ ocean: "water",
7219
+ splash: "water",
7220
+ wind: "wind",
7221
+ thunder: "wind",
7222
+ thunderstorm: "wind",
7223
+ door: "door",
7224
+ door_slam: "door",
7225
+ sliding_door: "door",
7226
+ footsteps: "footsteps",
7227
+ walking: "footsteps",
7228
+ running: "footsteps",
7229
+ crowd: "crowd",
7230
+ chatter: "crowd",
7231
+ cheering: "crowd",
7232
+ applause: "crowd",
7233
+ telephone_ring: "telephone",
7234
+ ringtone: "telephone",
7235
+ engine: "engine",
7236
+ engine_starting: "engine",
7237
+ lawn_mower: "engine",
7238
+ chainsaw: "engine",
7239
+ hammer: "tools",
7240
+ jackhammer: "tools",
7241
+ drill: "tools",
7242
+ power_tool: "tools",
7243
+ silence: "silence"
7244
+ },
7245
+ preserveOriginal: false
7246
+ };
7247
+ var _macroLookup = /* @__PURE__ */ new Map();
7248
+ for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7249
+ for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7108
7250
  /**
7109
7251
  * Accessory device helpers — shared across drivers.
7110
7252
  *
@@ -7264,74 +7406,6 @@ object({
7264
7406
  });
7265
7407
  DeviceType.Sensor;
7266
7408
  /**
7267
- * Generic types for capability definitions.
7268
- *
7269
- * A capability is defined with Zod schemas for methods, events, and settings.
7270
- * TypeScript types are inferred via z.infer<> — zero duplication.
7271
- *
7272
- * Pattern:
7273
- * 1. Define Zod schemas for data, methods, settings
7274
- * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
7275
- * 3. Export type IProvider = InferProvider<typeof capabilityDef>
7276
- * 4. Addon implements IProvider
7277
- * 5. Registry auto-mounts tRPC router from definition.methods
7278
- */
7279
- /**
7280
- * Output schema shared by the contribution + live methods.
7281
- *
7282
- * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
7283
- * tabs[]) without importing from `../interfaces/config-ui.js` — a
7284
- * concrete-but-lenient Zod object keeps tRPC output inference happy
7285
- * (using `z.unknown()` here collapses unrelated router branches to
7286
- * `unknown` when the generator re-inlines the huge AppRouter type).
7287
- *
7288
- * `.passthrough()` on sections/fields accepts whatever FormBuilder
7289
- * extensions the caller adds (showWhen, displayScale, …) without
7290
- * rebuilding every time a new field kind is introduced.
7291
- */
7292
- var ContributionSectionSchema = object({
7293
- id: string(),
7294
- title: string(),
7295
- description: string().optional(),
7296
- style: _enum(["card", "accordion"]).optional(),
7297
- defaultCollapsed: boolean().optional(),
7298
- columns: union([
7299
- literal(1),
7300
- literal(2),
7301
- literal(3),
7302
- literal(4)
7303
- ]).optional(),
7304
- tab: string().optional(),
7305
- location: _enum(["settings", "top-tab"]).optional(),
7306
- order: number().optional(),
7307
- fields: array(any())
7308
- });
7309
- object({
7310
- tabs: array(object({
7311
- id: string(),
7312
- label: string(),
7313
- icon: string(),
7314
- order: number().optional()
7315
- })).optional(),
7316
- sections: array(ContributionSectionSchema)
7317
- }).nullable();
7318
- object({ deviceId: number() }), object({ deviceId: number() }), object({
7319
- deviceId: number(),
7320
- patch: record(string(), unknown())
7321
- }), object({ success: literal(true) });
7322
- object({ deviceId: number() }), unknown().nullable();
7323
- /** Shorthand to define a method schema */
7324
- function method(input, output, options) {
7325
- return {
7326
- input,
7327
- output,
7328
- kind: options?.kind ?? "query",
7329
- auth: options?.auth ?? "protected",
7330
- ...options?.access !== void 0 ? { access: options.access } : {},
7331
- timeoutMs: options?.timeoutMs
7332
- };
7333
- }
7334
- /**
7335
7409
  * Alarm-panel cap. Models HA `alarm_control_panel.*` on
7336
7410
  * `DeviceType.AlarmPanel`. State follows HA's canonical lifecycle
7337
7411
  * across disarmed / armed_(home|away|night|vacation|custom_bypass) /
@@ -9146,6 +9220,24 @@ var DetectorOutputSchema = object({
9146
9220
  inferenceMs: number(),
9147
9221
  modelId: string()
9148
9222
  });
9223
+ var EngineProvisioningSchema = object({
9224
+ runtimeId: _enum([
9225
+ "onnx",
9226
+ "openvino",
9227
+ "coreml"
9228
+ ]).nullable(),
9229
+ device: string().nullable(),
9230
+ state: _enum([
9231
+ "idle",
9232
+ "installing",
9233
+ "verifying",
9234
+ "ready",
9235
+ "failed"
9236
+ ]),
9237
+ progress: number().optional(),
9238
+ error: string().optional(),
9239
+ nextRetryAt: number().optional()
9240
+ });
9149
9241
  var PipelineStepInputSchema = lazy(() => object({
9150
9242
  addonId: string(),
9151
9243
  modelId: string(),
@@ -9214,7 +9306,7 @@ var PipelineRunResultBridge = custom();
9214
9306
  method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(_void(), PipelineEngineChoiceSchema, {
9215
9307
  kind: "mutation",
9216
9308
  auth: "admin"
9217
- }), method(_void(), record(string(), object({
9309
+ }), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
9218
9310
  modelId: string(),
9219
9311
  settings: record(string(), unknown()).readonly()
9220
9312
  }))), method(object({ steps: record(string(), object({
@@ -11315,9 +11407,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
11315
11407
  limit: number().optional(),
11316
11408
  tags: record(string(), string()).optional()
11317
11409
  }), array(LogEntrySchema).readonly());
11318
- var StaticDirOutputSchema = object({ staticDir: string() });
11319
- var VersionOutputSchema = object({ version: string() });
11320
- method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
11321
11410
  /**
11322
11411
  * Zod schemas for persisted record types.
11323
11412
  *
@@ -12801,7 +12890,10 @@ var AgentAddonConfigSchema = object({
12801
12890
  modelId: string(),
12802
12891
  settings: record(string(), unknown()).readonly()
12803
12892
  });
12804
- var AgentPipelineSettingsSchema = object({ addonDefaults: record(string(), AgentAddonConfigSchema).readonly() });
12893
+ var AgentPipelineSettingsSchema = object({
12894
+ addonDefaults: record(string(), AgentAddonConfigSchema).readonly(),
12895
+ maxCameras: number().int().nonnegative().nullable().default(null)
12896
+ });
12805
12897
  var CameraPipelineForAgentSchema = object({
12806
12898
  steps: array(PipelineStepInputSchema).readonly(),
12807
12899
  audio: object({
@@ -12903,6 +12995,133 @@ var GlobalMetricsSchema = object({
12903
12995
  * capability providers.
12904
12996
  */
12905
12997
  var CapabilityBindingsSchema = record(string(), string());
12998
+ /** Source block — always present; derives from the stream catalog. */
12999
+ var CameraSourceStatusSchema = object({ streams: array(object({
13000
+ camStreamId: string(),
13001
+ codec: string(),
13002
+ width: number(),
13003
+ height: number(),
13004
+ fps: number(),
13005
+ kind: string()
13006
+ })).readonly() });
13007
+ /** Assignment block — always present (orchestrator-local, no remote call). */
13008
+ var CameraAssignmentStatusSchema = object({
13009
+ detectionNodeId: string().nullable(),
13010
+ decoderNodeId: string().nullable(),
13011
+ audioNodeId: string().nullable(),
13012
+ pinned: object({
13013
+ detection: boolean(),
13014
+ decoder: boolean(),
13015
+ audio: boolean()
13016
+ }),
13017
+ reasons: object({
13018
+ detection: string().optional(),
13019
+ decoder: string().optional(),
13020
+ audio: string().optional()
13021
+ })
13022
+ });
13023
+ /** Broker block — null when the broker stage is unreachable or inactive. */
13024
+ var CameraBrokerStatusSchema = object({
13025
+ profiles: array(object({
13026
+ profile: string(),
13027
+ status: string(),
13028
+ codec: string(),
13029
+ width: number(),
13030
+ height: number(),
13031
+ subscribers: number(),
13032
+ inFps: number(),
13033
+ outFps: number()
13034
+ })).readonly(),
13035
+ webrtcSessions: number(),
13036
+ rtspRestream: boolean()
13037
+ });
13038
+ /** Shared-memory ring statistics within the decoder block. */
13039
+ var CameraDecoderShmSchema = object({
13040
+ framesWritten: number(),
13041
+ getFrameHits: number(),
13042
+ getFrameMisses: number(),
13043
+ budgetMb: number()
13044
+ });
13045
+ /** Decoder block — null when the decoder stage is unreachable or inactive. */
13046
+ var CameraDecoderStatusSchema = object({
13047
+ nodeId: string(),
13048
+ formats: array(string()).readonly(),
13049
+ sessionCount: number(),
13050
+ shm: CameraDecoderShmSchema
13051
+ });
13052
+ /** Motion block — null when motion detection is not active for this device. */
13053
+ var CameraMotionStatusSchema = object({
13054
+ enabled: boolean(),
13055
+ fps: number()
13056
+ });
13057
+ /** Detection provisioning sub-block. */
13058
+ var CameraDetectionProvisioningSchema = object({
13059
+ state: _enum([
13060
+ "idle",
13061
+ "installing",
13062
+ "verifying",
13063
+ "ready",
13064
+ "failed"
13065
+ ]),
13066
+ error: string().optional()
13067
+ });
13068
+ /** Detection phase — derived from the runner's engine phase. */
13069
+ var CameraDetectionPhaseSchema = _enum([
13070
+ "idle",
13071
+ "watching",
13072
+ "active"
13073
+ ]);
13074
+ /** Detection block — null when no detection node is assigned or reachable. */
13075
+ var CameraDetectionStatusSchema = object({
13076
+ nodeId: string(),
13077
+ engine: object({
13078
+ backend: string(),
13079
+ device: string()
13080
+ }),
13081
+ phase: CameraDetectionPhaseSchema,
13082
+ configuredFps: number(),
13083
+ actualFps: number(),
13084
+ queueDepth: number(),
13085
+ avgInferenceMs: number(),
13086
+ provisioning: CameraDetectionProvisioningSchema
13087
+ });
13088
+ /** Audio block — null when no audio node is assigned or reachable. */
13089
+ var CameraAudioStatusSchema = object({
13090
+ nodeId: string(),
13091
+ enabled: boolean()
13092
+ });
13093
+ /** Recording block — null when no recording cap is active for this device. */
13094
+ var CameraRecordingStatusSchema = object({
13095
+ mode: _enum([
13096
+ "off",
13097
+ "continuous",
13098
+ "events"
13099
+ ]),
13100
+ active: boolean(),
13101
+ storageBytes: number()
13102
+ });
13103
+ /**
13104
+ * Aggregated per-camera pipeline status — server-composed, single call.
13105
+ *
13106
+ * The `assignment` and `source` blocks are always present.
13107
+ * Every other block is `null` when the stage is inactive or unreachable
13108
+ * during the bounded parallel fan-out in the orchestrator implementation.
13109
+ *
13110
+ * See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
13111
+ */
13112
+ var CameraStatusSchema = object({
13113
+ deviceId: number(),
13114
+ assignment: CameraAssignmentStatusSchema,
13115
+ source: CameraSourceStatusSchema,
13116
+ broker: CameraBrokerStatusSchema.nullable(),
13117
+ decoder: CameraDecoderStatusSchema.nullable(),
13118
+ motion: CameraMotionStatusSchema.nullable(),
13119
+ detection: CameraDetectionStatusSchema.nullable(),
13120
+ audio: CameraAudioStatusSchema.nullable(),
13121
+ recording: CameraRecordingStatusSchema.nullable(),
13122
+ /** Unix timestamp (ms) when this snapshot was composed server-side. */
13123
+ fetchedAt: number()
13124
+ });
12906
13125
  method(object({
12907
13126
  deviceId: number(),
12908
13127
  agentNodeId: string()
@@ -12970,6 +13189,12 @@ method(object({
12970
13189
  }), {
12971
13190
  kind: "mutation",
12972
13191
  auth: "admin"
13192
+ }), method(object({
13193
+ agentNodeId: string(),
13194
+ maxCameras: number().int().nonnegative().nullable()
13195
+ }), object({ success: literal(true) }), {
13196
+ kind: "mutation",
13197
+ auth: "admin"
12973
13198
  }), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
12974
13199
  deviceId: number(),
12975
13200
  addonId: string(),
@@ -12995,7 +13220,7 @@ method(object({
12995
13220
  }), method(object({
12996
13221
  deviceId: number(),
12997
13222
  agentNodeId: string().optional()
12998
- }), CameraPipelineConfigSchema), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
13223
+ }), CameraPipelineConfigSchema), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
12999
13224
  name: string(),
13000
13225
  description: string().optional(),
13001
13226
  config: CameraPipelineConfigSchema
@@ -13482,7 +13707,7 @@ method(object({
13482
13707
  }), _void(), {
13483
13708
  kind: "mutation",
13484
13709
  auth: "admin"
13485
- }), 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({
13710
+ }), 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({
13486
13711
  deviceId: number(),
13487
13712
  values: record(string(), unknown())
13488
13713
  }), object({ success: literal(true) }), {
@@ -14187,7 +14412,20 @@ var DiskSpaceInfoSchema = object({
14187
14412
  var PidResourceStatsSchema = object({
14188
14413
  pid: number(),
14189
14414
  cpu: number(),
14190
- memory: number()
14415
+ memory: number(),
14416
+ /**
14417
+ * Private (anonymous) resident bytes — the per-process V8 heap + native
14418
+ * allocations NOT shared with other processes (Linux RssAnon). This is the
14419
+ * "real" per-runner cost; summing it across runners is meaningful, unlike
14420
+ * `memory` (RSS), which double-counts the shared mmap'd framework code.
14421
+ * Undefined where /proc is unavailable (e.g. macOS).
14422
+ */
14423
+ privateBytes: number().optional(),
14424
+ /**
14425
+ * Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
14426
+ * code shared copy-on-write across runners. Undefined on macOS.
14427
+ */
14428
+ sharedBytes: number().optional()
14191
14429
  });
14192
14430
  var AddonInstanceSchema = object({
14193
14431
  addonId: string(),
@@ -14236,6 +14474,17 @@ var KillProcessResultSchema = object({
14236
14474
  reason: string().optional(),
14237
14475
  signal: _enum(["SIGTERM", "SIGKILL"]).optional()
14238
14476
  });
14477
+ var DumpHeapSnapshotInputSchema = object({
14478
+ /** The addon whose runner should dump a heap snapshot. */
14479
+ addonId: string() });
14480
+ var DumpHeapSnapshotResultSchema = object({
14481
+ success: boolean(),
14482
+ /** Path of the written .heapsnapshot inside the runner's container/host. */
14483
+ path: string().optional(),
14484
+ /** Process pid that was signalled. */
14485
+ pid: number().optional(),
14486
+ reason: string().optional()
14487
+ });
14239
14488
  var SystemMetricsSchema = object({
14240
14489
  cpuPercent: number(),
14241
14490
  memoryPercent: number(),
@@ -14249,6 +14498,9 @@ var SystemMetricsSchema = object({
14249
14498
  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, {
14250
14499
  kind: "mutation",
14251
14500
  auth: "admin"
14501
+ }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
14502
+ kind: "mutation",
14503
+ auth: "admin"
14252
14504
  });
14253
14505
  var PtzPresetSchema = object({
14254
14506
  id: string(),
@@ -14615,63 +14867,6 @@ method(object({
14615
14867
  auth: "admin"
14616
14868
  });
14617
14869
  /**
14618
- * device-ops — device-scoped cap that unifies the per-IDevice operations
14619
- * previously routed through the `.device-ops` Moleculer bridge service.
14620
- *
14621
- * Each worker that hosts live `IDevice` instances auto-registers a native
14622
- * provider for this cap (per device) backed by its local
14623
- * `DeviceRegistry`. Hub-side callers reach it transparently through
14624
- * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
14625
- * `deviceId` + `nodeId` and dispatches through the standard cap-router,
14626
- * so there's no parallel bridge path anymore.
14627
- *
14628
- * The surface is intentionally small — every method corresponds to a
14629
- * single action on the live `IDevice` (or `ICameraDevice` for
14630
- * `getStreamSources`). Richer orchestration (enable/disable with
14631
- * integration plumbing, bulk updates) stays in the `device-manager` cap;
14632
- * `device-ops` is the per-device primitive the device-manager routes to.
14633
- */
14634
- var StreamSourceEntrySchema$1 = object({
14635
- id: string(),
14636
- label: string(),
14637
- protocol: _enum([
14638
- "rtsp",
14639
- "rtmp",
14640
- "annexb",
14641
- "http-mjpeg",
14642
- "webrtc",
14643
- "custom"
14644
- ]),
14645
- url: string().optional(),
14646
- resolution: object({
14647
- width: number(),
14648
- height: number()
14649
- }).optional(),
14650
- fps: number().optional(),
14651
- bitrate: number().optional(),
14652
- codec: string().optional(),
14653
- profileHint: CamProfileSchema.optional(),
14654
- sdp: string().optional()
14655
- });
14656
- var ConfigEntrySchema$1 = object({
14657
- key: string(),
14658
- value: unknown()
14659
- });
14660
- var RawStateResultSchema = object({
14661
- /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
14662
- source: string(),
14663
- /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
14664
- data: record(string(), unknown())
14665
- });
14666
- method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
14667
- deviceId: number(),
14668
- values: record(string(), unknown())
14669
- }), _void(), { kind: "mutation" }), method(object({
14670
- deviceId: number(),
14671
- action: string().min(1),
14672
- input: unknown()
14673
- }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
14674
- /**
14675
14870
  * camera-credentials — device-scoped cap exposing the camera's network
14676
14871
  * + auth surface in a vendor-neutral shape.
14677
14872
  *
@@ -18354,6 +18549,12 @@ Object.freeze({
18354
18549
  addonId: null,
18355
18550
  access: "view"
18356
18551
  },
18552
+ "metricsProvider.dumpHeapSnapshot": {
18553
+ capName: "metrics-provider",
18554
+ capScope: "system",
18555
+ addonId: null,
18556
+ access: "create"
18557
+ },
18357
18558
  "metricsProvider.getAddonStats": {
18358
18559
  capName: "metrics-provider",
18359
18560
  capScope: "system",
@@ -18810,6 +19011,12 @@ Object.freeze({
18810
19011
  addonId: null,
18811
19012
  access: "view"
18812
19013
  },
19014
+ "pipelineExecutor.getEngineProvisioning": {
19015
+ capName: "pipeline-executor",
19016
+ capScope: "system",
19017
+ addonId: null,
19018
+ access: "view"
19019
+ },
18813
19020
  "pipelineExecutor.getGlobalPipelineConfig": {
18814
19021
  capName: "pipeline-executor",
18815
19022
  capScope: "system",
@@ -19014,6 +19221,18 @@ Object.freeze({
19014
19221
  addonId: null,
19015
19222
  access: "view"
19016
19223
  },
19224
+ "pipelineOrchestrator.getCameraStatus": {
19225
+ capName: "pipeline-orchestrator",
19226
+ capScope: "system",
19227
+ addonId: null,
19228
+ access: "view"
19229
+ },
19230
+ "pipelineOrchestrator.getCameraStatuses": {
19231
+ capName: "pipeline-orchestrator",
19232
+ capScope: "system",
19233
+ addonId: null,
19234
+ access: "view"
19235
+ },
19017
19236
  "pipelineOrchestrator.getCameraStepOverrides": {
19018
19237
  capName: "pipeline-orchestrator",
19019
19238
  capScope: "system",
@@ -19098,6 +19317,12 @@ Object.freeze({
19098
19317
  addonId: null,
19099
19318
  access: "create"
19100
19319
  },
19320
+ "pipelineOrchestrator.setAgentMaxCameras": {
19321
+ capName: "pipeline-orchestrator",
19322
+ capScope: "system",
19323
+ addonId: null,
19324
+ access: "create"
19325
+ },
19101
19326
  "pipelineOrchestrator.setCameraPipelineForAgent": {
19102
19327
  capName: "pipeline-orchestrator",
19103
19328
  capScope: "system",