@camstack/addon-decoder-nodeav 1.2.12 → 1.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/index.js +625 -22
  2. package/dist/index.mjs +625 -22
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7205,8 +7205,31 @@ var AdoptionJobSchema = object({
7205
7205
  error: string().nullable()
7206
7206
  });
7207
7207
  /**
7208
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7209
- * pipeline functions an operator thinks in terms of.
7208
+ * Per-camera FUNCTION SWITCHES.
7209
+ *
7210
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7211
+ *
7212
+ * This file shipped as "the one coherent on/off surface over the pipeline
7213
+ * functions an operator thinks in terms of". The operator's verdict on
7214
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7215
+ * every function already had a settings page of its own, and a second place to
7216
+ * turn it off is a second place to look. Each switch is going back to its own
7217
+ * component's original options — detection to the detection-pipeline wrapper
7218
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7219
+ * (which was always first-class; the switch was a veneer over
7220
+ * `recording.setDeviceConfig`), notifications to a notification-center
7221
+ * per-device setting, the two camera planes to their own components.
7222
+ *
7223
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7224
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7225
+ * straight from the authorities with no group in the middle. That rule was
7226
+ * never about a control panel.
7227
+ *
7228
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7229
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7230
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7231
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7232
+ * stop; nothing new may be built on it.
7210
7233
  *
7211
7234
  * ## This file adds no state
7212
7235
  *
@@ -7557,7 +7580,15 @@ var RecordingConfigSchema = object({
7557
7580
  * Each completed/failed run also lands one durable ops-log row on its owning
7558
7581
  * addon surface.
7559
7582
  */
