@camstack/addon-provider-amcrest 0.2.16 → 0.2.18

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
@@ -10750,7 +10750,14 @@ var cameraStreamsCapability = {
10750
10750
  low: string().optional()
10751
10751
  }),
10752
10752
  lastChangedAt: number()
10753
- })
10753
+ }),
10754
+ /**
10755
+ * 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.
10756
+ *
10757
+ * See `RuntimeStateDurability`. Enforced by
10758
+ * `scripts/check-runtime-state-durability.ts`.
10759
+ */
10760
+ durability: "session"
10754
10761
  };
10755
10762
  /** Where a block runs. The operator chooses — a block driving a device on an
10756
10763
  * agent is the reason placement is not fixed to the hub. */
@@ -11311,6 +11318,13 @@ var deviceDiscoveryCapability = {
11311
11318
  kind: "poll"
11312
11319
  },
11313
11320
  runtimeState: DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: number().int().nonnegative() }),
11321
+ /**
11322
+ * Runtime-state durability: **session** — 5.7 KB of scan output on the largest device, fully re-derivable by re-scanning.
11323
+ *
11324
+ * See `RuntimeStateDurability`. Enforced by
11325
+ * `scripts/check-runtime-state-durability.ts`.
11326
+ */
11327
+ durability: "session",
11314
11328
  methods: {
11315
11329
  /**
11316
11330
  * Snapshot of the current `discovered` list. Returns the
@@ -13180,11 +13194,33 @@ var NotificationFormatSchema = _enum([
13180
13194
  * Named by INTENT, never by glyph. "check" would tie the vocabulary to one
13181
13195
  * renderer's icon set; "acknowledge" survives an adapter that draws it
13182
13196
  * differently.
13197
+ *
13198
+ * ── A TOKEN IS NOT A WIRE VALUE ─────────────────────────────────────
13199
+ *
13200
+ * These names are for US. **No adapter may forward one verbatim.** Each maps
13201
+ * the whole set onto its own renderer's vocabulary through a
13202
+ * `Record<NotificationActionIcon, string>` — a Record, never a lookup with a
13203
+ * fallback, so adding a member here fails every adapter's build until someone
13204
+ * decides its glyph, which is the only place that decision can be made
13205
+ * honestly.
13206
+ *
13207
+ * This paragraph is the bug. Zentik declared `actionIcons: true` and passed
13208
+ * `disarm` straight through; iOS feeds that string to
13209
+ * `UNNotificationActionIcon(systemImageName:)`, `disarm` is not an SF Symbol,
13210
+ * and every snooze and alarm button arrived BLANK. A pass-through is not a
13211
+ * mapping, and "the field is documented" is not "the value renders".
13212
+ *
13213
+ * Adding a member is TRAIN-BOUND. The enum lives in the published
13214
+ * `@camstack/server` closure and the cap seam validates against the HUB's copy,
13215
+ * so an addon that emits a token the running hub does not know does not lose an
13216
+ * icon — its whole `send` fails Zod validation and the notification never
13217
+ * arrives. Never emit a new token from an addon before the train carrying it.
13183
13218
  */
13184
13219
  var NotificationActionIconSchema = _enum([
13185
13220
  "acknowledge",
13186
13221
  "dismiss",
13187
13222
  "silence",
13223
+ "snooze",
13188
13224
  "view",
13189
13225
  "play",
13190
13226
  "open",
@@ -13192,9 +13228,13 @@ var NotificationActionIconSchema = _enum([
13192
13228
  "lock",
13193
13229
  "unlock",
13194
13230
  "arm",
13231
+ "arm-home",
13232
+ "arm-away",
13233
+ "arm-night",
13195
13234
  "disarm",
13196
13235
  "light",
13197
- "alert"
13236
+ "alert",
13237
+ "camera"
13198
13238
  ]);
13199
13239
  /** A single tap-through action button. */
13200
13240
  var NotificationActionSchema = object({
@@ -13210,7 +13250,23 @@ var NotificationActionSchema = object({
13210
13250
  * else — see `notification-center/action-token.ts` for what that does and
13211
13251
  * does not buy.
13212
13252
  */
13213
- destructive: boolean().optional()
13253
+ destructive: boolean().optional(),
13254
+ /**
13255
+ * How the tap should REACH the url.
13256
+ *
13257
+ * `navigate` (absent, and every button authored before this field) opens it:
13258
+ * the phone leaves the notification and shows whatever the callback returns.
13259
+ * That is right for a button whose answer the operator wants to read.
13260
+ *
13261
+ * `background` fires it as a POST and stays put. It exists for the buttons
13262
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13263
+ * an answer to the notification, and being thrown into a browser tab to
13264
+ * confirm it costs more attention than the notification did. A backend that
13265
+ * cannot do a background call renders it as an ordinary link (the adapters
13266
+ * fall back rather than dropping the button), so this is a preference, never
13267
+ * a requirement.
13268
+ */
13269
+ mode: _enum(["navigate", "background"]).optional()
13214
13270
  });
13215
13271
  /**
13216
13272
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -13378,6 +13434,24 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
13378
13434
  targetId: string(),
13379
13435
  enabled: boolean()
13380
13436
  }), _void(), { kind: "mutation" });
13437
+ new Set([
13438
+ {
13439
+ id: "person",
13440
+ name: "Person"
13441
+ },
13442
+ {
13443
+ id: "vehicle",
13444
+ name: "Vehicle"
13445
+ },
13446
+ {
13447
+ id: "animal",
13448
+ name: "Animal"
13449
+ },
13450
+ {
13451
+ id: "package",
13452
+ name: "Package"
13453
+ }
13454
+ ].map((l) => l.id));
13381
13455
  var COCO_TO_MACRO = {
13382
13456
  mapping: {
13383
13457
  person: "person",
@@ -14062,7 +14136,17 @@ var alarmPanelCapability = {
14062
14136
  * full slice; renders an arm button per `availableModes` entry and
14063
14137
  * a PIN field iff `requiresCode === true`.
14064
14138
  */
14065
- runtimeState: AlarmPanelStatusSchema
14139
+ runtimeState: AlarmPanelStatusSchema,
14140
+ /**
14141
+ * Runtime-state durability: **restored** — armed state is the one thing a panel must not lose across a restart.
14142
+ *
14143
+ * See `RuntimeStateDurability`. Enforced by
14144
+ * `scripts/check-runtime-state-durability.ts`.
14145
+ */
14146
+ durability: "restored",
14147
+ /** Clock fields: written, but excluded from the compare that decides
14148
+ * whether persisting is worth a SQLite commit. */
14149
+ volatileStateFields: ["lastChangedAt"]
14066
14150
  };
14067
14151
  /**
14068
14152
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
@@ -14203,6 +14287,8 @@ var NcSystemEventKindSchema = _enum([
14203
14287
  "alarm-triggered",
14204
14288
  "alarm-armed",
14205
14289
  "alarm-disarmed",
14290
+ "alarm-arming",
14291
+ "alarm-arm-refused",
14206
14292
  "camera-online",
14207
14293
  "camera-offline",
14208
14294
  "camera-disabled",
@@ -14239,6 +14325,9 @@ var NcSystemEventConditionSchema = object({
14239
14325
  nodeIds: array(string().min(1)).min(1).optional(),
14240
14326
  packageNames: array(string().min(1)).min(1).optional()
14241
14327
  });
14328
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14329
+ * outage the operator asked for once and forgot. */
14330
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14242
14331
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14243
14332
  var NcScheduleSchema = object({
14244
14333
  windows: array(object({
@@ -14615,15 +14704,15 @@ var NcConditionsSchema = object({
14615
14704
  * (an `immediate` rule naming an `audio-*` class, one notification per
14616
14705
  * classified sample) stays exactly as it was for rules that already use it.
14617
14706
  *
14618
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14619
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14620
- * (`camstack/src/data/notification-center.ts`, guarded by
14621
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14707
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14708
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14709
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14710
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14622
14711
  * condition fields it does not know when a rule is saved from the phone.
14623
14712
  * Publishing an editor for a condition the app cannot round-trip is how an
14624
- * operator loses a rule's conditions by opening it — so the descriptor, the
14625
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14626
- * does an audio rule become authorable.
14713
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14714
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14715
+ * follows here.
14627
14716
  */
14628
14717
  audio: NcAudioConditionSchema.optional()
14629
14718
  });
@@ -14859,6 +14948,30 @@ var NcRuleInputSchema = object({
14859
14948
  */
14860
14949
  snoozeAllowGlobal: boolean().optional(),
14861
14950
  /**
14951
+ * The snooze durations THIS rule's notification offers as buttons, in
14952
+ * minutes.
14953
+ *
14954
+ * Three states, and all three are distinct — which is exactly why this is
14955
+ * `.optional()` and never `.default()`. A Zod default does not run on the
14956
+ * addon cap path (three production failures in one day), so a schema default
14957
+ * would collapse the first two:
14958
+ *
14959
+ * | value | meaning |
14960
+ * | --- | --- |
14961
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
14962
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
14963
+ * | a list | these choices, de-duplicated and sorted, at most four |
14964
+ *
14965
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
14966
+ * three buttons in total) and a rule that spent it all on snooze choices
14967
+ * would push its own tap-through actions off the notification.
14968
+ *
14969
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
14970
+ * that arms the panel, is exempt automatically and cannot be silenced by a
14971
+ * window from anywhere (D133).
14972
+ */
14973
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
14974
+ /**
14862
14975
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14863
14976
  *
14864
14977
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -14958,6 +15071,7 @@ var NcConditionDescriptorSchema = object({
14958
15071
  "device",
14959
15072
  "package",
14960
15073
  "occupancy",
15074
+ "audio",
14961
15075
  "system"
14962
15076
  ]),
14963
15077
  label: string(),
@@ -14976,6 +15090,7 @@ var NcConditionDescriptorSchema = object({
14976
15090
  "crossingSelect",
14977
15091
  "polygonDraw",
14978
15092
  "occupancy",
15093
+ "audio",
14979
15094
  "deviceState",
14980
15095
  "systemEvent"
14981
15096
  ]),
@@ -15127,7 +15242,20 @@ var NcSnoozeInputSchema = object({
15127
15242
  ruleId: string().optional(),
15128
15243
  /** Required when `scope: 'device'`. */
15129
15244
  deviceId: number().int().optional(),
15130
- durationMinutes: number().int().min(1).max(1440),
15245
+ /**
15246
+ * Narrow the window to these subject classes — "the cat, not the person".
15247
+ *
15248
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15249
+ * what every window authored before this field meant, so no persisted row
15250
+ * changes meaning and no client has to learn anything to keep working.
15251
+ *
15252
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15253
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15254
+ * not at whichever of their four rules happened to produce the notification
15255
+ * they are dismissing.
15256
+ */
15257
+ classes: array(string().min(1)).min(1).optional(),
15258
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
15131
15259
  /**
15132
15260
  * Silence this for EVERY recipient, not just the caller. Permission is
15133
15261
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15152,6 +15280,10 @@ var NcSnoozeSchema = object({
15152
15280
  scope: NcSnoozeScopeSchema,
15153
15281
  ruleId: string().optional(),
15154
15282
  deviceId: number().int().optional(),
15283
+ /** Subject classes this window covers. ABSENT = every class — see
15284
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15285
+ * no SQLite column: nothing queries a window by class. */
15286
+ classes: array(string().min(1)).min(1).optional(),
15155
15287
  startedAt: number(),
15156
15288
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15157
15289
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -17252,7 +17384,14 @@ var zonesCapability = {
17252
17384
  * handle. Slice shape is `{ zones: Zone[] }` so future extensions
17253
17385
  * (e.g. zone groupings) can sit alongside the polygon list.
17254
17386
  */
17255
- runtimeState: object({ zones: array(ZoneSchema).readonly() })
17387
+ runtimeState: object({ zones: array(ZoneSchema).readonly() }),
17388
+ /**
17389
+ * 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.
17390
+ *
17391
+ * See `RuntimeStateDurability`. Enforced by
17392
+ * `scripts/check-runtime-state-durability.ts`.
17393
+ */
17394
+ durability: "restored"
17256
17395
  };
17257
17396
  /**
17258
17397
  * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
@@ -17422,6 +17561,22 @@ var detectionFpsField = {
17422
17561
  default: 10,
17423
17562
  step: 1
17424
17563
  };
17564
+ /**
17565
+ * The occupancy re-check interval. DEFAULT 300 s (2026-08-13 — was 30 s).
17566
+ *
17567
+ * The recheck is now on by default (a parked car is invisible to occupancy
17568
+ * rules until the stationary registry has been rebuilt by motion, which after a
17569
+ * restart may be never on a quiet camera). Each cycle re-subscribes a detection
17570
+ * session — an RTSP re-dial — so the switch is only affordable at a WIDE
17571
+ * interval: 300 s is ~12 re-dials an hour per camera, against 120 at the old
17572
+ * 30 s. A parked car is therefore counted within 5 minutes of a restart.
17573
+ *
17574
+ * Why not wider: `max` is 300 and raising it is TRAIN-BOUND, not addon-bound —
17575
+ * the host validates `attachCamera` against ITS copy of this schema, so a
17576
+ * runner asked for 600 would be rejected by the hub until a `@camstack/server`
17577
+ * carrying the wider bound is installed everywhere. 300 is the widest value
17578
+ * that ships with an addon deploy.
17579
+ */
17425
17580
  var occupancyRecheckSecField = {
17426
17581
  min: 0,
17427
17582
  max: 300,
@@ -17623,15 +17778,21 @@ var RunnerCameraConfigSchema = object({
17623
17778
  */
17624
17779
  onboardMotionDrivesAnalyzer: boolean().default(true),
17625
17780
  /**
17626
- * Master toggle for the occupancy re-check. When `false` (DEFAULT) the runner
17627
- * never arms the periodic recheck timer, regardless of `occupancyRecheckSec`
17628
- * this is off by default because the recheck re-subscribes a detection session
17629
- * every N seconds while `watching`, a major source of pull-decoder re-dial
17630
- * churn (each cycle creates+tears a session → RTSP re-dial → latency). The
17781
+ * Master toggle for the occupancy re-check. When `false` the runner never arms
17782
+ * the periodic recheck timer, regardless of `occupancyRecheckSec`; the
17631
17783
  * `occupancyRecheckSec` / `occupancyRecheckFrames` sliders only take effect
17632
17784
  * (and only render) when this is enabled.
17633
- */
17634
- occupancyRecheckEnabled: boolean().default(false),
17785
+ *
17786
+ * DEFAULT `true` since 2026-08-13 (was `false`). It was off because the
17787
+ * recheck re-subscribes a detection session every N seconds while `watching`
17788
+ * — each cycle creates+tears a session ⇒ an RTSP re-dial ⇒ latency, a major
17789
+ * pull-decoder churn source. What that bought was a blind spot: a STATIONARY
17790
+ * object is counted only while the stationary registry holds it, and the
17791
+ * registry rebuilds from motion, so after a restart a parked car was invisible
17792
+ * to every occupancy rule until something moved in front of it. The churn is
17793
+ * now paid on the interval instead — see `occupancyRecheckSecField`.
17794
+ */
17795
+ occupancyRecheckEnabled: boolean().default(true),
17635
17796
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
17636
17797
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
17637
17798
  /**
@@ -20146,7 +20307,17 @@ var airQualitySensorCapability = {
20146
20307
  schema: AirQualitySensorStatusSchema,
20147
20308
  kind: "push"
20148
20309
  },
20149
- runtimeState: AirQualitySensorStatusSchema
20310
+ runtimeState: AirQualitySensorStatusSchema,
20311
+ /**
20312
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20313
+ *
20314
+ * See `RuntimeStateDurability`. Enforced by
20315
+ * `scripts/check-runtime-state-durability.ts`.
20316
+ */
20317
+ durability: "restored",
20318
+ /** Clock fields: written, but excluded from the compare that decides
20319
+ * whether persisting is worth a SQLite commit. */
20320
+ volatileStateFields: ["lastFetchedAt"]
20150
20321
  };
20151
20322
  /**
20152
20323
  * Ambient illuminance reading in lux. Drives Home Assistant `sensor`
@@ -20178,7 +20349,17 @@ var ambientLightSensorCapability = {
20178
20349
  schema: AmbientLightSensorStatusSchema,
20179
20350
  kind: "push"
20180
20351
  },
20181
- runtimeState: AmbientLightSensorStatusSchema
20352
+ runtimeState: AmbientLightSensorStatusSchema,
20353
+ /**
20354
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20355
+ *
20356
+ * See `RuntimeStateDurability`. Enforced by
20357
+ * `scripts/check-runtime-state-durability.ts`.
20358
+ */
20359
+ durability: "restored",
20360
+ /** Clock fields: written, but excluded from the compare that decides
20361
+ * whether persisting is worth a SQLite commit. */
20362
+ volatileStateFields: ["lastFetchedAt"]
20182
20363
  };
20183
20364
  /**
20184
20365
  * Per-class audio metrics aggregated over a sliding window.
@@ -20296,7 +20477,14 @@ var audioMetricsCapability = {
20296
20477
  }), AudioMetricsHistorySchema)
20297
20478
  },
20298
20479
  /** Reactive runtime-state mirror — live `device.state.audioMetrics.value`. */
20299
- runtimeState: AudioMetricsSnapshotSchema
20480
+ runtimeState: AudioMetricsSnapshotSchema,
20481
+ /**
20482
+ * 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.
20483
+ *
20484
+ * See `RuntimeStateDurability`. Enforced by
20485
+ * `scripts/check-runtime-state-durability.ts`.
20486
+ */
20487
+ durability: "session"
20300
20488
  };
20301
20489
  /**
20302
20490
  * Automation-control cap. Models HA `automation.*` entities on
@@ -20358,7 +20546,14 @@ var automationControlCapability = {
20358
20546
  * reads `enabled` (toggle) + `isRunning` (spinner) + `lastError`
20359
20547
  * (badge) directly.
20360
20548
  */
20361
- runtimeState: AutomationControlStatusSchema
20549
+ runtimeState: AutomationControlStatusSchema,
20550
+ /**
20551
+ * 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.
20552
+ *
20553
+ * See `RuntimeStateDurability`. Enforced by
20554
+ * `scripts/check-runtime-state-durability.ts`.
20555
+ */
20556
+ durability: "session"
20362
20557
  };
20363
20558
  /**
20364
20559
  * Battery status snapshot. Emitted by providers whose device is
@@ -20464,7 +20659,17 @@ onStatusChanged: { data: object({
20464
20659
  * via `device.runtimeState.getCapState('battery')` regardless of
20465
20660
  * the underlying driver.
20466
20661
  */
20467
- runtimeState: BatteryStatusSchema
20662
+ runtimeState: BatteryStatusSchema,
20663
+ /**
20664
+ * 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.
20665
+ *
20666
+ * See `RuntimeStateDurability`. Enforced by
20667
+ * `scripts/check-runtime-state-durability.ts`.
20668
+ */
20669
+ durability: "restored",
20670
+ /** Clock fields: written, but excluded from the compare that decides
20671
+ * whether persisting is worth a SQLite commit. */
20672
+ volatileStateFields: ["lastUpdated"]
20468
20673
  };
20469
20674
  /**
20470
20675
  * Generic boolean sensor — last-resort fallback when no domain-
@@ -20493,7 +20698,17 @@ var binaryCapability = {
20493
20698
  schema: BinaryStatusSchema,
20494
20699
  kind: "push"
20495
20700
  },
20496
- runtimeState: BinaryStatusSchema
20701
+ runtimeState: BinaryStatusSchema,
20702
+ /**
20703
+ * Runtime-state durability: **restored** — transition-driven sensor state; the restored value gives the boot comparison.
20704
+ *
20705
+ * See `RuntimeStateDurability`. Enforced by
20706
+ * `scripts/check-runtime-state-durability.ts`.
20707
+ */
20708
+ durability: "restored",
20709
+ /** Clock fields: written, but excluded from the compare that decides
20710
+ * whether persisting is worth a SQLite commit. */
20711
+ volatileStateFields: ["lastChangedAt"]
20497
20712
  };
20498
20713
  /**
20499
20714
  * Dimmable-light brightness control. Co-exists with `switch` on the
@@ -20546,7 +20761,14 @@ onBrightnessChanged: { data: object({
20546
20761
  * by the kernel. Read via `device.state.brightness.value` so UI
20547
20762
  * sliders surface the current level without polling the provider.
20548
20763
  */
20549
- runtimeState: BrightnessStatusSchema
20764
+ runtimeState: BrightnessStatusSchema,
20765
+ /**
20766
+ * Runtime-state durability: **session** — live lamp state, re-published by the provider on connect.
20767
+ *
20768
+ * See `RuntimeStateDurability`. Enforced by
20769
+ * `scripts/check-runtime-state-durability.ts`.
20770
+ */
20771
+ durability: "session"
20550
20772
  };
20551
20773
  DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
20552
20774
  kind: "mutation",
@@ -20634,7 +20856,17 @@ var carbonMonoxideCapability = {
20634
20856
  schema: CarbonMonoxideStatusSchema,
20635
20857
  kind: "push"
20636
20858
  },
20637
- runtimeState: CarbonMonoxideStatusSchema
20859
+ runtimeState: CarbonMonoxideStatusSchema,
20860
+ /**
20861
+ * Runtime-state durability: **restored** — as `smoke`.
20862
+ *
20863
+ * See `RuntimeStateDurability`. Enforced by
20864
+ * `scripts/check-runtime-state-durability.ts`.
20865
+ */
20866
+ durability: "restored",
20867
+ /** Clock fields: written, but excluded from the compare that decides
20868
+ * whether persisting is worth a SQLite commit. */
20869
+ volatileStateFields: ["lastChangedAt"]
20638
20870
  };
20639
20871
  /**
20640
20872
  * HVAC / climate control cap. Models the full surface of a HA
@@ -20794,7 +21026,14 @@ var climateControlCapability = {
20794
21026
  * the full slice via `device.state.climate-control.value` and refresh
20795
21027
  * on every push without re-querying the provider.
20796
21028
  */
20797
- runtimeState: ClimateControlStatusSchema
21029
+ runtimeState: ClimateControlStatusSchema,
21030
+ /**
21031
+ * Runtime-state durability: **session** — as `brightness`; `currentTemp` moves continuously and is re-published on connect.
21032
+ *
21033
+ * See `RuntimeStateDurability`. Enforced by
21034
+ * `scripts/check-runtime-state-durability.ts`.
21035
+ */
21036
+ durability: "session"
20798
21037
  };
20799
21038
  /**
20800
21039
  * Color-light cap. Coexists with `switch` (on/off) and `brightness`
@@ -20904,7 +21143,14 @@ onColorChanged: { data: object({
20904
21143
  * kernel. Read via `device.state.color.value` so UI pickers surface
20905
21144
  * the current chromaticity without polling the provider.
20906
21145
  */
20907
- runtimeState: ColorStatusSchema
21146
+ runtimeState: ColorStatusSchema,
21147
+ /**
21148
+ * Runtime-state durability: **session** — as `brightness`.
21149
+ *
21150
+ * See `RuntimeStateDurability`. Enforced by
21151
+ * `scripts/check-runtime-state-durability.ts`.
21152
+ */
21153
+ durability: "session"
20908
21154
  };
20909
21155
  var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
20910
21156
  object({
@@ -20962,7 +21208,17 @@ var connectivityCapability = {
20962
21208
  schema: ConnectivityStatusSchema,
20963
21209
  kind: "push"
20964
21210
  },
20965
- runtimeState: ConnectivityStatusSchema
21211
+ runtimeState: ConnectivityStatusSchema,
21212
+ /**
21213
+ * Runtime-state durability: **restored** — same shape and same argument as `device-status`, for links rather than devices.
21214
+ *
21215
+ * See `RuntimeStateDurability`. Enforced by
21216
+ * `scripts/check-runtime-state-durability.ts`.
21217
+ */
21218
+ durability: "restored",
21219
+ /** Clock fields: written, but excluded from the compare that decides
21220
+ * whether persisting is worth a SQLite commit. */
21221
+ volatileStateFields: ["lastChangedAt"]
20966
21222
  };
20967
21223
  /**
20968
21224
  * Generic device-consumables capability — surfaces a device's
@@ -21044,7 +21300,14 @@ reset: method(object({
21044
21300
  }
21045
21301
  }
21046
21302
  },
21047
- runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() })
21303
+ runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() }),
21304
+ /**
21305
+ * Runtime-state durability: **session** — the authority is the appliance; the provider re-reads the whole item array on connect.
21306
+ *
21307
+ * See `RuntimeStateDurability`. Enforced by
21308
+ * `scripts/check-runtime-state-durability.ts`.
21309
+ */
21310
+ durability: "session"
21048
21311
  };
21049
21312
  /**
21050
21313
  * Door / window / opening / garage / valve contact sensor. Boolean
@@ -21075,7 +21338,17 @@ var contactCapability = {
21075
21338
  schema: ContactStatusSchema,
21076
21339
  kind: "push"
21077
21340
  },
21078
- runtimeState: ContactStatusSchema
21341
+ runtimeState: ContactStatusSchema,
21342
+ /**
21343
+ * Runtime-state durability: **restored** — a door left open across a restart must still read open.
21344
+ *
21345
+ * See `RuntimeStateDurability`. Enforced by
21346
+ * `scripts/check-runtime-state-durability.ts`.
21347
+ */
21348
+ durability: "restored",
21349
+ /** Clock fields: written, but excluded from the compare that decides
21350
+ * whether persisting is worth a SQLite commit. */
21351
+ volatileStateFields: ["lastChangedAt"]
21079
21352
  };
21080
21353
  /**
21081
21354
  * Status slice — flat object (the framework's `runtimeState` contract
@@ -21181,7 +21454,14 @@ var controlCapability = {
21181
21454
  * dropdown / text field / date picker) read the slice's discriminant
21182
21455
  * and value directly without polling the provider.
21183
21456
  */
21184
- runtimeState: ControlStatusSchema
21457
+ runtimeState: ControlStatusSchema,
21458
+ /**
21459
+ * Runtime-state durability: **session** — a generic control mirrors an external entity that re-publishes on connect; the options array is re-derived with it.
21460
+ *
21461
+ * See `RuntimeStateDurability`. Enforced by
21462
+ * `scripts/check-runtime-state-durability.ts`.
21463
+ */
21464
+ durability: "session"
21185
21465
  };
21186
21466
  var CoverStatusSchema = object({
21187
21467
  /** Lifecycle state of the cover. */
@@ -21242,7 +21522,17 @@ var coverCapability = {
21242
21522
  * Runtime-state slice — mirrored by the kernel. UI controls watch
21243
21523
  * the slice for live position changes during a move.
21244
21524
  */
21245
- runtimeState: CoverStatusSchema
21525
+ runtimeState: CoverStatusSchema,
21526
+ /**
21527
+ * Runtime-state durability: **restored** — position survives a restart on the device; the mirror should agree at boot rather than read blank.
21528
+ *
21529
+ * See `RuntimeStateDurability`. Enforced by
21530
+ * `scripts/check-runtime-state-durability.ts`.
21531
+ */
21532
+ durability: "restored",
21533
+ /** Clock fields: written, but excluded from the compare that decides
21534
+ * whether persisting is worth a SQLite commit. */
21535
+ volatileStateFields: ["lastChangedAt"]
21246
21536
  };
21247
21537
  /**
21248
21538
  * Vendor-neutral day/night (IR-cut) control — the per-camera config cap
@@ -21336,7 +21626,17 @@ var dayNightCapability = {
21336
21626
  schema: DayNightStatusSchema,
21337
21627
  kind: "poll"
21338
21628
  },
21339
- runtimeState: DayNightStatusSchema
21629
+ runtimeState: DayNightStatusSchema,
21630
+ /**
21631
+ * Runtime-state durability: **restored** — operator-set IR-cut behaviour; mutation-driven.
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: ["lastFetchedAt"]
21340
21640
  };
21341
21641
  /**
21342
21642
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
@@ -21383,7 +21683,17 @@ onStatusChanged: { data: object({
21383
21683
  schema: DeviceStatusSchema,
21384
21684
  kind: "push"
21385
21685
  },
21386
- runtimeState: DeviceStatusSchema
21686
+ runtimeState: DeviceStatusSchema,
21687
+ /**
21688
+ * 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.
21689
+ *
21690
+ * See `RuntimeStateDurability`. Enforced by
21691
+ * `scripts/check-runtime-state-durability.ts`.
21692
+ */
21693
+ durability: "restored",
21694
+ /** Clock fields: written, but excluded from the compare that decides
21695
+ * whether persisting is worth a SQLite commit. */
21696
+ volatileStateFields: ["lastChangedAt"]
21387
21697
  };
21388
21698
  /**
21389
21699
  * Doorbell button cap. Two kinds of providers coexist behind this cap
@@ -21445,7 +21755,14 @@ onPressed: { data: DoorbellPressEventSchema } },
21445
21755
  * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
21446
21756
  * without subscribing.
21447
21757
  */
21448
- runtimeState: DoorbellStatusSchema
21758
+ runtimeState: DoorbellStatusSchema,
21759
+ /**
21760
+ * 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.
21761
+ *
21762
+ * See `RuntimeStateDurability`. Enforced by
21763
+ * `scripts/check-runtime-state-durability.ts`.
21764
+ */
21765
+ durability: "restored"
21449
21766
  };
21450
21767
  /**
21451
21768
  * Enum-state sensor — a string value picked from a finite option set.
@@ -21485,7 +21802,17 @@ var enumSensorCapability = {
21485
21802
  schema: EnumSensorStatusSchema,
21486
21803
  kind: "push"
21487
21804
  },
21488
- runtimeState: EnumSensorStatusSchema
21805
+ runtimeState: EnumSensorStatusSchema,
21806
+ /**
21807
+ * Runtime-state durability: **restored** — as `numeric-sensor`; 80 devices.
21808
+ *
21809
+ * See `RuntimeStateDurability`. Enforced by
21810
+ * `scripts/check-runtime-state-durability.ts`.
21811
+ */
21812
+ durability: "restored",
21813
+ /** Clock fields: written, but excluded from the compare that decides
21814
+ * whether persisting is worth a SQLite commit. */
21815
+ volatileStateFields: ["lastFetchedAt"]
21489
21816
  };
21490
21817
  /**
21491
21818
  * Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
@@ -21521,7 +21848,14 @@ var eventEmitterCapability = {
21521
21848
  schema: EventEmitterStatusSchema,
21522
21849
  kind: "push"
21523
21850
  },
21524
- runtimeState: EventEmitterStatusSchema
21851
+ runtimeState: EventEmitterStatusSchema,
21852
+ /**
21853
+ * Runtime-state durability: **session** — `eventCountSinceStart` names its own scope.
21854
+ *
21855
+ * See `RuntimeStateDurability`. Enforced by
21856
+ * `scripts/check-runtime-state-durability.ts`.
21857
+ */
21858
+ durability: "session"
21525
21859
  };
21526
21860
  var EventItemSchema = object({
21527
21861
  id: string(),
@@ -21802,7 +22136,14 @@ var fanControlCapability = {
21802
22136
  * Runtime-state slice — mirrored by the kernel. UI fan speed
21803
22137
  * sliders read `percentage` for live updates.
21804
22138
  */
21805
- runtimeState: FanControlStatusSchema
22139
+ runtimeState: FanControlStatusSchema,
22140
+ /**
22141
+ * Runtime-state durability: **session** — as `brightness`.
22142
+ *
22143
+ * See `RuntimeStateDurability`. Enforced by
22144
+ * `scripts/check-runtime-state-durability.ts`.
22145
+ */
22146
+ durability: "session"
21806
22147
  };
21807
22148
  /**
21808
22149
  * Per-device feature/identity probe slice. Holds the runtime-resolved
@@ -21878,7 +22219,14 @@ onProbeChanged: { data: object({
21878
22219
  schema: FeatureProbeStatusSchema,
21879
22220
  kind: "push"
21880
22221
  },
21881
- runtimeState: FeatureProbeStatusSchema
22222
+ runtimeState: FeatureProbeStatusSchema,
22223
+ /**
22224
+ * 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.
22225
+ *
22226
+ * See `RuntimeStateDurability`. Enforced by
22227
+ * `scripts/check-runtime-state-durability.ts`.
22228
+ */
22229
+ durability: "session"
21882
22230
  };
21883
22231
  /**
21884
22232
  * Water leak / moisture sensor. Boolean "is liquid currently
@@ -21905,7 +22253,17 @@ var floodCapability = {
21905
22253
  schema: FloodStatusSchema,
21906
22254
  kind: "push"
21907
22255
  },
21908
- runtimeState: FloodStatusSchema
22256
+ runtimeState: FloodStatusSchema,
22257
+ /**
22258
+ * Runtime-state durability: **restored** — as `smoke`.
22259
+ *
22260
+ * See `RuntimeStateDurability`. Enforced by
22261
+ * `scripts/check-runtime-state-durability.ts`.
22262
+ */
22263
+ durability: "restored",
22264
+ /** Clock fields: written, but excluded from the compare that decides
22265
+ * whether persisting is worth a SQLite commit. */
22266
+ volatileStateFields: ["lastChangedAt"]
21909
22267
  };
21910
22268
  /**
21911
22269
  * Combustible-gas (LPG / methane / hydrogen) alarm sensor. Drives
@@ -21928,7 +22286,17 @@ var gasCapability = {
21928
22286
  schema: GasStatusSchema,
21929
22287
  kind: "push"
21930
22288
  },
21931
- runtimeState: GasStatusSchema
22289
+ runtimeState: GasStatusSchema,
22290
+ /**
22291
+ * Runtime-state durability: **restored** — as `smoke`.
22292
+ *
22293
+ * See `RuntimeStateDurability`. Enforced by
22294
+ * `scripts/check-runtime-state-durability.ts`.
22295
+ */
22296
+ durability: "restored",
22297
+ /** Clock fields: written, but excluded from the compare that decides
22298
+ * whether persisting is worth a SQLite commit. */
22299
+ volatileStateFields: ["lastChangedAt"]
21932
22300
  };
