@camstack/addon-provider-onvif 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 +1301 -1074
  2. package/dist/addon.mjs +1301 -1074
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -4632,63 +4632,7 @@ function _instanceof(cls, params = {}) {
4632
4632
  return inst;
4633
4633
  }
4634
4634
  //#endregion
4635
- //#region ../types/dist/index.mjs
4636
- /**
4637
- * Deep wiring healthcheck — snapshot of active reachability probes across
4638
- * every declared capability + widget of every installed plugin, on every
4639
- * node. Produced by the backend `WiringHealthService` and surfaced via
4640
- * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
4641
- *
4642
- * Unlike `/health` (process liveness), this reflects whether each cap/widget
4643
- * is actually *reachable* over the real cap-dispatch path. See spec
4644
- * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
4645
- */
4646
- /** What kind of target a probe addressed. */
4647
- var wiringProbeKindSchema = _enum([
4648
- "singleton",
4649
- "device",
4650
- "widget"
4651
- ]);
4652
- /** Result of probing a single (cap|widget [, device]) target. */
4653
- var wiringProbeResultSchema = object({
4654
- capName: string(),
4655
- kind: wiringProbeKindSchema,
4656
- deviceId: number().optional(),
4657
- reachable: boolean(),
4658
- latencyMs: number(),
4659
- error: string().optional()
4660
- });
4661
- /** Per-addon roll-up of cap + widget probe results. */
4662
- var wiringAddonHealthSchema = object({
4663
- addonId: string(),
4664
- caps: array(wiringProbeResultSchema).readonly(),
4665
- widgets: array(wiringProbeResultSchema).readonly()
4666
- });
4667
- /** Per-node roll-up. */
4668
- var wiringNodeHealthSchema = object({
4669
- nodeId: string(),
4670
- addons: array(wiringAddonHealthSchema).readonly()
4671
- });
4672
- object({
4673
- /** True only when every probed target is reachable. */
4674
- ok: boolean(),
4675
- /** True when at least one target is unreachable. */
4676
- degraded: boolean(),
4677
- checkedAt: string(),
4678
- nodes: array(wiringNodeHealthSchema).readonly(),
4679
- summary: object({
4680
- total: number(),
4681
- reachable: number(),
4682
- unreachable: number()
4683
- })
4684
- });
4685
- var MODEL_FORMATS = [
4686
- "onnx",
4687
- "coreml",
4688
- "openvino",
4689
- "tflite",
4690
- "pt"
4691
- ];
4635
+ //#region ../types/dist/sleep-D7JeS58T.mjs
4692
4636
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4693
4637
  EventCategory["SystemBoot"] = "system.boot";
4694
4638
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -4986,6 +4930,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
4986
4930
  */
4987
4931
  EventCategory["PipelineEngineMetricsSnapshot"] = "pipeline.engine-metrics-snapshot";
4988
4932
  /**
4933
+ * Per-node detection-engine runtime-provisioning transition. Emitted by
4934
+ * the detection-pipeline provider on every state change of its lazy
4935
+ * engine-provisioning machine (idle → installing → verifying → ready,
4936
+ * or → failed with a `nextRetryAt`). Payload is the
4937
+ * `EngineProvisioningState` snapshot; `event.source.nodeId` carries the
4938
+ * node. The Pipeline page subscribes to drive a live "installing
4939
+ * OpenVINO… / ready" indicator per node without polling
4940
+ * `pipelineExecutor.getEngineProvisioning`. Telemetry-grade (D8): the UI
4941
+ * also reads the cap snapshot on mount / reconnect. Phase 2.
4942
+ */
4943
+ EventCategory["PipelineEngineProvisioning"] = "pipeline.engine-provisioning";
4944
+ /**
4989
4945
  * Cluster topology snapshot. Carries the same payload returned by
4990
4946
  * `nodes.topology` (every reachable node + addons + processes).
4991
4947
  * Emitted by the hub on any agent / addon lifecycle change
@@ -5999,7 +5955,7 @@ var ProfileSlotSchema = object({
5999
5955
  * Zod schema for StreamSourceEntry — the canonical stream descriptor
6000
5956
  * exposed by ICameraDevice.getStreamSources() and consumed by the broker.
6001
5957
  */
