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