@camstack/addon-provider-reolink 1.2.24 → 1.2.26

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 +731 -76
  2. package/dist/addon.mjs +731 -76
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -10971,7 +10971,14 @@ var cameraStreamsCapability = {
10971
10971
  low: string().optional()
10972
10972
  }),
10973
10973
  lastChangedAt: number()
10974
- })
10974
+ }),
10975
+ /**
10976
+ * 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.
10977
+ *
10978
+ * See `RuntimeStateDurability`. Enforced by
10979
+ * `scripts/check-runtime-state-durability.ts`.
10980
+ */
10981
+ durability: "session"
10975
10982
  };
10976
10983
  /** Where a block runs. The operator chooses — a block driving a device on an
10977
10984
  * agent is the reason placement is not fixed to the hub. */
@@ -11544,6 +11551,13 @@ var deviceDiscoveryCapability = {
11544
11551
  kind: "poll"
11545
11552
  },
11546
11553
  runtimeState: DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: number().int().nonnegative() }),
11554
+ /**
11555
+ * Runtime-state durability: **session** — 5.7 KB of scan output on the largest device, fully re-derivable by re-scanning.
11556
+ *
11557
+ * See `RuntimeStateDurability`. Enforced by
11558
+ * `scripts/check-runtime-state-durability.ts`.
11559
+ */
11560
+ durability: "session",
11547
11561
  methods: {
11548
11562
  /**
11549
11563
  * Snapshot of the current `discovered` list. Returns the
@@ -13413,11 +13427,33 @@ var NotificationFormatSchema = _enum([
13413
13427
  * Named by INTENT, never by glyph. "check" would tie the vocabulary to one
13414
13428
  * renderer's icon set; "acknowledge" survives an adapter that draws it
13415
13429
  * differently.
13430
+ *
13431
+ * ── A TOKEN IS NOT A WIRE VALUE ─────────────────────────────────────
13432
+ *
13433
+ * These names are for US. **No adapter may forward one verbatim.** Each maps
13434
+ * the whole set onto its own renderer's vocabulary through a
13435
+ * `Record<NotificationActionIcon, string>` — a Record, never a lookup with a
13436
+ * fallback, so adding a member here fails every adapter's build until someone
13437
+ * decides its glyph, which is the only place that decision can be made
13438
+ * honestly.
13439
+ *
13440
+ * This paragraph is the bug. Zentik declared `actionIcons: true` and passed
13441
+ * `disarm` straight through; iOS feeds that string to
13442
+ * `UNNotificationActionIcon(systemImageName:)`, `disarm` is not an SF Symbol,
13443
+ * and every snooze and alarm button arrived BLANK. A pass-through is not a
13444
+ * mapping, and "the field is documented" is not "the value renders".
13445
+ *
13446
+ * Adding a member is TRAIN-BOUND. The enum lives in the published
13447
+ * `@camstack/server` closure and the cap seam validates against the HUB's copy,
13448
+ * so an addon that emits a token the running hub does not know does not lose an
13449
+ * icon — its whole `send` fails Zod validation and the notification never
13450
+ * arrives. Never emit a new token from an addon before the train carrying it.
13416
13451
  */
13417
13452
  var NotificationActionIconSchema = _enum([
13418
13453
  "acknowledge",
13419
13454
  "dismiss",
13420
13455
  "silence",
13456
+ "snooze",
13421
13457
  "view",
13422
13458
  "play",
13423
13459
  "open",
@@ -13425,9 +13461,13 @@ var NotificationActionIconSchema = _enum([
13425
13461
  "lock",
13426
13462
  "unlock",
13427
13463
  "arm",
13464
+ "arm-home",
13465
+ "arm-away",
13466
+ "arm-night",
13428
13467
  "disarm",
13429
13468
  "light",
13430
- "alert"
13469
+ "alert",
13470
+ "camera"
13431
13471
  ]);
13432
13472
  /** A single tap-through action button. */
13433
13473
  var NotificationActionSchema = object({
@@ -13443,7 +13483,23 @@ var NotificationActionSchema = object({
13443
13483
  * else — see `notification-center/action-token.ts` for what that does and
13444
13484
  * does not buy.
13445
13485
  */
13446
- destructive: boolean().optional()
13486
+ destructive: boolean().optional(),
13487
+ /**
13488
+ * How the tap should REACH the url.
13489
+ *
13490
+ * `navigate` (absent, and every button authored before this field) opens it:
13491
+ * the phone leaves the notification and shows whatever the callback returns.
13492
+ * That is right for a button whose answer the operator wants to read.
13493
+ *
13494
+ * `background` fires it as a POST and stays put. It exists for the buttons
13495
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13496
+ * an answer to the notification, and being thrown into a browser tab to
13497
+ * confirm it costs more attention than the notification did. A backend that
13498
+ * cannot do a background call renders it as an ordinary link (the adapters
13499
+ * fall back rather than dropping the button), so this is a preference, never
13500
+ * a requirement.
13501
+ */
13502
+ mode: _enum(["navigate", "background"]).optional()
13447
13503
  });
13448
13504
  /**
13449
13505
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -13611,6 +13667,24 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
13611
13667
  targetId: string(),
13612
13668
  enabled: boolean()
13613
13669
  }), _void(), { kind: "mutation" });
13670
+ new Set([
13671
+ {
13672
+ id: "person",
13673
+ name: "Person"
13674
+ },
13675
+ {
13676
+ id: "vehicle",
13677
+ name: "Vehicle"
13678
+ },
13679
+ {
13680
+ id: "animal",
13681
+ name: "Animal"
13682
+ },
13683
+ {
13684
+ id: "package",
13685
+ name: "Package"
13686
+ }
13687
+ ].map((l) => l.id));
13614
13688
  var COCO_TO_MACRO = {
13615
13689
  mapping: {
13616
13690
  person: "person",
@@ -14295,7 +14369,17 @@ var alarmPanelCapability = {
14295
14369
  * full slice; renders an arm button per `availableModes` entry and
14296
14370
  * a PIN field iff `requiresCode === true`.
14297
14371
  */
14298
- runtimeState: AlarmPanelStatusSchema
14372
+ runtimeState: AlarmPanelStatusSchema,
14373
+ /**
14374
+ * Runtime-state durability: **restored** — armed state is the one thing a panel must not lose across a restart.
14375
+ *
14376
+ * See `RuntimeStateDurability`. Enforced by
14377
+ * `scripts/check-runtime-state-durability.ts`.
14378
+ */
14379
+ durability: "restored",
14380
+ /** Clock fields: written, but excluded from the compare that decides
14381
+ * whether persisting is worth a SQLite commit. */
14382
+ volatileStateFields: ["lastChangedAt"]
14299
14383
  };
14300
14384
  /**
14301
14385
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
@@ -14436,6 +14520,8 @@ var NcSystemEventKindSchema = _enum([
14436
14520
  "alarm-triggered",
14437
14521
  "alarm-armed",
14438
14522
  "alarm-disarmed",
14523
+ "alarm-arming",
14524
+ "alarm-arm-refused",
14439
14525
  "camera-online",
14440
14526
  "camera-offline",
14441
14527
  "camera-disabled",
@@ -14472,6 +14558,9 @@ var NcSystemEventConditionSchema = object({
14472
14558
  nodeIds: array(string().min(1)).min(1).optional(),
14473
14559
  packageNames: array(string().min(1)).min(1).optional()
14474
14560
  });
14561
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14562
+ * outage the operator asked for once and forgot. */
14563
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14475
14564
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14476
14565
  var NcScheduleSchema = object({
14477
14566
  windows: array(object({
@@ -14848,15 +14937,15 @@ var NcConditionsSchema = object({
14848
14937
  * (an `immediate` rule naming an `audio-*` class, one notification per
14849
14938
  * classified sample) stays exactly as it was for rules that already use it.
14850
14939
  *
14851
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14852
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14853
- * (`camstack/src/data/notification-center.ts`, guarded by
14854
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14940
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14941
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14942
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14943
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14855
14944
  * condition fields it does not know when a rule is saved from the phone.
14856
14945
  * Publishing an editor for a condition the app cannot round-trip is how an
14857
- * operator loses a rule's conditions by opening it — so the descriptor, the
14858
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14859
- * does an audio rule become authorable.
14946
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14947
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14948
+ * follows here.
14860
14949
  */
14861
14950
  audio: NcAudioConditionSchema.optional()
14862
14951
  });
@@ -15092,6 +15181,30 @@ var NcRuleInputSchema = object({
15092
15181
  */
15093
15182
  snoozeAllowGlobal: boolean().optional(),
15094
15183
  /**
15184
+ * The snooze durations THIS rule's notification offers as buttons, in
15185
+ * minutes.
15186
+ *
15187
+ * Three states, and all three are distinct — which is exactly why this is
15188
+ * `.optional()` and never `.default()`. A Zod default does not run on the
15189
+ * addon cap path (three production failures in one day), so a schema default
15190
+ * would collapse the first two:
15191
+ *
15192
+ * | value | meaning |
15193
+ * | --- | --- |
15194
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
15195
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
15196
+ * | a list | these choices, de-duplicated and sorted, at most four |
15197
+ *
15198
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
15199
+ * three buttons in total) and a rule that spent it all on snooze choices
15200
+ * would push its own tap-through actions off the notification.
15201
+ *
15202
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
15203
+ * that arms the panel, is exempt automatically and cannot be silenced by a
15204
+ * window from anywhere (D133).
15205
+ */
15206
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
15207
+ /**
15095
15208
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
15096
15209
  *
15097
15210
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -15191,6 +15304,7 @@ var NcConditionDescriptorSchema = object({
15191
15304
  "device",
15192
15305
  "package",
15193
15306
  "occupancy",
15307
+ "audio",
15194
15308
  "system"
15195
15309
  ]),
15196
15310
  label: string(),
@@ -15209,6 +15323,7 @@ var NcConditionDescriptorSchema = object({
15209
15323
  "crossingSelect",
15210
15324
  "polygonDraw",
15211
15325
  "occupancy",
15326
+ "audio",
15212
15327
  "deviceState",
15213
15328
  "systemEvent"
15214
15329
  ]),
@@ -15360,7 +15475,20 @@ var NcSnoozeInputSchema = object({
15360
15475
  ruleId: string().optional(),
15361
15476
  /** Required when `scope: 'device'`. */
15362
15477
  deviceId: number().int().optional(),
15363
- durationMinutes: number().int().min(1).max(1440),
15478
+ /**
15479
+ * Narrow the window to these subject classes — "the cat, not the person".
15480
+ *
15481
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15482
+ * what every window authored before this field meant, so no persisted row
15483
+ * changes meaning and no client has to learn anything to keep working.
15484
+ *
15485
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15486
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15487
+ * not at whichever of their four rules happened to produce the notification
15488
+ * they are dismissing.
15489
+ */
15490
+ classes: array(string().min(1)).min(1).optional(),
15491
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
15364
15492
  /**
15365
15493
  * Silence this for EVERY recipient, not just the caller. Permission is
15366
15494
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15385,6 +15513,10 @@ var NcSnoozeSchema = object({
15385
15513
  scope: NcSnoozeScopeSchema,
15386
15514
  ruleId: string().optional(),
15387
15515
  deviceId: number().int().optional(),
15516
+ /** Subject classes this window covers. ABSENT = every class — see
15517
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15518
+ * no SQLite column: nothing queries a window by class. */
15519
+ classes: array(string().min(1)).min(1).optional(),
15388
15520
  startedAt: number(),
15389
15521
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15390
15522
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -17485,7 +17617,14 @@ var zonesCapability = {
17485
17617
  * handle. Slice shape is `{ zones: Zone[] }` so future extensions
17486
17618
  * (e.g. zone groupings) can sit alongside the polygon list.
17487
17619
  */
17488
- runtimeState: object({ zones: array(ZoneSchema).readonly() })
17620
+ runtimeState: object({ zones: array(ZoneSchema).readonly() }),
17621
+ /**
17622
+ * 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.
17623
+ *
17624
+ * See `RuntimeStateDurability`. Enforced by
17625
+ * `scripts/check-runtime-state-durability.ts`.
17626
+ */
17627
+ durability: "restored"
17489
17628
  };
17490
17629
  /**
17491
17630
  * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
@@ -17655,6 +17794,22 @@ var detectionFpsField = {
17655
17794
  default: 10,
17656
17795
  step: 1
17657
17796
  };
17797
+ /**
17798
+ * The occupancy re-check interval. DEFAULT 300 s (2026-08-13 — was 30 s).
17799
+ *
17800
+ * The recheck is now on by default (a parked car is invisible to occupancy
17801
+ * rules until the stationary registry has been rebuilt by motion, which after a
17802
+ * restart may be never on a quiet camera). Each cycle re-subscribes a detection
17803
+ * session — an RTSP re-dial — so the switch is only affordable at a WIDE
17804
+ * interval: 300 s is ~12 re-dials an hour per camera, against 120 at the old
17805
+ * 30 s. A parked car is therefore counted within 5 minutes of a restart.
17806
+ *
17807
+ * Why not wider: `max` is 300 and raising it is TRAIN-BOUND, not addon-bound —
17808
+ * the host validates `attachCamera` against ITS copy of this schema, so a
17809
+ * runner asked for 600 would be rejected by the hub until a `@camstack/server`
17810
+ * carrying the wider bound is installed everywhere. 300 is the widest value
17811
+ * that ships with an addon deploy.
17812
+ */
17658
17813
  var occupancyRecheckSecField = {
17659
17814
  min: 0,
17660
17815
  max: 300,
@@ -17856,15 +18011,21 @@ var RunnerCameraConfigSchema = object({
17856
18011
  */
17857
18012
  onboardMotionDrivesAnalyzer: boolean().default(true),
17858
18013
  /**
17859
- * Master toggle for the occupancy re-check. When `false` (DEFAULT) the runner
17860
- * never arms the periodic recheck timer, regardless of `occupancyRecheckSec`
17861
- * this is off by default because the recheck re-subscribes a detection session
17862
- * every N seconds while `watching`, a major source of pull-decoder re-dial
17863
- * churn (each cycle creates+tears a session → RTSP re-dial → latency). The
18014
+ * Master toggle for the occupancy re-check. When `false` the runner never arms
18015
+ * the periodic recheck timer, regardless of `occupancyRecheckSec`; the
17864
18016
  * `occupancyRecheckSec` / `occupancyRecheckFrames` sliders only take effect
17865
18017
  * (and only render) when this is enabled.
18018
+ *
18019
+ * DEFAULT `true` since 2026-08-13 (was `false`). It was off because the
18020
+ * recheck re-subscribes a detection session every N seconds while `watching`
18021
+ * — each cycle creates+tears a session ⇒ an RTSP re-dial ⇒ latency, a major
18022
+ * pull-decoder churn source. What that bought was a blind spot: a STATIONARY
18023
+ * object is counted only while the stationary registry holds it, and the
18024
+ * registry rebuilds from motion, so after a restart a parked car was invisible
18025
+ * to every occupancy rule until something moved in front of it. The churn is
18026
+ * now paid on the interval instead — see `occupancyRecheckSecField`.
17866
18027
  */
17867
- occupancyRecheckEnabled: boolean().default(false),
18028
+ occupancyRecheckEnabled: boolean().default(true),
17868
18029
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
17869
18030
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
17870
18031
  /**
@@ -20379,7 +20540,17 @@ var airQualitySensorCapability = {
20379
20540
  schema: AirQualitySensorStatusSchema,
20380
20541
  kind: "push"
20381
20542
  },
20382
- runtimeState: AirQualitySensorStatusSchema
20543
+ runtimeState: AirQualitySensorStatusSchema,
20544
+ /**
20545
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20546
+ *
20547
+ * See `RuntimeStateDurability`. Enforced by
20548
+ * `scripts/check-runtime-state-durability.ts`.
20549
+ */
20550
+ durability: "restored",
20551
+ /** Clock fields: written, but excluded from the compare that decides
20552
+ * whether persisting is worth a SQLite commit. */
20553
+ volatileStateFields: ["lastFetchedAt"]
20383
20554
  };
20384
20555
  /**
20385
20556
  * Ambient illuminance reading in lux. Drives Home Assistant `sensor`
@@ -20411,7 +20582,17 @@ var ambientLightSensorCapability = {
20411
20582
  schema: AmbientLightSensorStatusSchema,
20412
20583
  kind: "push"
20413
20584
  },
20414
- runtimeState: AmbientLightSensorStatusSchema
20585
+ runtimeState: AmbientLightSensorStatusSchema,
20586
+ /**
20587
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20588
+ *
20589
+ * See `RuntimeStateDurability`. Enforced by
20590
+ * `scripts/check-runtime-state-durability.ts`.
20591
+ */
20592
+ durability: "restored",
20593
+ /** Clock fields: written, but excluded from the compare that decides
20594
+ * whether persisting is worth a SQLite commit. */
20595
+ volatileStateFields: ["lastFetchedAt"]
20415
20596
  };
20416
20597
  /**
20417
20598
  * Per-class audio metrics aggregated over a sliding window.
@@ -20529,7 +20710,14 @@ var audioMetricsCapability = {
20529
20710
  }), AudioMetricsHistorySchema)
20530
20711
  },
20531
20712
  /** Reactive runtime-state mirror — live `device.state.audioMetrics.value`. */
20532
- runtimeState: AudioMetricsSnapshotSchema
20713
+ runtimeState: AudioMetricsSnapshotSchema,
20714
+ /**
20715
+ * 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.
20716
+ *
20717
+ * See `RuntimeStateDurability`. Enforced by
20718
+ * `scripts/check-runtime-state-durability.ts`.
20719
+ */
20720
+ durability: "session"
20533
20721
  };
20534
20722
  /**
20535
20723
  * Automation-control cap. Models HA `automation.*` entities on
@@ -20591,7 +20779,14 @@ var automationControlCapability = {
20591
20779
  * reads `enabled` (toggle) + `isRunning` (spinner) + `lastError`
20592
20780
  * (badge) directly.
20593
20781
  */
20594
- runtimeState: AutomationControlStatusSchema
20782
+ runtimeState: AutomationControlStatusSchema,
20783
+ /**
20784
+ * 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.
20785
+ *
20786
+ * See `RuntimeStateDurability`. Enforced by
20787
+ * `scripts/check-runtime-state-durability.ts`.
20788
+ */
20789
+ durability: "session"
20595
20790
  };
20596
20791
  /**
20597
20792
  * Battery status snapshot. Emitted by providers whose device is
@@ -20697,7 +20892,17 @@ onStatusChanged: { data: object({
20697
20892
  * via `device.runtimeState.getCapState('battery')` regardless of
20698
20893
  * the underlying driver.
20699
20894
  */
20700
- runtimeState: BatteryStatusSchema
20895
+ runtimeState: BatteryStatusSchema,
20896
+ /**
20897
+ * 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.
20898
+ *
20899
+ * See `RuntimeStateDurability`. Enforced by
20900
+ * `scripts/check-runtime-state-durability.ts`.
20901
+ */
20902
+ durability: "restored",
20903
+ /** Clock fields: written, but excluded from the compare that decides
20904
+ * whether persisting is worth a SQLite commit. */
20905
+ volatileStateFields: ["lastUpdated"]
20701
20906
  };
20702
20907
  /**
20703
20908
  * Generic boolean sensor — last-resort fallback when no domain-
@@ -20726,7 +20931,17 @@ var binaryCapability = {
20726
20931
  schema: BinaryStatusSchema,
20727
20932
  kind: "push"
20728
20933
  },
20729
- runtimeState: BinaryStatusSchema
20934
+ runtimeState: BinaryStatusSchema,
20935
+ /**
20936
+ * Runtime-state durability: **restored** — transition-driven sensor state; the restored value gives the boot comparison.
20937
+ *
20938
+ * See `RuntimeStateDurability`. Enforced by
20939
+ * `scripts/check-runtime-state-durability.ts`.
20940
+ */
20941
+ durability: "restored",
20942
+ /** Clock fields: written, but excluded from the compare that decides
20943
+ * whether persisting is worth a SQLite commit. */
20944
+ volatileStateFields: ["lastChangedAt"]
20730
20945
  };
20731
20946
  /**
20732
20947
  * Dimmable-light brightness control. Co-exists with `switch` on the
@@ -20779,7 +20994,14 @@ onBrightnessChanged: { data: object({
20779
20994
  * by the kernel. Read via `device.state.brightness.value` so UI
20780
20995
  * sliders surface the current level without polling the provider.
20781
20996
  */
20782
- runtimeState: BrightnessStatusSchema
20997
+ runtimeState: BrightnessStatusSchema,
20998
+ /**
20999
+ * Runtime-state durability: **session** — live lamp state, re-published by the provider on connect.
21000
+ *
21001
+ * See `RuntimeStateDurability`. Enforced by
21002
+ * `scripts/check-runtime-state-durability.ts`.
21003
+ */
21004
+ durability: "session"
20783
21005
  };
20784
21006
  DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
20785
21007
  kind: "mutation",
@@ -20867,7 +21089,17 @@ var carbonMonoxideCapability = {
20867
21089
  schema: CarbonMonoxideStatusSchema,
20868
21090
  kind: "push"
20869
21091
  },
20870
- runtimeState: CarbonMonoxideStatusSchema
21092
+ runtimeState: CarbonMonoxideStatusSchema,
21093
+ /**
21094
+ * Runtime-state durability: **restored** — as `smoke`.
21095
+ *
21096
+ * See `RuntimeStateDurability`. Enforced by
21097
+ * `scripts/check-runtime-state-durability.ts`.
21098
+ */
21099
+ durability: "restored",
21100
+ /** Clock fields: written, but excluded from the compare that decides
21101
+ * whether persisting is worth a SQLite commit. */
21102
+ volatileStateFields: ["lastChangedAt"]
20871
21103
  };
20872
21104
  /**
20873
21105
  * HVAC / climate control cap. Models the full surface of a HA
@@ -21027,7 +21259,14 @@ var climateControlCapability = {
21027
21259
  * the full slice via `device.state.climate-control.value` and refresh
21028
21260
  * on every push without re-querying the provider.
21029
21261
  */
21030
- runtimeState: ClimateControlStatusSchema
21262
+ runtimeState: ClimateControlStatusSchema,
21263
+ /**
21264
+ * Runtime-state durability: **session** — as `brightness`; `currentTemp` moves continuously and is re-published on connect.
21265
+ *
21266
+ * See `RuntimeStateDurability`. Enforced by
21267
+ * `scripts/check-runtime-state-durability.ts`.
21268
+ */
21269
+ durability: "session"
21031
21270
  };
21032
21271
  /**
21033
21272
  * Color-light cap. Coexists with `switch` (on/off) and `brightness`
@@ -21137,7 +21376,14 @@ onColorChanged: { data: object({
21137
21376
  * kernel. Read via `device.state.color.value` so UI pickers surface
21138
21377
  * the current chromaticity without polling the provider.
21139
21378
  */
21140
- runtimeState: ColorStatusSchema
21379
+ runtimeState: ColorStatusSchema,
21380
+ /**
21381
+ * Runtime-state durability: **session** — as `brightness`.
21382
+ *
21383
+ * See `RuntimeStateDurability`. Enforced by
21384
+ * `scripts/check-runtime-state-durability.ts`.
21385
+ */
21386
+ durability: "session"
21141
21387
  };
21142
21388
  var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
21143
21389
  object({
@@ -21195,7 +21441,17 @@ var connectivityCapability = {
21195
21441
  schema: ConnectivityStatusSchema,
21196
21442
  kind: "push"
21197
21443
  },
21198
- runtimeState: ConnectivityStatusSchema
21444
+ runtimeState: ConnectivityStatusSchema,
21445
+ /**
21446
+ * Runtime-state durability: **restored** — same shape and same argument as `device-status`, for links rather than devices.
21447
+ *
21448
+ * See `RuntimeStateDurability`. Enforced by
21449
+ * `scripts/check-runtime-state-durability.ts`.
21450
+ */
21451
+ durability: "restored",
21452
+ /** Clock fields: written, but excluded from the compare that decides
21453
+ * whether persisting is worth a SQLite commit. */
21454
+ volatileStateFields: ["lastChangedAt"]
21199
21455
  };
21200
21456
  /**
21201
21457
  * Generic device-consumables capability — surfaces a device's
@@ -21277,7 +21533,14 @@ reset: method(object({
21277
21533
  }
21278
21534
  }
21279
21535
  },
21280
- runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() })
21536
+ runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() }),
21537
+ /**
21538
+ * Runtime-state durability: **session** — the authority is the appliance; the provider re-reads the whole item array on connect.
21539
+ *
21540
+ * See `RuntimeStateDurability`. Enforced by
21541
+ * `scripts/check-runtime-state-durability.ts`.
21542
+ */
21543
+ durability: "session"
21281
21544
  };
21282
21545
  /**
21283
21546
  * Door / window / opening / garage / valve contact sensor. Boolean
@@ -21308,7 +21571,17 @@ var contactCapability = {
21308
21571
  schema: ContactStatusSchema,
21309
21572
  kind: "push"
21310
21573
  },
21311
- runtimeState: ContactStatusSchema
21574
+ runtimeState: ContactStatusSchema,
21575
+ /**
21576
+ * Runtime-state durability: **restored** — a door left open across a restart must still read open.
21577
+ *
21578
+ * See `RuntimeStateDurability`. Enforced by
21579
+ * `scripts/check-runtime-state-durability.ts`.
21580
+ */
21581
+ durability: "restored",
21582
+ /** Clock fields: written, but excluded from the compare that decides
21583
+ * whether persisting is worth a SQLite commit. */
21584
+ volatileStateFields: ["lastChangedAt"]
21312
21585
  };
21313
21586
  /**
21314
21587
  * Status slice — flat object (the framework's `runtimeState` contract
@@ -21414,7 +21687,14 @@ var controlCapability = {
21414
21687
  * dropdown / text field / date picker) read the slice's discriminant
21415
21688
  * and value directly without polling the provider.
21416
21689
  */
21417
- runtimeState: ControlStatusSchema
21690
+ runtimeState: ControlStatusSchema,
21691
+ /**
21692
+ * Runtime-state durability: **session** — a generic control mirrors an external entity that re-publishes on connect; the options array is re-derived with it.
21693
+ *
21694
+ * See `RuntimeStateDurability`. Enforced by
21695
+ * `scripts/check-runtime-state-durability.ts`.
21696
+ */
21697
+ durability: "session"
21418
21698
  };
21419
21699
  var CoverStatusSchema = object({
21420
21700
  /** Lifecycle state of the cover. */
@@ -21475,7 +21755,17 @@ var coverCapability = {
21475
21755
  * Runtime-state slice — mirrored by the kernel. UI controls watch
21476
21756
  * the slice for live position changes during a move.
21477
21757
  */
21478
- runtimeState: CoverStatusSchema
21758
+ runtimeState: CoverStatusSchema,
21759
+ /**
21760
+ * Runtime-state durability: **restored** — position survives a restart on the device; the mirror should agree at boot rather than read blank.
21761
+ *
21762
+ * See `RuntimeStateDurability`. Enforced by
21763
+ * `scripts/check-runtime-state-durability.ts`.
21764
+ */
21765
+ durability: "restored",
21766
+ /** Clock fields: written, but excluded from the compare that decides
21767
+ * whether persisting is worth a SQLite commit. */
21768
+ volatileStateFields: ["lastChangedAt"]
21479
21769
  };
21480
21770
  /**
21481
21771
  * Vendor-neutral day/night (IR-cut) control — the per-camera config cap
@@ -21569,7 +21859,17 @@ var dayNightCapability = {
21569
21859
  schema: DayNightStatusSchema,
21570
21860
  kind: "poll"
21571
21861
  },
21572
- runtimeState: DayNightStatusSchema
21862
+ runtimeState: DayNightStatusSchema,
21863
+ /**
21864
+ * Runtime-state durability: **restored** — operator-set IR-cut behaviour; mutation-driven.
21865
+ *
21866
+ * See `RuntimeStateDurability`. Enforced by
21867
+ * `scripts/check-runtime-state-durability.ts`.
21868
+ */
21869
+ durability: "restored",
21870
+ /** Clock fields: written, but excluded from the compare that decides
21871
+ * whether persisting is worth a SQLite commit. */
21872
+ volatileStateFields: ["lastFetchedAt"]
21573
21873
  };
21574
21874
  /**
21575
21875
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
@@ -21616,7 +21916,17 @@ onStatusChanged: { data: object({
21616
21916
  schema: DeviceStatusSchema,
21617
21917
  kind: "push"
21618
21918
  },
21619
- runtimeState: DeviceStatusSchema
21919
+ runtimeState: DeviceStatusSchema,
21920
+ /**
21921
+ * 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.
21922
+ *
21923
+ * See `RuntimeStateDurability`. Enforced by
21924
+ * `scripts/check-runtime-state-durability.ts`.
21925
+ */
21926
+ durability: "restored",
21927
+ /** Clock fields: written, but excluded from the compare that decides
21928
+ * whether persisting is worth a SQLite commit. */
21929
+ volatileStateFields: ["lastChangedAt"]
21620
21930
  };
21621
21931
  /**
21622
21932
  * Doorbell button cap. Two kinds of providers coexist behind this cap
@@ -21678,7 +21988,14 @@ onPressed: { data: DoorbellPressEventSchema } },
21678
21988
  * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
21679
21989
  * without subscribing.
21680
21990
  */
21681
- runtimeState: DoorbellStatusSchema
21991
+ runtimeState: DoorbellStatusSchema,
21992
+ /**
21993
+ * 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.
21994
+ *
21995
+ * See `RuntimeStateDurability`. Enforced by
21996
+ * `scripts/check-runtime-state-durability.ts`.
21997
+ */
21998
+ durability: "restored"
21682
21999
  };
21683
22000
  /**
21684
22001
  * Enum-state sensor — a string value picked from a finite option set.
@@ -21718,7 +22035,17 @@ var enumSensorCapability = {
21718
22035
  schema: EnumSensorStatusSchema,
21719
22036
  kind: "push"
21720
22037
  },
21721
- runtimeState: EnumSensorStatusSchema
22038
+ runtimeState: EnumSensorStatusSchema,
22039
+ /**
22040
+ * Runtime-state durability: **restored** — as `numeric-sensor`; 80 devices.
22041
+ *
22042
+ * See `RuntimeStateDurability`. Enforced by
22043
+ * `scripts/check-runtime-state-durability.ts`.
22044
+ */
22045
+ durability: "restored",
22046
+ /** Clock fields: written, but excluded from the compare that decides
22047
+ * whether persisting is worth a SQLite commit. */
22048
+ volatileStateFields: ["lastFetchedAt"]
21722
22049
  };
21723
22050
  /**
21724
22051
  * Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
@@ -21754,7 +22081,14 @@ var eventEmitterCapability = {
21754
22081
  schema: EventEmitterStatusSchema,
21755
22082
  kind: "push"
21756
22083
  },
21757
- runtimeState: EventEmitterStatusSchema
22084
+ runtimeState: EventEmitterStatusSchema,
22085
+ /**
22086
+ * Runtime-state durability: **session** — `eventCountSinceStart` names its own scope.
22087
+ *
22088
+ * See `RuntimeStateDurability`. Enforced by
22089
+ * `scripts/check-runtime-state-durability.ts`.
22090
+ */
22091
+ durability: "session"
21758
22092
  };
