@camstack/addon-provider-wyze 0.2.14 → 0.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +732 -77
  2. package/dist/addon.mjs +732 -77
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -10788,7 +10788,14 @@ var cameraStreamsCapability = {
10788
10788
  low: string().optional()
10789
10789
  }),
10790
10790
  lastChangedAt: number()
10791
- })
10791
+ }),
10792
+ /**
10793
+ * 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.
10794
+ *
10795
+ * See `RuntimeStateDurability`. Enforced by
10796
+ * `scripts/check-runtime-state-durability.ts`.
10797
+ */
10798
+ durability: "session"
10792
10799
  };
10793
10800
  /** Where a block runs. The operator chooses — a block driving a device on an
10794
10801
  * agent is the reason placement is not fixed to the hub. */
@@ -11349,6 +11356,13 @@ var deviceDiscoveryCapability = {
11349
11356
  kind: "poll"
11350
11357
  },
11351
11358
  runtimeState: DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: number().int().nonnegative() }),
11359
+ /**
11360
+ * Runtime-state durability: **session** — 5.7 KB of scan output on the largest device, fully re-derivable by re-scanning.
11361
+ *
11362
+ * See `RuntimeStateDurability`. Enforced by
11363
+ * `scripts/check-runtime-state-durability.ts`.
11364
+ */
11365
+ durability: "session",
11352
11366
  methods: {
11353
11367
  /**
11354
11368
  * Snapshot of the current `discovered` list. Returns the
@@ -13235,11 +13249,33 @@ var NotificationFormatSchema = _enum([
13235
13249
  * Named by INTENT, never by glyph. "check" would tie the vocabulary to one
13236
13250
  * renderer's icon set; "acknowledge" survives an adapter that draws it
13237
13251
  * differently.
13252
+ *
13253
+ * ── A TOKEN IS NOT A WIRE VALUE ─────────────────────────────────────
13254
+ *
13255
+ * These names are for US. **No adapter may forward one verbatim.** Each maps
13256
+ * the whole set onto its own renderer's vocabulary through a
13257
+ * `Record<NotificationActionIcon, string>` — a Record, never a lookup with a
13258
+ * fallback, so adding a member here fails every adapter's build until someone
13259
+ * decides its glyph, which is the only place that decision can be made
13260
+ * honestly.
13261
+ *
13262
+ * This paragraph is the bug. Zentik declared `actionIcons: true` and passed
13263
+ * `disarm` straight through; iOS feeds that string to
13264
+ * `UNNotificationActionIcon(systemImageName:)`, `disarm` is not an SF Symbol,
13265
+ * and every snooze and alarm button arrived BLANK. A pass-through is not a
13266
+ * mapping, and "the field is documented" is not "the value renders".
13267
+ *
13268
+ * Adding a member is TRAIN-BOUND. The enum lives in the published
13269
+ * `@camstack/server` closure and the cap seam validates against the HUB's copy,
13270
+ * so an addon that emits a token the running hub does not know does not lose an
13271
+ * icon — its whole `send` fails Zod validation and the notification never
13272
+ * arrives. Never emit a new token from an addon before the train carrying it.
13238
13273
  */
13239
13274
  var NotificationActionIconSchema = _enum([
13240
13275
  "acknowledge",
13241
13276
  "dismiss",
13242
13277
  "silence",
13278
+ "snooze",
13243
13279
  "view",
13244
13280
  "play",
13245
13281
  "open",
@@ -13247,9 +13283,13 @@ var NotificationActionIconSchema = _enum([
13247
13283
  "lock",
13248
13284
  "unlock",
13249
13285
  "arm",
13286
+ "arm-home",
13287
+ "arm-away",
13288
+ "arm-night",
13250
13289
  "disarm",
13251
13290
  "light",
13252
- "alert"
13291
+ "alert",
13292
+ "camera"
13253
13293
  ]);
13254
13294
  /** A single tap-through action button. */
13255
13295
  var NotificationActionSchema = object({
@@ -13265,7 +13305,23 @@ var NotificationActionSchema = object({
13265
13305
  * else — see `notification-center/action-token.ts` for what that does and
13266
13306
  * does not buy.
13267
13307
  */
13268
- destructive: boolean().optional()
13308
+ destructive: boolean().optional(),
13309
+ /**
13310
+ * How the tap should REACH the url.
13311
+ *
13312
+ * `navigate` (absent, and every button authored before this field) opens it:
13313
+ * the phone leaves the notification and shows whatever the callback returns.
13314
+ * That is right for a button whose answer the operator wants to read.
13315
+ *
13316
+ * `background` fires it as a POST and stays put. It exists for the buttons
13317
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13318
+ * an answer to the notification, and being thrown into a browser tab to
13319
+ * confirm it costs more attention than the notification did. A backend that
13320
+ * cannot do a background call renders it as an ordinary link (the adapters
13321
+ * fall back rather than dropping the button), so this is a preference, never
13322
+ * a requirement.
13323
+ */
13324
+ mode: _enum(["navigate", "background"]).optional()
13269
13325
  });
13270
13326
  /**
13271
13327
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -13433,6 +13489,24 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
13433
13489
  targetId: string(),
13434
13490
  enabled: boolean()
13435
13491
  }), _void(), { kind: "mutation" });
13492
+ new Set([
13493
+ {
13494
+ id: "person",
13495
+ name: "Person"
13496
+ },
13497
+ {
13498
+ id: "vehicle",
13499
+ name: "Vehicle"
13500
+ },
13501
+ {
13502
+ id: "animal",
13503
+ name: "Animal"
13504
+ },
13505
+ {
13506
+ id: "package",
13507
+ name: "Package"
13508
+ }
13509
+ ].map((l) => l.id));
13436
13510
  var COCO_TO_MACRO = {
13437
13511
  mapping: {
13438
13512
  person: "person",
@@ -14117,7 +14191,17 @@ var alarmPanelCapability = {
14117
14191
  * full slice; renders an arm button per `availableModes` entry and
14118
14192
  * a PIN field iff `requiresCode === true`.
14119
14193
  */
14120
- runtimeState: AlarmPanelStatusSchema
14194
+ runtimeState: AlarmPanelStatusSchema,
14195
+ /**
14196
+ * Runtime-state durability: **restored** — armed state is the one thing a panel must not lose across a restart.
14197
+ *
14198
+ * See `RuntimeStateDurability`. Enforced by
14199
+ * `scripts/check-runtime-state-durability.ts`.
14200
+ */
14201
+ durability: "restored",
14202
+ /** Clock fields: written, but excluded from the compare that decides
14203
+ * whether persisting is worth a SQLite commit. */
14204
+ volatileStateFields: ["lastChangedAt"]
14121
14205
  };
14122
14206
  /**
14123
14207
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
@@ -14258,6 +14342,8 @@ var NcSystemEventKindSchema = _enum([
14258
14342
  "alarm-triggered",
14259
14343
  "alarm-armed",
14260
14344
  "alarm-disarmed",
14345
+ "alarm-arming",
14346
+ "alarm-arm-refused",
14261
14347
  "camera-online",
14262
14348
  "camera-offline",
14263
14349
  "camera-disabled",
@@ -14294,6 +14380,9 @@ var NcSystemEventConditionSchema = object({
14294
14380
  nodeIds: array(string().min(1)).min(1).optional(),
14295
14381
  packageNames: array(string().min(1)).min(1).optional()
14296
14382
  });
14383
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14384
+ * outage the operator asked for once and forgot. */
14385
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14297
14386
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14298
14387
  var NcScheduleSchema = object({
14299
14388
  windows: array(object({
@@ -14670,15 +14759,15 @@ var NcConditionsSchema = object({
14670
14759
  * (an `immediate` rule naming an `audio-*` class, one notification per
14671
14760
  * classified sample) stays exactly as it was for rules that already use it.
14672
14761
  *
14673
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14674
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14675
- * (`camstack/src/data/notification-center.ts`, guarded by
14676
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14762
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14763
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14764
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14765
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14677
14766
  * condition fields it does not know when a rule is saved from the phone.
14678
14767
  * Publishing an editor for a condition the app cannot round-trip is how an
14679
- * operator loses a rule's conditions by opening it — so the descriptor, the
14680
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14681
- * does an audio rule become authorable.
14768
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14769
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14770
+ * follows here.
14682
14771
  */
14683
14772
  audio: NcAudioConditionSchema.optional()
14684
14773
  });
@@ -14914,6 +15003,30 @@ var NcRuleInputSchema = object({
14914
15003
  */
14915
15004
  snoozeAllowGlobal: boolean().optional(),
14916
15005
  /**
15006
+ * The snooze durations THIS rule's notification offers as buttons, in
15007
+ * minutes.
15008
+ *
15009
+ * Three states, and all three are distinct — which is exactly why this is
15010
+ * `.optional()` and never `.default()`. A Zod default does not run on the
15011
+ * addon cap path (three production failures in one day), so a schema default
15012
+ * would collapse the first two:
15013
+ *
15014
+ * | value | meaning |
15015
+ * | --- | --- |
15016
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
15017
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
15018
+ * | a list | these choices, de-duplicated and sorted, at most four |
15019
+ *
15020
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
15021
+ * three buttons in total) and a rule that spent it all on snooze choices
15022
+ * would push its own tap-through actions off the notification.
15023
+ *
15024
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
15025
+ * that arms the panel, is exempt automatically and cannot be silenced by a
15026
+ * window from anywhere (D133).
15027
+ */
15028
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
15029
+ /**
14917
15030
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14918
15031
  *
14919
15032
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -15013,6 +15126,7 @@ var NcConditionDescriptorSchema = object({
15013
15126
  "device",
15014
15127
  "package",
15015
15128
  "occupancy",
15129
+ "audio",
15016
15130
  "system"
15017
15131
  ]),
15018
15132
  label: string(),
@@ -15031,6 +15145,7 @@ var NcConditionDescriptorSchema = object({
15031
15145
  "crossingSelect",
15032
15146
  "polygonDraw",
15033
15147
  "occupancy",
15148
+ "audio",
15034
15149
  "deviceState",
15035
15150
  "systemEvent"
15036
15151
  ]),
@@ -15182,7 +15297,20 @@ var NcSnoozeInputSchema = object({
15182
15297
  ruleId: string().optional(),
15183
15298
  /** Required when `scope: 'device'`. */
15184
15299
  deviceId: number().int().optional(),
15185
- durationMinutes: number().int().min(1).max(1440),
15300
+ /**
15301
+ * Narrow the window to these subject classes — "the cat, not the person".
15302
+ *
15303
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15304
+ * what every window authored before this field meant, so no persisted row
15305
+ * changes meaning and no client has to learn anything to keep working.
15306
+ *
15307
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15308
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15309
+ * not at whichever of their four rules happened to produce the notification
15310
+ * they are dismissing.
15311
+ */
15312
+ classes: array(string().min(1)).min(1).optional(),
15313
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
15186
15314
  /**
15187
15315
  * Silence this for EVERY recipient, not just the caller. Permission is
15188
15316
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15207,6 +15335,10 @@ var NcSnoozeSchema = object({
15207
15335
  scope: NcSnoozeScopeSchema,
15208
15336
  ruleId: string().optional(),
15209
15337
  deviceId: number().int().optional(),
15338
+ /** Subject classes this window covers. ABSENT = every class — see
15339
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15340
+ * no SQLite column: nothing queries a window by class. */
15341
+ classes: array(string().min(1)).min(1).optional(),
15210
15342
  startedAt: number(),
15211
15343
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15212
15344
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -17307,7 +17439,14 @@ var zonesCapability = {
17307
17439
  * handle. Slice shape is `{ zones: Zone[] }` so future extensions
17308
17440
  * (e.g. zone groupings) can sit alongside the polygon list.
17309
17441
  */
17310
- runtimeState: object({ zones: array(ZoneSchema).readonly() })
17442
+ runtimeState: object({ zones: array(ZoneSchema).readonly() }),
17443
+ /**
17444
+ * 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.
17445
+ *
17446
+ * See `RuntimeStateDurability`. Enforced by
17447
+ * `scripts/check-runtime-state-durability.ts`.
17448
+ */
17449
+ durability: "restored"
17311
17450
  };
17312
17451
  /**
17313
17452
  * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
@@ -17477,6 +17616,22 @@ var detectionFpsField = {
17477
17616
  default: 10,
17478
17617
  step: 1
17479
17618
  };
17619
+ /**
17620
+ * The occupancy re-check interval. DEFAULT 300 s (2026-08-13 — was 30 s).
17621
+ *
17622
+ * The recheck is now on by default (a parked car is invisible to occupancy
17623
+ * rules until the stationary registry has been rebuilt by motion, which after a
17624
+ * restart may be never on a quiet camera). Each cycle re-subscribes a detection
17625
+ * session — an RTSP re-dial — so the switch is only affordable at a WIDE
17626
+ * interval: 300 s is ~12 re-dials an hour per camera, against 120 at the old
17627
+ * 30 s. A parked car is therefore counted within 5 minutes of a restart.
17628
+ *
17629
+ * Why not wider: `max` is 300 and raising it is TRAIN-BOUND, not addon-bound —
17630
+ * the host validates `attachCamera` against ITS copy of this schema, so a
17631
+ * runner asked for 600 would be rejected by the hub until a `@camstack/server`
17632
+ * carrying the wider bound is installed everywhere. 300 is the widest value
17633
+ * that ships with an addon deploy.
17634
+ */
17480
17635
  var occupancyRecheckSecField = {
17481
17636
  min: 0,
17482
17637
  max: 300,
@@ -17678,15 +17833,21 @@ var RunnerCameraConfigSchema = object({
17678
17833
  */
17679
17834
  onboardMotionDrivesAnalyzer: boolean().default(true),
17680
17835
  /**
17681
- * Master toggle for the occupancy re-check. When `false` (DEFAULT) the runner
17682
- * never arms the periodic recheck timer, regardless of `occupancyRecheckSec`
17683
- * this is off by default because the recheck re-subscribes a detection session
17684
- * every N seconds while `watching`, a major source of pull-decoder re-dial
17685
- * churn (each cycle creates+tears a session → RTSP re-dial → latency). The
17836
+ * Master toggle for the occupancy re-check. When `false` the runner never arms
17837
+ * the periodic recheck timer, regardless of `occupancyRecheckSec`; the
17686
17838
  * `occupancyRecheckSec` / `occupancyRecheckFrames` sliders only take effect
17687
17839
  * (and only render) when this is enabled.
17688
- */
17689
- occupancyRecheckEnabled: boolean().default(false),
17840
+ *
17841
+ * DEFAULT `true` since 2026-08-13 (was `false`). It was off because the
17842
+ * recheck re-subscribes a detection session every N seconds while `watching`
17843
+ * — each cycle creates+tears a session ⇒ an RTSP re-dial ⇒ latency, a major
17844
+ * pull-decoder churn source. What that bought was a blind spot: a STATIONARY
17845
+ * object is counted only while the stationary registry holds it, and the
17846
+ * registry rebuilds from motion, so after a restart a parked car was invisible
17847
+ * to every occupancy rule until something moved in front of it. The churn is
17848
+ * now paid on the interval instead — see `occupancyRecheckSecField`.
17849
+ */
17850
+ occupancyRecheckEnabled: boolean().default(true),
17690
17851
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
17691
17852
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
17692
17853
  /**
@@ -20201,7 +20362,17 @@ var airQualitySensorCapability = {
20201
20362
  schema: AirQualitySensorStatusSchema,
20202
20363
  kind: "push"
20203
20364
  },
20204
- runtimeState: AirQualitySensorStatusSchema
20365
+ runtimeState: AirQualitySensorStatusSchema,
20366
+ /**
20367
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20368
+ *
20369
+ * See `RuntimeStateDurability`. Enforced by
20370
+ * `scripts/check-runtime-state-durability.ts`.
20371
+ */
20372
+ durability: "restored",
20373
+ /** Clock fields: written, but excluded from the compare that decides
20374
+ * whether persisting is worth a SQLite commit. */
20375
+ volatileStateFields: ["lastFetchedAt"]
20205
20376
  };
20206
20377
  /**
20207
20378
  * Ambient illuminance reading in lux. Drives Home Assistant `sensor`
@@ -20233,7 +20404,17 @@ var ambientLightSensorCapability = {
20233
20404
  schema: AmbientLightSensorStatusSchema,
20234
20405
  kind: "push"
20235
20406
  },
20236
- runtimeState: AmbientLightSensorStatusSchema
20407
+ runtimeState: AmbientLightSensorStatusSchema,
20408
+ /**
20409
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20410
+ *
20411
+ * See `RuntimeStateDurability`. Enforced by
20412
+ * `scripts/check-runtime-state-durability.ts`.
20413
+ */
20414
+ durability: "restored",
20415
+ /** Clock fields: written, but excluded from the compare that decides
20416
+ * whether persisting is worth a SQLite commit. */
20417
+ volatileStateFields: ["lastFetchedAt"]
20237
20418
  };
20238
20419
  /**
20239
20420
  * Per-class audio metrics aggregated over a sliding window.
@@ -20351,7 +20532,14 @@ var audioMetricsCapability = {
20351
20532
  }), AudioMetricsHistorySchema)
20352
20533
  },
20353
20534
  /** Reactive runtime-state mirror — live `device.state.audioMetrics.value`. */
20354
- runtimeState: AudioMetricsSnapshotSchema
20535
+ runtimeState: AudioMetricsSnapshotSchema,
20536
+ /**
20537
+ * 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.
20538
+ *
20539
+ * See `RuntimeStateDurability`. Enforced by
20540
+ * `scripts/check-runtime-state-durability.ts`.
20541
+ */
20542
+ durability: "session"
20355
20543
  };
20356
20544
  /**
20357
20545
  * Automation-control cap. Models HA `automation.*` entities on
@@ -20413,7 +20601,14 @@ var automationControlCapability = {
20413
20601
  * reads `enabled` (toggle) + `isRunning` (spinner) + `lastError`
20414
20602
  * (badge) directly.
20415
20603
  */
20416
- runtimeState: AutomationControlStatusSchema
20604
+ runtimeState: AutomationControlStatusSchema,
20605
+ /**
20606
+ * 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.
20607
+ *
20608
+ * See `RuntimeStateDurability`. Enforced by
20609
+ * `scripts/check-runtime-state-durability.ts`.
20610
+ */
20611
+ durability: "session"
20417
20612
  };
20418
20613
  /**
20419
20614
  * Battery status snapshot. Emitted by providers whose device is
@@ -20519,7 +20714,17 @@ onStatusChanged: { data: object({
20519
20714
  * via `device.runtimeState.getCapState('battery')` regardless of
20520
20715
  * the underlying driver.
20521
20716
  */
20522
- runtimeState: BatteryStatusSchema
20717
+ runtimeState: BatteryStatusSchema,
20718
+ /**
20719
+ * 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.
20720
+ *
20721
+ * See `RuntimeStateDurability`. Enforced by
20722
+ * `scripts/check-runtime-state-durability.ts`.
20723
+ */
20724
+ durability: "restored",
20725
+ /** Clock fields: written, but excluded from the compare that decides
20726
+ * whether persisting is worth a SQLite commit. */
20727
+ volatileStateFields: ["lastUpdated"]
20523
20728
  };
20524
20729
  /**
20525
20730
  * Generic boolean sensor — last-resort fallback when no domain-
@@ -20548,7 +20753,17 @@ var binaryCapability = {
20548
20753
  schema: BinaryStatusSchema,
20549
20754
  kind: "push"
20550
20755
  },
20551
- runtimeState: BinaryStatusSchema
20756
+ runtimeState: BinaryStatusSchema,
20757
+ /**
20758
+ * Runtime-state durability: **restored** — transition-driven sensor state; the restored value gives the boot comparison.
20759
+ *
20760
+ * See `RuntimeStateDurability`. Enforced by
20761
+ * `scripts/check-runtime-state-durability.ts`.
20762
+ */
20763
+ durability: "restored",
20764
+ /** Clock fields: written, but excluded from the compare that decides
20765
+ * whether persisting is worth a SQLite commit. */
20766
+ volatileStateFields: ["lastChangedAt"]
20552
20767
  };
20553
20768
  /**
20554
20769
  * Dimmable-light brightness control. Co-exists with `switch` on the
@@ -20601,7 +20816,14 @@ onBrightnessChanged: { data: object({
20601
20816
  * by the kernel. Read via `device.state.brightness.value` so UI
20602
20817
  * sliders surface the current level without polling the provider.
20603
20818
  */
20604
- runtimeState: BrightnessStatusSchema
20819
+ runtimeState: BrightnessStatusSchema,
20820
+ /**
20821
+ * Runtime-state durability: **session** — live lamp state, re-published by the provider on connect.
20822
+ *
20823
+ * See `RuntimeStateDurability`. Enforced by
20824
+ * `scripts/check-runtime-state-durability.ts`.
20825
+ */
20826
+ durability: "session"
20605
20827
  };
20606
20828
  DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
20607
20829
  kind: "mutation",
@@ -20689,7 +20911,17 @@ var carbonMonoxideCapability = {
20689
20911
  schema: CarbonMonoxideStatusSchema,
20690
20912
  kind: "push"
20691
20913
  },
20692
- runtimeState: CarbonMonoxideStatusSchema
20914
+ runtimeState: CarbonMonoxideStatusSchema,
20915
+ /**
20916
+ * Runtime-state durability: **restored** — as `smoke`.
20917
+ *
20918
+ * See `RuntimeStateDurability`. Enforced by
20919
+ * `scripts/check-runtime-state-durability.ts`.
20920
+ */
20921
+ durability: "restored",
20922
+ /** Clock fields: written, but excluded from the compare that decides
20923
+ * whether persisting is worth a SQLite commit. */
20924
+ volatileStateFields: ["lastChangedAt"]
20693
20925
  };
20694
20926
  /**
20695
20927
  * HVAC / climate control cap. Models the full surface of a HA
@@ -20849,7 +21081,14 @@ var climateControlCapability = {
20849
21081
  * the full slice via `device.state.climate-control.value` and refresh
20850
21082
  * on every push without re-querying the provider.
20851
21083
  */
20852
- runtimeState: ClimateControlStatusSchema
21084
+ runtimeState: ClimateControlStatusSchema,
21085
+ /**
21086
+ * Runtime-state durability: **session** — as `brightness`; `currentTemp` moves continuously and is re-published on connect.
21087
+ *
21088
+ * See `RuntimeStateDurability`. Enforced by
21089
+ * `scripts/check-runtime-state-durability.ts`.
21090
+ */
21091
+ durability: "session"
20853
21092
  };
20854
21093
  /**
20855
21094
  * Color-light cap. Coexists with `switch` (on/off) and `brightness`
@@ -20959,7 +21198,14 @@ onColorChanged: { data: object({
20959
21198
  * kernel. Read via `device.state.color.value` so UI pickers surface
20960
21199
  * the current chromaticity without polling the provider.
20961
21200
  */
20962
- runtimeState: ColorStatusSchema
21201
+ runtimeState: ColorStatusSchema,
21202
+ /**
21203
+ * Runtime-state durability: **session** — as `brightness`.
21204
+ *
21205
+ * See `RuntimeStateDurability`. Enforced by
21206
+ * `scripts/check-runtime-state-durability.ts`.
21207
+ */
21208
+ durability: "session"
20963
21209
  };
20964
21210
  var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
20965
21211
  object({
@@ -21017,7 +21263,17 @@ var connectivityCapability = {
21017
21263
  schema: ConnectivityStatusSchema,
21018
21264
  kind: "push"
21019
21265
  },
21020
- runtimeState: ConnectivityStatusSchema
21266
+ runtimeState: ConnectivityStatusSchema,
21267
+ /**
21268
+ * Runtime-state durability: **restored** — same shape and same argument as `device-status`, for links rather than devices.
21269
+ *
21270
+ * See `RuntimeStateDurability`. Enforced by
21271
+ * `scripts/check-runtime-state-durability.ts`.
21272
+ */
21273
+ durability: "restored",
21274
+ /** Clock fields: written, but excluded from the compare that decides
21275
+ * whether persisting is worth a SQLite commit. */
21276
+ volatileStateFields: ["lastChangedAt"]
21021
21277
  };
21022
21278
  /**
21023
21279
  * Generic device-consumables capability — surfaces a device's
@@ -21099,7 +21355,14 @@ reset: method(object({
21099
21355
  }
21100
21356
  }
21101
21357
  },
21102
- runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() })
21358
+ runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() }),
21359
+ /**
21360
+ * Runtime-state durability: **session** — the authority is the appliance; the provider re-reads the whole item array on connect.
21361
+ *
21362
+ * See `RuntimeStateDurability`. Enforced by
21363
+ * `scripts/check-runtime-state-durability.ts`.
21364
+ */
21365
+ durability: "session"
21103
21366
  };
21104
21367
  /**
21105
21368
  * Door / window / opening / garage / valve contact sensor. Boolean
@@ -21130,7 +21393,17 @@ var contactCapability = {
21130
21393
  schema: ContactStatusSchema,
21131
21394
  kind: "push"
21132
21395
  },
21133
- runtimeState: ContactStatusSchema
21396
+ runtimeState: ContactStatusSchema,
21397
+ /**
21398
+ * Runtime-state durability: **restored** — a door left open across a restart must still read open.
21399
+ *
21400
+ * See `RuntimeStateDurability`. Enforced by
21401
+ * `scripts/check-runtime-state-durability.ts`.
21402
+ */
21403
+ durability: "restored",
21404
+ /** Clock fields: written, but excluded from the compare that decides
21405
+ * whether persisting is worth a SQLite commit. */
21406
+ volatileStateFields: ["lastChangedAt"]
21134
21407
  };
21135
21408
  /**
21136
21409
  * Status slice — flat object (the framework's `runtimeState` contract
@@ -21236,7 +21509,14 @@ var controlCapability = {
21236
21509
  * dropdown / text field / date picker) read the slice's discriminant
21237
21510
  * and value directly without polling the provider.
21238
21511
  */
21239
- runtimeState: ControlStatusSchema
21512
+ runtimeState: ControlStatusSchema,
21513
+ /**
21514
+ * Runtime-state durability: **session** — a generic control mirrors an external entity that re-publishes on connect; the options array is re-derived with it.
21515
+ *
21516
+ * See `RuntimeStateDurability`. Enforced by
21517
+ * `scripts/check-runtime-state-durability.ts`.
21518
+ */
21519
+ durability: "session"
21240
21520
  };
21241
21521
  var CoverStatusSchema = object({
21242
21522
  /** Lifecycle state of the cover. */
@@ -21297,7 +21577,17 @@ var coverCapability = {
21297
21577
  * Runtime-state slice — mirrored by the kernel. UI controls watch
21298
21578
  * the slice for live position changes during a move.
21299
21579
  */
21300
- runtimeState: CoverStatusSchema
21580
+ runtimeState: CoverStatusSchema,
21581
+ /**
21582
+ * Runtime-state durability: **restored** — position survives a restart on the device; the mirror should agree at boot rather than read blank.
21583
+ *
21584
+ * See `RuntimeStateDurability`. Enforced by
21585
+ * `scripts/check-runtime-state-durability.ts`.
21586
+ */
21587
+ durability: "restored",
21588
+ /** Clock fields: written, but excluded from the compare that decides
21589
+ * whether persisting is worth a SQLite commit. */
21590
+ volatileStateFields: ["lastChangedAt"]
21301
21591
  };
21302
21592
  /**
21303
21593
  * Vendor-neutral day/night (IR-cut) control — the per-camera config cap
@@ -21391,7 +21681,17 @@ var dayNightCapability = {
21391
21681
  schema: DayNightStatusSchema,
21392
21682
  kind: "poll"
21393
21683
  },
21394
- runtimeState: DayNightStatusSchema
21684
+ runtimeState: DayNightStatusSchema,
21685
+ /**
21686
+ * Runtime-state durability: **restored** — operator-set IR-cut behaviour; mutation-driven.
21687
+ *
21688
+ * See `RuntimeStateDurability`. Enforced by
21689
+ * `scripts/check-runtime-state-durability.ts`.
21690
+ */
21691
+ durability: "restored",
21692
+ /** Clock fields: written, but excluded from the compare that decides
21693
+ * whether persisting is worth a SQLite commit. */
21694
+ volatileStateFields: ["lastFetchedAt"]
21395
21695
  };
21396
21696
  /**
21397
21697
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
@@ -21438,7 +21738,17 @@ onStatusChanged: { data: object({
21438
21738
  schema: DeviceStatusSchema,
21439
21739
  kind: "push"
21440
21740
  },
21441
- runtimeState: DeviceStatusSchema
21741
+ runtimeState: DeviceStatusSchema,
21742
+ /**
21743
+ * 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.
21744
+ *
21745
+ * See `RuntimeStateDurability`. Enforced by
21746
+ * `scripts/check-runtime-state-durability.ts`.
21747
+ */
21748
+ durability: "restored",
21749
+ /** Clock fields: written, but excluded from the compare that decides
21750
+ * whether persisting is worth a SQLite commit. */
21751
+ volatileStateFields: ["lastChangedAt"]
21442
21752
  };
21443
21753
  /**
21444
21754
  * Doorbell button cap. Two kinds of providers coexist behind this cap
@@ -21500,7 +21810,14 @@ onPressed: { data: DoorbellPressEventSchema } },
21500
21810
  * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
21501
21811
  * without subscribing.
21502
21812
  */
21503
- runtimeState: DoorbellStatusSchema
21813
+ runtimeState: DoorbellStatusSchema,
21814
+ /**
21815
+ * 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.
21816
+ *
21817
+ * See `RuntimeStateDurability`. Enforced by
21818
+ * `scripts/check-runtime-state-durability.ts`.
21819
+ */
21820
+ durability: "restored"
21504
21821
  };
21505
21822
  /**
21506
21823
  * Enum-state sensor — a string value picked from a finite option set.
@@ -21540,7 +21857,17 @@ var enumSensorCapability = {
21540
21857
  schema: EnumSensorStatusSchema,
21541
21858
  kind: "push"
21542
21859
  },
21543
- runtimeState: EnumSensorStatusSchema
21860
+ runtimeState: EnumSensorStatusSchema,
21861
+ /**
21862
+ * Runtime-state durability: **restored** — as `numeric-sensor`; 80 devices.
21863
+ *
21864
+ * See `RuntimeStateDurability`. Enforced by
21865
+ * `scripts/check-runtime-state-durability.ts`.
21866
+ */
21867
+ durability: "restored",
21868
+ /** Clock fields: written, but excluded from the compare that decides
21869
+ * whether persisting is worth a SQLite commit. */
21870
+ volatileStateFields: ["lastFetchedAt"]
21544
21871
  };
21545
21872
  /**
21546
21873
  * Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
@@ -21576,7 +21903,14 @@ var eventEmitterCapability = {
21576
21903
  schema: EventEmitterStatusSchema,
21577
21904
  kind: "push"
21578
21905
  },
21579
- runtimeState: EventEmitterStatusSchema
21906
+ runtimeState: EventEmitterStatusSchema,
21907
+ /**
21908
+ * Runtime-state durability: **session** — `eventCountSinceStart` names its own scope.
21909
+ *
21910
+ * See `RuntimeStateDurability`. Enforced by
21911
+ * `scripts/check-runtime-state-durability.ts`.
21912
+ */
21913
+ durability: "session"
21580
21914
  };