21933
22301
  /**
21934
22302
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
@@ -22004,7 +22372,14 @@ var humidifierCapability = {
22004
22372
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22005
22373
  * slice for live humidity / mode changes.
22006
22374
  */
22007
- runtimeState: HumidifierStatusSchema
22375
+ runtimeState: HumidifierStatusSchema,
22376
+ /**
22377
+ * Runtime-state durability: **session** — as `climate-control`.
22378
+ *
22379
+ * See `RuntimeStateDurability`. Enforced by
22380
+ * `scripts/check-runtime-state-durability.ts`.
22381
+ */
22382
+ durability: "session"
22008
22383
  };
22009
22384
  /**
22010
22385
  * Single-metric humidity reading. Drives Home Assistant `sensor`
@@ -22040,7 +22415,17 @@ var humiditySensorCapability = {
22040
22415
  schema: HumiditySensorStatusSchema,
22041
22416
  kind: "push"
22042
22417
  },
22043
- runtimeState: HumiditySensorStatusSchema
22418
+ runtimeState: HumiditySensorStatusSchema,
22419
+ /**
22420
+ * Runtime-state durability: **restored** — as `numeric-sensor` (67 of 75 writes were the clock alone).
22421
+ *
22422
+ * See `RuntimeStateDurability`. Enforced by
22423
+ * `scripts/check-runtime-state-durability.ts`.
22424
+ */
22425
+ durability: "restored",
22426
+ /** Clock fields: written, but excluded from the compare that decides
22427
+ * whether persisting is worth a SQLite commit. */
22428
+ volatileStateFields: ["lastFetchedAt"]
22044
22429
  };
