@camstack/addon-provider-unraid 0.2.15 → 0.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +732 -77
  2. package/dist/addon.mjs +732 -77
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -10771,7 +10771,14 @@ var cameraStreamsCapability = {
10771
10771
  low: string().optional()
10772
10772
  }),
10773
10773
  lastChangedAt: number()
10774
- })
10774
+ }),
10775
+ /**
10776
+ * 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.
10777
+ *
10778
+ * See `RuntimeStateDurability`. Enforced by
10779
+ * `scripts/check-runtime-state-durability.ts`.
10780
+ */
10781
+ durability: "session"
10775
10782
  };
10776
10783
  /** Where a block runs. The operator chooses — a block driving a device on an
10777
10784
  * agent is the reason placement is not fixed to the hub. */
@@ -11332,6 +11339,13 @@ var deviceDiscoveryCapability = {
11332
11339
  kind: "poll"
11333
11340
  },
11334
11341
  runtimeState: DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: number().int().nonnegative() }),
11342
+ /**
11343
+ * Runtime-state durability: **session** — 5.7 KB of scan output on the largest device, fully re-derivable by re-scanning.
11344
+ *
11345
+ * See `RuntimeStateDurability`. Enforced by
11346
+ * `scripts/check-runtime-state-durability.ts`.
11347
+ */
11348
+ durability: "session",
11335
11349
  methods: {
11336
11350
  /**
11337
11351
  * Snapshot of the current `discovered` list. Returns the
@@ -13201,11 +13215,33 @@ var NotificationFormatSchema = _enum([
13201
13215
  * Named by INTENT, never by glyph. "check" would tie the vocabulary to one
13202
13216
  * renderer's icon set; "acknowledge" survives an adapter that draws it
13203
13217
  * differently.
13218
+ *
13219
+ * ── A TOKEN IS NOT A WIRE VALUE ─────────────────────────────────────
13220
+ *
13221
+ * These names are for US. **No adapter may forward one verbatim.** Each maps
13222
+ * the whole set onto its own renderer's vocabulary through a
13223
+ * `Record<NotificationActionIcon, string>` — a Record, never a lookup with a
13224
+ * fallback, so adding a member here fails every adapter's build until someone
13225
+ * decides its glyph, which is the only place that decision can be made
13226
+ * honestly.
13227
+ *
13228
+ * This paragraph is the bug. Zentik declared `actionIcons: true` and passed
13229
+ * `disarm` straight through; iOS feeds that string to
13230
+ * `UNNotificationActionIcon(systemImageName:)`, `disarm` is not an SF Symbol,
13231
+ * and every snooze and alarm button arrived BLANK. A pass-through is not a
13232
+ * mapping, and "the field is documented" is not "the value renders".
13233
+ *
13234
+ * Adding a member is TRAIN-BOUND. The enum lives in the published
13235
+ * `@camstack/server` closure and the cap seam validates against the HUB's copy,
13236
+ * so an addon that emits a token the running hub does not know does not lose an
13237
+ * icon — its whole `send` fails Zod validation and the notification never
13238
+ * arrives. Never emit a new token from an addon before the train carrying it.
13204
13239
  */
13205
13240
  var NotificationActionIconSchema = _enum([
13206
13241
  "acknowledge",
13207
13242
  "dismiss",
13208
13243
  "silence",
13244
+ "snooze",
13209
13245
  "view",
13210
13246
  "play",
13211
13247
  "open",
@@ -13213,9 +13249,13 @@ var NotificationActionIconSchema = _enum([
13213
13249
  "lock",
13214
13250
  "unlock",
13215
13251
  "arm",
13252
+ "arm-home",
13253
+ "arm-away",
13254
+ "arm-night",
13216
13255
  "disarm",
13217
13256
  "light",
13218
- "alert"
13257
+ "alert",
13258
+ "camera"
13219
13259
  ]);
13220
13260
  /** A single tap-through action button. */
13221
13261
  var NotificationActionSchema = object({
@@ -13231,7 +13271,23 @@ var NotificationActionSchema = object({
13231
13271
  * else — see `notification-center/action-token.ts` for what that does and
13232
13272
  * does not buy.
13233
13273
  */
13234
- destructive: boolean().optional()
13274
+ destructive: boolean().optional(),
13275
+ /**
13276
+ * How the tap should REACH the url.
13277
+ *
13278
+ * `navigate` (absent, and every button authored before this field) opens it:
13279
+ * the phone leaves the notification and shows whatever the callback returns.
13280
+ * That is right for a button whose answer the operator wants to read.
13281
+ *
13282
+ * `background` fires it as a POST and stays put. It exists for the buttons
13283
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13284
+ * an answer to the notification, and being thrown into a browser tab to
13285
+ * confirm it costs more attention than the notification did. A backend that
13286
+ * cannot do a background call renders it as an ordinary link (the adapters
13287
+ * fall back rather than dropping the button), so this is a preference, never
13288
+ * a requirement.
13289
+ */
13290
+ mode: _enum(["navigate", "background"]).optional()
13235
13291
  });
13236
13292
  /**
13237
13293
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -13399,6 +13455,24 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
13399
13455
  targetId: string(),
13400
13456
  enabled: boolean()
13401
13457
  }), _void(), { kind: "mutation" });
13458
+ new Set([
13459
+ {
13460
+ id: "person",
13461
+ name: "Person"
13462
+ },
13463
+ {
13464
+ id: "vehicle",
13465
+ name: "Vehicle"
13466
+ },
13467
+ {
13468
+ id: "animal",
13469
+ name: "Animal"
13470
+ },
13471
+ {
13472
+ id: "package",
13473
+ name: "Package"
13474
+ }
13475
+ ].map((l) => l.id));
13402
13476
  var COCO_TO_MACRO = {
13403
13477
  mapping: {
13404
13478
  person: "person",
@@ -14083,7 +14157,17 @@ var alarmPanelCapability = {
14083
14157
  * full slice; renders an arm button per `availableModes` entry and
14084
14158
  * a PIN field iff `requiresCode === true`.
14085
14159
  */
14086
- runtimeState: AlarmPanelStatusSchema
14160
+ runtimeState: AlarmPanelStatusSchema,
14161
+ /**
14162
+ * Runtime-state durability: **restored** — armed state is the one thing a panel must not lose across a restart.
14163
+ *
14164
+ * See `RuntimeStateDurability`. Enforced by
14165
+ * `scripts/check-runtime-state-durability.ts`.
14166
+ */
14167
+ durability: "restored",
14168
+ /** Clock fields: written, but excluded from the compare that decides
14169
+ * whether persisting is worth a SQLite commit. */
14170
+ volatileStateFields: ["lastChangedAt"]
14087
14171
  };
14088
14172
  /**
14089
14173
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
@@ -14224,6 +14308,8 @@ var NcSystemEventKindSchema = _enum([
14224
14308
  "alarm-triggered",
14225
14309
  "alarm-armed",
14226
14310
  "alarm-disarmed",
14311
+ "alarm-arming",
14312
+ "alarm-arm-refused",
14227
14313
  "camera-online",
14228
14314
  "camera-offline",
14229
14315
  "camera-disabled",
@@ -14260,6 +14346,9 @@ var NcSystemEventConditionSchema = object({
14260
14346
  nodeIds: array(string().min(1)).min(1).optional(),
14261
14347
  packageNames: array(string().min(1)).min(1).optional()
14262
14348
  });
14349
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14350
+ * outage the operator asked for once and forgot. */
14351
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14263
14352
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14264
14353
  var NcScheduleSchema = object({
14265
14354
  windows: array(object({
@@ -14636,15 +14725,15 @@ var NcConditionsSchema = object({
14636
14725
  * (an `immediate` rule naming an `audio-*` class, one notification per
14637
14726
  * classified sample) stays exactly as it was for rules that already use it.
14638
14727
  *
14639
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14640
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14641
- * (`camstack/src/data/notification-center.ts`, guarded by
14642
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14728
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14729
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14730
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14731
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14643
14732
  * condition fields it does not know when a rule is saved from the phone.
14644
14733
  * Publishing an editor for a condition the app cannot round-trip is how an
14645
- * operator loses a rule's conditions by opening it — so the descriptor, the
14646
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14647
- * does an audio rule become authorable.
14734
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14735
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14736
+ * follows here.
14648
14737
  */
14649
14738
  audio: NcAudioConditionSchema.optional()
14650
14739
  });
@@ -14880,6 +14969,30 @@ var NcRuleInputSchema = object({
14880
14969
  */
14881
14970
  snoozeAllowGlobal: boolean().optional(),
14882
14971
  /**
14972
+ * The snooze durations THIS rule's notification offers as buttons, in
14973
+ * minutes.
14974
+ *
14975
+ * Three states, and all three are distinct — which is exactly why this is
14976
+ * `.optional()` and never `.default()`. A Zod default does not run on the
14977
+ * addon cap path (three production failures in one day), so a schema default
14978
+ * would collapse the first two:
14979
+ *
14980
+ * | value | meaning |
14981
+ * | --- | --- |
14982
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
14983
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
14984
+ * | a list | these choices, de-duplicated and sorted, at most four |
14985
+ *
14986
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
14987
+ * three buttons in total) and a rule that spent it all on snooze choices
14988
+ * would push its own tap-through actions off the notification.
14989
+ *
14990
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
14991
+ * that arms the panel, is exempt automatically and cannot be silenced by a
14992
+ * window from anywhere (D133).
14993
+ */
14994
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
14995
+ /**
14883
14996
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14884
14997
  *
14885
14998
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -14979,6 +15092,7 @@ var NcConditionDescriptorSchema = object({
14979
15092
  "device",
14980
15093
  "package",
14981
15094
  "occupancy",
15095
+ "audio",
14982
15096
  "system"
14983
15097
  ]),
14984
15098
  label: string(),
@@ -14997,6 +15111,7 @@ var NcConditionDescriptorSchema = object({
14997
15111
  "crossingSelect",
14998
15112
  "polygonDraw",
14999
15113
  "occupancy",
15114
+ "audio",
15000
15115
  "deviceState",
15001
15116
  "systemEvent"
15002
15117
  ]),
@@ -15148,7 +15263,20 @@ var NcSnoozeInputSchema = object({
15148
15263
  ruleId: string().optional(),
15149
15264
  /** Required when `scope: 'device'`. */
15150
15265
  deviceId: number().int().optional(),
15151
- durationMinutes: number().int().min(1).max(1440),
15266
+ /**
15267
+ * Narrow the window to these subject classes — "the cat, not the person".
15268
+ *
15269
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15270
+ * what every window authored before this field meant, so no persisted row
15271
+ * changes meaning and no client has to learn anything to keep working.
15272
+ *
15273
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15274
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15275
+ * not at whichever of their four rules happened to produce the notification
15276
+ * they are dismissing.
15277
+ */
15278
+ classes: array(string().min(1)).min(1).optional(),
15279
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
15152
15280
  /**
15153
15281
  * Silence this for EVERY recipient, not just the caller. Permission is
15154
15282
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15173,6 +15301,10 @@ var NcSnoozeSchema = object({
15173
15301
  scope: NcSnoozeScopeSchema,
15174
15302
  ruleId: string().optional(),
15175
15303
  deviceId: number().int().optional(),
15304
+ /** Subject classes this window covers. ABSENT = every class — see
15305
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15306
+ * no SQLite column: nothing queries a window by class. */
15307
+ classes: array(string().min(1)).min(1).optional(),
15176
15308
  startedAt: number(),
15177
15309
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15178
15310
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -17273,7 +17405,14 @@ var zonesCapability = {
17273
17405
  * handle. Slice shape is `{ zones: Zone[] }` so future extensions
17274
17406
  * (e.g. zone groupings) can sit alongside the polygon list.
17275
17407
  */
17276
- runtimeState: object({ zones: array(ZoneSchema).readonly() })
17408
+ runtimeState: object({ zones: array(ZoneSchema).readonly() }),
17409
+ /**
17410
+ * 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.
17411
+ *
17412
+ * See `RuntimeStateDurability`. Enforced by
17413
+ * `scripts/check-runtime-state-durability.ts`.
17414
+ */
17415
+ durability: "restored"
17277
17416
  };
17278
17417
  /**
17279
17418
  * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
@@ -17443,6 +17582,22 @@ var detectionFpsField = {
17443
17582
  default: 10,
17444
17583
  step: 1
17445
17584
  };
17585
+ /**
17586
+ * The occupancy re-check interval. DEFAULT 300 s (2026-08-13 — was 30 s).
17587
+ *
17588
+ * The recheck is now on by default (a parked car is invisible to occupancy
17589
+ * rules until the stationary registry has been rebuilt by motion, which after a
17590
+ * restart may be never on a quiet camera). Each cycle re-subscribes a detection
17591
+ * session — an RTSP re-dial — so the switch is only affordable at a WIDE
17592
+ * interval: 300 s is ~12 re-dials an hour per camera, against 120 at the old
17593
+ * 30 s. A parked car is therefore counted within 5 minutes of a restart.
17594
+ *
17595
+ * Why not wider: `max` is 300 and raising it is TRAIN-BOUND, not addon-bound —
17596
+ * the host validates `attachCamera` against ITS copy of this schema, so a
17597
+ * runner asked for 600 would be rejected by the hub until a `@camstack/server`
17598
+ * carrying the wider bound is installed everywhere. 300 is the widest value
17599
+ * that ships with an addon deploy.
17600
+ */
17446
17601
  var occupancyRecheckSecField = {
17447
17602
  min: 0,
17448
17603
  max: 300,
@@ -17644,15 +17799,21 @@ var RunnerCameraConfigSchema = object({
17644
17799
  */
17645
17800
  onboardMotionDrivesAnalyzer: boolean().default(true),
17646
17801
  /**
17647
- * Master toggle for the occupancy re-check. When `false` (DEFAULT) the runner
17648
- * never arms the periodic recheck timer, regardless of `occupancyRecheckSec`
17649
- * this is off by default because the recheck re-subscribes a detection session
17650
- * every N seconds while `watching`, a major source of pull-decoder re-dial
17651
- * churn (each cycle creates+tears a session → RTSP re-dial → latency). The
17802
+ * Master toggle for the occupancy re-check. When `false` the runner never arms
17803
+ * the periodic recheck timer, regardless of `occupancyRecheckSec`; the
17652
17804
  * `occupancyRecheckSec` / `occupancyRecheckFrames` sliders only take effect
17653
17805
  * (and only render) when this is enabled.
17654
- */
17655
- occupancyRecheckEnabled: boolean().default(false),
17806
+ *
17807
+ * DEFAULT `true` since 2026-08-13 (was `false`). It was off because the
17808
+ * recheck re-subscribes a detection session every N seconds while `watching`
17809
+ * — each cycle creates+tears a session ⇒ an RTSP re-dial ⇒ latency, a major
17810
+ * pull-decoder churn source. What that bought was a blind spot: a STATIONARY
17811
+ * object is counted only while the stationary registry holds it, and the
17812
+ * registry rebuilds from motion, so after a restart a parked car was invisible
17813
+ * to every occupancy rule until something moved in front of it. The churn is
17814
+ * now paid on the interval instead — see `occupancyRecheckSecField`.
17815
+ */
17816
+ occupancyRecheckEnabled: boolean().default(true),
17656
17817
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
17657
17818
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
17658
17819
  /**
@@ -20072,7 +20233,17 @@ var airQualitySensorCapability = {
20072
20233
  schema: AirQualitySensorStatusSchema,
20073
20234
  kind: "push"
20074
20235
  },
20075
- runtimeState: AirQualitySensorStatusSchema
20236
+ runtimeState: AirQualitySensorStatusSchema,
20237
+ /**
20238
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20239
+ *
20240
+ * See `RuntimeStateDurability`. Enforced by
20241
+ * `scripts/check-runtime-state-durability.ts`.
20242
+ */
20243
+ durability: "restored",
20244
+ /** Clock fields: written, but excluded from the compare that decides
20245
+ * whether persisting is worth a SQLite commit. */
20246
+ volatileStateFields: ["lastFetchedAt"]
20076
20247
  };
20077
20248
  /**
20078
20249
  * Ambient illuminance reading in lux. Drives Home Assistant `sensor`
@@ -20104,7 +20275,17 @@ var ambientLightSensorCapability = {
20104
20275
  schema: AmbientLightSensorStatusSchema,
20105
20276
  kind: "push"
20106
20277
  },
20107
- runtimeState: AmbientLightSensorStatusSchema
20278
+ runtimeState: AmbientLightSensorStatusSchema,
20279
+ /**
20280
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20281
+ *
20282
+ * See `RuntimeStateDurability`. Enforced by
20283
+ * `scripts/check-runtime-state-durability.ts`.
20284
+ */
20285
+ durability: "restored",
20286
+ /** Clock fields: written, but excluded from the compare that decides
20287
+ * whether persisting is worth a SQLite commit. */
20288
+ volatileStateFields: ["lastFetchedAt"]
20108
20289
  };
20109
20290
  /**
20110
20291
  * Per-class audio metrics aggregated over a sliding window.
@@ -20222,7 +20403,14 @@ var audioMetricsCapability = {
20222
20403
  }), AudioMetricsHistorySchema)
20223
20404
  },
20224
20405
  /** Reactive runtime-state mirror — live `device.state.audioMetrics.value`. */
20225
- runtimeState: AudioMetricsSnapshotSchema
20406
+ runtimeState: AudioMetricsSnapshotSchema,
20407
+ /**
20408
+ * 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.
20409
+ *
20410
+ * See `RuntimeStateDurability`. Enforced by
20411
+ * `scripts/check-runtime-state-durability.ts`.
20412
+ */
20413
+ durability: "session"
20226
20414
  };
20227
20415
  /**
20228
20416
  * Automation-control cap. Models HA `automation.*` entities on
@@ -20284,7 +20472,14 @@ var automationControlCapability = {
20284
20472
  * reads `enabled` (toggle) + `isRunning` (spinner) + `lastError`
20285
20473
  * (badge) directly.
20286
20474
  */
20287
- runtimeState: AutomationControlStatusSchema
20475
+ runtimeState: AutomationControlStatusSchema,
20476
+ /**
20477
+ * 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.
20478
+ *
20479
+ * See `RuntimeStateDurability`. Enforced by
20480
+ * `scripts/check-runtime-state-durability.ts`.
20481
+ */
20482
+ durability: "session"
20288
20483
  };
20289
20484
  /**
20290
20485
  * Battery status snapshot. Emitted by providers whose device is
@@ -20390,7 +20585,17 @@ onStatusChanged: { data: object({
20390
20585
  * via `device.runtimeState.getCapState('battery')` regardless of
20391
20586
  * the underlying driver.
20392
20587
  */
20393
- runtimeState: BatteryStatusSchema
20588
+ runtimeState: BatteryStatusSchema,
20589
+ /**
20590
+ * 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.
20591
+ *
20592
+ * See `RuntimeStateDurability`. Enforced by
20593
+ * `scripts/check-runtime-state-durability.ts`.
20594
+ */
20595
+ durability: "restored",
20596
+ /** Clock fields: written, but excluded from the compare that decides
20597
+ * whether persisting is worth a SQLite commit. */
20598
+ volatileStateFields: ["lastUpdated"]
20394
20599
  };
20395
20600
  /**
20396
20601
  * Generic boolean sensor — last-resort fallback when no domain-
@@ -20419,7 +20624,17 @@ var binaryCapability = {
20419
20624
  schema: BinaryStatusSchema,
20420
20625
  kind: "push"
20421
20626
  },
20422
- runtimeState: BinaryStatusSchema
20627
+ runtimeState: BinaryStatusSchema,
20628
+ /**
20629
+ * Runtime-state durability: **restored** — transition-driven sensor state; the restored value gives the boot comparison.
20630
+ *
20631
+ * See `RuntimeStateDurability`. Enforced by
20632
+ * `scripts/check-runtime-state-durability.ts`.
20633
+ */
20634
+ durability: "restored",
20635
+ /** Clock fields: written, but excluded from the compare that decides
20636
+ * whether persisting is worth a SQLite commit. */
20637
+ volatileStateFields: ["lastChangedAt"]
20423
20638
  };
20424
20639
  /**
20425
20640
  * Dimmable-light brightness control. Co-exists with `switch` on the
@@ -20472,7 +20687,14 @@ onBrightnessChanged: { data: object({
20472
20687
  * by the kernel. Read via `device.state.brightness.value` so UI
20473
20688
  * sliders surface the current level without polling the provider.
20474
20689
  */
20475
- runtimeState: BrightnessStatusSchema
20690
+ runtimeState: BrightnessStatusSchema,
20691
+ /**
20692
+ * Runtime-state durability: **session** — live lamp state, re-published by the provider on connect.
20693
+ *
20694
+ * See `RuntimeStateDurability`. Enforced by
20695
+ * `scripts/check-runtime-state-durability.ts`.
20696
+ */
20697
+ durability: "session"
20476
20698
  };
20477
20699
  /**
20478
20700
  * button — device-scoped capability for HA `button.*` / `input_button.*`
@@ -20577,7 +20799,17 @@ var carbonMonoxideCapability = {
20577
20799
  schema: CarbonMonoxideStatusSchema,
20578
20800
  kind: "push"
20579
20801
  },
20580
- runtimeState: CarbonMonoxideStatusSchema
20802
+ runtimeState: CarbonMonoxideStatusSchema,
20803
+ /**
20804
+ * Runtime-state durability: **restored** — as `smoke`.
20805
+ *
20806
+ * See `RuntimeStateDurability`. Enforced by
20807
+ * `scripts/check-runtime-state-durability.ts`.
20808
+ */
20809
+ durability: "restored",
20810
+ /** Clock fields: written, but excluded from the compare that decides
20811
+ * whether persisting is worth a SQLite commit. */
20812
+ volatileStateFields: ["lastChangedAt"]
20581
20813
  };
20582
20814
  /**
20583
20815
  * HVAC / climate control cap. Models the full surface of a HA
@@ -20737,7 +20969,14 @@ var climateControlCapability = {
20737
20969
  * the full slice via `device.state.climate-control.value` and refresh
20738
20970
  * on every push without re-querying the provider.
20739
20971
  */
20740
- runtimeState: ClimateControlStatusSchema
20972
+ runtimeState: ClimateControlStatusSchema,
20973
+ /**
20974
+ * Runtime-state durability: **session** — as `brightness`; `currentTemp` moves continuously and is re-published on connect.
20975
+ *
20976
+ * See `RuntimeStateDurability`. Enforced by
20977
+ * `scripts/check-runtime-state-durability.ts`.
20978
+ */
20979
+ durability: "session"
20741
20980
  };
20742
20981
  /**
20743
20982
  * Color-light cap. Coexists with `switch` (on/off) and `brightness`
@@ -20847,7 +21086,14 @@ onColorChanged: { data: object({
20847
21086
  * kernel. Read via `device.state.color.value` so UI pickers surface
20848
21087
  * the current chromaticity without polling the provider.
20849
21088
  */
20850
- runtimeState: ColorStatusSchema
21089
+ runtimeState: ColorStatusSchema,
21090
+ /**
21091
+ * Runtime-state durability: **session** — as `brightness`.
21092
+ *
21093
+ * See `RuntimeStateDurability`. Enforced by
21094
+ * `scripts/check-runtime-state-durability.ts`.
21095
+ */
21096
+ durability: "session"
20851
21097
  };
20852
21098
  var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
20853
21099
  object({
@@ -20905,7 +21151,17 @@ var connectivityCapability = {
20905
21151
  schema: ConnectivityStatusSchema,
20906
21152
  kind: "push"
20907
21153
  },
20908
- runtimeState: ConnectivityStatusSchema
21154
+ runtimeState: ConnectivityStatusSchema,
21155
+ /**
21156
+ * Runtime-state durability: **restored** — same shape and same argument as `device-status`, for links rather than devices.
21157
+ *
21158
+ * See `RuntimeStateDurability`. Enforced by
21159
+ * `scripts/check-runtime-state-durability.ts`.
21160
+ */
21161
+ durability: "restored",
21162
+ /** Clock fields: written, but excluded from the compare that decides
21163
+ * whether persisting is worth a SQLite commit. */
21164
+ volatileStateFields: ["lastChangedAt"]
20909
21165
  };
20910
21166
  /**
20911
21167
  * Generic device-consumables capability — surfaces a device's
@@ -20987,7 +21243,14 @@ reset: method(object({
20987
21243
  }
20988
21244
  }
20989
21245
  },
20990
- runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() })
21246
+ runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() }),
21247
+ /**
21248
+ * Runtime-state durability: **session** — the authority is the appliance; the provider re-reads the whole item array on connect.
21249
+ *
21250
+ * See `RuntimeStateDurability`. Enforced by
21251
+ * `scripts/check-runtime-state-durability.ts`.
21252
+ */
21253
+ durability: "session"
20991
21254
  };
20992
21255
  /**
20993
21256
  * Door / window / opening / garage / valve contact sensor. Boolean
@@ -21018,7 +21281,17 @@ var contactCapability = {
21018
21281
  schema: ContactStatusSchema,
21019
21282
  kind: "push"
21020
21283
  },
21021
- runtimeState: ContactStatusSchema
21284
+ runtimeState: ContactStatusSchema,
21285
+ /**
21286
+ * Runtime-state durability: **restored** — a door left open across a restart must still read open.
21287
+ *
21288
+ * See `RuntimeStateDurability`. Enforced by
21289
+ * `scripts/check-runtime-state-durability.ts`.
21290
+ */
21291
+ durability: "restored",
21292
+ /** Clock fields: written, but excluded from the compare that decides
21293
+ * whether persisting is worth a SQLite commit. */
21294
+ volatileStateFields: ["lastChangedAt"]
21022
21295
  };
21023
21296
  /**
21024
21297
  * Status slice — flat object (the framework's `runtimeState` contract
@@ -21124,7 +21397,14 @@ var controlCapability = {
21124
21397
  * dropdown / text field / date picker) read the slice's discriminant
21125
21398
  * and value directly without polling the provider.
21126
21399
  */
21127
- runtimeState: ControlStatusSchema
21400
+ runtimeState: ControlStatusSchema,
21401
+ /**
21402
+ * Runtime-state durability: **session** — a generic control mirrors an external entity that re-publishes on connect; the options array is re-derived with it.
21403
+ *
21404
+ * See `RuntimeStateDurability`. Enforced by
21405
+ * `scripts/check-runtime-state-durability.ts`.
21406
+ */
21407
+ durability: "session"
21128
21408
  };
21129
21409
  var CoverStatusSchema = object({
21130
21410
  /** Lifecycle state of the cover. */
@@ -21185,7 +21465,17 @@ var coverCapability = {
21185
21465
  * Runtime-state slice — mirrored by the kernel. UI controls watch
21186
21466
  * the slice for live position changes during a move.
21187
21467
  */
21188
- runtimeState: CoverStatusSchema
21468
+ runtimeState: CoverStatusSchema,
21469
+ /**
21470
+ * Runtime-state durability: **restored** — position survives a restart on the device; the mirror should agree at boot rather than read blank.
21471
+ *
21472
+ * See `RuntimeStateDurability`. Enforced by
21473
+ * `scripts/check-runtime-state-durability.ts`.
21474
+ */
21475
+ durability: "restored",
21476
+ /** Clock fields: written, but excluded from the compare that decides
21477
+ * whether persisting is worth a SQLite commit. */
21478
+ volatileStateFields: ["lastChangedAt"]
21189
21479
  };
21190
21480
  /**
21191
21481
  * Vendor-neutral day/night (IR-cut) control — the per-camera config cap
@@ -21279,7 +21569,17 @@ var dayNightCapability = {
21279
21569
  schema: DayNightStatusSchema,
21280
21570
  kind: "poll"
21281
21571
  },
21282
- runtimeState: DayNightStatusSchema
21572
+ runtimeState: DayNightStatusSchema,
21573
+ /**
21574
+ * Runtime-state durability: **restored** — operator-set IR-cut behaviour; mutation-driven.
21575
+ *
21576
+ * See `RuntimeStateDurability`. Enforced by
21577
+ * `scripts/check-runtime-state-durability.ts`.
21578
+ */
21579
+ durability: "restored",
21580
+ /** Clock fields: written, but excluded from the compare that decides
21581
+ * whether persisting is worth a SQLite commit. */
21582
+ volatileStateFields: ["lastFetchedAt"]
21283
21583
  };
21284
21584
  /**
21285
21585
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
@@ -21326,7 +21626,17 @@ onStatusChanged: { data: object({
21326
21626
  schema: DeviceStatusSchema,
21327
21627
  kind: "push"
21328
21628
  },
21329
- runtimeState: DeviceStatusSchema
21629
+ runtimeState: DeviceStatusSchema,
21630
+ /**
21631
+ * 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.
21632
+ *
21633
+ * See `RuntimeStateDurability`. Enforced by
21634
+ * `scripts/check-runtime-state-durability.ts`.
21635
+ */
21636
+ durability: "restored",
21637
+ /** Clock fields: written, but excluded from the compare that decides
21638
+ * whether persisting is worth a SQLite commit. */
21639
+ volatileStateFields: ["lastChangedAt"]
21330
21640
  };
21331
21641
  /**
21332
21642
  * Doorbell button cap. Two kinds of providers coexist behind this cap
@@ -21388,7 +21698,14 @@ onPressed: { data: DoorbellPressEventSchema } },
21388
21698
  * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
21389
21699
  * without subscribing.
21390
21700
  */
21391
- runtimeState: DoorbellStatusSchema
21701
+ runtimeState: DoorbellStatusSchema,
21702
+ /**
21703
+ * 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.
21704
+ *
21705
+ * See `RuntimeStateDurability`. Enforced by
21706
+ * `scripts/check-runtime-state-durability.ts`.
21707
+ */
21708
+ durability: "restored"
21392
21709
  };
21393
21710
  /**
21394
21711
  * Enum-state sensor — a string value picked from a finite option set.
@@ -21428,7 +21745,17 @@ var enumSensorCapability = {
21428
21745
  schema: EnumSensorStatusSchema,
21429
21746
  kind: "push"
21430
21747
  },
21431
- runtimeState: EnumSensorStatusSchema
21748
+ runtimeState: EnumSensorStatusSchema,
21749
+ /**
21750
+ * Runtime-state durability: **restored** — as `numeric-sensor`; 80 devices.
21751
+ *
21752
+ * See `RuntimeStateDurability`. Enforced by
21753
+ * `scripts/check-runtime-state-durability.ts`.
21754
+ */
21755
+ durability: "restored",
21756
+ /** Clock fields: written, but excluded from the compare that decides
21757
+ * whether persisting is worth a SQLite commit. */
21758
+ volatileStateFields: ["lastFetchedAt"]
21432
21759
  };
21433
21760
  /**
21434
21761
  * Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
@@ -21464,7 +21791,14 @@ var eventEmitterCapability = {
21464
21791
  schema: EventEmitterStatusSchema,
21465
21792
  kind: "push"
21466
21793
  },
21467
- runtimeState: EventEmitterStatusSchema
21794
+ runtimeState: EventEmitterStatusSchema,
21795
+ /**
21796
+ * Runtime-state durability: **session** — `eventCountSinceStart` names its own scope.
21797
+ *
21798
+ * See `RuntimeStateDurability`. Enforced by
21799
+ * `scripts/check-runtime-state-durability.ts`.
21800
+ */
21801
+ durability: "session"
21468
21802
  };
