@camstack/addon-provider-rademacher 0.2.11 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +936 -48
  2. package/dist/addon.mjs +936 -48
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -8203,8 +8203,31 @@ var AdoptionJobSchema = object({
8203
8203
  error: string().nullable()
8204
8204
  });
8205
8205
  /**
8206
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
8207
- * pipeline functions an operator thinks in terms of.
8206
+ * Per-camera FUNCTION SWITCHES.
8207
+ *
8208
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
8209
+ *
8210
+ * This file shipped as "the one coherent on/off surface over the pipeline
8211
+ * functions an operator thinks in terms of". The operator's verdict on
8212
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
8213
+ * every function already had a settings page of its own, and a second place to
8214
+ * turn it off is a second place to look. Each switch is going back to its own
8215
+ * component's original options — detection to the detection-pipeline wrapper
8216
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
8217
+ * (which was always first-class; the switch was a veneer over
8218
+ * `recording.setDeviceConfig`), notifications to a notification-center
8219
+ * per-device setting, the two camera planes to their own components.
8220
+ *
8221
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
8222
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
8223
+ * straight from the authorities with no group in the middle. That rule was
8224
+ * never about a control panel.
8225
+ *
8226
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
8227
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
8228
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
8229
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
8230
+ * stop; nothing new may be built on it.
8208
8231
  *
8209
8232
  * ## This file adds no state
8210
8233
  *
@@ -8549,14 +8572,21 @@ var RecordingConfigSchema = object({
8549
8572
  /**
8550
8573
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
8551
8574
  *
8552
- * One shape shared by the recorder's `relocateFootage` (segments) and
8553
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
8554
- * page renders both movers with one component. Jobs are in-RAM (a restart
8555
- * forgets them re-running is safe by construction: copy-if-absent, delete
8556
- * after verify) and each completed/failed run also lands one durable ops-log
8557
- * row on the owning addon's surface.
8575
+ * One shape shared by the recorder and pipeline-analytics internal movers.
8576
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
8577
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
8578
+ * Each completed/failed run also lands one durable ops-log row on its owning
8579
+ * addon surface.
8580
+ */
8581
+ /**
8582
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
8583
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
8584
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
8585
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
8586
+ * runs at all.
8558
8587
  */
8559
8588
  var RelocateJobStateSchema = _enum([
8589
+ "queued",
8560
8590
  "running",
8561
8591
  "done",
8562
8592
  "failed",
@@ -8581,19 +8611,109 @@ var RelocateJobSchema = object({
8581
8611
  finishedAt: number().nullable(),
8582
8612
  error: string().nullable()
8583
8613
  });
8614
+ /** Profile-derived footage selection used only by the migration coordinator:
8615
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
8616
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
8584
8617
  var RelocateFootageInputSchema = object({
8585
- deviceId: number().optional(),
8586
8618
  fromLocationId: string(),
8587
8619
  toLocationId: string(),
8588
8620
  entities: array(_enum(["segments"])).optional(),
8621
+ /** Limits relocation to the logical profile class. Omit only for the
8622
+ * pre-orchestration compatibility path. */
8623
+ footageClass: RelocateFootageClassSchema.optional(),
8624
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
8625
+ * is what a whole-disk drain means. The rebalance path always sets it: its
8626
+ * unit is a (camera, profile) pile, not a disk. */
8627
+ deviceId: number().int().optional(),
8628
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
8629
+ * Finer than `footageClass`, which cannot separate high from mid — and the
8630
+ * placement plan assigns those two independently, so a rebalance that could
8631
+ * only say "recordings" would move footage the plan never asked to move. */
8632
+ profiles: array(string()).optional(),
8589
8633
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
8590
8634
  * never allowed to starve live writers. */
8591
8635
  throttleMbps: number().min(1).max(1e3).optional()
8592
8636
  });
