@camstack/addon-provider-dreame 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 +723 -95
  2. package/dist/addon.mjs +723 -95
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -61276,7 +61276,14 @@ var cameraStreamsCapability = {
61276
61276
  low: string().optional()
61277
61277
  }),
61278
61278
  lastChangedAt: number()
61279
- })
61279
+ }),
61280
+ /**
61281
+ * 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.
61282
+ *
61283
+ * See `RuntimeStateDurability`. Enforced by
61284
+ * `scripts/check-runtime-state-durability.ts`.
61285
+ */
61286
+ durability: "session"
61280
61287
  };
61281
61288
  /** Where a block runs. The operator chooses — a block driving a device on an
61282
61289
  * agent is the reason placement is not fixed to the hub. */
@@ -61837,6 +61844,13 @@ var deviceDiscoveryCapability = {
61837
61844
  kind: "poll"
61838
61845
  },
61839
61846
  runtimeState: DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: number().int().nonnegative() }),
61847
+ /**
61848
+ * Runtime-state durability: **session** — 5.7 KB of scan output on the largest device, fully re-derivable by re-scanning.
61849
+ *
61850
+ * See `RuntimeStateDurability`. Enforced by
61851
+ * `scripts/check-runtime-state-durability.ts`.
61852
+ */
61853
+ durability: "session",
61840
61854
  methods: {
61841
61855
  /**
61842
61856
  * Snapshot of the current `discovered` list. Returns the
@@ -63753,7 +63767,23 @@ var NotificationActionSchema = object({
63753
63767
  * else — see `notification-center/action-token.ts` for what that does and
63754
63768
  * does not buy.
63755
63769
  */
63756
- destructive: boolean().optional()
63770
+ destructive: boolean().optional(),
63771
+ /**
63772
+ * How the tap should REACH the url.
63773
+ *
63774
+ * `navigate` (absent, and every button authored before this field) opens it:
63775
+ * the phone leaves the notification and shows whatever the callback returns.
63776
+ * That is right for a button whose answer the operator wants to read.
63777
+ *
63778
+ * `background` fires it as a POST and stays put. It exists for the buttons
63779
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
63780
+ * an answer to the notification, and being thrown into a browser tab to
63781
+ * confirm it costs more attention than the notification did. A backend that
63782
+ * cannot do a background call renders it as an ordinary link (the adapters
63783
+ * fall back rather than dropping the button), so this is a preference, never
63784
+ * a requirement.
63785
+ */
63786
+ mode: _enum(["navigate", "background"]).optional()
63757
63787
  });
63758
63788
  /**
63759
63789
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -64605,7 +64635,17 @@ var alarmPanelCapability = {
64605
64635
  * full slice; renders an arm button per `availableModes` entry and
64606
64636
  * a PIN field iff `requiresCode === true`.
64607
64637
  */
64608
- runtimeState: AlarmPanelStatusSchema
64638
+ runtimeState: AlarmPanelStatusSchema,
64639
+ /**
64640
+ * Runtime-state durability: **restored** — armed state is the one thing a panel must not lose across a restart.
64641
+ *
64642
+ * See `RuntimeStateDurability`. Enforced by
64643
+ * `scripts/check-runtime-state-durability.ts`.
64644
+ */
64645
+ durability: "restored",
64646
+ /** Clock fields: written, but excluded from the compare that decides
64647
+ * whether persisting is worth a SQLite commit. */
64648
+ volatileStateFields: ["lastChangedAt"]
64609
64649
  };
