@camstack/addon-provider-dreo 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.js CHANGED
@@ -10793,7 +10793,14 @@ var cameraStreamsCapability = {
10793
10793
  low: string().optional()
10794
10794
  }),
10795
10795
  lastChangedAt: number()
10796
- })
10796
+ }),
10797
+ /**
10798
+ * 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.
10799
+ *
10800
+ * See `RuntimeStateDurability`. Enforced by
10801
+ * `scripts/check-runtime-state-durability.ts`.
10802
+ */
10803
+ durability: "session"
10797
10804
  };
10798
10805
  /** Where a block runs. The operator chooses — a block driving a device on an
10799
10806
  * agent is the reason placement is not fixed to the hub. */
@@ -11354,6 +11361,13 @@ var deviceDiscoveryCapability = {
11354
11361
  kind: "poll"
11355
11362
  },
11356
11363
  runtimeState: DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: number().int().nonnegative() }),
11364
+ /**
11365
+ * Runtime-state durability: **session** — 5.7 KB of scan output on the largest device, fully re-derivable by re-scanning.
11366
+ *
11367
+ * See `RuntimeStateDurability`. Enforced by
11368
+ * `scripts/check-runtime-state-durability.ts`.
11369
+ */
11370
+ durability: "session",
11357
11371
  methods: {
11358
11372
  /**
11359
11373
  * Snapshot of the current `discovered` list. Returns the
@@ -13240,11 +13254,33 @@ var NotificationFormatSchema = _enum([
13240
13254
  * Named by INTENT, never by glyph. "check" would tie the vocabulary to one
13241
13255
  * renderer's icon set; "acknowledge" survives an adapter that draws it
13242
13256
  * differently.
13257
+ *
13258
+ * ── A TOKEN IS NOT A WIRE VALUE ─────────────────────────────────────
13259
+ *
13260
+ * These names are for US. **No adapter may forward one verbatim.** Each maps
13261
+ * the whole set onto its own renderer's vocabulary through a
13262
+ * `Record<NotificationActionIcon, string>` — a Record, never a lookup with a
13263
+ * fallback, so adding a member here fails every adapter's build until someone
13264
+ * decides its glyph, which is the only place that decision can be made
13265
+ * honestly.
13266
+ *
13267
+ * This paragraph is the bug. Zentik declared `actionIcons: true` and passed
13268
+ * `disarm` straight through; iOS feeds that string to
13269
+ * `UNNotificationActionIcon(systemImageName:)`, `disarm` is not an SF Symbol,
13270
+ * and every snooze and alarm button arrived BLANK. A pass-through is not a
13271
+ * mapping, and "the field is documented" is not "the value renders".
13272
+ *
13273
+ * Adding a member is TRAIN-BOUND. The enum lives in the published
13274
+ * `@camstack/server` closure and the cap seam validates against the HUB's copy,
13275
+ * so an addon that emits a token the running hub does not know does not lose an
13276
+ * icon — its whole `send` fails Zod validation and the notification never
13277
+ * arrives. Never emit a new token from an addon before the train carrying it.
13243
13278
  */
13244
13279
  var NotificationActionIconSchema = _enum([
13245
13280
  "acknowledge",
13246
13281
  "dismiss",
13247
13282
  "silence",
13283
+ "snooze",
13248
13284
  "view",
13249
13285
  "play",
13250
13286
  "open",
@@ -13252,9 +13288,13 @@ var NotificationActionIconSchema = _enum([
13252
13288
  "lock",
13253
13289
  "unlock",
13254
13290
  "arm",
13291
+ "arm-home",
13292
+ "arm-away",
13293
+ "arm-night",
13255
13294
  "disarm",
13256
13295
  "light",
13257
- "alert"
13296
+ "alert",
13297
+ "camera"
13258
13298
  ]);
13259
13299
  /** A single tap-through action button. */
13260
13300
  var NotificationActionSchema = object({
@@ -13270,7 +13310,23 @@ var NotificationActionSchema = object({
13270
13310
  * else — see `notification-center/action-token.ts` for what that does and
13271
13311
  * does not buy.
13272
13312
  */
13273
- destructive: boolean().optional()
13313
+ destructive: boolean().optional(),
13314
+ /**
13315
+ * How the tap should REACH the url.
13316
+ *
13317
+ * `navigate` (absent, and every button authored before this field) opens it:
13318
+ * the phone leaves the notification and shows whatever the callback returns.
13319
+ * That is right for a button whose answer the operator wants to read.
13320
+ *
13321
+ * `background` fires it as a POST and stays put. It exists for the buttons
13322
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13323
+ * an answer to the notification, and being thrown into a browser tab to
13324
+ * confirm it costs more attention than the notification did. A backend that
13325
+ * cannot do a background call renders it as an ordinary link (the adapters
13326
+ * fall back rather than dropping the button), so this is a preference, never
13327
+ * a requirement.
13328
+ */
13329
+ mode: _enum(["navigate", "background"]).optional()
13274
13330
  });
13275
13331
  /**
13276
13332
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -13438,6 +13494,24 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
13438
13494
  targetId: string(),
13439
13495
  enabled: boolean()
13440
13496
  }), _void(), { kind: "mutation" });
13497
+ new Set([
13498
+ {
13499
+ id: "person",
13500
+ name: "Person"
13501
+ },
13502
+ {
13503
+ id: "vehicle",
13504
+ name: "Vehicle"
13505
+ },
13506
+ {
13507
+ id: "animal",
13508
+ name: "Animal"
13509
+ },
13510
+ {
13511
+ id: "package",
13512
+ name: "Package"
13513
+ }
13514
+ ].map((l) => l.id));
13441
13515
  var COCO_TO_MACRO = {
13442
13516
  mapping: {
13443
13517
  person: "person",
@@ -14122,7 +14196,17 @@ var alarmPanelCapability = {
14122
14196
  * full slice; renders an arm button per `availableModes` entry and
14123
14197
  * a PIN field iff `requiresCode === true`.
14124
14198
  */
14125
- runtimeState: AlarmPanelStatusSchema
14199
+ runtimeState: AlarmPanelStatusSchema,
14200
+ /**
14201
+ * Runtime-state durability: **restored** — armed state is the one thing a panel must not lose across a restart.
14202
+ *
14203
+ * See `RuntimeStateDurability`. Enforced by
14204
+ * `scripts/check-runtime-state-durability.ts`.
14205
+ */
14206
+ durability: "restored",
14207
+ /** Clock fields: written, but excluded from the compare that decides
14208
+ * whether persisting is worth a SQLite commit. */
14209
+ volatileStateFields: ["lastChangedAt"]
14126
14210
  };
14127
14211
  /**
14128
14212
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
@@ -14263,6 +14347,8 @@ var NcSystemEventKindSchema = _enum([
14263
14347
  "alarm-triggered",
14264
14348
  "alarm-armed",
14265
14349
  "alarm-disarmed",
14350
+ "alarm-arming",
14351
+ "alarm-arm-refused",
14266
14352
  "camera-online",
14267
14353
  "camera-offline",
14268
14354
  "camera-disabled",
@@ -14299,6 +14385,9 @@ var NcSystemEventConditionSchema = object({
14299
14385
  nodeIds: array(string().min(1)).min(1).optional(),
14300
14386
  packageNames: array(string().min(1)).min(1).optional()
14301
14387
  });
14388
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14389
+ * outage the operator asked for once and forgot. */
14390
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14302
14391
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14303
14392
  var NcScheduleSchema = object({
14304
14393
  windows: array(object({
@@ -14675,15 +14764,15 @@ var NcConditionsSchema = object({
14675
14764
  * (an `immediate` rule naming an `audio-*` class, one notification per
14676
14765
  * classified sample) stays exactly as it was for rules that already use it.
14677
14766
  *
14678
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14679
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14680
- * (`camstack/src/data/notification-center.ts`, guarded by
14681
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14767
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14768
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14769
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14770
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14682
14771
  * condition fields it does not know when a rule is saved from the phone.
14683
14772
  * Publishing an editor for a condition the app cannot round-trip is how an
14684
- * operator loses a rule's conditions by opening it — so the descriptor, the
14685
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14686
- * does an audio rule become authorable.
14773
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14774
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14775
+ * follows here.
14687
14776
  */
14688
14777
  audio: NcAudioConditionSchema.optional()
14689
14778
  });
@@ -14919,6 +15008,30 @@ var NcRuleInputSchema = object({
14919
15008
  */
14920
15009
  snoozeAllowGlobal: boolean().optional(),
14921
15010
  /**
15011
+ * The snooze durations THIS rule's notification offers as buttons, in
15012
+ * minutes.
15013
+ *
15014
+ * Three states, and all three are distinct — which is exactly why this is
15015
+ * `.optional()` and never `.default()`. A Zod default does not run on the
15016
+ * addon cap path (three production failures in one day), so a schema default
15017
+ * would collapse the first two:
15018
+ *
15019
+ * | value | meaning |
15020
+ * | --- | --- |
15021
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
15022
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
15023
+ * | a list | these choices, de-duplicated and sorted, at most four |
15024
+ *
15025
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
15026
+ * three buttons in total) and a rule that spent it all on snooze choices
15027
+ * would push its own tap-through actions off the notification.
15028
+ *
15029
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
15030
+ * that arms the panel, is exempt automatically and cannot be silenced by a
15031
+ * window from anywhere (D133).
15032
+ */
15033
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
15034
+ /**
14922
15035
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14923
15036
  *
14924
15037
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -15018,6 +15131,7 @@ var NcConditionDescriptorSchema = object({
15018
15131
  "device",
15019
15132
  "package",
15020
15133
  "occupancy",
15134
+ "audio",
15021
15135
  "system"
15022
15136
  ]),
15023
15137
  label: string(),
@@ -15036,6 +15150,7 @@ var NcConditionDescriptorSchema = object({
15036
15150
  "crossingSelect",
15037
15151
  "polygonDraw",
15038
15152
  "occupancy",
15153
+ "audio",
15039
15154
  "deviceState",
15040
15155
  "systemEvent"
15041
15156
  ]),
@@ -15187,7 +15302,20 @@ var NcSnoozeInputSchema = object({
15187
15302
  ruleId: string().optional(),
15188
15303
  /** Required when `scope: 'device'`. */
15189
15304
  deviceId: number().int().optional(),
15190
- durationMinutes: number().int().min(1).max(1440),
15305
+ /**
15306
+ * Narrow the window to these subject classes — "the cat, not the person".
15307
+ *
15308
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15309
+ * what every window authored before this field meant, so no persisted row
15310
+ * changes meaning and no client has to learn anything to keep working.
15311
+ *
15312
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15313
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15314
+ * not at whichever of their four rules happened to produce the notification
15315
+ * they are dismissing.
15316
+ */
15317
+ classes: array(string().min(1)).min(1).optional(),
15318
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
15191
15319
  /**
15192
15320
  * Silence this for EVERY recipient, not just the caller. Permission is
15193
15321
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15212,6 +15340,10 @@ var NcSnoozeSchema = object({
15212
15340
  scope: NcSnoozeScopeSchema,
15213
15341
  ruleId: string().optional(),
15214
15342
  deviceId: number().int().optional(),
15343
+ /** Subject classes this window covers. ABSENT = every class — see
15344
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15345
+ * no SQLite column: nothing queries a window by class. */
15346
+ classes: array(string().min(1)).min(1).optional(),
15215
15347
  startedAt: number(),
15216
15348
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15217
15349
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -17312,7 +17444,14 @@ var zonesCapability = {
17312
17444
  * handle. Slice shape is `{ zones: Zone[] }` so future extensions
17313
17445
  * (e.g. zone groupings) can sit alongside the polygon list.
17314
17446
  */
17315
- runtimeState: object({ zones: array(ZoneSchema).readonly() })
17447
+ runtimeState: object({ zones: array(ZoneSchema).readonly() }),
17448
+ /**
17449
+ * 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.
17450
+ *
17451
+ * See `RuntimeStateDurability`. Enforced by
17452
+ * `scripts/check-runtime-state-durability.ts`.
17453
+ */
17454
+ durability: "restored"
17316
17455
  };
17317
17456
  /**
17318
17457
  * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
@@ -17482,6 +17621,22 @@ var detectionFpsField = {
17482
17621
  default: 10,
17483
17622
  step: 1
17484
17623
  };
17624
+ /**
17625
+ * The occupancy re-check interval. DEFAULT 300 s (2026-08-13 — was 30 s).
17626
+ *
17627
+ * The recheck is now on by default (a parked car is invisible to occupancy
17628
+ * rules until the stationary registry has been rebuilt by motion, which after a
17629
+ * restart may be never on a quiet camera). Each cycle re-subscribes a detection
17630
+ * session — an RTSP re-dial — so the switch is only affordable at a WIDE
17631
+ * interval: 300 s is ~12 re-dials an hour per camera, against 120 at the old
17632
+ * 30 s. A parked car is therefore counted within 5 minutes of a restart.
17633
+ *
17634
+ * Why not wider: `max` is 300 and raising it is TRAIN-BOUND, not addon-bound —
17635
+ * the host validates `attachCamera` against ITS copy of this schema, so a
17636
+ * runner asked for 600 would be rejected by the hub until a `@camstack/server`
17637
+ * carrying the wider bound is installed everywhere. 300 is the widest value
17638
+ * that ships with an addon deploy.
17639
+ */
17485
17640
  var occupancyRecheckSecField = {
17486
17641
  min: 0,
17487
17642
  max: 300,
@@ -17683,15 +17838,21 @@ var RunnerCameraConfigSchema = object({
17683
17838
  */
17684
17839
  onboardMotionDrivesAnalyzer: boolean().default(true),
17685
17840
  /**
17686
- * Master toggle for the occupancy re-check. When `false` (DEFAULT) the runner
17687
- * never arms the periodic recheck timer, regardless of `occupancyRecheckSec`
17688
- * this is off by default because the recheck re-subscribes a detection session
17689
- * every N seconds while `watching`, a major source of pull-decoder re-dial
17690
- * churn (each cycle creates+tears a session → RTSP re-dial → latency). The
17841
+ * Master toggle for the occupancy re-check. When `false` the runner never arms
17842
+ * the periodic recheck timer, regardless of `occupancyRecheckSec`; the
17691
17843
  * `occupancyRecheckSec` / `occupancyRecheckFrames` sliders only take effect
17692
17844
  * (and only render) when this is enabled.
17693
- */
17694
- occupancyRecheckEnabled: boolean().default(false),
17845
+ *
17846
+ * DEFAULT `true` since 2026-08-13 (was `false`). It was off because the
17847
+ * recheck re-subscribes a detection session every N seconds while `watching`
17848
+ * — each cycle creates+tears a session ⇒ an RTSP re-dial ⇒ latency, a major
17849
+ * pull-decoder churn source. What that bought was a blind spot: a STATIONARY
17850
+ * object is counted only while the stationary registry holds it, and the
17851
+ * registry rebuilds from motion, so after a restart a parked car was invisible
17852
+ * to every occupancy rule until something moved in front of it. The churn is
17853
+ * now paid on the interval instead — see `occupancyRecheckSecField`.
17854
+ */
17855
+ occupancyRecheckEnabled: boolean().default(true),
17695
17856
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
17696
17857
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
17697
17858
  /**
@@ -20111,7 +20272,17 @@ var airQualitySensorCapability = {
20111
20272
  schema: AirQualitySensorStatusSchema,
20112
20273
  kind: "push"
20113
20274
  },
20114
- runtimeState: AirQualitySensorStatusSchema
20275
+ runtimeState: AirQualitySensorStatusSchema,
20276
+ /**
20277
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20278
+ *
20279
+ * See `RuntimeStateDurability`. Enforced by
20280
+ * `scripts/check-runtime-state-durability.ts`.
20281
+ */
20282
+ durability: "restored",
20283
+ /** Clock fields: written, but excluded from the compare that decides
20284
+ * whether persisting is worth a SQLite commit. */
20285
+ volatileStateFields: ["lastFetchedAt"]
20115
20286
  };
20116
20287
  /**
20117
20288
  * Ambient illuminance reading in lux. Drives Home Assistant `sensor`
@@ -20143,7 +20314,17 @@ var ambientLightSensorCapability = {
20143
20314
  schema: AmbientLightSensorStatusSchema,
20144
20315
  kind: "push"
20145
20316
  },
20146
- runtimeState: AmbientLightSensorStatusSchema
20317
+ runtimeState: AmbientLightSensorStatusSchema,
20318
+ /**
20319
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20320
+ *
20321
+ * See `RuntimeStateDurability`. Enforced by
20322
+ * `scripts/check-runtime-state-durability.ts`.
20323
+ */
20324
+ durability: "restored",
20325
+ /** Clock fields: written, but excluded from the compare that decides
20326
+ * whether persisting is worth a SQLite commit. */
20327
+ volatileStateFields: ["lastFetchedAt"]
20147
20328
  };
20148
20329
  /**
20149
20330
  * Per-class audio metrics aggregated over a sliding window.
@@ -20261,7 +20442,14 @@ var audioMetricsCapability = {
20261
20442
  }), AudioMetricsHistorySchema)
20262
20443
  },
20263
20444
  /** Reactive runtime-state mirror — live `device.state.audioMetrics.value`. */
20264
- runtimeState: AudioMetricsSnapshotSchema
20445
+ runtimeState: AudioMetricsSnapshotSchema,
20446
+ /**
20447
+ * 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.
20448
+ *
20449
+ * See `RuntimeStateDurability`. Enforced by
20450
+ * `scripts/check-runtime-state-durability.ts`.
20451
+ */
20452
+ durability: "session"
20265
20453
  };
20266
20454
  /**
20267
20455
  * Automation-control cap. Models HA `automation.*` entities on
@@ -20323,7 +20511,14 @@ var automationControlCapability = {
20323
20511
  * reads `enabled` (toggle) + `isRunning` (spinner) + `lastError`
20324
20512
  * (badge) directly.
20325
20513
  */
20326
- runtimeState: AutomationControlStatusSchema
20514
+ runtimeState: AutomationControlStatusSchema,
20515
+ /**
20516
+ * 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.
20517
+ *
20518
+ * See `RuntimeStateDurability`. Enforced by
20519
+ * `scripts/check-runtime-state-durability.ts`.
20520
+ */
20521
+ durability: "session"
20327
20522
  };
20328
20523
  /**
20329
20524
  * Battery status snapshot. Emitted by providers whose device is
@@ -20429,7 +20624,17 @@ onStatusChanged: { data: object({
20429
20624
  * via `device.runtimeState.getCapState('battery')` regardless of
20430
20625
  * the underlying driver.
20431
20626
  */
20432
- runtimeState: BatteryStatusSchema
20627
+ runtimeState: BatteryStatusSchema,
20628
+ /**
20629
+ * 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.
20630
+ *
20631
+ * See `RuntimeStateDurability`. Enforced by
20632
+ * `scripts/check-runtime-state-durability.ts`.
20633
+ */
20634
+ durability: "restored",
20635
+ /** Clock fields: written, but excluded from the compare that decides
20636
+ * whether persisting is worth a SQLite commit. */
20637
+ volatileStateFields: ["lastUpdated"]
20433
20638
  };
20434
20639
  /**
20435
20640
  * Generic boolean sensor — last-resort fallback when no domain-
@@ -20458,7 +20663,17 @@ var binaryCapability = {
20458
20663
  schema: BinaryStatusSchema,
20459
20664
  kind: "push"
20460
20665
  },
20461
- runtimeState: BinaryStatusSchema
20666
+ runtimeState: BinaryStatusSchema,
20667
+ /**
20668
+ * Runtime-state durability: **restored** — transition-driven sensor state; the restored value gives the boot comparison.
20669
+ *
20670
+ * See `RuntimeStateDurability`. Enforced by
20671
+ * `scripts/check-runtime-state-durability.ts`.
20672
+ */
20673
+ durability: "restored",
20674
+ /** Clock fields: written, but excluded from the compare that decides
20675
+ * whether persisting is worth a SQLite commit. */
20676
+ volatileStateFields: ["lastChangedAt"]
20462
20677
  };
20463
20678
  /**
20464
20679
  * Dimmable-light brightness control. Co-exists with `switch` on the
@@ -20511,7 +20726,14 @@ onBrightnessChanged: { data: object({
20511
20726
  * by the kernel. Read via `device.state.brightness.value` so UI
20512
20727
  * sliders surface the current level without polling the provider.
20513
20728
  */
20514
- runtimeState: BrightnessStatusSchema
20729
+ runtimeState: BrightnessStatusSchema,
20730
+ /**
20731
+ * Runtime-state durability: **session** — live lamp state, re-published by the provider on connect.
20732
+ *
20733
+ * See `RuntimeStateDurability`. Enforced by
20734
+ * `scripts/check-runtime-state-durability.ts`.
20735
+ */
20736
+ durability: "session"
20515
20737
  };
20516
20738
  DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
20517
20739
  kind: "mutation",
@@ -20599,7 +20821,17 @@ var carbonMonoxideCapability = {
20599
20821
  schema: CarbonMonoxideStatusSchema,
20600
20822
  kind: "push"
20601
20823
  },
20602
- runtimeState: CarbonMonoxideStatusSchema
20824
+ runtimeState: CarbonMonoxideStatusSchema,
20825
+ /**
20826
+ * Runtime-state durability: **restored** — as `smoke`.
20827
+ *
20828
+ * See `RuntimeStateDurability`. Enforced by
20829
+ * `scripts/check-runtime-state-durability.ts`.
20830
+ */
20831
+ durability: "restored",
20832
+ /** Clock fields: written, but excluded from the compare that decides
20833
+ * whether persisting is worth a SQLite commit. */
20834
+ volatileStateFields: ["lastChangedAt"]
20603
20835
  };
20604
20836
  /**
20605
20837
  * HVAC / climate control cap. Models the full surface of a HA
@@ -20759,7 +20991,14 @@ var climateControlCapability = {
20759
20991
  * the full slice via `device.state.climate-control.value` and refresh
20760
20992
  * on every push without re-querying the provider.
20761
20993
  */
20762
- runtimeState: ClimateControlStatusSchema
20994
+ runtimeState: ClimateControlStatusSchema,
20995
+ /**
20996
+ * Runtime-state durability: **session** — as `brightness`; `currentTemp` moves continuously and is re-published on connect.
20997
+ *
20998
+ * See `RuntimeStateDurability`. Enforced by
20999
+ * `scripts/check-runtime-state-durability.ts`.
21000
+ */
21001
+ durability: "session"
20763
21002
  };
20764
21003
  /**
20765
21004
  * Color-light cap. Coexists with `switch` (on/off) and `brightness`
@@ -20869,7 +21108,14 @@ onColorChanged: { data: object({
20869
21108
  * kernel. Read via `device.state.color.value` so UI pickers surface
20870
21109
  * the current chromaticity without polling the provider.
20871
21110
  */
20872
- runtimeState: ColorStatusSchema
21111
+ runtimeState: ColorStatusSchema,
21112
+ /**
21113
+ * Runtime-state durability: **session** — as `brightness`.
21114
+ *
21115
+ * See `RuntimeStateDurability`. Enforced by
21116
+ * `scripts/check-runtime-state-durability.ts`.
21117
+ */
21118
+ durability: "session"
20873
21119
  };
20874
21120
  var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
20875
21121
  object({
@@ -20935,7 +21181,17 @@ var connectivityCapability = {
20935
21181
  schema: ConnectivityStatusSchema,
20936
21182
  kind: "push"
20937
21183
  },
20938
- runtimeState: ConnectivityStatusSchema
21184
+ runtimeState: ConnectivityStatusSchema,
21185
+ /**
21186
+ * Runtime-state durability: **restored** — same shape and same argument as `device-status`, for links rather than devices.
21187
+ *
21188
+ * See `RuntimeStateDurability`. Enforced by
21189
+ * `scripts/check-runtime-state-durability.ts`.
21190
+ */
21191
+ durability: "restored",
21192
+ /** Clock fields: written, but excluded from the compare that decides
21193
+ * whether persisting is worth a SQLite commit. */
21194
+ volatileStateFields: ["lastChangedAt"]
20939
21195
  };
20940
21196
  /**
20941
21197
  * Generic device-consumables capability — surfaces a device's
@@ -21017,7 +21273,14 @@ reset: method(object({
21017
21273
  }
21018
21274
  }
21019
21275
  },
21020
- runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() })
21276
+ runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() }),
21277
+ /**
21278
+ * Runtime-state durability: **session** — the authority is the appliance; the provider re-reads the whole item array on connect.
21279
+ *
21280
+ * See `RuntimeStateDurability`. Enforced by
21281
+ * `scripts/check-runtime-state-durability.ts`.
21282
+ */
21283
+ durability: "session"
21021
21284
  };
21022
21285
  /**
21023
21286
  * Door / window / opening / garage / valve contact sensor. Boolean
@@ -21048,7 +21311,17 @@ var contactCapability = {
21048
21311
  schema: ContactStatusSchema,
21049
21312
  kind: "push"
21050
21313
  },
21051
- runtimeState: ContactStatusSchema
21314
+ runtimeState: ContactStatusSchema,
21315
+ /**
21316
+ * Runtime-state durability: **restored** — a door left open across a restart must still read open.
21317
+ *
21318
+ * See `RuntimeStateDurability`. Enforced by
21319
+ * `scripts/check-runtime-state-durability.ts`.
21320
+ */
21321
+ durability: "restored",
21322
+ /** Clock fields: written, but excluded from the compare that decides
21323
+ * whether persisting is worth a SQLite commit. */
21324
+ volatileStateFields: ["lastChangedAt"]
21052
21325
  };
21053
21326
  /**
21054
21327
  * Status slice — flat object (the framework's `runtimeState` contract
@@ -21154,7 +21427,14 @@ var controlCapability = {
21154
21427
  * dropdown / text field / date picker) read the slice's discriminant
21155
21428
  * and value directly without polling the provider.
21156
21429
  */
21157
- runtimeState: ControlStatusSchema
21430
+ runtimeState: ControlStatusSchema,
21431
+ /**
21432
+ * Runtime-state durability: **session** — a generic control mirrors an external entity that re-publishes on connect; the options array is re-derived with it.
21433
+ *
21434
+ * See `RuntimeStateDurability`. Enforced by
21435
+ * `scripts/check-runtime-state-durability.ts`.
21436
+ */
21437
+ durability: "session"
21158
21438
  };
21159
21439
  var CoverStatusSchema = object({
21160
21440
  /** Lifecycle state of the cover. */
@@ -21215,7 +21495,17 @@ var coverCapability = {
21215
21495
  * Runtime-state slice — mirrored by the kernel. UI controls watch
21216
21496
  * the slice for live position changes during a move.
21217
21497
  */
21218
- runtimeState: CoverStatusSchema
21498
+ runtimeState: CoverStatusSchema,
21499
+ /**
21500
+ * Runtime-state durability: **restored** — position survives a restart on the device; the mirror should agree at boot rather than read blank.
21501
+ *
21502
+ * See `RuntimeStateDurability`. Enforced by
21503
+ * `scripts/check-runtime-state-durability.ts`.
21504
+ */
21505
+ durability: "restored",
21506
+ /** Clock fields: written, but excluded from the compare that decides
21507
+ * whether persisting is worth a SQLite commit. */
21508
+ volatileStateFields: ["lastChangedAt"]
21219
21509
  };
21220
21510
  /**
21221
21511
  * Vendor-neutral day/night (IR-cut) control — the per-camera config cap
@@ -21309,7 +21599,17 @@ var dayNightCapability = {
21309
21599
  schema: DayNightStatusSchema,
21310
21600
  kind: "poll"
21311
21601
  },
21312
- runtimeState: DayNightStatusSchema
21602
+ runtimeState: DayNightStatusSchema,
21603
+ /**
21604
+ * Runtime-state durability: **restored** — operator-set IR-cut behaviour; mutation-driven.
21605
+ *
21606
+ * See `RuntimeStateDurability`. Enforced by
21607
+ * `scripts/check-runtime-state-durability.ts`.
21608
+ */
21609
+ durability: "restored",
21610
+ /** Clock fields: written, but excluded from the compare that decides
21611
+ * whether persisting is worth a SQLite commit. */
21612
+ volatileStateFields: ["lastFetchedAt"]
21313
21613
  };
21314
21614
  /**
21315
21615
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
@@ -21356,7 +21656,17 @@ onStatusChanged: { data: object({
21356
21656
  schema: DeviceStatusSchema,
21357
21657
  kind: "push"
21358
21658
  },
21359
- runtimeState: DeviceStatusSchema
21659
+ runtimeState: DeviceStatusSchema,
21660
+ /**
21661
+ * 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.
21662
+ *
21663
+ * See `RuntimeStateDurability`. Enforced by
21664
+ * `scripts/check-runtime-state-durability.ts`.
21665
+ */
21666
+ durability: "restored",
21667
+ /** Clock fields: written, but excluded from the compare that decides
21668
+ * whether persisting is worth a SQLite commit. */
21669
+ volatileStateFields: ["lastChangedAt"]
21360
21670
  };
21361
21671
  /**
21362
21672
  * Doorbell button cap. Two kinds of providers coexist behind this cap
@@ -21418,7 +21728,14 @@ onPressed: { data: DoorbellPressEventSchema } },
21418
21728
  * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
21419
21729
  * without subscribing.
21420
21730
  */
21421
- runtimeState: DoorbellStatusSchema
21731
+ runtimeState: DoorbellStatusSchema,
21732
+ /**
21733
+ * 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.
21734
+ *
21735
+ * See `RuntimeStateDurability`. Enforced by
21736
+ * `scripts/check-runtime-state-durability.ts`.
21737
+ */
21738
+ durability: "restored"
21422
21739
  };
21423
21740
  /**
21424
21741
  * Enum-state sensor — a string value picked from a finite option set.
@@ -21458,7 +21775,17 @@ var enumSensorCapability = {
21458
21775
  schema: EnumSensorStatusSchema,
21459
21776
  kind: "push"
21460
21777
  },
21461
- runtimeState: EnumSensorStatusSchema
21778
+ runtimeState: EnumSensorStatusSchema,
21779
+ /**
21780
+ * Runtime-state durability: **restored** — as `numeric-sensor`; 80 devices.
21781
+ *
21782
+ * See `RuntimeStateDurability`. Enforced by
21783
+ * `scripts/check-runtime-state-durability.ts`.
21784
+ */
21785
+ durability: "restored",
21786
+ /** Clock fields: written, but excluded from the compare that decides
21787
+ * whether persisting is worth a SQLite commit. */
21788
+ volatileStateFields: ["lastFetchedAt"]
21462
21789
  };
21463
21790
  /**
21464
21791
  * Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
@@ -21494,7 +21821,14 @@ var eventEmitterCapability = {
21494
21821
  schema: EventEmitterStatusSchema,
21495
21822
  kind: "push"
21496
21823
  },
21497
- runtimeState: EventEmitterStatusSchema
21824
+ runtimeState: EventEmitterStatusSchema,
21825
+ /**
21826
+ * Runtime-state durability: **session** — `eventCountSinceStart` names its own scope.
21827
+ *
21828
+ * See `RuntimeStateDurability`. Enforced by
21829
+ * `scripts/check-runtime-state-durability.ts`.
21830
+ */
21831
+ durability: "session"
21498
21832
  };
