@camstack/addon-provider-rademacher 0.2.14 → 0.2.16

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
@@ -11756,7 +11756,14 @@ var cameraStreamsCapability = {
11756
11756
  low: string().optional()
11757
11757
  }),
11758
11758
  lastChangedAt: number()
11759
- })
11759
+ }),
11760
+ /**
11761
+ * 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.
11762
+ *
11763
+ * See `RuntimeStateDurability`. Enforced by
11764
+ * `scripts/check-runtime-state-durability.ts`.
11765
+ */
11766
+ durability: "session"
11760
11767
  };
11761
11768
  /** Where a block runs. The operator chooses — a block driving a device on an
11762
11769
  * agent is the reason placement is not fixed to the hub. */
@@ -12317,6 +12324,13 @@ var deviceDiscoveryCapability = {
12317
12324
  kind: "poll"
12318
12325
  },
12319
12326
  runtimeState: DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: number().int().nonnegative() }),
12327
+ /**
12328
+ * Runtime-state durability: **session** — 5.7 KB of scan output on the largest device, fully re-derivable by re-scanning.
12329
+ *
12330
+ * See `RuntimeStateDurability`. Enforced by
12331
+ * `scripts/check-runtime-state-durability.ts`.
12332
+ */
12333
+ durability: "session",
12320
12334
  methods: {
12321
12335
  /**
12322
12336
  * Snapshot of the current `discovered` list. Returns the
@@ -14186,11 +14200,33 @@ var NotificationFormatSchema = _enum([
14186
14200
  * Named by INTENT, never by glyph. "check" would tie the vocabulary to one
14187
14201
  * renderer's icon set; "acknowledge" survives an adapter that draws it
14188
14202
  * differently.
14203
+ *
14204
+ * ── A TOKEN IS NOT A WIRE VALUE ─────────────────────────────────────
14205
+ *
14206
+ * These names are for US. **No adapter may forward one verbatim.** Each maps
14207
+ * the whole set onto its own renderer's vocabulary through a
14208
+ * `Record<NotificationActionIcon, string>` — a Record, never a lookup with a
14209
+ * fallback, so adding a member here fails every adapter's build until someone
14210
+ * decides its glyph, which is the only place that decision can be made
14211
+ * honestly.
14212
+ *
14213
+ * This paragraph is the bug. Zentik declared `actionIcons: true` and passed
14214
+ * `disarm` straight through; iOS feeds that string to
14215
+ * `UNNotificationActionIcon(systemImageName:)`, `disarm` is not an SF Symbol,
14216
+ * and every snooze and alarm button arrived BLANK. A pass-through is not a
14217
+ * mapping, and "the field is documented" is not "the value renders".
14218
+ *
14219
+ * Adding a member is TRAIN-BOUND. The enum lives in the published
14220
+ * `@camstack/server` closure and the cap seam validates against the HUB's copy,
14221
+ * so an addon that emits a token the running hub does not know does not lose an
14222
+ * icon — its whole `send` fails Zod validation and the notification never
14223
+ * arrives. Never emit a new token from an addon before the train carrying it.
14189
14224
  */
14190
14225
  var NotificationActionIconSchema = _enum([
14191
14226
  "acknowledge",
14192
14227
  "dismiss",
14193
14228
  "silence",
14229
+ "snooze",
14194
14230
  "view",
14195
14231
  "play",
14196
14232
  "open",
@@ -14198,9 +14234,13 @@ var NotificationActionIconSchema = _enum([
14198
14234
  "lock",
14199
14235
  "unlock",
14200
14236
  "arm",
14237
+ "arm-home",
14238
+ "arm-away",
14239
+ "arm-night",
14201
14240
  "disarm",
14202
14241
  "light",
14203
- "alert"
14242
+ "alert",
14243
+ "camera"
14204
14244
  ]);
14205
14245
  /** A single tap-through action button. */
14206
14246
  var NotificationActionSchema = object({
@@ -14216,7 +14256,23 @@ var NotificationActionSchema = object({
14216
14256
  * else — see `notification-center/action-token.ts` for what that does and
14217
14257
  * does not buy.
14218
14258
  */
14219
- destructive: boolean().optional()
14259
+ destructive: boolean().optional(),
14260
+ /**
14261
+ * How the tap should REACH the url.
14262
+ *
14263
+ * `navigate` (absent, and every button authored before this field) opens it:
14264
+ * the phone leaves the notification and shows whatever the callback returns.
14265
+ * That is right for a button whose answer the operator wants to read.
14266
+ *
14267
+ * `background` fires it as a POST and stays put. It exists for the buttons
14268
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
14269
+ * an answer to the notification, and being thrown into a browser tab to
14270
+ * confirm it costs more attention than the notification did. A backend that
14271
+ * cannot do a background call renders it as an ordinary link (the adapters
14272
+ * fall back rather than dropping the button), so this is a preference, never
14273
+ * a requirement.
14274
+ */
14275
+ mode: _enum(["navigate", "background"]).optional()
14220
14276
  });
14221
14277
  /**
14222
14278
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -14384,6 +14440,24 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
14384
14440
  targetId: string(),
14385
14441
  enabled: boolean()
14386
14442
  }), _void(), { kind: "mutation" });
14443
+ new Set([
14444
+ {
14445
+ id: "person",
14446
+ name: "Person"
14447
+ },
14448
+ {
14449
+ id: "vehicle",
14450
+ name: "Vehicle"
14451
+ },
14452
+ {
14453
+ id: "animal",
14454
+ name: "Animal"
14455
+ },
14456
+ {
14457
+ id: "package",
14458
+ name: "Package"
14459
+ }
14460
+ ].map((l) => l.id));
14387
14461
  var COCO_TO_MACRO = {
14388
14462
  mapping: {
14389
14463
  person: "person",
@@ -15068,7 +15142,17 @@ var alarmPanelCapability = {
15068
15142
  * full slice; renders an arm button per `availableModes` entry and
15069
15143
  * a PIN field iff `requiresCode === true`.
15070
15144
  */
15071
- runtimeState: AlarmPanelStatusSchema
15145
+ runtimeState: AlarmPanelStatusSchema,
15146
+ /**
15147
+ * Runtime-state durability: **restored** — armed state is the one thing a panel must not lose across a restart.
15148
+ *
15149
+ * See `RuntimeStateDurability`. Enforced by
15150
+ * `scripts/check-runtime-state-durability.ts`.
15151
+ */
15152
+ durability: "restored",
15153
+ /** Clock fields: written, but excluded from the compare that decides
15154
+ * whether persisting is worth a SQLite commit. */
15155
+ volatileStateFields: ["lastChangedAt"]
15072
15156
  };
15073
15157
  /**
15074
15158
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
@@ -15209,6 +15293,8 @@ var NcSystemEventKindSchema = _enum([
15209
15293
  "alarm-triggered",
15210
15294
  "alarm-armed",
15211
15295
  "alarm-disarmed",
15296
+ "alarm-arming",
15297
+ "alarm-arm-refused",
15212
15298
  "camera-online",
15213
15299
  "camera-offline",
15214
15300
  "camera-disabled",
@@ -15245,6 +15331,9 @@ var NcSystemEventConditionSchema = object({
15245
15331
  nodeIds: array(string().min(1)).min(1).optional(),
15246
15332
  packageNames: array(string().min(1)).min(1).optional()
15247
15333
  });
15334
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
15335
+ * outage the operator asked for once and forgot. */
15336
+ var NC_SNOOZE_MAX_MINUTES = 1440;
15248
15337
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
15249
15338
  var NcScheduleSchema = object({
15250
15339
  windows: array(object({
@@ -15621,15 +15710,15 @@ var NcConditionsSchema = object({
15621
15710
  * (an `immediate` rule naming an `audio-*` class, one notification per
15622
15711
  * classified sample) stays exactly as it was for rules that already use it.
15623
15712
  *
15624
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
15625
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
15626
- * (`camstack/src/data/notification-center.ts`, guarded by
15627
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
15713
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
15714
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
15715
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
15716
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
15628
15717
  * condition fields it does not know when a rule is saved from the phone.
15629
15718
  * Publishing an editor for a condition the app cannot round-trip is how an
15630
- * operator loses a rule's conditions by opening it — so the descriptor, the
15631
- * admin widget and the viewer mirror land together (P2 + P3), and only then
15632
- * does an audio rule become authorable.
15719
+ * operator loses a rule's conditions by opening it — so the viewer mirror
15720
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
15721
+ * follows here.
15633
15722
  */
15634
15723
  audio: NcAudioConditionSchema.optional()
15635
15724
  });
@@ -15865,6 +15954,30 @@ var NcRuleInputSchema = object({
15865
15954
  */
15866
15955
  snoozeAllowGlobal: boolean().optional(),
15867
15956
  /**
15957
+ * The snooze durations THIS rule's notification offers as buttons, in
15958
+ * minutes.
15959
+ *
15960
+ * Three states, and all three are distinct — which is exactly why this is
15961
+ * `.optional()` and never `.default()`. A Zod default does not run on the
15962
+ * addon cap path (three production failures in one day), so a schema default
15963
+ * would collapse the first two:
15964
+ *
15965
+ * | value | meaning |
15966
+ * | --- | --- |
15967
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
15968
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
15969
+ * | a list | these choices, de-duplicated and sorted, at most four |
15970
+ *
15971
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
15972
+ * three buttons in total) and a rule that spent it all on snooze choices
15973
+ * would push its own tap-through actions off the notification.
15974
+ *
15975
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
15976
+ * that arms the panel, is exempt automatically and cannot be silenced by a
15977
+ * window from anywhere (D133).
15978
+ */
15979
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
15980
+ /**
15868
15981
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
15869
15982
  *
15870
15983
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -15964,6 +16077,7 @@ var NcConditionDescriptorSchema = object({
15964
16077
  "device",
15965
16078
  "package",
15966
16079
  "occupancy",
16080
+ "audio",
15967
16081
  "system"
15968
16082
  ]),
15969
16083
  label: string(),
@@ -15982,6 +16096,7 @@ var NcConditionDescriptorSchema = object({
15982
16096
  "crossingSelect",
15983
16097
  "polygonDraw",
15984
16098
  "occupancy",
16099
+ "audio",
15985
16100
  "deviceState",
15986
16101
  "systemEvent"
15987
16102
  ]),
@@ -16133,7 +16248,20 @@ var NcSnoozeInputSchema = object({
16133
16248
  ruleId: string().optional(),
16134
16249
  /** Required when `scope: 'device'`. */
16135
16250
  deviceId: number().int().optional(),
16136
- durationMinutes: number().int().min(1).max(1440),
16251
+ /**
16252
+ * Narrow the window to these subject classes — "the cat, not the person".
16253
+ *
16254
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
16255
+ * what every window authored before this field meant, so no persisted row
16256
+ * changes meaning and no client has to learn anything to keep working.
16257
+ *
16258
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
16259
+ * cross rules (D133): the operator points at a camera and a kind of thing,
16260
+ * not at whichever of their four rules happened to produce the notification
16261
+ * they are dismissing.
16262
+ */
16263
+ classes: array(string().min(1)).min(1).optional(),
16264
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
16137
16265
  /**
16138
16266
  * Silence this for EVERY recipient, not just the caller. Permission is
16139
16267
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -16158,6 +16286,10 @@ var NcSnoozeSchema = object({
16158
16286
  scope: NcSnoozeScopeSchema,
16159
16287
  ruleId: string().optional(),
16160
16288
  deviceId: number().int().optional(),
16289
+ /** Subject classes this window covers. ABSENT = every class — see
16290
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
16291
+ * no SQLite column: nothing queries a window by class. */
16292
+ classes: array(string().min(1)).min(1).optional(),
16161
16293
  startedAt: number(),
16162
16294
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
16163
16295
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -18258,7 +18390,14 @@ var zonesCapability = {
18258
18390
  * handle. Slice shape is `{ zones: Zone[] }` so future extensions
18259
18391
  * (e.g. zone groupings) can sit alongside the polygon list.
18260
18392
  */
18261
- runtimeState: object({ zones: array(ZoneSchema).readonly() })
18393
+ runtimeState: object({ zones: array(ZoneSchema).readonly() }),
18394
+ /**
18395
+ * 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.
18396
+ *
18397
+ * See `RuntimeStateDurability`. Enforced by
18398
+ * `scripts/check-runtime-state-durability.ts`.
18399
+ */
18400
+ durability: "restored"
18262
18401
  };
18263
18402
  /**
18264
18403
  * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
@@ -18428,6 +18567,22 @@ var detectionFpsField = {
18428
18567
  default: 10,
18429
18568
  step: 1
18430
18569
  };
18570
+ /**
18571
+ * The occupancy re-check interval. DEFAULT 300 s (2026-08-13 — was 30 s).
18572
+ *
18573
+ * The recheck is now on by default (a parked car is invisible to occupancy
18574
+ * rules until the stationary registry has been rebuilt by motion, which after a
18575
+ * restart may be never on a quiet camera). Each cycle re-subscribes a detection
18576
+ * session — an RTSP re-dial — so the switch is only affordable at a WIDE
18577
+ * interval: 300 s is ~12 re-dials an hour per camera, against 120 at the old
18578
+ * 30 s. A parked car is therefore counted within 5 minutes of a restart.
18579
+ *
18580
+ * Why not wider: `max` is 300 and raising it is TRAIN-BOUND, not addon-bound —
18581
+ * the host validates `attachCamera` against ITS copy of this schema, so a
18582
+ * runner asked for 600 would be rejected by the hub until a `@camstack/server`
18583
+ * carrying the wider bound is installed everywhere. 300 is the widest value
18584
+ * that ships with an addon deploy.
18585
+ */
18431
18586
  var occupancyRecheckSecField = {
18432
18587
  min: 0,
18433
18588
  max: 300,
@@ -18629,15 +18784,21 @@ var RunnerCameraConfigSchema = object({
18629
18784
  */
18630
18785
  onboardMotionDrivesAnalyzer: boolean().default(true),
18631
18786
  /**
18632
- * Master toggle for the occupancy re-check. When `false` (DEFAULT) the runner
18633
- * never arms the periodic recheck timer, regardless of `occupancyRecheckSec`
18634
- * this is off by default because the recheck re-subscribes a detection session
18635
- * every N seconds while `watching`, a major source of pull-decoder re-dial
18636
- * churn (each cycle creates+tears a session → RTSP re-dial → latency). The
18787
+ * Master toggle for the occupancy re-check. When `false` the runner never arms
18788
+ * the periodic recheck timer, regardless of `occupancyRecheckSec`; the
18637
18789
  * `occupancyRecheckSec` / `occupancyRecheckFrames` sliders only take effect
18638
18790
  * (and only render) when this is enabled.
18639
- */
18640
- occupancyRecheckEnabled: boolean().default(false),
18791
+ *
18792
+ * DEFAULT `true` since 2026-08-13 (was `false`). It was off because the
18793
+ * recheck re-subscribes a detection session every N seconds while `watching`
18794
+ * — each cycle creates+tears a session ⇒ an RTSP re-dial ⇒ latency, a major
18795
+ * pull-decoder churn source. What that bought was a blind spot: a STATIONARY
18796
+ * object is counted only while the stationary registry holds it, and the
18797
+ * registry rebuilds from motion, so after a restart a parked car was invisible
18798
+ * to every occupancy rule until something moved in front of it. The churn is
18799
+ * now paid on the interval instead — see `occupancyRecheckSecField`.
18800
+ */
18801
+ occupancyRecheckEnabled: boolean().default(true),
18641
18802
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
18642
18803
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
18643
18804
  /**
@@ -21057,7 +21218,17 @@ var airQualitySensorCapability = {
21057
21218
  schema: AirQualitySensorStatusSchema,
21058
21219
  kind: "push"
21059
21220
  },
21060
- runtimeState: AirQualitySensorStatusSchema
21221
+ runtimeState: AirQualitySensorStatusSchema,
21222
+ /**
21223
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
21224
+ *
21225
+ * See `RuntimeStateDurability`. Enforced by
21226
+ * `scripts/check-runtime-state-durability.ts`.
21227
+ */
21228
+ durability: "restored",
21229
+ /** Clock fields: written, but excluded from the compare that decides
21230
+ * whether persisting is worth a SQLite commit. */
21231
+ volatileStateFields: ["lastFetchedAt"]
21061
21232
  };
21062
21233
  /**
21063
21234
  * Ambient illuminance reading in lux. Drives Home Assistant `sensor`
@@ -21089,7 +21260,17 @@ var ambientLightSensorCapability = {
21089
21260
  schema: AmbientLightSensorStatusSchema,
21090
21261
  kind: "push"
21091
21262
  },
21092
- runtimeState: AmbientLightSensorStatusSchema
21263
+ runtimeState: AmbientLightSensorStatusSchema,
21264
+ /**
21265
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
21266
+ *
21267
+ * See `RuntimeStateDurability`. Enforced by
21268
+ * `scripts/check-runtime-state-durability.ts`.
21269
+ */
21270
+ durability: "restored",
21271
+ /** Clock fields: written, but excluded from the compare that decides
21272
+ * whether persisting is worth a SQLite commit. */
21273
+ volatileStateFields: ["lastFetchedAt"]
21093
21274
  };
21094
21275
  /**
21095
21276
  * Per-class audio metrics aggregated over a sliding window.
@@ -21207,7 +21388,14 @@ var audioMetricsCapability = {
21207
21388
  }), AudioMetricsHistorySchema)
21208
21389
  },
21209
21390
  /** Reactive runtime-state mirror — live `device.state.audioMetrics.value`. */
21210
- runtimeState: AudioMetricsSnapshotSchema
21391
+ runtimeState: AudioMetricsSnapshotSchema,
21392
+ /**
21393
+ * 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.
21394
+ *
21395
+ * See `RuntimeStateDurability`. Enforced by
21396
+ * `scripts/check-runtime-state-durability.ts`.
21397
+ */
21398
+ durability: "session"
21211
21399
  };
21212
21400
  /**
21213
21401
  * Automation-control cap. Models HA `automation.*` entities on
@@ -21269,7 +21457,14 @@ var automationControlCapability = {
21269
21457
  * reads `enabled` (toggle) + `isRunning` (spinner) + `lastError`
21270
21458
  * (badge) directly.
21271
21459
  */
21272
- runtimeState: AutomationControlStatusSchema
21460
+ runtimeState: AutomationControlStatusSchema,
21461
+ /**
21462
+ * 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.
21463
+ *
21464
+ * See `RuntimeStateDurability`. Enforced by
21465
+ * `scripts/check-runtime-state-durability.ts`.
21466
+ */
21467
+ durability: "session"
21273
21468
  };
21274
21469
  /**
21275
21470
  * Battery status snapshot. Emitted by providers whose device is
@@ -21375,7 +21570,17 @@ onStatusChanged: { data: object({
21375
21570
  * via `device.runtimeState.getCapState('battery')` regardless of
21376
21571
  * the underlying driver.
21377
21572
  */
21378
- runtimeState: BatteryStatusSchema
21573
+ runtimeState: BatteryStatusSchema,
21574
+ /**
21575
+ * 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.
21576
+ *
21577
+ * See `RuntimeStateDurability`. Enforced by
21578
+ * `scripts/check-runtime-state-durability.ts`.
21579
+ */
21580
+ durability: "restored",
21581
+ /** Clock fields: written, but excluded from the compare that decides
21582
+ * whether persisting is worth a SQLite commit. */
21583
+ volatileStateFields: ["lastUpdated"]
21379
21584
  };
21380
21585
  /**
21381
21586
  * Generic boolean sensor — last-resort fallback when no domain-
@@ -21404,7 +21609,17 @@ var binaryCapability = {
21404
21609
  schema: BinaryStatusSchema,
21405
21610
  kind: "push"
21406
21611
  },
21407
- runtimeState: BinaryStatusSchema
21612
+ runtimeState: BinaryStatusSchema,
21613
+ /**
21614
+ * Runtime-state durability: **restored** — transition-driven sensor state; the restored value gives the boot comparison.
21615
+ *
21616
+ * See `RuntimeStateDurability`. Enforced by
21617
+ * `scripts/check-runtime-state-durability.ts`.
21618
+ */
21619
+ durability: "restored",
21620
+ /** Clock fields: written, but excluded from the compare that decides
21621
+ * whether persisting is worth a SQLite commit. */
21622
+ volatileStateFields: ["lastChangedAt"]
21408
21623
  };
21409
21624
  /**
21410
21625
  * Dimmable-light brightness control. Co-exists with `switch` on the
@@ -21457,7 +21672,14 @@ onBrightnessChanged: { data: object({
21457
21672
  * by the kernel. Read via `device.state.brightness.value` so UI
21458
21673
  * sliders surface the current level without polling the provider.
21459
21674
  */
21460
- runtimeState: BrightnessStatusSchema
21675
+ runtimeState: BrightnessStatusSchema,
21676
+ /**
21677
+ * Runtime-state durability: **session** — live lamp state, re-published by the provider on connect.
21678
+ *
21679
+ * See `RuntimeStateDurability`. Enforced by
21680
+ * `scripts/check-runtime-state-durability.ts`.
21681
+ */
21682
+ durability: "session"
21461
21683
  };
21462
21684
  DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
21463
21685
  kind: "mutation",
@@ -21545,7 +21767,17 @@ var carbonMonoxideCapability = {
21545
21767
  schema: CarbonMonoxideStatusSchema,
21546
21768
  kind: "push"
21547
21769
  },
21548
- runtimeState: CarbonMonoxideStatusSchema
21770
+ runtimeState: CarbonMonoxideStatusSchema,
21771
+ /**
21772
+ * Runtime-state durability: **restored** — as `smoke`.
21773
+ *
21774
+ * See `RuntimeStateDurability`. Enforced by
21775
+ * `scripts/check-runtime-state-durability.ts`.
21776
+ */
21777
+ durability: "restored",
21778
+ /** Clock fields: written, but excluded from the compare that decides
21779
+ * whether persisting is worth a SQLite commit. */
21780
+ volatileStateFields: ["lastChangedAt"]
21549
21781
  };
21550
21782
  /**
21551
21783
  * HVAC / climate control cap. Models the full surface of a HA
@@ -21705,7 +21937,14 @@ var climateControlCapability = {
21705
21937
  * the full slice via `device.state.climate-control.value` and refresh
21706
21938
  * on every push without re-querying the provider.
21707
21939
  */
21708
- runtimeState: ClimateControlStatusSchema
21940
+ runtimeState: ClimateControlStatusSchema,
21941
+ /**
21942
+ * Runtime-state durability: **session** — as `brightness`; `currentTemp` moves continuously and is re-published on connect.
21943
+ *
21944
+ * See `RuntimeStateDurability`. Enforced by
21945
+ * `scripts/check-runtime-state-durability.ts`.
21946
+ */
21947
+ durability: "session"
21709
21948
  };
21710
21949
  /**
21711
21950
  * Color-light cap. Coexists with `switch` (on/off) and `brightness`
@@ -21815,7 +22054,14 @@ onColorChanged: { data: object({
21815
22054
  * kernel. Read via `device.state.color.value` so UI pickers surface
21816
22055
  * the current chromaticity without polling the provider.
21817
22056
  */
21818
- runtimeState: ColorStatusSchema
22057
+ runtimeState: ColorStatusSchema,
22058
+ /**
22059
+ * Runtime-state durability: **session** — as `brightness`.
22060
+ *
22061
+ * See `RuntimeStateDurability`. Enforced by
22062
+ * `scripts/check-runtime-state-durability.ts`.
22063
+ */
22064
+ durability: "session"
21819
22065
  };
21820
22066
  var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
21821
22067
  object({
@@ -21873,7 +22119,17 @@ var connectivityCapability = {
21873
22119
  schema: ConnectivityStatusSchema,
21874
22120
  kind: "push"
21875
22121
  },
21876
- runtimeState: ConnectivityStatusSchema
22122
+ runtimeState: ConnectivityStatusSchema,
22123
+ /**
22124
+ * Runtime-state durability: **restored** — same shape and same argument as `device-status`, for links rather than devices.
22125
+ *
22126
+ * See `RuntimeStateDurability`. Enforced by
22127
+ * `scripts/check-runtime-state-durability.ts`.
22128
+ */
22129
+ durability: "restored",
22130
+ /** Clock fields: written, but excluded from the compare that decides
22131
+ * whether persisting is worth a SQLite commit. */
22132
+ volatileStateFields: ["lastChangedAt"]
21877
22133
  };
21878
22134
  /**
21879
22135
  * Generic device-consumables capability — surfaces a device's
@@ -21955,7 +22211,14 @@ reset: method(object({
21955
22211
  }
21956
22212
  }
21957
22213
  },
21958
- runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() })
22214
+ runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() }),
22215
+ /**
22216
+ * Runtime-state durability: **session** — the authority is the appliance; the provider re-reads the whole item array on connect.
22217
+ *
22218
+ * See `RuntimeStateDurability`. Enforced by
22219
+ * `scripts/check-runtime-state-durability.ts`.
22220
+ */
22221
+ durability: "session"
21959
22222
  };
21960
22223
  /**
21961
22224
  * Door / window / opening / garage / valve contact sensor. Boolean
@@ -21986,7 +22249,17 @@ var contactCapability = {
21986
22249
  schema: ContactStatusSchema,
21987
22250
  kind: "push"
21988
22251
  },
21989
- runtimeState: ContactStatusSchema
22252
+ runtimeState: ContactStatusSchema,
22253
+ /**
22254
+ * Runtime-state durability: **restored** — a door left open across a restart must still read open.
22255
+ *
22256
+ * See `RuntimeStateDurability`. Enforced by
22257
+ * `scripts/check-runtime-state-durability.ts`.
22258
+ */
22259
+ durability: "restored",
22260
+ /** Clock fields: written, but excluded from the compare that decides
22261
+ * whether persisting is worth a SQLite commit. */
22262
+ volatileStateFields: ["lastChangedAt"]
21990
22263
  };
21991
22264
  /**
21992
22265
  * Status slice — flat object (the framework's `runtimeState` contract
@@ -22092,7 +22365,14 @@ var controlCapability = {
22092
22365
  * dropdown / text field / date picker) read the slice's discriminant
22093
22366
  * and value directly without polling the provider.
22094
22367
  */
22095
- runtimeState: ControlStatusSchema
22368
+ runtimeState: ControlStatusSchema,
22369
+ /**
22370
+ * Runtime-state durability: **session** — a generic control mirrors an external entity that re-publishes on connect; the options array is re-derived with it.
22371
+ *
22372
+ * See `RuntimeStateDurability`. Enforced by
22373
+ * `scripts/check-runtime-state-durability.ts`.
22374
+ */
22375
+ durability: "session"
22096
22376
  };
22097
22377
  var CoverStatusSchema = object({
22098
22378
  /** Lifecycle state of the cover. */
@@ -22153,7 +22433,17 @@ var coverCapability = {
22153
22433
  * Runtime-state slice — mirrored by the kernel. UI controls watch
22154
22434
  * the slice for live position changes during a move.
22155
22435
  */
22156
- runtimeState: CoverStatusSchema
22436
+ runtimeState: CoverStatusSchema,
22437
+ /**
22438
+ * Runtime-state durability: **restored** — position survives a restart on the device; the mirror should agree at boot rather than read blank.
22439
+ *
22440
+ * See `RuntimeStateDurability`. Enforced by
22441
+ * `scripts/check-runtime-state-durability.ts`.
22442
+ */
22443
+ durability: "restored",
22444
+ /** Clock fields: written, but excluded from the compare that decides
22445
+ * whether persisting is worth a SQLite commit. */
22446
+ volatileStateFields: ["lastChangedAt"]
22157
22447
  };
22158
22448
  /**
22159
22449
  * Vendor-neutral day/night (IR-cut) control — the per-camera config cap
@@ -22247,7 +22537,17 @@ var dayNightCapability = {
22247
22537
  schema: DayNightStatusSchema,
22248
22538
  kind: "poll"
22249
22539
  },
22250
- runtimeState: DayNightStatusSchema
22540
+ runtimeState: DayNightStatusSchema,
22541
+ /**
22542
+ * Runtime-state durability: **restored** — operator-set IR-cut behaviour; mutation-driven.
22543
+ *
22544
+ * See `RuntimeStateDurability`. Enforced by
22545
+ * `scripts/check-runtime-state-durability.ts`.
22546
+ */
22547
+ durability: "restored",
22548
+ /** Clock fields: written, but excluded from the compare that decides
22549
+ * whether persisting is worth a SQLite commit. */
22550
+ volatileStateFields: ["lastFetchedAt"]
22251
22551
  };
22252
22552
  /**
22253
22553
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
@@ -22294,7 +22594,17 @@ onStatusChanged: { data: object({
22294
22594
  schema: DeviceStatusSchema,
22295
22595
  kind: "push"
22296
22596
  },
22297
- runtimeState: DeviceStatusSchema
22597
+ runtimeState: DeviceStatusSchema,
22598
+ /**
22599
+ * 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.
22600
+ *
22601
+ * See `RuntimeStateDurability`. Enforced by
22602
+ * `scripts/check-runtime-state-durability.ts`.
22603
+ */
22604
+ durability: "restored",
22605
+ /** Clock fields: written, but excluded from the compare that decides
22606
+ * whether persisting is worth a SQLite commit. */
22607
+ volatileStateFields: ["lastChangedAt"]
22298
22608
  };
22299
22609
  /**
22300
22610
  * Doorbell button cap. Two kinds of providers coexist behind this cap
@@ -22356,7 +22666,14 @@ onPressed: { data: DoorbellPressEventSchema } },
22356
22666
  * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
22357
22667
  * without subscribing.
22358
22668
  */
22359
- runtimeState: DoorbellStatusSchema
22669
+ runtimeState: DoorbellStatusSchema,
22670
+ /**
22671
+ * 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.
22672
+ *
22673
+ * See `RuntimeStateDurability`. Enforced by
22674
+ * `scripts/check-runtime-state-durability.ts`.
22675
+ */
22676
+ durability: "restored"
22360
22677
  };
22361
22678
  /**
22362
22679
  * Enum-state sensor — a string value picked from a finite option set.
@@ -22396,7 +22713,17 @@ var enumSensorCapability = {
22396
22713
  schema: EnumSensorStatusSchema,
22397
22714
  kind: "push"
22398
22715
  },
22399
- runtimeState: EnumSensorStatusSchema
22716
+ runtimeState: EnumSensorStatusSchema,
22717
+ /**
22718
+ * Runtime-state durability: **restored** — as `numeric-sensor`; 80 devices.
22719
+ *
22720
+ * See `RuntimeStateDurability`. Enforced by
22721
+ * `scripts/check-runtime-state-durability.ts`.
22722
+ */
22723
+ durability: "restored",
22724
+ /** Clock fields: written, but excluded from the compare that decides
22725
+ * whether persisting is worth a SQLite commit. */
22726
+ volatileStateFields: ["lastFetchedAt"]
22400
22727
  };
22401
22728
  /**
22402
22729
  * Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
@@ -22432,7 +22759,14 @@ var eventEmitterCapability = {
22432
22759
  schema: EventEmitterStatusSchema,
22433
22760
  kind: "push"
22434
22761
  },
22435
- runtimeState: EventEmitterStatusSchema
22762
+ runtimeState: EventEmitterStatusSchema,
22763
+ /**
22764
+ * Runtime-state durability: **session** — `eventCountSinceStart` names its own scope.
22765
+ *
22766
+ * See `RuntimeStateDurability`. Enforced by
22767
+ * `scripts/check-runtime-state-durability.ts`.
22768
+ */
22769
+ durability: "session"
22436
22770
  };
