@camstack/addon-provider-rtsp 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +714 -679
  2. package/dist/addon.mjs +714 -679
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -4641,63 +4641,7 @@ function preprocess(fn, schema) {
4641
4641
  });
4642
4642
  }
4643
4643
  //#endregion
4644
- //#region ../types/dist/index.mjs
4645
- /**
4646
- * Deep wiring healthcheck — snapshot of active reachability probes across
4647
- * every declared capability + widget of every installed plugin, on every
4648
- * node. Produced by the backend `WiringHealthService` and surfaced via
4649
- * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
4650
- *
4651
- * Unlike `/health` (process liveness), this reflects whether each cap/widget
4652
- * is actually *reachable* over the real cap-dispatch path. See spec
4653
- * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
4654
- */
4655
- /** What kind of target a probe addressed. */
4656
- var wiringProbeKindSchema = _enum([
4657
- "singleton",
4658
- "device",
4659
- "widget"
4660
- ]);
4661
- /** Result of probing a single (cap|widget [, device]) target. */
4662
- var wiringProbeResultSchema = object({
4663
- capName: string(),
4664
- kind: wiringProbeKindSchema,
4665
- deviceId: number().optional(),
4666
- reachable: boolean(),
4667
- latencyMs: number(),
4668
- error: string().optional()
4669
- });
4670
- /** Per-addon roll-up of cap + widget probe results. */
4671
- var wiringAddonHealthSchema = object({
4672
- addonId: string(),
4673
- caps: array(wiringProbeResultSchema).readonly(),
4674
- widgets: array(wiringProbeResultSchema).readonly()
4675
- });
4676
- /** Per-node roll-up. */
4677
- var wiringNodeHealthSchema = object({
4678
- nodeId: string(),
4679
- addons: array(wiringAddonHealthSchema).readonly()
4680
- });
4681
- object({
4682
- /** True only when every probed target is reachable. */
4683
- ok: boolean(),
4684
- /** True when at least one target is unreachable. */
4685
- degraded: boolean(),
4686
- checkedAt: string(),
4687
- nodes: array(wiringNodeHealthSchema).readonly(),
4688
- summary: object({
4689
- total: number(),
4690
- reachable: number(),
4691
- unreachable: number()
4692
- })
4693
- });
4694
- var MODEL_FORMATS = [
4695
- "onnx",
4696
- "coreml",
4697
- "openvino",
4698
- "tflite",
4699
- "pt"
4700
- ];
4644
+ //#region ../types/dist/sleep-B1dKJAMJ.mjs
4701
4645
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4702
4646
  EventCategory["SystemBoot"] = "system.boot";