6002
- var StreamSourceEntrySchema = object({
5958
+ var StreamSourceEntrySchema$1 = object({
6003
5959
  id: string(),
6004
5960
  label: string(),
6005
5961
  protocol: _enum([
@@ -6221,904 +6177,1092 @@ var ProfileRtspEntrySchema = object({
6221
6177
  codec: string().optional(),
6222
6178
  resolution: CamStreamResolutionSchema.optional()
6223
6179
  });
6224
- /**
6225
- * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6226
- * Named `RecordingWeekday` to avoid collision with the string-union
6227
- * `Weekday` exported from `interfaces/timezones.ts`.
6228
- */
6229
- var RecordingWeekdaySchema = number().int().min(0).max(6);
6230
- var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6231
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6232
- kind: literal("timeOfDay"),
6233
- start: string().regex(HHMM),
6234
- end: string().regex(HHMM),
6235
- /** Restrict to these weekdays; omit = every day. */
6236
- days: array(RecordingWeekdaySchema).optional()
6237
- })]);
6238
- var RecordingModeSchema = _enum([
6239
- "continuous",
6240
- "onMotion",
6241
- "onAudioThreshold"
6242
- ]);
6243
- /**
6244
- * First-class, authoritative per-camera storage mode the netta choice the UI
6245
- * reads directly (never inferred from `rules`):
6246
- * - `off` not recording.
6247
- * - `events` — record only around triggers (motion / audio threshold),
6248
- * with pre/post-buffer.
6249
- * - `continuous` record 24/7 within the schedule.
6250
- *
6251
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6252
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6253
- */
6254
- var RecordingStorageModeSchema = _enum([
6255
- "off",
6256
- "events",
6257
- "continuous"
6258
- ]);
6259
- /** Which detectors trigger an `events`-mode recording. */
6260
- var RecordingTriggersSchema = object({
6261
- motion: boolean().optional(),
6262
- audioThresholdDbfs: number().optional()
6263
- });
6264
- /**
6265
- * Mode of a single recording band the recorder per-band vocabulary.
6266
- *
6267
- * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6268
- * only ever `continuous` or `events`; "off" is expressed by the absence of a
6269
- * covering band, not by a band value.
6270
- */
6271
- var RecordingBandModeSchema = _enum(["continuous", "events"]);
6272
- /**
6273
- * Triggers for an `events`-mode band. Identical shape to
6274
- * `RecordingTriggersSchema`reuse that schema as the band trigger type so the
6275
- * two never drift.
6276
- */
6277
- var RecordingBandTriggersSchema = RecordingTriggersSchema;
6278
- /**
6279
- * A single mode-per-band window the canonical recorder band shape, the
6280
- * single source of truth re-used by `addon-pipeline/recorder`.
6281
- *
6282
- * `days` lists the weekdays the band covers (empty = every day, matching the
6283
- * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6284
- * span wraps past midnight (handled by the band engine).
6285
- */
6286
- var RecordingBandSchema = object({
6287
- days: array(RecordingWeekdaySchema),
6288
- start: string().regex(HHMM),
6289
- end: string().regex(HHMM),
6290
- mode: RecordingBandModeSchema,
6291
- triggers: RecordingBandTriggersSchema.optional(),
6292
- preBufferSec: number().min(0).optional(),
6293
- postBufferSec: number().min(0).optional()
6294
- });
6295
- var RecordingRuleSchema = object({
6296
- schedule: RecordingScheduleSchema,
6297
- mode: RecordingModeSchema,
6298
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6299
- preBufferSec: number().min(0).default(0),
6300
- /** Keep recording until this many seconds after the last trigger. */
6301
- postBufferSec: number().min(0).default(0),
6302
- /** Each new trigger restarts the post-buffer window. */
6303
- resetTimeoutOnNewEvent: boolean().default(true),
6304
- /** onAudioThreshold only dBFS level that counts as a trigger. */
6305
- thresholdDbfs: number().optional()
6306
- });
6307
- /**
6308
- * Per-device retention overrides. Every field is optional; an unset or `0`
6309
- * value inherits the node-wide recorder default. Only footage-lifetime limits
6310
- * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6311
- * (when the volume is too full to keep recording) is NOT a per-camera concern —
6312
- * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6313
- * shared by every camera writing to that volume.
6314
- */
6315
- var RecordingRetentionSchema = object({
6316
- maxAgeDays: number().min(0).optional(),
6317
- maxSizeGb: number().min(0).optional()
6318
- });
6319
- /**
6320
- * The full per-camera recording intent — the wire shape of a RecordingTarget.
6321
- *
6322
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6323
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6324
- * only for transition + migration (`migrateRulesToMode`); the policy engine
6325
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6326
- */
6327
- var RecordingConfigSchema = object({
6328
- enabled: boolean(),
6329
- /** Authoritative storage mode. Absent on legacy targets → derived once via
6330
- * `migrateRulesToMode`, then persisted. */
6331
- mode: RecordingStorageModeSchema.optional(),
6332
- profiles: array(CamProfileSchema).optional(),
6333
- segmentSeconds: number().int().positive().optional(),
6334
- /** Shared recording time-bands for `events` & `continuous` — record only when
6335
- * the wall-clock falls inside one of these windows. Omit or empty = always.
6336
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
6337
- schedules: array(RecordingScheduleSchema).optional(),
6338
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
6339
- * normalized into `schedules` on read and never written going forward. (Not
6340
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
6341
- schedule: RecordingScheduleSchema.optional(),
6342
- /** `events`-mode only — which detectors trigger a recording. */
6343
- triggers: RecordingTriggersSchema.optional(),
6344
- /** `events`-mode only — seconds retained before / after a trigger. */
6345
- preBufferSec: number().min(0).optional(),
6346
- postBufferSec: number().min(0).optional(),
6347
- /** DEPRECATED authoring input; retained for migration/transition. */
6348
- rules: array(RecordingRuleSchema).optional(),
6349
- /**
6350
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
6351
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
6352
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
6353
- * derived into bands once via `migrateConfigToBands`.
6354
- */
6355
- bands: array(RecordingBandSchema).optional(),
6356
- retention: RecordingRetentionSchema.optional()
6357
- });
6358
- /**
6359
- * `StorageLocationType` — an addon-declared id that identifies the *kind* of
6360
- * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
6361
- * so the persisted record schema and the consumer-facing cap can both consume it
6362
- * without forming a circular import. The `storage` cap re-exports it
6363
- * verbatim for back-compat.
6364
- *
6365
- * This Zod schema is the **authoritative source** for `StorageLocationType`.
6366
- * The TS alias in `./storage.ts` re-exports `z.infer<typeof
6367
- * StorageLocationTypeSchema>` so the wire surface (cap) and the legacy
6368
- * `IStorageProvider` interface stay in lockstep.
6369
- *
6370
- * The type is now an **open string** (not a closed enum) — addons declare
6371
- * their own location kinds via `StorageLocationDeclaration.id`. The regex
6372
- * enforces a safe id format: lowercase-start, alphanumeric + hyphens.
6373
- */
6374
- var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
6375
- /**
6376
- * Persisted record for a storage location instance. Operators can register
6377
- * multiple instances for multi-cardinality types (e.g. two `backups`
6378
- * locations with different `providerId`s). Cardinality is now declared per
6379
- * location via `StorageLocationDeclaration.cardinality` — the static
6380
- * `STORAGE_LOCATION_CARDINALITY` map has been removed.
6381
- *
6382
- * `id` is a stable namespaced string of the form `<type>:<slug>`.
6383
- * The default location for a type uses `id === <type>:default` by
6384
- * convention (the bare type ref like `'backups'` resolves to it).
6385
- *
6386
- * `isSystem: true` marks a location as orchestrator-seeded and
6387
- * undeletable. The bootstrap-installed defaults (one per type) carry
6388
- * this flag; operator-added locations don't. Editing the config of
6389
- * a system location is allowed (path migration, provider swap) but
6390
- * deleting it is rejected at the cap level.
6391
- */
6392
- var StorageLocationSchema = object({
6393
- id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
6394
- type: string(),
6395
- displayName: string().min(1),
6396
- providerId: string().min(1),
6397
- config: record(string(), unknown()),
6398
- /**
6399
- * Cluster node this location physically lives on. REQUIRED for node-local
6400
- * providers (filesystem — the path exists on one node's disk), null/absent
6401
- * for node-agnostic providers (S3/SFTP/WebDAV, reachable from any node).
6402
- * `'hub'` is the hub node. Validated against the provider's `nodeLocal`
6403
- * flag at upsert time, not here (the schema is provider-agnostic).
6404
- */
6405
- nodeId: string().optional(),
6406
- isDefault: boolean().default(false),
6407
- isSystem: boolean().default(false),
6408
- createdAt: number(),
6409
- updatedAt: number()
6410
- });
6411
- /**
6412
- * Reference accepted by consumer-facing `api.storage.*` calls.
6413
- * Either:
6414
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
6415
- * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
6416
- *
6417
- * The orchestrator's `resolveRef(ref)` handles both cases.
6418
- */
6419
- var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]);
6420
- /**
6421
- * `StorageLocationDeclaration` — a single storage-location entry declared by
6422
- * an addon in its `package.json` under `camstack.storageLocations`.
6423
- *
6424
- * Design intent:
6425
- * - **Addon declares its needs** — each addon describes the logical storage
6426
- * slots it requires (e.g. `recordings`, `recordingsLow`) without caring
6427
- * about the physical path.
6428
- * - **Kernel aggregates** — at boot the kernel collects declarations from all
6429
- * installed addons, deduplicates by `id`, and exposes the union via the
6430
- * storage-locations settings surface.
6431
- * - **Orchestrator seeds** — for every declared `id` the orchestrator ensures
6432
- * at least one instance named `<id>:default` is present, using
6433
- * `defaultsTo` to inherit the resolved root from another location when the
6434
- * declaration is a derivative slot (e.g. `recordingsLow` defaults to
6435
- * `recordings`).
6436
- * - **ids are global** — `id` values are shared across the entire deployment;
6437
- * two addons declaring the same `id` must agree on `cardinality` (validated
6438
- * at kernel aggregation time, not here).
6439
- */
6440
- var StorageLocationDeclarationSchema = object({
6441
- /**
6442
- * Global location identifier, e.g. `recordings` or `recordingsLow`.
6443
- * Must start with a lowercase letter and may contain letters, digits, and
6444
- * hyphens.
6445
- */
6446
- id: string().regex(/^[a-z][a-zA-Z0-9-]*$/, { message: "id must start with a lowercase letter and contain only letters, digits, or hyphens" }),
6447
- /** Human-readable name shown in the admin UI. */
6448
- displayName: string().min(1, { message: "displayName must not be empty" }),
6449
- /** Optional longer explanation of what data this location stores. */
6450
- description: string().optional(),
6451
- /**
6452
- * `single` — exactly one instance of this location is allowed system-wide
6453
- * (e.g. `logs`, `models`). The operator can edit it but not add more.
6454
- * `multi` — the operator may register several instances (e.g. a second
6455
- * `recordings` on a NAS for disk tiering); one is the default at any time.
6456
- */
6457
- cardinality: _enum(["single", "multi"]),
6458
- /**
6459
- * When set, the default instance for this location inherits its resolved
6460
- * root from the named location's default instance. Useful for derivative
6461
- * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
6462
- * configure the primary location.
6463
- */
6464
- defaultsTo: string().optional()
6465
- });
6466
- var DecoderStatsSchema = object({
6467
- inputFps: number(),
6468
- outputFps: number(),
6469
- avgDecodeTimeMs: number(),
6470
- droppedFrames: number()
6471
- });
6472
- var DecoderSessionConfigSchema = object({
6473
- codec: string(),
6474
- maxFps: number().default(0),
6475
- outputFormat: _enum([
6476
- "jpeg",
6477
- "rgb",
6478
- "bgr",
6479
- "yuv420",
6480
- "gray"
6481
- ]).default("jpeg"),
6482
- scale: number().default(1),
6483
- width: number().optional(),
6484
- height: number().optional(),
6180
+ var DeviceType = /* @__PURE__ */ function(DeviceType) {
6181
+ DeviceType["Camera"] = "camera";
6182
+ DeviceType["Hub"] = "hub";
6183
+ DeviceType["Light"] = "light";
6184
+ DeviceType["Siren"] = "siren";
6185
+ DeviceType["Switch"] = "switch";
6186
+ DeviceType["Sensor"] = "sensor";
6187
+ DeviceType["Thermostat"] = "thermostat";
6188
+ DeviceType["Button"] = "button";
6189
+ /** Generic stateless event emitter — carries a device's EXACT declared
6190
+ * event vocabulary verbatim (no normalization). Installed with the
6191
+ * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6192
+ * HA bus events (e.g. `zha_event`, generic). */
6193
+ DeviceType["EventEmitter"] = "event-emitter";
6194
+ /** Firmware/software update entity — current vs available version,
6195
+ * updatable flag, update state, and an install action. Installed with
6196
+ * the `update` cap. Sources: Homematic firmware-update channels (and
6197
+ * reusable by other providers, e.g. HA `update.*` entities). */
6198
+ DeviceType["Update"] = "update";
6199
+ DeviceType["Generic"] = "generic";
6200
+ /** Generic notification delivery target (HA `notify.<service>`, future
6201
+ * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6202
+ * endpoint; the `notifier` cap defines the send surface. */
6203
+ DeviceType["Notifier"] = "notifier";
6204
+ /** Pre-recorded action sequence with optional parameters
6205
+ * (HA `script.*`). Runnable via `script-runner` cap. */
6206
+ DeviceType["Script"] = "script";
6207
+ /** Automation rule (HA `automation.*`) enable/disable + manual
6208
+ * trigger surface exposed via `automation-control` cap. */
6209
+ DeviceType["Automation"] = "automation";
6210
+ /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6211
+ DeviceType["Lock"] = "lock";
6212
+ /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6213
+ * `valve.*`). `cover` cap with sub-roles for variant. */
6214
+ DeviceType["Cover"] = "cover";
6215
+ /** Pipe / water / gas valve with open/close/stop and optional
6216
+ * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6217
+ * modelled on the same open/closed lifecycle. */
6218
+ DeviceType["Valve"] = "valve";
6219
+ /** Humidifier / dehumidifier with on/off + target humidity + mode
6220
+ * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6221
+ * modelled on the same target / mode lifecycle. */
6222
+ DeviceType["Humidifier"] = "humidifier";
6223
+ /** Water heater / boiler with target temperature + operation mode +
6224
+ * away mode (HA `water_heater.*`). `water-heater` cap a
6225
+ * climate-family actuator. */
6226
+ DeviceType["WaterHeater"] = "water-heater";
6227
+ /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6228
+ DeviceType["Fan"] = "fan";
6229
+ /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6230
+ * the camera surface those use `Camera`. `media-player` cap. */
6231
+ DeviceType["MediaPlayer"] = "media-player";
6232
+ /** Security panel / alarm system (HA `alarm_control_panel.*`).
6233
+ * `alarm-panel` cap. */
6234
+ DeviceType["AlarmPanel"] = "alarm-panel";
6235
+ /** Generic user-settable input (HA `number` / `input_number` / `select`
6236
+ * / `input_select` / `text` / `input_text` / `input_datetime`).
6237
+ * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6238
+ * TextControl / DateTimeControl. */
6239
+ DeviceType["Control"] = "control";
6240
+ /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6241
+ * `presence` cap. */
6242
+ DeviceType["Presence"] = "presence";
6243
+ /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6244
+ * `weather` cap. */
6245
+ DeviceType["Weather"] = "weather";
6246
+ /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6247
+ DeviceType["Vacuum"] = "vacuum";
6248
+ /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6249
+ * `lawn-mower-control` cap. */
6250
+ DeviceType["LawnMower"] = "lawn-mower";
6251
+ /** Physical HA device group — parent container for entity-children
6252
+ * adopted from a single HA device entry. Not renderable as a
6253
+ * standalone device; exists only to anchor child entities. */
6254
+ DeviceType["Container"] = "container";
6255
+ /** Single still-image entity (HA `image.*`). Read-only display of an
6256
+ * `entity_picture` signed URL the browser loads directly. `image` cap. */
6257
+ DeviceType["Image"] = "image";
6258
+ return DeviceType;
6259
+ }({});
6260
+ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6261
+ DeviceFeature["BatteryOperated"] = "battery-operated";
6262
+ DeviceFeature["Rebootable"] = "rebootable";
6485
6263
  /**
6486
- * Identifier of the camera this decoder session serves. Optional
6487
- * because the cap is generic (any caller could request decode), but
6488
- * stream-broker passes it so decoder logs include `deviceId` for
6489
- * per-camera filtering when diagnosing failures (e.g. node-av
6490
- * sendPacket errors on a single hung camera).
6264
+ * Device supports an on-demand re-sync of its derived spec with its
6265
+ * upstream source drives the generic Re-sync button. The owning
6266
+ * provider implements the action via the `device-adoption.resync` cap.
6491
6267
  */
6492
- deviceId: number().int().nonnegative().optional(),
6268
+ DeviceFeature["Resyncable"] = "resyncable";
6269
+ DeviceFeature["NativeSnapshot"] = "native-snapshot";
6270
+ DeviceFeature["DoorbellButton"] = "doorbell-button";
6271
+ DeviceFeature["TwoWayAudio"] = "two-way-audio";
6272
+ DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6493
6273
  /**
6494
- * Free-form tag for log scoping. Stream-broker uses
6495
- * `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
6496
- * on every line so `grep tag=broker:5/high` filters one camera
6497
- * profile cleanly.
6274
+ * Camera supports the on-firmware autotrack subsystem (subject-
6275
+ * following). Distinct from `PanTiltZoom` because not every PTZ
6276
+ * camera ships autotrack the admin UI uses this flag to gate
6277
+ * the autotrack toggle / settings card without re-deriving from
6278
+ * the cap registry. Mirrors `ptz-autotrack` cap registration:
6279
+ * driver sets this feature when probe confirms the firmware
6280
+ * surface, and registers the cap in the same code path.
6498
6281
  */
6499
- tag: string().optional(),
6282
+ DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6500
6283
  /**
6501
- * Where the session delivers decoded frames (Phase 5 / D9):
6284
+ * Accessory exposes a "trigger on motion" toggle the parent camera's
6285
+ * motion detection automatically activates this device. Mirrors
6286
+ * `motion-trigger` cap registration: drivers set this feature in the
6287
+ * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6502
6288
  *
6503
- * - `'callback'` (default) the legacy pixel path: decoded frames are
6504
- * buffered as `DecodedFrame`s and drained via `pullFrames`.
6505
- * - `'shm'` the shared-memory frame plane: decoded frames are written
6506
- * into an OS shared-memory ring and drained as zero-pixel
6507
- * `FrameHandle`s via `pullHandles`. A session is one mode or the
6508
- * other — `pullFrames` returns nothing for an `'shm'` session and
6509
- * `pullHandles` returns nothing for a `'callback'` session.
6510
- */
6511
- frameSink: _enum(["callback", "shm"]).default("callback")
6512
- });
6513
- var EncodeProfileSchema = object({
6514
- video: object({
6515
- codec: _enum([
6516
- "h264",
6517
- "h265",
6518
- "copy"
6519
- ]),
6520
- profile: _enum([
6521
- "baseline",
6522
- "main",
6523
- "high"
6524
- ]).optional(),
6525
- width: number().int().positive().optional(),
6526
- height: number().int().positive().optional(),
6527
- fps: number().positive().optional(),
6528
- bitrateKbps: number().int().positive().optional(),
6529
- gopFrames: number().int().positive().optional(),
6530
- bf: number().int().min(0).optional(),
6531
- preset: _enum([
6532
- "ultrafast",
6533
- "superfast",
6534
- "veryfast",
6535
- "faster",
6536
- "fast",
6537
- "medium"
6538
- ]).optional(),
6539
- tune: _enum([
6540
- "zerolatency",
6541
- "film",
6542
- "animation"
6543
- ]).optional()
6544
- }),
6545
- audio: union([literal("passthrough"), object({
6546
- codec: _enum([
6547
- "opus",
6548
- "aac",
6549
- "pcmu",
6550
- "pcma",
6551
- "copy"
6552
- ]),
6553
- bitrateKbps: number().int().positive().optional(),
6554
- sampleRateHz: number().int().positive().optional(),
6555
- channels: union([literal(1), literal(2)]).optional()
6556
- })]),
6557
- /**
6558
- * ffmpeg input-side args, inserted between the fixed global flags
6559
- * (`-hide_banner -loglevel error`) and `-i pipe:0`. Free-text array
6560
- * — the widget surfaces a textarea + suggestion chips for the most-
6561
- * used demuxer/format options.
6562
- */
6563
- inputArgs: array(string()).optional(),
6564
- /**
6565
- * ffmpeg output-side args, inserted between the encode block and
6566
- * the final `-f <muxer> pipe:1`. Use for muxer options, bitstream
6567
- * filters, codec-specific overrides. Free-text array.
6289
+ * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6290
+ * fast scalar without binding fetch), notifier rules, and `listAll`
6291
+ * filters that want "all devices with on-motion behaviour".
6568
6292
  */
6569
- outputArgs: array(string()).optional()
6570
- });
6571
- /**
6572
- import { errMsg } from '@camstack/types'
6573
- * Extract a human-readable message from an unknown error value.
6574
- * Replaces the ubiquitous `errMsg(err)` pattern.
6575
- */
6576
- function errMsg(err) {
6577
- if (err instanceof Error) return err.message;
6578
- if (typeof err === "string") return err;
6579
- return String(err);
6293
+ DeviceFeature["MotionTrigger"] = "motion-trigger";
6294
+ /** Light supports rgb-triplet color via `color` cap. */
6295
+ DeviceFeature["LightColorRgb"] = "light-color-rgb";
6296
+ /** Light supports HSV color via `color` cap. */
6297
+ DeviceFeature["LightColorHsv"] = "light-color-hsv";
6298
+ /** Light supports color-temperature (mired) via `color` cap. */
6299
+ DeviceFeature["LightColorMired"] = "light-color-mired";
6300
+ /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6301
+ * targetHigh). Gates the range slider UI. */
6302
+ DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6303
+ /** Thermostat exposes target humidity and/or current humidity
6304
+ * readings. Gates the humidity controls. */
6305
+ DeviceFeature["ClimateHumidity"] = "climate-humidity";
6306
+ /** Thermostat exposes a fan-mode selector. */
6307
+ DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6308
+ /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6309
+ DeviceFeature["ClimatePreset"] = "climate-preset";
6310
+ /** Cover exposes intermediate position control (0..100). Gates the
6311
+ * position slider UI. */
6312
+ DeviceFeature["CoverPositionable"] = "cover-positionable";
6313
+ /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6314
+ DeviceFeature["CoverTilt"] = "cover-tilt";
6315
+ /** Valve exposes intermediate position control (0..100). Gates the
6316
+ * position slider / drag surface UI. */
6317
+ DeviceFeature["ValvePositionable"] = "valve-positionable";
6318
+ /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6319
+ DeviceFeature["FanSpeed"] = "fan-speed";
6320
+ /** Fan exposes a preset mode selector. */
6321
+ DeviceFeature["FanPreset"] = "fan-preset";
6322
+ /** Fan exposes blade direction (forward/reverse) — typical of
6323
+ * ceiling fans. */
6324
+ DeviceFeature["FanDirection"] = "fan-direction";
6325
+ /** Fan exposes an oscillation toggle. */
6326
+ DeviceFeature["FanOscillating"] = "fan-oscillating";
6327
+ /** Lock requires a PIN code on lock/unlock. Gates the code-entry
6328
+ * field on the UI lock-controls panel. */
6329
+ DeviceFeature["LockPinRequired"] = "lock-pin-required";
6330
+ /** Lock supports a latch-release ("open door") action distinct from
6331
+ * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
6332
+ * `supported_features`. Gates the Open Door button in the UI. */
6333
+ DeviceFeature["LockOpen"] = "lock-open";
6334
+ /** Media player exposes a seek-to-position surface. */
6335
+ DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
6336
+ /** Media player exposes a volume-level setter. */
6337
+ DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
6338
+ /** Media player exposes a mute toggle distinct from volume=0. */
6339
+ DeviceFeature["MediaPlayerMute"] = "media-player-mute";
6340
+ /** Media player exposes a shuffle toggle. */
6341
+ DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
6342
+ /** Media player exposes a repeat mode (off / all / one). */
6343
+ DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
6344
+ /** Media player exposes a source / input selector. */
6345
+ DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
6346
+ /** Media player exposes a play-arbitrary-media surface (URL / id). */
6347
+ DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
6348
+ /** Media player exposes next-track. */
6349
+ DeviceFeature["MediaPlayerNext"] = "media-player-next";
6350
+ /** Media player exposes previous-track. */
6351
+ DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
6352
+ /** Media player exposes stop distinct from pause. */
6353
+ DeviceFeature["MediaPlayerStop"] = "media-player-stop";
6354
+ /** Alarm panel requires a PIN code on arm/disarm. */
6355
+ DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
6356
+ /** Presence device carries GPS coordinates (lat/lng/accuracy) in
6357
+ * addition to a textual location. */
6358
+ DeviceFeature["PresenceGps"] = "presence-gps";
6359
+ /** Notifier accepts an inline / URL image attachment. */
6360
+ DeviceFeature["NotifierImage"] = "notifier-image";
6361
+ /** Notifier accepts a priority hint (high/normal/low). */
6362
+ DeviceFeature["NotifierPriority"] = "notifier-priority";
6363
+ /** Notifier accepts a free-form `data` payload for platform-specific
6364
+ * fields. */
6365
+ DeviceFeature["NotifierData"] = "notifier-data";
6366
+ /** Notifier supports interactive action buttons / callbacks. */
6367
+ DeviceFeature["NotifierActions"] = "notifier-actions";
6368
+ /** Notifier supports per-call recipient targeting (multi-user). */
6369
+ DeviceFeature["NotifierRecipients"] = "notifier-recipients";
6370
+ /** Script runner accepts a variables map on each run invocation. */
6371
+ DeviceFeature["ScriptVariables"] = "script-variables";
6372
+ /** Automation `trigger` accepts a skipCondition flag — fires the
6373
+ * automation's actions while bypassing its condition block. */
6374
+ DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
6375
+ return DeviceFeature;
6376
+ }({});
6377
+ /**
6378
+ * Semantic role a device plays within its parent. Populated by driver
6379
+ * addons when creating accessory devices (Reolink siren/floodlight/
6380
+ * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
6381
+ * admin UI to pick icons, labels, and widgets — a `Switch` with
6382
+ * `role: Floodlight` renders as a bulb with a brightness slider,
6383
+ * whereas a `Switch` with `role: Siren` renders as a klaxon.
6384
+ *
6385
+ * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
6386
+ * sqlite as a nullable TEXT column — old rows keep working unchanged.
6387
+ */
6388
+ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
6389
+ DeviceRole["Siren"] = "siren";
6390
+ DeviceRole["Floodlight"] = "floodlight";
6391
+ DeviceRole["Spotlight"] = "spotlight";
6392
+ DeviceRole["PirSensor"] = "pir-sensor";
6393
+ DeviceRole["Chime"] = "chime";
6394
+ DeviceRole["Autotrack"] = "autotrack";
6395
+ DeviceRole["Nightvision"] = "nightvision";
6396
+ DeviceRole["PrivacyMask"] = "privacy-mask";
6397
+ DeviceRole["Doorbell"] = "doorbell";
6398
+ /** Virtual HA toggle (input_boolean.*) — distinguishable from a
6399
+ * real Switch device for UI rendering / export adapters. */
6400
+ DeviceRole["BinaryHelper"] = "binary-helper";
6401
+ /** Generic motion / occupancy / moving event source. Distinct from
6402
+ * the camera accessory PirSensor role: that one is a camera child;
6403
+ * this is a standalone HA / 3rd-party motion sensor. */
6404
+ DeviceRole["MotionSensor"] = "motion-sensor";
6405
+ DeviceRole["ContactSensor"] = "contact-sensor";
6406
+ DeviceRole["LeakSensor"] = "leak-sensor";
6407
+ DeviceRole["SmokeSensor"] = "smoke-sensor";
6408
+ DeviceRole["COSensor"] = "co-sensor";
6409
+ DeviceRole["GasSensor"] = "gas-sensor";
6410
+ DeviceRole["TamperSensor"] = "tamper-sensor";
6411
+ DeviceRole["VibrationSensor"] = "vibration-sensor";
6412
+ DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
6413
+ DeviceRole["SoundSensor"] = "sound-sensor";
6414
+ /** Fallback for `binary_sensor` without a known `device_class`. */
6415
+ DeviceRole["BinarySensor"] = "binary-sensor";
6416
+ DeviceRole["TemperatureSensor"] = "temperature-sensor";
6417
+ DeviceRole["HumiditySensor"] = "humidity-sensor";
6418
+ DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
6419
+ DeviceRole["PressureSensor"] = "pressure-sensor";
6420
+ DeviceRole["PowerSensor"] = "power-sensor";
6421
+ DeviceRole["EnergySensor"] = "energy-sensor";
6422
+ DeviceRole["VoltageSensor"] = "voltage-sensor";
6423
+ DeviceRole["CurrentSensor"] = "current-sensor";
6424
+ DeviceRole["AirQualitySensor"] = "air-quality-sensor";
6425
+ /** Battery level (numeric % via `sensor` OR low-bool via
6426
+ * `binary_sensor` — the cap distinguishes via the value type). */
6427
+ DeviceRole["BatterySensor"] = "battery-sensor";
6428
+ /** Fallback for `sensor` numeric without a known `device_class`. */
6429
+ DeviceRole["NumericSensor"] = "numeric-sensor";
6430
+ /** String / enum state (HA `sensor` with `state_class: enum` or
6431
+ * `attributes.options`). */
6432
+ DeviceRole["EnumSensor"] = "enum-sensor";
6433
+ /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
6434
+ * or `date`). The slice carries the raw ISO string verbatim (hosted on
6435
+ * the `enum-sensor` cap); the UI renders it locale-formatted. */
6436
+ DeviceRole["DateTimeSensor"] = "datetime-sensor";
6437
+ /** Last-resort fallback when nothing else matches. */
6438
+ DeviceRole["GenericSensor"] = "generic-sensor";
6439
+ DeviceRole["NumericControl"] = "numeric-control";
6440
+ DeviceRole["SelectControl"] = "select-control";
6441
+ DeviceRole["TextControl"] = "text-control";
6442
+ DeviceRole["DateTimeControl"] = "datetime-control";
6443
+ /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
6444
+ * rich features (image, priority, channel routing). */
6445
+ DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
6446
+ /** Chat / messaging service (HA `notify.telegram_*`,
6447
+ * `notify.discord_*`, etc.). */
6448
+ DeviceRole["MessagingNotifier"] = "messaging-notifier";
6449
+ /** Email-based delivery (HA `notify.smtp`, etc.). */
6450
+ DeviceRole["EmailNotifier"] = "email-notifier";
6451
+ /** Fallback when the notifier service name doesn't match a known
6452
+ * pattern. */
6453
+ DeviceRole["GenericNotifier"] = "generic-notifier";
6454
+ return DeviceRole;
6455
+ }({});
6456
+ /**
6457
+ * Generic types for capability definitions.
6458
+ *
6459
+ * A capability is defined with Zod schemas for methods, events, and settings.
6460
+ * TypeScript types are inferred via z.infer<> — zero duplication.
6461
+ *
6462
+ * Pattern:
6463
+ * 1. Define Zod schemas for data, methods, settings
6464
+ * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
6465
+ * 3. Export type IProvider = InferProvider<typeof capabilityDef>
6466
+ * 4. Addon implements IProvider
6467
+ * 5. Registry auto-mounts tRPC router from definition.methods
6468
+ */
6469
+ /**
6470
+ * Output schema shared by the contribution + live methods.
6471
+ *
6472
+ * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
6473
+ * tabs[]) without importing from `../interfaces/config-ui.js` — a
6474
+ * concrete-but-lenient Zod object keeps tRPC output inference happy
6475
+ * (using `z.unknown()` here collapses unrelated router branches to
6476
+ * `unknown` when the generator re-inlines the huge AppRouter type).
6477
+ *
6478
+ * `.passthrough()` on sections/fields accepts whatever FormBuilder
6479
+ * extensions the caller adds (showWhen, displayScale, …) without
6480
+ * rebuilding every time a new field kind is introduced.
6481
+ */
6482
+ var ContributionSectionSchema = object({
6483
+ id: string(),
6484
+ title: string(),
6485
+ description: string().optional(),
6486
+ style: _enum(["card", "accordion"]).optional(),
6487
+ defaultCollapsed: boolean().optional(),
6488
+ columns: union([
6489
+ literal(1),
6490
+ literal(2),
6491
+ literal(3),
6492
+ literal(4)
6493
+ ]).optional(),
6494
+ tab: string().optional(),
6495
+ location: _enum(["settings", "top-tab"]).optional(),
6496
+ order: number().optional(),
6497
+ fields: array(any())
6498
+ });
6499
+ object({
6500
+ tabs: array(object({
6501
+ id: string(),
6502
+ label: string(),
6503
+ icon: string(),
6504
+ order: number().optional()
6505
+ })).optional(),
6506
+ sections: array(ContributionSectionSchema)
6507
+ }).nullable();
6508
+ object({ deviceId: number() }), object({ deviceId: number() }), object({
6509
+ deviceId: number(),
6510
+ patch: record(string(), unknown())
6511
+ }), object({ success: literal(true) });
6512
+ object({ deviceId: number() }), unknown().nullable();
6513
+ /** Shorthand to define a method schema */
6514
+ function method(input, output, options) {
6515
+ return {
6516
+ input,
6517
+ output,
6518
+ kind: options?.kind ?? "query",
6519
+ auth: options?.auth ?? "protected",
6520
+ ...options?.access !== void 0 ? { access: options.access } : {},
6521
+ timeoutMs: options?.timeoutMs
6522
+ };
6580
6523
  }