22437
22771
  var EventItemSchema = object({
22438
22772
  id: string(),
@@ -22713,7 +23047,14 @@ var fanControlCapability = {
22713
23047
  * Runtime-state slice — mirrored by the kernel. UI fan speed
22714
23048
  * sliders read `percentage` for live updates.
22715
23049
  */
22716
- runtimeState: FanControlStatusSchema
23050
+ runtimeState: FanControlStatusSchema,
23051
+ /**
23052
+ * Runtime-state durability: **session** — as `brightness`.
23053
+ *
23054
+ * See `RuntimeStateDurability`. Enforced by
23055
+ * `scripts/check-runtime-state-durability.ts`.
23056
+ */
23057
+ durability: "session"
22717
23058
  };
22718
23059
  /**
22719
23060
  * Per-device feature/identity probe slice. Holds the runtime-resolved
@@ -22789,7 +23130,14 @@ onProbeChanged: { data: object({
22789
23130
  schema: FeatureProbeStatusSchema,
22790
23131
  kind: "push"
22791
23132
  },
22792
- runtimeState: FeatureProbeStatusSchema
23133
+ runtimeState: FeatureProbeStatusSchema,
23134
+ /**
23135
+ * 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.
23136
+ *
23137
+ * See `RuntimeStateDurability`. Enforced by
23138
+ * `scripts/check-runtime-state-durability.ts`.
23139
+ */
23140
+ durability: "session"
22793
23141
  };
22794
23142
  /**
22795
23143
  * Water leak / moisture sensor. Boolean "is liquid currently
@@ -22816,7 +23164,17 @@ var floodCapability = {
22816
23164
  schema: FloodStatusSchema,
22817
23165
  kind: "push"
22818
23166
  },
22819
- runtimeState: FloodStatusSchema
23167
+ runtimeState: FloodStatusSchema,
23168
+ /**
23169
+ * Runtime-state durability: **restored** — as `smoke`.
23170
+ *
23171
+ * See `RuntimeStateDurability`. Enforced by
23172
+ * `scripts/check-runtime-state-durability.ts`.
23173
+ */
23174
+ durability: "restored",
23175
+ /** Clock fields: written, but excluded from the compare that decides
23176
+ * whether persisting is worth a SQLite commit. */
23177
+ volatileStateFields: ["lastChangedAt"]
22820
23178
  };
