@camstack/addon-import-alexa 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 +731 -76
  2. package/dist/addon.mjs +731 -76
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -10997,7 +10997,14 @@ var cameraStreamsCapability = {
10997
10997
  low: string().optional()
10998
10998
  }),
10999
10999
  lastChangedAt: number()
11000
- })
11000
+ }),
11001
+ /**
11002
+ * 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.
11003
+ *
11004
+ * See `RuntimeStateDurability`. Enforced by
11005
+ * `scripts/check-runtime-state-durability.ts`.
11006
+ */
11007
+ durability: "session"
11001
11008
  };
11002
11009
  /** Where a block runs. The operator chooses — a block driving a device on an
11003
11010
  * agent is the reason placement is not fixed to the hub. */
@@ -11558,6 +11565,13 @@ var deviceDiscoveryCapability = {
11558
11565
  kind: "poll"
11559
11566
  },
11560
11567
  runtimeState: DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: number().int().nonnegative() }),
11568
+ /**
11569
+ * Runtime-state durability: **session** — 5.7 KB of scan output on the largest device, fully re-derivable by re-scanning.
11570
+ *
11571
+ * See `RuntimeStateDurability`. Enforced by
11572
+ * `scripts/check-runtime-state-durability.ts`.
11573
+ */
11574
+ durability: "session",
11561
11575
  methods: {
11562
11576
  /**
11563
11577
  * Snapshot of the current `discovered` list. Returns the
@@ -13444,11 +13458,33 @@ var NotificationFormatSchema = _enum([
13444
13458
  * Named by INTENT, never by glyph. "check" would tie the vocabulary to one
13445
13459
  * renderer's icon set; "acknowledge" survives an adapter that draws it
13446
13460
  * differently.
13461
+ *
13462
+ * ── A TOKEN IS NOT A WIRE VALUE ─────────────────────────────────────
13463
+ *
13464
+ * These names are for US. **No adapter may forward one verbatim.** Each maps
13465
+ * the whole set onto its own renderer's vocabulary through a
13466
+ * `Record<NotificationActionIcon, string>` — a Record, never a lookup with a
13467
+ * fallback, so adding a member here fails every adapter's build until someone
13468
+ * decides its glyph, which is the only place that decision can be made
13469
+ * honestly.
13470
+ *
13471
+ * This paragraph is the bug. Zentik declared `actionIcons: true` and passed
13472
+ * `disarm` straight through; iOS feeds that string to
13473
+ * `UNNotificationActionIcon(systemImageName:)`, `disarm` is not an SF Symbol,
13474
+ * and every snooze and alarm button arrived BLANK. A pass-through is not a
13475
+ * mapping, and "the field is documented" is not "the value renders".
13476
+ *
13477
+ * Adding a member is TRAIN-BOUND. The enum lives in the published
13478
+ * `@camstack/server` closure and the cap seam validates against the HUB's copy,
13479
+ * so an addon that emits a token the running hub does not know does not lose an
13480
+ * icon — its whole `send` fails Zod validation and the notification never
13481
+ * arrives. Never emit a new token from an addon before the train carrying it.
13447
13482
  */
13448
13483
  var NotificationActionIconSchema = _enum([
13449
13484
  "acknowledge",
13450
13485
  "dismiss",
13451
13486
  "silence",
13487
+ "snooze",
13452
13488
  "view",
13453
13489
  "play",
13454
13490
  "open",
@@ -13456,9 +13492,13 @@ var NotificationActionIconSchema = _enum([
13456
13492
  "lock",
13457
13493
  "unlock",
13458
13494
  "arm",
13495
+ "arm-home",
13496
+ "arm-away",
13497
+ "arm-night",
13459
13498
  "disarm",
13460
13499
  "light",
13461
- "alert"
13500
+ "alert",
13501
+ "camera"
13462
13502
  ]);
13463
13503
  /** A single tap-through action button. */
13464
13504
  var NotificationActionSchema = object({
@@ -13474,7 +13514,23 @@ var NotificationActionSchema = object({
13474
13514
  * else — see `notification-center/action-token.ts` for what that does and
13475
13515
  * does not buy.
13476
13516
  */
13477
- destructive: boolean().optional()
13517
+ destructive: boolean().optional(),
13518
+ /**
13519
+ * How the tap should REACH the url.
13520
+ *
13521
+ * `navigate` (absent, and every button authored before this field) opens it:
13522
+ * the phone leaves the notification and shows whatever the callback returns.
13523
+ * That is right for a button whose answer the operator wants to read.
13524
+ *
13525
+ * `background` fires it as a POST and stays put. It exists for the buttons
13526
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13527
+ * an answer to the notification, and being thrown into a browser tab to
13528
+ * confirm it costs more attention than the notification did. A backend that
13529
+ * cannot do a background call renders it as an ordinary link (the adapters
13530
+ * fall back rather than dropping the button), so this is a preference, never
13531
+ * a requirement.
13532
+ */
13533
+ mode: _enum(["navigate", "background"]).optional()
13478
13534
  });
13479
13535
  /**
13480
13536
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -13642,6 +13698,24 @@ method(object({}), array(TargetKindSchema)), method(object({}), array(TargetSche
13642
13698
  targetId: string(),
13643
13699
  enabled: boolean()
13644
13700
  }), _void(), { kind: "mutation" });
13701
+ new Set([
13702
+ {
13703
+ id: "person",
13704
+ name: "Person"
13705
+ },
13706
+ {
13707
+ id: "vehicle",
13708
+ name: "Vehicle"
13709
+ },
13710
+ {
13711
+ id: "animal",
13712
+ name: "Animal"
13713
+ },
13714
+ {
13715
+ id: "package",
13716
+ name: "Package"
13717
+ }
13718
+ ].map((l) => l.id));
13645
13719
  var COCO_TO_MACRO = {
13646
13720
  mapping: {
13647
13721
  person: "person",
@@ -14326,7 +14400,17 @@ var alarmPanelCapability = {
14326
14400
  * full slice; renders an arm button per `availableModes` entry and
14327
14401
  * a PIN field iff `requiresCode === true`.
14328
14402
  */
14329
- runtimeState: AlarmPanelStatusSchema
14403
+ runtimeState: AlarmPanelStatusSchema,
14404
+ /**
14405
+ * Runtime-state durability: **restored** — armed state is the one thing a panel must not lose across a restart.
14406
+ *
14407
+ * See `RuntimeStateDurability`. Enforced by
14408
+ * `scripts/check-runtime-state-durability.ts`.
14409
+ */
14410
+ durability: "restored",
14411
+ /** Clock fields: written, but excluded from the compare that decides
14412
+ * whether persisting is worth a SQLite commit. */
14413
+ volatileStateFields: ["lastChangedAt"]
14330
14414
  };
14331
14415
  /**
14332
14416
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
@@ -14467,6 +14551,8 @@ var NcSystemEventKindSchema = _enum([
14467
14551
  "alarm-triggered",
14468
14552
  "alarm-armed",
14469
14553
  "alarm-disarmed",
14554
+ "alarm-arming",
14555
+ "alarm-arm-refused",
14470
14556
  "camera-online",
14471
14557
  "camera-offline",
14472
14558
  "camera-disabled",
@@ -14503,6 +14589,9 @@ var NcSystemEventConditionSchema = object({
14503
14589
  nodeIds: array(string().min(1)).min(1).optional(),
14504
14590
  packageNames: array(string().min(1)).min(1).optional()
14505
14591
  });
14592
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14593
+ * outage the operator asked for once and forgot. */
14594
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14506
14595
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14507
14596
  var NcScheduleSchema = object({
14508
14597
  windows: array(object({
@@ -14879,15 +14968,15 @@ var NcConditionsSchema = object({
14879
14968
  * (an `immediate` rule naming an `audio-*` class, one notification per
14880
14969
  * classified sample) stays exactly as it was for rules that already use it.
14881
14970
  *
14882
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14883
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14884
- * (`camstack/src/data/notification-center.ts`, guarded by
14885
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14971
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14972
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14973
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14974
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14886
14975
  * condition fields it does not know when a rule is saved from the phone.
14887
14976
  * Publishing an editor for a condition the app cannot round-trip is how an
14888
- * operator loses a rule's conditions by opening it — so the descriptor, the
14889
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14890
- * does an audio rule become authorable.
14977
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14978
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14979
+ * follows here.
14891
14980
  */
14892
14981
  audio: NcAudioConditionSchema.optional()
14893
14982
  });
@@ -15123,6 +15212,30 @@ var NcRuleInputSchema = object({
15123
15212
  */
15124
15213
  snoozeAllowGlobal: boolean().optional(),
15125
15214
  /**
15215
+ * The snooze durations THIS rule's notification offers as buttons, in
15216
+ * minutes.
15217
+ *
15218
+ * Three states, and all three are distinct — which is exactly why this is
15219
+ * `.optional()` and never `.default()`. A Zod default does not run on the
15220
+ * addon cap path (three production failures in one day), so a schema default
15221
+ * would collapse the first two:
15222
+ *
15223
+ * | value | meaning |
15224
+ * | --- | --- |
15225
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
15226
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
15227
+ * | a list | these choices, de-duplicated and sorted, at most four |
15228
+ *
15229
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
15230
+ * three buttons in total) and a rule that spent it all on snooze choices
15231
+ * would push its own tap-through actions off the notification.
15232
+ *
15233
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
15234
+ * that arms the panel, is exempt automatically and cannot be silenced by a
15235
+ * window from anywhere (D133).
15236
+ */
15237
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
15238
+ /**
15126
15239
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
15127
15240
  *
15128
15241
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -15222,6 +15335,7 @@ var NcConditionDescriptorSchema = object({
15222
15335
  "device",
15223
15336
  "package",
15224
15337
  "occupancy",
15338
+ "audio",
15225
15339
  "system"
15226
15340
  ]),
15227
15341
  label: string(),
@@ -15240,6 +15354,7 @@ var NcConditionDescriptorSchema = object({
15240
15354
  "crossingSelect",
15241
15355
  "polygonDraw",
15242
15356
  "occupancy",
15357
+ "audio",
15243
15358
  "deviceState",
15244
15359
  "systemEvent"
15245
15360
  ]),
@@ -15391,7 +15506,20 @@ var NcSnoozeInputSchema = object({
15391
15506
  ruleId: string().optional(),
15392
15507
  /** Required when `scope: 'device'`. */
15393
15508
  deviceId: number().int().optional(),
15394
- durationMinutes: number().int().min(1).max(1440),
15509
+ /**
15510
+ * Narrow the window to these subject classes — "the cat, not the person".
15511
+ *
15512
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15513
+ * what every window authored before this field meant, so no persisted row
15514
+ * changes meaning and no client has to learn anything to keep working.
15515
+ *
15516
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15517
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15518
+ * not at whichever of their four rules happened to produce the notification
15519
+ * they are dismissing.
15520
+ */
15521
+ classes: array(string().min(1)).min(1).optional(),
15522
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
15395
15523
  /**
15396
15524
  * Silence this for EVERY recipient, not just the caller. Permission is
15397
15525
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15416,6 +15544,10 @@ var NcSnoozeSchema = object({
15416
15544
  scope: NcSnoozeScopeSchema,
15417
15545
  ruleId: string().optional(),
15418
15546
  deviceId: number().int().optional(),
15547
+ /** Subject classes this window covers. ABSENT = every class — see
15548
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15549
+ * no SQLite column: nothing queries a window by class. */
15550
+ classes: array(string().min(1)).min(1).optional(),
15419
15551
  startedAt: number(),
15420
15552
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15421
15553
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -17516,7 +17648,14 @@ var zonesCapability = {
17516
17648
  * handle. Slice shape is `{ zones: Zone[] }` so future extensions
17517
17649
  * (e.g. zone groupings) can sit alongside the polygon list.
17518
17650
  */
17519
- runtimeState: object({ zones: array(ZoneSchema).readonly() })
17651
+ runtimeState: object({ zones: array(ZoneSchema).readonly() }),
17652
+ /**
17653
+ * 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.
17654
+ *
17655
+ * See `RuntimeStateDurability`. Enforced by
17656
+ * `scripts/check-runtime-state-durability.ts`.
17657
+ */
17658
+ durability: "restored"
17520
17659
  };
17521
17660
  /**
17522
17661
  * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
@@ -17686,6 +17825,22 @@ var detectionFpsField = {
17686
17825
  default: 10,
17687
17826
  step: 1
17688
17827
  };
17828
+ /**
17829
+ * The occupancy re-check interval. DEFAULT 300 s (2026-08-13 — was 30 s).
17830
+ *
17831
+ * The recheck is now on by default (a parked car is invisible to occupancy
17832
+ * rules until the stationary registry has been rebuilt by motion, which after a
17833
+ * restart may be never on a quiet camera). Each cycle re-subscribes a detection
17834
+ * session — an RTSP re-dial — so the switch is only affordable at a WIDE
17835
+ * interval: 300 s is ~12 re-dials an hour per camera, against 120 at the old
17836
+ * 30 s. A parked car is therefore counted within 5 minutes of a restart.
17837
+ *
17838
+ * Why not wider: `max` is 300 and raising it is TRAIN-BOUND, not addon-bound —
17839
+ * the host validates `attachCamera` against ITS copy of this schema, so a
17840
+ * runner asked for 600 would be rejected by the hub until a `@camstack/server`
17841
+ * carrying the wider bound is installed everywhere. 300 is the widest value
17842
+ * that ships with an addon deploy.
17843
+ */
17689
17844
  var occupancyRecheckSecField = {
17690
17845
  min: 0,
17691
17846
  max: 300,
@@ -17887,15 +18042,21 @@ var RunnerCameraConfigSchema = object({
17887
18042
  */
17888
18043
  onboardMotionDrivesAnalyzer: boolean().default(true),
17889
18044
  /**
17890
- * Master toggle for the occupancy re-check. When `false` (DEFAULT) the runner
17891
- * never arms the periodic recheck timer, regardless of `occupancyRecheckSec`
17892
- * this is off by default because the recheck re-subscribes a detection session
17893
- * every N seconds while `watching`, a major source of pull-decoder re-dial
17894
- * churn (each cycle creates+tears a session → RTSP re-dial → latency). The
18045
+ * Master toggle for the occupancy re-check. When `false` the runner never arms
18046
+ * the periodic recheck timer, regardless of `occupancyRecheckSec`; the
17895
18047
  * `occupancyRecheckSec` / `occupancyRecheckFrames` sliders only take effect
17896
18048
  * (and only render) when this is enabled.
18049
+ *
18050
+ * DEFAULT `true` since 2026-08-13 (was `false`). It was off because the
18051
+ * recheck re-subscribes a detection session every N seconds while `watching`
18052
+ * — each cycle creates+tears a session ⇒ an RTSP re-dial ⇒ latency, a major
18053
+ * pull-decoder churn source. What that bought was a blind spot: a STATIONARY
18054
+ * object is counted only while the stationary registry holds it, and the
18055
+ * registry rebuilds from motion, so after a restart a parked car was invisible
18056
+ * to every occupancy rule until something moved in front of it. The churn is
18057
+ * now paid on the interval instead — see `occupancyRecheckSecField`.
17897
18058
  */
17898
- occupancyRecheckEnabled: boolean().default(false),
18059
+ occupancyRecheckEnabled: boolean().default(true),
17899
18060
  occupancyRecheckSec: number().min(occupancyRecheckSecField.min).max(occupancyRecheckSecField.max).default(occupancyRecheckSecField.default),
17900
18061
  occupancyRecheckFrames: number().min(occupancyRecheckFramesField.min).max(occupancyRecheckFramesField.max).default(occupancyRecheckFramesField.default),
17901
18062
  /**
@@ -20315,7 +20476,17 @@ var airQualitySensorCapability = {
20315
20476
  schema: AirQualitySensorStatusSchema,
20316
20477
  kind: "push"
20317
20478
  },
20318
- runtimeState: AirQualitySensorStatusSchema
20479
+ runtimeState: AirQualitySensorStatusSchema,
20480
+ /**
20481
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20482
+ *
20483
+ * See `RuntimeStateDurability`. Enforced by
20484
+ * `scripts/check-runtime-state-durability.ts`.
20485
+ */
20486
+ durability: "restored",
20487
+ /** Clock fields: written, but excluded from the compare that decides
20488
+ * whether persisting is worth a SQLite commit. */
20489
+ volatileStateFields: ["lastFetchedAt"]
20319
20490
  };
20320
20491
  /**
20321
20492
  * Ambient illuminance reading in lux. Drives Home Assistant `sensor`
@@ -20347,7 +20518,17 @@ var ambientLightSensorCapability = {
20347
20518
  schema: AmbientLightSensorStatusSchema,
20348
20519
  kind: "push"
20349
20520
  },
20350
- runtimeState: AmbientLightSensorStatusSchema
20521
+ runtimeState: AmbientLightSensorStatusSchema,
20522
+ /**
20523
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20524
+ *
20525
+ * See `RuntimeStateDurability`. Enforced by
20526
+ * `scripts/check-runtime-state-durability.ts`.
20527
+ */
20528
+ durability: "restored",
20529
+ /** Clock fields: written, but excluded from the compare that decides
20530
+ * whether persisting is worth a SQLite commit. */
20531
+ volatileStateFields: ["lastFetchedAt"]
20351
20532
  };
20352
20533
  /**
20353
20534
  * Per-class audio metrics aggregated over a sliding window.
@@ -20465,7 +20646,14 @@ var audioMetricsCapability = {
20465
20646
  }), AudioMetricsHistorySchema)
20466
20647
  },
20467
20648
  /** Reactive runtime-state mirror — live `device.state.audioMetrics.value`. */
20468
- runtimeState: AudioMetricsSnapshotSchema
20649
+ runtimeState: AudioMetricsSnapshotSchema,
20650
+ /**
20651
+ * 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.
20652
+ *
20653
+ * See `RuntimeStateDurability`. Enforced by
20654
+ * `scripts/check-runtime-state-durability.ts`.
20655
+ */
20656
+ durability: "session"
20469
20657
  };
20470
20658
  /**
20471
20659
  * Automation-control cap. Models HA `automation.*` entities on
@@ -20527,7 +20715,14 @@ var automationControlCapability = {
20527
20715
  * reads `enabled` (toggle) + `isRunning` (spinner) + `lastError`
20528
20716
  * (badge) directly.
20529
20717
  */
20530
- runtimeState: AutomationControlStatusSchema
20718
+ runtimeState: AutomationControlStatusSchema,
20719
+ /**
20720
+ * 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.
20721
+ *
20722
+ * See `RuntimeStateDurability`. Enforced by
20723
+ * `scripts/check-runtime-state-durability.ts`.
20724
+ */
20725
+ durability: "session"
20531
20726
  };
20532
20727
  /**
20533
20728
  * Battery status snapshot. Emitted by providers whose device is
@@ -20633,7 +20828,17 @@ onStatusChanged: { data: object({
20633
20828
  * via `device.runtimeState.getCapState('battery')` regardless of
20634
20829
  * the underlying driver.
20635
20830
  */
20636
- runtimeState: BatteryStatusSchema
20831
+ runtimeState: BatteryStatusSchema,
20832
+ /**
20833
+ * 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.
20834
+ *
20835
+ * See `RuntimeStateDurability`. Enforced by
20836
+ * `scripts/check-runtime-state-durability.ts`.
20837
+ */
20838
+ durability: "restored",
20839
+ /** Clock fields: written, but excluded from the compare that decides
20840
+ * whether persisting is worth a SQLite commit. */
20841
+ volatileStateFields: ["lastUpdated"]
20637
20842
  };
20638
20843
  /**
20639
20844
  * Generic boolean sensor — last-resort fallback when no domain-
@@ -20662,7 +20867,17 @@ var binaryCapability = {
20662
20867
  schema: BinaryStatusSchema,
20663
20868
  kind: "push"
20664
20869
  },
20665
- runtimeState: BinaryStatusSchema
20870
+ runtimeState: BinaryStatusSchema,
20871
+ /**
20872
+ * Runtime-state durability: **restored** — transition-driven sensor state; the restored value gives the boot comparison.
20873
+ *
20874
+ * See `RuntimeStateDurability`. Enforced by
20875
+ * `scripts/check-runtime-state-durability.ts`.
20876
+ */
20877
+ durability: "restored",
20878
+ /** Clock fields: written, but excluded from the compare that decides
20879
+ * whether persisting is worth a SQLite commit. */
20880
+ volatileStateFields: ["lastChangedAt"]
20666
20881
  };
20667
20882
  /**
20668
20883
  * Dimmable-light brightness control. Co-exists with `switch` on the
@@ -20715,7 +20930,14 @@ onBrightnessChanged: { data: object({
20715
20930
  * by the kernel. Read via `device.state.brightness.value` so UI
20716
20931
  * sliders surface the current level without polling the provider.
20717
20932
  */
20718
- runtimeState: BrightnessStatusSchema
20933
+ runtimeState: BrightnessStatusSchema,
20934
+ /**
20935
+ * Runtime-state durability: **session** — live lamp state, re-published by the provider on connect.
20936
+ *
20937
+ * See `RuntimeStateDurability`. Enforced by
20938
+ * `scripts/check-runtime-state-durability.ts`.
20939
+ */
20940
+ durability: "session"
20719
20941
  };
20720
20942
  /**
20721
20943
  * button — device-scoped capability for HA `button.*` / `input_button.*`
@@ -20820,7 +21042,17 @@ var carbonMonoxideCapability = {
20820
21042
  schema: CarbonMonoxideStatusSchema,
20821
21043
  kind: "push"
20822
21044
  },
20823
- runtimeState: CarbonMonoxideStatusSchema
21045
+ runtimeState: CarbonMonoxideStatusSchema,
21046
+ /**
21047
+ * Runtime-state durability: **restored** — as `smoke`.
21048
+ *
21049
+ * See `RuntimeStateDurability`. Enforced by
21050
+ * `scripts/check-runtime-state-durability.ts`.
21051
+ */
21052
+ durability: "restored",
21053
+ /** Clock fields: written, but excluded from the compare that decides
21054
+ * whether persisting is worth a SQLite commit. */
21055
+ volatileStateFields: ["lastChangedAt"]
20824
21056
  };
20825
21057
  /**
20826
21058
  * HVAC / climate control cap. Models the full surface of a HA
@@ -20980,7 +21212,14 @@ var climateControlCapability = {
20980
21212
  * the full slice via `device.state.climate-control.value` and refresh
20981
21213
  * on every push without re-querying the provider.
20982
21214
  */
20983
- runtimeState: ClimateControlStatusSchema
21215
+ runtimeState: ClimateControlStatusSchema,
21216
+ /**
21217
+ * Runtime-state durability: **session** — as `brightness`; `currentTemp` moves continuously and is re-published on connect.
21218
+ *
21219
+ * See `RuntimeStateDurability`. Enforced by
21220
+ * `scripts/check-runtime-state-durability.ts`.
21221
+ */
21222
+ durability: "session"
20984
21223
  };
20985
21224
  /**
20986
21225
  * Color-light cap. Coexists with `switch` (on/off) and `brightness`
@@ -21090,7 +21329,14 @@ onColorChanged: { data: object({
21090
21329
  * kernel. Read via `device.state.color.value` so UI pickers surface
21091
21330
  * the current chromaticity without polling the provider.
21092
21331
  */
21093
- runtimeState: ColorStatusSchema
21332
+ runtimeState: ColorStatusSchema,
21333
+ /**
21334
+ * Runtime-state durability: **session** — as `brightness`.
21335
+ *
21336
+ * See `RuntimeStateDurability`. Enforced by
21337
+ * `scripts/check-runtime-state-durability.ts`.
21338
+ */
21339
+ durability: "session"
21094
21340
  };
21095
21341
  var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
21096
21342
  object({
@@ -21148,7 +21394,17 @@ var connectivityCapability = {
21148
21394
  schema: ConnectivityStatusSchema,
21149
21395
  kind: "push"
21150
21396
  },
21151
- runtimeState: ConnectivityStatusSchema
21397
+ runtimeState: ConnectivityStatusSchema,
21398
+ /**
21399
+ * Runtime-state durability: **restored** — same shape and same argument as `device-status`, for links rather than devices.
21400
+ *
21401
+ * See `RuntimeStateDurability`. Enforced by
21402
+ * `scripts/check-runtime-state-durability.ts`.
21403
+ */
21404
+ durability: "restored",
21405
+ /** Clock fields: written, but excluded from the compare that decides
21406
+ * whether persisting is worth a SQLite commit. */
21407
+ volatileStateFields: ["lastChangedAt"]
21152
21408
  };
21153
21409
  /**
21154
21410
  * Generic device-consumables capability — surfaces a device's
@@ -21230,7 +21486,14 @@ reset: method(object({
21230
21486
  }
21231
21487
  }
21232
21488
  },
21233
- runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() })
21489
+ runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() }),
21490
+ /**
21491
+ * Runtime-state durability: **session** — the authority is the appliance; the provider re-reads the whole item array on connect.
21492
+ *
21493
+ * See `RuntimeStateDurability`. Enforced by
21494
+ * `scripts/check-runtime-state-durability.ts`.
21495
+ */
21496
+ durability: "session"
21234
21497
  };
21235
21498
  /**
21236
21499
  * Door / window / opening / garage / valve contact sensor. Boolean
@@ -21261,7 +21524,17 @@ var contactCapability = {
21261
21524
  schema: ContactStatusSchema,
21262
21525
  kind: "push"
21263
21526
  },
21264
- runtimeState: ContactStatusSchema
21527
+ runtimeState: ContactStatusSchema,
21528
+ /**
21529
+ * Runtime-state durability: **restored** — a door left open across a restart must still read open.
21530
+ *
21531
+ * See `RuntimeStateDurability`. Enforced by
21532
+ * `scripts/check-runtime-state-durability.ts`.
21533
+ */
21534
+ durability: "restored",
21535
+ /** Clock fields: written, but excluded from the compare that decides
21536
+ * whether persisting is worth a SQLite commit. */
21537
+ volatileStateFields: ["lastChangedAt"]
21265
21538
  };
21266
21539
  /**
21267
21540
  * Status slice — flat object (the framework's `runtimeState` contract
@@ -21367,7 +21640,14 @@ var controlCapability = {
21367
21640
  * dropdown / text field / date picker) read the slice's discriminant
21368
21641
  * and value directly without polling the provider.
21369
21642
  */
21370
- runtimeState: ControlStatusSchema
21643
+ runtimeState: ControlStatusSchema,
21644
+ /**
21645
+ * Runtime-state durability: **session** — a generic control mirrors an external entity that re-publishes on connect; the options array is re-derived with it.
21646
+ *
21647
+ * See `RuntimeStateDurability`. Enforced by
21648
+ * `scripts/check-runtime-state-durability.ts`.
21649
+ */
21650
+ durability: "session"
21371
21651
  };
21372
21652
  var CoverStatusSchema = object({
21373
21653
  /** Lifecycle state of the cover. */
@@ -21428,7 +21708,17 @@ var coverCapability = {
21428
21708
  * Runtime-state slice — mirrored by the kernel. UI controls watch
21429
21709
  * the slice for live position changes during a move.
21430
21710
  */
21431
- runtimeState: CoverStatusSchema
21711
+ runtimeState: CoverStatusSchema,
21712
+ /**
21713
+ * Runtime-state durability: **restored** — position survives a restart on the device; the mirror should agree at boot rather than read blank.
21714
+ *
21715
+ * See `RuntimeStateDurability`. Enforced by
21716
+ * `scripts/check-runtime-state-durability.ts`.
21717
+ */
21718
+ durability: "restored",
21719
+ /** Clock fields: written, but excluded from the compare that decides
21720
+ * whether persisting is worth a SQLite commit. */
21721
+ volatileStateFields: ["lastChangedAt"]
21432
21722
  };
21433
21723
  /**
21434
21724
  * Vendor-neutral day/night (IR-cut) control — the per-camera config cap
@@ -21522,7 +21812,17 @@ var dayNightCapability = {
21522
21812
  schema: DayNightStatusSchema,
21523
21813
  kind: "poll"
21524
21814
  },
21525
- runtimeState: DayNightStatusSchema
21815
+ runtimeState: DayNightStatusSchema,
21816
+ /**
21817
+ * Runtime-state durability: **restored** — operator-set IR-cut behaviour; mutation-driven.
21818
+ *
21819
+ * See `RuntimeStateDurability`. Enforced by
21820
+ * `scripts/check-runtime-state-durability.ts`.
21821
+ */
21822
+ durability: "restored",
21823
+ /** Clock fields: written, but excluded from the compare that decides
21824
+ * whether persisting is worth a SQLite commit. */
21825
+ volatileStateFields: ["lastFetchedAt"]
21526
21826
  };
21527
21827
  /**
21528
21828
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
@@ -21569,7 +21869,17 @@ onStatusChanged: { data: object({
21569
21869
  schema: DeviceStatusSchema,
21570
21870
  kind: "push"
21571
21871
  },
21572
- runtimeState: DeviceStatusSchema
21872
+ runtimeState: DeviceStatusSchema,
21873
+ /**
21874
+ * 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.
21875
+ *
21876
+ * See `RuntimeStateDurability`. Enforced by
21877
+ * `scripts/check-runtime-state-durability.ts`.
21878
+ */
21879
+ durability: "restored",
21880
+ /** Clock fields: written, but excluded from the compare that decides
21881
+ * whether persisting is worth a SQLite commit. */
21882
+ volatileStateFields: ["lastChangedAt"]
21573
21883
  };
21574
21884
  /**
21575
21885
  * Doorbell button cap. Two kinds of providers coexist behind this cap
@@ -21631,7 +21941,14 @@ onPressed: { data: DoorbellPressEventSchema } },
21631
21941
  * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
21632
21942
  * without subscribing.
21633
21943
  */
21634
- runtimeState: DoorbellStatusSchema
21944
+ runtimeState: DoorbellStatusSchema,
21945
+ /**
21946
+ * 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.
21947
+ *
21948
+ * See `RuntimeStateDurability`. Enforced by
21949
+ * `scripts/check-runtime-state-durability.ts`.
21950
+ */
21951
+ durability: "restored"
21635
21952
  };
21636
21953
  /**
21637
21954
  * Enum-state sensor — a string value picked from a finite option set.
@@ -21671,7 +21988,17 @@ var enumSensorCapability = {
21671
21988
  schema: EnumSensorStatusSchema,
21672
21989
  kind: "push"
21673
21990
  },
21674
- runtimeState: EnumSensorStatusSchema
21991
+ runtimeState: EnumSensorStatusSchema,
21992
+ /**
21993
+ * Runtime-state durability: **restored** — as `numeric-sensor`; 80 devices.
21994
+ *
21995
+ * See `RuntimeStateDurability`. Enforced by
21996
+ * `scripts/check-runtime-state-durability.ts`.
21997
+ */
21998
+ durability: "restored",
21999
+ /** Clock fields: written, but excluded from the compare that decides
22000
+ * whether persisting is worth a SQLite commit. */
22001
+ volatileStateFields: ["lastFetchedAt"]
21675
22002
  };
21676
22003
  /**
21677
22004
  * Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
@@ -21707,7 +22034,14 @@ var eventEmitterCapability = {
21707
22034
  schema: EventEmitterStatusSchema,
21708
22035
  kind: "push"
21709
22036
  },
21710
- runtimeState: EventEmitterStatusSchema
22037
+ runtimeState: EventEmitterStatusSchema,
22038
+ /**
22039
+ * Runtime-state durability: **session** — `eventCountSinceStart` names its own scope.
22040
+ *
22041
+ * See `RuntimeStateDurability`. Enforced by
22042
+ * `scripts/check-runtime-state-durability.ts`.
22043
+ */
22044
+ durability: "session"
21711
22045
  };
