@camstack/addon-matter-broker 0.2.12 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +625 -22
  2. package/dist/addon.mjs +625 -22
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -7231,8 +7231,31 @@ var AdoptionJobSchema = object({
7231
7231
  error: string$2().nullable()
7232
7232
  });
7233
7233
  /**
7234
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7235
- * pipeline functions an operator thinks in terms of.
7234
+ * Per-camera FUNCTION SWITCHES.
7235
+ *
7236
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7237
+ *
7238
+ * This file shipped as "the one coherent on/off surface over the pipeline
7239
+ * functions an operator thinks in terms of". The operator's verdict on
7240
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7241
+ * every function already had a settings page of its own, and a second place to
7242
+ * turn it off is a second place to look. Each switch is going back to its own
7243
+ * component's original options — detection to the detection-pipeline wrapper
7244
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7245
+ * (which was always first-class; the switch was a veneer over
7246
+ * `recording.setDeviceConfig`), notifications to a notification-center
7247
+ * per-device setting, the two camera planes to their own components.
7248
+ *
7249
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7250
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7251
+ * straight from the authorities with no group in the middle. That rule was
7252
+ * never about a control panel.
7253
+ *
7254
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7255
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7256
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7257
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7258
+ * stop; nothing new may be built on it.
7236
7259
  *
7237
7260
  * ## This file adds no state
7238
7261
  *
@@ -7583,7 +7606,15 @@ var RecordingConfigSchema = object({
7583
7606
  * Each completed/failed run also lands one durable ops-log row on its owning
7584
7607
  * addon surface.
7585
7608
  */
