@camstack/addon-provider-amcrest 0.2.14 → 0.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +643 -36
  2. package/dist/addon.mjs +643 -36
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -7198,8 +7198,31 @@ var AdoptionJobSchema = object({
7198
7198
  error: string().nullable()
7199
7199
  });
7200
7200
  /**
7201
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7202
- * pipeline functions an operator thinks in terms of.
7201
+ * Per-camera FUNCTION SWITCHES.
7202
+ *
7203
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7204
+ *
7205
+ * This file shipped as "the one coherent on/off surface over the pipeline
7206
+ * functions an operator thinks in terms of". The operator's verdict on
7207
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7208
+ * every function already had a settings page of its own, and a second place to
7209
+ * turn it off is a second place to look. Each switch is going back to its own
7210
+ * component's original options — detection to the detection-pipeline wrapper
7211
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7212
+ * (which was always first-class; the switch was a veneer over
7213
+ * `recording.setDeviceConfig`), notifications to a notification-center
7214
+ * per-device setting, the two camera planes to their own components.
7215
+ *
7216
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7217
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7218
+ * straight from the authorities with no group in the middle. That rule was
7219
+ * never about a control panel.
7220
+ *
7221
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7222
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7223
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7224
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7225
+ * stop; nothing new may be built on it.
7203
7226
  *
7204
7227
  * ## This file adds no state
7205
7228
  *
@@ -7550,7 +7573,15 @@ var RecordingConfigSchema = object({
7550
7573
  * Each completed/failed run also lands one durable ops-log row on its owning
7551
7574
  * addon surface.
7552
7575
  */
