@camstack/addon-provider-rtsp 1.2.14 → 1.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +723 -95
  2. package/dist/addon.mjs +723 -95
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -10827,7 +10827,14 @@ var cameraStreamsCapability = {
10827
10827
  low: string().optional()
10828
10828
  }),
10829
10829
  lastChangedAt: number()
10830
- })
10830
+ }),
10831
+ /**
10832
+ * 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.
10833
+ *
10834
+ * See `RuntimeStateDurability`. Enforced by
10835
+ * `scripts/check-runtime-state-durability.ts`.
10836
+ */
10837
+ durability: "session"
10831
10838
  };
10832
10839
  /** Where a block runs. The operator chooses — a block driving a device on an
10833
10840
  * agent is the reason placement is not fixed to the hub. */
@@ -11388,6 +11395,13 @@ var deviceDiscoveryCapability = {
11388
11395
  kind: "poll"
11389
11396
  },
11390
11397
  runtimeState: DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: number().int().nonnegative() }),
11398
+ /**
11399
+ * Runtime-state durability: **session** — 5.7 KB of scan output on the largest device, fully re-derivable by re-scanning.
11400
+ *
11401
+ * See `RuntimeStateDurability`. Enforced by
11402
+ * `scripts/check-runtime-state-durability.ts`.
11403
+ */
11404
+ durability: "session",
11391
11405
  methods: {
11392
11406
  /**
11393
11407
  * Snapshot of the current `discovered` list. Returns the
@@ -13287,7 +13301,23 @@ var NotificationActionSchema = object({
13287
13301
  * else — see `notification-center/action-token.ts` for what that does and
13288
13302
  * does not buy.
13289
13303
  */
13290
- destructive: boolean().optional()
13304
+ destructive: boolean().optional(),
13305
+ /**
13306
+ * How the tap should REACH the url.
13307
+ *
13308
+ * `navigate` (absent, and every button authored before this field) opens it:
13309
+ * the phone leaves the notification and shows whatever the callback returns.
13310
+ * That is right for a button whose answer the operator wants to read.
13311
+ *
13312
+ * `background` fires it as a POST and stays put. It exists for the buttons
13313
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13314
+ * an answer to the notification, and being thrown into a browser tab to
13315
+ * confirm it costs more attention than the notification did. A backend that
13316
+ * cannot do a background call renders it as an ordinary link (the adapters
13317
+ * fall back rather than dropping the button), so this is a preference, never
13318
+ * a requirement.
13319
+ */
13320
+ mode: _enum(["navigate", "background"]).optional()
13291
13321
  });
13292
13322
  /**
13293
13323
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -14139,7 +14169,17 @@ var alarmPanelCapability = {
14139
14169
  * full slice; renders an arm button per `availableModes` entry and
14140
14170
  * a PIN field iff `requiresCode === true`.
14141
14171
  */
14142
- runtimeState: AlarmPanelStatusSchema
14172
+ runtimeState: AlarmPanelStatusSchema,
14173
+ /**
14174
+ * Runtime-state durability: **restored** — armed state is the one thing a panel must not lose across a restart.
14175
+ *
14176
+ * See `RuntimeStateDurability`. Enforced by
14177
+ * `scripts/check-runtime-state-durability.ts`.
14178
+ */
14179
+ durability: "restored",
14180
+ /** Clock fields: written, but excluded from the compare that decides
14181
+ * whether persisting is worth a SQLite commit. */
14182
+ volatileStateFields: ["lastChangedAt"]
14143
14183
  };