21712
22046
  var EventItemSchema = object({
21713
22047
  id: string(),
@@ -21988,7 +22322,14 @@ var fanControlCapability = {
21988
22322
  * Runtime-state slice — mirrored by the kernel. UI fan speed
21989
22323
  * sliders read `percentage` for live updates.
21990
22324
  */
21991
- runtimeState: FanControlStatusSchema
22325
+ runtimeState: FanControlStatusSchema,
22326
+ /**
22327
+ * Runtime-state durability: **session** — as `brightness`.
22328
+ *
22329
+ * See `RuntimeStateDurability`. Enforced by
22330
+ * `scripts/check-runtime-state-durability.ts`.
22331
+ */
22332
+ durability: "session"
21992
22333
  };
21993
22334
  /**
21994
22335
  * Per-device feature/identity probe slice. Holds the runtime-resolved
@@ -22064,7 +22405,14 @@ onProbeChanged: { data: object({
22064
22405
  schema: FeatureProbeStatusSchema,
22065
22406
  kind: "push"
22066
22407
  },
22067
- runtimeState: FeatureProbeStatusSchema
22408
+ runtimeState: FeatureProbeStatusSchema,
22409
+ /**
22410
+ * 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.
22411
+ *
22412
+ * See `RuntimeStateDurability`. Enforced by
22413
+ * `scripts/check-runtime-state-durability.ts`.
22414
+ */
22415
+ durability: "session"
22068
22416
  };
22069
22417
  /**
22070
22418
  * Water leak / moisture sensor. Boolean "is liquid currently
@@ -22091,7 +22439,17 @@ var floodCapability = {
22091
22439
  schema: FloodStatusSchema,
22092
22440
  kind: "push"
22093
22441
  },
22094
- runtimeState: FloodStatusSchema
22442
+ runtimeState: FloodStatusSchema,
22443
+ /**
22444
+ * Runtime-state durability: **restored** — as `smoke`.
22445
+ *
22446
+ * See `RuntimeStateDurability`. Enforced by
22447
+ * `scripts/check-runtime-state-durability.ts`.
22448
+ */
22449
+ durability: "restored",
22450
+ /** Clock fields: written, but excluded from the compare that decides
22451
+ * whether persisting is worth a SQLite commit. */
22452
+ volatileStateFields: ["lastChangedAt"]
22095
22453
  };