21499
21833
  var EventItemSchema = object({
21500
21834
  id: string(),
@@ -21775,7 +22109,14 @@ var fanControlCapability = {
21775
22109
  * Runtime-state slice — mirrored by the kernel. UI fan speed
21776
22110
  * sliders read `percentage` for live updates.
21777
22111
  */
21778
- runtimeState: FanControlStatusSchema
22112
+ runtimeState: FanControlStatusSchema,
22113
+ /**
22114
+ * Runtime-state durability: **session** — as `brightness`.
22115
+ *
22116
+ * See `RuntimeStateDurability`. Enforced by
22117
+ * `scripts/check-runtime-state-durability.ts`.
22118
+ */
22119
+ durability: "session"
21779
22120
  };
21780
22121
  /**
21781
22122
  * Per-device feature/identity probe slice. Holds the runtime-resolved
@@ -21851,7 +22192,14 @@ onProbeChanged: { data: object({
21851
22192
  schema: FeatureProbeStatusSchema,
21852
22193
  kind: "push"
21853
22194
  },
21854
- runtimeState: FeatureProbeStatusSchema
22195
+ runtimeState: FeatureProbeStatusSchema,
22196
+ /**
22197
+ * 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.
22198
+ *
22199
+ * See `RuntimeStateDurability`. Enforced by
22200
+ * `scripts/check-runtime-state-durability.ts`.
22201
+ */
22202
+ durability: "session"
21855
22203
  };
21856
22204
  /**
21857
22205
  * Water leak / moisture sensor. Boolean "is liquid currently
@@ -21878,7 +22226,17 @@ var floodCapability = {
21878
22226
  schema: FloodStatusSchema,
21879
22227
  kind: "push"
21880
22228
  },
21881
- runtimeState: FloodStatusSchema
22229
+ runtimeState: FloodStatusSchema,
22230
+ /**
22231
+ * Runtime-state durability: **restored** — as `smoke`.
22232
+ *
22233
+ * See `RuntimeStateDurability`. Enforced by
22234
+ * `scripts/check-runtime-state-durability.ts`.
22235
+ */
22236
+ durability: "restored",
22237
+ /** Clock fields: written, but excluded from the compare that decides
22238
+ * whether persisting is worth a SQLite commit. */
22239
+ volatileStateFields: ["lastChangedAt"]
21882
22240
  };
