@camstack/addon-static-turn 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.
@@ -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,121 +6173,583 @@ 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
+ var StaticDirOutputSchema = object({ staticDir: string() });
6521
+ var VersionOutputSchema = object({ version: string() });
6522
+ method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
6327
6523
  /**
6328
- * The full per-camera recording intent the wire shape of a RecordingTarget.
6524
+ * device-ops device-scoped cap that unifies the per-IDevice operations
6525
+ * previously routed through the `.device-ops` Moleculer bridge service.
6329
6526
  *
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.
6527
+ * Each worker that hosts live `IDevice` instances auto-registers a native
6528
+ * provider for this cap (per device) backed by its local
6529
+ * `DeviceRegistry`. Hub-side callers reach it transparently through
6530
+ * `ctx.fetchDevice(id).deviceOps.*` the DeviceProxy injects
6531
+ * `deviceId` + `nodeId` and dispatches through the standard cap-router,
6532
+ * so there's no parallel bridge path anymore.
6533
+ *
6534
+ * The surface is intentionally small — every method corresponds to a
6535
+ * single action on the live `IDevice` (or `ICameraDevice` for
6536
+ * `getStreamSources`). Richer orchestration (enable/disable with
6537
+ * integration plumbing, bulk updates) stays in the `device-manager` cap;
6538
+ * `device-ops` is the per-device primitive the device-manager routes to.
6334
6539
  */
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
6343
- * the wall-clock falls inside one of these windows. Omit or empty = always.
6344
- * `continuous` compiles to one rule per band; `events` to band × trigger. */
6345
- schedules: array(RecordingScheduleSchema).optional(),
6346
- /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
6540
+ var StreamSourceEntrySchema = object({
6541
+ id: string(),
6542
+ label: string(),
6543
+ protocol: _enum([
6544
+ "rtsp",
6545
+ "rtmp",
6546
+ "annexb",
6547
+ "http-mjpeg",
6548
+ "webrtc",
6549
+ "custom"
6550
+ ]),
6551
+ url: string().optional(),
6552
+ resolution: object({
6553
+ width: number(),
6554
+ height: number()
6555
+ }).optional(),
6556
+ fps: number().optional(),
6557
+ bitrate: number().optional(),
6558
+ codec: string().optional(),
6559
+ profileHint: CamProfileSchema.optional(),
6560
+ sdp: string().optional()
6561
+ });
6562
+ var ConfigEntrySchema$1 = object({
6563
+ key: string(),
6564
+ value: unknown()
6565
+ });
6566
+ var RawStateResultSchema = object({
6567
+ /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
6568
+ source: string(),
6569
+ /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
6570
+ data: record(string(), unknown())
6571
+ });
6572
+ method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
6573
+ deviceId: number(),
6574
+ values: record(string(), unknown())
6575
+ }), _void(), { kind: "mutation" }), method(object({
6576
+ deviceId: number(),
6577
+ action: string().min(1),
6578
+ input: unknown()
6579
+ }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
6580
+ //#endregion
6581
+ //#region ../types/dist/index.mjs
6582
+ /**
6583
+ * Deep wiring healthcheck — snapshot of active reachability probes across
6584
+ * every declared capability + widget of every installed plugin, on every
6585
+ * node. Produced by the backend `WiringHealthService` and surfaced via
6586
+ * `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
6587
+ *
6588
+ * Unlike `/health` (process liveness), this reflects whether each cap/widget
6589
+ * is actually *reachable* over the real cap-dispatch path. See spec
6590
+ * `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
6591
+ */
6592
+ /** What kind of target a probe addressed. */
6593
+ var wiringProbeKindSchema = _enum([
6594
+ "singleton",
6595
+ "device",
6596
+ "widget"
6597
+ ]);
6598
+ /** Result of probing a single (cap|widget [, device]) target. */
6599
+ var wiringProbeResultSchema = object({
6600
+ capName: string(),
6601
+ kind: wiringProbeKindSchema,
6602
+ deviceId: number().optional(),
6603
+ reachable: boolean(),
6604
+ latencyMs: number(),
6605
+ error: string().optional()
6606
+ });
6607
+ /** Per-addon roll-up of cap + widget probe results. */
6608
+ var wiringAddonHealthSchema = object({
6609
+ addonId: string(),
6610
+ caps: array(wiringProbeResultSchema).readonly(),
6611
+ widgets: array(wiringProbeResultSchema).readonly()
6612
+ });
6613
+ /** Per-node roll-up. */
6614
+ var wiringNodeHealthSchema = object({
6615
+ nodeId: string(),
6616
+ addons: array(wiringAddonHealthSchema).readonly()
6617
+ });
6618
+ object({
6619
+ /** True only when every probed target is reachable. */
6620
+ ok: boolean(),
6621
+ /** True when at least one target is unreachable. */
6622
+ degraded: boolean(),
6623
+ checkedAt: string(),
6624
+ nodes: array(wiringNodeHealthSchema).readonly(),
6625
+ summary: object({
6626
+ total: number(),
6627
+ reachable: number(),
6628
+ unreachable: number()
6629
+ })
6630
+ });
6631
+ var MODEL_FORMATS = [
6632
+ "onnx",
6633
+ "coreml",
6634
+ "openvino",
6635
+ "tflite",
6636
+ "pt"
6637
+ ];
6638
+ /**
6639
+ * Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
6640
+ * Named `RecordingWeekday` to avoid collision with the string-union
6641
+ * `Weekday` exported from `interfaces/timezones.ts`.
6642
+ */
6643
+ var RecordingWeekdaySchema = number().int().min(0).max(6);
6644
+ var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
6645
+ var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
6646
+ kind: literal("timeOfDay"),
6647
+ start: string().regex(HHMM),
6648
+ end: string().regex(HHMM),
6649
+ /** Restrict to these weekdays; omit = every day. */
6650
+ days: array(RecordingWeekdaySchema).optional()
6651
+ })]);
6652
+ var RecordingModeSchema = _enum([
6653
+ "continuous",
6654
+ "onMotion",
6655
+ "onAudioThreshold"
6656
+ ]);
6657
+ /**
6658
+ * First-class, authoritative per-camera storage mode — the netta choice the UI
6659
+ * reads directly (never inferred from `rules`):
6660
+ * - `off` — not recording.
6661
+ * - `events` — record only around triggers (motion / audio threshold),
6662
+ * with pre/post-buffer.
6663
+ * - `continuous` — record 24/7 within the schedule.
6664
+ *
6665
+ * `mode` compiles one-way to the internal `rules[]` consumed by the policy
6666
+ * engine (see `compileRules`); `rules[]` is never authored directly anymore.
6667
+ */
6668
+ var RecordingStorageModeSchema = _enum([
6669
+ "off",
6670
+ "events",
6671
+ "continuous"
6672
+ ]);
6673
+ /** Which detectors trigger an `events`-mode recording. */
6674
+ var RecordingTriggersSchema = object({
6675
+ motion: boolean().optional(),
6676
+ audioThresholdDbfs: number().optional()
6677
+ });
6678
+ /**
6679
+ * Mode of a single recording band — the recorder per-band vocabulary.
6680
+ *
6681
+ * Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
6682
+ * only ever `continuous` or `events`; "off" is expressed by the absence of a
6683
+ * covering band, not by a band value.
6684
+ */
6685
+ var RecordingBandModeSchema = _enum(["continuous", "events"]);
6686
+ /**
6687
+ * Triggers for an `events`-mode band. Identical shape to
6688
+ * `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
6689
+ * two never drift.
6690
+ */
6691
+ var RecordingBandTriggersSchema = RecordingTriggersSchema;
6692
+ /**
6693
+ * A single mode-per-band window — the canonical recorder band shape, the
6694
+ * single source of truth re-used by `addon-pipeline/recorder`.
6695
+ *
6696
+ * `days` lists the weekdays the band covers (empty = every day, matching the
6697
+ * band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
6698
+ * span wraps past midnight (handled by the band engine).
6699
+ */
6700
+ var RecordingBandSchema = object({
6701
+ days: array(RecordingWeekdaySchema),
6702
+ start: string().regex(HHMM),
6703
+ end: string().regex(HHMM),
6704
+ mode: RecordingBandModeSchema,
6705
+ triggers: RecordingBandTriggersSchema.optional(),
6706
+ preBufferSec: number().min(0).optional(),
6707
+ postBufferSec: number().min(0).optional()
6708
+ });
6709
+ var RecordingRuleSchema = object({
6710
+ schedule: RecordingScheduleSchema,
6711
+ mode: RecordingModeSchema,
6712
+ /** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
6713
+ preBufferSec: number().min(0).default(0),
6714
+ /** Keep recording until this many seconds after the last trigger. */
6715
+ postBufferSec: number().min(0).default(0),
6716
+ /** Each new trigger restarts the post-buffer window. */
6717
+ resetTimeoutOnNewEvent: boolean().default(true),
6718
+ /** onAudioThreshold only — dBFS level that counts as a trigger. */
6719
+ thresholdDbfs: number().optional()
6720
+ });
6721
+ /**
6722
+ * Per-device retention overrides. Every field is optional; an unset or `0`
6723
+ * value inherits the node-wide recorder default. Only footage-lifetime limits
6724
+ * live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
6725
+ * (when the volume is too full to keep recording) is NOT a per-camera concern —
6726
+ * it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
6727
+ * shared by every camera writing to that volume.
6728
+ */
6729
+ var RecordingRetentionSchema = object({
6730
+ maxAgeDays: number().min(0).optional(),
6731
+ maxSizeGb: number().min(0).optional()
6732
+ });
6733
+ /**
6734
+ * The full per-camera recording intent — the wire shape of a RecordingTarget.
6735
+ *
6736
+ * `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
6737
+ * are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
6738
+ * only for transition + migration (`migrateRulesToMode`); the policy engine
6739
+ * consumes the compiled output of `compileRules(config)`, never `rules` directly.
6740
+ */
6741
+ var RecordingConfigSchema = object({
6742
+ enabled: boolean(),
6743
+ /** Authoritative storage mode. Absent on legacy targets → derived once via
6744
+ * `migrateRulesToMode`, then persisted. */
6745
+ mode: RecordingStorageModeSchema.optional(),
6746
+ profiles: array(CamProfileSchema).optional(),
6747
+ segmentSeconds: number().int().positive().optional(),
6748
+ /** Shared recording time-bands for `events` & `continuous` — record only when
6749
+ * the wall-clock falls inside one of these windows. Omit or empty = always.
6750
+ * `continuous` compiles to one rule per band; `events` to band × trigger. */
6751
+ schedules: array(RecordingScheduleSchema).optional(),
6752
+ /** Legacy single-band predecessor of `schedules`. Read-compat only — it is
6347
6753
  * normalized into `schedules` on read and never written going forward. (Not
6348
6754
  * tagged `@deprecated`: the normalization paths must read it cast-free.) */
6349
6755
  schedule: RecordingScheduleSchema.optional(),
@@ -6727,396 +7133,120 @@ var YAMNET_TO_MACRO = {
6727
7133
  "Hubbub, speech noise, speech babble": "crowd",
6728
7134
  Telephone: "telephone",
6729
7135
  "Telephone bell ringing": "telephone",
6730
- Ringtone: "telephone",
6731
- "Telephone dialing, DTMF": "telephone",
6732
- "Busy signal": "telephone",
6733
- Engine: "engine",
6734
- "Engine starting": "engine",
6735
- Idling: "engine",
6736
- "Accelerating, revving, vroom": "engine",
6737
- "Light engine (high frequency)": "engine",
6738
- "Medium engine (mid frequency)": "engine",
6739
- "Heavy engine (low frequency)": "engine",
6740
- "Lawn mower": "engine",
6741
- Chainsaw: "engine",
6742
- Hammer: "tools",
6743
- Jackhammer: "tools",
6744
- Sawing: "tools",
6745
- "Power tool": "tools",
6746
- Drill: "tools",
6747
- Sanding: "tools",
6748
- Silence: "silence"
6749
- },
6750
- preserveOriginal: false
6751
- };
6752
- var APPLE_SA_TO_MACRO = {
6753
- mapping: {
6754
- speech: "speech",
6755
- child_speech: "speech",
6756
- conversation: "speech",
6757
- whispering: "speech",
6758
- singing: "speech",
6759
- humming: "speech",
6760
- shout: "scream",
6761
- yell: "scream",
6762
- screaming: "scream",
6763
- crying: "crying",
6764
- baby_crying: "crying",
6765
- sobbing: "crying",
6766
- laughter: "laughter",
6767
- baby_laughter: "laughter",
6768
- giggling: "laughter",
6769
- music: "music",
6770
- guitar: "music",
6771
- piano: "music",
6772
- drums: "music",
6773
- dog_bark: "dog",
6774
- dog_bow_wow: "dog",
6775
- dog_growling: "dog",
6776
- dog_howl: "dog",
6777
- cat_meow: "cat",
6778
- cat_purr: "cat",
6779
- cat_hiss: "cat",
6780
- bird: "bird",
6781
- bird_chirp: "bird",
6782
- bird_squawk: "bird",
6783
- animal: "animal",
6784
- horse: "animal",
6785
- cow_moo: "animal",
6786
- insect: "animal",
6787
- alarm: "alarm",
6788
- smoke_alarm: "alarm",
6789
- fire_alarm: "alarm",
6790
- car_alarm: "alarm",
6791
- siren: "siren",
6792
- police_siren: "siren",
6793
- ambulance_siren: "siren",
6794
- doorbell: "doorbell",
6795
- door_knock: "doorbell",
6796
- knocking: "doorbell",
6797
- glass_breaking: "glass_breaking",
6798
- glass_shatter: "glass_breaking",
6799
- gunshot: "gunshot",
6800
- explosion: "gunshot",
6801
- fireworks: "gunshot",
6802
- car: "vehicle",
6803
- truck: "vehicle",
6804
- motorcycle: "vehicle",
6805
- car_horn: "vehicle",
6806
- vehicle_horn: "vehicle",
6807
- traffic: "vehicle",
6808
- fire: "fire",
6809
- fire_crackle: "fire",
6810
- water: "water",
6811
- rain: "water",
6812
- ocean: "water",
6813
- splash: "water",
6814
- wind: "wind",
6815
- thunder: "wind",
6816
- thunderstorm: "wind",
6817
- door: "door",
6818
- door_slam: "door",
6819
- sliding_door: "door",
6820
- footsteps: "footsteps",
6821
- walking: "footsteps",
6822
- running: "footsteps",
6823
- crowd: "crowd",
6824
- chatter: "crowd",
6825
- cheering: "crowd",
6826
- applause: "crowd",
6827
- telephone_ring: "telephone",
6828
- ringtone: "telephone",
6829
- engine: "engine",
6830
- engine_starting: "engine",
6831
- lawn_mower: "engine",
6832
- chainsaw: "engine",
6833
- hammer: "tools",
6834
- jackhammer: "tools",
6835
- drill: "tools",
6836
- power_tool: "tools",
6837
- silence: "silence"
6838
- },
6839
- preserveOriginal: false
6840
- };
6841
- var _macroLookup = /* @__PURE__ */ new Map();
6842
- for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6843
- for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
6844
- var DeviceType = /* @__PURE__ */ function(DeviceType) {
6845
- DeviceType["Camera"] = "camera";
6846
- DeviceType["Hub"] = "hub";
6847
- DeviceType["Light"] = "light";
6848
- DeviceType["Siren"] = "siren";
6849
- DeviceType["Switch"] = "switch";
6850
- DeviceType["Sensor"] = "sensor";
6851
- DeviceType["Thermostat"] = "thermostat";
6852
- DeviceType["Button"] = "button";
6853
- /** Generic stateless event emitter — carries a device's EXACT declared
6854
- * event vocabulary verbatim (no normalization). Installed with the
6855
- * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
6856
- * HA bus events (e.g. `zha_event`, generic). */
6857
- DeviceType["EventEmitter"] = "event-emitter";
6858
- /** Firmware/software update entity — current vs available version,
6859
- * updatable flag, update state, and an install action. Installed with
6860
- * the `update` cap. Sources: Homematic firmware-update channels (and
6861
- * reusable by other providers, e.g. HA `update.*` entities). */
6862
- DeviceType["Update"] = "update";
6863
- DeviceType["Generic"] = "generic";
6864
- /** Generic notification delivery target (HA `notify.<service>`, future
6865
- * Telegram / Discord / ntfy / SMTP, …). One device per delivery
6866
- * endpoint; the `notifier` cap defines the send surface. */
6867
- DeviceType["Notifier"] = "notifier";
6868
- /** Pre-recorded action sequence with optional parameters
6869
- * (HA `script.*`). Runnable via `script-runner` cap. */
6870
- DeviceType["Script"] = "script";
6871
- /** Automation rule (HA `automation.*`) — enable/disable + manual
6872
- * trigger surface exposed via `automation-control` cap. */
6873
- DeviceType["Automation"] = "automation";
6874
- /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
6875
- DeviceType["Lock"] = "lock";
6876
- /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
6877
- * `valve.*`). `cover` cap with sub-roles for variant. */
6878
- DeviceType["Cover"] = "cover";
6879
- /** Pipe / water / gas valve with open/close/stop and optional
6880
- * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
6881
- * modelled on the same open/closed lifecycle. */
6882
- DeviceType["Valve"] = "valve";
6883
- /** Humidifier / dehumidifier with on/off + target humidity + mode
6884
- * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
6885
- * modelled on the same target / mode lifecycle. */
6886
- DeviceType["Humidifier"] = "humidifier";
6887
- /** Water heater / boiler with target temperature + operation mode +
6888
- * away mode (HA `water_heater.*`). `water-heater` cap — a
6889
- * climate-family actuator. */
6890
- DeviceType["WaterHeater"] = "water-heater";
6891
- /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
6892
- DeviceType["Fan"] = "fan";
6893
- /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
6894
- * the camera surface — those use `Camera`. `media-player` cap. */
6895
- DeviceType["MediaPlayer"] = "media-player";
6896
- /** Security panel / alarm system (HA `alarm_control_panel.*`).
6897
- * `alarm-panel` cap. */
6898
- DeviceType["AlarmPanel"] = "alarm-panel";
6899
- /** Generic user-settable input (HA `number` / `input_number` / `select`
6900
- * / `input_select` / `text` / `input_text` / `input_datetime`).
6901
- * Sub-type via `DeviceRole`: NumericControl / SelectControl /
6902
- * TextControl / DateTimeControl. */
6903
- DeviceType["Control"] = "control";
6904
- /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
6905
- * `presence` cap. */
6906
- DeviceType["Presence"] = "presence";
6907
- /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
6908
- * `weather` cap. */
6909
- DeviceType["Weather"] = "weather";
6910
- /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
6911
- DeviceType["Vacuum"] = "vacuum";
6912
- /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
6913
- * `lawn-mower-control` cap. */
6914
- DeviceType["LawnMower"] = "lawn-mower";
6915
- /** Physical HA device group — parent container for entity-children
6916
- * adopted from a single HA device entry. Not renderable as a
6917
- * standalone device; exists only to anchor child entities. */
6918
- DeviceType["Container"] = "container";
6919
- /** Single still-image entity (HA `image.*`). Read-only display of an
6920
- * `entity_picture` signed URL the browser loads directly. `image` cap. */
6921
- DeviceType["Image"] = "image";
6922
- return DeviceType;
6923
- }({});
6924
- var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
6925
- DeviceFeature["BatteryOperated"] = "battery-operated";
6926
- DeviceFeature["Rebootable"] = "rebootable";
6927
- /**
6928
- * Device supports an on-demand re-sync of its derived spec with its
6929
- * upstream source — drives the generic Re-sync button. The owning
6930
- * provider implements the action via the `device-adoption.resync` cap.
6931
- */
6932
- DeviceFeature["Resyncable"] = "resyncable";
6933
- DeviceFeature["NativeSnapshot"] = "native-snapshot";
6934
- DeviceFeature["DoorbellButton"] = "doorbell-button";
6935
- DeviceFeature["TwoWayAudio"] = "two-way-audio";
6936
- DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
6937
- /**
6938
- * Camera supports the on-firmware autotrack subsystem (subject-
6939
- * following). Distinct from `PanTiltZoom` because not every PTZ
6940
- * camera ships autotrack — the admin UI uses this flag to gate
6941
- * the autotrack toggle / settings card without re-deriving from
6942
- * the cap registry. Mirrors `ptz-autotrack` cap registration:
6943
- * driver sets this feature when probe confirms the firmware
6944
- * surface, and registers the cap in the same code path.
6945
- */
6946
- DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
6947
- /**
6948
- * Accessory exposes a "trigger on motion" toggle — the parent camera's
6949
- * motion detection automatically activates this device. Mirrors
6950
- * `motion-trigger` cap registration: drivers set this feature in the
6951
- * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
6952
- *
6953
- * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
6954
- * fast scalar without binding fetch), notifier rules, and `listAll`
6955
- * filters that want "all devices with on-motion behaviour".
6956
- */
6957
- DeviceFeature["MotionTrigger"] = "motion-trigger";
6958
- /** Light supports rgb-triplet color via `color` cap. */
6959
- DeviceFeature["LightColorRgb"] = "light-color-rgb";
6960
- /** Light supports HSV color via `color` cap. */
6961
- DeviceFeature["LightColorHsv"] = "light-color-hsv";
6962
- /** Light supports color-temperature (mired) via `color` cap. */
6963
- DeviceFeature["LightColorMired"] = "light-color-mired";
6964
- /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
6965
- * targetHigh). Gates the range slider UI. */
6966
- DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
6967
- /** Thermostat exposes target humidity and/or current humidity
6968
- * readings. Gates the humidity controls. */
6969
- DeviceFeature["ClimateHumidity"] = "climate-humidity";
6970
- /** Thermostat exposes a fan-mode selector. */
6971
- DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
6972
- /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
6973
- DeviceFeature["ClimatePreset"] = "climate-preset";
6974
- /** Cover exposes intermediate position control (0..100). Gates the
6975
- * position slider UI. */
6976
- DeviceFeature["CoverPositionable"] = "cover-positionable";
6977
- /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
6978
- DeviceFeature["CoverTilt"] = "cover-tilt";
6979
- /** Valve exposes intermediate position control (0..100). Gates the
6980
- * position slider / drag surface UI. */
6981
- DeviceFeature["ValvePositionable"] = "valve-positionable";
6982
- /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
6983
- DeviceFeature["FanSpeed"] = "fan-speed";
6984
- /** Fan exposes a preset mode selector. */
6985
- DeviceFeature["FanPreset"] = "fan-preset";
6986
- /** Fan exposes blade direction (forward/reverse) — typical of
6987
- * ceiling fans. */
6988
- DeviceFeature["FanDirection"] = "fan-direction";
6989
- /** Fan exposes an oscillation toggle. */
6990
- DeviceFeature["FanOscillating"] = "fan-oscillating";
6991
- /** Lock requires a PIN code on lock/unlock. Gates the code-entry
6992
- * field on the UI lock-controls panel. */
6993
- DeviceFeature["LockPinRequired"] = "lock-pin-required";
6994
- /** Lock supports a latch-release ("open door") action distinct from
6995
- * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
6996
- * `supported_features`. Gates the Open Door button in the UI. */
6997
- DeviceFeature["LockOpen"] = "lock-open";
6998
- /** Media player exposes a seek-to-position surface. */
6999
- DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
7000
- /** Media player exposes a volume-level setter. */
7001
- DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
7002
- /** Media player exposes a mute toggle distinct from volume=0. */
7003
- DeviceFeature["MediaPlayerMute"] = "media-player-mute";
7004
- /** Media player exposes a shuffle toggle. */
7005
- DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
7006
- /** Media player exposes a repeat mode (off / all / one). */
7007
- DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
7008
- /** Media player exposes a source / input selector. */
7009
- DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
7010
- /** Media player exposes a play-arbitrary-media surface (URL / id). */
7011
- DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
7012
- /** Media player exposes next-track. */
7013
- DeviceFeature["MediaPlayerNext"] = "media-player-next";
7014
- /** Media player exposes previous-track. */
7015
- DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
7016
- /** Media player exposes stop distinct from pause. */
7017
- DeviceFeature["MediaPlayerStop"] = "media-player-stop";
7018
- /** Alarm panel requires a PIN code on arm/disarm. */
7019
- DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
7020
- /** Presence device carries GPS coordinates (lat/lng/accuracy) in
7021
- * addition to a textual location. */
7022
- DeviceFeature["PresenceGps"] = "presence-gps";
7023
- /** Notifier accepts an inline / URL image attachment. */
7024
- DeviceFeature["NotifierImage"] = "notifier-image";
7025
- /** Notifier accepts a priority hint (high/normal/low). */
7026
- DeviceFeature["NotifierPriority"] = "notifier-priority";
7027
- /** Notifier accepts a free-form `data` payload for platform-specific
7028
- * fields. */
7029
- DeviceFeature["NotifierData"] = "notifier-data";
7030
- /** Notifier supports interactive action buttons / callbacks. */
7031
- DeviceFeature["NotifierActions"] = "notifier-actions";
7032
- /** Notifier supports per-call recipient targeting (multi-user). */
7033
- DeviceFeature["NotifierRecipients"] = "notifier-recipients";
7034
- /** Script runner accepts a variables map on each run invocation. */
7035
- DeviceFeature["ScriptVariables"] = "script-variables";
7036
- /** Automation `trigger` accepts a skipCondition flag — fires the
7037
- * automation's actions while bypassing its condition block. */
7038
- DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
7039
- return DeviceFeature;
7040
- }({});
7041
- /**
7042
- * Semantic role a device plays within its parent. Populated by driver
7043
- * addons when creating accessory devices (Reolink siren/floodlight/
7044
- * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
7045
- * admin UI to pick icons, labels, and widgets — a `Switch` with
7046
- * `role: Floodlight` renders as a bulb with a brightness slider,
7047
- * whereas a `Switch` with `role: Siren` renders as a klaxon.
7048
- *
7049
- * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
7050
- * sqlite as a nullable TEXT column — old rows keep working unchanged.
7051
- */
7052
- var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
7053
- DeviceRole["Siren"] = "siren";
7054
- DeviceRole["Floodlight"] = "floodlight";
7055
- DeviceRole["Spotlight"] = "spotlight";
7056
- DeviceRole["PirSensor"] = "pir-sensor";
7057
- DeviceRole["Chime"] = "chime";
7058
- DeviceRole["Autotrack"] = "autotrack";
7059
- DeviceRole["Nightvision"] = "nightvision";
7060
- DeviceRole["PrivacyMask"] = "privacy-mask";
7061
- DeviceRole["Doorbell"] = "doorbell";
7062
- /** Virtual HA toggle (input_boolean.*) — distinguishable from a
7063
- * real Switch device for UI rendering / export adapters. */
7064
- DeviceRole["BinaryHelper"] = "binary-helper";
7065
- /** Generic motion / occupancy / moving event source. Distinct from
7066
- * the camera accessory PirSensor role: that one is a camera child;
7067
- * this is a standalone HA / 3rd-party motion sensor. */
7068
- DeviceRole["MotionSensor"] = "motion-sensor";
7069
- DeviceRole["ContactSensor"] = "contact-sensor";
7070
- DeviceRole["LeakSensor"] = "leak-sensor";
7071
- DeviceRole["SmokeSensor"] = "smoke-sensor";
7072
- DeviceRole["COSensor"] = "co-sensor";
7073
- DeviceRole["GasSensor"] = "gas-sensor";
7074
- DeviceRole["TamperSensor"] = "tamper-sensor";
7075
- DeviceRole["VibrationSensor"] = "vibration-sensor";
7076
- DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
7077
- DeviceRole["SoundSensor"] = "sound-sensor";
7078
- /** Fallback for `binary_sensor` without a known `device_class`. */
7079
- DeviceRole["BinarySensor"] = "binary-sensor";
7080
- DeviceRole["TemperatureSensor"] = "temperature-sensor";
7081
- DeviceRole["HumiditySensor"] = "humidity-sensor";
7082
- DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
7083
- DeviceRole["PressureSensor"] = "pressure-sensor";
7084
- DeviceRole["PowerSensor"] = "power-sensor";
7085
- DeviceRole["EnergySensor"] = "energy-sensor";
7086
- DeviceRole["VoltageSensor"] = "voltage-sensor";
7087
- DeviceRole["CurrentSensor"] = "current-sensor";
7088
- DeviceRole["AirQualitySensor"] = "air-quality-sensor";
7089
- /** Battery level (numeric % via `sensor` OR low-bool via
7090
- * `binary_sensor` — the cap distinguishes via the value type). */
7091
- DeviceRole["BatterySensor"] = "battery-sensor";
7092
- /** Fallback for `sensor` numeric without a known `device_class`. */
7093
- DeviceRole["NumericSensor"] = "numeric-sensor";
7094
- /** String / enum state (HA `sensor` with `state_class: enum` or
7095
- * `attributes.options`). */
7096
- DeviceRole["EnumSensor"] = "enum-sensor";
7097
- /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
7098
- * or `date`). The slice carries the raw ISO string verbatim (hosted on
7099
- * the `enum-sensor` cap); the UI renders it locale-formatted. */
7100
- DeviceRole["DateTimeSensor"] = "datetime-sensor";
7101
- /** Last-resort fallback when nothing else matches. */
7102
- DeviceRole["GenericSensor"] = "generic-sensor";
7103
- DeviceRole["NumericControl"] = "numeric-control";
7104
- DeviceRole["SelectControl"] = "select-control";
7105
- DeviceRole["TextControl"] = "text-control";
7106
- DeviceRole["DateTimeControl"] = "datetime-control";
7107
- /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
7108
- * rich features (image, priority, channel routing). */
7109
- DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
7110
- /** Chat / messaging service (HA `notify.telegram_*`,
7111
- * `notify.discord_*`, etc.). */
7112
- DeviceRole["MessagingNotifier"] = "messaging-notifier";
7113
- /** Email-based delivery (HA `notify.smtp`, etc.). */
7114
- DeviceRole["EmailNotifier"] = "email-notifier";
7115
- /** Fallback when the notifier service name doesn't match a known
7116
- * pattern. */
7117
- DeviceRole["GenericNotifier"] = "generic-notifier";
7118
- return DeviceRole;
7119
- }({});
7136
+ Ringtone: "telephone",
7137
+ "Telephone dialing, DTMF": "telephone",
7138
+ "Busy signal": "telephone",
7139
+ Engine: "engine",
7140
+ "Engine starting": "engine",
7141
+ Idling: "engine",
7142
+ "Accelerating, revving, vroom": "engine",
7143
+ "Light engine (high frequency)": "engine",
7144
+ "Medium engine (mid frequency)": "engine",
7145
+ "Heavy engine (low frequency)": "engine",
7146
+ "Lawn mower": "engine",
7147
+ Chainsaw: "engine",
7148
+ Hammer: "tools",
7149
+ Jackhammer: "tools",
7150
+ Sawing: "tools",
7151
+ "Power tool": "tools",
7152
+ Drill: "tools",
7153
+ Sanding: "tools",
7154
+ Silence: "silence"
7155
+ },
7156
+ preserveOriginal: false
7157
+ };
7158
+ var APPLE_SA_TO_MACRO = {
7159
+ mapping: {
7160
+ speech: "speech",
7161
+ child_speech: "speech",
7162
+ conversation: "speech",
7163
+ whispering: "speech",
7164
+ singing: "speech",
7165
+ humming: "speech",
7166
+ shout: "scream",
7167
+ yell: "scream",
7168
+ screaming: "scream",
7169
+ crying: "crying",
7170
+ baby_crying: "crying",
7171
+ sobbing: "crying",
7172
+ laughter: "laughter",
7173
+ baby_laughter: "laughter",
7174
+ giggling: "laughter",
7175
+ music: "music",
7176
+ guitar: "music",
7177
+ piano: "music",
7178
+ drums: "music",
7179
+ dog_bark: "dog",
7180
+ dog_bow_wow: "dog",
7181
+ dog_growling: "dog",
7182
+ dog_howl: "dog",
7183
+ cat_meow: "cat",
7184
+ cat_purr: "cat",
7185
+ cat_hiss: "cat",
7186
+ bird: "bird",
7187
+ bird_chirp: "bird",
7188
+ bird_squawk: "bird",
7189
+ animal: "animal",
7190
+ horse: "animal",
7191
+ cow_moo: "animal",
7192
+ insect: "animal",
7193
+ alarm: "alarm",
7194
+ smoke_alarm: "alarm",
7195
+ fire_alarm: "alarm",
7196
+ car_alarm: "alarm",
7197
+ siren: "siren",
7198
+ police_siren: "siren",
7199
+ ambulance_siren: "siren",
7200
+ doorbell: "doorbell",
7201
+ door_knock: "doorbell",
7202
+ knocking: "doorbell",
7203
+ glass_breaking: "glass_breaking",
7204
+ glass_shatter: "glass_breaking",
7205
+ gunshot: "gunshot",
7206
+ explosion: "gunshot",
7207
+ fireworks: "gunshot",
7208
+ car: "vehicle",
7209
+ truck: "vehicle",
7210
+ motorcycle: "vehicle",
7211
+ car_horn: "vehicle",
7212
+ vehicle_horn: "vehicle",
7213
+ traffic: "vehicle",
7214
+ fire: "fire",
7215
+ fire_crackle: "fire",
7216
+ water: "water",
7217
+ rain: "water",
7218
+ ocean: "water",
7219
+ splash: "water",
7220
+ wind: "wind",
7221
+ thunder: "wind",
7222
+ thunderstorm: "wind",
7223
+ door: "door",
7224
+ door_slam: "door",
7225
+ sliding_door: "door",
7226
+ footsteps: "footsteps",
7227
+ walking: "footsteps",
7228
+ running: "footsteps",
7229
+ crowd: "crowd",
7230
+ chatter: "crowd",
7231
+ cheering: "crowd",
7232
+ applause: "crowd",
7233
+ telephone_ring: "telephone",
7234
+ ringtone: "telephone",
7235
+ engine: "engine",
7236
+ engine_starting: "engine",
7237
+ lawn_mower: "engine",
7238
+ chainsaw: "engine",
7239
+ hammer: "tools",
7240
+ jackhammer: "tools",
7241
+ drill: "tools",
7242
+ power_tool: "tools",
7243
+ silence: "silence"
7244
+ },
7245
+ preserveOriginal: false
7246
+ };
7247
+ var _macroLookup = /* @__PURE__ */ new Map();
7248
+ for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7249
+ for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
7120
7250
  /**
7121
7251
  * Accessory device helpers — shared across drivers.
7122
7252
  *
@@ -7276,74 +7406,6 @@ object({
7276
7406
  });
7277
7407
  DeviceType.Sensor;
7278
7408
  /**
7279
- * Generic types for capability definitions.
7280
- *
7281
- * A capability is defined with Zod schemas for methods, events, and settings.
7282
- * TypeScript types are inferred via z.infer<> — zero duplication.
7283
- *
7284
- * Pattern:
7285
- * 1. Define Zod schemas for data, methods, settings
7286
- * 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
7287
- * 3. Export type IProvider = InferProvider<typeof capabilityDef>
7288
- * 4. Addon implements IProvider
7289
- * 5. Registry auto-mounts tRPC router from definition.methods
7290
- */
7291
- /**
7292
- * Output schema shared by the contribution + live methods.
7293
- *
7294
- * Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
7295
- * tabs[]) without importing from `../interfaces/config-ui.js` — a
7296
- * concrete-but-lenient Zod object keeps tRPC output inference happy
7297
- * (using `z.unknown()` here collapses unrelated router branches to
7298
- * `unknown` when the generator re-inlines the huge AppRouter type).
7299
- *
7300
- * `.passthrough()` on sections/fields accepts whatever FormBuilder
7301
- * extensions the caller adds (showWhen, displayScale, …) without
7302
- * rebuilding every time a new field kind is introduced.
7303
- */
7304
- var ContributionSectionSchema = object({
7305
- id: string(),
7306
- title: string(),
7307
- description: string().optional(),
7308
- style: _enum(["card", "accordion"]).optional(),
7309
- defaultCollapsed: boolean().optional(),
7310
- columns: union([
7311
- literal(1),
7312
- literal(2),
7313
- literal(3),
7314
- literal(4)
7315
- ]).optional(),
7316
- tab: string().optional(),
7317
- location: _enum(["settings", "top-tab"]).optional(),
7318
- order: number().optional(),
7319
- fields: array(any())
7320
- });
7321
- object({
7322
- tabs: array(object({
7323
- id: string(),
7324
- label: string(),
7325
- icon: string(),
7326
- order: number().optional()
7327
- })).optional(),
7328
- sections: array(ContributionSectionSchema)
7329
- }).nullable();
7330
- object({ deviceId: number() }), object({ deviceId: number() }), object({
7331
- deviceId: number(),
7332
- patch: record(string(), unknown())
7333
- }), object({ success: literal(true) });
7334
- object({ deviceId: number() }), unknown().nullable();
7335
- /** Shorthand to define a method schema */
7336
- function method(input, output, options) {
7337
- return {
7338
- input,
7339
- output,
7340
- kind: options?.kind ?? "query",
7341
- auth: options?.auth ?? "protected",
7342
- ...options?.access !== void 0 ? { access: options.access } : {},
7343
- timeoutMs: options?.timeoutMs
7344
- };
7345
- }
7346
- /**
7347
7409
  * Alarm-panel cap. Models HA `alarm_control_panel.*` on
7348
7410
  * `DeviceType.AlarmPanel`. State follows HA's canonical lifecycle
7349
7411
  * across disarmed / armed_(home|away|night|vacation|custom_bypass) /
@@ -11345,9 +11407,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
11345
11407
  limit: number().optional(),
11346
11408
  tags: record(string(), string()).optional()
11347
11409
  }), array(LogEntrySchema).readonly());
11348
- var StaticDirOutputSchema = object({ staticDir: string() });
11349
- var VersionOutputSchema = object({ version: string() });
11350
- method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
11351
11410
  /**
11352
11411
  * Zod schemas for persisted record types.
11353
11412
  *
@@ -13648,7 +13707,7 @@ method(object({
13648
13707
  }), _void(), {
13649
13708
  kind: "mutation",
13650
13709
  auth: "admin"
13651
- }), 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({
13710
+ }), 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({
13652
13711
  deviceId: number(),
13653
13712
  values: record(string(), unknown())
13654
13713
  }), object({ success: literal(true) }), {
@@ -14353,7 +14412,20 @@ var DiskSpaceInfoSchema = object({
14353
14412
  var PidResourceStatsSchema = object({
14354
14413
  pid: number(),
14355
14414
  cpu: number(),
14356
- memory: number()
14415
+ memory: number(),
14416
+ /**
14417
+ * Private (anonymous) resident bytes — the per-process V8 heap + native
14418
+ * allocations NOT shared with other processes (Linux RssAnon). This is the
14419
+ * "real" per-runner cost; summing it across runners is meaningful, unlike
14420
+ * `memory` (RSS), which double-counts the shared mmap'd framework code.
14421
+ * Undefined where /proc is unavailable (e.g. macOS).
14422
+ */
14423
+ privateBytes: number().optional(),
14424
+ /**
14425
+ * Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
14426
+ * code shared copy-on-write across runners. Undefined on macOS.
14427
+ */
14428
+ sharedBytes: number().optional()
14357
14429
  });