22045
22430
  /**
22046
22431
  * Image display cap. Models a single still image exposed by an integration —
@@ -22078,7 +22463,14 @@ var imageCapability = {
22078
22463
  * Runtime-state slice — mirrored by the kernel. The UI reads `url`
22079
22464
  * directly and renders the still image.
22080
22465
  */
22081
- runtimeState: ImageStatusSchema
22466
+ runtimeState: ImageStatusSchema,
22467
+ /**
22468
+ * Runtime-state durability: **session** — a snapshot URL is a session-scoped handle; a restored one points at nothing.
22469
+ *
22470
+ * See `RuntimeStateDurability`. Enforced by
22471
+ * `scripts/check-runtime-state-durability.ts`.
22472
+ */
22473
+ durability: "session"
22082
22474
  };
22083
22475
  /**
22084
22476
  * Vendor-neutral image / picture-adjustment cap — the per-camera config
@@ -22227,7 +22619,17 @@ var imageSettingsCapability = {
22227
22619
  schema: ImageSettingsStatusSchema,
22228
22620
  kind: "poll"
22229
22621
  },
22230
- runtimeState: ImageSettingsStatusSchema
22622
+ runtimeState: ImageSettingsStatusSchema,
22623
+ /**
22624
+ * Runtime-state durability: **restored** — operator-set camera imaging; mutation-driven.
22625
+ *
22626
+ * See `RuntimeStateDurability`. Enforced by
22627
+ * `scripts/check-runtime-state-durability.ts`.
22628
+ */
22629
+ durability: "restored",
22630
+ /** Clock fields: written, but excluded from the compare that decides
22631
+ * whether persisting is worth a SQLite commit. */
22632
+ volatileStateFields: ["lastFetchedAt"]
22231
22633
  };