21759
22093
  var EventItemSchema = object({
21760
22094
  id: string(),
@@ -22035,7 +22369,14 @@ var fanControlCapability = {
22035
22369
  * Runtime-state slice — mirrored by the kernel. UI fan speed
22036
22370
  * sliders read `percentage` for live updates.
22037
22371
  */
22038
- runtimeState: FanControlStatusSchema
22372
+ runtimeState: FanControlStatusSchema,
22373
+ /**
22374
+ * Runtime-state durability: **session** — as `brightness`.
22375
+ *
22376
+ * See `RuntimeStateDurability`. Enforced by
22377
+ * `scripts/check-runtime-state-durability.ts`.
22378
+ */
22379
+ durability: "session"
22039
22380
  };
22040
22381
  /**
22041
22382
  * Per-device feature/identity probe slice. Holds the runtime-resolved
@@ -22111,7 +22452,14 @@ onProbeChanged: { data: object({
22111
22452
  schema: FeatureProbeStatusSchema,
22112
22453
  kind: "push"
22113
22454
  },
22114
- runtimeState: FeatureProbeStatusSchema
22455
+ runtimeState: FeatureProbeStatusSchema,
22456
+ /**
22457
+ * 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.
22458
+ *
22459
+ * See `RuntimeStateDurability`. Enforced by
22460
+ * `scripts/check-runtime-state-durability.ts`.
22461
+ */
22462
+ durability: "session"
22115
22463
  };
22116
22464
  /**
22117
22465
  * Water leak / moisture sensor. Boolean "is liquid currently
@@ -22138,7 +22486,17 @@ var floodCapability = {
22138
22486
  schema: FloodStatusSchema,
22139
22487
  kind: "push"
22140
22488
  },
22141
- runtimeState: FloodStatusSchema
22489
+ runtimeState: FloodStatusSchema,
22490
+ /**
22491
+ * Runtime-state durability: **restored** — as `smoke`.
22492
+ *
22493
+ * See `RuntimeStateDurability`. Enforced by
22494
+ * `scripts/check-runtime-state-durability.ts`.
22495
+ */
22496
+ durability: "restored",
22497
+ /** Clock fields: written, but excluded from the compare that decides
22498
+ * whether persisting is worth a SQLite commit. */
22499
+ volatileStateFields: ["lastChangedAt"]
22142
22500
  };