14358
14430
  var AddonInstanceSchema = object({
14359
14431
  addonId: string(),
@@ -14402,6 +14474,17 @@ var KillProcessResultSchema = object({
14402
14474
  reason: string().optional(),
14403
14475
  signal: _enum(["SIGTERM", "SIGKILL"]).optional()
14404
14476
  });
14477
+ var DumpHeapSnapshotInputSchema = object({
14478
+ /** The addon whose runner should dump a heap snapshot. */
14479
+ addonId: string() });
14480
+ var DumpHeapSnapshotResultSchema = object({
14481
+ success: boolean(),
14482
+ /** Path of the written .heapsnapshot inside the runner's container/host. */
14483
+ path: string().optional(),
14484
+ /** Process pid that was signalled. */
14485
+ pid: number().optional(),
14486
+ reason: string().optional()
14487
+ });
14405
14488
  var SystemMetricsSchema = object({
14406
14489
  cpuPercent: number(),
14407
14490
  memoryPercent: number(),
@@ -14415,6 +14498,9 @@ var SystemMetricsSchema = object({
14415
14498
  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, {
14416
14499
  kind: "mutation",
14417
14500
  auth: "admin"
14501
+ }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
14502
+ kind: "mutation",
14503
+ auth: "admin"
14418
14504
  });
14419
14505
  var PtzPresetSchema = object({
14420
14506
  id: string(),
@@ -14781,63 +14867,6 @@ method(object({
14781
14867
  auth: "admin"
14782
14868
  });
14783
14869
  /**
14784
- * device-ops — device-scoped cap that unifies the per-IDevice operations
14785
- * previously routed through the `.device-ops` Moleculer bridge service.
14786
- *
14787
- * Each worker that hosts live `IDevice` instances auto-registers a native
14788
- * provider for this cap (per device) backed by its local
14789
- * `DeviceRegistry`. Hub-side callers reach it transparently through
14790
- * `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
14791
- * `deviceId` + `nodeId` and dispatches through the standard cap-router,
14792
- * so there's no parallel bridge path anymore.
14793
- *
14794
- * The surface is intentionally small — every method corresponds to a
14795
- * single action on the live `IDevice` (or `ICameraDevice` for
14796
- * `getStreamSources`). Richer orchestration (enable/disable with
14797
- * integration plumbing, bulk updates) stays in the `device-manager` cap;
14798
- * `device-ops` is the per-device primitive the device-manager routes to.
14799
- */
14800
- var StreamSourceEntrySchema$1 = object({
14801
- id: string(),
14802
- label: string(),
14803
- protocol: _enum([
14804
- "rtsp",
14805
- "rtmp",
14806
- "annexb",
14807
- "http-mjpeg",
14808
- "webrtc",
14809
- "custom"
14810
- ]),
14811
- url: string().optional(),
14812
- resolution: object({
14813
- width: number(),
14814
- height: number()
14815
- }).optional(),
14816
- fps: number().optional(),
14817
- bitrate: number().optional(),
14818
- codec: string().optional(),
14819
- profileHint: CamProfileSchema.optional(),
14820
- sdp: string().optional()
14821
- });
14822
- var ConfigEntrySchema$1 = object({
14823
- key: string(),
14824
- value: unknown()
14825
- });
14826
- var RawStateResultSchema = object({
14827
- /** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
14828
- source: string(),
14829
- /** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
14830
- data: record(string(), unknown())
14831
- });
14832
- method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
14833
- deviceId: number(),
14834
- values: record(string(), unknown())
14835
- }), _void(), { kind: "mutation" }), method(object({
14836
- deviceId: number(),
14837
- action: string().min(1),
14838
- input: unknown()
14839
- }), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
14840
- /**
14841
14870
  * camera-credentials — device-scoped cap exposing the camera's network
14842
14871
  * + auth surface in a vendor-neutral shape.
14843
14872
  *
@@ -18520,6 +18549,12 @@ Object.freeze({
18520
18549
  addonId: null,
18521
18550
  access: "view"
18522
18551
  },
18552
+ "metricsProvider.dumpHeapSnapshot": {
18553
+ capName: "metrics-provider",
18554
+ capScope: "system",
18555
+ addonId: null,
18556
+ access: "create"
18557
+ },
18523
18558
  "metricsProvider.getAddonStats": {
18524
18559
  capName: "metrics-provider",
18525
18560
  capScope: "system",