@camstack/addon-provider-amcrest 0.2.15 → 0.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +723 -95
  2. package/dist/addon.mjs +723 -95
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -10750,7 +10750,14 @@ var cameraStreamsCapability = {
10750
10750
  low: string().optional()
10751
10751
  }),
10752
10752
  lastChangedAt: number()
10753
- })
10753
+ }),
10754
+ /**
10755
+ * 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.
10756
+ *
10757
+ * See `RuntimeStateDurability`. Enforced by
10758
+ * `scripts/check-runtime-state-durability.ts`.
10759
+ */
10760
+ durability: "session"
10754
10761
  };
10755
10762
  /** Where a block runs. The operator chooses — a block driving a device on an
10756
10763
  * agent is the reason placement is not fixed to the hub. */
@@ -11311,6 +11318,13 @@ var deviceDiscoveryCapability = {
11311
11318
  kind: "poll"
11312
11319
  },
11313
11320
  runtimeState: DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: number().int().nonnegative() }),
11321
+ /**
11322
+ * Runtime-state durability: **session** — 5.7 KB of scan output on the largest device, fully re-derivable by re-scanning.
11323
+ *
11324
+ * See `RuntimeStateDurability`. Enforced by
11325
+ * `scripts/check-runtime-state-durability.ts`.
11326
+ */
11327
+ durability: "session",
11314
11328
  methods: {
11315
11329
  /**
11316
11330
  * Snapshot of the current `discovered` list. Returns the
@@ -13210,7 +13224,23 @@ var NotificationActionSchema = object({
13210
13224
  * else — see `notification-center/action-token.ts` for what that does and
13211
13225
  * does not buy.
13212
13226
  */
13213
- destructive: boolean().optional()
13227
+ destructive: boolean().optional(),
13228
+ /**
13229
+ * How the tap should REACH the url.
13230
+ *
13231
+ * `navigate` (absent, and every button authored before this field) opens it:
13232
+ * the phone leaves the notification and shows whatever the callback returns.
13233
+ * That is right for a button whose answer the operator wants to read.
13234
+ *
13235
+ * `background` fires it as a POST and stays put. It exists for the buttons
13236
+ * whose whole point is not to interrupt — "silence this for 30 minutes" is
13237
+ * an answer to the notification, and being thrown into a browser tab to
13238
+ * confirm it costs more attention than the notification did. A backend that
13239
+ * cannot do a background call renders it as an ordinary link (the adapters
13240
+ * fall back rather than dropping the button), so this is a preference, never
13241
+ * a requirement.
13242
+ */
13243
+ mode: _enum(["navigate", "background"]).optional()
13214
13244
  });
13215
13245
  /**
13216
13246
  * The canonical notification. `body` is the only hard field (Apprise model).
@@ -14062,7 +14092,17 @@ var alarmPanelCapability = {
14062
14092
  * full slice; renders an arm button per `availableModes` entry and
14063
14093
  * a PIN field iff `requiresCode === true`.
14064
14094
  */
14065
- runtimeState: AlarmPanelStatusSchema
14095
+ runtimeState: AlarmPanelStatusSchema,
14096
+ /**
14097
+ * Runtime-state durability: **restored** — armed state is the one thing a panel must not lose across a restart.
14098
+ *
14099
+ * See `RuntimeStateDurability`. Enforced by
14100
+ * `scripts/check-runtime-state-durability.ts`.
14101
+ */
14102
+ durability: "restored",
14103
+ /** Clock fields: written, but excluded from the compare that decides
14104
+ * whether persisting is worth a SQLite commit. */
14105
+ volatileStateFields: ["lastChangedAt"]
14066
14106
  };
14067
14107
  /**
14068
14108
  * Shared geometry vocabulary for on-frame shape caps — privacy-mask,
@@ -14239,6 +14279,9 @@ var NcSystemEventConditionSchema = object({
14239
14279
  nodeIds: array(string().min(1)).min(1).optional(),
14240
14280
  packageNames: array(string().min(1)).min(1).optional()
14241
14281
  });
14282
+ /** Hard ceiling on a window (24h). A snooze that could not expire would be an
14283
+ * outage the operator asked for once and forgot. */
14284
+ var NC_SNOOZE_MAX_MINUTES = 1440;
14242
14285
  /** Weekly schedule — OR of windows; absence on the rule = always active. */
