@camstack/addon-provider-hikvision 1.2.16 → 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 +643 -36
  2. package/dist/addon.mjs +643 -36
  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
  *
@@ -7552,7 +7575,15 @@ var RecordingConfigSchema = object({
7552
7575
  * Each completed/failed run also lands one durable ops-log row on its owning
7553
7576
  * addon surface.
7554
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.
7584
+ */
7555
7585
  var RelocateJobStateSchema = _enum([
7586
+ "queued",
7556
7587
  "running",
7557
7588
  "done",
7558
7589
  "failed",
@@ -7587,6 +7618,15 @@ var RelocateFootageInputSchema = object({
7587
7618
  /** Limits relocation to the logical profile class. Omit only for the
7588
7619
  * pre-orchestration compatibility path. */
7589
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(),
7590
7630
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7591
7631
  * never allowed to starve live writers. */
7592
7632
  throttleMbps: number().min(1).max(1e3).optional()
@@ -7722,6 +7762,21 @@ var StorageLocationSchema = object({
7722
7762
  nodeId: string().optional(),
7723
7763
  isDefault: boolean().default(false),
7724
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(),
7725
7780
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7726
7781
  * for node-local locations it can reach) — never persisted, absent when the
7727
7782
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12461,7 +12516,8 @@ method(object({
12461
12516
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12462
12517
  /**
12463
12518
  * filesystem-browse — per-node capability for browsing the node's local
12464
- * 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
12465
12521
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12466
12522
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12467
12523
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -14302,6 +14358,13 @@ var MaskGridDimsSchema = object({
14302
14358
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
14303
14359
  * this one field keeps the schema additive — a rule still declares exactly
14304
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`.
14305
14368
  */
14306
14369
  var NcDeliverySchema = _enum([
14307
14370
  "immediate",
@@ -14316,15 +14379,32 @@ var NcDeliverySchema = _enum([
14316
14379
  * depend on a provider's raw event name or payload shape.
14317
14380
  */
14318
14381
  var NcSystemEventKindSchema = _enum([
14319
- "camera-online",
14320
- "camera-offline",
14382
+ "device-online",
14383
+ "device-offline",
14384
+ "device-disabled",
14385
+ "device-enabled",
14321
14386
  "stream-online",
14322
14387
  "stream-offline",
14323
14388
  "node-online",
14324
14389
  "node-offline",
14325
14390
  "addon-update-available",
14326
- "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"
14327
14406
  ]);
14407
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
14328
14408
  /**
14329
14409
  * One coherent system-event condition. `kinds` is the required opt-in safety
14330
14410
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -14333,6 +14413,18 @@ var NcSystemEventKindSchema = _enum([
14333
14413
  var NcSystemEventConditionSchema = object({
14334
14414
  kinds: array(NcSystemEventKindSchema).min(1),
14335
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(),
14336
14428
  nodeIds: array(string().min(1)).min(1).optional(),
14337
14429
  packageNames: array(string().min(1)).min(1).optional()
14338
14430
  });
@@ -14383,6 +14475,47 @@ var NcOccupancyConditionSchema = object({
14383
14475
  sustainSeconds: number().int().min(0).max(3600).default(15)
14384
14476
  });
14385
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
+ /**
14386
14519
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
14387
14520
  *
14388
14521
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14655,7 +14788,33 @@ var NcConditionsSchema = object({
14655
14788
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14656
14789
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14657
14790
  */
14658
- 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()
14659
14818
  });
14660
14819
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14661
14820
  var NcRuleTargetSchema = object({
@@ -14769,6 +14928,73 @@ var NcThrottleSchema = object({
14769
14928
  */
14770
14929
  granularity: NcThrottleGranularitySchema.optional()
14771
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
+ });
14772
14998
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14773
14999
  var NcRuleInputSchema = object({
14774
15000
  name: string().min(1).max(200),
@@ -14829,7 +15055,13 @@ var NcRuleInputSchema = object({
14829
15055
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14830
15056
  * shape as every other actuation.
14831
15057
  */
14832
- 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()
14833
15065
  });
14834
15066
  /**
14835
15067
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14840,7 +15072,37 @@ var NcRuleInputSchema = object({
14840
15072
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14841
15073
  * `updateRule` patch.
14842
15074
  */
14843
- 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
+ });
14844
15106
  /** A persisted rule. */
14845
15107
  var NcRuleSchema = NcRuleInputSchema.extend({
14846
15108
  id: string(),
@@ -15141,6 +15403,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
15141
15403
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
15142
15404
  * copy would lie the first time a rule is disabled.
15143
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
+ });
15144
15425
  var NcAlarmModeCoverageSchema = object({
15145
15426
  mode: AlarmArmModeSchema,
15146
15427
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -15148,7 +15429,18 @@ var NcAlarmModeCoverageSchema = object({
15148
15429
  /** At least one covering rule has no device scope, so the mode covers all. */
15149
15430
  allDevices: boolean(),
15150
15431
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
15151
- 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([])
15152
15444
  });
15153
15445
  var NcAlarmConfigSchema = object({
15154
15446
  /**
@@ -17980,9 +18272,16 @@ var CameraStatusSchema = object({
17980
18272
  audio: CameraAudioStatusSchema.nullable(),
17981
18273
  recording: CameraRecordingStatusSchema.nullable(),
17982
18274
  /**
17983
- * Per-camera function switches an OPERATOR has turned off
18275
+ * Per-camera functions an OPERATOR has turned off
17984
18276
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17985
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
+ *
17986
18285
  * This is the difference between DISABLED and BROKEN. A camera whose
17987
18286
  * `detection` block reports zero fps and whose `switchedOff` contains
17988
18287
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -18589,24 +18888,28 @@ var snapshotCapability = {
18589
18888
  *
18590
18889
  * `getSnapshotOverview` is cache-only by contract: it answers from whatever
18591
18890
  * the wrapper happens to hold and never captures. Under D93 the client
18592
- * versions its image URL on that answer, and an image REQUEST is what enrols
18593
- * a camera in the keep-warm loop. Both of those are satisfiable by the
18594
- * client's own image cache — `expo-image` is URL-keyed and never revalidates
18595
- * — so a URL painted in a previous session comes off disk with no network,
18596
- * no enrolment, and nothing warming. Measured on the live hub: reopening
18597
- * after two minutes idle painted 15 of 16 tiles at **168 s old** with zero
18598
- * HTTP requests, and the fleet only recovered because a later poll happened
18599
- * 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.
18600
18899
  *
18601
18900
  * ## The two properties that fix it
18602
18901
  *
18603
18902
  * **It is an RPC, so no client cache can answer it.** The demand signal
18604
- * always reaches the wrapper. This method therefore MAY create keep-warm
18605
- * subscriptions, where `getSnapshotOverview` must never (D93) — the
18606
- * distinction is not "one is newer" but that the overview poll is app-wide
18607
- * (a creating overview would warm every camera on the install) while this is
18608
- * called by a rendered surface naming the tiles it is actually painting, at
18609
- * 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.
18610
18913
  *
18611
18914
  * **It waits, briefly and boundedly, for the capture it triggered.** The
18612
18915
  * returned `capturedAt` is the frame the link will serve, not the frame the
@@ -24999,7 +25302,19 @@ var RecordingManifestSchema = object({
24999
25302
  * profiles/subtrees/locations on this node). */
25000
25303
  var RecordingDeviceUsageSchema = object({
25001
25304
  deviceId: number(),
25002
- 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()
25003
25318
  });
25004
25319
  /** Recording storage usage + capacity for one storage location. */
25005
25320
  var RecordingLocationUsageSchema = object({
@@ -25027,6 +25342,57 @@ var RecordingStorageUsageSchema = object({
25027
25342
  locations: array(RecordingLocationUsageSchema)
25028
25343
  });
25029
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
+ /**
25030
25396
  * Result of locating footage at a wall-clock instant for one device/profile.
25031
25397
  * `segment` carries the covering segment's window; `gap` reports the forward
25032
25398
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -25189,9 +25555,24 @@ method(object({
25189
25555
  }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
25190
25556
  kind: "mutation",
25191
25557
  auth: "admin"
25558
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
25559
+ kind: "mutation",
25560
+ auth: "admin"
25561
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
25562
+ kind: "query",
25563
+ auth: "admin"
25564
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
25565
+ kind: "mutation",
25566
+ auth: "admin"
25567
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25568
+ kind: "query",
25569
+ auth: "admin"
25570
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25571
+ kind: "mutation",
25572
+ auth: "admin"
25192
25573
  });
25193
25574
  /**
25194
- * `recordingExport` cap — render a footage time range into a single downloadable
25575
+ * `recording-export` cap — render a footage time range into a single downloadable
25195
25576
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
25196
25577
  * bounded lifetime with a durable history, auto-expiry, and optional
25197
25578
  * delete-after-download.
@@ -25206,10 +25587,42 @@ method(object({
25206
25587
  */
25207
25588
  /** Playback-speed multiplier for the render (1 = realtime). */
25208
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
+ });
25209
25614
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
25210
25615
  var ExportTimelapseSchema = object({
25211
25616
  everyMs: number().int().positive(),
25212
- 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
+ });
25213
25626
  });
25214
25627
  /**
25215
25628
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -25267,6 +25680,19 @@ var ExportDownloadSchema = object({
25267
25680
  url: string(),
25268
25681
  endpoints: array(string())
25269
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
+ });
25270
25696
  method(object({
25271
25697
  deviceId: number(),
25272
25698
  profile: string(),
@@ -25291,6 +25717,9 @@ method(object({
25291
25717
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
25292
25718
  kind: "query",
25293
25719
  auth: "protected"
25720
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
25721
+ kind: "query",
25722
+ auth: "protected"
25294
25723
  });
25295
25724
  /**
25296
25725
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -32325,6 +32754,12 @@ Object.freeze({
32325
32754
  addonId: null,
32326
32755
  access: "create"
32327
32756
  },
32757
+ "recording.cancelRelocateJob": {
32758
+ capName: "recording",
32759
+ capScope: "system",
32760
+ addonId: null,
32761
+ access: "create"
32762
+ },
32328
32763
  "recording.cancelStorageMigrationMove": {
32329
32764
  capName: "recording",
32330
32765
  capScope: "system",
@@ -32379,6 +32814,12 @@ Object.freeze({
32379
32814
  addonId: null,
32380
32815
  access: "view"
32381
32816
  },
32817
+ "recording.listRelocateJobs": {
32818
+ capName: "recording",
32819
+ capScope: "system",
32820
+ addonId: null,
32821
+ access: "view"
32822
+ },
32382
32823
  "recording.locateSegment": {
32383
32824
  capName: "recording",
32384
32825
  capScope: "system",
@@ -32391,6 +32832,12 @@ Object.freeze({
32391
32832
  addonId: null,
32392
32833
  access: "create"
32393
32834
  },
32835
+ "recording.planStorageRebalance": {
32836
+ capName: "recording",
32837
+ capScope: "system",
32838
+ addonId: null,
32839
+ access: "view"
32840
+ },
32394
32841
  "recording.pruneFootage": {
32395
32842
  capName: "recording",
32396
32843
  capScope: "system",
@@ -32415,6 +32862,12 @@ Object.freeze({
32415
32862
  addonId: null,
32416
32863
  access: "create"
32417
32864
  },
32865
+ "recording.relocateFootage": {
32866
+ capName: "recording",
32867
+ capScope: "system",
32868
+ addonId: null,
32869
+ access: "create"
32870
+ },
32418
32871
  "recording.renderClip": {
32419
32872
  capName: "recording",
32420
32873
  capScope: "system",
@@ -32451,38 +32904,50 @@ Object.freeze({
32451
32904
  addonId: null,
32452
32905
  access: "create"
32453
32906
  },
32907
+ "recording.startStorageRebalance": {
32908
+ capName: "recording",
32909
+ capScope: "system",
32910
+ addonId: null,
32911
+ access: "create"
32912
+ },
32454
32913
  "recordingExport.cancelExport": {
32455
- capName: "recordingExport",
32914
+ capName: "recording-export",
32456
32915
  capScope: "system",
32457
32916
  addonId: null,
32458
32917
  access: "create"
32459
32918
  },
32460
32919
  "recordingExport.createExport": {
32461
- capName: "recordingExport",
32920
+ capName: "recording-export",
32462
32921
  capScope: "system",
32463
32922
  addonId: null,
32464
32923
  access: "create"
32465
32924
  },
32466
32925
  "recordingExport.deleteExport": {
32467
- capName: "recordingExport",
32926
+ capName: "recording-export",
32468
32927
  capScope: "system",
32469
32928
  addonId: null,
32470
32929
  access: "delete"
32471
32930
  },
32472
32931
  "recordingExport.getDownloadUrl": {
32473
- capName: "recordingExport",
32932
+ capName: "recording-export",
32474
32933
  capScope: "system",
32475
32934
  addonId: null,
32476
32935
  access: "view"
32477
32936
  },
32478
32937
  "recordingExport.getExport": {
32479
- capName: "recordingExport",
32938
+ capName: "recording-export",
32480
32939
  capScope: "system",
32481
32940
  addonId: null,
32482
32941
  access: "view"
32483
32942
  },
32484
32943
  "recordingExport.listExports": {
32485
- capName: "recordingExport",
32944
+ capName: "recording-export",
32945
+ capScope: "system",
32946
+ addonId: null,
32947
+ access: "view"
32948
+ },
32949
+ "recordingExport.readExportBytes": {
32950
+ capName: "recording-export",
32486
32951
  capScope: "system",
32487
32952
  addonId: null,
32488
32953
  access: "view"
@@ -33859,6 +34324,104 @@ var FramerateField = number().int().min(1).max(60);
33859
34324
  var TargetsField = array(NcRuleTargetSchema).min(1);
33860
34325
  var PriorityField = number().int().min(1).max(5);
33861
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
+ /**
33862
34425
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
33863
34426
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
33864
34427
  * here (see the ownership note above).
@@ -33878,9 +34441,30 @@ var TimelapseRuleInputSchema = object({
33878
34441
  cadenceSec: CadenceSecField.default(15),
33879
34442
  /** Output frames per second of the assembled mp4 (predecessor parity). */
33880
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(),
33881
34452
  /** `notification-output` targets the finished video/thumbnail is sent to. */
33882
34453
  targets: TargetsField,
33883
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(),
33884
34468
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
33885
34469
  priority: PriorityField.default(3)
33886
34470
  });
@@ -33891,8 +34475,13 @@ object({
33891
34475
  schedule: NcScheduleSchema.optional(),
33892
34476
  cadenceSec: CadenceSecField.optional(),
33893
34477
  framerate: FramerateField.optional(),
34478
+ denseCadenceSec: DenseCadenceSecField.optional(),
34479
+ minDwellSec: MinDwellSecField.optional(),
33894
34480
  targets: TargetsField.optional(),
33895
34481
  template: TimelapseTemplateSchema.nullable().optional(),
34482
+ previewText: PreviewTextField.optional(),
34483
+ previewMode: PreviewModeField.optional(),
34484
+ reportClasses: ReportClassesField.optional(),
33896
34485
  priority: PriorityField.optional()
33897
34486
  });
33898
34487
  TimelapseRuleInputSchema.extend({
@@ -33904,10 +34493,28 @@ TimelapseRuleInputSchema.extend({
33904
34493
  */
33905
34494
  ownerUserId: string().optional(),
33906
34495
  /**
33907
- * Epoch-ms of the last successful generation the 1-hour re-generation
33908
- * 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.
33909
34499
  */
33910
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(),
33911
34518
  /** userId of the caller who created the rule (server-stamped). */
33912
34519
  createdBy: string(),
33913
34520
  createdAt: number(),