@camstack/addon-provider-gree 0.2.13 → 0.2.15

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
@@ -10774,7 +10774,14 @@ var cameraStreamsCapability = {
10774
10774
  low: string().optional()
10775
10775
  }),
10776
10776
  lastChangedAt: number()
10777
- })
10777
+ }),
10778
+ /**
10779
+ * 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.
10780
+ *
10781
+ * See `RuntimeStateDurability`. Enforced by
10782
+ * `scripts/check-runtime-state-durability.ts`.
10783
+ */
10784
+ durability: "session"
10778
10785
  };
10779
10786
  /** Where a block runs. The operator chooses — a block driving a device on an
10780
10787
  * agent is the reason placement is not fixed to the hub. */
@@ -11335,6 +11342,13 @@ var deviceDiscoveryCapability = {
11335
11342
  kind: "poll"
11336
11343
  },
11337
11344
  runtimeState: DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: number().int().nonnegative() }),
11345
+ /**
11346
+ * Runtime-state durability: **session** — 5.7 KB of scan output on the largest device, fully re-derivable by re-scanning.
11347
+ *
11348
+ * See `RuntimeStateDurability`. Enforced by
11349
+ * `scripts/check-runtime-state-durability.ts`.
11350
+ */
11351
+ durability: "session",
11338
11352
  methods: {
11339
11353
  /**
11340
11354
  * Snapshot of the current `discovered` list. Returns the
@@ -13234,7 +13248,23 @@ var NotificationActionSchema = object({
13234
13248
  * else — see `notification-center/action-token.ts` for what that does and
13235
13249
  * does not buy.
13236
13250
  */
13237
- destructive: boolean().optional()
13251
+ destructive: boolean().optional(),
13252
+ /**
13253
+ * How the tap should REACH the url.
13254
+ *
13255
+ * `navigate` (absent, and every button authored before this field) opens it:
13256
+ * the phone leaves the notification and shows whatever the callback returns.
13257
+ * That is right for a button whose answer the operator wants to read.
13258
+ *
13259
+ * `background` fires it as a POST and stays put. It exists for the buttons
13260
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13261
+ * an answer to the notification, and being thrown into a browser tab to
13262
+ * confirm it costs more attention than the notification did. A backend that
13263
+ * cannot do a background call renders it as an ordinary link (the adapters
13264
+ * fall back rather than dropping the button), so this is a preference, never
13265
+ * a requirement.
13266
+ */
13267
+ mode: _enum(["navigate", "background"]).optional()
13238
13268
  });
13239
13269
  /**
13240
13270
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -14086,7 +14116,17 @@ var alarmPanelCapability = {
14086
14116
  * full slice; renders an arm button per `availableModes` entry and
14087
14117
  * a PIN field iff `requiresCode === true`.
14088
14118
  */
14089
- runtimeState: AlarmPanelStatusSchema
14119
+ runtimeState: AlarmPanelStatusSchema,
14120
+ /**
14121
+ * Runtime-state durability: **restored** — armed state is the one thing a panel must not lose across a restart.
14122
+ *
14123
+ * See `RuntimeStateDurability`. Enforced by
14124
+ * `scripts/check-runtime-state-durability.ts`.
14125
+ */
14126
+ durability: "restored",
14127
+ /** Clock fields: written, but excluded from the compare that decides
14128
+ * whether persisting is worth a SQLite commit. */
14129
+ volatileStateFields: ["lastChangedAt"]
14090
14130
  };
