@camstack/addon-decoder-ffmpeg 1.2.11 → 1.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +936 -48
  2. package/dist/index.mjs +936 -48
  3. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -7202,8 +7202,31 @@ var AdoptionJobSchema = object({
7202
7202
  error: string().nullable()
7203
7203
  });
7204
7204
  /**
7205
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7206
- * pipeline functions an operator thinks in terms of.
7205
+ * Per-camera FUNCTION SWITCHES.
7206
+ *
7207
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7208
+ *
7209
+ * This file shipped as "the one coherent on/off surface over the pipeline
7210
+ * functions an operator thinks in terms of". The operator's verdict on
7211
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7212
+ * every function already had a settings page of its own, and a second place to
7213
+ * turn it off is a second place to look. Each switch is going back to its own
7214
+ * component's original options — detection to the detection-pipeline wrapper
7215
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7216
+ * (which was always first-class; the switch was a veneer over
7217
+ * `recording.setDeviceConfig`), notifications to a notification-center
7218
+ * per-device setting, the two camera planes to their own components.
7219
+ *
7220
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7221
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7222
+ * straight from the authorities with no group in the middle. That rule was
7223
+ * never about a control panel.
7224
+ *
7225
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7226
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7227
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7228
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7229
+ * stop; nothing new may be built on it.
7207
7230
  *
7208
7231
  * ## This file adds no state
7209
7232
  *
@@ -7548,14 +7571,21 @@ var RecordingConfigSchema = object({
7548
7571
  /**
7549
7572
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
7550
7573
  *
7551
- * One shape shared by the recorder's `relocateFootage` (segments) and
7552
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7553
- * page renders both movers with one component. Jobs are in-RAM (a restart
7554
- * forgets them re-running is safe by construction: copy-if-absent, delete
7555
- * after verify) and each completed/failed run also lands one durable ops-log
7556
- * row on the owning addon's surface.
7574
+ * One shape shared by the recorder and pipeline-analytics internal movers.
7575
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
7576
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
7577
+ * Each completed/failed run also lands one durable ops-log row on its owning
7578
+ * addon surface.
7579
+ */
7580
+ /**
7581
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7582
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7583
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7584
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7585
+ * runs at all.
7557
7586
  */
7558
7587
  var RelocateJobStateSchema = _enum([
7588
+ "queued",
7559
7589
  "running",
7560
7590
  "done",
7561
7591
  "failed",
@@ -7580,19 +7610,109 @@ var RelocateJobSchema = object({
7580
7610
  finishedAt: number().nullable(),
7581
7611
  error: string().nullable()
7582
7612
  });
7613
+ /** Profile-derived footage selection used only by the migration coordinator:
7614
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
7615
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
7583
7616
  var RelocateFootageInputSchema = object({
7584
- deviceId: number().optional(),
7585
7617
  fromLocationId: string(),
7586
7618
  toLocationId: string(),
7587
7619
  entities: array(_enum(["segments"])).optional(),
7620
+ /** Limits relocation to the logical profile class. Omit only for the
7621
+ * pre-orchestration compatibility path. */
7622
+ footageClass: RelocateFootageClassSchema.optional(),
7623
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7624
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7625
+ * unit is a (camera, profile) pile, not a disk. */
7626
+ deviceId: number().int().optional(),
7627
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7628
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7629
+ * placement plan assigns those two independently, so a rebalance that could
7630
+ * only say "recordings" would move footage the plan never asked to move. */
7631
+ profiles: array(string()).optional(),
7588
7632
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7589
7633
  * never allowed to starve live writers. */
7590
7634
  throttleMbps: number().min(1).max(1e3).optional()
7591
7635
  });
