@camstack/addon-provider-petkit 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
@@ -11872,7 +11872,14 @@ var cameraStreamsCapability = {
11872
11872
  low: string().optional()
11873
11873
  }),
11874
11874
  lastChangedAt: number()
11875
- })
11875
+ }),
11876
+ /**
11877
+ * 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.
11878
+ *
11879
+ * See `RuntimeStateDurability`. Enforced by
11880
+ * `scripts/check-runtime-state-durability.ts`.
11881
+ */
11882
+ durability: "session"
11876
11883
  };
11877
11884
  /** Where a block runs. The operator chooses — a block driving a device on an
11878
11885
  * agent is the reason placement is not fixed to the hub. */
@@ -12433,6 +12440,13 @@ var deviceDiscoveryCapability = {
12433
12440
  kind: "poll"
12434
12441
  },
12435
12442
  runtimeState: DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: number().int().nonnegative() }),
12443
+ /**
12444
+ * Runtime-state durability: **session** — 5.7 KB of scan output on the largest device, fully re-derivable by re-scanning.
12445
+ *
12446
+ * See `RuntimeStateDurability`. Enforced by
12447
+ * `scripts/check-runtime-state-durability.ts`.
12448
+ */
12449
+ durability: "session",
12436
12450
  methods: {
12437
12451
  /**
12438
12452
  * Snapshot of the current `discovered` list. Returns the
@@ -14349,7 +14363,23 @@ var NotificationActionSchema = object({
14349
14363
  * else — see `notification-center/action-token.ts` for what that does and
14350
14364
  * does not buy.
14351
14365
  */
14352
- destructive: boolean().optional()
14366
+ destructive: boolean().optional(),
14367
+ /**
14368
+ * How the tap should REACH the url.
14369
+ *
14370
+ * `navigate` (absent, and every button authored before this field) opens it:
14371
+ * the phone leaves the notification and shows whatever the callback returns.
14372
+ * That is right for a button whose answer the operator wants to read.
14373
+ *
14374
+ * `background` fires it as a POST and stays put. It exists for the buttons
14375
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
14376
+ * an answer to the notification, and being thrown into a browser tab to
14377
+ * confirm it costs more attention than the notification did. A backend that
14378
+ * cannot do a background call renders it as an ordinary link (the adapters
14379
+ * fall back rather than dropping the button), so this is a preference, never
14380
+ * a requirement.
14381
+ */
14382
+ mode: _enum(["navigate", "background"]).optional()
14353
14383
  });
14354
14384
  /**
14355
14385
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -15201,7 +15231,17 @@ var alarmPanelCapability = {
15201
15231
  * full slice; renders an arm button per `availableModes` entry and
15202
15232
  * a PIN field iff `requiresCode === true`.
15203
15233
  */
15204
- runtimeState: AlarmPanelStatusSchema
15234
+ runtimeState: AlarmPanelStatusSchema,
15235
+ /**
15236
+ * Runtime-state durability: **restored** — armed state is the one thing a panel must not lose across a restart.
15237
+ *
15238
+ * See `RuntimeStateDurability`. Enforced by
15239
+ * `scripts/check-runtime-state-durability.ts`.
15240
+ */
15241
+ durability: "restored",
15242
+ /** Clock fields: written, but excluded from the compare that decides
15243
+ * whether persisting is worth a SQLite commit. */
15244
+ volatileStateFields: ["lastChangedAt"]
15205
15245
  };