14091
14131
  /**
14092
14132
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
@@ -14263,6 +14303,9 @@ var NcSystemEventConditionSchema = object({
14263
14303
  nodeIds: array(string().min(1)).min(1).optional(),
14264
14304
  packageNames: array(string().min(1)).min(1).optional()
14265
14305
  });
14306
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14307
+ * outage the operator asked for once and forgot. */
14308
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14266
14309
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14267
14310
  var NcScheduleSchema = object({
14268
14311
  windows: array(object({
@@ -14639,15 +14682,15 @@ var NcConditionsSchema = object({
14639
14682
  * (an `immediate` rule naming an `audio-*` class, one notification per
14640
14683
  * classified sample) stays exactly as it was for rules that already use it.
14641
14684
  *
14642
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14643
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14644
- * (`camstack/src/data/notification-center.ts`, guarded by
14645
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14685
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14686
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14687
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14688
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14646
14689
  * condition fields it does not know when a rule is saved from the phone.
14647
14690
  * Publishing an editor for a condition the app cannot round-trip is how an
14648
- * operator loses a rule's conditions by opening it — so the descriptor, the
14649
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14650
- * does an audio rule become authorable.
14691
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14692
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14693
+ * follows here.
14651
14694
  */
14652
14695
  audio: NcAudioConditionSchema.optional()
14653
14696
  });
@@ -14883,6 +14926,30 @@ var NcRuleInputSchema = object({
14883
14926
  */
14884
14927
  snoozeAllowGlobal: boolean().optional(),
14885
14928
  /**
14929
+ * The snooze durations THIS rule's notification offers as buttons, in
14930
+ * minutes.
14931
+ *
14932
+ * Three states, and all three are distinct — which is exactly why this is
14933
+ * `.optional()` and never `.default()`. A Zod default does not run on the
14934
+ * addon cap path (three production failures in one day), so a schema default
14935
+ * would collapse the first two:
14936
+ *
14937
+ * | value | meaning |
14938
+ * | --- | --- |
14939
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
14940
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
14941
+ * | a list | these choices, de-duplicated and sorted, at most four |
14942
+ *
14943
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
14944
+ * three buttons in total) and a rule that spent it all on snooze choices
14945
+ * would push its own tap-through actions off the notification.
14946
+ *
14947
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
14948
+ * that arms the panel, is exempt automatically and cannot be silenced by a
14949
+ * window from anywhere (D133).
14950
+ */
14951
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
14952
+ /**
14886
14953
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14887
14954
  *
14888
14955
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -14982,6 +15049,7 @@ var NcConditionDescriptorSchema = object({
14982
15049
  "device",
14983
15050
  "package",
14984
15051
  "occupancy",
15052
+ "audio",
14985
15053
  "system"
14986
15054
  ]),
14987
15055
  label: string(),
@@ -15000,6 +15068,7 @@ var NcConditionDescriptorSchema = object({
15000
15068
  "crossingSelect",
15001
15069
  "polygonDraw",
15002
15070
  "occupancy",
15071
+ "audio",
15003
15072
  "deviceState",
15004
15073
  "systemEvent"
15005
15074
  ]),
@@ -15151,7 +15220,20 @@ var NcSnoozeInputSchema = object({
15151
15220
  ruleId: string().optional(),
15152
15221
  /** Required when `scope: 'device'`. */
15153
15222
  deviceId: number().int().optional(),
15154
- durationMinutes: number().int().min(1).max(1440),
15223
+ /**
15224
+ * Narrow the window to these subject classes — "the cat, not the person".
15225
+ *
15226
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15227
+ * what every window authored before this field meant, so no persisted row
15228
+ * changes meaning and no client has to learn anything to keep working.
15229
+ *
15230
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15231
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15232
+ * not at whichever of their four rules happened to produce the notification
15233
+ * they are dismissing.
15234
+ */
15235
+ classes: array(string().min(1)).min(1).optional(),
15236
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
15155
15237
  /**
15156
15238
  * Silence this for EVERY recipient, not just the caller. Permission is
15157
15239
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15176,6 +15258,10 @@ var NcSnoozeSchema = object({
15176
15258
  scope: NcSnoozeScopeSchema,
15177
15259
  ruleId: string().optional(),
15178
15260
  deviceId: number().int().optional(),
15261
+ /** Subject classes this window covers. ABSENT = every class — see
15262
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15263
+ * no SQLite column: nothing queries a window by class. */
15264
+ classes: array(string().min(1)).min(1).optional(),
15179
15265
  startedAt: number(),
15180
15266
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15181
15267
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -17276,7 +17362,14 @@ var zonesCapability = {
17276
17362
  * handle. Slice shape is `{ zones: Zone[] }` so future extensions
17277
17363
  * (e.g. zone groupings) can sit alongside the polygon list.
17278
17364
  */
17279
- runtimeState: object({ zones: array(ZoneSchema).readonly() })
17365
+ runtimeState: object({ zones: array(ZoneSchema).readonly() }),
17366
+ /**
17367
+ * 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.
17368
+ *
17369
+ * See `RuntimeStateDurability`. Enforced by
17370
+ * `scripts/check-runtime-state-durability.ts`.
17371
+ */
17372
+ durability: "restored"
17280
17373
  };
17281
17374
  /**
17282
17375
  * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
@@ -20075,7 +20168,17 @@ var airQualitySensorCapability = {
20075
20168
  schema: AirQualitySensorStatusSchema,
20076
20169
  kind: "push"
20077
20170
  },
20078
- runtimeState: AirQualitySensorStatusSchema
20171
+ runtimeState: AirQualitySensorStatusSchema,
20172
+ /**
20173
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20174
+ *
20175
+ * See `RuntimeStateDurability`. Enforced by
20176
+ * `scripts/check-runtime-state-durability.ts`.
20177
+ */
20178
+ durability: "restored",
20179
+ /** Clock fields: written, but excluded from the compare that decides
20180
+ * whether persisting is worth a SQLite commit. */
20181
+ volatileStateFields: ["lastFetchedAt"]
20079
20182
  };
20080
20183
  /**
20081
20184
  * Ambient illuminance reading in lux. Drives Home Assistant `sensor`
@@ -20107,7 +20210,17 @@ var ambientLightSensorCapability = {
20107
20210
  schema: AmbientLightSensorStatusSchema,
20108
20211
  kind: "push"
20109
20212
  },
20110
- runtimeState: AmbientLightSensorStatusSchema
20213
+ runtimeState: AmbientLightSensorStatusSchema,
20214
+ /**
20215
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20216
+ *
20217
+ * See `RuntimeStateDurability`. Enforced by
20218
+ * `scripts/check-runtime-state-durability.ts`.
20219
+ */
20220
+ durability: "restored",
20221
+ /** Clock fields: written, but excluded from the compare that decides
20222
+ * whether persisting is worth a SQLite commit. */
20223
+ volatileStateFields: ["lastFetchedAt"]
20111
20224
  };
20112
20225
  /**
20113
20226
  * Per-class audio metrics aggregated over a sliding window.
@@ -20225,7 +20338,14 @@ var audioMetricsCapability = {
20225
20338
  }), AudioMetricsHistorySchema)
20226
20339
  },
20227
20340
  /** Reactive runtime-state mirror — live `device.state.audioMetrics.value`. */
20228
- runtimeState: AudioMetricsSnapshotSchema
20341
+ runtimeState: AudioMetricsSnapshotSchema,
20342
+ /**
20343
+ * 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.
20344
+ *
20345
+ * See `RuntimeStateDurability`. Enforced by
20346
+ * `scripts/check-runtime-state-durability.ts`.
20347
+ */
20348
+ durability: "session"
20229
20349
  };
20230
20350
  /**
20231
20351
  * Automation-control cap. Models HA `automation.*` entities on
@@ -20287,7 +20407,14 @@ var automationControlCapability = {
20287
20407
  * reads `enabled` (toggle) + `isRunning` (spinner) + `lastError`
20288
20408
  * (badge) directly.
20289
20409
  */
20290
- runtimeState: AutomationControlStatusSchema
20410
+ runtimeState: AutomationControlStatusSchema,
20411
+ /**
20412
+ * 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.
20413
+ *
20414
+ * See `RuntimeStateDurability`. Enforced by
20415
+ * `scripts/check-runtime-state-durability.ts`.
20416
+ */
20417
+ durability: "session"
20291
20418
  };
20292
20419
  /**
20293
20420
  * Battery status snapshot. Emitted by providers whose device is
@@ -20393,7 +20520,17 @@ onStatusChanged: { data: object({
20393
20520
  * via `device.runtimeState.getCapState('battery')` regardless of
20394
20521
  * the underlying driver.
20395
20522
  */
20396
- runtimeState: BatteryStatusSchema
20523
+ runtimeState: BatteryStatusSchema,
20524
+ /**
20525
+ * 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.
20526
+ *
20527
+ * See `RuntimeStateDurability`. Enforced by
20528
+ * `scripts/check-runtime-state-durability.ts`.
20529
+ */
20530
+ durability: "restored",
20531
+ /** Clock fields: written, but excluded from the compare that decides
20532
+ * whether persisting is worth a SQLite commit. */
20533
+ volatileStateFields: ["lastUpdated"]
20397
20534
  };
20398
20535
  /**
20399
20536
  * Generic boolean sensor — last-resort fallback when no domain-
@@ -20422,7 +20559,17 @@ var binaryCapability = {
20422
20559
  schema: BinaryStatusSchema,
20423
20560
  kind: "push"
20424
20561
  },
20425
- runtimeState: BinaryStatusSchema
20562
+ runtimeState: BinaryStatusSchema,
20563
+ /**
20564
+ * Runtime-state durability: **restored** — transition-driven sensor state; the restored value gives the boot comparison.
20565
+ *
20566
+ * See `RuntimeStateDurability`. Enforced by
20567
+ * `scripts/check-runtime-state-durability.ts`.
20568
+ */
20569
+ durability: "restored",
20570
+ /** Clock fields: written, but excluded from the compare that decides
20571
+ * whether persisting is worth a SQLite commit. */
20572
+ volatileStateFields: ["lastChangedAt"]
20426
20573
  };
20427
20574
  /**
20428
20575
  * Dimmable-light brightness control. Co-exists with `switch` on the
@@ -20475,7 +20622,14 @@ onBrightnessChanged: { data: object({
20475
20622
  * by the kernel. Read via `device.state.brightness.value` so UI
20476
20623
  * sliders surface the current level without polling the provider.
20477
20624
  */
20478
- runtimeState: BrightnessStatusSchema
20625
+ runtimeState: BrightnessStatusSchema,
20626
+ /**
20627
+ * Runtime-state durability: **session** — live lamp state, re-published by the provider on connect.
20628
+ *
20629
+ * See `RuntimeStateDurability`. Enforced by
20630
+ * `scripts/check-runtime-state-durability.ts`.
20631
+ */
20632
+ durability: "session"
20479
20633
  };
20480
20634
  DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
20481
20635
  kind: "mutation",
@@ -20563,7 +20717,17 @@ var carbonMonoxideCapability = {
20563
20717
  schema: CarbonMonoxideStatusSchema,
20564
20718
  kind: "push"
20565
20719
  },
20566
- runtimeState: CarbonMonoxideStatusSchema
20720
+ runtimeState: CarbonMonoxideStatusSchema,
20721
+ /**
20722
+ * Runtime-state durability: **restored** — as `smoke`.
20723
+ *
20724
+ * See `RuntimeStateDurability`. Enforced by
20725
+ * `scripts/check-runtime-state-durability.ts`.
20726
+ */
20727
+ durability: "restored",
20728
+ /** Clock fields: written, but excluded from the compare that decides
20729
+ * whether persisting is worth a SQLite commit. */
20730
+ volatileStateFields: ["lastChangedAt"]
20567
20731
  };
20568
20732
  /**
20569
20733
  * HVAC / climate control cap. Models the full surface of a HA
@@ -20723,7 +20887,14 @@ var climateControlCapability = {
20723
20887
  * the full slice via `device.state.climate-control.value` and refresh
20724
20888
  * on every push without re-querying the provider.
20725
20889
  */