21581
21915
  var EventItemSchema = object({
21582
21916
  id: string(),
@@ -21857,7 +22191,14 @@ var fanControlCapability = {
21857
22191
  * Runtime-state slice — mirrored by the kernel. UI fan speed
21858
22192
  * sliders read `percentage` for live updates.
21859
22193
  */
21860
- runtimeState: FanControlStatusSchema
22194
+ runtimeState: FanControlStatusSchema,
22195
+ /**
22196
+ * Runtime-state durability: **session** — as `brightness`.
22197
+ *
22198
+ * See `RuntimeStateDurability`. Enforced by
22199
+ * `scripts/check-runtime-state-durability.ts`.
22200
+ */
22201
+ durability: "session"
21861
22202
  };
21862
22203
  /**
21863
22204
  * Per-device feature/identity probe slice. Holds the runtime-resolved
@@ -21933,7 +22274,14 @@ onProbeChanged: { data: object({
21933
22274
  schema: FeatureProbeStatusSchema,
21934
22275
  kind: "push"
21935
22276
  },
21936
- runtimeState: FeatureProbeStatusSchema
22277
+ runtimeState: FeatureProbeStatusSchema,
22278
+ /**
22279
+ * 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.
22280
+ *
22281
+ * See `RuntimeStateDurability`. Enforced by
22282
+ * `scripts/check-runtime-state-durability.ts`.
22283
+ */
22284
+ durability: "session"
21937
22285
  };
21938
22286
  /**
21939
22287
  * Water leak / moisture sensor. Boolean "is liquid currently
@@ -21960,7 +22308,17 @@ var floodCapability = {
21960
22308
  schema: FloodStatusSchema,
21961
22309
  kind: "push"
21962
22310
  },
21963
- runtimeState: FloodStatusSchema
22311
+ runtimeState: FloodStatusSchema,
22312
+ /**
22313
+ * Runtime-state durability: **restored** — as `smoke`.
22314
+ *
22315
+ * See `RuntimeStateDurability`. Enforced by
22316
+ * `scripts/check-runtime-state-durability.ts`.
22317
+ */
22318
+ durability: "restored",
22319
+ /** Clock fields: written, but excluded from the compare that decides
22320
+ * whether persisting is worth a SQLite commit. */
22321
+ volatileStateFields: ["lastChangedAt"]
21964
22322
  };
