@camstack/addon-provider-rademacher 0.2.12 → 0.2.13

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
@@ -8203,8 +8203,31 @@ var AdoptionJobSchema = object({
8203
8203
  error: string().nullable()
8204
8204
  });
8205
8205
  /**
8206
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
8207
- * pipeline functions an operator thinks in terms of.
8206
+ * Per-camera FUNCTION SWITCHES.
8207
+ *
8208
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
8209
+ *
8210
+ * This file shipped as "the one coherent on/off surface over the pipeline
8211
+ * functions an operator thinks in terms of". The operator's verdict on
8212
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
8213
+ * every function already had a settings page of its own, and a second place to
8214
+ * turn it off is a second place to look. Each switch is going back to its own
8215
+ * component's original options — detection to the detection-pipeline wrapper
8216
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
8217
+ * (which was always first-class; the switch was a veneer over
8218
+ * `recording.setDeviceConfig`), notifications to a notification-center
8219
+ * per-device setting, the two camera planes to their own components.
8220
+ *
8221
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
8222
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
8223
+ * straight from the authorities with no group in the middle. That rule was
8224
+ * never about a control panel.
8225
+ *
8226
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
8227
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
8228
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
8229
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
8230
+ * stop; nothing new may be built on it.
8208
8231
  *
8209
8232
  * ## This file adds no state
8210
8233
  *
@@ -8555,7 +8578,15 @@ var RecordingConfigSchema = object({
8555
8578
  * Each completed/failed run also lands one durable ops-log row on its owning
8556
8579
  * addon surface.
8557
8580
  */
