@camstack/addon-provider-homematic 1.2.15 → 1.2.17

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
@@ -10829,7 +10829,14 @@ var cameraStreamsCapability = {
10829
10829
  low: string().optional()
10830
10830
  }),
10831
10831
  lastChangedAt: number()
10832
- })
10832
+ }),
10833
+ /**
10834
+ * 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.
10835
+ *
10836
+ * See `RuntimeStateDurability`. Enforced by
10837
+ * `scripts/check-runtime-state-durability.ts`.
10838
+ */
10839
+ durability: "session"
10833
10840
  };
10834
10841
  /** Where a block runs. The operator chooses — a block driving a device on an
10835
10842
  * agent is the reason placement is not fixed to the hub. */
@@ -11390,6 +11397,13 @@ var deviceDiscoveryCapability = {
11390
11397
  kind: "poll"
11391
11398
  },
11392
11399
  runtimeState: DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: number().int().nonnegative() }),
11400
+ /**
11401
+ * Runtime-state durability: **session** — 5.7 KB of scan output on the largest device, fully re-derivable by re-scanning.
11402
+ *
11403
+ * See `RuntimeStateDurability`. Enforced by
11404
+ * `scripts/check-runtime-state-durability.ts`.
11405
+ */
11406
+ durability: "session",
11393
11407
  methods: {
11394
11408
  /**
11395
11409
  * Snapshot of the current `discovered` list. Returns the
@@ -13306,7 +13320,23 @@ var NotificationActionSchema = object({
13306
13320
  * else — see `notification-center/action-token.ts` for what that does and
13307
13321
  * does not buy.
13308
13322
  */
13309
- destructive: boolean().optional()
13323
+ destructive: boolean().optional(),
13324
+ /**
13325
+ * How the tap should REACH the url.
13326
+ *
13327
+ * `navigate` (absent, and every button authored before this field) opens it:
13328
+ * the phone leaves the notification and shows whatever the callback returns.
13329
+ * That is right for a button whose answer the operator wants to read.
13330
+ *
13331
+ * `background` fires it as a POST and stays put. It exists for the buttons
13332
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13333
+ * an answer to the notification, and being thrown into a browser tab to
13334
+ * confirm it costs more attention than the notification did. A backend that
13335
+ * cannot do a background call renders it as an ordinary link (the adapters
13336
+ * fall back rather than dropping the button), so this is a preference, never
13337
+ * a requirement.
13338
+ */
13339
+ mode: _enum(["navigate", "background"]).optional()
13310
13340
  });
13311
13341
  /**
13312
13342
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -14158,7 +14188,17 @@ var alarmPanelCapability = {
14158
14188
  * full slice; renders an arm button per `availableModes` entry and
14159
14189
  * a PIN field iff `requiresCode === true`.
14160
14190
  */
14161
- runtimeState: AlarmPanelStatusSchema
14191
+ runtimeState: AlarmPanelStatusSchema,
14192
+ /**
14193
+ * Runtime-state durability: **restored** — armed state is the one thing a panel must not lose across a restart.
14194
+ *
14195
+ * See `RuntimeStateDurability`. Enforced by
14196
+ * `scripts/check-runtime-state-durability.ts`.
14197
+ */
14198
+ durability: "restored",
14199
+ /** Clock fields: written, but excluded from the compare that decides
14200
+ * whether persisting is worth a SQLite commit. */
14201
+ volatileStateFields: ["lastChangedAt"]
14162
14202
  };