21965
22323
  /**
21966
22324
  * Combustible-gas (LPG / methane / hydrogen) alarm sensor. Drives
@@ -21983,7 +22341,17 @@ var gasCapability = {
21983
22341
  schema: GasStatusSchema,
21984
22342
  kind: "push"
21985
22343
  },
21986
- runtimeState: GasStatusSchema
22344
+ runtimeState: GasStatusSchema,
22345
+ /**
22346
+ * Runtime-state durability: **restored** — as `smoke`.
22347
+ *
22348
+ * See `RuntimeStateDurability`. Enforced by
22349
+ * `scripts/check-runtime-state-durability.ts`.
22350
+ */
22351
+ durability: "restored",
22352
+ /** Clock fields: written, but excluded from the compare that decides
22353
+ * whether persisting is worth a SQLite commit. */
22354
+ volatileStateFields: ["lastChangedAt"]
21987
22355
  };
21988
22356
  /**
21989
22357
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
@@ -22059,7 +22427,14 @@ var humidifierCapability = {
22059
22427
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22060
22428
  * slice for live humidity / mode changes.
22061
22429
  */
22062
- runtimeState: HumidifierStatusSchema
22430
+ runtimeState: HumidifierStatusSchema,
22431
+ /**
22432
+ * Runtime-state durability: **session** — as `climate-control`.
22433
+ *
22434
+ * See `RuntimeStateDurability`. Enforced by
22435
+ * `scripts/check-runtime-state-durability.ts`.
22436
+ */
22437
+ durability: "session"
22063
22438
  };
