@camstack/addon-provider-homematic 1.2.13 → 1.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +936 -48
  2. package/dist/addon.mjs +936 -48
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -7228,8 +7228,31 @@ var AdoptionJobSchema = object({
7228
7228
  error: string().nullable()
7229
7229
  });
7230
7230
  /**
7231
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7232
- * pipeline functions an operator thinks in terms of.
7231
+ * Per-camera FUNCTION SWITCHES.
7232
+ *
7233
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7234
+ *
7235
+ * This file shipped as "the one coherent on/off surface over the pipeline
7236
+ * functions an operator thinks in terms of". The operator's verdict on
7237
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7238
+ * every function already had a settings page of its own, and a second place to
7239
+ * turn it off is a second place to look. Each switch is going back to its own
7240
+ * component's original options — detection to the detection-pipeline wrapper
7241
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7242
+ * (which was always first-class; the switch was a veneer over
7243
+ * `recording.setDeviceConfig`), notifications to a notification-center
7244
+ * per-device setting, the two camera planes to their own components.
7245
+ *
7246
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7247
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7248
+ * straight from the authorities with no group in the middle. That rule was
7249
+ * never about a control panel.
7250
+ *
7251
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7252
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7253
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7254
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7255
+ * stop; nothing new may be built on it.
7233
7256
  *
7234
7257
  * ## This file adds no state
7235
7258
  *
@@ -7574,14 +7597,21 @@ var RecordingConfigSchema = object({
7574
7597
  /**
7575
7598
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
7576
7599
  *
7577
- * One shape shared by the recorder's `relocateFootage` (segments) and
7578
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7579
- * page renders both movers with one component. Jobs are in-RAM (a restart
7580
- * forgets them — re-running is safe by construction: copy-if-absent, delete
7581
- * after verify) and each completed/failed run also lands one durable ops-log
7582
- * row on the owning addon's surface.
7600
+ * One shape shared by the recorder and pipeline-analytics internal movers.
7601
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
7602
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
7603
+ * Each completed/failed run also lands one durable ops-log row on its owning
7604
+ * addon surface.
7605
+ */
7606
+ /**
7607
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7608
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7609
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7610
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7611
+ * runs at all.
7583
7612
  */
7584
7613
  var RelocateJobStateSchema = _enum([
7614
+ "queued",
7585
7615
  "running",
7586
7616
  "done",
7587
7617
  "failed",
@@ -7606,19 +7636,109 @@ var RelocateJobSchema = object({
7606
7636
  finishedAt: number().nullable(),
7607
7637
  error: string().nullable()
7608
7638
  });
7639
+ /** Profile-derived footage selection used only by the migration coordinator:
7640
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
7641
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
7609
7642
  var RelocateFootageInputSchema = object({
7610
- deviceId: number().optional(),
7611
7643
  fromLocationId: string(),
7612
7644
  toLocationId: string(),
7613
7645
  entities: array(_enum(["segments"])).optional(),
7646
+ /** Limits relocation to the logical profile class. Omit only for the
7647
+ * pre-orchestration compatibility path. */
7648
+ footageClass: RelocateFootageClassSchema.optional(),
7649
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7650
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7651
+ * unit is a (camera, profile) pile, not a disk. */
7652
+ deviceId: number().int().optional(),
7653
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7654
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7655
+ * placement plan assigns those two independently, so a rebalance that could
7656
+ * only say "recordings" would move footage the plan never asked to move. */
7657
+ profiles: array(string()).optional(),
7614
7658
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7615
7659
  * never allowed to starve live writers. */
7616
7660
  throttleMbps: number().min(1).max(1e3).optional()
7617
7661
  });
