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