15206
15246
  /**
15207
15247
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
@@ -15378,6 +15418,9 @@ var NcSystemEventConditionSchema = object({
15378
15418
  nodeIds: array(string().min(1)).min(1).optional(),
15379
15419
  packageNames: array(string().min(1)).min(1).optional()
15380
15420
  });
15421
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
15422
+ * outage the operator asked for once and forgot. */
15423
+ var NC_SNOOZE_MAX_MINUTES = 1440;
15381
15424
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
15382
15425
  var NcScheduleSchema = object({
15383
15426
  windows: array(object({
@@ -15754,15 +15797,15 @@ var NcConditionsSchema = object({
15754
15797
  * (an `immediate` rule naming an `audio-*` class, one notification per
15755
15798
  * classified sample) stays exactly as it was for rules that already use it.
15756
15799
  *
15757
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
15758
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
15759
- * (`camstack/src/data/notification-center.ts`, guarded by
15760
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
15800
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
15801
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
15802
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
15803
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
15761
15804
  * condition fields it does not know when a rule is saved from the phone.
15762
15805
  * Publishing an editor for a condition the app cannot round-trip is how an
15763
- * operator loses a rule's conditions by opening it — so the descriptor, the
15764
- * admin widget and the viewer mirror land together (P2 + P3), and only then
15765
- * does an audio rule become authorable.
15806
+ * operator loses a rule's conditions by opening it — so the viewer mirror
15807
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
15808
+ * follows here.
15766
15809
  */
15767
15810
  audio: NcAudioConditionSchema.optional()
15768
15811
  });
@@ -15998,6 +16041,30 @@ var NcRuleInputSchema = object({
15998
16041
  */
15999
16042
  snoozeAllowGlobal: boolean().optional(),
16000
16043
  /**
16044
+ * The snooze durations THIS rule's notification offers as buttons, in
16045
+ * minutes.
16046
+ *
16047
+ * Three states, and all three are distinct — which is exactly why this is
16048
+ * `.optional()` and never `.default()`. A Zod default does not run on the
16049
+ * addon cap path (three production failures in one day), so a schema default
16050
+ * would collapse the first two:
16051
+ *
16052
+ * | value | meaning |
16053
+ * | --- | --- |
16054
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
16055
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
16056
+ * | a list | these choices, de-duplicated and sorted, at most four |
16057
+ *
16058
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
16059
+ * three buttons in total) and a rule that spent it all on snooze choices
16060
+ * would push its own tap-through actions off the notification.
16061
+ *
16062
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
16063
+ * that arms the panel, is exempt automatically and cannot be silenced by a
16064
+ * window from anywhere (D133).
16065
+ */
16066
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
16067
+ /**
16001
16068
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
16002
16069
  *
16003
16070
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -16097,6 +16164,7 @@ var NcConditionDescriptorSchema = object({
16097
16164
  "device",
16098
16165
  "package",
16099
16166
  "occupancy",
16167
+ "audio",
16100
16168
  "system"
16101
16169
  ]),
16102
16170
  label: string(),
@@ -16115,6 +16183,7 @@ var NcConditionDescriptorSchema = object({
16115
16183
  "crossingSelect",
16116
16184
  "polygonDraw",
16117
16185
  "occupancy",
16186
+ "audio",
16118
16187
  "deviceState",
16119
16188
  "systemEvent"
16120
16189
  ]),
@@ -16266,7 +16335,20 @@ var NcSnoozeInputSchema = object({
16266
16335
  ruleId: string().optional(),
16267
16336
  /** Required when `scope: 'device'`. */
16268
16337
  deviceId: number().int().optional(),
16269
- durationMinutes: number().int().min(1).max(1440),
16338
+ /**
16339
+ * Narrow the window to these subject classes — "the cat, not the person".
16340
+ *
16341
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
16342
+ * what every window authored before this field meant, so no persisted row
16343
+ * changes meaning and no client has to learn anything to keep working.
16344
+ *
16345
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
16346
+ * cross rules (D133): the operator points at a camera and a kind of thing,
16347
+ * not at whichever of their four rules happened to produce the notification
16348
+ * they are dismissing.
16349
+ */
16350
+ classes: array(string().min(1)).min(1).optional(),
16351
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
16270
16352
  /**
16271
16353
  * Silence this for EVERY recipient, not just the caller. Permission is
16272
16354
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -16291,6 +16373,10 @@ var NcSnoozeSchema = object({
16291
16373
  scope: NcSnoozeScopeSchema,
16292
16374
  ruleId: string().optional(),
16293
16375
  deviceId: number().int().optional(),
16376
+ /** Subject classes this window covers. ABSENT = every class — see
16377
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
16378
+ * no SQLite column: nothing queries a window by class. */
16379
+ classes: array(string().min(1)).min(1).optional(),
16294
16380
  startedAt: number(),
16295
16381
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
16296
16382
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -18391,7 +18477,14 @@ var zonesCapability = {
18391
18477
  * handle. Slice shape is `{ zones: Zone[] }` so future extensions
18392
18478
  * (e.g. zone groupings) can sit alongside the polygon list.
18393
18479
  */
18394
- runtimeState: object({ zones: array(ZoneSchema).readonly() })
18480
+ runtimeState: object({ zones: array(ZoneSchema).readonly() }),
18481
+ /**
18482
+ * 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.
18483
+ *
18484
+ * See `RuntimeStateDurability`. Enforced by
18485
+ * `scripts/check-runtime-state-durability.ts`.
18486
+ */
18487
+ durability: "restored"
18395
18488
  };
18396
18489
  /**
18397
18490
  * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
@@ -21190,7 +21283,17 @@ var airQualitySensorCapability = {
21190
21283
  schema: AirQualitySensorStatusSchema,
21191
21284
  kind: "push"
21192
21285
  },
21193
- runtimeState: AirQualitySensorStatusSchema
21286
+ runtimeState: AirQualitySensorStatusSchema,
21287
+ /**
21288
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
21289
+ *
21290
+ * See `RuntimeStateDurability`. Enforced by
21291
+ * `scripts/check-runtime-state-durability.ts`.
21292
+ */
21293
+ durability: "restored",
21294
+ /** Clock fields: written, but excluded from the compare that decides
21295
+ * whether persisting is worth a SQLite commit. */
21296
+ volatileStateFields: ["lastFetchedAt"]
21194
21297
  };
21195
21298
  /**
21196
21299
  * Ambient illuminance reading in lux. Drives Home Assistant `sensor`
@@ -21222,7 +21325,17 @@ var ambientLightSensorCapability = {
21222
21325
  schema: AmbientLightSensorStatusSchema,
21223
21326
  kind: "push"
21224
21327
  },
21225
- runtimeState: AmbientLightSensorStatusSchema
21328
+ runtimeState: AmbientLightSensorStatusSchema,
21329
+ /**
21330
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
21331
+ *
21332
+ * See `RuntimeStateDurability`. Enforced by
21333
+ * `scripts/check-runtime-state-durability.ts`.
21334
+ */
21335
+ durability: "restored",
21336
+ /** Clock fields: written, but excluded from the compare that decides
21337
+ * whether persisting is worth a SQLite commit. */
21338
+ volatileStateFields: ["lastFetchedAt"]
21226
21339
  };
21227
21340
  /**
21228
21341
  * Per-class audio metrics aggregated over a sliding window.
@@ -21340,7 +21453,14 @@ var audioMetricsCapability = {
21340
21453
  }), AudioMetricsHistorySchema)
21341
21454
  },
21342
21455
  /** Reactive runtime-state mirror — live `device.state.audioMetrics.value`. */
21343
- runtimeState: AudioMetricsSnapshotSchema
21456
+ runtimeState: AudioMetricsSnapshotSchema,
21457
+ /**
21458
+ * 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.
21459
+ *
21460
+ * See `RuntimeStateDurability`. Enforced by
21461
+ * `scripts/check-runtime-state-durability.ts`.
21462
+ */
21463
+ durability: "session"
21344
21464
  };
21345
21465
  /**
21346
21466
  * Automation-control cap. Models HA `automation.*` entities on
@@ -21402,7 +21522,14 @@ var automationControlCapability = {
21402
21522
  * reads `enabled` (toggle) + `isRunning` (spinner) + `lastError`
21403
21523
  * (badge) directly.
21404
21524
  */
21405
- runtimeState: AutomationControlStatusSchema
21525
+ runtimeState: AutomationControlStatusSchema,
21526
+ /**
21527
+ * 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.
21528
+ *
21529
+ * See `RuntimeStateDurability`. Enforced by
21530
+ * `scripts/check-runtime-state-durability.ts`.
21531
+ */
21532
+ durability: "session"
21406
21533
  };
21407
21534
  /**
21408
21535
  * Battery status snapshot. Emitted by providers whose device is
@@ -21508,7 +21635,17 @@ onStatusChanged: { data: object({
21508
21635
  * via `device.runtimeState.getCapState('battery')` regardless of
21509
21636
  * the underlying driver.
21510
21637
  */
21511
- runtimeState: BatteryStatusSchema
21638
+ runtimeState: BatteryStatusSchema,
21639
+ /**
21640
+ * 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.
21641
+ *
21642
+ * See `RuntimeStateDurability`. Enforced by
21643
+ * `scripts/check-runtime-state-durability.ts`.
21644
+ */
21645
+ durability: "restored",
21646
+ /** Clock fields: written, but excluded from the compare that decides
21647
+ * whether persisting is worth a SQLite commit. */
21648
+ volatileStateFields: ["lastUpdated"]
21512
21649
  };
21513
21650
  /**
21514
21651
  * Generic boolean sensor — last-resort fallback when no domain-
@@ -21537,7 +21674,17 @@ var binaryCapability = {
21537
21674
  schema: BinaryStatusSchema,
21538
21675
  kind: "push"
21539
21676
  },
21540
- runtimeState: BinaryStatusSchema
21677
+ runtimeState: BinaryStatusSchema,
21678
+ /**
21679
+ * Runtime-state durability: **restored** — transition-driven sensor state; the restored value gives the boot comparison.
21680
+ *
21681
+ * See `RuntimeStateDurability`. Enforced by
21682
+ * `scripts/check-runtime-state-durability.ts`.
21683
+ */
21684
+ durability: "restored",
21685
+ /** Clock fields: written, but excluded from the compare that decides
21686
+ * whether persisting is worth a SQLite commit. */
21687
+ volatileStateFields: ["lastChangedAt"]
21541
21688
  };
21542
21689
  /**
21543
21690
  * Dimmable-light brightness control. Co-exists with `switch` on the
@@ -21590,7 +21737,14 @@ onBrightnessChanged: { data: object({
21590
21737
  * by the kernel. Read via `device.state.brightness.value` so UI
21591
21738
  * sliders surface the current level without polling the provider.
21592
21739
  */
21593
- runtimeState: BrightnessStatusSchema
21740
+ runtimeState: BrightnessStatusSchema,
21741
+ /**
21742
+ * Runtime-state durability: **session** — live lamp state, re-published by the provider on connect.
21743
+ *
21744
+ * See `RuntimeStateDurability`. Enforced by
21745
+ * `scripts/check-runtime-state-durability.ts`.
21746
+ */
21747
+ durability: "session"
21594
21748
  };
21595
21749
  DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
21596
21750
  kind: "mutation",
@@ -21678,7 +21832,17 @@ var carbonMonoxideCapability = {
21678
21832
  schema: CarbonMonoxideStatusSchema,
21679
21833
  kind: "push"
21680
21834
  },
21681
- runtimeState: CarbonMonoxideStatusSchema
21835
+ runtimeState: CarbonMonoxideStatusSchema,
21836
+ /**
21837
+ * Runtime-state durability: **restored** — as `smoke`.
21838
+ *
21839
+ * See `RuntimeStateDurability`. Enforced by
21840
+ * `scripts/check-runtime-state-durability.ts`.
21841
+ */
21842
+ durability: "restored",
21843
+ /** Clock fields: written, but excluded from the compare that decides
21844
+ * whether persisting is worth a SQLite commit. */
21845
+ volatileStateFields: ["lastChangedAt"]
21682
21846
  };