22821
23179
  /**
22822
23180
  * Combustible-gas (LPG / methane / hydrogen) alarm sensor. Drives
@@ -22839,7 +23197,17 @@ var gasCapability = {
22839
23197
  schema: GasStatusSchema,
22840
23198
  kind: "push"
22841
23199
  },
22842
- runtimeState: GasStatusSchema
23200
+ runtimeState: GasStatusSchema,
23201
+ /**
23202
+ * Runtime-state durability: **restored** — as `smoke`.
23203
+ *
23204
+ * See `RuntimeStateDurability`. Enforced by
23205
+ * `scripts/check-runtime-state-durability.ts`.
23206
+ */
23207
+ durability: "restored",
23208
+ /** Clock fields: written, but excluded from the compare that decides
23209
+ * whether persisting is worth a SQLite commit. */
23210
+ volatileStateFields: ["lastChangedAt"]
22843
23211
  };
22844
23212
  /**
22845
23213
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
@@ -22915,7 +23283,14 @@ var humidifierCapability = {
22915
23283
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22916
23284
  * slice for live humidity / mode changes.
22917
23285
  */
22918
- runtimeState: HumidifierStatusSchema
23286
+ runtimeState: HumidifierStatusSchema,
23287
+ /**
23288
+ * Runtime-state durability: **session** — as `climate-control`.
23289
+ *
23290
+ * See `RuntimeStateDurability`. Enforced by
23291
+ * `scripts/check-runtime-state-durability.ts`.
23292
+ */
23293
+ durability: "session"
22919
23294
  };
