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