22064
22439
  /**
22065
22440
  * Single-metric humidity reading. Drives Home Assistant `sensor`
@@ -22095,7 +22470,17 @@ var humiditySensorCapability = {
22095
22470
  schema: HumiditySensorStatusSchema,
22096
22471
  kind: "push"
22097
22472
  },
22098
- runtimeState: HumiditySensorStatusSchema
22473
+ runtimeState: HumiditySensorStatusSchema,
22474
+ /**
22475
+ * Runtime-state durability: **restored** — as `numeric-sensor` (67 of 75 writes were the clock alone).
22476
+ *
22477
+ * See `RuntimeStateDurability`. Enforced by
22478
+ * `scripts/check-runtime-state-durability.ts`.
22479
+ */
22480
+ durability: "restored",
22481
+ /** Clock fields: written, but excluded from the compare that decides
22482
+ * whether persisting is worth a SQLite commit. */
22483
+ volatileStateFields: ["lastFetchedAt"]
22099
22484
  };
22100
22485
  /**
22101
22486
  * Image display cap. Models a single still image exposed by an integration —
@@ -22133,7 +22518,14 @@ var imageCapability = {
22133
22518
  * Runtime-state slice — mirrored by the kernel. The UI reads `url`
22134
22519
  * directly and renders the still image.
22135
22520
  */
