@camstack/addon-model-studio 1.1.18 → 1.1.20

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 (18) hide show
  1. package/dist/{MotionZonesSettings-O5n6O0Gj.mjs → MotionZonesSettings-Cu3v84EK.mjs} +1 -1
  2. package/dist/{PrivacyMaskSettings-CSp0pqdC.mjs → PrivacyMaskSettings-BXCBb85n.mjs} +2 -2
  3. package/dist/_stub.js +7 -7
  4. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-DDgNY3RZ.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_model_studio_page-ChXR-SrT.mjs} +4 -4
  5. package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DpvRwqsx.mjs +26 -0
  6. package/dist/{hostInit-DOu0vY6d.mjs → hostInit-DTLitKtO.mjs} +3 -3
  7. package/dist/model-studio.addon.js +936 -48
  8. package/dist/model-studio.addon.mjs +936 -48
  9. package/dist/{player-overlays-WenGh8C9.mjs → player-overlays-9g9Wl5lu.mjs} +1 -1
  10. package/dist/remoteEntry.js +1 -1
  11. package/dist/{trash-2-g2CKQXbP.mjs → trash-2-CuBBH1-r.mjs} +1 -1
  12. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-BxoKR4IK.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_model_studio_page__remoteEntry_js-CNbwY0Zt.mjs} +1 -1
  13. package/package.json +1 -1
  14. package/dist/_virtual_mf___mfe_internal__addon_model_studio_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-l-RIbQas.mjs +0 -26
  15. package/python/__pycache__/convert.cpython-314.pyc +0 -0
  16. package/python/__pycache__/convert_lib.cpython-312.pyc +0 -0
  17. package/python/__pycache__/convert_lib.cpython-314.pyc +0 -0
  18. package/python/__tests__/__pycache__/test_convert_lib.cpython-314.pyc +0 -0
@@ -7339,8 +7339,31 @@ var AdoptionJobSchema = object({
7339
7339
  error: string().nullable()
7340
7340
  });
7341
7341
  /**
7342
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7343
- * pipeline functions an operator thinks in terms of.
7342
+ * Per-camera FUNCTION SWITCHES.
7343
+ *
7344
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7345
+ *
7346
+ * This file shipped as "the one coherent on/off surface over the pipeline
7347
+ * functions an operator thinks in terms of". The operator's verdict on
7348
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7349
+ * every function already had a settings page of its own, and a second place to
7350
+ * turn it off is a second place to look. Each switch is going back to its own
7351
+ * component's original options — detection to the detection-pipeline wrapper
7352
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7353
+ * (which was always first-class; the switch was a veneer over
7354
+ * `recording.setDeviceConfig`), notifications to a notification-center
7355
+ * per-device setting, the two camera planes to their own components.
7356
+ *
7357
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7358
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7359
+ * straight from the authorities with no group in the middle. That rule was
7360
+ * never about a control panel.
7361
+ *
7362
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7363
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7364
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7365
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7366
+ * stop; nothing new may be built on it.
7344
7367
  *
7345
7368
  * ## This file adds no state
7346
7369
  *
@@ -7685,14 +7708,21 @@ var RecordingConfigSchema = object({
7685
7708
  /**
7686
7709
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
7687
7710
  *
7688
- * One shape shared by the recorder's `relocateFootage` (segments) and
7689
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7690
- * page renders both movers with one component. Jobs are in-RAM (a restart
7691
- * forgets them re-running is safe by construction: copy-if-absent, delete
7692
- * after verify) and each completed/failed run also lands one durable ops-log
7693
- * row on the owning addon's surface.
7711
+ * One shape shared by the recorder and pipeline-analytics internal movers.
7712
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
7713
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
7714
+ * Each completed/failed run also lands one durable ops-log row on its owning
7715
+ * addon surface.
7716
+ */
7717
+ /**
7718
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7719
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7720
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7721
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7722
+ * runs at all.
7694
7723
  */
7695
7724
  var RelocateJobStateSchema = _enum([
7725
+ "queued",
7696
7726
  "running",
7697
7727
  "done",
7698
7728
  "failed",
@@ -7717,19 +7747,109 @@ var RelocateJobSchema = object({
7717
7747
  finishedAt: number().nullable(),
7718
7748
  error: string().nullable()
7719
7749
  });
7750
+ /** Profile-derived footage selection used only by the migration coordinator:
7751
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
7752
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
7720
7753
  var RelocateFootageInputSchema = object({
7721
- deviceId: number().optional(),
7722
7754
  fromLocationId: string(),
7723
7755
  toLocationId: string(),
7724
7756
  entities: array(_enum(["segments"])).optional(),
7757
+ /** Limits relocation to the logical profile class. Omit only for the
7758
+ * pre-orchestration compatibility path. */
7759
+ footageClass: RelocateFootageClassSchema.optional(),
7760
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7761
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7762
+ * unit is a (camera, profile) pile, not a disk. */
7763
+ deviceId: number().int().optional(),
7764
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7765
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7766
+ * placement plan assigns those two independently, so a rebalance that could
7767
+ * only say "recordings" would move footage the plan never asked to move. */
7768
+ profiles: array(string()).optional(),
7725
7769
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7726
7770
  * never allowed to starve live writers. */
7727
7771
  throttleMbps: number().min(1).max(1e3).optional()
7728
7772
  });
