@camstack/addon-provider-homeassistant 1.0.4 → 1.0.6

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