@camstack/addon-provider-velux 0.2.15 → 0.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +732 -77
  2. package/dist/addon.mjs +732 -77
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -10770,7 +10770,14 @@ var cameraStreamsCapability = {
10770
10770
  low: string().optional()
10771
10771
  }),
10772
10772
  lastChangedAt: number()
10773
- })
10773
+ }),
10774
+ /**
10775
+ * Runtime-state durability: **session** — a restored `slotStatuses: streaming` for a camera that has been dark for two hours is a lie the UI renders as truth.
10776
+ *
10777
+ * See `RuntimeStateDurability`. Enforced by
10778
+ * `scripts/check-runtime-state-durability.ts`.
10779
+ */
10780
+ durability: "session"
10774
10781
  };
10775
10782
  /** Where a block runs. The operator chooses — a block driving a device on an
10776
10783
  * agent is the reason placement is not fixed to the hub. */
@@ -11331,6 +11338,13 @@ var deviceDiscoveryCapability = {
11331
11338
  kind: "poll"
11332
11339
  },
11333
11340
  runtimeState: DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: number().int().nonnegative() }),
11341
+ /**
11342
+ * Runtime-state durability: **session** — 5.7 KB of scan output on the largest device, fully re-derivable by re-scanning.
11343
+ *
11344
+ * See `RuntimeStateDurability`. Enforced by
11345
+ * `scripts/check-runtime-state-durability.ts`.
11346
+ */
11347
+ durability: "session",
11334
11348
  methods: {
11335
11349
  /**
11336
11350
  * Snapshot of the current `discovered` list. Returns the
@@ -13200,11 +13214,33 @@ var NotificationFormatSchema = _enum([
13200
13214
  * Named by INTENT, never by glyph. "check" would tie the vocabulary to one
13201
13215
  * renderer's icon set; "acknowledge" survives an adapter that draws it
13202
13216
  * differently.
13217
+ *
13218
+ * ── A TOKEN IS NOT A WIRE VALUE ─────────────────────────────────────
13219
+ *
13220
+ * These names are for US. **No adapter may forward one verbatim.** Each maps
13221
+ * the whole set onto its own renderer's vocabulary through a
13222
+ * `Record<NotificationActionIcon, string>` — a Record, never a lookup with a
13223
+ * fallback, so adding a member here fails every adapter's build until someone
13224
+ * decides its glyph, which is the only place that decision can be made
13225
+ * honestly.
13226
+ *
13227
+ * This paragraph is the bug. Zentik declared `actionIcons: true` and passed
13228
+ * `disarm` straight through; iOS feeds that string to
13229
+ * `UNNotificationActionIcon(systemImageName:)`, `disarm` is not an SF Symbol,
13230
+ * and every snooze and alarm button arrived BLANK. A pass-through is not a
13231
+ * mapping, and "the field is documented" is not "the value renders".
13232
+ *
13233
+ * Adding a member is TRAIN-BOUND. The enum lives in the published
13234
+ * `@camstack/server` closure and the cap seam validates against the HUB's copy,
13235
+ * so an addon that emits a token the running hub does not know does not lose an
13236
+ * icon — its whole `send` fails Zod validation and the notification never
13237
+ * arrives. Never emit a new token from an addon before the train carrying it.
13203
13238
  */
13204
13239
  var NotificationActionIconSchema = _enum([
13205
13240
  "acknowledge",
13206
13241
  "dismiss",
13207
13242
  "silence",
13243
+ "snooze",
13208
13244
  "view",
13209
13245
  "play",
13210
13246
  "open",
@@ -13212,9 +13248,13 @@ var NotificationActionIconSchema = _enum([
13212
13248
  "lock",
13213
13249
  "unlock",
13214
13250
  "arm",
13251
+ "arm-home",
13252
+ "arm-away",
13253
+ "arm-night",
13215
13254
  "disarm",
13216
13255
  "light",
13217
- "alert"
13256
+ "alert",
13257
+ "camera"
13218
13258
  ]);
13219
13259
  /** A single tap-through action button. */
13220
13260
  var NotificationActionSchema = object({
@@ -13230,7 +13270,23 @@ var NotificationActionSchema = object({
13230
13270
  * else — see `notification-center/action-token.ts` for what that does and
13231
13271
  * does not buy.
13232
13272
  */
13233
- destructive: boolean().optional()
13273
+ destructive: boolean().optional(),
13274
+ /**
13275
+ * How the tap should REACH the url.
13276
+ *
13277
+ * `navigate` (absent, and every button authored before this field) opens it:
13278
+ * the phone leaves the notification and shows whatever the callback returns.
13279
+ * That is right for a button whose answer the operator wants to read.
13280
+ *
13281
+ * `background` fires it as a POST and stays put. It exists for the buttons
13282
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13283
+ * an answer to the notification, and being thrown into a browser tab to
13284
+ * confirm it costs more attention than the notification did. A backend that
13285
+ * cannot do a background call renders it as an ordinary link (the adapters
13286
+ * fall back rather than dropping the button), so this is a preference, never
13287
+ * a requirement.
13288
+ */
13289
+ mode: _enum(["navigate", "background"]).optional()
13234
13290
  });
13235
13291
  /**
13236
13292
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -13398,6 +13454,24 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
13398
13454
  targetId: string(),
13399
13455
  enabled: boolean()
13400
13456
  }), _void(), { kind: "mutation" });
13457
+ new Set([
13458
+ {
13459
+ id: "person",
13460
+ name: "Person"
13461
+ },
13462
+ {
13463
+ id: "vehicle",
13464
+ name: "Vehicle"
13465
+ },
13466
+ {
13467
+ id: "animal",
13468
+ name: "Animal"
13469
+ },
13470
+ {
13471
+ id: "package",
13472
+ name: "Package"
13473
+ }
13474
+ ].map((l) => l.id));
13401
13475
  var COCO_TO_MACRO = {
13402
13476
  mapping: {
13403
13477
  person: "person",
@@ -14082,7 +14156,17 @@ var alarmPanelCapability = {
14082
14156
  * full slice; renders an arm button per `availableModes` entry and
14083
14157
  * a PIN field iff `requiresCode === true`.
14084
14158
  */
14085
- runtimeState: AlarmPanelStatusSchema
14159
+ runtimeState: AlarmPanelStatusSchema,
14160
+ /**
14161
+ * Runtime-state durability: **restored** — armed state is the one thing a panel must not lose across a restart.
14162
+ *
14163
+ * See `RuntimeStateDurability`. Enforced by
14164
+ * `scripts/check-runtime-state-durability.ts`.
14165
+ */
14166
+ durability: "restored",
14167
+ /** Clock fields: written, but excluded from the compare that decides
14168
+ * whether persisting is worth a SQLite commit. */
14169
+ volatileStateFields: ["lastChangedAt"]
14086
14170
  };
14087
14171
  /**
14088
14172
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
@@ -14223,6 +14307,8 @@ var NcSystemEventKindSchema = _enum([
14223
14307
  "alarm-triggered",
14224
14308
  "alarm-armed",
14225
14309
  "alarm-disarmed",
14310
+ "alarm-arming",
14311
+ "alarm-arm-refused",
14226
14312
  "camera-online",
14227
14313
  "camera-offline",
14228
14314
  "camera-disabled",
@@ -14259,6 +14345,9 @@ var NcSystemEventConditionSchema = object({
14259
14345
  nodeIds: array(string().min(1)).min(1).optional(),
14260
14346
  packageNames: array(string().min(1)).min(1).optional()
14261
14347
  });
14348
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14349
+ * outage the operator asked for once and forgot. */
14350
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14262
14351
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14263
14352
  var NcScheduleSchema = object({
14264
14353
  windows: array(object({
@@ -14635,15 +14724,15 @@ var NcConditionsSchema = object({
14635
14724
  * (an `immediate` rule naming an `audio-*` class, one notification per
14636
14725
  * classified sample) stays exactly as it was for rules that already use it.
14637
14726
  *
14638
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14639
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14640
- * (`camstack/src/data/notification-center.ts`, guarded by
14641
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14727
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14728
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14729
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14730
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14642
14731
  * condition fields it does not know when a rule is saved from the phone.
14643
14732
  * Publishing an editor for a condition the app cannot round-trip is how an
14644
- * operator loses a rule's conditions by opening it — so the descriptor, the
14645
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14646
- * does an audio rule become authorable.
14733
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14734
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14735
+ * follows here.
14647
14736
  */
14648
14737
  audio: NcAudioConditionSchema.optional()
14649
14738
  });
@@ -14879,6 +14968,30 @@ var NcRuleInputSchema = object({
14879
14968
  */
14880
14969
  snoozeAllowGlobal: boolean().optional(),
14881
14970
  /**
14971
+ * The snooze durations THIS rule's notification offers as buttons, in
14972
+ * minutes.
14973
+ *
14974
+ * Three states, and all three are distinct — which is exactly why this is
14975
+ * `.optional()` and never `.default()`. A Zod default does not run on the
14976
+ * addon cap path (three production failures in one day), so a schema default
14977
+ * would collapse the first two:
14978
+ *
14979
+ * | value | meaning |
14980
+ * | --- | --- |
14981
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
14982
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
14983
+ * | a list | these choices, de-duplicated and sorted, at most four |
14984
+ *
14985
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
14986
+ * three buttons in total) and a rule that spent it all on snooze choices
14987
+ * would push its own tap-through actions off the notification.
14988
+ *
14989
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
14990
+ * that arms the panel, is exempt automatically and cannot be silenced by a
14991
+ * window from anywhere (D133).
14992
+ */
14993
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
14994
+ /**
14882
14995
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14883
14996
  *
14884
14997
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -14978,6 +15091,7 @@ var NcConditionDescriptorSchema = object({
14978
15091
  "device",
14979
15092
  "package",
14980
15093
  "occupancy",
15094
+ "audio",
14981
15095
  "system"
14982
15096
  ]),
14983
15097
  label: string(),
@@ -14996,6 +15110,7 @@ var NcConditionDescriptorSchema = object({
14996
15110
  "crossingSelect",
14997
15111
  "polygonDraw",
14998
15112
  "occupancy",
15113
+ "audio",
14999
15114
  "deviceState",
15000
15115
  "systemEvent"
15001
15116
  ]),
@@ -15147,7 +15262,20 @@ var NcSnoozeInputSchema = object({
15147
15262
  ruleId: string().optional(),
15148
15263
  /** Required when `scope: 'device'`. */
15149
15264
  deviceId: number().int().optional(),
15150
- durationMinutes: number().int().min(1).max(1440),
15265
+ /**
15266
+ * Narrow the window to these subject classes — "the cat, not the person".
15267
+ *
15268
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15269
+ * what every window authored before this field meant, so no persisted row
15270
+ * changes meaning and no client has to learn anything to keep working.
15271
+ *
15272
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15273
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15274
+ * not at whichever of their four rules happened to produce the notification
15275
+ * they are dismissing.
15276
+ */
15277
+ classes: array(string().min(1)).min(1).optional(),
15278
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
15151
15279
  /**
15152
15280
  * Silence this for EVERY recipient, not just the caller. Permission is
15153
15281
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15172,6 +15300,10 @@ var NcSnoozeSchema = object({
15172
15300
  scope: NcSnoozeScopeSchema,
15173
15301
  ruleId: string().optional(),
15174
15302
  deviceId: number().int().optional(),
15303
+ /** Subject classes this window covers. ABSENT = every class — see
15304
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15305
+ * no SQLite column: nothing queries a window by class. */
15306
+ classes: array(string().min(1)).min(1).optional(),
15175
15307
  startedAt: number(),
15176
15308
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15177
15309
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -17272,7 +17404,14 @@ var zonesCapability = {
17272
17404
  * handle. Slice shape is `{ zones: Zone[] }` so future extensions
17273
17405
  * (e.g. zone groupings) can sit alongside the polygon list.
17274
17406
  */
17275
- runtimeState: object({ zones: array(ZoneSchema).readonly() })
17407
+ runtimeState: object({ zones: array(ZoneSchema).readonly() }),
17408
+ /**
17409
+ * Runtime-state durability: **restored** — written only on operator mutation, so a camera that never had one has nothing to re-derive from. This is the slice `zone-mirror-hydration.ts` exists to paper over.
17410
+ *
17411
+ * See `RuntimeStateDurability`. Enforced by
17412
+ * `scripts/check-runtime-state-durability.ts`.
17413
+ */
17414
+ durability: "restored"
17276
17415
  };
17277
17416
  /**
17278
17417
  * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
@@ -17442,6 +17581,22 @@ var detectionFpsField = {
17442
17581
  default: 10,
17443
17582
  step: 1
17444
17583
  };
17584
+ /**
17585
+ * The occupancy re-check interval. DEFAULT 300 s (2026-08-13 — was 30 s).
17586
+ *
17587
+ * The recheck is now on by default (a parked car is invisible to occupancy
17588
+ * rules until the stationary registry has been rebuilt by motion, which after a
17589
+ * restart may be never on a quiet camera). Each cycle re-subscribes a detection
17590
+ * session — an RTSP re-dial — so the switch is only affordable at a WIDE
17591
+ * interval: 300 s is ~12 re-dials an hour per camera, against 120 at the old
17592
+ * 30 s. A parked car is therefore counted within 5 minutes of a restart.
17593
+ *
17594
+ * Why not wider: `max` is 300 and raising it is TRAIN-BOUND, not addon-bound —
17595
+ * the host validates `attachCamera` against ITS copy of this schema, so a
17596
+ * runner asked for 600 would be rejected by the hub until a `@camstack/server`
17597
+ * carrying the wider bound is installed everywhere. 300 is the widest value
17598
+ * that ships with an addon deploy.
17599
+ */
17445
17600
  var occupancyRecheckSecField = {
17446
17601
  min: 0,
17447
17602
  max: 300,
@@ -17643,15 +17798,21 @@ var RunnerCameraConfigSchema = object({
17643
17798
  */
17644
17799
  onboardMotionDrivesAnalyzer: boolean().default(true),
17645
17800
  /**
17646
- * Master toggle for the occupancy re-check. When `false` (DEFAULT) the runner
17647
- * never arms the periodic recheck timer, regardless of `occupancyRecheckSec` —
17648
- * this is off by default because the recheck re-subscribes a detection session
17649
- * every N seconds while `watching`, a major source of pull-decoder re-dial
17650
- * churn (each cycle creates+tears a session → RTSP re-dial → latency). The
17801
+ * Master toggle for the occupancy re-check. When `false` the runner never arms
17802
+ * the periodic recheck timer, regardless of `occupancyRecheckSec`; the
17651
17803
  * `occupancyRecheckSec` / `occupancyRecheckFrames` sliders only take effect
17652
17804
  * (and only render) when this is enabled.
17653
- */
17654
- occupancyRecheckEnabled: boolean().default(false),
17805
+ *
17806
+ * DEFAULT `true` since 2026-08-13 (was `false`). It was off because the
17807
+ * recheck re-subscribes a detection session every N seconds while `watching`
17808
+ * — each cycle creates+tears a session ⇒ an RTSP re-dial ⇒ latency, a major
17809
+ * pull-decoder churn source. What that bought was a blind spot: a STATIONARY
17810
+ * object is counted only while the stationary registry holds it, and the
17811
+ * registry rebuilds from motion, so after a restart a parked car was invisible
17812
+ * to every occupancy rule until something moved in front of it. The churn is
17813
+ * now paid on the interval instead — see `occupancyRecheckSecField`.
17814
+ */
17815
+ occupancyRecheckEnabled: boolean().default(true),
17655
17816
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
17656
17817
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
17657
17818
  /**
@@ -20071,7 +20232,17 @@ var airQualitySensorCapability = {
20071
20232
  schema: AirQualitySensorStatusSchema,
20072
20233
  kind: "push"
20073
20234
  },
20074
- runtimeState: AirQualitySensorStatusSchema
20235
+ runtimeState: AirQualitySensorStatusSchema,
20236
+ /**
20237
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20238
+ *
20239
+ * See `RuntimeStateDurability`. Enforced by
20240
+ * `scripts/check-runtime-state-durability.ts`.
20241
+ */
20242
+ durability: "restored",
20243
+ /** Clock fields: written, but excluded from the compare that decides
20244
+ * whether persisting is worth a SQLite commit. */
20245
+ volatileStateFields: ["lastFetchedAt"]
20075
20246
  };
20076
20247
  /**
20077
20248
  * Ambient illuminance reading in lux. Drives Home Assistant `sensor`
@@ -20103,7 +20274,17 @@ var ambientLightSensorCapability = {
20103
20274
  schema: AmbientLightSensorStatusSchema,
20104
20275
  kind: "push"
20105
20276
  },
20106
- runtimeState: AmbientLightSensorStatusSchema
20277
+ runtimeState: AmbientLightSensorStatusSchema,
20278
+ /**
20279
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20280
+ *
20281
+ * See `RuntimeStateDurability`. Enforced by
20282
+ * `scripts/check-runtime-state-durability.ts`.
20283
+ */
20284
+ durability: "restored",
20285
+ /** Clock fields: written, but excluded from the compare that decides
20286
+ * whether persisting is worth a SQLite commit. */
20287
+ volatileStateFields: ["lastFetchedAt"]
20107
20288
  };
20108
20289
  /**
20109
20290
  * Per-class audio metrics aggregated over a sliding window.
@@ -20221,7 +20402,14 @@ var audioMetricsCapability = {
20221
20402
  }), AudioMetricsHistorySchema)
20222
20403
  },
20223
20404
  /** Reactive runtime-state mirror — live `device.state.audioMetrics.value`. */
20224
- runtimeState: AudioMetricsSnapshotSchema
20405
+ runtimeState: AudioMetricsSnapshotSchema,
20406
+ /**
20407
+ * Runtime-state durability: **session** — 1 Hz per camera at the mirror and ~63 % of the fleet's whole runtime-state write rate. `avgDbfs` is a rolling 60 s mean that genuinely moves every second, so no equality fix reclaims it — and a two-hour-old dB reading rendered as current is worse than no reading.
20408
+ *
20409
+ * See `RuntimeStateDurability`. Enforced by
20410
+ * `scripts/check-runtime-state-durability.ts`.
20411
+ */
20412
+ durability: "session"
20225
20413
  };
20226
20414
  /**
20227
20415
  * Automation-control cap. Models HA `automation.*` entities on
@@ -20283,7 +20471,14 @@ var automationControlCapability = {
20283
20471
  * reads `enabled` (toggle) + `isRunning` (spinner) + `lastError`
20284
20472
  * (badge) directly.
20285
20473
  */
20286
- runtimeState: AutomationControlStatusSchema
20474
+ runtimeState: AutomationControlStatusSchema,
20475
+ /**
20476
+ * Runtime-state durability: **session** — the authority for an automation being enabled is the automation store; a restored `isRunning` would be a lie. D62: one authority per switch.
20477
+ *
20478
+ * See `RuntimeStateDurability`. Enforced by
20479
+ * `scripts/check-runtime-state-durability.ts`.
20480
+ */
20481
+ durability: "session"
20287
20482
  };
20288
20483
  /**
20289
20484
  * Battery status snapshot. Emitted by providers whose device is
@@ -20389,7 +20584,17 @@ onStatusChanged: { data: object({
20389
20584
  * via `device.runtimeState.getCapState('battery')` regardless of
20390
20585
  * the underlying driver.
20391
20586
  */
20392
- runtimeState: BatteryStatusSchema
20587
+ runtimeState: BatteryStatusSchema,
20588
+ /**
20589
+ * Runtime-state durability: **restored** — a sleeping battery camera may not report for hours; the restored percentage is the only thing the UI and the sleep gate have. Zero churn once `lastUpdated` is excluded — 526 writes, 0 value changes, in 25 minutes.
20590
+ *
20591
+ * See `RuntimeStateDurability`. Enforced by
20592
+ * `scripts/check-runtime-state-durability.ts`.
20593
+ */
20594
+ durability: "restored",
20595
+ /** Clock fields: written, but excluded from the compare that decides
20596
+ * whether persisting is worth a SQLite commit. */
20597
+ volatileStateFields: ["lastUpdated"]
20393
20598
  };
20394
20599
  /**
20395
20600
  * Generic boolean sensor — last-resort fallback when no domain-
@@ -20418,7 +20623,17 @@ var binaryCapability = {
20418
20623
  schema: BinaryStatusSchema,
20419
20624
  kind: "push"
20420
20625
  },
20421
- runtimeState: BinaryStatusSchema
20626
+ runtimeState: BinaryStatusSchema,
20627
+ /**
20628
+ * Runtime-state durability: **restored** — transition-driven sensor state; the restored value gives the boot comparison.
20629
+ *
20630
+ * See `RuntimeStateDurability`. Enforced by
20631
+ * `scripts/check-runtime-state-durability.ts`.
20632
+ */
20633
+ durability: "restored",
20634
+ /** Clock fields: written, but excluded from the compare that decides
20635
+ * whether persisting is worth a SQLite commit. */
20636
+ volatileStateFields: ["lastChangedAt"]
20422
20637
  };
20423
20638
  /**
20424
20639
  * Dimmable-light brightness control. Co-exists with `switch` on the
@@ -20471,7 +20686,14 @@ onBrightnessChanged: { data: object({
20471
20686
  * by the kernel. Read via `device.state.brightness.value` so UI
20472
20687
  * sliders surface the current level without polling the provider.
20473
20688
  */
20474
- runtimeState: BrightnessStatusSchema
20689
+ runtimeState: BrightnessStatusSchema,
20690
+ /**
20691
+ * Runtime-state durability: **session** — live lamp state, re-published by the provider on connect.
20692
+ *
20693
+ * See `RuntimeStateDurability`. Enforced by
20694
+ * `scripts/check-runtime-state-durability.ts`.
20695
+ */
20696
+ durability: "session"
20475
20697
  };
20476
20698
  DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
20477
20699
  kind: "mutation",
@@ -20559,7 +20781,17 @@ var carbonMonoxideCapability = {
20559
20781
  schema: CarbonMonoxideStatusSchema,
20560
20782
  kind: "push"
20561
20783
  },
20562
- runtimeState: CarbonMonoxideStatusSchema
20784
+ runtimeState: CarbonMonoxideStatusSchema,
20785
+ /**
20786
+ * Runtime-state durability: **restored** — as `smoke`.
20787
+ *
20788
+ * See `RuntimeStateDurability`. Enforced by
20789
+ * `scripts/check-runtime-state-durability.ts`.
20790
+ */
20791
+ durability: "restored",
20792
+ /** Clock fields: written, but excluded from the compare that decides
20793
+ * whether persisting is worth a SQLite commit. */
20794
+ volatileStateFields: ["lastChangedAt"]
20563
20795
  };
20564
20796
  /**
20565
20797
  * HVAC / climate control cap. Models the full surface of a HA
@@ -20719,7 +20951,14 @@ var climateControlCapability = {
20719
20951
  * the full slice via `device.state.climate-control.value` and refresh
20720
20952
  * on every push without re-querying the provider.
20721
20953
  */
20722
- runtimeState: ClimateControlStatusSchema
20954
+ runtimeState: ClimateControlStatusSchema,
20955
+ /**
20956
+ * Runtime-state durability: **session** — as `brightness`; `currentTemp` moves continuously and is re-published on connect.
20957
+ *
20958
+ * See `RuntimeStateDurability`. Enforced by
20959
+ * `scripts/check-runtime-state-durability.ts`.
20960
+ */
20961
+ durability: "session"
20723
20962
  };
20724
20963
  /**
20725
20964
  * Color-light cap. Coexists with `switch` (on/off) and `brightness`
@@ -20829,7 +21068,14 @@ onColorChanged: { data: object({
20829
21068
  * kernel. Read via `device.state.color.value` so UI pickers surface
20830
21069
  * the current chromaticity without polling the provider.
20831
21070
  */
20832
- runtimeState: ColorStatusSchema
21071
+ runtimeState: ColorStatusSchema,
21072
+ /**
21073
+ * Runtime-state durability: **session** — as `brightness`.
21074
+ *
21075
+ * See `RuntimeStateDurability`. Enforced by
21076
+ * `scripts/check-runtime-state-durability.ts`.
21077
+ */
21078
+ durability: "session"
20833
21079
  };
20834
21080
  var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
20835
21081
  object({
@@ -20887,7 +21133,17 @@ var connectivityCapability = {
20887
21133
  schema: ConnectivityStatusSchema,
20888
21134
  kind: "push"
20889
21135
  },
20890
- runtimeState: ConnectivityStatusSchema
21136
+ runtimeState: ConnectivityStatusSchema,
21137
+ /**
21138
+ * Runtime-state durability: **restored** — same shape and same argument as `device-status`, for links rather than devices.
21139
+ *
21140
+ * See `RuntimeStateDurability`. Enforced by
21141
+ * `scripts/check-runtime-state-durability.ts`.
21142
+ */
21143
+ durability: "restored",
21144
+ /** Clock fields: written, but excluded from the compare that decides
21145
+ * whether persisting is worth a SQLite commit. */
21146
+ volatileStateFields: ["lastChangedAt"]
20891
21147
  };
20892
21148
  /**
20893
21149
  * Generic device-consumables capability — surfaces a device's
@@ -20969,7 +21225,14 @@ reset: method(object({
20969
21225
  }
20970
21226
  }
20971
21227
  },
20972
- runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() })
21228
+ runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() }),
21229
+ /**
21230
+ * Runtime-state durability: **session** — the authority is the appliance; the provider re-reads the whole item array on connect.
21231
+ *
21232
+ * See `RuntimeStateDurability`. Enforced by
21233
+ * `scripts/check-runtime-state-durability.ts`.
21234
+ */
21235
+ durability: "session"
20973
21236
  };
20974
21237
  /**
20975
21238
  * Door / window / opening / garage / valve contact sensor. Boolean
@@ -21000,7 +21263,17 @@ var contactCapability = {
21000
21263
  schema: ContactStatusSchema,
21001
21264
  kind: "push"
21002
21265
  },
21003
- runtimeState: ContactStatusSchema
21266
+ runtimeState: ContactStatusSchema,
21267
+ /**
21268
+ * Runtime-state durability: **restored** — a door left open across a restart must still read open.
21269
+ *
21270
+ * See `RuntimeStateDurability`. Enforced by
21271
+ * `scripts/check-runtime-state-durability.ts`.
21272
+ */
21273
+ durability: "restored",
21274
+ /** Clock fields: written, but excluded from the compare that decides
21275
+ * whether persisting is worth a SQLite commit. */
21276
+ volatileStateFields: ["lastChangedAt"]
21004
21277
  };
21005
21278
  /**
21006
21279
  * Status slice — flat object (the framework's `runtimeState` contract
@@ -21106,7 +21379,14 @@ var controlCapability = {
21106
21379
  * dropdown / text field / date picker) read the slice's discriminant
21107
21380
  * and value directly without polling the provider.
21108
21381
  */
21109
- runtimeState: ControlStatusSchema
21382
+ runtimeState: ControlStatusSchema,
21383
+ /**
21384
+ * Runtime-state durability: **session** — a generic control mirrors an external entity that re-publishes on connect; the options array is re-derived with it.
21385
+ *
21386
+ * See `RuntimeStateDurability`. Enforced by
21387
+ * `scripts/check-runtime-state-durability.ts`.
21388
+ */
21389
+ durability: "session"
21110
21390
  };
21111
21391
  var CoverStatusSchema = object({
21112
21392
  /** Lifecycle state of the cover. */
@@ -21167,7 +21447,17 @@ var coverCapability = {
21167
21447
  * Runtime-state slice — mirrored by the kernel. UI controls watch
21168
21448
  * the slice for live position changes during a move.
21169
21449
  */
21170
- runtimeState: CoverStatusSchema
21450
+ runtimeState: CoverStatusSchema,
21451
+ /**
21452
+ * Runtime-state durability: **restored** — position survives a restart on the device; the mirror should agree at boot rather than read blank.
21453
+ *
21454
+ * See `RuntimeStateDurability`. Enforced by
21455
+ * `scripts/check-runtime-state-durability.ts`.
21456
+ */
21457
+ durability: "restored",
21458
+ /** Clock fields: written, but excluded from the compare that decides
21459
+ * whether persisting is worth a SQLite commit. */
21460
+ volatileStateFields: ["lastChangedAt"]
21171
21461
  };
21172
21462
  /**
21173
21463
  * Vendor-neutral day/night (IR-cut) control — the per-camera config cap
@@ -21261,7 +21551,17 @@ var dayNightCapability = {
21261
21551
  schema: DayNightStatusSchema,
21262
21552
  kind: "poll"
21263
21553
  },
21264
- runtimeState: DayNightStatusSchema
21554
+ runtimeState: DayNightStatusSchema,
21555
+ /**
21556
+ * Runtime-state durability: **restored** — operator-set IR-cut behaviour; mutation-driven.
21557
+ *
21558
+ * See `RuntimeStateDurability`. Enforced by
21559
+ * `scripts/check-runtime-state-durability.ts`.
21560
+ */
21561
+ durability: "restored",
21562
+ /** Clock fields: written, but excluded from the compare that decides
21563
+ * whether persisting is worth a SQLite commit. */
21564
+ volatileStateFields: ["lastFetchedAt"]
21265
21565
  };
21266
21566
  /**
21267
21567
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
@@ -21308,7 +21608,17 @@ onStatusChanged: { data: object({
21308
21608
  schema: DeviceStatusSchema,
21309
21609
  kind: "push"
21310
21610
  },
21311
- runtimeState: DeviceStatusSchema
21611
+ runtimeState: DeviceStatusSchema,
21612
+ /**
21613
+ * Runtime-state durability: **restored** — the previous observation is what makes the first reading after a restart a COMPARISON instead of a phantom transition (D130). 32 real flips across 16 devices in 25 min — the busiest slice in the cold half.
21614
+ *
21615
+ * See `RuntimeStateDurability`. Enforced by
21616
+ * `scripts/check-runtime-state-durability.ts`.
21617
+ */
21618
+ durability: "restored",
21619
+ /** Clock fields: written, but excluded from the compare that decides
21620
+ * whether persisting is worth a SQLite commit. */
21621
+ volatileStateFields: ["lastChangedAt"]
21312
21622
  };
21313
21623
  /**
21314
21624
  * Doorbell button cap. Two kinds of providers coexist behind this cap
@@ -21370,7 +21680,14 @@ onPressed: { data: DoorbellPressEventSchema } },
21370
21680
  * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
21371
21681
  * without subscribing.
21372
21682
  */
21373
- runtimeState: DoorbellStatusSchema
21683
+ runtimeState: DoorbellStatusSchema,
21684
+ /**
21685
+ * Runtime-state durability: **restored** — a monotonic accumulator: the slice IS the record. `lastPressedAt` is content here, not a clock, so it is deliberately NOT volatile.
21686
+ *
21687
+ * See `RuntimeStateDurability`. Enforced by
21688
+ * `scripts/check-runtime-state-durability.ts`.
21689
+ */
21690
+ durability: "restored"
21374
21691
  };
21375
21692
  /**
21376
21693
  * Enum-state sensor — a string value picked from a finite option set.
@@ -21410,7 +21727,17 @@ var enumSensorCapability = {
21410
21727
  schema: EnumSensorStatusSchema,
21411
21728
  kind: "push"
21412
21729
  },
21413
- runtimeState: EnumSensorStatusSchema
21730
+ runtimeState: EnumSensorStatusSchema,
21731
+ /**
21732
+ * Runtime-state durability: **restored** — as `numeric-sensor`; 80 devices.
21733
+ *
21734
+ * See `RuntimeStateDurability`. Enforced by
21735
+ * `scripts/check-runtime-state-durability.ts`.
21736
+ */
21737
+ durability: "restored",
21738
+ /** Clock fields: written, but excluded from the compare that decides
21739
+ * whether persisting is worth a SQLite commit. */
21740
+ volatileStateFields: ["lastFetchedAt"]
21414
21741
  };
21415
21742
  /**
21416
21743
  * Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
@@ -21446,7 +21773,14 @@ var eventEmitterCapability = {
21446
21773
  schema: EventEmitterStatusSchema,
21447
21774
  kind: "push"
21448
21775
  },
21449
- runtimeState: EventEmitterStatusSchema
21776
+ runtimeState: EventEmitterStatusSchema,
21777
+ /**
21778
+ * Runtime-state durability: **session** — `eventCountSinceStart` names its own scope.
21779
+ *
21780
+ * See `RuntimeStateDurability`. Enforced by
21781
+ * `scripts/check-runtime-state-durability.ts`.
21782
+ */
21783
+ durability: "session"
21450
21784
  };