22920
23295
  /**
22921
23296
  * Single-metric humidity reading. Drives Home Assistant `sensor`
@@ -22951,7 +23326,17 @@ var humiditySensorCapability = {
22951
23326
  schema: HumiditySensorStatusSchema,
22952
23327
  kind: "push"
22953
23328
  },
22954
- runtimeState: HumiditySensorStatusSchema
23329
+ runtimeState: HumiditySensorStatusSchema,
23330
+ /**
23331
+ * Runtime-state durability: **restored** — as `numeric-sensor` (67 of 75 writes were the clock alone).
23332
+ *
23333
+ * See `RuntimeStateDurability`. Enforced by
23334
+ * `scripts/check-runtime-state-durability.ts`.
23335
+ */
23336
+ durability: "restored",
23337
+ /** Clock fields: written, but excluded from the compare that decides
23338
+ * whether persisting is worth a SQLite commit. */
23339
+ volatileStateFields: ["lastFetchedAt"]
22955
23340
  };
22956
23341
  /**
22957
23342
  * Image display cap. Models a single still image exposed by an integration —
@@ -22989,7 +23374,14 @@ var imageCapability = {
22989
23374
  * Runtime-state slice — mirrored by the kernel. The UI reads `url`
22990
23375
  * directly and renders the still image.
22991
23376
  */
