@camstack/addon-provider-homeassistant 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.
Files changed (3) hide show
  1. package/dist/addon.js +725 -688
  2. package/dist/addon.mjs +725 -688
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -4629,63 +4629,7 @@ function _instanceof(cls, params = {}) {
4629
4629
  return inst;
4630
4630
  }
4631
4631
  //#endregion
4632
- //#region ../types/dist/index.mjs
4633
- /**
4634
- * Deep wiring healthcheck — snapshot of active reachability probes across
4635
- * every declared capability + widget of every installed plugin, on every
4636
- * node. Produced by the backend `WiringHealthService` and surfaced via
4637
- * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
4638
- *
4639
- * Unlike `/health` (process liveness), this reflects whether each cap/widget
4640
- * is actually *reachable* over the real cap-dispatch path. See spec
4641
- * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
4642
- */
4643
- /** What kind of target a probe addressed. */
4644
- var wiringProbeKindSchema = _enum([
4645
- "singleton",
4646
- "device",
4647
- "widget"
4648
- ]);
4649
- /** Result of probing a single (cap|widget [, device]) target. */
4650
- var wiringProbeResultSchema = object({
4651
- capName: string(),
4652
- kind: wiringProbeKindSchema,
4653
- deviceId: number().optional(),
4654
- reachable: boolean(),
4655
- latencyMs: number(),
4656
- error: string().optional()
4657
- });
4658
- /** Per-addon roll-up of cap + widget probe results. */
4659
- var wiringAddonHealthSchema = object({
4660
- addonId: string(),
4661
- caps: array(wiringProbeResultSchema).readonly(),
4662
- widgets: array(wiringProbeResultSchema).readonly()
4663
- });
4664
- /** Per-node roll-up. */
4665
- var wiringNodeHealthSchema = object({
4666
- nodeId: string(),
4667
- addons: array(wiringAddonHealthSchema).readonly()
4668
- });
4669
- object({
4670
- /** True only when every probed target is reachable. */
4671
- ok: boolean(),
4672
- /** True when at least one target is unreachable. */
4673
- degraded: boolean(),
4674
- checkedAt: string(),
4675
- nodes: array(wiringNodeHealthSchema).readonly(),
4676
- summary: object({
4677
- total: number(),
4678
- reachable: number(),
4679
- unreachable: number()
4680
- })
4681
- });
4682
- var MODEL_FORMATS = [
4683
- "onnx",
4684
- "coreml",
4685
- "openvino",
4686
- "tflite",
4687
- "pt"
4688
- ];
4632
+ //#region ../types/dist/sleep-B1dKJAMJ.mjs
4689
4633
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4690
4634
  EventCategory["SystemBoot"] = "system.boot";
