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