@camstack/addon-advanced-notifier 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 +715 -680
  2. package/dist/addon.mjs +715 -680
  3. package/package.json +1 -1
package/dist/addon.js 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,583 @@ 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/index.mjs
6586
+ /**
6587
+ * Deep wiring healthcheck — snapshot of active reachability probes across
6588
+ * every declared capability + widget of every installed plugin, on every
6589
+ * node. Produced by the backend `WiringHealthService` and surfaced via
6590
+ * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
6591
+ *
6592
+ * Unlike `/health` (process liveness), this reflects whether each cap/widget
6593
+ * is actually *reachable* over the real cap-dispatch path. See spec
6594
+ * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
6595
+ */
6596
+ /** What kind of target a probe addressed. */
6597
+ var wiringProbeKindSchema = _enum([
6598
+ "singleton",
6599
+ "device",
6600
+ "widget"
6601
+ ]);
6602
+ /** Result of probing a single (cap|widget [, device]) target. */
6603
+ var wiringProbeResultSchema = object({
6604
+ capName: string(),
6605
+ kind: wiringProbeKindSchema,
6606
+ deviceId: number().optional(),
6607
+ reachable: boolean(),
6608
+ latencyMs: number(),
6609
+ error: string().optional()
6610
+ });
6611
+ /** Per-addon roll-up of cap + widget probe results. */
6612
+ var wiringAddonHealthSchema = object({
6613
+ addonId: string(),
6614
+ caps: array(wiringProbeResultSchema).readonly(),
6615
+ widgets: array(wiringProbeResultSchema).readonly()
6616
+ });
6617
+ /** Per-node roll-up. */
6618
+ var wiringNodeHealthSchema = object({
6619
+ nodeId: string(),
6620
+ addons: array(wiringAddonHealthSchema).readonly()
6621
+ });
6622
+ object({
6623
+ /** True only when every probed target is reachable. */
6624
+ ok: boolean(),
6625
+ /** True when at least one target is unreachable. */
6626
+ degraded: boolean(),
6627
+ checkedAt: string(),
6628
+ nodes: array(wiringNodeHealthSchema).readonly(),
6629
+ summary: object({
6630
+ total: number(),
6631
+ reachable: number(),
6632
+ unreachable: number()
6633
+ })
6634
+ });
6635
+ var MODEL_FORMATS = [
6636
+ "onnx",
6637
+ "coreml",
6638
+ "openvino",
6639
+ "tflite",
6640
+ "pt"
6641
+ ];
6642
+ /**
6643
+ * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6644
+ * Named `RecordingWeekday` to avoid collision with the string-union
6645
+ * `Weekday` exported from `interfaces/timezones.ts`.
6646
+ */
6647
+ var RecordingWeekdaySchema = number().int().min(0).max(6);
6648
+ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6649
+ var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6650
+ kind: literal("timeOfDay"),
6651
+ start: string().regex(HHMM),
6652
+ end: string().regex(HHMM),
6653
+ /** Restrict to these weekdays; omit = every day. */
6654
+ days: array(RecordingWeekdaySchema).optional()
6655
+ })]);
6656
+ var RecordingModeSchema = _enum([
6657
+ "continuous",
6658
+ "onMotion",
6659
+ "onAudioThreshold"
6660
+ ]);
6661
+ /**
6662
+ * First-class, authoritative per-camera storage mode — the netta choice the UI
6663
+ * reads directly (never inferred from `rules`):
6664
+ * - `off` — not recording.
6665
+ * - `events` — record only around triggers (motion / audio threshold),
6666
+ * with pre/post-buffer.
6667
+ * - `continuous` — record 24/7 within the schedule.
6668
+ *
6669
+ * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6670
+ * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6671
+ */
6672
+ var RecordingStorageModeSchema = _enum([
6673
+ "off",
6674
+ "events",
6675
+ "continuous"
6676
+ ]);
6677
+ /** Which detectors trigger an `events`-mode recording. */
6678
+ var RecordingTriggersSchema = object({
6679
+ motion: boolean().optional(),
6680
+ audioThresholdDbfs: number().optional()
6681
+ });
6682
+ /**
6683
+ * Mode of a single recording band — the recorder per-band vocabulary.
6684
+ *
6685
+ * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6686
+ * only ever `continuous` or `events`; "off" is expressed by the absence of a
6687
+ * covering band, not by a band value.
6688
+ */
6689
+ var RecordingBandModeSchema = _enum(["continuous", "events"]);
6690
+ /**
6691
+ * Triggers for an `events`-mode band. Identical shape to
6692
+ * `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
6693
+ * two never drift.
6694
+ */
6695
+ var RecordingBandTriggersSchema = RecordingTriggersSchema;
6696
+ /**
6697
+ * A single mode-per-band window — the canonical recorder band shape, the
6698
+ * single source of truth re-used by `addon-pipeline/recorder`.
6699
+ *
6700
+ * `days` lists the weekdays the band covers (empty = every day, matching the
6701
+ * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6702
+ * span wraps past midnight (handled by the band engine).
6703
+ */
6704
+ var RecordingBandSchema = object({
6705
+ days: array(RecordingWeekdaySchema),
6706
+ start: string().regex(HHMM),
6707
+ end: string().regex(HHMM),
6708
+ mode: RecordingBandModeSchema,
6709
+ triggers: RecordingBandTriggersSchema.optional(),
6710
+ preBufferSec: number().min(0).optional(),
6711
+ postBufferSec: number().min(0).optional()
6712
+ });
6713
+ var RecordingRuleSchema = object({
6714
+ schedule: RecordingScheduleSchema,
6715
+ mode: RecordingModeSchema,
6716
+ /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6717
+ preBufferSec: number().min(0).default(0),
6718
+ /** Keep recording until this many seconds after the last trigger. */
6719
+ postBufferSec: number().min(0).default(0),
6720
+ /** Each new trigger restarts the post-buffer window. */
6721
+ resetTimeoutOnNewEvent: boolean().default(true),
6722
+ /** onAudioThreshold only — dBFS level that counts as a trigger. */
6723
+ thresholdDbfs: number().optional()
6724
+ });
6725
+ /**
6726
+ * Per-device retention overrides. Every field is optional; an unset or `0`
6727
+ * value inherits the node-wide recorder default. Only footage-lifetime limits
6728
+ * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6729
+ * (when the volume is too full to keep recording) is NOT a per-camera concern —
6730
+ * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6731
+ * shared by every camera writing to that volume.
6732
+ */
6733
+ var RecordingRetentionSchema = object({
6734
+ maxAgeDays: number().min(0).optional(),
6735
+ maxSizeGb: number().min(0).optional()
6736
+ });
6737
+ /**
6738
+ * The full per-camera recording intent — the wire shape of a RecordingTarget.
6739
+ *
6740
+ * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6741
+ * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6742
+ * only for transition + migration (`migrateRulesToMode`); the policy engine
6743
+ * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6744
+ */
6745
+ var RecordingConfigSchema = object({
6746
+ enabled: boolean(),
6747
+ /** Authoritative storage mode. Absent on legacy targets → derived once via
6748
+ * `migrateRulesToMode`, then persisted. */
6749
+ mode: RecordingStorageModeSchema.optional(),
6750
+ profiles: array(CamProfileSchema).optional(),
6751
+ segmentSeconds: number().int().positive().optional(),
6752
+ /** Shared recording time-bands for `events` & `continuous` — record only when
6753
+ * the wall-clock falls inside one of these windows. Omit or empty = always.
6754
+ * `continuous` compiles to one rule per band; `events` to band × trigger. */
6755
+ schedules: array(RecordingScheduleSchema).optional(),
6756
+ /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
6351
6757
  * normalized into `schedules` on read and never written going forward. (Not
6352
6758
  * tagged `@deprecated`: the normalization paths must read it cast-free.) */
6353
6759
  schedule: RecordingScheduleSchema.optional(),
@@ -6731,396 +7137,120 @@ var YAMNET_TO_MACRO = {
6731
7137
  "Hubbub, speech noise, speech babble": "crowd",
6732
7138
  Telephone: "telephone",
6733
7139
  "Telephone bell ringing": "telephone",
6734
- Ringtone: "telephone",
6735
- "Telephone dialing, DTMF": "telephone",
6736
- "Busy signal": "telephone",
6737
- Engine: "engine",
6738
- "Engine starting": "engine",
6739
- Idling: "engine",
6740
- "Accelerating, revving, vroom": "engine",
6741
- "Light engine (high frequency)": "engine",
6742
- "Medium engine (mid frequency)": "engine",
6743
- "Heavy engine (low frequency)": "engine",
6744
- "Lawn mower": "engine",
6745
- Chainsaw: "engine",
6746
- Hammer: "tools",
6747
- Jackhammer: "tools",
6748
- Sawing: "tools",
6749
- "Power tool": "tools",
6750
- Drill: "tools",
6751
- Sanding: "tools",
6752
- Silence: "silence"
6753
- },
6754
- preserveOriginal: false
6755
- };
6756
- var APPLE_SA_TO_MACRO = {
6757
- mapping: {
6758
- speech: "speech",
6759
- child_speech: "speech",
6760
- conversation: "speech",
6761
- whispering: "speech",
6762
- singing: "speech",
6763
- humming: "speech",
6764
- shout: "scream",
6765
- yell: "scream",
6766
- screaming: "scream",
6767
- crying: "crying",
6768
- baby_crying: "crying",
6769
- sobbing: "crying",
6770
- laughter: "laughter",
6771
- baby_laughter: "laughter",
6772
- giggling: "laughter",
6773
- music: "music",
6774
- guitar: "music",
6775
- piano: "music",
6776
- drums: "music",
6777
- dog_bark: "dog",
6778
- dog_bow_wow: "dog",
6779
- dog_growling: "dog",
6780
- dog_howl: "dog",
6781
- cat_meow: "cat",
6782
- cat_purr: "cat",
6783
- cat_hiss: "cat",
6784
- bird: "bird",
6785
- bird_chirp: "bird",
6786
- bird_squawk: "bird",
6787
- animal: "animal",
6788
- horse: "animal",
6789
- cow_moo: "animal",
6790
- insect: "animal",
6791
- alarm: "alarm",
6792
- smoke_alarm: "alarm",
6793
- fire_alarm: "alarm",
6794
- car_alarm: "alarm",
6795
- siren: "siren",
6796
- police_siren: "siren",
6797
- ambulance_siren: "siren",
6798
- doorbell: "doorbell",
6799
- door_knock: "doorbell",
6800
- knocking: "doorbell",
6801
- glass_breaking: "glass_breaking",
6802
- glass_shatter: "glass_breaking",
6803
- gunshot: "gunshot",
6804
- explosion: "gunshot",
6805
- fireworks: "gunshot",
6806
- car: "vehicle",
6807
- truck: "vehicle",
6808
- motorcycle: "vehicle",
6809
- car_horn: "vehicle",
6810
- vehicle_horn: "vehicle",
6811
- traffic: "vehicle",
6812
- fire: "fire",
6813
- fire_crackle: "fire",
6814
- water: "water",
6815
- rain: "water",
6816
- ocean: "water",
6817
- splash: "water",
6818
- wind: "wind",
6819
- thunder: "wind",
6820
- thunderstorm: "wind",
6821
- door: "door",
6822
- door_slam: "door",
6823
- sliding_door: "door",
6824
- footsteps: "footsteps",
6825
- walking: "footsteps",
6826
- running: "footsteps",
6827
- crowd: "crowd",
6828
- chatter: "crowd",
6829
- cheering: "crowd",
6830
- applause: "crowd",
6831
- telephone_ring: "telephone",
6832
- ringtone: "telephone",
6833
- engine: "engine",
6834
- engine_starting: "engine",
6835
- lawn_mower: "engine",
6836
- chainsaw: "engine",
6837
- hammer: "tools",
6838
- jackhammer: "tools",
6839
- drill: "tools",
6840
- power_tool: "tools",
6841
- silence: "silence"
6842
- },
6843
- preserveOriginal: false
6844
- };
6845
- var _macroLookup = /* @__PURE__ */ new Map();
6846
- for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6847
- for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6848
- var DeviceType = /* @__PURE__ */ function(DeviceType) {
6849
- DeviceType["Camera"] = "camera";
6850
- DeviceType["Hub"] = "hub";
6851
- DeviceType["Light"] = "light";
6852
- DeviceType["Siren"] = "siren";
6853
- DeviceType["Switch"] = "switch";
6854
- DeviceType["Sensor"] = "sensor";
6855
- DeviceType["Thermostat"] = "thermostat";
6856
- DeviceType["Button"] = "button";
6857
- /** Generic stateless event emitter — carries a device's EXACT declared
6858
- * event vocabulary verbatim (no normalization). Installed with the
6859
- * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6860
- * HA bus events (e.g. `zha_event`, generic). */
6861
- DeviceType["EventEmitter"] = "event-emitter";
6862
- /** Firmware/software update entity — current vs available version,
6863
- * updatable flag, update state, and an install action. Installed with
6864
- * the `update` cap. Sources: Homematic firmware-update channels (and
6865
- * reusable by other providers, e.g. HA `update.*` entities). */
6866
- DeviceType["Update"] = "update";
6867
- DeviceType["Generic"] = "generic";
6868
- /** Generic notification delivery target (HA `notify.<service>`, future
6869
- * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6870
- * endpoint; the `notifier` cap defines the send surface. */
6871
- DeviceType["Notifier"] = "notifier";
6872
- /** Pre-recorded action sequence with optional parameters
6873
- * (HA `script.*`). Runnable via `script-runner` cap. */
6874
- DeviceType["Script"] = "script";
6875
- /** Automation rule (HA `automation.*`) — enable/disable + manual
6876
- * trigger surface exposed via `automation-control` cap. */
6877
- DeviceType["Automation"] = "automation";
6878
- /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6879
- DeviceType["Lock"] = "lock";
6880
- /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6881
- * `valve.*`). `cover` cap with sub-roles for variant. */
6882
- DeviceType["Cover"] = "cover";
6883
- /** Pipe / water / gas valve with open/close/stop and optional
6884
- * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6885
- * modelled on the same open/closed lifecycle. */
6886
- DeviceType["Valve"] = "valve";
6887
- /** Humidifier / dehumidifier with on/off + target humidity + mode
6888
- * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6889
- * modelled on the same target / mode lifecycle. */
6890
- DeviceType["Humidifier"] = "humidifier";
6891
- /** Water heater / boiler with target temperature + operation mode +
6892
- * away mode (HA `water_heater.*`). `water-heater` cap — a
6893
- * climate-family actuator. */
6894
- DeviceType["WaterHeater"] = "water-heater";
6895
- /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6896
- DeviceType["Fan"] = "fan";
6897
- /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6898
- * the camera surface — those use `Camera`. `media-player` cap. */
6899
- DeviceType["MediaPlayer"] = "media-player";
6900
- /** Security panel / alarm system (HA `alarm_control_panel.*`).
6901
- * `alarm-panel` cap. */
6902
- DeviceType["AlarmPanel"] = "alarm-panel";
6903
- /** Generic user-settable input (HA `number` / `input_number` / `select`
6904
- * / `input_select` / `text` / `input_text` / `input_datetime`).
6905
- * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6906
- * TextControl / DateTimeControl. */
6907
- DeviceType["Control"] = "control";
6908
- /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6909
- * `presence` cap. */
6910
- DeviceType["Presence"] = "presence";
6911
- /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6912
- * `weather` cap. */
6913
- DeviceType["Weather"] = "weather";
6914
- /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6915
- DeviceType["Vacuum"] = "vacuum";
6916
- /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6917
- * `lawn-mower-control` cap. */
6918
- DeviceType["LawnMower"] = "lawn-mower";
6919
- /** Physical HA device group — parent container for entity-children
6920
- * adopted from a single HA device entry. Not renderable as a
6921
- * standalone device; exists only to anchor child entities. */
6922
- DeviceType["Container"] = "container";
6923
- /** Single still-image entity (HA `image.*`). Read-only display of an
6924
- * `entity_picture` signed URL the browser loads directly. `image` cap. */
6925
- DeviceType["Image"] = "image";
6926
- return DeviceType;
6927
- }({});
6928
- var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6929
- DeviceFeature["BatteryOperated"] = "battery-operated";
6930
- DeviceFeature["Rebootable"] = "rebootable";
6931
- /**
6932
- * Device supports an on-demand re-sync of its derived spec with its
6933
- * upstream source — drives the generic Re-sync button. The owning
6934
- * provider implements the action via the `device-adoption.resync` cap.
6935
- */
6936
- DeviceFeature["Resyncable"] = "resyncable";
6937
- DeviceFeature["NativeSnapshot"] = "native-snapshot";
6938
- DeviceFeature["DoorbellButton"] = "doorbell-button";
6939
- DeviceFeature["TwoWayAudio"] = "two-way-audio";
6940
- DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6941
- /**
6942
- * Camera supports the on-firmware autotrack subsystem (subject-
6943
- * following). Distinct from `PanTiltZoom` because not every PTZ
6944
- * camera ships autotrack — the admin UI uses this flag to gate
6945
- * the autotrack toggle / settings card without re-deriving from
6946
- * the cap registry. Mirrors `ptz-autotrack` cap registration:
6947
- * driver sets this feature when probe confirms the firmware
6948
- * surface, and registers the cap in the same code path.
6949
- */
6950
- DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6951
- /**
6952
- * Accessory exposes a "trigger on motion" toggle — the parent camera's
6953
- * motion detection automatically activates this device. Mirrors
6954
- * `motion-trigger` cap registration: drivers set this feature in the
6955
- * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6956
- *
6957
- * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6958
- * fast scalar without binding fetch), notifier rules, and `listAll`
6959
- * filters that want "all devices with on-motion behaviour".
6960
- */
6961
- DeviceFeature["MotionTrigger"] = "motion-trigger";
6962
- /** Light supports rgb-triplet color via `color` cap. */
6963
- DeviceFeature["LightColorRgb"] = "light-color-rgb";
6964
- /** Light supports HSV color via `color` cap. */
6965
- DeviceFeature["LightColorHsv"] = "light-color-hsv";
6966
- /** Light supports color-temperature (mired) via `color` cap. */
6967
- DeviceFeature["LightColorMired"] = "light-color-mired";
6968
- /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6969
- * targetHigh). Gates the range slider UI. */
6970
- DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6971
- /** Thermostat exposes target humidity and/or current humidity
6972
- * readings. Gates the humidity controls. */
6973
- DeviceFeature["ClimateHumidity"] = "climate-humidity";
6974
- /** Thermostat exposes a fan-mode selector. */
6975
- DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6976
- /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6977
- DeviceFeature["ClimatePreset"] = "climate-preset";
6978
- /** Cover exposes intermediate position control (0..100). Gates the
6979
- * position slider UI. */
6980
- DeviceFeature["CoverPositionable"] = "cover-positionable";
6981
- /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6982
- DeviceFeature["CoverTilt"] = "cover-tilt";
6983
- /** Valve exposes intermediate position control (0..100). Gates the
6984
- * position slider / drag surface UI. */
6985
- DeviceFeature["ValvePositionable"] = "valve-positionable";
6986
- /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6987
- DeviceFeature["FanSpeed"] = "fan-speed";
6988
- /** Fan exposes a preset mode selector. */
6989
- DeviceFeature["FanPreset"] = "fan-preset";
6990
- /** Fan exposes blade direction (forward/reverse) — typical of
6991
- * ceiling fans. */
6992
- DeviceFeature["FanDirection"] = "fan-direction";
6993
- /** Fan exposes an oscillation toggle. */
6994
- DeviceFeature["FanOscillating"] = "fan-oscillating";
6995
- /** Lock requires a PIN code on lock/unlock. Gates the code-entry
6996
- * field on the UI lock-controls panel. */
6997
- DeviceFeature["LockPinRequired"] = "lock-pin-required";
6998
- /** Lock supports a latch-release ("open door") action distinct from
6999
- * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
7000
- * `supported_features`. Gates the Open Door button in the UI. */
7001
- DeviceFeature["LockOpen"] = "lock-open";
7002
- /** Media player exposes a seek-to-position surface. */
7003
- DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
7004
- /** Media player exposes a volume-level setter. */
7005
- DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
7006
- /** Media player exposes a mute toggle distinct from volume=0. */
7007
- DeviceFeature["MediaPlayerMute"] = "media-player-mute";
7008
- /** Media player exposes a shuffle toggle. */
7009
- DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
7010
- /** Media player exposes a repeat mode (off / all / one). */
7011
- DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
7012
- /** Media player exposes a source / input selector. */
7013
- DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
7014
- /** Media player exposes a play-arbitrary-media surface (URL / id). */
7015
- DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
7016
- /** Media player exposes next-track. */
7017
- DeviceFeature["MediaPlayerNext"] = "media-player-next";
7018
- /** Media player exposes previous-track. */
7019
- DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
7020
- /** Media player exposes stop distinct from pause. */
7021
- DeviceFeature["MediaPlayerStop"] = "media-player-stop";
7022
- /** Alarm panel requires a PIN code on arm/disarm. */
7023
- DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
7024
- /** Presence device carries GPS coordinates (lat/lng/accuracy) in
7025
- * addition to a textual location. */
7026
- DeviceFeature["PresenceGps"] = "presence-gps";
7027
- /** Notifier accepts an inline / URL image attachment. */
7028
- DeviceFeature["NotifierImage"] = "notifier-image";
7029
- /** Notifier accepts a priority hint (high/normal/low). */
7030
- DeviceFeature["NotifierPriority"] = "notifier-priority";
7031
- /** Notifier accepts a free-form `data` payload for platform-specific
7032
- * fields. */
7033
- DeviceFeature["NotifierData"] = "notifier-data";
7034
- /** Notifier supports interactive action buttons / callbacks. */
7035
- DeviceFeature["NotifierActions"] = "notifier-actions";
7036
- /** Notifier supports per-call recipient targeting (multi-user). */
7037
- DeviceFeature["NotifierRecipients"] = "notifier-recipients";
7038
- /** Script runner accepts a variables map on each run invocation. */
7039
- DeviceFeature["ScriptVariables"] = "script-variables";
7040
- /** Automation `trigger` accepts a skipCondition flag — fires the
7041
- * automation's actions while bypassing its condition block. */
7042
- DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
7043
- return DeviceFeature;
7044
- }({});
7045
- /**
7046
- * Semantic role a device plays within its parent. Populated by driver
7047
- * addons when creating accessory devices (Reolink siren/floodlight/
7048
- * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
7049
- * admin UI to pick icons, labels, and widgets — a `Switch` with
7050
- * `role: Floodlight` renders as a bulb with a brightness slider,
7051
- * whereas a `Switch` with `role: Siren` renders as a klaxon.
7052
- *
7053
- * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
7054
- * sqlite as a nullable TEXT column — old rows keep working unchanged.
7055
- */
7056
- var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
7057
- DeviceRole["Siren"] = "siren";
7058
- DeviceRole["Floodlight"] = "floodlight";
7059
- DeviceRole["Spotlight"] = "spotlight";
7060
- DeviceRole["PirSensor"] = "pir-sensor";
7061
- DeviceRole["Chime"] = "chime";
7062
- DeviceRole["Autotrack"] = "autotrack";
7063
- DeviceRole["Nightvision"] = "nightvision";
7064
- DeviceRole["PrivacyMask"] = "privacy-mask";
7065
- DeviceRole["Doorbell"] = "doorbell";
7066
- /** Virtual HA toggle (input_boolean.*) — distinguishable from a
7067
- * real Switch device for UI rendering / export adapters. */
7068
- DeviceRole["BinaryHelper"] = "binary-helper";
7069
- /** Generic motion / occupancy / moving event source. Distinct from
7070
- * the camera accessory PirSensor role: that one is a camera child;
7071
- * this is a standalone HA / 3rd-party motion sensor. */
7072
- DeviceRole["MotionSensor"] = "motion-sensor";
7073
- DeviceRole["ContactSensor"] = "contact-sensor";
7074
- DeviceRole["LeakSensor"] = "leak-sensor";
7075
- DeviceRole["SmokeSensor"] = "smoke-sensor";
7076
- DeviceRole["COSensor"] = "co-sensor";
7077
- DeviceRole["GasSensor"] = "gas-sensor";
7078
- DeviceRole["TamperSensor"] = "tamper-sensor";
7079
- DeviceRole["VibrationSensor"] = "vibration-sensor";
7080
- DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
7081
- DeviceRole["SoundSensor"] = "sound-sensor";
7082
- /** Fallback for `binary_sensor` without a known `device_class`. */
7083
- DeviceRole["BinarySensor"] = "binary-sensor";
7084
- DeviceRole["TemperatureSensor"] = "temperature-sensor";
7085
- DeviceRole["HumiditySensor"] = "humidity-sensor";
7086
- DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
7087
- DeviceRole["PressureSensor"] = "pressure-sensor";
7088
- DeviceRole["PowerSensor"] = "power-sensor";
7089
- DeviceRole["EnergySensor"] = "energy-sensor";
7090
- DeviceRole["VoltageSensor"] = "voltage-sensor";
7091
- DeviceRole["CurrentSensor"] = "current-sensor";
7092
- DeviceRole["AirQualitySensor"] = "air-quality-sensor";
7093
- /** Battery level (numeric % via `sensor` OR low-bool via
7094
- * `binary_sensor` — the cap distinguishes via the value type). */
7095
- DeviceRole["BatterySensor"] = "battery-sensor";
7096
- /** Fallback for `sensor` numeric without a known `device_class`. */
7097
- DeviceRole["NumericSensor"] = "numeric-sensor";
7098
- /** String / enum state (HA `sensor` with `state_class: enum` or
7099
- * `attributes.options`). */
7100
- DeviceRole["EnumSensor"] = "enum-sensor";
7101
- /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
7102
- * or `date`). The slice carries the raw ISO string verbatim (hosted on
7103
- * the `enum-sensor` cap); the UI renders it locale-formatted. */
7104
- DeviceRole["DateTimeSensor"] = "datetime-sensor";
7105
- /** Last-resort fallback when nothing else matches. */
7106
- DeviceRole["GenericSensor"] = "generic-sensor";
7107
- DeviceRole["NumericControl"] = "numeric-control";
7108
- DeviceRole["SelectControl"] = "select-control";
7109
- DeviceRole["TextControl"] = "text-control";
7110
- DeviceRole["DateTimeControl"] = "datetime-control";
7111
- /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
7112
- * rich features (image, priority, channel routing). */
7113
- DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
7114
- /** Chat / messaging service (HA `notify.telegram_*`,
7115
- * `notify.discord_*`, etc.). */
7116
- DeviceRole["MessagingNotifier"] = "messaging-notifier";
7117
- /** Email-based delivery (HA `notify.smtp`, etc.). */
7118
- DeviceRole["EmailNotifier"] = "email-notifier";
7119
- /** Fallback when the notifier service name doesn't match a known
7120
- * pattern. */
7121
- DeviceRole["GenericNotifier"] = "generic-notifier";
7122
- return DeviceRole;
7123
- }({});
7140
+ Ringtone: "telephone",
7141
+ "Telephone dialing, DTMF": "telephone",
7142
+ "Busy signal": "telephone",
7143
+ Engine: "engine",
7144
+ "Engine starting": "engine",
7145
+ Idling: "engine",
7146
+ "Accelerating, revving, vroom": "engine",
7147
+ "Light engine (high frequency)": "engine",
7148
+ "Medium engine (mid frequency)": "engine",
7149
+ "Heavy engine (low frequency)": "engine",
7150
+ "Lawn mower": "engine",
7151
+ Chainsaw: "engine",
7152
+ Hammer: "tools",
7153
+ Jackhammer: "tools",
7154
+ Sawing: "tools",
7155
+ "Power tool": "tools",
7156
+ Drill: "tools",
7157
+ Sanding: "tools",
7158
+ Silence: "silence"
7159
+ },
7160
+ preserveOriginal: false
7161
+ };
7162
+ var APPLE_SA_TO_MACRO = {
7163
+ mapping: {
7164
+ speech: "speech",
7165
+ child_speech: "speech",
7166
+ conversation: "speech",
7167
+ whispering: "speech",
7168
+ singing: "speech",
7169
+ humming: "speech",
7170
+ shout: "scream",
7171
+ yell: "scream",
7172
+ screaming: "scream",
7173
+ crying: "crying",
7174
+ baby_crying: "crying",
7175
+ sobbing: "crying",
7176
+ laughter: "laughter",
7177
+ baby_laughter: "laughter",
7178
+ giggling: "laughter",
7179
+ music: "music",
7180
+ guitar: "music",
7181
+ piano: "music",
7182
+ drums: "music",
7183
+ dog_bark: "dog",
7184
+ dog_bow_wow: "dog",
7185
+ dog_growling: "dog",
7186
+ dog_howl: "dog",
7187
+ cat_meow: "cat",
7188
+ cat_purr: "cat",
7189
+ cat_hiss: "cat",
7190
+ bird: "bird",
7191
+ bird_chirp: "bird",
7192
+ bird_squawk: "bird",
7193
+ animal: "animal",
7194
+ horse: "animal",
7195
+ cow_moo: "animal",
7196
+ insect: "animal",
7197
+ alarm: "alarm",
7198
+ smoke_alarm: "alarm",
7199
+ fire_alarm: "alarm",
7200
+ car_alarm: "alarm",
7201
+ siren: "siren",
7202
+ police_siren: "siren",
7203
+ ambulance_siren: "siren",
7204
+ doorbell: "doorbell",
7205
+ door_knock: "doorbell",
7206
+ knocking: "doorbell",
7207
+ glass_breaking: "glass_breaking",
7208
+ glass_shatter: "glass_breaking",
7209
+ gunshot: "gunshot",
7210
+ explosion: "gunshot",
7211
+ fireworks: "gunshot",
7212
+ car: "vehicle",
7213
+ truck: "vehicle",
7214
+ motorcycle: "vehicle",
7215
+ car_horn: "vehicle",
7216
+ vehicle_horn: "vehicle",
7217
+ traffic: "vehicle",
7218
+ fire: "fire",
7219
+ fire_crackle: "fire",
7220
+ water: "water",
7221
+ rain: "water",
7222
+ ocean: "water",
7223
+ splash: "water",
7224
+ wind: "wind",
7225
+ thunder: "wind",
7226
+ thunderstorm: "wind",
7227
+ door: "door",
7228
+ door_slam: "door",
7229
+ sliding_door: "door",
7230
+ footsteps: "footsteps",
7231
+ walking: "footsteps",
7232
+ running: "footsteps",
7233
+ crowd: "crowd",
7234
+ chatter: "crowd",
7235
+ cheering: "crowd",
7236
+ applause: "crowd",
7237
+ telephone_ring: "telephone",
7238
+ ringtone: "telephone",
7239
+ engine: "engine",
7240
+ engine_starting: "engine",
7241
+ lawn_mower: "engine",
7242
+ chainsaw: "engine",
7243
+ hammer: "tools",
7244
+ jackhammer: "tools",
7245
+ drill: "tools",
7246
+ power_tool: "tools",
7247
+ silence: "silence"
7248
+ },
7249
+ preserveOriginal: false
7250
+ };
7251
+ var _macroLookup = /* @__PURE__ */ new Map();
7252
+ for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7253
+ for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7124
7254
  /**
7125
7255
  * Accessory device helpers — shared across drivers.
7126
7256
  *
@@ -7280,74 +7410,6 @@ object({
7280
7410
  });
7281
7411
  DeviceType.Sensor;
7282
7412
  /**
7283
- * Generic types for capability definitions.
7284
- *
7285
- * A capability is defined with Zod schemas for methods, events, and settings.
7286
- * TypeScript types are inferred via z.infer<> — zero duplication.
7287
- *
7288
- * Pattern:
7289
- * 1. Define Zod schemas for data, methods, settings
7290
- * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
7291
- * 3. Export type IProvider = InferProvider<typeof capabilityDef>
7292
- * 4. Addon implements IProvider
7293
- * 5. Registry auto-mounts tRPC router from definition.methods
7294
- */
7295
- /**
7296
- * Output schema shared by the contribution + live methods.
7297
- *
7298
- * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
7299
- * tabs[]) without importing from `../interfaces/config-ui.js` — a
7300
- * concrete-but-lenient Zod object keeps tRPC output inference happy
7301
- * (using `z.unknown()` here collapses unrelated router branches to
7302
- * `unknown` when the generator re-inlines the huge AppRouter type).
7303
- *
7304
- * `.passthrough()` on sections/fields accepts whatever FormBuilder
7305
- * extensions the caller adds (showWhen, displayScale, …) without
7306
- * rebuilding every time a new field kind is introduced.
7307
- */
7308
- var ContributionSectionSchema = object({
7309
- id: string(),
7310
- title: string(),
7311
- description: string().optional(),
7312
- style: _enum(["card", "accordion"]).optional(),
7313
- defaultCollapsed: boolean().optional(),
7314
- columns: union([
7315
- literal(1),
7316
- literal(2),
7317
- literal(3),
7318
- literal(4)
7319
- ]).optional(),
7320
- tab: string().optional(),
7321
- location: _enum(["settings", "top-tab"]).optional(),
7322
- order: number().optional(),
7323
- fields: array(any())
7324
- });
7325
- object({
7326
- tabs: array(object({
7327
- id: string(),
7328
- label: string(),
7329
- icon: string(),
7330
- order: number().optional()
7331
- })).optional(),
7332
- sections: array(ContributionSectionSchema)
7333
- }).nullable();
7334
- object({ deviceId: number() }), object({ deviceId: number() }), object({
7335
- deviceId: number(),
7336
- patch: record(string(), unknown())
7337
- }), object({ success: literal(true) });
7338
- object({ deviceId: number() }), unknown().nullable();
7339
- /** Shorthand to define a method schema */
7340
- function method(input, output, options) {
7341
- return {
7342
- input,
7343
- output,
7344
- kind: options?.kind ?? "query",
7345
- auth: options?.auth ?? "protected",
7346
- ...options?.access !== void 0 ? { access: options.access } : {},
7347
- timeoutMs: options?.timeoutMs
7348
- };
7349
- }
7350
- /**
7351
7413
  * Alarm-panel cap. Models HA `alarm_control_panel.*` on
7352
7414
  * `DeviceType.AlarmPanel`. State follows HA's canonical lifecycle
7353
7415
  * across disarmed / armed_(home|away|night|vacation|custom_bypass) /
@@ -11349,9 +11411,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
11349
11411
  limit: number().optional(),
11350
11412
  tags: record(string(), string()).optional()
11351
11413
  }), array(LogEntrySchema).readonly());
11352
- var StaticDirOutputSchema = object({ staticDir: string() });
11353
- var VersionOutputSchema = object({ version: string() });
11354
- method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
11355
11414
  /**
11356
11415
  * Zod schemas for persisted record types.
11357
11416
  *
@@ -13652,7 +13711,7 @@ method(object({
13652
13711
  }), _void(), {
13653
13712
  kind: "mutation",
13654
13713
  auth: "admin"
13655
- }), 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({
13714
+ }), 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({
13656
13715
  deviceId: number(),
13657
13716
  values: record(string(), unknown())
13658
13717
  }), object({ success: literal(true) }), {
@@ -14354,7 +14413,20 @@ var DiskSpaceInfoSchema = object({
14354
14413
  var PidResourceStatsSchema = object({
14355
14414
  pid: number(),
14356
14415
  cpu: number(),
14357
- memory: number()
14416
+ memory: number(),
14417
+ /**
14418
+ * Private (anonymous) resident bytes — the per-process V8 heap + native
14419
+ * allocations NOT shared with other processes (Linux RssAnon). This is the
14420
+ * "real" per-runner cost; summing it across runners is meaningful, unlike
14421
+ * `memory` (RSS), which double-counts the shared mmap'd framework code.
14422
+ * Undefined where /proc is unavailable (e.g. macOS).
14423
+ */
14424
+ privateBytes: number().optional(),
14425
+ /**
14426
+ * Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
14427
+ * code shared copy-on-write across runners. Undefined on macOS.
14428
+ */
14429
+ sharedBytes: number().optional()
14358
14430
  });
