@camstack/addon-post-analysis 1.0.5 → 1.0.7

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.
@@ -4649,63 +4649,7 @@ function _instanceof(cls, params = {}) {
4649
4649
  return inst;
4650
4650
  }
4651
4651
  //#endregion
4652
- //#region ../types/dist/index.mjs
4653
- /**
4654
- * Deep wiring healthcheck — snapshot of active reachability probes across
4655
- * every declared capability + widget of every installed plugin, on every
4656
- * node. Produced by the backend `WiringHealthService` and surfaced via
4657
- * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
4658
- *
4659
- * Unlike `/health` (process liveness), this reflects whether each cap/widget
4660
- * is actually *reachable* over the real cap-dispatch path. See spec
4661
- * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
4662
- */
4663
- /** What kind of target a probe addressed. */
4664
- var wiringProbeKindSchema = _enum([
4665
- "singleton",
4666
- "device",
4667
- "widget"
4668
- ]);
4669
- /** Result of probing a single (cap|widget [, device]) target. */
4670
- var wiringProbeResultSchema = object({
4671
- capName: string(),
4672
- kind: wiringProbeKindSchema,
4673
- deviceId: number().optional(),
4674
- reachable: boolean(),
4675
- latencyMs: number(),
4676
- error: string().optional()
4677
- });
4678
- /** Per-addon roll-up of cap + widget probe results. */
4679
- var wiringAddonHealthSchema = object({
4680
- addonId: string(),
4681
- caps: array(wiringProbeResultSchema).readonly(),
4682
- widgets: array(wiringProbeResultSchema).readonly()
4683
- });
4684
- /** Per-node roll-up. */
4685
- var wiringNodeHealthSchema = object({
4686
- nodeId: string(),
4687
- addons: array(wiringAddonHealthSchema).readonly()
4688
- });
4689
- object({
4690
- /** True only when every probed target is reachable. */
4691
- ok: boolean(),
4692
- /** True when at least one target is unreachable. */
4693
- degraded: boolean(),
4694
- checkedAt: string(),
4695
- nodes: array(wiringNodeHealthSchema).readonly(),
4696
- summary: object({
4697
- total: number(),
4698
- reachable: number(),
4699
- unreachable: number()
4700
- })
4701
- });
4702
- var MODEL_FORMATS = [
4703
- "onnx",
4704
- "coreml",
4705
- "openvino",
4706
- "tflite",
4707
- "pt"
4708
- ];
4652
+ //#region ../types/dist/sleep-D7JeS58T.mjs
4709
4653
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4710
4654
  EventCategory["SystemBoot"] = "system.boot";
4711
4655
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5003,6 +4947,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
5003
4947
  */
5004
4948
  EventCategory["PipelineEngineMetricsSnapshot"] = "pipeline.engine-metrics-snapshot";
5005
4949
  /**
4950
+ * Per-node detection-engine runtime-provisioning transition. Emitted by
4951
+ * the detection-pipeline provider on every state change of its lazy
4952
+ * engine-provisioning machine (idle → installing → verifying → ready,
4953
+ * or → failed with a `nextRetryAt`). Payload is the
4954
+ * `EngineProvisioningState` snapshot; `event.source.nodeId` carries the
4955
+ * node. The Pipeline page subscribes to drive a live "installing
4956
+ * OpenVINO… / ready" indicator per node without polling
4957
+ * `pipelineExecutor.getEngineProvisioning`. Telemetry-grade (D8): the UI
4958
+ * also reads the cap snapshot on mount / reconnect. Phase 2.
4959
+ */
4960
+ EventCategory["PipelineEngineProvisioning"] = "pipeline.engine-provisioning";
4961
+ /**
5006
4962
  * Cluster topology snapshot. Carries the same payload returned by
5007
4963
  * `nodes.topology` (every reachable node + addons + processes).
5008
4964
  * Emitted by the hub on any agent / addon lifecycle change
@@ -6016,7 +5972,7 @@ var ProfileSlotSchema = object({
6016
5972
  * Zod schema for StreamSourceEntry — the canonical stream descriptor
6017
5973
  * exposed by ICameraDevice.getStreamSources() and consumed by the broker.
6018
5974
  */