14163
14203
  /**
14164
14204
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
@@ -14335,6 +14375,9 @@ var NcSystemEventConditionSchema = object({
14335
14375
  nodeIds: array(string().min(1)).min(1).optional(),
14336
14376
  packageNames: array(string().min(1)).min(1).optional()
14337
14377
  });
14378
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14379
+ * outage the operator asked for once and forgot. */
14380
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14338
14381
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14339
14382
  var NcScheduleSchema = object({
14340
14383
  windows: array(object({
@@ -14711,15 +14754,15 @@ var NcConditionsSchema = object({
14711
14754
  * (an `immediate` rule naming an `audio-*` class, one notification per
14712
14755
  * classified sample) stays exactly as it was for rules that already use it.
14713
14756
  *
14714
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14715
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14716
- * (`camstack/src/data/notification-center.ts`, guarded by
14717
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14757
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14758
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14759
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14760
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14718
14761
  * condition fields it does not know when a rule is saved from the phone.
14719
14762
  * Publishing an editor for a condition the app cannot round-trip is how an
14720
- * operator loses a rule's conditions by opening it — so the descriptor, the
14721
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14722
- * does an audio rule become authorable.
14763
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14764
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14765
+ * follows here.
14723
14766
  */
14724
14767
  audio: NcAudioConditionSchema.optional()
14725
14768
  });
@@ -14955,6 +14998,30 @@ var NcRuleInputSchema = object({
14955
14998
  */
14956
14999
  snoozeAllowGlobal: boolean().optional(),
14957
15000
  /**
15001
+ * The snooze durations THIS rule's notification offers as buttons, in
15002
+ * minutes.
15003
+ *
15004
+ * Three states, and all three are distinct — which is exactly why this is
15005
+ * `.optional()` and never `.default()`. A Zod default does not run on the
15006
+ * addon cap path (three production failures in one day), so a schema default
15007
+ * would collapse the first two:
15008
+ *
15009
+ * | value | meaning |
15010
+ * | --- | --- |
15011
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
15012
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
15013
+ * | a list | these choices, de-duplicated and sorted, at most four |
15014
+ *
15015
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
15016
+ * three buttons in total) and a rule that spent it all on snooze choices
15017
+ * would push its own tap-through actions off the notification.
15018
+ *
15019
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
15020
+ * that arms the panel, is exempt automatically and cannot be silenced by a
15021
+ * window from anywhere (D133).
15022
+ */
15023
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
15024
+ /**
14958
15025
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14959
15026
  *
14960
15027
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -15054,6 +15121,7 @@ var NcConditionDescriptorSchema = object({
15054
15121
  "device",
15055
15122
  "package",
15056
15123
  "occupancy",
15124
+ "audio",
15057
15125
  "system"
15058
15126
  ]),
15059
15127
  label: string(),
@@ -15072,6 +15140,7 @@ var NcConditionDescriptorSchema = object({
15072
15140
  "crossingSelect",
15073
15141
  "polygonDraw",
15074
15142
  "occupancy",
15143
+ "audio",
15075
15144
  "deviceState",
15076
15145
  "systemEvent"
15077
15146
  ]),
@@ -15223,7 +15292,20 @@ var NcSnoozeInputSchema = object({
15223
15292
  ruleId: string().optional(),
15224
15293
  /** Required when `scope: 'device'`. */
15225
15294
  deviceId: number().int().optional(),
15226
- durationMinutes: number().int().min(1).max(1440),
15295
+ /**
15296
+ * Narrow the window to these subject classes — "the cat, not the person".
15297
+ *
15298
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15299
+ * what every window authored before this field meant, so no persisted row
15300
+ * changes meaning and no client has to learn anything to keep working.
15301
+ *
15302
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15303
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15304
+ * not at whichever of their four rules happened to produce the notification
15305
+ * they are dismissing.
15306
+ */
15307
+ classes: array(string().min(1)).min(1).optional(),
15308
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
15227
15309
  /**
15228
15310
  * Silence this for EVERY recipient, not just the caller. Permission is
15229
15311
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15248,6 +15330,10 @@ var NcSnoozeSchema = object({
15248
15330
  scope: NcSnoozeScopeSchema,
15249
15331
  ruleId: string().optional(),
15250
15332
  deviceId: number().int().optional(),
15333
+ /** Subject classes this window covers. ABSENT = every class — see
15334
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15335
+ * no SQLite column: nothing queries a window by class. */
15336
+ classes: array(string().min(1)).min(1).optional(),
15251
15337
  startedAt: number(),
15252
15338
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15253
15339
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -17348,7 +17434,14 @@ var zonesCapability = {
17348
17434
  * handle. Slice shape is `{ zones: Zone[] }` so future extensions
17349
17435
  * (e.g. zone groupings) can sit alongside the polygon list.
17350
17436
  */
17351
- runtimeState: object({ zones: array(ZoneSchema).readonly() })
17437
+ runtimeState: object({ zones: array(ZoneSchema).readonly() }),
17438
+ /**
17439
+ * 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.
17440
+ *
17441
+ * See `RuntimeStateDurability`. Enforced by
17442
+ * `scripts/check-runtime-state-durability.ts`.
17443
+ */
17444
+ durability: "restored"
17352
17445
  };
17353
17446
  /**
17354
17447
  * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
@@ -20147,7 +20240,17 @@ var airQualitySensorCapability = {
20147
20240
  schema: AirQualitySensorStatusSchema,
20148
20241
  kind: "push"
20149
20242
  },
20150
- runtimeState: AirQualitySensorStatusSchema
20243
+ runtimeState: AirQualitySensorStatusSchema,
20244
+ /**
20245
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20246
+ *
20247
+ * See `RuntimeStateDurability`. Enforced by
20248
+ * `scripts/check-runtime-state-durability.ts`.
20249
+ */
20250
+ durability: "restored",
20251
+ /** Clock fields: written, but excluded from the compare that decides
20252
+ * whether persisting is worth a SQLite commit. */
20253
+ volatileStateFields: ["lastFetchedAt"]
20151
20254
  };
20152
20255
  /**
20153
20256
  * Ambient illuminance reading in lux. Drives Home Assistant `sensor`
@@ -20179,7 +20282,17 @@ var ambientLightSensorCapability = {
20179
20282
  schema: AmbientLightSensorStatusSchema,
20180
20283
  kind: "push"
20181
20284
  },
20182
- runtimeState: AmbientLightSensorStatusSchema
20285
+ runtimeState: AmbientLightSensorStatusSchema,
20286
+ /**
20287
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20288
+ *
20289
+ * See `RuntimeStateDurability`. Enforced by
20290
+ * `scripts/check-runtime-state-durability.ts`.
20291
+ */
20292
+ durability: "restored",
20293
+ /** Clock fields: written, but excluded from the compare that decides
20294
+ * whether persisting is worth a SQLite commit. */
20295
+ volatileStateFields: ["lastFetchedAt"]
20183
20296
  };
20184
20297
  /**
20185
20298
  * Per-class audio metrics aggregated over a sliding window.
@@ -20297,7 +20410,14 @@ var audioMetricsCapability = {
20297
20410
  }), AudioMetricsHistorySchema)
20298
20411
  },
20299
20412
  /** Reactive runtime-state mirror — live `device.state.audioMetrics.value`. */
20300
- runtimeState: AudioMetricsSnapshotSchema
20413
+ runtimeState: AudioMetricsSnapshotSchema,
20414
+ /**
20415
+ * 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.
20416
+ *
20417
+ * See `RuntimeStateDurability`. Enforced by
20418
+ * `scripts/check-runtime-state-durability.ts`.
20419
+ */
20420
+ durability: "session"
20301
20421
  };
20302
20422
  /**
20303
20423
  * Automation-control cap. Models HA `automation.*` entities on
@@ -20359,7 +20479,14 @@ var automationControlCapability = {
20359
20479
  * reads `enabled` (toggle) + `isRunning` (spinner) + `lastError`
20360
20480
  * (badge) directly.
20361
20481
  */
20362
- runtimeState: AutomationControlStatusSchema
20482
+ runtimeState: AutomationControlStatusSchema,
20483
+ /**
20484
+ * 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.
20485
+ *
20486
+ * See `RuntimeStateDurability`. Enforced by
20487
+ * `scripts/check-runtime-state-durability.ts`.
20488
+ */
20489
+ durability: "session"
20363
20490
  };
20364
20491
  /**
20365
20492
  * Battery status snapshot. Emitted by providers whose device is
@@ -20465,7 +20592,17 @@ onStatusChanged: { data: object({
20465
20592
  * via `device.runtimeState.getCapState('battery')` regardless of
20466
20593
  * the underlying driver.
20467
20594
  */
20468
- runtimeState: BatteryStatusSchema
20595
+ runtimeState: BatteryStatusSchema,
20596
+ /**
20597
+ * 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.
20598
+ *
20599
+ * See `RuntimeStateDurability`. Enforced by
20600
+ * `scripts/check-runtime-state-durability.ts`.
20601
+ */
20602
+ durability: "restored",
20603
+ /** Clock fields: written, but excluded from the compare that decides
20604
+ * whether persisting is worth a SQLite commit. */
20605
+ volatileStateFields: ["lastUpdated"]
20469
20606
  };
20470
20607
  /**
20471
20608
  * Generic boolean sensor — last-resort fallback when no domain-
@@ -20494,7 +20631,17 @@ var binaryCapability = {
20494
20631
  schema: BinaryStatusSchema,
20495
20632
  kind: "push"
20496
20633
  },
20497
- runtimeState: BinaryStatusSchema
20634
+ runtimeState: BinaryStatusSchema,
20635
+ /**
20636
+ * Runtime-state durability: **restored** — transition-driven sensor state; the restored value gives the boot comparison.
20637
+ *
20638
+ * See `RuntimeStateDurability`. Enforced by
20639
+ * `scripts/check-runtime-state-durability.ts`.
20640
+ */
20641
+ durability: "restored",
20642
+ /** Clock fields: written, but excluded from the compare that decides
20643
+ * whether persisting is worth a SQLite commit. */
20644
+ volatileStateFields: ["lastChangedAt"]
20498
20645
  };
20499
20646
  /**
20500
20647
  * Dimmable-light brightness control. Co-exists with `switch` on the
@@ -20547,7 +20694,14 @@ onBrightnessChanged: { data: object({
20547
20694
  * by the kernel. Read via `device.state.brightness.value` so UI
20548
20695
  * sliders surface the current level without polling the provider.
20549
20696
  */
20550
- runtimeState: BrightnessStatusSchema
20697
+ runtimeState: BrightnessStatusSchema,
20698
+ /**
20699
+ * Runtime-state durability: **session** — live lamp state, re-published by the provider on connect.
20700
+ *
20701
+ * See `RuntimeStateDurability`. Enforced by
20702
+ * `scripts/check-runtime-state-durability.ts`.
20703
+ */
20704
+ durability: "session"
20551
20705
  };
20552
20706
  DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
20553
20707
  kind: "mutation",
@@ -20635,7 +20789,17 @@ var carbonMonoxideCapability = {
20635
20789
  schema: CarbonMonoxideStatusSchema,
20636
20790
  kind: "push"
20637
20791
  },
20638
- runtimeState: CarbonMonoxideStatusSchema
20792
+ runtimeState: CarbonMonoxideStatusSchema,
20793
+ /**
20794
+ * Runtime-state durability: **restored** — as `smoke`.
20795
+ *
20796
+ * See `RuntimeStateDurability`. Enforced by
20797
+ * `scripts/check-runtime-state-durability.ts`.
20798
+ */
20799
+ durability: "restored",
20800
+ /** Clock fields: written, but excluded from the compare that decides
20801
+ * whether persisting is worth a SQLite commit. */
20802
+ volatileStateFields: ["lastChangedAt"]
20639
20803
  };
20640
20804
  /**
20641
20805
  * HVAC / climate control cap. Models the full surface of a HA
@@ -20795,7 +20959,14 @@ var climateControlCapability = {
20795
20959
  * the full slice via `device.state.climate-control.value` and refresh
20796
20960
  * on every push without re-querying the provider.
20797
20961
  */
