@camstack/addon-export-hap 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.
@@ -4639,63 +4639,7 @@ function _instanceof(cls, params = {}) {
4639
4639
  return inst;
4640
4640
  }
4641
4641
  //#endregion
4642
- //#region ../types/dist/index.mjs
4643
- /**
4644
- * Deep wiring healthcheck — snapshot of active reachability probes across
4645
- * every declared capability + widget of every installed plugin, on every
4646
- * node. Produced by the backend `WiringHealthService` and surfaced via
4647
- * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
4648
- *
4649
- * Unlike `/health` (process liveness), this reflects whether each cap/widget
4650
- * is actually *reachable* over the real cap-dispatch path. See spec
4651
- * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
4652
- */
4653
- /** What kind of target a probe addressed. */
4654
- var wiringProbeKindSchema = _enum([
4655
- "singleton",
4656
- "device",
4657
- "widget"
4658
- ]);
4659
- /** Result of probing a single (cap|widget [, device]) target. */
4660
- var wiringProbeResultSchema = object({
4661
- capName: string(),
4662
- kind: wiringProbeKindSchema,
4663
- deviceId: number().optional(),
4664
- reachable: boolean(),
4665
- latencyMs: number(),
4666
- error: string().optional()
4667
- });
4668
- /** Per-addon roll-up of cap + widget probe results. */
4669
- var wiringAddonHealthSchema = object({
4670
- addonId: string(),
4671
- caps: array(wiringProbeResultSchema).readonly(),
4672
- widgets: array(wiringProbeResultSchema).readonly()
4673
- });
4674
- /** Per-node roll-up. */
4675
- var wiringNodeHealthSchema = object({
4676
- nodeId: string(),
4677
- addons: array(wiringAddonHealthSchema).readonly()
4678
- });
4679
- object({
4680
- /** True only when every probed target is reachable. */
4681
- ok: boolean(),
4682
- /** True when at least one target is unreachable. */
4683
- degraded: boolean(),
4684
- checkedAt: string(),
4685
- nodes: array(wiringNodeHealthSchema).readonly(),
4686
- summary: object({
4687
- total: number(),
4688
- reachable: number(),
4689
- unreachable: number()
4690
- })
4691
- });
4692
- var MODEL_FORMATS = [
4693
- "onnx",
4694
- "coreml",
4695
- "openvino",
4696
- "tflite",
4697
- "pt"
4698
- ];
4642
+ //#region ../types/dist/sleep-D7JeS58T.mjs
4699
4643
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4700
4644
  EventCategory["SystemBoot"] = "system.boot";