7592
- var RelocateMediaInputSchema = object({
7593
- deviceId: number().optional(),
7636
+ /** Internal, lease-scoped participant operation. It is intentionally separate
7637
+ * from persistent recording settings: a migration never changes
7638
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
7639
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
7640
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
7641
+ var StorageMigrationMediaMoveInputSchema = object({
7594
7642
  toLocationId: string(),
7595
7643
  throttleMbps: number().min(1).max(1e3).optional()
7644
+ }).extend({ leaseId: string().min(1) });
7645
+ /** The independently selectable logical storage classes. `recordings`
7646
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
7647
+ * segments; `eventMedia` is post-analysis blobs. */
7648
+ var StorageMigrationClassSchema = _enum([
7649
+ "recordings",
7650
+ "recordingsLow",
7651
+ "eventMedia"
7652
+ ]);
7653
+ /** A destination is always an existing, fully-qualified location id. The
7654
+ * migration API intentionally never changes a source location's `basePath`:
7655
+ * callers create a new `<type>:<slug>` location, then select it here. */
7656
+ var StorageMigrationDestinationsSchema = object({
7657
+ recordings: string().min(1).optional(),
7658
+ recordingsLow: string().min(1).optional(),
7659
+ eventMedia: string().min(1).optional()
7660
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
7661
+ /** Shared input for planning and starting an orchestrated storage migration. */
7662
+ var StorageMigrationInputSchema = object({
7663
+ destinations: StorageMigrationDestinationsSchema,
7664
+ throttleMbps: number().min(1).max(1e3).optional()
7665
+ });
7666
+ /** The durable coordinator state machine. The only phase that changes default
7667
+ * locations is `repointing`, after every selected mover has completed and been
7668
+ * verified. */
7669
+ var StorageMigrationPhaseSchema = _enum([
7670
+ "planning",
7671
+ "pausing",
7672
+ "moving",
7673
+ "verifying",
7674
+ "repointing",
7675
+ "refreshing",
7676
+ "resuming",
7677
+ "done",
7678
+ "failed",
7679
+ "cancelled"
7680
+ ]);
7681
+ var StorageMigrationParticipantSchema = _enum([
7682
+ "pipeline",
7683
+ "recorder",
7684
+ "analytics"
7685
+ ]);
7686
+ var StorageMigrationMoveSchema = object({
7687
+ storageClass: StorageMigrationClassSchema,
7688
+ fromLocationId: string(),
7689
+ toLocationId: string(),
7690
+ moverJobId: string().nullable(),
7691
+ state: RelocateJobStateSchema.nullable(),
7692
+ error: string().nullable()
7693
+ });
7694
+ var StorageMigrationJobSchema = object({
7695
+ jobId: string(),
7696
+ phase: StorageMigrationPhaseSchema,
7697
+ destinations: StorageMigrationDestinationsSchema,
7698
+ throttleMbps: number(),
7699
+ moves: array(StorageMigrationMoveSchema),
7700
+ pauseLeaseId: string().nullable(),
7701
+ pausedParticipants: array(StorageMigrationParticipantSchema),
7702
+ repointed: boolean(),
7703
+ cancelRequested: boolean(),
7704
+ startedAt: number(),
7705
+ updatedAt: number(),
7706
+ finishedAt: number().nullable(),
7707
+ error: string().nullable()
7708
+ });
7709
+ var StorageMigrationPlanSchema = object({
7710
+ destinations: StorageMigrationDestinationsSchema,
7711
+ moves: array(object({
7712
+ storageClass: StorageMigrationClassSchema,
7713
+ fromLocationId: string(),
7714
+ toLocationId: string()
7715
+ }))
7596
7716
  });
7597
7717
  /**
7598
7718
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -7644,6 +7764,21 @@ var StorageLocationSchema = object({
7644
7764
  nodeId: string().optional(),
7645
7765
  isDefault: boolean().default(false),
7646
7766
  isSystem: boolean().default(false),
7767
+ /**
7768
+ * Operator opt-in: whether consumers that BALANCE across several locations
7769
+ * of a type may write here. Recordings reads it today; event media and
7770
+ * backups are the next consumers, which is why the flag lives on the
7771
+ * location rather than in any one addon's store — nothing has to be
7772
+ * extended to add the next consumer.
7773
+ *
7774
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7775
+ * flag existed reads back with no flag and keeps working exactly as before;
7776
+ * that is the whole compat story, and it is why no migration ships with it.
7777
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7778
+ * disk must not silently start writing to it); the default of a type is
7779
+ * always stamped `true`.
7780
+ */
7781
+ enabled: boolean().optional(),
7647
7782
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7648
7783
  * for node-local locations it can reach) — never persisted, absent when the
7649
7784
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12076,7 +12211,8 @@ method(object({
12076
12211
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12077
12212
  /**
12078
12213
  * filesystem-browse — per-node capability for browsing the node's local
12079
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12214
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12215
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12080
12216
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12081
12217
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12082
12218
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -13889,6 +14025,13 @@ var MaskGridDimsSchema = object({
13889
14025
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
13890
14026
  * this one field keeps the schema additive — a rule still declares exactly
13891
14027
  * one trigger.
14028
+ *
14029
+ * AUDIO rules add no member here, for the reason occupancy added none: the
14030
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
14031
+ * mirror.ts` fails the build on a member the app cannot render) and every
14032
+ * member costs a release train. A sustained-sound rule is therefore an
14033
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
14034
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
13892
14035
  */
13893
14036
  var NcDeliverySchema = _enum([
13894
14037
  "immediate",
@@ -13903,15 +14046,32 @@ var NcDeliverySchema = _enum([
13903
14046
  * depend on a provider's raw event name or payload shape.
13904
14047
  */
13905
14048
  var NcSystemEventKindSchema = _enum([
13906
- "camera-online",
13907
- "camera-offline",
14049
+ "device-online",
14050
+ "device-offline",
14051
+ "device-disabled",
14052
+ "device-enabled",
13908
14053
  "stream-online",
13909
14054
  "stream-offline",
13910
14055
  "node-online",
13911
14056
  "node-offline",
13912
14057
  "addon-update-available",
13913
- "server-update-available"
14058
+ "server-update-available",
14059
+ "alarm-triggered",
14060
+ "alarm-armed",
14061
+ "alarm-disarmed",
14062
+ "camera-online",
14063
+ "camera-offline",
14064
+ "camera-disabled",
14065
+ "camera-enabled"
14066
+ ]);
14067
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14068
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14069
+ "camera-online",
14070
+ "camera-offline",
14071
+ "camera-disabled",
14072
+ "camera-enabled"
13914
14073
  ]);
14074
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
13915
14075
  /**
13916
14076
  * One coherent system-event condition. `kinds` is the required opt-in safety
13917
14077
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -13920,6 +14080,18 @@ var NcSystemEventKindSchema = _enum([
13920
14080
  var NcSystemEventConditionSchema = object({
13921
14081
  kinds: array(NcSystemEventKindSchema).min(1),
13922
14082
  deviceIds: array(number().int()).min(1).optional(),
14083
+ /**
14084
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14085
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14086
+ * is what a liveness rule means when nobody said otherwise.
14087
+ *
14088
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14089
+ * one reason: the intake cannot know which devices this household cares
14090
+ * about, and a producer-side filter is one no operator can change. Fails
14091
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14092
+ * does not carry) matches no `deviceTypes` list.
14093
+ */
14094
+ deviceTypes: array(string().min(1)).min(1).optional(),
13923
14095
  nodeIds: array(string().min(1)).min(1).optional(),
13924
14096
  packageNames: array(string().min(1)).min(1).optional()
13925
14097
  });
@@ -13970,6 +14142,47 @@ var NcOccupancyConditionSchema = object({
13970
14142
  sustainSeconds: number().int().min(0).max(3600).default(15)
13971
14143
  });
13972
14144
  /**
14145
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14146
+ *
14147
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14148
+ * reference notifier uses, so an operator moving between them re-uses what
14149
+ * they already know): a rule matches when, over a sampling window of
14150
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14151
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14152
+ *
14153
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14154
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14155
+ * - `labels` — the classifier put at least one of these labels on it.
14156
+ *
14157
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14158
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14159
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14160
+ * is given** — a window in which every sample is trivially a hit would fire on
14161
+ * silence, so the engine refuses such a condition rather than notifying on
14162
+ * nothing (the schema cannot express "at least one of" without becoming a
14163
+ * ZodEffects the cap path would have to special-case).
14164
+ *
14165
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14166
+ * must be FULL before it can match — a window that has been open for two
14167
+ * seconds of its ten is 100% of nothing, and firing on it would make
14168
+ * `samplingSeconds` decorative.
14169
+ *
14170
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14171
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14172
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14173
+ * an operator who typed `dog` mean the same thing.
14174
+ */
14175
+ var NcAudioConditionSchema = object({
14176
+ /** Audio macro labels; absent = any sound (level-only rule). */
14177
+ labels: array(string().min(1)).min(1).optional(),
14178
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14179
+ dbThreshold: number().min(-96).max(0).optional(),
14180
+ /** Percentage of the window's samples that must be hits (1–100). */
14181
+ hitPercent: number().int().min(1).max(100).default(60),
14182
+ /** Length of the sampling window in seconds. */
14183
+ samplingSeconds: number().int().min(1).max(300).default(10)
14184
+ });
14185
+ /**
13973
14186
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
13974
14187
  *
13975
14188
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14242,7 +14455,33 @@ var NcConditionsSchema = object({
14242
14455
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14243
14456
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14244
14457
  */
14245
- occupancy: NcOccupancyConditionSchema.optional()
14458
+ occupancy: NcOccupancyConditionSchema.optional(),
14459
+ /**
14460
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14461
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14462
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14463
+ * a window that is not full yet, neither filter given). See
14464
+ * {@link NcAudioCondition}.
14465
+ *
14466
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14467
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14468
+ * a detection, a track or a device event (the same fail-closed pairing
14469
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14470
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14471
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14472
+ * classified sample) stays exactly as it was for rules that already use it.
14473
+ *
14474
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14475
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14476
+ * (`camstack/src/data/notification-center.ts`, guarded by
14477
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14478
+ * condition fields it does not know when a rule is saved from the phone.
14479
+ * Publishing an editor for a condition the app cannot round-trip is how an
14480
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14481
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14482
+ * does an audio rule become authorable.
14483
+ */
14484
+ audio: NcAudioConditionSchema.optional()
14246
14485
  });
14247
14486
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14248
14487
  var NcRuleTargetSchema = object({
@@ -14356,6 +14595,73 @@ var NcThrottleSchema = object({
14356
14595
  */
14357
14596
  granularity: NcThrottleGranularitySchema.optional()
14358
14597
  });
14598
+ /**
14599
+ * How long the confirm gate may hold ONE notification, and how big the picture
14600
+ * it judges may be.
14601
+ *
14602
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14603
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14604
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14605
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14606
+ * tokens for pixels the model pools away.
14607
+ */
14608
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14609
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14610
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14611
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14612
+ var NcConfirmExpectSchema = object({
14613
+ op: _enum([
14614
+ ">=",
14615
+ ">",
14616
+ "<=",
14617
+ "<",
14618
+ "=="
14619
+ ]),
14620
+ count: number().int().min(0).max(1e3)
14621
+ });
14622
+ /**
14623
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14624
+ * to ship and says whether it agrees with the rule.
14625
+ *
14626
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14627
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14628
+ * on the operator's phone is not a verdict about this notification.
14629
+ *
14630
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14631
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14632
+ * the default and every fail-open is COUNTED, because a gate that always fails
14633
+ * open looks in the log exactly like a gate that works.
14634
+ *
14635
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14636
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14637
+ * production failures in one day), so the gate reads absent as the constant
14638
+ * above rather than trusting a parse it may never have seen.
14639
+ */
14640
+ var NcConfirmSchema = object({
14641
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14642
+ * same thing, and both mean "deliver exactly as before". */
14643
+ enabled: boolean().default(false),
14644
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14645
+ profileId: string().optional(),
14646
+ /**
14647
+ * The operator's question, in his own words. Absent = a question derived
14648
+ * from the rule (its class and its expectation).
14649
+ *
14650
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14651
+ * banners, signage and plates as instructions if you let them reach the
14652
+ * prompt — proven live — so the authoritative contract stays in the system
14653
+ * turn and only rule-authored words land here.
14654
+ */
14655
+ prompt: string().max(1e3).optional(),
14656
+ /** Fire only when the model's count satisfies this. Absent = the model's
14657
+ * own boolean verdict decides. */
14658
+ expect: NcConfirmExpectSchema.optional(),
14659
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14660
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14661
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14662
+ /** Longest edge the judged image is downscaled to before it is sent. */
14663
+ maxImagePx: number().int().min(64).max(2048).default(448)
14664
+ });
14359
14665
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14360
14666
  var NcRuleInputSchema = object({
14361
14667
  name: string().min(1).max(200),
@@ -14416,7 +14722,13 @@ var NcRuleInputSchema = object({
14416
14722
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14417
14723
  * shape as every other actuation.
14418
14724
  */
14419
- actions: NcRuleActionsSchema.optional()
14725
+ actions: NcRuleActionsSchema.optional(),
14726
+ /**
14727
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14728
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14729
+ * did, and absent is the only way to say that without a migration.
14730
+ */
14731
+ confirm: NcConfirmSchema.optional()
14420
14732
  });
14421
14733
  /**
14422
14734
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14427,7 +14739,37 @@ var NcRuleInputSchema = object({
14427
14739
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14428
14740
  * `updateRule` patch.
14429
14741
  */
14430
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
14742
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14743
+ disabledTargetIds: array(string()).optional(),
14744
+ /**
14745
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14746
+ *
14747
+ * It makes the key optional to SUPPLY; the parse still materialises the
14748
+ * default when the key is absent. And `NcRuleStore.update` merges with
14749
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14750
+ * one — which made every partial edit destructive:
14751
+ *
14752
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14753
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14754
+ * setEnabled(ruleId, false) → conditions reset to `{}`
14755
+ *
14756
+ * A rule scoped to one camera and one zone silently became a rule that
14757
+ * matches EVERY event on EVERY camera, and lost its `media` policy
14758
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
14759
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
14760
+ * within a minute of a two-field patch.
14761
+ *
14762
+ * So every defaulted field is re-declared here WITHOUT its default. The
14763
+ * inner defaults still apply when the caller DOES send the key — `{}` for
14764
+ * conditions remains a real instruction ("clear them") — and only the
14765
+ * absent key is now genuinely absent.
14766
+ */
14767
+ enabled: boolean().optional(),
14768
+ conditions: NcConditionsSchema.optional(),
14769
+ media: NcMediaPolicySchema.optional(),
14770
+ throttle: NcThrottleSchema.optional(),
14771
+ priority: number().int().min(1).max(5).optional()
14772
+ });
14431
14773
  /** A persisted rule. */
14432
14774
  var NcRuleSchema = NcRuleInputSchema.extend({
14433
14775
  id: string(),
@@ -14728,6 +15070,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14728
15070
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14729
15071
  * copy would lie the first time a rule is disabled.
14730
15072
  */
15073
+ /**
15074
+ * Why a device a mode NAMES is nonetheless not armed by it.
15075
+ *
15076
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15077
+ * per-camera notification switch the Notification Center already owns,
15078
+ * `detection-off` is the device's own detection binding being inactive, and
15079
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15080
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15081
+ * with the switches the operator actually used.
15082
+ */
15083
+ var NcAlarmSkipReasonSchema = _enum([
15084
+ "muted",
15085
+ "detection-off",
15086
+ "offline"
15087
+ ]);
15088
+ var NcAlarmSkippedDeviceSchema = object({
15089
+ deviceId: number().int(),
15090
+ reason: NcAlarmSkipReasonSchema
15091
+ });
14731
15092
  var NcAlarmModeCoverageSchema = object({
14732
15093
  mode: AlarmArmModeSchema,
14733
15094
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14735,7 +15096,18 @@ var NcAlarmModeCoverageSchema = object({
14735
15096
  /** At least one covering rule has no device scope, so the mode covers all. */
14736
15097
  allDevices: boolean(),
14737
15098
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14738
- deviceIds: array(number().int())
15099
+ deviceIds: array(number().int()),
15100
+ /**
15101
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15102
+ * excludes it.
15103
+ *
15104
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15105
+ * twelve makes it false in exactly the way nobody notices until an incident.
15106
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15107
+ * still parses as "nothing known to be skipped" rather than failing the whole
15108
+ * alarm tab.
15109
+ */
15110
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
14739
15111
  });
14740
15112
  var NcAlarmConfigSchema = object({
14741
15113
  /**
@@ -16098,13 +16470,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16098
16470
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16099
16471
  kind: "mutation",
16100
16472
  auth: "admin"
16101
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
16473
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
16102
16474
  kind: "mutation",
16103
16475
  auth: "admin"
16104
- }), method(object({}), array(RelocateJobSchema).readonly(), {
16105
- kind: "query",
16476
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
16477
+ kind: "mutation",
16106
16478
  auth: "admin"
16107
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16479
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
16480
+ kind: "mutation",
16481
+ auth: "admin"
16482
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
16483
+ kind: "mutation",
16484
+ auth: "admin"
16485
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16108
16486
  kind: "mutation",
16109
16487
  auth: "admin"
16110
16488
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -17528,9 +17906,16 @@ var CameraStatusSchema = object({
17528
17906
  audio: CameraAudioStatusSchema.nullable(),
17529
17907
  recording: CameraRecordingStatusSchema.nullable(),
17530
17908
  /**
17531
- * Per-camera function switches an OPERATOR has turned off
17909
+ * Per-camera functions an OPERATOR has turned off
17532
17910
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17533
17911
  *
17912
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
17913
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
17914
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
17915
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
17916
+ * The badge outlives the control panel: the panel was a convenience, this is
17917
+ * the difference between a camera being off and a camera being dead.
17918
+ *
17534
17919
  * This is the difference between DISABLED and BROKEN. A camera whose
17535
17920
  * `detection` block reports zero fps and whose `switchedOff` contains
17536
17921
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -17601,7 +17986,13 @@ var NodeInferenceDevicesSchema = object({
17601
17986
  reachable: boolean(),
17602
17987
  devices: array(NodeInferenceDeviceSchema).readonly()
17603
17988
  });
17604
- method(object({
17989
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
17990
+ kind: "mutation",
17991
+ auth: "admin"
17992
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
17993
+ kind: "mutation",
17994
+ auth: "admin"
17995
+ }), method(object({
17605
17996
  deviceId: number(),
17606
17997
  agentNodeId: string()
17607
17998
  }), object({ success: literal(true) }), {
@@ -18275,6 +18666,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
18275
18666
  locationId: string(),
18276
18667
  targetBytes: number().int().positive()
18277
18668
  }), EvictResultSchema, { kind: "mutation" });
18669
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
18670
+ kind: "mutation",
18671
+ auth: "admin"
18672
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
18673
+ kind: "mutation",
18674
+ auth: "admin"
18675
+ });
18278
18676
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
18279
18677
  providerId: string().min(1),
18280
18678
  displayName: string().min(1),
@@ -18378,6 +18776,28 @@ var TerminalProfileInfoSchema = object({
18378
18776
  label: string(),
18379
18777
  description: string().optional()
18380
18778
  });
18779
+ /**
18780
+ * A durable operator-created Terminal instance. Profiles are templates; only
18781
+ * an instance declares a camera.
18782
+ */
18783
+ var TerminalInstanceInfoSchema = object({
18784
+ instanceId: string(),
18785
+ cameraStableId: string(),
18786
+ nodeId: string(),
18787
+ profileId: string(),
18788
+ profileLabel: string(),
18789
+ name: string(),
18790
+ enabled: boolean()
18791
+ });
18792
+ var TerminalLegacyCameraSchema = object({
18793
+ stableId: string(),
18794
+ nodeId: string(),
18795
+ profileId: string(),
18796
+ profileLabel: string(),
18797
+ name: string(),
18798
+ /** Only legacy monitor cameras can retain their historic stable identity. */
18799
+ adoptable: boolean()
18800
+ });
18381
18801
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
18382
18802
  seq: number().int().positive(),
18383
18803
  kind: literal("data"),
@@ -18394,7 +18814,29 @@ var TerminalOutputBatchSchema = object({
18394
18814
  snapshot: string().optional(),
18395
18815
  events: array(TerminalOutputEventSchema).readonly()
18396
18816
  });
18397
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18817
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
18818
+ targetNodeId: string().min(1),
18819
+ profileId: string().min(1),
18820
+ name: string().trim().min(1).max(160).optional()
18821
+ }), TerminalInstanceInfoSchema, {
18822
+ kind: "mutation",
18823
+ auth: "admin"
18824
+ }), method(object({ instanceId: string().min(1) }), _void(), {
18825
+ kind: "mutation",
18826
+ auth: "admin"
18827
+ }), method(object({
18828
+ instanceId: string().min(1),
18829
+ enabled: boolean()
18830
+ }), TerminalInstanceInfoSchema, {
18831
+ kind: "mutation",
18832
+ auth: "admin"
18833
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
18834
+ stableId: string().min(1),
18835
+ name: string().trim().min(1).max(160).optional()
18836
+ }), TerminalInstanceInfoSchema, {
18837
+ kind: "mutation",
18838
+ auth: "admin"
18839
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18398
18840
  profileId: string(),
18399
18841
  cols: number().int().positive(),
18400
18842
  rows: number().int().positive()
@@ -18411,7 +18853,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
18411
18853
  }), method(object({
18412
18854
  sessionId: string(),
18413
18855
  afterSeq: number().int().nonnegative(),
18414
- waitMs: number().int().min(0).max(2e3).default(0)
18856
+ waitMs: number().int().min(0).max(2e3).default(0),
18857
+ /**
18858
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
18859
+ * browser's initial repaint remains immediate; the camera snapshot
18860
+ * relay uses it to avoid encoding a blank startup frame.
18861
+ */
18862
+ waitForOutput: boolean().optional()
18415
18863
  }), TerminalOutputBatchSchema, {
18416
18864
  kind: "mutation",
18417
18865
  auth: "admin",
@@ -20352,6 +20800,7 @@ var FaceInfoSchema = object({
20352
20800
  var FaceFilterEnum = _enum([
20353
20801
  "unassigned",
20354
20802
  "recognized",
20803
+ "identified",
20355
20804
  "all"
20356
20805
  ]);
20357
20806
  var MediaFileLiteSchema$1 = object({
@@ -20380,6 +20829,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string(
20380
20829
  kind: "mutation",
20381
20830
  auth: "admin"
20382
20831
  }), method(object({
20832
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
20833
+ deviceId: number().int().optional(),
20383
20834
  limit: number().int().positive().optional(),
20384
20835
  filter: FaceFilterEnum.optional(),
20385
20836
  /**
@@ -22145,6 +22596,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
22145
22596
  capName: string().min(1).max(64),
22146
22597
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
22147
22598
  valuePath: string().min(1).max(64)
22599
+ }),
22600
+ object({
22601
+ kind: literal("latest-recognition"),
22602
+ recognition: _enum(["person", "plate"])
22148
22603
  })
22149
22604
  ]);
22150
22605
  var OsdSlotBindingSchema = object({
@@ -22250,6 +22705,15 @@ method(object({ deviceId: number().int() }), object({
22250
22705
  }), object({ success: literal(true) }), {
22251
22706
  kind: "mutation",
22252
22707
  auth: "admin"
22708
+ }), method(object({
22709
+ sourceDeviceId: number().int(),
22710
+ targetDeviceId: number().int()
22711
+ }), object({
22712
+ copied: number().int().nonnegative(),
22713
+ skipped: number().int().nonnegative()
22714
+ }), {
22715
+ kind: "mutation",
22716
+ auth: "admin"
22253
22717
  }), method(object({
22254
22718
  deviceId: number().int(),
22255
22719
  slotId: string().min(1),
@@ -22960,7 +23424,19 @@ var RecordingManifestSchema = object({
22960
23424
  * profiles/subtrees/locations on this node). */
22961
23425
  var RecordingDeviceUsageSchema = object({
22962
23426
  deviceId: number(),
22963
- usedBytes: number()
23427
+ usedBytes: number(),
23428
+ /**
23429
+ * Start of this camera's OLDEST indexed segment, across every profile and
23430
+ * location — the "Oldest footage" column in Recordings → Storage, and the
23431
+ * only honest answer to "is retention actually holding?" per camera.
23432
+ *
23433
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
23434
+ * predates this field omits it entirely, and a hub whose types carry the
23435
+ * field must keep validating that older provider's payload: the framework
23436
+ * (types) and the addon ship on different trains, and the addon is usually
23437
+ * the later of the two.
23438
+ */
23439
+ oldestMs: number().nullable().optional()
22964
23440
  });
22965
23441
  /** Recording storage usage + capacity for one storage location. */
22966
23442
  var RecordingLocationUsageSchema = object({
@@ -22988,6 +23464,57 @@ var RecordingStorageUsageSchema = object({
22988
23464
  locations: array(RecordingLocationUsageSchema)
22989
23465
  });
22990
23466
  /**
23467
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
23468
+ *
23469
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
23470
+ * is the operator asking for the EXISTING archive to be brought into line with
23471
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
23472
+ * location, run FIFO behind the single-flight mover.
23473
+ *
23474
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
23475
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
23476
+ * (empty on the plan).
23477
+ */
23478
+ var RecordingRebalanceMoveSchema = object({
23479
+ deviceId: number(),
23480
+ profile: string(),
23481
+ fromLocationId: string(),
23482
+ toLocationId: string(),
23483
+ bytes: number(),
23484
+ files: number().int()
23485
+ });
23486
+ /** Why a pile that is out of place is staying there. Every refusal is
23487
+ * reported: a rebalance that silently drops a camera reads exactly like one
23488
+ * that had nothing to do. */
23489
+ var RecordingRebalanceSkipReasonSchema = _enum([
23490
+ "unassigned",
23491
+ "target-not-writable",
23492
+ "below-threshold",
23493
+ "no-headroom"
23494
+ ]);
23495
+ var RecordingRebalanceSkipSchema = object({
23496
+ deviceId: number(),
23497
+ profile: string(),
23498
+ fromLocationId: string(),
23499
+ /** The location the plan wants; null when the camera has no assignment. */
23500
+ toLocationId: string().nullable(),
23501
+ bytes: number(),
23502
+ reason: RecordingRebalanceSkipReasonSchema
23503
+ });
23504
+ var RecordingRebalancePlanSchema = object({
23505
+ moves: array(RecordingRebalanceMoveSchema),
23506
+ skipped: array(RecordingRebalanceSkipSchema),
23507
+ bytesToMove: number(),
23508
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
23509
+ jobIds: array(string())
23510
+ });
23511
+ var RecordingRebalanceInputSchema = object({
23512
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
23513
+ throttleMbps: number().min(1).max(1e3).optional(),
23514
+ /** Ignore piles smaller than this (default 1 GB). */
23515
+ minMoveGb: number().min(0).optional()
23516
+ });
23517
+ /**
22991
23518
  * Result of locating footage at a wall-clock instant for one device/profile.
22992
23519
  * `segment` carries the covering segment's window; `gap` reports the forward
22993
23520
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -23135,6 +23662,21 @@ method(object({
23135
23662
  }), {
23136
23663
  kind: "mutation",
23137
23664
  auth: "admin"
23665
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
23666
+ kind: "mutation",
23667
+ auth: "admin"
23668
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
23669
+ kind: "mutation",
23670
+ auth: "admin"
23671
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
23672
+ kind: "mutation",
23673
+ auth: "admin"
23674
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
23675
+ kind: "mutation",
23676
+ auth: "admin"
23677
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23678
+ kind: "mutation",
23679
+ auth: "admin"
23138
23680
  }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
23139
23681
  kind: "mutation",
23140
23682
  auth: "admin"
@@ -23144,9 +23686,15 @@ method(object({
23144
23686
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
23145
23687
  kind: "mutation",
23146
23688
  auth: "admin"
23689
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23690
+ kind: "query",
23691
+ auth: "admin"
23692
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
23693
+ kind: "mutation",
23694
+ auth: "admin"
23147
23695
  });
23148
23696
  /**
23149
- * `recordingExport` cap — render a footage time range into a single downloadable
23697
+ * `recording-export` cap — render a footage time range into a single downloadable
23150
23698
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
23151
23699
  * bounded lifetime with a durable history, auto-expiry, and optional
23152
23700
  * delete-after-download.
@@ -23161,10 +23709,42 @@ method(object({
23161
23709
  */
23162
23710
  /** Playback-speed multiplier for the render (1 = realtime). */
23163
23711
  var ExportSpeedSchema = number().min(.25).max(32);
23712
+ /**
23713
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
23714
+ *
23715
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
23716
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
23717
+ * playlist. Handing it absolute epochs would make every call site responsible
23718
+ * for the same subtraction, and the one that forgot would emit a filter that
23719
+ * selects nothing — silently, as a uniform timelapse.
23720
+ */
23721
+ var ExportDenseRangeSchema = object({
23722
+ fromSec: number().nonnegative(),
23723
+ toSec: number().nonnegative()
23724
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
23725
+ /**
23726
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
23727
+ * listed ranges and at the base `everyMs` everywhere else.
23728
+ *
23729
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
23730
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
23731
+ */
23732
+ var ExportDenseSchema = object({
23733
+ everyMs: number().int().positive(),
23734
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
23735
+ });
23164
23736
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
23165
23737
  var ExportTimelapseSchema = object({
23166
23738
  everyMs: number().int().positive(),
23167
- outputFps: number().int().min(1).max(60).optional()
23739
+ outputFps: number().int().min(1).max(60).optional(),
23740
+ /** Optional second, FASTER rate over the intervals that matter. */
23741
+ dense: ExportDenseSchema.optional()
23742
+ }).superRefine((v, ctx) => {
23743
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
23744
+ code: ZodIssueCode.custom,
23745
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
23746
+ path: ["dense", "everyMs"]
23747
+ });
23168
23748
  });
23169
23749
  /**
23170
23750
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -23222,6 +23802,19 @@ var ExportDownloadSchema = object({
23222
23802
  url: string(),
23223
23803
  endpoints: array(string())
23224
23804
  });
23805
+ /**
23806
+ * A finished export's bytes, inline.
23807
+ *
23808
+ * `bytes` is the DECODED length — the number the caller bounds and logs
23809
+ * against, so nobody has to infer it from the base64 length.
23810
+ */
23811
+ var ExportBytesSchema = object({
23812
+ base64: string(),
23813
+ contentType: string(),
23814
+ /** Suggested filename, extension included. */
23815
+ name: string(),
23816
+ bytes: number().int().nonnegative()
23817
+ });
23225
23818
  method(object({
23226
23819
  deviceId: number(),
23227
23820
  profile: string(),
@@ -23246,6 +23839,9 @@ method(object({
23246
23839
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
23247
23840
  kind: "query",
23248
23841
  auth: "protected"
23842
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
23843
+ kind: "query",
23844
+ auth: "protected"
23249
23845
  });
23250
23846
  /**
23251
23847
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -27263,6 +27859,12 @@ Object.freeze({
27263
27859
  addonId: null,
27264
27860
  access: "delete"
27265
27861
  },
27862
+ "osdManager.copyDeviceConfiguration": {
27863
+ capName: "osd-manager",
27864
+ capScope: "system",
27865
+ addonId: null,
27866
+ access: "create"
27867
+ },
27266
27868
  "osdManager.getConditionSupport": {
27267
27869
  capName: "osd-manager",
27268
27870
  capScope: "system",
@@ -27359,7 +27961,7 @@ Object.freeze({
27359
27961
  addonId: null,
27360
27962
  access: "create"
27361
27963
  },
27362
- "pipelineAnalytics.cancelMediaRelocate": {
27964
+ "pipelineAnalytics.cancelStorageMigrationMove": {
27363
27965
  capName: "pipeline-analytics",
27364
27966
  capScope: "device",
27365
27967
  addonId: null,
@@ -27431,12 +28033,6 @@ Object.freeze({
27431
28033
  addonId: null,
27432
28034
  access: "view"
27433
28035
  },
27434
- "pipelineAnalytics.getMediaRelocateStatus": {
27435
- capName: "pipeline-analytics",
27436
- capScope: "device",
27437
- addonId: null,
27438
- access: "view"
27439
- },
27440
28036
  "pipelineAnalytics.getMotionEvents": {
27441
28037
  capName: "pipeline-analytics",
27442
28038
  capScope: "device",
@@ -27473,6 +28069,12 @@ Object.freeze({
27473
28069
  addonId: null,
27474
28070
  access: "view"
27475
28071
  },
28072
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
28073
+ capName: "pipeline-analytics",
28074
+ capScope: "device",
28075
+ addonId: null,
28076
+ access: "view"
28077
+ },
27476
28078
  "pipelineAnalytics.getTrack": {
27477
28079
  capName: "pipeline-analytics",
27478
28080
  capScope: "device",
@@ -27551,6 +28153,12 @@ Object.freeze({
27551
28153
  addonId: null,
27552
28154
  access: "view"
27553
28155
  },
28156
+ "pipelineAnalytics.pauseForStorageMigration": {
28157
+ capName: "pipeline-analytics",
28158
+ capScope: "device",
28159
+ addonId: null,
28160
+ access: "create"
28161
+ },
27554
28162
  "pipelineAnalytics.proposeRetrainAnnotations": {
27555
28163
  capName: "pipeline-analytics",
27556
28164
  capScope: "device",
@@ -27581,7 +28189,7 @@ Object.freeze({
27581
28189
  addonId: null,
27582
28190
  access: "create"
27583
28191
  },
27584
- "pipelineAnalytics.relocateMedia": {
28192
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
27585
28193
  capName: "pipeline-analytics",
27586
28194
  capScope: "device",
27587
28195
  addonId: null,
@@ -27593,6 +28201,12 @@ Object.freeze({
27593
28201
  addonId: null,
27594
28202
  access: "create"
27595
28203
  },
28204
+ "pipelineAnalytics.resumeForStorageMigration": {
28205
+ capName: "pipeline-analytics",
28206
+ capScope: "device",
28207
+ addonId: null,
28208
+ access: "create"
28209
+ },
27596
28210
  "pipelineAnalytics.saveRetrainAnnotations": {
27597
28211
  capName: "pipeline-analytics",
27598
28212
  capScope: "device",
@@ -27617,6 +28231,12 @@ Object.freeze({
27617
28231
  addonId: null,
27618
28232
  access: "create"
27619
28233
  },
28234
+ "pipelineAnalytics.startStorageMigrationMove": {
28235
+ capName: "pipeline-analytics",
28236
+ capScope: "device",
28237
+ addonId: null,
28238
+ access: "create"
28239
+ },
27620
28240
  "pipelineAnalytics.wipeAllAnalytics": {
27621
28241
  capName: "pipeline-analytics",
27622
28242
  capScope: "device",
@@ -27983,6 +28603,12 @@ Object.freeze({
27983
28603
  addonId: null,
27984
28604
  access: "view"
27985
28605
  },
28606
+ "pipelineOrchestrator.pauseForStorageMigration": {
28607
+ capName: "pipeline-orchestrator",
28608
+ capScope: "system",
28609
+ addonId: null,
28610
+ access: "create"
28611
+ },
27986
28612
  "pipelineOrchestrator.rebalance": {
27987
28613
  capName: "pipeline-orchestrator",
27988
28614
  capScope: "system",
@@ -28007,6 +28633,12 @@ Object.freeze({
28007
28633
  addonId: null,
28008
28634
  access: "view"
28009
28635
  },
28636
+ "pipelineOrchestrator.resumeForStorageMigration": {
28637
+ capName: "pipeline-orchestrator",
28638
+ capScope: "system",
28639
+ addonId: null,
28640
+ access: "create"
28641
+ },
28010
28642
  "pipelineOrchestrator.saveTemplate": {
28011
28643
  capName: "pipeline-orchestrator",
28012
28644
  capScope: "system",
@@ -28403,7 +29035,13 @@ Object.freeze({
28403
29035
  addonId: null,
28404
29036
  access: "create"
28405
29037
  },
28406
- "recording.cancelRelocate": {
29038
+ "recording.cancelRelocateJob": {
29039
+ capName: "recording",
29040
+ capScope: "system",
29041
+ addonId: null,
29042
+ access: "create"
29043
+ },
29044
+ "recording.cancelStorageMigrationMove": {
28407
29045
  capName: "recording",
28408
29046
  capScope: "system",
28409
29047
  addonId: null,
@@ -28439,7 +29077,7 @@ Object.freeze({
28439
29077
  addonId: null,
28440
29078
  access: "view"
28441
29079
  },
28442
- "recording.getRelocateStatus": {
29080
+ "recording.getStorageMigrationMoveStatus": {
28443
29081
  capName: "recording",
28444
29082
  capScope: "system",
28445
29083
  addonId: null,
@@ -28457,12 +29095,30 @@ Object.freeze({
28457
29095
  addonId: null,
28458
29096
  access: "view"
28459
29097
  },
29098
+ "recording.listRelocateJobs": {
29099
+ capName: "recording",
29100
+ capScope: "system",
29101
+ addonId: null,
29102
+ access: "view"
29103
+ },
28460
29104
  "recording.locateSegment": {
28461
29105
  capName: "recording",
28462
29106
  capScope: "system",
28463
29107
  addonId: null,
28464
29108
  access: "view"
28465
29109
  },
29110
+ "recording.pauseForStorageMigration": {
29111
+ capName: "recording",
29112
+ capScope: "system",
29113
+ addonId: null,
29114
+ access: "create"
29115
+ },
29116
+ "recording.planStorageRebalance": {
29117
+ capName: "recording",
29118
+ capScope: "system",
29119
+ addonId: null,
29120
+ access: "view"
29121
+ },
28466
29122
  "recording.pruneFootage": {
28467
29123
  capName: "recording",
28468
29124
  capScope: "system",
@@ -28481,6 +29137,12 @@ Object.freeze({
28481
29137
  addonId: null,
28482
29138
  access: "view"
28483
29139
  },
29140
+ "recording.refreshStorageLocationsForMigration": {
29141
+ capName: "recording",
29142
+ capScope: "system",
29143
+ addonId: null,
29144
+ access: "create"
29145
+ },
28484
29146
  "recording.relocateFootage": {
28485
29147
  capName: "recording",
28486
29148
  capScope: "system",
@@ -28505,44 +29167,68 @@ Object.freeze({
28505
29167
  addonId: null,
28506
29168
  access: "create"
28507
29169
  },
29170
+ "recording.resumeForStorageMigration": {
29171
+ capName: "recording",
29172
+ capScope: "system",
29173
+ addonId: null,
29174
+ access: "create"
29175
+ },
28508
29176
  "recording.setDeviceConfig": {
28509
29177
  capName: "recording",
28510
29178
  capScope: "system",
28511
29179
  addonId: null,
28512
29180
  access: "create"
28513
29181
  },
29182
+ "recording.startStorageMigrationMove": {
29183
+ capName: "recording",
29184
+ capScope: "system",
29185
+ addonId: null,
29186
+ access: "create"
29187
+ },
29188
+ "recording.startStorageRebalance": {
29189
+ capName: "recording",
29190
+ capScope: "system",
29191
+ addonId: null,
29192
+ access: "create"
29193
+ },
28514
29194
  "recordingExport.cancelExport": {
28515
- capName: "recordingExport",
29195
+ capName: "recording-export",
28516
29196
  capScope: "system",
28517
29197
  addonId: null,
28518
29198
  access: "create"
28519
29199
  },
28520
29200
  "recordingExport.createExport": {
28521
- capName: "recordingExport",
29201
+ capName: "recording-export",
28522
29202
  capScope: "system",
28523
29203
  addonId: null,
28524
29204
  access: "create"
28525
29205
  },
28526
29206
  "recordingExport.deleteExport": {
28527
- capName: "recordingExport",
29207
+ capName: "recording-export",
28528
29208
  capScope: "system",
28529
29209
  addonId: null,
28530
29210
  access: "delete"
28531
29211
  },
28532
29212
  "recordingExport.getDownloadUrl": {
28533
- capName: "recordingExport",
29213
+ capName: "recording-export",
28534
29214
  capScope: "system",
28535
29215
  addonId: null,
28536
29216
  access: "view"
28537
29217
  },
28538
29218
  "recordingExport.getExport": {
28539
- capName: "recordingExport",
29219
+ capName: "recording-export",
28540
29220
  capScope: "system",
28541
29221
  addonId: null,
28542
29222
  access: "view"
28543
29223
  },
28544
29224
  "recordingExport.listExports": {
28545
- capName: "recordingExport",
29225
+ capName: "recording-export",
29226
+ capScope: "system",
29227
+ addonId: null,
29228
+ access: "view"
29229
+ },
29230
+ "recordingExport.readExportBytes": {
29231
+ capName: "recording-export",
28546
29232
  capScope: "system",
28547
29233
  addonId: null,
28548
29234
  access: "view"
@@ -28901,6 +29587,30 @@ Object.freeze({
28901
29587
  addonId: null,
28902
29588
  access: "view"
28903
29589
  },
29590
+ "storageMigration.cancel": {
29591
+ capName: "storage-migration",
29592
+ capScope: "system",
29593
+ addonId: null,
29594
+ access: "create"
29595
+ },
29596
+ "storageMigration.plan": {
29597
+ capName: "storage-migration",
29598
+ capScope: "system",
29599
+ addonId: null,
29600
+ access: "view"
29601
+ },
29602
+ "storageMigration.start": {
29603
+ capName: "storage-migration",
29604
+ capScope: "system",
29605
+ addonId: null,
29606
+ access: "create"
29607
+ },
29608
+ "storageMigration.status": {
29609
+ capName: "storage-migration",
29610
+ capScope: "system",
29611
+ addonId: null,
29612
+ access: "view"
29613
+ },
28904
29614
  "storageProvider.abortUpload": {
28905
29615
  capName: "storage-provider",
28906
29616
  capScope: "system",
@@ -29279,12 +29989,42 @@ Object.freeze({
29279
29989
  addonId: null,
29280
29990
  access: "create"
29281
29991
  },
29992
+ "terminalSession.adoptLegacyMonitor": {
29993
+ capName: "terminal-session",
29994
+ capScope: "system",
29995
+ addonId: null,
29996
+ access: "create"
29997
+ },
29282
29998
  "terminalSession.close": {
29283
29999
  capName: "terminal-session",
29284
30000
  capScope: "system",
29285
30001
  addonId: null,
29286
30002
  access: "create"
29287
30003
  },
30004
+ "terminalSession.createInstance": {
30005
+ capName: "terminal-session",
30006
+ capScope: "system",
30007
+ addonId: null,
30008
+ access: "create"
30009
+ },
30010
+ "terminalSession.deleteInstance": {
30011
+ capName: "terminal-session",
30012
+ capScope: "system",
30013
+ addonId: null,
30014
+ access: "delete"
30015
+ },
30016
+ "terminalSession.listInstances": {
30017
+ capName: "terminal-session",
30018
+ capScope: "system",
30019
+ addonId: null,
30020
+ access: "view"
30021
+ },
30022
+ "terminalSession.listLegacyCameras": {
30023
+ capName: "terminal-session",
30024
+ capScope: "system",
30025
+ addonId: null,
30026
+ access: "view"
30027
+ },
29288
30028
  "terminalSession.listProfiles": {
29289
30029
  capName: "terminal-session",
29290
30030
  capScope: "system",
@@ -29315,6 +30055,12 @@ Object.freeze({
29315
30055
  addonId: null,
29316
30056
  access: "create"
29317
30057
  },
30058
+ "terminalSession.setInstanceEnabled": {
30059
+ capName: "terminal-session",
30060
+ capScope: "system",
30061
+ addonId: null,
30062
+ access: "create"
30063
+ },
29318
30064
  "terminalSession.writeInput": {
29319
30065
  capName: "terminal-session",
29320
30066
  capScope: "system",
@@ -29859,6 +30605,104 @@ var FramerateField = number().int().min(1).max(60);
29859
30605
  var TargetsField = array(NcRuleTargetSchema).min(1);
29860
30606
  var PriorityField = number().int().min(1).max(5);
29861
30607
  /**
30608
+ * Explicit override of the DENSE sampling cadence, seconds.
30609
+ *
30610
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
30611
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
30612
+ * made that same base 3 s and rendered a person pass as two frames.)
30613
+ *
30614
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
30615
+ * `denseCadenceSec` and played at `framerate` occupies
30616
+ *
30617
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
30618
+ *
30619
+ * 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.
30620
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
30621
+ * and therefore the length of a quiet night, does not move.
30622
+ *
30623
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
30624
+ * the recording has them returns the same frames, requested twice. Must be
30625
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
30626
+ * a uniform video the operator believes is two-rate — and upsert refuses it
30627
+ * rather than letting the export cap reject the render hours after the window.
30628
+ */
30629
+ var DenseCadenceSecField = number().min(.1).max(3600);
30630
+ /**
30631
+ * Minimum seconds of OUTPUT video each detection range must occupy.
30632
+ *
30633
+ * The operator-facing form of the arithmetic above: instead of solving for a
30634
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
30635
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
30636
+ * that range every ~583 ms.
30637
+ *
30638
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
30639
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
30640
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
30641
+ * ranges are sampled denser than they need. Per-range cadences require a cap
30642
+ * schema change and are the tracked follow-up.
30643
+ *
30644
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
30645
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
30646
+ * by real footage, never met by duplicating frames into motion that never
30647
+ * happened.
30648
+ */
30649
+ var MinDwellSecField = number().min(0).max(60);
30650
+ /**
30651
+ * Caption burned into the notification's preview frame.
30652
+ *
30653
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
30654
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
30655
+ * templating dialect for one field would be a second thing to explain.
30656
+ *
30657
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
30658
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
30659
+ * the reason this is not `.min(1)`.
30660
+ */
30661
+ var PreviewTextField = string().max(200);
30662
+ /**
30663
+ * Whether the notification's preview is a STILL or a short animation.
30664
+ *
30665
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
30666
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
30667
+ * night reads better as three seconds of motion than as one frame of it. Both
30668
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
30669
+ * simply applies it to a dozen frames sampled across the render and assembles
30670
+ * them.
30671
+ *
30672
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
30673
+ * seeks and a palette pass, and no rule that never asked for one should start
30674
+ * paying that on the deploy that shipped it.
30675
+ *
30676
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
30677
+ */
30678
+ var PreviewModeField = _enum(["image", "gif"]);
30679
+ /**
30680
+ * Which detection classes the notification reports counts for.
30681
+ *
30682
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
30683
+ * plan — no second query — aggregated per class. Absent or empty means "every
30684
+ * class the window actually contained", which is what an operator who never
30685
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
30686
+ * counts cars all night).
30687
+ *
30688
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
30689
+ * …). An unknown name simply never matches and reports nothing — it is not an
30690
+ * error, because a rule may legitimately name a class this camera's model does
30691
+ * not emit.
30692
+ *
30693
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
30694
+ * - `{{detections}}` — total over the reported classes
30695
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
30696
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
30697
+ * one per class, `count_` + the class name
30698
+ *
30699
+ * With NO custom body template the summary is appended to the derived body, and
30700
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
30701
+ * reads. With a custom template the operator owns every word — nothing is
30702
+ * appended, so `{{detectionSummary}}` is how he asks for it.
30703
+ */
30704
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
30705
+ /**
29862
30706
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
29863
30707
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
29864
30708
  * here (see the ownership note above).
@@ -29878,9 +30722,30 @@ var TimelapseRuleInputSchema = object({
29878
30722
  cadenceSec: CadenceSecField.default(15),
29879
30723
  /** Output frames per second of the assembled mp4 (predecessor parity). */
29880
30724
  framerate: FramerateField.default(10),
30725
+ /**
30726
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
30727
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
30728
+ * field gets.
30729
+ */
30730
+ denseCadenceSec: DenseCadenceSecField.optional(),
30731
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
30732
+ minDwellSec: MinDwellSecField.optional(),
29881
30733
  /** `notification-output` targets the finished video/thumbnail is sent to. */
29882
30734
  targets: TargetsField,
29883
30735
  template: TimelapseTemplateSchema.optional(),
30736
+ /**
30737
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
30738
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
30739
+ *
30740
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
30741
+ * the notification's title/body, and clearing it (`template: null`) must not
30742
+ * silently clear the caption too.
30743
+ */
30744
+ previewText: PreviewTextField.optional(),
30745
+ /** Still or animation — see {@link PreviewModeField}. */
30746
+ previewMode: PreviewModeField.default("image"),
30747
+ /** Classes the notification counts — see {@link ReportClassesField}. */
30748
+ reportClasses: ReportClassesField.optional(),
29884
30749
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
29885
30750
  priority: PriorityField.default(3)
29886
30751
  });
@@ -29891,8 +30756,13 @@ object({
29891
30756
  schedule: NcScheduleSchema.optional(),
29892
30757
  cadenceSec: CadenceSecField.optional(),
29893
30758
  framerate: FramerateField.optional(),
30759
+ denseCadenceSec: DenseCadenceSecField.optional(),
30760
+ minDwellSec: MinDwellSecField.optional(),
29894
30761
  targets: TargetsField.optional(),
29895
30762
  template: TimelapseTemplateSchema.nullable().optional(),
30763
+ previewText: PreviewTextField.optional(),
30764
+ previewMode: PreviewModeField.optional(),
30765
+ reportClasses: ReportClassesField.optional(),
29896
30766
  priority: PriorityField.optional()
29897
30767
  });
29898
30768
  TimelapseRuleInputSchema.extend({
@@ -29904,10 +30774,28 @@ TimelapseRuleInputSchema.extend({
29904
30774
  */
29905
30775
  ownerUserId: string().optional(),
29906
30776
  /**
29907
- * Epoch-ms of the last successful generation the 1-hour re-generation
29908
- * guard's durable state (predecessor parity). Absent = never generated.
30777
+ * Epoch-ms of the NEWEST successful generation across every camera of this
30778
+ * rule. What a UI shows, and the compatibility floor for
30779
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
29909
30780
  */
29910
30781
  lastGeneratedAt: number().optional(),
30782
+ /**
30783
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
30784
+ * re-generation guard's real durable state.
30785
+ *
30786
+ * One rule covers several cameras and each renders its own video, so a rule
30787
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
30788
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
30789
+ * already done — and B's night is gone for good, because the window will not
30790
+ * come back.
30791
+ *
30792
+ * ADDITIVE, so the migration is free: a row written before this field simply
30793
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
30794
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
30795
+ * "never generated" would re-render and re-notify every camera of every rule
30796
+ * once, on the deploy that shipped the map.
30797
+ */
30798
+ generatedByDevice: record(string(), number()).optional(),
29911
30799
  /** userId of the caller who created the rule (server-stamped). */
29912
30800
  createdBy: string(),
29913
30801
  createdAt: number(),