7729
- var RelocateMediaInputSchema = object({
7730
- deviceId: number().optional(),
7773
+ /** Internal, lease-scoped participant operation. It is intentionally separate
7774
+ * from persistent recording settings: a migration never changes
7775
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
7776
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
7777
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
7778
+ var StorageMigrationMediaMoveInputSchema = object({
7731
7779
  toLocationId: string(),
7732
7780
  throttleMbps: number().min(1).max(1e3).optional()
7781
+ }).extend({ leaseId: string().min(1) });
7782
+ /** The independently selectable logical storage classes. `recordings`
7783
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
7784
+ * segments; `eventMedia` is post-analysis blobs. */
7785
+ var StorageMigrationClassSchema = _enum([
7786
+ "recordings",
7787
+ "recordingsLow",
7788
+ "eventMedia"
7789
+ ]);
7790
+ /** A destination is always an existing, fully-qualified location id. The
7791
+ * migration API intentionally never changes a source location's `basePath`:
7792
+ * callers create a new `<type>:<slug>` location, then select it here. */
7793
+ var StorageMigrationDestinationsSchema = object({
7794
+ recordings: string().min(1).optional(),
7795
+ recordingsLow: string().min(1).optional(),
7796
+ eventMedia: string().min(1).optional()
7797
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
7798
+ /** Shared input for planning and starting an orchestrated storage migration. */
7799
+ var StorageMigrationInputSchema = object({
7800
+ destinations: StorageMigrationDestinationsSchema,
7801
+ throttleMbps: number().min(1).max(1e3).optional()
7802
+ });
7803
+ /** The durable coordinator state machine. The only phase that changes default
7804
+ * locations is `repointing`, after every selected mover has completed and been
7805
+ * verified. */
7806
+ var StorageMigrationPhaseSchema = _enum([
7807
+ "planning",
7808
+ "pausing",
7809
+ "moving",
7810
+ "verifying",
7811
+ "repointing",
7812
+ "refreshing",
7813
+ "resuming",
7814
+ "done",
7815
+ "failed",
7816
+ "cancelled"
7817
+ ]);
7818
+ var StorageMigrationParticipantSchema = _enum([
7819
+ "pipeline",
7820
+ "recorder",
7821
+ "analytics"
7822
+ ]);
7823
+ var StorageMigrationMoveSchema = object({
7824
+ storageClass: StorageMigrationClassSchema,
7825
+ fromLocationId: string(),
7826
+ toLocationId: string(),
7827
+ moverJobId: string().nullable(),
7828
+ state: RelocateJobStateSchema.nullable(),
7829
+ error: string().nullable()
7830
+ });
7831
+ var StorageMigrationJobSchema = object({
7832
+ jobId: string(),
7833
+ phase: StorageMigrationPhaseSchema,
7834
+ destinations: StorageMigrationDestinationsSchema,
7835
+ throttleMbps: number(),
7836
+ moves: array(StorageMigrationMoveSchema),
7837
+ pauseLeaseId: string().nullable(),
7838
+ pausedParticipants: array(StorageMigrationParticipantSchema),
7839
+ repointed: boolean(),
7840
+ cancelRequested: boolean(),
7841
+ startedAt: number(),
7842
+ updatedAt: number(),
7843
+ finishedAt: number().nullable(),
7844
+ error: string().nullable()
7845
+ });
7846
+ var StorageMigrationPlanSchema = object({
7847
+ destinations: StorageMigrationDestinationsSchema,
7848
+ moves: array(object({
7849
+ storageClass: StorageMigrationClassSchema,
7850
+ fromLocationId: string(),
7851
+ toLocationId: string()
7852
+ }))
7733
7853
  });
7734
7854
  /**
7735
7855
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -7781,6 +7901,21 @@ var StorageLocationSchema = object({
7781
7901
  nodeId: string().optional(),
7782
7902
  isDefault: boolean().default(false),
7783
7903
  isSystem: boolean().default(false),
7904
+ /**
7905
+ * Operator opt-in: whether consumers that BALANCE across several locations
7906
+ * of a type may write here. Recordings reads it today; event media and
7907
+ * backups are the next consumers, which is why the flag lives on the
7908
+ * location rather than in any one addon's store — nothing has to be
7909
+ * extended to add the next consumer.
7910
+ *
7911
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7912
+ * flag existed reads back with no flag and keeps working exactly as before;
7913
+ * that is the whole compat story, and it is why no migration ships with it.
7914
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7915
+ * disk must not silently start writing to it); the default of a type is
7916
+ * always stamped `true`.
7917
+ */
7918
+ enabled: boolean().optional(),
7784
7919
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7785
7920
  * for node-local locations it can reach) — never persisted, absent when the
7786
7921
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12118,7 +12253,8 @@ method(object({
12118
12253
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12119
12254
  /**
12120
12255
  * filesystem-browse — per-node capability for browsing the node's local
12121
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12256
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12257
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12122
12258
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12123
12259
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12124
12260
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -13937,6 +14073,13 @@ var MaskGridDimsSchema = object({
13937
14073
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
13938
14074
  * this one field keeps the schema additive — a rule still declares exactly
13939
14075
  * one trigger.
14076
+ *
14077
+ * AUDIO rules add no member here, for the reason occupancy added none: the
14078
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
14079
+ * mirror.ts` fails the build on a member the app cannot render) and every
14080
+ * member costs a release train. A sustained-sound rule is therefore an
14081
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
14082
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
13940
14083
  */
13941
14084
  var NcDeliverySchema = _enum([
13942
14085
  "immediate",
@@ -13951,15 +14094,32 @@ var NcDeliverySchema = _enum([
13951
14094
  * depend on a provider's raw event name or payload shape.
13952
14095
  */
13953
14096
  var NcSystemEventKindSchema = _enum([
13954
- "camera-online",
13955
- "camera-offline",
14097
+ "device-online",
14098
+ "device-offline",
14099
+ "device-disabled",
14100
+ "device-enabled",
13956
14101
  "stream-online",
13957
14102
  "stream-offline",
13958
14103
  "node-online",
13959
14104
  "node-offline",
13960
14105
  "addon-update-available",
13961
- "server-update-available"
14106
+ "server-update-available",
14107
+ "alarm-triggered",
14108
+ "alarm-armed",
14109
+ "alarm-disarmed",
14110
+ "camera-online",
14111
+ "camera-offline",
14112
+ "camera-disabled",
14113
+ "camera-enabled"
14114
+ ]);
14115
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14116
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14117
+ "camera-online",
14118
+ "camera-offline",
14119
+ "camera-disabled",
14120
+ "camera-enabled"
13962
14121
  ]);
14122
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
13963
14123
  /**
13964
14124
  * One coherent system-event condition. `kinds` is the required opt-in safety
13965
14125
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -13968,6 +14128,18 @@ var NcSystemEventKindSchema = _enum([
13968
14128
  var NcSystemEventConditionSchema = object({
13969
14129
  kinds: array(NcSystemEventKindSchema).min(1),
13970
14130
  deviceIds: array(number().int()).min(1).optional(),
14131
+ /**
14132
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14133
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14134
+ * is what a liveness rule means when nobody said otherwise.
14135
+ *
14136
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14137
+ * one reason: the intake cannot know which devices this household cares
14138
+ * about, and a producer-side filter is one no operator can change. Fails
14139
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14140
+ * does not carry) matches no `deviceTypes` list.
14141
+ */
14142
+ deviceTypes: array(string().min(1)).min(1).optional(),
13971
14143
  nodeIds: array(string().min(1)).min(1).optional(),
13972
14144
  packageNames: array(string().min(1)).min(1).optional()
13973
14145
  });
@@ -14018,6 +14190,47 @@ var NcOccupancyConditionSchema = object({
14018
14190
  sustainSeconds: number().int().min(0).max(3600).default(15)
14019
14191
  });
14020
14192
  /**
14193
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14194
+ *
14195
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14196
+ * reference notifier uses, so an operator moving between them re-uses what
14197
+ * they already know): a rule matches when, over a sampling window of
14198
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14199
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14200
+ *
14201
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14202
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14203
+ * - `labels` — the classifier put at least one of these labels on it.
14204
+ *
14205
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14206
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14207
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14208
+ * is given** — a window in which every sample is trivially a hit would fire on
14209
+ * silence, so the engine refuses such a condition rather than notifying on
14210
+ * nothing (the schema cannot express "at least one of" without becoming a
14211
+ * ZodEffects the cap path would have to special-case).
14212
+ *
14213
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14214
+ * must be FULL before it can match — a window that has been open for two
14215
+ * seconds of its ten is 100% of nothing, and firing on it would make
14216
+ * `samplingSeconds` decorative.
14217
+ *
14218
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14219
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14220
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14221
+ * an operator who typed `dog` mean the same thing.
14222
+ */
14223
+ var NcAudioConditionSchema = object({
14224
+ /** Audio macro labels; absent = any sound (level-only rule). */
14225
+ labels: array(string().min(1)).min(1).optional(),
14226
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14227
+ dbThreshold: number().min(-96).max(0).optional(),
14228
+ /** Percentage of the window's samples that must be hits (1–100). */
14229
+ hitPercent: number().int().min(1).max(100).default(60),
14230
+ /** Length of the sampling window in seconds. */
14231
+ samplingSeconds: number().int().min(1).max(300).default(10)
14232
+ });
14233
+ /**
14021
14234
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
14022
14235
  *
14023
14236
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14290,7 +14503,33 @@ var NcConditionsSchema = object({
14290
14503
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14291
14504
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14292
14505
  */
14293
- occupancy: NcOccupancyConditionSchema.optional()
14506
+ occupancy: NcOccupancyConditionSchema.optional(),
14507
+ /**
14508
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14509
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14510
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14511
+ * a window that is not full yet, neither filter given). See
14512
+ * {@link NcAudioCondition}.
14513
+ *
14514
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14515
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14516
+ * a detection, a track or a device event (the same fail-closed pairing
14517
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14518
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14519
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14520
+ * classified sample) stays exactly as it was for rules that already use it.
14521
+ *
14522
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14523
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14524
+ * (`camstack/src/data/notification-center.ts`, guarded by
14525
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14526
+ * condition fields it does not know when a rule is saved from the phone.
14527
+ * Publishing an editor for a condition the app cannot round-trip is how an
14528
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14529
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14530
+ * does an audio rule become authorable.
14531
+ */
14532
+ audio: NcAudioConditionSchema.optional()
14294
14533
  });
14295
14534
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14296
14535
  var NcRuleTargetSchema = object({
@@ -14404,6 +14643,73 @@ var NcThrottleSchema = object({
14404
14643
  */
14405
14644
  granularity: NcThrottleGranularitySchema.optional()
14406
14645
  });
14646
+ /**
14647
+ * How long the confirm gate may hold ONE notification, and how big the picture
14648
+ * it judges may be.
14649
+ *
14650
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14651
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14652
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14653
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14654
+ * tokens for pixels the model pools away.
14655
+ */
14656
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14657
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14658
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14659
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14660
+ var NcConfirmExpectSchema = object({
14661
+ op: _enum([
14662
+ ">=",
14663
+ ">",
14664
+ "<=",
14665
+ "<",
14666
+ "=="
14667
+ ]),
14668
+ count: number().int().min(0).max(1e3)
14669
+ });
14670
+ /**
14671
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14672
+ * to ship and says whether it agrees with the rule.
14673
+ *
14674
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14675
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14676
+ * on the operator's phone is not a verdict about this notification.
14677
+ *
14678
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14679
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14680
+ * the default and every fail-open is COUNTED, because a gate that always fails
14681
+ * open looks in the log exactly like a gate that works.
14682
+ *
14683
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14684
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14685
+ * production failures in one day), so the gate reads absent as the constant
14686
+ * above rather than trusting a parse it may never have seen.
14687
+ */
14688
+ var NcConfirmSchema = object({
14689
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14690
+ * same thing, and both mean "deliver exactly as before". */
14691
+ enabled: boolean().default(false),
14692
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14693
+ profileId: string().optional(),
14694
+ /**
14695
+ * The operator's question, in his own words. Absent = a question derived
14696
+ * from the rule (its class and its expectation).
14697
+ *
14698
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14699
+ * banners, signage and plates as instructions if you let them reach the
14700
+ * prompt — proven live — so the authoritative contract stays in the system
14701
+ * turn and only rule-authored words land here.
14702
+ */
14703
+ prompt: string().max(1e3).optional(),
14704
+ /** Fire only when the model's count satisfies this. Absent = the model's
14705
+ * own boolean verdict decides. */
14706
+ expect: NcConfirmExpectSchema.optional(),
14707
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14708
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14709
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14710
+ /** Longest edge the judged image is downscaled to before it is sent. */
14711
+ maxImagePx: number().int().min(64).max(2048).default(448)
14712
+ });
14407
14713
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14408
14714
  var NcRuleInputSchema = object({
14409
14715
  name: string().min(1).max(200),
@@ -14464,7 +14770,13 @@ var NcRuleInputSchema = object({
14464
14770
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14465
14771
  * shape as every other actuation.
14466
14772
  */
14467
- actions: NcRuleActionsSchema.optional()
14773
+ actions: NcRuleActionsSchema.optional(),
14774
+ /**
14775
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14776
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14777
+ * did, and absent is the only way to say that without a migration.
14778
+ */
14779
+ confirm: NcConfirmSchema.optional()
14468
14780
  });
14469
14781
  /**
14470
14782
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14475,7 +14787,37 @@ var NcRuleInputSchema = object({
14475
14787
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14476
14788
  * `updateRule` patch.
14477
14789
  */
14478
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
14790
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14791
+ disabledTargetIds: array(string()).optional(),
14792
+ /**
14793
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14794
+ *
14795
+ * It makes the key optional to SUPPLY; the parse still materialises the
14796
+ * default when the key is absent. And `NcRuleStore.update` merges with
14797
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14798
+ * one — which made every partial edit destructive:
14799
+ *
14800
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14801
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14802
+ * setEnabled(ruleId, false) → conditions reset to `{}`
14803
+ *
14804
+ * A rule scoped to one camera and one zone silently became a rule that
14805
+ * matches EVERY event on EVERY camera, and lost its `media` policy
14806
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
14807
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
14808
+ * within a minute of a two-field patch.
14809
+ *
14810
+ * So every defaulted field is re-declared here WITHOUT its default. The
14811
+ * inner defaults still apply when the caller DOES send the key — `{}` for
14812
+ * conditions remains a real instruction ("clear them") — and only the
14813
+ * absent key is now genuinely absent.
14814
+ */
14815
+ enabled: boolean().optional(),
14816
+ conditions: NcConditionsSchema.optional(),
14817
+ media: NcMediaPolicySchema.optional(),
14818
+ throttle: NcThrottleSchema.optional(),
14819
+ priority: number().int().min(1).max(5).optional()
14820
+ });
14479
14821
  /** A persisted rule. */
14480
14822
  var NcRuleSchema = NcRuleInputSchema.extend({
14481
14823
  id: string(),
@@ -14776,6 +15118,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14776
15118
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14777
15119
  * copy would lie the first time a rule is disabled.
14778
15120
  */
15121
+ /**
15122
+ * Why a device a mode NAMES is nonetheless not armed by it.
15123
+ *
15124
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15125
+ * per-camera notification switch the Notification Center already owns,
15126
+ * `detection-off` is the device's own detection binding being inactive, and
15127
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15128
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15129
+ * with the switches the operator actually used.
15130
+ */
15131
+ var NcAlarmSkipReasonSchema = _enum([
15132
+ "muted",
15133
+ "detection-off",
15134
+ "offline"
15135
+ ]);
15136
+ var NcAlarmSkippedDeviceSchema = object({
15137
+ deviceId: number().int(),
15138
+ reason: NcAlarmSkipReasonSchema
15139
+ });
14779
15140
  var NcAlarmModeCoverageSchema = object({
14780
15141
  mode: AlarmArmModeSchema,
14781
15142
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14783,7 +15144,18 @@ var NcAlarmModeCoverageSchema = object({
14783
15144
  /** At least one covering rule has no device scope, so the mode covers all. */
14784
15145
  allDevices: boolean(),
14785
15146
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14786
- deviceIds: array(number().int())
15147
+ deviceIds: array(number().int()),
15148
+ /**
15149
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15150
+ * excludes it.
15151
+ *
15152
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15153
+ * twelve makes it false in exactly the way nobody notices until an incident.
15154
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15155
+ * still parses as "nothing known to be skipped" rather than failing the whole
15156
+ * alarm tab.
15157
+ */
15158
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
14787
15159
  });
14788
15160
  var NcAlarmConfigSchema = object({
14789
15161
  /**
@@ -16146,13 +16518,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16146
16518
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16147
16519
  kind: "mutation",
16148
16520
  auth: "admin"
16149
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
16521
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
16150
16522
  kind: "mutation",
16151
16523
  auth: "admin"
16152
- }), method(object({}), array(RelocateJobSchema).readonly(), {
16153
- kind: "query",
16524
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
16525
+ kind: "mutation",
16154
16526
  auth: "admin"
16155
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16527
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
16528
+ kind: "mutation",
16529
+ auth: "admin"
16530
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
16531
+ kind: "mutation",
16532
+ auth: "admin"
16533
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16156
16534
  kind: "mutation",
16157
16535
  auth: "admin"
16158
16536
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -17576,9 +17954,16 @@ var CameraStatusSchema = object({
17576
17954
  audio: CameraAudioStatusSchema.nullable(),
17577
17955
  recording: CameraRecordingStatusSchema.nullable(),
17578
17956
  /**
17579
- * Per-camera function switches an OPERATOR has turned off
17957
+ * Per-camera functions an OPERATOR has turned off
17580
17958
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17581
17959
  *
17960
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
17961
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
17962
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
17963
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
17964
+ * The badge outlives the control panel: the panel was a convenience, this is
17965
+ * the difference between a camera being off and a camera being dead.
17966
+ *
17582
17967
  * This is the difference between DISABLED and BROKEN. A camera whose
17583
17968
  * `detection` block reports zero fps and whose `switchedOff` contains
17584
17969
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -17649,7 +18034,13 @@ var NodeInferenceDevicesSchema = object({
17649
18034
  reachable: boolean(),
17650
18035
  devices: array(NodeInferenceDeviceSchema).readonly()
17651
18036
  });
17652
- method(object({
18037
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
18038
+ kind: "mutation",
18039
+ auth: "admin"
18040
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
18041
+ kind: "mutation",
18042
+ auth: "admin"
18043
+ }), method(object({
17653
18044
  deviceId: number(),
17654
18045
  agentNodeId: string()
17655
18046
  }), object({ success: literal(true) }), {
@@ -18323,6 +18714,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
18323
18714
  locationId: string(),
18324
18715
  targetBytes: number().int().positive()
18325
18716
  }), EvictResultSchema, { kind: "mutation" });
18717
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
18718
+ kind: "mutation",
18719
+ auth: "admin"
18720
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
18721
+ kind: "mutation",
18722
+ auth: "admin"
18723
+ });
18326
18724
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
18327
18725
  providerId: string().min(1),
18328
18726
  displayName: string().min(1),
@@ -18426,6 +18824,28 @@ var TerminalProfileInfoSchema = object({
18426
18824
  label: string(),
18427
18825
  description: string().optional()
18428
18826
  });
18827
+ /**
18828
+ * A durable operator-created Terminal instance. Profiles are templates; only
18829
+ * an instance declares a camera.
18830
+ */
18831
+ var TerminalInstanceInfoSchema = object({
18832
+ instanceId: string(),
18833
+ cameraStableId: string(),
18834
+ nodeId: string(),
18835
+ profileId: string(),
18836
+ profileLabel: string(),
18837
+ name: string(),
18838
+ enabled: boolean()
18839
+ });
18840
+ var TerminalLegacyCameraSchema = object({
18841
+ stableId: string(),
18842
+ nodeId: string(),
18843
+ profileId: string(),
18844
+ profileLabel: string(),
18845
+ name: string(),
18846
+ /** Only legacy monitor cameras can retain their historic stable identity. */
18847
+ adoptable: boolean()
18848
+ });
18429
18849
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
18430
18850
  seq: number().int().positive(),
18431
18851
  kind: literal("data"),
@@ -18442,7 +18862,29 @@ var TerminalOutputBatchSchema = object({
18442
18862
  snapshot: string().optional(),
18443
18863
  events: array(TerminalOutputEventSchema).readonly()
18444
18864
  });
18445
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18865
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
18866
+ targetNodeId: string().min(1),
18867
+ profileId: string().min(1),
18868
+ name: string().trim().min(1).max(160).optional()
18869
+ }), TerminalInstanceInfoSchema, {
18870
+ kind: "mutation",
18871
+ auth: "admin"
18872
+ }), method(object({ instanceId: string().min(1) }), _void(), {
18873
+ kind: "mutation",
18874
+ auth: "admin"
18875
+ }), method(object({
18876
+ instanceId: string().min(1),
18877
+ enabled: boolean()
18878
+ }), TerminalInstanceInfoSchema, {
18879
+ kind: "mutation",
18880
+ auth: "admin"
18881
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
18882
+ stableId: string().min(1),
18883
+ name: string().trim().min(1).max(160).optional()
18884
+ }), TerminalInstanceInfoSchema, {
18885
+ kind: "mutation",
18886
+ auth: "admin"
18887
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18446
18888
  profileId: string(),
18447
18889
  cols: number().int().positive(),
18448
18890
  rows: number().int().positive()
@@ -18459,7 +18901,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
18459
18901
  }), method(object({
18460
18902
  sessionId: string(),
18461
18903
  afterSeq: number().int().nonnegative(),
18462
- waitMs: number().int().min(0).max(2e3).default(0)
18904
+ waitMs: number().int().min(0).max(2e3).default(0),
18905
+ /**
18906
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
18907
+ * browser's initial repaint remains immediate; the camera snapshot
18908
+ * relay uses it to avoid encoding a blank startup frame.
18909
+ */
18910
+ waitForOutput: boolean().optional()
18463
18911
  }), TerminalOutputBatchSchema, {
18464
18912
  kind: "mutation",
18465
18913
  auth: "admin",
@@ -20400,6 +20848,7 @@ var FaceInfoSchema = object({
20400
20848
  var FaceFilterEnum = _enum([
20401
20849
  "unassigned",
20402
20850
  "recognized",
20851
+ "identified",
20403
20852
  "all"
20404
20853
  ]);
20405
20854
  var MediaFileLiteSchema$1 = object({
@@ -20428,6 +20877,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string(
20428
20877
  kind: "mutation",
20429
20878
  auth: "admin"
20430
20879
  }), method(object({
20880
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
20881
+ deviceId: number().int().optional(),
20431
20882
  limit: number().int().positive().optional(),
20432
20883
  filter: FaceFilterEnum.optional(),
20433
20884
  /**
@@ -22193,6 +22644,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
22193
22644
  capName: string().min(1).max(64),
22194
22645
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
22195
22646
  valuePath: string().min(1).max(64)
22647
+ }),
22648
+ object({
22649
+ kind: literal("latest-recognition"),
22650
+ recognition: _enum(["person", "plate"])
22196
22651
  })
22197
22652
  ]);
22198
22653
  var OsdSlotBindingSchema = object({
@@ -22298,6 +22753,15 @@ method(object({ deviceId: number().int() }), object({
22298
22753
  }), object({ success: literal(true) }), {
22299
22754
  kind: "mutation",
22300
22755
  auth: "admin"
22756
+ }), method(object({
22757
+ sourceDeviceId: number().int(),
22758
+ targetDeviceId: number().int()
22759
+ }), object({
22760
+ copied: number().int().nonnegative(),
22761
+ skipped: number().int().nonnegative()
22762
+ }), {
22763
+ kind: "mutation",
22764
+ auth: "admin"
22301
22765
  }), method(object({
22302
22766
  deviceId: number().int(),
22303
22767
  slotId: string().min(1),
@@ -23008,7 +23472,19 @@ var RecordingManifestSchema = object({
23008
23472
  * profiles/subtrees/locations on this node). */
23009
23473
  var RecordingDeviceUsageSchema = object({
23010
23474
  deviceId: number(),
23011
- usedBytes: number()
23475
+ usedBytes: number(),
23476
+ /**
23477
+ * Start of this camera's OLDEST indexed segment, across every profile and
23478
+ * location — the "Oldest footage" column in Recordings → Storage, and the
23479
+ * only honest answer to "is retention actually holding?" per camera.
23480
+ *
23481
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
23482
+ * predates this field omits it entirely, and a hub whose types carry the
23483
+ * field must keep validating that older provider's payload: the framework
23484
+ * (types) and the addon ship on different trains, and the addon is usually
23485
+ * the later of the two.
23486
+ */
23487
+ oldestMs: number().nullable().optional()
23012
23488
  });
23013
23489
  /** Recording storage usage + capacity for one storage location. */
23014
23490
  var RecordingLocationUsageSchema = object({
@@ -23036,6 +23512,57 @@ var RecordingStorageUsageSchema = object({
23036
23512
  locations: array(RecordingLocationUsageSchema)
23037
23513
  });
23038
23514
  /**
23515
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
23516
+ *
23517
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
23518
+ * is the operator asking for the EXISTING archive to be brought into line with
23519
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
23520
+ * location, run FIFO behind the single-flight mover.
23521
+ *
23522
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
23523
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
23524
+ * (empty on the plan).
23525
+ */
23526
+ var RecordingRebalanceMoveSchema = object({
23527
+ deviceId: number(),
23528
+ profile: string(),
23529
+ fromLocationId: string(),
23530
+ toLocationId: string(),
23531
+ bytes: number(),
23532
+ files: number().int()
23533
+ });
23534
+ /** Why a pile that is out of place is staying there. Every refusal is
23535
+ * reported: a rebalance that silently drops a camera reads exactly like one
23536
+ * that had nothing to do. */
23537
+ var RecordingRebalanceSkipReasonSchema = _enum([
23538
+ "unassigned",
23539
+ "target-not-writable",
23540
+ "below-threshold",
23541
+ "no-headroom"
23542
+ ]);
23543
+ var RecordingRebalanceSkipSchema = object({
23544
+ deviceId: number(),
23545
+ profile: string(),
23546
+ fromLocationId: string(),
23547
+ /** The location the plan wants; null when the camera has no assignment. */
23548
+ toLocationId: string().nullable(),
23549
+ bytes: number(),
23550
+ reason: RecordingRebalanceSkipReasonSchema
23551
+ });
23552
+ var RecordingRebalancePlanSchema = object({
23553
+ moves: array(RecordingRebalanceMoveSchema),
23554
+ skipped: array(RecordingRebalanceSkipSchema),
23555
+ bytesToMove: number(),
23556
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
23557
+ jobIds: array(string())
23558
+ });
23559
+ var RecordingRebalanceInputSchema = object({
23560
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
23561
+ throttleMbps: number().min(1).max(1e3).optional(),
23562
+ /** Ignore piles smaller than this (default 1 GB). */
23563
+ minMoveGb: number().min(0).optional()
23564
+ });
23565
+ /**
23039
23566
  * Result of locating footage at a wall-clock instant for one device/profile.
23040
23567
  * `segment` carries the covering segment's window; `gap` reports the forward
23041
23568
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -23183,6 +23710,21 @@ method(object({
23183
23710
  }), {
23184
23711
  kind: "mutation",
23185
23712
  auth: "admin"
23713
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
23714
+ kind: "mutation",
23715
+ auth: "admin"
23716
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
23717
+ kind: "mutation",
23718
+ auth: "admin"
23719
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
23720
+ kind: "mutation",
23721
+ auth: "admin"
23722
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
23723
+ kind: "mutation",
23724
+ auth: "admin"
23725
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23726
+ kind: "mutation",
23727
+ auth: "admin"
23186
23728
  }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
23187
23729
  kind: "mutation",
23188
23730
  auth: "admin"
@@ -23192,9 +23734,15 @@ method(object({
23192
23734
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23193
23735
  kind: "mutation",
23194
23736
  auth: "admin"
23737
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23738
+ kind: "query",
23739
+ auth: "admin"
23740
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23741
+ kind: "mutation",
23742
+ auth: "admin"
23195
23743
  });
23196
23744
  /**
23197
- * `recordingExport` cap — render a footage time range into a single downloadable
23745
+ * `recording-export` cap — render a footage time range into a single downloadable
23198
23746
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
23199
23747
  * bounded lifetime with a durable history, auto-expiry, and optional
23200
23748
  * delete-after-download.
@@ -23209,10 +23757,42 @@ method(object({
23209
23757
  */
23210
23758
  /** Playback-speed multiplier for the render (1 = realtime). */
23211
23759
  var ExportSpeedSchema = number().min(.25).max(32);
23760
+ /**
23761
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23762
+ *
23763
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
23764
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23765
+ * playlist. Handing it absolute epochs would make every call site responsible
23766
+ * for the same subtraction, and the one that forgot would emit a filter that
23767
+ * selects nothing — silently, as a uniform timelapse.
23768
+ */
23769
+ var ExportDenseRangeSchema = object({
23770
+ fromSec: number().nonnegative(),
23771
+ toSec: number().nonnegative()
23772
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
23773
+ /**
23774
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
23775
+ * listed ranges and at the base `everyMs` everywhere else.
23776
+ *
23777
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
23778
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
23779
+ */
23780
+ var ExportDenseSchema = object({
23781
+ everyMs: number().int().positive(),
23782
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
23783
+ });
23212
23784
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
23213
23785
  var ExportTimelapseSchema = object({
23214
23786
  everyMs: number().int().positive(),
23215
- outputFps: number().int().min(1).max(60).optional()
23787
+ outputFps: number().int().min(1).max(60).optional(),
23788
+ /** Optional second, FASTER rate over the intervals that matter. */
23789
+ dense: ExportDenseSchema.optional()
23790
+ }).superRefine((v, ctx) => {
23791
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
23792
+ code: ZodIssueCode.custom,
23793
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
23794
+ path: ["dense", "everyMs"]
23795
+ });
23216
23796
  });
23217
23797
  /**
23218
23798
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -23270,6 +23850,19 @@ var ExportDownloadSchema = object({
23270
23850
  url: string(),
23271
23851
  endpoints: array(string())
23272
23852
  });
23853
+ /**
23854
+ * A finished export's bytes, inline.
23855
+ *
23856
+ * `bytes` is the DECODED length — the number the caller bounds and logs
23857
+ * against, so nobody has to infer it from the base64 length.
23858
+ */
23859
+ var ExportBytesSchema = object({
23860
+ base64: string(),
23861
+ contentType: string(),
23862
+ /** Suggested filename, extension included. */
23863
+ name: string(),
23864
+ bytes: number().int().nonnegative()
23865
+ });
23273
23866
  method(object({
23274
23867
  deviceId: number(),
23275
23868
  profile: string(),
@@ -23294,6 +23887,9 @@ method(object({
23294
23887
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
23295
23888
  kind: "query",
23296
23889
  auth: "protected"
23890
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
23891
+ kind: "query",
23892
+ auth: "protected"
23297
23893
  });
23298
23894
  /**
23299
23895
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -27311,6 +27907,12 @@ Object.freeze({
27311
27907
  addonId: null,
27312
27908
  access: "delete"
27313
27909
  },
27910
+ "osdManager.copyDeviceConfiguration": {
27911
+ capName: "osd-manager",
27912
+ capScope: "system",
27913
+ addonId: null,
27914
+ access: "create"
27915
+ },
27314
27916
  "osdManager.getConditionSupport": {
27315
27917
  capName: "osd-manager",
27316
27918
  capScope: "system",
@@ -27407,7 +28009,7 @@ Object.freeze({
27407
28009
  addonId: null,
27408
28010
  access: "create"
27409
28011
  },
27410
- "pipelineAnalytics.cancelMediaRelocate": {
28012
+ "pipelineAnalytics.cancelStorageMigrationMove": {
27411
28013
  capName: "pipeline-analytics",
27412
28014
  capScope: "device",
27413
28015
  addonId: null,
@@ -27479,12 +28081,6 @@ Object.freeze({
27479
28081
  addonId: null,
27480
28082
  access: "view"
27481
28083
  },
27482
- "pipelineAnalytics.getMediaRelocateStatus": {
27483
- capName: "pipeline-analytics",
27484
- capScope: "device",
27485
- addonId: null,
27486
- access: "view"
27487
- },
27488
28084
  "pipelineAnalytics.getMotionEvents": {
27489
28085
  capName: "pipeline-analytics",
27490
28086
  capScope: "device",
@@ -27521,6 +28117,12 @@ Object.freeze({
27521
28117
  addonId: null,
27522
28118
  access: "view"
27523
28119
  },
28120
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
28121
+ capName: "pipeline-analytics",
28122
+ capScope: "device",
28123
+ addonId: null,
28124
+ access: "view"
28125
+ },
27524
28126
  "pipelineAnalytics.getTrack": {
27525
28127
  capName: "pipeline-analytics",
27526
28128
  capScope: "device",
@@ -27599,6 +28201,12 @@ Object.freeze({
27599
28201
  addonId: null,
27600
28202
  access: "view"
27601
28203
  },
28204
+ "pipelineAnalytics.pauseForStorageMigration": {
28205
+ capName: "pipeline-analytics",
28206
+ capScope: "device",
28207
+ addonId: null,
28208
+ access: "create"
28209
+ },
27602
28210
  "pipelineAnalytics.proposeRetrainAnnotations": {
27603
28211
  capName: "pipeline-analytics",
27604
28212
  capScope: "device",
@@ -27629,7 +28237,7 @@ Object.freeze({
27629
28237
  addonId: null,
27630
28238
  access: "create"
27631
28239
  },
27632
- "pipelineAnalytics.relocateMedia": {
28240
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
27633
28241
  capName: "pipeline-analytics",
27634
28242
  capScope: "device",
27635
28243
  addonId: null,
@@ -27641,6 +28249,12 @@ Object.freeze({
27641
28249
  addonId: null,
27642
28250
  access: "create"
27643
28251
  },
28252
+ "pipelineAnalytics.resumeForStorageMigration": {
28253
+ capName: "pipeline-analytics",
28254
+ capScope: "device",
28255
+ addonId: null,
28256
+ access: "create"
28257
+ },
27644
28258
  "pipelineAnalytics.saveRetrainAnnotations": {
27645
28259
  capName: "pipeline-analytics",
27646
28260
  capScope: "device",
@@ -27665,6 +28279,12 @@ Object.freeze({
27665
28279
  addonId: null,
27666
28280
  access: "create"
27667
28281
  },
28282
+ "pipelineAnalytics.startStorageMigrationMove": {
28283
+ capName: "pipeline-analytics",
28284
+ capScope: "device",
28285
+ addonId: null,
28286
+ access: "create"
28287
+ },
27668
28288
  "pipelineAnalytics.wipeAllAnalytics": {
27669
28289
  capName: "pipeline-analytics",
27670
28290
  capScope: "device",
@@ -28031,6 +28651,12 @@ Object.freeze({
28031
28651
  addonId: null,
28032
28652
  access: "view"
28033
28653
  },
28654
+ "pipelineOrchestrator.pauseForStorageMigration": {
28655
+ capName: "pipeline-orchestrator",
28656
+ capScope: "system",
28657
+ addonId: null,
28658
+ access: "create"
28659
+ },
28034
28660
  "pipelineOrchestrator.rebalance": {
28035
28661
  capName: "pipeline-orchestrator",
28036
28662
  capScope: "system",
@@ -28055,6 +28681,12 @@ Object.freeze({
28055
28681
  addonId: null,
28056
28682
  access: "view"
28057
28683
  },
28684
+ "pipelineOrchestrator.resumeForStorageMigration": {
28685
+ capName: "pipeline-orchestrator",
28686
+ capScope: "system",
28687
+ addonId: null,
28688
+ access: "create"
28689
+ },
28058
28690
  "pipelineOrchestrator.saveTemplate": {
28059
28691
  capName: "pipeline-orchestrator",
28060
28692
  capScope: "system",
@@ -28451,7 +29083,13 @@ Object.freeze({
28451
29083
  addonId: null,
28452
29084
  access: "create"
28453
29085
  },
28454
- "recording.cancelRelocate": {
29086
+ "recording.cancelRelocateJob": {
29087
+ capName: "recording",
29088
+ capScope: "system",
29089
+ addonId: null,
29090
+ access: "create"
29091
+ },
29092
+ "recording.cancelStorageMigrationMove": {
28455
29093
  capName: "recording",
28456
29094
  capScope: "system",
28457
29095
  addonId: null,
@@ -28487,7 +29125,7 @@ Object.freeze({
28487
29125
  addonId: null,
28488
29126
  access: "view"
28489
29127
  },
28490
- "recording.getRelocateStatus": {
29128
+ "recording.getStorageMigrationMoveStatus": {
28491
29129
  capName: "recording",
28492
29130
  capScope: "system",
28493
29131
  addonId: null,
@@ -28505,12 +29143,30 @@ Object.freeze({
28505
29143
  addonId: null,
28506
29144
  access: "view"
28507
29145
  },
29146
+ "recording.listRelocateJobs": {
29147
+ capName: "recording",
29148
+ capScope: "system",
29149
+ addonId: null,
29150
+ access: "view"
29151
+ },
28508
29152
  "recording.locateSegment": {
28509
29153
  capName: "recording",
28510
29154
  capScope: "system",
28511
29155
  addonId: null,
28512
29156
  access: "view"
28513
29157
  },
29158
+ "recording.pauseForStorageMigration": {
29159
+ capName: "recording",
29160
+ capScope: "system",
29161
+ addonId: null,
29162
+ access: "create"
29163
+ },
29164
+ "recording.planStorageRebalance": {
29165
+ capName: "recording",
29166
+ capScope: "system",
29167
+ addonId: null,
29168
+ access: "view"
29169
+ },
28514
29170
  "recording.pruneFootage": {
28515
29171
  capName: "recording",
28516
29172
  capScope: "system",
@@ -28529,6 +29185,12 @@ Object.freeze({
28529
29185
  addonId: null,
28530
29186
  access: "view"
28531
29187
  },
29188
+ "recording.refreshStorageLocationsForMigration": {
29189
+ capName: "recording",
29190
+ capScope: "system",
29191
+ addonId: null,
29192
+ access: "create"
29193
+ },
28532
29194
  "recording.relocateFootage": {
28533
29195
  capName: "recording",
28534
29196
  capScope: "system",
@@ -28553,44 +29215,68 @@ Object.freeze({
28553
29215
  addonId: null,
28554
29216
  access: "create"
28555
29217
  },
29218
+ "recording.resumeForStorageMigration": {
29219
+ capName: "recording",
29220
+ capScope: "system",
29221
+ addonId: null,
29222
+ access: "create"
29223
+ },
28556
29224
  "recording.setDeviceConfig": {
28557
29225
  capName: "recording",
28558
29226
  capScope: "system",
28559
29227
  addonId: null,
28560
29228
  access: "create"
28561
29229
  },
29230
+ "recording.startStorageMigrationMove": {
29231
+ capName: "recording",
29232
+ capScope: "system",
29233
+ addonId: null,
29234
+ access: "create"
29235
+ },
29236
+ "recording.startStorageRebalance": {
29237
+ capName: "recording",
29238
+ capScope: "system",
29239
+ addonId: null,
29240
+ access: "create"
29241
+ },
28562
29242
  "recordingExport.cancelExport": {
28563
- capName: "recordingExport",
29243
+ capName: "recording-export",
28564
29244
  capScope: "system",
28565
29245
  addonId: null,
28566
29246
  access: "create"
28567
29247
  },
28568
29248
  "recordingExport.createExport": {
28569
- capName: "recordingExport",
29249
+ capName: "recording-export",
28570
29250
  capScope: "system",
28571
29251
  addonId: null,
28572
29252
  access: "create"
28573
29253
  },
28574
29254
  "recordingExport.deleteExport": {
28575
- capName: "recordingExport",
29255
+ capName: "recording-export",
28576
29256
  capScope: "system",
28577
29257
  addonId: null,
28578
29258
  access: "delete"
28579
29259
  },
28580
29260
  "recordingExport.getDownloadUrl": {
28581
- capName: "recordingExport",
29261
+ capName: "recording-export",
28582
29262
  capScope: "system",
28583
29263
  addonId: null,
28584
29264
  access: "view"
28585
29265
  },
28586
29266
  "recordingExport.getExport": {
28587
- capName: "recordingExport",
29267
+ capName: "recording-export",
28588
29268
  capScope: "system",
28589
29269
  addonId: null,
28590
29270
  access: "view"
28591
29271
  },
28592
29272
  "recordingExport.listExports": {
28593
- capName: "recordingExport",
29273
+ capName: "recording-export",
29274
+ capScope: "system",
29275
+ addonId: null,
29276
+ access: "view"
29277
+ },
29278
+ "recordingExport.readExportBytes": {
29279
+ capName: "recording-export",
28594
29280
  capScope: "system",
28595
29281
  addonId: null,
28596
29282
  access: "view"
@@ -28949,6 +29635,30 @@ Object.freeze({
28949
29635
  addonId: null,
28950
29636
  access: "view"
28951
29637
  },
29638
+ "storageMigration.cancel": {
29639
+ capName: "storage-migration",
29640
+ capScope: "system",
29641
+ addonId: null,
29642
+ access: "create"
29643
+ },
29644
+ "storageMigration.plan": {
29645
+ capName: "storage-migration",
29646
+ capScope: "system",
29647
+ addonId: null,
29648
+ access: "view"
29649
+ },
29650
+ "storageMigration.start": {
29651
+ capName: "storage-migration",
29652
+ capScope: "system",
29653
+ addonId: null,
29654
+ access: "create"
29655
+ },
29656
+ "storageMigration.status": {
29657
+ capName: "storage-migration",
29658
+ capScope: "system",
29659
+ addonId: null,
29660
+ access: "view"
29661
+ },
28952
29662
  "storageProvider.abortUpload": {
28953
29663
  capName: "storage-provider",
28954
29664
  capScope: "system",
@@ -29327,12 +30037,42 @@ Object.freeze({
29327
30037
  addonId: null,
29328
30038
  access: "create"
29329
30039
  },
30040
+ "terminalSession.adoptLegacyMonitor": {
30041
+ capName: "terminal-session",
30042
+ capScope: "system",
30043
+ addonId: null,
30044
+ access: "create"
30045
+ },
29330
30046
  "terminalSession.close": {
29331
30047
  capName: "terminal-session",
29332
30048
  capScope: "system",
29333
30049
  addonId: null,
29334
30050
  access: "create"
29335
30051
  },
30052
+ "terminalSession.createInstance": {
30053
+ capName: "terminal-session",
30054
+ capScope: "system",
30055
+ addonId: null,
30056
+ access: "create"
30057
+ },
30058
+ "terminalSession.deleteInstance": {
30059
+ capName: "terminal-session",
30060
+ capScope: "system",
30061
+ addonId: null,
30062
+ access: "delete"
30063
+ },
30064
+ "terminalSession.listInstances": {
30065
+ capName: "terminal-session",
30066
+ capScope: "system",
30067
+ addonId: null,
30068
+ access: "view"
30069
+ },
30070
+ "terminalSession.listLegacyCameras": {
30071
+ capName: "terminal-session",
30072
+ capScope: "system",
30073
+ addonId: null,
30074
+ access: "view"
30075
+ },
29336
30076
  "terminalSession.listProfiles": {
29337
30077
  capName: "terminal-session",
29338
30078
  capScope: "system",
@@ -29363,6 +30103,12 @@ Object.freeze({
29363
30103
  addonId: null,
29364
30104
  access: "create"
29365
30105
  },
30106
+ "terminalSession.setInstanceEnabled": {
30107
+ capName: "terminal-session",
30108
+ capScope: "system",
30109
+ addonId: null,
30110
+ access: "create"
30111
+ },
29366
30112
  "terminalSession.writeInput": {
29367
30113
  capName: "terminal-session",
29368
30114
  capScope: "system",
@@ -29907,6 +30653,104 @@ var FramerateField = number().int().min(1).max(60);
29907
30653
  var TargetsField = array(NcRuleTargetSchema).min(1);
29908
30654
  var PriorityField = number().int().min(1).max(5);
29909
30655
  /**
30656
+ * Explicit override of the DENSE sampling cadence, seconds.
30657
+ *
30658
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
30659
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
30660
+ * made that same base 3 s and rendered a person pass as two frames.)
30661
+ *
30662
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
30663
+ * `denseCadenceSec` and played at `framerate` occupies
30664
+ *
30665
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
30666
+ *
30667
+ * 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.
30668
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
30669
+ * and therefore the length of a quiet night, does not move.
30670
+ *
30671
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
30672
+ * the recording has them returns the same frames, requested twice. Must be
30673
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
30674
+ * a uniform video the operator believes is two-rate — and upsert refuses it
30675
+ * rather than letting the export cap reject the render hours after the window.
30676
+ */
30677
+ var DenseCadenceSecField = number().min(.1).max(3600);
30678
+ /**
30679
+ * Minimum seconds of OUTPUT video each detection range must occupy.
30680
+ *
30681
+ * The operator-facing form of the arithmetic above: instead of solving for a
30682
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
30683
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
30684
+ * that range every ~583 ms.
30685
+ *
30686
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
30687
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
30688
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
30689
+ * ranges are sampled denser than they need. Per-range cadences require a cap
30690
+ * schema change and are the tracked follow-up.
30691
+ *
30692
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
30693
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
30694
+ * by real footage, never met by duplicating frames into motion that never
30695
+ * happened.
30696
+ */
30697
+ var MinDwellSecField = number().min(0).max(60);
30698
+ /**
30699
+ * Caption burned into the notification's preview frame.
30700
+ *
30701
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
30702
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
30703
+ * templating dialect for one field would be a second thing to explain.
30704
+ *
30705
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
30706
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
30707
+ * the reason this is not `.min(1)`.
30708
+ */
30709
+ var PreviewTextField = string().max(200);
30710
+ /**
30711
+ * Whether the notification's preview is a STILL or a short animation.
30712
+ *
30713
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
30714
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
30715
+ * night reads better as three seconds of motion than as one frame of it. Both
30716
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
30717
+ * simply applies it to a dozen frames sampled across the render and assembles
30718
+ * them.
30719
+ *
30720
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
30721
+ * seeks and a palette pass, and no rule that never asked for one should start
30722
+ * paying that on the deploy that shipped it.
30723
+ *
30724
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
30725
+ */
30726
+ var PreviewModeField = _enum(["image", "gif"]);
30727
+ /**
30728
+ * Which detection classes the notification reports counts for.
30729
+ *
30730
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
30731
+ * plan — no second query — aggregated per class. Absent or empty means "every
30732
+ * class the window actually contained", which is what an operator who never
30733
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
30734
+ * counts cars all night).
30735
+ *
30736
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
30737
+ * …). An unknown name simply never matches and reports nothing — it is not an
30738
+ * error, because a rule may legitimately name a class this camera's model does
30739
+ * not emit.
30740
+ *
30741
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
30742
+ * - `{{detections}}` — total over the reported classes
30743
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
30744
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
30745
+ * one per class, `count_` + the class name
30746
+ *
30747
+ * With NO custom body template the summary is appended to the derived body, and
30748
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
30749
+ * reads. With a custom template the operator owns every word — nothing is
30750
+ * appended, so `{{detectionSummary}}` is how he asks for it.
30751
+ */
30752
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
30753
+ /**
29910
30754
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
29911
30755
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
29912
30756
  * here (see the ownership note above).
@@ -29926,9 +30770,30 @@ var TimelapseRuleInputSchema = object({
29926
30770
  cadenceSec: CadenceSecField.default(15),
29927
30771
  /** Output frames per second of the assembled mp4 (predecessor parity). */
29928
30772
  framerate: FramerateField.default(10),
30773
+ /**
30774
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
30775
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
30776
+ * field gets.
30777
+ */
30778
+ denseCadenceSec: DenseCadenceSecField.optional(),
30779
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
30780
+ minDwellSec: MinDwellSecField.optional(),
29929
30781
  /** `notification-output` targets the finished video/thumbnail is sent to. */
29930
30782
  targets: TargetsField,
29931
30783
  template: TimelapseTemplateSchema.optional(),
30784
+ /**
30785
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
30786
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
30787
+ *
30788
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
30789
+ * the notification's title/body, and clearing it (`template: null`) must not
30790
+ * silently clear the caption too.
30791
+ */
30792
+ previewText: PreviewTextField.optional(),
30793
+ /** Still or animation — see {@link PreviewModeField}. */
30794
+ previewMode: PreviewModeField.default("image"),
30795
+ /** Classes the notification counts — see {@link ReportClassesField}. */
30796
+ reportClasses: ReportClassesField.optional(),
29932
30797
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
29933
30798
  priority: PriorityField.default(3)
29934
30799
  });
@@ -29939,8 +30804,13 @@ object({
29939
30804
  schedule: NcScheduleSchema.optional(),
29940
30805
  cadenceSec: CadenceSecField.optional(),
29941
30806
  framerate: FramerateField.optional(),
30807
+ denseCadenceSec: DenseCadenceSecField.optional(),
30808
+ minDwellSec: MinDwellSecField.optional(),
29942
30809
  targets: TargetsField.optional(),
29943
30810
  template: TimelapseTemplateSchema.nullable().optional(),
30811
+ previewText: PreviewTextField.optional(),
30812
+ previewMode: PreviewModeField.optional(),
30813
+ reportClasses: ReportClassesField.optional(),
29944
30814
  priority: PriorityField.optional()
29945
30815
  });
29946
30816
  TimelapseRuleInputSchema.extend({
@@ -29952,10 +30822,28 @@ TimelapseRuleInputSchema.extend({
29952
30822
  */
29953
30823
  ownerUserId: string().optional(),
29954
30824
  /**
29955
- * Epoch-ms of the last successful generation the 1-hour re-generation
29956
- * guard's durable state (predecessor parity). Absent = never generated.
30825
+ * Epoch-ms of the NEWEST successful generation across every camera of this
30826
+ * rule. What a UI shows, and the compatibility floor for
30827
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
29957
30828
  */
29958
30829
  lastGeneratedAt: number().optional(),
30830
+ /**
30831
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
30832
+ * re-generation guard's real durable state.
30833
+ *
30834
+ * One rule covers several cameras and each renders its own video, so a rule
30835
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
30836
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
30837
+ * already done — and B's night is gone for good, because the window will not
30838
+ * come back.
30839
+ *
30840
+ * ADDITIVE, so the migration is free: a row written before this field simply
30841
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
30842
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
30843
+ * "never generated" would re-render and re-notify every camera of every rule
30844
+ * once, on the deploy that shipped the map.
30845
+ */
30846
+ generatedByDevice: record(string(), number()).optional(),
29959
30847
  /** userId of the caller who created the rule (server-stamped). */
29960
30848
  createdBy: string(),
29961
30849
  createdAt: number(),