@camstack/addon-export-ha-mqtt 1.0.5 → 1.0.7

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