21883
22241
  /**
21884
22242
  * Combustible-gas (LPG / methane / hydrogen) alarm sensor. Drives
@@ -21901,7 +22259,17 @@ var gasCapability = {
21901
22259
  schema: GasStatusSchema,
21902
22260
  kind: "push"
21903
22261
  },
21904
- runtimeState: GasStatusSchema
22262
+ runtimeState: GasStatusSchema,
22263
+ /**
22264
+ * Runtime-state durability: **restored** — as `smoke`.
22265
+ *
22266
+ * See `RuntimeStateDurability`. Enforced by
22267
+ * `scripts/check-runtime-state-durability.ts`.
22268
+ */
22269
+ durability: "restored",
22270
+ /** Clock fields: written, but excluded from the compare that decides
22271
+ * whether persisting is worth a SQLite commit. */
22272
+ volatileStateFields: ["lastChangedAt"]
21905
22273
  };
21906
22274
  /**
21907
22275
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
@@ -21977,7 +22345,14 @@ var humidifierCapability = {
21977
22345
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
21978
22346
  * slice for live humidity / mode changes.
21979
22347
  */
21980
- runtimeState: HumidifierStatusSchema
22348
+ runtimeState: HumidifierStatusSchema,
22349
+ /**
22350
+ * Runtime-state durability: **session** — as `climate-control`.
22351
+ *
22352
+ * See `RuntimeStateDurability`. Enforced by
22353
+ * `scripts/check-runtime-state-durability.ts`.
22354
+ */
22355
+ durability: "session"
21981
22356
  };
