@camstack/addon-provider-homematic 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.
package/dist/addon.js CHANGED
@@ -4651,63 +4651,7 @@ function preprocess(fn, schema) {
4651
4651
  });
4652
4652
  }
4653
4653
  //#endregion
4654
- //#region ../types/dist/index.mjs
4655
- /**
4656
- * Deep wiring healthcheck — snapshot of active reachability probes across
4657
- * every declared capability + widget of every installed plugin, on every
4658
- * node. Produced by the backend `WiringHealthService` and surfaced via
4659
- * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
4660
- *
4661
- * Unlike `/health` (process liveness), this reflects whether each cap/widget
4662
- * is actually *reachable* over the real cap-dispatch path. See spec
4663
- * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
4664
- */
4665
- /** What kind of target a probe addressed. */
4666
- var wiringProbeKindSchema = _enum([
4667
- "singleton",
4668
- "device",
4669
- "widget"
4670
- ]);
4671
- /** Result of probing a single (cap|widget [, device]) target. */
4672
- var wiringProbeResultSchema = object({
4673
- capName: string(),
4674
- kind: wiringProbeKindSchema,
4675
- deviceId: number().optional(),
4676
- reachable: boolean(),
4677
- latencyMs: number(),
4678
- error: string().optional()
4679
- });
4680
- /** Per-addon roll-up of cap + widget probe results. */
4681
- var wiringAddonHealthSchema = object({
4682
- addonId: string(),
4683
- caps: array(wiringProbeResultSchema).readonly(),
4684
- widgets: array(wiringProbeResultSchema).readonly()
4685
- });
4686
- /** Per-node roll-up. */
4687
- var wiringNodeHealthSchema = object({
4688
- nodeId: string(),
4689
- addons: array(wiringAddonHealthSchema).readonly()
4690
- });
4691
- object({
4692
- /** True only when every probed target is reachable. */
4693
- ok: boolean(),
4694
- /** True when at least one target is unreachable. */
4695
- degraded: boolean(),
4696
- checkedAt: string(),
4697
- nodes: array(wiringNodeHealthSchema).readonly(),
4698
- summary: object({
4699
- total: number(),
4700
- reachable: number(),
4701
- unreachable: number()
4702
- })
4703
- });
4704
- var MODEL_FORMATS = [
4705
- "onnx",
4706
- "coreml",
4707
- "openvino",
4708
- "tflite",
4709
- "pt"
4710
- ];
4654
+ //#region ../types/dist/sleep-B1dKJAMJ.mjs
4711
4655
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4712
4656
  EventCategory["SystemBoot"] = "system.boot";