64610
64650
  /**
64611
64651
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
@@ -64782,6 +64822,9 @@ var NcSystemEventConditionSchema = object({
64782
64822
  nodeIds: array(string().min(1)).min(1).optional(),
64783
64823
  packageNames: array(string().min(1)).min(1).optional()
64784
64824
  });
64825
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
64826
+ * outage the operator asked for once and forgot. */
64827
+ var NC_SNOOZE_MAX_MINUTES = 1440;
64785
64828
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
64786
64829
  var NcScheduleSchema = object({
64787
64830
  windows: array(object({
@@ -65158,15 +65201,15 @@ var NcConditionsSchema = object({
65158
65201
  * (an `immediate` rule naming an `audio-*` class, one notification per
65159
65202
  * classified sample) stays exactly as it was for rules that already use it.
65160
65203
  *
65161
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
65162
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
65163
- * (`camstack/src/data/notification-center.ts`, guarded by
65164
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
65204
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
65205
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
65206
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
65207
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
65165
65208
  * condition fields it does not know when a rule is saved from the phone.
65166
65209
  * Publishing an editor for a condition the app cannot round-trip is how an
65167
- * operator loses a rule's conditions by opening it — so the descriptor, the
65168
- * admin widget and the viewer mirror land together (P2 + P3), and only then
65169
- * does an audio rule become authorable.
65210
+ * operator loses a rule's conditions by opening it — so the viewer mirror
65211
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
65212
+ * follows here.
65170
65213
  */
65171
65214
  audio: NcAudioConditionSchema.optional()
65172
65215
  });
@@ -65402,6 +65445,30 @@ var NcRuleInputSchema = object({
65402
65445
  */
65403
65446
  snoozeAllowGlobal: boolean().optional(),
65404
65447
  /**
65448
+ * The snooze durations THIS rule's notification offers as buttons, in
65449
+ * minutes.
65450
+ *
65451
+ * Three states, and all three are distinct — which is exactly why this is
65452
+ * `.optional()` and never `.default()`. A Zod default does not run on the
65453
+ * addon cap path (three production failures in one day), so a schema default
65454
+ * would collapse the first two:
65455
+ *
65456
+ * | value | meaning |
65457
+ * | --- | --- |
65458
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
65459
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
65460
+ * | a list | these choices, de-duplicated and sorted, at most four |
65461
+ *
65462
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
65463
+ * three buttons in total) and a rule that spent it all on snooze choices
65464
+ * would push its own tap-through actions off the notification.
65465
+ *
65466
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
65467
+ * that arms the panel, is exempt automatically and cannot be silenced by a
65468
+ * window from anywhere (D133).
65469
+ */
65470
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
65471
+ /**
65405
65472
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
65406
65473
  *
65407
65474
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -65501,6 +65568,7 @@ var NcConditionDescriptorSchema = object({
65501
65568
  "device",
65502
65569
  "package",
65503
65570
  "occupancy",
65571
+ "audio",
65504
65572
  "system"
65505
65573
  ]),
65506
65574
  label: string(),
@@ -65519,6 +65587,7 @@ var NcConditionDescriptorSchema = object({
65519
65587
  "crossingSelect",
65520
65588
  "polygonDraw",
65521
65589
  "occupancy",
65590
+ "audio",
65522
65591
  "deviceState",
65523
65592
  "systemEvent"
65524
65593
  ]),
@@ -65670,7 +65739,20 @@ var NcSnoozeInputSchema = object({
65670
65739
  ruleId: string().optional(),
65671
65740
  /** Required when `scope: 'device'`. */
65672
65741
  deviceId: number().int().optional(),
65673
- durationMinutes: number().int().min(1).max(1440),
65742
+ /**
65743
+ * Narrow the window to these subject classes — "the cat, not the person".
65744
+ *
65745
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
65746
+ * what every window authored before this field meant, so no persisted row
65747
+ * changes meaning and no client has to learn anything to keep working.
65748
+ *
65749
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
65750
+ * cross rules (D133): the operator points at a camera and a kind of thing,
65751
+ * not at whichever of their four rules happened to produce the notification
65752
+ * they are dismissing.
65753
+ */
65754
+ classes: array(string().min(1)).min(1).optional(),
65755
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
65674
65756
  /**
65675
65757
  * Silence this for EVERY recipient, not just the caller. Permission is
65676
65758
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -65695,6 +65777,10 @@ var NcSnoozeSchema = object({
65695
65777
  scope: NcSnoozeScopeSchema,
65696
65778
  ruleId: string().optional(),
65697
65779
  deviceId: number().int().optional(),
65780
+ /** Subject classes this window covers. ABSENT = every class — see
65781
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
65782
+ * no SQLite column: nothing queries a window by class. */
65783
+ classes: array(string().min(1)).min(1).optional(),
65698
65784
  startedAt: number(),
65699
65785
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
65700
65786
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -67795,7 +67881,14 @@ var zonesCapability = {
67795
67881
  * handle. Slice shape is `{ zones: Zone[] }` so future extensions
67796
67882
  * (e.g. zone groupings) can sit alongside the polygon list.
67797
67883
  */
67798
- runtimeState: object({ zones: array(ZoneSchema).readonly() })
67884
+ runtimeState: object({ zones: array(ZoneSchema).readonly() }),
67885
+ /**
67886
+ * 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.
67887
+ *
67888
+ * See `RuntimeStateDurability`. Enforced by
67889
+ * `scripts/check-runtime-state-durability.ts`.
67890
+ */
67891
+ durability: "restored"
67799
67892
  };
67800
67893
  /**
67801
67894
  * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
@@ -70594,7 +70687,17 @@ var airQualitySensorCapability = {
70594
70687
  schema: AirQualitySensorStatusSchema,
70595
70688
  kind: "push"
70596
70689
  },
70597
- runtimeState: AirQualitySensorStatusSchema
70690
+ runtimeState: AirQualitySensorStatusSchema,
70691
+ /**
70692
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
70693
+ *
70694
+ * See `RuntimeStateDurability`. Enforced by
70695
+ * `scripts/check-runtime-state-durability.ts`.
70696
+ */
70697
+ durability: "restored",
70698
+ /** Clock fields: written, but excluded from the compare that decides
70699
+ * whether persisting is worth a SQLite commit. */
70700
+ volatileStateFields: ["lastFetchedAt"]
70598
70701
  };
70599
70702
  /**
70600
70703
  * Ambient illuminance reading in lux. Drives Home Assistant `sensor`
@@ -70626,7 +70729,17 @@ var ambientLightSensorCapability = {
70626
70729
  schema: AmbientLightSensorStatusSchema,
70627
70730
  kind: "push"
70628
70731
  },
70629
- runtimeState: AmbientLightSensorStatusSchema
70732
+ runtimeState: AmbientLightSensorStatusSchema,
70733
+ /**
70734
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
70735
+ *
70736
+ * See `RuntimeStateDurability`. Enforced by
70737
+ * `scripts/check-runtime-state-durability.ts`.
70738
+ */
70739
+ durability: "restored",
70740
+ /** Clock fields: written, but excluded from the compare that decides
70741
+ * whether persisting is worth a SQLite commit. */
70742
+ volatileStateFields: ["lastFetchedAt"]
70630
70743
  };
70631
70744
  /**
70632
70745
  * Per-class audio metrics aggregated over a sliding window.
@@ -70744,7 +70857,14 @@ var audioMetricsCapability = {
70744
70857
  }), AudioMetricsHistorySchema)
70745
70858
  },
70746
70859
  /** Reactive runtime-state mirror — live `device.state.audioMetrics.value`. */
70747
- runtimeState: AudioMetricsSnapshotSchema
70860
+ runtimeState: AudioMetricsSnapshotSchema,
70861
+ /**
70862
+ * 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.
70863
+ *
70864
+ * See `RuntimeStateDurability`. Enforced by
70865
+ * `scripts/check-runtime-state-durability.ts`.
70866
+ */
70867
+ durability: "session"
70748
70868
  };
70749
70869
  /**
70750
70870
  * Automation-control cap. Models HA `automation.*` entities on
@@ -70806,7 +70926,14 @@ var automationControlCapability = {
70806
70926
  * reads `enabled` (toggle) + `isRunning` (spinner) + `lastError`
70807
70927
  * (badge) directly.
70808
70928
  */
70809
- runtimeState: AutomationControlStatusSchema
70929
+ runtimeState: AutomationControlStatusSchema,
70930
+ /**
70931
+ * 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.
70932
+ *
70933
+ * See `RuntimeStateDurability`. Enforced by
70934
+ * `scripts/check-runtime-state-durability.ts`.
70935
+ */
70936
+ durability: "session"
70810
70937
  };
70811
70938
  /**
70812
70939
  * Battery status snapshot. Emitted by providers whose device is
@@ -70912,7 +71039,17 @@ onStatusChanged: { data: object({
70912
71039
  * via `device.runtimeState.getCapState('battery')` regardless of
70913
71040
  * the underlying driver.
70914
71041
  */
70915
- runtimeState: BatteryStatusSchema
71042
+ runtimeState: BatteryStatusSchema,
71043
+ /**
71044
+ * 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.
71045
+ *
71046
+ * See `RuntimeStateDurability`. Enforced by
71047
+ * `scripts/check-runtime-state-durability.ts`.
71048
+ */
71049
+ durability: "restored",
71050
+ /** Clock fields: written, but excluded from the compare that decides
71051
+ * whether persisting is worth a SQLite commit. */
71052
+ volatileStateFields: ["lastUpdated"]
70916
71053
  };
70917
71054
  /**
70918
71055
  * Generic boolean sensor — last-resort fallback when no domain-
@@ -70941,7 +71078,17 @@ var binaryCapability = {
70941
71078
  schema: BinaryStatusSchema,
70942
71079
  kind: "push"
70943
71080
  },
70944
- runtimeState: BinaryStatusSchema
71081
+ runtimeState: BinaryStatusSchema,
71082
+ /**
71083
+ * Runtime-state durability: **restored** — transition-driven sensor state; the restored value gives the boot comparison.
71084
+ *
71085
+ * See `RuntimeStateDurability`. Enforced by
71086
+ * `scripts/check-runtime-state-durability.ts`.
71087
+ */
71088
+ durability: "restored",
71089
+ /** Clock fields: written, but excluded from the compare that decides
71090
+ * whether persisting is worth a SQLite commit. */
71091
+ volatileStateFields: ["lastChangedAt"]
70945
71092
  };
70946
71093
  /**
70947
71094
  * Dimmable-light brightness control. Co-exists with `switch` on the
@@ -70994,7 +71141,14 @@ onBrightnessChanged: { data: object({
70994
71141
  * by the kernel. Read via `device.state.brightness.value` so UI
70995
71142
  * sliders surface the current level without polling the provider.
70996
71143
  */
70997
- runtimeState: BrightnessStatusSchema
71144
+ runtimeState: BrightnessStatusSchema,
71145
+ /**
71146
+ * Runtime-state durability: **session** — live lamp state, re-published by the provider on connect.
71147
+ *
71148
+ * See `RuntimeStateDurability`. Enforced by
71149
+ * `scripts/check-runtime-state-durability.ts`.
71150
+ */
71151
+ durability: "session"
70998
71152
  };
70999
71153
  /**
71000
71154
  * button — device-scoped capability for HA `button.*` / `input_button.*`
@@ -71099,7 +71253,17 @@ var carbonMonoxideCapability = {
71099
71253
  schema: CarbonMonoxideStatusSchema,
71100
71254
  kind: "push"
71101
71255
  },
71102
- runtimeState: CarbonMonoxideStatusSchema
71256
+ runtimeState: CarbonMonoxideStatusSchema,
71257
+ /**
71258
+ * Runtime-state durability: **restored** — as `smoke`.
71259
+ *
71260
+ * See `RuntimeStateDurability`. Enforced by
71261
+ * `scripts/check-runtime-state-durability.ts`.
71262
+ */
71263
+ durability: "restored",
71264
+ /** Clock fields: written, but excluded from the compare that decides
71265
+ * whether persisting is worth a SQLite commit. */
71266
+ volatileStateFields: ["lastChangedAt"]
71103
71267
  };