22232
22634
  /**
22233
22635
  * integrations — system-scoped singleton capability for integration
@@ -22567,7 +22969,14 @@ var lawnMowerControlCapability = {
22567
22969
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22568
22970
  * slice for live activity + battery changes.
22569
22971
  */
22570
- runtimeState: LawnMowerControlStatusSchema
22972
+ runtimeState: LawnMowerControlStatusSchema,
22973
+ /**
22974
+ * Runtime-state durability: **session** — as `vacuum-control`.
22975
+ *
22976
+ * See `RuntimeStateDurability`. Enforced by
22977
+ * `scripts/check-runtime-state-durability.ts`.
22978
+ */
22979
+ durability: "session"
22571
22980
  };
22572
22981
  /**
22573
22982
  * local-network — hub-only singleton.
@@ -22773,7 +23182,17 @@ var lockControlCapability = {
22773
23182
  * read `state` and disable themselves during `locking`/`unlocking`
22774
23183
  * transitions.
22775
23184
  */
22776
- runtimeState: LockControlStatusSchema
23185
+ runtimeState: LockControlStatusSchema,
23186
+ /**
23187
+ * Runtime-state durability: **restored** — a lock left locked must still read locked.
23188
+ *
23189
+ * See `RuntimeStateDurability`. Enforced by
23190
+ * `scripts/check-runtime-state-durability.ts`.
23191
+ */
23192
+ durability: "restored",
23193
+ /** Clock fields: written, but excluded from the compare that decides
23194
+ * whether persisting is worth a SQLite commit. */
23195
+ volatileStateFields: ["lastChangedAt"]
22777
23196
  };