6581
- var YAMNET_TO_MACRO = {
6582
- mapping: {
6583
- Speech: "speech",
6584
- "Child speech, kid speaking": "speech",
6585
- Conversation: "speech",
6586
- "Narration, monologue": "speech",
6587
- Babbling: "speech",
6588
- Whispering: "speech",
6589
- "Speech synthesizer": "speech",
6590
- Humming: "speech",
6591
- Rapping: "speech",
6592
- Singing: "speech",
6593
- Choir: "speech",
6594
- "Child singing": "speech",
6595
- Shout: "scream",
6596
- Bellow: "scream",
6597
- Yell: "scream",
6598
- Screaming: "scream",
6599
- "Children shouting": "scream",
6600
- Whoop: "scream",
6601
- "Crying, sobbing": "crying",
6602
- "Baby cry, infant cry": "crying",
6603
- Whimper: "crying",
6604
- "Wail, moan": "crying",
6605
- Groan: "crying",
6606
- Laughter: "laughter",
6607
- "Baby laughter": "laughter",
6608
- Giggle: "laughter",
6609
- Snicker: "laughter",
6610
- "Belly laugh": "laughter",
6611
- "Chuckle, chortle": "laughter",
6612
- Music: "music",
6613
- "Musical instrument": "music",
6614
- Guitar: "music",
6615
- Piano: "music",
6616
- Drum: "music",
6617
- "Drum kit": "music",
6618
- "Violin, fiddle": "music",
6619
- Flute: "music",
6620
- Saxophone: "music",
6621
- Trumpet: "music",
6622
- Synthesizer: "music",
6623
- "Pop music": "music",
6624
- "Rock music": "music",
6625
- "Hip hop music": "music",
6626
- "Classical music": "music",
6627
- Jazz: "music",
6628
- "Electronic music": "music",
6629
- "Background music": "music",
6630
- Dog: "dog",
6631
- Bark: "dog",
6632
- Yip: "dog",
6633
- Howl: "dog",
6634
- "Bow-wow": "dog",
6635
- Growling: "dog",
6636
- "Whimper (dog)": "dog",
6637
- Cat: "cat",
6638
- Purr: "cat",
6639
- Meow: "cat",
6640
- Hiss: "cat",
6641
- Caterwaul: "cat",
6642
- Bird: "bird",
6643
- "Bird vocalization, bird call, bird song": "bird",
6644
- "Chirp, tweet": "bird",
6645
- Squawk: "bird",
6646
- Crow: "bird",
6647
- Owl: "bird",
6648
- "Pigeon, dove": "bird",
6649
- Animal: "animal",
6650
- "Domestic animals, pets": "animal",
6651
- "Livestock, farm animals, working animals": "animal",
6652
- Horse: "animal",
6653
- "Cattle, bovinae": "animal",
6654
- Pig: "animal",
6655
- Sheep: "animal",
6656
- Goat: "animal",
6657
- Frog: "animal",
6658
- Insect: "animal",
6659
- Cricket: "animal",
6660
- Alarm: "alarm",
6661
- "Alarm clock": "alarm",
6662
- "Smoke detector, smoke alarm": "alarm",
6663
- "Fire alarm": "alarm",
6664
- Buzzer: "alarm",
6665
- "Civil defense siren": "alarm",
6666
- "Car alarm": "alarm",
6667
- Siren: "siren",
6668
- "Police car (siren)": "siren",
6669
- "Ambulance (siren)": "siren",
6670
- "Fire engine, fire truck (siren)": "siren",
6671
- "Emergency vehicle": "siren",
6672
- Foghorn: "siren",
6673
- Doorbell: "doorbell",
6674
- "Ding-dong": "doorbell",
6675
- Knock: "doorbell",
6676
- Tap: "doorbell",
6677
- Glass: "glass_breaking",
6678
- Shatter: "glass_breaking",
6679
- "Chink, clink": "glass_breaking",
6680
- "Gunshot, gunfire": "gunshot",
6681
- "Machine gun": "gunshot",
6682
- Explosion: "gunshot",
6683
- Fireworks: "gunshot",
6684
- Firecracker: "gunshot",
6685
- "Artillery fire": "gunshot",
6686
- "Cap gun": "gunshot",
6687
- Boom: "gunshot",
6688
- Vehicle: "vehicle",
6689
- Car: "vehicle",
6690
- Truck: "vehicle",
6691
- Bus: "vehicle",
6692
- Motorcycle: "vehicle",
6693
- "Car passing by": "vehicle",
6694
- "Vehicle horn, car horn, honking": "vehicle",
6695
- "Traffic noise, roadway noise": "vehicle",
6696
- Train: "vehicle",
6697
- Aircraft: "vehicle",
6698
- Helicopter: "vehicle",
6699
- Bicycle: "vehicle",
6700
- Skateboard: "vehicle",
6701
- Fire: "fire",
6702
- Crackle: "fire",
6703
- Water: "water",
6704
- Rain: "water",
6705
- Raindrop: "water",
6706
- "Rain on surface": "water",
6707
- Stream: "water",
6708
- Waterfall: "water",
6709
- Ocean: "water",
6710
- "Waves, surf": "water",
6711
- "Splash, splatter": "water",
6712
- Wind: "wind",
6713
- Thunderstorm: "wind",
6714
- Thunder: "wind",
6715
- "Wind noise (microphone)": "wind",
6716
- "Rustling leaves": "wind",
6717
- Door: "door",
6718
- "Sliding door": "door",
6719
- Slam: "door",
6720
- "Cupboard open or close": "door",
6721
- "Walk, footsteps": "footsteps",
6722
- Run: "footsteps",
6723
- Shuffle: "footsteps",
6724
- Crowd: "crowd",
6725
- Chatter: "crowd",
6726
- Cheering: "crowd",
6727
- Applause: "crowd",
6728
- "Children playing": "crowd",
6729
- "Hubbub, speech noise, speech babble": "crowd",
6730
- Telephone: "telephone",
6731
- "Telephone bell ringing": "telephone",
6732
- Ringtone: "telephone",
6733
- "Telephone dialing, DTMF": "telephone",
6734
- "Busy signal": "telephone",
6735
- Engine: "engine",
6736
- "Engine starting": "engine",
6737
- Idling: "engine",
6738
- "Accelerating, revving, vroom": "engine",
6739
- "Light engine (high frequency)": "engine",
6740
- "Medium engine (mid frequency)": "engine",
6741
- "Heavy engine (low frequency)": "engine",
6742
- "Lawn mower": "engine",
6743
- Chainsaw: "engine",
6744
- Hammer: "tools",
6745
- Jackhammer: "tools",
6746
- Sawing: "tools",
6747
- "Power tool": "tools",
6748
- Drill: "tools",
6749
- Sanding: "tools",
6750
- Silence: "silence"
6751
- },
6752
- preserveOriginal: false
6753
- };
6754
- var APPLE_SA_TO_MACRO = {
6755
- mapping: {
6756
- speech: "speech",
6757
- child_speech: "speech",
6758
- conversation: "speech",
6759
- whispering: "speech",
6760
- singing: "speech",
6761
- humming: "speech",
6762
- shout: "scream",
6763
- yell: "scream",
6764
- screaming: "scream",
6765
- crying: "crying",
6766
- baby_crying: "crying",
6767
- sobbing: "crying",
6768
- laughter: "laughter",
6769
- baby_laughter: "laughter",
6770
- giggling: "laughter",
6771
- music: "music",
6772
- guitar: "music",
6773
- piano: "music",
6774
- drums: "music",
6775
- dog_bark: "dog",
6776
- dog_bow_wow: "dog",
6777
- dog_growling: "dog",
6778
- dog_howl: "dog",
6779
- cat_meow: "cat",
6780
- cat_purr: "cat",
6781
- cat_hiss: "cat",
6782
- bird: "bird",
6783
- bird_chirp: "bird",
6784
- bird_squawk: "bird",
6785
- animal: "animal",
6786
- horse: "animal",
6787
- cow_moo: "animal",
6788
- insect: "animal",
6789
- alarm: "alarm",
6790
- smoke_alarm: "alarm",
6791
- fire_alarm: "alarm",
6792
- car_alarm: "alarm",
6793
- siren: "siren",
6794
- police_siren: "siren",
6795
- ambulance_siren: "siren",
6796
- doorbell: "doorbell",
6797
- door_knock: "doorbell",
6798
- knocking: "doorbell",
6799
- glass_breaking: "glass_breaking",
6800
- glass_shatter: "glass_breaking",
6801
- gunshot: "gunshot",
6802
- explosion: "gunshot",
6803
- fireworks: "gunshot",
6804
- car: "vehicle",
6805
- truck: "vehicle",
6806
- motorcycle: "vehicle",
6807
- car_horn: "vehicle",
6808
- vehicle_horn: "vehicle",
6809
- traffic: "vehicle",
6810
- fire: "fire",
6811
- fire_crackle: "fire",
6812
- water: "water",
6813
- rain: "water",
6814
- ocean: "water",
6815
- splash: "water",
6816
- wind: "wind",
6817
- thunder: "wind",
6818
- thunderstorm: "wind",
6819
- door: "door",
6820
- door_slam: "door",
6821
- sliding_door: "door",
6822
- footsteps: "footsteps",
6823
- walking: "footsteps",
6824
- running: "footsteps",
6825
- crowd: "crowd",
6826
- chatter: "crowd",
6827
- cheering: "crowd",
6828
- applause: "crowd",
6829
- telephone_ring: "telephone",
6830
- ringtone: "telephone",
6831
- engine: "engine",
6832
- engine_starting: "engine",
6833
- lawn_mower: "engine",
6834
- chainsaw: "engine",
6835
- hammer: "tools",
6836
- jackhammer: "tools",
6837
- drill: "tools",
6838
- power_tool: "tools",
6839
- silence: "silence"
6840
- },
6841
- preserveOriginal: false
6842
- };
6843
- var _macroLookup = /* @__PURE__ */ new Map();
6844
- for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6845
- for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6846
- var DeviceType = /* @__PURE__ */ function(DeviceType) {
6847
- DeviceType["Camera"] = "camera";
6848
- DeviceType["Hub"] = "hub";
6849
- DeviceType["Light"] = "light";
6850
- DeviceType["Siren"] = "siren";
6851
- DeviceType["Switch"] = "switch";
6852
- DeviceType["Sensor"] = "sensor";
6853
- DeviceType["Thermostat"] = "thermostat";
6854
- DeviceType["Button"] = "button";
6855
- /** Generic stateless event emitter — carries a device's EXACT declared
6856
- * event vocabulary verbatim (no normalization). Installed with the
6857
- * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6858
- * HA bus events (e.g. `zha_event`, generic). */
6859
- DeviceType["EventEmitter"] = "event-emitter";
6860
- /** Firmware/software update entity — current vs available version,
6861
- * updatable flag, update state, and an install action. Installed with
6862
- * the `update` cap. Sources: Homematic firmware-update channels (and
6863
- * reusable by other providers, e.g. HA `update.*` entities). */
6864
- DeviceType["Update"] = "update";
6865
- DeviceType["Generic"] = "generic";
6866
- /** Generic notification delivery target (HA `notify.<service>`, future
6867
- * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6868
- * endpoint; the `notifier` cap defines the send surface. */
6869
- DeviceType["Notifier"] = "notifier";
6870
- /** Pre-recorded action sequence with optional parameters
6871
- * (HA `script.*`). Runnable via `script-runner` cap. */
6872
- DeviceType["Script"] = "script";
6873
- /** Automation rule (HA `automation.*`) enable/disable + manual
6874
- * trigger surface exposed via `automation-control` cap. */
6875
- DeviceType["Automation"] = "automation";
6876
- /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6877
- DeviceType["Lock"] = "lock";
6878
- /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6879
- * `valve.*`). `cover` cap with sub-roles for variant. */
6880
- DeviceType["Cover"] = "cover";
6881
- /** Pipe / water / gas valve with open/close/stop and optional
6882
- * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6883
- * modelled on the same open/closed lifecycle. */
6884
- DeviceType["Valve"] = "valve";
6885
- /** Humidifier / dehumidifier with on/off + target humidity + mode
6886
- * (HA `humidifier.*`). `humidifier` cap a climate-family actuator
6887
- * modelled on the same target / mode lifecycle. */
6888
- DeviceType["Humidifier"] = "humidifier";
6889
- /** Water heater / boiler with target temperature + operation mode +
6890
- * away mode (HA `water_heater.*`). `water-heater` cap a
6891
- * climate-family actuator. */
6892
- DeviceType["WaterHeater"] = "water-heater";
6893
- /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6894
- DeviceType["Fan"] = "fan";
6895
- /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6896
- * the camera surface — those use `Camera`. `media-player` cap. */
6897
- DeviceType["MediaPlayer"] = "media-player";
6898
- /** Security panel / alarm system (HA `alarm_control_panel.*`).
6899
- * `alarm-panel` cap. */
6900
- DeviceType["AlarmPanel"] = "alarm-panel";
6901
- /** Generic user-settable input (HA `number` / `input_number` / `select`
6902
- * / `input_select` / `text` / `input_text` / `input_datetime`).
6903
- * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6904
- * TextControl / DateTimeControl. */
6905
- DeviceType["Control"] = "control";
6906
- /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6907
- * `presence` cap. */
6908
- DeviceType["Presence"] = "presence";
6909
- /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6910
- * `weather` cap. */
6911
- DeviceType["Weather"] = "weather";
6912
- /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6913
- DeviceType["Vacuum"] = "vacuum";
6914
- /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6915
- * `lawn-mower-control` cap. */
6916
- DeviceType["LawnMower"] = "lawn-mower";
6917
- /** Physical HA device group — parent container for entity-children
6918
- * adopted from a single HA device entry. Not renderable as a
6919
- * standalone device; exists only to anchor child entities. */
6920
- DeviceType["Container"] = "container";
6921
- /** Single still-image entity (HA `image.*`). Read-only display of an
6922
- * `entity_picture` signed URL the browser loads directly. `image` cap. */
6923
- DeviceType["Image"] = "image";
6924
- return DeviceType;
6925
- }({});
6926
- var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6927
- DeviceFeature["BatteryOperated"] = "battery-operated";
6928
- DeviceFeature["Rebootable"] = "rebootable";
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(),
6929
6915
  /**
6930
- * Device supports an on-demand re-sync of its derived spec with its
6931
- * upstream source drives the generic Re-sync button. The owning
6932
- * 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).
6933
6921
  */