4701
4645
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -6018,7 +5962,7 @@ var ProfileSlotSchema = object({
6018
5962
  * Zod schema for StreamSourceEntry — the canonical stream descriptor
6019
5963
  * exposed by ICameraDevice.getStreamSources() and consumed by the broker.
6020
5964
  */
6021
- var StreamSourceEntrySchema = object({
5965
+ var StreamSourceEntrySchema$1 = object({
6022
5966
  id: string(),
6023
5967
  label: string(),
6024
5968
  protocol: _enum([
@@ -6240,121 +6184,583 @@ var ProfileRtspEntrySchema = object({
6240
6184
  codec: string().optional(),
6241
6185
  resolution: CamStreamResolutionSchema.optional()
6242
6186
  });
6187
+ var DeviceType = /* @__PURE__ */ function(DeviceType) {
6188
+ DeviceType["Camera"] = "camera";
6189
+ DeviceType["Hub"] = "hub";
6190
+ DeviceType["Light"] = "light";
6191
+ DeviceType["Siren"] = "siren";
6192
+ DeviceType["Switch"] = "switch";
6193
+ DeviceType["Sensor"] = "sensor";
6194
+ DeviceType["Thermostat"] = "thermostat";
6195
+ DeviceType["Button"] = "button";
6196
+ /** Generic stateless event emitter — carries a device's EXACT declared
6197
+ * event vocabulary verbatim (no normalization). Installed with the
6198
+ * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6199
+ * HA bus events (e.g. `zha_event`, generic). */
6200
+ DeviceType["EventEmitter"] = "event-emitter";
6201
+ /** Firmware/software update entity — current vs available version,
6202
+ * updatable flag, update state, and an install action. Installed with
6203
+ * the `update` cap. Sources: Homematic firmware-update channels (and
6204
+ * reusable by other providers, e.g. HA `update.*` entities). */
6205
+ DeviceType["Update"] = "update";
6206
+ DeviceType["Generic"] = "generic";
6207
+ /** Generic notification delivery target (HA `notify.<service>`, future
6208
+ * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6209
+ * endpoint; the `notifier` cap defines the send surface. */
6210
+ DeviceType["Notifier"] = "notifier";
6211
+ /** Pre-recorded action sequence with optional parameters
6212
+ * (HA `script.*`). Runnable via `script-runner` cap. */
6213
+ DeviceType["Script"] = "script";
6214
+ /** Automation rule (HA `automation.*`) — enable/disable + manual
6215
+ * trigger surface exposed via `automation-control` cap. */
6216
+ DeviceType["Automation"] = "automation";
6217
+ /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6218
+ DeviceType["Lock"] = "lock";
6219
+ /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6220
+ * `valve.*`). `cover` cap with sub-roles for variant. */
6221
+ DeviceType["Cover"] = "cover";
6222
+ /** Pipe / water / gas valve with open/close/stop and optional
6223
+ * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6224
+ * modelled on the same open/closed lifecycle. */
6225
+ DeviceType["Valve"] = "valve";
6226
+ /** Humidifier / dehumidifier with on/off + target humidity + mode
6227
+ * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6228
+ * modelled on the same target / mode lifecycle. */
6229
+ DeviceType["Humidifier"] = "humidifier";
6230
+ /** Water heater / boiler with target temperature + operation mode +
6231
+ * away mode (HA `water_heater.*`). `water-heater` cap — a
6232
+ * climate-family actuator. */
6233
+ DeviceType["WaterHeater"] = "water-heater";
6234
+ /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6235
+ DeviceType["Fan"] = "fan";
6236
+ /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6237
+ * the camera surface — those use `Camera`. `media-player` cap. */
6238
+ DeviceType["MediaPlayer"] = "media-player";
6239
+ /** Security panel / alarm system (HA `alarm_control_panel.*`).
6240
+ * `alarm-panel` cap. */
6241
+ DeviceType["AlarmPanel"] = "alarm-panel";
6242
+ /** Generic user-settable input (HA `number` / `input_number` / `select`
6243
+ * / `input_select` / `text` / `input_text` / `input_datetime`).
6244
+ * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6245
+ * TextControl / DateTimeControl. */
6246
+ DeviceType["Control"] = "control";
6247
+ /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6248
+ * `presence` cap. */
6249
+ DeviceType["Presence"] = "presence";
6250
+ /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6251
+ * `weather` cap. */
6252
+ DeviceType["Weather"] = "weather";
6253
+ /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6254
+ DeviceType["Vacuum"] = "vacuum";
6255
+ /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6256
+ * `lawn-mower-control` cap. */
6257
+ DeviceType["LawnMower"] = "lawn-mower";
6258
+ /** Physical HA device group — parent container for entity-children
6259
+ * adopted from a single HA device entry. Not renderable as a
6260
+ * standalone device; exists only to anchor child entities. */
6261
+ DeviceType["Container"] = "container";
6262
+ /** Single still-image entity (HA `image.*`). Read-only display of an
6263
+ * `entity_picture` signed URL the browser loads directly. `image` cap. */
6264
+ DeviceType["Image"] = "image";
6265
+ return DeviceType;
6266
+ }({});
6267
+ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6268
+ DeviceFeature["BatteryOperated"] = "battery-operated";
6269
+ DeviceFeature["Rebootable"] = "rebootable";
6270
+ /**
6271
+ * Device supports an on-demand re-sync of its derived spec with its
6272
+ * upstream source — drives the generic Re-sync button. The owning
6273
+ * provider implements the action via the `device-adoption.resync` cap.
6274
+ */
6275
+ DeviceFeature["Resyncable"] = "resyncable";
6276
+ DeviceFeature["NativeSnapshot"] = "native-snapshot";
6277
+ DeviceFeature["DoorbellButton"] = "doorbell-button";
6278
+ DeviceFeature["TwoWayAudio"] = "two-way-audio";
6279
+ DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6280
+ /**
6281
+ * Camera supports the on-firmware autotrack subsystem (subject-
6282
+ * following). Distinct from `PanTiltZoom` because not every PTZ
6283
+ * camera ships autotrack — the admin UI uses this flag to gate
6284
+ * the autotrack toggle / settings card without re-deriving from
6285
+ * the cap registry. Mirrors `ptz-autotrack` cap registration:
6286
+ * driver sets this feature when probe confirms the firmware
6287
+ * surface, and registers the cap in the same code path.
6288
+ */
6289
+ DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6290
+ /**
6291
+ * Accessory exposes a "trigger on motion" toggle — the parent camera's
6292
+ * motion detection automatically activates this device. Mirrors
6293
+ * `motion-trigger` cap registration: drivers set this feature in the
6294
+ * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6295
+ *
6296
+ * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6297
+ * fast scalar without binding fetch), notifier rules, and `listAll`
6298
+ * filters that want "all devices with on-motion behaviour".
6299
+ */
6300
+ DeviceFeature["MotionTrigger"] = "motion-trigger";
6301
+ /** Light supports rgb-triplet color via `color` cap. */
6302
+ DeviceFeature["LightColorRgb"] = "light-color-rgb";
6303
+ /** Light supports HSV color via `color` cap. */
6304
+ DeviceFeature["LightColorHsv"] = "light-color-hsv";
6305
+ /** Light supports color-temperature (mired) via `color` cap. */
6306
+ DeviceFeature["LightColorMired"] = "light-color-mired";
6307
+ /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6308
+ * targetHigh). Gates the range slider UI. */
6309
+ DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6310
+ /** Thermostat exposes target humidity and/or current humidity
6311
+ * readings. Gates the humidity controls. */
6312
+ DeviceFeature["ClimateHumidity"] = "climate-humidity";
6313
+ /** Thermostat exposes a fan-mode selector. */
6314
+ DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6315
+ /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6316
+ DeviceFeature["ClimatePreset"] = "climate-preset";
6317
+ /** Cover exposes intermediate position control (0..100). Gates the
6318
+ * position slider UI. */
6319
+ DeviceFeature["CoverPositionable"] = "cover-positionable";
6320
+ /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6321
+ DeviceFeature["CoverTilt"] = "cover-tilt";
6322
+ /** Valve exposes intermediate position control (0..100). Gates the
6323
+ * position slider / drag surface UI. */
6324
+ DeviceFeature["ValvePositionable"] = "valve-positionable";
6325
+ /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6326
+ DeviceFeature["FanSpeed"] = "fan-speed";
6327
+ /** Fan exposes a preset mode selector. */
6328
+ DeviceFeature["FanPreset"] = "fan-preset";
6329
+ /** Fan exposes blade direction (forward/reverse) — typical of
6330
+ * ceiling fans. */
6331
+ DeviceFeature["FanDirection"] = "fan-direction";
6332
+ /** Fan exposes an oscillation toggle. */
6333
+ DeviceFeature["FanOscillating"] = "fan-oscillating";
6334
+ /** Lock requires a PIN code on lock/unlock. Gates the code-entry
6335
+ * field on the UI lock-controls panel. */
6336
+ DeviceFeature["LockPinRequired"] = "lock-pin-required";
6337
+ /** Lock supports a latch-release ("open door") action distinct from
6338
+ * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
6339
+ * `supported_features`. Gates the Open Door button in the UI. */
6340
+ DeviceFeature["LockOpen"] = "lock-open";
6341
+ /** Media player exposes a seek-to-position surface. */
6342
+ DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
6343
+ /** Media player exposes a volume-level setter. */
6344
+ DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
6345
+ /** Media player exposes a mute toggle distinct from volume=0. */
6346
+ DeviceFeature["MediaPlayerMute"] = "media-player-mute";
6347
+ /** Media player exposes a shuffle toggle. */
6348
+ DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
6349
+ /** Media player exposes a repeat mode (off / all / one). */
6350
+ DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
6351
+ /** Media player exposes a source / input selector. */
6352
+ DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
6353
+ /** Media player exposes a play-arbitrary-media surface (URL / id). */
6354
+ DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
6355
+ /** Media player exposes next-track. */
6356
+ DeviceFeature["MediaPlayerNext"] = "media-player-next";
6357
+ /** Media player exposes previous-track. */
6358
+ DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
6359
+ /** Media player exposes stop distinct from pause. */
6360
+ DeviceFeature["MediaPlayerStop"] = "media-player-stop";
6361
+ /** Alarm panel requires a PIN code on arm/disarm. */
6362
+ DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
6363
+ /** Presence device carries GPS coordinates (lat/lng/accuracy) in
6364
+ * addition to a textual location. */
6365
+ DeviceFeature["PresenceGps"] = "presence-gps";
6366
+ /** Notifier accepts an inline / URL image attachment. */
6367
+ DeviceFeature["NotifierImage"] = "notifier-image";
6368
+ /** Notifier accepts a priority hint (high/normal/low). */
6369
+ DeviceFeature["NotifierPriority"] = "notifier-priority";
6370
+ /** Notifier accepts a free-form `data` payload for platform-specific
6371
+ * fields. */
6372
+ DeviceFeature["NotifierData"] = "notifier-data";
6373
+ /** Notifier supports interactive action buttons / callbacks. */
6374
+ DeviceFeature["NotifierActions"] = "notifier-actions";
6375
+ /** Notifier supports per-call recipient targeting (multi-user). */
6376
+ DeviceFeature["NotifierRecipients"] = "notifier-recipients";
6377
+ /** Script runner accepts a variables map on each run invocation. */
6378
+ DeviceFeature["ScriptVariables"] = "script-variables";
6379
+ /** Automation `trigger` accepts a skipCondition flag — fires the
6380
+ * automation's actions while bypassing its condition block. */
6381
+ DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
6382
+ return DeviceFeature;
6383
+ }({});
6243
6384
  /**
6244
- * Numeric day-of-week: 0 = Sunday 6 = Saturday (matches `Date.getDay`).
6245
- * Named `RecordingWeekday` to avoid collision with the string-union
6246
- * `Weekday` exported from `interfaces/timezones.ts`.
6247
- */
6248
- var RecordingWeekdaySchema = number().int().min(0).max(6);
6249
- var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6250
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6251
- kind: literal("timeOfDay"),
6252
- start: string().regex(HHMM),
6253
- end: string().regex(HHMM),
6254
- /** Restrict to these weekdays; omit = every day. */
6255
- days: array(RecordingWeekdaySchema).optional()
6256
- })]);
6257
- var RecordingModeSchema = _enum([
6258
- "continuous",
6259
- "onMotion",
6260
- "onAudioThreshold"
6261
- ]);
6262
- /**
6263
- * First-class, authoritative per-camera storage mode — the netta choice the UI
6264
- * reads directly (never inferred from `rules`):
6265
- * - `off` — not recording.
6266
- * - `events` — record only around triggers (motion / audio threshold),
6267
- * with pre/post-buffer.
6268
- * - `continuous` — record 24/7 within the schedule.
6385
+ * Semantic role a device plays within its parent. Populated by driver
6386
+ * addons when creating accessory devices (Reolink siren/floodlight/
6387
+ * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
6388
+ * admin UI to pick icons, labels, and widgets — a `Switch` with
6389
+ * `role: Floodlight` renders as a bulb with a brightness slider,
6390
+ * whereas a `Switch` with `role: Siren` renders as a klaxon.
6269
6391
  *
6270
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6271
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6392
+ * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
6393
+ * sqlite as a nullable TEXT column old rows keep working unchanged.
6272
6394
  */
6273
- var RecordingStorageModeSchema = _enum([
6274
- "off",
6275
- "events",
6276
- "continuous"
6277
- ]);
6278
- /** Which detectors trigger an `events`-mode recording. */
6279
- var RecordingTriggersSchema = object({
6280
- motion: boolean().optional(),
6281
- audioThresholdDbfs: number().optional()
6282
- });
6395
+ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
6396
+ DeviceRole["Siren"] = "siren";
6397
+ DeviceRole["Floodlight"] = "floodlight";
6398
+ DeviceRole["Spotlight"] = "spotlight";
6399
+ DeviceRole["PirSensor"] = "pir-sensor";
6400
+ DeviceRole["Chime"] = "chime";
6401
+ DeviceRole["Autotrack"] = "autotrack";
6402
+ DeviceRole["Nightvision"] = "nightvision";
6403
+ DeviceRole["PrivacyMask"] = "privacy-mask";
6404
+ DeviceRole["Doorbell"] = "doorbell";
6405
+ /** Virtual HA toggle (input_boolean.*) — distinguishable from a
6406
+ * real Switch device for UI rendering / export adapters. */
6407
+ DeviceRole["BinaryHelper"] = "binary-helper";
6408
+ /** Generic motion / occupancy / moving event source. Distinct from
6409
+ * the camera accessory PirSensor role: that one is a camera child;
6410
+ * this is a standalone HA / 3rd-party motion sensor. */
6411
+ DeviceRole["MotionSensor"] = "motion-sensor";
6412
+ DeviceRole["ContactSensor"] = "contact-sensor";
6413
+ DeviceRole["LeakSensor"] = "leak-sensor";
6414
+ DeviceRole["SmokeSensor"] = "smoke-sensor";
6415
+ DeviceRole["COSensor"] = "co-sensor";
6416
+ DeviceRole["GasSensor"] = "gas-sensor";
6417
+ DeviceRole["TamperSensor"] = "tamper-sensor";
6418
+ DeviceRole["VibrationSensor"] = "vibration-sensor";
6419
+ DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
6420
+ DeviceRole["SoundSensor"] = "sound-sensor";
6421
+ /** Fallback for `binary_sensor` without a known `device_class`. */
6422
+ DeviceRole["BinarySensor"] = "binary-sensor";
6423
+ DeviceRole["TemperatureSensor"] = "temperature-sensor";
6424
+ DeviceRole["HumiditySensor"] = "humidity-sensor";
6425
+ DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
6426
+ DeviceRole["PressureSensor"] = "pressure-sensor";
6427
+ DeviceRole["PowerSensor"] = "power-sensor";
6428
+ DeviceRole["EnergySensor"] = "energy-sensor";
6429
+ DeviceRole["VoltageSensor"] = "voltage-sensor";
6430
+ DeviceRole["CurrentSensor"] = "current-sensor";
6431
+ DeviceRole["AirQualitySensor"] = "air-quality-sensor";
6432
+ /** Battery level (numeric % via `sensor` OR low-bool via
6433
+ * `binary_sensor` — the cap distinguishes via the value type). */
6434
+ DeviceRole["BatterySensor"] = "battery-sensor";
6435
+ /** Fallback for `sensor` numeric without a known `device_class`. */
6436
+ DeviceRole["NumericSensor"] = "numeric-sensor";
6437
+ /** String / enum state (HA `sensor` with `state_class: enum` or
6438
+ * `attributes.options`). */
6439
+ DeviceRole["EnumSensor"] = "enum-sensor";
6440
+ /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
6441
+ * or `date`). The slice carries the raw ISO string verbatim (hosted on
6442
+ * the `enum-sensor` cap); the UI renders it locale-formatted. */
6443
+ DeviceRole["DateTimeSensor"] = "datetime-sensor";
6444
+ /** Last-resort fallback when nothing else matches. */
6445
+ DeviceRole["GenericSensor"] = "generic-sensor";
6446
+ DeviceRole["NumericControl"] = "numeric-control";
6447
+ DeviceRole["SelectControl"] = "select-control";
6448
+ DeviceRole["TextControl"] = "text-control";
6449
+ DeviceRole["DateTimeControl"] = "datetime-control";
6450
+ /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
6451
+ * rich features (image, priority, channel routing). */
6452
+ DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
6453
+ /** Chat / messaging service (HA `notify.telegram_*`,
6454
+ * `notify.discord_*`, etc.). */
6455
+ DeviceRole["MessagingNotifier"] = "messaging-notifier";
6456
+ /** Email-based delivery (HA `notify.smtp`, etc.). */
6457
+ DeviceRole["EmailNotifier"] = "email-notifier";
6458
+ /** Fallback when the notifier service name doesn't match a known
6459
+ * pattern. */
6460
+ DeviceRole["GenericNotifier"] = "generic-notifier";
6461
+ return DeviceRole;
6462
+ }({});
6283
6463
  /**
6284
- * Mode of a single recording band — the recorder per-band vocabulary.
6464
+ * Generic types for capability definitions.
6285
6465
  *
6286
- * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6287
- * only ever `continuous` or `events`; "off" is expressed by the absence of a
6288
- * covering band, not by a band value.
6289
- */
6290
- var RecordingBandModeSchema = _enum(["continuous", "events"]);
6291
- /**
6292
- * Triggers for an `events`-mode band. Identical shape to
6293
- * `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
6294
- * two never drift.
6295
- */
6296
- var RecordingBandTriggersSchema = RecordingTriggersSchema;
6297
- /**
6298
- * A single mode-per-band window — the canonical recorder band shape, the
6299
- * single source of truth re-used by `addon-pipeline/recorder`.
6466
+ * A capability is defined with Zod schemas for methods, events, and settings.
6467
+ * TypeScript types are inferred via z.infer<> zero duplication.
6300
6468
  *
6301
- * `days` lists the weekdays the band covers (empty = every day, matching the
6302
- * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6303
- * span wraps past midnight (handled by the band engine).
6469
+ * Pattern:
6470
+ * 1. Define Zod schemas for data, methods, settings
6471
+ * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
6472
+ * 3. Export type IProvider = InferProvider<typeof capabilityDef>
6473
+ * 4. Addon implements IProvider
6474
+ * 5. Registry auto-mounts tRPC router from definition.methods
6304
6475
  */