21982
22357
  /**
21983
22358
  * Single-metric humidity reading. Drives Home Assistant `sensor`
@@ -22013,7 +22388,17 @@ var humiditySensorCapability = {
22013
22388
  schema: HumiditySensorStatusSchema,
22014
22389
  kind: "push"
22015
22390
  },
22016
- runtimeState: HumiditySensorStatusSchema
22391
+ runtimeState: HumiditySensorStatusSchema,
22392
+ /**
22393
+ * Runtime-state durability: **restored** — as `numeric-sensor` (67 of 75 writes were the clock alone).
22394
+ *
22395
+ * See `RuntimeStateDurability`. Enforced by
22396
+ * `scripts/check-runtime-state-durability.ts`.
22397
+ */
22398
+ durability: "restored",
22399
+ /** Clock fields: written, but excluded from the compare that decides
22400
+ * whether persisting is worth a SQLite commit. */
22401
+ volatileStateFields: ["lastFetchedAt"]
22017
22402
  };
22018
22403
  /**
22019
22404
  * Image display cap. Models a single still image exposed by an integration —
@@ -22051,7 +22436,14 @@ var imageCapability = {
22051
22436
  * Runtime-state slice — mirrored by the kernel. The UI reads `url`
22052
22437
  * directly and renders the still image.
22053
22438
  */
