@camstack/addon-provider-homeassistant 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +723 -686
  2. package/dist/addon.mjs +723 -686
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -4628,63 +4628,7 @@ function _instanceof(cls, params = {}) {
4628
4628
  return inst;
4629
4629
  }
4630
4630
  //#endregion
4631
- //#region ../types/dist/index.mjs
4632
- /**
4633
- * Deep wiring healthcheck — snapshot of active reachability probes across
4634
- * every declared capability + widget of every installed plugin, on every
4635
- * node. Produced by the backend `WiringHealthService` and surfaced via
4636
- * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
4637
- *
4638
- * Unlike `/health` (process liveness), this reflects whether each cap/widget
4639
- * is actually *reachable* over the real cap-dispatch path. See spec
4640
- * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
4641
- */
4642
- /** What kind of target a probe addressed. */
4643
- var wiringProbeKindSchema = _enum([
4644
- "singleton",
4645
- "device",
4646
- "widget"
4647
- ]);
4648
- /** Result of probing a single (cap|widget [, device]) target. */
4649
- var wiringProbeResultSchema = object({
4650
- capName: string(),
4651
- kind: wiringProbeKindSchema,
4652
- deviceId: number().optional(),
4653
- reachable: boolean(),
4654
- latencyMs: number(),
4655
- error: string().optional()
4656
- });
4657
- /** Per-addon roll-up of cap + widget probe results. */
4658
- var wiringAddonHealthSchema = object({
4659
- addonId: string(),
4660
- caps: array(wiringProbeResultSchema).readonly(),
4661
- widgets: array(wiringProbeResultSchema).readonly()
4662
- });
4663
- /** Per-node roll-up. */
4664
- var wiringNodeHealthSchema = object({
4665
- nodeId: string(),
4666
- addons: array(wiringAddonHealthSchema).readonly()
4667
- });
4668
- object({
4669
- /** True only when every probed target is reachable. */
4670
- ok: boolean(),
4671
- /** True when at least one target is unreachable. */
4672
- degraded: boolean(),
4673
- checkedAt: string(),
4674
- nodes: array(wiringNodeHealthSchema).readonly(),
4675
- summary: object({
4676
- total: number(),
4677
- reachable: number(),
4678
- unreachable: number()
4679
- })
4680
- });
4681
- var MODEL_FORMATS = [
4682
- "onnx",
4683
- "coreml",
4684
- "openvino",
4685
- "tflite",
4686
- "pt"
4687
- ];
4631
+ //#region ../types/dist/sleep-D7JeS58T.mjs
4688
4632
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4689
4633
  EventCategory["SystemBoot"] = "system.boot";
