@camstack/addon-provider-tuya 0.2.12 → 0.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +936 -48
  2. package/dist/addon.mjs +936 -48
  3. package/package.json +1 -1
package/dist/addon.mjs CHANGED
@@ -8038,8 +8038,31 @@ var AdoptionJobSchema = object({
8038
8038
  error: string().nullable()
8039
8039
  });
8040
8040
  /**
8041
- * Per-camera FUNCTION SWITCHES — the one coherent on/off surface over the
8042
- * pipeline functions an operator thinks in terms of.
8041
+ * Per-camera FUNCTION SWITCHES.
8042
+ *
8043
+ * ## The aggregate group is being withdrawn — the BADGE is not (D113)
8044
+ *
8045
+ * This file shipped as "the one coherent on/off surface over the pipeline
8046
+ * functions an operator thinks in terms of". The operator's verdict on
8047
+ * 2026-08-12 was that the coherent surface bought complexity and no clarity:
8048
+ * every function already had a settings page of its own, and a second place to
8049
+ * turn it off is a second place to look. Each switch is going back to its own
8050
+ * component's original options — detection to the detection-pipeline wrapper
8051
+ * binding, audio analysis to its own, recording to `RecordingConfig.enabled`
8052
+ * (which was always first-class; the switch was a veneer over
8053
+ * `recording.setDeviceConfig`), notifications to a notification-center
8054
+ * per-device setting, the two camera planes to their own components.
8055
+ *
8056
+ * What survives is {@link composeSwitchedOff}: `CameraStatus.switchedOff`, the
8057
+ * thing that lets a status surface say DISABLED instead of BROKEN, recomposed
8058
+ * straight from the authorities with no group in the middle. That rule was
8059
+ * never about a control panel.
8060
+ *
8061
+ * Everything else here — {@link CAMERA_SWITCH_CATALOG}, {@link CameraSwitch},
8062
+ * {@link deriveCameraSwitches}, the `pipelineOrchestrator.getCameraSwitches` /
8063
+ * `setCameraSwitch` pair — is a COMPATIBILITY surface for as long as deployed
8064
+ * viewers (v1.0.305) and the admin UI still call it. It is deleted when they
8065
+ * stop; nothing new may be built on it.
8043
8066
  *
8044
8067
  * ## This file adds no state
8045
8068
  *
@@ -8384,14 +8407,21 @@ var RecordingConfigSchema = object({
8384
8407
  /**
8385
8408
  * Entity-relocation job state (storage entity-routing spec, Phase 4).
8386
8409
  *
8387
- * One shape shared by the recorder's `relocateFootage` (segments) and
8388
- * pipeline-analytics' `relocateMedia` (event media blobs) so the admin Data
8389
- * page renders both movers with one component. Jobs are in-RAM (a restart
8390
- * forgets them re-running is safe by construction: copy-if-absent, delete
8391
- * after verify) and each completed/failed run also lands one durable ops-log
8392
- * row on the owning addon's surface.
8410
+ * One shape shared by the recorder and pipeline-analytics internal movers.
8411
+ * The public admin surface is `storage-migration`; child jobs remain in RAM
8412
+ * because copy-if-absent, verify, delete and index/row repoint are resumable.
8413
+ * Each completed/failed run also lands one durable ops-log row on its owning
8414
+ * addon surface.
8415
+ */
8416
+ /**
8417
+ * `queued` exists because the recorder mover is SINGLE-FLIGHT and an operator
8418
+ * rebalance enqueues one job per (camera, profile). Refusing the second job —
8419
+ * what the engine did before — turned a fifteen-camera rebalance into fifteen
8420
+ * manual retries. Queued jobs run FIFO; a queued job that is cancelled never
8421
+ * runs at all.
8393
8422
  */