6305
- var RecordingBandSchema = object({
6306
- days: array(RecordingWeekdaySchema),
6307
- start: string().regex(HHMM),
6308
- end: string().regex(HHMM),
6309
- mode: RecordingBandModeSchema,
6310
- triggers: RecordingBandTriggersSchema.optional(),
6311
- preBufferSec: number().min(0).optional(),
6312
- postBufferSec: number().min(0).optional()
6313
- });
6314
- var RecordingRuleSchema = object({
6315
- schedule: RecordingScheduleSchema,
6316
- mode: RecordingModeSchema,
6317
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6318
- preBufferSec: number().min(0).default(0),
6319
- /** Keep recording until this many seconds after the last trigger. */
6320
- postBufferSec: number().min(0).default(0),
6321
- /** Each new trigger restarts the post-buffer window. */
6322
- resetTimeoutOnNewEvent: boolean().default(true),
6323
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
6324
- thresholdDbfs: number().optional()
6325
- });
6326
6476
  /**
6327
- * Per-device retention overrides. Every field is optional; an unset or `0`
6328
- * value inherits the node-wide recorder default. Only footage-lifetime limits
6329
- * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6330
- * (when the volume is too full to keep recording) is NOT a per-camera concern
6331
- * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6332
- * shared by every camera writing to that volume.
6477
+ * Output schema shared by the contribution + live methods.
6478
+ *
6479
+ * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
6480
+ * tabs[]) without importing from `../interfaces/config-ui.js` a
6481
+ * concrete-but-lenient Zod object keeps tRPC output inference happy
6482
+ * (using `z.unknown()` here collapses unrelated router branches to
6483
+ * `unknown` when the generator re-inlines the huge AppRouter type).
6484
+ *
6485
+ * `.passthrough()` on sections/fields accepts whatever FormBuilder
6486
+ * extensions the caller adds (showWhen, displayScale, …) without
6487
+ * rebuilding every time a new field kind is introduced.
6333
6488
  */