7609
+ /**
7610
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7611
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7612
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7613
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7614
+ * runs at all.
7615
+ */
7586
7616
  var RelocateJobStateSchema = _enum([
7617
+ "queued",
7587
7618
  "running",
7588
7619
  "done",
7589
7620
  "failed",
@@ -7618,6 +7649,15 @@ var RelocateFootageInputSchema = object({
7618
7649
  /** Limits relocation to the logical profile class. Omit only for the
7619
7650
  * pre-orchestration compatibility path. */
7620
7651
  footageClass: RelocateFootageClassSchema.optional(),
7652
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7653
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7654
+ * unit is a (camera, profile) pile, not a disk. */
7655
+ deviceId: number().int().optional(),
7656
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7657
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7658
+ * placement plan assigns those two independently, so a rebalance that could
7659
+ * only say "recordings" would move footage the plan never asked to move. */
7660
+ profiles: array(string$2()).optional(),
7621
7661
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7622
7662
  * never allowed to starve live writers. */
7623
7663
  throttleMbps: number().min(1).max(1e3).optional()
@@ -7753,6 +7793,21 @@ var StorageLocationSchema = object({
7753
7793
  nodeId: string$2().optional(),
7754
7794
  isDefault: boolean().default(false),
7755
7795
  isSystem: boolean().default(false),
7796
+ /**
7797
+ * Operator opt-in: whether consumers that BALANCE across several locations
7798
+ * of a type may write here. Recordings reads it today; event media and
7799
+ * backups are the next consumers, which is why the flag lives on the
7800
+ * location rather than in any one addon's store — nothing has to be
7801
+ * extended to add the next consumer.
7802
+ *
7803
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7804
+ * flag existed reads back with no flag and keeps working exactly as before;
7805
+ * that is the whole compat story, and it is why no migration ships with it.
7806
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7807
+ * disk must not silently start writing to it); the default of a type is
7808
+ * always stamped `true`.
7809
+ */
7810
+ enabled: boolean().optional(),
7756
7811
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7757
7812
  * for node-local locations it can reach) — never persisted, absent when the
7758
7813
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12371,7 +12426,8 @@ method(object({
12371
12426
  }), EmbeddingResultSchema), method(object({ text: string$2() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12372
12427
  /**
12373
12428
  * filesystem-browse — per-node capability for browsing the node's local
12374
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12429
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12430
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12375
12431
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12376
12432
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12377
12433
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -14212,6 +14268,13 @@ var MaskGridDimsSchema = object({
14212
14268
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
14213
14269
  * this one field keeps the schema additive — a rule still declares exactly
14214
14270
  * one trigger.
14271
+ *
14272
+ * AUDIO rules add no member here, for the reason occupancy added none: the
14273
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
14274
+ * mirror.ts` fails the build on a member the app cannot render) and every
14275
+ * member costs a release train. A sustained-sound rule is therefore an
14276
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
14277
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
14215
14278
  */
14216
14279
  var NcDeliverySchema = _enum([
14217
14280
  "immediate",
@@ -14226,15 +14289,32 @@ var NcDeliverySchema = _enum([
14226
14289
  * depend on a provider's raw event name or payload shape.
14227
14290
  */
14228
14291
  var NcSystemEventKindSchema = _enum([
14229
- "camera-online",
14230
- "camera-offline",
14292
+ "device-online",
14293
+ "device-offline",
14294
+ "device-disabled",
14295
+ "device-enabled",
14231
14296
  "stream-online",
14232
14297
  "stream-offline",
14233
14298
  "node-online",
14234
14299
  "node-offline",
14235
14300
  "addon-update-available",
14236
- "server-update-available"
14301
+ "server-update-available",
14302
+ "alarm-triggered",
14303
+ "alarm-armed",
14304
+ "alarm-disarmed",
14305
+ "camera-online",
14306
+ "camera-offline",
14307
+ "camera-disabled",
14308
+ "camera-enabled"
14237
14309
  ]);
14310
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14311
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14312
+ "camera-online",
14313
+ "camera-offline",
14314
+ "camera-disabled",
14315
+ "camera-enabled"
14316
+ ]);
14317
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
14238
14318
  /**
14239
14319
  * One coherent system-event condition. `kinds` is the required opt-in safety
14240
14320
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -14243,6 +14323,18 @@ var NcSystemEventKindSchema = _enum([
14243
14323
  var NcSystemEventConditionSchema = object({
14244
14324
  kinds: array(NcSystemEventKindSchema).min(1),
14245
14325
  deviceIds: array(number().int()).min(1).optional(),
14326
+ /**
14327
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14328
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14329
+ * is what a liveness rule means when nobody said otherwise.
14330
+ *
14331
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14332
+ * one reason: the intake cannot know which devices this household cares
14333
+ * about, and a producer-side filter is one no operator can change. Fails
14334
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14335
+ * does not carry) matches no `deviceTypes` list.
14336
+ */
14337
+ deviceTypes: array(string$2().min(1)).min(1).optional(),
14246
14338
  nodeIds: array(string$2().min(1)).min(1).optional(),
14247
14339
  packageNames: array(string$2().min(1)).min(1).optional()
14248
14340
  });
@@ -14293,6 +14385,47 @@ var NcOccupancyConditionSchema = object({
14293
14385
  sustainSeconds: number().int().min(0).max(3600).default(15)
14294
14386
  });
14295
14387
  /**
14388
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14389
+ *
14390
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14391
+ * reference notifier uses, so an operator moving between them re-uses what
14392
+ * they already know): a rule matches when, over a sampling window of
14393
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14394
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14395
+ *
14396
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14397
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14398
+ * - `labels` — the classifier put at least one of these labels on it.
14399
+ *
14400
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14401
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14402
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14403
+ * is given** — a window in which every sample is trivially a hit would fire on
14404
+ * silence, so the engine refuses such a condition rather than notifying on
14405
+ * nothing (the schema cannot express "at least one of" without becoming a
14406
+ * ZodEffects the cap path would have to special-case).
14407
+ *
14408
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14409
+ * must be FULL before it can match — a window that has been open for two
14410
+ * seconds of its ten is 100% of nothing, and firing on it would make
14411
+ * `samplingSeconds` decorative.
14412
+ *
14413
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14414
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14415
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14416
+ * an operator who typed `dog` mean the same thing.
14417
+ */
14418
+ var NcAudioConditionSchema = object({
14419
+ /** Audio macro labels; absent = any sound (level-only rule). */
14420
+ labels: array(string$2().min(1)).min(1).optional(),
14421
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14422
+ dbThreshold: number().min(-96).max(0).optional(),
14423
+ /** Percentage of the window's samples that must be hits (1–100). */
14424
+ hitPercent: number().int().min(1).max(100).default(60),
14425
+ /** Length of the sampling window in seconds. */
14426
+ samplingSeconds: number().int().min(1).max(300).default(10)
14427
+ });
14428
+ /**
14296
14429
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
14297
14430
  *
14298
14431
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14565,7 +14698,33 @@ var NcConditionsSchema = object({
14565
14698
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14566
14699
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14567
14700
  */
14568
- occupancy: NcOccupancyConditionSchema.optional()
14701
+ occupancy: NcOccupancyConditionSchema.optional(),
14702
+ /**
14703
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14704
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14705
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14706
+ * a window that is not full yet, neither filter given). See
14707
+ * {@link NcAudioCondition}.
14708
+ *
14709
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14710
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14711
+ * a detection, a track or a device event (the same fail-closed pairing
14712
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14713
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14714
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14715
+ * classified sample) stays exactly as it was for rules that already use it.
14716
+ *
14717
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14718
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14719
+ * (`camstack/src/data/notification-center.ts`, guarded by
14720
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14721
+ * condition fields it does not know when a rule is saved from the phone.
14722
+ * Publishing an editor for a condition the app cannot round-trip is how an
14723
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14724
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14725
+ * does an audio rule become authorable.
14726
+ */
14727
+ audio: NcAudioConditionSchema.optional()
14569
14728
  });
14570
14729
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14571
14730
  var NcRuleTargetSchema = object({
@@ -14679,6 +14838,73 @@ var NcThrottleSchema = object({
14679
14838
  */
14680
14839
  granularity: NcThrottleGranularitySchema.optional()
14681
14840
  });
14841
+ /**
14842
+ * How long the confirm gate may hold ONE notification, and how big the picture
14843
+ * it judges may be.
14844
+ *
14845
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14846
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14847
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14848
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14849
+ * tokens for pixels the model pools away.
14850
+ */
14851
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14852
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14853
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14854
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14855
+ var NcConfirmExpectSchema = object({
14856
+ op: _enum([
14857
+ ">=",
14858
+ ">",
14859
+ "<=",
14860
+ "<",
14861
+ "=="
14862
+ ]),
14863
+ count: number().int().min(0).max(1e3)
14864
+ });
14865
+ /**
14866
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14867
+ * to ship and says whether it agrees with the rule.
14868
+ *
14869
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14870
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14871
+ * on the operator's phone is not a verdict about this notification.
14872
+ *
14873
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14874
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14875
+ * the default and every fail-open is COUNTED, because a gate that always fails
14876
+ * open looks in the log exactly like a gate that works.
14877
+ *
14878
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14879
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14880
+ * production failures in one day), so the gate reads absent as the constant
14881
+ * above rather than trusting a parse it may never have seen.
14882
+ */
14883
+ var NcConfirmSchema = object({
14884
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14885
+ * same thing, and both mean "deliver exactly as before". */
14886
+ enabled: boolean().default(false),
14887
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14888
+ profileId: string$2().optional(),
14889
+ /**
14890
+ * The operator's question, in his own words. Absent = a question derived
14891
+ * from the rule (its class and its expectation).
14892
+ *
14893
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14894
+ * banners, signage and plates as instructions if you let them reach the
14895
+ * prompt — proven live — so the authoritative contract stays in the system
14896
+ * turn and only rule-authored words land here.
14897
+ */
14898
+ prompt: string$2().max(1e3).optional(),
14899
+ /** Fire only when the model's count satisfies this. Absent = the model's
14900
+ * own boolean verdict decides. */
14901
+ expect: NcConfirmExpectSchema.optional(),
14902
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14903
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14904
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14905
+ /** Longest edge the judged image is downscaled to before it is sent. */
14906
+ maxImagePx: number().int().min(64).max(2048).default(448)
14907
+ });
14682
14908
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14683
14909
  var NcRuleInputSchema = object({
14684
14910
  name: string$2().min(1).max(200),
@@ -14739,7 +14965,13 @@ var NcRuleInputSchema = object({
14739
14965
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14740
14966
  * shape as every other actuation.
14741
14967
  */
14742
- actions: NcRuleActionsSchema.optional()
14968
+ actions: NcRuleActionsSchema.optional(),
14969
+ /**
14970
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14971
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14972
+ * did, and absent is the only way to say that without a migration.
14973
+ */
14974
+ confirm: NcConfirmSchema.optional()
14743
14975
  });
14744
14976
  /**
14745
14977
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14750,7 +14982,37 @@ var NcRuleInputSchema = object({
14750
14982
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14751
14983
  * `updateRule` patch.
14752
14984
  */
14753
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string$2()).optional() });
14985
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14986
+ disabledTargetIds: array(string$2()).optional(),
14987
+ /**
14988
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14989
+ *
14990
+ * It makes the key optional to SUPPLY; the parse still materialises the
14991
+ * default when the key is absent. And `NcRuleStore.update` merges with
14992
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14993
+ * one — which made every partial edit destructive:
14994
+ *
14995
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14996
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14997
+ * setEnabled(ruleId, false) → conditions reset to `{}`
14998
+ *
14999
+ * A rule scoped to one camera and one zone silently became a rule that
15000
+ * matches EVERY event on EVERY camera, and lost its `media` policy
15001
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
15002
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
15003
+ * within a minute of a two-field patch.
15004
+ *
15005
+ * So every defaulted field is re-declared here WITHOUT its default. The
15006
+ * inner defaults still apply when the caller DOES send the key — `{}` for
15007
+ * conditions remains a real instruction ("clear them") — and only the
15008
+ * absent key is now genuinely absent.
15009
+ */
15010
+ enabled: boolean().optional(),
15011
+ conditions: NcConditionsSchema.optional(),
15012
+ media: NcMediaPolicySchema.optional(),
15013
+ throttle: NcThrottleSchema.optional(),
15014
+ priority: number().int().min(1).max(5).optional()
15015
+ });
14754
15016
  /** A persisted rule. */
14755
15017
  var NcRuleSchema = NcRuleInputSchema.extend({
14756
15018
  id: string$2(),
@@ -15051,6 +15313,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
15051
15313
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
15052
15314
  * copy would lie the first time a rule is disabled.
15053
15315
  */
15316
+ /**
15317
+ * Why a device a mode NAMES is nonetheless not armed by it.
15318
+ *
15319
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15320
+ * per-camera notification switch the Notification Center already owns,
15321
+ * `detection-off` is the device's own detection binding being inactive, and
15322
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15323
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15324
+ * with the switches the operator actually used.
15325
+ */
15326
+ var NcAlarmSkipReasonSchema = _enum([
15327
+ "muted",
15328
+ "detection-off",
15329
+ "offline"
15330
+ ]);
15331
+ var NcAlarmSkippedDeviceSchema = object({
15332
+ deviceId: number().int(),
15333
+ reason: NcAlarmSkipReasonSchema
15334
+ });
15054
15335
  var NcAlarmModeCoverageSchema = object({
15055
15336
  mode: AlarmArmModeSchema,
15056
15337
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -15058,7 +15339,18 @@ var NcAlarmModeCoverageSchema = object({
15058
15339
  /** At least one covering rule has no device scope, so the mode covers all. */
15059
15340
  allDevices: boolean(),
15060
15341
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
15061
- deviceIds: array(number().int())
15342
+ deviceIds: array(number().int()),
15343
+ /**
15344
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15345
+ * excludes it.
15346
+ *
15347
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15348
+ * twelve makes it false in exactly the way nobody notices until an incident.
15349
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15350
+ * still parses as "nothing known to be skipped" rather than failing the whole
15351
+ * alarm tab.
15352
+ */
15353
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
15062
15354
  });
15063
15355
  var NcAlarmConfigSchema = object({
15064
15356
  /**
@@ -17890,9 +18182,16 @@ var CameraStatusSchema = object({
17890
18182
  audio: CameraAudioStatusSchema.nullable(),
17891
18183
  recording: CameraRecordingStatusSchema.nullable(),
17892
18184
  /**
17893
- * Per-camera function switches an OPERATOR has turned off
18185
+ * Per-camera functions an OPERATOR has turned off
17894
18186
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17895
18187
  *
18188
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
18189
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
18190
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
18191
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
18192
+ * The badge outlives the control panel: the panel was a convenience, this is
18193
+ * the difference between a camera being off and a camera being dead.
18194
+ *
17896
18195
  * This is the difference between DISABLED and BROKEN. A camera whose
17897
18196
  * `detection` block reports zero fps and whose `switchedOff` contains
17898
18197
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -24651,7 +24950,19 @@ var RecordingManifestSchema = object({
24651
24950
  * profiles/subtrees/locations on this node). */
24652
24951
  var RecordingDeviceUsageSchema = object({
24653
24952
  deviceId: number(),
24654
- usedBytes: number()
24953
+ usedBytes: number(),
24954
+ /**
24955
+ * Start of this camera's OLDEST indexed segment, across every profile and
24956
+ * location — the "Oldest footage" column in Recordings → Storage, and the
24957
+ * only honest answer to "is retention actually holding?" per camera.
24958
+ *
24959
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
24960
+ * predates this field omits it entirely, and a hub whose types carry the
24961
+ * field must keep validating that older provider's payload: the framework
24962
+ * (types) and the addon ship on different trains, and the addon is usually
24963
+ * the later of the two.
24964
+ */
24965
+ oldestMs: number().nullable().optional()
24655
24966
  });
24656
24967
  /** Recording storage usage + capacity for one storage location. */
24657
24968
  var RecordingLocationUsageSchema = object({
@@ -24679,6 +24990,57 @@ var RecordingStorageUsageSchema = object({
24679
24990
  locations: array(RecordingLocationUsageSchema)
24680
24991
  });
24681
24992
  /**
24993
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
24994
+ *
24995
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
24996
+ * is the operator asking for the EXISTING archive to be brought into line with
24997
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
24998
+ * location, run FIFO behind the single-flight mover.
24999
+ *
25000
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
25001
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
25002
+ * (empty on the plan).
25003
+ */
25004
+ var RecordingRebalanceMoveSchema = object({
25005
+ deviceId: number(),
25006
+ profile: string$2(),
25007
+ fromLocationId: string$2(),
25008
+ toLocationId: string$2(),
25009
+ bytes: number(),
25010
+ files: number().int()
25011
+ });
25012
+ /** Why a pile that is out of place is staying there. Every refusal is
25013
+ * reported: a rebalance that silently drops a camera reads exactly like one
25014
+ * that had nothing to do. */
25015
+ var RecordingRebalanceSkipReasonSchema = _enum([
25016
+ "unassigned",
25017
+ "target-not-writable",
25018
+ "below-threshold",
25019
+ "no-headroom"
25020
+ ]);
25021
+ var RecordingRebalanceSkipSchema = object({
25022
+ deviceId: number(),
25023
+ profile: string$2(),
25024
+ fromLocationId: string$2(),
25025
+ /** The location the plan wants; null when the camera has no assignment. */
25026
+ toLocationId: string$2().nullable(),
25027
+ bytes: number(),
25028
+ reason: RecordingRebalanceSkipReasonSchema
25029
+ });
25030
+ var RecordingRebalancePlanSchema = object({
25031
+ moves: array(RecordingRebalanceMoveSchema),
25032
+ skipped: array(RecordingRebalanceSkipSchema),
25033
+ bytesToMove: number(),
25034
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
25035
+ jobIds: array(string$2())
25036
+ });
25037
+ var RecordingRebalanceInputSchema = object({
25038
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
25039
+ throttleMbps: number().min(1).max(1e3).optional(),
25040
+ /** Ignore piles smaller than this (default 1 GB). */
25041
+ minMoveGb: number().min(0).optional()
25042
+ });
25043
+ /**
24682
25044
  * Result of locating footage at a wall-clock instant for one device/profile.
24683
25045
  * `segment` carries the covering segment's window; `gap` reports the forward
24684
25046
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -24841,9 +25203,24 @@ method(object({
24841
25203
  }), method(object({ jobId: string$2() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
24842
25204
  kind: "mutation",
24843
25205
  auth: "admin"
25206
+ }), method(RelocateFootageInputSchema, object({ jobId: string$2() }), {
25207
+ kind: "mutation",
25208
+ auth: "admin"
25209
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
25210
+ kind: "query",
25211
+ auth: "admin"
25212
+ }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
25213
+ kind: "mutation",
25214
+ auth: "admin"
25215
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25216
+ kind: "query",
25217
+ auth: "admin"
25218
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25219
+ kind: "mutation",
25220
+ auth: "admin"
24844
25221
  });
24845
25222
  /**
24846
- * `recordingExport` cap — render a footage time range into a single downloadable
25223
+ * `recording-export` cap — render a footage time range into a single downloadable
24847
25224
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
24848
25225
  * bounded lifetime with a durable history, auto-expiry, and optional
24849
25226
  * delete-after-download.
@@ -24858,10 +25235,42 @@ method(object({
24858
25235
  */
24859
25236
  /** Playback-speed multiplier for the render (1 = realtime). */
24860
25237
  var ExportSpeedSchema = number().min(.25).max(32);
25238
+ /**
25239
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25240
+ *
25241
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
25242
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25243
+ * playlist. Handing it absolute epochs would make every call site responsible
25244
+ * for the same subtraction, and the one that forgot would emit a filter that
25245
+ * selects nothing — silently, as a uniform timelapse.
25246
+ */
25247
+ var ExportDenseRangeSchema = object({
25248
+ fromSec: number().nonnegative(),
25249
+ toSec: number().nonnegative()
25250
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
25251
+ /**
25252
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
25253
+ * listed ranges and at the base `everyMs` everywhere else.
25254
+ *
25255
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
25256
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
25257
+ */
25258
+ var ExportDenseSchema = object({
25259
+ everyMs: number().int().positive(),
25260
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
25261
+ });
24861
25262
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
24862
25263
  var ExportTimelapseSchema = object({
24863
25264
  everyMs: number().int().positive(),
24864
- outputFps: number().int().min(1).max(60).optional()
25265
+ outputFps: number().int().min(1).max(60).optional(),
25266
+ /** Optional second, FASTER rate over the intervals that matter. */
25267
+ dense: ExportDenseSchema.optional()
25268
+ }).superRefine((v, ctx) => {
25269
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
25270
+ code: ZodIssueCode.custom,
25271
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
25272
+ path: ["dense", "everyMs"]
25273
+ });
24865
25274
  });
24866
25275
  /**
24867
25276
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -24919,6 +25328,19 @@ var ExportDownloadSchema = object({
24919
25328
  url: string$2(),
24920
25329
  endpoints: array(string$2())
24921
25330
  });
25331
+ /**
25332
+ * A finished export's bytes, inline.
25333
+ *
25334
+ * `bytes` is the DECODED length — the number the caller bounds and logs
25335
+ * against, so nobody has to infer it from the base64 length.
25336
+ */
25337
+ var ExportBytesSchema = object({
25338
+ base64: string$2(),
25339
+ contentType: string$2(),
25340
+ /** Suggested filename, extension included. */
25341
+ name: string$2(),
25342
+ bytes: number().int().nonnegative()
25343
+ });
24922
25344
  method(object({
24923
25345
  deviceId: number(),
24924
25346
  profile: string$2(),
@@ -24943,6 +25365,9 @@ method(object({
24943
25365
  }), method(object({ exportId: string$2() }), ExportDownloadSchema, {
24944
25366
  kind: "query",
24945
25367
  auth: "protected"
25368
+ }), method(object({ exportId: string$2() }), ExportBytesSchema, {
25369
+ kind: "query",
25370
+ auth: "protected"
24946
25371
  });
24947
25372
  /**
24948
25373
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -31620,6 +32045,12 @@ Object.freeze({
31620
32045
  addonId: null,
31621
32046
  access: "create"
31622
32047
  },
32048
+ "recording.cancelRelocateJob": {
32049
+ capName: "recording",
32050
+ capScope: "system",
32051
+ addonId: null,
32052
+ access: "create"
32053
+ },
31623
32054
  "recording.cancelStorageMigrationMove": {
31624
32055
  capName: "recording",
31625
32056
  capScope: "system",
@@ -31674,6 +32105,12 @@ Object.freeze({
31674
32105
  addonId: null,
31675
32106
  access: "view"
31676
32107
  },
32108
+ "recording.listRelocateJobs": {
32109
+ capName: "recording",
32110
+ capScope: "system",
32111
+ addonId: null,
32112
+ access: "view"
32113
+ },
31677
32114
  "recording.locateSegment": {
31678
32115
  capName: "recording",
31679
32116
  capScope: "system",
@@ -31686,6 +32123,12 @@ Object.freeze({
31686
32123
  addonId: null,
31687
32124
  access: "create"
31688
32125
  },
32126
+ "recording.planStorageRebalance": {
32127
+ capName: "recording",
32128
+ capScope: "system",
32129
+ addonId: null,
32130
+ access: "view"
32131
+ },
31689
32132
  "recording.pruneFootage": {
31690
32133
  capName: "recording",
31691
32134
  capScope: "system",
@@ -31710,6 +32153,12 @@ Object.freeze({
31710
32153
  addonId: null,
31711
32154
  access: "create"
31712
32155
  },
32156
+ "recording.relocateFootage": {
32157
+ capName: "recording",
32158
+ capScope: "system",
32159
+ addonId: null,
32160
+ access: "create"
32161
+ },
31713
32162
  "recording.renderClip": {
31714
32163
  capName: "recording",
31715
32164
  capScope: "system",
@@ -31746,38 +32195,50 @@ Object.freeze({
31746
32195
  addonId: null,
31747
32196
  access: "create"
31748
32197
  },
32198
+ "recording.startStorageRebalance": {
32199
+ capName: "recording",
32200
+ capScope: "system",
32201
+ addonId: null,
32202
+ access: "create"
32203
+ },
31749
32204
  "recordingExport.cancelExport": {
31750
- capName: "recordingExport",
32205
+ capName: "recording-export",
31751
32206
  capScope: "system",
31752
32207
  addonId: null,
31753
32208
  access: "create"
31754
32209
  },
31755
32210
  "recordingExport.createExport": {
31756
- capName: "recordingExport",
32211
+ capName: "recording-export",
31757
32212
  capScope: "system",
31758
32213
  addonId: null,
31759
32214
  access: "create"
31760
32215
  },
31761
32216
  "recordingExport.deleteExport": {
31762
- capName: "recordingExport",
32217
+ capName: "recording-export",
31763
32218
  capScope: "system",
31764
32219
  addonId: null,
31765
32220
  access: "delete"
31766
32221
  },
31767
32222
  "recordingExport.getDownloadUrl": {
31768
- capName: "recordingExport",
32223
+ capName: "recording-export",
31769
32224
  capScope: "system",
31770
32225
  addonId: null,
31771
32226
  access: "view"
31772
32227
  },
31773
32228
  "recordingExport.getExport": {
31774
- capName: "recordingExport",
32229
+ capName: "recording-export",
31775
32230
  capScope: "system",
31776
32231
  addonId: null,
31777
32232
  access: "view"
31778
32233
  },
31779
32234
  "recordingExport.listExports": {
31780
- capName: "recordingExport",
32235
+ capName: "recording-export",
32236
+ capScope: "system",
32237
+ addonId: null,
32238
+ access: "view"
32239
+ },
32240
+ "recordingExport.readExportBytes": {
32241
+ capName: "recording-export",
31781
32242
  capScope: "system",
31782
32243
  addonId: null,
31783
32244
  access: "view"
@@ -33154,6 +33615,104 @@ var FramerateField = number().int().min(1).max(60);
33154
33615
  var TargetsField = array(NcRuleTargetSchema).min(1);
33155
33616
  var PriorityField = number().int().min(1).max(5);
33156
33617
  /**
33618
+ * Explicit override of the DENSE sampling cadence, seconds.
33619
+ *
33620
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
33621
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
33622
+ * made that same base 3 s and rendered a person pass as two frames.)
33623
+ *
33624
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
33625
+ * `denseCadenceSec` and played at `framerate` occupies
33626
+ *
33627
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
33628
+ *
33629
+ * 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.
33630
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
33631
+ * and therefore the length of a quiet night, does not move.
33632
+ *
33633
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
33634
+ * the recording has them returns the same frames, requested twice. Must be
33635
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
33636
+ * a uniform video the operator believes is two-rate — and upsert refuses it
33637
+ * rather than letting the export cap reject the render hours after the window.
33638
+ */
33639
+ var DenseCadenceSecField = number().min(.1).max(3600);
33640
+ /**
33641
+ * Minimum seconds of OUTPUT video each detection range must occupy.
33642
+ *
33643
+ * The operator-facing form of the arithmetic above: instead of solving for a
33644
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
33645
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
33646
+ * that range every ~583 ms.
33647
+ *
33648
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
33649
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
33650
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
33651
+ * ranges are sampled denser than they need. Per-range cadences require a cap
33652
+ * schema change and are the tracked follow-up.
33653
+ *
33654
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
33655
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
33656
+ * by real footage, never met by duplicating frames into motion that never
33657
+ * happened.
33658
+ */
33659
+ var MinDwellSecField = number().min(0).max(60);
33660
+ /**
33661
+ * Caption burned into the notification's preview frame.
33662
+ *
33663
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
33664
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
33665
+ * templating dialect for one field would be a second thing to explain.
33666
+ *
33667
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
33668
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
33669
+ * the reason this is not `.min(1)`.
33670
+ */
33671
+ var PreviewTextField = string$2().max(200);
33672
+ /**
33673
+ * Whether the notification's preview is a STILL or a short animation.
33674
+ *
33675
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
33676
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
33677
+ * night reads better as three seconds of motion than as one frame of it. Both
33678
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
33679
+ * simply applies it to a dozen frames sampled across the render and assembles
33680
+ * them.
33681
+ *
33682
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
33683
+ * seeks and a palette pass, and no rule that never asked for one should start
33684
+ * paying that on the deploy that shipped it.
33685
+ *
33686
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
33687
+ */
33688
+ var PreviewModeField = _enum(["image", "gif"]);
33689
+ /**
33690
+ * Which detection classes the notification reports counts for.
33691
+ *
33692
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
33693
+ * plan — no second query — aggregated per class. Absent or empty means "every
33694
+ * class the window actually contained", which is what an operator who never
33695
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
33696
+ * counts cars all night).
33697
+ *
33698
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
33699
+ * …). An unknown name simply never matches and reports nothing — it is not an
33700
+ * error, because a rule may legitimately name a class this camera's model does
33701
+ * not emit.
33702
+ *
33703
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
33704
+ * - `{{detections}}` — total over the reported classes
33705
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
33706
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
33707
+ * one per class, `count_` + the class name
33708
+ *
33709
+ * With NO custom body template the summary is appended to the derived body, and
33710
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
33711
+ * reads. With a custom template the operator owns every word — nothing is
33712
+ * appended, so `{{detectionSummary}}` is how he asks for it.
33713
+ */
33714
+ var ReportClassesField = array(string$2().min(1).max(40)).max(20);
33715
+ /**
33157
33716
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
33158
33717
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
33159
33718
  * here (see the ownership note above).
@@ -33173,9 +33732,30 @@ var TimelapseRuleInputSchema = object({
33173
33732
  cadenceSec: CadenceSecField.default(15),
33174
33733
  /** Output frames per second of the assembled mp4 (predecessor parity). */
33175
33734
  framerate: FramerateField.default(10),
33735
+ /**
33736
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
33737
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
33738
+ * field gets.
33739
+ */
33740
+ denseCadenceSec: DenseCadenceSecField.optional(),
33741
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
33742
+ minDwellSec: MinDwellSecField.optional(),
33176
33743
  /** `notification-output` targets the finished video/thumbnail is sent to. */
33177
33744
  targets: TargetsField,
33178
33745
  template: TimelapseTemplateSchema.optional(),
33746
+ /**
33747
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
33748
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
33749
+ *
33750
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
33751
+ * the notification's title/body, and clearing it (`template: null`) must not
33752
+ * silently clear the caption too.
33753
+ */
33754
+ previewText: PreviewTextField.optional(),
33755
+ /** Still or animation — see {@link PreviewModeField}. */
33756
+ previewMode: PreviewModeField.default("image"),
33757
+ /** Classes the notification counts — see {@link ReportClassesField}. */
33758
+ reportClasses: ReportClassesField.optional(),
33179
33759
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
33180
33760
  priority: PriorityField.default(3)
33181
33761
  });
@@ -33186,8 +33766,13 @@ object({
33186
33766
  schedule: NcScheduleSchema.optional(),
33187
33767
  cadenceSec: CadenceSecField.optional(),
33188
33768
  framerate: FramerateField.optional(),
33769
+ denseCadenceSec: DenseCadenceSecField.optional(),
33770
+ minDwellSec: MinDwellSecField.optional(),
33189
33771
  targets: TargetsField.optional(),
33190
33772
  template: TimelapseTemplateSchema.nullable().optional(),
33773
+ previewText: PreviewTextField.optional(),
33774
+ previewMode: PreviewModeField.optional(),
33775
+ reportClasses: ReportClassesField.optional(),
33191
33776
  priority: PriorityField.optional()
33192
33777
  });
33193
33778
  TimelapseRuleInputSchema.extend({
@@ -33199,10 +33784,28 @@ TimelapseRuleInputSchema.extend({
33199
33784
  */
33200
33785
  ownerUserId: string$2().optional(),
33201
33786
  /**
33202
- * Epoch-ms of the last successful generation — the 1-hour re-generation
33203
- * guard's durable state (predecessor parity). Absent = never generated.
33787
+ * Epoch-ms of the NEWEST successful generation across every camera of this
33788
+ * rule. What a UI shows, and the compatibility floor for
33789
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
33204
33790
  */
33205
33791
  lastGeneratedAt: number().optional(),
33792
+ /**
33793
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
33794
+ * re-generation guard's real durable state.
33795
+ *
33796
+ * One rule covers several cameras and each renders its own video, so a rule
33797
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
33798
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
33799
+ * already done — and B's night is gone for good, because the window will not
33800
+ * come back.
33801
+ *
33802
+ * ADDITIVE, so the migration is free: a row written before this field simply
33803
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
33804
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
33805
+ * "never generated" would re-render and re-notify every camera of every rule
33806
+ * once, on the deploy that shipped the map.
33807
+ */
33808
+ generatedByDevice: record(string$2(), number()).optional(),
33206
33809
  /** userId of the caller who created the rule (server-stamped). */
33207
33810
  createdBy: string$2(),
33208
33811
  createdAt: number(),