22096
22454
  /**
22097
22455
  * Combustible-gas (LPG / methane / hydrogen) alarm sensor. Drives
@@ -22114,7 +22472,17 @@ var gasCapability = {
22114
22472
  schema: GasStatusSchema,
22115
22473
  kind: "push"
22116
22474
  },
22117
- runtimeState: GasStatusSchema
22475
+ runtimeState: GasStatusSchema,
22476
+ /**
22477
+ * Runtime-state durability: **restored** — as `smoke`.
22478
+ *
22479
+ * See `RuntimeStateDurability`. Enforced by
22480
+ * `scripts/check-runtime-state-durability.ts`.
22481
+ */
22482
+ durability: "restored",
22483
+ /** Clock fields: written, but excluded from the compare that decides
22484
+ * whether persisting is worth a SQLite commit. */
22485
+ volatileStateFields: ["lastChangedAt"]
22118
22486
  };
22119
22487
  /**
22120
22488
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
@@ -22190,7 +22558,14 @@ var humidifierCapability = {
22190
22558
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22191
22559
  * slice for live humidity / mode changes.
22192
22560
  */
22193
- runtimeState: HumidifierStatusSchema
22561
+ runtimeState: HumidifierStatusSchema,
22562
+ /**
22563
+ * Runtime-state durability: **session** — as `climate-control`.
22564
+ *
22565
+ * See `RuntimeStateDurability`. Enforced by
22566
+ * `scripts/check-runtime-state-durability.ts`.
22567
+ */
22568
+ durability: "session"
22194
22569
  };