6934
- DeviceFeature["Resyncable"] = "resyncable";
6935
- DeviceFeature["NativeSnapshot"] = "native-snapshot";
6936
- DeviceFeature["DoorbellButton"] = "doorbell-button";
6937
- DeviceFeature["TwoWayAudio"] = "two-way-audio";
6938
- DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6922
+ deviceId: number().int().nonnegative().optional(),
6939
6923
  /**
6940
- * Camera supports the on-firmware autotrack subsystem (subject-
6941
- * following). Distinct from `PanTiltZoom` because not every PTZ
6942
- * camera ships autotrack the admin UI uses this flag to gate
6943
- * the autotrack toggle / settings card without re-deriving from
6944
- * the cap registry. Mirrors `ptz-autotrack` cap registration:
6945
- * driver sets this feature when probe confirms the firmware
6946
- * 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.
6947
6928
  */
6948
- DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6929
+ tag: string().optional(),
6949
6930
  /**
6950
- * Accessory exposes a "trigger on motion" toggle the parent camera's
6951
- * motion detection automatically activates this device. Mirrors
6952
- * `motion-trigger` cap registration: drivers set this feature in the
6953
- * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6931
+ * Where the session delivers decoded frames (Phase 5 / D9):
6954
6932
  *
6955
- * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6956
- * fast scalar without binding fetch), notifier rules, and `listAll`
6957
- * 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.
6958
6940
  */