4691
4635
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5659,7 +5603,7 @@ var BaseAddon = class {
5659
5603
  deviceSettingsSchema() {
5660
5604
  return null;
5661
5605
  }
5662
- async getGlobalSettings(overlay, cap) {
5606
+ async getGlobalSettings(overlay, cap, _nodeId) {
5663
5607
  const schema = this.globalSettingsSchema(cap);
5664
5608
  if (!schema) return { sections: [] };
5665
5609
  const raw = await this._ctx?.settings?.readAddonStore() ?? {};
@@ -5668,7 +5612,7 @@ var BaseAddon = class {
5668
5612
  ...overlay
5669
5613
  } : raw);
5670
5614
  }
5671
- async updateGlobalSettings(patch) {
5615
+ async updateGlobalSettings(patch, _nodeId) {
5672
5616
  await this._ctx?.settings?.writeAddonStore(patch);
5673
5617
  await this.resolveConfig();
5674
5618
  await this.onConfigChanged();
@@ -6008,7 +5952,7 @@ var ProfileSlotSchema = object({
6008
5952
  * Zod schema for StreamSourceEntry — the canonical stream descriptor
6009
5953
  * exposed by ICameraDevice.getStreamSources() and consumed by the broker.
6010
5954
  */
6011
- var StreamSourceEntrySchema = object({
5955
+ var StreamSourceEntrySchema$1 = object({
6012
5956
  id: string(),
6013
5957
  label: string(),
6014
5958
  protocol: _enum([
@@ -6230,117 +6174,595 @@ var ProfileRtspEntrySchema = object({
6230
6174
  codec: string().optional(),
6231
6175
  resolution: CamStreamResolutionSchema.optional()
6232
6176
  });
6177
+ var DeviceType = /* @__PURE__ */ function(DeviceType) {
6178
+ DeviceType["Camera"] = "camera";
6179
+ DeviceType["Hub"] = "hub";
6180
+ DeviceType["Light"] = "light";
6181
+ DeviceType["Siren"] = "siren";
6182
+ DeviceType["Switch"] = "switch";
6183
+ DeviceType["Sensor"] = "sensor";
6184
+ DeviceType["Thermostat"] = "thermostat";
6185
+ DeviceType["Button"] = "button";
6186
+ /** Generic stateless event emitter — carries a device's EXACT declared
6187
+ * event vocabulary verbatim (no normalization). Installed with the
6188
+ * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6189
+ * HA bus events (e.g. `zha_event`, generic). */
6190
+ DeviceType["EventEmitter"] = "event-emitter";
6191
+ /** Firmware/software update entity — current vs available version,
6192
+ * updatable flag, update state, and an install action. Installed with
6193
+ * the `update` cap. Sources: Homematic firmware-update channels (and
6194
+ * reusable by other providers, e.g. HA `update.*` entities). */
6195
+ DeviceType["Update"] = "update";
6196
+ DeviceType["Generic"] = "generic";
6197
+ /** Generic notification delivery target (HA `notify.<service>`, future
6198
+ * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6199
+ * endpoint; the `notifier` cap defines the send surface. */
6200
+ DeviceType["Notifier"] = "notifier";
6201
+ /** Pre-recorded action sequence with optional parameters
6202
+ * (HA `script.*`). Runnable via `script-runner` cap. */
6203
+ DeviceType["Script"] = "script";
6204
+ /** Automation rule (HA `automation.*`) — enable/disable + manual
6205
+ * trigger surface exposed via `automation-control` cap. */
6206
+ DeviceType["Automation"] = "automation";
6207
+ /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6208
+ DeviceType["Lock"] = "lock";
6209
+ /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6210
+ * `valve.*`). `cover` cap with sub-roles for variant. */
6211
+ DeviceType["Cover"] = "cover";
6212
+ /** Pipe / water / gas valve with open/close/stop and optional
6213
+ * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6214
+ * modelled on the same open/closed lifecycle. */
6215
+ DeviceType["Valve"] = "valve";
6216
+ /** Humidifier / dehumidifier with on/off + target humidity + mode
6217
+ * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6218
+ * modelled on the same target / mode lifecycle. */
6219
+ DeviceType["Humidifier"] = "humidifier";
6220
+ /** Water heater / boiler with target temperature + operation mode +
6221
+ * away mode (HA `water_heater.*`). `water-heater` cap — a
6222
+ * climate-family actuator. */
6223
+ DeviceType["WaterHeater"] = "water-heater";
6224
+ /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6225
+ DeviceType["Fan"] = "fan";
6226
+ /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6227
+ * the camera surface — those use `Camera`. `media-player` cap. */
6228
+ DeviceType["MediaPlayer"] = "media-player";
6229
+ /** Security panel / alarm system (HA `alarm_control_panel.*`).
6230
+ * `alarm-panel` cap. */
6231
+ DeviceType["AlarmPanel"] = "alarm-panel";
6232
+ /** Generic user-settable input (HA `number` / `input_number` / `select`
6233
+ * / `input_select` / `text` / `input_text` / `input_datetime`).
6234
+ * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6235
+ * TextControl / DateTimeControl. */
6236
+ DeviceType["Control"] = "control";
6237
+ /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6238
+ * `presence` cap. */
6239
+ DeviceType["Presence"] = "presence";
6240
+ /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6241
+ * `weather` cap. */
6242
+ DeviceType["Weather"] = "weather";
6243
+ /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6244
+ DeviceType["Vacuum"] = "vacuum";
6245
+ /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6246
+ * `lawn-mower-control` cap. */
6247
+ DeviceType["LawnMower"] = "lawn-mower";
6248
+ /** Physical HA device group — parent container for entity-children
6249
+ * adopted from a single HA device entry. Not renderable as a
6250
+ * standalone device; exists only to anchor child entities. */
6251
+ DeviceType["Container"] = "container";
6252
+ /** Single still-image entity (HA `image.*`). Read-only display of an
6253
+ * `entity_picture` signed URL the browser loads directly. `image` cap. */
6254
+ DeviceType["Image"] = "image";
6255
+ return DeviceType;
6256
+ }({});
6257
+ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6258
+ DeviceFeature["BatteryOperated"] = "battery-operated";
6259
+ DeviceFeature["Rebootable"] = "rebootable";
6260
+ /**
6261
+ * Device supports an on-demand re-sync of its derived spec with its
6262
+ * upstream source — drives the generic Re-sync button. The owning
6263
+ * provider implements the action via the `device-adoption.resync` cap.
6264
+ */
6265
+ DeviceFeature["Resyncable"] = "resyncable";
6266
+ DeviceFeature["NativeSnapshot"] = "native-snapshot";
6267
+ DeviceFeature["DoorbellButton"] = "doorbell-button";
6268
+ DeviceFeature["TwoWayAudio"] = "two-way-audio";
6269
+ DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6270
+ /**
6271
+ * Camera supports the on-firmware autotrack subsystem (subject-
6272
+ * following). Distinct from `PanTiltZoom` because not every PTZ
6273
+ * camera ships autotrack — the admin UI uses this flag to gate
6274
+ * the autotrack toggle / settings card without re-deriving from
6275
+ * the cap registry. Mirrors `ptz-autotrack` cap registration:
6276
+ * driver sets this feature when probe confirms the firmware
6277
+ * surface, and registers the cap in the same code path.
6278
+ */
6279
+ DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6280
+ /**
6281
+ * Accessory exposes a "trigger on motion" toggle — the parent camera's
6282
+ * motion detection automatically activates this device. Mirrors
6283
+ * `motion-trigger` cap registration: drivers set this feature in the
6284
+ * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6285
+ *
6286
+ * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6287
+ * fast scalar without binding fetch), notifier rules, and `listAll`
6288
+ * filters that want "all devices with on-motion behaviour".
6289
+ */
6290
+ DeviceFeature["MotionTrigger"] = "motion-trigger";
6291
+ /** Light supports rgb-triplet color via `color` cap. */
6292
+ DeviceFeature["LightColorRgb"] = "light-color-rgb";
6293
+ /** Light supports HSV color via `color` cap. */
6294
+ DeviceFeature["LightColorHsv"] = "light-color-hsv";
6295
+ /** Light supports color-temperature (mired) via `color` cap. */
6296
+ DeviceFeature["LightColorMired"] = "light-color-mired";
6297
+ /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6298
+ * targetHigh). Gates the range slider UI. */
6299
+ DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6300
+ /** Thermostat exposes target humidity and/or current humidity
6301
+ * readings. Gates the humidity controls. */
6302
+ DeviceFeature["ClimateHumidity"] = "climate-humidity";
6303
+ /** Thermostat exposes a fan-mode selector. */
6304
+ DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6305
+ /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6306
+ DeviceFeature["ClimatePreset"] = "climate-preset";
6307
+ /** Cover exposes intermediate position control (0..100). Gates the
6308
+ * position slider UI. */
6309
+ DeviceFeature["CoverPositionable"] = "cover-positionable";
6310
+ /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6311
+ DeviceFeature["CoverTilt"] = "cover-tilt";
6312
+ /** Valve exposes intermediate position control (0..100). Gates the
6313
+ * position slider / drag surface UI. */
6314
+ DeviceFeature["ValvePositionable"] = "valve-positionable";
6315
+ /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6316
+ DeviceFeature["FanSpeed"] = "fan-speed";
6317
+ /** Fan exposes a preset mode selector. */
6318
+ DeviceFeature["FanPreset"] = "fan-preset";
6319
+ /** Fan exposes blade direction (forward/reverse) — typical of
6320
+ * ceiling fans. */
6321
+ DeviceFeature["FanDirection"] = "fan-direction";
6322
+ /** Fan exposes an oscillation toggle. */
6323
+ DeviceFeature["FanOscillating"] = "fan-oscillating";
6324
+ /** Lock requires a PIN code on lock/unlock. Gates the code-entry
6325
+ * field on the UI lock-controls panel. */
6326
+ DeviceFeature["LockPinRequired"] = "lock-pin-required";
6327
+ /** Lock supports a latch-release ("open door") action distinct from
6328
+ * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
6329
+ * `supported_features`. Gates the Open Door button in the UI. */
6330
+ DeviceFeature["LockOpen"] = "lock-open";
6331
+ /** Media player exposes a seek-to-position surface. */
6332
+ DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
6333
+ /** Media player exposes a volume-level setter. */
6334
+ DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
6335
+ /** Media player exposes a mute toggle distinct from volume=0. */
6336
+ DeviceFeature["MediaPlayerMute"] = "media-player-mute";
6337
+ /** Media player exposes a shuffle toggle. */
6338
+ DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
6339
+ /** Media player exposes a repeat mode (off / all / one). */
6340
+ DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
6341
+ /** Media player exposes a source / input selector. */
6342
+ DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
6343
+ /** Media player exposes a play-arbitrary-media surface (URL / id). */
6344
+ DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
6345
+ /** Media player exposes next-track. */
6346
+ DeviceFeature["MediaPlayerNext"] = "media-player-next";
6347
+ /** Media player exposes previous-track. */
6348
+ DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
6349
+ /** Media player exposes stop distinct from pause. */
6350
+ DeviceFeature["MediaPlayerStop"] = "media-player-stop";
6351
+ /** Alarm panel requires a PIN code on arm/disarm. */
6352
+ DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
6353
+ /** Presence device carries GPS coordinates (lat/lng/accuracy) in
6354
+ * addition to a textual location. */
6355
+ DeviceFeature["PresenceGps"] = "presence-gps";
6356
+ /** Notifier accepts an inline / URL image attachment. */
6357
+ DeviceFeature["NotifierImage"] = "notifier-image";
6358
+ /** Notifier accepts a priority hint (high/normal/low). */
6359
+ DeviceFeature["NotifierPriority"] = "notifier-priority";
6360
+ /** Notifier accepts a free-form `data` payload for platform-specific
6361
+ * fields. */
6362
+ DeviceFeature["NotifierData"] = "notifier-data";
6363
+ /** Notifier supports interactive action buttons / callbacks. */
6364
+ DeviceFeature["NotifierActions"] = "notifier-actions";
6365
+ /** Notifier supports per-call recipient targeting (multi-user). */
6366
+ DeviceFeature["NotifierRecipients"] = "notifier-recipients";
6367
+ /** Script runner accepts a variables map on each run invocation. */
6368
+ DeviceFeature["ScriptVariables"] = "script-variables";
6369
+ /** Automation `trigger` accepts a skipCondition flag — fires the
6370
+ * automation's actions while bypassing its condition block. */
6371
+ DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
6372
+ return DeviceFeature;
6373
+ }({});
6233
6374
  /**
6234
- * Numeric day-of-week: 0 = Sunday 6 = Saturday (matches `Date.getDay`).
6235
- * Named `RecordingWeekday` to avoid collision with the string-union
6236
- * `Weekday` exported from `interfaces/timezones.ts`.
6237
- */
6238
- var RecordingWeekdaySchema = number().int().min(0).max(6);
6239
- var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6240
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6241
- kind: literal("timeOfDay"),
6242
- start: string().regex(HHMM),
6243
- end: string().regex(HHMM),
6244
- /** Restrict to these weekdays; omit = every day. */
6245
- days: array(RecordingWeekdaySchema).optional()
6246
- })]);
6247
- var RecordingModeSchema = _enum([
6248
- "continuous",
6249
- "onMotion",
6250
- "onAudioThreshold"
6251
- ]);
6252
- /**
6253
- * First-class, authoritative per-camera storage mode — the netta choice the UI
6254
- * reads directly (never inferred from `rules`):
6255
- * - `off` — not recording.
6256
- * - `events` — record only around triggers (motion / audio threshold),
6257
- * with pre/post-buffer.
6258
- * - `continuous` — record 24/7 within the schedule.
6375
+ * Semantic role a device plays within its parent. Populated by driver
6376
+ * addons when creating accessory devices (Reolink siren/floodlight/
6377
+ * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
6378
+ * admin UI to pick icons, labels, and widgets — a `Switch` with
6379
+ * `role: Floodlight` renders as a bulb with a brightness slider,
6380
+ * whereas a `Switch` with `role: Siren` renders as a klaxon.
6259
6381
  *
6260
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6261
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6382
+ * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
6383
+ * sqlite as a nullable TEXT column old rows keep working unchanged.
6262
6384
  */
6263
- var RecordingStorageModeSchema = _enum([
6264
- "off",
6265
- "events",
6266
- "continuous"
6267
- ]);
6268
- /** Which detectors trigger an `events`-mode recording. */
6269
- var RecordingTriggersSchema = object({
6270
- motion: boolean().optional(),
6271
- audioThresholdDbfs: number().optional()
6272
- });
6385
+ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
6386
+ DeviceRole["Siren"] = "siren";
6387
+ DeviceRole["Floodlight"] = "floodlight";
6388
+ DeviceRole["Spotlight"] = "spotlight";
6389
+ DeviceRole["PirSensor"] = "pir-sensor";
6390
+ DeviceRole["Chime"] = "chime";
6391
+ DeviceRole["Autotrack"] = "autotrack";
6392
+ DeviceRole["Nightvision"] = "nightvision";
6393
+ DeviceRole["PrivacyMask"] = "privacy-mask";
6394
+ DeviceRole["Doorbell"] = "doorbell";
6395
+ /** Virtual HA toggle (input_boolean.*) — distinguishable from a
6396
+ * real Switch device for UI rendering / export adapters. */
6397
+ DeviceRole["BinaryHelper"] = "binary-helper";
6398
+ /** Generic motion / occupancy / moving event source. Distinct from
6399
+ * the camera accessory PirSensor role: that one is a camera child;
6400
+ * this is a standalone HA / 3rd-party motion sensor. */
6401
+ DeviceRole["MotionSensor"] = "motion-sensor";
6402
+ DeviceRole["ContactSensor"] = "contact-sensor";
6403
+ DeviceRole["LeakSensor"] = "leak-sensor";
6404
+ DeviceRole["SmokeSensor"] = "smoke-sensor";
6405
+ DeviceRole["COSensor"] = "co-sensor";
6406
+ DeviceRole["GasSensor"] = "gas-sensor";
6407
+ DeviceRole["TamperSensor"] = "tamper-sensor";
6408
+ DeviceRole["VibrationSensor"] = "vibration-sensor";
6409
+ DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
6410
+ DeviceRole["SoundSensor"] = "sound-sensor";
6411
+ /** Fallback for `binary_sensor` without a known `device_class`. */
6412
+ DeviceRole["BinarySensor"] = "binary-sensor";
6413
+ DeviceRole["TemperatureSensor"] = "temperature-sensor";
6414
+ DeviceRole["HumiditySensor"] = "humidity-sensor";
6415
+ DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
6416
+ DeviceRole["PressureSensor"] = "pressure-sensor";
6417
+ DeviceRole["PowerSensor"] = "power-sensor";
6418
+ DeviceRole["EnergySensor"] = "energy-sensor";
6419
+ DeviceRole["VoltageSensor"] = "voltage-sensor";
6420
+ DeviceRole["CurrentSensor"] = "current-sensor";
6421
+ DeviceRole["AirQualitySensor"] = "air-quality-sensor";
6422
+ /** Battery level (numeric % via `sensor` OR low-bool via
6423
+ * `binary_sensor` — the cap distinguishes via the value type). */
6424
+ DeviceRole["BatterySensor"] = "battery-sensor";
6425
+ /** Fallback for `sensor` numeric without a known `device_class`. */
6426
+ DeviceRole["NumericSensor"] = "numeric-sensor";
6427
+ /** String / enum state (HA `sensor` with `state_class: enum` or
6428
+ * `attributes.options`). */
6429
+ DeviceRole["EnumSensor"] = "enum-sensor";
6430
+ /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
6431
+ * or `date`). The slice carries the raw ISO string verbatim (hosted on
6432
+ * the `enum-sensor` cap); the UI renders it locale-formatted. */
6433
+ DeviceRole["DateTimeSensor"] = "datetime-sensor";
6434
+ /** Last-resort fallback when nothing else matches. */
6435
+ DeviceRole["GenericSensor"] = "generic-sensor";
6436
+ DeviceRole["NumericControl"] = "numeric-control";
6437
+ DeviceRole["SelectControl"] = "select-control";
6438
+ DeviceRole["TextControl"] = "text-control";
6439
+ DeviceRole["DateTimeControl"] = "datetime-control";
6440
+ /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
6441
+ * rich features (image, priority, channel routing). */
6442
+ DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
6443
+ /** Chat / messaging service (HA `notify.telegram_*`,
6444
+ * `notify.discord_*`, etc.). */
6445
+ DeviceRole["MessagingNotifier"] = "messaging-notifier";
6446
+ /** Email-based delivery (HA `notify.smtp`, etc.). */
6447
+ DeviceRole["EmailNotifier"] = "email-notifier";
6448
+ /** Fallback when the notifier service name doesn't match a known
6449
+ * pattern. */
6450
+ DeviceRole["GenericNotifier"] = "generic-notifier";
6451
+ return DeviceRole;
6452
+ }({});
6273
6453
  /**
6274
- * Mode of a single recording band — the recorder per-band vocabulary.
6454
+ * Generic types for capability definitions.
6275
6455
  *
6276
- * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6277
- * only ever `continuous` or `events`; "off" is expressed by the absence of a
6278
- * covering band, not by a band value.
6279
- */
6280
- var RecordingBandModeSchema = _enum(["continuous", "events"]);
6281
- /**
6282
- * Triggers for an `events`-mode band. Identical shape to
6283
- * `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
6284
- * two never drift.
6285
- */
6286
- var RecordingBandTriggersSchema = RecordingTriggersSchema;
6287
- /**
6288
- * A single mode-per-band window — the canonical recorder band shape, the
6289
- * single source of truth re-used by `addon-pipeline/recorder`.
6456
+ * A capability is defined with Zod schemas for methods, events, and settings.
6457
+ * TypeScript types are inferred via z.infer<> zero duplication.
6290
6458
  *
6291
- * `days` lists the weekdays the band covers (empty = every day, matching the
6292
- * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6293
- * span wraps past midnight (handled by the band engine).
6459
+ * Pattern:
6460
+ * 1. Define Zod schemas for data, methods, settings
6461
+ * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
6462
+ * 3. Export type IProvider = InferProvider<typeof capabilityDef>
6463
+ * 4. Addon implements IProvider
6464
+ * 5. Registry auto-mounts tRPC router from definition.methods
6294
6465
  */
6295
- var RecordingBandSchema = object({
6296
- days: array(RecordingWeekdaySchema),
6297
- start: string().regex(HHMM),
6298
- end: string().regex(HHMM),
6299
- mode: RecordingBandModeSchema,
6300
- triggers: RecordingBandTriggersSchema.optional(),
6301
- preBufferSec: number().min(0).optional(),
6302
- postBufferSec: number().min(0).optional()
6303
- });
6304
- var RecordingRuleSchema = object({
6305
- schedule: RecordingScheduleSchema,
6306
- mode: RecordingModeSchema,
6307
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6308
- preBufferSec: number().min(0).default(0),
6309
- /** Keep recording until this many seconds after the last trigger. */
6310
- postBufferSec: number().min(0).default(0),
6311
- /** Each new trigger restarts the post-buffer window. */
6312
- resetTimeoutOnNewEvent: boolean().default(true),
6313
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
6314
- thresholdDbfs: number().optional()
6315
- });
6316
6466
  /**
6317
- * Per-device retention overrides. Every field is optional; an unset or `0`
6318
- * value inherits the node-wide recorder default. Only footage-lifetime limits
6319
- * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6320
- * (when the volume is too full to keep recording) is NOT a per-camera concern
6321
- * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6322
- * shared by every camera writing to that volume.
6467
+ * Output schema shared by the contribution + live methods.
6468
+ *
6469
+ * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
6470
+ * tabs[]) without importing from `../interfaces/config-ui.js` a
6471
+ * concrete-but-lenient Zod object keeps tRPC output inference happy
6472
+ * (using `z.unknown()` here collapses unrelated router branches to
6473
+ * `unknown` when the generator re-inlines the huge AppRouter type).
6474
+ *
6475
+ * `.passthrough()` on sections/fields accepts whatever FormBuilder
6476
+ * extensions the caller adds (showWhen, displayScale, …) without
6477
+ * rebuilding every time a new field kind is introduced.
6323
6478
  */
6324
- var RecordingRetentionSchema = object({
6325
- maxAgeDays: number().min(0).optional(),
6326
- maxSizeGb: number().min(0).optional()
6479
+ var ContributionSectionSchema = object({
6480
+ id: string(),
6481
+ title: string(),
6482
+ description: string().optional(),
6483
+ style: _enum(["card", "accordion"]).optional(),
6484
+ defaultCollapsed: boolean().optional(),
6485
+ columns: union([
6486
+ literal(1),
6487
+ literal(2),
6488
+ literal(3),
6489
+ literal(4)
6490
+ ]).optional(),
6491
+ tab: string().optional(),
6492
+ location: _enum(["settings", "top-tab"]).optional(),
6493
+ order: number().optional(),
6494
+ fields: array(any())
6327
6495
  });
6496
+ object({
6497
+ tabs: array(object({
6498
+ id: string(),
6499
+ label: string(),
6500
+ icon: string(),
6501
+ order: number().optional()
6502
+ })).optional(),
6503
+ sections: array(ContributionSectionSchema)
6504
+ }).nullable();
6505
+ object({ deviceId: number() }), object({ deviceId: number() }), object({
6506
+ deviceId: number(),
6507
+ patch: record(string(), unknown())
6508
+ }), object({ success: literal(true) });
6509
+ object({ deviceId: number() }), unknown().nullable();
6510
+ /** Shorthand to define a method schema */
6511
+ function method(input, output, options) {
6512
+ return {
6513
+ input,
6514
+ output,
6515
+ kind: options?.kind ?? "query",
6516
+ auth: options?.auth ?? "protected",
6517
+ ...options?.access !== void 0 ? { access: options.access } : {},
6518
+ timeoutMs: options?.timeoutMs
6519
+ };
6520
+ }
6521
+ /** Shorthand to define an event schema */
6522
+ function event(data) {
6523
+ return { data };
6524
+ }
6525
+ var StaticDirOutputSchema = object({ staticDir: string() });
6526
+ var VersionOutputSchema = object({ version: string() });
6527
+ method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
6328
6528
  /**
6329
- * The full per-camera recording intent the wire shape of a RecordingTarget.
6529
+ * device-ops device-scoped cap that unifies the per-IDevice operations
6530
+ * previously routed through the `.device-ops` Moleculer bridge service.
6330
6531
  *
6331
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6332
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6333
- * only for transition + migration (`migrateRulesToMode`); the policy engine
6334
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6532
+ * Each worker that hosts live `IDevice` instances auto-registers a native
6533
+ * provider for this cap (per device) backed by its local
6534
+ * `DeviceRegistry`. Hub-side callers reach it transparently through
6535
+ * `ctx.fetchDevice(id).deviceOps.*` the DeviceProxy injects
6536
+ * `deviceId` + `nodeId` and dispatches through the standard cap-router,
6537
+ * so there's no parallel bridge path anymore.
6538
+ *
6539
+ * The surface is intentionally small — every method corresponds to a
6540
+ * single action on the live `IDevice` (or `ICameraDevice` for
6541
+ * `getStreamSources`). Richer orchestration (enable/disable with
6542
+ * integration plumbing, bulk updates) stays in the `device-manager` cap;
6543
+ * `device-ops` is the per-device primitive the device-manager routes to.
6335
6544
  */
6336
- var RecordingConfigSchema = object({
6337
- enabled: boolean(),
6338
- /** Authoritative storage mode. Absent on legacy targets → derived once via
6339
- * `migrateRulesToMode`, then persisted. */
6340
- mode: RecordingStorageModeSchema.optional(),
6341
- profiles: array(CamProfileSchema).optional(),
6342
- segmentSeconds: number().int().positive().optional(),
6343
- /** Shared recording time-bands for `events` & `continuous` — record only when
6545
+ var StreamSourceEntrySchema = object({
6546
+ id: string(),
6547
+ label: string(),
6548
+ protocol: _enum([
6549
+ "rtsp",
6550
+ "rtmp",
6551
+ "annexb",
6552
+ "http-mjpeg",
6553
+ "webrtc",
6554
+ "custom"
6555
+ ]),
6556
+ url: string().optional(),
6557
+ resolution: object({
6558
+ width: number(),
6559
+ height: number()
6560
+ }).optional(),
6561
+ fps: number().optional(),
6562
+ bitrate: number().optional(),
6563
+ codec: string().optional(),
6564
+ profileHint: CamProfileSchema.optional(),
6565
+ sdp: string().optional()
6566
+ });
6567
+ var ConfigEntrySchema$1 = object({
6568
+ key: string(),
6569
+ value: unknown()
6570
+ });
6571
+ var RawStateResultSchema = object({
6572
+ /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
6573
+ source: string(),
6574
+ /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
6575
+ data: record(string(), unknown())
6576
+ });
6577
+ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
6578
+ deviceId: number(),
6579
+ values: record(string(), unknown())
6580
+ }), _void(), { kind: "mutation" }), method(object({
6581
+ deviceId: number(),
6582
+ action: string().min(1),
6583
+ input: unknown()
6584
+ }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
6585
+ //#endregion
6586
+ //#region ../types/dist/err-msg-IQTHeDzc.mjs
6587
+ /**
6588
+ import { errMsg } from '@camstack/types'
6589
+ * Extract a human-readable message from an unknown error value.
6590
+ * Replaces the ubiquitous `errMsg(err)` pattern.
6591
+ */
6592
+ function errMsg(err) {
6593
+ if (err instanceof Error) return err.message;
6594
+ if (typeof err === "string") return err;
6595
+ return String(err);
6596
+ }
6597
+ //#endregion
6598
+ //#region ../types/dist/index.mjs
6599
+ /**
6600
+ * Deep wiring healthcheck — snapshot of active reachability probes across
6601
+ * every declared capability + widget of every installed plugin, on every
6602
+ * node. Produced by the backend `WiringHealthService` and surfaced via
6603
+ * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
6604
+ *
6605
+ * Unlike `/health` (process liveness), this reflects whether each cap/widget
6606
+ * is actually *reachable* over the real cap-dispatch path. See spec
6607
+ * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
6608
+ */
6609
+ /** What kind of target a probe addressed. */
6610
+ var wiringProbeKindSchema = _enum([
6611
+ "singleton",
6612
+ "device",
6613
+ "widget"
6614
+ ]);
6615
+ /** Result of probing a single (cap|widget [, device]) target. */
6616
+ var wiringProbeResultSchema = object({
6617
+ capName: string(),
6618
+ kind: wiringProbeKindSchema,
6619
+ deviceId: number().optional(),
6620
+ reachable: boolean(),
6621
+ latencyMs: number(),
6622
+ error: string().optional()
6623
+ });
6624
+ /** Per-addon roll-up of cap + widget probe results. */
6625
+ var wiringAddonHealthSchema = object({
6626
+ addonId: string(),
6627
+ caps: array(wiringProbeResultSchema).readonly(),
6628
+ widgets: array(wiringProbeResultSchema).readonly()
6629
+ });
6630
+ /** Per-node roll-up. */
6631
+ var wiringNodeHealthSchema = object({
6632
+ nodeId: string(),
6633
+ addons: array(wiringAddonHealthSchema).readonly()
6634
+ });
6635
+ object({
6636
+ /** True only when every probed target is reachable. */
6637
+ ok: boolean(),
6638
+ /** True when at least one target is unreachable. */
6639
+ degraded: boolean(),
6640
+ checkedAt: string(),
6641
+ nodes: array(wiringNodeHealthSchema).readonly(),
6642
+ summary: object({
6643
+ total: number(),
6644
+ reachable: number(),
6645
+ unreachable: number()
6646
+ })
6647
+ });
6648
+ var MODEL_FORMATS = [
6649
+ "onnx",
6650
+ "coreml",
6651
+ "openvino",
6652
+ "tflite",
6653
+ "pt"
6654
+ ];
6655
+ /**
6656
+ * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6657
+ * Named `RecordingWeekday` to avoid collision with the string-union
6658
+ * `Weekday` exported from `interfaces/timezones.ts`.
6659
+ */
6660
+ var RecordingWeekdaySchema = number().int().min(0).max(6);
6661
+ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6662
+ var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6663
+ kind: literal("timeOfDay"),
6664
+ start: string().regex(HHMM),
6665
+ end: string().regex(HHMM),
6666
+ /** Restrict to these weekdays; omit = every day. */
6667
+ days: array(RecordingWeekdaySchema).optional()
6668
+ })]);
6669
+ var RecordingModeSchema = _enum([
6670
+ "continuous",
6671
+ "onMotion",
6672
+ "onAudioThreshold"
6673
+ ]);
6674
+ /**
6675
+ * First-class, authoritative per-camera storage mode — the netta choice the UI
6676
+ * reads directly (never inferred from `rules`):
6677
+ * - `off` — not recording.
6678
+ * - `events` — record only around triggers (motion / audio threshold),
6679
+ * with pre/post-buffer.
6680
+ * - `continuous` — record 24/7 within the schedule.
6681
+ *
6682
+ * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6683
+ * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6684
+ */
6685
+ var RecordingStorageModeSchema = _enum([
6686
+ "off",
6687
+ "events",
6688
+ "continuous"
6689
+ ]);
6690
+ /** Which detectors trigger an `events`-mode recording. */
6691
+ var RecordingTriggersSchema = object({
6692
+ motion: boolean().optional(),
6693
+ audioThresholdDbfs: number().optional()
6694
+ });
6695
+ /**
6696
+ * Mode of a single recording band — the recorder per-band vocabulary.
6697
+ *
6698
+ * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6699
+ * only ever `continuous` or `events`; "off" is expressed by the absence of a
6700
+ * covering band, not by a band value.
6701
+ */
6702
+ var RecordingBandModeSchema = _enum(["continuous", "events"]);
6703
+ /**
6704
+ * Triggers for an `events`-mode band. Identical shape to
6705
+ * `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
6706
+ * two never drift.
6707
+ */
6708
+ var RecordingBandTriggersSchema = RecordingTriggersSchema;
6709
+ /**
6710
+ * A single mode-per-band window — the canonical recorder band shape, the
6711
+ * single source of truth re-used by `addon-pipeline/recorder`.
6712
+ *
6713
+ * `days` lists the weekdays the band covers (empty = every day, matching the
6714
+ * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6715
+ * span wraps past midnight (handled by the band engine).
6716
+ */
6717
+ var RecordingBandSchema = object({
6718
+ days: array(RecordingWeekdaySchema),
6719
+ start: string().regex(HHMM),
6720
+ end: string().regex(HHMM),
6721
+ mode: RecordingBandModeSchema,
6722
+ triggers: RecordingBandTriggersSchema.optional(),
6723
+ preBufferSec: number().min(0).optional(),
6724
+ postBufferSec: number().min(0).optional()
6725
+ });
6726
+ var RecordingRuleSchema = object({
6727
+ schedule: RecordingScheduleSchema,
6728
+ mode: RecordingModeSchema,
6729
+ /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6730
+ preBufferSec: number().min(0).default(0),
6731
+ /** Keep recording until this many seconds after the last trigger. */
6732
+ postBufferSec: number().min(0).default(0),
6733
+ /** Each new trigger restarts the post-buffer window. */
6734
+ resetTimeoutOnNewEvent: boolean().default(true),
6735
+ /** onAudioThreshold only — dBFS level that counts as a trigger. */
6736
+ thresholdDbfs: number().optional()
6737
+ });
6738
+ /**
6739
+ * Per-device retention overrides. Every field is optional; an unset or `0`
6740
+ * value inherits the node-wide recorder default. Only footage-lifetime limits
6741
+ * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6742
+ * (when the volume is too full to keep recording) is NOT a per-camera concern —
6743
+ * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6744
+ * shared by every camera writing to that volume.
6745
+ */
6746
+ var RecordingRetentionSchema = object({
6747
+ maxAgeDays: number().min(0).optional(),
6748
+ maxSizeGb: number().min(0).optional()
6749
+ });
6750
+ /**
6751
+ * The full per-camera recording intent — the wire shape of a RecordingTarget.
6752
+ *
6753
+ * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6754
+ * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6755
+ * only for transition + migration (`migrateRulesToMode`); the policy engine
6756
+ * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6757
+ */
6758
+ var RecordingConfigSchema = object({
6759
+ enabled: boolean(),
6760
+ /** Authoritative storage mode. Absent on legacy targets → derived once via
6761
+ * `migrateRulesToMode`, then persisted. */
6762
+ mode: RecordingStorageModeSchema.optional(),
6763
+ profiles: array(CamProfileSchema).optional(),
6764
+ segmentSeconds: number().int().positive().optional(),
6765
+ /** Shared recording time-bands for `events` & `continuous` — record only when
6344
6766
  * the wall-clock falls inside one of these windows. Omit or empty = always.
6345
6767
  * `continuous` compiles to one rule per band; `events` to band × trigger. */
6346
6768
  schedules: array(RecordingScheduleSchema).optional(),
@@ -6577,16 +6999,6 @@ var EncodeProfileSchema = object({
6577
6999
  */
6578
7000
  outputArgs: array(string()).optional()
6579
7001
  });
6580
- /**
6581
- import { errMsg } from '@camstack/types'
6582
- * Extract a human-readable message from an unknown error value.
6583
- * Replaces the ubiquitous `errMsg(err)` pattern.
6584
- */
6585
- function errMsg(err) {
6586
- if (err instanceof Error) return err.message;
6587
- if (typeof err === "string") return err;
6588
- return String(err);
6589
- }
6590
7002
  var YAMNET_TO_MACRO = {
6591
7003
  mapping: {
6592
7004
  Speech: "speech",
@@ -6742,392 +7154,116 @@ var YAMNET_TO_MACRO = {
6742
7154
  "Telephone dialing, DTMF": "telephone",
6743
7155
  "Busy signal": "telephone",
6744
7156
  Engine: "engine",
6745
- "Engine starting": "engine",
6746
- Idling: "engine",
6747
- "Accelerating, revving, vroom": "engine",
6748
- "Light engine (high frequency)": "engine",
6749
- "Medium engine (mid frequency)": "engine",
6750
- "Heavy engine (low frequency)": "engine",
6751
- "Lawn mower": "engine",
6752
- Chainsaw: "engine",
6753
- Hammer: "tools",
6754
- Jackhammer: "tools",
6755
- Sawing: "tools",
6756
- "Power tool": "tools",
6757
- Drill: "tools",
6758
- Sanding: "tools",
6759
- Silence: "silence"
6760
- },
6761
- preserveOriginal: false
6762
- };
6763
- var APPLE_SA_TO_MACRO = {
6764
- mapping: {
6765
- speech: "speech",
6766
- child_speech: "speech",
6767
- conversation: "speech",
6768
- whispering: "speech",
6769
- singing: "speech",
6770
- humming: "speech",
6771
- shout: "scream",
6772
- yell: "scream",
6773
- screaming: "scream",
6774
- crying: "crying",
6775
- baby_crying: "crying",
6776
- sobbing: "crying",
6777
- laughter: "laughter",
6778
- baby_laughter: "laughter",
6779
- giggling: "laughter",
6780
- music: "music",
6781
- guitar: "music",
6782
- piano: "music",
6783
- drums: "music",
6784
- dog_bark: "dog",
6785
- dog_bow_wow: "dog",
6786
- dog_growling: "dog",
6787
- dog_howl: "dog",
6788
- cat_meow: "cat",
6789
- cat_purr: "cat",
6790
- cat_hiss: "cat",
6791
- bird: "bird",
6792
- bird_chirp: "bird",
6793
- bird_squawk: "bird",
6794
- animal: "animal",
6795
- horse: "animal",
6796
- cow_moo: "animal",
6797
- insect: "animal",
6798
- alarm: "alarm",
6799
- smoke_alarm: "alarm",
6800
- fire_alarm: "alarm",
6801
- car_alarm: "alarm",
6802
- siren: "siren",
6803
- police_siren: "siren",
6804
- ambulance_siren: "siren",
6805
- doorbell: "doorbell",
6806
- door_knock: "doorbell",
6807
- knocking: "doorbell",
6808
- glass_breaking: "glass_breaking",
6809
- glass_shatter: "glass_breaking",
6810
- gunshot: "gunshot",
6811
- explosion: "gunshot",
6812
- fireworks: "gunshot",
6813
- car: "vehicle",
6814
- truck: "vehicle",
6815
- motorcycle: "vehicle",
6816
- car_horn: "vehicle",
6817
- vehicle_horn: "vehicle",
6818
- traffic: "vehicle",
6819
- fire: "fire",
6820
- fire_crackle: "fire",
6821
- water: "water",
6822
- rain: "water",
6823
- ocean: "water",
6824
- splash: "water",
6825
- wind: "wind",
6826
- thunder: "wind",
6827
- thunderstorm: "wind",
6828
- door: "door",
6829
- door_slam: "door",
6830
- sliding_door: "door",
6831
- footsteps: "footsteps",
6832
- walking: "footsteps",
6833
- running: "footsteps",
6834
- crowd: "crowd",
6835
- chatter: "crowd",
6836
- cheering: "crowd",
6837
- applause: "crowd",
6838
- telephone_ring: "telephone",
6839
- ringtone: "telephone",
6840
- engine: "engine",
6841
- engine_starting: "engine",
6842
- lawn_mower: "engine",
6843
- chainsaw: "engine",
6844
- hammer: "tools",
6845
- jackhammer: "tools",
6846
- drill: "tools",
6847
- power_tool: "tools",
6848
- silence: "silence"
6849
- },
6850
- preserveOriginal: false
6851
- };
6852
- var _macroLookup = /* @__PURE__ */ new Map();
6853
- for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6854
- for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6855
- var DeviceType = /* @__PURE__ */ function(DeviceType) {
6856
- DeviceType["Camera"] = "camera";
6857
- DeviceType["Hub"] = "hub";
6858
- DeviceType["Light"] = "light";
6859
- DeviceType["Siren"] = "siren";
6860
- DeviceType["Switch"] = "switch";
6861
- DeviceType["Sensor"] = "sensor";
6862
- DeviceType["Thermostat"] = "thermostat";
6863
- DeviceType["Button"] = "button";
6864
- /** Generic stateless event emitter — carries a device's EXACT declared
6865
- * event vocabulary verbatim (no normalization). Installed with the
6866
- * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6867
- * HA bus events (e.g. `zha_event`, generic). */
6868
- DeviceType["EventEmitter"] = "event-emitter";
6869
- /** Firmware/software update entity — current vs available version,
6870
- * updatable flag, update state, and an install action. Installed with
6871
- * the `update` cap. Sources: Homematic firmware-update channels (and
6872
- * reusable by other providers, e.g. HA `update.*` entities). */
6873
- DeviceType["Update"] = "update";
6874
- DeviceType["Generic"] = "generic";
6875
- /** Generic notification delivery target (HA `notify.<service>`, future
6876
- * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6877
- * endpoint; the `notifier` cap defines the send surface. */
6878
- DeviceType["Notifier"] = "notifier";
6879
- /** Pre-recorded action sequence with optional parameters
6880
- * (HA `script.*`). Runnable via `script-runner` cap. */
6881
- DeviceType["Script"] = "script";
6882
- /** Automation rule (HA `automation.*`) — enable/disable + manual
6883
- * trigger surface exposed via `automation-control` cap. */
6884
- DeviceType["Automation"] = "automation";
6885
- /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6886
- DeviceType["Lock"] = "lock";
6887
- /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6888
- * `valve.*`). `cover` cap with sub-roles for variant. */
6889
- DeviceType["Cover"] = "cover";
6890
- /** Pipe / water / gas valve with open/close/stop and optional
6891
- * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6892
- * modelled on the same open/closed lifecycle. */
6893
- DeviceType["Valve"] = "valve";
6894
- /** Humidifier / dehumidifier with on/off + target humidity + mode
6895
- * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6896
- * modelled on the same target / mode lifecycle. */
6897
- DeviceType["Humidifier"] = "humidifier";
6898
- /** Water heater / boiler with target temperature + operation mode +
6899
- * away mode (HA `water_heater.*`). `water-heater` cap — a
6900
- * climate-family actuator. */
6901
- DeviceType["WaterHeater"] = "water-heater";
6902
- /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6903
- DeviceType["Fan"] = "fan";
6904
- /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6905
- * the camera surface — those use `Camera`. `media-player` cap. */
6906
- DeviceType["MediaPlayer"] = "media-player";
6907
- /** Security panel / alarm system (HA `alarm_control_panel.*`).
6908
- * `alarm-panel` cap. */
6909
- DeviceType["AlarmPanel"] = "alarm-panel";
6910
- /** Generic user-settable input (HA `number` / `input_number` / `select`
6911
- * / `input_select` / `text` / `input_text` / `input_datetime`).
6912
- * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6913
- * TextControl / DateTimeControl. */
6914
- DeviceType["Control"] = "control";
6915
- /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6916
- * `presence` cap. */
6917
- DeviceType["Presence"] = "presence";
6918
- /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6919
- * `weather` cap. */
6920
- DeviceType["Weather"] = "weather";
6921
- /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6922
- DeviceType["Vacuum"] = "vacuum";
6923
- /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6924
- * `lawn-mower-control` cap. */
6925
- DeviceType["LawnMower"] = "lawn-mower";
6926
- /** Physical HA device group — parent container for entity-children
6927
- * adopted from a single HA device entry. Not renderable as a
6928
- * standalone device; exists only to anchor child entities. */
6929
- DeviceType["Container"] = "container";
6930
- /** Single still-image entity (HA `image.*`). Read-only display of an
6931
- * `entity_picture` signed URL the browser loads directly. `image` cap. */
6932
- DeviceType["Image"] = "image";
6933
- return DeviceType;
6934
- }({});
6935
- var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6936
- DeviceFeature["BatteryOperated"] = "battery-operated";
6937
- DeviceFeature["Rebootable"] = "rebootable";
6938
- /**
6939
- * Device supports an on-demand re-sync of its derived spec with its
6940
- * upstream source — drives the generic Re-sync button. The owning
6941
- * provider implements the action via the `device-adoption.resync` cap.
6942
- */
6943
- DeviceFeature["Resyncable"] = "resyncable";
6944
- DeviceFeature["NativeSnapshot"] = "native-snapshot";
6945
- DeviceFeature["DoorbellButton"] = "doorbell-button";
6946
- DeviceFeature["TwoWayAudio"] = "two-way-audio";
6947
- DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6948
- /**
6949
- * Camera supports the on-firmware autotrack subsystem (subject-
6950
- * following). Distinct from `PanTiltZoom` because not every PTZ
6951
- * camera ships autotrack — the admin UI uses this flag to gate
6952
- * the autotrack toggle / settings card without re-deriving from
6953
- * the cap registry. Mirrors `ptz-autotrack` cap registration:
6954
- * driver sets this feature when probe confirms the firmware
6955
- * surface, and registers the cap in the same code path.
6956
- */
6957
- DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6958
- /**
6959
- * Accessory exposes a "trigger on motion" toggle — the parent camera's
6960
- * motion detection automatically activates this device. Mirrors
6961
- * `motion-trigger` cap registration: drivers set this feature in the
6962
- * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6963
- *
6964
- * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6965
- * fast scalar without binding fetch), notifier rules, and `listAll`
6966
- * filters that want "all devices with on-motion behaviour".
6967
- */
6968
- DeviceFeature["MotionTrigger"] = "motion-trigger";
6969
- /** Light supports rgb-triplet color via `color` cap. */
6970
- DeviceFeature["LightColorRgb"] = "light-color-rgb";
6971
- /** Light supports HSV color via `color` cap. */
6972
- DeviceFeature["LightColorHsv"] = "light-color-hsv";
6973
- /** Light supports color-temperature (mired) via `color` cap. */
6974
- DeviceFeature["LightColorMired"] = "light-color-mired";
6975
- /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6976
- * targetHigh). Gates the range slider UI. */
6977
- DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6978
- /** Thermostat exposes target humidity and/or current humidity
6979
- * readings. Gates the humidity controls. */
6980
- DeviceFeature["ClimateHumidity"] = "climate-humidity";
6981
- /** Thermostat exposes a fan-mode selector. */
6982
- DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6983
- /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6984
- DeviceFeature["ClimatePreset"] = "climate-preset";
6985
- /** Cover exposes intermediate position control (0..100). Gates the
6986
- * position slider UI. */
6987
- DeviceFeature["CoverPositionable"] = "cover-positionable";
6988
- /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6989
- DeviceFeature["CoverTilt"] = "cover-tilt";
6990
- /** Valve exposes intermediate position control (0..100). Gates the
6991
- * position slider / drag surface UI. */
6992
- DeviceFeature["ValvePositionable"] = "valve-positionable";
6993
- /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6994
- DeviceFeature["FanSpeed"] = "fan-speed";
6995
- /** Fan exposes a preset mode selector. */
6996
- DeviceFeature["FanPreset"] = "fan-preset";
6997
- /** Fan exposes blade direction (forward/reverse) — typical of
6998
- * ceiling fans. */
6999
- DeviceFeature["FanDirection"] = "fan-direction";
7000
- /** Fan exposes an oscillation toggle. */
7001
- DeviceFeature["FanOscillating"] = "fan-oscillating";
7002
- /** Lock requires a PIN code on lock/unlock. Gates the code-entry
7003
- * field on the UI lock-controls panel. */
7004
- DeviceFeature["LockPinRequired"] = "lock-pin-required";
7005
- /** Lock supports a latch-release ("open door") action distinct from
7006
- * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
7007
- * `supported_features`. Gates the Open Door button in the UI. */
7008
- DeviceFeature["LockOpen"] = "lock-open";
7009
- /** Media player exposes a seek-to-position surface. */
7010
- DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
7011
- /** Media player exposes a volume-level setter. */
7012
- DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
7013
- /** Media player exposes a mute toggle distinct from volume=0. */
7014
- DeviceFeature["MediaPlayerMute"] = "media-player-mute";
7015
- /** Media player exposes a shuffle toggle. */
7016
- DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
7017
- /** Media player exposes a repeat mode (off / all / one). */
7018
- DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
7019
- /** Media player exposes a source / input selector. */
7020
- DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
7021
- /** Media player exposes a play-arbitrary-media surface (URL / id). */
7022
- DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
7023
- /** Media player exposes next-track. */
7024
- DeviceFeature["MediaPlayerNext"] = "media-player-next";
7025
- /** Media player exposes previous-track. */
7026
- DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
7027
- /** Media player exposes stop distinct from pause. */
7028
- DeviceFeature["MediaPlayerStop"] = "media-player-stop";
7029
- /** Alarm panel requires a PIN code on arm/disarm. */
7030
- DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
7031
- /** Presence device carries GPS coordinates (lat/lng/accuracy) in
7032
- * addition to a textual location. */
7033
- DeviceFeature["PresenceGps"] = "presence-gps";
7034
- /** Notifier accepts an inline / URL image attachment. */
7035
- DeviceFeature["NotifierImage"] = "notifier-image";
7036
- /** Notifier accepts a priority hint (high/normal/low). */
7037
- DeviceFeature["NotifierPriority"] = "notifier-priority";
7038
- /** Notifier accepts a free-form `data` payload for platform-specific
7039
- * fields. */
7040
- DeviceFeature["NotifierData"] = "notifier-data";
7041
- /** Notifier supports interactive action buttons / callbacks. */
7042
- DeviceFeature["NotifierActions"] = "notifier-actions";
7043
- /** Notifier supports per-call recipient targeting (multi-user). */
7044
- DeviceFeature["NotifierRecipients"] = "notifier-recipients";
7045
- /** Script runner accepts a variables map on each run invocation. */
7046
- DeviceFeature["ScriptVariables"] = "script-variables";
7047
- /** Automation `trigger` accepts a skipCondition flag — fires the
7048
- * automation's actions while bypassing its condition block. */
7049
- DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
7050
- return DeviceFeature;
7051
- }({});
7052
- /**
7053
- * Semantic role a device plays within its parent. Populated by driver
7054
- * addons when creating accessory devices (Reolink siren/floodlight/
7055
- * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
7056
- * admin UI to pick icons, labels, and widgets — a `Switch` with
7057
- * `role: Floodlight` renders as a bulb with a brightness slider,
7058
- * whereas a `Switch` with `role: Siren` renders as a klaxon.
7059
- *
7060
- * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
7061
- * sqlite as a nullable TEXT column — old rows keep working unchanged.
7062
- */
7063
- var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
7064
- DeviceRole["Siren"] = "siren";
7065
- DeviceRole["Floodlight"] = "floodlight";
7066
- DeviceRole["Spotlight"] = "spotlight";
7067
- DeviceRole["PirSensor"] = "pir-sensor";
7068
- DeviceRole["Chime"] = "chime";
7069
- DeviceRole["Autotrack"] = "autotrack";
7070
- DeviceRole["Nightvision"] = "nightvision";
7071
- DeviceRole["PrivacyMask"] = "privacy-mask";
7072
- DeviceRole["Doorbell"] = "doorbell";
7073
- /** Virtual HA toggle (input_boolean.*) — distinguishable from a
7074
- * real Switch device for UI rendering / export adapters. */
7075
- DeviceRole["BinaryHelper"] = "binary-helper";
7076
- /** Generic motion / occupancy / moving event source. Distinct from
7077
- * the camera accessory PirSensor role: that one is a camera child;
7078
- * this is a standalone HA / 3rd-party motion sensor. */
7079
- DeviceRole["MotionSensor"] = "motion-sensor";
7080
- DeviceRole["ContactSensor"] = "contact-sensor";
7081
- DeviceRole["LeakSensor"] = "leak-sensor";
7082
- DeviceRole["SmokeSensor"] = "smoke-sensor";
7083
- DeviceRole["COSensor"] = "co-sensor";
7084
- DeviceRole["GasSensor"] = "gas-sensor";
7085
- DeviceRole["TamperSensor"] = "tamper-sensor";
7086
- DeviceRole["VibrationSensor"] = "vibration-sensor";
7087
- DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
7088
- DeviceRole["SoundSensor"] = "sound-sensor";
7089
- /** Fallback for `binary_sensor` without a known `device_class`. */
7090
- DeviceRole["BinarySensor"] = "binary-sensor";
7091
- DeviceRole["TemperatureSensor"] = "temperature-sensor";
7092
- DeviceRole["HumiditySensor"] = "humidity-sensor";
7093
- DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
7094
- DeviceRole["PressureSensor"] = "pressure-sensor";
7095
- DeviceRole["PowerSensor"] = "power-sensor";
7096
- DeviceRole["EnergySensor"] = "energy-sensor";
7097
- DeviceRole["VoltageSensor"] = "voltage-sensor";
7098
- DeviceRole["CurrentSensor"] = "current-sensor";
7099
- DeviceRole["AirQualitySensor"] = "air-quality-sensor";
7100
- /** Battery level (numeric % via `sensor` OR low-bool via
7101
- * `binary_sensor` — the cap distinguishes via the value type). */
7102
- DeviceRole["BatterySensor"] = "battery-sensor";
7103
- /** Fallback for `sensor` numeric without a known `device_class`. */
7104
- DeviceRole["NumericSensor"] = "numeric-sensor";
7105
- /** String / enum state (HA `sensor` with `state_class: enum` or
7106
- * `attributes.options`). */
7107
- DeviceRole["EnumSensor"] = "enum-sensor";
7108
- /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
7109
- * or `date`). The slice carries the raw ISO string verbatim (hosted on
7110
- * the `enum-sensor` cap); the UI renders it locale-formatted. */
7111
- DeviceRole["DateTimeSensor"] = "datetime-sensor";
7112
- /** Last-resort fallback when nothing else matches. */
7113
- DeviceRole["GenericSensor"] = "generic-sensor";
7114
- DeviceRole["NumericControl"] = "numeric-control";
7115
- DeviceRole["SelectControl"] = "select-control";
7116
- DeviceRole["TextControl"] = "text-control";
7117
- DeviceRole["DateTimeControl"] = "datetime-control";
7118
- /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
7119
- * rich features (image, priority, channel routing). */
7120
- DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
7121
- /** Chat / messaging service (HA `notify.telegram_*`,
7122
- * `notify.discord_*`, etc.). */
7123
- DeviceRole["MessagingNotifier"] = "messaging-notifier";
7124
- /** Email-based delivery (HA `notify.smtp`, etc.). */
7125
- DeviceRole["EmailNotifier"] = "email-notifier";
7126
- /** Fallback when the notifier service name doesn't match a known
7127
- * pattern. */
7128
- DeviceRole["GenericNotifier"] = "generic-notifier";
7129
- return DeviceRole;
7130
- }({});
7157
+ "Engine starting": "engine",
7158
+ Idling: "engine",
7159
+ "Accelerating, revving, vroom": "engine",
7160
+ "Light engine (high frequency)": "engine",
7161
+ "Medium engine (mid frequency)": "engine",
7162
+ "Heavy engine (low frequency)": "engine",
7163
+ "Lawn mower": "engine",
7164
+ Chainsaw: "engine",
7165
+ Hammer: "tools",
7166
+ Jackhammer: "tools",
7167
+ Sawing: "tools",
7168
+ "Power tool": "tools",
7169
+ Drill: "tools",
7170
+ Sanding: "tools",
7171
+ Silence: "silence"
7172
+ },
7173
+ preserveOriginal: false
7174
+ };
7175
+ var APPLE_SA_TO_MACRO = {
7176
+ mapping: {
7177
+ speech: "speech",
7178
+ child_speech: "speech",
7179
+ conversation: "speech",
7180
+ whispering: "speech",
7181
+ singing: "speech",
7182
+ humming: "speech",
7183
+ shout: "scream",
7184
+ yell: "scream",
7185
+ screaming: "scream",
7186
+ crying: "crying",
7187
+ baby_crying: "crying",
7188
+ sobbing: "crying",
7189
+ laughter: "laughter",
7190
+ baby_laughter: "laughter",
7191
+ giggling: "laughter",
7192
+ music: "music",
7193
+ guitar: "music",
7194
+ piano: "music",
7195
+ drums: "music",
7196
+ dog_bark: "dog",
7197
+ dog_bow_wow: "dog",
7198
+ dog_growling: "dog",
7199
+ dog_howl: "dog",
7200
+ cat_meow: "cat",
7201
+ cat_purr: "cat",
7202
+ cat_hiss: "cat",
7203
+ bird: "bird",
7204
+ bird_chirp: "bird",
7205
+ bird_squawk: "bird",
7206
+ animal: "animal",
7207
+ horse: "animal",
7208
+ cow_moo: "animal",
7209
+ insect: "animal",
7210
+ alarm: "alarm",
7211
+ smoke_alarm: "alarm",
7212
+ fire_alarm: "alarm",
7213
+ car_alarm: "alarm",
7214
+ siren: "siren",
7215
+ police_siren: "siren",
7216
+ ambulance_siren: "siren",
7217
+ doorbell: "doorbell",
7218
+ door_knock: "doorbell",
7219
+ knocking: "doorbell",
7220
+ glass_breaking: "glass_breaking",
7221
+ glass_shatter: "glass_breaking",
7222
+ gunshot: "gunshot",
7223
+ explosion: "gunshot",
7224
+ fireworks: "gunshot",
7225
+ car: "vehicle",
7226
+ truck: "vehicle",
7227
+ motorcycle: "vehicle",
7228
+ car_horn: "vehicle",
7229
+ vehicle_horn: "vehicle",
7230
+ traffic: "vehicle",
7231
+ fire: "fire",
7232
+ fire_crackle: "fire",
7233
+ water: "water",
7234
+ rain: "water",
7235
+ ocean: "water",
7236
+ splash: "water",
7237
+ wind: "wind",
7238
+ thunder: "wind",
7239
+ thunderstorm: "wind",
7240
+ door: "door",
7241
+ door_slam: "door",
7242
+ sliding_door: "door",
7243
+ footsteps: "footsteps",
7244
+ walking: "footsteps",
7245
+ running: "footsteps",
7246
+ crowd: "crowd",
7247
+ chatter: "crowd",
7248
+ cheering: "crowd",
7249
+ applause: "crowd",
7250
+ telephone_ring: "telephone",
7251
+ ringtone: "telephone",
7252
+ engine: "engine",
7253
+ engine_starting: "engine",
7254
+ lawn_mower: "engine",
7255
+ chainsaw: "engine",
7256
+ hammer: "tools",
7257
+ jackhammer: "tools",
7258
+ drill: "tools",
7259
+ power_tool: "tools",
7260
+ silence: "silence"
7261
+ },
7262
+ preserveOriginal: false
7263
+ };
7264
+ var _macroLookup = /* @__PURE__ */ new Map();
7265
+ for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7266
+ for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7131
7267
  /**
7132
7268
  * Accessory device helpers — shared across drivers.
7133
7269
  *
@@ -7581,78 +7717,6 @@ var airQualitySensorCapability = {
7581
7717
  runtimeState: AirQualitySensorStatusSchema
7582
7718
  };
7583
7719
  /**
7584
- * Generic types for capability definitions.
7585
- *
7586
- * A capability is defined with Zod schemas for methods, events, and settings.
7587
- * TypeScript types are inferred via z.infer<> — zero duplication.
7588
- *
7589
- * Pattern:
7590
- * 1. Define Zod schemas for data, methods, settings
7591
- * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
7592
- * 3. Export type IProvider = InferProvider<typeof capabilityDef>
7593
- * 4. Addon implements IProvider
7594
- * 5. Registry auto-mounts tRPC router from definition.methods
7595
- */
7596
- /**
7597
- * Output schema shared by the contribution + live methods.
7598
- *
7599
- * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
7600
- * tabs[]) without importing from `../interfaces/config-ui.js` — a
7601
- * concrete-but-lenient Zod object keeps tRPC output inference happy
7602
- * (using `z.unknown()` here collapses unrelated router branches to
7603
- * `unknown` when the generator re-inlines the huge AppRouter type).
7604
- *
7605
- * `.passthrough()` on sections/fields accepts whatever FormBuilder
7606
- * extensions the caller adds (showWhen, displayScale, …) without
7607
- * rebuilding every time a new field kind is introduced.
7608
- */
7609
- var ContributionSectionSchema = object({
7610
- id: string(),
7611
- title: string(),
7612
- description: string().optional(),
7613
- style: _enum(["card", "accordion"]).optional(),
7614
- defaultCollapsed: boolean().optional(),
7615
- columns: union([
7616
- literal(1),
7617
- literal(2),
7618
- literal(3),
7619
- literal(4)
7620
- ]).optional(),
7621
- tab: string().optional(),
7622
- location: _enum(["settings", "top-tab"]).optional(),
7623
- order: number().optional(),
7624
- fields: array(any())
7625
- });
7626
- object({
7627
- tabs: array(object({
7628
- id: string(),
7629
- label: string(),
7630
- icon: string(),
7631
- order: number().optional()
7632
- })).optional(),
7633
- sections: array(ContributionSectionSchema)
7634
- }).nullable();
7635
- object({ deviceId: number() }), object({ deviceId: number() }), object({
7636
- deviceId: number(),
7637
- patch: record(string(), unknown())
7638
- }), object({ success: literal(true) });
7639
- object({ deviceId: number() }), unknown().nullable();
7640
- /** Shorthand to define a method schema */
7641
- function method(input, output, options) {
7642
- return {
7643
- input,
7644
- output,
7645
- kind: options?.kind ?? "query",
7646
- auth: options?.auth ?? "protected",
7647
- ...options?.access !== void 0 ? { access: options.access } : {},
7648
- timeoutMs: options?.timeoutMs
7649
- };
7650
- }
7651
- /** Shorthand to define an event schema */
7652
- function event(data) {
7653
- return { data };
7654
- }
7655
- /**
7656
7720
  * Alarm-panel cap. Models HA `alarm_control_panel.*` on
7657
7721
  * `DeviceType.AlarmPanel`. State follows HA's canonical lifecycle
7658
7722
  * across disarmed / armed_(home|away|night|vacation|custom_bypass) /
@@ -14169,9 +14233,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
14169
14233
  limit: number().optional(),
14170
14234
  tags: record(string(), string()).optional()
14171
14235
  }), array(LogEntrySchema).readonly());
14172
- var StaticDirOutputSchema = object({ staticDir: string() });
14173
- var VersionOutputSchema = object({ version: string() });
14174
- method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
14175
14236
  /**
14176
14237
  * Zod schemas for persisted record types.
14177
14238
  *
@@ -16538,7 +16599,7 @@ method(object({
16538
16599
  }), _void(), {
16539
16600
  kind: "mutation",
16540
16601
  auth: "admin"
16541
- }), 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({
16602
+ }), 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({
16542
16603
  deviceId: number(),
16543
16604
  values: record(string(), unknown())
16544
16605
  }), object({ success: literal(true) }), {
@@ -17220,7 +17281,20 @@ var DiskSpaceInfoSchema = object({
17220
17281
  var PidResourceStatsSchema = object({
17221
17282
  pid: number(),
17222
17283
  cpu: number(),
17223
- memory: number()
17284
+ memory: number(),
17285
+ /**
17286
+ * Private (anonymous) resident bytes — the per-process V8 heap + native
17287
+ * allocations NOT shared with other processes (Linux RssAnon). This is the
17288
+ * "real" per-runner cost; summing it across runners is meaningful, unlike
17289
+ * `memory` (RSS), which double-counts the shared mmap'd framework code.
17290
+ * Undefined where /proc is unavailable (e.g. macOS).
17291
+ */
17292
+ privateBytes: number().optional(),
17293
+ /**
17294
+ * Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
17295
+ * code shared copy-on-write across runners. Undefined on macOS.
17296
+ */
17297
+ sharedBytes: number().optional()
17224
17298
  });