14144
14184
  /**
14145
14185
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
@@ -14316,6 +14356,9 @@ var NcSystemEventConditionSchema = object({
14316
14356
  nodeIds: array(string().min(1)).min(1).optional(),
14317
14357
  packageNames: array(string().min(1)).min(1).optional()
14318
14358
  });
14359
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14360
+ * outage the operator asked for once and forgot. */
14361
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14319
14362
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14320
14363
  var NcScheduleSchema = object({
14321
14364
  windows: array(object({
@@ -14692,15 +14735,15 @@ var NcConditionsSchema = object({
14692
14735
  * (an `immediate` rule naming an `audio-*` class, one notification per
14693
14736
  * classified sample) stays exactly as it was for rules that already use it.
14694
14737
  *
14695
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14696
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14697
- * (`camstack/src/data/notification-center.ts`, guarded by
14698
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14738
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14739
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14740
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14741
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14699
14742
  * condition fields it does not know when a rule is saved from the phone.
14700
14743
  * Publishing an editor for a condition the app cannot round-trip is how an
14701
- * operator loses a rule's conditions by opening it — so the descriptor, the
14702
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14703
- * does an audio rule become authorable.
14744
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14745
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14746
+ * follows here.
14704
14747
  */
14705
14748
  audio: NcAudioConditionSchema.optional()
14706
14749
  });
@@ -14936,6 +14979,30 @@ var NcRuleInputSchema = object({
14936
14979
  */
14937
14980
  snoozeAllowGlobal: boolean().optional(),
14938
14981
  /**
14982
+ * The snooze durations THIS rule's notification offers as buttons, in
14983
+ * minutes.
14984
+ *
14985
+ * Three states, and all three are distinct — which is exactly why this is
14986
+ * `.optional()` and never `.default()`. A Zod default does not run on the
14987
+ * addon cap path (three production failures in one day), so a schema default
14988
+ * would collapse the first two:
14989
+ *
14990
+ * | value | meaning |
14991
+ * | --- | --- |
14992
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
14993
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
14994
+ * | a list | these choices, de-duplicated and sorted, at most four |
14995
+ *
14996
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
14997
+ * three buttons in total) and a rule that spent it all on snooze choices
14998
+ * would push its own tap-through actions off the notification.
14999
+ *
15000
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
15001
+ * that arms the panel, is exempt automatically and cannot be silenced by a
15002
+ * window from anywhere (D133).
15003
+ */
15004
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
15005
+ /**
14939
15006
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14940
15007
  *
14941
15008
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -15035,6 +15102,7 @@ var NcConditionDescriptorSchema = object({
15035
15102
  "device",
15036
15103
  "package",
15037
15104
  "occupancy",
15105
+ "audio",
15038
15106
  "system"
15039
15107
  ]),
15040
15108
  label: string(),
@@ -15053,6 +15121,7 @@ var NcConditionDescriptorSchema = object({
15053
15121
  "crossingSelect",
15054
15122
  "polygonDraw",
15055
15123
  "occupancy",
15124
+ "audio",
15056
15125
  "deviceState",
15057
15126
  "systemEvent"
15058
15127
  ]),
@@ -15204,7 +15273,20 @@ var NcSnoozeInputSchema = object({
15204
15273
  ruleId: string().optional(),
15205
15274
  /** Required when `scope: 'device'`. */
15206
15275
  deviceId: number().int().optional(),
15207
- durationMinutes: number().int().min(1).max(1440),
15276
+ /**
15277
+ * Narrow the window to these subject classes — "the cat, not the person".
15278
+ *
15279
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15280
+ * what every window authored before this field meant, so no persisted row
15281
+ * changes meaning and no client has to learn anything to keep working.
15282
+ *
15283
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15284
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15285
+ * not at whichever of their four rules happened to produce the notification
15286
+ * they are dismissing.
15287
+ */
15288
+ classes: array(string().min(1)).min(1).optional(),
15289
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
15208
15290
  /**
15209
15291
  * Silence this for EVERY recipient, not just the caller. Permission is
15210
15292
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15229,6 +15311,10 @@ var NcSnoozeSchema = object({
15229
15311
  scope: NcSnoozeScopeSchema,
15230
15312
  ruleId: string().optional(),
15231
15313
  deviceId: number().int().optional(),
15314
+ /** Subject classes this window covers. ABSENT = every class — see
15315
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15316
+ * no SQLite column: nothing queries a window by class. */
15317
+ classes: array(string().min(1)).min(1).optional(),
15232
15318
  startedAt: number(),
15233
15319
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15234
15320
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -17329,7 +17415,14 @@ var zonesCapability = {
17329
17415
  * handle. Slice shape is `{ zones: Zone[] }` so future extensions
17330
17416
  * (e.g. zone groupings) can sit alongside the polygon list.
17331
17417
  */
17332
- runtimeState: object({ zones: array(ZoneSchema).readonly() })
17418
+ runtimeState: object({ zones: array(ZoneSchema).readonly() }),
17419
+ /**
17420
+ * 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.
17421
+ *
17422
+ * See `RuntimeStateDurability`. Enforced by
17423
+ * `scripts/check-runtime-state-durability.ts`.
17424
+ */
17425
+ durability: "restored"
17333
17426
  };
17334
17427
  /**
17335
17428
  * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
@@ -20223,7 +20316,17 @@ var airQualitySensorCapability = {
20223
20316
  schema: AirQualitySensorStatusSchema,
20224
20317
  kind: "push"
20225
20318
  },
20226
- runtimeState: AirQualitySensorStatusSchema
20319
+ runtimeState: AirQualitySensorStatusSchema,
20320
+ /**
20321
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20322
+ *
20323
+ * See `RuntimeStateDurability`. Enforced by
20324
+ * `scripts/check-runtime-state-durability.ts`.
20325
+ */
20326
+ durability: "restored",
20327
+ /** Clock fields: written, but excluded from the compare that decides
20328
+ * whether persisting is worth a SQLite commit. */
20329
+ volatileStateFields: ["lastFetchedAt"]
20227
20330
  };
20228
20331
  /**
20229
20332
  * Ambient illuminance reading in lux. Drives Home Assistant `sensor`
@@ -20255,7 +20358,17 @@ var ambientLightSensorCapability = {
20255
20358
  schema: AmbientLightSensorStatusSchema,
20256
20359
  kind: "push"
20257
20360
  },
20258
- runtimeState: AmbientLightSensorStatusSchema
20361
+ runtimeState: AmbientLightSensorStatusSchema,
20362
+ /**
20363
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20364
+ *
20365
+ * See `RuntimeStateDurability`. Enforced by
20366
+ * `scripts/check-runtime-state-durability.ts`.
20367
+ */
20368
+ durability: "restored",
20369
+ /** Clock fields: written, but excluded from the compare that decides
20370
+ * whether persisting is worth a SQLite commit. */
20371
+ volatileStateFields: ["lastFetchedAt"]
20259
20372
  };
20260
20373
  /**
20261
20374
  * Per-class audio metrics aggregated over a sliding window.
@@ -20373,7 +20486,14 @@ var audioMetricsCapability = {
20373
20486
  }), AudioMetricsHistorySchema)
20374
20487
  },
20375
20488
  /** Reactive runtime-state mirror — live `device.state.audioMetrics.value`. */
20376
- runtimeState: AudioMetricsSnapshotSchema
20489
+ runtimeState: AudioMetricsSnapshotSchema,
20490
+ /**
20491
+ * 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.
20492
+ *
20493
+ * See `RuntimeStateDurability`. Enforced by
20494
+ * `scripts/check-runtime-state-durability.ts`.
20495
+ */
20496
+ durability: "session"
20377
20497
  };
20378
20498
  /**
20379
20499
  * Automation-control cap. Models HA `automation.*` entities on
@@ -20435,7 +20555,14 @@ var automationControlCapability = {
20435
20555
  * reads `enabled` (toggle) + `isRunning` (spinner) + `lastError`
20436
20556
  * (badge) directly.
20437
20557
  */
20438
- runtimeState: AutomationControlStatusSchema
20558
+ runtimeState: AutomationControlStatusSchema,
20559
+ /**
20560
+ * 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.
20561
+ *
20562
+ * See `RuntimeStateDurability`. Enforced by
20563
+ * `scripts/check-runtime-state-durability.ts`.
20564
+ */
20565
+ durability: "session"
20439
20566
  };
20440
20567
  /**
20441
20568
  * Battery status snapshot. Emitted by providers whose device is
@@ -20541,7 +20668,17 @@ onStatusChanged: { data: object({
20541
20668
  * via `device.runtimeState.getCapState('battery')` regardless of
20542
20669
  * the underlying driver.
20543
20670
  */
20544
- runtimeState: BatteryStatusSchema
20671
+ runtimeState: BatteryStatusSchema,
20672
+ /**
20673
+ * 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.
20674
+ *
20675
+ * See `RuntimeStateDurability`. Enforced by
20676
+ * `scripts/check-runtime-state-durability.ts`.
20677
+ */
20678
+ durability: "restored",
20679
+ /** Clock fields: written, but excluded from the compare that decides
20680
+ * whether persisting is worth a SQLite commit. */
20681
+ volatileStateFields: ["lastUpdated"]
20545
20682
  };
20546
20683
  /**
20547
20684
  * Generic boolean sensor — last-resort fallback when no domain-
@@ -20570,7 +20707,17 @@ var binaryCapability = {
20570
20707
  schema: BinaryStatusSchema,
20571
20708
  kind: "push"
20572
20709
  },
20573
- runtimeState: BinaryStatusSchema
20710
+ runtimeState: BinaryStatusSchema,
20711
+ /**
20712
+ * Runtime-state durability: **restored** — transition-driven sensor state; the restored value gives the boot comparison.
20713
+ *
20714
+ * See `RuntimeStateDurability`. Enforced by
20715
+ * `scripts/check-runtime-state-durability.ts`.
20716
+ */
20717
+ durability: "restored",
20718
+ /** Clock fields: written, but excluded from the compare that decides
20719
+ * whether persisting is worth a SQLite commit. */
20720
+ volatileStateFields: ["lastChangedAt"]
20574
20721
  };
20575
20722
  /**
20576
20723
  * Dimmable-light brightness control. Co-exists with `switch` on the
@@ -20623,7 +20770,14 @@ onBrightnessChanged: { data: object({
20623
20770
  * by the kernel. Read via `device.state.brightness.value` so UI
20624
20771
  * sliders surface the current level without polling the provider.
20625
20772
  */
20626
- runtimeState: BrightnessStatusSchema
20773
+ runtimeState: BrightnessStatusSchema,
20774
+ /**
20775
+ * Runtime-state durability: **session** — live lamp state, re-published by the provider on connect.
20776
+ *
20777
+ * See `RuntimeStateDurability`. Enforced by
20778
+ * `scripts/check-runtime-state-durability.ts`.
20779
+ */
20780
+ durability: "session"
20627
20781
  };
20628
20782
  DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
20629
20783
  kind: "mutation",
@@ -20711,7 +20865,17 @@ var carbonMonoxideCapability = {
20711
20865
  schema: CarbonMonoxideStatusSchema,
20712
20866
  kind: "push"
20713
20867
  },
20714
- runtimeState: CarbonMonoxideStatusSchema
20868
+ runtimeState: CarbonMonoxideStatusSchema,
20869
+ /**
20870
+ * Runtime-state durability: **restored** — as `smoke`.
20871
+ *
20872
+ * See `RuntimeStateDurability`. Enforced by
20873
+ * `scripts/check-runtime-state-durability.ts`.
20874
+ */
20875
+ durability: "restored",
20876
+ /** Clock fields: written, but excluded from the compare that decides
20877
+ * whether persisting is worth a SQLite commit. */
20878
+ volatileStateFields: ["lastChangedAt"]
20715
20879
  };