7618
- var RelocateMediaInputSchema = object({
7619
- deviceId: number().optional(),
7662
+ /** Internal, lease-scoped participant operation. It is intentionally separate
7663
+ * from persistent recording settings: a migration never changes
7664
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
7665
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
7666
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
7667
+ var StorageMigrationMediaMoveInputSchema = object({
7620
7668
  toLocationId: string(),
7621
7669
  throttleMbps: number().min(1).max(1e3).optional()
7670
+ }).extend({ leaseId: string().min(1) });
7671
+ /** The independently selectable logical storage classes. `recordings`
7672
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
7673
+ * segments; `eventMedia` is post-analysis blobs. */
7674
+ var StorageMigrationClassSchema = _enum([
7675
+ "recordings",
7676
+ "recordingsLow",
7677
+ "eventMedia"
7678
+ ]);
7679
+ /** A destination is always an existing, fully-qualified location id. The
7680
+ * migration API intentionally never changes a source location's `basePath`:
7681
+ * callers create a new `<type>:<slug>` location, then select it here. */
7682
+ var StorageMigrationDestinationsSchema = object({
7683
+ recordings: string().min(1).optional(),
7684
+ recordingsLow: string().min(1).optional(),
7685
+ eventMedia: string().min(1).optional()
7686
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
7687
+ /** Shared input for planning and starting an orchestrated storage migration. */
7688
+ var StorageMigrationInputSchema = object({
7689
+ destinations: StorageMigrationDestinationsSchema,
7690
+ throttleMbps: number().min(1).max(1e3).optional()
7691
+ });
7692
+ /** The durable coordinator state machine. The only phase that changes default
7693
+ * locations is `repointing`, after every selected mover has completed and been
7694
+ * verified. */
7695
+ var StorageMigrationPhaseSchema = _enum([
7696
+ "planning",
7697
+ "pausing",
7698
+ "moving",
7699
+ "verifying",
7700
+ "repointing",
7701
+ "refreshing",
7702
+ "resuming",
7703
+ "done",
7704
+ "failed",
7705
+ "cancelled"
7706
+ ]);
7707
+ var StorageMigrationParticipantSchema = _enum([
7708
+ "pipeline",
7709
+ "recorder",
7710
+ "analytics"
7711
+ ]);
7712
+ var StorageMigrationMoveSchema = object({
7713
+ storageClass: StorageMigrationClassSchema,
7714
+ fromLocationId: string(),
7715
+ toLocationId: string(),
7716
+ moverJobId: string().nullable(),
7717
+ state: RelocateJobStateSchema.nullable(),
7718
+ error: string().nullable()
7719
+ });
7720
+ var StorageMigrationJobSchema = object({
7721
+ jobId: string(),
7722
+ phase: StorageMigrationPhaseSchema,
7723
+ destinations: StorageMigrationDestinationsSchema,
7724
+ throttleMbps: number(),
7725
+ moves: array(StorageMigrationMoveSchema),
7726
+ pauseLeaseId: string().nullable(),
7727
+ pausedParticipants: array(StorageMigrationParticipantSchema),
7728
+ repointed: boolean(),
7729
+ cancelRequested: boolean(),
7730
+ startedAt: number(),
7731
+ updatedAt: number(),
7732
+ finishedAt: number().nullable(),
7733
+ error: string().nullable()
7734
+ });
7735
+ var StorageMigrationPlanSchema = object({
7736
+ destinations: StorageMigrationDestinationsSchema,
7737
+ moves: array(object({
7738
+ storageClass: StorageMigrationClassSchema,
7739
+ fromLocationId: string(),
7740
+ toLocationId: string()
7741
+ }))
7622
7742
  });
7623
7743
  /**
7624
7744
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -7670,6 +7790,21 @@ var StorageLocationSchema = object({
7670
7790
  nodeId: string().optional(),
7671
7791
  isDefault: boolean().default(false),
7672
7792
  isSystem: boolean().default(false),
7793
+ /**
7794
+ * Operator opt-in: whether consumers that BALANCE across several locations
7795
+ * of a type may write here. Recordings reads it today; event media and
7796
+ * backups are the next consumers, which is why the flag lives on the
7797
+ * location rather than in any one addon's store — nothing has to be
7798
+ * extended to add the next consumer.
7799
+ *
7800
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7801
+ * flag existed reads back with no flag and keeps working exactly as before;
7802
+ * that is the whole compat story, and it is why no migration ships with it.
7803
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7804
+ * disk must not silently start writing to it); the default of a type is
7805
+ * always stamped `true`.
7806
+ */
7807
+ enabled: boolean().optional(),
7673
7808
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7674
7809
  * for node-local locations it can reach) — never persisted, absent when the
7675
7810
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12288,7 +12423,8 @@ method(object({
12288
12423
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12289
12424
  /**
12290
12425
  * filesystem-browse — per-node capability for browsing the node's local
12291
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12426
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12427
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12292
12428
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12293
12429
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12294
12430
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -14129,6 +14265,13 @@ var MaskGridDimsSchema = object({
14129
14265
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
14130
14266
  * this one field keeps the schema additive — a rule still declares exactly
14131
14267
  * one trigger.
14268
+ *
14269
+ * AUDIO rules add no member here, for the reason occupancy added none: the
14270
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
14271
+ * mirror.ts` fails the build on a member the app cannot render) and every
14272
+ * member costs a release train. A sustained-sound rule is therefore an
14273
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
14274
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
14132
14275
  */
14133
14276
  var NcDeliverySchema = _enum([
14134
14277
  "immediate",
@@ -14143,15 +14286,32 @@ var NcDeliverySchema = _enum([
14143
14286
  * depend on a provider's raw event name or payload shape.
14144
14287
  */
14145
14288
  var NcSystemEventKindSchema = _enum([
14146
- "camera-online",
14147
- "camera-offline",
14289
+ "device-online",
14290
+ "device-offline",
14291
+ "device-disabled",
14292
+ "device-enabled",
14148
14293
  "stream-online",
14149
14294
  "stream-offline",
14150
14295
  "node-online",
14151
14296
  "node-offline",
14152
14297
  "addon-update-available",
14153
- "server-update-available"
14298
+ "server-update-available",
14299
+ "alarm-triggered",
14300
+ "alarm-armed",
14301
+ "alarm-disarmed",
14302
+ "camera-online",
14303
+ "camera-offline",
14304
+ "camera-disabled",
14305
+ "camera-enabled"
14306
+ ]);
14307
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14308
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14309
+ "camera-online",
14310
+ "camera-offline",
14311
+ "camera-disabled",
14312
+ "camera-enabled"
14154
14313
  ]);
14314
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
14155
14315
  /**
14156
14316
  * One coherent system-event condition. `kinds` is the required opt-in safety
14157
14317
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -14160,6 +14320,18 @@ var NcSystemEventKindSchema = _enum([
14160
14320
  var NcSystemEventConditionSchema = object({
14161
14321
  kinds: array(NcSystemEventKindSchema).min(1),
14162
14322
  deviceIds: array(number().int()).min(1).optional(),
14323
+ /**
14324
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14325
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14326
+ * is what a liveness rule means when nobody said otherwise.
14327
+ *
14328
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14329
+ * one reason: the intake cannot know which devices this household cares
14330
+ * about, and a producer-side filter is one no operator can change. Fails
14331
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14332
+ * does not carry) matches no `deviceTypes` list.
14333
+ */
14334
+ deviceTypes: array(string().min(1)).min(1).optional(),
14163
14335
  nodeIds: array(string().min(1)).min(1).optional(),
14164
14336
  packageNames: array(string().min(1)).min(1).optional()
14165
14337
  });
@@ -14210,6 +14382,47 @@ var NcOccupancyConditionSchema = object({
14210
14382
  sustainSeconds: number().int().min(0).max(3600).default(15)
14211
14383
  });
14212
14384
  /**
14385
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14386
+ *
14387
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14388
+ * reference notifier uses, so an operator moving between them re-uses what
14389
+ * they already know): a rule matches when, over a sampling window of
14390
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14391
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14392
+ *
14393
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14394
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14395
+ * - `labels` — the classifier put at least one of these labels on it.
14396
+ *
14397
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14398
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14399
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14400
+ * is given** — a window in which every sample is trivially a hit would fire on
14401
+ * silence, so the engine refuses such a condition rather than notifying on
14402
+ * nothing (the schema cannot express "at least one of" without becoming a
14403
+ * ZodEffects the cap path would have to special-case).
14404
+ *
14405
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14406
+ * must be FULL before it can match — a window that has been open for two
14407
+ * seconds of its ten is 100% of nothing, and firing on it would make
14408
+ * `samplingSeconds` decorative.
14409
+ *
14410
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14411
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14412
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14413
+ * an operator who typed `dog` mean the same thing.
14414
+ */
14415
+ var NcAudioConditionSchema = object({
14416
+ /** Audio macro labels; absent = any sound (level-only rule). */
14417
+ labels: array(string().min(1)).min(1).optional(),
14418
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14419
+ dbThreshold: number().min(-96).max(0).optional(),
14420
+ /** Percentage of the window's samples that must be hits (1–100). */
14421
+ hitPercent: number().int().min(1).max(100).default(60),
14422
+ /** Length of the sampling window in seconds. */
14423
+ samplingSeconds: number().int().min(1).max(300).default(10)
14424
+ });
14425
+ /**
14213
14426
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
14214
14427
  *
14215
14428
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14482,7 +14695,33 @@ var NcConditionsSchema = object({
14482
14695
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14483
14696
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14484
14697
  */
14485
- occupancy: NcOccupancyConditionSchema.optional()
14698
+ occupancy: NcOccupancyConditionSchema.optional(),
14699
+ /**
14700
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14701
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14702
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14703
+ * a window that is not full yet, neither filter given). See
14704
+ * {@link NcAudioCondition}.
14705
+ *
14706
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14707
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14708
+ * a detection, a track or a device event (the same fail-closed pairing
14709
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14710
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14711
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14712
+ * classified sample) stays exactly as it was for rules that already use it.
14713
+ *
14714
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14715
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14716
+ * (`camstack/src/data/notification-center.ts`, guarded by
14717
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14718
+ * condition fields it does not know when a rule is saved from the phone.
14719
+ * Publishing an editor for a condition the app cannot round-trip is how an
14720
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14721
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14722
+ * does an audio rule become authorable.
14723
+ */
14724
+ audio: NcAudioConditionSchema.optional()
14486
14725
  });
14487
14726
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14488
14727
  var NcRuleTargetSchema = object({
@@ -14596,6 +14835,73 @@ var NcThrottleSchema = object({
14596
14835
  */
14597
14836
  granularity: NcThrottleGranularitySchema.optional()
14598
14837
  });
14838
+ /**
14839
+ * How long the confirm gate may hold ONE notification, and how big the picture
14840
+ * it judges may be.
14841
+ *
14842
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14843
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14844
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14845
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14846
+ * tokens for pixels the model pools away.
14847
+ */
14848
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14849
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14850
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14851
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14852
+ var NcConfirmExpectSchema = object({
14853
+ op: _enum([
14854
+ ">=",
14855
+ ">",
14856
+ "<=",
14857
+ "<",
14858
+ "=="
14859
+ ]),
14860
+ count: number().int().min(0).max(1e3)
14861
+ });
14862
+ /**
14863
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14864
+ * to ship and says whether it agrees with the rule.
14865
+ *
14866
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14867
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14868
+ * on the operator's phone is not a verdict about this notification.
14869
+ *
14870
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14871
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14872
+ * the default and every fail-open is COUNTED, because a gate that always fails
14873
+ * open looks in the log exactly like a gate that works.
14874
+ *
14875
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14876
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14877
+ * production failures in one day), so the gate reads absent as the constant
14878
+ * above rather than trusting a parse it may never have seen.
14879
+ */
14880
+ var NcConfirmSchema = object({
14881
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14882
+ * same thing, and both mean "deliver exactly as before". */
14883
+ enabled: boolean().default(false),
14884
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14885
+ profileId: string().optional(),
14886
+ /**
14887
+ * The operator's question, in his own words. Absent = a question derived
14888
+ * from the rule (its class and its expectation).
14889
+ *
14890
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14891
+ * banners, signage and plates as instructions if you let them reach the
14892
+ * prompt — proven live — so the authoritative contract stays in the system
14893
+ * turn and only rule-authored words land here.
14894
+ */
14895
+ prompt: string().max(1e3).optional(),
14896
+ /** Fire only when the model's count satisfies this. Absent = the model's
14897
+ * own boolean verdict decides. */
14898
+ expect: NcConfirmExpectSchema.optional(),
14899
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14900
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14901
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14902
+ /** Longest edge the judged image is downscaled to before it is sent. */
14903
+ maxImagePx: number().int().min(64).max(2048).default(448)
14904
+ });
14599
14905
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14600
14906
  var NcRuleInputSchema = object({
14601
14907
  name: string().min(1).max(200),
@@ -14656,7 +14962,13 @@ var NcRuleInputSchema = object({
14656
14962
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14657
14963
  * shape as every other actuation.
14658
14964
  */
14659
- actions: NcRuleActionsSchema.optional()
14965
+ actions: NcRuleActionsSchema.optional(),
14966
+ /**
14967
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14968
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14969
+ * did, and absent is the only way to say that without a migration.
14970
+ */
14971
+ confirm: NcConfirmSchema.optional()
14660
14972
  });
14661
14973
  /**
14662
14974
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14667,7 +14979,37 @@ var NcRuleInputSchema = object({
14667
14979
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14668
14980
  * `updateRule` patch.
14669
14981
  */
14670
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
14982
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14983
+ disabledTargetIds: array(string()).optional(),
14984
+ /**
14985
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14986
+ *
14987
+ * It makes the key optional to SUPPLY; the parse still materialises the
14988
+ * default when the key is absent. And `NcRuleStore.update` merges with
14989
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14990
+ * one — which made every partial edit destructive:
14991
+ *
14992
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14993
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14994
+ * setEnabled(ruleId, false) → conditions reset to `{}`
14995
+ *
14996
+ * A rule scoped to one camera and one zone silently became a rule that
14997
+ * matches EVERY event on EVERY camera, and lost its `media` policy
14998
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
14999
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
15000
+ * within a minute of a two-field patch.
15001
+ *
15002
+ * So every defaulted field is re-declared here WITHOUT its default. The
15003
+ * inner defaults still apply when the caller DOES send the key — `{}` for
15004
+ * conditions remains a real instruction ("clear them") — and only the
15005
+ * absent key is now genuinely absent.
15006
+ */
15007
+ enabled: boolean().optional(),
15008
+ conditions: NcConditionsSchema.optional(),
15009
+ media: NcMediaPolicySchema.optional(),
15010
+ throttle: NcThrottleSchema.optional(),
15011
+ priority: number().int().min(1).max(5).optional()
15012
+ });
14671
15013
  /** A persisted rule. */
14672
15014
  var NcRuleSchema = NcRuleInputSchema.extend({
14673
15015
  id: string(),
@@ -14968,6 +15310,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14968
15310
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14969
15311
  * copy would lie the first time a rule is disabled.
14970
15312
  */
15313
+ /**
15314
+ * Why a device a mode NAMES is nonetheless not armed by it.
15315
+ *
15316
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15317
+ * per-camera notification switch the Notification Center already owns,
15318
+ * `detection-off` is the device's own detection binding being inactive, and
15319
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15320
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15321
+ * with the switches the operator actually used.
15322
+ */
15323
+ var NcAlarmSkipReasonSchema = _enum([
15324
+ "muted",
15325
+ "detection-off",
15326
+ "offline"
15327
+ ]);
15328
+ var NcAlarmSkippedDeviceSchema = object({
15329
+ deviceId: number().int(),
15330
+ reason: NcAlarmSkipReasonSchema
15331
+ });
14971
15332
  var NcAlarmModeCoverageSchema = object({
14972
15333
  mode: AlarmArmModeSchema,
14973
15334
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14975,7 +15336,18 @@ var NcAlarmModeCoverageSchema = object({
14975
15336
  /** At least one covering rule has no device scope, so the mode covers all. */
14976
15337
  allDevices: boolean(),
14977
15338
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14978
- deviceIds: array(number().int())
15339
+ deviceIds: array(number().int()),
15340
+ /**
15341
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15342
+ * excludes it.
15343
+ *
15344
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15345
+ * twelve makes it false in exactly the way nobody notices until an incident.
15346
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15347
+ * still parses as "nothing known to be skipped" rather than failing the whole
15348
+ * alarm tab.
15349
+ */
15350
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
14979
15351
  });
14980
15352
  var NcAlarmConfigSchema = object({
14981
15353
  /**
@@ -16338,13 +16710,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16338
16710
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16339
16711
  kind: "mutation",
16340
16712
  auth: "admin"
16341
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
16713
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
16342
16714
  kind: "mutation",
16343
16715
  auth: "admin"
16344
- }), method(object({}), array(RelocateJobSchema).readonly(), {
16345
- kind: "query",
16716
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
16717
+ kind: "mutation",
16346
16718
  auth: "admin"
16347
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16719
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
16720
+ kind: "mutation",
16721
+ auth: "admin"
16722
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
16723
+ kind: "mutation",
16724
+ auth: "admin"
16725
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16348
16726
  kind: "mutation",
16349
16727
  auth: "admin"
16350
16728
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -17801,9 +18179,16 @@ var CameraStatusSchema = object({
17801
18179
  audio: CameraAudioStatusSchema.nullable(),
17802
18180
  recording: CameraRecordingStatusSchema.nullable(),
17803
18181
  /**
17804
- * Per-camera function switches an OPERATOR has turned off
18182
+ * Per-camera functions an OPERATOR has turned off
17805
18183
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17806
18184
  *
18185
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
18186
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
18187
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
18188
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
18189
+ * The badge outlives the control panel: the panel was a convenience, this is
18190
+ * the difference between a camera being off and a camera being dead.
18191
+ *
17807
18192
  * This is the difference between DISABLED and BROKEN. A camera whose
17808
18193
  * `detection` block reports zero fps and whose `switchedOff` contains
17809
18194
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -17874,7 +18259,13 @@ var NodeInferenceDevicesSchema = object({
17874
18259
  reachable: boolean(),
17875
18260
  devices: array(NodeInferenceDeviceSchema).readonly()
17876
18261
  });
17877
- method(object({
18262
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
18263
+ kind: "mutation",
18264
+ auth: "admin"
18265
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
18266
+ kind: "mutation",
18267
+ auth: "admin"
18268
+ }), method(object({
17878
18269
  deviceId: number(),
17879
18270
  agentNodeId: string()
17880
18271
  }), object({ success: literal(true) }), {
@@ -18548,6 +18939,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
18548
18939
  locationId: string(),
18549
18940
  targetBytes: number().int().positive()
18550
18941
  }), EvictResultSchema, { kind: "mutation" });
18942
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
18943
+ kind: "mutation",
18944
+ auth: "admin"
18945
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
18946
+ kind: "mutation",
18947
+ auth: "admin"
18948
+ });
18551
18949
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
18552
18950
  providerId: string().min(1),
18553
18951
  displayName: string().min(1),
@@ -18651,6 +19049,28 @@ var TerminalProfileInfoSchema = object({
18651
19049
  label: string(),
18652
19050
  description: string().optional()
18653
19051
  });
19052
+ /**
19053
+ * A durable operator-created Terminal instance. Profiles are templates; only
19054
+ * an instance declares a camera.
19055
+ */
19056
+ var TerminalInstanceInfoSchema = object({
19057
+ instanceId: string(),
19058
+ cameraStableId: string(),
19059
+ nodeId: string(),
19060
+ profileId: string(),
19061
+ profileLabel: string(),
19062
+ name: string(),
19063
+ enabled: boolean()
19064
+ });
19065
+ var TerminalLegacyCameraSchema = object({
19066
+ stableId: string(),
19067
+ nodeId: string(),
19068
+ profileId: string(),
19069
+ profileLabel: string(),
19070
+ name: string(),
19071
+ /** Only legacy monitor cameras can retain their historic stable identity. */
19072
+ adoptable: boolean()
19073
+ });
18654
19074
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
18655
19075
  seq: number().int().positive(),
18656
19076
  kind: literal("data"),
@@ -18667,7 +19087,29 @@ var TerminalOutputBatchSchema = object({
18667
19087
  snapshot: string().optional(),
18668
19088
  events: array(TerminalOutputEventSchema).readonly()
18669
19089
  });
18670
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
19090
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
19091
+ targetNodeId: string().min(1),
19092
+ profileId: string().min(1),
19093
+ name: string().trim().min(1).max(160).optional()
19094
+ }), TerminalInstanceInfoSchema, {
19095
+ kind: "mutation",
19096
+ auth: "admin"
19097
+ }), method(object({ instanceId: string().min(1) }), _void(), {
19098
+ kind: "mutation",
19099
+ auth: "admin"
19100
+ }), method(object({
19101
+ instanceId: string().min(1),
19102
+ enabled: boolean()
19103
+ }), TerminalInstanceInfoSchema, {
19104
+ kind: "mutation",
19105
+ auth: "admin"
19106
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
19107
+ stableId: string().min(1),
19108
+ name: string().trim().min(1).max(160).optional()
19109
+ }), TerminalInstanceInfoSchema, {
19110
+ kind: "mutation",
19111
+ auth: "admin"
19112
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18671
19113
  profileId: string(),
18672
19114
  cols: number().int().positive(),
18673
19115
  rows: number().int().positive()
@@ -18684,7 +19126,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
18684
19126
  }), method(object({
18685
19127
  sessionId: string(),
18686
19128
  afterSeq: number().int().nonnegative(),
18687
- waitMs: number().int().min(0).max(2e3).default(0)
19129
+ waitMs: number().int().min(0).max(2e3).default(0),
19130
+ /**
19131
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
19132
+ * browser's initial repaint remains immediate; the camera snapshot
19133
+ * relay uses it to avoid encoding a blank startup frame.
19134
+ */
19135
+ waitForOutput: boolean().optional()
18688
19136
  }), TerminalOutputBatchSchema, {
18689
19137
  kind: "mutation",
18690
19138
  auth: "admin",
@@ -21182,6 +21630,7 @@ var FaceInfoSchema = object({
21182
21630
  var FaceFilterEnum = _enum([
21183
21631
  "unassigned",
21184
21632
  "recognized",
21633
+ "identified",
21185
21634
  "all"
21186
21635
  ]);
21187
21636
  var MediaFileLiteSchema$1 = object({
@@ -21210,6 +21659,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string(
21210
21659
  kind: "mutation",
21211
21660
  auth: "admin"
21212
21661
  }), method(object({
21662
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
21663
+ deviceId: number().int().optional(),
21213
21664
  limit: number().int().positive().optional(),
21214
21665
  filter: FaceFilterEnum.optional(),
21215
21666
  /**
@@ -23439,6 +23890,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
23439
23890
  capName: string().min(1).max(64),
23440
23891
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
23441
23892
  valuePath: string().min(1).max(64)
23893
+ }),
23894
+ object({
23895
+ kind: literal("latest-recognition"),
23896
+ recognition: _enum(["person", "plate"])
23442
23897
  })
23443
23898
  ]);
23444
23899
  var OsdSlotBindingSchema = object({
@@ -23544,6 +23999,15 @@ method(object({ deviceId: number().int() }), object({
23544
23999
  }), object({ success: literal(true) }), {
23545
24000
  kind: "mutation",
23546
24001
  auth: "admin"
24002
+ }), method(object({
24003
+ sourceDeviceId: number().int(),
24004
+ targetDeviceId: number().int()
24005
+ }), object({
24006
+ copied: number().int().nonnegative(),
24007
+ skipped: number().int().nonnegative()
24008
+ }), {
24009
+ kind: "mutation",
24010
+ auth: "admin"
23547
24011
  }), method(object({
23548
24012
  deviceId: number().int(),
23549
24013
  slotId: string().min(1),
@@ -24466,7 +24930,19 @@ var RecordingManifestSchema = object({
24466
24930
  * profiles/subtrees/locations on this node). */
24467
24931
  var RecordingDeviceUsageSchema = object({
24468
24932
  deviceId: number(),
24469
- usedBytes: number()
24933
+ usedBytes: number(),
24934
+ /**
24935
+ * Start of this camera's OLDEST indexed segment, across every profile and
24936
+ * location — the "Oldest footage" column in Recordings → Storage, and the
24937
+ * only honest answer to "is retention actually holding?" per camera.
24938
+ *
24939
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
24940
+ * predates this field omits it entirely, and a hub whose types carry the
24941
+ * field must keep validating that older provider's payload: the framework
24942
+ * (types) and the addon ship on different trains, and the addon is usually
24943
+ * the later of the two.
24944
+ */
24945
+ oldestMs: number().nullable().optional()
24470
24946
  });
24471
24947
  /** Recording storage usage + capacity for one storage location. */
24472
24948
  var RecordingLocationUsageSchema = object({
@@ -24494,6 +24970,57 @@ var RecordingStorageUsageSchema = object({
24494
24970
  locations: array(RecordingLocationUsageSchema)
24495
24971
  });
24496
24972
  /**
24973
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
24974
+ *
24975
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
24976
+ * is the operator asking for the EXISTING archive to be brought into line with
24977
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
24978
+ * location, run FIFO behind the single-flight mover.
24979
+ *
24980
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
24981
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
24982
+ * (empty on the plan).
24983
+ */
24984
+ var RecordingRebalanceMoveSchema = object({
24985
+ deviceId: number(),
24986
+ profile: string(),
24987
+ fromLocationId: string(),
24988
+ toLocationId: string(),
24989
+ bytes: number(),
24990
+ files: number().int()
24991
+ });
24992
+ /** Why a pile that is out of place is staying there. Every refusal is
24993
+ * reported: a rebalance that silently drops a camera reads exactly like one
24994
+ * that had nothing to do. */
24995
+ var RecordingRebalanceSkipReasonSchema = _enum([
24996
+ "unassigned",
24997
+ "target-not-writable",
24998
+ "below-threshold",
24999
+ "no-headroom"
25000
+ ]);
25001
+ var RecordingRebalanceSkipSchema = object({
25002
+ deviceId: number(),
25003
+ profile: string(),
25004
+ fromLocationId: string(),
25005
+ /** The location the plan wants; null when the camera has no assignment. */
25006
+ toLocationId: string().nullable(),
25007
+ bytes: number(),
25008
+ reason: RecordingRebalanceSkipReasonSchema
25009
+ });
25010
+ var RecordingRebalancePlanSchema = object({
25011
+ moves: array(RecordingRebalanceMoveSchema),
25012
+ skipped: array(RecordingRebalanceSkipSchema),
25013
+ bytesToMove: number(),
25014
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
25015
+ jobIds: array(string())
25016
+ });
25017
+ var RecordingRebalanceInputSchema = object({
25018
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
25019
+ throttleMbps: number().min(1).max(1e3).optional(),
25020
+ /** Ignore piles smaller than this (default 1 GB). */
25021
+ minMoveGb: number().min(0).optional()
25022
+ });
25023
+ /**
24497
25024
  * Result of locating footage at a wall-clock instant for one device/profile.
24498
25025
  * `segment` carries the covering segment's window; `gap` reports the forward
24499
25026
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -24641,6 +25168,21 @@ method(object({
24641
25168
  }), {
24642
25169
  kind: "mutation",
24643
25170
  auth: "admin"
25171
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
25172
+ kind: "mutation",
25173
+ auth: "admin"
25174
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
25175
+ kind: "mutation",
25176
+ auth: "admin"
25177
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
25178
+ kind: "mutation",
25179
+ auth: "admin"
25180
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
25181
+ kind: "mutation",
25182
+ auth: "admin"
25183
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
25184
+ kind: "mutation",
25185
+ auth: "admin"
24644
25186
  }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24645
25187
  kind: "mutation",
24646
25188
  auth: "admin"
@@ -24650,9 +25192,15 @@ method(object({
24650
25192
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24651
25193
  kind: "mutation",
24652
25194
  auth: "admin"
25195
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25196
+ kind: "query",
25197
+ auth: "admin"
25198
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25199
+ kind: "mutation",
25200
+ auth: "admin"
24653
25201
  });
24654
25202
  /**
24655
- * `recordingExport` cap — render a footage time range into a single downloadable
25203
+ * `recording-export` cap — render a footage time range into a single downloadable
24656
25204
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
24657
25205
  * bounded lifetime with a durable history, auto-expiry, and optional
24658
25206
  * delete-after-download.
@@ -24667,10 +25215,42 @@ method(object({
24667
25215
  */
24668
25216
  /** Playback-speed multiplier for the render (1 = realtime). */
24669
25217
  var ExportSpeedSchema = number().min(.25).max(32);
25218
+ /**
25219
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25220
+ *
25221
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
25222
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25223
+ * playlist. Handing it absolute epochs would make every call site responsible
25224
+ * for the same subtraction, and the one that forgot would emit a filter that
25225
+ * selects nothing — silently, as a uniform timelapse.
25226
+ */
25227
+ var ExportDenseRangeSchema = object({
25228
+ fromSec: number().nonnegative(),
25229
+ toSec: number().nonnegative()
25230
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
25231
+ /**
25232
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
25233
+ * listed ranges and at the base `everyMs` everywhere else.
25234
+ *
25235
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
25236
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
25237
+ */
25238
+ var ExportDenseSchema = object({
25239
+ everyMs: number().int().positive(),
25240
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
25241
+ });
24670
25242
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
24671
25243
  var ExportTimelapseSchema = object({
24672
25244
  everyMs: number().int().positive(),
24673
- outputFps: number().int().min(1).max(60).optional()
25245
+ outputFps: number().int().min(1).max(60).optional(),
25246
+ /** Optional second, FASTER rate over the intervals that matter. */
25247
+ dense: ExportDenseSchema.optional()
25248
+ }).superRefine((v, ctx) => {
25249
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
25250
+ code: ZodIssueCode.custom,
25251
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
25252
+ path: ["dense", "everyMs"]
25253
+ });
24674
25254
  });
24675
25255
  /**
24676
25256
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -24728,6 +25308,19 @@ var ExportDownloadSchema = object({
24728
25308
  url: string(),
24729
25309
  endpoints: array(string())
24730
25310
  });
25311
+ /**
25312
+ * A finished export's bytes, inline.
25313
+ *
25314
+ * `bytes` is the DECODED length — the number the caller bounds and logs
25315
+ * against, so nobody has to infer it from the base64 length.
25316
+ */
25317
+ var ExportBytesSchema = object({
25318
+ base64: string(),
25319
+ contentType: string(),
25320
+ /** Suggested filename, extension included. */
25321
+ name: string(),
25322
+ bytes: number().int().nonnegative()
25323
+ });
24731
25324
  method(object({
24732
25325
  deviceId: number(),
24733
25326
  profile: string(),
@@ -24752,6 +25345,9 @@ method(object({
24752
25345
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
24753
25346
  kind: "query",
24754
25347
  auth: "protected"
25348
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
25349
+ kind: "query",
25350
+ auth: "protected"
24755
25351
  });
24756
25352
  /**
24757
25353
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -30253,6 +30849,12 @@ Object.freeze({
30253
30849
  addonId: null,
30254
30850
  access: "delete"
30255
30851
  },
30852
+ "osdManager.copyDeviceConfiguration": {
30853
+ capName: "osd-manager",
30854
+ capScope: "system",
30855
+ addonId: null,
30856
+ access: "create"
30857
+ },
30256
30858
  "osdManager.getConditionSupport": {
30257
30859
  capName: "osd-manager",
30258
30860
  capScope: "system",
@@ -30349,7 +30951,7 @@ Object.freeze({
30349
30951
  addonId: null,
30350
30952
  access: "create"
30351
30953
  },
30352
- "pipelineAnalytics.cancelMediaRelocate": {
30954
+ "pipelineAnalytics.cancelStorageMigrationMove": {
30353
30955
  capName: "pipeline-analytics",
30354
30956
  capScope: "device",
30355
30957
  addonId: null,
@@ -30421,12 +31023,6 @@ Object.freeze({
30421
31023
  addonId: null,
30422
31024
  access: "view"
30423
31025
  },
30424
- "pipelineAnalytics.getMediaRelocateStatus": {
30425
- capName: "pipeline-analytics",
30426
- capScope: "device",
30427
- addonId: null,
30428
- access: "view"
30429
- },
30430
31026
  "pipelineAnalytics.getMotionEvents": {
30431
31027
  capName: "pipeline-analytics",
30432
31028
  capScope: "device",
@@ -30463,6 +31059,12 @@ Object.freeze({
30463
31059
  addonId: null,
30464
31060
  access: "view"
30465
31061
  },
31062
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
31063
+ capName: "pipeline-analytics",
31064
+ capScope: "device",
31065
+ addonId: null,
31066
+ access: "view"
31067
+ },
30466
31068
  "pipelineAnalytics.getTrack": {
30467
31069
  capName: "pipeline-analytics",
30468
31070
  capScope: "device",
@@ -30541,6 +31143,12 @@ Object.freeze({
30541
31143
  addonId: null,
30542
31144
  access: "view"
30543
31145
  },
31146
+ "pipelineAnalytics.pauseForStorageMigration": {
31147
+ capName: "pipeline-analytics",
31148
+ capScope: "device",
31149
+ addonId: null,
31150
+ access: "create"
31151
+ },
30544
31152
  "pipelineAnalytics.proposeRetrainAnnotations": {
30545
31153
  capName: "pipeline-analytics",
30546
31154
  capScope: "device",
@@ -30571,7 +31179,7 @@ Object.freeze({
30571
31179
  addonId: null,
30572
31180
  access: "create"
30573
31181
  },
30574
- "pipelineAnalytics.relocateMedia": {
31182
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
30575
31183
  capName: "pipeline-analytics",
30576
31184
  capScope: "device",
30577
31185
  addonId: null,
@@ -30583,6 +31191,12 @@ Object.freeze({
30583
31191
  addonId: null,
30584
31192
  access: "create"
30585
31193
  },
31194
+ "pipelineAnalytics.resumeForStorageMigration": {
31195
+ capName: "pipeline-analytics",
31196
+ capScope: "device",
31197
+ addonId: null,
31198
+ access: "create"
31199
+ },
30586
31200
  "pipelineAnalytics.saveRetrainAnnotations": {
30587
31201
  capName: "pipeline-analytics",
30588
31202
  capScope: "device",
@@ -30607,6 +31221,12 @@ Object.freeze({
30607
31221
  addonId: null,
30608
31222
  access: "create"
30609
31223
  },
31224
+ "pipelineAnalytics.startStorageMigrationMove": {
31225
+ capName: "pipeline-analytics",
31226
+ capScope: "device",
31227
+ addonId: null,
31228
+ access: "create"
31229
+ },
30610
31230
  "pipelineAnalytics.wipeAllAnalytics": {
30611
31231
  capName: "pipeline-analytics",
30612
31232
  capScope: "device",
@@ -30973,6 +31593,12 @@ Object.freeze({
30973
31593
  addonId: null,
30974
31594
  access: "view"
30975
31595
  },
31596
+ "pipelineOrchestrator.pauseForStorageMigration": {
31597
+ capName: "pipeline-orchestrator",
31598
+ capScope: "system",
31599
+ addonId: null,
31600
+ access: "create"
31601
+ },
30976
31602
  "pipelineOrchestrator.rebalance": {
30977
31603
  capName: "pipeline-orchestrator",
30978
31604
  capScope: "system",
@@ -30997,6 +31623,12 @@ Object.freeze({
30997
31623
  addonId: null,
30998
31624
  access: "view"
30999
31625
  },
31626
+ "pipelineOrchestrator.resumeForStorageMigration": {
31627
+ capName: "pipeline-orchestrator",
31628
+ capScope: "system",
31629
+ addonId: null,
31630
+ access: "create"
31631
+ },
31000
31632
  "pipelineOrchestrator.saveTemplate": {
31001
31633
  capName: "pipeline-orchestrator",
31002
31634
  capScope: "system",
@@ -31393,7 +32025,13 @@ Object.freeze({
31393
32025
  addonId: null,
31394
32026
  access: "create"
31395
32027
  },
31396
- "recording.cancelRelocate": {
32028
+ "recording.cancelRelocateJob": {
32029
+ capName: "recording",
32030
+ capScope: "system",
32031
+ addonId: null,
32032
+ access: "create"
32033
+ },
32034
+ "recording.cancelStorageMigrationMove": {
31397
32035
  capName: "recording",
31398
32036
  capScope: "system",
31399
32037
  addonId: null,
@@ -31429,7 +32067,7 @@ Object.freeze({
31429
32067
  addonId: null,
31430
32068
  access: "view"
31431
32069
  },
31432
- "recording.getRelocateStatus": {
32070
+ "recording.getStorageMigrationMoveStatus": {
31433
32071
  capName: "recording",
31434
32072
  capScope: "system",
31435
32073
  addonId: null,
@@ -31447,12 +32085,30 @@ Object.freeze({
31447
32085
  addonId: null,
31448
32086
  access: "view"
31449
32087
  },
32088
+ "recording.listRelocateJobs": {
32089
+ capName: "recording",
32090
+ capScope: "system",
32091
+ addonId: null,
32092
+ access: "view"
32093
+ },
31450
32094
  "recording.locateSegment": {
31451
32095
  capName: "recording",
31452
32096
  capScope: "system",
31453
32097
  addonId: null,
31454
32098
  access: "view"
31455
32099
  },
32100
+ "recording.pauseForStorageMigration": {
32101
+ capName: "recording",
32102
+ capScope: "system",
32103
+ addonId: null,
32104
+ access: "create"
32105
+ },
32106
+ "recording.planStorageRebalance": {
32107
+ capName: "recording",
32108
+ capScope: "system",
32109
+ addonId: null,
32110
+ access: "view"
32111
+ },
31456
32112
  "recording.pruneFootage": {
31457
32113
  capName: "recording",
31458
32114
  capScope: "system",
@@ -31471,6 +32127,12 @@ Object.freeze({
31471
32127
  addonId: null,
31472
32128
  access: "view"
31473
32129
  },
32130
+ "recording.refreshStorageLocationsForMigration": {
32131
+ capName: "recording",
32132
+ capScope: "system",
32133
+ addonId: null,
32134
+ access: "create"
32135
+ },
31474
32136
  "recording.relocateFootage": {
31475
32137
  capName: "recording",
31476
32138
  capScope: "system",
@@ -31495,44 +32157,68 @@ Object.freeze({
31495
32157
  addonId: null,
31496
32158
  access: "create"
31497
32159
  },
32160
+ "recording.resumeForStorageMigration": {
32161
+ capName: "recording",
32162
+ capScope: "system",
32163
+ addonId: null,
32164
+ access: "create"
32165
+ },
31498
32166
  "recording.setDeviceConfig": {
31499
32167
  capName: "recording",
31500
32168
  capScope: "system",
31501
32169
  addonId: null,
31502
32170
  access: "create"
31503
32171
  },
32172
+ "recording.startStorageMigrationMove": {
32173
+ capName: "recording",
32174
+ capScope: "system",
32175
+ addonId: null,
32176
+ access: "create"
32177
+ },
32178
+ "recording.startStorageRebalance": {
32179
+ capName: "recording",
32180
+ capScope: "system",
32181
+ addonId: null,
32182
+ access: "create"
32183
+ },
31504
32184
  "recordingExport.cancelExport": {
31505
- capName: "recordingExport",
32185
+ capName: "recording-export",
31506
32186
  capScope: "system",
31507
32187
  addonId: null,
31508
32188
  access: "create"
31509
32189
  },
31510
32190
  "recordingExport.createExport": {
31511
- capName: "recordingExport",
32191
+ capName: "recording-export",
31512
32192
  capScope: "system",
31513
32193
  addonId: null,
31514
32194
  access: "create"
31515
32195
  },
31516
32196
  "recordingExport.deleteExport": {
31517
- capName: "recordingExport",
32197
+ capName: "recording-export",
31518
32198
  capScope: "system",
31519
32199
  addonId: null,
31520
32200
  access: "delete"
31521
32201
  },
31522
32202
  "recordingExport.getDownloadUrl": {
31523
- capName: "recordingExport",
32203
+ capName: "recording-export",
31524
32204
  capScope: "system",
31525
32205
  addonId: null,
31526
32206
  access: "view"
31527
32207
  },
31528
32208
  "recordingExport.getExport": {
31529
- capName: "recordingExport",
32209
+ capName: "recording-export",
31530
32210
  capScope: "system",
31531
32211
  addonId: null,
31532
32212
  access: "view"
31533
32213
  },
31534
32214
  "recordingExport.listExports": {
31535
- capName: "recordingExport",
32215
+ capName: "recording-export",
32216
+ capScope: "system",
32217
+ addonId: null,
32218
+ access: "view"
32219
+ },
32220
+ "recordingExport.readExportBytes": {
32221
+ capName: "recording-export",
31536
32222
  capScope: "system",
31537
32223
  addonId: null,
31538
32224
  access: "view"
@@ -31891,6 +32577,30 @@ Object.freeze({
31891
32577
  addonId: null,
31892
32578
  access: "view"
31893
32579
  },
32580
+ "storageMigration.cancel": {
32581
+ capName: "storage-migration",
32582
+ capScope: "system",
32583
+ addonId: null,
32584
+ access: "create"
32585
+ },
32586
+ "storageMigration.plan": {
32587
+ capName: "storage-migration",
32588
+ capScope: "system",
32589
+ addonId: null,
32590
+ access: "view"
32591
+ },
32592
+ "storageMigration.start": {
32593
+ capName: "storage-migration",
32594
+ capScope: "system",
32595
+ addonId: null,
32596
+ access: "create"
32597
+ },
32598
+ "storageMigration.status": {
32599
+ capName: "storage-migration",
32600
+ capScope: "system",
32601
+ addonId: null,
32602
+ access: "view"
32603
+ },
31894
32604
  "storageProvider.abortUpload": {
31895
32605
  capName: "storage-provider",
31896
32606
  capScope: "system",
@@ -32269,12 +32979,42 @@ Object.freeze({
32269
32979
  addonId: null,
32270
32980
  access: "create"
32271
32981
  },
32982
+ "terminalSession.adoptLegacyMonitor": {
32983
+ capName: "terminal-session",
32984
+ capScope: "system",
32985
+ addonId: null,
32986
+ access: "create"
32987
+ },
32272
32988
  "terminalSession.close": {
32273
32989
  capName: "terminal-session",
32274
32990
  capScope: "system",
32275
32991
  addonId: null,
32276
32992
  access: "create"
32277
32993
  },
32994
+ "terminalSession.createInstance": {
32995
+ capName: "terminal-session",
32996
+ capScope: "system",
32997
+ addonId: null,
32998
+ access: "create"
32999
+ },
33000
+ "terminalSession.deleteInstance": {
33001
+ capName: "terminal-session",
33002
+ capScope: "system",
33003
+ addonId: null,
33004
+ access: "delete"
33005
+ },
33006
+ "terminalSession.listInstances": {
33007
+ capName: "terminal-session",
33008
+ capScope: "system",
33009
+ addonId: null,
33010
+ access: "view"
33011
+ },
33012
+ "terminalSession.listLegacyCameras": {
33013
+ capName: "terminal-session",
33014
+ capScope: "system",
33015
+ addonId: null,
33016
+ access: "view"
33017
+ },
32278
33018
  "terminalSession.listProfiles": {
32279
33019
  capName: "terminal-session",
32280
33020
  capScope: "system",
@@ -32305,6 +33045,12 @@ Object.freeze({
32305
33045
  addonId: null,
32306
33046
  access: "create"
32307
33047
  },
33048
+ "terminalSession.setInstanceEnabled": {
33049
+ capName: "terminal-session",
33050
+ capScope: "system",
33051
+ addonId: null,
33052
+ access: "create"
33053
+ },
32308
33054
  "terminalSession.writeInput": {
32309
33055
  capName: "terminal-session",
32310
33056
  capScope: "system",
@@ -32849,6 +33595,104 @@ var FramerateField = number().int().min(1).max(60);
32849
33595
  var TargetsField = array(NcRuleTargetSchema).min(1);
32850
33596
  var PriorityField = number().int().min(1).max(5);
32851
33597
  /**
33598
+ * Explicit override of the DENSE sampling cadence, seconds.
33599
+ *
33600
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
33601
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
33602
+ * made that same base 3 s and rendered a person pass as two frames.)
33603
+ *
33604
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
33605
+ * `denseCadenceSec` and played at `framerate` occupies
33606
+ *
33607
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
33608
+ *
33609
+ * 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.
33610
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
33611
+ * and therefore the length of a quiet night, does not move.
33612
+ *
33613
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
33614
+ * the recording has them returns the same frames, requested twice. Must be
33615
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
33616
+ * a uniform video the operator believes is two-rate — and upsert refuses it
33617
+ * rather than letting the export cap reject the render hours after the window.
33618
+ */
33619
+ var DenseCadenceSecField = number().min(.1).max(3600);
33620
+ /**
33621
+ * Minimum seconds of OUTPUT video each detection range must occupy.
33622
+ *
33623
+ * The operator-facing form of the arithmetic above: instead of solving for a
33624
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
33625
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
33626
+ * that range every ~583 ms.
33627
+ *
33628
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
33629
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
33630
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
33631
+ * ranges are sampled denser than they need. Per-range cadences require a cap
33632
+ * schema change and are the tracked follow-up.
33633
+ *
33634
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
33635
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
33636
+ * by real footage, never met by duplicating frames into motion that never
33637
+ * happened.
33638
+ */
33639
+ var MinDwellSecField = number().min(0).max(60);
33640
+ /**
33641
+ * Caption burned into the notification's preview frame.
33642
+ *
33643
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
33644
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
33645
+ * templating dialect for one field would be a second thing to explain.
33646
+ *
33647
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
33648
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
33649
+ * the reason this is not `.min(1)`.
33650
+ */
33651
+ var PreviewTextField = string().max(200);
33652
+ /**
33653
+ * Whether the notification's preview is a STILL or a short animation.
33654
+ *
33655
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
33656
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
33657
+ * night reads better as three seconds of motion than as one frame of it. Both
33658
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
33659
+ * simply applies it to a dozen frames sampled across the render and assembles
33660
+ * them.
33661
+ *
33662
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
33663
+ * seeks and a palette pass, and no rule that never asked for one should start
33664
+ * paying that on the deploy that shipped it.
33665
+ *
33666
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
33667
+ */
33668
+ var PreviewModeField = _enum(["image", "gif"]);
33669
+ /**
33670
+ * Which detection classes the notification reports counts for.
33671
+ *
33672
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
33673
+ * plan — no second query — aggregated per class. Absent or empty means "every
33674
+ * class the window actually contained", which is what an operator who never
33675
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
33676
+ * counts cars all night).
33677
+ *
33678
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
33679
+ * …). An unknown name simply never matches and reports nothing — it is not an
33680
+ * error, because a rule may legitimately name a class this camera's model does
33681
+ * not emit.
33682
+ *
33683
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
33684
+ * - `{{detections}}` — total over the reported classes
33685
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
33686
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
33687
+ * one per class, `count_` + the class name
33688
+ *
33689
+ * With NO custom body template the summary is appended to the derived body, and
33690
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
33691
+ * reads. With a custom template the operator owns every word — nothing is
33692
+ * appended, so `{{detectionSummary}}` is how he asks for it.
33693
+ */
33694
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
33695
+ /**
32852
33696
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
32853
33697
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
32854
33698
  * here (see the ownership note above).
@@ -32868,9 +33712,30 @@ var TimelapseRuleInputSchema = object({
32868
33712
  cadenceSec: CadenceSecField.default(15),
32869
33713
  /** Output frames per second of the assembled mp4 (predecessor parity). */
32870
33714
  framerate: FramerateField.default(10),
33715
+ /**
33716
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
33717
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
33718
+ * field gets.
33719
+ */
33720
+ denseCadenceSec: DenseCadenceSecField.optional(),
33721
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
33722
+ minDwellSec: MinDwellSecField.optional(),
32871
33723
  /** `notification-output` targets the finished video/thumbnail is sent to. */
32872
33724
  targets: TargetsField,
32873
33725
  template: TimelapseTemplateSchema.optional(),
33726
+ /**
33727
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
33728
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
33729
+ *
33730
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
33731
+ * the notification's title/body, and clearing it (`template: null`) must not
33732
+ * silently clear the caption too.
33733
+ */
33734
+ previewText: PreviewTextField.optional(),
33735
+ /** Still or animation — see {@link PreviewModeField}. */
33736
+ previewMode: PreviewModeField.default("image"),
33737
+ /** Classes the notification counts — see {@link ReportClassesField}. */
33738
+ reportClasses: ReportClassesField.optional(),
32874
33739
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
32875
33740
  priority: PriorityField.default(3)
32876
33741
  });
@@ -32881,8 +33746,13 @@ object({
32881
33746
  schedule: NcScheduleSchema.optional(),
32882
33747
  cadenceSec: CadenceSecField.optional(),
32883
33748
  framerate: FramerateField.optional(),
33749
+ denseCadenceSec: DenseCadenceSecField.optional(),
33750
+ minDwellSec: MinDwellSecField.optional(),
32884
33751
  targets: TargetsField.optional(),
32885
33752
  template: TimelapseTemplateSchema.nullable().optional(),
33753
+ previewText: PreviewTextField.optional(),
33754
+ previewMode: PreviewModeField.optional(),
33755
+ reportClasses: ReportClassesField.optional(),
32886
33756
  priority: PriorityField.optional()
32887
33757
  });
32888
33758
  TimelapseRuleInputSchema.extend({
@@ -32894,10 +33764,28 @@ TimelapseRuleInputSchema.extend({
32894
33764
  */
32895
33765
  ownerUserId: string().optional(),
32896
33766
  /**
32897
- * Epoch-ms of the last successful generation — the 1-hour re-generation
32898
- * guard's durable state (predecessor parity). Absent = never generated.
33767
+ * Epoch-ms of the NEWEST successful generation across every camera of this
33768
+ * rule. What a UI shows, and the compatibility floor for
33769
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
32899
33770
  */
32900
33771
  lastGeneratedAt: number().optional(),
33772
+ /**
33773
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
33774
+ * re-generation guard's real durable state.
33775
+ *
33776
+ * One rule covers several cameras and each renders its own video, so a rule
33777
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
33778
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
33779
+ * already done — and B's night is gone for good, because the window will not
33780
+ * come back.
33781
+ *
33782
+ * ADDITIVE, so the migration is free: a row written before this field simply
33783
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
33784
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
33785
+ * "never generated" would re-render and re-notify every camera of every rule
33786
+ * once, on the deploy that shipped the map.
33787
+ */
33788
+ generatedByDevice: record(string(), number()).optional(),
32901
33789
  /** userId of the caller who created the rule (server-stamped). */
32902
33790
  createdBy: string(),
32903
33791
  createdAt: number(),