17225
17299
  var AddonInstanceSchema = object({
17226
17300
  addonId: string(),
@@ -17269,6 +17343,17 @@ var KillProcessResultSchema = object({
17269
17343
  reason: string().optional(),
17270
17344
  signal: _enum(["SIGTERM", "SIGKILL"]).optional()
17271
17345
  });
17346
+ var DumpHeapSnapshotInputSchema = object({
17347
+ /** The addon whose runner should dump a heap snapshot. */
17348
+ addonId: string() });
17349
+ var DumpHeapSnapshotResultSchema = object({
17350
+ success: boolean(),
17351
+ /** Path of the written .heapsnapshot inside the runner's container/host. */
17352
+ path: string().optional(),
17353
+ /** Process pid that was signalled. */
17354
+ pid: number().optional(),
17355
+ reason: string().optional()
17356
+ });
17272
17357
  var SystemMetricsSchema = object({
17273
17358
  cpuPercent: number(),
17274
17359
  memoryPercent: number(),
@@ -17282,6 +17367,9 @@ var SystemMetricsSchema = object({
17282
17367
  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, {
17283
17368
  kind: "mutation",
17284
17369
  auth: "admin"
17370
+ }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
17371
+ kind: "mutation",
17372
+ auth: "admin"
17285
17373
  });
17286
17374
  var PtzPresetSchema = object({
17287
17375
  id: string(),
@@ -17648,63 +17736,6 @@ method(object({
17648
17736
  auth: "admin"
17649
17737
  });
17650
17738
  /**
17651
- * device-ops — device-scoped cap that unifies the per-IDevice operations
17652
- * previously routed through the `.device-ops` Moleculer bridge service.
17653
- *
17654
- * Each worker that hosts live `IDevice` instances auto-registers a native
17655
- * provider for this cap (per device) backed by its local
17656
- * `DeviceRegistry`. Hub-side callers reach it transparently through
17657
- * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
17658
- * `deviceId` + `nodeId` and dispatches through the standard cap-router,
17659
- * so there's no parallel bridge path anymore.
17660
- *
17661
- * The surface is intentionally small — every method corresponds to a
17662
- * single action on the live `IDevice` (or `ICameraDevice` for
17663
- * `getStreamSources`). Richer orchestration (enable/disable with
17664
- * integration plumbing, bulk updates) stays in the `device-manager` cap;
17665
- * `device-ops` is the per-device primitive the device-manager routes to.
17666
- */
17667
- var StreamSourceEntrySchema$1 = object({
17668
- id: string(),
17669
- label: string(),
17670
- protocol: _enum([
17671
- "rtsp",
17672
- "rtmp",
17673
- "annexb",
17674
- "http-mjpeg",
17675
- "webrtc",
17676
- "custom"
17677
- ]),
17678
- url: string().optional(),
17679
- resolution: object({
17680
- width: number(),
17681
- height: number()
17682
- }).optional(),
17683
- fps: number().optional(),
17684
- bitrate: number().optional(),
17685
- codec: string().optional(),
17686
- profileHint: CamProfileSchema.optional(),
17687
- sdp: string().optional()
17688
- });
17689
- var ConfigEntrySchema$1 = object({
17690
- key: string(),
17691
- value: unknown()
17692
- });
17693
- var RawStateResultSchema = object({
17694
- /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
17695
- source: string(),
17696
- /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
17697
- data: record(string(), unknown())
17698
- });
17699
- method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
17700
- deviceId: number(),
17701
- values: record(string(), unknown())
17702
- }), _void(), { kind: "mutation" }), method(object({
17703
- deviceId: number(),
17704
- action: string().min(1),
17705
- input: unknown()
17706
- }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
17707
- /**
17708
17739
  * camera-credentials — device-scoped cap exposing the camera's network
17709
17740
  * + auth surface in a vendor-neutral shape.
17710
17741
  *
@@ -21476,6 +21507,12 @@ Object.freeze({
21476
21507
  addonId: null,
21477
21508
  access: "view"
21478
21509
  },
21510
+ "metricsProvider.dumpHeapSnapshot": {
21511
+ capName: "metrics-provider",
21512
+ capScope: "system",
21513
+ addonId: null,
21514
+ access: "create"
21515
+ },
21479
21516
  "metricsProvider.getAddonStats": {
21480
21517
  capName: "metrics-provider",
21481
21518
  capScope: "system",