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