21469
21803
  var EventItemSchema = object({
21470
21804
  id: string(),
@@ -21745,7 +22079,14 @@ var fanControlCapability = {
21745
22079
  * Runtime-state slice — mirrored by the kernel. UI fan speed
21746
22080
  * sliders read `percentage` for live updates.
21747
22081
  */
21748
- runtimeState: FanControlStatusSchema
22082
+ runtimeState: FanControlStatusSchema,
22083
+ /**
22084
+ * Runtime-state durability: **session** — as `brightness`.
22085
+ *
22086
+ * See `RuntimeStateDurability`. Enforced by
22087
+ * `scripts/check-runtime-state-durability.ts`.
22088
+ */
22089
+ durability: "session"
21749
22090
  };
21750
22091
  /**
21751
22092
  * Per-device feature/identity probe slice. Holds the runtime-resolved
@@ -21821,7 +22162,14 @@ onProbeChanged: { data: object({
21821
22162
  schema: FeatureProbeStatusSchema,
21822
22163
  kind: "push"
21823
22164
  },
21824
- runtimeState: FeatureProbeStatusSchema
22165
+ runtimeState: FeatureProbeStatusSchema,
22166
+ /**
22167
+ * 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.
22168
+ *
22169
+ * See `RuntimeStateDurability`. Enforced by
22170
+ * `scripts/check-runtime-state-durability.ts`.
22171
+ */
22172
+ durability: "session"
21825
22173
  };
21826
22174
  /**
21827
22175
  * Water leak / moisture sensor. Boolean "is liquid currently
@@ -21848,7 +22196,17 @@ var floodCapability = {
21848
22196
  schema: FloodStatusSchema,
21849
22197
  kind: "push"
21850
22198
  },
21851
- runtimeState: FloodStatusSchema
22199
+ runtimeState: FloodStatusSchema,
22200
+ /**
22201
+ * Runtime-state durability: **restored** — as `smoke`.
22202
+ *
22203
+ * See `RuntimeStateDurability`. Enforced by
22204
+ * `scripts/check-runtime-state-durability.ts`.
22205
+ */
22206
+ durability: "restored",
22207
+ /** Clock fields: written, but excluded from the compare that decides
22208
+ * whether persisting is worth a SQLite commit. */
22209
+ volatileStateFields: ["lastChangedAt"]
21852
22210
  };
