@camstack/addon-mqtt-broker 1.0.5 → 1.0.6

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