@camstack/addon-matter-broker 0.2.11 → 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 +936 -48
  2. package/dist/addon.mjs +936 -48
  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
  *
@@ -7577,14 +7600,21 @@ var RecordingConfigSchema = object({
7577
7600
  /**
7578
7601
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
7579
7602
  *
7580
- * One shape shared by the recorder's `relocateFootage` (segments) and
7581
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7582
- * page renders both movers with one component. Jobs are in-RAM (a restart
7583
- * forgets them — re-running is safe by construction: copy-if-absent, delete
7584
- * after verify) and each completed/failed run also lands one durable ops-log
7585
- * row on the owning addon's surface.
7603
+ * One shape shared by the recorder and pipeline-analytics internal movers.
7604
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
7605
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
7606
+ * Each completed/failed run also lands one durable ops-log row on its owning
7607
+ * addon surface.
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.
7586
7615
  */
7587
7616
  var RelocateJobStateSchema = _enum([
7617
+ "queued",
7588
7618
  "running",
7589
7619
  "done",
7590
7620
  "failed",
@@ -7609,19 +7639,109 @@ var RelocateJobSchema = object({
7609
7639
  finishedAt: number().nullable(),
7610
7640
  error: string$2().nullable()
7611
7641
  });
7642
+ /** Profile-derived footage selection used only by the migration coordinator:
7643
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
7644
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
7612
7645
  var RelocateFootageInputSchema = object({
7613
- deviceId: number().optional(),
7614
7646
  fromLocationId: string$2(),
7615
7647
  toLocationId: string$2(),
7616
7648
  entities: array(_enum(["segments"])).optional(),
7649
+ /** Limits relocation to the logical profile class. Omit only for the
7650
+ * pre-orchestration compatibility path. */
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(),
7617
7661
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7618
7662
  * never allowed to starve live writers. */
7619
7663
  throttleMbps: number().min(1).max(1e3).optional()
7620
7664
  });
7621
- var RelocateMediaInputSchema = object({
7622
- deviceId: number().optional(),
7665
+ /** Internal, lease-scoped participant operation. It is intentionally separate
7666
+ * from persistent recording settings: a migration never changes
7667
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
7668
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string$2().min(1) });
7669
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string$2().min(1) });
7670
+ var StorageMigrationMediaMoveInputSchema = object({
7623
7671
  toLocationId: string$2(),
7624
7672
  throttleMbps: number().min(1).max(1e3).optional()
7673
+ }).extend({ leaseId: string$2().min(1) });
7674
+ /** The independently selectable logical storage classes. `recordings`
7675
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
7676
+ * segments; `eventMedia` is post-analysis blobs. */
7677
+ var StorageMigrationClassSchema = _enum([
7678
+ "recordings",
7679
+ "recordingsLow",
7680
+ "eventMedia"
7681
+ ]);
7682
+ /** A destination is always an existing, fully-qualified location id. The
7683
+ * migration API intentionally never changes a source location's `basePath`:
7684
+ * callers create a new `<type>:<slug>` location, then select it here. */
7685
+ var StorageMigrationDestinationsSchema = object({
7686
+ recordings: string$2().min(1).optional(),
7687
+ recordingsLow: string$2().min(1).optional(),
7688
+ eventMedia: string$2().min(1).optional()
7689
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
7690
+ /** Shared input for planning and starting an orchestrated storage migration. */
7691
+ var StorageMigrationInputSchema = object({
7692
+ destinations: StorageMigrationDestinationsSchema,
7693
+ throttleMbps: number().min(1).max(1e3).optional()
7694
+ });
7695
+ /** The durable coordinator state machine. The only phase that changes default
7696
+ * locations is `repointing`, after every selected mover has completed and been
7697
+ * verified. */
7698
+ var StorageMigrationPhaseSchema = _enum([
7699
+ "planning",
7700
+ "pausing",
7701
+ "moving",
7702
+ "verifying",
7703
+ "repointing",
7704
+ "refreshing",
7705
+ "resuming",
7706
+ "done",
7707
+ "failed",
7708
+ "cancelled"
7709
+ ]);
7710
+ var StorageMigrationParticipantSchema = _enum([
7711
+ "pipeline",
7712
+ "recorder",
7713
+ "analytics"
7714
+ ]);
7715
+ var StorageMigrationMoveSchema = object({
7716
+ storageClass: StorageMigrationClassSchema,
7717
+ fromLocationId: string$2(),
7718
+ toLocationId: string$2(),
7719
+ moverJobId: string$2().nullable(),
7720
+ state: RelocateJobStateSchema.nullable(),
7721
+ error: string$2().nullable()
7722
+ });
7723
+ var StorageMigrationJobSchema = object({
7724
+ jobId: string$2(),
7725
+ phase: StorageMigrationPhaseSchema,
7726
+ destinations: StorageMigrationDestinationsSchema,
7727
+ throttleMbps: number(),
7728
+ moves: array(StorageMigrationMoveSchema),
7729
+ pauseLeaseId: string$2().nullable(),
7730
+ pausedParticipants: array(StorageMigrationParticipantSchema),
7731
+ repointed: boolean(),
7732
+ cancelRequested: boolean(),
7733
+ startedAt: number(),
7734
+ updatedAt: number(),
7735
+ finishedAt: number().nullable(),
7736
+ error: string$2().nullable()
7737
+ });
7738
+ var StorageMigrationPlanSchema = object({
7739
+ destinations: StorageMigrationDestinationsSchema,
7740
+ moves: array(object({
7741
+ storageClass: StorageMigrationClassSchema,
7742
+ fromLocationId: string$2(),
7743
+ toLocationId: string$2()
7744
+ }))
7625
7745
  });
7626
7746
  /**
7627
7747
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -7673,6 +7793,21 @@ var StorageLocationSchema = object({
7673
7793
  nodeId: string$2().optional(),
7674
7794
  isDefault: boolean().default(false),
7675
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(),
7676
7811
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7677
7812
  * for node-local locations it can reach) — never persisted, absent when the
7678
7813
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12291,7 +12426,8 @@ method(object({
12291
12426
  }), EmbeddingResultSchema), method(object({ text: string$2() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12292
12427
  /**
12293
12428
  * filesystem-browse — per-node capability for browsing the node's local
12294
- * 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
12295
12431
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12296
12432
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12297
12433
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -14132,6 +14268,13 @@ var MaskGridDimsSchema = object({
14132
14268
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
14133
14269
  * this one field keeps the schema additive — a rule still declares exactly
14134
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`.
14135
14278
  */
14136
14279
  var NcDeliverySchema = _enum([
14137
14280
  "immediate",
@@ -14146,15 +14289,32 @@ var NcDeliverySchema = _enum([
14146
14289
  * depend on a provider's raw event name or payload shape.
14147
14290
  */
14148
14291
  var NcSystemEventKindSchema = _enum([
14149
- "camera-online",
14150
- "camera-offline",
14292
+ "device-online",
14293
+ "device-offline",
14294
+ "device-disabled",
14295
+ "device-enabled",
14151
14296
  "stream-online",
14152
14297
  "stream-offline",
14153
14298
  "node-online",
14154
14299
  "node-offline",
14155
14300
  "addon-update-available",
14156
- "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"
14157
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));
14158
14318
  /**
14159
14319
  * One coherent system-event condition. `kinds` is the required opt-in safety
14160
14320
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -14163,6 +14323,18 @@ var NcSystemEventKindSchema = _enum([
14163
14323
  var NcSystemEventConditionSchema = object({
14164
14324
  kinds: array(NcSystemEventKindSchema).min(1),
14165
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(),
14166
14338
  nodeIds: array(string$2().min(1)).min(1).optional(),
14167
14339
  packageNames: array(string$2().min(1)).min(1).optional()
14168
14340
  });
@@ -14213,6 +14385,47 @@ var NcOccupancyConditionSchema = object({
14213
14385
  sustainSeconds: number().int().min(0).max(3600).default(15)
14214
14386
  });
14215
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
+ /**
14216
14429
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
14217
14430
  *
14218
14431
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14485,7 +14698,33 @@ var NcConditionsSchema = object({
14485
14698
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14486
14699
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14487
14700
  */
14488
- 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()
14489
14728
  });
14490
14729
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14491
14730
  var NcRuleTargetSchema = object({
@@ -14599,6 +14838,73 @@ var NcThrottleSchema = object({
14599
14838
  */
14600
14839
  granularity: NcThrottleGranularitySchema.optional()
14601
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
+ });
14602
14908
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14603
14909
  var NcRuleInputSchema = object({
14604
14910
  name: string$2().min(1).max(200),
@@ -14659,7 +14965,13 @@ var NcRuleInputSchema = object({
14659
14965
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14660
14966
  * shape as every other actuation.
14661
14967
  */
14662
- 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()
14663
14975
  });
14664
14976
  /**
14665
14977
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14670,7 +14982,37 @@ var NcRuleInputSchema = object({
14670
14982
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14671
14983
  * `updateRule` patch.
14672
14984
  */
14673
- 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
+ });
14674
15016
  /** A persisted rule. */
14675
15017
  var NcRuleSchema = NcRuleInputSchema.extend({
14676
15018
  id: string$2(),
@@ -14971,6 +15313,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14971
15313
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14972
15314
  * copy would lie the first time a rule is disabled.
14973
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
+ });
14974
15335
  var NcAlarmModeCoverageSchema = object({
14975
15336
  mode: AlarmArmModeSchema,
14976
15337
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14978,7 +15339,18 @@ var NcAlarmModeCoverageSchema = object({
14978
15339
  /** At least one covering rule has no device scope, so the mode covers all. */
14979
15340
  allDevices: boolean(),
14980
15341
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14981
- 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([])
14982
15354
  });
14983
15355
  var NcAlarmConfigSchema = object({
14984
15356
  /**
@@ -16341,13 +16713,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16341
16713
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16342
16714
  kind: "mutation",
16343
16715
  auth: "admin"
16344
- }), method(RelocateMediaInputSchema, object({ jobId: string$2() }), {
16716
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
16345
16717
  kind: "mutation",
16346
16718
  auth: "admin"
16347
- }), method(object({}), array(RelocateJobSchema).readonly(), {
16348
- kind: "query",
16719
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
16720
+ kind: "mutation",
16349
16721
  auth: "admin"
16350
- }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
16722
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
16723
+ kind: "mutation",
16724
+ auth: "admin"
16725
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string$2() }), {
16726
+ kind: "mutation",
16727
+ auth: "admin"
16728
+ }), method(object({ jobId: string$2() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
16351
16729
  kind: "mutation",
16352
16730
  auth: "admin"
16353
16731
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -17804,9 +18182,16 @@ var CameraStatusSchema = object({
17804
18182
  audio: CameraAudioStatusSchema.nullable(),
17805
18183
  recording: CameraRecordingStatusSchema.nullable(),
17806
18184
  /**
17807
- * Per-camera function switches an OPERATOR has turned off
18185
+ * Per-camera functions an OPERATOR has turned off
17808
18186
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17809
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
+ *
17810
18195
  * This is the difference between DISABLED and BROKEN. A camera whose
17811
18196
  * `detection` block reports zero fps and whose `switchedOff` contains
17812
18197
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -17877,7 +18262,13 @@ var NodeInferenceDevicesSchema = object({
17877
18262
  reachable: boolean(),
17878
18263
  devices: array(NodeInferenceDeviceSchema).readonly()
17879
18264
  });
17880
- method(object({
18265
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
18266
+ kind: "mutation",
18267
+ auth: "admin"
18268
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
18269
+ kind: "mutation",
18270
+ auth: "admin"
18271
+ }), method(object({
17881
18272
  deviceId: number(),
17882
18273
  agentNodeId: string$2()
17883
18274
  }), object({ success: literal(true) }), {
@@ -18551,6 +18942,13 @@ method(object({ locationId: string$2() }), EvictableUsageSchema), method(object(
18551
18942
  locationId: string$2(),
18552
18943
  targetBytes: number().int().positive()
18553
18944
  }), EvictResultSchema, { kind: "mutation" });
18945
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string$2() }), {
18946
+ kind: "mutation",
18947
+ auth: "admin"
18948
+ }), method(object({ jobId: string$2().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
18949
+ kind: "mutation",
18950
+ auth: "admin"
18951
+ });
18554
18952
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
18555
18953
  providerId: string$2().min(1),
18556
18954
  displayName: string$2().min(1),
@@ -18654,6 +19052,28 @@ var TerminalProfileInfoSchema = object({
18654
19052
  label: string$2(),
18655
19053
  description: string$2().optional()
18656
19054
  });
19055
+ /**
19056
+ * A durable operator-created Terminal instance. Profiles are templates; only
19057
+ * an instance declares a camera.
19058
+ */
19059
+ var TerminalInstanceInfoSchema = object({
19060
+ instanceId: string$2(),
19061
+ cameraStableId: string$2(),
19062
+ nodeId: string$2(),
19063
+ profileId: string$2(),
19064
+ profileLabel: string$2(),
19065
+ name: string$2(),
19066
+ enabled: boolean()
19067
+ });
19068
+ var TerminalLegacyCameraSchema = object({
19069
+ stableId: string$2(),
19070
+ nodeId: string$2(),
19071
+ profileId: string$2(),
19072
+ profileLabel: string$2(),
19073
+ name: string$2(),
19074
+ /** Only legacy monitor cameras can retain their historic stable identity. */
19075
+ adoptable: boolean()
19076
+ });
18657
19077
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
18658
19078
  seq: number().int().positive(),
18659
19079
  kind: literal("data"),
@@ -18670,7 +19090,29 @@ var TerminalOutputBatchSchema = object({
18670
19090
  snapshot: string$2().optional(),
18671
19091
  events: array(TerminalOutputEventSchema).readonly()
18672
19092
  });
18673
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
19093
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
19094
+ targetNodeId: string$2().min(1),
19095
+ profileId: string$2().min(1),
19096
+ name: string$2().trim().min(1).max(160).optional()
19097
+ }), TerminalInstanceInfoSchema, {
19098
+ kind: "mutation",
19099
+ auth: "admin"
19100
+ }), method(object({ instanceId: string$2().min(1) }), _void(), {
19101
+ kind: "mutation",
19102
+ auth: "admin"
19103
+ }), method(object({
19104
+ instanceId: string$2().min(1),
19105
+ enabled: boolean()
19106
+ }), TerminalInstanceInfoSchema, {
19107
+ kind: "mutation",
19108
+ auth: "admin"
19109
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
19110
+ stableId: string$2().min(1),
19111
+ name: string$2().trim().min(1).max(160).optional()
19112
+ }), TerminalInstanceInfoSchema, {
19113
+ kind: "mutation",
19114
+ auth: "admin"
19115
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18674
19116
  profileId: string$2(),
18675
19117
  cols: number().int().positive(),
18676
19118
  rows: number().int().positive()
@@ -18687,7 +19129,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
18687
19129
  }), method(object({
18688
19130
  sessionId: string$2(),
18689
19131
  afterSeq: number().int().nonnegative(),
18690
- waitMs: number().int().min(0).max(2e3).default(0)
19132
+ waitMs: number().int().min(0).max(2e3).default(0),
19133
+ /**
19134
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
19135
+ * browser's initial repaint remains immediate; the camera snapshot
19136
+ * relay uses it to avoid encoding a blank startup frame.
19137
+ */
19138
+ waitForOutput: boolean().optional()
18691
19139
  }), TerminalOutputBatchSchema, {
18692
19140
  kind: "mutation",
18693
19141
  auth: "admin",
@@ -21202,6 +21650,7 @@ var FaceInfoSchema = object({
21202
21650
  var FaceFilterEnum = _enum([
21203
21651
  "unassigned",
21204
21652
  "recognized",
21653
+ "identified",
21205
21654
  "all"
21206
21655
  ]);
21207
21656
  var MediaFileLiteSchema$1 = object({
@@ -21230,6 +21679,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string$
21230
21679
  kind: "mutation",
21231
21680
  auth: "admin"
21232
21681
  }), method(object({
21682
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
21683
+ deviceId: number().int().optional(),
21233
21684
  limit: number().int().positive().optional(),
21234
21685
  filter: FaceFilterEnum.optional(),
21235
21686
  /**
@@ -23459,6 +23910,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
23459
23910
  capName: string$2().min(1).max(64),
23460
23911
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
23461
23912
  valuePath: string$2().min(1).max(64)
23913
+ }),
23914
+ object({
23915
+ kind: literal("latest-recognition"),
23916
+ recognition: _enum(["person", "plate"])
23462
23917
  })
23463
23918
  ]);
23464
23919
  var OsdSlotBindingSchema = object({
@@ -23564,6 +24019,15 @@ method(object({ deviceId: number().int() }), object({
23564
24019
  }), object({ success: literal(true) }), {
23565
24020
  kind: "mutation",
23566
24021
  auth: "admin"
24022
+ }), method(object({
24023
+ sourceDeviceId: number().int(),
24024
+ targetDeviceId: number().int()
24025
+ }), object({
24026
+ copied: number().int().nonnegative(),
24027
+ skipped: number().int().nonnegative()
24028
+ }), {
24029
+ kind: "mutation",
24030
+ auth: "admin"
23567
24031
  }), method(object({
23568
24032
  deviceId: number().int(),
23569
24033
  slotId: string$2().min(1),
@@ -24486,7 +24950,19 @@ var RecordingManifestSchema = object({
24486
24950
  * profiles/subtrees/locations on this node). */
24487
24951
  var RecordingDeviceUsageSchema = object({
24488
24952
  deviceId: number(),
24489
- 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()
24490
24966
  });
24491
24967
  /** Recording storage usage + capacity for one storage location. */
24492
24968
  var RecordingLocationUsageSchema = object({
@@ -24514,6 +24990,57 @@ var RecordingStorageUsageSchema = object({
24514
24990
  locations: array(RecordingLocationUsageSchema)
24515
24991
  });
24516
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
+ /**
24517
25044
  * Result of locating footage at a wall-clock instant for one device/profile.
24518
25045
  * `segment` carries the covering segment's window; `gap` reports the forward
24519
25046
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -24661,6 +25188,21 @@ method(object({
24661
25188
  }), {
24662
25189
  kind: "mutation",
24663
25190
  auth: "admin"
25191
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
25192
+ kind: "mutation",
25193
+ auth: "admin"
25194
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
25195
+ kind: "mutation",
25196
+ auth: "admin"
25197
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
25198
+ kind: "mutation",
25199
+ auth: "admin"
25200
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string$2() }), {
25201
+ kind: "mutation",
25202
+ auth: "admin"
25203
+ }), method(object({ jobId: string$2() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
25204
+ kind: "mutation",
25205
+ auth: "admin"
24664
25206
  }), method(RelocateFootageInputSchema, object({ jobId: string$2() }), {
24665
25207
  kind: "mutation",
24666
25208
  auth: "admin"
@@ -24670,9 +25212,15 @@ method(object({
24670
25212
  }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
24671
25213
  kind: "mutation",
24672
25214
  auth: "admin"
25215
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25216
+ kind: "query",
25217
+ auth: "admin"
25218
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25219
+ kind: "mutation",
25220
+ auth: "admin"
24673
25221
  });
24674
25222
  /**
24675
- * `recordingExport` cap — render a footage time range into a single downloadable
25223
+ * `recording-export` cap — render a footage time range into a single downloadable
24676
25224
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
24677
25225
  * bounded lifetime with a durable history, auto-expiry, and optional
24678
25226
  * delete-after-download.
@@ -24687,10 +25235,42 @@ method(object({
24687
25235
  */
24688
25236
  /** Playback-speed multiplier for the render (1 = realtime). */
24689
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
+ });
24690
25262
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
24691
25263
  var ExportTimelapseSchema = object({
24692
25264
  everyMs: number().int().positive(),
24693
- 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
+ });
24694
25274
  });
24695
25275
  /**
24696
25276
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -24748,6 +25328,19 @@ var ExportDownloadSchema = object({
24748
25328
  url: string$2(),
24749
25329
  endpoints: array(string$2())
24750
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
+ });
24751
25344
  method(object({
24752
25345
  deviceId: number(),
24753
25346
  profile: string$2(),
@@ -24772,6 +25365,9 @@ method(object({
24772
25365
  }), method(object({ exportId: string$2() }), ExportDownloadSchema, {
24773
25366
  kind: "query",
24774
25367
  auth: "protected"
25368
+ }), method(object({ exportId: string$2() }), ExportBytesSchema, {
25369
+ kind: "query",
25370
+ auth: "protected"
24775
25371
  });
24776
25372
  /**
24777
25373
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -30273,6 +30869,12 @@ Object.freeze({
30273
30869
  addonId: null,
30274
30870
  access: "delete"
30275
30871
  },
30872
+ "osdManager.copyDeviceConfiguration": {
30873
+ capName: "osd-manager",
30874
+ capScope: "system",
30875
+ addonId: null,
30876
+ access: "create"
30877
+ },
30276
30878
  "osdManager.getConditionSupport": {
30277
30879
  capName: "osd-manager",
30278
30880
  capScope: "system",
@@ -30369,7 +30971,7 @@ Object.freeze({
30369
30971
  addonId: null,
30370
30972
  access: "create"
30371
30973
  },
30372
- "pipelineAnalytics.cancelMediaRelocate": {
30974
+ "pipelineAnalytics.cancelStorageMigrationMove": {
30373
30975
  capName: "pipeline-analytics",
30374
30976
  capScope: "device",
30375
30977
  addonId: null,
@@ -30441,12 +31043,6 @@ Object.freeze({
30441
31043
  addonId: null,
30442
31044
  access: "view"
30443
31045
  },
30444
- "pipelineAnalytics.getMediaRelocateStatus": {
30445
- capName: "pipeline-analytics",
30446
- capScope: "device",
30447
- addonId: null,
30448
- access: "view"
30449
- },
30450
31046
  "pipelineAnalytics.getMotionEvents": {
30451
31047
  capName: "pipeline-analytics",
30452
31048
  capScope: "device",
@@ -30483,6 +31079,12 @@ Object.freeze({
30483
31079
  addonId: null,
30484
31080
  access: "view"
30485
31081
  },
31082
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
31083
+ capName: "pipeline-analytics",
31084
+ capScope: "device",
31085
+ addonId: null,
31086
+ access: "view"
31087
+ },
30486
31088
  "pipelineAnalytics.getTrack": {
30487
31089
  capName: "pipeline-analytics",
30488
31090
  capScope: "device",
@@ -30561,6 +31163,12 @@ Object.freeze({
30561
31163
  addonId: null,
30562
31164
  access: "view"
30563
31165
  },
31166
+ "pipelineAnalytics.pauseForStorageMigration": {
31167
+ capName: "pipeline-analytics",
31168
+ capScope: "device",
31169
+ addonId: null,
31170
+ access: "create"
31171
+ },
30564
31172
  "pipelineAnalytics.proposeRetrainAnnotations": {
30565
31173
  capName: "pipeline-analytics",
30566
31174
  capScope: "device",
@@ -30591,7 +31199,7 @@ Object.freeze({
30591
31199
  addonId: null,
30592
31200
  access: "create"
30593
31201
  },
30594
- "pipelineAnalytics.relocateMedia": {
31202
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
30595
31203
  capName: "pipeline-analytics",
30596
31204
  capScope: "device",
30597
31205
  addonId: null,
@@ -30603,6 +31211,12 @@ Object.freeze({
30603
31211
  addonId: null,
30604
31212
  access: "create"
30605
31213
  },
31214
+ "pipelineAnalytics.resumeForStorageMigration": {
31215
+ capName: "pipeline-analytics",
31216
+ capScope: "device",
31217
+ addonId: null,
31218
+ access: "create"
31219
+ },
30606
31220
  "pipelineAnalytics.saveRetrainAnnotations": {
30607
31221
  capName: "pipeline-analytics",
30608
31222
  capScope: "device",
@@ -30627,6 +31241,12 @@ Object.freeze({
30627
31241
  addonId: null,
30628
31242
  access: "create"
30629
31243
  },
31244
+ "pipelineAnalytics.startStorageMigrationMove": {
31245
+ capName: "pipeline-analytics",
31246
+ capScope: "device",
31247
+ addonId: null,
31248
+ access: "create"
31249
+ },
30630
31250
  "pipelineAnalytics.wipeAllAnalytics": {
30631
31251
  capName: "pipeline-analytics",
30632
31252
  capScope: "device",
@@ -30993,6 +31613,12 @@ Object.freeze({
30993
31613
  addonId: null,
30994
31614
  access: "view"
30995
31615
  },
31616
+ "pipelineOrchestrator.pauseForStorageMigration": {
31617
+ capName: "pipeline-orchestrator",
31618
+ capScope: "system",
31619
+ addonId: null,
31620
+ access: "create"
31621
+ },
30996
31622
  "pipelineOrchestrator.rebalance": {
30997
31623
  capName: "pipeline-orchestrator",
30998
31624
  capScope: "system",
@@ -31017,6 +31643,12 @@ Object.freeze({
31017
31643
  addonId: null,
31018
31644
  access: "view"
31019
31645
  },
31646
+ "pipelineOrchestrator.resumeForStorageMigration": {
31647
+ capName: "pipeline-orchestrator",
31648
+ capScope: "system",
31649
+ addonId: null,
31650
+ access: "create"
31651
+ },
31020
31652
  "pipelineOrchestrator.saveTemplate": {
31021
31653
  capName: "pipeline-orchestrator",
31022
31654
  capScope: "system",
@@ -31413,7 +32045,13 @@ Object.freeze({
31413
32045
  addonId: null,
31414
32046
  access: "create"
31415
32047
  },
31416
- "recording.cancelRelocate": {
32048
+ "recording.cancelRelocateJob": {
32049
+ capName: "recording",
32050
+ capScope: "system",
32051
+ addonId: null,
32052
+ access: "create"
32053
+ },
32054
+ "recording.cancelStorageMigrationMove": {
31417
32055
  capName: "recording",
31418
32056
  capScope: "system",
31419
32057
  addonId: null,
@@ -31449,7 +32087,7 @@ Object.freeze({
31449
32087
  addonId: null,
31450
32088
  access: "view"
31451
32089
  },
31452
- "recording.getRelocateStatus": {
32090
+ "recording.getStorageMigrationMoveStatus": {
31453
32091
  capName: "recording",
31454
32092
  capScope: "system",
31455
32093
  addonId: null,
@@ -31467,12 +32105,30 @@ Object.freeze({
31467
32105
  addonId: null,
31468
32106
  access: "view"
31469
32107
  },
32108
+ "recording.listRelocateJobs": {
32109
+ capName: "recording",
32110
+ capScope: "system",
32111
+ addonId: null,
32112
+ access: "view"
32113
+ },
31470
32114
  "recording.locateSegment": {
31471
32115
  capName: "recording",
31472
32116
  capScope: "system",
31473
32117
  addonId: null,
31474
32118
  access: "view"
31475
32119
  },
32120
+ "recording.pauseForStorageMigration": {
32121
+ capName: "recording",
32122
+ capScope: "system",
32123
+ addonId: null,
32124
+ access: "create"
32125
+ },
32126
+ "recording.planStorageRebalance": {
32127
+ capName: "recording",
32128
+ capScope: "system",
32129
+ addonId: null,
32130
+ access: "view"
32131
+ },
31476
32132
  "recording.pruneFootage": {
31477
32133
  capName: "recording",
31478
32134
  capScope: "system",
@@ -31491,6 +32147,12 @@ Object.freeze({
31491
32147
  addonId: null,
31492
32148
  access: "view"
31493
32149
  },
32150
+ "recording.refreshStorageLocationsForMigration": {
32151
+ capName: "recording",
32152
+ capScope: "system",
32153
+ addonId: null,
32154
+ access: "create"
32155
+ },
31494
32156
  "recording.relocateFootage": {
31495
32157
  capName: "recording",
31496
32158
  capScope: "system",
@@ -31515,44 +32177,68 @@ Object.freeze({
31515
32177
  addonId: null,
31516
32178
  access: "create"
31517
32179
  },
32180
+ "recording.resumeForStorageMigration": {
32181
+ capName: "recording",
32182
+ capScope: "system",
32183
+ addonId: null,
32184
+ access: "create"
32185
+ },
31518
32186
  "recording.setDeviceConfig": {
31519
32187
  capName: "recording",
31520
32188
  capScope: "system",
31521
32189
  addonId: null,
31522
32190
  access: "create"
31523
32191
  },
32192
+ "recording.startStorageMigrationMove": {
32193
+ capName: "recording",
32194
+ capScope: "system",
32195
+ addonId: null,
32196
+ access: "create"
32197
+ },
32198
+ "recording.startStorageRebalance": {
32199
+ capName: "recording",
32200
+ capScope: "system",
32201
+ addonId: null,
32202
+ access: "create"
32203
+ },
31524
32204
  "recordingExport.cancelExport": {
31525
- capName: "recordingExport",
32205
+ capName: "recording-export",
31526
32206
  capScope: "system",
31527
32207
  addonId: null,
31528
32208
  access: "create"
31529
32209
  },
31530
32210
  "recordingExport.createExport": {
31531
- capName: "recordingExport",
32211
+ capName: "recording-export",
31532
32212
  capScope: "system",
31533
32213
  addonId: null,
31534
32214
  access: "create"
31535
32215
  },
31536
32216
  "recordingExport.deleteExport": {
31537
- capName: "recordingExport",
32217
+ capName: "recording-export",
31538
32218
  capScope: "system",
31539
32219
  addonId: null,
31540
32220
  access: "delete"
31541
32221
  },
31542
32222
  "recordingExport.getDownloadUrl": {
31543
- capName: "recordingExport",
32223
+ capName: "recording-export",
31544
32224
  capScope: "system",
31545
32225
  addonId: null,
31546
32226
  access: "view"
31547
32227
  },
31548
32228
  "recordingExport.getExport": {
31549
- capName: "recordingExport",
32229
+ capName: "recording-export",
31550
32230
  capScope: "system",
31551
32231
  addonId: null,
31552
32232
  access: "view"
31553
32233
  },
31554
32234
  "recordingExport.listExports": {
31555
- capName: "recordingExport",
32235
+ capName: "recording-export",
32236
+ capScope: "system",
32237
+ addonId: null,
32238
+ access: "view"
32239
+ },
32240
+ "recordingExport.readExportBytes": {
32241
+ capName: "recording-export",
31556
32242
  capScope: "system",
31557
32243
  addonId: null,
31558
32244
  access: "view"
@@ -31911,6 +32597,30 @@ Object.freeze({
31911
32597
  addonId: null,
31912
32598
  access: "view"
31913
32599
  },
32600
+ "storageMigration.cancel": {
32601
+ capName: "storage-migration",
32602
+ capScope: "system",
32603
+ addonId: null,
32604
+ access: "create"
32605
+ },
32606
+ "storageMigration.plan": {
32607
+ capName: "storage-migration",
32608
+ capScope: "system",
32609
+ addonId: null,
32610
+ access: "view"
32611
+ },
32612
+ "storageMigration.start": {
32613
+ capName: "storage-migration",
32614
+ capScope: "system",
32615
+ addonId: null,
32616
+ access: "create"
32617
+ },
32618
+ "storageMigration.status": {
32619
+ capName: "storage-migration",
32620
+ capScope: "system",
32621
+ addonId: null,
32622
+ access: "view"
32623
+ },
31914
32624
  "storageProvider.abortUpload": {
31915
32625
  capName: "storage-provider",
31916
32626
  capScope: "system",
@@ -32289,12 +32999,42 @@ Object.freeze({
32289
32999
  addonId: null,
32290
33000
  access: "create"
32291
33001
  },
33002
+ "terminalSession.adoptLegacyMonitor": {
33003
+ capName: "terminal-session",
33004
+ capScope: "system",
33005
+ addonId: null,
33006
+ access: "create"
33007
+ },
32292
33008
  "terminalSession.close": {
32293
33009
  capName: "terminal-session",
32294
33010
  capScope: "system",
32295
33011
  addonId: null,
32296
33012
  access: "create"
32297
33013
  },
33014
+ "terminalSession.createInstance": {
33015
+ capName: "terminal-session",
33016
+ capScope: "system",
33017
+ addonId: null,
33018
+ access: "create"
33019
+ },
33020
+ "terminalSession.deleteInstance": {
33021
+ capName: "terminal-session",
33022
+ capScope: "system",
33023
+ addonId: null,
33024
+ access: "delete"
33025
+ },
33026
+ "terminalSession.listInstances": {
33027
+ capName: "terminal-session",
33028
+ capScope: "system",
33029
+ addonId: null,
33030
+ access: "view"
33031
+ },
33032
+ "terminalSession.listLegacyCameras": {
33033
+ capName: "terminal-session",
33034
+ capScope: "system",
33035
+ addonId: null,
33036
+ access: "view"
33037
+ },
32298
33038
  "terminalSession.listProfiles": {
32299
33039
  capName: "terminal-session",
32300
33040
  capScope: "system",
@@ -32325,6 +33065,12 @@ Object.freeze({
32325
33065
  addonId: null,
32326
33066
  access: "create"
32327
33067
  },
33068
+ "terminalSession.setInstanceEnabled": {
33069
+ capName: "terminal-session",
33070
+ capScope: "system",
33071
+ addonId: null,
33072
+ access: "create"
33073
+ },
32328
33074
  "terminalSession.writeInput": {
32329
33075
  capName: "terminal-session",
32330
33076
  capScope: "system",
@@ -32869,6 +33615,104 @@ var FramerateField = number().int().min(1).max(60);
32869
33615
  var TargetsField = array(NcRuleTargetSchema).min(1);
32870
33616
  var PriorityField = number().int().min(1).max(5);
32871
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
+ /**
32872
33716
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
32873
33717
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
32874
33718
  * here (see the ownership note above).
@@ -32888,9 +33732,30 @@ var TimelapseRuleInputSchema = object({
32888
33732
  cadenceSec: CadenceSecField.default(15),
32889
33733
  /** Output frames per second of the assembled mp4 (predecessor parity). */
32890
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(),
32891
33743
  /** `notification-output` targets the finished video/thumbnail is sent to. */
32892
33744
  targets: TargetsField,
32893
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(),
32894
33759
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
32895
33760
  priority: PriorityField.default(3)
32896
33761
  });
@@ -32901,8 +33766,13 @@ object({
32901
33766
  schedule: NcScheduleSchema.optional(),
32902
33767
  cadenceSec: CadenceSecField.optional(),
32903
33768
  framerate: FramerateField.optional(),
33769
+ denseCadenceSec: DenseCadenceSecField.optional(),
33770
+ minDwellSec: MinDwellSecField.optional(),
32904
33771
  targets: TargetsField.optional(),
32905
33772
  template: TimelapseTemplateSchema.nullable().optional(),
33773
+ previewText: PreviewTextField.optional(),
33774
+ previewMode: PreviewModeField.optional(),
33775
+ reportClasses: ReportClassesField.optional(),
32906
33776
  priority: PriorityField.optional()
32907
33777
  });
32908
33778
  TimelapseRuleInputSchema.extend({
@@ -32914,10 +33784,28 @@ TimelapseRuleInputSchema.extend({
32914
33784
  */
32915
33785
  ownerUserId: string$2().optional(),
32916
33786
  /**
32917
- * Epoch-ms of the last successful generation — the 1-hour re-generation
32918
- * 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.
32919
33790
  */
32920
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(),
32921
33809
  /** userId of the caller who created the rule (server-stamped). */
32922
33810
  createdBy: string$2(),
32923
33811
  createdAt: number(),