21451
21785
  var EventItemSchema = object({
21452
21786
  id: string(),
@@ -21727,7 +22061,14 @@ var fanControlCapability = {
21727
22061
  * Runtime-state slice — mirrored by the kernel. UI fan speed
21728
22062
  * sliders read `percentage` for live updates.
21729
22063
  */
21730
- runtimeState: FanControlStatusSchema
22064
+ runtimeState: FanControlStatusSchema,
22065
+ /**
22066
+ * Runtime-state durability: **session** — as `brightness`.
22067
+ *
22068
+ * See `RuntimeStateDurability`. Enforced by
22069
+ * `scripts/check-runtime-state-durability.ts`.
22070
+ */
22071
+ durability: "session"
21731
22072
  };
21732
22073
  /**
21733
22074
  * Per-device feature/identity probe slice. Holds the runtime-resolved
@@ -21803,7 +22144,14 @@ onProbeChanged: { data: object({
21803
22144
  schema: FeatureProbeStatusSchema,
21804
22145
  kind: "push"
21805
22146
  },
21806
- runtimeState: FeatureProbeStatusSchema
22147
+ runtimeState: FeatureProbeStatusSchema,
22148
+ /**
22149
+ * Runtime-state durability: **session** — per-session by definition — `lastProbedAt` means "this worker completed a probe THIS session", which is why the mirror seed already blanks it. Persisting it only creates something to blank.
22150
+ *
22151
+ * See `RuntimeStateDurability`. Enforced by
22152
+ * `scripts/check-runtime-state-durability.ts`.
22153
+ */
22154
+ durability: "session"
21807
22155
  };
21808
22156
  /**
21809
22157
  * Water leak / moisture sensor. Boolean "is liquid currently
@@ -21830,7 +22178,17 @@ var floodCapability = {
21830
22178
  schema: FloodStatusSchema,
21831
22179
  kind: "push"
21832
22180
  },
21833
- runtimeState: FloodStatusSchema
22181
+ runtimeState: FloodStatusSchema,
22182
+ /**
22183
+ * Runtime-state durability: **restored** — as `smoke`.
22184
+ *
22185
+ * See `RuntimeStateDurability`. Enforced by
22186
+ * `scripts/check-runtime-state-durability.ts`.
22187
+ */
22188
+ durability: "restored",
22189
+ /** Clock fields: written, but excluded from the compare that decides
22190
+ * whether persisting is worth a SQLite commit. */
22191
+ volatileStateFields: ["lastChangedAt"]
21834
22192
  };