21683
21847
  /**
21684
21848
  * HVAC / climate control cap. Models the full surface of a HA
@@ -21838,7 +22002,14 @@ var climateControlCapability = {
21838
22002
  * the full slice via `device.state.climate-control.value` and refresh
21839
22003
  * on every push without re-querying the provider.
21840
22004
  */
21841
- runtimeState: ClimateControlStatusSchema
22005
+ runtimeState: ClimateControlStatusSchema,
22006
+ /**
22007
+ * Runtime-state durability: **session** — as `brightness`; `currentTemp` moves continuously and is re-published on connect.
22008
+ *
22009
+ * See `RuntimeStateDurability`. Enforced by
22010
+ * `scripts/check-runtime-state-durability.ts`.
22011
+ */
22012
+ durability: "session"
21842
22013
  };
21843
22014
  /**
21844
22015
  * Color-light cap. Coexists with `switch` (on/off) and `brightness`
@@ -21948,7 +22119,14 @@ onColorChanged: { data: object({
21948
22119
  * kernel. Read via `device.state.color.value` so UI pickers surface
21949
22120
  * the current chromaticity without polling the provider.
21950
22121
  */
21951
- runtimeState: ColorStatusSchema
22122
+ runtimeState: ColorStatusSchema,
22123
+ /**
22124
+ * Runtime-state durability: **session** — as `brightness`.
22125
+ *
22126
+ * See `RuntimeStateDurability`. Enforced by
22127
+ * `scripts/check-runtime-state-durability.ts`.
22128
+ */
22129
+ durability: "session"
21952
22130
  };
21953
22131
  var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
21954
22132
  object({
@@ -22014,7 +22192,17 @@ var connectivityCapability = {
22014
22192
  schema: ConnectivityStatusSchema,
22015
22193
  kind: "push"
22016
22194
  },
22017
- runtimeState: ConnectivityStatusSchema
22195
+ runtimeState: ConnectivityStatusSchema,
22196
+ /**
22197
+ * Runtime-state durability: **restored** — same shape and same argument as `device-status`, for links rather than devices.
22198
+ *
22199
+ * See `RuntimeStateDurability`. Enforced by
22200
+ * `scripts/check-runtime-state-durability.ts`.
22201
+ */
22202
+ durability: "restored",
22203
+ /** Clock fields: written, but excluded from the compare that decides
22204
+ * whether persisting is worth a SQLite commit. */
22205
+ volatileStateFields: ["lastChangedAt"]
22018
22206
  };
22019
22207
  /**
22020
22208
  * Generic device-consumables capability — surfaces a device's
@@ -22096,7 +22284,14 @@ reset: method(object({
22096
22284
  }
22097
22285
  }
22098
22286
  },
22099
- runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() })
22287
+ runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() }),
22288
+ /**
22289
+ * Runtime-state durability: **session** — the authority is the appliance; the provider re-reads the whole item array on connect.
22290
+ *
22291
+ * See `RuntimeStateDurability`. Enforced by
22292
+ * `scripts/check-runtime-state-durability.ts`.
22293
+ */
22294
+ durability: "session"
22100
22295
  };
22101
22296
  /**
22102
22297
  * Door / window / opening / garage / valve contact sensor. Boolean
@@ -22127,7 +22322,17 @@ var contactCapability = {
22127
22322
  schema: ContactStatusSchema,
22128
22323
  kind: "push"
22129
22324
  },
22130
- runtimeState: ContactStatusSchema
22325
+ runtimeState: ContactStatusSchema,
22326
+ /**
22327
+ * Runtime-state durability: **restored** — a door left open across a restart must still read open.
22328
+ *
22329
+ * See `RuntimeStateDurability`. Enforced by
22330
+ * `scripts/check-runtime-state-durability.ts`.
22331
+ */
22332
+ durability: "restored",
22333
+ /** Clock fields: written, but excluded from the compare that decides
22334
+ * whether persisting is worth a SQLite commit. */
22335
+ volatileStateFields: ["lastChangedAt"]
22131
22336
  };
22132
22337
  /**
22133
22338
  * Status slice — flat object (the framework's `runtimeState` contract
@@ -22233,7 +22438,14 @@ var controlCapability = {
22233
22438
  * dropdown / text field / date picker) read the slice's discriminant
22234
22439
  * and value directly without polling the provider.
22235
22440
  */
22236
- runtimeState: ControlStatusSchema
22441
+ runtimeState: ControlStatusSchema,
22442
+ /**
22443
+ * Runtime-state durability: **session** — a generic control mirrors an external entity that re-publishes on connect; the options array is re-derived with it.
22444
+ *
22445
+ * See `RuntimeStateDurability`. Enforced by
22446
+ * `scripts/check-runtime-state-durability.ts`.
22447
+ */
22448
+ durability: "session"
22237
22449
  };
22238
22450
  var CoverStatusSchema = object({
22239
22451
  /** Lifecycle state of the cover. */
@@ -22294,7 +22506,17 @@ var coverCapability = {
22294
22506
  * Runtime-state slice — mirrored by the kernel. UI controls watch
22295
22507
  * the slice for live position changes during a move.
22296
22508
  */
22297
- runtimeState: CoverStatusSchema
22509
+ runtimeState: CoverStatusSchema,
22510
+ /**
22511
+ * Runtime-state durability: **restored** — position survives a restart on the device; the mirror should agree at boot rather than read blank.
22512
+ *
22513
+ * See `RuntimeStateDurability`. Enforced by
22514
+ * `scripts/check-runtime-state-durability.ts`.
22515
+ */
22516
+ durability: "restored",
22517
+ /** Clock fields: written, but excluded from the compare that decides
22518
+ * whether persisting is worth a SQLite commit. */
22519
+ volatileStateFields: ["lastChangedAt"]
22298
22520
  };
22299
22521
  /**
22300
22522
  * Vendor-neutral day/night (IR-cut) control — the per-camera config cap
@@ -22388,7 +22610,17 @@ var dayNightCapability = {
22388
22610
  schema: DayNightStatusSchema,
22389
22611
  kind: "poll"
22390
22612
  },
22391
- runtimeState: DayNightStatusSchema
22613
+ runtimeState: DayNightStatusSchema,
22614
+ /**
22615
+ * Runtime-state durability: **restored** — operator-set IR-cut behaviour; mutation-driven.
22616
+ *
22617
+ * See `RuntimeStateDurability`. Enforced by
22618
+ * `scripts/check-runtime-state-durability.ts`.
22619
+ */
22620
+ durability: "restored",
22621
+ /** Clock fields: written, but excluded from the compare that decides
22622
+ * whether persisting is worth a SQLite commit. */
22623
+ volatileStateFields: ["lastFetchedAt"]
22392
22624
  };
22393
22625
  /**
22394
22626
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
@@ -22435,7 +22667,17 @@ onStatusChanged: { data: object({
22435
22667
  schema: DeviceStatusSchema,
22436
22668
  kind: "push"
22437
22669
  },
22438
- runtimeState: DeviceStatusSchema
22670
+ runtimeState: DeviceStatusSchema,
22671
+ /**
22672
+ * 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.
22673
+ *
22674
+ * See `RuntimeStateDurability`. Enforced by
22675
+ * `scripts/check-runtime-state-durability.ts`.
22676
+ */
22677
+ durability: "restored",
22678
+ /** Clock fields: written, but excluded from the compare that decides
22679
+ * whether persisting is worth a SQLite commit. */
22680
+ volatileStateFields: ["lastChangedAt"]
22439
22681
  };
22440
22682
  /**
22441
22683
  * Doorbell button cap. Two kinds of providers coexist behind this cap
@@ -22497,7 +22739,14 @@ onPressed: { data: DoorbellPressEventSchema } },
22497
22739
  * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
22498
22740
  * without subscribing.
22499
22741
  */