20716
20880
  /**
20717
20881
  * HVAC / climate control cap. Models the full surface of a HA
@@ -20871,7 +21035,14 @@ var climateControlCapability = {
20871
21035
  * the full slice via `device.state.climate-control.value` and refresh
20872
21036
  * on every push without re-querying the provider.
20873
21037
  */
20874
- runtimeState: ClimateControlStatusSchema
21038
+ runtimeState: ClimateControlStatusSchema,
21039
+ /**
21040
+ * Runtime-state durability: **session** — as `brightness`; `currentTemp` moves continuously and is re-published on connect.
21041
+ *
21042
+ * See `RuntimeStateDurability`. Enforced by
21043
+ * `scripts/check-runtime-state-durability.ts`.
21044
+ */
21045
+ durability: "session"
20875
21046
  };
20876
21047
  /**
20877
21048
  * Color-light cap. Coexists with `switch` (on/off) and `brightness`
@@ -20981,7 +21152,14 @@ onColorChanged: { data: object({
20981
21152
  * kernel. Read via `device.state.color.value` so UI pickers surface
20982
21153
  * the current chromaticity without polling the provider.
20983
21154
  */
20984
- runtimeState: ColorStatusSchema
21155
+ runtimeState: ColorStatusSchema,
21156
+ /**
21157
+ * Runtime-state durability: **session** — as `brightness`.
21158
+ *
21159
+ * See `RuntimeStateDurability`. Enforced by
21160
+ * `scripts/check-runtime-state-durability.ts`.
21161
+ */
21162
+ durability: "session"
20985
21163
  };
20986
21164
  var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
20987
21165
  object({
@@ -21047,7 +21225,17 @@ var connectivityCapability = {
21047
21225
  schema: ConnectivityStatusSchema,
21048
21226
  kind: "push"
21049
21227
  },
21050
- runtimeState: ConnectivityStatusSchema
21228
+ runtimeState: ConnectivityStatusSchema,
21229
+ /**
21230
+ * Runtime-state durability: **restored** — same shape and same argument as `device-status`, for links rather than devices.
21231
+ *
21232
+ * See `RuntimeStateDurability`. Enforced by
21233
+ * `scripts/check-runtime-state-durability.ts`.
21234
+ */
21235
+ durability: "restored",
21236
+ /** Clock fields: written, but excluded from the compare that decides
21237
+ * whether persisting is worth a SQLite commit. */
21238
+ volatileStateFields: ["lastChangedAt"]
21051
21239
  };
21052
21240
  /**
21053
21241
  * Generic device-consumables capability — surfaces a device's
@@ -21129,7 +21317,14 @@ reset: method(object({
21129
21317
  }
21130
21318
  }
21131
21319
  },
21132
- runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() })
21320
+ runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() }),
21321
+ /**
21322
+ * Runtime-state durability: **session** — the authority is the appliance; the provider re-reads the whole item array on connect.
21323
+ *
21324
+ * See `RuntimeStateDurability`. Enforced by
21325
+ * `scripts/check-runtime-state-durability.ts`.
21326
+ */
21327
+ durability: "session"
21133
21328
  };
21134
21329
  /**
21135
21330
  * Door / window / opening / garage / valve contact sensor. Boolean
@@ -21160,7 +21355,17 @@ var contactCapability = {
21160
21355
  schema: ContactStatusSchema,
21161
21356
  kind: "push"
21162
21357
  },
21163
- runtimeState: ContactStatusSchema
21358
+ runtimeState: ContactStatusSchema,
21359
+ /**
21360
+ * Runtime-state durability: **restored** — a door left open across a restart must still read open.
21361
+ *
21362
+ * See `RuntimeStateDurability`. Enforced by
21363
+ * `scripts/check-runtime-state-durability.ts`.
21364
+ */
21365
+ durability: "restored",
21366
+ /** Clock fields: written, but excluded from the compare that decides
21367
+ * whether persisting is worth a SQLite commit. */
21368
+ volatileStateFields: ["lastChangedAt"]
21164
21369
  };
21165
21370
  /**
21166
21371
  * Status slice — flat object (the framework's `runtimeState` contract
@@ -21266,7 +21471,14 @@ var controlCapability = {
21266
21471
  * dropdown / text field / date picker) read the slice's discriminant
21267
21472
  * and value directly without polling the provider.
21268
21473
  */
21269
- runtimeState: ControlStatusSchema
21474
+ runtimeState: ControlStatusSchema,
21475
+ /**
21476
+ * Runtime-state durability: **session** — a generic control mirrors an external entity that re-publishes on connect; the options array is re-derived with it.
21477
+ *
21478
+ * See `RuntimeStateDurability`. Enforced by
21479
+ * `scripts/check-runtime-state-durability.ts`.
21480
+ */
21481
+ durability: "session"
21270
21482
  };
21271
21483
  var CoverStatusSchema = object({
21272
21484
  /** Lifecycle state of the cover. */
@@ -21327,7 +21539,17 @@ var coverCapability = {
21327
21539
  * Runtime-state slice — mirrored by the kernel. UI controls watch
21328
21540
  * the slice for live position changes during a move.
21329
21541
  */
21330
- runtimeState: CoverStatusSchema
21542
+ runtimeState: CoverStatusSchema,
21543
+ /**
21544
+ * Runtime-state durability: **restored** — position survives a restart on the device; the mirror should agree at boot rather than read blank.
21545
+ *
21546
+ * See `RuntimeStateDurability`. Enforced by
21547
+ * `scripts/check-runtime-state-durability.ts`.
21548
+ */
21549
+ durability: "restored",
21550
+ /** Clock fields: written, but excluded from the compare that decides
21551
+ * whether persisting is worth a SQLite commit. */
21552
+ volatileStateFields: ["lastChangedAt"]
21331
21553
  };
21332
21554
  /**
21333
21555
  * Vendor-neutral day/night (IR-cut) control — the per-camera config cap
@@ -21421,7 +21643,17 @@ var dayNightCapability = {
21421
21643
  schema: DayNightStatusSchema,
21422
21644
  kind: "poll"
21423
21645
  },
21424
- runtimeState: DayNightStatusSchema
21646
+ runtimeState: DayNightStatusSchema,
21647
+ /**
21648
+ * Runtime-state durability: **restored** — operator-set IR-cut behaviour; mutation-driven.
21649
+ *
21650
+ * See `RuntimeStateDurability`. Enforced by
21651
+ * `scripts/check-runtime-state-durability.ts`.
21652
+ */
21653
+ durability: "restored",
21654
+ /** Clock fields: written, but excluded from the compare that decides
21655
+ * whether persisting is worth a SQLite commit. */
21656
+ volatileStateFields: ["lastFetchedAt"]
21425
21657
  };
21426
21658
  /**
21427
21659
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
@@ -21468,7 +21700,17 @@ onStatusChanged: { data: object({
21468
21700
  schema: DeviceStatusSchema,
21469
21701
  kind: "push"
21470
21702
  },
21471
- runtimeState: DeviceStatusSchema
21703
+ runtimeState: DeviceStatusSchema,
21704
+ /**
21705
+ * 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.
21706
+ *
21707
+ * See `RuntimeStateDurability`. Enforced by
21708
+ * `scripts/check-runtime-state-durability.ts`.
21709
+ */
21710
+ durability: "restored",
21711
+ /** Clock fields: written, but excluded from the compare that decides
21712
+ * whether persisting is worth a SQLite commit. */
21713
+ volatileStateFields: ["lastChangedAt"]
21472
21714
  };
21473
21715
  /**
21474
21716
  * Doorbell button cap. Two kinds of providers coexist behind this cap
@@ -21530,7 +21772,14 @@ onPressed: { data: DoorbellPressEventSchema } },
21530
21772
  * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
21531
21773
  * without subscribing.
21532
21774
  */