6019
- var StreamSourceEntrySchema = object({
5975
+ var StreamSourceEntrySchema$1 = object({
6020
5976
  id: string(),
6021
5977
  label: string(),
6022
5978
  protocol: _enum([
@@ -6238,923 +6194,1111 @@ var ProfileRtspEntrySchema = object({
6238
6194
  codec: string().optional(),
6239
6195
  resolution: CamStreamResolutionSchema.optional()
6240
6196
  });
6241
- /**
6242
- * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6243
- * Named `RecordingWeekday` to avoid collision with the string-union
6244
- * `Weekday` exported from `interfaces/timezones.ts`.
6245
- */
6246
- var RecordingWeekdaySchema = number().int().min(0).max(6);
6247
- var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6248
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6249
- kind: literal("timeOfDay"),
6250
- start: string().regex(HHMM),
6251
- end: string().regex(HHMM),
6252
- /** Restrict to these weekdays; omit = every day. */
6253
- days: array(RecordingWeekdaySchema).optional()
6254
- })]);
6255
- var RecordingModeSchema = _enum([
6256
- "continuous",
6257
- "onMotion",
6258
- "onAudioThreshold"
6259
- ]);
6260
- /**
6261
- * First-class, authoritative per-camera storage mode the netta choice the UI
6262
- * reads directly (never inferred from `rules`):
6263
- * - `off` — not recording.
6264
- * - `events` — record only around triggers (motion / audio threshold),
6265
- * with pre/post-buffer.
6266
- * - `continuous` record 24/7 within the schedule.
6267
- *
6268
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6269
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6270
- */
6271
- var RecordingStorageModeSchema = _enum([
6272
- "off",
6273
- "events",
6274
- "continuous"
6275
- ]);
6276
- /** Which detectors trigger an `events`-mode recording. */
6277
- var RecordingTriggersSchema = object({
6278
- motion: boolean().optional(),
6279
- audioThresholdDbfs: number().optional()
6280
- });
6281
- /**
6282
- * Mode of a single recording band the recorder per-band vocabulary.
6283
- *
6284
- * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6285
- * only ever `continuous` or `events`; "off" is expressed by the absence of a
6286
- * covering band, not by a band value.
6287
- */
6288
- var RecordingBandModeSchema = _enum(["continuous", "events"]);
6289
- /**
6290
- * Triggers for an `events`-mode band. Identical shape to
6291
- * `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
6292
- * two never drift.
6293
- */
6294
- var RecordingBandTriggersSchema = RecordingTriggersSchema;
6295
- /**
6296
- * A single mode-per-band window the canonical recorder band shape, the
6297
- * single source of truth re-used by `addon-pipeline/recorder`.
6298
- *
6299
- * `days` lists the weekdays the band covers (empty = every day, matching the
6300
- * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6301
- * span wraps past midnight (handled by the band engine).
6302
- */
6303
- var RecordingBandSchema = object({
6304
- days: array(RecordingWeekdaySchema),
6305
- start: string().regex(HHMM),
6306
- end: string().regex(HHMM),
6307
- mode: RecordingBandModeSchema,
6308
- triggers: RecordingBandTriggersSchema.optional(),
6309
- preBufferSec: number().min(0).optional(),
6310
- postBufferSec: number().min(0).optional()
6311
- });
6312
- var RecordingRuleSchema = object({
6313
- schedule: RecordingScheduleSchema,
6314
- mode: RecordingModeSchema,
6315
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6316
- preBufferSec: number().min(0).default(0),
6317
- /** Keep recording until this many seconds after the last trigger. */
6318
- postBufferSec: number().min(0).default(0),
6319
- /** Each new trigger restarts the post-buffer window. */
6320
- resetTimeoutOnNewEvent: boolean().default(true),
6321
- /** onAudioThreshold only dBFS level that counts as a trigger. */
6322
- thresholdDbfs: number().optional()
6323
- });
6324
- /**
6325
- * Per-device retention overrides. Every field is optional; an unset or `0`
6326
- * value inherits the node-wide recorder default. Only footage-lifetime limits
6327
- * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6328
- * (when the volume is too full to keep recording) is NOT a per-camera concern —
6329
- * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6330
- * shared by every camera writing to that volume.
6331
- */
6332
- var RecordingRetentionSchema = object({
6333
- maxAgeDays: number().min(0).optional(),
6334
- maxSizeGb: number().min(0).optional()
6335
- });
6336
- /**
6337
- * The full per-camera recording intent — the wire shape of a RecordingTarget.
6338
- *
6339
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6340
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6341
- * only for transition + migration (`migrateRulesToMode`); the policy engine
6342
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6343
- */
6344
- var RecordingConfigSchema = object({
6345
- enabled: boolean(),
6346
- /** Authoritative storage mode. Absent on legacy targets → derived once via
6347
- * `migrateRulesToMode`, then persisted. */
6348
- mode: RecordingStorageModeSchema.optional(),
6349
- profiles: array(CamProfileSchema).optional(),
6350
- segmentSeconds: number().int().positive().optional(),
6351
- /** Shared recording time-bands for `events` & `continuous` — record only when
6352
- * the wall-clock falls inside one of these windows. Omit or empty = always.
6353
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
6354
- schedules: array(RecordingScheduleSchema).optional(),
6355
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
6356
- * normalized into `schedules` on read and never written going forward. (Not
6357
- * tagged `@deprecated`: the normalization paths must read it cast-free.) */
6358
- schedule: RecordingScheduleSchema.optional(),
6359
- /** `events`-mode only — which detectors trigger a recording. */
6360
- triggers: RecordingTriggersSchema.optional(),
6361
- /** `events`-mode only — seconds retained before / after a trigger. */
6362
- preBufferSec: number().min(0).optional(),
6363
- postBufferSec: number().min(0).optional(),
6364
- /** DEPRECATED authoring input; retained for migration/transition. */
6365
- rules: array(RecordingRuleSchema).optional(),
6366
- /**
6367
- * AUTHORITATIVE mode-per-band recording model (recorder). When present it
6368
- * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
6369
- * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
6370
- * derived into bands once via `migrateConfigToBands`.
6371
- */
6372
- bands: array(RecordingBandSchema).optional(),
6373
- retention: RecordingRetentionSchema.optional()
6374
- });
6375
- /**
6376
- * `StorageLocationType` — an addon-declared id that identifies the *kind* of
6377
- * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
6378
- * so the persisted record schema and the consumer-facing cap can both consume it
6379
- * without forming a circular import. The `storage` cap re-exports it
6380
- * verbatim for back-compat.
6381
- *
6382
- * This Zod schema is the **authoritative source** for `StorageLocationType`.
6383
- * The TS alias in `./storage.ts` re-exports `z.infer<typeof
6384
- * StorageLocationTypeSchema>` so the wire surface (cap) and the legacy
6385
- * `IStorageProvider` interface stay in lockstep.
6386
- *
6387
- * The type is now an **open string** (not a closed enum) — addons declare
6388
- * their own location kinds via `StorageLocationDeclaration.id`. The regex
6389
- * enforces a safe id format: lowercase-start, alphanumeric + hyphens.
6390
- */
6391
- var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
6392
- /**
6393
- * Persisted record for a storage location instance. Operators can register
6394
- * multiple instances for multi-cardinality types (e.g. two `backups`
6395
- * locations with different `providerId`s). Cardinality is now declared per
6396
- * location via `StorageLocationDeclaration.cardinality` — the static
6397
- * `STORAGE_LOCATION_CARDINALITY` map has been removed.
6398
- *
6399
- * `id` is a stable namespaced string of the form `<type>:<slug>`.
6400
- * The default location for a type uses `id === <type>:default` by
6401
- * convention (the bare type ref like `'backups'` resolves to it).
6402
- *
6403
- * `isSystem: true` marks a location as orchestrator-seeded and
6404
- * undeletable. The bootstrap-installed defaults (one per type) carry
6405
- * this flag; operator-added locations don't. Editing the config of
6406
- * a system location is allowed (path migration, provider swap) but
6407
- * deleting it is rejected at the cap level.
6408
- */
6409
- var StorageLocationSchema = object({
6410
- id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
6411
- type: string(),
6412
- displayName: string().min(1),
6413
- providerId: string().min(1),
6414
- config: record(string(), unknown()),
6415
- /**
6416
- * Cluster node this location physically lives on. REQUIRED for node-local
6417
- * providers (filesystem — the path exists on one node's disk), null/absent
6418
- * for node-agnostic providers (S3/SFTP/WebDAV, reachable from any node).
6419
- * `'hub'` is the hub node. Validated against the provider's `nodeLocal`
6420
- * flag at upsert time, not here (the schema is provider-agnostic).
6421
- */
6422
- nodeId: string().optional(),
6423
- isDefault: boolean().default(false),
6424
- isSystem: boolean().default(false),
6425
- createdAt: number(),
6426
- updatedAt: number()
6427
- });
6428
- /**
6429
- * Reference accepted by consumer-facing `api.storage.*` calls.
6430
- * Either:
6431
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
6432
- * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
6433
- *
6434
- * The orchestrator's `resolveRef(ref)` handles both cases.
6435
- */
6436
- var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]);
6437
- /**
6438
- * `StorageLocationDeclaration` — a single storage-location entry declared by
6439
- * an addon in its `package.json` under `camstack.storageLocations`.
6440
- *
6441
- * Design intent:
6442
- * - **Addon declares its needs** — each addon describes the logical storage
6443
- * slots it requires (e.g. `recordings`, `recordingsLow`) without caring
6444
- * about the physical path.
6445
- * - **Kernel aggregates** — at boot the kernel collects declarations from all
6446
- * installed addons, deduplicates by `id`, and exposes the union via the
6447
- * storage-locations settings surface.
6448
- * - **Orchestrator seeds** — for every declared `id` the orchestrator ensures
6449
- * at least one instance named `<id>:default` is present, using
6450
- * `defaultsTo` to inherit the resolved root from another location when the
6451
- * declaration is a derivative slot (e.g. `recordingsLow` defaults to
6452
- * `recordings`).
6453
- * - **ids are global** — `id` values are shared across the entire deployment;
6454
- * two addons declaring the same `id` must agree on `cardinality` (validated
6455
- * at kernel aggregation time, not here).
6456
- */
6457
- var StorageLocationDeclarationSchema = object({
6458
- /**
6459
- * Global location identifier, e.g. `recordings` or `recordingsLow`.
6460
- * Must start with a lowercase letter and may contain letters, digits, and
6461
- * hyphens.
6462
- */
6463
- id: string().regex(/^[a-z][a-zA-Z0-9-]*$/, { message: "id must start with a lowercase letter and contain only letters, digits, or hyphens" }),
6464
- /** Human-readable name shown in the admin UI. */
6465
- displayName: string().min(1, { message: "displayName must not be empty" }),
6466
- /** Optional longer explanation of what data this location stores. */
6467
- description: string().optional(),
6468
- /**
6469
- * `single` — exactly one instance of this location is allowed system-wide
6470
- * (e.g. `logs`, `models`). The operator can edit it but not add more.
6471
- * `multi` — the operator may register several instances (e.g. a second
6472
- * `recordings` on a NAS for disk tiering); one is the default at any time.
6473
- */
6474
- cardinality: _enum(["single", "multi"]),
6475
- /**
6476
- * When set, the default instance for this location inherits its resolved
6477
- * root from the named location's default instance. Useful for derivative
6478
- * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
6479
- * configure the primary location.
6480
- */
6481
- defaultsTo: string().optional()
6482
- });
6483
- var DecoderStatsSchema = object({
6484
- inputFps: number(),
6485
- outputFps: number(),
6486
- avgDecodeTimeMs: number(),
6487
- droppedFrames: number()
6488
- });
6489
- var DecoderSessionConfigSchema = object({
6490
- codec: string(),
6491
- maxFps: number().default(0),
6492
- outputFormat: _enum([
6493
- "jpeg",
6494
- "rgb",
6495
- "bgr",
6496
- "yuv420",
6497
- "gray"
6498
- ]).default("jpeg"),
6499
- scale: number().default(1),
6500
- width: number().optional(),
6501
- height: number().optional(),
6197
+ /** Narrow an unknown value to a plain `Record<string, unknown>` or return null. */
6198
+ function asJsonObject(value) {
6199
+ if (value === null || typeof value !== "object" || Array.isArray(value)) return null;
6200
+ return { ...value };
6201
+ }
6202
+ var DeviceType = /* @__PURE__ */ function(DeviceType) {
6203
+ DeviceType["Camera"] = "camera";
6204
+ DeviceType["Hub"] = "hub";
6205
+ DeviceType["Light"] = "light";
6206
+ DeviceType["Siren"] = "siren";
6207
+ DeviceType["Switch"] = "switch";
6208
+ DeviceType["Sensor"] = "sensor";
6209
+ DeviceType["Thermostat"] = "thermostat";
6210
+ DeviceType["Button"] = "button";
6211
+ /** Generic stateless event emitter — carries a device's EXACT declared
6212
+ * event vocabulary verbatim (no normalization). Installed with the
6213
+ * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6214
+ * HA bus events (e.g. `zha_event`, generic). */
6215
+ DeviceType["EventEmitter"] = "event-emitter";
6216
+ /** Firmware/software update entity — current vs available version,
6217
+ * updatable flag, update state, and an install action. Installed with
6218
+ * the `update` cap. Sources: Homematic firmware-update channels (and
6219
+ * reusable by other providers, e.g. HA `update.*` entities). */
6220
+ DeviceType["Update"] = "update";
6221
+ DeviceType["Generic"] = "generic";
6222
+ /** Generic notification delivery target (HA `notify.<service>`, future
6223
+ * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6224
+ * endpoint; the `notifier` cap defines the send surface. */
6225
+ DeviceType["Notifier"] = "notifier";
6226
+ /** Pre-recorded action sequence with optional parameters
6227
+ * (HA `script.*`). Runnable via `script-runner` cap. */
6228
+ DeviceType["Script"] = "script";
6229
+ /** Automation rule (HA `automation.*`) — enable/disable + manual
6230
+ * trigger surface exposed via `automation-control` cap. */
6231
+ DeviceType["Automation"] = "automation";
6232
+ /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6233
+ DeviceType["Lock"] = "lock";
6234
+ /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6235
+ * `valve.*`). `cover` cap with sub-roles for variant. */
6236
+ DeviceType["Cover"] = "cover";
6237
+ /** Pipe / water / gas valve with open/close/stop and optional
6238
+ * position (HA `valve.*`). `valve` capa cover-sibling actuator
6239
+ * modelled on the same open/closed lifecycle. */
6240
+ DeviceType["Valve"] = "valve";
6241
+ /** Humidifier / dehumidifier with on/off + target humidity + mode
6242
+ * (HA `humidifier.*`). `humidifier` cap a climate-family actuator
6243
+ * modelled on the same target / mode lifecycle. */
6244
+ DeviceType["Humidifier"] = "humidifier";
6245
+ /** Water heater / boiler with target temperature + operation mode +
6246
+ * away mode (HA `water_heater.*`). `water-heater` cap a
6247
+ * climate-family actuator. */
6248
+ DeviceType["WaterHeater"] = "water-heater";
6249
+ /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6250
+ DeviceType["Fan"] = "fan";
6251
+ /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6252
+ * the camera surfacethose use `Camera`. `media-player` cap. */
6253
+ DeviceType["MediaPlayer"] = "media-player";
6254
+ /** Security panel / alarm system (HA `alarm_control_panel.*`).
6255
+ * `alarm-panel` cap. */
6256
+ DeviceType["AlarmPanel"] = "alarm-panel";
6257
+ /** Generic user-settable input (HA `number` / `input_number` / `select`
6258
+ * / `input_select` / `text` / `input_text` / `input_datetime`).
6259
+ * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6260
+ * TextControl / DateTimeControl. */
6261
+ DeviceType["Control"] = "control";
6262
+ /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6263
+ * `presence` cap. */
6264
+ DeviceType["Presence"] = "presence";
6265
+ /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6266
+ * `weather` cap. */
6267
+ DeviceType["Weather"] = "weather";
6268
+ /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6269
+ DeviceType["Vacuum"] = "vacuum";
6270
+ /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6271
+ * `lawn-mower-control` cap. */
6272
+ DeviceType["LawnMower"] = "lawn-mower";
6273
+ /** Physical HA device group parent container for entity-children
6274
+ * adopted from a single HA device entry. Not renderable as a
6275
+ * standalone device; exists only to anchor child entities. */
6276
+ DeviceType["Container"] = "container";
6277
+ /** Single still-image entity (HA `image.*`). Read-only display of an
6278
+ * `entity_picture` signed URL the browser loads directly. `image` cap. */
6279
+ DeviceType["Image"] = "image";
6280
+ return DeviceType;
6281
+ }({});
6282
+ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6283
+ DeviceFeature["BatteryOperated"] = "battery-operated";
6284
+ DeviceFeature["Rebootable"] = "rebootable";
6502
6285
  /**
6503
- * Identifier of the camera this decoder session serves. Optional
6504
- * because the cap is generic (any caller could request decode), but
6505
- * stream-broker passes it so decoder logs include `deviceId` for
6506
- * per-camera filtering when diagnosing failures (e.g. node-av
6507
- * sendPacket errors on a single hung camera).
6286
+ * Device supports an on-demand re-sync of its derived spec with its
6287
+ * upstream source drives the generic Re-sync button. The owning
6288
+ * provider implements the action via the `device-adoption.resync` cap.
6508
6289
  */
6509
- deviceId: number().int().nonnegative().optional(),
6290
+ DeviceFeature["Resyncable"] = "resyncable";
6291
+ DeviceFeature["NativeSnapshot"] = "native-snapshot";
6292
+ DeviceFeature["DoorbellButton"] = "doorbell-button";
6293
+ DeviceFeature["TwoWayAudio"] = "two-way-audio";
6294
+ DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6510
6295
  /**
6511
- * Free-form tag for log scoping. Stream-broker uses
6512
- * `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
6513
- * on every line so `grep tag=broker:5/high` filters one camera
6514
- * profile cleanly.
6296
+ * Camera supports the on-firmware autotrack subsystem (subject-
6297
+ * following). Distinct from `PanTiltZoom` because not every PTZ
6298
+ * camera ships autotrack the admin UI uses this flag to gate
6299
+ * the autotrack toggle / settings card without re-deriving from
6300
+ * the cap registry. Mirrors `ptz-autotrack` cap registration:
6301
+ * driver sets this feature when probe confirms the firmware
6302
+ * surface, and registers the cap in the same code path.
6515
6303
  */
6516
- tag: string().optional(),
6304
+ DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6517
6305
  /**
6518
- * Where the session delivers decoded frames (Phase 5 / D9):
6306
+ * Accessory exposes a "trigger on motion" toggle the parent camera's
6307
+ * motion detection automatically activates this device. Mirrors
6308
+ * `motion-trigger` cap registration: drivers set this feature in the
6309
+ * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6519
6310
  *
6520
- * - `'callback'` (default) the legacy pixel path: decoded frames are
6521
- * buffered as `DecodedFrame`s and drained via `pullFrames`.
6522
- * - `'shm'` the shared-memory frame plane: decoded frames are written
6523
- * into an OS shared-memory ring and drained as zero-pixel
6524
- * `FrameHandle`s via `pullHandles`. A session is one mode or the
6525
- * other — `pullFrames` returns nothing for an `'shm'` session and
6526
- * `pullHandles` returns nothing for a `'callback'` session.
6527
- */
6528
- frameSink: _enum(["callback", "shm"]).default("callback")
6529
- });
6530
- var EncodeProfileSchema = object({
6531
- video: object({
6532
- codec: _enum([
6533
- "h264",
6534
- "h265",
6535
- "copy"
6536
- ]),
6537
- profile: _enum([
6538
- "baseline",
6539
- "main",
6540
- "high"
6541
- ]).optional(),
6542
- width: number().int().positive().optional(),
6543
- height: number().int().positive().optional(),
6544
- fps: number().positive().optional(),
6545
- bitrateKbps: number().int().positive().optional(),
6546
- gopFrames: number().int().positive().optional(),
6547
- bf: number().int().min(0).optional(),
6548
- preset: _enum([
6549
- "ultrafast",
6550
- "superfast",
6551
- "veryfast",
6552
- "faster",
6553
- "fast",
6554
- "medium"
6555
- ]).optional(),
6556
- tune: _enum([
6557
- "zerolatency",
6558
- "film",
6559
- "animation"
6560
- ]).optional()
6561
- }),
6562
- audio: union([literal("passthrough"), object({
6563
- codec: _enum([
6564
- "opus",
6565
- "aac",
6566
- "pcmu",
6567
- "pcma",
6568
- "copy"
6569
- ]),
6570
- bitrateKbps: number().int().positive().optional(),
6571
- sampleRateHz: number().int().positive().optional(),
6572
- channels: union([literal(1), literal(2)]).optional()
6573
- })]),
6574
- /**
6575
- * ffmpeg input-side args, inserted between the fixed global flags
6576
- * (`-hide_banner -loglevel error`) and `-i pipe:0`. Free-text array
6577
- * — the widget surfaces a textarea + suggestion chips for the most-
6578
- * used demuxer/format options.
6579
- */
6580
- inputArgs: array(string()).optional(),
6581
- /**
6582
- * ffmpeg output-side args, inserted between the encode block and
6583
- * the final `-f <muxer> pipe:1`. Use for muxer options, bitstream
6584
- * filters, codec-specific overrides. Free-text array.
6311
+ * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6312
+ * fast scalar without binding fetch), notifier rules, and `listAll`
6313
+ * filters that want "all devices with on-motion behaviour".
6585
6314
  */
6586
- outputArgs: array(string()).optional()
6587
- });
6588
- /** Narrow an unknown value to a plain `Record<string, unknown>` or return null. */
6589
- function asJsonObject(value) {
6590
- if (value === null || typeof value !== "object" || Array.isArray(value)) return null;
6591
- return { ...value };
6592
- }
6593
- /** Cosine similarity between two embedding vectors */
6594
- function cosineSimilarity(a, b) {
6595
- if (a.length !== b.length) return 0;
6596
- let dotProduct = 0;
6597
- let normA = 0;
6598
- let normB = 0;
6599
- for (let i = 0; i < a.length; i++) {
6600
- dotProduct += a[i] * b[i];
6601
- normA += a[i] * a[i];
6602
- normB += b[i] * b[i];
6603
- }
6604
- const denom = Math.sqrt(normA) * Math.sqrt(normB);
6605
- return denom === 0 ? 0 : dotProduct / denom;
6606
- }
6315
+ DeviceFeature["MotionTrigger"] = "motion-trigger";
6316
+ /** Light supports rgb-triplet color via `color` cap. */
6317
+ DeviceFeature["LightColorRgb"] = "light-color-rgb";
6318
+ /** Light supports HSV color via `color` cap. */
6319
+ DeviceFeature["LightColorHsv"] = "light-color-hsv";
6320
+ /** Light supports color-temperature (mired) via `color` cap. */
6321
+ DeviceFeature["LightColorMired"] = "light-color-mired";
6322
+ /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6323
+ * targetHigh). Gates the range slider UI. */
6324
+ DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6325
+ /** Thermostat exposes target humidity and/or current humidity
6326
+ * readings. Gates the humidity controls. */
6327
+ DeviceFeature["ClimateHumidity"] = "climate-humidity";
6328
+ /** Thermostat exposes a fan-mode selector. */
6329
+ DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6330
+ /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6331
+ DeviceFeature["ClimatePreset"] = "climate-preset";
6332
+ /** Cover exposes intermediate position control (0..100). Gates the
6333
+ * position slider UI. */
6334
+ DeviceFeature["CoverPositionable"] = "cover-positionable";
6335
+ /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6336
+ DeviceFeature["CoverTilt"] = "cover-tilt";
6337
+ /** Valve exposes intermediate position control (0..100). Gates the
6338
+ * position slider / drag surface UI. */
6339
+ DeviceFeature["ValvePositionable"] = "valve-positionable";
6340
+ /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6341
+ DeviceFeature["FanSpeed"] = "fan-speed";
6342
+ /** Fan exposes a preset mode selector. */
6343
+ DeviceFeature["FanPreset"] = "fan-preset";
6344
+ /** Fan exposes blade direction (forward/reverse) — typical of
6345
+ * ceiling fans. */
6346
+ DeviceFeature["FanDirection"] = "fan-direction";
6347
+ /** Fan exposes an oscillation toggle. */
6348
+ DeviceFeature["FanOscillating"] = "fan-oscillating";
6349
+ /** Lock requires a PIN code on lock/unlock. Gates the code-entry
6350
+ * field on the UI lock-controls panel. */
6351
+ DeviceFeature["LockPinRequired"] = "lock-pin-required";
6352
+ /** Lock supports a latch-release ("open door") action distinct from
6353
+ * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
6354
+ * `supported_features`. Gates the Open Door button in the UI. */
6355
+ DeviceFeature["LockOpen"] = "lock-open";
6356
+ /** Media player exposes a seek-to-position surface. */
6357
+ DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
6358
+ /** Media player exposes a volume-level setter. */
6359
+ DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
6360
+ /** Media player exposes a mute toggle distinct from volume=0. */
6361
+ DeviceFeature["MediaPlayerMute"] = "media-player-mute";
6362
+ /** Media player exposes a shuffle toggle. */
6363
+ DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
6364
+ /** Media player exposes a repeat mode (off / all / one). */
6365
+ DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
6366
+ /** Media player exposes a source / input selector. */
6367
+ DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
6368
+ /** Media player exposes a play-arbitrary-media surface (URL / id). */
6369
+ DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
6370
+ /** Media player exposes next-track. */
6371
+ DeviceFeature["MediaPlayerNext"] = "media-player-next";
6372
+ /** Media player exposes previous-track. */
6373
+ DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
6374
+ /** Media player exposes stop distinct from pause. */
6375
+ DeviceFeature["MediaPlayerStop"] = "media-player-stop";
6376
+ /** Alarm panel requires a PIN code on arm/disarm. */
6377
+ DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
6378
+ /** Presence device carries GPS coordinates (lat/lng/accuracy) in
6379
+ * addition to a textual location. */
6380
+ DeviceFeature["PresenceGps"] = "presence-gps";
6381
+ /** Notifier accepts an inline / URL image attachment. */
6382
+ DeviceFeature["NotifierImage"] = "notifier-image";
6383
+ /** Notifier accepts a priority hint (high/normal/low). */
6384
+ DeviceFeature["NotifierPriority"] = "notifier-priority";
6385
+ /** Notifier accepts a free-form `data` payload for platform-specific
6386
+ * fields. */
6387
+ DeviceFeature["NotifierData"] = "notifier-data";
6388
+ /** Notifier supports interactive action buttons / callbacks. */
6389
+ DeviceFeature["NotifierActions"] = "notifier-actions";
6390
+ /** Notifier supports per-call recipient targeting (multi-user). */
6391
+ DeviceFeature["NotifierRecipients"] = "notifier-recipients";
6392
+ /** Script runner accepts a variables map on each run invocation. */
6393
+ DeviceFeature["ScriptVariables"] = "script-variables";
6394
+ /** Automation `trigger` accepts a skipCondition flag — fires the
6395
+ * automation's actions while bypassing its condition block. */
6396
+ DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
6397
+ return DeviceFeature;
6398
+ }({});
6607
6399
  /**
6608
- import { errMsg } from '@camstack/types'
6609
- * Extract a human-readable message from an unknown error value.
6610
- * Replaces the ubiquitous `errMsg(err)` pattern.
6400
+ * Semantic role a device plays within its parent. Populated by driver
6401
+ * addons when creating accessory devices (Reolink siren/floodlight/
6402
+ * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
6403
+ * admin UI to pick icons, labels, and widgets — a `Switch` with
6404
+ * `role: Floodlight` renders as a bulb with a brightness slider,
6405
+ * whereas a `Switch` with `role: Siren` renders as a klaxon.
6406
+ *
6407
+ * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
6408
+ * sqlite as a nullable TEXT column — old rows keep working unchanged.
6611
6409
  */