4703
4647
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -5671,7 +5615,7 @@ var BaseAddon = class {
5671
5615
  deviceSettingsSchema() {
5672
5616
  return null;
5673
5617
  }
5674
- async getGlobalSettings(overlay, cap) {
5618
+ async getGlobalSettings(overlay, cap, _nodeId) {
5675
5619
  const schema = this.globalSettingsSchema(cap);
5676
5620
  if (!schema) return { sections: [] };
5677
5621
  const raw = await this._ctx?.settings?.readAddonStore() ?? {};
@@ -5680,7 +5624,7 @@ var BaseAddon = class {
5680
5624
  ...overlay
5681
5625
  } : raw);
5682
5626
  }
5683
- async updateGlobalSettings(patch) {
5627
+ async updateGlobalSettings(patch, _nodeId) {
5684
5628
  await this._ctx?.settings?.writeAddonStore(patch);
5685
5629
  await this.resolveConfig();
5686
5630
  await this.onConfigChanged();
@@ -6020,7 +5964,7 @@ var ProfileSlotSchema = object({
6020
5964
  * Zod schema for StreamSourceEntry — the canonical stream descriptor
6021
5965
  * exposed by ICameraDevice.getStreamSources() and consumed by the broker.
6022
5966
  */
6023
- var StreamSourceEntrySchema = object({
5967
+ var StreamSourceEntrySchema$1 = object({
6024
5968
  id: string(),
6025
5969
  label: string(),
6026
5970
  protocol: _enum([
@@ -6242,117 +6186,583 @@ var ProfileRtspEntrySchema = object({
6242
6186
  codec: string().optional(),
6243
6187
  resolution: CamStreamResolutionSchema.optional()
6244
6188
  });
6189
+ var DeviceType = /* @__PURE__ */ function(DeviceType) {
6190
+ DeviceType["Camera"] = "camera";
6191
+ DeviceType["Hub"] = "hub";
6192
+ DeviceType["Light"] = "light";
6193
+ DeviceType["Siren"] = "siren";
6194
+ DeviceType["Switch"] = "switch";
6195
+ DeviceType["Sensor"] = "sensor";
6196
+ DeviceType["Thermostat"] = "thermostat";
6197
+ DeviceType["Button"] = "button";
6198
+ /** Generic stateless event emitter — carries a device's EXACT declared
6199
+ * event vocabulary verbatim (no normalization). Installed with the
6200
+ * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6201
+ * HA bus events (e.g. `zha_event`, generic). */
6202
+ DeviceType["EventEmitter"] = "event-emitter";
6203
+ /** Firmware/software update entity — current vs available version,
6204
+ * updatable flag, update state, and an install action. Installed with
6205
+ * the `update` cap. Sources: Homematic firmware-update channels (and
6206
+ * reusable by other providers, e.g. HA `update.*` entities). */
6207
+ DeviceType["Update"] = "update";
6208
+ DeviceType["Generic"] = "generic";
6209
+ /** Generic notification delivery target (HA `notify.<service>`, future
6210
+ * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6211
+ * endpoint; the `notifier` cap defines the send surface. */
6212
+ DeviceType["Notifier"] = "notifier";
6213
+ /** Pre-recorded action sequence with optional parameters
6214
+ * (HA `script.*`). Runnable via `script-runner` cap. */
6215
+ DeviceType["Script"] = "script";
6216
+ /** Automation rule (HA `automation.*`) — enable/disable + manual
6217
+ * trigger surface exposed via `automation-control` cap. */
6218
+ DeviceType["Automation"] = "automation";
6219
+ /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6220
+ DeviceType["Lock"] = "lock";
6221
+ /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6222
+ * `valve.*`). `cover` cap with sub-roles for variant. */
6223
+ DeviceType["Cover"] = "cover";
6224
+ /** Pipe / water / gas valve with open/close/stop and optional
6225
+ * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6226
+ * modelled on the same open/closed lifecycle. */
6227
+ DeviceType["Valve"] = "valve";
6228
+ /** Humidifier / dehumidifier with on/off + target humidity + mode
6229
+ * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6230
+ * modelled on the same target / mode lifecycle. */
6231
+ DeviceType["Humidifier"] = "humidifier";
6232
+ /** Water heater / boiler with target temperature + operation mode +
6233
+ * away mode (HA `water_heater.*`). `water-heater` cap — a
6234
+ * climate-family actuator. */
6235
+ DeviceType["WaterHeater"] = "water-heater";
6236
+ /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6237
+ DeviceType["Fan"] = "fan";
6238
+ /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6239
+ * the camera surface — those use `Camera`. `media-player` cap. */
6240
+ DeviceType["MediaPlayer"] = "media-player";
6241
+ /** Security panel / alarm system (HA `alarm_control_panel.*`).
6242
+ * `alarm-panel` cap. */
6243
+ DeviceType["AlarmPanel"] = "alarm-panel";
6244
+ /** Generic user-settable input (HA `number` / `input_number` / `select`
6245
+ * / `input_select` / `text` / `input_text` / `input_datetime`).
6246
+ * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6247
+ * TextControl / DateTimeControl. */
6248
+ DeviceType["Control"] = "control";
6249
+ /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6250
+ * `presence` cap. */
6251
+ DeviceType["Presence"] = "presence";
6252
+ /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6253
+ * `weather` cap. */
6254
+ DeviceType["Weather"] = "weather";
6255
+ /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6256
+ DeviceType["Vacuum"] = "vacuum";
6257
+ /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6258
+ * `lawn-mower-control` cap. */
6259
+ DeviceType["LawnMower"] = "lawn-mower";
6260
+ /** Physical HA device group — parent container for entity-children
6261
+ * adopted from a single HA device entry. Not renderable as a
6262
+ * standalone device; exists only to anchor child entities. */
6263
+ DeviceType["Container"] = "container";
6264
+ /** Single still-image entity (HA `image.*`). Read-only display of an
6265
+ * `entity_picture` signed URL the browser loads directly. `image` cap. */
6266
+ DeviceType["Image"] = "image";
6267
+ return DeviceType;
6268
+ }({});
6269
+ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6270
+ DeviceFeature["BatteryOperated"] = "battery-operated";
6271
+ DeviceFeature["Rebootable"] = "rebootable";
6272
+ /**
6273
+ * Device supports an on-demand re-sync of its derived spec with its
6274
+ * upstream source — drives the generic Re-sync button. The owning
6275
+ * provider implements the action via the `device-adoption.resync` cap.
6276
+ */
6277
+ DeviceFeature["Resyncable"] = "resyncable";
6278
+ DeviceFeature["NativeSnapshot"] = "native-snapshot";
6279
+ DeviceFeature["DoorbellButton"] = "doorbell-button";
6280
+ DeviceFeature["TwoWayAudio"] = "two-way-audio";
6281
+ DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6282
+ /**
6283
+ * Camera supports the on-firmware autotrack subsystem (subject-
6284
+ * following). Distinct from `PanTiltZoom` because not every PTZ
6285
+ * camera ships autotrack — the admin UI uses this flag to gate
6286
+ * the autotrack toggle / settings card without re-deriving from
6287
+ * the cap registry. Mirrors `ptz-autotrack` cap registration:
6288
+ * driver sets this feature when probe confirms the firmware
6289
+ * surface, and registers the cap in the same code path.
6290
+ */
6291
+ DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6292
+ /**
6293
+ * Accessory exposes a "trigger on motion" toggle — the parent camera's
6294
+ * motion detection automatically activates this device. Mirrors
6295
+ * `motion-trigger` cap registration: drivers set this feature in the
6296
+ * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6297
+ *
6298
+ * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6299
+ * fast scalar without binding fetch), notifier rules, and `listAll`
6300
+ * filters that want "all devices with on-motion behaviour".
6301
+ */
6302
+ DeviceFeature["MotionTrigger"] = "motion-trigger";
6303
+ /** Light supports rgb-triplet color via `color` cap. */
6304
+ DeviceFeature["LightColorRgb"] = "light-color-rgb";
6305
+ /** Light supports HSV color via `color` cap. */
6306
+ DeviceFeature["LightColorHsv"] = "light-color-hsv";
6307
+ /** Light supports color-temperature (mired) via `color` cap. */
6308
+ DeviceFeature["LightColorMired"] = "light-color-mired";
6309
+ /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6310
+ * targetHigh). Gates the range slider UI. */
6311
+ DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6312
+ /** Thermostat exposes target humidity and/or current humidity
6313
+ * readings. Gates the humidity controls. */
6314
+ DeviceFeature["ClimateHumidity"] = "climate-humidity";
6315
+ /** Thermostat exposes a fan-mode selector. */
6316
+ DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6317
+ /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6318
+ DeviceFeature["ClimatePreset"] = "climate-preset";
6319
+ /** Cover exposes intermediate position control (0..100). Gates the
6320
+ * position slider UI. */
6321
+ DeviceFeature["CoverPositionable"] = "cover-positionable";
6322
+ /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6323
+ DeviceFeature["CoverTilt"] = "cover-tilt";
6324
+ /** Valve exposes intermediate position control (0..100). Gates the
6325
+ * position slider / drag surface UI. */
6326
+ DeviceFeature["ValvePositionable"] = "valve-positionable";
6327
+ /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6328
+ DeviceFeature["FanSpeed"] = "fan-speed";
6329
+ /** Fan exposes a preset mode selector. */
6330
+ DeviceFeature["FanPreset"] = "fan-preset";
6331
+ /** Fan exposes blade direction (forward/reverse) — typical of
6332
+ * ceiling fans. */
6333
+ DeviceFeature["FanDirection"] = "fan-direction";
6334
+ /** Fan exposes an oscillation toggle. */
6335
+ DeviceFeature["FanOscillating"] = "fan-oscillating";
6336
+ /** Lock requires a PIN code on lock/unlock. Gates the code-entry
6337
+ * field on the UI lock-controls panel. */
6338
+ DeviceFeature["LockPinRequired"] = "lock-pin-required";
6339
+ /** Lock supports a latch-release ("open door") action distinct from
6340
+ * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
6341
+ * `supported_features`. Gates the Open Door button in the UI. */
6342
+ DeviceFeature["LockOpen"] = "lock-open";
6343
+ /** Media player exposes a seek-to-position surface. */
6344
+ DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
6345
+ /** Media player exposes a volume-level setter. */
6346
+ DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
6347
+ /** Media player exposes a mute toggle distinct from volume=0. */
6348
+ DeviceFeature["MediaPlayerMute"] = "media-player-mute";
6349
+ /** Media player exposes a shuffle toggle. */
6350
+ DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
6351
+ /** Media player exposes a repeat mode (off / all / one). */
6352
+ DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
6353
+ /** Media player exposes a source / input selector. */
6354
+ DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
6355
+ /** Media player exposes a play-arbitrary-media surface (URL / id). */
6356
+ DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
6357
+ /** Media player exposes next-track. */
6358
+ DeviceFeature["MediaPlayerNext"] = "media-player-next";
6359
+ /** Media player exposes previous-track. */
6360
+ DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
6361
+ /** Media player exposes stop distinct from pause. */
6362
+ DeviceFeature["MediaPlayerStop"] = "media-player-stop";
6363
+ /** Alarm panel requires a PIN code on arm/disarm. */
6364
+ DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
6365
+ /** Presence device carries GPS coordinates (lat/lng/accuracy) in
6366
+ * addition to a textual location. */
6367
+ DeviceFeature["PresenceGps"] = "presence-gps";
6368
+ /** Notifier accepts an inline / URL image attachment. */
6369
+ DeviceFeature["NotifierImage"] = "notifier-image";
6370
+ /** Notifier accepts a priority hint (high/normal/low). */
6371
+ DeviceFeature["NotifierPriority"] = "notifier-priority";
6372
+ /** Notifier accepts a free-form `data` payload for platform-specific
6373
+ * fields. */
6374
+ DeviceFeature["NotifierData"] = "notifier-data";
6375
+ /** Notifier supports interactive action buttons / callbacks. */
6376
+ DeviceFeature["NotifierActions"] = "notifier-actions";
6377
+ /** Notifier supports per-call recipient targeting (multi-user). */
6378
+ DeviceFeature["NotifierRecipients"] = "notifier-recipients";
6379
+ /** Script runner accepts a variables map on each run invocation. */
6380
+ DeviceFeature["ScriptVariables"] = "script-variables";
6381
+ /** Automation `trigger` accepts a skipCondition flag — fires the
6382
+ * automation's actions while bypassing its condition block. */
6383
+ DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
6384
+ return DeviceFeature;
6385
+ }({});
6245
6386
  /**
6246
- * Numeric day-of-week: 0 = Sunday 6 = Saturday (matches `Date.getDay`).
6247
- * Named `RecordingWeekday` to avoid collision with the string-union
6248
- * `Weekday` exported from `interfaces/timezones.ts`.
6249
- */
6250
- var RecordingWeekdaySchema = number().int().min(0).max(6);
6251
- var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6252
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6253
- kind: literal("timeOfDay"),
6254
- start: string().regex(HHMM),
6255
- end: string().regex(HHMM),
6256
- /** Restrict to these weekdays; omit = every day. */
6257
- days: array(RecordingWeekdaySchema).optional()
6258
- })]);
6259
- var RecordingModeSchema = _enum([
6260
- "continuous",
6261
- "onMotion",
6262
- "onAudioThreshold"
6263
- ]);
6264
- /**
6265
- * First-class, authoritative per-camera storage mode — the netta choice the UI
6266
- * reads directly (never inferred from `rules`):
6267
- * - `off` — not recording.
6268
- * - `events` — record only around triggers (motion / audio threshold),
6269
- * with pre/post-buffer.
6270
- * - `continuous` — record 24/7 within the schedule.
6387
+ * Semantic role a device plays within its parent. Populated by driver
6388
+ * addons when creating accessory devices (Reolink siren/floodlight/
6389
+ * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
6390
+ * admin UI to pick icons, labels, and widgets — a `Switch` with
6391
+ * `role: Floodlight` renders as a bulb with a brightness slider,
6392
+ * whereas a `Switch` with `role: Siren` renders as a klaxon.
6271
6393
  *
6272
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6273
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6394
+ * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
6395
+ * sqlite as a nullable TEXT column old rows keep working unchanged.
6274
6396
  */
6275
- var RecordingStorageModeSchema = _enum([
6276
- "off",
6277
- "events",
6278
- "continuous"
6279
- ]);
6280
- /** Which detectors trigger an `events`-mode recording. */
6281
- var RecordingTriggersSchema = object({
6282
- motion: boolean().optional(),
6283
- audioThresholdDbfs: number().optional()
6284
- });
6397
+ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
6398
+ DeviceRole["Siren"] = "siren";
6399
+ DeviceRole["Floodlight"] = "floodlight";
6400
+ DeviceRole["Spotlight"] = "spotlight";
6401
+ DeviceRole["PirSensor"] = "pir-sensor";
6402
+ DeviceRole["Chime"] = "chime";
6403
+ DeviceRole["Autotrack"] = "autotrack";
6404
+ DeviceRole["Nightvision"] = "nightvision";
6405
+ DeviceRole["PrivacyMask"] = "privacy-mask";
6406
+ DeviceRole["Doorbell"] = "doorbell";
6407
+ /** Virtual HA toggle (input_boolean.*) — distinguishable from a
6408
+ * real Switch device for UI rendering / export adapters. */
6409
+ DeviceRole["BinaryHelper"] = "binary-helper";
6410
+ /** Generic motion / occupancy / moving event source. Distinct from
6411
+ * the camera accessory PirSensor role: that one is a camera child;
6412
+ * this is a standalone HA / 3rd-party motion sensor. */
6413
+ DeviceRole["MotionSensor"] = "motion-sensor";
6414
+ DeviceRole["ContactSensor"] = "contact-sensor";
6415
+ DeviceRole["LeakSensor"] = "leak-sensor";
6416
+ DeviceRole["SmokeSensor"] = "smoke-sensor";
6417
+ DeviceRole["COSensor"] = "co-sensor";
6418
+ DeviceRole["GasSensor"] = "gas-sensor";
6419
+ DeviceRole["TamperSensor"] = "tamper-sensor";
6420
+ DeviceRole["VibrationSensor"] = "vibration-sensor";
6421
+ DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
6422
+ DeviceRole["SoundSensor"] = "sound-sensor";
6423
+ /** Fallback for `binary_sensor` without a known `device_class`. */
6424
+ DeviceRole["BinarySensor"] = "binary-sensor";
6425
+ DeviceRole["TemperatureSensor"] = "temperature-sensor";
6426
+ DeviceRole["HumiditySensor"] = "humidity-sensor";
6427
+ DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
6428
+ DeviceRole["PressureSensor"] = "pressure-sensor";
6429
+ DeviceRole["PowerSensor"] = "power-sensor";
6430
+ DeviceRole["EnergySensor"] = "energy-sensor";
6431
+ DeviceRole["VoltageSensor"] = "voltage-sensor";
6432
+ DeviceRole["CurrentSensor"] = "current-sensor";
6433
+ DeviceRole["AirQualitySensor"] = "air-quality-sensor";
6434
+ /** Battery level (numeric % via `sensor` OR low-bool via
6435
+ * `binary_sensor` — the cap distinguishes via the value type). */
6436
+ DeviceRole["BatterySensor"] = "battery-sensor";
6437
+ /** Fallback for `sensor` numeric without a known `device_class`. */
6438
+ DeviceRole["NumericSensor"] = "numeric-sensor";
6439
+ /** String / enum state (HA `sensor` with `state_class: enum` or
6440
+ * `attributes.options`). */
6441
+ DeviceRole["EnumSensor"] = "enum-sensor";
6442
+ /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
6443
+ * or `date`). The slice carries the raw ISO string verbatim (hosted on
6444
+ * the `enum-sensor` cap); the UI renders it locale-formatted. */
6445
+ DeviceRole["DateTimeSensor"] = "datetime-sensor";
6446
+ /** Last-resort fallback when nothing else matches. */
6447
+ DeviceRole["GenericSensor"] = "generic-sensor";
6448
+ DeviceRole["NumericControl"] = "numeric-control";
6449
+ DeviceRole["SelectControl"] = "select-control";
6450
+ DeviceRole["TextControl"] = "text-control";
6451
+ DeviceRole["DateTimeControl"] = "datetime-control";
6452
+ /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
6453
+ * rich features (image, priority, channel routing). */
6454
+ DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
6455
+ /** Chat / messaging service (HA `notify.telegram_*`,
6456
+ * `notify.discord_*`, etc.). */
6457
+ DeviceRole["MessagingNotifier"] = "messaging-notifier";
6458
+ /** Email-based delivery (HA `notify.smtp`, etc.). */
6459
+ DeviceRole["EmailNotifier"] = "email-notifier";
6460
+ /** Fallback when the notifier service name doesn't match a known
6461
+ * pattern. */
6462
+ DeviceRole["GenericNotifier"] = "generic-notifier";
6463
+ return DeviceRole;
6464
+ }({});
6285
6465
  /**
6286
- * Mode of a single recording band — the recorder per-band vocabulary.
6466
+ * Generic types for capability definitions.
6287
6467
  *
6288
- * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6289
- * only ever `continuous` or `events`; "off" is expressed by the absence of a
6290
- * covering band, not by a band value.
6291
- */
6292
- var RecordingBandModeSchema = _enum(["continuous", "events"]);
6293
- /**
6294
- * Triggers for an `events`-mode band. Identical shape to
6295
- * `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
6296
- * two never drift.
6297
- */
6298
- var RecordingBandTriggersSchema = RecordingTriggersSchema;
6299
- /**
6300
- * A single mode-per-band window — the canonical recorder band shape, the
6301
- * single source of truth re-used by `addon-pipeline/recorder`.
6468
+ * A capability is defined with Zod schemas for methods, events, and settings.
6469
+ * TypeScript types are inferred via z.infer<> zero duplication.
6302
6470
  *
6303
- * `days` lists the weekdays the band covers (empty = every day, matching the
6304
- * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6305
- * span wraps past midnight (handled by the band engine).
6471
+ * Pattern:
6472
+ * 1. Define Zod schemas for data, methods, settings
6473
+ * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
6474
+ * 3. Export type IProvider = InferProvider<typeof capabilityDef>
6475
+ * 4. Addon implements IProvider
6476
+ * 5. Registry auto-mounts tRPC router from definition.methods
6306
6477
  */
6307
- var RecordingBandSchema = object({
6308
- days: array(RecordingWeekdaySchema),
6309
- start: string().regex(HHMM),
6310
- end: string().regex(HHMM),
6311
- mode: RecordingBandModeSchema,
6312
- triggers: RecordingBandTriggersSchema.optional(),
6313
- preBufferSec: number().min(0).optional(),
6314
- postBufferSec: number().min(0).optional()
6315
- });
6316
- var RecordingRuleSchema = object({
6317
- schedule: RecordingScheduleSchema,
6318
- mode: RecordingModeSchema,
6319
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6320
- preBufferSec: number().min(0).default(0),
6321
- /** Keep recording until this many seconds after the last trigger. */
6322
- postBufferSec: number().min(0).default(0),
6323
- /** Each new trigger restarts the post-buffer window. */
6324
- resetTimeoutOnNewEvent: boolean().default(true),
6325
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
6326
- thresholdDbfs: number().optional()
6327
- });
6328
6478
  /**
6329
- * Per-device retention overrides. Every field is optional; an unset or `0`
6330
- * value inherits the node-wide recorder default. Only footage-lifetime limits
6331
- * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6332
- * (when the volume is too full to keep recording) is NOT a per-camera concern
6333
- * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6334
- * shared by every camera writing to that volume.
6479
+ * Output schema shared by the contribution + live methods.
6480
+ *
6481
+ * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
6482
+ * tabs[]) without importing from `../interfaces/config-ui.js` a
6483
+ * concrete-but-lenient Zod object keeps tRPC output inference happy
6484
+ * (using `z.unknown()` here collapses unrelated router branches to
6485
+ * `unknown` when the generator re-inlines the huge AppRouter type).
6486
+ *
6487
+ * `.passthrough()` on sections/fields accepts whatever FormBuilder
6488
+ * extensions the caller adds (showWhen, displayScale, …) without
6489
+ * rebuilding every time a new field kind is introduced.
6335
6490
  */
6336
- var RecordingRetentionSchema = object({
6337
- maxAgeDays: number().min(0).optional(),
6338
- maxSizeGb: number().min(0).optional()
6491
+ var ContributionSectionSchema = object({
6492
+ id: string(),
6493
+ title: string(),
6494
+ description: string().optional(),
6495
+ style: _enum(["card", "accordion"]).optional(),
6496
+ defaultCollapsed: boolean().optional(),
6497
+ columns: union([
6498
+ literal(1),
6499
+ literal(2),
6500
+ literal(3),
6501
+ literal(4)
6502
+ ]).optional(),
6503
+ tab: string().optional(),
6504
+ location: _enum(["settings", "top-tab"]).optional(),
6505
+ order: number().optional(),
6506
+ fields: array(any())
6339
6507
  });
6508
+ object({
6509
+ tabs: array(object({
6510
+ id: string(),
6511
+ label: string(),
6512
+ icon: string(),
6513
+ order: number().optional()
6514
+ })).optional(),
6515
+ sections: array(ContributionSectionSchema)
6516
+ }).nullable();
6517
+ object({ deviceId: number() }), object({ deviceId: number() }), object({
6518
+ deviceId: number(),
6519
+ patch: record(string(), unknown())
6520
+ }), object({ success: literal(true) });
6521
+ object({ deviceId: number() }), unknown().nullable();
6522
+ /** Shorthand to define a method schema */
6523
+ function method(input, output, options) {
6524
+ return {
6525
+ input,
6526
+ output,
6527
+ kind: options?.kind ?? "query",
6528
+ auth: options?.auth ?? "protected",
6529
+ ...options?.access !== void 0 ? { access: options.access } : {},
6530
+ timeoutMs: options?.timeoutMs
6531
+ };
6532
+ }
6533
+ /** Shorthand to define an event schema */
6534
+ function event(data) {
6535
+ return { data };
6536
+ }
6537
+ var StaticDirOutputSchema = object({ staticDir: string() });
6538
+ var VersionOutputSchema = object({ version: string() });
6539
+ method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
6340
6540
  /**
6341
- * The full per-camera recording intent the wire shape of a RecordingTarget.
6541
+ * device-ops device-scoped cap that unifies the per-IDevice operations
6542
+ * previously routed through the `.device-ops` Moleculer bridge service.
6342
6543
  *
6343
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6344
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6345
- * only for transition + migration (`migrateRulesToMode`); the policy engine
6346
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6544
+ * Each worker that hosts live `IDevice` instances auto-registers a native
6545
+ * provider for this cap (per device) backed by its local
6546
+ * `DeviceRegistry`. Hub-side callers reach it transparently through
6547
+ * `ctx.fetchDevice(id).deviceOps.*` the DeviceProxy injects
6548
+ * `deviceId` + `nodeId` and dispatches through the standard cap-router,
6549
+ * so there's no parallel bridge path anymore.
6550
+ *
6551
+ * The surface is intentionally small — every method corresponds to a
6552
+ * single action on the live `IDevice` (or `ICameraDevice` for
6553
+ * `getStreamSources`). Richer orchestration (enable/disable with
6554
+ * integration plumbing, bulk updates) stays in the `device-manager` cap;
6555
+ * `device-ops` is the per-device primitive the device-manager routes to.
6347
6556
  */
6348
- var RecordingConfigSchema = object({
6349
- enabled: boolean(),
6350
- /** Authoritative storage mode. Absent on legacy targets → derived once via
6351
- * `migrateRulesToMode`, then persisted. */
6352
- mode: RecordingStorageModeSchema.optional(),
6353
- profiles: array(CamProfileSchema).optional(),
6354
- segmentSeconds: number().int().positive().optional(),
6355
- /** Shared recording time-bands for `events` & `continuous` — record only when
6557
+ var StreamSourceEntrySchema = object({
6558
+ id: string(),
6559
+ label: string(),
6560
+ protocol: _enum([
6561
+ "rtsp",
6562
+ "rtmp",
6563
+ "annexb",
6564
+ "http-mjpeg",
6565
+ "webrtc",
6566
+ "custom"
6567
+ ]),
6568
+ url: string().optional(),
6569
+ resolution: object({
6570
+ width: number(),
6571
+ height: number()
6572
+ }).optional(),
6573
+ fps: number().optional(),
6574
+ bitrate: number().optional(),
6575
+ codec: string().optional(),
6576
+ profileHint: CamProfileSchema.optional(),
6577
+ sdp: string().optional()
6578
+ });
6579
+ var ConfigEntrySchema$1 = object({
6580
+ key: string(),
6581
+ value: unknown()
6582
+ });
6583
+ var RawStateResultSchema = object({
6584
+ /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
6585
+ source: string(),
6586
+ /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
6587
+ data: record(string(), unknown())
6588
+ });
6589
+ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
6590
+ deviceId: number(),
6591
+ values: record(string(), unknown())
6592
+ }), _void(), { kind: "mutation" }), method(object({
6593
+ deviceId: number(),
6594
+ action: string().min(1),
6595
+ input: unknown()
6596
+ }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
6597
+ //#endregion
6598
+ //#region ../types/dist/index.mjs
6599
+ /**
6600
+ * Deep wiring healthcheck — snapshot of active reachability probes across
6601
+ * every declared capability + widget of every installed plugin, on every
6602
+ * node. Produced by the backend `WiringHealthService` and surfaced via
6603
+ * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
6604
+ *
6605
+ * Unlike `/health` (process liveness), this reflects whether each cap/widget
6606
+ * is actually *reachable* over the real cap-dispatch path. See spec
6607
+ * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
6608
+ */
6609
+ /** What kind of target a probe addressed. */
6610
+ var wiringProbeKindSchema = _enum([
6611
+ "singleton",
6612
+ "device",
6613
+ "widget"
6614
+ ]);
6615
+ /** Result of probing a single (cap|widget [, device]) target. */
6616
+ var wiringProbeResultSchema = object({
6617
+ capName: string(),
6618
+ kind: wiringProbeKindSchema,
6619
+ deviceId: number().optional(),
6620
+ reachable: boolean(),
6621
+ latencyMs: number(),
6622
+ error: string().optional()
6623
+ });
6624
+ /** Per-addon roll-up of cap + widget probe results. */
6625
+ var wiringAddonHealthSchema = object({
6626
+ addonId: string(),
6627
+ caps: array(wiringProbeResultSchema).readonly(),
6628
+ widgets: array(wiringProbeResultSchema).readonly()
6629
+ });
6630
+ /** Per-node roll-up. */
6631
+ var wiringNodeHealthSchema = object({
6632
+ nodeId: string(),
6633
+ addons: array(wiringAddonHealthSchema).readonly()
6634
+ });
6635
+ object({
6636
+ /** True only when every probed target is reachable. */
6637
+ ok: boolean(),
6638
+ /** True when at least one target is unreachable. */
6639
+ degraded: boolean(),
6640
+ checkedAt: string(),
6641
+ nodes: array(wiringNodeHealthSchema).readonly(),
6642
+ summary: object({
6643
+ total: number(),
6644
+ reachable: number(),
6645
+ unreachable: number()
6646
+ })
6647
+ });
6648
+ var MODEL_FORMATS = [
6649
+ "onnx",
6650
+ "coreml",
6651
+ "openvino",
6652
+ "tflite",
6653
+ "pt"
6654
+ ];
6655
+ /**
6656
+ * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6657
+ * Named `RecordingWeekday` to avoid collision with the string-union
6658
+ * `Weekday` exported from `interfaces/timezones.ts`.
6659
+ */
6660
+ var RecordingWeekdaySchema = number().int().min(0).max(6);
6661
+ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6662
+ var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6663
+ kind: literal("timeOfDay"),
6664
+ start: string().regex(HHMM),
6665
+ end: string().regex(HHMM),
6666
+ /** Restrict to these weekdays; omit = every day. */
6667
+ days: array(RecordingWeekdaySchema).optional()
6668
+ })]);
6669
+ var RecordingModeSchema = _enum([
6670
+ "continuous",
6671
+ "onMotion",
6672
+ "onAudioThreshold"
6673
+ ]);
6674
+ /**
6675
+ * First-class, authoritative per-camera storage mode — the netta choice the UI
6676
+ * reads directly (never inferred from `rules`):
6677
+ * - `off` — not recording.
6678
+ * - `events` — record only around triggers (motion / audio threshold),
6679
+ * with pre/post-buffer.
6680
+ * - `continuous` — record 24/7 within the schedule.
6681
+ *
6682
+ * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6683
+ * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6684
+ */
6685
+ var RecordingStorageModeSchema = _enum([
6686
+ "off",
6687
+ "events",
6688
+ "continuous"
6689
+ ]);
6690
+ /** Which detectors trigger an `events`-mode recording. */
6691
+ var RecordingTriggersSchema = object({
6692
+ motion: boolean().optional(),
6693
+ audioThresholdDbfs: number().optional()
6694
+ });
6695
+ /**
6696
+ * Mode of a single recording band — the recorder per-band vocabulary.
6697
+ *
6698
+ * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6699
+ * only ever `continuous` or `events`; "off" is expressed by the absence of a
6700
+ * covering band, not by a band value.
6701
+ */
6702
+ var RecordingBandModeSchema = _enum(["continuous", "events"]);
6703
+ /**
6704
+ * Triggers for an `events`-mode band. Identical shape to
6705
+ * `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
6706
+ * two never drift.
6707
+ */
6708
+ var RecordingBandTriggersSchema = RecordingTriggersSchema;
6709
+ /**
6710
+ * A single mode-per-band window — the canonical recorder band shape, the
6711
+ * single source of truth re-used by `addon-pipeline/recorder`.
6712
+ *
6713
+ * `days` lists the weekdays the band covers (empty = every day, matching the
6714
+ * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6715
+ * span wraps past midnight (handled by the band engine).
6716
+ */
6717
+ var RecordingBandSchema = object({
6718
+ days: array(RecordingWeekdaySchema),
6719
+ start: string().regex(HHMM),
6720
+ end: string().regex(HHMM),
6721
+ mode: RecordingBandModeSchema,
6722
+ triggers: RecordingBandTriggersSchema.optional(),
6723
+ preBufferSec: number().min(0).optional(),
6724
+ postBufferSec: number().min(0).optional()
6725
+ });
6726
+ var RecordingRuleSchema = object({
6727
+ schedule: RecordingScheduleSchema,
6728
+ mode: RecordingModeSchema,
6729
+ /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6730
+ preBufferSec: number().min(0).default(0),
6731
+ /** Keep recording until this many seconds after the last trigger. */
6732
+ postBufferSec: number().min(0).default(0),
6733
+ /** Each new trigger restarts the post-buffer window. */
6734
+ resetTimeoutOnNewEvent: boolean().default(true),
6735
+ /** onAudioThreshold only — dBFS level that counts as a trigger. */
6736
+ thresholdDbfs: number().optional()
6737
+ });
6738
+ /**
6739
+ * Per-device retention overrides. Every field is optional; an unset or `0`
6740
+ * value inherits the node-wide recorder default. Only footage-lifetime limits
6741
+ * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6742
+ * (when the volume is too full to keep recording) is NOT a per-camera concern —
6743
+ * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6744
+ * shared by every camera writing to that volume.
6745
+ */
6746
+ var RecordingRetentionSchema = object({
6747
+ maxAgeDays: number().min(0).optional(),
6748
+ maxSizeGb: number().min(0).optional()
6749
+ });
6750
+ /**
6751
+ * The full per-camera recording intent — the wire shape of a RecordingTarget.
6752
+ *
6753
+ * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6754
+ * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6755
+ * only for transition + migration (`migrateRulesToMode`); the policy engine
6756
+ * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6757
+ */
6758
+ var RecordingConfigSchema = object({
6759
+ enabled: boolean(),
6760
+ /** Authoritative storage mode. Absent on legacy targets → derived once via
6761
+ * `migrateRulesToMode`, then persisted. */
6762
+ mode: RecordingStorageModeSchema.optional(),
6763
+ profiles: array(CamProfileSchema).optional(),
6764
+ segmentSeconds: number().int().positive().optional(),
6765
+ /** Shared recording time-bands for `events` & `continuous` — record only when
6356
6766
  * the wall-clock falls inside one of these windows. Omit or empty = always.
6357
6767
  * `continuous` compiles to one rule per band; `events` to band × trigger. */
6358
6768
  schedules: array(RecordingScheduleSchema).optional(),
@@ -6776,392 +7186,116 @@ var YAMNET_TO_MACRO = {
6776
7186
  "Telephone dialing, DTMF": "telephone",
6777
7187
  "Busy signal": "telephone",
6778
7188
  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
- }({});
7189
+ "Engine starting": "engine",
7190
+ Idling: "engine",
7191
+ "Accelerating, revving, vroom": "engine",
7192
+ "Light engine (high frequency)": "engine",
7193
+ "Medium engine (mid frequency)": "engine",
7194
+ "Heavy engine (low frequency)": "engine",
7195
+ "Lawn mower": "engine",
7196
+ Chainsaw: "engine",
7197
+ Hammer: "tools",
7198
+ Jackhammer: "tools",
7199
+ Sawing: "tools",
7200
+ "Power tool": "tools",
7201
+ Drill: "tools",
7202
+ Sanding: "tools",
7203
+ Silence: "silence"
7204
+ },
7205
+ preserveOriginal: false
7206
+ };
7207
+ var APPLE_SA_TO_MACRO = {
7208
+ mapping: {
7209
+ speech: "speech",
7210
+ child_speech: "speech",
7211
+ conversation: "speech",
7212
+ whispering: "speech",
7213
+ singing: "speech",
7214
+ humming: "speech",
7215
+ shout: "scream",
7216
+ yell: "scream",
7217
+ screaming: "scream",
7218
+ crying: "crying",
7219
+ baby_crying: "crying",
7220
+ sobbing: "crying",
7221
+ laughter: "laughter",
7222
+ baby_laughter: "laughter",
7223
+ giggling: "laughter",
7224
+ music: "music",
7225
+ guitar: "music",
7226
+ piano: "music",
7227
+ drums: "music",
7228
+ dog_bark: "dog",
7229
+ dog_bow_wow: "dog",
7230
+ dog_growling: "dog",
7231
+ dog_howl: "dog",
7232
+ cat_meow: "cat",
7233
+ cat_purr: "cat",
7234
+ cat_hiss: "cat",
7235
+ bird: "bird",
7236
+ bird_chirp: "bird",
7237
+ bird_squawk: "bird",
7238
+ animal: "animal",
7239
+ horse: "animal",
7240
+ cow_moo: "animal",
7241
+ insect: "animal",
7242
+ alarm: "alarm",
7243
+ smoke_alarm: "alarm",
7244
+ fire_alarm: "alarm",
7245
+ car_alarm: "alarm",
7246
+ siren: "siren",
7247
+ police_siren: "siren",
7248
+ ambulance_siren: "siren",
7249
+ doorbell: "doorbell",
7250
+ door_knock: "doorbell",
7251
+ knocking: "doorbell",
7252
+ glass_breaking: "glass_breaking",
7253
+ glass_shatter: "glass_breaking",
7254
+ gunshot: "gunshot",
7255
+ explosion: "gunshot",
7256
+ fireworks: "gunshot",
7257
+ car: "vehicle",
7258
+ truck: "vehicle",
7259
+ motorcycle: "vehicle",
7260
+ car_horn: "vehicle",
7261
+ vehicle_horn: "vehicle",
7262
+ traffic: "vehicle",
7263
+ fire: "fire",
7264
+ fire_crackle: "fire",
7265
+ water: "water",
7266
+ rain: "water",
7267
+ ocean: "water",
7268
+ splash: "water",
7269
+ wind: "wind",
7270
+ thunder: "wind",
7271
+ thunderstorm: "wind",
7272
+ door: "door",
7273
+ door_slam: "door",
7274
+ sliding_door: "door",
7275
+ footsteps: "footsteps",
7276
+ walking: "footsteps",
7277
+ running: "footsteps",
7278
+ crowd: "crowd",
7279
+ chatter: "crowd",
7280
+ cheering: "crowd",
7281
+ applause: "crowd",
7282
+ telephone_ring: "telephone",
7283
+ ringtone: "telephone",
7284
+ engine: "engine",
7285
+ engine_starting: "engine",
7286
+ lawn_mower: "engine",
7287
+ chainsaw: "engine",
7288
+ hammer: "tools",
7289
+ jackhammer: "tools",
7290
+ drill: "tools",
7291
+ power_tool: "tools",
7292
+ silence: "silence"
7293
+ },
7294
+ preserveOriginal: false
7295
+ };
7296
+ var _macroLookup = /* @__PURE__ */ new Map();
7297
+ for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7298
+ for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7165
7299
  /**
7166
7300
  * Accessory device helpers — shared across drivers.
7167
7301
  *
@@ -7615,78 +7749,6 @@ var airQualitySensorCapability = {
7615
7749
  runtimeState: AirQualitySensorStatusSchema
7616
7750
  };
7617
7751
  /**
7618
- * Generic types for capability definitions.
7619
- *
7620
- * A capability is defined with Zod schemas for methods, events, and settings.
7621
- * TypeScript types are inferred via z.infer<> — zero duplication.
7622
- *
7623
- * Pattern:
7624
- * 1. Define Zod schemas for data, methods, settings
7625
- * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
7626
- * 3. Export type IProvider = InferProvider<typeof capabilityDef>
7627
- * 4. Addon implements IProvider
7628
- * 5. Registry auto-mounts tRPC router from definition.methods
7629
- */
7630
- /**
7631
- * Output schema shared by the contribution + live methods.
7632
- *
7633
- * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
7634
- * tabs[]) without importing from `../interfaces/config-ui.js` — a
7635
- * concrete-but-lenient Zod object keeps tRPC output inference happy
7636
- * (using `z.unknown()` here collapses unrelated router branches to
7637
- * `unknown` when the generator re-inlines the huge AppRouter type).
7638
- *
7639
- * `.passthrough()` on sections/fields accepts whatever FormBuilder
7640
- * extensions the caller adds (showWhen, displayScale, …) without
7641
- * rebuilding every time a new field kind is introduced.
7642
- */
7643
- var ContributionSectionSchema = object({
7644
- id: string(),
7645
- title: string(),
7646
- description: string().optional(),
7647
- style: _enum(["card", "accordion"]).optional(),
7648
- defaultCollapsed: boolean().optional(),
7649
- columns: union([
7650
- literal(1),
7651
- literal(2),
7652
- literal(3),
7653
- literal(4)
7654
- ]).optional(),
7655
- tab: string().optional(),
7656
- location: _enum(["settings", "top-tab"]).optional(),
7657
- order: number().optional(),
7658
- fields: array(any())
7659
- });
7660
- object({
7661
- tabs: array(object({
7662
- id: string(),
7663
- label: string(),
7664
- icon: string(),
7665
- order: number().optional()
7666
- })).optional(),
7667
- sections: array(ContributionSectionSchema)
7668
- }).nullable();
7669
- object({ deviceId: number() }), object({ deviceId: number() }), object({
7670
- deviceId: number(),
7671
- patch: record(string(), unknown())
7672
- }), object({ success: literal(true) });
7673
- object({ deviceId: number() }), unknown().nullable();
7674
- /** Shorthand to define a method schema */
7675
- function method(input, output, options) {
7676
- return {
7677
- input,
7678
- output,
7679
- kind: options?.kind ?? "query",
7680
- auth: options?.auth ?? "protected",
7681
- ...options?.access !== void 0 ? { access: options.access } : {},
7682
- timeoutMs: options?.timeoutMs
7683
- };
7684
- }
7685
- /** Shorthand to define an event schema */
7686
- function event(data) {
7687
- return { data };
7688
- }
7689
- /**
7690
7752
  * Alarm-panel cap. Models HA `alarm_control_panel.*` on
7691
7753
  * `DeviceType.AlarmPanel`. State follows HA's canonical lifecycle
7692
7754
  * across disarmed / armed_(home|away|night|vacation|custom_bypass) /
@@ -14158,9 +14220,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
14158
14220
  limit: number().optional(),
14159
14221
  tags: record(string(), string()).optional()
14160
14222
  }), array(LogEntrySchema).readonly());
14161
- var StaticDirOutputSchema = object({ staticDir: string() });
14162
- var VersionOutputSchema = object({ version: string() });
14163
- method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
14164
14223
  /**
14165
14224
  * Zod schemas for persisted record types.
14166
14225
  *
@@ -16461,7 +16520,7 @@ method(object({
16461
16520
  }), _void(), {
16462
16521
  kind: "mutation",
16463
16522
  auth: "admin"
16464
- }), 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({
16523
+ }), 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({
16465
16524
  deviceId: number(),
16466
16525
  values: record(string(), unknown())
16467
16526
  }), object({ success: literal(true) }), {
@@ -17186,7 +17245,20 @@ var DiskSpaceInfoSchema = object({
17186
17245
  var PidResourceStatsSchema = object({
17187
17246
  pid: number(),
17188
17247
  cpu: number(),
17189
- memory: number()
17248
+ memory: number(),
17249
+ /**
17250
+ * Private (anonymous) resident bytes — the per-process V8 heap + native
17251
+ * allocations NOT shared with other processes (Linux RssAnon). This is the
17252
+ * "real" per-runner cost; summing it across runners is meaningful, unlike
17253
+ * `memory` (RSS), which double-counts the shared mmap'd framework code.
17254
+ * Undefined where /proc is unavailable (e.g. macOS).
17255
+ */
17256
+ privateBytes: number().optional(),
17257
+ /**
17258
+ * Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
17259
+ * code shared copy-on-write across runners. Undefined on macOS.
17260
+ */
17261
+ sharedBytes: number().optional()
17190
17262
  });