20726
- runtimeState: ClimateControlStatusSchema
20890
+ runtimeState: ClimateControlStatusSchema,
20891
+ /**
20892
+ * Runtime-state durability: **session** — as `brightness`; `currentTemp` moves continuously and is re-published on connect.
20893
+ *
20894
+ * See `RuntimeStateDurability`. Enforced by
20895
+ * `scripts/check-runtime-state-durability.ts`.
20896
+ */
20897
+ durability: "session"
20727
20898
  };
20728
20899
  /**
20729
20900
  * Color-light cap. Coexists with `switch` (on/off) and `brightness`
@@ -20833,7 +21004,14 @@ onColorChanged: { data: object({
20833
21004
  * kernel. Read via `device.state.color.value` so UI pickers surface
20834
21005
  * the current chromaticity without polling the provider.
20835
21006
  */
20836
- runtimeState: ColorStatusSchema
21007
+ runtimeState: ColorStatusSchema,
21008
+ /**
21009
+ * Runtime-state durability: **session** — as `brightness`.
21010
+ *
21011
+ * See `RuntimeStateDurability`. Enforced by
21012
+ * `scripts/check-runtime-state-durability.ts`.
21013
+ */
21014
+ durability: "session"
20837
21015
  };
20838
21016
  var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
20839
21017
  object({
@@ -20891,7 +21069,17 @@ var connectivityCapability = {
20891
21069
  schema: ConnectivityStatusSchema,
20892
21070
  kind: "push"
20893
21071
  },
20894
- runtimeState: ConnectivityStatusSchema
21072
+ runtimeState: ConnectivityStatusSchema,
21073
+ /**
21074
+ * Runtime-state durability: **restored** — same shape and same argument as `device-status`, for links rather than devices.
21075
+ *
21076
+ * See `RuntimeStateDurability`. Enforced by
21077
+ * `scripts/check-runtime-state-durability.ts`.
21078
+ */
21079
+ durability: "restored",
21080
+ /** Clock fields: written, but excluded from the compare that decides
21081
+ * whether persisting is worth a SQLite commit. */
21082
+ volatileStateFields: ["lastChangedAt"]
20895
21083
  };
20896
21084
  /**
20897
21085
  * Generic device-consumables capability — surfaces a device's
@@ -20973,7 +21161,14 @@ reset: method(object({
20973
21161
  }
20974
21162
  }
20975
21163
  },
20976
- runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() })
21164
+ runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() }),
21165
+ /**
21166
+ * Runtime-state durability: **session** — the authority is the appliance; the provider re-reads the whole item array on connect.
21167
+ *
21168
+ * See `RuntimeStateDurability`. Enforced by
21169
+ * `scripts/check-runtime-state-durability.ts`.
21170
+ */
21171
+ durability: "session"
20977
21172
  };
20978
21173
  /**
20979
21174
  * Door / window / opening / garage / valve contact sensor. Boolean
@@ -21004,7 +21199,17 @@ var contactCapability = {
21004
21199
  schema: ContactStatusSchema,
21005
21200
  kind: "push"
21006
21201
  },
21007
- runtimeState: ContactStatusSchema
21202
+ runtimeState: ContactStatusSchema,
21203
+ /**
21204
+ * Runtime-state durability: **restored** — a door left open across a restart must still read open.
21205
+ *
21206
+ * See `RuntimeStateDurability`. Enforced by
21207
+ * `scripts/check-runtime-state-durability.ts`.
21208
+ */
21209
+ durability: "restored",
21210
+ /** Clock fields: written, but excluded from the compare that decides
21211
+ * whether persisting is worth a SQLite commit. */
21212
+ volatileStateFields: ["lastChangedAt"]
21008
21213
  };
21009
21214
  /**
21010
21215
  * Status slice — flat object (the framework's `runtimeState` contract
@@ -21110,7 +21315,14 @@ var controlCapability = {
21110
21315
  * dropdown / text field / date picker) read the slice's discriminant
21111
21316
  * and value directly without polling the provider.
21112
21317
  */
21113
- runtimeState: ControlStatusSchema
21318
+ runtimeState: ControlStatusSchema,
21319
+ /**
21320
+ * Runtime-state durability: **session** — a generic control mirrors an external entity that re-publishes on connect; the options array is re-derived with it.
21321
+ *
21322
+ * See `RuntimeStateDurability`. Enforced by
21323
+ * `scripts/check-runtime-state-durability.ts`.
21324
+ */
21325
+ durability: "session"
21114
21326
  };
21115
21327
  var CoverStatusSchema = object({
21116
21328
  /** Lifecycle state of the cover. */
@@ -21171,7 +21383,17 @@ var coverCapability = {
21171
21383
  * Runtime-state slice — mirrored by the kernel. UI controls watch
21172
21384
  * the slice for live position changes during a move.
21173
21385
  */
21174
- runtimeState: CoverStatusSchema
21386
+ runtimeState: CoverStatusSchema,
21387
+ /**
21388
+ * Runtime-state durability: **restored** — position survives a restart on the device; the mirror should agree at boot rather than read blank.
21389
+ *
21390
+ * See `RuntimeStateDurability`. Enforced by
21391
+ * `scripts/check-runtime-state-durability.ts`.
21392
+ */
21393
+ durability: "restored",
21394
+ /** Clock fields: written, but excluded from the compare that decides
21395
+ * whether persisting is worth a SQLite commit. */
21396
+ volatileStateFields: ["lastChangedAt"]
21175
21397
  };
21176
21398
  /**
21177
21399
  * Vendor-neutral day/night (IR-cut) control — the per-camera config cap
@@ -21265,7 +21487,17 @@ var dayNightCapability = {
21265
21487
  schema: DayNightStatusSchema,
21266
21488
  kind: "poll"
21267
21489
  },
21268
- runtimeState: DayNightStatusSchema
21490
+ runtimeState: DayNightStatusSchema,
21491
+ /**
21492
+ * Runtime-state durability: **restored** — operator-set IR-cut behaviour; mutation-driven.
21493
+ *
21494
+ * See `RuntimeStateDurability`. Enforced by
21495
+ * `scripts/check-runtime-state-durability.ts`.
21496
+ */
21497
+ durability: "restored",
21498
+ /** Clock fields: written, but excluded from the compare that decides
21499
+ * whether persisting is worth a SQLite commit. */
21500
+ volatileStateFields: ["lastFetchedAt"]
21269
21501
  };
21270
21502
  /**
21271
21503
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
@@ -21312,7 +21544,17 @@ onStatusChanged: { data: object({
21312
21544
  schema: DeviceStatusSchema,
21313
21545
  kind: "push"
21314
21546
  },
21315
- runtimeState: DeviceStatusSchema
21547
+ runtimeState: DeviceStatusSchema,
21548
+ /**
21549
+ * 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.
21550
+ *
21551
+ * See `RuntimeStateDurability`. Enforced by
21552
+ * `scripts/check-runtime-state-durability.ts`.
21553
+ */
21554
+ durability: "restored",
21555
+ /** Clock fields: written, but excluded from the compare that decides
21556
+ * whether persisting is worth a SQLite commit. */
21557
+ volatileStateFields: ["lastChangedAt"]
21316
21558
  };
21317
21559
  /**
21318
21560
  * Doorbell button cap. Two kinds of providers coexist behind this cap
@@ -21374,7 +21616,14 @@ onPressed: { data: DoorbellPressEventSchema } },
21374
21616
  * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
21375
21617
  * without subscribing.
21376
21618
  */
