@camstack/addon-provider-onvif 1.2.11 → 1.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +954 -62
  2. package/dist/addon.mjs +954 -62
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -7204,8 +7204,31 @@ var AdoptionJobSchema = object({
7204
7204
  error: string().nullable()
7205
7205
  });
7206
7206
  /**
7207
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7208
- * pipeline functions an operator thinks in terms of.
7207
+ * Per-camera FUNCTION SWITCHES.
7208
+ *
7209
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7210
+ *
7211
+ * This file shipped as "the one coherent on/off surface over the pipeline
7212
+ * functions an operator thinks in terms of". The operator's verdict on
7213
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7214
+ * every function already had a settings page of its own, and a second place to
7215
+ * turn it off is a second place to look. Each switch is going back to its own
7216
+ * component's original options — detection to the detection-pipeline wrapper
7217
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7218
+ * (which was always first-class; the switch was a veneer over
7219
+ * `recording.setDeviceConfig`), notifications to a notification-center
7220
+ * per-device setting, the two camera planes to their own components.
7221
+ *
7222
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7223
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7224
+ * straight from the authorities with no group in the middle. That rule was
7225
+ * never about a control panel.
7226
+ *
7227
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7228
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7229
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7230
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7231
+ * stop; nothing new may be built on it.
7209
7232
  *
7210
7233
  * ## This file adds no state
7211
7234
  *
@@ -7550,14 +7573,21 @@ var RecordingConfigSchema = object({
7550
7573
  /**
7551
7574
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
7552
7575
  *
7553
- * One shape shared by the recorder's `relocateFootage` (segments) and
7554
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7555
- * page renders both movers with one component. Jobs are in-RAM (a restart
7556
- * forgets them re-running is safe by construction: copy-if-absent, delete
7557
- * after verify) and each completed/failed run also lands one durable ops-log
7558
- * row on the owning addon's surface.
7576
+ * One shape shared by the recorder and pipeline-analytics internal movers.
7577
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
7578
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
7579
+ * Each completed/failed run also lands one durable ops-log row on its owning
7580
+ * addon surface.
7581
+ */
7582
+ /**
7583
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7584
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7585
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7586
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7587
+ * runs at all.
7559
7588
  */
7560
7589
  var RelocateJobStateSchema = _enum([
7590
+ "queued",
7561
7591
  "running",
7562
7592
  "done",
7563
7593
  "failed",
@@ -7582,19 +7612,109 @@ var RelocateJobSchema = object({
7582
7612
  finishedAt: number().nullable(),
7583
7613
  error: string().nullable()
7584
7614
  });
7615
+ /** Profile-derived footage selection used only by the migration coordinator:
7616
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
7617
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
7585
7618
  var RelocateFootageInputSchema = object({
7586
- deviceId: number().optional(),
7587
7619
  fromLocationId: string(),
7588
7620
  toLocationId: string(),
7589
7621
  entities: array(_enum(["segments"])).optional(),
7622
+ /** Limits relocation to the logical profile class. Omit only for the
7623
+ * pre-orchestration compatibility path. */
7624
+ footageClass: RelocateFootageClassSchema.optional(),
7625
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7626
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7627
+ * unit is a (camera, profile) pile, not a disk. */
7628
+ deviceId: number().int().optional(),
7629
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7630
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7631
+ * placement plan assigns those two independently, so a rebalance that could
7632
+ * only say "recordings" would move footage the plan never asked to move. */
7633
+ profiles: array(string()).optional(),
7590
7634
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7591
7635
  * never allowed to starve live writers. */
7592
7636
  throttleMbps: number().min(1).max(1e3).optional()
7593
7637
  });
