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