@camstack/addon-provider-unraid 0.2.14 → 0.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +723 -95
  2. package/dist/addon.mjs +723 -95
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -10771,7 +10771,14 @@ var cameraStreamsCapability = {
10771
10771
  low: string().optional()
10772
10772
  }),
10773
10773
  lastChangedAt: number()
10774
- })
10774
+ }),
10775
+ /**
10776
+ * 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.
10777
+ *
10778
+ * See `RuntimeStateDurability`. Enforced by
10779
+ * `scripts/check-runtime-state-durability.ts`.
10780
+ */
10781
+ durability: "session"
10775
10782
  };
10776
10783
  /** Where a block runs. The operator chooses — a block driving a device on an
10777
10784
  * agent is the reason placement is not fixed to the hub. */
@@ -11332,6 +11339,13 @@ var deviceDiscoveryCapability = {
11332
11339
  kind: "poll"
11333
11340
  },
11334
11341
  runtimeState: DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: number().int().nonnegative() }),
11342
+ /**
11343
+ * Runtime-state durability: **session** — 5.7 KB of scan output on the largest device, fully re-derivable by re-scanning.
11344
+ *
11345
+ * See `RuntimeStateDurability`. Enforced by
11346
+ * `scripts/check-runtime-state-durability.ts`.
11347
+ */
11348
+ durability: "session",
11335
11349
  methods: {
11336
11350
  /**
11337
11351
  * Snapshot of the current `discovered` list. Returns the
@@ -13231,7 +13245,23 @@ var NotificationActionSchema = object({
13231
13245
  * else — see `notification-center/action-token.ts` for what that does and
13232
13246
  * does not buy.
13233
13247
  */
13234
- destructive: boolean().optional()
13248
+ destructive: boolean().optional(),
13249
+ /**
13250
+ * How the tap should REACH the url.
13251
+ *
13252
+ * `navigate` (absent, and every button authored before this field) opens it:
13253
+ * the phone leaves the notification and shows whatever the callback returns.
13254
+ * That is right for a button whose answer the operator wants to read.
13255
+ *
13256
+ * `background` fires it as a POST and stays put. It exists for the buttons
13257
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13258
+ * an answer to the notification, and being thrown into a browser tab to
13259
+ * confirm it costs more attention than the notification did. A backend that
13260
+ * cannot do a background call renders it as an ordinary link (the adapters
13261
+ * fall back rather than dropping the button), so this is a preference, never
13262
+ * a requirement.
13263
+ */
13264
+ mode: _enum(["navigate", "background"]).optional()
13235
13265
  });
13236
13266
  /**
13237
13267
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -14083,7 +14113,17 @@ var alarmPanelCapability = {
14083
14113
  * full slice; renders an arm button per `availableModes` entry and
14084
14114
  * a PIN field iff `requiresCode === true`.
14085
14115
  */
14086
- runtimeState: AlarmPanelStatusSchema
14116
+ runtimeState: AlarmPanelStatusSchema,
14117
+ /**
14118
+ * Runtime-state durability: **restored** — armed state is the one thing a panel must not lose across a restart.
14119
+ *
14120
+ * See `RuntimeStateDurability`. Enforced by
14121
+ * `scripts/check-runtime-state-durability.ts`.
14122
+ */
14123
+ durability: "restored",
14124
+ /** Clock fields: written, but excluded from the compare that decides
14125
+ * whether persisting is worth a SQLite commit. */
14126
+ volatileStateFields: ["lastChangedAt"]
14087
14127
  };