17191
17263
  var AddonInstanceSchema = object({
17192
17264
  addonId: string(),
@@ -17235,6 +17307,17 @@ var KillProcessResultSchema = object({
17235
17307
  reason: string().optional(),
17236
17308
  signal: _enum(["SIGTERM", "SIGKILL"]).optional()
17237
17309
  });
17310
+ var DumpHeapSnapshotInputSchema = object({
17311
+ /** The addon whose runner should dump a heap snapshot. */
17312
+ addonId: string() });
17313
+ var DumpHeapSnapshotResultSchema = object({
17314
+ success: boolean(),
17315
+ /** Path of the written .heapsnapshot inside the runner's container/host. */
17316
+ path: string().optional(),
17317
+ /** Process pid that was signalled. */
17318
+ pid: number().optional(),
17319
+ reason: string().optional()
17320
+ });
17238
17321
  var SystemMetricsSchema = object({
17239
17322
  cpuPercent: number(),
17240
17323
  memoryPercent: number(),
@@ -17248,6 +17331,9 @@ var SystemMetricsSchema = object({
17248
17331
  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, {
17249
17332
  kind: "mutation",
17250
17333
  auth: "admin"
17334
+ }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
17335
+ kind: "mutation",
17336
+ auth: "admin"
17251
17337
  });
17252
17338
  var PtzPresetSchema = object({
17253
17339
  id: string(),
@@ -17614,63 +17700,6 @@ method(object({
17614
17700
  auth: "admin"
17615
17701
  });
17616
17702
  /**
17617
- * device-ops — device-scoped cap that unifies the per-IDevice operations
17618
- * previously routed through the `.device-ops` Moleculer bridge service.
17619
- *
17620
- * Each worker that hosts live `IDevice` instances auto-registers a native
17621
- * provider for this cap (per device) backed by its local
17622
- * `DeviceRegistry`. Hub-side callers reach it transparently through
17623
- * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
17624
- * `deviceId` + `nodeId` and dispatches through the standard cap-router,
17625
- * so there's no parallel bridge path anymore.
17626
- *
17627
- * The surface is intentionally small — every method corresponds to a
17628
- * single action on the live `IDevice` (or `ICameraDevice` for
17629
- * `getStreamSources`). Richer orchestration (enable/disable with
17630
- * integration plumbing, bulk updates) stays in the `device-manager` cap;
17631
- * `device-ops` is the per-device primitive the device-manager routes to.
17632
- */
17633
- var StreamSourceEntrySchema$1 = object({
17634
- id: string(),
17635
- label: string(),
17636
- protocol: _enum([
17637
- "rtsp",
17638
- "rtmp",
17639
- "annexb",
17640
- "http-mjpeg",
17641
- "webrtc",
17642
- "custom"
17643
- ]),
17644
- url: string().optional(),
17645
- resolution: object({
17646
- width: number(),
17647
- height: number()
17648
- }).optional(),
17649
- fps: number().optional(),
17650
- bitrate: number().optional(),
17651
- codec: string().optional(),
17652
- profileHint: CamProfileSchema.optional(),
17653
- sdp: string().optional()
17654
- });
17655
- var ConfigEntrySchema$1 = object({
17656
- key: string(),
17657
- value: unknown()
17658
- });
17659
- var RawStateResultSchema = object({
17660
- /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
17661
- source: string(),
17662
- /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
17663
- data: record(string(), unknown())
17664
- });
17665
- method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
17666
- deviceId: number(),
17667
- values: record(string(), unknown())
17668
- }), _void(), { kind: "mutation" }), method(object({
17669
- deviceId: number(),
17670
- action: string().min(1),
17671
- input: unknown()
17672
- }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
17673
- /**
17674
17703
  * camera-credentials — device-scoped cap exposing the camera's network
17675
17704
  * + auth surface in a vendor-neutral shape.
17676
17705
  *
@@ -21366,6 +21395,12 @@ Object.freeze({
21366
21395
  addonId: null,
21367
21396
  access: "view"
21368
21397
  },
21398
+ "metricsProvider.dumpHeapSnapshot": {
21399
+ capName: "metrics-provider",
21400
+ capScope: "system",
21401
+ addonId: null,
21402
+ access: "create"
21403
+ },
21369
21404
  "metricsProvider.getAddonStats": {
21370
21405
  capName: "metrics-provider",
21371
21406
  capScope: "system",
@@ -23688,7 +23723,7 @@ function maskUrlCredentials(rawUrl) {
23688
23723
  u.password = "";
23689
23724
  touched = true;
23690
23725
  }
23691
- for (const key of [...u.searchParams.keys()]) if (isCredentialParam(key)) {
23726
+ for (const key of Array.from(u.searchParams.keys())) if (isCredentialParam(key)) {
23692
23727
  u.searchParams.set(key, "***");
23693
23728
  touched = true;
23694
23729
  }