21835
22193
  /**
21836
22194
  * Combustible-gas (LPG / methane / hydrogen) alarm sensor. Drives
@@ -21853,7 +22211,17 @@ var gasCapability = {
21853
22211
  schema: GasStatusSchema,
21854
22212
  kind: "push"
21855
22213
  },
21856
- runtimeState: GasStatusSchema
22214
+ runtimeState: GasStatusSchema,
22215
+ /**
22216
+ * Runtime-state durability: **restored** — as `smoke`.
22217
+ *
22218
+ * See `RuntimeStateDurability`. Enforced by
22219
+ * `scripts/check-runtime-state-durability.ts`.
22220
+ */
22221
+ durability: "restored",
22222
+ /** Clock fields: written, but excluded from the compare that decides
22223
+ * whether persisting is worth a SQLite commit. */
22224
+ volatileStateFields: ["lastChangedAt"]
21857
22225
  };
21858
22226
  /**
21859
22227
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
@@ -21929,7 +22297,14 @@ var humidifierCapability = {
21929
22297
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
21930
22298
  * slice for live humidity / mode changes.
21931
22299
  */
21932
- runtimeState: HumidifierStatusSchema
22300
+ runtimeState: HumidifierStatusSchema,
22301
+ /**
22302
+ * Runtime-state durability: **session** — as `climate-control`.
22303
+ *
22304
+ * See `RuntimeStateDurability`. Enforced by
22305
+ * `scripts/check-runtime-state-durability.ts`.
22306
+ */
22307
+ durability: "session"
21933
22308
  };