21853
22211
  /**
21854
22212
  * Combustible-gas (LPG / methane / hydrogen) alarm sensor. Drives
@@ -21871,7 +22229,17 @@ var gasCapability = {
21871
22229
  schema: GasStatusSchema,
21872
22230
  kind: "push"
21873
22231
  },
21874
- runtimeState: GasStatusSchema
22232
+ runtimeState: GasStatusSchema,
22233
+ /**
22234
+ * Runtime-state durability: **restored** — as `smoke`.
22235
+ *
22236
+ * See `RuntimeStateDurability`. Enforced by
22237
+ * `scripts/check-runtime-state-durability.ts`.
22238
+ */
22239
+ durability: "restored",
22240
+ /** Clock fields: written, but excluded from the compare that decides
22241
+ * whether persisting is worth a SQLite commit. */
22242
+ volatileStateFields: ["lastChangedAt"]
21875
22243
  };
21876
22244
  /**
21877
22245
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
@@ -21947,7 +22315,14 @@ var humidifierCapability = {
21947
22315
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
21948
22316
  * slice for live humidity / mode changes.
21949
22317
  */
21950
- runtimeState: HumidifierStatusSchema
22318
+ runtimeState: HumidifierStatusSchema,
22319
+ /**
22320
+ * Runtime-state durability: **session** — as `climate-control`.
22321
+ *
22322
+ * See `RuntimeStateDurability`. Enforced by
22323
+ * `scripts/check-runtime-state-durability.ts`.
22324
+ */
22325
+ durability: "session"
21951
22326
  };