14088
14128
  /**
14089
14129
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
@@ -14260,6 +14300,9 @@ var NcSystemEventConditionSchema = object({
14260
14300
  nodeIds: array(string().min(1)).min(1).optional(),
14261
14301
  packageNames: array(string().min(1)).min(1).optional()
14262
14302
  });
14303
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14304
+ * outage the operator asked for once and forgot. */
14305
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14263
14306
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14264
14307
  var NcScheduleSchema = object({
14265
14308
  windows: array(object({
@@ -14636,15 +14679,15 @@ var NcConditionsSchema = object({
14636
14679
  * (an `immediate` rule naming an `audio-*` class, one notification per
14637
14680
  * classified sample) stays exactly as it was for rules that already use it.
14638
14681
  *
14639
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14640
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14641
- * (`camstack/src/data/notification-center.ts`, guarded by
14642
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14682
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14683
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14684
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14685
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14643
14686
  * condition fields it does not know when a rule is saved from the phone.
14644
14687
  * Publishing an editor for a condition the app cannot round-trip is how an
14645
- * operator loses a rule's conditions by opening it — so the descriptor, the
14646
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14647
- * does an audio rule become authorable.
14688
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14689
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14690
+ * follows here.
14648
14691
  */
14649
14692
  audio: NcAudioConditionSchema.optional()
14650
14693
  });
@@ -14880,6 +14923,30 @@ var NcRuleInputSchema = object({
14880
14923
  */
14881
14924
  snoozeAllowGlobal: boolean().optional(),
14882
14925
  /**
14926
+ * The snooze durations THIS rule's notification offers as buttons, in
14927
+ * minutes.
14928
+ *
14929
+ * Three states, and all three are distinct — which is exactly why this is
14930
+ * `.optional()` and never `.default()`. A Zod default does not run on the
14931
+ * addon cap path (three production failures in one day), so a schema default
14932
+ * would collapse the first two:
14933
+ *
14934
+ * | value | meaning |
14935
+ * | --- | --- |
14936
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
14937
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
14938
+ * | a list | these choices, de-duplicated and sorted, at most four |
14939
+ *
14940
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
14941
+ * three buttons in total) and a rule that spent it all on snooze choices
14942
+ * would push its own tap-through actions off the notification.
14943
+ *
14944
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
14945
+ * that arms the panel, is exempt automatically and cannot be silenced by a
14946
+ * window from anywhere (D133).
14947
+ */
14948
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
14949
+ /**
14883
14950
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14884
14951
  *
14885
14952
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -14979,6 +15046,7 @@ var NcConditionDescriptorSchema = object({
14979
15046
  "device",
14980
15047
  "package",
14981
15048
  "occupancy",
15049
+ "audio",
14982
15050
  "system"
14983
15051
  ]),
14984
15052
  label: string(),
@@ -14997,6 +15065,7 @@ var NcConditionDescriptorSchema = object({
14997
15065
  "crossingSelect",
14998
15066
  "polygonDraw",
14999
15067
  "occupancy",
15068
+ "audio",
15000
15069
  "deviceState",
15001
15070
  "systemEvent"
15002
15071
  ]),
@@ -15148,7 +15217,20 @@ var NcSnoozeInputSchema = object({
15148
15217
  ruleId: string().optional(),
15149
15218
  /** Required when `scope: 'device'`. */
15150
15219
  deviceId: number().int().optional(),
15151
- durationMinutes: number().int().min(1).max(1440),
15220
+ /**
15221
+ * Narrow the window to these subject classes — "the cat, not the person".
15222
+ *
15223
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15224
+ * what every window authored before this field meant, so no persisted row
15225
+ * changes meaning and no client has to learn anything to keep working.
15226
+ *
15227
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15228
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15229
+ * not at whichever of their four rules happened to produce the notification
15230
+ * they are dismissing.
15231
+ */
15232
+ classes: array(string().min(1)).min(1).optional(),
15233
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
15152
15234
  /**
15153
15235
  * Silence this for EVERY recipient, not just the caller. Permission is
15154
15236
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15173,6 +15255,10 @@ var NcSnoozeSchema = object({
15173
15255
  scope: NcSnoozeScopeSchema,
15174
15256
  ruleId: string().optional(),
15175
15257
  deviceId: number().int().optional(),
15258
+ /** Subject classes this window covers. ABSENT = every class — see
15259
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15260
+ * no SQLite column: nothing queries a window by class. */
15261
+ classes: array(string().min(1)).min(1).optional(),
15176
15262
  startedAt: number(),
15177
15263
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15178
15264
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -17273,7 +17359,14 @@ var zonesCapability = {
17273
17359
  * handle. Slice shape is `{ zones: Zone[] }` so future extensions
17274
17360
  * (e.g. zone groupings) can sit alongside the polygon list.
17275
17361
  */
17276
- runtimeState: object({ zones: array(ZoneSchema).readonly() })
17362
+ runtimeState: object({ zones: array(ZoneSchema).readonly() }),
17363
+ /**
17364
+ * 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.
17365
+ *
17366
+ * See `RuntimeStateDurability`. Enforced by
17367
+ * `scripts/check-runtime-state-durability.ts`.
17368
+ */
17369
+ durability: "restored"
17277
17370
  };
17278
17371
  /**
17279
17372
  * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
@@ -20072,7 +20165,17 @@ var airQualitySensorCapability = {
20072
20165
  schema: AirQualitySensorStatusSchema,
20073
20166
  kind: "push"
20074
20167
  },
20075
- runtimeState: AirQualitySensorStatusSchema
20168
+ runtimeState: AirQualitySensorStatusSchema,
20169
+ /**
20170
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20171
+ *
20172
+ * See `RuntimeStateDurability`. Enforced by
20173
+ * `scripts/check-runtime-state-durability.ts`.
20174
+ */
20175
+ durability: "restored",
20176
+ /** Clock fields: written, but excluded from the compare that decides
20177
+ * whether persisting is worth a SQLite commit. */
20178
+ volatileStateFields: ["lastFetchedAt"]
20076
20179
  };
20077
20180
  /**
20078
20181
  * Ambient illuminance reading in lux. Drives Home Assistant `sensor`
@@ -20104,7 +20207,17 @@ var ambientLightSensorCapability = {
20104
20207
  schema: AmbientLightSensorStatusSchema,
20105
20208
  kind: "push"
20106
20209
  },
20107
- runtimeState: AmbientLightSensorStatusSchema
20210
+ runtimeState: AmbientLightSensorStatusSchema,
20211
+ /**
20212
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20213
+ *
20214
+ * See `RuntimeStateDurability`. Enforced by
20215
+ * `scripts/check-runtime-state-durability.ts`.
20216
+ */
20217
+ durability: "restored",
20218
+ /** Clock fields: written, but excluded from the compare that decides
20219
+ * whether persisting is worth a SQLite commit. */
20220
+ volatileStateFields: ["lastFetchedAt"]
20108
20221
  };
20109
20222
  /**
20110
20223
  * Per-class audio metrics aggregated over a sliding window.
@@ -20222,7 +20335,14 @@ var audioMetricsCapability = {
20222
20335
  }), AudioMetricsHistorySchema)
20223
20336
  },
20224
20337
  /** Reactive runtime-state mirror — live `device.state.audioMetrics.value`. */
20225
- runtimeState: AudioMetricsSnapshotSchema
20338
+ runtimeState: AudioMetricsSnapshotSchema,
20339
+ /**
20340
+ * 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.
20341
+ *
20342
+ * See `RuntimeStateDurability`. Enforced by
20343
+ * `scripts/check-runtime-state-durability.ts`.
20344
+ */
20345
+ durability: "session"
20226
20346
  };
20227
20347
  /**
20228
20348
  * Automation-control cap. Models HA `automation.*` entities on
@@ -20284,7 +20404,14 @@ var automationControlCapability = {
20284
20404
  * reads `enabled` (toggle) + `isRunning` (spinner) + `lastError`
20285
20405
  * (badge) directly.
20286
20406
  */
20287
- runtimeState: AutomationControlStatusSchema
20407
+ runtimeState: AutomationControlStatusSchema,
20408
+ /**
20409
+ * 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.
20410
+ *
20411
+ * See `RuntimeStateDurability`. Enforced by
20412
+ * `scripts/check-runtime-state-durability.ts`.
20413
+ */
20414
+ durability: "session"
20288
20415
  };
20289
20416
  /**
20290
20417
  * Battery status snapshot. Emitted by providers whose device is
@@ -20390,7 +20517,17 @@ onStatusChanged: { data: object({
20390
20517
  * via `device.runtimeState.getCapState('battery')` regardless of
20391
20518
  * the underlying driver.
20392
20519
  */
20393
- runtimeState: BatteryStatusSchema
20520
+ runtimeState: BatteryStatusSchema,
20521
+ /**
20522
+ * 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.
20523
+ *
20524
+ * See `RuntimeStateDurability`. Enforced by
20525
+ * `scripts/check-runtime-state-durability.ts`.
20526
+ */
20527
+ durability: "restored",
20528
+ /** Clock fields: written, but excluded from the compare that decides
20529
+ * whether persisting is worth a SQLite commit. */
20530
+ volatileStateFields: ["lastUpdated"]
20394
20531
  };
20395
20532
  /**
20396
20533
  * Generic boolean sensor — last-resort fallback when no domain-
@@ -20419,7 +20556,17 @@ var binaryCapability = {
20419
20556
  schema: BinaryStatusSchema,
20420
20557
  kind: "push"
20421
20558
  },
20422
- runtimeState: BinaryStatusSchema
20559
+ runtimeState: BinaryStatusSchema,
20560
+ /**
20561
+ * Runtime-state durability: **restored** — transition-driven sensor state; the restored value gives the boot comparison.
20562
+ *
20563
+ * See `RuntimeStateDurability`. Enforced by
20564
+ * `scripts/check-runtime-state-durability.ts`.
20565
+ */
20566
+ durability: "restored",
20567
+ /** Clock fields: written, but excluded from the compare that decides
20568
+ * whether persisting is worth a SQLite commit. */
20569
+ volatileStateFields: ["lastChangedAt"]
20423
20570
  };
20424
20571
  /**
20425
20572
  * Dimmable-light brightness control. Co-exists with `switch` on the
@@ -20472,7 +20619,14 @@ onBrightnessChanged: { data: object({
20472
20619
  * by the kernel. Read via `device.state.brightness.value` so UI
20473
20620
  * sliders surface the current level without polling the provider.
20474
20621
  */
20475
- runtimeState: BrightnessStatusSchema
20622
+ runtimeState: BrightnessStatusSchema,
20623
+ /**
20624
+ * Runtime-state durability: **session** — live lamp state, re-published by the provider on connect.
20625
+ *
20626
+ * See `RuntimeStateDurability`. Enforced by
20627
+ * `scripts/check-runtime-state-durability.ts`.
20628
+ */
20629
+ durability: "session"
20476
20630
  };
20477
20631
  /**
20478
20632
  * button — device-scoped capability for HA `button.*` / `input_button.*`
@@ -20577,7 +20731,17 @@ var carbonMonoxideCapability = {
20577
20731
  schema: CarbonMonoxideStatusSchema,
20578
20732
  kind: "push"
20579
20733
  },
20580
- runtimeState: CarbonMonoxideStatusSchema
20734
+ runtimeState: CarbonMonoxideStatusSchema,
20735
+ /**
20736
+ * Runtime-state durability: **restored** — as `smoke`.
20737
+ *
20738
+ * See `RuntimeStateDurability`. Enforced by
20739
+ * `scripts/check-runtime-state-durability.ts`.
20740
+ */
20741
+ durability: "restored",
20742
+ /** Clock fields: written, but excluded from the compare that decides
20743
+ * whether persisting is worth a SQLite commit. */
20744
+ volatileStateFields: ["lastChangedAt"]
20581
20745
  };