14243
14286
  var NcScheduleSchema = object({
14244
14287
  windows: array(object({
@@ -14615,15 +14658,15 @@ var NcConditionsSchema = object({
14615
14658
  * (an `immediate` rule naming an `audio-*` class, one notification per
14616
14659
  * classified sample) stays exactly as it was for rules that already use it.
14617
14660
  *
14618
- * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14619
- * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14620
- * (`camstack/src/data/notification-center.ts`, guarded by
14621
- * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14661
+ * In {@link NC_CONDITION_CATALOG} since P2, and the ORDER it got there is the
14662
+ * rule rather than an accident: the viewer mirrors the descriptor enums BY
14663
+ * HAND (`camstack/src/data/notification-center.ts`, guarded by
14664
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor strips the
14622
14665
  * condition fields it does not know when a rule is saved from the phone.
14623
14666
  * Publishing an editor for a condition the app cannot round-trip is how an
14624
- * operator loses a rule's conditions by opening it — so the descriptor, the
14625
- * admin widget and the viewer mirror land together (P2 + P3), and only then
14626
- * does an audio rule become authorable.
14667
+ * operator loses a rule's conditions by opening it — so the viewer mirror
14668
+ * (P3, shipped) went FIRST, and the descriptor an editor renders from
14669
+ * follows here.
14627
14670
  */
14628
14671
  audio: NcAudioConditionSchema.optional()
14629
14672
  });
@@ -14859,6 +14902,30 @@ var NcRuleInputSchema = object({
14859
14902
  */
14860
14903
  snoozeAllowGlobal: boolean().optional(),
14861
14904
  /**
14905
+ * The snooze durations THIS rule's notification offers as buttons, in
14906
+ * minutes.
14907
+ *
14908
+ * Three states, and all three are distinct — which is exactly why this is
14909
+ * `.optional()` and never `.default()`. A Zod default does not run on the
14910
+ * addon cap path (three production failures in one day), so a schema default
14911
+ * would collapse the first two:
14912
+ *
14913
+ * | value | meaning |
14914
+ * | --- | --- |
14915
+ * | absent | the operator never said ⇒ {@link NC_DEFAULT_SNOOZE_MINUTES} |
14916
+ * | `[]` | **no snooze buttons on this rule** — the explicit override |
14917
+ * | a list | these choices, de-duplicated and sorted, at most four |
14918
+ *
14919
+ * `.max(4)` because the notifier's own action budget is small (ntfy allows
14920
+ * three buttons in total) and a rule that spent it all on snooze choices
14921
+ * would push its own tap-through actions off the notification.
14922
+ *
14923
+ * An empty list is NOT an alarm exemption: a rule the alarm is about, or
14924
+ * that arms the panel, is exempt automatically and cannot be silenced by a
14925
+ * window from anywhere (D133).
14926
+ */
14927
+ snoozeOptions: array(number().int().min(1).max(NC_SNOOZE_MAX_MINUTES)).max(4).optional(),
14928
+ /**
14862
14929
  * Devices this rule ACTUATES — arm the alarm, open a gate, turn on a light.
14863
14930
  *
14864
14931
  * This is what makes the rule set the alarm's trigger set without the alarm
@@ -14958,6 +15025,7 @@ var NcConditionDescriptorSchema = object({
14958
15025
  "device",
14959
15026
  "package",
14960
15027
  "occupancy",
15028
+ "audio",
14961
15029
  "system"
14962
15030
  ]),
14963
15031
  label: string(),
@@ -14976,6 +15044,7 @@ var NcConditionDescriptorSchema = object({
14976
15044
  "crossingSelect",
14977
15045
  "polygonDraw",
14978
15046
  "occupancy",
15047
+ "audio",
14979
15048
  "deviceState",
14980
15049
  "systemEvent"
14981
15050
  ]),
@@ -15127,7 +15196,20 @@ var NcSnoozeInputSchema = object({
15127
15196
  ruleId: string().optional(),
15128
15197
  /** Required when `scope: 'device'`. */
15129
15198
  deviceId: number().int().optional(),
15130
- durationMinutes: number().int().min(1).max(1440),
15199
+ /**
15200
+ * Narrow the window to these subject classes — "the cat, not the person".
15201
+ *
15202
+ * ORTHOGONAL to `scope`, deliberately, and absent means EVERY class: that is
15203
+ * what every window authored before this field meant, so no persisted row
15204
+ * changes meaning and no client has to learn anything to keep working.
15205
+ *
15206
+ * It is what makes the window's real key `(deviceId, classes[])` and lets it
15207
+ * cross rules (D133): the operator points at a camera and a kind of thing,
15208
+ * not at whichever of their four rules happened to produce the notification
15209
+ * they are dismissing.
15210
+ */
15211
+ classes: array(string().min(1)).min(1).optional(),
15212
+ durationMinutes: number().int().min(1).max(NC_SNOOZE_MAX_MINUTES),
15131
15213
  /**
15132
15214
  * Silence this for EVERY recipient, not just the caller. Permission is
15133
15215
  * checked server-side (the rule's `snoozeAllowGlobal`, or admin for the
@@ -15152,6 +15234,10 @@ var NcSnoozeSchema = object({
15152
15234
  scope: NcSnoozeScopeSchema,
15153
15235
  ruleId: string().optional(),
15154
15236
  deviceId: number().int().optional(),
15237
+ /** Subject classes this window covers. ABSENT = every class — see
15238
+ * {@link NcSnoozeInputSchema.shape.classes}. Lives in the JSON blob and has
15239
+ * no SQLite column: nothing queries a window by class. */
15240
+ classes: array(string().min(1)).min(1).optional(),
15155
15241
  startedAt: number(),
15156
15242
  /** Exclusive: at exactly this instant the snooze is over. Expiry is a
15157
15243
  * COMPARISON, not a job — no sweeper can leave the operator silenced. */
@@ -17252,7 +17338,14 @@ var zonesCapability = {
17252
17338
  * handle. Slice shape is `{ zones: Zone[] }` so future extensions
17253
17339
  * (e.g. zone groupings) can sit alongside the polygon list.
17254
17340
  */
17255
- runtimeState: object({ zones: array(ZoneSchema).readonly() })
17341
+ runtimeState: object({ zones: array(ZoneSchema).readonly() }),
17342
+ /**
17343
+ * 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.
17344
+ *
17345
+ * See `RuntimeStateDurability`. Enforced by
17346
+ * `scripts/check-runtime-state-durability.ts`.
17347
+ */
17348
+ durability: "restored"
17256
17349
  };
17257
17350
  /**
17258
17351
  * A bounding box in NORMALIZED [0,1] frame coordinates for `getNativeCrop`. The
@@ -20146,7 +20239,17 @@ var airQualitySensorCapability = {
20146
20239
  schema: AirQualitySensorStatusSchema,
20147
20240
  kind: "push"
20148
20241
  },
20149
- runtimeState: AirQualitySensorStatusSchema
20242
+ runtimeState: AirQualitySensorStatusSchema,
20243
+ /**
20244
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20245
+ *
20246
+ * See `RuntimeStateDurability`. Enforced by
20247
+ * `scripts/check-runtime-state-durability.ts`.
20248
+ */
20249
+ durability: "restored",
20250
+ /** Clock fields: written, but excluded from the compare that decides
20251
+ * whether persisting is worth a SQLite commit. */
20252
+ volatileStateFields: ["lastFetchedAt"]
20150
20253
  };
20151
20254
  /**
20152
20255
  * Ambient illuminance reading in lux. Drives Home Assistant `sensor`
@@ -20178,7 +20281,17 @@ var ambientLightSensorCapability = {
20178
20281
  schema: AmbientLightSensorStatusSchema,
20179
20282
  kind: "push"
20180
20283
  },
20181
- runtimeState: AmbientLightSensorStatusSchema
20284
+ runtimeState: AmbientLightSensorStatusSchema,
20285
+ /**
20286
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
20287
+ *
20288
+ * See `RuntimeStateDurability`. Enforced by
20289
+ * `scripts/check-runtime-state-durability.ts`.
20290
+ */
20291
+ durability: "restored",
20292
+ /** Clock fields: written, but excluded from the compare that decides
20293
+ * whether persisting is worth a SQLite commit. */
20294
+ volatileStateFields: ["lastFetchedAt"]
20182
20295
  };
20183
20296
  /**
20184
20297
  * Per-class audio metrics aggregated over a sliding window.
@@ -20296,7 +20409,14 @@ var audioMetricsCapability = {
20296
20409
  }), AudioMetricsHistorySchema)
20297
20410
  },
20298
20411
  /** Reactive runtime-state mirror — live `device.state.audioMetrics.value`. */
20299
- runtimeState: AudioMetricsSnapshotSchema
20412
+ runtimeState: AudioMetricsSnapshotSchema,
20413
+ /**
20414
+ * 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.
20415
+ *
20416
+ * See `RuntimeStateDurability`. Enforced by
20417
+ * `scripts/check-runtime-state-durability.ts`.
20418
+ */
20419
+ durability: "session"
20300
20420
  };
20301
20421
  /**
20302
20422
  * Automation-control cap. Models HA `automation.*` entities on
@@ -20358,7 +20478,14 @@ var automationControlCapability = {
20358
20478
  * reads `enabled` (toggle) + `isRunning` (spinner) + `lastError`
20359
20479
  * (badge) directly.
20360
20480
  */
20361
- runtimeState: AutomationControlStatusSchema
20481
+ runtimeState: AutomationControlStatusSchema,
20482
+ /**
20483
+ * 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.
20484
+ *
20485
+ * See `RuntimeStateDurability`. Enforced by
20486
+ * `scripts/check-runtime-state-durability.ts`.
20487
+ */
20488
+ durability: "session"
20362
20489
  };
20363
20490
  /**
20364
20491
  * Battery status snapshot. Emitted by providers whose device is
@@ -20464,7 +20591,17 @@ onStatusChanged: { data: object({
20464
20591
  * via `device.runtimeState.getCapState('battery')` regardless of
20465
20592
  * the underlying driver.
20466
20593
  */
20467
- runtimeState: BatteryStatusSchema
20594
+ runtimeState: BatteryStatusSchema,
20595
+ /**
20596
+ * 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.
20597
+ *
20598
+ * See `RuntimeStateDurability`. Enforced by
20599
+ * `scripts/check-runtime-state-durability.ts`.
20600
+ */
20601
+ durability: "restored",
20602
+ /** Clock fields: written, but excluded from the compare that decides
20603
+ * whether persisting is worth a SQLite commit. */
20604
+ volatileStateFields: ["lastUpdated"]
20468
20605
  };
20469
20606
  /**
20470
20607
  * Generic boolean sensor — last-resort fallback when no domain-
@@ -20493,7 +20630,17 @@ var binaryCapability = {
20493
20630
  schema: BinaryStatusSchema,
20494
20631
  kind: "push"
20495
20632
  },
20496
- runtimeState: BinaryStatusSchema
20633
+ runtimeState: BinaryStatusSchema,
20634
+ /**
20635
+ * Runtime-state durability: **restored** — transition-driven sensor state; the restored value gives the boot comparison.
20636
+ *
20637
+ * See `RuntimeStateDurability`. Enforced by
20638
+ * `scripts/check-runtime-state-durability.ts`.
20639
+ */
20640
+ durability: "restored",
20641
+ /** Clock fields: written, but excluded from the compare that decides
20642
+ * whether persisting is worth a SQLite commit. */
20643
+ volatileStateFields: ["lastChangedAt"]
20497
20644
  };
20498
20645
  /**
20499
20646
  * Dimmable-light brightness control. Co-exists with `switch` on the
@@ -20546,7 +20693,14 @@ onBrightnessChanged: { data: object({
20546
20693
  * by the kernel. Read via `device.state.brightness.value` so UI
20547
20694
  * sliders surface the current level without polling the provider.
20548
20695
  */
20549
- runtimeState: BrightnessStatusSchema
20696
+ runtimeState: BrightnessStatusSchema,
20697
+ /**
20698
+ * Runtime-state durability: **session** — live lamp state, re-published by the provider on connect.
20699
+ *
20700
+ * See `RuntimeStateDurability`. Enforced by
20701
+ * `scripts/check-runtime-state-durability.ts`.
20702
+ */
20703
+ durability: "session"
20550
20704
  };
20551
20705
  DeviceType.Button, method(object({ deviceId: number().int().nonnegative() }), _void(), {
20552
20706
  kind: "mutation",
@@ -20634,7 +20788,17 @@ var carbonMonoxideCapability = {
20634
20788
  schema: CarbonMonoxideStatusSchema,
20635
20789
  kind: "push"
20636
20790
  },
20637
- runtimeState: CarbonMonoxideStatusSchema
20791
+ runtimeState: CarbonMonoxideStatusSchema,
20792
+ /**
20793
+ * Runtime-state durability: **restored** — as `smoke`.
20794
+ *
20795
+ * See `RuntimeStateDurability`. Enforced by
20796
+ * `scripts/check-runtime-state-durability.ts`.
20797
+ */
20798
+ durability: "restored",
20799
+ /** Clock fields: written, but excluded from the compare that decides
20800
+ * whether persisting is worth a SQLite commit. */
20801
+ volatileStateFields: ["lastChangedAt"]
20638
20802
  };
20639
20803
  /**
20640
20804
  * HVAC / climate control cap. Models the full surface of a HA
@@ -20794,7 +20958,14 @@ var climateControlCapability = {
20794
20958
  * the full slice via `device.state.climate-control.value` and refresh
20795
20959
  * on every push without re-querying the provider.
20796
20960
  */
20797
- runtimeState: ClimateControlStatusSchema
20961
+ runtimeState: ClimateControlStatusSchema,
20962
+ /**
20963
+ * Runtime-state durability: **session** — as `brightness`; `currentTemp` moves continuously and is re-published on connect.
20964
+ *
20965
+ * See `RuntimeStateDurability`. Enforced by
20966
+ * `scripts/check-runtime-state-durability.ts`.
20967
+ */
20968
+ durability: "session"
20798
20969
  };
20799
20970
  /**
20800
20971
  * Color-light cap. Coexists with `switch` (on/off) and `brightness`
@@ -20904,7 +21075,14 @@ onColorChanged: { data: object({
20904
21075
  * kernel. Read via `device.state.color.value` so UI pickers surface
20905
21076
  * the current chromaticity without polling the provider.
20906
21077
  */
20907
- runtimeState: ColorStatusSchema
21078
+ runtimeState: ColorStatusSchema,
21079
+ /**
21080
+ * Runtime-state durability: **session** — as `brightness`.
21081
+ *
21082
+ * See `RuntimeStateDurability`. Enforced by
21083
+ * `scripts/check-runtime-state-durability.ts`.
21084
+ */
21085
+ durability: "session"
20908
21086
  };
20909
21087
  var ConnectionTestOutcomeSchema = discriminatedUnion("outcome", [
20910
21088
  object({
@@ -20962,7 +21140,17 @@ var connectivityCapability = {
20962
21140
  schema: ConnectivityStatusSchema,
20963
21141
  kind: "push"
20964
21142
  },
20965
- runtimeState: ConnectivityStatusSchema
21143
+ runtimeState: ConnectivityStatusSchema,
21144
+ /**
21145
+ * Runtime-state durability: **restored** — same shape and same argument as `device-status`, for links rather than devices.
21146
+ *
21147
+ * See `RuntimeStateDurability`. Enforced by
21148
+ * `scripts/check-runtime-state-durability.ts`.
21149
+ */
21150
+ durability: "restored",
21151
+ /** Clock fields: written, but excluded from the compare that decides
21152
+ * whether persisting is worth a SQLite commit. */
21153
+ volatileStateFields: ["lastChangedAt"]
20966
21154
  };
20967
21155
  /**
20968
21156
  * Generic device-consumables capability — surfaces a device's
@@ -21044,7 +21232,14 @@ reset: method(object({
21044
21232
  }
21045
21233
  }
21046
21234
  },
21047
- runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() })
21235
+ runtimeState: ConsumablesStatusSchema.extend({ lastFetchedAt: number() }),
21236
+ /**
21237
+ * Runtime-state durability: **session** — the authority is the appliance; the provider re-reads the whole item array on connect.
21238
+ *
21239
+ * See `RuntimeStateDurability`. Enforced by
21240
+ * `scripts/check-runtime-state-durability.ts`.
21241
+ */
21242
+ durability: "session"
21048
21243
  };
21049
21244
  /**
21050
21245
  * Door / window / opening / garage / valve contact sensor. Boolean
@@ -21075,7 +21270,17 @@ var contactCapability = {
21075
21270
  schema: ContactStatusSchema,
21076
21271
  kind: "push"
21077
21272
  },
21078
- runtimeState: ContactStatusSchema
21273
+ runtimeState: ContactStatusSchema,
21274
+ /**
21275
+ * Runtime-state durability: **restored** — a door left open across a restart must still read open.
21276
+ *
21277
+ * See `RuntimeStateDurability`. Enforced by
21278
+ * `scripts/check-runtime-state-durability.ts`.
21279
+ */
21280
+ durability: "restored",
21281
+ /** Clock fields: written, but excluded from the compare that decides
21282
+ * whether persisting is worth a SQLite commit. */
21283
+ volatileStateFields: ["lastChangedAt"]
21079
21284
  };
21080
21285
  /**
21081
21286
  * Status slice — flat object (the framework's `runtimeState` contract
@@ -21181,7 +21386,14 @@ var controlCapability = {
21181
21386
  * dropdown / text field / date picker) read the slice's discriminant
21182
21387
  * and value directly without polling the provider.
21183
21388
  */
21184
- runtimeState: ControlStatusSchema
21389
+ runtimeState: ControlStatusSchema,
21390
+ /**
21391
+ * Runtime-state durability: **session** — a generic control mirrors an external entity that re-publishes on connect; the options array is re-derived with it.
21392
+ *
21393
+ * See `RuntimeStateDurability`. Enforced by
21394
+ * `scripts/check-runtime-state-durability.ts`.
21395
+ */
21396
+ durability: "session"
21185
21397
  };
21186
21398
  var CoverStatusSchema = object({
21187
21399
  /** Lifecycle state of the cover. */
@@ -21242,7 +21454,17 @@ var coverCapability = {
21242
21454
  * Runtime-state slice — mirrored by the kernel. UI controls watch
21243
21455
  * the slice for live position changes during a move.
21244
21456
  */
21245
- runtimeState: CoverStatusSchema
21457
+ runtimeState: CoverStatusSchema,
21458
+ /**
21459
+ * Runtime-state durability: **restored** — position survives a restart on the device; the mirror should agree at boot rather than read blank.
21460
+ *
21461
+ * See `RuntimeStateDurability`. Enforced by
21462
+ * `scripts/check-runtime-state-durability.ts`.
21463
+ */
21464
+ durability: "restored",
21465
+ /** Clock fields: written, but excluded from the compare that decides
21466
+ * whether persisting is worth a SQLite commit. */
21467
+ volatileStateFields: ["lastChangedAt"]
21246
21468
  };
21247
21469
  /**
21248
21470
  * Vendor-neutral day/night (IR-cut) control — the per-camera config cap
@@ -21336,7 +21558,17 @@ var dayNightCapability = {
21336
21558
  schema: DayNightStatusSchema,
21337
21559
  kind: "poll"
21338
21560
  },
21339
- runtimeState: DayNightStatusSchema
21561
+ runtimeState: DayNightStatusSchema,
21562
+ /**
21563
+ * Runtime-state durability: **restored** — operator-set IR-cut behaviour; mutation-driven.
21564
+ *
21565
+ * See `RuntimeStateDurability`. Enforced by
21566
+ * `scripts/check-runtime-state-durability.ts`.
21567
+ */
21568
+ durability: "restored",
21569
+ /** Clock fields: written, but excluded from the compare that decides
21570
+ * whether persisting is worth a SQLite commit. */
21571
+ volatileStateFields: ["lastFetchedAt"]
21340
21572
  };
21341
21573
  /**
21342
21574
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
@@ -21383,7 +21615,17 @@ onStatusChanged: { data: object({
21383
21615
  schema: DeviceStatusSchema,
21384
21616
  kind: "push"
21385
21617
  },
21386
- runtimeState: DeviceStatusSchema
21618
+ runtimeState: DeviceStatusSchema,
21619
+ /**
21620
+ * 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.
21621
+ *
21622
+ * See `RuntimeStateDurability`. Enforced by
21623
+ * `scripts/check-runtime-state-durability.ts`.
21624
+ */
21625
+ durability: "restored",
21626
+ /** Clock fields: written, but excluded from the compare that decides
21627
+ * whether persisting is worth a SQLite commit. */
21628
+ volatileStateFields: ["lastChangedAt"]
21387
21629
  };
21388
21630
  /**
21389
21631
  * Doorbell button cap. Two kinds of providers coexist behind this cap
@@ -21445,7 +21687,14 @@ onPressed: { data: DoorbellPressEventSchema } },
21445
21687
  * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
21446
21688
  * without subscribing.
21447
21689
  */
21448
- runtimeState: DoorbellStatusSchema
21690
+ runtimeState: DoorbellStatusSchema,
21691
+ /**
21692
+ * 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.
21693
+ *
21694
+ * See `RuntimeStateDurability`. Enforced by
21695
+ * `scripts/check-runtime-state-durability.ts`.
21696
+ */
21697
+ durability: "restored"
21449
21698
  };