21377
- runtimeState: DoorbellStatusSchema
21619
+ runtimeState: DoorbellStatusSchema,
21620
+ /**
21621
+ * 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.
21622
+ *
21623
+ * See `RuntimeStateDurability`. Enforced by
21624
+ * `scripts/check-runtime-state-durability.ts`.
21625
+ */
21626
+ durability: "restored"
21378
21627
  };
21379
21628
  /**
21380
21629
  * Enum-state sensor — a string value picked from a finite option set.
@@ -21414,7 +21663,17 @@ var enumSensorCapability = {
21414
21663
  schema: EnumSensorStatusSchema,
21415
21664
  kind: "push"
21416
21665
  },
21417
- runtimeState: EnumSensorStatusSchema
21666
+ runtimeState: EnumSensorStatusSchema,
21667
+ /**
21668
+ * Runtime-state durability: **restored** — as `numeric-sensor`; 80 devices.
21669
+ *
21670
+ * See `RuntimeStateDurability`. Enforced by
21671
+ * `scripts/check-runtime-state-durability.ts`.
21672
+ */
21673
+ durability: "restored",
21674
+ /** Clock fields: written, but excluded from the compare that decides
21675
+ * whether persisting is worth a SQLite commit. */
21676
+ volatileStateFields: ["lastFetchedAt"]
21418
21677
  };
21419
21678
  /**
21420
21679
  * Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
@@ -21450,7 +21709,14 @@ var eventEmitterCapability = {
21450
21709
  schema: EventEmitterStatusSchema,
21451
21710
  kind: "push"
21452
21711
  },
21453
- runtimeState: EventEmitterStatusSchema
21712
+ runtimeState: EventEmitterStatusSchema,
21713
+ /**
21714
+ * Runtime-state durability: **session** — `eventCountSinceStart` names its own scope.
21715
+ *
21716
+ * See `RuntimeStateDurability`. Enforced by
21717
+ * `scripts/check-runtime-state-durability.ts`.
21718
+ */
21719
+ durability: "session"
21454
21720
  };
21455
21721
  var EventItemSchema = object({
21456
21722
  id: string(),
@@ -21731,7 +21997,14 @@ var fanControlCapability = {
21731
21997
  * Runtime-state slice — mirrored by the kernel. UI fan speed
21732
21998
  * sliders read `percentage` for live updates.
21733
21999
  */
21734
- runtimeState: FanControlStatusSchema
22000
+ runtimeState: FanControlStatusSchema,
22001
+ /**
22002
+ * Runtime-state durability: **session** — as `brightness`.
22003
+ *
22004
+ * See `RuntimeStateDurability`. Enforced by
22005
+ * `scripts/check-runtime-state-durability.ts`.
22006
+ */
22007
+ durability: "session"
21735
22008
  };
21736
22009
  /**
21737
22010
  * Per-device feature/identity probe slice. Holds the runtime-resolved
@@ -21807,7 +22080,14 @@ onProbeChanged: { data: object({
21807
22080
  schema: FeatureProbeStatusSchema,
21808
22081
  kind: "push"
21809
22082
  },
21810
- runtimeState: FeatureProbeStatusSchema
22083
+ runtimeState: FeatureProbeStatusSchema,
22084
+ /**
22085
+ * 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.
22086
+ *
22087
+ * See `RuntimeStateDurability`. Enforced by
22088
+ * `scripts/check-runtime-state-durability.ts`.
22089
+ */
22090
+ durability: "session"
21811
22091
  };
21812
22092
  /**
21813
22093
  * Water leak / moisture sensor. Boolean "is liquid currently
@@ -21834,7 +22114,17 @@ var floodCapability = {
21834
22114
  schema: FloodStatusSchema,
21835
22115
  kind: "push"
21836
22116
  },
21837
- runtimeState: FloodStatusSchema
22117
+ runtimeState: FloodStatusSchema,
22118
+ /**
22119
+ * Runtime-state durability: **restored** — as `smoke`.
22120
+ *
22121
+ * See `RuntimeStateDurability`. Enforced by
22122
+ * `scripts/check-runtime-state-durability.ts`.
22123
+ */
22124
+ durability: "restored",
22125
+ /** Clock fields: written, but excluded from the compare that decides
22126
+ * whether persisting is worth a SQLite commit. */
22127
+ volatileStateFields: ["lastChangedAt"]
21838
22128
  };
21839
22129
  /**
21840
22130
  * Combustible-gas (LPG / methane / hydrogen) alarm sensor. Drives
@@ -21857,7 +22147,17 @@ var gasCapability = {
21857
22147
  schema: GasStatusSchema,
21858
22148
  kind: "push"
21859
22149
  },
21860
- runtimeState: GasStatusSchema
22150
+ runtimeState: GasStatusSchema,
22151
+ /**
22152
+ * Runtime-state durability: **restored** — as `smoke`.
22153
+ *
22154
+ * See `RuntimeStateDurability`. Enforced by
22155
+ * `scripts/check-runtime-state-durability.ts`.
22156
+ */
22157
+ durability: "restored",
22158
+ /** Clock fields: written, but excluded from the compare that decides
22159
+ * whether persisting is worth a SQLite commit. */
22160
+ volatileStateFields: ["lastChangedAt"]
21861
22161
  };
21862
22162
  /**
21863
22163
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
@@ -21933,7 +22233,14 @@ var humidifierCapability = {
21933
22233
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
21934
22234
  * slice for live humidity / mode changes.
21935
22235
  */
21936
- runtimeState: HumidifierStatusSchema
22236
+ runtimeState: HumidifierStatusSchema,
22237
+ /**
22238
+ * Runtime-state durability: **session** — as `climate-control`.
22239
+ *
22240
+ * See `RuntimeStateDurability`. Enforced by
22241
+ * `scripts/check-runtime-state-durability.ts`.
22242
+ */
22243
+ durability: "session"
21937
22244
  };
21938
22245
  /**
21939
22246
  * Single-metric humidity reading. Drives Home Assistant `sensor`
@@ -21969,7 +22276,17 @@ var humiditySensorCapability = {
21969
22276
  schema: HumiditySensorStatusSchema,
21970
22277
  kind: "push"
21971
22278
  },
21972
- runtimeState: HumiditySensorStatusSchema
22279
+ runtimeState: HumiditySensorStatusSchema,
22280
+ /**
22281
+ * Runtime-state durability: **restored** — as `numeric-sensor` (67 of 75 writes were the clock alone).
22282
+ *
22283
+ * See `RuntimeStateDurability`. Enforced by
22284
+ * `scripts/check-runtime-state-durability.ts`.
22285
+ */
22286
+ durability: "restored",
22287
+ /** Clock fields: written, but excluded from the compare that decides
22288
+ * whether persisting is worth a SQLite commit. */
22289
+ volatileStateFields: ["lastFetchedAt"]
21973
22290
  };
21974
22291
  /**
21975
22292
  * Image display cap. Models a single still image exposed by an integration —
@@ -22007,7 +22324,14 @@ var imageCapability = {
22007
22324
  * Runtime-state slice — mirrored by the kernel. The UI reads `url`
22008
22325
  * directly and renders the still image.
22009
22326
  */
22010
- runtimeState: ImageStatusSchema
22327
+ runtimeState: ImageStatusSchema,
22328
+ /**
22329
+ * Runtime-state durability: **session** — a snapshot URL is a session-scoped handle; a restored one points at nothing.
22330
+ *
22331
+ * See `RuntimeStateDurability`. Enforced by
22332
+ * `scripts/check-runtime-state-durability.ts`.
22333
+ */
22334
+ durability: "session"
22011
22335
  };
