@camstack/addon-provider-homeassistant 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.
Files changed (3) hide show
  1. package/dist/addon.js +1305 -1078
  2. package/dist/addon.mjs +1305 -1078
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -4629,63 +4629,7 @@ function _instanceof(cls, params = {}) {
4629
4629
  return inst;
4630
4630
  }
4631
4631
  //#endregion
4632
- //#region ../types/dist/index.mjs
4633
- /**
4634
- * Deep wiring healthcheck — snapshot of active reachability probes across
4635
- * every declared capability + widget of every installed plugin, on every
4636
- * node. Produced by the backend `WiringHealthService` and surfaced via
4637
- * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
4638
- *
4639
- * Unlike `/health` (process liveness), this reflects whether each cap/widget
4640
- * is actually *reachable* over the real cap-dispatch path. See spec
4641
- * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
4642
- */
4643
- /** What kind of target a probe addressed. */
4644
- var wiringProbeKindSchema = _enum([
4645
- "singleton",
4646
- "device",
4647
- "widget"
4648
- ]);
4649
- /** Result of probing a single (cap|widget [, device]) target. */
4650
- var wiringProbeResultSchema = object({
4651
- capName: string(),
4652
- kind: wiringProbeKindSchema,
4653
- deviceId: number().optional(),
4654
- reachable: boolean(),
4655
- latencyMs: number(),
4656
- error: string().optional()
4657
- });
4658
- /** Per-addon roll-up of cap + widget probe results. */
4659
- var wiringAddonHealthSchema = object({
4660
- addonId: string(),
4661
- caps: array(wiringProbeResultSchema).readonly(),
4662
- widgets: array(wiringProbeResultSchema).readonly()
4663
- });
4664
- /** Per-node roll-up. */
4665
- var wiringNodeHealthSchema = object({
4666
- nodeId: string(),
4667
- addons: array(wiringAddonHealthSchema).readonly()
4668
- });
4669
- object({
4670
- /** True only when every probed target is reachable. */
4671
- ok: boolean(),
4672
- /** True when at least one target is unreachable. */
4673
- degraded: boolean(),
4674
- checkedAt: string(),
4675
- nodes: array(wiringNodeHealthSchema).readonly(),
4676
- summary: object({
4677
- total: number(),
4678
- reachable: number(),
4679
- unreachable: number()
4680
- })
4681
- });
4682
- var MODEL_FORMATS = [
4683
- "onnx",
4684
- "coreml",
4685
- "openvino",
4686
- "tflite",
4687
- "pt"
4688
- ];
4632
+ //#region ../types/dist/sleep-D7JeS58T.mjs
4689
4633
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4690
4634
  EventCategory["SystemBoot"] = "system.boot";
4691
4635
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -4983,6 +4927,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
4983
4927
  */
4984
4928
  EventCategory["PipelineEngineMetricsSnapshot"] = "pipeline.engine-metrics-snapshot";
4985
4929
  /**
4930
+ * Per-node detection-engine runtime-provisioning transition. Emitted by
4931
+ * the detection-pipeline provider on every state change of its lazy
4932
+ * engine-provisioning machine (idle → installing → verifying → ready,
4933
+ * or → failed with a `nextRetryAt`). Payload is the
4934
+ * `EngineProvisioningState` snapshot; `event.source.nodeId` carries the
4935
+ * node. The Pipeline page subscribes to drive a live "installing
4936
+ * OpenVINO… / ready" indicator per node without polling
4937
+ * `pipelineExecutor.getEngineProvisioning`. Telemetry-grade (D8): the UI
4938
+ * also reads the cap snapshot on mount / reconnect. Phase 2.
4939
+ */
4940
+ EventCategory["PipelineEngineProvisioning"] = "pipeline.engine-provisioning";
4941
+ /**
4986
4942
  * Cluster topology snapshot. Carries the same payload returned by
4987
4943
  * `nodes.topology` (every reachable node + addons + processes).
4988
4944
  * Emitted by the hub on any agent / addon lifecycle change
@@ -5996,7 +5952,7 @@ var ProfileSlotSchema = object({
5996
5952
  * Zod schema for StreamSourceEntry — the canonical stream descriptor
5997
5953
  * exposed by ICameraDevice.getStreamSources() and consumed by the broker.
5998
5954
  */
