@camstack/addon-provider-amcrest 0.2.13 → 0.2.15

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 +954 -62
  2. package/dist/addon.mjs +954 -62
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -7199,8 +7199,31 @@ var AdoptionJobSchema = object({
7199
7199
  error: string().nullable()
7200
7200
  });
7201
7201
  /**
7202
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7203
- * pipeline functions an operator thinks in terms of.
7202
+ * Per-camera FUNCTION SWITCHES.
7203
+ *
7204
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7205
+ *
7206
+ * This file shipped as "the one coherent on/off surface over the pipeline
7207
+ * functions an operator thinks in terms of". The operator's verdict on
7208
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7209
+ * every function already had a settings page of its own, and a second place to
7210
+ * turn it off is a second place to look. Each switch is going back to its own
7211
+ * component's original options — detection to the detection-pipeline wrapper
7212
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7213
+ * (which was always first-class; the switch was a veneer over
7214
+ * `recording.setDeviceConfig`), notifications to a notification-center
7215
+ * per-device setting, the two camera planes to their own components.
7216
+ *
7217
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7218
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7219
+ * straight from the authorities with no group in the middle. That rule was
7220
+ * never about a control panel.
7221
+ *
7222
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7223
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7224
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7225
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7226
+ * stop; nothing new may be built on it.
7204
7227
  *
7205
7228
  * ## This file adds no state
7206
7229
  *
@@ -7545,14 +7568,21 @@ var RecordingConfigSchema = object({
7545
7568
  /**
7546
7569
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
7547
7570
  *
7548
- * One shape shared by the recorder's `relocateFootage` (segments) and
7549
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7550
- * page renders both movers with one component. Jobs are in-RAM (a restart
7551
- * forgets them re-running is safe by construction: copy-if-absent, delete
7552
- * after verify) and each completed/failed run also lands one durable ops-log
7553
- * row on the owning addon's surface.
7571
+ * One shape shared by the recorder and pipeline-analytics internal movers.
7572
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
7573
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
7574
+ * Each completed/failed run also lands one durable ops-log row on its owning
7575
+ * addon surface.
7576
+ */
7577
+ /**
7578
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7579
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7580
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7581
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7582
+ * runs at all.
7554
7583
  */
7555
7584
  var RelocateJobStateSchema = _enum([
7585
+ "queued",
7556
7586
  "running",
7557
7587
  "done",
7558
7588
  "failed",
@@ -7577,19 +7607,109 @@ var RelocateJobSchema = object({
7577
7607
  finishedAt: number().nullable(),
7578
7608
  error: string().nullable()
7579
7609
  });
7610
+ /** Profile-derived footage selection used only by the migration coordinator:
7611
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
7612
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
7580
7613
  var RelocateFootageInputSchema = object({
7581
- deviceId: number().optional(),
7582
7614
  fromLocationId: string(),
7583
7615
  toLocationId: string(),
7584
7616
  entities: array(_enum(["segments"])).optional(),
7617
+ /** Limits relocation to the logical profile class. Omit only for the
7618
+ * pre-orchestration compatibility path. */
7619
+ footageClass: RelocateFootageClassSchema.optional(),
7620
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7621
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7622
+ * unit is a (camera, profile) pile, not a disk. */
7623
+ deviceId: number().int().optional(),
7624
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7625
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7626
+ * placement plan assigns those two independently, so a rebalance that could
7627
+ * only say "recordings" would move footage the plan never asked to move. */
7628
+ profiles: array(string()).optional(),
7585
7629
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7586
7630
  * never allowed to starve live writers. */
7587
7631
  throttleMbps: number().min(1).max(1e3).optional()
7588
7632
  });