8581
+ /**
8582
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
8583
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
8584
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
8585
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
8586
+ * runs at all.
8587
+ */
8558
8588
  var RelocateJobStateSchema = _enum([
8589
+ "queued",
8559
8590
  "running",
8560
8591
  "done",
8561
8592
  "failed",
@@ -8590,6 +8621,15 @@ var RelocateFootageInputSchema = object({
8590
8621
  /** Limits relocation to the logical profile class. Omit only for the
8591
8622
  * pre-orchestration compatibility path. */
8592
8623
  footageClass: RelocateFootageClassSchema.optional(),
8624
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
8625
+ * is what a whole-disk drain means. The rebalance path always sets it: its
8626
+ * unit is a (camera, profile) pile, not a disk. */
8627
+ deviceId: number().int().optional(),
8628
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
8629
+ * Finer than `footageClass`, which cannot separate high from mid — and the
8630
+ * placement plan assigns those two independently, so a rebalance that could
8631
+ * only say "recordings" would move footage the plan never asked to move. */
8632
+ profiles: array(string()).optional(),
8593
8633
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
8594
8634
  * never allowed to starve live writers. */
8595
8635
  throttleMbps: number().min(1).max(1e3).optional()
@@ -8725,6 +8765,21 @@ var StorageLocationSchema = object({
8725
8765
  nodeId: string().optional(),
8726
8766
  isDefault: boolean().default(false),
8727
8767
  isSystem: boolean().default(false),
8768
+ /**
8769
+ * Operator opt-in: whether consumers that BALANCE across several locations
8770
+ * of a type may write here. Recordings reads it today; event media and
8771
+ * backups are the next consumers, which is why the flag lives on the
8772
+ * location rather than in any one addon's store — nothing has to be
8773
+ * extended to add the next consumer.
8774
+ *
8775
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
8776
+ * flag existed reads back with no flag and keeps working exactly as before;
8777
+ * that is the whole compat story, and it is why no migration ships with it.
8778
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
8779
+ * disk must not silently start writing to it); the default of a type is
8780
+ * always stamped `true`.
8781
+ */
8782
+ enabled: boolean().optional(),
8728
8783
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8729
8784
  * for node-local locations it can reach) — never persisted, absent when the
8730
8785
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -13277,7 +13332,8 @@ method(object({
13277
13332
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
13278
13333
  /**
13279
13334
  * filesystem-browse — per-node capability for browsing the node's local
13280
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
13335
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
13336
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
13281
13337
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
13282
13338
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
13283
13339
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -15118,6 +15174,13 @@ var MaskGridDimsSchema = object({
15118
15174
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
15119
15175
  * this one field keeps the schema additive — a rule still declares exactly
15120
15176
  * one trigger.
15177
+ *
15178
+ * AUDIO rules add no member here, for the reason occupancy added none: the
15179
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
15180
+ * mirror.ts` fails the build on a member the app cannot render) and every
15181
+ * member costs a release train. A sustained-sound rule is therefore an
15182
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
15183
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
15121
15184
  */
15122
15185
  var NcDeliverySchema = _enum([
15123
15186
  "immediate",
@@ -15132,15 +15195,32 @@ var NcDeliverySchema = _enum([
15132
15195
  * depend on a provider's raw event name or payload shape.
15133
15196
  */
15134
15197
  var NcSystemEventKindSchema = _enum([
15135
- "camera-online",
15136
- "camera-offline",
15198
+ "device-online",
15199
+ "device-offline",
15200
+ "device-disabled",
15201
+ "device-enabled",
15137
15202
  "stream-online",
15138
15203
  "stream-offline",
15139
15204
  "node-online",
15140
15205
  "node-offline",
15141
15206
  "addon-update-available",
15142
- "server-update-available"
15207
+ "server-update-available",
15208
+ "alarm-triggered",
15209
+ "alarm-armed",
15210
+ "alarm-disarmed",
15211
+ "camera-online",
15212
+ "camera-offline",
15213
+ "camera-disabled",
15214
+ "camera-enabled"
15215
+ ]);
15216
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
15217
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
15218
+ "camera-online",
15219
+ "camera-offline",
15220
+ "camera-disabled",
15221
+ "camera-enabled"
15143
15222
  ]);
15223
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
15144
15224
  /**
15145
15225
  * One coherent system-event condition. `kinds` is the required opt-in safety
15146
15226
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -15149,6 +15229,18 @@ var NcSystemEventKindSchema = _enum([
15149
15229
  var NcSystemEventConditionSchema = object({
15150
15230
  kinds: array(NcSystemEventKindSchema).min(1),
15151
15231
  deviceIds: array(number().int()).min(1).optional(),
15232
+ /**
15233
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
15234
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
15235
+ * is what a liveness rule means when nobody said otherwise.
15236
+ *
15237
+ * This is where "only my cameras" is expressed, and it lives on the rule for
15238
+ * one reason: the intake cannot know which devices this household cares
15239
+ * about, and a producer-side filter is one no operator can change. Fails
15240
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
15241
+ * does not carry) matches no `deviceTypes` list.
15242
+ */
15243
+ deviceTypes: array(string().min(1)).min(1).optional(),
15152
15244
  nodeIds: array(string().min(1)).min(1).optional(),
15153
15245
  packageNames: array(string().min(1)).min(1).optional()
15154
15246
  });
@@ -15199,6 +15291,47 @@ var NcOccupancyConditionSchema = object({
15199
15291
  sustainSeconds: number().int().min(0).max(3600).default(15)
15200
15292
  });
15201
15293
  /**
15294
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
15295
+ *
15296
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
15297
+ * reference notifier uses, so an operator moving between them re-uses what
15298
+ * they already know): a rule matches when, over a sampling window of
15299
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
15300
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
15301
+ *
15302
+ * - `dbThreshold` — its level is at or above this many dBFS (see
15303
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
15304
+ * - `labels` — the classifier put at least one of these labels on it.
15305
+ *
15306
+ * Both are OPTIONAL and independent, which is the point of the shape: a
15307
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
15308
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
15309
+ * is given** — a window in which every sample is trivially a hit would fire on
15310
+ * silence, so the engine refuses such a condition rather than notifying on
15311
+ * nothing (the schema cannot express "at least one of" without becoming a
15312
+ * ZodEffects the cap path would have to special-case).
15313
+ *
15314
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
15315
+ * must be FULL before it can match — a window that has been open for two
15316
+ * seconds of its ten is 100% of nothing, and firing on it would make
15317
+ * `samplingSeconds` decorative.
15318
+ *
15319
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
15320
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
15321
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
15322
+ * an operator who typed `dog` mean the same thing.
15323
+ */
15324
+ var NcAudioConditionSchema = object({
15325
+ /** Audio macro labels; absent = any sound (level-only rule). */
15326
+ labels: array(string().min(1)).min(1).optional(),
15327
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
15328
+ dbThreshold: number().min(-96).max(0).optional(),
15329
+ /** Percentage of the window's samples that must be hits (1–100). */
15330
+ hitPercent: number().int().min(1).max(100).default(60),
15331
+ /** Length of the sampling window in seconds. */
15332
+ samplingSeconds: number().int().min(1).max(300).default(10)
15333
+ });
15334
+ /**
15202
15335
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
15203
15336
  *
15204
15337
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -15471,7 +15604,33 @@ var NcConditionsSchema = object({
15471
15604
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
15472
15605
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
15473
15606
  */
15474
- occupancy: NcOccupancyConditionSchema.optional()
15607
+ occupancy: NcOccupancyConditionSchema.optional(),
15608
+ /**
15609
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
15610
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
15611
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
15612
+ * a window that is not full yet, neither filter given). See
15613
+ * {@link NcAudioCondition}.
15614
+ *
15615
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
15616
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
15617
+ * a detection, a track or a device event (the same fail-closed pairing
15618
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
15619
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
15620
+ * (an `immediate` rule naming an `audio-*` class, one notification per
15621
+ * classified sample) stays exactly as it was for rules that already use it.
15622
+ *
15623
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
15624
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
15625
+ * (`camstack/src/data/notification-center.ts`, guarded by
15626
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
15627
+ * condition fields it does not know when a rule is saved from the phone.
15628
+ * Publishing an editor for a condition the app cannot round-trip is how an
15629
+ * operator loses a rule's conditions by opening it — so the descriptor, the
15630
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
15631
+ * does an audio rule become authorable.
15632
+ */
15633
+ audio: NcAudioConditionSchema.optional()
15475
15634
  });
15476
15635
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
15477
15636
  var NcRuleTargetSchema = object({
@@ -15585,6 +15744,73 @@ var NcThrottleSchema = object({
15585
15744
  */
15586
15745
  granularity: NcThrottleGranularitySchema.optional()
15587
15746
  });
15747
+ /**
15748
+ * How long the confirm gate may hold ONE notification, and how big the picture
15749
+ * it judges may be.
15750
+ *
15751
+ * The clamp is the product decision, not a coincidence of the model: p50 was
15752
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
15753
+ * arrives after the visitor has gone is not a notification. 448 px was enough
15754
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
15755
+ * tokens for pixels the model pools away.
15756
+ */
15757
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
15758
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
15759
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
15760
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
15761
+ var NcConfirmExpectSchema = object({
15762
+ op: _enum([
15763
+ ">=",
15764
+ ">",
15765
+ "<=",
15766
+ "<",
15767
+ "=="
15768
+ ]),
15769
+ count: number().int().min(0).max(1e3)
15770
+ });
15771
+ /**
15772
+ * AI CONFIRM — a vision model looks at the picture this notification is about
15773
+ * to ship and says whether it agrees with the rule.
15774
+ *
15775
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
15776
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
15777
+ * on the operator's phone is not a verdict about this notification.
15778
+ *
15779
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
15780
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
15781
+ * the default and every fail-open is COUNTED, because a gate that always fails
15782
+ * open looks in the log exactly like a gate that works.
15783
+ *
15784
+ * Every field is `.optional()` rather than relied on as a Zod default at the
15785
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
15786
+ * production failures in one day), so the gate reads absent as the constant
15787
+ * above rather than trusting a parse it may never have seen.
15788
+ */
15789
+ var NcConfirmSchema = object({
15790
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
15791
+ * same thing, and both mean "deliver exactly as before". */
15792
+ enabled: boolean().default(false),
15793
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
15794
+ profileId: string().optional(),
15795
+ /**
15796
+ * The operator's question, in his own words. Absent = a question derived
15797
+ * from the rule (its class and its expectation).
15798
+ *
15799
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
15800
+ * banners, signage and plates as instructions if you let them reach the
15801
+ * prompt — proven live — so the authoritative contract stays in the system
15802
+ * turn and only rule-authored words land here.
15803
+ */
15804
+ prompt: string().max(1e3).optional(),
15805
+ /** Fire only when the model's count satisfies this. Absent = the model's
15806
+ * own boolean verdict decides. */
15807
+ expect: NcConfirmExpectSchema.optional(),
15808
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
15809
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
15810
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
15811
+ /** Longest edge the judged image is downscaled to before it is sent. */
15812
+ maxImagePx: number().int().min(64).max(2048).default(448)
15813
+ });
15588
15814
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
15589
15815
  var NcRuleInputSchema = object({
15590
15816
  name: string().min(1).max(200),
@@ -15645,7 +15871,13 @@ var NcRuleInputSchema = object({
15645
15871
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
15646
15872
  * shape as every other actuation.
15647
15873
  */
15648
- actions: NcRuleActionsSchema.optional()
15874
+ actions: NcRuleActionsSchema.optional(),
15875
+ /**
15876
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
15877
+ * a rule that predates the gate must keep delivering byte-for-byte as it
15878
+ * did, and absent is the only way to say that without a migration.
15879
+ */
15880
+ confirm: NcConfirmSchema.optional()
15649
15881
  });
15650
15882
  /**
15651
15883
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -15656,7 +15888,37 @@ var NcRuleInputSchema = object({
15656
15888
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
15657
15889
  * `updateRule` patch.
15658
15890
  */
15659
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
15891
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
15892
+ disabledTargetIds: array(string()).optional(),
15893
+ /**
15894
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
15895
+ *
15896
+ * It makes the key optional to SUPPLY; the parse still materialises the
15897
+ * default when the key is absent. And `NcRuleStore.update` merges with
15898
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
15899
+ * one — which made every partial edit destructive:
15900
+ *
15901
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
15902
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
15903
+ * setEnabled(ruleId, false) → conditions reset to `{}`
15904
+ *
15905
+ * A rule scoped to one camera and one zone silently became a rule that
15906
+ * matches EVERY event on EVERY camera, and lost its `media` policy
15907
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
15908
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
15909
+ * within a minute of a two-field patch.
15910
+ *
15911
+ * So every defaulted field is re-declared here WITHOUT its default. The
15912
+ * inner defaults still apply when the caller DOES send the key — `{}` for
15913
+ * conditions remains a real instruction ("clear them") — and only the
15914
+ * absent key is now genuinely absent.
15915
+ */
15916
+ enabled: boolean().optional(),
15917
+ conditions: NcConditionsSchema.optional(),
15918
+ media: NcMediaPolicySchema.optional(),
15919
+ throttle: NcThrottleSchema.optional(),
15920
+ priority: number().int().min(1).max(5).optional()
15921
+ });
15660
15922
  /** A persisted rule. */
15661
15923
  var NcRuleSchema = NcRuleInputSchema.extend({
15662
15924
  id: string(),
@@ -15957,6 +16219,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
15957
16219
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
15958
16220
  * copy would lie the first time a rule is disabled.
15959
16221
  */
16222
+ /**
16223
+ * Why a device a mode NAMES is nonetheless not armed by it.
16224
+ *
16225
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
16226
+ * per-camera notification switch the Notification Center already owns,
16227
+ * `detection-off` is the device's own detection binding being inactive, and
16228
+ * `offline` is the device manager's liveness. A fourth reason would mean a
16229
+ * fourth authority, and inventing one here is how a panel starts disagreeing
16230
+ * with the switches the operator actually used.
16231
+ */
16232
+ var NcAlarmSkipReasonSchema = _enum([
16233
+ "muted",
16234
+ "detection-off",
16235
+ "offline"
16236
+ ]);
16237
+ var NcAlarmSkippedDeviceSchema = object({
16238
+ deviceId: number().int(),
16239
+ reason: NcAlarmSkipReasonSchema
16240
+ });
15960
16241
  var NcAlarmModeCoverageSchema = object({
15961
16242
  mode: AlarmArmModeSchema,
15962
16243
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -15964,7 +16245,18 @@ var NcAlarmModeCoverageSchema = object({
15964
16245
  /** At least one covering rule has no device scope, so the mode covers all. */
15965
16246
  allDevices: boolean(),
15966
16247
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
15967
- deviceIds: array(number().int())
16248
+ deviceIds: array(number().int()),
16249
+ /**
16250
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
16251
+ * excludes it.
16252
+ *
16253
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
16254
+ * twelve makes it false in exactly the way nobody notices until an incident.
16255
+ * Defaulted to `[]` so a coverage answer computed before this field existed
16256
+ * still parses as "nothing known to be skipped" rather than failing the whole
16257
+ * alarm tab.
16258
+ */
16259
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
15968
16260
  });
15969
16261
  var NcAlarmConfigSchema = object({
15970
16262
  /**
@@ -18796,9 +19088,16 @@ var CameraStatusSchema = object({
18796
19088
  audio: CameraAudioStatusSchema.nullable(),
18797
19089
  recording: CameraRecordingStatusSchema.nullable(),
18798
19090
  /**
18799
- * Per-camera function switches an OPERATOR has turned off
19091
+ * Per-camera functions an OPERATOR has turned off
18800
19092
  * ([D61](../../../../docs/decisions/adr-0067.md)).
18801
19093
  *
19094
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
19095
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
19096
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
19097
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
19098
+ * The badge outlives the control panel: the panel was a convenience, this is
19099
+ * the difference between a camera being off and a camera being dead.
19100
+ *
18802
19101
  * This is the difference between DISABLED and BROKEN. A camera whose
18803
19102
  * `detection` block reports zero fps and whose `switchedOff` contains
18804
19103
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -25540,7 +25839,19 @@ var RecordingManifestSchema = object({
25540
25839
  * profiles/subtrees/locations on this node). */
25541
25840
  var RecordingDeviceUsageSchema = object({
25542
25841
  deviceId: number(),
25543
- usedBytes: number()
25842
+ usedBytes: number(),
25843
+ /**
25844
+ * Start of this camera's OLDEST indexed segment, across every profile and
25845
+ * location — the "Oldest footage" column in Recordings → Storage, and the
25846
+ * only honest answer to "is retention actually holding?" per camera.
25847
+ *
25848
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
25849
+ * predates this field omits it entirely, and a hub whose types carry the
25850
+ * field must keep validating that older provider's payload: the framework
25851
+ * (types) and the addon ship on different trains, and the addon is usually
25852
+ * the later of the two.
25853
+ */
25854
+ oldestMs: number().nullable().optional()
25544
25855
  });
25545
25856
  /** Recording storage usage + capacity for one storage location. */
25546
25857
  var RecordingLocationUsageSchema = object({
@@ -25568,6 +25879,57 @@ var RecordingStorageUsageSchema = object({
25568
25879
  locations: array(RecordingLocationUsageSchema)
25569
25880
  });
25570
25881
  /**
25882
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
25883
+ *
25884
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
25885
+ * is the operator asking for the EXISTING archive to be brought into line with
25886
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
25887
+ * location, run FIFO behind the single-flight mover.
25888
+ *
25889
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
25890
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
25891
+ * (empty on the plan).
25892
+ */
25893
+ var RecordingRebalanceMoveSchema = object({
25894
+ deviceId: number(),
25895
+ profile: string(),
25896
+ fromLocationId: string(),
25897
+ toLocationId: string(),
25898
+ bytes: number(),
25899
+ files: number().int()
25900
+ });
25901
+ /** Why a pile that is out of place is staying there. Every refusal is
25902
+ * reported: a rebalance that silently drops a camera reads exactly like one
25903
+ * that had nothing to do. */
25904
+ var RecordingRebalanceSkipReasonSchema = _enum([
25905
+ "unassigned",
25906
+ "target-not-writable",
25907
+ "below-threshold",
25908
+ "no-headroom"
25909
+ ]);
25910
+ var RecordingRebalanceSkipSchema = object({
25911
+ deviceId: number(),
25912
+ profile: string(),
25913
+ fromLocationId: string(),
25914
+ /** The location the plan wants; null when the camera has no assignment. */
25915
+ toLocationId: string().nullable(),
25916
+ bytes: number(),
25917
+ reason: RecordingRebalanceSkipReasonSchema
25918
+ });
25919
+ var RecordingRebalancePlanSchema = object({
25920
+ moves: array(RecordingRebalanceMoveSchema),
25921
+ skipped: array(RecordingRebalanceSkipSchema),
25922
+ bytesToMove: number(),
25923
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
25924
+ jobIds: array(string())
25925
+ });
25926
+ var RecordingRebalanceInputSchema = object({
25927
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
25928
+ throttleMbps: number().min(1).max(1e3).optional(),
25929
+ /** Ignore piles smaller than this (default 1 GB). */
25930
+ minMoveGb: number().min(0).optional()
25931
+ });
25932
+ /**
25571
25933
  * Result of locating footage at a wall-clock instant for one device/profile.
25572
25934
  * `segment` carries the covering segment's window; `gap` reports the forward
25573
25935
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -25730,9 +26092,24 @@ method(object({
25730
26092
  }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
25731
26093
  kind: "mutation",
25732
26094
  auth: "admin"
26095
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
26096
+ kind: "mutation",
26097
+ auth: "admin"
26098
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
26099
+ kind: "query",
26100
+ auth: "admin"
26101
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
26102
+ kind: "mutation",
26103
+ auth: "admin"
26104
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
26105
+ kind: "query",
26106
+ auth: "admin"
26107
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
26108
+ kind: "mutation",
26109
+ auth: "admin"
25733
26110
  });
25734
26111
  /**
25735
- * `recordingExport` cap — render a footage time range into a single downloadable
26112
+ * `recording-export` cap — render a footage time range into a single downloadable
25736
26113
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
25737
26114
  * bounded lifetime with a durable history, auto-expiry, and optional
25738
26115
  * delete-after-download.
@@ -25747,10 +26124,42 @@ method(object({
25747
26124
  */
25748
26125
  /** Playback-speed multiplier for the render (1 = realtime). */
25749
26126
  var ExportSpeedSchema = number().min(.25).max(32);
26127
+ /**
26128
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
26129
+ *
26130
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
26131
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
26132
+ * playlist. Handing it absolute epochs would make every call site responsible
26133
+ * for the same subtraction, and the one that forgot would emit a filter that
26134
+ * selects nothing — silently, as a uniform timelapse.
26135
+ */
26136
+ var ExportDenseRangeSchema = object({
26137
+ fromSec: number().nonnegative(),
26138
+ toSec: number().nonnegative()
26139
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
26140
+ /**
26141
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
26142
+ * listed ranges and at the base `everyMs` everywhere else.
26143
+ *
26144
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
26145
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
26146
+ */
26147
+ var ExportDenseSchema = object({
26148
+ everyMs: number().int().positive(),
26149
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
26150
+ });
25750
26151
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
25751
26152
  var ExportTimelapseSchema = object({
25752
26153
  everyMs: number().int().positive(),
25753
- outputFps: number().int().min(1).max(60).optional()
26154
+ outputFps: number().int().min(1).max(60).optional(),
26155
+ /** Optional second, FASTER rate over the intervals that matter. */
26156
+ dense: ExportDenseSchema.optional()
26157
+ }).superRefine((v, ctx) => {
26158
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
26159
+ code: ZodIssueCode.custom,
26160
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
26161
+ path: ["dense", "everyMs"]
26162
+ });
25754
26163
  });
25755
26164
  /**
25756
26165
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -25808,6 +26217,19 @@ var ExportDownloadSchema = object({
25808
26217
  url: string(),
25809
26218
  endpoints: array(string())
25810
26219
  });
26220
+ /**
26221
+ * A finished export's bytes, inline.
26222
+ *
26223
+ * `bytes` is the DECODED length — the number the caller bounds and logs
26224
+ * against, so nobody has to infer it from the base64 length.
26225
+ */
26226
+ var ExportBytesSchema = object({
26227
+ base64: string(),
26228
+ contentType: string(),
26229
+ /** Suggested filename, extension included. */
26230
+ name: string(),
26231
+ bytes: number().int().nonnegative()
26232
+ });
25811
26233
  method(object({
25812
26234
  deviceId: number(),
25813
26235
  profile: string(),
@@ -25832,6 +26254,9 @@ method(object({
25832
26254
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
25833
26255
  kind: "query",
25834
26256
  auth: "protected"
26257
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
26258
+ kind: "query",
26259
+ auth: "protected"
25835
26260
  });
25836
26261
  /**
25837
26262
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -32509,6 +32934,12 @@ Object.freeze({
32509
32934
  addonId: null,
32510
32935
  access: "create"
32511
32936
  },
32937
+ "recording.cancelRelocateJob": {
32938
+ capName: "recording",
32939
+ capScope: "system",
32940
+ addonId: null,
32941
+ access: "create"
32942
+ },
32512
32943
  "recording.cancelStorageMigrationMove": {
32513
32944
  capName: "recording",
32514
32945
  capScope: "system",
@@ -32563,6 +32994,12 @@ Object.freeze({
32563
32994
  addonId: null,
32564
32995
  access: "view"
32565
32996
  },
32997
+ "recording.listRelocateJobs": {
32998
+ capName: "recording",
32999
+ capScope: "system",
33000
+ addonId: null,
33001
+ access: "view"
33002
+ },
32566
33003
  "recording.locateSegment": {
32567
33004
  capName: "recording",
32568
33005
  capScope: "system",
@@ -32575,6 +33012,12 @@ Object.freeze({
32575
33012
  addonId: null,
32576
33013
  access: "create"
32577
33014
  },
33015
+ "recording.planStorageRebalance": {
33016
+ capName: "recording",
33017
+ capScope: "system",
33018
+ addonId: null,
33019
+ access: "view"
33020
+ },
32578
33021
  "recording.pruneFootage": {
32579
33022
  capName: "recording",
32580
33023
  capScope: "system",
@@ -32599,6 +33042,12 @@ Object.freeze({
32599
33042
  addonId: null,
32600
33043
  access: "create"
32601
33044
  },
33045
+ "recording.relocateFootage": {
33046
+ capName: "recording",
33047
+ capScope: "system",
33048
+ addonId: null,
33049
+ access: "create"
33050
+ },
32602
33051
  "recording.renderClip": {
32603
33052
  capName: "recording",
32604
33053
  capScope: "system",
@@ -32635,38 +33084,50 @@ Object.freeze({
32635
33084
  addonId: null,
32636
33085
  access: "create"
32637
33086
  },
33087
+ "recording.startStorageRebalance": {
33088
+ capName: "recording",
33089
+ capScope: "system",
33090
+ addonId: null,
33091
+ access: "create"
33092
+ },
32638
33093
  "recordingExport.cancelExport": {
32639
- capName: "recordingExport",
33094
+ capName: "recording-export",
32640
33095
  capScope: "system",
32641
33096
  addonId: null,
32642
33097
  access: "create"
32643
33098
  },
32644
33099
  "recordingExport.createExport": {
32645
- capName: "recordingExport",
33100
+ capName: "recording-export",
32646
33101
  capScope: "system",
32647
33102
  addonId: null,
32648
33103
  access: "create"
32649
33104
  },
32650
33105
  "recordingExport.deleteExport": {
32651
- capName: "recordingExport",
33106
+ capName: "recording-export",
32652
33107
  capScope: "system",
32653
33108
  addonId: null,
32654
33109
  access: "delete"
32655
33110
  },
32656
33111
  "recordingExport.getDownloadUrl": {
32657
- capName: "recordingExport",
33112
+ capName: "recording-export",
32658
33113
  capScope: "system",
32659
33114
  addonId: null,
32660
33115
  access: "view"
32661
33116
  },
32662
33117
  "recordingExport.getExport": {
32663
- capName: "recordingExport",
33118
+ capName: "recording-export",
32664
33119
  capScope: "system",
32665
33120
  addonId: null,
32666
33121
  access: "view"
32667
33122
  },
32668
33123
  "recordingExport.listExports": {
32669
- capName: "recordingExport",
33124
+ capName: "recording-export",
33125
+ capScope: "system",
33126
+ addonId: null,
33127
+ access: "view"
33128
+ },
33129
+ "recordingExport.readExportBytes": {
33130
+ capName: "recording-export",
32670
33131
  capScope: "system",
32671
33132
  addonId: null,
32672
33133
  access: "view"
@@ -34043,6 +34504,104 @@ var FramerateField = number().int().min(1).max(60);
34043
34504
  var TargetsField = array(NcRuleTargetSchema).min(1);
34044
34505
  var PriorityField = number().int().min(1).max(5);
34045
34506
  /**
34507
+ * Explicit override of the DENSE sampling cadence, seconds.
34508
+ *
34509
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
34510
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
34511
+ * made that same base 3 s and rendered a person pass as two frames.)
34512
+ *
34513
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
34514
+ * `denseCadenceSec` and played at `framerate` occupies
34515
+ *
34516
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
34517
+ *
34518
+ * 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.
34519
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
34520
+ * and therefore the length of a quiet night, does not move.
34521
+ *
34522
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
34523
+ * the recording has them returns the same frames, requested twice. Must be
34524
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
34525
+ * a uniform video the operator believes is two-rate — and upsert refuses it
34526
+ * rather than letting the export cap reject the render hours after the window.
34527
+ */
34528
+ var DenseCadenceSecField = number().min(.1).max(3600);
34529
+ /**
34530
+ * Minimum seconds of OUTPUT video each detection range must occupy.
34531
+ *
34532
+ * The operator-facing form of the arithmetic above: instead of solving for a
34533
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
34534
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
34535
+ * that range every ~583 ms.
34536
+ *
34537
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
34538
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
34539
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
34540
+ * ranges are sampled denser than they need. Per-range cadences require a cap
34541
+ * schema change and are the tracked follow-up.
34542
+ *
34543
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
34544
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
34545
+ * by real footage, never met by duplicating frames into motion that never
34546
+ * happened.
34547
+ */
34548
+ var MinDwellSecField = number().min(0).max(60);
34549
+ /**
34550
+ * Caption burned into the notification's preview frame.
34551
+ *
34552
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
34553
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
34554
+ * templating dialect for one field would be a second thing to explain.
34555
+ *
34556
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
34557
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
34558
+ * the reason this is not `.min(1)`.
34559
+ */
34560
+ var PreviewTextField = string().max(200);
34561
+ /**
34562
+ * Whether the notification's preview is a STILL or a short animation.
34563
+ *
34564
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
34565
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
34566
+ * night reads better as three seconds of motion than as one frame of it. Both
34567
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
34568
+ * simply applies it to a dozen frames sampled across the render and assembles
34569
+ * them.
34570
+ *
34571
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
34572
+ * seeks and a palette pass, and no rule that never asked for one should start
34573
+ * paying that on the deploy that shipped it.
34574
+ *
34575
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
34576
+ */
34577
+ var PreviewModeField = _enum(["image", "gif"]);
34578
+ /**
34579
+ * Which detection classes the notification reports counts for.
34580
+ *
34581
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
34582
+ * plan — no second query — aggregated per class. Absent or empty means "every
34583
+ * class the window actually contained", which is what an operator who never
34584
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
34585
+ * counts cars all night).
34586
+ *
34587
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
34588
+ * …). An unknown name simply never matches and reports nothing — it is not an
34589
+ * error, because a rule may legitimately name a class this camera's model does
34590
+ * not emit.
34591
+ *
34592
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
34593
+ * - `{{detections}}` — total over the reported classes
34594
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
34595
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
34596
+ * one per class, `count_` + the class name
34597
+ *
34598
+ * With NO custom body template the summary is appended to the derived body, and
34599
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
34600
+ * reads. With a custom template the operator owns every word — nothing is
34601
+ * appended, so `{{detectionSummary}}` is how he asks for it.
34602
+ */
34603
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
34604
+ /**
34046
34605
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
34047
34606
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
34048
34607
  * here (see the ownership note above).
@@ -34062,9 +34621,30 @@ var TimelapseRuleInputSchema = object({
34062
34621
  cadenceSec: CadenceSecField.default(15),
34063
34622
  /** Output frames per second of the assembled mp4 (predecessor parity). */
34064
34623
  framerate: FramerateField.default(10),
34624
+ /**
34625
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
34626
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
34627
+ * field gets.
34628
+ */
34629
+ denseCadenceSec: DenseCadenceSecField.optional(),
34630
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
34631
+ minDwellSec: MinDwellSecField.optional(),
34065
34632
  /** `notification-output` targets the finished video/thumbnail is sent to. */
34066
34633
  targets: TargetsField,
34067
34634
  template: TimelapseTemplateSchema.optional(),
34635
+ /**
34636
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
34637
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
34638
+ *
34639
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
34640
+ * the notification's title/body, and clearing it (`template: null`) must not
34641
+ * silently clear the caption too.
34642
+ */
34643
+ previewText: PreviewTextField.optional(),
34644
+ /** Still or animation — see {@link PreviewModeField}. */
34645
+ previewMode: PreviewModeField.default("image"),
34646
+ /** Classes the notification counts — see {@link ReportClassesField}. */
34647
+ reportClasses: ReportClassesField.optional(),
34068
34648
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
34069
34649
  priority: PriorityField.default(3)
34070
34650
  });
@@ -34075,8 +34655,13 @@ object({
34075
34655
  schedule: NcScheduleSchema.optional(),
34076
34656
  cadenceSec: CadenceSecField.optional(),
34077
34657
  framerate: FramerateField.optional(),
34658
+ denseCadenceSec: DenseCadenceSecField.optional(),
34659
+ minDwellSec: MinDwellSecField.optional(),
34078
34660
  targets: TargetsField.optional(),
34079
34661
  template: TimelapseTemplateSchema.nullable().optional(),
34662
+ previewText: PreviewTextField.optional(),
34663
+ previewMode: PreviewModeField.optional(),
34664
+ reportClasses: ReportClassesField.optional(),
34080
34665
  priority: PriorityField.optional()
34081
34666
  });
34082
34667
  TimelapseRuleInputSchema.extend({
@@ -34088,10 +34673,28 @@ TimelapseRuleInputSchema.extend({
34088
34673
  */
34089
34674
  ownerUserId: string().optional(),
34090
34675
  /**
34091
- * Epoch-ms of the last successful generation the 1-hour re-generation
34092
- * guard's durable state (predecessor parity). Absent = never generated.
34676
+ * Epoch-ms of the NEWEST successful generation across every camera of this
34677
+ * rule. What a UI shows, and the compatibility floor for
34678
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
34093
34679
  */
34094
34680
  lastGeneratedAt: number().optional(),
34681
+ /**
34682
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
34683
+ * re-generation guard's real durable state.
34684
+ *
34685
+ * One rule covers several cameras and each renders its own video, so a rule
34686
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
34687
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
34688
+ * already done — and B's night is gone for good, because the window will not
34689
+ * come back.
34690
+ *
34691
+ * ADDITIVE, so the migration is free: a row written before this field simply
34692
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
34693
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
34694
+ * "never generated" would re-render and re-notify every camera of every rule
34695
+ * once, on the deploy that shipped the map.
34696
+ */
34697
+ generatedByDevice: record(string(), number()).optional(),
34095
34698
  /** userId of the caller who created the rule (server-stamped). */
34096
34699
  createdBy: string(),
34097
34700
  createdAt: number(),