21450
21699
  /**
21451
21700
  * Enum-state sensor — a string value picked from a finite option set.
@@ -21485,7 +21734,17 @@ var enumSensorCapability = {
21485
21734
  schema: EnumSensorStatusSchema,
21486
21735
  kind: "push"
21487
21736
  },
21488
- runtimeState: EnumSensorStatusSchema
21737
+ runtimeState: EnumSensorStatusSchema,
21738
+ /**
21739
+ * Runtime-state durability: **restored** — as `numeric-sensor`; 80 devices.
21740
+ *
21741
+ * See `RuntimeStateDurability`. Enforced by
21742
+ * `scripts/check-runtime-state-durability.ts`.
21743
+ */
21744
+ durability: "restored",
21745
+ /** Clock fields: written, but excluded from the compare that decides
21746
+ * whether persisting is worth a SQLite commit. */
21747
+ volatileStateFields: ["lastFetchedAt"]
21489
21748
  };
21490
21749
  /**
21491
21750
  * Generic stateless event emitter. Installed on a `DeviceType.EventEmitter`
@@ -21521,7 +21780,14 @@ var eventEmitterCapability = {
21521
21780
  schema: EventEmitterStatusSchema,
21522
21781
  kind: "push"
21523
21782
  },
21524
- runtimeState: EventEmitterStatusSchema
21783
+ runtimeState: EventEmitterStatusSchema,
21784
+ /**
21785
+ * Runtime-state durability: **session** — `eventCountSinceStart` names its own scope.
21786
+ *
21787
+ * See `RuntimeStateDurability`. Enforced by
21788
+ * `scripts/check-runtime-state-durability.ts`.
21789
+ */
21790
+ durability: "session"
21525
21791
  };