22143
22501
  /**
22144
22502
  * Combustible-gas (LPG / methane / hydrogen) alarm sensor. Drives
@@ -22161,7 +22519,17 @@ var gasCapability = {
22161
22519
  schema: GasStatusSchema,
22162
22520
  kind: "push"
22163
22521
  },
22164
- runtimeState: GasStatusSchema
22522
+ runtimeState: GasStatusSchema,
22523
+ /**
22524
+ * Runtime-state durability: **restored** — as `smoke`.
22525
+ *
22526
+ * See `RuntimeStateDurability`. Enforced by
22527
+ * `scripts/check-runtime-state-durability.ts`.
22528
+ */
22529
+ durability: "restored",
22530
+ /** Clock fields: written, but excluded from the compare that decides
22531
+ * whether persisting is worth a SQLite commit. */
22532
+ volatileStateFields: ["lastChangedAt"]
22165
22533
  };
22166
22534
  /**
22167
22535
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
@@ -22237,7 +22605,14 @@ var humidifierCapability = {
22237
22605
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22238
22606
  * slice for live humidity / mode changes.
22239
22607
  */
22240
- runtimeState: HumidifierStatusSchema
22608
+ runtimeState: HumidifierStatusSchema,
22609
+ /**
22610
+ * Runtime-state durability: **session** — as `climate-control`.
22611
+ *
22612
+ * See `RuntimeStateDurability`. Enforced by
22613
+ * `scripts/check-runtime-state-durability.ts`.
22614
+ */
22615
+ durability: "session"
22241
22616
  };