71104
71268
  /**
71105
71269
  * HVAC / climate control cap. Models the full surface of a HA
@@ -71259,7 +71423,14 @@ var climateControlCapability = {
71259
71423
  * the full slice via `device.state.climate-control.value` and refresh
71260
71424
  * on every push without re-querying the provider.
71261
71425
  */
71262
- runtimeState: ClimateControlStatusSchema
71426
+ runtimeState: ClimateControlStatusSchema,
71427
+ /**
71428
+ * Runtime-state durability: **session** — as `brightness`; `currentTemp` moves continuously and is re-published on connect.
71429
+ *
71430
+ * See `RuntimeStateDurability`. Enforced by
71431
+ * `scripts/check-runtime-state-durability.ts`.
71432
+ */
71433
+ durability: "session"
71263
71434
  };
71264
71435
  /**
71265
71436
  * Color-light cap. Coexists with `switch` (on/off) and `brightness`
@@ -71369,7 +71540,14 @@ onColorChanged: { data: object({
71369
71540
  * kernel. Read via `device.state.color.value` so UI pickers surface
71370
71541
  * the current chromaticity without polling the provider.
71371
71542
  */
71372
- runtimeState: ColorStatusSchema
71543
+ runtimeState: ColorStatusSchema,
71544
+ /**
71545
+ * Runtime-state durability: **session** — as `brightness`.
71546
+ *
71547
+ * See `RuntimeStateDurability`. Enforced by
71548
+ * `scripts/check-runtime-state-durability.ts`.
71549
+ */
71550
+ durability: "session"
71373
71551
  };
71374
71552
  var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
71375
71553
  object({
@@ -71435,7 +71613,17 @@ var connectivityCapability = {
71435
71613
  schema: ConnectivityStatusSchema,
71436
71614
  kind: "push"
71437
71615
  },
71438
- runtimeState: ConnectivityStatusSchema
71616
+ runtimeState: ConnectivityStatusSchema,
71617
+ /**
71618
+ * Runtime-state durability: **restored** — same shape and same argument as `device-status`, for links rather than devices.
71619
+ *
71620
+ * See `RuntimeStateDurability`. Enforced by
71621
+ * `scripts/check-runtime-state-durability.ts`.
71622
+ */
71623
+ durability: "restored",
71624
+ /** Clock fields: written, but excluded from the compare that decides
71625
+ * whether persisting is worth a SQLite commit. */
71626
+ volatileStateFields: ["lastChangedAt"]
71439
71627
  };
71440
71628
  /**
71441
71629
  * Generic device-consumables capability — surfaces a device's
@@ -71517,7 +71705,14 @@ reset: method(object({
71517
71705
  }
71518
71706
  }
71519
71707
  },
71520
- runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() })
71708
+ runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() }),
71709
+ /**
71710
+ * Runtime-state durability: **session** — the authority is the appliance; the provider re-reads the whole item array on connect.
71711
+ *
71712
+ * See `RuntimeStateDurability`. Enforced by
71713
+ * `scripts/check-runtime-state-durability.ts`.
71714
+ */
71715
+ durability: "session"
71521
71716
  };
71522
71717
  /**
71523
71718
  * Door / window / opening / garage / valve contact sensor. Boolean
@@ -71548,7 +71743,17 @@ var contactCapability = {
71548
71743
  schema: ContactStatusSchema,
71549
71744
  kind: "push"
71550
71745
  },
71551
- runtimeState: ContactStatusSchema
71746
+ runtimeState: ContactStatusSchema,
71747
+ /**
71748
+ * Runtime-state durability: **restored** — a door left open across a restart must still read open.
71749
+ *
71750
+ * See `RuntimeStateDurability`. Enforced by
71751
+ * `scripts/check-runtime-state-durability.ts`.
71752
+ */
71753
+ durability: "restored",
71754
+ /** Clock fields: written, but excluded from the compare that decides
71755
+ * whether persisting is worth a SQLite commit. */
71756
+ volatileStateFields: ["lastChangedAt"]
71552
71757
  };
71553
71758
  /**
71554
71759
  * Status slice — flat object (the framework's `runtimeState` contract
@@ -71654,7 +71859,14 @@ var controlCapability = {
71654
71859
  * dropdown / text field / date picker) read the slice's discriminant
71655
71860
  * and value directly without polling the provider.
71656
71861
  */
71657
- runtimeState: ControlStatusSchema
71862
+ runtimeState: ControlStatusSchema,
71863
+ /**
71864
+ * Runtime-state durability: **session** — a generic control mirrors an external entity that re-publishes on connect; the options array is re-derived with it.
71865
+ *
71866
+ * See `RuntimeStateDurability`. Enforced by
71867
+ * `scripts/check-runtime-state-durability.ts`.
71868
+ */
71869
+ durability: "session"
71658
71870
  };
71659
71871
  var CoverStatusSchema = object({
71660
71872
  /** Lifecycle state of the cover. */
@@ -71715,7 +71927,17 @@ var coverCapability = {
71715
71927
  * Runtime-state slice — mirrored by the kernel. UI controls watch
71716
71928
  * the slice for live position changes during a move.
71717
71929
  */
71718
- runtimeState: CoverStatusSchema
71930
+ runtimeState: CoverStatusSchema,
71931
+ /**
71932
+ * Runtime-state durability: **restored** — position survives a restart on the device; the mirror should agree at boot rather than read blank.
71933
+ *
71934
+ * See `RuntimeStateDurability`. Enforced by
71935
+ * `scripts/check-runtime-state-durability.ts`.
71936
+ */
71937
+ durability: "restored",
71938
+ /** Clock fields: written, but excluded from the compare that decides
71939
+ * whether persisting is worth a SQLite commit. */
71940
+ volatileStateFields: ["lastChangedAt"]
71719
71941
  };
71720
71942
  /**
71721
71943
  * Vendor-neutral day/night (IR-cut) control — the per-camera config cap
@@ -71809,7 +72031,17 @@ var dayNightCapability = {
71809
72031
  schema: DayNightStatusSchema,
71810
72032
  kind: "poll"
71811
72033
  },
71812
- runtimeState: DayNightStatusSchema
72034
+ runtimeState: DayNightStatusSchema,
72035
+ /**
72036
+ * Runtime-state durability: **restored** — operator-set IR-cut behaviour; mutation-driven.
72037
+ *
72038
+ * See `RuntimeStateDurability`. Enforced by
72039
+ * `scripts/check-runtime-state-durability.ts`.
72040
+ */
72041
+ durability: "restored",
72042
+ /** Clock fields: written, but excluded from the compare that decides
72043
+ * whether persisting is worth a SQLite commit. */
72044
+ volatileStateFields: ["lastFetchedAt"]
71813
72045
  };
71814
72046
  /**
71815
72047
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
@@ -71856,7 +72088,17 @@ onStatusChanged: { data: object({
71856
72088
  schema: DeviceStatusSchema,
71857
72089
  kind: "push"
71858
72090
  },
71859
- runtimeState: DeviceStatusSchema
72091
+ runtimeState: DeviceStatusSchema,
72092
+ /**
72093
+ * 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.
72094
+ *
72095
+ * See `RuntimeStateDurability`. Enforced by
72096
+ * `scripts/check-runtime-state-durability.ts`.
72097
+ */
72098
+ durability: "restored",
72099
+ /** Clock fields: written, but excluded from the compare that decides
72100
+ * whether persisting is worth a SQLite commit. */
72101
+ volatileStateFields: ["lastChangedAt"]
71860
72102
  };
71861
72103
  /**
71862
72104
  * Doorbell button cap. Two kinds of providers coexist behind this cap
@@ -71918,7 +72160,14 @@ onPressed: { data: DoorbellPressEventSchema } },
71918
72160
  * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
71919
72161
  * without subscribing.
71920
72162
  */