8394
8423
  var RelocateJobStateSchema = _enum([
8424
+ "queued",
8395
8425
  "running",
8396
8426
  "done",
8397
8427
  "failed",
@@ -8416,19 +8446,109 @@ var RelocateJobSchema = object({
8416
8446
  finishedAt: number().nullable(),
8417
8447
  error: string().nullable()
8418
8448
  });
8449
+ /** Profile-derived footage selection used only by the migration coordinator:
8450
+ * `recordings` owns high+mid; `recordingsLow` owns low. */
8451
+ var RelocateFootageClassSchema = _enum(["recordings", "recordingsLow"]);
8419
8452
  var RelocateFootageInputSchema = object({
8420
- deviceId: number().optional(),
8421
8453
  fromLocationId: string(),
8422
8454
  toLocationId: string(),
8423
8455
  entities: array(_enum(["segments"])).optional(),
8456
+ /** Limits relocation to the logical profile class. Omit only for the
8457
+ * pre-orchestration compatibility path. */
8458
+ footageClass: RelocateFootageClassSchema.optional(),
8459
+ /** Scope the move to ONE camera. Absent = every camera on the source, which
8460
+ * is what a whole-disk drain means. The rebalance path always sets it: its
8461
+ * unit is a (camera, profile) pile, not a disk. */
8462
+ deviceId: number().int().optional(),
8463
+ /** Scope the move to specific segment profiles (`high` / `mid` / `low`).
8464
+ * Finer than `footageClass`, which cannot separate high from mid — and the
8465
+ * placement plan assigns those two independently, so a rebalance that could
8466
+ * only say "recordings" would move footage the plan never asked to move. */
8467
+ profiles: array(string()).optional(),
8424
8468
  /** Copy throttle in MB/s (default 40) — the drain is a background chore,
8425
8469
  * never allowed to starve live writers. */
8426
8470
  throttleMbps: number().min(1).max(1e3).optional()
8427
8471
  });
8428
- var RelocateMediaInputSchema = object({
8429
- deviceId: number().optional(),
8472
+ /** Internal, lease-scoped participant operation. It is intentionally separate
8473
+ * from persistent recording settings: a migration never changes
8474
+ * `RecordingConfig.enabled` or camera wrapper bindings. */
8475
+ var StorageMigrationLeaseInputSchema = object({ leaseId: string().min(1) });
8476
+ var StorageMigrationFootageMoveInputSchema = RelocateFootageInputSchema.extend({ leaseId: string().min(1) });
8477
+ var StorageMigrationMediaMoveInputSchema = object({
8430
8478
  toLocationId: string(),
8431
8479
  throttleMbps: number().min(1).max(1e3).optional()
8480
+ }).extend({ leaseId: string().min(1) });
8481
+ /** The independently selectable logical storage classes. `recordings`
8482
+ * encompasses the high and mid segment profiles; `recordingsLow` is low
8483
+ * segments; `eventMedia` is post-analysis blobs. */
8484
+ var StorageMigrationClassSchema = _enum([
8485
+ "recordings",
8486
+ "recordingsLow",
8487
+ "eventMedia"
8488
+ ]);
8489
+ /** A destination is always an existing, fully-qualified location id. The
8490
+ * migration API intentionally never changes a source location's `basePath`:
8491
+ * callers create a new `<type>:<slug>` location, then select it here. */
8492
+ var StorageMigrationDestinationsSchema = object({
8493
+ recordings: string().min(1).optional(),
8494
+ recordingsLow: string().min(1).optional(),
8495
+ eventMedia: string().min(1).optional()
8496
+ }).refine((value) => Object.keys(value).length > 0, { message: "select at least one storage class" });
8497
+ /** Shared input for planning and starting an orchestrated storage migration. */
8498
+ var StorageMigrationInputSchema = object({
8499
+ destinations: StorageMigrationDestinationsSchema,
8500
+ throttleMbps: number().min(1).max(1e3).optional()
8501
+ });
8502
+ /** The durable coordinator state machine. The only phase that changes default
8503
+ * locations is `repointing`, after every selected mover has completed and been
8504
+ * verified. */
8505
+ var StorageMigrationPhaseSchema = _enum([
8506
+ "planning",
8507
+ "pausing",
8508
+ "moving",
8509
+ "verifying",
8510
+ "repointing",
8511
+ "refreshing",
8512
+ "resuming",
8513
+ "done",
8514
+ "failed",
8515
+ "cancelled"
8516
+ ]);
8517
+ var StorageMigrationParticipantSchema = _enum([
8518
+ "pipeline",
8519
+ "recorder",
8520
+ "analytics"
8521
+ ]);
8522
+ var StorageMigrationMoveSchema = object({
8523
+ storageClass: StorageMigrationClassSchema,
8524
+ fromLocationId: string(),
8525
+ toLocationId: string(),
8526
+ moverJobId: string().nullable(),
8527
+ state: RelocateJobStateSchema.nullable(),
8528
+ error: string().nullable()
8529
+ });
8530
+ var StorageMigrationJobSchema = object({
8531
+ jobId: string(),
8532
+ phase: StorageMigrationPhaseSchema,
8533
+ destinations: StorageMigrationDestinationsSchema,
8534
+ throttleMbps: number(),
8535
+ moves: array(StorageMigrationMoveSchema),
8536
+ pauseLeaseId: string().nullable(),
8537
+ pausedParticipants: array(StorageMigrationParticipantSchema),
8538
+ repointed: boolean(),
8539
+ cancelRequested: boolean(),
8540
+ startedAt: number(),
8541
+ updatedAt: number(),
8542
+ finishedAt: number().nullable(),
8543
+ error: string().nullable()
8544
+ });
8545
+ var StorageMigrationPlanSchema = object({
8546
+ destinations: StorageMigrationDestinationsSchema,
8547
+ moves: array(object({
8548
+ storageClass: StorageMigrationClassSchema,
8549
+ fromLocationId: string(),
8550
+ toLocationId: string()
8551
+ }))
8432
8552
  });
8433
8553
  /**
8434
8554
  * `StorageLocationType` — an addon-declared id that identifies the *kind* of
@@ -8480,6 +8600,21 @@ var StorageLocationSchema = object({
8480
8600
  nodeId: string().optional(),
8481
8601
  isDefault: boolean().default(false),
8482
8602
  isSystem: boolean().default(false),
8603
+ /**
8604
+ * Operator opt-in: whether consumers that BALANCE across several locations
8605
+ * of a type may write here. Recordings reads it today; event media and
8606
+ * backups are the next consumers, which is why the flag lives on the
8607
+ * location rather than in any one addon's store — nothing has to be
8608
+ * extended to add the next consumer.
8609
+ *
8610
+ * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
8611
+ * flag existed reads back with no flag and keeps working exactly as before;
8612
+ * that is the whole compat story, and it is why no migration ships with it.
8613
+ * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
8614
+ * disk must not silently start writing to it); the default of a type is
8615
+ * always stamped `true`.
8616
+ */
8617
+ enabled: boolean().optional(),
8483
8618
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
8484
8619
  * for node-local locations it can reach) — never persisted, absent when the
8485
8620
  * volume is remote/unreachable. The single capacity truth every UI reads. */
@@ -13049,7 +13184,8 @@ method(object({
13049
13184
  }), EmbeddingResultSchema), method(object({ text: string() }), EmbeddingResultSchema), method(_void(), EmbeddingInfoSchema);
13050
13185
  /**
13051
13186
  * filesystem-browse — per-node capability for browsing the node's local
13052
- * filesystem, sandboxed to operator-configured allowed roots. Used by the
13187
+ * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
13188
+ * are sandboxed to operator-configured allowed roots (D115). Used by the
13053
13189
  * admin "Add filesystem location" flow to pick a node + path. `mode:'per-node'`
13054
13190
  * (one provider per node); the hub calls it with `{nodeId}` so the codegen
13055
13191
  * routes to that exact node (default `nodeIdMode:'routing'`).
@@ -14890,6 +15026,13 @@ var MaskGridDimsSchema = object({
14890
15026
  * `package-event` are pure trigger kinds (no urgency dimension). Extending
14891
15027
  * this one field keeps the schema additive — a rule still declares exactly
14892
15028
  * one trigger.
15029
+ *
15030
+ * AUDIO rules add no member here, for the reason occupancy added none: the
15031
+ * enum is mirrored by hand in the viewer (`scripts/check-viewer-condition-
15032
+ * mirror.ts` fails the build on a member the app cannot render) and every
15033
+ * member costs a release train. A sustained-sound rule is therefore an
15034
+ * `immediate` rule carrying {@link NcConditions.audio} — the condition is the
15035
+ * trigger discriminator, exactly as `occupancy` is on `device-event`.
14893
15036
  */
14894
15037
  var NcDeliverySchema = _enum([
14895
15038
  "immediate",
@@ -14904,15 +15047,32 @@ var NcDeliverySchema = _enum([
14904
15047
  * depend on a provider's raw event name or payload shape.
14905
15048
  */
14906
15049
  var NcSystemEventKindSchema = _enum([
14907
- "camera-online",
14908
- "camera-offline",
15050
+ "device-online",
15051
+ "device-offline",
15052
+ "device-disabled",
15053
+ "device-enabled",
14909
15054
  "stream-online",
14910
15055
  "stream-offline",
14911
15056
  "node-online",
14912
15057
  "node-offline",
14913
15058
  "addon-update-available",
14914
- "server-update-available"
15059
+ "server-update-available",
15060
+ "alarm-triggered",
15061
+ "alarm-armed",
15062
+ "alarm-disarmed",
15063
+ "camera-online",
15064
+ "camera-offline",
15065
+ "camera-disabled",
15066
+ "camera-enabled"
15067
+ ]);
15068
+ /** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
15069
+ var NC_LEGACY_SYSTEM_EVENT_KINDS = new Set([
15070
+ "camera-online",
15071
+ "camera-offline",
15072
+ "camera-disabled",
15073
+ "camera-enabled"
14915
15074
  ]);
15075
+ NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
14916
15076
  /**
14917
15077
  * One coherent system-event condition. `kinds` is the required opt-in safety
14918
15078
  * gate; the remaining lists are optional narrowing filters relevant to the
@@ -14921,6 +15081,18 @@ var NcSystemEventKindSchema = _enum([
14921
15081
  var NcSystemEventConditionSchema = object({
14922
15082
  kinds: array(NcSystemEventKindSchema).min(1),
14923
15083
  deviceIds: array(number().int()).min(1).optional(),
15084
+ /**
15085
+ * Narrow a `device-*` kind to these device TYPES (`DeviceType` values —
15086
+ * `camera`, `switch`, `sensor`, `container`, …). Absent = every type, which
15087
+ * is what a liveness rule means when nobody said otherwise.
15088
+ *
15089
+ * This is where "only my cameras" is expressed, and it lives on the rule for
15090
+ * one reason: the intake cannot know which devices this household cares
15091
+ * about, and a producer-side filter is one no operator can change. Fails
15092
+ * CLOSED — a subject whose device type is unknown (an id the device mirror
15093
+ * does not carry) matches no `deviceTypes` list.
15094
+ */
15095
+ deviceTypes: array(string().min(1)).min(1).optional(),
14924
15096
  nodeIds: array(string().min(1)).min(1).optional(),
14925
15097
  packageNames: array(string().min(1)).min(1).optional()
14926
15098
  });
@@ -14971,6 +15143,47 @@ var NcOccupancyConditionSchema = object({
14971
15143
  sustainSeconds: number().int().min(0).max(3600).default(15)
14972
15144
  });
14973
15145
  /**
15146
+ * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
15147
+ *
15148
+ * Operator-approved vocabulary (2026-08-12, option A — the same one the
15149
+ * reference notifier uses, so an operator moving between them re-uses what
15150
+ * they already know): a rule matches when, over a sampling window of
15151
+ * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
15152
+ * window are HITS. A sample is a hit when it satisfies BOTH present filters:
15153
+ *
15154
+ * - `dbThreshold` — its level is at or above this many dBFS (see
15155
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
15156
+ * - `labels` — the classifier put at least one of these labels on it.
15157
+ *
15158
+ * Both are OPTIONAL and independent, which is the point of the shape: a
15159
+ * loudness rule ("something loud at 3am") needs no model to be right, and a
15160
+ * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
15161
+ * is given** — a window in which every sample is trivially a hit would fire on
15162
+ * silence, so the engine refuses such a condition rather than notifying on
15163
+ * nothing (the schema cannot express "at least one of" without becoming a
15164
+ * ZodEffects the cap path would have to special-case).
15165
+ *
15166
+ * `hitPercent` is over the samples the window actually HOLDS, and the window
15167
+ * must be FULL before it can match — a window that has been open for two
15168
+ * seconds of its ten is 100% of nothing, and firing on it would make
15169
+ * `samplingSeconds` decorative.
15170
+ *
15171
+ * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
15172
+ * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
15173
+ * `audio-` prefix away on both sides, so a picker that offers taxonomy ids and
15174
+ * an operator who typed `dog` mean the same thing.
15175
+ */
15176
+ var NcAudioConditionSchema = object({
15177
+ /** Audio macro labels; absent = any sound (level-only rule). */
15178
+ labels: array(string().min(1)).min(1).optional(),
15179
+ /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
15180
+ dbThreshold: number().min(-96).max(0).optional(),
15181
+ /** Percentage of the window's samples that must be hits (1–100). */
15182
+ hitPercent: number().int().min(1).max(100).default(60),
15183
+ /** Length of the sampling window in seconds. */
15184
+ samplingSeconds: number().int().min(1).max(300).default(10)
15185
+ });
15186
+ /**
14974
15187
  * Which zone-crossing DIRECTION a rule accepts (`ObjectEvent.zoneCrossing`).
14975
15188
  *
14976
15189
  * The values are not symmetric, and deliberately so — the absent value has to
@@ -15243,7 +15456,33 @@ var NcConditionsSchema = object({
15243
15456
  * threshold and holds for `sustainSeconds`. Fail-closed on missing
15244
15457
  * substrate (no snapshot / missing zone). See {@link NcOccupancyCondition}.
15245
15458
  */
15246
- occupancy: NcOccupancyConditionSchema.optional()
15459
+ occupancy: NcOccupancyConditionSchema.optional(),
15460
+ /**
15461
+ * IMMEDIATE only. Sustained-sound matcher — `hitPercent` of the samples in a
15462
+ * `samplingSeconds` window clear the optional `dbThreshold` and carry one of
15463
+ * the optional `labels`. Fail-closed on missing substrate (no audio samples,
15464
+ * a window that is not full yet, neither filter given). See
15465
+ * {@link NcAudioCondition}.
15466
+ *
15467
+ * Presence of this key is what makes a rule an AUDIO rule: the engine fires
15468
+ * it ONLY on a confirmed audio window, and a rule carrying it never fires on
15469
+ * a detection, a track or a device event (the same fail-closed pairing
15470
+ * `occupancy` has with the `device-event` trigger). That is how audio labels
15471
+ * leave `classes`: an audio rule names its sounds HERE, and the legacy path
15472
+ * (an `immediate` rule naming an `audio-*` class, one notification per
15473
+ * classified sample) stays exactly as it was for rules that already use it.
15474
+ *
15475
+ * NOT in {@link NC_CONDITION_CATALOG} yet, and that is the sequencing rule
15476
+ * rather than an oversight: the viewer mirrors the descriptor enums BY HAND
15477
+ * (`camstack/src/data/notification-center.ts`, guarded by
15478
+ * `scripts/check-viewer-condition-mirror.ts`) and its rule editor STRIPS the
15479
+ * condition fields it does not know when a rule is saved from the phone.
15480
+ * Publishing an editor for a condition the app cannot round-trip is how an
15481
+ * operator loses a rule's conditions by opening it — so the descriptor, the
15482
+ * admin widget and the viewer mirror land together (P2 + P3), and only then
15483
+ * does an audio rule become authorable.
15484
+ */
15485
+ audio: NcAudioConditionSchema.optional()
15247
15486
  });
15248
15487
  /** One delivery target: a `notification-output` Target ref + passthrough params. */
15249
15488
  var NcRuleTargetSchema = object({
@@ -15357,6 +15596,73 @@ var NcThrottleSchema = object({
15357
15596
  */
15358
15597
  granularity: NcThrottleGranularitySchema.optional()
15359
15598
  });
15599
+ /**
15600
+ * How long the confirm gate may hold ONE notification, and how big the picture
15601
+ * it judges may be.
15602
+ *
15603
+ * The clamp is the product decision, not a coincidence of the model: p50 was
15604
+ * 4.9 s warm and 15.3 s cold against qwen3-vl-8b, and a notification that
15605
+ * arrives after the visitor has gone is not a notification. 448 px was enough
15606
+ * to score 16/16 on the operator's parking scenario — bigger costs latency and
15607
+ * tokens for pixels the model pools away.
15608
+ */
15609
+ var NC_CONFIRM_MIN_TIMEOUT_MS = 1e3;
15610
+ var NC_CONFIRM_MAX_TIMEOUT_MS = 2e4;
15611
+ var NC_CONFIRM_DEFAULT_TIMEOUT_MS = 8e3;
15612
+ /** Comparison the model's COUNT must satisfy for the notification to fire. */
15613
+ var NcConfirmExpectSchema = object({
15614
+ op: _enum([
15615
+ ">=",
15616
+ ">",
15617
+ "<=",
15618
+ "<",
15619
+ "=="
15620
+ ]),
15621
+ count: number().int().min(0).max(1e3)
15622
+ });
15623
+ /**
15624
+ * AI CONFIRM — a vision model looks at the picture this notification is about
15625
+ * to ship and says whether it agrees with the rule.
15626
+ *
15627
+ * It runs AFTER the attachments resolve, deliberately: the crop JUDGED is the
15628
+ * crop SHIPPED (D52). A verdict about a different pixel rectangle than the one
15629
+ * on the operator's phone is not a verdict about this notification.
15630
+ *
15631
+ * FAIL-OPEN is the only safe default. A gate that cannot reach its model, or
15632
+ * whose model is cold, must not silence a camera — so `onTimeout: 'fire'` is
15633
+ * the default and every fail-open is COUNTED, because a gate that always fails
15634
+ * open looks in the log exactly like a gate that works.
15635
+ *
15636
+ * Every field is `.optional()` rather than relied on as a Zod default at the
15637
+ * runtime seam: a Zod default does NOT run on the addon→addon cap path (three
15638
+ * production failures in one day), so the gate reads absent as the constant
15639
+ * above rather than trusting a parse it may never have seen.
15640
+ */
15641
+ var NcConfirmSchema = object({
15642
+ /** Off unless asked for. An absent `confirm` and `enabled:false` are the
15643
+ * same thing, and both mean "deliver exactly as before". */
15644
+ enabled: boolean().default(false),
15645
+ /** Explicit vision profile; absent = the `purpose:'vision'` cluster default. */
15646
+ profileId: string().optional(),
15647
+ /**
15648
+ * The operator's question, in his own words. Absent = a question derived
15649
+ * from the rule (its class and its expectation).
15650
+ *
15651
+ * NEVER composed with text READ OUT OF THE FRAME. The model reads OSD
15652
+ * banners, signage and plates as instructions if you let them reach the
15653
+ * prompt — proven live — so the authoritative contract stays in the system
15654
+ * turn and only rule-authored words land here.
15655
+ */
15656
+ prompt: string().max(1e3).optional(),
15657
+ /** Fire only when the model's count satisfies this. Absent = the model's
15658
+ * own boolean verdict decides. */
15659
+ expect: NcConfirmExpectSchema.optional(),
15660
+ timeoutMs: number().int().min(NC_CONFIRM_MIN_TIMEOUT_MS).max(NC_CONFIRM_MAX_TIMEOUT_MS).default(NC_CONFIRM_DEFAULT_TIMEOUT_MS),
15661
+ /** What a timeout / unreachable model MEANS. `fire` (default) = fail-open. */
15662
+ onTimeout: _enum(["fire", "suppress"]).default("fire"),
15663
+ /** Longest edge the judged image is downscaled to before it is sent. */
15664
+ maxImagePx: number().int().min(64).max(2048).default(448)
15665
+ });
15360
15666
  /** Client-supplied rule fields (server stamps id/createdBy/createdAt/updatedAt). */
15361
15667
  var NcRuleInputSchema = object({
15362
15668
  name: string().min(1).max(200),
@@ -15417,7 +15723,13 @@ var NcRuleInputSchema = object({
15417
15723
  * `{ cap: 'alarm-panel', method: 'arm', args: { mode: 'away' } }`, the same
15418
15724
  * shape as every other actuation.
15419
15725
  */
15420
- actions: NcRuleActionsSchema.optional()
15726
+ actions: NcRuleActionsSchema.optional(),
15727
+ /**
15728
+ * AI CONFIRM — see {@link NcConfirmSchema}. `.optional()`, never defaulted:
15729
+ * a rule that predates the gate must keep delivering byte-for-byte as it
15730
+ * did, and absent is the only way to say that without a migration.
15731
+ */
15732
+ confirm: NcConfirmSchema.optional()
15421
15733
  });
15422
15734
  /**
15423
15735
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -15428,7 +15740,37 @@ var NcRuleInputSchema = object({
15428
15740
  * still flow through `nc.setRuleTargetEnabled` (owner-checked), never a raw
15429
15741
  * `updateRule` patch.
15430
15742
  */
15431
- var NcRulePatchSchema = NcRuleInputSchema.partial().extend({ disabledTargetIds: array(string()).optional() });
15743
+ var NcRulePatchSchema = NcRuleInputSchema.partial().extend({
15744
+ disabledTargetIds: array(string()).optional(),
15745
+ /**
15746
+ * `.partial()` DOES NOT REMOVE A FIELD'S `.default()`.
15747
+ *
15748
+ * It makes the key optional to SUPPLY; the parse still materialises the
15749
+ * default when the key is absent. And `NcRuleStore.update` merges with
15750
+ * `{ ...existing, ...patch }`, so a materialised key OVERWRITES the stored
15751
+ * one — which made every partial edit destructive:
15752
+ *
15753
+ * nc.updateRule({ throttle }) → conditions reset to `{}`
15754
+ * nc.setRuleTargetEnabled(...) → conditions reset to `{}`
15755
+ * setEnabled(ruleId, false) → conditions reset to `{}`
15756
+ *
15757
+ * A rule scoped to one camera and one zone silently became a rule that
15758
+ * matches EVERY event on EVERY camera, and lost its `media` policy
15759
+ * (zoneCrop / gif / clip / frame) and its `priority` at the same time. Seen
15760
+ * live on 2026-08-12: a rule scoped to device 617 fired on 590 and 615
15761
+ * within a minute of a two-field patch.
15762
+ *
15763
+ * So every defaulted field is re-declared here WITHOUT its default. The
15764
+ * inner defaults still apply when the caller DOES send the key — `{}` for
15765
+ * conditions remains a real instruction ("clear them") — and only the
15766
+ * absent key is now genuinely absent.
15767
+ */
15768
+ enabled: boolean().optional(),
15769
+ conditions: NcConditionsSchema.optional(),
15770
+ media: NcMediaPolicySchema.optional(),
15771
+ throttle: NcThrottleSchema.optional(),
15772
+ priority: number().int().min(1).max(5).optional()
15773
+ });
15432
15774
  /** A persisted rule. */
15433
15775
  var NcRuleSchema = NcRuleInputSchema.extend({
15434
15776
  id: string(),
@@ -15729,6 +16071,25 @@ var NcAlarmSettingsPatchSchema = NcAlarmSettingsSchema.partial();
15729
16071
  * Never authored, never stored — see `alarm-mode-coverage.ts` for why a stored
15730
16072
  * copy would lie the first time a rule is disabled.
15731
16073
  */
16074
+ /**
16075
+ * Why a device a mode NAMES is nonetheless not armed by it.
16076
+ *
16077
+ * Each value is an existing authority, never a new flag (D62): `muted` is the
16078
+ * per-camera notification switch the Notification Center already owns,
16079
+ * `detection-off` is the device's own detection binding being inactive, and
16080
+ * `offline` is the device manager's liveness. A fourth reason would mean a
16081
+ * fourth authority, and inventing one here is how a panel starts disagreeing
16082
+ * with the switches the operator actually used.
16083
+ */
16084
+ var NcAlarmSkipReasonSchema = _enum([
16085
+ "muted",
16086
+ "detection-off",
16087
+ "offline"
16088
+ ]);
16089
+ var NcAlarmSkippedDeviceSchema = object({
16090
+ deviceId: number().int(),
16091
+ reason: NcAlarmSkipReasonSchema
16092
+ });
15732
16093
  var NcAlarmModeCoverageSchema = object({
15733
16094
  mode: AlarmArmModeSchema,
15734
16095
  /** Enabled rules gated on `armed_<mode>`. Zero means the mode does nothing. */
@@ -15736,7 +16097,18 @@ var NcAlarmModeCoverageSchema = object({
15736
16097
  /** At least one covering rule has no device scope, so the mode covers all. */
15737
16098
  allDevices: boolean(),
15738
16099
  /** Ids named by the covering rules. A SUBSET when `allDevices` is true. */
15739
- deviceIds: array(number().int())
16100
+ deviceIds: array(number().int()),
16101
+ /**
16102
+ * Devices this mode NAMES but cannot actually arm, each with the switch that
16103
+ * excludes it.
16104
+ *
16105
+ * "Away armed — 12 cameras" is a promise, and a muted camera among those
16106
+ * twelve makes it false in exactly the way nobody notices until an incident.
16107
+ * Defaulted to `[]` so a coverage answer computed before this field existed
16108
+ * still parses as "nothing known to be skipped" rather than failing the whole
16109
+ * alarm tab.
16110
+ */
16111
+ skippedDevices: array(NcAlarmSkippedDeviceSchema).default([])
15740
16112
  });
15741
16113
  var NcAlarmConfigSchema = object({
15742
16114
  /**
@@ -17099,13 +17471,19 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
17099
17471
  }), method(object({ deviceId: number() }), EventPruneCountsSchema, {
17100
17472
  kind: "mutation",
17101
17473
  auth: "admin"
17102
- }), method(RelocateMediaInputSchema, object({ jobId: string() }), {
17474
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
17103
17475
  kind: "mutation",
17104
17476
  auth: "admin"
17105
- }), method(object({}), array(RelocateJobSchema).readonly(), {
17106
- kind: "query",
17477
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
17478
+ kind: "mutation",
17107
17479
  auth: "admin"
17108
- }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
17480
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
17481
+ kind: "mutation",
17482
+ auth: "admin"
17483
+ }), method(StorageMigrationMediaMoveInputSchema, object({ jobId: string() }), {
17484
+ kind: "mutation",
17485
+ auth: "admin"
17486
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
17109
17487
  kind: "mutation",
17110
17488
  auth: "admin"
17111
17489
  }), method(OpsLogQueryInputSchema, array(OpsLogEntrySchema).readonly(), {
@@ -18562,9 +18940,16 @@ var CameraStatusSchema = object({
18562
18940
  audio: CameraAudioStatusSchema.nullable(),
18563
18941
  recording: CameraRecordingStatusSchema.nullable(),
18564
18942
  /**
18565
- * Per-camera function switches an OPERATOR has turned off
18943
+ * Per-camera functions an OPERATOR has turned off
18566
18944
  * ([D61](../../../../docs/decisions/adr-0067.md)).
18567
18945
  *
18946
+ * Composed from the AUTHORITIES themselves — the wrapper bindings,
18947
+ * `RecordingConfig.enabled`, the notification mute, the broker's audio
18948
+ * policy, the camera's own microphone — via `composeSwitchedOff`, not from
18949
+ * the deprecated `getCameraSwitches` group ([D113](../../../../docs/decisions/adr-0113.md)).
18950
+ * The badge outlives the control panel: the panel was a convenience, this is
18951
+ * the difference between a camera being off and a camera being dead.
18952
+ *
18568
18953
  * This is the difference between DISABLED and BROKEN. A camera whose
18569
18954
  * `detection` block reports zero fps and whose `switchedOff` contains
18570
18955
  * `'object-detection'` was switched off by a person; the same camera with an
@@ -18635,7 +19020,13 @@ var NodeInferenceDevicesSchema = object({
18635
19020
  reachable: boolean(),
18636
19021
  devices: array(NodeInferenceDeviceSchema).readonly()
18637
19022
  });
18638
- method(object({
19023
+ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
19024
+ kind: "mutation",
19025
+ auth: "admin"
19026
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
19027
+ kind: "mutation",
19028
+ auth: "admin"
19029
+ }), method(object({
18639
19030
  deviceId: number(),
18640
19031
  agentNodeId: string()
18641
19032
  }), object({ success: literal(true) }), {
@@ -19309,6 +19700,13 @@ method(object({ locationId: string() }), EvictableUsageSchema), method(object({
19309
19700
  locationId: string(),
19310
19701
  targetBytes: number().int().positive()
19311
19702
  }), EvictResultSchema, { kind: "mutation" });
19703
+ method(StorageMigrationInputSchema, StorageMigrationPlanSchema, { auth: "admin" }), method(StorageMigrationInputSchema, object({ jobId: string() }), {
19704
+ kind: "mutation",
19705
+ auth: "admin"
19706
+ }), method(object({ jobId: string().optional() }), StorageMigrationJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
19707
+ kind: "mutation",
19708
+ auth: "admin"
19709
+ });
19312
19710
  var ProviderInfoSchema = discriminatedUnion("shouldSaveDiskSpace", [object({
19313
19711
  providerId: string().min(1),
19314
19712
  displayName: string().min(1),
@@ -19412,6 +19810,28 @@ var TerminalProfileInfoSchema = object({
19412
19810
  label: string(),
19413
19811
  description: string().optional()
19414
19812
  });
19813
+ /**
19814
+ * A durable operator-created Terminal instance. Profiles are templates; only
19815
+ * an instance declares a camera.
19816
+ */
19817
+ var TerminalInstanceInfoSchema = object({
19818
+ instanceId: string(),
19819
+ cameraStableId: string(),
19820
+ nodeId: string(),
19821
+ profileId: string(),
19822
+ profileLabel: string(),
19823
+ name: string(),
19824
+ enabled: boolean()
19825
+ });
19826
+ var TerminalLegacyCameraSchema = object({
19827
+ stableId: string(),
19828
+ nodeId: string(),
19829
+ profileId: string(),
19830
+ profileLabel: string(),
19831
+ name: string(),
19832
+ /** Only legacy monitor cameras can retain their historic stable identity. */
19833
+ adoptable: boolean()
19834
+ });
19415
19835
  var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
19416
19836
  seq: number().int().positive(),
19417
19837
  kind: literal("data"),
@@ -19428,7 +19848,29 @@ var TerminalOutputBatchSchema = object({
19428
19848
  snapshot: string().optional(),
19429
19849
  events: array(TerminalOutputEventSchema).readonly()
19430
19850
  });
19431
- method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
19851
+ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }), method(_void(), array(TerminalInstanceInfoSchema).readonly(), { auth: "admin" }), method(object({
19852
+ targetNodeId: string().min(1),
19853
+ profileId: string().min(1),
19854
+ name: string().trim().min(1).max(160).optional()
19855
+ }), TerminalInstanceInfoSchema, {
19856
+ kind: "mutation",
19857
+ auth: "admin"
19858
+ }), method(object({ instanceId: string().min(1) }), _void(), {
19859
+ kind: "mutation",
19860
+ auth: "admin"
19861
+ }), method(object({
19862
+ instanceId: string().min(1),
19863
+ enabled: boolean()
19864
+ }), TerminalInstanceInfoSchema, {
19865
+ kind: "mutation",
19866
+ auth: "admin"
19867
+ }), method(_void(), array(TerminalLegacyCameraSchema).readonly(), { auth: "admin" }), method(object({
19868
+ stableId: string().min(1),
19869
+ name: string().trim().min(1).max(160).optional()
19870
+ }), TerminalInstanceInfoSchema, {
19871
+ kind: "mutation",
19872
+ auth: "admin"
19873
+ }), method(_void(), array(TerminalSessionInfoSchema).readonly(), { auth: "admin" }), method(object({
19432
19874
  profileId: string(),
19433
19875
  cols: number().int().positive(),
19434
19876
  rows: number().int().positive()
@@ -19445,7 +19887,13 @@ method(_void(), array(TerminalProfileInfoSchema).readonly(), { auth: "admin" }),
19445
19887
  }), method(object({
19446
19888
  sessionId: string(),
19447
19889
  afterSeq: number().int().nonnegative(),
19448
- waitMs: number().int().min(0).max(2e3).default(0)
19890
+ waitMs: number().int().min(0).max(2e3).default(0),
19891
+ /**
19892
+ * Wait when a just-opened session has no output yet. Kept opt-in so a
19893
+ * browser's initial repaint remains immediate; the camera snapshot
19894
+ * relay uses it to avoid encoding a blank startup frame.
19895
+ */
19896
+ waitForOutput: boolean().optional()
19449
19897
  }), TerminalOutputBatchSchema, {
19450
19898
  kind: "mutation",
19451
19899
  auth: "admin",
@@ -21951,6 +22399,7 @@ var FaceInfoSchema = object({
21951
22399
  var FaceFilterEnum = _enum([
21952
22400
  "unassigned",
21953
22401
  "recognized",
22402
+ "identified",
21954
22403
  "all"
21955
22404
  ]);
21956
22405
  var MediaFileLiteSchema$1 = object({
@@ -21979,6 +22428,8 @@ method(_void(), array(IdentitySchema).readonly()), method(object({ name: string(
21979
22428
  kind: "mutation",
21980
22429
  auth: "admin"
21981
22430
  }), method(object({
22431
+ /** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
22432
+ deviceId: number().int().optional(),
21982
22433
  limit: number().int().positive().optional(),
21983
22434
  filter: FaceFilterEnum.optional(),
21984
22435
  /**
@@ -24208,6 +24659,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
24208
24659
  capName: string().min(1).max(64),
24209
24660
  /** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
24210
24661
  valuePath: string().min(1).max(64)
24662
+ }),
24663
+ object({
24664
+ kind: literal("latest-recognition"),
24665
+ recognition: _enum(["person", "plate"])
24211
24666
  })
24212
24667
  ]);
24213
24668
  var OsdSlotBindingSchema = object({
@@ -24313,6 +24768,15 @@ method(object({ deviceId: number().int() }), object({
24313
24768
  }), object({ success: literal(true) }), {
24314
24769
  kind: "mutation",
24315
24770
  auth: "admin"
24771
+ }), method(object({
24772
+ sourceDeviceId: number().int(),
24773
+ targetDeviceId: number().int()
24774
+ }), object({
24775
+ copied: number().int().nonnegative(),
24776
+ skipped: number().int().nonnegative()
24777
+ }), {
24778
+ kind: "mutation",
24779
+ auth: "admin"
24316
24780
  }), method(object({
24317
24781
  deviceId: number().int(),
24318
24782
  slotId: string().min(1),
@@ -25235,7 +25699,19 @@ var RecordingManifestSchema = object({
25235
25699
  * profiles/subtrees/locations on this node). */
25236
25700
  var RecordingDeviceUsageSchema = object({
25237
25701
  deviceId: number(),
25238
- usedBytes: number()
25702
+ usedBytes: number(),
25703
+ /**
25704
+ * Start of this camera's OLDEST indexed segment, across every profile and
25705
+ * location — the "Oldest footage" column in Recordings → Storage, and the
25706
+ * only honest answer to "is retention actually holding?" per camera.
25707
+ *
25708
+ * `null` = the camera has no footage. OPTIONAL because a recorder that
25709
+ * predates this field omits it entirely, and a hub whose types carry the
25710
+ * field must keep validating that older provider's payload: the framework
25711
+ * (types) and the addon ship on different trains, and the addon is usually
25712
+ * the later of the two.
25713
+ */
25714
+ oldestMs: number().nullable().optional()
25239
25715
  });
25240
25716
  /** Recording storage usage + capacity for one storage location. */
25241
25717
  var RecordingLocationUsageSchema = object({
@@ -25263,6 +25739,57 @@ var RecordingStorageUsageSchema = object({
25263
25739
  locations: array(RecordingLocationUsageSchema)
25264
25740
  });
25265
25741
  /**
25742
+ * The OPERATOR-ARMED half of multi-location recordings (D116).
25743
+ *
25744
+ * The placement plan decides where NEW writes go and moves nothing. A rebalance
25745
+ * is the operator asking for the EXISTING archive to be brought into line with
25746
+ * that plan: one relocate job per (camera, profile) pile that sits on the wrong
25747
+ * location, run FIFO behind the single-flight mover.
25748
+ *
25749
+ * `plan…` and `start…` return the SAME shape deliberately — what the operator
25750
+ * confirms is exactly what gets enqueued, and `jobIds` is the only difference
25751
+ * (empty on the plan).
25752
+ */
25753
+ var RecordingRebalanceMoveSchema = object({
25754
+ deviceId: number(),
25755
+ profile: string(),
25756
+ fromLocationId: string(),
25757
+ toLocationId: string(),
25758
+ bytes: number(),
25759
+ files: number().int()
25760
+ });
25761
+ /** Why a pile that is out of place is staying there. Every refusal is
25762
+ * reported: a rebalance that silently drops a camera reads exactly like one
25763
+ * that had nothing to do. */
25764
+ var RecordingRebalanceSkipReasonSchema = _enum([
25765
+ "unassigned",
25766
+ "target-not-writable",
25767
+ "below-threshold",
25768
+ "no-headroom"
25769
+ ]);
25770
+ var RecordingRebalanceSkipSchema = object({
25771
+ deviceId: number(),
25772
+ profile: string(),
25773
+ fromLocationId: string(),
25774
+ /** The location the plan wants; null when the camera has no assignment. */
25775
+ toLocationId: string().nullable(),
25776
+ bytes: number(),
25777
+ reason: RecordingRebalanceSkipReasonSchema
25778
+ });
25779
+ var RecordingRebalancePlanSchema = object({
25780
+ moves: array(RecordingRebalanceMoveSchema),
25781
+ skipped: array(RecordingRebalanceSkipSchema),
25782
+ bytesToMove: number(),
25783
+ /** Relocate job ids enqueued. Always empty for the plan (dry-run) call. */
25784
+ jobIds: array(string())
25785
+ });
25786
+ var RecordingRebalanceInputSchema = object({
25787
+ /** Copy throttle in MB/s (default 40) — a rebalance is a background chore. */
25788
+ throttleMbps: number().min(1).max(1e3).optional(),
25789
+ /** Ignore piles smaller than this (default 1 GB). */
25790
+ minMoveGb: number().min(0).optional()
25791
+ });
25792
+ /**
25266
25793
  * Result of locating footage at a wall-clock instant for one device/profile.
25267
25794
  * `segment` carries the covering segment's window; `gap` reports the forward
25268
25795
  * nearest covered edge (`null` past the end of footage / when none exists)
@@ -25410,6 +25937,21 @@ method(object({
25410
25937
  }), {
25411
25938
  kind: "mutation",
25412
25939
  auth: "admin"
25940
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
25941
+ kind: "mutation",
25942
+ auth: "admin"
25943
+ }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
25944
+ kind: "mutation",
25945
+ auth: "admin"
25946
+ }), method(StorageMigrationLeaseInputSchema, object({ refreshed: literal(true) }), {
25947
+ kind: "mutation",
25948
+ auth: "admin"
25949
+ }), method(StorageMigrationFootageMoveInputSchema, object({ jobId: string() }), {
25950
+ kind: "mutation",
25951
+ auth: "admin"
25952
+ }), method(object({ jobId: string() }), RelocateJobSchema.nullable(), { auth: "admin" }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
25953
+ kind: "mutation",
25954
+ auth: "admin"
25413
25955
  }), method(RelocateFootageInputSchema, object({ jobId: string() }), {
25414
25956
  kind: "mutation",
25415
25957
  auth: "admin"
@@ -25419,9 +25961,15 @@ method(object({
25419
25961
  }), method(object({ jobId: string() }), object({ cancelled: boolean() }), {
25420
25962
  kind: "mutation",
25421
25963
  auth: "admin"
25964
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25965
+ kind: "query",
25966
+ auth: "admin"
25967
+ }), method(RecordingRebalanceInputSchema, RecordingRebalancePlanSchema, {
25968
+ kind: "mutation",
25969
+ auth: "admin"
25422
25970
  });
25423
25971
  /**
25424
- * `recordingExport` cap — render a footage time range into a single downloadable
25972
+ * `recording-export` cap — render a footage time range into a single downloadable
25425
25973
  * MP4 (regular / accelerated / decelerated / timelapse, ± audio), kept for a
25426
25974
  * bounded lifetime with a durable history, auto-expiry, and optional
25427
25975
  * delete-after-download.
@@ -25436,10 +25984,42 @@ method(object({
25436
25984
  */
25437
25985
  /** Playback-speed multiplier for the render (1 = realtime). */
25438
25986
  var ExportSpeedSchema = number().min(.25).max(32);
25987
+ /**
25988
+ * One dense interval, in SECONDS FROM THE EXPORT'S OWN `fromMs`.
25989
+ *
25990
+ * Relative and not absolute epoch on purpose: the renderer's frame-select
25991
+ * expression sees ffmpeg's `t`, which starts at 0 for the export's source
25992
+ * playlist. Handing it absolute epochs would make every call site responsible
25993
+ * for the same subtraction, and the one that forgot would emit a filter that
25994
+ * selects nothing — silently, as a uniform timelapse.
25995
+ */
25996
+ var ExportDenseRangeSchema = object({
25997
+ fromSec: number().nonnegative(),
25998
+ toSec: number().nonnegative()
25999
+ }).refine((r) => r.toSec > r.fromSec, { message: "dense range must have toSec > fromSec" });
26000
+ /**
26001
+ * Dense-interval overlay for a timelapse: sample at `dense.everyMs` INSIDE the
26002
+ * listed ranges and at the base `everyMs` everywhere else.
26003
+ *
26004
+ * `everyMs` must be strictly smaller than the base cadence — a dense rate that
26005
+ * is not denser renders a uniform timelapse the operator believes is two-rate.
26006
+ */
26007
+ var ExportDenseSchema = object({
26008
+ everyMs: number().int().positive(),
26009
+ ranges: array(ExportDenseRangeSchema).min(1).max(200)
26010
+ });
25439
26011
  /** Timelapse cadence — sample one source frame per `everyMs`, output at `outputFps`. */
25440
26012
  var ExportTimelapseSchema = object({
25441
26013
  everyMs: number().int().positive(),
25442
- outputFps: number().int().min(1).max(60).optional()
26014
+ outputFps: number().int().min(1).max(60).optional(),
26015
+ /** Optional second, FASTER rate over the intervals that matter. */
26016
+ dense: ExportDenseSchema.optional()
26017
+ }).superRefine((v, ctx) => {
26018
+ if (v.dense !== void 0 && v.dense.everyMs >= v.everyMs) ctx.addIssue({
26019
+ code: ZodIssueCode.custom,
26020
+ message: "dense.everyMs must be strictly smaller than the base everyMs",
26021
+ path: ["dense", "everyMs"]
26022
+ });
25443
26023
  });
25444
26024
  /**
25445
26025
  * Render options. `speed` and `timelapse` are mutually exclusive. `includeAudio`
@@ -25497,6 +26077,19 @@ var ExportDownloadSchema = object({
25497
26077
  url: string(),
25498
26078
  endpoints: array(string())
25499
26079
  });
26080
+ /**
26081
+ * A finished export's bytes, inline.
26082
+ *
26083
+ * `bytes` is the DECODED length — the number the caller bounds and logs
26084
+ * against, so nobody has to infer it from the base64 length.
26085
+ */
26086
+ var ExportBytesSchema = object({
26087
+ base64: string(),
26088
+ contentType: string(),
26089
+ /** Suggested filename, extension included. */
26090
+ name: string(),
26091
+ bytes: number().int().nonnegative()
26092
+ });
25500
26093
  method(object({
25501
26094
  deviceId: number(),
25502
26095
  profile: string(),
@@ -25521,6 +26114,9 @@ method(object({
25521
26114
  }), method(object({ exportId: string() }), ExportDownloadSchema, {
25522
26115
  kind: "query",
25523
26116
  auth: "protected"
26117
+ }), method(object({ exportId: string() }), ExportBytesSchema, {
26118
+ kind: "query",
26119
+ auth: "protected"
25524
26120
  });
25525
26121
  /**
25526
26122
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -31022,6 +31618,12 @@ Object.freeze({
31022
31618
  addonId: null,
31023
31619
  access: "delete"
31024
31620
  },
31621
+ "osdManager.copyDeviceConfiguration": {
31622
+ capName: "osd-manager",
31623
+ capScope: "system",
31624
+ addonId: null,
31625
+ access: "create"
31626
+ },
31025
31627
  "osdManager.getConditionSupport": {
31026
31628
  capName: "osd-manager",
31027
31629
  capScope: "system",
@@ -31118,7 +31720,7 @@ Object.freeze({
31118
31720
  addonId: null,
31119
31721
  access: "create"
31120
31722
  },
31121
- "pipelineAnalytics.cancelMediaRelocate": {
31723
+ "pipelineAnalytics.cancelStorageMigrationMove": {
31122
31724
  capName: "pipeline-analytics",
31123
31725
  capScope: "device",
31124
31726
  addonId: null,
@@ -31190,12 +31792,6 @@ Object.freeze({
31190
31792
  addonId: null,
31191
31793
  access: "view"
31192
31794
  },
31193
- "pipelineAnalytics.getMediaRelocateStatus": {
31194
- capName: "pipeline-analytics",
31195
- capScope: "device",
31196
- addonId: null,
31197
- access: "view"
31198
- },
31199
31795
  "pipelineAnalytics.getMotionEvents": {
31200
31796
  capName: "pipeline-analytics",
31201
31797
  capScope: "device",
@@ -31232,6 +31828,12 @@ Object.freeze({
31232
31828
  addonId: null,
31233
31829
  access: "view"
31234
31830
  },
31831
+ "pipelineAnalytics.getStorageMigrationMoveStatus": {
31832
+ capName: "pipeline-analytics",
31833
+ capScope: "device",
31834
+ addonId: null,
31835
+ access: "view"
31836
+ },
31235
31837
  "pipelineAnalytics.getTrack": {
31236
31838
  capName: "pipeline-analytics",
31237
31839
  capScope: "device",
@@ -31310,6 +31912,12 @@ Object.freeze({
31310
31912
  addonId: null,
31311
31913
  access: "view"
31312
31914
  },
31915
+ "pipelineAnalytics.pauseForStorageMigration": {
31916
+ capName: "pipeline-analytics",
31917
+ capScope: "device",
31918
+ addonId: null,
31919
+ access: "create"
31920
+ },
31313
31921
  "pipelineAnalytics.proposeRetrainAnnotations": {
31314
31922
  capName: "pipeline-analytics",
31315
31923
  capScope: "device",
@@ -31340,7 +31948,7 @@ Object.freeze({
31340
31948
  addonId: null,
31341
31949
  access: "create"
31342
31950
  },
31343
- "pipelineAnalytics.relocateMedia": {
31951
+ "pipelineAnalytics.refreshStorageLocationsForMigration": {
31344
31952
  capName: "pipeline-analytics",
31345
31953
  capScope: "device",
31346
31954
  addonId: null,
@@ -31352,6 +31960,12 @@ Object.freeze({
31352
31960
  addonId: null,
31353
31961
  access: "create"
31354
31962
  },
31963
+ "pipelineAnalytics.resumeForStorageMigration": {
31964
+ capName: "pipeline-analytics",
31965
+ capScope: "device",
31966
+ addonId: null,
31967
+ access: "create"
31968
+ },
31355
31969
  "pipelineAnalytics.saveRetrainAnnotations": {
31356
31970
  capName: "pipeline-analytics",
31357
31971
  capScope: "device",
@@ -31376,6 +31990,12 @@ Object.freeze({
31376
31990
  addonId: null,
31377
31991
  access: "create"
31378
31992
  },
31993
+ "pipelineAnalytics.startStorageMigrationMove": {
31994
+ capName: "pipeline-analytics",
31995
+ capScope: "device",
31996
+ addonId: null,
31997
+ access: "create"
31998
+ },
31379
31999
  "pipelineAnalytics.wipeAllAnalytics": {
31380
32000
  capName: "pipeline-analytics",
31381
32001
  capScope: "device",
@@ -31742,6 +32362,12 @@ Object.freeze({
31742
32362
  addonId: null,
31743
32363
  access: "view"
31744
32364
  },
32365
+ "pipelineOrchestrator.pauseForStorageMigration": {
32366
+ capName: "pipeline-orchestrator",
32367
+ capScope: "system",
32368
+ addonId: null,
32369
+ access: "create"
32370
+ },
31745
32371
  "pipelineOrchestrator.rebalance": {
31746
32372
  capName: "pipeline-orchestrator",
31747
32373
  capScope: "system",
@@ -31766,6 +32392,12 @@ Object.freeze({
31766
32392
  addonId: null,
31767
32393
  access: "view"
31768
32394
  },
32395
+ "pipelineOrchestrator.resumeForStorageMigration": {
32396
+ capName: "pipeline-orchestrator",
32397
+ capScope: "system",
32398
+ addonId: null,
32399
+ access: "create"
32400
+ },
31769
32401
  "pipelineOrchestrator.saveTemplate": {
31770
32402
  capName: "pipeline-orchestrator",
31771
32403
  capScope: "system",
@@ -32162,7 +32794,13 @@ Object.freeze({
32162
32794
  addonId: null,
32163
32795
  access: "create"
32164
32796
  },
32165
- "recording.cancelRelocate": {
32797
+ "recording.cancelRelocateJob": {
32798
+ capName: "recording",
32799
+ capScope: "system",
32800
+ addonId: null,
32801
+ access: "create"
32802
+ },
32803
+ "recording.cancelStorageMigrationMove": {
32166
32804
  capName: "recording",
32167
32805
  capScope: "system",
32168
32806
  addonId: null,
@@ -32198,7 +32836,7 @@ Object.freeze({
32198
32836
  addonId: null,
32199
32837
  access: "view"
32200
32838
  },
32201
- "recording.getRelocateStatus": {
32839
+ "recording.getStorageMigrationMoveStatus": {
32202
32840
  capName: "recording",
32203
32841
  capScope: "system",
32204
32842
  addonId: null,
@@ -32216,12 +32854,30 @@ Object.freeze({
32216
32854
  addonId: null,
32217
32855
  access: "view"
32218
32856
  },
32857
+ "recording.listRelocateJobs": {
32858
+ capName: "recording",
32859
+ capScope: "system",
32860
+ addonId: null,
32861
+ access: "view"
32862
+ },
32219
32863
  "recording.locateSegment": {
32220
32864
  capName: "recording",
32221
32865
  capScope: "system",
32222
32866
  addonId: null,
32223
32867
  access: "view"
32224
32868
  },
32869
+ "recording.pauseForStorageMigration": {
32870
+ capName: "recording",
32871
+ capScope: "system",
32872
+ addonId: null,
32873
+ access: "create"
32874
+ },
32875
+ "recording.planStorageRebalance": {
32876
+ capName: "recording",
32877
+ capScope: "system",
32878
+ addonId: null,
32879
+ access: "view"
32880
+ },
32225
32881
  "recording.pruneFootage": {
32226
32882
  capName: "recording",
32227
32883
  capScope: "system",
@@ -32240,6 +32896,12 @@ Object.freeze({
32240
32896
  addonId: null,
32241
32897
  access: "view"
32242
32898
  },
32899
+ "recording.refreshStorageLocationsForMigration": {
32900
+ capName: "recording",
32901
+ capScope: "system",
32902
+ addonId: null,
32903
+ access: "create"
32904
+ },
32243
32905
  "recording.relocateFootage": {
32244
32906
  capName: "recording",
32245
32907
  capScope: "system",
@@ -32264,44 +32926,68 @@ Object.freeze({
32264
32926
  addonId: null,
32265
32927
  access: "create"
32266
32928
  },
32929
+ "recording.resumeForStorageMigration": {
32930
+ capName: "recording",
32931
+ capScope: "system",
32932
+ addonId: null,
32933
+ access: "create"
32934
+ },
32267
32935
  "recording.setDeviceConfig": {
32268
32936
  capName: "recording",
32269
32937
  capScope: "system",
32270
32938
  addonId: null,
32271
32939
  access: "create"
32272
32940
  },
32941
+ "recording.startStorageMigrationMove": {
32942
+ capName: "recording",
32943
+ capScope: "system",
32944
+ addonId: null,
32945
+ access: "create"
32946
+ },
32947
+ "recording.startStorageRebalance": {
32948
+ capName: "recording",
32949
+ capScope: "system",
32950
+ addonId: null,
32951
+ access: "create"
32952
+ },
32273
32953
  "recordingExport.cancelExport": {
32274
- capName: "recordingExport",
32954
+ capName: "recording-export",
32275
32955
  capScope: "system",
32276
32956
  addonId: null,
32277
32957
  access: "create"
32278
32958
  },
32279
32959
  "recordingExport.createExport": {
32280
- capName: "recordingExport",
32960
+ capName: "recording-export",
32281
32961
  capScope: "system",
32282
32962
  addonId: null,
32283
32963
  access: "create"
32284
32964
  },
32285
32965
  "recordingExport.deleteExport": {
32286
- capName: "recordingExport",
32966
+ capName: "recording-export",
32287
32967
  capScope: "system",
32288
32968
  addonId: null,
32289
32969
  access: "delete"
32290
32970
  },
32291
32971
  "recordingExport.getDownloadUrl": {
32292
- capName: "recordingExport",
32972
+ capName: "recording-export",
32293
32973
  capScope: "system",
32294
32974
  addonId: null,
32295
32975
  access: "view"
32296
32976
  },
32297
32977
  "recordingExport.getExport": {
32298
- capName: "recordingExport",
32978
+ capName: "recording-export",
32299
32979
  capScope: "system",
32300
32980
  addonId: null,
32301
32981
  access: "view"
32302
32982
  },
32303
32983
  "recordingExport.listExports": {
32304
- capName: "recordingExport",
32984
+ capName: "recording-export",
32985
+ capScope: "system",
32986
+ addonId: null,
32987
+ access: "view"
32988
+ },
32989
+ "recordingExport.readExportBytes": {
32990
+ capName: "recording-export",
32305
32991
  capScope: "system",
32306
32992
  addonId: null,
32307
32993
  access: "view"
@@ -32660,6 +33346,30 @@ Object.freeze({
32660
33346
  addonId: null,
32661
33347
  access: "view"
32662
33348
  },
33349
+ "storageMigration.cancel": {
33350
+ capName: "storage-migration",
33351
+ capScope: "system",
33352
+ addonId: null,
33353
+ access: "create"
33354
+ },
33355
+ "storageMigration.plan": {
33356
+ capName: "storage-migration",
33357
+ capScope: "system",
33358
+ addonId: null,
33359
+ access: "view"
33360
+ },
33361
+ "storageMigration.start": {
33362
+ capName: "storage-migration",
33363
+ capScope: "system",
33364
+ addonId: null,
33365
+ access: "create"
33366
+ },
33367
+ "storageMigration.status": {
33368
+ capName: "storage-migration",
33369
+ capScope: "system",
33370
+ addonId: null,
33371
+ access: "view"
33372
+ },
32663
33373
  "storageProvider.abortUpload": {
32664
33374
  capName: "storage-provider",
32665
33375
  capScope: "system",
@@ -33038,12 +33748,42 @@ Object.freeze({
33038
33748
  addonId: null,
33039
33749
  access: "create"
33040
33750
  },
33751
+ "terminalSession.adoptLegacyMonitor": {
33752
+ capName: "terminal-session",
33753
+ capScope: "system",
33754
+ addonId: null,
33755
+ access: "create"
33756
+ },
33041
33757
  "terminalSession.close": {
33042
33758
  capName: "terminal-session",
33043
33759
  capScope: "system",
33044
33760
  addonId: null,
33045
33761
  access: "create"
33046
33762
  },
33763
+ "terminalSession.createInstance": {
33764
+ capName: "terminal-session",
33765
+ capScope: "system",
33766
+ addonId: null,
33767
+ access: "create"
33768
+ },
33769
+ "terminalSession.deleteInstance": {
33770
+ capName: "terminal-session",
33771
+ capScope: "system",
33772
+ addonId: null,
33773
+ access: "delete"
33774
+ },
33775
+ "terminalSession.listInstances": {
33776
+ capName: "terminal-session",
33777
+ capScope: "system",
33778
+ addonId: null,
33779
+ access: "view"
33780
+ },
33781
+ "terminalSession.listLegacyCameras": {
33782
+ capName: "terminal-session",
33783
+ capScope: "system",
33784
+ addonId: null,
33785
+ access: "view"
33786
+ },
33047
33787
  "terminalSession.listProfiles": {
33048
33788
  capName: "terminal-session",
33049
33789
  capScope: "system",
@@ -33074,6 +33814,12 @@ Object.freeze({
33074
33814
  addonId: null,
33075
33815
  access: "create"
33076
33816
  },
33817
+ "terminalSession.setInstanceEnabled": {
33818
+ capName: "terminal-session",
33819
+ capScope: "system",
33820
+ addonId: null,
33821
+ access: "create"
33822
+ },
33077
33823
  "terminalSession.writeInput": {
33078
33824
  capName: "terminal-session",
33079
33825
  capScope: "system",
@@ -33618,6 +34364,104 @@ var FramerateField = number().int().min(1).max(60);
33618
34364
  var TargetsField = array(NcRuleTargetSchema).min(1);
33619
34365
  var PriorityField = number().int().min(1).max(5);
33620
34366
  /**
34367
+ * Explicit override of the DENSE sampling cadence, seconds.
34368
+ *
34369
+ * Absent ⇒ derived as `max(1s, cadenceSec / 30)` — a 30 s base samples every
34370
+ * 1 s inside a detection range. (It was `base / 10` until 2026-08-12, which
34371
+ * made that same base 3 s and rendered a person pass as two frames.)
34372
+ *
34373
+ * THE ARITHMETIC. A detection range of `rangeSec` seconds sampled every
34374
+ * `denseCadenceSec` and played at `framerate` occupies
34375
+ *
34376
+ * outputSeconds = (rangeSec / denseCadenceSec) / framerate
34377
+ *
34378
+ * 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.
34379
+ * Halving this field doubles the frames INSIDE ranges only — the base cadence,
34380
+ * and therefore the length of a quiet night, does not move.
34381
+ *
34382
+ * Floored at {@link TIMELAPSE_DENSE_FLOOR_SEC}: asking for frames faster than
34383
+ * the recording has them returns the same frames, requested twice. Must be
34384
+ * STRICTLY smaller than `cadenceSec` — a dense rate that is not denser renders
34385
+ * a uniform video the operator believes is two-rate — and upsert refuses it
34386
+ * rather than letting the export cap reject the render hours after the window.
34387
+ */
34388
+ var DenseCadenceSecField = number().min(.1).max(3600);
34389
+ /**
34390
+ * Minimum seconds of OUTPUT video each detection range must occupy.
34391
+ *
34392
+ * The operator-facing form of the arithmetic above: instead of solving for a
34393
+ * cadence, state the dwell and let the renderer solve. `minDwellSec: 1` on a
34394
+ * 30 s base at 12 fps turns a 7 s pass into a full second of video by sampling
34395
+ * that range every ~583 ms.
34396
+ *
34397
+ * ONE CADENCE SERVES EVERY RANGE. `ExportDenseSchema.everyMs` is global — the
34398
+ * ranges are terms of a single ffmpeg `select` expression that cannot vary rate
34399
+ * per term — so the MOST DEMANDING (shortest) range sets the rate and longer
34400
+ * ranges are sampled denser than they need. Per-range cadences require a cap
34401
+ * schema change and are the tracked follow-up.
34402
+ *
34403
+ * A range too short to reach the dwell even at {@link TIMELAPSE_DENSE_FLOOR_SEC}
34404
+ * is rendered with every frame that EXISTS and no more: the guarantee is capped
34405
+ * by real footage, never met by duplicating frames into motion that never
34406
+ * happened.
34407
+ */
34408
+ var MinDwellSecField = number().min(0).max(60);
34409
+ /**
34410
+ * Caption burned into the notification's preview frame.
34411
+ *
34412
+ * Same `{{var}}` vocabulary as {@link TimelapseTemplateSchema} (`camera`,
34413
+ * `rule`, `from`, `to`) and rendered by the SAME renderer — a second
34414
+ * templating dialect for one field would be a second thing to explain.
34415
+ *
34416
+ * Absent ⇒ {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}. An EMPTY STRING is the
34417
+ * operator saying "the frame, no caption" — a distinct, reachable answer, and
34418
+ * the reason this is not `.min(1)`.
34419
+ */
34420
+ var PreviewTextField = string().max(200);
34421
+ /**
34422
+ * Whether the notification's preview is a STILL or a short animation.
34423
+ *
34424
+ * The operator's ask, verbatim: *"inviato come gif o video (come per le altre
34425
+ * rule)"* — his Scrypted advanced-notifier has a `gifRule`, and a ten-hour
34426
+ * night reads better as three seconds of motion than as one frame of it. Both
34427
+ * modes get the SAME treatment (blurred frame, large centred title); `'gif'`
34428
+ * simply applies it to a dozen frames sampled across the render and assembles
34429
+ * them.
34430
+ *
34431
+ * `'image'` is the default and stays the default: a GIF costs a dozen ffmpeg
34432
+ * seeks and a palette pass, and no rule that never asked for one should start
34433
+ * paying that on the deploy that shipped it.
34434
+ *
34435
+ * A GIF that cannot be assembled DEGRADES to the still — never to nothing.
34436
+ */
34437
+ var PreviewModeField = _enum(["image", "gif"]);
34438
+ /**
34439
+ * Which detection classes the notification reports counts for.
34440
+ *
34441
+ * The counts come from the tracks the render ALREADY fetched for its dense-range
34442
+ * plan — no second query — aggregated per class. Absent or empty means "every
34443
+ * class the window actually contained", which is what an operator who never
34444
+ * opened the field wants; a list narrows it (`['person']` on a driveway that
34445
+ * counts cars all night).
34446
+ *
34447
+ * Class names are the tracker's own (`person`, `vehicle`, `animal`, `package`,
34448
+ * …). An unknown name simply never matches and reports nothing — it is not an
34449
+ * error, because a rule may legitimately name a class this camera's model does
34450
+ * not emit.
34451
+ *
34452
+ * The counts are exposed to {@link TimelapseTemplateSchema} as:
34453
+ * - `{{detections}}` — total over the reported classes
34454
+ * - `{{detectionSummary}}` — `2 persone, 1 veicolo`
34455
+ * - `{{count_person}}` / `{{count_vehicle}}` / `{{count_animal}}` / … —
34456
+ * one per class, `count_` + the class name
34457
+ *
34458
+ * With NO custom body template the summary is appended to the derived body, and
34459
+ * only when the total is non-zero: a nightly `0 rilevamenti` is a line nobody
34460
+ * reads. With a custom template the operator owns every word — nothing is
34461
+ * appended, so `{{detectionSummary}}` is how he asks for it.
34462
+ */
34463
+ var ReportClassesField = array(string().min(1).max(40)).max(20);
34464
+ /**
33621
34465
  * Client-supplied timelapse-rule fields. The server stamps id / createdBy /
33622
34466
  * createdAt / updatedAt / ownerUserId / lastGeneratedAt — none of them appear
33623
34467
  * here (see the ownership note above).
@@ -33637,9 +34481,30 @@ var TimelapseRuleInputSchema = object({
33637
34481
  cadenceSec: CadenceSecField.default(15),
33638
34482
  /** Output frames per second of the assembled mp4 (predecessor parity). */
33639
34483
  framerate: FramerateField.default(10),
34484
+ /**
34485
+ * Explicit dense cadence — see {@link DenseCadenceSecField}. Absent ⇒ derived
34486
+ * as `max(1s, cadenceSec / 30)`, which is what every rule written before this
34487
+ * field gets.
34488
+ */
34489
+ denseCadenceSec: DenseCadenceSecField.optional(),
34490
+ /** Output-seconds guarantee per detection range — see {@link MinDwellSecField}. */
34491
+ minDwellSec: MinDwellSecField.optional(),
33640
34492
  /** `notification-output` targets the finished video/thumbnail is sent to. */
33641
34493
  targets: TargetsField,
33642
34494
  template: TimelapseTemplateSchema.optional(),
34495
+ /**
34496
+ * Caption on the notification's PREVIEW FRAME — see {@link PreviewTextField}
34497
+ * and {@link DEFAULT_TIMELAPSE_PREVIEW_TEXT}.
34498
+ *
34499
+ * Deliberately NOT part of {@link TimelapseTemplateSchema}: that object is
34500
+ * the notification's title/body, and clearing it (`template: null`) must not
34501
+ * silently clear the caption too.
34502
+ */
34503
+ previewText: PreviewTextField.optional(),
34504
+ /** Still or animation — see {@link PreviewModeField}. */
34505
+ previewMode: PreviewModeField.default("image"),
34506
+ /** Classes the notification counts — see {@link ReportClassesField}. */
34507
+ reportClasses: ReportClassesField.optional(),
33643
34508
  /** Canonical notification priority ordinal (1..5); per-target overridable. */
33644
34509
  priority: PriorityField.default(3)
33645
34510
  });
@@ -33650,8 +34515,13 @@ object({
33650
34515
  schedule: NcScheduleSchema.optional(),
33651
34516
  cadenceSec: CadenceSecField.optional(),
33652
34517
  framerate: FramerateField.optional(),
34518
+ denseCadenceSec: DenseCadenceSecField.optional(),
34519
+ minDwellSec: MinDwellSecField.optional(),
33653
34520
  targets: TargetsField.optional(),
33654
34521
  template: TimelapseTemplateSchema.nullable().optional(),
34522
+ previewText: PreviewTextField.optional(),
34523
+ previewMode: PreviewModeField.optional(),
34524
+ reportClasses: ReportClassesField.optional(),
33655
34525
  priority: PriorityField.optional()
33656
34526
  });
33657
34527
  TimelapseRuleInputSchema.extend({
@@ -33663,10 +34533,28 @@ TimelapseRuleInputSchema.extend({
33663
34533
  */
33664
34534
  ownerUserId: string().optional(),
33665
34535
  /**
33666
- * Epoch-ms of the last successful generation the 1-hour re-generation
33667
- * guard's durable state (predecessor parity). Absent = never generated.
34536
+ * Epoch-ms of the NEWEST successful generation across every camera of this
34537
+ * rule. What a UI shows, and the compatibility floor for
34538
+ * {@link readTimelapseGeneratedAt}. Absent = never generated.
33668
34539
  */
33669
34540
  lastGeneratedAt: number().optional(),
34541
+ /**
34542
+ * PER-CAMERA generation state, keyed by `String(deviceId)` — the
34543
+ * re-generation guard's real durable state.
34544
+ *
34545
+ * One rule covers several cameras and each renders its own video, so a rule
34546
+ * -wide stamp is wrong in the direction that DESTROYS work: camera A
34547
+ * succeeding at 06:05 tells camera B, whose render failed, that it is
34548
+ * already done — and B's night is gone for good, because the window will not
34549
+ * come back.
34550
+ *
34551
+ * ADDITIVE, so the migration is free: a row written before this field simply
34552
+ * has no map, and {@link readTimelapseGeneratedAt} falls back to
34553
+ * {@link TimelapseRuleSchema.shape.lastGeneratedAt}. Reading an old row as
34554
+ * "never generated" would re-render and re-notify every camera of every rule
34555
+ * once, on the deploy that shipped the map.
34556
+ */
34557
+ generatedByDevice: record(string(), number()).optional(),
33670
34558
  /** userId of the caller who created the rule (server-stamped). */
33671
34559
  createdBy: string(),
33672
34560
  createdAt: number(),