6612
- function errMsg(err) {
6613
- if (err instanceof Error) return err.message;
6614
- if (typeof err === "string") return err;
6615
- return String(err);
6410
+ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
6411
+ DeviceRole["Siren"] = "siren";
6412
+ DeviceRole["Floodlight"] = "floodlight";
6413
+ DeviceRole["Spotlight"] = "spotlight";
6414
+ DeviceRole["PirSensor"] = "pir-sensor";
6415
+ DeviceRole["Chime"] = "chime";
6416
+ DeviceRole["Autotrack"] = "autotrack";
6417
+ DeviceRole["Nightvision"] = "nightvision";
6418
+ DeviceRole["PrivacyMask"] = "privacy-mask";
6419
+ DeviceRole["Doorbell"] = "doorbell";
6420
+ /** Virtual HA toggle (input_boolean.*) — distinguishable from a
6421
+ * real Switch device for UI rendering / export adapters. */
6422
+ DeviceRole["BinaryHelper"] = "binary-helper";
6423
+ /** Generic motion / occupancy / moving event source. Distinct from
6424
+ * the camera accessory PirSensor role: that one is a camera child;
6425
+ * this is a standalone HA / 3rd-party motion sensor. */
6426
+ DeviceRole["MotionSensor"] = "motion-sensor";
6427
+ DeviceRole["ContactSensor"] = "contact-sensor";
6428
+ DeviceRole["LeakSensor"] = "leak-sensor";
6429
+ DeviceRole["SmokeSensor"] = "smoke-sensor";
6430
+ DeviceRole["COSensor"] = "co-sensor";
6431
+ DeviceRole["GasSensor"] = "gas-sensor";
6432
+ DeviceRole["TamperSensor"] = "tamper-sensor";
6433
+ DeviceRole["VibrationSensor"] = "vibration-sensor";
6434
+ DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
6435
+ DeviceRole["SoundSensor"] = "sound-sensor";
6436
+ /** Fallback for `binary_sensor` without a known `device_class`. */
6437
+ DeviceRole["BinarySensor"] = "binary-sensor";
6438
+ DeviceRole["TemperatureSensor"] = "temperature-sensor";
6439
+ DeviceRole["HumiditySensor"] = "humidity-sensor";
6440
+ DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
6441
+ DeviceRole["PressureSensor"] = "pressure-sensor";
6442
+ DeviceRole["PowerSensor"] = "power-sensor";
6443
+ DeviceRole["EnergySensor"] = "energy-sensor";
6444
+ DeviceRole["VoltageSensor"] = "voltage-sensor";
6445
+ DeviceRole["CurrentSensor"] = "current-sensor";
6446
+ DeviceRole["AirQualitySensor"] = "air-quality-sensor";
6447
+ /** Battery level (numeric % via `sensor` OR low-bool via
6448
+ * `binary_sensor` — the cap distinguishes via the value type). */
6449
+ DeviceRole["BatterySensor"] = "battery-sensor";
6450
+ /** Fallback for `sensor` numeric without a known `device_class`. */
6451
+ DeviceRole["NumericSensor"] = "numeric-sensor";
6452
+ /** String / enum state (HA `sensor` with `state_class: enum` or
6453
+ * `attributes.options`). */
6454
+ DeviceRole["EnumSensor"] = "enum-sensor";
6455
+ /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
6456
+ * or `date`). The slice carries the raw ISO string verbatim (hosted on
6457
+ * the `enum-sensor` cap); the UI renders it locale-formatted. */
6458
+ DeviceRole["DateTimeSensor"] = "datetime-sensor";
6459
+ /** Last-resort fallback when nothing else matches. */
6460
+ DeviceRole["GenericSensor"] = "generic-sensor";
6461
+ DeviceRole["NumericControl"] = "numeric-control";
6462
+ DeviceRole["SelectControl"] = "select-control";
6463
+ DeviceRole["TextControl"] = "text-control";
6464
+ DeviceRole["DateTimeControl"] = "datetime-control";
6465
+ /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
6466
+ * rich features (image, priority, channel routing). */
6467
+ DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
6468
+ /** Chat / messaging service (HA `notify.telegram_*`,
6469
+ * `notify.discord_*`, etc.). */
6470
+ DeviceRole["MessagingNotifier"] = "messaging-notifier";
6471
+ /** Email-based delivery (HA `notify.smtp`, etc.). */
6472
+ DeviceRole["EmailNotifier"] = "email-notifier";
6473
+ /** Fallback when the notifier service name doesn't match a known
6474
+ * pattern. */
6475
+ DeviceRole["GenericNotifier"] = "generic-notifier";
6476
+ return DeviceRole;
6477
+ }({});
6478
+ /**
6479
+ * Generic types for capability definitions.
6480
+ *
6481
+ * A capability is defined with Zod schemas for methods, events, and settings.
6482
+ * TypeScript types are inferred via z.infer<> — zero duplication.
6483
+ *
6484
+ * Pattern:
6485
+ * 1. Define Zod schemas for data, methods, settings
6486
+ * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
6487
+ * 3. Export type IProvider = InferProvider<typeof capabilityDef>
6488
+ * 4. Addon implements IProvider
6489
+ * 5. Registry auto-mounts tRPC router from definition.methods
6490
+ */
6491
+ /**
6492
+ * Output schema shared by the contribution + live methods.
6493
+ *
6494
+ * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
6495
+ * tabs[]) without importing from `../interfaces/config-ui.js` — a
6496
+ * concrete-but-lenient Zod object keeps tRPC output inference happy
6497
+ * (using `z.unknown()` here collapses unrelated router branches to
6498
+ * `unknown` when the generator re-inlines the huge AppRouter type).
6499
+ *
6500
+ * `.passthrough()` on sections/fields accepts whatever FormBuilder
6501
+ * extensions the caller adds (showWhen, displayScale, …) without
6502
+ * rebuilding every time a new field kind is introduced.
6503
+ */
6504
+ var ContributionSectionSchema = object({
6505
+ id: string(),
6506
+ title: string(),
6507
+ description: string().optional(),
6508
+ style: _enum(["card", "accordion"]).optional(),
6509
+ defaultCollapsed: boolean().optional(),
6510
+ columns: union([
6511
+ literal(1),
6512
+ literal(2),
6513
+ literal(3),
6514
+ literal(4)
6515
+ ]).optional(),
6516
+ tab: string().optional(),
6517
+ location: _enum(["settings", "top-tab"]).optional(),
6518
+ order: number().optional(),
6519
+ fields: array(any())
6520
+ });
6521
+ object({
6522
+ tabs: array(object({
6523
+ id: string(),
6524
+ label: string(),
6525
+ icon: string(),
6526
+ order: number().optional()
6527
+ })).optional(),
6528
+ sections: array(ContributionSectionSchema)
6529
+ }).nullable();
6530
+ object({ deviceId: number() }), object({ deviceId: number() }), object({
6531
+ deviceId: number(),
6532
+ patch: record(string(), unknown())
6533
+ }), object({ success: literal(true) });
6534
+ object({ deviceId: number() }), unknown().nullable();
6535
+ /** Shorthand to define a method schema */
6536
+ function method(input, output, options) {
6537
+ return {
6538
+ input,
6539
+ output,
6540
+ kind: options?.kind ?? "query",
6541
+ auth: options?.auth ?? "protected",
6542
+ ...options?.access !== void 0 ? { access: options.access } : {},
6543
+ timeoutMs: options?.timeoutMs
6544
+ };
6616
6545
  }