22778
23197
  /**
22779
23198
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
@@ -22935,7 +23354,14 @@ var mediaPlayerCapability = {
22935
23354
  * full slice for live now-playing, volume, and progress updates
22936
23355
  * without polling.
22937
23356
  */
22938
- runtimeState: MediaPlayerStatusSchema
23357
+ runtimeState: MediaPlayerStatusSchema,
23358
+ /**
23359
+ * Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
23360
+ *
23361
+ * See `RuntimeStateDurability`. Enforced by
23362
+ * `scripts/check-runtime-state-durability.ts`.
23363
+ */
23364
+ durability: "session"
22939
23365
  };
22940
23366
  /**
22941
23367
  * mesh-network — collection cap for mesh-VPN providers.
@@ -23199,7 +23625,14 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
23199
23625
  * `device.state.motion.value`. Reads never invoke the provider, so
23200
23626
  * UIs and other addons can poll the cached state safely.
23201
23627
  */
23202
- runtimeState: MotionStatusSchema
23628
+ runtimeState: MotionStatusSchema,
23629
+ /**
23630
+ * 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.
23631
+ *
23632
+ * See `RuntimeStateDurability`. Enforced by
23633
+ * `scripts/check-runtime-state-durability.ts`.
23634
+ */
23635
+ durability: "session"
23203
23636
  };