21533
- runtimeState: DoorbellStatusSchema
21775
+ runtimeState: DoorbellStatusSchema,
21776
+ /**
21777
+ * 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.
21778
+ *
21779
+ * See `RuntimeStateDurability`. Enforced by
21780
+ * `scripts/check-runtime-state-durability.ts`.
21781
+ */
21782
+ durability: "restored"
21534
21783
  };
21535
21784
  /**
21536
21785
  * Enum-state sensor — a string value picked from a finite option set.
@@ -21570,7 +21819,17 @@ var enumSensorCapability = {
21570
21819
  schema: EnumSensorStatusSchema,
21571
21820
  kind: "push"
21572
21821
  },
21573
- runtimeState: EnumSensorStatusSchema
21822
+ runtimeState: EnumSensorStatusSchema,
21823
+ /**
21824
+ * Runtime-state durability: **restored** — as `numeric-sensor`; 80 devices.
21825
+ *
21826
+ * See `RuntimeStateDurability`. Enforced by
21827
+ * `scripts/check-runtime-state-durability.ts`.
21828
+ */
21829
+ durability: "restored",
21830
+ /** Clock fields: written, but excluded from the compare that decides
21831
+ * whether persisting is worth a SQLite commit. */
21832
+ volatileStateFields: ["lastFetchedAt"]
21574
21833
  };
21575
21834
  /**
21576
21835
  * Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
@@ -21606,7 +21865,14 @@ var eventEmitterCapability = {
21606
21865
  schema: EventEmitterStatusSchema,
21607
21866
  kind: "push"
21608
21867
  },
21609
- runtimeState: EventEmitterStatusSchema
21868
+ runtimeState: EventEmitterStatusSchema,
21869
+ /**
21870
+ * Runtime-state durability: **session** — `eventCountSinceStart` names its own scope.
21871
+ *
21872
+ * See `RuntimeStateDurability`. Enforced by
21873
+ * `scripts/check-runtime-state-durability.ts`.
21874
+ */
21875
+ durability: "session"
21610
21876
  };
21611
21877
  var EventItemSchema = object({
21612
21878
  id: string(),
@@ -21887,7 +22153,14 @@ var fanControlCapability = {
21887
22153
  * Runtime-state slice — mirrored by the kernel. UI fan speed
21888
22154
  * sliders read `percentage` for live updates.
21889
22155
  */
21890
- runtimeState: FanControlStatusSchema
22156
+ runtimeState: FanControlStatusSchema,
22157
+ /**
22158
+ * Runtime-state durability: **session** — as `brightness`.
22159
+ *
22160
+ * See `RuntimeStateDurability`. Enforced by
22161
+ * `scripts/check-runtime-state-durability.ts`.
22162
+ */
22163
+ durability: "session"
21891
22164
  };
21892
22165
  /**
21893
22166
  * Per-device feature/identity probe slice. Holds the runtime-resolved
@@ -21963,7 +22236,14 @@ onProbeChanged: { data: object({
21963
22236
  schema: FeatureProbeStatusSchema,
21964
22237
  kind: "push"
21965
22238
  },
21966
- runtimeState: FeatureProbeStatusSchema
22239
+ runtimeState: FeatureProbeStatusSchema,
22240
+ /**
22241
+ * 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.
22242
+ *
22243
+ * See `RuntimeStateDurability`. Enforced by
22244
+ * `scripts/check-runtime-state-durability.ts`.
22245
+ */
22246
+ durability: "session"
21967
22247
  };
21968
22248
  /**
21969
22249
  * Water leak / moisture sensor. Boolean "is liquid currently
@@ -21990,7 +22270,17 @@ var floodCapability = {
21990
22270
  schema: FloodStatusSchema,
21991
22271
  kind: "push"
21992
22272
  },
21993
- runtimeState: FloodStatusSchema
22273
+ runtimeState: FloodStatusSchema,
22274
+ /**
22275
+ * Runtime-state durability: **restored** — as `smoke`.
22276
+ *
22277
+ * See `RuntimeStateDurability`. Enforced by
22278
+ * `scripts/check-runtime-state-durability.ts`.
22279
+ */
22280
+ durability: "restored",
22281
+ /** Clock fields: written, but excluded from the compare that decides
22282
+ * whether persisting is worth a SQLite commit. */
22283
+ volatileStateFields: ["lastChangedAt"]
21994
22284
  };
21995
22285
  /**
21996
22286
  * Combustible-gas (LPG / methane / hydrogen) alarm sensor. Drives
@@ -22013,7 +22303,17 @@ var gasCapability = {
22013
22303
  schema: GasStatusSchema,
22014
22304
  kind: "push"
22015
22305
  },
22016
- runtimeState: GasStatusSchema
22306
+ runtimeState: GasStatusSchema,
22307
+ /**
22308
+ * Runtime-state durability: **restored** — as `smoke`.
22309
+ *
22310
+ * See `RuntimeStateDurability`. Enforced by
22311
+ * `scripts/check-runtime-state-durability.ts`.
22312
+ */
22313
+ durability: "restored",
22314
+ /** Clock fields: written, but excluded from the compare that decides
22315
+ * whether persisting is worth a SQLite commit. */
22316
+ volatileStateFields: ["lastChangedAt"]
22017
22317
  };
22018
22318
  /**
22019
22319
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
@@ -22089,7 +22389,14 @@ var humidifierCapability = {
22089
22389
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22090
22390
  * slice for live humidity / mode changes.
22091
22391
  */
22092
- runtimeState: HumidifierStatusSchema
22392
+ runtimeState: HumidifierStatusSchema,
22393
+ /**
22394
+ * Runtime-state durability: **session** — as `climate-control`.
22395
+ *
22396
+ * See `RuntimeStateDurability`. Enforced by
22397
+ * `scripts/check-runtime-state-durability.ts`.
22398
+ */
22399
+ durability: "session"
22093
22400
  };
22094
22401
  /**
22095
22402
  * Single-metric humidity reading. Drives Home Assistant `sensor`
@@ -22125,7 +22432,17 @@ var humiditySensorCapability = {
22125
22432
  schema: HumiditySensorStatusSchema,
22126
22433
  kind: "push"
22127
22434
  },
22128
- runtimeState: HumiditySensorStatusSchema
22435
+ runtimeState: HumiditySensorStatusSchema,
22436
+ /**
22437
+ * Runtime-state durability: **restored** — as `numeric-sensor` (67 of 75 writes were the clock alone).
22438
+ *
22439
+ * See `RuntimeStateDurability`. Enforced by
22440
+ * `scripts/check-runtime-state-durability.ts`.
22441
+ */
22442
+ durability: "restored",
22443
+ /** Clock fields: written, but excluded from the compare that decides
22444
+ * whether persisting is worth a SQLite commit. */
22445
+ volatileStateFields: ["lastFetchedAt"]
22129
22446
  };
22130
22447
  /**
22131
22448
  * Image display cap. Models a single still image exposed by an integration —
@@ -22163,7 +22480,14 @@ var imageCapability = {
22163
22480
  * Runtime-state slice — mirrored by the kernel. The UI reads `url`
22164
22481
  * directly and renders the still image.
22165
22482
  */
22166
- runtimeState: ImageStatusSchema
22483
+ runtimeState: ImageStatusSchema,
22484
+ /**
22485
+ * Runtime-state durability: **session** — a snapshot URL is a session-scoped handle; a restored one points at nothing.
22486
+ *
22487
+ * See `RuntimeStateDurability`. Enforced by
22488
+ * `scripts/check-runtime-state-durability.ts`.
22489
+ */
22490
+ durability: "session"
22167
22491
  };
