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