8593
- var RelocateMediaInputSchema = object({
8594
- deviceId: number().optional(),
8637
+ /** Internal, lease-scoped participant operation. It is intentionally separate
8638
+ * from persistent recording settings: a migration never changes
8639
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
8640
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
8641
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
8642
+ var StorageMigrationMediaMoveInputSchema = object({
8595
8643
  toLocationId: string(),
8596
8644
  throttleMbps: number().min(1).max(1e3).optional()
8645
+ }).extend({ leaseId: string().min(1) });
8646
+ /** The independently selectable logical storage classes. `recordings`
8647
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
8648
+ * segments; `eventMedia` is post-analysis blobs. */
8649
+ var StorageMigrationClassSchema = _enum([
8650
+ "recordings",
8651
+ "recordingsLow",
8652
+ "eventMedia"
8653
+ ]);
8654
+ /** A destination is always an existing, fully-qualified location id. The
8655
+ * migration API intentionally never changes a source location's `basePath`:
8656
+ * callers create a new `<type>:<slug>` location, then select it here. */
8657
+ var StorageMigrationDestinationsSchema = object({
8658
+ recordings: string().min(1).optional(),
8659
+ recordingsLow: string().min(1).optional(),
8660
+ eventMedia: string().min(1).optional()
8661
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8662
+ /** Shared input for planning and starting an orchestrated storage migration. */
8663
+ var StorageMigrationInputSchema = object({
8664
+ destinations: StorageMigrationDestinationsSchema,
8665
+ throttleMbps: number().min(1).max(1e3).optional()
8666
+ });
8667
+ /** The durable coordinator state machine. The only phase that changes default
8668
+ * locations is `repointing`, after every selected mover has completed and been
8669
+ * verified. */
8670
+ var StorageMigrationPhaseSchema = _enum([
8671
+ "planning",
8672
+ "pausing",
8673
+ "moving",
8674
+ "verifying",
8675
+ "repointing",
8676
+ "refreshing",
8677
+ "resuming",
8678
+ "done",
8679
+ "failed",
8680
+ "cancelled"
8681
+ ]);
8682
+ var StorageMigrationParticipantSchema = _enum([
8683
+ "pipeline",
8684
+ "recorder",
8685
+ "analytics"
8686
+ ]);
8687
+ var StorageMigrationMoveSchema = object({
8688
+ storageClass: StorageMigrationClassSchema,
8689
+ fromLocationId: string(),
8690
+ toLocationId: string(),
8691
+ moverJobId: string().nullable(),
8692
+ state: RelocateJobStateSchema.nullable(),
8693
+ error: string().nullable()
8694
+ });
8695
+ var StorageMigrationJobSchema = object({
8696
+ jobId: string(),
8697
+ phase: StorageMigrationPhaseSchema,
8698
+ destinations: StorageMigrationDestinationsSchema,
8699
+ throttleMbps: number(),
8700
+ moves: array(StorageMigrationMoveSchema),
8701
+ pauseLeaseId: string().nullable(),
8702
+ pausedParticipants: array(StorageMigrationParticipantSchema),
8703
+ repointed: boolean(),
8704
+ cancelRequested: boolean(),
8705
+ startedAt: number(),
8706
+ updatedAt: number(),
8707
+ finishedAt: number().nullable(),
8708
+ error: string().nullable()
8709
+ });
8710
+ var StorageMigrationPlanSchema = object({
8711
+ destinations: StorageMigrationDestinationsSchema,
8712
+ moves: array(object({
8713
+ storageClass: StorageMigrationClassSchema,
8714
+ fromLocationId: string(),
8715
+ toLocationId: string()
8716
+ }))
8597
8717
  });
8598
8718
  /**
8599
8719
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -8645,6 +8765,21 @@ var StorageLocationSchema = object({
8645
8765
  nodeId: string().optional(),
8646
8766
  isDefault: boolean().default(false),
8647
8767
  isSystem: boolean().default(false),
8768
+ /**
8769
+ * Operator opt-in: whether consumers that BALANCE across several locations
8770
+ * of a type may write here. Recordings reads it today; event media and
8771
+ * backups are the next consumers, which is why the flag lives on the
8772
+ * location rather than in any one addon's store — nothing has to be
8773
+ * extended to add the next consumer.
8774
+ *
8775
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
8776
+ * flag existed reads back with no flag and keeps working exactly as before;
8777
+ * that is the whole compat story, and it is why no migration ships with it.
8778
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
8779
+ * disk must not silently start writing to it); the default of a type is
8780
+ * always stamped `true`.
8781
+ */
8782
+ enabled: boolean().optional(),
8648
8783
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8649
8784
  * for node-local locations it can reach) — never persisted, absent when the
8650
8785
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -13197,7 +13332,8 @@ method(object({
13197
13332
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
13198
13333
  /**
13199
13334
  * filesystem-browse — per-node capability for browsing the node's local
13200
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
13335
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
13336
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
13201
13337
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
13202
13338
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
13203
13339
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -15038,6 +15174,13 @@ var MaskGridDimsSchema = object({
15038
15174
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
15039
15175
  * this one field keeps the schema additive — a rule still declares exactly
15040
15176
  * one trigger.
15177
+ *
15178
+ * AUDIO rules add no member here, for the reason occupancy added none: the
15179
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
15180
+ * mirror.ts` fails the build on a member the app cannot render) and every
15181
+ * member costs a release train. A sustained-sound rule is therefore an
15182
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
15183
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
15041
15184
  */
15042
15185
  var NcDeliverySchema = _enum([
15043
15186
  "immediate",
@@ -15052,15 +15195,32 @@ var NcDeliverySchema = _enum([
15052
15195
  * depend on a provider's raw event name or payload shape.
15053
15196
  */
15054
15197
  var NcSystemEventKindSchema = _enum([
15055
- "camera-online",
15056
- "camera-offline",
15198
+ "device-online",
15199
+ "device-offline",
15200
+ "device-disabled",
15201
+ "device-enabled",
15057
15202
  "stream-online",
15058
15203
  "stream-offline",
15059
15204
  "node-online",
15060
15205
  "node-offline",
15061
15206
  "addon-update-available",
15062
- "server-update-available"
15207
+ "server-update-available",
15208
+ "alarm-triggered",
15209
+ "alarm-armed",
15210
+ "alarm-disarmed",
15211
+ "camera-online",
15212
+ "camera-offline",
15213
+ "camera-disabled",
15214
+ "camera-enabled"
15215
+ ]);
15216
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
15217
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
15218
+ "camera-online",
15219
+ "camera-offline",
15220
+ "camera-disabled",
15221
+ "camera-enabled"
15063
15222
  ]);
15223
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
15064
15224
  /**
15065
15225
  * One coherent system-event condition. `kinds` is the required opt-in safety
15066
15226
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -15069,6 +15229,18 @@ var NcSystemEventKindSchema = _enum([
15069
15229
  var NcSystemEventConditionSchema = object({
15070
15230
  kinds: array(NcSystemEventKindSchema).min(1),
15071
15231
  deviceIds: array(number().int()).min(1).optional(),
15232
+ /**
15233
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
15234
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
15235
+ * is what a liveness rule means when nobody said otherwise.
15236
+ *
15237
+ * This is where "only my cameras" is expressed, and it lives on the rule for
15238
+ * one reason: the intake cannot know which devices this household cares
15239
+ * about, and a producer-side filter is one no operator can change. Fails
15240
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
15241
+ * does not carry) matches no `deviceTypes` list.
15242
+ */
15243
+ deviceTypes: array(string().min(1)).min(1).optional(),
15072
15244
  nodeIds: array(string().min(1)).min(1).optional(),
15073
15245
  packageNames: array(string().min(1)).min(1).optional()
15074
15246
  });
@@ -15119,6 +15291,47 @@ var NcOccupancyConditionSchema = object({
15119
15291
  sustainSeconds: number().int().min(0).max(3600).default(15)
15120
15292
  });
15121
15293
  /**
15294
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
15295
+ *
15296
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
15297
+ * reference notifier uses, so an operator moving between them re-uses what
15298
+ * they already know): a rule matches when, over a sampling window of
15299
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
15300
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
15301
+ *
15302
+ * - `dbThreshold` — its level is at or above this many dBFS (see
15303
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
15304
+ * - `labels` — the classifier put at least one of these labels on it.
15305
+ *
15306
+ * Both are OPTIONAL and independent, which is the point of the shape: a
15307
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
15308
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
15309
+ * is given** — a window in which every sample is trivially a hit would fire on
15310
+ * silence, so the engine refuses such a condition rather than notifying on
15311
+ * nothing (the schema cannot express "at least one of" without becoming a
15312
+ * ZodEffects the cap path would have to special-case).
15313
+ *
15314
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
15315
+ * must be FULL before it can match — a window that has been open for two
15316
+ * seconds of its ten is 100% of nothing, and firing on it would make
15317
+ * `samplingSeconds` decorative.
15318
+ *
15319
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
15320
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
15321
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
15322
+ * an operator who typed `dog` mean the same thing.
15323
+ */
15324
+ var NcAudioConditionSchema = object({
15325
+ /** Audio macro labels; absent = any sound (level-only rule). */
15326
+ labels: array(string().min(1)).min(1).optional(),
15327
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
15328
+ dbThreshold: number().min(-96).max(0).optional(),
15329
+ /** Percentage of the window's samples that must be hits (1–100). */
15330
+ hitPercent: number().int().min(1).max(100).default(60),
15331
+ /** Length of the sampling window in seconds. */
15332
+ samplingSeconds: number().int().min(1).max(300).default(10)
15333
+ });
15334
+ /**
15122
15335
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
15123
15336
  *
15124
15337
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -15391,7 +15604,33 @@ var NcConditionsSchema = object({
15391
15604
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
15392
15605
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
15393
15606
  */
15394
- occupancy: NcOccupancyConditionSchema.optional()
15607
+ occupancy: NcOccupancyConditionSchema.optional(),
15608
+ /**
15609
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
15610
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
15611
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
15612
+ * a window that is not full yet, neither filter given). See
15613
+ * {@link NcAudioCondition}.
15614
+ *
15615
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
15616
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
15617
+ * a detection, a track or a device event (the same fail-closed pairing
15618
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
15619
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
15620
+ * (an `immediate` rule naming an `audio-*` class, one notification per
15621
+ * classified sample) stays exactly as it was for rules that already use it.
15622
+ *
15623
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
15624
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
15625
+ * (`camstack/src/data/notification-center.ts`, guarded by
15626
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
15627
+ * condition fields it does not know when a rule is saved from the phone.
15628
+ * Publishing an editor for a condition the app cannot round-trip is how an
15629
+ * operator loses a rule's conditions by opening it — so the descriptor, the
15630
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
15631
+ * does an audio rule become authorable.
15632
+ */
15633
+ audio: NcAudioConditionSchema.optional()
15395
15634
  });
15396
15635
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
15397
15636
  var NcRuleTargetSchema = object({
@@ -15505,6 +15744,73 @@ var NcThrottleSchema = object({
15505
15744
  */
15506
15745
  granularity: NcThrottleGranularitySchema.optional()
15507
15746
  });
15747
+ /**
15748
+ * How long the confirm gate may hold ONE notification, and how big the picture
15749
+ * it judges may be.
15750
+ *
15751
+ * The clamp is the product decision, not a coincidence of the model: p50 was
15752
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
15753
+ * arrives after the visitor has gone is not a notification. 448 px was enough
15754
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
15755
+ * tokens for pixels the model pools away.
15756
+ */
15757
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
15758
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
15759
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
15760
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
15761
+ var NcConfirmExpectSchema = object({
15762
+ op: _enum([
15763
+ ">=",
15764
+ ">",
15765
+ "<=",
15766
+ "<",
15767
+ "=="
15768
+ ]),
15769
+ count: number().int().min(0).max(1e3)
15770
+ });
15771
+ /**
15772
+ * AI CONFIRM — a vision model looks at the picture this notification is about
15773
+ * to ship and says whether it agrees with the rule.
15774
+ *
15775
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
15776
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
15777
+ * on the operator's phone is not a verdict about this notification.
15778
+ *
15779
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
15780
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
15781
+ * the default and every fail-open is COUNTED, because a gate that always fails
15782
+ * open looks in the log exactly like a gate that works.
15783
+ *
15784
+ * Every field is `.optional()` rather than relied on as a Zod default at the
15785
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
15786
+ * production failures in one day), so the gate reads absent as the constant
15787
+ * above rather than trusting a parse it may never have seen.
15788
+ */
15789
+ var NcConfirmSchema = object({
15790
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
15791
+ * same thing, and both mean "deliver exactly as before". */
15792
+ enabled: boolean().default(false),
15793
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
15794
+ profileId: string().optional(),
15795
+ /**
15796
+ * The operator's question, in his own words. Absent = a question derived
15797
+ * from the rule (its class and its expectation).
15798
+ *
15799
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
15800
+ * banners, signage and plates as instructions if you let them reach the
15801
+ * prompt — proven live — so the authoritative contract stays in the system
15802
+ * turn and only rule-authored words land here.
15803
+ */
15804
+ prompt: string().max(1e3).optional(),
15805
+ /** Fire only when the model's count satisfies this. Absent = the model's
15806
+ * own boolean verdict decides. */
15807
+ expect: NcConfirmExpectSchema.optional(),
15808
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
15809
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
15810
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
15811
+ /** Longest edge the judged image is downscaled to before it is sent. */
15812
+ maxImagePx: number().int().min(64).max(2048).default(448)
15813
+ });
15508
15814
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
15509
15815
  var NcRuleInputSchema = object({
15510
15816
  name: string().min(1).max(200),
@@ -15565,7 +15871,13 @@ var NcRuleInputSchema = object({
15565
15871
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
15566
15872
  * shape as every other actuation.
15567
15873
  */
15568
- actions: NcRuleActionsSchema.optional()
15874
+ actions: NcRuleActionsSchema.optional(),
15875
+ /**
15876
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
15877
+ * a rule that predates the gate must keep delivering byte-for-byte as it
15878
+ * did, and absent is the only way to say that without a migration.
15879
+ */
15880
+ confirm: NcConfirmSchema.optional()
15569
15881
  });
15570
15882
  /**
15571
15883
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -15576,7 +15888,37 @@ var NcRuleInputSchema = object({
15576
15888
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
15577
15889
  * `updateRule` patch.
15578
15890
  */
15579
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
15891
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
15892
+ disabledTargetIds: array(string()).optional(),
15893
+ /**
15894
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
15895
+ *
15896
+ * It makes the key optional to SUPPLY; the parse still materialises the
15897
+ * default when the key is absent. And `NcRuleStore.update` merges with
15898
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
15899
+ * one — which made every partial edit destructive:
15900
+ *
15901
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
15902
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
15903
+ * setEnabled(ruleId, false) → conditions reset to `{}`
15904
+ *
15905
+ * A rule scoped to one camera and one zone silently became a rule that
15906
+ * matches EVERY event on EVERY camera, and lost its `media` policy
15907
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
15908
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
15909
+ * within a minute of a two-field patch.
15910
+ *
15911
+ * So every defaulted field is re-declared here WITHOUT its default. The
15912
+ * inner defaults still apply when the caller DOES send the key — `{}` for
15913
+ * conditions remains a real instruction ("clear them") — and only the
15914
+ * absent key is now genuinely absent.
15915
+ */
15916
+ enabled: boolean().optional(),
15917
+ conditions: NcConditionsSchema.optional(),
15918
+ media: NcMediaPolicySchema.optional(),
15919
+ throttle: NcThrottleSchema.optional(),
15920
+ priority: number().int().min(1).max(5).optional()
15921
+ });
15580
15922
  /** A persisted rule. */
15581
15923
  var NcRuleSchema = NcRuleInputSchema.extend({
15582
15924
  id: string(),
@@ -15877,6 +16219,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
15877
16219
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
15878
16220
  * copy would lie the first time a rule is disabled.
15879
16221
  */
16222
+ /**
16223
+ * Why a device a mode NAMES is nonetheless not armed by it.
16224
+ *
16225
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
16226
+ * per-camera notification switch the Notification Center already owns,
16227
+ * `detection-off` is the device's own detection binding being inactive, and
16228
+ * `offline` is the device manager's liveness. A fourth reason would mean a
16229
+ * fourth authority, and inventing one here is how a panel starts disagreeing
16230
+ * with the switches the operator actually used.
16231
+ */
16232
+ var NcAlarmSkipReasonSchema = _enum([
16233
+ "muted",
16234
+ "detection-off",
16235
+ "offline"
16236
+ ]);
16237
+ var NcAlarmSkippedDeviceSchema = object({
16238
+ deviceId: number().int(),
16239
+ reason: NcAlarmSkipReasonSchema
16240
+ });
15880
16241
  var NcAlarmModeCoverageSchema = object({
15881
16242
  mode: AlarmArmModeSchema,
15882
16243
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -15884,7 +16245,18 @@ var NcAlarmModeCoverageSchema = object({
15884
16245
  /** At least one covering rule has no device scope, so the mode covers all. */
15885
16246
  allDevices: boolean(),
15886
16247
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
15887
- deviceIds: array(number().int())
16248
+ deviceIds: array(number().int()),
16249
+ /**
16250
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
16251
+ * excludes it.
16252
+ *
16253
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
16254
+ * twelve makes it false in exactly the way nobody notices until an incident.
16255
+ * Defaulted to `[]` so a coverage answer computed before this field existed
16256
+ * still parses as "nothing known to be skipped" rather than failing the whole
16257
+ * alarm tab.
16258
+ */
16259
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
15888
16260
  });
15889
16261
  var NcAlarmConfigSchema = object({
15890
16262
  /**
@@ -17247,13 +17619,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17247
17619
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
17248
17620
  kind: "mutation",
17249
17621
  auth: "admin"
17250
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
17622
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
17251
17623
  kind: "mutation",
17252
17624
  auth: "admin"
17253
- }), method(object({}), array(RelocateJobSchema).readonly(), {
17254
- kind: "query",
17625
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
17626
+ kind: "mutation",
17255
17627
  auth: "admin"
17256
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
17628
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
17629
+ kind: "mutation",
17630
+ auth: "admin"
17631
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
17632
+ kind: "mutation",
17633
+ auth: "admin"
17634
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
17257
17635
  kind: "mutation",
17258
17636
  auth: "admin"
17259
17637
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -18710,9 +19088,16 @@ var CameraStatusSchema = object({
18710
19088
  audio: CameraAudioStatusSchema.nullable(),
18711
19089
  recording: CameraRecordingStatusSchema.nullable(),
18712
19090
  /**
18713
- * Per-camera function switches an OPERATOR has turned off
19091
+ * Per-camera functions an OPERATOR has turned off
18714
19092
  * ([D61](../../../../docs/decisions/adr-0067.md)).
18715
19093
  *
19094
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
19095
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
19096
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
19097
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
19098
+ * The badge outlives the control panel: the panel was a convenience, this is
19099
+ * the difference between a camera being off and a camera being dead.
19100
+ *
18716
19101
  * This is the difference between DISABLED and BROKEN. A camera whose
18717
19102
  * `detection` block reports zero fps and whose `switchedOff` contains
18718
19103
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -18783,7 +19168,13 @@ var NodeInferenceDevicesSchema = object({
18783
19168
  reachable: boolean(),
18784
19169
  devices: array(NodeInferenceDeviceSchema).readonly()
18785
19170
  });
18786
- method(object({
19171
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
19172
+ kind: "mutation",
19173
+ auth: "admin"
19174
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
19175
+ kind: "mutation",
19176
+ auth: "admin"
19177
+ }), method(object({
18787
19178
  deviceId: number(),
18788
19179
  agentNodeId: string()
18789
19180
  }), object({ success: literal(true) }), {
@@ -19457,6 +19848,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
19457
19848
  locationId: string(),
19458
19849
  targetBytes: number().int().positive()
19459
19850
  }), EvictResultSchema, { kind: "mutation" });
19851
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
19852
+ kind: "mutation",
19853
+ auth: "admin"
19854
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
19855
+ kind: "mutation",
19856
+ auth: "admin"
19857
+ });
19460
19858
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
19461
19859
  providerId: string().min(1),
19462
19860
  displayName: string().min(1),
@@ -19560,6 +19958,28 @@ var TerminalProfileInfoSchema = object({
19560
19958
  label: string(),
19561
19959
  description: string().optional()
19562
19960
  });
19961
+ /**
19962
+ * A durable operator-created Terminal instance. Profiles are templates; only
19963
+ * an instance declares a camera.
19964
+ */
19965
+ var TerminalInstanceInfoSchema = object({
19966
+ instanceId: string(),
19967
+ cameraStableId: string(),
19968
+ nodeId: string(),
19969
+ profileId: string(),
19970
+ profileLabel: string(),
19971
+ name: string(),
19972
+ enabled: boolean()
19973
+ });
19974
+ var TerminalLegacyCameraSchema = object({
19975
+ stableId: string(),
19976
+ nodeId: string(),
19977
+ profileId: string(),
19978
+ profileLabel: string(),
19979
+ name: string(),
19980
+ /** Only legacy monitor cameras can retain their historic stable identity. */
19981
+ adoptable: boolean()
19982
+ });
19563
19983
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
19564
19984
  seq: number().int().positive(),
19565
19985
  kind: literal("data"),
@@ -19576,7 +19996,29 @@ var TerminalOutputBatchSchema = object({
19576
19996
  snapshot: string().optional(),
19577
19997
  events: array(TerminalOutputEventSchema).readonly()
19578
19998
  });
19579
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
19999
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
20000
+ targetNodeId: string().min(1),
20001
+ profileId: string().min(1),
20002
+ name: string().trim().min(1).max(160).optional()
20003
+ }), TerminalInstanceInfoSchema, {
20004
+ kind: "mutation",
20005
+ auth: "admin"
20006
+ }), method(object({ instanceId: string().min(1) }), _void(), {
20007
+ kind: "mutation",
20008
+ auth: "admin"
20009
+ }), method(object({
20010
+ instanceId: string().min(1),
20011
+ enabled: boolean()
20012
+ }), TerminalInstanceInfoSchema, {
20013
+ kind: "mutation",
20014
+ auth: "admin"
20015
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
20016
+ stableId: string().min(1),
20017
+ name: string().trim().min(1).max(160).optional()
20018
+ }), TerminalInstanceInfoSchema, {
20019
+ kind: "mutation",
20020
+ auth: "admin"
20021
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
19580
20022
  profileId: string(),
19581
20023
  cols: number().int().positive(),
19582
20024
  rows: number().int().positive()
@@ -19593,7 +20035,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
19593
20035
  }), method(object({
19594
20036
  sessionId: string(),
19595
20037
  afterSeq: number().int().nonnegative(),
19596
- waitMs: number().int().min(0).max(2e3).default(0)
20038
+ waitMs: number().int().min(0).max(2e3).default(0),
20039
+ /**
20040
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
20041
+ * browser's initial repaint remains immediate; the camera snapshot
20042
+ * relay uses it to avoid encoding a blank startup frame.
20043
+ */
20044
+ waitForOutput: boolean().optional()
19597
20045
  }), TerminalOutputBatchSchema, {
19598
20046
  kind: "mutation",
19599
20047
  auth: "admin",
@@ -22091,6 +22539,7 @@ var FaceInfoSchema = object({
22091
22539
  var FaceFilterEnum = _enum([
22092
22540
  "unassigned",
22093
22541
  "recognized",
22542
+ "identified",
22094
22543
  "all"
22095
22544
  ]);
22096
22545
  var MediaFileLiteSchema$1 = object({
@@ -22119,6 +22568,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string(
22119
22568
  kind: "mutation",
22120
22569
  auth: "admin"
22121
22570
  }), method(object({
22571
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
22572
+ deviceId: number().int().optional(),
22122
22573
  limit: number().int().positive().optional(),
22123
22574
  filter: FaceFilterEnum.optional(),
22124
22575
  /**
@@ -24348,6 +24799,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
24348
24799
  capName: string().min(1).max(64),
24349
24800
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
24350
24801
  valuePath: string().min(1).max(64)
24802
+ }),
24803
+ object({
24804
+ kind: literal("latest-recognition"),
24805
+ recognition: _enum(["person", "plate"])
24351
24806
  })
24352
24807
  ]);
24353
24808
  var OsdSlotBindingSchema = object({
@@ -24453,6 +24908,15 @@ method(object({ deviceId: number().int() }), object({
24453
24908
  }), object({ success: literal(true) }), {
24454
24909
  kind: "mutation",
24455
24910
  auth: "admin"
24911
+ }), method(object({
24912
+ sourceDeviceId: number().int(),
24913
+ targetDeviceId: number().int()
24914
+ }), object({
24915
+ copied: number().int().nonnegative(),
24916
+ skipped: number().int().nonnegative()
24917
+ }), {
24918
+ kind: "mutation",
24919
+ auth: "admin"
24456
24920
  }), method(object({
24457
24921
  deviceId: number().int(),
24458
24922
  slotId: string().min(1),
@@ -25375,7 +25839,19 @@ var RecordingManifestSchema = object({
25375
25839
  * profiles/subtrees/locations on this node). */
25376
25840
  var RecordingDeviceUsageSchema = object({
25377
25841
  deviceId: number(),
25378
- usedBytes: number()
25842
+ usedBytes: number(),
25843
+ /**
25844
+ * Start of this camera's OLDEST indexed segment, across every profile and
25845
+ * location — the "Oldest footage" column in Recordings → Storage, and the
25846
+ * only honest answer to "is retention actually holding?" per camera.
25847
+ *
25848
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
25849
+ * predates this field omits it entirely, and a hub whose types carry the
25850
+ * field must keep validating that older provider's payload: the framework
25851
+ * (types) and the addon ship on different trains, and the addon is usually
25852
+ * the later of the two.
25853
+ */
25854
+ oldestMs: number().nullable().optional()
25379
25855
  });
25380
25856
  /** Recording storage usage + capacity for one storage location. */
25381
25857
  var RecordingLocationUsageSchema = object({
@@ -25403,6 +25879,57 @@ var RecordingStorageUsageSchema = object({
25403
25879
  locations: array(RecordingLocationUsageSchema)
25404
25880
  });
25405
25881
  /**
25882
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
25883
+ *
25884
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
25885
+ * is the operator asking for the EXISTING archive to be brought into line with
25886
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
25887
+ * location, run FIFO behind the single-flight mover.
25888
+ *
25889
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
25890
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
25891
+ * (empty on the plan).
25892
+ */
25893
+ var RecordingRebalanceMoveSchema = object({
25894
+ deviceId: number(),
25895
+ profile: string(),
25896
+ fromLocationId: string(),
25897
+ toLocationId: string(),
25898
+ bytes: number(),
25899
+ files: number().int()
25900
+ });
25901
+ /** Why a pile that is out of place is staying there. Every refusal is
25902
+ * reported: a rebalance that silently drops a camera reads exactly like one
25903
+ * that had nothing to do. */
25904
+ var RecordingRebalanceSkipReasonSchema = _enum([
25905
+ "unassigned",
25906
+ "target-not-writable",
25907
+ "below-threshold",
25908
+ "no-headroom"
25909
+ ]);
25910
+ var RecordingRebalanceSkipSchema = object({
25911
+ deviceId: number(),
25912
+ profile: string(),
25913
+ fromLocationId: string(),
25914
+ /** The location the plan wants; null when the camera has no assignment. */
25915
+ toLocationId: string().nullable(),
25916
+ bytes: number(),
25917
+ reason: RecordingRebalanceSkipReasonSchema
25918
+ });
25919
+ var RecordingRebalancePlanSchema = object({
25920
+ moves: array(RecordingRebalanceMoveSchema),
25921
+ skipped: array(RecordingRebalanceSkipSchema),
25922
+ bytesToMove: number(),
25923
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
25924
+ jobIds: array(string())
25925
+ });
25926
+ var RecordingRebalanceInputSchema = object({
25927
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
25928
+ throttleMbps: number().min(1).max(1e3).optional(),
25929
+ /** Ignore piles smaller than this (default 1 GB). */
25930
+ minMoveGb: number().min(0).optional()
25931
+ });
25932
+ /**
25406
25933
  * Result of locating footage at a wall-clock instant for one device/profile.
25407
25934
  * `segment` carries the covering segment's window; `gap` reports the forward
25408
25935
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -25550,6 +26077,21 @@ method(object({
25550
26077
  }), {
25551
26078
  kind: "mutation",
25552
26079
  auth: "admin"
26080
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
26081
+ kind: "mutation",
26082
+ auth: "admin"
26083
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
26084
+ kind: "mutation",
26085
+ auth: "admin"
26086
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
26087
+ kind: "mutation",
26088
+ auth: "admin"
26089
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
26090
+ kind: "mutation",
26091
+ auth: "admin"
26092
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
26093
+ kind: "mutation",
26094
+ auth: "admin"
25553
26095
  }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
25554
26096
  kind: "mutation",
25555
26097
  auth: "admin"
@@ -25559,9 +26101,15 @@ method(object({
25559
26101
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
25560
26102
  kind: "mutation",
25561
26103
  auth: "admin"
26104
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
26105
+ kind: "query",
26106
+ auth: "admin"
26107
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
26108
+ kind: "mutation",
26109
+ auth: "admin"
25562
26110
  });
25563
26111
  /**
25564
- * `recordingExport` cap — render a footage time range into a single downloadable
26112
+ * `recording-export` cap — render a footage time range into a single downloadable
25565
26113
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
25566
26114
  * bounded lifetime with a durable history, auto-expiry, and optional
25567
26115
  * delete-after-download.
@@ -25576,10 +26124,42 @@ method(object({
25576
26124
  */
25577
26125
  /** Playback-speed multiplier for the render (1 = realtime). */
25578
26126
  var ExportSpeedSchema = number().min(.25).max(32);
26127
+ /**
26128
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
26129
+ *
26130
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
26131
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
26132
+ * playlist. Handing it absolute epochs would make every call site responsible
26133
+ * for the same subtraction, and the one that forgot would emit a filter that
26134
+ * selects nothing — silently, as a uniform timelapse.
26135
+ */
26136
+ var ExportDenseRangeSchema = object({
26137
+ fromSec: number().nonnegative(),
26138
+ toSec: number().nonnegative()
26139
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
26140
+ /**
26141
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
26142
+ * listed ranges and at the base `everyMs` everywhere else.
26143
+ *
26144
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
26145
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
26146
+ */
26147
+ var ExportDenseSchema = object({
26148
+ everyMs: number().int().positive(),
26149
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
26150
+ });
25579
26151
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
25580
26152
  var ExportTimelapseSchema = object({
25581
26153
  everyMs: number().int().positive(),
25582
- outputFps: number().int().min(1).max(60).optional()
26154
+ outputFps: number().int().min(1).max(60).optional(),
26155
+ /** Optional second, FASTER rate over the intervals that matter. */
26156
+ dense: ExportDenseSchema.optional()
26157
+ }).superRefine((v, ctx) => {
26158
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
26159
+ code: ZodIssueCode.custom,
26160
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
26161
+ path: ["dense", "everyMs"]
26162
+ });
25583
26163
  });
25584
26164
  /**
25585
26165
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -25637,6 +26217,19 @@ var ExportDownloadSchema = object({
25637
26217
  url: string(),
25638
26218
  endpoints: array(string())
25639
26219
  });
26220
+ /**
26221
+ * A finished export's bytes, inline.
26222
+ *
26223
+ * `bytes` is the DECODED length — the number the caller bounds and logs
26224
+ * against, so nobody has to infer it from the base64 length.
26225
+ */
26226
+ var ExportBytesSchema = object({
26227
+ base64: string(),
26228
+ contentType: string(),
26229
+ /** Suggested filename, extension included. */
26230
+ name: string(),
26231
+ bytes: number().int().nonnegative()
26232
+ });
25640
26233
  method(object({
25641
26234
  deviceId: number(),
25642
26235
  profile: string(),
@@ -25661,6 +26254,9 @@ method(object({
25661
26254
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
25662
26255
  kind: "query",
25663
26256
  auth: "protected"
26257
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
26258
+ kind: "query",
26259
+ auth: "protected"
25664
26260
  });
25665
26261
  /**
25666
26262
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -31162,6 +31758,12 @@ Object.freeze({
31162
31758
  addonId: null,
31163
31759
  access: "delete"
31164
31760
  },
31761
+ "osdManager.copyDeviceConfiguration": {
31762
+ capName: "osd-manager",
31763
+ capScope: "system",
31764
+ addonId: null,
31765
+ access: "create"
31766
+ },
31165
31767
  "osdManager.getConditionSupport": {
31166
31768
  capName: "osd-manager",
31167
31769
  capScope: "system",
@@ -31258,7 +31860,7 @@ Object.freeze({
31258
31860
  addonId: null,
31259
31861
  access: "create"
31260
31862
  },
31261
- "pipelineAnalytics.cancelMediaRelocate": {
31863
+ "pipelineAnalytics.cancelStorageMigrationMove": {
31262
31864
  capName: "pipeline-analytics",
31263
31865
  capScope: "device",
31264
31866
  addonId: null,
@@ -31330,12 +31932,6 @@ Object.freeze({
31330
31932
  addonId: null,
31331
31933
  access: "view"
31332
31934
  },
31333
- "pipelineAnalytics.getMediaRelocateStatus": {
31334
- capName: "pipeline-analytics",
31335
- capScope: "device",
31336
- addonId: null,
31337
- access: "view"
31338
- },
31339
31935
  "pipelineAnalytics.getMotionEvents": {
31340
31936
  capName: "pipeline-analytics",
31341
31937
  capScope: "device",
@@ -31372,6 +31968,12 @@ Object.freeze({
31372
31968
  addonId: null,
31373
31969
  access: "view"
31374
31970
  },
31971
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
31972
+ capName: "pipeline-analytics",
31973
+ capScope: "device",
31974
+ addonId: null,
31975
+ access: "view"
31976
+ },
31375
31977
  "pipelineAnalytics.getTrack": {
31376
31978
  capName: "pipeline-analytics",
31377
31979
  capScope: "device",
@@ -31450,6 +32052,12 @@ Object.freeze({
31450
32052
  addonId: null,
31451
32053
  access: "view"
31452
32054
  },
32055
+ "pipelineAnalytics.pauseForStorageMigration": {
32056
+ capName: "pipeline-analytics",
32057
+ capScope: "device",
32058
+ addonId: null,
32059
+ access: "create"
32060
+ },
31453
32061
  "pipelineAnalytics.proposeRetrainAnnotations": {
31454
32062
  capName: "pipeline-analytics",
31455
32063
  capScope: "device",
@@ -31480,7 +32088,7 @@ Object.freeze({
31480
32088
  addonId: null,
31481
32089
  access: "create"
31482
32090
  },
31483
- "pipelineAnalytics.relocateMedia": {
32091
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
31484
32092
  capName: "pipeline-analytics",
31485
32093
  capScope: "device",
31486
32094
  addonId: null,
@@ -31492,6 +32100,12 @@ Object.freeze({
31492
32100
  addonId: null,
31493
32101
  access: "create"
31494
32102
  },
32103
+ "pipelineAnalytics.resumeForStorageMigration": {
32104
+ capName: "pipeline-analytics",
32105
+ capScope: "device",
32106
+ addonId: null,
32107
+ access: "create"
32108
+ },
31495
32109
  "pipelineAnalytics.saveRetrainAnnotations": {
31496
32110
  capName: "pipeline-analytics",
31497
32111
  capScope: "device",
@@ -31516,6 +32130,12 @@ Object.freeze({
31516
32130
  addonId: null,
31517
32131
  access: "create"
31518
32132
  },
32133
+ "pipelineAnalytics.startStorageMigrationMove": {
32134
+ capName: "pipeline-analytics",
32135
+ capScope: "device",
32136
+ addonId: null,
32137
+ access: "create"
32138
+ },
31519
32139
  "pipelineAnalytics.wipeAllAnalytics": {
31520
32140
  capName: "pipeline-analytics",
31521
32141
  capScope: "device",
@@ -31882,6 +32502,12 @@ Object.freeze({
31882
32502
  addonId: null,
31883
32503
  access: "view"
31884
32504
  },
32505
+ "pipelineOrchestrator.pauseForStorageMigration": {
32506
+ capName: "pipeline-orchestrator",
32507
+ capScope: "system",
32508
+ addonId: null,
32509
+ access: "create"
32510
+ },
31885
32511
  "pipelineOrchestrator.rebalance": {
31886
32512
  capName: "pipeline-orchestrator",
31887
32513
  capScope: "system",
@@ -31906,6 +32532,12 @@ Object.freeze({
31906
32532
  addonId: null,
31907
32533
  access: "view"
31908
32534
  },
32535
+ "pipelineOrchestrator.resumeForStorageMigration": {
32536
+ capName: "pipeline-orchestrator",
32537
+ capScope: "system",
32538
+ addonId: null,
32539
+ access: "create"
32540
+ },
31909
32541
  "pipelineOrchestrator.saveTemplate": {
31910
32542
  capName: "pipeline-orchestrator",
31911
32543
  capScope: "system",
@@ -32302,7 +32934,13 @@ Object.freeze({
32302
32934
  addonId: null,
32303
32935
  access: "create"
32304
32936
  },
32305
- "recording.cancelRelocate": {
32937
+ "recording.cancelRelocateJob": {
32938
+ capName: "recording",
32939
+ capScope: "system",
32940
+ addonId: null,
32941
+ access: "create"
32942
+ },
32943
+ "recording.cancelStorageMigrationMove": {
32306
32944
  capName: "recording",
32307
32945
  capScope: "system",
32308
32946
  addonId: null,
@@ -32338,7 +32976,7 @@ Object.freeze({
32338
32976
  addonId: null,
32339
32977
  access: "view"
32340
32978
  },
32341
- "recording.getRelocateStatus": {
32979
+ "recording.getStorageMigrationMoveStatus": {
32342
32980
  capName: "recording",
32343
32981
  capScope: "system",
32344
32982
  addonId: null,
@@ -32356,12 +32994,30 @@ Object.freeze({
32356
32994
  addonId: null,
32357
32995
  access: "view"
32358
32996
  },
32997
+ "recording.listRelocateJobs": {
32998
+ capName: "recording",
32999
+ capScope: "system",
33000
+ addonId: null,
33001
+ access: "view"
33002
+ },
32359
33003
  "recording.locateSegment": {
32360
33004
  capName: "recording",
32361
33005
  capScope: "system",
32362
33006
  addonId: null,
32363
33007
  access: "view"
32364
33008
  },
33009
+ "recording.pauseForStorageMigration": {
33010
+ capName: "recording",
33011
+ capScope: "system",
33012
+ addonId: null,
33013
+ access: "create"
33014
+ },
33015
+ "recording.planStorageRebalance": {
33016
+ capName: "recording",
33017
+ capScope: "system",
33018
+ addonId: null,
33019
+ access: "view"
33020
+ },
32365
33021
  "recording.pruneFootage": {
32366
33022
  capName: "recording",
32367
33023
  capScope: "system",
@@ -32380,6 +33036,12 @@ Object.freeze({
32380
33036
  addonId: null,
32381
33037
  access: "view"
32382
33038
  },
33039
+ "recording.refreshStorageLocationsForMigration": {
33040
+ capName: "recording",
33041
+ capScope: "system",
33042
+ addonId: null,
33043
+ access: "create"
33044
+ },
32383
33045
  "recording.relocateFootage": {
32384
33046
  capName: "recording",
32385
33047
  capScope: "system",
@@ -32404,44 +33066,68 @@ Object.freeze({
32404
33066
  addonId: null,
32405
33067
  access: "create"
32406
33068
  },
33069
+ "recording.resumeForStorageMigration": {
33070
+ capName: "recording",
33071
+ capScope: "system",
33072
+ addonId: null,
33073
+ access: "create"
33074
+ },
32407
33075
  "recording.setDeviceConfig": {
32408
33076
  capName: "recording",
32409
33077
  capScope: "system",
32410
33078
  addonId: null,
32411
33079
  access: "create"
32412
33080
  },
33081
+ "recording.startStorageMigrationMove": {
33082
+ capName: "recording",
33083
+ capScope: "system",
33084
+ addonId: null,
33085
+ access: "create"
33086
+ },
33087
+ "recording.startStorageRebalance": {
33088
+ capName: "recording",
33089
+ capScope: "system",
33090
+ addonId: null,
33091
+ access: "create"
33092
+ },
32413
33093
  "recordingExport.cancelExport": {
32414
- capName: "recordingExport",
33094
+ capName: "recording-export",
32415
33095
  capScope: "system",
32416
33096
  addonId: null,
32417
33097
  access: "create"
32418
33098
  },
32419
33099
  "recordingExport.createExport": {
32420
- capName: "recordingExport",
33100
+ capName: "recording-export",
32421
33101
  capScope: "system",
32422
33102
  addonId: null,
32423
33103
  access: "create"
32424
33104
  },
32425
33105
  "recordingExport.deleteExport": {
32426
- capName: "recordingExport",
33106
+ capName: "recording-export",
32427
33107
  capScope: "system",
32428
33108
  addonId: null,
32429
33109
  access: "delete"
32430
33110
  },
32431
33111
  "recordingExport.getDownloadUrl": {
32432
- capName: "recordingExport",
33112
+ capName: "recording-export",
32433
33113
  capScope: "system",
32434
33114
  addonId: null,
32435
33115
  access: "view"
32436
33116
  },
32437
33117
  "recordingExport.getExport": {
32438
- capName: "recordingExport",
33118
+ capName: "recording-export",
32439
33119
  capScope: "system",
32440
33120
  addonId: null,
32441
33121
  access: "view"
32442
33122
  },
32443
33123
  "recordingExport.listExports": {
32444
- capName: "recordingExport",
33124
+ capName: "recording-export",
33125
+ capScope: "system",
33126
+ addonId: null,
33127
+ access: "view"
33128
+ },
33129
+ "recordingExport.readExportBytes": {
33130
+ capName: "recording-export",
32445
33131
  capScope: "system",
32446
33132
  addonId: null,
32447
33133
  access: "view"
@@ -32800,6 +33486,30 @@ Object.freeze({
32800
33486
  addonId: null,
32801
33487
  access: "view"
32802
33488
  },
33489
+ "storageMigration.cancel": {
33490
+ capName: "storage-migration",
33491
+ capScope: "system",
33492
+ addonId: null,
33493
+ access: "create"
33494
+ },
33495
+ "storageMigration.plan": {
33496
+ capName: "storage-migration",
33497
+ capScope: "system",
33498
+ addonId: null,
33499
+ access: "view"
33500
+ },
33501
+ "storageMigration.start": {
33502
+ capName: "storage-migration",
33503
+ capScope: "system",
33504
+ addonId: null,
33505
+ access: "create"
33506
+ },
33507
+ "storageMigration.status": {
33508
+ capName: "storage-migration",
33509
+ capScope: "system",
33510
+ addonId: null,
33511
+ access: "view"
33512
+ },
32803
33513
  "storageProvider.abortUpload": {
32804
33514
  capName: "storage-provider",
32805
33515
  capScope: "system",
@@ -33178,12 +33888,42 @@ Object.freeze({
33178
33888
  addonId: null,
33179
33889
  access: "create"
33180
33890
  },
33891
+ "terminalSession.adoptLegacyMonitor": {
33892
+ capName: "terminal-session",
33893
+ capScope: "system",
33894
+ addonId: null,
33895
+ access: "create"
33896
+ },
33181
33897
  "terminalSession.close": {
33182
33898
  capName: "terminal-session",
33183
33899
  capScope: "system",
33184
33900
  addonId: null,
33185
33901
  access: "create"
33186
33902
  },
33903
+ "terminalSession.createInstance": {
33904
+ capName: "terminal-session",
33905
+ capScope: "system",
33906
+ addonId: null,
33907
+ access: "create"
33908
+ },
33909
+ "terminalSession.deleteInstance": {
33910
+ capName: "terminal-session",
33911
+ capScope: "system",
33912
+ addonId: null,
33913
+ access: "delete"
33914
+ },
33915
+ "terminalSession.listInstances": {
33916
+ capName: "terminal-session",
33917
+ capScope: "system",
33918
+ addonId: null,
33919
+ access: "view"
33920
+ },
33921
+ "terminalSession.listLegacyCameras": {
33922
+ capName: "terminal-session",
33923
+ capScope: "system",
33924
+ addonId: null,
33925
+ access: "view"
33926
+ },
33187
33927
  "terminalSession.listProfiles": {
33188
33928
  capName: "terminal-session",
33189
33929
  capScope: "system",
@@ -33214,6 +33954,12 @@ Object.freeze({
33214
33954
  addonId: null,
33215
33955
  access: "create"
33216
33956
  },
33957
+ "terminalSession.setInstanceEnabled": {
33958
+ capName: "terminal-session",
33959
+ capScope: "system",
33960
+ addonId: null,
33961
+ access: "create"
33962
+ },
33217
33963
  "terminalSession.writeInput": {
33218
33964
  capName: "terminal-session",
33219
33965
  capScope: "system",
@@ -33758,6 +34504,104 @@ var FramerateField = number().int().min(1).max(60);
33758
34504
  var TargetsField = array(NcRuleTargetSchema).min(1);
33759
34505
  var PriorityField = number().int().min(1).max(5);
33760
34506
  /**
34507
+ * Explicit override of the DENSE sampling cadence, seconds.
34508
+ *
34509
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
34510
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
34511
+ * made that same base 3 s and rendered a person pass as two frames.)
34512
+ *
34513
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
34514
+ * `denseCadenceSec` and played at `framerate` occupies
34515
+ *
34516
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
34517
+ *
34518
+ * 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.
34519
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
34520
+ * and therefore the length of a quiet night, does not move.
34521
+ *
34522
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
34523
+ * the recording has them returns the same frames, requested twice. Must be
34524
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
34525
+ * a uniform video the operator believes is two-rate — and upsert refuses it
34526
+ * rather than letting the export cap reject the render hours after the window.
34527
+ */
34528
+ var DenseCadenceSecField = number().min(.1).max(3600);
34529
+ /**
34530
+ * Minimum seconds of OUTPUT video each detection range must occupy.
34531
+ *
34532
+ * The operator-facing form of the arithmetic above: instead of solving for a
34533
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
34534
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
34535
+ * that range every ~583 ms.
34536
+ *
34537
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
34538
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
34539
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
34540
+ * ranges are sampled denser than they need. Per-range cadences require a cap
34541
+ * schema change and are the tracked follow-up.
34542
+ *
34543
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
34544
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
34545
+ * by real footage, never met by duplicating frames into motion that never
34546
+ * happened.
34547
+ */
34548
+ var MinDwellSecField = number().min(0).max(60);
34549
+ /**
34550
+ * Caption burned into the notification's preview frame.
34551
+ *
34552
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
34553
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
34554
+ * templating dialect for one field would be a second thing to explain.
34555
+ *
34556
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
34557
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
34558
+ * the reason this is not `.min(1)`.
34559
+ */
34560
+ var PreviewTextField = string().max(200);
34561
+ /**
34562
+ * Whether the notification's preview is a STILL or a short animation.
34563
+ *
34564
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
34565
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
34566
+ * night reads better as three seconds of motion than as one frame of it. Both
34567
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
34568
+ * simply applies it to a dozen frames sampled across the render and assembles
34569
+ * them.
34570
+ *
34571
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
34572
+ * seeks and a palette pass, and no rule that never asked for one should start
34573
+ * paying that on the deploy that shipped it.
34574
+ *
34575
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
34576
+ */
34577
+ var PreviewModeField = _enum(["image", "gif"]);
34578
+ /**
34579
+ * Which detection classes the notification reports counts for.
34580
+ *
34581
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
34582
+ * plan — no second query — aggregated per class. Absent or empty means "every
34583
+ * class the window actually contained", which is what an operator who never
34584
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
34585
+ * counts cars all night).
34586
+ *
34587
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
34588
+ * …). An unknown name simply never matches and reports nothing — it is not an
34589
+ * error, because a rule may legitimately name a class this camera's model does
34590
+ * not emit.
34591
+ *
34592
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
34593
+ * - `{{detections}}` — total over the reported classes
34594
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
34595
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
34596
+ * one per class, `count_` + the class name
34597
+ *
34598
+ * With NO custom body template the summary is appended to the derived body, and
34599
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
34600
+ * reads. With a custom template the operator owns every word — nothing is
34601
+ * appended, so `{{detectionSummary}}` is how he asks for it.
34602
+ */
34603
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
34604
+ /**
33761
34605
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
33762
34606
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
33763
34607
  * here (see the ownership note above).
@@ -33777,9 +34621,30 @@ var TimelapseRuleInputSchema = object({
33777
34621
  cadenceSec: CadenceSecField.default(15),
33778
34622
  /** Output frames per second of the assembled mp4 (predecessor parity). */
33779
34623
  framerate: FramerateField.default(10),
34624
+ /**
34625
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
34626
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
34627
+ * field gets.
34628
+ */
34629
+ denseCadenceSec: DenseCadenceSecField.optional(),
34630
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
34631
+ minDwellSec: MinDwellSecField.optional(),
33780
34632
  /** `notification-output` targets the finished video/thumbnail is sent to. */
33781
34633
  targets: TargetsField,
33782
34634
  template: TimelapseTemplateSchema.optional(),
34635
+ /**
34636
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
34637
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
34638
+ *
34639
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
34640
+ * the notification's title/body, and clearing it (`template: null`) must not
34641
+ * silently clear the caption too.
34642
+ */
34643
+ previewText: PreviewTextField.optional(),
34644
+ /** Still or animation — see {@link PreviewModeField}. */
34645
+ previewMode: PreviewModeField.default("image"),
34646
+ /** Classes the notification counts — see {@link ReportClassesField}. */
34647
+ reportClasses: ReportClassesField.optional(),
33783
34648
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
33784
34649
  priority: PriorityField.default(3)
33785
34650
  });
@@ -33790,8 +34655,13 @@ object({
33790
34655
  schedule: NcScheduleSchema.optional(),
33791
34656
  cadenceSec: CadenceSecField.optional(),
33792
34657
  framerate: FramerateField.optional(),
34658
+ denseCadenceSec: DenseCadenceSecField.optional(),
34659
+ minDwellSec: MinDwellSecField.optional(),
33793
34660
  targets: TargetsField.optional(),
33794
34661
  template: TimelapseTemplateSchema.nullable().optional(),
34662
+ previewText: PreviewTextField.optional(),
34663
+ previewMode: PreviewModeField.optional(),
34664
+ reportClasses: ReportClassesField.optional(),
33795
34665
  priority: PriorityField.optional()
33796
34666
  });
33797
34667
  TimelapseRuleInputSchema.extend({
@@ -33803,10 +34673,28 @@ TimelapseRuleInputSchema.extend({
33803
34673
  */
33804
34674
  ownerUserId: string().optional(),
33805
34675
  /**
33806
- * Epoch-ms of the last successful generation the 1-hour re-generation
33807
- * guard's durable state (predecessor parity). Absent = never generated.
34676
+ * Epoch-ms of the NEWEST successful generation across every camera of this
34677
+ * rule. What a UI shows, and the compatibility floor for
34678
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
33808
34679
  */
33809
34680
  lastGeneratedAt: number().optional(),
34681
+ /**
34682
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
34683
+ * re-generation guard's real durable state.
34684
+ *
34685
+ * One rule covers several cameras and each renders its own video, so a rule
34686
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
34687
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
34688
+ * already done — and B's night is gone for good, because the window will not
34689
+ * come back.
34690
+ *
34691
+ * ADDITIVE, so the migration is free: a row written before this field simply
34692
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
34693
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
34694
+ * "never generated" would re-render and re-notify every camera of every rule
34695
+ * once, on the deploy that shipped the map.
34696
+ */
34697
+ generatedByDevice: record(string(), number()).optional(),
33810
34698
  /** userId of the caller who created the rule (server-stamped). */
33811
34699
  createdBy: string(),
33812
34700
  createdAt: number(),