22992
- runtimeState: ImageStatusSchema
23377
+ runtimeState: ImageStatusSchema,
23378
+ /**
23379
+ * Runtime-state durability: **session** — a snapshot URL is a session-scoped handle; a restored one points at nothing.
23380
+ *
23381
+ * See `RuntimeStateDurability`. Enforced by
23382
+ * `scripts/check-runtime-state-durability.ts`.
23383
+ */
23384
+ durability: "session"
22993
23385
  };
22994
23386
  /**
22995
23387
  * Vendor-neutral image / picture-adjustment cap — the per-camera config
@@ -23138,7 +23530,17 @@ var imageSettingsCapability = {
23138
23530
  schema: ImageSettingsStatusSchema,
23139
23531
  kind: "poll"
23140
23532
  },
23141
- runtimeState: ImageSettingsStatusSchema
23533
+ runtimeState: ImageSettingsStatusSchema,
23534
+ /**
23535
+ * Runtime-state durability: **restored** — operator-set camera imaging; mutation-driven.
23536
+ *
23537
+ * See `RuntimeStateDurability`. Enforced by
23538
+ * `scripts/check-runtime-state-durability.ts`.
23539
+ */
23540
+ durability: "restored",
23541
+ /** Clock fields: written, but excluded from the compare that decides
23542
+ * whether persisting is worth a SQLite commit. */
23543
+ volatileStateFields: ["lastFetchedAt"]
23142
23544
  };
23143
23545
  /**
23144
23546
  * integrations — system-scoped singleton capability for integration
@@ -23478,7 +23880,14 @@ var lawnMowerControlCapability = {
23478
23880
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
23479
23881
  * slice for live activity + battery changes.
23480
23882
  */
23481
- runtimeState: LawnMowerControlStatusSchema
23883
+ runtimeState: LawnMowerControlStatusSchema,
23884
+ /**
23885
+ * Runtime-state durability: **session** — as `vacuum-control`.
23886
+ *
23887
+ * See `RuntimeStateDurability`. Enforced by
23888
+ * `scripts/check-runtime-state-durability.ts`.
23889
+ */
23890
+ durability: "session"
23482
23891
  };
23483
23892
  /**
23484
23893
  * local-network — hub-only singleton.
@@ -23684,7 +24093,17 @@ var lockControlCapability = {
23684
24093
  * read `state` and disable themselves during `locking`/`unlocking`
23685
24094
  * transitions.
23686
24095
  */