20798
- runtimeState: ClimateControlStatusSchema
20962
+ runtimeState: ClimateControlStatusSchema,
20963
+ /**
20964
+ * Runtime-state durability: **session** — as `brightness`; `currentTemp` moves continuously and is re-published on connect.
20965
+ *
20966
+ * See `RuntimeStateDurability`. Enforced by
20967
+ * `scripts/check-runtime-state-durability.ts`.
20968
+ */
20969
+ durability: "session"
20799
20970
  };
20800
20971
  /**
20801
20972
  * Color-light cap. Coexists with `switch` (on/off) and `brightness`
@@ -20905,7 +21076,14 @@ onColorChanged: { data: object({
20905
21076
  * kernel. Read via `device.state.color.value` so UI pickers surface
20906
21077
  * the current chromaticity without polling the provider.
20907
21078
  */
20908
- runtimeState: ColorStatusSchema
21079
+ runtimeState: ColorStatusSchema,
21080
+ /**
21081
+ * Runtime-state durability: **session** — as `brightness`.
21082
+ *
21083
+ * See `RuntimeStateDurability`. Enforced by
21084
+ * `scripts/check-runtime-state-durability.ts`.
21085
+ */
21086
+ durability: "session"
20909
21087
  };
20910
21088
  var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
20911
21089
  object({
@@ -20963,7 +21141,17 @@ var connectivityCapability = {
20963
21141
  schema: ConnectivityStatusSchema,
20964
21142
  kind: "push"
20965
21143
  },
20966
- runtimeState: ConnectivityStatusSchema
21144
+ runtimeState: ConnectivityStatusSchema,
21145
+ /**
21146
+ * Runtime-state durability: **restored** — same shape and same argument as `device-status`, for links rather than devices.
21147
+ *
21148
+ * See `RuntimeStateDurability`. Enforced by
21149
+ * `scripts/check-runtime-state-durability.ts`.
21150
+ */
21151
+ durability: "restored",
21152
+ /** Clock fields: written, but excluded from the compare that decides
21153
+ * whether persisting is worth a SQLite commit. */
21154
+ volatileStateFields: ["lastChangedAt"]
20967
21155
  };
20968
21156
  /**
20969
21157
  * Generic device-consumables capability — surfaces a device's
@@ -21045,7 +21233,14 @@ reset: method(object({
21045
21233
  }
21046
21234
  }
21047
21235
  },
21048
- runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() })
21236
+ runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() }),
21237
+ /**
21238
+ * Runtime-state durability: **session** — the authority is the appliance; the provider re-reads the whole item array on connect.
21239
+ *
21240
+ * See `RuntimeStateDurability`. Enforced by
21241
+ * `scripts/check-runtime-state-durability.ts`.
21242
+ */
21243
+ durability: "session"
21049
21244
  };
21050
21245
  /**
21051
21246
  * Door / window / opening / garage / valve contact sensor. Boolean
@@ -21076,7 +21271,17 @@ var contactCapability = {
21076
21271
  schema: ContactStatusSchema,
21077
21272
  kind: "push"
21078
21273
  },
21079
- runtimeState: ContactStatusSchema
21274
+ runtimeState: ContactStatusSchema,
21275
+ /**
21276
+ * Runtime-state durability: **restored** — a door left open across a restart must still read open.
21277
+ *
21278
+ * See `RuntimeStateDurability`. Enforced by
21279
+ * `scripts/check-runtime-state-durability.ts`.
21280
+ */
21281
+ durability: "restored",
21282
+ /** Clock fields: written, but excluded from the compare that decides
21283
+ * whether persisting is worth a SQLite commit. */
21284
+ volatileStateFields: ["lastChangedAt"]
21080
21285
  };
21081
21286
  /**
21082
21287
  * Status slice — flat object (the framework's `runtimeState` contract
@@ -21182,7 +21387,14 @@ var controlCapability = {
21182
21387
  * dropdown / text field / date picker) read the slice's discriminant
21183
21388
  * and value directly without polling the provider.
21184
21389
  */
21185
- runtimeState: ControlStatusSchema
21390
+ runtimeState: ControlStatusSchema,
21391
+ /**
21392
+ * Runtime-state durability: **session** — a generic control mirrors an external entity that re-publishes on connect; the options array is re-derived with it.
21393
+ *
21394
+ * See `RuntimeStateDurability`. Enforced by
21395
+ * `scripts/check-runtime-state-durability.ts`.
21396
+ */
21397
+ durability: "session"
21186
21398
  };
21187
21399
  var CoverStatusSchema = object({
21188
21400
  /** Lifecycle state of the cover. */
@@ -21243,7 +21455,17 @@ var coverCapability = {
21243
21455
  * Runtime-state slice — mirrored by the kernel. UI controls watch
21244
21456
  * the slice for live position changes during a move.
21245
21457
  */
21246
- runtimeState: CoverStatusSchema
21458
+ runtimeState: CoverStatusSchema,
21459
+ /**
21460
+ * Runtime-state durability: **restored** — position survives a restart on the device; the mirror should agree at boot rather than read blank.
21461
+ *
21462
+ * See `RuntimeStateDurability`. Enforced by
21463
+ * `scripts/check-runtime-state-durability.ts`.
21464
+ */
21465
+ durability: "restored",
21466
+ /** Clock fields: written, but excluded from the compare that decides
21467
+ * whether persisting is worth a SQLite commit. */
21468
+ volatileStateFields: ["lastChangedAt"]
21247
21469
  };
21248
21470
  /**
21249
21471
  * Vendor-neutral day/night (IR-cut) control — the per-camera config cap
@@ -21337,7 +21559,17 @@ var dayNightCapability = {
21337
21559
  schema: DayNightStatusSchema,
21338
21560
  kind: "poll"
21339
21561
  },
21340
- runtimeState: DayNightStatusSchema
21562
+ runtimeState: DayNightStatusSchema,
21563
+ /**
21564
+ * Runtime-state durability: **restored** — operator-set IR-cut behaviour; mutation-driven.
21565
+ *
21566
+ * See `RuntimeStateDurability`. Enforced by
21567
+ * `scripts/check-runtime-state-durability.ts`.
21568
+ */
21569
+ durability: "restored",
21570
+ /** Clock fields: written, but excluded from the compare that decides
21571
+ * whether persisting is worth a SQLite commit. */
21572
+ volatileStateFields: ["lastFetchedAt"]
21341
21573
  };
21342
21574
  /**
21343
21575
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
@@ -21384,7 +21616,17 @@ onStatusChanged: { data: object({
21384
21616
  schema: DeviceStatusSchema,
21385
21617
  kind: "push"
21386
21618
  },
21387
- runtimeState: DeviceStatusSchema
21619
+ runtimeState: DeviceStatusSchema,
21620
+ /**
21621
+ * 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.
21622
+ *
21623
+ * See `RuntimeStateDurability`. Enforced by
21624
+ * `scripts/check-runtime-state-durability.ts`.
21625
+ */
21626
+ durability: "restored",
21627
+ /** Clock fields: written, but excluded from the compare that decides
21628
+ * whether persisting is worth a SQLite commit. */
21629
+ volatileStateFields: ["lastChangedAt"]
21388
21630
  };
21389
21631
  /**
21390
21632
  * Doorbell button cap. Two kinds of providers coexist behind this cap
@@ -21446,7 +21688,14 @@ onPressed: { data: DoorbellPressEventSchema } },
21446
21688
  * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
21447
21689
  * without subscribing.
21448
21690
  */