20582
20746
  /**
20583
20747
  * HVAC / climate control cap. Models the full surface of a HA
@@ -20737,7 +20901,14 @@ var climateControlCapability = {
20737
20901
  * the full slice via `device.state.climate-control.value` and refresh
20738
20902
  * on every push without re-querying the provider.
20739
20903
  */
20740
- runtimeState: ClimateControlStatusSchema
20904
+ runtimeState: ClimateControlStatusSchema,
20905
+ /**
20906
+ * Runtime-state durability: **session** — as `brightness`; `currentTemp` moves continuously and is re-published on connect.
20907
+ *
20908
+ * See `RuntimeStateDurability`. Enforced by
20909
+ * `scripts/check-runtime-state-durability.ts`.
20910
+ */
20911
+ durability: "session"
20741
20912
  };
20742
20913
  /**
20743
20914
  * Color-light cap. Coexists with `switch` (on/off) and `brightness`
@@ -20847,7 +21018,14 @@ onColorChanged: { data: object({
20847
21018
  * kernel. Read via `device.state.color.value` so UI pickers surface
20848
21019
  * the current chromaticity without polling the provider.
20849
21020
  */
20850
- runtimeState: ColorStatusSchema
21021
+ runtimeState: ColorStatusSchema,
21022
+ /**
21023
+ * Runtime-state durability: **session** — as `brightness`.
21024
+ *
21025
+ * See `RuntimeStateDurability`. Enforced by
21026
+ * `scripts/check-runtime-state-durability.ts`.
21027
+ */
21028
+ durability: "session"
20851
21029
  };
20852
21030
  var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
20853
21031
  object({
@@ -20905,7 +21083,17 @@ var connectivityCapability = {
20905
21083
  schema: ConnectivityStatusSchema,
20906
21084
  kind: "push"
20907
21085
  },
20908
- runtimeState: ConnectivityStatusSchema
21086
+ runtimeState: ConnectivityStatusSchema,
21087
+ /**
21088
+ * Runtime-state durability: **restored** — same shape and same argument as `device-status`, for links rather than devices.
21089
+ *
21090
+ * See `RuntimeStateDurability`. Enforced by
21091
+ * `scripts/check-runtime-state-durability.ts`.
21092
+ */
21093
+ durability: "restored",
21094
+ /** Clock fields: written, but excluded from the compare that decides
21095
+ * whether persisting is worth a SQLite commit. */
21096
+ volatileStateFields: ["lastChangedAt"]
20909
21097
  };
20910
21098
  /**
20911
21099
  * Generic device-consumables capability — surfaces a device's
@@ -20987,7 +21175,14 @@ reset: method(object({
20987
21175
  }
20988
21176
  }
20989
21177
  },
20990
- runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() })
21178
+ runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() }),
21179
+ /**
21180
+ * Runtime-state durability: **session** — the authority is the appliance; the provider re-reads the whole item array on connect.
21181
+ *
21182
+ * See `RuntimeStateDurability`. Enforced by
21183
+ * `scripts/check-runtime-state-durability.ts`.
21184
+ */
21185
+ durability: "session"
20991
21186
  };
20992
21187
  /**
20993
21188
  * Door / window / opening / garage / valve contact sensor. Boolean
@@ -21018,7 +21213,17 @@ var contactCapability = {
21018
21213
  schema: ContactStatusSchema,
21019
21214
  kind: "push"
21020
21215
  },
21021
- runtimeState: ContactStatusSchema
21216
+ runtimeState: ContactStatusSchema,
21217
+ /**
21218
+ * Runtime-state durability: **restored** — a door left open across a restart must still read open.
21219
+ *
21220
+ * See `RuntimeStateDurability`. Enforced by
21221
+ * `scripts/check-runtime-state-durability.ts`.
21222
+ */
21223
+ durability: "restored",
21224
+ /** Clock fields: written, but excluded from the compare that decides
21225
+ * whether persisting is worth a SQLite commit. */
21226
+ volatileStateFields: ["lastChangedAt"]
21022
21227
  };
21023
21228
  /**
21024
21229
  * Status slice — flat object (the framework's `runtimeState` contract
@@ -21124,7 +21329,14 @@ var controlCapability = {
21124
21329
  * dropdown / text field / date picker) read the slice's discriminant
21125
21330
  * and value directly without polling the provider.
21126
21331
  */
21127
- runtimeState: ControlStatusSchema
21332
+ runtimeState: ControlStatusSchema,
21333
+ /**
21334
+ * Runtime-state durability: **session** — a generic control mirrors an external entity that re-publishes on connect; the options array is re-derived with it.
21335
+ *
21336
+ * See `RuntimeStateDurability`. Enforced by
21337
+ * `scripts/check-runtime-state-durability.ts`.
21338
+ */
21339
+ durability: "session"
21128
21340
  };
21129
21341
  var CoverStatusSchema = object({
21130
21342
  /** Lifecycle state of the cover. */
@@ -21185,7 +21397,17 @@ var coverCapability = {
21185
21397
  * Runtime-state slice — mirrored by the kernel. UI controls watch
21186
21398
  * the slice for live position changes during a move.
21187
21399
  */
21188
- runtimeState: CoverStatusSchema
21400
+ runtimeState: CoverStatusSchema,
21401
+ /**
21402
+ * Runtime-state durability: **restored** — position survives a restart on the device; the mirror should agree at boot rather than read blank.
21403
+ *
21404
+ * See `RuntimeStateDurability`. Enforced by
21405
+ * `scripts/check-runtime-state-durability.ts`.
21406
+ */
21407
+ durability: "restored",
21408
+ /** Clock fields: written, but excluded from the compare that decides
21409
+ * whether persisting is worth a SQLite commit. */
21410
+ volatileStateFields: ["lastChangedAt"]
21189
21411
  };
21190
21412
  /**
21191
21413
  * Vendor-neutral day/night (IR-cut) control — the per-camera config cap
@@ -21279,7 +21501,17 @@ var dayNightCapability = {
21279
21501
  schema: DayNightStatusSchema,
21280
21502
  kind: "poll"
21281
21503
  },
21282
- runtimeState: DayNightStatusSchema
21504
+ runtimeState: DayNightStatusSchema,
21505
+ /**
21506
+ * Runtime-state durability: **restored** — operator-set IR-cut behaviour; mutation-driven.
21507
+ *
21508
+ * See `RuntimeStateDurability`. Enforced by
21509
+ * `scripts/check-runtime-state-durability.ts`.
21510
+ */
21511
+ durability: "restored",
21512
+ /** Clock fields: written, but excluded from the compare that decides
21513
+ * whether persisting is worth a SQLite commit. */
21514
+ volatileStateFields: ["lastFetchedAt"]
21283
21515
  };
21284
21516
  /**
21285
21517
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
@@ -21326,7 +21558,17 @@ onStatusChanged: { data: object({
21326
21558
  schema: DeviceStatusSchema,
21327
21559
  kind: "push"
21328
21560
  },
21329
- runtimeState: DeviceStatusSchema
21561
+ runtimeState: DeviceStatusSchema,
21562
+ /**
21563
+ * 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.
21564
+ *
21565
+ * See `RuntimeStateDurability`. Enforced by
21566
+ * `scripts/check-runtime-state-durability.ts`.
21567
+ */
21568
+ durability: "restored",
21569
+ /** Clock fields: written, but excluded from the compare that decides
21570
+ * whether persisting is worth a SQLite commit. */
21571
+ volatileStateFields: ["lastChangedAt"]
21330
21572
  };
21331
21573
  /**
21332
21574
  * Doorbell button cap. Two kinds of providers coexist behind this cap
@@ -21388,7 +21630,14 @@ onPressed: { data: DoorbellPressEventSchema } },
21388
21630
  * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
21389
21631
  * without subscribing.
21390
21632
  */