21526
21792
  var EventItemSchema = object({
21527
21793
  id: string(),
@@ -21802,7 +22068,14 @@ var fanControlCapability = {
21802
22068
  * Runtime-state slice — mirrored by the kernel. UI fan speed
21803
22069
  * sliders read `percentage` for live updates.
21804
22070
  */
21805
- runtimeState: FanControlStatusSchema
22071
+ runtimeState: FanControlStatusSchema,
22072
+ /**
22073
+ * Runtime-state durability: **session** — as `brightness`.
22074
+ *
22075
+ * See `RuntimeStateDurability`. Enforced by
22076
+ * `scripts/check-runtime-state-durability.ts`.
22077
+ */
22078
+ durability: "session"
21806
22079
  };
21807
22080
  /**
21808
22081
  * Per-device feature/identity probe slice. Holds the runtime-resolved
@@ -21878,7 +22151,14 @@ onProbeChanged: { data: object({
21878
22151
  schema: FeatureProbeStatusSchema,
21879
22152
  kind: "push"
21880
22153
  },
21881
- runtimeState: FeatureProbeStatusSchema
22154
+ runtimeState: FeatureProbeStatusSchema,
22155
+ /**
22156
+ * 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.
22157
+ *
22158
+ * See `RuntimeStateDurability`. Enforced by
22159
+ * `scripts/check-runtime-state-durability.ts`.
22160
+ */
22161
+ durability: "session"
21882
22162
  };
21883
22163
  /**
21884
22164
  * Water leak / moisture sensor. Boolean "is liquid currently
@@ -21905,7 +22185,17 @@ var floodCapability = {
21905
22185
  schema: FloodStatusSchema,
21906
22186
  kind: "push"
21907
22187
  },
21908
- runtimeState: FloodStatusSchema
22188
+ runtimeState: FloodStatusSchema,
22189
+ /**
22190
+ * Runtime-state durability: **restored** — as `smoke`.
22191
+ *
22192
+ * See `RuntimeStateDurability`. Enforced by
22193
+ * `scripts/check-runtime-state-durability.ts`.
22194
+ */
22195
+ durability: "restored",
22196
+ /** Clock fields: written, but excluded from the compare that decides
22197
+ * whether persisting is worth a SQLite commit. */
22198
+ volatileStateFields: ["lastChangedAt"]
21909
22199
  };
21910
22200
  /**
21911
22201
  * Combustible-gas (LPG / methane / hydrogen) alarm sensor. Drives
@@ -21928,7 +22218,17 @@ var gasCapability = {
21928
22218
  schema: GasStatusSchema,
21929
22219
  kind: "push"
21930
22220
  },
21931
- runtimeState: GasStatusSchema
22221
+ runtimeState: GasStatusSchema,
22222
+ /**
22223
+ * Runtime-state durability: **restored** — as `smoke`.
22224
+ *
22225
+ * See `RuntimeStateDurability`. Enforced by
22226
+ * `scripts/check-runtime-state-durability.ts`.
22227
+ */
22228
+ durability: "restored",
22229
+ /** Clock fields: written, but excluded from the compare that decides
22230
+ * whether persisting is worth a SQLite commit. */
22231
+ volatileStateFields: ["lastChangedAt"]
21932
22232
  };
21933
22233
  /**
21934
22234
  * Humidifier / dehumidifier cap. Models HA `humidifier.*` entities —
@@ -22004,7 +22304,14 @@ var humidifierCapability = {
22004
22304
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22005
22305
  * slice for live humidity / mode changes.
22006
22306
  */
22007
- runtimeState: HumidifierStatusSchema
22307
+ runtimeState: HumidifierStatusSchema,
22308
+ /**
22309
+ * Runtime-state durability: **session** — as `climate-control`.
22310
+ *
22311
+ * See `RuntimeStateDurability`. Enforced by
22312
+ * `scripts/check-runtime-state-durability.ts`.
22313
+ */
22314
+ durability: "session"
22008
22315
  };
22009
22316
  /**
22010
22317
  * Single-metric humidity reading. Drives Home Assistant `sensor`
@@ -22040,7 +22347,17 @@ var humiditySensorCapability = {
22040
22347
  schema: HumiditySensorStatusSchema,
22041
22348
  kind: "push"
22042
22349
  },
22043
- runtimeState: HumiditySensorStatusSchema
22350
+ runtimeState: HumiditySensorStatusSchema,
22351
+ /**
22352
+ * Runtime-state durability: **restored** — as `numeric-sensor` (67 of 75 writes were the clock alone).
22353
+ *
22354
+ * See `RuntimeStateDurability`. Enforced by
22355
+ * `scripts/check-runtime-state-durability.ts`.
22356
+ */
22357
+ durability: "restored",
22358
+ /** Clock fields: written, but excluded from the compare that decides
22359
+ * whether persisting is worth a SQLite commit. */
22360
+ volatileStateFields: ["lastFetchedAt"]
22044
22361
  };
22045
22362
  /**
22046
22363
  * Image display cap. Models a single still image exposed by an integration —
@@ -22078,7 +22395,14 @@ var imageCapability = {
22078
22395
  * Runtime-state slice — mirrored by the kernel. The UI reads `url`
22079
22396
  * directly and renders the still image.
22080
22397
  */
22081
- runtimeState: ImageStatusSchema
22398
+ runtimeState: ImageStatusSchema,
22399
+ /**
22400
+ * Runtime-state durability: **session** — a snapshot URL is a session-scoped handle; a restored one points at nothing.
22401
+ *
22402
+ * See `RuntimeStateDurability`. Enforced by
22403
+ * `scripts/check-runtime-state-durability.ts`.
22404
+ */
22405
+ durability: "session"
22082
22406
  };
22083
22407
  /**
22084
22408
  * Vendor-neutral image / picture-adjustment cap — the per-camera config
@@ -22227,7 +22551,17 @@ var imageSettingsCapability = {
22227
22551
  schema: ImageSettingsStatusSchema,
22228
22552
  kind: "poll"
22229
22553
  },
22230
- runtimeState: ImageSettingsStatusSchema
22554
+ runtimeState: ImageSettingsStatusSchema,
22555
+ /**
22556
+ * Runtime-state durability: **restored** — operator-set camera imaging; mutation-driven.
22557
+ *
22558
+ * See `RuntimeStateDurability`. Enforced by
22559
+ * `scripts/check-runtime-state-durability.ts`.
22560
+ */
22561
+ durability: "restored",
22562
+ /** Clock fields: written, but excluded from the compare that decides
22563
+ * whether persisting is worth a SQLite commit. */
22564
+ volatileStateFields: ["lastFetchedAt"]
22231
22565
  };