6959
- DeviceFeature["MotionTrigger"] = "motion-trigger";
6960
- /** Light supports rgb-triplet color via `color` cap. */
6961
- DeviceFeature["LightColorRgb"] = "light-color-rgb";
6962
- /** Light supports HSV color via `color` cap. */
6963
- DeviceFeature["LightColorHsv"] = "light-color-hsv";
6964
- /** Light supports color-temperature (mired) via `color` cap. */
6965
- DeviceFeature["LightColorMired"] = "light-color-mired";
6966
- /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6967
- * targetHigh). Gates the range slider UI. */
6968
- DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6969
- /** Thermostat exposes target humidity and/or current humidity
6970
- * readings. Gates the humidity controls. */
6971
- DeviceFeature["ClimateHumidity"] = "climate-humidity";
6972
- /** Thermostat exposes a fan-mode selector. */
6973
- DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6974
- /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6975
- DeviceFeature["ClimatePreset"] = "climate-preset";
6976
- /** Cover exposes intermediate position control (0..100). Gates the
6977
- * position slider UI. */
6978
- DeviceFeature["CoverPositionable"] = "cover-positionable";
6979
- /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6980
- DeviceFeature["CoverTilt"] = "cover-tilt";
6981
- /** Valve exposes intermediate position control (0..100). Gates the
6982
- * position slider / drag surface UI. */
6983
- DeviceFeature["ValvePositionable"] = "valve-positionable";
6984
- /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6985
- DeviceFeature["FanSpeed"] = "fan-speed";
6986
- /** Fan exposes a preset mode selector. */
6987
- DeviceFeature["FanPreset"] = "fan-preset";
6988
- /** Fan exposes blade direction (forward/reverse) — typical of
6989
- * ceiling fans. */
6990
- DeviceFeature["FanDirection"] = "fan-direction";
6991
- /** Fan exposes an oscillation toggle. */
6992
- DeviceFeature["FanOscillating"] = "fan-oscillating";
6993
- /** Lock requires a PIN code on lock/unlock. Gates the code-entry
6994
- * field on the UI lock-controls panel. */
6995
- DeviceFeature["LockPinRequired"] = "lock-pin-required";
6996
- /** Lock supports a latch-release ("open door") action distinct from
6997
- * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
6998
- * `supported_features`. Gates the Open Door button in the UI. */
6999
- DeviceFeature["LockOpen"] = "lock-open";
7000
- /** Media player exposes a seek-to-position surface. */
7001
- DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
7002
- /** Media player exposes a volume-level setter. */
7003
- DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
7004
- /** Media player exposes a mute toggle distinct from volume=0. */
7005
- DeviceFeature["MediaPlayerMute"] = "media-player-mute";
7006
- /** Media player exposes a shuffle toggle. */
7007
- DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
7008
- /** Media player exposes a repeat mode (off / all / one). */
7009
- DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
7010
- /** Media player exposes a source / input selector. */
7011
- DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
7012
- /** Media player exposes a play-arbitrary-media surface (URL / id). */
7013
- DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
7014
- /** Media player exposes next-track. */
7015
- DeviceFeature["MediaPlayerNext"] = "media-player-next";
7016
- /** Media player exposes previous-track. */
7017
- DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
7018
- /** Media player exposes stop distinct from pause. */
7019
- DeviceFeature["MediaPlayerStop"] = "media-player-stop";
7020
- /** Alarm panel requires a PIN code on arm/disarm. */
7021
- DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
7022
- /** Presence device carries GPS coordinates (lat/lng/accuracy) in
7023
- * addition to a textual location. */
7024
- DeviceFeature["PresenceGps"] = "presence-gps";
7025
- /** Notifier accepts an inline / URL image attachment. */
7026
- DeviceFeature["NotifierImage"] = "notifier-image";
7027
- /** Notifier accepts a priority hint (high/normal/low). */
7028
- DeviceFeature["NotifierPriority"] = "notifier-priority";
7029
- /** Notifier accepts a free-form `data` payload for platform-specific
7030
- * fields. */
7031
- DeviceFeature["NotifierData"] = "notifier-data";
7032
- /** Notifier supports interactive action buttons / callbacks. */
7033
- DeviceFeature["NotifierActions"] = "notifier-actions";
7034
- /** Notifier supports per-call recipient targeting (multi-user). */
7035
- DeviceFeature["NotifierRecipients"] = "notifier-recipients";
7036
- /** Script runner accepts a variables map on each run invocation. */
7037
- DeviceFeature["ScriptVariables"] = "script-variables";
7038
- /** Automation `trigger` accepts a skipCondition flag — fires the
7039
- * automation's actions while bypassing its condition block. */
7040
- DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
7041
- return DeviceFeature;
7042
- }({});
7043
- /**
7044
- * Semantic role a device plays within its parent. Populated by driver
7045
- * addons when creating accessory devices (Reolink siren/floodlight/
7046
- * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
7047
- * admin UI to pick icons, labels, and widgets — a `Switch` with
7048
- * `role: Floodlight` renders as a bulb with a brightness slider,
7049
- * whereas a `Switch` with `role: Siren` renders as a klaxon.
7050
- *
7051
- * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
7052
- * sqlite as a nullable TEXT column — old rows keep working unchanged.
7053
- */
7054
- var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
7055
- DeviceRole["Siren"] = "siren";
7056
- DeviceRole["Floodlight"] = "floodlight";
7057
- DeviceRole["Spotlight"] = "spotlight";
7058
- DeviceRole["PirSensor"] = "pir-sensor";
7059
- DeviceRole["Chime"] = "chime";
7060
- DeviceRole["Autotrack"] = "autotrack";
7061
- DeviceRole["Nightvision"] = "nightvision";
7062
- DeviceRole["PrivacyMask"] = "privacy-mask";
7063
- DeviceRole["Doorbell"] = "doorbell";
7064
- /** Virtual HA toggle (input_boolean.*) — distinguishable from a
7065
- * real Switch device for UI rendering / export adapters. */
7066
- DeviceRole["BinaryHelper"] = "binary-helper";
7067
- /** Generic motion / occupancy / moving event source. Distinct from
7068
- * the camera accessory PirSensor role: that one is a camera child;
7069
- * this is a standalone HA / 3rd-party motion sensor. */
7070
- DeviceRole["MotionSensor"] = "motion-sensor";
7071
- DeviceRole["ContactSensor"] = "contact-sensor";
7072
- DeviceRole["LeakSensor"] = "leak-sensor";
7073
- DeviceRole["SmokeSensor"] = "smoke-sensor";
7074
- DeviceRole["COSensor"] = "co-sensor";
7075
- DeviceRole["GasSensor"] = "gas-sensor";
7076
- DeviceRole["TamperSensor"] = "tamper-sensor";
7077
- DeviceRole["VibrationSensor"] = "vibration-sensor";
7078
- DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
7079
- DeviceRole["SoundSensor"] = "sound-sensor";
7080
- /** Fallback for `binary_sensor` without a known `device_class`. */
7081
- DeviceRole["BinarySensor"] = "binary-sensor";
7082
- DeviceRole["TemperatureSensor"] = "temperature-sensor";
7083
- DeviceRole["HumiditySensor"] = "humidity-sensor";
7084
- DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
7085
- DeviceRole["PressureSensor"] = "pressure-sensor";
7086
- DeviceRole["PowerSensor"] = "power-sensor";
7087
- DeviceRole["EnergySensor"] = "energy-sensor";
7088
- DeviceRole["VoltageSensor"] = "voltage-sensor";
7089
- DeviceRole["CurrentSensor"] = "current-sensor";
7090
- DeviceRole["AirQualitySensor"] = "air-quality-sensor";
7091
- /** Battery level (numeric % via `sensor` OR low-bool via
7092
- * `binary_sensor` — the cap distinguishes via the value type). */
7093
- DeviceRole["BatterySensor"] = "battery-sensor";
7094
- /** Fallback for `sensor` numeric without a known `device_class`. */
7095
- DeviceRole["NumericSensor"] = "numeric-sensor";
7096
- /** String / enum state (HA `sensor` with `state_class: enum` or
7097
- * `attributes.options`). */
7098
- DeviceRole["EnumSensor"] = "enum-sensor";
7099
- /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
7100
- * or `date`). The slice carries the raw ISO string verbatim (hosted on
7101
- * the `enum-sensor` cap); the UI renders it locale-formatted. */
7102
- DeviceRole["DateTimeSensor"] = "datetime-sensor";
7103
- /** Last-resort fallback when nothing else matches. */
7104
- DeviceRole["GenericSensor"] = "generic-sensor";
7105
- DeviceRole["NumericControl"] = "numeric-control";
7106
- DeviceRole["SelectControl"] = "select-control";
7107
- DeviceRole["TextControl"] = "text-control";
7108
- DeviceRole["DateTimeControl"] = "datetime-control";
7109
- /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
7110
- * rich features (image, priority, channel routing). */
7111
- DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
7112
- /** Chat / messaging service (HA `notify.telegram_*`,
7113
- * `notify.discord_*`, etc.). */
7114
- DeviceRole["MessagingNotifier"] = "messaging-notifier";
7115
- /** Email-based delivery (HA `notify.smtp`, etc.). */
7116
- DeviceRole["EmailNotifier"] = "email-notifier";
7117
- /** Fallback when the notifier service name doesn't match a known
7118
- * pattern. */
7119
- DeviceRole["GenericNotifier"] = "generic-notifier";
7120
- return DeviceRole;
7121
- }({});
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);
7122
7266
  /**
7123
7267
  * Accessory device helpers — shared across drivers.
7124
7268
  *
@@ -7382,74 +7526,6 @@ object({
7382
7526
  });
7383
7527
  DeviceType.Sensor;
7384
7528
  /**
7385
- * Generic types for capability definitions.
7386
- *
7387
- * A capability is defined with Zod schemas for methods, events, and settings.
7388
- * TypeScript types are inferred via z.infer<> — zero duplication.
7389
- *
7390
- * Pattern:
7391
- * 1. Define Zod schemas for data, methods, settings
7392
- * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
7393
- * 3. Export type IProvider = InferProvider<typeof capabilityDef>
7394
- * 4. Addon implements IProvider
7395
- * 5. Registry auto-mounts tRPC router from definition.methods
7396
- */
7397
- /**
7398
- * Output schema shared by the contribution + live methods.
7399
- *
7400
- * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
7401
- * tabs[]) without importing from `../interfaces/config-ui.js` — a
7402
- * concrete-but-lenient Zod object keeps tRPC output inference happy
7403
- * (using `z.unknown()` here collapses unrelated router branches to
7404
- * `unknown` when the generator re-inlines the huge AppRouter type).
7405
- *
7406
- * `.passthrough()` on sections/fields accepts whatever FormBuilder
7407
- * extensions the caller adds (showWhen, displayScale, …) without
7408
- * rebuilding every time a new field kind is introduced.
7409
- */
7410
- var ContributionSectionSchema = object({
7411
- id: string(),
7412
- title: string(),
7413
- description: string().optional(),
7414
- style: _enum(["card", "accordion"]).optional(),
7415
- defaultCollapsed: boolean().optional(),
7416
- columns: union([
7417
- literal(1),
7418
- literal(2),
7419
- literal(3),
7420
- literal(4)
7421
- ]).optional(),
7422
- tab: string().optional(),
7423
- location: _enum(["settings", "top-tab"]).optional(),
7424
- order: number().optional(),
7425
- fields: array(any())
7426
- });
7427
- object({
7428
- tabs: array(object({
7429
- id: string(),
7430
- label: string(),
7431
- icon: string(),
7432
- order: number().optional()
7433
- })).optional(),
7434
- sections: array(ContributionSectionSchema)
7435
- }).nullable();
7436
- object({ deviceId: number() }), object({ deviceId: number() }), object({
7437
- deviceId: number(),
7438
- patch: record(string(), unknown())
7439
- }), object({ success: literal(true) });
7440
- object({ deviceId: number() }), unknown().nullable();
7441
- /** Shorthand to define a method schema */
7442
- function method(input, output, options) {
7443
- return {
7444
- input,
7445
- output,
7446
- kind: options?.kind ?? "query",
7447
- auth: options?.auth ?? "protected",
7448
- ...options?.access !== void 0 ? { access: options.access } : {},
7449
- timeoutMs: options?.timeoutMs
7450
- };
7451
- }
7452
- /**
7453
7529
  * Alarm-panel cap. Models HA `alarm_control_panel.*` on
7454
7530
  * `DeviceType.AlarmPanel`. State follows HA's canonical lifecycle
7455
7531
  * across disarmed / armed_(home|away|night|vacation|custom_bypass) /
@@ -9264,6 +9340,24 @@ var DetectorOutputSchema = object({
9264
9340
  inferenceMs: number(),
9265
9341
  modelId: string()
9266
9342
  });
9343
+ var EngineProvisioningSchema = object({
9344
+ runtimeId: _enum([
9345
+ "onnx",
9346
+ "openvino",
9347
+ "coreml"
9348
+ ]).nullable(),
9349
+ device: string().nullable(),
9350
+ state: _enum([
9351
+ "idle",
9352
+ "installing",
9353
+ "verifying",
9354
+ "ready",
9355
+ "failed"
9356
+ ]),
9357
+ progress: number().optional(),
9358
+ error: string().optional(),
9359
+ nextRetryAt: number().optional()
9360
+ });
9267
9361
  var PipelineStepInputSchema = lazy(() => object({
9268
9362
  addonId: string(),
9269
9363
  modelId: string(),
@@ -9332,7 +9426,7 @@ var PipelineRunResultBridge = custom();
9332
9426
  method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(_void(), PipelineEngineChoiceSchema, {
9333
9427
  kind: "mutation",
9334
9428
  auth: "admin"
9335
- }), method(_void(), record(string(), object({
9429
+ }), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
9336
9430
  modelId: string(),
9337
9431
  settings: record(string(), unknown()).readonly()
9338
9432
  }))), method(object({ steps: record(string(), object({
@@ -11693,9 +11787,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
11693
11787
  limit: number().optional(),
11694
11788
  tags: record(string(), string()).optional()
11695
11789
  }), array(LogEntrySchema).readonly());
11696
- var StaticDirOutputSchema = object({ staticDir: string() });
11697
- var VersionOutputSchema = object({ version: string() });
11698
- method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
11699
11790
  /**
11700
11791
  * Zod schemas for persisted record types.
11701
11792
  *
@@ -13179,7 +13270,10 @@ var AgentAddonConfigSchema = object({
13179
13270
  modelId: string(),
13180
13271
  settings: record(string(), unknown()).readonly()
13181
13272
  });
13182
- var AgentPipelineSettingsSchema = object({ addonDefaults: record(string(), AgentAddonConfigSchema).readonly() });
13273
+ var AgentPipelineSettingsSchema = object({
13274
+ addonDefaults: record(string(), AgentAddonConfigSchema).readonly(),
13275
+ maxCameras: number().int().nonnegative().nullable().default(null)
13276
+ });
13183
13277
  var CameraPipelineForAgentSchema = object({
13184
13278
  steps: array(PipelineStepInputSchema).readonly(),
13185
13279
  audio: object({
@@ -13281,6 +13375,133 @@ var GlobalMetricsSchema = object({
13281
13375
  * capability providers.
13282
13376
  */