22012
22336
  /**
22013
22337
  * Vendor-neutral image / picture-adjustment cap — the per-camera config
@@ -22156,7 +22480,17 @@ var imageSettingsCapability = {
22156
22480
  schema: ImageSettingsStatusSchema,
22157
22481
  kind: "poll"
22158
22482
  },
22159
- runtimeState: ImageSettingsStatusSchema
22483
+ runtimeState: ImageSettingsStatusSchema,
22484
+ /**
22485
+ * Runtime-state durability: **restored** — operator-set camera imaging; mutation-driven.
22486
+ *
22487
+ * See `RuntimeStateDurability`. Enforced by
22488
+ * `scripts/check-runtime-state-durability.ts`.
22489
+ */
22490
+ durability: "restored",
22491
+ /** Clock fields: written, but excluded from the compare that decides
22492
+ * whether persisting is worth a SQLite commit. */
22493
+ volatileStateFields: ["lastFetchedAt"]
22160
22494
  };
22161
22495
  /**
22162
22496
  * integrations — system-scoped singleton capability for integration
@@ -22496,7 +22830,14 @@ var lawnMowerControlCapability = {
22496
22830
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22497
22831
  * slice for live activity + battery changes.
22498
22832
  */
22499
- runtimeState: LawnMowerControlStatusSchema
22833
+ runtimeState: LawnMowerControlStatusSchema,
22834
+ /**
22835
+ * Runtime-state durability: **session** — as `vacuum-control`.
22836
+ *
22837
+ * See `RuntimeStateDurability`. Enforced by
22838
+ * `scripts/check-runtime-state-durability.ts`.
22839
+ */
22840
+ durability: "session"
22500
22841
  };
22501
22842
  /**
22502
22843
  * local-network — hub-only singleton.
@@ -22702,7 +23043,17 @@ var lockControlCapability = {
22702
23043
  * read `state` and disable themselves during `locking`/`unlocking`
22703
23044
  * transitions.
22704
23045
  */
22705
- runtimeState: LockControlStatusSchema
23046
+ runtimeState: LockControlStatusSchema,
23047
+ /**
23048
+ * Runtime-state durability: **restored** — a lock left locked must still read locked.
23049
+ *
23050
+ * See `RuntimeStateDurability`. Enforced by
23051
+ * `scripts/check-runtime-state-durability.ts`.
23052
+ */
23053
+ durability: "restored",
23054
+ /** Clock fields: written, but excluded from the compare that decides
23055
+ * whether persisting is worth a SQLite commit. */
23056
+ volatileStateFields: ["lastChangedAt"]
22706
23057
  };
22707
23058
  /**
22708
23059
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
@@ -22864,7 +23215,14 @@ var mediaPlayerCapability = {
22864
23215
  * full slice for live now-playing, volume, and progress updates
22865
23216
  * without polling.
22866
23217
  */
22867
- runtimeState: MediaPlayerStatusSchema
23218
+ runtimeState: MediaPlayerStatusSchema,
23219
+ /**
23220
+ * Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
23221
+ *
23222
+ * See `RuntimeStateDurability`. Enforced by
23223
+ * `scripts/check-runtime-state-durability.ts`.
23224
+ */
23225
+ durability: "session"
22868
23226
  };
22869
23227
  /**
22870
23228
  * mesh-network — collection cap for mesh-VPN providers.
@@ -23128,7 +23486,14 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
23128
23486
  * `device.state.motion.value`. Reads never invoke the provider, so
23129
23487
  * UIs and other addons can poll the cached state safely.
23130
23488
  */
23131
- runtimeState: MotionStatusSchema
23489
+ runtimeState: MotionStatusSchema,
23490
+ /**
23491
+ * 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.
23492
+ *
23493
+ * See `RuntimeStateDurability`. Enforced by
23494
+ * `scripts/check-runtime-state-durability.ts`.
23495
+ */
23496
+ durability: "session"
23132
23497
  };
23133
23498
  /**
23134
23499
  * Motion-trigger toggle for accessory devices.
@@ -23193,7 +23558,14 @@ var motionTriggerCapability = {
23193
23558
  schema: MotionTriggerStatusSchema,
23194
23559
  kind: "command-driven"
23195
23560
  },
23196
- runtimeState: MotionTriggerRuntimeStateSchema
23561
+ runtimeState: MotionTriggerRuntimeStateSchema,
23562
+ /**
23563
+ * 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.
23564
+ *
23565
+ * See `RuntimeStateDurability`. Enforced by
23566
+ * `scripts/check-runtime-state-durability.ts`.
23567
+ */
23568
+ durability: "session"
23197
23569
  };
23198
23570
  /**
23199
23571
  * Motion-zones share the same MaskShape vocabulary as privacy-mask — the
@@ -23260,7 +23632,17 @@ var motionZonesCapability = {
23260
23632
  schema: MotionZoneStatusSchema,
23261
23633
  kind: "poll"
23262
23634
  },
23263
- runtimeState: MotionZoneStatusSchema
23635
+ runtimeState: MotionZoneStatusSchema,
23636
+ /**
23637
+ * 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.
23638
+ *
23639
+ * See `RuntimeStateDurability`. Enforced by
23640
+ * `scripts/check-runtime-state-durability.ts`.
23641
+ */
23642
+ durability: "restored",
23643
+ /** Clock fields: written, but excluded from the compare that decides
23644
+ * whether persisting is worth a SQLite commit. */
23645
+ volatileStateFields: ["lastFetchedAt"]
23264
23646
  };
23265
23647
  /**
23266
23648
  * On-camera AI object detection cap. Surfaces per-device the classes
@@ -23334,7 +23716,17 @@ var nativeObjectDetectionCapability = {
23334
23716
  schema: NativeObjectDetectionStatusSchema,
23335
23717
  kind: "push"
23336
23718
  },
23337
- runtimeState: NativeObjectDetectionRuntimeStateSchema
23719
+ runtimeState: NativeObjectDetectionRuntimeStateSchema,
23720
+ /**
23721
+ * 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.
23722
+ *
23723
+ * See `RuntimeStateDurability`. Enforced by
23724
+ * `scripts/check-runtime-state-durability.ts`.
23725
+ */
23726
+ durability: "restored",
23727
+ /** Clock fields: written, but excluded from the compare that decides
23728
+ * whether persisting is worth a SQLite commit. */
23729
+ volatileStateFields: ["lastFetchedAt"]
23338
23730
  };
23339
23731
  /**
23340
23732
  * network-quality — system-scoped singleton capability tracking RTT,
@@ -23668,7 +24060,14 @@ onSent: { data: object({
23668
24060
  * form reads `supports` to gate optional fields; history pane reads
23669
24061
  * `lastSentAt` / `lastError` / `queueDepth`.
23670
24062
  */
23671
- runtimeState: NotifierStatusSchema
24063
+ runtimeState: NotifierStatusSchema,
24064
+ /**
24065
+ * Runtime-state durability: **session** — live queue depth and last-send state; a restored queue depth describes a queue that no longer exists.
24066
+ *
24067
+ * See `RuntimeStateDurability`. Enforced by
24068
+ * `scripts/check-runtime-state-durability.ts`.
24069
+ */
24070
+ durability: "session"
23672
24071
  };
23673
24072
  /**
23674
24073
  * Generic numeric sensor — last-resort fallback when no typed numeric
@@ -23711,7 +24110,17 @@ var numericSensorCapability = {
23711
24110
  schema: NumericSensorStatusSchema,
23712
24111
  kind: "push"
23713
24112
  },
23714
- runtimeState: NumericSensorStatusSchema
24113
+ runtimeState: NumericSensorStatusSchema,
24114
+ /**
24115
+ * 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.
24116
+ *
24117
+ * See `RuntimeStateDurability`. Enforced by
24118
+ * `scripts/check-runtime-state-durability.ts`.
24119
+ */
24120
+ durability: "restored",
24121
+ /** Clock fields: written, but excluded from the compare that decides
24122
+ * whether persisting is worth a SQLite commit. */
24123
+ volatileStateFields: ["lastFetchedAt"]
23715
24124
  };