22242
22617
  /**
22243
22618
  * Single-metric humidity reading. Drives Home Assistant `sensor`
@@ -22273,7 +22648,17 @@ var humiditySensorCapability = {
22273
22648
  schema: HumiditySensorStatusSchema,
22274
22649
  kind: "push"
22275
22650
  },
22276
- runtimeState: HumiditySensorStatusSchema
22651
+ runtimeState: HumiditySensorStatusSchema,
22652
+ /**
22653
+ * Runtime-state durability: **restored** — as `numeric-sensor` (67 of 75 writes were the clock alone).
22654
+ *
22655
+ * See `RuntimeStateDurability`. Enforced by
22656
+ * `scripts/check-runtime-state-durability.ts`.
22657
+ */
22658
+ durability: "restored",
22659
+ /** Clock fields: written, but excluded from the compare that decides
22660
+ * whether persisting is worth a SQLite commit. */
22661
+ volatileStateFields: ["lastFetchedAt"]
22277
22662
  };
22278
22663
  /**
22279
22664
  * Image display cap. Models a single still image exposed by an integration —
@@ -22311,7 +22696,14 @@ var imageCapability = {
22311
22696
  * Runtime-state slice — mirrored by the kernel. The UI reads `url`
22312
22697
  * directly and renders the still image.
22313
22698
  */