21391
- runtimeState: DoorbellStatusSchema
21633
+ runtimeState: DoorbellStatusSchema,
21634
+ /**
21635
+ * 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.
21636
+ *
21637
+ * See `RuntimeStateDurability`. Enforced by
21638
+ * `scripts/check-runtime-state-durability.ts`.
21639
+ */
21640
+ durability: "restored"
21392
21641
  };
21393
21642
  /**
21394
21643
  * Enum-state sensor — a string value picked from a finite option set.
@@ -21428,7 +21677,17 @@ var enumSensorCapability = {
21428
21677
  schema: EnumSensorStatusSchema,
21429
21678
  kind: "push"
21430
21679
  },
21431
- runtimeState: EnumSensorStatusSchema
21680
+ runtimeState: EnumSensorStatusSchema,
21681
+ /**
21682
+ * Runtime-state durability: **restored** — as `numeric-sensor`; 80 devices.
21683
+ *
21684
+ * See `RuntimeStateDurability`. Enforced by
21685
+ * `scripts/check-runtime-state-durability.ts`.
21686
+ */
21687
+ durability: "restored",
21688
+ /** Clock fields: written, but excluded from the compare that decides
21689
+ * whether persisting is worth a SQLite commit. */
21690
+ volatileStateFields: ["lastFetchedAt"]
21432
21691
  };
21433
21692
  /**
21434
21693
  * Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
@@ -21464,7 +21723,14 @@ var eventEmitterCapability = {
21464
21723
  schema: EventEmitterStatusSchema,
21465
21724
  kind: "push"
21466
21725
  },
21467
- runtimeState: EventEmitterStatusSchema
21726
+ runtimeState: EventEmitterStatusSchema,
21727
+ /**
21728
+ * Runtime-state durability: **session** — `eventCountSinceStart` names its own scope.
21729
+ *
21730
+ * See `RuntimeStateDurability`. Enforced by
21731
+ * `scripts/check-runtime-state-durability.ts`.
21732
+ */
21733
+ durability: "session"
21468
21734
  };
21469
21735
  var EventItemSchema = object({
21470
21736
  id: string(),
@@ -21745,7 +22011,14 @@ var fanControlCapability = {
21745
22011
  * Runtime-state slice — mirrored by the kernel. UI fan speed
21746
22012
  * sliders read `percentage` for live updates.
21747
22013
  */
21748
- runtimeState: FanControlStatusSchema
22014
+ runtimeState: FanControlStatusSchema,
22015
+ /**
22016
+ * Runtime-state durability: **session** — as `brightness`.
22017
+ *
22018
+ * See `RuntimeStateDurability`. Enforced by
22019
+ * `scripts/check-runtime-state-durability.ts`.
22020
+ */
22021
+ durability: "session"
21749
22022
  };
21750
22023
  /**
21751
22024
  * Per-device feature/identity probe slice. Holds the runtime-resolved
@@ -21821,7 +22094,14 @@ onProbeChanged: { data: object({
21821
22094
  schema: FeatureProbeStatusSchema,
21822
22095
  kind: "push"
21823
22096
  },
21824
- runtimeState: FeatureProbeStatusSchema
22097
+ runtimeState: FeatureProbeStatusSchema,
22098
+ /**
22099
+ * 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.
22100
+ *
22101
+ * See `RuntimeStateDurability`. Enforced by
22102
+ * `scripts/check-runtime-state-durability.ts`.
22103
+ */
22104
+ durability: "session"
21825
22105
  };
21826
22106
  /**
21827
22107
  * Water leak / moisture sensor. Boolean "is liquid currently
@@ -21848,7 +22128,17 @@ var floodCapability = {
21848
22128
  schema: FloodStatusSchema,
21849
22129
  kind: "push"
21850
22130
  },
21851
- runtimeState: FloodStatusSchema
22131
+ runtimeState: FloodStatusSchema,
22132
+ /**
22133
+ * Runtime-state durability: **restored** — as `smoke`.
22134
+ *
22135
+ * See `RuntimeStateDurability`. Enforced by
22136
+ * `scripts/check-runtime-state-durability.ts`.
22137
+ */
22138
+ durability: "restored",
22139
+ /** Clock fields: written, but excluded from the compare that decides
22140
+ * whether persisting is worth a SQLite commit. */
22141
+ volatileStateFields: ["lastChangedAt"]
21852
22142
  };
21853
22143
  /**
21854
22144
  * Combustible-gas (LPG / methane / hydrogen) alarm sensor. Drives
@@ -21871,7 +22161,17 @@ var gasCapability = {
21871
22161
  schema: GasStatusSchema,
21872
22162
  kind: "push"
21873
22163
  },
21874
- runtimeState: GasStatusSchema
22164
+ runtimeState: GasStatusSchema,
22165
+ /**
22166
+ * Runtime-state durability: **restored** — as `smoke`.
22167
+ *
22168
+ * See `RuntimeStateDurability`. Enforced by
22169
+ * `scripts/check-runtime-state-durability.ts`.
22170
+ */
22171
+ durability: "restored",
22172
+ /** Clock fields: written, but excluded from the compare that decides
22173
+ * whether persisting is worth a SQLite commit. */
22174
+ volatileStateFields: ["lastChangedAt"]
21875
22175
  };
21876
22176
  /**
21877
22177
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
@@ -21947,7 +22247,14 @@ var humidifierCapability = {
21947
22247
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
21948
22248
  * slice for live humidity / mode changes.
21949
22249
  */
21950
- runtimeState: HumidifierStatusSchema
22250
+ runtimeState: HumidifierStatusSchema,
22251
+ /**
22252
+ * Runtime-state durability: **session** — as `climate-control`.
22253
+ *
22254
+ * See `RuntimeStateDurability`. Enforced by
22255
+ * `scripts/check-runtime-state-durability.ts`.
22256
+ */
22257
+ durability: "session"
21951
22258
  };
21952
22259
  /**
21953
22260
  * Single-metric humidity reading. Drives Home Assistant `sensor`
@@ -21983,7 +22290,17 @@ var humiditySensorCapability = {
21983
22290
  schema: HumiditySensorStatusSchema,
21984
22291
  kind: "push"
21985
22292
  },
21986
- runtimeState: HumiditySensorStatusSchema
22293
+ runtimeState: HumiditySensorStatusSchema,
22294
+ /**
22295
+ * Runtime-state durability: **restored** — as `numeric-sensor` (67 of 75 writes were the clock alone).
22296
+ *
22297
+ * See `RuntimeStateDurability`. Enforced by
22298
+ * `scripts/check-runtime-state-durability.ts`.
22299
+ */
22300
+ durability: "restored",
22301
+ /** Clock fields: written, but excluded from the compare that decides
22302
+ * whether persisting is worth a SQLite commit. */
22303
+ volatileStateFields: ["lastFetchedAt"]
21987
22304
  };
21988
22305
  /**
21989
22306
  * Image display cap. Models a single still image exposed by an integration —
@@ -22021,7 +22338,14 @@ var imageCapability = {
22021
22338
  * Runtime-state slice — mirrored by the kernel. The UI reads `url`
22022
22339
  * directly and renders the still image.
22023
22340
  */
22024
- runtimeState: ImageStatusSchema
22341
+ runtimeState: ImageStatusSchema,
22342
+ /**
22343
+ * Runtime-state durability: **session** — a snapshot URL is a session-scoped handle; a restored one points at nothing.
22344
+ *
22345
+ * See `RuntimeStateDurability`. Enforced by
22346
+ * `scripts/check-runtime-state-durability.ts`.
22347
+ */
22348
+ durability: "session"
22025
22349
  };