21934
22309
  /**
21935
22310
  * Single-metric humidity reading. Drives Home Assistant `sensor`
@@ -21965,7 +22340,17 @@ var humiditySensorCapability = {
21965
22340
  schema: HumiditySensorStatusSchema,
21966
22341
  kind: "push"
21967
22342
  },
21968
- runtimeState: HumiditySensorStatusSchema
22343
+ runtimeState: HumiditySensorStatusSchema,
22344
+ /**
22345
+ * Runtime-state durability: **restored** — as `numeric-sensor` (67 of 75 writes were the clock alone).
22346
+ *
22347
+ * See `RuntimeStateDurability`. Enforced by
22348
+ * `scripts/check-runtime-state-durability.ts`.
22349
+ */
22350
+ durability: "restored",
22351
+ /** Clock fields: written, but excluded from the compare that decides
22352
+ * whether persisting is worth a SQLite commit. */
22353
+ volatileStateFields: ["lastFetchedAt"]
21969
22354
  };
21970
22355
  /**
21971
22356
  * Image display cap. Models a single still image exposed by an integration —
@@ -22003,7 +22388,14 @@ var imageCapability = {
22003
22388
  * Runtime-state slice — mirrored by the kernel. The UI reads `url`
22004
22389
  * directly and renders the still image.
22005
22390
  */