22054
- runtimeState: ImageStatusSchema
22439
+ runtimeState: ImageStatusSchema,
22440
+ /**
22441
+ * Runtime-state durability: **session** — a snapshot URL is a session-scoped handle; a restored one points at nothing.
22442
+ *
22443
+ * See `RuntimeStateDurability`. Enforced by
22444
+ * `scripts/check-runtime-state-durability.ts`.
22445
+ */
22446
+ durability: "session"
22055
22447
  };
22056
22448
  /**
22057
22449
  * Vendor-neutral image / picture-adjustment cap — the per-camera config
@@ -22200,7 +22592,17 @@ var imageSettingsCapability = {
22200
22592
  schema: ImageSettingsStatusSchema,
22201
22593
  kind: "poll"
22202
22594
  },
22203
- runtimeState: ImageSettingsStatusSchema
22595
+ runtimeState: ImageSettingsStatusSchema,
22596
+ /**
22597
+ * Runtime-state durability: **restored** — operator-set camera imaging; mutation-driven.
22598
+ *
22599
+ * See `RuntimeStateDurability`. Enforced by
22600
+ * `scripts/check-runtime-state-durability.ts`.
22601
+ */
22602
+ durability: "restored",
22603
+ /** Clock fields: written, but excluded from the compare that decides
22604
+ * whether persisting is worth a SQLite commit. */
22605
+ volatileStateFields: ["lastFetchedAt"]
22204
22606
  };
22205
22607
  /**
22206
22608
  * integrations — system-scoped singleton capability for integration
@@ -22540,7 +22942,14 @@ var lawnMowerControlCapability = {
22540
22942
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22541
22943
  * slice for live activity + battery changes.
22542
22944
  */
22543
- runtimeState: LawnMowerControlStatusSchema
22945
+ runtimeState: LawnMowerControlStatusSchema,
22946
+ /**
22947
+ * Runtime-state durability: **session** — as `vacuum-control`.
22948
+ *
22949
+ * See `RuntimeStateDurability`. Enforced by
22950
+ * `scripts/check-runtime-state-durability.ts`.
22951
+ */
22952
+ durability: "session"
22544
22953
  };
22545
22954
  /**
22546
22955
  * local-network — hub-only singleton.
@@ -22746,7 +23155,17 @@ var lockControlCapability = {
22746
23155
  * read `state` and disable themselves during `locking`/`unlocking`
22747
23156
  * transitions.
22748
23157
  */
22749
- runtimeState: LockControlStatusSchema
23158
+ runtimeState: LockControlStatusSchema,
23159
+ /**
23160
+ * Runtime-state durability: **restored** — a lock left locked must still read locked.
23161
+ *
23162
+ * See `RuntimeStateDurability`. Enforced by
23163
+ * `scripts/check-runtime-state-durability.ts`.
23164
+ */
23165
+ durability: "restored",
23166
+ /** Clock fields: written, but excluded from the compare that decides
23167
+ * whether persisting is worth a SQLite commit. */
23168
+ volatileStateFields: ["lastChangedAt"]
22750
23169
  };