22026
22350
  /**
22027
22351
  * Vendor-neutral image / picture-adjustment cap — the per-camera config
@@ -22170,7 +22494,17 @@ var imageSettingsCapability = {
22170
22494
  schema: ImageSettingsStatusSchema,
22171
22495
  kind: "poll"
22172
22496
  },
22173
- runtimeState: ImageSettingsStatusSchema
22497
+ runtimeState: ImageSettingsStatusSchema,
22498
+ /**
22499
+ * Runtime-state durability: **restored** — operator-set camera imaging; mutation-driven.
22500
+ *
22501
+ * See `RuntimeStateDurability`. Enforced by
22502
+ * `scripts/check-runtime-state-durability.ts`.
22503
+ */
22504
+ durability: "restored",
22505
+ /** Clock fields: written, but excluded from the compare that decides
22506
+ * whether persisting is worth a SQLite commit. */
22507
+ volatileStateFields: ["lastFetchedAt"]
22174
22508
  };
22175
22509
  /**
22176
22510
  * integrations — system-scoped singleton capability for integration
@@ -22510,7 +22844,14 @@ var lawnMowerControlCapability = {
22510
22844
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22511
22845
  * slice for live activity + battery changes.
22512
22846
  */
22513
- runtimeState: LawnMowerControlStatusSchema
22847
+ runtimeState: LawnMowerControlStatusSchema,
22848
+ /**
22849
+ * Runtime-state durability: **session** — as `vacuum-control`.
22850
+ *
22851
+ * See `RuntimeStateDurability`. Enforced by
22852
+ * `scripts/check-runtime-state-durability.ts`.
22853
+ */
22854
+ durability: "session"
22514
22855
  };
22515
22856
  /**
22516
22857
  * local-network — hub-only singleton.
@@ -22716,7 +23057,17 @@ var lockControlCapability = {
22716
23057
  * read `state` and disable themselves during `locking`/`unlocking`
22717
23058
  * transitions.
22718
23059
  */
22719
- runtimeState: LockControlStatusSchema
23060
+ runtimeState: LockControlStatusSchema,
23061
+ /**
23062
+ * Runtime-state durability: **restored** — a lock left locked must still read locked.
23063
+ *
23064
+ * See `RuntimeStateDurability`. Enforced by
23065
+ * `scripts/check-runtime-state-durability.ts`.
23066
+ */
23067
+ durability: "restored",
23068
+ /** Clock fields: written, but excluded from the compare that decides
23069
+ * whether persisting is worth a SQLite commit. */
23070
+ volatileStateFields: ["lastChangedAt"]
22720
23071
  };
22721
23072
  /**
22722
23073
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
@@ -22878,7 +23229,14 @@ var mediaPlayerCapability = {
22878
23229
  * full slice for live now-playing, volume, and progress updates
22879
23230
  * without polling.
22880
23231
  */
22881
- runtimeState: MediaPlayerStatusSchema
23232
+ runtimeState: MediaPlayerStatusSchema,
23233
+ /**
23234
+ * Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
23235
+ *
23236
+ * See `RuntimeStateDurability`. Enforced by
23237
+ * `scripts/check-runtime-state-durability.ts`.
23238
+ */
23239
+ durability: "session"
22882
23240
  };
22883
23241
  /**
22884
23242
  * mesh-network — collection cap for mesh-VPN providers.
@@ -23142,7 +23500,14 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
23142
23500
  * `device.state.motion.value`. Reads never invoke the provider, so
23143
23501
  * UIs and other addons can poll the cached state safely.
23144
23502
  */
23145
- runtimeState: MotionStatusSchema
23503
+ runtimeState: MotionStatusSchema,
23504
+ /**
23505
+ * 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.
23506
+ *
23507
+ * See `RuntimeStateDurability`. Enforced by
23508
+ * `scripts/check-runtime-state-durability.ts`.
23509
+ */
23510
+ durability: "session"
23146
23511
  };
23147
23512
  /**
23148
23513
  * Motion-trigger toggle for accessory devices.
@@ -23207,7 +23572,14 @@ var motionTriggerCapability = {
23207
23572
  schema: MotionTriggerStatusSchema,
23208
23573
  kind: "command-driven"
23209
23574
  },
23210
- runtimeState: MotionTriggerRuntimeStateSchema
23575
+ runtimeState: MotionTriggerRuntimeStateSchema,
23576
+ /**
23577
+ * 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.
23578
+ *
23579
+ * See `RuntimeStateDurability`. Enforced by
23580
+ * `scripts/check-runtime-state-durability.ts`.
23581
+ */
23582
+ durability: "session"
23211
23583
  };
23212
23584
  /**
23213
23585
  * Motion-zones share the same MaskShape vocabulary as privacy-mask — the
@@ -23274,7 +23646,17 @@ var motionZonesCapability = {
23274
23646
  schema: MotionZoneStatusSchema,
23275
23647
  kind: "poll"
23276
23648
  },
23277
- runtimeState: MotionZoneStatusSchema
23649
+ runtimeState: MotionZoneStatusSchema,
23650
+ /**
23651
+ * 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.
23652
+ *
23653
+ * See `RuntimeStateDurability`. Enforced by
23654
+ * `scripts/check-runtime-state-durability.ts`.
23655
+ */
23656
+ durability: "restored",
23657
+ /** Clock fields: written, but excluded from the compare that decides
23658
+ * whether persisting is worth a SQLite commit. */
23659
+ volatileStateFields: ["lastFetchedAt"]
23278
23660
  };
23279
23661
  /**
23280
23662
  * On-camera AI object detection cap. Surfaces per-device the classes
@@ -23348,7 +23730,17 @@ var nativeObjectDetectionCapability = {
23348
23730
  schema: NativeObjectDetectionStatusSchema,
23349
23731
  kind: "push"
23350
23732
  },
23351
- runtimeState: NativeObjectDetectionRuntimeStateSchema
23733
+ runtimeState: NativeObjectDetectionRuntimeStateSchema,
23734
+ /**
23735
+ * 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.
23736
+ *
23737
+ * See `RuntimeStateDurability`. Enforced by
23738
+ * `scripts/check-runtime-state-durability.ts`.
23739
+ */
23740
+ durability: "restored",
23741
+ /** Clock fields: written, but excluded from the compare that decides
23742
+ * whether persisting is worth a SQLite commit. */
23743
+ volatileStateFields: ["lastFetchedAt"]
23352
23744
  };
23353
23745
  /**
23354
23746
  * network-quality — system-scoped singleton capability tracking RTT,
@@ -23682,7 +24074,14 @@ onSent: { data: object({
23682
24074
  * form reads `supports` to gate optional fields; history pane reads
23683
24075
  * `lastSentAt` / `lastError` / `queueDepth`.
23684
24076
  */
23685
- runtimeState: NotifierStatusSchema
24077
+ runtimeState: NotifierStatusSchema,
24078
+ /**
24079
+ * Runtime-state durability: **session** — live queue depth and last-send state; a restored queue depth describes a queue that no longer exists.
24080
+ *
24081
+ * See `RuntimeStateDurability`. Enforced by
24082
+ * `scripts/check-runtime-state-durability.ts`.
24083
+ */
24084
+ durability: "session"
23686
24085
  };
23687
24086
  /**
23688
24087
  * Generic numeric sensor — last-resort fallback when no typed numeric
@@ -23725,7 +24124,17 @@ var numericSensorCapability = {
23725
24124
  schema: NumericSensorStatusSchema,
23726
24125
  kind: "push"
23727
24126
  },
23728
- runtimeState: NumericSensorStatusSchema
24127
+ runtimeState: NumericSensorStatusSchema,
24128
+ /**
24129
+ * 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.
24130
+ *
24131
+ * See `RuntimeStateDurability`. Enforced by
24132
+ * `scripts/check-runtime-state-durability.ts`.
24133
+ */
24134
+ durability: "restored",
24135
+ /** Clock fields: written, but excluded from the compare that decides
24136
+ * whether persisting is worth a SQLite commit. */
24137
+ volatileStateFields: ["lastFetchedAt"]
23729
24138
  };