21449
- runtimeState: DoorbellStatusSchema
21691
+ runtimeState: DoorbellStatusSchema,
21692
+ /**
21693
+ * 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.
21694
+ *
21695
+ * See `RuntimeStateDurability`. Enforced by
21696
+ * `scripts/check-runtime-state-durability.ts`.
21697
+ */
21698
+ durability: "restored"
21450
21699
  };
21451
21700
  /**
21452
21701
  * Enum-state sensor — a string value picked from a finite option set.
@@ -21486,7 +21735,17 @@ var enumSensorCapability = {
21486
21735
  schema: EnumSensorStatusSchema,
21487
21736
  kind: "push"
21488
21737
  },
21489
- runtimeState: EnumSensorStatusSchema
21738
+ runtimeState: EnumSensorStatusSchema,
21739
+ /**
21740
+ * Runtime-state durability: **restored** — as `numeric-sensor`; 80 devices.
21741
+ *
21742
+ * See `RuntimeStateDurability`. Enforced by
21743
+ * `scripts/check-runtime-state-durability.ts`.
21744
+ */
21745
+ durability: "restored",
21746
+ /** Clock fields: written, but excluded from the compare that decides
21747
+ * whether persisting is worth a SQLite commit. */
21748
+ volatileStateFields: ["lastFetchedAt"]
21490
21749
  };
21491
21750
  /**
21492
21751
  * Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
@@ -21522,7 +21781,14 @@ var eventEmitterCapability = {
21522
21781
  schema: EventEmitterStatusSchema,
21523
21782
  kind: "push"
21524
21783
  },
21525
- runtimeState: EventEmitterStatusSchema
21784
+ runtimeState: EventEmitterStatusSchema,
21785
+ /**
21786
+ * Runtime-state durability: **session** — `eventCountSinceStart` names its own scope.
21787
+ *
21788
+ * See `RuntimeStateDurability`. Enforced by
21789
+ * `scripts/check-runtime-state-durability.ts`.
21790
+ */
21791
+ durability: "session"
21526
21792
  };
21527
21793
  var EventItemSchema = object({
21528
21794
  id: string(),
@@ -21803,7 +22069,14 @@ var fanControlCapability = {
21803
22069
  * Runtime-state slice — mirrored by the kernel. UI fan speed
21804
22070
  * sliders read `percentage` for live updates.
21805
22071
  */
21806
- runtimeState: FanControlStatusSchema
22072
+ runtimeState: FanControlStatusSchema,
22073
+ /**
22074
+ * Runtime-state durability: **session** — as `brightness`.
22075
+ *
22076
+ * See `RuntimeStateDurability`. Enforced by
22077
+ * `scripts/check-runtime-state-durability.ts`.
22078
+ */
22079
+ durability: "session"
21807
22080
  };
21808
22081
  /**
21809
22082
  * Per-device feature/identity probe slice. Holds the runtime-resolved
@@ -21879,7 +22152,14 @@ onProbeChanged: { data: object({
21879
22152
  schema: FeatureProbeStatusSchema,
21880
22153
  kind: "push"
21881
22154
  },
21882
- runtimeState: FeatureProbeStatusSchema
22155
+ runtimeState: FeatureProbeStatusSchema,
22156
+ /**
22157
+ * 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.
22158
+ *
22159
+ * See `RuntimeStateDurability`. Enforced by
22160
+ * `scripts/check-runtime-state-durability.ts`.
22161
+ */
22162
+ durability: "session"
21883
22163
  };
21884
22164
  /**
21885
22165
  * Water leak / moisture sensor. Boolean "is liquid currently
@@ -21906,7 +22186,17 @@ var floodCapability = {
21906
22186
  schema: FloodStatusSchema,
21907
22187
  kind: "push"
21908
22188
  },
21909
- runtimeState: FloodStatusSchema
22189
+ runtimeState: FloodStatusSchema,
22190
+ /**
22191
+ * Runtime-state durability: **restored** — as `smoke`.
22192
+ *
22193
+ * See `RuntimeStateDurability`. Enforced by
22194
+ * `scripts/check-runtime-state-durability.ts`.
22195
+ */
22196
+ durability: "restored",
22197
+ /** Clock fields: written, but excluded from the compare that decides
22198
+ * whether persisting is worth a SQLite commit. */
22199
+ volatileStateFields: ["lastChangedAt"]
21910
22200
  };
21911
22201
  /**
21912
22202
  * Combustible-gas (LPG / methane / hydrogen) alarm sensor. Drives
@@ -21929,7 +22219,17 @@ var gasCapability = {
21929
22219
  schema: GasStatusSchema,
21930
22220
  kind: "push"
21931
22221
  },
21932
- runtimeState: GasStatusSchema
22222
+ runtimeState: GasStatusSchema,
22223
+ /**
22224
+ * Runtime-state durability: **restored** — as `smoke`.
22225
+ *
22226
+ * See `RuntimeStateDurability`. Enforced by
22227
+ * `scripts/check-runtime-state-durability.ts`.
22228
+ */
22229
+ durability: "restored",
22230
+ /** Clock fields: written, but excluded from the compare that decides
22231
+ * whether persisting is worth a SQLite commit. */
22232
+ volatileStateFields: ["lastChangedAt"]
21933
22233
  };
21934
22234
  /**
21935
22235
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
@@ -22005,7 +22305,14 @@ var humidifierCapability = {
22005
22305
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22006
22306
  * slice for live humidity / mode changes.
22007
22307
  */
22008
- runtimeState: HumidifierStatusSchema
22308
+ runtimeState: HumidifierStatusSchema,
22309
+ /**
22310
+ * Runtime-state durability: **session** — as `climate-control`.
22311
+ *
22312
+ * See `RuntimeStateDurability`. Enforced by
22313
+ * `scripts/check-runtime-state-durability.ts`.
22314
+ */
22315
+ durability: "session"
22009
22316
  };
22010
22317
  /**
22011
22318
  * Single-metric humidity reading. Drives Home Assistant `sensor`
@@ -22041,7 +22348,17 @@ var humiditySensorCapability = {
22041
22348
  schema: HumiditySensorStatusSchema,
22042
22349
  kind: "push"
22043
22350
  },
22044
- runtimeState: HumiditySensorStatusSchema
22351
+ runtimeState: HumiditySensorStatusSchema,
22352
+ /**
22353
+ * Runtime-state durability: **restored** — as `numeric-sensor` (67 of 75 writes were the clock alone).
22354
+ *
22355
+ * See `RuntimeStateDurability`. Enforced by
22356
+ * `scripts/check-runtime-state-durability.ts`.
22357
+ */
22358
+ durability: "restored",
22359
+ /** Clock fields: written, but excluded from the compare that decides
22360
+ * whether persisting is worth a SQLite commit. */
22361
+ volatileStateFields: ["lastFetchedAt"]
22045
22362
  };
22046
22363
  /**
22047
22364
  * Image display cap. Models a single still image exposed by an integration —
@@ -22079,7 +22396,14 @@ var imageCapability = {
22079
22396
  * Runtime-state slice — mirrored by the kernel. The UI reads `url`
22080
22397
  * directly and renders the still image.
22081
22398
  */
22082
- runtimeState: ImageStatusSchema
22399
+ runtimeState: ImageStatusSchema,
22400
+ /**
22401
+ * Runtime-state durability: **session** — a snapshot URL is a session-scoped handle; a restored one points at nothing.
22402
+ *
22403
+ * See `RuntimeStateDurability`. Enforced by
22404
+ * `scripts/check-runtime-state-durability.ts`.
22405
+ */
22406
+ durability: "session"
22083
22407
  };