22195
22570
  /**
22196
22571
  * Single-metric humidity reading. Drives Home Assistant `sensor`
@@ -22226,7 +22601,17 @@ var humiditySensorCapability = {
22226
22601
  schema: HumiditySensorStatusSchema,
22227
22602
  kind: "push"
22228
22603
  },
22229
- runtimeState: HumiditySensorStatusSchema
22604
+ runtimeState: HumiditySensorStatusSchema,
22605
+ /**
22606
+ * Runtime-state durability: **restored** — as `numeric-sensor` (67 of 75 writes were the clock alone).
22607
+ *
22608
+ * See `RuntimeStateDurability`. Enforced by
22609
+ * `scripts/check-runtime-state-durability.ts`.
22610
+ */
22611
+ durability: "restored",
22612
+ /** Clock fields: written, but excluded from the compare that decides
22613
+ * whether persisting is worth a SQLite commit. */
22614
+ volatileStateFields: ["lastFetchedAt"]
22230
22615
  };
22231
22616
  /**
22232
22617
  * Image display cap. Models a single still image exposed by an integration —
@@ -22264,7 +22649,14 @@ var imageCapability = {
22264
22649
  * Runtime-state slice — mirrored by the kernel. The UI reads `url`
22265
22650
  * directly and renders the still image.
22266
22651
  */