21952
22327
  /**
21953
22328
  * Single-metric humidity reading. Drives Home Assistant `sensor`
@@ -21983,7 +22358,17 @@ var humiditySensorCapability = {
21983
22358
  schema: HumiditySensorStatusSchema,
21984
22359
  kind: "push"
21985
22360
  },
21986
- runtimeState: HumiditySensorStatusSchema
22361
+ runtimeState: HumiditySensorStatusSchema,
22362
+ /**
22363
+ * Runtime-state durability: **restored** — as `numeric-sensor` (67 of 75 writes were the clock alone).
22364
+ *
22365
+ * See `RuntimeStateDurability`. Enforced by
22366
+ * `scripts/check-runtime-state-durability.ts`.
22367
+ */
22368
+ durability: "restored",
22369
+ /** Clock fields: written, but excluded from the compare that decides
22370
+ * whether persisting is worth a SQLite commit. */
22371
+ volatileStateFields: ["lastFetchedAt"]
21987
22372
  };
21988
22373
  /**
21989
22374
  * Image display cap. Models a single still image exposed by an integration —
@@ -22021,7 +22406,14 @@ var imageCapability = {
22021
22406
  * Runtime-state slice — mirrored by the kernel. The UI reads `url`
22022
22407
  * directly and renders the still image.
22023
22408
  */