22751
23170
  /**
22752
23171
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
@@ -22908,7 +23327,14 @@ var mediaPlayerCapability = {
22908
23327
  * full slice for live now-playing, volume, and progress updates
22909
23328
  * without polling.
22910
23329
  */
22911
- runtimeState: MediaPlayerStatusSchema
23330
+ runtimeState: MediaPlayerStatusSchema,
23331
+ /**
23332
+ * Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
23333
+ *
23334
+ * See `RuntimeStateDurability`. Enforced by
23335
+ * `scripts/check-runtime-state-durability.ts`.
23336
+ */
23337
+ durability: "session"
22912
23338
  };
22913
23339
  /**
22914
23340
  * mesh-network — collection cap for mesh-VPN providers.
@@ -23172,7 +23598,14 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
23172
23598
  * `device.state.motion.value`. Reads never invoke the provider, so
23173
23599
  * UIs and other addons can poll the cached state safely.
23174
23600
  */
23175
- runtimeState: MotionStatusSchema
23601
+ runtimeState: MotionStatusSchema,
23602
+ /**
23603
+ * 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.
23604
+ *
23605
+ * See `RuntimeStateDurability`. Enforced by
23606
+ * `scripts/check-runtime-state-durability.ts`.
23607
+ */
23608
+ durability: "session"
23176
23609
  };
23177
23610
  /**
23178
23611
  * Motion-trigger toggle for accessory devices.
@@ -23237,7 +23670,14 @@ var motionTriggerCapability = {
23237
23670
  schema: MotionTriggerStatusSchema,
23238
23671
  kind: "command-driven"
23239
23672
  },
23240
- runtimeState: MotionTriggerRuntimeStateSchema
23673
+ runtimeState: MotionTriggerRuntimeStateSchema,
23674
+ /**
23675
+ * 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.
23676
+ *
23677
+ * See `RuntimeStateDurability`. Enforced by
23678
+ * `scripts/check-runtime-state-durability.ts`.
23679
+ */
23680
+ durability: "session"
23241
23681
  };
23242
23682
  /**
23243
23683
  * Motion-zones share the same MaskShape vocabulary as privacy-mask — the
@@ -23304,7 +23744,17 @@ var motionZonesCapability = {
23304
23744
  schema: MotionZoneStatusSchema,
23305
23745
  kind: "poll"
23306
23746
  },
23307
- runtimeState: MotionZoneStatusSchema
23747
+ runtimeState: MotionZoneStatusSchema,
23748
+ /**
23749
+ * 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.
23750
+ *
23751
+ * See `RuntimeStateDurability`. Enforced by
23752
+ * `scripts/check-runtime-state-durability.ts`.
23753
+ */
23754
+ durability: "restored",
23755
+ /** Clock fields: written, but excluded from the compare that decides
23756
+ * whether persisting is worth a SQLite commit. */
23757
+ volatileStateFields: ["lastFetchedAt"]
23308
23758
  };
23309
23759
  /**
23310
23760
  * On-camera AI object detection cap. Surfaces per-device the classes
@@ -23378,7 +23828,17 @@ var nativeObjectDetectionCapability = {
23378
23828
  schema: NativeObjectDetectionStatusSchema,
23379
23829
  kind: "push"
23380
23830
  },
23381
- runtimeState: NativeObjectDetectionRuntimeStateSchema
23831
+ runtimeState: NativeObjectDetectionRuntimeStateSchema,
23832
+ /**
23833
+ * 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.
23834
+ *
23835
+ * See `RuntimeStateDurability`. Enforced by
23836
+ * `scripts/check-runtime-state-durability.ts`.
23837
+ */
23838
+ durability: "restored",
23839
+ /** Clock fields: written, but excluded from the compare that decides
23840
+ * whether persisting is worth a SQLite commit. */
23841
+ volatileStateFields: ["lastFetchedAt"]
23382
23842
  };
23383
23843
  /**
23384
23844
  * network-quality — system-scoped singleton capability tracking RTT,
@@ -23712,7 +24172,14 @@ onSent: { data: object({
23712
24172
  * form reads `supports` to gate optional fields; history pane reads
23713
24173
  * `lastSentAt` / `lastError` / `queueDepth`.
23714
24174
  */
23715
- runtimeState: NotifierStatusSchema
24175
+ runtimeState: NotifierStatusSchema,
24176
+ /**
24177
+ * Runtime-state durability: **session** — live queue depth and last-send state; a restored queue depth describes a queue that no longer exists.
24178
+ *
24179
+ * See `RuntimeStateDurability`. Enforced by
24180
+ * `scripts/check-runtime-state-durability.ts`.
24181
+ */
24182
+ durability: "session"
23716
24183
  };
23717
24184
  /**
23718
24185
  * Generic numeric sensor — last-resort fallback when no typed numeric
@@ -23755,7 +24222,17 @@ var numericSensorCapability = {
23755
24222
  schema: NumericSensorStatusSchema,
23756
24223
  kind: "push"
23757
24224
  },
23758
- runtimeState: NumericSensorStatusSchema
24225
+ runtimeState: NumericSensorStatusSchema,
24226
+ /**
24227
+ * 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.
24228
+ *
24229
+ * See `RuntimeStateDurability`. Enforced by
24230
+ * `scripts/check-runtime-state-durability.ts`.
24231
+ */
24232
+ durability: "restored",
24233
+ /** Clock fields: written, but excluded from the compare that decides
24234
+ * whether persisting is worth a SQLite commit. */
24235
+ volatileStateFields: ["lastFetchedAt"]
23759
24236
  };
23760
24237
  /**
23761
24238
  * Generic on-screen-display (video overlay) cap. Each camera exposes
@@ -24140,7 +24617,14 @@ var petFeederCapability = {
24140
24617
  * the full slice via `device.state.petFeeder.value` and refresh on
24141
24618
  * every poll without re-querying the provider.
24142
24619
  */
24143
- runtimeState: PetFeederStatusSchema
24620
+ runtimeState: PetFeederStatusSchema,
24621
+ /**
24622
+ * Runtime-state durability: **session** — live appliance state re-published on connect.
24623
+ *
24624
+ * See `RuntimeStateDurability`. Enforced by
24625
+ * `scripts/check-runtime-state-durability.ts`.
24626
+ */
24627
+ durability: "session"
24144
24628
  };
24145
24629
  var VehicleSchema = object({
24146
24630
  id: string(),
@@ -24452,7 +24936,17 @@ var powerMeterCapability = {
24452
24936
  schema: PowerMeterStatusSchema,
24453
24937
  kind: "push"
24454
24938
  },
24455
- runtimeState: PowerMeterStatusSchema
24939
+ runtimeState: PowerMeterStatusSchema,
24940
+ /**
24941
+ * Runtime-state durability: **restored** — as `numeric-sensor`; `kwhTotal` is an accumulator whose restored value is the baseline.
24942
+ *
24943
+ * See `RuntimeStateDurability`. Enforced by
24944
+ * `scripts/check-runtime-state-durability.ts`.
24945
+ */
24946
+ durability: "restored",
24947
+ /** Clock fields: written, but excluded from the compare that decides
24948
+ * whether persisting is worth a SQLite commit. */
24949
+ volatileStateFields: ["lastFetchedAt"]
24456
24950
  };
24457
24951
  /**
24458
24952
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -24509,7 +25003,17 @@ var presenceCapability = {
24509
25003
  * the map pin is rendered (use `DeviceFeature.PresenceGps` for the
24510
25004
  * pre-fetch fast-path check).
24511
25005
  */
24512
- runtimeState: PresenceStatusSchema
25006
+ runtimeState: PresenceStatusSchema,
25007
+ /**
25008
+ * Runtime-state durability: **restored** — occupancy-relevant: the restored state is what an occupancy rule compares the first post-restart observation against.
25009
+ *
25010
+ * See `RuntimeStateDurability`. Enforced by
25011
+ * `scripts/check-runtime-state-durability.ts`.
25012
+ */
25013
+ durability: "restored",
25014
+ /** Clock fields: written, but excluded from the compare that decides
25015
+ * whether persisting is worth a SQLite commit. */
25016
+ volatileStateFields: ["lastChangedAt"]
24513
25017
  };
