@camstack/addon-provider-ecowitt 0.2.11 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +936 -48
  2. package/dist/addon.mjs +936 -48
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -7222,8 +7222,31 @@ var AdoptionJobSchema = object({
7222
7222
  error: string().nullable()
7223
7223
  });
7224
7224
  /**
7225
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
7226
- * pipeline functions an operator thinks in terms of.
7225
+ * Per-camera FUNCTION SWITCHES.
7226
+ *
7227
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
7228
+ *
7229
+ * This file shipped as "the one coherent on/off surface over the pipeline
7230
+ * functions an operator thinks in terms of". The operator's verdict on
7231
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
7232
+ * every function already had a settings page of its own, and a second place to
7233
+ * turn it off is a second place to look. Each switch is going back to its own
7234
+ * component's original options — detection to the detection-pipeline wrapper
7235
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
7236
+ * (which was always first-class; the switch was a veneer over
7237
+ * `recording.setDeviceConfig`), notifications to a notification-center
7238
+ * per-device setting, the two camera planes to their own components.
7239
+ *
7240
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
7241
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
7242
+ * straight from the authorities with no group in the middle. That rule was
7243
+ * never about a control panel.
7244
+ *
7245
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
7246
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
7247
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
7248
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
7249
+ * stop; nothing new may be built on it.
7227
7250
  *
7228
7251
  * ## This file adds no state
7229
7252
  *
@@ -7568,14 +7591,21 @@ var RecordingConfigSchema = object({
7568
7591
  /**
7569
7592
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
7570
7593
  *
7571
- * One shape shared by the recorder's `relocateFootage` (segments) and
7572
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
7573
- * page renders both movers with one component. Jobs are in-RAM (a restart
7574
- * forgets them re-running is safe by construction: copy-if-absent, delete
7575
- * after verify) and each completed/failed run also lands one durable ops-log
7576
- * row on the owning addon's surface.
7594
+ * One shape shared by the recorder and pipeline-analytics internal movers.
7595
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
7596
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
7597
+ * Each completed/failed run also lands one durable ops-log row on its owning
7598
+ * addon surface.
7599
+ */
7600
+ /**
7601
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
7602
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
7603
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
7604
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
7605
+ * runs at all.
7577
7606
  */
7578
7607
  var RelocateJobStateSchema = _enum([
7608
+ "queued",
7579
7609
  "running",
7580
7610
  "done",
7581
7611
  "failed",
@@ -7600,19 +7630,109 @@ var RelocateJobSchema = object({
7600
7630
  finishedAt: number().nullable(),
7601
7631
  error: string().nullable()
7602
7632
  });
7633
+ /** Profile-derived footage selection used only by the migration coordinator:
7634
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
7635
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
7603
7636
  var RelocateFootageInputSchema = object({
7604
- deviceId: number().optional(),
7605
7637
  fromLocationId: string(),
7606
7638
  toLocationId: string(),
7607
7639
  entities: array(_enum(["segments"])).optional(),
7640
+ /** Limits relocation to the logical profile class. Omit only for the
7641
+ * pre-orchestration compatibility path. */
7642
+ footageClass: RelocateFootageClassSchema.optional(),
7643
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
7644
+ * is what a whole-disk drain means. The rebalance path always sets it: its
7645
+ * unit is a (camera, profile) pile, not a disk. */
7646
+ deviceId: number().int().optional(),
7647
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
7648
+ * Finer than `footageClass`, which cannot separate high from mid — and the
7649
+ * placement plan assigns those two independently, so a rebalance that could
7650
+ * only say "recordings" would move footage the plan never asked to move. */
7651
+ profiles: array(string()).optional(),
7608
7652
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
7609
7653
  * never allowed to starve live writers. */
7610
7654
  throttleMbps: number().min(1).max(1e3).optional()
7611
7655
  });
