@camstack/addon-provider-onvif 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +727 -690
  2. package/dist/addon.mjs +727 -690
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -4632,63 +4632,7 @@ function _instanceof(cls, params = {}) {
4632
4632
  return inst;
4633
4633
  }
4634
4634
  //#endregion
4635
- //#region ../types/dist/index.mjs
4636
- /**
4637
- * Deep wiring healthcheck — snapshot of active reachability probes across
4638
- * every declared capability + widget of every installed plugin, on every
4639
- * node. Produced by the backend `WiringHealthService` and surfaced via
4640
- * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
4641
- *
4642
- * Unlike `/health` (process liveness), this reflects whether each cap/widget
4643
- * is actually *reachable* over the real cap-dispatch path. See spec
4644
- * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
4645
- */
4646
- /** What kind of target a probe addressed. */
4647
- var wiringProbeKindSchema = _enum([
4648
- "singleton",
4649
- "device",
4650
- "widget"
4651
- ]);
4652
- /** Result of probing a single (cap|widget [, device]) target. */
4653
- var wiringProbeResultSchema = object({
4654
- capName: string(),
4655
- kind: wiringProbeKindSchema,
4656
- deviceId: number().optional(),
4657
- reachable: boolean(),
4658
- latencyMs: number(),
4659
- error: string().optional()
4660
- });
4661
- /** Per-addon roll-up of cap + widget probe results. */
4662
- var wiringAddonHealthSchema = object({
4663
- addonId: string(),
4664
- caps: array(wiringProbeResultSchema).readonly(),
4665
- widgets: array(wiringProbeResultSchema).readonly()
4666
- });
4667
- /** Per-node roll-up. */
4668
- var wiringNodeHealthSchema = object({
4669
- nodeId: string(),
4670
- addons: array(wiringAddonHealthSchema).readonly()
4671
- });
4672
- object({
4673
- /** True only when every probed target is reachable. */
4674
- ok: boolean(),
4675
- /** True when at least one target is unreachable. */
4676
- degraded: boolean(),
4677
- checkedAt: string(),
4678
- nodes: array(wiringNodeHealthSchema).readonly(),
4679
- summary: object({
4680
- total: number(),
4681
- reachable: number(),
4682
- unreachable: number()
4683
- })
4684
- });
4685
- var MODEL_FORMATS = [
4686
- "onnx",
4687
- "coreml",
4688
- "openvino",
4689
- "tflite",
4690
- "pt"
4691
- ];
4635
+ //#region ../types/dist/sleep-D7JeS58T.mjs
4692
4636
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4693
4637
  EventCategory["SystemBoot"] = "system.boot";