23730
24139
  /**
23731
24140
  * Generic on-screen-display (video overlay) cap. Each camera exposes
@@ -24110,7 +24519,14 @@ var petFeederCapability = {
24110
24519
  * the full slice via `device.state.petFeeder.value` and refresh on
24111
24520
  * every poll without re-querying the provider.
24112
24521
  */
24113
- runtimeState: PetFeederStatusSchema
24522
+ runtimeState: PetFeederStatusSchema,
24523
+ /**
24524
+ * Runtime-state durability: **session** — live appliance state re-published on connect.
24525
+ *
24526
+ * See `RuntimeStateDurability`. Enforced by
24527
+ * `scripts/check-runtime-state-durability.ts`.
24528
+ */
24529
+ durability: "session"
24114
24530
  };
24115
24531
  var VehicleSchema = object({
24116
24532
  id: string(),
@@ -24422,7 +24838,17 @@ var powerMeterCapability = {
24422
24838
  schema: PowerMeterStatusSchema,
24423
24839
  kind: "push"
24424
24840
  },
24425
- runtimeState: PowerMeterStatusSchema
24841
+ runtimeState: PowerMeterStatusSchema,
24842
+ /**
24843
+ * Runtime-state durability: **restored** — as `numeric-sensor`; `kwhTotal` is an accumulator whose restored value is the baseline.
24844
+ *
24845
+ * See `RuntimeStateDurability`. Enforced by
24846
+ * `scripts/check-runtime-state-durability.ts`.
24847
+ */
24848
+ durability: "restored",
24849
+ /** Clock fields: written, but excluded from the compare that decides
24850
+ * whether persisting is worth a SQLite commit. */
24851
+ volatileStateFields: ["lastFetchedAt"]
24426
24852
  };
24427
24853
  /**
24428
24854
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -24479,7 +24905,17 @@ var presenceCapability = {
24479
24905
  * the map pin is rendered (use `DeviceFeature.PresenceGps` for the
24480
24906
  * pre-fetch fast-path check).
24481
24907
  */
24482
- runtimeState: PresenceStatusSchema
24908
+ runtimeState: PresenceStatusSchema,
24909
+ /**
24910
+ * Runtime-state durability: **restored** — occupancy-relevant: the restored state is what an occupancy rule compares the first post-restart observation against.
24911
+ *
24912
+ * See `RuntimeStateDurability`. Enforced by
24913
+ * `scripts/check-runtime-state-durability.ts`.
24914
+ */
24915
+ durability: "restored",
24916
+ /** Clock fields: written, but excluded from the compare that decides
24917
+ * whether persisting is worth a SQLite commit. */
24918
+ volatileStateFields: ["lastChangedAt"]
24483
24919
  };
24484
24920
  /**
24485
24921
  * Atmospheric pressure reading in hectopascals. Drives Home Assistant
@@ -24515,7 +24951,17 @@ var pressureSensorCapability = {
24515
24951
  schema: PressureSensorStatusSchema,
24516
24952
  kind: "push"
24517
24953
  },
24518
- runtimeState: PressureSensorStatusSchema
24954
+ runtimeState: PressureSensorStatusSchema,
24955
+ /**
24956
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
24957
+ *
24958
+ * See `RuntimeStateDurability`. Enforced by
24959
+ * `scripts/check-runtime-state-durability.ts`.
24960
+ */
24961
+ durability: "restored",
24962
+ /** Clock fields: written, but excluded from the compare that decides
24963
+ * whether persisting is worth a SQLite commit. */
24964
+ volatileStateFields: ["lastFetchedAt"]
24519
24965
  };
24520
24966
  /**
24521
24967
  * PRIVACY — what the camera deliberately does not capture. Two planes:
@@ -24645,7 +25091,17 @@ var privacyMaskCapability = {
24645
25091
  schema: PrivacyMaskStatusSchema,
24646
25092
  kind: "poll"
24647
25093
  },
24648
- runtimeState: PrivacyMaskStatusSchema
25094
+ runtimeState: PrivacyMaskStatusSchema,
25095
+ /**
25096
+ * Runtime-state durability: **restored** — operator-drawn regions, zero real churn — 22 writes in 25 minutes, every one of them the clock.
25097
+ *
25098
+ * See `RuntimeStateDurability`. Enforced by
25099
+ * `scripts/check-runtime-state-durability.ts`.
25100
+ */
25101
+ durability: "restored",
25102
+ /** Clock fields: written, but excluded from the compare that decides
25103
+ * whether persisting is worth a SQLite commit. */
25104
+ volatileStateFields: ["lastFetchedAt"]
24649
25105
  };