22232
22566
  /**
22233
22567
  * integrations — system-scoped singleton capability for integration
@@ -22567,7 +22901,14 @@ var lawnMowerControlCapability = {
22567
22901
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
22568
22902
  * slice for live activity + battery changes.
22569
22903
  */
22570
- runtimeState: LawnMowerControlStatusSchema
22904
+ runtimeState: LawnMowerControlStatusSchema,
22905
+ /**
22906
+ * Runtime-state durability: **session** — as `vacuum-control`.
22907
+ *
22908
+ * See `RuntimeStateDurability`. Enforced by
22909
+ * `scripts/check-runtime-state-durability.ts`.
22910
+ */
22911
+ durability: "session"
22571
22912
  };
22572
22913
  /**
22573
22914
  * local-network — hub-only singleton.
@@ -22773,7 +23114,17 @@ var lockControlCapability = {
22773
23114
  * read `state` and disable themselves during `locking`/`unlocking`
22774
23115
  * transitions.
22775
23116
  */
22776
- runtimeState: LockControlStatusSchema
23117
+ runtimeState: LockControlStatusSchema,
23118
+ /**
23119
+ * Runtime-state durability: **restored** — a lock left locked must still read locked.
23120
+ *
23121
+ * See `RuntimeStateDurability`. Enforced by
23122
+ * `scripts/check-runtime-state-durability.ts`.
23123
+ */
23124
+ durability: "restored",
23125
+ /** Clock fields: written, but excluded from the compare that decides
23126
+ * whether persisting is worth a SQLite commit. */
23127
+ volatileStateFields: ["lastChangedAt"]
22777
23128
  };
22778
23129
  /**
22779
23130
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
@@ -22935,7 +23286,14 @@ var mediaPlayerCapability = {
22935
23286
  * full slice for live now-playing, volume, and progress updates
22936
23287
  * without polling.
22937
23288
  */
22938
- runtimeState: MediaPlayerStatusSchema
23289
+ runtimeState: MediaPlayerStatusSchema,
23290
+ /**
23291
+ * Runtime-state durability: **session** — a restored transport position describes a playback that stopped when the hub did.
23292
+ *
23293
+ * See `RuntimeStateDurability`. Enforced by
23294
+ * `scripts/check-runtime-state-durability.ts`.
23295
+ */
23296
+ durability: "session"
22939
23297
  };
22940
23298
  /**
22941
23299
  * mesh-network — collection cap for mesh-VPN providers.
@@ -23199,7 +23557,14 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
23199
23557
  * `device.state.motion.value`. Reads never invoke the provider, so
23200
23558
  * UIs and other addons can poll the cached state safely.
23201
23559
  */
23202
- runtimeState: MotionStatusSchema
23560
+ runtimeState: MotionStatusSchema,
23561
+ /**
23562
+ * 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.
23563
+ *
23564
+ * See `RuntimeStateDurability`. Enforced by
23565
+ * `scripts/check-runtime-state-durability.ts`.
23566
+ */
23567
+ durability: "session"
23203
23568
  };
23204
23569
  /**
23205
23570
  * Motion-trigger toggle for accessory devices.
@@ -23264,7 +23629,14 @@ var motionTriggerCapability = {
23264
23629
  schema: MotionTriggerStatusSchema,
23265
23630
  kind: "command-driven"
23266
23631
  },
23267
- runtimeState: MotionTriggerRuntimeStateSchema
23632
+ runtimeState: MotionTriggerRuntimeStateSchema,
23633
+ /**
23634
+ * 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.
23635
+ *
23636
+ * See `RuntimeStateDurability`. Enforced by
23637
+ * `scripts/check-runtime-state-durability.ts`.
23638
+ */
23639
+ durability: "session"
23268
23640
  };
23269
23641
  /**
23270
23642
  * Motion-zones share the same MaskShape vocabulary as privacy-mask — the
@@ -23331,7 +23703,17 @@ var motionZonesCapability = {
23331
23703
  schema: MotionZoneStatusSchema,
23332
23704
  kind: "poll"
23333
23705
  },
23334
- runtimeState: MotionZoneStatusSchema
23706
+ runtimeState: MotionZoneStatusSchema,
23707
+ /**
23708
+ * 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.
23709
+ *
23710
+ * See `RuntimeStateDurability`. Enforced by
23711
+ * `scripts/check-runtime-state-durability.ts`.
23712
+ */
23713
+ durability: "restored",
23714
+ /** Clock fields: written, but excluded from the compare that decides
23715
+ * whether persisting is worth a SQLite commit. */
23716
+ volatileStateFields: ["lastFetchedAt"]
23335
23717
  };
23336
23718
  /**
23337
23719
  * On-camera AI object detection cap. Surfaces per-device the classes
@@ -23405,7 +23787,17 @@ var nativeObjectDetectionCapability = {
23405
23787
  schema: NativeObjectDetectionStatusSchema,
23406
23788
  kind: "push"
23407
23789
  },
23408
- runtimeState: NativeObjectDetectionRuntimeStateSchema
23790
+ runtimeState: NativeObjectDetectionRuntimeStateSchema,
23791
+ /**
23792
+ * 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.
23793
+ *
23794
+ * See `RuntimeStateDurability`. Enforced by
23795
+ * `scripts/check-runtime-state-durability.ts`.
23796
+ */
23797
+ durability: "restored",
23798
+ /** Clock fields: written, but excluded from the compare that decides
23799
+ * whether persisting is worth a SQLite commit. */
23800
+ volatileStateFields: ["lastFetchedAt"]
23409
23801
  };
23410
23802
  /**
23411
23803
  * network-quality — system-scoped singleton capability tracking RTT,
@@ -23739,7 +24131,14 @@ onSent: { data: object({
23739
24131
  * form reads `supports` to gate optional fields; history pane reads
23740
24132
  * `lastSentAt` / `lastError` / `queueDepth`.
23741
24133
  */
23742
- runtimeState: NotifierStatusSchema
24134
+ runtimeState: NotifierStatusSchema,
24135
+ /**
24136
+ * Runtime-state durability: **session** — live queue depth and last-send state; a restored queue depth describes a queue that no longer exists.
24137
+ *
24138
+ * See `RuntimeStateDurability`. Enforced by
24139
+ * `scripts/check-runtime-state-durability.ts`.
24140
+ */
24141
+ durability: "session"
23743
24142
  };
23744
24143
  /**
23745
24144
  * Generic numeric sensor — last-resort fallback when no typed numeric
@@ -23782,7 +24181,17 @@ var numericSensorCapability = {
23782
24181
  schema: NumericSensorStatusSchema,
23783
24182
  kind: "push"
23784
24183
  },
23785
- runtimeState: NumericSensorStatusSchema
24184
+ runtimeState: NumericSensorStatusSchema,
24185
+ /**
24186
+ * 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.
24187
+ *
24188
+ * See `RuntimeStateDurability`. Enforced by
24189
+ * `scripts/check-runtime-state-durability.ts`.
24190
+ */
24191
+ durability: "restored",
24192
+ /** Clock fields: written, but excluded from the compare that decides
24193
+ * whether persisting is worth a SQLite commit. */
24194
+ volatileStateFields: ["lastFetchedAt"]
23786
24195
  };
23787
24196
  /**
23788
24197
  * Generic on-screen-display (video overlay) cap. Each camera exposes
@@ -24213,7 +24622,14 @@ var petFeederCapability = {
24213
24622
  * the full slice via `device.state.petFeeder.value` and refresh on
24214
24623
  * every poll without re-querying the provider.
24215
24624
  */
24216
- runtimeState: PetFeederStatusSchema
24625
+ runtimeState: PetFeederStatusSchema,
24626
+ /**
24627
+ * Runtime-state durability: **session** — live appliance state re-published on connect.
24628
+ *
24629
+ * See `RuntimeStateDurability`. Enforced by
24630
+ * `scripts/check-runtime-state-durability.ts`.
24631
+ */
24632
+ durability: "session"
24217
24633
  };