7594
- var RelocateMediaInputSchema = object({
7595
- deviceId: number().optional(),
7638
+ /** Internal, lease-scoped participant operation. It is intentionally separate
7639
+ * from persistent recording settings: a migration never changes
7640
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
7641
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
7642
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
7643
+ var StorageMigrationMediaMoveInputSchema = object({
7596
7644
  toLocationId: string(),
7597
7645
  throttleMbps: number().min(1).max(1e3).optional()
7646
+ }).extend({ leaseId: string().min(1) });
7647
+ /** The independently selectable logical storage classes. `recordings`
7648
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
7649
+ * segments; `eventMedia` is post-analysis blobs. */
7650
+ var StorageMigrationClassSchema = _enum([
7651
+ "recordings",
7652
+ "recordingsLow",
7653
+ "eventMedia"
7654
+ ]);
7655
+ /** A destination is always an existing, fully-qualified location id. The
7656
+ * migration API intentionally never changes a source location's `basePath`:
7657
+ * callers create a new `<type>:<slug>` location, then select it here. */
7658
+ var StorageMigrationDestinationsSchema = object({
7659
+ recordings: string().min(1).optional(),
7660
+ recordingsLow: string().min(1).optional(),
7661
+ eventMedia: string().min(1).optional()
7662
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
7663
+ /** Shared input for planning and starting an orchestrated storage migration. */
7664
+ var StorageMigrationInputSchema = object({
7665
+ destinations: StorageMigrationDestinationsSchema,
7666
+ throttleMbps: number().min(1).max(1e3).optional()
7667
+ });
7668
+ /** The durable coordinator state machine. The only phase that changes default
7669
+ * locations is `repointing`, after every selected mover has completed and been
7670
+ * verified. */
7671
+ var StorageMigrationPhaseSchema = _enum([
7672
+ "planning",
7673
+ "pausing",
7674
+ "moving",
7675
+ "verifying",
7676
+ "repointing",
7677
+ "refreshing",
7678
+ "resuming",
7679
+ "done",
7680
+ "failed",
7681
+ "cancelled"
7682
+ ]);
7683
+ var StorageMigrationParticipantSchema = _enum([
7684
+ "pipeline",
7685
+ "recorder",
7686
+ "analytics"
7687
+ ]);
7688
+ var StorageMigrationMoveSchema = object({
7689
+ storageClass: StorageMigrationClassSchema,
7690
+ fromLocationId: string(),
7691
+ toLocationId: string(),
7692
+ moverJobId: string().nullable(),
7693
+ state: RelocateJobStateSchema.nullable(),
7694
+ error: string().nullable()
7695
+ });
7696
+ var StorageMigrationJobSchema = object({
7697
+ jobId: string(),
7698
+ phase: StorageMigrationPhaseSchema,
7699
+ destinations: StorageMigrationDestinationsSchema,
7700
+ throttleMbps: number(),
7701
+ moves: array(StorageMigrationMoveSchema),
7702
+ pauseLeaseId: string().nullable(),
7703
+ pausedParticipants: array(StorageMigrationParticipantSchema),
7704
+ repointed: boolean(),
7705
+ cancelRequested: boolean(),
7706
+ startedAt: number(),
7707
+ updatedAt: number(),
7708
+ finishedAt: number().nullable(),
7709
+ error: string().nullable()
7710
+ });
7711
+ var StorageMigrationPlanSchema = object({
7712
+ destinations: StorageMigrationDestinationsSchema,
7713
+ moves: array(object({
7714
+ storageClass: StorageMigrationClassSchema,
7715
+ fromLocationId: string(),
7716
+ toLocationId: string()
7717
+ }))
7598
7718
  });
7599
7719
  /**
7600
7720
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -7646,6 +7766,21 @@ var StorageLocationSchema = object({
7646
7766
  nodeId: string().optional(),
7647
7767
  isDefault: boolean().default(false),
7648
7768
  isSystem: boolean().default(false),
7769
+ /**
7770
+ * Operator opt-in: whether consumers that BALANCE across several locations
7771
+ * of a type may write here. Recordings reads it today; event media and
7772
+ * backups are the next consumers, which is why the flag lives on the
7773
+ * location rather than in any one addon's store — nothing has to be
7774
+ * extended to add the next consumer.
7775
+ *
7776
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7777
+ * flag existed reads back with no flag and keeps working exactly as before;
7778
+ * that is the whole compat story, and it is why no migration ships with it.
7779
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7780
+ * disk must not silently start writing to it); the default of a type is
7781
+ * always stamped `true`.
7782
+ */
7783
+ enabled: boolean().optional(),
7649
7784
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7650
7785
  * for node-local locations it can reach) — never persisted, absent when the
7651
7786
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12003,7 +12138,8 @@ method(object({
12003
12138
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12004
12139
  /**
12005
12140
  * filesystem-browse — per-node capability for browsing the node's local
12006
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12141
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12142
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12007
12143
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12008
12144
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12009
12145
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -13816,6 +13952,13 @@ var MaskGridDimsSchema = object({
13816
13952
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
13817
13953
  * this one field keeps the schema additive — a rule still declares exactly
13818
13954
  * one trigger.
13955
+ *
13956
+ * AUDIO rules add no member here, for the reason occupancy added none: the
13957
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
13958
+ * mirror.ts` fails the build on a member the app cannot render) and every
13959
+ * member costs a release train. A sustained-sound rule is therefore an
13960
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
13961
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
13819
13962
  */
13820
13963
  var NcDeliverySchema = _enum([
13821
13964
  "immediate",
@@ -13830,15 +13973,32 @@ var NcDeliverySchema = _enum([
13830
13973
  * depend on a provider's raw event name or payload shape.
13831
13974
  */
13832
13975
  var NcSystemEventKindSchema = _enum([
13833
- "camera-online",
13834
- "camera-offline",
13976
+ "device-online",
13977
+ "device-offline",
13978
+ "device-disabled",
13979
+ "device-enabled",
13835
13980
  "stream-online",
13836
13981
  "stream-offline",
13837
13982
  "node-online",
13838
13983
  "node-offline",
13839
13984
  "addon-update-available",
13840
- "server-update-available"
13985
+ "server-update-available",
13986
+ "alarm-triggered",
13987
+ "alarm-armed",
13988
+ "alarm-disarmed",
13989
+ "camera-online",
13990
+ "camera-offline",
13991
+ "camera-disabled",
13992
+ "camera-enabled"
13993
+ ]);
13994
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
13995
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
13996
+ "camera-online",
13997
+ "camera-offline",
13998
+ "camera-disabled",
13999
+ "camera-enabled"
13841
14000
  ]);
14001
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
13842
14002
  /**
13843
14003
  * One coherent system-event condition. `kinds` is the required opt-in safety
13844
14004
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -13847,6 +14007,18 @@ var NcSystemEventKindSchema = _enum([
13847
14007
  var NcSystemEventConditionSchema = object({
13848
14008
  kinds: array(NcSystemEventKindSchema).min(1),
13849
14009
  deviceIds: array(number().int()).min(1).optional(),
14010
+ /**
14011
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14012
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14013
+ * is what a liveness rule means when nobody said otherwise.
14014
+ *
14015
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14016
+ * one reason: the intake cannot know which devices this household cares
14017
+ * about, and a producer-side filter is one no operator can change. Fails
14018
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14019
+ * does not carry) matches no `deviceTypes` list.
14020
+ */
14021
+ deviceTypes: array(string().min(1)).min(1).optional(),
13850
14022
  nodeIds: array(string().min(1)).min(1).optional(),
13851
14023
  packageNames: array(string().min(1)).min(1).optional()
13852
14024
  });
@@ -13897,6 +14069,47 @@ var NcOccupancyConditionSchema = object({
13897
14069
  sustainSeconds: number().int().min(0).max(3600).default(15)
13898
14070
  });
13899
14071
  /**
14072
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14073
+ *
14074
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14075
+ * reference notifier uses, so an operator moving between them re-uses what
14076
+ * they already know): a rule matches when, over a sampling window of
14077
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14078
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14079
+ *
14080
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14081
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14082
+ * - `labels` — the classifier put at least one of these labels on it.
14083
+ *
14084
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14085
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14086
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14087
+ * is given** — a window in which every sample is trivially a hit would fire on
14088
+ * silence, so the engine refuses such a condition rather than notifying on
14089
+ * nothing (the schema cannot express "at least one of" without becoming a
14090
+ * ZodEffects the cap path would have to special-case).
14091
+ *
14092
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14093
+ * must be FULL before it can match — a window that has been open for two
14094
+ * seconds of its ten is 100% of nothing, and firing on it would make
14095
+ * `samplingSeconds` decorative.
14096
+ *
14097
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14098
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14099
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14100
+ * an operator who typed `dog` mean the same thing.
14101
+ */
14102
+ var NcAudioConditionSchema = object({
14103
+ /** Audio macro labels; absent = any sound (level-only rule). */
14104
+ labels: array(string().min(1)).min(1).optional(),
14105
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14106
+ dbThreshold: number().min(-96).max(0).optional(),
14107
+ /** Percentage of the window's samples that must be hits (1–100). */
14108
+ hitPercent: number().int().min(1).max(100).default(60),
14109
+ /** Length of the sampling window in seconds. */
14110
+ samplingSeconds: number().int().min(1).max(300).default(10)
14111
+ });
14112
+ /**
13900
14113
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
13901
14114
  *
13902
14115
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14169,7 +14382,33 @@ var NcConditionsSchema = object({
14169
14382
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14170
14383
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14171
14384
  */
14172
- occupancy: NcOccupancyConditionSchema.optional()
14385
+ occupancy: NcOccupancyConditionSchema.optional(),
14386
+ /**
14387
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14388
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14389
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14390
+ * a window that is not full yet, neither filter given). See
14391
+ * {@link NcAudioCondition}.
14392
+ *
14393
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14394
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14395
+ * a detection, a track or a device event (the same fail-closed pairing
14396
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14397
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14398
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14399
+ * classified sample) stays exactly as it was for rules that already use it.
14400
+ *
14401
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14402
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14403
+ * (`camstack/src/data/notification-center.ts`, guarded by
14404
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14405
+ * condition fields it does not know when a rule is saved from the phone.
14406
+ * Publishing an editor for a condition the app cannot round-trip is how an
14407
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14408
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14409
+ * does an audio rule become authorable.
14410
+ */
14411
+ audio: NcAudioConditionSchema.optional()
14173
14412
  });
14174
14413
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14175
14414
  var NcRuleTargetSchema = object({
@@ -14283,6 +14522,73 @@ var NcThrottleSchema = object({
14283
14522
  */
14284
14523
  granularity: NcThrottleGranularitySchema.optional()
14285
14524
  });
14525
+ /**
14526
+ * How long the confirm gate may hold ONE notification, and how big the picture
14527
+ * it judges may be.
14528
+ *
14529
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14530
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14531
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14532
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14533
+ * tokens for pixels the model pools away.
14534
+ */
14535
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14536
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14537
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14538
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14539
+ var NcConfirmExpectSchema = object({
14540
+ op: _enum([
14541
+ ">=",
14542
+ ">",
14543
+ "<=",
14544
+ "<",
14545
+ "=="
14546
+ ]),
14547
+ count: number().int().min(0).max(1e3)
14548
+ });
14549
+ /**
14550
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14551
+ * to ship and says whether it agrees with the rule.
14552
+ *
14553
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14554
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14555
+ * on the operator's phone is not a verdict about this notification.
14556
+ *
14557
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14558
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14559
+ * the default and every fail-open is COUNTED, because a gate that always fails
14560
+ * open looks in the log exactly like a gate that works.
14561
+ *
14562
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14563
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14564
+ * production failures in one day), so the gate reads absent as the constant
14565
+ * above rather than trusting a parse it may never have seen.
14566
+ */
14567
+ var NcConfirmSchema = object({
14568
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14569
+ * same thing, and both mean "deliver exactly as before". */
14570
+ enabled: boolean().default(false),
14571
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14572
+ profileId: string().optional(),
14573
+ /**
14574
+ * The operator's question, in his own words. Absent = a question derived
14575
+ * from the rule (its class and its expectation).
14576
+ *
14577
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14578
+ * banners, signage and plates as instructions if you let them reach the
14579
+ * prompt — proven live — so the authoritative contract stays in the system
14580
+ * turn and only rule-authored words land here.
14581
+ */
14582
+ prompt: string().max(1e3).optional(),
14583
+ /** Fire only when the model's count satisfies this. Absent = the model's
14584
+ * own boolean verdict decides. */
14585
+ expect: NcConfirmExpectSchema.optional(),
14586
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14587
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14588
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14589
+ /** Longest edge the judged image is downscaled to before it is sent. */
14590
+ maxImagePx: number().int().min(64).max(2048).default(448)
14591
+ });
14286
14592
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14287
14593
  var NcRuleInputSchema = object({
14288
14594
  name: string().min(1).max(200),
@@ -14343,7 +14649,13 @@ var NcRuleInputSchema = object({
14343
14649
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14344
14650
  * shape as every other actuation.
14345
14651
  */
14346
- actions: NcRuleActionsSchema.optional()
14652
+ actions: NcRuleActionsSchema.optional(),
14653
+ /**
14654
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14655
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14656
+ * did, and absent is the only way to say that without a migration.
14657
+ */
14658
+ confirm: NcConfirmSchema.optional()
14347
14659
  });
14348
14660
  /**
14349
14661
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14354,7 +14666,37 @@ var NcRuleInputSchema = object({
14354
14666
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14355
14667
  * `updateRule` patch.
14356
14668
  */
14357
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
14669
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14670
+ disabledTargetIds: array(string()).optional(),
14671
+ /**
14672
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14673
+ *
14674
+ * It makes the key optional to SUPPLY; the parse still materialises the
14675
+ * default when the key is absent. And `NcRuleStore.update` merges with
14676
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14677
+ * one — which made every partial edit destructive:
14678
+ *
14679
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14680
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14681
+ * setEnabled(ruleId, false) → conditions reset to `{}`
14682
+ *
14683
+ * A rule scoped to one camera and one zone silently became a rule that
14684
+ * matches EVERY event on EVERY camera, and lost its `media` policy
14685
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
14686
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
14687
+ * within a minute of a two-field patch.
14688
+ *
14689
+ * So every defaulted field is re-declared here WITHOUT its default. The
14690
+ * inner defaults still apply when the caller DOES send the key — `{}` for
14691
+ * conditions remains a real instruction ("clear them") — and only the
14692
+ * absent key is now genuinely absent.
14693
+ */
14694
+ enabled: boolean().optional(),
14695
+ conditions: NcConditionsSchema.optional(),
14696
+ media: NcMediaPolicySchema.optional(),
14697
+ throttle: NcThrottleSchema.optional(),
14698
+ priority: number().int().min(1).max(5).optional()
14699
+ });
14358
14700
  /** A persisted rule. */
14359
14701
  var NcRuleSchema = NcRuleInputSchema.extend({
14360
14702
  id: string(),
@@ -14655,6 +14997,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14655
14997
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14656
14998
  * copy would lie the first time a rule is disabled.
14657
14999
  */
15000
+ /**
15001
+ * Why a device a mode NAMES is nonetheless not armed by it.
15002
+ *
15003
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15004
+ * per-camera notification switch the Notification Center already owns,
15005
+ * `detection-off` is the device's own detection binding being inactive, and
15006
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15007
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15008
+ * with the switches the operator actually used.
15009
+ */
15010
+ var NcAlarmSkipReasonSchema = _enum([
15011
+ "muted",
15012
+ "detection-off",
15013
+ "offline"
15014
+ ]);
15015
+ var NcAlarmSkippedDeviceSchema = object({
15016
+ deviceId: number().int(),
15017
+ reason: NcAlarmSkipReasonSchema
15018
+ });
14658
15019
  var NcAlarmModeCoverageSchema = object({
14659
15020
  mode: AlarmArmModeSchema,
14660
15021
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14662,7 +15023,18 @@ var NcAlarmModeCoverageSchema = object({
14662
15023
  /** At least one covering rule has no device scope, so the mode covers all. */
14663
15024
  allDevices: boolean(),
14664
15025
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14665
- deviceIds: array(number().int())
15026
+ deviceIds: array(number().int()),
15027
+ /**
15028
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15029
+ * excludes it.
15030
+ *
15031
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15032
+ * twelve makes it false in exactly the way nobody notices until an incident.
15033
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15034
+ * still parses as "nothing known to be skipped" rather than failing the whole
15035
+ * alarm tab.
15036
+ */
15037
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
14666
15038
  });
14667
15039
  var NcAlarmConfigSchema = object({
14668
15040
  /**
@@ -16025,13 +16397,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16025
16397
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16026
16398
  kind: "mutation",
16027
16399
  auth: "admin"
16028
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
16400
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
16029
16401
  kind: "mutation",
16030
16402
  auth: "admin"
16031
- }), method(object({}), array(RelocateJobSchema).readonly(), {
16032
- kind: "query",
16403
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
16404
+ kind: "mutation",
16033
16405
  auth: "admin"
16034
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16406
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
16407
+ kind: "mutation",
16408
+ auth: "admin"
16409
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
16410
+ kind: "mutation",
16411
+ auth: "admin"
16412
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16035
16413
  kind: "mutation",
16036
16414
  auth: "admin"
16037
16415
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -17455,9 +17833,16 @@ var CameraStatusSchema = object({
17455
17833
  audio: CameraAudioStatusSchema.nullable(),
17456
17834
  recording: CameraRecordingStatusSchema.nullable(),
17457
17835
  /**
17458
- * Per-camera function switches an OPERATOR has turned off
17836
+ * Per-camera functions an OPERATOR has turned off
17459
17837
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17460
17838
  *
17839
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
17840
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
17841
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
17842
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
17843
+ * The badge outlives the control panel: the panel was a convenience, this is
17844
+ * the difference between a camera being off and a camera being dead.
17845
+ *
17461
17846
  * This is the difference between DISABLED and BROKEN. A camera whose
17462
17847
  * `detection` block reports zero fps and whose `switchedOff` contains
17463
17848
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -17528,7 +17913,13 @@ var NodeInferenceDevicesSchema = object({
17528
17913
  reachable: boolean(),
17529
17914
  devices: array(NodeInferenceDeviceSchema).readonly()
17530
17915
  });
17531
- method(object({
17916
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
17917
+ kind: "mutation",
17918
+ auth: "admin"
17919
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
17920
+ kind: "mutation",
17921
+ auth: "admin"
17922
+ }), method(object({
17532
17923
  deviceId: number(),
17533
17924
  agentNodeId: string()
17534
17925
  }), object({ success: literal(true) }), {
@@ -18058,24 +18449,28 @@ var snapshotCapability = {
18058
18449
  *
18059
18450
  * `getSnapshotOverview` is cache-only by contract: it answers from whatever
18060
18451
  * the wrapper happens to hold and never captures. Under D93 the client
18061
- * versions its image URL on that answer, and an image REQUEST is what enrols
18062
- * a camera in the keep-warm loop. Both of those are satisfiable by the
18063
- * client's own image cache — `expo-image` is URL-keyed and never revalidates
18064
- * — so a URL painted in a previous session comes off disk with no network,
18065
- * no enrolment, and nothing warming. Measured on the live hub: reopening
18066
- * after two minutes idle painted 15 of 16 tiles at **168 s old** with zero
18067
- * HTTP requests, and the fleet only recovered because a later poll happened
18068
- * to observe a different identity.
18452
+ * versions its image URL on that answer, and an image REQUEST was the only
18453
+ * demand signal. Both of those are satisfiable by the client's own image
18454
+ * cache — `expo-image` is URL-keyed and never revalidates — so a URL painted
18455
+ * in a previous session comes off disk with no network, no demand, and no
18456
+ * capture. Measured on the live hub: reopening after two minutes idle
18457
+ * painted 15 of 16 tiles at **168 s old** with zero HTTP requests, and the
18458
+ * fleet only recovered because a later poll happened to observe a different
18459
+ * identity.
18069
18460
  *
18070
18461
  * ## The two properties that fix it
18071
18462
  *
18072
18463
  * **It is an RPC, so no client cache can answer it.** The demand signal
18073
- * always reaches the wrapper. This method therefore MAY create keep-warm
18074
- * subscriptions, where `getSnapshotOverview` must never (D93) — the
18075
- * distinction is not "one is newer" but that the overview poll is app-wide
18076
- * (a creating overview would warm every camera on the install) while this is
18077
- * called by a rendered surface naming the tiles it is actually painting, at
18078
- * the width it is painting them.
18464
+ * always reaches the wrapper. This method therefore CAPTURES, where
18465
+ * `getSnapshotOverview` must never (D93) — the distinction is not "one is
18466
+ * newer" but that the overview poll is app-wide (a capturing overview would
18467
+ * dial every camera on the install) while this is called by a rendered
18468
+ * surface naming the tiles it is actually painting, at the width it is
18469
+ * painting them.
18470
+ *
18471
+ * Since 2026-08-11 this is the ONLY thing that refreshes a snapshot: the
18472
+ * server-side keep-warm loop was removed (operator directive — on-demand,
18473
+ * always), so a camera nobody is looking at costs nothing at all.
18079
18474
  *
18080
18475
  * **It waits, briefly and boundedly, for the capture it triggered.** The
18081
18476
  * returned `capturedAt` is the frame the link will serve, not the frame the
@@ -18293,6 +18688,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
18293
18688
  locationId: string(),
18294
18689
  targetBytes: number().int().positive()
18295
18690
  }), EvictResultSchema, { kind: "mutation" });
18691
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
18692
+ kind: "mutation",
18693
+ auth: "admin"
18694
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
18695
+ kind: "mutation",
18696
+ auth: "admin"
18697
+ });
18296
18698
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
18297
18699
  providerId: string().min(1),
18298
18700
  displayName: string().min(1),
@@ -18396,6 +18798,28 @@ var TerminalProfileInfoSchema = object({
18396
18798
  label: string(),
18397
18799
  description: string().optional()
18398
18800
  });
18801
+ /**
18802
+ * A durable operator-created Terminal instance. Profiles are templates; only
18803
+ * an instance declares a camera.
18804
+ */
18805
+ var TerminalInstanceInfoSchema = object({
18806
+ instanceId: string(),
18807
+ cameraStableId: string(),
18808
+ nodeId: string(),
18809
+ profileId: string(),
18810
+ profileLabel: string(),
18811
+ name: string(),
18812
+ enabled: boolean()
18813
+ });
18814
+ var TerminalLegacyCameraSchema = object({
18815
+ stableId: string(),
18816
+ nodeId: string(),
18817
+ profileId: string(),
18818
+ profileLabel: string(),
18819
+ name: string(),
18820
+ /** Only legacy monitor cameras can retain their historic stable identity. */
18821
+ adoptable: boolean()
18822
+ });
18399
18823
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
18400
18824
  seq: number().int().positive(),
18401
18825
  kind: literal("data"),
@@ -18412,7 +18836,29 @@ var TerminalOutputBatchSchema = object({
18412
18836
  snapshot: string().optional(),
18413
18837
  events: array(TerminalOutputEventSchema).readonly()
18414
18838
  });
18415
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18839
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
18840
+ targetNodeId: string().min(1),
18841
+ profileId: string().min(1),
18842
+ name: string().trim().min(1).max(160).optional()
18843
+ }), TerminalInstanceInfoSchema, {
18844
+ kind: "mutation",
18845
+ auth: "admin"
18846
+ }), method(object({ instanceId: string().min(1) }), _void(), {
18847
+ kind: "mutation",
18848
+ auth: "admin"
18849
+ }), method(object({
18850
+ instanceId: string().min(1),
18851
+ enabled: boolean()
18852
+ }), TerminalInstanceInfoSchema, {
18853
+ kind: "mutation",
18854
+ auth: "admin"
18855
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
18856
+ stableId: string().min(1),
18857
+ name: string().trim().min(1).max(160).optional()
18858
+ }), TerminalInstanceInfoSchema, {
18859
+ kind: "mutation",
18860
+ auth: "admin"
18861
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18416
18862
  profileId: string(),
18417
18863
  cols: number().int().positive(),
18418
18864
  rows: number().int().positive()
@@ -18429,7 +18875,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
18429
18875
  }), method(object({
18430
18876
  sessionId: string(),
18431
18877
  afterSeq: number().int().nonnegative(),
18432
- waitMs: number().int().min(0).max(2e3).default(0)
18878
+ waitMs: number().int().min(0).max(2e3).default(0),
18879
+ /**
18880
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
18881
+ * browser's initial repaint remains immediate; the camera snapshot
18882
+ * relay uses it to avoid encoding a blank startup frame.
18883
+ */
18884
+ waitForOutput: boolean().optional()
18433
18885
  }), TerminalOutputBatchSchema, {
18434
18886
  kind: "mutation",
18435
18887
  auth: "admin",
@@ -20370,6 +20822,7 @@ var FaceInfoSchema = object({
20370
20822
  var FaceFilterEnum = _enum([
20371
20823
  "unassigned",
20372
20824
  "recognized",
20825
+ "identified",
20373
20826
  "all"
20374
20827
  ]);
20375
20828
  var MediaFileLiteSchema$1 = object({
@@ -20398,6 +20851,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string(
20398
20851
  kind: "mutation",
20399
20852
  auth: "admin"
20400
20853
  }), method(object({
20854
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
20855
+ deviceId: number().int().optional(),
20401
20856
  limit: number().int().positive().optional(),
20402
20857
  filter: FaceFilterEnum.optional(),
20403
20858
  /**
@@ -22163,6 +22618,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
22163
22618
  capName: string().min(1).max(64),
22164
22619
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
22165
22620
  valuePath: string().min(1).max(64)
22621
+ }),
22622
+ object({
22623
+ kind: literal("latest-recognition"),
22624
+ recognition: _enum(["person", "plate"])
22166
22625
  })
22167
22626
  ]);
22168
22627
  var OsdSlotBindingSchema = object({
@@ -22268,6 +22727,15 @@ method(object({ deviceId: number().int() }), object({
22268
22727
  }), object({ success: literal(true) }), {
22269
22728
  kind: "mutation",
22270
22729
  auth: "admin"
22730
+ }), method(object({
22731
+ sourceDeviceId: number().int(),
22732
+ targetDeviceId: number().int()
22733
+ }), object({
22734
+ copied: number().int().nonnegative(),
22735
+ skipped: number().int().nonnegative()
22736
+ }), {
22737
+ kind: "mutation",
22738
+ auth: "admin"
22271
22739
  }), method(object({
22272
22740
  deviceId: number().int(),
22273
22741
  slotId: string().min(1),
@@ -23020,7 +23488,19 @@ var RecordingManifestSchema = object({
23020
23488
  * profiles/subtrees/locations on this node). */
23021
23489
  var RecordingDeviceUsageSchema = object({
23022
23490
  deviceId: number(),
23023
- usedBytes: number()
23491
+ usedBytes: number(),
23492
+ /**
23493
+ * Start of this camera's OLDEST indexed segment, across every profile and
23494
+ * location — the "Oldest footage" column in Recordings → Storage, and the
23495
+ * only honest answer to "is retention actually holding?" per camera.
23496
+ *
23497
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
23498
+ * predates this field omits it entirely, and a hub whose types carry the
23499
+ * field must keep validating that older provider's payload: the framework
23500
+ * (types) and the addon ship on different trains, and the addon is usually
23501
+ * the later of the two.
23502
+ */
23503
+ oldestMs: number().nullable().optional()
23024
23504
  });
23025
23505
  /** Recording storage usage + capacity for one storage location. */
23026
23506
  var RecordingLocationUsageSchema = object({
@@ -23048,6 +23528,57 @@ var RecordingStorageUsageSchema = object({
23048
23528
  locations: array(RecordingLocationUsageSchema)
23049
23529
  });
23050
23530
  /**
23531
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
23532
+ *
23533
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
23534
+ * is the operator asking for the EXISTING archive to be brought into line with
23535
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
23536
+ * location, run FIFO behind the single-flight mover.
23537
+ *
23538
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
23539
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
23540
+ * (empty on the plan).
23541
+ */
23542
+ var RecordingRebalanceMoveSchema = object({
23543
+ deviceId: number(),
23544
+ profile: string(),
23545
+ fromLocationId: string(),
23546
+ toLocationId: string(),
23547
+ bytes: number(),
23548
+ files: number().int()
23549
+ });
23550
+ /** Why a pile that is out of place is staying there. Every refusal is
23551
+ * reported: a rebalance that silently drops a camera reads exactly like one
23552
+ * that had nothing to do. */
23553
+ var RecordingRebalanceSkipReasonSchema = _enum([
23554
+ "unassigned",
23555
+ "target-not-writable",
23556
+ "below-threshold",
23557
+ "no-headroom"
23558
+ ]);
23559
+ var RecordingRebalanceSkipSchema = object({
23560
+ deviceId: number(),
23561
+ profile: string(),
23562
+ fromLocationId: string(),
23563
+ /** The location the plan wants; null when the camera has no assignment. */
23564
+ toLocationId: string().nullable(),
23565
+ bytes: number(),
23566
+ reason: RecordingRebalanceSkipReasonSchema
23567
+ });
23568
+ var RecordingRebalancePlanSchema = object({
23569
+ moves: array(RecordingRebalanceMoveSchema),
23570
+ skipped: array(RecordingRebalanceSkipSchema),
23571
+ bytesToMove: number(),
23572
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
23573
+ jobIds: array(string())
23574
+ });
23575
+ var RecordingRebalanceInputSchema = object({
23576
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
23577
+ throttleMbps: number().min(1).max(1e3).optional(),
23578
+ /** Ignore piles smaller than this (default 1 GB). */
23579
+ minMoveGb: number().min(0).optional()
23580
+ });
23581
+ /**
23051
23582
  * Result of locating footage at a wall-clock instant for one device/profile.
23052
23583
  * `segment` carries the covering segment's window; `gap` reports the forward
23053
23584
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -23195,6 +23726,21 @@ method(object({
23195
23726
  }), {
23196
23727
  kind: "mutation",
23197
23728
  auth: "admin"
23729
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
23730
+ kind: "mutation",
23731
+ auth: "admin"
23732
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
23733
+ kind: "mutation",
23734
+ auth: "admin"
23735
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
23736
+ kind: "mutation",
23737
+ auth: "admin"
23738
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
23739
+ kind: "mutation",
23740
+ auth: "admin"
23741
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23742
+ kind: "mutation",
23743
+ auth: "admin"
23198
23744
  }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
23199
23745
  kind: "mutation",
23200
23746
  auth: "admin"
@@ -23204,9 +23750,15 @@ method(object({
23204
23750
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23205
23751
  kind: "mutation",
23206
23752
  auth: "admin"
23753
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23754
+ kind: "query",
23755
+ auth: "admin"
23756
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23757
+ kind: "mutation",
23758
+ auth: "admin"
23207
23759
  });
23208
23760
  /**
23209
- * `recordingExport` cap — render a footage time range into a single downloadable
23761
+ * `recording-export` cap — render a footage time range into a single downloadable
23210
23762
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
23211
23763
  * bounded lifetime with a durable history, auto-expiry, and optional
23212
23764
  * delete-after-download.
@@ -23221,10 +23773,42 @@ method(object({
23221
23773
  */
23222
23774
  /** Playback-speed multiplier for the render (1 = realtime). */
23223
23775
  var ExportSpeedSchema = number().min(.25).max(32);
23776
+ /**
23777
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23778
+ *
23779
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
23780
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23781
+ * playlist. Handing it absolute epochs would make every call site responsible
23782
+ * for the same subtraction, and the one that forgot would emit a filter that
23783
+ * selects nothing — silently, as a uniform timelapse.
23784
+ */
23785
+ var ExportDenseRangeSchema = object({
23786
+ fromSec: number().nonnegative(),
23787
+ toSec: number().nonnegative()
23788
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
23789
+ /**
23790
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
23791
+ * listed ranges and at the base `everyMs` everywhere else.
23792
+ *
23793
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
23794
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
23795
+ */
23796
+ var ExportDenseSchema = object({
23797
+ everyMs: number().int().positive(),
23798
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
23799
+ });
23224
23800
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
23225
23801
  var ExportTimelapseSchema = object({
23226
23802
  everyMs: number().int().positive(),
23227
- outputFps: number().int().min(1).max(60).optional()
23803
+ outputFps: number().int().min(1).max(60).optional(),
23804
+ /** Optional second, FASTER rate over the intervals that matter. */
23805
+ dense: ExportDenseSchema.optional()
23806
+ }).superRefine((v, ctx) => {
23807
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
23808
+ code: ZodIssueCode.custom,
23809
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
23810
+ path: ["dense", "everyMs"]
23811
+ });
23228
23812
  });
23229
23813
  /**
23230
23814
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -23282,6 +23866,19 @@ var ExportDownloadSchema = object({
23282
23866
  url: string(),
23283
23867
  endpoints: array(string())
23284
23868
  });
23869
+ /**
23870
+ * A finished export's bytes, inline.
23871
+ *
23872
+ * `bytes` is the DECODED length — the number the caller bounds and logs
23873
+ * against, so nobody has to infer it from the base64 length.
23874
+ */
23875
+ var ExportBytesSchema = object({
23876
+ base64: string(),
23877
+ contentType: string(),
23878
+ /** Suggested filename, extension included. */
23879
+ name: string(),
23880
+ bytes: number().int().nonnegative()
23881
+ });
23285
23882
  method(object({
23286
23883
  deviceId: number(),
23287
23884
  profile: string(),
@@ -23306,6 +23903,9 @@ method(object({
23306
23903
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
23307
23904
  kind: "query",
23308
23905
  auth: "protected"
23906
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
23907
+ kind: "query",
23908
+ auth: "protected"
23309
23909
  });
23310
23910
  /**
23311
23911
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -27732,6 +28332,12 @@ Object.freeze({
27732
28332
  addonId: null,
27733
28333
  access: "delete"
27734
28334
  },
28335
+ "osdManager.copyDeviceConfiguration": {
28336
+ capName: "osd-manager",
28337
+ capScope: "system",
28338
+ addonId: null,
28339
+ access: "create"
28340
+ },
27735
28341
  "osdManager.getConditionSupport": {
27736
28342
  capName: "osd-manager",
27737
28343
  capScope: "system",
@@ -27828,7 +28434,7 @@ Object.freeze({
27828
28434
  addonId: null,
27829
28435
  access: "create"
27830
28436
  },
27831
- "pipelineAnalytics.cancelMediaRelocate": {
28437
+ "pipelineAnalytics.cancelStorageMigrationMove": {
27832
28438
  capName: "pipeline-analytics",
27833
28439
  capScope: "device",
27834
28440
  addonId: null,
@@ -27900,12 +28506,6 @@ Object.freeze({
27900
28506
  addonId: null,
27901
28507
  access: "view"
27902
28508
  },
27903
- "pipelineAnalytics.getMediaRelocateStatus": {
27904
- capName: "pipeline-analytics",
27905
- capScope: "device",
27906
- addonId: null,
27907
- access: "view"
27908
- },
27909
28509
  "pipelineAnalytics.getMotionEvents": {
27910
28510
  capName: "pipeline-analytics",
27911
28511
  capScope: "device",
@@ -27942,6 +28542,12 @@ Object.freeze({
27942
28542
  addonId: null,
27943
28543
  access: "view"
27944
28544
  },
28545
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
28546
+ capName: "pipeline-analytics",
28547
+ capScope: "device",
28548
+ addonId: null,
28549
+ access: "view"
28550
+ },
27945
28551
  "pipelineAnalytics.getTrack": {
27946
28552
  capName: "pipeline-analytics",
27947
28553
  capScope: "device",
@@ -28020,6 +28626,12 @@ Object.freeze({
28020
28626
  addonId: null,
28021
28627
  access: "view"
28022
28628
  },
28629
+ "pipelineAnalytics.pauseForStorageMigration": {
28630
+ capName: "pipeline-analytics",
28631
+ capScope: "device",
28632
+ addonId: null,
28633
+ access: "create"
28634
+ },
28023
28635
  "pipelineAnalytics.proposeRetrainAnnotations": {
28024
28636
  capName: "pipeline-analytics",
28025
28637
  capScope: "device",
@@ -28050,7 +28662,7 @@ Object.freeze({
28050
28662
  addonId: null,
28051
28663
  access: "create"
28052
28664
  },
28053
- "pipelineAnalytics.relocateMedia": {
28665
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
28054
28666
  capName: "pipeline-analytics",
28055
28667
  capScope: "device",
28056
28668
  addonId: null,
@@ -28062,6 +28674,12 @@ Object.freeze({
28062
28674
  addonId: null,
28063
28675
  access: "create"
28064
28676
  },
28677
+ "pipelineAnalytics.resumeForStorageMigration": {
28678
+ capName: "pipeline-analytics",
28679
+ capScope: "device",
28680
+ addonId: null,
28681
+ access: "create"
28682
+ },
28065
28683
  "pipelineAnalytics.saveRetrainAnnotations": {
28066
28684
  capName: "pipeline-analytics",
28067
28685
  capScope: "device",
@@ -28086,6 +28704,12 @@ Object.freeze({
28086
28704
  addonId: null,
28087
28705
  access: "create"
28088
28706
  },
28707
+ "pipelineAnalytics.startStorageMigrationMove": {
28708
+ capName: "pipeline-analytics",
28709
+ capScope: "device",
28710
+ addonId: null,
28711
+ access: "create"
28712
+ },
28089
28713
  "pipelineAnalytics.wipeAllAnalytics": {
28090
28714
  capName: "pipeline-analytics",
28091
28715
  capScope: "device",
@@ -28452,6 +29076,12 @@ Object.freeze({
28452
29076
  addonId: null,
28453
29077
  access: "view"
28454
29078
  },
29079
+ "pipelineOrchestrator.pauseForStorageMigration": {
29080
+ capName: "pipeline-orchestrator",
29081
+ capScope: "system",
29082
+ addonId: null,
29083
+ access: "create"
29084
+ },
28455
29085
  "pipelineOrchestrator.rebalance": {
28456
29086
  capName: "pipeline-orchestrator",
28457
29087
  capScope: "system",
@@ -28476,6 +29106,12 @@ Object.freeze({
28476
29106
  addonId: null,
28477
29107
  access: "view"
28478
29108
  },
29109
+ "pipelineOrchestrator.resumeForStorageMigration": {
29110
+ capName: "pipeline-orchestrator",
29111
+ capScope: "system",
29112
+ addonId: null,
29113
+ access: "create"
29114
+ },
28479
29115
  "pipelineOrchestrator.saveTemplate": {
28480
29116
  capName: "pipeline-orchestrator",
28481
29117
  capScope: "system",
@@ -28872,7 +29508,13 @@ Object.freeze({
28872
29508
  addonId: null,
28873
29509
  access: "create"
28874
29510
  },
28875
- "recording.cancelRelocate": {
29511
+ "recording.cancelRelocateJob": {
29512
+ capName: "recording",
29513
+ capScope: "system",
29514
+ addonId: null,
29515
+ access: "create"
29516
+ },
29517
+ "recording.cancelStorageMigrationMove": {
28876
29518
  capName: "recording",
28877
29519
  capScope: "system",
28878
29520
  addonId: null,
@@ -28908,7 +29550,7 @@ Object.freeze({
28908
29550
  addonId: null,
28909
29551
  access: "view"
28910
29552
  },
28911
- "recording.getRelocateStatus": {
29553
+ "recording.getStorageMigrationMoveStatus": {
28912
29554
  capName: "recording",
28913
29555
  capScope: "system",
28914
29556
  addonId: null,
@@ -28926,12 +29568,30 @@ Object.freeze({
28926
29568
  addonId: null,
28927
29569
  access: "view"
28928
29570
  },
29571
+ "recording.listRelocateJobs": {
29572
+ capName: "recording",
29573
+ capScope: "system",
29574
+ addonId: null,
29575
+ access: "view"
29576
+ },
28929
29577
  "recording.locateSegment": {
28930
29578
  capName: "recording",
28931
29579
  capScope: "system",
28932
29580
  addonId: null,
28933
29581
  access: "view"
28934
29582
  },
29583
+ "recording.pauseForStorageMigration": {
29584
+ capName: "recording",
29585
+ capScope: "system",
29586
+ addonId: null,
29587
+ access: "create"
29588
+ },
29589
+ "recording.planStorageRebalance": {
29590
+ capName: "recording",
29591
+ capScope: "system",
29592
+ addonId: null,
29593
+ access: "view"
29594
+ },
28935
29595
  "recording.pruneFootage": {
28936
29596
  capName: "recording",
28937
29597
  capScope: "system",
@@ -28950,6 +29610,12 @@ Object.freeze({
28950
29610
  addonId: null,
28951
29611
  access: "view"
28952
29612
  },
29613
+ "recording.refreshStorageLocationsForMigration": {
29614
+ capName: "recording",
29615
+ capScope: "system",
29616
+ addonId: null,
29617
+ access: "create"
29618
+ },
28953
29619
  "recording.relocateFootage": {
28954
29620
  capName: "recording",
28955
29621
  capScope: "system",
@@ -28974,44 +29640,68 @@ Object.freeze({
28974
29640
  addonId: null,
28975
29641
  access: "create"
28976
29642
  },
29643
+ "recording.resumeForStorageMigration": {
29644
+ capName: "recording",
29645
+ capScope: "system",
29646
+ addonId: null,
29647
+ access: "create"
29648
+ },
28977
29649
  "recording.setDeviceConfig": {
28978
29650
  capName: "recording",
28979
29651
  capScope: "system",
28980
29652
  addonId: null,
28981
29653
  access: "create"
28982
29654
  },
29655
+ "recording.startStorageMigrationMove": {
29656
+ capName: "recording",
29657
+ capScope: "system",
29658
+ addonId: null,
29659
+ access: "create"
29660
+ },
29661
+ "recording.startStorageRebalance": {
29662
+ capName: "recording",
29663
+ capScope: "system",
29664
+ addonId: null,
29665
+ access: "create"
29666
+ },
28983
29667
  "recordingExport.cancelExport": {
28984
- capName: "recordingExport",
29668
+ capName: "recording-export",
28985
29669
  capScope: "system",
28986
29670
  addonId: null,
28987
29671
  access: "create"
28988
29672
  },
28989
29673
  "recordingExport.createExport": {
28990
- capName: "recordingExport",
29674
+ capName: "recording-export",
28991
29675
  capScope: "system",
28992
29676
  addonId: null,
28993
29677
  access: "create"
28994
29678
  },
28995
29679
  "recordingExport.deleteExport": {
28996
- capName: "recordingExport",
29680
+ capName: "recording-export",
28997
29681
  capScope: "system",
28998
29682
  addonId: null,
28999
29683
  access: "delete"
29000
29684
  },
29001
29685
  "recordingExport.getDownloadUrl": {
29002
- capName: "recordingExport",
29686
+ capName: "recording-export",
29003
29687
  capScope: "system",
29004
29688
  addonId: null,
29005
29689
  access: "view"
29006
29690
  },
29007
29691
  "recordingExport.getExport": {
29008
- capName: "recordingExport",
29692
+ capName: "recording-export",
29009
29693
  capScope: "system",
29010
29694
  addonId: null,
29011
29695
  access: "view"
29012
29696
  },
29013
29697
  "recordingExport.listExports": {
29014
- capName: "recordingExport",
29698
+ capName: "recording-export",
29699
+ capScope: "system",
29700
+ addonId: null,
29701
+ access: "view"
29702
+ },
29703
+ "recordingExport.readExportBytes": {
29704
+ capName: "recording-export",
29015
29705
  capScope: "system",
29016
29706
  addonId: null,
29017
29707
  access: "view"
@@ -29370,6 +30060,30 @@ Object.freeze({
29370
30060
  addonId: null,
29371
30061
  access: "view"
29372
30062
  },
30063
+ "storageMigration.cancel": {
30064
+ capName: "storage-migration",
30065
+ capScope: "system",
30066
+ addonId: null,
30067
+ access: "create"
30068
+ },
30069
+ "storageMigration.plan": {
30070
+ capName: "storage-migration",
30071
+ capScope: "system",
30072
+ addonId: null,
30073
+ access: "view"
30074
+ },
30075
+ "storageMigration.start": {
30076
+ capName: "storage-migration",
30077
+ capScope: "system",
30078
+ addonId: null,
30079
+ access: "create"
30080
+ },
30081
+ "storageMigration.status": {
30082
+ capName: "storage-migration",
30083
+ capScope: "system",
30084
+ addonId: null,
30085
+ access: "view"
30086
+ },
29373
30087
  "storageProvider.abortUpload": {
29374
30088
  capName: "storage-provider",
29375
30089
  capScope: "system",
@@ -29748,12 +30462,42 @@ Object.freeze({
29748
30462
  addonId: null,
29749
30463
  access: "create"
29750
30464
  },
30465
+ "terminalSession.adoptLegacyMonitor": {
30466
+ capName: "terminal-session",
30467
+ capScope: "system",
30468
+ addonId: null,
30469
+ access: "create"
30470
+ },
29751
30471
  "terminalSession.close": {
29752
30472
  capName: "terminal-session",
29753
30473
  capScope: "system",
29754
30474
  addonId: null,
29755
30475
  access: "create"
29756
30476
  },
30477
+ "terminalSession.createInstance": {
30478
+ capName: "terminal-session",
30479
+ capScope: "system",
30480
+ addonId: null,
30481
+ access: "create"
30482
+ },
30483
+ "terminalSession.deleteInstance": {
30484
+ capName: "terminal-session",
30485
+ capScope: "system",
30486
+ addonId: null,
30487
+ access: "delete"
30488
+ },
30489
+ "terminalSession.listInstances": {
30490
+ capName: "terminal-session",
30491
+ capScope: "system",
30492
+ addonId: null,
30493
+ access: "view"
30494
+ },
30495
+ "terminalSession.listLegacyCameras": {
30496
+ capName: "terminal-session",
30497
+ capScope: "system",
30498
+ addonId: null,
30499
+ access: "view"
30500
+ },
29757
30501
  "terminalSession.listProfiles": {
29758
30502
  capName: "terminal-session",
29759
30503
  capScope: "system",
@@ -29784,6 +30528,12 @@ Object.freeze({
29784
30528
  addonId: null,
29785
30529
  access: "create"
29786
30530
  },
30531
+ "terminalSession.setInstanceEnabled": {
30532
+ capName: "terminal-session",
30533
+ capScope: "system",
30534
+ addonId: null,
30535
+ access: "create"
30536
+ },
29787
30537
  "terminalSession.writeInput": {
29788
30538
  capName: "terminal-session",
29789
30539
  capScope: "system",
@@ -30328,6 +31078,104 @@ var FramerateField = number().int().min(1).max(60);
30328
31078
  var TargetsField = array(NcRuleTargetSchema).min(1);
30329
31079
  var PriorityField = number().int().min(1).max(5);
30330
31080
  /**
31081
+ * Explicit override of the DENSE sampling cadence, seconds.
31082
+ *
31083
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
31084
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
31085
+ * made that same base 3 s and rendered a person pass as two frames.)
31086
+ *
31087
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
31088
+ * `denseCadenceSec` and played at `framerate` occupies
31089
+ *
31090
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
31091
+ *
31092
+ * 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.
31093
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
31094
+ * and therefore the length of a quiet night, does not move.
31095
+ *
31096
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
31097
+ * the recording has them returns the same frames, requested twice. Must be
31098
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
31099
+ * a uniform video the operator believes is two-rate — and upsert refuses it
31100
+ * rather than letting the export cap reject the render hours after the window.
31101
+ */
31102
+ var DenseCadenceSecField = number().min(.1).max(3600);
31103
+ /**
31104
+ * Minimum seconds of OUTPUT video each detection range must occupy.
31105
+ *
31106
+ * The operator-facing form of the arithmetic above: instead of solving for a
31107
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
31108
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
31109
+ * that range every ~583 ms.
31110
+ *
31111
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
31112
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
31113
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
31114
+ * ranges are sampled denser than they need. Per-range cadences require a cap
31115
+ * schema change and are the tracked follow-up.
31116
+ *
31117
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
31118
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
31119
+ * by real footage, never met by duplicating frames into motion that never
31120
+ * happened.
31121
+ */
31122
+ var MinDwellSecField = number().min(0).max(60);
31123
+ /**
31124
+ * Caption burned into the notification's preview frame.
31125
+ *
31126
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
31127
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
31128
+ * templating dialect for one field would be a second thing to explain.
31129
+ *
31130
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
31131
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
31132
+ * the reason this is not `.min(1)`.
31133
+ */
31134
+ var PreviewTextField = string().max(200);
31135
+ /**
31136
+ * Whether the notification's preview is a STILL or a short animation.
31137
+ *
31138
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
31139
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
31140
+ * night reads better as three seconds of motion than as one frame of it. Both
31141
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
31142
+ * simply applies it to a dozen frames sampled across the render and assembles
31143
+ * them.
31144
+ *
31145
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
31146
+ * seeks and a palette pass, and no rule that never asked for one should start
31147
+ * paying that on the deploy that shipped it.
31148
+ *
31149
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
31150
+ */
31151
+ var PreviewModeField = _enum(["image", "gif"]);
31152
+ /**
31153
+ * Which detection classes the notification reports counts for.
31154
+ *
31155
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
31156
+ * plan — no second query — aggregated per class. Absent or empty means "every
31157
+ * class the window actually contained", which is what an operator who never
31158
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
31159
+ * counts cars all night).
31160
+ *
31161
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
31162
+ * …). An unknown name simply never matches and reports nothing — it is not an
31163
+ * error, because a rule may legitimately name a class this camera's model does
31164
+ * not emit.
31165
+ *
31166
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
31167
+ * - `{{detections}}` — total over the reported classes
31168
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
31169
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
31170
+ * one per class, `count_` + the class name
31171
+ *
31172
+ * With NO custom body template the summary is appended to the derived body, and
31173
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
31174
+ * reads. With a custom template the operator owns every word — nothing is
31175
+ * appended, so `{{detectionSummary}}` is how he asks for it.
31176
+ */
31177
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
31178
+ /**
30331
31179
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
30332
31180
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
30333
31181
  * here (see the ownership note above).
@@ -30347,9 +31195,30 @@ var TimelapseRuleInputSchema = object({
30347
31195
  cadenceSec: CadenceSecField.default(15),
30348
31196
  /** Output frames per second of the assembled mp4 (predecessor parity). */
30349
31197
  framerate: FramerateField.default(10),
31198
+ /**
31199
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
31200
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
31201
+ * field gets.
31202
+ */
31203
+ denseCadenceSec: DenseCadenceSecField.optional(),
31204
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
31205
+ minDwellSec: MinDwellSecField.optional(),
30350
31206
  /** `notification-output` targets the finished video/thumbnail is sent to. */
30351
31207
  targets: TargetsField,
30352
31208
  template: TimelapseTemplateSchema.optional(),
31209
+ /**
31210
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
31211
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
31212
+ *
31213
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
31214
+ * the notification's title/body, and clearing it (`template: null`) must not
31215
+ * silently clear the caption too.
31216
+ */
31217
+ previewText: PreviewTextField.optional(),
31218
+ /** Still or animation — see {@link PreviewModeField}. */
31219
+ previewMode: PreviewModeField.default("image"),
31220
+ /** Classes the notification counts — see {@link ReportClassesField}. */
31221
+ reportClasses: ReportClassesField.optional(),
30353
31222
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
30354
31223
  priority: PriorityField.default(3)
30355
31224
  });
@@ -30360,8 +31229,13 @@ object({
30360
31229
  schedule: NcScheduleSchema.optional(),
30361
31230
  cadenceSec: CadenceSecField.optional(),
30362
31231
  framerate: FramerateField.optional(),
31232
+ denseCadenceSec: DenseCadenceSecField.optional(),
31233
+ minDwellSec: MinDwellSecField.optional(),
30363
31234
  targets: TargetsField.optional(),
30364
31235
  template: TimelapseTemplateSchema.nullable().optional(),
31236
+ previewText: PreviewTextField.optional(),
31237
+ previewMode: PreviewModeField.optional(),
31238
+ reportClasses: ReportClassesField.optional(),
30365
31239
  priority: PriorityField.optional()
30366
31240
  });
30367
31241
  TimelapseRuleInputSchema.extend({
@@ -30373,10 +31247,28 @@ TimelapseRuleInputSchema.extend({
30373
31247
  */
30374
31248
  ownerUserId: string().optional(),
30375
31249
  /**
30376
- * Epoch-ms of the last successful generation the 1-hour re-generation
30377
- * guard's durable state (predecessor parity). Absent = never generated.
31250
+ * Epoch-ms of the NEWEST successful generation across every camera of this
31251
+ * rule. What a UI shows, and the compatibility floor for
31252
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
30378
31253
  */
30379
31254
  lastGeneratedAt: number().optional(),
31255
+ /**
31256
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
31257
+ * re-generation guard's real durable state.
31258
+ *
31259
+ * One rule covers several cameras and each renders its own video, so a rule
31260
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
31261
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
31262
+ * already done — and B's night is gone for good, because the window will not
31263
+ * come back.
31264
+ *
31265
+ * ADDITIVE, so the migration is free: a row written before this field simply
31266
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
31267
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
31268
+ * "never generated" would re-render and re-notify every camera of every rule
31269
+ * once, on the deploy that shipped the map.
31270
+ */
31271
+ generatedByDevice: record(string(), number()).optional(),
30380
31272
  /** userId of the caller who created the rule (server-stamped). */
30381
31273
  createdBy: string(),
30382
31274
  createdAt: number(),