@camstack/addon-provider-dreo 0.2.13 → 0.2.14

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 +625 -22
  2. package/dist/addon.mjs +625 -22
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -7242,8 +7242,31 @@ var AdoptionJobSchema = object({
7242
7242
  error: string().nullable()
7243
7243
  });
7244
7244
  /**
7245
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7246
- * pipeline functions an operator thinks in terms of.
7245
+ * Per-camera FUNCTION SWITCHES.
7246
+ *
7247
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7248
+ *
7249
+ * This file shipped as "the one coherent on/off surface over the pipeline
7250
+ * functions an operator thinks in terms of". The operator's verdict on
7251
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7252
+ * every function already had a settings page of its own, and a second place to
7253
+ * turn it off is a second place to look. Each switch is going back to its own
7254
+ * component's original options — detection to the detection-pipeline wrapper
7255
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7256
+ * (which was always first-class; the switch was a veneer over
7257
+ * `recording.setDeviceConfig`), notifications to a notification-center
7258
+ * per-device setting, the two camera planes to their own components.
7259
+ *
7260
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7261
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7262
+ * straight from the authorities with no group in the middle. That rule was
7263
+ * never about a control panel.
7264
+ *
7265
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7266
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7267
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7268
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7269
+ * stop; nothing new may be built on it.
7247
7270
  *
7248
7271
  * ## This file adds no state
7249
7272
  *
@@ -7594,7 +7617,15 @@ var RecordingConfigSchema = object({
7594
7617
  * Each completed/failed run also lands one durable ops-log row on its owning
7595
7618
  * addon surface.
7596
7619
  */