23687
- runtimeState: LockControlStatusSchema
24096
+ runtimeState: LockControlStatusSchema,
24097
+ /**
24098
+ * Runtime-state durability: **restored** — a lock left locked must still read locked.
24099
+ *
24100
+ * See `RuntimeStateDurability`. Enforced by
24101
+ * `scripts/check-runtime-state-durability.ts`.
24102
+ */
24103
+ durability: "restored",
24104
+ /** Clock fields: written, but excluded from the compare that decides
24105
+ * whether persisting is worth a SQLite commit. */
24106
+ volatileStateFields: ["lastChangedAt"]
23688
24107
  };
23689
24108
  /**
23690
24109
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
@@ -23846,7 +24265,14 @@ var mediaPlayerCapability = {
23846
24265
  * full slice for live now-playing, volume, and progress updates
23847
24266
  * without polling.
23848
24267
  */
23849
- runtimeState: MediaPlayerStatusSchema
24268
+ runtimeState: MediaPlayerStatusSchema,
24269
+ /**
24270
+ * Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
24271
+ *
24272
+ * See `RuntimeStateDurability`. Enforced by
24273
+ * `scripts/check-runtime-state-durability.ts`.
24274
+ */
24275
+ durability: "session"
23850
24276
  };
23851
24277
  /**
23852
24278
  * mesh-network — collection cap for mesh-VPN providers.
@@ -24110,7 +24536,14 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
24110
24536
  * `device.state.motion.value`. Reads never invoke the provider, so
24111
24537
  * UIs and other addons can poll the cached state safely.
24112
24538
  */
24113
- runtimeState: MotionStatusSchema
24539
+ runtimeState: MotionStatusSchema,
24540
+ /**
24541
+ * 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.
24542
+ *
24543
+ * See `RuntimeStateDurability`. Enforced by
24544
+ * `scripts/check-runtime-state-durability.ts`.
24545
+ */
24546
+ durability: "session"
24114
24547
  };
24115
24548
  /**
24116
24549
  * Motion-trigger toggle for accessory devices.
@@ -24175,7 +24608,14 @@ var motionTriggerCapability = {
24175
24608
  schema: MotionTriggerStatusSchema,
24176
24609
  kind: "command-driven"
24177
24610
  },
24178
- runtimeState: MotionTriggerRuntimeStateSchema
24611
+ runtimeState: MotionTriggerRuntimeStateSchema,
24612
+ /**
24613
+ * 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.
24614
+ *
24615
+ * See `RuntimeStateDurability`. Enforced by
24616
+ * `scripts/check-runtime-state-durability.ts`.
24617
+ */
24618
+ durability: "session"
24179
24619
  };
24180
24620
  /**
24181
24621
  * Motion-zones share the same MaskShape vocabulary as privacy-mask — the
@@ -24242,7 +24682,17 @@ var motionZonesCapability = {
24242
24682
  schema: MotionZoneStatusSchema,
24243
24683
  kind: "poll"
24244
24684
  },
24245
- runtimeState: MotionZoneStatusSchema
24685
+ runtimeState: MotionZoneStatusSchema,
24686
+ /**
24687
+ * 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.
24688
+ *
24689
+ * See `RuntimeStateDurability`. Enforced by
24690
+ * `scripts/check-runtime-state-durability.ts`.
24691
+ */
24692
+ durability: "restored",
24693
+ /** Clock fields: written, but excluded from the compare that decides
24694
+ * whether persisting is worth a SQLite commit. */
24695
+ volatileStateFields: ["lastFetchedAt"]
24246
24696
  };
24247
24697
  /**
24248
24698
  * On-camera AI object detection cap. Surfaces per-device the classes
@@ -24316,7 +24766,17 @@ var nativeObjectDetectionCapability = {
24316
24766
  schema: NativeObjectDetectionStatusSchema,
24317
24767
  kind: "push"
24318
24768
  },
24319
- runtimeState: NativeObjectDetectionRuntimeStateSchema
24769
+ runtimeState: NativeObjectDetectionRuntimeStateSchema,
24770
+ /**
24771
+ * 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.
24772
+ *
24773
+ * See `RuntimeStateDurability`. Enforced by
24774
+ * `scripts/check-runtime-state-durability.ts`.
24775
+ */
24776
+ durability: "restored",
24777
+ /** Clock fields: written, but excluded from the compare that decides
24778
+ * whether persisting is worth a SQLite commit. */
24779
+ volatileStateFields: ["lastFetchedAt"]
24320
24780
  };
24321
24781
  /**
24322
24782
  * network-quality — system-scoped singleton capability tracking RTT,
@@ -24650,7 +25110,14 @@ onSent: { data: object({
24650
25110
  * form reads `supports` to gate optional fields; history pane reads
24651
25111
  * `lastSentAt` / `lastError` / `queueDepth`.
24652
25112
  */
24653
- runtimeState: NotifierStatusSchema
25113
+ runtimeState: NotifierStatusSchema,
25114
+ /**
25115
+ * Runtime-state durability: **session** — live queue depth and last-send state; a restored queue depth describes a queue that no longer exists.
25116
+ *
25117
+ * See `RuntimeStateDurability`. Enforced by
25118
+ * `scripts/check-runtime-state-durability.ts`.
25119
+ */
25120
+ durability: "session"
24654
25121
  };
24655
25122
  /**
24656
25123
  * Generic numeric sensor — last-resort fallback when no typed numeric
@@ -24693,7 +25160,17 @@ var numericSensorCapability = {
24693
25160
  schema: NumericSensorStatusSchema,
24694
25161
  kind: "push"
24695
25162
  },
24696
- runtimeState: NumericSensorStatusSchema
25163
+ runtimeState: NumericSensorStatusSchema,
25164
+ /**
25165
+ * 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.
25166
+ *
25167
+ * See `RuntimeStateDurability`. Enforced by
25168
+ * `scripts/check-runtime-state-durability.ts`.
25169
+ */
25170
+ durability: "restored",
25171
+ /** Clock fields: written, but excluded from the compare that decides
25172
+ * whether persisting is worth a SQLite commit. */
25173
+ volatileStateFields: ["lastFetchedAt"]
24697
25174
  };
24698
25175
  /**
24699
25176
  * Generic on-screen-display (video overlay) cap. Each camera exposes
@@ -25078,7 +25555,14 @@ var petFeederCapability = {
25078
25555
  * the full slice via `device.state.petFeeder.value` and refresh on
25079
25556
  * every poll without re-querying the provider.
25080
25557
  */
25081
- runtimeState: PetFeederStatusSchema
25558
+ runtimeState: PetFeederStatusSchema,
25559
+ /**
25560
+ * Runtime-state durability: **session** — live appliance state re-published on connect.
25561
+ *
25562
+ * See `RuntimeStateDurability`. Enforced by
25563
+ * `scripts/check-runtime-state-durability.ts`.
25564
+ */
25565
+ durability: "session"
25082
25566
  };
25083
25567
  var VehicleSchema = object({
25084
25568
  id: string(),
@@ -25390,7 +25874,17 @@ var powerMeterCapability = {
25390
25874
  schema: PowerMeterStatusSchema,
25391
25875
  kind: "push"
25392
25876
  },
25393
- runtimeState: PowerMeterStatusSchema
25877
+ runtimeState: PowerMeterStatusSchema,
25878
+ /**
25879
+ * Runtime-state durability: **restored** — as `numeric-sensor`; `kwhTotal` is an accumulator whose restored value is the baseline.
25880
+ *
25881
+ * See `RuntimeStateDurability`. Enforced by
25882
+ * `scripts/check-runtime-state-durability.ts`.
25883
+ */
25884
+ durability: "restored",
25885
+ /** Clock fields: written, but excluded from the compare that decides
25886
+ * whether persisting is worth a SQLite commit. */
25887
+ volatileStateFields: ["lastFetchedAt"]
25394
25888
  };
25395
25889
  /**
25396
25890
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -25447,7 +25941,17 @@ var presenceCapability = {
25447
25941
  * the map pin is rendered (use `DeviceFeature.PresenceGps` for the
25448
25942
  * pre-fetch fast-path check).
25449
25943
  */
25450
- runtimeState: PresenceStatusSchema
25944
+ runtimeState: PresenceStatusSchema,
25945
+ /**
25946
+ * Runtime-state durability: **restored** — occupancy-relevant: the restored state is what an occupancy rule compares the first post-restart observation against.
25947
+ *
25948
+ * See `RuntimeStateDurability`. Enforced by
25949
+ * `scripts/check-runtime-state-durability.ts`.
25950
+ */
25951
+ durability: "restored",
25952
+ /** Clock fields: written, but excluded from the compare that decides
25953
+ * whether persisting is worth a SQLite commit. */
25954
+ volatileStateFields: ["lastChangedAt"]
25451
25955
  };