22267
- runtimeState: ImageStatusSchema
22652
+ runtimeState: ImageStatusSchema,
22653
+ /**
22654
+ * Runtime-state durability: **session** — a snapshot URL is a session-scoped handle; a restored one points at nothing.
22655
+ *
22656
+ * See `RuntimeStateDurability`. Enforced by
22657
+ * `scripts/check-runtime-state-durability.ts`.
22658
+ */
22659
+ durability: "session"
22268
22660
  };
22269
22661
  /**
22270
22662
  * Vendor-neutral image / picture-adjustment cap — the per-camera config
@@ -22413,7 +22805,17 @@ var imageSettingsCapability = {
22413
22805
  schema: ImageSettingsStatusSchema,
22414
22806
  kind: "poll"
22415
22807
  },
22416
- runtimeState: ImageSettingsStatusSchema
22808
+ runtimeState: ImageSettingsStatusSchema,
22809
+ /**
22810
+ * Runtime-state durability: **restored** — operator-set camera imaging; mutation-driven.
22811
+ *
22812
+ * See `RuntimeStateDurability`. Enforced by
22813
+ * `scripts/check-runtime-state-durability.ts`.
22814
+ */
22815
+ durability: "restored",
22816
+ /** Clock fields: written, but excluded from the compare that decides
22817
+ * whether persisting is worth a SQLite commit. */
22818
+ volatileStateFields: ["lastFetchedAt"]
22417
22819
  };
22418
22820
  /**
22419
22821
  * integrations — system-scoped singleton capability for integration
@@ -22753,7 +23155,14 @@ var lawnMowerControlCapability = {
22753
23155
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22754
23156
  * slice for live activity + battery changes.
22755
23157
  */
22756
- runtimeState: LawnMowerControlStatusSchema
23158
+ runtimeState: LawnMowerControlStatusSchema,
23159
+ /**
23160
+ * Runtime-state durability: **session** — as `vacuum-control`.
23161
+ *
23162
+ * See `RuntimeStateDurability`. Enforced by
23163
+ * `scripts/check-runtime-state-durability.ts`.
23164
+ */
23165
+ durability: "session"
22757
23166
  };
22758
23167
  /**
22759
23168
  * local-network — hub-only singleton.
@@ -22959,7 +23368,17 @@ var lockControlCapability = {
22959
23368
  * read `state` and disable themselves during `locking`/`unlocking`
22960
23369
  * transitions.
22961
23370
  */