22084
22408
  /**
22085
22409
  * Vendor-neutral image / picture-adjustment cap — the per-camera config
@@ -22228,7 +22552,17 @@ var imageSettingsCapability = {
22228
22552
  schema: ImageSettingsStatusSchema,
22229
22553
  kind: "poll"
22230
22554
  },
22231
- runtimeState: ImageSettingsStatusSchema
22555
+ runtimeState: ImageSettingsStatusSchema,
22556
+ /**
22557
+ * Runtime-state durability: **restored** — operator-set camera imaging; mutation-driven.
22558
+ *
22559
+ * See `RuntimeStateDurability`. Enforced by
22560
+ * `scripts/check-runtime-state-durability.ts`.
22561
+ */
22562
+ durability: "restored",
22563
+ /** Clock fields: written, but excluded from the compare that decides
22564
+ * whether persisting is worth a SQLite commit. */
22565
+ volatileStateFields: ["lastFetchedAt"]
22232
22566
  };
22233
22567
  /**
22234
22568
  * integrations — system-scoped singleton capability for integration
@@ -22568,7 +22902,14 @@ var lawnMowerControlCapability = {
22568
22902
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22569
22903
  * slice for live activity + battery changes.
22570
22904
  */
22571
- runtimeState: LawnMowerControlStatusSchema
22905
+ runtimeState: LawnMowerControlStatusSchema,
22906
+ /**
22907
+ * Runtime-state durability: **session** — as `vacuum-control`.
22908
+ *
22909
+ * See `RuntimeStateDurability`. Enforced by
22910
+ * `scripts/check-runtime-state-durability.ts`.
22911
+ */
22912
+ durability: "session"
22572
22913
  };
22573
22914
  /**
22574
22915
  * local-network — hub-only singleton.
@@ -22774,7 +23115,17 @@ var lockControlCapability = {
22774
23115
  * read `state` and disable themselves during `locking`/`unlocking`
22775
23116
  * transitions.
22776
23117
  */
22777
- runtimeState: LockControlStatusSchema
23118
+ runtimeState: LockControlStatusSchema,
23119
+ /**
23120
+ * Runtime-state durability: **restored** — a lock left locked must still read locked.
23121
+ *
23122
+ * See `RuntimeStateDurability`. Enforced by
23123
+ * `scripts/check-runtime-state-durability.ts`.
23124
+ */
23125
+ durability: "restored",
23126
+ /** Clock fields: written, but excluded from the compare that decides
23127
+ * whether persisting is worth a SQLite commit. */
23128
+ volatileStateFields: ["lastChangedAt"]
22778
23129
  };
22779
23130
  /**
22780
23131
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
@@ -22936,7 +23287,14 @@ var mediaPlayerCapability = {
22936
23287
  * full slice for live now-playing, volume, and progress updates
22937
23288
  * without polling.
22938
23289
  */
22939
- runtimeState: MediaPlayerStatusSchema
23290
+ runtimeState: MediaPlayerStatusSchema,
23291
+ /**
23292
+ * Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
23293
+ *
23294
+ * See `RuntimeStateDurability`. Enforced by
23295
+ * `scripts/check-runtime-state-durability.ts`.
23296
+ */
23297
+ durability: "session"
22940
23298
  };
22941
23299
  /**
22942
23300
  * mesh-network — collection cap for mesh-VPN providers.
@@ -23200,7 +23558,14 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
23200
23558
  * `device.state.motion.value`. Reads never invoke the provider, so
23201
23559
  * UIs and other addons can poll the cached state safely.
23202
23560
  */
23203
- runtimeState: MotionStatusSchema
23561
+ runtimeState: MotionStatusSchema,
23562
+ /**
23563
+ * 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.
23564
+ *
23565
+ * See `RuntimeStateDurability`. Enforced by
23566
+ * `scripts/check-runtime-state-durability.ts`.
23567
+ */
23568
+ durability: "session"
23204
23569
  };
23205
23570
  /**
23206
23571
  * Motion-trigger toggle for accessory devices.
@@ -23265,7 +23630,14 @@ var motionTriggerCapability = {
23265
23630
  schema: MotionTriggerStatusSchema,
23266
23631
  kind: "command-driven"
23267
23632
  },
23268
- runtimeState: MotionTriggerRuntimeStateSchema
23633
+ runtimeState: MotionTriggerRuntimeStateSchema,
23634
+ /**
23635
+ * 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.
23636
+ *
23637
+ * See `RuntimeStateDurability`. Enforced by
23638
+ * `scripts/check-runtime-state-durability.ts`.
23639
+ */
23640
+ durability: "session"
23269
23641
  };
23270
23642
  /**
23271
23643
  * Motion-zones share the same MaskShape vocabulary as privacy-mask — the
@@ -23332,7 +23704,17 @@ var motionZonesCapability = {
23332
23704
  schema: MotionZoneStatusSchema,
23333
23705
  kind: "poll"
23334
23706
  },
23335
- runtimeState: MotionZoneStatusSchema
23707
+ runtimeState: MotionZoneStatusSchema,
23708
+ /**
23709
+ * 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.
23710
+ *
23711
+ * See `RuntimeStateDurability`. Enforced by
23712
+ * `scripts/check-runtime-state-durability.ts`.
23713
+ */
23714
+ durability: "restored",
23715
+ /** Clock fields: written, but excluded from the compare that decides
23716
+ * whether persisting is worth a SQLite commit. */
23717
+ volatileStateFields: ["lastFetchedAt"]
23336
23718
  };
23337
23719
  /**
23338
23720
  * On-camera AI object detection cap. Surfaces per-device the classes
@@ -23406,7 +23788,17 @@ var nativeObjectDetectionCapability = {
23406
23788
  schema: NativeObjectDetectionStatusSchema,
23407
23789
  kind: "push"
23408
23790
  },
23409
- runtimeState: NativeObjectDetectionRuntimeStateSchema
23791
+ runtimeState: NativeObjectDetectionRuntimeStateSchema,
23792
+ /**
23793
+ * 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.
23794
+ *
23795
+ * See `RuntimeStateDurability`. Enforced by
23796
+ * `scripts/check-runtime-state-durability.ts`.
23797
+ */
23798
+ durability: "restored",
23799
+ /** Clock fields: written, but excluded from the compare that decides
23800
+ * whether persisting is worth a SQLite commit. */
23801
+ volatileStateFields: ["lastFetchedAt"]
23410
23802
  };
23411
23803
  /**
23412
23804
  * network-quality — system-scoped singleton capability tracking RTT,
@@ -23740,7 +24132,14 @@ onSent: { data: object({
23740
24132
  * form reads `supports` to gate optional fields; history pane reads
23741
24133
  * `lastSentAt` / `lastError` / `queueDepth`.
23742
24134
  */
23743
- runtimeState: NotifierStatusSchema
24135
+ runtimeState: NotifierStatusSchema,
24136
+ /**
24137
+ * Runtime-state durability: **session** — live queue depth and last-send state; a restored queue depth describes a queue that no longer exists.
24138
+ *
24139
+ * See `RuntimeStateDurability`. Enforced by
24140
+ * `scripts/check-runtime-state-durability.ts`.
24141
+ */
24142
+ durability: "session"
23744
24143
  };
23745
24144
  /**
23746
24145
  * Generic numeric sensor — last-resort fallback when no typed numeric
@@ -23783,7 +24182,17 @@ var numericSensorCapability = {
23783
24182
  schema: NumericSensorStatusSchema,
23784
24183
  kind: "push"
23785
24184
  },
23786
- runtimeState: NumericSensorStatusSchema
24185
+ runtimeState: NumericSensorStatusSchema,
24186
+ /**
24187
+ * 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.
24188
+ *
24189
+ * See `RuntimeStateDurability`. Enforced by
24190
+ * `scripts/check-runtime-state-durability.ts`.
24191
+ */
24192
+ durability: "restored",
24193
+ /** Clock fields: written, but excluded from the compare that decides
24194
+ * whether persisting is worth a SQLite commit. */
24195
+ volatileStateFields: ["lastFetchedAt"]
23787
24196
  };