24514
25018
  /**
24515
25019
  * Atmospheric pressure reading in hectopascals. Drives Home Assistant
@@ -24545,7 +25049,17 @@ var pressureSensorCapability = {
24545
25049
  schema: PressureSensorStatusSchema,
24546
25050
  kind: "push"
24547
25051
  },
24548
- runtimeState: PressureSensorStatusSchema
25052
+ runtimeState: PressureSensorStatusSchema,
25053
+ /**
25054
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
25055
+ *
25056
+ * See `RuntimeStateDurability`. Enforced by
25057
+ * `scripts/check-runtime-state-durability.ts`.
25058
+ */
25059
+ durability: "restored",
25060
+ /** Clock fields: written, but excluded from the compare that decides
25061
+ * whether persisting is worth a SQLite commit. */
25062
+ volatileStateFields: ["lastFetchedAt"]
24549
25063
  };
24550
25064
  /**
24551
25065
  * PRIVACY — what the camera deliberately does not capture. Two planes:
@@ -24675,7 +25189,17 @@ var privacyMaskCapability = {
24675
25189
  schema: PrivacyMaskStatusSchema,
24676
25190
  kind: "poll"
24677
25191
  },
24678
- runtimeState: PrivacyMaskStatusSchema
25192
+ runtimeState: PrivacyMaskStatusSchema,
25193
+ /**
25194
+ * Runtime-state durability: **restored** — operator-drawn regions, zero real churn — 22 writes in 25 minutes, every one of them the clock.
25195
+ *
25196
+ * See `RuntimeStateDurability`. Enforced by
25197
+ * `scripts/check-runtime-state-durability.ts`.
25198
+ */
25199
+ durability: "restored",
25200
+ /** Clock fields: written, but excluded from the compare that decides
25201
+ * whether persisting is worth a SQLite commit. */
25202
+ volatileStateFields: ["lastFetchedAt"]
24679
25203
  };
24680
25204
  var PtzPresetSchema = object({
24681
25205
  id: string(),
@@ -24841,7 +25365,14 @@ var ptzAutotrackCapability = {
24841
25365
  * fetch / cache / fallback logic out of the four cap methods —
24842
25366
  * they become trampolines over `runtimeState`.
24843
25367
  */
24844
- runtimeState: PtzAutotrackRuntimeStateSchema
25368
+ runtimeState: PtzAutotrackRuntimeStateSchema,
25369
+ /**
25370
+ * Runtime-state durability: **session** — mirrors the camera's own autotrack config, re-read on connect.
25371
+ *
25372
+ * See `RuntimeStateDurability`. Enforced by
25373
+ * `scripts/check-runtime-state-durability.ts`.
25374
+ */
25375
+ durability: "session"
24845
25376
  };
24846
25377
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
24847
25378
  kind: "mutation",
@@ -25491,7 +26022,14 @@ var sceneMonitorCapability = {
25491
26022
  schema: SceneMonitorStatusSchema,
25492
26023
  kind: "push"
25493
26024
  },
25494
- runtimeState: SceneMonitorStatusSchema
26025
+ runtimeState: SceneMonitorStatusSchema,
26026
+ /**
26027
+ * Runtime-state durability: **session** — re-derived from the current scene on the next evaluation.
26028
+ *
26029
+ * See `RuntimeStateDurability`. Enforced by
26030
+ * `scripts/check-runtime-state-durability.ts`.
26031
+ */
26032
+ durability: "session"
25495
26033
  };
25496
26034
  /**
25497
26035
  * Per-stage gating mode applied to the zones a rule references.
@@ -25635,7 +26173,14 @@ var scriptRunnerCapability = {
25635
26173
  * `isRunning` to render a spinner during execution and surfaces
25636
26174
  * `lastError` / `lastRunSuccess` in the recent-runs panel.
25637
26175
  */
25638
- runtimeState: ScriptRunnerStatusSchema
26176
+ runtimeState: ScriptRunnerStatusSchema,
26177
+ /**
26178
+ * Runtime-state durability: **session** — a restored `isRunning: true` describes a process that died with the previous hub.
26179
+ *
26180
+ * See `RuntimeStateDurability`. Enforced by
26181
+ * `scripts/check-runtime-state-durability.ts`.
26182
+ */
26183
+ durability: "session"
25639
26184
  };
25640
26185
  /**
25641
26186
  * Smoke alarm sensor — boolean "is smoke currently detected" with
@@ -25662,7 +26207,17 @@ var smokeCapability = {
25662
26207
  schema: SmokeStatusSchema,
25663
26208
  kind: "push"
25664
26209
  },
25665
- runtimeState: SmokeStatusSchema
26210
+ runtimeState: SmokeStatusSchema,
26211
+ /**
26212
+ * Runtime-state durability: **restored** — a safety sensor must not read "clear" merely because the hub restarted.
26213
+ *
26214
+ * See `RuntimeStateDurability`. Enforced by
26215
+ * `scripts/check-runtime-state-durability.ts`.
26216
+ */
26217
+ durability: "restored",
26218
+ /** Clock fields: written, but excluded from the compare that decides
26219
+ * whether persisting is worth a SQLite commit. */
26220
+ volatileStateFields: ["lastChangedAt"]
25666
26221
  };
25667
26222
  /**
25668
26223
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -25835,7 +26390,17 @@ var streamParamsCapability = {
25835
26390
  schema: StreamParamsStatusSchema,
25836
26391
  kind: "poll"
25837
26392
  },
25838
- runtimeState: StreamParamsStatusSchema
26393
+ runtimeState: StreamParamsStatusSchema,
26394
+ /**
26395
+ * Runtime-state durability: **restored** — operator-set encoder profile; mutation-driven.
26396
+ *
26397
+ * See `RuntimeStateDurability`. Enforced by
26398
+ * `scripts/check-runtime-state-durability.ts`.
26399
+ */
26400
+ durability: "restored",
26401
+ /** Clock fields: written, but excluded from the compare that decides
26402
+ * whether persisting is worth a SQLite commit. */
26403
+ volatileStateFields: ["lastFetchedAt"]
25839
26404
  };
25840
26405
  /**
25841
26406
  * Generic on/off switch cap for accessory children (siren, floodlight,
@@ -25881,6 +26446,16 @@ var switchCapability = {
25881
26446
  * not need to re-query the provider after a setState mutation.
25882
26447
  */
25883
26448
  runtimeState: SwitchStatusSchema,