5999
- var StreamSourceEntrySchema = object({
5955
+ var StreamSourceEntrySchema$1 = object({
6000
5956
  id: string(),
6001
5957
  label: string(),
6002
5958
  protocol: _enum([
@@ -6218,904 +6174,1096 @@ var ProfileRtspEntrySchema = object({
6218
6174
  codec: string().optional(),
6219
6175
  resolution: CamStreamResolutionSchema.optional()
6220
6176
  });
6221
- /**
6222
- * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6223
- * Named `RecordingWeekday` to avoid collision with the string-union
6224
- * `Weekday` exported from `interfaces/timezones.ts`.
6225
- */
6226
- var RecordingWeekdaySchema = number().int().min(0).max(6);
6227
- var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6228
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6229
- kind: literal("timeOfDay"),
6230
- start: string().regex(HHMM),
6231
- end: string().regex(HHMM),
6232
- /** Restrict to these weekdays; omit = every day. */
6233
- days: array(RecordingWeekdaySchema).optional()
6234
- })]);
6235
- var RecordingModeSchema = _enum([
6236
- "continuous",
6237
- "onMotion",
6238
- "onAudioThreshold"
6239
- ]);
6240
- /**
6241
- * First-class, authoritative per-camera storage mode the netta choice the UI
6242
- * reads directly (never inferred from `rules`):
6243
- * - `off` not recording.
6244
- * - `events` — record only around triggers (motion / audio threshold),
6245
- * with pre/post-buffer.
6246
- * - `continuous` record 24/7 within the schedule.
6247
- *
6248
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6249
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6250
- */
6251
- var RecordingStorageModeSchema = _enum([
6252
- "off",
6253
- "events",
6254
- "continuous"
6255
- ]);
6256
- /** Which detectors trigger an `events`-mode recording. */
6257
- var RecordingTriggersSchema = object({
6258
- motion: boolean().optional(),
6259
- audioThresholdDbfs: number().optional()
6260
- });
6261
- /**
6262
- * Mode of a single recording band the recorder per-band vocabulary.
6263
- *
6264
- * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6265
- * only ever `continuous` or `events`; "off" is expressed by the absence of a
6266
- * covering band, not by a band value.
6267
- */
6268
- var RecordingBandModeSchema = _enum(["continuous", "events"]);
6269
- /**
6270
- * Triggers for an `events`-mode band. Identical shape to
6271
- * `RecordingTriggersSchema`reuse that schema as the band trigger type so the
6272
- * two never drift.
6273
- */
6274
- var RecordingBandTriggersSchema = RecordingTriggersSchema;
6275
- /**
6276
- * A single mode-per-band window the canonical recorder band shape, the
6277
- * single source of truth re-used by `addon-pipeline/recorder`.
6278
- *
6279
- * `days` lists the weekdays the band covers (empty = every day, matching the
6280
- * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6281
- * span wraps past midnight (handled by the band engine).
6282
- */
6283
- var RecordingBandSchema = object({
6284
- days: array(RecordingWeekdaySchema),
6285
- start: string().regex(HHMM),
6286
- end: string().regex(HHMM),
6287
- mode: RecordingBandModeSchema,
6288
- triggers: RecordingBandTriggersSchema.optional(),
6289
- preBufferSec: number().min(0).optional(),
6290
- postBufferSec: number().min(0).optional()
6291
- });
6292
- var RecordingRuleSchema = object({
6293
- schedule: RecordingScheduleSchema,
6294
- mode: RecordingModeSchema,
6295
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6296
- preBufferSec: number().min(0).default(0),
6297
- /** Keep recording until this many seconds after the last trigger. */
6298
- postBufferSec: number().min(0).default(0),
6299
- /** Each new trigger restarts the post-buffer window. */
6300
- resetTimeoutOnNewEvent: boolean().default(true),
6301
- /** onAudioThreshold only dBFS level that counts as a trigger. */
6302
- thresholdDbfs: number().optional()
6303
- });
6304
- /**
6305
- * Per-device retention overrides. Every field is optional; an unset or `0`
6306
- * value inherits the node-wide recorder default. Only footage-lifetime limits
6307
- * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6308
- * (when the volume is too full to keep recording) is NOT a per-camera concern —
6309
- * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6310
- * shared by every camera writing to that volume.
6311
- */
6312
- var RecordingRetentionSchema = object({
6313
- maxAgeDays: number().min(0).optional(),
6314
- maxSizeGb: number().min(0).optional()
6315
- });
6316
- /**
6317
- * The full per-camera recording intent — the wire shape of a RecordingTarget.
6318
- *
6319
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6320
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6321
- * only for transition + migration (`migrateRulesToMode`); the policy engine
6322
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6323
- */
6324
- var RecordingConfigSchema = object({
6325
- enabled: boolean(),
6326
- /** Authoritative storage mode. Absent on legacy targets → derived once via
6327
- * `migrateRulesToMode`, then persisted. */
6328
- mode: RecordingStorageModeSchema.optional(),
6329
- profiles: array(CamProfileSchema).optional(),
6330
- segmentSeconds: number().int().positive().optional(),
6331
- /** Shared recording time-bands for `events` & `continuous` — record only when
6332
- * the wall-clock falls inside one of these windows. Omit or empty = always.
6333
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
6334
- schedules: array(RecordingScheduleSchema).optional(),
6335
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
6336
- * normalized into `schedules` on read and never written going forward. (Not
6337
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
6338
- schedule: RecordingScheduleSchema.optional(),
6339
- /** `events`-mode only — which detectors trigger a recording. */
6340
- triggers: RecordingTriggersSchema.optional(),
6341
- /** `events`-mode only — seconds retained before / after a trigger. */
6342
- preBufferSec: number().min(0).optional(),
6343
- postBufferSec: number().min(0).optional(),
6344
- /** DEPRECATED authoring input; retained for migration/transition. */
6345
- rules: array(RecordingRuleSchema).optional(),
6346
- /**
6347
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
6348
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
6349
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
6350
- * derived into bands once via `migrateConfigToBands`.
6351
- */
6352
- bands: array(RecordingBandSchema).optional(),
6353
- retention: RecordingRetentionSchema.optional()
6354
- });
6355
- /**
6356
- * `StorageLocationType` — an addon-declared id that identifies the *kind* of
6357
- * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
6358
- * so the persisted record schema and the consumer-facing cap can both consume it
6359
- * without forming a circular import. The `storage` cap re-exports it
6360
- * verbatim for back-compat.
6361
- *
6362
- * This Zod schema is the **authoritative source** for `StorageLocationType`.
6363
- * The TS alias in `./storage.ts` re-exports `z.infer<typeof
6364
- * StorageLocationTypeSchema>` so the wire surface (cap) and the legacy
6365
- * `IStorageProvider` interface stay in lockstep.
6366
- *
6367
- * The type is now an **open string** (not a closed enum) — addons declare
6368
- * their own location kinds via `StorageLocationDeclaration.id`. The regex
6369
- * enforces a safe id format: lowercase-start, alphanumeric + hyphens.
6370
- */
6371
- var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
6372
- /**
6373
- * Persisted record for a storage location instance. Operators can register
6374
- * multiple instances for multi-cardinality types (e.g. two `backups`
6375
- * locations with different `providerId`s). Cardinality is now declared per
6376
- * location via `StorageLocationDeclaration.cardinality` — the static
6377
- * `STORAGE_LOCATION_CARDINALITY` map has been removed.
6378
- *
6379
- * `id` is a stable namespaced string of the form `<type>:<slug>`.
6380
- * The default location for a type uses `id === <type>:default` by
6381
- * convention (the bare type ref like `'backups'` resolves to it).
6382
- *
6383
- * `isSystem: true` marks a location as orchestrator-seeded and
6384
- * undeletable. The bootstrap-installed defaults (one per type) carry
6385
- * this flag; operator-added locations don't. Editing the config of
6386
- * a system location is allowed (path migration, provider swap) but
6387
- * deleting it is rejected at the cap level.
6388
- */
6389
- var StorageLocationSchema = object({
6390
- id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
6391
- type: string(),
6392
- displayName: string().min(1),
6393
- providerId: string().min(1),
6394
- config: record(string(), unknown()),
6395
- /**
6396
- * Cluster node this location physically lives on. REQUIRED for node-local
6397
- * providers (filesystem — the path exists on one node's disk), null/absent
6398
- * for node-agnostic providers (S3/SFTP/WebDAV, reachable from any node).
6399
- * `'hub'` is the hub node. Validated against the provider's `nodeLocal`
6400
- * flag at upsert time, not here (the schema is provider-agnostic).
6401
- */
6402
- nodeId: string().optional(),
6403
- isDefault: boolean().default(false),
6404
- isSystem: boolean().default(false),
6405
- createdAt: number(),
6406
- updatedAt: number()
6407
- });
6408
- /**
6409
- * Reference accepted by consumer-facing `api.storage.*` calls.
6410
- * Either:
6411
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
6412
- * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
6413
- *
6414
- * The orchestrator's `resolveRef(ref)` handles both cases.
6415
- */
6416
- var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]);
6417
- /**
6418
- * `StorageLocationDeclaration` — a single storage-location entry declared by
6419
- * an addon in its `package.json` under `camstack.storageLocations`.
6420
- *
6421
- * Design intent:
6422
- * - **Addon declares its needs** — each addon describes the logical storage
6423
- * slots it requires (e.g. `recordings`, `recordingsLow`) without caring
6424
- * about the physical path.
6425
- * - **Kernel aggregates** — at boot the kernel collects declarations from all
6426
- * installed addons, deduplicates by `id`, and exposes the union via the
6427
- * storage-locations settings surface.
6428
- * - **Orchestrator seeds** — for every declared `id` the orchestrator ensures
6429
- * at least one instance named `<id>:default` is present, using
6430
- * `defaultsTo` to inherit the resolved root from another location when the
6431
- * declaration is a derivative slot (e.g. `recordingsLow` defaults to
6432
- * `recordings`).
6433
- * - **ids are global** — `id` values are shared across the entire deployment;
6434
- * two addons declaring the same `id` must agree on `cardinality` (validated
6435
- * at kernel aggregation time, not here).
6436
- */
6437
- var StorageLocationDeclarationSchema = object({
6438
- /**
6439
- * Global location identifier, e.g. `recordings` or `recordingsLow`.
6440
- * Must start with a lowercase letter and may contain letters, digits, and
6441
- * hyphens.
6442
- */
6443
- id: string().regex(/^[a-z][a-zA-Z0-9-]*$/, { message: "id must start with a lowercase letter and contain only letters, digits, or hyphens" }),
6444
- /** Human-readable name shown in the admin UI. */
6445
- displayName: string().min(1, { message: "displayName must not be empty" }),
6446
- /** Optional longer explanation of what data this location stores. */
6447
- description: string().optional(),
6448
- /**
6449
- * `single` — exactly one instance of this location is allowed system-wide
6450
- * (e.g. `logs`, `models`). The operator can edit it but not add more.
6451
- * `multi` — the operator may register several instances (e.g. a second
6452
- * `recordings` on a NAS for disk tiering); one is the default at any time.
6453
- */
6454
- cardinality: _enum(["single", "multi"]),
6455
- /**
6456
- * When set, the default instance for this location inherits its resolved
6457
- * root from the named location's default instance. Useful for derivative
6458
- * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
6459
- * configure the primary location.
6460
- */
6461
- defaultsTo: string().optional()
6462
- });
6463
- var DecoderStatsSchema = object({
6464
- inputFps: number(),
6465
- outputFps: number(),
6466
- avgDecodeTimeMs: number(),
6467
- droppedFrames: number()
6468
- });
6469
- var DecoderSessionConfigSchema = object({
6470
- codec: string(),
6471
- maxFps: number().default(0),
6472
- outputFormat: _enum([
6473
- "jpeg",
6474
- "rgb",
6475
- "bgr",
6476
- "yuv420",
6477
- "gray"
6478
- ]).default("jpeg"),
6479
- scale: number().default(1),
6480
- width: number().optional(),
6481
- height: number().optional(),
6177
+ var DeviceType = /* @__PURE__ */ function(DeviceType) {
6178
+ DeviceType["Camera"] = "camera";
6179
+ DeviceType["Hub"] = "hub";
6180
+ DeviceType["Light"] = "light";
6181
+ DeviceType["Siren"] = "siren";
6182
+ DeviceType["Switch"] = "switch";
6183
+ DeviceType["Sensor"] = "sensor";
6184
+ DeviceType["Thermostat"] = "thermostat";
6185
+ DeviceType["Button"] = "button";
6186
+ /** Generic stateless event emitter — carries a device's EXACT declared
6187
+ * event vocabulary verbatim (no normalization). Installed with the
6188
+ * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6189
+ * HA bus events (e.g. `zha_event`, generic). */
6190
+ DeviceType["EventEmitter"] = "event-emitter";
6191
+ /** Firmware/software update entity — current vs available version,
6192
+ * updatable flag, update state, and an install action. Installed with
6193
+ * the `update` cap. Sources: Homematic firmware-update channels (and
6194
+ * reusable by other providers, e.g. HA `update.*` entities). */
6195
+ DeviceType["Update"] = "update";
6196
+ DeviceType["Generic"] = "generic";
6197
+ /** Generic notification delivery target (HA `notify.<service>`, future
6198
+ * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6199
+ * endpoint; the `notifier` cap defines the send surface. */
6200
+ DeviceType["Notifier"] = "notifier";
6201
+ /** Pre-recorded action sequence with optional parameters
6202
+ * (HA `script.*`). Runnable via `script-runner` cap. */
6203
+ DeviceType["Script"] = "script";
6204
+ /** Automation rule (HA `automation.*`) enable/disable + manual
6205
+ * trigger surface exposed via `automation-control` cap. */
6206
+ DeviceType["Automation"] = "automation";
6207
+ /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6208
+ DeviceType["Lock"] = "lock";
6209
+ /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6210
+ * `valve.*`). `cover` cap with sub-roles for variant. */
6211
+ DeviceType["Cover"] = "cover";
6212
+ /** Pipe / water / gas valve with open/close/stop and optional
6213
+ * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6214
+ * modelled on the same open/closed lifecycle. */
6215
+ DeviceType["Valve"] = "valve";
6216
+ /** Humidifier / dehumidifier with on/off + target humidity + mode
6217
+ * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6218
+ * modelled on the same target / mode lifecycle. */
6219
+ DeviceType["Humidifier"] = "humidifier";
6220
+ /** Water heater / boiler with target temperature + operation mode +
6221
+ * away mode (HA `water_heater.*`). `water-heater` cap a
6222
+ * climate-family actuator. */
6223
+ DeviceType["WaterHeater"] = "water-heater";
6224
+ /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6225
+ DeviceType["Fan"] = "fan";
6226
+ /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6227
+ * the camera surface those use `Camera`. `media-player` cap. */
6228
+ DeviceType["MediaPlayer"] = "media-player";
6229
+ /** Security panel / alarm system (HA `alarm_control_panel.*`).
6230
+ * `alarm-panel` cap. */
6231
+ DeviceType["AlarmPanel"] = "alarm-panel";
6232
+ /** Generic user-settable input (HA `number` / `input_number` / `select`
6233
+ * / `input_select` / `text` / `input_text` / `input_datetime`).
6234
+ * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6235
+ * TextControl / DateTimeControl. */
6236
+ DeviceType["Control"] = "control";
6237
+ /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6238
+ * `presence` cap. */
6239
+ DeviceType["Presence"] = "presence";
6240
+ /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6241
+ * `weather` cap. */
6242
+ DeviceType["Weather"] = "weather";
6243
+ /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6244
+ DeviceType["Vacuum"] = "vacuum";
6245
+ /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6246
+ * `lawn-mower-control` cap. */
6247
+ DeviceType["LawnMower"] = "lawn-mower";
6248
+ /** Physical HA device group — parent container for entity-children
6249
+ * adopted from a single HA device entry. Not renderable as a
6250
+ * standalone device; exists only to anchor child entities. */
6251
+ DeviceType["Container"] = "container";
6252
+ /** Single still-image entity (HA `image.*`). Read-only display of an
6253
+ * `entity_picture` signed URL the browser loads directly. `image` cap. */
6254
+ DeviceType["Image"] = "image";
6255
+ return DeviceType;
6256
+ }({});
6257
+ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6258
+ DeviceFeature["BatteryOperated"] = "battery-operated";
6259
+ DeviceFeature["Rebootable"] = "rebootable";
6482
6260
  /**
6483
- * Identifier of the camera this decoder session serves. Optional
6484
- * because the cap is generic (any caller could request decode), but
6485
- * stream-broker passes it so decoder logs include `deviceId` for
6486
- * per-camera filtering when diagnosing failures (e.g. node-av
6487
- * sendPacket errors on a single hung camera).
6261
+ * Device supports an on-demand re-sync of its derived spec with its
6262
+ * upstream source drives the generic Re-sync button. The owning
6263
+ * provider implements the action via the `device-adoption.resync` cap.
6488
6264
  */
6489
- deviceId: number().int().nonnegative().optional(),
6265
+ DeviceFeature["Resyncable"] = "resyncable";
6266
+ DeviceFeature["NativeSnapshot"] = "native-snapshot";
6267
+ DeviceFeature["DoorbellButton"] = "doorbell-button";
6268
+ DeviceFeature["TwoWayAudio"] = "two-way-audio";
6269
+ DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6490
6270
  /**
6491
- * Free-form tag for log scoping. Stream-broker uses
6492
- * `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
6493
- * on every line so `grep tag=broker:5/high` filters one camera
6494
- * profile cleanly.
6271
+ * Camera supports the on-firmware autotrack subsystem (subject-
6272
+ * following). Distinct from `PanTiltZoom` because not every PTZ
6273
+ * camera ships autotrack the admin UI uses this flag to gate
6274
+ * the autotrack toggle / settings card without re-deriving from
6275
+ * the cap registry. Mirrors `ptz-autotrack` cap registration:
6276
+ * driver sets this feature when probe confirms the firmware
6277
+ * surface, and registers the cap in the same code path.
6495
6278
  */
6496
- tag: string().optional(),
6279
+ DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6497
6280
  /**
6498
- * Where the session delivers decoded frames (Phase 5 / D9):
6281
+ * Accessory exposes a "trigger on motion" toggle the parent camera's
6282
+ * motion detection automatically activates this device. Mirrors
6283
+ * `motion-trigger` cap registration: drivers set this feature in the
6284
+ * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6499
6285
  *
6500
- * - `'callback'` (default) the legacy pixel path: decoded frames are
6501
- * buffered as `DecodedFrame`s and drained via `pullFrames`.
6502
- * - `'shm'` the shared-memory frame plane: decoded frames are written
6503
- * into an OS shared-memory ring and drained as zero-pixel
6504
- * `FrameHandle`s via `pullHandles`. A session is one mode or the
6505
- * other — `pullFrames` returns nothing for an `'shm'` session and
6506
- * `pullHandles` returns nothing for a `'callback'` session.
6507
- */
6508
- frameSink: _enum(["callback", "shm"]).default("callback")
6509
- });
6510
- var EncodeProfileSchema = object({
6511
- video: object({
6512
- codec: _enum([
6513
- "h264",
6514
- "h265",
6515
- "copy"
6516
- ]),
6517
- profile: _enum([
6518
- "baseline",
6519
- "main",
6520
- "high"
6521
- ]).optional(),
6522
- width: number().int().positive().optional(),
6523
- height: number().int().positive().optional(),
6524
- fps: number().positive().optional(),
6525
- bitrateKbps: number().int().positive().optional(),
6526
- gopFrames: number().int().positive().optional(),
6527
- bf: number().int().min(0).optional(),
6528
- preset: _enum([
6529
- "ultrafast",
6530
- "superfast",
6531
- "veryfast",
6532
- "faster",
6533
- "fast",
6534
- "medium"
6535
- ]).optional(),
6536
- tune: _enum([
6537
- "zerolatency",
6538
- "film",
6539
- "animation"
6540
- ]).optional()
6541
- }),
6542
- audio: union([literal("passthrough"), object({
6543
- codec: _enum([
6544
- "opus",
6545
- "aac",
6546
- "pcmu",
6547
- "pcma",
6548
- "copy"
6549
- ]),
6550
- bitrateKbps: number().int().positive().optional(),
6551
- sampleRateHz: number().int().positive().optional(),
6552
- channels: union([literal(1), literal(2)]).optional()
6553
- })]),
6554
- /**
6555
- * ffmpeg input-side args, inserted between the fixed global flags
6556
- * (`-hide_banner -loglevel error`) and `-i pipe:0`. Free-text array
6557
- * — the widget surfaces a textarea + suggestion chips for the most-
6558
- * used demuxer/format options.
6559
- */
6560
- inputArgs: array(string()).optional(),
6561
- /**
6562
- * ffmpeg output-side args, inserted between the encode block and
6563
- * the final `-f <muxer> pipe:1`. Use for muxer options, bitstream
6564
- * filters, codec-specific overrides. Free-text array.
6286
+ * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6287
+ * fast scalar without binding fetch), notifier rules, and `listAll`
6288
+ * filters that want "all devices with on-motion behaviour".
6565
6289
  */
6566
- outputArgs: array(string()).optional()
6567
- });
6568
- /**
6569
- import { errMsg } from '@camstack/types'
6570
- * Extract a human-readable message from an unknown error value.
6571
- * Replaces the ubiquitous `errMsg(err)` pattern.
6572
- */
6573
- function errMsg(err) {
6574
- if (err instanceof Error) return err.message;
6575
- if (typeof err === "string") return err;
6576
- return String(err);
6290
+ DeviceFeature["MotionTrigger"] = "motion-trigger";
6291
+ /** Light supports rgb-triplet color via `color` cap. */
6292
+ DeviceFeature["LightColorRgb"] = "light-color-rgb";
6293
+ /** Light supports HSV color via `color` cap. */
6294
+ DeviceFeature["LightColorHsv"] = "light-color-hsv";
6295
+ /** Light supports color-temperature (mired) via `color` cap. */
6296
+ DeviceFeature["LightColorMired"] = "light-color-mired";
6297
+ /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6298
+ * targetHigh). Gates the range slider UI. */
6299
+ DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6300
+ /** Thermostat exposes target humidity and/or current humidity
6301
+ * readings. Gates the humidity controls. */
6302
+ DeviceFeature["ClimateHumidity"] = "climate-humidity";
6303
+ /** Thermostat exposes a fan-mode selector. */
6304
+ DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6305
+ /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6306
+ DeviceFeature["ClimatePreset"] = "climate-preset";
6307
+ /** Cover exposes intermediate position control (0..100). Gates the
6308
+ * position slider UI. */
6309
+ DeviceFeature["CoverPositionable"] = "cover-positionable";
6310
+ /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6311
+ DeviceFeature["CoverTilt"] = "cover-tilt";
6312
+ /** Valve exposes intermediate position control (0..100). Gates the
6313
+ * position slider / drag surface UI. */
6314
+ DeviceFeature["ValvePositionable"] = "valve-positionable";
6315
+ /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6316
+ DeviceFeature["FanSpeed"] = "fan-speed";
6317
+ /** Fan exposes a preset mode selector. */
6318
+ DeviceFeature["FanPreset"] = "fan-preset";
6319
+ /** Fan exposes blade direction (forward/reverse) — typical of
6320
+ * ceiling fans. */
6321
+ DeviceFeature["FanDirection"] = "fan-direction";
6322
+ /** Fan exposes an oscillation toggle. */
6323
+ DeviceFeature["FanOscillating"] = "fan-oscillating";
6324
+ /** Lock requires a PIN code on lock/unlock. Gates the code-entry
6325
+ * field on the UI lock-controls panel. */
6326
+ DeviceFeature["LockPinRequired"] = "lock-pin-required";
6327
+ /** Lock supports a latch-release ("open door") action distinct from
6328
+ * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
6329
+ * `supported_features`. Gates the Open Door button in the UI. */
6330
+ DeviceFeature["LockOpen"] = "lock-open";
6331
+ /** Media player exposes a seek-to-position surface. */
6332
+ DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
6333
+ /** Media player exposes a volume-level setter. */
6334
+ DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
6335
+ /** Media player exposes a mute toggle distinct from volume=0. */
6336
+ DeviceFeature["MediaPlayerMute"] = "media-player-mute";
6337
+ /** Media player exposes a shuffle toggle. */
6338
+ DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
6339
+ /** Media player exposes a repeat mode (off / all / one). */
6340
+ DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
6341
+ /** Media player exposes a source / input selector. */
6342
+ DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
6343
+ /** Media player exposes a play-arbitrary-media surface (URL / id). */
6344
+ DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
6345
+ /** Media player exposes next-track. */
6346
+ DeviceFeature["MediaPlayerNext"] = "media-player-next";
6347
+ /** Media player exposes previous-track. */
6348
+ DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
6349
+ /** Media player exposes stop distinct from pause. */
6350
+ DeviceFeature["MediaPlayerStop"] = "media-player-stop";
6351
+ /** Alarm panel requires a PIN code on arm/disarm. */
6352
+ DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
6353
+ /** Presence device carries GPS coordinates (lat/lng/accuracy) in
6354
+ * addition to a textual location. */
6355
+ DeviceFeature["PresenceGps"] = "presence-gps";
6356
+ /** Notifier accepts an inline / URL image attachment. */
6357
+ DeviceFeature["NotifierImage"] = "notifier-image";
6358
+ /** Notifier accepts a priority hint (high/normal/low). */
6359
+ DeviceFeature["NotifierPriority"] = "notifier-priority";
6360
+ /** Notifier accepts a free-form `data` payload for platform-specific
6361
+ * fields. */
6362
+ DeviceFeature["NotifierData"] = "notifier-data";
6363
+ /** Notifier supports interactive action buttons / callbacks. */
6364
+ DeviceFeature["NotifierActions"] = "notifier-actions";
6365
+ /** Notifier supports per-call recipient targeting (multi-user). */
6366
+ DeviceFeature["NotifierRecipients"] = "notifier-recipients";
6367
+ /** Script runner accepts a variables map on each run invocation. */
6368
+ DeviceFeature["ScriptVariables"] = "script-variables";
6369
+ /** Automation `trigger` accepts a skipCondition flag — fires the
6370
+ * automation's actions while bypassing its condition block. */
6371
+ DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
6372
+ return DeviceFeature;
6373
+ }({});
6374
+ /**
6375
+ * Semantic role a device plays within its parent. Populated by driver
6376
+ * addons when creating accessory devices (Reolink siren/floodlight/
6377
+ * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
6378
+ * admin UI to pick icons, labels, and widgets — a `Switch` with
6379
+ * `role: Floodlight` renders as a bulb with a brightness slider,
6380
+ * whereas a `Switch` with `role: Siren` renders as a klaxon.
6381
+ *
6382
+ * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
6383
+ * sqlite as a nullable TEXT column — old rows keep working unchanged.
6384
+ */
6385
+ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
6386
+ DeviceRole["Siren"] = "siren";
6387
+ DeviceRole["Floodlight"] = "floodlight";
6388
+ DeviceRole["Spotlight"] = "spotlight";
6389
+ DeviceRole["PirSensor"] = "pir-sensor";
6390
+ DeviceRole["Chime"] = "chime";
6391
+ DeviceRole["Autotrack"] = "autotrack";
6392
+ DeviceRole["Nightvision"] = "nightvision";
6393
+ DeviceRole["PrivacyMask"] = "privacy-mask";
6394
+ DeviceRole["Doorbell"] = "doorbell";
6395
+ /** Virtual HA toggle (input_boolean.*) — distinguishable from a
6396
+ * real Switch device for UI rendering / export adapters. */
6397
+ DeviceRole["BinaryHelper"] = "binary-helper";
6398
+ /** Generic motion / occupancy / moving event source. Distinct from
6399
+ * the camera accessory PirSensor role: that one is a camera child;
6400
+ * this is a standalone HA / 3rd-party motion sensor. */
6401
+ DeviceRole["MotionSensor"] = "motion-sensor";
6402
+ DeviceRole["ContactSensor"] = "contact-sensor";
6403
+ DeviceRole["LeakSensor"] = "leak-sensor";
6404
+ DeviceRole["SmokeSensor"] = "smoke-sensor";
6405
+ DeviceRole["COSensor"] = "co-sensor";
6406
+ DeviceRole["GasSensor"] = "gas-sensor";
6407
+ DeviceRole["TamperSensor"] = "tamper-sensor";
6408
+ DeviceRole["VibrationSensor"] = "vibration-sensor";
6409
+ DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
6410
+ DeviceRole["SoundSensor"] = "sound-sensor";
6411
+ /** Fallback for `binary_sensor` without a known `device_class`. */
6412
+ DeviceRole["BinarySensor"] = "binary-sensor";
6413
+ DeviceRole["TemperatureSensor"] = "temperature-sensor";
6414
+ DeviceRole["HumiditySensor"] = "humidity-sensor";
6415
+ DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
6416
+ DeviceRole["PressureSensor"] = "pressure-sensor";
6417
+ DeviceRole["PowerSensor"] = "power-sensor";
6418
+ DeviceRole["EnergySensor"] = "energy-sensor";
6419
+ DeviceRole["VoltageSensor"] = "voltage-sensor";
6420
+ DeviceRole["CurrentSensor"] = "current-sensor";
6421
+ DeviceRole["AirQualitySensor"] = "air-quality-sensor";
6422
+ /** Battery level (numeric % via `sensor` OR low-bool via
6423
+ * `binary_sensor` — the cap distinguishes via the value type). */
6424
+ DeviceRole["BatterySensor"] = "battery-sensor";
6425
+ /** Fallback for `sensor` numeric without a known `device_class`. */
6426
+ DeviceRole["NumericSensor"] = "numeric-sensor";
6427
+ /** String / enum state (HA `sensor` with `state_class: enum` or
6428
+ * `attributes.options`). */
6429
+ DeviceRole["EnumSensor"] = "enum-sensor";
6430
+ /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
6431
+ * or `date`). The slice carries the raw ISO string verbatim (hosted on
6432
+ * the `enum-sensor` cap); the UI renders it locale-formatted. */
6433
+ DeviceRole["DateTimeSensor"] = "datetime-sensor";
6434
+ /** Last-resort fallback when nothing else matches. */
6435
+ DeviceRole["GenericSensor"] = "generic-sensor";
6436
+ DeviceRole["NumericControl"] = "numeric-control";
6437
+ DeviceRole["SelectControl"] = "select-control";
6438
+ DeviceRole["TextControl"] = "text-control";
6439
+ DeviceRole["DateTimeControl"] = "datetime-control";
6440
+ /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
6441
+ * rich features (image, priority, channel routing). */
6442
+ DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
6443
+ /** Chat / messaging service (HA `notify.telegram_*`,
6444
+ * `notify.discord_*`, etc.). */
6445
+ DeviceRole["MessagingNotifier"] = "messaging-notifier";
6446
+ /** Email-based delivery (HA `notify.smtp`, etc.). */
6447
+ DeviceRole["EmailNotifier"] = "email-notifier";
6448
+ /** Fallback when the notifier service name doesn't match a known
6449
+ * pattern. */
6450
+ DeviceRole["GenericNotifier"] = "generic-notifier";
6451
+ return DeviceRole;
6452
+ }({});
6453
+ /**
6454
+ * Generic types for capability definitions.
6455
+ *
6456
+ * A capability is defined with Zod schemas for methods, events, and settings.
6457
+ * TypeScript types are inferred via z.infer<> — zero duplication.
6458
+ *
6459
+ * Pattern:
6460
+ * 1. Define Zod schemas for data, methods, settings
6461
+ * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
6462
+ * 3. Export type IProvider = InferProvider<typeof capabilityDef>
6463
+ * 4. Addon implements IProvider
6464
+ * 5. Registry auto-mounts tRPC router from definition.methods
6465
+ */
6466
+ /**
6467
+ * Output schema shared by the contribution + live methods.
6468
+ *
6469
+ * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
6470
+ * tabs[]) without importing from `../interfaces/config-ui.js` — a
6471
+ * concrete-but-lenient Zod object keeps tRPC output inference happy
6472
+ * (using `z.unknown()` here collapses unrelated router branches to
6473
+ * `unknown` when the generator re-inlines the huge AppRouter type).
6474
+ *
6475
+ * `.passthrough()` on sections/fields accepts whatever FormBuilder
6476
+ * extensions the caller adds (showWhen, displayScale, …) without
6477
+ * rebuilding every time a new field kind is introduced.
6478
+ */
6479
+ var ContributionSectionSchema = object({
6480
+ id: string(),
6481
+ title: string(),
6482
+ description: string().optional(),
6483
+ style: _enum(["card", "accordion"]).optional(),
6484
+ defaultCollapsed: boolean().optional(),
6485
+ columns: union([
6486
+ literal(1),
6487
+ literal(2),
6488
+ literal(3),
6489
+ literal(4)
6490
+ ]).optional(),
6491
+ tab: string().optional(),
6492
+ location: _enum(["settings", "top-tab"]).optional(),
6493
+ order: number().optional(),
6494
+ fields: array(any())
6495
+ });
6496
+ object({
6497
+ tabs: array(object({
6498
+ id: string(),
6499
+ label: string(),
6500
+ icon: string(),
6501
+ order: number().optional()
6502
+ })).optional(),
6503
+ sections: array(ContributionSectionSchema)
6504
+ }).nullable();
6505
+ object({ deviceId: number() }), object({ deviceId: number() }), object({
6506
+ deviceId: number(),
6507
+ patch: record(string(), unknown())
6508
+ }), object({ success: literal(true) });
6509
+ object({ deviceId: number() }), unknown().nullable();
6510
+ /** Shorthand to define a method schema */
6511
+ function method(input, output, options) {
6512
+ return {
6513
+ input,
6514
+ output,
6515
+ kind: options?.kind ?? "query",
6516
+ auth: options?.auth ?? "protected",
6517
+ ...options?.access !== void 0 ? { access: options.access } : {},
6518
+ timeoutMs: options?.timeoutMs
6519
+ };
6577
6520
  }
