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