26449
+ /**
26450
+ * Runtime-state durability: **restored** — device state an operator reads as authoritative; 55 devices, transition-driven.
26451
+ *
26452
+ * See `RuntimeStateDurability`. Enforced by
26453
+ * `scripts/check-runtime-state-durability.ts`.
26454
+ */
26455
+ durability: "restored",
26456
+ /** Clock fields: written, but excluded from the compare that decides
26457
+ * whether persisting is worth a SQLite commit. */
26458
+ volatileStateFields: ["lastChangedAt"],
25884
26459
  settings: { bindings: [{
25885
26460
  kind: "scalar",
25886
26461
  statusPath: "on",
@@ -25960,7 +26535,17 @@ var tamperCapability = {
25960
26535
  schema: TamperStatusSchema,
25961
26536
  kind: "push"
25962
26537
  },
25963
- runtimeState: TamperStatusSchema
26538
+ runtimeState: TamperStatusSchema,
26539
+ /**
26540
+ * Runtime-state durability: **restored** — as `smoke`.
26541
+ *
26542
+ * See `RuntimeStateDurability`. Enforced by
26543
+ * `scripts/check-runtime-state-durability.ts`.
26544
+ */
26545
+ durability: "restored",
26546
+ /** Clock fields: written, but excluded from the compare that decides
26547
+ * whether persisting is worth a SQLite commit. */
26548
+ volatileStateFields: ["lastChangedAt"]
25964
26549
  };
25965
26550
  /**
25966
26551
  * Single-metric temperature reading. Drives Home Assistant `sensor`
@@ -26005,7 +26590,17 @@ var temperatureSensorCapability = {
26005
26590
  schema: TemperatureSensorStatusSchema,
26006
26591
  kind: "push"
26007
26592
  },
26008
- runtimeState: TemperatureSensorStatusSchema
26593
+ runtimeState: TemperatureSensorStatusSchema,
26594
+ /**
26595
+ * Runtime-state durability: **restored** — as `numeric-sensor` (69 of 125 writes were the clock alone).
26596
+ *
26597
+ * See `RuntimeStateDurability`. Enforced by
26598
+ * `scripts/check-runtime-state-durability.ts`.
26599
+ */
26600
+ durability: "restored",
26601
+ /** Clock fields: written, but excluded from the compare that decides
26602
+ * whether persisting is worth a SQLite commit. */
26603
+ volatileStateFields: ["lastFetchedAt"]
26009
26604
  };
26010
26605
  /**
26011
26606
  * toast — system-scoped singleton capability that streams toast
@@ -26074,7 +26669,14 @@ var updateCapability = {
26074
26669
  schema: UpdateStatusSchema,
26075
26670
  kind: "poll"
26076
26671
  },
26077
- runtimeState: UpdateStatusSchema
26672
+ runtimeState: UpdateStatusSchema,
26673
+ /**
26674
+ * Runtime-state durability: **session** — a restored `inProgress: true` describes an update that is no longer running; versions are re-probed at boot.
26675
+ *
26676
+ * See `RuntimeStateDurability`. Enforced by
26677
+ * `scripts/check-runtime-state-durability.ts`.
26678
+ */
26679
+ durability: "session"
26078
26680
  };
26079
26681
  var UserSummarySchema = object({
26080
26682
  id: string(),
@@ -26408,7 +27010,14 @@ var vacuumControlCapability = {
26408
27010
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26409
27011
  * slice for live state + battery + fan-speed changes.
26410
27012
  */
26411
- runtimeState: VacuumControlStatusSchema
27013
+ runtimeState: VacuumControlStatusSchema,
27014
+ /**
27015
+ * Runtime-state durability: **session** — as `media-player` — a restored `state: cleaning` is a robot that is not cleaning.
27016
+ *
27017
+ * See `RuntimeStateDurability`. Enforced by
27018
+ * `scripts/check-runtime-state-durability.ts`.
27019
+ */
27020
+ durability: "session"
26412
27021
  };
26413
27022
  var ValveStatusSchema = object({
26414
27023
  /** Lifecycle state of the valve. */
@@ -26460,7 +27069,14 @@ var valveCapability = {
26460
27069
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26461
27070
  * slice for live position changes during a move.
26462
27071
  */
26463
- runtimeState: ValveStatusSchema
27072
+ runtimeState: ValveStatusSchema,
27073
+ /**
27074
+ * Runtime-state durability: **session** — as `brightness`.
27075
+ *
27076
+ * See `RuntimeStateDurability`. Enforced by
27077
+ * `scripts/check-runtime-state-durability.ts`.
27078
+ */
27079
+ durability: "session"
26464
27080
  };
26465
27081
  /**
26466
27082
  * Vibration / shake / impact sensor. Drives Home Assistant
@@ -26482,7 +27098,17 @@ var vibrationCapability = {
26482
27098
  schema: VibrationStatusSchema,
26483
27099
  kind: "push"
26484
27100
  },
26485
- runtimeState: VibrationStatusSchema
27101
+ runtimeState: VibrationStatusSchema,
27102
+ /**
27103
+ * Runtime-state durability: **restored** — as `smoke`.
27104
+ *
27105
+ * See `RuntimeStateDurability`. Enforced by
27106
+ * `scripts/check-runtime-state-durability.ts`.
27107
+ */
27108
+ durability: "restored",
27109
+ /** Clock fields: written, but excluded from the compare that decides
27110
+ * whether persisting is worth a SQLite commit. */
27111
+ volatileStateFields: ["lastChangedAt"]
26486
27112
  };
26487
27113
  /**
26488
27114
  * Water heater / boiler cap. Models HA `water_heater.*` entities — a
@@ -26556,7 +27182,14 @@ var waterHeaterCapability = {
26556
27182
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26557
27183
  * slice for live temperature / mode / away changes.
26558
27184
  */
26559
- runtimeState: WaterHeaterStatusSchema
27185
+ runtimeState: WaterHeaterStatusSchema,
27186
+ /**
27187
+ * Runtime-state durability: **session** — as `climate-control`.
27188
+ *
27189
+ * See `RuntimeStateDurability`. Enforced by
27190
+ * `scripts/check-runtime-state-durability.ts`.
27191
+ */
27192
+ durability: "session"
26560
27193
  };
26561
27194
  /**
26562
27195
  * Weather provider cap. Models HA `weather.*` entities — a read-only
@@ -26615,7 +27248,14 @@ var weatherCapability = {
26615
27248
  * Runtime-state slice — mirrored by the kernel. The UI reads the
26616
27249
  * current conditions directly from the slice on each weather push.
26617
27250
  */
26618
- runtimeState: WeatherStatusSchema
27251
+ runtimeState: WeatherStatusSchema,
27252
+ /**
27253
+ * Runtime-state durability: **session** — a forecast is stale the moment the hub is down; the provider re-fetches on connect.
27254
+ *
27255
+ * See `RuntimeStateDurability`. Enforced by
27256
+ * `scripts/check-runtime-state-durability.ts`.
27257
+ */
27258
+ durability: "session"
26619
27259
  };
26620
27260
  /**
26621
27261
  * Per-zone occupancy aggregation produced by the analytics frame
@@ -26777,7 +27417,14 @@ var zoneAnalyticsCapability = {
26777
27417
  * automatically; the explicit `getCurrentSnapshot` cap method is
26778
27418
  * still useful for one-off polls without a subscription.
26779
27419
  */
26780
- runtimeState: CameraOccupancySnapshotSchema
27420
+ runtimeState: CameraOccupancySnapshotSchema,
27421
+ /**
27422
+ * Runtime-state durability: **session** — per-frame analytics; with `audio-metrics` it is ~90 % of the offered write rate. Re-derived on the next frame.
27423
+ *
27424
+ * See `RuntimeStateDurability`. Enforced by
27425
+ * `scripts/check-runtime-state-durability.ts`.
27426
+ */
27427
+ durability: "session"
26781
27428
  };
26782
27429
  /**
26783
27430
  * Stages a {@link ZoneRule} can apply to. Discriminator on the rules
@@ -26855,7 +27502,14 @@ var zoneRulesCapability = {
26855
27502
  motion: array(ZoneRuleSchema).readonly(),
26856
27503
  detection: array(ZoneRuleSchema).readonly(),
26857
27504
  package: array(ZoneRuleSchema).readonly()
26858
- })
27505
+ }),
27506
+ /**
27507
+ * Runtime-state durability: **restored** — operator intent, mutation-only, same argument as `zones`.
27508
+ *
27509
+ * See `RuntimeStateDurability`. Enforced by
27510
+ * `scripts/check-runtime-state-durability.ts`.
27511
+ */
27512
+ durability: "restored"
26859
27513
  };
26860
27514
  /**
26861
27515
  * Accessory device helpers — shared across drivers.
@@ -33542,6 +34196,7 @@ Object.freeze({
33542
34196
  "network-access": "ingress",
33543
34197
  "smtp-provider": "email"
33544
34198
  });
34199
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
33545
34200
  new Set(["devices", "classes"]);
33546
34201
  /**
33547
34202
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.