24218
24634
  var VehicleSchema = object({
24219
24635
  id: string(),
@@ -24525,7 +24941,17 @@ var powerMeterCapability = {
24525
24941
  schema: PowerMeterStatusSchema,
24526
24942
  kind: "push"
24527
24943
  },
24528
- runtimeState: PowerMeterStatusSchema
24944
+ runtimeState: PowerMeterStatusSchema,
24945
+ /**
24946
+ * Runtime-state durability: **restored** — as `numeric-sensor`; `kwhTotal` is an accumulator whose restored value is the baseline.
24947
+ *
24948
+ * See `RuntimeStateDurability`. Enforced by
24949
+ * `scripts/check-runtime-state-durability.ts`.
24950
+ */
24951
+ durability: "restored",
24952
+ /** Clock fields: written, but excluded from the compare that decides
24953
+ * whether persisting is worth a SQLite commit. */
24954
+ volatileStateFields: ["lastFetchedAt"]
24529
24955
  };
24530
24956
  /**
24531
24957
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
@@ -24582,7 +25008,17 @@ var presenceCapability = {
24582
25008
  * the map pin is rendered (use `DeviceFeature.PresenceGps` for the
24583
25009
  * pre-fetch fast-path check).
24584
25010
  */
24585
- runtimeState: PresenceStatusSchema
25011
+ runtimeState: PresenceStatusSchema,
25012
+ /**
25013
+ * Runtime-state durability: **restored** — occupancy-relevant: the restored state is what an occupancy rule compares the first post-restart observation against.
25014
+ *
25015
+ * See `RuntimeStateDurability`. Enforced by
25016
+ * `scripts/check-runtime-state-durability.ts`.
25017
+ */
25018
+ durability: "restored",
25019
+ /** Clock fields: written, but excluded from the compare that decides
25020
+ * whether persisting is worth a SQLite commit. */
25021
+ volatileStateFields: ["lastChangedAt"]
24586
25022
  };
24587
25023
  /**
24588
25024
  * Atmospheric pressure reading in hectopascals. Drives Home Assistant
@@ -24618,7 +25054,17 @@ var pressureSensorCapability = {
24618
25054
  schema: PressureSensorStatusSchema,
24619
25055
  kind: "push"
24620
25056
  },
24621
- runtimeState: PressureSensorStatusSchema
25057
+ runtimeState: PressureSensorStatusSchema,
25058
+ /**
25059
+ * Runtime-state durability: **restored** — as `numeric-sensor`.
25060
+ *
25061
+ * See `RuntimeStateDurability`. Enforced by
25062
+ * `scripts/check-runtime-state-durability.ts`.
25063
+ */
25064
+ durability: "restored",
25065
+ /** Clock fields: written, but excluded from the compare that decides
25066
+ * whether persisting is worth a SQLite commit. */
25067
+ volatileStateFields: ["lastFetchedAt"]
24622
25068
  };
24623
25069
  /**
24624
25070
  * PRIVACY — what the camera deliberately does not capture. Two planes:
@@ -24748,7 +25194,17 @@ var privacyMaskCapability = {
24748
25194
  schema: PrivacyMaskStatusSchema,
24749
25195
  kind: "poll"
24750
25196
  },
24751
- runtimeState: PrivacyMaskStatusSchema
25197
+ runtimeState: PrivacyMaskStatusSchema,
25198
+ /**
25199
+ * Runtime-state durability: **restored** — operator-drawn regions, zero real churn — 22 writes in 25 minutes, every one of them the clock.
25200
+ *
25201
+ * See `RuntimeStateDurability`. Enforced by
25202
+ * `scripts/check-runtime-state-durability.ts`.
25203
+ */
25204
+ durability: "restored",
25205
+ /** Clock fields: written, but excluded from the compare that decides
25206
+ * whether persisting is worth a SQLite commit. */
25207
+ volatileStateFields: ["lastFetchedAt"]
24752
25208
  };