24650
25106
  var PtzPresetSchema = object({
24651
25107
  id: string(),
@@ -24811,7 +25267,14 @@ var ptzAutotrackCapability = {
24811
25267
  * fetch / cache / fallback logic out of the four cap methods —
24812
25268
  * they become trampolines over `runtimeState`.
24813
25269
  */
24814
- runtimeState: PtzAutotrackRuntimeStateSchema
25270
+ runtimeState: PtzAutotrackRuntimeStateSchema,
25271
+ /**
25272
+ * Runtime-state durability: **session** — mirrors the camera's own autotrack config, re-read on connect.
25273
+ *
25274
+ * See `RuntimeStateDurability`. Enforced by
25275
+ * `scripts/check-runtime-state-durability.ts`.
25276
+ */
25277
+ durability: "session"
24815
25278
  };
24816
25279
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
24817
25280
  kind: "mutation",
@@ -25158,13 +25621,24 @@ method(object({
25158
25621
  /** Playback-speed multiplier for the render (1 = realtime). */
25159
25622
  var ExportSpeedSchema = number().min(.25).max(32);
25160
25623
  /**
25161
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25624
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
25625
+ *
25626
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
25627
+ * derives these bounds from things that happened at a TIME (a track's
25628
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
25629
+ * every segment present for the range, with each recording GAP removed. The
25630
+ * two agree only on a window that recorded without one interruption, and only
25631
+ * the render side knows the segments, so the translation lives there
25632
+ * (`export-dense-map.ts`, addon-pipeline).
25633
+ *
25634
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
25635
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
25636
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
25637
+ * the video was a uniform timelapse, and the log line reported the five ranges
25638
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
25162
25639
  *
25163
- * Relative and not absolute epoch on purpose: the renderer's frame-select
25164
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25165
- * playlist. Handing it absolute epochs would make every call site responsible
25166
- * for the same subtraction, and the one that forgot would emit a filter that
25167
- * selects nothing — silently, as a uniform timelapse.
25640
+ * Relative and not absolute epoch, because an absolute epoch would make every
25641
+ * call site responsible for the same subtraction.
25168
25642
  */
25169
25643
  var ExportDenseRangeSchema = object({
25170
25644
  fromSec: number().nonnegative(),
@@ -25450,7 +25924,14 @@ var sceneMonitorCapability = {
25450
25924
  schema: SceneMonitorStatusSchema,
25451
25925
  kind: "push"
25452
25926
  },
25453
- runtimeState: SceneMonitorStatusSchema
25927
+ runtimeState: SceneMonitorStatusSchema,
25928
+ /**
25929
+ * Runtime-state durability: **session** — re-derived from the current scene on the next evaluation.
25930
+ *
25931
+ * See `RuntimeStateDurability`. Enforced by
25932
+ * `scripts/check-runtime-state-durability.ts`.
25933
+ */
25934
+ durability: "session"
25454
25935
  };
25455
25936
  /**
25456
25937
  * Per-stage gating mode applied to the zones a rule references.
@@ -25594,7 +26075,14 @@ var scriptRunnerCapability = {
25594
26075
  * `isRunning` to render a spinner during execution and surfaces
25595
26076
  * `lastError` / `lastRunSuccess` in the recent-runs panel.
25596
26077
  */
25597
- runtimeState: ScriptRunnerStatusSchema
26078
+ runtimeState: ScriptRunnerStatusSchema,
26079
+ /**
26080
+ * Runtime-state durability: **session** — a restored `isRunning: true` describes a process that died with the previous hub.
26081
+ *
26082
+ * See `RuntimeStateDurability`. Enforced by
26083
+ * `scripts/check-runtime-state-durability.ts`.
26084
+ */
26085
+ durability: "session"
25598
26086
  };
25599
26087
  /**
25600
26088
  * Smoke alarm sensor — boolean "is smoke currently detected" with
@@ -25621,7 +26109,17 @@ var smokeCapability = {
25621
26109
  schema: SmokeStatusSchema,
25622
26110
  kind: "push"
25623
26111
  },
25624
- runtimeState: SmokeStatusSchema
26112
+ runtimeState: SmokeStatusSchema,
26113
+ /**
26114
+ * Runtime-state durability: **restored** — a safety sensor must not read "clear" merely because the hub restarted.
26115
+ *
26116
+ * See `RuntimeStateDurability`. Enforced by
26117
+ * `scripts/check-runtime-state-durability.ts`.
26118
+ */
26119
+ durability: "restored",
26120
+ /** Clock fields: written, but excluded from the compare that decides
26121
+ * whether persisting is worth a SQLite commit. */
26122
+ volatileStateFields: ["lastChangedAt"]
25625
26123
  };
25626
26124
  /**
25627
26125
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -25794,7 +26292,17 @@ var streamParamsCapability = {
25794
26292
  schema: StreamParamsStatusSchema,
25795
26293
  kind: "poll"
25796
26294
  },
25797
- runtimeState: StreamParamsStatusSchema
26295
+ runtimeState: StreamParamsStatusSchema,
26296
+ /**
26297
+ * Runtime-state durability: **restored** — operator-set encoder profile; mutation-driven.
26298
+ *
26299
+ * See `RuntimeStateDurability`. Enforced by
26300
+ * `scripts/check-runtime-state-durability.ts`.
26301
+ */
26302
+ durability: "restored",
26303
+ /** Clock fields: written, but excluded from the compare that decides
26304
+ * whether persisting is worth a SQLite commit. */
26305
+ volatileStateFields: ["lastFetchedAt"]
25798
26306
  };
25799
26307
  /**
25800
26308
  * Generic on/off switch cap for accessory children (siren, floodlight,
@@ -25840,6 +26348,16 @@ var switchCapability = {
25840
26348
  * not need to re-query the provider after a setState mutation.
25841
26349
  */
25842
26350
  runtimeState: SwitchStatusSchema,
26351
+ /**
26352
+ * Runtime-state durability: **restored** — device state an operator reads as authoritative; 55 devices, transition-driven.
26353
+ *
26354
+ * See `RuntimeStateDurability`. Enforced by
26355
+ * `scripts/check-runtime-state-durability.ts`.
26356
+ */
26357
+ durability: "restored",
26358
+ /** Clock fields: written, but excluded from the compare that decides
26359
+ * whether persisting is worth a SQLite commit. */
26360
+ volatileStateFields: ["lastChangedAt"],
25843
26361
  settings: { bindings: [{
25844
26362
  kind: "scalar",
25845
26363
  statusPath: "on",
@@ -25919,7 +26437,17 @@ var tamperCapability = {
25919
26437
  schema: TamperStatusSchema,
25920
26438
  kind: "push"
25921
26439
  },
25922
- runtimeState: TamperStatusSchema
26440
+ runtimeState: TamperStatusSchema,
26441
+ /**
26442
+ * Runtime-state durability: **restored** — as `smoke`.
26443
+ *
26444
+ * See `RuntimeStateDurability`. Enforced by
26445
+ * `scripts/check-runtime-state-durability.ts`.
26446
+ */
26447
+ durability: "restored",
26448
+ /** Clock fields: written, but excluded from the compare that decides
26449
+ * whether persisting is worth a SQLite commit. */
26450
+ volatileStateFields: ["lastChangedAt"]
25923
26451
  };
25924
26452
  /**
25925
26453
  * Single-metric temperature reading. Drives Home Assistant `sensor`
@@ -25964,7 +26492,17 @@ var temperatureSensorCapability = {
25964
26492
  schema: TemperatureSensorStatusSchema,
25965
26493
  kind: "push"
25966
26494
  },
25967
- runtimeState: TemperatureSensorStatusSchema
26495
+ runtimeState: TemperatureSensorStatusSchema,
26496
+ /**
26497
+ * Runtime-state durability: **restored** — as `numeric-sensor` (69 of 125 writes were the clock alone).
26498
+ *
26499
+ * See `RuntimeStateDurability`. Enforced by
26500
+ * `scripts/check-runtime-state-durability.ts`.
26501
+ */
26502
+ durability: "restored",
26503
+ /** Clock fields: written, but excluded from the compare that decides
26504
+ * whether persisting is worth a SQLite commit. */
26505
+ volatileStateFields: ["lastFetchedAt"]
25968
26506
  };
25969
26507
  /**
25970
26508
  * toast — system-scoped singleton capability that streams toast
@@ -26033,7 +26571,14 @@ var updateCapability = {
26033
26571
  schema: UpdateStatusSchema,
26034
26572
  kind: "poll"
26035
26573
  },
26036
- runtimeState: UpdateStatusSchema
26574
+ runtimeState: UpdateStatusSchema,
26575
+ /**
26576
+ * Runtime-state durability: **session** — a restored `inProgress: true` describes an update that is no longer running; versions are re-probed at boot.
26577
+ *
26578
+ * See `RuntimeStateDurability`. Enforced by
26579
+ * `scripts/check-runtime-state-durability.ts`.
26580
+ */
26581
+ durability: "session"
26037
26582
  };
26038
26583
  var UserSummarySchema = object({
26039
26584
  id: string(),
@@ -26367,7 +26912,14 @@ var vacuumControlCapability = {
26367
26912
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26368
26913
  * slice for live state + battery + fan-speed changes.
26369
26914
  */
26370
- runtimeState: VacuumControlStatusSchema
26915
+ runtimeState: VacuumControlStatusSchema,
26916
+ /**
26917
+ * Runtime-state durability: **session** — as `media-player` — a restored `state: cleaning` is a robot that is not cleaning.
26918
+ *
26919
+ * See `RuntimeStateDurability`. Enforced by
26920
+ * `scripts/check-runtime-state-durability.ts`.
26921
+ */
26922
+ durability: "session"
26371
26923
  };
26372
26924
  var ValveStatusSchema = object({
26373
26925
  /** Lifecycle state of the valve. */
@@ -26419,7 +26971,14 @@ var valveCapability = {
26419
26971
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26420
26972
  * slice for live position changes during a move.
26421
26973
  */
26422
- runtimeState: ValveStatusSchema
26974
+ runtimeState: ValveStatusSchema,
26975
+ /**
26976
+ * Runtime-state durability: **session** — as `brightness`.
26977
+ *
26978
+ * See `RuntimeStateDurability`. Enforced by
26979
+ * `scripts/check-runtime-state-durability.ts`.
26980
+ */
26981
+ durability: "session"
26423
26982
  };
26424
26983
  /**
26425
26984
  * Vibration / shake / impact sensor. Drives Home Assistant
@@ -26441,7 +27000,17 @@ var vibrationCapability = {
26441
27000
  schema: VibrationStatusSchema,
26442
27001
  kind: "push"
26443
27002
  },
26444
- runtimeState: VibrationStatusSchema
27003
+ runtimeState: VibrationStatusSchema,
27004
+ /**
27005
+ * Runtime-state durability: **restored** — as `smoke`.
27006
+ *
27007
+ * See `RuntimeStateDurability`. Enforced by
27008
+ * `scripts/check-runtime-state-durability.ts`.
27009
+ */
27010
+ durability: "restored",
27011
+ /** Clock fields: written, but excluded from the compare that decides
27012
+ * whether persisting is worth a SQLite commit. */
27013
+ volatileStateFields: ["lastChangedAt"]
26445
27014
  };
26446
27015
  /**
26447
27016
  * Water heater / boiler cap. Models HA `water_heater.*` entities — a
@@ -26515,7 +27084,14 @@ var waterHeaterCapability = {
26515
27084
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26516
27085
  * slice for live temperature / mode / away changes.
26517
27086
  */
26518
- runtimeState: WaterHeaterStatusSchema
27087
+ runtimeState: WaterHeaterStatusSchema,
27088
+ /**
27089
+ * Runtime-state durability: **session** — as `climate-control`.
27090
+ *
27091
+ * See `RuntimeStateDurability`. Enforced by
27092
+ * `scripts/check-runtime-state-durability.ts`.
27093
+ */
27094
+ durability: "session"
26519
27095
  };
26520
27096
  /**
26521
27097
  * Weather provider cap. Models HA `weather.*` entities — a read-only
@@ -26574,7 +27150,14 @@ var weatherCapability = {
26574
27150
  * Runtime-state slice — mirrored by the kernel. The UI reads the
26575
27151
  * current conditions directly from the slice on each weather push.
26576
27152
  */
26577
- runtimeState: WeatherStatusSchema
27153
+ runtimeState: WeatherStatusSchema,
27154
+ /**
27155
+ * Runtime-state durability: **session** — a forecast is stale the moment the hub is down; the provider re-fetches on connect.
27156
+ *
27157
+ * See `RuntimeStateDurability`. Enforced by
27158
+ * `scripts/check-runtime-state-durability.ts`.
27159
+ */
27160
+ durability: "session"
26578
27161
  };
26579
27162
  /**
26580
27163
  * Per-zone occupancy aggregation produced by the analytics frame
@@ -26736,7 +27319,14 @@ var zoneAnalyticsCapability = {
26736
27319
  * automatically; the explicit `getCurrentSnapshot` cap method is
26737
27320
  * still useful for one-off polls without a subscription.
26738
27321
  */
26739
- runtimeState: CameraOccupancySnapshotSchema
27322
+ runtimeState: CameraOccupancySnapshotSchema,
27323
+ /**
27324
+ * Runtime-state durability: **session** — per-frame analytics; with `audio-metrics` it is ~90 % of the offered write rate. Re-derived on the next frame.
27325
+ *
27326
+ * See `RuntimeStateDurability`. Enforced by
27327
+ * `scripts/check-runtime-state-durability.ts`.
27328
+ */
27329
+ durability: "session"
26740
27330
  };
26741
27331
  /**
26742
27332
  * Stages a {@link ZoneRule} can apply to. Discriminator on the rules
@@ -26814,7 +27404,14 @@ var zoneRulesCapability = {
26814
27404
  motion: array(ZoneRuleSchema).readonly(),
26815
27405
  detection: array(ZoneRuleSchema).readonly(),
26816
27406
  package: array(ZoneRuleSchema).readonly()
26817
- })
27407
+ }),
27408
+ /**
27409
+ * Runtime-state durability: **restored** — operator intent, mutation-only, same argument as `zones`.
27410
+ *
27411
+ * See `RuntimeStateDurability`. Enforced by
27412
+ * `scripts/check-runtime-state-durability.ts`.
27413
+ */
27414
+ durability: "restored"
26818
27415
  };
26819
27416
  /**
26820
27417
  * Accessory device helpers — shared across drivers.
@@ -33501,6 +34098,7 @@ Object.freeze({
33501
34098
  "network-access": "ingress",
33502
34099
  "smtp-provider": "email"
33503
34100
  });
34101
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
33504
34102
  new Set(["devices", "classes"]);
33505
34103
  /**
33506
34104
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
@@ -33778,25 +34376,32 @@ object({
33778
34376
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
33779
34377
  object({
33780
34378
  /**
33781
- * How long a retained native frame is served before it counts as a miss.
34379
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
34380
+ * detection result.
33782
34381
  *
33783
- * Must cover the FULL late-crop horizon: detection inference + the
33784
- * cross-process inference-result hop to hub post-analysis + tracking + the
33785
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
33786
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
33787
- * RAM per busy camera grows linearly with no measured hit-rate gain.
34382
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
34383
+ * a time window was never related to the event the pixels were waiting for.
34384
+ * A held frame now lives from delivery until the runner has its `FrameResult`
34385
+ * at which moment the runner cuts the subject tiles it actually wanted and
34386
+ * releases the frame. The bound exists only so a runner that stops answering
34387
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
34388
+ *
34389
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
34390
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
34391
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
34392
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
34393
+ * `holdOverflow` on the metrics line is what says you need it.
33788
34394
  */
33789
- ttlMs: number().int().min(250).max(1e4),
34395
+ holdFrames: number().int().min(1).max(64),
33790
34396
  /**
33791
34397
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
33792
34398
  *
33793
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
33794
- * which one is actually binding before reasoning from that. At the shipped
33795
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
33796
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
33797
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
33798
- * change that admits fewer frames buys retention WINDOW at constant RAM
33799
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
34399
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
34400
+ * is what decides how much is held, and the ceiling is the number above which
34401
+ * something is wrong. Before that it was the effective cap at 1024 MB with
34402
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
34403
+ * with the TTL expiring nothing, which is exactly the confusion the hold
34404
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
33800
34405
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
33801
34406
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
33802
34407
  * to replace).
@@ -33822,22 +34427,45 @@ object({
33822
34427
  * there is the signal that some caller names frames outside the inference set
33823
34428
  * and that this must go back to `all`.
33824
34429
  */
33825
- admission: NativeLeaseAdmissionSchema
34430
+ admission: NativeLeaseAdmissionSchema,
34431
+ /**
34432
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
34433
+ * compressed native crops the worker cuts at the moment a frame's detection
34434
+ * result arrives, and keeps long after the frame itself is freed.
34435
+ *
34436
+ * This is the knob that replaced the old retention window, and it buys about
34437
+ * three orders of magnitude more of it: a tile is one subject at native
34438
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
34439
+ * the frame it was cut from. A frame on which nothing was detected costs
34440
+ * nothing at all, which is the real change — the old lease paid per FRAME and
34441
+ * was interrogated per SUBJECT.
34442
+ *
34443
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
34444
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34445
+ * reproduce that.
34446
+ */
34447
+ tileBudgetMb: number().int().min(0).max(1024)
33826
34448
  });
33827
34449
  /**
33828
- * The values in force when the operator has set nothing — byte-for-byte the
33829
- * constants the decode worker shipped with as env-var defaults, so making these
33830
- * settings changed no behaviour on the day it landed.
34450
+ * The values in force when the operator has set nothing.
34451
+ *
34452
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
34453
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
34454
+ * in the same change that redefines it would make a regression and a retune
34455
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
34456
+ * live traffic.
33831
34457
  */
33832
34458
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
33833
- ttlMs: 1200,
34459
+ holdFrames: 8,
33834
34460
  budgetMb: 1024,
33835
34461
  activityMs: 15e3,
34462
+ tileBudgetMb: 64,
33836
34463
  admission: "inferred"
33837
34464
  };
33838
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
34465
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
33839
34466
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
33840
34467
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34468
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
33841
34469
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
33842
34470
  //#endregion
33843
34471
  //#region src/config.ts