22006
- runtimeState: ImageStatusSchema
22391
+ runtimeState: ImageStatusSchema,
22392
+ /**
22393
+ * Runtime-state durability: **session** — a snapshot URL is a session-scoped handle; a restored one points at nothing.
22394
+ *
22395
+ * See `RuntimeStateDurability`. Enforced by
22396
+ * `scripts/check-runtime-state-durability.ts`.
22397
+ */
22398
+ durability: "session"
22007
22399
  };
22008
22400
  /**
22009
22401
  * Vendor-neutral image / picture-adjustment cap — the per-camera config
@@ -22152,7 +22544,17 @@ var imageSettingsCapability = {
22152
22544
  schema: ImageSettingsStatusSchema,
22153
22545
  kind: "poll"
22154
22546
  },
22155
- runtimeState: ImageSettingsStatusSchema
22547
+ runtimeState: ImageSettingsStatusSchema,
22548
+ /**
22549
+ * Runtime-state durability: **restored** — operator-set camera imaging; mutation-driven.
22550
+ *
22551
+ * See `RuntimeStateDurability`. Enforced by
22552
+ * `scripts/check-runtime-state-durability.ts`.
22553
+ */
22554
+ durability: "restored",
22555
+ /** Clock fields: written, but excluded from the compare that decides
22556
+ * whether persisting is worth a SQLite commit. */
22557
+ volatileStateFields: ["lastFetchedAt"]
22156
22558
  };
22157
22559
  /**
22158
22560
  * integrations — system-scoped singleton capability for integration
@@ -22492,7 +22894,14 @@ var lawnMowerControlCapability = {
22492
22894
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22493
22895
  * slice for live activity + battery changes.
22494
22896
  */
22495
- runtimeState: LawnMowerControlStatusSchema
22897
+ runtimeState: LawnMowerControlStatusSchema,
22898
+ /**
22899
+ * Runtime-state durability: **session** — as `vacuum-control`.
22900
+ *
22901
+ * See `RuntimeStateDurability`. Enforced by
22902
+ * `scripts/check-runtime-state-durability.ts`.
22903
+ */
22904
+ durability: "session"
22496
22905
  };
22497
22906
  /**
22498
22907
  * local-network — hub-only singleton.
@@ -22698,7 +23107,17 @@ var lockControlCapability = {
22698
23107
  * read `state` and disable themselves during `locking`/`unlocking`
22699
23108
  * transitions.
22700
23109
  */
