@camstack/addon-mqtt-broker 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.
@@ -4673,63 +4673,7 @@ function _instanceof(cls, params = {}) {
4673
4673
  return inst;
4674
4674
  }
4675
4675
  //#endregion
4676
- //#region ../types/dist/index.mjs
4677
- /**
4678
- * Deep wiring healthcheck — snapshot of active reachability probes across
4679
- * every declared capability + widget of every installed plugin, on every
4680
- * node. Produced by the backend `WiringHealthService` and surfaced via
4681
- * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
4682
- *
4683
- * Unlike `/health` (process liveness), this reflects whether each cap/widget
4684
- * is actually *reachable* over the real cap-dispatch path. See spec
4685
- * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
4686
- */
4687
- /** What kind of target a probe addressed. */
4688
- var wiringProbeKindSchema = _enum([
4689
- "singleton",
4690
- "device",
4691
- "widget"
4692
- ]);
4693
- /** Result of probing a single (cap|widget [, device]) target. */
4694
- var wiringProbeResultSchema = object({
4695
- capName: string(),
4696
- kind: wiringProbeKindSchema,
4697
- deviceId: number().optional(),
4698
- reachable: boolean(),
4699
- latencyMs: number(),
4700
- error: string().optional()
4701
- });
4702
- /** Per-addon roll-up of cap + widget probe results. */
4703
- var wiringAddonHealthSchema = object({
4704
- addonId: string(),
4705
- caps: array(wiringProbeResultSchema).readonly(),
4706
- widgets: array(wiringProbeResultSchema).readonly()
4707
- });
4708
- /** Per-node roll-up. */
4709
- var wiringNodeHealthSchema = object({
4710
- nodeId: string(),
4711
- addons: array(wiringAddonHealthSchema).readonly()
4712
- });
4713
- object({
4714
- /** True only when every probed target is reachable. */
4715
- ok: boolean(),
4716
- /** True when at least one target is unreachable. */
4717
- degraded: boolean(),
4718
- checkedAt: string(),
4719
- nodes: array(wiringNodeHealthSchema).readonly(),
4720
- summary: object({
4721
- total: number(),
4722
- reachable: number(),
4723
- unreachable: number()
4724
- })
4725
- });
4726
- var MODEL_FORMATS = [
4727
- "onnx",
4728
- "coreml",
4729
- "openvino",
4730
- "tflite",
4731
- "pt"
4732
- ];
4676
+ //#region ../types/dist/sleep-B1dKJAMJ.mjs
4733
4677
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4734
4678
  EventCategory["SystemBoot"] = "system.boot";