6617
- var YAMNET_TO_MACRO = {
6618
- mapping: {
6619
- Speech: "speech",
6620
- "Child speech, kid speaking": "speech",
6621
- Conversation: "speech",
6622
- "Narration, monologue": "speech",
6623
- Babbling: "speech",
6624
- Whispering: "speech",
6625
- "Speech synthesizer": "speech",
6626
- Humming: "speech",
6627
- Rapping: "speech",
6628
- Singing: "speech",
6629
- Choir: "speech",
6630
- "Child singing": "speech",
6631
- Shout: "scream",
6632
- Bellow: "scream",
6633
- Yell: "scream",
6634
- Screaming: "scream",
6635
- "Children shouting": "scream",
6636
- Whoop: "scream",
6637
- "Crying, sobbing": "crying",
6638
- "Baby cry, infant cry": "crying",
6639
- Whimper: "crying",
6640
- "Wail, moan": "crying",
6641
- Groan: "crying",
6642
- Laughter: "laughter",
6643
- "Baby laughter": "laughter",
6644
- Giggle: "laughter",
6645
- Snicker: "laughter",
6646
- "Belly laugh": "laughter",
6647
- "Chuckle, chortle": "laughter",
6648
- Music: "music",
6649
- "Musical instrument": "music",
6650
- Guitar: "music",
6651
- Piano: "music",
6652
- Drum: "music",
6653
- "Drum kit": "music",
6654
- "Violin, fiddle": "music",
6655
- Flute: "music",
6656
- Saxophone: "music",
6657
- Trumpet: "music",
6658
- Synthesizer: "music",
6659
- "Pop music": "music",
6660
- "Rock music": "music",
6661
- "Hip hop music": "music",
6662
- "Classical music": "music",
6663
- Jazz: "music",
6664
- "Electronic music": "music",
6665
- "Background music": "music",
6666
- Dog: "dog",
6667
- Bark: "dog",
6668
- Yip: "dog",
6669
- Howl: "dog",
6670
- "Bow-wow": "dog",
6671
- Growling: "dog",
6672
- "Whimper (dog)": "dog",
6673
- Cat: "cat",
6674
- Purr: "cat",
6675
- Meow: "cat",
6676
- Hiss: "cat",
6677
- Caterwaul: "cat",
6678
- Bird: "bird",
6679
- "Bird vocalization, bird call, bird song": "bird",
6680
- "Chirp, tweet": "bird",
6681
- Squawk: "bird",
6682
- Crow: "bird",
6683
- Owl: "bird",
6684
- "Pigeon, dove": "bird",
6685
- Animal: "animal",
6686
- "Domestic animals, pets": "animal",
6687
- "Livestock, farm animals, working animals": "animal",
6688
- Horse: "animal",
6689
- "Cattle, bovinae": "animal",
6690
- Pig: "animal",
6691
- Sheep: "animal",
6692
- Goat: "animal",
6693
- Frog: "animal",
6694
- Insect: "animal",
6695
- Cricket: "animal",
6696
- Alarm: "alarm",
6697
- "Alarm clock": "alarm",
6698
- "Smoke detector, smoke alarm": "alarm",
6699
- "Fire alarm": "alarm",
6700
- Buzzer: "alarm",
6701
- "Civil defense siren": "alarm",
6702
- "Car alarm": "alarm",
6703
- Siren: "siren",
6704
- "Police car (siren)": "siren",
6705
- "Ambulance (siren)": "siren",
6706
- "Fire engine, fire truck (siren)": "siren",
6707
- "Emergency vehicle": "siren",
6708
- Foghorn: "siren",
6709
- Doorbell: "doorbell",
6710
- "Ding-dong": "doorbell",
6711
- Knock: "doorbell",
6712
- Tap: "doorbell",
6713
- Glass: "glass_breaking",
6714
- Shatter: "glass_breaking",
6715
- "Chink, clink": "glass_breaking",
6716
- "Gunshot, gunfire": "gunshot",
6717
- "Machine gun": "gunshot",
6718
- Explosion: "gunshot",
6719
- Fireworks: "gunshot",
6720
- Firecracker: "gunshot",
6721
- "Artillery fire": "gunshot",
6722
- "Cap gun": "gunshot",
6723
- Boom: "gunshot",
6724
- Vehicle: "vehicle",
6725
- Car: "vehicle",
6726
- Truck: "vehicle",
6727
- Bus: "vehicle",
6728
- Motorcycle: "vehicle",
6729
- "Car passing by": "vehicle",
6730
- "Vehicle horn, car horn, honking": "vehicle",
6731
- "Traffic noise, roadway noise": "vehicle",
6732
- Train: "vehicle",
6733
- Aircraft: "vehicle",
6734
- Helicopter: "vehicle",
6735
- Bicycle: "vehicle",
6736
- Skateboard: "vehicle",
6737
- Fire: "fire",
6738
- Crackle: "fire",
6739
- Water: "water",
6740
- Rain: "water",
6741
- Raindrop: "water",
6742
- "Rain on surface": "water",
6743
- Stream: "water",
6744
- Waterfall: "water",
6745
- Ocean: "water",
6746
- "Waves, surf": "water",
6747
- "Splash, splatter": "water",
6748
- Wind: "wind",
6749
- Thunderstorm: "wind",
6750
- Thunder: "wind",
6751
- "Wind noise (microphone)": "wind",
6752
- "Rustling leaves": "wind",
6753
- Door: "door",
6754
- "Sliding door": "door",
6755
- Slam: "door",
6756
- "Cupboard open or close": "door",
6757
- "Walk, footsteps": "footsteps",
6758
- Run: "footsteps",
6759
- Shuffle: "footsteps",
6760
- Crowd: "crowd",
6761
- Chatter: "crowd",
6762
- Cheering: "crowd",
6763
- Applause: "crowd",
6764
- "Children playing": "crowd",
6765
- "Hubbub, speech noise, speech babble": "crowd",
6766
- Telephone: "telephone",
6767
- "Telephone bell ringing": "telephone",
6768
- Ringtone: "telephone",
6769
- "Telephone dialing, DTMF": "telephone",
6770
- "Busy signal": "telephone",
6771
- Engine: "engine",
6772
- "Engine starting": "engine",
6773
- Idling: "engine",
6774
- "Accelerating, revving, vroom": "engine",
6775
- "Light engine (high frequency)": "engine",
6776
- "Medium engine (mid frequency)": "engine",
6777
- "Heavy engine (low frequency)": "engine",
6778
- "Lawn mower": "engine",
6779
- Chainsaw: "engine",
6780
- Hammer: "tools",
6781
- Jackhammer: "tools",
6782
- Sawing: "tools",
6783
- "Power tool": "tools",
6784
- Drill: "tools",
6785
- Sanding: "tools",
6786
- Silence: "silence"
6787
- },
6788
- preserveOriginal: false
6789
- };
6790
- var APPLE_SA_TO_MACRO = {
6791
- mapping: {
6792
- speech: "speech",
6793
- child_speech: "speech",
6794
- conversation: "speech",
6795
- whispering: "speech",
6796
- singing: "speech",
6797
- humming: "speech",
6798
- shout: "scream",
6799
- yell: "scream",
6800
- screaming: "scream",
6801
- crying: "crying",
6802
- baby_crying: "crying",
6803
- sobbing: "crying",
6804
- laughter: "laughter",
6805
- baby_laughter: "laughter",
6806
- giggling: "laughter",
6807
- music: "music",
6808
- guitar: "music",
6809
- piano: "music",
6810
- drums: "music",
6811
- dog_bark: "dog",
6812
- dog_bow_wow: "dog",
6813
- dog_growling: "dog",
6814
- dog_howl: "dog",
6815
- cat_meow: "cat",
6816
- cat_purr: "cat",
6817
- cat_hiss: "cat",
6818
- bird: "bird",
6819
- bird_chirp: "bird",
6820
- bird_squawk: "bird",
6821
- animal: "animal",
6822
- horse: "animal",
6823
- cow_moo: "animal",
6824
- insect: "animal",
6825
- alarm: "alarm",
6826
- smoke_alarm: "alarm",
6827
- fire_alarm: "alarm",
6828
- car_alarm: "alarm",
6829
- siren: "siren",
6830
- police_siren: "siren",
6831
- ambulance_siren: "siren",
6832
- doorbell: "doorbell",
6833
- door_knock: "doorbell",
6834
- knocking: "doorbell",
6835
- glass_breaking: "glass_breaking",
6836
- glass_shatter: "glass_breaking",
6837
- gunshot: "gunshot",
6838
- explosion: "gunshot",
6839
- fireworks: "gunshot",
6840
- car: "vehicle",
6841
- truck: "vehicle",
6842
- motorcycle: "vehicle",
6843
- car_horn: "vehicle",
6844
- vehicle_horn: "vehicle",
6845
- traffic: "vehicle",
6846
- fire: "fire",
6847
- fire_crackle: "fire",
6848
- water: "water",
6849
- rain: "water",
6850
- ocean: "water",
6851
- splash: "water",
6852
- wind: "wind",
6853
- thunder: "wind",
6854
- thunderstorm: "wind",
6855
- door: "door",
6856
- door_slam: "door",
6857
- sliding_door: "door",
6858
- footsteps: "footsteps",
6859
- walking: "footsteps",
6860
- running: "footsteps",
6861
- crowd: "crowd",
6862
- chatter: "crowd",
6863
- cheering: "crowd",
6864
- applause: "crowd",
6865
- telephone_ring: "telephone",
6866
- ringtone: "telephone",
6867
- engine: "engine",
6868
- engine_starting: "engine",
6869
- lawn_mower: "engine",
6870
- chainsaw: "engine",
6871
- hammer: "tools",
6872
- jackhammer: "tools",
6873
- drill: "tools",
6874
- power_tool: "tools",
6875
- silence: "silence"
6876
- },
6877
- preserveOriginal: false
6878
- };
6879
- var _macroLookup = /* @__PURE__ */ new Map();
6880
- for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6881
- for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6882
- var DeviceType = /* @__PURE__ */ function(DeviceType) {
6883
- DeviceType["Camera"] = "camera";
6884
- DeviceType["Hub"] = "hub";
6885
- DeviceType["Light"] = "light";
6886
- DeviceType["Siren"] = "siren";
6887
- DeviceType["Switch"] = "switch";
6888
- DeviceType["Sensor"] = "sensor";
6889
- DeviceType["Thermostat"] = "thermostat";
6890
- DeviceType["Button"] = "button";
6891
- /** Generic stateless event emitter — carries a device's EXACT declared
6892
- * event vocabulary verbatim (no normalization). Installed with the
6893
- * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6894
- * HA bus events (e.g. `zha_event`, generic). */
6895
- DeviceType["EventEmitter"] = "event-emitter";
6896
- /** Firmware/software update entity — current vs available version,
6897
- * updatable flag, update state, and an install action. Installed with
6898
- * the `update` cap. Sources: Homematic firmware-update channels (and
6899
- * reusable by other providers, e.g. HA `update.*` entities). */
6900
- DeviceType["Update"] = "update";
6901
- DeviceType["Generic"] = "generic";
6902
- /** Generic notification delivery target (HA `notify.<service>`, future
6903
- * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6904
- * endpoint; the `notifier` cap defines the send surface. */
6905
- DeviceType["Notifier"] = "notifier";
6906
- /** Pre-recorded action sequence with optional parameters
6907
- * (HA `script.*`). Runnable via `script-runner` cap. */
6908
- DeviceType["Script"] = "script";
6909
- /** Automation rule (HA `automation.*`) enable/disable + manual
6910
- * trigger surface exposed via `automation-control` cap. */
6911
- DeviceType["Automation"] = "automation";
6912
- /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6913
- DeviceType["Lock"] = "lock";
6914
- /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6915
- * `valve.*`). `cover` cap with sub-roles for variant. */
6916
- DeviceType["Cover"] = "cover";
6917
- /** Pipe / water / gas valve with open/close/stop and optional
6918
- * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6919
- * modelled on the same open/closed lifecycle. */
6920
- DeviceType["Valve"] = "valve";
6921
- /** Humidifier / dehumidifier with on/off + target humidity + mode
6922
- * (HA `humidifier.*`). `humidifier` cap a climate-family actuator
6923
- * modelled on the same target / mode lifecycle. */
6924
- DeviceType["Humidifier"] = "humidifier";
6925
- /** Water heater / boiler with target temperature + operation mode +
6926
- * away mode (HA `water_heater.*`). `water-heater` cap a
6927
- * climate-family actuator. */
6928
- DeviceType["WaterHeater"] = "water-heater";
6929
- /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6930
- DeviceType["Fan"] = "fan";
6931
- /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6932
- * the camera surface — those use `Camera`. `media-player` cap. */
6933
- DeviceType["MediaPlayer"] = "media-player";
6934
- /** Security panel / alarm system (HA `alarm_control_panel.*`).
6935
- * `alarm-panel` cap. */
6936
- DeviceType["AlarmPanel"] = "alarm-panel";
6937
- /** Generic user-settable input (HA `number` / `input_number` / `select`
6938
- * / `input_select` / `text` / `input_text` / `input_datetime`).
6939
- * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6940
- * TextControl / DateTimeControl. */
6941
- DeviceType["Control"] = "control";
6942
- /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6943
- * `presence` cap. */
6944
- DeviceType["Presence"] = "presence";
6945
- /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6946
- * `weather` cap. */
6947
- DeviceType["Weather"] = "weather";
6948
- /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6949
- DeviceType["Vacuum"] = "vacuum";
6950
- /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6951
- * `lawn-mower-control` cap. */
6952
- DeviceType["LawnMower"] = "lawn-mower";
6953
- /** Physical HA device group — parent container for entity-children
6954
- * adopted from a single HA device entry. Not renderable as a
6955
- * standalone device; exists only to anchor child entities. */
6956
- DeviceType["Container"] = "container";
6957
- /** Single still-image entity (HA `image.*`). Read-only display of an
6958
- * `entity_picture` signed URL the browser loads directly. `image` cap. */
6959
- DeviceType["Image"] = "image";
6960
- return DeviceType;
6961
- }({});
6962
- var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6963
- DeviceFeature["BatteryOperated"] = "battery-operated";
6964
- DeviceFeature["Rebootable"] = "rebootable";
6546
+ var StaticDirOutputSchema = object({ staticDir: string() });
6547
+ var VersionOutputSchema = object({ version: string() });
6548
+ method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
6549
+ /**
6550
+ * device-ops — device-scoped cap that unifies the per-IDevice operations
6551
+ * previously routed through the `.device-ops` Moleculer bridge service.
6552
+ *
6553
+ * Each worker that hosts live `IDevice` instances auto-registers a native
6554
+ * provider for this cap (per device) backed by its local
6555
+ * `DeviceRegistry`. Hub-side callers reach it transparently through
6556
+ * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
6557
+ * `deviceId` + `nodeId` and dispatches through the standard cap-router,
6558
+ * so there's no parallel bridge path anymore.
6559
+ *
6560
+ * The surface is intentionally small — every method corresponds to a
6561
+ * single action on the live `IDevice` (or `ICameraDevice` for
6562
+ * `getStreamSources`). Richer orchestration (enable/disable with
6563
+ * integration plumbing, bulk updates) stays in the `device-manager` cap;
6564
+ * `device-ops` is the per-device primitive the device-manager routes to.
6565
+ */
6566
+ var StreamSourceEntrySchema = object({
6567
+ id: string(),
6568
+ label: string(),
6569
+ protocol: _enum([
6570
+ "rtsp",
6571
+ "rtmp",
6572
+ "annexb",
6573
+ "http-mjpeg",
6574
+ "webrtc",
6575
+ "custom"
6576
+ ]),
6577
+ url: string().optional(),
6578
+ resolution: object({
6579
+ width: number(),
6580
+ height: number()
6581
+ }).optional(),
6582
+ fps: number().optional(),
6583
+ bitrate: number().optional(),
6584
+ codec: string().optional(),
6585
+ profileHint: CamProfileSchema.optional(),
6586
+ sdp: string().optional()
6587
+ });
6588
+ var ConfigEntrySchema$1 = object({
6589
+ key: string(),
6590
+ value: unknown()
6591
+ });
6592
+ var RawStateResultSchema = object({
6593
+ /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
6594
+ source: string(),
6595
+ /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
6596
+ data: record(string(), unknown())
6597
+ });
6598
+ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
6599
+ deviceId: number(),
6600
+ values: record(string(), unknown())
6601
+ }), _void(), { kind: "mutation" }), method(object({
6602
+ deviceId: number(),
6603
+ action: string().min(1),
6604
+ input: unknown()
6605
+ }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
6606
+ //#endregion
6607
+ //#region ../types/dist/err-msg-IQTHeDzc.mjs
6608
+ /**
6609
+ import { errMsg } from '@camstack/types'
6610
+ * Extract a human-readable message from an unknown error value.
6611
+ * Replaces the ubiquitous `errMsg(err)` pattern.
6612
+ */
6613
+ function errMsg(err) {
6614
+ if (err instanceof Error) return err.message;
6615
+ if (typeof err === "string") return err;
6616
+ return String(err);
6617
+ }
6618
+ //#endregion
6619
+ //#region ../types/dist/index.mjs
6620
+ /**
6621
+ * Deep wiring healthcheck — snapshot of active reachability probes across
6622
+ * every declared capability + widget of every installed plugin, on every
6623
+ * node. Produced by the backend `WiringHealthService` and surfaced via
6624
+ * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
6625
+ *
6626
+ * Unlike `/health` (process liveness), this reflects whether each cap/widget
6627
+ * is actually *reachable* over the real cap-dispatch path. See spec
6628
+ * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
6629
+ */
6630
+ /** What kind of target a probe addressed. */
6631
+ var wiringProbeKindSchema = _enum([
6632
+ "singleton",
6633
+ "device",
6634
+ "widget"
6635
+ ]);
6636
+ /** Result of probing a single (cap|widget [, device]) target. */
6637
+ var wiringProbeResultSchema = object({
6638
+ capName: string(),
6639
+ kind: wiringProbeKindSchema,
6640
+ deviceId: number().optional(),
6641
+ reachable: boolean(),
6642
+ latencyMs: number(),
6643
+ error: string().optional()
6644
+ });
6645
+ /** Per-addon roll-up of cap + widget probe results. */
6646
+ var wiringAddonHealthSchema = object({
6647
+ addonId: string(),
6648
+ caps: array(wiringProbeResultSchema).readonly(),
6649
+ widgets: array(wiringProbeResultSchema).readonly()
6650
+ });
6651
+ /** Per-node roll-up. */
6652
+ var wiringNodeHealthSchema = object({
6653
+ nodeId: string(),
6654
+ addons: array(wiringAddonHealthSchema).readonly()
6655
+ });
6656
+ object({
6657
+ /** True only when every probed target is reachable. */
6658
+ ok: boolean(),
6659
+ /** True when at least one target is unreachable. */
6660
+ degraded: boolean(),
6661
+ checkedAt: string(),
6662
+ nodes: array(wiringNodeHealthSchema).readonly(),
6663
+ summary: object({
6664
+ total: number(),
6665
+ reachable: number(),
6666
+ unreachable: number()
6667
+ })
6668
+ });
6669
+ var MODEL_FORMATS = [
6670
+ "onnx",
6671
+ "coreml",
6672
+ "openvino",
6673
+ "tflite",
6674
+ "pt"
6675
+ ];
6676
+ /**
6677
+ * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6678
+ * Named `RecordingWeekday` to avoid collision with the string-union
6679
+ * `Weekday` exported from `interfaces/timezones.ts`.
6680
+ */
6681
+ var RecordingWeekdaySchema = number().int().min(0).max(6);
6682
+ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6683
+ var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6684
+ kind: literal("timeOfDay"),
6685
+ start: string().regex(HHMM),
6686
+ end: string().regex(HHMM),
6687
+ /** Restrict to these weekdays; omit = every day. */
6688
+ days: array(RecordingWeekdaySchema).optional()
6689
+ })]);
6690
+ var RecordingModeSchema = _enum([
6691
+ "continuous",
6692
+ "onMotion",
6693
+ "onAudioThreshold"
6694
+ ]);
6695
+ /**
6696
+ * First-class, authoritative per-camera storage mode — the netta choice the UI
6697
+ * reads directly (never inferred from `rules`):
6698
+ * - `off` — not recording.
6699
+ * - `events` — record only around triggers (motion / audio threshold),
6700
+ * with pre/post-buffer.
6701
+ * - `continuous` — record 24/7 within the schedule.
6702
+ *
6703
+ * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6704
+ * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6705
+ */
6706
+ var RecordingStorageModeSchema = _enum([
6707
+ "off",
6708
+ "events",
6709
+ "continuous"
6710
+ ]);
6711
+ /** Which detectors trigger an `events`-mode recording. */
6712
+ var RecordingTriggersSchema = object({
6713
+ motion: boolean().optional(),
6714
+ audioThresholdDbfs: number().optional()
6715
+ });
6716
+ /**
6717
+ * Mode of a single recording band — the recorder per-band vocabulary.
6718
+ *
6719
+ * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6720
+ * only ever `continuous` or `events`; "off" is expressed by the absence of a
6721
+ * covering band, not by a band value.
6722
+ */
6723
+ var RecordingBandModeSchema = _enum(["continuous", "events"]);
6724
+ /**
6725
+ * Triggers for an `events`-mode band. Identical shape to
6726
+ * `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
6727
+ * two never drift.
6728
+ */
6729
+ var RecordingBandTriggersSchema = RecordingTriggersSchema;
6730
+ /**
6731
+ * A single mode-per-band window — the canonical recorder band shape, the
6732
+ * single source of truth re-used by `addon-pipeline/recorder`.
6733
+ *
6734
+ * `days` lists the weekdays the band covers (empty = every day, matching the
6735
+ * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6736
+ * span wraps past midnight (handled by the band engine).
6737
+ */
6738
+ var RecordingBandSchema = object({
6739
+ days: array(RecordingWeekdaySchema),
6740
+ start: string().regex(HHMM),
6741
+ end: string().regex(HHMM),
6742
+ mode: RecordingBandModeSchema,
6743
+ triggers: RecordingBandTriggersSchema.optional(),
6744
+ preBufferSec: number().min(0).optional(),
6745
+ postBufferSec: number().min(0).optional()
6746
+ });
6747
+ var RecordingRuleSchema = object({
6748
+ schedule: RecordingScheduleSchema,
6749
+ mode: RecordingModeSchema,
6750
+ /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6751
+ preBufferSec: number().min(0).default(0),
6752
+ /** Keep recording until this many seconds after the last trigger. */
6753
+ postBufferSec: number().min(0).default(0),
6754
+ /** Each new trigger restarts the post-buffer window. */
6755
+ resetTimeoutOnNewEvent: boolean().default(true),
6756
+ /** onAudioThreshold only — dBFS level that counts as a trigger. */
6757
+ thresholdDbfs: number().optional()
6758
+ });
6759
+ /**
6760
+ * Per-device retention overrides. Every field is optional; an unset or `0`
6761
+ * value inherits the node-wide recorder default. Only footage-lifetime limits
6762
+ * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6763
+ * (when the volume is too full to keep recording) is NOT a per-camera concern —
6764
+ * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6765
+ * shared by every camera writing to that volume.
6766
+ */
6767
+ var RecordingRetentionSchema = object({
6768
+ maxAgeDays: number().min(0).optional(),
6769
+ maxSizeGb: number().min(0).optional()
6770
+ });
6771
+ /**
6772
+ * The full per-camera recording intent — the wire shape of a RecordingTarget.
6773
+ *
6774
+ * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6775
+ * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6776
+ * only for transition + migration (`migrateRulesToMode`); the policy engine
6777
+ * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6778
+ */
6779
+ var RecordingConfigSchema = object({
6780
+ enabled: boolean(),
6781
+ /** Authoritative storage mode. Absent on legacy targets → derived once via
6782
+ * `migrateRulesToMode`, then persisted. */
6783
+ mode: RecordingStorageModeSchema.optional(),
6784
+ profiles: array(CamProfileSchema).optional(),
6785
+ segmentSeconds: number().int().positive().optional(),
6786
+ /** Shared recording time-bands for `events` & `continuous` — record only when
6787
+ * the wall-clock falls inside one of these windows. Omit or empty = always.
6788
+ * `continuous` compiles to one rule per band; `events` to band × trigger. */
6789
+ schedules: array(RecordingScheduleSchema).optional(),
6790
+ /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
6791
+ * normalized into `schedules` on read and never written going forward. (Not
6792
+ * tagged `@deprecated`: the normalization paths must read it cast-free.) */
6793
+ schedule: RecordingScheduleSchema.optional(),
6794
+ /** `events`-mode only — which detectors trigger a recording. */
6795
+ triggers: RecordingTriggersSchema.optional(),
6796
+ /** `events`-mode only — seconds retained before / after a trigger. */
6797
+ preBufferSec: number().min(0).optional(),
6798
+ postBufferSec: number().min(0).optional(),
6799
+ /** DEPRECATED authoring input; retained for migration/transition. */
6800
+ rules: array(RecordingRuleSchema).optional(),
6801
+ /**
6802
+ * AUTHORITATIVE mode-per-band recording model (recorder). When present it
6803
+ * is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
6804
+ * `triggers`/`rules` fields above are kept for READ-COMPAT only and are
6805
+ * derived into bands once via `migrateConfigToBands`.
6806
+ */
6807
+ bands: array(RecordingBandSchema).optional(),
6808
+ retention: RecordingRetentionSchema.optional()
6809
+ });
6810
+ /**
6811
+ * `StorageLocationType` an addon-declared id that identifies the *kind* of
6812
+ * storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
6813
+ * so the persisted record schema and the consumer-facing cap can both consume it
6814
+ * without forming a circular import. The `storage` cap re-exports it
6815
+ * verbatim for back-compat.
6816
+ *
6817
+ * This Zod schema is the **authoritative source** for `StorageLocationType`.
6818
+ * The TS alias in `./storage.ts` re-exports `z.infer<typeof
6819
+ * StorageLocationTypeSchema>` so the wire surface (cap) and the legacy
6820
+ * `IStorageProvider` interface stay in lockstep.
6821
+ *
6822
+ * The type is now an **open string** (not a closed enum) — addons declare
6823
+ * their own location kinds via `StorageLocationDeclaration.id`. The regex
6824
+ * enforces a safe id format: lowercase-start, alphanumeric + hyphens.
6825
+ */
6826
+ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
6827
+ /**
6828
+ * Persisted record for a storage location instance. Operators can register
6829
+ * multiple instances for multi-cardinality types (e.g. two `backups`
6830
+ * locations with different `providerId`s). Cardinality is now declared per
6831
+ * location via `StorageLocationDeclaration.cardinality` the static
6832
+ * `STORAGE_LOCATION_CARDINALITY` map has been removed.
6833
+ *
6834
+ * `id` is a stable namespaced string of the form `<type>:<slug>`.
6835
+ * The default location for a type uses `id === <type>:default` by
6836
+ * convention (the bare type ref like `'backups'` resolves to it).
6837
+ *
6838
+ * `isSystem: true` marks a location as orchestrator-seeded and
6839
+ * undeletable. The bootstrap-installed defaults (one per type) carry
6840
+ * this flag; operator-added locations don't. Editing the config of
6841
+ * a system location is allowed (path migration, provider swap) but
6842
+ * deleting it is rejected at the cap level.
6843
+ */
6844
+ var StorageLocationSchema = object({
6845
+ id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
6846
+ type: string(),
6847
+ displayName: string().min(1),
6848
+ providerId: string().min(1),
6849
+ config: record(string(), unknown()),
6850
+ /**
6851
+ * Cluster node this location physically lives on. REQUIRED for node-local
6852
+ * providers (filesystem — the path exists on one node's disk), null/absent
6853
+ * for node-agnostic providers (S3/SFTP/WebDAV, reachable from any node).
6854
+ * `'hub'` is the hub node. Validated against the provider's `nodeLocal`
6855
+ * flag at upsert time, not here (the schema is provider-agnostic).
6856
+ */
6857
+ nodeId: string().optional(),
6858
+ isDefault: boolean().default(false),
6859
+ isSystem: boolean().default(false),
6860
+ createdAt: number(),
6861
+ updatedAt: number()
6862
+ });
6863
+ /**
6864
+ * Reference accepted by consumer-facing `api.storage.*` calls.
6865
+ * Either:
6866
+ * - a `StorageLocationType` (e.g. `'backups'`) orchestrator resolves to the default of that type
6867
+ * - a fully-qualified id (e.g. `'backups:nas-01'`) addresses a specific instance
6868
+ *
6869
+ * The orchestrator's `resolveRef(ref)` handles both cases.
6870
+ */
6871
+ var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]);
6872
+ /**
6873
+ * `StorageLocationDeclaration` — a single storage-location entry declared by
6874
+ * an addon in its `package.json` under `camstack.storageLocations`.
6875
+ *
6876
+ * Design intent:
6877
+ * - **Addon declares its needs** each addon describes the logical storage
6878
+ * slots it requires (e.g. `recordings`, `recordingsLow`) without caring
6879
+ * about the physical path.
6880
+ * - **Kernel aggregates** — at boot the kernel collects declarations from all
6881
+ * installed addons, deduplicates by `id`, and exposes the union via the
6882
+ * storage-locations settings surface.
6883
+ * - **Orchestrator seeds** for every declared `id` the orchestrator ensures
6884
+ * at least one instance named `<id>:default` is present, using
6885
+ * `defaultsTo` to inherit the resolved root from another location when the
6886
+ * declaration is a derivative slot (e.g. `recordingsLow` defaults to
6887
+ * `recordings`).
6888
+ * - **ids are global** — `id` values are shared across the entire deployment;
6889
+ * two addons declaring the same `id` must agree on `cardinality` (validated
6890
+ * at kernel aggregation time, not here).
6891
+ */
6892
+ var StorageLocationDeclarationSchema = object({
6893
+ /**
6894
+ * Global location identifier, e.g. `recordings` or `recordingsLow`.
6895
+ * Must start with a lowercase letter and may contain letters, digits, and
6896
+ * hyphens.
6897
+ */
6898
+ id: string().regex(/^[a-z][a-zA-Z0-9-]*$/, { message: "id must start with a lowercase letter and contain only letters, digits, or hyphens" }),
6899
+ /** Human-readable name shown in the admin UI. */
6900
+ displayName: string().min(1, { message: "displayName must not be empty" }),
6901
+ /** Optional longer explanation of what data this location stores. */
6902
+ description: string().optional(),
6903
+ /**
6904
+ * `single` — exactly one instance of this location is allowed system-wide
6905
+ * (e.g. `logs`, `models`). The operator can edit it but not add more.
6906
+ * `multi` — the operator may register several instances (e.g. a second
6907
+ * `recordings` on a NAS for disk tiering); one is the default at any time.
6908
+ */
6909
+ cardinality: _enum(["single", "multi"]),
6910
+ /**
6911
+ * When set, the default instance for this location inherits its resolved
6912
+ * root from the named location's default instance. Useful for derivative
6913
+ * slots (e.g. `recordingsLow` → `recordings`) so operators only need to
6914
+ * configure the primary location.
6915
+ */
6916
+ defaultsTo: string().optional()
6917
+ });
6918
+ var DecoderStatsSchema = object({
6919
+ inputFps: number(),
6920
+ outputFps: number(),
6921
+ avgDecodeTimeMs: number(),
6922
+ droppedFrames: number()
6923
+ });
6924
+ var DecoderSessionConfigSchema = object({
6925
+ codec: string(),
6926
+ maxFps: number().default(0),
6927
+ outputFormat: _enum([
6928
+ "jpeg",
6929
+ "rgb",
6930
+ "bgr",
6931
+ "yuv420",
6932
+ "gray"
6933
+ ]).default("jpeg"),
6934
+ scale: number().default(1),
6935
+ width: number().optional(),
6936
+ height: number().optional(),
6965
6937
  /**
6966
- * Device supports an on-demand re-sync of its derived spec with its
6967
- * upstream source drives the generic Re-sync button. The owning
6968
- * provider implements the action via the `device-adoption.resync` cap.
6938
+ * Identifier of the camera this decoder session serves. Optional
6939
+ * because the cap is generic (any caller could request decode), but
6940
+ * stream-broker passes it so decoder logs include `deviceId` for
6941
+ * per-camera filtering when diagnosing failures (e.g. node-av
6942
+ * sendPacket errors on a single hung camera).
6969
6943
  */
6970
- DeviceFeature["Resyncable"] = "resyncable";
6971
- DeviceFeature["NativeSnapshot"] = "native-snapshot";
6972
- DeviceFeature["DoorbellButton"] = "doorbell-button";
6973
- DeviceFeature["TwoWayAudio"] = "two-way-audio";
6974
- DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6944
+ deviceId: number().int().nonnegative().optional(),
6975
6945
  /**
6976
- * Camera supports the on-firmware autotrack subsystem (subject-
6977
- * following). Distinct from `PanTiltZoom` because not every PTZ
6978
- * camera ships autotrack the admin UI uses this flag to gate
6979
- * the autotrack toggle / settings card without re-deriving from
6980
- * the cap registry. Mirrors `ptz-autotrack` cap registration:
6981
- * driver sets this feature when probe confirms the firmware
6982
- * surface, and registers the cap in the same code path.
6946
+ * Free-form tag for log scoping. Stream-broker uses
6947
+ * `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
6948
+ * on every line so `grep tag=broker:5/high` filters one camera
6949
+ * profile cleanly.
6983
6950
  */
6984
- DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6951
+ tag: string().optional(),
6985
6952
  /**
6986
- * Accessory exposes a "trigger on motion" toggle the parent camera's
6987
- * motion detection automatically activates this device. Mirrors
6988
- * `motion-trigger` cap registration: drivers set this feature in the
6989
- * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6953
+ * Where the session delivers decoded frames (Phase 5 / D9):
6990
6954
  *
6991
- * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6992
- * fast scalar without binding fetch), notifier rules, and `listAll`
6993
- * filters that want "all devices with on-motion behaviour".
6955
+ * - `'callback'` (default) the legacy pixel path: decoded frames are
6956
+ * buffered as `DecodedFrame`s and drained via `pullFrames`.
6957
+ * - `'shm'` the shared-memory frame plane: decoded frames are written
6958
+ * into an OS shared-memory ring and drained as zero-pixel
6959
+ * `FrameHandle`s via `pullHandles`. A session is one mode or the
6960
+ * other — `pullFrames` returns nothing for an `'shm'` session and
6961
+ * `pullHandles` returns nothing for a `'callback'` session.
6994
6962
  */
6995
- DeviceFeature["MotionTrigger"] = "motion-trigger";
6996
- /** Light supports rgb-triplet color via `color` cap. */
6997
- DeviceFeature["LightColorRgb"] = "light-color-rgb";
6998
- /** Light supports HSV color via `color` cap. */
6999
- DeviceFeature["LightColorHsv"] = "light-color-hsv";
7000
- /** Light supports color-temperature (mired) via `color` cap. */
7001
- DeviceFeature["LightColorMired"] = "light-color-mired";
7002
- /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
7003
- * targetHigh). Gates the range slider UI. */
7004
- DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
7005
- /** Thermostat exposes target humidity and/or current humidity
7006
- * readings. Gates the humidity controls. */
7007
- DeviceFeature["ClimateHumidity"] = "climate-humidity";
7008
- /** Thermostat exposes a fan-mode selector. */
7009
- DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
7010
- /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
7011
- DeviceFeature["ClimatePreset"] = "climate-preset";
7012
- /** Cover exposes intermediate position control (0..100). Gates the
7013
- * position slider UI. */
7014
- DeviceFeature["CoverPositionable"] = "cover-positionable";
7015
- /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
7016
- DeviceFeature["CoverTilt"] = "cover-tilt";
7017
- /** Valve exposes intermediate position control (0..100). Gates the
7018
- * position slider / drag surface UI. */
7019
- DeviceFeature["ValvePositionable"] = "valve-positionable";
7020
- /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
7021
- DeviceFeature["FanSpeed"] = "fan-speed";
7022
- /** Fan exposes a preset mode selector. */
7023
- DeviceFeature["FanPreset"] = "fan-preset";
7024
- /** Fan exposes blade direction (forward/reverse) — typical of
7025
- * ceiling fans. */
7026
- DeviceFeature["FanDirection"] = "fan-direction";
7027
- /** Fan exposes an oscillation toggle. */
7028
- DeviceFeature["FanOscillating"] = "fan-oscillating";
7029
- /** Lock requires a PIN code on lock/unlock. Gates the code-entry
7030
- * field on the UI lock-controls panel. */
7031
- DeviceFeature["LockPinRequired"] = "lock-pin-required";
7032
- /** Lock supports a latch-release ("open door") action distinct from
7033
- * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
7034
- * `supported_features`. Gates the Open Door button in the UI. */
7035
- DeviceFeature["LockOpen"] = "lock-open";
7036
- /** Media player exposes a seek-to-position surface. */
7037
- DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
7038
- /** Media player exposes a volume-level setter. */
7039
- DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
7040
- /** Media player exposes a mute toggle distinct from volume=0. */
7041
- DeviceFeature["MediaPlayerMute"] = "media-player-mute";
7042
- /** Media player exposes a shuffle toggle. */
7043
- DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
7044
- /** Media player exposes a repeat mode (off / all / one). */
7045
- DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
7046
- /** Media player exposes a source / input selector. */
7047
- DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
7048
- /** Media player exposes a play-arbitrary-media surface (URL / id). */
7049
- DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
7050
- /** Media player exposes next-track. */
7051
- DeviceFeature["MediaPlayerNext"] = "media-player-next";
7052
- /** Media player exposes previous-track. */
7053
- DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
7054
- /** Media player exposes stop distinct from pause. */
7055
- DeviceFeature["MediaPlayerStop"] = "media-player-stop";
7056
- /** Alarm panel requires a PIN code on arm/disarm. */
7057
- DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
7058
- /** Presence device carries GPS coordinates (lat/lng/accuracy) in
7059
- * addition to a textual location. */
7060
- DeviceFeature["PresenceGps"] = "presence-gps";
7061
- /** Notifier accepts an inline / URL image attachment. */
7062
- DeviceFeature["NotifierImage"] = "notifier-image";
7063
- /** Notifier accepts a priority hint (high/normal/low). */
7064
- DeviceFeature["NotifierPriority"] = "notifier-priority";
7065
- /** Notifier accepts a free-form `data` payload for platform-specific
7066
- * fields. */
7067
- DeviceFeature["NotifierData"] = "notifier-data";
7068
- /** Notifier supports interactive action buttons / callbacks. */
7069
- DeviceFeature["NotifierActions"] = "notifier-actions";
7070
- /** Notifier supports per-call recipient targeting (multi-user). */
7071
- DeviceFeature["NotifierRecipients"] = "notifier-recipients";
7072
- /** Script runner accepts a variables map on each run invocation. */
7073
- DeviceFeature["ScriptVariables"] = "script-variables";
7074
- /** Automation `trigger` accepts a skipCondition flag — fires the
7075
- * automation's actions while bypassing its condition block. */
7076
- DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
7077
- return DeviceFeature;
7078
- }({});
7079
- /**
7080
- * Semantic role a device plays within its parent. Populated by driver
7081
- * addons when creating accessory devices (Reolink siren/floodlight/
7082
- * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
7083
- * admin UI to pick icons, labels, and widgets — a `Switch` with
7084
- * `role: Floodlight` renders as a bulb with a brightness slider,
7085
- * whereas a `Switch` with `role: Siren` renders as a klaxon.
7086
- *
7087
- * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
7088
- * sqlite as a nullable TEXT column — old rows keep working unchanged.
7089
- */
7090
- var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
7091
- DeviceRole["Siren"] = "siren";
7092
- DeviceRole["Floodlight"] = "floodlight";
7093
- DeviceRole["Spotlight"] = "spotlight";
7094
- DeviceRole["PirSensor"] = "pir-sensor";
7095
- DeviceRole["Chime"] = "chime";
7096
- DeviceRole["Autotrack"] = "autotrack";
7097
- DeviceRole["Nightvision"] = "nightvision";
7098
- DeviceRole["PrivacyMask"] = "privacy-mask";
7099
- DeviceRole["Doorbell"] = "doorbell";
7100
- /** Virtual HA toggle (input_boolean.*) — distinguishable from a
7101
- * real Switch device for UI rendering / export adapters. */
7102
- DeviceRole["BinaryHelper"] = "binary-helper";
7103
- /** Generic motion / occupancy / moving event source. Distinct from
7104
- * the camera accessory PirSensor role: that one is a camera child;
7105
- * this is a standalone HA / 3rd-party motion sensor. */
7106
- DeviceRole["MotionSensor"] = "motion-sensor";
7107
- DeviceRole["ContactSensor"] = "contact-sensor";
7108
- DeviceRole["LeakSensor"] = "leak-sensor";
7109
- DeviceRole["SmokeSensor"] = "smoke-sensor";
7110
- DeviceRole["COSensor"] = "co-sensor";
7111
- DeviceRole["GasSensor"] = "gas-sensor";
7112
- DeviceRole["TamperSensor"] = "tamper-sensor";
7113
- DeviceRole["VibrationSensor"] = "vibration-sensor";
7114
- DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
7115
- DeviceRole["SoundSensor"] = "sound-sensor";
7116
- /** Fallback for `binary_sensor` without a known `device_class`. */
7117
- DeviceRole["BinarySensor"] = "binary-sensor";
7118
- DeviceRole["TemperatureSensor"] = "temperature-sensor";
7119
- DeviceRole["HumiditySensor"] = "humidity-sensor";
7120
- DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
7121
- DeviceRole["PressureSensor"] = "pressure-sensor";
7122
- DeviceRole["PowerSensor"] = "power-sensor";
7123
- DeviceRole["EnergySensor"] = "energy-sensor";
7124
- DeviceRole["VoltageSensor"] = "voltage-sensor";
7125
- DeviceRole["CurrentSensor"] = "current-sensor";
7126
- DeviceRole["AirQualitySensor"] = "air-quality-sensor";
7127
- /** Battery level (numeric % via `sensor` OR low-bool via
7128
- * `binary_sensor` — the cap distinguishes via the value type). */
7129
- DeviceRole["BatterySensor"] = "battery-sensor";
7130
- /** Fallback for `sensor` numeric without a known `device_class`. */
7131
- DeviceRole["NumericSensor"] = "numeric-sensor";
7132
- /** String / enum state (HA `sensor` with `state_class: enum` or
7133
- * `attributes.options`). */
7134
- DeviceRole["EnumSensor"] = "enum-sensor";
7135
- /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
7136
- * or `date`). The slice carries the raw ISO string verbatim (hosted on
7137
- * the `enum-sensor` cap); the UI renders it locale-formatted. */
7138
- DeviceRole["DateTimeSensor"] = "datetime-sensor";
7139
- /** Last-resort fallback when nothing else matches. */
7140
- DeviceRole["GenericSensor"] = "generic-sensor";
7141
- DeviceRole["NumericControl"] = "numeric-control";
7142
- DeviceRole["SelectControl"] = "select-control";
7143
- DeviceRole["TextControl"] = "text-control";
7144
- DeviceRole["DateTimeControl"] = "datetime-control";
7145
- /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
7146
- * rich features (image, priority, channel routing). */
7147
- DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
7148
- /** Chat / messaging service (HA `notify.telegram_*`,
7149
- * `notify.discord_*`, etc.). */
7150
- DeviceRole["MessagingNotifier"] = "messaging-notifier";
7151
- /** Email-based delivery (HA `notify.smtp`, etc.). */
7152
- DeviceRole["EmailNotifier"] = "email-notifier";
7153
- /** Fallback when the notifier service name doesn't match a known
7154
- * pattern. */
7155
- DeviceRole["GenericNotifier"] = "generic-notifier";
7156
- return DeviceRole;
7157
- }({});
6963
+ frameSink: _enum(["callback", "shm"]).default("callback")
6964
+ });
6965
+ var EncodeProfileSchema = object({
6966
+ video: object({
6967
+ codec: _enum([
6968
+ "h264",
6969
+ "h265",
6970
+ "copy"
6971
+ ]),
6972
+ profile: _enum([
6973
+ "baseline",
6974
+ "main",
6975
+ "high"
6976
+ ]).optional(),
6977
+ width: number().int().positive().optional(),
6978
+ height: number().int().positive().optional(),
6979
+ fps: number().positive().optional(),
6980
+ bitrateKbps: number().int().positive().optional(),
6981
+ gopFrames: number().int().positive().optional(),
6982
+ bf: number().int().min(0).optional(),
6983
+ preset: _enum([
6984
+ "ultrafast",
6985
+ "superfast",
6986
+ "veryfast",
6987
+ "faster",
6988
+ "fast",
6989
+ "medium"
6990
+ ]).optional(),
6991
+ tune: _enum([
6992
+ "zerolatency",
6993
+ "film",
6994
+ "animation"
6995
+ ]).optional()
6996
+ }),
6997
+ audio: union([literal("passthrough"), object({
6998
+ codec: _enum([
6999
+ "opus",
7000
+ "aac",
7001
+ "pcmu",
7002
+ "pcma",
7003
+ "copy"
7004
+ ]),
7005
+ bitrateKbps: number().int().positive().optional(),
7006
+ sampleRateHz: number().int().positive().optional(),
7007
+ channels: union([literal(1), literal(2)]).optional()
7008
+ })]),
7009
+ /**
7010
+ * ffmpeg input-side args, inserted between the fixed global flags
7011
+ * (`-hide_banner -loglevel error`) and `-i pipe:0`. Free-text array
7012
+ * the widget surfaces a textarea + suggestion chips for the most-
7013
+ * used demuxer/format options.
7014
+ */
7015
+ inputArgs: array(string()).optional(),
7016
+ /**
7017
+ * ffmpeg output-side args, inserted between the encode block and
7018
+ * the final `-f <muxer> pipe:1`. Use for muxer options, bitstream
7019
+ * filters, codec-specific overrides. Free-text array.
7020
+ */
7021
+ outputArgs: array(string()).optional()
7022
+ });
7023
+ /** Cosine similarity between two embedding vectors */
7024
+ function cosineSimilarity(a, b) {
7025
+ if (a.length !== b.length) return 0;
7026
+ let dotProduct = 0;
7027
+ let normA = 0;
7028
+ let normB = 0;
7029
+ for (let i = 0; i < a.length; i++) {
7030
+ dotProduct += a[i] * b[i];
7031
+ normA += a[i] * a[i];
7032
+ normB += b[i] * b[i];
7033
+ }
7034
+ const denom = Math.sqrt(normA) * Math.sqrt(normB);
7035
+ return denom === 0 ? 0 : dotProduct / denom;
7036
+ }
7037
+ var YAMNET_TO_MACRO = {
7038
+ mapping: {
7039
+ Speech: "speech",
7040
+ "Child speech, kid speaking": "speech",
7041
+ Conversation: "speech",
7042
+ "Narration, monologue": "speech",
7043
+ Babbling: "speech",
7044
+ Whispering: "speech",
7045
+ "Speech synthesizer": "speech",
7046
+ Humming: "speech",
7047
+ Rapping: "speech",
7048
+ Singing: "speech",
7049
+ Choir: "speech",
7050
+ "Child singing": "speech",
7051
+ Shout: "scream",
7052
+ Bellow: "scream",
7053
+ Yell: "scream",
7054
+ Screaming: "scream",
7055
+ "Children shouting": "scream",
7056
+ Whoop: "scream",
7057
+ "Crying, sobbing": "crying",
7058
+ "Baby cry, infant cry": "crying",
7059
+ Whimper: "crying",
7060
+ "Wail, moan": "crying",
7061
+ Groan: "crying",
7062
+ Laughter: "laughter",
7063
+ "Baby laughter": "laughter",
7064
+ Giggle: "laughter",
7065
+ Snicker: "laughter",
7066
+ "Belly laugh": "laughter",
7067
+ "Chuckle, chortle": "laughter",
7068
+ Music: "music",
7069
+ "Musical instrument": "music",
7070
+ Guitar: "music",
7071
+ Piano: "music",
7072
+ Drum: "music",
7073
+ "Drum kit": "music",
7074
+ "Violin, fiddle": "music",
7075
+ Flute: "music",
7076
+ Saxophone: "music",
7077
+ Trumpet: "music",
7078
+ Synthesizer: "music",
7079
+ "Pop music": "music",
7080
+ "Rock music": "music",
7081
+ "Hip hop music": "music",
7082
+ "Classical music": "music",
7083
+ Jazz: "music",
7084
+ "Electronic music": "music",
7085
+ "Background music": "music",
7086
+ Dog: "dog",
7087
+ Bark: "dog",
7088
+ Yip: "dog",
7089
+ Howl: "dog",
7090
+ "Bow-wow": "dog",
7091
+ Growling: "dog",
7092
+ "Whimper (dog)": "dog",
7093
+ Cat: "cat",
7094
+ Purr: "cat",
7095
+ Meow: "cat",
7096
+ Hiss: "cat",
7097
+ Caterwaul: "cat",
7098
+ Bird: "bird",
7099
+ "Bird vocalization, bird call, bird song": "bird",
7100
+ "Chirp, tweet": "bird",
7101
+ Squawk: "bird",
7102
+ Crow: "bird",
7103
+ Owl: "bird",
7104
+ "Pigeon, dove": "bird",
7105
+ Animal: "animal",
7106
+ "Domestic animals, pets": "animal",
7107
+ "Livestock, farm animals, working animals": "animal",
7108
+ Horse: "animal",
7109
+ "Cattle, bovinae": "animal",
7110
+ Pig: "animal",
7111
+ Sheep: "animal",
7112
+ Goat: "animal",
7113
+ Frog: "animal",
7114
+ Insect: "animal",
7115
+ Cricket: "animal",
7116
+ Alarm: "alarm",
7117
+ "Alarm clock": "alarm",
7118
+ "Smoke detector, smoke alarm": "alarm",
7119
+ "Fire alarm": "alarm",
7120
+ Buzzer: "alarm",
7121
+ "Civil defense siren": "alarm",
7122
+ "Car alarm": "alarm",
7123
+ Siren: "siren",
7124
+ "Police car (siren)": "siren",
7125
+ "Ambulance (siren)": "siren",
7126
+ "Fire engine, fire truck (siren)": "siren",
7127
+ "Emergency vehicle": "siren",
7128
+ Foghorn: "siren",
7129
+ Doorbell: "doorbell",
7130
+ "Ding-dong": "doorbell",
7131
+ Knock: "doorbell",
7132
+ Tap: "doorbell",
7133
+ Glass: "glass_breaking",
7134
+ Shatter: "glass_breaking",
7135
+ "Chink, clink": "glass_breaking",
7136
+ "Gunshot, gunfire": "gunshot",
7137
+ "Machine gun": "gunshot",
7138
+ Explosion: "gunshot",
7139
+ Fireworks: "gunshot",
7140
+ Firecracker: "gunshot",
7141
+ "Artillery fire": "gunshot",
7142
+ "Cap gun": "gunshot",
7143
+ Boom: "gunshot",
7144
+ Vehicle: "vehicle",
7145
+ Car: "vehicle",
7146
+ Truck: "vehicle",
7147
+ Bus: "vehicle",
7148
+ Motorcycle: "vehicle",
7149
+ "Car passing by": "vehicle",
7150
+ "Vehicle horn, car horn, honking": "vehicle",
7151
+ "Traffic noise, roadway noise": "vehicle",
7152
+ Train: "vehicle",
7153
+ Aircraft: "vehicle",
7154
+ Helicopter: "vehicle",
7155
+ Bicycle: "vehicle",
7156
+ Skateboard: "vehicle",
7157
+ Fire: "fire",
7158
+ Crackle: "fire",
7159
+ Water: "water",
7160
+ Rain: "water",
7161
+ Raindrop: "water",
7162
+ "Rain on surface": "water",
7163
+ Stream: "water",
7164
+ Waterfall: "water",
7165
+ Ocean: "water",
7166
+ "Waves, surf": "water",
7167
+ "Splash, splatter": "water",
7168
+ Wind: "wind",
7169
+ Thunderstorm: "wind",
7170
+ Thunder: "wind",
7171
+ "Wind noise (microphone)": "wind",
7172
+ "Rustling leaves": "wind",
7173
+ Door: "door",
7174
+ "Sliding door": "door",
7175
+ Slam: "door",
7176
+ "Cupboard open or close": "door",
7177
+ "Walk, footsteps": "footsteps",
7178
+ Run: "footsteps",
7179
+ Shuffle: "footsteps",
7180
+ Crowd: "crowd",
7181
+ Chatter: "crowd",
7182
+ Cheering: "crowd",
7183
+ Applause: "crowd",
7184
+ "Children playing": "crowd",
7185
+ "Hubbub, speech noise, speech babble": "crowd",
7186
+ Telephone: "telephone",
7187
+ "Telephone bell ringing": "telephone",
7188
+ Ringtone: "telephone",
7189
+ "Telephone dialing, DTMF": "telephone",
7190
+ "Busy signal": "telephone",
7191
+ Engine: "engine",
7192
+ "Engine starting": "engine",
7193
+ Idling: "engine",
7194
+ "Accelerating, revving, vroom": "engine",
7195
+ "Light engine (high frequency)": "engine",
7196
+ "Medium engine (mid frequency)": "engine",
7197
+ "Heavy engine (low frequency)": "engine",
7198
+ "Lawn mower": "engine",
7199
+ Chainsaw: "engine",
7200
+ Hammer: "tools",
7201
+ Jackhammer: "tools",
7202
+ Sawing: "tools",
7203
+ "Power tool": "tools",
7204
+ Drill: "tools",
7205
+ Sanding: "tools",
7206
+ Silence: "silence"
7207
+ },
7208
+ preserveOriginal: false
7209
+ };
7210
+ var APPLE_SA_TO_MACRO = {
7211
+ mapping: {
7212
+ speech: "speech",
7213
+ child_speech: "speech",
7214
+ conversation: "speech",
7215
+ whispering: "speech",
7216
+ singing: "speech",
7217
+ humming: "speech",
7218
+ shout: "scream",
7219
+ yell: "scream",
7220
+ screaming: "scream",
7221
+ crying: "crying",
7222
+ baby_crying: "crying",
7223
+ sobbing: "crying",
7224
+ laughter: "laughter",
7225
+ baby_laughter: "laughter",
7226
+ giggling: "laughter",
7227
+ music: "music",
7228
+ guitar: "music",
7229
+ piano: "music",
7230
+ drums: "music",
7231
+ dog_bark: "dog",
7232
+ dog_bow_wow: "dog",
7233
+ dog_growling: "dog",
7234
+ dog_howl: "dog",
7235
+ cat_meow: "cat",
7236
+ cat_purr: "cat",
7237
+ cat_hiss: "cat",
7238
+ bird: "bird",
7239
+ bird_chirp: "bird",
7240
+ bird_squawk: "bird",
7241
+ animal: "animal",
7242
+ horse: "animal",
7243
+ cow_moo: "animal",
7244
+ insect: "animal",
7245
+ alarm: "alarm",
7246
+ smoke_alarm: "alarm",
7247
+ fire_alarm: "alarm",
7248
+ car_alarm: "alarm",
7249
+ siren: "siren",
7250
+ police_siren: "siren",
7251
+ ambulance_siren: "siren",
7252
+ doorbell: "doorbell",
7253
+ door_knock: "doorbell",
7254
+ knocking: "doorbell",
7255
+ glass_breaking: "glass_breaking",
7256
+ glass_shatter: "glass_breaking",
7257
+ gunshot: "gunshot",
7258
+ explosion: "gunshot",
7259
+ fireworks: "gunshot",
7260
+ car: "vehicle",
7261
+ truck: "vehicle",
7262
+ motorcycle: "vehicle",
7263
+ car_horn: "vehicle",
7264
+ vehicle_horn: "vehicle",
7265
+ traffic: "vehicle",
7266
+ fire: "fire",
7267
+ fire_crackle: "fire",
7268
+ water: "water",
7269
+ rain: "water",
7270
+ ocean: "water",
7271
+ splash: "water",
7272
+ wind: "wind",
7273
+ thunder: "wind",
7274
+ thunderstorm: "wind",
7275
+ door: "door",
7276
+ door_slam: "door",
7277
+ sliding_door: "door",
7278
+ footsteps: "footsteps",
7279
+ walking: "footsteps",
7280
+ running: "footsteps",
7281
+ crowd: "crowd",
7282
+ chatter: "crowd",
7283
+ cheering: "crowd",
7284
+ applause: "crowd",
7285
+ telephone_ring: "telephone",
7286
+ ringtone: "telephone",
7287
+ engine: "engine",
7288
+ engine_starting: "engine",
7289
+ lawn_mower: "engine",
7290
+ chainsaw: "engine",
7291
+ hammer: "tools",
7292
+ jackhammer: "tools",
7293
+ drill: "tools",
7294
+ power_tool: "tools",
7295
+ silence: "silence"
7296
+ },
7297
+ preserveOriginal: false
7298
+ };
7299
+ var _macroLookup = /* @__PURE__ */ new Map();
7300
+ for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7301
+ for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7158
7302
  /**
7159
7303
  * Accessory device helpers — shared across drivers.
7160
7304
  *
@@ -7314,74 +7458,6 @@ object({
7314
7458
  });
7315
7459
  DeviceType.Sensor;
7316
7460
  /**
7317
- * Generic types for capability definitions.
7318
- *
7319
- * A capability is defined with Zod schemas for methods, events, and settings.
7320
- * TypeScript types are inferred via z.infer<> — zero duplication.
7321
- *
7322
- * Pattern:
7323
- * 1. Define Zod schemas for data, methods, settings
7324
- * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
7325
- * 3. Export type IProvider = InferProvider<typeof capabilityDef>
7326
- * 4. Addon implements IProvider
7327
- * 5. Registry auto-mounts tRPC router from definition.methods
7328
- */
7329
- /**
7330
- * Output schema shared by the contribution + live methods.
7331
- *
7332
- * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
7333
- * tabs[]) without importing from `../interfaces/config-ui.js` — a
7334
- * concrete-but-lenient Zod object keeps tRPC output inference happy
7335
- * (using `z.unknown()` here collapses unrelated router branches to
7336
- * `unknown` when the generator re-inlines the huge AppRouter type).
7337
- *
7338
- * `.passthrough()` on sections/fields accepts whatever FormBuilder
7339
- * extensions the caller adds (showWhen, displayScale, …) without
7340
- * rebuilding every time a new field kind is introduced.
7341
- */
7342
- var ContributionSectionSchema = object({
7343
- id: string(),
7344
- title: string(),
7345
- description: string().optional(),
7346
- style: _enum(["card", "accordion"]).optional(),
7347
- defaultCollapsed: boolean().optional(),
7348
- columns: union([
7349
- literal(1),
7350
- literal(2),
7351
- literal(3),
7352
- literal(4)
7353
- ]).optional(),
7354
- tab: string().optional(),
7355
- location: _enum(["settings", "top-tab"]).optional(),
7356
- order: number().optional(),
7357
- fields: array(any())
7358
- });
7359
- object({
7360
- tabs: array(object({
7361
- id: string(),
7362
- label: string(),
7363
- icon: string(),
7364
- order: number().optional()
7365
- })).optional(),
7366
- sections: array(ContributionSectionSchema)
7367
- }).nullable();
7368
- object({ deviceId: number() }), object({ deviceId: number() }), object({
7369
- deviceId: number(),
7370
- patch: record(string(), unknown())
7371
- }), object({ success: literal(true) });
7372
- object({ deviceId: number() }), unknown().nullable();
7373
- /** Shorthand to define a method schema */
7374
- function method(input, output, options) {
7375
- return {
7376
- input,
7377
- output,
7378
- kind: options?.kind ?? "query",
7379
- auth: options?.auth ?? "protected",
7380
- ...options?.access !== void 0 ? { access: options.access } : {},
7381
- timeoutMs: options?.timeoutMs
7382
- };
7383
- }
7384
- /**
7385
7461
  * Alarm-panel cap. Models HA `alarm_control_panel.*` on
7386
7462
  * `DeviceType.AlarmPanel`. State follows HA's canonical lifecycle
7387
7463
  * across disarmed / armed_(home|away|night|vacation|custom_bypass) /
@@ -9225,6 +9301,24 @@ var DetectorOutputSchema = object({
9225
9301
  inferenceMs: number(),
9226
9302
  modelId: string()
9227
9303
  });
9304
+ var EngineProvisioningSchema = object({
9305
+ runtimeId: _enum([
9306
+ "onnx",
9307
+ "openvino",
9308
+ "coreml"
9309
+ ]).nullable(),
9310
+ device: string().nullable(),
9311
+ state: _enum([
9312
+ "idle",
9313
+ "installing",
9314
+ "verifying",
9315
+ "ready",
9316
+ "failed"
9317
+ ]),
9318
+ progress: number().optional(),
9319
+ error: string().optional(),
9320
+ nextRetryAt: number().optional()
9321
+ });
9228
9322
  var PipelineStepInputSchema = lazy(() => object({
9229
9323
  addonId: string(),
9230
9324
  modelId: string(),
@@ -9293,7 +9387,7 @@ var PipelineRunResultBridge = custom();
9293
9387
  method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(_void(), PipelineEngineChoiceSchema, {
9294
9388
  kind: "mutation",
9295
9389
  auth: "admin"
9296
- }), method(_void(), record(string(), object({
9390
+ }), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
9297
9391
  modelId: string(),
9298
9392
  settings: record(string(), unknown()).readonly()
9299
9393
  }))), method(object({ steps: record(string(), object({
@@ -11443,9 +11537,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
11443
11537
  limit: number().optional(),
11444
11538
  tags: record(string(), string()).optional()
11445
11539
  }), array(LogEntrySchema).readonly());
11446
- var StaticDirOutputSchema = object({ staticDir: string() });
11447
- var VersionOutputSchema = object({ version: string() });
11448
- method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
11449
11540
  /**
11450
11541
  * Zod schemas for persisted record types.
11451
11542
  *
@@ -12945,7 +13036,10 @@ var AgentAddonConfigSchema = object({
12945
13036
  modelId: string(),
12946
13037
  settings: record(string(), unknown()).readonly()
12947
13038
  });
12948
- var AgentPipelineSettingsSchema = object({ addonDefaults: record(string(), AgentAddonConfigSchema).readonly() });
13039
+ var AgentPipelineSettingsSchema = object({
13040
+ addonDefaults: record(string(), AgentAddonConfigSchema).readonly(),
13041
+ maxCameras: number().int().nonnegative().nullable().default(null)
13042
+ });
12949
13043
  var CameraPipelineForAgentSchema = object({
12950
13044
  steps: array(PipelineStepInputSchema).readonly(),
12951
13045
  audio: object({
@@ -13047,6 +13141,133 @@ var GlobalMetricsSchema = object({
13047
13141
  * capability providers.
13048
13142
  */