22701
- runtimeState: LockControlStatusSchema
23110
+ runtimeState: LockControlStatusSchema,
23111
+ /**
23112
+ * Runtime-state durability: **restored** — a lock left locked must still read locked.
23113
+ *
23114
+ * See `RuntimeStateDurability`. Enforced by
23115
+ * `scripts/check-runtime-state-durability.ts`.
23116
+ */
23117
+ durability: "restored",
23118
+ /** Clock fields: written, but excluded from the compare that decides
23119
+ * whether persisting is worth a SQLite commit. */
23120
+ volatileStateFields: ["lastChangedAt"]
22702
23121
  };
22703
23122
  /**
22704
23123
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
@@ -22860,7 +23279,14 @@ var mediaPlayerCapability = {
22860
23279
  * full slice for live now-playing, volume, and progress updates
22861
23280
  * without polling.
22862
23281
  */
22863
- runtimeState: MediaPlayerStatusSchema
23282
+ runtimeState: MediaPlayerStatusSchema,
23283
+ /**
23284
+ * Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
23285
+ *
23286
+ * See `RuntimeStateDurability`. Enforced by
23287
+ * `scripts/check-runtime-state-durability.ts`.
23288
+ */
23289
+ durability: "session"
22864
23290
  };
22865
23291
  /**
22866
23292
  * mesh-network — collection cap for mesh-VPN providers.
@@ -23124,7 +23550,14 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
23124
23550
  * `device.state.motion.value`. Reads never invoke the provider, so
23125
23551
  * UIs and other addons can poll the cached state safely.
23126
23552
  */
23127
- runtimeState: MotionStatusSchema
23553
+ runtimeState: MotionStatusSchema,
23554
+ /**
23555
+ * Runtime-state durability: **session** — self-clearing by construction (`autoClearAfterMs`); a restored `detected: true` is a frozen event, and the next frame re-publishes the real one.
23556
+ *
23557
+ * See `RuntimeStateDurability`. Enforced by
23558
+ * `scripts/check-runtime-state-durability.ts`.
23559
+ */
23560
+ durability: "session"
23128
23561
  };
23129
23562
  /**
23130
23563
  * Motion-trigger toggle for accessory devices.
@@ -23189,7 +23622,14 @@ var motionTriggerCapability = {
23189
23622
  schema: MotionTriggerStatusSchema,
23190
23623
  kind: "command-driven"
23191
23624
  },
23192
- runtimeState: MotionTriggerRuntimeStateSchema
23625
+ runtimeState: MotionTriggerRuntimeStateSchema,
23626
+ /**
23627
+ * Runtime-state durability: **session** — the authority for motion-trigger enablement is the provider's own config; the slice is a mirror of it, re-published on connect.
23628
+ *
23629
+ * See `RuntimeStateDurability`. Enforced by
23630
+ * `scripts/check-runtime-state-durability.ts`.
23631
+ */
23632
+ durability: "session"
23193
23633
  };
23194
23634
  /**
23195
23635
  * Motion-zones share the same MaskShape vocabulary as privacy-mask — the
@@ -23256,7 +23696,17 @@ var motionZonesCapability = {
23256
23696
  schema: MotionZoneStatusSchema,
23257
23697
  kind: "poll"
23258
23698
  },
23259
- runtimeState: MotionZoneStatusSchema
23699
+ runtimeState: MotionZoneStatusSchema,
23700
+ /**
23701
+ * Runtime-state durability: **restored** — the 14 KB polygon list is the single largest slice on the fleet and has not changed since the operator drew it. Highest value per byte in the table.
23702
+ *
23703
+ * See `RuntimeStateDurability`. Enforced by
23704
+ * `scripts/check-runtime-state-durability.ts`.
23705
+ */
23706
+ durability: "restored",
23707
+ /** Clock fields: written, but excluded from the compare that decides
23708
+ * whether persisting is worth a SQLite commit. */
23709
+ volatileStateFields: ["lastFetchedAt"]
23260
23710
  };
23261
23711
  /**
23262
23712
  * On-camera AI object detection cap. Surfaces per-device the classes
@@ -23330,7 +23780,17 @@ var nativeObjectDetectionCapability = {
23330
23780
  schema: NativeObjectDetectionStatusSchema,
23331
23781
  kind: "push"
23332
23782
  },
23333
- runtimeState: NativeObjectDetectionRuntimeStateSchema
23783
+ runtimeState: NativeObjectDetectionRuntimeStateSchema,
23784
+ /**
23785
+ * Runtime-state durability: **restored** — `enabled` is an operator toggle on a camera whose refresh is a no-op and whose staleMs is Infinity. There is no hardware value to re-read — losing it loses the setting.
23786
+ *
23787
+ * See `RuntimeStateDurability`. Enforced by
23788
+ * `scripts/check-runtime-state-durability.ts`.
23789
+ */
23790
+ durability: "restored",
23791
+ /** Clock fields: written, but excluded from the compare that decides
23792
+ * whether persisting is worth a SQLite commit. */
23793
+ volatileStateFields: ["lastFetchedAt"]
23334
23794
  };
23335
23795
  /**
23336
23796
  * network-quality — system-scoped singleton capability tracking RTT,
@@ -23664,7 +24124,14 @@ onSent: { data: object({
23664
24124
  * form reads `supports` to gate optional fields; history pane reads
23665
24125
  * `lastSentAt` / `lastError` / `queueDepth`.
23666
24126
  */
23667
- runtimeState: NotifierStatusSchema
24127
+ runtimeState: NotifierStatusSchema,
24128
+ /**
24129
+ * Runtime-state durability: **session** — live queue depth and last-send state; a restored queue depth describes a queue that no longer exists.
24130
+ *
24131
+ * See `RuntimeStateDurability`. Enforced by
24132
+ * `scripts/check-runtime-state-durability.ts`.
24133
+ */
24134
+ durability: "session"
23668
24135
  };
23669
24136
  /**
23670
24137
  * Generic numeric sensor — last-resort fallback when no typed numeric
@@ -23707,7 +24174,17 @@ var numericSensorCapability = {
23707
24174
  schema: NumericSensorStatusSchema,
23708
24175
  kind: "push"
23709
24176
  },
23710
- runtimeState: NumericSensorStatusSchema
24177
+ runtimeState: NumericSensorStatusSchema,
24178
+ /**
24179
+ * Runtime-state durability: **restored** — polled value, low churn once the clock is excluded (251 of 669 writes were the clock alone); restoring it removes the cold window before the first poll.
24180
+ *
24181
+ * See `RuntimeStateDurability`. Enforced by
24182
+ * `scripts/check-runtime-state-durability.ts`.
24183
+ */
24184
+ durability: "restored",
24185
+ /** Clock fields: written, but excluded from the compare that decides
24186
+ * whether persisting is worth a SQLite commit. */
24187
+ volatileStateFields: ["lastFetchedAt"]
23711
24188
  };
23712
24189
  /**
23713
24190
  * Generic on-screen-display (video overlay) cap. Each camera exposes
@@ -24092,7 +24569,14 @@ var petFeederCapability = {
24092
24569
  * the full slice via `device.state.petFeeder.value` and refresh on
24093
24570
  * every poll without re-querying the provider.
24094
24571
  */
24095
- runtimeState: PetFeederStatusSchema
24572
+ runtimeState: PetFeederStatusSchema,
24573
+ /**
24574
+ * Runtime-state durability: **session** — live appliance state re-published on connect.
24575
+ *
24576
+ * See `RuntimeStateDurability`. Enforced by
24577
+ * `scripts/check-runtime-state-durability.ts`.
24578
+ */
24579
+ durability: "session"
24096
24580
  };