22024
- runtimeState: ImageStatusSchema
22409
+ runtimeState: ImageStatusSchema,
22410
+ /**
22411
+ * Runtime-state durability: **session** — a snapshot URL is a session-scoped handle; a restored one points at nothing.
22412
+ *
22413
+ * See `RuntimeStateDurability`. Enforced by
22414
+ * `scripts/check-runtime-state-durability.ts`.
22415
+ */
22416
+ durability: "session"
22025
22417
  };
22026
22418
  /**
22027
22419
  * Vendor-neutral image / picture-adjustment cap — the per-camera config
@@ -22170,7 +22562,17 @@ var imageSettingsCapability = {
22170
22562
  schema: ImageSettingsStatusSchema,
22171
22563
  kind: "poll"
22172
22564
  },
22173
- runtimeState: ImageSettingsStatusSchema
22565
+ runtimeState: ImageSettingsStatusSchema,
22566
+ /**
22567
+ * Runtime-state durability: **restored** — operator-set camera imaging; mutation-driven.
22568
+ *
22569
+ * See `RuntimeStateDurability`. Enforced by
22570
+ * `scripts/check-runtime-state-durability.ts`.
22571
+ */
22572
+ durability: "restored",
22573
+ /** Clock fields: written, but excluded from the compare that decides
22574
+ * whether persisting is worth a SQLite commit. */
22575
+ volatileStateFields: ["lastFetchedAt"]
22174
22576
  };
22175
22577
  /**
22176
22578
  * integrations — system-scoped singleton capability for integration
@@ -22510,7 +22912,14 @@ var lawnMowerControlCapability = {
22510
22912
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22511
22913
  * slice for live activity + battery changes.
22512
22914
  */
22513
- runtimeState: LawnMowerControlStatusSchema
22915
+ runtimeState: LawnMowerControlStatusSchema,
22916
+ /**
22917
+ * Runtime-state durability: **session** — as `vacuum-control`.
22918
+ *
22919
+ * See `RuntimeStateDurability`. Enforced by
22920
+ * `scripts/check-runtime-state-durability.ts`.
22921
+ */
22922
+ durability: "session"
22514
22923
  };
22515
22924
  /**
22516
22925
  * local-network — hub-only singleton.
@@ -22716,7 +23125,17 @@ var lockControlCapability = {
22716
23125
  * read `state` and disable themselves during `locking`/`unlocking`
22717
23126
  * transitions.
22718
23127
  */
22719
- runtimeState: LockControlStatusSchema
23128
+ runtimeState: LockControlStatusSchema,
23129
+ /**
23130
+ * Runtime-state durability: **restored** — a lock left locked must still read locked.
23131
+ *
23132
+ * See `RuntimeStateDurability`. Enforced by
23133
+ * `scripts/check-runtime-state-durability.ts`.
23134
+ */
23135
+ durability: "restored",
23136
+ /** Clock fields: written, but excluded from the compare that decides
23137
+ * whether persisting is worth a SQLite commit. */
23138
+ volatileStateFields: ["lastChangedAt"]
22720
23139
  };