4690
4634
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -6007,7 +5951,7 @@ var ProfileSlotSchema = object({
6007
5951
  * Zod schema for StreamSourceEntry — the canonical stream descriptor
6008
5952
  * exposed by ICameraDevice.getStreamSources() and consumed by the broker.
6009
5953
  */
6010
- var StreamSourceEntrySchema = object({
5954
+ var StreamSourceEntrySchema$1 = object({
6011
5955
  id: string(),
6012
5956
  label: string(),
6013
5957
  protocol: _enum([
@@ -6229,117 +6173,595 @@ var ProfileRtspEntrySchema = object({
6229
6173
  codec: string().optional(),
6230
6174
  resolution: CamStreamResolutionSchema.optional()
6231
6175
  });
6176
+ var DeviceType = /* @__PURE__ */ function(DeviceType) {
6177
+ DeviceType["Camera"] = "camera";
6178
+ DeviceType["Hub"] = "hub";
6179
+ DeviceType["Light"] = "light";
6180
+ DeviceType["Siren"] = "siren";
6181
+ DeviceType["Switch"] = "switch";
6182
+ DeviceType["Sensor"] = "sensor";
6183
+ DeviceType["Thermostat"] = "thermostat";
6184
+ DeviceType["Button"] = "button";
6185
+ /** Generic stateless event emitter — carries a device's EXACT declared
6186
+ * event vocabulary verbatim (no normalization). Installed with the
6187
+ * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6188
+ * HA bus events (e.g. `zha_event`, generic). */
6189
+ DeviceType["EventEmitter"] = "event-emitter";
6190
+ /** Firmware/software update entity — current vs available version,
6191
+ * updatable flag, update state, and an install action. Installed with
6192
+ * the `update` cap. Sources: Homematic firmware-update channels (and
6193
+ * reusable by other providers, e.g. HA `update.*` entities). */
6194
+ DeviceType["Update"] = "update";
6195
+ DeviceType["Generic"] = "generic";
6196
+ /** Generic notification delivery target (HA `notify.<service>`, future
6197
+ * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6198
+ * endpoint; the `notifier` cap defines the send surface. */
6199
+ DeviceType["Notifier"] = "notifier";
6200
+ /** Pre-recorded action sequence with optional parameters
6201
+ * (HA `script.*`). Runnable via `script-runner` cap. */
6202
+ DeviceType["Script"] = "script";
6203
+ /** Automation rule (HA `automation.*`) — enable/disable + manual
6204
+ * trigger surface exposed via `automation-control` cap. */
6205
+ DeviceType["Automation"] = "automation";
6206
+ /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6207
+ DeviceType["Lock"] = "lock";
6208
+ /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6209
+ * `valve.*`). `cover` cap with sub-roles for variant. */
6210
+ DeviceType["Cover"] = "cover";
6211
+ /** Pipe / water / gas valve with open/close/stop and optional
6212
+ * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6213
+ * modelled on the same open/closed lifecycle. */
6214
+ DeviceType["Valve"] = "valve";
6215
+ /** Humidifier / dehumidifier with on/off + target humidity + mode
6216
+ * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6217
+ * modelled on the same target / mode lifecycle. */
6218
+ DeviceType["Humidifier"] = "humidifier";
6219
+ /** Water heater / boiler with target temperature + operation mode +
6220
+ * away mode (HA `water_heater.*`). `water-heater` cap — a
6221
+ * climate-family actuator. */
6222
+ DeviceType["WaterHeater"] = "water-heater";
6223
+ /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6224
+ DeviceType["Fan"] = "fan";
6225
+ /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6226
+ * the camera surface — those use `Camera`. `media-player` cap. */
6227
+ DeviceType["MediaPlayer"] = "media-player";
6228
+ /** Security panel / alarm system (HA `alarm_control_panel.*`).
6229
+ * `alarm-panel` cap. */
6230
+ DeviceType["AlarmPanel"] = "alarm-panel";
6231
+ /** Generic user-settable input (HA `number` / `input_number` / `select`
6232
+ * / `input_select` / `text` / `input_text` / `input_datetime`).
6233
+ * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6234
+ * TextControl / DateTimeControl. */
6235
+ DeviceType["Control"] = "control";
6236
+ /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6237
+ * `presence` cap. */
6238
+ DeviceType["Presence"] = "presence";
6239
+ /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6240
+ * `weather` cap. */
6241
+ DeviceType["Weather"] = "weather";
6242
+ /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6243
+ DeviceType["Vacuum"] = "vacuum";
6244
+ /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6245
+ * `lawn-mower-control` cap. */
6246
+ DeviceType["LawnMower"] = "lawn-mower";
6247
+ /** Physical HA device group — parent container for entity-children
6248
+ * adopted from a single HA device entry. Not renderable as a
6249
+ * standalone device; exists only to anchor child entities. */
6250
+ DeviceType["Container"] = "container";
6251
+ /** Single still-image entity (HA `image.*`). Read-only display of an
6252
+ * `entity_picture` signed URL the browser loads directly. `image` cap. */
6253
+ DeviceType["Image"] = "image";
6254
+ return DeviceType;
6255
+ }({});
6256
+ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6257
+ DeviceFeature["BatteryOperated"] = "battery-operated";
6258
+ DeviceFeature["Rebootable"] = "rebootable";
6259
+ /**
6260
+ * Device supports an on-demand re-sync of its derived spec with its
6261
+ * upstream source — drives the generic Re-sync button. The owning
6262
+ * provider implements the action via the `device-adoption.resync` cap.
6263
+ */
6264
+ DeviceFeature["Resyncable"] = "resyncable";
6265
+ DeviceFeature["NativeSnapshot"] = "native-snapshot";
6266
+ DeviceFeature["DoorbellButton"] = "doorbell-button";
6267
+ DeviceFeature["TwoWayAudio"] = "two-way-audio";
6268
+ DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6269
+ /**
6270
+ * Camera supports the on-firmware autotrack subsystem (subject-
6271
+ * following). Distinct from `PanTiltZoom` because not every PTZ
6272
+ * camera ships autotrack — the admin UI uses this flag to gate
6273
+ * the autotrack toggle / settings card without re-deriving from
6274
+ * the cap registry. Mirrors `ptz-autotrack` cap registration:
6275
+ * driver sets this feature when probe confirms the firmware
6276
+ * surface, and registers the cap in the same code path.
6277
+ */
6278
+ DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6279
+ /**
6280
+ * Accessory exposes a "trigger on motion" toggle — the parent camera's
6281
+ * motion detection automatically activates this device. Mirrors
6282
+ * `motion-trigger` cap registration: drivers set this feature in the
6283
+ * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6284
+ *
6285
+ * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6286
+ * fast scalar without binding fetch), notifier rules, and `listAll`
6287
+ * filters that want "all devices with on-motion behaviour".
6288
+ */
6289
+ DeviceFeature["MotionTrigger"] = "motion-trigger";
6290
+ /** Light supports rgb-triplet color via `color` cap. */
6291
+ DeviceFeature["LightColorRgb"] = "light-color-rgb";
6292
+ /** Light supports HSV color via `color` cap. */
6293
+ DeviceFeature["LightColorHsv"] = "light-color-hsv";
6294
+ /** Light supports color-temperature (mired) via `color` cap. */
6295
+ DeviceFeature["LightColorMired"] = "light-color-mired";
6296
+ /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6297
+ * targetHigh). Gates the range slider UI. */
6298
+ DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6299
+ /** Thermostat exposes target humidity and/or current humidity
6300
+ * readings. Gates the humidity controls. */
6301
+ DeviceFeature["ClimateHumidity"] = "climate-humidity";
6302
+ /** Thermostat exposes a fan-mode selector. */
6303
+ DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6304
+ /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6305
+ DeviceFeature["ClimatePreset"] = "climate-preset";
6306
+ /** Cover exposes intermediate position control (0..100). Gates the
6307
+ * position slider UI. */
6308
+ DeviceFeature["CoverPositionable"] = "cover-positionable";
6309
+ /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6310
+ DeviceFeature["CoverTilt"] = "cover-tilt";
6311
+ /** Valve exposes intermediate position control (0..100). Gates the
6312
+ * position slider / drag surface UI. */
6313
+ DeviceFeature["ValvePositionable"] = "valve-positionable";
6314
+ /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6315
+ DeviceFeature["FanSpeed"] = "fan-speed";
6316
+ /** Fan exposes a preset mode selector. */
6317
+ DeviceFeature["FanPreset"] = "fan-preset";
6318
+ /** Fan exposes blade direction (forward/reverse) — typical of
6319
+ * ceiling fans. */
6320
+ DeviceFeature["FanDirection"] = "fan-direction";
6321
+ /** Fan exposes an oscillation toggle. */
6322
+ DeviceFeature["FanOscillating"] = "fan-oscillating";
6323
+ /** Lock requires a PIN code on lock/unlock. Gates the code-entry
6324
+ * field on the UI lock-controls panel. */
6325
+ DeviceFeature["LockPinRequired"] = "lock-pin-required";
6326
+ /** Lock supports a latch-release ("open door") action distinct from
6327
+ * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
6328
+ * `supported_features`. Gates the Open Door button in the UI. */
6329
+ DeviceFeature["LockOpen"] = "lock-open";
6330
+ /** Media player exposes a seek-to-position surface. */
6331
+ DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
6332
+ /** Media player exposes a volume-level setter. */
6333
+ DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
6334
+ /** Media player exposes a mute toggle distinct from volume=0. */
6335
+ DeviceFeature["MediaPlayerMute"] = "media-player-mute";
6336
+ /** Media player exposes a shuffle toggle. */
6337
+ DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
6338
+ /** Media player exposes a repeat mode (off / all / one). */
6339
+ DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
6340
+ /** Media player exposes a source / input selector. */
6341
+ DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
6342
+ /** Media player exposes a play-arbitrary-media surface (URL / id). */
6343
+ DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
6344
+ /** Media player exposes next-track. */
6345
+ DeviceFeature["MediaPlayerNext"] = "media-player-next";
6346
+ /** Media player exposes previous-track. */
6347
+ DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
6348
+ /** Media player exposes stop distinct from pause. */
6349
+ DeviceFeature["MediaPlayerStop"] = "media-player-stop";
6350
+ /** Alarm panel requires a PIN code on arm/disarm. */
6351
+ DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
6352
+ /** Presence device carries GPS coordinates (lat/lng/accuracy) in
6353
+ * addition to a textual location. */
6354
+ DeviceFeature["PresenceGps"] = "presence-gps";
6355
+ /** Notifier accepts an inline / URL image attachment. */
6356
+ DeviceFeature["NotifierImage"] = "notifier-image";
6357
+ /** Notifier accepts a priority hint (high/normal/low). */
6358
+ DeviceFeature["NotifierPriority"] = "notifier-priority";
6359
+ /** Notifier accepts a free-form `data` payload for platform-specific
6360
+ * fields. */
6361
+ DeviceFeature["NotifierData"] = "notifier-data";
6362
+ /** Notifier supports interactive action buttons / callbacks. */
6363
+ DeviceFeature["NotifierActions"] = "notifier-actions";
6364
+ /** Notifier supports per-call recipient targeting (multi-user). */
6365
+ DeviceFeature["NotifierRecipients"] = "notifier-recipients";
6366
+ /** Script runner accepts a variables map on each run invocation. */
6367
+ DeviceFeature["ScriptVariables"] = "script-variables";
6368
+ /** Automation `trigger` accepts a skipCondition flag — fires the
6369
+ * automation's actions while bypassing its condition block. */
6370
+ DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
6371
+ return DeviceFeature;
6372
+ }({});
6232
6373
  /**
6233
- * Numeric day-of-week: 0 = Sunday 6 = Saturday (matches `Date.getDay`).
6234
- * Named `RecordingWeekday` to avoid collision with the string-union
6235
- * `Weekday` exported from `interfaces/timezones.ts`.
6236
- */
6237
- var RecordingWeekdaySchema = number().int().min(0).max(6);
6238
- var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6239
- var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6240
- kind: literal("timeOfDay"),
6241
- start: string().regex(HHMM),
6242
- end: string().regex(HHMM),
6243
- /** Restrict to these weekdays; omit = every day. */
6244
- days: array(RecordingWeekdaySchema).optional()
6245
- })]);
6246
- var RecordingModeSchema = _enum([
6247
- "continuous",
6248
- "onMotion",
6249
- "onAudioThreshold"
6250
- ]);
6251
- /**
6252
- * First-class, authoritative per-camera storage mode — the netta choice the UI
6253
- * reads directly (never inferred from `rules`):
6254
- * - `off` — not recording.
6255
- * - `events` — record only around triggers (motion / audio threshold),
6256
- * with pre/post-buffer.
6257
- * - `continuous` — record 24/7 within the schedule.
6374
+ * Semantic role a device plays within its parent. Populated by driver
6375
+ * addons when creating accessory devices (Reolink siren/floodlight/
6376
+ * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
6377
+ * admin UI to pick icons, labels, and widgets — a `Switch` with
6378
+ * `role: Floodlight` renders as a bulb with a brightness slider,
6379
+ * whereas a `Switch` with `role: Siren` renders as a klaxon.
6258
6380
  *
6259
- * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6260
- * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6381
+ * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
6382
+ * sqlite as a nullable TEXT column old rows keep working unchanged.
6261
6383
  */
6262
- var RecordingStorageModeSchema = _enum([
6263
- "off",
6264
- "events",
6265
- "continuous"
6266
- ]);
6267
- /** Which detectors trigger an `events`-mode recording. */
6268
- var RecordingTriggersSchema = object({
6269
- motion: boolean().optional(),
6270
- audioThresholdDbfs: number().optional()
6271
- });
6384
+ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
6385
+ DeviceRole["Siren"] = "siren";
6386
+ DeviceRole["Floodlight"] = "floodlight";
6387
+ DeviceRole["Spotlight"] = "spotlight";
6388
+ DeviceRole["PirSensor"] = "pir-sensor";
6389
+ DeviceRole["Chime"] = "chime";
6390
+ DeviceRole["Autotrack"] = "autotrack";
6391
+ DeviceRole["Nightvision"] = "nightvision";
6392
+ DeviceRole["PrivacyMask"] = "privacy-mask";
6393
+ DeviceRole["Doorbell"] = "doorbell";
6394
+ /** Virtual HA toggle (input_boolean.*) — distinguishable from a
6395
+ * real Switch device for UI rendering / export adapters. */
6396
+ DeviceRole["BinaryHelper"] = "binary-helper";
6397
+ /** Generic motion / occupancy / moving event source. Distinct from
6398
+ * the camera accessory PirSensor role: that one is a camera child;
6399
+ * this is a standalone HA / 3rd-party motion sensor. */
6400
+ DeviceRole["MotionSensor"] = "motion-sensor";
6401
+ DeviceRole["ContactSensor"] = "contact-sensor";
6402
+ DeviceRole["LeakSensor"] = "leak-sensor";
6403
+ DeviceRole["SmokeSensor"] = "smoke-sensor";
6404
+ DeviceRole["COSensor"] = "co-sensor";
6405
+ DeviceRole["GasSensor"] = "gas-sensor";
6406
+ DeviceRole["TamperSensor"] = "tamper-sensor";
6407
+ DeviceRole["VibrationSensor"] = "vibration-sensor";
6408
+ DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
6409
+ DeviceRole["SoundSensor"] = "sound-sensor";
6410
+ /** Fallback for `binary_sensor` without a known `device_class`. */
6411
+ DeviceRole["BinarySensor"] = "binary-sensor";
6412
+ DeviceRole["TemperatureSensor"] = "temperature-sensor";
6413
+ DeviceRole["HumiditySensor"] = "humidity-sensor";
6414
+ DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
6415
+ DeviceRole["PressureSensor"] = "pressure-sensor";
6416
+ DeviceRole["PowerSensor"] = "power-sensor";
6417
+ DeviceRole["EnergySensor"] = "energy-sensor";
6418
+ DeviceRole["VoltageSensor"] = "voltage-sensor";
6419
+ DeviceRole["CurrentSensor"] = "current-sensor";
6420
+ DeviceRole["AirQualitySensor"] = "air-quality-sensor";
6421
+ /** Battery level (numeric % via `sensor` OR low-bool via
6422
+ * `binary_sensor` — the cap distinguishes via the value type). */
6423
+ DeviceRole["BatterySensor"] = "battery-sensor";
6424
+ /** Fallback for `sensor` numeric without a known `device_class`. */
6425
+ DeviceRole["NumericSensor"] = "numeric-sensor";
6426
+ /** String / enum state (HA `sensor` with `state_class: enum` or
6427
+ * `attributes.options`). */
6428
+ DeviceRole["EnumSensor"] = "enum-sensor";
6429
+ /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
6430
+ * or `date`). The slice carries the raw ISO string verbatim (hosted on
6431
+ * the `enum-sensor` cap); the UI renders it locale-formatted. */
6432
+ DeviceRole["DateTimeSensor"] = "datetime-sensor";
6433
+ /** Last-resort fallback when nothing else matches. */
6434
+ DeviceRole["GenericSensor"] = "generic-sensor";
6435
+ DeviceRole["NumericControl"] = "numeric-control";
6436
+ DeviceRole["SelectControl"] = "select-control";
6437
+ DeviceRole["TextControl"] = "text-control";
6438
+ DeviceRole["DateTimeControl"] = "datetime-control";
6439
+ /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
6440
+ * rich features (image, priority, channel routing). */
6441
+ DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
6442
+ /** Chat / messaging service (HA `notify.telegram_*`,
6443
+ * `notify.discord_*`, etc.). */
6444
+ DeviceRole["MessagingNotifier"] = "messaging-notifier";
6445
+ /** Email-based delivery (HA `notify.smtp`, etc.). */
6446
+ DeviceRole["EmailNotifier"] = "email-notifier";
6447
+ /** Fallback when the notifier service name doesn't match a known
6448
+ * pattern. */
6449
+ DeviceRole["GenericNotifier"] = "generic-notifier";
6450
+ return DeviceRole;
6451
+ }({});
6272
6452
  /**
6273
- * Mode of a single recording band — the recorder per-band vocabulary.
6453
+ * Generic types for capability definitions.
6274
6454
  *
6275
- * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6276
- * only ever `continuous` or `events`; "off" is expressed by the absence of a
6277
- * covering band, not by a band value.
6278
- */
6279
- var RecordingBandModeSchema = _enum(["continuous", "events"]);
6280
- /**
6281
- * Triggers for an `events`-mode band. Identical shape to
6282
- * `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
6283
- * two never drift.
6284
- */
6285
- var RecordingBandTriggersSchema = RecordingTriggersSchema;
6286
- /**
6287
- * A single mode-per-band window — the canonical recorder band shape, the
6288
- * single source of truth re-used by `addon-pipeline/recorder`.
6455
+ * A capability is defined with Zod schemas for methods, events, and settings.
6456
+ * TypeScript types are inferred via z.infer<> zero duplication.
6289
6457
  *
6290
- * `days` lists the weekdays the band covers (empty = every day, matching the
6291
- * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6292
- * span wraps past midnight (handled by the band engine).
6458
+ * Pattern:
6459
+ * 1. Define Zod schemas for data, methods, settings
6460
+ * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
6461
+ * 3. Export type IProvider = InferProvider<typeof capabilityDef>
6462
+ * 4. Addon implements IProvider
6463
+ * 5. Registry auto-mounts tRPC router from definition.methods
6293
6464
  */