6578
- var YAMNET_TO_MACRO = {
6579
- mapping: {
6580
- Speech: "speech",
6581
- "Child speech, kid speaking": "speech",
6582
- Conversation: "speech",
6583
- "Narration, monologue": "speech",
6584
- Babbling: "speech",
6585
- Whispering: "speech",
6586
- "Speech synthesizer": "speech",
6587
- Humming: "speech",
6588
- Rapping: "speech",
6589
- Singing: "speech",
6590
- Choir: "speech",
6591
- "Child singing": "speech",
6592
- Shout: "scream",
6593
- Bellow: "scream",
6594
- Yell: "scream",
6595
- Screaming: "scream",
6596
- "Children shouting": "scream",
6597
- Whoop: "scream",
6598
- "Crying, sobbing": "crying",
6599
- "Baby cry, infant cry": "crying",
6600
- Whimper: "crying",
6601
- "Wail, moan": "crying",
6602
- Groan: "crying",
6603
- Laughter: "laughter",
6604
- "Baby laughter": "laughter",
6605
- Giggle: "laughter",
6606
- Snicker: "laughter",
6607
- "Belly laugh": "laughter",
6608
- "Chuckle, chortle": "laughter",
6609
- Music: "music",
6610
- "Musical instrument": "music",
6611
- Guitar: "music",
6612
- Piano: "music",
6613
- Drum: "music",
6614
- "Drum kit": "music",
6615
- "Violin, fiddle": "music",
6616
- Flute: "music",
6617
- Saxophone: "music",
6618
- Trumpet: "music",
6619
- Synthesizer: "music",
6620
- "Pop music": "music",
6621
- "Rock music": "music",
6622
- "Hip hop music": "music",
6623
- "Classical music": "music",
6624
- Jazz: "music",
6625
- "Electronic music": "music",
6626
- "Background music": "music",
6627
- Dog: "dog",
6628
- Bark: "dog",
6629
- Yip: "dog",
6630
- Howl: "dog",
6631
- "Bow-wow": "dog",
6632
- Growling: "dog",
6633
- "Whimper (dog)": "dog",
6634
- Cat: "cat",
6635
- Purr: "cat",
6636
- Meow: "cat",
6637
- Hiss: "cat",
6638
- Caterwaul: "cat",
6639
- Bird: "bird",
6640
- "Bird vocalization, bird call, bird song": "bird",
6641
- "Chirp, tweet": "bird",
6642
- Squawk: "bird",
6643
- Crow: "bird",
6644
- Owl: "bird",
6645
- "Pigeon, dove": "bird",
6646
- Animal: "animal",
6647
- "Domestic animals, pets": "animal",
6648
- "Livestock, farm animals, working animals": "animal",
6649
- Horse: "animal",
6650
- "Cattle, bovinae": "animal",
6651
- Pig: "animal",
6652
- Sheep: "animal",
6653
- Goat: "animal",
6654
- Frog: "animal",
6655
- Insect: "animal",
6656
- Cricket: "animal",
6657
- Alarm: "alarm",
6658
- "Alarm clock": "alarm",
6659
- "Smoke detector, smoke alarm": "alarm",
6660
- "Fire alarm": "alarm",
6661
- Buzzer: "alarm",
6662
- "Civil defense siren": "alarm",
6663
- "Car alarm": "alarm",
6664
- Siren: "siren",
6665
- "Police car (siren)": "siren",
6666
- "Ambulance (siren)": "siren",
6667
- "Fire engine, fire truck (siren)": "siren",
6668
- "Emergency vehicle": "siren",
6669
- Foghorn: "siren",
6670
- Doorbell: "doorbell",
6671
- "Ding-dong": "doorbell",
6672
- Knock: "doorbell",
6673
- Tap: "doorbell",
6674
- Glass: "glass_breaking",
6675
- Shatter: "glass_breaking",
6676
- "Chink, clink": "glass_breaking",
6677
- "Gunshot, gunfire": "gunshot",
6678
- "Machine gun": "gunshot",
6679
- Explosion: "gunshot",
6680
- Fireworks: "gunshot",
6681
- Firecracker: "gunshot",
6682
- "Artillery fire": "gunshot",
6683
- "Cap gun": "gunshot",
6684
- Boom: "gunshot",
6685
- Vehicle: "vehicle",
6686
- Car: "vehicle",
6687
- Truck: "vehicle",
6688
- Bus: "vehicle",
6689
- Motorcycle: "vehicle",
6690
- "Car passing by": "vehicle",
6691
- "Vehicle horn, car horn, honking": "vehicle",
6692
- "Traffic noise, roadway noise": "vehicle",
6693
- Train: "vehicle",
6694
- Aircraft: "vehicle",
6695
- Helicopter: "vehicle",
6696
- Bicycle: "vehicle",
6697
- Skateboard: "vehicle",
6698
- Fire: "fire",
6699
- Crackle: "fire",
6700
- Water: "water",
6701
- Rain: "water",
6702
- Raindrop: "water",
6703
- "Rain on surface": "water",
6704
- Stream: "water",
6705
- Waterfall: "water",
6706
- Ocean: "water",
6707
- "Waves, surf": "water",
6708
- "Splash, splatter": "water",
6709
- Wind: "wind",
6710
- Thunderstorm: "wind",
6711
- Thunder: "wind",
6712
- "Wind noise (microphone)": "wind",
6713
- "Rustling leaves": "wind",
6714
- Door: "door",
6715
- "Sliding door": "door",
6716
- Slam: "door",
6717
- "Cupboard open or close": "door",
6718
- "Walk, footsteps": "footsteps",
6719
- Run: "footsteps",
6720
- Shuffle: "footsteps",
6721
- Crowd: "crowd",
6722
- Chatter: "crowd",
6723
- Cheering: "crowd",
6724
- Applause: "crowd",
6725
- "Children playing": "crowd",
6726
- "Hubbub, speech noise, speech babble": "crowd",
6727
- Telephone: "telephone",
6728
- "Telephone bell ringing": "telephone",
6729
- Ringtone: "telephone",
6730
- "Telephone dialing, DTMF": "telephone",
6731
- "Busy signal": "telephone",
6732
- Engine: "engine",
6733
- "Engine starting": "engine",
6734
- Idling: "engine",
6735
- "Accelerating, revving, vroom": "engine",
6736
- "Light engine (high frequency)": "engine",
6737
- "Medium engine (mid frequency)": "engine",
6738
- "Heavy engine (low frequency)": "engine",
6739
- "Lawn mower": "engine",
6740
- Chainsaw: "engine",
6741
- Hammer: "tools",
6742
- Jackhammer: "tools",
6743
- Sawing: "tools",
6744
- "Power tool": "tools",
6745
- Drill: "tools",
6746
- Sanding: "tools",
6747
- Silence: "silence"
6748
- },
6749
- preserveOriginal: false
6750
- };
6751
- var APPLE_SA_TO_MACRO = {
6752
- mapping: {
6753
- speech: "speech",
6754
- child_speech: "speech",
6755
- conversation: "speech",
6756
- whispering: "speech",
6757
- singing: "speech",
6758
- humming: "speech",
6759
- shout: "scream",
6760
- yell: "scream",
6761
- screaming: "scream",
6762
- crying: "crying",
6763
- baby_crying: "crying",
6764
- sobbing: "crying",
6765
- laughter: "laughter",
6766
- baby_laughter: "laughter",
6767
- giggling: "laughter",
6768
- music: "music",
6769
- guitar: "music",
6770
- piano: "music",
6771
- drums: "music",
6772
- dog_bark: "dog",
6773
- dog_bow_wow: "dog",
6774
- dog_growling: "dog",
6775
- dog_howl: "dog",
6776
- cat_meow: "cat",
6777
- cat_purr: "cat",
6778
- cat_hiss: "cat",
6779
- bird: "bird",
6780
- bird_chirp: "bird",
6781
- bird_squawk: "bird",
6782
- animal: "animal",
6783
- horse: "animal",
6784
- cow_moo: "animal",
6785
- insect: "animal",
6786
- alarm: "alarm",
6787
- smoke_alarm: "alarm",
6788
- fire_alarm: "alarm",
6789
- car_alarm: "alarm",
6790
- siren: "siren",
6791
- police_siren: "siren",
6792
- ambulance_siren: "siren",
6793
- doorbell: "doorbell",
6794
- door_knock: "doorbell",
6795
- knocking: "doorbell",
6796
- glass_breaking: "glass_breaking",
6797
- glass_shatter: "glass_breaking",
6798
- gunshot: "gunshot",
6799
- explosion: "gunshot",
6800
- fireworks: "gunshot",
6801
- car: "vehicle",
6802
- truck: "vehicle",
6803
- motorcycle: "vehicle",
6804
- car_horn: "vehicle",
6805
- vehicle_horn: "vehicle",
6806
- traffic: "vehicle",
6807
- fire: "fire",
6808
- fire_crackle: "fire",
6809
- water: "water",
6810
- rain: "water",
6811
- ocean: "water",
6812
- splash: "water",
6813
- wind: "wind",
6814
- thunder: "wind",
6815
- thunderstorm: "wind",
6816
- door: "door",
6817
- door_slam: "door",
6818
- sliding_door: "door",
6819
- footsteps: "footsteps",
6820
- walking: "footsteps",
6821
- running: "footsteps",
6822
- crowd: "crowd",
6823
- chatter: "crowd",
6824
- cheering: "crowd",
6825
- applause: "crowd",
6826
- telephone_ring: "telephone",
6827
- ringtone: "telephone",
6828
- engine: "engine",
6829
- engine_starting: "engine",
6830
- lawn_mower: "engine",
6831
- chainsaw: "engine",
6832
- hammer: "tools",
6833
- jackhammer: "tools",
6834
- drill: "tools",
6835
- power_tool: "tools",
6836
- silence: "silence"
6837
- },
6838
- preserveOriginal: false
6839
- };
6840
- var _macroLookup = /* @__PURE__ */ new Map();
6841
- for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6842
- for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6843
- var DeviceType = /* @__PURE__ */ function(DeviceType) {
6844
- DeviceType["Camera"] = "camera";
6845
- DeviceType["Hub"] = "hub";
6846
- DeviceType["Light"] = "light";
6847
- DeviceType["Siren"] = "siren";
6848
- DeviceType["Switch"] = "switch";
6849
- DeviceType["Sensor"] = "sensor";
6850
- DeviceType["Thermostat"] = "thermostat";
6851
- DeviceType["Button"] = "button";
6852
- /** Generic stateless event emitter — carries a device's EXACT declared
6853
- * event vocabulary verbatim (no normalization). Installed with the
6854
- * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6855
- * HA bus events (e.g. `zha_event`, generic). */
6856
- DeviceType["EventEmitter"] = "event-emitter";
6857
- /** Firmware/software update entity — current vs available version,
6858
- * updatable flag, update state, and an install action. Installed with
6859
- * the `update` cap. Sources: Homematic firmware-update channels (and
6860
- * reusable by other providers, e.g. HA `update.*` entities). */
6861
- DeviceType["Update"] = "update";
6862
- DeviceType["Generic"] = "generic";
6863
- /** Generic notification delivery target (HA `notify.<service>`, future
6864
- * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6865
- * endpoint; the `notifier` cap defines the send surface. */
6866
- DeviceType["Notifier"] = "notifier";
6867
- /** Pre-recorded action sequence with optional parameters
6868
- * (HA `script.*`). Runnable via `script-runner` cap. */
6869
- DeviceType["Script"] = "script";
6870
- /** Automation rule (HA `automation.*`) enable/disable + manual
6871
- * trigger surface exposed via `automation-control` cap. */
6872
- DeviceType["Automation"] = "automation";
6873
- /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6874
- DeviceType["Lock"] = "lock";
6875
- /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6876
- * `valve.*`). `cover` cap with sub-roles for variant. */
6877
- DeviceType["Cover"] = "cover";
6878
- /** Pipe / water / gas valve with open/close/stop and optional
6879
- * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6880
- * modelled on the same open/closed lifecycle. */
6881
- DeviceType["Valve"] = "valve";
6882
- /** Humidifier / dehumidifier with on/off + target humidity + mode
6883
- * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6884
- * modelled on the same target / mode lifecycle. */
6885
- DeviceType["Humidifier"] = "humidifier";
6886
- /** Water heater / boiler with target temperature + operation mode +
6887
- * away mode (HA `water_heater.*`). `water-heater` cap — a
6888
- * climate-family actuator. */
6889
- DeviceType["WaterHeater"] = "water-heater";
6890
- /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6891
- DeviceType["Fan"] = "fan";
6892
- /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6893
- * the camera surface — those use `Camera`. `media-player` cap. */
6894
- DeviceType["MediaPlayer"] = "media-player";
6895
- /** Security panel / alarm system (HA `alarm_control_panel.*`).
6896
- * `alarm-panel` cap. */
6897
- DeviceType["AlarmPanel"] = "alarm-panel";
6898
- /** Generic user-settable input (HA `number` / `input_number` / `select`
6899
- * / `input_select` / `text` / `input_text` / `input_datetime`).
6900
- * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6901
- * TextControl / DateTimeControl. */
6902
- DeviceType["Control"] = "control";
6903
- /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6904
- * `presence` cap. */
6905
- DeviceType["Presence"] = "presence";
6906
- /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6907
- * `weather` cap. */
6908
- DeviceType["Weather"] = "weather";
6909
- /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6910
- DeviceType["Vacuum"] = "vacuum";
6911
- /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6912
- * `lawn-mower-control` cap. */
6913
- DeviceType["LawnMower"] = "lawn-mower";
6914
- /** Physical HA device group parent container for entity-children
6915
- * adopted from a single HA device entry. Not renderable as a
6916
- * standalone device; exists only to anchor child entities. */
6917
- DeviceType["Container"] = "container";
6918
- /** Single still-image entity (HA `image.*`). Read-only display of an
6919
- * `entity_picture` signed URL the browser loads directly. `image` cap. */
6920
- DeviceType["Image"] = "image";
6921
- return DeviceType;
6922
- }({});
6923
- var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6924
- DeviceFeature["BatteryOperated"] = "battery-operated";
6925
- DeviceFeature["Rebootable"] = "rebootable";
6521
+ /** Shorthand to define an event schema */
6522
+ function event(data) {
6523
+ return { data };
6524
+ }
6525
+ var StaticDirOutputSchema = object({ staticDir: string() });
6526
+ var VersionOutputSchema = object({ version: string() });
6527
+ method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
6528
+ /**
6529
+ * device-ops — device-scoped cap that unifies the per-IDevice operations
6530
+ * previously routed through the `.device-ops` Moleculer bridge service.
6531
+ *
6532
+ * Each worker that hosts live `IDevice` instances auto-registers a native
6533
+ * provider for this cap (per device) backed by its local
6534
+ * `DeviceRegistry`. Hub-side callers reach it transparently through
6535
+ * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
6536
+ * `deviceId` + `nodeId` and dispatches through the standard cap-router,
6537
+ * so there's no parallel bridge path anymore.
6538
+ *
6539
+ * The surface is intentionally small — every method corresponds to a
6540
+ * single action on the live `IDevice` (or `ICameraDevice` for
6541
+ * `getStreamSources`). Richer orchestration (enable/disable with
6542
+ * integration plumbing, bulk updates) stays in the `device-manager` cap;
6543
+ * `device-ops` is the per-device primitive the device-manager routes to.
6544
+ */
6545
+ var StreamSourceEntrySchema = object({
6546
+ id: string(),
6547
+ label: string(),
6548
+ protocol: _enum([
6549
+ "rtsp",
6550
+ "rtmp",
6551
+ "annexb",
6552
+ "http-mjpeg",
6553
+ "webrtc",
6554
+ "custom"
6555
+ ]),
6556
+ url: string().optional(),
6557
+ resolution: object({
6558
+ width: number(),
6559
+ height: number()
6560
+ }).optional(),
6561
+ fps: number().optional(),
6562
+ bitrate: number().optional(),
6563
+ codec: string().optional(),
6564
+ profileHint: CamProfileSchema.optional(),
6565
+ sdp: string().optional()
6566
+ });
6567
+ var ConfigEntrySchema$1 = object({
6568
+ key: string(),
6569
+ value: unknown()
6570
+ });
6571
+ var RawStateResultSchema = object({
6572
+ /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
6573
+ source: string(),
6574
+ /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
6575
+ data: record(string(), unknown())
6576
+ });
6577
+ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
6578
+ deviceId: number(),
6579
+ values: record(string(), unknown())
6580
+ }), _void(), { kind: "mutation" }), method(object({
6581
+ deviceId: number(),
6582
+ action: string().min(1),
6583
+ input: unknown()
6584
+ }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
6585
+ //#endregion
6586
+ //#region ../types/dist/err-msg-IQTHeDzc.mjs
6587
+ /**
6588
+ import { errMsg } from '@camstack/types'
6589
+ * Extract a human-readable message from an unknown error value.
6590
+ * Replaces the ubiquitous `errMsg(err)` pattern.
6591
+ */
6592
+ function errMsg(err) {
6593
+ if (err instanceof Error) return err.message;
6594
+ if (typeof err === "string") return err;
6595
+ return String(err);
6596
+ }
6597
+ //#endregion
6598
+ //#region ../types/dist/index.mjs
6599
+ /**
6600
+ * Deep wiring healthcheck — snapshot of active reachability probes across
6601
+ * every declared capability + widget of every installed plugin, on every
6602
+ * node. Produced by the backend `WiringHealthService` and surfaced via
6603
+ * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
6604
+ *
6605
+ * Unlike `/health` (process liveness), this reflects whether each cap/widget
6606
+ * is actually *reachable* over the real cap-dispatch path. See spec
6607
+ * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
6608
+ */
6609
+ /** What kind of target a probe addressed. */
6610
+ var wiringProbeKindSchema = _enum([
6611
+ "singleton",
6612
+ "device",
6613
+ "widget"
6614
+ ]);
6615
+ /** Result of probing a single (cap|widget [, device]) target. */
6616
+ var wiringProbeResultSchema = object({
6617
+ capName: string(),
6618
+ kind: wiringProbeKindSchema,
6619
+ deviceId: number().optional(),
6620
+ reachable: boolean(),
6621
+ latencyMs: number(),
6622
+ error: string().optional()
6623
+ });
6624
+ /** Per-addon roll-up of cap + widget probe results. */
6625
+ var wiringAddonHealthSchema = object({
6626
+ addonId: string(),
6627
+ caps: array(wiringProbeResultSchema).readonly(),
6628
+ widgets: array(wiringProbeResultSchema).readonly()
6629
+ });
6630
+ /** Per-node roll-up. */
6631
+ var wiringNodeHealthSchema = object({
6632
+ nodeId: string(),
6633
+ addons: array(wiringAddonHealthSchema).readonly()
6634
+ });
6635
+ object({
6636
+ /** True only when every probed target is reachable. */
6637
+ ok: boolean(),
6638
+ /** True when at least one target is unreachable. */
6639
+ degraded: boolean(),
6640
+ checkedAt: string(),
6641
+ nodes: array(wiringNodeHealthSchema).readonly(),
6642
+ summary: object({
6643
+ total: number(),
6644
+ reachable: number(),
6645
+ unreachable: number()
6646
+ })
6647
+ });
6648
+ var MODEL_FORMATS = [
6649
+ "onnx",
6650
+ "coreml",
6651
+ "openvino",
6652
+ "tflite",
6653
+ "pt"
6654
+ ];
6655
+ /**
6656
+ * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6657
+ * Named `RecordingWeekday` to avoid collision with the string-union
6658
+ * `Weekday` exported from `interfaces/timezones.ts`.
6659
+ */
6660
+ var RecordingWeekdaySchema = number().int().min(0).max(6);
6661
+ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6662
+ var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6663
+ kind: literal("timeOfDay"),
6664
+ start: string().regex(HHMM),
6665
+ end: string().regex(HHMM),
6666
+ /** Restrict to these weekdays; omit = every day. */
6667
+ days: array(RecordingWeekdaySchema).optional()
6668
+ })]);
6669
+ var RecordingModeSchema = _enum([
6670
+ "continuous",
6671
+ "onMotion",
6672
+ "onAudioThreshold"
6673
+ ]);
6674
+ /**
6675
+ * First-class, authoritative per-camera storage mode — the netta choice the UI
6676
+ * reads directly (never inferred from `rules`):
6677
+ * - `off` — not recording.
6678
+ * - `events` — record only around triggers (motion / audio threshold),
6679
+ * with pre/post-buffer.
6680
+ * - `continuous` record 24/7 within the schedule.
6681
+ *
6682
+ * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6683
+ * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6684
+ */
6685
+ var RecordingStorageModeSchema = _enum([
6686
+ "off",
6687
+ "events",
6688
+ "continuous"
6689
+ ]);
6690
+ /** Which detectors trigger an `events`-mode recording. */
6691
+ var RecordingTriggersSchema = object({
6692
+ motion: boolean().optional(),
6693
+ audioThresholdDbfs: number().optional()
6694
+ });
6695
+ /**
6696
+ * Mode of a single recording band — the recorder per-band vocabulary.
6697
+ *
6698
+ * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6699
+ * only ever `continuous` or `events`; "off" is expressed by the absence of a
6700
+ * covering band, not by a band value.
6701
+ */
6702
+ var RecordingBandModeSchema = _enum(["continuous", "events"]);
6703
+ /**
6704
+ * Triggers for an `events`-mode band. Identical shape to
6705
+ * `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
6706
+ * two never drift.
6707
+ */
6708
+ var RecordingBandTriggersSchema = RecordingTriggersSchema;
6709
+ /**
6710
+ * A single mode-per-band window — the canonical recorder band shape, the
6711
+ * single source of truth re-used by `addon-pipeline/recorder`.
6712
+ *
6713
+ * `days` lists the weekdays the band covers (empty = every day, matching the
6714
+ * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6715
+ * span wraps past midnight (handled by the band engine).
6716
+ */
6717
+ var RecordingBandSchema = object({
6718
+ days: array(RecordingWeekdaySchema),
6719
+ start: string().regex(HHMM),
6720
+ end: string().regex(HHMM),
6721
+ mode: RecordingBandModeSchema,
6722
+ triggers: RecordingBandTriggersSchema.optional(),
6723
+ preBufferSec: number().min(0).optional(),
6724
+ postBufferSec: number().min(0).optional()
6725
+ });
6726
+ var RecordingRuleSchema = object({
6727
+ schedule: RecordingScheduleSchema,
6728
+ mode: RecordingModeSchema,
6729
+ /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6730
+ preBufferSec: number().min(0).default(0),
6731
+ /** Keep recording until this many seconds after the last trigger. */
6732
+ postBufferSec: number().min(0).default(0),
6733
+ /** Each new trigger restarts the post-buffer window. */
6734
+ resetTimeoutOnNewEvent: boolean().default(true),
6735
+ /** onAudioThreshold only — dBFS level that counts as a trigger. */
6736
+ thresholdDbfs: number().optional()
6737
+ });
6738
+ /**
6739
+ * Per-device retention overrides. Every field is optional; an unset or `0`
6740
+ * value inherits the node-wide recorder default. Only footage-lifetime limits
6741
+ * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6742
+ * (when the volume is too full to keep recording) is NOT a per-camera concern —
6743
+ * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6744
+ * shared by every camera writing to that volume.
6745
+ */
6746
+ var RecordingRetentionSchema = object({
6747
+ maxAgeDays: number().min(0).optional(),
6748
+ maxSizeGb: number().min(0).optional()
6749
+ });
6750
+ /**
6751
+ * The full per-camera recording intent — the wire shape of a RecordingTarget.
6752
+ *
6753
+ * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6754
+ * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6755
+ * only for transition + migration (`migrateRulesToMode`); the policy engine
6756
+ * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6757
+ */
6758
+ var RecordingConfigSchema = object({
6759
+ enabled: boolean(),
6760
+ /** Authoritative storage mode. Absent on legacy targets → derived once via
6761
+ * `migrateRulesToMode`, then persisted. */
6762
+ mode: RecordingStorageModeSchema.optional(),
6763
+ profiles: array(CamProfileSchema).optional(),
6764
+ segmentSeconds: number().int().positive().optional(),
6765
+ /** Shared recording time-bands for `events` & `continuous` — record only when
6766
+ * the wall-clock falls inside one of these windows. Omit or empty = always.
6767
+ * `continuous` compiles to one rule per band; `events` to band × trigger. */
6768
+ schedules: array(RecordingScheduleSchema).optional(),
6769
+ /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
6770
+ * normalized into `schedules` on read and never written going forward. (Not
6771
+ * tagged `@deprecated`: the normalization paths must read it cast-free.) */
6772
+ schedule: RecordingScheduleSchema.optional(),
6773
+ /** `events`-mode only — which detectors trigger a recording. */
6774
+ triggers: RecordingTriggersSchema.optional(),
6775
+ /** `events`-mode only — seconds retained before / after a trigger. */
6776
+ preBufferSec: number().min(0).optional(),
6777
+ postBufferSec: number().min(0).optional(),
6778
+ /** DEPRECATED authoring input; retained for migration/transition. */
6779
+ rules: array(RecordingRuleSchema).optional(),
6780
+ /**
6781
+ * AUTHORITATIVE mode-per-band recording model (recorder). When present it
6782
+ * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
6783
+ * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
6784
+ * derived into bands once via `migrateConfigToBands`.
6785
+ */
6786
+ bands: array(RecordingBandSchema).optional(),
6787
+ retention: RecordingRetentionSchema.optional()
6788
+ });
6789
+ /**
6790
+ * `StorageLocationType` — an addon-declared id that identifies the *kind* of
6791
+ * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
6792
+ * so the persisted record schema and the consumer-facing cap can both consume it
6793
+ * without forming a circular import. The `storage` cap re-exports it
6794
+ * verbatim for back-compat.
6795
+ *
6796
+ * This Zod schema is the **authoritative source** for `StorageLocationType`.
6797
+ * The TS alias in `./storage.ts` re-exports `z.infer<typeof
6798
+ * StorageLocationTypeSchema>` so the wire surface (cap) and the legacy
6799
+ * `IStorageProvider` interface stay in lockstep.
6800
+ *
6801
+ * The type is now an **open string** (not a closed enum) — addons declare
6802
+ * their own location kinds via `StorageLocationDeclaration.id`. The regex
6803
+ * enforces a safe id format: lowercase-start, alphanumeric + hyphens.
6804
+ */
6805
+ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
6806
+ /**
6807
+ * Persisted record for a storage location instance. Operators can register
6808
+ * multiple instances for multi-cardinality types (e.g. two `backups`
6809
+ * locations with different `providerId`s). Cardinality is now declared per
6810
+ * location via `StorageLocationDeclaration.cardinality` the static
6811
+ * `STORAGE_LOCATION_CARDINALITY` map has been removed.
6812
+ *
6813
+ * `id` is a stable namespaced string of the form `<type>:<slug>`.
6814
+ * The default location for a type uses `id === <type>:default` by
6815
+ * convention (the bare type ref like `'backups'` resolves to it).
6816
+ *
6817
+ * `isSystem: true` marks a location as orchestrator-seeded and
6818
+ * undeletable. The bootstrap-installed defaults (one per type) carry
6819
+ * this flag; operator-added locations don't. Editing the config of
6820
+ * a system location is allowed (path migration, provider swap) but
6821
+ * deleting it is rejected at the cap level.
6822
+ */
6823
+ var StorageLocationSchema = object({
6824
+ id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
6825
+ type: string(),
6826
+ displayName: string().min(1),
6827
+ providerId: string().min(1),
6828
+ config: record(string(), unknown()),
6829
+ /**
6830
+ * Cluster node this location physically lives on. REQUIRED for node-local
6831
+ * providers (filesystem — the path exists on one node's disk), null/absent
6832
+ * for node-agnostic providers (S3/SFTP/WebDAV, reachable from any node).
6833
+ * `'hub'` is the hub node. Validated against the provider's `nodeLocal`
6834
+ * flag at upsert time, not here (the schema is provider-agnostic).
6835
+ */
6836
+ nodeId: string().optional(),
6837
+ isDefault: boolean().default(false),
6838
+ isSystem: boolean().default(false),
6839
+ createdAt: number(),
6840
+ updatedAt: number()
6841
+ });
6842
+ /**
6843
+ * Reference accepted by consumer-facing `api.storage.*` calls.
6844
+ * Either:
6845
+ * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
6846
+ * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
6847
+ *
6848
+ * The orchestrator's `resolveRef(ref)` handles both cases.
6849
+ */
6850
+ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]);
6851
+ /**
6852
+ * `StorageLocationDeclaration` a single storage-location entry declared by
6853
+ * an addon in its `package.json` under `camstack.storageLocations`.
6854
+ *
6855
+ * Design intent:
6856
+ * - **Addon declares its needs** — each addon describes the logical storage
6857
+ * slots it requires (e.g. `recordings`, `recordingsLow`) without caring
6858
+ * about the physical path.
6859
+ * - **Kernel aggregates** at boot the kernel collects declarations from all
6860
+ * installed addons, deduplicates by `id`, and exposes the union via the
6861
+ * storage-locations settings surface.
6862
+ * - **Orchestrator seeds** for every declared `id` the orchestrator ensures
6863
+ * at least one instance named `<id>:default` is present, using
6864
+ * `defaultsTo` to inherit the resolved root from another location when the
6865
+ * declaration is a derivative slot (e.g. `recordingsLow` defaults to
6866
+ * `recordings`).
6867
+ * - **ids are global** — `id` values are shared across the entire deployment;
6868
+ * two addons declaring the same `id` must agree on `cardinality` (validated
6869
+ * at kernel aggregation time, not here).
6870
+ */
6871
+ var StorageLocationDeclarationSchema = object({
6872
+ /**
6873
+ * Global location identifier, e.g. `recordings` or `recordingsLow`.
6874
+ * Must start with a lowercase letter and may contain letters, digits, and
6875
+ * hyphens.
6876
+ */
6877
+ id: string().regex(/^[a-z][a-zA-Z0-9-]*$/, { message: "id must start with a lowercase letter and contain only letters, digits, or hyphens" }),
6878
+ /** Human-readable name shown in the admin UI. */
6879
+ displayName: string().min(1, { message: "displayName must not be empty" }),
6880
+ /** Optional longer explanation of what data this location stores. */
6881
+ description: string().optional(),
6882
+ /**
6883
+ * `single` — exactly one instance of this location is allowed system-wide
6884
+ * (e.g. `logs`, `models`). The operator can edit it but not add more.
6885
+ * `multi` — the operator may register several instances (e.g. a second
6886
+ * `recordings` on a NAS for disk tiering); one is the default at any time.
6887
+ */
6888
+ cardinality: _enum(["single", "multi"]),
6889
+ /**
6890
+ * When set, the default instance for this location inherits its resolved
6891
+ * root from the named location's default instance. Useful for derivative
6892
+ * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
6893
+ * configure the primary location.
6894
+ */
6895
+ defaultsTo: string().optional()
6896
+ });
6897
+ var DecoderStatsSchema = object({
6898
+ inputFps: number(),
6899
+ outputFps: number(),
6900
+ avgDecodeTimeMs: number(),
6901
+ droppedFrames: number()
6902
+ });
6903
+ var DecoderSessionConfigSchema = object({
6904
+ codec: string(),
6905
+ maxFps: number().default(0),
6906
+ outputFormat: _enum([
6907
+ "jpeg",
6908
+ "rgb",
6909
+ "bgr",
6910
+ "yuv420",
6911
+ "gray"
6912
+ ]).default("jpeg"),
6913
+ scale: number().default(1),
6914
+ width: number().optional(),
6915
+ height: number().optional(),
6926
6916
  /**
6927
- * Device supports an on-demand re-sync of its derived spec with its
6928
- * upstream source drives the generic Re-sync button. The owning
6929
- * provider implements the action via the `device-adoption.resync` cap.
6917
+ * Identifier of the camera this decoder session serves. Optional
6918
+ * because the cap is generic (any caller could request decode), but
6919
+ * stream-broker passes it so decoder logs include `deviceId` for
6920
+ * per-camera filtering when diagnosing failures (e.g. node-av
6921
+ * sendPacket errors on a single hung camera).
6930
6922
  */
6931
- DeviceFeature["Resyncable"] = "resyncable";
6932
- DeviceFeature["NativeSnapshot"] = "native-snapshot";
6933
- DeviceFeature["DoorbellButton"] = "doorbell-button";
6934
- DeviceFeature["TwoWayAudio"] = "two-way-audio";
6935
- DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6923
+ deviceId: number().int().nonnegative().optional(),
6936
6924
  /**
6937
- * Camera supports the on-firmware autotrack subsystem (subject-
6938
- * following). Distinct from `PanTiltZoom` because not every PTZ
6939
- * camera ships autotrack the admin UI uses this flag to gate
6940
- * the autotrack toggle / settings card without re-deriving from
6941
- * the cap registry. Mirrors `ptz-autotrack` cap registration:
6942
- * driver sets this feature when probe confirms the firmware
6943
- * surface, and registers the cap in the same code path.
6925
+ * Free-form tag for log scoping. Stream-broker uses
6926
+ * `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
6927
+ * on every line so `grep tag=broker:5/high` filters one camera
6928
+ * profile cleanly.
6944
6929
  */
6945
- DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6930
+ tag: string().optional(),
6946
6931
  /**
6947
- * Accessory exposes a "trigger on motion" toggle the parent camera's
6948
- * motion detection automatically activates this device. Mirrors
6949
- * `motion-trigger` cap registration: drivers set this feature in the
6950
- * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6932
+ * Where the session delivers decoded frames (Phase 5 / D9):
6951
6933
  *
6952
- * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6953
- * fast scalar without binding fetch), notifier rules, and `listAll`
6954
- * filters that want "all devices with on-motion behaviour".
6934
+ * - `'callback'` (default) the legacy pixel path: decoded frames are
6935
+ * buffered as `DecodedFrame`s and drained via `pullFrames`.
6936
+ * - `'shm'` the shared-memory frame plane: decoded frames are written
6937
+ * into an OS shared-memory ring and drained as zero-pixel
6938
+ * `FrameHandle`s via `pullHandles`. A session is one mode or the
6939
+ * other — `pullFrames` returns nothing for an `'shm'` session and
6940
+ * `pullHandles` returns nothing for a `'callback'` session.
6955
6941
  */
6956
- DeviceFeature["MotionTrigger"] = "motion-trigger";
6957
- /** Light supports rgb-triplet color via `color` cap. */
6958
- DeviceFeature["LightColorRgb"] = "light-color-rgb";
6959
- /** Light supports HSV color via `color` cap. */
6960
- DeviceFeature["LightColorHsv"] = "light-color-hsv";
6961
- /** Light supports color-temperature (mired) via `color` cap. */
6962
- DeviceFeature["LightColorMired"] = "light-color-mired";
6963
- /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6964
- * targetHigh). Gates the range slider UI. */
6965
- DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6966
- /** Thermostat exposes target humidity and/or current humidity
6967
- * readings. Gates the humidity controls. */
6968
- DeviceFeature["ClimateHumidity"] = "climate-humidity";
6969
- /** Thermostat exposes a fan-mode selector. */
6970
- DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6971
- /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6972
- DeviceFeature["ClimatePreset"] = "climate-preset";
6973
- /** Cover exposes intermediate position control (0..100). Gates the
6974
- * position slider UI. */
6975
- DeviceFeature["CoverPositionable"] = "cover-positionable";
6976
- /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6977
- DeviceFeature["CoverTilt"] = "cover-tilt";
6978
- /** Valve exposes intermediate position control (0..100). Gates the
6979
- * position slider / drag surface UI. */
6980
- DeviceFeature["ValvePositionable"] = "valve-positionable";
6981
- /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6982
- DeviceFeature["FanSpeed"] = "fan-speed";
6983
- /** Fan exposes a preset mode selector. */
6984
- DeviceFeature["FanPreset"] = "fan-preset";
6985
- /** Fan exposes blade direction (forward/reverse) — typical of
6986
- * ceiling fans. */
6987
- DeviceFeature["FanDirection"] = "fan-direction";
6988
- /** Fan exposes an oscillation toggle. */
6989
- DeviceFeature["FanOscillating"] = "fan-oscillating";
6990
- /** Lock requires a PIN code on lock/unlock. Gates the code-entry
6991
- * field on the UI lock-controls panel. */
6992
- DeviceFeature["LockPinRequired"] = "lock-pin-required";
6993
- /** Lock supports a latch-release ("open door") action distinct from
6994
- * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
6995
- * `supported_features`. Gates the Open Door button in the UI. */
6996
- DeviceFeature["LockOpen"] = "lock-open";
6997
- /** Media player exposes a seek-to-position surface. */
6998
- DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
6999
- /** Media player exposes a volume-level setter. */
7000
- DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
7001
- /** Media player exposes a mute toggle distinct from volume=0. */
7002
- DeviceFeature["MediaPlayerMute"] = "media-player-mute";
7003
- /** Media player exposes a shuffle toggle. */
7004
- DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
7005
- /** Media player exposes a repeat mode (off / all / one). */
7006
- DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
7007
- /** Media player exposes a source / input selector. */
7008
- DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
7009
- /** Media player exposes a play-arbitrary-media surface (URL / id). */
7010
- DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
7011
- /** Media player exposes next-track. */
7012
- DeviceFeature["MediaPlayerNext"] = "media-player-next";
7013
- /** Media player exposes previous-track. */
7014
- DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
7015
- /** Media player exposes stop distinct from pause. */
7016
- DeviceFeature["MediaPlayerStop"] = "media-player-stop";
7017
- /** Alarm panel requires a PIN code on arm/disarm. */
7018
- DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
7019
- /** Presence device carries GPS coordinates (lat/lng/accuracy) in
7020
- * addition to a textual location. */
7021
- DeviceFeature["PresenceGps"] = "presence-gps";
7022
- /** Notifier accepts an inline / URL image attachment. */
7023
- DeviceFeature["NotifierImage"] = "notifier-image";
7024
- /** Notifier accepts a priority hint (high/normal/low). */
7025
- DeviceFeature["NotifierPriority"] = "notifier-priority";
7026
- /** Notifier accepts a free-form `data` payload for platform-specific
7027
- * fields. */
7028
- DeviceFeature["NotifierData"] = "notifier-data";
7029
- /** Notifier supports interactive action buttons / callbacks. */
7030
- DeviceFeature["NotifierActions"] = "notifier-actions";
7031
- /** Notifier supports per-call recipient targeting (multi-user). */
7032
- DeviceFeature["NotifierRecipients"] = "notifier-recipients";
7033
- /** Script runner accepts a variables map on each run invocation. */
7034
- DeviceFeature["ScriptVariables"] = "script-variables";
7035
- /** Automation `trigger` accepts a skipCondition flag — fires the
7036
- * automation's actions while bypassing its condition block. */
7037
- DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
7038
- return DeviceFeature;
7039
- }({});
7040
- /**
7041
- * Semantic role a device plays within its parent. Populated by driver
7042
- * addons when creating accessory devices (Reolink siren/floodlight/
7043
- * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
7044
- * admin UI to pick icons, labels, and widgets — a `Switch` with
7045
- * `role: Floodlight` renders as a bulb with a brightness slider,
7046
- * whereas a `Switch` with `role: Siren` renders as a klaxon.
7047
- *
7048
- * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
7049
- * sqlite as a nullable TEXT column — old rows keep working unchanged.
7050
- */
7051
- var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
7052
- DeviceRole["Siren"] = "siren";
7053
- DeviceRole["Floodlight"] = "floodlight";
7054
- DeviceRole["Spotlight"] = "spotlight";
7055
- DeviceRole["PirSensor"] = "pir-sensor";
7056
- DeviceRole["Chime"] = "chime";
7057
- DeviceRole["Autotrack"] = "autotrack";
7058
- DeviceRole["Nightvision"] = "nightvision";
7059
- DeviceRole["PrivacyMask"] = "privacy-mask";
7060
- DeviceRole["Doorbell"] = "doorbell";
7061
- /** Virtual HA toggle (input_boolean.*) — distinguishable from a
7062
- * real Switch device for UI rendering / export adapters. */
7063
- DeviceRole["BinaryHelper"] = "binary-helper";
7064
- /** Generic motion / occupancy / moving event source. Distinct from
7065
- * the camera accessory PirSensor role: that one is a camera child;
7066
- * this is a standalone HA / 3rd-party motion sensor. */
7067
- DeviceRole["MotionSensor"] = "motion-sensor";
7068
- DeviceRole["ContactSensor"] = "contact-sensor";
7069
- DeviceRole["LeakSensor"] = "leak-sensor";
7070
- DeviceRole["SmokeSensor"] = "smoke-sensor";
7071
- DeviceRole["COSensor"] = "co-sensor";
7072
- DeviceRole["GasSensor"] = "gas-sensor";
7073
- DeviceRole["TamperSensor"] = "tamper-sensor";
7074
- DeviceRole["VibrationSensor"] = "vibration-sensor";
7075
- DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
7076
- DeviceRole["SoundSensor"] = "sound-sensor";
7077
- /** Fallback for `binary_sensor` without a known `device_class`. */
7078
- DeviceRole["BinarySensor"] = "binary-sensor";
7079
- DeviceRole["TemperatureSensor"] = "temperature-sensor";
7080
- DeviceRole["HumiditySensor"] = "humidity-sensor";
7081
- DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
7082
- DeviceRole["PressureSensor"] = "pressure-sensor";
7083
- DeviceRole["PowerSensor"] = "power-sensor";
7084
- DeviceRole["EnergySensor"] = "energy-sensor";
7085
- DeviceRole["VoltageSensor"] = "voltage-sensor";
7086
- DeviceRole["CurrentSensor"] = "current-sensor";
7087
- DeviceRole["AirQualitySensor"] = "air-quality-sensor";
7088
- /** Battery level (numeric % via `sensor` OR low-bool via
7089
- * `binary_sensor` — the cap distinguishes via the value type). */
7090
- DeviceRole["BatterySensor"] = "battery-sensor";
7091
- /** Fallback for `sensor` numeric without a known `device_class`. */
7092
- DeviceRole["NumericSensor"] = "numeric-sensor";
7093
- /** String / enum state (HA `sensor` with `state_class: enum` or
7094
- * `attributes.options`). */
7095
- DeviceRole["EnumSensor"] = "enum-sensor";
7096
- /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
7097
- * or `date`). The slice carries the raw ISO string verbatim (hosted on
7098
- * the `enum-sensor` cap); the UI renders it locale-formatted. */
7099
- DeviceRole["DateTimeSensor"] = "datetime-sensor";
7100
- /** Last-resort fallback when nothing else matches. */
7101
- DeviceRole["GenericSensor"] = "generic-sensor";
7102
- DeviceRole["NumericControl"] = "numeric-control";
7103
- DeviceRole["SelectControl"] = "select-control";
7104
- DeviceRole["TextControl"] = "text-control";
7105
- DeviceRole["DateTimeControl"] = "datetime-control";
7106
- /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
7107
- * rich features (image, priority, channel routing). */
7108
- DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
7109
- /** Chat / messaging service (HA `notify.telegram_*`,
7110
- * `notify.discord_*`, etc.). */
7111
- DeviceRole["MessagingNotifier"] = "messaging-notifier";
7112
- /** Email-based delivery (HA `notify.smtp`, etc.). */
7113
- DeviceRole["EmailNotifier"] = "email-notifier";
7114
- /** Fallback when the notifier service name doesn't match a known
7115
- * pattern. */
7116
- DeviceRole["GenericNotifier"] = "generic-notifier";
7117
- return DeviceRole;
7118
- }({});
6942
+ frameSink: _enum(["callback", "shm"]).default("callback")
6943
+ });
6944
+ var EncodeProfileSchema = object({
6945
+ video: object({
6946
+ codec: _enum([
6947
+ "h264",
6948
+ "h265",
6949
+ "copy"
6950
+ ]),
6951
+ profile: _enum([
6952
+ "baseline",
6953
+ "main",
6954
+ "high"
6955
+ ]).optional(),
6956
+ width: number().int().positive().optional(),
6957
+ height: number().int().positive().optional(),
6958
+ fps: number().positive().optional(),
6959
+ bitrateKbps: number().int().positive().optional(),
6960
+ gopFrames: number().int().positive().optional(),
6961
+ bf: number().int().min(0).optional(),
6962
+ preset: _enum([
6963
+ "ultrafast",
6964
+ "superfast",
6965
+ "veryfast",
6966
+ "faster",
6967
+ "fast",
6968
+ "medium"
6969
+ ]).optional(),
6970
+ tune: _enum([
6971
+ "zerolatency",
6972
+ "film",
6973
+ "animation"
6974
+ ]).optional()
6975
+ }),
6976
+ audio: union([literal("passthrough"), object({
6977
+ codec: _enum([
6978
+ "opus",
6979
+ "aac",
6980
+ "pcmu",
6981
+ "pcma",
6982
+ "copy"
6983
+ ]),
6984
+ bitrateKbps: number().int().positive().optional(),
6985
+ sampleRateHz: number().int().positive().optional(),
6986
+ channels: union([literal(1), literal(2)]).optional()
6987
+ })]),
6988
+ /**
6989
+ * ffmpeg input-side args, inserted between the fixed global flags
6990
+ * (`-hide_banner -loglevel error`) and `-i pipe:0`. Free-text array
6991
+ * the widget surfaces a textarea + suggestion chips for the most-
6992
+ * used demuxer/format options.
6993
+ */
6994
+ inputArgs: array(string()).optional(),
6995
+ /**
6996
+ * ffmpeg output-side args, inserted between the encode block and
6997
+ * the final `-f <muxer> pipe:1`. Use for muxer options, bitstream
6998
+ * filters, codec-specific overrides. Free-text array.
6999
+ */
7000
+ outputArgs: array(string()).optional()
7001
+ });
7002
+ var YAMNET_TO_MACRO = {
7003
+ mapping: {
7004
+ Speech: "speech",
7005
+ "Child speech, kid speaking": "speech",
7006
+ Conversation: "speech",
7007
+ "Narration, monologue": "speech",
7008
+ Babbling: "speech",
7009
+ Whispering: "speech",
7010
+ "Speech synthesizer": "speech",
7011
+ Humming: "speech",
7012
+ Rapping: "speech",
7013
+ Singing: "speech",
7014
+ Choir: "speech",
7015
+ "Child singing": "speech",
7016
+ Shout: "scream",
7017
+ Bellow: "scream",
7018
+ Yell: "scream",
7019
+ Screaming: "scream",
7020
+ "Children shouting": "scream",
7021
+ Whoop: "scream",
7022
+ "Crying, sobbing": "crying",
7023
+ "Baby cry, infant cry": "crying",
7024
+ Whimper: "crying",
7025
+ "Wail, moan": "crying",
7026
+ Groan: "crying",
7027
+ Laughter: "laughter",
7028
+ "Baby laughter": "laughter",
7029
+ Giggle: "laughter",
7030
+ Snicker: "laughter",
7031
+ "Belly laugh": "laughter",
7032
+ "Chuckle, chortle": "laughter",
7033
+ Music: "music",
7034
+ "Musical instrument": "music",
7035
+ Guitar: "music",
7036
+ Piano: "music",
7037
+ Drum: "music",
7038
+ "Drum kit": "music",
7039
+ "Violin, fiddle": "music",
7040
+ Flute: "music",
7041
+ Saxophone: "music",
7042
+ Trumpet: "music",
7043
+ Synthesizer: "music",
7044
+ "Pop music": "music",
7045
+ "Rock music": "music",
7046
+ "Hip hop music": "music",
7047
+ "Classical music": "music",
7048
+ Jazz: "music",
7049
+ "Electronic music": "music",
7050
+ "Background music": "music",
7051
+ Dog: "dog",
7052
+ Bark: "dog",
7053
+ Yip: "dog",
7054
+ Howl: "dog",
7055
+ "Bow-wow": "dog",
7056
+ Growling: "dog",
7057
+ "Whimper (dog)": "dog",
7058
+ Cat: "cat",
7059
+ Purr: "cat",
7060
+ Meow: "cat",
7061
+ Hiss: "cat",
7062
+ Caterwaul: "cat",
7063
+ Bird: "bird",
7064
+ "Bird vocalization, bird call, bird song": "bird",
7065
+ "Chirp, tweet": "bird",
7066
+ Squawk: "bird",
7067
+ Crow: "bird",
7068
+ Owl: "bird",
7069
+ "Pigeon, dove": "bird",
7070
+ Animal: "animal",
7071
+ "Domestic animals, pets": "animal",
7072
+ "Livestock, farm animals, working animals": "animal",
7073
+ Horse: "animal",
7074
+ "Cattle, bovinae": "animal",
7075
+ Pig: "animal",
7076
+ Sheep: "animal",
7077
+ Goat: "animal",
7078
+ Frog: "animal",
7079
+ Insect: "animal",
7080
+ Cricket: "animal",
7081
+ Alarm: "alarm",
7082
+ "Alarm clock": "alarm",
7083
+ "Smoke detector, smoke alarm": "alarm",
7084
+ "Fire alarm": "alarm",
7085
+ Buzzer: "alarm",
7086
+ "Civil defense siren": "alarm",
7087
+ "Car alarm": "alarm",
7088
+ Siren: "siren",
7089
+ "Police car (siren)": "siren",
7090
+ "Ambulance (siren)": "siren",
7091
+ "Fire engine, fire truck (siren)": "siren",
7092
+ "Emergency vehicle": "siren",
7093
+ Foghorn: "siren",
7094
+ Doorbell: "doorbell",
7095
+ "Ding-dong": "doorbell",
7096
+ Knock: "doorbell",
7097
+ Tap: "doorbell",
7098
+ Glass: "glass_breaking",
7099
+ Shatter: "glass_breaking",
7100
+ "Chink, clink": "glass_breaking",
7101
+ "Gunshot, gunfire": "gunshot",
7102
+ "Machine gun": "gunshot",
7103
+ Explosion: "gunshot",
7104
+ Fireworks: "gunshot",
7105
+ Firecracker: "gunshot",
7106
+ "Artillery fire": "gunshot",
7107
+ "Cap gun": "gunshot",
7108
+ Boom: "gunshot",
7109
+ Vehicle: "vehicle",
7110
+ Car: "vehicle",
7111
+ Truck: "vehicle",
7112
+ Bus: "vehicle",
7113
+ Motorcycle: "vehicle",
7114
+ "Car passing by": "vehicle",
7115
+ "Vehicle horn, car horn, honking": "vehicle",
7116
+ "Traffic noise, roadway noise": "vehicle",
7117
+ Train: "vehicle",
7118
+ Aircraft: "vehicle",
7119
+ Helicopter: "vehicle",
7120
+ Bicycle: "vehicle",
7121
+ Skateboard: "vehicle",
7122
+ Fire: "fire",
7123
+ Crackle: "fire",
7124
+ Water: "water",
7125
+ Rain: "water",
7126
+ Raindrop: "water",
7127
+ "Rain on surface": "water",
7128
+ Stream: "water",
7129
+ Waterfall: "water",
7130
+ Ocean: "water",
7131
+ "Waves, surf": "water",
7132
+ "Splash, splatter": "water",
7133
+ Wind: "wind",
7134
+ Thunderstorm: "wind",
7135
+ Thunder: "wind",
7136
+ "Wind noise (microphone)": "wind",
7137
+ "Rustling leaves": "wind",
7138
+ Door: "door",
7139
+ "Sliding door": "door",
7140
+ Slam: "door",
7141
+ "Cupboard open or close": "door",
7142
+ "Walk, footsteps": "footsteps",
7143
+ Run: "footsteps",
7144
+ Shuffle: "footsteps",
7145
+ Crowd: "crowd",
7146
+ Chatter: "crowd",
7147
+ Cheering: "crowd",
7148
+ Applause: "crowd",
7149
+ "Children playing": "crowd",
7150
+ "Hubbub, speech noise, speech babble": "crowd",
7151
+ Telephone: "telephone",
7152
+ "Telephone bell ringing": "telephone",
7153
+ Ringtone: "telephone",
7154
+ "Telephone dialing, DTMF": "telephone",
7155
+ "Busy signal": "telephone",
7156
+ Engine: "engine",
7157
+ "Engine starting": "engine",
7158
+ Idling: "engine",
7159
+ "Accelerating, revving, vroom": "engine",
7160
+ "Light engine (high frequency)": "engine",
7161
+ "Medium engine (mid frequency)": "engine",
7162
+ "Heavy engine (low frequency)": "engine",
7163
+ "Lawn mower": "engine",
7164
+ Chainsaw: "engine",
7165
+ Hammer: "tools",
7166
+ Jackhammer: "tools",
7167
+ Sawing: "tools",
7168
+ "Power tool": "tools",
7169
+ Drill: "tools",
7170
+ Sanding: "tools",
7171
+ Silence: "silence"
7172
+ },
7173
+ preserveOriginal: false
7174
+ };
7175
+ var APPLE_SA_TO_MACRO = {
7176
+ mapping: {
7177
+ speech: "speech",
7178
+ child_speech: "speech",
7179
+ conversation: "speech",
7180
+ whispering: "speech",
7181
+ singing: "speech",
7182
+ humming: "speech",
7183
+ shout: "scream",
7184
+ yell: "scream",
7185
+ screaming: "scream",
7186
+ crying: "crying",
7187
+ baby_crying: "crying",
7188
+ sobbing: "crying",
7189
+ laughter: "laughter",
7190
+ baby_laughter: "laughter",
7191
+ giggling: "laughter",
7192
+ music: "music",
7193
+ guitar: "music",
7194
+ piano: "music",
7195
+ drums: "music",
7196
+ dog_bark: "dog",
7197
+ dog_bow_wow: "dog",
7198
+ dog_growling: "dog",
7199
+ dog_howl: "dog",
7200
+ cat_meow: "cat",
7201
+ cat_purr: "cat",
7202
+ cat_hiss: "cat",
7203
+ bird: "bird",
7204
+ bird_chirp: "bird",
7205
+ bird_squawk: "bird",
7206
+ animal: "animal",
7207
+ horse: "animal",
7208
+ cow_moo: "animal",
7209
+ insect: "animal",
7210
+ alarm: "alarm",
7211
+ smoke_alarm: "alarm",
7212
+ fire_alarm: "alarm",
7213
+ car_alarm: "alarm",
7214
+ siren: "siren",
7215
+ police_siren: "siren",
7216
+ ambulance_siren: "siren",
7217
+ doorbell: "doorbell",
7218
+ door_knock: "doorbell",
7219
+ knocking: "doorbell",
7220
+ glass_breaking: "glass_breaking",
7221
+ glass_shatter: "glass_breaking",
7222
+ gunshot: "gunshot",
7223
+ explosion: "gunshot",
7224
+ fireworks: "gunshot",
7225
+ car: "vehicle",
7226
+ truck: "vehicle",
7227
+ motorcycle: "vehicle",
7228
+ car_horn: "vehicle",
7229
+ vehicle_horn: "vehicle",
7230
+ traffic: "vehicle",
7231
+ fire: "fire",
7232
+ fire_crackle: "fire",
7233
+ water: "water",
7234
+ rain: "water",
7235
+ ocean: "water",
7236
+ splash: "water",
7237
+ wind: "wind",
7238
+ thunder: "wind",
7239
+ thunderstorm: "wind",
7240
+ door: "door",
7241
+ door_slam: "door",
7242
+ sliding_door: "door",
7243
+ footsteps: "footsteps",
7244
+ walking: "footsteps",
7245
+ running: "footsteps",
7246
+ crowd: "crowd",
7247
+ chatter: "crowd",
7248
+ cheering: "crowd",
7249
+ applause: "crowd",
7250
+ telephone_ring: "telephone",
7251
+ ringtone: "telephone",
7252
+ engine: "engine",
7253
+ engine_starting: "engine",
7254
+ lawn_mower: "engine",
7255
+ chainsaw: "engine",
7256
+ hammer: "tools",
7257
+ jackhammer: "tools",
7258
+ drill: "tools",
7259
+ power_tool: "tools",
7260
+ silence: "silence"
7261
+ },
7262
+ preserveOriginal: false
7263
+ };
7264
+ var _macroLookup = /* @__PURE__ */ new Map();
7265
+ for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7266
+ for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7119
7267
  /**
7120
7268
  * Accessory device helpers — shared across drivers.
7121
7269
  *
@@ -7569,78 +7717,6 @@ var airQualitySensorCapability = {
7569
7717
  runtimeState: AirQualitySensorStatusSchema
7570
7718
  };
7571
7719
  /**
7572
- * Generic types for capability definitions.
7573
- *
7574
- * A capability is defined with Zod schemas for methods, events, and settings.
7575
- * TypeScript types are inferred via z.infer<> — zero duplication.
7576
- *
7577
- * Pattern:
7578
- * 1. Define Zod schemas for data, methods, settings
7579
- * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
7580
- * 3. Export type IProvider = InferProvider<typeof capabilityDef>
7581
- * 4. Addon implements IProvider
7582
- * 5. Registry auto-mounts tRPC router from definition.methods
7583
- */
7584
- /**
7585
- * Output schema shared by the contribution + live methods.
7586
- *
7587
- * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
7588
- * tabs[]) without importing from `../interfaces/config-ui.js` — a
7589
- * concrete-but-lenient Zod object keeps tRPC output inference happy
7590
- * (using `z.unknown()` here collapses unrelated router branches to
7591
- * `unknown` when the generator re-inlines the huge AppRouter type).
7592
- *
7593
- * `.passthrough()` on sections/fields accepts whatever FormBuilder
7594
- * extensions the caller adds (showWhen, displayScale, …) without
7595
- * rebuilding every time a new field kind is introduced.
7596
- */
7597
- var ContributionSectionSchema = object({
7598
- id: string(),
7599
- title: string(),
7600
- description: string().optional(),
7601
- style: _enum(["card", "accordion"]).optional(),
7602
- defaultCollapsed: boolean().optional(),
7603
- columns: union([
7604
- literal(1),
7605
- literal(2),
7606
- literal(3),
7607
- literal(4)
7608
- ]).optional(),
7609
- tab: string().optional(),
7610
- location: _enum(["settings", "top-tab"]).optional(),
7611
- order: number().optional(),
7612
- fields: array(any())
7613
- });
7614
- object({
7615
- tabs: array(object({
7616
- id: string(),
7617
- label: string(),
7618
- icon: string(),
7619
- order: number().optional()
7620
- })).optional(),
7621
- sections: array(ContributionSectionSchema)
7622
- }).nullable();
7623
- object({ deviceId: number() }), object({ deviceId: number() }), object({
7624
- deviceId: number(),
7625
- patch: record(string(), unknown())
7626
- }), object({ success: literal(true) });
7627
- object({ deviceId: number() }), unknown().nullable();
7628
- /** Shorthand to define a method schema */
7629
- function method(input, output, options) {
7630
- return {
7631
- input,
7632
- output,
7633
- kind: options?.kind ?? "query",
7634
- auth: options?.auth ?? "protected",
7635
- ...options?.access !== void 0 ? { access: options.access } : {},
7636
- timeoutMs: options?.timeoutMs
7637
- };
7638
- }
7639
- /** Shorthand to define an event schema */
7640
- function event(data) {
7641
- return { data };
7642
- }
7643
- /**
7644
7720
  * Alarm-panel cap. Models HA `alarm_control_panel.*` on
7645
7721
  * `DeviceType.AlarmPanel`. State follows HA's canonical lifecycle
7646
7722
  * across disarmed / armed_(home|away|night|vacation|custom_bypass) /
@@ -10401,6 +10477,24 @@ var DetectorOutputSchema = object({
10401
10477
  inferenceMs: number(),
10402
10478
  modelId: string()
10403
10479
  });
10480
+ var EngineProvisioningSchema = object({
10481
+ runtimeId: _enum([
10482
+ "onnx",
10483
+ "openvino",
10484
+ "coreml"
10485
+ ]).nullable(),
10486
+ device: string().nullable(),
10487
+ state: _enum([
10488
+ "idle",
10489
+ "installing",
10490
+ "verifying",
10491
+ "ready",
10492
+ "failed"
10493
+ ]),
10494
+ progress: number().optional(),
10495
+ error: string().optional(),
10496
+ nextRetryAt: number().optional()
10497
+ });
10404
10498
  var PipelineStepInputSchema = lazy(() => object({
10405
10499
  addonId: string(),
10406
10500
  modelId: string(),
@@ -10469,7 +10563,7 @@ var PipelineRunResultBridge = custom();
10469
10563
  method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(_void(), PipelineEngineChoiceSchema, {
10470
10564
  kind: "mutation",
10471
10565
  auth: "admin"
10472
- }), method(_void(), record(string(), object({
10566
+ }), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
10473
10567
  modelId: string(),
10474
10568
  settings: record(string(), unknown()).readonly()
10475
10569
  }))), method(object({ steps: record(string(), object({
@@ -14139,9 +14233,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
14139
14233
  limit: number().optional(),
14140
14234
  tags: record(string(), string()).optional()
14141
14235
  }), array(LogEntrySchema).readonly());
14142
- var StaticDirOutputSchema = object({ staticDir: string() });
14143
- var VersionOutputSchema = object({ version: string() });
14144
- method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
14145
14236
  /**
14146
14237
  * Zod schemas for persisted record types.
14147
14238
  *
@@ -15691,7 +15782,10 @@ var AgentAddonConfigSchema = object({
15691
15782
  modelId: string(),
15692
15783
  settings: record(string(), unknown()).readonly()
15693
15784
  });
15694
- var AgentPipelineSettingsSchema = object({ addonDefaults: record(string(), AgentAddonConfigSchema).readonly() });
15785
+ var AgentPipelineSettingsSchema = object({
15786
+ addonDefaults: record(string(), AgentAddonConfigSchema).readonly(),
15787
+ maxCameras: number().int().nonnegative().nullable().default(null)
15788
+ });
15695
15789
  var CameraPipelineForAgentSchema = object({
15696
15790
  steps: array(PipelineStepInputSchema).readonly(),
15697
15791
  audio: object({
@@ -15793,6 +15887,133 @@ var GlobalMetricsSchema = object({
15793
15887
  * capability providers.
15794
15888
  */