71921
- runtimeState: DoorbellStatusSchema
72163
+ runtimeState: DoorbellStatusSchema,
72164
+ /**
72165
+ * 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.
72166
+ *
72167
+ * See `RuntimeStateDurability`. Enforced by
72168
+ * `scripts/check-runtime-state-durability.ts`.
72169
+ */
72170
+ durability: "restored"
71922
72171
  };
71923
72172
  /**
71924
72173
  * Enum-state sensor — a string value picked from a finite option set.
@@ -71958,7 +72207,17 @@ var enumSensorCapability = {
71958
72207
  schema: EnumSensorStatusSchema,
71959
72208
  kind: "push"
71960
72209
  },
71961
- runtimeState: EnumSensorStatusSchema
72210
+ runtimeState: EnumSensorStatusSchema,
72211
+ /**
72212
+ * Runtime-state durability: **restored** — as `numeric-sensor`; 80 devices.
72213
+ *
72214
+ * See `RuntimeStateDurability`. Enforced by
72215
+ * `scripts/check-runtime-state-durability.ts`.
72216
+ */
72217
+ durability: "restored",
72218
+ /** Clock fields: written, but excluded from the compare that decides
72219
+ * whether persisting is worth a SQLite commit. */
72220
+ volatileStateFields: ["lastFetchedAt"]
71962
72221
  };
71963
72222
  /**
71964
72223
  * Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
@@ -71994,7 +72253,14 @@ var eventEmitterCapability = {
71994
72253
  schema: EventEmitterStatusSchema,
71995
72254
  kind: "push"
71996
72255
  },
71997
- runtimeState: EventEmitterStatusSchema
72256
+ runtimeState: EventEmitterStatusSchema,
72257
+ /**
72258
+ * Runtime-state durability: **session** — `eventCountSinceStart` names its own scope.
72259
+ *
72260
+ * See `RuntimeStateDurability`. Enforced by
72261
+ * `scripts/check-runtime-state-durability.ts`.
72262
+ */
72263
+ durability: "session"
71998
72264
  };
71999
72265
  var EventItemSchema = object({
72000
72266
  id: string(),
@@ -72275,7 +72541,14 @@ var fanControlCapability = {
72275
72541
  * Runtime-state slice — mirrored by the kernel. UI fan speed
72276
72542
  * sliders read `percentage` for live updates.
72277
72543
  */
72278
- runtimeState: FanControlStatusSchema
72544
+ runtimeState: FanControlStatusSchema,
72545
+ /**
72546
+ * Runtime-state durability: **session** — as `brightness`.
72547
+ *
72548
+ * See `RuntimeStateDurability`. Enforced by
72549
+ * `scripts/check-runtime-state-durability.ts`.
72550
+ */
72551
+ durability: "session"
72279
72552
  };
72280
72553
  /**
72281
72554
  * Per-device feature/identity probe slice. Holds the runtime-resolved
@@ -72351,7 +72624,14 @@ onProbeChanged: { data: object({
72351
72624
  schema: FeatureProbeStatusSchema,
72352
72625
  kind: "push"
72353
72626
  },
72354
- runtimeState: FeatureProbeStatusSchema
72627
+ runtimeState: FeatureProbeStatusSchema,
72628
+ /**
72629
+ * 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.
72630
+ *
72631
+ * See `RuntimeStateDurability`. Enforced by
72632
+ * `scripts/check-runtime-state-durability.ts`.
72633
+ */
72634
+ durability: "session"
72355
72635
  };
72356
72636
  /**
72357
72637
  * Water leak / moisture sensor. Boolean "is liquid currently
@@ -72378,7 +72658,17 @@ var floodCapability = {
72378
72658
  schema: FloodStatusSchema,
72379
72659
  kind: "push"
72380
72660
  },
72381
- runtimeState: FloodStatusSchema
72661
+ runtimeState: FloodStatusSchema,
72662
+ /**
72663
+ * Runtime-state durability: **restored** — as `smoke`.
72664
+ *
72665
+ * See `RuntimeStateDurability`. Enforced by
72666
+ * `scripts/check-runtime-state-durability.ts`.
72667
+ */
72668
+ durability: "restored",
72669
+ /** Clock fields: written, but excluded from the compare that decides
72670
+ * whether persisting is worth a SQLite commit. */
72671
+ volatileStateFields: ["lastChangedAt"]
72382
72672
  };
72383
72673
  /**
72384
72674
  * Combustible-gas (LPG / methane / hydrogen) alarm sensor. Drives
@@ -72401,7 +72691,17 @@ var gasCapability = {
72401
72691
  schema: GasStatusSchema,
72402
72692
  kind: "push"
72403
72693
  },
72404
- runtimeState: GasStatusSchema
72694
+ runtimeState: GasStatusSchema,
72695
+ /**
72696
+ * Runtime-state durability: **restored** — as `smoke`.
72697
+ *
72698
+ * See `RuntimeStateDurability`. Enforced by
72699
+ * `scripts/check-runtime-state-durability.ts`.
72700
+ */
72701
+ durability: "restored",
72702
+ /** Clock fields: written, but excluded from the compare that decides
72703
+ * whether persisting is worth a SQLite commit. */
72704
+ volatileStateFields: ["lastChangedAt"]
72405
72705
  };
72406
72706
  /**
72407
72707
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
@@ -72477,7 +72777,14 @@ var humidifierCapability = {
72477
72777
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
72478
72778
  * slice for live humidity / mode changes.
72479
72779
  */
72480
- runtimeState: HumidifierStatusSchema
72780
+ runtimeState: HumidifierStatusSchema,
72781
+ /**
72782
+ * Runtime-state durability: **session** — as `climate-control`.
72783
+ *
72784
+ * See `RuntimeStateDurability`. Enforced by
72785
+ * `scripts/check-runtime-state-durability.ts`.
72786
+ */
72787
+ durability: "session"
72481
72788
  };
72482
72789
  /**
72483
72790
  * Single-metric humidity reading. Drives Home Assistant `sensor`
@@ -72513,7 +72820,17 @@ var humiditySensorCapability = {
72513
72820
  schema: HumiditySensorStatusSchema,
72514
72821
  kind: "push"
72515
72822
  },
72516
- runtimeState: HumiditySensorStatusSchema
72823
+ runtimeState: HumiditySensorStatusSchema,
72824
+ /**
72825
+ * Runtime-state durability: **restored** — as `numeric-sensor` (67 of 75 writes were the clock alone).
72826
+ *
72827
+ * See `RuntimeStateDurability`. Enforced by
72828
+ * `scripts/check-runtime-state-durability.ts`.
72829
+ */
72830
+ durability: "restored",
72831
+ /** Clock fields: written, but excluded from the compare that decides
72832
+ * whether persisting is worth a SQLite commit. */
72833
+ volatileStateFields: ["lastFetchedAt"]
72517
72834
  };
72518
72835
  /**
72519
72836
  * Image display cap. Models a single still image exposed by an integration —
@@ -72551,7 +72868,14 @@ var imageCapability = {
72551
72868
  * Runtime-state slice — mirrored by the kernel. The UI reads `url`
72552
72869
  * directly and renders the still image.
72553
72870
  */
72554
- runtimeState: ImageStatusSchema
72871
+ runtimeState: ImageStatusSchema,
72872
+ /**
72873
+ * Runtime-state durability: **session** — a snapshot URL is a session-scoped handle; a restored one points at nothing.
72874
+ *
72875
+ * See `RuntimeStateDurability`. Enforced by
72876
+ * `scripts/check-runtime-state-durability.ts`.
72877
+ */
72878
+ durability: "session"
72555
72879
  };