4735
4679
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5703,7 +5647,7 @@ var BaseAddon = class {
5703
5647
  deviceSettingsSchema() {
5704
5648
  return null;
5705
5649
  }
5706
- async getGlobalSettings(overlay, cap) {
5650
+ async getGlobalSettings(overlay, cap, _nodeId) {
5707
5651
  const schema = this.globalSettingsSchema(cap);
5708
5652
  if (!schema) return { sections: [] };
5709
5653
  const raw = await this._ctx?.settings?.readAddonStore() ?? {};
@@ -5712,7 +5656,7 @@ var BaseAddon = class {
5712
5656
  ...overlay
5713
5657
  } : raw);
5714
5658
  }
5715
- async updateGlobalSettings(patch) {
5659
+ async updateGlobalSettings(patch, _nodeId) {
5716
5660
  await this._ctx?.settings?.writeAddonStore(patch);
5717
5661
  await this.resolveConfig();
5718
5662
  await this.onConfigChanged();
@@ -6052,7 +5996,7 @@ var ProfileSlotSchema = object({
6052
5996
  * Zod schema for StreamSourceEntry — the canonical stream descriptor
6053
5997
  * exposed by ICameraDevice.getStreamSources() and consumed by the broker.
6054
5998
  */
6055
- var StreamSourceEntrySchema = object({
5999
+ var StreamSourceEntrySchema$1 = object({
6056
6000
  id: string(),
6057
6001
  label: string(),
6058
6002
  protocol: _enum([
@@ -6274,6 +6218,468 @@ var ProfileRtspEntrySchema = object({
6274
6218
  codec: string().optional(),
6275
6219
  resolution: CamStreamResolutionSchema.optional()
6276
6220
  });
6221
+ var DeviceType = /* @__PURE__ */ function(DeviceType) {
6222
+ DeviceType["Camera"] = "camera";
6223
+ DeviceType["Hub"] = "hub";
6224
+ DeviceType["Light"] = "light";
6225
+ DeviceType["Siren"] = "siren";
6226
+ DeviceType["Switch"] = "switch";
6227
+ DeviceType["Sensor"] = "sensor";
6228
+ DeviceType["Thermostat"] = "thermostat";
6229
+ DeviceType["Button"] = "button";
6230
+ /** Generic stateless event emitter — carries a device's EXACT declared
6231
+ * event vocabulary verbatim (no normalization). Installed with the
6232
+ * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6233
+ * HA bus events (e.g. `zha_event`, generic). */
6234
+ DeviceType["EventEmitter"] = "event-emitter";
6235
+ /** Firmware/software update entity — current vs available version,
6236
+ * updatable flag, update state, and an install action. Installed with
6237
+ * the `update` cap. Sources: Homematic firmware-update channels (and
6238
+ * reusable by other providers, e.g. HA `update.*` entities). */
6239
+ DeviceType["Update"] = "update";
6240
+ DeviceType["Generic"] = "generic";
6241
+ /** Generic notification delivery target (HA `notify.<service>`, future
6242
+ * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6243
+ * endpoint; the `notifier` cap defines the send surface. */
6244
+ DeviceType["Notifier"] = "notifier";
6245
+ /** Pre-recorded action sequence with optional parameters
6246
+ * (HA `script.*`). Runnable via `script-runner` cap. */
6247
+ DeviceType["Script"] = "script";
6248
+ /** Automation rule (HA `automation.*`) — enable/disable + manual
6249
+ * trigger surface exposed via `automation-control` cap. */
6250
+ DeviceType["Automation"] = "automation";
6251
+ /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6252
+ DeviceType["Lock"] = "lock";
6253
+ /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6254
+ * `valve.*`). `cover` cap with sub-roles for variant. */
6255
+ DeviceType["Cover"] = "cover";
6256
+ /** Pipe / water / gas valve with open/close/stop and optional
6257
+ * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6258
+ * modelled on the same open/closed lifecycle. */
6259
+ DeviceType["Valve"] = "valve";
6260
+ /** Humidifier / dehumidifier with on/off + target humidity + mode
6261
+ * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6262
+ * modelled on the same target / mode lifecycle. */
6263
+ DeviceType["Humidifier"] = "humidifier";
6264
+ /** Water heater / boiler with target temperature + operation mode +
6265
+ * away mode (HA `water_heater.*`). `water-heater` cap — a
6266
+ * climate-family actuator. */
6267
+ DeviceType["WaterHeater"] = "water-heater";
6268
+ /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6269
+ DeviceType["Fan"] = "fan";
6270
+ /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6271
+ * the camera surface — those use `Camera`. `media-player` cap. */
6272
+ DeviceType["MediaPlayer"] = "media-player";
6273
+ /** Security panel / alarm system (HA `alarm_control_panel.*`).
6274
+ * `alarm-panel` cap. */
6275
+ DeviceType["AlarmPanel"] = "alarm-panel";
6276
+ /** Generic user-settable input (HA `number` / `input_number` / `select`
6277
+ * / `input_select` / `text` / `input_text` / `input_datetime`).
6278
+ * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6279
+ * TextControl / DateTimeControl. */
6280
+ DeviceType["Control"] = "control";
6281
+ /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6282
+ * `presence` cap. */
6283
+ DeviceType["Presence"] = "presence";
6284
+ /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6285
+ * `weather` cap. */
6286
+ DeviceType["Weather"] = "weather";
6287
+ /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6288
+ DeviceType["Vacuum"] = "vacuum";
6289
+ /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6290
+ * `lawn-mower-control` cap. */
6291
+ DeviceType["LawnMower"] = "lawn-mower";
6292
+ /** Physical HA device group — parent container for entity-children
6293
+ * adopted from a single HA device entry. Not renderable as a
6294
+ * standalone device; exists only to anchor child entities. */
6295
+ DeviceType["Container"] = "container";
6296
+ /** Single still-image entity (HA `image.*`). Read-only display of an
6297
+ * `entity_picture` signed URL the browser loads directly. `image` cap. */
6298
+ DeviceType["Image"] = "image";
6299
+ return DeviceType;
6300
+ }({});
6301
+ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6302
+ DeviceFeature["BatteryOperated"] = "battery-operated";
6303
+ DeviceFeature["Rebootable"] = "rebootable";
6304
+ /**
6305
+ * Device supports an on-demand re-sync of its derived spec with its
6306
+ * upstream source — drives the generic Re-sync button. The owning
6307
+ * provider implements the action via the `device-adoption.resync` cap.
6308
+ */
6309
+ DeviceFeature["Resyncable"] = "resyncable";
6310
+ DeviceFeature["NativeSnapshot"] = "native-snapshot";
6311
+ DeviceFeature["DoorbellButton"] = "doorbell-button";
6312
+ DeviceFeature["TwoWayAudio"] = "two-way-audio";
6313
+ DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6314
+ /**
6315
+ * Camera supports the on-firmware autotrack subsystem (subject-
6316
+ * following). Distinct from `PanTiltZoom` because not every PTZ
6317
+ * camera ships autotrack — the admin UI uses this flag to gate
6318
+ * the autotrack toggle / settings card without re-deriving from
6319
+ * the cap registry. Mirrors `ptz-autotrack` cap registration:
6320
+ * driver sets this feature when probe confirms the firmware
6321
+ * surface, and registers the cap in the same code path.
6322
+ */
6323
+ DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6324
+ /**
6325
+ * Accessory exposes a "trigger on motion" toggle — the parent camera's
6326
+ * motion detection automatically activates this device. Mirrors
6327
+ * `motion-trigger` cap registration: drivers set this feature in the
6328
+ * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6329
+ *
6330
+ * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6331
+ * fast scalar without binding fetch), notifier rules, and `listAll`
6332
+ * filters that want "all devices with on-motion behaviour".
6333
+ */
6334
+ DeviceFeature["MotionTrigger"] = "motion-trigger";
6335
+ /** Light supports rgb-triplet color via `color` cap. */
6336
+ DeviceFeature["LightColorRgb"] = "light-color-rgb";
6337
+ /** Light supports HSV color via `color` cap. */
6338
+ DeviceFeature["LightColorHsv"] = "light-color-hsv";
6339
+ /** Light supports color-temperature (mired) via `color` cap. */
6340
+ DeviceFeature["LightColorMired"] = "light-color-mired";
6341
+ /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6342
+ * targetHigh). Gates the range slider UI. */
6343
+ DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6344
+ /** Thermostat exposes target humidity and/or current humidity
6345
+ * readings. Gates the humidity controls. */
6346
+ DeviceFeature["ClimateHumidity"] = "climate-humidity";
6347
+ /** Thermostat exposes a fan-mode selector. */
6348
+ DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6349
+ /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6350
+ DeviceFeature["ClimatePreset"] = "climate-preset";
6351
+ /** Cover exposes intermediate position control (0..100). Gates the
6352
+ * position slider UI. */
6353
+ DeviceFeature["CoverPositionable"] = "cover-positionable";
6354
+ /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6355
+ DeviceFeature["CoverTilt"] = "cover-tilt";
6356
+ /** Valve exposes intermediate position control (0..100). Gates the
6357
+ * position slider / drag surface UI. */
6358
+ DeviceFeature["ValvePositionable"] = "valve-positionable";
6359
+ /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6360
+ DeviceFeature["FanSpeed"] = "fan-speed";
6361
+ /** Fan exposes a preset mode selector. */
6362
+ DeviceFeature["FanPreset"] = "fan-preset";
6363
+ /** Fan exposes blade direction (forward/reverse) — typical of
6364
+ * ceiling fans. */
6365
+ DeviceFeature["FanDirection"] = "fan-direction";
6366
+ /** Fan exposes an oscillation toggle. */
6367
+ DeviceFeature["FanOscillating"] = "fan-oscillating";
6368
+ /** Lock requires a PIN code on lock/unlock. Gates the code-entry
6369
+ * field on the UI lock-controls panel. */
6370
+ DeviceFeature["LockPinRequired"] = "lock-pin-required";
6371
+ /** Lock supports a latch-release ("open door") action distinct from
6372
+ * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
6373
+ * `supported_features`. Gates the Open Door button in the UI. */
6374
+ DeviceFeature["LockOpen"] = "lock-open";
6375
+ /** Media player exposes a seek-to-position surface. */
6376
+ DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
6377
+ /** Media player exposes a volume-level setter. */
6378
+ DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
6379
+ /** Media player exposes a mute toggle distinct from volume=0. */
6380
+ DeviceFeature["MediaPlayerMute"] = "media-player-mute";
6381
+ /** Media player exposes a shuffle toggle. */
6382
+ DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
6383
+ /** Media player exposes a repeat mode (off / all / one). */
6384
+ DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
6385
+ /** Media player exposes a source / input selector. */
6386
+ DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
6387
+ /** Media player exposes a play-arbitrary-media surface (URL / id). */
6388
+ DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
6389
+ /** Media player exposes next-track. */
6390
+ DeviceFeature["MediaPlayerNext"] = "media-player-next";
6391
+ /** Media player exposes previous-track. */
6392
+ DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
6393
+ /** Media player exposes stop distinct from pause. */
6394
+ DeviceFeature["MediaPlayerStop"] = "media-player-stop";
6395
+ /** Alarm panel requires a PIN code on arm/disarm. */
6396
+ DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
6397
+ /** Presence device carries GPS coordinates (lat/lng/accuracy) in
6398
+ * addition to a textual location. */
6399
+ DeviceFeature["PresenceGps"] = "presence-gps";
6400
+ /** Notifier accepts an inline / URL image attachment. */
6401
+ DeviceFeature["NotifierImage"] = "notifier-image";
6402
+ /** Notifier accepts a priority hint (high/normal/low). */
6403
+ DeviceFeature["NotifierPriority"] = "notifier-priority";
6404
+ /** Notifier accepts a free-form `data` payload for platform-specific
6405
+ * fields. */
6406
+ DeviceFeature["NotifierData"] = "notifier-data";
6407
+ /** Notifier supports interactive action buttons / callbacks. */
6408
+ DeviceFeature["NotifierActions"] = "notifier-actions";
6409
+ /** Notifier supports per-call recipient targeting (multi-user). */
6410
+ DeviceFeature["NotifierRecipients"] = "notifier-recipients";
6411
+ /** Script runner accepts a variables map on each run invocation. */
6412
+ DeviceFeature["ScriptVariables"] = "script-variables";
6413
+ /** Automation `trigger` accepts a skipCondition flag — fires the
6414
+ * automation's actions while bypassing its condition block. */
6415
+ DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
6416
+ return DeviceFeature;
6417
+ }({});
6418
+ /**
6419
+ * Semantic role a device plays within its parent. Populated by driver
6420
+ * addons when creating accessory devices (Reolink siren/floodlight/
6421
+ * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
6422
+ * admin UI to pick icons, labels, and widgets — a `Switch` with
6423
+ * `role: Floodlight` renders as a bulb with a brightness slider,
6424
+ * whereas a `Switch` with `role: Siren` renders as a klaxon.
6425
+ *
6426
+ * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
6427
+ * sqlite as a nullable TEXT column — old rows keep working unchanged.
6428
+ */
6429
+ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
6430
+ DeviceRole["Siren"] = "siren";
6431
+ DeviceRole["Floodlight"] = "floodlight";
6432
+ DeviceRole["Spotlight"] = "spotlight";
6433
+ DeviceRole["PirSensor"] = "pir-sensor";
6434
+ DeviceRole["Chime"] = "chime";
6435
+ DeviceRole["Autotrack"] = "autotrack";
6436
+ DeviceRole["Nightvision"] = "nightvision";
6437
+ DeviceRole["PrivacyMask"] = "privacy-mask";
6438
+ DeviceRole["Doorbell"] = "doorbell";
6439
+ /** Virtual HA toggle (input_boolean.*) — distinguishable from a
6440
+ * real Switch device for UI rendering / export adapters. */
6441
+ DeviceRole["BinaryHelper"] = "binary-helper";
6442
+ /** Generic motion / occupancy / moving event source. Distinct from
6443
+ * the camera accessory PirSensor role: that one is a camera child;
6444
+ * this is a standalone HA / 3rd-party motion sensor. */
6445
+ DeviceRole["MotionSensor"] = "motion-sensor";
6446
+ DeviceRole["ContactSensor"] = "contact-sensor";
6447
+ DeviceRole["LeakSensor"] = "leak-sensor";
6448
+ DeviceRole["SmokeSensor"] = "smoke-sensor";
6449
+ DeviceRole["COSensor"] = "co-sensor";
6450
+ DeviceRole["GasSensor"] = "gas-sensor";
6451
+ DeviceRole["TamperSensor"] = "tamper-sensor";
6452
+ DeviceRole["VibrationSensor"] = "vibration-sensor";
6453
+ DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
6454
+ DeviceRole["SoundSensor"] = "sound-sensor";
6455
+ /** Fallback for `binary_sensor` without a known `device_class`. */
6456
+ DeviceRole["BinarySensor"] = "binary-sensor";
6457
+ DeviceRole["TemperatureSensor"] = "temperature-sensor";
6458
+ DeviceRole["HumiditySensor"] = "humidity-sensor";
6459
+ DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
6460
+ DeviceRole["PressureSensor"] = "pressure-sensor";
6461
+ DeviceRole["PowerSensor"] = "power-sensor";
6462
+ DeviceRole["EnergySensor"] = "energy-sensor";
6463
+ DeviceRole["VoltageSensor"] = "voltage-sensor";
6464
+ DeviceRole["CurrentSensor"] = "current-sensor";
6465
+ DeviceRole["AirQualitySensor"] = "air-quality-sensor";
6466
+ /** Battery level (numeric % via `sensor` OR low-bool via
6467
+ * `binary_sensor` — the cap distinguishes via the value type). */
6468
+ DeviceRole["BatterySensor"] = "battery-sensor";
6469
+ /** Fallback for `sensor` numeric without a known `device_class`. */
6470
+ DeviceRole["NumericSensor"] = "numeric-sensor";
6471
+ /** String / enum state (HA `sensor` with `state_class: enum` or
6472
+ * `attributes.options`). */
6473
+ DeviceRole["EnumSensor"] = "enum-sensor";
6474
+ /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
6475
+ * or `date`). The slice carries the raw ISO string verbatim (hosted on
6476
+ * the `enum-sensor` cap); the UI renders it locale-formatted. */
6477
+ DeviceRole["DateTimeSensor"] = "datetime-sensor";
6478
+ /** Last-resort fallback when nothing else matches. */
6479
+ DeviceRole["GenericSensor"] = "generic-sensor";
6480
+ DeviceRole["NumericControl"] = "numeric-control";
6481
+ DeviceRole["SelectControl"] = "select-control";
6482
+ DeviceRole["TextControl"] = "text-control";
6483
+ DeviceRole["DateTimeControl"] = "datetime-control";
6484
+ /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
6485
+ * rich features (image, priority, channel routing). */
6486
+ DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
6487
+ /** Chat / messaging service (HA `notify.telegram_*`,
6488
+ * `notify.discord_*`, etc.). */
6489
+ DeviceRole["MessagingNotifier"] = "messaging-notifier";
6490
+ /** Email-based delivery (HA `notify.smtp`, etc.). */
6491
+ DeviceRole["EmailNotifier"] = "email-notifier";
6492
+ /** Fallback when the notifier service name doesn't match a known
6493
+ * pattern. */
6494
+ DeviceRole["GenericNotifier"] = "generic-notifier";
6495
+ return DeviceRole;
6496
+ }({});
6497
+ /**
6498
+ * Generic types for capability definitions.
6499
+ *
6500
+ * A capability is defined with Zod schemas for methods, events, and settings.
6501
+ * TypeScript types are inferred via z.infer<> — zero duplication.
6502
+ *
6503
+ * Pattern:
6504
+ * 1. Define Zod schemas for data, methods, settings
6505
+ * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
6506
+ * 3. Export type IProvider = InferProvider<typeof capabilityDef>
6507
+ * 4. Addon implements IProvider
6508
+ * 5. Registry auto-mounts tRPC router from definition.methods
6509
+ */
6510
+ /**
6511
+ * Output schema shared by the contribution + live methods.
6512
+ *
6513
+ * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
6514
+ * tabs[]) without importing from `../interfaces/config-ui.js` — a
6515
+ * concrete-but-lenient Zod object keeps tRPC output inference happy
6516
+ * (using `z.unknown()` here collapses unrelated router branches to
6517
+ * `unknown` when the generator re-inlines the huge AppRouter type).
6518
+ *
6519
+ * `.passthrough()` on sections/fields accepts whatever FormBuilder
6520
+ * extensions the caller adds (showWhen, displayScale, …) without
6521
+ * rebuilding every time a new field kind is introduced.
6522
+ */
6523
+ var ContributionSectionSchema = object({
6524
+ id: string(),
6525
+ title: string(),
6526
+ description: string().optional(),
6527
+ style: _enum(["card", "accordion"]).optional(),
6528
+ defaultCollapsed: boolean().optional(),
6529
+ columns: union([
6530
+ literal(1),
6531
+ literal(2),
6532
+ literal(3),
6533
+ literal(4)
6534
+ ]).optional(),
6535
+ tab: string().optional(),
6536
+ location: _enum(["settings", "top-tab"]).optional(),
6537
+ order: number().optional(),
6538
+ fields: array(any())
6539
+ });
6540
+ object({
6541
+ tabs: array(object({
6542
+ id: string(),
6543
+ label: string(),
6544
+ icon: string(),
6545
+ order: number().optional()
6546
+ })).optional(),
6547
+ sections: array(ContributionSectionSchema)
6548
+ }).nullable();
6549
+ object({ deviceId: number() }), object({ deviceId: number() }), object({
6550
+ deviceId: number(),
6551
+ patch: record(string(), unknown())
6552
+ }), object({ success: literal(true) });
6553
+ object({ deviceId: number() }), unknown().nullable();
6554
+ /** Shorthand to define a method schema */
6555
+ function method(input, output, options) {
6556
+ return {
6557
+ input,
6558
+ output,
6559
+ kind: options?.kind ?? "query",
6560
+ auth: options?.auth ?? "protected",
6561
+ ...options?.access !== void 0 ? { access: options.access } : {},
6562
+ timeoutMs: options?.timeoutMs
6563
+ };
6564
+ }
6565
+ var StaticDirOutputSchema = object({ staticDir: string() });
6566
+ var VersionOutputSchema = object({ version: string() });
6567
+ method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
6568
+ /**
6569
+ * device-ops — device-scoped cap that unifies the per-IDevice operations
6570
+ * previously routed through the `.device-ops` Moleculer bridge service.
6571
+ *
6572
+ * Each worker that hosts live `IDevice` instances auto-registers a native
6573
+ * provider for this cap (per device) backed by its local
6574
+ * `DeviceRegistry`. Hub-side callers reach it transparently through
6575
+ * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
6576
+ * `deviceId` + `nodeId` and dispatches through the standard cap-router,
6577
+ * so there's no parallel bridge path anymore.
6578
+ *
6579
+ * The surface is intentionally small — every method corresponds to a
6580
+ * single action on the live `IDevice` (or `ICameraDevice` for
6581
+ * `getStreamSources`). Richer orchestration (enable/disable with
6582
+ * integration plumbing, bulk updates) stays in the `device-manager` cap;
6583
+ * `device-ops` is the per-device primitive the device-manager routes to.
6584
+ */
6585
+ var StreamSourceEntrySchema = object({
6586
+ id: string(),
6587
+ label: string(),
6588
+ protocol: _enum([
6589
+ "rtsp",
6590
+ "rtmp",
6591
+ "annexb",
6592
+ "http-mjpeg",
6593
+ "webrtc",
6594
+ "custom"
6595
+ ]),
6596
+ url: string().optional(),
6597
+ resolution: object({
6598
+ width: number(),
6599
+ height: number()
6600
+ }).optional(),
6601
+ fps: number().optional(),
6602
+ bitrate: number().optional(),
6603
+ codec: string().optional(),
6604
+ profileHint: CamProfileSchema.optional(),
6605
+ sdp: string().optional()
6606
+ });
6607
+ var ConfigEntrySchema$1 = object({
6608
+ key: string(),
6609
+ value: unknown()
6610
+ });
6611
+ var RawStateResultSchema = object({
6612
+ /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
6613
+ source: string(),
6614
+ /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
6615
+ data: record(string(), unknown())
6616
+ });
6617
+ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
6618
+ deviceId: number(),
6619
+ values: record(string(), unknown())
6620
+ }), _void(), { kind: "mutation" }), method(object({
6621
+ deviceId: number(),
6622
+ action: string().min(1),
6623
+ input: unknown()
6624
+ }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
6625
+ //#endregion
6626
+ //#region ../types/dist/index.mjs
6627
+ /**
6628
+ * Deep wiring healthcheck — snapshot of active reachability probes across
6629
+ * every declared capability + widget of every installed plugin, on every
6630
+ * node. Produced by the backend `WiringHealthService` and surfaced via
6631
+ * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
6632
+ *
6633
+ * Unlike `/health` (process liveness), this reflects whether each cap/widget
6634
+ * is actually *reachable* over the real cap-dispatch path. See spec
6635
+ * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
6636
+ */
6637
+ /** What kind of target a probe addressed. */
6638
+ var wiringProbeKindSchema = _enum([
6639
+ "singleton",
6640
+ "device",
6641
+ "widget"
6642
+ ]);
6643
+ /** Result of probing a single (cap|widget [, device]) target. */
6644
+ var wiringProbeResultSchema = object({
6645
+ capName: string(),
6646
+ kind: wiringProbeKindSchema,
6647
+ deviceId: number().optional(),
6648
+ reachable: boolean(),
6649
+ latencyMs: number(),
6650
+ error: string().optional()
6651
+ });
6652
+ /** Per-addon roll-up of cap + widget probe results. */
6653
+ var wiringAddonHealthSchema = object({
6654
+ addonId: string(),
6655
+ caps: array(wiringProbeResultSchema).readonly(),
6656
+ widgets: array(wiringProbeResultSchema).readonly()
6657
+ });
6658
+ /** Per-node roll-up. */
6659
+ var wiringNodeHealthSchema = object({
6660
+ nodeId: string(),
6661
+ addons: array(wiringAddonHealthSchema).readonly()
6662
+ });
6663
+ object({
6664
+ /** True only when every probed target is reachable. */
6665
+ ok: boolean(),
6666
+ /** True when at least one target is unreachable. */
6667
+ degraded: boolean(),
6668
+ checkedAt: string(),
6669
+ nodes: array(wiringNodeHealthSchema).readonly(),
6670
+ summary: object({
6671
+ total: number(),
6672
+ reachable: number(),
6673
+ unreachable: number()
6674
+ })
6675
+ });
6676
+ var MODEL_FORMATS = [
6677
+ "onnx",
6678
+ "coreml",
6679
+ "openvino",
6680
+ "tflite",
6681
+ "pt"
6682
+ ];
6277
6683
  /**
6278
6684
  * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6279
6685
  * Named `RecordingWeekday` to avoid collision with the string-union
@@ -6886,282 +7292,6 @@ var APPLE_SA_TO_MACRO = {
6886
7292
  var _macroLookup = /* @__PURE__ */ new Map();
6887
7293
  for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6888
7294
  for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6889
- var DeviceType = /* @__PURE__ */ function(DeviceType) {
6890
- DeviceType["Camera"] = "camera";
6891
- DeviceType["Hub"] = "hub";
6892
- DeviceType["Light"] = "light";
6893
- DeviceType["Siren"] = "siren";
6894
- DeviceType["Switch"] = "switch";
6895
- DeviceType["Sensor"] = "sensor";
6896
- DeviceType["Thermostat"] = "thermostat";
6897
- DeviceType["Button"] = "button";
6898
- /** Generic stateless event emitter — carries a device's EXACT declared
6899
- * event vocabulary verbatim (no normalization). Installed with the
6900
- * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6901
- * HA bus events (e.g. `zha_event`, generic). */
6902
- DeviceType["EventEmitter"] = "event-emitter";
6903
- /** Firmware/software update entity — current vs available version,
6904
- * updatable flag, update state, and an install action. Installed with
6905
- * the `update` cap. Sources: Homematic firmware-update channels (and
6906
- * reusable by other providers, e.g. HA `update.*` entities). */
6907
- DeviceType["Update"] = "update";
6908
- DeviceType["Generic"] = "generic";
6909
- /** Generic notification delivery target (HA `notify.<service>`, future
6910
- * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6911
- * endpoint; the `notifier` cap defines the send surface. */
6912
- DeviceType["Notifier"] = "notifier";
6913
- /** Pre-recorded action sequence with optional parameters
6914
- * (HA `script.*`). Runnable via `script-runner` cap. */
6915
- DeviceType["Script"] = "script";
6916
- /** Automation rule (HA `automation.*`) — enable/disable + manual
6917
- * trigger surface exposed via `automation-control` cap. */
6918
- DeviceType["Automation"] = "automation";
6919
- /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6920
- DeviceType["Lock"] = "lock";
6921
- /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6922
- * `valve.*`). `cover` cap with sub-roles for variant. */
6923
- DeviceType["Cover"] = "cover";
6924
- /** Pipe / water / gas valve with open/close/stop and optional
6925
- * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6926
- * modelled on the same open/closed lifecycle. */
6927
- DeviceType["Valve"] = "valve";
6928
- /** Humidifier / dehumidifier with on/off + target humidity + mode
6929
- * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6930
- * modelled on the same target / mode lifecycle. */
6931
- DeviceType["Humidifier"] = "humidifier";
6932
- /** Water heater / boiler with target temperature + operation mode +
6933
- * away mode (HA `water_heater.*`). `water-heater` cap — a
6934
- * climate-family actuator. */
6935
- DeviceType["WaterHeater"] = "water-heater";
6936
- /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6937
- DeviceType["Fan"] = "fan";
6938
- /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6939
- * the camera surface — those use `Camera`. `media-player` cap. */
6940
- DeviceType["MediaPlayer"] = "media-player";
6941
- /** Security panel / alarm system (HA `alarm_control_panel.*`).
6942
- * `alarm-panel` cap. */
6943
- DeviceType["AlarmPanel"] = "alarm-panel";
6944
- /** Generic user-settable input (HA `number` / `input_number` / `select`
6945
- * / `input_select` / `text` / `input_text` / `input_datetime`).
6946
- * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6947
- * TextControl / DateTimeControl. */
6948
- DeviceType["Control"] = "control";
6949
- /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6950
- * `presence` cap. */
6951
- DeviceType["Presence"] = "presence";
6952
- /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6953
- * `weather` cap. */
6954
- DeviceType["Weather"] = "weather";
6955
- /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6956
- DeviceType["Vacuum"] = "vacuum";
6957
- /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6958
- * `lawn-mower-control` cap. */
6959
- DeviceType["LawnMower"] = "lawn-mower";
6960
- /** Physical HA device group — parent container for entity-children
6961
- * adopted from a single HA device entry. Not renderable as a
6962
- * standalone device; exists only to anchor child entities. */
6963
- DeviceType["Container"] = "container";
6964
- /** Single still-image entity (HA `image.*`). Read-only display of an
6965
- * `entity_picture` signed URL the browser loads directly. `image` cap. */
6966
- DeviceType["Image"] = "image";
6967
- return DeviceType;
6968
- }({});
6969
- var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6970
- DeviceFeature["BatteryOperated"] = "battery-operated";
6971
- DeviceFeature["Rebootable"] = "rebootable";
6972
- /**
6973
- * Device supports an on-demand re-sync of its derived spec with its
6974
- * upstream source — drives the generic Re-sync button. The owning
6975
- * provider implements the action via the `device-adoption.resync` cap.
6976
- */
6977
- DeviceFeature["Resyncable"] = "resyncable";
6978
- DeviceFeature["NativeSnapshot"] = "native-snapshot";
6979
- DeviceFeature["DoorbellButton"] = "doorbell-button";
6980
- DeviceFeature["TwoWayAudio"] = "two-way-audio";
6981
- DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6982
- /**
6983
- * Camera supports the on-firmware autotrack subsystem (subject-
6984
- * following). Distinct from `PanTiltZoom` because not every PTZ
6985
- * camera ships autotrack — the admin UI uses this flag to gate
6986
- * the autotrack toggle / settings card without re-deriving from
6987
- * the cap registry. Mirrors `ptz-autotrack` cap registration:
6988
- * driver sets this feature when probe confirms the firmware
6989
- * surface, and registers the cap in the same code path.
6990
- */
6991
- DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6992
- /**
6993
- * Accessory exposes a "trigger on motion" toggle — the parent camera's
6994
- * motion detection automatically activates this device. Mirrors
6995
- * `motion-trigger` cap registration: drivers set this feature in the
6996
- * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6997
- *
6998
- * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6999
- * fast scalar without binding fetch), notifier rules, and `listAll`
7000
- * filters that want "all devices with on-motion behaviour".
7001
- */
7002
- DeviceFeature["MotionTrigger"] = "motion-trigger";
7003
- /** Light supports rgb-triplet color via `color` cap. */
7004
- DeviceFeature["LightColorRgb"] = "light-color-rgb";
7005
- /** Light supports HSV color via `color` cap. */
7006
- DeviceFeature["LightColorHsv"] = "light-color-hsv";
7007
- /** Light supports color-temperature (mired) via `color` cap. */
7008
- DeviceFeature["LightColorMired"] = "light-color-mired";
7009
- /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
7010
- * targetHigh). Gates the range slider UI. */
7011
- DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
7012
- /** Thermostat exposes target humidity and/or current humidity
7013
- * readings. Gates the humidity controls. */
7014
- DeviceFeature["ClimateHumidity"] = "climate-humidity";
7015
- /** Thermostat exposes a fan-mode selector. */
7016
- DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
7017
- /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
7018
- DeviceFeature["ClimatePreset"] = "climate-preset";
7019
- /** Cover exposes intermediate position control (0..100). Gates the
7020
- * position slider UI. */
7021
- DeviceFeature["CoverPositionable"] = "cover-positionable";
7022
- /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
7023
- DeviceFeature["CoverTilt"] = "cover-tilt";
7024
- /** Valve exposes intermediate position control (0..100). Gates the
7025
- * position slider / drag surface UI. */
7026
- DeviceFeature["ValvePositionable"] = "valve-positionable";
7027
- /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
7028
- DeviceFeature["FanSpeed"] = "fan-speed";
7029
- /** Fan exposes a preset mode selector. */
7030
- DeviceFeature["FanPreset"] = "fan-preset";
7031
- /** Fan exposes blade direction (forward/reverse) — typical of
7032
- * ceiling fans. */
7033
- DeviceFeature["FanDirection"] = "fan-direction";
7034
- /** Fan exposes an oscillation toggle. */
7035
- DeviceFeature["FanOscillating"] = "fan-oscillating";
7036
- /** Lock requires a PIN code on lock/unlock. Gates the code-entry
7037
- * field on the UI lock-controls panel. */
7038
- DeviceFeature["LockPinRequired"] = "lock-pin-required";
7039
- /** Lock supports a latch-release ("open door") action distinct from
7040
- * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
7041
- * `supported_features`. Gates the Open Door button in the UI. */
7042
- DeviceFeature["LockOpen"] = "lock-open";
7043
- /** Media player exposes a seek-to-position surface. */
7044
- DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
7045
- /** Media player exposes a volume-level setter. */
7046
- DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
7047
- /** Media player exposes a mute toggle distinct from volume=0. */
7048
- DeviceFeature["MediaPlayerMute"] = "media-player-mute";
7049
- /** Media player exposes a shuffle toggle. */
7050
- DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
7051
- /** Media player exposes a repeat mode (off / all / one). */
7052
- DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
7053
- /** Media player exposes a source / input selector. */
7054
- DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
7055
- /** Media player exposes a play-arbitrary-media surface (URL / id). */
7056
- DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
7057
- /** Media player exposes next-track. */
7058
- DeviceFeature["MediaPlayerNext"] = "media-player-next";
7059
- /** Media player exposes previous-track. */
7060
- DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
7061
- /** Media player exposes stop distinct from pause. */
7062
- DeviceFeature["MediaPlayerStop"] = "media-player-stop";
7063
- /** Alarm panel requires a PIN code on arm/disarm. */
7064
- DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
7065
- /** Presence device carries GPS coordinates (lat/lng/accuracy) in
7066
- * addition to a textual location. */
7067
- DeviceFeature["PresenceGps"] = "presence-gps";
7068
- /** Notifier accepts an inline / URL image attachment. */
7069
- DeviceFeature["NotifierImage"] = "notifier-image";
7070
- /** Notifier accepts a priority hint (high/normal/low). */
7071
- DeviceFeature["NotifierPriority"] = "notifier-priority";
7072
- /** Notifier accepts a free-form `data` payload for platform-specific
7073
- * fields. */
7074
- DeviceFeature["NotifierData"] = "notifier-data";
7075
- /** Notifier supports interactive action buttons / callbacks. */
7076
- DeviceFeature["NotifierActions"] = "notifier-actions";
7077
- /** Notifier supports per-call recipient targeting (multi-user). */
7078
- DeviceFeature["NotifierRecipients"] = "notifier-recipients";
7079
- /** Script runner accepts a variables map on each run invocation. */
7080
- DeviceFeature["ScriptVariables"] = "script-variables";
7081
- /** Automation `trigger` accepts a skipCondition flag — fires the
7082
- * automation's actions while bypassing its condition block. */
7083
- DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
7084
- return DeviceFeature;
7085
- }({});
7086
- /**
7087
- * Semantic role a device plays within its parent. Populated by driver
7088
- * addons when creating accessory devices (Reolink siren/floodlight/
7089
- * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
7090
- * admin UI to pick icons, labels, and widgets — a `Switch` with
7091
- * `role: Floodlight` renders as a bulb with a brightness slider,
7092
- * whereas a `Switch` with `role: Siren` renders as a klaxon.
7093
- *
7094
- * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
7095
- * sqlite as a nullable TEXT column — old rows keep working unchanged.
7096
- */
7097
- var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
7098
- DeviceRole["Siren"] = "siren";
7099
- DeviceRole["Floodlight"] = "floodlight";
7100
- DeviceRole["Spotlight"] = "spotlight";
7101
- DeviceRole["PirSensor"] = "pir-sensor";
7102
- DeviceRole["Chime"] = "chime";
7103
- DeviceRole["Autotrack"] = "autotrack";
7104
- DeviceRole["Nightvision"] = "nightvision";
7105
- DeviceRole["PrivacyMask"] = "privacy-mask";
7106
- DeviceRole["Doorbell"] = "doorbell";
7107
- /** Virtual HA toggle (input_boolean.*) — distinguishable from a
7108
- * real Switch device for UI rendering / export adapters. */
7109
- DeviceRole["BinaryHelper"] = "binary-helper";
7110
- /** Generic motion / occupancy / moving event source. Distinct from
7111
- * the camera accessory PirSensor role: that one is a camera child;
7112
- * this is a standalone HA / 3rd-party motion sensor. */
7113
- DeviceRole["MotionSensor"] = "motion-sensor";
7114
- DeviceRole["ContactSensor"] = "contact-sensor";
7115
- DeviceRole["LeakSensor"] = "leak-sensor";
7116
- DeviceRole["SmokeSensor"] = "smoke-sensor";
7117
- DeviceRole["COSensor"] = "co-sensor";
7118
- DeviceRole["GasSensor"] = "gas-sensor";
7119
- DeviceRole["TamperSensor"] = "tamper-sensor";
7120
- DeviceRole["VibrationSensor"] = "vibration-sensor";
7121
- DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
7122
- DeviceRole["SoundSensor"] = "sound-sensor";
7123
- /** Fallback for `binary_sensor` without a known `device_class`. */
7124
- DeviceRole["BinarySensor"] = "binary-sensor";
7125
- DeviceRole["TemperatureSensor"] = "temperature-sensor";
7126
- DeviceRole["HumiditySensor"] = "humidity-sensor";
7127
- DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
7128
- DeviceRole["PressureSensor"] = "pressure-sensor";
7129
- DeviceRole["PowerSensor"] = "power-sensor";
7130
- DeviceRole["EnergySensor"] = "energy-sensor";
7131
- DeviceRole["VoltageSensor"] = "voltage-sensor";
7132
- DeviceRole["CurrentSensor"] = "current-sensor";
7133
- DeviceRole["AirQualitySensor"] = "air-quality-sensor";
7134
- /** Battery level (numeric % via `sensor` OR low-bool via
7135
- * `binary_sensor` — the cap distinguishes via the value type). */
7136
- DeviceRole["BatterySensor"] = "battery-sensor";
7137
- /** Fallback for `sensor` numeric without a known `device_class`. */
7138
- DeviceRole["NumericSensor"] = "numeric-sensor";
7139
- /** String / enum state (HA `sensor` with `state_class: enum` or
7140
- * `attributes.options`). */
7141
- DeviceRole["EnumSensor"] = "enum-sensor";
7142
- /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
7143
- * or `date`). The slice carries the raw ISO string verbatim (hosted on
7144
- * the `enum-sensor` cap); the UI renders it locale-formatted. */
7145
- DeviceRole["DateTimeSensor"] = "datetime-sensor";
7146
- /** Last-resort fallback when nothing else matches. */
7147
- DeviceRole["GenericSensor"] = "generic-sensor";
7148
- DeviceRole["NumericControl"] = "numeric-control";
7149
- DeviceRole["SelectControl"] = "select-control";
7150
- DeviceRole["TextControl"] = "text-control";
7151
- DeviceRole["DateTimeControl"] = "datetime-control";
7152
- /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
7153
- * rich features (image, priority, channel routing). */
7154
- DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
7155
- /** Chat / messaging service (HA `notify.telegram_*`,
7156
- * `notify.discord_*`, etc.). */
7157
- DeviceRole["MessagingNotifier"] = "messaging-notifier";
7158
- /** Email-based delivery (HA `notify.smtp`, etc.). */
7159
- DeviceRole["EmailNotifier"] = "email-notifier";
7160
- /** Fallback when the notifier service name doesn't match a known
7161
- * pattern. */
7162
- DeviceRole["GenericNotifier"] = "generic-notifier";
7163
- return DeviceRole;
7164
- }({});
7165
7295
  /**
7166
7296
  * Accessory device helpers — shared across drivers.
7167
7297
  *
@@ -7321,74 +7451,6 @@ object({
7321
7451
  });
7322
7452
  DeviceType.Sensor;
7323
7453
  /**
7324
- * Generic types for capability definitions.
7325
- *
7326
- * A capability is defined with Zod schemas for methods, events, and settings.
7327
- * TypeScript types are inferred via z.infer<> — zero duplication.
7328
- *
7329
- * Pattern:
7330
- * 1. Define Zod schemas for data, methods, settings
7331
- * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
7332
- * 3. Export type IProvider = InferProvider<typeof capabilityDef>
7333
- * 4. Addon implements IProvider
7334
- * 5. Registry auto-mounts tRPC router from definition.methods
7335
- */
7336
- /**
7337
- * Output schema shared by the contribution + live methods.
7338
- *
7339
- * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
7340
- * tabs[]) without importing from `../interfaces/config-ui.js` — a
7341
- * concrete-but-lenient Zod object keeps tRPC output inference happy
7342
- * (using `z.unknown()` here collapses unrelated router branches to
7343
- * `unknown` when the generator re-inlines the huge AppRouter type).
7344
- *
7345
- * `.passthrough()` on sections/fields accepts whatever FormBuilder
7346
- * extensions the caller adds (showWhen, displayScale, …) without
7347
- * rebuilding every time a new field kind is introduced.
7348
- */
7349
- var ContributionSectionSchema = object({
7350
- id: string(),
7351
- title: string(),
7352
- description: string().optional(),
7353
- style: _enum(["card", "accordion"]).optional(),
7354
- defaultCollapsed: boolean().optional(),
7355
- columns: union([
7356
- literal(1),
7357
- literal(2),
7358
- literal(3),
7359
- literal(4)
7360
- ]).optional(),
7361
- tab: string().optional(),
7362
- location: _enum(["settings", "top-tab"]).optional(),
7363
- order: number().optional(),
7364
- fields: array(any())
7365
- });
7366
- object({
7367
- tabs: array(object({
7368
- id: string(),
7369
- label: string(),
7370
- icon: string(),
7371
- order: number().optional()
7372
- })).optional(),
7373
- sections: array(ContributionSectionSchema)
7374
- }).nullable();
7375
- object({ deviceId: number() }), object({ deviceId: number() }), object({
7376
- deviceId: number(),
7377
- patch: record(string(), unknown())
7378
- }), object({ success: literal(true) });
7379
- object({ deviceId: number() }), unknown().nullable();
7380
- /** Shorthand to define a method schema */
7381
- function method(input, output, options) {
7382
- return {
7383
- input,
7384
- output,
7385
- kind: options?.kind ?? "query",
7386
- auth: options?.auth ?? "protected",
7387
- ...options?.access !== void 0 ? { access: options.access } : {},
7388
- timeoutMs: options?.timeoutMs
7389
- };
7390
- }
7391
- /**
7392
7454
  * Alarm-panel cap. Models HA `alarm_control_panel.*` on
7393
7455
  * `DeviceType.AlarmPanel`. State follows HA's canonical lifecycle
7394
7456
  * across disarmed / armed_(home|away|night|vacation|custom_bypass) /
@@ -11390,9 +11452,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
11390
11452
  limit: number().optional(),
11391
11453
  tags: record(string(), string()).optional()
11392
11454
  }), array(LogEntrySchema).readonly());
11393
- var StaticDirOutputSchema = object({ staticDir: string() });
11394
- var VersionOutputSchema = object({ version: string() });
11395
- method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
11396
11455
  /**
11397
11456
  * Zod schemas for persisted record types.
11398
11457
  *
@@ -13761,7 +13820,7 @@ method(object({
13761
13820
  }), _void(), {
13762
13821
  kind: "mutation",
13763
13822
  auth: "admin"
13764
- }), 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({
13823
+ }), 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({
13765
13824
  deviceId: number(),
13766
13825
  values: record(string(), unknown())
13767
13826
  }), object({ success: literal(true) }), {
@@ -14443,7 +14502,20 @@ var DiskSpaceInfoSchema = object({
14443
14502
  var PidResourceStatsSchema = object({
14444
14503
  pid: number(),
14445
14504
  cpu: number(),
14446
- memory: number()
14505
+ memory: number(),
14506
+ /**
14507
+ * Private (anonymous) resident bytes — the per-process V8 heap + native
14508
+ * allocations NOT shared with other processes (Linux RssAnon). This is the
14509
+ * "real" per-runner cost; summing it across runners is meaningful, unlike
14510
+ * `memory` (RSS), which double-counts the shared mmap'd framework code.
14511
+ * Undefined where /proc is unavailable (e.g. macOS).
14512
+ */
14513
+ privateBytes: number().optional(),
14514
+ /**
14515
+ * Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
14516
+ * code shared copy-on-write across runners. Undefined on macOS.
14517
+ */
14518
+ sharedBytes: number().optional()
14447
14519
  });