22500
- runtimeState: DoorbellStatusSchema
22742
+ runtimeState: DoorbellStatusSchema,
22743
+ /**
22744
+ * 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.
22745
+ *
22746
+ * See `RuntimeStateDurability`. Enforced by
22747
+ * `scripts/check-runtime-state-durability.ts`.
22748
+ */
22749
+ durability: "restored"
22501
22750
  };
22502
22751
  /**
22503
22752
  * Enum-state sensor — a string value picked from a finite option set.
@@ -22537,7 +22786,17 @@ var enumSensorCapability = {
22537
22786
  schema: EnumSensorStatusSchema,
22538
22787
  kind: "push"
22539
22788
  },
22540
- runtimeState: EnumSensorStatusSchema
22789
+ runtimeState: EnumSensorStatusSchema,
22790
+ /**
22791
+ * Runtime-state durability: **restored** — as `numeric-sensor`; 80 devices.
22792
+ *
22793
+ * See `RuntimeStateDurability`. Enforced by
22794
+ * `scripts/check-runtime-state-durability.ts`.
22795
+ */
22796
+ durability: "restored",
22797
+ /** Clock fields: written, but excluded from the compare that decides
22798
+ * whether persisting is worth a SQLite commit. */
22799
+ volatileStateFields: ["lastFetchedAt"]
22541
22800
  };
22542
22801
  /**
22543
22802
  * Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
@@ -22573,7 +22832,14 @@ var eventEmitterCapability = {
22573
22832
  schema: EventEmitterStatusSchema,
22574
22833
  kind: "push"
22575
22834
  },
22576
- runtimeState: EventEmitterStatusSchema
22835
+ runtimeState: EventEmitterStatusSchema,
22836
+ /**
22837
+ * Runtime-state durability: **session** — `eventCountSinceStart` names its own scope.
22838
+ *
22839
+ * See `RuntimeStateDurability`. Enforced by
22840
+ * `scripts/check-runtime-state-durability.ts`.
22841
+ */
22842
+ durability: "session"
22577
22843
  };
22578
22844
  var EventItemSchema = object({
22579
22845
  id: string(),
@@ -22854,7 +23120,14 @@ var fanControlCapability = {
22854
23120
  * Runtime-state slice — mirrored by the kernel. UI fan speed
22855
23121
  * sliders read `percentage` for live updates.
22856
23122
  */
22857
- runtimeState: FanControlStatusSchema
23123
+ runtimeState: FanControlStatusSchema,
23124
+ /**
23125
+ * Runtime-state durability: **session** — as `brightness`.
23126
+ *
23127
+ * See `RuntimeStateDurability`. Enforced by
23128
+ * `scripts/check-runtime-state-durability.ts`.
23129
+ */
23130
+ durability: "session"
22858
23131
  };
22859
23132
  /**
22860
23133
  * Per-device feature/identity probe slice. Holds the runtime-resolved
@@ -22930,7 +23203,14 @@ onProbeChanged: { data: object({
22930
23203
  schema: FeatureProbeStatusSchema,
22931
23204
  kind: "push"
22932
23205
  },
22933
- runtimeState: FeatureProbeStatusSchema
23206
+ runtimeState: FeatureProbeStatusSchema,
23207
+ /**
23208
+ * 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.
23209
+ *
23210
+ * See `RuntimeStateDurability`. Enforced by
23211
+ * `scripts/check-runtime-state-durability.ts`.
23212
+ */
23213
+ durability: "session"
22934
23214
  };
22935
23215
  /**
22936
23216
  * Water leak / moisture sensor. Boolean "is liquid currently
@@ -22957,7 +23237,17 @@ var floodCapability = {
22957
23237
  schema: FloodStatusSchema,
22958
23238
  kind: "push"
22959
23239
  },
22960
- runtimeState: FloodStatusSchema
23240
+ runtimeState: FloodStatusSchema,
23241
+ /**
23242
+ * Runtime-state durability: **restored** — as `smoke`.
23243
+ *
23244
+ * See `RuntimeStateDurability`. Enforced by
23245
+ * `scripts/check-runtime-state-durability.ts`.
23246
+ */
23247
+ durability: "restored",
23248
+ /** Clock fields: written, but excluded from the compare that decides
23249
+ * whether persisting is worth a SQLite commit. */
23250
+ volatileStateFields: ["lastChangedAt"]
22961
23251
  };
22962
23252
  /**
22963
23253
  * Combustible-gas (LPG / methane / hydrogen) alarm sensor. Drives
@@ -22980,7 +23270,17 @@ var gasCapability = {
22980
23270
  schema: GasStatusSchema,
22981
23271
  kind: "push"
22982
23272
  },
22983
- runtimeState: GasStatusSchema
23273
+ runtimeState: GasStatusSchema,
23274
+ /**
23275
+ * Runtime-state durability: **restored** — as `smoke`.
23276
+ *
23277
+ * See `RuntimeStateDurability`. Enforced by
23278
+ * `scripts/check-runtime-state-durability.ts`.
23279
+ */
23280
+ durability: "restored",
23281
+ /** Clock fields: written, but excluded from the compare that decides
23282
+ * whether persisting is worth a SQLite commit. */
23283
+ volatileStateFields: ["lastChangedAt"]
22984
23284
  };
22985
23285
  /**
22986
23286
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
@@ -23056,7 +23356,14 @@ var humidifierCapability = {
23056
23356
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
23057
23357
  * slice for live humidity / mode changes.
23058
23358
  */
23059
- runtimeState: HumidifierStatusSchema
23359
+ runtimeState: HumidifierStatusSchema,
23360
+ /**
23361
+ * Runtime-state durability: **session** — as `climate-control`.
23362
+ *
23363
+ * See `RuntimeStateDurability`. Enforced by
23364
+ * `scripts/check-runtime-state-durability.ts`.
23365
+ */
23366
+ durability: "session"
23060
23367
  };
23061
23368
  /**
23062
23369
  * Single-metric humidity reading. Drives Home Assistant `sensor`
@@ -23092,7 +23399,17 @@ var humiditySensorCapability = {
23092
23399
  schema: HumiditySensorStatusSchema,
23093
23400
  kind: "push"
23094
23401
  },
23095
- runtimeState: HumiditySensorStatusSchema
23402
+ runtimeState: HumiditySensorStatusSchema,
23403
+ /**
23404
+ * Runtime-state durability: **restored** — as `numeric-sensor` (67 of 75 writes were the clock alone).
23405
+ *
23406
+ * See `RuntimeStateDurability`. Enforced by
23407
+ * `scripts/check-runtime-state-durability.ts`.
23408
+ */
23409
+ durability: "restored",
23410
+ /** Clock fields: written, but excluded from the compare that decides
23411
+ * whether persisting is worth a SQLite commit. */
23412
+ volatileStateFields: ["lastFetchedAt"]
23096
23413
  };
23097
23414
  /**
23098
23415
  * Image display cap. Models a single still image exposed by an integration —
@@ -23130,7 +23447,14 @@ var imageCapability = {
23130
23447
  * Runtime-state slice — mirrored by the kernel. The UI reads `url`
23131
23448
  * directly and renders the still image.
23132
23449
  */
23133
- runtimeState: ImageStatusSchema
23450
+ runtimeState: ImageStatusSchema,
23451
+ /**
23452
+ * Runtime-state durability: **session** — a snapshot URL is a session-scoped handle; a restored one points at nothing.
23453
+ *
23454
+ * See `RuntimeStateDurability`. Enforced by
23455
+ * `scripts/check-runtime-state-durability.ts`.
23456
+ */
23457
+ durability: "session"
23134
23458
  };