72556
72880
  /**
72557
72881
  * Vendor-neutral image / picture-adjustment cap — the per-camera config
@@ -72700,7 +73024,17 @@ var imageSettingsCapability = {
72700
73024
  schema: ImageSettingsStatusSchema,
72701
73025
  kind: "poll"
72702
73026
  },
72703
- runtimeState: ImageSettingsStatusSchema
73027
+ runtimeState: ImageSettingsStatusSchema,
73028
+ /**
73029
+ * Runtime-state durability: **restored** — operator-set camera imaging; mutation-driven.
73030
+ *
73031
+ * See `RuntimeStateDurability`. Enforced by
73032
+ * `scripts/check-runtime-state-durability.ts`.
73033
+ */
73034
+ durability: "restored",
73035
+ /** Clock fields: written, but excluded from the compare that decides
73036
+ * whether persisting is worth a SQLite commit. */
73037
+ volatileStateFields: ["lastFetchedAt"]
72704
73038
  };
72705
73039
  /**
72706
73040
  * integrations — system-scoped singleton capability for integration
@@ -73040,7 +73374,14 @@ var lawnMowerControlCapability = {
73040
73374
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
73041
73375
  * slice for live activity + battery changes.
73042
73376
  */
73043
- runtimeState: LawnMowerControlStatusSchema
73377
+ runtimeState: LawnMowerControlStatusSchema,
73378
+ /**
73379
+ * Runtime-state durability: **session** — as `vacuum-control`.
73380
+ *
73381
+ * See `RuntimeStateDurability`. Enforced by
73382
+ * `scripts/check-runtime-state-durability.ts`.
73383
+ */
73384
+ durability: "session"
73044
73385
  };
73045
73386
  /**
73046
73387
  * local-network — hub-only singleton.
@@ -73246,7 +73587,17 @@ var lockControlCapability = {
73246
73587
  * read `state` and disable themselves during `locking`/`unlocking`
73247
73588
  * transitions.
73248
73589
  */
73249
- runtimeState: LockControlStatusSchema
73590
+ runtimeState: LockControlStatusSchema,
73591
+ /**
73592
+ * Runtime-state durability: **restored** — a lock left locked must still read locked.
73593
+ *
73594
+ * See `RuntimeStateDurability`. Enforced by
73595
+ * `scripts/check-runtime-state-durability.ts`.
73596
+ */
73597
+ durability: "restored",
73598
+ /** Clock fields: written, but excluded from the compare that decides
73599
+ * whether persisting is worth a SQLite commit. */
73600
+ volatileStateFields: ["lastChangedAt"]
73250
73601
  };
73251
73602
  /**
73252
73603
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
@@ -73408,7 +73759,14 @@ var mediaPlayerCapability = {
73408
73759
  * full slice for live now-playing, volume, and progress updates
73409
73760
  * without polling.
73410
73761
  */
73411
- runtimeState: MediaPlayerStatusSchema
73762
+ runtimeState: MediaPlayerStatusSchema,
73763
+ /**
73764
+ * Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
73765
+ *
73766
+ * See `RuntimeStateDurability`. Enforced by
73767
+ * `scripts/check-runtime-state-durability.ts`.
73768
+ */
73769
+ durability: "session"
73412
73770
  };
73413
73771
  /**
73414
73772
  * mesh-network — collection cap for mesh-VPN providers.
@@ -73672,7 +74030,14 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
73672
74030
  * `device.state.motion.value`. Reads never invoke the provider, so
73673
74031
  * UIs and other addons can poll the cached state safely.
73674
74032
  */
73675
- runtimeState: MotionStatusSchema
74033
+ runtimeState: MotionStatusSchema,
74034
+ /**
74035
+ * 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.
74036
+ *
74037
+ * See `RuntimeStateDurability`. Enforced by
74038
+ * `scripts/check-runtime-state-durability.ts`.
74039
+ */
74040
+ durability: "session"
73676
74041
  };
73677
74042
  /**
73678
74043
  * Motion-trigger toggle for accessory devices.
@@ -73737,7 +74102,14 @@ var motionTriggerCapability = {
73737
74102
  schema: MotionTriggerStatusSchema,
73738
74103
  kind: "command-driven"
73739
74104
  },
73740
- runtimeState: MotionTriggerRuntimeStateSchema
74105
+ runtimeState: MotionTriggerRuntimeStateSchema,
74106
+ /**
74107
+ * 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.
74108
+ *
74109
+ * See `RuntimeStateDurability`. Enforced by
74110
+ * `scripts/check-runtime-state-durability.ts`.
74111
+ */
74112
+ durability: "session"
73741
74113
  };
73742
74114
  /**
73743
74115
  * Motion-zones share the same MaskShape vocabulary as privacy-mask — the
@@ -73804,7 +74176,17 @@ var motionZonesCapability = {
73804
74176
  schema: MotionZoneStatusSchema,
73805
74177
  kind: "poll"
73806
74178
  },
73807
- runtimeState: MotionZoneStatusSchema
74179
+ runtimeState: MotionZoneStatusSchema,
74180
+ /**
74181
+ * 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.
74182
+ *
74183
+ * See `RuntimeStateDurability`. Enforced by
74184
+ * `scripts/check-runtime-state-durability.ts`.
74185
+ */
74186
+ durability: "restored",
74187
+ /** Clock fields: written, but excluded from the compare that decides
74188
+ * whether persisting is worth a SQLite commit. */
74189
+ volatileStateFields: ["lastFetchedAt"]
73808
74190
  };
73809
74191
  /**
73810
74192
  * On-camera AI object detection cap. Surfaces per-device the classes
@@ -73878,7 +74260,17 @@ var nativeObjectDetectionCapability = {
73878
74260
  schema: NativeObjectDetectionStatusSchema,
73879
74261
  kind: "push"
73880
74262
  },
73881
- runtimeState: NativeObjectDetectionRuntimeStateSchema
74263
+ runtimeState: NativeObjectDetectionRuntimeStateSchema,
74264
+ /**
74265
+ * 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.
74266
+ *
74267
+ * See `RuntimeStateDurability`. Enforced by
74268
+ * `scripts/check-runtime-state-durability.ts`.
74269
+ */
74270
+ durability: "restored",
74271
+ /** Clock fields: written, but excluded from the compare that decides
74272
+ * whether persisting is worth a SQLite commit. */
74273
+ volatileStateFields: ["lastFetchedAt"]
73882
74274
  };
73883
74275
  /**
73884
74276
  * network-quality — system-scoped singleton capability tracking RTT,
@@ -74212,7 +74604,14 @@ onSent: { data: object({
74212
74604
  * form reads `supports` to gate optional fields; history pane reads
74213
74605
  * `lastSentAt` / `lastError` / `queueDepth`.
74214
74606
  */
74215
- runtimeState: NotifierStatusSchema
74607
+ runtimeState: NotifierStatusSchema,
74608
+ /**
74609
+ * Runtime-state durability: **session** — live queue depth and last-send state; a restored queue depth describes a queue that no longer exists.
74610
+ *
74611
+ * See `RuntimeStateDurability`. Enforced by
74612
+ * `scripts/check-runtime-state-durability.ts`.
74613
+ */
74614
+ durability: "session"
74216
74615
  };
74217
74616
  /**
74218
74617
  * Generic numeric sensor — last-resort fallback when no typed numeric
@@ -74255,7 +74654,17 @@ var numericSensorCapability = {
74255
74654
  schema: NumericSensorStatusSchema,
74256
74655
  kind: "push"
74257
74656
  },
74258
- runtimeState: NumericSensorStatusSchema
74657
+ runtimeState: NumericSensorStatusSchema,
74658
+ /**
74659
+ * 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.
74660
+ *
74661
+ * See `RuntimeStateDurability`. Enforced by
74662
+ * `scripts/check-runtime-state-durability.ts`.
74663
+ */
74664
+ durability: "restored",
74665
+ /** Clock fields: written, but excluded from the compare that decides
74666
+ * whether persisting is worth a SQLite commit. */
74667
+ volatileStateFields: ["lastFetchedAt"]
74259
74668
  };