25452
25956
  /**
25453
25957
  * Atmospheric pressure reading in hectopascals. Drives Home Assistant
@@ -25483,7 +25987,17 @@ var pressureSensorCapability = {
25483
25987
  schema: PressureSensorStatusSchema,
25484
25988
  kind: "push"
25485
25989
  },
25486
- runtimeState: PressureSensorStatusSchema
25990
+ runtimeState: PressureSensorStatusSchema,
25991
+ /**
25992
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
25993
+ *
25994
+ * See `RuntimeStateDurability`. Enforced by
25995
+ * `scripts/check-runtime-state-durability.ts`.
25996
+ */
25997
+ durability: "restored",
25998
+ /** Clock fields: written, but excluded from the compare that decides
25999
+ * whether persisting is worth a SQLite commit. */
26000
+ volatileStateFields: ["lastFetchedAt"]
25487
26001
  };
25488
26002
  /**
25489
26003
  * PRIVACY — what the camera deliberately does not capture. Two planes:
@@ -25613,7 +26127,17 @@ var privacyMaskCapability = {
25613
26127
  schema: PrivacyMaskStatusSchema,
25614
26128
  kind: "poll"
25615
26129
  },
25616
- runtimeState: PrivacyMaskStatusSchema
26130
+ runtimeState: PrivacyMaskStatusSchema,
26131
+ /**
26132
+ * Runtime-state durability: **restored** — operator-drawn regions, zero real churn — 22 writes in 25 minutes, every one of them the clock.
26133
+ *
26134
+ * See `RuntimeStateDurability`. Enforced by
26135
+ * `scripts/check-runtime-state-durability.ts`.
26136
+ */
26137
+ durability: "restored",
26138
+ /** Clock fields: written, but excluded from the compare that decides
26139
+ * whether persisting is worth a SQLite commit. */
26140
+ volatileStateFields: ["lastFetchedAt"]
25617
26141
  };
25618
26142
  var PtzPresetSchema = object({
25619
26143
  id: string(),
@@ -25779,7 +26303,14 @@ var ptzAutotrackCapability = {
25779
26303
  * fetch / cache / fallback logic out of the four cap methods —
25780
26304
  * they become trampolines over `runtimeState`.
25781
26305
  */
25782
- runtimeState: PtzAutotrackRuntimeStateSchema
26306
+ runtimeState: PtzAutotrackRuntimeStateSchema,
26307
+ /**
26308
+ * Runtime-state durability: **session** — mirrors the camera's own autotrack config, re-read on connect.
26309
+ *
26310
+ * See `RuntimeStateDurability`. Enforced by
26311
+ * `scripts/check-runtime-state-durability.ts`.
26312
+ */
26313
+ durability: "session"
25783
26314
  };
25784
26315
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
25785
26316
  kind: "mutation",
@@ -26429,7 +26960,14 @@ var sceneMonitorCapability = {
26429
26960
  schema: SceneMonitorStatusSchema,
26430
26961
  kind: "push"
26431
26962
  },
26432
- runtimeState: SceneMonitorStatusSchema
26963
+ runtimeState: SceneMonitorStatusSchema,
26964
+ /**
26965
+ * Runtime-state durability: **session** — re-derived from the current scene on the next evaluation.
26966
+ *
26967
+ * See `RuntimeStateDurability`. Enforced by
26968
+ * `scripts/check-runtime-state-durability.ts`.
26969
+ */
26970
+ durability: "session"
26433
26971
  };
26434
26972
  /**
26435
26973
  * Per-stage gating mode applied to the zones a rule references.
@@ -26573,7 +27111,14 @@ var scriptRunnerCapability = {
26573
27111
  * `isRunning` to render a spinner during execution and surfaces
26574
27112
  * `lastError` / `lastRunSuccess` in the recent-runs panel.
26575
27113
  */
26576
- runtimeState: ScriptRunnerStatusSchema
27114
+ runtimeState: ScriptRunnerStatusSchema,
27115
+ /**
27116
+ * Runtime-state durability: **session** — a restored `isRunning: true` describes a process that died with the previous hub.
27117
+ *
27118
+ * See `RuntimeStateDurability`. Enforced by
27119
+ * `scripts/check-runtime-state-durability.ts`.
27120
+ */
27121
+ durability: "session"
26577
27122
  };
26578
27123
  /**
26579
27124
  * Smoke alarm sensor — boolean "is smoke currently detected" with
@@ -26600,7 +27145,17 @@ var smokeCapability = {
26600
27145
  schema: SmokeStatusSchema,
26601
27146
  kind: "push"
26602
27147
  },
26603
- runtimeState: SmokeStatusSchema
27148
+ runtimeState: SmokeStatusSchema,
27149
+ /**
27150
+ * Runtime-state durability: **restored** — a safety sensor must not read "clear" merely because the hub restarted.
27151
+ *
27152
+ * See `RuntimeStateDurability`. Enforced by
27153
+ * `scripts/check-runtime-state-durability.ts`.
27154
+ */
27155
+ durability: "restored",
27156
+ /** Clock fields: written, but excluded from the compare that decides
27157
+ * whether persisting is worth a SQLite commit. */
27158
+ volatileStateFields: ["lastChangedAt"]
26604
27159
  };
26605
27160
  /**
26606
27161
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -26773,7 +27328,17 @@ var streamParamsCapability = {
26773
27328
  schema: StreamParamsStatusSchema,
26774
27329
  kind: "poll"
26775
27330
  },
26776
- runtimeState: StreamParamsStatusSchema
27331
+ runtimeState: StreamParamsStatusSchema,
27332
+ /**
27333
+ * Runtime-state durability: **restored** — operator-set encoder profile; mutation-driven.
27334
+ *
27335
+ * See `RuntimeStateDurability`. Enforced by
27336
+ * `scripts/check-runtime-state-durability.ts`.
27337
+ */
27338
+ durability: "restored",
27339
+ /** Clock fields: written, but excluded from the compare that decides
27340
+ * whether persisting is worth a SQLite commit. */
27341
+ volatileStateFields: ["lastFetchedAt"]
26777
27342
  };
26778
27343
  /**
26779
27344
  * Generic on/off switch cap for accessory children (siren, floodlight,
@@ -26819,6 +27384,16 @@ var switchCapability = {
26819
27384
  * not need to re-query the provider after a setState mutation.
26820
27385
  */
26821
27386
  runtimeState: SwitchStatusSchema,