4713
4657
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5681,7 +5625,7 @@ var BaseAddon = class {
5681
5625
  deviceSettingsSchema() {
5682
5626
  return null;
5683
5627
  }
5684
- async getGlobalSettings(overlay, cap) {
5628
+ async getGlobalSettings(overlay, cap, _nodeId) {
5685
5629
  const schema = this.globalSettingsSchema(cap);
5686
5630
  if (!schema) return { sections: [] };
5687
5631
  const raw = await this._ctx?.settings?.readAddonStore() ?? {};
@@ -5690,7 +5634,7 @@ var BaseAddon = class {
5690
5634
  ...overlay
5691
5635
  } : raw);
5692
5636
  }
5693
- async updateGlobalSettings(patch) {
5637
+ async updateGlobalSettings(patch, _nodeId) {
5694
5638
  await this._ctx?.settings?.writeAddonStore(patch);
5695
5639
  await this.resolveConfig();
5696
5640
  await this.onConfigChanged();
@@ -6030,7 +5974,7 @@ var ProfileSlotSchema = object({
6030
5974
  * Zod schema for StreamSourceEntry — the canonical stream descriptor
6031
5975
  * exposed by ICameraDevice.getStreamSources() and consumed by the broker.
6032
5976
  */
6033
- var StreamSourceEntrySchema = object({
5977
+ var StreamSourceEntrySchema$1 = object({
6034
5978
  id: string(),
6035
5979
  label: string(),
6036
5980
  protocol: _enum([
@@ -6252,6 +6196,484 @@ var ProfileRtspEntrySchema = object({
6252
6196
  codec: string().optional(),
6253
6197
  resolution: CamStreamResolutionSchema.optional()
6254
6198
  });
6199
+ var DeviceType = /* @__PURE__ */ function(DeviceType) {
6200
+ DeviceType["Camera"] = "camera";
6201
+ DeviceType["Hub"] = "hub";
6202
+ DeviceType["Light"] = "light";
6203
+ DeviceType["Siren"] = "siren";
6204
+ DeviceType["Switch"] = "switch";
6205
+ DeviceType["Sensor"] = "sensor";
6206
+ DeviceType["Thermostat"] = "thermostat";
6207
+ DeviceType["Button"] = "button";
6208
+ /** Generic stateless event emitter — carries a device's EXACT declared
6209
+ * event vocabulary verbatim (no normalization). Installed with the
6210
+ * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6211
+ * HA bus events (e.g. `zha_event`, generic). */
6212
+ DeviceType["EventEmitter"] = "event-emitter";
6213
+ /** Firmware/software update entity — current vs available version,
6214
+ * updatable flag, update state, and an install action. Installed with
6215
+ * the `update` cap. Sources: Homematic firmware-update channels (and
6216
+ * reusable by other providers, e.g. HA `update.*` entities). */
6217
+ DeviceType["Update"] = "update";
6218
+ DeviceType["Generic"] = "generic";
6219
+ /** Generic notification delivery target (HA `notify.<service>`, future
6220
+ * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6221
+ * endpoint; the `notifier` cap defines the send surface. */
6222
+ DeviceType["Notifier"] = "notifier";
6223
+ /** Pre-recorded action sequence with optional parameters
6224
+ * (HA `script.*`). Runnable via `script-runner` cap. */
6225
+ DeviceType["Script"] = "script";
6226
+ /** Automation rule (HA `automation.*`) — enable/disable + manual
6227
+ * trigger surface exposed via `automation-control` cap. */
6228
+ DeviceType["Automation"] = "automation";
6229
+ /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6230
+ DeviceType["Lock"] = "lock";
6231
+ /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6232
+ * `valve.*`). `cover` cap with sub-roles for variant. */
6233
+ DeviceType["Cover"] = "cover";
6234
+ /** Pipe / water / gas valve with open/close/stop and optional
6235
+ * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6236
+ * modelled on the same open/closed lifecycle. */
6237
+ DeviceType["Valve"] = "valve";
6238
+ /** Humidifier / dehumidifier with on/off + target humidity + mode
6239
+ * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6240
+ * modelled on the same target / mode lifecycle. */
6241
+ DeviceType["Humidifier"] = "humidifier";
6242
+ /** Water heater / boiler with target temperature + operation mode +
6243
+ * away mode (HA `water_heater.*`). `water-heater` cap — a
6244
+ * climate-family actuator. */
6245
+ DeviceType["WaterHeater"] = "water-heater";
6246
+ /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6247
+ DeviceType["Fan"] = "fan";
6248
+ /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6249
+ * the camera surface — those use `Camera`. `media-player` cap. */
6250
+ DeviceType["MediaPlayer"] = "media-player";
6251
+ /** Security panel / alarm system (HA `alarm_control_panel.*`).
6252
+ * `alarm-panel` cap. */
6253
+ DeviceType["AlarmPanel"] = "alarm-panel";
6254
+ /** Generic user-settable input (HA `number` / `input_number` / `select`
6255
+ * / `input_select` / `text` / `input_text` / `input_datetime`).
6256
+ * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6257
+ * TextControl / DateTimeControl. */
6258
+ DeviceType["Control"] = "control";
6259
+ /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6260
+ * `presence` cap. */
6261
+ DeviceType["Presence"] = "presence";
6262
+ /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6263
+ * `weather` cap. */
6264
+ DeviceType["Weather"] = "weather";
6265
+ /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6266
+ DeviceType["Vacuum"] = "vacuum";
6267
+ /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6268
+ * `lawn-mower-control` cap. */
6269
+ DeviceType["LawnMower"] = "lawn-mower";
6270
+ /** Physical HA device group — parent container for entity-children
6271
+ * adopted from a single HA device entry. Not renderable as a
6272
+ * standalone device; exists only to anchor child entities. */
6273
+ DeviceType["Container"] = "container";
6274
+ /** Single still-image entity (HA `image.*`). Read-only display of an
6275
+ * `entity_picture` signed URL the browser loads directly. `image` cap. */
6276
+ DeviceType["Image"] = "image";
6277
+ return DeviceType;
6278
+ }({});
6279
+ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6280
+ DeviceFeature["BatteryOperated"] = "battery-operated";
6281
+ DeviceFeature["Rebootable"] = "rebootable";
6282
+ /**
6283
+ * Device supports an on-demand re-sync of its derived spec with its
6284
+ * upstream source — drives the generic Re-sync button. The owning
6285
+ * provider implements the action via the `device-adoption.resync` cap.
6286
+ */
6287
+ DeviceFeature["Resyncable"] = "resyncable";
6288
+ DeviceFeature["NativeSnapshot"] = "native-snapshot";
6289
+ DeviceFeature["DoorbellButton"] = "doorbell-button";
6290
+ DeviceFeature["TwoWayAudio"] = "two-way-audio";
6291
+ DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6292
+ /**
6293
+ * Camera supports the on-firmware autotrack subsystem (subject-
6294
+ * following). Distinct from `PanTiltZoom` because not every PTZ
6295
+ * camera ships autotrack — the admin UI uses this flag to gate
6296
+ * the autotrack toggle / settings card without re-deriving from
6297
+ * the cap registry. Mirrors `ptz-autotrack` cap registration:
6298
+ * driver sets this feature when probe confirms the firmware
6299
+ * surface, and registers the cap in the same code path.
6300
+ */
6301
+ DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6302
+ /**
6303
+ * Accessory exposes a "trigger on motion" toggle — the parent camera's
6304
+ * motion detection automatically activates this device. Mirrors
6305
+ * `motion-trigger` cap registration: drivers set this feature in the
6306
+ * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6307
+ *
6308
+ * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6309
+ * fast scalar without binding fetch), notifier rules, and `listAll`
6310
+ * filters that want "all devices with on-motion behaviour".
6311
+ */
6312
+ DeviceFeature["MotionTrigger"] = "motion-trigger";
6313
+ /** Light supports rgb-triplet color via `color` cap. */
6314
+ DeviceFeature["LightColorRgb"] = "light-color-rgb";
6315
+ /** Light supports HSV color via `color` cap. */
6316
+ DeviceFeature["LightColorHsv"] = "light-color-hsv";
6317
+ /** Light supports color-temperature (mired) via `color` cap. */
6318
+ DeviceFeature["LightColorMired"] = "light-color-mired";
6319
+ /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6320
+ * targetHigh). Gates the range slider UI. */
6321
+ DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6322
+ /** Thermostat exposes target humidity and/or current humidity
6323
+ * readings. Gates the humidity controls. */
6324
+ DeviceFeature["ClimateHumidity"] = "climate-humidity";
6325
+ /** Thermostat exposes a fan-mode selector. */
6326
+ DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6327
+ /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6328
+ DeviceFeature["ClimatePreset"] = "climate-preset";
6329
+ /** Cover exposes intermediate position control (0..100). Gates the
6330
+ * position slider UI. */
6331
+ DeviceFeature["CoverPositionable"] = "cover-positionable";
6332
+ /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6333
+ DeviceFeature["CoverTilt"] = "cover-tilt";
6334
+ /** Valve exposes intermediate position control (0..100). Gates the
6335
+ * position slider / drag surface UI. */
6336
+ DeviceFeature["ValvePositionable"] = "valve-positionable";
6337
+ /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6338
+ DeviceFeature["FanSpeed"] = "fan-speed";
6339
+ /** Fan exposes a preset mode selector. */
6340
+ DeviceFeature["FanPreset"] = "fan-preset";
6341
+ /** Fan exposes blade direction (forward/reverse) — typical of
6342
+ * ceiling fans. */
6343
+ DeviceFeature["FanDirection"] = "fan-direction";
6344
+ /** Fan exposes an oscillation toggle. */
6345
+ DeviceFeature["FanOscillating"] = "fan-oscillating";
6346
+ /** Lock requires a PIN code on lock/unlock. Gates the code-entry
6347
+ * field on the UI lock-controls panel. */
6348
+ DeviceFeature["LockPinRequired"] = "lock-pin-required";
6349
+ /** Lock supports a latch-release ("open door") action distinct from
6350
+ * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
6351
+ * `supported_features`. Gates the Open Door button in the UI. */
6352
+ DeviceFeature["LockOpen"] = "lock-open";
6353
+ /** Media player exposes a seek-to-position surface. */
6354
+ DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
6355
+ /** Media player exposes a volume-level setter. */
6356
+ DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
6357
+ /** Media player exposes a mute toggle distinct from volume=0. */
6358
+ DeviceFeature["MediaPlayerMute"] = "media-player-mute";
6359
+ /** Media player exposes a shuffle toggle. */
6360
+ DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
6361
+ /** Media player exposes a repeat mode (off / all / one). */
6362
+ DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
6363
+ /** Media player exposes a source / input selector. */
6364
+ DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
6365
+ /** Media player exposes a play-arbitrary-media surface (URL / id). */
6366
+ DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
6367
+ /** Media player exposes next-track. */
6368
+ DeviceFeature["MediaPlayerNext"] = "media-player-next";
6369
+ /** Media player exposes previous-track. */
6370
+ DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
6371
+ /** Media player exposes stop distinct from pause. */
6372
+ DeviceFeature["MediaPlayerStop"] = "media-player-stop";
6373
+ /** Alarm panel requires a PIN code on arm/disarm. */
6374
+ DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
6375
+ /** Presence device carries GPS coordinates (lat/lng/accuracy) in
6376
+ * addition to a textual location. */
6377
+ DeviceFeature["PresenceGps"] = "presence-gps";
6378
+ /** Notifier accepts an inline / URL image attachment. */
6379
+ DeviceFeature["NotifierImage"] = "notifier-image";
6380
+ /** Notifier accepts a priority hint (high/normal/low). */
6381
+ DeviceFeature["NotifierPriority"] = "notifier-priority";
6382
+ /** Notifier accepts a free-form `data` payload for platform-specific
6383
+ * fields. */
6384
+ DeviceFeature["NotifierData"] = "notifier-data";
6385
+ /** Notifier supports interactive action buttons / callbacks. */
6386
+ DeviceFeature["NotifierActions"] = "notifier-actions";
6387
+ /** Notifier supports per-call recipient targeting (multi-user). */
6388
+ DeviceFeature["NotifierRecipients"] = "notifier-recipients";
6389
+ /** Script runner accepts a variables map on each run invocation. */
6390
+ DeviceFeature["ScriptVariables"] = "script-variables";
6391
+ /** Automation `trigger` accepts a skipCondition flag — fires the
6392
+ * automation's actions while bypassing its condition block. */
6393
+ DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
6394
+ return DeviceFeature;
6395
+ }({});
6396
+ /**
6397
+ * Semantic role a device plays within its parent. Populated by driver
6398
+ * addons when creating accessory devices (Reolink siren/floodlight/
6399
+ * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
6400
+ * admin UI to pick icons, labels, and widgets — a `Switch` with
6401
+ * `role: Floodlight` renders as a bulb with a brightness slider,
6402
+ * whereas a `Switch` with `role: Siren` renders as a klaxon.
6403
+ *
6404
+ * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
6405
+ * sqlite as a nullable TEXT column — old rows keep working unchanged.
6406
+ */
6407
+ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
6408
+ DeviceRole["Siren"] = "siren";
6409
+ DeviceRole["Floodlight"] = "floodlight";
6410
+ DeviceRole["Spotlight"] = "spotlight";
6411
+ DeviceRole["PirSensor"] = "pir-sensor";
6412
+ DeviceRole["Chime"] = "chime";
6413
+ DeviceRole["Autotrack"] = "autotrack";
6414
+ DeviceRole["Nightvision"] = "nightvision";
6415
+ DeviceRole["PrivacyMask"] = "privacy-mask";
6416
+ DeviceRole["Doorbell"] = "doorbell";
6417
+ /** Virtual HA toggle (input_boolean.*) — distinguishable from a
6418
+ * real Switch device for UI rendering / export adapters. */
6419
+ DeviceRole["BinaryHelper"] = "binary-helper";
6420
+ /** Generic motion / occupancy / moving event source. Distinct from
6421
+ * the camera accessory PirSensor role: that one is a camera child;
6422
+ * this is a standalone HA / 3rd-party motion sensor. */
6423
+ DeviceRole["MotionSensor"] = "motion-sensor";
6424
+ DeviceRole["ContactSensor"] = "contact-sensor";
6425
+ DeviceRole["LeakSensor"] = "leak-sensor";
6426
+ DeviceRole["SmokeSensor"] = "smoke-sensor";
6427
+ DeviceRole["COSensor"] = "co-sensor";
6428
+ DeviceRole["GasSensor"] = "gas-sensor";
6429
+ DeviceRole["TamperSensor"] = "tamper-sensor";
6430
+ DeviceRole["VibrationSensor"] = "vibration-sensor";
6431
+ DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
6432
+ DeviceRole["SoundSensor"] = "sound-sensor";
6433
+ /** Fallback for `binary_sensor` without a known `device_class`. */
6434
+ DeviceRole["BinarySensor"] = "binary-sensor";
6435
+ DeviceRole["TemperatureSensor"] = "temperature-sensor";
6436
+ DeviceRole["HumiditySensor"] = "humidity-sensor";
6437
+ DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
6438
+ DeviceRole["PressureSensor"] = "pressure-sensor";
6439
+ DeviceRole["PowerSensor"] = "power-sensor";
6440
+ DeviceRole["EnergySensor"] = "energy-sensor";
6441
+ DeviceRole["VoltageSensor"] = "voltage-sensor";
6442
+ DeviceRole["CurrentSensor"] = "current-sensor";
6443
+ DeviceRole["AirQualitySensor"] = "air-quality-sensor";
6444
+ /** Battery level (numeric % via `sensor` OR low-bool via
6445
+ * `binary_sensor` — the cap distinguishes via the value type). */
6446
+ DeviceRole["BatterySensor"] = "battery-sensor";
6447
+ /** Fallback for `sensor` numeric without a known `device_class`. */
6448
+ DeviceRole["NumericSensor"] = "numeric-sensor";
6449
+ /** String / enum state (HA `sensor` with `state_class: enum` or
6450
+ * `attributes.options`). */
6451
+ DeviceRole["EnumSensor"] = "enum-sensor";
6452
+ /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
6453
+ * or `date`). The slice carries the raw ISO string verbatim (hosted on
6454
+ * the `enum-sensor` cap); the UI renders it locale-formatted. */
6455
+ DeviceRole["DateTimeSensor"] = "datetime-sensor";
6456
+ /** Last-resort fallback when nothing else matches. */
6457
+ DeviceRole["GenericSensor"] = "generic-sensor";
6458
+ DeviceRole["NumericControl"] = "numeric-control";
6459
+ DeviceRole["SelectControl"] = "select-control";
6460
+ DeviceRole["TextControl"] = "text-control";
6461
+ DeviceRole["DateTimeControl"] = "datetime-control";
6462
+ /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
6463
+ * rich features (image, priority, channel routing). */
6464
+ DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
6465
+ /** Chat / messaging service (HA `notify.telegram_*`,
6466
+ * `notify.discord_*`, etc.). */
6467
+ DeviceRole["MessagingNotifier"] = "messaging-notifier";
6468
+ /** Email-based delivery (HA `notify.smtp`, etc.). */
6469
+ DeviceRole["EmailNotifier"] = "email-notifier";
6470
+ /** Fallback when the notifier service name doesn't match a known
6471
+ * pattern. */
6472
+ DeviceRole["GenericNotifier"] = "generic-notifier";
6473
+ return DeviceRole;
6474
+ }({});
6475
+ /**
6476
+ * Generic types for capability definitions.
6477
+ *
6478
+ * A capability is defined with Zod schemas for methods, events, and settings.
6479
+ * TypeScript types are inferred via z.infer<> — zero duplication.
6480
+ *
6481
+ * Pattern:
6482
+ * 1. Define Zod schemas for data, methods, settings
6483
+ * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
6484
+ * 3. Export type IProvider = InferProvider<typeof capabilityDef>
6485
+ * 4. Addon implements IProvider
6486
+ * 5. Registry auto-mounts tRPC router from definition.methods
6487
+ */
6488
+ /**
6489
+ * Output schema shared by the contribution + live methods.
6490
+ *
6491
+ * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
6492
+ * tabs[]) without importing from `../interfaces/config-ui.js` — a
6493
+ * concrete-but-lenient Zod object keeps tRPC output inference happy
6494
+ * (using `z.unknown()` here collapses unrelated router branches to
6495
+ * `unknown` when the generator re-inlines the huge AppRouter type).
6496
+ *
6497
+ * `.passthrough()` on sections/fields accepts whatever FormBuilder
6498
+ * extensions the caller adds (showWhen, displayScale, …) without
6499
+ * rebuilding every time a new field kind is introduced.
6500
+ */
6501
+ var ContributionSectionSchema = object({
6502
+ id: string(),
6503
+ title: string(),
6504
+ description: string().optional(),
6505
+ style: _enum(["card", "accordion"]).optional(),
6506
+ defaultCollapsed: boolean().optional(),
6507
+ columns: union([
6508
+ literal(1),
6509
+ literal(2),
6510
+ literal(3),
6511
+ literal(4)
6512
+ ]).optional(),
6513
+ tab: string().optional(),
6514
+ location: _enum(["settings", "top-tab"]).optional(),
6515
+ order: number().optional(),
6516
+ fields: array(any())
6517
+ });
6518
+ object({
6519
+ tabs: array(object({
6520
+ id: string(),
6521
+ label: string(),
6522
+ icon: string(),
6523
+ order: number().optional()
6524
+ })).optional(),
6525
+ sections: array(ContributionSectionSchema)
6526
+ }).nullable();
6527
+ object({ deviceId: number() }), object({ deviceId: number() }), object({
6528
+ deviceId: number(),
6529
+ patch: record(string(), unknown())
6530
+ }), object({ success: literal(true) });
6531
+ object({ deviceId: number() }), unknown().nullable();
6532
+ /** Shorthand to define a method schema */
6533
+ function method(input, output, options) {
6534
+ return {
6535
+ input,
6536
+ output,
6537
+ kind: options?.kind ?? "query",
6538
+ auth: options?.auth ?? "protected",
6539
+ ...options?.access !== void 0 ? { access: options.access } : {},
6540
+ timeoutMs: options?.timeoutMs
6541
+ };
6542
+ }
6543
+ /** Shorthand to define an event schema */
6544
+ function event(data) {
6545
+ return { data };
6546
+ }
6547
+ var StaticDirOutputSchema = object({ staticDir: string() });
6548
+ var VersionOutputSchema = object({ version: string() });
6549
+ method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
6550
+ /**
6551
+ * device-ops — device-scoped cap that unifies the per-IDevice operations
6552
+ * previously routed through the `.device-ops` Moleculer bridge service.
6553
+ *
6554
+ * Each worker that hosts live `IDevice` instances auto-registers a native
6555
+ * provider for this cap (per device) backed by its local
6556
+ * `DeviceRegistry`. Hub-side callers reach it transparently through
6557
+ * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
6558
+ * `deviceId` + `nodeId` and dispatches through the standard cap-router,
6559
+ * so there's no parallel bridge path anymore.
6560
+ *
6561
+ * The surface is intentionally small — every method corresponds to a
6562
+ * single action on the live `IDevice` (or `ICameraDevice` for
6563
+ * `getStreamSources`). Richer orchestration (enable/disable with
6564
+ * integration plumbing, bulk updates) stays in the `device-manager` cap;
6565
+ * `device-ops` is the per-device primitive the device-manager routes to.
6566
+ */
6567
+ var StreamSourceEntrySchema = object({
6568
+ id: string(),
6569
+ label: string(),
6570
+ protocol: _enum([
6571
+ "rtsp",
6572
+ "rtmp",
6573
+ "annexb",
6574
+ "http-mjpeg",
6575
+ "webrtc",
6576
+ "custom"
6577
+ ]),
6578
+ url: string().optional(),
6579
+ resolution: object({
6580
+ width: number(),
6581
+ height: number()
6582
+ }).optional(),
6583
+ fps: number().optional(),
6584
+ bitrate: number().optional(),
6585
+ codec: string().optional(),
6586
+ profileHint: CamProfileSchema.optional(),
6587
+ sdp: string().optional()
6588
+ });
6589
+ var ConfigEntrySchema$1 = object({
6590
+ key: string(),
6591
+ value: unknown()
6592
+ });
6593
+ var RawStateResultSchema = object({
6594
+ /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
6595
+ source: string(),
6596
+ /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
6597
+ data: record(string(), unknown())
6598
+ });
6599
+ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
6600
+ deviceId: number(),
6601
+ values: record(string(), unknown())
6602
+ }), _void(), { kind: "mutation" }), method(object({
6603
+ deviceId: number(),
6604
+ action: string().min(1),
6605
+ input: unknown()
6606
+ }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
6607
+ //#endregion
6608
+ //#region ../types/dist/err-msg-IQTHeDzc.mjs
6609
+ /**
6610
+ import { errMsg } from '@camstack/types'
6611
+ * Extract a human-readable message from an unknown error value.
6612
+ * Replaces the ubiquitous `errMsg(err)` pattern.
6613
+ */
6614
+ function errMsg(err) {
6615
+ if (err instanceof Error) return err.message;
6616
+ if (typeof err === "string") return err;
6617
+ return String(err);
6618
+ }
6619
+ //#endregion
6620
+ //#region ../types/dist/index.mjs
6621
+ /**
6622
+ * Deep wiring healthcheck — snapshot of active reachability probes across
6623
+ * every declared capability + widget of every installed plugin, on every
6624
+ * node. Produced by the backend `WiringHealthService` and surfaced via
6625
+ * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
6626
+ *
6627
+ * Unlike `/health` (process liveness), this reflects whether each cap/widget
6628
+ * is actually *reachable* over the real cap-dispatch path. See spec
6629
+ * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
6630
+ */
6631
+ /** What kind of target a probe addressed. */
6632
+ var wiringProbeKindSchema = _enum([
6633
+ "singleton",
6634
+ "device",
6635
+ "widget"
6636
+ ]);
6637
+ /** Result of probing a single (cap|widget [, device]) target. */
6638
+ var wiringProbeResultSchema = object({
6639
+ capName: string(),
6640
+ kind: wiringProbeKindSchema,
6641
+ deviceId: number().optional(),
6642
+ reachable: boolean(),
6643
+ latencyMs: number(),
6644
+ error: string().optional()
6645
+ });
6646
+ /** Per-addon roll-up of cap + widget probe results. */
6647
+ var wiringAddonHealthSchema = object({
6648
+ addonId: string(),
6649
+ caps: array(wiringProbeResultSchema).readonly(),
6650
+ widgets: array(wiringProbeResultSchema).readonly()
6651
+ });
6652
+ /** Per-node roll-up. */
6653
+ var wiringNodeHealthSchema = object({
6654
+ nodeId: string(),
6655
+ addons: array(wiringAddonHealthSchema).readonly()
6656
+ });
6657
+ object({
6658
+ /** True only when every probed target is reachable. */
6659
+ ok: boolean(),
6660
+ /** True when at least one target is unreachable. */
6661
+ degraded: boolean(),
6662
+ checkedAt: string(),
6663
+ nodes: array(wiringNodeHealthSchema).readonly(),
6664
+ summary: object({
6665
+ total: number(),
6666
+ reachable: number(),
6667
+ unreachable: number()
6668
+ })
6669
+ });
6670
+ var MODEL_FORMATS = [
6671
+ "onnx",
6672
+ "coreml",
6673
+ "openvino",
6674
+ "tflite",
6675
+ "pt"
6676
+ ];
6255
6677
  /**
6256
6678
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6257
6679
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -6599,16 +7021,6 @@ var EncodeProfileSchema = object({
6599
7021
  */
6600
7022
  outputArgs: array(string()).optional()
6601
7023
  });
6602
- /**
6603
- import { errMsg } from '@camstack/types'
6604
- * Extract a human-readable message from an unknown error value.
6605
- * Replaces the ubiquitous `errMsg(err)` pattern.
6606
- */
6607
- function errMsg(err) {
6608
- if (err instanceof Error) return err.message;
6609
- if (typeof err === "string") return err;
6610
- return String(err);
6611
- }
6612
7024
  var YAMNET_TO_MACRO = {
6613
7025
  mapping: {
6614
7026
  Speech: "speech",
@@ -6874,282 +7286,6 @@ var APPLE_SA_TO_MACRO = {
6874
7286
  var _macroLookup = /* @__PURE__ */ new Map();
6875
7287
  for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6876
7288
  for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6877
- var DeviceType = /* @__PURE__ */ function(DeviceType) {
6878
- DeviceType["Camera"] = "camera";
6879
- DeviceType["Hub"] = "hub";
6880
- DeviceType["Light"] = "light";
6881
- DeviceType["Siren"] = "siren";
6882
- DeviceType["Switch"] = "switch";
6883
- DeviceType["Sensor"] = "sensor";
6884
- DeviceType["Thermostat"] = "thermostat";
6885
- DeviceType["Button"] = "button";
6886
- /** Generic stateless event emitter — carries a device's EXACT declared
6887
- * event vocabulary verbatim (no normalization). Installed with the
6888
- * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6889
- * HA bus events (e.g. `zha_event`, generic). */
6890
- DeviceType["EventEmitter"] = "event-emitter";
6891
- /** Firmware/software update entity — current vs available version,
6892
- * updatable flag, update state, and an install action. Installed with
6893
- * the `update` cap. Sources: Homematic firmware-update channels (and
6894
- * reusable by other providers, e.g. HA `update.*` entities). */
6895
- DeviceType["Update"] = "update";
6896
- DeviceType["Generic"] = "generic";
6897
- /** Generic notification delivery target (HA `notify.<service>`, future
6898
- * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6899
- * endpoint; the `notifier` cap defines the send surface. */
6900
- DeviceType["Notifier"] = "notifier";
6901
- /** Pre-recorded action sequence with optional parameters
6902
- * (HA `script.*`). Runnable via `script-runner` cap. */
6903
- DeviceType["Script"] = "script";
6904
- /** Automation rule (HA `automation.*`) — enable/disable + manual
6905
- * trigger surface exposed via `automation-control` cap. */
6906
- DeviceType["Automation"] = "automation";
6907
- /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6908
- DeviceType["Lock"] = "lock";
6909
- /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6910
- * `valve.*`). `cover` cap with sub-roles for variant. */
6911
- DeviceType["Cover"] = "cover";
6912
- /** Pipe / water / gas valve with open/close/stop and optional
6913
- * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6914
- * modelled on the same open/closed lifecycle. */
6915
- DeviceType["Valve"] = "valve";
6916
- /** Humidifier / dehumidifier with on/off + target humidity + mode
6917
- * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6918
- * modelled on the same target / mode lifecycle. */
6919
- DeviceType["Humidifier"] = "humidifier";
6920
- /** Water heater / boiler with target temperature + operation mode +
6921
- * away mode (HA `water_heater.*`). `water-heater` cap — a
6922
- * climate-family actuator. */
6923
- DeviceType["WaterHeater"] = "water-heater";
6924
- /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6925
- DeviceType["Fan"] = "fan";
6926
- /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6927
- * the camera surface — those use `Camera`. `media-player` cap. */
6928
- DeviceType["MediaPlayer"] = "media-player";
6929
- /** Security panel / alarm system (HA `alarm_control_panel.*`).
6930
- * `alarm-panel` cap. */
6931
- DeviceType["AlarmPanel"] = "alarm-panel";
6932
- /** Generic user-settable input (HA `number` / `input_number` / `select`
6933
- * / `input_select` / `text` / `input_text` / `input_datetime`).
6934
- * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6935
- * TextControl / DateTimeControl. */
6936
- DeviceType["Control"] = "control";
6937
- /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6938
- * `presence` cap. */
6939
- DeviceType["Presence"] = "presence";
6940
- /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6941
- * `weather` cap. */
6942
- DeviceType["Weather"] = "weather";
6943
- /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6944
- DeviceType["Vacuum"] = "vacuum";
6945
- /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6946
- * `lawn-mower-control` cap. */
6947
- DeviceType["LawnMower"] = "lawn-mower";
6948
- /** Physical HA device group — parent container for entity-children
6949
- * adopted from a single HA device entry. Not renderable as a
6950
- * standalone device; exists only to anchor child entities. */
6951
- DeviceType["Container"] = "container";
6952
- /** Single still-image entity (HA `image.*`). Read-only display of an
6953
- * `entity_picture` signed URL the browser loads directly. `image` cap. */
6954
- DeviceType["Image"] = "image";
6955
- return DeviceType;
6956
- }({});
6957
- var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6958
- DeviceFeature["BatteryOperated"] = "battery-operated";
6959
- DeviceFeature["Rebootable"] = "rebootable";
6960
- /**
6961
- * Device supports an on-demand re-sync of its derived spec with its
6962
- * upstream source — drives the generic Re-sync button. The owning
6963
- * provider implements the action via the `device-adoption.resync` cap.
6964
- */
6965
- DeviceFeature["Resyncable"] = "resyncable";
6966
- DeviceFeature["NativeSnapshot"] = "native-snapshot";
6967
- DeviceFeature["DoorbellButton"] = "doorbell-button";
6968
- DeviceFeature["TwoWayAudio"] = "two-way-audio";
6969
- DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6970
- /**
6971
- * Camera supports the on-firmware autotrack subsystem (subject-
6972
- * following). Distinct from `PanTiltZoom` because not every PTZ
6973
- * camera ships autotrack — the admin UI uses this flag to gate
6974
- * the autotrack toggle / settings card without re-deriving from
6975
- * the cap registry. Mirrors `ptz-autotrack` cap registration:
6976
- * driver sets this feature when probe confirms the firmware
6977
- * surface, and registers the cap in the same code path.
6978
- */
6979
- DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6980
- /**
6981
- * Accessory exposes a "trigger on motion" toggle — the parent camera's
6982
- * motion detection automatically activates this device. Mirrors
6983
- * `motion-trigger` cap registration: drivers set this feature in the
6984
- * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6985
- *
6986
- * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6987
- * fast scalar without binding fetch), notifier rules, and `listAll`
6988
- * filters that want "all devices with on-motion behaviour".
6989
- */
6990
- DeviceFeature["MotionTrigger"] = "motion-trigger";
6991
- /** Light supports rgb-triplet color via `color` cap. */
6992
- DeviceFeature["LightColorRgb"] = "light-color-rgb";
6993
- /** Light supports HSV color via `color` cap. */
6994
- DeviceFeature["LightColorHsv"] = "light-color-hsv";
6995
- /** Light supports color-temperature (mired) via `color` cap. */
6996
- DeviceFeature["LightColorMired"] = "light-color-mired";
6997
- /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6998
- * targetHigh). Gates the range slider UI. */
6999
- DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
7000
- /** Thermostat exposes target humidity and/or current humidity
7001
- * readings. Gates the humidity controls. */
7002
- DeviceFeature["ClimateHumidity"] = "climate-humidity";
7003
- /** Thermostat exposes a fan-mode selector. */
7004
- DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
7005
- /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
7006
- DeviceFeature["ClimatePreset"] = "climate-preset";
7007
- /** Cover exposes intermediate position control (0..100). Gates the
7008
- * position slider UI. */
7009
- DeviceFeature["CoverPositionable"] = "cover-positionable";
7010
- /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
7011
- DeviceFeature["CoverTilt"] = "cover-tilt";
7012
- /** Valve exposes intermediate position control (0..100). Gates the
7013
- * position slider / drag surface UI. */
7014
- DeviceFeature["ValvePositionable"] = "valve-positionable";
7015
- /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
7016
- DeviceFeature["FanSpeed"] = "fan-speed";
7017
- /** Fan exposes a preset mode selector. */
7018
- DeviceFeature["FanPreset"] = "fan-preset";
7019
- /** Fan exposes blade direction (forward/reverse) — typical of
7020
- * ceiling fans. */
7021
- DeviceFeature["FanDirection"] = "fan-direction";
7022
- /** Fan exposes an oscillation toggle. */
7023
- DeviceFeature["FanOscillating"] = "fan-oscillating";
7024
- /** Lock requires a PIN code on lock/unlock. Gates the code-entry
7025
- * field on the UI lock-controls panel. */
7026
- DeviceFeature["LockPinRequired"] = "lock-pin-required";
7027
- /** Lock supports a latch-release ("open door") action distinct from
7028
- * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
7029
- * `supported_features`. Gates the Open Door button in the UI. */
7030
- DeviceFeature["LockOpen"] = "lock-open";
7031
- /** Media player exposes a seek-to-position surface. */
7032
- DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
7033
- /** Media player exposes a volume-level setter. */
7034
- DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
7035
- /** Media player exposes a mute toggle distinct from volume=0. */
7036
- DeviceFeature["MediaPlayerMute"] = "media-player-mute";
7037
- /** Media player exposes a shuffle toggle. */
7038
- DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
7039
- /** Media player exposes a repeat mode (off / all / one). */
7040
- DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
7041
- /** Media player exposes a source / input selector. */
7042
- DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
7043
- /** Media player exposes a play-arbitrary-media surface (URL / id). */
7044
- DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
7045
- /** Media player exposes next-track. */
7046
- DeviceFeature["MediaPlayerNext"] = "media-player-next";
7047
- /** Media player exposes previous-track. */
7048
- DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
7049
- /** Media player exposes stop distinct from pause. */
7050
- DeviceFeature["MediaPlayerStop"] = "media-player-stop";
7051
- /** Alarm panel requires a PIN code on arm/disarm. */
7052
- DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
7053
- /** Presence device carries GPS coordinates (lat/lng/accuracy) in
7054
- * addition to a textual location. */
7055
- DeviceFeature["PresenceGps"] = "presence-gps";
7056
- /** Notifier accepts an inline / URL image attachment. */
7057
- DeviceFeature["NotifierImage"] = "notifier-image";
7058
- /** Notifier accepts a priority hint (high/normal/low). */
7059
- DeviceFeature["NotifierPriority"] = "notifier-priority";
7060
- /** Notifier accepts a free-form `data` payload for platform-specific
7061
- * fields. */
7062
- DeviceFeature["NotifierData"] = "notifier-data";
7063
- /** Notifier supports interactive action buttons / callbacks. */
7064
- DeviceFeature["NotifierActions"] = "notifier-actions";
7065
- /** Notifier supports per-call recipient targeting (multi-user). */
7066
- DeviceFeature["NotifierRecipients"] = "notifier-recipients";
7067
- /** Script runner accepts a variables map on each run invocation. */
7068
- DeviceFeature["ScriptVariables"] = "script-variables";
7069
- /** Automation `trigger` accepts a skipCondition flag — fires the
7070
- * automation's actions while bypassing its condition block. */
7071
- DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
7072
- return DeviceFeature;
7073
- }({});
7074
- /**
7075
- * Semantic role a device plays within its parent. Populated by driver
7076
- * addons when creating accessory devices (Reolink siren/floodlight/
7077
- * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
7078
- * admin UI to pick icons, labels, and widgets — a `Switch` with
7079
- * `role: Floodlight` renders as a bulb with a brightness slider,
7080
- * whereas a `Switch` with `role: Siren` renders as a klaxon.
7081
- *
7082
- * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
7083
- * sqlite as a nullable TEXT column — old rows keep working unchanged.
7084
- */
7085
- var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
7086
- DeviceRole["Siren"] = "siren";
7087
- DeviceRole["Floodlight"] = "floodlight";
7088
- DeviceRole["Spotlight"] = "spotlight";
7089
- DeviceRole["PirSensor"] = "pir-sensor";
7090
- DeviceRole["Chime"] = "chime";
7091
- DeviceRole["Autotrack"] = "autotrack";
7092
- DeviceRole["Nightvision"] = "nightvision";
7093
- DeviceRole["PrivacyMask"] = "privacy-mask";
7094
- DeviceRole["Doorbell"] = "doorbell";
7095
- /** Virtual HA toggle (input_boolean.*) — distinguishable from a
7096
- * real Switch device for UI rendering / export adapters. */
7097
- DeviceRole["BinaryHelper"] = "binary-helper";
7098
- /** Generic motion / occupancy / moving event source. Distinct from
7099
- * the camera accessory PirSensor role: that one is a camera child;
7100
- * this is a standalone HA / 3rd-party motion sensor. */
7101
- DeviceRole["MotionSensor"] = "motion-sensor";
7102
- DeviceRole["ContactSensor"] = "contact-sensor";
7103
- DeviceRole["LeakSensor"] = "leak-sensor";
7104
- DeviceRole["SmokeSensor"] = "smoke-sensor";
7105
- DeviceRole["COSensor"] = "co-sensor";
7106
- DeviceRole["GasSensor"] = "gas-sensor";
7107
- DeviceRole["TamperSensor"] = "tamper-sensor";
7108
- DeviceRole["VibrationSensor"] = "vibration-sensor";
7109
- DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
7110
- DeviceRole["SoundSensor"] = "sound-sensor";
7111
- /** Fallback for `binary_sensor` without a known `device_class`. */
7112
- DeviceRole["BinarySensor"] = "binary-sensor";
7113
- DeviceRole["TemperatureSensor"] = "temperature-sensor";
7114
- DeviceRole["HumiditySensor"] = "humidity-sensor";
7115
- DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
7116
- DeviceRole["PressureSensor"] = "pressure-sensor";
7117
- DeviceRole["PowerSensor"] = "power-sensor";
7118
- DeviceRole["EnergySensor"] = "energy-sensor";
7119
- DeviceRole["VoltageSensor"] = "voltage-sensor";
7120
- DeviceRole["CurrentSensor"] = "current-sensor";
7121
- DeviceRole["AirQualitySensor"] = "air-quality-sensor";
7122
- /** Battery level (numeric % via `sensor` OR low-bool via
7123
- * `binary_sensor` — the cap distinguishes via the value type). */
7124
- DeviceRole["BatterySensor"] = "battery-sensor";
7125
- /** Fallback for `sensor` numeric without a known `device_class`. */
7126
- DeviceRole["NumericSensor"] = "numeric-sensor";
7127
- /** String / enum state (HA `sensor` with `state_class: enum` or
7128
- * `attributes.options`). */
7129
- DeviceRole["EnumSensor"] = "enum-sensor";
7130
- /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
7131
- * or `date`). The slice carries the raw ISO string verbatim (hosted on
7132
- * the `enum-sensor` cap); the UI renders it locale-formatted. */
7133
- DeviceRole["DateTimeSensor"] = "datetime-sensor";
7134
- /** Last-resort fallback when nothing else matches. */
7135
- DeviceRole["GenericSensor"] = "generic-sensor";
7136
- DeviceRole["NumericControl"] = "numeric-control";
7137
- DeviceRole["SelectControl"] = "select-control";
7138
- DeviceRole["TextControl"] = "text-control";
7139
- DeviceRole["DateTimeControl"] = "datetime-control";
7140
- /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
7141
- * rich features (image, priority, channel routing). */
7142
- DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
7143
- /** Chat / messaging service (HA `notify.telegram_*`,
7144
- * `notify.discord_*`, etc.). */
7145
- DeviceRole["MessagingNotifier"] = "messaging-notifier";
7146
- /** Email-based delivery (HA `notify.smtp`, etc.). */
7147
- DeviceRole["EmailNotifier"] = "email-notifier";
7148
- /** Fallback when the notifier service name doesn't match a known
7149
- * pattern. */
7150
- DeviceRole["GenericNotifier"] = "generic-notifier";
7151
- return DeviceRole;
7152
- }({});
7153
7289
  /**
7154
7290
  * Accessory device helpers — shared across drivers.
7155
7291
  *
@@ -7603,78 +7739,6 @@ var airQualitySensorCapability = {
7603
7739
  runtimeState: AirQualitySensorStatusSchema
7604
7740
  };
7605
7741
  /**
7606
- * Generic types for capability definitions.
7607
- *
7608
- * A capability is defined with Zod schemas for methods, events, and settings.
7609
- * TypeScript types are inferred via z.infer<> — zero duplication.
7610
- *
7611
- * Pattern:
7612
- * 1. Define Zod schemas for data, methods, settings
7613
- * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
7614
- * 3. Export type IProvider = InferProvider<typeof capabilityDef>
7615
- * 4. Addon implements IProvider
7616
- * 5. Registry auto-mounts tRPC router from definition.methods
7617
- */
7618
- /**
7619
- * Output schema shared by the contribution + live methods.
7620
- *
7621
- * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
7622
- * tabs[]) without importing from `../interfaces/config-ui.js` — a
7623
- * concrete-but-lenient Zod object keeps tRPC output inference happy
7624
- * (using `z.unknown()` here collapses unrelated router branches to
7625
- * `unknown` when the generator re-inlines the huge AppRouter type).
7626
- *
7627
- * `.passthrough()` on sections/fields accepts whatever FormBuilder
7628
- * extensions the caller adds (showWhen, displayScale, …) without
7629
- * rebuilding every time a new field kind is introduced.
7630
- */
7631
- var ContributionSectionSchema = object({
7632
- id: string(),
7633
- title: string(),
7634
- description: string().optional(),
7635
- style: _enum(["card", "accordion"]).optional(),
7636
- defaultCollapsed: boolean().optional(),
7637
- columns: union([
7638
- literal(1),
7639
- literal(2),
7640
- literal(3),
7641
- literal(4)
7642
- ]).optional(),
7643
- tab: string().optional(),
7644
- location: _enum(["settings", "top-tab"]).optional(),
7645
- order: number().optional(),
7646
- fields: array(any())
7647
- });
7648
- object({
7649
- tabs: array(object({
7650
- id: string(),
7651
- label: string(),
7652
- icon: string(),
7653
- order: number().optional()
7654
- })).optional(),
7655
- sections: array(ContributionSectionSchema)
7656
- }).nullable();
7657
- object({ deviceId: number() }), object({ deviceId: number() }), object({
7658
- deviceId: number(),
7659
- patch: record(string(), unknown())
7660
- }), object({ success: literal(true) });
7661
- object({ deviceId: number() }), unknown().nullable();
7662
- /** Shorthand to define a method schema */
7663
- function method(input, output, options) {
7664
- return {
7665
- input,
7666
- output,
7667
- kind: options?.kind ?? "query",
7668
- auth: options?.auth ?? "protected",
7669
- ...options?.access !== void 0 ? { access: options.access } : {},
7670
- timeoutMs: options?.timeoutMs
7671
- };
7672
- }
7673
- /** Shorthand to define an event schema */
7674
- function event(data) {
7675
- return { data };
7676
- }
7677
- /**
7678
7742
  * Alarm-panel cap. Models HA `alarm_control_panel.*` on
7679
7743
  * `DeviceType.AlarmPanel`. State follows HA's canonical lifecycle
7680
7744
  * across disarmed / armed_(home|away|night|vacation|custom_bypass) /
@@ -14146,9 +14210,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
14146
14210
  limit: number().optional(),
14147
14211
  tags: record(string(), string()).optional()
14148
14212
  }), array(LogEntrySchema).readonly());
14149
- var StaticDirOutputSchema = object({ staticDir: string() });
14150
- var VersionOutputSchema = object({ version: string() });
14151
- method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
14152
14213
  /**
14153
14214
  * Zod schemas for persisted record types.
14154
14215
  *
@@ -16515,7 +16576,7 @@ method(object({
16515
16576
  }), _void(), {
16516
16577
  kind: "mutation",
16517
16578
  auth: "admin"
16518
- }), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
16579
+ }), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
16519
16580
  deviceId: number(),
16520
16581
  values: record(string(), unknown())
16521
16582
  }), object({ success: literal(true) }), {
@@ -17197,7 +17258,20 @@ var DiskSpaceInfoSchema = object({
17197
17258
  var PidResourceStatsSchema = object({
17198
17259
  pid: number(),
17199
17260
  cpu: number(),
17200
- memory: number()
17261
+ memory: number(),
17262
+ /**
17263
+ * Private (anonymous) resident bytes — the per-process V8 heap + native
17264
+ * allocations NOT shared with other processes (Linux RssAnon). This is the
17265
+ * "real" per-runner cost; summing it across runners is meaningful, unlike
17266
+ * `memory` (RSS), which double-counts the shared mmap'd framework code.
17267
+ * Undefined where /proc is unavailable (e.g. macOS).
17268
+ */
17269
+ privateBytes: number().optional(),
17270
+ /**
17271
+ * Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
17272
+ * code shared copy-on-write across runners. Undefined on macOS.
17273
+ */
17274
+ sharedBytes: number().optional()
17201
17275
  });