13283
13377
  var CapabilityBindingsSchema = record(string(), string());
13378
+ /** Source block — always present; derives from the stream catalog. */
13379
+ var CameraSourceStatusSchema = object({ streams: array(object({
13380
+ camStreamId: string(),
13381
+ codec: string(),
13382
+ width: number(),
13383
+ height: number(),
13384
+ fps: number(),
13385
+ kind: string()
13386
+ })).readonly() });
13387
+ /** Assignment block — always present (orchestrator-local, no remote call). */
13388
+ var CameraAssignmentStatusSchema = object({
13389
+ detectionNodeId: string().nullable(),
13390
+ decoderNodeId: string().nullable(),
13391
+ audioNodeId: string().nullable(),
13392
+ pinned: object({
13393
+ detection: boolean(),
13394
+ decoder: boolean(),
13395
+ audio: boolean()
13396
+ }),
13397
+ reasons: object({
13398
+ detection: string().optional(),
13399
+ decoder: string().optional(),
13400
+ audio: string().optional()
13401
+ })
13402
+ });
13403
+ /** Broker block — null when the broker stage is unreachable or inactive. */
13404
+ var CameraBrokerStatusSchema = object({
13405
+ profiles: array(object({
13406
+ profile: string(),
13407
+ status: string(),
13408
+ codec: string(),
13409
+ width: number(),
13410
+ height: number(),
13411
+ subscribers: number(),
13412
+ inFps: number(),
13413
+ outFps: number()
13414
+ })).readonly(),
13415
+ webrtcSessions: number(),
13416
+ rtspRestream: boolean()
13417
+ });
13418
+ /** Shared-memory ring statistics within the decoder block. */
13419
+ var CameraDecoderShmSchema = object({
13420
+ framesWritten: number(),
13421
+ getFrameHits: number(),
13422
+ getFrameMisses: number(),
13423
+ budgetMb: number()
13424
+ });
13425
+ /** Decoder block — null when the decoder stage is unreachable or inactive. */
13426
+ var CameraDecoderStatusSchema = object({
13427
+ nodeId: string(),
13428
+ formats: array(string()).readonly(),
13429
+ sessionCount: number(),
13430
+ shm: CameraDecoderShmSchema
13431
+ });
13432
+ /** Motion block — null when motion detection is not active for this device. */
13433
+ var CameraMotionStatusSchema = object({
13434
+ enabled: boolean(),
13435
+ fps: number()
13436
+ });
13437
+ /** Detection provisioning sub-block. */
13438
+ var CameraDetectionProvisioningSchema = object({
13439
+ state: _enum([
13440
+ "idle",
13441
+ "installing",
13442
+ "verifying",
13443
+ "ready",
13444
+ "failed"
13445
+ ]),
13446
+ error: string().optional()
13447
+ });
13448
+ /** Detection phase — derived from the runner's engine phase. */
13449
+ var CameraDetectionPhaseSchema = _enum([
13450
+ "idle",
13451
+ "watching",
13452
+ "active"
13453
+ ]);
13454
+ /** Detection block — null when no detection node is assigned or reachable. */
13455
+ var CameraDetectionStatusSchema = object({
13456
+ nodeId: string(),
13457
+ engine: object({
13458
+ backend: string(),
13459
+ device: string()
13460
+ }),
13461
+ phase: CameraDetectionPhaseSchema,
13462
+ configuredFps: number(),
13463
+ actualFps: number(),
13464
+ queueDepth: number(),
13465
+ avgInferenceMs: number(),
13466
+ provisioning: CameraDetectionProvisioningSchema
13467
+ });
13468
+ /** Audio block — null when no audio node is assigned or reachable. */
13469
+ var CameraAudioStatusSchema = object({
13470
+ nodeId: string(),
13471
+ enabled: boolean()
13472
+ });
13473
+ /** Recording block — null when no recording cap is active for this device. */
13474
+ var CameraRecordingStatusSchema = object({
13475
+ mode: _enum([
13476
+ "off",
13477
+ "continuous",
13478
+ "events"
13479
+ ]),
13480
+ active: boolean(),
13481
+ storageBytes: number()
13482
+ });
13483
+ /**
13484
+ * Aggregated per-camera pipeline status — server-composed, single call.
13485
+ *
13486
+ * The `assignment` and `source` blocks are always present.
13487
+ * Every other block is `null` when the stage is inactive or unreachable
13488
+ * during the bounded parallel fan-out in the orchestrator implementation.
13489
+ *
13490
+ * See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
13491
+ */
13492
+ var CameraStatusSchema = object({
13493
+ deviceId: number(),
13494
+ assignment: CameraAssignmentStatusSchema,
13495
+ source: CameraSourceStatusSchema,
13496
+ broker: CameraBrokerStatusSchema.nullable(),
13497
+ decoder: CameraDecoderStatusSchema.nullable(),
13498
+ motion: CameraMotionStatusSchema.nullable(),
13499
+ detection: CameraDetectionStatusSchema.nullable(),
13500
+ audio: CameraAudioStatusSchema.nullable(),
13501
+ recording: CameraRecordingStatusSchema.nullable(),
13502
+ /** Unix timestamp (ms) when this snapshot was composed server-side. */
13503
+ fetchedAt: number()
13504
+ });
13284
13505
  method(object({
13285
13506
  deviceId: number(),
13286
13507
  agentNodeId: string()
@@ -13348,6 +13569,12 @@ method(object({
13348
13569
  }), {
13349
13570
  kind: "mutation",
13350
13571
  auth: "admin"
13572
+ }), method(object({
13573
+ agentNodeId: string(),
13574
+ maxCameras: number().int().nonnegative().nullable()
13575
+ }), object({ success: literal(true) }), {
13576
+ kind: "mutation",
13577
+ auth: "admin"
13351
13578
  }), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
13352
13579
  deviceId: number(),
13353
13580
  addonId: string(),
@@ -13373,7 +13600,7 @@ method(object({
13373
13600
  }), method(object({
13374
13601
  deviceId: number(),
13375
13602
  agentNodeId: string().optional()
13376
- }), CameraPipelineConfigSchema), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
13603
+ }), CameraPipelineConfigSchema), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
13377
13604
  name: string(),
13378
13605
  description: string().optional(),
13379
13606
  config: CameraPipelineConfigSchema
@@ -13860,7 +14087,7 @@ method(object({
13860
14087
  }), _void(), {
13861
14088
  kind: "mutation",
13862
14089
  auth: "admin"
13863
- }), 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({
14090
+ }), 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({
13864
14091
  deviceId: number(),
13865
14092
  values: record(string(), unknown())
13866
14093
  }), object({ success: literal(true) }), {
@@ -14585,7 +14812,20 @@ var DiskSpaceInfoSchema = object({
14585
14812
  var PidResourceStatsSchema = object({
14586
14813
  pid: number(),
14587
14814
  cpu: number(),
14588
- memory: number()
14815
+ memory: number(),
14816
+ /**
14817
+ * Private (anonymous) resident bytes — the per-process V8 heap + native
14818
+ * allocations NOT shared with other processes (Linux RssAnon). This is the
14819
+ * "real" per-runner cost; summing it across runners is meaningful, unlike
14820
+ * `memory` (RSS), which double-counts the shared mmap'd framework code.
14821
+ * Undefined where /proc is unavailable (e.g. macOS).
14822
+ */
14823
+ privateBytes: number().optional(),
14824
+ /**
14825
+ * Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
14826
+ * code shared copy-on-write across runners. Undefined on macOS.
14827
+ */
14828
+ sharedBytes: number().optional()
14589
14829
  });
14590
14830
  var AddonInstanceSchema = object({
14591
14831
  addonId: string(),
@@ -14634,6 +14874,17 @@ var KillProcessResultSchema = object({
14634
14874
  reason: string().optional(),
14635
14875
  signal: _enum(["SIGTERM", "SIGKILL"]).optional()
14636
14876
  });
14877
+ var DumpHeapSnapshotInputSchema = object({
14878
+ /** The addon whose runner should dump a heap snapshot. */
14879
+ addonId: string() });
14880
+ var DumpHeapSnapshotResultSchema = object({
14881
+ success: boolean(),
14882
+ /** Path of the written .heapsnapshot inside the runner's container/host. */
14883
+ path: string().optional(),
14884
+ /** Process pid that was signalled. */
14885
+ pid: number().optional(),
14886
+ reason: string().optional()
14887
+ });
14637
14888
  var SystemMetricsSchema = object({
14638
14889
  cpuPercent: number(),
14639
14890
  memoryPercent: number(),
@@ -14647,6 +14898,9 @@ var SystemMetricsSchema = object({
14647
14898
  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, {
14648
14899
  kind: "mutation",
14649
14900
  auth: "admin"
14901
+ }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
14902
+ kind: "mutation",
14903
+ auth: "admin"
14650
14904
  });
14651
14905
  var PtzPresetSchema = object({
14652
14906
  id: string(),
@@ -15055,63 +15309,6 @@ method(object({
15055
15309
  auth: "admin"
15056
15310
  });
15057
15311
  /**
15058
- * device-ops — device-scoped cap that unifies the per-IDevice operations
15059
- * previously routed through the `.device-ops` Moleculer bridge service.
15060
- *
15061
- * Each worker that hosts live `IDevice` instances auto-registers a native
15062
- * provider for this cap (per device) backed by its local
15063
- * `DeviceRegistry`. Hub-side callers reach it transparently through
15064
- * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
15065
- * `deviceId` + `nodeId` and dispatches through the standard cap-router,
15066
- * so there's no parallel bridge path anymore.
15067
- *
15068
- * The surface is intentionally small — every method corresponds to a
15069
- * single action on the live `IDevice` (or `ICameraDevice` for
15070
- * `getStreamSources`). Richer orchestration (enable/disable with
15071
- * integration plumbing, bulk updates) stays in the `device-manager` cap;
15072
- * `device-ops` is the per-device primitive the device-manager routes to.
15073
- */
15074
- var StreamSourceEntrySchema$1 = object({
15075
- id: string(),
15076
- label: string(),
15077
- protocol: _enum([
15078
- "rtsp",
15079
- "rtmp",
15080
- "annexb",
15081
- "http-mjpeg",
15082
- "webrtc",
15083
- "custom"
15084
- ]),
15085
- url: string().optional(),
15086
- resolution: object({
15087
- width: number(),
15088
- height: number()
15089
- }).optional(),
15090
- fps: number().optional(),
15091
- bitrate: number().optional(),
15092
- codec: string().optional(),
15093
- profileHint: CamProfileSchema.optional(),
15094
- sdp: string().optional()
15095
- });
15096
- var ConfigEntrySchema$1 = object({
15097
- key: string(),
15098
- value: unknown()
15099
- });
15100
- var RawStateResultSchema = object({
15101
- /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
15102
- source: string(),
15103
- /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
15104
- data: record(string(), unknown())
15105
- });
15106
- method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
15107
- deviceId: number(),
15108
- values: record(string(), unknown())
15109
- }), _void(), { kind: "mutation" }), method(object({
15110
- deviceId: number(),
15111
- action: string().min(1),
15112
- input: unknown()
15113
- }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
15114
- /**
15115
15312
  * camera-credentials — device-scoped cap exposing the camera's network
15116
15313
  * + auth surface in a vendor-neutral shape.
15117
15314
  *
@@ -18794,6 +18991,12 @@ Object.freeze({
18794
18991
  addonId: null,
18795
18992
  access: "view"
18796
18993
  },
18994
+ "metricsProvider.dumpHeapSnapshot": {
18995
+ capName: "metrics-provider",
18996
+ capScope: "system",
18997
+ addonId: null,
18998
+ access: "create"
18999
+ },
18797
19000
  "metricsProvider.getAddonStats": {
18798
19001
  capName: "metrics-provider",
18799
19002
  capScope: "system",
@@ -19250,6 +19453,12 @@ Object.freeze({
19250
19453
  addonId: null,
19251
19454
  access: "view"
19252
19455
  },
19456
+ "pipelineExecutor.getEngineProvisioning": {
19457
+ capName: "pipeline-executor",
19458
+ capScope: "system",
19459
+ addonId: null,
19460
+ access: "view"
19461
+ },
19253
19462
  "pipelineExecutor.getGlobalPipelineConfig": {
19254
19463
  capName: "pipeline-executor",
19255
19464
  capScope: "system",
@@ -19454,6 +19663,18 @@ Object.freeze({
19454
19663
  addonId: null,
19455
19664
  access: "view"
19456
19665
  },
19666
+ "pipelineOrchestrator.getCameraStatus": {
19667
+ capName: "pipeline-orchestrator",
19668
+ capScope: "system",
19669
+ addonId: null,
19670
+ access: "view"
19671
+ },
19672
+ "pipelineOrchestrator.getCameraStatuses": {
19673
+ capName: "pipeline-orchestrator",
19674
+ capScope: "system",
19675
+ addonId: null,
19676
+ access: "view"
19677
+ },
19457
19678
  "pipelineOrchestrator.getCameraStepOverrides": {
19458
19679
  capName: "pipeline-orchestrator",
19459
19680
  capScope: "system",
@@ -19538,6 +19759,12 @@ Object.freeze({
19538
19759
  addonId: null,
19539
19760
  access: "create"
19540
19761
  },
19762
+ "pipelineOrchestrator.setAgentMaxCameras": {
19763
+ capName: "pipeline-orchestrator",
19764
+ capScope: "system",
19765
+ addonId: null,
19766
+ access: "create"
19767
+ },
19541
19768
  "pipelineOrchestrator.setCameraPipelineForAgent": {
19542
19769
  capName: "pipeline-orchestrator",
19543
19770
  capScope: "system",