22314
- runtimeState: ImageStatusSchema
22699
+ runtimeState: ImageStatusSchema,
22700
+ /**
22701
+ * Runtime-state durability: **session** — a snapshot URL is a session-scoped handle; a restored one points at nothing.
22702
+ *
22703
+ * See `RuntimeStateDurability`. Enforced by
22704
+ * `scripts/check-runtime-state-durability.ts`.
22705
+ */
22706
+ durability: "session"
22315
22707
  };
22316
22708
  /**
22317
22709
  * Vendor-neutral image / picture-adjustment cap — the per-camera config
@@ -22460,7 +22852,17 @@ var imageSettingsCapability = {
22460
22852
  schema: ImageSettingsStatusSchema,
22461
22853
  kind: "poll"
22462
22854
  },
22463
- runtimeState: ImageSettingsStatusSchema
22855
+ runtimeState: ImageSettingsStatusSchema,
22856
+ /**
22857
+ * Runtime-state durability: **restored** — operator-set camera imaging; mutation-driven.
22858
+ *
22859
+ * See `RuntimeStateDurability`. Enforced by
22860
+ * `scripts/check-runtime-state-durability.ts`.
22861
+ */
22862
+ durability: "restored",
22863
+ /** Clock fields: written, but excluded from the compare that decides
22864
+ * whether persisting is worth a SQLite commit. */
22865
+ volatileStateFields: ["lastFetchedAt"]
22464
22866
  };
22465
22867
  /**
22466
22868
  * integrations — system-scoped singleton capability for integration
@@ -22851,7 +23253,14 @@ var lawnMowerControlCapability = {
22851
23253
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22852
23254
  * slice for live activity + battery changes.
22853
23255
  */
22854
- runtimeState: LawnMowerControlStatusSchema
23256
+ runtimeState: LawnMowerControlStatusSchema,
23257
+ /**
23258
+ * Runtime-state durability: **session** — as `vacuum-control`.
23259
+ *
23260
+ * See `RuntimeStateDurability`. Enforced by
23261
+ * `scripts/check-runtime-state-durability.ts`.
23262
+ */
23263
+ durability: "session"
22855
23264
  };
22856
23265
  /**
22857
23266
  * local-network — hub-only singleton.
@@ -23057,7 +23466,17 @@ var lockControlCapability = {
23057
23466
  * read `state` and disable themselves during `locking`/`unlocking`
23058
23467
  * transitions.
23059
23468
  */
23060
- runtimeState: LockControlStatusSchema
23469
+ runtimeState: LockControlStatusSchema,
23470
+ /**
23471
+ * Runtime-state durability: **restored** — a lock left locked must still read locked.
23472
+ *
23473
+ * See `RuntimeStateDurability`. Enforced by
23474
+ * `scripts/check-runtime-state-durability.ts`.
23475
+ */
23476
+ durability: "restored",
23477
+ /** Clock fields: written, but excluded from the compare that decides
23478
+ * whether persisting is worth a SQLite commit. */
23479
+ volatileStateFields: ["lastChangedAt"]
23061
23480
  };
