@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.js CHANGED
@@ -7233,8 +7233,31 @@ var AdoptionJobSchema = object({
7233
7233
  error: string$2().nullable()
7234
7234
  });
7235
7235
  /**
7236
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7237
- * pipeline functions an operator thinks in terms of.
7236
+ * Per-camera FUNCTION SWITCHES.
7237
+ *
7238
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7239
+ *
7240
+ * This file shipped as "the one coherent on/off surface over the pipeline
7241
+ * functions an operator thinks in terms of". The operator's verdict on
7242
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7243
+ * every function already had a settings page of its own, and a second place to
7244
+ * turn it off is a second place to look. Each switch is going back to its own
7245
+ * component's original options — detection to the detection-pipeline wrapper
7246
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7247
+ * (which was always first-class; the switch was a veneer over
7248
+ * `recording.setDeviceConfig`), notifications to a notification-center
7249
+ * per-device setting, the two camera planes to their own components.
7250
+ *
7251
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7252
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7253
+ * straight from the authorities with no group in the middle. That rule was
7254
+ * never about a control panel.
7255
+ *
7256
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7257
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7258
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7259
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7260
+ * stop; nothing new may be built on it.
7238
7261
  *
7239
7262
  * ## This file adds no state
7240
7263
  *
@@ -7579,14 +7602,21 @@ var RecordingConfigSchema = object({
7579
7602
  /**
7580
7603
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
7581
7604
  *
7582
- * One shape shared by the recorder's `relocateFootage` (segments) and
7583
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7584
- * page renders both movers with one component. Jobs are in-RAM (a restart
7585
- * forgets them — re-running is safe by construction: copy-if-absent, delete
7586
- * after verify) and each completed/failed run also lands one durable ops-log
7587
- * row on the owning addon's surface.
7605
+ * One shape shared by the recorder and pipeline-analytics internal movers.
7606
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
7607
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
7608
+ * Each completed/failed run also lands one durable ops-log row on its owning
7609
+ * addon surface.
7610
+ */
7611
+ /**
7612
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7613
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7614
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7615
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7616
+ * runs at all.
7588
7617
  */
7589
7618
  var RelocateJobStateSchema = _enum([
7619
+ "queued",
7590
7620
  "running",
7591
7621
  "done",
7592
7622
  "failed",
@@ -7611,19 +7641,109 @@ var RelocateJobSchema = object({
7611
7641
  finishedAt: number().nullable(),
7612
7642
  error: string$2().nullable()
7613
7643
  });
7644
+ /** Profile-derived footage selection used only by the migration coordinator:
7645
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
7646
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
7614
7647
  var RelocateFootageInputSchema = object({
7615
- deviceId: number().optional(),
7616
7648
  fromLocationId: string$2(),
7617
7649
  toLocationId: string$2(),
7618
7650
  entities: array(_enum(["segments"])).optional(),
7651
+ /** Limits relocation to the logical profile class. Omit only for the
7652
+ * pre-orchestration compatibility path. */
7653
+ footageClass: RelocateFootageClassSchema.optional(),
7654
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7655
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7656
+ * unit is a (camera, profile) pile, not a disk. */
7657
+ deviceId: number().int().optional(),
7658
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7659
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7660
+ * placement plan assigns those two independently, so a rebalance that could
7661
+ * only say "recordings" would move footage the plan never asked to move. */
7662
+ profiles: array(string$2()).optional(),
7619
7663
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7620
7664
  * never allowed to starve live writers. */
7621
7665
  throttleMbps: number().min(1).max(1e3).optional()
7622
7666
  });