7589
- var RelocateMediaInputSchema = object({
7590
- deviceId: number().optional(),
7633
+ /** Internal, lease-scoped participant operation. It is intentionally separate
7634
+ * from persistent recording settings: a migration never changes
7635
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
7636
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
7637
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
7638
+ var StorageMigrationMediaMoveInputSchema = object({
7591
7639
  toLocationId: string(),
7592
7640
  throttleMbps: number().min(1).max(1e3).optional()
7641
+ }).extend({ leaseId: string().min(1) });
7642
+ /** The independently selectable logical storage classes. `recordings`
7643
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
7644
+ * segments; `eventMedia` is post-analysis blobs. */
7645
+ var StorageMigrationClassSchema = _enum([
7646
+ "recordings",
7647
+ "recordingsLow",
7648
+ "eventMedia"
7649
+ ]);
7650
+ /** A destination is always an existing, fully-qualified location id. The
7651
+ * migration API intentionally never changes a source location's `basePath`:
7652
+ * callers create a new `<type>:<slug>` location, then select it here. */
7653
+ var StorageMigrationDestinationsSchema = object({
7654
+ recordings: string().min(1).optional(),
7655
+ recordingsLow: string().min(1).optional(),
7656
+ eventMedia: string().min(1).optional()
7657
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
7658
+ /** Shared input for planning and starting an orchestrated storage migration. */
7659
+ var StorageMigrationInputSchema = object({
7660
+ destinations: StorageMigrationDestinationsSchema,
7661
+ throttleMbps: number().min(1).max(1e3).optional()
7662
+ });
7663
+ /** The durable coordinator state machine. The only phase that changes default
7664
+ * locations is `repointing`, after every selected mover has completed and been
7665
+ * verified. */
7666
+ var StorageMigrationPhaseSchema = _enum([
7667
+ "planning",
7668
+ "pausing",
7669
+ "moving",
7670
+ "verifying",
7671
+ "repointing",
7672
+ "refreshing",
7673
+ "resuming",
7674
+ "done",
7675
+ "failed",
7676
+ "cancelled"
7677
+ ]);
7678
+ var StorageMigrationParticipantSchema = _enum([
7679
+ "pipeline",
7680
+ "recorder",
7681
+ "analytics"
7682
+ ]);
7683
+ var StorageMigrationMoveSchema = object({
7684
+ storageClass: StorageMigrationClassSchema,
7685
+ fromLocationId: string(),
7686
+ toLocationId: string(),
7687
+ moverJobId: string().nullable(),
7688
+ state: RelocateJobStateSchema.nullable(),
7689
+ error: string().nullable()
7690
+ });
7691
+ var StorageMigrationJobSchema = object({
7692
+ jobId: string(),
7693
+ phase: StorageMigrationPhaseSchema,
7694
+ destinations: StorageMigrationDestinationsSchema,
7695
+ throttleMbps: number(),
7696
+ moves: array(StorageMigrationMoveSchema),
7697
+ pauseLeaseId: string().nullable(),
7698
+ pausedParticipants: array(StorageMigrationParticipantSchema),
7699
+ repointed: boolean(),
7700
+ cancelRequested: boolean(),
7701
+ startedAt: number(),
7702
+ updatedAt: number(),
7703
+ finishedAt: number().nullable(),
7704
+ error: string().nullable()
7705
+ });
7706
+ var StorageMigrationPlanSchema = object({
7707
+ destinations: StorageMigrationDestinationsSchema,
7708
+ moves: array(object({
7709
+ storageClass: StorageMigrationClassSchema,
7710
+ fromLocationId: string(),
7711
+ toLocationId: string()
7712
+ }))
7593
7713
  });
7594
7714
  /**
7595
7715
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -7641,6 +7761,21 @@ var StorageLocationSchema = object({
7641
7761
  nodeId: string().optional(),
7642
7762
  isDefault: boolean().default(false),
7643
7763
  isSystem: boolean().default(false),
7764
+ /**
7765
+ * Operator opt-in: whether consumers that BALANCE across several locations
7766
+ * of a type may write here. Recordings reads it today; event media and
7767
+ * backups are the next consumers, which is why the flag lives on the
7768
+ * location rather than in any one addon's store — nothing has to be
7769
+ * extended to add the next consumer.
7770
+ *
7771
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7772
+ * flag existed reads back with no flag and keeps working exactly as before;
7773
+ * that is the whole compat story, and it is why no migration ships with it.
7774
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7775
+ * disk must not silently start writing to it); the default of a type is
7776
+ * always stamped `true`.
7777
+ */
7778
+ enabled: boolean().optional(),
7644
7779
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7645
7780
  * for node-local locations it can reach) — never persisted, absent when the
7646
7781
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12193,7 +12328,8 @@ method(object({
12193
12328
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12194
12329
  /**
12195
12330
  * filesystem-browse — per-node capability for browsing the node's local
12196
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12331
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12332
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12197
12333
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12198
12334
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12199
12335
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -14034,6 +14170,13 @@ var MaskGridDimsSchema = object({
14034
14170
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
14035
14171
  * this one field keeps the schema additive — a rule still declares exactly
14036
14172
  * one trigger.
14173
+ *
14174
+ * AUDIO rules add no member here, for the reason occupancy added none: the
14175
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
14176
+ * mirror.ts` fails the build on a member the app cannot render) and every
14177
+ * member costs a release train. A sustained-sound rule is therefore an
14178
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
14179
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
14037
14180
  */
14038
14181
  var NcDeliverySchema = _enum([
14039
14182
  "immediate",
@@ -14048,15 +14191,32 @@ var NcDeliverySchema = _enum([
14048
14191
  * depend on a provider's raw event name or payload shape.
14049
14192
  */
14050
14193
  var NcSystemEventKindSchema = _enum([
14051
- "camera-online",
14052
- "camera-offline",
14194
+ "device-online",
14195
+ "device-offline",
14196
+ "device-disabled",
14197
+ "device-enabled",
14053
14198
  "stream-online",
14054
14199
  "stream-offline",
14055
14200
  "node-online",
14056
14201
  "node-offline",
14057
14202
  "addon-update-available",
14058
- "server-update-available"
14203
+ "server-update-available",
14204
+ "alarm-triggered",
14205
+ "alarm-armed",
14206
+ "alarm-disarmed",
14207
+ "camera-online",
14208
+ "camera-offline",
14209
+ "camera-disabled",
14210
+ "camera-enabled"
14211
+ ]);
14212
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14213
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14214
+ "camera-online",
14215
+ "camera-offline",
14216
+ "camera-disabled",
14217
+ "camera-enabled"
14059
14218
  ]);
14219
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
14060
14220
  /**
14061
14221
  * One coherent system-event condition. `kinds` is the required opt-in safety
14062
14222
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -14065,6 +14225,18 @@ var NcSystemEventKindSchema = _enum([
14065
14225
  var NcSystemEventConditionSchema = object({
14066
14226
  kinds: array(NcSystemEventKindSchema).min(1),
14067
14227
  deviceIds: array(number().int()).min(1).optional(),
14228
+ /**
14229
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14230
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14231
+ * is what a liveness rule means when nobody said otherwise.
14232
+ *
14233
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14234
+ * one reason: the intake cannot know which devices this household cares
14235
+ * about, and a producer-side filter is one no operator can change. Fails
14236
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14237
+ * does not carry) matches no `deviceTypes` list.
14238
+ */
14239
+ deviceTypes: array(string().min(1)).min(1).optional(),
14068
14240
  nodeIds: array(string().min(1)).min(1).optional(),
14069
14241
  packageNames: array(string().min(1)).min(1).optional()
14070
14242
  });
@@ -14115,6 +14287,47 @@ var NcOccupancyConditionSchema = object({
14115
14287
  sustainSeconds: number().int().min(0).max(3600).default(15)
14116
14288
  });
14117
14289
  /**
14290
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14291
+ *
14292
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14293
+ * reference notifier uses, so an operator moving between them re-uses what
14294
+ * they already know): a rule matches when, over a sampling window of
14295
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14296
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14297
+ *
14298
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14299
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14300
+ * - `labels` — the classifier put at least one of these labels on it.
14301
+ *
14302
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14303
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14304
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14305
+ * is given** — a window in which every sample is trivially a hit would fire on
14306
+ * silence, so the engine refuses such a condition rather than notifying on
14307
+ * nothing (the schema cannot express "at least one of" without becoming a
14308
+ * ZodEffects the cap path would have to special-case).
14309
+ *
14310
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14311
+ * must be FULL before it can match — a window that has been open for two
14312
+ * seconds of its ten is 100% of nothing, and firing on it would make
14313
+ * `samplingSeconds` decorative.
14314
+ *
14315
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14316
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14317
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14318
+ * an operator who typed `dog` mean the same thing.
14319
+ */
14320
+ var NcAudioConditionSchema = object({
14321
+ /** Audio macro labels; absent = any sound (level-only rule). */
14322
+ labels: array(string().min(1)).min(1).optional(),
14323
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14324
+ dbThreshold: number().min(-96).max(0).optional(),
14325
+ /** Percentage of the window's samples that must be hits (1–100). */
14326
+ hitPercent: number().int().min(1).max(100).default(60),
14327
+ /** Length of the sampling window in seconds. */
14328
+ samplingSeconds: number().int().min(1).max(300).default(10)
14329
+ });
14330
+ /**
14118
14331
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
14119
14332
  *
14120
14333
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14387,7 +14600,33 @@ var NcConditionsSchema = object({
14387
14600
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14388
14601
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14389
14602
  */
14390
- occupancy: NcOccupancyConditionSchema.optional()
14603
+ occupancy: NcOccupancyConditionSchema.optional(),
14604
+ /**
14605
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14606
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14607
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14608
+ * a window that is not full yet, neither filter given). See
14609
+ * {@link NcAudioCondition}.
14610
+ *
14611
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14612
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14613
+ * a detection, a track or a device event (the same fail-closed pairing
14614
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14615
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14616
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14617
+ * classified sample) stays exactly as it was for rules that already use it.
14618
+ *
14619
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14620
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14621
+ * (`camstack/src/data/notification-center.ts`, guarded by
14622
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14623
+ * condition fields it does not know when a rule is saved from the phone.
14624
+ * Publishing an editor for a condition the app cannot round-trip is how an
14625
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14626
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14627
+ * does an audio rule become authorable.
14628
+ */
14629
+ audio: NcAudioConditionSchema.optional()
14391
14630
  });
14392
14631
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14393
14632
  var NcRuleTargetSchema = object({
@@ -14501,6 +14740,73 @@ var NcThrottleSchema = object({
14501
14740
  */
14502
14741
  granularity: NcThrottleGranularitySchema.optional()
14503
14742
  });
14743
+ /**
14744
+ * How long the confirm gate may hold ONE notification, and how big the picture
14745
+ * it judges may be.
14746
+ *
14747
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14748
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14749
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14750
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14751
+ * tokens for pixels the model pools away.
14752
+ */
14753
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14754
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14755
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14756
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14757
+ var NcConfirmExpectSchema = object({
14758
+ op: _enum([
14759
+ ">=",
14760
+ ">",
14761
+ "<=",
14762
+ "<",
14763
+ "=="
14764
+ ]),
14765
+ count: number().int().min(0).max(1e3)
14766
+ });
14767
+ /**
14768
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14769
+ * to ship and says whether it agrees with the rule.
14770
+ *
14771
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14772
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14773
+ * on the operator's phone is not a verdict about this notification.
14774
+ *
14775
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14776
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14777
+ * the default and every fail-open is COUNTED, because a gate that always fails
14778
+ * open looks in the log exactly like a gate that works.
14779
+ *
14780
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14781
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14782
+ * production failures in one day), so the gate reads absent as the constant
14783
+ * above rather than trusting a parse it may never have seen.
14784
+ */
14785
+ var NcConfirmSchema = object({
14786
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14787
+ * same thing, and both mean "deliver exactly as before". */
14788
+ enabled: boolean().default(false),
14789
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14790
+ profileId: string().optional(),
14791
+ /**
14792
+ * The operator's question, in his own words. Absent = a question derived
14793
+ * from the rule (its class and its expectation).
14794
+ *
14795
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14796
+ * banners, signage and plates as instructions if you let them reach the
14797
+ * prompt — proven live — so the authoritative contract stays in the system
14798
+ * turn and only rule-authored words land here.
14799
+ */
14800
+ prompt: string().max(1e3).optional(),
14801
+ /** Fire only when the model's count satisfies this. Absent = the model's
14802
+ * own boolean verdict decides. */
14803
+ expect: NcConfirmExpectSchema.optional(),
14804
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14805
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14806
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14807
+ /** Longest edge the judged image is downscaled to before it is sent. */
14808
+ maxImagePx: number().int().min(64).max(2048).default(448)
14809
+ });
14504
14810
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14505
14811
  var NcRuleInputSchema = object({
14506
14812
  name: string().min(1).max(200),
@@ -14561,7 +14867,13 @@ var NcRuleInputSchema = object({
14561
14867
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14562
14868
  * shape as every other actuation.
14563
14869
  */
14564
- actions: NcRuleActionsSchema.optional()
14870
+ actions: NcRuleActionsSchema.optional(),
14871
+ /**
14872
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14873
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14874
+ * did, and absent is the only way to say that without a migration.
14875
+ */
14876
+ confirm: NcConfirmSchema.optional()
14565
14877
  });
14566
14878
  /**
14567
14879
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14572,7 +14884,37 @@ var NcRuleInputSchema = object({
14572
14884
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14573
14885
  * `updateRule` patch.
14574
14886
  */
14575
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
14887
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14888
+ disabledTargetIds: array(string()).optional(),
14889
+ /**
14890
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14891
+ *
14892
+ * It makes the key optional to SUPPLY; the parse still materialises the
14893
+ * default when the key is absent. And `NcRuleStore.update` merges with
14894
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14895
+ * one — which made every partial edit destructive:
14896
+ *
14897
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14898
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14899
+ * setEnabled(ruleId, false) → conditions reset to `{}`
14900
+ *
14901
+ * A rule scoped to one camera and one zone silently became a rule that
14902
+ * matches EVERY event on EVERY camera, and lost its `media` policy
14903
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
14904
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
14905
+ * within a minute of a two-field patch.
14906
+ *
14907
+ * So every defaulted field is re-declared here WITHOUT its default. The
14908
+ * inner defaults still apply when the caller DOES send the key — `{}` for
14909
+ * conditions remains a real instruction ("clear them") — and only the
14910
+ * absent key is now genuinely absent.
14911
+ */
14912
+ enabled: boolean().optional(),
14913
+ conditions: NcConditionsSchema.optional(),
14914
+ media: NcMediaPolicySchema.optional(),
14915
+ throttle: NcThrottleSchema.optional(),
14916
+ priority: number().int().min(1).max(5).optional()
14917
+ });
14576
14918
  /** A persisted rule. */
14577
14919
  var NcRuleSchema = NcRuleInputSchema.extend({
14578
14920
  id: string(),
@@ -14873,6 +15215,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14873
15215
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14874
15216
  * copy would lie the first time a rule is disabled.
14875
15217
  */
15218
+ /**
15219
+ * Why a device a mode NAMES is nonetheless not armed by it.
15220
+ *
15221
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15222
+ * per-camera notification switch the Notification Center already owns,
15223
+ * `detection-off` is the device's own detection binding being inactive, and
15224
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15225
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15226
+ * with the switches the operator actually used.
15227
+ */
15228
+ var NcAlarmSkipReasonSchema = _enum([
15229
+ "muted",
15230
+ "detection-off",
15231
+ "offline"
15232
+ ]);
15233
+ var NcAlarmSkippedDeviceSchema = object({
15234
+ deviceId: number().int(),
15235
+ reason: NcAlarmSkipReasonSchema
15236
+ });
14876
15237
  var NcAlarmModeCoverageSchema = object({
14877
15238
  mode: AlarmArmModeSchema,
14878
15239
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14880,7 +15241,18 @@ var NcAlarmModeCoverageSchema = object({
14880
15241
  /** At least one covering rule has no device scope, so the mode covers all. */
14881
15242
  allDevices: boolean(),
14882
15243
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14883
- deviceIds: array(number().int())
15244
+ deviceIds: array(number().int()),
15245
+ /**
15246
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15247
+ * excludes it.
15248
+ *
15249
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15250
+ * twelve makes it false in exactly the way nobody notices until an incident.
15251
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15252
+ * still parses as "nothing known to be skipped" rather than failing the whole
15253
+ * alarm tab.
15254
+ */
15255
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
14884
15256
  });
14885
15257
  var NcAlarmConfigSchema = object({
14886
15258
  /**
@@ -16243,13 +16615,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16243
16615
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16244
16616
  kind: "mutation",
16245
16617
  auth: "admin"
16246
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
16618
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
16247
16619
  kind: "mutation",
16248
16620
  auth: "admin"
16249
- }), method(object({}), array(RelocateJobSchema).readonly(), {
16250
- kind: "query",
16621
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
16622
+ kind: "mutation",
16251
16623
  auth: "admin"
16252
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16624
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
16625
+ kind: "mutation",
16626
+ auth: "admin"
16627
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
16628
+ kind: "mutation",
16629
+ auth: "admin"
16630
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16253
16631
  kind: "mutation",
16254
16632
  auth: "admin"
16255
16633
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -17706,9 +18084,16 @@ var CameraStatusSchema = object({
17706
18084
  audio: CameraAudioStatusSchema.nullable(),
17707
18085
  recording: CameraRecordingStatusSchema.nullable(),
17708
18086
  /**
17709
- * Per-camera function switches an OPERATOR has turned off
18087
+ * Per-camera functions an OPERATOR has turned off
17710
18088
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17711
18089
  *
18090
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
18091
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
18092
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
18093
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
18094
+ * The badge outlives the control panel: the panel was a convenience, this is
18095
+ * the difference between a camera being off and a camera being dead.
18096
+ *
17712
18097
  * This is the difference between DISABLED and BROKEN. A camera whose
17713
18098
  * `detection` block reports zero fps and whose `switchedOff` contains
17714
18099
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -17779,7 +18164,13 @@ var NodeInferenceDevicesSchema = object({
17779
18164
  reachable: boolean(),
17780
18165
  devices: array(NodeInferenceDeviceSchema).readonly()
17781
18166
  });
17782
- method(object({
18167
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
18168
+ kind: "mutation",
18169
+ auth: "admin"
18170
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
18171
+ kind: "mutation",
18172
+ auth: "admin"
18173
+ }), method(object({
17783
18174
  deviceId: number(),
17784
18175
  agentNodeId: string()
17785
18176
  }), object({ success: literal(true) }), {
@@ -18309,24 +18700,28 @@ var snapshotCapability = {
18309
18700
  *
18310
18701
  * `getSnapshotOverview` is cache-only by contract: it answers from whatever
18311
18702
  * the wrapper happens to hold and never captures. Under D93 the client
18312
- * versions its image URL on that answer, and an image REQUEST is what enrols
18313
- * a camera in the keep-warm loop. Both of those are satisfiable by the
18314
- * client's own image cache — `expo-image` is URL-keyed and never revalidates
18315
- * — so a URL painted in a previous session comes off disk with no network,
18316
- * no enrolment, and nothing warming. Measured on the live hub: reopening
18317
- * after two minutes idle painted 15 of 16 tiles at **168 s old** with zero
18318
- * HTTP requests, and the fleet only recovered because a later poll happened
18319
- * to observe a different identity.
18703
+ * versions its image URL on that answer, and an image REQUEST was the only
18704
+ * demand signal. Both of those are satisfiable by the client's own image
18705
+ * cache — `expo-image` is URL-keyed and never revalidates — so a URL painted
18706
+ * in a previous session comes off disk with no network, no demand, and no
18707
+ * capture. Measured on the live hub: reopening after two minutes idle
18708
+ * painted 15 of 16 tiles at **168 s old** with zero HTTP requests, and the
18709
+ * fleet only recovered because a later poll happened to observe a different
18710
+ * identity.
18320
18711
  *
18321
18712
  * ## The two properties that fix it
18322
18713
  *
18323
18714
  * **It is an RPC, so no client cache can answer it.** The demand signal
18324
- * always reaches the wrapper. This method therefore MAY create keep-warm
18325
- * subscriptions, where `getSnapshotOverview` must never (D93) — the
18326
- * distinction is not "one is newer" but that the overview poll is app-wide
18327
- * (a creating overview would warm every camera on the install) while this is
18328
- * called by a rendered surface naming the tiles it is actually painting, at
18329
- * the width it is painting them.
18715
+ * always reaches the wrapper. This method therefore CAPTURES, where
18716
+ * `getSnapshotOverview` must never (D93) — the distinction is not "one is
18717
+ * newer" but that the overview poll is app-wide (a capturing overview would
18718
+ * dial every camera on the install) while this is called by a rendered
18719
+ * surface naming the tiles it is actually painting, at the width it is
18720
+ * painting them.
18721
+ *
18722
+ * Since 2026-08-11 this is the ONLY thing that refreshes a snapshot: the
18723
+ * server-side keep-warm loop was removed (operator directive — on-demand,
18724
+ * always), so a camera nobody is looking at costs nothing at all.
18330
18725
  *
18331
18726
  * **It waits, briefly and boundedly, for the capture it triggered.** The
18332
18727
  * returned `capturedAt` is the frame the link will serve, not the frame the
@@ -18544,6 +18939,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
18544
18939
  locationId: string(),
18545
18940
  targetBytes: number().int().positive()
18546
18941
  }), EvictResultSchema, { kind: "mutation" });
18942
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
18943
+ kind: "mutation",
18944
+ auth: "admin"
18945
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
18946
+ kind: "mutation",
18947
+ auth: "admin"
18948
+ });
18547
18949
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
18548
18950
  providerId: string().min(1),
18549
18951
  displayName: string().min(1),
@@ -18647,6 +19049,28 @@ var TerminalProfileInfoSchema = object({
18647
19049
  label: string(),
18648
19050
  description: string().optional()
18649
19051
  });
19052
+ /**
19053
+ * A durable operator-created Terminal instance. Profiles are templates; only
19054
+ * an instance declares a camera.
19055
+ */
19056
+ var TerminalInstanceInfoSchema = object({
19057
+ instanceId: string(),
19058
+ cameraStableId: string(),
19059
+ nodeId: string(),
19060
+ profileId: string(),
19061
+ profileLabel: string(),
19062
+ name: string(),
19063
+ enabled: boolean()
19064
+ });
19065
+ var TerminalLegacyCameraSchema = object({
19066
+ stableId: string(),
19067
+ nodeId: string(),
19068
+ profileId: string(),
19069
+ profileLabel: string(),
19070
+ name: string(),
19071
+ /** Only legacy monitor cameras can retain their historic stable identity. */
19072
+ adoptable: boolean()
19073
+ });
18650
19074
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
18651
19075
  seq: number().int().positive(),
18652
19076
  kind: literal("data"),
@@ -18663,7 +19087,29 @@ var TerminalOutputBatchSchema = object({
18663
19087
  snapshot: string().optional(),
18664
19088
  events: array(TerminalOutputEventSchema).readonly()
18665
19089
  });
18666
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
19090
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
19091
+ targetNodeId: string().min(1),
19092
+ profileId: string().min(1),
19093
+ name: string().trim().min(1).max(160).optional()
19094
+ }), TerminalInstanceInfoSchema, {
19095
+ kind: "mutation",
19096
+ auth: "admin"
19097
+ }), method(object({ instanceId: string().min(1) }), _void(), {
19098
+ kind: "mutation",
19099
+ auth: "admin"
19100
+ }), method(object({
19101
+ instanceId: string().min(1),
19102
+ enabled: boolean()
19103
+ }), TerminalInstanceInfoSchema, {
19104
+ kind: "mutation",
19105
+ auth: "admin"
19106
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
19107
+ stableId: string().min(1),
19108
+ name: string().trim().min(1).max(160).optional()
19109
+ }), TerminalInstanceInfoSchema, {
19110
+ kind: "mutation",
19111
+ auth: "admin"
19112
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18667
19113
  profileId: string(),
18668
19114
  cols: number().int().positive(),
18669
19115
  rows: number().int().positive()
@@ -18680,7 +19126,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
18680
19126
  }), method(object({
18681
19127
  sessionId: string(),
18682
19128
  afterSeq: number().int().nonnegative(),
18683
- waitMs: number().int().min(0).max(2e3).default(0)
19129
+ waitMs: number().int().min(0).max(2e3).default(0),
19130
+ /**
19131
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
19132
+ * browser's initial repaint remains immediate; the camera snapshot
19133
+ * relay uses it to avoid encoding a blank startup frame.
19134
+ */
19135
+ waitForOutput: boolean().optional()
18684
19136
  }), TerminalOutputBatchSchema, {
18685
19137
  kind: "mutation",
18686
19138
  auth: "admin",
@@ -21178,6 +21630,7 @@ var FaceInfoSchema = object({
21178
21630
  var FaceFilterEnum = _enum([
21179
21631
  "unassigned",
21180
21632
  "recognized",
21633
+ "identified",
21181
21634
  "all"
21182
21635
  ]);
21183
21636
  var MediaFileLiteSchema$1 = object({
@@ -21206,6 +21659,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string(
21206
21659
  kind: "mutation",
21207
21660
  auth: "admin"
21208
21661
  }), method(object({
21662
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
21663
+ deviceId: number().int().optional(),
21209
21664
  limit: number().int().positive().optional(),
21210
21665
  filter: FaceFilterEnum.optional(),
21211
21666
  /**
@@ -23481,6 +23936,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
23481
23936
  capName: string().min(1).max(64),
23482
23937
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
23483
23938
  valuePath: string().min(1).max(64)
23939
+ }),
23940
+ object({
23941
+ kind: literal("latest-recognition"),
23942
+ recognition: _enum(["person", "plate"])
23484
23943
  })
23485
23944
  ]);
23486
23945
  var OsdSlotBindingSchema = object({
@@ -23586,6 +24045,15 @@ method(object({ deviceId: number().int() }), object({
23586
24045
  }), object({ success: literal(true) }), {
23587
24046
  kind: "mutation",
23588
24047
  auth: "admin"
24048
+ }), method(object({
24049
+ sourceDeviceId: number().int(),
24050
+ targetDeviceId: number().int()
24051
+ }), object({
24052
+ copied: number().int().nonnegative(),
24053
+ skipped: number().int().nonnegative()
24054
+ }), {
24055
+ kind: "mutation",
24056
+ auth: "admin"
23589
24057
  }), method(object({
23590
24058
  deviceId: number().int(),
23591
24059
  slotId: string().min(1),
@@ -24550,7 +25018,19 @@ var RecordingManifestSchema = object({
24550
25018
  * profiles/subtrees/locations on this node). */
24551
25019
  var RecordingDeviceUsageSchema = object({
24552
25020
  deviceId: number(),
24553
- usedBytes: number()
25021
+ usedBytes: number(),
25022
+ /**
25023
+ * Start of this camera's OLDEST indexed segment, across every profile and
25024
+ * location — the "Oldest footage" column in Recordings → Storage, and the
25025
+ * only honest answer to "is retention actually holding?" per camera.
25026
+ *
25027
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
25028
+ * predates this field omits it entirely, and a hub whose types carry the
25029
+ * field must keep validating that older provider's payload: the framework
25030
+ * (types) and the addon ship on different trains, and the addon is usually
25031
+ * the later of the two.
25032
+ */
25033
+ oldestMs: number().nullable().optional()
24554
25034
  });
24555
25035
  /** Recording storage usage + capacity for one storage location. */
24556
25036
  var RecordingLocationUsageSchema = object({
@@ -24578,6 +25058,57 @@ var RecordingStorageUsageSchema = object({
24578
25058
  locations: array(RecordingLocationUsageSchema)
24579
25059
  });
24580
25060
  /**
25061
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
25062
+ *
25063
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
25064
+ * is the operator asking for the EXISTING archive to be brought into line with
25065
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
25066
+ * location, run FIFO behind the single-flight mover.
25067
+ *
25068
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
25069
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
25070
+ * (empty on the plan).
25071
+ */
25072
+ var RecordingRebalanceMoveSchema = object({
25073
+ deviceId: number(),
25074
+ profile: string(),
25075
+ fromLocationId: string(),
25076
+ toLocationId: string(),
25077
+ bytes: number(),
25078
+ files: number().int()
25079
+ });
25080
+ /** Why a pile that is out of place is staying there. Every refusal is
25081
+ * reported: a rebalance that silently drops a camera reads exactly like one
25082
+ * that had nothing to do. */
25083
+ var RecordingRebalanceSkipReasonSchema = _enum([
25084
+ "unassigned",
25085
+ "target-not-writable",
25086
+ "below-threshold",
25087
+ "no-headroom"
25088
+ ]);
25089
+ var RecordingRebalanceSkipSchema = object({
25090
+ deviceId: number(),
25091
+ profile: string(),
25092
+ fromLocationId: string(),
25093
+ /** The location the plan wants; null when the camera has no assignment. */
25094
+ toLocationId: string().nullable(),
25095
+ bytes: number(),
25096
+ reason: RecordingRebalanceSkipReasonSchema
25097
+ });
25098
+ var RecordingRebalancePlanSchema = object({
25099
+ moves: array(RecordingRebalanceMoveSchema),
25100
+ skipped: array(RecordingRebalanceSkipSchema),
25101
+ bytesToMove: number(),
25102
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
25103
+ jobIds: array(string())
25104
+ });
25105
+ var RecordingRebalanceInputSchema = object({
25106
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
25107
+ throttleMbps: number().min(1).max(1e3).optional(),
25108
+ /** Ignore piles smaller than this (default 1 GB). */
25109
+ minMoveGb: number().min(0).optional()
25110
+ });
25111
+ /**
24581
25112
  * Result of locating footage at a wall-clock instant for one device/profile.
24582
25113
  * `segment` carries the covering segment's window; `gap` reports the forward
24583
25114
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -24725,6 +25256,21 @@ method(object({
24725
25256
  }), {
24726
25257
  kind: "mutation",
24727
25258
  auth: "admin"
25259
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
25260
+ kind: "mutation",
25261
+ auth: "admin"
25262
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
25263
+ kind: "mutation",
25264
+ auth: "admin"
25265
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
25266
+ kind: "mutation",
25267
+ auth: "admin"
25268
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
25269
+ kind: "mutation",
25270
+ auth: "admin"
25271
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
25272
+ kind: "mutation",
25273
+ auth: "admin"
24728
25274
  }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24729
25275
  kind: "mutation",
24730
25276
  auth: "admin"
@@ -24734,9 +25280,15 @@ method(object({
24734
25280
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24735
25281
  kind: "mutation",
24736
25282
  auth: "admin"
25283
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25284
+ kind: "query",
25285
+ auth: "admin"
25286
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25287
+ kind: "mutation",
25288
+ auth: "admin"
24737
25289
  });
24738
25290
  /**
24739
- * `recordingExport` cap — render a footage time range into a single downloadable
25291
+ * `recording-export` cap — render a footage time range into a single downloadable
24740
25292
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
24741
25293
  * bounded lifetime with a durable history, auto-expiry, and optional
24742
25294
  * delete-after-download.
@@ -24751,10 +25303,42 @@ method(object({
24751
25303
  */
24752
25304
  /** Playback-speed multiplier for the render (1 = realtime). */
24753
25305
  var ExportSpeedSchema = number().min(.25).max(32);
25306
+ /**
25307
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25308
+ *
25309
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
25310
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25311
+ * playlist. Handing it absolute epochs would make every call site responsible
25312
+ * for the same subtraction, and the one that forgot would emit a filter that
25313
+ * selects nothing — silently, as a uniform timelapse.
25314
+ */
25315
+ var ExportDenseRangeSchema = object({
25316
+ fromSec: number().nonnegative(),
25317
+ toSec: number().nonnegative()
25318
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
25319
+ /**
25320
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
25321
+ * listed ranges and at the base `everyMs` everywhere else.
25322
+ *
25323
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
25324
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
25325
+ */
25326
+ var ExportDenseSchema = object({
25327
+ everyMs: number().int().positive(),
25328
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
25329
+ });
24754
25330
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
24755
25331
  var ExportTimelapseSchema = object({
24756
25332
  everyMs: number().int().positive(),
24757
- outputFps: number().int().min(1).max(60).optional()
25333
+ outputFps: number().int().min(1).max(60).optional(),
25334
+ /** Optional second, FASTER rate over the intervals that matter. */
25335
+ dense: ExportDenseSchema.optional()
25336
+ }).superRefine((v, ctx) => {
25337
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
25338
+ code: ZodIssueCode.custom,
25339
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
25340
+ path: ["dense", "everyMs"]
25341
+ });
24758
25342
  });
24759
25343
  /**
24760
25344
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -24812,6 +25396,19 @@ var ExportDownloadSchema = object({
24812
25396
  url: string(),
24813
25397
  endpoints: array(string())
24814
25398
  });
25399
+ /**
25400
+ * A finished export's bytes, inline.
25401
+ *
25402
+ * `bytes` is the DECODED length — the number the caller bounds and logs
25403
+ * against, so nobody has to infer it from the base64 length.
25404
+ */
25405
+ var ExportBytesSchema = object({
25406
+ base64: string(),
25407
+ contentType: string(),
25408
+ /** Suggested filename, extension included. */
25409
+ name: string(),
25410
+ bytes: number().int().nonnegative()
25411
+ });
24815
25412
  method(object({
24816
25413
  deviceId: number(),
24817
25414
  profile: string(),
@@ -24836,6 +25433,9 @@ method(object({
24836
25433
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
24837
25434
  kind: "query",
24838
25435
  auth: "protected"
25436
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
25437
+ kind: "query",
25438
+ auth: "protected"
24839
25439
  });
24840
25440
  /**
24841
25441
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -30679,6 +31279,12 @@ Object.freeze({
30679
31279
  addonId: null,
30680
31280
  access: "delete"
30681
31281
  },
31282
+ "osdManager.copyDeviceConfiguration": {
31283
+ capName: "osd-manager",
31284
+ capScope: "system",
31285
+ addonId: null,
31286
+ access: "create"
31287
+ },
30682
31288
  "osdManager.getConditionSupport": {
30683
31289
  capName: "osd-manager",
30684
31290
  capScope: "system",
@@ -30775,7 +31381,7 @@ Object.freeze({
30775
31381
  addonId: null,
30776
31382
  access: "create"
30777
31383
  },
30778
- "pipelineAnalytics.cancelMediaRelocate": {
31384
+ "pipelineAnalytics.cancelStorageMigrationMove": {
30779
31385
  capName: "pipeline-analytics",
30780
31386
  capScope: "device",
30781
31387
  addonId: null,
@@ -30847,12 +31453,6 @@ Object.freeze({
30847
31453
  addonId: null,
30848
31454
  access: "view"
30849
31455
  },
30850
- "pipelineAnalytics.getMediaRelocateStatus": {
30851
- capName: "pipeline-analytics",
30852
- capScope: "device",
30853
- addonId: null,
30854
- access: "view"
30855
- },
30856
31456
  "pipelineAnalytics.getMotionEvents": {
30857
31457
  capName: "pipeline-analytics",
30858
31458
  capScope: "device",
@@ -30889,6 +31489,12 @@ Object.freeze({
30889
31489
  addonId: null,
30890
31490
  access: "view"
30891
31491
  },
31492
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
31493
+ capName: "pipeline-analytics",
31494
+ capScope: "device",
31495
+ addonId: null,
31496
+ access: "view"
31497
+ },
30892
31498
  "pipelineAnalytics.getTrack": {
30893
31499
  capName: "pipeline-analytics",
30894
31500
  capScope: "device",
@@ -30967,6 +31573,12 @@ Object.freeze({
30967
31573
  addonId: null,
30968
31574
  access: "view"
30969
31575
  },
31576
+ "pipelineAnalytics.pauseForStorageMigration": {
31577
+ capName: "pipeline-analytics",
31578
+ capScope: "device",
31579
+ addonId: null,
31580
+ access: "create"
31581
+ },
30970
31582
  "pipelineAnalytics.proposeRetrainAnnotations": {
30971
31583
  capName: "pipeline-analytics",
30972
31584
  capScope: "device",
@@ -30997,7 +31609,7 @@ Object.freeze({
30997
31609
  addonId: null,
30998
31610
  access: "create"
30999
31611
  },
31000
- "pipelineAnalytics.relocateMedia": {
31612
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
31001
31613
  capName: "pipeline-analytics",
31002
31614
  capScope: "device",
31003
31615
  addonId: null,
@@ -31009,6 +31621,12 @@ Object.freeze({
31009
31621
  addonId: null,
31010
31622
  access: "create"
31011
31623
  },
31624
+ "pipelineAnalytics.resumeForStorageMigration": {
31625
+ capName: "pipeline-analytics",
31626
+ capScope: "device",
31627
+ addonId: null,
31628
+ access: "create"
31629
+ },
31012
31630
  "pipelineAnalytics.saveRetrainAnnotations": {
31013
31631
  capName: "pipeline-analytics",
31014
31632
  capScope: "device",
@@ -31033,6 +31651,12 @@ Object.freeze({
31033
31651
  addonId: null,
31034
31652
  access: "create"
31035
31653
  },
31654
+ "pipelineAnalytics.startStorageMigrationMove": {
31655
+ capName: "pipeline-analytics",
31656
+ capScope: "device",
31657
+ addonId: null,
31658
+ access: "create"
31659
+ },
31036
31660
  "pipelineAnalytics.wipeAllAnalytics": {
31037
31661
  capName: "pipeline-analytics",
31038
31662
  capScope: "device",
@@ -31399,6 +32023,12 @@ Object.freeze({
31399
32023
  addonId: null,
31400
32024
  access: "view"
31401
32025
  },
32026
+ "pipelineOrchestrator.pauseForStorageMigration": {
32027
+ capName: "pipeline-orchestrator",
32028
+ capScope: "system",
32029
+ addonId: null,
32030
+ access: "create"
32031
+ },
31402
32032
  "pipelineOrchestrator.rebalance": {
31403
32033
  capName: "pipeline-orchestrator",
31404
32034
  capScope: "system",
@@ -31423,6 +32053,12 @@ Object.freeze({
31423
32053
  addonId: null,
31424
32054
  access: "view"
31425
32055
  },
32056
+ "pipelineOrchestrator.resumeForStorageMigration": {
32057
+ capName: "pipeline-orchestrator",
32058
+ capScope: "system",
32059
+ addonId: null,
32060
+ access: "create"
32061
+ },
31426
32062
  "pipelineOrchestrator.saveTemplate": {
31427
32063
  capName: "pipeline-orchestrator",
31428
32064
  capScope: "system",
@@ -31819,7 +32455,13 @@ Object.freeze({
31819
32455
  addonId: null,
31820
32456
  access: "create"
31821
32457
  },
31822
- "recording.cancelRelocate": {
32458
+ "recording.cancelRelocateJob": {
32459
+ capName: "recording",
32460
+ capScope: "system",
32461
+ addonId: null,
32462
+ access: "create"
32463
+ },
32464
+ "recording.cancelStorageMigrationMove": {
31823
32465
  capName: "recording",
31824
32466
  capScope: "system",
31825
32467
  addonId: null,
@@ -31855,7 +32497,7 @@ Object.freeze({
31855
32497
  addonId: null,
31856
32498
  access: "view"
31857
32499
  },
31858
- "recording.getRelocateStatus": {
32500
+ "recording.getStorageMigrationMoveStatus": {
31859
32501
  capName: "recording",
31860
32502
  capScope: "system",
31861
32503
  addonId: null,
@@ -31873,12 +32515,30 @@ Object.freeze({
31873
32515
  addonId: null,
31874
32516
  access: "view"
31875
32517
  },
32518
+ "recording.listRelocateJobs": {
32519
+ capName: "recording",
32520
+ capScope: "system",
32521
+ addonId: null,
32522
+ access: "view"
32523
+ },
31876
32524
  "recording.locateSegment": {
31877
32525
  capName: "recording",
31878
32526
  capScope: "system",
31879
32527
  addonId: null,
31880
32528
  access: "view"
31881
32529
  },
32530
+ "recording.pauseForStorageMigration": {
32531
+ capName: "recording",
32532
+ capScope: "system",
32533
+ addonId: null,
32534
+ access: "create"
32535
+ },
32536
+ "recording.planStorageRebalance": {
32537
+ capName: "recording",
32538
+ capScope: "system",
32539
+ addonId: null,
32540
+ access: "view"
32541
+ },
31882
32542
  "recording.pruneFootage": {
31883
32543
  capName: "recording",
31884
32544
  capScope: "system",
@@ -31897,6 +32557,12 @@ Object.freeze({
31897
32557
  addonId: null,
31898
32558
  access: "view"
31899
32559
  },
32560
+ "recording.refreshStorageLocationsForMigration": {
32561
+ capName: "recording",
32562
+ capScope: "system",
32563
+ addonId: null,
32564
+ access: "create"
32565
+ },
31900
32566
  "recording.relocateFootage": {
31901
32567
  capName: "recording",
31902
32568
  capScope: "system",
@@ -31921,44 +32587,68 @@ Object.freeze({
31921
32587
  addonId: null,
31922
32588
  access: "create"
31923
32589
  },
32590
+ "recording.resumeForStorageMigration": {
32591
+ capName: "recording",
32592
+ capScope: "system",
32593
+ addonId: null,
32594
+ access: "create"
32595
+ },
31924
32596
  "recording.setDeviceConfig": {
31925
32597
  capName: "recording",
31926
32598
  capScope: "system",
31927
32599
  addonId: null,
31928
32600
  access: "create"
31929
32601
  },
32602
+ "recording.startStorageMigrationMove": {
32603
+ capName: "recording",
32604
+ capScope: "system",
32605
+ addonId: null,
32606
+ access: "create"
32607
+ },
32608
+ "recording.startStorageRebalance": {
32609
+ capName: "recording",
32610
+ capScope: "system",
32611
+ addonId: null,
32612
+ access: "create"
32613
+ },
31930
32614
  "recordingExport.cancelExport": {
31931
- capName: "recordingExport",
32615
+ capName: "recording-export",
31932
32616
  capScope: "system",
31933
32617
  addonId: null,
31934
32618
  access: "create"
31935
32619
  },
31936
32620
  "recordingExport.createExport": {
31937
- capName: "recordingExport",
32621
+ capName: "recording-export",
31938
32622
  capScope: "system",
31939
32623
  addonId: null,
31940
32624
  access: "create"
31941
32625
  },
31942
32626
  "recordingExport.deleteExport": {
31943
- capName: "recordingExport",
32627
+ capName: "recording-export",
31944
32628
  capScope: "system",
31945
32629
  addonId: null,
31946
32630
  access: "delete"
31947
32631
  },
31948
32632
  "recordingExport.getDownloadUrl": {
31949
- capName: "recordingExport",
32633
+ capName: "recording-export",
31950
32634
  capScope: "system",
31951
32635
  addonId: null,
31952
32636
  access: "view"
31953
32637
  },
31954
32638
  "recordingExport.getExport": {
31955
- capName: "recordingExport",
32639
+ capName: "recording-export",
31956
32640
  capScope: "system",
31957
32641
  addonId: null,
31958
32642
  access: "view"
31959
32643
  },
31960
32644
  "recordingExport.listExports": {
31961
- capName: "recordingExport",
32645
+ capName: "recording-export",
32646
+ capScope: "system",
32647
+ addonId: null,
32648
+ access: "view"
32649
+ },
32650
+ "recordingExport.readExportBytes": {
32651
+ capName: "recording-export",
31962
32652
  capScope: "system",
31963
32653
  addonId: null,
31964
32654
  access: "view"
@@ -32317,6 +33007,30 @@ Object.freeze({
32317
33007
  addonId: null,
32318
33008
  access: "view"
32319
33009
  },
33010
+ "storageMigration.cancel": {
33011
+ capName: "storage-migration",
33012
+ capScope: "system",
33013
+ addonId: null,
33014
+ access: "create"
33015
+ },
33016
+ "storageMigration.plan": {
33017
+ capName: "storage-migration",
33018
+ capScope: "system",
33019
+ addonId: null,
33020
+ access: "view"
33021
+ },
33022
+ "storageMigration.start": {
33023
+ capName: "storage-migration",
33024
+ capScope: "system",
33025
+ addonId: null,
33026
+ access: "create"
33027
+ },
33028
+ "storageMigration.status": {
33029
+ capName: "storage-migration",
33030
+ capScope: "system",
33031
+ addonId: null,
33032
+ access: "view"
33033
+ },
32320
33034
  "storageProvider.abortUpload": {
32321
33035
  capName: "storage-provider",
32322
33036
  capScope: "system",
@@ -32695,12 +33409,42 @@ Object.freeze({
32695
33409
  addonId: null,
32696
33410
  access: "create"
32697
33411
  },
33412
+ "terminalSession.adoptLegacyMonitor": {
33413
+ capName: "terminal-session",
33414
+ capScope: "system",
33415
+ addonId: null,
33416
+ access: "create"
33417
+ },
32698
33418
  "terminalSession.close": {
32699
33419
  capName: "terminal-session",
32700
33420
  capScope: "system",
32701
33421
  addonId: null,
32702
33422
  access: "create"
32703
33423
  },
33424
+ "terminalSession.createInstance": {
33425
+ capName: "terminal-session",
33426
+ capScope: "system",
33427
+ addonId: null,
33428
+ access: "create"
33429
+ },
33430
+ "terminalSession.deleteInstance": {
33431
+ capName: "terminal-session",
33432
+ capScope: "system",
33433
+ addonId: null,
33434
+ access: "delete"
33435
+ },
33436
+ "terminalSession.listInstances": {
33437
+ capName: "terminal-session",
33438
+ capScope: "system",
33439
+ addonId: null,
33440
+ access: "view"
33441
+ },
33442
+ "terminalSession.listLegacyCameras": {
33443
+ capName: "terminal-session",
33444
+ capScope: "system",
33445
+ addonId: null,
33446
+ access: "view"
33447
+ },
32704
33448
  "terminalSession.listProfiles": {
32705
33449
  capName: "terminal-session",
32706
33450
  capScope: "system",
@@ -32731,6 +33475,12 @@ Object.freeze({
32731
33475
  addonId: null,
32732
33476
  access: "create"
32733
33477
  },
33478
+ "terminalSession.setInstanceEnabled": {
33479
+ capName: "terminal-session",
33480
+ capScope: "system",
33481
+ addonId: null,
33482
+ access: "create"
33483
+ },
32734
33484
  "terminalSession.writeInput": {
32735
33485
  capName: "terminal-session",
32736
33486
  capScope: "system",
@@ -33275,6 +34025,104 @@ var FramerateField = number().int().min(1).max(60);
33275
34025
  var TargetsField = array(NcRuleTargetSchema).min(1);
33276
34026
  var PriorityField = number().int().min(1).max(5);
33277
34027
  /**
34028
+ * Explicit override of the DENSE sampling cadence, seconds.
34029
+ *
34030
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
34031
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
34032
+ * made that same base 3 s and rendered a person pass as two frames.)
34033
+ *
34034
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
34035
+ * `denseCadenceSec` and played at `framerate` occupies
34036
+ *
34037
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
34038
+ *
34039
+ * 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.
34040
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
34041
+ * and therefore the length of a quiet night, does not move.
34042
+ *
34043
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
34044
+ * the recording has them returns the same frames, requested twice. Must be
34045
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
34046
+ * a uniform video the operator believes is two-rate — and upsert refuses it
34047
+ * rather than letting the export cap reject the render hours after the window.
34048
+ */
34049
+ var DenseCadenceSecField = number().min(.1).max(3600);
34050
+ /**
34051
+ * Minimum seconds of OUTPUT video each detection range must occupy.
34052
+ *
34053
+ * The operator-facing form of the arithmetic above: instead of solving for a
34054
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
34055
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
34056
+ * that range every ~583 ms.
34057
+ *
34058
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
34059
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
34060
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
34061
+ * ranges are sampled denser than they need. Per-range cadences require a cap
34062
+ * schema change and are the tracked follow-up.
34063
+ *
34064
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
34065
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
34066
+ * by real footage, never met by duplicating frames into motion that never
34067
+ * happened.
34068
+ */
34069
+ var MinDwellSecField = number().min(0).max(60);
34070
+ /**
34071
+ * Caption burned into the notification's preview frame.
34072
+ *
34073
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
34074
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
34075
+ * templating dialect for one field would be a second thing to explain.
34076
+ *
34077
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
34078
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
34079
+ * the reason this is not `.min(1)`.
34080
+ */
34081
+ var PreviewTextField = string().max(200);
34082
+ /**
34083
+ * Whether the notification's preview is a STILL or a short animation.
34084
+ *
34085
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
34086
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
34087
+ * night reads better as three seconds of motion than as one frame of it. Both
34088
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
34089
+ * simply applies it to a dozen frames sampled across the render and assembles
34090
+ * them.
34091
+ *
34092
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
34093
+ * seeks and a palette pass, and no rule that never asked for one should start
34094
+ * paying that on the deploy that shipped it.
34095
+ *
34096
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
34097
+ */
34098
+ var PreviewModeField = _enum(["image", "gif"]);
34099
+ /**
34100
+ * Which detection classes the notification reports counts for.
34101
+ *
34102
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
34103
+ * plan — no second query — aggregated per class. Absent or empty means "every
34104
+ * class the window actually contained", which is what an operator who never
34105
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
34106
+ * counts cars all night).
34107
+ *
34108
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
34109
+ * …). An unknown name simply never matches and reports nothing — it is not an
34110
+ * error, because a rule may legitimately name a class this camera's model does
34111
+ * not emit.
34112
+ *
34113
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
34114
+ * - `{{detections}}` — total over the reported classes
34115
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
34116
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
34117
+ * one per class, `count_` + the class name
34118
+ *
34119
+ * With NO custom body template the summary is appended to the derived body, and
34120
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
34121
+ * reads. With a custom template the operator owns every word — nothing is
34122
+ * appended, so `{{detectionSummary}}` is how he asks for it.
34123
+ */
34124
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
34125
+ /**
33278
34126
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
33279
34127
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
33280
34128
  * here (see the ownership note above).
@@ -33294,9 +34142,30 @@ var TimelapseRuleInputSchema = object({
33294
34142
  cadenceSec: CadenceSecField.default(15),
33295
34143
  /** Output frames per second of the assembled mp4 (predecessor parity). */
33296
34144
  framerate: FramerateField.default(10),
34145
+ /**
34146
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
34147
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
34148
+ * field gets.
34149
+ */
34150
+ denseCadenceSec: DenseCadenceSecField.optional(),
34151
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
34152
+ minDwellSec: MinDwellSecField.optional(),
33297
34153
  /** `notification-output` targets the finished video/thumbnail is sent to. */
33298
34154
  targets: TargetsField,
33299
34155
  template: TimelapseTemplateSchema.optional(),
34156
+ /**
34157
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
34158
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
34159
+ *
34160
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
34161
+ * the notification's title/body, and clearing it (`template: null`) must not
34162
+ * silently clear the caption too.
34163
+ */
34164
+ previewText: PreviewTextField.optional(),
34165
+ /** Still or animation — see {@link PreviewModeField}. */
34166
+ previewMode: PreviewModeField.default("image"),
34167
+ /** Classes the notification counts — see {@link ReportClassesField}. */
34168
+ reportClasses: ReportClassesField.optional(),
33300
34169
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
33301
34170
  priority: PriorityField.default(3)
33302
34171
  });
@@ -33307,8 +34176,13 @@ object({
33307
34176
  schedule: NcScheduleSchema.optional(),
33308
34177
  cadenceSec: CadenceSecField.optional(),
33309
34178
  framerate: FramerateField.optional(),
34179
+ denseCadenceSec: DenseCadenceSecField.optional(),
34180
+ minDwellSec: MinDwellSecField.optional(),
33310
34181
  targets: TargetsField.optional(),
33311
34182
  template: TimelapseTemplateSchema.nullable().optional(),
34183
+ previewText: PreviewTextField.optional(),
34184
+ previewMode: PreviewModeField.optional(),
34185
+ reportClasses: ReportClassesField.optional(),
33312
34186
  priority: PriorityField.optional()
33313
34187
  });
33314
34188
  TimelapseRuleInputSchema.extend({
@@ -33320,10 +34194,28 @@ TimelapseRuleInputSchema.extend({
33320
34194
  */
33321
34195
  ownerUserId: string().optional(),
33322
34196
  /**
33323
- * Epoch-ms of the last successful generation the 1-hour re-generation
33324
- * guard's durable state (predecessor parity). Absent = never generated.
34197
+ * Epoch-ms of the NEWEST successful generation across every camera of this
34198
+ * rule. What a UI shows, and the compatibility floor for
34199
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
33325
34200
  */
33326
34201
  lastGeneratedAt: number().optional(),
34202
+ /**
34203
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
34204
+ * re-generation guard's real durable state.
34205
+ *
34206
+ * One rule covers several cameras and each renders its own video, so a rule
34207
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
34208
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
34209
+ * already done — and B's night is gone for good, because the window will not
34210
+ * come back.
34211
+ *
34212
+ * ADDITIVE, so the migration is free: a row written before this field simply
34213
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
34214
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
34215
+ * "never generated" would re-render and re-notify every camera of every rule
34216
+ * once, on the deploy that shipped the map.
34217
+ */
34218
+ generatedByDevice: record(string(), number()).optional(),
33327
34219
  /** userId of the caller who created the rule (server-stamped). */
33328
34220
  createdBy: string(),
33329
34221
  createdAt: number(),