23062
23481
  /**
23063
23482
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
@@ -23219,7 +23638,14 @@ var mediaPlayerCapability = {
23219
23638
  * full slice for live now-playing, volume, and progress updates
23220
23639
  * without polling.
23221
23640
  */
23222
- runtimeState: MediaPlayerStatusSchema
23641
+ runtimeState: MediaPlayerStatusSchema,
23642
+ /**
23643
+ * Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
23644
+ *
23645
+ * See `RuntimeStateDurability`. Enforced by
23646
+ * `scripts/check-runtime-state-durability.ts`.
23647
+ */
23648
+ durability: "session"
23223
23649
  };
23224
23650
  /**
23225
23651
  * mesh-network — collection cap for mesh-VPN providers.
@@ -23483,7 +23909,14 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
23483
23909
  * `device.state.motion.value`. Reads never invoke the provider, so
23484
23910
  * UIs and other addons can poll the cached state safely.
23485
23911
  */
23486
- runtimeState: MotionStatusSchema
23912
+ runtimeState: MotionStatusSchema,
23913
+ /**
23914
+ * 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.
23915
+ *
23916
+ * See `RuntimeStateDurability`. Enforced by
23917
+ * `scripts/check-runtime-state-durability.ts`.
23918
+ */
23919
+ durability: "session"
23487
23920
  };
23488
23921
  /**
23489
23922
  * Motion-trigger toggle for accessory devices.
@@ -23548,7 +23981,14 @@ var motionTriggerCapability = {
23548
23981
  schema: MotionTriggerStatusSchema,
23549
23982
  kind: "command-driven"
23550
23983
  },
23551
- runtimeState: MotionTriggerRuntimeStateSchema
23984
+ runtimeState: MotionTriggerRuntimeStateSchema,
23985
+ /**
23986
+ * 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.
23987
+ *
23988
+ * See `RuntimeStateDurability`. Enforced by
23989
+ * `scripts/check-runtime-state-durability.ts`.
23990
+ */
23991
+ durability: "session"
23552
23992
  };
23553
23993
  /**
23554
23994
  * Motion-zones share the same MaskShape vocabulary as privacy-mask — the
@@ -23615,7 +24055,17 @@ var motionZonesCapability = {
23615
24055
  schema: MotionZoneStatusSchema,
23616
24056
  kind: "poll"
23617
24057
  },
23618
- runtimeState: MotionZoneStatusSchema
24058
+ runtimeState: MotionZoneStatusSchema,
24059
+ /**
24060
+ * 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.
24061
+ *
24062
+ * See `RuntimeStateDurability`. Enforced by
24063
+ * `scripts/check-runtime-state-durability.ts`.
24064
+ */
24065
+ durability: "restored",
24066
+ /** Clock fields: written, but excluded from the compare that decides
24067
+ * whether persisting is worth a SQLite commit. */
24068
+ volatileStateFields: ["lastFetchedAt"]
23619
24069
  };
23620
24070
  /**
23621
24071
  * On-camera AI object detection cap. Surfaces per-device the classes
@@ -23689,7 +24139,17 @@ var nativeObjectDetectionCapability = {
23689
24139
  schema: NativeObjectDetectionStatusSchema,
23690
24140
  kind: "push"
23691
24141
  },
23692
- runtimeState: NativeObjectDetectionRuntimeStateSchema
24142
+ runtimeState: NativeObjectDetectionRuntimeStateSchema,
24143
+ /**
24144
+ * 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.
24145
+ *
24146
+ * See `RuntimeStateDurability`. Enforced by
24147
+ * `scripts/check-runtime-state-durability.ts`.
24148
+ */
24149
+ durability: "restored",
24150
+ /** Clock fields: written, but excluded from the compare that decides
24151
+ * whether persisting is worth a SQLite commit. */
24152
+ volatileStateFields: ["lastFetchedAt"]
23693
24153
  };
23694
24154
  /**
23695
24155
  * network-quality — system-scoped singleton capability tracking RTT,
@@ -24023,7 +24483,14 @@ onSent: { data: object({
24023
24483
  * form reads `supports` to gate optional fields; history pane reads
24024
24484
  * `lastSentAt` / `lastError` / `queueDepth`.
24025
24485
  */
24026
- runtimeState: NotifierStatusSchema
24486
+ runtimeState: NotifierStatusSchema,
24487
+ /**
24488
+ * Runtime-state durability: **session** — live queue depth and last-send state; a restored queue depth describes a queue that no longer exists.
24489
+ *
24490
+ * See `RuntimeStateDurability`. Enforced by
24491
+ * `scripts/check-runtime-state-durability.ts`.
24492
+ */
24493
+ durability: "session"
24027
24494
  };
24028
24495
  /**
24029
24496
  * Generic numeric sensor — last-resort fallback when no typed numeric
@@ -24066,7 +24533,17 @@ var numericSensorCapability = {
24066
24533
  schema: NumericSensorStatusSchema,
24067
24534
  kind: "push"
24068
24535
  },
24069
- runtimeState: NumericSensorStatusSchema
24536
+ runtimeState: NumericSensorStatusSchema,
24537
+ /**
24538
+ * 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.
24539
+ *
24540
+ * See `RuntimeStateDurability`. Enforced by
24541
+ * `scripts/check-runtime-state-durability.ts`.
24542
+ */
24543
+ durability: "restored",
24544
+ /** Clock fields: written, but excluded from the compare that decides
24545
+ * whether persisting is worth a SQLite commit. */
24546
+ volatileStateFields: ["lastFetchedAt"]
24070
24547
  };
24071
24548
  /**
24072
24549
  * Generic on-screen-display (video overlay) cap. Each camera exposes
@@ -24451,7 +24928,14 @@ var petFeederCapability = {
24451
24928
  * the full slice via `device.state.petFeeder.value` and refresh on
24452
24929
  * every poll without re-querying the provider.
24453
24930
  */
24454
- runtimeState: PetFeederStatusSchema
24931
+ runtimeState: PetFeederStatusSchema,
24932
+ /**
24933
+ * Runtime-state durability: **session** — live appliance state re-published on connect.
24934
+ *
24935
+ * See `RuntimeStateDurability`. Enforced by
24936
+ * `scripts/check-runtime-state-durability.ts`.
24937
+ */
24938
+ durability: "session"
24455
24939
  };
24456
24940
  var VehicleSchema = object({
24457
24941
  id: string(),
@@ -24763,7 +25247,17 @@ var powerMeterCapability = {
24763
25247
  schema: PowerMeterStatusSchema,
24764
25248
  kind: "push"
24765
25249
  },
24766
- runtimeState: PowerMeterStatusSchema
25250
+ runtimeState: PowerMeterStatusSchema,
25251
+ /**
25252
+ * Runtime-state durability: **restored** — as `numeric-sensor`; `kwhTotal` is an accumulator whose restored value is the baseline.
25253
+ *
25254
+ * See `RuntimeStateDurability`. Enforced by
25255
+ * `scripts/check-runtime-state-durability.ts`.
25256
+ */
25257
+ durability: "restored",
25258
+ /** Clock fields: written, but excluded from the compare that decides
25259
+ * whether persisting is worth a SQLite commit. */
25260
+ volatileStateFields: ["lastFetchedAt"]
24767
25261
  };
24768
25262
  /**
24769
25263
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -24820,7 +25314,17 @@ var presenceCapability = {
24820
25314
  * the map pin is rendered (use `DeviceFeature.PresenceGps` for the
24821
25315
  * pre-fetch fast-path check).
24822
25316
  */
24823
- runtimeState: PresenceStatusSchema
25317
+ runtimeState: PresenceStatusSchema,
25318
+ /**
25319
+ * Runtime-state durability: **restored** — occupancy-relevant: the restored state is what an occupancy rule compares the first post-restart observation against.
25320
+ *
25321
+ * See `RuntimeStateDurability`. Enforced by
25322
+ * `scripts/check-runtime-state-durability.ts`.
25323
+ */
25324
+ durability: "restored",
25325
+ /** Clock fields: written, but excluded from the compare that decides
25326
+ * whether persisting is worth a SQLite commit. */
25327
+ volatileStateFields: ["lastChangedAt"]
24824
25328
  };