23716
24125
  /**
23717
24126
  * Generic on-screen-display (video overlay) cap. Each camera exposes
@@ -24096,7 +24505,14 @@ var petFeederCapability = {
24096
24505
  * the full slice via `device.state.petFeeder.value` and refresh on
24097
24506
  * every poll without re-querying the provider.
24098
24507
  */
24099
- runtimeState: PetFeederStatusSchema
24508
+ runtimeState: PetFeederStatusSchema,
24509
+ /**
24510
+ * Runtime-state durability: **session** — live appliance state re-published on connect.
24511
+ *
24512
+ * See `RuntimeStateDurability`. Enforced by
24513
+ * `scripts/check-runtime-state-durability.ts`.
24514
+ */
24515
+ durability: "session"
24100
24516
  };
24101
24517
  var VehicleSchema = object({
24102
24518
  id: string(),
@@ -24408,7 +24824,17 @@ var powerMeterCapability = {
24408
24824
  schema: PowerMeterStatusSchema,
24409
24825
  kind: "push"
24410
24826
  },
24411
- runtimeState: PowerMeterStatusSchema
24827
+ runtimeState: PowerMeterStatusSchema,
24828
+ /**
24829
+ * Runtime-state durability: **restored** — as `numeric-sensor`; `kwhTotal` is an accumulator whose restored value is the baseline.
24830
+ *
24831
+ * See `RuntimeStateDurability`. Enforced by
24832
+ * `scripts/check-runtime-state-durability.ts`.
24833
+ */
24834
+ durability: "restored",
24835
+ /** Clock fields: written, but excluded from the compare that decides
24836
+ * whether persisting is worth a SQLite commit. */
24837
+ volatileStateFields: ["lastFetchedAt"]
24412
24838
  };
24413
24839
  /**
24414
24840
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -24465,7 +24891,17 @@ var presenceCapability = {
24465
24891
  * the map pin is rendered (use `DeviceFeature.PresenceGps` for the
24466
24892
  * pre-fetch fast-path check).
24467
24893
  */
24468
- runtimeState: PresenceStatusSchema
24894
+ runtimeState: PresenceStatusSchema,
24895
+ /**
24896
+ * Runtime-state durability: **restored** — occupancy-relevant: the restored state is what an occupancy rule compares the first post-restart observation against.
24897
+ *
24898
+ * See `RuntimeStateDurability`. Enforced by
24899
+ * `scripts/check-runtime-state-durability.ts`.
24900
+ */
24901
+ durability: "restored",
24902
+ /** Clock fields: written, but excluded from the compare that decides
24903
+ * whether persisting is worth a SQLite commit. */
24904
+ volatileStateFields: ["lastChangedAt"]
24469
24905
  };
24470
24906
  /**
24471
24907
  * Atmospheric pressure reading in hectopascals. Drives Home Assistant
@@ -24501,7 +24937,17 @@ var pressureSensorCapability = {
24501
24937
  schema: PressureSensorStatusSchema,
24502
24938
  kind: "push"
24503
24939
  },
24504
- runtimeState: PressureSensorStatusSchema
24940
+ runtimeState: PressureSensorStatusSchema,
24941
+ /**
24942
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
24943
+ *
24944
+ * See `RuntimeStateDurability`. Enforced by
24945
+ * `scripts/check-runtime-state-durability.ts`.
24946
+ */
24947
+ durability: "restored",
24948
+ /** Clock fields: written, but excluded from the compare that decides
24949
+ * whether persisting is worth a SQLite commit. */
24950
+ volatileStateFields: ["lastFetchedAt"]
24505
24951
  };
24506
24952
  /**
24507
24953
  * PRIVACY — what the camera deliberately does not capture. Two planes:
@@ -24631,7 +25077,17 @@ var privacyMaskCapability = {
24631
25077
  schema: PrivacyMaskStatusSchema,
24632
25078
  kind: "poll"
24633
25079
  },
24634
- runtimeState: PrivacyMaskStatusSchema
25080
+ runtimeState: PrivacyMaskStatusSchema,
25081
+ /**
25082
+ * Runtime-state durability: **restored** — operator-drawn regions, zero real churn — 22 writes in 25 minutes, every one of them the clock.
25083
+ *
25084
+ * See `RuntimeStateDurability`. Enforced by
25085
+ * `scripts/check-runtime-state-durability.ts`.
25086
+ */
25087
+ durability: "restored",
25088
+ /** Clock fields: written, but excluded from the compare that decides
25089
+ * whether persisting is worth a SQLite commit. */
25090
+ volatileStateFields: ["lastFetchedAt"]
24635
25091
  };
