@camstack/addon-tailscale 1.0.5 → 1.0.7

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