7583
+ /**
7584
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7585
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7586
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7587
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7588
+ * runs at all.
7589
+ */
7560
7590
  var RelocateJobStateSchema = _enum([
7591
+ "queued",
7561
7592
  "running",
7562
7593
  "done",
7563
7594
  "failed",
@@ -7592,6 +7623,15 @@ var RelocateFootageInputSchema = object({
7592
7623
  /** Limits relocation to the logical profile class. Omit only for the
7593
7624
  * pre-orchestration compatibility path. */
7594
7625
  footageClass: RelocateFootageClassSchema.optional(),
7626
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7627
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7628
+ * unit is a (camera, profile) pile, not a disk. */
7629
+ deviceId: number().int().optional(),
7630
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7631
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7632
+ * placement plan assigns those two independently, so a rebalance that could
7633
+ * only say "recordings" would move footage the plan never asked to move. */
7634
+ profiles: array(string()).optional(),
7595
7635
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7596
7636
  * never allowed to starve live writers. */
7597
7637
  throttleMbps: number().min(1).max(1e3).optional()
@@ -7727,6 +7767,21 @@ var StorageLocationSchema = object({
7727
7767
  nodeId: string().optional(),
7728
7768
  isDefault: boolean().default(false),
7729
7769
  isSystem: boolean().default(false),
7770
+ /**
7771
+ * Operator opt-in: whether consumers that BALANCE across several locations
7772
+ * of a type may write here. Recordings reads it today; event media and
7773
+ * backups are the next consumers, which is why the flag lives on the
7774
+ * location rather than in any one addon's store — nothing has to be
7775
+ * extended to add the next consumer.
7776
+ *
7777
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7778
+ * flag existed reads back with no flag and keeps working exactly as before;
7779
+ * that is the whole compat story, and it is why no migration ships with it.
7780
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7781
+ * disk must not silently start writing to it); the default of a type is
7782
+ * always stamped `true`.
7783
+ */
7784
+ enabled: boolean().optional(),
7730
7785
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7731
7786
  * for node-local locations it can reach) — never persisted, absent when the
7732
7787
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12159,7 +12214,8 @@ method(object({
12159
12214
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12160
12215
  /**
12161
12216
  * filesystem-browse — per-node capability for browsing the node's local
12162
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12217
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12218
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12163
12219
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12164
12220
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12165
12221
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -13972,6 +14028,13 @@ var MaskGridDimsSchema = object({
13972
14028
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
13973
14029
  * this one field keeps the schema additive — a rule still declares exactly
13974
14030
  * one trigger.
14031
+ *
14032
+ * AUDIO rules add no member here, for the reason occupancy added none: the
14033
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
14034
+ * mirror.ts` fails the build on a member the app cannot render) and every
14035
+ * member costs a release train. A sustained-sound rule is therefore an
14036
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
14037
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
13975
14038
  */
13976
14039
  var NcDeliverySchema = _enum([
13977
14040
  "immediate",
@@ -13986,15 +14049,32 @@ var NcDeliverySchema = _enum([
13986
14049
  * depend on a provider's raw event name or payload shape.
13987
14050
  */
13988
14051
  var NcSystemEventKindSchema = _enum([
13989
- "camera-online",
13990
- "camera-offline",
14052
+ "device-online",
14053
+ "device-offline",
14054
+ "device-disabled",
14055
+ "device-enabled",
13991
14056
  "stream-online",
13992
14057
  "stream-offline",
13993
14058
  "node-online",
13994
14059
  "node-offline",
13995
14060
  "addon-update-available",
13996
- "server-update-available"
14061
+ "server-update-available",
14062
+ "alarm-triggered",
14063
+ "alarm-armed",
14064
+ "alarm-disarmed",
14065
+ "camera-online",
14066
+ "camera-offline",
14067
+ "camera-disabled",
14068
+ "camera-enabled"
14069
+ ]);
14070
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14071
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14072
+ "camera-online",
14073
+ "camera-offline",
14074
+ "camera-disabled",
14075
+ "camera-enabled"
13997
14076
  ]);
14077
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
13998
14078
  /**
13999
14079
  * One coherent system-event condition. `kinds` is the required opt-in safety
14000
14080
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -14003,6 +14083,18 @@ var NcSystemEventKindSchema = _enum([
14003
14083
  var NcSystemEventConditionSchema = object({
14004
14084
  kinds: array(NcSystemEventKindSchema).min(1),
14005
14085
  deviceIds: array(number().int()).min(1).optional(),
14086
+ /**
14087
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14088
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14089
+ * is what a liveness rule means when nobody said otherwise.
14090
+ *
14091
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14092
+ * one reason: the intake cannot know which devices this household cares
14093
+ * about, and a producer-side filter is one no operator can change. Fails
14094
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14095
+ * does not carry) matches no `deviceTypes` list.
14096
+ */
14097
+ deviceTypes: array(string().min(1)).min(1).optional(),
14006
14098
  nodeIds: array(string().min(1)).min(1).optional(),
14007
14099
  packageNames: array(string().min(1)).min(1).optional()
14008
14100
  });
@@ -14053,6 +14145,47 @@ var NcOccupancyConditionSchema = object({
14053
14145
  sustainSeconds: number().int().min(0).max(3600).default(15)
14054
14146
  });
14055
14147
  /**
14148
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14149
+ *
14150
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14151
+ * reference notifier uses, so an operator moving between them re-uses what
14152
+ * they already know): a rule matches when, over a sampling window of
14153
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14154
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14155
+ *
14156
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14157
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14158
+ * - `labels` — the classifier put at least one of these labels on it.
14159
+ *
14160
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14161
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14162
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14163
+ * is given** — a window in which every sample is trivially a hit would fire on
14164
+ * silence, so the engine refuses such a condition rather than notifying on
14165
+ * nothing (the schema cannot express "at least one of" without becoming a
14166
+ * ZodEffects the cap path would have to special-case).
14167
+ *
14168
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14169
+ * must be FULL before it can match — a window that has been open for two
14170
+ * seconds of its ten is 100% of nothing, and firing on it would make
14171
+ * `samplingSeconds` decorative.
14172
+ *
14173
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14174
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14175
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14176
+ * an operator who typed `dog` mean the same thing.
14177
+ */
14178
+ var NcAudioConditionSchema = object({
14179
+ /** Audio macro labels; absent = any sound (level-only rule). */
14180
+ labels: array(string().min(1)).min(1).optional(),
14181
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14182
+ dbThreshold: number().min(-96).max(0).optional(),
14183
+ /** Percentage of the window's samples that must be hits (1–100). */
14184
+ hitPercent: number().int().min(1).max(100).default(60),
14185
+ /** Length of the sampling window in seconds. */
14186
+ samplingSeconds: number().int().min(1).max(300).default(10)
14187
+ });
14188
+ /**
14056
14189
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
14057
14190
  *
14058
14191
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14325,7 +14458,33 @@ var NcConditionsSchema = object({
14325
14458
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14326
14459
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14327
14460
  */
14328
- occupancy: NcOccupancyConditionSchema.optional()
14461
+ occupancy: NcOccupancyConditionSchema.optional(),
14462
+ /**
14463
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14464
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14465
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14466
+ * a window that is not full yet, neither filter given). See
14467
+ * {@link NcAudioCondition}.
14468
+ *
14469
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14470
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14471
+ * a detection, a track or a device event (the same fail-closed pairing
14472
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14473
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14474
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14475
+ * classified sample) stays exactly as it was for rules that already use it.
14476
+ *
14477
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14478
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14479
+ * (`camstack/src/data/notification-center.ts`, guarded by
14480
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14481
+ * condition fields it does not know when a rule is saved from the phone.
14482
+ * Publishing an editor for a condition the app cannot round-trip is how an
14483
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14484
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14485
+ * does an audio rule become authorable.
14486
+ */
14487
+ audio: NcAudioConditionSchema.optional()
14329
14488
  });
14330
14489
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14331
14490
  var NcRuleTargetSchema = object({
@@ -14439,6 +14598,73 @@ var NcThrottleSchema = object({
14439
14598
  */
14440
14599
  granularity: NcThrottleGranularitySchema.optional()
14441
14600
  });
14601
+ /**
14602
+ * How long the confirm gate may hold ONE notification, and how big the picture
14603
+ * it judges may be.
14604
+ *
14605
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14606
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14607
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14608
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14609
+ * tokens for pixels the model pools away.
14610
+ */
14611
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14612
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14613
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14614
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14615
+ var NcConfirmExpectSchema = object({
14616
+ op: _enum([
14617
+ ">=",
14618
+ ">",
14619
+ "<=",
14620
+ "<",
14621
+ "=="
14622
+ ]),
14623
+ count: number().int().min(0).max(1e3)
14624
+ });
14625
+ /**
14626
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14627
+ * to ship and says whether it agrees with the rule.
14628
+ *
14629
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14630
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14631
+ * on the operator's phone is not a verdict about this notification.
14632
+ *
14633
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14634
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14635
+ * the default and every fail-open is COUNTED, because a gate that always fails
14636
+ * open looks in the log exactly like a gate that works.
14637
+ *
14638
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14639
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14640
+ * production failures in one day), so the gate reads absent as the constant
14641
+ * above rather than trusting a parse it may never have seen.
14642
+ */
14643
+ var NcConfirmSchema = object({
14644
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14645
+ * same thing, and both mean "deliver exactly as before". */
14646
+ enabled: boolean().default(false),
14647
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14648
+ profileId: string().optional(),
14649
+ /**
14650
+ * The operator's question, in his own words. Absent = a question derived
14651
+ * from the rule (its class and its expectation).
14652
+ *
14653
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14654
+ * banners, signage and plates as instructions if you let them reach the
14655
+ * prompt — proven live — so the authoritative contract stays in the system
14656
+ * turn and only rule-authored words land here.
14657
+ */
14658
+ prompt: string().max(1e3).optional(),
14659
+ /** Fire only when the model's count satisfies this. Absent = the model's
14660
+ * own boolean verdict decides. */
14661
+ expect: NcConfirmExpectSchema.optional(),
14662
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14663
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14664
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14665
+ /** Longest edge the judged image is downscaled to before it is sent. */
14666
+ maxImagePx: number().int().min(64).max(2048).default(448)
14667
+ });
14442
14668
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14443
14669
  var NcRuleInputSchema = object({
14444
14670
  name: string().min(1).max(200),
@@ -14499,7 +14725,13 @@ var NcRuleInputSchema = object({
14499
14725
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14500
14726
  * shape as every other actuation.
14501
14727
  */
14502
- actions: NcRuleActionsSchema.optional()
14728
+ actions: NcRuleActionsSchema.optional(),
14729
+ /**
14730
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14731
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14732
+ * did, and absent is the only way to say that without a migration.
14733
+ */
14734
+ confirm: NcConfirmSchema.optional()
14503
14735
  });
14504
14736
  /**
14505
14737
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14510,7 +14742,37 @@ var NcRuleInputSchema = object({
14510
14742
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14511
14743
  * `updateRule` patch.
14512
14744
  */
14513
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
14745
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14746
+ disabledTargetIds: array(string()).optional(),
14747
+ /**
14748
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14749
+ *
14750
+ * It makes the key optional to SUPPLY; the parse still materialises the
14751
+ * default when the key is absent. And `NcRuleStore.update` merges with
14752
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14753
+ * one — which made every partial edit destructive:
14754
+ *
14755
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14756
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14757
+ * setEnabled(ruleId, false) → conditions reset to `{}`
14758
+ *
14759
+ * A rule scoped to one camera and one zone silently became a rule that
14760
+ * matches EVERY event on EVERY camera, and lost its `media` policy
14761
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
14762
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
14763
+ * within a minute of a two-field patch.
14764
+ *
14765
+ * So every defaulted field is re-declared here WITHOUT its default. The
14766
+ * inner defaults still apply when the caller DOES send the key — `{}` for
14767
+ * conditions remains a real instruction ("clear them") — and only the
14768
+ * absent key is now genuinely absent.
14769
+ */
14770
+ enabled: boolean().optional(),
14771
+ conditions: NcConditionsSchema.optional(),
14772
+ media: NcMediaPolicySchema.optional(),
14773
+ throttle: NcThrottleSchema.optional(),
14774
+ priority: number().int().min(1).max(5).optional()
14775
+ });
14514
14776
  /** A persisted rule. */
14515
14777
  var NcRuleSchema = NcRuleInputSchema.extend({
14516
14778
  id: string(),
@@ -14811,6 +15073,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14811
15073
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14812
15074
  * copy would lie the first time a rule is disabled.
14813
15075
  */
15076
+ /**
15077
+ * Why a device a mode NAMES is nonetheless not armed by it.
15078
+ *
15079
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15080
+ * per-camera notification switch the Notification Center already owns,
15081
+ * `detection-off` is the device's own detection binding being inactive, and
15082
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15083
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15084
+ * with the switches the operator actually used.
15085
+ */
15086
+ var NcAlarmSkipReasonSchema = _enum([
15087
+ "muted",
15088
+ "detection-off",
15089
+ "offline"
15090
+ ]);
15091
+ var NcAlarmSkippedDeviceSchema = object({
15092
+ deviceId: number().int(),
15093
+ reason: NcAlarmSkipReasonSchema
15094
+ });
14814
15095
  var NcAlarmModeCoverageSchema = object({
14815
15096
  mode: AlarmArmModeSchema,
14816
15097
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14818,7 +15099,18 @@ var NcAlarmModeCoverageSchema = object({
14818
15099
  /** At least one covering rule has no device scope, so the mode covers all. */
14819
15100
  allDevices: boolean(),
14820
15101
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14821
- deviceIds: array(number().int())
15102
+ deviceIds: array(number().int()),
15103
+ /**
15104
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15105
+ * excludes it.
15106
+ *
15107
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15108
+ * twelve makes it false in exactly the way nobody notices until an incident.
15109
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15110
+ * still parses as "nothing known to be skipped" rather than failing the whole
15111
+ * alarm tab.
15112
+ */
15113
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
14822
15114
  });
14823
15115
  var NcAlarmConfigSchema = object({
14824
15116
  /**
@@ -17617,9 +17909,16 @@ var CameraStatusSchema = object({
17617
17909
  audio: CameraAudioStatusSchema.nullable(),
17618
17910
  recording: CameraRecordingStatusSchema.nullable(),
17619
17911
  /**
17620
- * Per-camera function switches an OPERATOR has turned off
17912
+ * Per-camera functions an OPERATOR has turned off
17621
17913
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17622
17914
  *
17915
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
17916
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
17917
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
17918
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
17919
+ * The badge outlives the control panel: the panel was a convenience, this is
17920
+ * the difference between a camera being off and a camera being dead.
17921
+ *
17623
17922
  * This is the difference between DISABLED and BROKEN. A camera whose
17624
17923
  * `detection` block reports zero fps and whose `switchedOff` contains
17625
17924
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -23128,7 +23427,19 @@ var RecordingManifestSchema = object({
23128
23427
  * profiles/subtrees/locations on this node). */
23129
23428
  var RecordingDeviceUsageSchema = object({
23130
23429
  deviceId: number(),
23131
- usedBytes: number()
23430
+ usedBytes: number(),
23431
+ /**
23432
+ * Start of this camera's OLDEST indexed segment, across every profile and
23433
+ * location — the "Oldest footage" column in Recordings → Storage, and the
23434
+ * only honest answer to "is retention actually holding?" per camera.
23435
+ *
23436
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
23437
+ * predates this field omits it entirely, and a hub whose types carry the
23438
+ * field must keep validating that older provider's payload: the framework
23439
+ * (types) and the addon ship on different trains, and the addon is usually
23440
+ * the later of the two.
23441
+ */
23442
+ oldestMs: number().nullable().optional()
23132
23443
  });
23133
23444
  /** Recording storage usage + capacity for one storage location. */
23134
23445
  var RecordingLocationUsageSchema = object({
@@ -23156,6 +23467,57 @@ var RecordingStorageUsageSchema = object({
23156
23467
  locations: array(RecordingLocationUsageSchema)
23157
23468
  });
23158
23469
  /**
23470
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
23471
+ *
23472
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
23473
+ * is the operator asking for the EXISTING archive to be brought into line with
23474
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
23475
+ * location, run FIFO behind the single-flight mover.
23476
+ *
23477
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
23478
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
23479
+ * (empty on the plan).
23480
+ */
23481
+ var RecordingRebalanceMoveSchema = object({
23482
+ deviceId: number(),
23483
+ profile: string(),
23484
+ fromLocationId: string(),
23485
+ toLocationId: string(),
23486
+ bytes: number(),
23487
+ files: number().int()
23488
+ });
23489
+ /** Why a pile that is out of place is staying there. Every refusal is
23490
+ * reported: a rebalance that silently drops a camera reads exactly like one
23491
+ * that had nothing to do. */
23492
+ var RecordingRebalanceSkipReasonSchema = _enum([
23493
+ "unassigned",
23494
+ "target-not-writable",
23495
+ "below-threshold",
23496
+ "no-headroom"
23497
+ ]);
23498
+ var RecordingRebalanceSkipSchema = object({
23499
+ deviceId: number(),
23500
+ profile: string(),
23501
+ fromLocationId: string(),
23502
+ /** The location the plan wants; null when the camera has no assignment. */
23503
+ toLocationId: string().nullable(),
23504
+ bytes: number(),
23505
+ reason: RecordingRebalanceSkipReasonSchema
23506
+ });
23507
+ var RecordingRebalancePlanSchema = object({
23508
+ moves: array(RecordingRebalanceMoveSchema),
23509
+ skipped: array(RecordingRebalanceSkipSchema),
23510
+ bytesToMove: number(),
23511
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
23512
+ jobIds: array(string())
23513
+ });
23514
+ var RecordingRebalanceInputSchema = object({
23515
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
23516
+ throttleMbps: number().min(1).max(1e3).optional(),
23517
+ /** Ignore piles smaller than this (default 1 GB). */
23518
+ minMoveGb: number().min(0).optional()
23519
+ });
23520
+ /**
23159
23521
  * Result of locating footage at a wall-clock instant for one device/profile.
23160
23522
  * `segment` carries the covering segment's window; `gap` reports the forward
23161
23523
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -23318,9 +23680,24 @@ method(object({
23318
23680
  }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23319
23681
  kind: "mutation",
23320
23682
  auth: "admin"
23683
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
23684
+ kind: "mutation",
23685
+ auth: "admin"
23686
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
23687
+ kind: "query",
23688
+ auth: "admin"
23689
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23690
+ kind: "mutation",
23691
+ auth: "admin"
23692
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23693
+ kind: "query",
23694
+ auth: "admin"
23695
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23696
+ kind: "mutation",
23697
+ auth: "admin"
23321
23698
  });
23322
23699
  /**
23323
- * `recordingExport` cap — render a footage time range into a single downloadable
23700
+ * `recording-export` cap — render a footage time range into a single downloadable
23324
23701
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
23325
23702
  * bounded lifetime with a durable history, auto-expiry, and optional
23326
23703
  * delete-after-download.
@@ -23335,10 +23712,42 @@ method(object({
23335
23712
  */
23336
23713
  /** Playback-speed multiplier for the render (1 = realtime). */
23337
23714
  var ExportSpeedSchema = number().min(.25).max(32);
23715
+ /**
23716
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23717
+ *
23718
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
23719
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23720
+ * playlist. Handing it absolute epochs would make every call site responsible
23721
+ * for the same subtraction, and the one that forgot would emit a filter that
23722
+ * selects nothing — silently, as a uniform timelapse.
23723
+ */
23724
+ var ExportDenseRangeSchema = object({
23725
+ fromSec: number().nonnegative(),
23726
+ toSec: number().nonnegative()
23727
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
23728
+ /**
23729
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
23730
+ * listed ranges and at the base `everyMs` everywhere else.
23731
+ *
23732
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
23733
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
23734
+ */
23735
+ var ExportDenseSchema = object({
23736
+ everyMs: number().int().positive(),
23737
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
23738
+ });
23338
23739
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
23339
23740
  var ExportTimelapseSchema = object({
23340
23741
  everyMs: number().int().positive(),
23341
- outputFps: number().int().min(1).max(60).optional()
23742
+ outputFps: number().int().min(1).max(60).optional(),
23743
+ /** Optional second, FASTER rate over the intervals that matter. */
23744
+ dense: ExportDenseSchema.optional()
23745
+ }).superRefine((v, ctx) => {
23746
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
23747
+ code: ZodIssueCode.custom,
23748
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
23749
+ path: ["dense", "everyMs"]
23750
+ });
23342
23751
  });
23343
23752
  /**
23344
23753
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -23396,6 +23805,19 @@ var ExportDownloadSchema = object({
23396
23805
  url: string(),
23397
23806
  endpoints: array(string())
23398
23807
  });
23808
+ /**
23809
+ * A finished export's bytes, inline.
23810
+ *
23811
+ * `bytes` is the DECODED length — the number the caller bounds and logs
23812
+ * against, so nobody has to infer it from the base64 length.
23813
+ */
23814
+ var ExportBytesSchema = object({
23815
+ base64: string(),
23816
+ contentType: string(),
23817
+ /** Suggested filename, extension included. */
23818
+ name: string(),
23819
+ bytes: number().int().nonnegative()
23820
+ });
23399
23821
  method(object({
23400
23822
  deviceId: number(),
23401
23823
  profile: string(),
@@ -23420,6 +23842,9 @@ method(object({
23420
23842
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
23421
23843
  kind: "query",
23422
23844
  auth: "protected"
23845
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
23846
+ kind: "query",
23847
+ auth: "protected"
23423
23848
  });
23424
23849
  /**
23425
23850
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -28613,6 +29038,12 @@ Object.freeze({
28613
29038
  addonId: null,
28614
29039
  access: "create"
28615
29040
  },
29041
+ "recording.cancelRelocateJob": {
29042
+ capName: "recording",
29043
+ capScope: "system",
29044
+ addonId: null,
29045
+ access: "create"
29046
+ },
28616
29047
  "recording.cancelStorageMigrationMove": {
28617
29048
  capName: "recording",
28618
29049
  capScope: "system",
@@ -28667,6 +29098,12 @@ Object.freeze({
28667
29098
  addonId: null,
28668
29099
  access: "view"
28669
29100
  },
29101
+ "recording.listRelocateJobs": {
29102
+ capName: "recording",
29103
+ capScope: "system",
29104
+ addonId: null,
29105
+ access: "view"
29106
+ },
28670
29107
  "recording.locateSegment": {
28671
29108
  capName: "recording",
28672
29109
  capScope: "system",
@@ -28679,6 +29116,12 @@ Object.freeze({
28679
29116
  addonId: null,
28680
29117
  access: "create"
28681
29118
  },
29119
+ "recording.planStorageRebalance": {
29120
+ capName: "recording",
29121
+ capScope: "system",
29122
+ addonId: null,
29123
+ access: "view"
29124
+ },
28682
29125
  "recording.pruneFootage": {
28683
29126
  capName: "recording",
28684
29127
  capScope: "system",
@@ -28703,6 +29146,12 @@ Object.freeze({
28703
29146
  addonId: null,
28704
29147
  access: "create"
28705
29148
  },
29149
+ "recording.relocateFootage": {
29150
+ capName: "recording",
29151
+ capScope: "system",
29152
+ addonId: null,
29153
+ access: "create"
29154
+ },
28706
29155
  "recording.renderClip": {
28707
29156
  capName: "recording",
28708
29157
  capScope: "system",
@@ -28739,38 +29188,50 @@ Object.freeze({
28739
29188
  addonId: null,
28740
29189
  access: "create"
28741
29190
  },
29191
+ "recording.startStorageRebalance": {
29192
+ capName: "recording",
29193
+ capScope: "system",
29194
+ addonId: null,
29195
+ access: "create"
29196
+ },
28742
29197
  "recordingExport.cancelExport": {
28743
- capName: "recordingExport",
29198
+ capName: "recording-export",
28744
29199
  capScope: "system",
28745
29200
  addonId: null,
28746
29201
  access: "create"
28747
29202
  },
28748
29203
  "recordingExport.createExport": {
28749
- capName: "recordingExport",
29204
+ capName: "recording-export",
28750
29205
  capScope: "system",
28751
29206
  addonId: null,
28752
29207
  access: "create"
28753
29208
  },
28754
29209
  "recordingExport.deleteExport": {
28755
- capName: "recordingExport",
29210
+ capName: "recording-export",
28756
29211
  capScope: "system",
28757
29212
  addonId: null,
28758
29213
  access: "delete"
28759
29214
  },
28760
29215
  "recordingExport.getDownloadUrl": {
28761
- capName: "recordingExport",
29216
+ capName: "recording-export",
28762
29217
  capScope: "system",
28763
29218
  addonId: null,
28764
29219
  access: "view"
28765
29220
  },
28766
29221
  "recordingExport.getExport": {
28767
- capName: "recordingExport",
29222
+ capName: "recording-export",
28768
29223
  capScope: "system",
28769
29224
  addonId: null,
28770
29225
  access: "view"
28771
29226
  },
28772
29227
  "recordingExport.listExports": {
28773
- capName: "recordingExport",
29228
+ capName: "recording-export",
29229
+ capScope: "system",
29230
+ addonId: null,
29231
+ access: "view"
29232
+ },
29233
+ "recordingExport.readExportBytes": {
29234
+ capName: "recording-export",
28774
29235
  capScope: "system",
28775
29236
  addonId: null,
28776
29237
  access: "view"
@@ -30147,6 +30608,104 @@ var FramerateField = number().int().min(1).max(60);
30147
30608
  var TargetsField = array(NcRuleTargetSchema).min(1);
30148
30609
  var PriorityField = number().int().min(1).max(5);
30149
30610
  /**
30611
+ * Explicit override of the DENSE sampling cadence, seconds.
30612
+ *
30613
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
30614
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
30615
+ * made that same base 3 s and rendered a person pass as two frames.)
30616
+ *
30617
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
30618
+ * `denseCadenceSec` and played at `framerate` occupies
30619
+ *
30620
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
30621
+ *
30622
+ * 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.
30623
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
30624
+ * and therefore the length of a quiet night, does not move.
30625
+ *
30626
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
30627
+ * the recording has them returns the same frames, requested twice. Must be
30628
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
30629
+ * a uniform video the operator believes is two-rate — and upsert refuses it
30630
+ * rather than letting the export cap reject the render hours after the window.
30631
+ */
30632
+ var DenseCadenceSecField = number().min(.1).max(3600);
30633
+ /**
30634
+ * Minimum seconds of OUTPUT video each detection range must occupy.
30635
+ *
30636
+ * The operator-facing form of the arithmetic above: instead of solving for a
30637
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
30638
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
30639
+ * that range every ~583 ms.
30640
+ *
30641
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
30642
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
30643
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
30644
+ * ranges are sampled denser than they need. Per-range cadences require a cap
30645
+ * schema change and are the tracked follow-up.
30646
+ *
30647
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
30648
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
30649
+ * by real footage, never met by duplicating frames into motion that never
30650
+ * happened.
30651
+ */
30652
+ var MinDwellSecField = number().min(0).max(60);
30653
+ /**
30654
+ * Caption burned into the notification's preview frame.
30655
+ *
30656
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
30657
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
30658
+ * templating dialect for one field would be a second thing to explain.
30659
+ *
30660
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
30661
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
30662
+ * the reason this is not `.min(1)`.
30663
+ */
30664
+ var PreviewTextField = string().max(200);
30665
+ /**
30666
+ * Whether the notification's preview is a STILL or a short animation.
30667
+ *
30668
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
30669
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
30670
+ * night reads better as three seconds of motion than as one frame of it. Both
30671
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
30672
+ * simply applies it to a dozen frames sampled across the render and assembles
30673
+ * them.
30674
+ *
30675
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
30676
+ * seeks and a palette pass, and no rule that never asked for one should start
30677
+ * paying that on the deploy that shipped it.
30678
+ *
30679
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
30680
+ */
30681
+ var PreviewModeField = _enum(["image", "gif"]);
30682
+ /**
30683
+ * Which detection classes the notification reports counts for.
30684
+ *
30685
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
30686
+ * plan — no second query — aggregated per class. Absent or empty means "every
30687
+ * class the window actually contained", which is what an operator who never
30688
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
30689
+ * counts cars all night).
30690
+ *
30691
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
30692
+ * …). An unknown name simply never matches and reports nothing — it is not an
30693
+ * error, because a rule may legitimately name a class this camera's model does
30694
+ * not emit.
30695
+ *
30696
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
30697
+ * - `{{detections}}` — total over the reported classes
30698
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
30699
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
30700
+ * one per class, `count_` + the class name
30701
+ *
30702
+ * With NO custom body template the summary is appended to the derived body, and
30703
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
30704
+ * reads. With a custom template the operator owns every word — nothing is
30705
+ * appended, so `{{detectionSummary}}` is how he asks for it.
30706
+ */
30707
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
30708
+ /**
30150
30709
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
30151
30710
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
30152
30711
  * here (see the ownership note above).
@@ -30166,9 +30725,30 @@ var TimelapseRuleInputSchema = object({
30166
30725
  cadenceSec: CadenceSecField.default(15),
30167
30726
  /** Output frames per second of the assembled mp4 (predecessor parity). */
30168
30727
  framerate: FramerateField.default(10),
30728
+ /**
30729
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
30730
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
30731
+ * field gets.
30732
+ */
30733
+ denseCadenceSec: DenseCadenceSecField.optional(),
30734
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
30735
+ minDwellSec: MinDwellSecField.optional(),
30169
30736
  /** `notification-output` targets the finished video/thumbnail is sent to. */
30170
30737
  targets: TargetsField,
30171
30738
  template: TimelapseTemplateSchema.optional(),
30739
+ /**
30740
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
30741
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
30742
+ *
30743
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
30744
+ * the notification's title/body, and clearing it (`template: null`) must not
30745
+ * silently clear the caption too.
30746
+ */
30747
+ previewText: PreviewTextField.optional(),
30748
+ /** Still or animation — see {@link PreviewModeField}. */
30749
+ previewMode: PreviewModeField.default("image"),
30750
+ /** Classes the notification counts — see {@link ReportClassesField}. */
30751
+ reportClasses: ReportClassesField.optional(),
30172
30752
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
30173
30753
  priority: PriorityField.default(3)
30174
30754
  });
@@ -30179,8 +30759,13 @@ object({
30179
30759
  schedule: NcScheduleSchema.optional(),
30180
30760
  cadenceSec: CadenceSecField.optional(),
30181
30761
  framerate: FramerateField.optional(),
30762
+ denseCadenceSec: DenseCadenceSecField.optional(),
30763
+ minDwellSec: MinDwellSecField.optional(),
30182
30764
  targets: TargetsField.optional(),
30183
30765
  template: TimelapseTemplateSchema.nullable().optional(),
30766
+ previewText: PreviewTextField.optional(),
30767
+ previewMode: PreviewModeField.optional(),
30768
+ reportClasses: ReportClassesField.optional(),
30184
30769
  priority: PriorityField.optional()
30185
30770
  });
30186
30771
  TimelapseRuleInputSchema.extend({
@@ -30192,10 +30777,28 @@ TimelapseRuleInputSchema.extend({
30192
30777
  */
30193
30778
  ownerUserId: string().optional(),
30194
30779
  /**
30195
- * Epoch-ms of the last successful generation the 1-hour re-generation
30196
- * guard's durable state (predecessor parity). Absent = never generated.
30780
+ * Epoch-ms of the NEWEST successful generation across every camera of this
30781
+ * rule. What a UI shows, and the compatibility floor for
30782
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
30197
30783
  */
30198
30784
  lastGeneratedAt: number().optional(),
30785
+ /**
30786
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
30787
+ * re-generation guard's real durable state.
30788
+ *
30789
+ * One rule covers several cameras and each renders its own video, so a rule
30790
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
30791
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
30792
+ * already done — and B's night is gone for good, because the window will not
30793
+ * come back.
30794
+ *
30795
+ * ADDITIVE, so the migration is free: a row written before this field simply
30796
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
30797
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
30798
+ * "never generated" would re-render and re-notify every camera of every rule
30799
+ * once, on the deploy that shipped the map.
30800
+ */
30801
+ generatedByDevice: record(string(), number()).optional(),
30199
30802
  /** userId of the caller who created the rule (server-stamped). */
30200
30803
  createdBy: string(),
30201
30804
  createdAt: number(),