13049
13143
  var CapabilityBindingsSchema = record(string(), string());
13144
+ /** Source block — always present; derives from the stream catalog. */
13145
+ var CameraSourceStatusSchema = object({ streams: array(object({
13146
+ camStreamId: string(),
13147
+ codec: string(),
13148
+ width: number(),
13149
+ height: number(),
13150
+ fps: number(),
13151
+ kind: string()
13152
+ })).readonly() });
13153
+ /** Assignment block — always present (orchestrator-local, no remote call). */
13154
+ var CameraAssignmentStatusSchema = object({
13155
+ detectionNodeId: string().nullable(),
13156
+ decoderNodeId: string().nullable(),
13157
+ audioNodeId: string().nullable(),
13158
+ pinned: object({
13159
+ detection: boolean(),
13160
+ decoder: boolean(),
13161
+ audio: boolean()
13162
+ }),
13163
+ reasons: object({
13164
+ detection: string().optional(),
13165
+ decoder: string().optional(),
13166
+ audio: string().optional()
13167
+ })
13168
+ });
13169
+ /** Broker block — null when the broker stage is unreachable or inactive. */
13170
+ var CameraBrokerStatusSchema = object({
13171
+ profiles: array(object({
13172
+ profile: string(),
13173
+ status: string(),
13174
+ codec: string(),
13175
+ width: number(),
13176
+ height: number(),
13177
+ subscribers: number(),
13178
+ inFps: number(),
13179
+ outFps: number()
13180
+ })).readonly(),
13181
+ webrtcSessions: number(),
13182
+ rtspRestream: boolean()
13183
+ });
13184
+ /** Shared-memory ring statistics within the decoder block. */
13185
+ var CameraDecoderShmSchema = object({
13186
+ framesWritten: number(),
13187
+ getFrameHits: number(),
13188
+ getFrameMisses: number(),
13189
+ budgetMb: number()
13190
+ });
13191
+ /** Decoder block — null when the decoder stage is unreachable or inactive. */
13192
+ var CameraDecoderStatusSchema = object({
13193
+ nodeId: string(),
13194
+ formats: array(string()).readonly(),
13195
+ sessionCount: number(),
13196
+ shm: CameraDecoderShmSchema
13197
+ });
13198
+ /** Motion block — null when motion detection is not active for this device. */
13199
+ var CameraMotionStatusSchema = object({
13200
+ enabled: boolean(),
13201
+ fps: number()
13202
+ });
13203
+ /** Detection provisioning sub-block. */
13204
+ var CameraDetectionProvisioningSchema = object({
13205
+ state: _enum([
13206
+ "idle",
13207
+ "installing",
13208
+ "verifying",
13209
+ "ready",
13210
+ "failed"
13211
+ ]),
13212
+ error: string().optional()
13213
+ });
13214
+ /** Detection phase — derived from the runner's engine phase. */
13215
+ var CameraDetectionPhaseSchema = _enum([
13216
+ "idle",
13217
+ "watching",
13218
+ "active"
13219
+ ]);
13220
+ /** Detection block — null when no detection node is assigned or reachable. */
13221
+ var CameraDetectionStatusSchema = object({
13222
+ nodeId: string(),
13223
+ engine: object({
13224
+ backend: string(),
13225
+ device: string()
13226
+ }),
13227
+ phase: CameraDetectionPhaseSchema,
13228
+ configuredFps: number(),
13229
+ actualFps: number(),
13230
+ queueDepth: number(),
13231
+ avgInferenceMs: number(),
13232
+ provisioning: CameraDetectionProvisioningSchema
13233
+ });
13234
+ /** Audio block — null when no audio node is assigned or reachable. */
13235
+ var CameraAudioStatusSchema = object({
13236
+ nodeId: string(),
13237
+ enabled: boolean()
13238
+ });
13239
+ /** Recording block — null when no recording cap is active for this device. */
13240
+ var CameraRecordingStatusSchema = object({
13241
+ mode: _enum([
13242
+ "off",
13243
+ "continuous",
13244
+ "events"
13245
+ ]),
13246
+ active: boolean(),
13247
+ storageBytes: number()
13248
+ });
13249
+ /**
13250
+ * Aggregated per-camera pipeline status — server-composed, single call.
13251
+ *
13252
+ * The `assignment` and `source` blocks are always present.
13253
+ * Every other block is `null` when the stage is inactive or unreachable
13254
+ * during the bounded parallel fan-out in the orchestrator implementation.
13255
+ *
13256
+ * See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
13257
+ */
13258
+ var CameraStatusSchema = object({
13259
+ deviceId: number(),
13260
+ assignment: CameraAssignmentStatusSchema,
13261
+ source: CameraSourceStatusSchema,
13262
+ broker: CameraBrokerStatusSchema.nullable(),
13263
+ decoder: CameraDecoderStatusSchema.nullable(),
13264
+ motion: CameraMotionStatusSchema.nullable(),
13265
+ detection: CameraDetectionStatusSchema.nullable(),
13266
+ audio: CameraAudioStatusSchema.nullable(),
13267
+ recording: CameraRecordingStatusSchema.nullable(),
13268
+ /** Unix timestamp (ms) when this snapshot was composed server-side. */
13269
+ fetchedAt: number()
13270
+ });
13050
13271
  method(object({
13051
13272
  deviceId: number(),
13052
13273
  agentNodeId: string()
@@ -13114,6 +13335,12 @@ method(object({
13114
13335
  }), {
13115
13336
  kind: "mutation",
13116
13337
  auth: "admin"
13338
+ }), method(object({
13339
+ agentNodeId: string(),
13340
+ maxCameras: number().int().nonnegative().nullable()
13341
+ }), object({ success: literal(true) }), {
13342
+ kind: "mutation",
13343
+ auth: "admin"
13117
13344
  }), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
13118
13345
  deviceId: number(),
13119
13346
  addonId: string(),
@@ -13139,7 +13366,7 @@ method(object({
13139
13366
  }), method(object({
13140
13367
  deviceId: number(),
13141
13368
  agentNodeId: string().optional()
13142
- }), CameraPipelineConfigSchema), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
13369
+ }), CameraPipelineConfigSchema), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
13143
13370
  name: string(),
13144
13371
  description: string().optional(),
13145
13372
  config: CameraPipelineConfigSchema
@@ -13636,7 +13863,7 @@ method(object({
13636
13863
  }), _void(), {
13637
13864
  kind: "mutation",
13638
13865
  auth: "admin"
13639
- }), 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({
13866
+ }), 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({
13640
13867
  deviceId: number(),
13641
13868
  values: record(string(), unknown())
13642
13869
  }), object({ success: literal(true) }), {
@@ -14367,7 +14594,20 @@ var DiskSpaceInfoSchema = object({
14367
14594
  var PidResourceStatsSchema = object({
14368
14595
  pid: number(),
14369
14596
  cpu: number(),
14370
- memory: number()
14597
+ memory: number(),
14598
+ /**
14599
+ * Private (anonymous) resident bytes — the per-process V8 heap + native
14600
+ * allocations NOT shared with other processes (Linux RssAnon). This is the
14601
+ * "real" per-runner cost; summing it across runners is meaningful, unlike
14602
+ * `memory` (RSS), which double-counts the shared mmap'd framework code.
14603
+ * Undefined where /proc is unavailable (e.g. macOS).
14604
+ */
14605
+ privateBytes: number().optional(),
14606
+ /**
14607
+ * Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
14608
+ * code shared copy-on-write across runners. Undefined on macOS.
14609
+ */
14610
+ sharedBytes: number().optional()
14371
14611
  });
14372
14612
  var AddonInstanceSchema = object({
14373
14613
  addonId: string(),
@@ -14416,6 +14656,17 @@ var KillProcessResultSchema = object({
14416
14656
  reason: string().optional(),
14417
14657
  signal: _enum(["SIGTERM", "SIGKILL"]).optional()
14418
14658
  });
14659
+ var DumpHeapSnapshotInputSchema = object({
14660
+ /** The addon whose runner should dump a heap snapshot. */
14661
+ addonId: string() });
14662
+ var DumpHeapSnapshotResultSchema = object({
14663
+ success: boolean(),
14664
+ /** Path of the written .heapsnapshot inside the runner's container/host. */
14665
+ path: string().optional(),
14666
+ /** Process pid that was signalled. */
14667
+ pid: number().optional(),
14668
+ reason: string().optional()
14669
+ });
14419
14670
  var SystemMetricsSchema = object({
14420
14671
  cpuPercent: number(),
14421
14672
  memoryPercent: number(),
@@ -14429,6 +14680,9 @@ var SystemMetricsSchema = object({
14429
14680
  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, {
14430
14681
  kind: "mutation",
14431
14682
  auth: "admin"
14683
+ }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
14684
+ kind: "mutation",
14685
+ auth: "admin"
14432
14686
  });
14433
14687
  var PtzPresetSchema = object({
14434
14688
  id: string(),
@@ -14845,63 +15099,6 @@ method(object({
14845
15099
  auth: "admin"
14846
15100
  });
14847
15101
  /**
14848
- * device-ops — device-scoped cap that unifies the per-IDevice operations
14849
- * previously routed through the `.device-ops` Moleculer bridge service.
14850
- *
14851
- * Each worker that hosts live `IDevice` instances auto-registers a native
14852
- * provider for this cap (per device) backed by its local
14853
- * `DeviceRegistry`. Hub-side callers reach it transparently through
14854
- * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
14855
- * `deviceId` + `nodeId` and dispatches through the standard cap-router,
14856
- * so there's no parallel bridge path anymore.
14857
- *
14858
- * The surface is intentionally small — every method corresponds to a
14859
- * single action on the live `IDevice` (or `ICameraDevice` for
14860
- * `getStreamSources`). Richer orchestration (enable/disable with
14861
- * integration plumbing, bulk updates) stays in the `device-manager` cap;
14862
- * `device-ops` is the per-device primitive the device-manager routes to.
14863
- */
14864
- var StreamSourceEntrySchema$1 = object({
14865
- id: string(),
14866
- label: string(),
14867
- protocol: _enum([
14868
- "rtsp",
14869
- "rtmp",
14870
- "annexb",
14871
- "http-mjpeg",
14872
- "webrtc",
14873
- "custom"
14874
- ]),
14875
- url: string().optional(),
14876
- resolution: object({
14877
- width: number(),
14878
- height: number()
14879
- }).optional(),
14880
- fps: number().optional(),
14881
- bitrate: number().optional(),
14882
- codec: string().optional(),
14883
- profileHint: CamProfileSchema.optional(),
14884
- sdp: string().optional()
14885
- });
14886
- var ConfigEntrySchema$1 = object({
14887
- key: string(),
14888
- value: unknown()
14889
- });
14890
- var RawStateResultSchema = object({
14891
- /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
14892
- source: string(),
14893
- /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
14894
- data: record(string(), unknown())
14895
- });
14896
- method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
14897
- deviceId: number(),
14898
- values: record(string(), unknown())
14899
- }), _void(), { kind: "mutation" }), method(object({
14900
- deviceId: number(),
14901
- action: string().min(1),
14902
- input: unknown()
14903
- }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
14904
- /**
14905
15102
  * camera-credentials — device-scoped cap exposing the camera's network
14906
15103
  * + auth surface in a vendor-neutral shape.
14907
15104
  *
@@ -18584,6 +18781,12 @@ Object.freeze({
18584
18781
  addonId: null,
18585
18782
  access: "view"
18586
18783
  },
18784
+ "metricsProvider.dumpHeapSnapshot": {
18785
+ capName: "metrics-provider",
18786
+ capScope: "system",
18787
+ addonId: null,
18788
+ access: "create"
18789
+ },
18587
18790
  "metricsProvider.getAddonStats": {
18588
18791
  capName: "metrics-provider",
18589
18792
  capScope: "system",
@@ -19040,6 +19243,12 @@ Object.freeze({
19040
19243
  addonId: null,
19041
19244
  access: "view"
19042
19245
  },
19246
+ "pipelineExecutor.getEngineProvisioning": {
19247
+ capName: "pipeline-executor",
19248
+ capScope: "system",
19249
+ addonId: null,
19250
+ access: "view"
19251
+ },
19043
19252
  "pipelineExecutor.getGlobalPipelineConfig": {
19044
19253
  capName: "pipeline-executor",
19045
19254
  capScope: "system",
@@ -19244,6 +19453,18 @@ Object.freeze({
19244
19453
  addonId: null,
19245
19454
  access: "view"
19246
19455
  },
19456
+ "pipelineOrchestrator.getCameraStatus": {
19457
+ capName: "pipeline-orchestrator",
19458
+ capScope: "system",
19459
+ addonId: null,
19460
+ access: "view"
19461
+ },
19462
+ "pipelineOrchestrator.getCameraStatuses": {
19463
+ capName: "pipeline-orchestrator",
19464
+ capScope: "system",
19465
+ addonId: null,
19466
+ access: "view"
19467
+ },
19247
19468
  "pipelineOrchestrator.getCameraStepOverrides": {
19248
19469
  capName: "pipeline-orchestrator",
19249
19470
  capScope: "system",
@@ -19328,6 +19549,12 @@ Object.freeze({
19328
19549
  addonId: null,
19329
19550
  access: "create"
19330
19551
  },
19552
+ "pipelineOrchestrator.setAgentMaxCameras": {
19553
+ capName: "pipeline-orchestrator",
19554
+ capScope: "system",
19555
+ addonId: null,
19556
+ access: "create"
19557
+ },
19331
19558
  "pipelineOrchestrator.setCameraPipelineForAgent": {
19332
19559
  capName: "pipeline-orchestrator",
19333
19560
  capScope: "system",