22962
- runtimeState: LockControlStatusSchema
23371
+ runtimeState: LockControlStatusSchema,
23372
+ /**
23373
+ * Runtime-state durability: **restored** — a lock left locked must still read locked.
23374
+ *
23375
+ * See `RuntimeStateDurability`. Enforced by
23376
+ * `scripts/check-runtime-state-durability.ts`.
23377
+ */
23378
+ durability: "restored",
23379
+ /** Clock fields: written, but excluded from the compare that decides
23380
+ * whether persisting is worth a SQLite commit. */
23381
+ volatileStateFields: ["lastChangedAt"]
22963
23382
  };
22964
23383
  /**
22965
23384
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
@@ -23121,7 +23540,14 @@ var mediaPlayerCapability = {
23121
23540
  * full slice for live now-playing, volume, and progress updates
23122
23541
  * without polling.
23123
23542
  */
23124
- runtimeState: MediaPlayerStatusSchema
23543
+ runtimeState: MediaPlayerStatusSchema,
23544
+ /**
23545
+ * Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
23546
+ *
23547
+ * See `RuntimeStateDurability`. Enforced by
23548
+ * `scripts/check-runtime-state-durability.ts`.
23549
+ */
23550
+ durability: "session"
23125
23551
  };
23126
23552
  /**
23127
23553
  * mesh-network — collection cap for mesh-VPN providers.
@@ -23385,7 +23811,14 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
23385
23811
  * `device.state.motion.value`. Reads never invoke the provider, so
23386
23812
  * UIs and other addons can poll the cached state safely.
23387
23813
  */
23388
- runtimeState: MotionStatusSchema
23814
+ runtimeState: MotionStatusSchema,
23815
+ /**
23816
+ * 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.
23817
+ *
23818
+ * See `RuntimeStateDurability`. Enforced by
23819
+ * `scripts/check-runtime-state-durability.ts`.
23820
+ */
23821
+ durability: "session"
23389
23822
  };
23390
23823
  /**
23391
23824
  * Motion-trigger toggle for accessory devices.
@@ -23450,7 +23883,14 @@ var motionTriggerCapability = {
23450
23883
  schema: MotionTriggerStatusSchema,
23451
23884
  kind: "command-driven"
23452
23885
  },
23453
- runtimeState: MotionTriggerRuntimeStateSchema
23886
+ runtimeState: MotionTriggerRuntimeStateSchema,
23887
+ /**
23888
+ * 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.
23889
+ *
23890
+ * See `RuntimeStateDurability`. Enforced by
23891
+ * `scripts/check-runtime-state-durability.ts`.
23892
+ */
23893
+ durability: "session"
23454
23894
  };
23455
23895
  /**
23456
23896
  * Motion-zones share the same MaskShape vocabulary as privacy-mask — the
@@ -23517,7 +23957,17 @@ var motionZonesCapability = {
23517
23957
  schema: MotionZoneStatusSchema,
23518
23958
  kind: "poll"
23519
23959
  },
23520
- runtimeState: MotionZoneStatusSchema
23960
+ runtimeState: MotionZoneStatusSchema,
23961
+ /**
23962
+ * 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.
23963
+ *
23964
+ * See `RuntimeStateDurability`. Enforced by
23965
+ * `scripts/check-runtime-state-durability.ts`.
23966
+ */
23967
+ durability: "restored",
23968
+ /** Clock fields: written, but excluded from the compare that decides
23969
+ * whether persisting is worth a SQLite commit. */
23970
+ volatileStateFields: ["lastFetchedAt"]
23521
23971
  };
23522
23972
  /**
23523
23973
  * On-camera AI object detection cap. Surfaces per-device the classes
@@ -23591,7 +24041,17 @@ var nativeObjectDetectionCapability = {
23591
24041
  schema: NativeObjectDetectionStatusSchema,
23592
24042
  kind: "push"
23593
24043
  },
23594
- runtimeState: NativeObjectDetectionRuntimeStateSchema
24044
+ runtimeState: NativeObjectDetectionRuntimeStateSchema,
24045
+ /**
24046
+ * 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.
24047
+ *
24048
+ * See `RuntimeStateDurability`. Enforced by
24049
+ * `scripts/check-runtime-state-durability.ts`.
24050
+ */
24051
+ durability: "restored",
24052
+ /** Clock fields: written, but excluded from the compare that decides
24053
+ * whether persisting is worth a SQLite commit. */
24054
+ volatileStateFields: ["lastFetchedAt"]
23595
24055
  };
23596
24056
  /**
23597
24057
  * network-quality — system-scoped singleton capability tracking RTT,
@@ -23925,7 +24385,14 @@ onSent: { data: object({
23925
24385
  * form reads `supports` to gate optional fields; history pane reads
23926
24386
  * `lastSentAt` / `lastError` / `queueDepth`.
23927
24387
  */
23928
- runtimeState: NotifierStatusSchema
24388
+ runtimeState: NotifierStatusSchema,
24389
+ /**
24390
+ * Runtime-state durability: **session** — live queue depth and last-send state; a restored queue depth describes a queue that no longer exists.
24391
+ *
24392
+ * See `RuntimeStateDurability`. Enforced by
24393
+ * `scripts/check-runtime-state-durability.ts`.
24394
+ */
24395
+ durability: "session"
23929
24396
  };
23930
24397
  /**
23931
24398
  * Generic numeric sensor — last-resort fallback when no typed numeric
@@ -23968,7 +24435,17 @@ var numericSensorCapability = {
23968
24435
  schema: NumericSensorStatusSchema,
23969
24436
  kind: "push"
23970
24437
  },
23971
- runtimeState: NumericSensorStatusSchema
24438
+ runtimeState: NumericSensorStatusSchema,
24439
+ /**
24440
+ * 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.
24441
+ *
24442
+ * See `RuntimeStateDurability`. Enforced by
24443
+ * `scripts/check-runtime-state-durability.ts`.
24444
+ */
24445
+ durability: "restored",
24446
+ /** Clock fields: written, but excluded from the compare that decides
24447
+ * whether persisting is worth a SQLite commit. */
24448
+ volatileStateFields: ["lastFetchedAt"]
23972
24449
  };
23973
24450
  /**
23974
24451
  * Generic on-screen-display (video overlay) cap. Each camera exposes
@@ -24353,7 +24830,14 @@ var petFeederCapability = {
24353
24830
  * the full slice via `device.state.petFeeder.value` and refresh on
24354
24831
  * every poll without re-querying the provider.
24355
24832
  */
24356
- runtimeState: PetFeederStatusSchema
24833
+ runtimeState: PetFeederStatusSchema,
24834
+ /**
24835
+ * Runtime-state durability: **session** — live appliance state re-published on connect.
24836
+ *
24837
+ * See `RuntimeStateDurability`. Enforced by
24838
+ * `scripts/check-runtime-state-durability.ts`.
24839
+ */
24840
+ durability: "session"
24357
24841
  };
24358
24842
  var VehicleSchema = object({
24359
24843
  id: string(),
@@ -24665,7 +25149,17 @@ var powerMeterCapability = {
24665
25149
  schema: PowerMeterStatusSchema,
24666
25150
  kind: "push"
24667
25151
  },
24668
- runtimeState: PowerMeterStatusSchema
25152
+ runtimeState: PowerMeterStatusSchema,
25153
+ /**
25154
+ * Runtime-state durability: **restored** — as `numeric-sensor`; `kwhTotal` is an accumulator whose restored value is the baseline.
25155
+ *
25156
+ * See `RuntimeStateDurability`. Enforced by
25157
+ * `scripts/check-runtime-state-durability.ts`.
25158
+ */
25159
+ durability: "restored",
25160
+ /** Clock fields: written, but excluded from the compare that decides
25161
+ * whether persisting is worth a SQLite commit. */
25162
+ volatileStateFields: ["lastFetchedAt"]
24669
25163
  };
24670
25164
  /**
24671
25165
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -24722,7 +25216,17 @@ var presenceCapability = {
24722
25216
  * the map pin is rendered (use `DeviceFeature.PresenceGps` for the
24723
25217
  * pre-fetch fast-path check).
24724
25218
  */
24725
- runtimeState: PresenceStatusSchema
25219
+ runtimeState: PresenceStatusSchema,
25220
+ /**
25221
+ * Runtime-state durability: **restored** — occupancy-relevant: the restored state is what an occupancy rule compares the first post-restart observation against.
25222
+ *
25223
+ * See `RuntimeStateDurability`. Enforced by
25224
+ * `scripts/check-runtime-state-durability.ts`.
25225
+ */
25226
+ durability: "restored",
25227
+ /** Clock fields: written, but excluded from the compare that decides
25228
+ * whether persisting is worth a SQLite commit. */
25229
+ volatileStateFields: ["lastChangedAt"]
24726
25230
  };