15795
15889
  var CapabilityBindingsSchema = record(string(), string());
15890
+ /** Source block — always present; derives from the stream catalog. */
15891
+ var CameraSourceStatusSchema = object({ streams: array(object({
15892
+ camStreamId: string(),
15893
+ codec: string(),
15894
+ width: number(),
15895
+ height: number(),
15896
+ fps: number(),
15897
+ kind: string()
15898
+ })).readonly() });
15899
+ /** Assignment block — always present (orchestrator-local, no remote call). */
15900
+ var CameraAssignmentStatusSchema = object({
15901
+ detectionNodeId: string().nullable(),
15902
+ decoderNodeId: string().nullable(),
15903
+ audioNodeId: string().nullable(),
15904
+ pinned: object({
15905
+ detection: boolean(),
15906
+ decoder: boolean(),
15907
+ audio: boolean()
15908
+ }),
15909
+ reasons: object({
15910
+ detection: string().optional(),
15911
+ decoder: string().optional(),
15912
+ audio: string().optional()
15913
+ })
15914
+ });
15915
+ /** Broker block — null when the broker stage is unreachable or inactive. */
15916
+ var CameraBrokerStatusSchema = object({
15917
+ profiles: array(object({
15918
+ profile: string(),
15919
+ status: string(),
15920
+ codec: string(),
15921
+ width: number(),
15922
+ height: number(),
15923
+ subscribers: number(),
15924
+ inFps: number(),
15925
+ outFps: number()
15926
+ })).readonly(),
15927
+ webrtcSessions: number(),
15928
+ rtspRestream: boolean()
15929
+ });
15930
+ /** Shared-memory ring statistics within the decoder block. */
15931
+ var CameraDecoderShmSchema = object({
15932
+ framesWritten: number(),
15933
+ getFrameHits: number(),
15934
+ getFrameMisses: number(),
15935
+ budgetMb: number()
15936
+ });
15937
+ /** Decoder block — null when the decoder stage is unreachable or inactive. */
15938
+ var CameraDecoderStatusSchema = object({
15939
+ nodeId: string(),
15940
+ formats: array(string()).readonly(),
15941
+ sessionCount: number(),
15942
+ shm: CameraDecoderShmSchema
15943
+ });
15944
+ /** Motion block — null when motion detection is not active for this device. */
15945
+ var CameraMotionStatusSchema = object({
15946
+ enabled: boolean(),
15947
+ fps: number()
15948
+ });
15949
+ /** Detection provisioning sub-block. */
15950
+ var CameraDetectionProvisioningSchema = object({
15951
+ state: _enum([
15952
+ "idle",
15953
+ "installing",
15954
+ "verifying",
15955
+ "ready",
15956
+ "failed"
15957
+ ]),
15958
+ error: string().optional()
15959
+ });
15960
+ /** Detection phase — derived from the runner's engine phase. */
15961
+ var CameraDetectionPhaseSchema = _enum([
15962
+ "idle",
15963
+ "watching",
15964
+ "active"
15965
+ ]);
15966
+ /** Detection block — null when no detection node is assigned or reachable. */
15967
+ var CameraDetectionStatusSchema = object({
15968
+ nodeId: string(),
15969
+ engine: object({
15970
+ backend: string(),
15971
+ device: string()
15972
+ }),
15973
+ phase: CameraDetectionPhaseSchema,
15974
+ configuredFps: number(),
15975
+ actualFps: number(),
15976
+ queueDepth: number(),
15977
+ avgInferenceMs: number(),
15978
+ provisioning: CameraDetectionProvisioningSchema
15979
+ });
15980
+ /** Audio block — null when no audio node is assigned or reachable. */
15981
+ var CameraAudioStatusSchema = object({
15982
+ nodeId: string(),
15983
+ enabled: boolean()
15984
+ });
15985
+ /** Recording block — null when no recording cap is active for this device. */
15986
+ var CameraRecordingStatusSchema = object({
15987
+ mode: _enum([
15988
+ "off",
15989
+ "continuous",
15990
+ "events"
15991
+ ]),
15992
+ active: boolean(),
15993
+ storageBytes: number()
15994
+ });
15995
+ /**
15996
+ * Aggregated per-camera pipeline status — server-composed, single call.
15997
+ *
15998
+ * The `assignment` and `source` blocks are always present.
15999
+ * Every other block is `null` when the stage is inactive or unreachable
16000
+ * during the bounded parallel fan-out in the orchestrator implementation.
16001
+ *
16002
+ * See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
16003
+ */
16004
+ var CameraStatusSchema = object({
16005
+ deviceId: number(),
16006
+ assignment: CameraAssignmentStatusSchema,
16007
+ source: CameraSourceStatusSchema,
16008
+ broker: CameraBrokerStatusSchema.nullable(),
16009
+ decoder: CameraDecoderStatusSchema.nullable(),
16010
+ motion: CameraMotionStatusSchema.nullable(),
16011
+ detection: CameraDetectionStatusSchema.nullable(),
16012
+ audio: CameraAudioStatusSchema.nullable(),
16013
+ recording: CameraRecordingStatusSchema.nullable(),
16014
+ /** Unix timestamp (ms) when this snapshot was composed server-side. */
16015
+ fetchedAt: number()
16016
+ });
15796
16017
  method(object({
15797
16018
  deviceId: number(),
15798
16019
  agentNodeId: string()
@@ -15860,6 +16081,12 @@ method(object({
15860
16081
  }), {
15861
16082
  kind: "mutation",
15862
16083
  auth: "admin"
16084
+ }), method(object({
16085
+ agentNodeId: string(),
16086
+ maxCameras: number().int().nonnegative().nullable()
16087
+ }), object({ success: literal(true) }), {
16088
+ kind: "mutation",
16089
+ auth: "admin"
15863
16090
  }), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
15864
16091
  deviceId: number(),
15865
16092
  addonId: string(),
@@ -15885,7 +16112,7 @@ method(object({
15885
16112
  }), method(object({
15886
16113
  deviceId: number(),
15887
16114
  agentNodeId: string().optional()
15888
- }), CameraPipelineConfigSchema), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
16115
+ }), CameraPipelineConfigSchema), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
15889
16116
  name: string(),
15890
16117
  description: string().optional(),
15891
16118
  config: CameraPipelineConfigSchema
@@ -16372,7 +16599,7 @@ method(object({
16372
16599
  }), _void(), {
16373
16600
  kind: "mutation",
16374
16601
  auth: "admin"
16375
- }), 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({
16602
+ }), 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({
16376
16603
  deviceId: number(),
16377
16604
  values: record(string(), unknown())
16378
16605
  }), object({ success: literal(true) }), {
@@ -17054,7 +17281,20 @@ var DiskSpaceInfoSchema = object({
17054
17281
  var PidResourceStatsSchema = object({
17055
17282
  pid: number(),
17056
17283
  cpu: number(),
17057
- memory: number()
17284
+ memory: number(),
17285
+ /**
17286
+ * Private (anonymous) resident bytes — the per-process V8 heap + native
17287
+ * allocations NOT shared with other processes (Linux RssAnon). This is the
17288
+ * "real" per-runner cost; summing it across runners is meaningful, unlike
17289
+ * `memory` (RSS), which double-counts the shared mmap'd framework code.
17290
+ * Undefined where /proc is unavailable (e.g. macOS).
17291
+ */
17292
+ privateBytes: number().optional(),
17293
+ /**
17294
+ * Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
17295
+ * code shared copy-on-write across runners. Undefined on macOS.
17296
+ */
17297
+ sharedBytes: number().optional()
17058
17298
  });
17059
17299
  var AddonInstanceSchema = object({
17060
17300
  addonId: string(),
@@ -17103,6 +17343,17 @@ var KillProcessResultSchema = object({
17103
17343
  reason: string().optional(),
17104
17344
  signal: _enum(["SIGTERM", "SIGKILL"]).optional()
17105
17345
  });
17346
+ var DumpHeapSnapshotInputSchema = object({
17347
+ /** The addon whose runner should dump a heap snapshot. */
17348
+ addonId: string() });
17349
+ var DumpHeapSnapshotResultSchema = object({
17350
+ success: boolean(),
17351
+ /** Path of the written .heapsnapshot inside the runner's container/host. */
17352
+ path: string().optional(),
17353
+ /** Process pid that was signalled. */
17354
+ pid: number().optional(),
17355
+ reason: string().optional()
17356
+ });
17106
17357
  var SystemMetricsSchema = object({
17107
17358
  cpuPercent: number(),
17108
17359
  memoryPercent: number(),
@@ -17116,6 +17367,9 @@ var SystemMetricsSchema = object({
17116
17367
  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, {
17117
17368
  kind: "mutation",
17118
17369
  auth: "admin"
17370
+ }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
17371
+ kind: "mutation",
17372
+ auth: "admin"
17119
17373
  });
17120
17374
  var PtzPresetSchema = object({
17121
17375
  id: string(),
@@ -17482,63 +17736,6 @@ method(object({
17482
17736
  auth: "admin"
17483
17737
  });
17484
17738
  /**
17485
- * device-ops — device-scoped cap that unifies the per-IDevice operations
17486
- * previously routed through the `.device-ops` Moleculer bridge service.
17487
- *
17488
- * Each worker that hosts live `IDevice` instances auto-registers a native
17489
- * provider for this cap (per device) backed by its local
17490
- * `DeviceRegistry`. Hub-side callers reach it transparently through
17491
- * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
17492
- * `deviceId` + `nodeId` and dispatches through the standard cap-router,
17493
- * so there's no parallel bridge path anymore.
17494
- *
17495
- * The surface is intentionally small — every method corresponds to a
17496
- * single action on the live `IDevice` (or `ICameraDevice` for
17497
- * `getStreamSources`). Richer orchestration (enable/disable with
17498
- * integration plumbing, bulk updates) stays in the `device-manager` cap;
17499
- * `device-ops` is the per-device primitive the device-manager routes to.
17500
- */
17501
- var StreamSourceEntrySchema$1 = object({
17502
- id: string(),
17503
- label: string(),
17504
- protocol: _enum([
17505
- "rtsp",
17506
- "rtmp",
17507
- "annexb",
17508
- "http-mjpeg",
17509
- "webrtc",
17510
- "custom"
17511
- ]),
17512
- url: string().optional(),
17513
- resolution: object({
17514
- width: number(),
17515
- height: number()
17516
- }).optional(),
17517
- fps: number().optional(),
17518
- bitrate: number().optional(),
17519
- codec: string().optional(),
17520
- profileHint: CamProfileSchema.optional(),
17521
- sdp: string().optional()
17522
- });
17523
- var ConfigEntrySchema$1 = object({
17524
- key: string(),
17525
- value: unknown()
17526
- });
17527
- var RawStateResultSchema = object({
17528
- /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
17529
- source: string(),
17530
- /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
17531
- data: record(string(), unknown())
17532
- });
17533
- method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
17534
- deviceId: number(),
17535
- values: record(string(), unknown())
17536
- }), _void(), { kind: "mutation" }), method(object({
17537
- deviceId: number(),
17538
- action: string().min(1),
17539
- input: unknown()
17540
- }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
17541
- /**
17542
17739
  * camera-credentials — device-scoped cap exposing the camera's network
17543
17740
  * + auth surface in a vendor-neutral shape.
17544
17741
  *
@@ -21310,6 +21507,12 @@ Object.freeze({
21310
21507
  addonId: null,
21311
21508
  access: "view"
21312
21509
  },
21510
+ "metricsProvider.dumpHeapSnapshot": {
21511
+ capName: "metrics-provider",
21512
+ capScope: "system",
21513
+ addonId: null,
21514
+ access: "create"
21515
+ },
21313
21516
  "metricsProvider.getAddonStats": {
21314
21517
  capName: "metrics-provider",
21315
21518
  capScope: "system",
@@ -21766,6 +21969,12 @@ Object.freeze({
21766
21969
  addonId: null,
21767
21970
  access: "view"
21768
21971
  },
21972
+ "pipelineExecutor.getEngineProvisioning": {
21973
+ capName: "pipeline-executor",
21974
+ capScope: "system",
21975
+ addonId: null,
21976
+ access: "view"
21977
+ },
21769
21978
  "pipelineExecutor.getGlobalPipelineConfig": {
21770
21979
  capName: "pipeline-executor",
21771
21980
  capScope: "system",
@@ -21970,6 +22179,18 @@ Object.freeze({
21970
22179
  addonId: null,
21971
22180
  access: "view"
21972
22181
  },
22182
+ "pipelineOrchestrator.getCameraStatus": {
22183
+ capName: "pipeline-orchestrator",
22184
+ capScope: "system",
22185
+ addonId: null,
22186
+ access: "view"
22187
+ },
22188
+ "pipelineOrchestrator.getCameraStatuses": {
22189
+ capName: "pipeline-orchestrator",
22190
+ capScope: "system",
22191
+ addonId: null,
22192
+ access: "view"
22193
+ },
21973
22194
  "pipelineOrchestrator.getCameraStepOverrides": {
21974
22195
  capName: "pipeline-orchestrator",
21975
22196
  capScope: "system",
@@ -22054,6 +22275,12 @@ Object.freeze({
22054
22275
  addonId: null,
22055
22276
  access: "create"
22056
22277
  },
22278
+ "pipelineOrchestrator.setAgentMaxCameras": {
22279
+ capName: "pipeline-orchestrator",
22280
+ capScope: "system",
22281
+ addonId: null,
22282
+ access: "create"
22283
+ },
22057
22284
  "pipelineOrchestrator.setCameraPipelineForAgent": {
22058
22285
  capName: "pipeline-orchestrator",
22059
22286
  capScope: "system",