23204
23637
  /**
23205
23638
  * Motion-trigger toggle for accessory devices.
@@ -23264,7 +23697,14 @@ var motionTriggerCapability = {
23264
23697
  schema: MotionTriggerStatusSchema,
23265
23698
  kind: "command-driven"
23266
23699
  },
23267
- runtimeState: MotionTriggerRuntimeStateSchema
23700
+ runtimeState: MotionTriggerRuntimeStateSchema,
23701
+ /**
23702
+ * 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.
23703
+ *
23704
+ * See `RuntimeStateDurability`. Enforced by
23705
+ * `scripts/check-runtime-state-durability.ts`.
23706
+ */
23707
+ durability: "session"
23268
23708
  };
23269
23709
  /**
23270
23710
  * Motion-zones share the same MaskShape vocabulary as privacy-mask — the
@@ -23331,7 +23771,17 @@ var motionZonesCapability = {
23331
23771
  schema: MotionZoneStatusSchema,
23332
23772
  kind: "poll"
23333
23773
  },
23334
- runtimeState: MotionZoneStatusSchema
23774
+ runtimeState: MotionZoneStatusSchema,
23775
+ /**
23776
+ * 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.
23777
+ *
23778
+ * See `RuntimeStateDurability`. Enforced by
23779
+ * `scripts/check-runtime-state-durability.ts`.
23780
+ */
23781
+ durability: "restored",
23782
+ /** Clock fields: written, but excluded from the compare that decides
23783
+ * whether persisting is worth a SQLite commit. */
23784
+ volatileStateFields: ["lastFetchedAt"]
23335
23785
  };
23336
23786
  /**
23337
23787
  * On-camera AI object detection cap. Surfaces per-device the classes
@@ -23405,7 +23855,17 @@ var nativeObjectDetectionCapability = {
23405
23855
  schema: NativeObjectDetectionStatusSchema,
23406
23856
  kind: "push"
23407
23857
  },
23408
- runtimeState: NativeObjectDetectionRuntimeStateSchema
23858
+ runtimeState: NativeObjectDetectionRuntimeStateSchema,
23859
+ /**
23860
+ * 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.
23861
+ *
23862
+ * See `RuntimeStateDurability`. Enforced by
23863
+ * `scripts/check-runtime-state-durability.ts`.
23864
+ */
23865
+ durability: "restored",
23866
+ /** Clock fields: written, but excluded from the compare that decides
23867
+ * whether persisting is worth a SQLite commit. */
23868
+ volatileStateFields: ["lastFetchedAt"]
23409
23869
  };
23410
23870
  /**
23411
23871
  * network-quality — system-scoped singleton capability tracking RTT,
@@ -23739,7 +24199,14 @@ onSent: { data: object({
23739
24199
  * form reads `supports` to gate optional fields; history pane reads
23740
24200
  * `lastSentAt` / `lastError` / `queueDepth`.
23741
24201
  */
23742
- runtimeState: NotifierStatusSchema
24202
+ runtimeState: NotifierStatusSchema,
24203
+ /**
24204
+ * Runtime-state durability: **session** — live queue depth and last-send state; a restored queue depth describes a queue that no longer exists.
24205
+ *
24206
+ * See `RuntimeStateDurability`. Enforced by
24207
+ * `scripts/check-runtime-state-durability.ts`.
24208
+ */
24209
+ durability: "session"
23743
24210
  };
23744
24211
  /**
23745
24212
  * Generic numeric sensor — last-resort fallback when no typed numeric
@@ -23782,7 +24249,17 @@ var numericSensorCapability = {
23782
24249
  schema: NumericSensorStatusSchema,
23783
24250
  kind: "push"
23784
24251
  },
23785
- runtimeState: NumericSensorStatusSchema
24252
+ runtimeState: NumericSensorStatusSchema,
24253
+ /**
24254
+ * 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.
24255
+ *
24256
+ * See `RuntimeStateDurability`. Enforced by
24257
+ * `scripts/check-runtime-state-durability.ts`.
24258
+ */
24259
+ durability: "restored",
24260
+ /** Clock fields: written, but excluded from the compare that decides
24261
+ * whether persisting is worth a SQLite commit. */
24262
+ volatileStateFields: ["lastFetchedAt"]
23786
24263
  };
23787
24264
  /**
23788
24265
  * Generic on-screen-display (video overlay) cap. Each camera exposes
@@ -24213,7 +24690,14 @@ var petFeederCapability = {
24213
24690
  * the full slice via `device.state.petFeeder.value` and refresh on
24214
24691
  * every poll without re-querying the provider.
24215
24692
  */
24216
- runtimeState: PetFeederStatusSchema
24693
+ runtimeState: PetFeederStatusSchema,
24694
+ /**
24695
+ * Runtime-state durability: **session** — live appliance state re-published on connect.
24696
+ *
24697
+ * See `RuntimeStateDurability`. Enforced by
24698
+ * `scripts/check-runtime-state-durability.ts`.
24699
+ */
24700
+ durability: "session"
24217
24701
  };
24218
24702
  var VehicleSchema = object({
24219
24703
  id: string(),
@@ -24525,7 +25009,17 @@ var powerMeterCapability = {
24525
25009
  schema: PowerMeterStatusSchema,
24526
25010
  kind: "push"
24527
25011
  },
24528
- runtimeState: PowerMeterStatusSchema
25012
+ runtimeState: PowerMeterStatusSchema,
25013
+ /**
25014
+ * Runtime-state durability: **restored** — as `numeric-sensor`; `kwhTotal` is an accumulator whose restored value is the baseline.
25015
+ *
25016
+ * See `RuntimeStateDurability`. Enforced by
25017
+ * `scripts/check-runtime-state-durability.ts`.
25018
+ */
25019
+ durability: "restored",
25020
+ /** Clock fields: written, but excluded from the compare that decides
25021
+ * whether persisting is worth a SQLite commit. */
25022
+ volatileStateFields: ["lastFetchedAt"]
24529
25023
  };
24530
25024
  /**
24531
25025
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -24582,7 +25076,17 @@ var presenceCapability = {
24582
25076
  * the map pin is rendered (use `DeviceFeature.PresenceGps` for the
24583
25077
  * pre-fetch fast-path check).
24584
25078
  */
24585
- runtimeState: PresenceStatusSchema
25079
+ runtimeState: PresenceStatusSchema,
25080
+ /**
25081
+ * Runtime-state durability: **restored** — occupancy-relevant: the restored state is what an occupancy rule compares the first post-restart observation against.
25082
+ *
25083
+ * See `RuntimeStateDurability`. Enforced by
25084
+ * `scripts/check-runtime-state-durability.ts`.
25085
+ */
25086
+ durability: "restored",
25087
+ /** Clock fields: written, but excluded from the compare that decides
25088
+ * whether persisting is worth a SQLite commit. */
25089
+ volatileStateFields: ["lastChangedAt"]
24586
25090
  };