23135
23459
  /**
23136
23460
  * Vendor-neutral image / picture-adjustment cap — the per-camera config
@@ -23279,7 +23603,17 @@ var imageSettingsCapability = {
23279
23603
  schema: ImageSettingsStatusSchema,
23280
23604
  kind: "poll"
23281
23605
  },
23282
- runtimeState: ImageSettingsStatusSchema
23606
+ runtimeState: ImageSettingsStatusSchema,
23607
+ /**
23608
+ * Runtime-state durability: **restored** — operator-set camera imaging; mutation-driven.
23609
+ *
23610
+ * See `RuntimeStateDurability`. Enforced by
23611
+ * `scripts/check-runtime-state-durability.ts`.
23612
+ */
23613
+ durability: "restored",
23614
+ /** Clock fields: written, but excluded from the compare that decides
23615
+ * whether persisting is worth a SQLite commit. */
23616
+ volatileStateFields: ["lastFetchedAt"]
23283
23617
  };
23284
23618
  /**
23285
23619
  * integrations — system-scoped singleton capability for integration
@@ -23619,7 +23953,14 @@ var lawnMowerControlCapability = {
23619
23953
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
23620
23954
  * slice for live activity + battery changes.
23621
23955
  */
23622
- runtimeState: LawnMowerControlStatusSchema
23956
+ runtimeState: LawnMowerControlStatusSchema,
23957
+ /**
23958
+ * Runtime-state durability: **session** — as `vacuum-control`.
23959
+ *
23960
+ * See `RuntimeStateDurability`. Enforced by
23961
+ * `scripts/check-runtime-state-durability.ts`.
23962
+ */
23963
+ durability: "session"
23623
23964
  };
23624
23965
  /**
23625
23966
  * local-network — hub-only singleton.
@@ -23825,7 +24166,17 @@ var lockControlCapability = {
23825
24166
  * read `state` and disable themselves during `locking`/`unlocking`
23826
24167
  * transitions.
23827
24168
  */
23828
- runtimeState: LockControlStatusSchema
24169
+ runtimeState: LockControlStatusSchema,
24170
+ /**
24171
+ * Runtime-state durability: **restored** — a lock left locked must still read locked.
24172
+ *
24173
+ * See `RuntimeStateDurability`. Enforced by
24174
+ * `scripts/check-runtime-state-durability.ts`.
24175
+ */
24176
+ durability: "restored",
24177
+ /** Clock fields: written, but excluded from the compare that decides
24178
+ * whether persisting is worth a SQLite commit. */
24179
+ volatileStateFields: ["lastChangedAt"]
23829
24180
  };
23830
24181
  /**
23831
24182
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
@@ -23987,7 +24338,14 @@ var mediaPlayerCapability = {
23987
24338
  * full slice for live now-playing, volume, and progress updates
23988
24339
  * without polling.
23989
24340
  */
23990
- runtimeState: MediaPlayerStatusSchema
24341
+ runtimeState: MediaPlayerStatusSchema,
24342
+ /**
24343
+ * Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
24344
+ *
24345
+ * See `RuntimeStateDurability`. Enforced by
24346
+ * `scripts/check-runtime-state-durability.ts`.
24347
+ */
24348
+ durability: "session"
23991
24349
  };
23992
24350
  /**
23993
24351
  * mesh-network — collection cap for mesh-VPN providers.
@@ -24251,7 +24609,14 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
24251
24609
  * `device.state.motion.value`. Reads never invoke the provider, so
24252
24610
  * UIs and other addons can poll the cached state safely.
24253
24611
  */
24254
- runtimeState: MotionStatusSchema
24612
+ runtimeState: MotionStatusSchema,
24613
+ /**
24614
+ * 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.
24615
+ *
24616
+ * See `RuntimeStateDurability`. Enforced by
24617
+ * `scripts/check-runtime-state-durability.ts`.
24618
+ */
24619
+ durability: "session"
24255
24620
  };
24256
24621
  /**
24257
24622
  * Motion-trigger toggle for accessory devices.
@@ -24316,7 +24681,14 @@ var motionTriggerCapability = {
24316
24681
  schema: MotionTriggerStatusSchema,
24317
24682
  kind: "command-driven"
24318
24683
  },
24319
- runtimeState: MotionTriggerRuntimeStateSchema
24684
+ runtimeState: MotionTriggerRuntimeStateSchema,
24685
+ /**
24686
+ * 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.
24687
+ *
24688
+ * See `RuntimeStateDurability`. Enforced by
24689
+ * `scripts/check-runtime-state-durability.ts`.
24690
+ */
24691
+ durability: "session"
24320
24692
  };
24321
24693
  /**
24322
24694
  * Motion-zones share the same MaskShape vocabulary as privacy-mask — the
@@ -24383,7 +24755,17 @@ var motionZonesCapability = {
24383
24755
  schema: MotionZoneStatusSchema,
24384
24756
  kind: "poll"
24385
24757
  },
24386
- runtimeState: MotionZoneStatusSchema
24758
+ runtimeState: MotionZoneStatusSchema,
24759
+ /**
24760
+ * 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.
24761
+ *
24762
+ * See `RuntimeStateDurability`. Enforced by
24763
+ * `scripts/check-runtime-state-durability.ts`.
24764
+ */
24765
+ durability: "restored",
24766
+ /** Clock fields: written, but excluded from the compare that decides
24767
+ * whether persisting is worth a SQLite commit. */
24768
+ volatileStateFields: ["lastFetchedAt"]
24387
24769
  };
24388
24770
  /**
24389
24771
  * On-camera AI object detection cap. Surfaces per-device the classes
@@ -24457,7 +24839,17 @@ var nativeObjectDetectionCapability = {
24457
24839
  schema: NativeObjectDetectionStatusSchema,
24458
24840
  kind: "push"
24459
24841
  },
24460
- runtimeState: NativeObjectDetectionRuntimeStateSchema
24842
+ runtimeState: NativeObjectDetectionRuntimeStateSchema,
24843
+ /**
24844
+ * 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.
24845
+ *
24846
+ * See `RuntimeStateDurability`. Enforced by
24847
+ * `scripts/check-runtime-state-durability.ts`.
24848
+ */
24849
+ durability: "restored",
24850
+ /** Clock fields: written, but excluded from the compare that decides
24851
+ * whether persisting is worth a SQLite commit. */
24852
+ volatileStateFields: ["lastFetchedAt"]
24461
24853
  };
24462
24854
  /**
24463
24855
  * network-quality — system-scoped singleton capability tracking RTT,
@@ -24791,7 +25183,14 @@ onSent: { data: object({
24791
25183
  * form reads `supports` to gate optional fields; history pane reads
24792
25184
  * `lastSentAt` / `lastError` / `queueDepth`.
24793
25185
  */
24794
- runtimeState: NotifierStatusSchema
25186
+ runtimeState: NotifierStatusSchema,
25187
+ /**
25188
+ * Runtime-state durability: **session** — live queue depth and last-send state; a restored queue depth describes a queue that no longer exists.
25189
+ *
25190
+ * See `RuntimeStateDurability`. Enforced by
25191
+ * `scripts/check-runtime-state-durability.ts`.
25192
+ */
25193
+ durability: "session"
24795
25194
  };
24796
25195
  /**
24797
25196
  * Generic numeric sensor — last-resort fallback when no typed numeric
@@ -24834,7 +25233,17 @@ var numericSensorCapability = {
24834
25233
  schema: NumericSensorStatusSchema,
24835
25234
  kind: "push"
24836
25235
  },
24837
- runtimeState: NumericSensorStatusSchema
25236
+ runtimeState: NumericSensorStatusSchema,
25237
+ /**
25238
+ * 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.
25239
+ *
25240
+ * See `RuntimeStateDurability`. Enforced by
25241
+ * `scripts/check-runtime-state-durability.ts`.
25242
+ */
25243
+ durability: "restored",
25244
+ /** Clock fields: written, but excluded from the compare that decides
25245
+ * whether persisting is worth a SQLite commit. */
25246
+ volatileStateFields: ["lastFetchedAt"]
24838
25247
  };