22721
23140
  /**
22722
23141
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
@@ -22878,7 +23297,14 @@ var mediaPlayerCapability = {
22878
23297
  * full slice for live now-playing, volume, and progress updates
22879
23298
  * without polling.
22880
23299
  */
22881
- runtimeState: MediaPlayerStatusSchema
23300
+ runtimeState: MediaPlayerStatusSchema,
23301
+ /**
23302
+ * Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
23303
+ *
23304
+ * See `RuntimeStateDurability`. Enforced by
23305
+ * `scripts/check-runtime-state-durability.ts`.
23306
+ */
23307
+ durability: "session"
22882
23308
  };
22883
23309
  /**
22884
23310
  * mesh-network — collection cap for mesh-VPN providers.
@@ -23142,7 +23568,14 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
23142
23568
  * `device.state.motion.value`. Reads never invoke the provider, so
23143
23569
  * UIs and other addons can poll the cached state safely.
23144
23570
  */
23145
- runtimeState: MotionStatusSchema
23571
+ runtimeState: MotionStatusSchema,
23572
+ /**
23573
+ * 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.
23574
+ *
23575
+ * See `RuntimeStateDurability`. Enforced by
23576
+ * `scripts/check-runtime-state-durability.ts`.
23577
+ */
23578
+ durability: "session"
23146
23579
  };
23147
23580
  /**
23148
23581
  * Motion-trigger toggle for accessory devices.
@@ -23207,7 +23640,14 @@ var motionTriggerCapability = {
23207
23640
  schema: MotionTriggerStatusSchema,
23208
23641
  kind: "command-driven"
23209
23642
  },
23210
- runtimeState: MotionTriggerRuntimeStateSchema
23643
+ runtimeState: MotionTriggerRuntimeStateSchema,
23644
+ /**
23645
+ * 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.
23646
+ *
23647
+ * See `RuntimeStateDurability`. Enforced by
23648
+ * `scripts/check-runtime-state-durability.ts`.
23649
+ */
23650
+ durability: "session"
23211
23651
  };
23212
23652
  /**
23213
23653
  * Motion-zones share the same MaskShape vocabulary as privacy-mask — the
@@ -23274,7 +23714,17 @@ var motionZonesCapability = {
23274
23714
  schema: MotionZoneStatusSchema,
23275
23715
  kind: "poll"
23276
23716
  },
23277
- runtimeState: MotionZoneStatusSchema
23717
+ runtimeState: MotionZoneStatusSchema,
23718
+ /**
23719
+ * 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.
23720
+ *
23721
+ * See `RuntimeStateDurability`. Enforced by
23722
+ * `scripts/check-runtime-state-durability.ts`.
23723
+ */
23724
+ durability: "restored",
23725
+ /** Clock fields: written, but excluded from the compare that decides
23726
+ * whether persisting is worth a SQLite commit. */
23727
+ volatileStateFields: ["lastFetchedAt"]
23278
23728
  };
23279
23729
  /**
23280
23730
  * On-camera AI object detection cap. Surfaces per-device the classes
@@ -23348,7 +23798,17 @@ var nativeObjectDetectionCapability = {
23348
23798
  schema: NativeObjectDetectionStatusSchema,
23349
23799
  kind: "push"
23350
23800
  },
23351
- runtimeState: NativeObjectDetectionRuntimeStateSchema
23801
+ runtimeState: NativeObjectDetectionRuntimeStateSchema,
23802
+ /**
23803
+ * 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.
23804
+ *
23805
+ * See `RuntimeStateDurability`. Enforced by
23806
+ * `scripts/check-runtime-state-durability.ts`.
23807
+ */
23808
+ durability: "restored",
23809
+ /** Clock fields: written, but excluded from the compare that decides
23810
+ * whether persisting is worth a SQLite commit. */
23811
+ volatileStateFields: ["lastFetchedAt"]
23352
23812
  };
23353
23813
  /**
23354
23814
  * network-quality — system-scoped singleton capability tracking RTT,
@@ -23682,7 +24142,14 @@ onSent: { data: object({
23682
24142
  * form reads `supports` to gate optional fields; history pane reads
23683
24143
  * `lastSentAt` / `lastError` / `queueDepth`.
23684
24144
  */
23685
- runtimeState: NotifierStatusSchema
24145
+ runtimeState: NotifierStatusSchema,
24146
+ /**
24147
+ * Runtime-state durability: **session** — live queue depth and last-send state; a restored queue depth describes a queue that no longer exists.
24148
+ *
24149
+ * See `RuntimeStateDurability`. Enforced by
24150
+ * `scripts/check-runtime-state-durability.ts`.
24151
+ */
24152
+ durability: "session"
23686
24153
  };
23687
24154
  /**
23688
24155
  * Generic numeric sensor — last-resort fallback when no typed numeric
@@ -23725,7 +24192,17 @@ var numericSensorCapability = {
23725
24192
  schema: NumericSensorStatusSchema,
23726
24193
  kind: "push"
23727
24194
  },
23728
- runtimeState: NumericSensorStatusSchema
24195
+ runtimeState: NumericSensorStatusSchema,
24196
+ /**
24197
+ * 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.
24198
+ *
24199
+ * See `RuntimeStateDurability`. Enforced by
24200
+ * `scripts/check-runtime-state-durability.ts`.
24201
+ */
24202
+ durability: "restored",
24203
+ /** Clock fields: written, but excluded from the compare that decides
24204
+ * whether persisting is worth a SQLite commit. */
24205
+ volatileStateFields: ["lastFetchedAt"]
23729
24206
  };
23730
24207
  /**
23731
24208
  * Generic on-screen-display (video overlay) cap. Each camera exposes
@@ -24110,7 +24587,14 @@ var petFeederCapability = {
24110
24587
  * the full slice via `device.state.petFeeder.value` and refresh on
24111
24588
  * every poll without re-querying the provider.
24112
24589
  */
24113
- runtimeState: PetFeederStatusSchema
24590
+ runtimeState: PetFeederStatusSchema,
24591
+ /**
24592
+ * Runtime-state durability: **session** — live appliance state re-published on connect.
24593
+ *
24594
+ * See `RuntimeStateDurability`. Enforced by
24595
+ * `scripts/check-runtime-state-durability.ts`.
24596
+ */
24597
+ durability: "session"
24114
24598
  };
24115
24599
  var VehicleSchema = object({
24116
24600
  id: string(),
@@ -24422,7 +24906,17 @@ var powerMeterCapability = {
24422
24906
  schema: PowerMeterStatusSchema,
24423
24907
  kind: "push"
24424
24908
  },
24425
- runtimeState: PowerMeterStatusSchema
24909
+ runtimeState: PowerMeterStatusSchema,
24910
+ /**
24911
+ * Runtime-state durability: **restored** — as `numeric-sensor`; `kwhTotal` is an accumulator whose restored value is the baseline.
24912
+ *
24913
+ * See `RuntimeStateDurability`. Enforced by
24914
+ * `scripts/check-runtime-state-durability.ts`.
24915
+ */
24916
+ durability: "restored",
24917
+ /** Clock fields: written, but excluded from the compare that decides
24918
+ * whether persisting is worth a SQLite commit. */
24919
+ volatileStateFields: ["lastFetchedAt"]
24426
24920
  };
24427
24921
  /**
24428
24922
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -24479,7 +24973,17 @@ var presenceCapability = {
24479
24973
  * the map pin is rendered (use `DeviceFeature.PresenceGps` for the
24480
24974
  * pre-fetch fast-path check).
24481
24975
  */
24482
- runtimeState: PresenceStatusSchema
24976
+ runtimeState: PresenceStatusSchema,
24977
+ /**
24978
+ * Runtime-state durability: **restored** — occupancy-relevant: the restored state is what an occupancy rule compares the first post-restart observation against.
24979
+ *
24980
+ * See `RuntimeStateDurability`. Enforced by
24981
+ * `scripts/check-runtime-state-durability.ts`.
24982
+ */
24983
+ durability: "restored",
24984
+ /** Clock fields: written, but excluded from the compare that decides
24985
+ * whether persisting is worth a SQLite commit. */
24986
+ volatileStateFields: ["lastChangedAt"]
24483
24987
  };