24825
25329
  /**
24826
25330
  * Atmospheric pressure reading in hectopascals. Drives Home Assistant
@@ -24856,7 +25360,17 @@ var pressureSensorCapability = {
24856
25360
  schema: PressureSensorStatusSchema,
24857
25361
  kind: "push"
24858
25362
  },
24859
- runtimeState: PressureSensorStatusSchema
25363
+ runtimeState: PressureSensorStatusSchema,
25364
+ /**
25365
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
25366
+ *
25367
+ * See `RuntimeStateDurability`. Enforced by
25368
+ * `scripts/check-runtime-state-durability.ts`.
25369
+ */
25370
+ durability: "restored",
25371
+ /** Clock fields: written, but excluded from the compare that decides
25372
+ * whether persisting is worth a SQLite commit. */
25373
+ volatileStateFields: ["lastFetchedAt"]
24860
25374
  };
24861
25375
  /**
24862
25376
  * PRIVACY — what the camera deliberately does not capture. Two planes:
@@ -24986,7 +25500,17 @@ var privacyMaskCapability = {
24986
25500
  schema: PrivacyMaskStatusSchema,
24987
25501
  kind: "poll"
24988
25502
  },
24989
- runtimeState: PrivacyMaskStatusSchema
25503
+ runtimeState: PrivacyMaskStatusSchema,
25504
+ /**
25505
+ * Runtime-state durability: **restored** — operator-drawn regions, zero real churn — 22 writes in 25 minutes, every one of them the clock.
25506
+ *
25507
+ * See `RuntimeStateDurability`. Enforced by
25508
+ * `scripts/check-runtime-state-durability.ts`.
25509
+ */
25510
+ durability: "restored",
25511
+ /** Clock fields: written, but excluded from the compare that decides
25512
+ * whether persisting is worth a SQLite commit. */
25513
+ volatileStateFields: ["lastFetchedAt"]
24990
25514
  };
24991
25515
  /**
24992
25516
  * Collapse a camera's PER-PROFILE audio flags into the one answer
@@ -25214,7 +25738,14 @@ var ptzAutotrackCapability = {
25214
25738
  * fetch / cache / fallback logic out of the four cap methods —
25215
25739
  * they become trampolines over `runtimeState`.
25216
25740
  */
25217
- runtimeState: PtzAutotrackRuntimeStateSchema
25741
+ runtimeState: PtzAutotrackRuntimeStateSchema,
25742
+ /**
25743
+ * Runtime-state durability: **session** — mirrors the camera's own autotrack config, re-read on connect.
25744
+ *
25745
+ * See `RuntimeStateDurability`. Enforced by
25746
+ * `scripts/check-runtime-state-durability.ts`.
25747
+ */
25748
+ durability: "session"
25218
25749
  };
25219
25750
  /**
25220
25751
  * reboot — device-scoped capability for "soft" device reboots (firmware
@@ -25889,7 +26420,14 @@ var sceneMonitorCapability = {
25889
26420
  schema: SceneMonitorStatusSchema,
25890
26421
  kind: "push"
25891
26422
  },
25892
- runtimeState: SceneMonitorStatusSchema
26423
+ runtimeState: SceneMonitorStatusSchema,
26424
+ /**
26425
+ * Runtime-state durability: **session** — re-derived from the current scene on the next evaluation.
26426
+ *
26427
+ * See `RuntimeStateDurability`. Enforced by
26428
+ * `scripts/check-runtime-state-durability.ts`.
26429
+ */
26430
+ durability: "session"
25893
26431
  };
25894
26432
  /**
25895
26433
  * Per-stage gating mode applied to the zones a rule references.
@@ -26033,7 +26571,14 @@ var scriptRunnerCapability = {
26033
26571
  * `isRunning` to render a spinner during execution and surfaces
26034
26572
  * `lastError` / `lastRunSuccess` in the recent-runs panel.
26035
26573
  */
26036
- runtimeState: ScriptRunnerStatusSchema
26574
+ runtimeState: ScriptRunnerStatusSchema,
26575
+ /**
26576
+ * Runtime-state durability: **session** — a restored `isRunning: true` describes a process that died with the previous hub.
26577
+ *
26578
+ * See `RuntimeStateDurability`. Enforced by
26579
+ * `scripts/check-runtime-state-durability.ts`.
26580
+ */
26581
+ durability: "session"
26037
26582
  };
26038
26583
  /**
26039
26584
  * Smoke alarm sensor — boolean "is smoke currently detected" with
@@ -26060,7 +26605,17 @@ var smokeCapability = {
26060
26605
  schema: SmokeStatusSchema,
26061
26606
  kind: "push"
26062
26607
  },
26063
- runtimeState: SmokeStatusSchema
26608
+ runtimeState: SmokeStatusSchema,
26609
+ /**
26610
+ * Runtime-state durability: **restored** — a safety sensor must not read "clear" merely because the hub restarted.
26611
+ *
26612
+ * See `RuntimeStateDurability`. Enforced by
26613
+ * `scripts/check-runtime-state-durability.ts`.
26614
+ */
26615
+ durability: "restored",
26616
+ /** Clock fields: written, but excluded from the compare that decides
26617
+ * whether persisting is worth a SQLite commit. */
26618
+ volatileStateFields: ["lastChangedAt"]
26064
26619
  };
26065
26620
  /**
26066
26621
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -26246,7 +26801,17 @@ var streamParamsCapability = {
26246
26801
  schema: StreamParamsStatusSchema,
26247
26802
  kind: "poll"
26248
26803
  },
26249
- runtimeState: StreamParamsStatusSchema
26804
+ runtimeState: StreamParamsStatusSchema,
26805
+ /**
26806
+ * Runtime-state durability: **restored** — operator-set encoder profile; mutation-driven.
26807
+ *
26808
+ * See `RuntimeStateDurability`. Enforced by
26809
+ * `scripts/check-runtime-state-durability.ts`.
26810
+ */
26811
+ durability: "restored",
26812
+ /** Clock fields: written, but excluded from the compare that decides
26813
+ * whether persisting is worth a SQLite commit. */
26814
+ volatileStateFields: ["lastFetchedAt"]
26250
26815
  };
26251
26816
  /**
26252
26817
  * The three well-known stream profiles in render order. Exported so the
@@ -26490,6 +27055,16 @@ var switchCapability = {
26490
27055
  * not need to re-query the provider after a setState mutation.
26491
27056
  */
26492
27057
  runtimeState: SwitchStatusSchema,
