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