22136
- runtimeState: ImageStatusSchema
22521
+ runtimeState: ImageStatusSchema,
22522
+ /**
22523
+ * Runtime-state durability: **session** — a snapshot URL is a session-scoped handle; a restored one points at nothing.
22524
+ *
22525
+ * See `RuntimeStateDurability`. Enforced by
22526
+ * `scripts/check-runtime-state-durability.ts`.
22527
+ */
22528
+ durability: "session"
22137
22529
  };
22138
22530
  /**
22139
22531
  * Vendor-neutral image / picture-adjustment cap — the per-camera config
@@ -22282,7 +22674,17 @@ var imageSettingsCapability = {
22282
22674
  schema: ImageSettingsStatusSchema,
22283
22675
  kind: "poll"
22284
22676
  },
22285
- runtimeState: ImageSettingsStatusSchema
22677
+ runtimeState: ImageSettingsStatusSchema,
22678
+ /**
22679
+ * Runtime-state durability: **restored** — operator-set camera imaging; mutation-driven.
22680
+ *
22681
+ * See `RuntimeStateDurability`. Enforced by
22682
+ * `scripts/check-runtime-state-durability.ts`.
22683
+ */
22684
+ durability: "restored",
22685
+ /** Clock fields: written, but excluded from the compare that decides
22686
+ * whether persisting is worth a SQLite commit. */
22687
+ volatileStateFields: ["lastFetchedAt"]
22286
22688
  };
22287
22689
  /**
22288
22690
  * integrations — system-scoped singleton capability for integration
@@ -22673,7 +23075,14 @@ var lawnMowerControlCapability = {
22673
23075
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22674
23076
  * slice for live activity + battery changes.
22675
23077
  */
22676
- runtimeState: LawnMowerControlStatusSchema
23078
+ runtimeState: LawnMowerControlStatusSchema,
23079
+ /**
23080
+ * Runtime-state durability: **session** — as `vacuum-control`.
23081
+ *
23082
+ * See `RuntimeStateDurability`. Enforced by
23083
+ * `scripts/check-runtime-state-durability.ts`.
23084
+ */
23085
+ durability: "session"
22677
23086
  };
22678
23087
  /**
22679
23088
  * local-network — hub-only singleton.
@@ -22879,7 +23288,17 @@ var lockControlCapability = {
22879
23288
  * read `state` and disable themselves during `locking`/`unlocking`
22880
23289
  * transitions.
22881
23290
  */
22882
- runtimeState: LockControlStatusSchema
23291
+ runtimeState: LockControlStatusSchema,
23292
+ /**
23293
+ * Runtime-state durability: **restored** — a lock left locked must still read locked.
23294
+ *
23295
+ * See `RuntimeStateDurability`. Enforced by
23296
+ * `scripts/check-runtime-state-durability.ts`.
23297
+ */
23298
+ durability: "restored",
23299
+ /** Clock fields: written, but excluded from the compare that decides
23300
+ * whether persisting is worth a SQLite commit. */
23301
+ volatileStateFields: ["lastChangedAt"]
22883
23302
  };