24753
25209
  var PtzPresetSchema = object({
24754
25210
  id: string(),
@@ -24956,7 +25412,14 @@ var ptzAutotrackCapability = {
24956
25412
  * fetch / cache / fallback logic out of the four cap methods —
24957
25413
  * they become trampolines over `runtimeState`.
24958
25414
  */
24959
- runtimeState: PtzAutotrackRuntimeStateSchema
25415
+ runtimeState: PtzAutotrackRuntimeStateSchema,
25416
+ /**
25417
+ * Runtime-state durability: **session** — mirrors the camera's own autotrack config, re-read on connect.
25418
+ *
25419
+ * See `RuntimeStateDurability`. Enforced by
25420
+ * `scripts/check-runtime-state-durability.ts`.
25421
+ */
25422
+ durability: "session"
24960
25423
  };
24961
25424
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
24962
25425
  kind: "mutation",
@@ -25303,13 +25766,24 @@ method(object({
25303
25766
  /** Playback-speed multiplier for the render (1 = realtime). */
25304
25767
  var ExportSpeedSchema = number().min(.25).max(32);
25305
25768
  /**
25306
- * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25769
+ * One dense interval, in WALL-CLOCK SECONDS FROM THE EXPORT'S OWN `fromMs`.
25770
+ *
25771
+ * **Wall clock, not ffmpeg's `t`** — and the recorder translates. A caller
25772
+ * derives these bounds from things that happened at a TIME (a track's
25773
+ * `firstSeen`), while `t` runs over the source playlist: the concatenation of
25774
+ * every segment present for the range, with each recording GAP removed. The
25775
+ * two agree only on a window that recorded without one interruption, and only
25776
+ * the render side knows the segments, so the translation lives there
25777
+ * (`export-dense-map.ts`, addon-pipeline).
25778
+ *
25779
+ * It was not always so. These seconds were fed to `between(t,…)` verbatim, and
25780
+ * on a 10 h window holding 29,393 s of footage every range landed late by the
25781
+ * gap accumulated before it — up to 6,607 s, well past EOF. Nothing matched,
25782
+ * the video was a uniform timelapse, and the log line reported the five ranges
25783
+ * that had been ASKED for (2026-08-13, export `57d14363`, camera 615).
25307
25784
  *
25308
- * Relative and not absolute epoch on purpose: the renderer's frame-select
25309
- * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25310
- * playlist. Handing it absolute epochs would make every call site responsible
25311
- * for the same subtraction, and the one that forgot would emit a filter that
25312
- * selects nothing — silently, as a uniform timelapse.
25785
+ * Relative and not absolute epoch, because an absolute epoch would make every
25786
+ * call site responsible for the same subtraction.
25313
25787
  */
25314
25788
  var ExportDenseRangeSchema = object({
25315
25789
  fromSec: number().nonnegative(),
@@ -25595,7 +26069,14 @@ var sceneMonitorCapability = {
25595
26069
  schema: SceneMonitorStatusSchema,
25596
26070
  kind: "push"
25597
26071
  },
25598
- runtimeState: SceneMonitorStatusSchema
26072
+ runtimeState: SceneMonitorStatusSchema,
26073
+ /**
26074
+ * Runtime-state durability: **session** — re-derived from the current scene on the next evaluation.
26075
+ *
26076
+ * See `RuntimeStateDurability`. Enforced by
26077
+ * `scripts/check-runtime-state-durability.ts`.
26078
+ */
26079
+ durability: "session"
25599
26080
  };
25600
26081
  /**
25601
26082
  * Per-stage gating mode applied to the zones a rule references.
@@ -25739,7 +26220,14 @@ var scriptRunnerCapability = {
25739
26220
  * `isRunning` to render a spinner during execution and surfaces
25740
26221
  * `lastError` / `lastRunSuccess` in the recent-runs panel.
25741
26222
  */
25742
- runtimeState: ScriptRunnerStatusSchema
26223
+ runtimeState: ScriptRunnerStatusSchema,
26224
+ /**
26225
+ * Runtime-state durability: **session** — a restored `isRunning: true` describes a process that died with the previous hub.
26226
+ *
26227
+ * See `RuntimeStateDurability`. Enforced by
26228
+ * `scripts/check-runtime-state-durability.ts`.
26229
+ */
26230
+ durability: "session"
25743
26231
  };
25744
26232
  /**
25745
26233
  * Smoke alarm sensor — boolean "is smoke currently detected" with
@@ -25766,7 +26254,17 @@ var smokeCapability = {
25766
26254
  schema: SmokeStatusSchema,
25767
26255
  kind: "push"
25768
26256
  },
25769
- runtimeState: SmokeStatusSchema
26257
+ runtimeState: SmokeStatusSchema,
26258
+ /**
26259
+ * Runtime-state durability: **restored** — a safety sensor must not read "clear" merely because the hub restarted.
26260
+ *
26261
+ * See `RuntimeStateDurability`. Enforced by
26262
+ * `scripts/check-runtime-state-durability.ts`.
26263
+ */
26264
+ durability: "restored",
26265
+ /** Clock fields: written, but excluded from the compare that decides
26266
+ * whether persisting is worth a SQLite commit. */
26267
+ volatileStateFields: ["lastChangedAt"]
25770
26268
  };
25771
26269
  /**
25772
26270
  * One publishable camera stream as its OWNING PROVIDER describes it — the same
@@ -25952,7 +26450,17 @@ var streamParamsCapability = {
25952
26450
  schema: StreamParamsStatusSchema,
25953
26451
  kind: "poll"
25954
26452
  },
25955
- runtimeState: StreamParamsStatusSchema
26453
+ runtimeState: StreamParamsStatusSchema,
26454
+ /**
26455
+ * Runtime-state durability: **restored** — operator-set encoder profile; mutation-driven.
26456
+ *
26457
+ * See `RuntimeStateDurability`. Enforced by
26458
+ * `scripts/check-runtime-state-durability.ts`.
26459
+ */
26460
+ durability: "restored",
26461
+ /** Clock fields: written, but excluded from the compare that decides
26462
+ * whether persisting is worth a SQLite commit. */
26463
+ volatileStateFields: ["lastFetchedAt"]
25956
26464
  };
25957
26465
  /**
25958
26466
  * The three well-known stream profiles in render order. Exported so the
@@ -26196,6 +26704,16 @@ var switchCapability = {
26196
26704
  * not need to re-query the provider after a setState mutation.
26197
26705
  */
26198
26706
  runtimeState: SwitchStatusSchema,
26707
+ /**
26708
+ * Runtime-state durability: **restored** — device state an operator reads as authoritative; 55 devices, transition-driven.
26709
+ *
26710
+ * See `RuntimeStateDurability`. Enforced by
26711
+ * `scripts/check-runtime-state-durability.ts`.
26712
+ */
26713
+ durability: "restored",
26714
+ /** Clock fields: written, but excluded from the compare that decides
26715
+ * whether persisting is worth a SQLite commit. */
26716
+ volatileStateFields: ["lastChangedAt"],
26199
26717
  settings: { bindings: [{
26200
26718
  kind: "scalar",
26201
26719
  statusPath: "on",
@@ -26275,7 +26793,17 @@ var tamperCapability = {
26275
26793
  schema: TamperStatusSchema,
26276
26794
  kind: "push"
26277
26795
  },
26278
- runtimeState: TamperStatusSchema
26796
+ runtimeState: TamperStatusSchema,
26797
+ /**
26798
+ * Runtime-state durability: **restored** — as `smoke`.
26799
+ *
26800
+ * See `RuntimeStateDurability`. Enforced by
26801
+ * `scripts/check-runtime-state-durability.ts`.
26802
+ */
26803
+ durability: "restored",
26804
+ /** Clock fields: written, but excluded from the compare that decides
26805
+ * whether persisting is worth a SQLite commit. */
26806
+ volatileStateFields: ["lastChangedAt"]
26279
26807
  };
26280
26808
  /**
26281
26809
  * Single-metric temperature reading. Drives Home Assistant `sensor`
@@ -26320,7 +26848,17 @@ var temperatureSensorCapability = {
26320
26848
  schema: TemperatureSensorStatusSchema,
26321
26849
  kind: "push"
26322
26850
  },
26323
- runtimeState: TemperatureSensorStatusSchema
26851
+ runtimeState: TemperatureSensorStatusSchema,
26852
+ /**
26853
+ * Runtime-state durability: **restored** — as `numeric-sensor` (69 of 125 writes were the clock alone).
26854
+ *
26855
+ * See `RuntimeStateDurability`. Enforced by
26856
+ * `scripts/check-runtime-state-durability.ts`.
26857
+ */
26858
+ durability: "restored",
26859
+ /** Clock fields: written, but excluded from the compare that decides
26860
+ * whether persisting is worth a SQLite commit. */
26861
+ volatileStateFields: ["lastFetchedAt"]
26324
26862
  };
26325
26863
  /**
26326
26864
  * toast — system-scoped singleton capability that streams toast
@@ -26389,7 +26927,14 @@ var updateCapability = {
26389
26927
  schema: UpdateStatusSchema,
26390
26928
  kind: "poll"
26391
26929
  },
26392
- runtimeState: UpdateStatusSchema
26930
+ runtimeState: UpdateStatusSchema,
26931
+ /**
26932
+ * Runtime-state durability: **session** — a restored `inProgress: true` describes an update that is no longer running; versions are re-probed at boot.
26933
+ *
26934
+ * See `RuntimeStateDurability`. Enforced by
26935
+ * `scripts/check-runtime-state-durability.ts`.
26936
+ */
26937
+ durability: "session"
26393
26938
  };
26394
26939
  var UserSummarySchema = object({
26395
26940
  id: string(),
@@ -26723,7 +27268,14 @@ var vacuumControlCapability = {
26723
27268
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26724
27269
  * slice for live state + battery + fan-speed changes.
26725
27270
  */
26726
- runtimeState: VacuumControlStatusSchema
27271
+ runtimeState: VacuumControlStatusSchema,
27272
+ /**
27273
+ * Runtime-state durability: **session** — as `media-player` — a restored `state: cleaning` is a robot that is not cleaning.
27274
+ *
27275
+ * See `RuntimeStateDurability`. Enforced by
27276
+ * `scripts/check-runtime-state-durability.ts`.
27277
+ */
27278
+ durability: "session"
26727
27279
  };
26728
27280
  var ValveStatusSchema = object({
26729
27281
  /** Lifecycle state of the valve. */
@@ -26775,7 +27327,14 @@ var valveCapability = {
26775
27327
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26776
27328
  * slice for live position changes during a move.
26777
27329
  */
26778
- runtimeState: ValveStatusSchema
27330
+ runtimeState: ValveStatusSchema,
27331
+ /**
27332
+ * Runtime-state durability: **session** — as `brightness`.
27333
+ *
27334
+ * See `RuntimeStateDurability`. Enforced by
27335
+ * `scripts/check-runtime-state-durability.ts`.
27336
+ */
27337
+ durability: "session"
26779
27338
  };
26780
27339
  /**
26781
27340
  * Vibration / shake / impact sensor. Drives Home Assistant
@@ -26797,7 +27356,17 @@ var vibrationCapability = {
26797
27356
  schema: VibrationStatusSchema,
26798
27357
  kind: "push"
26799
27358
  },
26800
- runtimeState: VibrationStatusSchema
27359
+ runtimeState: VibrationStatusSchema,
27360
+ /**
27361
+ * Runtime-state durability: **restored** — as `smoke`.
27362
+ *
27363
+ * See `RuntimeStateDurability`. Enforced by
27364
+ * `scripts/check-runtime-state-durability.ts`.
27365
+ */
27366
+ durability: "restored",
27367
+ /** Clock fields: written, but excluded from the compare that decides
27368
+ * whether persisting is worth a SQLite commit. */
27369
+ volatileStateFields: ["lastChangedAt"]
26801
27370
  };
26802
27371
  /**
26803
27372
  * Water heater / boiler cap. Models HA `water_heater.*` entities — a
@@ -26871,7 +27440,14 @@ var waterHeaterCapability = {
26871
27440
  * Runtime-state slice — mirrored by the kernel. UI controls watch the
26872
27441
  * slice for live temperature / mode / away changes.
26873
27442
  */
26874
- runtimeState: WaterHeaterStatusSchema
27443
+ runtimeState: WaterHeaterStatusSchema,
27444
+ /**
27445
+ * Runtime-state durability: **session** — as `climate-control`.
27446
+ *
27447
+ * See `RuntimeStateDurability`. Enforced by
27448
+ * `scripts/check-runtime-state-durability.ts`.
27449
+ */
27450
+ durability: "session"
26875
27451
  };
26876
27452
  /**
26877
27453
  * Weather provider cap. Models HA `weather.*` entities — a read-only
@@ -26930,7 +27506,14 @@ var weatherCapability = {
26930
27506
  * Runtime-state slice — mirrored by the kernel. The UI reads the
26931
27507
  * current conditions directly from the slice on each weather push.
26932
27508
  */
26933
- runtimeState: WeatherStatusSchema
27509
+ runtimeState: WeatherStatusSchema,
27510
+ /**
27511
+ * Runtime-state durability: **session** — a forecast is stale the moment the hub is down; the provider re-fetches on connect.
27512
+ *
27513
+ * See `RuntimeStateDurability`. Enforced by
27514
+ * `scripts/check-runtime-state-durability.ts`.
27515
+ */
27516
+ durability: "session"
26934
27517
  };
26935
27518
  /**
26936
27519
  * Per-zone occupancy aggregation produced by the analytics frame
@@ -27092,7 +27675,14 @@ var zoneAnalyticsCapability = {
27092
27675
  * automatically; the explicit `getCurrentSnapshot` cap method is
27093
27676
  * still useful for one-off polls without a subscription.
27094
27677
  */
27095
- runtimeState: CameraOccupancySnapshotSchema
27678
+ runtimeState: CameraOccupancySnapshotSchema,
27679
+ /**
27680
+ * Runtime-state durability: **session** — per-frame analytics; with `audio-metrics` it is ~90 % of the offered write rate. Re-derived on the next frame.
27681
+ *
27682
+ * See `RuntimeStateDurability`. Enforced by
27683
+ * `scripts/check-runtime-state-durability.ts`.
27684
+ */
27685
+ durability: "session"
27096
27686
  };
27097
27687
  /**
27098
27688
  * Stages a {@link ZoneRule} can apply to. Discriminator on the rules
@@ -27170,7 +27760,14 @@ var zoneRulesCapability = {
27170
27760
  motion: array(ZoneRuleSchema).readonly(),
27171
27761
  detection: array(ZoneRuleSchema).readonly(),
27172
27762
  package: array(ZoneRuleSchema).readonly()
27173
- })
27763
+ }),
27764
+ /**
27765
+ * Runtime-state durability: **restored** — operator intent, mutation-only, same argument as `zones`.
27766
+ *
27767
+ * See `RuntimeStateDurability`. Enforced by
27768
+ * `scripts/check-runtime-state-durability.ts`.
27769
+ */
27770
+ durability: "restored"
27174
27771
  };
27175
27772
  /**
27176
27773
  * Accessory device helpers — shared across drivers.
@@ -33988,6 +34585,7 @@ Object.freeze({
33988
34585
  "network-access": "ingress",
33989
34586
  "smtp-provider": "email"
33990
34587
  });
34588
+ new Map(AUDIO_MACRO_LABELS.flatMap((macro) => macro.icon === void 0 ? [] : [[macro.id, macro.icon]]));
33991
34589
  new Set(["devices", "classes"]);
33992
34590
  /**
33993
34591
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
@@ -34265,25 +34863,32 @@ object({
34265
34863
  var NativeLeaseAdmissionSchema = _enum(["all", "inferred"]);
34266
34864
  object({
34267
34865
  /**
34268
- * How long a retained native frame is served before it counts as a miss.
34866
+ * How many delivered frames the worker HOLDS at once, waiting for each one's
34867
+ * detection result.
34269
34868
  *
34270
- * Must cover the FULL late-crop horizon: detection inference + the
34271
- * cross-process inference-result hop to hub post-analysis + tracking + the
34272
- * tRPC crop round-trip back. Below ~500 ms the busiest cameras' subject crops
34273
- * outrun it and fall back to the ≤640 detection frame; above ~3 s the resident
34274
- * RAM per busy camera grows linearly with no measured hit-rate gain.
34869
+ * This replaced a TTL on 2026-08-13, and the replacement is the whole point:
34870
+ * a time window was never related to the event the pixels were waiting for.
34871
+ * A held frame now lives from delivery until the runner has its `FrameResult`
34872
+ * at which moment the runner cuts the subject tiles it actually wanted and
34873
+ * releases the frame. The bound exists only so a runner that stops answering
34874
+ * cannot pin RAM: above it the OLDEST held frame is dropped and counted.
34875
+ *
34876
+ * Sizing: the steady state is `inferenceLatency × deliveredFps`, measured at
34877
+ * 40-160 ms × ≤25 fps = 1-4 frames. The default leaves headroom for a hiccup
34878
+ * without ever approaching the old resident set (43 frames × 24.9 MB at 4K).
34879
+ * Raising it does not buy hit rate — it buys tolerance for a slow runner, and
34880
+ * `holdOverflow` on the metrics line is what says you need it.
34275
34881
  */
34276
- ttlMs: number().int().min(250).max(1e4),
34882
+ holdFrames: number().int().min(1).max(64),
34277
34883
  /**
34278
34884
  * Hard per-decode-worker RAM ceiling for retained native frames, in MB.
34279
34885
  *
34280
- * Intended as a SAFETY ceiling with the TTL as the effective cap — but check
34281
- * which one is actually binding before reasoning from that. At the shipped
34282
- * 1024 MB and a 2 800 ms TTL, a 4K camera hits the CEILING first (~43 frames
34283
- * at ~24 MB each) and the TTL never gets to expire anything; `leaseMb` /
34284
- * `leaseFrames` on the metrics line say which. When the ceiling binds, a
34285
- * change that admits fewer frames buys retention WINDOW at constant RAM
34286
- * rather than giving RAM back — lower this knob if RAM is what you wanted.
34886
+ * Since 2026-08-13 this is a SAFETY ceiling and nothing else: `holdFrames`
34887
+ * is what decides how much is held, and the ceiling is the number above which
34888
+ * something is wrong. Before that it was the effective cap at 1024 MB with
34889
+ * a 2 800 ms TTL a 4K camera sat pinned at `leaseMb:1020, leaseFrames:43`
34890
+ * with the TTL expiring nothing, which is exactly the confusion the hold
34891
+ * removes. `leaseMb` / `leaseFrames` still say what is resident.
34287
34892
  * `0` DISABLES the lease entirely and falls the worker back to the tiny
34288
34893
  * leak-prone GPU surface ring (~85% crop miss; that is what the lease exists
34289
34894
  * to replace).
@@ -34309,22 +34914,45 @@ object({
34309
34914
  * there is the signal that some caller names frames outside the inference set
34310
34915
  * and that this must go back to `all`.
34311
34916
  */
34312
- admission: NativeLeaseAdmissionSchema
34917
+ admission: NativeLeaseAdmissionSchema,
34918
+ /**
34919
+ * RAM ceiling per decode worker, in MB, for the SUBJECT TILES — the
34920
+ * compressed native crops the worker cuts at the moment a frame's detection
34921
+ * result arrives, and keeps long after the frame itself is freed.
34922
+ *
34923
+ * This is the knob that replaced the old retention window, and it buys about
34924
+ * three orders of magnitude more of it: a tile is one subject at native
34925
+ * resolution, JPEG-encoded (~60-120 KB on a 4K person), against ~24.9 MB for
34926
+ * the frame it was cut from. A frame on which nothing was detected costs
34927
+ * nothing at all, which is the real change — the old lease paid per FRAME and
34928
+ * was interrogated per SUBJECT.
34929
+ *
34930
+ * `0` DISABLES tiles, leaving only the hold window and the ≤640 RAM
34931
+ * fallback — i.e. the pre-2026-08-13 miss profile. Set it there only to
34932
+ * reproduce that.
34933
+ */
34934
+ tileBudgetMb: number().int().min(0).max(1024)
34313
34935
  });