74260
74669
  /**
74261
74670
  * Generic on-screen-display (video overlay) cap. Each camera exposes
@@ -74640,7 +75049,14 @@ var petFeederCapability = {
74640
75049
  * the full slice via `device.state.petFeeder.value` and refresh on
74641
75050
  * every poll without re-querying the provider.
74642
75051
  */
74643
- runtimeState: PetFeederStatusSchema
75052
+ runtimeState: PetFeederStatusSchema,
75053
+ /**
75054
+ * Runtime-state durability: **session** — live appliance state re-published on connect.
75055
+ *
75056
+ * See `RuntimeStateDurability`. Enforced by
75057
+ * `scripts/check-runtime-state-durability.ts`.
75058
+ */
75059
+ durability: "session"
74644
75060
  };
74645
75061
  var VehicleSchema = object({
74646
75062
  id: string(),
@@ -74952,7 +75368,17 @@ var powerMeterCapability = {
74952
75368
  schema: PowerMeterStatusSchema,
74953
75369
  kind: "push"
74954
75370
  },
74955
- runtimeState: PowerMeterStatusSchema
75371
+ runtimeState: PowerMeterStatusSchema,
75372
+ /**
75373
+ * Runtime-state durability: **restored** — as `numeric-sensor`; `kwhTotal` is an accumulator whose restored value is the baseline.
75374
+ *
75375
+ * See `RuntimeStateDurability`. Enforced by
75376
+ * `scripts/check-runtime-state-durability.ts`.
75377
+ */
75378
+ durability: "restored",
75379
+ /** Clock fields: written, but excluded from the compare that decides
75380
+ * whether persisting is worth a SQLite commit. */
75381
+ volatileStateFields: ["lastFetchedAt"]
74956
75382
  };
74957
75383
  /**
74958
75384
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -75009,7 +75435,17 @@ var presenceCapability = {
75009
75435
  * the map pin is rendered (use `DeviceFeature.PresenceGps` for the
75010
75436
  * pre-fetch fast-path check).
75011
75437
  */
75012
- runtimeState: PresenceStatusSchema
75438
+ runtimeState: PresenceStatusSchema,
75439
+ /**
75440
+ * Runtime-state durability: **restored** — occupancy-relevant: the restored state is what an occupancy rule compares the first post-restart observation against.
75441
+ *
75442
+ * See `RuntimeStateDurability`. Enforced by
75443
+ * `scripts/check-runtime-state-durability.ts`.
75444
+ */
75445
+ durability: "restored",
75446
+ /** Clock fields: written, but excluded from the compare that decides
75447
+ * whether persisting is worth a SQLite commit. */
75448
+ volatileStateFields: ["lastChangedAt"]
75013
75449
  };
75014
75450
  /**
75015
75451
  * Atmospheric pressure reading in hectopascals. Drives Home Assistant
@@ -75045,7 +75481,17 @@ var pressureSensorCapability = {
75045
75481
  schema: PressureSensorStatusSchema,
75046
75482
  kind: "push"
75047
75483
  },
75048
- runtimeState: PressureSensorStatusSchema
75484
+ runtimeState: PressureSensorStatusSchema,
75485
+ /**
75486
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
75487
+ *
75488
+ * See `RuntimeStateDurability`. Enforced by
75489
+ * `scripts/check-runtime-state-durability.ts`.
75490
+ */
75491
+ durability: "restored",
75492
+ /** Clock fields: written, but excluded from the compare that decides
75493
+ * whether persisting is worth a SQLite commit. */
75494
+ volatileStateFields: ["lastFetchedAt"]
75049
75495
  };
75050
75496
  /**
75051
75497
  * PRIVACY — what the camera deliberately does not capture. Two planes:
@@ -75175,7 +75621,17 @@ var privacyMaskCapability = {
75175
75621
  schema: PrivacyMaskStatusSchema,
75176
75622
  kind: "poll"
75177
75623
  },
75178
- runtimeState: PrivacyMaskStatusSchema
75624
+ runtimeState: PrivacyMaskStatusSchema,
75625
+ /**
75626
+ * Runtime-state durability: **restored** — operator-drawn regions, zero real churn — 22 writes in 25 minutes, every one of them the clock.
75627
+ *
75628
+ * See `RuntimeStateDurability`. Enforced by
75629
+ * `scripts/check-runtime-state-durability.ts`.
75630
+ */
75631
+ durability: "restored",
75632
+ /** Clock fields: written, but excluded from the compare that decides
75633
+ * whether persisting is worth a SQLite commit. */
75634
+ volatileStateFields: ["lastFetchedAt"]
75179
75635
  };