6294
- var RecordingBandSchema = object({
6295
- days: array(RecordingWeekdaySchema),
6296
- start: string().regex(HHMM),
6297
- end: string().regex(HHMM),
6298
- mode: RecordingBandModeSchema,
6299
- triggers: RecordingBandTriggersSchema.optional(),
6300
- preBufferSec: number().min(0).optional(),
6301
- postBufferSec: number().min(0).optional()
6302
- });
6303
- var RecordingRuleSchema = object({
6304
- schedule: RecordingScheduleSchema,
6305
- mode: RecordingModeSchema,
6306
- /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6307
- preBufferSec: number().min(0).default(0),
6308
- /** Keep recording until this many seconds after the last trigger. */
6309
- postBufferSec: number().min(0).default(0),
6310
- /** Each new trigger restarts the post-buffer window. */
6311
- resetTimeoutOnNewEvent: boolean().default(true),
6312
- /** onAudioThreshold only — dBFS level that counts as a trigger. */
6313
- thresholdDbfs: number().optional()
6314
- });
6315
6465
  /**
6316
- * Per-device retention overrides. Every field is optional; an unset or `0`
6317
- * value inherits the node-wide recorder default. Only footage-lifetime limits
6318
- * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6319
- * (when the volume is too full to keep recording) is NOT a per-camera concern
6320
- * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6321
- * shared by every camera writing to that volume.
6466
+ * Output schema shared by the contribution + live methods.
6467
+ *
6468
+ * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
6469
+ * tabs[]) without importing from `../interfaces/config-ui.js` a
6470
+ * concrete-but-lenient Zod object keeps tRPC output inference happy
6471
+ * (using `z.unknown()` here collapses unrelated router branches to
6472
+ * `unknown` when the generator re-inlines the huge AppRouter type).
6473
+ *
6474
+ * `.passthrough()` on sections/fields accepts whatever FormBuilder
6475
+ * extensions the caller adds (showWhen, displayScale, …) without
6476
+ * rebuilding every time a new field kind is introduced.
6322
6477
  */