24839
25248
  /**
24840
25249
  * Generic on-screen-display (video overlay) cap. Each camera exposes
@@ -25219,7 +25628,14 @@ var petFeederCapability = {
25219
25628
  * the full slice via `device.state.petFeeder.value` and refresh on
25220
25629
  * every poll without re-querying the provider.
25221
25630
  */
25222
- runtimeState: PetFeederStatusSchema
25631
+ runtimeState: PetFeederStatusSchema,
25632
+ /**
25633
+ * Runtime-state durability: **session** — live appliance state re-published on connect.
25634
+ *
25635
+ * See `RuntimeStateDurability`. Enforced by
25636
+ * `scripts/check-runtime-state-durability.ts`.
25637
+ */
25638
+ durability: "session"
25223
25639
  };
25224
25640
  var VehicleSchema = object({
25225
25641
  id: string(),
@@ -25531,7 +25947,17 @@ var powerMeterCapability = {
25531
25947
  schema: PowerMeterStatusSchema,
25532
25948
  kind: "push"
25533
25949
  },
25534
- runtimeState: PowerMeterStatusSchema
25950
+ runtimeState: PowerMeterStatusSchema,
25951
+ /**
25952
+ * Runtime-state durability: **restored** — as `numeric-sensor`; `kwhTotal` is an accumulator whose restored value is the baseline.
25953
+ *
25954
+ * See `RuntimeStateDurability`. Enforced by
25955
+ * `scripts/check-runtime-state-durability.ts`.
25956
+ */
25957
+ durability: "restored",
25958
+ /** Clock fields: written, but excluded from the compare that decides
25959
+ * whether persisting is worth a SQLite commit. */
25960
+ volatileStateFields: ["lastFetchedAt"]
25535
25961
  };
25536
25962
  /**
25537
25963
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -25588,7 +26014,17 @@ var presenceCapability = {
25588
26014
  * the map pin is rendered (use `DeviceFeature.PresenceGps` for the
25589
26015
  * pre-fetch fast-path check).
25590
26016
  */
25591
- runtimeState: PresenceStatusSchema
26017
+ runtimeState: PresenceStatusSchema,
26018
+ /**
26019
+ * Runtime-state durability: **restored** — occupancy-relevant: the restored state is what an occupancy rule compares the first post-restart observation against.
26020
+ *
26021
+ * See `RuntimeStateDurability`. Enforced by
26022
+ * `scripts/check-runtime-state-durability.ts`.
26023
+ */
26024
+ durability: "restored",
26025
+ /** Clock fields: written, but excluded from the compare that decides
26026
+ * whether persisting is worth a SQLite commit. */
26027
+ volatileStateFields: ["lastChangedAt"]
25592
26028
  };
25593
26029
  /**
25594
26030
  * Atmospheric pressure reading in hectopascals. Drives Home Assistant
@@ -25624,7 +26060,17 @@ var pressureSensorCapability = {
25624
26060
  schema: PressureSensorStatusSchema,
25625
26061
  kind: "push"
25626
26062
  },
25627
- runtimeState: PressureSensorStatusSchema
26063
+ runtimeState: PressureSensorStatusSchema,
26064
+ /**
26065
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
26066
+ *
26067
+ * See `RuntimeStateDurability`. Enforced by
26068
+ * `scripts/check-runtime-state-durability.ts`.
26069
+ */
26070
+ durability: "restored",
26071
+ /** Clock fields: written, but excluded from the compare that decides
26072
+ * whether persisting is worth a SQLite commit. */
26073
+ volatileStateFields: ["lastFetchedAt"]
25628
26074
  };
25629
26075
  /**
25630
26076
  * PRIVACY — what the camera deliberately does not capture. Two planes:
@@ -25754,7 +26200,17 @@ var privacyMaskCapability = {
25754
26200
  schema: PrivacyMaskStatusSchema,
25755
26201
  kind: "poll"
25756
26202
  },
25757
- runtimeState: PrivacyMaskStatusSchema
26203
+ runtimeState: PrivacyMaskStatusSchema,
26204
+ /**
26205
+ * Runtime-state durability: **restored** — operator-drawn regions, zero real churn — 22 writes in 25 minutes, every one of them the clock.
26206
+ *
26207
+ * See `RuntimeStateDurability`. Enforced by
26208
+ * `scripts/check-runtime-state-durability.ts`.
26209
+ */
26210
+ durability: "restored",
26211
+ /** Clock fields: written, but excluded from the compare that decides
26212
+ * whether persisting is worth a SQLite commit. */
26213
+ volatileStateFields: ["lastFetchedAt"]
25758
26214
  };