14359
14431
  var AddonInstanceSchema = object({
14360
14432
  addonId: string(),
@@ -14403,6 +14475,17 @@ var KillProcessResultSchema = object({
14403
14475
  reason: string().optional(),
14404
14476
  signal: _enum(["SIGTERM", "SIGKILL"]).optional()
14405
14477
  });
14478
+ var DumpHeapSnapshotInputSchema = object({
14479
+ /** The addon whose runner should dump a heap snapshot. */
14480
+ addonId: string() });
14481
+ var DumpHeapSnapshotResultSchema = object({
14482
+ success: boolean(),
14483
+ /** Path of the written .heapsnapshot inside the runner's container/host. */
14484
+ path: string().optional(),
14485
+ /** Process pid that was signalled. */
14486
+ pid: number().optional(),
14487
+ reason: string().optional()
14488
+ });
14406
14489
  var SystemMetricsSchema = object({
14407
14490
  cpuPercent: number(),
14408
14491
  memoryPercent: number(),
@@ -14416,6 +14499,9 @@ var SystemMetricsSchema = object({
14416
14499
  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, {
14417
14500
  kind: "mutation",
14418
14501
  auth: "admin"
14502
+ }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
14503
+ kind: "mutation",
14504
+ auth: "admin"
14419
14505
  });
14420
14506
  var PtzPresetSchema = object({
14421
14507
  id: string(),
@@ -14782,63 +14868,6 @@ method(object({
14782
14868
  auth: "admin"
14783
14869
  });
14784
14870
  /**
14785
- * device-ops — device-scoped cap that unifies the per-IDevice operations
14786
- * previously routed through the `.device-ops` Moleculer bridge service.
14787
- *
14788
- * Each worker that hosts live `IDevice` instances auto-registers a native
14789
- * provider for this cap (per device) backed by its local
14790
- * `DeviceRegistry`. Hub-side callers reach it transparently through
14791
- * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
14792
- * `deviceId` + `nodeId` and dispatches through the standard cap-router,
14793
- * so there's no parallel bridge path anymore.
14794
- *
14795
- * The surface is intentionally small — every method corresponds to a
14796
- * single action on the live `IDevice` (or `ICameraDevice` for
14797
- * `getStreamSources`). Richer orchestration (enable/disable with
14798
- * integration plumbing, bulk updates) stays in the `device-manager` cap;
14799
- * `device-ops` is the per-device primitive the device-manager routes to.
14800
- */
14801
- var StreamSourceEntrySchema$1 = object({
14802
- id: string(),
14803
- label: string(),
14804
- protocol: _enum([
14805
- "rtsp",
14806
- "rtmp",
14807
- "annexb",
14808
- "http-mjpeg",
14809
- "webrtc",
14810
- "custom"
14811
- ]),
14812
- url: string().optional(),
14813
- resolution: object({
14814
- width: number(),
14815
- height: number()
14816
- }).optional(),
14817
- fps: number().optional(),
14818
- bitrate: number().optional(),
14819
- codec: string().optional(),
14820
- profileHint: CamProfileSchema.optional(),
14821
- sdp: string().optional()
14822
- });
14823
- var ConfigEntrySchema$1 = object({
14824
- key: string(),
14825
- value: unknown()
14826
- });
14827
- var RawStateResultSchema = object({
14828
- /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
14829
- source: string(),
14830
- /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
14831
- data: record(string(), unknown())
14832
- });
14833
- method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
14834
- deviceId: number(),
14835
- values: record(string(), unknown())
14836
- }), _void(), { kind: "mutation" }), method(object({
14837
- deviceId: number(),
14838
- action: string().min(1),
14839
- input: unknown()
14840
- }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
14841
- /**
14842
14871
  * camera-credentials — device-scoped cap exposing the camera's network
14843
14872
  * + auth surface in a vendor-neutral shape.
14844
14873
  *
@@ -18521,6 +18550,12 @@ Object.freeze({
18521
18550
  addonId: null,
18522
18551
  access: "view"
18523
18552
  },
18553
+ "metricsProvider.dumpHeapSnapshot": {
18554
+ capName: "metrics-provider",
18555
+ capScope: "system",
18556
+ addonId: null,
18557
+ access: "create"
18558
+ },
18524
18559
  "metricsProvider.getAddonStats": {
18525
18560
  capName: "metrics-provider",
18526
18561
  capScope: "system",