6323
- var RecordingRetentionSchema = object({
6324
- maxAgeDays: number().min(0).optional(),
6325
- maxSizeGb: number().min(0).optional()
6478
+ var ContributionSectionSchema = object({
6479
+ id: string(),
6480
+ title: string(),
6481
+ description: string().optional(),
6482
+ style: _enum(["card", "accordion"]).optional(),
6483
+ defaultCollapsed: boolean().optional(),
6484
+ columns: union([
6485
+ literal(1),
6486
+ literal(2),
6487
+ literal(3),
6488
+ literal(4)
6489
+ ]).optional(),
6490
+ tab: string().optional(),
6491
+ location: _enum(["settings", "top-tab"]).optional(),
6492
+ order: number().optional(),
6493
+ fields: array(any())
6326
6494
  });
6495
+ object({
6496
+ tabs: array(object({
6497
+ id: string(),
6498
+ label: string(),
6499
+ icon: string(),
6500
+ order: number().optional()
6501
+ })).optional(),
6502
+ sections: array(ContributionSectionSchema)
6503
+ }).nullable();
6504
+ object({ deviceId: number() }), object({ deviceId: number() }), object({
6505
+ deviceId: number(),
6506
+ patch: record(string(), unknown())
6507
+ }), object({ success: literal(true) });
6508
+ object({ deviceId: number() }), unknown().nullable();
6509
+ /** Shorthand to define a method schema */
6510
+ function method(input, output, options) {
6511
+ return {
6512
+ input,
6513
+ output,
6514
+ kind: options?.kind ?? "query",
6515
+ auth: options?.auth ?? "protected",
6516
+ ...options?.access !== void 0 ? { access: options.access } : {},
6517
+ timeoutMs: options?.timeoutMs
6518
+ };
6519
+ }
6520
+ /** Shorthand to define an event schema */
6521
+ function event(data) {
6522
+ return { data };
6523
+ }
6524
+ var StaticDirOutputSchema = object({ staticDir: string() });
6525
+ var VersionOutputSchema = object({ version: string() });
6526
+ method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
6327
6527
  /**
6328
- * The full per-camera recording intent the wire shape of a RecordingTarget.
6528
+ * device-ops device-scoped cap that unifies the per-IDevice operations
6529
+ * previously routed through the `.device-ops` Moleculer bridge service.
6329
6530
  *
6330
- * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6331
- * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6332
- * only for transition + migration (`migrateRulesToMode`); the policy engine
6333
- * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6531
+ * Each worker that hosts live `IDevice` instances auto-registers a native
6532
+ * provider for this cap (per device) backed by its local
6533
+ * `DeviceRegistry`. Hub-side callers reach it transparently through
6534
+ * `ctx.fetchDevice(id).deviceOps.*` the DeviceProxy injects
6535
+ * `deviceId` + `nodeId` and dispatches through the standard cap-router,
6536
+ * so there's no parallel bridge path anymore.
6537
+ *
6538
+ * The surface is intentionally small — every method corresponds to a
6539
+ * single action on the live `IDevice` (or `ICameraDevice` for
6540
+ * `getStreamSources`). Richer orchestration (enable/disable with
6541
+ * integration plumbing, bulk updates) stays in the `device-manager` cap;
6542
+ * `device-ops` is the per-device primitive the device-manager routes to.
6334
6543
  */
6335
- var RecordingConfigSchema = object({
6336
- enabled: boolean(),
6337
- /** Authoritative storage mode. Absent on legacy targets → derived once via
6338
- * `migrateRulesToMode`, then persisted. */
6339
- mode: RecordingStorageModeSchema.optional(),
6340
- profiles: array(CamProfileSchema).optional(),
6341
- segmentSeconds: number().int().positive().optional(),
6342
- /** Shared recording time-bands for `events` & `continuous` — record only when
6544
+ var StreamSourceEntrySchema = object({
6545
+ id: string(),
6546
+ label: string(),
6547
+ protocol: _enum([
6548
+ "rtsp",
6549
+ "rtmp",
6550
+ "annexb",
6551
+ "http-mjpeg",
6552
+ "webrtc",
6553
+ "custom"
6554
+ ]),
6555
+ url: string().optional(),
6556
+ resolution: object({
6557
+ width: number(),
6558
+ height: number()
6559
+ }).optional(),
6560
+ fps: number().optional(),
6561
+ bitrate: number().optional(),
6562
+ codec: string().optional(),
6563
+ profileHint: CamProfileSchema.optional(),
6564
+ sdp: string().optional()
6565
+ });
6566
+ var ConfigEntrySchema$1 = object({
6567
+ key: string(),
6568
+ value: unknown()
6569
+ });
6570
+ var RawStateResultSchema = object({
6571
+ /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
6572
+ source: string(),
6573
+ /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
6574
+ data: record(string(), unknown())
6575
+ });
6576
+ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
6577
+ deviceId: number(),
6578
+ values: record(string(), unknown())
6579
+ }), _void(), { kind: "mutation" }), method(object({
6580
+ deviceId: number(),
6581
+ action: string().min(1),
6582
+ input: unknown()
6583
+ }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
6584
+ //#endregion
6585
+ //#region ../types/dist/err-msg-IQTHeDzc.mjs
6586
+ /**
6587
+ import { errMsg } from '@camstack/types'
6588
+ * Extract a human-readable message from an unknown error value.
6589
+ * Replaces the ubiquitous `errMsg(err)` pattern.
6590
+ */
6591
+ function errMsg(err) {
6592
+ if (err instanceof Error) return err.message;
6593
+ if (typeof err === "string") return err;
6594
+ return String(err);
6595
+ }
6596
+ //#endregion
6597
+ //#region ../types/dist/index.mjs
6598
+ /**
6599
+ * Deep wiring healthcheck — snapshot of active reachability probes across
6600
+ * every declared capability + widget of every installed plugin, on every
6601
+ * node. Produced by the backend `WiringHealthService` and surfaced via
6602
+ * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
6603
+ *
6604
+ * Unlike `/health` (process liveness), this reflects whether each cap/widget
6605
+ * is actually *reachable* over the real cap-dispatch path. See spec
6606
+ * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
6607
+ */
6608
+ /** What kind of target a probe addressed. */
6609
+ var wiringProbeKindSchema = _enum([
6610
+ "singleton",
6611
+ "device",
6612
+ "widget"
6613
+ ]);
6614
+ /** Result of probing a single (cap|widget [, device]) target. */
6615
+ var wiringProbeResultSchema = object({
6616
+ capName: string(),
6617
+ kind: wiringProbeKindSchema,
6618
+ deviceId: number().optional(),
6619
+ reachable: boolean(),
6620
+ latencyMs: number(),
6621
+ error: string().optional()
6622
+ });
6623
+ /** Per-addon roll-up of cap + widget probe results. */
6624
+ var wiringAddonHealthSchema = object({
6625
+ addonId: string(),
6626
+ caps: array(wiringProbeResultSchema).readonly(),
6627
+ widgets: array(wiringProbeResultSchema).readonly()
6628
+ });
6629
+ /** Per-node roll-up. */
6630
+ var wiringNodeHealthSchema = object({
6631
+ nodeId: string(),
6632
+ addons: array(wiringAddonHealthSchema).readonly()
6633
+ });
6634
+ object({
6635
+ /** True only when every probed target is reachable. */
6636
+ ok: boolean(),
6637
+ /** True when at least one target is unreachable. */
6638
+ degraded: boolean(),
6639
+ checkedAt: string(),
6640
+ nodes: array(wiringNodeHealthSchema).readonly(),
6641
+ summary: object({
6642
+ total: number(),
6643
+ reachable: number(),
6644
+ unreachable: number()
6645
+ })
6646
+ });
6647
+ var MODEL_FORMATS = [
6648
+ "onnx",
6649
+ "coreml",
6650
+ "openvino",
6651
+ "tflite",
6652
+ "pt"
6653
+ ];
6654
+ /**
6655
+ * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6656
+ * Named `RecordingWeekday` to avoid collision with the string-union
6657
+ * `Weekday` exported from `interfaces/timezones.ts`.
6658
+ */
6659
+ var RecordingWeekdaySchema = number().int().min(0).max(6);
6660
+ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6661
+ var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6662
+ kind: literal("timeOfDay"),
6663
+ start: string().regex(HHMM),
6664
+ end: string().regex(HHMM),
6665
+ /** Restrict to these weekdays; omit = every day. */
6666
+ days: array(RecordingWeekdaySchema).optional()
6667
+ })]);
6668
+ var RecordingModeSchema = _enum([
6669
+ "continuous",
6670
+ "onMotion",
6671
+ "onAudioThreshold"
6672
+ ]);
6673
+ /**
6674
+ * First-class, authoritative per-camera storage mode — the netta choice the UI
6675
+ * reads directly (never inferred from `rules`):
6676
+ * - `off` — not recording.
6677
+ * - `events` — record only around triggers (motion / audio threshold),
6678
+ * with pre/post-buffer.
6679
+ * - `continuous` — record 24/7 within the schedule.
6680
+ *
6681
+ * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6682
+ * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6683
+ */
6684
+ var RecordingStorageModeSchema = _enum([
6685
+ "off",
6686
+ "events",
6687
+ "continuous"
6688
+ ]);
6689
+ /** Which detectors trigger an `events`-mode recording. */
6690
+ var RecordingTriggersSchema = object({
6691
+ motion: boolean().optional(),
6692
+ audioThresholdDbfs: number().optional()
6693
+ });
6694
+ /**
6695
+ * Mode of a single recording band — the recorder per-band vocabulary.
6696
+ *
6697
+ * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6698
+ * only ever `continuous` or `events`; "off" is expressed by the absence of a
6699
+ * covering band, not by a band value.
6700
+ */
6701
+ var RecordingBandModeSchema = _enum(["continuous", "events"]);
6702
+ /**
6703
+ * Triggers for an `events`-mode band. Identical shape to
6704
+ * `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
6705
+ * two never drift.
6706
+ */
6707
+ var RecordingBandTriggersSchema = RecordingTriggersSchema;
6708
+ /**
6709
+ * A single mode-per-band window — the canonical recorder band shape, the
6710
+ * single source of truth re-used by `addon-pipeline/recorder`.
6711
+ *
6712
+ * `days` lists the weekdays the band covers (empty = every day, matching the
6713
+ * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6714
+ * span wraps past midnight (handled by the band engine).
6715
+ */
6716
+ var RecordingBandSchema = object({
6717
+ days: array(RecordingWeekdaySchema),
6718
+ start: string().regex(HHMM),
6719
+ end: string().regex(HHMM),
6720
+ mode: RecordingBandModeSchema,
6721
+ triggers: RecordingBandTriggersSchema.optional(),
6722
+ preBufferSec: number().min(0).optional(),
6723
+ postBufferSec: number().min(0).optional()
6724
+ });
6725
+ var RecordingRuleSchema = object({
6726
+ schedule: RecordingScheduleSchema,
6727
+ mode: RecordingModeSchema,
6728
+ /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6729
+ preBufferSec: number().min(0).default(0),
6730
+ /** Keep recording until this many seconds after the last trigger. */
6731
+ postBufferSec: number().min(0).default(0),
6732
+ /** Each new trigger restarts the post-buffer window. */
6733
+ resetTimeoutOnNewEvent: boolean().default(true),
6734
+ /** onAudioThreshold only — dBFS level that counts as a trigger. */
6735
+ thresholdDbfs: number().optional()
6736
+ });
6737
+ /**
6738
+ * Per-device retention overrides. Every field is optional; an unset or `0`
6739
+ * value inherits the node-wide recorder default. Only footage-lifetime limits
6740
+ * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6741
+ * (when the volume is too full to keep recording) is NOT a per-camera concern —
6742
+ * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6743
+ * shared by every camera writing to that volume.
6744
+ */
6745
+ var RecordingRetentionSchema = object({
6746
+ maxAgeDays: number().min(0).optional(),
6747
+ maxSizeGb: number().min(0).optional()
6748
+ });
6749
+ /**
6750
+ * The full per-camera recording intent — the wire shape of a RecordingTarget.
6751
+ *
6752
+ * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6753
+ * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6754
+ * only for transition + migration (`migrateRulesToMode`); the policy engine
6755
+ * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6756
+ */
6757
+ var RecordingConfigSchema = object({
6758
+ enabled: boolean(),
6759
+ /** Authoritative storage mode. Absent on legacy targets → derived once via
6760
+ * `migrateRulesToMode`, then persisted. */
6761
+ mode: RecordingStorageModeSchema.optional(),
6762
+ profiles: array(CamProfileSchema).optional(),
6763
+ segmentSeconds: number().int().positive().optional(),
6764
+ /** Shared recording time-bands for `events` & `continuous` — record only when
6343
6765
  * the wall-clock falls inside one of these windows. Omit or empty = always.
6344
6766
  * `continuous` compiles to one rule per band; `events` to band × trigger. */
6345
6767
  schedules: array(RecordingScheduleSchema).optional(),
@@ -6576,16 +6998,6 @@ var EncodeProfileSchema = object({
6576
6998
  */
6577
6999
  outputArgs: array(string()).optional()
6578
7000
  });
6579
- /**
6580
- import { errMsg } from '@camstack/types'
6581
- * Extract a human-readable message from an unknown error value.
6582
- * Replaces the ubiquitous `errMsg(err)` pattern.
6583
- */
6584
- function errMsg(err) {
6585
- if (err instanceof Error) return err.message;
6586
- if (typeof err === "string") return err;
6587
- return String(err);
6588
- }
6589
7001
  var YAMNET_TO_MACRO = {
6590
7002
  mapping: {
6591
7003
  Speech: "speech",
@@ -6741,392 +7153,116 @@ var YAMNET_TO_MACRO = {
6741
7153
  "Telephone dialing, DTMF": "telephone",
6742
7154
  "Busy signal": "telephone",
6743
7155
  Engine: "engine",
6744
- "Engine starting": "engine",
6745
- Idling: "engine",
6746
- "Accelerating, revving, vroom": "engine",
6747
- "Light engine (high frequency)": "engine",
6748
- "Medium engine (mid frequency)": "engine",
6749
- "Heavy engine (low frequency)": "engine",
6750
- "Lawn mower": "engine",
6751
- Chainsaw: "engine",
6752
- Hammer: "tools",
6753
- Jackhammer: "tools",
6754
- Sawing: "tools",
6755
- "Power tool": "tools",
6756
- Drill: "tools",
6757
- Sanding: "tools",
6758
- Silence: "silence"
6759
- },
6760
- preserveOriginal: false
6761
- };
6762
- var APPLE_SA_TO_MACRO = {
6763
- mapping: {
6764
- speech: "speech",
6765
- child_speech: "speech",
6766
- conversation: "speech",
6767
- whispering: "speech",
6768
- singing: "speech",
6769
- humming: "speech",
6770
- shout: "scream",
6771
- yell: "scream",
6772
- screaming: "scream",
6773
- crying: "crying",
6774
- baby_crying: "crying",
6775
- sobbing: "crying",
6776
- laughter: "laughter",
6777
- baby_laughter: "laughter",
6778
- giggling: "laughter",
6779
- music: "music",
6780
- guitar: "music",
6781
- piano: "music",
6782
- drums: "music",
6783
- dog_bark: "dog",
6784
- dog_bow_wow: "dog",
6785
- dog_growling: "dog",
6786
- dog_howl: "dog",
6787
- cat_meow: "cat",
6788
- cat_purr: "cat",
6789
- cat_hiss: "cat",
6790
- bird: "bird",
6791
- bird_chirp: "bird",
6792
- bird_squawk: "bird",
6793
- animal: "animal",
6794
- horse: "animal",
6795
- cow_moo: "animal",
6796
- insect: "animal",
6797
- alarm: "alarm",
6798
- smoke_alarm: "alarm",
6799
- fire_alarm: "alarm",
6800
- car_alarm: "alarm",
6801
- siren: "siren",
6802
- police_siren: "siren",
6803
- ambulance_siren: "siren",
6804
- doorbell: "doorbell",
6805
- door_knock: "doorbell",
6806
- knocking: "doorbell",
6807
- glass_breaking: "glass_breaking",
6808
- glass_shatter: "glass_breaking",
6809
- gunshot: "gunshot",
6810
- explosion: "gunshot",
6811
- fireworks: "gunshot",
6812
- car: "vehicle",
6813
- truck: "vehicle",
6814
- motorcycle: "vehicle",
6815
- car_horn: "vehicle",
6816
- vehicle_horn: "vehicle",
6817
- traffic: "vehicle",
6818
- fire: "fire",
6819
- fire_crackle: "fire",
6820
- water: "water",
6821
- rain: "water",
6822
- ocean: "water",
6823
- splash: "water",
6824
- wind: "wind",
6825
- thunder: "wind",
6826
- thunderstorm: "wind",
6827
- door: "door",
6828
- door_slam: "door",
6829
- sliding_door: "door",
6830
- footsteps: "footsteps",
6831
- walking: "footsteps",
6832
- running: "footsteps",
6833
- crowd: "crowd",
6834
- chatter: "crowd",
6835
- cheering: "crowd",
6836
- applause: "crowd",
6837
- telephone_ring: "telephone",
6838
- ringtone: "telephone",
6839
- engine: "engine",
6840
- engine_starting: "engine",
6841
- lawn_mower: "engine",
6842
- chainsaw: "engine",
6843
- hammer: "tools",
6844
- jackhammer: "tools",
6845
- drill: "tools",
6846
- power_tool: "tools",
6847
- silence: "silence"
6848
- },
6849
- preserveOriginal: false
6850
- };
6851
- var _macroLookup = /* @__PURE__ */ new Map();
6852
- for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6853
- for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6854
- var DeviceType = /* @__PURE__ */ function(DeviceType) {
6855
- DeviceType["Camera"] = "camera";
6856
- DeviceType["Hub"] = "hub";
6857
- DeviceType["Light"] = "light";
6858
- DeviceType["Siren"] = "siren";
6859
- DeviceType["Switch"] = "switch";
6860
- DeviceType["Sensor"] = "sensor";
6861
- DeviceType["Thermostat"] = "thermostat";
6862
- DeviceType["Button"] = "button";
6863
- /** Generic stateless event emitter — carries a device's EXACT declared
6864
- * event vocabulary verbatim (no normalization). Installed with the
6865
- * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6866
- * HA bus events (e.g. `zha_event`, generic). */
6867
- DeviceType["EventEmitter"] = "event-emitter";
6868
- /** Firmware/software update entity — current vs available version,
6869
- * updatable flag, update state, and an install action. Installed with
6870
- * the `update` cap. Sources: Homematic firmware-update channels (and
6871
- * reusable by other providers, e.g. HA `update.*` entities). */
6872
- DeviceType["Update"] = "update";
6873
- DeviceType["Generic"] = "generic";
6874
- /** Generic notification delivery target (HA `notify.<service>`, future
6875
- * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6876
- * endpoint; the `notifier` cap defines the send surface. */
6877
- DeviceType["Notifier"] = "notifier";
6878
- /** Pre-recorded action sequence with optional parameters
6879
- * (HA `script.*`). Runnable via `script-runner` cap. */
6880
- DeviceType["Script"] = "script";
6881
- /** Automation rule (HA `automation.*`) — enable/disable + manual
6882
- * trigger surface exposed via `automation-control` cap. */
6883
- DeviceType["Automation"] = "automation";
6884
- /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6885
- DeviceType["Lock"] = "lock";
6886
- /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6887
- * `valve.*`). `cover` cap with sub-roles for variant. */
6888
- DeviceType["Cover"] = "cover";
6889
- /** Pipe / water / gas valve with open/close/stop and optional
6890
- * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6891
- * modelled on the same open/closed lifecycle. */
6892
- DeviceType["Valve"] = "valve";
6893
- /** Humidifier / dehumidifier with on/off + target humidity + mode
6894
- * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6895
- * modelled on the same target / mode lifecycle. */
6896
- DeviceType["Humidifier"] = "humidifier";
6897
- /** Water heater / boiler with target temperature + operation mode +
6898
- * away mode (HA `water_heater.*`). `water-heater` cap — a
6899
- * climate-family actuator. */
6900
- DeviceType["WaterHeater"] = "water-heater";
6901
- /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6902
- DeviceType["Fan"] = "fan";
6903
- /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6904
- * the camera surface — those use `Camera`. `media-player` cap. */
6905
- DeviceType["MediaPlayer"] = "media-player";
6906
- /** Security panel / alarm system (HA `alarm_control_panel.*`).
6907
- * `alarm-panel` cap. */
6908
- DeviceType["AlarmPanel"] = "alarm-panel";
6909
- /** Generic user-settable input (HA `number` / `input_number` / `select`
6910
- * / `input_select` / `text` / `input_text` / `input_datetime`).
6911
- * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6912
- * TextControl / DateTimeControl. */
6913
- DeviceType["Control"] = "control";
6914
- /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6915
- * `presence` cap. */
6916
- DeviceType["Presence"] = "presence";
6917
- /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6918
- * `weather` cap. */
6919
- DeviceType["Weather"] = "weather";
6920
- /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6921
- DeviceType["Vacuum"] = "vacuum";
6922
- /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6923
- * `lawn-mower-control` cap. */
6924
- DeviceType["LawnMower"] = "lawn-mower";
6925
- /** Physical HA device group — parent container for entity-children
6926
- * adopted from a single HA device entry. Not renderable as a
6927
- * standalone device; exists only to anchor child entities. */
6928
- DeviceType["Container"] = "container";
6929
- /** Single still-image entity (HA `image.*`). Read-only display of an
6930
- * `entity_picture` signed URL the browser loads directly. `image` cap. */
6931
- DeviceType["Image"] = "image";
6932
- return DeviceType;
6933
- }({});
6934
- var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6935
- DeviceFeature["BatteryOperated"] = "battery-operated";
6936
- DeviceFeature["Rebootable"] = "rebootable";
6937
- /**
6938
- * Device supports an on-demand re-sync of its derived spec with its
6939
- * upstream source — drives the generic Re-sync button. The owning
6940
- * provider implements the action via the `device-adoption.resync` cap.
6941
- */
6942
- DeviceFeature["Resyncable"] = "resyncable";
6943
- DeviceFeature["NativeSnapshot"] = "native-snapshot";
6944
- DeviceFeature["DoorbellButton"] = "doorbell-button";
6945
- DeviceFeature["TwoWayAudio"] = "two-way-audio";
6946
- DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6947
- /**
6948
- * Camera supports the on-firmware autotrack subsystem (subject-
6949
- * following). Distinct from `PanTiltZoom` because not every PTZ
6950
- * camera ships autotrack — the admin UI uses this flag to gate
6951
- * the autotrack toggle / settings card without re-deriving from
6952
- * the cap registry. Mirrors `ptz-autotrack` cap registration:
6953
- * driver sets this feature when probe confirms the firmware
6954
- * surface, and registers the cap in the same code path.
6955
- */
6956
- DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6957
- /**
6958
- * Accessory exposes a "trigger on motion" toggle — the parent camera's
6959
- * motion detection automatically activates this device. Mirrors
6960
- * `motion-trigger` cap registration: drivers set this feature in the
6961
- * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6962
- *
6963
- * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6964
- * fast scalar without binding fetch), notifier rules, and `listAll`
6965
- * filters that want "all devices with on-motion behaviour".
6966
- */
6967
- DeviceFeature["MotionTrigger"] = "motion-trigger";
6968
- /** Light supports rgb-triplet color via `color` cap. */
6969
- DeviceFeature["LightColorRgb"] = "light-color-rgb";
6970
- /** Light supports HSV color via `color` cap. */
6971
- DeviceFeature["LightColorHsv"] = "light-color-hsv";
6972
- /** Light supports color-temperature (mired) via `color` cap. */
6973
- DeviceFeature["LightColorMired"] = "light-color-mired";
6974
- /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6975
- * targetHigh). Gates the range slider UI. */
6976
- DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6977
- /** Thermostat exposes target humidity and/or current humidity
6978
- * readings. Gates the humidity controls. */
6979
- DeviceFeature["ClimateHumidity"] = "climate-humidity";
6980
- /** Thermostat exposes a fan-mode selector. */
6981
- DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6982
- /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6983
- DeviceFeature["ClimatePreset"] = "climate-preset";
6984
- /** Cover exposes intermediate position control (0..100). Gates the
6985
- * position slider UI. */
6986
- DeviceFeature["CoverPositionable"] = "cover-positionable";
6987
- /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6988
- DeviceFeature["CoverTilt"] = "cover-tilt";
6989
- /** Valve exposes intermediate position control (0..100). Gates the
6990
- * position slider / drag surface UI. */
6991
- DeviceFeature["ValvePositionable"] = "valve-positionable";
6992
- /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6993
- DeviceFeature["FanSpeed"] = "fan-speed";
6994
- /** Fan exposes a preset mode selector. */
6995
- DeviceFeature["FanPreset"] = "fan-preset";
6996
- /** Fan exposes blade direction (forward/reverse) — typical of
6997
- * ceiling fans. */
6998
- DeviceFeature["FanDirection"] = "fan-direction";
6999
- /** Fan exposes an oscillation toggle. */
7000
- DeviceFeature["FanOscillating"] = "fan-oscillating";
7001
- /** Lock requires a PIN code on lock/unlock. Gates the code-entry
7002
- * field on the UI lock-controls panel. */
7003
- DeviceFeature["LockPinRequired"] = "lock-pin-required";
7004
- /** Lock supports a latch-release ("open door") action distinct from
7005
- * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
7006
- * `supported_features`. Gates the Open Door button in the UI. */
7007
- DeviceFeature["LockOpen"] = "lock-open";
7008
- /** Media player exposes a seek-to-position surface. */
7009
- DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
7010
- /** Media player exposes a volume-level setter. */
7011
- DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
7012
- /** Media player exposes a mute toggle distinct from volume=0. */
7013
- DeviceFeature["MediaPlayerMute"] = "media-player-mute";
7014
- /** Media player exposes a shuffle toggle. */
7015
- DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
7016
- /** Media player exposes a repeat mode (off / all / one). */
7017
- DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
7018
- /** Media player exposes a source / input selector. */
7019
- DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
7020
- /** Media player exposes a play-arbitrary-media surface (URL / id). */
7021
- DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
7022
- /** Media player exposes next-track. */
7023
- DeviceFeature["MediaPlayerNext"] = "media-player-next";
7024
- /** Media player exposes previous-track. */
7025
- DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
7026
- /** Media player exposes stop distinct from pause. */
7027
- DeviceFeature["MediaPlayerStop"] = "media-player-stop";
7028
- /** Alarm panel requires a PIN code on arm/disarm. */
7029
- DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
7030
- /** Presence device carries GPS coordinates (lat/lng/accuracy) in
7031
- * addition to a textual location. */
7032
- DeviceFeature["PresenceGps"] = "presence-gps";
7033
- /** Notifier accepts an inline / URL image attachment. */
7034
- DeviceFeature["NotifierImage"] = "notifier-image";
7035
- /** Notifier accepts a priority hint (high/normal/low). */
7036
- DeviceFeature["NotifierPriority"] = "notifier-priority";
7037
- /** Notifier accepts a free-form `data` payload for platform-specific
7038
- * fields. */
7039
- DeviceFeature["NotifierData"] = "notifier-data";
7040
- /** Notifier supports interactive action buttons / callbacks. */
7041
- DeviceFeature["NotifierActions"] = "notifier-actions";
7042
- /** Notifier supports per-call recipient targeting (multi-user). */
7043
- DeviceFeature["NotifierRecipients"] = "notifier-recipients";
7044
- /** Script runner accepts a variables map on each run invocation. */
7045
- DeviceFeature["ScriptVariables"] = "script-variables";
7046
- /** Automation `trigger` accepts a skipCondition flag — fires the
7047
- * automation's actions while bypassing its condition block. */
7048
- DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
7049
- return DeviceFeature;
7050
- }({});
7051
- /**
7052
- * Semantic role a device plays within its parent. Populated by driver
7053
- * addons when creating accessory devices (Reolink siren/floodlight/
7054
- * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
7055
- * admin UI to pick icons, labels, and widgets — a `Switch` with
7056
- * `role: Floodlight` renders as a bulb with a brightness slider,
7057
- * whereas a `Switch` with `role: Siren` renders as a klaxon.
7058
- *
7059
- * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
7060
- * sqlite as a nullable TEXT column — old rows keep working unchanged.
7061
- */
7062
- var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
7063
- DeviceRole["Siren"] = "siren";
7064
- DeviceRole["Floodlight"] = "floodlight";
7065
- DeviceRole["Spotlight"] = "spotlight";
7066
- DeviceRole["PirSensor"] = "pir-sensor";
7067
- DeviceRole["Chime"] = "chime";
7068
- DeviceRole["Autotrack"] = "autotrack";
7069
- DeviceRole["Nightvision"] = "nightvision";
7070
- DeviceRole["PrivacyMask"] = "privacy-mask";
7071
- DeviceRole["Doorbell"] = "doorbell";
7072
- /** Virtual HA toggle (input_boolean.*) — distinguishable from a
7073
- * real Switch device for UI rendering / export adapters. */
7074
- DeviceRole["BinaryHelper"] = "binary-helper";
7075
- /** Generic motion / occupancy / moving event source. Distinct from
7076
- * the camera accessory PirSensor role: that one is a camera child;
7077
- * this is a standalone HA / 3rd-party motion sensor. */
7078
- DeviceRole["MotionSensor"] = "motion-sensor";
7079
- DeviceRole["ContactSensor"] = "contact-sensor";
7080
- DeviceRole["LeakSensor"] = "leak-sensor";
7081
- DeviceRole["SmokeSensor"] = "smoke-sensor";
7082
- DeviceRole["COSensor"] = "co-sensor";
7083
- DeviceRole["GasSensor"] = "gas-sensor";
7084
- DeviceRole["TamperSensor"] = "tamper-sensor";
7085
- DeviceRole["VibrationSensor"] = "vibration-sensor";
7086
- DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
7087
- DeviceRole["SoundSensor"] = "sound-sensor";
7088
- /** Fallback for `binary_sensor` without a known `device_class`. */
7089
- DeviceRole["BinarySensor"] = "binary-sensor";
7090
- DeviceRole["TemperatureSensor"] = "temperature-sensor";
7091
- DeviceRole["HumiditySensor"] = "humidity-sensor";
7092
- DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
7093
- DeviceRole["PressureSensor"] = "pressure-sensor";
7094
- DeviceRole["PowerSensor"] = "power-sensor";
7095
- DeviceRole["EnergySensor"] = "energy-sensor";
7096
- DeviceRole["VoltageSensor"] = "voltage-sensor";
7097
- DeviceRole["CurrentSensor"] = "current-sensor";
7098
- DeviceRole["AirQualitySensor"] = "air-quality-sensor";
7099
- /** Battery level (numeric % via `sensor` OR low-bool via
7100
- * `binary_sensor` — the cap distinguishes via the value type). */
7101
- DeviceRole["BatterySensor"] = "battery-sensor";
7102
- /** Fallback for `sensor` numeric without a known `device_class`. */
7103
- DeviceRole["NumericSensor"] = "numeric-sensor";
7104
- /** String / enum state (HA `sensor` with `state_class: enum` or
7105
- * `attributes.options`). */
7106
- DeviceRole["EnumSensor"] = "enum-sensor";
7107
- /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
7108
- * or `date`). The slice carries the raw ISO string verbatim (hosted on
7109
- * the `enum-sensor` cap); the UI renders it locale-formatted. */
7110
- DeviceRole["DateTimeSensor"] = "datetime-sensor";
7111
- /** Last-resort fallback when nothing else matches. */
7112
- DeviceRole["GenericSensor"] = "generic-sensor";
7113
- DeviceRole["NumericControl"] = "numeric-control";
7114
- DeviceRole["SelectControl"] = "select-control";
7115
- DeviceRole["TextControl"] = "text-control";
7116
- DeviceRole["DateTimeControl"] = "datetime-control";
7117
- /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
7118
- * rich features (image, priority, channel routing). */
7119
- DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
7120
- /** Chat / messaging service (HA `notify.telegram_*`,
7121
- * `notify.discord_*`, etc.). */
7122
- DeviceRole["MessagingNotifier"] = "messaging-notifier";
7123
- /** Email-based delivery (HA `notify.smtp`, etc.). */
7124
- DeviceRole["EmailNotifier"] = "email-notifier";
7125
- /** Fallback when the notifier service name doesn't match a known
7126
- * pattern. */
7127
- DeviceRole["GenericNotifier"] = "generic-notifier";
7128
- return DeviceRole;
7129
- }({});
7156
+ "Engine starting": "engine",
7157
+ Idling: "engine",
7158
+ "Accelerating, revving, vroom": "engine",
7159
+ "Light engine (high frequency)": "engine",
7160
+ "Medium engine (mid frequency)": "engine",
7161
+ "Heavy engine (low frequency)": "engine",
7162
+ "Lawn mower": "engine",
7163
+ Chainsaw: "engine",
7164
+ Hammer: "tools",
7165
+ Jackhammer: "tools",
7166
+ Sawing: "tools",
7167
+ "Power tool": "tools",
7168
+ Drill: "tools",
7169
+ Sanding: "tools",
7170
+ Silence: "silence"
7171
+ },
7172
+ preserveOriginal: false
7173
+ };
7174
+ var APPLE_SA_TO_MACRO = {
7175
+ mapping: {
7176
+ speech: "speech",
7177
+ child_speech: "speech",
7178
+ conversation: "speech",
7179
+ whispering: "speech",
7180
+ singing: "speech",
7181
+ humming: "speech",
7182
+ shout: "scream",
7183
+ yell: "scream",
7184
+ screaming: "scream",
7185
+ crying: "crying",
7186
+ baby_crying: "crying",
7187
+ sobbing: "crying",
7188
+ laughter: "laughter",
7189
+ baby_laughter: "laughter",
7190
+ giggling: "laughter",
7191
+ music: "music",
7192
+ guitar: "music",
7193
+ piano: "music",
7194
+ drums: "music",
7195
+ dog_bark: "dog",
7196
+ dog_bow_wow: "dog",
7197
+ dog_growling: "dog",
7198
+ dog_howl: "dog",
7199
+ cat_meow: "cat",
7200
+ cat_purr: "cat",
7201
+ cat_hiss: "cat",
7202
+ bird: "bird",
7203
+ bird_chirp: "bird",
7204
+ bird_squawk: "bird",
7205
+ animal: "animal",
7206
+ horse: "animal",
7207
+ cow_moo: "animal",
7208
+ insect: "animal",
7209
+ alarm: "alarm",
7210
+ smoke_alarm: "alarm",
7211
+ fire_alarm: "alarm",
7212
+ car_alarm: "alarm",
7213
+ siren: "siren",
7214
+ police_siren: "siren",
7215
+ ambulance_siren: "siren",
7216
+ doorbell: "doorbell",
7217
+ door_knock: "doorbell",
7218
+ knocking: "doorbell",
7219
+ glass_breaking: "glass_breaking",
7220
+ glass_shatter: "glass_breaking",
7221
+ gunshot: "gunshot",
7222
+ explosion: "gunshot",
7223
+ fireworks: "gunshot",
7224
+ car: "vehicle",
7225
+ truck: "vehicle",
7226
+ motorcycle: "vehicle",
7227
+ car_horn: "vehicle",
7228
+ vehicle_horn: "vehicle",
7229
+ traffic: "vehicle",
7230
+ fire: "fire",
7231
+ fire_crackle: "fire",
7232
+ water: "water",
7233
+ rain: "water",
7234
+ ocean: "water",
7235
+ splash: "water",
7236
+ wind: "wind",
7237
+ thunder: "wind",
7238
+ thunderstorm: "wind",
7239
+ door: "door",
7240
+ door_slam: "door",
7241
+ sliding_door: "door",
7242
+ footsteps: "footsteps",
7243
+ walking: "footsteps",
7244
+ running: "footsteps",
7245
+ crowd: "crowd",
7246
+ chatter: "crowd",
7247
+ cheering: "crowd",
7248
+ applause: "crowd",
7249
+ telephone_ring: "telephone",
7250
+ ringtone: "telephone",
7251
+ engine: "engine",
7252
+ engine_starting: "engine",
7253
+ lawn_mower: "engine",
7254
+ chainsaw: "engine",
7255
+ hammer: "tools",
7256
+ jackhammer: "tools",
7257
+ drill: "tools",
7258
+ power_tool: "tools",
7259
+ silence: "silence"
7260
+ },
7261
+ preserveOriginal: false
7262
+ };
7263
+ var _macroLookup = /* @__PURE__ */ new Map();
7264
+ for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7265
+ for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7130
7266
  /**
7131
7267
  * Accessory device helpers — shared across drivers.
7132
7268
  *
@@ -7580,78 +7716,6 @@ var airQualitySensorCapability = {
7580
7716
  runtimeState: AirQualitySensorStatusSchema
7581
7717
  };
7582
7718
  /**
7583
- * Generic types for capability definitions.
7584
- *
7585
- * A capability is defined with Zod schemas for methods, events, and settings.
7586
- * TypeScript types are inferred via z.infer<> — zero duplication.
7587
- *
7588
- * Pattern:
7589
- * 1. Define Zod schemas for data, methods, settings
7590
- * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
7591
- * 3. Export type IProvider = InferProvider<typeof capabilityDef>
7592
- * 4. Addon implements IProvider
7593
- * 5. Registry auto-mounts tRPC router from definition.methods
7594
- */
7595
- /**
7596
- * Output schema shared by the contribution + live methods.
7597
- *
7598
- * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
7599
- * tabs[]) without importing from `../interfaces/config-ui.js` — a
7600
- * concrete-but-lenient Zod object keeps tRPC output inference happy
7601
- * (using `z.unknown()` here collapses unrelated router branches to
7602
- * `unknown` when the generator re-inlines the huge AppRouter type).
7603
- *
7604
- * `.passthrough()` on sections/fields accepts whatever FormBuilder
7605
- * extensions the caller adds (showWhen, displayScale, …) without
7606
- * rebuilding every time a new field kind is introduced.
7607
- */
7608
- var ContributionSectionSchema = object({
7609
- id: string(),
7610
- title: string(),
7611
- description: string().optional(),
7612
- style: _enum(["card", "accordion"]).optional(),
7613
- defaultCollapsed: boolean().optional(),
7614
- columns: union([
7615
- literal(1),
7616
- literal(2),
7617
- literal(3),
7618
- literal(4)
7619
- ]).optional(),
7620
- tab: string().optional(),
7621
- location: _enum(["settings", "top-tab"]).optional(),
7622
- order: number().optional(),
7623
- fields: array(any())
7624
- });
7625
- object({
7626
- tabs: array(object({
7627
- id: string(),
7628
- label: string(),
7629
- icon: string(),
7630
- order: number().optional()
7631
- })).optional(),
7632
- sections: array(ContributionSectionSchema)
7633
- }).nullable();
7634
- object({ deviceId: number() }), object({ deviceId: number() }), object({
7635
- deviceId: number(),
7636
- patch: record(string(), unknown())
7637
- }), object({ success: literal(true) });
7638
- object({ deviceId: number() }), unknown().nullable();
7639
- /** Shorthand to define a method schema */
7640
- function method(input, output, options) {
7641
- return {
7642
- input,
7643
- output,
7644
- kind: options?.kind ?? "query",
7645
- auth: options?.auth ?? "protected",
7646
- ...options?.access !== void 0 ? { access: options.access } : {},
7647
- timeoutMs: options?.timeoutMs
7648
- };
7649
- }
7650
- /** Shorthand to define an event schema */
7651
- function event(data) {
7652
- return { data };
7653
- }
7654
- /**
7655
7719
  * Alarm-panel cap. Models HA `alarm_control_panel.*` on
7656
7720
  * `DeviceType.AlarmPanel`. State follows HA's canonical lifecycle
7657
7721
  * across disarmed / armed_(home|away|night|vacation|custom_bypass) /
@@ -14168,9 +14232,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
14168
14232
  limit: number().optional(),
14169
14233
  tags: record(string(), string()).optional()
14170
14234
  }), array(LogEntrySchema).readonly());
14171
- var StaticDirOutputSchema = object({ staticDir: string() });
14172
- var VersionOutputSchema = object({ version: string() });
14173
- method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
14174
14235
  /**
14175
14236
  * Zod schemas for persisted record types.
14176
14237
  *
@@ -16537,7 +16598,7 @@ method(object({
16537
16598
  }), _void(), {
16538
16599
  kind: "mutation",
16539
16600
  auth: "admin"
16540
- }), 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({
16601
+ }), 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({
16541
16602
  deviceId: number(),
16542
16603
  values: record(string(), unknown())
16543
16604
  }), object({ success: literal(true) }), {
@@ -17219,7 +17280,20 @@ var DiskSpaceInfoSchema = object({
17219
17280
  var PidResourceStatsSchema = object({
17220
17281
  pid: number(),
17221
17282
  cpu: number(),
17222
- memory: number()
17283
+ memory: number(),
17284
+ /**
17285
+ * Private (anonymous) resident bytes — the per-process V8 heap + native
17286
+ * allocations NOT shared with other processes (Linux RssAnon). This is the
17287
+ * "real" per-runner cost; summing it across runners is meaningful, unlike
17288
+ * `memory` (RSS), which double-counts the shared mmap'd framework code.
17289
+ * Undefined where /proc is unavailable (e.g. macOS).
17290
+ */
17291
+ privateBytes: number().optional(),
17292
+ /**
17293
+ * Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
17294
+ * code shared copy-on-write across runners. Undefined on macOS.
17295
+ */
17296
+ sharedBytes: number().optional()
17223
17297
  });