34314
34936
  /**
34315
- * The values in force when the operator has set nothing — byte-for-byte the
34316
- * constants the decode worker shipped with as env-var defaults, so making these
34317
- * settings changed no behaviour on the day it landed.
34937
+ * The values in force when the operator has set nothing.
34938
+ *
34939
+ * `budgetMb` stays at 1024 on the day the hold landed, deliberately: it stopped
34940
+ * being the retention window and became the OOM ceiling, and lowering a ceiling
34941
+ * in the same change that redefines it would make a regression and a retune
34942
+ * indistinguishable. Cut it once `tileHits` / `holdOverflow` have been read on
34943
+ * live traffic.
34318
34944
  */
34319
34945
  var DEFAULT_NATIVE_LEASE_SETTINGS = {
34320
- ttlMs: 1200,
34946
+ holdFrames: 8,
34321
34947
  budgetMb: 1024,
34322
34948
  activityMs: 15e3,
34949
+ tileBudgetMb: 64,
34323
34950
  admission: "inferred"
34324
34951
  };
34325
- DEFAULT_NATIVE_LEASE_SETTINGS.ttlMs;
34952
+ DEFAULT_NATIVE_LEASE_SETTINGS.holdFrames;
34326
34953
  DEFAULT_NATIVE_LEASE_SETTINGS.budgetMb;
34327
34954
  DEFAULT_NATIVE_LEASE_SETTINGS.activityMs;
34955
+ DEFAULT_NATIVE_LEASE_SETTINGS.tileBudgetMb;
34328
34956
  DEFAULT_NATIVE_LEASE_SETTINGS.admission;
34329
34957
  //#endregion
34330
34958
  //#region src/digest-auth.ts