4694
4638
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -6011,7 +5955,7 @@ var ProfileSlotSchema = object({
6011
5955
  * Zod schema for StreamSourceEntry — the canonical stream descriptor
6012
5956
  * exposed by ICameraDevice.getStreamSources() and consumed by the broker.
6013
5957
  */
6014
- var StreamSourceEntrySchema = object({
5958
+ var StreamSourceEntrySchema$1 = object({
6015
5959
  id: string(),
6016
5960
  label: string(),
6017
5961
  protocol: _enum([
@@ -6233,121 +6177,595 @@ var ProfileRtspEntrySchema = object({
6233
6177
  codec: string().optional(),
6234
6178
  resolution: CamStreamResolutionSchema.optional()
6235
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` cap — a cover-sibling actuator
6217
+ * modelled on the same open/closed lifecycle. */
6218
+ DeviceType["Valve"] = "valve";
6219
+ /** Humidifier / dehumidifier with on/off + target humidity + mode
6220
+ * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6221
+ * modelled on the same target / mode lifecycle. */
6222
+ DeviceType["Humidifier"] = "humidifier";
6223
+ /** Water heater / boiler with target temperature + operation mode +
6224
+ * away mode (HA `water_heater.*`). `water-heater` cap — a
6225
+ * climate-family actuator. */
6226
+ DeviceType["WaterHeater"] = "water-heater";
6227
+ /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6228
+ DeviceType["Fan"] = "fan";
6229
+ /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6230
+ * the camera surface — those use `Camera`. `media-player` cap. */
6231
+ DeviceType["MediaPlayer"] = "media-player";
6232
+ /** Security panel / alarm system (HA `alarm_control_panel.*`).
6233
+ * `alarm-panel` cap. */
6234
+ DeviceType["AlarmPanel"] = "alarm-panel";
6235
+ /** Generic user-settable input (HA `number` / `input_number` / `select`
6236
+ * / `input_select` / `text` / `input_text` / `input_datetime`).
6237
+ * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6238
+ * TextControl / DateTimeControl. */
6239
+ DeviceType["Control"] = "control";
6240
+ /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6241
+ * `presence` cap. */
6242
+ DeviceType["Presence"] = "presence";
6243
+ /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6244
+ * `weather` cap. */
6245
+ DeviceType["Weather"] = "weather";
6246
+ /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6247
+ DeviceType["Vacuum"] = "vacuum";
6248
+ /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6249
+ * `lawn-mower-control` cap. */
6250
+ DeviceType["LawnMower"] = "lawn-mower";
6251
+ /** Physical HA device group — parent container for entity-children
6252
+ * adopted from a single HA device entry. Not renderable as a
6253
+ * standalone device; exists only to anchor child entities. */
6254
+ DeviceType["Container"] = "container";
6255
+ /** Single still-image entity (HA `image.*`). Read-only display of an
6256
+ * `entity_picture` signed URL the browser loads directly. `image` cap. */
6257
+ DeviceType["Image"] = "image";
6258
+ return DeviceType;
6259
+ }({});
6260
+ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6261
+ DeviceFeature["BatteryOperated"] = "battery-operated";
6262
+ DeviceFeature["Rebootable"] = "rebootable";
6263
+ /**
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.
6267
+ */
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";
6273
+ /**
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.
6281
+ */
6282
+ DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6283
+ /**
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, ...)`.
6288
+ *
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".
6292
+ */
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
+ }({});
6236
6377
  /**
6237
- * Numeric day-of-week: 0 = Sunday 6 = Saturday (matches `Date.getDay`).
6238
- * Named `RecordingWeekday` to avoid collision with the string-union
6239
- * `Weekday` exported from `interfaces/timezones.ts`.
6240
- */
6241
- var RecordingWeekdaySchema = number().int().min(0).max(6);
6242
- var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6243
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6244
- kind: literal("timeOfDay"),
6245
- start: string().regex(HHMM),
6246
- end: string().regex(HHMM),
6247
- /** Restrict to these weekdays; omit = every day. */
6248
- days: array(RecordingWeekdaySchema).optional()
6249
- })]);
6250
- var RecordingModeSchema = _enum([
6251
- "continuous",
6252
- "onMotion",
6253
- "onAudioThreshold"
6254
- ]);
6255
- /**
6256
- * First-class, authoritative per-camera storage mode — the netta choice the UI
6257
- * reads directly (never inferred from `rules`):
6258
- * - `off` — not recording.
6259
- * - `events` — record only around triggers (motion / audio threshold),
6260
- * with pre/post-buffer.
6261
- * - `continuous` — record 24/7 within the schedule.
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.
6262
6384
  *
6263
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6264
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6385
+ * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
6386
+ * sqlite as a nullable TEXT column old rows keep working unchanged.
6265
6387
  */
6266
- var RecordingStorageModeSchema = _enum([
6267
- "off",
6268
- "events",
6269
- "continuous"
6270
- ]);
6271
- /** Which detectors trigger an `events`-mode recording. */
6272
- var RecordingTriggersSchema = object({
6273
- motion: boolean().optional(),
6274
- audioThresholdDbfs: number().optional()
6275
- });
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
+ }({});
6276
6456
  /**
6277
- * Mode of a single recording band — the recorder per-band vocabulary.
6457
+ * Generic types for capability definitions.
6278
6458
  *
6279
- * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6280
- * only ever `continuous` or `events`; "off" is expressed by the absence of a
6281
- * covering band, not by a band value.
6282
- */
6283
- var RecordingBandModeSchema = _enum(["continuous", "events"]);
6284
- /**
6285
- * Triggers for an `events`-mode band. Identical shape to
6286
- * `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
6287
- * two never drift.
6288
- */
6289
- var RecordingBandTriggersSchema = RecordingTriggersSchema;
6290
- /**
6291
- * A single mode-per-band window — the canonical recorder band shape, the
6292
- * single source of truth re-used by `addon-pipeline/recorder`.
6459
+ * A capability is defined with Zod schemas for methods, events, and settings.
6460
+ * TypeScript types are inferred via z.infer<> zero duplication.
6293
6461
  *
6294
- * `days` lists the weekdays the band covers (empty = every day, matching the
6295
- * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6296
- * span wraps past midnight (handled by the band engine).
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
6297
6468
  */
6298
- var RecordingBandSchema = object({
6299
- days: array(RecordingWeekdaySchema),
6300
- start: string().regex(HHMM),
6301
- end: string().regex(HHMM),
6302
- mode: RecordingBandModeSchema,
6303
- triggers: RecordingBandTriggersSchema.optional(),
6304
- preBufferSec: number().min(0).optional(),
6305
- postBufferSec: number().min(0).optional()
6306
- });
6307
- var RecordingRuleSchema = object({
6308
- schedule: RecordingScheduleSchema,
6309
- mode: RecordingModeSchema,
6310
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6311
- preBufferSec: number().min(0).default(0),
6312
- /** Keep recording until this many seconds after the last trigger. */
6313
- postBufferSec: number().min(0).default(0),
6314
- /** Each new trigger restarts the post-buffer window. */
6315
- resetTimeoutOnNewEvent: boolean().default(true),
6316
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
6317
- thresholdDbfs: number().optional()
6318
- });
6319
6469
  /**
6320
- * Per-device retention overrides. Every field is optional; an unset or `0`
6321
- * value inherits the node-wide recorder default. Only footage-lifetime limits
6322
- * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6323
- * (when the volume is too full to keep recording) is NOT a per-camera concern
6324
- * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6325
- * shared by every camera writing to that volume.
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.
6326
6481
  */
6327
- var RecordingRetentionSchema = object({
6328
- maxAgeDays: number().min(0).optional(),
6329
- maxSizeGb: number().min(0).optional()
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())
6330
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
+ };
6523
+ }
6524
+ var StaticDirOutputSchema = object({ staticDir: string() });
6525
+ var VersionOutputSchema = object({ version: string() });
6526
+ method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
6331
6527
  /**
6332
- * The full per-camera recording intent the wire shape of a RecordingTarget.
6528
+ * device-ops device-scoped cap that unifies the per-IDevice operations
6529
+ * previously routed through the `.device-ops` Moleculer bridge service.
6333
6530
  *
6334
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6335
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6336
- * only for transition + migration (`migrateRulesToMode`); the policy engine
6337
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
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.
6338
6543
  */
6339
- var RecordingConfigSchema = object({
6340
- enabled: boolean(),
6341
- /** Authoritative storage mode. Absent on legacy targets → derived once via
6342
- * `migrateRulesToMode`, then persisted. */
6343
- mode: RecordingStorageModeSchema.optional(),
6344
- profiles: array(CamProfileSchema).optional(),
6345
- segmentSeconds: number().int().positive().optional(),
6346
- /** Shared recording time-bands for `events` & `continuous` — record only when
6347
- * the wall-clock falls inside one of these windows. Omit or empty = always.
6348
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
6349
- schedules: array(RecordingScheduleSchema).optional(),
6350
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
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
6351
6769
  * normalized into `schedules` on read and never written going forward. (Not
6352
6770
  * tagged `@deprecated`: the normalization paths must read it cast-free.) */
6353
6771
  schedule: RecordingScheduleSchema.optional(),
@@ -6580,16 +6998,6 @@ var EncodeProfileSchema = object({
6580
6998
  */
6581
6999
  outputArgs: array(string()).optional()
6582
7000
  });
6583
- /**
6584
- import { errMsg } from '@camstack/types'
6585
- * Extract a human-readable message from an unknown error value.
6586
- * Replaces the ubiquitous `errMsg(err)` pattern.
6587
- */
6588
- function errMsg(err) {
6589
- if (err instanceof Error) return err.message;
6590
- if (typeof err === "string") return err;
6591
- return String(err);
6592
- }
6593
7001
  var YAMNET_TO_MACRO = {
6594
7002
  mapping: {
6595
7003
  Speech: "speech",
@@ -6741,396 +7149,120 @@ var YAMNET_TO_MACRO = {
6741
7149
  "Hubbub, speech noise, speech babble": "crowd",
6742
7150
  Telephone: "telephone",
6743
7151
  "Telephone bell ringing": "telephone",
6744
- Ringtone: "telephone",
6745
- "Telephone dialing, DTMF": "telephone",
6746
- "Busy signal": "telephone",
6747
- Engine: "engine",
6748
- "Engine starting": "engine",
6749
- Idling: "engine",
6750
- "Accelerating, revving, vroom": "engine",
6751
- "Light engine (high frequency)": "engine",
6752
- "Medium engine (mid frequency)": "engine",
6753
- "Heavy engine (low frequency)": "engine",
6754
- "Lawn mower": "engine",
6755
- Chainsaw: "engine",
6756
- Hammer: "tools",
6757
- Jackhammer: "tools",
6758
- Sawing: "tools",
6759
- "Power tool": "tools",
6760
- Drill: "tools",
6761
- Sanding: "tools",
6762
- Silence: "silence"
6763
- },
6764
- preserveOriginal: false
6765
- };
6766
- var APPLE_SA_TO_MACRO = {
6767
- mapping: {
6768
- speech: "speech",
6769
- child_speech: "speech",
6770
- conversation: "speech",
6771
- whispering: "speech",
6772
- singing: "speech",
6773
- humming: "speech",
6774
- shout: "scream",
6775
- yell: "scream",
6776
- screaming: "scream",
6777
- crying: "crying",
6778
- baby_crying: "crying",
6779
- sobbing: "crying",
6780
- laughter: "laughter",
6781
- baby_laughter: "laughter",
6782
- giggling: "laughter",
6783
- music: "music",
6784
- guitar: "music",
6785
- piano: "music",
6786
- drums: "music",
6787
- dog_bark: "dog",
6788
- dog_bow_wow: "dog",
6789
- dog_growling: "dog",
6790
- dog_howl: "dog",
6791
- cat_meow: "cat",
6792
- cat_purr: "cat",
6793
- cat_hiss: "cat",
6794
- bird: "bird",
6795
- bird_chirp: "bird",
6796
- bird_squawk: "bird",
6797
- animal: "animal",
6798
- horse: "animal",
6799
- cow_moo: "animal",
6800
- insect: "animal",
6801
- alarm: "alarm",
6802
- smoke_alarm: "alarm",
6803
- fire_alarm: "alarm",
6804
- car_alarm: "alarm",
6805
- siren: "siren",
6806
- police_siren: "siren",
6807
- ambulance_siren: "siren",
6808
- doorbell: "doorbell",
6809
- door_knock: "doorbell",
6810
- knocking: "doorbell",
6811
- glass_breaking: "glass_breaking",
6812
- glass_shatter: "glass_breaking",
6813
- gunshot: "gunshot",
6814
- explosion: "gunshot",
6815
- fireworks: "gunshot",
6816
- car: "vehicle",
6817
- truck: "vehicle",
6818
- motorcycle: "vehicle",
6819
- car_horn: "vehicle",
6820
- vehicle_horn: "vehicle",
6821
- traffic: "vehicle",
6822
- fire: "fire",
6823
- fire_crackle: "fire",
6824
- water: "water",
6825
- rain: "water",
6826
- ocean: "water",
6827
- splash: "water",
6828
- wind: "wind",
6829
- thunder: "wind",
6830
- thunderstorm: "wind",
6831
- door: "door",
6832
- door_slam: "door",
6833
- sliding_door: "door",
6834
- footsteps: "footsteps",
6835
- walking: "footsteps",
6836
- running: "footsteps",
6837
- crowd: "crowd",
6838
- chatter: "crowd",
6839
- cheering: "crowd",
6840
- applause: "crowd",
6841
- telephone_ring: "telephone",
6842
- ringtone: "telephone",
6843
- engine: "engine",
6844
- engine_starting: "engine",
6845
- lawn_mower: "engine",
6846
- chainsaw: "engine",
6847
- hammer: "tools",
6848
- jackhammer: "tools",
6849
- drill: "tools",
6850
- power_tool: "tools",
6851
- silence: "silence"
6852
- },
6853
- preserveOriginal: false
6854
- };
6855
- var _macroLookup = /* @__PURE__ */ new Map();
6856
- for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6857
- for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6858
- var DeviceType = /* @__PURE__ */ function(DeviceType) {
6859
- DeviceType["Camera"] = "camera";
6860
- DeviceType["Hub"] = "hub";
6861
- DeviceType["Light"] = "light";
6862
- DeviceType["Siren"] = "siren";
6863
- DeviceType["Switch"] = "switch";
6864
- DeviceType["Sensor"] = "sensor";
6865
- DeviceType["Thermostat"] = "thermostat";
6866
- DeviceType["Button"] = "button";
6867
- /** Generic stateless event emitter — carries a device's EXACT declared
6868
- * event vocabulary verbatim (no normalization). Installed with the
6869
- * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6870
- * HA bus events (e.g. `zha_event`, generic). */
6871
- DeviceType["EventEmitter"] = "event-emitter";
6872
- /** Firmware/software update entity — current vs available version,
6873
- * updatable flag, update state, and an install action. Installed with
6874
- * the `update` cap. Sources: Homematic firmware-update channels (and
6875
- * reusable by other providers, e.g. HA `update.*` entities). */
6876
- DeviceType["Update"] = "update";
6877
- DeviceType["Generic"] = "generic";
6878
- /** Generic notification delivery target (HA `notify.<service>`, future
6879
- * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6880
- * endpoint; the `notifier` cap defines the send surface. */
6881
- DeviceType["Notifier"] = "notifier";
6882
- /** Pre-recorded action sequence with optional parameters
6883
- * (HA `script.*`). Runnable via `script-runner` cap. */
6884
- DeviceType["Script"] = "script";
6885
- /** Automation rule (HA `automation.*`) — enable/disable + manual
6886
- * trigger surface exposed via `automation-control` cap. */
6887
- DeviceType["Automation"] = "automation";
6888
- /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6889
- DeviceType["Lock"] = "lock";
6890
- /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6891
- * `valve.*`). `cover` cap with sub-roles for variant. */
6892
- DeviceType["Cover"] = "cover";
6893
- /** Pipe / water / gas valve with open/close/stop and optional
6894
- * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6895
- * modelled on the same open/closed lifecycle. */
6896
- DeviceType["Valve"] = "valve";
6897
- /** Humidifier / dehumidifier with on/off + target humidity + mode
6898
- * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6899
- * modelled on the same target / mode lifecycle. */
6900
- DeviceType["Humidifier"] = "humidifier";
6901
- /** Water heater / boiler with target temperature + operation mode +
6902
- * away mode (HA `water_heater.*`). `water-heater` cap — a
6903
- * climate-family actuator. */
6904
- DeviceType["WaterHeater"] = "water-heater";
6905
- /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6906
- DeviceType["Fan"] = "fan";
6907
- /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6908
- * the camera surface — those use `Camera`. `media-player` cap. */
6909
- DeviceType["MediaPlayer"] = "media-player";
6910
- /** Security panel / alarm system (HA `alarm_control_panel.*`).
6911
- * `alarm-panel` cap. */
6912
- DeviceType["AlarmPanel"] = "alarm-panel";
6913
- /** Generic user-settable input (HA `number` / `input_number` / `select`
6914
- * / `input_select` / `text` / `input_text` / `input_datetime`).
6915
- * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6916
- * TextControl / DateTimeControl. */
6917
- DeviceType["Control"] = "control";
6918
- /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6919
- * `presence` cap. */
6920
- DeviceType["Presence"] = "presence";
6921
- /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6922
- * `weather` cap. */
6923
- DeviceType["Weather"] = "weather";
6924
- /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6925
- DeviceType["Vacuum"] = "vacuum";
6926
- /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6927
- * `lawn-mower-control` cap. */
6928
- DeviceType["LawnMower"] = "lawn-mower";
6929
- /** Physical HA device group — parent container for entity-children
6930
- * adopted from a single HA device entry. Not renderable as a
6931
- * standalone device; exists only to anchor child entities. */
6932
- DeviceType["Container"] = "container";
6933
- /** Single still-image entity (HA `image.*`). Read-only display of an
6934
- * `entity_picture` signed URL the browser loads directly. `image` cap. */
6935
- DeviceType["Image"] = "image";
6936
- return DeviceType;
6937
- }({});
6938
- var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6939
- DeviceFeature["BatteryOperated"] = "battery-operated";
6940
- DeviceFeature["Rebootable"] = "rebootable";
6941
- /**
6942
- * Device supports an on-demand re-sync of its derived spec with its
6943
- * upstream source — drives the generic Re-sync button. The owning
6944
- * provider implements the action via the `device-adoption.resync` cap.
6945
- */
6946
- DeviceFeature["Resyncable"] = "resyncable";
6947
- DeviceFeature["NativeSnapshot"] = "native-snapshot";
6948
- DeviceFeature["DoorbellButton"] = "doorbell-button";
6949
- DeviceFeature["TwoWayAudio"] = "two-way-audio";
6950
- DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6951
- /**
6952
- * Camera supports the on-firmware autotrack subsystem (subject-
6953
- * following). Distinct from `PanTiltZoom` because not every PTZ
6954
- * camera ships autotrack — the admin UI uses this flag to gate
6955
- * the autotrack toggle / settings card without re-deriving from
6956
- * the cap registry. Mirrors `ptz-autotrack` cap registration:
6957
- * driver sets this feature when probe confirms the firmware
6958
- * surface, and registers the cap in the same code path.
6959
- */
6960
- DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6961
- /**
6962
- * Accessory exposes a "trigger on motion" toggle — the parent camera's
6963
- * motion detection automatically activates this device. Mirrors
6964
- * `motion-trigger` cap registration: drivers set this feature in the
6965
- * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6966
- *
6967
- * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6968
- * fast scalar without binding fetch), notifier rules, and `listAll`
6969
- * filters that want "all devices with on-motion behaviour".
6970
- */
6971
- DeviceFeature["MotionTrigger"] = "motion-trigger";
6972
- /** Light supports rgb-triplet color via `color` cap. */
6973
- DeviceFeature["LightColorRgb"] = "light-color-rgb";
6974
- /** Light supports HSV color via `color` cap. */
6975
- DeviceFeature["LightColorHsv"] = "light-color-hsv";
6976
- /** Light supports color-temperature (mired) via `color` cap. */
6977
- DeviceFeature["LightColorMired"] = "light-color-mired";
6978
- /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6979
- * targetHigh). Gates the range slider UI. */
6980
- DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6981
- /** Thermostat exposes target humidity and/or current humidity
6982
- * readings. Gates the humidity controls. */
6983
- DeviceFeature["ClimateHumidity"] = "climate-humidity";
6984
- /** Thermostat exposes a fan-mode selector. */
6985
- DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6986
- /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6987
- DeviceFeature["ClimatePreset"] = "climate-preset";
6988
- /** Cover exposes intermediate position control (0..100). Gates the
6989
- * position slider UI. */
6990
- DeviceFeature["CoverPositionable"] = "cover-positionable";
6991
- /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6992
- DeviceFeature["CoverTilt"] = "cover-tilt";
6993
- /** Valve exposes intermediate position control (0..100). Gates the
6994
- * position slider / drag surface UI. */
6995
- DeviceFeature["ValvePositionable"] = "valve-positionable";
6996
- /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6997
- DeviceFeature["FanSpeed"] = "fan-speed";
6998
- /** Fan exposes a preset mode selector. */
6999
- DeviceFeature["FanPreset"] = "fan-preset";
7000
- /** Fan exposes blade direction (forward/reverse) — typical of
7001
- * ceiling fans. */
7002
- DeviceFeature["FanDirection"] = "fan-direction";
7003
- /** Fan exposes an oscillation toggle. */
7004
- DeviceFeature["FanOscillating"] = "fan-oscillating";
7005
- /** Lock requires a PIN code on lock/unlock. Gates the code-entry
7006
- * field on the UI lock-controls panel. */
7007
- DeviceFeature["LockPinRequired"] = "lock-pin-required";
7008
- /** Lock supports a latch-release ("open door") action distinct from
7009
- * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
7010
- * `supported_features`. Gates the Open Door button in the UI. */
7011
- DeviceFeature["LockOpen"] = "lock-open";
7012
- /** Media player exposes a seek-to-position surface. */
7013
- DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
7014
- /** Media player exposes a volume-level setter. */
7015
- DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
7016
- /** Media player exposes a mute toggle distinct from volume=0. */
7017
- DeviceFeature["MediaPlayerMute"] = "media-player-mute";
7018
- /** Media player exposes a shuffle toggle. */
7019
- DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
7020
- /** Media player exposes a repeat mode (off / all / one). */
7021
- DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
7022
- /** Media player exposes a source / input selector. */
7023
- DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
7024
- /** Media player exposes a play-arbitrary-media surface (URL / id). */
7025
- DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
7026
- /** Media player exposes next-track. */
7027
- DeviceFeature["MediaPlayerNext"] = "media-player-next";
7028
- /** Media player exposes previous-track. */
7029
- DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
7030
- /** Media player exposes stop distinct from pause. */
7031
- DeviceFeature["MediaPlayerStop"] = "media-player-stop";
7032
- /** Alarm panel requires a PIN code on arm/disarm. */
7033
- DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
7034
- /** Presence device carries GPS coordinates (lat/lng/accuracy) in
7035
- * addition to a textual location. */
7036
- DeviceFeature["PresenceGps"] = "presence-gps";
7037
- /** Notifier accepts an inline / URL image attachment. */
7038
- DeviceFeature["NotifierImage"] = "notifier-image";
7039
- /** Notifier accepts a priority hint (high/normal/low). */
7040
- DeviceFeature["NotifierPriority"] = "notifier-priority";
7041
- /** Notifier accepts a free-form `data` payload for platform-specific
7042
- * fields. */
7043
- DeviceFeature["NotifierData"] = "notifier-data";
7044
- /** Notifier supports interactive action buttons / callbacks. */
7045
- DeviceFeature["NotifierActions"] = "notifier-actions";
7046
- /** Notifier supports per-call recipient targeting (multi-user). */
7047
- DeviceFeature["NotifierRecipients"] = "notifier-recipients";
7048
- /** Script runner accepts a variables map on each run invocation. */
7049
- DeviceFeature["ScriptVariables"] = "script-variables";
7050
- /** Automation `trigger` accepts a skipCondition flag — fires the
7051
- * automation's actions while bypassing its condition block. */
7052
- DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
7053
- return DeviceFeature;
7054
- }({});
7055
- /**
7056
- * Semantic role a device plays within its parent. Populated by driver
7057
- * addons when creating accessory devices (Reolink siren/floodlight/
7058
- * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
7059
- * admin UI to pick icons, labels, and widgets — a `Switch` with
7060
- * `role: Floodlight` renders as a bulb with a brightness slider,
7061
- * whereas a `Switch` with `role: Siren` renders as a klaxon.
7062
- *
7063
- * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
7064
- * sqlite as a nullable TEXT column — old rows keep working unchanged.
7065
- */
7066
- var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
7067
- DeviceRole["Siren"] = "siren";
7068
- DeviceRole["Floodlight"] = "floodlight";
7069
- DeviceRole["Spotlight"] = "spotlight";
7070
- DeviceRole["PirSensor"] = "pir-sensor";
7071
- DeviceRole["Chime"] = "chime";
7072
- DeviceRole["Autotrack"] = "autotrack";
7073
- DeviceRole["Nightvision"] = "nightvision";
7074
- DeviceRole["PrivacyMask"] = "privacy-mask";
7075
- DeviceRole["Doorbell"] = "doorbell";
7076
- /** Virtual HA toggle (input_boolean.*) — distinguishable from a
7077
- * real Switch device for UI rendering / export adapters. */
7078
- DeviceRole["BinaryHelper"] = "binary-helper";
7079
- /** Generic motion / occupancy / moving event source. Distinct from
7080
- * the camera accessory PirSensor role: that one is a camera child;
7081
- * this is a standalone HA / 3rd-party motion sensor. */
7082
- DeviceRole["MotionSensor"] = "motion-sensor";
7083
- DeviceRole["ContactSensor"] = "contact-sensor";
7084
- DeviceRole["LeakSensor"] = "leak-sensor";
7085
- DeviceRole["SmokeSensor"] = "smoke-sensor";
7086
- DeviceRole["COSensor"] = "co-sensor";
7087
- DeviceRole["GasSensor"] = "gas-sensor";
7088
- DeviceRole["TamperSensor"] = "tamper-sensor";
7089
- DeviceRole["VibrationSensor"] = "vibration-sensor";
7090
- DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
7091
- DeviceRole["SoundSensor"] = "sound-sensor";
7092
- /** Fallback for `binary_sensor` without a known `device_class`. */
7093
- DeviceRole["BinarySensor"] = "binary-sensor";
7094
- DeviceRole["TemperatureSensor"] = "temperature-sensor";
7095
- DeviceRole["HumiditySensor"] = "humidity-sensor";
7096
- DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
7097
- DeviceRole["PressureSensor"] = "pressure-sensor";
7098
- DeviceRole["PowerSensor"] = "power-sensor";
7099
- DeviceRole["EnergySensor"] = "energy-sensor";
7100
- DeviceRole["VoltageSensor"] = "voltage-sensor";
7101
- DeviceRole["CurrentSensor"] = "current-sensor";
7102
- DeviceRole["AirQualitySensor"] = "air-quality-sensor";
7103
- /** Battery level (numeric % via `sensor` OR low-bool via
7104
- * `binary_sensor` — the cap distinguishes via the value type). */
7105
- DeviceRole["BatterySensor"] = "battery-sensor";
7106
- /** Fallback for `sensor` numeric without a known `device_class`. */
7107
- DeviceRole["NumericSensor"] = "numeric-sensor";
7108
- /** String / enum state (HA `sensor` with `state_class: enum` or
7109
- * `attributes.options`). */
7110
- DeviceRole["EnumSensor"] = "enum-sensor";
7111
- /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
7112
- * or `date`). The slice carries the raw ISO string verbatim (hosted on
7113
- * the `enum-sensor` cap); the UI renders it locale-formatted. */
7114
- DeviceRole["DateTimeSensor"] = "datetime-sensor";
7115
- /** Last-resort fallback when nothing else matches. */
7116
- DeviceRole["GenericSensor"] = "generic-sensor";
7117
- DeviceRole["NumericControl"] = "numeric-control";
7118
- DeviceRole["SelectControl"] = "select-control";
7119
- DeviceRole["TextControl"] = "text-control";
7120
- DeviceRole["DateTimeControl"] = "datetime-control";
7121
- /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
7122
- * rich features (image, priority, channel routing). */
7123
- DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
7124
- /** Chat / messaging service (HA `notify.telegram_*`,
7125
- * `notify.discord_*`, etc.). */
7126
- DeviceRole["MessagingNotifier"] = "messaging-notifier";
7127
- /** Email-based delivery (HA `notify.smtp`, etc.). */
7128
- DeviceRole["EmailNotifier"] = "email-notifier";
7129
- /** Fallback when the notifier service name doesn't match a known
7130
- * pattern. */
7131
- DeviceRole["GenericNotifier"] = "generic-notifier";
7132
- return DeviceRole;
7133
- }({});
7152
+ Ringtone: "telephone",
7153
+ "Telephone dialing, DTMF": "telephone",
7154
+ "Busy signal": "telephone",
7155
+ Engine: "engine",
7156
+ "Engine starting": "engine",
7157
+ Idling: "engine",
7158
+ "Accelerating, revving, vroom": "engine",
7159
+ "Light engine (high frequency)": "engine",
7160
+ "Medium engine (mid frequency)": "engine",
7161
+ "Heavy engine (low frequency)": "engine",
7162
+ "Lawn mower": "engine",
7163
+ Chainsaw: "engine",
7164
+ Hammer: "tools",
7165
+ Jackhammer: "tools",
7166
+ Sawing: "tools",
7167
+ "Power tool": "tools",
7168
+ Drill: "tools",
7169
+ Sanding: "tools",
7170
+ Silence: "silence"
7171
+ },
7172
+ preserveOriginal: false
7173
+ };
7174
+ var APPLE_SA_TO_MACRO = {
7175
+ mapping: {
7176
+ speech: "speech",
7177
+ child_speech: "speech",
7178
+ conversation: "speech",
7179
+ whispering: "speech",
7180
+ singing: "speech",
7181
+ humming: "speech",
7182
+ shout: "scream",
7183
+ yell: "scream",
7184
+ screaming: "scream",
7185
+ crying: "crying",
7186
+ baby_crying: "crying",
7187
+ sobbing: "crying",
7188
+ laughter: "laughter",
7189
+ baby_laughter: "laughter",
7190
+ giggling: "laughter",
7191
+ music: "music",
7192
+ guitar: "music",
7193
+ piano: "music",
7194
+ drums: "music",
7195
+ dog_bark: "dog",
7196
+ dog_bow_wow: "dog",
7197
+ dog_growling: "dog",
7198
+ dog_howl: "dog",
7199
+ cat_meow: "cat",
7200
+ cat_purr: "cat",
7201
+ cat_hiss: "cat",
7202
+ bird: "bird",
7203
+ bird_chirp: "bird",
7204
+ bird_squawk: "bird",
7205
+ animal: "animal",
7206
+ horse: "animal",
7207
+ cow_moo: "animal",
7208
+ insect: "animal",
7209
+ alarm: "alarm",
7210
+ smoke_alarm: "alarm",
7211
+ fire_alarm: "alarm",
7212
+ car_alarm: "alarm",
7213
+ siren: "siren",
7214
+ police_siren: "siren",
7215
+ ambulance_siren: "siren",
7216
+ doorbell: "doorbell",
7217
+ door_knock: "doorbell",
7218
+ knocking: "doorbell",
7219
+ glass_breaking: "glass_breaking",
7220
+ glass_shatter: "glass_breaking",
7221
+ gunshot: "gunshot",
7222
+ explosion: "gunshot",
7223
+ fireworks: "gunshot",
7224
+ car: "vehicle",
7225
+ truck: "vehicle",
7226
+ motorcycle: "vehicle",
7227
+ car_horn: "vehicle",
7228
+ vehicle_horn: "vehicle",
7229
+ traffic: "vehicle",
7230
+ fire: "fire",
7231
+ fire_crackle: "fire",
7232
+ water: "water",
7233
+ rain: "water",
7234
+ ocean: "water",
7235
+ splash: "water",
7236
+ wind: "wind",
7237
+ thunder: "wind",
7238
+ thunderstorm: "wind",
7239
+ door: "door",
7240
+ door_slam: "door",
7241
+ sliding_door: "door",
7242
+ footsteps: "footsteps",
7243
+ walking: "footsteps",
7244
+ running: "footsteps",
7245
+ crowd: "crowd",
7246
+ chatter: "crowd",
7247
+ cheering: "crowd",
7248
+ applause: "crowd",
7249
+ telephone_ring: "telephone",
7250
+ ringtone: "telephone",
7251
+ engine: "engine",
7252
+ engine_starting: "engine",
7253
+ lawn_mower: "engine",
7254
+ chainsaw: "engine",
7255
+ hammer: "tools",
7256
+ jackhammer: "tools",
7257
+ drill: "tools",
7258
+ power_tool: "tools",
7259
+ silence: "silence"
7260
+ },
7261
+ preserveOriginal: false
7262
+ };
7263
+ var _macroLookup = /* @__PURE__ */ new Map();
7264
+ for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7265
+ for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7134
7266
  /**
7135
7267
  * Accessory device helpers — shared across drivers.
7136
7268
  *
@@ -7394,74 +7526,6 @@ object({
7394
7526
  });
7395
7527
  DeviceType.Sensor;
7396
7528
  /**
7397
- * Generic types for capability definitions.
7398
- *
7399
- * A capability is defined with Zod schemas for methods, events, and settings.
7400
- * TypeScript types are inferred via z.infer<> — zero duplication.
7401
- *
7402
- * Pattern:
7403
- * 1. Define Zod schemas for data, methods, settings
7404
- * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
7405
- * 3. Export type IProvider = InferProvider<typeof capabilityDef>
7406
- * 4. Addon implements IProvider
7407
- * 5. Registry auto-mounts tRPC router from definition.methods
7408
- */
7409
- /**
7410
- * Output schema shared by the contribution + live methods.
7411
- *
7412
- * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
7413
- * tabs[]) without importing from `../interfaces/config-ui.js` — a
7414
- * concrete-but-lenient Zod object keeps tRPC output inference happy
7415
- * (using `z.unknown()` here collapses unrelated router branches to
7416
- * `unknown` when the generator re-inlines the huge AppRouter type).
7417
- *
7418
- * `.passthrough()` on sections/fields accepts whatever FormBuilder
7419
- * extensions the caller adds (showWhen, displayScale, …) without
7420
- * rebuilding every time a new field kind is introduced.
7421
- */
7422
- var ContributionSectionSchema = object({
7423
- id: string(),
7424
- title: string(),
7425
- description: string().optional(),
7426
- style: _enum(["card", "accordion"]).optional(),
7427
- defaultCollapsed: boolean().optional(),
7428
- columns: union([
7429
- literal(1),
7430
- literal(2),
7431
- literal(3),
7432
- literal(4)
7433
- ]).optional(),
7434
- tab: string().optional(),
7435
- location: _enum(["settings", "top-tab"]).optional(),
7436
- order: number().optional(),
7437
- fields: array(any())
7438
- });
7439
- object({
7440
- tabs: array(object({
7441
- id: string(),
7442
- label: string(),
7443
- icon: string(),
7444
- order: number().optional()
7445
- })).optional(),
7446
- sections: array(ContributionSectionSchema)
7447
- }).nullable();
7448
- object({ deviceId: number() }), object({ deviceId: number() }), object({
7449
- deviceId: number(),
7450
- patch: record(string(), unknown())
7451
- }), object({ success: literal(true) });
7452
- object({ deviceId: number() }), unknown().nullable();
7453
- /** Shorthand to define a method schema */
7454
- function method(input, output, options) {
7455
- return {
7456
- input,
7457
- output,
7458
- kind: options?.kind ?? "query",
7459
- auth: options?.auth ?? "protected",
7460
- ...options?.access !== void 0 ? { access: options.access } : {},
7461
- timeoutMs: options?.timeoutMs
7462
- };
7463
- }
7464
- /**
7465
7529
  * Alarm-panel cap. Models HA `alarm_control_panel.*` on
7466
7530
  * `DeviceType.AlarmPanel`. State follows HA's canonical lifecycle
7467
7531
  * across disarmed / armed_(home|away|night|vacation|custom_bypass) /
@@ -11723,9 +11787,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
11723
11787
  limit: number().optional(),
11724
11788
  tags: record(string(), string()).optional()
11725
11789
  }), array(LogEntrySchema).readonly());
11726
- var StaticDirOutputSchema = object({ staticDir: string() });
11727
- var VersionOutputSchema = object({ version: string() });
11728
- method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
11729
11790
  /**
11730
11791
  * Zod schemas for persisted record types.
11731
11792
  *
@@ -14026,7 +14087,7 @@ method(object({
14026
14087
  }), _void(), {
14027
14088
  kind: "mutation",
14028
14089
  auth: "admin"
14029
- }), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
14090
+ }), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
14030
14091
  deviceId: number(),
14031
14092
  values: record(string(), unknown())
14032
14093
  }), object({ success: literal(true) }), {
@@ -14751,7 +14812,20 @@ var DiskSpaceInfoSchema = object({
14751
14812
  var PidResourceStatsSchema = object({
14752
14813
  pid: number(),
14753
14814
  cpu: number(),
14754
- memory: number()
14815
+ memory: number(),
14816
+ /**
14817
+ * Private (anonymous) resident bytes — the per-process V8 heap + native
14818
+ * allocations NOT shared with other processes (Linux RssAnon). This is the
14819
+ * "real" per-runner cost; summing it across runners is meaningful, unlike
14820
+ * `memory` (RSS), which double-counts the shared mmap'd framework code.
14821
+ * Undefined where /proc is unavailable (e.g. macOS).
14822
+ */
14823
+ privateBytes: number().optional(),
14824
+ /**
14825
+ * Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
14826
+ * code shared copy-on-write across runners. Undefined on macOS.
14827
+ */
14828
+ sharedBytes: number().optional()
14755
14829
  });