7612
- var RelocateMediaInputSchema = object({
7613
- deviceId: number().optional(),
7656
+ /** Internal, lease-scoped participant operation. It is intentionally separate
7657
+ * from persistent recording settings: a migration never changes
7658
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
7659
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
7660
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
7661
+ var StorageMigrationMediaMoveInputSchema = object({
7614
7662
  toLocationId: string(),
7615
7663
  throttleMbps: number().min(1).max(1e3).optional()
7664
+ }).extend({ leaseId: string().min(1) });
7665
+ /** The independently selectable logical storage classes. `recordings`
7666
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
7667
+ * segments; `eventMedia` is post-analysis blobs. */
7668
+ var StorageMigrationClassSchema = _enum([
7669
+ "recordings",
7670
+ "recordingsLow",
7671
+ "eventMedia"
7672
+ ]);
7673
+ /** A destination is always an existing, fully-qualified location id. The
7674
+ * migration API intentionally never changes a source location's `basePath`:
7675
+ * callers create a new `<type>:<slug>` location, then select it here. */
7676
+ var StorageMigrationDestinationsSchema = object({
7677
+ recordings: string().min(1).optional(),
7678
+ recordingsLow: string().min(1).optional(),
7679
+ eventMedia: string().min(1).optional()
7680
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
7681
+ /** Shared input for planning and starting an orchestrated storage migration. */
7682
+ var StorageMigrationInputSchema = object({
7683
+ destinations: StorageMigrationDestinationsSchema,
7684
+ throttleMbps: number().min(1).max(1e3).optional()
7685
+ });
7686
+ /** The durable coordinator state machine. The only phase that changes default
7687
+ * locations is `repointing`, after every selected mover has completed and been
7688
+ * verified. */
7689
+ var StorageMigrationPhaseSchema = _enum([
7690
+ "planning",
7691
+ "pausing",
7692
+ "moving",
7693
+ "verifying",
7694
+ "repointing",
7695
+ "refreshing",
7696
+ "resuming",
7697
+ "done",
7698
+ "failed",
7699
+ "cancelled"
7700
+ ]);
7701
+ var StorageMigrationParticipantSchema = _enum([
7702
+ "pipeline",
7703
+ "recorder",
7704
+ "analytics"
7705
+ ]);
7706
+ var StorageMigrationMoveSchema = object({
7707
+ storageClass: StorageMigrationClassSchema,
7708
+ fromLocationId: string(),
7709
+ toLocationId: string(),
7710
+ moverJobId: string().nullable(),
7711
+ state: RelocateJobStateSchema.nullable(),
7712
+ error: string().nullable()
7713
+ });
7714
+ var StorageMigrationJobSchema = object({
7715
+ jobId: string(),
7716
+ phase: StorageMigrationPhaseSchema,
7717
+ destinations: StorageMigrationDestinationsSchema,
7718
+ throttleMbps: number(),
7719
+ moves: array(StorageMigrationMoveSchema),
7720
+ pauseLeaseId: string().nullable(),
7721
+ pausedParticipants: array(StorageMigrationParticipantSchema),
7722
+ repointed: boolean(),
7723
+ cancelRequested: boolean(),
7724
+ startedAt: number(),
7725
+ updatedAt: number(),
7726
+ finishedAt: number().nullable(),
7727
+ error: string().nullable()
7728
+ });
7729
+ var StorageMigrationPlanSchema = object({
7730
+ destinations: StorageMigrationDestinationsSchema,
7731
+ moves: array(object({
7732
+ storageClass: StorageMigrationClassSchema,
7733
+ fromLocationId: string(),
7734
+ toLocationId: string()
7735
+ }))
7616
7736
  });
7617
7737
  /**
7618
7738
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -7664,6 +7784,21 @@ var StorageLocationSchema = object({
7664
7784
  nodeId: string().optional(),
7665
7785
  isDefault: boolean().default(false),
7666
7786
  isSystem: boolean().default(false),
7787
+ /**
7788
+ * Operator opt-in: whether consumers that BALANCE across several locations
7789
+ * of a type may write here. Recordings reads it today; event media and
7790
+ * backups are the next consumers, which is why the flag lives on the
7791
+ * location rather than in any one addon's store — nothing has to be
7792
+ * extended to add the next consumer.
7793
+ *
7794
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
7795
+ * flag existed reads back with no flag and keeps working exactly as before;
7796
+ * that is the whole compat story, and it is why no migration ships with it.
7797
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
7798
+ * disk must not silently start writing to it); the default of a type is
7799
+ * always stamped `true`.
7800
+ */
7801
+ enabled: boolean().optional(),
7667
7802
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
7668
7803
  * for node-local locations it can reach) — never persisted, absent when the
7669
7804
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -12216,7 +12351,8 @@ method(object({
12216
12351
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
12217
12352
  /**
12218
12353
  * filesystem-browse — per-node capability for browsing the node's local
12219
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
12354
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
12355
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
12220
12356
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
12221
12357
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
12222
12358
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -14057,6 +14193,13 @@ var MaskGridDimsSchema = object({
14057
14193
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
14058
14194
  * this one field keeps the schema additive — a rule still declares exactly
14059
14195
  * one trigger.
14196
+ *
14197
+ * AUDIO rules add no member here, for the reason occupancy added none: the
14198
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
14199
+ * mirror.ts` fails the build on a member the app cannot render) and every
14200
+ * member costs a release train. A sustained-sound rule is therefore an
14201
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
14202
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
14060
14203
  */
14061
14204
  var NcDeliverySchema = _enum([
14062
14205
  "immediate",
@@ -14071,15 +14214,32 @@ var NcDeliverySchema = _enum([
14071
14214
  * depend on a provider's raw event name or payload shape.
14072
14215
  */
14073
14216
  var NcSystemEventKindSchema = _enum([
14074
- "camera-online",
14075
- "camera-offline",
14217
+ "device-online",
14218
+ "device-offline",
14219
+ "device-disabled",
14220
+ "device-enabled",
14076
14221
  "stream-online",
14077
14222
  "stream-offline",
14078
14223
  "node-online",
14079
14224
  "node-offline",
14080
14225
  "addon-update-available",
14081
- "server-update-available"
14226
+ "server-update-available",
14227
+ "alarm-triggered",
14228
+ "alarm-armed",
14229
+ "alarm-disarmed",
14230
+ "camera-online",
14231
+ "camera-offline",
14232
+ "camera-disabled",
14233
+ "camera-enabled"
14234
+ ]);
14235
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
14236
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
14237
+ "camera-online",
14238
+ "camera-offline",
14239
+ "camera-disabled",
14240
+ "camera-enabled"
14082
14241
  ]);
14242
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
14083
14243
  /**
14084
14244
  * One coherent system-event condition. `kinds` is the required opt-in safety
14085
14245
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -14088,6 +14248,18 @@ var NcSystemEventKindSchema = _enum([
14088
14248
  var NcSystemEventConditionSchema = object({
14089
14249
  kinds: array(NcSystemEventKindSchema).min(1),
14090
14250
  deviceIds: array(number().int()).min(1).optional(),
14251
+ /**
14252
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
14253
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
14254
+ * is what a liveness rule means when nobody said otherwise.
14255
+ *
14256
+ * This is where "only my cameras" is expressed, and it lives on the rule for
14257
+ * one reason: the intake cannot know which devices this household cares
14258
+ * about, and a producer-side filter is one no operator can change. Fails
14259
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
14260
+ * does not carry) matches no `deviceTypes` list.
14261
+ */
14262
+ deviceTypes: array(string().min(1)).min(1).optional(),
14091
14263
  nodeIds: array(string().min(1)).min(1).optional(),
14092
14264
  packageNames: array(string().min(1)).min(1).optional()
14093
14265
  });
@@ -14138,6 +14310,47 @@ var NcOccupancyConditionSchema = object({
14138
14310
  sustainSeconds: number().int().min(0).max(3600).default(15)
14139
14311
  });
14140
14312
  /**
14313
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14314
+ *
14315
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
14316
+ * reference notifier uses, so an operator moving between them re-uses what
14317
+ * they already know): a rule matches when, over a sampling window of
14318
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14319
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14320
+ *
14321
+ * - `dbThreshold` — its level is at or above this many dBFS (see
14322
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14323
+ * - `labels` — the classifier put at least one of these labels on it.
14324
+ *
14325
+ * Both are OPTIONAL and independent, which is the point of the shape: a
14326
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
14327
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14328
+ * is given** — a window in which every sample is trivially a hit would fire on
14329
+ * silence, so the engine refuses such a condition rather than notifying on
14330
+ * nothing (the schema cannot express "at least one of" without becoming a
14331
+ * ZodEffects the cap path would have to special-case).
14332
+ *
14333
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
14334
+ * must be FULL before it can match — a window that has been open for two
14335
+ * seconds of its ten is 100% of nothing, and firing on it would make
14336
+ * `samplingSeconds` decorative.
14337
+ *
14338
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14339
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
14340
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
14341
+ * an operator who typed `dog` mean the same thing.
14342
+ */
14343
+ var NcAudioConditionSchema = object({
14344
+ /** Audio macro labels; absent = any sound (level-only rule). */
14345
+ labels: array(string().min(1)).min(1).optional(),
14346
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14347
+ dbThreshold: number().min(-96).max(0).optional(),
14348
+ /** Percentage of the window's samples that must be hits (1–100). */
14349
+ hitPercent: number().int().min(1).max(100).default(60),
14350
+ /** Length of the sampling window in seconds. */
14351
+ samplingSeconds: number().int().min(1).max(300).default(10)
14352
+ });
14353
+ /**
14141
14354
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
14142
14355
  *
14143
14356
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -14410,7 +14623,33 @@ var NcConditionsSchema = object({
14410
14623
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
14411
14624
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
14412
14625
  */
14413
- occupancy: NcOccupancyConditionSchema.optional()
14626
+ occupancy: NcOccupancyConditionSchema.optional(),
14627
+ /**
14628
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
14629
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
14630
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
14631
+ * a window that is not full yet, neither filter given). See
14632
+ * {@link NcAudioCondition}.
14633
+ *
14634
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
14635
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
14636
+ * a detection, a track or a device event (the same fail-closed pairing
14637
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
14638
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
14639
+ * (an `immediate` rule naming an `audio-*` class, one notification per
14640
+ * classified sample) stays exactly as it was for rules that already use it.
14641
+ *
14642
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
14643
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
14644
+ * (`camstack/src/data/notification-center.ts`, guarded by
14645
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
14646
+ * condition fields it does not know when a rule is saved from the phone.
14647
+ * Publishing an editor for a condition the app cannot round-trip is how an
14648
+ * operator loses a rule's conditions by opening it — so the descriptor, the
14649
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
14650
+ * does an audio rule become authorable.
14651
+ */
14652
+ audio: NcAudioConditionSchema.optional()
14414
14653
  });
14415
14654
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
14416
14655
  var NcRuleTargetSchema = object({
@@ -14524,6 +14763,73 @@ var NcThrottleSchema = object({
14524
14763
  */
14525
14764
  granularity: NcThrottleGranularitySchema.optional()
14526
14765
  });
14766
+ /**
14767
+ * How long the confirm gate may hold ONE notification, and how big the picture
14768
+ * it judges may be.
14769
+ *
14770
+ * The clamp is the product decision, not a coincidence of the model: p50 was
14771
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
14772
+ * arrives after the visitor has gone is not a notification. 448 px was enough
14773
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
14774
+ * tokens for pixels the model pools away.
14775
+ */
14776
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
14777
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
14778
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
14779
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
14780
+ var NcConfirmExpectSchema = object({
14781
+ op: _enum([
14782
+ ">=",
14783
+ ">",
14784
+ "<=",
14785
+ "<",
14786
+ "=="
14787
+ ]),
14788
+ count: number().int().min(0).max(1e3)
14789
+ });
14790
+ /**
14791
+ * AI CONFIRM — a vision model looks at the picture this notification is about
14792
+ * to ship and says whether it agrees with the rule.
14793
+ *
14794
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
14795
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
14796
+ * on the operator's phone is not a verdict about this notification.
14797
+ *
14798
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
14799
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
14800
+ * the default and every fail-open is COUNTED, because a gate that always fails
14801
+ * open looks in the log exactly like a gate that works.
14802
+ *
14803
+ * Every field is `.optional()` rather than relied on as a Zod default at the
14804
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
14805
+ * production failures in one day), so the gate reads absent as the constant
14806
+ * above rather than trusting a parse it may never have seen.
14807
+ */
14808
+ var NcConfirmSchema = object({
14809
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
14810
+ * same thing, and both mean "deliver exactly as before". */
14811
+ enabled: boolean().default(false),
14812
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
14813
+ profileId: string().optional(),
14814
+ /**
14815
+ * The operator's question, in his own words. Absent = a question derived
14816
+ * from the rule (its class and its expectation).
14817
+ *
14818
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
14819
+ * banners, signage and plates as instructions if you let them reach the
14820
+ * prompt — proven live — so the authoritative contract stays in the system
14821
+ * turn and only rule-authored words land here.
14822
+ */
14823
+ prompt: string().max(1e3).optional(),
14824
+ /** Fire only when the model's count satisfies this. Absent = the model's
14825
+ * own boolean verdict decides. */
14826
+ expect: NcConfirmExpectSchema.optional(),
14827
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
14828
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
14829
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
14830
+ /** Longest edge the judged image is downscaled to before it is sent. */
14831
+ maxImagePx: number().int().min(64).max(2048).default(448)
14832
+ });
14527
14833
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
14528
14834
  var NcRuleInputSchema = object({
14529
14835
  name: string().min(1).max(200),
@@ -14584,7 +14890,13 @@ var NcRuleInputSchema = object({
14584
14890
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
14585
14891
  * shape as every other actuation.
14586
14892
  */
14587
- actions: NcRuleActionsSchema.optional()
14893
+ actions: NcRuleActionsSchema.optional(),
14894
+ /**
14895
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
14896
+ * a rule that predates the gate must keep delivering byte-for-byte as it
14897
+ * did, and absent is the only way to say that without a migration.
14898
+ */
14899
+ confirm: NcConfirmSchema.optional()
14588
14900
  });
14589
14901
  /**
14590
14902
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -14595,7 +14907,37 @@ var NcRuleInputSchema = object({
14595
14907
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
14596
14908
  * `updateRule` patch.
14597
14909
  */
14598
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
14910
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
14911
+ disabledTargetIds: array(string()).optional(),
14912
+ /**
14913
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
14914
+ *
14915
+ * It makes the key optional to SUPPLY; the parse still materialises the
14916
+ * default when the key is absent. And `NcRuleStore.update` merges with
14917
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
14918
+ * one — which made every partial edit destructive:
14919
+ *
14920
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
14921
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
14922
+ * setEnabled(ruleId, false) → conditions reset to `{}`
14923
+ *
14924
+ * A rule scoped to one camera and one zone silently became a rule that
14925
+ * matches EVERY event on EVERY camera, and lost its `media` policy
14926
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
14927
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
14928
+ * within a minute of a two-field patch.
14929
+ *
14930
+ * So every defaulted field is re-declared here WITHOUT its default. The
14931
+ * inner defaults still apply when the caller DOES send the key — `{}` for
14932
+ * conditions remains a real instruction ("clear them") — and only the
14933
+ * absent key is now genuinely absent.
14934
+ */
14935
+ enabled: boolean().optional(),
14936
+ conditions: NcConditionsSchema.optional(),
14937
+ media: NcMediaPolicySchema.optional(),
14938
+ throttle: NcThrottleSchema.optional(),
14939
+ priority: number().int().min(1).max(5).optional()
14940
+ });
14599
14941
  /** A persisted rule. */
14600
14942
  var NcRuleSchema = NcRuleInputSchema.extend({
14601
14943
  id: string(),
@@ -14896,6 +15238,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
14896
15238
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
14897
15239
  * copy would lie the first time a rule is disabled.
14898
15240
  */
15241
+ /**
15242
+ * Why a device a mode NAMES is nonetheless not armed by it.
15243
+ *
15244
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
15245
+ * per-camera notification switch the Notification Center already owns,
15246
+ * `detection-off` is the device's own detection binding being inactive, and
15247
+ * `offline` is the device manager's liveness. A fourth reason would mean a
15248
+ * fourth authority, and inventing one here is how a panel starts disagreeing
15249
+ * with the switches the operator actually used.
15250
+ */
15251
+ var NcAlarmSkipReasonSchema = _enum([
15252
+ "muted",
15253
+ "detection-off",
15254
+ "offline"
15255
+ ]);
15256
+ var NcAlarmSkippedDeviceSchema = object({
15257
+ deviceId: number().int(),
15258
+ reason: NcAlarmSkipReasonSchema
15259
+ });
14899
15260
  var NcAlarmModeCoverageSchema = object({
14900
15261
  mode: AlarmArmModeSchema,
14901
15262
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -14903,7 +15264,18 @@ var NcAlarmModeCoverageSchema = object({
14903
15264
  /** At least one covering rule has no device scope, so the mode covers all. */
14904
15265
  allDevices: boolean(),
14905
15266
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
14906
- deviceIds: array(number().int())
15267
+ deviceIds: array(number().int()),
15268
+ /**
15269
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
15270
+ * excludes it.
15271
+ *
15272
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
15273
+ * twelve makes it false in exactly the way nobody notices until an incident.
15274
+ * Defaulted to `[]` so a coverage answer computed before this field existed
15275
+ * still parses as "nothing known to be skipped" rather than failing the whole
15276
+ * alarm tab.
15277
+ */
15278
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
14907
15279
  });
14908
15280
  var NcAlarmConfigSchema = object({
14909
15281
  /**
@@ -16266,13 +16638,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
16266
16638
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
16267
16639
  kind: "mutation",
16268
16640
  auth: "admin"
16269
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
16641
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
16270
16642
  kind: "mutation",
16271
16643
  auth: "admin"
16272
- }), method(object({}), array(RelocateJobSchema).readonly(), {
16273
- kind: "query",
16644
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
16645
+ kind: "mutation",
16274
16646
  auth: "admin"
16275
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16647
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
16648
+ kind: "mutation",
16649
+ auth: "admin"
16650
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
16651
+ kind: "mutation",
16652
+ auth: "admin"
16653
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
16276
16654
  kind: "mutation",
16277
16655
  auth: "admin"
16278
16656
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -17729,9 +18107,16 @@ var CameraStatusSchema = object({
17729
18107
  audio: CameraAudioStatusSchema.nullable(),
17730
18108
  recording: CameraRecordingStatusSchema.nullable(),
17731
18109
  /**
17732
- * Per-camera function switches an OPERATOR has turned off
18110
+ * Per-camera functions an OPERATOR has turned off
17733
18111
  * ([D61](../../../../docs/decisions/adr-0067.md)).
17734
18112
  *
18113
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
18114
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
18115
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
18116
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
18117
+ * The badge outlives the control panel: the panel was a convenience, this is
18118
+ * the difference between a camera being off and a camera being dead.
18119
+ *
17735
18120
  * This is the difference between DISABLED and BROKEN. A camera whose
17736
18121
  * `detection` block reports zero fps and whose `switchedOff` contains
17737
18122
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -17802,7 +18187,13 @@ var NodeInferenceDevicesSchema = object({
17802
18187
  reachable: boolean(),
17803
18188
  devices: array(NodeInferenceDeviceSchema).readonly()
17804
18189
  });
17805
- method(object({
18190
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
18191
+ kind: "mutation",
18192
+ auth: "admin"
18193
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
18194
+ kind: "mutation",
18195
+ auth: "admin"
18196
+ }), method(object({
17806
18197
  deviceId: number(),
17807
18198
  agentNodeId: string()
17808
18199
  }), object({ success: literal(true) }), {
@@ -18476,6 +18867,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
18476
18867
  locationId: string(),
18477
18868
  targetBytes: number().int().positive()
18478
18869
  }), EvictResultSchema, { kind: "mutation" });
18870
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
18871
+ kind: "mutation",
18872
+ auth: "admin"
18873
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
18874
+ kind: "mutation",
18875
+ auth: "admin"
18876
+ });
18479
18877
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
18480
18878
  providerId: string().min(1),
18481
18879
  displayName: string().min(1),
@@ -18579,6 +18977,28 @@ var TerminalProfileInfoSchema = object({
18579
18977
  label: string(),
18580
18978
  description: string().optional()
18581
18979
  });
18980
+ /**
18981
+ * A durable operator-created Terminal instance. Profiles are templates; only
18982
+ * an instance declares a camera.
18983
+ */
18984
+ var TerminalInstanceInfoSchema = object({
18985
+ instanceId: string(),
18986
+ cameraStableId: string(),
18987
+ nodeId: string(),
18988
+ profileId: string(),
18989
+ profileLabel: string(),
18990
+ name: string(),
18991
+ enabled: boolean()
18992
+ });
18993
+ var TerminalLegacyCameraSchema = object({
18994
+ stableId: string(),
18995
+ nodeId: string(),
18996
+ profileId: string(),
18997
+ profileLabel: string(),
18998
+ name: string(),
18999
+ /** Only legacy monitor cameras can retain their historic stable identity. */
19000
+ adoptable: boolean()
19001
+ });
18582
19002
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
18583
19003
  seq: number().int().positive(),
18584
19004
  kind: literal("data"),
@@ -18595,7 +19015,29 @@ var TerminalOutputBatchSchema = object({
18595
19015
  snapshot: string().optional(),
18596
19016
  events: array(TerminalOutputEventSchema).readonly()
18597
19017
  });
18598
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
19018
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
19019
+ targetNodeId: string().min(1),
19020
+ profileId: string().min(1),
19021
+ name: string().trim().min(1).max(160).optional()
19022
+ }), TerminalInstanceInfoSchema, {
19023
+ kind: "mutation",
19024
+ auth: "admin"
19025
+ }), method(object({ instanceId: string().min(1) }), _void(), {
19026
+ kind: "mutation",
19027
+ auth: "admin"
19028
+ }), method(object({
19029
+ instanceId: string().min(1),
19030
+ enabled: boolean()
19031
+ }), TerminalInstanceInfoSchema, {
19032
+ kind: "mutation",
19033
+ auth: "admin"
19034
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
19035
+ stableId: string().min(1),
19036
+ name: string().trim().min(1).max(160).optional()
19037
+ }), TerminalInstanceInfoSchema, {
19038
+ kind: "mutation",
19039
+ auth: "admin"
19040
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
18599
19041
  profileId: string(),
18600
19042
  cols: number().int().positive(),
18601
19043
  rows: number().int().positive()
@@ -18612,7 +19054,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
18612
19054
  }), method(object({
18613
19055
  sessionId: string(),
18614
19056
  afterSeq: number().int().nonnegative(),
18615
- waitMs: number().int().min(0).max(2e3).default(0)
19057
+ waitMs: number().int().min(0).max(2e3).default(0),
19058
+ /**
19059
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
19060
+ * browser's initial repaint remains immediate; the camera snapshot
19061
+ * relay uses it to avoid encoding a blank startup frame.
19062
+ */
19063
+ waitForOutput: boolean().optional()
18616
19064
  }), TerminalOutputBatchSchema, {
18617
19065
  kind: "mutation",
18618
19066
  auth: "admin",
@@ -21110,6 +21558,7 @@ var FaceInfoSchema = object({
21110
21558
  var FaceFilterEnum = _enum([
21111
21559
  "unassigned",
21112
21560
  "recognized",
21561
+ "identified",
21113
21562
  "all"
21114
21563
  ]);
21115
21564
  var MediaFileLiteSchema$1 = object({
@@ -21138,6 +21587,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string(
21138
21587
  kind: "mutation",
21139
21588
  auth: "admin"
21140
21589
  }), method(object({
21590
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
21591
+ deviceId: number().int().optional(),
21141
21592
  limit: number().int().positive().optional(),
21142
21593
  filter: FaceFilterEnum.optional(),
21143
21594
  /**
@@ -23367,6 +23818,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
23367
23818
  capName: string().min(1).max(64),
23368
23819
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
23369
23820
  valuePath: string().min(1).max(64)
23821
+ }),
23822
+ object({
23823
+ kind: literal("latest-recognition"),
23824
+ recognition: _enum(["person", "plate"])
23370
23825
  })
23371
23826
  ]);
23372
23827
  var OsdSlotBindingSchema = object({
@@ -23472,6 +23927,15 @@ method(object({ deviceId: number().int() }), object({
23472
23927
  }), object({ success: literal(true) }), {
23473
23928
  kind: "mutation",
23474
23929
  auth: "admin"
23930
+ }), method(object({
23931
+ sourceDeviceId: number().int(),
23932
+ targetDeviceId: number().int()
23933
+ }), object({
23934
+ copied: number().int().nonnegative(),
23935
+ skipped: number().int().nonnegative()
23936
+ }), {
23937
+ kind: "mutation",
23938
+ auth: "admin"
23475
23939
  }), method(object({
23476
23940
  deviceId: number().int(),
23477
23941
  slotId: string().min(1),
@@ -24394,7 +24858,19 @@ var RecordingManifestSchema = object({
24394
24858
  * profiles/subtrees/locations on this node). */
24395
24859
  var RecordingDeviceUsageSchema = object({
24396
24860
  deviceId: number(),
24397
- usedBytes: number()
24861
+ usedBytes: number(),
24862
+ /**
24863
+ * Start of this camera's OLDEST indexed segment, across every profile and
24864
+ * location — the "Oldest footage" column in Recordings → Storage, and the
24865
+ * only honest answer to "is retention actually holding?" per camera.
24866
+ *
24867
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
24868
+ * predates this field omits it entirely, and a hub whose types carry the
24869
+ * field must keep validating that older provider's payload: the framework
24870
+ * (types) and the addon ship on different trains, and the addon is usually
24871
+ * the later of the two.
24872
+ */
24873
+ oldestMs: number().nullable().optional()
24398
24874
  });
24399
24875
  /** Recording storage usage + capacity for one storage location. */
24400
24876
  var RecordingLocationUsageSchema = object({
@@ -24422,6 +24898,57 @@ var RecordingStorageUsageSchema = object({
24422
24898
  locations: array(RecordingLocationUsageSchema)
24423
24899
  });
24424
24900
  /**
24901
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
24902
+ *
24903
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
24904
+ * is the operator asking for the EXISTING archive to be brought into line with
24905
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
24906
+ * location, run FIFO behind the single-flight mover.
24907
+ *
24908
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
24909
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
24910
+ * (empty on the plan).
24911
+ */
24912
+ var RecordingRebalanceMoveSchema = object({
24913
+ deviceId: number(),
24914
+ profile: string(),
24915
+ fromLocationId: string(),
24916
+ toLocationId: string(),
24917
+ bytes: number(),
24918
+ files: number().int()
24919
+ });
24920
+ /** Why a pile that is out of place is staying there. Every refusal is
24921
+ * reported: a rebalance that silently drops a camera reads exactly like one
24922
+ * that had nothing to do. */
24923
+ var RecordingRebalanceSkipReasonSchema = _enum([
24924
+ "unassigned",
24925
+ "target-not-writable",
24926
+ "below-threshold",
24927
+ "no-headroom"
24928
+ ]);
24929
+ var RecordingRebalanceSkipSchema = object({
24930
+ deviceId: number(),
24931
+ profile: string(),
24932
+ fromLocationId: string(),
24933
+ /** The location the plan wants; null when the camera has no assignment. */
24934
+ toLocationId: string().nullable(),
24935
+ bytes: number(),
24936
+ reason: RecordingRebalanceSkipReasonSchema
24937
+ });
24938
+ var RecordingRebalancePlanSchema = object({
24939
+ moves: array(RecordingRebalanceMoveSchema),
24940
+ skipped: array(RecordingRebalanceSkipSchema),
24941
+ bytesToMove: number(),
24942
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
24943
+ jobIds: array(string())
24944
+ });
24945
+ var RecordingRebalanceInputSchema = object({
24946
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
24947
+ throttleMbps: number().min(1).max(1e3).optional(),
24948
+ /** Ignore piles smaller than this (default 1 GB). */
24949
+ minMoveGb: number().min(0).optional()
24950
+ });
24951
+ /**
24425
24952
  * Result of locating footage at a wall-clock instant for one device/profile.
24426
24953
  * `segment` carries the covering segment's window; `gap` reports the forward
24427
24954
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -24569,6 +25096,21 @@ method(object({
24569
25096
  }), {
24570
25097
  kind: "mutation",
24571
25098
  auth: "admin"
25099
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
25100
+ kind: "mutation",
25101
+ auth: "admin"
25102
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
25103
+ kind: "mutation",
25104
+ auth: "admin"
25105
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
25106
+ kind: "mutation",
25107
+ auth: "admin"
25108
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
25109
+ kind: "mutation",
25110
+ auth: "admin"
25111
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
25112
+ kind: "mutation",
25113
+ auth: "admin"
24572
25114
  }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
24573
25115
  kind: "mutation",
24574
25116
  auth: "admin"
@@ -24578,9 +25120,15 @@ method(object({
24578
25120
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
24579
25121
  kind: "mutation",
24580
25122
  auth: "admin"
25123
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25124
+ kind: "query",
25125
+ auth: "admin"
25126
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25127
+ kind: "mutation",
25128
+ auth: "admin"
24581
25129
  });
24582
25130
  /**
24583
- * `recordingExport` cap — render a footage time range into a single downloadable
25131
+ * `recording-export` cap — render a footage time range into a single downloadable
24584
25132
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
24585
25133
  * bounded lifetime with a durable history, auto-expiry, and optional
24586
25134
  * delete-after-download.
@@ -24595,10 +25143,42 @@ method(object({
24595
25143
  */
24596
25144
  /** Playback-speed multiplier for the render (1 = realtime). */
24597
25145
  var ExportSpeedSchema = number().min(.25).max(32);
25146
+ /**
25147
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25148
+ *
25149
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
25150
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25151
+ * playlist. Handing it absolute epochs would make every call site responsible
25152
+ * for the same subtraction, and the one that forgot would emit a filter that
25153
+ * selects nothing — silently, as a uniform timelapse.
25154
+ */
25155
+ var ExportDenseRangeSchema = object({
25156
+ fromSec: number().nonnegative(),
25157
+ toSec: number().nonnegative()
25158
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
25159
+ /**
25160
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
25161
+ * listed ranges and at the base `everyMs` everywhere else.
25162
+ *
25163
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
25164
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
25165
+ */
25166
+ var ExportDenseSchema = object({
25167
+ everyMs: number().int().positive(),
25168
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
25169
+ });
24598
25170
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
24599
25171
  var ExportTimelapseSchema = object({
24600
25172
  everyMs: number().int().positive(),
24601
- outputFps: number().int().min(1).max(60).optional()
25173
+ outputFps: number().int().min(1).max(60).optional(),
25174
+ /** Optional second, FASTER rate over the intervals that matter. */
25175
+ dense: ExportDenseSchema.optional()
25176
+ }).superRefine((v, ctx) => {
25177
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
25178
+ code: ZodIssueCode$1.custom,
25179
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
25180
+ path: ["dense", "everyMs"]
25181
+ });
24602
25182
  });
24603
25183
  /**
24604
25184
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -24656,6 +25236,19 @@ var ExportDownloadSchema = object({
24656
25236
  url: string(),
24657
25237
  endpoints: array(string())
24658
25238
  });
25239
+ /**
25240
+ * A finished export's bytes, inline.
25241
+ *
25242
+ * `bytes` is the DECODED length — the number the caller bounds and logs
25243
+ * against, so nobody has to infer it from the base64 length.
25244
+ */
25245
+ var ExportBytesSchema = object({
25246
+ base64: string(),
25247
+ contentType: string(),
25248
+ /** Suggested filename, extension included. */
25249
+ name: string(),
25250
+ bytes: number().int().nonnegative()
25251
+ });
24659
25252
  method(object({
24660
25253
  deviceId: number(),
24661
25254
  profile: string(),
@@ -24680,6 +25273,9 @@ method(object({
24680
25273
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
24681
25274
  kind: "query",
24682
25275
  auth: "protected"
25276
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
25277
+ kind: "query",
25278
+ auth: "protected"
24683
25279
  });
24684
25280
  /**
24685
25281
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -30181,6 +30777,12 @@ Object.freeze({
30181
30777
  addonId: null,
30182
30778
  access: "delete"
30183
30779
  },
30780
+ "osdManager.copyDeviceConfiguration": {
30781
+ capName: "osd-manager",
30782
+ capScope: "system",
30783
+ addonId: null,
30784
+ access: "create"
30785
+ },
30184
30786
  "osdManager.getConditionSupport": {
30185
30787
  capName: "osd-manager",
30186
30788
  capScope: "system",
@@ -30277,7 +30879,7 @@ Object.freeze({
30277
30879
  addonId: null,
30278
30880
  access: "create"
30279
30881
  },
30280
- "pipelineAnalytics.cancelMediaRelocate": {
30882
+ "pipelineAnalytics.cancelStorageMigrationMove": {
30281
30883
  capName: "pipeline-analytics",
30282
30884
  capScope: "device",
30283
30885
  addonId: null,
@@ -30349,12 +30951,6 @@ Object.freeze({
30349
30951
  addonId: null,
30350
30952
  access: "view"
30351
30953
  },
30352
- "pipelineAnalytics.getMediaRelocateStatus": {
30353
- capName: "pipeline-analytics",
30354
- capScope: "device",
30355
- addonId: null,
30356
- access: "view"
30357
- },
30358
30954
  "pipelineAnalytics.getMotionEvents": {
30359
30955
  capName: "pipeline-analytics",
30360
30956
  capScope: "device",
@@ -30391,6 +30987,12 @@ Object.freeze({
30391
30987
  addonId: null,
30392
30988
  access: "view"
30393
30989
  },
30990
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
30991
+ capName: "pipeline-analytics",
30992
+ capScope: "device",
30993
+ addonId: null,
30994
+ access: "view"
30995
+ },
30394
30996
  "pipelineAnalytics.getTrack": {
30395
30997
  capName: "pipeline-analytics",
30396
30998
  capScope: "device",
@@ -30469,6 +31071,12 @@ Object.freeze({
30469
31071
  addonId: null,
30470
31072
  access: "view"
30471
31073
  },
31074
+ "pipelineAnalytics.pauseForStorageMigration": {
31075
+ capName: "pipeline-analytics",
31076
+ capScope: "device",
31077
+ addonId: null,
31078
+ access: "create"
31079
+ },
30472
31080
  "pipelineAnalytics.proposeRetrainAnnotations": {
30473
31081
  capName: "pipeline-analytics",
30474
31082
  capScope: "device",
@@ -30499,7 +31107,7 @@ Object.freeze({
30499
31107
  addonId: null,
30500
31108
  access: "create"
30501
31109
  },
30502
- "pipelineAnalytics.relocateMedia": {
31110
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
30503
31111
  capName: "pipeline-analytics",
30504
31112
  capScope: "device",
30505
31113
  addonId: null,
@@ -30511,6 +31119,12 @@ Object.freeze({
30511
31119
  addonId: null,
30512
31120
  access: "create"
30513
31121
  },
31122
+ "pipelineAnalytics.resumeForStorageMigration": {
31123
+ capName: "pipeline-analytics",
31124
+ capScope: "device",
31125
+ addonId: null,
31126
+ access: "create"
31127
+ },
30514
31128
  "pipelineAnalytics.saveRetrainAnnotations": {
30515
31129
  capName: "pipeline-analytics",
30516
31130
  capScope: "device",
@@ -30535,6 +31149,12 @@ Object.freeze({
30535
31149
  addonId: null,
30536
31150
  access: "create"
30537
31151
  },
31152
+ "pipelineAnalytics.startStorageMigrationMove": {
31153
+ capName: "pipeline-analytics",
31154
+ capScope: "device",
31155
+ addonId: null,
31156
+ access: "create"
31157
+ },
30538
31158
  "pipelineAnalytics.wipeAllAnalytics": {
30539
31159
  capName: "pipeline-analytics",
30540
31160
  capScope: "device",
@@ -30901,6 +31521,12 @@ Object.freeze({
30901
31521
  addonId: null,
30902
31522
  access: "view"
30903
31523
  },
31524
+ "pipelineOrchestrator.pauseForStorageMigration": {
31525
+ capName: "pipeline-orchestrator",
31526
+ capScope: "system",
31527
+ addonId: null,
31528
+ access: "create"
31529
+ },
30904
31530
  "pipelineOrchestrator.rebalance": {
30905
31531
  capName: "pipeline-orchestrator",
30906
31532
  capScope: "system",
@@ -30925,6 +31551,12 @@ Object.freeze({
30925
31551
  addonId: null,
30926
31552
  access: "view"
30927
31553
  },
31554
+ "pipelineOrchestrator.resumeForStorageMigration": {
31555
+ capName: "pipeline-orchestrator",
31556
+ capScope: "system",
31557
+ addonId: null,
31558
+ access: "create"
31559
+ },
30928
31560
  "pipelineOrchestrator.saveTemplate": {
30929
31561
  capName: "pipeline-orchestrator",
30930
31562
  capScope: "system",
@@ -31321,7 +31953,13 @@ Object.freeze({
31321
31953
  addonId: null,
31322
31954
  access: "create"
31323
31955
  },
31324
- "recording.cancelRelocate": {
31956
+ "recording.cancelRelocateJob": {
31957
+ capName: "recording",
31958
+ capScope: "system",
31959
+ addonId: null,
31960
+ access: "create"
31961
+ },
31962
+ "recording.cancelStorageMigrationMove": {
31325
31963
  capName: "recording",
31326
31964
  capScope: "system",
31327
31965
  addonId: null,
@@ -31357,7 +31995,7 @@ Object.freeze({
31357
31995
  addonId: null,
31358
31996
  access: "view"
31359
31997
  },
31360
- "recording.getRelocateStatus": {
31998
+ "recording.getStorageMigrationMoveStatus": {
31361
31999
  capName: "recording",
31362
32000
  capScope: "system",
31363
32001
  addonId: null,
@@ -31375,12 +32013,30 @@ Object.freeze({
31375
32013
  addonId: null,
31376
32014
  access: "view"
31377
32015
  },
32016
+ "recording.listRelocateJobs": {
32017
+ capName: "recording",
32018
+ capScope: "system",
32019
+ addonId: null,
32020
+ access: "view"
32021
+ },
31378
32022
  "recording.locateSegment": {
31379
32023
  capName: "recording",
31380
32024
  capScope: "system",
31381
32025
  addonId: null,
31382
32026
  access: "view"
31383
32027
  },
32028
+ "recording.pauseForStorageMigration": {
32029
+ capName: "recording",
32030
+ capScope: "system",
32031
+ addonId: null,
32032
+ access: "create"
32033
+ },
32034
+ "recording.planStorageRebalance": {
32035
+ capName: "recording",
32036
+ capScope: "system",
32037
+ addonId: null,
32038
+ access: "view"
32039
+ },
31384
32040
  "recording.pruneFootage": {
31385
32041
  capName: "recording",
31386
32042
  capScope: "system",
@@ -31399,6 +32055,12 @@ Object.freeze({
31399
32055
  addonId: null,
31400
32056
  access: "view"
31401
32057
  },
32058
+ "recording.refreshStorageLocationsForMigration": {
32059
+ capName: "recording",
32060
+ capScope: "system",
32061
+ addonId: null,
32062
+ access: "create"
32063
+ },
31402
32064
  "recording.relocateFootage": {
31403
32065
  capName: "recording",
31404
32066
  capScope: "system",
@@ -31423,44 +32085,68 @@ Object.freeze({
31423
32085
  addonId: null,
31424
32086
  access: "create"
31425
32087
  },
32088
+ "recording.resumeForStorageMigration": {
32089
+ capName: "recording",
32090
+ capScope: "system",
32091
+ addonId: null,
32092
+ access: "create"
32093
+ },
31426
32094
  "recording.setDeviceConfig": {
31427
32095
  capName: "recording",
31428
32096
  capScope: "system",
31429
32097
  addonId: null,
31430
32098
  access: "create"
31431
32099
  },
32100
+ "recording.startStorageMigrationMove": {
32101
+ capName: "recording",
32102
+ capScope: "system",
32103
+ addonId: null,
32104
+ access: "create"
32105
+ },
32106
+ "recording.startStorageRebalance": {
32107
+ capName: "recording",
32108
+ capScope: "system",
32109
+ addonId: null,
32110
+ access: "create"
32111
+ },
31432
32112
  "recordingExport.cancelExport": {
31433
- capName: "recordingExport",
32113
+ capName: "recording-export",
31434
32114
  capScope: "system",
31435
32115
  addonId: null,
31436
32116
  access: "create"
31437
32117
  },
31438
32118
  "recordingExport.createExport": {
31439
- capName: "recordingExport",
32119
+ capName: "recording-export",
31440
32120
  capScope: "system",
31441
32121
  addonId: null,
31442
32122
  access: "create"
31443
32123
  },
31444
32124
  "recordingExport.deleteExport": {
31445
- capName: "recordingExport",
32125
+ capName: "recording-export",
31446
32126
  capScope: "system",
31447
32127
  addonId: null,
31448
32128
  access: "delete"
31449
32129
  },
31450
32130
  "recordingExport.getDownloadUrl": {
31451
- capName: "recordingExport",
32131
+ capName: "recording-export",
31452
32132
  capScope: "system",
31453
32133
  addonId: null,
31454
32134
  access: "view"
31455
32135
  },
31456
32136
  "recordingExport.getExport": {
31457
- capName: "recordingExport",
32137
+ capName: "recording-export",
31458
32138
  capScope: "system",
31459
32139
  addonId: null,
31460
32140
  access: "view"
31461
32141
  },
31462
32142
  "recordingExport.listExports": {
31463
- capName: "recordingExport",
32143
+ capName: "recording-export",
32144
+ capScope: "system",
32145
+ addonId: null,
32146
+ access: "view"
32147
+ },
32148
+ "recordingExport.readExportBytes": {
32149
+ capName: "recording-export",
31464
32150
  capScope: "system",
31465
32151
  addonId: null,
31466
32152
  access: "view"
@@ -31819,6 +32505,30 @@ Object.freeze({
31819
32505
  addonId: null,
31820
32506
  access: "view"
31821
32507
  },
32508
+ "storageMigration.cancel": {
32509
+ capName: "storage-migration",
32510
+ capScope: "system",
32511
+ addonId: null,
32512
+ access: "create"
32513
+ },
32514
+ "storageMigration.plan": {
32515
+ capName: "storage-migration",
32516
+ capScope: "system",
32517
+ addonId: null,
32518
+ access: "view"
32519
+ },
32520
+ "storageMigration.start": {
32521
+ capName: "storage-migration",
32522
+ capScope: "system",
32523
+ addonId: null,
32524
+ access: "create"
32525
+ },
32526
+ "storageMigration.status": {
32527
+ capName: "storage-migration",
32528
+ capScope: "system",
32529
+ addonId: null,
32530
+ access: "view"
32531
+ },
31822
32532
  "storageProvider.abortUpload": {
31823
32533
  capName: "storage-provider",
31824
32534
  capScope: "system",
@@ -32197,12 +32907,42 @@ Object.freeze({
32197
32907
  addonId: null,
32198
32908
  access: "create"
32199
32909
  },
32910
+ "terminalSession.adoptLegacyMonitor": {
32911
+ capName: "terminal-session",
32912
+ capScope: "system",
32913
+ addonId: null,
32914
+ access: "create"
32915
+ },
32200
32916
  "terminalSession.close": {
32201
32917
  capName: "terminal-session",
32202
32918
  capScope: "system",
32203
32919
  addonId: null,
32204
32920
  access: "create"
32205
32921
  },
32922
+ "terminalSession.createInstance": {
32923
+ capName: "terminal-session",
32924
+ capScope: "system",
32925
+ addonId: null,
32926
+ access: "create"
32927
+ },
32928
+ "terminalSession.deleteInstance": {
32929
+ capName: "terminal-session",
32930
+ capScope: "system",
32931
+ addonId: null,
32932
+ access: "delete"
32933
+ },
32934
+ "terminalSession.listInstances": {
32935
+ capName: "terminal-session",
32936
+ capScope: "system",
32937
+ addonId: null,
32938
+ access: "view"
32939
+ },
32940
+ "terminalSession.listLegacyCameras": {
32941
+ capName: "terminal-session",
32942
+ capScope: "system",
32943
+ addonId: null,
32944
+ access: "view"
32945
+ },
32206
32946
  "terminalSession.listProfiles": {
32207
32947
  capName: "terminal-session",
32208
32948
  capScope: "system",
@@ -32233,6 +32973,12 @@ Object.freeze({
32233
32973
  addonId: null,
32234
32974
  access: "create"
32235
32975
  },
32976
+ "terminalSession.setInstanceEnabled": {
32977
+ capName: "terminal-session",
32978
+ capScope: "system",
32979
+ addonId: null,
32980
+ access: "create"
32981
+ },
32236
32982
  "terminalSession.writeInput": {
32237
32983
  capName: "terminal-session",
32238
32984
  capScope: "system",
@@ -32777,6 +33523,104 @@ var FramerateField = number().int().min(1).max(60);
32777
33523
  var TargetsField = array(NcRuleTargetSchema).min(1);
32778
33524
  var PriorityField = number().int().min(1).max(5);
32779
33525
  /**
33526
+ * Explicit override of the DENSE sampling cadence, seconds.
33527
+ *
33528
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
33529
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
33530
+ * made that same base 3 s and rendered a person pass as two frames.)
33531
+ *
33532
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
33533
+ * `denseCadenceSec` and played at `framerate` occupies
33534
+ *
33535
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
33536
+ *
33537
+ * 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.
33538
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
33539
+ * and therefore the length of a quiet night, does not move.
33540
+ *
33541
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
33542
+ * the recording has them returns the same frames, requested twice. Must be
33543
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
33544
+ * a uniform video the operator believes is two-rate — and upsert refuses it
33545
+ * rather than letting the export cap reject the render hours after the window.
33546
+ */
33547
+ var DenseCadenceSecField = number().min(.1).max(3600);
33548
+ /**
33549
+ * Minimum seconds of OUTPUT video each detection range must occupy.
33550
+ *
33551
+ * The operator-facing form of the arithmetic above: instead of solving for a
33552
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
33553
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
33554
+ * that range every ~583 ms.
33555
+ *
33556
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
33557
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
33558
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
33559
+ * ranges are sampled denser than they need. Per-range cadences require a cap
33560
+ * schema change and are the tracked follow-up.
33561
+ *
33562
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
33563
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
33564
+ * by real footage, never met by duplicating frames into motion that never
33565
+ * happened.
33566
+ */
33567
+ var MinDwellSecField = number().min(0).max(60);
33568
+ /**
33569
+ * Caption burned into the notification's preview frame.
33570
+ *
33571
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
33572
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
33573
+ * templating dialect for one field would be a second thing to explain.
33574
+ *
33575
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
33576
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
33577
+ * the reason this is not `.min(1)`.
33578
+ */
33579
+ var PreviewTextField = string().max(200);
33580
+ /**
33581
+ * Whether the notification's preview is a STILL or a short animation.
33582
+ *
33583
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
33584
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
33585
+ * night reads better as three seconds of motion than as one frame of it. Both
33586
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
33587
+ * simply applies it to a dozen frames sampled across the render and assembles
33588
+ * them.
33589
+ *
33590
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
33591
+ * seeks and a palette pass, and no rule that never asked for one should start
33592
+ * paying that on the deploy that shipped it.
33593
+ *
33594
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
33595
+ */
33596
+ var PreviewModeField = _enum(["image", "gif"]);
33597
+ /**
33598
+ * Which detection classes the notification reports counts for.
33599
+ *
33600
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
33601
+ * plan — no second query — aggregated per class. Absent or empty means "every
33602
+ * class the window actually contained", which is what an operator who never
33603
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
33604
+ * counts cars all night).
33605
+ *
33606
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
33607
+ * …). An unknown name simply never matches and reports nothing — it is not an
33608
+ * error, because a rule may legitimately name a class this camera's model does
33609
+ * not emit.
33610
+ *
33611
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
33612
+ * - `{{detections}}` — total over the reported classes
33613
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
33614
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
33615
+ * one per class, `count_` + the class name
33616
+ *
33617
+ * With NO custom body template the summary is appended to the derived body, and
33618
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
33619
+ * reads. With a custom template the operator owns every word — nothing is
33620
+ * appended, so `{{detectionSummary}}` is how he asks for it.
33621
+ */
33622
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
33623
+ /**
32780
33624
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
32781
33625
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
32782
33626
  * here (see the ownership note above).
@@ -32796,9 +33640,30 @@ var TimelapseRuleInputSchema = object({
32796
33640
  cadenceSec: CadenceSecField.default(15),
32797
33641
  /** Output frames per second of the assembled mp4 (predecessor parity). */
32798
33642
  framerate: FramerateField.default(10),
33643
+ /**
33644
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
33645
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
33646
+ * field gets.
33647
+ */
33648
+ denseCadenceSec: DenseCadenceSecField.optional(),
33649
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
33650
+ minDwellSec: MinDwellSecField.optional(),
32799
33651
  /** `notification-output` targets the finished video/thumbnail is sent to. */
32800
33652
  targets: TargetsField,
32801
33653
  template: TimelapseTemplateSchema.optional(),
33654
+ /**
33655
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
33656
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
33657
+ *
33658
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
33659
+ * the notification's title/body, and clearing it (`template: null`) must not
33660
+ * silently clear the caption too.
33661
+ */
33662
+ previewText: PreviewTextField.optional(),
33663
+ /** Still or animation — see {@link PreviewModeField}. */
33664
+ previewMode: PreviewModeField.default("image"),
33665
+ /** Classes the notification counts — see {@link ReportClassesField}. */
33666
+ reportClasses: ReportClassesField.optional(),
32802
33667
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
32803
33668
  priority: PriorityField.default(3)
32804
33669
  });
@@ -32809,8 +33674,13 @@ object({
32809
33674
  schedule: NcScheduleSchema.optional(),
32810
33675
  cadenceSec: CadenceSecField.optional(),
32811
33676
  framerate: FramerateField.optional(),
33677
+ denseCadenceSec: DenseCadenceSecField.optional(),
33678
+ minDwellSec: MinDwellSecField.optional(),
32812
33679
  targets: TargetsField.optional(),
32813
33680
  template: TimelapseTemplateSchema.nullable().optional(),
33681
+ previewText: PreviewTextField.optional(),
33682
+ previewMode: PreviewModeField.optional(),
33683
+ reportClasses: ReportClassesField.optional(),
32814
33684
  priority: PriorityField.optional()
32815
33685
  });
32816
33686
  TimelapseRuleInputSchema.extend({
@@ -32822,10 +33692,28 @@ TimelapseRuleInputSchema.extend({
32822
33692
  */
32823
33693
  ownerUserId: string().optional(),
32824
33694
  /**
32825
- * Epoch-ms of the last successful generation the 1-hour re-generation
32826
- * guard's durable state (predecessor parity). Absent = never generated.
33695
+ * Epoch-ms of the NEWEST successful generation across every camera of this
33696
+ * rule. What a UI shows, and the compatibility floor for
33697
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
32827
33698
  */
32828
33699
  lastGeneratedAt: number().optional(),
33700
+ /**
33701
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
33702
+ * re-generation guard's real durable state.
33703
+ *
33704
+ * One rule covers several cameras and each renders its own video, so a rule
33705
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
33706
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
33707
+ * already done — and B's night is gone for good, because the window will not
33708
+ * come back.
33709
+ *
33710
+ * ADDITIVE, so the migration is free: a row written before this field simply
33711
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
33712
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
33713
+ * "never generated" would re-render and re-notify every camera of every rule
33714
+ * once, on the deploy that shipped the map.
33715
+ */
33716
+ generatedByDevice: record(string(), number()).optional(),
32829
33717
  /** userId of the caller who created the rule (server-stamped). */
32830
33718
  createdBy: string(),
32831
33719
  createdAt: number(),