24097
24581
  var VehicleSchema = object({
24098
24582
  id: string(),
@@ -24404,7 +24888,17 @@ var powerMeterCapability = {
24404
24888
  schema: PowerMeterStatusSchema,
24405
24889
  kind: "push"
24406
24890
  },
24407
- runtimeState: PowerMeterStatusSchema
24891
+ runtimeState: PowerMeterStatusSchema,
24892
+ /**
24893
+ * Runtime-state durability: **restored** — as `numeric-sensor`; `kwhTotal` is an accumulator whose restored value is the baseline.
24894
+ *
24895
+ * See `RuntimeStateDurability`. Enforced by
24896
+ * `scripts/check-runtime-state-durability.ts`.
24897
+ */
24898
+ durability: "restored",
24899
+ /** Clock fields: written, but excluded from the compare that decides
24900
+ * whether persisting is worth a SQLite commit. */
24901
+ volatileStateFields: ["lastFetchedAt"]
24408
24902
  };
24409
24903
  /**
24410
24904
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -24461,7 +24955,17 @@ var presenceCapability = {
24461
24955
  * the map pin is rendered (use `DeviceFeature.PresenceGps` for the
24462
24956
  * pre-fetch fast-path check).
24463
24957
  */
24464
- runtimeState: PresenceStatusSchema
24958
+ runtimeState: PresenceStatusSchema,
24959
+ /**
24960
+ * Runtime-state durability: **restored** — occupancy-relevant: the restored state is what an occupancy rule compares the first post-restart observation against.
24961
+ *
24962
+ * See `RuntimeStateDurability`. Enforced by
24963
+ * `scripts/check-runtime-state-durability.ts`.
24964
+ */
24965
+ durability: "restored",
24966
+ /** Clock fields: written, but excluded from the compare that decides
24967
+ * whether persisting is worth a SQLite commit. */
24968
+ volatileStateFields: ["lastChangedAt"]
24465
24969
  };
24466
24970
  /**
24467
24971
  * Atmospheric pressure reading in hectopascals. Drives Home Assistant
@@ -24497,7 +25001,17 @@ var pressureSensorCapability = {
24497
25001
  schema: PressureSensorStatusSchema,
24498
25002
  kind: "push"
24499
25003
  },
24500
- runtimeState: PressureSensorStatusSchema
25004
+ runtimeState: PressureSensorStatusSchema,
25005
+ /**
25006
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
25007
+ *
25008
+ * See `RuntimeStateDurability`. Enforced by
25009
+ * `scripts/check-runtime-state-durability.ts`.
25010
+ */
25011
+ durability: "restored",
25012
+ /** Clock fields: written, but excluded from the compare that decides
25013
+ * whether persisting is worth a SQLite commit. */
25014
+ volatileStateFields: ["lastFetchedAt"]
24501
25015
  };
24502
25016
  /**
24503
25017
  * PRIVACY — what the camera deliberately does not capture. Two planes:
@@ -24627,7 +25141,17 @@ var privacyMaskCapability = {
24627
25141
  schema: PrivacyMaskStatusSchema,
24628
25142
  kind: "poll"
24629
25143
  },
24630
- runtimeState: PrivacyMaskStatusSchema
25144
+ runtimeState: PrivacyMaskStatusSchema,
25145
+ /**
25146
+ * Runtime-state durability: **restored** — operator-drawn regions, zero real churn — 22 writes in 25 minutes, every one of them the clock.
25147
+ *
25148
+ * See `RuntimeStateDurability`. Enforced by
25149
+ * `scripts/check-runtime-state-durability.ts`.
25150
+ */
25151
+ durability: "restored",
25152
+ /** Clock fields: written, but excluded from the compare that decides
25153
+ * whether persisting is worth a SQLite commit. */
25154
+ volatileStateFields: ["lastFetchedAt"]
24631
25155
  };
24632
25156
  var PtzPresetSchema = object({
24633
25157
  id: string(),
@@ -24793,7 +25317,14 @@ var ptzAutotrackCapability = {
24793
25317
  * fetch / cache / fallback logic out of the four cap methods —
24794
25318
  * they become trampolines over `runtimeState`.
24795
25319
  */
24796
- runtimeState: PtzAutotrackRuntimeStateSchema
25320
+ runtimeState: PtzAutotrackRuntimeStateSchema,
25321
+ /**
25322
+ * Runtime-state durability: **session** — mirrors the camera's own autotrack config, re-read on connect.
25323
+ *
25324
+ * See `RuntimeStateDurability`. Enforced by
25325
+ * `scripts/check-runtime-state-durability.ts`.
25326
+ */
25327
+ durability: "session"
24797
25328
  };
24798
25329
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
24799
25330
  kind: "mutation",
@@ -25443,7 +25974,14 @@ var sceneMonitorCapability = {
25443
25974
  schema: SceneMonitorStatusSchema,
25444
25975
  kind: "push"
25445
25976
  },
25446
- runtimeState: SceneMonitorStatusSchema
25977
+ runtimeState: SceneMonitorStatusSchema,
25978
+ /**
25979
+ * Runtime-state durability: **session** — re-derived from the current scene on the next evaluation.
25980
+ *
25981
+ * See `RuntimeStateDurability`. Enforced by
25982
+ * `scripts/check-runtime-state-durability.ts`.
25983
+ */
25984
+ durability: "session"
25447
25985
  };
25448
25986
  /**
25449
25987
  * Per-stage gating mode applied to the zones a rule references.
@@ -25587,7 +26125,14 @@ var scriptRunnerCapability = {
25587
26125
  * `isRunning` to render a spinner during execution and surfaces
25588
26126
  * `lastError` / `lastRunSuccess` in the recent-runs panel.
25589
26127
  */
25590
- runtimeState: ScriptRunnerStatusSchema
26128
+ runtimeState: ScriptRunnerStatusSchema,
26129
+ /**
26130
+ * Runtime-state durability: **session** — a restored `isRunning: true` describes a process that died with the previous hub.
26131
+ *
26132
+ * See `RuntimeStateDurability`. Enforced by
26133
+ * `scripts/check-runtime-state-durability.ts`.
26134
+ */
26135
+ durability: "session"
25591
26136
  };
25592
26137
  /**
25593
26138
  * Smoke alarm sensor — boolean "is smoke currently detected" with
@@ -25614,7 +26159,17 @@ var smokeCapability = {
25614
26159
  schema: SmokeStatusSchema,
25615
26160
  kind: "push"
25616
26161
  },
25617
- runtimeState: SmokeStatusSchema
26162
+ runtimeState: SmokeStatusSchema,
26163
+ /**
26164
+ * Runtime-state durability: **restored** — a safety sensor must not read "clear" merely because the hub restarted.
26165
+ *
26166
+ * See `RuntimeStateDurability`. Enforced by
26167
+ * `scripts/check-runtime-state-durability.ts`.
26168
+ */
26169
+ durability: "restored",
26170
+ /** Clock fields: written, but excluded from the compare that decides
26171
+ * whether persisting is worth a SQLite commit. */
26172
+ volatileStateFields: ["lastChangedAt"]
25618
26173
  };
25619
26174
  /**
25620
26175
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -25787,7 +26342,17 @@ var streamParamsCapability = {
25787
26342
  schema: StreamParamsStatusSchema,
25788
26343
  kind: "poll"
25789
26344
  },
25790
- runtimeState: StreamParamsStatusSchema
26345
+ runtimeState: StreamParamsStatusSchema,
26346
+ /**
26347
+ * Runtime-state durability: **restored** — operator-set encoder profile; mutation-driven.
26348
+ *
26349
+ * See `RuntimeStateDurability`. Enforced by
26350
+ * `scripts/check-runtime-state-durability.ts`.
26351
+ */
26352
+ durability: "restored",
26353
+ /** Clock fields: written, but excluded from the compare that decides
26354
+ * whether persisting is worth a SQLite commit. */
26355
+ volatileStateFields: ["lastFetchedAt"]
25791
26356
  };
25792
26357
  /**
25793
26358
  * Generic on/off switch cap for accessory children (siren, floodlight,
@@ -25833,6 +26398,16 @@ var switchCapability = {
25833
26398
  * not need to re-query the provider after a setState mutation.
25834
26399
  */
25835
26400
  runtimeState: SwitchStatusSchema,