6334
- var RecordingRetentionSchema = object({
6335
- maxAgeDays: number().min(0).optional(),
6336
- maxSizeGb: number().min(0).optional()
6489
+ var ContributionSectionSchema = object({
6490
+ id: string(),
6491
+ title: string(),
6492
+ description: string().optional(),
6493
+ style: _enum(["card", "accordion"]).optional(),
6494
+ defaultCollapsed: boolean().optional(),
6495
+ columns: union([
6496
+ literal(1),
6497
+ literal(2),
6498
+ literal(3),
6499
+ literal(4)
6500
+ ]).optional(),
6501
+ tab: string().optional(),
6502
+ location: _enum(["settings", "top-tab"]).optional(),
6503
+ order: number().optional(),
6504
+ fields: array(any())
6337
6505
  });
6506
+ object({
6507
+ tabs: array(object({
6508
+ id: string(),
6509
+ label: string(),
6510
+ icon: string(),
6511
+ order: number().optional()
6512
+ })).optional(),
6513
+ sections: array(ContributionSectionSchema)
6514
+ }).nullable();
6515
+ object({ deviceId: number() }), object({ deviceId: number() }), object({
6516
+ deviceId: number(),
6517
+ patch: record(string(), unknown())
6518
+ }), object({ success: literal(true) });
6519
+ object({ deviceId: number() }), unknown().nullable();
6520
+ /** Shorthand to define a method schema */
6521
+ function method(input, output, options) {
6522
+ return {
6523
+ input,
6524
+ output,
6525
+ kind: options?.kind ?? "query",
6526
+ auth: options?.auth ?? "protected",
6527
+ ...options?.access !== void 0 ? { access: options.access } : {},
6528
+ timeoutMs: options?.timeoutMs
6529
+ };
6530
+ }
6531
+ var StaticDirOutputSchema = object({ staticDir: string() });
6532
+ var VersionOutputSchema = object({ version: string() });
6533
+ method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
6338
6534
  /**
6339
- * The full per-camera recording intent the wire shape of a RecordingTarget.
6535
+ * device-ops device-scoped cap that unifies the per-IDevice operations
6536
+ * previously routed through the `.device-ops` Moleculer bridge service.
6340
6537
  *
6341
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6342
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6343
- * only for transition + migration (`migrateRulesToMode`); the policy engine
6344
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6538
+ * Each worker that hosts live `IDevice` instances auto-registers a native
6539
+ * provider for this cap (per device) backed by its local
6540
+ * `DeviceRegistry`. Hub-side callers reach it transparently through
6541
+ * `ctx.fetchDevice(id).deviceOps.*` the DeviceProxy injects
6542
+ * `deviceId` + `nodeId` and dispatches through the standard cap-router,
6543
+ * so there's no parallel bridge path anymore.
6544
+ *
6545
+ * The surface is intentionally small — every method corresponds to a
6546
+ * single action on the live `IDevice` (or `ICameraDevice` for
6547
+ * `getStreamSources`). Richer orchestration (enable/disable with
6548
+ * integration plumbing, bulk updates) stays in the `device-manager` cap;
6549
+ * `device-ops` is the per-device primitive the device-manager routes to.
6345
6550
  */
6346
- var RecordingConfigSchema = object({
6347
- enabled: boolean(),
6348
- /** Authoritative storage mode. Absent on legacy targets → derived once via
6349
- * `migrateRulesToMode`, then persisted. */
6350
- mode: RecordingStorageModeSchema.optional(),
6351
- profiles: array(CamProfileSchema).optional(),
6352
- segmentSeconds: number().int().positive().optional(),
6353
- /** Shared recording time-bands for `events` & `continuous` — record only when
6354
- * the wall-clock falls inside one of these windows. Omit or empty = always.
6355
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
6356
- schedules: array(RecordingScheduleSchema).optional(),
6357
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
6551
+ var StreamSourceEntrySchema = object({
6552
+ id: string(),
6553
+ label: string(),
6554
+ protocol: _enum([
6555
+ "rtsp",
6556
+ "rtmp",
6557
+ "annexb",
6558
+ "http-mjpeg",
6559
+ "webrtc",
6560
+ "custom"
6561
+ ]),
6562
+ url: string().optional(),
6563
+ resolution: object({
6564
+ width: number(),
6565
+ height: number()
6566
+ }).optional(),
6567
+ fps: number().optional(),
6568
+ bitrate: number().optional(),
6569
+ codec: string().optional(),
6570
+ profileHint: CamProfileSchema.optional(),
6571
+ sdp: string().optional()
6572
+ });
6573
+ var ConfigEntrySchema$1 = object({
6574
+ key: string(),
6575
+ value: unknown()
6576
+ });
6577
+ var RawStateResultSchema = object({
6578
+ /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
6579
+ source: string(),
6580
+ /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
6581
+ data: record(string(), unknown())
6582
+ });
6583
+ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
6584
+ deviceId: number(),
6585
+ values: record(string(), unknown())
6586
+ }), _void(), { kind: "mutation" }), method(object({
6587
+ deviceId: number(),
6588
+ action: string().min(1),
6589
+ input: unknown()
6590
+ }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
6591
+ //#endregion
6592
+ //#region ../types/dist/index.mjs
6593
+ /**
6594
+ * Deep wiring healthcheck — snapshot of active reachability probes across
6595
+ * every declared capability + widget of every installed plugin, on every
6596
+ * node. Produced by the backend `WiringHealthService` and surfaced via
6597
+ * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
6598
+ *
6599
+ * Unlike `/health` (process liveness), this reflects whether each cap/widget
6600
+ * is actually *reachable* over the real cap-dispatch path. See spec
6601
+ * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
6602
+ */
6603
+ /** What kind of target a probe addressed. */
6604
+ var wiringProbeKindSchema = _enum([
6605
+ "singleton",
6606
+ "device",
6607
+ "widget"
6608
+ ]);
6609
+ /** Result of probing a single (cap|widget [, device]) target. */
6610
+ var wiringProbeResultSchema = object({
6611
+ capName: string(),
6612
+ kind: wiringProbeKindSchema,
6613
+ deviceId: number().optional(),
6614
+ reachable: boolean(),
6615
+ latencyMs: number(),
6616
+ error: string().optional()
6617
+ });
6618
+ /** Per-addon roll-up of cap + widget probe results. */
6619
+ var wiringAddonHealthSchema = object({
6620
+ addonId: string(),
6621
+ caps: array(wiringProbeResultSchema).readonly(),
6622
+ widgets: array(wiringProbeResultSchema).readonly()
6623
+ });
6624
+ /** Per-node roll-up. */
6625
+ var wiringNodeHealthSchema = object({
6626
+ nodeId: string(),
6627
+ addons: array(wiringAddonHealthSchema).readonly()
6628
+ });
6629
+ object({
6630
+ /** True only when every probed target is reachable. */
6631
+ ok: boolean(),
6632
+ /** True when at least one target is unreachable. */
6633
+ degraded: boolean(),
6634
+ checkedAt: string(),
6635
+ nodes: array(wiringNodeHealthSchema).readonly(),
6636
+ summary: object({
6637
+ total: number(),
6638
+ reachable: number(),
6639
+ unreachable: number()
6640
+ })
6641
+ });
6642
+ var MODEL_FORMATS = [
6643
+ "onnx",
6644
+ "coreml",
6645
+ "openvino",
6646
+ "tflite",
6647
+ "pt"
6648
+ ];
6649
+ /**
6650
+ * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6651
+ * Named `RecordingWeekday` to avoid collision with the string-union
6652
+ * `Weekday` exported from `interfaces/timezones.ts`.
6653
+ */
6654
+ var RecordingWeekdaySchema = number().int().min(0).max(6);
6655
+ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6656
+ var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6657
+ kind: literal("timeOfDay"),
6658
+ start: string().regex(HHMM),
6659
+ end: string().regex(HHMM),
6660
+ /** Restrict to these weekdays; omit = every day. */
6661
+ days: array(RecordingWeekdaySchema).optional()
6662
+ })]);
6663
+ var RecordingModeSchema = _enum([
6664
+ "continuous",
6665
+ "onMotion",
6666
+ "onAudioThreshold"
6667
+ ]);
6668
+ /**
6669
+ * First-class, authoritative per-camera storage mode — the netta choice the UI
6670
+ * reads directly (never inferred from `rules`):
6671
+ * - `off` — not recording.
6672
+ * - `events` — record only around triggers (motion / audio threshold),
6673
+ * with pre/post-buffer.
6674
+ * - `continuous` — record 24/7 within the schedule.
6675
+ *
6676
+ * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6677
+ * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6678
+ */
6679
+ var RecordingStorageModeSchema = _enum([
6680
+ "off",
6681
+ "events",
6682
+ "continuous"
6683
+ ]);
6684
+ /** Which detectors trigger an `events`-mode recording. */
6685
+ var RecordingTriggersSchema = object({
6686
+ motion: boolean().optional(),
6687
+ audioThresholdDbfs: number().optional()
6688
+ });
6689
+ /**
6690
+ * Mode of a single recording band — the recorder per-band vocabulary.
6691
+ *
6692
+ * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6693
+ * only ever `continuous` or `events`; "off" is expressed by the absence of a
6694
+ * covering band, not by a band value.
6695
+ */
6696
+ var RecordingBandModeSchema = _enum(["continuous", "events"]);
6697
+ /**
6698
+ * Triggers for an `events`-mode band. Identical shape to
6699
+ * `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
6700
+ * two never drift.
6701
+ */
6702
+ var RecordingBandTriggersSchema = RecordingTriggersSchema;
6703
+ /**
6704
+ * A single mode-per-band window — the canonical recorder band shape, the
6705
+ * single source of truth re-used by `addon-pipeline/recorder`.
6706
+ *
6707
+ * `days` lists the weekdays the band covers (empty = every day, matching the
6708
+ * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6709
+ * span wraps past midnight (handled by the band engine).
6710
+ */
6711
+ var RecordingBandSchema = object({
6712
+ days: array(RecordingWeekdaySchema),
6713
+ start: string().regex(HHMM),
6714
+ end: string().regex(HHMM),
6715
+ mode: RecordingBandModeSchema,
6716
+ triggers: RecordingBandTriggersSchema.optional(),
6717
+ preBufferSec: number().min(0).optional(),
6718
+ postBufferSec: number().min(0).optional()
6719
+ });
6720
+ var RecordingRuleSchema = object({
6721
+ schedule: RecordingScheduleSchema,
6722
+ mode: RecordingModeSchema,
6723
+ /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6724
+ preBufferSec: number().min(0).default(0),
6725
+ /** Keep recording until this many seconds after the last trigger. */
6726
+ postBufferSec: number().min(0).default(0),
6727
+ /** Each new trigger restarts the post-buffer window. */
6728
+ resetTimeoutOnNewEvent: boolean().default(true),
6729
+ /** onAudioThreshold only — dBFS level that counts as a trigger. */
6730
+ thresholdDbfs: number().optional()
6731
+ });
6732
+ /**
6733
+ * Per-device retention overrides. Every field is optional; an unset or `0`
6734
+ * value inherits the node-wide recorder default. Only footage-lifetime limits
6735
+ * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6736
+ * (when the volume is too full to keep recording) is NOT a per-camera concern —
6737
+ * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6738
+ * shared by every camera writing to that volume.
6739
+ */
6740
+ var RecordingRetentionSchema = object({
6741
+ maxAgeDays: number().min(0).optional(),
6742
+ maxSizeGb: number().min(0).optional()
6743
+ });
6744
+ /**
6745
+ * The full per-camera recording intent — the wire shape of a RecordingTarget.
6746
+ *
6747
+ * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6748
+ * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6749
+ * only for transition + migration (`migrateRulesToMode`); the policy engine
6750
+ * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6751
+ */
6752
+ var RecordingConfigSchema = object({
6753
+ enabled: boolean(),
6754
+ /** Authoritative storage mode. Absent on legacy targets → derived once via
6755
+ * `migrateRulesToMode`, then persisted. */
6756
+ mode: RecordingStorageModeSchema.optional(),
6757
+ profiles: array(CamProfileSchema).optional(),
6758
+ segmentSeconds: number().int().positive().optional(),
6759
+ /** Shared recording time-bands for `events` & `continuous` — record only when
6760
+ * the wall-clock falls inside one of these windows. Omit or empty = always.
6761
+ * `continuous` compiles to one rule per band; `events` to band × trigger. */
6762
+ schedules: array(RecordingScheduleSchema).optional(),
6763
+ /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
6358
6764
  * normalized into `schedules` on read and never written going forward. (Not
6359
6765
  * tagged `@deprecated`: the normalization paths must read it cast-free.) */
6360
6766
  schedule: RecordingScheduleSchema.optional(),
@@ -6792,396 +7198,120 @@ var YAMNET_TO_MACRO = {
6792
7198
  "Hubbub, speech noise, speech babble": "crowd",
6793
7199
  Telephone: "telephone",
6794
7200
  "Telephone bell ringing": "telephone",
6795
- Ringtone: "telephone",
6796
- "Telephone dialing, DTMF": "telephone",
6797
- "Busy signal": "telephone",
6798
- Engine: "engine",
6799
- "Engine starting": "engine",
6800
- Idling: "engine",
6801
- "Accelerating, revving, vroom": "engine",
6802
- "Light engine (high frequency)": "engine",
6803
- "Medium engine (mid frequency)": "engine",
6804
- "Heavy engine (low frequency)": "engine",
6805
- "Lawn mower": "engine",
6806
- Chainsaw: "engine",
6807
- Hammer: "tools",
6808
- Jackhammer: "tools",
6809
- Sawing: "tools",
6810
- "Power tool": "tools",
6811
- Drill: "tools",
6812
- Sanding: "tools",
6813
- Silence: "silence"
6814
- },
6815
- preserveOriginal: false
6816
- };
6817
- var APPLE_SA_TO_MACRO = {
6818
- mapping: {
6819
- speech: "speech",
6820
- child_speech: "speech",
6821
- conversation: "speech",
6822
- whispering: "speech",
6823
- singing: "speech",
6824
- humming: "speech",
6825
- shout: "scream",
6826
- yell: "scream",
6827
- screaming: "scream",
6828
- crying: "crying",
6829
- baby_crying: "crying",
6830
- sobbing: "crying",
6831
- laughter: "laughter",
6832
- baby_laughter: "laughter",
6833
- giggling: "laughter",
6834
- music: "music",
6835
- guitar: "music",
6836
- piano: "music",
6837
- drums: "music",
6838
- dog_bark: "dog",
6839
- dog_bow_wow: "dog",
6840
- dog_growling: "dog",
6841
- dog_howl: "dog",
6842
- cat_meow: "cat",
6843
- cat_purr: "cat",
6844
- cat_hiss: "cat",
6845
- bird: "bird",
6846
- bird_chirp: "bird",
6847
- bird_squawk: "bird",
6848
- animal: "animal",
6849
- horse: "animal",
6850
- cow_moo: "animal",
6851
- insect: "animal",
6852
- alarm: "alarm",
6853
- smoke_alarm: "alarm",
6854
- fire_alarm: "alarm",
6855
- car_alarm: "alarm",
6856
- siren: "siren",
6857
- police_siren: "siren",
6858
- ambulance_siren: "siren",
6859
- doorbell: "doorbell",
6860
- door_knock: "doorbell",
6861
- knocking: "doorbell",
6862
- glass_breaking: "glass_breaking",
6863
- glass_shatter: "glass_breaking",
6864
- gunshot: "gunshot",
6865
- explosion: "gunshot",
6866
- fireworks: "gunshot",
6867
- car: "vehicle",
6868
- truck: "vehicle",
6869
- motorcycle: "vehicle",
6870
- car_horn: "vehicle",
6871
- vehicle_horn: "vehicle",
6872
- traffic: "vehicle",
6873
- fire: "fire",
6874
- fire_crackle: "fire",
6875
- water: "water",
6876
- rain: "water",
6877
- ocean: "water",
6878
- splash: "water",
6879
- wind: "wind",
6880
- thunder: "wind",
6881
- thunderstorm: "wind",
6882
- door: "door",
6883
- door_slam: "door",
6884
- sliding_door: "door",
6885
- footsteps: "footsteps",
6886
- walking: "footsteps",
6887
- running: "footsteps",
6888
- crowd: "crowd",
6889
- chatter: "crowd",
6890
- cheering: "crowd",
6891
- applause: "crowd",
6892
- telephone_ring: "telephone",
6893
- ringtone: "telephone",
6894
- engine: "engine",
6895
- engine_starting: "engine",
6896
- lawn_mower: "engine",
6897
- chainsaw: "engine",
6898
- hammer: "tools",
6899
- jackhammer: "tools",
6900
- drill: "tools",
6901
- power_tool: "tools",
6902
- silence: "silence"
6903
- },
6904
- preserveOriginal: false
6905
- };
6906
- var _macroLookup = /* @__PURE__ */ new Map();
6907
- for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6908
- for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6909
- var DeviceType = /* @__PURE__ */ function(DeviceType) {
6910
- DeviceType["Camera"] = "camera";
6911
- DeviceType["Hub"] = "hub";
6912
- DeviceType["Light"] = "light";
6913
- DeviceType["Siren"] = "siren";
6914
- DeviceType["Switch"] = "switch";
6915
- DeviceType["Sensor"] = "sensor";
6916
- DeviceType["Thermostat"] = "thermostat";
6917
- DeviceType["Button"] = "button";
6918
- /** Generic stateless event emitter — carries a device's EXACT declared
6919
- * event vocabulary verbatim (no normalization). Installed with the
6920
- * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6921
- * HA bus events (e.g. `zha_event`, generic). */
6922
- DeviceType["EventEmitter"] = "event-emitter";
6923
- /** Firmware/software update entity — current vs available version,
6924
- * updatable flag, update state, and an install action. Installed with
6925
- * the `update` cap. Sources: Homematic firmware-update channels (and
6926
- * reusable by other providers, e.g. HA `update.*` entities). */
6927
- DeviceType["Update"] = "update";
6928
- DeviceType["Generic"] = "generic";
6929
- /** Generic notification delivery target (HA `notify.<service>`, future
6930
- * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6931
- * endpoint; the `notifier` cap defines the send surface. */
6932
- DeviceType["Notifier"] = "notifier";
6933
- /** Pre-recorded action sequence with optional parameters
6934
- * (HA `script.*`). Runnable via `script-runner` cap. */
6935
- DeviceType["Script"] = "script";
6936
- /** Automation rule (HA `automation.*`) — enable/disable + manual
6937
- * trigger surface exposed via `automation-control` cap. */
6938
- DeviceType["Automation"] = "automation";
6939
- /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6940
- DeviceType["Lock"] = "lock";
6941
- /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6942
- * `valve.*`). `cover` cap with sub-roles for variant. */
6943
- DeviceType["Cover"] = "cover";
6944
- /** Pipe / water / gas valve with open/close/stop and optional
6945
- * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6946
- * modelled on the same open/closed lifecycle. */
6947
- DeviceType["Valve"] = "valve";
6948
- /** Humidifier / dehumidifier with on/off + target humidity + mode
6949
- * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6950
- * modelled on the same target / mode lifecycle. */
6951
- DeviceType["Humidifier"] = "humidifier";
6952
- /** Water heater / boiler with target temperature + operation mode +
6953
- * away mode (HA `water_heater.*`). `water-heater` cap — a
6954
- * climate-family actuator. */
6955
- DeviceType["WaterHeater"] = "water-heater";
6956
- /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6957
- DeviceType["Fan"] = "fan";
6958
- /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6959
- * the camera surface — those use `Camera`. `media-player` cap. */
6960
- DeviceType["MediaPlayer"] = "media-player";
6961
- /** Security panel / alarm system (HA `alarm_control_panel.*`).
6962
- * `alarm-panel` cap. */
6963
- DeviceType["AlarmPanel"] = "alarm-panel";
6964
- /** Generic user-settable input (HA `number` / `input_number` / `select`
6965
- * / `input_select` / `text` / `input_text` / `input_datetime`).
6966
- * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6967
- * TextControl / DateTimeControl. */
6968
- DeviceType["Control"] = "control";
6969
- /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6970
- * `presence` cap. */
6971
- DeviceType["Presence"] = "presence";
6972
- /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6973
- * `weather` cap. */
6974
- DeviceType["Weather"] = "weather";
6975
- /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6976
- DeviceType["Vacuum"] = "vacuum";
6977
- /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6978
- * `lawn-mower-control` cap. */
6979
- DeviceType["LawnMower"] = "lawn-mower";
6980
- /** Physical HA device group — parent container for entity-children
6981
- * adopted from a single HA device entry. Not renderable as a
6982
- * standalone device; exists only to anchor child entities. */
6983
- DeviceType["Container"] = "container";
6984
- /** Single still-image entity (HA `image.*`). Read-only display of an
6985
- * `entity_picture` signed URL the browser loads directly. `image` cap. */
6986
- DeviceType["Image"] = "image";
6987
- return DeviceType;
6988
- }({});
6989
- var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6990
- DeviceFeature["BatteryOperated"] = "battery-operated";
6991
- DeviceFeature["Rebootable"] = "rebootable";
6992
- /**
6993
- * Device supports an on-demand re-sync of its derived spec with its
6994
- * upstream source — drives the generic Re-sync button. The owning
6995
- * provider implements the action via the `device-adoption.resync` cap.
6996
- */
6997
- DeviceFeature["Resyncable"] = "resyncable";
6998
- DeviceFeature["NativeSnapshot"] = "native-snapshot";
6999
- DeviceFeature["DoorbellButton"] = "doorbell-button";
7000
- DeviceFeature["TwoWayAudio"] = "two-way-audio";
7001
- DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
7002
- /**
7003
- * Camera supports the on-firmware autotrack subsystem (subject-
7004
- * following). Distinct from `PanTiltZoom` because not every PTZ
7005
- * camera ships autotrack — the admin UI uses this flag to gate
7006
- * the autotrack toggle / settings card without re-deriving from
7007
- * the cap registry. Mirrors `ptz-autotrack` cap registration:
7008
- * driver sets this feature when probe confirms the firmware
7009
- * surface, and registers the cap in the same code path.
7010
- */
7011
- DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
7012
- /**
7013
- * Accessory exposes a "trigger on motion" toggle — the parent camera's
7014
- * motion detection automatically activates this device. Mirrors
7015
- * `motion-trigger` cap registration: drivers set this feature in the
7016
- * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
7017
- *
7018
- * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
7019
- * fast scalar without binding fetch), notifier rules, and `listAll`
7020
- * filters that want "all devices with on-motion behaviour".
7021
- */
7022
- DeviceFeature["MotionTrigger"] = "motion-trigger";
7023
- /** Light supports rgb-triplet color via `color` cap. */
7024
- DeviceFeature["LightColorRgb"] = "light-color-rgb";
7025
- /** Light supports HSV color via `color` cap. */
7026
- DeviceFeature["LightColorHsv"] = "light-color-hsv";
7027
- /** Light supports color-temperature (mired) via `color` cap. */
7028
- DeviceFeature["LightColorMired"] = "light-color-mired";
7029
- /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
7030
- * targetHigh). Gates the range slider UI. */
7031
- DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
7032
- /** Thermostat exposes target humidity and/or current humidity
7033
- * readings. Gates the humidity controls. */
7034
- DeviceFeature["ClimateHumidity"] = "climate-humidity";
7035
- /** Thermostat exposes a fan-mode selector. */
7036
- DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
7037
- /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
7038
- DeviceFeature["ClimatePreset"] = "climate-preset";
7039
- /** Cover exposes intermediate position control (0..100). Gates the
7040
- * position slider UI. */
7041
- DeviceFeature["CoverPositionable"] = "cover-positionable";
7042
- /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
7043
- DeviceFeature["CoverTilt"] = "cover-tilt";
7044
- /** Valve exposes intermediate position control (0..100). Gates the
7045
- * position slider / drag surface UI. */
7046
- DeviceFeature["ValvePositionable"] = "valve-positionable";
7047
- /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
7048
- DeviceFeature["FanSpeed"] = "fan-speed";
7049
- /** Fan exposes a preset mode selector. */
7050
- DeviceFeature["FanPreset"] = "fan-preset";
7051
- /** Fan exposes blade direction (forward/reverse) — typical of
7052
- * ceiling fans. */
7053
- DeviceFeature["FanDirection"] = "fan-direction";
7054
- /** Fan exposes an oscillation toggle. */
7055
- DeviceFeature["FanOscillating"] = "fan-oscillating";
7056
- /** Lock requires a PIN code on lock/unlock. Gates the code-entry
7057
- * field on the UI lock-controls panel. */
7058
- DeviceFeature["LockPinRequired"] = "lock-pin-required";
7059
- /** Lock supports a latch-release ("open door") action distinct from
7060
- * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
7061
- * `supported_features`. Gates the Open Door button in the UI. */
7062
- DeviceFeature["LockOpen"] = "lock-open";
7063
- /** Media player exposes a seek-to-position surface. */
7064
- DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
7065
- /** Media player exposes a volume-level setter. */
7066
- DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
7067
- /** Media player exposes a mute toggle distinct from volume=0. */
7068
- DeviceFeature["MediaPlayerMute"] = "media-player-mute";
7069
- /** Media player exposes a shuffle toggle. */
7070
- DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
7071
- /** Media player exposes a repeat mode (off / all / one). */
7072
- DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
7073
- /** Media player exposes a source / input selector. */
7074
- DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
7075
- /** Media player exposes a play-arbitrary-media surface (URL / id). */
7076
- DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
7077
- /** Media player exposes next-track. */
7078
- DeviceFeature["MediaPlayerNext"] = "media-player-next";
7079
- /** Media player exposes previous-track. */
7080
- DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
7081
- /** Media player exposes stop distinct from pause. */
7082
- DeviceFeature["MediaPlayerStop"] = "media-player-stop";
7083
- /** Alarm panel requires a PIN code on arm/disarm. */
7084
- DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
7085
- /** Presence device carries GPS coordinates (lat/lng/accuracy) in
7086
- * addition to a textual location. */
7087
- DeviceFeature["PresenceGps"] = "presence-gps";
7088
- /** Notifier accepts an inline / URL image attachment. */
7089
- DeviceFeature["NotifierImage"] = "notifier-image";
7090
- /** Notifier accepts a priority hint (high/normal/low). */
7091
- DeviceFeature["NotifierPriority"] = "notifier-priority";
7092
- /** Notifier accepts a free-form `data` payload for platform-specific
7093
- * fields. */
7094
- DeviceFeature["NotifierData"] = "notifier-data";
7095
- /** Notifier supports interactive action buttons / callbacks. */
7096
- DeviceFeature["NotifierActions"] = "notifier-actions";
7097
- /** Notifier supports per-call recipient targeting (multi-user). */
7098
- DeviceFeature["NotifierRecipients"] = "notifier-recipients";
7099
- /** Script runner accepts a variables map on each run invocation. */
7100
- DeviceFeature["ScriptVariables"] = "script-variables";
7101
- /** Automation `trigger` accepts a skipCondition flag — fires the
7102
- * automation's actions while bypassing its condition block. */
7103
- DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
7104
- return DeviceFeature;
7105
- }({});
7106
- /**
7107
- * Semantic role a device plays within its parent. Populated by driver
7108
- * addons when creating accessory devices (Reolink siren/floodlight/
7109
- * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
7110
- * admin UI to pick icons, labels, and widgets — a `Switch` with
7111
- * `role: Floodlight` renders as a bulb with a brightness slider,
7112
- * whereas a `Switch` with `role: Siren` renders as a klaxon.
7113
- *
7114
- * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
7115
- * sqlite as a nullable TEXT column — old rows keep working unchanged.
7116
- */
7117
- var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
7118
- DeviceRole["Siren"] = "siren";
7119
- DeviceRole["Floodlight"] = "floodlight";
7120
- DeviceRole["Spotlight"] = "spotlight";
7121
- DeviceRole["PirSensor"] = "pir-sensor";
7122
- DeviceRole["Chime"] = "chime";
7123
- DeviceRole["Autotrack"] = "autotrack";
7124
- DeviceRole["Nightvision"] = "nightvision";
7125
- DeviceRole["PrivacyMask"] = "privacy-mask";
7126
- DeviceRole["Doorbell"] = "doorbell";
7127
- /** Virtual HA toggle (input_boolean.*) — distinguishable from a
7128
- * real Switch device for UI rendering / export adapters. */
7129
- DeviceRole["BinaryHelper"] = "binary-helper";
7130
- /** Generic motion / occupancy / moving event source. Distinct from
7131
- * the camera accessory PirSensor role: that one is a camera child;
7132
- * this is a standalone HA / 3rd-party motion sensor. */
7133
- DeviceRole["MotionSensor"] = "motion-sensor";
7134
- DeviceRole["ContactSensor"] = "contact-sensor";
7135
- DeviceRole["LeakSensor"] = "leak-sensor";
7136
- DeviceRole["SmokeSensor"] = "smoke-sensor";
7137
- DeviceRole["COSensor"] = "co-sensor";
7138
- DeviceRole["GasSensor"] = "gas-sensor";
7139
- DeviceRole["TamperSensor"] = "tamper-sensor";
7140
- DeviceRole["VibrationSensor"] = "vibration-sensor";
7141
- DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
7142
- DeviceRole["SoundSensor"] = "sound-sensor";
7143
- /** Fallback for `binary_sensor` without a known `device_class`. */
7144
- DeviceRole["BinarySensor"] = "binary-sensor";
7145
- DeviceRole["TemperatureSensor"] = "temperature-sensor";
7146
- DeviceRole["HumiditySensor"] = "humidity-sensor";
7147
- DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
7148
- DeviceRole["PressureSensor"] = "pressure-sensor";
7149
- DeviceRole["PowerSensor"] = "power-sensor";
7150
- DeviceRole["EnergySensor"] = "energy-sensor";
7151
- DeviceRole["VoltageSensor"] = "voltage-sensor";
7152
- DeviceRole["CurrentSensor"] = "current-sensor";
7153
- DeviceRole["AirQualitySensor"] = "air-quality-sensor";
7154
- /** Battery level (numeric % via `sensor` OR low-bool via
7155
- * `binary_sensor` — the cap distinguishes via the value type). */
7156
- DeviceRole["BatterySensor"] = "battery-sensor";
7157
- /** Fallback for `sensor` numeric without a known `device_class`. */
7158
- DeviceRole["NumericSensor"] = "numeric-sensor";
7159
- /** String / enum state (HA `sensor` with `state_class: enum` or
7160
- * `attributes.options`). */
7161
- DeviceRole["EnumSensor"] = "enum-sensor";
7162
- /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
7163
- * or `date`). The slice carries the raw ISO string verbatim (hosted on
7164
- * the `enum-sensor` cap); the UI renders it locale-formatted. */
7165
- DeviceRole["DateTimeSensor"] = "datetime-sensor";
7166
- /** Last-resort fallback when nothing else matches. */
7167
- DeviceRole["GenericSensor"] = "generic-sensor";
7168
- DeviceRole["NumericControl"] = "numeric-control";
7169
- DeviceRole["SelectControl"] = "select-control";
7170
- DeviceRole["TextControl"] = "text-control";
7171
- DeviceRole["DateTimeControl"] = "datetime-control";
7172
- /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
7173
- * rich features (image, priority, channel routing). */
7174
- DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
7175
- /** Chat / messaging service (HA `notify.telegram_*`,
7176
- * `notify.discord_*`, etc.). */
7177
- DeviceRole["MessagingNotifier"] = "messaging-notifier";
7178
- /** Email-based delivery (HA `notify.smtp`, etc.). */
7179
- DeviceRole["EmailNotifier"] = "email-notifier";
7180
- /** Fallback when the notifier service name doesn't match a known
7181
- * pattern. */
7182
- DeviceRole["GenericNotifier"] = "generic-notifier";
7183
- return DeviceRole;
7184
- }({});
7201
+ Ringtone: "telephone",
7202
+ "Telephone dialing, DTMF": "telephone",
7203
+ "Busy signal": "telephone",
7204
+ Engine: "engine",
7205
+ "Engine starting": "engine",
7206
+ Idling: "engine",
7207
+ "Accelerating, revving, vroom": "engine",
7208
+ "Light engine (high frequency)": "engine",
7209
+ "Medium engine (mid frequency)": "engine",
7210
+ "Heavy engine (low frequency)": "engine",
7211
+ "Lawn mower": "engine",
7212
+ Chainsaw: "engine",
7213
+ Hammer: "tools",
7214
+ Jackhammer: "tools",
7215
+ Sawing: "tools",
7216
+ "Power tool": "tools",
7217
+ Drill: "tools",
7218
+ Sanding: "tools",
7219
+ Silence: "silence"
7220
+ },
7221
+ preserveOriginal: false
7222
+ };
7223
+ var APPLE_SA_TO_MACRO = {
7224
+ mapping: {
7225
+ speech: "speech",
7226
+ child_speech: "speech",
7227
+ conversation: "speech",
7228
+ whispering: "speech",
7229
+ singing: "speech",
7230
+ humming: "speech",
7231
+ shout: "scream",
7232
+ yell: "scream",
7233
+ screaming: "scream",
7234
+ crying: "crying",
7235
+ baby_crying: "crying",
7236
+ sobbing: "crying",
7237
+ laughter: "laughter",
7238
+ baby_laughter: "laughter",
7239
+ giggling: "laughter",
7240
+ music: "music",
7241
+ guitar: "music",
7242
+ piano: "music",
7243
+ drums: "music",
7244
+ dog_bark: "dog",
7245
+ dog_bow_wow: "dog",
7246
+ dog_growling: "dog",
7247
+ dog_howl: "dog",
7248
+ cat_meow: "cat",
7249
+ cat_purr: "cat",
7250
+ cat_hiss: "cat",
7251
+ bird: "bird",
7252
+ bird_chirp: "bird",
7253
+ bird_squawk: "bird",
7254
+ animal: "animal",
7255
+ horse: "animal",
7256
+ cow_moo: "animal",
7257
+ insect: "animal",
7258
+ alarm: "alarm",
7259
+ smoke_alarm: "alarm",
7260
+ fire_alarm: "alarm",
7261
+ car_alarm: "alarm",
7262
+ siren: "siren",
7263
+ police_siren: "siren",
7264
+ ambulance_siren: "siren",
7265
+ doorbell: "doorbell",
7266
+ door_knock: "doorbell",
7267
+ knocking: "doorbell",
7268
+ glass_breaking: "glass_breaking",
7269
+ glass_shatter: "glass_breaking",
7270
+ gunshot: "gunshot",
7271
+ explosion: "gunshot",
7272
+ fireworks: "gunshot",
7273
+ car: "vehicle",
7274
+ truck: "vehicle",
7275
+ motorcycle: "vehicle",
7276
+ car_horn: "vehicle",
7277
+ vehicle_horn: "vehicle",
7278
+ traffic: "vehicle",
7279
+ fire: "fire",
7280
+ fire_crackle: "fire",
7281
+ water: "water",
7282
+ rain: "water",
7283
+ ocean: "water",
7284
+ splash: "water",
7285
+ wind: "wind",
7286
+ thunder: "wind",
7287
+ thunderstorm: "wind",
7288
+ door: "door",
7289
+ door_slam: "door",
7290
+ sliding_door: "door",
7291
+ footsteps: "footsteps",
7292
+ walking: "footsteps",
7293
+ running: "footsteps",
7294
+ crowd: "crowd",
7295
+ chatter: "crowd",
7296
+ cheering: "crowd",
7297
+ applause: "crowd",
7298
+ telephone_ring: "telephone",
7299
+ ringtone: "telephone",
7300
+ engine: "engine",
7301
+ engine_starting: "engine",
7302
+ lawn_mower: "engine",
7303
+ chainsaw: "engine",
7304
+ hammer: "tools",
7305
+ jackhammer: "tools",
7306
+ drill: "tools",
7307
+ power_tool: "tools",
7308
+ silence: "silence"
7309
+ },
7310
+ preserveOriginal: false
7311
+ };
7312
+ var _macroLookup = /* @__PURE__ */ new Map();
7313
+ for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7314
+ for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7185
7315
  /**
7186
7316
  * Accessory device helpers — shared across drivers.
7187
7317
  *
@@ -7341,74 +7471,6 @@ object({
7341
7471
  });
7342
7472
  DeviceType.Sensor;
7343
7473
  /**
7344
- * Generic types for capability definitions.
7345
- *
7346
- * A capability is defined with Zod schemas for methods, events, and settings.
7347
- * TypeScript types are inferred via z.infer<> — zero duplication.
7348
- *
7349
- * Pattern:
7350
- * 1. Define Zod schemas for data, methods, settings
7351
- * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
7352
- * 3. Export type IProvider = InferProvider<typeof capabilityDef>
7353
- * 4. Addon implements IProvider
7354
- * 5. Registry auto-mounts tRPC router from definition.methods
7355
- */
7356
- /**
7357
- * Output schema shared by the contribution + live methods.
7358
- *
7359
- * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
7360
- * tabs[]) without importing from `../interfaces/config-ui.js` — a
7361
- * concrete-but-lenient Zod object keeps tRPC output inference happy
7362
- * (using `z.unknown()` here collapses unrelated router branches to
7363
- * `unknown` when the generator re-inlines the huge AppRouter type).
7364
- *
7365
- * `.passthrough()` on sections/fields accepts whatever FormBuilder
7366
- * extensions the caller adds (showWhen, displayScale, …) without
7367
- * rebuilding every time a new field kind is introduced.
7368
- */
7369
- var ContributionSectionSchema = object({
7370
- id: string(),
7371
- title: string(),
7372
- description: string().optional(),
7373
- style: _enum(["card", "accordion"]).optional(),
7374
- defaultCollapsed: boolean().optional(),
7375
- columns: union([
7376
- literal(1),
7377
- literal(2),
7378
- literal(3),
7379
- literal(4)
7380
- ]).optional(),
7381
- tab: string().optional(),
7382
- location: _enum(["settings", "top-tab"]).optional(),
7383
- order: number().optional(),
7384
- fields: array(any())
7385
- });
7386
- object({
7387
- tabs: array(object({
7388
- id: string(),
7389
- label: string(),
7390
- icon: string(),
7391
- order: number().optional()
7392
- })).optional(),
7393
- sections: array(ContributionSectionSchema)
7394
- }).nullable();
7395
- object({ deviceId: number() }), object({ deviceId: number() }), object({
7396
- deviceId: number(),
7397
- patch: record(string(), unknown())
7398
- }), object({ success: literal(true) });
7399
- object({ deviceId: number() }), unknown().nullable();
7400
- /** Shorthand to define a method schema */
7401
- function method(input, output, options) {
7402
- return {
7403
- input,
7404
- output,
7405
- kind: options?.kind ?? "query",
7406
- auth: options?.auth ?? "protected",
7407
- ...options?.access !== void 0 ? { access: options.access } : {},
7408
- timeoutMs: options?.timeoutMs
7409
- };
7410
- }
7411
- /**
7412
7474
  * Alarm-panel cap. Models HA `alarm_control_panel.*` on
7413
7475
  * `DeviceType.AlarmPanel`. State follows HA's canonical lifecycle
7414
7476
  * across disarmed / armed_(home|away|night|vacation|custom_bypass) /
@@ -11410,9 +11472,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
11410
11472
  limit: number().optional(),
11411
11473
  tags: record(string(), string()).optional()
11412
11474
  }), array(LogEntrySchema).readonly());
11413
- var StaticDirOutputSchema = object({ staticDir: string() });
11414
- var VersionOutputSchema = object({ version: string() });
11415
- method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
11416
11475
  /**
11417
11476
  * Zod schemas for persisted record types.
11418
11477
  *
@@ -13738,7 +13797,7 @@ method(object({
13738
13797
  }), _void(), {
13739
13798
  kind: "mutation",
13740
13799
  auth: "admin"
13741
- }), 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({
13800
+ }), 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({
13742
13801
  deviceId: number(),
13743
13802
  values: record(string(), unknown())
13744
13803
  }), object({ success: literal(true) }), {
@@ -14420,7 +14479,20 @@ var DiskSpaceInfoSchema = object({
14420
14479
  var PidResourceStatsSchema = object({
14421
14480
  pid: number(),
14422
14481
  cpu: number(),
14423
- memory: number()
14482
+ memory: number(),
14483
+ /**
14484
+ * Private (anonymous) resident bytes — the per-process V8 heap + native
14485
+ * allocations NOT shared with other processes (Linux RssAnon). This is the
14486
+ * "real" per-runner cost; summing it across runners is meaningful, unlike
14487
+ * `memory` (RSS), which double-counts the shared mmap'd framework code.
14488
+ * Undefined where /proc is unavailable (e.g. macOS).
14489
+ */
14490
+ privateBytes: number().optional(),
14491
+ /**
14492
+ * Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
14493
+ * code shared copy-on-write across runners. Undefined on macOS.
14494
+ */
14495
+ sharedBytes: number().optional()
14424
14496
  });