22168
22492
  /**
22169
22493
  * Vendor-neutral image / picture-adjustment cap — the per-camera config
@@ -22312,7 +22636,17 @@ var imageSettingsCapability = {
22312
22636
  schema: ImageSettingsStatusSchema,
22313
22637
  kind: "poll"
22314
22638
  },
22315
- runtimeState: ImageSettingsStatusSchema
22639
+ runtimeState: ImageSettingsStatusSchema,
22640
+ /**
22641
+ * Runtime-state durability: **restored** — operator-set camera imaging; mutation-driven.
22642
+ *
22643
+ * See `RuntimeStateDurability`. Enforced by
22644
+ * `scripts/check-runtime-state-durability.ts`.
22645
+ */
22646
+ durability: "restored",
22647
+ /** Clock fields: written, but excluded from the compare that decides
22648
+ * whether persisting is worth a SQLite commit. */
22649
+ volatileStateFields: ["lastFetchedAt"]
22316
22650
  };
22317
22651
  /**
22318
22652
  * integrations — system-scoped singleton capability for integration
@@ -22652,7 +22986,14 @@ var lawnMowerControlCapability = {
22652
22986
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22653
22987
  * slice for live activity + battery changes.
22654
22988
  */
22655
- runtimeState: LawnMowerControlStatusSchema
22989
+ runtimeState: LawnMowerControlStatusSchema,
22990
+ /**
22991
+ * Runtime-state durability: **session** — as `vacuum-control`.
22992
+ *
22993
+ * See `RuntimeStateDurability`. Enforced by
22994
+ * `scripts/check-runtime-state-durability.ts`.
22995
+ */
22996
+ durability: "session"
22656
22997
  };
22657
22998
  /**
22658
22999
  * local-network — hub-only singleton.
@@ -22858,7 +23199,17 @@ var lockControlCapability = {
22858
23199
  * read `state` and disable themselves during `locking`/`unlocking`
22859
23200
  * transitions.
22860
23201
  */
22861
- runtimeState: LockControlStatusSchema
23202
+ runtimeState: LockControlStatusSchema,
23203
+ /**
23204
+ * Runtime-state durability: **restored** — a lock left locked must still read locked.
23205
+ *
23206
+ * See `RuntimeStateDurability`. Enforced by
23207
+ * `scripts/check-runtime-state-durability.ts`.
23208
+ */
23209
+ durability: "restored",
23210
+ /** Clock fields: written, but excluded from the compare that decides
23211
+ * whether persisting is worth a SQLite commit. */
23212
+ volatileStateFields: ["lastChangedAt"]
22862
23213
  };
22863
23214
  /**
22864
23215
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
@@ -23020,7 +23371,14 @@ var mediaPlayerCapability = {
23020
23371
  * full slice for live now-playing, volume, and progress updates
23021
23372
  * without polling.
23022
23373
  */
23023
- runtimeState: MediaPlayerStatusSchema
23374
+ runtimeState: MediaPlayerStatusSchema,
23375
+ /**
23376
+ * Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
23377
+ *
23378
+ * See `RuntimeStateDurability`. Enforced by
23379
+ * `scripts/check-runtime-state-durability.ts`.
23380
+ */
23381
+ durability: "session"
23024
23382
  };
23025
23383
  /**
23026
23384
  * mesh-network — collection cap for mesh-VPN providers.
@@ -23284,7 +23642,14 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
23284
23642
  * `device.state.motion.value`. Reads never invoke the provider, so
23285
23643
  * UIs and other addons can poll the cached state safely.
23286
23644
  */
23287
- runtimeState: MotionStatusSchema
23645
+ runtimeState: MotionStatusSchema,
23646
+ /**
23647
+ * 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.
23648
+ *
23649
+ * See `RuntimeStateDurability`. Enforced by
23650
+ * `scripts/check-runtime-state-durability.ts`.
23651
+ */
23652
+ durability: "session"
23288
23653
  };
23289
23654
  /**
23290
23655
  * Motion-trigger toggle for accessory devices.
@@ -23349,7 +23714,14 @@ var motionTriggerCapability = {
23349
23714
  schema: MotionTriggerStatusSchema,
23350
23715
  kind: "command-driven"
23351
23716
  },
23352
- runtimeState: MotionTriggerRuntimeStateSchema
23717
+ runtimeState: MotionTriggerRuntimeStateSchema,
23718
+ /**
23719
+ * 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.
23720
+ *
23721
+ * See `RuntimeStateDurability`. Enforced by
23722
+ * `scripts/check-runtime-state-durability.ts`.
23723
+ */
23724
+ durability: "session"
23353
23725
  };
23354
23726
  /**
23355
23727
  * Motion-zones share the same MaskShape vocabulary as privacy-mask — the
@@ -23416,7 +23788,17 @@ var motionZonesCapability = {
23416
23788
  schema: MotionZoneStatusSchema,
23417
23789
  kind: "poll"
23418
23790
  },
23419
- runtimeState: MotionZoneStatusSchema
23791
+ runtimeState: MotionZoneStatusSchema,
23792
+ /**
23793
+ * 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.
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"]
23420
23802
  };
23421
23803
  /**
23422
23804
  * On-camera AI object detection cap. Surfaces per-device the classes
@@ -23490,7 +23872,17 @@ var nativeObjectDetectionCapability = {
23490
23872
  schema: NativeObjectDetectionStatusSchema,
23491
23873
  kind: "push"
23492
23874
  },
23493
- runtimeState: NativeObjectDetectionRuntimeStateSchema
23875
+ runtimeState: NativeObjectDetectionRuntimeStateSchema,
23876
+ /**
23877
+ * 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.
23878
+ *
23879
+ * See `RuntimeStateDurability`. Enforced by
23880
+ * `scripts/check-runtime-state-durability.ts`.
23881
+ */
23882
+ durability: "restored",
23883
+ /** Clock fields: written, but excluded from the compare that decides
23884
+ * whether persisting is worth a SQLite commit. */
23885
+ volatileStateFields: ["lastFetchedAt"]
23494
23886
  };
23495
23887
  /**
23496
23888
  * network-quality — system-scoped singleton capability tracking RTT,
@@ -23824,7 +24216,14 @@ onSent: { data: object({
23824
24216
  * form reads `supports` to gate optional fields; history pane reads
23825
24217
  * `lastSentAt` / `lastError` / `queueDepth`.
23826
24218
  */
23827
- runtimeState: NotifierStatusSchema
24219
+ runtimeState: NotifierStatusSchema,
24220
+ /**
24221
+ * Runtime-state durability: **session** — live queue depth and last-send state; a restored queue depth describes a queue that no longer exists.
24222
+ *
24223
+ * See `RuntimeStateDurability`. Enforced by
24224
+ * `scripts/check-runtime-state-durability.ts`.
24225
+ */
24226
+ durability: "session"
23828
24227
  };
23829
24228
  /**
23830
24229
  * Generic numeric sensor — last-resort fallback when no typed numeric
@@ -23867,7 +24266,17 @@ var numericSensorCapability = {
23867
24266
  schema: NumericSensorStatusSchema,
23868
24267
  kind: "push"
23869
24268
  },
23870
- runtimeState: NumericSensorStatusSchema
24269
+ runtimeState: NumericSensorStatusSchema,
24270
+ /**
24271
+ * 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.
24272
+ *
24273
+ * See `RuntimeStateDurability`. Enforced by
24274
+ * `scripts/check-runtime-state-durability.ts`.
24275
+ */
24276
+ durability: "restored",
24277
+ /** Clock fields: written, but excluded from the compare that decides
24278
+ * whether persisting is worth a SQLite commit. */
24279
+ volatileStateFields: ["lastFetchedAt"]
23871
24280
  };
