@camstack/addon-provider-hikvision 1.2.15 → 1.2.17

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.js CHANGED
@@ -7200,8 +7200,31 @@ var AdoptionJobSchema = object({
7200
7200
  error: string().nullable()
7201
7201
  });
7202
7202
  /**
7203
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7204
- * pipeline functions an operator thinks in terms of.
7203
+ * Per-camera FUNCTION SWITCHES.
7204
+ *
7205
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7206
+ *
7207
+ * This file shipped as "the one coherent on/off surface over the pipeline
7208
+ * functions an operator thinks in terms of". The operator's verdict on
7209
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7210
+ * every function already had a settings page of its own, and a second place to
7211
+ * turn it off is a second place to look. Each switch is going back to its own
7212
+ * component's original options — detection to the detection-pipeline wrapper
7213
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7214
+ * (which was always first-class; the switch was a veneer over
7215
+ * `recording.setDeviceConfig`), notifications to a notification-center
7216
+ * per-device setting, the two camera planes to their own components.
7217
+ *
7218
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7219
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7220
+ * straight from the authorities with no group in the middle. That rule was
7221
+ * never about a control panel.
7222
+ *
7223
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7224
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7225
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7226
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7227
+ * stop; nothing new may be built on it.
7205
7228
  *
7206
7229
  * ## This file adds no state
7207
7230
  *
@@ -7546,14 +7569,21 @@ var RecordingConfigSchema = object({
7546
7569
  /**
7547
7570
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
7548
7571
  *
7549
- * One shape shared by the recorder's `relocateFootage` (segments) and
7550
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7551
- * page renders both movers with one component. Jobs are in-RAM (a restart
7552
- * forgets them re-running is safe by construction: copy-if-absent, delete
7553
- * after verify) and each completed/failed run also lands one durable ops-log
7554
- * row on the owning addon's surface.
7572
+ * One shape shared by the recorder and pipeline-analytics internal movers.
7573
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
7574
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
7575
+ * Each completed/failed run also lands one durable ops-log row on its owning
7576
+ * addon surface.
7577
+ */
7578
+ /**
7579
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7580
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7581
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7582
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7583
+ * runs at all.
7555
7584
  */
7556
7585
  var RelocateJobStateSchema = _enum([
7586
+ "queued",
7557
7587
  "running",
7558
7588
  "done",
7559
7589
  "failed",
@@ -7578,19 +7608,109 @@ var RelocateJobSchema = object({
7578
7608
  finishedAt: number().nullable(),
7579
7609
  error: string().nullable()
7580
7610
  });
7611
+ /** Profile-derived footage selection used only by the migration coordinator:
7612
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
7613
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
7581
7614
  var RelocateFootageInputSchema = object({
7582
- deviceId: number().optional(),
7583
7615
  fromLocationId: string(),
7584
7616
  toLocationId: string(),
7585
7617
  entities: array(_enum(["segments"])).optional(),
7618
+ /** Limits relocation to the logical profile class. Omit only for the
7619
+ * pre-orchestration compatibility path. */
7620
+ footageClass: RelocateFootageClassSchema.optional(),
7621
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7622
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7623
+ * unit is a (camera, profile) pile, not a disk. */
7624
+ deviceId: number().int().optional(),
7625
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7626
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7627
+ * placement plan assigns those two independently, so a rebalance that could
7628
+ * only say "recordings" would move footage the plan never asked to move. */
7629
+ profiles: array(string()).optional(),
7586
7630
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7587
7631
  * never allowed to starve live writers. */
7588
7632
  throttleMbps: number().min(1).max(1e3).optional()
7589
7633
  });
