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