23872
24281
  /**
23873
24282
  * Generic on-screen-display (video overlay) cap. Each camera exposes
@@ -24252,7 +24661,14 @@ var petFeederCapability = {
24252
24661
  * the full slice via `device.state.petFeeder.value` and refresh on
24253
24662
  * every poll without re-querying the provider.
24254
24663
  */
24255
- runtimeState: PetFeederStatusSchema
24664
+ runtimeState: PetFeederStatusSchema,
24665
+ /**
24666
+ * Runtime-state durability: **session** — live appliance state re-published on connect.
24667
+ *
24668
+ * See `RuntimeStateDurability`. Enforced by
24669
+ * `scripts/check-runtime-state-durability.ts`.
24670
+ */
24671
+ durability: "session"
24256
24672
  };
24257
24673
  var VehicleSchema = object({
24258
24674
  id: string(),
@@ -24564,7 +24980,17 @@ var powerMeterCapability = {
24564
24980
  schema: PowerMeterStatusSchema,
24565
24981
  kind: "push"
24566
24982
  },
24567
- runtimeState: PowerMeterStatusSchema
24983
+ runtimeState: PowerMeterStatusSchema,
24984
+ /**
24985
+ * Runtime-state durability: **restored** — as `numeric-sensor`; `kwhTotal` is an accumulator whose restored value is the baseline.
24986
+ *
24987
+ * See `RuntimeStateDurability`. Enforced by
24988
+ * `scripts/check-runtime-state-durability.ts`.
24989
+ */
24990
+ durability: "restored",
24991
+ /** Clock fields: written, but excluded from the compare that decides
24992
+ * whether persisting is worth a SQLite commit. */
24993
+ volatileStateFields: ["lastFetchedAt"]
24568
24994
  };
24569
24995
  /**
24570
24996
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -24621,7 +25047,17 @@ var presenceCapability = {
24621
25047
  * the map pin is rendered (use `DeviceFeature.PresenceGps` for the
24622
25048
  * pre-fetch fast-path check).
24623
25049
  */
24624
- runtimeState: PresenceStatusSchema
25050
+ runtimeState: PresenceStatusSchema,
25051
+ /**
25052
+ * Runtime-state durability: **restored** — occupancy-relevant: the restored state is what an occupancy rule compares the first post-restart observation against.
25053
+ *
25054
+ * See `RuntimeStateDurability`. Enforced by
25055
+ * `scripts/check-runtime-state-durability.ts`.
25056
+ */
25057
+ durability: "restored",
25058
+ /** Clock fields: written, but excluded from the compare that decides
25059
+ * whether persisting is worth a SQLite commit. */
25060
+ volatileStateFields: ["lastChangedAt"]
24625
25061
  };
24626
25062
  /**
24627
25063
  * Atmospheric pressure reading in hectopascals. Drives Home Assistant
@@ -24657,7 +25093,17 @@ var pressureSensorCapability = {
24657
25093
  schema: PressureSensorStatusSchema,
24658
25094
  kind: "push"
24659
25095
  },
24660
- runtimeState: PressureSensorStatusSchema
25096
+ runtimeState: PressureSensorStatusSchema,
25097
+ /**
25098
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
25099
+ *
25100
+ * See `RuntimeStateDurability`. Enforced by
25101
+ * `scripts/check-runtime-state-durability.ts`.
25102
+ */
25103
+ durability: "restored",
25104
+ /** Clock fields: written, but excluded from the compare that decides
25105
+ * whether persisting is worth a SQLite commit. */
25106
+ volatileStateFields: ["lastFetchedAt"]
24661
25107
  };
24662
25108
  /**
24663
25109
  * PRIVACY — what the camera deliberately does not capture. Two planes:
@@ -24787,7 +25233,17 @@ var privacyMaskCapability = {
24787
25233
  schema: PrivacyMaskStatusSchema,
24788
25234
  kind: "poll"
24789
25235
  },
24790
- runtimeState: PrivacyMaskStatusSchema
25236
+ runtimeState: PrivacyMaskStatusSchema,
25237
+ /**
25238
+ * Runtime-state durability: **restored** — operator-drawn regions, zero real churn — 22 writes in 25 minutes, every one of them the clock.
25239
+ *
25240
+ * See `RuntimeStateDurability`. Enforced by
25241
+ * `scripts/check-runtime-state-durability.ts`.
25242
+ */
25243
+ durability: "restored",
25244
+ /** Clock fields: written, but excluded from the compare that decides
25245
+ * whether persisting is worth a SQLite commit. */
25246
+ volatileStateFields: ["lastFetchedAt"]
24791
25247
  };