23788
24197
  /**
23789
24198
  * Generic on-screen-display (video overlay) cap. Each camera exposes
@@ -24168,7 +24577,14 @@ var petFeederCapability = {
24168
24577
  * the full slice via `device.state.petFeeder.value` and refresh on
24169
24578
  * every poll without re-querying the provider.
24170
24579
  */
24171
- runtimeState: PetFeederStatusSchema
24580
+ runtimeState: PetFeederStatusSchema,
24581
+ /**
24582
+ * Runtime-state durability: **session** — live appliance state re-published on connect.
24583
+ *
24584
+ * See `RuntimeStateDurability`. Enforced by
24585
+ * `scripts/check-runtime-state-durability.ts`.
24586
+ */
24587
+ durability: "session"
24172
24588
  };
24173
24589
  var VehicleSchema = object({
24174
24590
  id: string(),
@@ -24480,7 +24896,17 @@ var powerMeterCapability = {
24480
24896
  schema: PowerMeterStatusSchema,
24481
24897
  kind: "push"
24482
24898
  },
24483
- runtimeState: PowerMeterStatusSchema
24899
+ runtimeState: PowerMeterStatusSchema,
24900
+ /**
24901
+ * Runtime-state durability: **restored** — as `numeric-sensor`; `kwhTotal` is an accumulator whose restored value is the baseline.
24902
+ *
24903
+ * See `RuntimeStateDurability`. Enforced by
24904
+ * `scripts/check-runtime-state-durability.ts`.
24905
+ */
24906
+ durability: "restored",
24907
+ /** Clock fields: written, but excluded from the compare that decides
24908
+ * whether persisting is worth a SQLite commit. */
24909
+ volatileStateFields: ["lastFetchedAt"]
24484
24910
  };
24485
24911
  /**
24486
24912
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -24537,7 +24963,17 @@ var presenceCapability = {
24537
24963
  * the map pin is rendered (use `DeviceFeature.PresenceGps` for the
24538
24964
  * pre-fetch fast-path check).
24539
24965
  */
24540
- runtimeState: PresenceStatusSchema
24966
+ runtimeState: PresenceStatusSchema,
24967
+ /**
24968
+ * Runtime-state durability: **restored** — occupancy-relevant: the restored state is what an occupancy rule compares the first post-restart observation against.
24969
+ *
24970
+ * See `RuntimeStateDurability`. Enforced by
24971
+ * `scripts/check-runtime-state-durability.ts`.
24972
+ */
24973
+ durability: "restored",
24974
+ /** Clock fields: written, but excluded from the compare that decides
24975
+ * whether persisting is worth a SQLite commit. */
24976
+ volatileStateFields: ["lastChangedAt"]
24541
24977
  };
24542
24978
  /**
24543
24979
  * Atmospheric pressure reading in hectopascals. Drives Home Assistant
@@ -24573,7 +25009,17 @@ var pressureSensorCapability = {
24573
25009
  schema: PressureSensorStatusSchema,
24574
25010
  kind: "push"
24575
25011
  },
24576
- runtimeState: PressureSensorStatusSchema
25012
+ runtimeState: PressureSensorStatusSchema,
25013
+ /**
25014
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
25015
+ *
25016
+ * See `RuntimeStateDurability`. Enforced by
25017
+ * `scripts/check-runtime-state-durability.ts`.
25018
+ */
25019
+ durability: "restored",
25020
+ /** Clock fields: written, but excluded from the compare that decides
25021
+ * whether persisting is worth a SQLite commit. */
25022
+ volatileStateFields: ["lastFetchedAt"]
24577
25023
  };
24578
25024
  /**
24579
25025
  * PRIVACY — what the camera deliberately does not capture. Two planes:
@@ -24703,7 +25149,17 @@ var privacyMaskCapability = {
24703
25149
  schema: PrivacyMaskStatusSchema,
24704
25150
  kind: "poll"
24705
25151
  },
24706
- runtimeState: PrivacyMaskStatusSchema
25152
+ runtimeState: PrivacyMaskStatusSchema,
25153
+ /**
25154
+ * Runtime-state durability: **restored** — operator-drawn regions, zero real churn — 22 writes in 25 minutes, every one of them the clock.
25155
+ *
25156
+ * See `RuntimeStateDurability`. Enforced by
25157
+ * `scripts/check-runtime-state-durability.ts`.
25158
+ */
25159
+ durability: "restored",
25160
+ /** Clock fields: written, but excluded from the compare that decides
25161
+ * whether persisting is worth a SQLite commit. */
25162
+ volatileStateFields: ["lastFetchedAt"]
24707
25163
  };