22884
23303
  /**
22885
23304
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
@@ -23041,7 +23460,14 @@ var mediaPlayerCapability = {
23041
23460
  * full slice for live now-playing, volume, and progress updates
23042
23461
  * without polling.
23043
23462
  */
23044
- runtimeState: MediaPlayerStatusSchema
23463
+ runtimeState: MediaPlayerStatusSchema,
23464
+ /**
23465
+ * Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
23466
+ *
23467
+ * See `RuntimeStateDurability`. Enforced by
23468
+ * `scripts/check-runtime-state-durability.ts`.
23469
+ */
23470
+ durability: "session"
23045
23471
  };
23046
23472
  /**
23047
23473
  * mesh-network — collection cap for mesh-VPN providers.
@@ -23305,7 +23731,14 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
23305
23731
  * `device.state.motion.value`. Reads never invoke the provider, so
23306
23732
  * UIs and other addons can poll the cached state safely.
23307
23733
  */
23308
- runtimeState: MotionStatusSchema
23734
+ runtimeState: MotionStatusSchema,
23735
+ /**
23736
+ * 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.
23737
+ *
23738
+ * See `RuntimeStateDurability`. Enforced by
23739
+ * `scripts/check-runtime-state-durability.ts`.
23740
+ */
23741
+ durability: "session"
23309
23742
  };
23310
23743
  /**
23311
23744
  * Motion-trigger toggle for accessory devices.
@@ -23370,7 +23803,14 @@ var motionTriggerCapability = {
23370
23803
  schema: MotionTriggerStatusSchema,
23371
23804
  kind: "command-driven"
23372
23805
  },
23373
- runtimeState: MotionTriggerRuntimeStateSchema
23806
+ runtimeState: MotionTriggerRuntimeStateSchema,
23807
+ /**
23808
+ * 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.
23809
+ *
23810
+ * See `RuntimeStateDurability`. Enforced by
23811
+ * `scripts/check-runtime-state-durability.ts`.
23812
+ */
23813
+ durability: "session"
23374
23814
  };
23375
23815
  /**
23376
23816
  * Motion-zones share the same MaskShape vocabulary as privacy-mask — the
@@ -23437,7 +23877,17 @@ var motionZonesCapability = {
23437
23877
  schema: MotionZoneStatusSchema,
23438
23878
  kind: "poll"
23439
23879
  },
23440
- runtimeState: MotionZoneStatusSchema
23880
+ runtimeState: MotionZoneStatusSchema,
23881
+ /**
23882
+ * 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.
23883
+ *
23884
+ * See `RuntimeStateDurability`. Enforced by
23885
+ * `scripts/check-runtime-state-durability.ts`.
23886
+ */
23887
+ durability: "restored",
23888
+ /** Clock fields: written, but excluded from the compare that decides
23889
+ * whether persisting is worth a SQLite commit. */
23890
+ volatileStateFields: ["lastFetchedAt"]
23441
23891
  };
23442
23892
  /**
23443
23893
  * On-camera AI object detection cap. Surfaces per-device the classes
@@ -23511,7 +23961,17 @@ var nativeObjectDetectionCapability = {
23511
23961
  schema: NativeObjectDetectionStatusSchema,
23512
23962
  kind: "push"
23513
23963
  },
23514
- runtimeState: NativeObjectDetectionRuntimeStateSchema
23964
+ runtimeState: NativeObjectDetectionRuntimeStateSchema,
23965
+ /**
23966
+ * 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.
23967
+ *
23968
+ * See `RuntimeStateDurability`. Enforced by
23969
+ * `scripts/check-runtime-state-durability.ts`.
23970
+ */
23971
+ durability: "restored",
23972
+ /** Clock fields: written, but excluded from the compare that decides
23973
+ * whether persisting is worth a SQLite commit. */
23974
+ volatileStateFields: ["lastFetchedAt"]
23515
23975
  };
23516
23976
  /**
23517
23977
  * network-quality — system-scoped singleton capability tracking RTT,
@@ -23845,7 +24305,14 @@ onSent: { data: object({
23845
24305
  * form reads `supports` to gate optional fields; history pane reads
23846
24306
  * `lastSentAt` / `lastError` / `queueDepth`.
23847
24307
  */
23848
- runtimeState: NotifierStatusSchema
24308
+ runtimeState: NotifierStatusSchema,
24309
+ /**
24310
+ * Runtime-state durability: **session** — live queue depth and last-send state; a restored queue depth describes a queue that no longer exists.
24311
+ *
24312
+ * See `RuntimeStateDurability`. Enforced by
24313
+ * `scripts/check-runtime-state-durability.ts`.
24314
+ */
24315
+ durability: "session"
23849
24316
  };
23850
24317
  /**
23851
24318
  * Generic numeric sensor — last-resort fallback when no typed numeric
@@ -23888,7 +24355,17 @@ var numericSensorCapability = {
23888
24355
  schema: NumericSensorStatusSchema,
23889
24356
  kind: "push"
23890
24357
  },
23891
- runtimeState: NumericSensorStatusSchema
24358
+ runtimeState: NumericSensorStatusSchema,
24359
+ /**
24360
+ * 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.
24361
+ *
24362
+ * See `RuntimeStateDurability`. Enforced by
24363
+ * `scripts/check-runtime-state-durability.ts`.
24364
+ */
24365
+ durability: "restored",
24366
+ /** Clock fields: written, but excluded from the compare that decides
24367
+ * whether persisting is worth a SQLite commit. */
24368
+ volatileStateFields: ["lastFetchedAt"]
23892
24369
  };
23893
24370
  /**
23894
24371
  * Generic on-screen-display (video overlay) cap. Each camera exposes
@@ -24273,7 +24750,14 @@ var petFeederCapability = {
24273
24750
  * the full slice via `device.state.petFeeder.value` and refresh on
24274
24751
  * every poll without re-querying the provider.
24275
24752
  */
24276
- runtimeState: PetFeederStatusSchema
24753
+ runtimeState: PetFeederStatusSchema,
24754
+ /**
24755
+ * Runtime-state durability: **session** — live appliance state re-published on connect.
24756
+ *
24757
+ * See `RuntimeStateDurability`. Enforced by
24758
+ * `scripts/check-runtime-state-durability.ts`.
24759
+ */
24760
+ durability: "session"
24277
24761
  };
24278
24762
  var VehicleSchema = object({
24279
24763
  id: string(),
@@ -24585,7 +25069,17 @@ var powerMeterCapability = {
24585
25069
  schema: PowerMeterStatusSchema,
24586
25070
  kind: "push"
24587
25071
  },
24588
- runtimeState: PowerMeterStatusSchema
25072
+ runtimeState: PowerMeterStatusSchema,
25073
+ /**
25074
+ * Runtime-state durability: **restored** — as `numeric-sensor`; `kwhTotal` is an accumulator whose restored value is the baseline.
25075
+ *
25076
+ * See `RuntimeStateDurability`. Enforced by
25077
+ * `scripts/check-runtime-state-durability.ts`.
25078
+ */
25079
+ durability: "restored",
25080
+ /** Clock fields: written, but excluded from the compare that decides
25081
+ * whether persisting is worth a SQLite commit. */
25082
+ volatileStateFields: ["lastFetchedAt"]
24589
25083
  };
24590
25084
  /**
24591
25085
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -24642,7 +25136,17 @@ var presenceCapability = {
24642
25136
  * the map pin is rendered (use `DeviceFeature.PresenceGps` for the
24643
25137
  * pre-fetch fast-path check).
24644
25138
  */
24645
- runtimeState: PresenceStatusSchema
25139
+ runtimeState: PresenceStatusSchema,
25140
+ /**
25141
+ * Runtime-state durability: **restored** — occupancy-relevant: the restored state is what an occupancy rule compares the first post-restart observation against.
25142
+ *
25143
+ * See `RuntimeStateDurability`. Enforced by
25144
+ * `scripts/check-runtime-state-durability.ts`.
25145
+ */
25146
+ durability: "restored",
25147
+ /** Clock fields: written, but excluded from the compare that decides
25148
+ * whether persisting is worth a SQLite commit. */
25149
+ volatileStateFields: ["lastChangedAt"]
24646
25150
  };