17202
17276
  var AddonInstanceSchema = object({
17203
17277
  addonId: string(),
@@ -17246,6 +17320,17 @@ var KillProcessResultSchema = object({
17246
17320
  reason: string().optional(),
17247
17321
  signal: _enum(["SIGTERM", "SIGKILL"]).optional()
17248
17322
  });
17323
+ var DumpHeapSnapshotInputSchema = object({
17324
+ /** The addon whose runner should dump a heap snapshot. */
17325
+ addonId: string() });
17326
+ var DumpHeapSnapshotResultSchema = object({
17327
+ success: boolean(),
17328
+ /** Path of the written .heapsnapshot inside the runner's container/host. */
17329
+ path: string().optional(),
17330
+ /** Process pid that was signalled. */
17331
+ pid: number().optional(),
17332
+ reason: string().optional()
17333
+ });
17249
17334
  var SystemMetricsSchema = object({
17250
17335
  cpuPercent: number(),
17251
17336
  memoryPercent: number(),
@@ -17259,6 +17344,9 @@ var SystemMetricsSchema = object({
17259
17344
  method(_void(), SystemResourceSnapshotSchema), method(_void(), SystemResourceSnapshotSchema.nullable()), method(_void(), SystemMetricsSchema), method(object({ dirPath: string() }), DiskSpaceInfoSchema), method(_void(), MetricsGpuInfoSchema.nullable()), method(_void(), number().nullable()), method(object({ pids: array(number()) }), array(PidResourceStatsSchema)), method(_void(), array(AddonInstanceSchema).readonly()), method(object({ addonId: string() }), PidResourceStatsSchema.nullable()), method(_void(), array(NodeProcessSchema).readonly()), method(KillProcessInputSchema, KillProcessResultSchema, {
17260
17345
  kind: "mutation",
17261
17346
  auth: "admin"
17347
+ }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
17348
+ kind: "mutation",
17349
+ auth: "admin"
17262
17350
  });
17263
17351
  var PtzPresetSchema = object({
17264
17352
  id: string(),
@@ -17625,63 +17713,6 @@ method(object({
17625
17713
  auth: "admin"
17626
17714
  });
17627
17715
  /**
17628
- * device-ops — device-scoped cap that unifies the per-IDevice operations
17629
- * previously routed through the `.device-ops` Moleculer bridge service.
17630
- *
17631
- * Each worker that hosts live `IDevice` instances auto-registers a native
17632
- * provider for this cap (per device) backed by its local
17633
- * `DeviceRegistry`. Hub-side callers reach it transparently through
17634
- * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
17635
- * `deviceId` + `nodeId` and dispatches through the standard cap-router,
17636
- * so there's no parallel bridge path anymore.
17637
- *
17638
- * The surface is intentionally small — every method corresponds to a
17639
- * single action on the live `IDevice` (or `ICameraDevice` for
17640
- * `getStreamSources`). Richer orchestration (enable/disable with
17641
- * integration plumbing, bulk updates) stays in the `device-manager` cap;
17642
- * `device-ops` is the per-device primitive the device-manager routes to.
17643
- */
17644
- var StreamSourceEntrySchema$1 = object({
17645
- id: string(),
17646
- label: string(),
17647
- protocol: _enum([
17648
- "rtsp",
17649
- "rtmp",
17650
- "annexb",
17651
- "http-mjpeg",
17652
- "webrtc",
17653
- "custom"
17654
- ]),
17655
- url: string().optional(),
17656
- resolution: object({
17657
- width: number(),
17658
- height: number()
17659
- }).optional(),
17660
- fps: number().optional(),
17661
- bitrate: number().optional(),
17662
- codec: string().optional(),
17663
- profileHint: CamProfileSchema.optional(),
17664
- sdp: string().optional()
17665
- });
17666
- var ConfigEntrySchema$1 = object({
17667
- key: string(),
17668
- value: unknown()
17669
- });
17670
- var RawStateResultSchema = object({
17671
- /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
17672
- source: string(),
17673
- /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
17674
- data: record(string(), unknown())
17675
- });
17676
- method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
17677
- deviceId: number(),
17678
- values: record(string(), unknown())
17679
- }), _void(), { kind: "mutation" }), method(object({
17680
- deviceId: number(),
17681
- action: string().min(1),
17682
- input: unknown()
17683
- }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
17684
- /**
17685
17716
  * camera-credentials — device-scoped cap exposing the camera's network
17686
17717
  * + auth surface in a vendor-neutral shape.
17687
17718
  *
@@ -21364,6 +21395,12 @@ Object.freeze({
21364
21395
  addonId: null,
21365
21396
  access: "view"
21366
21397
  },
21398
+ "metricsProvider.dumpHeapSnapshot": {
21399
+ capName: "metrics-provider",
21400
+ capScope: "system",
21401
+ addonId: null,
21402
+ access: "create"
21403
+ },
21367
21404
  "metricsProvider.getAddonStats": {
21368
21405
  capName: "metrics-provider",
21369
21406
  capScope: "system",
@@ -48834,11 +48871,11 @@ var HmUpdateDevice = class extends HmChildDevice {
48834
48871
  * `binary` / `temperature-sensor`) — the MAINTENANCE-provenance `sourceParams`
48835
48872
  * marker on the config disambiguates them.
48836
48873
  */
48837
- function pickHmChildClass(capabilities, hasDiagnosticProvenance) {
48874
+ function pickHmChildClass(capabilities, isDiagnostic) {
48838
48875
  if (capabilities.includes("switch") || capabilities.includes("cover") || capabilities.includes("lock-control") || capabilities.includes("climate-control")) return HmActuatorDevice;
48839
48876
  if (capabilities.includes("event-emitter")) return HmEventEmitterDevice;
48840
48877
  if (capabilities.includes("update")) return HmUpdateDevice;
48841
- if (hasDiagnosticProvenance) return HmDiagnosticDevice;
48878
+ if (isDiagnostic) return HmDiagnosticDevice;
48842
48879
  return HmSensorDevice;
48843
48880
  }
48844
48881
  /**