7623
- var RelocateMediaInputSchema = object({
7624
- deviceId: number().optional(),
7667
+ /** Internal, lease-scoped participant operation. It is intentionally separate
7668
+ * from persistent recording settings: a migration never changes
7669
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
7670
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string$2().min(1) });
7671
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string$2().min(1) });
7672
+ var StorageMigrationMediaMoveInputSchema = object({
7625
7673
  toLocationId: string$2(),
7626
7674
  throttleMbps: number().min(1).max(1e3).optional()
7675
+ }).extend({ leaseId: string$2().min(1) });
7676
+ /** The independently selectable logical storage classes. `recordings`
7677
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
7678
+ * segments; `eventMedia` is post-analysis blobs. */
7679
+ var StorageMigrationClassSchema = _enum([
7680
+ "recordings",
7681
+ "recordingsLow",
7682
+ "eventMedia"
7683
+ ]);
7684
+ /** A destination is always an existing, fully-qualified location id. The
7685
+ * migration API intentionally never changes a source location's `basePath`:
7686
+ * callers create a new `<type>:<slug>` location, then select it here. */
7687
+ var StorageMigrationDestinationsSchema = object({
7688
+ recordings: string$2().min(1).optional(),
7689
+ recordingsLow: string$2().min(1).optional(),
7690
+ eventMedia: string$2().min(1).optional()
7691
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
7692
+ /** Shared input for planning and starting an orchestrated storage migration. */
7693
+ var StorageMigrationInputSchema = object({
7694
+ destinations: StorageMigrationDestinationsSchema,
7695
+ throttleMbps: number().min(1).max(1e3).optional()
7696
+ });
7697
+ /** The durable coordinator state machine. The only phase that changes default
7698
+ * locations is `repointing`, after every selected mover has completed and been
7699
+ * verified. */
7700
+ var StorageMigrationPhaseSchema = _enum([
7701
+ "planning",
7702
+ "pausing",
7703
+ "moving",
7704
+ "verifying",
7705
+ "repointing",
7706
+ "refreshing",
7707
+ "resuming",
7708
+ "done",
7709
+ "failed",
7710
+ "cancelled"
7711
+ ]);
7712
+ var StorageMigrationParticipantSchema = _enum([
7713
+ "pipeline",
7714
+ "recorder",
7715
+ "analytics"
7716
+ ]);
7717
+ var StorageMigrationMoveSchema = object({
7718
+ storageClass: StorageMigrationClassSchema,
7719
+ fromLocationId: string$2(),
7720
+ toLocationId: string$2(),
7721
+ moverJobId: string$2().nullable(),
7722
+ state: RelocateJobStateSchema.nullable(),
7723
+ error: string$2().nullable()
7724
+ });
7725
+ var StorageMigrationJobSchema = object({
7726
+ jobId: string$2(),
7727
+ phase: StorageMigrationPhaseSchema,
7728
+ destinations: StorageMigrationDestinationsSchema,
7729
+ throttleMbps: number(),
7730
+ moves: array(StorageMigrationMoveSchema),
7731
+ pauseLeaseId: string$2().nullable(),
7732
+ pausedParticipants: array(StorageMigrationParticipantSchema),
7733
+ repointed: boolean(),
7734
+ cancelRequested: boolean(),
7735
+ startedAt: number(),
7736
+ updatedAt: number(),
7737
+ finishedAt: number().nullable(),
7738
+ error: string$2().nullable()
7739
+ });
7740
+ var StorageMigrationPlanSchema = object({
7741
+ destinations: StorageMigrationDestinationsSchema,
7742
+ moves: array(object({
7743
+ storageClass: StorageMigrationClassSchema,
7744
+ fromLocationId: string$2(),
7745
+ toLocationId: string$2()
7746
+ }))
7627
7747
  });
7628
7748
  /**
7629
7749
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -7675,6 +7795,21 @@ var StorageLocationSchema = object({
7675
7795
  nodeId: string$2().optional(),
7676
7796
  isDefault: boolean().default(false),
7677
7797
  isSystem: boolean().default(false),
7798
+ /**
7799
+ * Operator opt-in: whether consumers that BALANCE across several locations
7800
+ * of a type may write here. Recordings reads it today; event media and
7801
+ * backups are the next consumers, which is why the flag lives on the
7802
+ * location rather than in any one addon's store — nothing has to be
7803
+ * extended to add the next consumer.
7804
+ *
7805
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7806
+ * flag existed reads back with no flag and keeps working exactly as before;
7807
+ * that is the whole compat story, and it is why no migration ships with it.
7808
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7809
+ * disk must not silently start writing to it); the default of a type is
7810
+ * always stamped `true`.
7811
+ */
7812
+ enabled: boolean().optional(),
7678
7813
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7679
7814
  * for node-local locations it can reach) — never persisted, absent when the
7680
7815
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12293,7 +12428,8 @@ method(object({
12293
12428
  }), EmbeddingResultSchema), method(object({ text: string$2() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12294
12429
  /**
12295
12430
  * filesystem-browse — per-node capability for browsing the node's local
12296
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12431
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12432
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12297
12433
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12298
12434
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12299
12435
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -14134,6 +14270,13 @@ var MaskGridDimsSchema = object({
14134
14270
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
14135
14271
  * this one field keeps the schema additive — a rule still declares exactly
14136
14272
  * one trigger.
14273
+ *
14274
+ * AUDIO rules add no member here, for the reason occupancy added none: the
14275
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
14276
+ * mirror.ts` fails the build on a member the app cannot render) and every
14277
+ * member costs a release train. A sustained-sound rule is therefore an
14278
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
14279
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
14137
14280
  */
14138
14281
  var NcDeliverySchema = _enum([
14139
14282
  "immediate",
@@ -14148,15 +14291,32 @@ var NcDeliverySchema = _enum([
14148
14291
  * depend on a provider's raw event name or payload shape.
14149
14292
  */
14150
14293
  var NcSystemEventKindSchema = _enum([
14151
- "camera-online",
14152
- "camera-offline",
14294
+ "device-online",
14295
+ "device-offline",
14296
+ "device-disabled",
14297
+ "device-enabled",
14153
14298
  "stream-online",
14154
14299
  "stream-offline",
14155
14300
  "node-online",
14156
14301
  "node-offline",
14157
14302
  "addon-update-available",
14158
- "server-update-available"
14303
+ "server-update-available",
14304
+ "alarm-triggered",
14305
+ "alarm-armed",
14306
+ "alarm-disarmed",
14307
+ "camera-online",
14308
+ "camera-offline",
14309
+ "camera-disabled",
14310
+ "camera-enabled"
14159
14311
  ]);
14312
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14313
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14314
+ "camera-online",
14315
+ "camera-offline",
14316
+ "camera-disabled",
14317
+ "camera-enabled"
14318
+ ]);
14319
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
14160
14320
  /**
14161
14321
  * One coherent system-event condition. `kinds` is the required opt-in safety
14162
14322
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -14165,6 +14325,18 @@ var NcSystemEventKindSchema = _enum([
14165
14325
  var NcSystemEventConditionSchema = object({
14166
14326
  kinds: array(NcSystemEventKindSchema).min(1),
14167
14327
  deviceIds: array(number().int()).min(1).optional(),
14328
+ /**
14329
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14330
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14331
+ * is what a liveness rule means when nobody said otherwise.
14332
+ *
14333
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14334
+ * one reason: the intake cannot know which devices this household cares
14335
+ * about, and a producer-side filter is one no operator can change. Fails
14336
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14337
+ * does not carry) matches no `deviceTypes` list.
14338
+ */
14339
+ deviceTypes: array(string$2().min(1)).min(1).optional(),
14168
14340
  nodeIds: array(string$2().min(1)).min(1).optional(),
14169
14341
  packageNames: array(string$2().min(1)).min(1).optional()
14170
14342
  });
@@ -14215,6 +14387,47 @@ var NcOccupancyConditionSchema = object({
14215
14387
  sustainSeconds: number().int().min(0).max(3600).default(15)
14216
14388
  });
14217
14389
  /**
14390
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14391
+ *
14392
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14393
+ * reference notifier uses, so an operator moving between them re-uses what
14394
+ * they already know): a rule matches when, over a sampling window of
14395
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14396
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14397
+ *
14398
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14399
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14400
+ * - `labels` — the classifier put at least one of these labels on it.
14401
+ *
14402
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14403
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14404
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14405
+ * is given** — a window in which every sample is trivially a hit would fire on
14406
+ * silence, so the engine refuses such a condition rather than notifying on
14407
+ * nothing (the schema cannot express "at least one of" without becoming a
14408
+ * ZodEffects the cap path would have to special-case).
14409
+ *
14410
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14411
+ * must be FULL before it can match — a window that has been open for two
14412
+ * seconds of its ten is 100% of nothing, and firing on it would make
14413
+ * `samplingSeconds` decorative.
14414
+ *
14415
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14416
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14417
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14418
+ * an operator who typed `dog` mean the same thing.
14419
+ */
14420
+ var NcAudioConditionSchema = object({
14421
+ /** Audio macro labels; absent = any sound (level-only rule). */
14422
+ labels: array(string$2().min(1)).min(1).optional(),
14423
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14424
+ dbThreshold: number().min(-96).max(0).optional(),
14425
+ /** Percentage of the window's samples that must be hits (1–100). */
14426
+ hitPercent: number().int().min(1).max(100).default(60),
14427
+ /** Length of the sampling window in seconds. */
14428
+ samplingSeconds: number().int().min(1).max(300).default(10)
14429
+ });
14430
+ /**
14218
14431
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
14219
14432
  *
14220
14433
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14487,7 +14700,33 @@ var NcConditionsSchema = object({
14487
14700
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14488
14701
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14489
14702
  */
14490
- occupancy: NcOccupancyConditionSchema.optional()
14703
+ occupancy: NcOccupancyConditionSchema.optional(),
14704
+ /**
14705
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14706
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14707
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14708
+ * a window that is not full yet, neither filter given). See
14709
+ * {@link NcAudioCondition}.
14710
+ *
14711
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14712
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14713
+ * a detection, a track or a device event (the same fail-closed pairing
14714
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14715
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14716
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14717
+ * classified sample) stays exactly as it was for rules that already use it.
14718
+ *
14719
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14720
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14721
+ * (`camstack/src/data/notification-center.ts`, guarded by
14722
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14723
+ * condition fields it does not know when a rule is saved from the phone.
14724
+ * Publishing an editor for a condition the app cannot round-trip is how an
14725
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14726
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14727
+ * does an audio rule become authorable.
14728
+ */
14729
+ audio: NcAudioConditionSchema.optional()
14491
14730
  });
14492
14731
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14493
14732
  var NcRuleTargetSchema = object({
@@ -14601,6 +14840,73 @@ var NcThrottleSchema = object({
14601
14840
  */
14602
14841
  granularity: NcThrottleGranularitySchema.optional()
14603
14842
  });
14843
+ /**
14844
+ * How long the confirm gate may hold ONE notification, and how big the picture
14845
+ * it judges may be.
14846
+ *
14847
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14848
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14849
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14850
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14851
+ * tokens for pixels the model pools away.
14852
+ */
14853
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14854
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14855
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14856
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14857
+ var NcConfirmExpectSchema = object({
14858
+ op: _enum([
14859
+ ">=",
14860
+ ">",
14861
+ "<=",
14862
+ "<",
14863
+ "=="
14864
+ ]),
14865
+ count: number().int().min(0).max(1e3)
14866
+ });
14867
+ /**
14868
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14869
+ * to ship and says whether it agrees with the rule.
14870
+ *
14871
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14872
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14873
+ * on the operator's phone is not a verdict about this notification.
14874
+ *
14875
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14876
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14877
+ * the default and every fail-open is COUNTED, because a gate that always fails
14878
+ * open looks in the log exactly like a gate that works.
14879
+ *
14880
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14881
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14882
+ * production failures in one day), so the gate reads absent as the constant
14883
+ * above rather than trusting a parse it may never have seen.
14884
+ */
14885
+ var NcConfirmSchema = object({
14886
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14887
+ * same thing, and both mean "deliver exactly as before". */
14888
+ enabled: boolean().default(false),
14889
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14890
+ profileId: string$2().optional(),
14891
+ /**
14892
+ * The operator's question, in his own words. Absent = a question derived
14893
+ * from the rule (its class and its expectation).
14894
+ *
14895
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14896
+ * banners, signage and plates as instructions if you let them reach the
14897
+ * prompt — proven live — so the authoritative contract stays in the system
14898
+ * turn and only rule-authored words land here.
14899
+ */
14900
+ prompt: string$2().max(1e3).optional(),
14901
+ /** Fire only when the model's count satisfies this. Absent = the model's
14902
+ * own boolean verdict decides. */
14903
+ expect: NcConfirmExpectSchema.optional(),
14904
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14905
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14906
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14907
+ /** Longest edge the judged image is downscaled to before it is sent. */
14908
+ maxImagePx: number().int().min(64).max(2048).default(448)
14909
+ });
14604
14910
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14605
14911
  var NcRuleInputSchema = object({
14606
14912
  name: string$2().min(1).max(200),
@@ -14661,7 +14967,13 @@ var NcRuleInputSchema = object({
14661
14967
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14662
14968
  * shape as every other actuation.
14663
14969
  */
14664
- actions: NcRuleActionsSchema.optional()
14970
+ actions: NcRuleActionsSchema.optional(),
14971
+ /**
14972
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14973
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14974
+ * did, and absent is the only way to say that without a migration.
14975
+ */
14976
+ confirm: NcConfirmSchema.optional()
14665
14977
  });
14666
14978
  /**
14667
14979
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14672,7 +14984,37 @@ var NcRuleInputSchema = object({
14672
14984
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14673
14985
  * `updateRule` patch.
14674
14986
  */
14675
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string$2()).optional() });
14987
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14988
+ disabledTargetIds: array(string$2()).optional(),
14989
+ /**
14990
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14991
+ *
14992
+ * It makes the key optional to SUPPLY; the parse still materialises the
14993
+ * default when the key is absent. And `NcRuleStore.update` merges with
14994
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14995
+ * one — which made every partial edit destructive:
14996
+ *
14997
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14998
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14999
+ * setEnabled(ruleId, false) → conditions reset to `{}`
15000
+ *
15001
+ * A rule scoped to one camera and one zone silently became a rule that
15002
+ * matches EVERY event on EVERY camera, and lost its `media` policy
15003
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
15004
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
15005
+ * within a minute of a two-field patch.
15006
+ *
15007
+ * So every defaulted field is re-declared here WITHOUT its default. The
15008
+ * inner defaults still apply when the caller DOES send the key — `{}` for
15009
+ * conditions remains a real instruction ("clear them") — and only the
15010
+ * absent key is now genuinely absent.
15011
+ */
15012
+ enabled: boolean().optional(),
15013
+ conditions: NcConditionsSchema.optional(),
15014
+ media: NcMediaPolicySchema.optional(),
15015
+ throttle: NcThrottleSchema.optional(),
15016
+ priority: number().int().min(1).max(5).optional()
15017
+ });
14676
15018
  /** A persisted rule. */
14677
15019
  var NcRuleSchema = NcRuleInputSchema.extend({
14678
15020
  id: string$2(),
@@ -14973,6 +15315,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14973
15315
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14974
15316
  * copy would lie the first time a rule is disabled.
14975
15317
  */
15318
+ /**
15319
+ * Why a device a mode NAMES is nonetheless not armed by it.
15320
+ *
15321
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15322
+ * per-camera notification switch the Notification Center already owns,
15323
+ * `detection-off` is the device's own detection binding being inactive, and
15324
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15325
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15326
+ * with the switches the operator actually used.
15327
+ */
15328
+ var NcAlarmSkipReasonSchema = _enum([
15329
+ "muted",
15330
+ "detection-off",
15331
+ "offline"
15332
+ ]);
15333
+ var NcAlarmSkippedDeviceSchema = object({
15334
+ deviceId: number().int(),
15335
+ reason: NcAlarmSkipReasonSchema
15336
+ });
14976
15337
  var NcAlarmModeCoverageSchema = object({
14977
15338
  mode: AlarmArmModeSchema,
14978
15339
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14980,7 +15341,18 @@ var NcAlarmModeCoverageSchema = object({
14980
15341
  /** At least one covering rule has no device scope, so the mode covers all. */
14981
15342
  allDevices: boolean(),
14982
15343
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14983
- deviceIds: array(number().int())
15344
+ deviceIds: array(number().int()),
15345
+ /**
15346
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15347
+ * excludes it.
15348
+ *
15349
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15350
+ * twelve makes it false in exactly the way nobody notices until an incident.
15351
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15352
+ * still parses as "nothing known to be skipped" rather than failing the whole
15353
+ * alarm tab.
15354
+ */
15355
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
14984
15356
  });
14985
15357
  var NcAlarmConfigSchema = object({
14986
15358
  /**
@@ -16343,13 +16715,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16343
16715
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16344
16716
  kind: "mutation",
16345
16717
  auth: "admin"
16346
- }), method(RelocateMediaInputSchema, object({ jobId: string$2() }), {
16718
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
16347
16719
  kind: "mutation",
16348
16720
  auth: "admin"
16349
- }), method(object({}), array(RelocateJobSchema).readonly(), {
16350
- kind: "query",
16721
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
16722
+ kind: "mutation",
16351
16723
  auth: "admin"
16352
- }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
16724
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
16725
+ kind: "mutation",
16726
+ auth: "admin"
16727
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string$2() }), {
16728
+ kind: "mutation",
16729
+ auth: "admin"
16730
+ }), method(object({ jobId: string$2() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
16353
16731
  kind: "mutation",
16354
16732
  auth: "admin"
16355
16733
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -17806,9 +18184,16 @@ var CameraStatusSchema = object({
17806
18184
  audio: CameraAudioStatusSchema.nullable(),
17807
18185
  recording: CameraRecordingStatusSchema.nullable(),
17808
18186
  /**
17809
- * Per-camera function switches an OPERATOR has turned off
18187
+ * Per-camera functions an OPERATOR has turned off
17810
18188
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17811
18189
  *
18190
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
18191
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
18192
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
18193
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
18194
+ * The badge outlives the control panel: the panel was a convenience, this is
18195
+ * the difference between a camera being off and a camera being dead.
18196
+ *
17812
18197
  * This is the difference between DISABLED and BROKEN. A camera whose
17813
18198
  * `detection` block reports zero fps and whose `switchedOff` contains
17814
18199
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -17879,7 +18264,13 @@ var NodeInferenceDevicesSchema = object({
17879
18264
  reachable: boolean(),
17880
18265
  devices: array(NodeInferenceDeviceSchema).readonly()
17881
18266
  });
17882
- method(object({
18267
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
18268
+ kind: "mutation",
18269
+ auth: "admin"
18270
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
18271
+ kind: "mutation",
18272
+ auth: "admin"
18273
+ }), method(object({
17883
18274
  deviceId: number(),
17884
18275
  agentNodeId: string$2()
17885
18276
  }), object({ success: literal(true) }), {
@@ -18553,6 +18944,13 @@ method(object({ locationId: string$2() }), EvictableUsageSchema), method(object(
18553
18944
  locationId: string$2(),
18554
18945
  targetBytes: number().int().positive()
18555
18946
  }), EvictResultSchema, { kind: "mutation" });
18947
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string$2() }), {
18948
+ kind: "mutation",
18949
+ auth: "admin"
18950
+ }), method(object({ jobId: string$2().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
18951
+ kind: "mutation",
18952
+ auth: "admin"
18953
+ });
18556
18954
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
18557
18955
  providerId: string$2().min(1),
18558
18956
  displayName: string$2().min(1),
@@ -18656,6 +19054,28 @@ var TerminalProfileInfoSchema = object({
18656
19054
  label: string$2(),
18657
19055
  description: string$2().optional()
18658
19056
  });
19057
+ /**
19058
+ * A durable operator-created Terminal instance. Profiles are templates; only
19059
+ * an instance declares a camera.
19060
+ */
19061
+ var TerminalInstanceInfoSchema = object({
19062
+ instanceId: string$2(),
19063
+ cameraStableId: string$2(),
19064
+ nodeId: string$2(),
19065
+ profileId: string$2(),
19066
+ profileLabel: string$2(),
19067
+ name: string$2(),
19068
+ enabled: boolean()
19069
+ });
19070
+ var TerminalLegacyCameraSchema = object({
19071
+ stableId: string$2(),
19072
+ nodeId: string$2(),
19073
+ profileId: string$2(),
19074
+ profileLabel: string$2(),
19075
+ name: string$2(),
19076
+ /** Only legacy monitor cameras can retain their historic stable identity. */
19077
+ adoptable: boolean()
19078
+ });
18659
19079
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
18660
19080
  seq: number().int().positive(),
18661
19081
  kind: literal("data"),
@@ -18672,7 +19092,29 @@ var TerminalOutputBatchSchema = object({
18672
19092
  snapshot: string$2().optional(),
18673
19093
  events: array(TerminalOutputEventSchema).readonly()
18674
19094
  });
18675
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
19095
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
19096
+ targetNodeId: string$2().min(1),
19097
+ profileId: string$2().min(1),
19098
+ name: string$2().trim().min(1).max(160).optional()
19099
+ }), TerminalInstanceInfoSchema, {
19100
+ kind: "mutation",
19101
+ auth: "admin"
19102
+ }), method(object({ instanceId: string$2().min(1) }), _void(), {
19103
+ kind: "mutation",
19104
+ auth: "admin"
19105
+ }), method(object({
19106
+ instanceId: string$2().min(1),
19107
+ enabled: boolean()
19108
+ }), TerminalInstanceInfoSchema, {
19109
+ kind: "mutation",
19110
+ auth: "admin"
19111
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
19112
+ stableId: string$2().min(1),
19113
+ name: string$2().trim().min(1).max(160).optional()
19114
+ }), TerminalInstanceInfoSchema, {
19115
+ kind: "mutation",
19116
+ auth: "admin"
19117
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18676
19118
  profileId: string$2(),
18677
19119
  cols: number().int().positive(),
18678
19120
  rows: number().int().positive()
@@ -18689,7 +19131,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
18689
19131
  }), method(object({
18690
19132
  sessionId: string$2(),
18691
19133
  afterSeq: number().int().nonnegative(),
18692
- waitMs: number().int().min(0).max(2e3).default(0)
19134
+ waitMs: number().int().min(0).max(2e3).default(0),
19135
+ /**
19136
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
19137
+ * browser's initial repaint remains immediate; the camera snapshot
19138
+ * relay uses it to avoid encoding a blank startup frame.
19139
+ */
19140
+ waitForOutput: boolean().optional()
18693
19141
  }), TerminalOutputBatchSchema, {
18694
19142
  kind: "mutation",
18695
19143
  auth: "admin",
@@ -21204,6 +21652,7 @@ var FaceInfoSchema = object({
21204
21652
  var FaceFilterEnum = _enum([
21205
21653
  "unassigned",
21206
21654
  "recognized",
21655
+ "identified",
21207
21656
  "all"
21208
21657
  ]);
21209
21658
  var MediaFileLiteSchema$1 = object({
@@ -21232,6 +21681,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string$
21232
21681
  kind: "mutation",
21233
21682
  auth: "admin"
21234
21683
  }), method(object({
21684
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
21685
+ deviceId: number().int().optional(),
21235
21686
  limit: number().int().positive().optional(),
21236
21687
  filter: FaceFilterEnum.optional(),
21237
21688
  /**
@@ -23461,6 +23912,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
23461
23912
  capName: string$2().min(1).max(64),
23462
23913
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
23463
23914
  valuePath: string$2().min(1).max(64)
23915
+ }),
23916
+ object({
23917
+ kind: literal("latest-recognition"),
23918
+ recognition: _enum(["person", "plate"])
23464
23919
  })
23465
23920
  ]);
23466
23921
  var OsdSlotBindingSchema = object({
@@ -23566,6 +24021,15 @@ method(object({ deviceId: number().int() }), object({
23566
24021
  }), object({ success: literal(true) }), {
23567
24022
  kind: "mutation",
23568
24023
  auth: "admin"
24024
+ }), method(object({
24025
+ sourceDeviceId: number().int(),
24026
+ targetDeviceId: number().int()
24027
+ }), object({
24028
+ copied: number().int().nonnegative(),
24029
+ skipped: number().int().nonnegative()
24030
+ }), {
24031
+ kind: "mutation",
24032
+ auth: "admin"
23569
24033
  }), method(object({
23570
24034
  deviceId: number().int(),
23571
24035
  slotId: string$2().min(1),
@@ -24488,7 +24952,19 @@ var RecordingManifestSchema = object({
24488
24952
  * profiles/subtrees/locations on this node). */
24489
24953
  var RecordingDeviceUsageSchema = object({
24490
24954
  deviceId: number(),
24491
- usedBytes: number()
24955
+ usedBytes: number(),
24956
+ /**
24957
+ * Start of this camera's OLDEST indexed segment, across every profile and
24958
+ * location — the "Oldest footage" column in Recordings → Storage, and the
24959
+ * only honest answer to "is retention actually holding?" per camera.
24960
+ *
24961
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
24962
+ * predates this field omits it entirely, and a hub whose types carry the
24963
+ * field must keep validating that older provider's payload: the framework
24964
+ * (types) and the addon ship on different trains, and the addon is usually
24965
+ * the later of the two.
24966
+ */
24967
+ oldestMs: number().nullable().optional()
24492
24968
  });
24493
24969
  /** Recording storage usage + capacity for one storage location. */
24494
24970
  var RecordingLocationUsageSchema = object({
@@ -24516,6 +24992,57 @@ var RecordingStorageUsageSchema = object({
24516
24992
  locations: array(RecordingLocationUsageSchema)
24517
24993
  });
24518
24994
  /**
24995
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
24996
+ *
24997
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
24998
+ * is the operator asking for the EXISTING archive to be brought into line with
24999
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
25000
+ * location, run FIFO behind the single-flight mover.
25001
+ *
25002
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
25003
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
25004
+ * (empty on the plan).
25005
+ */
25006
+ var RecordingRebalanceMoveSchema = object({
25007
+ deviceId: number(),
25008
+ profile: string$2(),
25009
+ fromLocationId: string$2(),
25010
+ toLocationId: string$2(),
25011
+ bytes: number(),
25012
+ files: number().int()
25013
+ });
25014
+ /** Why a pile that is out of place is staying there. Every refusal is
25015
+ * reported: a rebalance that silently drops a camera reads exactly like one
25016
+ * that had nothing to do. */
25017
+ var RecordingRebalanceSkipReasonSchema = _enum([
25018
+ "unassigned",
25019
+ "target-not-writable",
25020
+ "below-threshold",
25021
+ "no-headroom"
25022
+ ]);
25023
+ var RecordingRebalanceSkipSchema = object({
25024
+ deviceId: number(),
25025
+ profile: string$2(),
25026
+ fromLocationId: string$2(),
25027
+ /** The location the plan wants; null when the camera has no assignment. */
25028
+ toLocationId: string$2().nullable(),
25029
+ bytes: number(),
25030
+ reason: RecordingRebalanceSkipReasonSchema
25031
+ });
25032
+ var RecordingRebalancePlanSchema = object({
25033
+ moves: array(RecordingRebalanceMoveSchema),
25034
+ skipped: array(RecordingRebalanceSkipSchema),
25035
+ bytesToMove: number(),
25036
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
25037
+ jobIds: array(string$2())
25038
+ });
25039
+ var RecordingRebalanceInputSchema = object({
25040
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
25041
+ throttleMbps: number().min(1).max(1e3).optional(),
25042
+ /** Ignore piles smaller than this (default 1 GB). */
25043
+ minMoveGb: number().min(0).optional()
25044
+ });
25045
+ /**
24519
25046
  * Result of locating footage at a wall-clock instant for one device/profile.
24520
25047
  * `segment` carries the covering segment's window; `gap` reports the forward
24521
25048
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -24663,6 +25190,21 @@ method(object({
24663
25190
  }), {
24664
25191
  kind: "mutation",
24665
25192
  auth: "admin"
25193
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
25194
+ kind: "mutation",
25195
+ auth: "admin"
25196
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
25197
+ kind: "mutation",
25198
+ auth: "admin"
25199
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
25200
+ kind: "mutation",
25201
+ auth: "admin"
25202
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string$2() }), {
25203
+ kind: "mutation",
25204
+ auth: "admin"
25205
+ }), method(object({ jobId: string$2() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
25206
+ kind: "mutation",
25207
+ auth: "admin"
24666
25208
  }), method(RelocateFootageInputSchema, object({ jobId: string$2() }), {
24667
25209
  kind: "mutation",
24668
25210
  auth: "admin"
@@ -24672,9 +25214,15 @@ method(object({
24672
25214
  }), method(object({ jobId: string$2() }), object({ cancelled: boolean() }), {
24673
25215
  kind: "mutation",
24674
25216
  auth: "admin"
25217
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25218
+ kind: "query",
25219
+ auth: "admin"
25220
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25221
+ kind: "mutation",
25222
+ auth: "admin"
24675
25223
  });
24676
25224
  /**
24677
- * `recordingExport` cap — render a footage time range into a single downloadable
25225
+ * `recording-export` cap — render a footage time range into a single downloadable
24678
25226
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
24679
25227
  * bounded lifetime with a durable history, auto-expiry, and optional
24680
25228
  * delete-after-download.
@@ -24689,10 +25237,42 @@ method(object({
24689
25237
  */
24690
25238
  /** Playback-speed multiplier for the render (1 = realtime). */
24691
25239
  var ExportSpeedSchema = number().min(.25).max(32);
25240
+ /**
25241
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25242
+ *
25243
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
25244
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25245
+ * playlist. Handing it absolute epochs would make every call site responsible
25246
+ * for the same subtraction, and the one that forgot would emit a filter that
25247
+ * selects nothing — silently, as a uniform timelapse.
25248
+ */
25249
+ var ExportDenseRangeSchema = object({
25250
+ fromSec: number().nonnegative(),
25251
+ toSec: number().nonnegative()
25252
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
25253
+ /**
25254
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
25255
+ * listed ranges and at the base `everyMs` everywhere else.
25256
+ *
25257
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
25258
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
25259
+ */
25260
+ var ExportDenseSchema = object({
25261
+ everyMs: number().int().positive(),
25262
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
25263
+ });
24692
25264
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
24693
25265
  var ExportTimelapseSchema = object({
24694
25266
  everyMs: number().int().positive(),
24695
- outputFps: number().int().min(1).max(60).optional()
25267
+ outputFps: number().int().min(1).max(60).optional(),
25268
+ /** Optional second, FASTER rate over the intervals that matter. */
25269
+ dense: ExportDenseSchema.optional()
25270
+ }).superRefine((v, ctx) => {
25271
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
25272
+ code: ZodIssueCode.custom,
25273
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
25274
+ path: ["dense", "everyMs"]
25275
+ });
24696
25276
  });
24697
25277
  /**
24698
25278
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -24750,6 +25330,19 @@ var ExportDownloadSchema = object({
24750
25330
  url: string$2(),
24751
25331
  endpoints: array(string$2())
24752
25332
  });
25333
+ /**
25334
+ * A finished export's bytes, inline.
25335
+ *
25336
+ * `bytes` is the DECODED length — the number the caller bounds and logs
25337
+ * against, so nobody has to infer it from the base64 length.
25338
+ */
25339
+ var ExportBytesSchema = object({
25340
+ base64: string$2(),
25341
+ contentType: string$2(),
25342
+ /** Suggested filename, extension included. */
25343
+ name: string$2(),
25344
+ bytes: number().int().nonnegative()
25345
+ });
24753
25346
  method(object({
24754
25347
  deviceId: number(),
24755
25348
  profile: string$2(),
@@ -24774,6 +25367,9 @@ method(object({
24774
25367
  }), method(object({ exportId: string$2() }), ExportDownloadSchema, {
24775
25368
  kind: "query",
24776
25369
  auth: "protected"
25370
+ }), method(object({ exportId: string$2() }), ExportBytesSchema, {
25371
+ kind: "query",
25372
+ auth: "protected"
24777
25373
  });
24778
25374
  /**
24779
25375
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -30275,6 +30871,12 @@ Object.freeze({
30275
30871
  addonId: null,
30276
30872
  access: "delete"
30277
30873
  },
30874
+ "osdManager.copyDeviceConfiguration": {
30875
+ capName: "osd-manager",
30876
+ capScope: "system",
30877
+ addonId: null,
30878
+ access: "create"
30879
+ },
30278
30880
  "osdManager.getConditionSupport": {
30279
30881
  capName: "osd-manager",
30280
30882
  capScope: "system",
@@ -30371,7 +30973,7 @@ Object.freeze({
30371
30973
  addonId: null,
30372
30974
  access: "create"
30373
30975
  },
30374
- "pipelineAnalytics.cancelMediaRelocate": {
30976
+ "pipelineAnalytics.cancelStorageMigrationMove": {
30375
30977
  capName: "pipeline-analytics",
30376
30978
  capScope: "device",
30377
30979
  addonId: null,
@@ -30443,12 +31045,6 @@ Object.freeze({
30443
31045
  addonId: null,
30444
31046
  access: "view"
30445
31047
  },
30446
- "pipelineAnalytics.getMediaRelocateStatus": {
30447
- capName: "pipeline-analytics",
30448
- capScope: "device",
30449
- addonId: null,
30450
- access: "view"
30451
- },
30452
31048
  "pipelineAnalytics.getMotionEvents": {
30453
31049
  capName: "pipeline-analytics",
30454
31050
  capScope: "device",
@@ -30485,6 +31081,12 @@ Object.freeze({
30485
31081
  addonId: null,
30486
31082
  access: "view"
30487
31083
  },
31084
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
31085
+ capName: "pipeline-analytics",
31086
+ capScope: "device",
31087
+ addonId: null,
31088
+ access: "view"
31089
+ },
30488
31090
  "pipelineAnalytics.getTrack": {
30489
31091
  capName: "pipeline-analytics",
30490
31092
  capScope: "device",
@@ -30563,6 +31165,12 @@ Object.freeze({
30563
31165
  addonId: null,
30564
31166
  access: "view"
30565
31167
  },
31168
+ "pipelineAnalytics.pauseForStorageMigration": {
31169
+ capName: "pipeline-analytics",
31170
+ capScope: "device",
31171
+ addonId: null,
31172
+ access: "create"
31173
+ },
30566
31174
  "pipelineAnalytics.proposeRetrainAnnotations": {
30567
31175
  capName: "pipeline-analytics",
30568
31176
  capScope: "device",
@@ -30593,7 +31201,7 @@ Object.freeze({
30593
31201
  addonId: null,
30594
31202
  access: "create"
30595
31203
  },
30596
- "pipelineAnalytics.relocateMedia": {
31204
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
30597
31205
  capName: "pipeline-analytics",
30598
31206
  capScope: "device",
30599
31207
  addonId: null,
@@ -30605,6 +31213,12 @@ Object.freeze({
30605
31213
  addonId: null,
30606
31214
  access: "create"
30607
31215
  },
31216
+ "pipelineAnalytics.resumeForStorageMigration": {
31217
+ capName: "pipeline-analytics",
31218
+ capScope: "device",
31219
+ addonId: null,
31220
+ access: "create"
31221
+ },
30608
31222
  "pipelineAnalytics.saveRetrainAnnotations": {
30609
31223
  capName: "pipeline-analytics",
30610
31224
  capScope: "device",
@@ -30629,6 +31243,12 @@ Object.freeze({
30629
31243
  addonId: null,
30630
31244
  access: "create"
30631
31245
  },
31246
+ "pipelineAnalytics.startStorageMigrationMove": {
31247
+ capName: "pipeline-analytics",
31248
+ capScope: "device",
31249
+ addonId: null,
31250
+ access: "create"
31251
+ },
30632
31252
  "pipelineAnalytics.wipeAllAnalytics": {
30633
31253
  capName: "pipeline-analytics",
30634
31254
  capScope: "device",
@@ -30995,6 +31615,12 @@ Object.freeze({
30995
31615
  addonId: null,
30996
31616
  access: "view"
30997
31617
  },
31618
+ "pipelineOrchestrator.pauseForStorageMigration": {
31619
+ capName: "pipeline-orchestrator",
31620
+ capScope: "system",
31621
+ addonId: null,
31622
+ access: "create"
31623
+ },
30998
31624
  "pipelineOrchestrator.rebalance": {
30999
31625
  capName: "pipeline-orchestrator",
31000
31626
  capScope: "system",
@@ -31019,6 +31645,12 @@ Object.freeze({
31019
31645
  addonId: null,
31020
31646
  access: "view"
31021
31647
  },
31648
+ "pipelineOrchestrator.resumeForStorageMigration": {
31649
+ capName: "pipeline-orchestrator",
31650
+ capScope: "system",
31651
+ addonId: null,
31652
+ access: "create"
31653
+ },
31022
31654
  "pipelineOrchestrator.saveTemplate": {
31023
31655
  capName: "pipeline-orchestrator",
31024
31656
  capScope: "system",
@@ -31415,7 +32047,13 @@ Object.freeze({
31415
32047
  addonId: null,
31416
32048
  access: "create"
31417
32049
  },
31418
- "recording.cancelRelocate": {
32050
+ "recording.cancelRelocateJob": {
32051
+ capName: "recording",
32052
+ capScope: "system",
32053
+ addonId: null,
32054
+ access: "create"
32055
+ },
32056
+ "recording.cancelStorageMigrationMove": {
31419
32057
  capName: "recording",
31420
32058
  capScope: "system",
31421
32059
  addonId: null,
@@ -31451,7 +32089,7 @@ Object.freeze({
31451
32089
  addonId: null,
31452
32090
  access: "view"
31453
32091
  },
31454
- "recording.getRelocateStatus": {
32092
+ "recording.getStorageMigrationMoveStatus": {
31455
32093
  capName: "recording",
31456
32094
  capScope: "system",
31457
32095
  addonId: null,
@@ -31469,12 +32107,30 @@ Object.freeze({
31469
32107
  addonId: null,
31470
32108
  access: "view"
31471
32109
  },
32110
+ "recording.listRelocateJobs": {
32111
+ capName: "recording",
32112
+ capScope: "system",
32113
+ addonId: null,
32114
+ access: "view"
32115
+ },
31472
32116
  "recording.locateSegment": {
31473
32117
  capName: "recording",
31474
32118
  capScope: "system",
31475
32119
  addonId: null,
31476
32120
  access: "view"
31477
32121
  },
32122
+ "recording.pauseForStorageMigration": {
32123
+ capName: "recording",
32124
+ capScope: "system",
32125
+ addonId: null,
32126
+ access: "create"
32127
+ },
32128
+ "recording.planStorageRebalance": {
32129
+ capName: "recording",
32130
+ capScope: "system",
32131
+ addonId: null,
32132
+ access: "view"
32133
+ },
31478
32134
  "recording.pruneFootage": {
31479
32135
  capName: "recording",
31480
32136
  capScope: "system",
@@ -31493,6 +32149,12 @@ Object.freeze({
31493
32149
  addonId: null,
31494
32150
  access: "view"
31495
32151
  },
32152
+ "recording.refreshStorageLocationsForMigration": {
32153
+ capName: "recording",
32154
+ capScope: "system",
32155
+ addonId: null,
32156
+ access: "create"
32157
+ },
31496
32158
  "recording.relocateFootage": {
31497
32159
  capName: "recording",
31498
32160
  capScope: "system",
@@ -31517,44 +32179,68 @@ Object.freeze({
31517
32179
  addonId: null,
31518
32180
  access: "create"
31519
32181
  },
32182
+ "recording.resumeForStorageMigration": {
32183
+ capName: "recording",
32184
+ capScope: "system",
32185
+ addonId: null,
32186
+ access: "create"
32187
+ },
31520
32188
  "recording.setDeviceConfig": {
31521
32189
  capName: "recording",
31522
32190
  capScope: "system",
31523
32191
  addonId: null,
31524
32192
  access: "create"
31525
32193
  },
32194
+ "recording.startStorageMigrationMove": {
32195
+ capName: "recording",
32196
+ capScope: "system",
32197
+ addonId: null,
32198
+ access: "create"
32199
+ },
32200
+ "recording.startStorageRebalance": {
32201
+ capName: "recording",
32202
+ capScope: "system",
32203
+ addonId: null,
32204
+ access: "create"
32205
+ },
31526
32206
  "recordingExport.cancelExport": {
31527
- capName: "recordingExport",
32207
+ capName: "recording-export",
31528
32208
  capScope: "system",
31529
32209
  addonId: null,
31530
32210
  access: "create"
31531
32211
  },
31532
32212
  "recordingExport.createExport": {
31533
- capName: "recordingExport",
32213
+ capName: "recording-export",
31534
32214
  capScope: "system",
31535
32215
  addonId: null,
31536
32216
  access: "create"
31537
32217
  },
31538
32218
  "recordingExport.deleteExport": {
31539
- capName: "recordingExport",
32219
+ capName: "recording-export",
31540
32220
  capScope: "system",
31541
32221
  addonId: null,
31542
32222
  access: "delete"
31543
32223
  },
31544
32224
  "recordingExport.getDownloadUrl": {
31545
- capName: "recordingExport",
32225
+ capName: "recording-export",
31546
32226
  capScope: "system",
31547
32227
  addonId: null,
31548
32228
  access: "view"
31549
32229
  },
31550
32230
  "recordingExport.getExport": {
31551
- capName: "recordingExport",
32231
+ capName: "recording-export",
31552
32232
  capScope: "system",
31553
32233
  addonId: null,
31554
32234
  access: "view"
31555
32235
  },
31556
32236
  "recordingExport.listExports": {
31557
- capName: "recordingExport",
32237
+ capName: "recording-export",
32238
+ capScope: "system",
32239
+ addonId: null,
32240
+ access: "view"
32241
+ },
32242
+ "recordingExport.readExportBytes": {
32243
+ capName: "recording-export",
31558
32244
  capScope: "system",
31559
32245
  addonId: null,
31560
32246
  access: "view"
@@ -31913,6 +32599,30 @@ Object.freeze({
31913
32599
  addonId: null,
31914
32600
  access: "view"
31915
32601
  },
32602
+ "storageMigration.cancel": {
32603
+ capName: "storage-migration",
32604
+ capScope: "system",
32605
+ addonId: null,
32606
+ access: "create"
32607
+ },
32608
+ "storageMigration.plan": {
32609
+ capName: "storage-migration",
32610
+ capScope: "system",
32611
+ addonId: null,
32612
+ access: "view"
32613
+ },
32614
+ "storageMigration.start": {
32615
+ capName: "storage-migration",
32616
+ capScope: "system",
32617
+ addonId: null,
32618
+ access: "create"
32619
+ },
32620
+ "storageMigration.status": {
32621
+ capName: "storage-migration",
32622
+ capScope: "system",
32623
+ addonId: null,
32624
+ access: "view"
32625
+ },
31916
32626
  "storageProvider.abortUpload": {
31917
32627
  capName: "storage-provider",
31918
32628
  capScope: "system",
@@ -32291,12 +33001,42 @@ Object.freeze({
32291
33001
  addonId: null,
32292
33002
  access: "create"
32293
33003
  },
33004
+ "terminalSession.adoptLegacyMonitor": {
33005
+ capName: "terminal-session",
33006
+ capScope: "system",
33007
+ addonId: null,
33008
+ access: "create"
33009
+ },
32294
33010
  "terminalSession.close": {
32295
33011
  capName: "terminal-session",
32296
33012
  capScope: "system",
32297
33013
  addonId: null,
32298
33014
  access: "create"
32299
33015
  },
33016
+ "terminalSession.createInstance": {
33017
+ capName: "terminal-session",
33018
+ capScope: "system",
33019
+ addonId: null,
33020
+ access: "create"
33021
+ },
33022
+ "terminalSession.deleteInstance": {
33023
+ capName: "terminal-session",
33024
+ capScope: "system",
33025
+ addonId: null,
33026
+ access: "delete"
33027
+ },
33028
+ "terminalSession.listInstances": {
33029
+ capName: "terminal-session",
33030
+ capScope: "system",
33031
+ addonId: null,
33032
+ access: "view"
33033
+ },
33034
+ "terminalSession.listLegacyCameras": {
33035
+ capName: "terminal-session",
33036
+ capScope: "system",
33037
+ addonId: null,
33038
+ access: "view"
33039
+ },
32300
33040
  "terminalSession.listProfiles": {
32301
33041
  capName: "terminal-session",
32302
33042
  capScope: "system",
@@ -32327,6 +33067,12 @@ Object.freeze({
32327
33067
  addonId: null,
32328
33068
  access: "create"
32329
33069
  },
33070
+ "terminalSession.setInstanceEnabled": {
33071
+ capName: "terminal-session",
33072
+ capScope: "system",
33073
+ addonId: null,
33074
+ access: "create"
33075
+ },
32330
33076
  "terminalSession.writeInput": {
32331
33077
  capName: "terminal-session",
32332
33078
  capScope: "system",
@@ -32871,6 +33617,104 @@ var FramerateField = number().int().min(1).max(60);
32871
33617
  var TargetsField = array(NcRuleTargetSchema).min(1);
32872
33618
  var PriorityField = number().int().min(1).max(5);
32873
33619
  /**
33620
+ * Explicit override of the DENSE sampling cadence, seconds.
33621
+ *
33622
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
33623
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
33624
+ * made that same base 3 s and rendered a person pass as two frames.)
33625
+ *
33626
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
33627
+ * `denseCadenceSec` and played at `framerate` occupies
33628
+ *
33629
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
33630
+ *
33631
+ * 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.
33632
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
33633
+ * and therefore the length of a quiet night, does not move.
33634
+ *
33635
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
33636
+ * the recording has them returns the same frames, requested twice. Must be
33637
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
33638
+ * a uniform video the operator believes is two-rate — and upsert refuses it
33639
+ * rather than letting the export cap reject the render hours after the window.
33640
+ */
33641
+ var DenseCadenceSecField = number().min(.1).max(3600);
33642
+ /**
33643
+ * Minimum seconds of OUTPUT video each detection range must occupy.
33644
+ *
33645
+ * The operator-facing form of the arithmetic above: instead of solving for a
33646
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
33647
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
33648
+ * that range every ~583 ms.
33649
+ *
33650
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
33651
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
33652
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
33653
+ * ranges are sampled denser than they need. Per-range cadences require a cap
33654
+ * schema change and are the tracked follow-up.
33655
+ *
33656
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
33657
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
33658
+ * by real footage, never met by duplicating frames into motion that never
33659
+ * happened.
33660
+ */
33661
+ var MinDwellSecField = number().min(0).max(60);
33662
+ /**
33663
+ * Caption burned into the notification's preview frame.
33664
+ *
33665
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
33666
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
33667
+ * templating dialect for one field would be a second thing to explain.
33668
+ *
33669
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
33670
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
33671
+ * the reason this is not `.min(1)`.
33672
+ */
33673
+ var PreviewTextField = string$2().max(200);
33674
+ /**
33675
+ * Whether the notification's preview is a STILL or a short animation.
33676
+ *
33677
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
33678
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
33679
+ * night reads better as three seconds of motion than as one frame of it. Both
33680
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
33681
+ * simply applies it to a dozen frames sampled across the render and assembles
33682
+ * them.
33683
+ *
33684
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
33685
+ * seeks and a palette pass, and no rule that never asked for one should start
33686
+ * paying that on the deploy that shipped it.
33687
+ *
33688
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
33689
+ */
33690
+ var PreviewModeField = _enum(["image", "gif"]);
33691
+ /**
33692
+ * Which detection classes the notification reports counts for.
33693
+ *
33694
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
33695
+ * plan — no second query — aggregated per class. Absent or empty means "every
33696
+ * class the window actually contained", which is what an operator who never
33697
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
33698
+ * counts cars all night).
33699
+ *
33700
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
33701
+ * …). An unknown name simply never matches and reports nothing — it is not an
33702
+ * error, because a rule may legitimately name a class this camera's model does
33703
+ * not emit.
33704
+ *
33705
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
33706
+ * - `{{detections}}` — total over the reported classes
33707
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
33708
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
33709
+ * one per class, `count_` + the class name
33710
+ *
33711
+ * With NO custom body template the summary is appended to the derived body, and
33712
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
33713
+ * reads. With a custom template the operator owns every word — nothing is
33714
+ * appended, so `{{detectionSummary}}` is how he asks for it.
33715
+ */
33716
+ var ReportClassesField = array(string$2().min(1).max(40)).max(20);
33717
+ /**
32874
33718
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
32875
33719
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
32876
33720
  * here (see the ownership note above).
@@ -32890,9 +33734,30 @@ var TimelapseRuleInputSchema = object({
32890
33734
  cadenceSec: CadenceSecField.default(15),
32891
33735
  /** Output frames per second of the assembled mp4 (predecessor parity). */
32892
33736
  framerate: FramerateField.default(10),
33737
+ /**
33738
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
33739
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
33740
+ * field gets.
33741
+ */
33742
+ denseCadenceSec: DenseCadenceSecField.optional(),
33743
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
33744
+ minDwellSec: MinDwellSecField.optional(),
32893
33745
  /** `notification-output` targets the finished video/thumbnail is sent to. */
32894
33746
  targets: TargetsField,
32895
33747
  template: TimelapseTemplateSchema.optional(),
33748
+ /**
33749
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
33750
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
33751
+ *
33752
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
33753
+ * the notification's title/body, and clearing it (`template: null`) must not
33754
+ * silently clear the caption too.
33755
+ */
33756
+ previewText: PreviewTextField.optional(),
33757
+ /** Still or animation — see {@link PreviewModeField}. */
33758
+ previewMode: PreviewModeField.default("image"),
33759
+ /** Classes the notification counts — see {@link ReportClassesField}. */
33760
+ reportClasses: ReportClassesField.optional(),
32896
33761
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
32897
33762
  priority: PriorityField.default(3)
32898
33763
  });
@@ -32903,8 +33768,13 @@ object({
32903
33768
  schedule: NcScheduleSchema.optional(),
32904
33769
  cadenceSec: CadenceSecField.optional(),
32905
33770
  framerate: FramerateField.optional(),
33771
+ denseCadenceSec: DenseCadenceSecField.optional(),
33772
+ minDwellSec: MinDwellSecField.optional(),
32906
33773
  targets: TargetsField.optional(),
32907
33774
  template: TimelapseTemplateSchema.nullable().optional(),
33775
+ previewText: PreviewTextField.optional(),
33776
+ previewMode: PreviewModeField.optional(),
33777
+ reportClasses: ReportClassesField.optional(),
32908
33778
  priority: PriorityField.optional()
32909
33779
  });
32910
33780
  TimelapseRuleInputSchema.extend({
@@ -32916,10 +33786,28 @@ TimelapseRuleInputSchema.extend({
32916
33786
  */
32917
33787
  ownerUserId: string$2().optional(),
32918
33788
  /**
32919
- * Epoch-ms of the last successful generation — the 1-hour re-generation
32920
- * guard's durable state (predecessor parity). Absent = never generated.
33789
+ * Epoch-ms of the NEWEST successful generation across every camera of this
33790
+ * rule. What a UI shows, and the compatibility floor for
33791
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
32921
33792
  */
32922
33793
  lastGeneratedAt: number().optional(),
33794
+ /**
33795
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
33796
+ * re-generation guard's real durable state.
33797
+ *
33798
+ * One rule covers several cameras and each renders its own video, so a rule
33799
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
33800
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
33801
+ * already done — and B's night is gone for good, because the window will not
33802
+ * come back.
33803
+ *
33804
+ * ADDITIVE, so the migration is free: a row written before this field simply
33805
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
33806
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
33807
+ * "never generated" would re-render and re-notify every camera of every rule
33808
+ * once, on the deploy that shipped the map.
33809
+ */
33810
+ generatedByDevice: record(string$2(), number()).optional(),
32923
33811
  /** userId of the caller who created the rule (server-stamped). */
32924
33812
  createdBy: string$2(),
32925
33813
  createdAt: number(),