24727
25231
  /**
24728
25232
  * Atmospheric pressure reading in hectopascals. Drives Home Assistant
@@ -24758,7 +25262,17 @@ var pressureSensorCapability = {
24758
25262
  schema: PressureSensorStatusSchema,
24759
25263
  kind: "push"
24760
25264
  },
24761
- runtimeState: PressureSensorStatusSchema
25265
+ runtimeState: PressureSensorStatusSchema,
25266
+ /**
25267
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
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"]
24762
25276
  };
24763
25277
  /**
24764
25278
  * PRIVACY — what the camera deliberately does not capture. Two planes:
@@ -24888,7 +25402,17 @@ var privacyMaskCapability = {
24888
25402
  schema: PrivacyMaskStatusSchema,
24889
25403
  kind: "poll"
24890
25404
  },
24891
- runtimeState: PrivacyMaskStatusSchema
25405
+ runtimeState: PrivacyMaskStatusSchema,
25406
+ /**
25407
+ * Runtime-state durability: **restored** — operator-drawn regions, zero real churn — 22 writes in 25 minutes, every one of them the clock.
25408
+ *
25409
+ * See `RuntimeStateDurability`. Enforced by
25410
+ * `scripts/check-runtime-state-durability.ts`.
25411
+ */
25412
+ durability: "restored",
25413
+ /** Clock fields: written, but excluded from the compare that decides
25414
+ * whether persisting is worth a SQLite commit. */
25415
+ volatileStateFields: ["lastFetchedAt"]
24892
25416
  };
24893
25417
  var PtzPresetSchema = object({
24894
25418
  id: string(),
@@ -25054,7 +25578,14 @@ var ptzAutotrackCapability = {
25054
25578
  * fetch / cache / fallback logic out of the four cap methods —
25055
25579
  * they become trampolines over `runtimeState`.
25056
25580
  */
25057
- runtimeState: PtzAutotrackRuntimeStateSchema
25581
+ runtimeState: PtzAutotrackRuntimeStateSchema,
25582
+ /**
25583
+ * Runtime-state durability: **session** — mirrors the camera's own autotrack config, re-read on connect.
25584
+ *
25585
+ * See `RuntimeStateDurability`. Enforced by
25586
+ * `scripts/check-runtime-state-durability.ts`.
25587
+ */
25588
+ durability: "session"
25058
25589
  };
25059
25590
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
25060
25591
  kind: "mutation",
@@ -25704,7 +26235,14 @@ var sceneMonitorCapability = {
25704
26235
  schema: SceneMonitorStatusSchema,
25705
26236
  kind: "push"
25706
26237
  },
25707
- runtimeState: SceneMonitorStatusSchema
26238
+ runtimeState: SceneMonitorStatusSchema,
26239
+ /**
26240
+ * Runtime-state durability: **session** — re-derived from the current scene on the next evaluation.
26241
+ *
26242
+ * See `RuntimeStateDurability`. Enforced by
26243
+ * `scripts/check-runtime-state-durability.ts`.
26244
+ */
26245
+ durability: "session"
25708
26246
  };
25709
26247
  /**
25710
26248
  * Per-stage gating mode applied to the zones a rule references.
@@ -25848,7 +26386,14 @@ var scriptRunnerCapability = {
25848
26386
  * `isRunning` to render a spinner during execution and surfaces
25849
26387
  * `lastError` / `lastRunSuccess` in the recent-runs panel.
25850
26388
  */
25851
- runtimeState: ScriptRunnerStatusSchema
26389
+ runtimeState: ScriptRunnerStatusSchema,
26390
+ /**
26391
+ * Runtime-state durability: **session** — a restored `isRunning: true` describes a process that died with the previous hub.
26392
+ *
26393
+ * See `RuntimeStateDurability`. Enforced by
26394
+ * `scripts/check-runtime-state-durability.ts`.
26395
+ */
26396
+ durability: "session"
25852
26397
  };
25853
26398
  /**
25854
26399
  * Smoke alarm sensor — boolean "is smoke currently detected" with
@@ -25875,7 +26420,17 @@ var smokeCapability = {
25875
26420
  schema: SmokeStatusSchema,
25876
26421
  kind: "push"
25877
26422
  },
25878
- runtimeState: SmokeStatusSchema
26423
+ runtimeState: SmokeStatusSchema,
26424
+ /**
26425
+ * Runtime-state durability: **restored** — a safety sensor must not read "clear" merely because the hub restarted.
26426
+ *
26427
+ * See `RuntimeStateDurability`. Enforced by
26428
+ * `scripts/check-runtime-state-durability.ts`.
26429
+ */
26430
+ durability: "restored",
26431
+ /** Clock fields: written, but excluded from the compare that decides
26432
+ * whether persisting is worth a SQLite commit. */
26433
+ volatileStateFields: ["lastChangedAt"]
25879
26434
  };
25880
26435
  /**
25881
26436
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -26048,7 +26603,17 @@ var streamParamsCapability = {
26048
26603
  schema: StreamParamsStatusSchema,
26049
26604
  kind: "poll"
26050
26605
  },
26051
- runtimeState: StreamParamsStatusSchema
26606
+ runtimeState: StreamParamsStatusSchema,
26607
+ /**
26608
+ * Runtime-state durability: **restored** — operator-set encoder profile; mutation-driven.
26609
+ *
26610
+ * See `RuntimeStateDurability`. Enforced by
26611
+ * `scripts/check-runtime-state-durability.ts`.
26612
+ */
26613
+ durability: "restored",
26614
+ /** Clock fields: written, but excluded from the compare that decides
26615
+ * whether persisting is worth a SQLite commit. */
26616
+ volatileStateFields: ["lastFetchedAt"]
26052
26617
  };
26053
26618
  /**
26054
26619
  * Generic on/off switch cap for accessory children (siren, floodlight,
@@ -26094,6 +26659,16 @@ var switchCapability = {
26094
26659
  * not need to re-query the provider after a setState mutation.
26095
26660
  */
26096
26661
  runtimeState: SwitchStatusSchema,