24484
24988
  /**
24485
24989
  * Atmospheric pressure reading in hectopascals. Drives Home Assistant
@@ -24515,7 +25019,17 @@ var pressureSensorCapability = {
24515
25019
  schema: PressureSensorStatusSchema,
24516
25020
  kind: "push"
24517
25021
  },
24518
- runtimeState: PressureSensorStatusSchema
25022
+ runtimeState: PressureSensorStatusSchema,
25023
+ /**
25024
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
25025
+ *
25026
+ * See `RuntimeStateDurability`. Enforced by
25027
+ * `scripts/check-runtime-state-durability.ts`.
25028
+ */
25029
+ durability: "restored",
25030
+ /** Clock fields: written, but excluded from the compare that decides
25031
+ * whether persisting is worth a SQLite commit. */
25032
+ volatileStateFields: ["lastFetchedAt"]
24519
25033
  };
24520
25034
  /**
24521
25035
  * PRIVACY — what the camera deliberately does not capture. Two planes:
@@ -24645,7 +25159,17 @@ var privacyMaskCapability = {
24645
25159
  schema: PrivacyMaskStatusSchema,
24646
25160
  kind: "poll"
24647
25161
  },
24648
- runtimeState: PrivacyMaskStatusSchema
25162
+ runtimeState: PrivacyMaskStatusSchema,
25163
+ /**
25164
+ * Runtime-state durability: **restored** — operator-drawn regions, zero real churn — 22 writes in 25 minutes, every one of them the clock.
25165
+ *
25166
+ * See `RuntimeStateDurability`. Enforced by
25167
+ * `scripts/check-runtime-state-durability.ts`.
25168
+ */
25169
+ durability: "restored",
25170
+ /** Clock fields: written, but excluded from the compare that decides
25171
+ * whether persisting is worth a SQLite commit. */
25172
+ volatileStateFields: ["lastFetchedAt"]
24649
25173
  };
24650
25174
  var PtzPresetSchema = object({
24651
25175
  id: string(),
@@ -24811,7 +25335,14 @@ var ptzAutotrackCapability = {
24811
25335
  * fetch / cache / fallback logic out of the four cap methods —
24812
25336
  * they become trampolines over `runtimeState`.
24813
25337
  */
24814
- runtimeState: PtzAutotrackRuntimeStateSchema
25338
+ runtimeState: PtzAutotrackRuntimeStateSchema,
25339
+ /**
25340
+ * Runtime-state durability: **session** — mirrors the camera's own autotrack config, re-read on connect.
25341
+ *
25342
+ * See `RuntimeStateDurability`. Enforced by
25343
+ * `scripts/check-runtime-state-durability.ts`.
25344
+ */
25345
+ durability: "session"
24815
25346
  };
24816
25347
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
24817
25348
  kind: "mutation",
@@ -25461,7 +25992,14 @@ var sceneMonitorCapability = {
25461
25992
  schema: SceneMonitorStatusSchema,
25462
25993
  kind: "push"
25463
25994
  },
25464
- runtimeState: SceneMonitorStatusSchema
25995
+ runtimeState: SceneMonitorStatusSchema,
25996
+ /**
25997
+ * Runtime-state durability: **session** — re-derived from the current scene on the next evaluation.
25998
+ *
25999
+ * See `RuntimeStateDurability`. Enforced by
26000
+ * `scripts/check-runtime-state-durability.ts`.
26001
+ */
26002
+ durability: "session"
25465
26003
  };
25466
26004
  /**
25467
26005
  * Per-stage gating mode applied to the zones a rule references.
@@ -25605,7 +26143,14 @@ var scriptRunnerCapability = {
25605
26143
  * `isRunning` to render a spinner during execution and surfaces
25606
26144
  * `lastError` / `lastRunSuccess` in the recent-runs panel.
25607
26145
  */
25608
- runtimeState: ScriptRunnerStatusSchema
26146
+ runtimeState: ScriptRunnerStatusSchema,
26147
+ /**
26148
+ * Runtime-state durability: **session** — a restored `isRunning: true` describes a process that died with the previous hub.
26149
+ *
26150
+ * See `RuntimeStateDurability`. Enforced by
26151
+ * `scripts/check-runtime-state-durability.ts`.
26152
+ */
26153
+ durability: "session"
25609
26154
  };
25610
26155
  /**
25611
26156
  * Smoke alarm sensor — boolean "is smoke currently detected" with
@@ -25632,7 +26177,17 @@ var smokeCapability = {
25632
26177
  schema: SmokeStatusSchema,
25633
26178
  kind: "push"
25634
26179
  },
25635
- runtimeState: SmokeStatusSchema
26180
+ runtimeState: SmokeStatusSchema,
26181
+ /**
26182
+ * Runtime-state durability: **restored** — a safety sensor must not read "clear" merely because the hub restarted.
26183
+ *
26184
+ * See `RuntimeStateDurability`. Enforced by
26185
+ * `scripts/check-runtime-state-durability.ts`.
26186
+ */
26187
+ durability: "restored",
26188
+ /** Clock fields: written, but excluded from the compare that decides
26189
+ * whether persisting is worth a SQLite commit. */
26190
+ volatileStateFields: ["lastChangedAt"]
25636
26191
  };
25637
26192
  /**
25638
26193
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -25805,7 +26360,17 @@ var streamParamsCapability = {
25805
26360
  schema: StreamParamsStatusSchema,
25806
26361
  kind: "poll"
25807
26362
  },
25808
- runtimeState: StreamParamsStatusSchema
26363
+ runtimeState: StreamParamsStatusSchema,
26364
+ /**
26365
+ * Runtime-state durability: **restored** — operator-set encoder profile; mutation-driven.
26366
+ *
26367
+ * See `RuntimeStateDurability`. Enforced by
26368
+ * `scripts/check-runtime-state-durability.ts`.
26369
+ */
26370
+ durability: "restored",
26371
+ /** Clock fields: written, but excluded from the compare that decides
26372
+ * whether persisting is worth a SQLite commit. */
26373
+ volatileStateFields: ["lastFetchedAt"]
25809
26374
  };
25810
26375
  /**
25811
26376
  * Generic on/off switch cap for accessory children (siren, floodlight,
@@ -25851,6 +26416,16 @@ var switchCapability = {
25851
26416
  * not need to re-query the provider after a setState mutation.
25852
26417
  */
25853
26418
  runtimeState: SwitchStatusSchema,