25759
26215
  var PtzPresetSchema = object({
25760
26216
  id: string(),
@@ -25920,7 +26376,14 @@ var ptzAutotrackCapability = {
25920
26376
  * fetch / cache / fallback logic out of the four cap methods —
25921
26377
  * they become trampolines over `runtimeState`.
25922
26378
  */
25923
- runtimeState: PtzAutotrackRuntimeStateSchema
26379
+ runtimeState: PtzAutotrackRuntimeStateSchema,
26380
+ /**
26381
+ * Runtime-state durability: **session** — mirrors the camera's own autotrack config, re-read on connect.
26382
+ *
26383
+ * See `RuntimeStateDurability`. Enforced by
26384
+ * `scripts/check-runtime-state-durability.ts`.
26385
+ */
26386
+ durability: "session"
25924
26387
  };
25925
26388
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
25926
26389
  kind: "mutation",
@@ -26267,13 +26730,24 @@ method(object({
26267
26730
  /** Playback-speed multiplier for the render (1 = realtime). */
26268
26731
  var ExportSpeedSchema = number().min(.25).max(32);
26269
26732
  /**
26270
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
26733
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
26734
+ *
26735
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
26736
+ * derives these bounds from things that happened at a TIME (a track's
26737
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
26738
+ * every segment present for the range, with each recording GAP removed. The
26739
+ * two agree only on a window that recorded without one interruption, and only
26740
+ * the render side knows the segments, so the translation lives there
26741
+ * (`export-dense-map.ts`, addon-pipeline).
26742
+ *
26743
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
26744
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
26745
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
26746
+ * the video was a uniform timelapse, and the log line reported the five ranges
26747
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
26271
26748
  *
26272
- * Relative and not absolute epoch on purpose: the renderer's frame-select
26273
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
26274
- * playlist. Handing it absolute epochs would make every call site responsible
26275
- * for the same subtraction, and the one that forgot would emit a filter that
26276
- * selects nothing — silently, as a uniform timelapse.
26749
+ * Relative and not absolute epoch, because an absolute epoch would make every
26750
+ * call site responsible for the same subtraction.
26277
26751
  */
26278
26752
  var ExportDenseRangeSchema = object({
26279
26753
  fromSec: number().nonnegative(),
@@ -26559,7 +27033,14 @@ var sceneMonitorCapability = {
26559
27033
  schema: SceneMonitorStatusSchema,
26560
27034
  kind: "push"
26561
27035
  },
26562
- runtimeState: SceneMonitorStatusSchema
27036
+ runtimeState: SceneMonitorStatusSchema,
27037
+ /**
27038
+ * Runtime-state durability: **session** — re-derived from the current scene on the next evaluation.
27039
+ *
27040
+ * See `RuntimeStateDurability`. Enforced by
27041
+ * `scripts/check-runtime-state-durability.ts`.
27042
+ */
27043
+ durability: "session"
26563
27044
  };
26564
27045
  /**
26565
27046
  * Per-stage gating mode applied to the zones a rule references.
@@ -26703,7 +27184,14 @@ var scriptRunnerCapability = {
26703
27184
  * `isRunning` to render a spinner during execution and surfaces
26704
27185
  * `lastError` / `lastRunSuccess` in the recent-runs panel.
26705
27186
  */
26706
- runtimeState: ScriptRunnerStatusSchema
27187
+ runtimeState: ScriptRunnerStatusSchema,
27188
+ /**
27189
+ * Runtime-state durability: **session** — a restored `isRunning: true` describes a process that died with the previous hub.
27190
+ *
27191
+ * See `RuntimeStateDurability`. Enforced by
27192
+ * `scripts/check-runtime-state-durability.ts`.
27193
+ */
27194
+ durability: "session"
26707
27195
  };
26708
27196
  /**
26709
27197
  * Smoke alarm sensor — boolean "is smoke currently detected" with
@@ -26730,7 +27218,17 @@ var smokeCapability = {
26730
27218
  schema: SmokeStatusSchema,
26731
27219
  kind: "push"
26732
27220
  },
26733
- runtimeState: SmokeStatusSchema
27221
+ runtimeState: SmokeStatusSchema,
27222
+ /**
27223
+ * Runtime-state durability: **restored** — a safety sensor must not read "clear" merely because the hub restarted.
27224
+ *
27225
+ * See `RuntimeStateDurability`. Enforced by
27226
+ * `scripts/check-runtime-state-durability.ts`.
27227
+ */
27228
+ durability: "restored",
27229
+ /** Clock fields: written, but excluded from the compare that decides
27230
+ * whether persisting is worth a SQLite commit. */
27231
+ volatileStateFields: ["lastChangedAt"]
26734
27232
  };
26735
27233
  /**
26736
27234
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -26903,7 +27401,17 @@ var streamParamsCapability = {
26903
27401
  schema: StreamParamsStatusSchema,
26904
27402
  kind: "poll"
26905
27403
  },
26906
- runtimeState: StreamParamsStatusSchema
27404
+ runtimeState: StreamParamsStatusSchema,
27405
+ /**
27406
+ * Runtime-state durability: **restored** — operator-set encoder profile; mutation-driven.
27407
+ *
27408
+ * See `RuntimeStateDurability`. Enforced by
27409
+ * `scripts/check-runtime-state-durability.ts`.
27410
+ */
27411
+ durability: "restored",
27412
+ /** Clock fields: written, but excluded from the compare that decides
27413
+ * whether persisting is worth a SQLite commit. */
27414
+ volatileStateFields: ["lastFetchedAt"]
26907
27415
  };
26908
27416
  /**
26909
27417
  * Generic on/off switch cap for accessory children (siren, floodlight,
@@ -26949,6 +27457,16 @@ var switchCapability = {
26949
27457
  * not need to re-query the provider after a setState mutation.
26950
27458
  */
26951
27459
  runtimeState: SwitchStatusSchema,
27460
+ /**
27461
+ * Runtime-state durability: **restored** — device state an operator reads as authoritative; 55 devices, transition-driven.
27462
+ *
27463
+ * See `RuntimeStateDurability`. Enforced by
27464
+ * `scripts/check-runtime-state-durability.ts`.
27465
+ */
27466
+ durability: "restored",
27467
+ /** Clock fields: written, but excluded from the compare that decides
27468
+ * whether persisting is worth a SQLite commit. */
27469
+ volatileStateFields: ["lastChangedAt"],
26952
27470
  settings: { bindings: [{
26953
27471
  kind: "scalar",
26954
27472
  statusPath: "on",
@@ -27028,7 +27546,17 @@ var tamperCapability = {
27028
27546
  schema: TamperStatusSchema,
27029
27547
  kind: "push"
27030
27548
  },
27031
- runtimeState: TamperStatusSchema
27549
+ runtimeState: TamperStatusSchema,
27550
+ /**
27551
+ * Runtime-state durability: **restored** — as `smoke`.
27552
+ *
27553
+ * See `RuntimeStateDurability`. Enforced by
27554
+ * `scripts/check-runtime-state-durability.ts`.
27555
+ */
27556
+ durability: "restored",
27557
+ /** Clock fields: written, but excluded from the compare that decides
27558
+ * whether persisting is worth a SQLite commit. */
27559
+ volatileStateFields: ["lastChangedAt"]
27032
27560
  };
27033
27561
  /**
27034
27562
  * Single-metric temperature reading. Drives Home Assistant `sensor`
@@ -27073,7 +27601,17 @@ var temperatureSensorCapability = {
27073
27601
  schema: TemperatureSensorStatusSchema,
27074
27602
  kind: "push"
27075
27603
  },
27076
- runtimeState: TemperatureSensorStatusSchema
27604
+ runtimeState: TemperatureSensorStatusSchema,
27605
+ /**
27606
+ * Runtime-state durability: **restored** — as `numeric-sensor` (69 of 125 writes were the clock alone).
27607
+ *
27608
+ * See `RuntimeStateDurability`. Enforced by
27609
+ * `scripts/check-runtime-state-durability.ts`.
27610
+ */
27611
+ durability: "restored",
27612
+ /** Clock fields: written, but excluded from the compare that decides
27613
+ * whether persisting is worth a SQLite commit. */
27614
+ volatileStateFields: ["lastFetchedAt"]
27077
27615
  };
27078
27616
  /**
27079
27617
  * toast — system-scoped singleton capability that streams toast
@@ -27142,7 +27680,14 @@ var updateCapability = {
27142
27680
  schema: UpdateStatusSchema,
27143
27681
  kind: "poll"
27144
27682
  },
27145
- runtimeState: UpdateStatusSchema
27683
+ runtimeState: UpdateStatusSchema,
27684
+ /**
27685
+ * Runtime-state durability: **session** — a restored `inProgress: true` describes an update that is no longer running; versions are re-probed at boot.
27686
+ *
27687
+ * See `RuntimeStateDurability`. Enforced by
27688
+ * `scripts/check-runtime-state-durability.ts`.
27689
+ */
27690
+ durability: "session"
27146
27691
  };
27147
27692
  var UserSummarySchema = object({
27148
27693
  id: string(),
@@ -27476,7 +28021,14 @@ var vacuumControlCapability = {
27476
28021
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
27477
28022
  * slice for live state + battery + fan-speed changes.
27478
28023
  */
27479
- runtimeState: VacuumControlStatusSchema
28024
+ runtimeState: VacuumControlStatusSchema,
28025
+ /**
28026
+ * Runtime-state durability: **session** — as `media-player` — a restored `state: cleaning` is a robot that is not cleaning.
28027
+ *
28028
+ * See `RuntimeStateDurability`. Enforced by
28029
+ * `scripts/check-runtime-state-durability.ts`.
28030
+ */
28031
+ durability: "session"
27480
28032
  };
27481
28033
  var ValveStatusSchema = object({
27482
28034
  /** Lifecycle state of the valve. */
@@ -27528,7 +28080,14 @@ var valveCapability = {
27528
28080
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
27529
28081
  * slice for live position changes during a move.
27530
28082
  */
27531
- runtimeState: ValveStatusSchema
28083
+ runtimeState: ValveStatusSchema,
28084
+ /**
28085
+ * Runtime-state durability: **session** — as `brightness`.
28086
+ *
28087
+ * See `RuntimeStateDurability`. Enforced by
28088
+ * `scripts/check-runtime-state-durability.ts`.
28089
+ */
28090
+ durability: "session"
27532
28091
  };
27533
28092
  /**
27534
28093
  * Vibration / shake / impact sensor. Drives Home Assistant
@@ -27550,7 +28109,17 @@ var vibrationCapability = {
27550
28109
  schema: VibrationStatusSchema,
27551
28110
  kind: "push"
27552
28111
  },
27553
- runtimeState: VibrationStatusSchema
28112
+ runtimeState: VibrationStatusSchema,
28113
+ /**
28114
+ * Runtime-state durability: **restored** — as `smoke`.
28115
+ *
28116
+ * See `RuntimeStateDurability`. Enforced by
28117
+ * `scripts/check-runtime-state-durability.ts`.
28118
+ */
28119
+ durability: "restored",
28120
+ /** Clock fields: written, but excluded from the compare that decides
28121
+ * whether persisting is worth a SQLite commit. */
28122
+ volatileStateFields: ["lastChangedAt"]
27554
28123
  };
27555
28124
  /**
27556
28125
  * Water heater / boiler cap. Models HA `water_heater.*` entities — a
@@ -27624,7 +28193,14 @@ var waterHeaterCapability = {
27624
28193
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
27625
28194
  * slice for live temperature / mode / away changes.
27626
28195
  */
27627
- runtimeState: WaterHeaterStatusSchema
28196
+ runtimeState: WaterHeaterStatusSchema,
28197
+ /**
28198
+ * Runtime-state durability: **session** — as `climate-control`.
28199
+ *
28200
+ * See `RuntimeStateDurability`. Enforced by
28201
+ * `scripts/check-runtime-state-durability.ts`.
28202
+ */
28203
+ durability: "session"
27628
28204
  };
27629
28205
  /**
27630
28206
  * Weather provider cap. Models HA `weather.*` entities — a read-only
@@ -27683,7 +28259,14 @@ var weatherCapability = {
27683
28259
  * Runtime-state slice — mirrored by the kernel. The UI reads the
27684
28260
  * current conditions directly from the slice on each weather push.
27685
28261
  */
27686
- runtimeState: WeatherStatusSchema
28262
+ runtimeState: WeatherStatusSchema,
28263
+ /**
28264
+ * Runtime-state durability: **session** — a forecast is stale the moment the hub is down; the provider re-fetches on connect.
28265
+ *
28266
+ * See `RuntimeStateDurability`. Enforced by
28267
+ * `scripts/check-runtime-state-durability.ts`.
28268
+ */
28269
+ durability: "session"
27687
28270
  };
27688
28271
  /**
27689
28272
  * Per-zone occupancy aggregation produced by the analytics frame
@@ -27845,7 +28428,14 @@ var zoneAnalyticsCapability = {
27845
28428
  * automatically; the explicit `getCurrentSnapshot` cap method is
27846
28429
  * still useful for one-off polls without a subscription.
27847
28430
  */
27848
- runtimeState: CameraOccupancySnapshotSchema
28431
+ runtimeState: CameraOccupancySnapshotSchema,
28432
+ /**
28433
+ * Runtime-state durability: **session** — per-frame analytics; with `audio-metrics` it is ~90 % of the offered write rate. Re-derived on the next frame.
28434
+ *
28435
+ * See `RuntimeStateDurability`. Enforced by
28436
+ * `scripts/check-runtime-state-durability.ts`.
28437
+ */
28438
+ durability: "session"
27849
28439
  };
27850
28440
  /**
27851
28441
  * Stages a {@link ZoneRule} can apply to. Discriminator on the rules
@@ -27923,7 +28513,14 @@ var zoneRulesCapability = {
27923
28513
  motion: array(ZoneRuleSchema).readonly(),
27924
28514
  detection: array(ZoneRuleSchema).readonly(),
27925
28515
  package: array(ZoneRuleSchema).readonly()
27926
- })
28516
+ }),
28517
+ /**
28518
+ * Runtime-state durability: **restored** — operator intent, mutation-only, same argument as `zones`.
28519
+ *
28520
+ * See `RuntimeStateDurability`. Enforced by
28521
+ * `scripts/check-runtime-state-durability.ts`.
28522
+ */
28523
+ durability: "restored"
27927
28524
  };
27928
28525
  /**
27929
28526
  * Accessory device helpers — shared across drivers.
@@ -34610,6 +35207,7 @@ Object.freeze({
34610
35207
  "network-access": "ingress",
34611
35208
  "smtp-provider": "email"
34612
35209
  });
35210
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
34613
35211
  new Set(["devices", "classes"]);
34614
35212
  /**
34615
35213
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
@@ -34887,25 +35485,32 @@ object({
34887
35485
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
34888
35486
  object({
34889
35487
  /**
34890
- * How long a retained native frame is served before it counts as a miss.
35488
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
35489
+ * detection result.
34891
35490
  *
34892
- * Must cover the FULL late-crop horizon: detection inference + the
34893
- * cross-process inference-result hop to hub post-analysis + tracking + the
34894
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
34895
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
34896
- * RAM per busy camera grows linearly with no measured hit-rate gain.
35491
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
35492
+ * a time window was never related to the event the pixels were waiting for.
35493
+ * A held frame now lives from delivery until the runner has its `FrameResult`
35494
+ * at which moment the runner cuts the subject tiles it actually wanted and
35495
+ * releases the frame. The bound exists only so a runner that stops answering
35496
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
35497
+ *
35498
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
35499
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
35500
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
35501
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
35502
+ * `holdOverflow` on the metrics line is what says you need it.
34897
35503
  */
34898
- ttlMs: number().int().min(250).max(1e4),
35504
+ holdFrames: number().int().min(1).max(64),
34899
35505
  /**
34900
35506
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
34901
35507
  *
34902
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
34903
- * which one is actually binding before reasoning from that. At the shipped
34904
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
34905
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
34906
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
34907
- * change that admits fewer frames buys retention WINDOW at constant RAM
34908
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
35508
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
35509
+ * is what decides how much is held, and the ceiling is the number above which
35510
+ * something is wrong. Before that it was the effective cap at 1024 MB with
35511
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
35512
+ * with the TTL expiring nothing, which is exactly the confusion the hold
35513
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
34909
35514
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
34910
35515
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
34911
35516
  * to replace).
@@ -34931,22 +35536,45 @@ object({
34931
35536
  * there is the signal that some caller names frames outside the inference set
34932
35537
  * and that this must go back to `all`.
34933
35538
  */
34934
- admission: NativeLeaseAdmissionSchema
35539
+ admission: NativeLeaseAdmissionSchema,
35540
+ /**
35541
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
35542
+ * compressed native crops the worker cuts at the moment a frame's detection
35543
+ * result arrives, and keeps long after the frame itself is freed.
35544
+ *
35545
+ * This is the knob that replaced the old retention window, and it buys about
35546
+ * three orders of magnitude more of it: a tile is one subject at native
35547
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
35548
+ * the frame it was cut from. A frame on which nothing was detected costs
35549
+ * nothing at all, which is the real change — the old lease paid per FRAME and
35550
+ * was interrogated per SUBJECT.
35551
+ *
35552
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
35553
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
35554
+ * reproduce that.
35555
+ */
35556
+ tileBudgetMb: number().int().min(0).max(1024)
34935
35557
  });
34936
35558
  /**
34937
- * The values in force when the operator has set nothing — byte-for-byte the
34938
- * constants the decode worker shipped with as env-var defaults, so making these
34939
- * settings changed no behaviour on the day it landed.
35559
+ * The values in force when the operator has set nothing.
35560
+ *
35561
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
35562
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
35563
+ * in the same change that redefines it would make a regression and a retune
35564
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
35565
+ * live traffic.
34940
35566
  */
34941
35567
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
34942
- ttlMs: 1200,
35568
+ holdFrames: 8,
34943
35569
  budgetMb: 1024,
34944
35570
  activityMs: 15e3,
35571
+ tileBudgetMb: 64,
34945
35572
  admission: "inferred"
34946
35573
  };
34947
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
35574
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34948
35575
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34949
35576
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
35577
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
34950
35578
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34951
35579
  //#endregion
34952
35580
  //#region src/config.ts