27387
+ /**
27388
+ * Runtime-state durability: **restored** — device state an operator reads as authoritative; 55 devices, transition-driven.
27389
+ *
27390
+ * See `RuntimeStateDurability`. Enforced by
27391
+ * `scripts/check-runtime-state-durability.ts`.
27392
+ */
27393
+ durability: "restored",
27394
+ /** Clock fields: written, but excluded from the compare that decides
27395
+ * whether persisting is worth a SQLite commit. */
27396
+ volatileStateFields: ["lastChangedAt"],
26822
27397
  settings: { bindings: [{
26823
27398
  kind: "scalar",
26824
27399
  statusPath: "on",
@@ -26898,7 +27473,17 @@ var tamperCapability = {
26898
27473
  schema: TamperStatusSchema,
26899
27474
  kind: "push"
26900
27475
  },
26901
- runtimeState: TamperStatusSchema
27476
+ runtimeState: TamperStatusSchema,
27477
+ /**
27478
+ * Runtime-state durability: **restored** — as `smoke`.
27479
+ *
27480
+ * See `RuntimeStateDurability`. Enforced by
27481
+ * `scripts/check-runtime-state-durability.ts`.
27482
+ */
27483
+ durability: "restored",
27484
+ /** Clock fields: written, but excluded from the compare that decides
27485
+ * whether persisting is worth a SQLite commit. */
27486
+ volatileStateFields: ["lastChangedAt"]
26902
27487
  };
26903
27488
  /**
26904
27489
  * Single-metric temperature reading. Drives Home Assistant `sensor`
@@ -26943,7 +27528,17 @@ var temperatureSensorCapability = {
26943
27528
  schema: TemperatureSensorStatusSchema,
26944
27529
  kind: "push"
26945
27530
  },
26946
- runtimeState: TemperatureSensorStatusSchema
27531
+ runtimeState: TemperatureSensorStatusSchema,
27532
+ /**
27533
+ * Runtime-state durability: **restored** — as `numeric-sensor` (69 of 125 writes were the clock alone).
27534
+ *
27535
+ * See `RuntimeStateDurability`. Enforced by
27536
+ * `scripts/check-runtime-state-durability.ts`.
27537
+ */
27538
+ durability: "restored",
27539
+ /** Clock fields: written, but excluded from the compare that decides
27540
+ * whether persisting is worth a SQLite commit. */
27541
+ volatileStateFields: ["lastFetchedAt"]
26947
27542
  };
26948
27543
  /**
26949
27544
  * toast — system-scoped singleton capability that streams toast
@@ -27012,7 +27607,14 @@ var updateCapability = {
27012
27607
  schema: UpdateStatusSchema,
27013
27608
  kind: "poll"
27014
27609
  },
27015
- runtimeState: UpdateStatusSchema
27610
+ runtimeState: UpdateStatusSchema,
27611
+ /**
27612
+ * Runtime-state durability: **session** — a restored `inProgress: true` describes an update that is no longer running; versions are re-probed at boot.
27613
+ *
27614
+ * See `RuntimeStateDurability`. Enforced by
27615
+ * `scripts/check-runtime-state-durability.ts`.
27616
+ */
27617
+ durability: "session"
27016
27618
  };
27017
27619
  var UserSummarySchema = object({
27018
27620
  id: string(),
@@ -27346,7 +27948,14 @@ var vacuumControlCapability = {
27346
27948
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
27347
27949
  * slice for live state + battery + fan-speed changes.
27348
27950
  */
27349
- runtimeState: VacuumControlStatusSchema
27951
+ runtimeState: VacuumControlStatusSchema,
27952
+ /**
27953
+ * Runtime-state durability: **session** — as `media-player` — a restored `state: cleaning` is a robot that is not cleaning.
27954
+ *
27955
+ * See `RuntimeStateDurability`. Enforced by
27956
+ * `scripts/check-runtime-state-durability.ts`.
27957
+ */
27958
+ durability: "session"
27350
27959
  };
27351
27960
  var ValveStatusSchema = object({
27352
27961
  /** Lifecycle state of the valve. */
@@ -27398,7 +28007,14 @@ var valveCapability = {
27398
28007
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
27399
28008
  * slice for live position changes during a move.
27400
28009
  */
27401
- runtimeState: ValveStatusSchema
28010
+ runtimeState: ValveStatusSchema,
28011
+ /**
28012
+ * Runtime-state durability: **session** — as `brightness`.
28013
+ *
28014
+ * See `RuntimeStateDurability`. Enforced by
28015
+ * `scripts/check-runtime-state-durability.ts`.
28016
+ */
28017
+ durability: "session"
27402
28018
  };
27403
28019
  /**
27404
28020
  * Vibration / shake / impact sensor. Drives Home Assistant
@@ -27420,7 +28036,17 @@ var vibrationCapability = {
27420
28036
  schema: VibrationStatusSchema,
27421
28037
  kind: "push"
27422
28038
  },
27423
- runtimeState: VibrationStatusSchema
28039
+ runtimeState: VibrationStatusSchema,
28040
+ /**
28041
+ * Runtime-state durability: **restored** — as `smoke`.
28042
+ *
28043
+ * See `RuntimeStateDurability`. Enforced by
28044
+ * `scripts/check-runtime-state-durability.ts`.
28045
+ */
28046
+ durability: "restored",
28047
+ /** Clock fields: written, but excluded from the compare that decides
28048
+ * whether persisting is worth a SQLite commit. */
28049
+ volatileStateFields: ["lastChangedAt"]
27424
28050
  };
27425
28051
  /**
27426
28052
  * Water heater / boiler cap. Models HA `water_heater.*` entities — a
@@ -27494,7 +28120,14 @@ var waterHeaterCapability = {
27494
28120
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
27495
28121
  * slice for live temperature / mode / away changes.
27496
28122
  */
27497
- runtimeState: WaterHeaterStatusSchema
28123
+ runtimeState: WaterHeaterStatusSchema,
28124
+ /**
28125
+ * Runtime-state durability: **session** — as `climate-control`.
28126
+ *
28127
+ * See `RuntimeStateDurability`. Enforced by
28128
+ * `scripts/check-runtime-state-durability.ts`.
28129
+ */
28130
+ durability: "session"
27498
28131
  };
27499
28132
  /**
27500
28133
  * Weather provider cap. Models HA `weather.*` entities — a read-only
@@ -27553,7 +28186,14 @@ var weatherCapability = {
27553
28186
  * Runtime-state slice — mirrored by the kernel. The UI reads the
27554
28187
  * current conditions directly from the slice on each weather push.
27555
28188
  */
27556
- runtimeState: WeatherStatusSchema
28189
+ runtimeState: WeatherStatusSchema,
28190
+ /**
28191
+ * Runtime-state durability: **session** — a forecast is stale the moment the hub is down; the provider re-fetches on connect.
28192
+ *
28193
+ * See `RuntimeStateDurability`. Enforced by
28194
+ * `scripts/check-runtime-state-durability.ts`.
28195
+ */
28196
+ durability: "session"
27557
28197
  };
27558
28198
  /**
27559
28199
  * Per-zone occupancy aggregation produced by the analytics frame
@@ -27715,7 +28355,14 @@ var zoneAnalyticsCapability = {
27715
28355
  * automatically; the explicit `getCurrentSnapshot` cap method is
27716
28356
  * still useful for one-off polls without a subscription.
27717
28357
  */
27718
- runtimeState: CameraOccupancySnapshotSchema
28358
+ runtimeState: CameraOccupancySnapshotSchema,
28359
+ /**
28360
+ * Runtime-state durability: **session** — per-frame analytics; with `audio-metrics` it is ~90 % of the offered write rate. Re-derived on the next frame.
28361
+ *
28362
+ * See `RuntimeStateDurability`. Enforced by
28363
+ * `scripts/check-runtime-state-durability.ts`.
28364
+ */
28365
+ durability: "session"
27719
28366
  };
27720
28367
  /**
27721
28368
  * Stages a {@link ZoneRule} can apply to. Discriminator on the rules
@@ -27793,7 +28440,14 @@ var zoneRulesCapability = {
27793
28440
  motion: array(ZoneRuleSchema).readonly(),
27794
28441
  detection: array(ZoneRuleSchema).readonly(),
27795
28442
  package: array(ZoneRuleSchema).readonly()
27796
- })
28443
+ }),
28444
+ /**
28445
+ * Runtime-state durability: **restored** — operator intent, mutation-only, same argument as `zones`.
28446
+ *
28447
+ * See `RuntimeStateDurability`. Enforced by
28448
+ * `scripts/check-runtime-state-durability.ts`.
28449
+ */
28450
+ durability: "restored"
27797
28451
  };
27798
28452
  /**
27799
28453
  * Accessory device helpers — shared across drivers.
@@ -34480,6 +35134,7 @@ Object.freeze({
34480
35134
  "network-access": "ingress",
34481
35135
  "smtp-provider": "email"
34482
35136
  });
35137
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
34483
35138
  new Set(["devices", "classes"]);
34484
35139
  /**
34485
35140
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.