7590
- var RelocateMediaInputSchema = object({
7591
- deviceId: number().optional(),
7634
+ /** Internal, lease-scoped participant operation. It is intentionally separate
7635
+ * from persistent recording settings: a migration never changes
7636
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
7637
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
7638
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
7639
+ var StorageMigrationMediaMoveInputSchema = object({
7592
7640
  toLocationId: string(),
7593
7641
  throttleMbps: number().min(1).max(1e3).optional()
7642
+ }).extend({ leaseId: string().min(1) });
7643
+ /** The independently selectable logical storage classes. `recordings`
7644
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
7645
+ * segments; `eventMedia` is post-analysis blobs. */
7646
+ var StorageMigrationClassSchema = _enum([
7647
+ "recordings",
7648
+ "recordingsLow",
7649
+ "eventMedia"
7650
+ ]);
7651
+ /** A destination is always an existing, fully-qualified location id. The
7652
+ * migration API intentionally never changes a source location's `basePath`:
7653
+ * callers create a new `<type>:<slug>` location, then select it here. */
7654
+ var StorageMigrationDestinationsSchema = object({
7655
+ recordings: string().min(1).optional(),
7656
+ recordingsLow: string().min(1).optional(),
7657
+ eventMedia: string().min(1).optional()
7658
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
7659
+ /** Shared input for planning and starting an orchestrated storage migration. */
7660
+ var StorageMigrationInputSchema = object({
7661
+ destinations: StorageMigrationDestinationsSchema,
7662
+ throttleMbps: number().min(1).max(1e3).optional()
7663
+ });
7664
+ /** The durable coordinator state machine. The only phase that changes default
7665
+ * locations is `repointing`, after every selected mover has completed and been
7666
+ * verified. */
7667
+ var StorageMigrationPhaseSchema = _enum([
7668
+ "planning",
7669
+ "pausing",
7670
+ "moving",
7671
+ "verifying",
7672
+ "repointing",
7673
+ "refreshing",
7674
+ "resuming",
7675
+ "done",
7676
+ "failed",
7677
+ "cancelled"
7678
+ ]);
7679
+ var StorageMigrationParticipantSchema = _enum([
7680
+ "pipeline",
7681
+ "recorder",
7682
+ "analytics"
7683
+ ]);
7684
+ var StorageMigrationMoveSchema = object({
7685
+ storageClass: StorageMigrationClassSchema,
7686
+ fromLocationId: string(),
7687
+ toLocationId: string(),
7688
+ moverJobId: string().nullable(),
7689
+ state: RelocateJobStateSchema.nullable(),
7690
+ error: string().nullable()
7691
+ });
7692
+ var StorageMigrationJobSchema = object({
7693
+ jobId: string(),
7694
+ phase: StorageMigrationPhaseSchema,
7695
+ destinations: StorageMigrationDestinationsSchema,
7696
+ throttleMbps: number(),
7697
+ moves: array(StorageMigrationMoveSchema),
7698
+ pauseLeaseId: string().nullable(),
7699
+ pausedParticipants: array(StorageMigrationParticipantSchema),
7700
+ repointed: boolean(),
7701
+ cancelRequested: boolean(),
7702
+ startedAt: number(),
7703
+ updatedAt: number(),
7704
+ finishedAt: number().nullable(),
7705
+ error: string().nullable()
7706
+ });
7707
+ var StorageMigrationPlanSchema = object({
7708
+ destinations: StorageMigrationDestinationsSchema,
7709
+ moves: array(object({
7710
+ storageClass: StorageMigrationClassSchema,
7711
+ fromLocationId: string(),
7712
+ toLocationId: string()
7713
+ }))
7594
7714
  });
7595
7715
  /**
7596
7716
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -7642,6 +7762,21 @@ var StorageLocationSchema = object({
7642
7762
  nodeId: string().optional(),
7643
7763
  isDefault: boolean().default(false),
7644
7764
  isSystem: boolean().default(false),
7765
+ /**
7766
+ * Operator opt-in: whether consumers that BALANCE across several locations
7767
+ * of a type may write here. Recordings reads it today; event media and
7768
+ * backups are the next consumers, which is why the flag lives on the
7769
+ * location rather than in any one addon's store — nothing has to be
7770
+ * extended to add the next consumer.
7771
+ *
7772
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7773
+ * flag existed reads back with no flag and keeps working exactly as before;
7774
+ * that is the whole compat story, and it is why no migration ships with it.
7775
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7776
+ * disk must not silently start writing to it); the default of a type is
7777
+ * always stamped `true`.
7778
+ */
7779
+ enabled: boolean().optional(),
7645
7780
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7646
7781
  * for node-local locations it can reach) — never persisted, absent when the
7647
7782
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12381,7 +12516,8 @@ method(object({
12381
12516
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12382
12517
  /**
12383
12518
  * filesystem-browse — per-node capability for browsing the node's local
12384
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12519
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12520
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12385
12521
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12386
12522
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12387
12523
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -14222,6 +14358,13 @@ var MaskGridDimsSchema = object({
14222
14358
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
14223
14359
  * this one field keeps the schema additive — a rule still declares exactly
14224
14360
  * one trigger.
14361
+ *
14362
+ * AUDIO rules add no member here, for the reason occupancy added none: the
14363
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
14364
+ * mirror.ts` fails the build on a member the app cannot render) and every
14365
+ * member costs a release train. A sustained-sound rule is therefore an
14366
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
14367
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
14225
14368
  */
14226
14369
  var NcDeliverySchema = _enum([
14227
14370
  "immediate",
@@ -14236,15 +14379,32 @@ var NcDeliverySchema = _enum([
14236
14379
  * depend on a provider's raw event name or payload shape.
14237
14380
  */
14238
14381
  var NcSystemEventKindSchema = _enum([
14239
- "camera-online",
14240
- "camera-offline",
14382
+ "device-online",
14383
+ "device-offline",
14384
+ "device-disabled",
14385
+ "device-enabled",
14241
14386
  "stream-online",
14242
14387
  "stream-offline",
14243
14388
  "node-online",
14244
14389
  "node-offline",
14245
14390
  "addon-update-available",
14246
- "server-update-available"
14391
+ "server-update-available",
14392
+ "alarm-triggered",
14393
+ "alarm-armed",
14394
+ "alarm-disarmed",
14395
+ "camera-online",
14396
+ "camera-offline",
14397
+ "camera-disabled",
14398
+ "camera-enabled"
14399
+ ]);
14400
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14401
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14402
+ "camera-online",
14403
+ "camera-offline",
14404
+ "camera-disabled",
14405
+ "camera-enabled"
14247
14406
  ]);
14407
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
14248
14408
  /**
14249
14409
  * One coherent system-event condition. `kinds` is the required opt-in safety
14250
14410
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -14253,6 +14413,18 @@ var NcSystemEventKindSchema = _enum([
14253
14413
  var NcSystemEventConditionSchema = object({
14254
14414
  kinds: array(NcSystemEventKindSchema).min(1),
14255
14415
  deviceIds: array(number().int()).min(1).optional(),
14416
+ /**
14417
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14418
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14419
+ * is what a liveness rule means when nobody said otherwise.
14420
+ *
14421
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14422
+ * one reason: the intake cannot know which devices this household cares
14423
+ * about, and a producer-side filter is one no operator can change. Fails
14424
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14425
+ * does not carry) matches no `deviceTypes` list.
14426
+ */
14427
+ deviceTypes: array(string().min(1)).min(1).optional(),
14256
14428
  nodeIds: array(string().min(1)).min(1).optional(),
14257
14429
  packageNames: array(string().min(1)).min(1).optional()
14258
14430
  });
@@ -14303,6 +14475,47 @@ var NcOccupancyConditionSchema = object({
14303
14475
  sustainSeconds: number().int().min(0).max(3600).default(15)
14304
14476
  });
14305
14477
  /**
14478
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14479
+ *
14480
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14481
+ * reference notifier uses, so an operator moving between them re-uses what
14482
+ * they already know): a rule matches when, over a sampling window of
14483
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14484
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14485
+ *
14486
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14487
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14488
+ * - `labels` — the classifier put at least one of these labels on it.
14489
+ *
14490
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14491
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14492
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14493
+ * is given** — a window in which every sample is trivially a hit would fire on
14494
+ * silence, so the engine refuses such a condition rather than notifying on
14495
+ * nothing (the schema cannot express "at least one of" without becoming a
14496
+ * ZodEffects the cap path would have to special-case).
14497
+ *
14498
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14499
+ * must be FULL before it can match — a window that has been open for two
14500
+ * seconds of its ten is 100% of nothing, and firing on it would make
14501
+ * `samplingSeconds` decorative.
14502
+ *
14503
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14504
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14505
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14506
+ * an operator who typed `dog` mean the same thing.
14507
+ */
14508
+ var NcAudioConditionSchema = object({
14509
+ /** Audio macro labels; absent = any sound (level-only rule). */
14510
+ labels: array(string().min(1)).min(1).optional(),
14511
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14512
+ dbThreshold: number().min(-96).max(0).optional(),
14513
+ /** Percentage of the window's samples that must be hits (1–100). */
14514
+ hitPercent: number().int().min(1).max(100).default(60),
14515
+ /** Length of the sampling window in seconds. */
14516
+ samplingSeconds: number().int().min(1).max(300).default(10)
14517
+ });
14518
+ /**
14306
14519
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
14307
14520
  *
14308
14521
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14575,7 +14788,33 @@ var NcConditionsSchema = object({
14575
14788
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14576
14789
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14577
14790
  */
14578
- occupancy: NcOccupancyConditionSchema.optional()
14791
+ occupancy: NcOccupancyConditionSchema.optional(),
14792
+ /**
14793
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14794
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14795
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14796
+ * a window that is not full yet, neither filter given). See
14797
+ * {@link NcAudioCondition}.
14798
+ *
14799
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14800
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14801
+ * a detection, a track or a device event (the same fail-closed pairing
14802
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14803
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14804
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14805
+ * classified sample) stays exactly as it was for rules that already use it.
14806
+ *
14807
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14808
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14809
+ * (`camstack/src/data/notification-center.ts`, guarded by
14810
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14811
+ * condition fields it does not know when a rule is saved from the phone.
14812
+ * Publishing an editor for a condition the app cannot round-trip is how an
14813
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14814
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14815
+ * does an audio rule become authorable.
14816
+ */
14817
+ audio: NcAudioConditionSchema.optional()
14579
14818
  });
14580
14819
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14581
14820
  var NcRuleTargetSchema = object({
@@ -14689,6 +14928,73 @@ var NcThrottleSchema = object({
14689
14928
  */
14690
14929
  granularity: NcThrottleGranularitySchema.optional()
14691
14930
  });
14931
+ /**
14932
+ * How long the confirm gate may hold ONE notification, and how big the picture
14933
+ * it judges may be.
14934
+ *
14935
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14936
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14937
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14938
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14939
+ * tokens for pixels the model pools away.
14940
+ */
14941
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14942
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14943
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14944
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14945
+ var NcConfirmExpectSchema = object({
14946
+ op: _enum([
14947
+ ">=",
14948
+ ">",
14949
+ "<=",
14950
+ "<",
14951
+ "=="
14952
+ ]),
14953
+ count: number().int().min(0).max(1e3)
14954
+ });
14955
+ /**
14956
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14957
+ * to ship and says whether it agrees with the rule.
14958
+ *
14959
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14960
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14961
+ * on the operator's phone is not a verdict about this notification.
14962
+ *
14963
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14964
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14965
+ * the default and every fail-open is COUNTED, because a gate that always fails
14966
+ * open looks in the log exactly like a gate that works.
14967
+ *
14968
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14969
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14970
+ * production failures in one day), so the gate reads absent as the constant
14971
+ * above rather than trusting a parse it may never have seen.
14972
+ */
14973
+ var NcConfirmSchema = object({
14974
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14975
+ * same thing, and both mean "deliver exactly as before". */
14976
+ enabled: boolean().default(false),
14977
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14978
+ profileId: string().optional(),
14979
+ /**
14980
+ * The operator's question, in his own words. Absent = a question derived
14981
+ * from the rule (its class and its expectation).
14982
+ *
14983
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14984
+ * banners, signage and plates as instructions if you let them reach the
14985
+ * prompt — proven live — so the authoritative contract stays in the system
14986
+ * turn and only rule-authored words land here.
14987
+ */
14988
+ prompt: string().max(1e3).optional(),
14989
+ /** Fire only when the model's count satisfies this. Absent = the model's
14990
+ * own boolean verdict decides. */
14991
+ expect: NcConfirmExpectSchema.optional(),
14992
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14993
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14994
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14995
+ /** Longest edge the judged image is downscaled to before it is sent. */
14996
+ maxImagePx: number().int().min(64).max(2048).default(448)
14997
+ });
14692
14998
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14693
14999
  var NcRuleInputSchema = object({
14694
15000
  name: string().min(1).max(200),
@@ -14749,7 +15055,13 @@ var NcRuleInputSchema = object({
14749
15055
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14750
15056
  * shape as every other actuation.
14751
15057
  */
14752
- actions: NcRuleActionsSchema.optional()
15058
+ actions: NcRuleActionsSchema.optional(),
15059
+ /**
15060
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
15061
+ * a rule that predates the gate must keep delivering byte-for-byte as it
15062
+ * did, and absent is the only way to say that without a migration.
15063
+ */
15064
+ confirm: NcConfirmSchema.optional()
14753
15065
  });
14754
15066
  /**
14755
15067
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14760,7 +15072,37 @@ var NcRuleInputSchema = object({
14760
15072
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14761
15073
  * `updateRule` patch.
14762
15074
  */
14763
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
15075
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
15076
+ disabledTargetIds: array(string()).optional(),
15077
+ /**
15078
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
15079
+ *
15080
+ * It makes the key optional to SUPPLY; the parse still materialises the
15081
+ * default when the key is absent. And `NcRuleStore.update` merges with
15082
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
15083
+ * one — which made every partial edit destructive:
15084
+ *
15085
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
15086
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
15087
+ * setEnabled(ruleId, false) → conditions reset to `{}`
15088
+ *
15089
+ * A rule scoped to one camera and one zone silently became a rule that
15090
+ * matches EVERY event on EVERY camera, and lost its `media` policy
15091
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
15092
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
15093
+ * within a minute of a two-field patch.
15094
+ *
15095
+ * So every defaulted field is re-declared here WITHOUT its default. The
15096
+ * inner defaults still apply when the caller DOES send the key — `{}` for
15097
+ * conditions remains a real instruction ("clear them") — and only the
15098
+ * absent key is now genuinely absent.
15099
+ */
15100
+ enabled: boolean().optional(),
15101
+ conditions: NcConditionsSchema.optional(),
15102
+ media: NcMediaPolicySchema.optional(),
15103
+ throttle: NcThrottleSchema.optional(),
15104
+ priority: number().int().min(1).max(5).optional()
15105
+ });
14764
15106
  /** A persisted rule. */
14765
15107
  var NcRuleSchema = NcRuleInputSchema.extend({
14766
15108
  id: string(),
@@ -15061,6 +15403,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
15061
15403
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
15062
15404
  * copy would lie the first time a rule is disabled.
15063
15405
  */
15406
+ /**
15407
+ * Why a device a mode NAMES is nonetheless not armed by it.
15408
+ *
15409
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15410
+ * per-camera notification switch the Notification Center already owns,
15411
+ * `detection-off` is the device's own detection binding being inactive, and
15412
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15413
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15414
+ * with the switches the operator actually used.
15415
+ */
15416
+ var NcAlarmSkipReasonSchema = _enum([
15417
+ "muted",
15418
+ "detection-off",
15419
+ "offline"
15420
+ ]);
15421
+ var NcAlarmSkippedDeviceSchema = object({
15422
+ deviceId: number().int(),
15423
+ reason: NcAlarmSkipReasonSchema
15424
+ });
15064
15425
  var NcAlarmModeCoverageSchema = object({
15065
15426
  mode: AlarmArmModeSchema,
15066
15427
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -15068,7 +15429,18 @@ var NcAlarmModeCoverageSchema = object({
15068
15429
  /** At least one covering rule has no device scope, so the mode covers all. */
15069
15430
  allDevices: boolean(),
15070
15431
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
15071
- deviceIds: array(number().int())
15432
+ deviceIds: array(number().int()),
15433
+ /**
15434
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15435
+ * excludes it.
15436
+ *
15437
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15438
+ * twelve makes it false in exactly the way nobody notices until an incident.
15439
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15440
+ * still parses as "nothing known to be skipped" rather than failing the whole
15441
+ * alarm tab.
15442
+ */
15443
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
15072
15444
  });
15073
15445
  var NcAlarmConfigSchema = object({
15074
15446
  /**
@@ -16431,13 +16803,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16431
16803
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16432
16804
  kind: "mutation",
16433
16805
  auth: "admin"
16434
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
16806
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
16435
16807
  kind: "mutation",
16436
16808
  auth: "admin"
16437
- }), method(object({}), array(RelocateJobSchema).readonly(), {
16438
- kind: "query",
16809
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
16810
+ kind: "mutation",
16439
16811
  auth: "admin"
16440
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16812
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
16813
+ kind: "mutation",
16814
+ auth: "admin"
16815
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
16816
+ kind: "mutation",
16817
+ auth: "admin"
16818
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16441
16819
  kind: "mutation",
16442
16820
  auth: "admin"
16443
16821
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -17894,9 +18272,16 @@ var CameraStatusSchema = object({
17894
18272
  audio: CameraAudioStatusSchema.nullable(),
17895
18273
  recording: CameraRecordingStatusSchema.nullable(),
17896
18274
  /**
17897
- * Per-camera function switches an OPERATOR has turned off
18275
+ * Per-camera functions an OPERATOR has turned off
17898
18276
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17899
18277
  *
18278
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
18279
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
18280
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
18281
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
18282
+ * The badge outlives the control panel: the panel was a convenience, this is
18283
+ * the difference between a camera being off and a camera being dead.
18284
+ *
17900
18285
  * This is the difference between DISABLED and BROKEN. A camera whose
17901
18286
  * `detection` block reports zero fps and whose `switchedOff` contains
17902
18287
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -17967,7 +18352,13 @@ var NodeInferenceDevicesSchema = object({
17967
18352
  reachable: boolean(),
17968
18353
  devices: array(NodeInferenceDeviceSchema).readonly()
17969
18354
  });
17970
- method(object({
18355
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
18356
+ kind: "mutation",
18357
+ auth: "admin"
18358
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
18359
+ kind: "mutation",
18360
+ auth: "admin"
18361
+ }), method(object({
17971
18362
  deviceId: number(),
17972
18363
  agentNodeId: string()
17973
18364
  }), object({ success: literal(true) }), {
@@ -18497,24 +18888,28 @@ var snapshotCapability = {
18497
18888
  *
18498
18889
  * `getSnapshotOverview` is cache-only by contract: it answers from whatever
18499
18890
  * the wrapper happens to hold and never captures. Under D93 the client
18500
- * versions its image URL on that answer, and an image REQUEST is what enrols
18501
- * a camera in the keep-warm loop. Both of those are satisfiable by the
18502
- * client's own image cache — `expo-image` is URL-keyed and never revalidates
18503
- * — so a URL painted in a previous session comes off disk with no network,
18504
- * no enrolment, and nothing warming. Measured on the live hub: reopening
18505
- * after two minutes idle painted 15 of 16 tiles at **168 s old** with zero
18506
- * HTTP requests, and the fleet only recovered because a later poll happened
18507
- * to observe a different identity.
18891
+ * versions its image URL on that answer, and an image REQUEST was the only
18892
+ * demand signal. Both of those are satisfiable by the client's own image
18893
+ * cache — `expo-image` is URL-keyed and never revalidates — so a URL painted
18894
+ * in a previous session comes off disk with no network, no demand, and no
18895
+ * capture. Measured on the live hub: reopening after two minutes idle
18896
+ * painted 15 of 16 tiles at **168 s old** with zero HTTP requests, and the
18897
+ * fleet only recovered because a later poll happened to observe a different
18898
+ * identity.
18508
18899
  *
18509
18900
  * ## The two properties that fix it
18510
18901
  *
18511
18902
  * **It is an RPC, so no client cache can answer it.** The demand signal
18512
- * always reaches the wrapper. This method therefore MAY create keep-warm
18513
- * subscriptions, where `getSnapshotOverview` must never (D93) — the
18514
- * distinction is not "one is newer" but that the overview poll is app-wide
18515
- * (a creating overview would warm every camera on the install) while this is
18516
- * called by a rendered surface naming the tiles it is actually painting, at
18517
- * the width it is painting them.
18903
+ * always reaches the wrapper. This method therefore CAPTURES, where
18904
+ * `getSnapshotOverview` must never (D93) — the distinction is not "one is
18905
+ * newer" but that the overview poll is app-wide (a capturing overview would
18906
+ * dial every camera on the install) while this is called by a rendered
18907
+ * surface naming the tiles it is actually painting, at the width it is
18908
+ * painting them.
18909
+ *
18910
+ * Since 2026-08-11 this is the ONLY thing that refreshes a snapshot: the
18911
+ * server-side keep-warm loop was removed (operator directive — on-demand,
18912
+ * always), so a camera nobody is looking at costs nothing at all.
18518
18913
  *
18519
18914
  * **It waits, briefly and boundedly, for the capture it triggered.** The
18520
18915
  * returned `capturedAt` is the frame the link will serve, not the frame the
@@ -18732,6 +19127,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
18732
19127
  locationId: string(),
18733
19128
  targetBytes: number().int().positive()
18734
19129
  }), EvictResultSchema, { kind: "mutation" });
19130
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
19131
+ kind: "mutation",
19132
+ auth: "admin"
19133
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
19134
+ kind: "mutation",
19135
+ auth: "admin"
19136
+ });
18735
19137
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
18736
19138
  providerId: string().min(1),
18737
19139
  displayName: string().min(1),
@@ -18835,6 +19237,28 @@ var TerminalProfileInfoSchema = object({
18835
19237
  label: string(),
18836
19238
  description: string().optional()
18837
19239
  });
19240
+ /**
19241
+ * A durable operator-created Terminal instance. Profiles are templates; only
19242
+ * an instance declares a camera.
19243
+ */
19244
+ var TerminalInstanceInfoSchema = object({
19245
+ instanceId: string(),
19246
+ cameraStableId: string(),
19247
+ nodeId: string(),
19248
+ profileId: string(),
19249
+ profileLabel: string(),
19250
+ name: string(),
19251
+ enabled: boolean()
19252
+ });
19253
+ var TerminalLegacyCameraSchema = object({
19254
+ stableId: string(),
19255
+ nodeId: string(),
19256
+ profileId: string(),
19257
+ profileLabel: string(),
19258
+ name: string(),
19259
+ /** Only legacy monitor cameras can retain their historic stable identity. */
19260
+ adoptable: boolean()
19261
+ });
18838
19262
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
18839
19263
  seq: number().int().positive(),
18840
19264
  kind: literal("data"),
@@ -18851,7 +19275,29 @@ var TerminalOutputBatchSchema = object({
18851
19275
  snapshot: string().optional(),
18852
19276
  events: array(TerminalOutputEventSchema).readonly()
18853
19277
  });
18854
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
19278
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
19279
+ targetNodeId: string().min(1),
19280
+ profileId: string().min(1),
19281
+ name: string().trim().min(1).max(160).optional()
19282
+ }), TerminalInstanceInfoSchema, {
19283
+ kind: "mutation",
19284
+ auth: "admin"
19285
+ }), method(object({ instanceId: string().min(1) }), _void(), {
19286
+ kind: "mutation",
19287
+ auth: "admin"
19288
+ }), method(object({
19289
+ instanceId: string().min(1),
19290
+ enabled: boolean()
19291
+ }), TerminalInstanceInfoSchema, {
19292
+ kind: "mutation",
19293
+ auth: "admin"
19294
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
19295
+ stableId: string().min(1),
19296
+ name: string().trim().min(1).max(160).optional()
19297
+ }), TerminalInstanceInfoSchema, {
19298
+ kind: "mutation",
19299
+ auth: "admin"
19300
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18855
19301
  profileId: string(),
18856
19302
  cols: number().int().positive(),
18857
19303
  rows: number().int().positive()
@@ -18868,7 +19314,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
18868
19314
  }), method(object({
18869
19315
  sessionId: string(),
18870
19316
  afterSeq: number().int().nonnegative(),
18871
- waitMs: number().int().min(0).max(2e3).default(0)
19317
+ waitMs: number().int().min(0).max(2e3).default(0),
19318
+ /**
19319
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
19320
+ * browser's initial repaint remains immediate; the camera snapshot
19321
+ * relay uses it to avoid encoding a blank startup frame.
19322
+ */
19323
+ waitForOutput: boolean().optional()
18872
19324
  }), TerminalOutputBatchSchema, {
18873
19325
  kind: "mutation",
18874
19326
  auth: "admin",
@@ -21366,6 +21818,7 @@ var FaceInfoSchema = object({
21366
21818
  var FaceFilterEnum = _enum([
21367
21819
  "unassigned",
21368
21820
  "recognized",
21821
+ "identified",
21369
21822
  "all"
21370
21823
  ]);
21371
21824
  var MediaFileLiteSchema$1 = object({
@@ -21394,6 +21847,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string(
21394
21847
  kind: "mutation",
21395
21848
  auth: "admin"
21396
21849
  }), method(object({
21850
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
21851
+ deviceId: number().int().optional(),
21397
21852
  limit: number().int().positive().optional(),
21398
21853
  filter: FaceFilterEnum.optional(),
21399
21854
  /**
@@ -23720,6 +24175,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
23720
24175
  capName: string().min(1).max(64),
23721
24176
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
23722
24177
  valuePath: string().min(1).max(64)
24178
+ }),
24179
+ object({
24180
+ kind: literal("latest-recognition"),
24181
+ recognition: _enum(["person", "plate"])
23723
24182
  })
23724
24183
  ]);
23725
24184
  var OsdSlotBindingSchema = object({
@@ -23825,6 +24284,15 @@ method(object({ deviceId: number().int() }), object({
23825
24284
  }), object({ success: literal(true) }), {
23826
24285
  kind: "mutation",
23827
24286
  auth: "admin"
24287
+ }), method(object({
24288
+ sourceDeviceId: number().int(),
24289
+ targetDeviceId: number().int()
24290
+ }), object({
24291
+ copied: number().int().nonnegative(),
24292
+ skipped: number().int().nonnegative()
24293
+ }), {
24294
+ kind: "mutation",
24295
+ auth: "admin"
23828
24296
  }), method(object({
23829
24297
  deviceId: number().int(),
23830
24298
  slotId: string().min(1),
@@ -24834,7 +25302,19 @@ var RecordingManifestSchema = object({
24834
25302
  * profiles/subtrees/locations on this node). */
24835
25303
  var RecordingDeviceUsageSchema = object({
24836
25304
  deviceId: number(),
24837
- usedBytes: number()
25305
+ usedBytes: number(),
25306
+ /**
25307
+ * Start of this camera's OLDEST indexed segment, across every profile and
25308
+ * location — the "Oldest footage" column in Recordings → Storage, and the
25309
+ * only honest answer to "is retention actually holding?" per camera.
25310
+ *
25311
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
25312
+ * predates this field omits it entirely, and a hub whose types carry the
25313
+ * field must keep validating that older provider's payload: the framework
25314
+ * (types) and the addon ship on different trains, and the addon is usually
25315
+ * the later of the two.
25316
+ */
25317
+ oldestMs: number().nullable().optional()
24838
25318
  });
24839
25319
  /** Recording storage usage + capacity for one storage location. */
24840
25320
  var RecordingLocationUsageSchema = object({
@@ -24862,6 +25342,57 @@ var RecordingStorageUsageSchema = object({
24862
25342
  locations: array(RecordingLocationUsageSchema)
24863
25343
  });
24864
25344
  /**
25345
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
25346
+ *
25347
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
25348
+ * is the operator asking for the EXISTING archive to be brought into line with
25349
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
25350
+ * location, run FIFO behind the single-flight mover.
25351
+ *
25352
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
25353
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
25354
+ * (empty on the plan).
25355
+ */
25356
+ var RecordingRebalanceMoveSchema = object({
25357
+ deviceId: number(),
25358
+ profile: string(),
25359
+ fromLocationId: string(),
25360
+ toLocationId: string(),
25361
+ bytes: number(),
25362
+ files: number().int()
25363
+ });
25364
+ /** Why a pile that is out of place is staying there. Every refusal is
25365
+ * reported: a rebalance that silently drops a camera reads exactly like one
25366
+ * that had nothing to do. */
25367
+ var RecordingRebalanceSkipReasonSchema = _enum([
25368
+ "unassigned",
25369
+ "target-not-writable",
25370
+ "below-threshold",
25371
+ "no-headroom"
25372
+ ]);
25373
+ var RecordingRebalanceSkipSchema = object({
25374
+ deviceId: number(),
25375
+ profile: string(),
25376
+ fromLocationId: string(),
25377
+ /** The location the plan wants; null when the camera has no assignment. */
25378
+ toLocationId: string().nullable(),
25379
+ bytes: number(),
25380
+ reason: RecordingRebalanceSkipReasonSchema
25381
+ });
25382
+ var RecordingRebalancePlanSchema = object({
25383
+ moves: array(RecordingRebalanceMoveSchema),
25384
+ skipped: array(RecordingRebalanceSkipSchema),
25385
+ bytesToMove: number(),
25386
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
25387
+ jobIds: array(string())
25388
+ });
25389
+ var RecordingRebalanceInputSchema = object({
25390
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
25391
+ throttleMbps: number().min(1).max(1e3).optional(),
25392
+ /** Ignore piles smaller than this (default 1 GB). */
25393
+ minMoveGb: number().min(0).optional()
25394
+ });
25395
+ /**
24865
25396
  * Result of locating footage at a wall-clock instant for one device/profile.
24866
25397
  * `segment` carries the covering segment's window; `gap` reports the forward
24867
25398
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -25009,6 +25540,21 @@ method(object({
25009
25540
  }), {
25010
25541
  kind: "mutation",
25011
25542
  auth: "admin"
25543
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
25544
+ kind: "mutation",
25545
+ auth: "admin"
25546
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
25547
+ kind: "mutation",
25548
+ auth: "admin"
25549
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
25550
+ kind: "mutation",
25551
+ auth: "admin"
25552
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
25553
+ kind: "mutation",
25554
+ auth: "admin"
25555
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
25556
+ kind: "mutation",
25557
+ auth: "admin"
25012
25558
  }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
25013
25559
  kind: "mutation",
25014
25560
  auth: "admin"
@@ -25018,9 +25564,15 @@ method(object({
25018
25564
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
25019
25565
  kind: "mutation",
25020
25566
  auth: "admin"
25567
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25568
+ kind: "query",
25569
+ auth: "admin"
25570
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25571
+ kind: "mutation",
25572
+ auth: "admin"
25021
25573
  });
25022
25574
  /**
25023
- * `recordingExport` cap — render a footage time range into a single downloadable
25575
+ * `recording-export` cap — render a footage time range into a single downloadable
25024
25576
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
25025
25577
  * bounded lifetime with a durable history, auto-expiry, and optional
25026
25578
  * delete-after-download.
@@ -25035,10 +25587,42 @@ method(object({
25035
25587
  */
25036
25588
  /** Playback-speed multiplier for the render (1 = realtime). */
25037
25589
  var ExportSpeedSchema = number().min(.25).max(32);
25590
+ /**
25591
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25592
+ *
25593
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
25594
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25595
+ * playlist. Handing it absolute epochs would make every call site responsible
25596
+ * for the same subtraction, and the one that forgot would emit a filter that
25597
+ * selects nothing — silently, as a uniform timelapse.
25598
+ */
25599
+ var ExportDenseRangeSchema = object({
25600
+ fromSec: number().nonnegative(),
25601
+ toSec: number().nonnegative()
25602
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
25603
+ /**
25604
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
25605
+ * listed ranges and at the base `everyMs` everywhere else.
25606
+ *
25607
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
25608
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
25609
+ */
25610
+ var ExportDenseSchema = object({
25611
+ everyMs: number().int().positive(),
25612
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
25613
+ });
25038
25614
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
25039
25615
  var ExportTimelapseSchema = object({
25040
25616
  everyMs: number().int().positive(),
25041
- outputFps: number().int().min(1).max(60).optional()
25617
+ outputFps: number().int().min(1).max(60).optional(),
25618
+ /** Optional second, FASTER rate over the intervals that matter. */
25619
+ dense: ExportDenseSchema.optional()
25620
+ }).superRefine((v, ctx) => {
25621
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
25622
+ code: ZodIssueCode.custom,
25623
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
25624
+ path: ["dense", "everyMs"]
25625
+ });
25042
25626
  });
25043
25627
  /**
25044
25628
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -25096,6 +25680,19 @@ var ExportDownloadSchema = object({
25096
25680
  url: string(),
25097
25681
  endpoints: array(string())
25098
25682
  });
25683
+ /**
25684
+ * A finished export's bytes, inline.
25685
+ *
25686
+ * `bytes` is the DECODED length — the number the caller bounds and logs
25687
+ * against, so nobody has to infer it from the base64 length.
25688
+ */
25689
+ var ExportBytesSchema = object({
25690
+ base64: string(),
25691
+ contentType: string(),
25692
+ /** Suggested filename, extension included. */
25693
+ name: string(),
25694
+ bytes: number().int().nonnegative()
25695
+ });
25099
25696
  method(object({
25100
25697
  deviceId: number(),
25101
25698
  profile: string(),
@@ -25120,6 +25717,9 @@ method(object({
25120
25717
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
25121
25718
  kind: "query",
25122
25719
  auth: "protected"
25720
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
25721
+ kind: "query",
25722
+ auth: "protected"
25123
25723
  });
25124
25724
  /**
25125
25725
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -30978,6 +31578,12 @@ Object.freeze({
30978
31578
  addonId: null,
30979
31579
  access: "delete"
30980
31580
  },
31581
+ "osdManager.copyDeviceConfiguration": {
31582
+ capName: "osd-manager",
31583
+ capScope: "system",
31584
+ addonId: null,
31585
+ access: "create"
31586
+ },
30981
31587
  "osdManager.getConditionSupport": {
30982
31588
  capName: "osd-manager",
30983
31589
  capScope: "system",
@@ -31074,7 +31680,7 @@ Object.freeze({
31074
31680
  addonId: null,
31075
31681
  access: "create"
31076
31682
  },
31077
- "pipelineAnalytics.cancelMediaRelocate": {
31683
+ "pipelineAnalytics.cancelStorageMigrationMove": {
31078
31684
  capName: "pipeline-analytics",
31079
31685
  capScope: "device",
31080
31686
  addonId: null,
@@ -31146,12 +31752,6 @@ Object.freeze({
31146
31752
  addonId: null,
31147
31753
  access: "view"
31148
31754
  },
31149
- "pipelineAnalytics.getMediaRelocateStatus": {
31150
- capName: "pipeline-analytics",
31151
- capScope: "device",
31152
- addonId: null,
31153
- access: "view"
31154
- },
31155
31755
  "pipelineAnalytics.getMotionEvents": {
31156
31756
  capName: "pipeline-analytics",
31157
31757
  capScope: "device",
@@ -31188,6 +31788,12 @@ Object.freeze({
31188
31788
  addonId: null,
31189
31789
  access: "view"
31190
31790
  },
31791
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
31792
+ capName: "pipeline-analytics",
31793
+ capScope: "device",
31794
+ addonId: null,
31795
+ access: "view"
31796
+ },
31191
31797
  "pipelineAnalytics.getTrack": {
31192
31798
  capName: "pipeline-analytics",
31193
31799
  capScope: "device",
@@ -31266,6 +31872,12 @@ Object.freeze({
31266
31872
  addonId: null,
31267
31873
  access: "view"
31268
31874
  },
31875
+ "pipelineAnalytics.pauseForStorageMigration": {
31876
+ capName: "pipeline-analytics",
31877
+ capScope: "device",
31878
+ addonId: null,
31879
+ access: "create"
31880
+ },
31269
31881
  "pipelineAnalytics.proposeRetrainAnnotations": {
31270
31882
  capName: "pipeline-analytics",
31271
31883
  capScope: "device",
@@ -31296,7 +31908,7 @@ Object.freeze({
31296
31908
  addonId: null,
31297
31909
  access: "create"
31298
31910
  },
31299
- "pipelineAnalytics.relocateMedia": {
31911
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
31300
31912
  capName: "pipeline-analytics",
31301
31913
  capScope: "device",
31302
31914
  addonId: null,
@@ -31308,6 +31920,12 @@ Object.freeze({
31308
31920
  addonId: null,
31309
31921
  access: "create"
31310
31922
  },
31923
+ "pipelineAnalytics.resumeForStorageMigration": {
31924
+ capName: "pipeline-analytics",
31925
+ capScope: "device",
31926
+ addonId: null,
31927
+ access: "create"
31928
+ },
31311
31929
  "pipelineAnalytics.saveRetrainAnnotations": {
31312
31930
  capName: "pipeline-analytics",
31313
31931
  capScope: "device",
@@ -31332,6 +31950,12 @@ Object.freeze({
31332
31950
  addonId: null,
31333
31951
  access: "create"
31334
31952
  },
31953
+ "pipelineAnalytics.startStorageMigrationMove": {
31954
+ capName: "pipeline-analytics",
31955
+ capScope: "device",
31956
+ addonId: null,
31957
+ access: "create"
31958
+ },
31335
31959
  "pipelineAnalytics.wipeAllAnalytics": {
31336
31960
  capName: "pipeline-analytics",
31337
31961
  capScope: "device",
@@ -31698,6 +32322,12 @@ Object.freeze({
31698
32322
  addonId: null,
31699
32323
  access: "view"
31700
32324
  },
32325
+ "pipelineOrchestrator.pauseForStorageMigration": {
32326
+ capName: "pipeline-orchestrator",
32327
+ capScope: "system",
32328
+ addonId: null,
32329
+ access: "create"
32330
+ },
31701
32331
  "pipelineOrchestrator.rebalance": {
31702
32332
  capName: "pipeline-orchestrator",
31703
32333
  capScope: "system",
@@ -31722,6 +32352,12 @@ Object.freeze({
31722
32352
  addonId: null,
31723
32353
  access: "view"
31724
32354
  },
32355
+ "pipelineOrchestrator.resumeForStorageMigration": {
32356
+ capName: "pipeline-orchestrator",
32357
+ capScope: "system",
32358
+ addonId: null,
32359
+ access: "create"
32360
+ },
31725
32361
  "pipelineOrchestrator.saveTemplate": {
31726
32362
  capName: "pipeline-orchestrator",
31727
32363
  capScope: "system",
@@ -32118,7 +32754,13 @@ Object.freeze({
32118
32754
  addonId: null,
32119
32755
  access: "create"
32120
32756
  },
32121
- "recording.cancelRelocate": {
32757
+ "recording.cancelRelocateJob": {
32758
+ capName: "recording",
32759
+ capScope: "system",
32760
+ addonId: null,
32761
+ access: "create"
32762
+ },
32763
+ "recording.cancelStorageMigrationMove": {
32122
32764
  capName: "recording",
32123
32765
  capScope: "system",
32124
32766
  addonId: null,
@@ -32154,7 +32796,7 @@ Object.freeze({
32154
32796
  addonId: null,
32155
32797
  access: "view"
32156
32798
  },
32157
- "recording.getRelocateStatus": {
32799
+ "recording.getStorageMigrationMoveStatus": {
32158
32800
  capName: "recording",
32159
32801
  capScope: "system",
32160
32802
  addonId: null,
@@ -32172,12 +32814,30 @@ Object.freeze({
32172
32814
  addonId: null,
32173
32815
  access: "view"
32174
32816
  },
32817
+ "recording.listRelocateJobs": {
32818
+ capName: "recording",
32819
+ capScope: "system",
32820
+ addonId: null,
32821
+ access: "view"
32822
+ },
32175
32823
  "recording.locateSegment": {
32176
32824
  capName: "recording",
32177
32825
  capScope: "system",
32178
32826
  addonId: null,
32179
32827
  access: "view"
32180
32828
  },
32829
+ "recording.pauseForStorageMigration": {
32830
+ capName: "recording",
32831
+ capScope: "system",
32832
+ addonId: null,
32833
+ access: "create"
32834
+ },
32835
+ "recording.planStorageRebalance": {
32836
+ capName: "recording",
32837
+ capScope: "system",
32838
+ addonId: null,
32839
+ access: "view"
32840
+ },
32181
32841
  "recording.pruneFootage": {
32182
32842
  capName: "recording",
32183
32843
  capScope: "system",
@@ -32196,6 +32856,12 @@ Object.freeze({
32196
32856
  addonId: null,
32197
32857
  access: "view"
32198
32858
  },
32859
+ "recording.refreshStorageLocationsForMigration": {
32860
+ capName: "recording",
32861
+ capScope: "system",
32862
+ addonId: null,
32863
+ access: "create"
32864
+ },
32199
32865
  "recording.relocateFootage": {
32200
32866
  capName: "recording",
32201
32867
  capScope: "system",
@@ -32220,44 +32886,68 @@ Object.freeze({
32220
32886
  addonId: null,
32221
32887
  access: "create"
32222
32888
  },
32889
+ "recording.resumeForStorageMigration": {
32890
+ capName: "recording",
32891
+ capScope: "system",
32892
+ addonId: null,
32893
+ access: "create"
32894
+ },
32223
32895
  "recording.setDeviceConfig": {
32224
32896
  capName: "recording",
32225
32897
  capScope: "system",
32226
32898
  addonId: null,
32227
32899
  access: "create"
32228
32900
  },
32901
+ "recording.startStorageMigrationMove": {
32902
+ capName: "recording",
32903
+ capScope: "system",
32904
+ addonId: null,
32905
+ access: "create"
32906
+ },
32907
+ "recording.startStorageRebalance": {
32908
+ capName: "recording",
32909
+ capScope: "system",
32910
+ addonId: null,
32911
+ access: "create"
32912
+ },
32229
32913
  "recordingExport.cancelExport": {
32230
- capName: "recordingExport",
32914
+ capName: "recording-export",
32231
32915
  capScope: "system",
32232
32916
  addonId: null,
32233
32917
  access: "create"
32234
32918
  },
32235
32919
  "recordingExport.createExport": {
32236
- capName: "recordingExport",
32920
+ capName: "recording-export",
32237
32921
  capScope: "system",
32238
32922
  addonId: null,
32239
32923
  access: "create"
32240
32924
  },
32241
32925
  "recordingExport.deleteExport": {
32242
- capName: "recordingExport",
32926
+ capName: "recording-export",
32243
32927
  capScope: "system",
32244
32928
  addonId: null,
32245
32929
  access: "delete"
32246
32930
  },
32247
32931
  "recordingExport.getDownloadUrl": {
32248
- capName: "recordingExport",
32932
+ capName: "recording-export",
32249
32933
  capScope: "system",
32250
32934
  addonId: null,
32251
32935
  access: "view"
32252
32936
  },
32253
32937
  "recordingExport.getExport": {
32254
- capName: "recordingExport",
32938
+ capName: "recording-export",
32255
32939
  capScope: "system",
32256
32940
  addonId: null,
32257
32941
  access: "view"
32258
32942
  },
32259
32943
  "recordingExport.listExports": {
32260
- capName: "recordingExport",
32944
+ capName: "recording-export",
32945
+ capScope: "system",
32946
+ addonId: null,
32947
+ access: "view"
32948
+ },
32949
+ "recordingExport.readExportBytes": {
32950
+ capName: "recording-export",
32261
32951
  capScope: "system",
32262
32952
  addonId: null,
32263
32953
  access: "view"
@@ -32616,6 +33306,30 @@ Object.freeze({
32616
33306
  addonId: null,
32617
33307
  access: "view"
32618
33308
  },
33309
+ "storageMigration.cancel": {
33310
+ capName: "storage-migration",
33311
+ capScope: "system",
33312
+ addonId: null,
33313
+ access: "create"
33314
+ },
33315
+ "storageMigration.plan": {
33316
+ capName: "storage-migration",
33317
+ capScope: "system",
33318
+ addonId: null,
33319
+ access: "view"
33320
+ },
33321
+ "storageMigration.start": {
33322
+ capName: "storage-migration",
33323
+ capScope: "system",
33324
+ addonId: null,
33325
+ access: "create"
33326
+ },
33327
+ "storageMigration.status": {
33328
+ capName: "storage-migration",
33329
+ capScope: "system",
33330
+ addonId: null,
33331
+ access: "view"
33332
+ },
32619
33333
  "storageProvider.abortUpload": {
32620
33334
  capName: "storage-provider",
32621
33335
  capScope: "system",
@@ -32994,12 +33708,42 @@ Object.freeze({
32994
33708
  addonId: null,
32995
33709
  access: "create"
32996
33710
  },
33711
+ "terminalSession.adoptLegacyMonitor": {
33712
+ capName: "terminal-session",
33713
+ capScope: "system",
33714
+ addonId: null,
33715
+ access: "create"
33716
+ },
32997
33717
  "terminalSession.close": {
32998
33718
  capName: "terminal-session",
32999
33719
  capScope: "system",
33000
33720
  addonId: null,
33001
33721
  access: "create"
33002
33722
  },
33723
+ "terminalSession.createInstance": {
33724
+ capName: "terminal-session",
33725
+ capScope: "system",
33726
+ addonId: null,
33727
+ access: "create"
33728
+ },
33729
+ "terminalSession.deleteInstance": {
33730
+ capName: "terminal-session",
33731
+ capScope: "system",
33732
+ addonId: null,
33733
+ access: "delete"
33734
+ },
33735
+ "terminalSession.listInstances": {
33736
+ capName: "terminal-session",
33737
+ capScope: "system",
33738
+ addonId: null,
33739
+ access: "view"
33740
+ },
33741
+ "terminalSession.listLegacyCameras": {
33742
+ capName: "terminal-session",
33743
+ capScope: "system",
33744
+ addonId: null,
33745
+ access: "view"
33746
+ },
33003
33747
  "terminalSession.listProfiles": {
33004
33748
  capName: "terminal-session",
33005
33749
  capScope: "system",
@@ -33030,6 +33774,12 @@ Object.freeze({
33030
33774
  addonId: null,
33031
33775
  access: "create"
33032
33776
  },
33777
+ "terminalSession.setInstanceEnabled": {
33778
+ capName: "terminal-session",
33779
+ capScope: "system",
33780
+ addonId: null,
33781
+ access: "create"
33782
+ },
33033
33783
  "terminalSession.writeInput": {
33034
33784
  capName: "terminal-session",
33035
33785
  capScope: "system",
@@ -33574,6 +34324,104 @@ var FramerateField = number().int().min(1).max(60);
33574
34324
  var TargetsField = array(NcRuleTargetSchema).min(1);
33575
34325
  var PriorityField = number().int().min(1).max(5);
33576
34326
  /**
34327
+ * Explicit override of the DENSE sampling cadence, seconds.
34328
+ *
34329
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
34330
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
34331
+ * made that same base 3 s and rendered a person pass as two frames.)
34332
+ *
34333
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
34334
+ * `denseCadenceSec` and played at `framerate` occupies
34335
+ *
34336
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
34337
+ *
34338
+ * 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.
34339
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
34340
+ * and therefore the length of a quiet night, does not move.
34341
+ *
34342
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
34343
+ * the recording has them returns the same frames, requested twice. Must be
34344
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
34345
+ * a uniform video the operator believes is two-rate — and upsert refuses it
34346
+ * rather than letting the export cap reject the render hours after the window.
34347
+ */
34348
+ var DenseCadenceSecField = number().min(.1).max(3600);
34349
+ /**
34350
+ * Minimum seconds of OUTPUT video each detection range must occupy.
34351
+ *
34352
+ * The operator-facing form of the arithmetic above: instead of solving for a
34353
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
34354
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
34355
+ * that range every ~583 ms.
34356
+ *
34357
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
34358
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
34359
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
34360
+ * ranges are sampled denser than they need. Per-range cadences require a cap
34361
+ * schema change and are the tracked follow-up.
34362
+ *
34363
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
34364
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
34365
+ * by real footage, never met by duplicating frames into motion that never
34366
+ * happened.
34367
+ */
34368
+ var MinDwellSecField = number().min(0).max(60);
34369
+ /**
34370
+ * Caption burned into the notification's preview frame.
34371
+ *
34372
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
34373
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
34374
+ * templating dialect for one field would be a second thing to explain.
34375
+ *
34376
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
34377
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
34378
+ * the reason this is not `.min(1)`.
34379
+ */
34380
+ var PreviewTextField = string().max(200);
34381
+ /**
34382
+ * Whether the notification's preview is a STILL or a short animation.
34383
+ *
34384
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
34385
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
34386
+ * night reads better as three seconds of motion than as one frame of it. Both
34387
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
34388
+ * simply applies it to a dozen frames sampled across the render and assembles
34389
+ * them.
34390
+ *
34391
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
34392
+ * seeks and a palette pass, and no rule that never asked for one should start
34393
+ * paying that on the deploy that shipped it.
34394
+ *
34395
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
34396
+ */
34397
+ var PreviewModeField = _enum(["image", "gif"]);
34398
+ /**
34399
+ * Which detection classes the notification reports counts for.
34400
+ *
34401
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
34402
+ * plan — no second query — aggregated per class. Absent or empty means "every
34403
+ * class the window actually contained", which is what an operator who never
34404
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
34405
+ * counts cars all night).
34406
+ *
34407
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
34408
+ * …). An unknown name simply never matches and reports nothing — it is not an
34409
+ * error, because a rule may legitimately name a class this camera's model does
34410
+ * not emit.
34411
+ *
34412
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
34413
+ * - `{{detections}}` — total over the reported classes
34414
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
34415
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
34416
+ * one per class, `count_` + the class name
34417
+ *
34418
+ * With NO custom body template the summary is appended to the derived body, and
34419
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
34420
+ * reads. With a custom template the operator owns every word — nothing is
34421
+ * appended, so `{{detectionSummary}}` is how he asks for it.
34422
+ */
34423
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
34424
+ /**
33577
34425
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
33578
34426
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
33579
34427
  * here (see the ownership note above).
@@ -33593,9 +34441,30 @@ var TimelapseRuleInputSchema = object({
33593
34441
  cadenceSec: CadenceSecField.default(15),
33594
34442
  /** Output frames per second of the assembled mp4 (predecessor parity). */
33595
34443
  framerate: FramerateField.default(10),
34444
+ /**
34445
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
34446
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
34447
+ * field gets.
34448
+ */
34449
+ denseCadenceSec: DenseCadenceSecField.optional(),
34450
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
34451
+ minDwellSec: MinDwellSecField.optional(),
33596
34452
  /** `notification-output` targets the finished video/thumbnail is sent to. */
33597
34453
  targets: TargetsField,
33598
34454
  template: TimelapseTemplateSchema.optional(),
34455
+ /**
34456
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
34457
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
34458
+ *
34459
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
34460
+ * the notification's title/body, and clearing it (`template: null`) must not
34461
+ * silently clear the caption too.
34462
+ */
34463
+ previewText: PreviewTextField.optional(),
34464
+ /** Still or animation — see {@link PreviewModeField}. */
34465
+ previewMode: PreviewModeField.default("image"),
34466
+ /** Classes the notification counts — see {@link ReportClassesField}. */
34467
+ reportClasses: ReportClassesField.optional(),
33599
34468
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
33600
34469
  priority: PriorityField.default(3)
33601
34470
  });
@@ -33606,8 +34475,13 @@ object({
33606
34475
  schedule: NcScheduleSchema.optional(),
33607
34476
  cadenceSec: CadenceSecField.optional(),
33608
34477
  framerate: FramerateField.optional(),
34478
+ denseCadenceSec: DenseCadenceSecField.optional(),
34479
+ minDwellSec: MinDwellSecField.optional(),
33609
34480
  targets: TargetsField.optional(),
33610
34481
  template: TimelapseTemplateSchema.nullable().optional(),
34482
+ previewText: PreviewTextField.optional(),
34483
+ previewMode: PreviewModeField.optional(),
34484
+ reportClasses: ReportClassesField.optional(),
33611
34485
  priority: PriorityField.optional()
33612
34486
  });
33613
34487
  TimelapseRuleInputSchema.extend({
@@ -33619,10 +34493,28 @@ TimelapseRuleInputSchema.extend({
33619
34493
  */
33620
34494
  ownerUserId: string().optional(),
33621
34495
  /**
33622
- * Epoch-ms of the last successful generation the 1-hour re-generation
33623
- * guard's durable state (predecessor parity). Absent = never generated.
34496
+ * Epoch-ms of the NEWEST successful generation across every camera of this
34497
+ * rule. What a UI shows, and the compatibility floor for
34498
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
33624
34499
  */
33625
34500
  lastGeneratedAt: number().optional(),
34501
+ /**
34502
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
34503
+ * re-generation guard's real durable state.
34504
+ *
34505
+ * One rule covers several cameras and each renders its own video, so a rule
34506
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
34507
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
34508
+ * already done — and B's night is gone for good, because the window will not
34509
+ * come back.
34510
+ *
34511
+ * ADDITIVE, so the migration is free: a row written before this field simply
34512
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
34513
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
34514
+ * "never generated" would re-render and re-notify every camera of every rule
34515
+ * once, on the deploy that shipped the map.
34516
+ */
34517
+ generatedByDevice: record(string(), number()).optional(),
33626
34518
  /** userId of the caller who created the rule (server-stamped). */
33627
34519
  createdBy: string(),
33628
34520
  createdAt: number(),