24587
25091
  /**
24588
25092
  * Atmospheric pressure reading in hectopascals. Drives Home Assistant
@@ -24618,7 +25122,17 @@ var pressureSensorCapability = {
24618
25122
  schema: PressureSensorStatusSchema,
24619
25123
  kind: "push"
24620
25124
  },
24621
- runtimeState: PressureSensorStatusSchema
25125
+ runtimeState: PressureSensorStatusSchema,
25126
+ /**
25127
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
25128
+ *
25129
+ * See `RuntimeStateDurability`. Enforced by
25130
+ * `scripts/check-runtime-state-durability.ts`.
25131
+ */
25132
+ durability: "restored",
25133
+ /** Clock fields: written, but excluded from the compare that decides
25134
+ * whether persisting is worth a SQLite commit. */
25135
+ volatileStateFields: ["lastFetchedAt"]
24622
25136
  };
24623
25137
  /**
24624
25138
  * PRIVACY — what the camera deliberately does not capture. Two planes:
@@ -24748,7 +25262,17 @@ var privacyMaskCapability = {
24748
25262
  schema: PrivacyMaskStatusSchema,
24749
25263
  kind: "poll"
24750
25264
  },
24751
- runtimeState: PrivacyMaskStatusSchema
25265
+ runtimeState: PrivacyMaskStatusSchema,
25266
+ /**
25267
+ * Runtime-state durability: **restored** — operator-drawn regions, zero real churn — 22 writes in 25 minutes, every one of them the clock.
25268
+ *
25269
+ * See `RuntimeStateDurability`. Enforced by
25270
+ * `scripts/check-runtime-state-durability.ts`.
25271
+ */
25272
+ durability: "restored",
25273
+ /** Clock fields: written, but excluded from the compare that decides
25274
+ * whether persisting is worth a SQLite commit. */
25275
+ volatileStateFields: ["lastFetchedAt"]
24752
25276
  };
24753
25277
  var PtzPresetSchema = object({
24754
25278
  id: string(),
@@ -24956,7 +25480,14 @@ var ptzAutotrackCapability = {
24956
25480
  * fetch / cache / fallback logic out of the four cap methods —
24957
25481
  * they become trampolines over `runtimeState`.
24958
25482
  */
24959
- runtimeState: PtzAutotrackRuntimeStateSchema
25483
+ runtimeState: PtzAutotrackRuntimeStateSchema,
25484
+ /**
25485
+ * Runtime-state durability: **session** — mirrors the camera's own autotrack config, re-read on connect.
25486
+ *
25487
+ * See `RuntimeStateDurability`. Enforced by
25488
+ * `scripts/check-runtime-state-durability.ts`.
25489
+ */
25490
+ durability: "session"
24960
25491
  };
24961
25492
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
24962
25493
  kind: "mutation",
@@ -25606,7 +26137,14 @@ var sceneMonitorCapability = {
25606
26137
  schema: SceneMonitorStatusSchema,
25607
26138
  kind: "push"
25608
26139
  },
25609
- runtimeState: SceneMonitorStatusSchema
26140
+ runtimeState: SceneMonitorStatusSchema,
26141
+ /**
26142
+ * Runtime-state durability: **session** — re-derived from the current scene on the next evaluation.
26143
+ *
26144
+ * See `RuntimeStateDurability`. Enforced by
26145
+ * `scripts/check-runtime-state-durability.ts`.
26146
+ */
26147
+ durability: "session"
25610
26148
  };
25611
26149
  /**
25612
26150
  * Per-stage gating mode applied to the zones a rule references.
@@ -25750,7 +26288,14 @@ var scriptRunnerCapability = {
25750
26288
  * `isRunning` to render a spinner during execution and surfaces
25751
26289
  * `lastError` / `lastRunSuccess` in the recent-runs panel.
25752
26290
  */
25753
- runtimeState: ScriptRunnerStatusSchema
26291
+ runtimeState: ScriptRunnerStatusSchema,
26292
+ /**
26293
+ * Runtime-state durability: **session** — a restored `isRunning: true` describes a process that died with the previous hub.
26294
+ *
26295
+ * See `RuntimeStateDurability`. Enforced by
26296
+ * `scripts/check-runtime-state-durability.ts`.
26297
+ */
26298
+ durability: "session"
25754
26299
  };
25755
26300
  /**
25756
26301
  * Smoke alarm sensor — boolean "is smoke currently detected" with
@@ -25777,7 +26322,17 @@ var smokeCapability = {
25777
26322
  schema: SmokeStatusSchema,
25778
26323
  kind: "push"
25779
26324
  },
25780
- runtimeState: SmokeStatusSchema
26325
+ runtimeState: SmokeStatusSchema,
26326
+ /**
26327
+ * Runtime-state durability: **restored** — a safety sensor must not read "clear" merely because the hub restarted.
26328
+ *
26329
+ * See `RuntimeStateDurability`. Enforced by
26330
+ * `scripts/check-runtime-state-durability.ts`.
26331
+ */
26332
+ durability: "restored",
26333
+ /** Clock fields: written, but excluded from the compare that decides
26334
+ * whether persisting is worth a SQLite commit. */
26335
+ volatileStateFields: ["lastChangedAt"]
25781
26336
  };
25782
26337
  /**
25783
26338
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -25963,7 +26518,17 @@ var streamParamsCapability = {
25963
26518
  schema: StreamParamsStatusSchema,
25964
26519
  kind: "poll"
25965
26520
  },
25966
- runtimeState: StreamParamsStatusSchema
26521
+ runtimeState: StreamParamsStatusSchema,
26522
+ /**
26523
+ * Runtime-state durability: **restored** — operator-set encoder profile; mutation-driven.
26524
+ *
26525
+ * See `RuntimeStateDurability`. Enforced by
26526
+ * `scripts/check-runtime-state-durability.ts`.
26527
+ */
26528
+ durability: "restored",
26529
+ /** Clock fields: written, but excluded from the compare that decides
26530
+ * whether persisting is worth a SQLite commit. */
26531
+ volatileStateFields: ["lastFetchedAt"]
25967
26532
  };
25968
26533
  /**
25969
26534
  * The three well-known stream profiles in render order. Exported so the
@@ -26207,6 +26772,16 @@ var switchCapability = {
26207
26772
  * not need to re-query the provider after a setState mutation.
26208
26773
  */
26209
26774
  runtimeState: SwitchStatusSchema,