26662
+ /**
26663
+ * Runtime-state durability: **restored** — device state an operator reads as authoritative; 55 devices, transition-driven.
26664
+ *
26665
+ * See `RuntimeStateDurability`. Enforced by
26666
+ * `scripts/check-runtime-state-durability.ts`.
26667
+ */
26668
+ durability: "restored",
26669
+ /** Clock fields: written, but excluded from the compare that decides
26670
+ * whether persisting is worth a SQLite commit. */
26671
+ volatileStateFields: ["lastChangedAt"],
26097
26672
  settings: { bindings: [{
26098
26673
  kind: "scalar",
26099
26674
  statusPath: "on",
@@ -26173,7 +26748,17 @@ var tamperCapability = {
26173
26748
  schema: TamperStatusSchema,
26174
26749
  kind: "push"
26175
26750
  },
26176
- runtimeState: TamperStatusSchema
26751
+ runtimeState: TamperStatusSchema,
26752
+ /**
26753
+ * Runtime-state durability: **restored** — as `smoke`.
26754
+ *
26755
+ * See `RuntimeStateDurability`. Enforced by
26756
+ * `scripts/check-runtime-state-durability.ts`.
26757
+ */
26758
+ durability: "restored",
26759
+ /** Clock fields: written, but excluded from the compare that decides
26760
+ * whether persisting is worth a SQLite commit. */
26761
+ volatileStateFields: ["lastChangedAt"]
26177
26762
  };
26178
26763
  /**
26179
26764
  * Single-metric temperature reading. Drives Home Assistant `sensor`
@@ -26218,7 +26803,17 @@ var temperatureSensorCapability = {
26218
26803
  schema: TemperatureSensorStatusSchema,
26219
26804
  kind: "push"
26220
26805
  },
26221
- runtimeState: TemperatureSensorStatusSchema
26806
+ runtimeState: TemperatureSensorStatusSchema,
26807
+ /**
26808
+ * Runtime-state durability: **restored** — as `numeric-sensor` (69 of 125 writes were the clock alone).
26809
+ *
26810
+ * See `RuntimeStateDurability`. Enforced by
26811
+ * `scripts/check-runtime-state-durability.ts`.
26812
+ */
26813
+ durability: "restored",
26814
+ /** Clock fields: written, but excluded from the compare that decides
26815
+ * whether persisting is worth a SQLite commit. */
26816
+ volatileStateFields: ["lastFetchedAt"]
26222
26817
  };
26223
26818
  /**
26224
26819
  * toast — system-scoped singleton capability that streams toast
@@ -26287,7 +26882,14 @@ var updateCapability = {
26287
26882
  schema: UpdateStatusSchema,
26288
26883
  kind: "poll"
26289
26884
  },
26290
- runtimeState: UpdateStatusSchema
26885
+ runtimeState: UpdateStatusSchema,
26886
+ /**
26887
+ * Runtime-state durability: **session** — a restored `inProgress: true` describes an update that is no longer running; versions are re-probed at boot.
26888
+ *
26889
+ * See `RuntimeStateDurability`. Enforced by
26890
+ * `scripts/check-runtime-state-durability.ts`.
26891
+ */
26892
+ durability: "session"
26291
26893
  };
26292
26894
  var UserSummarySchema = object({
26293
26895
  id: string(),
@@ -26621,7 +27223,14 @@ var vacuumControlCapability = {
26621
27223
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26622
27224
  * slice for live state + battery + fan-speed changes.
26623
27225
  */
26624
- runtimeState: VacuumControlStatusSchema
27226
+ runtimeState: VacuumControlStatusSchema,
27227
+ /**
27228
+ * Runtime-state durability: **session** — as `media-player` — a restored `state: cleaning` is a robot that is not cleaning.
27229
+ *
27230
+ * See `RuntimeStateDurability`. Enforced by
27231
+ * `scripts/check-runtime-state-durability.ts`.
27232
+ */
27233
+ durability: "session"
26625
27234
  };
26626
27235
  var ValveStatusSchema = object({
26627
27236
  /** Lifecycle state of the valve. */
@@ -26673,7 +27282,14 @@ var valveCapability = {
26673
27282
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26674
27283
  * slice for live position changes during a move.
26675
27284
  */
26676
- runtimeState: ValveStatusSchema
27285
+ runtimeState: ValveStatusSchema,
27286
+ /**
27287
+ * Runtime-state durability: **session** — as `brightness`.
27288
+ *
27289
+ * See `RuntimeStateDurability`. Enforced by
27290
+ * `scripts/check-runtime-state-durability.ts`.
27291
+ */
27292
+ durability: "session"
26677
27293
  };
26678
27294
  /**
26679
27295
  * Vibration / shake / impact sensor. Drives Home Assistant
@@ -26695,7 +27311,17 @@ var vibrationCapability = {
26695
27311
  schema: VibrationStatusSchema,
26696
27312
  kind: "push"
26697
27313
  },
26698
- runtimeState: VibrationStatusSchema
27314
+ runtimeState: VibrationStatusSchema,
27315
+ /**
27316
+ * Runtime-state durability: **restored** — as `smoke`.
27317
+ *
27318
+ * See `RuntimeStateDurability`. Enforced by
27319
+ * `scripts/check-runtime-state-durability.ts`.
27320
+ */
27321
+ durability: "restored",
27322
+ /** Clock fields: written, but excluded from the compare that decides
27323
+ * whether persisting is worth a SQLite commit. */
27324
+ volatileStateFields: ["lastChangedAt"]
26699
27325
  };
26700
27326
  /**
26701
27327
  * Water heater / boiler cap. Models HA `water_heater.*` entities — a
@@ -26769,7 +27395,14 @@ var waterHeaterCapability = {
26769
27395
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26770
27396
  * slice for live temperature / mode / away changes.
26771
27397
  */
26772
- runtimeState: WaterHeaterStatusSchema
27398
+ runtimeState: WaterHeaterStatusSchema,
27399
+ /**
27400
+ * Runtime-state durability: **session** — as `climate-control`.
27401
+ *
27402
+ * See `RuntimeStateDurability`. Enforced by
27403
+ * `scripts/check-runtime-state-durability.ts`.
27404
+ */
27405
+ durability: "session"
26773
27406
  };
26774
27407
  /**
26775
27408
  * Weather provider cap. Models HA `weather.*` entities — a read-only
@@ -26828,7 +27461,14 @@ var weatherCapability = {
26828
27461
  * Runtime-state slice — mirrored by the kernel. The UI reads the
26829
27462
  * current conditions directly from the slice on each weather push.
26830
27463
  */
26831
- runtimeState: WeatherStatusSchema
27464
+ runtimeState: WeatherStatusSchema,
27465
+ /**
27466
+ * Runtime-state durability: **session** — a forecast is stale the moment the hub is down; the provider re-fetches on connect.
27467
+ *
27468
+ * See `RuntimeStateDurability`. Enforced by
27469
+ * `scripts/check-runtime-state-durability.ts`.
27470
+ */
27471
+ durability: "session"
26832
27472
  };
26833
27473
  /**
26834
27474
  * Per-zone occupancy aggregation produced by the analytics frame
@@ -26990,7 +27630,14 @@ var zoneAnalyticsCapability = {
26990
27630
  * automatically; the explicit `getCurrentSnapshot` cap method is
26991
27631
  * still useful for one-off polls without a subscription.
26992
27632
  */
26993
- runtimeState: CameraOccupancySnapshotSchema
27633
+ runtimeState: CameraOccupancySnapshotSchema,
27634
+ /**
27635
+ * Runtime-state durability: **session** — per-frame analytics; with `audio-metrics` it is ~90 % of the offered write rate. Re-derived on the next frame.
27636
+ *
27637
+ * See `RuntimeStateDurability`. Enforced by
27638
+ * `scripts/check-runtime-state-durability.ts`.
27639
+ */
27640
+ durability: "session"
26994
27641
  };
26995
27642
  /**
26996
27643
  * Stages a {@link ZoneRule} can apply to. Discriminator on the rules
@@ -27068,7 +27715,14 @@ var zoneRulesCapability = {
27068
27715
  motion: array(ZoneRuleSchema).readonly(),
27069
27716
  detection: array(ZoneRuleSchema).readonly(),
27070
27717
  package: array(ZoneRuleSchema).readonly()
27071
- })
27718
+ }),
27719
+ /**
27720
+ * Runtime-state durability: **restored** — operator intent, mutation-only, same argument as `zones`.
27721
+ *
27722
+ * See `RuntimeStateDurability`. Enforced by
27723
+ * `scripts/check-runtime-state-durability.ts`.
27724
+ */
27725
+ durability: "restored"
27072
27726
  };
27073
27727
  /**
27074
27728
  * Accessory device helpers — shared across drivers.
@@ -33755,6 +34409,7 @@ Object.freeze({
33755
34409
  "network-access": "ingress",
33756
34410
  "smtp-provider": "email"
33757
34411
  });
34412
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
33758
34413
  new Set(["devices", "classes"]);
33759
34414
  /**
33760
34415
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.