75180
75636
  var PtzPresetSchema = object({
75181
75637
  id: string(),
@@ -75341,7 +75797,14 @@ var ptzAutotrackCapability = {
75341
75797
  * fetch / cache / fallback logic out of the four cap methods —
75342
75798
  * they become trampolines over `runtimeState`.
75343
75799
  */
75344
- runtimeState: PtzAutotrackRuntimeStateSchema
75800
+ runtimeState: PtzAutotrackRuntimeStateSchema,
75801
+ /**
75802
+ * Runtime-state durability: **session** — mirrors the camera's own autotrack config, re-read on connect.
75803
+ *
75804
+ * See `RuntimeStateDurability`. Enforced by
75805
+ * `scripts/check-runtime-state-durability.ts`.
75806
+ */
75807
+ durability: "session"
75345
75808
  };
75346
75809
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
75347
75810
  kind: "mutation",
@@ -75688,13 +76151,24 @@ method(object({
75688
76151
  /** Playback-speed multiplier for the render (1 = realtime). */
75689
76152
  var ExportSpeedSchema = number().min(.25).max(32);
75690
76153
  /**
75691
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
76154
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
76155
+ *
76156
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
76157
+ * derives these bounds from things that happened at a TIME (a track's
76158
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
76159
+ * every segment present for the range, with each recording GAP removed. The
76160
+ * two agree only on a window that recorded without one interruption, and only
76161
+ * the render side knows the segments, so the translation lives there
76162
+ * (`export-dense-map.ts`, addon-pipeline).
76163
+ *
76164
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
76165
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
76166
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
76167
+ * the video was a uniform timelapse, and the log line reported the five ranges
76168
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
75692
76169
  *
75693
- * Relative and not absolute epoch on purpose: the renderer's frame-select
75694
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
75695
- * playlist. Handing it absolute epochs would make every call site responsible
75696
- * for the same subtraction, and the one that forgot would emit a filter that
75697
- * selects nothing — silently, as a uniform timelapse.
76170
+ * Relative and not absolute epoch, because an absolute epoch would make every
76171
+ * call site responsible for the same subtraction.
75698
76172
  */
75699
76173
  var ExportDenseRangeSchema = object({
75700
76174
  fromSec: number().nonnegative(),
@@ -75980,7 +76454,14 @@ var sceneMonitorCapability = {
75980
76454
  schema: SceneMonitorStatusSchema,
75981
76455
  kind: "push"
75982
76456
  },
75983
- runtimeState: SceneMonitorStatusSchema
76457
+ runtimeState: SceneMonitorStatusSchema,
76458
+ /**
76459
+ * Runtime-state durability: **session** — re-derived from the current scene on the next evaluation.
76460
+ *
76461
+ * See `RuntimeStateDurability`. Enforced by
76462
+ * `scripts/check-runtime-state-durability.ts`.
76463
+ */
76464
+ durability: "session"
75984
76465
  };
75985
76466
  /**
75986
76467
  * Per-stage gating mode applied to the zones a rule references.
@@ -76124,7 +76605,14 @@ var scriptRunnerCapability = {
76124
76605
  * `isRunning` to render a spinner during execution and surfaces
76125
76606
  * `lastError` / `lastRunSuccess` in the recent-runs panel.
76126
76607
  */
76127
- runtimeState: ScriptRunnerStatusSchema
76608
+ runtimeState: ScriptRunnerStatusSchema,
76609
+ /**
76610
+ * Runtime-state durability: **session** — a restored `isRunning: true` describes a process that died with the previous hub.
76611
+ *
76612
+ * See `RuntimeStateDurability`. Enforced by
76613
+ * `scripts/check-runtime-state-durability.ts`.
76614
+ */
76615
+ durability: "session"
76128
76616
  };
76129
76617
  /**
76130
76618
  * Smoke alarm sensor — boolean "is smoke currently detected" with
@@ -76151,7 +76639,17 @@ var smokeCapability = {
76151
76639
  schema: SmokeStatusSchema,
76152
76640
  kind: "push"
76153
76641
  },
76154
- runtimeState: SmokeStatusSchema
76642
+ runtimeState: SmokeStatusSchema,
76643
+ /**
76644
+ * Runtime-state durability: **restored** — a safety sensor must not read "clear" merely because the hub restarted.
76645
+ *
76646
+ * See `RuntimeStateDurability`. Enforced by
76647
+ * `scripts/check-runtime-state-durability.ts`.
76648
+ */
76649
+ durability: "restored",
76650
+ /** Clock fields: written, but excluded from the compare that decides
76651
+ * whether persisting is worth a SQLite commit. */
76652
+ volatileStateFields: ["lastChangedAt"]
76155
76653
  };
76156
76654
  /**
76157
76655
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -76324,7 +76822,17 @@ var streamParamsCapability = {
76324
76822
  schema: StreamParamsStatusSchema,
76325
76823
  kind: "poll"
76326
76824
  },
76327
- runtimeState: StreamParamsStatusSchema
76825
+ runtimeState: StreamParamsStatusSchema,
76826
+ /**
76827
+ * Runtime-state durability: **restored** — operator-set encoder profile; mutation-driven.
76828
+ *
76829
+ * See `RuntimeStateDurability`. Enforced by
76830
+ * `scripts/check-runtime-state-durability.ts`.
76831
+ */
76832
+ durability: "restored",
76833
+ /** Clock fields: written, but excluded from the compare that decides
76834
+ * whether persisting is worth a SQLite commit. */
76835
+ volatileStateFields: ["lastFetchedAt"]
76328
76836
  };
76329
76837
  /**
76330
76838
  * Generic on/off switch cap for accessory children (siren, floodlight,
@@ -76370,6 +76878,16 @@ var switchCapability = {
76370
76878
  * not need to re-query the provider after a setState mutation.
76371
76879
  */
76372
76880
  runtimeState: SwitchStatusSchema,
76881
+ /**
76882
+ * Runtime-state durability: **restored** — device state an operator reads as authoritative; 55 devices, transition-driven.
76883
+ *
76884
+ * See `RuntimeStateDurability`. Enforced by
76885
+ * `scripts/check-runtime-state-durability.ts`.
76886
+ */
76887
+ durability: "restored",
76888
+ /** Clock fields: written, but excluded from the compare that decides
76889
+ * whether persisting is worth a SQLite commit. */
76890
+ volatileStateFields: ["lastChangedAt"],
76373
76891
  settings: { bindings: [{
76374
76892
  kind: "scalar",
76375
76893
  statusPath: "on",
@@ -76449,7 +76967,17 @@ var tamperCapability = {
76449
76967
  schema: TamperStatusSchema,
76450
76968
  kind: "push"
76451
76969
  },
76452
- runtimeState: TamperStatusSchema
76970
+ runtimeState: TamperStatusSchema,
76971
+ /**
76972
+ * Runtime-state durability: **restored** — as `smoke`.
76973
+ *
76974
+ * See `RuntimeStateDurability`. Enforced by
76975
+ * `scripts/check-runtime-state-durability.ts`.
76976
+ */
76977
+ durability: "restored",
76978
+ /** Clock fields: written, but excluded from the compare that decides
76979
+ * whether persisting is worth a SQLite commit. */
76980
+ volatileStateFields: ["lastChangedAt"]
76453
76981
  };
76454
76982
  /**
76455
76983
  * Single-metric temperature reading. Drives Home Assistant `sensor`
@@ -76494,7 +77022,17 @@ var temperatureSensorCapability = {
76494
77022
  schema: TemperatureSensorStatusSchema,
76495
77023
  kind: "push"
76496
77024
  },
76497
- runtimeState: TemperatureSensorStatusSchema
77025
+ runtimeState: TemperatureSensorStatusSchema,
77026
+ /**
77027
+ * Runtime-state durability: **restored** — as `numeric-sensor` (69 of 125 writes were the clock alone).
77028
+ *
77029
+ * See `RuntimeStateDurability`. Enforced by
77030
+ * `scripts/check-runtime-state-durability.ts`.
77031
+ */
77032
+ durability: "restored",
77033
+ /** Clock fields: written, but excluded from the compare that decides
77034
+ * whether persisting is worth a SQLite commit. */
77035
+ volatileStateFields: ["lastFetchedAt"]
76498
77036
  };
76499
77037
  /**
76500
77038
  * toast — system-scoped singleton capability that streams toast
@@ -76563,7 +77101,14 @@ var updateCapability = {
76563
77101
  schema: UpdateStatusSchema,
76564
77102
  kind: "poll"
76565
77103
  },
76566
- runtimeState: UpdateStatusSchema
77104
+ runtimeState: UpdateStatusSchema,
77105
+ /**
77106
+ * Runtime-state durability: **session** — a restored `inProgress: true` describes an update that is no longer running; versions are re-probed at boot.
77107
+ *
77108
+ * See `RuntimeStateDurability`. Enforced by
77109
+ * `scripts/check-runtime-state-durability.ts`.
77110
+ */
77111
+ durability: "session"
76567
77112
  };
76568
77113
  var UserSummarySchema = object({
76569
77114
  id: string(),
@@ -76897,7 +77442,14 @@ var vacuumControlCapability = {
76897
77442
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
76898
77443
  * slice for live state + battery + fan-speed changes.
76899
77444
  */
76900
- runtimeState: VacuumControlStatusSchema
77445
+ runtimeState: VacuumControlStatusSchema,
77446
+ /**
77447
+ * Runtime-state durability: **session** — as `media-player` — a restored `state: cleaning` is a robot that is not cleaning.
77448
+ *
77449
+ * See `RuntimeStateDurability`. Enforced by
77450
+ * `scripts/check-runtime-state-durability.ts`.
77451
+ */
77452
+ durability: "session"
76901
77453
  };
76902
77454
  var ValveStatusSchema = object({
76903
77455
  /** Lifecycle state of the valve. */
@@ -76949,7 +77501,14 @@ var valveCapability = {
76949
77501
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
76950
77502
  * slice for live position changes during a move.
76951
77503
  */
76952
- runtimeState: ValveStatusSchema
77504
+ runtimeState: ValveStatusSchema,
77505
+ /**
77506
+ * Runtime-state durability: **session** — as `brightness`.
77507
+ *
77508
+ * See `RuntimeStateDurability`. Enforced by
77509
+ * `scripts/check-runtime-state-durability.ts`.
77510
+ */
77511
+ durability: "session"
76953
77512
  };
76954
77513
  /**
76955
77514
  * Vibration / shake / impact sensor. Drives Home Assistant
@@ -76971,7 +77530,17 @@ var vibrationCapability = {
76971
77530
  schema: VibrationStatusSchema,
76972
77531
  kind: "push"
76973
77532
  },
76974
- runtimeState: VibrationStatusSchema
77533
+ runtimeState: VibrationStatusSchema,
77534
+ /**
77535
+ * Runtime-state durability: **restored** — as `smoke`.
77536
+ *
77537
+ * See `RuntimeStateDurability`. Enforced by
77538
+ * `scripts/check-runtime-state-durability.ts`.
77539
+ */
77540
+ durability: "restored",
77541
+ /** Clock fields: written, but excluded from the compare that decides
77542
+ * whether persisting is worth a SQLite commit. */
77543
+ volatileStateFields: ["lastChangedAt"]
76975
77544
  };
76976
77545
  /**
76977
77546
  * Water heater / boiler cap. Models HA `water_heater.*` entities — a
@@ -77045,7 +77614,14 @@ var waterHeaterCapability = {
77045
77614
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
77046
77615
  * slice for live temperature / mode / away changes.
77047
77616
  */
77048
- runtimeState: WaterHeaterStatusSchema
77617
+ runtimeState: WaterHeaterStatusSchema,
77618
+ /**
77619
+ * Runtime-state durability: **session** — as `climate-control`.
77620
+ *
77621
+ * See `RuntimeStateDurability`. Enforced by
77622
+ * `scripts/check-runtime-state-durability.ts`.
77623
+ */
77624
+ durability: "session"
77049
77625
  };
77050
77626
  /**
77051
77627
  * Weather provider cap. Models HA `weather.*` entities — a read-only
@@ -77104,7 +77680,14 @@ var weatherCapability = {
77104
77680
  * Runtime-state slice — mirrored by the kernel. The UI reads the
77105
77681
  * current conditions directly from the slice on each weather push.
77106
77682
  */
77107
- runtimeState: WeatherStatusSchema
77683
+ runtimeState: WeatherStatusSchema,
77684
+ /**
77685
+ * Runtime-state durability: **session** — a forecast is stale the moment the hub is down; the provider re-fetches on connect.
77686
+ *
77687
+ * See `RuntimeStateDurability`. Enforced by
77688
+ * `scripts/check-runtime-state-durability.ts`.
77689
+ */
77690
+ durability: "session"
77108
77691
  };
77109
77692
  /**
77110
77693
  * Per-zone occupancy aggregation produced by the analytics frame
@@ -77266,7 +77849,14 @@ var zoneAnalyticsCapability = {
77266
77849
  * automatically; the explicit `getCurrentSnapshot` cap method is
77267
77850
  * still useful for one-off polls without a subscription.
77268
77851
  */
77269
- runtimeState: CameraOccupancySnapshotSchema
77852
+ runtimeState: CameraOccupancySnapshotSchema,
77853
+ /**
77854
+ * Runtime-state durability: **session** — per-frame analytics; with `audio-metrics` it is ~90 % of the offered write rate. Re-derived on the next frame.
77855
+ *
77856
+ * See `RuntimeStateDurability`. Enforced by
77857
+ * `scripts/check-runtime-state-durability.ts`.
77858
+ */
77859
+ durability: "session"
77270
77860
  };
77271
77861
  /**
77272
77862
  * Stages a {@link ZoneRule} can apply to. Discriminator on the rules
@@ -77344,7 +77934,14 @@ var zoneRulesCapability = {
77344
77934
  motion: array(ZoneRuleSchema).readonly(),
77345
77935
  detection: array(ZoneRuleSchema).readonly(),
77346
77936
  package: array(ZoneRuleSchema).readonly()
77347
- })
77937
+ }),
77938
+ /**
77939
+ * Runtime-state durability: **restored** — operator intent, mutation-only, same argument as `zones`.
77940
+ *
77941
+ * See `RuntimeStateDurability`. Enforced by
77942
+ * `scripts/check-runtime-state-durability.ts`.
77943
+ */
77944
+ durability: "restored"
77348
77945
  };
77349
77946
  /**
77350
77947
  * Accessory device helpers — shared across drivers.
@@ -84031,6 +84628,7 @@ Object.freeze({
84031
84628
  "network-access": "ingress",
84032
84629
  "smtp-provider": "email"
84033
84630
  });
84631
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
84034
84632
  new Set(["devices", "classes"]);
84035
84633
  /**
84036
84634
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
@@ -84308,25 +84906,32 @@ object({
84308
84906
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
84309
84907
  object({
84310
84908
  /**
84311
- * How long a retained native frame is served before it counts as a miss.
84909
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
84910
+ * detection result.
84312
84911
  *
84313
- * Must cover the FULL late-crop horizon: detection inference + the
84314
- * cross-process inference-result hop to hub post-analysis + tracking + the
84315
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
84316
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
84317
- * RAM per busy camera grows linearly with no measured hit-rate gain.
84912
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
84913
+ * a time window was never related to the event the pixels were waiting for.
84914
+ * A held frame now lives from delivery until the runner has its `FrameResult`
84915
+ * at which moment the runner cuts the subject tiles it actually wanted and
84916
+ * releases the frame. The bound exists only so a runner that stops answering
84917
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
84918
+ *
84919
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
84920
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
84921
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
84922
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
84923
+ * `holdOverflow` on the metrics line is what says you need it.
84318
84924
  */
84319
- ttlMs: number().int().min(250).max(1e4),
84925
+ holdFrames: number().int().min(1).max(64),
84320
84926
  /**
84321
84927
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
84322
84928
  *
84323
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
84324
- * which one is actually binding before reasoning from that. At the shipped
84325
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
84326
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
84327
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
84328
- * change that admits fewer frames buys retention WINDOW at constant RAM
84329
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
84929
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
84930
+ * is what decides how much is held, and the ceiling is the number above which
84931
+ * something is wrong. Before that it was the effective cap at 1024 MB with
84932
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
84933
+ * with the TTL expiring nothing, which is exactly the confusion the hold
84934
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
84330
84935
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
84331
84936
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
84332
84937
  * to replace).
@@ -84352,22 +84957,45 @@ object({
84352
84957
  * there is the signal that some caller names frames outside the inference set
84353
84958
  * and that this must go back to `all`.
84354
84959
  */
84355
- admission: NativeLeaseAdmissionSchema
84960
+ admission: NativeLeaseAdmissionSchema,
84961
+ /**
84962
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
84963
+ * compressed native crops the worker cuts at the moment a frame's detection
84964
+ * result arrives, and keeps long after the frame itself is freed.
84965
+ *
84966
+ * This is the knob that replaced the old retention window, and it buys about
84967
+ * three orders of magnitude more of it: a tile is one subject at native
84968
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
84969
+ * the frame it was cut from. A frame on which nothing was detected costs
84970
+ * nothing at all, which is the real change — the old lease paid per FRAME and
84971
+ * was interrogated per SUBJECT.
84972
+ *
84973
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
84974
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
84975
+ * reproduce that.
84976
+ */
84977
+ tileBudgetMb: number().int().min(0).max(1024)
84356
84978
  });
84357
84979
  /**
84358
- * The values in force when the operator has set nothing — byte-for-byte the
84359
- * constants the decode worker shipped with as env-var defaults, so making these
84360
- * settings changed no behaviour on the day it landed.
84980
+ * The values in force when the operator has set nothing.
84981
+ *
84982
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
84983
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
84984
+ * in the same change that redefines it would make a regression and a retune
84985
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
84986
+ * live traffic.
84361
84987
  */
84362
84988
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
84363
- ttlMs: 1200,
84989
+ holdFrames: 8,
84364
84990
  budgetMb: 1024,
84365
84991
  activityMs: 15e3,
84992
+ tileBudgetMb: 64,
84366
84993
  admission: "inferred"
84367
84994
  };
84368
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
84995
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
84369
84996
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
84370
84997
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
84998
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
84371
84999
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
84372
85000
  //#endregion
84373
85001
  //#region src/config.ts