26775
+ /**
26776
+ * Runtime-state durability: **restored** — device state an operator reads as authoritative; 55 devices, transition-driven.
26777
+ *
26778
+ * See `RuntimeStateDurability`. Enforced by
26779
+ * `scripts/check-runtime-state-durability.ts`.
26780
+ */
26781
+ durability: "restored",
26782
+ /** Clock fields: written, but excluded from the compare that decides
26783
+ * whether persisting is worth a SQLite commit. */
26784
+ volatileStateFields: ["lastChangedAt"],
26210
26785
  settings: { bindings: [{
26211
26786
  kind: "scalar",
26212
26787
  statusPath: "on",
@@ -26286,7 +26861,17 @@ var tamperCapability = {
26286
26861
  schema: TamperStatusSchema,
26287
26862
  kind: "push"
26288
26863
  },
26289
- runtimeState: TamperStatusSchema
26864
+ runtimeState: TamperStatusSchema,
26865
+ /**
26866
+ * Runtime-state durability: **restored** — as `smoke`.
26867
+ *
26868
+ * See `RuntimeStateDurability`. Enforced by
26869
+ * `scripts/check-runtime-state-durability.ts`.
26870
+ */
26871
+ durability: "restored",
26872
+ /** Clock fields: written, but excluded from the compare that decides
26873
+ * whether persisting is worth a SQLite commit. */
26874
+ volatileStateFields: ["lastChangedAt"]
26290
26875
  };
26291
26876
  /**
26292
26877
  * Single-metric temperature reading. Drives Home Assistant `sensor`
@@ -26331,7 +26916,17 @@ var temperatureSensorCapability = {
26331
26916
  schema: TemperatureSensorStatusSchema,
26332
26917
  kind: "push"
26333
26918
  },
26334
- runtimeState: TemperatureSensorStatusSchema
26919
+ runtimeState: TemperatureSensorStatusSchema,
26920
+ /**
26921
+ * Runtime-state durability: **restored** — as `numeric-sensor` (69 of 125 writes were the clock alone).
26922
+ *
26923
+ * See `RuntimeStateDurability`. Enforced by
26924
+ * `scripts/check-runtime-state-durability.ts`.
26925
+ */
26926
+ durability: "restored",
26927
+ /** Clock fields: written, but excluded from the compare that decides
26928
+ * whether persisting is worth a SQLite commit. */
26929
+ volatileStateFields: ["lastFetchedAt"]
26335
26930
  };
26336
26931
  /**
26337
26932
  * toast — system-scoped singleton capability that streams toast
@@ -26400,7 +26995,14 @@ var updateCapability = {
26400
26995
  schema: UpdateStatusSchema,
26401
26996
  kind: "poll"
26402
26997
  },
26403
- runtimeState: UpdateStatusSchema
26998
+ runtimeState: UpdateStatusSchema,
26999
+ /**
27000
+ * Runtime-state durability: **session** — a restored `inProgress: true` describes an update that is no longer running; versions are re-probed at boot.
27001
+ *
27002
+ * See `RuntimeStateDurability`. Enforced by
27003
+ * `scripts/check-runtime-state-durability.ts`.
27004
+ */
27005
+ durability: "session"
26404
27006
  };
26405
27007
  var UserSummarySchema = object({
26406
27008
  id: string(),
@@ -26734,7 +27336,14 @@ var vacuumControlCapability = {
26734
27336
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26735
27337
  * slice for live state + battery + fan-speed changes.
26736
27338
  */
26737
- runtimeState: VacuumControlStatusSchema
27339
+ runtimeState: VacuumControlStatusSchema,
27340
+ /**
27341
+ * Runtime-state durability: **session** — as `media-player` — a restored `state: cleaning` is a robot that is not cleaning.
27342
+ *
27343
+ * See `RuntimeStateDurability`. Enforced by
27344
+ * `scripts/check-runtime-state-durability.ts`.
27345
+ */
27346
+ durability: "session"
26738
27347
  };
26739
27348
  var ValveStatusSchema = object({
26740
27349
  /** Lifecycle state of the valve. */
@@ -26786,7 +27395,14 @@ var valveCapability = {
26786
27395
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26787
27396
  * slice for live position changes during a move.
26788
27397
  */
26789
- runtimeState: ValveStatusSchema
27398
+ runtimeState: ValveStatusSchema,
27399
+ /**
27400
+ * Runtime-state durability: **session** — as `brightness`.
27401
+ *
27402
+ * See `RuntimeStateDurability`. Enforced by
27403
+ * `scripts/check-runtime-state-durability.ts`.
27404
+ */
27405
+ durability: "session"
26790
27406
  };
26791
27407
  /**
26792
27408
  * Vibration / shake / impact sensor. Drives Home Assistant
@@ -26808,7 +27424,17 @@ var vibrationCapability = {
26808
27424
  schema: VibrationStatusSchema,
26809
27425
  kind: "push"
26810
27426
  },
26811
- runtimeState: VibrationStatusSchema
27427
+ runtimeState: VibrationStatusSchema,
27428
+ /**
27429
+ * Runtime-state durability: **restored** — as `smoke`.
27430
+ *
27431
+ * See `RuntimeStateDurability`. Enforced by
27432
+ * `scripts/check-runtime-state-durability.ts`.
27433
+ */
27434
+ durability: "restored",
27435
+ /** Clock fields: written, but excluded from the compare that decides
27436
+ * whether persisting is worth a SQLite commit. */
27437
+ volatileStateFields: ["lastChangedAt"]
26812
27438
  };
26813
27439
  /**
26814
27440
  * Water heater / boiler cap. Models HA `water_heater.*` entities — a
@@ -26882,7 +27508,14 @@ var waterHeaterCapability = {
26882
27508
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26883
27509
  * slice for live temperature / mode / away changes.
26884
27510
  */
26885
- runtimeState: WaterHeaterStatusSchema
27511
+ runtimeState: WaterHeaterStatusSchema,
27512
+ /**
27513
+ * Runtime-state durability: **session** — as `climate-control`.
27514
+ *
27515
+ * See `RuntimeStateDurability`. Enforced by
27516
+ * `scripts/check-runtime-state-durability.ts`.
27517
+ */
27518
+ durability: "session"
26886
27519
  };
26887
27520
  /**
26888
27521
  * Weather provider cap. Models HA `weather.*` entities — a read-only
@@ -26941,7 +27574,14 @@ var weatherCapability = {
26941
27574
  * Runtime-state slice — mirrored by the kernel. The UI reads the
26942
27575
  * current conditions directly from the slice on each weather push.
26943
27576
  */
26944
- runtimeState: WeatherStatusSchema
27577
+ runtimeState: WeatherStatusSchema,
27578
+ /**
27579
+ * Runtime-state durability: **session** — a forecast is stale the moment the hub is down; the provider re-fetches on connect.
27580
+ *
27581
+ * See `RuntimeStateDurability`. Enforced by
27582
+ * `scripts/check-runtime-state-durability.ts`.
27583
+ */
27584
+ durability: "session"
26945
27585
  };
26946
27586
  /**
26947
27587
  * Per-zone occupancy aggregation produced by the analytics frame
@@ -27103,7 +27743,14 @@ var zoneAnalyticsCapability = {
27103
27743
  * automatically; the explicit `getCurrentSnapshot` cap method is
27104
27744
  * still useful for one-off polls without a subscription.
27105
27745
  */
27106
- runtimeState: CameraOccupancySnapshotSchema
27746
+ runtimeState: CameraOccupancySnapshotSchema,
27747
+ /**
27748
+ * Runtime-state durability: **session** — per-frame analytics; with `audio-metrics` it is ~90 % of the offered write rate. Re-derived on the next frame.
27749
+ *
27750
+ * See `RuntimeStateDurability`. Enforced by
27751
+ * `scripts/check-runtime-state-durability.ts`.
27752
+ */
27753
+ durability: "session"
27107
27754
  };
27108
27755
  /**
27109
27756
  * Stages a {@link ZoneRule} can apply to. Discriminator on the rules
@@ -27181,7 +27828,14 @@ var zoneRulesCapability = {
27181
27828
  motion: array(ZoneRuleSchema).readonly(),
27182
27829
  detection: array(ZoneRuleSchema).readonly(),
27183
27830
  package: array(ZoneRuleSchema).readonly()
27184
- })
27831
+ }),
27832
+ /**
27833
+ * Runtime-state durability: **restored** — operator intent, mutation-only, same argument as `zones`.
27834
+ *
27835
+ * See `RuntimeStateDurability`. Enforced by
27836
+ * `scripts/check-runtime-state-durability.ts`.
27837
+ */
27838
+ durability: "restored"
27185
27839
  };
27186
27840
  /**
27187
27841
  * Accessory device helpers — shared across drivers.
@@ -33999,6 +34653,7 @@ Object.freeze({
33999
34653
  "network-access": "ingress",
34000
34654
  "smtp-provider": "email"
34001
34655
  });
34656
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
34002
34657
  new Set(["devices", "classes"]);
34003
34658
  /**
34004
34659
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.