17224
17298
  var AddonInstanceSchema = object({
17225
17299
  addonId: string(),
@@ -17268,6 +17342,17 @@ var KillProcessResultSchema = object({
17268
17342
  reason: string().optional(),
17269
17343
  signal: _enum(["SIGTERM", "SIGKILL"]).optional()
17270
17344
  });
17345
+ var DumpHeapSnapshotInputSchema = object({
17346
+ /** The addon whose runner should dump a heap snapshot. */
17347
+ addonId: string() });
17348
+ var DumpHeapSnapshotResultSchema = object({
17349
+ success: boolean(),
17350
+ /** Path of the written .heapsnapshot inside the runner's container/host. */
17351
+ path: string().optional(),
17352
+ /** Process pid that was signalled. */
17353
+ pid: number().optional(),
17354
+ reason: string().optional()
17355
+ });
17271
17356
  var SystemMetricsSchema = object({
17272
17357
  cpuPercent: number(),
17273
17358
  memoryPercent: number(),
@@ -17281,6 +17366,9 @@ var SystemMetricsSchema = object({
17281
17366
  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, {
17282
17367
  kind: "mutation",
17283
17368
  auth: "admin"
17369
+ }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
17370
+ kind: "mutation",
17371
+ auth: "admin"
17284
17372
  });
17285
17373
  var PtzPresetSchema = object({
17286
17374
  id: string(),
@@ -17647,63 +17735,6 @@ method(object({
17647
17735
  auth: "admin"
17648
17736
  });
17649
17737
  /**
17650
- * device-ops — device-scoped cap that unifies the per-IDevice operations
17651
- * previously routed through the `.device-ops` Moleculer bridge service.
17652
- *
17653
- * Each worker that hosts live `IDevice` instances auto-registers a native
17654
- * provider for this cap (per device) backed by its local
17655
- * `DeviceRegistry`. Hub-side callers reach it transparently through
17656
- * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
17657
- * `deviceId` + `nodeId` and dispatches through the standard cap-router,
17658
- * so there's no parallel bridge path anymore.
17659
- *
17660
- * The surface is intentionally small — every method corresponds to a
17661
- * single action on the live `IDevice` (or `ICameraDevice` for
17662
- * `getStreamSources`). Richer orchestration (enable/disable with
17663
- * integration plumbing, bulk updates) stays in the `device-manager` cap;
17664
- * `device-ops` is the per-device primitive the device-manager routes to.
17665
- */
17666
- var StreamSourceEntrySchema$1 = object({
17667
- id: string(),
17668
- label: string(),
17669
- protocol: _enum([
17670
- "rtsp",
17671
- "rtmp",
17672
- "annexb",
17673
- "http-mjpeg",
17674
- "webrtc",
17675
- "custom"
17676
- ]),
17677
- url: string().optional(),
17678
- resolution: object({
17679
- width: number(),
17680
- height: number()
17681
- }).optional(),
17682
- fps: number().optional(),
17683
- bitrate: number().optional(),
17684
- codec: string().optional(),
17685
- profileHint: CamProfileSchema.optional(),
17686
- sdp: string().optional()
17687
- });
17688
- var ConfigEntrySchema$1 = object({
17689
- key: string(),
17690
- value: unknown()
17691
- });
17692
- var RawStateResultSchema = object({
17693
- /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
17694
- source: string(),
17695
- /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
17696
- data: record(string(), unknown())
17697
- });
17698
- method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
17699
- deviceId: number(),
17700
- values: record(string(), unknown())
17701
- }), _void(), { kind: "mutation" }), method(object({
17702
- deviceId: number(),
17703
- action: string().min(1),
17704
- input: unknown()
17705
- }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
17706
- /**
17707
17738
  * camera-credentials — device-scoped cap exposing the camera's network
17708
17739
  * + auth surface in a vendor-neutral shape.
17709
17740
  *
@@ -21475,6 +21506,12 @@ Object.freeze({
21475
21506
  addonId: null,
21476
21507
  access: "view"
21477
21508
  },
21509
+ "metricsProvider.dumpHeapSnapshot": {
21510
+ capName: "metrics-provider",
21511
+ capScope: "system",
21512
+ addonId: null,
21513
+ access: "create"
21514
+ },
21478
21515
  "metricsProvider.getAddonStats": {
21479
21516
  capName: "metrics-provider",
21480
21517
  capScope: "system",