27058
+ /**
27059
+ * Runtime-state durability: **restored** — device state an operator reads as authoritative; 55 devices, transition-driven.
27060
+ *
27061
+ * See `RuntimeStateDurability`. Enforced by
27062
+ * `scripts/check-runtime-state-durability.ts`.
27063
+ */
27064
+ durability: "restored",
27065
+ /** Clock fields: written, but excluded from the compare that decides
27066
+ * whether persisting is worth a SQLite commit. */
27067
+ volatileStateFields: ["lastChangedAt"],
26493
27068
  settings: { bindings: [{
26494
27069
  kind: "scalar",
26495
27070
  statusPath: "on",
@@ -26569,7 +27144,17 @@ var tamperCapability = {
26569
27144
  schema: TamperStatusSchema,
26570
27145
  kind: "push"
26571
27146
  },
26572
- runtimeState: TamperStatusSchema
27147
+ runtimeState: TamperStatusSchema,
27148
+ /**
27149
+ * Runtime-state durability: **restored** — as `smoke`.
27150
+ *
27151
+ * See `RuntimeStateDurability`. Enforced by
27152
+ * `scripts/check-runtime-state-durability.ts`.
27153
+ */
27154
+ durability: "restored",
27155
+ /** Clock fields: written, but excluded from the compare that decides
27156
+ * whether persisting is worth a SQLite commit. */
27157
+ volatileStateFields: ["lastChangedAt"]
26573
27158
  };
26574
27159
  /**
26575
27160
  * Single-metric temperature reading. Drives Home Assistant `sensor`
@@ -26614,7 +27199,17 @@ var temperatureSensorCapability = {
26614
27199
  schema: TemperatureSensorStatusSchema,
26615
27200
  kind: "push"
26616
27201
  },
26617
- runtimeState: TemperatureSensorStatusSchema
27202
+ runtimeState: TemperatureSensorStatusSchema,
27203
+ /**
27204
+ * Runtime-state durability: **restored** — as `numeric-sensor` (69 of 125 writes were the clock alone).
27205
+ *
27206
+ * See `RuntimeStateDurability`. Enforced by
27207
+ * `scripts/check-runtime-state-durability.ts`.
27208
+ */
27209
+ durability: "restored",
27210
+ /** Clock fields: written, but excluded from the compare that decides
27211
+ * whether persisting is worth a SQLite commit. */
27212
+ volatileStateFields: ["lastFetchedAt"]
26618
27213
  };
26619
27214
  /**
26620
27215
  * toast — system-scoped singleton capability that streams toast
@@ -26683,7 +27278,14 @@ var updateCapability = {
26683
27278
  schema: UpdateStatusSchema,
26684
27279
  kind: "poll"
26685
27280
  },
26686
- runtimeState: UpdateStatusSchema
27281
+ runtimeState: UpdateStatusSchema,
27282
+ /**
27283
+ * Runtime-state durability: **session** — a restored `inProgress: true` describes an update that is no longer running; versions are re-probed at boot.
27284
+ *
27285
+ * See `RuntimeStateDurability`. Enforced by
27286
+ * `scripts/check-runtime-state-durability.ts`.
27287
+ */
27288
+ durability: "session"
26687
27289
  };
26688
27290
  var UserSummarySchema = object({
26689
27291
  id: string(),
@@ -27017,7 +27619,14 @@ var vacuumControlCapability = {
27017
27619
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
27018
27620
  * slice for live state + battery + fan-speed changes.
27019
27621
  */
27020
- runtimeState: VacuumControlStatusSchema
27622
+ runtimeState: VacuumControlStatusSchema,
27623
+ /**
27624
+ * Runtime-state durability: **session** — as `media-player` — a restored `state: cleaning` is a robot that is not cleaning.
27625
+ *
27626
+ * See `RuntimeStateDurability`. Enforced by
27627
+ * `scripts/check-runtime-state-durability.ts`.
27628
+ */
27629
+ durability: "session"
27021
27630
  };
27022
27631
  var ValveStatusSchema = object({
27023
27632
  /** Lifecycle state of the valve. */
@@ -27069,7 +27678,14 @@ var valveCapability = {
27069
27678
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
27070
27679
  * slice for live position changes during a move.
27071
27680
  */
27072
- runtimeState: ValveStatusSchema
27681
+ runtimeState: ValveStatusSchema,
27682
+ /**
27683
+ * Runtime-state durability: **session** — as `brightness`.
27684
+ *
27685
+ * See `RuntimeStateDurability`. Enforced by
27686
+ * `scripts/check-runtime-state-durability.ts`.
27687
+ */
27688
+ durability: "session"
27073
27689
  };
27074
27690
  /**
27075
27691
  * Vibration / shake / impact sensor. Drives Home Assistant
@@ -27091,7 +27707,17 @@ var vibrationCapability = {
27091
27707
  schema: VibrationStatusSchema,
27092
27708
  kind: "push"
27093
27709
  },
27094
- runtimeState: VibrationStatusSchema
27710
+ runtimeState: VibrationStatusSchema,
27711
+ /**
27712
+ * Runtime-state durability: **restored** — as `smoke`.
27713
+ *
27714
+ * See `RuntimeStateDurability`. Enforced by
27715
+ * `scripts/check-runtime-state-durability.ts`.
27716
+ */
27717
+ durability: "restored",
27718
+ /** Clock fields: written, but excluded from the compare that decides
27719
+ * whether persisting is worth a SQLite commit. */
27720
+ volatileStateFields: ["lastChangedAt"]
27095
27721
  };
27096
27722
  /**
27097
27723
  * Water heater / boiler cap. Models HA `water_heater.*` entities — a
@@ -27165,7 +27791,14 @@ var waterHeaterCapability = {
27165
27791
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
27166
27792
  * slice for live temperature / mode / away changes.
27167
27793
  */
27168
- runtimeState: WaterHeaterStatusSchema
27794
+ runtimeState: WaterHeaterStatusSchema,
27795
+ /**
27796
+ * Runtime-state durability: **session** — as `climate-control`.
27797
+ *
27798
+ * See `RuntimeStateDurability`. Enforced by
27799
+ * `scripts/check-runtime-state-durability.ts`.
27800
+ */
27801
+ durability: "session"
27169
27802
  };
27170
27803
  /**
27171
27804
  * Weather provider cap. Models HA `weather.*` entities — a read-only
@@ -27224,7 +27857,14 @@ var weatherCapability = {
27224
27857
  * Runtime-state slice — mirrored by the kernel. The UI reads the
27225
27858
  * current conditions directly from the slice on each weather push.
27226
27859
  */
27227
- runtimeState: WeatherStatusSchema
27860
+ runtimeState: WeatherStatusSchema,
27861
+ /**
27862
+ * Runtime-state durability: **session** — a forecast is stale the moment the hub is down; the provider re-fetches on connect.
27863
+ *
27864
+ * See `RuntimeStateDurability`. Enforced by
27865
+ * `scripts/check-runtime-state-durability.ts`.
27866
+ */
27867
+ durability: "session"
27228
27868
  };
27229
27869
  /**
27230
27870
  * Per-zone occupancy aggregation produced by the analytics frame
@@ -27386,7 +28026,14 @@ var zoneAnalyticsCapability = {
27386
28026
  * automatically; the explicit `getCurrentSnapshot` cap method is
27387
28027
  * still useful for one-off polls without a subscription.
27388
28028
  */
27389
- runtimeState: CameraOccupancySnapshotSchema
28029
+ runtimeState: CameraOccupancySnapshotSchema,
28030
+ /**
28031
+ * Runtime-state durability: **session** — per-frame analytics; with `audio-metrics` it is ~90 % of the offered write rate. Re-derived on the next frame.
28032
+ *
28033
+ * See `RuntimeStateDurability`. Enforced by
28034
+ * `scripts/check-runtime-state-durability.ts`.
28035
+ */
28036
+ durability: "session"
27390
28037
  };
27391
28038
  /**
27392
28039
  * Stages a {@link ZoneRule} can apply to. Discriminator on the rules
@@ -27464,7 +28111,14 @@ var zoneRulesCapability = {
27464
28111
  motion: array(ZoneRuleSchema).readonly(),
27465
28112
  detection: array(ZoneRuleSchema).readonly(),
27466
28113
  package: array(ZoneRuleSchema).readonly()
27467
- })
28114
+ }),
28115
+ /**
28116
+ * Runtime-state durability: **restored** — operator intent, mutation-only, same argument as `zones`.
28117
+ *
28118
+ * See `RuntimeStateDurability`. Enforced by
28119
+ * `scripts/check-runtime-state-durability.ts`.
28120
+ */
28121
+ durability: "restored"
27468
28122
  };
27469
28123
  /**
27470
28124
  * Accessory device helpers — shared across drivers.
@@ -34231,6 +34885,7 @@ Object.freeze({
34231
34885
  "network-access": "ingress",
34232
34886
  "smtp-provider": "email"
34233
34887
  });
34888
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
34234
34889
  new Set(["devices", "classes"]);
34235
34890
  /**
34236
34891
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.