7576
+ /**
7577
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7578
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7579
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7580
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7581
+ * runs at all.
7582
+ */
7553
7583
  var RelocateJobStateSchema = _enum([
7584
+ "queued",
7554
7585
  "running",
7555
7586
  "done",
7556
7587
  "failed",
@@ -7585,6 +7616,15 @@ var RelocateFootageInputSchema = object({
7585
7616
  /** Limits relocation to the logical profile class. Omit only for the
7586
7617
  * pre-orchestration compatibility path. */
7587
7618
  footageClass: RelocateFootageClassSchema.optional(),
7619
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7620
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7621
+ * unit is a (camera, profile) pile, not a disk. */
7622
+ deviceId: number().int().optional(),
7623
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7624
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7625
+ * placement plan assigns those two independently, so a rebalance that could
7626
+ * only say "recordings" would move footage the plan never asked to move. */
7627
+ profiles: array(string()).optional(),
7588
7628
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7589
7629
  * never allowed to starve live writers. */
7590
7630
  throttleMbps: number().min(1).max(1e3).optional()
@@ -7720,6 +7760,21 @@ var StorageLocationSchema = object({
7720
7760
  nodeId: string().optional(),
7721
7761
  isDefault: boolean().default(false),
7722
7762
  isSystem: boolean().default(false),
7763
+ /**
7764
+ * Operator opt-in: whether consumers that BALANCE across several locations
7765
+ * of a type may write here. Recordings reads it today; event media and
7766
+ * backups are the next consumers, which is why the flag lives on the
7767
+ * location rather than in any one addon's store — nothing has to be
7768
+ * extended to add the next consumer.
7769
+ *
7770
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7771
+ * flag existed reads back with no flag and keeps working exactly as before;
7772
+ * that is the whole compat story, and it is why no migration ships with it.
7773
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7774
+ * disk must not silently start writing to it); the default of a type is
7775
+ * always stamped `true`.
7776
+ */
7777
+ enabled: boolean().optional(),
7723
7778
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7724
7779
  * for node-local locations it can reach) — never persisted, absent when the
7725
7780
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12272,7 +12327,8 @@ method(object({
12272
12327
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12273
12328
  /**
12274
12329
  * filesystem-browse — per-node capability for browsing the node's local
12275
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12330
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12331
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12276
12332
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12277
12333
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12278
12334
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -14113,6 +14169,13 @@ var MaskGridDimsSchema = object({
14113
14169
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
14114
14170
  * this one field keeps the schema additive — a rule still declares exactly
14115
14171
  * one trigger.
14172
+ *
14173
+ * AUDIO rules add no member here, for the reason occupancy added none: the
14174
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
14175
+ * mirror.ts` fails the build on a member the app cannot render) and every
14176
+ * member costs a release train. A sustained-sound rule is therefore an
14177
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
14178
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
14116
14179
  */
14117
14180
  var NcDeliverySchema = _enum([
14118
14181
  "immediate",
@@ -14127,15 +14190,32 @@ var NcDeliverySchema = _enum([
14127
14190
  * depend on a provider's raw event name or payload shape.
14128
14191
  */
14129
14192
  var NcSystemEventKindSchema = _enum([
14130
- "camera-online",
14131
- "camera-offline",
14193
+ "device-online",
14194
+ "device-offline",
14195
+ "device-disabled",
14196
+ "device-enabled",
14132
14197
  "stream-online",
14133
14198
  "stream-offline",
14134
14199
  "node-online",
14135
14200
  "node-offline",
14136
14201
  "addon-update-available",
14137
- "server-update-available"
14202
+ "server-update-available",
14203
+ "alarm-triggered",
14204
+ "alarm-armed",
14205
+ "alarm-disarmed",
14206
+ "camera-online",
14207
+ "camera-offline",
14208
+ "camera-disabled",
14209
+ "camera-enabled"
14210
+ ]);
14211
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14212
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14213
+ "camera-online",
14214
+ "camera-offline",
14215
+ "camera-disabled",
14216
+ "camera-enabled"
14138
14217
  ]);
14218
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
14139
14219
  /**
14140
14220
  * One coherent system-event condition. `kinds` is the required opt-in safety
14141
14221
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -14144,6 +14224,18 @@ var NcSystemEventKindSchema = _enum([
14144
14224
  var NcSystemEventConditionSchema = object({
14145
14225
  kinds: array(NcSystemEventKindSchema).min(1),
14146
14226
  deviceIds: array(number().int()).min(1).optional(),
14227
+ /**
14228
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14229
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14230
+ * is what a liveness rule means when nobody said otherwise.
14231
+ *
14232
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14233
+ * one reason: the intake cannot know which devices this household cares
14234
+ * about, and a producer-side filter is one no operator can change. Fails
14235
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14236
+ * does not carry) matches no `deviceTypes` list.
14237
+ */
14238
+ deviceTypes: array(string().min(1)).min(1).optional(),
14147
14239
  nodeIds: array(string().min(1)).min(1).optional(),
14148
14240
  packageNames: array(string().min(1)).min(1).optional()
14149
14241
  });
@@ -14194,6 +14286,47 @@ var NcOccupancyConditionSchema = object({
14194
14286
  sustainSeconds: number().int().min(0).max(3600).default(15)
14195
14287
  });
14196
14288
  /**
14289
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14290
+ *
14291
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14292
+ * reference notifier uses, so an operator moving between them re-uses what
14293
+ * they already know): a rule matches when, over a sampling window of
14294
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14295
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14296
+ *
14297
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14298
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14299
+ * - `labels` — the classifier put at least one of these labels on it.
14300
+ *
14301
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14302
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14303
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14304
+ * is given** — a window in which every sample is trivially a hit would fire on
14305
+ * silence, so the engine refuses such a condition rather than notifying on
14306
+ * nothing (the schema cannot express "at least one of" without becoming a
14307
+ * ZodEffects the cap path would have to special-case).
14308
+ *
14309
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14310
+ * must be FULL before it can match — a window that has been open for two
14311
+ * seconds of its ten is 100% of nothing, and firing on it would make
14312
+ * `samplingSeconds` decorative.
14313
+ *
14314
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14315
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14316
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14317
+ * an operator who typed `dog` mean the same thing.
14318
+ */
14319
+ var NcAudioConditionSchema = object({
14320
+ /** Audio macro labels; absent = any sound (level-only rule). */
14321
+ labels: array(string().min(1)).min(1).optional(),
14322
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14323
+ dbThreshold: number().min(-96).max(0).optional(),
14324
+ /** Percentage of the window's samples that must be hits (1–100). */
14325
+ hitPercent: number().int().min(1).max(100).default(60),
14326
+ /** Length of the sampling window in seconds. */
14327
+ samplingSeconds: number().int().min(1).max(300).default(10)
14328
+ });
14329
+ /**
14197
14330
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
14198
14331
  *
14199
14332
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14466,7 +14599,33 @@ var NcConditionsSchema = object({
14466
14599
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14467
14600
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14468
14601
  */
14469
- occupancy: NcOccupancyConditionSchema.optional()
14602
+ occupancy: NcOccupancyConditionSchema.optional(),
14603
+ /**
14604
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14605
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14606
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14607
+ * a window that is not full yet, neither filter given). See
14608
+ * {@link NcAudioCondition}.
14609
+ *
14610
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14611
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14612
+ * a detection, a track or a device event (the same fail-closed pairing
14613
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14614
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14615
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14616
+ * classified sample) stays exactly as it was for rules that already use it.
14617
+ *
14618
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14619
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14620
+ * (`camstack/src/data/notification-center.ts`, guarded by
14621
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14622
+ * condition fields it does not know when a rule is saved from the phone.
14623
+ * Publishing an editor for a condition the app cannot round-trip is how an
14624
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14625
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14626
+ * does an audio rule become authorable.
14627
+ */
14628
+ audio: NcAudioConditionSchema.optional()
14470
14629
  });
14471
14630
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14472
14631
  var NcRuleTargetSchema = object({
@@ -14580,6 +14739,73 @@ var NcThrottleSchema = object({
14580
14739
  */
14581
14740
  granularity: NcThrottleGranularitySchema.optional()
14582
14741
  });
14742
+ /**
14743
+ * How long the confirm gate may hold ONE notification, and how big the picture
14744
+ * it judges may be.
14745
+ *
14746
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14747
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14748
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14749
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14750
+ * tokens for pixels the model pools away.
14751
+ */
14752
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14753
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14754
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14755
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14756
+ var NcConfirmExpectSchema = object({
14757
+ op: _enum([
14758
+ ">=",
14759
+ ">",
14760
+ "<=",
14761
+ "<",
14762
+ "=="
14763
+ ]),
14764
+ count: number().int().min(0).max(1e3)
14765
+ });
14766
+ /**
14767
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14768
+ * to ship and says whether it agrees with the rule.
14769
+ *
14770
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14771
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14772
+ * on the operator's phone is not a verdict about this notification.
14773
+ *
14774
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14775
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14776
+ * the default and every fail-open is COUNTED, because a gate that always fails
14777
+ * open looks in the log exactly like a gate that works.
14778
+ *
14779
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14780
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14781
+ * production failures in one day), so the gate reads absent as the constant
14782
+ * above rather than trusting a parse it may never have seen.
14783
+ */
14784
+ var NcConfirmSchema = object({
14785
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14786
+ * same thing, and both mean "deliver exactly as before". */
14787
+ enabled: boolean().default(false),
14788
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14789
+ profileId: string().optional(),
14790
+ /**
14791
+ * The operator's question, in his own words. Absent = a question derived
14792
+ * from the rule (its class and its expectation).
14793
+ *
14794
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14795
+ * banners, signage and plates as instructions if you let them reach the
14796
+ * prompt — proven live — so the authoritative contract stays in the system
14797
+ * turn and only rule-authored words land here.
14798
+ */
14799
+ prompt: string().max(1e3).optional(),
14800
+ /** Fire only when the model's count satisfies this. Absent = the model's
14801
+ * own boolean verdict decides. */
14802
+ expect: NcConfirmExpectSchema.optional(),
14803
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14804
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14805
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14806
+ /** Longest edge the judged image is downscaled to before it is sent. */
14807
+ maxImagePx: number().int().min(64).max(2048).default(448)
14808
+ });
14583
14809
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14584
14810
  var NcRuleInputSchema = object({
14585
14811
  name: string().min(1).max(200),
@@ -14640,7 +14866,13 @@ var NcRuleInputSchema = object({
14640
14866
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14641
14867
  * shape as every other actuation.
14642
14868
  */
14643
- actions: NcRuleActionsSchema.optional()
14869
+ actions: NcRuleActionsSchema.optional(),
14870
+ /**
14871
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14872
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14873
+ * did, and absent is the only way to say that without a migration.
14874
+ */
14875
+ confirm: NcConfirmSchema.optional()
14644
14876
  });
14645
14877
  /**
14646
14878
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14651,7 +14883,37 @@ var NcRuleInputSchema = object({
14651
14883
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14652
14884
  * `updateRule` patch.
14653
14885
  */
14654
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
14886
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14887
+ disabledTargetIds: array(string()).optional(),
14888
+ /**
14889
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14890
+ *
14891
+ * It makes the key optional to SUPPLY; the parse still materialises the
14892
+ * default when the key is absent. And `NcRuleStore.update` merges with
14893
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14894
+ * one — which made every partial edit destructive:
14895
+ *
14896
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14897
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14898
+ * setEnabled(ruleId, false) → conditions reset to `{}`
14899
+ *
14900
+ * A rule scoped to one camera and one zone silently became a rule that
14901
+ * matches EVERY event on EVERY camera, and lost its `media` policy
14902
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
14903
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
14904
+ * within a minute of a two-field patch.
14905
+ *
14906
+ * So every defaulted field is re-declared here WITHOUT its default. The
14907
+ * inner defaults still apply when the caller DOES send the key — `{}` for
14908
+ * conditions remains a real instruction ("clear them") — and only the
14909
+ * absent key is now genuinely absent.
14910
+ */
14911
+ enabled: boolean().optional(),
14912
+ conditions: NcConditionsSchema.optional(),
14913
+ media: NcMediaPolicySchema.optional(),
14914
+ throttle: NcThrottleSchema.optional(),
14915
+ priority: number().int().min(1).max(5).optional()
14916
+ });
14655
14917
  /** A persisted rule. */
14656
14918
  var NcRuleSchema = NcRuleInputSchema.extend({
14657
14919
  id: string(),
@@ -14952,6 +15214,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14952
15214
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14953
15215
  * copy would lie the first time a rule is disabled.
14954
15216
  */
15217
+ /**
15218
+ * Why a device a mode NAMES is nonetheless not armed by it.
15219
+ *
15220
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15221
+ * per-camera notification switch the Notification Center already owns,
15222
+ * `detection-off` is the device's own detection binding being inactive, and
15223
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15224
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15225
+ * with the switches the operator actually used.
15226
+ */
15227
+ var NcAlarmSkipReasonSchema = _enum([
15228
+ "muted",
15229
+ "detection-off",
15230
+ "offline"
15231
+ ]);
15232
+ var NcAlarmSkippedDeviceSchema = object({
15233
+ deviceId: number().int(),
15234
+ reason: NcAlarmSkipReasonSchema
15235
+ });
14955
15236
  var NcAlarmModeCoverageSchema = object({
14956
15237
  mode: AlarmArmModeSchema,
14957
15238
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14959,7 +15240,18 @@ var NcAlarmModeCoverageSchema = object({
14959
15240
  /** At least one covering rule has no device scope, so the mode covers all. */
14960
15241
  allDevices: boolean(),
14961
15242
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14962
- deviceIds: array(number().int())
15243
+ deviceIds: array(number().int()),
15244
+ /**
15245
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15246
+ * excludes it.
15247
+ *
15248
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15249
+ * twelve makes it false in exactly the way nobody notices until an incident.
15250
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15251
+ * still parses as "nothing known to be skipped" rather than failing the whole
15252
+ * alarm tab.
15253
+ */
15254
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
14963
15255
  });
14964
15256
  var NcAlarmConfigSchema = object({
14965
15257
  /**
@@ -17791,9 +18083,16 @@ var CameraStatusSchema = object({
17791
18083
  audio: CameraAudioStatusSchema.nullable(),
17792
18084
  recording: CameraRecordingStatusSchema.nullable(),
17793
18085
  /**
17794
- * Per-camera function switches an OPERATOR has turned off
18086
+ * Per-camera functions an OPERATOR has turned off
17795
18087
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17796
18088
  *
18089
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
18090
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
18091
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
18092
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
18093
+ * The badge outlives the control panel: the panel was a convenience, this is
18094
+ * the difference between a camera being off and a camera being dead.
18095
+ *
17797
18096
  * This is the difference between DISABLED and BROKEN. A camera whose
17798
18097
  * `detection` block reports zero fps and whose `switchedOff` contains
17799
18098
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -18400,24 +18699,28 @@ var snapshotCapability = {
18400
18699
  *
18401
18700
  * `getSnapshotOverview` is cache-only by contract: it answers from whatever
18402
18701
  * the wrapper happens to hold and never captures. Under D93 the client
18403
- * versions its image URL on that answer, and an image REQUEST is what enrols
18404
- * a camera in the keep-warm loop. Both of those are satisfiable by the
18405
- * client's own image cache — `expo-image` is URL-keyed and never revalidates
18406
- * — so a URL painted in a previous session comes off disk with no network,
18407
- * no enrolment, and nothing warming. Measured on the live hub: reopening
18408
- * after two minutes idle painted 15 of 16 tiles at **168 s old** with zero
18409
- * HTTP requests, and the fleet only recovered because a later poll happened
18410
- * to observe a different identity.
18702
+ * versions its image URL on that answer, and an image REQUEST was the only
18703
+ * demand signal. Both of those are satisfiable by the client's own image
18704
+ * cache — `expo-image` is URL-keyed and never revalidates — so a URL painted
18705
+ * in a previous session comes off disk with no network, no demand, and no
18706
+ * capture. Measured on the live hub: reopening after two minutes idle
18707
+ * painted 15 of 16 tiles at **168 s old** with zero HTTP requests, and the
18708
+ * fleet only recovered because a later poll happened to observe a different
18709
+ * identity.
18411
18710
  *
18412
18711
  * ## The two properties that fix it
18413
18712
  *
18414
18713
  * **It is an RPC, so no client cache can answer it.** The demand signal
18415
- * always reaches the wrapper. This method therefore MAY create keep-warm
18416
- * subscriptions, where `getSnapshotOverview` must never (D93) — the
18417
- * distinction is not "one is newer" but that the overview poll is app-wide
18418
- * (a creating overview would warm every camera on the install) while this is
18419
- * called by a rendered surface naming the tiles it is actually painting, at
18420
- * the width it is painting them.
18714
+ * always reaches the wrapper. This method therefore CAPTURES, where
18715
+ * `getSnapshotOverview` must never (D93) — the distinction is not "one is
18716
+ * newer" but that the overview poll is app-wide (a capturing overview would
18717
+ * dial every camera on the install) while this is called by a rendered
18718
+ * surface naming the tiles it is actually painting, at the width it is
18719
+ * painting them.
18720
+ *
18721
+ * Since 2026-08-11 this is the ONLY thing that refreshes a snapshot: the
18722
+ * server-side keep-warm loop was removed (operator directive — on-demand,
18723
+ * always), so a camera nobody is looking at costs nothing at all.
18421
18724
  *
18422
18725
  * **It waits, briefly and boundedly, for the capture it triggered.** The
18423
18726
  * returned `capturedAt` is the frame the link will serve, not the frame the
@@ -24714,7 +25017,19 @@ var RecordingManifestSchema = object({
24714
25017
  * profiles/subtrees/locations on this node). */
24715
25018
  var RecordingDeviceUsageSchema = object({
24716
25019
  deviceId: number(),
24717
- usedBytes: number()
25020
+ usedBytes: number(),
25021
+ /**
25022
+ * Start of this camera's OLDEST indexed segment, across every profile and
25023
+ * location — the "Oldest footage" column in Recordings → Storage, and the
25024
+ * only honest answer to "is retention actually holding?" per camera.
25025
+ *
25026
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
25027
+ * predates this field omits it entirely, and a hub whose types carry the
25028
+ * field must keep validating that older provider's payload: the framework
25029
+ * (types) and the addon ship on different trains, and the addon is usually
25030
+ * the later of the two.
25031
+ */
25032
+ oldestMs: number().nullable().optional()
24718
25033
  });
24719
25034
  /** Recording storage usage + capacity for one storage location. */
24720
25035
  var RecordingLocationUsageSchema = object({
@@ -24742,6 +25057,57 @@ var RecordingStorageUsageSchema = object({
24742
25057
  locations: array(RecordingLocationUsageSchema)
24743
25058
  });
24744
25059
  /**
25060
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
25061
+ *
25062
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
25063
+ * is the operator asking for the EXISTING archive to be brought into line with
25064
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
25065
+ * location, run FIFO behind the single-flight mover.
25066
+ *
25067
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
25068
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
25069
+ * (empty on the plan).
25070
+ */
25071
+ var RecordingRebalanceMoveSchema = object({
25072
+ deviceId: number(),
25073
+ profile: string(),
25074
+ fromLocationId: string(),
25075
+ toLocationId: string(),
25076
+ bytes: number(),
25077
+ files: number().int()
25078
+ });
25079
+ /** Why a pile that is out of place is staying there. Every refusal is
25080
+ * reported: a rebalance that silently drops a camera reads exactly like one
25081
+ * that had nothing to do. */
25082
+ var RecordingRebalanceSkipReasonSchema = _enum([
25083
+ "unassigned",
25084
+ "target-not-writable",
25085
+ "below-threshold",
25086
+ "no-headroom"
25087
+ ]);
25088
+ var RecordingRebalanceSkipSchema = object({
25089
+ deviceId: number(),
25090
+ profile: string(),
25091
+ fromLocationId: string(),
25092
+ /** The location the plan wants; null when the camera has no assignment. */
25093
+ toLocationId: string().nullable(),
25094
+ bytes: number(),
25095
+ reason: RecordingRebalanceSkipReasonSchema
25096
+ });
25097
+ var RecordingRebalancePlanSchema = object({
25098
+ moves: array(RecordingRebalanceMoveSchema),
25099
+ skipped: array(RecordingRebalanceSkipSchema),
25100
+ bytesToMove: number(),
25101
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
25102
+ jobIds: array(string())
25103
+ });
25104
+ var RecordingRebalanceInputSchema = object({
25105
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
25106
+ throttleMbps: number().min(1).max(1e3).optional(),
25107
+ /** Ignore piles smaller than this (default 1 GB). */
25108
+ minMoveGb: number().min(0).optional()
25109
+ });
25110
+ /**
24745
25111
  * Result of locating footage at a wall-clock instant for one device/profile.
24746
25112
  * `segment` carries the covering segment's window; `gap` reports the forward
24747
25113
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -24904,9 +25270,24 @@ method(object({
24904
25270
  }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24905
25271
  kind: "mutation",
24906
25272
  auth: "admin"
25273
+ }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
25274
+ kind: "mutation",
25275
+ auth: "admin"
25276
+ }), method(object({}), array(RelocateJobSchema).readonly(), {
25277
+ kind: "query",
25278
+ auth: "admin"
25279
+ }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
25280
+ kind: "mutation",
25281
+ auth: "admin"
25282
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25283
+ kind: "query",
25284
+ auth: "admin"
25285
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25286
+ kind: "mutation",
25287
+ auth: "admin"
24907
25288
  });
24908
25289
  /**
24909
- * `recordingExport` cap — render a footage time range into a single downloadable
25290
+ * `recording-export` cap — render a footage time range into a single downloadable
24910
25291
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
24911
25292
  * bounded lifetime with a durable history, auto-expiry, and optional
24912
25293
  * delete-after-download.
@@ -24921,10 +25302,42 @@ method(object({
24921
25302
  */
24922
25303
  /** Playback-speed multiplier for the render (1 = realtime). */
24923
25304
  var ExportSpeedSchema = number().min(.25).max(32);
25305
+ /**
25306
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25307
+ *
25308
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
25309
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25310
+ * playlist. Handing it absolute epochs would make every call site responsible
25311
+ * for the same subtraction, and the one that forgot would emit a filter that
25312
+ * selects nothing — silently, as a uniform timelapse.
25313
+ */
25314
+ var ExportDenseRangeSchema = object({
25315
+ fromSec: number().nonnegative(),
25316
+ toSec: number().nonnegative()
25317
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
25318
+ /**
25319
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
25320
+ * listed ranges and at the base `everyMs` everywhere else.
25321
+ *
25322
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
25323
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
25324
+ */
25325
+ var ExportDenseSchema = object({
25326
+ everyMs: number().int().positive(),
25327
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
25328
+ });
24924
25329
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
24925
25330
  var ExportTimelapseSchema = object({
24926
25331
  everyMs: number().int().positive(),
24927
- outputFps: number().int().min(1).max(60).optional()
25332
+ outputFps: number().int().min(1).max(60).optional(),
25333
+ /** Optional second, FASTER rate over the intervals that matter. */
25334
+ dense: ExportDenseSchema.optional()
25335
+ }).superRefine((v, ctx) => {
25336
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
25337
+ code: ZodIssueCode.custom,
25338
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
25339
+ path: ["dense", "everyMs"]
25340
+ });
24928
25341
  });
24929
25342
  /**
24930
25343
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -24982,6 +25395,19 @@ var ExportDownloadSchema = object({
24982
25395
  url: string(),
24983
25396
  endpoints: array(string())
24984
25397
  });
25398
+ /**
25399
+ * A finished export's bytes, inline.
25400
+ *
25401
+ * `bytes` is the DECODED length — the number the caller bounds and logs
25402
+ * against, so nobody has to infer it from the base64 length.
25403
+ */
25404
+ var ExportBytesSchema = object({
25405
+ base64: string(),
25406
+ contentType: string(),
25407
+ /** Suggested filename, extension included. */
25408
+ name: string(),
25409
+ bytes: number().int().nonnegative()
25410
+ });
24985
25411
  method(object({
24986
25412
  deviceId: number(),
24987
25413
  profile: string(),
@@ -25006,6 +25432,9 @@ method(object({
25006
25432
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
25007
25433
  kind: "query",
25008
25434
  auth: "protected"
25435
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
25436
+ kind: "query",
25437
+ auth: "protected"
25009
25438
  });
25010
25439
  /**
25011
25440
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -32025,6 +32454,12 @@ Object.freeze({
32025
32454
  addonId: null,
32026
32455
  access: "create"
32027
32456
  },
32457
+ "recording.cancelRelocateJob": {
32458
+ capName: "recording",
32459
+ capScope: "system",
32460
+ addonId: null,
32461
+ access: "create"
32462
+ },
32028
32463
  "recording.cancelStorageMigrationMove": {
32029
32464
  capName: "recording",
32030
32465
  capScope: "system",
@@ -32079,6 +32514,12 @@ Object.freeze({
32079
32514
  addonId: null,
32080
32515
  access: "view"
32081
32516
  },
32517
+ "recording.listRelocateJobs": {
32518
+ capName: "recording",
32519
+ capScope: "system",
32520
+ addonId: null,
32521
+ access: "view"
32522
+ },
32082
32523
  "recording.locateSegment": {
32083
32524
  capName: "recording",
32084
32525
  capScope: "system",
@@ -32091,6 +32532,12 @@ Object.freeze({
32091
32532
  addonId: null,
32092
32533
  access: "create"
32093
32534
  },
32535
+ "recording.planStorageRebalance": {
32536
+ capName: "recording",
32537
+ capScope: "system",
32538
+ addonId: null,
32539
+ access: "view"
32540
+ },
32094
32541
  "recording.pruneFootage": {
32095
32542
  capName: "recording",
32096
32543
  capScope: "system",
@@ -32115,6 +32562,12 @@ Object.freeze({
32115
32562
  addonId: null,
32116
32563
  access: "create"
32117
32564
  },
32565
+ "recording.relocateFootage": {
32566
+ capName: "recording",
32567
+ capScope: "system",
32568
+ addonId: null,
32569
+ access: "create"
32570
+ },
32118
32571
  "recording.renderClip": {
32119
32572
  capName: "recording",
32120
32573
  capScope: "system",
@@ -32151,38 +32604,50 @@ Object.freeze({
32151
32604
  addonId: null,
32152
32605
  access: "create"
32153
32606
  },
32607
+ "recording.startStorageRebalance": {
32608
+ capName: "recording",
32609
+ capScope: "system",
32610
+ addonId: null,
32611
+ access: "create"
32612
+ },
32154
32613
  "recordingExport.cancelExport": {
32155
- capName: "recordingExport",
32614
+ capName: "recording-export",
32156
32615
  capScope: "system",
32157
32616
  addonId: null,
32158
32617
  access: "create"
32159
32618
  },
32160
32619
  "recordingExport.createExport": {
32161
- capName: "recordingExport",
32620
+ capName: "recording-export",
32162
32621
  capScope: "system",
32163
32622
  addonId: null,
32164
32623
  access: "create"
32165
32624
  },
32166
32625
  "recordingExport.deleteExport": {
32167
- capName: "recordingExport",
32626
+ capName: "recording-export",
32168
32627
  capScope: "system",
32169
32628
  addonId: null,
32170
32629
  access: "delete"
32171
32630
  },
32172
32631
  "recordingExport.getDownloadUrl": {
32173
- capName: "recordingExport",
32632
+ capName: "recording-export",
32174
32633
  capScope: "system",
32175
32634
  addonId: null,
32176
32635
  access: "view"
32177
32636
  },
32178
32637
  "recordingExport.getExport": {
32179
- capName: "recordingExport",
32638
+ capName: "recording-export",
32180
32639
  capScope: "system",
32181
32640
  addonId: null,
32182
32641
  access: "view"
32183
32642
  },
32184
32643
  "recordingExport.listExports": {
32185
- capName: "recordingExport",
32644
+ capName: "recording-export",
32645
+ capScope: "system",
32646
+ addonId: null,
32647
+ access: "view"
32648
+ },
32649
+ "recordingExport.readExportBytes": {
32650
+ capName: "recording-export",
32186
32651
  capScope: "system",
32187
32652
  addonId: null,
32188
32653
  access: "view"
@@ -33559,6 +34024,104 @@ var FramerateField = number().int().min(1).max(60);
33559
34024
  var TargetsField = array(NcRuleTargetSchema).min(1);
33560
34025
  var PriorityField = number().int().min(1).max(5);
33561
34026
  /**
34027
+ * Explicit override of the DENSE sampling cadence, seconds.
34028
+ *
34029
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
34030
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
34031
+ * made that same base 3 s and rendered a person pass as two frames.)
34032
+ *
34033
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
34034
+ * `denseCadenceSec` and played at `framerate` occupies
34035
+ *
34036
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
34037
+ *
34038
+ * 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.
34039
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
34040
+ * and therefore the length of a quiet night, does not move.
34041
+ *
34042
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
34043
+ * the recording has them returns the same frames, requested twice. Must be
34044
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
34045
+ * a uniform video the operator believes is two-rate — and upsert refuses it
34046
+ * rather than letting the export cap reject the render hours after the window.
34047
+ */
34048
+ var DenseCadenceSecField = number().min(.1).max(3600);
34049
+ /**
34050
+ * Minimum seconds of OUTPUT video each detection range must occupy.
34051
+ *
34052
+ * The operator-facing form of the arithmetic above: instead of solving for a
34053
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
34054
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
34055
+ * that range every ~583 ms.
34056
+ *
34057
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
34058
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
34059
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
34060
+ * ranges are sampled denser than they need. Per-range cadences require a cap
34061
+ * schema change and are the tracked follow-up.
34062
+ *
34063
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
34064
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
34065
+ * by real footage, never met by duplicating frames into motion that never
34066
+ * happened.
34067
+ */
34068
+ var MinDwellSecField = number().min(0).max(60);
34069
+ /**
34070
+ * Caption burned into the notification's preview frame.
34071
+ *
34072
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
34073
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
34074
+ * templating dialect for one field would be a second thing to explain.
34075
+ *
34076
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
34077
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
34078
+ * the reason this is not `.min(1)`.
34079
+ */
34080
+ var PreviewTextField = string().max(200);
34081
+ /**
34082
+ * Whether the notification's preview is a STILL or a short animation.
34083
+ *
34084
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
34085
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
34086
+ * night reads better as three seconds of motion than as one frame of it. Both
34087
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
34088
+ * simply applies it to a dozen frames sampled across the render and assembles
34089
+ * them.
34090
+ *
34091
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
34092
+ * seeks and a palette pass, and no rule that never asked for one should start
34093
+ * paying that on the deploy that shipped it.
34094
+ *
34095
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
34096
+ */
34097
+ var PreviewModeField = _enum(["image", "gif"]);
34098
+ /**
34099
+ * Which detection classes the notification reports counts for.
34100
+ *
34101
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
34102
+ * plan — no second query — aggregated per class. Absent or empty means "every
34103
+ * class the window actually contained", which is what an operator who never
34104
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
34105
+ * counts cars all night).
34106
+ *
34107
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
34108
+ * …). An unknown name simply never matches and reports nothing — it is not an
34109
+ * error, because a rule may legitimately name a class this camera's model does
34110
+ * not emit.
34111
+ *
34112
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
34113
+ * - `{{detections}}` — total over the reported classes
34114
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
34115
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
34116
+ * one per class, `count_` + the class name
34117
+ *
34118
+ * With NO custom body template the summary is appended to the derived body, and
34119
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
34120
+ * reads. With a custom template the operator owns every word — nothing is
34121
+ * appended, so `{{detectionSummary}}` is how he asks for it.
34122
+ */
34123
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
34124
+ /**
33562
34125
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
33563
34126
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
33564
34127
  * here (see the ownership note above).
@@ -33578,9 +34141,30 @@ var TimelapseRuleInputSchema = object({
33578
34141
  cadenceSec: CadenceSecField.default(15),
33579
34142
  /** Output frames per second of the assembled mp4 (predecessor parity). */
33580
34143
  framerate: FramerateField.default(10),
34144
+ /**
34145
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
34146
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
34147
+ * field gets.
34148
+ */
34149
+ denseCadenceSec: DenseCadenceSecField.optional(),
34150
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
34151
+ minDwellSec: MinDwellSecField.optional(),
33581
34152
  /** `notification-output` targets the finished video/thumbnail is sent to. */
33582
34153
  targets: TargetsField,
33583
34154
  template: TimelapseTemplateSchema.optional(),
34155
+ /**
34156
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
34157
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
34158
+ *
34159
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
34160
+ * the notification's title/body, and clearing it (`template: null`) must not
34161
+ * silently clear the caption too.
34162
+ */
34163
+ previewText: PreviewTextField.optional(),
34164
+ /** Still or animation — see {@link PreviewModeField}. */
34165
+ previewMode: PreviewModeField.default("image"),
34166
+ /** Classes the notification counts — see {@link ReportClassesField}. */
34167
+ reportClasses: ReportClassesField.optional(),
33584
34168
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
33585
34169
  priority: PriorityField.default(3)
33586
34170
  });
@@ -33591,8 +34175,13 @@ object({
33591
34175
  schedule: NcScheduleSchema.optional(),
33592
34176
  cadenceSec: CadenceSecField.optional(),
33593
34177
  framerate: FramerateField.optional(),
34178
+ denseCadenceSec: DenseCadenceSecField.optional(),
34179
+ minDwellSec: MinDwellSecField.optional(),
33594
34180
  targets: TargetsField.optional(),
33595
34181
  template: TimelapseTemplateSchema.nullable().optional(),
34182
+ previewText: PreviewTextField.optional(),
34183
+ previewMode: PreviewModeField.optional(),
34184
+ reportClasses: ReportClassesField.optional(),
33596
34185
  priority: PriorityField.optional()
33597
34186
  });
33598
34187
  TimelapseRuleInputSchema.extend({
@@ -33604,10 +34193,28 @@ TimelapseRuleInputSchema.extend({
33604
34193
  */
33605
34194
  ownerUserId: string().optional(),
33606
34195
  /**
33607
- * Epoch-ms of the last successful generation the 1-hour re-generation
33608
- * guard's durable state (predecessor parity). Absent = never generated.
34196
+ * Epoch-ms of the NEWEST successful generation across every camera of this
34197
+ * rule. What a UI shows, and the compatibility floor for
34198
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
33609
34199
  */
33610
34200
  lastGeneratedAt: number().optional(),
34201
+ /**
34202
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
34203
+ * re-generation guard's real durable state.
34204
+ *
34205
+ * One rule covers several cameras and each renders its own video, so a rule
34206
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
34207
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
34208
+ * already done — and B's night is gone for good, because the window will not
34209
+ * come back.
34210
+ *
34211
+ * ADDITIVE, so the migration is free: a row written before this field simply
34212
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
34213
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
34214
+ * "never generated" would re-render and re-notify every camera of every rule
34215
+ * once, on the deploy that shipped the map.
34216
+ */
34217
+ generatedByDevice: record(string(), number()).optional(),
33611
34218
  /** userId of the caller who created the rule (server-stamped). */
33612
34219
  createdBy: string(),
33613
34220
  createdAt: number(),