24792
25248
  var PtzPresetSchema = object({
24793
25249
  id: string(),
@@ -24953,7 +25409,14 @@ var ptzAutotrackCapability = {
24953
25409
  * fetch / cache / fallback logic out of the four cap methods —
24954
25410
  * they become trampolines over `runtimeState`.
24955
25411
  */
24956
- runtimeState: PtzAutotrackRuntimeStateSchema
25412
+ runtimeState: PtzAutotrackRuntimeStateSchema,
25413
+ /**
25414
+ * Runtime-state durability: **session** — mirrors the camera's own autotrack config, re-read on connect.
25415
+ *
25416
+ * See `RuntimeStateDurability`. Enforced by
25417
+ * `scripts/check-runtime-state-durability.ts`.
25418
+ */
25419
+ durability: "session"
24957
25420
  };
24958
25421
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
24959
25422
  kind: "mutation",
@@ -25300,13 +25763,24 @@ method(object({
25300
25763
  /** Playback-speed multiplier for the render (1 = realtime). */
25301
25764
  var ExportSpeedSchema = number().min(.25).max(32);
25302
25765
  /**
25303
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25766
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
25767
+ *
25768
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
25769
+ * derives these bounds from things that happened at a TIME (a track's
25770
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
25771
+ * every segment present for the range, with each recording GAP removed. The
25772
+ * two agree only on a window that recorded without one interruption, and only
25773
+ * the render side knows the segments, so the translation lives there
25774
+ * (`export-dense-map.ts`, addon-pipeline).
25775
+ *
25776
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
25777
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
25778
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
25779
+ * the video was a uniform timelapse, and the log line reported the five ranges
25780
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
25304
25781
  *
25305
- * Relative and not absolute epoch on purpose: the renderer's frame-select
25306
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25307
- * playlist. Handing it absolute epochs would make every call site responsible
25308
- * for the same subtraction, and the one that forgot would emit a filter that
25309
- * selects nothing — silently, as a uniform timelapse.
25782
+ * Relative and not absolute epoch, because an absolute epoch would make every
25783
+ * call site responsible for the same subtraction.
25310
25784
  */
25311
25785
  var ExportDenseRangeSchema = object({
25312
25786
  fromSec: number().nonnegative(),
@@ -25592,7 +26066,14 @@ var sceneMonitorCapability = {
25592
26066
  schema: SceneMonitorStatusSchema,
25593
26067
  kind: "push"
25594
26068
  },
25595
- runtimeState: SceneMonitorStatusSchema
26069
+ runtimeState: SceneMonitorStatusSchema,
26070
+ /**
26071
+ * Runtime-state durability: **session** — re-derived from the current scene on the next evaluation.
26072
+ *
26073
+ * See `RuntimeStateDurability`. Enforced by
26074
+ * `scripts/check-runtime-state-durability.ts`.
26075
+ */
26076
+ durability: "session"
25596
26077
  };
25597
26078
  /**
25598
26079
  * Per-stage gating mode applied to the zones a rule references.
@@ -25736,7 +26217,14 @@ var scriptRunnerCapability = {
25736
26217
  * `isRunning` to render a spinner during execution and surfaces
25737
26218
  * `lastError` / `lastRunSuccess` in the recent-runs panel.
25738
26219
  */
25739
- runtimeState: ScriptRunnerStatusSchema
26220
+ runtimeState: ScriptRunnerStatusSchema,
26221
+ /**
26222
+ * Runtime-state durability: **session** — a restored `isRunning: true` describes a process that died with the previous hub.
26223
+ *
26224
+ * See `RuntimeStateDurability`. Enforced by
26225
+ * `scripts/check-runtime-state-durability.ts`.
26226
+ */
26227
+ durability: "session"
25740
26228
  };
25741
26229
  /**
25742
26230
  * Smoke alarm sensor — boolean "is smoke currently detected" with
@@ -25763,7 +26251,17 @@ var smokeCapability = {
25763
26251
  schema: SmokeStatusSchema,
25764
26252
  kind: "push"
25765
26253
  },
25766
- runtimeState: SmokeStatusSchema
26254
+ runtimeState: SmokeStatusSchema,
26255
+ /**
26256
+ * Runtime-state durability: **restored** — a safety sensor must not read "clear" merely because the hub restarted.
26257
+ *
26258
+ * See `RuntimeStateDurability`. Enforced by
26259
+ * `scripts/check-runtime-state-durability.ts`.
26260
+ */
26261
+ durability: "restored",
26262
+ /** Clock fields: written, but excluded from the compare that decides
26263
+ * whether persisting is worth a SQLite commit. */
26264
+ volatileStateFields: ["lastChangedAt"]
25767
26265
  };
25768
26266
  /**
25769
26267
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -25949,7 +26447,17 @@ var streamParamsCapability = {
25949
26447
  schema: StreamParamsStatusSchema,
25950
26448
  kind: "poll"
25951
26449
  },
25952
- runtimeState: StreamParamsStatusSchema
26450
+ runtimeState: StreamParamsStatusSchema,
26451
+ /**
26452
+ * Runtime-state durability: **restored** — operator-set encoder profile; mutation-driven.
26453
+ *
26454
+ * See `RuntimeStateDurability`. Enforced by
26455
+ * `scripts/check-runtime-state-durability.ts`.
26456
+ */
26457
+ durability: "restored",
26458
+ /** Clock fields: written, but excluded from the compare that decides
26459
+ * whether persisting is worth a SQLite commit. */
26460
+ volatileStateFields: ["lastFetchedAt"]
25953
26461
  };
25954
26462
  /**
25955
26463
  * Generic on/off switch cap for accessory children (siren, floodlight,
@@ -25995,6 +26503,16 @@ var switchCapability = {
25995
26503
  * not need to re-query the provider after a setState mutation.
25996
26504
  */
25997
26505
  runtimeState: SwitchStatusSchema,
26506
+ /**
26507
+ * Runtime-state durability: **restored** — device state an operator reads as authoritative; 55 devices, transition-driven.
26508
+ *
26509
+ * See `RuntimeStateDurability`. Enforced by
26510
+ * `scripts/check-runtime-state-durability.ts`.
26511
+ */
26512
+ durability: "restored",
26513
+ /** Clock fields: written, but excluded from the compare that decides
26514
+ * whether persisting is worth a SQLite commit. */
26515
+ volatileStateFields: ["lastChangedAt"],
25998
26516
  settings: { bindings: [{
25999
26517
  kind: "scalar",
26000
26518
  statusPath: "on",
@@ -26074,7 +26592,17 @@ var tamperCapability = {
26074
26592
  schema: TamperStatusSchema,
26075
26593
  kind: "push"
26076
26594
  },
26077
- runtimeState: TamperStatusSchema
26595
+ runtimeState: TamperStatusSchema,
26596
+ /**
26597
+ * Runtime-state durability: **restored** — as `smoke`.
26598
+ *
26599
+ * See `RuntimeStateDurability`. Enforced by
26600
+ * `scripts/check-runtime-state-durability.ts`.
26601
+ */
26602
+ durability: "restored",
26603
+ /** Clock fields: written, but excluded from the compare that decides
26604
+ * whether persisting is worth a SQLite commit. */
26605
+ volatileStateFields: ["lastChangedAt"]
26078
26606
  };
26079
26607
  /**
26080
26608
  * Single-metric temperature reading. Drives Home Assistant `sensor`
@@ -26119,7 +26647,17 @@ var temperatureSensorCapability = {
26119
26647
  schema: TemperatureSensorStatusSchema,
26120
26648
  kind: "push"
26121
26649
  },
26122
- runtimeState: TemperatureSensorStatusSchema
26650
+ runtimeState: TemperatureSensorStatusSchema,
26651
+ /**
26652
+ * Runtime-state durability: **restored** — as `numeric-sensor` (69 of 125 writes were the clock alone).
26653
+ *
26654
+ * See `RuntimeStateDurability`. Enforced by
26655
+ * `scripts/check-runtime-state-durability.ts`.
26656
+ */
26657
+ durability: "restored",
26658
+ /** Clock fields: written, but excluded from the compare that decides
26659
+ * whether persisting is worth a SQLite commit. */
26660
+ volatileStateFields: ["lastFetchedAt"]
26123
26661
  };
26124
26662
  /**
26125
26663
  * toast — system-scoped singleton capability that streams toast
@@ -26188,7 +26726,14 @@ var updateCapability = {
26188
26726
  schema: UpdateStatusSchema,
26189
26727
  kind: "poll"
26190
26728
  },
26191
- runtimeState: UpdateStatusSchema
26729
+ runtimeState: UpdateStatusSchema,
26730
+ /**
26731
+ * Runtime-state durability: **session** — a restored `inProgress: true` describes an update that is no longer running; versions are re-probed at boot.
26732
+ *
26733
+ * See `RuntimeStateDurability`. Enforced by
26734
+ * `scripts/check-runtime-state-durability.ts`.
26735
+ */
26736
+ durability: "session"
26192
26737
  };
26193
26738
  var UserSummarySchema = object({
26194
26739
  id: string(),
@@ -26522,7 +27067,14 @@ var vacuumControlCapability = {
26522
27067
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26523
27068
  * slice for live state + battery + fan-speed changes.
26524
27069
  */
26525
- runtimeState: VacuumControlStatusSchema
27070
+ runtimeState: VacuumControlStatusSchema,
27071
+ /**
27072
+ * Runtime-state durability: **session** — as `media-player` — a restored `state: cleaning` is a robot that is not cleaning.
27073
+ *
27074
+ * See `RuntimeStateDurability`. Enforced by
27075
+ * `scripts/check-runtime-state-durability.ts`.
27076
+ */
27077
+ durability: "session"
26526
27078
  };
26527
27079
  var ValveStatusSchema = object({
26528
27080
  /** Lifecycle state of the valve. */
@@ -26574,7 +27126,14 @@ var valveCapability = {
26574
27126
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26575
27127
  * slice for live position changes during a move.
26576
27128
  */
26577
- runtimeState: ValveStatusSchema
27129
+ runtimeState: ValveStatusSchema,
27130
+ /**
27131
+ * Runtime-state durability: **session** — as `brightness`.
27132
+ *
27133
+ * See `RuntimeStateDurability`. Enforced by
27134
+ * `scripts/check-runtime-state-durability.ts`.
27135
+ */
27136
+ durability: "session"
26578
27137
  };
26579
27138
  /**
26580
27139
  * Vibration / shake / impact sensor. Drives Home Assistant
@@ -26596,7 +27155,17 @@ var vibrationCapability = {
26596
27155
  schema: VibrationStatusSchema,
26597
27156
  kind: "push"
26598
27157
  },
26599
- runtimeState: VibrationStatusSchema
27158
+ runtimeState: VibrationStatusSchema,
27159
+ /**
27160
+ * Runtime-state durability: **restored** — as `smoke`.
27161
+ *
27162
+ * See `RuntimeStateDurability`. Enforced by
27163
+ * `scripts/check-runtime-state-durability.ts`.
27164
+ */
27165
+ durability: "restored",
27166
+ /** Clock fields: written, but excluded from the compare that decides
27167
+ * whether persisting is worth a SQLite commit. */
27168
+ volatileStateFields: ["lastChangedAt"]
26600
27169
  };
26601
27170
  /**
26602
27171
  * Water heater / boiler cap. Models HA `water_heater.*` entities — a
@@ -26670,7 +27239,14 @@ var waterHeaterCapability = {
26670
27239
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26671
27240
  * slice for live temperature / mode / away changes.
26672
27241
  */
26673
- runtimeState: WaterHeaterStatusSchema
27242
+ runtimeState: WaterHeaterStatusSchema,
27243
+ /**
27244
+ * Runtime-state durability: **session** — as `climate-control`.
27245
+ *
27246
+ * See `RuntimeStateDurability`. Enforced by
27247
+ * `scripts/check-runtime-state-durability.ts`.
27248
+ */
27249
+ durability: "session"
26674
27250
  };
26675
27251
  /**
26676
27252
  * Weather provider cap. Models HA `weather.*` entities — a read-only
@@ -26729,7 +27305,14 @@ var weatherCapability = {
26729
27305
  * Runtime-state slice — mirrored by the kernel. The UI reads the
26730
27306
  * current conditions directly from the slice on each weather push.
26731
27307
  */
26732
- runtimeState: WeatherStatusSchema
27308
+ runtimeState: WeatherStatusSchema,
27309
+ /**
27310
+ * Runtime-state durability: **session** — a forecast is stale the moment the hub is down; the provider re-fetches on connect.
27311
+ *
27312
+ * See `RuntimeStateDurability`. Enforced by
27313
+ * `scripts/check-runtime-state-durability.ts`.
27314
+ */
27315
+ durability: "session"
26733
27316
  };
26734
27317
  /**
26735
27318
  * Per-zone occupancy aggregation produced by the analytics frame
@@ -26891,7 +27474,14 @@ var zoneAnalyticsCapability = {
26891
27474
  * automatically; the explicit `getCurrentSnapshot` cap method is
26892
27475
  * still useful for one-off polls without a subscription.
26893
27476
  */
26894
- runtimeState: CameraOccupancySnapshotSchema
27477
+ runtimeState: CameraOccupancySnapshotSchema,
27478
+ /**
27479
+ * Runtime-state durability: **session** — per-frame analytics; with `audio-metrics` it is ~90 % of the offered write rate. Re-derived on the next frame.
27480
+ *
27481
+ * See `RuntimeStateDurability`. Enforced by
27482
+ * `scripts/check-runtime-state-durability.ts`.
27483
+ */
27484
+ durability: "session"
26895
27485
  };
26896
27486
  /**
26897
27487
  * Stages a {@link ZoneRule} can apply to. Discriminator on the rules
@@ -26969,7 +27559,14 @@ var zoneRulesCapability = {
26969
27559
  motion: array(ZoneRuleSchema).readonly(),
26970
27560
  detection: array(ZoneRuleSchema).readonly(),
26971
27561
  package: array(ZoneRuleSchema).readonly()
26972
- })
27562
+ }),
27563
+ /**
27564
+ * Runtime-state durability: **restored** — operator intent, mutation-only, same argument as `zones`.
27565
+ *
27566
+ * See `RuntimeStateDurability`. Enforced by
27567
+ * `scripts/check-runtime-state-durability.ts`.
27568
+ */
27569
+ durability: "restored"
26973
27570
  };
26974
27571
  /**
26975
27572
  * Accessory device helpers — shared across drivers.
@@ -33722,6 +34319,7 @@ Object.freeze({
33722
34319
  "network-access": "ingress",
33723
34320
  "smtp-provider": "email"
33724
34321
  });
34322
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
33725
34323
  new Set(["devices", "classes"]);
33726
34324
  /**
33727
34325
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
@@ -33999,25 +34597,32 @@ object({
33999
34597
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
34000
34598
  object({
34001
34599
  /**
34002
- * How long a retained native frame is served before it counts as a miss.
34600
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
34601
+ * detection result.
34003
34602
  *
34004
- * Must cover the FULL late-crop horizon: detection inference + the
34005
- * cross-process inference-result hop to hub post-analysis + tracking + the
34006
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
34007
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
34008
- * RAM per busy camera grows linearly with no measured hit-rate gain.
34603
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
34604
+ * a time window was never related to the event the pixels were waiting for.
34605
+ * A held frame now lives from delivery until the runner has its `FrameResult`
34606
+ * at which moment the runner cuts the subject tiles it actually wanted and
34607
+ * releases the frame. The bound exists only so a runner that stops answering
34608
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
34609
+ *
34610
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
34611
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
34612
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
34613
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
34614
+ * `holdOverflow` on the metrics line is what says you need it.
34009
34615
  */
34010
- ttlMs: number().int().min(250).max(1e4),
34616
+ holdFrames: number().int().min(1).max(64),
34011
34617
  /**
34012
34618
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
34013
34619
  *
34014
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
34015
- * which one is actually binding before reasoning from that. At the shipped
34016
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
34017
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
34018
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
34019
- * change that admits fewer frames buys retention WINDOW at constant RAM
34020
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
34620
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
34621
+ * is what decides how much is held, and the ceiling is the number above which
34622
+ * something is wrong. Before that it was the effective cap at 1024 MB with
34623
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
34624
+ * with the TTL expiring nothing, which is exactly the confusion the hold
34625
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
34021
34626
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
34022
34627
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
34023
34628
  * to replace).
@@ -34043,22 +34648,45 @@ object({
34043
34648
  * there is the signal that some caller names frames outside the inference set
34044
34649
  * and that this must go back to `all`.
34045
34650
  */
34046
- admission: NativeLeaseAdmissionSchema
34651
+ admission: NativeLeaseAdmissionSchema,
34652
+ /**
34653
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
34654
+ * compressed native crops the worker cuts at the moment a frame's detection
34655
+ * result arrives, and keeps long after the frame itself is freed.
34656
+ *
34657
+ * This is the knob that replaced the old retention window, and it buys about
34658
+ * three orders of magnitude more of it: a tile is one subject at native
34659
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
34660
+ * the frame it was cut from. A frame on which nothing was detected costs
34661
+ * nothing at all, which is the real change — the old lease paid per FRAME and
34662
+ * was interrogated per SUBJECT.
34663
+ *
34664
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
34665
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34666
+ * reproduce that.
34667
+ */
34668
+ tileBudgetMb: number().int().min(0).max(1024)
34047
34669
  });
34048
34670
  /**
34049
- * The values in force when the operator has set nothing — byte-for-byte the
34050
- * constants the decode worker shipped with as env-var defaults, so making these
34051
- * settings changed no behaviour on the day it landed.
34671
+ * The values in force when the operator has set nothing.
34672
+ *
34673
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
34674
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
34675
+ * in the same change that redefines it would make a regression and a retune
34676
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
34677
+ * live traffic.
34052
34678
  */
34053
34679
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
34054
- ttlMs: 1200,
34680
+ holdFrames: 8,
34055
34681
  budgetMb: 1024,
34056
34682
  activityMs: 15e3,
34683
+ tileBudgetMb: 64,
34057
34684
  admission: "inferred"
34058
34685
  };
34059
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
34686
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34060
34687
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34061
34688
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34689
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
34062
34690
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34063
34691
  /**
34064
34692
  * Names that, when used as URL query parameters, almost certainly carry