14448
14520
  var AddonInstanceSchema = object({
14449
14521
  addonId: string(),
@@ -14492,6 +14564,17 @@ var KillProcessResultSchema = object({
14492
14564
  reason: string().optional(),
14493
14565
  signal: _enum(["SIGTERM", "SIGKILL"]).optional()
14494
14566
  });
14567
+ var DumpHeapSnapshotInputSchema = object({
14568
+ /** The addon whose runner should dump a heap snapshot. */
14569
+ addonId: string() });
14570
+ var DumpHeapSnapshotResultSchema = object({
14571
+ success: boolean(),
14572
+ /** Path of the written .heapsnapshot inside the runner's container/host. */
14573
+ path: string().optional(),
14574
+ /** Process pid that was signalled. */
14575
+ pid: number().optional(),
14576
+ reason: string().optional()
14577
+ });
14495
14578
  var SystemMetricsSchema = object({
14496
14579
  cpuPercent: number(),
14497
14580
  memoryPercent: number(),
@@ -14505,6 +14588,9 @@ var SystemMetricsSchema = object({
14505
14588
  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, {
14506
14589
  kind: "mutation",
14507
14590
  auth: "admin"
14591
+ }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
14592
+ kind: "mutation",
14593
+ auth: "admin"
14508
14594
  });
14509
14595
  var PtzPresetSchema = object({
14510
14596
  id: string(),
@@ -14871,63 +14957,6 @@ method(object({
14871
14957
  auth: "admin"
14872
14958
  });
14873
14959
  /**
14874
- * device-ops — device-scoped cap that unifies the per-IDevice operations
14875
- * previously routed through the `.device-ops` Moleculer bridge service.
14876
- *
14877
- * Each worker that hosts live `IDevice` instances auto-registers a native
14878
- * provider for this cap (per device) backed by its local
14879
- * `DeviceRegistry`. Hub-side callers reach it transparently through
14880
- * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
14881
- * `deviceId` + `nodeId` and dispatches through the standard cap-router,
14882
- * so there's no parallel bridge path anymore.
14883
- *
14884
- * The surface is intentionally small — every method corresponds to a
14885
- * single action on the live `IDevice` (or `ICameraDevice` for
14886
- * `getStreamSources`). Richer orchestration (enable/disable with
14887
- * integration plumbing, bulk updates) stays in the `device-manager` cap;
14888
- * `device-ops` is the per-device primitive the device-manager routes to.
14889
- */
14890
- var StreamSourceEntrySchema$1 = object({
14891
- id: string(),
14892
- label: string(),
14893
- protocol: _enum([
14894
- "rtsp",
14895
- "rtmp",
14896
- "annexb",
14897
- "http-mjpeg",
14898
- "webrtc",
14899
- "custom"
14900
- ]),
14901
- url: string().optional(),
14902
- resolution: object({
14903
- width: number(),
14904
- height: number()
14905
- }).optional(),
14906
- fps: number().optional(),
14907
- bitrate: number().optional(),
14908
- codec: string().optional(),
14909
- profileHint: CamProfileSchema.optional(),
14910
- sdp: string().optional()
14911
- });
14912
- var ConfigEntrySchema$1 = object({
14913
- key: string(),
14914
- value: unknown()
14915
- });
14916
- var RawStateResultSchema = object({
14917
- /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
14918
- source: string(),
14919
- /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
14920
- data: record(string(), unknown())
14921
- });
14922
- method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
14923
- deviceId: number(),
14924
- values: record(string(), unknown())
14925
- }), _void(), { kind: "mutation" }), method(object({
14926
- deviceId: number(),
14927
- action: string().min(1),
14928
- input: unknown()
14929
- }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
14930
- /**
14931
14960
  * camera-credentials — device-scoped cap exposing the camera's network
14932
14961
  * + auth surface in a vendor-neutral shape.
14933
14962
  *
@@ -18610,6 +18639,12 @@ Object.freeze({
18610
18639
  addonId: null,
18611
18640
  access: "view"
18612
18641
  },
18642
+ "metricsProvider.dumpHeapSnapshot": {
18643
+ capName: "metrics-provider",
18644
+ capScope: "system",
18645
+ addonId: null,
18646
+ access: "create"
18647
+ },
18613
18648
  "metricsProvider.getAddonStats": {
18614
18649
  capName: "metrics-provider",
18615
18650
  capScope: "system",
@@ -52771,7 +52806,7 @@ var BrokerProbeCache = class {
52771
52806
  try {
52772
52807
  const brokers = this.getBrokers();
52773
52808
  const liveIds = new Set(brokers.map((b) => b.id));
52774
- for (const cachedId of [...this.cache.keys()]) if (!liveIds.has(cachedId)) this.cache.delete(cachedId);
52809
+ for (const cachedId of Array.from(this.cache.keys())) if (!liveIds.has(cachedId)) this.cache.delete(cachedId);
52775
52810
  await Promise.all(brokers.map(async (broker) => {
52776
52811
  if (this.stopped) return;
52777
52812
  try {