26401
+ /**
26402
+ * Runtime-state durability: **restored** — device state an operator reads as authoritative; 55 devices, transition-driven.
26403
+ *
26404
+ * See `RuntimeStateDurability`. Enforced by
26405
+ * `scripts/check-runtime-state-durability.ts`.
26406
+ */
26407
+ durability: "restored",
26408
+ /** Clock fields: written, but excluded from the compare that decides
26409
+ * whether persisting is worth a SQLite commit. */
26410
+ volatileStateFields: ["lastChangedAt"],
25836
26411
  settings: { bindings: [{
25837
26412
  kind: "scalar",
25838
26413
  statusPath: "on",
@@ -25912,7 +26487,17 @@ var tamperCapability = {
25912
26487
  schema: TamperStatusSchema,
25913
26488
  kind: "push"
25914
26489
  },
25915
- runtimeState: TamperStatusSchema
26490
+ runtimeState: TamperStatusSchema,
26491
+ /**
26492
+ * Runtime-state durability: **restored** — as `smoke`.
26493
+ *
26494
+ * See `RuntimeStateDurability`. Enforced by
26495
+ * `scripts/check-runtime-state-durability.ts`.
26496
+ */
26497
+ durability: "restored",
26498
+ /** Clock fields: written, but excluded from the compare that decides
26499
+ * whether persisting is worth a SQLite commit. */
26500
+ volatileStateFields: ["lastChangedAt"]
25916
26501
  };
25917
26502
  /**
25918
26503
  * Single-metric temperature reading. Drives Home Assistant `sensor`
@@ -25957,7 +26542,17 @@ var temperatureSensorCapability = {
25957
26542
  schema: TemperatureSensorStatusSchema,
25958
26543
  kind: "push"
25959
26544
  },
25960
- runtimeState: TemperatureSensorStatusSchema
26545
+ runtimeState: TemperatureSensorStatusSchema,
26546
+ /**
26547
+ * Runtime-state durability: **restored** — as `numeric-sensor` (69 of 125 writes were the clock alone).
26548
+ *
26549
+ * See `RuntimeStateDurability`. Enforced by
26550
+ * `scripts/check-runtime-state-durability.ts`.
26551
+ */
26552
+ durability: "restored",
26553
+ /** Clock fields: written, but excluded from the compare that decides
26554
+ * whether persisting is worth a SQLite commit. */
26555
+ volatileStateFields: ["lastFetchedAt"]
25961
26556
  };
25962
26557
  /**
25963
26558
  * toast — system-scoped singleton capability that streams toast
@@ -26026,7 +26621,14 @@ var updateCapability = {
26026
26621
  schema: UpdateStatusSchema,
26027
26622
  kind: "poll"
26028
26623
  },
26029
- runtimeState: UpdateStatusSchema
26624
+ runtimeState: UpdateStatusSchema,
26625
+ /**
26626
+ * Runtime-state durability: **session** — a restored `inProgress: true` describes an update that is no longer running; versions are re-probed at boot.
26627
+ *
26628
+ * See `RuntimeStateDurability`. Enforced by
26629
+ * `scripts/check-runtime-state-durability.ts`.
26630
+ */
26631
+ durability: "session"
26030
26632
  };
26031
26633
  var UserSummarySchema = object({
26032
26634
  id: string(),
@@ -26360,7 +26962,14 @@ var vacuumControlCapability = {
26360
26962
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26361
26963
  * slice for live state + battery + fan-speed changes.
26362
26964
  */
26363
- runtimeState: VacuumControlStatusSchema
26965
+ runtimeState: VacuumControlStatusSchema,
26966
+ /**
26967
+ * Runtime-state durability: **session** — as `media-player` — a restored `state: cleaning` is a robot that is not cleaning.
26968
+ *
26969
+ * See `RuntimeStateDurability`. Enforced by
26970
+ * `scripts/check-runtime-state-durability.ts`.
26971
+ */
26972
+ durability: "session"
26364
26973
  };
26365
26974
  var ValveStatusSchema = object({
26366
26975
  /** Lifecycle state of the valve. */
@@ -26412,7 +27021,14 @@ var valveCapability = {
26412
27021
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26413
27022
  * slice for live position changes during a move.
26414
27023
  */
26415
- runtimeState: ValveStatusSchema
27024
+ runtimeState: ValveStatusSchema,
27025
+ /**
27026
+ * Runtime-state durability: **session** — as `brightness`.
27027
+ *
27028
+ * See `RuntimeStateDurability`. Enforced by
27029
+ * `scripts/check-runtime-state-durability.ts`.
27030
+ */
27031
+ durability: "session"
26416
27032
  };
26417
27033
  /**
26418
27034
  * Vibration / shake / impact sensor. Drives Home Assistant
@@ -26434,7 +27050,17 @@ var vibrationCapability = {
26434
27050
  schema: VibrationStatusSchema,
26435
27051
  kind: "push"
26436
27052
  },
26437
- runtimeState: VibrationStatusSchema
27053
+ runtimeState: VibrationStatusSchema,
27054
+ /**
27055
+ * Runtime-state durability: **restored** — as `smoke`.
27056
+ *
27057
+ * See `RuntimeStateDurability`. Enforced by
27058
+ * `scripts/check-runtime-state-durability.ts`.
27059
+ */
27060
+ durability: "restored",
27061
+ /** Clock fields: written, but excluded from the compare that decides
27062
+ * whether persisting is worth a SQLite commit. */
27063
+ volatileStateFields: ["lastChangedAt"]
26438
27064
  };
26439
27065
  /**
26440
27066
  * Water heater / boiler cap. Models HA `water_heater.*` entities — a
@@ -26508,7 +27134,14 @@ var waterHeaterCapability = {
26508
27134
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26509
27135
  * slice for live temperature / mode / away changes.
26510
27136
  */
26511
- runtimeState: WaterHeaterStatusSchema
27137
+ runtimeState: WaterHeaterStatusSchema,
27138
+ /**
27139
+ * Runtime-state durability: **session** — as `climate-control`.
27140
+ *
27141
+ * See `RuntimeStateDurability`. Enforced by
27142
+ * `scripts/check-runtime-state-durability.ts`.
27143
+ */
27144
+ durability: "session"
26512
27145
  };
26513
27146
  /**
26514
27147
  * Weather provider cap. Models HA `weather.*` entities — a read-only
@@ -26567,7 +27200,14 @@ var weatherCapability = {
26567
27200
  * Runtime-state slice — mirrored by the kernel. The UI reads the
26568
27201
  * current conditions directly from the slice on each weather push.
26569
27202
  */
26570
- runtimeState: WeatherStatusSchema
27203
+ runtimeState: WeatherStatusSchema,
27204
+ /**
27205
+ * Runtime-state durability: **session** — a forecast is stale the moment the hub is down; the provider re-fetches on connect.
27206
+ *
27207
+ * See `RuntimeStateDurability`. Enforced by
27208
+ * `scripts/check-runtime-state-durability.ts`.
27209
+ */
27210
+ durability: "session"
26571
27211
  };
26572
27212
  /**
26573
27213
  * Per-zone occupancy aggregation produced by the analytics frame
@@ -26729,7 +27369,14 @@ var zoneAnalyticsCapability = {
26729
27369
  * automatically; the explicit `getCurrentSnapshot` cap method is
26730
27370
  * still useful for one-off polls without a subscription.
26731
27371
  */
26732
- runtimeState: CameraOccupancySnapshotSchema
27372
+ runtimeState: CameraOccupancySnapshotSchema,
27373
+ /**
27374
+ * Runtime-state durability: **session** — per-frame analytics; with `audio-metrics` it is ~90 % of the offered write rate. Re-derived on the next frame.
27375
+ *
27376
+ * See `RuntimeStateDurability`. Enforced by
27377
+ * `scripts/check-runtime-state-durability.ts`.
27378
+ */
27379
+ durability: "session"
26733
27380
  };
26734
27381
  /**
26735
27382
  * Stages a {@link ZoneRule} can apply to. Discriminator on the rules
@@ -26807,7 +27454,14 @@ var zoneRulesCapability = {
26807
27454
  motion: array(ZoneRuleSchema).readonly(),
26808
27455
  detection: array(ZoneRuleSchema).readonly(),
26809
27456
  package: array(ZoneRuleSchema).readonly()
26810
- })
27457
+ }),
27458
+ /**
27459
+ * Runtime-state durability: **restored** — operator intent, mutation-only, same argument as `zones`.
27460
+ *
27461
+ * See `RuntimeStateDurability`. Enforced by
27462
+ * `scripts/check-runtime-state-durability.ts`.
27463
+ */
27464
+ durability: "restored"
26811
27465
  };
26812
27466
  /**
26813
27467
  * Accessory device helpers — shared across drivers.
@@ -33494,6 +34148,7 @@ Object.freeze({
33494
34148
  "network-access": "ingress",
33495
34149
  "smtp-provider": "email"
33496
34150
  });
34151
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
33497
34152
  new Set(["devices", "classes"]);
33498
34153
  /**
33499
34154
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.