14756
14830
  var AddonInstanceSchema = object({
14757
14831
  addonId: string(),
@@ -14800,6 +14874,17 @@ var KillProcessResultSchema = object({
14800
14874
  reason: string().optional(),
14801
14875
  signal: _enum(["SIGTERM", "SIGKILL"]).optional()
14802
14876
  });
14877
+ var DumpHeapSnapshotInputSchema = object({
14878
+ /** The addon whose runner should dump a heap snapshot. */
14879
+ addonId: string() });
14880
+ var DumpHeapSnapshotResultSchema = object({
14881
+ success: boolean(),
14882
+ /** Path of the written .heapsnapshot inside the runner's container/host. */
14883
+ path: string().optional(),
14884
+ /** Process pid that was signalled. */
14885
+ pid: number().optional(),
14886
+ reason: string().optional()
14887
+ });
14803
14888
  var SystemMetricsSchema = object({
14804
14889
  cpuPercent: number(),
14805
14890
  memoryPercent: number(),
@@ -14813,6 +14898,9 @@ var SystemMetricsSchema = object({
14813
14898
  method(_void(), SystemResourceSnapshotSchema), method(_void(), SystemResourceSnapshotSchema.nullable()), method(_void(), SystemMetricsSchema), method(object({ dirPath: string() }), DiskSpaceInfoSchema), method(_void(), MetricsGpuInfoSchema.nullable()), method(_void(), number().nullable()), method(object({ pids: array(number()) }), array(PidResourceStatsSchema)), method(_void(), array(AddonInstanceSchema).readonly()), method(object({ addonId: string() }), PidResourceStatsSchema.nullable()), method(_void(), array(NodeProcessSchema).readonly()), method(KillProcessInputSchema, KillProcessResultSchema, {
14814
14899
  kind: "mutation",
14815
14900
  auth: "admin"
14901
+ }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
14902
+ kind: "mutation",
14903
+ auth: "admin"
14816
14904
  });
14817
14905
  var PtzPresetSchema = object({
14818
14906
  id: string(),
@@ -15221,63 +15309,6 @@ method(object({
15221
15309
  auth: "admin"
15222
15310
  });
15223
15311
  /**
15224
- * device-ops — device-scoped cap that unifies the per-IDevice operations
15225
- * previously routed through the `.device-ops` Moleculer bridge service.
15226
- *
15227
- * Each worker that hosts live `IDevice` instances auto-registers a native
15228
- * provider for this cap (per device) backed by its local
15229
- * `DeviceRegistry`. Hub-side callers reach it transparently through
15230
- * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
15231
- * `deviceId` + `nodeId` and dispatches through the standard cap-router,
15232
- * so there's no parallel bridge path anymore.
15233
- *
15234
- * The surface is intentionally small — every method corresponds to a
15235
- * single action on the live `IDevice` (or `ICameraDevice` for
15236
- * `getStreamSources`). Richer orchestration (enable/disable with
15237
- * integration plumbing, bulk updates) stays in the `device-manager` cap;
15238
- * `device-ops` is the per-device primitive the device-manager routes to.
15239
- */
15240
- var StreamSourceEntrySchema$1 = object({
15241
- id: string(),
15242
- label: string(),
15243
- protocol: _enum([
15244
- "rtsp",
15245
- "rtmp",
15246
- "annexb",
15247
- "http-mjpeg",
15248
- "webrtc",
15249
- "custom"
15250
- ]),
15251
- url: string().optional(),
15252
- resolution: object({
15253
- width: number(),
15254
- height: number()
15255
- }).optional(),
15256
- fps: number().optional(),
15257
- bitrate: number().optional(),
15258
- codec: string().optional(),
15259
- profileHint: CamProfileSchema.optional(),
15260
- sdp: string().optional()
15261
- });
15262
- var ConfigEntrySchema$1 = object({
15263
- key: string(),
15264
- value: unknown()
15265
- });
15266
- var RawStateResultSchema = object({
15267
- /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
15268
- source: string(),
15269
- /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
15270
- data: record(string(), unknown())
15271
- });
15272
- method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
15273
- deviceId: number(),
15274
- values: record(string(), unknown())
15275
- }), _void(), { kind: "mutation" }), method(object({
15276
- deviceId: number(),
15277
- action: string().min(1),
15278
- input: unknown()
15279
- }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
15280
- /**
15281
15312
  * camera-credentials — device-scoped cap exposing the camera's network
15282
15313
  * + auth surface in a vendor-neutral shape.
15283
15314
  *
@@ -18960,6 +18991,12 @@ Object.freeze({
18960
18991
  addonId: null,
18961
18992
  access: "view"
18962
18993
  },
18994
+ "metricsProvider.dumpHeapSnapshot": {
18995
+ capName: "metrics-provider",
18996
+ capScope: "system",
18997
+ addonId: null,
18998
+ access: "create"
18999
+ },
18963
19000
  "metricsProvider.getAddonStats": {
18964
19001
  capName: "metrics-provider",
18965
19002
  capScope: "system",