7620
+ /**
7621
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7622
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7623
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7624
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7625
+ * runs at all.
7626
+ */
7597
7627
  var RelocateJobStateSchema = _enum([
7628
+ "queued",
7598
7629
  "running",
7599
7630
  "done",
7600
7631
  "failed",
@@ -7629,6 +7660,15 @@ var RelocateFootageInputSchema = object({
7629
7660
  /** Limits relocation to the logical profile class. Omit only for the
7630
7661
  * pre-orchestration compatibility path. */
7631
7662
  footageClass: RelocateFootageClassSchema.optional(),
7663
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7664
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7665
+ * unit is a (camera, profile) pile, not a disk. */
7666
+ deviceId: number().int().optional(),
7667
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7668
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7669
+ * placement plan assigns those two independently, so a rebalance that could
7670
+ * only say "recordings" would move footage the plan never asked to move. */
7671
+ profiles: array(string()).optional(),
7632
7672
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7633
7673
  * never allowed to starve live writers. */
7634
7674
  throttleMbps: number().min(1).max(1e3).optional()
@@ -7764,6 +7804,21 @@ var StorageLocationSchema = object({
7764
7804
  nodeId: string().optional(),
7765
7805
  isDefault: boolean().default(false),
7766
7806
  isSystem: boolean().default(false),
7807
+ /**
7808
+ * Operator opt-in: whether consumers that BALANCE across several locations
7809
+ * of a type may write here. Recordings reads it today; event media and
7810
+ * backups are the next consumers, which is why the flag lives on the
7811
+ * location rather than in any one addon's store — nothing has to be
7812
+ * extended to add the next consumer.
7813
+ *
7814
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7815
+ * flag existed reads back with no flag and keeps working exactly as before;
7816
+ * that is the whole compat story, and it is why no migration ships with it.
7817
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7818
+ * disk must not silently start writing to it); the default of a type is
7819
+ * always stamped `true`.
7820
+ */
7821
+ enabled: boolean().optional(),
7767
7822
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7768
7823
  * for node-local locations it can reach) — never persisted, absent when the
7769
7824
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12333,7 +12388,8 @@ method(object({
12333
12388
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12334
12389
  /**
12335
12390
  * filesystem-browse — per-node capability for browsing the node's local
12336
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12391
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12392
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12337
12393
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12338
12394
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12339
12395
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -14174,6 +14230,13 @@ var MaskGridDimsSchema = object({
14174
14230
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
14175
14231
  * this one field keeps the schema additive — a rule still declares exactly
14176
14232
  * one trigger.
14233
+ *
14234
+ * AUDIO rules add no member here, for the reason occupancy added none: the
14235
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
14236
+ * mirror.ts` fails the build on a member the app cannot render) and every
14237
+ * member costs a release train. A sustained-sound rule is therefore an
14238
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
14239
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
14177
14240
  */
14178
14241
  var NcDeliverySchema = _enum([
14179
14242
  "immediate",
@@ -14188,15 +14251,32 @@ var NcDeliverySchema = _enum([
14188
14251
  * depend on a provider's raw event name or payload shape.
14189
14252
  */
14190
14253
  var NcSystemEventKindSchema = _enum([
14191
- "camera-online",
14192
- "camera-offline",
14254
+ "device-online",
14255
+ "device-offline",
14256
+ "device-disabled",
14257
+ "device-enabled",
14193
14258
  "stream-online",
14194
14259
  "stream-offline",
14195
14260
  "node-online",
14196
14261
  "node-offline",
14197
14262
  "addon-update-available",
14198
- "server-update-available"
14263
+ "server-update-available",
14264
+ "alarm-triggered",
14265
+ "alarm-armed",
14266
+ "alarm-disarmed",
14267
+ "camera-online",
14268
+ "camera-offline",
14269
+ "camera-disabled",
14270
+ "camera-enabled"
14271
+ ]);
14272
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14273
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14274
+ "camera-online",
14275
+ "camera-offline",
14276
+ "camera-disabled",
14277
+ "camera-enabled"
14199
14278
  ]);
14279
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
14200
14280
  /**
14201
14281
  * One coherent system-event condition. `kinds` is the required opt-in safety
14202
14282
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -14205,6 +14285,18 @@ var NcSystemEventKindSchema = _enum([
14205
14285
  var NcSystemEventConditionSchema = object({
14206
14286
  kinds: array(NcSystemEventKindSchema).min(1),
14207
14287
  deviceIds: array(number().int()).min(1).optional(),
14288
+ /**
14289
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14290
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14291
+ * is what a liveness rule means when nobody said otherwise.
14292
+ *
14293
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14294
+ * one reason: the intake cannot know which devices this household cares
14295
+ * about, and a producer-side filter is one no operator can change. Fails
14296
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14297
+ * does not carry) matches no `deviceTypes` list.
14298
+ */
14299
+ deviceTypes: array(string().min(1)).min(1).optional(),
14208
14300
  nodeIds: array(string().min(1)).min(1).optional(),
14209
14301
  packageNames: array(string().min(1)).min(1).optional()
14210
14302
  });
@@ -14255,6 +14347,47 @@ var NcOccupancyConditionSchema = object({
14255
14347
  sustainSeconds: number().int().min(0).max(3600).default(15)
14256
14348
  });
14257
14349
  /**
14350
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14351
+ *
14352
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14353
+ * reference notifier uses, so an operator moving between them re-uses what
14354
+ * they already know): a rule matches when, over a sampling window of
14355
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14356
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14357
+ *
14358
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14359
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14360
+ * - `labels` — the classifier put at least one of these labels on it.
14361
+ *
14362
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14363
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14364
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14365
+ * is given** — a window in which every sample is trivially a hit would fire on
14366
+ * silence, so the engine refuses such a condition rather than notifying on
14367
+ * nothing (the schema cannot express "at least one of" without becoming a
14368
+ * ZodEffects the cap path would have to special-case).
14369
+ *
14370
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14371
+ * must be FULL before it can match — a window that has been open for two
14372
+ * seconds of its ten is 100% of nothing, and firing on it would make
14373
+ * `samplingSeconds` decorative.
14374
+ *
14375
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14376
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14377
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14378
+ * an operator who typed `dog` mean the same thing.
14379
+ */
14380
+ var NcAudioConditionSchema = object({
14381
+ /** Audio macro labels; absent = any sound (level-only rule). */
14382
+ labels: array(string().min(1)).min(1).optional(),
14383
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14384
+ dbThreshold: number().min(-96).max(0).optional(),
14385
+ /** Percentage of the window's samples that must be hits (1–100). */
14386
+ hitPercent: number().int().min(1).max(100).default(60),
14387
+ /** Length of the sampling window in seconds. */
14388
+ samplingSeconds: number().int().min(1).max(300).default(10)
14389
+ });
14390
+ /**
14258
14391
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
14259
14392
  *
14260
14393
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14527,7 +14660,33 @@ var NcConditionsSchema = object({
14527
14660
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14528
14661
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14529
14662
  */
14530
- occupancy: NcOccupancyConditionSchema.optional()
14663
+ occupancy: NcOccupancyConditionSchema.optional(),
14664
+ /**
14665
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14666
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14667
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14668
+ * a window that is not full yet, neither filter given). See
14669
+ * {@link NcAudioCondition}.
14670
+ *
14671
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14672
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14673
+ * a detection, a track or a device event (the same fail-closed pairing
14674
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14675
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14676
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14677
+ * classified sample) stays exactly as it was for rules that already use it.
14678
+ *
14679
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14680
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14681
+ * (`camstack/src/data/notification-center.ts`, guarded by
14682
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14683
+ * condition fields it does not know when a rule is saved from the phone.
14684
+ * Publishing an editor for a condition the app cannot round-trip is how an
14685
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14686
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14687
+ * does an audio rule become authorable.
14688
+ */
14689
+ audio: NcAudioConditionSchema.optional()
14531
14690
  });
14532
14691
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14533
14692
  var NcRuleTargetSchema = object({
@@ -14641,6 +14800,73 @@ var NcThrottleSchema = object({
14641
14800
  */
14642
14801
  granularity: NcThrottleGranularitySchema.optional()
14643
14802
  });
14803
+ /**
14804
+ * How long the confirm gate may hold ONE notification, and how big the picture
14805
+ * it judges may be.
14806
+ *
14807
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14808
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14809
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14810
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14811
+ * tokens for pixels the model pools away.
14812
+ */
14813
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14814
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14815
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14816
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14817
+ var NcConfirmExpectSchema = object({
14818
+ op: _enum([
14819
+ ">=",
14820
+ ">",
14821
+ "<=",
14822
+ "<",
14823
+ "=="
14824
+ ]),
14825
+ count: number().int().min(0).max(1e3)
14826
+ });
14827
+ /**
14828
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14829
+ * to ship and says whether it agrees with the rule.
14830
+ *
14831
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14832
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14833
+ * on the operator's phone is not a verdict about this notification.
14834
+ *
14835
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14836
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14837
+ * the default and every fail-open is COUNTED, because a gate that always fails
14838
+ * open looks in the log exactly like a gate that works.
14839
+ *
14840
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14841
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14842
+ * production failures in one day), so the gate reads absent as the constant
14843
+ * above rather than trusting a parse it may never have seen.
14844
+ */
14845
+ var NcConfirmSchema = object({
14846
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14847
+ * same thing, and both mean "deliver exactly as before". */
14848
+ enabled: boolean().default(false),
14849
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14850
+ profileId: string().optional(),
14851
+ /**
14852
+ * The operator's question, in his own words. Absent = a question derived
14853
+ * from the rule (its class and its expectation).
14854
+ *
14855
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14856
+ * banners, signage and plates as instructions if you let them reach the
14857
+ * prompt — proven live — so the authoritative contract stays in the system
14858
+ * turn and only rule-authored words land here.
14859
+ */
14860
+ prompt: string().max(1e3).optional(),
14861
+ /** Fire only when the model's count satisfies this. Absent = the model's
14862
+ * own boolean verdict decides. */
14863
+ expect: NcConfirmExpectSchema.optional(),
14864
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14865
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14866
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14867
+ /** Longest edge the judged image is downscaled to before it is sent. */
14868
+ maxImagePx: number().int().min(64).max(2048).default(448)
14869
+ });
14644
14870
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14645
14871
  var NcRuleInputSchema = object({
14646
14872
  name: string().min(1).max(200),
@@ -14701,7 +14927,13 @@ var NcRuleInputSchema = object({
14701
14927
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14702
14928
  * shape as every other actuation.
14703
14929
  */
14704
- actions: NcRuleActionsSchema.optional()
14930
+ actions: NcRuleActionsSchema.optional(),
14931
+ /**
14932
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14933
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14934
+ * did, and absent is the only way to say that without a migration.
14935
+ */
14936
+ confirm: NcConfirmSchema.optional()
14705
14937
  });
14706
14938
  /**
14707
14939
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14712,7 +14944,37 @@ var NcRuleInputSchema = object({
14712
14944
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14713
14945
  * `updateRule` patch.
14714
14946
  */
14715
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
14947
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14948
+ disabledTargetIds: array(string()).optional(),
14949
+ /**
14950
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14951
+ *
14952
+ * It makes the key optional to SUPPLY; the parse still materialises the
14953
+ * default when the key is absent. And `NcRuleStore.update` merges with
14954
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14955
+ * one — which made every partial edit destructive:
14956
+ *
14957
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14958
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14959
+ * setEnabled(ruleId, false) → conditions reset to `{}`
14960
+ *
14961
+ * A rule scoped to one camera and one zone silently became a rule that
14962
+ * matches EVERY event on EVERY camera, and lost its `media` policy
14963
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
14964
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
14965
+ * within a minute of a two-field patch.
14966
+ *
14967
+ * So every defaulted field is re-declared here WITHOUT its default. The
14968
+ * inner defaults still apply when the caller DOES send the key — `{}` for
14969
+ * conditions remains a real instruction ("clear them") — and only the
14970
+ * absent key is now genuinely absent.
14971
+ */
14972
+ enabled: boolean().optional(),
14973
+ conditions: NcConditionsSchema.optional(),
14974
+ media: NcMediaPolicySchema.optional(),
14975
+ throttle: NcThrottleSchema.optional(),
14976
+ priority: number().int().min(1).max(5).optional()
14977
+ });
14716
14978
  /** A persisted rule. */
14717
14979
  var NcRuleSchema = NcRuleInputSchema.extend({
14718
14980
  id: string(),
@@ -15013,6 +15275,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
15013
15275
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
15014
15276
  * copy would lie the first time a rule is disabled.
15015
15277
  */
15278
+ /**
15279
+ * Why a device a mode NAMES is nonetheless not armed by it.
15280
+ *
15281
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15282
+ * per-camera notification switch the Notification Center already owns,
15283
+ * `detection-off` is the device's own detection binding being inactive, and
15284
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15285
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15286
+ * with the switches the operator actually used.
15287
+ */
15288
+ var NcAlarmSkipReasonSchema = _enum([
15289
+ "muted",
15290
+ "detection-off",
15291
+ "offline"
15292
+ ]);
15293
+ var NcAlarmSkippedDeviceSchema = object({
15294
+ deviceId: number().int(),
15295
+ reason: NcAlarmSkipReasonSchema
15296
+ });
15016
15297
  var NcAlarmModeCoverageSchema = object({
15017
15298
  mode: AlarmArmModeSchema,
15018
15299
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -15020,7 +15301,18 @@ var NcAlarmModeCoverageSchema = object({
15020
15301
  /** At least one covering rule has no device scope, so the mode covers all. */
15021
15302
  allDevices: boolean(),
15022
15303
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
15023
- deviceIds: array(number().int())
15304
+ deviceIds: array(number().int()),
15305
+ /**
15306
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15307
+ * excludes it.
15308
+ *
15309
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15310
+ * twelve makes it false in exactly the way nobody notices until an incident.
15311
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15312
+ * still parses as "nothing known to be skipped" rather than failing the whole
15313
+ * alarm tab.
15314
+ */
15315
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
15024
15316
  });
15025
15317
  var NcAlarmConfigSchema = object({
15026
15318
  /**
@@ -17852,9 +18144,16 @@ var CameraStatusSchema = object({
17852
18144
  audio: CameraAudioStatusSchema.nullable(),
17853
18145
  recording: CameraRecordingStatusSchema.nullable(),
17854
18146
  /**
17855
- * Per-camera function switches an OPERATOR has turned off
18147
+ * Per-camera functions an OPERATOR has turned off
17856
18148
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17857
18149
  *
18150
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
18151
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
18152
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
18153
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
18154
+ * The badge outlives the control panel: the panel was a convenience, this is
18155
+ * the difference between a camera being off and a camera being dead.
18156
+ *
17858
18157
  * This is the difference between DISABLED and BROKEN. A camera whose
17859
18158
  * `detection` block reports zero fps and whose `switchedOff` contains
17860
18159
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -24604,7 +24903,19 @@ var RecordingManifestSchema = object({
24604
24903
  * profiles/subtrees/locations on this node). */
24605
24904
  var RecordingDeviceUsageSchema = object({
24606
24905
  deviceId: number(),
24607
- usedBytes: number()
24906
+ usedBytes: number(),
24907
+ /**
24908
+ * Start of this camera's OLDEST indexed segment, across every profile and
24909
+ * location — the "Oldest footage" column in Recordings → Storage, and the
24910
+ * only honest answer to "is retention actually holding?" per camera.
24911
+ *
24912
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
24913
+ * predates this field omits it entirely, and a hub whose types carry the
24914
+ * field must keep validating that older provider's payload: the framework
24915
+ * (types) and the addon ship on different trains, and the addon is usually
24916
+ * the later of the two.
24917
+ */
24918
+ oldestMs: number().nullable().optional()
24608
24919
  });
24609
24920
  /** Recording storage usage + capacity for one storage location. */
24610
24921
  var RecordingLocationUsageSchema = object({
@@ -24632,6 +24943,57 @@ var RecordingStorageUsageSchema = object({
24632
24943
  locations: array(RecordingLocationUsageSchema)
24633
24944
  });
24634
24945
  /**
24946
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
24947
+ *
24948
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
24949
+ * is the operator asking for the EXISTING archive to be brought into line with
24950
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
24951
+ * location, run FIFO behind the single-flight mover.
24952
+ *
24953
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
24954
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
24955
+ * (empty on the plan).
24956
+ */
24957
+ var RecordingRebalanceMoveSchema = object({
24958
+ deviceId: number(),
24959
+ profile: string(),
24960
+ fromLocationId: string(),
24961
+ toLocationId: string(),
24962
+ bytes: number(),
24963
+ files: number().int()
24964
+ });
24965
+ /** Why a pile that is out of place is staying there. Every refusal is
24966
+ * reported: a rebalance that silently drops a camera reads exactly like one
24967
+ * that had nothing to do. */
24968
+ var RecordingRebalanceSkipReasonSchema = _enum([
24969
+ "unassigned",
24970
+ "target-not-writable",
24971
+ "below-threshold",
24972
+ "no-headroom"
24973
+ ]);
24974
+ var RecordingRebalanceSkipSchema = object({
24975
+ deviceId: number(),
24976
+ profile: string(),
24977
+ fromLocationId: string(),
24978
+ /** The location the plan wants; null when the camera has no assignment. */
24979
+ toLocationId: string().nullable(),
24980
+ bytes: number(),
24981
+ reason: RecordingRebalanceSkipReasonSchema
24982
+ });
24983
+ var RecordingRebalancePlanSchema = object({
24984
+ moves: array(RecordingRebalanceMoveSchema),
24985
+ skipped: array(RecordingRebalanceSkipSchema),
24986
+ bytesToMove: number(),
24987
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
24988
+ jobIds: array(string())
24989
+ });
24990
+ var RecordingRebalanceInputSchema = object({
24991
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
24992
+ throttleMbps: number().min(1).max(1e3).optional(),
24993
+ /** Ignore piles smaller than this (default 1 GB). */
24994
+ minMoveGb: number().min(0).optional()
24995
+ });
24996
+ /**
24635
24997
  * Result of locating footage at a wall-clock instant for one device/profile.
24636
24998
  * `segment` carries the covering segment's window; `gap` reports the forward
24637
24999
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -24794,9 +25156,24 @@ method(object({
24794
25156
  }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24795
25157
  kind: "mutation",
24796
25158
  auth: "admin"
25159
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
25160
+ kind: "mutation",
25161
+ auth: "admin"
25162
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
25163
+ kind: "query",
25164
+ auth: "admin"
25165
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
25166
+ kind: "mutation",
25167
+ auth: "admin"
25168
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25169
+ kind: "query",
25170
+ auth: "admin"
25171
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25172
+ kind: "mutation",
25173
+ auth: "admin"
24797
25174
  });
24798
25175
  /**
24799
- * `recordingExport` cap — render a footage time range into a single downloadable
25176
+ * `recording-export` cap — render a footage time range into a single downloadable
24800
25177
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
24801
25178
  * bounded lifetime with a durable history, auto-expiry, and optional
24802
25179
  * delete-after-download.
@@ -24811,10 +25188,42 @@ method(object({
24811
25188
  */
24812
25189
  /** Playback-speed multiplier for the render (1 = realtime). */
24813
25190
  var ExportSpeedSchema = number().min(.25).max(32);
25191
+ /**
25192
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25193
+ *
25194
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
25195
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25196
+ * playlist. Handing it absolute epochs would make every call site responsible
25197
+ * for the same subtraction, and the one that forgot would emit a filter that
25198
+ * selects nothing — silently, as a uniform timelapse.
25199
+ */
25200
+ var ExportDenseRangeSchema = object({
25201
+ fromSec: number().nonnegative(),
25202
+ toSec: number().nonnegative()
25203
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
25204
+ /**
25205
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
25206
+ * listed ranges and at the base `everyMs` everywhere else.
25207
+ *
25208
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
25209
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
25210
+ */
25211
+ var ExportDenseSchema = object({
25212
+ everyMs: number().int().positive(),
25213
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
25214
+ });
24814
25215
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
24815
25216
  var ExportTimelapseSchema = object({
24816
25217
  everyMs: number().int().positive(),
24817
- outputFps: number().int().min(1).max(60).optional()
25218
+ outputFps: number().int().min(1).max(60).optional(),
25219
+ /** Optional second, FASTER rate over the intervals that matter. */
25220
+ dense: ExportDenseSchema.optional()
25221
+ }).superRefine((v, ctx) => {
25222
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
25223
+ code: ZodIssueCode.custom,
25224
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
25225
+ path: ["dense", "everyMs"]
25226
+ });
24818
25227
  });
24819
25228
  /**
24820
25229
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -24872,6 +25281,19 @@ var ExportDownloadSchema = object({
24872
25281
  url: string(),
24873
25282
  endpoints: array(string())
24874
25283
  });
25284
+ /**
25285
+ * A finished export's bytes, inline.
25286
+ *
25287
+ * `bytes` is the DECODED length — the number the caller bounds and logs
25288
+ * against, so nobody has to infer it from the base64 length.
25289
+ */
25290
+ var ExportBytesSchema = object({
25291
+ base64: string(),
25292
+ contentType: string(),
25293
+ /** Suggested filename, extension included. */
25294
+ name: string(),
25295
+ bytes: number().int().nonnegative()
25296
+ });
24875
25297
  method(object({
24876
25298
  deviceId: number(),
24877
25299
  profile: string(),
@@ -24896,6 +25318,9 @@ method(object({
24896
25318
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
24897
25319
  kind: "query",
24898
25320
  auth: "protected"
25321
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
25322
+ kind: "query",
25323
+ auth: "protected"
24899
25324
  });
24900
25325
  /**
24901
25326
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -31573,6 +31998,12 @@ Object.freeze({
31573
31998
  addonId: null,
31574
31999
  access: "create"
31575
32000
  },
32001
+ "recording.cancelRelocateJob": {
32002
+ capName: "recording",
32003
+ capScope: "system",
32004
+ addonId: null,
32005
+ access: "create"
32006
+ },
31576
32007
  "recording.cancelStorageMigrationMove": {
31577
32008
  capName: "recording",
31578
32009
  capScope: "system",
@@ -31627,6 +32058,12 @@ Object.freeze({
31627
32058
  addonId: null,
31628
32059
  access: "view"
31629
32060
  },
32061
+ "recording.listRelocateJobs": {
32062
+ capName: "recording",
32063
+ capScope: "system",
32064
+ addonId: null,
32065
+ access: "view"
32066
+ },
31630
32067
  "recording.locateSegment": {
31631
32068
  capName: "recording",
31632
32069
  capScope: "system",
@@ -31639,6 +32076,12 @@ Object.freeze({
31639
32076
  addonId: null,
31640
32077
  access: "create"
31641
32078
  },
32079
+ "recording.planStorageRebalance": {
32080
+ capName: "recording",
32081
+ capScope: "system",
32082
+ addonId: null,
32083
+ access: "view"
32084
+ },
31642
32085
  "recording.pruneFootage": {
31643
32086
  capName: "recording",
31644
32087
  capScope: "system",
@@ -31663,6 +32106,12 @@ Object.freeze({
31663
32106
  addonId: null,
31664
32107
  access: "create"
31665
32108
  },
32109
+ "recording.relocateFootage": {
32110
+ capName: "recording",
32111
+ capScope: "system",
32112
+ addonId: null,
32113
+ access: "create"
32114
+ },
31666
32115
  "recording.renderClip": {
31667
32116
  capName: "recording",
31668
32117
  capScope: "system",
@@ -31699,38 +32148,50 @@ Object.freeze({
31699
32148
  addonId: null,
31700
32149
  access: "create"
31701
32150
  },
32151
+ "recording.startStorageRebalance": {
32152
+ capName: "recording",
32153
+ capScope: "system",
32154
+ addonId: null,
32155
+ access: "create"
32156
+ },
31702
32157
  "recordingExport.cancelExport": {
31703
- capName: "recordingExport",
32158
+ capName: "recording-export",
31704
32159
  capScope: "system",
31705
32160
  addonId: null,
31706
32161
  access: "create"
31707
32162
  },
31708
32163
  "recordingExport.createExport": {
31709
- capName: "recordingExport",
32164
+ capName: "recording-export",
31710
32165
  capScope: "system",
31711
32166
  addonId: null,
31712
32167
  access: "create"
31713
32168
  },
31714
32169
  "recordingExport.deleteExport": {
31715
- capName: "recordingExport",
32170
+ capName: "recording-export",
31716
32171
  capScope: "system",
31717
32172
  addonId: null,
31718
32173
  access: "delete"
31719
32174
  },
31720
32175
  "recordingExport.getDownloadUrl": {
31721
- capName: "recordingExport",
32176
+ capName: "recording-export",
31722
32177
  capScope: "system",
31723
32178
  addonId: null,
31724
32179
  access: "view"
31725
32180
  },
31726
32181
  "recordingExport.getExport": {
31727
- capName: "recordingExport",
32182
+ capName: "recording-export",
31728
32183
  capScope: "system",
31729
32184
  addonId: null,
31730
32185
  access: "view"
31731
32186
  },
31732
32187
  "recordingExport.listExports": {
31733
- capName: "recordingExport",
32188
+ capName: "recording-export",
32189
+ capScope: "system",
32190
+ addonId: null,
32191
+ access: "view"
32192
+ },
32193
+ "recordingExport.readExportBytes": {
32194
+ capName: "recording-export",
31734
32195
  capScope: "system",
31735
32196
  addonId: null,
31736
32197
  access: "view"
@@ -33107,6 +33568,104 @@ var FramerateField = number().int().min(1).max(60);
33107
33568
  var TargetsField = array(NcRuleTargetSchema).min(1);
33108
33569
  var PriorityField = number().int().min(1).max(5);
33109
33570
  /**
33571
+ * Explicit override of the DENSE sampling cadence, seconds.
33572
+ *
33573
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
33574
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
33575
+ * made that same base 3 s and rendered a person pass as two frames.)
33576
+ *
33577
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
33578
+ * `denseCadenceSec` and played at `framerate` occupies
33579
+ *
33580
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
33581
+ *
33582
+ * so a 7 s pass at 1 s / 12 fps is 0.58 s of video, and at 0.5 s it is 1.17 s.
33583
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
33584
+ * and therefore the length of a quiet night, does not move.
33585
+ *
33586
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
33587
+ * the recording has them returns the same frames, requested twice. Must be
33588
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
33589
+ * a uniform video the operator believes is two-rate — and upsert refuses it
33590
+ * rather than letting the export cap reject the render hours after the window.
33591
+ */
33592
+ var DenseCadenceSecField = number().min(.1).max(3600);
33593
+ /**
33594
+ * Minimum seconds of OUTPUT video each detection range must occupy.
33595
+ *
33596
+ * The operator-facing form of the arithmetic above: instead of solving for a
33597
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
33598
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
33599
+ * that range every ~583 ms.
33600
+ *
33601
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
33602
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
33603
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
33604
+ * ranges are sampled denser than they need. Per-range cadences require a cap
33605
+ * schema change and are the tracked follow-up.
33606
+ *
33607
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
33608
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
33609
+ * by real footage, never met by duplicating frames into motion that never
33610
+ * happened.
33611
+ */
33612
+ var MinDwellSecField = number().min(0).max(60);
33613
+ /**
33614
+ * Caption burned into the notification's preview frame.
33615
+ *
33616
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
33617
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
33618
+ * templating dialect for one field would be a second thing to explain.
33619
+ *
33620
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
33621
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
33622
+ * the reason this is not `.min(1)`.
33623
+ */
33624
+ var PreviewTextField = string().max(200);
33625
+ /**
33626
+ * Whether the notification's preview is a STILL or a short animation.
33627
+ *
33628
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
33629
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
33630
+ * night reads better as three seconds of motion than as one frame of it. Both
33631
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
33632
+ * simply applies it to a dozen frames sampled across the render and assembles
33633
+ * them.
33634
+ *
33635
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
33636
+ * seeks and a palette pass, and no rule that never asked for one should start
33637
+ * paying that on the deploy that shipped it.
33638
+ *
33639
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
33640
+ */
33641
+ var PreviewModeField = _enum(["image", "gif"]);
33642
+ /**
33643
+ * Which detection classes the notification reports counts for.
33644
+ *
33645
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
33646
+ * plan — no second query — aggregated per class. Absent or empty means "every
33647
+ * class the window actually contained", which is what an operator who never
33648
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
33649
+ * counts cars all night).
33650
+ *
33651
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
33652
+ * …). An unknown name simply never matches and reports nothing — it is not an
33653
+ * error, because a rule may legitimately name a class this camera's model does
33654
+ * not emit.
33655
+ *
33656
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
33657
+ * - `{{detections}}` — total over the reported classes
33658
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
33659
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
33660
+ * one per class, `count_` + the class name
33661
+ *
33662
+ * With NO custom body template the summary is appended to the derived body, and
33663
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
33664
+ * reads. With a custom template the operator owns every word — nothing is
33665
+ * appended, so `{{detectionSummary}}` is how he asks for it.
33666
+ */
33667
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
33668
+ /**
33110
33669
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
33111
33670
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
33112
33671
  * here (see the ownership note above).
@@ -33126,9 +33685,30 @@ var TimelapseRuleInputSchema = object({
33126
33685
  cadenceSec: CadenceSecField.default(15),
33127
33686
  /** Output frames per second of the assembled mp4 (predecessor parity). */
33128
33687
  framerate: FramerateField.default(10),
33688
+ /**
33689
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
33690
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
33691
+ * field gets.
33692
+ */
33693
+ denseCadenceSec: DenseCadenceSecField.optional(),
33694
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
33695
+ minDwellSec: MinDwellSecField.optional(),
33129
33696
  /** `notification-output` targets the finished video/thumbnail is sent to. */
33130
33697
  targets: TargetsField,
33131
33698
  template: TimelapseTemplateSchema.optional(),
33699
+ /**
33700
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
33701
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
33702
+ *
33703
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
33704
+ * the notification's title/body, and clearing it (`template: null`) must not
33705
+ * silently clear the caption too.
33706
+ */
33707
+ previewText: PreviewTextField.optional(),
33708
+ /** Still or animation — see {@link PreviewModeField}. */
33709
+ previewMode: PreviewModeField.default("image"),
33710
+ /** Classes the notification counts — see {@link ReportClassesField}. */
33711
+ reportClasses: ReportClassesField.optional(),
33132
33712
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
33133
33713
  priority: PriorityField.default(3)
33134
33714
  });
@@ -33139,8 +33719,13 @@ object({
33139
33719
  schedule: NcScheduleSchema.optional(),
33140
33720
  cadenceSec: CadenceSecField.optional(),
33141
33721
  framerate: FramerateField.optional(),
33722
+ denseCadenceSec: DenseCadenceSecField.optional(),
33723
+ minDwellSec: MinDwellSecField.optional(),
33142
33724
  targets: TargetsField.optional(),
33143
33725
  template: TimelapseTemplateSchema.nullable().optional(),
33726
+ previewText: PreviewTextField.optional(),
33727
+ previewMode: PreviewModeField.optional(),
33728
+ reportClasses: ReportClassesField.optional(),
33144
33729
  priority: PriorityField.optional()
33145
33730
  });
33146
33731
  TimelapseRuleInputSchema.extend({
@@ -33152,10 +33737,28 @@ TimelapseRuleInputSchema.extend({
33152
33737
  */
33153
33738
  ownerUserId: string().optional(),
33154
33739
  /**
33155
- * Epoch-ms of the last successful generation the 1-hour re-generation
33156
- * guard's durable state (predecessor parity). Absent = never generated.
33740
+ * Epoch-ms of the NEWEST successful generation across every camera of this
33741
+ * rule. What a UI shows, and the compatibility floor for
33742
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
33157
33743
  */
33158
33744
  lastGeneratedAt: number().optional(),
33745
+ /**
33746
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
33747
+ * re-generation guard's real durable state.
33748
+ *
33749
+ * One rule covers several cameras and each renders its own video, so a rule
33750
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
33751
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
33752
+ * already done — and B's night is gone for good, because the window will not
33753
+ * come back.
33754
+ *
33755
+ * ADDITIVE, so the migration is free: a row written before this field simply
33756
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
33757
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
33758
+ * "never generated" would re-render and re-notify every camera of every rule
33759
+ * once, on the deploy that shipped the map.
33760
+ */
33761
+ generatedByDevice: record(string(), number()).optional(),
33159
33762
  /** userId of the caller who created the rule (server-stamped). */
33160
33763
  createdBy: string(),
33161
33764
  createdAt: number(),