24708
25164
  var PtzPresetSchema = object({
24709
25165
  id: string(),
@@ -24869,7 +25325,14 @@ var ptzAutotrackCapability = {
24869
25325
  * fetch / cache / fallback logic out of the four cap methods —
24870
25326
  * they become trampolines over `runtimeState`.
24871
25327
  */
24872
- runtimeState: PtzAutotrackRuntimeStateSchema
25328
+ runtimeState: PtzAutotrackRuntimeStateSchema,
25329
+ /**
25330
+ * Runtime-state durability: **session** — mirrors the camera's own autotrack config, re-read on connect.
25331
+ *
25332
+ * See `RuntimeStateDurability`. Enforced by
25333
+ * `scripts/check-runtime-state-durability.ts`.
25334
+ */
25335
+ durability: "session"
24873
25336
  };
24874
25337
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
24875
25338
  kind: "mutation",
@@ -25216,13 +25679,24 @@ method(object({
25216
25679
  /** Playback-speed multiplier for the render (1 = realtime). */
25217
25680
  var ExportSpeedSchema = number().min(.25).max(32);
25218
25681
  /**
25219
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25682
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
25683
+ *
25684
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
25685
+ * derives these bounds from things that happened at a TIME (a track's
25686
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
25687
+ * every segment present for the range, with each recording GAP removed. The
25688
+ * two agree only on a window that recorded without one interruption, and only
25689
+ * the render side knows the segments, so the translation lives there
25690
+ * (`export-dense-map.ts`, addon-pipeline).
25691
+ *
25692
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
25693
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
25694
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
25695
+ * the video was a uniform timelapse, and the log line reported the five ranges
25696
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
25220
25697
  *
25221
- * Relative and not absolute epoch on purpose: the renderer's frame-select
25222
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25223
- * playlist. Handing it absolute epochs would make every call site responsible
25224
- * for the same subtraction, and the one that forgot would emit a filter that
25225
- * selects nothing — silently, as a uniform timelapse.
25698
+ * Relative and not absolute epoch, because an absolute epoch would make every
25699
+ * call site responsible for the same subtraction.
25226
25700
  */
25227
25701
  var ExportDenseRangeSchema = object({
25228
25702
  fromSec: number().nonnegative(),
@@ -25508,7 +25982,14 @@ var sceneMonitorCapability = {
25508
25982
  schema: SceneMonitorStatusSchema,
25509
25983
  kind: "push"
25510
25984
  },
25511
- runtimeState: SceneMonitorStatusSchema
25985
+ runtimeState: SceneMonitorStatusSchema,
25986
+ /**
25987
+ * Runtime-state durability: **session** — re-derived from the current scene on the next evaluation.
25988
+ *
25989
+ * See `RuntimeStateDurability`. Enforced by
25990
+ * `scripts/check-runtime-state-durability.ts`.
25991
+ */
25992
+ durability: "session"
25512
25993
  };
25513
25994
  /**
25514
25995
  * Per-stage gating mode applied to the zones a rule references.
@@ -25652,7 +26133,14 @@ var scriptRunnerCapability = {
25652
26133
  * `isRunning` to render a spinner during execution and surfaces
25653
26134
  * `lastError` / `lastRunSuccess` in the recent-runs panel.
25654
26135
  */
25655
- runtimeState: ScriptRunnerStatusSchema
26136
+ runtimeState: ScriptRunnerStatusSchema,
26137
+ /**
26138
+ * Runtime-state durability: **session** — a restored `isRunning: true` describes a process that died with the previous hub.
26139
+ *
26140
+ * See `RuntimeStateDurability`. Enforced by
26141
+ * `scripts/check-runtime-state-durability.ts`.
26142
+ */
26143
+ durability: "session"
25656
26144
  };
25657
26145
  /**
25658
26146
  * Smoke alarm sensor — boolean "is smoke currently detected" with
@@ -25679,7 +26167,17 @@ var smokeCapability = {
25679
26167
  schema: SmokeStatusSchema,
25680
26168
  kind: "push"
25681
26169
  },
25682
- runtimeState: SmokeStatusSchema
26170
+ runtimeState: SmokeStatusSchema,
26171
+ /**
26172
+ * Runtime-state durability: **restored** — a safety sensor must not read "clear" merely because the hub restarted.
26173
+ *
26174
+ * See `RuntimeStateDurability`. Enforced by
26175
+ * `scripts/check-runtime-state-durability.ts`.
26176
+ */
26177
+ durability: "restored",
26178
+ /** Clock fields: written, but excluded from the compare that decides
26179
+ * whether persisting is worth a SQLite commit. */
26180
+ volatileStateFields: ["lastChangedAt"]
25683
26181
  };
25684
26182
  /**
25685
26183
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -25852,7 +26350,17 @@ var streamParamsCapability = {
25852
26350
  schema: StreamParamsStatusSchema,
25853
26351
  kind: "poll"
25854
26352
  },
25855
- runtimeState: StreamParamsStatusSchema
26353
+ runtimeState: StreamParamsStatusSchema,
26354
+ /**
26355
+ * Runtime-state durability: **restored** — operator-set encoder profile; mutation-driven.
26356
+ *
26357
+ * See `RuntimeStateDurability`. Enforced by
26358
+ * `scripts/check-runtime-state-durability.ts`.
26359
+ */
26360
+ durability: "restored",
26361
+ /** Clock fields: written, but excluded from the compare that decides
26362
+ * whether persisting is worth a SQLite commit. */
26363
+ volatileStateFields: ["lastFetchedAt"]
25856
26364
  };
25857
26365
  /**
25858
26366
  * Generic on/off switch cap for accessory children (siren, floodlight,
@@ -25898,6 +26406,16 @@ var switchCapability = {
25898
26406
  * not need to re-query the provider after a setState mutation.
25899
26407
  */
25900
26408
  runtimeState: SwitchStatusSchema,
26409
+ /**
26410
+ * Runtime-state durability: **restored** — device state an operator reads as authoritative; 55 devices, transition-driven.
26411
+ *
26412
+ * See `RuntimeStateDurability`. Enforced by
26413
+ * `scripts/check-runtime-state-durability.ts`.
26414
+ */
26415
+ durability: "restored",
26416
+ /** Clock fields: written, but excluded from the compare that decides
26417
+ * whether persisting is worth a SQLite commit. */
26418
+ volatileStateFields: ["lastChangedAt"],
25901
26419
  settings: { bindings: [{
25902
26420
  kind: "scalar",
25903
26421
  statusPath: "on",
@@ -25977,7 +26495,17 @@ var tamperCapability = {
25977
26495
  schema: TamperStatusSchema,
25978
26496
  kind: "push"
25979
26497
  },
25980
- runtimeState: TamperStatusSchema
26498
+ runtimeState: TamperStatusSchema,
26499
+ /**
26500
+ * Runtime-state durability: **restored** — as `smoke`.
26501
+ *
26502
+ * See `RuntimeStateDurability`. Enforced by
26503
+ * `scripts/check-runtime-state-durability.ts`.
26504
+ */
26505
+ durability: "restored",
26506
+ /** Clock fields: written, but excluded from the compare that decides
26507
+ * whether persisting is worth a SQLite commit. */
26508
+ volatileStateFields: ["lastChangedAt"]
25981
26509
  };
25982
26510
  /**
25983
26511
  * Single-metric temperature reading. Drives Home Assistant `sensor`
@@ -26022,7 +26550,17 @@ var temperatureSensorCapability = {
26022
26550
  schema: TemperatureSensorStatusSchema,
26023
26551
  kind: "push"
26024
26552
  },
26025
- runtimeState: TemperatureSensorStatusSchema
26553
+ runtimeState: TemperatureSensorStatusSchema,
26554
+ /**
26555
+ * Runtime-state durability: **restored** — as `numeric-sensor` (69 of 125 writes were the clock alone).
26556
+ *
26557
+ * See `RuntimeStateDurability`. Enforced by
26558
+ * `scripts/check-runtime-state-durability.ts`.
26559
+ */
26560
+ durability: "restored",
26561
+ /** Clock fields: written, but excluded from the compare that decides
26562
+ * whether persisting is worth a SQLite commit. */
26563
+ volatileStateFields: ["lastFetchedAt"]
26026
26564
  };
26027
26565
  /**
26028
26566
  * toast — system-scoped singleton capability that streams toast
@@ -26091,7 +26629,14 @@ var updateCapability = {
26091
26629
  schema: UpdateStatusSchema,
26092
26630
  kind: "poll"
26093
26631
  },
26094
- runtimeState: UpdateStatusSchema
26632
+ runtimeState: UpdateStatusSchema,
26633
+ /**
26634
+ * Runtime-state durability: **session** — a restored `inProgress: true` describes an update that is no longer running; versions are re-probed at boot.
26635
+ *
26636
+ * See `RuntimeStateDurability`. Enforced by
26637
+ * `scripts/check-runtime-state-durability.ts`.
26638
+ */
26639
+ durability: "session"
26095
26640
  };
26096
26641
  var UserSummarySchema = object({
26097
26642
  id: string(),
@@ -26425,7 +26970,14 @@ var vacuumControlCapability = {
26425
26970
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26426
26971
  * slice for live state + battery + fan-speed changes.
26427
26972
  */
26428
- runtimeState: VacuumControlStatusSchema
26973
+ runtimeState: VacuumControlStatusSchema,
26974
+ /**
26975
+ * Runtime-state durability: **session** — as `media-player` — a restored `state: cleaning` is a robot that is not cleaning.
26976
+ *
26977
+ * See `RuntimeStateDurability`. Enforced by
26978
+ * `scripts/check-runtime-state-durability.ts`.
26979
+ */
26980
+ durability: "session"
26429
26981
  };
26430
26982
  var ValveStatusSchema = object({
26431
26983
  /** Lifecycle state of the valve. */
@@ -26477,7 +27029,14 @@ var valveCapability = {
26477
27029
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26478
27030
  * slice for live position changes during a move.
26479
27031
  */
26480
- runtimeState: ValveStatusSchema
27032
+ runtimeState: ValveStatusSchema,
27033
+ /**
27034
+ * Runtime-state durability: **session** — as `brightness`.
27035
+ *
27036
+ * See `RuntimeStateDurability`. Enforced by
27037
+ * `scripts/check-runtime-state-durability.ts`.
27038
+ */
27039
+ durability: "session"
26481
27040
  };
26482
27041
  /**
26483
27042
  * Vibration / shake / impact sensor. Drives Home Assistant
@@ -26499,7 +27058,17 @@ var vibrationCapability = {
26499
27058
  schema: VibrationStatusSchema,
26500
27059
  kind: "push"
26501
27060
  },
26502
- runtimeState: VibrationStatusSchema
27061
+ runtimeState: VibrationStatusSchema,
27062
+ /**
27063
+ * Runtime-state durability: **restored** — as `smoke`.
27064
+ *
27065
+ * See `RuntimeStateDurability`. Enforced by
27066
+ * `scripts/check-runtime-state-durability.ts`.
27067
+ */
27068
+ durability: "restored",
27069
+ /** Clock fields: written, but excluded from the compare that decides
27070
+ * whether persisting is worth a SQLite commit. */
27071
+ volatileStateFields: ["lastChangedAt"]
26503
27072
  };
26504
27073
  /**
26505
27074
  * Water heater / boiler cap. Models HA `water_heater.*` entities — a
@@ -26573,7 +27142,14 @@ var waterHeaterCapability = {
26573
27142
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26574
27143
  * slice for live temperature / mode / away changes.
26575
27144
  */
26576
- runtimeState: WaterHeaterStatusSchema
27145
+ runtimeState: WaterHeaterStatusSchema,
27146
+ /**
27147
+ * Runtime-state durability: **session** — as `climate-control`.
27148
+ *
27149
+ * See `RuntimeStateDurability`. Enforced by
27150
+ * `scripts/check-runtime-state-durability.ts`.
27151
+ */
27152
+ durability: "session"
26577
27153
  };
26578
27154
  /**
26579
27155
  * Weather provider cap. Models HA `weather.*` entities — a read-only
@@ -26632,7 +27208,14 @@ var weatherCapability = {
26632
27208
  * Runtime-state slice — mirrored by the kernel. The UI reads the
26633
27209
  * current conditions directly from the slice on each weather push.
26634
27210
  */
26635
- runtimeState: WeatherStatusSchema
27211
+ runtimeState: WeatherStatusSchema,
27212
+ /**
27213
+ * Runtime-state durability: **session** — a forecast is stale the moment the hub is down; the provider re-fetches on connect.
27214
+ *
27215
+ * See `RuntimeStateDurability`. Enforced by
27216
+ * `scripts/check-runtime-state-durability.ts`.
27217
+ */
27218
+ durability: "session"
26636
27219
  };
26637
27220
  /**
26638
27221
  * Per-zone occupancy aggregation produced by the analytics frame
@@ -26794,7 +27377,14 @@ var zoneAnalyticsCapability = {
26794
27377
  * automatically; the explicit `getCurrentSnapshot` cap method is
26795
27378
  * still useful for one-off polls without a subscription.
26796
27379
  */
26797
- runtimeState: CameraOccupancySnapshotSchema
27380
+ runtimeState: CameraOccupancySnapshotSchema,
27381
+ /**
27382
+ * Runtime-state durability: **session** — per-frame analytics; with `audio-metrics` it is ~90 % of the offered write rate. Re-derived on the next frame.
27383
+ *
27384
+ * See `RuntimeStateDurability`. Enforced by
27385
+ * `scripts/check-runtime-state-durability.ts`.
27386
+ */
27387
+ durability: "session"
26798
27388
  };
26799
27389
  /**
26800
27390
  * Stages a {@link ZoneRule} can apply to. Discriminator on the rules
@@ -26872,7 +27462,14 @@ var zoneRulesCapability = {
26872
27462
  motion: array(ZoneRuleSchema).readonly(),
26873
27463
  detection: array(ZoneRuleSchema).readonly(),
26874
27464
  package: array(ZoneRuleSchema).readonly()
26875
- })
27465
+ }),
27466
+ /**
27467
+ * Runtime-state durability: **restored** — operator intent, mutation-only, same argument as `zones`.
27468
+ *
27469
+ * See `RuntimeStateDurability`. Enforced by
27470
+ * `scripts/check-runtime-state-durability.ts`.
27471
+ */
27472
+ durability: "restored"
26876
27473
  };
26877
27474
  /**
26878
27475
  * Accessory device helpers — shared across drivers.
@@ -33559,6 +34156,7 @@ Object.freeze({
33559
34156
  "network-access": "ingress",
33560
34157
  "smtp-provider": "email"
33561
34158
  });
34159
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
33562
34160
  new Set(["devices", "classes"]);
33563
34161
  /**
33564
34162
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
@@ -33836,25 +34434,32 @@ object({
33836
34434
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
33837
34435
  object({
33838
34436
  /**
33839
- * How long a retained native frame is served before it counts as a miss.
34437
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
34438
+ * detection result.
33840
34439
  *
33841
- * Must cover the FULL late-crop horizon: detection inference + the
33842
- * cross-process inference-result hop to hub post-analysis + tracking + the
33843
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
33844
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
33845
- * RAM per busy camera grows linearly with no measured hit-rate gain.
34440
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
34441
+ * a time window was never related to the event the pixels were waiting for.
34442
+ * A held frame now lives from delivery until the runner has its `FrameResult`
34443
+ * — at which moment the runner cuts the subject tiles it actually wanted and
34444
+ * releases the frame. The bound exists only so a runner that stops answering
34445
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
34446
+ *
34447
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
34448
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
34449
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
34450
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
34451
+ * `holdOverflow` on the metrics line is what says you need it.
33846
34452
  */
33847
- ttlMs: number().int().min(250).max(1e4),
34453
+ holdFrames: number().int().min(1).max(64),
33848
34454
  /**
33849
34455
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
33850
34456
  *
33851
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
33852
- * which one is actually binding before reasoning from that. At the shipped
33853
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
33854
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
33855
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
33856
- * change that admits fewer frames buys retention WINDOW at constant RAM
33857
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
34457
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
34458
+ * is what decides how much is held, and the ceiling is the number above which
34459
+ * something is wrong. Before that it was the effective cap — at 1024 MB with
34460
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
34461
+ * with the TTL expiring nothing, which is exactly the confusion the hold
34462
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
33858
34463
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
33859
34464
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
33860
34465
  * to replace).
@@ -33880,22 +34485,45 @@ object({
33880
34485
  * there is the signal that some caller names frames outside the inference set
33881
34486
  * and that this must go back to `all`.
33882
34487
  */
33883
- admission: NativeLeaseAdmissionSchema
34488
+ admission: NativeLeaseAdmissionSchema,
34489
+ /**
34490
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
34491
+ * compressed native crops the worker cuts at the moment a frame's detection
34492
+ * result arrives, and keeps long after the frame itself is freed.
34493
+ *
34494
+ * This is the knob that replaced the old retention window, and it buys about
34495
+ * three orders of magnitude more of it: a tile is one subject at native
34496
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
34497
+ * the frame it was cut from. A frame on which nothing was detected costs
34498
+ * nothing at all, which is the real change — the old lease paid per FRAME and
34499
+ * was interrogated per SUBJECT.
34500
+ *
34501
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
34502
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34503
+ * reproduce that.
34504
+ */
34505
+ tileBudgetMb: number().int().min(0).max(1024)
33884
34506
  });
33885
34507
  /**
33886
- * The values in force when the operator has set nothing — byte-for-byte the
33887
- * constants the decode worker shipped with as env-var defaults, so making these
33888
- * settings changed no behaviour on the day it landed.
34508
+ * The values in force when the operator has set nothing.
34509
+ *
34510
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
34511
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
34512
+ * in the same change that redefines it would make a regression and a retune
34513
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
34514
+ * live traffic.
33889
34515
  */
33890
34516
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
33891
- ttlMs: 1200,
34517
+ holdFrames: 8,
33892
34518
  budgetMb: 1024,
33893
34519
  activityMs: 15e3,
34520
+ tileBudgetMb: 64,
33894
34521
  admission: "inferred"
33895
34522
  };
33896
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
34523
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
33897
34524
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
33898
34525
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34526
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
33899
34527
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
33900
34528
  /**
33901
34529
  * Pure fuzzy matcher for adoption location import. Normalized