26419
+ /**
26420
+ * Runtime-state durability: **restored** — device state an operator reads as authoritative; 55 devices, transition-driven.
26421
+ *
26422
+ * See `RuntimeStateDurability`. Enforced by
26423
+ * `scripts/check-runtime-state-durability.ts`.
26424
+ */
26425
+ durability: "restored",
26426
+ /** Clock fields: written, but excluded from the compare that decides
26427
+ * whether persisting is worth a SQLite commit. */
26428
+ volatileStateFields: ["lastChangedAt"],
25854
26429
  settings: { bindings: [{
25855
26430
  kind: "scalar",
25856
26431
  statusPath: "on",
@@ -25930,7 +26505,17 @@ var tamperCapability = {
25930
26505
  schema: TamperStatusSchema,
25931
26506
  kind: "push"
25932
26507
  },
25933
- runtimeState: TamperStatusSchema
26508
+ runtimeState: TamperStatusSchema,
26509
+ /**
26510
+ * Runtime-state durability: **restored** — as `smoke`.
26511
+ *
26512
+ * See `RuntimeStateDurability`. Enforced by
26513
+ * `scripts/check-runtime-state-durability.ts`.
26514
+ */
26515
+ durability: "restored",
26516
+ /** Clock fields: written, but excluded from the compare that decides
26517
+ * whether persisting is worth a SQLite commit. */
26518
+ volatileStateFields: ["lastChangedAt"]
25934
26519
  };
25935
26520
  /**
25936
26521
  * Single-metric temperature reading. Drives Home Assistant `sensor`
@@ -25975,7 +26560,17 @@ var temperatureSensorCapability = {
25975
26560
  schema: TemperatureSensorStatusSchema,
25976
26561
  kind: "push"
25977
26562
  },
25978
- runtimeState: TemperatureSensorStatusSchema
26563
+ runtimeState: TemperatureSensorStatusSchema,
26564
+ /**
26565
+ * Runtime-state durability: **restored** — as `numeric-sensor` (69 of 125 writes were the clock alone).
26566
+ *
26567
+ * See `RuntimeStateDurability`. Enforced by
26568
+ * `scripts/check-runtime-state-durability.ts`.
26569
+ */
26570
+ durability: "restored",
26571
+ /** Clock fields: written, but excluded from the compare that decides
26572
+ * whether persisting is worth a SQLite commit. */
26573
+ volatileStateFields: ["lastFetchedAt"]
25979
26574
  };
25980
26575
  /**
25981
26576
  * toast — system-scoped singleton capability that streams toast
@@ -26044,7 +26639,14 @@ var updateCapability = {
26044
26639
  schema: UpdateStatusSchema,
26045
26640
  kind: "poll"
26046
26641
  },
26047
- runtimeState: UpdateStatusSchema
26642
+ runtimeState: UpdateStatusSchema,
26643
+ /**
26644
+ * Runtime-state durability: **session** — a restored `inProgress: true` describes an update that is no longer running; versions are re-probed at boot.
26645
+ *
26646
+ * See `RuntimeStateDurability`. Enforced by
26647
+ * `scripts/check-runtime-state-durability.ts`.
26648
+ */
26649
+ durability: "session"
26048
26650
  };
26049
26651
  var UserSummarySchema = object({
26050
26652
  id: string(),
@@ -26378,7 +26980,14 @@ var vacuumControlCapability = {
26378
26980
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26379
26981
  * slice for live state + battery + fan-speed changes.
26380
26982
  */
26381
- runtimeState: VacuumControlStatusSchema
26983
+ runtimeState: VacuumControlStatusSchema,
26984
+ /**
26985
+ * Runtime-state durability: **session** — as `media-player` — a restored `state: cleaning` is a robot that is not cleaning.
26986
+ *
26987
+ * See `RuntimeStateDurability`. Enforced by
26988
+ * `scripts/check-runtime-state-durability.ts`.
26989
+ */
26990
+ durability: "session"
26382
26991
  };
26383
26992
  var ValveStatusSchema = object({
26384
26993
  /** Lifecycle state of the valve. */
@@ -26430,7 +27039,14 @@ var valveCapability = {
26430
27039
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26431
27040
  * slice for live position changes during a move.
26432
27041
  */
26433
- runtimeState: ValveStatusSchema
27042
+ runtimeState: ValveStatusSchema,
27043
+ /**
27044
+ * Runtime-state durability: **session** — as `brightness`.
27045
+ *
27046
+ * See `RuntimeStateDurability`. Enforced by
27047
+ * `scripts/check-runtime-state-durability.ts`.
27048
+ */
27049
+ durability: "session"
26434
27050
  };
26435
27051
  /**
26436
27052
  * Vibration / shake / impact sensor. Drives Home Assistant
@@ -26452,7 +27068,17 @@ var vibrationCapability = {
26452
27068
  schema: VibrationStatusSchema,
26453
27069
  kind: "push"
26454
27070
  },
26455
- runtimeState: VibrationStatusSchema
27071
+ runtimeState: VibrationStatusSchema,
27072
+ /**
27073
+ * Runtime-state durability: **restored** — as `smoke`.
27074
+ *
27075
+ * See `RuntimeStateDurability`. Enforced by
27076
+ * `scripts/check-runtime-state-durability.ts`.
27077
+ */
27078
+ durability: "restored",
27079
+ /** Clock fields: written, but excluded from the compare that decides
27080
+ * whether persisting is worth a SQLite commit. */
27081
+ volatileStateFields: ["lastChangedAt"]
26456
27082
  };
26457
27083
  /**
26458
27084
  * Water heater / boiler cap. Models HA `water_heater.*` entities — a
@@ -26526,7 +27152,14 @@ var waterHeaterCapability = {
26526
27152
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26527
27153
  * slice for live temperature / mode / away changes.
26528
27154
  */
26529
- runtimeState: WaterHeaterStatusSchema
27155
+ runtimeState: WaterHeaterStatusSchema,
27156
+ /**
27157
+ * Runtime-state durability: **session** — as `climate-control`.
27158
+ *
27159
+ * See `RuntimeStateDurability`. Enforced by
27160
+ * `scripts/check-runtime-state-durability.ts`.
27161
+ */
27162
+ durability: "session"
26530
27163
  };
26531
27164
  /**
26532
27165
  * Weather provider cap. Models HA `weather.*` entities — a read-only
@@ -26585,7 +27218,14 @@ var weatherCapability = {
26585
27218
  * Runtime-state slice — mirrored by the kernel. The UI reads the
26586
27219
  * current conditions directly from the slice on each weather push.
26587
27220
  */
26588
- runtimeState: WeatherStatusSchema
27221
+ runtimeState: WeatherStatusSchema,
27222
+ /**
27223
+ * Runtime-state durability: **session** — a forecast is stale the moment the hub is down; the provider re-fetches on connect.
27224
+ *
27225
+ * See `RuntimeStateDurability`. Enforced by
27226
+ * `scripts/check-runtime-state-durability.ts`.
27227
+ */
27228
+ durability: "session"
26589
27229
  };
26590
27230
  /**
26591
27231
  * Per-zone occupancy aggregation produced by the analytics frame
@@ -26747,7 +27387,14 @@ var zoneAnalyticsCapability = {
26747
27387
  * automatically; the explicit `getCurrentSnapshot` cap method is
26748
27388
  * still useful for one-off polls without a subscription.
26749
27389
  */
26750
- runtimeState: CameraOccupancySnapshotSchema
27390
+ runtimeState: CameraOccupancySnapshotSchema,
27391
+ /**
27392
+ * Runtime-state durability: **session** — per-frame analytics; with `audio-metrics` it is ~90 % of the offered write rate. Re-derived on the next frame.
27393
+ *
27394
+ * See `RuntimeStateDurability`. Enforced by
27395
+ * `scripts/check-runtime-state-durability.ts`.
27396
+ */
27397
+ durability: "session"
26751
27398
  };
26752
27399
  /**
26753
27400
  * Stages a {@link ZoneRule} can apply to. Discriminator on the rules
@@ -26825,7 +27472,14 @@ var zoneRulesCapability = {
26825
27472
  motion: array(ZoneRuleSchema).readonly(),
26826
27473
  detection: array(ZoneRuleSchema).readonly(),
26827
27474
  package: array(ZoneRuleSchema).readonly()
26828
- })
27475
+ }),
27476
+ /**
27477
+ * Runtime-state durability: **restored** — operator intent, mutation-only, same argument as `zones`.
27478
+ *
27479
+ * See `RuntimeStateDurability`. Enforced by
27480
+ * `scripts/check-runtime-state-durability.ts`.
27481
+ */
27482
+ durability: "restored"
26829
27483
  };
26830
27484
  /**
26831
27485
  * Accessory device helpers — shared across drivers.
@@ -33512,6 +34166,7 @@ Object.freeze({
33512
34166
  "network-access": "ingress",
33513
34167
  "smtp-provider": "email"
33514
34168
  });
34169
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
33515
34170
  new Set(["devices", "classes"]);
33516
34171
  /**
33517
34172
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.