24647
25151
  /**
24648
25152
  * Atmospheric pressure reading in hectopascals. Drives Home Assistant
@@ -24678,7 +25182,17 @@ var pressureSensorCapability = {
24678
25182
  schema: PressureSensorStatusSchema,
24679
25183
  kind: "push"
24680
25184
  },
24681
- runtimeState: PressureSensorStatusSchema
25185
+ runtimeState: PressureSensorStatusSchema,
25186
+ /**
25187
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
25188
+ *
25189
+ * See `RuntimeStateDurability`. Enforced by
25190
+ * `scripts/check-runtime-state-durability.ts`.
25191
+ */
25192
+ durability: "restored",
25193
+ /** Clock fields: written, but excluded from the compare that decides
25194
+ * whether persisting is worth a SQLite commit. */
25195
+ volatileStateFields: ["lastFetchedAt"]
24682
25196
  };
24683
25197
  /**
24684
25198
  * PRIVACY — what the camera deliberately does not capture. Two planes:
@@ -24808,7 +25322,17 @@ var privacyMaskCapability = {
24808
25322
  schema: PrivacyMaskStatusSchema,
24809
25323
  kind: "poll"
24810
25324
  },
24811
- runtimeState: PrivacyMaskStatusSchema
25325
+ runtimeState: PrivacyMaskStatusSchema,
25326
+ /**
25327
+ * Runtime-state durability: **restored** — operator-drawn regions, zero real churn — 22 writes in 25 minutes, every one of them the clock.
25328
+ *
25329
+ * See `RuntimeStateDurability`. Enforced by
25330
+ * `scripts/check-runtime-state-durability.ts`.
25331
+ */
25332
+ durability: "restored",
25333
+ /** Clock fields: written, but excluded from the compare that decides
25334
+ * whether persisting is worth a SQLite commit. */
25335
+ volatileStateFields: ["lastFetchedAt"]
24812
25336
  };
24813
25337
  var PtzPresetSchema = object({
24814
25338
  id: string(),
@@ -24974,7 +25498,14 @@ var ptzAutotrackCapability = {
24974
25498
  * fetch / cache / fallback logic out of the four cap methods —
24975
25499
  * they become trampolines over `runtimeState`.
24976
25500
  */
24977
- runtimeState: PtzAutotrackRuntimeStateSchema
25501
+ runtimeState: PtzAutotrackRuntimeStateSchema,
25502
+ /**
25503
+ * Runtime-state durability: **session** — mirrors the camera's own autotrack config, re-read on connect.
25504
+ *
25505
+ * See `RuntimeStateDurability`. Enforced by
25506
+ * `scripts/check-runtime-state-durability.ts`.
25507
+ */
25508
+ durability: "session"
24978
25509
  };
24979
25510
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
24980
25511
  kind: "mutation",
@@ -25624,7 +26155,14 @@ var sceneMonitorCapability = {
25624
26155
  schema: SceneMonitorStatusSchema,
25625
26156
  kind: "push"
25626
26157
  },
25627
- runtimeState: SceneMonitorStatusSchema
26158
+ runtimeState: SceneMonitorStatusSchema,
26159
+ /**
26160
+ * Runtime-state durability: **session** — re-derived from the current scene on the next evaluation.
26161
+ *
26162
+ * See `RuntimeStateDurability`. Enforced by
26163
+ * `scripts/check-runtime-state-durability.ts`.
26164
+ */
26165
+ durability: "session"
25628
26166
  };
25629
26167
  /**
25630
26168
  * Per-stage gating mode applied to the zones a rule references.
@@ -25768,7 +26306,14 @@ var scriptRunnerCapability = {
25768
26306
  * `isRunning` to render a spinner during execution and surfaces
25769
26307
  * `lastError` / `lastRunSuccess` in the recent-runs panel.
25770
26308
  */
25771
- runtimeState: ScriptRunnerStatusSchema
26309
+ runtimeState: ScriptRunnerStatusSchema,
26310
+ /**
26311
+ * Runtime-state durability: **session** — a restored `isRunning: true` describes a process that died with the previous hub.
26312
+ *
26313
+ * See `RuntimeStateDurability`. Enforced by
26314
+ * `scripts/check-runtime-state-durability.ts`.
26315
+ */
26316
+ durability: "session"
25772
26317
  };
25773
26318
  /**
25774
26319
  * Smoke alarm sensor — boolean "is smoke currently detected" with
@@ -25795,7 +26340,17 @@ var smokeCapability = {
25795
26340
  schema: SmokeStatusSchema,
25796
26341
  kind: "push"
25797
26342
  },
25798
- runtimeState: SmokeStatusSchema
26343
+ runtimeState: SmokeStatusSchema,
26344
+ /**
26345
+ * Runtime-state durability: **restored** — a safety sensor must not read "clear" merely because the hub restarted.
26346
+ *
26347
+ * See `RuntimeStateDurability`. Enforced by
26348
+ * `scripts/check-runtime-state-durability.ts`.
26349
+ */
26350
+ durability: "restored",
26351
+ /** Clock fields: written, but excluded from the compare that decides
26352
+ * whether persisting is worth a SQLite commit. */
26353
+ volatileStateFields: ["lastChangedAt"]
25799
26354
  };
25800
26355
  /**
25801
26356
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -25981,7 +26536,17 @@ var streamParamsCapability = {
25981
26536
  schema: StreamParamsStatusSchema,
25982
26537
  kind: "poll"
25983
26538
  },
25984
- runtimeState: StreamParamsStatusSchema
26539
+ runtimeState: StreamParamsStatusSchema,
26540
+ /**
26541
+ * Runtime-state durability: **restored** — operator-set encoder profile; mutation-driven.
26542
+ *
26543
+ * See `RuntimeStateDurability`. Enforced by
26544
+ * `scripts/check-runtime-state-durability.ts`.
26545
+ */
26546
+ durability: "restored",
26547
+ /** Clock fields: written, but excluded from the compare that decides
26548
+ * whether persisting is worth a SQLite commit. */
26549
+ volatileStateFields: ["lastFetchedAt"]
25985
26550
  };
25986
26551
  /**
25987
26552
  * Generic on/off switch cap for accessory children (siren, floodlight,
@@ -26027,6 +26592,16 @@ var switchCapability = {
26027
26592
  * not need to re-query the provider after a setState mutation.
26028
26593
  */
26029
26594
  runtimeState: SwitchStatusSchema,