14425
14497
  var AddonInstanceSchema = object({
14426
14498
  addonId: string(),
@@ -14469,6 +14541,17 @@ var KillProcessResultSchema = object({
14469
14541
  reason: string().optional(),
14470
14542
  signal: _enum(["SIGTERM", "SIGKILL"]).optional()
14471
14543
  });
14544
+ var DumpHeapSnapshotInputSchema = object({
14545
+ /** The addon whose runner should dump a heap snapshot. */
14546
+ addonId: string() });
14547
+ var DumpHeapSnapshotResultSchema = object({
14548
+ success: boolean(),
14549
+ /** Path of the written .heapsnapshot inside the runner's container/host. */
14550
+ path: string().optional(),
14551
+ /** Process pid that was signalled. */
14552
+ pid: number().optional(),
14553
+ reason: string().optional()
14554
+ });
14472
14555
  var SystemMetricsSchema = object({
14473
14556
  cpuPercent: number(),
14474
14557
  memoryPercent: number(),
@@ -14482,6 +14565,9 @@ var SystemMetricsSchema = object({
14482
14565
  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, {
14483
14566
  kind: "mutation",
14484
14567
  auth: "admin"
14568
+ }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
14569
+ kind: "mutation",
14570
+ auth: "admin"
14485
14571
  });
14486
14572
  var PtzPresetSchema = object({
14487
14573
  id: string(),
@@ -14848,63 +14934,6 @@ method(object({
14848
14934
  auth: "admin"
14849
14935
  });
14850
14936
  /**
14851
- * device-ops — device-scoped cap that unifies the per-IDevice operations
14852
- * previously routed through the `.device-ops` Moleculer bridge service.
14853
- *
14854
- * Each worker that hosts live `IDevice` instances auto-registers a native
14855
- * provider for this cap (per device) backed by its local
14856
- * `DeviceRegistry`. Hub-side callers reach it transparently through
14857
- * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
14858
- * `deviceId` + `nodeId` and dispatches through the standard cap-router,
14859
- * so there's no parallel bridge path anymore.
14860
- *
14861
- * The surface is intentionally small — every method corresponds to a
14862
- * single action on the live `IDevice` (or `ICameraDevice` for
14863
- * `getStreamSources`). Richer orchestration (enable/disable with
14864
- * integration plumbing, bulk updates) stays in the `device-manager` cap;
14865
- * `device-ops` is the per-device primitive the device-manager routes to.
14866
- */
14867
- var StreamSourceEntrySchema$1 = object({
14868
- id: string(),
14869
- label: string(),
14870
- protocol: _enum([
14871
- "rtsp",
14872
- "rtmp",
14873
- "annexb",
14874
- "http-mjpeg",
14875
- "webrtc",
14876
- "custom"
14877
- ]),
14878
- url: string().optional(),
14879
- resolution: object({
14880
- width: number(),
14881
- height: number()
14882
- }).optional(),
14883
- fps: number().optional(),
14884
- bitrate: number().optional(),
14885
- codec: string().optional(),
14886
- profileHint: CamProfileSchema.optional(),
14887
- sdp: string().optional()
14888
- });
14889
- var ConfigEntrySchema$1 = object({
14890
- key: string(),
14891
- value: unknown()
14892
- });
14893
- var RawStateResultSchema = object({
14894
- /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
14895
- source: string(),
14896
- /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
14897
- data: record(string(), unknown())
14898
- });
14899
- method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
14900
- deviceId: number(),
14901
- values: record(string(), unknown())
14902
- }), _void(), { kind: "mutation" }), method(object({
14903
- deviceId: number(),
14904
- action: string().min(1),
14905
- input: unknown()
14906
- }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
14907
- /**
14908
14937
  * camera-credentials — device-scoped cap exposing the camera's network
14909
14938
  * + auth surface in a vendor-neutral shape.
14910
14939
  *
@@ -18587,6 +18616,12 @@ Object.freeze({
18587
18616
  addonId: null,
18588
18617
  access: "view"
18589
18618
  },
18619
+ "metricsProvider.dumpHeapSnapshot": {
18620
+ capName: "metrics-provider",
18621
+ capScope: "system",
18622
+ addonId: null,
18623
+ access: "create"
18624
+ },
18590
18625
  "metricsProvider.getAddonStats": {
18591
18626
  capName: "metrics-provider",
18592
18627
  capScope: "system",