24636
25092
  var PtzPresetSchema = object({
24637
25093
  id: string(),
@@ -24797,7 +25253,14 @@ var ptzAutotrackCapability = {
24797
25253
  * fetch / cache / fallback logic out of the four cap methods —
24798
25254
  * they become trampolines over `runtimeState`.
24799
25255
  */
24800
- runtimeState: PtzAutotrackRuntimeStateSchema
25256
+ runtimeState: PtzAutotrackRuntimeStateSchema,
25257
+ /**
25258
+ * Runtime-state durability: **session** — mirrors the camera's own autotrack config, re-read on connect.
25259
+ *
25260
+ * See `RuntimeStateDurability`. Enforced by
25261
+ * `scripts/check-runtime-state-durability.ts`.
25262
+ */
25263
+ durability: "session"
24801
25264
  };
24802
25265
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
24803
25266
  kind: "mutation",
@@ -25144,13 +25607,24 @@ method(object({
25144
25607
  /** Playback-speed multiplier for the render (1 = realtime). */
25145
25608
  var ExportSpeedSchema = number().min(.25).max(32);
25146
25609
  /**
25147
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25610
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
25611
+ *
25612
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
25613
+ * derives these bounds from things that happened at a TIME (a track's
25614
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
25615
+ * every segment present for the range, with each recording GAP removed. The
25616
+ * two agree only on a window that recorded without one interruption, and only
25617
+ * the render side knows the segments, so the translation lives there
25618
+ * (`export-dense-map.ts`, addon-pipeline).
25619
+ *
25620
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
25621
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
25622
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
25623
+ * the video was a uniform timelapse, and the log line reported the five ranges
25624
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
25148
25625
  *
25149
- * Relative and not absolute epoch on purpose: the renderer's frame-select
25150
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25151
- * playlist. Handing it absolute epochs would make every call site responsible
25152
- * for the same subtraction, and the one that forgot would emit a filter that
25153
- * selects nothing — silently, as a uniform timelapse.
25626
+ * Relative and not absolute epoch, because an absolute epoch would make every
25627
+ * call site responsible for the same subtraction.
25154
25628
  */
25155
25629
  var ExportDenseRangeSchema = object({
25156
25630
  fromSec: number().nonnegative(),
@@ -25436,7 +25910,14 @@ var sceneMonitorCapability = {
25436
25910
  schema: SceneMonitorStatusSchema,
25437
25911
  kind: "push"
25438
25912
  },
25439
- runtimeState: SceneMonitorStatusSchema
25913
+ runtimeState: SceneMonitorStatusSchema,
25914
+ /**
25915
+ * Runtime-state durability: **session** — re-derived from the current scene on the next evaluation.
25916
+ *
25917
+ * See `RuntimeStateDurability`. Enforced by
25918
+ * `scripts/check-runtime-state-durability.ts`.
25919
+ */
25920
+ durability: "session"
25440
25921
  };
25441
25922
  /**
25442
25923
  * Per-stage gating mode applied to the zones a rule references.
@@ -25580,7 +26061,14 @@ var scriptRunnerCapability = {
25580
26061
  * `isRunning` to render a spinner during execution and surfaces
25581
26062
  * `lastError` / `lastRunSuccess` in the recent-runs panel.
25582
26063
  */
25583
- runtimeState: ScriptRunnerStatusSchema
26064
+ runtimeState: ScriptRunnerStatusSchema,
26065
+ /**
26066
+ * Runtime-state durability: **session** — a restored `isRunning: true` describes a process that died with the previous hub.
26067
+ *
26068
+ * See `RuntimeStateDurability`. Enforced by
26069
+ * `scripts/check-runtime-state-durability.ts`.
26070
+ */
26071
+ durability: "session"
25584
26072
  };
25585
26073
  /**
25586
26074
  * Smoke alarm sensor — boolean "is smoke currently detected" with
@@ -25607,7 +26095,17 @@ var smokeCapability = {
25607
26095
  schema: SmokeStatusSchema,
25608
26096
  kind: "push"
25609
26097
  },
25610
- runtimeState: SmokeStatusSchema
26098
+ runtimeState: SmokeStatusSchema,
26099
+ /**
26100
+ * Runtime-state durability: **restored** — a safety sensor must not read "clear" merely because the hub restarted.
26101
+ *
26102
+ * See `RuntimeStateDurability`. Enforced by
26103
+ * `scripts/check-runtime-state-durability.ts`.
26104
+ */
26105
+ durability: "restored",
26106
+ /** Clock fields: written, but excluded from the compare that decides
26107
+ * whether persisting is worth a SQLite commit. */
26108
+ volatileStateFields: ["lastChangedAt"]
25611
26109
  };
25612
26110
  /**
25613
26111
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -25780,7 +26278,17 @@ var streamParamsCapability = {
25780
26278
  schema: StreamParamsStatusSchema,
25781
26279
  kind: "poll"
25782
26280
  },
25783
- runtimeState: StreamParamsStatusSchema
26281
+ runtimeState: StreamParamsStatusSchema,
26282
+ /**
26283
+ * Runtime-state durability: **restored** — operator-set encoder profile; mutation-driven.
26284
+ *
26285
+ * See `RuntimeStateDurability`. Enforced by
26286
+ * `scripts/check-runtime-state-durability.ts`.
26287
+ */
26288
+ durability: "restored",
26289
+ /** Clock fields: written, but excluded from the compare that decides
26290
+ * whether persisting is worth a SQLite commit. */
26291
+ volatileStateFields: ["lastFetchedAt"]
25784
26292
  };
25785
26293
  /**
25786
26294
  * Generic on/off switch cap for accessory children (siren, floodlight,
@@ -25826,6 +26334,16 @@ var switchCapability = {
25826
26334
  * not need to re-query the provider after a setState mutation.
25827
26335
  */
25828
26336
  runtimeState: SwitchStatusSchema,
26337
+ /**
26338
+ * Runtime-state durability: **restored** — device state an operator reads as authoritative; 55 devices, transition-driven.
26339
+ *
26340
+ * See `RuntimeStateDurability`. Enforced by
26341
+ * `scripts/check-runtime-state-durability.ts`.
26342
+ */
26343
+ durability: "restored",
26344
+ /** Clock fields: written, but excluded from the compare that decides
26345
+ * whether persisting is worth a SQLite commit. */
26346
+ volatileStateFields: ["lastChangedAt"],
25829
26347
  settings: { bindings: [{
25830
26348
  kind: "scalar",
25831
26349
  statusPath: "on",
@@ -25905,7 +26423,17 @@ var tamperCapability = {
25905
26423
  schema: TamperStatusSchema,
25906
26424
  kind: "push"
25907
26425
  },
25908
- runtimeState: TamperStatusSchema
26426
+ runtimeState: TamperStatusSchema,
26427
+ /**
26428
+ * Runtime-state durability: **restored** — as `smoke`.
26429
+ *
26430
+ * See `RuntimeStateDurability`. Enforced by
26431
+ * `scripts/check-runtime-state-durability.ts`.
26432
+ */
26433
+ durability: "restored",
26434
+ /** Clock fields: written, but excluded from the compare that decides
26435
+ * whether persisting is worth a SQLite commit. */
26436
+ volatileStateFields: ["lastChangedAt"]
25909
26437
  };
25910
26438
  /**
25911
26439
  * Single-metric temperature reading. Drives Home Assistant `sensor`
@@ -25950,7 +26478,17 @@ var temperatureSensorCapability = {
25950
26478
  schema: TemperatureSensorStatusSchema,
25951
26479
  kind: "push"
25952
26480
  },
25953
- runtimeState: TemperatureSensorStatusSchema
26481
+ runtimeState: TemperatureSensorStatusSchema,
26482
+ /**
26483
+ * Runtime-state durability: **restored** — as `numeric-sensor` (69 of 125 writes were the clock alone).
26484
+ *
26485
+ * See `RuntimeStateDurability`. Enforced by
26486
+ * `scripts/check-runtime-state-durability.ts`.
26487
+ */
26488
+ durability: "restored",
26489
+ /** Clock fields: written, but excluded from the compare that decides
26490
+ * whether persisting is worth a SQLite commit. */
26491
+ volatileStateFields: ["lastFetchedAt"]
25954
26492
  };
25955
26493
  /**
25956
26494
  * toast — system-scoped singleton capability that streams toast
@@ -26019,7 +26557,14 @@ var updateCapability = {
26019
26557
  schema: UpdateStatusSchema,
26020
26558
  kind: "poll"
26021
26559
  },
26022
- runtimeState: UpdateStatusSchema
26560
+ runtimeState: UpdateStatusSchema,
26561
+ /**
26562
+ * Runtime-state durability: **session** — a restored `inProgress: true` describes an update that is no longer running; versions are re-probed at boot.
26563
+ *
26564
+ * See `RuntimeStateDurability`. Enforced by
26565
+ * `scripts/check-runtime-state-durability.ts`.
26566
+ */
26567
+ durability: "session"
26023
26568
  };
26024
26569
  var UserSummarySchema = object({
26025
26570
  id: string(),
@@ -26353,7 +26898,14 @@ var vacuumControlCapability = {
26353
26898
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26354
26899
  * slice for live state + battery + fan-speed changes.
26355
26900
  */
26356
- runtimeState: VacuumControlStatusSchema
26901
+ runtimeState: VacuumControlStatusSchema,
26902
+ /**
26903
+ * Runtime-state durability: **session** — as `media-player` — a restored `state: cleaning` is a robot that is not cleaning.
26904
+ *
26905
+ * See `RuntimeStateDurability`. Enforced by
26906
+ * `scripts/check-runtime-state-durability.ts`.
26907
+ */
26908
+ durability: "session"
26357
26909
  };
26358
26910
  var ValveStatusSchema = object({
26359
26911
  /** Lifecycle state of the valve. */
@@ -26405,7 +26957,14 @@ var valveCapability = {
26405
26957
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26406
26958
  * slice for live position changes during a move.
26407
26959
  */
26408
- runtimeState: ValveStatusSchema
26960
+ runtimeState: ValveStatusSchema,
26961
+ /**
26962
+ * Runtime-state durability: **session** — as `brightness`.
26963
+ *
26964
+ * See `RuntimeStateDurability`. Enforced by
26965
+ * `scripts/check-runtime-state-durability.ts`.
26966
+ */
26967
+ durability: "session"
26409
26968
  };
26410
26969
  /**
26411
26970
  * Vibration / shake / impact sensor. Drives Home Assistant
@@ -26427,7 +26986,17 @@ var vibrationCapability = {
26427
26986
  schema: VibrationStatusSchema,
26428
26987
  kind: "push"
26429
26988
  },
26430
- runtimeState: VibrationStatusSchema
26989
+ runtimeState: VibrationStatusSchema,
26990
+ /**
26991
+ * Runtime-state durability: **restored** — as `smoke`.
26992
+ *
26993
+ * See `RuntimeStateDurability`. Enforced by
26994
+ * `scripts/check-runtime-state-durability.ts`.
26995
+ */
26996
+ durability: "restored",
26997
+ /** Clock fields: written, but excluded from the compare that decides
26998
+ * whether persisting is worth a SQLite commit. */
26999
+ volatileStateFields: ["lastChangedAt"]
26431
27000
  };
26432
27001
  /**
26433
27002
  * Water heater / boiler cap. Models HA `water_heater.*` entities — a
@@ -26501,7 +27070,14 @@ var waterHeaterCapability = {
26501
27070
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26502
27071
  * slice for live temperature / mode / away changes.
26503
27072
  */
26504
- runtimeState: WaterHeaterStatusSchema
27073
+ runtimeState: WaterHeaterStatusSchema,
27074
+ /**
27075
+ * Runtime-state durability: **session** — as `climate-control`.
27076
+ *
27077
+ * See `RuntimeStateDurability`. Enforced by
27078
+ * `scripts/check-runtime-state-durability.ts`.
27079
+ */
27080
+ durability: "session"
26505
27081
  };
26506
27082
  /**
26507
27083
  * Weather provider cap. Models HA `weather.*` entities — a read-only
@@ -26560,7 +27136,14 @@ var weatherCapability = {
26560
27136
  * Runtime-state slice — mirrored by the kernel. The UI reads the
26561
27137
  * current conditions directly from the slice on each weather push.
26562
27138
  */
26563
- runtimeState: WeatherStatusSchema
27139
+ runtimeState: WeatherStatusSchema,
27140
+ /**
27141
+ * Runtime-state durability: **session** — a forecast is stale the moment the hub is down; the provider re-fetches on connect.
27142
+ *
27143
+ * See `RuntimeStateDurability`. Enforced by
27144
+ * `scripts/check-runtime-state-durability.ts`.
27145
+ */
27146
+ durability: "session"
26564
27147
  };
26565
27148
  /**
26566
27149
  * Per-zone occupancy aggregation produced by the analytics frame
@@ -26722,7 +27305,14 @@ var zoneAnalyticsCapability = {
26722
27305
  * automatically; the explicit `getCurrentSnapshot` cap method is
26723
27306
  * still useful for one-off polls without a subscription.
26724
27307
  */
26725
- runtimeState: CameraOccupancySnapshotSchema
27308
+ runtimeState: CameraOccupancySnapshotSchema,
27309
+ /**
27310
+ * Runtime-state durability: **session** — per-frame analytics; with `audio-metrics` it is ~90 % of the offered write rate. Re-derived on the next frame.
27311
+ *
27312
+ * See `RuntimeStateDurability`. Enforced by
27313
+ * `scripts/check-runtime-state-durability.ts`.
27314
+ */
27315
+ durability: "session"
26726
27316
  };
26727
27317
  /**
26728
27318
  * Stages a {@link ZoneRule} can apply to. Discriminator on the rules
@@ -26800,7 +27390,14 @@ var zoneRulesCapability = {
26800
27390
  motion: array(ZoneRuleSchema).readonly(),
26801
27391
  detection: array(ZoneRuleSchema).readonly(),
26802
27392
  package: array(ZoneRuleSchema).readonly()
26803
- })
27393
+ }),
27394
+ /**
27395
+ * Runtime-state durability: **restored** — operator intent, mutation-only, same argument as `zones`.
27396
+ *
27397
+ * See `RuntimeStateDurability`. Enforced by
27398
+ * `scripts/check-runtime-state-durability.ts`.
27399
+ */
27400
+ durability: "restored"
26804
27401
  };
26805
27402
  /**
26806
27403
  * Accessory device helpers — shared across drivers.
@@ -33487,6 +34084,7 @@ Object.freeze({
33487
34084
  "network-access": "ingress",
33488
34085
  "smtp-provider": "email"
33489
34086
  });
34087
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
33490
34088
  new Set(["devices", "classes"]);
33491
34089
  /**
33492
34090
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
@@ -33764,25 +34362,32 @@ object({
33764
34362
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
33765
34363
  object({
33766
34364
  /**
33767
- * How long a retained native frame is served before it counts as a miss.
34365
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
34366
+ * detection result.
33768
34367
  *
33769
- * Must cover the FULL late-crop horizon: detection inference + the
33770
- * cross-process inference-result hop to hub post-analysis + tracking + the
33771
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
33772
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
33773
- * RAM per busy camera grows linearly with no measured hit-rate gain.
34368
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
34369
+ * a time window was never related to the event the pixels were waiting for.
34370
+ * A held frame now lives from delivery until the runner has its `FrameResult`
34371
+ * at which moment the runner cuts the subject tiles it actually wanted and
34372
+ * releases the frame. The bound exists only so a runner that stops answering
34373
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
34374
+ *
34375
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
34376
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
34377
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
34378
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
34379
+ * `holdOverflow` on the metrics line is what says you need it.
33774
34380
  */
33775
- ttlMs: number().int().min(250).max(1e4),
34381
+ holdFrames: number().int().min(1).max(64),
33776
34382
  /**
33777
34383
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
33778
34384
  *
33779
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
33780
- * which one is actually binding before reasoning from that. At the shipped
33781
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
33782
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
33783
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
33784
- * change that admits fewer frames buys retention WINDOW at constant RAM
33785
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
34385
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
34386
+ * is what decides how much is held, and the ceiling is the number above which
34387
+ * something is wrong. Before that it was the effective cap at 1024 MB with
34388
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
34389
+ * with the TTL expiring nothing, which is exactly the confusion the hold
34390
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
33786
34391
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
33787
34392
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
33788
34393
  * to replace).
@@ -33808,22 +34413,45 @@ object({
33808
34413
  * there is the signal that some caller names frames outside the inference set
33809
34414
  * and that this must go back to `all`.
33810
34415
  */
33811
- admission: NativeLeaseAdmissionSchema
34416
+ admission: NativeLeaseAdmissionSchema,
34417
+ /**
34418
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
34419
+ * compressed native crops the worker cuts at the moment a frame's detection
34420
+ * result arrives, and keeps long after the frame itself is freed.
34421
+ *
34422
+ * This is the knob that replaced the old retention window, and it buys about
34423
+ * three orders of magnitude more of it: a tile is one subject at native
34424
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
34425
+ * the frame it was cut from. A frame on which nothing was detected costs
34426
+ * nothing at all, which is the real change — the old lease paid per FRAME and
34427
+ * was interrogated per SUBJECT.
34428
+ *
34429
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
34430
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34431
+ * reproduce that.
34432
+ */
34433
+ tileBudgetMb: number().int().min(0).max(1024)
33812
34434
  });
33813
34435
  /**
33814
- * The values in force when the operator has set nothing — byte-for-byte the
33815
- * constants the decode worker shipped with as env-var defaults, so making these
33816
- * settings changed no behaviour on the day it landed.
34436
+ * The values in force when the operator has set nothing.
34437
+ *
34438
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
34439
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
34440
+ * in the same change that redefines it would make a regression and a retune
34441
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
34442
+ * live traffic.
33817
34443
  */
33818
34444
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
33819
- ttlMs: 1200,
34445
+ holdFrames: 8,
33820
34446
  budgetMb: 1024,
33821
34447
  activityMs: 15e3,
34448
+ tileBudgetMb: 64,
33822
34449
  admission: "inferred"
33823
34450
  };
33824
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
34451
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
33825
34452
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
33826
34453
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34454
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
33827
34455
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
33828
34456
  //#endregion
33829
34457
  //#region src/config.ts