26595
+ /**
26596
+ * Runtime-state durability: **restored** — device state an operator reads as authoritative; 55 devices, transition-driven.
26597
+ *
26598
+ * See `RuntimeStateDurability`. Enforced by
26599
+ * `scripts/check-runtime-state-durability.ts`.
26600
+ */
26601
+ durability: "restored",
26602
+ /** Clock fields: written, but excluded from the compare that decides
26603
+ * whether persisting is worth a SQLite commit. */
26604
+ volatileStateFields: ["lastChangedAt"],
26030
26605
  settings: { bindings: [{
26031
26606
  kind: "scalar",
26032
26607
  statusPath: "on",
@@ -26106,7 +26681,17 @@ var tamperCapability = {
26106
26681
  schema: TamperStatusSchema,
26107
26682
  kind: "push"
26108
26683
  },
26109
- runtimeState: TamperStatusSchema
26684
+ runtimeState: TamperStatusSchema,
26685
+ /**
26686
+ * Runtime-state durability: **restored** — as `smoke`.
26687
+ *
26688
+ * See `RuntimeStateDurability`. Enforced by
26689
+ * `scripts/check-runtime-state-durability.ts`.
26690
+ */
26691
+ durability: "restored",
26692
+ /** Clock fields: written, but excluded from the compare that decides
26693
+ * whether persisting is worth a SQLite commit. */
26694
+ volatileStateFields: ["lastChangedAt"]
26110
26695
  };
26111
26696
  /**
26112
26697
  * Single-metric temperature reading. Drives Home Assistant `sensor`
@@ -26151,7 +26736,17 @@ var temperatureSensorCapability = {
26151
26736
  schema: TemperatureSensorStatusSchema,
26152
26737
  kind: "push"
26153
26738
  },
26154
- runtimeState: TemperatureSensorStatusSchema
26739
+ runtimeState: TemperatureSensorStatusSchema,
26740
+ /**
26741
+ * Runtime-state durability: **restored** — as `numeric-sensor` (69 of 125 writes were the clock alone).
26742
+ *
26743
+ * See `RuntimeStateDurability`. Enforced by
26744
+ * `scripts/check-runtime-state-durability.ts`.
26745
+ */
26746
+ durability: "restored",
26747
+ /** Clock fields: written, but excluded from the compare that decides
26748
+ * whether persisting is worth a SQLite commit. */
26749
+ volatileStateFields: ["lastFetchedAt"]
26155
26750
  };
26156
26751
  /**
26157
26752
  * toast — system-scoped singleton capability that streams toast
@@ -26220,7 +26815,14 @@ var updateCapability = {
26220
26815
  schema: UpdateStatusSchema,
26221
26816
  kind: "poll"
26222
26817
  },
26223
- runtimeState: UpdateStatusSchema
26818
+ runtimeState: UpdateStatusSchema,
26819
+ /**
26820
+ * Runtime-state durability: **session** — a restored `inProgress: true` describes an update that is no longer running; versions are re-probed at boot.
26821
+ *
26822
+ * See `RuntimeStateDurability`. Enforced by
26823
+ * `scripts/check-runtime-state-durability.ts`.
26824
+ */
26825
+ durability: "session"
26224
26826
  };
26225
26827
  var UserSummarySchema = object({
26226
26828
  id: string(),
@@ -26554,7 +27156,14 @@ var vacuumControlCapability = {
26554
27156
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26555
27157
  * slice for live state + battery + fan-speed changes.
26556
27158
  */
26557
- runtimeState: VacuumControlStatusSchema
27159
+ runtimeState: VacuumControlStatusSchema,
27160
+ /**
27161
+ * Runtime-state durability: **session** — as `media-player` — a restored `state: cleaning` is a robot that is not cleaning.
27162
+ *
27163
+ * See `RuntimeStateDurability`. Enforced by
27164
+ * `scripts/check-runtime-state-durability.ts`.
27165
+ */
27166
+ durability: "session"
26558
27167
  };
26559
27168
  var ValveStatusSchema = object({
26560
27169
  /** Lifecycle state of the valve. */
@@ -26606,7 +27215,14 @@ var valveCapability = {
26606
27215
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26607
27216
  * slice for live position changes during a move.
26608
27217
  */
26609
- runtimeState: ValveStatusSchema
27218
+ runtimeState: ValveStatusSchema,
27219
+ /**
27220
+ * Runtime-state durability: **session** — as `brightness`.
27221
+ *
27222
+ * See `RuntimeStateDurability`. Enforced by
27223
+ * `scripts/check-runtime-state-durability.ts`.
27224
+ */
27225
+ durability: "session"
26610
27226
  };
26611
27227
  /**
26612
27228
  * Vibration / shake / impact sensor. Drives Home Assistant
@@ -26628,7 +27244,17 @@ var vibrationCapability = {
26628
27244
  schema: VibrationStatusSchema,
26629
27245
  kind: "push"
26630
27246
  },
26631
- runtimeState: VibrationStatusSchema
27247
+ runtimeState: VibrationStatusSchema,
27248
+ /**
27249
+ * Runtime-state durability: **restored** — as `smoke`.
27250
+ *
27251
+ * See `RuntimeStateDurability`. Enforced by
27252
+ * `scripts/check-runtime-state-durability.ts`.
27253
+ */
27254
+ durability: "restored",
27255
+ /** Clock fields: written, but excluded from the compare that decides
27256
+ * whether persisting is worth a SQLite commit. */
27257
+ volatileStateFields: ["lastChangedAt"]
26632
27258
  };
26633
27259
  /**
26634
27260
  * Water heater / boiler cap. Models HA `water_heater.*` entities — a
@@ -26702,7 +27328,14 @@ var waterHeaterCapability = {
26702
27328
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26703
27329
  * slice for live temperature / mode / away changes.
26704
27330
  */
26705
- runtimeState: WaterHeaterStatusSchema
27331
+ runtimeState: WaterHeaterStatusSchema,
27332
+ /**
27333
+ * Runtime-state durability: **session** — as `climate-control`.
27334
+ *
27335
+ * See `RuntimeStateDurability`. Enforced by
27336
+ * `scripts/check-runtime-state-durability.ts`.
27337
+ */
27338
+ durability: "session"
26706
27339
  };
26707
27340
  /**
26708
27341
  * Weather provider cap. Models HA `weather.*` entities — a read-only
@@ -26761,7 +27394,14 @@ var weatherCapability = {
26761
27394
  * Runtime-state slice — mirrored by the kernel. The UI reads the
26762
27395
  * current conditions directly from the slice on each weather push.
26763
27396
  */
26764
- runtimeState: WeatherStatusSchema
27397
+ runtimeState: WeatherStatusSchema,
27398
+ /**
27399
+ * Runtime-state durability: **session** — a forecast is stale the moment the hub is down; the provider re-fetches on connect.
27400
+ *
27401
+ * See `RuntimeStateDurability`. Enforced by
27402
+ * `scripts/check-runtime-state-durability.ts`.
27403
+ */
27404
+ durability: "session"
26765
27405
  };
26766
27406
  /**
26767
27407
  * Per-zone occupancy aggregation produced by the analytics frame
@@ -26923,7 +27563,14 @@ var zoneAnalyticsCapability = {
26923
27563
  * automatically; the explicit `getCurrentSnapshot` cap method is
26924
27564
  * still useful for one-off polls without a subscription.
26925
27565
  */
26926
- runtimeState: CameraOccupancySnapshotSchema
27566
+ runtimeState: CameraOccupancySnapshotSchema,
27567
+ /**
27568
+ * Runtime-state durability: **session** — per-frame analytics; with `audio-metrics` it is ~90 % of the offered write rate. Re-derived on the next frame.
27569
+ *
27570
+ * See `RuntimeStateDurability`. Enforced by
27571
+ * `scripts/check-runtime-state-durability.ts`.
27572
+ */
27573
+ durability: "session"
26927
27574
  };
26928
27575
  /**
26929
27576
  * Stages a {@link ZoneRule} can apply to. Discriminator on the rules
@@ -27001,7 +27648,14 @@ var zoneRulesCapability = {
27001
27648
  motion: array(ZoneRuleSchema).readonly(),
27002
27649
  detection: array(ZoneRuleSchema).readonly(),
27003
27650
  package: array(ZoneRuleSchema).readonly()
27004
- })
27651
+ }),
27652
+ /**
27653
+ * Runtime-state durability: **restored** — operator intent, mutation-only, same argument as `zones`.
27654
+ *
27655
+ * See `RuntimeStateDurability`. Enforced by
27656
+ * `scripts/check-runtime-state-durability.ts`.
27657
+ */
27658
+ durability: "restored"
27005
27659
  };
27006
27660
  /**
27007
27661
  * Accessory device helpers — shared across drivers.
@@ -33688,6 +34342,7 @@ Object.freeze({
33688
34342
  "network-access": "ingress",
33689
34343
  "smtp-provider": "email"
33690
34344
  });
34345
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
33691
34346
  new Set(["devices", "classes"]);
33692
34347
  /**
33693
34348
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.