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